git-ai-control 0.4.8 → 0.4.9

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  本项目的所有重要变更都会记录在此文件中。
4
4
 
5
+ ## [0.4.9] - 2026-08-12
6
+
7
+ ### 修复
8
+
9
+ - 顶部版本标记改为由配置中心构建版本自动注入,不再误显示本机 Git AI 二进制版本。
10
+
5
11
  ## [0.4.8] - 2026-08-12
6
12
 
7
13
  ### 新增
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-ai-control",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Git AI 本地配置与上传隐私控制面板",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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
  `},rs=0,is=[];function as(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(rs++)[0],a=_.useState(Do)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ro([e.lockRef.current],(e.shards||[]).map(es),!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=Qo(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=Go(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Go(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 Zo(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!is.length||is[is.length-1]!==a)){var r=`deltaY`in n?$o(n):Qo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ts(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(es).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:os(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Qo(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,$o(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Qo(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return is.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Bo),document.addEventListener(`touchmove`,c,Bo),document.addEventListener(`touchstart`,u,Bo),function(){is=is.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Bo),document.removeEventListener(`touchmove`,c,Bo),document.removeEventListener(`touchstart`,u,Bo)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:ns(i)}):null,p?_.createElement(Lo,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function os(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ss=go(_o,as),cs=_.forwardRef(function(e,t){return _.createElement(yo,to({},e,{ref:t,sideCar:ss}))});cs.classNames=yo.classNames;var ls=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},us=new WeakMap,ds=new WeakMap,fs={},ps=0,ms=function(e){return e&&(e.host||ms(e.parentNode))},hs=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ms(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})},gs=function(e,t,n,r){var i=hs(t,Array.isArray(e)?e:[e]);fs[n]||(fs[n]=new WeakMap);var a=fs[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=(us.get(e)||0)+1,l=(a.get(e)||0)+1;us.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ds.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(),ps++,function(){o.forEach(function(e){var t=us.get(e)-1,i=a.get(e)-1;us.set(e,t),a.set(e,i),t||(ds.has(e)||e.removeAttribute(r),ds.delete(e)),i||e.removeAttribute(n)}),ps--,ps||(us=new WeakMap,us=new WeakMap,ds=new WeakMap,fs={})}},_s=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ls(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),gs(r,i,n,`aria-hidden`)):function(){return null}},vs=Object.defineProperty,ys=(e,t)=>vs(e,`name`,{value:t,configurable:!0}),bs=`Dialog`,[xs,Ss]=pi(bs),[Cs,ws]=xs(bs),Ts=ys(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=Ui({prop:r,defaultProp:i??!1,onChange:a,caller:bs}),[d,f]=_.useState(0),[p,m]=_.useState(0);return(0,S.jsx)(Cs,{scope:t,triggerRef:s,contentRef:c,contentId:sa(),titleId:sa(),descriptionId:sa(),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`),Es=`DialogTrigger`,Ds=_.forwardRef(ys(function(e,t){let{__scopeDialog:n,...r}=e,i=ws(Es,n),a=zr(t,i.triggerRef);return(0,S.jsx)(ii.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:V(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Os=`DialogPortal`,[ks,As]=xs(Os,{forceMount:void 0}),js=ys(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ws(Os,t);return(0,S.jsx)(ks,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,S.jsx)(Zi,{present:n||a.open,children:(0,S.jsx)(qa,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Ms=`DialogOverlay`,Ns=_.forwardRef(ys(function(e,t){let n=As(Ms,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ws(Ms,e.__scopeDialog);return a.modal?(0,S.jsx)(Zi,{present:r||a.open,children:(0,S.jsx)(Fs,{...i,ref:t})}):null},`DialogOverlay`)),Ps=Hr(`DialogOverlay.RemoveScroll`),Fs=_.forwardRef(ys(function(e,t){let{__scopeDialog:n,...r}=e,i=ws(Ms,n),a=zr(t,Ca());return(0,S.jsx)(cs,{as:Ps,allowPinchZoom:!0,shards:[i.contentRef],children:(0,S.jsx)(ii.div,{"data-state":qs(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Is=`DialogContent`,Ls=_.forwardRef(ys(function(e,t){let n=As(Is,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ws(Is,e.__scopeDialog);return(0,S.jsx)(Zi,{present:r||a.open,children:a.modal?(0,S.jsx)(Rs,{...i,ref:t}):(0,S.jsx)(zs,{...i,ref:t})})},`DialogContent`)),Rs=_.forwardRef(ys(function(e,t){let n=ws(Is,e.__scopeDialog),r=_.useRef(null),i=zr(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return _s(e)},[]),(0,S.jsx)(Bs,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),zs=_.forwardRef(ys(function(e,t){let n=ws(Is,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,S.jsx)(Bs,{...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`)),Bs=_.forwardRef(ys(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ws(Is,n);return $a(),(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(Pa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,S.jsx)(Sa,{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`)),Vs=`DialogTitle`,Hs=_.forwardRef(ys(function(e,t){let{__scopeDialog:n,...r}=e,i=ws(Vs,n),{setTitleCount:a}=i;return Pi(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,S.jsx)(ii.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Us=`DialogDescription`,Ws=_.forwardRef(ys(function(e,t){let{__scopeDialog:n,...r}=e,i=ws(Us,n),{setDescriptionCount:a}=i;return Pi(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,S.jsx)(ii.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Gs=`DialogClose`,Ks=_.forwardRef(ys(function(e,t){let{__scopeDialog:n,...r}=e,i=ws(Gs,n);return(0,S.jsx)(ii.button,{type:`button`,...r,ref:t,onClick:V(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function qs(e){return e?`open`:`closed`}ys(qs,`getState`);var Js=Object.defineProperty,Ys=(e,t)=>Js(e,`name`,{value:t,configurable:!0}),[Xs,Zs]=pi(`AlertDialog`,[Ss]),Qs=Ss(),$s=Ys(e=>{let{__scopeAlertDialog:t,...n}=e,r=Qs(t);return(0,S.jsx)(Ts,{...r,...n,modal:!0})},`AlertDialog`),ec=_.forwardRef(Ys(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qs(n);return(0,S.jsx)(Ds,{...i,...r,ref:t})},`AlertDialogTrigger`)),tc=Ys(e=>{let{__scopeAlertDialog:t,...n}=e,r=Qs(t);return(0,S.jsx)(js,{...r,...n})},`AlertDialogPortal`),nc=_.forwardRef(Ys(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qs(n);return(0,S.jsx)(Ns,{...i,...r,ref:t})},`AlertDialogOverlay`)),[rc,ic]=Xs(`AlertDialogContent`),ac=_.forwardRef(Ys(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Qs(n),o=zr(t,_.useRef(null)),s=_.useRef(null);return(0,S.jsx)(rc,{scope:n,cancelRef:s,children:(0,S.jsx)(Ls,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:V(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),oc=_.forwardRef(Ys(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qs(n);return(0,S.jsx)(Hs,{...i,...r,ref:t})},`AlertDialogTitle`)),sc=_.forwardRef(Ys(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qs(n);return(0,S.jsx)(Ws,{...i,...r,ref:t})},`AlertDialogDescription`)),cc=_.forwardRef(Ys(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qs(n);return(0,S.jsx)(Ks,{...i,...r,ref:t})},`AlertDialogAction`)),lc=`AlertDialogCancel`,uc=_.forwardRef(Ys(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=ic(lc,n),a=Qs(n),o=zr(t,i);return(0,S.jsx)(Ks,{...a,...r,ref:o})},`AlertDialogCancel`)),dc=$s,fc=ec,pc=tc,mc=nc,hc=ac,gc=cc,_c=uc,vc=oc,yc=sc,bc=Object.defineProperty,xc=(e,t)=>bc(e,`name`,{value:t,configurable:!0});function Sc(e){let[t,n]=_.useState(void 0);return Pi(()=>{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}xc(Sc,`useSize`);var Cc=[`top`,`right`,`bottom`,`left`],wc=Math.min,Tc=Math.max,Ec=Math.round,Dc=Math.floor,Oc=e=>({x:e,y:e}),kc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ac(e,t,n){return Tc(e,wc(t,n))}function jc(e,t){return typeof e==`function`?e(t):e}function Mc(e){return e.split(`-`)[0]}function Nc(e){return e.split(`-`)[1]}function Pc(e){return e===`x`?`y`:`x`}function Fc(e){return e===`y`?`height`:`width`}function Ic(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Lc(e){return Pc(Ic(e))}function Rc(e,t,n){n===void 0&&(n=!1);let r=Nc(e),i=Lc(e),a=Fc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qc(o)),[o,qc(o)]}function zc(e){let t=qc(e);return[Bc(e),t,Bc(t)]}function Bc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Vc=[`left`,`right`],Hc=[`right`,`left`],Uc=[`top`,`bottom`],Wc=[`bottom`,`top`];function Gc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Hc:Vc:t?Vc:Hc;case`left`:case`right`:return t?Uc:Wc;default:return[]}}function Kc(e,t,n,r){let i=Nc(e),a=Gc(Mc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Bc)))),a}function qc(e){let t=Mc(e);return kc[t]+e.slice(t.length)}function Jc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Yc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Jc(e)}function Xc(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 Zc(e,t,n){let{reference:r,floating:i}=e,a=Ic(t),o=Lc(t),s=Fc(o),c=Mc(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=Nc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Qc(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}=jc(t,e),p=Yc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Xc(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=Xc(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 $c=50,el=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Qc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Zc(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<$c&&(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}=Zc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},tl=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}=jc(e,t)||{};if(l==null)return{};let d=Yc(u),f={x:n,y:r},p=Lc(i),m=Fc(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=wc(d[_],T),D=wc(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=Ac(E,k,O),A=!c.arrow&&Nc(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,j=A?k<E?k-E:k-O:0;return{[p]:f[p]+j,data:{[p]:ee,centerOffset:k-ee-j,...A&&{alignmentOffset:j}},reset:A}}}),nl=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}=jc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Mc(r),_=Ic(o),v=Mc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qc(o)]:zc(o)),x=p!==`none`;!d&&x&&b.push(...Kc(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=Rc(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`&&_!==Ic(t))||T.every(e=>Ic(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=Ic(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 rl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function il(e){return Cc.some(t=>e[t]>=0)}var al=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=jc(e,t);switch(i){case`referenceHidden`:{let e=rl(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:il(e)}}}case`escaped`:{let e=rl(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:il(e)}}}default:return{}}}}},ol=new Set([`left`,`top`]);async function sl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Mc(n),s=Nc(n),c=Ic(n)===`y`,l=ol.has(o)?-1:1,u=a&&c?-1:1,d=jc(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 cl=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 sl(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}}}}},ll=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}=jc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ic(i),p=Pc(f),m=u[p],h=u[f],g=(e,t)=>Ac(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}}}}}},ul=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}=jc(e,t),u={x:n,y:r},d=Ic(i),f=Pc(d),p=u[f],m=u[d],h=jc(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=ol.has(Mc(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}}}},dl=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}=jc(e,t),c=await i.detectOverflow(t,s),l=Mc(n),u=Nc(n),d=Ic(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=wc(p-c[m],g),y=wc(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*Tc(c.left,c.right):S=p-2*Tc(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 fl(){return typeof window<`u`}function pl(e){return gl(e)?(e.nodeName||``).toLowerCase():`#document`}function ml(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hl(e){return((gl(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function gl(e){return fl()?e instanceof Node||e instanceof ml(e).Node:!1}function _l(e){return fl()?e instanceof Element||e instanceof ml(e).Element:!1}function vl(e){return fl()?e instanceof HTMLElement||e instanceof ml(e).HTMLElement:!1}function yl(e){return!fl()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ml(e).ShadowRoot}function bl(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=jl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function xl(e){return/^(table|td|th)$/.test(pl(e))}function Sl(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Cl=/transform|translate|scale|rotate|perspective|filter/,wl=/paint|layout|strict|content/,Tl=e=>!!e&&e!==`none`,El;function Dl(e){let t=_l(e)?jl(e):e;return Tl(t.transform)||Tl(t.translate)||Tl(t.scale)||Tl(t.rotate)||Tl(t.perspective)||!kl()&&(Tl(t.backdropFilter)||Tl(t.filter))||Cl.test(t.willChange||``)||wl.test(t.contain||``)}function Ol(e){let t=Nl(e);for(;vl(t)&&!Al(t);){if(Dl(t))return t;if(Sl(t))return null;t=Nl(t)}return null}function kl(){return El??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),El}function Al(e){return/^(html|body|#document)$/.test(pl(e))}function jl(e){return ml(e).getComputedStyle(e)}function Ml(e){return _l(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nl(e){if(pl(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||yl(e)&&e.host||hl(e);return yl(t)?t.host:t}function Pl(e){let t=Nl(e);return Al(t)?(e.ownerDocument||e).body:vl(t)&&bl(t)?t:Pl(t)}function Fl(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Pl(e),i=r===e.ownerDocument?.body,a=ml(r);if(i){let e=Il(a);return t.concat(a,a.visualViewport||[],bl(r)?r:[],e&&n?Fl(e):[])}else return t.concat(r,Fl(r,[],n))}function Il(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ll(e){let t=jl(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=vl(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ec(n)!==a||Ec(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Rl(e){return _l(e)?e:e.contextElement}function zl(e){let t=Rl(e);if(!vl(t))return Oc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ll(t),o=(a?Ec(n.width):n.width)/r,s=(a?Ec(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var G=Oc(0);function Bl(e){let t=ml(e);return!kl()||!t.visualViewport?G:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function K(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ml(e)}function q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Rl(e),o=Oc(1);t&&(r?_l(r)&&(o=zl(r)):o=zl(e));let s=K(a,n,r)?Bl(a):Oc(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=ml(a),t=_l(r)?ml(r):r,n=e,i=Il(n);for(;i&&t!==n;){let e=zl(i),t=i.getBoundingClientRect(),r=jl(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=ml(i),i=Il(n)}}return Xc({width:u,height:d,x:c,y:l})}function J(e,t){let n=Ml(e).scrollLeft;return t?t.left+n:q(hl(e)).left+n}function Vl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-J(e,n),y:n.top+t.scrollTop}}function Hl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=hl(r),s=t?Sl(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Oc(1),u=Oc(0),d=vl(r);if((d||!a)&&((pl(r)!==`body`||bl(o))&&(c=Ml(r)),d)){let e=q(r);l=zl(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vl(o,c):Oc(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 Ul(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Wl(e){let t=Ml(e),n=e.ownerDocument.body,r=Tc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Tc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+J(e),o=-t.scrollTop;return jl(n).direction===`rtl`&&(a+=Tc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Gl=25;function Kl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ml(e),a=hl(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!kl()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(J(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<=Gl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ql(e,t){let n=q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=zl(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Jl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Kl(e,n,t);else if(t===`document`)r=Wl(hl(e));else if(_l(t))r=ql(t,n);else{let n=Bl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Xc(r)}function Yl(e,t){let n=t.get(e);if(n)return n;let r=Fl(e,[],!1).filter(e=>_l(e)&&pl(e)!==`body`),i=null,a=jl(e).position===`fixed`,o=a?Nl(e):e;for(;_l(o)&&!Al(o);){let e=jl(o),t=Dl(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Nl(o)}return t.set(e,r),r}function Xl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Sl(t)?[]:Yl(t,this._c):[].concat(n),r],o=Jl(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=Jl(t,a[e],i);s=Tc(n.top,s),c=wc(n.right,c),l=wc(n.bottom,l),u=Tc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Zl(e){let{width:t,height:n}=Ll(e);return{width:t,height:n}}function Ql(e,t,n){let r=vl(t),i=hl(t),a=n===`fixed`,o=q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Oc(0);if((r||!a)&&((pl(t)!==`body`||bl(i))&&(s=Ml(t)),r)){let e=q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=J(i));let l=i&&!r&&!a?Vl(i,s):Oc(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 $l(e){return jl(e).position===`static`}function eu(e,t){if(!vl(e)||jl(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return hl(e)===n&&(n=n.ownerDocument.body),n}function tu(e,t){let n=ml(e);if(Sl(e))return n;if(!vl(e)){let t=Nl(e);for(;t&&!Al(t);){if(_l(t)&&!$l(t))return t;t=Nl(t)}return n}let r=eu(e,t);for(;r&&xl(r)&&$l(r);)r=eu(r,t);return r&&Al(r)&&$l(r)&&!Dl(r)?n:r||Ol(e)||n}var nu=async function(e){let t=this.getOffsetParent||tu,n=this.getDimensions,r=await n(e.floating);return{reference:Ql(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ru(e){return jl(e).direction===`rtl`}var iu={convertOffsetParentRelativeRectToViewportRelativeRect:Hl,getDocumentElement:hl,getClippingRect:Xl,getOffsetParent:tu,getElementRects:nu,getClientRects:Ul,getDimensions:Zl,getScale:zl,isElement:_l,isRTL:ru};function au(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ou(e,t,n){let r=null,i,a=hl(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=Dc(d),h=Dc(a.clientWidth-(u+f)),g=Dc(a.clientHeight-(d+p)),_=Dc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Tc(0,wc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!au(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=ml(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function su(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=Rl(e),u=i||a?[...l?Fl(l):[],...t?Fl(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ou(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?q(e):null;c&&g();function g(){let t=q(e);h&&!au(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 cu=cl,lu=ll,uu=nl,du=dl,fu=al,pu=tl,mu=ul,hu=(e,t,n)=>{let r=new Map,i=n??{},a={...iu,...i.platform,_c:r};return el(e,t,{...i,platform:a})},gu=typeof document<`u`?_.useLayoutEffect:function(){};function _u(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(!_u(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)&&!_u(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function vu(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yu(e,t){let n=vu(e);return Math.round(t*n)/n}function bu(e){let t=_.useRef(e);return gu(()=>{t.current=e}),t}function xu(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);_u(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=bu(c),O=bu(i),k=bu(l),ee=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),hu(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};A.current&&!_u(T.current,t)&&(T.current=t,ir.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);gu(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=_.useRef(!1);gu(()=>(A.current=!0,()=>{A.current=!1}),[]),gu(()=>{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 j=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),M=_.useMemo(()=>({reference:x,floating:S}),[x,S]),N=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=yu(M.floating,u.x),r=yu(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...vu(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:ee,refs:j,elements:M,floatingStyles:N}),[u,ee,j,M,N])}var Su=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?{}:pu({element:r.current,padding:i}).fn(n):r?pu({element:r,padding:i}).fn(n):{}}}},Cu=(e,t)=>{let n=cu(e);return{name:n.name,fn:n.fn,options:[e,t]}},wu=(e,t)=>{let n=lu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tu=(e,t)=>({fn:mu(e).fn,options:[e,t]}),Eu=(e,t)=>{let n=uu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Du=(e,t)=>{let n=du(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ou=(e,t)=>{let n=fu(e);return{name:n.name,fn:n.fn,options:[e,t]}},ku=(e,t)=>{let n=Su(e);return{name:n.name,fn:n.fn,options:[e,t]}},Au=Object.defineProperty,ju=_.forwardRef(((e,t)=>Au(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,S.jsx)(ii.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`)),Mu=Object.defineProperty,Nu=(e,t)=>Mu(e,`name`,{value:t,configurable:!0}),Pu=`Popper`,[Fu,Iu]=pi(Pu),[Lu,Ru]=Fu(Pu),zu=Nu(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,S.jsx)(Lu,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Bu=`PopperAnchor`,Vu=_.forwardRef(Nu(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ru(Bu,n),o=_.useRef(null),s=a.onAnchorChange,c=zr(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&&Zu(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,S.jsx)(ii.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Hu=`PopperContent`,[Uu,Wu]=Fu(Hu),Gu=_.forwardRef(Nu(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=Ru(Hu,n),[v,y]=_.useState(null),b=zr(t,y),[x,C]=_.useState(null),w=Sc(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(Yu),altBoundary:ee},{refs:j,floatingStyles:M,placement:N,isPositioned:te,middlewareData:P}=xu({strategy:`fixed`,placement:D,whileElementsMounted:Nu((...e)=>su(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Cu({mainAxis:i+E,alignmentAxis:o}),c&&wu({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Tu():void 0,...A}),c&&Eu({...A}),Du({...A,apply:Nu(({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&&ku({element:x,padding:s}),Xu({arrowWidth:T,arrowHeight:E}),f&&Ou({strategy:`referenceHidden`,...A,boundary:ee?A.boundary:void 0})]}),F=g.setPlacementState;Pi(()=>(F(N),()=>{F(void 0)}),[N,F]);let[ne,re]=Zu(N),ie=ma(m);Pi(()=>{te&&ie?.()},[te,ie]);let ae=P.arrow?.x,I=P.arrow?.y,L=P.arrow?.centerOffset!==0,[oe,R]=_.useState();return Pi(()=>{v&&R(window.getComputedStyle(v).zIndex)},[v]),(0,S.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:te?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,S.jsx)(Uu,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:C,arrowX:ae,arrowY:I,shouldHideArrow:L,children:(0,S.jsx)(ii.div,{"data-side":ne,"data-align":re,...h,ref:b,style:{...h.style,animation:te?h.style?.animation:`none`}})})})},`PopperContent`)),Ku=`PopperArrow`,qu={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ju=_.forwardRef(Nu(function(e,t){let{__scopePopper:n,...r}=e,i=Wu(Ku,n),a=qu[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)(ju,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Yu(e){return e!==null}Nu(Yu,`isNotNull`);var Xu=Nu(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]=Zu(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 Zu(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Nu(Zu,`getSideAndAlignFromPlacement`);var Qu=zu,$u=Vu,ed=Gu,td=Ju,nd=Object.defineProperty,rd=(e,t)=>nd(e,`name`,{value:t,configurable:!0}),id=!1;function ad(){let[e,t]=_.useState(id);return _.useEffect(()=>{id||(id=!0,t(!0))},[]),e}rd(ad,`useIsHydrated`);var od=_.useSyncExternalStore;function sd(){return()=>{}}rd(sd,`subscribe`);function cd(){return od(sd,()=>!0,()=>!1)}rd(cd,`useIsHydratedModern`);var ld=typeof od==`function`?cd:ad,ud=Object.defineProperty,dd=(e,t)=>ud(e,`name`,{value:t,configurable:!0}),fd=`rovingFocusGroup.onEntryFocus`,pd={bubbles:!1,cancelable:!0},md=`RovingFocusGroup`,[hd,gd,_d]=_i(md),[vd,yd]=pi(md,[_d]),[bd,xd]=vd(md),Sd=_.forwardRef(dd(function(e,t){return(0,S.jsx)(hd.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,S.jsx)(hd.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,S.jsx)(Y,{...e,ref:t})})})},`RovingFocusGroup`)),Y=_.forwardRef(dd(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=zr(t,f),m=da(a),[h,g]=Ui({prop:o,defaultProp:s??null,onChange:c,caller:md}),[v,y]=_.useState(!1),b=ma(l),x=gd(n),C=_.useRef(!1),[w,T]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(fd,b),()=>e.removeEventListener(fd,b)},[b]),(0,S.jsx)(bd,{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)(ii.div,{tabIndex:v||w===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(fd,pd);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Od([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}C.current=!1}),onBlur:V(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Cd=`RovingFocusGroupItem`,wd=_.forwardRef(dd(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=sa(),l=a||c,u=xd(Cd,n),d=u.currentTabStopId===l,f=gd(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=ld();return Pi(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),_.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,S.jsx)(hd.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,S.jsx)(ii.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:V(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:V(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Dd(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?kd(n,r+1):n.slice(r+1)}setTimeout(()=>Od(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Td={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ed(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}dd(Ed,`getDirectionAwareKey`);function Dd(e,t,n){let r=Ed(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Td[r]}dd(Dd,`getFocusIntent`);function Od(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}dd(Od,`focusFirst`);function kd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}dd(kd,`wrapArray`);var Ad=Sd,jd=wd,Md=Object.defineProperty,Nd=_.forwardRef(((e,t)=>Md(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,S.jsx)(ii.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Pd=Object.defineProperty,Fd=(e,t)=>Pd(e,`name`,{value:t,configurable:!0}),Id=`horizontal`,Ld=[`horizontal`,`vertical`],Rd=_.forwardRef(Fd(function(e,t){let{decorative:n,orientation:r=Id,...i}=e,a=zd(r)?r:Id,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,S.jsx)(ii.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function zd(e){return Ld.includes(e)}Fd(zd,`isValidOrientation`);var Bd=Rd,Vd=Object.defineProperty,Hd=(e,t)=>Vd(e,`name`,{value:t,configurable:!0}),Ud=`Switch`,[Wd,Gd]=pi(Ud),[Kd,qd]=Wd(Ud);function Jd(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]=Ui({prop:n,defaultProp:i??!1,onChange:c,caller:Ud}),[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)(Kd,{scope:t,...C,children:nf(d)?d(C):r})}Hd(Jd,`SwitchProvider`);var Yd=`SwitchTrigger`,Xd=_.forwardRef(Hd(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}=qd(Yd,e),g=zr(r,u),v=_.useRef(c);return _.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=Hd(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,S.jsx)(ii.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":rf(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:g,onClick:V(t,e=>{p(),d(e=>!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),Zd=_.forwardRef(Hd(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)(Jd,{__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)(Xd,{...d,ref:t,__scopeSwitch:n}),e&&(0,S.jsx)(tf,{__scopeSwitch:n})]})})},`Switch`)),Qd=`SwitchThumb`,$d=_.forwardRef(Hd(function(e,t){let{__scopeSwitch:n,...r}=e,i=qd(Qd,n);return(0,S.jsx)(ii.span,{"data-state":rf(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),ef=`SwitchBubbleInput`,tf=_.forwardRef(Hd(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}=qd(ef,e),g=zr(r,h),v=Sc(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)(ii.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:V(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function nf(e){return typeof e==`function`}Hd(nf,`isFunction`);function rf(e){return e?`checked`:`unchecked`}Hd(rf,`getState`);var af=Object.defineProperty,of=(e,t)=>af(e,`name`,{value:t,configurable:!0}),sf=`Tabs`,[cf,lf]=pi(sf,[yd]),uf=yd(),[df,ff]=cf(sf),pf=_.forwardRef(of(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=da(s),[d,f]=Ui({prop:r,onChange:i,defaultProp:a??``,caller:sf});return(0,S.jsx)(df,{scope:n,baseId:sa(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,S.jsx)(ii.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),mf=`TabsList`,hf=_.forwardRef(of(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=ff(mf,n),o=uf(n);return(0,S.jsx)(Ad,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,S.jsx)(ii.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),gf=`TabsTrigger`,_f=_.forwardRef(of(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=ff(gf,n),s=uf(n),c=bf(o.baseId,r),l=xf(o.baseId,r),u=r===o.value;return(0,S.jsx)(jd,{asChild:!0,...s,focusable:!i,active:u,children:(0,S.jsx)(ii.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:V(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:V(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:V(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),vf=`TabsContent`,yf=_.forwardRef(of(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=ff(vf,n),c=bf(s.baseId,r),l=xf(s.baseId,r),u=r===s.value,d=_.useRef(u);return _.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,S.jsx)(Zi,{present:i||u,children:({present:n})=>(0,S.jsx)(ii.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 bf(e,t){return`${e}-trigger-${t}`}of(bf,`makeTriggerId`);function xf(e,t){return`${e}-content-${t}`}of(xf,`makeContentId`);var Sf=pf,Cf=hf,wf=_f,Tf=yf,Ef=Object.defineProperty,Df=(e,t)=>Ef(e,`name`,{value:t,configurable:!0}),[Of,kf]=pi(`Tooltip`,[Iu]),Af=Iu(),jf=`TooltipProvider`,Mf=700,Nf=`tooltip.open`,[Pf,Ff]=Of(jf),If=Df(e=>{let{__scopeTooltip:t,delayDuration:n=Mf,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)(Pf,{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`),Lf=`Tooltip`,[Rf,zf]=Of(Lf),Bf=Df(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Ff(Lf,e.__scopeTooltip),l=Af(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=sa(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=Ui({prop:r,defaultProp:i??!1,onChange:Df(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Nf))):c.onClose(),a?.(e)},`onChange`),caller:Lf}),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)(Qu,{...l,children:(0,S.jsx)(Rf,{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`),Vf=`TooltipTrigger`,Hf=_.forwardRef(Df(function(e,t){let{__scopeTooltip:n,...r}=e,i=zf(Vf,n),a=Ff(Vf,n),o=Af(n),s=zr(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)($u,{asChild:!0,...o,children:(0,S.jsx)(ii.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:V(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:V(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:V(e.onBlur,i.onClose),onClick:V(e.onClick,i.onClose)})})},`TooltipTrigger`)),Uf=`TooltipPortal`,[Wf,Gf]=Of(Uf,{forceMount:void 0}),Kf=Df(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=zf(Uf,t);return(0,S.jsx)(Wf,{scope:t,forceMount:n,children:(0,S.jsx)(Zi,{present:n||a.open,children:(0,S.jsx)(qa,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),qf=`TooltipContent`,Jf=_.forwardRef(Df(function(e,t){let n=Gf(qf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=zf(qf,e.__scopeTooltip);return(0,S.jsx)(Zi,{present:r||o.open,children:o.disableHoverableContent?(0,S.jsx)(Zf,{side:i,...a,ref:t}):(0,S.jsx)(Yf,{side:i,...a,ref:t})})},`TooltipContent`)),Yf=_.forwardRef(Df(function(e,t){let n=zf(qf,e.__scopeTooltip),r=Ff(qf,e.__scopeTooltip),i=_.useRef(null),a=zr(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=ep(r,$f(r,n.getBoundingClientRect())),a=tp(t.getBoundingClientRect()),o=rp([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=Df(e=>p(e,u),`handleTriggerLeave`),t=Df(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=Df(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!np(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)(Zf,{...e,ref:a})},`TooltipContentHoverable`)),Xf=Gr(`TooltipContent`),Zf=_.forwardRef(Df(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=zf(qf,n),u=Af(n),{onClose:d}=l;_.useEffect(()=>(document.addEventListener(Nf,d),()=>document.removeEventListener(Nf,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=Df(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 Pi(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,S.jsx)(Sa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,S.jsxs)(ed,{"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)(Xf,{children:r}),i?(0,S.jsx)(li,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Qf=_.forwardRef(Df(function(e,t){let{__scopeTooltip:n,...r}=e,i=Af(n);return(0,S.jsx)(td,{...i,...r,ref:t})},`TooltipArrow`));function $f(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`)}}Df($f,`getExitSideFromRect`);function ep(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}Df(ep,`getPaddedExitPoints`);function tp(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}]}Df(tp,`getPointsFromRect`);function np(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}Df(np,`isPointInPolygon`);function rp(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)),ip(t)}Df(rp,`getHull`);function ip(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)}Df(ip,`getHullPresorted`);var ap=If,op=Bf,sp=Hf,cp=Kf,lp=Jf,up=Qf;function dp(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=dp(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function fp(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=dp(e))&&(r&&(r+=` `),r+=t);return r}var pp=(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},mp=(e,t)=>({classGroupId:e,validator:t}),hp=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),gp=`-`,_p=[],vp=`arbitrary..`,yp=e=>{let t=Sp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return xp(e);let n=e.split(gp);return bp(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?pp(i,t):t:i||_p}return n[e]||_p}}},bp=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=bp(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(gp):e.slice(t).join(gp),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},xp=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?vp+r:void 0})(),Sp=e=>{let{theme:t,classGroups:n}=e;return Cp(n,t)},Cp=(e,t)=>{let n=hp();for(let r in e){let i=e[r];wp(i,n,r,t)}return n},wp=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Tp(i,t,n,r)}},Tp=(e,t,n,r)=>{if(typeof e==`string`){Ep(e,t,n);return}if(typeof e==`function`){Dp(e,t,n,r);return}Op(e,t,n,r)},Ep=(e,t,n)=>{let r=e===``?t:kp(t,e);r.classGroupId=n},Dp=(e,t,n,r)=>{if(Ap(e)){wp(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mp(n,e))},Op=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];wp(o,kp(t,a),n,r)}},kp=(e,t)=>{let n=e,r=t.split(gp),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=hp(),n.nextPart.set(t,i)),n=i}return n},Ap=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,jp=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)}}},Mp=`!`,Np=`:`,Pp=[],Fp=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ip=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===Np){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(Mp)?(c=s.slice(0,-1),l=!0):s.startsWith(Mp)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Fp(t,l,c,u)};if(t){let e=t+Np,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Fp(Pp,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Lp=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}},Rp=e=>({cache:jp(e.cacheSize),parseClassName:Ip(e),sortModifiers:Lp(e),postfixLookupClassGroupIds:zp(e),...yp(e)}),zp=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},Bp=/\s+/,Vp=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Bp),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?_+Mp:_,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},Hp=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Up(n))&&(i&&(i+=` `),i+=r);return i},Up=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Up(e[r]))&&(n&&(n+=` `),n+=t);return n},Wp=(e,...t)=>{let n,r,i,a,o=o=>(n=Rp(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=Vp(e,n);return i(e,a),a};return a=o,(...e)=>a(Hp(...e))},Gp=[],Kp=e=>{let t=t=>t[e]||Gp;return t.isThemeGetter=!0,t},qp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Yp=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Xp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zp=/\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$/,Qp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$p=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,em=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tm=e=>Yp.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),nm=e=>!!e&&Number.isInteger(Number(e)),rm=e=>e.endsWith(`%`)&&X(e.slice(0,-1)),im=e=>Xp.test(e),am=()=>!0,om=e=>Zp.test(e)&&!Qp.test(e),sm=()=>!1,cm=e=>$p.test(e),lm=e=>em.test(e),um=e=>!Z(e)&&!Q(e),dm=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)),fm=e=>Dm(e,jm,sm),Z=e=>qp.test(e),pm=e=>Dm(e,Mm,om),mm=e=>Dm(e,Nm,X),hm=e=>Dm(e,Fm,am),gm=e=>Dm(e,Pm,sm),_m=e=>Dm(e,km,sm),vm=e=>Dm(e,Am,lm),ym=e=>Dm(e,Im,cm),Q=e=>Jp.test(e),bm=e=>Om(e,Mm),xm=e=>Om(e,Pm),Sm=e=>Om(e,km),Cm=e=>Om(e,jm),wm=e=>Om(e,Am),Tm=e=>Om(e,Im,!0),Em=e=>Om(e,Fm,!0),Dm=(e,t,n)=>{let r=qp.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Om=(e,t,n=!1)=>{let r=Jp.exec(e);return r?r[1]?t(r[1]):n:!1},km=e=>e===`position`||e===`percentage`,Am=e=>e===`image`||e===`url`,jm=e=>e===`length`||e===`size`||e===`bg-size`,Mm=e=>e===`length`,Nm=e=>e===`number`,Pm=e=>e===`family-name`,Fm=e=>e===`number`||e===`weight`,Im=e=>e===`shadow`,Lm=Wp(()=>{let e=Kp(`color`),t=Kp(`font`),n=Kp(`text`),r=Kp(`font-weight`),i=Kp(`tracking`),a=Kp(`leading`),o=Kp(`breakpoint`),s=Kp(`container`),c=Kp(`spacing`),l=Kp(`radius`),u=Kp(`shadow`),d=Kp(`inset-shadow`),f=Kp(`text-shadow`),p=Kp(`drop-shadow`),m=Kp(`blur`),h=Kp(`perspective`),g=Kp(`aspect`),_=Kp(`ease`),v=Kp(`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=()=>[tm,`full`,`auto`,...w()],E=()=>[nm,`none`,`subgrid`,Q,Z],D=()=>[`auto`,{span:[`full`,nm,Q,Z]},nm,Q,Z],O=()=>[nm,`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`],j=()=>[`auto`,...w()],M=()=>[tm,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[tm,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[tm,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,Q,Z],F=()=>[...b(),Sm,_m,{position:[Q,Z]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,Cm,fm,{size:[Q,Z]}],ie=()=>[rm,bm,pm],ae=()=>[``,`none`,`full`,l,Q,Z],I=()=>[``,X,bm,pm],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,rm,Sm,_m],se=()=>[``,`none`,m,Q,Z],ce=()=>[`none`,X,Q,Z],le=()=>[`none`,X,Q,Z],ue=()=>[X,Q,Z],de=()=>[tm,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[im],breakpoint:[im],color:[am],container:[im],"drop-shadow":[im],ease:[`in`,`out`,`in-out`],font:[um],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[im],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[im],shadow:[im],spacing:[`px`,X],text:[im],"text-shadow":[im],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,tm,Z,Q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Q,Z]}],"container-named":[dm],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:[nm,`auto`,Q,Z]}],basis:[{basis:[tm,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[X,tm,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,X,Q,Z]}],shrink:[{shrink:[``,X,Q,Z]}],order:[{order:[nm,`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:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...N()]}],"min-inline-size":[{"min-inline":[`auto`,...N()]}],"max-inline-size":[{"max-inline":[`none`,...N()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,...M()]}],"font-size":[{text:[`base`,n,bm,pm]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Em,hm]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,rm,Z]}],"font-family":[{font:[xm,gm,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,mm]}],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:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[X,`from-font`,`auto`,Q,pm]}],"text-decoration-color":[{decoration:P()}],"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:[nm,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:F()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},nm,Q,Z],radial:[``,Q,Z],conic:[nm,Q,Z]},wm,vm]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"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:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[X,Q,Z]}],"outline-w":[{outline:[``,X,bm,pm]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,Tm,ym]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Tm,ym]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[X,pm]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Tm,ym]}],"text-shadow-color":[{"text-shadow":P()}],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":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"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":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"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":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"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":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"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":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"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":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"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":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"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":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"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,Tm,ym]}],"drop-shadow-color":[{"drop-shadow":P()}],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:[nm,Q,Z]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"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":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"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`,...P()]}],"stroke-w":[{stroke:[X,bm,pm,mm]}],stroke:[{stroke:[`none`,...P()]}],"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 Lm(fp(e))}var Rm=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,zm=fp,Bm=(e,t)=>n=>{if(t?.variants==null)return zm(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=Rm(t)||Rm(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 zm(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)},Vm=Bm(`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 Hm({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,S.jsx)(r?Ur:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:$(Vm({variant:t,size:n,className:e})),...i})}function Um({...e}){return(0,S.jsx)(dc,{"data-slot":`alert-dialog`,...e})}function Wm({...e}){return(0,S.jsx)(fc,{"data-slot":`alert-dialog-trigger`,...e})}function Gm({...e}){return(0,S.jsx)(pc,{"data-slot":`alert-dialog-portal`,...e})}function Km({className:e,...t}){return(0,S.jsx)(mc,{"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 qm({className:e,size:t=`default`,...n}){return(0,S.jsxs)(Gm,{children:[(0,S.jsx)(Km,{}),(0,S.jsx)(hc,{"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 Jm({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 Ym({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 Xm({className:e,...t}){return(0,S.jsx)(vc,{"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 Zm({className:e,...t}){return(0,S.jsx)(yc,{"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 Qm({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,S.jsx)(Hm,{variant:t,size:n,asChild:!0,children:(0,S.jsx)(gc,{"data-slot":`alert-dialog-action`,className:$(e),...r})})}function $m({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,S.jsx)(Hm,{variant:t,size:n,asChild:!0,children:(0,S.jsx)(_c,{"data-slot":`alert-dialog-cancel`,className:$(e),...r})})}var eh=Bm(`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 th({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,S.jsx)(n?Ur:`span`,{"data-slot":`badge`,"data-variant":t,className:$(eh({variant:t}),e),...r})}function nh({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 rh({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 ih({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 ah({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-description`,className:$(`text-sm text-muted-foreground`,e),...t})}function oh({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-content`,className:$(`px-(--card-spacing)`,e),...t})}function sh({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 ch({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 lh({className:e,...t}){return(0,S.jsx)(Nd,{"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 uh({...e}){return(0,S.jsx)(Ts,{"data-slot":`dialog`,...e})}function dh({...e}){return(0,S.jsx)(Ds,{"data-slot":`dialog-trigger`,...e})}function fh({...e}){return(0,S.jsx)(js,{"data-slot":`dialog-portal`,...e})}function ph({className:e,...t}){return(0,S.jsx)(Ns,{"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 mh({className:e,children:t,showCloseButton:n=!0,...r}){return(0,S.jsxs)(fh,{children:[(0,S.jsx)(ph,{}),(0,S.jsxs)(Ls,{"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)(Ks,{"data-slot":`dialog-close`,asChild:!0,children:(0,S.jsxs)(Hm,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,S.jsx)(rr,{}),(0,S.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function hh({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`dialog-header`,className:$(`flex flex-col gap-2`,e),...t})}function gh({className:e,...t}){return(0,S.jsx)(Hs,{"data-slot":`dialog-title`,className:$(`font-heading text-base leading-none font-medium`,e),...t})}function _h({className:e,...t}){return(0,S.jsx)(Ws,{"data-slot":`dialog-description`,className:$(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function vh({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,S.jsx)(Bd,{"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 yh({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`skeleton`,className:$(`animate-pulse rounded-md bg-muted`,e),...t})}function bh({className:e,size:t=`default`,...n}){return(0,S.jsx)(Zd,{"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)($d,{"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 xh({className:e,orientation:t=`horizontal`,...n}){return(0,S.jsx)(Sf,{"data-slot":`tabs`,"data-orientation":t,className:$(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Sh=Bm(`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 Ch({className:e,variant:t=`default`,...n}){return(0,S.jsx)(Cf,{"data-slot":`tabs-list`,"data-variant":t,className:$(Sh({variant:t}),e),...n})}function wh({className:e,...t}){return(0,S.jsx)(wf,{"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 Th({className:e,...t}){return(0,S.jsx)(Tf,{"data-slot":`tabs-content`,className:$(`flex-1 text-sm outline-none`,e),...t})}function Eh({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 Dh=(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{}},Oh=[`light`,`dark`],kh=`(prefers-color-scheme: dark)`,Ah=typeof window>`u`,jh=_.createContext(void 0),Mh={setTheme:e=>{},themes:[]},Nh=()=>_.useContext(jh)??Mh,Ph=e=>_.useContext(jh)?_.createElement(_.Fragment,null,e.children):_.createElement(Ih,{...e}),Fh=[`light`,`dark`],Ih=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=Fh,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=_.useState(()=>Rh(i,o)),[m,h]=_.useState(()=>f===`system`?Bh():f),g=c?Object.values(c):a,v=_.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=Bh());let a=c?c[i]:i,l=t?zh(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=Oh.includes(o)?o:null,t=Oh.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=Bh(t);h(r),f===`system`&&n&&!e&&v(`system`)},[f,e]);_.useEffect(()=>{let e=window.matchMedia(kh);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(jh.Provider,{value:x},_.createElement(Lh,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},Lh=_.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:`(${Dh.toString()})(${u})`}})}),Rh=(e,t)=>{if(Ah)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},zh=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)}},Bh=e=>(e||=window.matchMedia(kh),e.matches?`dark`:`light`),Vh=({...e})=>{let{theme:t=`system`}=Nh();return(0,S.jsx)(Pr,{theme:t,className:`toaster group`,icons:{success:(0,S.jsx)(Bn,{className:`size-4`}),info:(0,S.jsx)(Wn,{className:`size-4`}),warning:(0,S.jsx)(nr,{className:`size-4`}),error:(0,S.jsx)(qn,{className:`size-4`}),loading:(0,S.jsx)(Kn,{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 Hh({delayDuration:e=0,...t}){return(0,S.jsx)(ap,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Uh({...e}){return(0,S.jsx)(op,{"data-slot":`tooltip`,...e})}function Wh({...e}){return(0,S.jsx)(sp,{"data-slot":`tooltip-trigger`,...e})}function Gh({className:e,sideOffset:t=0,children:n,...r}){return(0,S.jsx)(cp,{children:(0,S.jsxs)(lp,{"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)(up,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var Kh={token:`Token`,skill:`Skills`,commit:`Commit`,checkpoint:`Checkpoint`,agent:`Agent`,prompt_duration:`提示耗时`,prompt_report:`提示报告`},qh={repository:`仓库信息`,path:`项目路径`,branch:`分支名称`},Jh=[`hosts`,`repositories`,`directories`,`branches`],Yh=[`allowed_agents`,`allowed_models`,`blocked_patterns`],Xh={git_path:`/usr/bin/git`,exclude_repositories:[],exclude_prompts_in_repositories:[],disable_auto_updates:!1,disable_version_checks:!1,telemetry_oss:`on`},Zh=Object.fromEntries(Object.keys(Kh).map(e=>[e,!0])),Qh={installed:!1,enabled:!1,action:`redact`,event_types:Zh,built_in_rules:{api_key:!0,private_key:!0,credential:!0,email:!1,phone:!1},custom_patterns:[]},$h={installed:!1,enabled:!1,mode:`audit`,allowed_agents:[],allowed_models:[],blocked_patterns:[]};function eg(e){return Array.isArray(e)?e.join(`
50
- `):``}function tg(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}function ng(e,t){return`${e}:${t}`}function rg(e){return Object.fromEntries(e.flatMap(e=>Jh.map(t=>[ng(e.id,t),eg(e.match[t])])))}function ig(e){return Object.fromEntries(Yh.map(t=>[t,eg(e[t])]))}function ag(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 og(e){let t=new Date(e);return Number.isNaN(t.getTime())?`时间未知`:new Intl.DateTimeFormat(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(t)}function sg(e){return e===`skill_pattern`?`命中 Skill 规则`:e===`default_deny`?`未匹配仓库默认拦截`:e===`git_ai_paused`?`Git AI 已暂停`:e===`sensitive_content`?`命中敏感内容规则`:e===`agent_model_policy`?`命中 Agent / 模型规则`:e.startsWith(`plugin:`)?`命中仓库插件策略`:e||`已拦截`}function cg(e){return`repository:${e}`}function lg(e,t){let n=[...t.plugins.map(e=>cg(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 ug(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},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:{...Qh,...e.sensitive_data_policy,event_types:{...Zh,...e.sensitive_data_policy?.event_types},built_in_rules:{...Qh.built_in_rules,...e.sensitive_data_policy?.built_in_rules},custom_patterns:e.sensitive_data_policy?.custom_patterns??[]},agent_model_policy:{...$h,...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=lg(e.plugin_order,n),n}function dg(e){let t=1;for(;e.some(e=>e.id===`repository-${t}`);)t+=1;return`repository-${t}`}async function fg(e){let t=await e.json().catch(()=>({}));if(!e.ok||t.ok===!1)throw Error(t.message||`请求失败:${e.status}`);return t}function pg({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)(lh,{htmlFor:e,children:t}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n})]}),(0,S.jsx)(bh,{id:e,checked:r,onCheckedChange:i})]})}function mg({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)(lh,{htmlFor:e,className:`font-normal`,children:t}),(0,S.jsx)(bh,{id:e,checked:n,onCheckedChange:r})]})}function hg(){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)(yh,{className:`h-8 w-64`}),(0,S.jsx)(yh,{className:`h-4 w-80`})]}),(0,S.jsx)(yh,{className:`h-8 w-28`})]}),(0,S.jsx)(yh,{className:`h-24 w-full`}),(0,S.jsx)(yh,{className:`h-[420px] w-full`})]})}function gg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)({}),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(()=>ig($h)),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)({ok:!1}),[y,b]=(0,_.useState)([]),[x,C]=(0,_.useState)(!1),[w,T]=(0,_.useState)(``),[E,D]=(0,_.useState)(!1),[O,k]=(0,_.useState)(!1),[ee,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(!1),[N,te]=(0,_.useState)(null),P=(0,_.useCallback)(async()=>{try{let e=await fg(await fetch(`/api/config`,{cache:`no-store`})),n={...Xh,...e.gitAi};t(n),r(eg(n.exclude_repositories)),a(eg(n.exclude_prompts_in_repositories));let i=ug(e.policy);s(eg(i.skill_policy.blocked_patterns)),l(rg(i.plugins)),d(eg(i.sensitive_data_policy.custom_patterns)),p(ig(i.agent_model_policy)),h(i),v(e.runtime??{ok:!1}),D(!1)}catch(e){yr.error(e instanceof Error?e.message:`读取配置失败`)}},[]),F=(0,_.useCallback)(async()=>{C(!0);try{let e=await fg(await fetch(`/api/filter-events`,{cache:`no-store`}));b(Array.isArray(e.events)?e.events:[]),T(``)}catch(e){T(e instanceof Error?e.message:`读取过滤记录失败`)}finally{C(!1)}},[]);(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void P());return()=>window.cancelAnimationFrame(e)},[P]),(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void F()),t=window.setInterval(()=>void F(),3e4);return()=>{window.cancelAnimationFrame(e),window.clearInterval(t)}},[F]);let ne=(0,_.useMemo)(()=>m?.plugins.filter(e=>e.enabled)??[],[m]),re=(0,_.useMemo)(()=>ne.reduce((e,t)=>e+Object.values(t.allow).filter(Boolean).length,0),[ne]),ie=(m?.plugins.length??0)+ +!!m?.skill_policy.installed+ +!!m?.sensitive_data_policy.installed+ +!!m?.agent_model_policy.installed,ae=(m?.plugins.filter(e=>e.enabled).length??0)+(m?.skill_policy.installed&&m.skill_policy.enabled?1:0)+(m?.sensitive_data_policy.installed&&m.sensitive_data_policy.enabled?1:0)+(m?.agent_model_policy.installed&&m.agent_model_policy.enabled?1:0),I=(0,_.useMemo)(()=>new Map(m?.plugin_order.map((e,t)=>[e,t])),[m?.plugin_order]),L=(0,_.useMemo)(()=>ag(y,`repositories`),[y]),oe=(0,_.useMemo)(()=>ag(y,`skills`),[y]),R=(0,_.useMemo)(()=>[{title:`仓库`,items:L,emptyMessage:`尚未拦截包含仓库信息的上报`},{title:`Skills`,items:oe,emptyMessage:`尚未拦截 Skill 调用`}],[L,oe]),se=g.gitAiEnabled??m?.git_ai_enabled??!0,ce=m?.git_ai_enabled!==se,le=g.filter?.ok===!0,ue=(0,_.useMemo)(()=>{let e=[];return m&&e.push(`repository`),m?.skill_policy.installed||e.push(`skill_filter`),m?.sensitive_data_policy.installed||e.push(`sensitive_data`),m?.agent_model_policy.installed||e.push(`agent_model`),e},[m]),de=e=>{t(e),D(!0)},z=e=>{h(e),D(!0)},fe=(e,t)=>{m&&z({...m,plugins:m.plugins.map(n=>n.id===e?t(n):n)})},pe=(e,t,n)=>{l(r=>({...r,[ng(e,t)]:n})),fe(e,e=>({...e,match:{...e.match,[t]:tg(n)}}))},me=e=>{if(m){if(e===`repository`){let e=dg(m.plugins);l(t=>({...t,[ng(e,`hosts`)]:`example.com`,[ng(e,`repositories`)]:``,[ng(e,`directories`)]:``,[ng(e,`branches`)]:``})),z({...m,plugins:[...m.plugins,{id:e,name:`仓库插件 ${m.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(Kh).map(e=>[e,!1])),fields:Object.fromEntries(Object.keys(qh).map(e=>[e,!1]))}],plugin_order:[...m.plugin_order,cg(e)]})}else e===`skill_filter`?z({...m,skill_policy:{...m.skill_policy,installed:!0,enabled:!0},plugin_order:[...m.plugin_order,`skill_filter`]}):e===`sensitive_data`?z({...m,sensitive_data_policy:{...Qh,installed:!0,enabled:!0},plugin_order:[...m.plugin_order,`sensitive_data`]}):e===`agent_model`&&z({...m,agent_model_policy:{...$h,installed:!0,enabled:!0},plugin_order:[...m.plugin_order,`agent_model`]});A(!1)}},he=e=>{m&&(l(t=>Object.fromEntries(Object.entries(t).filter(([t])=>!t.startsWith(`${e}:`)))),z({...m,plugins:m.plugins.filter(t=>t.id!==e),plugin_order:m.plugin_order.filter(t=>t!==cg(e))}))},ge=()=>{m&&z({...m,skill_policy:{...m.skill_policy,installed:!1,enabled:!1},plugin_order:m.plugin_order.filter(e=>e!==`skill_filter`)})},_e=e=>{m&&z({...m,[e]:{...m[e],installed:!1,enabled:!1},plugin_order:m.plugin_order.filter(t=>t!==(e===`sensitive_data_policy`?`sensitive_data`:`agent_model`))})},ve=async()=>{if(!(!e||!m)){k(!0);try{let n=await fg(await fetch(`/api/config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({gitAi:e,policy:m})})),i={...Xh,...n.gitAi};t(i),r(eg(i.exclude_repositories)),a(eg(i.exclude_prompts_in_repositories));let o=ug(n.policy);s(eg(o.skill_policy.blocked_patterns)),l(rg(o.plugins)),d(eg(o.sensitive_data_policy.custom_patterns)),p(ig(o.agent_model_policy)),h(o),n.runtime&&v(n.runtime),D(!1),yr.success(`配置已保存,下一次上报立即使用新策略`)}catch(e){yr.error(e instanceof Error?e.message:`保存失败`)}finally{k(!1)}}},ye=async()=>{k(!0);let e=yr.loading(`正在验证配置`,{description:`检查插件策略、过滤脚本和本地服务连接…`});try{let t=await fetch(`/api/test`,{method:`POST`}),n=await t.json().catch(()=>({}));if(!t.ok||!Array.isArray(n.checks))throw Error(n.message||`请求失败:${t.status}`);let r=n.checks.filter(e=>!e.ok);r.length?yr.error(`配置验证失败`,{id:e,description:r.map(e=>e.message?`${e.name}:${e.message}`:e.name).join(`;`)}):yr.success(`配置验证通过`,{id:e,description:n.checks.map(e=>e.name).join(`、`)})}catch(t){yr.error(`配置验证失败`,{id:e,description:t instanceof Error?t.message:`验证请求失败`})}finally{k(!1)}},be=async()=>{k(!0);try{let e=await fg(await fetch(`/api/restart-filter`,{method:`POST`}));yr.success(e.message||`过滤服务已重启`),window.setTimeout(()=>void P(),900)}catch(e){yr.error(e instanceof Error?e.message:`重启失败`)}finally{k(!1)}},xe=async e=>{M(!0);try{let t=await fg(await fetch(`/api/config`,{cache:`no-store`}));te(e===`gitAi`?{title:`当前 Git AI 原生配置`,description:`读取 ~/.git-ai/config.json 中由本页面管理的已保存字段,未保存更改和敏感未知字段不会显示。`,content:t.gitAi}:{title:`当前插件策略配置`,description:`读取 ~/.git-ai/filter_plugins.json 中已写入磁盘的完整插件策略,未保存更改不会显示。`,content:t.policy})}catch(e){yr.error(e instanceof Error?e.message:`读取当前配置失败`)}finally{M(!1)}};return!e||!m?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(hg,{}),(0,S.jsx)(Vh,{position:`top-right`,richColors:!0,closeButton:!0,duration:5e3})]}):(0,S.jsxs)(Hh,{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)(er,{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:`Git AI 配置中心`}),g.gitAiVersion&&(0,S.jsxs)(th,{variant:`outline`,className:`font-mono text-xs font-normal`,children:[`v`,g.gitAiVersion]})]}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`本机插件策略与上传权限`})]})]}),(0,S.jsxs)(th,{variant:g.distribution===`upstream-oss`?`outline`:g.ok?`secondary`:`destructive`,children:[(0,S.jsx)(Rn,{className:`size-3.5`}),g.distribution===`upstream-oss`?`上游 OSS · 原生配置`:g.ok?`定制版 · 过滤在线`:`定制版 · 过滤异常`]})]})}),(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)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`已安装插件`}),(0,S.jsxs)(ih,{className:`flex items-baseline gap-2 text-2xl`,children:[ie,(0,S.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[ae,` 个启用`]})]})]})}),(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`允许的数据通道`}),(0,S.jsx)(ih,{className:`text-2xl`,children:re})]})}),(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`配置状态`}),(0,S.jsxs)(ih,{className:`flex items-center gap-2 text-base`,children:[(0,S.jsx)(Bn,{className:`size-4 ${E?`text-amber-600`:`text-emerald-600`}`}),E?`有未保存更改`:`已同步`]})]})}),(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`当前 Git AI 状态`}),(0,S.jsxs)(ih,{className:`flex items-center gap-2 text-base`,children:[(0,S.jsx)(Rn,{className:`size-4 ${se?`text-emerald-600`:`text-amber-600`}`}),ce?m.git_ai_enabled?`开启(待保存)`:`暂停(待保存)`:se?`已开启`:`已暂停`]})]})}),(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`过滤服务状态`}),(0,S.jsxs)(ih,{className:`flex items-center gap-2 text-base`,children:[(0,S.jsx)(Rn,{className:`size-4 ${le?`text-emerald-600`:`text-destructive`}`}),le?`已在线`:`已离线`]})]})})]}),(0,S.jsxs)(xh,{defaultValue:`system`,children:[(0,S.jsxs)(Ch,{className:`w-full justify-start`,children:[(0,S.jsxs)(wh,{value:`system`,children:[(0,S.jsx)(Qn,{}),`Git AI 设置`]}),(0,S.jsxs)(wh,{value:`plugins`,children:[(0,S.jsx)(Yn,{}),`插件管理`]})]}),(0,S.jsx)(Th,{value:`system`,className:`mt-4`,children:(0,S.jsxs)(nh,{children:[(0,S.jsxs)(rh,{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)(ih,{children:`Git AI 原生设置`}),(0,S.jsx)(ah,{children:`写入 ~/.git-ai/config.json,未知字段会原样保留。`})]}),(0,S.jsx)(Hm,{variant:`outline`,size:`sm`,onClick:()=>void xe(`gitAi`),disabled:j,children:j?`读取中...`:`查看配置`})]}),(0,S.jsxs)(oh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsx)(pg,{id:`git-ai-enabled`,title:`Git AI`,description:m.git_ai_enabled?`已开启:按当前插件策略处理并转发 Git AI 上报`:`已暂停:全部 Git AI 上报会在本机拦截,恢复后继续按原策略处理`,checked:m.git_ai_enabled,onCheckedChange:e=>z({...m,git_ai_enabled:e})}),(0,S.jsx)(pg,{id:`auto-updates`,title:`自动更新`,description:`检测到稳定版本后自动安装`,checked:!e.disable_auto_updates,onCheckedChange:t=>de({...e,disable_auto_updates:!t})}),(0,S.jsx)(pg,{id:`version-checks`,title:`版本检查`,description:`在 fetch、pull、push 时检查版本`,checked:!e.disable_version_checks,onCheckedChange:t=>de({...e,disable_version_checks:!t})}),(0,S.jsx)(pg,{id:`oss-telemetry`,title:`上游 OSS 遥测`,description:`控制官方版的 Sentry/PostHog 遥测,不等同于细粒度事件过滤`,checked:e.telemetry_oss!==`off`,onCheckedChange:t=>de({...e,telemetry_oss:t?`on`:`off`})})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`git-path`,children:`Git 可执行文件`}),(0,S.jsx)(ch,{id:`git-path`,className:`font-mono`,value:e.git_path,onChange:t=>de({...e,git_path:t.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)(lh,{htmlFor:`exclude-repositories`,children:`排除的仓库`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一个远程地址、路径或通配符。匹配后 Git AI 整体停用。`}),(0,S.jsx)(Eh,{id:`exclude-repositories`,className:`min-h-44 font-mono text-xs`,value:n,onChange:t=>{let n=t.target.value;r(n),de({...e,exclude_repositories:tg(n)})}})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`exclude-prompts`,children:`不保存提示词的仓库`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一个规则,只影响提示词与会话内容。`}),(0,S.jsx)(Eh,{id:`exclude-prompts`,className:`min-h-44 font-mono text-xs`,value:i,onChange:t=>{let n=t.target.value;a(n),de({...e,exclude_prompts_in_repositories:tg(n)})}})]})]})]})]})}),(0,S.jsxs)(Th,{value:`plugins`,className:`mt-4 space-y-4`,children:[(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{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)(ih,{children:`Git AI 运行兼容性`}),(0,S.jsx)(ah,{children:g.distribution===`upstream-oss`?`检测到官方上游版:原生设置生效,但官方版没有 custom_metrics 扩展点,下面的仓库和 Skill 细粒度上报规则不会接管 /worker/metrics/upload。仓库插件可以添加多个,主机规则重叠时按列表顺序使用第一个命中插件。`:`检测到 custom_metrics 定制版:仓库、Skill、数据类型和字段规则会在请求离开本机前执行。仓库插件可以添加多个,主机规则重叠时按列表顺序使用第一个命中插件。`})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(Hm,{variant:`outline`,size:`sm`,onClick:()=>void xe(`policy`),disabled:j,children:j?`读取中...`:`查看配置`}),(0,S.jsx)(th,{variant:g.granularFilterActive?`secondary`:`outline`,children:g.granularFilterActive?`细粒度过滤已接管`:`仅原生配置兼容`})]})]})}),(0,S.jsxs)(nh,{className:`overflow-hidden`,children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)(Rn,{}),`过滤观察`]}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(ih,{children:`最近 24 小时的拦截记录`}),(0,S.jsxs)(ah,{children:[`已拦截 `,y.length,` 次上报,按仓库和 Skill 汇总。`]})]})]}),(0,S.jsxs)(Hm,{variant:`outline`,size:`sm`,onClick:()=>void F(),disabled:x,children:[(0,S.jsx)(Xn,{className:x?`animate-spin`:void 0}),`刷新记录`]})]}),(0,S.jsxs)(oh,{className:`space-y-4 pt-6`,children:[w?(0,S.jsxs)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:[`无法读取过滤记录:`,w]}):(0,S.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:R.map(({title:e,items:t,emptyMessage:n})=>(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:e}),(0,S.jsxs)(th,{variant:`outline`,children:[t.length,` 项`]})]}),t.length?(0,S.jsx)(`ul`,{className:`divide-y`,children:t.map(e=>(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:e.name}),(0,S.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[sg(e.reason),` · 最近 `,og(e.timestamp)]})]}),(0,S.jsxs)(th,{variant:`secondary`,className:`shrink-0`,children:[e.count,` 次`]})]},e.name))}):(0,S.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:n})]},e))}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`记录仅保存在本机 24 小时,包含时间、仓库或 Skill 标识及拦截原因,不保存上报正文。`})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[m.plugins.map(e=>(0,S.jsxs)(nh,{style:{order:I.get(cg(e.id))},children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)(Un,{}),`仓库插件`]}),(0,S.jsx)(ch,{"aria-label":`插件名称`,className:`max-w-md text-base font-medium`,value:e.name,onChange:t=>fe(e.id,e=>({...e,name:t.target.value}))}),(0,S.jsxs)(ah,{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)(lh,{htmlFor:`plugin-${e.id}`,children:`启用`}),(0,S.jsx)(bh,{id:`plugin-${e.id}`,checked:e.enabled,onCheckedChange:t=>fe(e.id,e=>({...e,enabled:t}))})]}),(0,S.jsxs)(Um,{children:[(0,S.jsxs)(Uh,{children:[(0,S.jsx)(Wh,{asChild:!0,children:(0,S.jsx)(Wm,{asChild:!0,children:(0,S.jsx)(Hm,{variant:`ghost`,size:`icon`,"aria-label":`删除插件 ${e.name}`,children:(0,S.jsx)(tr,{})})})}),(0,S.jsx)(Gh,{children:`删除当前插件`})]}),(0,S.jsxs)(qm,{children:[(0,S.jsxs)(Jm,{children:[(0,S.jsx)(Xm,{children:`删除仓库插件?`}),(0,S.jsxs)(Zm,{children:[`将删除“`,e.name,`”的全部配置。保存更改前不会写入磁盘。`]})]}),(0,S.jsxs)(Ym,{children:[(0,S.jsx)($m,{children:`取消`}),(0,S.jsx)(Qm,{onClick:()=>he(e.id),children:`删除`})]})]})]})]})]}),(0,S.jsxs)(oh,{className:`space-y-6`,children:[(0,S.jsx)(pg,{id:`default-allow`,title:`未匹配主机的仓库`,description:`控制未命中此插件主机规则的仓库是否允许原始上报`,checked:m.default_allow_unmatched,onCheckedChange:e=>z({...m,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)(pg,{id:`global-${e.id}`,title:`全部仓库(全局规则)`,description:`全局规则始终排在所有特定仓库规则之后,适合作为默认策略。`,checked:e.match.all_repositories,onCheckedChange:t=>fe(e.id,e=>({...e,match:{...e.match,all_repositories:t}}))}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`priority-${e.id}`,children:`特定规则优先级`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`数值越大越优先;同优先级按插件列表顺序匹配。`}),(0,S.jsx)(ch,{id:`priority-${e.id}`,type:`number`,min:`0`,max:`1000`,value:e.priority,onChange:t=>{let n=Number.parseInt(t.target.value,10);fe(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)(lh,{htmlFor:`directory-${e.id}`,children:`Skill 上报目录`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`仅替换此插件允许上传的 Skill 路径。留空则保留原路径。`}),(0,S.jsx)(ch,{id:`directory-${e.id}`,className:`font-mono`,value:e.fixed_project_directory,onChange:t=>fe(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)(Hn,{className:`size-4`}),`上报目录预览`]}),(0,S.jsx)(`p`,{className:`mt-2 break-all font-mono text-xs text-muted-foreground`,children:e.fixed_project_directory||`保留原路径`})]})]})]}),!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)(lh,{htmlFor:`hosts-${e.id}`,children:`匹配仓库主机`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:"每行一条,可用 `github.com` 或 `*github.com*`。"}),(0,S.jsx)(Eh,{id:`hosts-${e.id}`,className:`min-h-28 font-mono text-xs`,value:c[ng(e.id,`hosts`)]??eg(e.match.hosts),onChange:t=>pe(e.id,`hosts`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`repositories-${e.id}`,children:`匹配仓库`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一条,可填 owner/repo、远程地址或通配符。`}),(0,S.jsx)(Eh,{id:`repositories-${e.id}`,className:`min-h-28 font-mono text-xs`,value:c[ng(e.id,`repositories`)]??eg(e.match.repositories),onChange:t=>pe(e.id,`repositories`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`directories-${e.id}`,children:`匹配项目目录`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:"多条件会同时生效;可用 `/work/*` 缩小范围。"}),(0,S.jsx)(Eh,{id:`directories-${e.id}`,className:`min-h-28 font-mono text-xs`,value:c[ng(e.id,`directories`)]??eg(e.match.directories),onChange:t=>pe(e.id,`directories`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`branches-${e.id}`,children:`匹配分支`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一条,例如 main、release/* 或 feature/*。`}),(0,S.jsx)(Eh,{id:`branches-${e.id}`,className:`min-h-28 font-mono text-xs`,value:c[ng(e.id,`branches`)]??eg(e.match.branches),onChange:t=>pe(e.id,`branches`,t.target.value)})]})]}),(0,S.jsx)(vh,{}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:`允许上传的数据`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每类事件可单独启用,关闭时请求会在本机被拦截。`})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:Object.keys(Kh).map(t=>(0,S.jsx)(mg,{id:`${e.id}-event-${t}`,label:Kh[t],checked:e.allow[t],onCheckedChange:n=>fe(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:`允许保留的字段`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`关闭的仓库、目录和分支字段会在请求离开本机前删除。`})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:Object.keys(qh).map(t=>(0,S.jsx)(mg,{id:`${e.id}-field-${t}`,label:qh[t],checked:e.fields[t],onCheckedChange:n=>fe(e.id,e=>({...e,fields:{...e.fields,[t]:n}}))},t))})]})]}),(0,S.jsxs)(sh,{className:`justify-between border-t`,children:[(0,S.jsx)(th,{variant:e.enabled?`outline`:`secondary`,children:e.enabled?`${Object.values(e.allow).filter(Boolean).length}/7 数据类型 · ${Object.values(e.fields).filter(Boolean).length}/3 字段`:`插件已停用`}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.match.all_repositories?`全局默认策略`:`特定规则 · 优先级 ${e.priority}`})]})]},e.id)),m.skill_policy.installed&&(0,S.jsxs)(nh,{style:{order:I.get(`skill_filter`)},children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)(Gn,{}),`Skill 过滤插件`]}),(0,S.jsx)(ih,{children:`Skill 关键词过滤`}),(0,S.jsx)(ah,{children:`根据 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)(lh,{htmlFor:`skill-enabled`,children:`启用`}),(0,S.jsx)(bh,{id:`skill-enabled`,checked:m.skill_policy.enabled,onCheckedChange:e=>z({...m,skill_policy:{...m.skill_policy,enabled:e}})})]}),(0,S.jsxs)(Um,{children:[(0,S.jsxs)(Uh,{children:[(0,S.jsx)(Wh,{asChild:!0,children:(0,S.jsx)(Wm,{asChild:!0,children:(0,S.jsx)(Hm,{variant:`ghost`,size:`icon`,"aria-label":`删除插件 Skill 过滤插件`,children:(0,S.jsx)(tr,{})})})}),(0,S.jsx)(Gh,{children:`删除 Skill 过滤插件`})]}),(0,S.jsxs)(qm,{children:[(0,S.jsxs)(Jm,{children:[(0,S.jsx)(Xm,{children:`删除 Skill 过滤插件?`}),(0,S.jsx)(Zm,{children:`删除后关键词拦截将停用,现有关键词会保留,重新添加插件时可以继续使用。`})]}),(0,S.jsxs)(Ym,{children:[(0,S.jsx)($m,{children:`取消`}),(0,S.jsx)(Qm,{onClick:ge,children:`删除`})]})]})]})]})]}),(0,S.jsx)(oh,{children:(0,S.jsxs)(`div`,{className:`max-w-2xl space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`blocked-patterns`,children:`拦截关键词 / 正则`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一个,不区分大小写。命中 skillName、skill 或 name 即拦截。`}),(0,S.jsx)(Eh,{id:`blocked-patterns`,className:`min-h-72 font-mono text-xs`,value:o,onChange:e=>{let t=e.target.value;s(t),z({...m,skill_policy:{...m.skill_policy,blocked_patterns:tg(t)}})}})]})}),(0,S.jsxs)(sh,{className:`justify-between border-t`,children:[(0,S.jsx)(th,{variant:m.skill_policy.enabled?`outline`:`secondary`,children:m.skill_policy.enabled?`${m.skill_policy.blocked_patterns.length} 条拦截规则`:`插件已停用`}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`仅处理 Skill 调用名称`})]})]}),m.sensitive_data_policy.installed&&(0,S.jsxs)(nh,{style:{order:I.get(`sensitive_data`)},children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)($n,{}),`敏感内容脱敏插件`]}),(0,S.jsx)(ih,{children:`请求内容二次保护`}),(0,S.jsx)(ah,{children:`在请求离开本机前检测文本。不会保存命中的原始内容。`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(lh,{htmlFor:`sensitive-enabled`,children:`启用`}),(0,S.jsx)(bh,{id:`sensitive-enabled`,checked:m.sensitive_data_policy.enabled,onCheckedChange:e=>z({...m,sensitive_data_policy:{...m.sensitive_data_policy,enabled:e}})}),(0,S.jsx)(Hm,{variant:`ghost`,size:`icon`,"aria-label":`删除敏感内容脱敏插件`,onClick:()=>_e(`sensitive_data_policy`),children:(0,S.jsx)(tr,{})})]})]}),(0,S.jsxs)(oh,{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)(lh,{htmlFor:`sensitive-action`,children:`命中后的动作`}),(0,S.jsxs)(`select`,{id:`sensitive-action`,className:`h-9 w-full rounded-md border bg-background px-3 text-sm`,value:m.sensitive_data_policy.action,onChange:e=>z({...m,sensitive_data_policy:{...m.sensitive_data_policy,action:e.target.value}}),children:[(0,S.jsx)(`option`,{value:`redact`,children:`脱敏后继续上报`}),(0,S.jsx)(`option`,{value:`block`,children:`直接阻止上报`})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`sensitive-patterns`,children:`自定义正则`}),(0,S.jsx)(Eh,{id:`sensitive-patterns`,className:`min-h-24 font-mono text-xs`,placeholder:`每行一个正则`,value:u,onChange:e=>{let t=e.target.value;d(t),z({...m,sensitive_data_policy:{...m.sensitive_data_policy,custom_patterns:tg(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:`内置识别规则`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`默认启用密钥、私钥和凭据;邮箱与手机号由你决定是否纳入。`})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-5`,children:[[`api_key`,`API Key`],[`private_key`,`私钥`],[`credential`,`密码 / 凭据`],[`email`,`邮箱`],[`phone`,`手机号`]].map(([e,t])=>(0,S.jsx)(mg,{id:`sensitive-${e}`,label:t,checked:m.sensitive_data_policy.built_in_rules[e],onCheckedChange:t=>z({...m,sensitive_data_policy:{...m.sensitive_data_policy,built_in_rules:{...m.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:`作用数据类型`}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:Object.keys(Kh).map(e=>(0,S.jsx)(mg,{id:`sensitive-event-${e}`,label:Kh[e],checked:m.sensitive_data_policy.event_types[e],onCheckedChange:t=>z({...m,sensitive_data_policy:{...m.sensitive_data_policy,event_types:{...m.sensitive_data_policy.event_types,[e]:t}}})},e))})]})]})]}),m.agent_model_policy.installed&&(0,S.jsxs)(nh,{style:{order:I.get(`agent_model`)},children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)(zn,{}),`Agent / 模型治理插件`]}),(0,S.jsx)(ih,{children:`允许名单与阻止规则`}),(0,S.jsx)(ah,{children:`允许名单支持通配符;审计模式只记录本地统计,阻止模式会拦截不合规上报。`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(lh,{htmlFor:`agent-model-enabled`,children:`启用`}),(0,S.jsx)(bh,{id:`agent-model-enabled`,checked:m.agent_model_policy.enabled,onCheckedChange:e=>z({...m,agent_model_policy:{...m.agent_model_policy,enabled:e}})}),(0,S.jsx)(Hm,{variant:`ghost`,size:`icon`,"aria-label":`删除 Agent / 模型治理插件`,onClick:()=>_e(`agent_model_policy`),children:(0,S.jsx)(tr,{})})]})]}),(0,S.jsxs)(oh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`max-w-md space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`agent-model-mode`,children:`治理模式`}),(0,S.jsxs)(`select`,{id:`agent-model-mode`,className:`h-9 w-full rounded-md border bg-background px-3 text-sm`,value:m.agent_model_policy.mode,onChange:e=>z({...m,agent_model_policy:{...m.agent_model_policy,mode:e.target.value}}),children:[(0,S.jsx)(`option`,{value:`audit`,children:`仅审计,不阻止`}),(0,S.jsx)(`option`,{value:`block`,children:`命中规则时阻止`})]})]}),(0,S.jsx)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[[`allowed_agents`,`允许的 Agent`,`例如 codex、claude*`],[`allowed_models`,`允许的模型`,`例如 gpt-5*、claude-sonnet-*`],[`blocked_patterns`,`阻止正则`,`每行一个,不区分大小写`]].map(([e,t,n])=>(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`agent-model-${e}`,children:t}),(0,S.jsx)(Eh,{id:`agent-model-${e}`,className:`min-h-40 font-mono text-xs`,placeholder:n,value:f[e],onChange:t=>{let n=t.target.value;p(t=>({...t,[e]:n})),z({...m,agent_model_policy:{...m.agent_model_policy,[e]:tg(n)}})}})]},e))})]})]}),!m.plugins.length&&!m.skill_policy.installed&&!m.sensitive_data_policy.installed&&!m.agent_model_policy.installed&&(0,S.jsx)(nh,{children:(0,S.jsxs)(oh,{className:`flex min-h-40 flex-col items-center justify-center gap-2 text-center`,children:[(0,S.jsx)(Yn,{className:`size-6 text-muted-foreground`}),(0,S.jsx)(`p`,{className:`font-medium`,children:`还没有安装插件`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`添加插件后,这里会出现对应类型的配置模块。`})]})})]}),(0,S.jsxs)(uh,{open:ee,onOpenChange:A,children:[(0,S.jsx)(dh,{asChild:!0,children:(0,S.jsxs)(Hm,{variant:`outline`,className:`w-full`,disabled:!ue.length,children:[(0,S.jsx)(Jn,{}),ue.length?`添加插件`:`所有可用插件均已添加`]})}),(0,S.jsxs)(mh,{children:[(0,S.jsxs)(hh,{children:[(0,S.jsx)(gh,{children:`添加插件`}),(0,S.jsx)(_h,{children:`仓库插件可以添加多个;其余插件使用独立配置表单且每种只能添加一次。新插件会追加到当前列表最后。`})]}),(0,S.jsxs)(`div`,{className:`grid gap-2`,children:[ue.includes(`repository`)&&(0,S.jsxs)(Hm,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>me(`repository`),children:[(0,S.jsx)(Un,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:`仓库插件`}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:`配置仓库主机、上传类型、目录与字段脱敏`})]})]}),ue.includes(`skill_filter`)&&(0,S.jsxs)(Hm,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>me(`skill_filter`),children:[(0,S.jsx)(Gn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:`Skill 过滤插件`}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:`配置需要拦截的 Skill 名称关键词或正则`})]})]}),ue.includes(`sensitive_data`)&&(0,S.jsxs)(Hm,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>me(`sensitive_data`),children:[(0,S.jsx)($n,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:`敏感内容脱敏`}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:`检测密钥、私钥、凭据等文本,可脱敏或阻止上报`})]})]}),ue.includes(`agent_model`)&&(0,S.jsxs)(Hm,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>me(`agent_model`),children:[(0,S.jsx)(zn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:`Agent / 模型治理`}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:`设置 Agent、模型允许名单与阻止规则`})]})]})]})]})]})]})]})]}),(0,S.jsx)(uh,{open:!!N,onOpenChange:e=>{e||te(null)},children:(0,S.jsxs)(mh,{className:`w-[96vw] max-w-6xl sm:max-w-6xl`,children:[(0,S.jsxs)(hh,{children:[(0,S.jsx)(gh,{children:N?.title}),(0,S.jsx)(_h,{children:N?.description})]}),(0,S.jsx)(`div`,{className:`max-h-[70svh] overflow-auto rounded-lg border bg-muted/50 p-4`,children:N&&(0,S.jsx)(B,{value:N.content,collapsed:!1,displayDataTypes:!1,enableClipboard:!1,shortenTextAfterLength:0,style:Dn})})]})}),(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)(Bn,{className:`size-4 ${E?`text-amber-600`:`text-emerald-600`}`}),E?`有未保存的更改`:`配置已同步`]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,S.jsxs)(Hm,{variant:`outline`,onClick:ye,disabled:O,children:[(0,S.jsx)(Vn,{}),`验证配置`]}),(0,S.jsxs)(Hm,{variant:`outline`,onClick:be,disabled:O,children:[(0,S.jsx)(Xn,{className:O?`animate-spin`:``}),`重启过滤服务`]}),(0,S.jsxs)(Hm,{onClick:ve,disabled:O||!E,children:[O?(0,S.jsx)(Kn,{className:`animate-spin`}):(0,S.jsx)(Zn,{}),`保存更改`]})]})]})})]}),(0,S.jsx)(Vh,{position:`top-right`,richColors:!0,closeButton:!0,duration:5e3})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(Ph,{attribute:`class`,defaultTheme:`light`,enableSystem:!1,children:(0,S.jsx)(gg,{})})}));
50
+ `):``}function tg(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}function ng(e,t){return`${e}:${t}`}function rg(e){return Object.fromEntries(e.flatMap(e=>Jh.map(t=>[ng(e.id,t),eg(e.match[t])])))}function ig(e){return Object.fromEntries(Yh.map(t=>[t,eg(e[t])]))}function ag(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 og(e){let t=new Date(e);return Number.isNaN(t.getTime())?`时间未知`:new Intl.DateTimeFormat(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(t)}function sg(e){return e===`skill_pattern`?`命中 Skill 规则`:e===`default_deny`?`未匹配仓库默认拦截`:e===`git_ai_paused`?`Git AI 已暂停`:e===`sensitive_content`?`命中敏感内容规则`:e===`agent_model_policy`?`命中 Agent / 模型规则`:e.startsWith(`plugin:`)?`命中仓库插件策略`:e||`已拦截`}function cg(e){return`repository:${e}`}function lg(e,t){let n=[...t.plugins.map(e=>cg(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 ug(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},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:{...Qh,...e.sensitive_data_policy,event_types:{...Zh,...e.sensitive_data_policy?.event_types},built_in_rules:{...Qh.built_in_rules,...e.sensitive_data_policy?.built_in_rules},custom_patterns:e.sensitive_data_policy?.custom_patterns??[]},agent_model_policy:{...$h,...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=lg(e.plugin_order,n),n}function dg(e){let t=1;for(;e.some(e=>e.id===`repository-${t}`);)t+=1;return`repository-${t}`}async function fg(e){let t=await e.json().catch(()=>({}));if(!e.ok||t.ok===!1)throw Error(t.message||`请求失败:${e.status}`);return t}function pg({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)(lh,{htmlFor:e,children:t}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n})]}),(0,S.jsx)(bh,{id:e,checked:r,onCheckedChange:i})]})}function mg({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)(lh,{htmlFor:e,className:`font-normal`,children:t}),(0,S.jsx)(bh,{id:e,checked:n,onCheckedChange:r})]})}function hg(){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)(yh,{className:`h-8 w-64`}),(0,S.jsx)(yh,{className:`h-4 w-80`})]}),(0,S.jsx)(yh,{className:`h-8 w-28`})]}),(0,S.jsx)(yh,{className:`h-24 w-full`}),(0,S.jsx)(yh,{className:`h-[420px] w-full`})]})}function gg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)({}),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(()=>ig($h)),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)({ok:!1}),[y,b]=(0,_.useState)([]),[x,C]=(0,_.useState)(!1),[w,T]=(0,_.useState)(``),[E,D]=(0,_.useState)(!1),[O,k]=(0,_.useState)(!1),[ee,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(!1),[N,te]=(0,_.useState)(null),P=(0,_.useCallback)(async()=>{try{let e=await fg(await fetch(`/api/config`,{cache:`no-store`})),n={...Xh,...e.gitAi};t(n),r(eg(n.exclude_repositories)),a(eg(n.exclude_prompts_in_repositories));let i=ug(e.policy);s(eg(i.skill_policy.blocked_patterns)),l(rg(i.plugins)),d(eg(i.sensitive_data_policy.custom_patterns)),p(ig(i.agent_model_policy)),h(i),v(e.runtime??{ok:!1}),D(!1)}catch(e){yr.error(e instanceof Error?e.message:`读取配置失败`)}},[]),F=(0,_.useCallback)(async()=>{C(!0);try{let e=await fg(await fetch(`/api/filter-events`,{cache:`no-store`}));b(Array.isArray(e.events)?e.events:[]),T(``)}catch(e){T(e instanceof Error?e.message:`读取过滤记录失败`)}finally{C(!1)}},[]);(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void P());return()=>window.cancelAnimationFrame(e)},[P]),(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void F()),t=window.setInterval(()=>void F(),3e4);return()=>{window.cancelAnimationFrame(e),window.clearInterval(t)}},[F]);let ne=(0,_.useMemo)(()=>m?.plugins.filter(e=>e.enabled)??[],[m]),re=(0,_.useMemo)(()=>ne.reduce((e,t)=>e+Object.values(t.allow).filter(Boolean).length,0),[ne]),ie=(m?.plugins.length??0)+ +!!m?.skill_policy.installed+ +!!m?.sensitive_data_policy.installed+ +!!m?.agent_model_policy.installed,ae=(m?.plugins.filter(e=>e.enabled).length??0)+(m?.skill_policy.installed&&m.skill_policy.enabled?1:0)+(m?.sensitive_data_policy.installed&&m.sensitive_data_policy.enabled?1:0)+(m?.agent_model_policy.installed&&m.agent_model_policy.enabled?1:0),I=(0,_.useMemo)(()=>new Map(m?.plugin_order.map((e,t)=>[e,t])),[m?.plugin_order]),L=(0,_.useMemo)(()=>ag(y,`repositories`),[y]),oe=(0,_.useMemo)(()=>ag(y,`skills`),[y]),R=(0,_.useMemo)(()=>[{title:`仓库`,items:L,emptyMessage:`尚未拦截包含仓库信息的上报`},{title:`Skills`,items:oe,emptyMessage:`尚未拦截 Skill 调用`}],[L,oe]),se=g.gitAiEnabled??m?.git_ai_enabled??!0,ce=m?.git_ai_enabled!==se,le=g.filter?.ok===!0,ue=(0,_.useMemo)(()=>{let e=[];return m&&e.push(`repository`),m?.skill_policy.installed||e.push(`skill_filter`),m?.sensitive_data_policy.installed||e.push(`sensitive_data`),m?.agent_model_policy.installed||e.push(`agent_model`),e},[m]),de=e=>{t(e),D(!0)},z=e=>{h(e),D(!0)},fe=(e,t)=>{m&&z({...m,plugins:m.plugins.map(n=>n.id===e?t(n):n)})},pe=(e,t,n)=>{l(r=>({...r,[ng(e,t)]:n})),fe(e,e=>({...e,match:{...e.match,[t]:tg(n)}}))},me=e=>{if(m){if(e===`repository`){let e=dg(m.plugins);l(t=>({...t,[ng(e,`hosts`)]:`example.com`,[ng(e,`repositories`)]:``,[ng(e,`directories`)]:``,[ng(e,`branches`)]:``})),z({...m,plugins:[...m.plugins,{id:e,name:`仓库插件 ${m.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(Kh).map(e=>[e,!1])),fields:Object.fromEntries(Object.keys(qh).map(e=>[e,!1]))}],plugin_order:[...m.plugin_order,cg(e)]})}else e===`skill_filter`?z({...m,skill_policy:{...m.skill_policy,installed:!0,enabled:!0},plugin_order:[...m.plugin_order,`skill_filter`]}):e===`sensitive_data`?z({...m,sensitive_data_policy:{...Qh,installed:!0,enabled:!0},plugin_order:[...m.plugin_order,`sensitive_data`]}):e===`agent_model`&&z({...m,agent_model_policy:{...$h,installed:!0,enabled:!0},plugin_order:[...m.plugin_order,`agent_model`]});A(!1)}},he=e=>{m&&(l(t=>Object.fromEntries(Object.entries(t).filter(([t])=>!t.startsWith(`${e}:`)))),z({...m,plugins:m.plugins.filter(t=>t.id!==e),plugin_order:m.plugin_order.filter(t=>t!==cg(e))}))},ge=()=>{m&&z({...m,skill_policy:{...m.skill_policy,installed:!1,enabled:!1},plugin_order:m.plugin_order.filter(e=>e!==`skill_filter`)})},_e=e=>{m&&z({...m,[e]:{...m[e],installed:!1,enabled:!1},plugin_order:m.plugin_order.filter(t=>t!==(e===`sensitive_data_policy`?`sensitive_data`:`agent_model`))})},ve=async()=>{if(!(!e||!m)){k(!0);try{let n=await fg(await fetch(`/api/config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({gitAi:e,policy:m})})),i={...Xh,...n.gitAi};t(i),r(eg(i.exclude_repositories)),a(eg(i.exclude_prompts_in_repositories));let o=ug(n.policy);s(eg(o.skill_policy.blocked_patterns)),l(rg(o.plugins)),d(eg(o.sensitive_data_policy.custom_patterns)),p(ig(o.agent_model_policy)),h(o),n.runtime&&v(n.runtime),D(!1),yr.success(`配置已保存,下一次上报立即使用新策略`)}catch(e){yr.error(e instanceof Error?e.message:`保存失败`)}finally{k(!1)}}},ye=async()=>{k(!0);let e=yr.loading(`正在验证配置`,{description:`检查插件策略、过滤脚本和本地服务连接…`});try{let t=await fetch(`/api/test`,{method:`POST`}),n=await t.json().catch(()=>({}));if(!t.ok||!Array.isArray(n.checks))throw Error(n.message||`请求失败:${t.status}`);let r=n.checks.filter(e=>!e.ok);r.length?yr.error(`配置验证失败`,{id:e,description:r.map(e=>e.message?`${e.name}:${e.message}`:e.name).join(`;`)}):yr.success(`配置验证通过`,{id:e,description:n.checks.map(e=>e.name).join(`、`)})}catch(t){yr.error(`配置验证失败`,{id:e,description:t instanceof Error?t.message:`验证请求失败`})}finally{k(!1)}},be=async()=>{k(!0);try{let e=await fg(await fetch(`/api/restart-filter`,{method:`POST`}));yr.success(e.message||`过滤服务已重启`),window.setTimeout(()=>void P(),900)}catch(e){yr.error(e instanceof Error?e.message:`重启失败`)}finally{k(!1)}},xe=async e=>{M(!0);try{let t=await fg(await fetch(`/api/config`,{cache:`no-store`}));te(e===`gitAi`?{title:`当前 Git AI 原生配置`,description:`读取 ~/.git-ai/config.json 中由本页面管理的已保存字段,未保存更改和敏感未知字段不会显示。`,content:t.gitAi}:{title:`当前插件策略配置`,description:`读取 ~/.git-ai/filter_plugins.json 中已写入磁盘的完整插件策略,未保存更改不会显示。`,content:t.policy})}catch(e){yr.error(e instanceof Error?e.message:`读取当前配置失败`)}finally{M(!1)}};return!e||!m?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(hg,{}),(0,S.jsx)(Vh,{position:`top-right`,richColors:!0,closeButton:!0,duration:5e3})]}):(0,S.jsxs)(Hh,{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)(er,{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:`Git AI 配置中心`}),(0,S.jsxs)(th,{variant:`outline`,className:`font-mono text-xs font-normal`,children:[`v`,`0.4.9`]})]}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`本机插件策略与上传权限`})]})]}),(0,S.jsxs)(th,{variant:g.distribution===`upstream-oss`?`outline`:g.ok?`secondary`:`destructive`,children:[(0,S.jsx)(Rn,{className:`size-3.5`}),g.distribution===`upstream-oss`?`上游 OSS · 原生配置`:g.ok?`定制版 · 过滤在线`:`定制版 · 过滤异常`]})]})}),(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)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`已安装插件`}),(0,S.jsxs)(ih,{className:`flex items-baseline gap-2 text-2xl`,children:[ie,(0,S.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[ae,` 个启用`]})]})]})}),(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`允许的数据通道`}),(0,S.jsx)(ih,{className:`text-2xl`,children:re})]})}),(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`配置状态`}),(0,S.jsxs)(ih,{className:`flex items-center gap-2 text-base`,children:[(0,S.jsx)(Bn,{className:`size-4 ${E?`text-amber-600`:`text-emerald-600`}`}),E?`有未保存更改`:`已同步`]})]})}),(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`当前 Git AI 状态`}),(0,S.jsxs)(ih,{className:`flex items-center gap-2 text-base`,children:[(0,S.jsx)(Rn,{className:`size-4 ${se?`text-emerald-600`:`text-amber-600`}`}),ce?m.git_ai_enabled?`开启(待保存)`:`暂停(待保存)`:se?`已开启`:`已暂停`]})]})}),(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{children:[(0,S.jsx)(ah,{children:`过滤服务状态`}),(0,S.jsxs)(ih,{className:`flex items-center gap-2 text-base`,children:[(0,S.jsx)(Rn,{className:`size-4 ${le?`text-emerald-600`:`text-destructive`}`}),le?`已在线`:`已离线`]})]})})]}),(0,S.jsxs)(xh,{defaultValue:`system`,children:[(0,S.jsxs)(Ch,{className:`w-full justify-start`,children:[(0,S.jsxs)(wh,{value:`system`,children:[(0,S.jsx)(Qn,{}),`Git AI 设置`]}),(0,S.jsxs)(wh,{value:`plugins`,children:[(0,S.jsx)(Yn,{}),`插件管理`]})]}),(0,S.jsx)(Th,{value:`system`,className:`mt-4`,children:(0,S.jsxs)(nh,{children:[(0,S.jsxs)(rh,{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)(ih,{children:`Git AI 原生设置`}),(0,S.jsx)(ah,{children:`写入 ~/.git-ai/config.json,未知字段会原样保留。`})]}),(0,S.jsx)(Hm,{variant:`outline`,size:`sm`,onClick:()=>void xe(`gitAi`),disabled:j,children:j?`读取中...`:`查看配置`})]}),(0,S.jsxs)(oh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsx)(pg,{id:`git-ai-enabled`,title:`Git AI`,description:m.git_ai_enabled?`已开启:按当前插件策略处理并转发 Git AI 上报`:`已暂停:全部 Git AI 上报会在本机拦截,恢复后继续按原策略处理`,checked:m.git_ai_enabled,onCheckedChange:e=>z({...m,git_ai_enabled:e})}),(0,S.jsx)(pg,{id:`auto-updates`,title:`自动更新`,description:`检测到稳定版本后自动安装`,checked:!e.disable_auto_updates,onCheckedChange:t=>de({...e,disable_auto_updates:!t})}),(0,S.jsx)(pg,{id:`version-checks`,title:`版本检查`,description:`在 fetch、pull、push 时检查版本`,checked:!e.disable_version_checks,onCheckedChange:t=>de({...e,disable_version_checks:!t})}),(0,S.jsx)(pg,{id:`oss-telemetry`,title:`上游 OSS 遥测`,description:`控制官方版的 Sentry/PostHog 遥测,不等同于细粒度事件过滤`,checked:e.telemetry_oss!==`off`,onCheckedChange:t=>de({...e,telemetry_oss:t?`on`:`off`})})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`git-path`,children:`Git 可执行文件`}),(0,S.jsx)(ch,{id:`git-path`,className:`font-mono`,value:e.git_path,onChange:t=>de({...e,git_path:t.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)(lh,{htmlFor:`exclude-repositories`,children:`排除的仓库`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一个远程地址、路径或通配符。匹配后 Git AI 整体停用。`}),(0,S.jsx)(Eh,{id:`exclude-repositories`,className:`min-h-44 font-mono text-xs`,value:n,onChange:t=>{let n=t.target.value;r(n),de({...e,exclude_repositories:tg(n)})}})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`exclude-prompts`,children:`不保存提示词的仓库`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一个规则,只影响提示词与会话内容。`}),(0,S.jsx)(Eh,{id:`exclude-prompts`,className:`min-h-44 font-mono text-xs`,value:i,onChange:t=>{let n=t.target.value;a(n),de({...e,exclude_prompts_in_repositories:tg(n)})}})]})]})]})]})}),(0,S.jsxs)(Th,{value:`plugins`,className:`mt-4 space-y-4`,children:[(0,S.jsx)(nh,{size:`sm`,children:(0,S.jsxs)(rh,{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)(ih,{children:`Git AI 运行兼容性`}),(0,S.jsx)(ah,{children:g.distribution===`upstream-oss`?`检测到官方上游版:原生设置生效,但官方版没有 custom_metrics 扩展点,下面的仓库和 Skill 细粒度上报规则不会接管 /worker/metrics/upload。仓库插件可以添加多个,主机规则重叠时按列表顺序使用第一个命中插件。`:`检测到 custom_metrics 定制版:仓库、Skill、数据类型和字段规则会在请求离开本机前执行。仓库插件可以添加多个,主机规则重叠时按列表顺序使用第一个命中插件。`})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(Hm,{variant:`outline`,size:`sm`,onClick:()=>void xe(`policy`),disabled:j,children:j?`读取中...`:`查看配置`}),(0,S.jsx)(th,{variant:g.granularFilterActive?`secondary`:`outline`,children:g.granularFilterActive?`细粒度过滤已接管`:`仅原生配置兼容`})]})]})}),(0,S.jsxs)(nh,{className:`overflow-hidden`,children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)(Rn,{}),`过滤观察`]}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(ih,{children:`最近 24 小时的拦截记录`}),(0,S.jsxs)(ah,{children:[`已拦截 `,y.length,` 次上报,按仓库和 Skill 汇总。`]})]})]}),(0,S.jsxs)(Hm,{variant:`outline`,size:`sm`,onClick:()=>void F(),disabled:x,children:[(0,S.jsx)(Xn,{className:x?`animate-spin`:void 0}),`刷新记录`]})]}),(0,S.jsxs)(oh,{className:`space-y-4 pt-6`,children:[w?(0,S.jsxs)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:[`无法读取过滤记录:`,w]}):(0,S.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:R.map(({title:e,items:t,emptyMessage:n})=>(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:e}),(0,S.jsxs)(th,{variant:`outline`,children:[t.length,` 项`]})]}),t.length?(0,S.jsx)(`ul`,{className:`divide-y`,children:t.map(e=>(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:e.name}),(0,S.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[sg(e.reason),` · 最近 `,og(e.timestamp)]})]}),(0,S.jsxs)(th,{variant:`secondary`,className:`shrink-0`,children:[e.count,` 次`]})]},e.name))}):(0,S.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:n})]},e))}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`记录仅保存在本机 24 小时,包含时间、仓库或 Skill 标识及拦截原因,不保存上报正文。`})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[m.plugins.map(e=>(0,S.jsxs)(nh,{style:{order:I.get(cg(e.id))},children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)(Un,{}),`仓库插件`]}),(0,S.jsx)(ch,{"aria-label":`插件名称`,className:`max-w-md text-base font-medium`,value:e.name,onChange:t=>fe(e.id,e=>({...e,name:t.target.value}))}),(0,S.jsxs)(ah,{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)(lh,{htmlFor:`plugin-${e.id}`,children:`启用`}),(0,S.jsx)(bh,{id:`plugin-${e.id}`,checked:e.enabled,onCheckedChange:t=>fe(e.id,e=>({...e,enabled:t}))})]}),(0,S.jsxs)(Um,{children:[(0,S.jsxs)(Uh,{children:[(0,S.jsx)(Wh,{asChild:!0,children:(0,S.jsx)(Wm,{asChild:!0,children:(0,S.jsx)(Hm,{variant:`ghost`,size:`icon`,"aria-label":`删除插件 ${e.name}`,children:(0,S.jsx)(tr,{})})})}),(0,S.jsx)(Gh,{children:`删除当前插件`})]}),(0,S.jsxs)(qm,{children:[(0,S.jsxs)(Jm,{children:[(0,S.jsx)(Xm,{children:`删除仓库插件?`}),(0,S.jsxs)(Zm,{children:[`将删除“`,e.name,`”的全部配置。保存更改前不会写入磁盘。`]})]}),(0,S.jsxs)(Ym,{children:[(0,S.jsx)($m,{children:`取消`}),(0,S.jsx)(Qm,{onClick:()=>he(e.id),children:`删除`})]})]})]})]})]}),(0,S.jsxs)(oh,{className:`space-y-6`,children:[(0,S.jsx)(pg,{id:`default-allow`,title:`未匹配主机的仓库`,description:`控制未命中此插件主机规则的仓库是否允许原始上报`,checked:m.default_allow_unmatched,onCheckedChange:e=>z({...m,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)(pg,{id:`global-${e.id}`,title:`全部仓库(全局规则)`,description:`全局规则始终排在所有特定仓库规则之后,适合作为默认策略。`,checked:e.match.all_repositories,onCheckedChange:t=>fe(e.id,e=>({...e,match:{...e.match,all_repositories:t}}))}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`priority-${e.id}`,children:`特定规则优先级`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`数值越大越优先;同优先级按插件列表顺序匹配。`}),(0,S.jsx)(ch,{id:`priority-${e.id}`,type:`number`,min:`0`,max:`1000`,value:e.priority,onChange:t=>{let n=Number.parseInt(t.target.value,10);fe(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)(lh,{htmlFor:`directory-${e.id}`,children:`Skill 上报目录`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`仅替换此插件允许上传的 Skill 路径。留空则保留原路径。`}),(0,S.jsx)(ch,{id:`directory-${e.id}`,className:`font-mono`,value:e.fixed_project_directory,onChange:t=>fe(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)(Hn,{className:`size-4`}),`上报目录预览`]}),(0,S.jsx)(`p`,{className:`mt-2 break-all font-mono text-xs text-muted-foreground`,children:e.fixed_project_directory||`保留原路径`})]})]})]}),!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)(lh,{htmlFor:`hosts-${e.id}`,children:`匹配仓库主机`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:"每行一条,可用 `github.com` 或 `*github.com*`。"}),(0,S.jsx)(Eh,{id:`hosts-${e.id}`,className:`min-h-28 font-mono text-xs`,value:c[ng(e.id,`hosts`)]??eg(e.match.hosts),onChange:t=>pe(e.id,`hosts`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`repositories-${e.id}`,children:`匹配仓库`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一条,可填 owner/repo、远程地址或通配符。`}),(0,S.jsx)(Eh,{id:`repositories-${e.id}`,className:`min-h-28 font-mono text-xs`,value:c[ng(e.id,`repositories`)]??eg(e.match.repositories),onChange:t=>pe(e.id,`repositories`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`directories-${e.id}`,children:`匹配项目目录`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:"多条件会同时生效;可用 `/work/*` 缩小范围。"}),(0,S.jsx)(Eh,{id:`directories-${e.id}`,className:`min-h-28 font-mono text-xs`,value:c[ng(e.id,`directories`)]??eg(e.match.directories),onChange:t=>pe(e.id,`directories`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`branches-${e.id}`,children:`匹配分支`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一条,例如 main、release/* 或 feature/*。`}),(0,S.jsx)(Eh,{id:`branches-${e.id}`,className:`min-h-28 font-mono text-xs`,value:c[ng(e.id,`branches`)]??eg(e.match.branches),onChange:t=>pe(e.id,`branches`,t.target.value)})]})]}),(0,S.jsx)(vh,{}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:`允许上传的数据`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每类事件可单独启用,关闭时请求会在本机被拦截。`})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:Object.keys(Kh).map(t=>(0,S.jsx)(mg,{id:`${e.id}-event-${t}`,label:Kh[t],checked:e.allow[t],onCheckedChange:n=>fe(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:`允许保留的字段`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`关闭的仓库、目录和分支字段会在请求离开本机前删除。`})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:Object.keys(qh).map(t=>(0,S.jsx)(mg,{id:`${e.id}-field-${t}`,label:qh[t],checked:e.fields[t],onCheckedChange:n=>fe(e.id,e=>({...e,fields:{...e.fields,[t]:n}}))},t))})]})]}),(0,S.jsxs)(sh,{className:`justify-between border-t`,children:[(0,S.jsx)(th,{variant:e.enabled?`outline`:`secondary`,children:e.enabled?`${Object.values(e.allow).filter(Boolean).length}/7 数据类型 · ${Object.values(e.fields).filter(Boolean).length}/3 字段`:`插件已停用`}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.match.all_repositories?`全局默认策略`:`特定规则 · 优先级 ${e.priority}`})]})]},e.id)),m.skill_policy.installed&&(0,S.jsxs)(nh,{style:{order:I.get(`skill_filter`)},children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)(Gn,{}),`Skill 过滤插件`]}),(0,S.jsx)(ih,{children:`Skill 关键词过滤`}),(0,S.jsx)(ah,{children:`根据 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)(lh,{htmlFor:`skill-enabled`,children:`启用`}),(0,S.jsx)(bh,{id:`skill-enabled`,checked:m.skill_policy.enabled,onCheckedChange:e=>z({...m,skill_policy:{...m.skill_policy,enabled:e}})})]}),(0,S.jsxs)(Um,{children:[(0,S.jsxs)(Uh,{children:[(0,S.jsx)(Wh,{asChild:!0,children:(0,S.jsx)(Wm,{asChild:!0,children:(0,S.jsx)(Hm,{variant:`ghost`,size:`icon`,"aria-label":`删除插件 Skill 过滤插件`,children:(0,S.jsx)(tr,{})})})}),(0,S.jsx)(Gh,{children:`删除 Skill 过滤插件`})]}),(0,S.jsxs)(qm,{children:[(0,S.jsxs)(Jm,{children:[(0,S.jsx)(Xm,{children:`删除 Skill 过滤插件?`}),(0,S.jsx)(Zm,{children:`删除后关键词拦截将停用,现有关键词会保留,重新添加插件时可以继续使用。`})]}),(0,S.jsxs)(Ym,{children:[(0,S.jsx)($m,{children:`取消`}),(0,S.jsx)(Qm,{onClick:ge,children:`删除`})]})]})]})]})]}),(0,S.jsx)(oh,{children:(0,S.jsxs)(`div`,{className:`max-w-2xl space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`blocked-patterns`,children:`拦截关键词 / 正则`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`每行一个,不区分大小写。命中 skillName、skill 或 name 即拦截。`}),(0,S.jsx)(Eh,{id:`blocked-patterns`,className:`min-h-72 font-mono text-xs`,value:o,onChange:e=>{let t=e.target.value;s(t),z({...m,skill_policy:{...m.skill_policy,blocked_patterns:tg(t)}})}})]})}),(0,S.jsxs)(sh,{className:`justify-between border-t`,children:[(0,S.jsx)(th,{variant:m.skill_policy.enabled?`outline`:`secondary`,children:m.skill_policy.enabled?`${m.skill_policy.blocked_patterns.length} 条拦截规则`:`插件已停用`}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`仅处理 Skill 调用名称`})]})]}),m.sensitive_data_policy.installed&&(0,S.jsxs)(nh,{style:{order:I.get(`sensitive_data`)},children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)($n,{}),`敏感内容脱敏插件`]}),(0,S.jsx)(ih,{children:`请求内容二次保护`}),(0,S.jsx)(ah,{children:`在请求离开本机前检测文本。不会保存命中的原始内容。`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(lh,{htmlFor:`sensitive-enabled`,children:`启用`}),(0,S.jsx)(bh,{id:`sensitive-enabled`,checked:m.sensitive_data_policy.enabled,onCheckedChange:e=>z({...m,sensitive_data_policy:{...m.sensitive_data_policy,enabled:e}})}),(0,S.jsx)(Hm,{variant:`ghost`,size:`icon`,"aria-label":`删除敏感内容脱敏插件`,onClick:()=>_e(`sensitive_data_policy`),children:(0,S.jsx)(tr,{})})]})]}),(0,S.jsxs)(oh,{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)(lh,{htmlFor:`sensitive-action`,children:`命中后的动作`}),(0,S.jsxs)(`select`,{id:`sensitive-action`,className:`h-9 w-full rounded-md border bg-background px-3 text-sm`,value:m.sensitive_data_policy.action,onChange:e=>z({...m,sensitive_data_policy:{...m.sensitive_data_policy,action:e.target.value}}),children:[(0,S.jsx)(`option`,{value:`redact`,children:`脱敏后继续上报`}),(0,S.jsx)(`option`,{value:`block`,children:`直接阻止上报`})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`sensitive-patterns`,children:`自定义正则`}),(0,S.jsx)(Eh,{id:`sensitive-patterns`,className:`min-h-24 font-mono text-xs`,placeholder:`每行一个正则`,value:u,onChange:e=>{let t=e.target.value;d(t),z({...m,sensitive_data_policy:{...m.sensitive_data_policy,custom_patterns:tg(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:`内置识别规则`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`默认启用密钥、私钥和凭据;邮箱与手机号由你决定是否纳入。`})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-5`,children:[[`api_key`,`API Key`],[`private_key`,`私钥`],[`credential`,`密码 / 凭据`],[`email`,`邮箱`],[`phone`,`手机号`]].map(([e,t])=>(0,S.jsx)(mg,{id:`sensitive-${e}`,label:t,checked:m.sensitive_data_policy.built_in_rules[e],onCheckedChange:t=>z({...m,sensitive_data_policy:{...m.sensitive_data_policy,built_in_rules:{...m.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:`作用数据类型`}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:Object.keys(Kh).map(e=>(0,S.jsx)(mg,{id:`sensitive-event-${e}`,label:Kh[e],checked:m.sensitive_data_policy.event_types[e],onCheckedChange:t=>z({...m,sensitive_data_policy:{...m.sensitive_data_policy,event_types:{...m.sensitive_data_policy.event_types,[e]:t}}})},e))})]})]})]}),m.agent_model_policy.installed&&(0,S.jsxs)(nh,{style:{order:I.get(`agent_model`)},children:[(0,S.jsxs)(rh,{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)(th,{variant:`secondary`,children:[(0,S.jsx)(zn,{}),`Agent / 模型治理插件`]}),(0,S.jsx)(ih,{children:`允许名单与阻止规则`}),(0,S.jsx)(ah,{children:`允许名单支持通配符;审计模式只记录本地统计,阻止模式会拦截不合规上报。`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(lh,{htmlFor:`agent-model-enabled`,children:`启用`}),(0,S.jsx)(bh,{id:`agent-model-enabled`,checked:m.agent_model_policy.enabled,onCheckedChange:e=>z({...m,agent_model_policy:{...m.agent_model_policy,enabled:e}})}),(0,S.jsx)(Hm,{variant:`ghost`,size:`icon`,"aria-label":`删除 Agent / 模型治理插件`,onClick:()=>_e(`agent_model_policy`),children:(0,S.jsx)(tr,{})})]})]}),(0,S.jsxs)(oh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`max-w-md space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`agent-model-mode`,children:`治理模式`}),(0,S.jsxs)(`select`,{id:`agent-model-mode`,className:`h-9 w-full rounded-md border bg-background px-3 text-sm`,value:m.agent_model_policy.mode,onChange:e=>z({...m,agent_model_policy:{...m.agent_model_policy,mode:e.target.value}}),children:[(0,S.jsx)(`option`,{value:`audit`,children:`仅审计,不阻止`}),(0,S.jsx)(`option`,{value:`block`,children:`命中规则时阻止`})]})]}),(0,S.jsx)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[[`allowed_agents`,`允许的 Agent`,`例如 codex、claude*`],[`allowed_models`,`允许的模型`,`例如 gpt-5*、claude-sonnet-*`],[`blocked_patterns`,`阻止正则`,`每行一个,不区分大小写`]].map(([e,t,n])=>(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(lh,{htmlFor:`agent-model-${e}`,children:t}),(0,S.jsx)(Eh,{id:`agent-model-${e}`,className:`min-h-40 font-mono text-xs`,placeholder:n,value:f[e],onChange:t=>{let n=t.target.value;p(t=>({...t,[e]:n})),z({...m,agent_model_policy:{...m.agent_model_policy,[e]:tg(n)}})}})]},e))})]})]}),!m.plugins.length&&!m.skill_policy.installed&&!m.sensitive_data_policy.installed&&!m.agent_model_policy.installed&&(0,S.jsx)(nh,{children:(0,S.jsxs)(oh,{className:`flex min-h-40 flex-col items-center justify-center gap-2 text-center`,children:[(0,S.jsx)(Yn,{className:`size-6 text-muted-foreground`}),(0,S.jsx)(`p`,{className:`font-medium`,children:`还没有安装插件`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`添加插件后,这里会出现对应类型的配置模块。`})]})})]}),(0,S.jsxs)(uh,{open:ee,onOpenChange:A,children:[(0,S.jsx)(dh,{asChild:!0,children:(0,S.jsxs)(Hm,{variant:`outline`,className:`w-full`,disabled:!ue.length,children:[(0,S.jsx)(Jn,{}),ue.length?`添加插件`:`所有可用插件均已添加`]})}),(0,S.jsxs)(mh,{children:[(0,S.jsxs)(hh,{children:[(0,S.jsx)(gh,{children:`添加插件`}),(0,S.jsx)(_h,{children:`仓库插件可以添加多个;其余插件使用独立配置表单且每种只能添加一次。新插件会追加到当前列表最后。`})]}),(0,S.jsxs)(`div`,{className:`grid gap-2`,children:[ue.includes(`repository`)&&(0,S.jsxs)(Hm,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>me(`repository`),children:[(0,S.jsx)(Un,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:`仓库插件`}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:`配置仓库主机、上传类型、目录与字段脱敏`})]})]}),ue.includes(`skill_filter`)&&(0,S.jsxs)(Hm,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>me(`skill_filter`),children:[(0,S.jsx)(Gn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:`Skill 过滤插件`}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:`配置需要拦截的 Skill 名称关键词或正则`})]})]}),ue.includes(`sensitive_data`)&&(0,S.jsxs)(Hm,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>me(`sensitive_data`),children:[(0,S.jsx)($n,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:`敏感内容脱敏`}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:`检测密钥、私钥、凭据等文本,可脱敏或阻止上报`})]})]}),ue.includes(`agent_model`)&&(0,S.jsxs)(Hm,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>me(`agent_model`),children:[(0,S.jsx)(zn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:`Agent / 模型治理`}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:`设置 Agent、模型允许名单与阻止规则`})]})]})]})]})]})]})]})]}),(0,S.jsx)(uh,{open:!!N,onOpenChange:e=>{e||te(null)},children:(0,S.jsxs)(mh,{className:`w-[96vw] max-w-6xl sm:max-w-6xl`,children:[(0,S.jsxs)(hh,{children:[(0,S.jsx)(gh,{children:N?.title}),(0,S.jsx)(_h,{children:N?.description})]}),(0,S.jsx)(`div`,{className:`max-h-[70svh] overflow-auto rounded-lg border bg-muted/50 p-4`,children:N&&(0,S.jsx)(B,{value:N.content,collapsed:!1,displayDataTypes:!1,enableClipboard:!1,shortenTextAfterLength:0,style:Dn})})]})}),(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)(Bn,{className:`size-4 ${E?`text-amber-600`:`text-emerald-600`}`}),E?`有未保存的更改`:`配置已同步`]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,S.jsxs)(Hm,{variant:`outline`,onClick:ye,disabled:O,children:[(0,S.jsx)(Vn,{}),`验证配置`]}),(0,S.jsxs)(Hm,{variant:`outline`,onClick:be,disabled:O,children:[(0,S.jsx)(Xn,{className:O?`animate-spin`:``}),`重启过滤服务`]}),(0,S.jsxs)(Hm,{onClick:ve,disabled:O||!E,children:[O?(0,S.jsx)(Kn,{className:`animate-spin`}):(0,S.jsx)(Zn,{}),`保存更改`]})]})]})})]}),(0,S.jsx)(Vh,{position:`top-right`,richColors:!0,closeButton:!0,duration:5e3})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(Ph,{attribute:`class`,defaultTheme:`light`,enableSystem:!1,children:(0,S.jsx)(gg,{})})}));
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-7Qs4-mts.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-t5Osu3Sa.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-CpOHU4DS.css">
10
10
  </head>
11
11
  <body>