ylcwf 0.4.0 → 0.5.1

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.
@@ -46,7 +46,7 @@ Error generating stack: `+e.message+`
46
46
  `},Es=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ds=function(){v.useEffect(function(){return document.body.setAttribute(ws,(Es()+1).toString()),function(){var e=Es()-1;e<=0?document.body.removeAttribute(ws):document.body.setAttribute(ws,e.toString())}},[])},Os=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ds();var a=v.useMemo(function(){return Ss(i)},[i]);return v.createElement(Cs,{styles:Ts(a,!t,i,n?``:`!important`)})},ks=!1;if(typeof window<`u`)try{var As=Object.defineProperty({},"passive",{get:function(){return ks=!0,!0}});window.addEventListener(`test`,As,As),window.removeEventListener(`test`,As,As)}catch{ks=!1}var js=ks?{passive:!1}:!1,Ms=function(e){return e.tagName===`TEXTAREA`},Ns=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ms(e)&&n[t]===`visible`)},Ps=function(e){return Ns(e,`overflowY`)},Fs=function(e){return Ns(e,`overflowX`)},Is=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),zs(e,r)){var i=Bs(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ls=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Rs=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},zs=function(e,t){return e===`v`?Ps(t):Fs(t)},Bs=function(e,t){return e===`v`?Ls(t):Rs(t)},Vs=function(e,t){return e===`h`&&t===`rtl`?-1:1},Hs=function(e,t,n,r,i){var a=Vs(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Bs(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&zs(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Us=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ws=function(e){return[e.deltaX,e.deltaY]},Gs=function(e){return e&&`current`in e?e.current:e},Ks=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qs=function(e){return`
47
47
  .block-interactivity-${e} {pointer-events: none;}
48
48
  .allow-interactivity-${e} {pointer-events: all;}
49
- `},Js=0,Ys=[];function Xs(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Js++)[0],a=v.useState(vs)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Jo([e.lockRef.current],(e.shards||[]).map(Gs),!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=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Us(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=Is(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Is(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 Hs(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(Ys.length&&Ys[Ys.length-1]===a){var r=`deltaY`in n?Ws(n):Us(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ks(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Gs).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=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Zs(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Us(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Ws(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Us(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Ys.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,js),document.addEventListener(`touchmove`,c,js),document.addEventListener(`touchstart`,u,js),function(){Ys=Ys.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,js),document.removeEventListener(`touchmove`,c,js),document.removeEventListener(`touchstart`,u,js)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:qs(i)}):null,p?v.createElement(Os,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zs(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Qs=cs(ls,Xs),$s=v.forwardRef(function(e,t){return v.createElement(ds,Ko({},e,{ref:t,sideCar:Qs}))});$s.classNames=ds.classNames;var ec=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},tc=new WeakMap,nc=new WeakMap,rc={},ic=0,ac=function(e){return e&&(e.host||ac(e.parentNode))},oc=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ac(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})},sc=function(e,t,n,r){var i=oc(t,Array.isArray(e)?e:[e]);rc[n]||(rc[n]=new WeakMap);var a=rc[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=(tc.get(e)||0)+1,l=(a.get(e)||0)+1;tc.set(e,c),a.set(e,l),o.push(e),c===1&&i&&nc.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(),ic++,function(){o.forEach(function(e){var t=tc.get(e)-1,i=a.get(e)-1;tc.set(e,t),a.set(e,i),t||(nc.has(e)||e.removeAttribute(r),nc.delete(e)),i||e.removeAttribute(n)}),ic--,ic||(tc=new WeakMap,tc=new WeakMap,nc=new WeakMap,rc={})}},cc=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ec(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),sc(r,i,n,`aria-hidden`)):function(){return null}},lc=Object.defineProperty,uc=(e,t)=>lc(e,`name`,{value:t,configurable:!0}),dc=`Dialog`,[fc,pc]=va(dc),[mc,hc]=fc(dc),gc=uc(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),{nodes:l,registry:u}=go(),[d,f]=Pa({prop:r,defaultProp:i??!1,onChange:a,caller:dc}),[p,m]=v.useState(0),[h,g]=v.useState(0);return(0,H.jsx)(mc,{scope:t,triggerRef:s,contentRef:c,contentId:Ta(),titleId:Ta(),descriptionId:Ta(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),_c=`DialogPortal`,[vc,yc]=fc(_c,{forceMount:void 0}),bc=uc(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=hc(_c,t);return(0,H.jsx)(vc,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,H.jsx)(Po,{present:n||a.open,children:(0,H.jsx)(Ao,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),xc=`DialogOverlay`,Sc=v.forwardRef(uc(function(e,t){let n=yc(xc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hc(xc,e.__scopeDialog);return a.modal?(0,H.jsx)(Po,{present:r||a.open,children:(0,H.jsx)(wc,{...i,ref:t})}):null},`DialogOverlay`)),Cc=Ln(`DialogOverlay.RemoveScroll`),wc=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,...r}=e,i=hc(xc,n),a=Pn(t,to());return(0,H.jsx)($s,{as:Cc,allowPinchZoom:!0,shards:v.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,H.jsx)(Va.div,{"data-state":Fc(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Tc=`DialogContent`,Ec=v.forwardRef(uc(function(e,t){let n=yc(Tc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hc(Tc,e.__scopeDialog);return(0,H.jsx)(Po,{present:r||a.open,children:a.modal?(0,H.jsx)(Dc,{...i,ref:t}):(0,H.jsx)(Oc,{...i,ref:t})})},`DialogContent`)),Dc=v.forwardRef(uc(function(e,t){let n=hc(Tc,e.__scopeDialog),r=v.useRef(null),i=Pn(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return cc(e)},[]),(0,H.jsx)(kc,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ua(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ua(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ua(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Oc=v.forwardRef(uc(function(e,t){let n=hc(Tc,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,H.jsx)(kc,{...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`)),kc=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=hc(Tc,n);return Wo(),(0,H.jsx)(ho,{registry:l.branchRegistry,children:(0,H.jsx)(po,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(eo,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Pc(o,l.descriptionId):o,"data-state":Fc(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Ac=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,...r}=e,i=hc(`DialogTitle`,n),{setTitleCount:a}=i;return ba(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(Va.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),jc=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,...r}=e,i=hc(`DialogDescription`,n),{setDescriptionCount:a}=i;return ba(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(Va.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Mc=`DialogClose`,Nc=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,...r}=e,i=hc(Mc,n);return(0,H.jsx)(Va.button,{type:`button`,...r,ref:t,onClick:ua(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Pc(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}uc(Pc,`concatAriaDescribedby`);function Fc(e){return e?`open`:`closed`}uc(Fc,`getState`);var Ic=Object.defineProperty,Lc=(e,t)=>Ic(e,`name`,{value:t,configurable:!0});function Rc(e,[t,n]){return Math.min(n,Math.max(t,e))}Lc(Rc,`clamp`);var zc=Object.defineProperty,Bc=(e,t)=>zc(e,`name`,{value:t,configurable:!0});function Vc(e){let t=e+`CollectionProvider`,[n,r]=va(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Bc(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,H.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Ln(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Pn(t,a(s,n).collectionRef);return(0,H.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Ln(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=Pn(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,H.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Bc(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Bc(Vc,`createCollection`);var Hc=new WeakMap,Uc=class e extends Map{static{Bc(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Hc.set(this,!0)}set(e,t){return Hc.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=Kc(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Wc(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Wc(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Wc(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Wc(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Gc(e,t);return n===-1?void 0:e[n]}Bc(Wc,`at`);function Gc(e,t){let n=e.length,r=Kc(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Bc(Gc,`toSafeIndex`);function Kc(e){return e!==e||e===0?0:Math.trunc(e)}Bc(Kc,`toSafeInteger`);function qc(e){let t=e+`CollectionProvider`,[n,r]=va(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=Bc(({state:e,...t})=>e?(0,H.jsx)(u,{...t,state:e}):(0,H.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=Bc(e=>{let t=_();return(0,H.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=Bc(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[s,c]=v.useState(null),l=Pn(a,c),[u,d]=r,f=v.useRef(new Uc),p=v.useCallback(()=>{let e=f.current;return Xc(e)||e.sort(Zc),e},[]);return v.useEffect(()=>{if(!s)return;let e=Qc(()=>{d(e=>{let t=e.toSorted(Zc);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,H.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,H.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=Ln(d),p=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Pn(t,a(d,n).collectionElementRef);return(0,H.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Ln(m),g=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=v.useRef(i);Jc(l.current,i)||(l.current=i);let u=l.current,d=Pn(t,v.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);ba(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=v.useRef(null);return v.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new Uc(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(Zc)}))}),v.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new Uc(t);return n.delete(e.element),n})},[s]),(0,H.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return v.useState(new Uc)}Bc(_,`useInitCollection`);function y(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}Bc(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Bc(b,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:_}]}Bc(qc,`createCollection`);function Jc(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Bc(Jc,`shallowEqual`);function Yc(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Bc(Yc,`isElementPreceding`);function Xc(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Bc(Xc,`isInDocumentOrder`);function Zc(e,t){return!e[1].element||!t[1].element?0:Yc(e[1].element,t[1].element)?-1:1}Bc(Zc,`sortByDocumentPosition`);function Qc(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Bc(Qc,`getChildListObserver`);var $c=Object.defineProperty,el=(e,t)=>$c(e,`name`,{value:t,configurable:!0}),tl={LTR:`ltr`,RTL:`rtl`},nl=v.createContext(void 0);function rl(e){let t=v.useContext(nl);return e||t||tl.LTR}el(rl,`useDirection`);var il=[`top`,`right`,`bottom`,`left`],al=Math.min,ol=Math.max,sl=Math.round,cl=Math.floor,ll=e=>({x:e,y:e}),ul={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function dl(e,t,n){return ol(e,al(t,n))}function fl(e,t){return typeof e==`function`?e(t):e}function pl(e){return e.split(`-`)[0]}function ml(e){return e.split(`-`)[1]}function hl(e){return e===`x`?`y`:`x`}function gl(e){return e===`y`?`height`:`width`}function _l(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function vl(e){return hl(_l(e))}function yl(e,t,n){n===void 0&&(n=!1);let r=ml(e),i=vl(e),a=gl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ol(o)),[o,Ol(o)]}function bl(e){let t=Ol(e);return[xl(e),t,xl(t)]}function xl(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Sl=[`left`,`right`],Cl=[`right`,`left`],wl=[`top`,`bottom`],Tl=[`bottom`,`top`];function El(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Cl:Sl:t?Sl:Cl;case`left`:case`right`:return t?wl:Tl;default:return[]}}function Dl(e,t,n,r){let i=ml(e),a=El(pl(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(xl)))),a}function Ol(e){let t=pl(e);return ul[t]+e.slice(t.length)}function kl(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Al(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:kl(e)}function jl(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 Ml(e,t,n){let{reference:r,floating:i}=e,a=_l(t),o=vl(t),s=gl(o),c=pl(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=ml(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Nl(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=fl(t,e),p=Al(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=jl(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=jl(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 Pl=50,Fl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Nl},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ml(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<Pl&&(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}=Ml(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Il=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}=fl(e,t)||{};if(l==null)return{};let d=Al(u),f={x:n,y:r},p=vl(i),m=gl(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=al(d[_],T),D=al(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=dl(E,k,O),j=!c.arrow&&ml(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Ll=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}=fl(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=pl(r),_=_l(o),v=pl(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ol(o)]:bl(o)),x=p!==`none`;!d&&x&&b.push(...Dl(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=yl(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`||_===_l(t)||T.every(e=>_l(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=_l(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}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 zl(e){return il.some(t=>e[t]>=0)}var Bl=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=fl(e,t);switch(i){case`referenceHidden`:{let e=Rl(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zl(e)}}}case`escaped`:{let e=Rl(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:zl(e)}}}default:return{}}}}},Vl=new Set([`left`,`top`]);async function Hl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=pl(n),s=ml(n),c=_l(n)===`y`,l=Vl.has(o)?-1:1,u=a&&c?-1:1,d=fl(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 Ul=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 Hl(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}}}}},Wl=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}=fl(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=_l(i),p=hl(f),m=u[p],h=u[f],g=(e,t)=>dl(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}}}}}},Gl=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}=fl(e,t),u={x:n,y:r},d=_l(i),f=hl(d),p=u[f],m=u[d],h=fl(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=Vl.has(pl(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}}}},Kl=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}=fl(e,t),c=await i.detectOverflow(t,s),l=pl(n),u=ml(n),d=_l(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=al(p-c[m],g),y=al(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*ol(c.left,c.right):S=p-2*ol(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 ql(){return typeof window<`u`}function Jl(e){return Zl(e)?(e.nodeName||``).toLowerCase():`#document`}function Yl(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xl(e){return((Zl(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Zl(e){return ql()?e instanceof Node||e instanceof Yl(e).Node:!1}function Ql(e){return ql()?e instanceof Element||e instanceof Yl(e).Element:!1}function $l(e){return ql()?e instanceof HTMLElement||e instanceof Yl(e).HTMLElement:!1}function eu(e){return!ql()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Yl(e).ShadowRoot}function tu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=fu(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function nu(e){return/^(table|td|th)$/.test(Jl(e))}function ru(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var iu=/transform|translate|scale|rotate|perspective|filter/,au=/paint|layout|strict|content/,ou=e=>!!e&&e!==`none`,su;function cu(e){let t=Ql(e)?fu(e):e;return ou(t.transform)||ou(t.translate)||ou(t.scale)||ou(t.rotate)||ou(t.perspective)||!uu()&&(ou(t.backdropFilter)||ou(t.filter))||iu.test(t.willChange||``)||au.test(t.contain||``)}function lu(e){let t=mu(e);for(;$l(t)&&!du(t);){if(cu(t))return t;if(ru(t))return null;t=mu(t)}return null}function uu(){return su??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),su}function du(e){return/^(html|body|#document)$/.test(Jl(e))}function fu(e){return Yl(e).getComputedStyle(e)}function pu(e){return Ql(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mu(e){if(Jl(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||eu(e)&&e.host||Xl(e);return eu(t)?t.host:t}function hu(e){let t=mu(e);return du(t)?(e.ownerDocument||e).body:$l(t)&&tu(t)?t:hu(t)}function gu(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=hu(e),i=r===e.ownerDocument?.body,a=Yl(r);if(i){let e=_u(a);return t.concat(a,a.visualViewport||[],tu(r)?r:[],e&&n?gu(e):[])}return t.concat(r,gu(r,[],n))}function _u(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vu(e){let t=fu(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=$l(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=sl(n)!==a||sl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function yu(e){return Ql(e)?e:e.contextElement}function bu(e){let t=yu(e);if(!$l(t))return ll(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=vu(t),o=(a?sl(n.width):n.width)/r,s=(a?sl(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var xu=ll(0);function Su(e){let t=Yl(e);return!uu()||!t.visualViewport?xu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Cu(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Yl(e)}function wu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=yu(e),o=ll(1);t&&(r?Ql(r)&&(o=bu(r)):o=bu(e));let s=Cu(a,n,r)?Su(a):ll(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=Yl(a),t=Ql(r)?Yl(r):r,n=e,i=_u(n);for(;i&&t!==n;){let e=bu(i),t=i.getBoundingClientRect(),r=fu(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=Yl(i),i=_u(n)}}return jl({width:u,height:d,x:c,y:l})}function Tu(e,t){let n=pu(e).scrollLeft;return t?t.left+n:wu(Xl(e)).left+n}function Eu(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Tu(e,n),y:n.top+t.scrollTop}}function Du(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Xl(r),s=t?ru(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ll(1),u=ll(0),d=$l(r);if((d||!a)&&((Jl(r)!==`body`||tu(o))&&(c=pu(r)),d)){let e=wu(r);l=bu(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Eu(o,c):ll(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 Ou(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ku(e){let t=pu(e),n=e.ownerDocument.body,r=ol(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ol(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Tu(e),o=-t.scrollTop;return fu(n).direction===`rtl`&&(a+=ol(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Au=25;function ju(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Yl(e),a=Xl(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!uu()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Tu(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<=Au&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Mu(e,t){let n=wu(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=bu(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Nu(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ju(e,n,t);else if(t===`document`)r=ku(Xl(e));else if(Ql(t))r=Mu(t,n);else{let n=Su(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return jl(r)}function Pu(e,t){let n=t.get(e);if(n)return n;let r=gu(e,[],!1).filter(e=>Ql(e)&&Jl(e)!==`body`),i=null,a=fu(e).position===`fixed`,o=a?mu(e):e;for(;Ql(o)&&!du(o);){let e=fu(o),t=cu(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=mu(o)}return t.set(e,r),r}function Fu(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ru(t)?[]:Pu(t,this._c):[].concat(n),r],o=Nu(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=Nu(t,a[e],i);s=ol(n.top,s),c=al(n.right,c),l=al(n.bottom,l),u=ol(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Iu(e){let{width:t,height:n}=vu(e);return{width:t,height:n}}function Lu(e,t,n){let r=$l(t),i=Xl(t),a=n===`fixed`,o=wu(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ll(0);if((r||!a)&&((Jl(t)!==`body`||tu(i))&&(s=pu(t)),r)){let e=wu(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Tu(i));let l=i&&!r&&!a?Eu(i,s):ll(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 Ru(e){return fu(e).position===`static`}function zu(e,t){if(!$l(e)||fu(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Xl(e)===n&&(n=n.ownerDocument.body),n}function Bu(e,t){let n=Yl(e);if(ru(e))return n;if(!$l(e)){let t=mu(e);for(;t&&!du(t);){if(Ql(t)&&!Ru(t))return t;t=mu(t)}return n}let r=zu(e,t);for(;r&&nu(r)&&Ru(r);)r=zu(r,t);return r&&du(r)&&Ru(r)&&!cu(r)?n:r||lu(e)||n}var Vu=async function(e){let t=this.getOffsetParent||Bu,n=this.getDimensions,r=await n(e.floating);return{reference:Lu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hu(e){return fu(e).direction===`rtl`}var Uu={convertOffsetParentRelativeRectToViewportRelativeRect:Du,getDocumentElement:Xl,getClippingRect:Fu,getOffsetParent:Bu,getElementRects:Vu,getClientRects:Ou,getDimensions:Iu,getScale:bu,isElement:Ql,isRTL:Hu};function Wu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gu(e,t,n){let r=null,i,a=Xl(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=cl(d),h=cl(a.clientWidth-(u+f)),g=cl(a.clientHeight-(d+p)),_=cl(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ol(0,al(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Wu(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=Yl(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ku(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=yu(e),u=i||a?[...l?gu(l):[],...t?gu(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Gu(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?wu(e):null;c&&g();function g(){let t=wu(e);h&&!Wu(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 qu=Ul,Ju=Wl,Yu=Ll,Xu=Kl,Zu=Bl,Qu=Il,$u=Gl,ed=(e,t,n)=>{let r=new Map,i=n??{},a={...Uu,...i.platform,_c:r};return Fl(e,t,{...i,platform:a})},J=typeof document<`u`?v.useLayoutEffect:function(){};function td(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(!td(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)&&!td(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function nd(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rd(e,t){let n=nd(e);return Math.round(t*n)/n}function id(e){let t=v.useRef(e);return J(()=>{t.current=e}),t}function ad(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);td(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=id(c),O=id(i),k=id(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),ed(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!td(T.current,t)&&(T.current=t,Xt.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);J(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);J(()=>(j.current=!0,()=>{j.current=!1}),[]),J(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=rd(N.floating,u.x),r=rd(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...nd(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var od=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?{}:Qu({element:r.current,padding:i}).fn(n):r?Qu({element:r,padding:i}).fn(n):{}}}},sd=(e,t)=>{let n=qu(e);return{name:n.name,fn:n.fn,options:[e,t]}},cd=(e,t)=>{let n=Ju(e);return{name:n.name,fn:n.fn,options:[e,t]}},ld=(e,t)=>({fn:$u(e).fn,options:[e,t]}),ud=(e,t)=>{let n=Yu(e);return{name:n.name,fn:n.fn,options:[e,t]}},dd=(e,t)=>{let n=Xu(e);return{name:n.name,fn:n.fn,options:[e,t]}},fd=(e,t)=>{let n=Zu(e);return{name:n.name,fn:n.fn,options:[e,t]}},pd=(e,t)=>{let n=od(e);return{name:n.name,fn:n.fn,options:[e,t]}},md=Object.defineProperty,hd=(e,t)=>md(e,`name`,{value:t,configurable:!0});function gd(e){let[t,n]=v.useState(void 0);return ba(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}hd(gd,`useSize`);var _d=Object.defineProperty,vd=(e,t)=>_d(e,`name`,{value:t,configurable:!0}),yd={Partial:`partial`,Always:`always`},bd={Optimized:`optimized`,Always:`always`},xd=`Popper`,[Sd,Cd]=va(xd),[wd,Td]=Sd(xd),Ed=vd(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,H.jsx)(wd,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Dd=`PopperAnchor`,Od=v.forwardRef(vd(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Td(Dd,n),o=v.useRef(null),s=a.onAnchorChange,c=Pn(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Fd(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(Va.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),kd=`PopperContent`,[Ad,jd]=Sd(kd),Md=v.forwardRef(vd(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=yd.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=bd.Optimized,onPlaced:m,...h}=e,g=Td(kd,n),[_,y]=v.useState(null),b=Pn(t,y),[x,S]=v.useState(null),C=gd(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Nd),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:ee,middlewareData:P}=ad({strategy:`fixed`,placement:E,whileElementsMounted:vd((...e)=>Ku(...e,{animationFrame:p===bd.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[sd({mainAxis:i+T,alignmentAxis:o}),c&&cd({mainAxis:!0,crossAxis:!1,...d===yd.Partial?{limiter:ld()}:{},...A}),c&&ud({...A}),dd({...A,apply:vd(({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&&pd({element:x,padding:s}),Pd({arrowWidth:w,arrowHeight:T}),f&&fd(k?{strategy:`referenceHidden`,...A}:{strategy:`referenceHidden`,padding:A.padding,altBoundary:A.altBoundary})]}),F=g.setPlacementState;ba(()=>(F(N),()=>{F(void 0)}),[N,F]);let[te,ne]=Fd(N),re=Ka(m);ba(()=>{ee&&re?.()},[ee,re]);let ie=P.arrow?.x,ae=P.arrow?.y,oe=P.arrow?.centerOffset!==0,[se,ce]=v.useState();return ba(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:ee?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(Ad,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:S,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,H.jsx)(Va.div,{"data-side":te,"data-align":ne,...h,ref:b,style:{...h.style,animation:ee?h.style?.animation:`none`}})})})},`PopperContent`));function Nd(e){return e!==null}vd(Nd,`isNotNull`);var Pd=vd(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]=Fd(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 Fd(e){let[t,n=`center`]=e.split(`-`);return[t,n]}vd(Fd,`getSideAndAlignFromPlacement`);var Id=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ld=Object.defineProperty,Rd=(e,t)=>Ld(e,`name`,{value:t,configurable:!0}),zd={ItemAligned:`item-aligned`,Popper:`popper`},Bd={LTR:`ltr`,RTL:`rtl`},Vd=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Hd=[` `,`Enter`],Ud=`Select`,[Wd,Gd,Kd]=Vc(Ud),[qd,Jd]=va(Ud,[Kd,Cd]),Yd=Cd(),[Xd,Zd]=qd(Ud),[Qd,$d]=qd(Ud);function ef(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=Yd(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=rl(l),[T,E]=Pa({prop:r,defaultProp:i??!1,onChange:a,caller:Ud}),[D,O]=Pa({prop:o,defaultProp:s,onChange:c,caller:Ud}),k=v.useRef(null),A=v.useRef(!1),[j,M]=v.useState(null),N=Rd(e=>{M({value:e,hasConsumerStoppedPropagation:A.current}),O(e)},`handleUserSelect`),ee=v.useRef(D);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=Rd(()=>O(ee.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let P=!_||!!m||!!_.closest(`form`),[F,te]=v.useState(new Set),ne=Ta(),re=Array.from(F).map(e=>e.props.value).join(`;`),ie=v.useCallback(e=>{te(t=>new Set(t).add(e))},[]),ae=v.useCallback(e=>{te(t=>{let n=new Set(t);return n.delete(e),n})},[]),oe={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:ne,value:D,onValueChange:O,hasConsumerStoppedPropagationRef:A,userSelection:j,onUserSelect:N,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:F,nativeSelectKey:re,isFormControl:P};return(0,H.jsx)(Ed,{...g,children:(0,H.jsx)(Xd,{scope:t,...oe,children:(0,H.jsx)(Wd.Provider,{scope:t,children:(0,H.jsx)(Qd,{scope:t,onNativeOptionAdd:ie,onNativeOptionRemove:ae,children:Lf(h)?h(oe):n})})})})}Rd(ef,`SelectProvider`);var tf=Rd(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,H.jsx)(ef,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[n,e?(0,H.jsx)(If,{__scopeSelect:t}):null]})})},`Select`),nf=`SelectTrigger`,rf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Yd(n),o=Zd(nf,n),s=o.disabled||r,c=Pn(t,o.onTriggerChange),l=Gd(n),u=v.useRef(`touch`),[d,f,p]=zf(e=>{let t=l().filter(e=>!e.disabled),n=Bf(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),m=Rd(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,H.jsx)(Od,{asChild:!0,...a,children:(0,H.jsx)(Va.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Rf(o.value)?``:void 0,...i,ref:c,onClick:ua(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:ua(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:ua(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),f(e.key)),t&&e.key===` `||Vd.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),af=`SelectValue`,of=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Zd(af,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Pn(t,c.onValueNodeChange);ba(()=>{l(u)},[l,u]);let f=Rf(c.value);return(0,H.jsx)(Va.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,H.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),sf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,H.jsx)(Va.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[cf,lf]=qd(`SelectPortal`,{forceMount:void 0}),uf=Rd(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,H.jsx)(cf,{scope:e.__scopeSelect,forceMount:n,children:(0,H.jsx)(Ao,{asChild:!0,...r})})},`SelectPortal`),df=`SelectContent`,ff=v.forwardRef(Rd(function(e,t){let n=lf(df,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Zd(df,e.__scopeSelect),[o,s]=v.useState();return ba(()=>{s(new DocumentFragment)},[]),(0,H.jsx)(Po,{present:r||a.open,children:({present:e})=>e?(0,H.jsx)(vf,{...i,ref:t}):(0,H.jsx)(pf,{...i,fragment:o})})},`SelectContent`)),pf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Xt.createPortal((0,H.jsx)(hf,{scope:n,children:(0,H.jsx)(Wd.Slot,{scope:n,children:(0,H.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),mf=10,[hf,gf]=qd(df),_f=Ln(`SelectContent.RemoveScroll`),vf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n}=e,{position:r=zd.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=Zd(df,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=Pn(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=Gd(n),[A,j]=v.useState(!1),M=v.useRef(!1),N=v.useRef(!1),ee=v.useRef(!1);v.useEffect(()=>{if(b)return cc(b)},[b]),Wo();let P=v.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),F=v.useCallback(()=>P([T,b]),[P,T,b]);v.useEffect(()=>{A&&F()},[A,F]);let{onOpenChange:te,triggerPointerDownPosRef:ne}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=Rd(t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},`handlePointerMove`),n=Rd(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||te(!1),document.removeEventListener(`pointermove`,t),ne.current=null},`handlePointerUp`);return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,te,ne]),v.useEffect(()=>{let e=Rd(()=>te(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[te]);let[re,ie]=zf(e=>{let t=k().filter(e=>!e.disabled),n=Bf(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=v.useCallback((e,t,n)=>{let r=!N.current;r&&(N.current=!0);let i=!M.current&&!n;y.value!==void 0&&y.value===t||i?(E(e),i&&(M.current=!0)):r&&E(e)},[y.value]),oe=v.useCallback(()=>b?.focus(),[b]),se=v.useCallback((e,t,n)=>{if(!e)return;let r=!ee.current;r&&(ee.current=!0);let i=!M.current&&!n;(y.value!==void 0&&y.value===t||i||r)&&O(e)},[y.value]),ce=r===zd.Popper?bf:yf,le=ce===bf?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,H.jsx)(hf,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ae,selectedItem:T,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:F,selectedItemText:D,position:r,isPositioned:A,searchRef:re,children:(0,H.jsx)($s,{as:_f,allowPinchZoom:!0,children:(0,H.jsx)(po,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ua(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,H.jsx)(eo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,H.jsx)(ce,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:ua(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),yf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Zd(df,n),o=gf(df,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=Pn(t,u),f=Gd(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==Bd.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-mf,d=Rc(a,[mf,Math.max(mf,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-mf,d=Rc(a,[mf,Math.max(mf,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-mf*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-mf,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${mf}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);ba(()=>b(),[b]);let[x,S]=v.useState();ba(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]);return(0,H.jsx)(xf,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,H.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,H.jsx)(Va.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),bf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=mf,...a}=e,o=Yd(n);return(0,H.jsx)(Md,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[xf,Sf]=qd(df,{}),Cf=`SelectViewport`,wf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=gf(Cf,n),o=Sf(Cf,n),s=Pn(t,a.onViewportChange),c=v.useRef(0);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,H.jsx)(Wd.Slot,{scope:n,children:(0,H.jsx)(Va.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:ua(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-mf*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Tf,Ef]=qd(`SelectGroup`),Df=`SelectItem`,[Of,kf]=qd(Df),Af=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Zd(Df,n),c=gf(Df,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=Pn(t,Ka(e=>c.itemRefCallback?.(e,r,i))),h=Ta(),g=v.useRef(`touch`);function _(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return Rd(_,`handleSelect`),(0,H.jsx)(Of,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,H.jsx)(Wd.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,H.jsx)(Va.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:ua(o.onFocus,()=>p(!0)),onBlur:ua(o.onBlur,()=>p(!1)),onClick:ua(o.onClick,e=>{i||g.current!==`mouse`&&_(e)}),onPointerUp:ua(o.onPointerUp,e=>{i||g.current===`mouse`&&_(e)}),onPointerDown:ua(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:ua(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ua(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ua(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Hd.includes(e.key)&&_(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),jf=`SelectItemText`,Mf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Zd(jf,n),s=gf(jf,n),c=kf(jf,n),l=$d(jf,n),[u,d]=v.useState(null),f=Ka(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Pn(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,H.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return ba(()=>(g(h),()=>_(h)),[g,_,h]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Va.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Rf(o.value)?Xt.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Nf=`SelectItemIndicator`,Pf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,...r}=e;return kf(Nf,n).isSelected?(0,H.jsx)(Va.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Ff=`SelectBubbleInput`,If=v.forwardRef(Rd(function({__scopeSelect:e,...t},n){let r=Zd(Ff,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=v.useRef(null),h=Pn(n,m),g=i??``,_=v.useRef(g),y=v.useRef(d),b=v.useRef(!1),x=Array.from(f).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=d!==null&&d!==y.current;y.current=d;let i=_.current!==g;_.current=g;let a=r&&i;if(r&&!i&&d.value!==g&&!d.hasConsumerStoppedPropagation&&n){b.current=!0;try{n.call(e,d.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{b.current=!1,n.call(e,g)}return}let o=a&&!d.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,g),e.dispatchEvent(t)}},[g,d]),(0,H.jsxs)(Va.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{b.current||a(e.target.value)},...t,style:{...Id,...t.style},ref:h,defaultValue:g,children:[Rf(i)&&!x?(0,H.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function Lf(e){return typeof e==`function`}Rd(Lf,`isFunction`);function Rf(e){return e===``||e===void 0}Rd(Rf,`shouldShowPlaceholder`);function zf(e){let t=Ka(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}Rd(a,`updateSearch`),a(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Rd(zf,`useTypeaheadSearch`);function Bf(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Vf(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Rd(Bf,`findNextItem`);function Vf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Rd(Vf,`wrapArray`);var Hf=gc;function Uf({className:e,children:t,...n}){let r=v.useRef(null);return(0,H.jsxs)(bc,{children:[(0,H.jsx)(Sc,{className:`fixed inset-0 z-50 bg-black/45 backdrop-blur-[2px]`}),(0,H.jsxs)(Ec,{ref:r,tabIndex:-1,onOpenAutoFocus:e=>{e.preventDefault(),r.current?.focus({preventScroll:!0})},className:V(`animate-fade-up fixed left-1/2 top-1/2 z-50 grid w-full max-w-xl -translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl border bg-card p-6 shadow-2xl focus:outline-none`,e),...n,children:[t,(0,H.jsxs)(Nc,{className:`absolute right-4 top-4 rounded-md p-1 text-muted-foreground opacity-70 transition hover:bg-accent hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:outline-none`,children:[(0,H.jsx)(Yt,{className:`size-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`关闭`})]})]})]})}function Wf({className:e,...t}){return(0,H.jsx)(`div`,{className:V(`flex flex-col gap-1.5 pr-8`,e),...t})}function Y({className:e,...t}){return(0,H.jsx)(Ac,{className:V(`text-lg font-semibold tracking-tight`,e),...t})}function Gf({className:e,...t}){return(0,H.jsx)(jc,{className:V(`text-sm text-muted-foreground`,e),...t})}function Kf({className:e,...t}){return(0,H.jsx)(`div`,{className:V(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}var qf=tf,Jf=of;function Yf({className:e,children:t,...n}){return(0,H.jsxs)(rf,{className:V(`flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:[t,(0,H.jsx)(sf,{asChild:!0,children:(0,H.jsx)(de,{className:`size-4 opacity-50`})})]})}function Xf({className:e,children:t,...n}){return(0,H.jsx)(uf,{children:(0,H.jsx)(ff,{position:`popper`,className:V(`z-50 max-h-72 min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg`,e),...n,children:(0,H.jsx)(wf,{children:t})})})}function Zf({className:e,children:t,...n}){return(0,H.jsxs)(Af,{className:V(`relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground`,e),...n,children:[(0,H.jsx)(Mf,{children:t}),(0,H.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,H.jsx)(Pf,{children:(0,H.jsx)(le,{className:`size-4`})})})]})}function Qf({open:e,initialPath:t,onOpenChange:n,onPick:r}){let[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),f=async e=>{s(!0),l(null);try{let t=await G.listDirectories(e);a(t),d(t.path),localStorage.setItem(`ylcwf-last-dir`,t.path)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}};(0,v.useEffect)(()=>{if(!e)return;a(null);let n=localStorage.getItem(`ylcwf-last-dir`);f(t??n??void 0)},[e,t]);let p=[],m=localStorage.getItem(`ylcwf-last-dir`);return m!==null&&p.push({label:`上次位置`,path:m,icon:Ft}),t!==void 0&&t.trim().length>0&&t!==m&&p.push({label:`当前配置`,path:t,icon:Ft}),(0,H.jsx)(Hf,{open:e,onOpenChange:n,children:(0,H.jsxs)(Uf,{className:`max-w-2xl`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:`选择文档仓库目录`}),(0,H.jsx)(Gf,{children:`逐层进入目标目录后点「选择此目录」;需包含 skills/iteration-task-docs。`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(U,{variant:`outline`,size:`icon`,className:`shrink-0`,disabled:i?.parent===null||i?.parent===void 0||o,onClick:()=>i?.parent!=null&&void f(i.parent),title:`上一级`,children:(0,H.jsx)(re,{className:`size-4`})}),(0,H.jsx)(Ni,{value:u,spellCheck:!1,className:`font-mono text-xs`,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f(u)}}),(0,H.jsx)(U,{variant:`ghost`,size:`sm`,className:`shrink-0`,onClick:()=>void f(u),disabled:o,children:`前往`})]}),p.length===0?null:(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:p.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>void f(e.path),className:`flex max-w-full items-center gap-1.5 rounded-md border px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground`,children:[(0,H.jsx)(e.icon,{className:`size-3`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.label})]},`${e.label}-${e.path}`))}),(0,H.jsx)(`div`,{className:`h-72 overflow-y-auto rounded-lg border`,children:o?(0,H.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}),`正在读取目录…`]}):c===null?i===null||i.entries.length===0?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center text-xs text-muted-foreground`,children:`该目录下没有子目录`}):(0,H.jsx)(`ul`,{className:`divide-y`,children:i.entries.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>void f(e.path),className:V(`flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-accent/60`,e.hidden?`text-muted-foreground`:``),children:[(0,H.jsx)(Ue,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.path))}):(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs text-destructive`,children:c})}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>n(!1),children:`取消`}),(0,H.jsxs)(U,{size:`sm`,className:`gap-1.5`,disabled:i===null,onClick:()=>{i!==null&&(r(i.path),n(!1))},children:[(0,H.jsx)(ze,{className:`size-3.5`}),`选择此目录`]})]})]})})}function $f(e){return[{label:`本地配置`,ok:e.hasConfig&&e.configValid,detail:e.hasConfig?e.configValid?`已就绪`:`结构不合法`:`未创建`},{label:`Git 环境`,ok:e.gitAvailable,detail:e.gitAvailable?`已安装`:`未检测到 git 命令`},{label:`文档仓库`,ok:e.docsConfigured,detail:e.docsConfigured?e.docsRoot:`尚未选择`},{label:`访问权限`,ok:e.docsAccessible,detail:e.docsAccessible?`可读取(${e.iterationCount} 个迭代)`:e.reason??`待检测`}]}function ep(e){switch(e.nextStep){case`install-git`:case`fix-config`:return`blocked`;case`set-docs-root`:return`docs`;default:return`detect`}}function tp({state:e,onDone:t}){let{snapshot:n}=oa(),[r,i]=(0,v.useState)(ep(e)),[a,o]=(0,v.useState)(e.docsRoot),[s,c]=(0,v.useState)(e.developer),[l,u]=(0,v.useState)(e.role),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(!1),b=async e=>{f(!0),m(null);try{await e()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}},x=()=>b(async()=>{g(await G.inspect(a.trim()))}),S=()=>b(async()=>{let e=n?.config,r={profile:{developer:s.trim(),role:l},docs:{root:a.trim(),git:e?.docs.git??{cli:{commit:!0,push:!1},ui:{commit:!0,push:!1}}},terminals:e?.terminals??{}};await G.completeOnboarding(r),await t()}),C=()=>b(async()=>{let e=await G.pickDirectory();e!==null&&(o(e),g(await G.inspect(e)))}),w=/^[a-z][a-z0-9]*$/.test(s.trim()),T=a.trim().length>0&&h?.hasDocsSkill===!0;return(0,H.jsx)(`div`,{className:`app-glow flex min-h-full items-center justify-center px-6 py-10`,children:(0,H.jsxs)(`div`,{className:`relative z-10 w-full max-w-2xl`,children:[(0,H.jsxs)(`div`,{className:`mb-6 flex items-center gap-2.5`,children:[(0,H.jsx)(`div`,{className:`flex size-9 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm`,children:(0,H.jsx)(lt,{className:`size-4`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-sm font-semibold tracking-tight`,children:`ylcwf 工作台`}),(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`首次启动配置`})]})]}),(0,H.jsxs)(`div`,{className:`animate-fade-up rounded-xl border bg-card p-7 shadow-xl`,children:[r===`detect`?(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`启动环境检测`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`确认为你准备好文档仓库与访问权限后进入工作台。`})]}),(0,H.jsx)(`ul`,{className:`space-y-2`,children:$f(e).map(e=>(0,H.jsxs)(`li`,{className:`flex items-center justify-between gap-3 rounded-lg border px-3.5 py-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[e.ok?(0,H.jsx)(I,{className:`size-4 text-success`}):(0,H.jsx)(Ce,{className:`size-4 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`text-sm`,children:e.label})]}),(0,H.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,title:e.detail,children:e.detail})]},e.label))}),(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsxs)(U,{onClick:()=>i(`docs`),children:[`继续`,(0,H.jsx)(te,{className:`size-3.5`})]})})]}):null,r===`docs`?(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`迭代任务文档仓库`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`选择你本地已克隆的文档仓库;需要包含 skills/iteration-task-docs。`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Pi,{children:`本地仓库路径`}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(Ni,{value:a,placeholder:`/Users/you/develop/iteration-task-repo`,spellCheck:!1,className:`font-mono text-xs`,onChange:e=>{o(e.target.value),g(null)}}),(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`shrink-0 gap-1.5`,onClick:()=>{G.mode===`electron`?C():y(!0)},children:[(0,H.jsx)(Ve,{className:`size-3.5`}),`选择`]}),(0,H.jsx)(U,{variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>void x(),disabled:a.trim().length===0,children:`校验`})]}),G.mode===`http`?(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`「选择」会打开本地目录浏览器;也可以直接粘贴绝对路径后点「校验」。`}):null,h===null?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[11px]`,children:[(0,H.jsx)(W,{variant:h.exists?`success`:`destructive`,children:h.exists?`路径存在`:`路径不存在`}),(0,H.jsx)(W,{variant:h.isGit?`success`:`warning`,children:h.isGit?`git 仓库`:`非 git 仓库`}),h.hasDocsSkill===void 0?null:(0,H.jsx)(W,{variant:h.hasDocsSkill?`success`:`destructive`,children:h.hasDocsSkill?`含 iteration-task-docs`:`缺少 iteration-task-docs`})]})]}),(0,H.jsxs)(`div`,{className:`flex justify-between`,children:[(0,H.jsx)(U,{variant:`ghost`,onClick:()=>i(`detect`),children:`返回`}),(0,H.jsxs)(U,{onClick:()=>i(`profile`),disabled:!T,children:[`继续`,(0,H.jsx)(te,{className:`size-3.5`})]})]})]}):null,r===`profile`?(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`身份信息`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`用于确定个人文档文件名,并在迭代看板里默认高亮你自己。`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Pi,{htmlFor:`onboarding-developer`,children:`开发者标识`}),(0,H.jsx)(Ni,{id:`onboarding-developer`,value:s,placeholder:`yourname`,spellCheck:!1,className:`font-mono`,onChange:e=>c(e.target.value.trim())}),w||s.length===0?null:(0,H.jsx)(`p`,{className:`text-xs text-destructive`,children:`必须是小写字母开头的字母数字串(姓名小写全拼)`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Pi,{children:`默认角色`}),(0,H.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:qi.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:V(`rounded-lg border p-3 text-left text-xs transition-all`,l===e?`border-primary/60 bg-primary/5`:`hover:bg-accent/40`),children:[(0,H.jsx)(`p`,{className:`font-medium`,children:Yi[e]}),(0,H.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:Xi[e]})]},e))})]}),(0,H.jsxs)(`div`,{className:`flex justify-between`,children:[(0,H.jsx)(U,{variant:`ghost`,onClick:()=>i(`docs`),children:`返回`}),(0,H.jsxs)(U,{onClick:()=>void S(),disabled:!w||!T||d,children:[d?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(le,{className:`size-3.5`}),`完成配置`]})]})]}):null,r===`blocked`?(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`需要先解决环境问题`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.reason??`当前环境不满足启动条件`})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3.5 py-3 text-xs text-warning`,children:[(0,H.jsx)(Vt,{className:`mt-0.5 size-4 shrink-0`}),(0,H.jsxs)(`div`,{className:`space-y-1.5 leading-relaxed`,children:[e.nextStep===`install-git`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{children:`请先安装 Git:`}),(0,H.jsx)(`code`,{className:`block rounded bg-background/60 px-2 py-1 font-mono`,children:`brew install git`})]}):null,e.nextStep===`fix-config`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{children:`配置文件结构不合法(可能来自旧版本),请重新初始化:`}),(0,H.jsx)(`code`,{className:`block rounded bg-background/60 px-2 py-1 font-mono`,children:`ylcwf init`}),(0,H.jsx)(`p`,{className:`opacity-80`,children:`或查看详情:`}),(0,H.jsx)(`code`,{className:`block rounded bg-background/60 px-2 py-1 font-mono`,children:`ylcwf doctor`})]}):null]})]}),(0,H.jsx)(`div`,{className:`flex justify-end gap-2`,children:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:()=>void t(),children:[(0,H.jsx)(_t,{className:`size-3.5`}),`重新检测`]})})]}):null,p===null?null:(0,H.jsxs)(`div`,{className:`mt-4 flex items-start gap-2 rounded-lg border border-destructive/25 bg-destructive/8 px-3.5 py-2.5 text-xs text-destructive`,children:[(0,H.jsx)(Vt,{className:`mt-0.5 size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`leading-relaxed`,children:p})]})]}),(0,H.jsx)(Qf,{open:_,initialPath:a.trim().length>0?a.trim():void 0,onOpenChange:y,onPick:e=>{o(e),g(null),(async()=>{try{g(await G.inspect(e))}catch{}})()}}),(0,H.jsxs)(`p`,{className:`mt-4 text-center text-[11px] text-muted-foreground`,children:[(0,H.jsx)(qe,{className:`mr-1 inline size-3`}),`配置保存在 ~/.ylcwf/config.yaml,与命令行工具共用`]})]})})}var np=class extends v.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[ylcwf] ${this.props.area} 渲染失败`,e,t.componentStack)}render(){let{error:e}=this.state;return e===null?this.props.children:(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 px-6 py-12 text-center`,children:[(0,H.jsx)(Vt,{className:`size-6 text-warning`}),(0,H.jsxs)(`p`,{className:`text-sm font-medium`,children:[this.props.area,`渲染失败`]}),(0,H.jsxs)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:[e.message,(0,H.jsx)(`br`,{}),`如果刚升级过,请重启 `,(0,H.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono`,children:`ylcwf serve`}),`(或重开桌面端)后刷新。`]}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>this.setState({error:null}),children:`重试`}),(0,H.jsx)(U,{size:`sm`,onClick:()=>window.location.reload(),children:`刷新页面`})]})]})}};function rp({title:e,description:t,actions:n,children:r,className:i}){return(0,H.jsxs)(ji,{className:V(`gap-4`,i),children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight`,children:e}),t===void 0?null:(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),n]}),(0,H.jsx)(Ii,{}),(0,H.jsx)(Mi,{className:`space-y-4`,children:r})]})}function ip({label:e,hint:t,error:n,htmlFor:r,children:i}){return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Pi,{htmlFor:r,children:e}),i,n===void 0?t===void 0?null:(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):(0,H.jsx)(`p`,{className:`text-xs text-destructive`,children:n})]})}function ap({issues:e}){return e.length===0?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-success/25 bg-success/8 px-4 py-3 text-sm text-success`,children:[(0,H.jsx)(I,{className:`size-4`}),`未发现问题,配置健康`]}):(0,H.jsx)(`ul`,{className:`space-y-2`,children:e.map((e,t)=>{let n=e.level===`error`;return(0,H.jsxs)(`li`,{className:V(`flex items-start gap-2.5 rounded-lg border px-3.5 py-2.5 text-sm`,n?`border-destructive/25 bg-destructive/6 text-destructive`:`border-warning/30 bg-warning/8 text-warning`),children:[n?(0,H.jsx)(Ce,{className:`mt-0.5 size-4 shrink-0`}):(0,H.jsx)(Vt,{className:`mt-0.5 size-4 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,H.jsx)(`p`,{className:`leading-snug`,children:e.message}),(0,H.jsxs)(`p`,{className:`font-mono text-[11px] opacity-70`,children:[e.code,e.where===void 0?``:` · ${e.where}`]})]})]},`${e.code}-${e.where??``}-${t}`)})})}function op({ok:e,text:t}){return e?(0,H.jsxs)(W,{variant:`success`,children:[(0,H.jsx)(I,{className:`size-3`}),t]}):(0,H.jsxs)(W,{variant:`destructive`,children:[(0,H.jsx)(Ce,{className:`size-3`}),t]})}function sp({icon:e,title:t,description:n,action:r}){return(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-14 text-center`,children:[(0,H.jsx)(`div`,{className:`flex size-11 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:e}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:t}),(0,H.jsx)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:n})]}),r]})}function cp({children:e}){return(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg bg-muted/60 px-3.5 py-2.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(Ye,{className:`mt-0.5 size-3.5 shrink-0`}),(0,H.jsx)(`div`,{className:`leading-relaxed`,children:e})]})}function lp({icon:e,label:t,value:n,hint:r}){return(0,H.jsx)(ji,{className:`gap-0 py-5`,children:(0,H.jsxs)(Mi,{className:`flex items-start justify-between`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),(0,H.jsx)(`p`,{className:`text-2xl font-semibold tracking-tight`,children:n}),r===void 0?null:(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:r})]}),(0,H.jsx)(`div`,{className:`flex size-9 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:e})]})})}function up(){let{snapshot:e,draft:t}=oa(),n=t?.terminals??{},r=Object.keys(n),i=r.reduce((e,t)=>e+Ki.reduce((e,r)=>e+(n[t]?.repos[r].length??0),0),0),a=e?.issues.filter(e=>e.level===`error`).length??0,o=e?.issues.filter(e=>e.level===`warning`).length??0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,H.jsx)(lp,{icon:(0,H.jsx)(lt,{className:`size-4`}),label:`PRD 终端`,value:r.length,hint:`已配置的终端数量`}),(0,H.jsx)(lp,{icon:(0,H.jsx)(Le,{className:`size-4`}),label:`本地仓库`,value:i,hint:`前后端仓库合计`}),(0,H.jsx)(lp,{icon:(0,H.jsx)(kt,{className:`size-4`}),label:`健康状态`,value:a>0?`${a} error`:o>0?`${o} warning`:`健康`,hint:a>0?`需要修复后才能正常使用`:o>0?`可继续使用,建议处理`:`doctor 校验通过`})]}),(0,H.jsx)(rp,{title:`当前身份`,description:`用于个人任务文档命名与模板选择`,children:(0,H.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`开发者标识`}),(0,H.jsx)(`p`,{className:`mt-1 font-mono text-sm`,children:t?.profile.developer||`—`})]}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`默认角色`}),(0,H.jsx)(`p`,{className:`mt-1 text-sm`,children:t===null?`—`:Yi[t.profile.role]})]}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`文档仓库`}),(0,H.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs`,title:t?.docs.root,children:t?.docs.root||`—`})]})]})}),(0,H.jsx)(rp,{title:`校验结果`,description:`与 ylcwf doctor 使用同一套规则`,children:(0,H.jsx)(ap,{issues:e?.issues??[]})})]})}var dp=/^[a-z][a-z0-9]*$/;function fp(){let{draft:e,mutate:t}=oa(),n=e?.profile.developer??``,r=e?.profile.role??`frontend`,i=n.length===0||dp.test(n)?void 0:`必须是小写字母开头的字母数字串(姓名小写全拼)`;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rp,{title:`开发者标识`,description:`个人任务文档文件名,也是文档中「负责人」的取值`,children:(0,H.jsx)(ip,{label:`developer`,htmlFor:`developer`,hint:`姓名小写全拼,例如 zhangsan。仅允许小写字母开头,可含数字与字母。`,error:i,children:(0,H.jsx)(Ni,{id:`developer`,value:n,placeholder:`yourname`,spellCheck:!1,autoComplete:`off`,className:`max-w-sm font-mono`,onChange:e=>t(t=>{t.profile.developer=e.target.value.trim()})})})}),(0,H.jsx)(rp,{title:`默认角色`,description:`决定写文档时使用的模板与「负责范围」;不影响可录入的仓库数量`,children:(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:qi.map(e=>{let n=r===e;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>t(t=>{t.profile.role=e}),className:V(`group relative flex flex-col gap-2 rounded-xl border p-4 text-left transition-all`,n?`border-primary/60 bg-primary/5 shadow-sm ring-1 ring-primary/20`:`hover:border-border hover:bg-accent/40`),children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:Yi[e]}),(0,H.jsx)(`span`,{className:V(`flex size-4 items-center justify-center rounded-full border transition`,n?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/30`),children:n?(0,H.jsx)(le,{className:`size-2.5`}):null})]}),(0,H.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:Xi[e]})]},e)})})})]})}function pp(){let{draft:e,mutate:t,snapshot:n}=oa(),r=e?.docs.root??``,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),c=async()=>{if(r.trim().length!==0){a(!0);try{s(await G.inspect(r.trim()))}finally{a(!1)}}},l=n?.issues.find(e=>e.where===`docs.root`&&e.level===`error`);return(0,H.jsx)(H.Fragment,{children:(0,H.jsxs)(rp,{title:`文档仓库路径`,description:`迭代任务文档仓库的绝对路径,需包含 skills/iteration-task-docs/`,actions:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,onClick:()=>void c(),disabled:i||r.length===0,children:[i?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(Ve,{className:`size-3.5`}),`检查路径`]}),children:[(0,H.jsx)(ip,{label:`docs.root`,htmlFor:`docs-root`,error:l?.message,children:(0,H.jsx)(Ni,{id:`docs-root`,value:r,placeholder:`/Users/you/develop/iteration-task-repo`,spellCheck:!1,autoComplete:`off`,className:`font-mono text-xs`,onChange:e=>t(t=>{t.docs.root=e.target.value.trim(),s(null)})})}),o===null?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,H.jsx)(op,{ok:o.exists,text:o.exists?`路径存在`:`路径不存在`}),(0,H.jsx)(op,{ok:o.isGit,text:o.isGit?`git 仓库`:`非 git 仓库`}),o.hasDocsSkill===void 0?null:(0,H.jsx)(op,{ok:o.hasDocsSkill,text:o.hasDocsSkill?`含 iteration-task-docs`:`缺少 iteration-task-docs`})]}),(0,H.jsx)(cp,{children:`该路径只存于本机配置,不写进业务仓库。修改后点击右上角「保存」,再回到概览确认校验结果。`})]})})}function mp(e,t){return{name:e,aliasesText:t.aliases.join(`, `),frontend:[...t.repos.frontend],backend:[...t.repos.backend]}}function hp(e){return e.split(/[,,;;]/).map(e=>e.trim()).filter(e=>e.length>0)}function gp({side:e,path:t,status:n,onChange:r,onRemove:i}){return(0,H.jsxs)(`div`,{className:`group flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-10 shrink-0 text-[11px] text-muted-foreground`,children:Ji[e]}),(0,H.jsx)(Ni,{value:t,spellCheck:!1,autoComplete:`off`,placeholder:`/Users/you/develop/.../repo`,className:`font-mono text-xs`,onChange:e=>r(e.target.value)}),n===void 0?null:n.exists?(0,H.jsx)(I,{className:V(`size-4 shrink-0`,n.isGit?`text-success`:`text-warning`)}):(0,H.jsx)(Ce,{className:`size-4 shrink-0 text-destructive`}),(0,H.jsx)(U,{variant:`ghost`,size:`icon`,className:`shrink-0`,onClick:i,children:(0,H.jsx)(zt,{className:`size-3.5 text-muted-foreground`})})]})}function _p({open:e,initial:t,existingNames:n,onOpenChange:r,onSubmit:i}){let[a,o]=(0,v.useState)(t??{name:``,aliasesText:``,frontend:[],backend:[]}),[s,c]=(0,v.useState)(null);(0,v.useEffect)(()=>{e&&(o(t??{name:``,aliasesText:``,frontend:[],backend:[]}),c(null))},[e,t]);let l=t?.name??null,u=n.filter(e=>e!==l),d=(e,t,n)=>{o(r=>{let i={...r,[e]:[...r[e]]};return i[e][t]=n,i})},f=(e,t)=>{o(n=>({...n,[e]:n[e].filter((e,n)=>n!==t)}))};return(0,H.jsx)(Hf,{open:e,onOpenChange:r,children:(0,H.jsxs)(Uf,{children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:t===null?`新增终端`:`编辑「${t.name}」`}),(0,H.jsx)(Gf,{children:`终端名取自 PRD 中的写法,可含中文;每端可配置多个仓库。`})]}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(ip,{label:`终端名`,htmlFor:`terminal-name`,hint:`例如:业务运营平台-IEP、AI学习机`,children:(0,H.jsx)(Ni,{id:`terminal-name`,value:a.name,placeholder:`示例终端-A`,onChange:e=>{o(t=>({...t,name:e.target.value})),c(null)}})}),(0,H.jsx)(ip,{label:`别名`,htmlFor:`terminal-alias`,hint:`同一终端的其它写法,逗号分隔;空格/全角/大小写差异无需别名`,children:(0,H.jsx)(Ni,{id:`terminal-alias`,value:a.aliasesText,placeholder:`别名1, 别名2`,onChange:e=>o(t=>({...t,aliasesText:e.target.value}))})}),Ki.map(e=>(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`span`,{className:`text-sm font-medium`,children:[Ji[e],`仓库`]}),(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,className:`h-7 gap-1 text-xs`,onClick:()=>o(t=>({...t,[e]:[...t[e],``]})),children:[(0,H.jsx)(ht,{className:`size-3`}),`添加`]})]}),a[e].length===0?(0,H.jsxs)(`p`,{className:`rounded-md border border-dashed px-3 py-2.5 text-xs text-muted-foreground`,children:[`未配置`,Ji[e],`仓库`]}):(0,H.jsx)(`div`,{className:`space-y-2`,children:a[e].map((t,n)=>(0,H.jsx)(gp,{side:e,path:t,status:void 0,onChange:t=>d(e,n,t),onRemove:()=>f(e,n)},`${e}-${n}`))})]},e)),s===null?null:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/8 px-3 py-2 text-xs text-destructive`,children:[(0,H.jsx)(Vt,{className:`size-3.5`}),s]})]}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>r(!1),children:`取消`}),(0,H.jsx)(U,{size:`sm`,onClick:()=>{let e=a.name.trim();if(e.length===0)return c(`终端名不能为空`);if(e.includes(`.`))return c(`终端名不能包含「.」`);if(u.includes(e))return c(`终端名已存在`);let t=a.frontend.map(e=>e.trim()).filter(e=>e.length>0),n=a.backend.map(e=>e.trim()).filter(e=>e.length>0);for(let e of[...t,...n])if(!e.startsWith(`/`))return c(`仓库路径必须是绝对路径:${e}`);if(new Set(t).size!==t.length)return c(`前端仓库存在重复路径`);if(new Set(n).size!==n.length)return c(`后端仓库存在重复路径`);i({name:e,aliasesText:a.aliasesText,frontend:t,backend:n},l),r(!1)},children:t===null?`添加`:`保存修改`})]})]})})}function vp(){let{draft:e,mutate:t,snapshot:n}=oa(),[r,i]=(0,v.useState)(()=>new URLSearchParams(window.location.search).get(`q`)??``),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)({}),h=e?.terminals??{},g=(0,v.useMemo)(()=>Object.keys(h).sort((e,t)=>e.localeCompare(t,`zh-CN`)),[h]);(0,v.useEffect)(()=>{let e=r.trim();if(e.length===0){o(null);return}let t=!1,n=setTimeout(()=>{G.resolve(e).then(e=>{t||o(e)}).catch(()=>{t||o(null)})},250);return()=>{t=!0,clearTimeout(n)}},[r]);let _=r.trim(),y=_.length===0?g:a?.matched===!0&&a.terminal!==null?g.filter(e=>e===a.terminal):g.filter(e=>e.toLowerCase().includes(_.toLowerCase())),b=(0,v.useMemo)(()=>g.flatMap(e=>Ki.flatMap(t=>h[e]?.repos[t]??[])),[g,h]),x=b.join(`\0`);(0,v.useEffect)(()=>{if(b.length===0){m({});return}let e=!1;return Promise.all(b.map(e=>G.inspect(e).then(t=>[e,t]))).then(t=>{e||m(Object.fromEntries(t))}).catch(()=>void 0),()=>{e=!0}},[x]);let S=(e,n)=>{t(t=>{n!==null&&n!==e.name&&delete t.terminals[n],t.terminals[e.name]={aliases:hp(e.aliasesText),repos:{frontend:e.frontend,backend:e.backend}}})},C=e=>{t(t=>{delete t.terminals[e]}),f(null)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(rp,{title:`PRD终端-本地仓库映射表`,description:`终端名用 PRD 中的写法;一端多个仓库时,解析会要求显式选择`,actions:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative hidden sm:block`,children:[(0,H.jsx)(Tt,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(Ni,{value:r,placeholder:`搜索终端`,className:`h-8 w-44 pl-8 text-xs`,onChange:e=>i(e.target.value)})]}),(0,H.jsxs)(U,{size:`sm`,onClick:()=>{u(null),c(!0)},children:[(0,H.jsx)(ht,{className:`size-3.5`}),`新增终端`]})]}),children:[_.length===0?null:(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-lg border bg-muted/40 px-3 py-2 text-[11px]`,children:a===null?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`解析中…`}):a.matched?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(W,{variant:`success`,children:`命中`}),(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[a.matchedBy===null?``:Zi[a.matchedBy],` →`]}),(0,H.jsx)(`span`,{className:`font-medium`,children:a.terminal}),[...a.repos.frontend,...a.repos.backend].length>1?(0,H.jsx)(W,{variant:`warning`,children:`多仓库,Agent 会先询问`}):null]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`未命中,候选(需人工确认):`}),a.candidates.length===0?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`无`}):a.candidates.map(e=>(0,H.jsx)(`button`,{type:`button`,className:`rounded border bg-background px-2 py-0.5 transition-colors hover:bg-accent`,onClick:()=>i(e),children:e},e))]})}),g.length===0?(0,H.jsx)(sp,{icon:(0,H.jsx)(lt,{className:`size-5`}),title:`还没有配置终端`,description:`添加一个终端,把 PRD 里的写法映射到本地仓库;支持中文名与多个仓库。`,action:(0,H.jsxs)(U,{size:`sm`,onClick:()=>{u(null),c(!0)},children:[(0,H.jsx)(ht,{className:`size-3.5`}),`新增终端`]})}):y.length===0?(0,H.jsxs)(`p`,{className:`rounded-lg border border-dashed px-4 py-8 text-center text-xs text-muted-foreground`,children:[`没有匹配「`,r,`」的终端`]}):(0,H.jsx)(`div`,{className:`space-y-3`,children:y.map(e=>{let t=h[e];return t===void 0?null:(0,H.jsx)(ji,{className:`gap-3 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 space-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:e}),t.aliases.length===0?(0,H.jsx)(W,{variant:`muted`,children:`无别名`}):t.aliases.map(e=>(0,H.jsx)(W,{variant:`secondary`,children:e},e))]}),(0,H.jsx)(`p`,{className:`font-mono text-[11px] text-muted-foreground`,children:Ki.map(e=>`${Ji[e]} ${t.repos[e].length}`).join(` · `)})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,H.jsx)(U,{variant:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>{u(mp(e,t)),c(!0)},children:`编辑`}),(0,H.jsx)(U,{variant:`ghost`,size:`icon`,onClick:()=>f(e),children:(0,H.jsx)(zt,{className:`size-3.5 text-muted-foreground`})})]})]}),(0,H.jsx)(`div`,{className:`space-y-1.5`,children:Ki.map(e=>{let n=t.repos[e];return n.length===0?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`w-10`,children:Ji[e]}),(0,H.jsx)(`span`,{className:`rounded border border-dashed px-2 py-0.5`,children:`未配置`})]},e):n.map(t=>{let n=p[t];return(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-10 shrink-0 text-[11px] text-muted-foreground`,children:Ji[e]}),(0,H.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded bg-muted/60 px-2 py-1 font-mono text-[11px]`,children:t}),n===void 0?null:n.exists?(0,H.jsx)(W,{variant:n.isGit?`success`:`warning`,children:n.isGit?`存在`:`非 git`}):(0,H.jsx)(W,{variant:`destructive`,children:`不存在`})]},`${e}-${t}`)})})})]})},e)})}),n!==null&&n.issues.some(e=>e.where?.startsWith(`terminals`))?(0,H.jsx)(cp,{children:`终端相关的问题会显示在「概览 → 校验结果」中;保存后即可看到最新结果。`}):null]}),(0,H.jsx)(_p,{open:s,initial:l,existingNames:g,onOpenChange:c,onSubmit:S}),(0,H.jsx)(Hf,{open:d!==null,onOpenChange:e=>e?void 0:f(null),children:(0,H.jsxs)(Uf,{className:`max-w-md`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:`删除终端`}),(0,H.jsxs)(Gf,{children:[`确认删除「`,d,`」?该操作会在保存后写入配置文件。`]})]}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>f(null),children:`取消`}),(0,H.jsx)(U,{variant:`destructive`,size:`sm`,onClick:()=>d!==null&&C(d),children:`删除`})]})]})})]})}function yp(e){return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}function bp(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function xp(){let{snapshot:e,restore:t,saving:n}=oa(),[r,i]=(0,v.useState)(null),a=e?.backups??[];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(rp,{title:`配置备份`,description:`每次保存前自动备份,最多保留 10 份;回滚会先备份当前文件`,actions:(0,H.jsxs)(W,{variant:`muted`,children:[a.length,` 份`]}),children:[a.length===0?(0,H.jsx)(sp,{icon:(0,H.jsx)(yt,{className:`size-5`}),title:`暂无备份`,description:`第一次保存配置后,这里会出现历史版本,可用于对比与回滚。`}):(0,H.jsx)(`div`,{className:`space-y-2`,children:a.map((e,t)=>(0,H.jsx)(ji,{className:`gap-0 py-3`,children:(0,H.jsxs)(Mi,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs font-medium`,children:yp(e.mtime)}),t===0?(0,H.jsx)(W,{variant:`secondary`,children:`最新`}):null]}),(0,H.jsxs)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,title:e.name,children:[e.name,` · `,bp(e.size)]})]}),(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`shrink-0 gap-1.5 text-xs`,onClick:()=>i(e.name),children:[(0,H.jsx)(xt,{className:`size-3`}),`回滚`]})]})},e.name))}),(0,H.jsx)(cp,{children:`回滚会覆盖当前配置文件。若当前存在未保存的修改,回滚后这些修改会被丢弃。`})]}),(0,H.jsx)(Hf,{open:r!==null,onOpenChange:e=>e?void 0:i(null),children:(0,H.jsxs)(Uf,{className:`max-w-md`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:`回滚到该备份`}),(0,H.jsxs)(Gf,{children:[`将用 `,(0,H.jsx)(`code`,{className:`font-mono text-[11px]`,children:r}),` 覆盖当前配置,系统会先把当前文件再备份一次。`]})]}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>i(null),children:`取消`}),(0,H.jsxs)(U,{size:`sm`,disabled:n,onClick:()=>{if(r===null)return;let e=r;i(null),t(e)},children:[n?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(xt,{className:`size-3.5`}),`确认回滚`]})]})]})})]})}var Sp={profile:`profile`,docs:`docs`,terminals:`terminals`,backups:`backups`};function Cp(){let[e,t]=window.location.hash.replace(`#`,``).split(`?`);return new URLSearchParams(t??``).get(`tab`)??Sp[e??``]??`about`}function wp(){let{snapshot:e,draft:t,mutate:n}=oa(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),s=e?.issues.filter(e=>e.level===`error`).length??0,c=e?.issues.filter(e=>e.level===`warning`).length??0,[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(()=>Cp());(0,v.useEffect)(()=>{let e=()=>m(Cp());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let h=e=>{m(e);let t=new URL(window.location.href);t.hash=`settings?tab=${e}`,window.history.replaceState(null,``,t)},g=[{id:`profile`,label:`身份`,icon:Gt},{id:`docs`,label:`文档仓库`,icon:Le},{id:`terminals`,label:`PRD终端映射`,icon:lt},{id:`backups`,label:`备份`,icon:yt},{id:`about`,label:`关于`,icon:Ye}],_=async()=>{f(!0);try{u(await G.updateCheck(!0))}catch(t){u({current:e?.meta.version??``,latest:null,hasUpdate:!1,downloadUrl:null,source:`none`,checkedAt:new Date().toISOString(),error:t instanceof Error?t.message:String(t)})}finally{f(!1)}};(0,v.useEffect)(()=>{G.updateCheck(!1).then(u).catch(()=>void 0)},[]);let y=async()=>{o(!0);try{await G.reset(!0),window.location.reload()}finally{o(!1),i(!1)}},b=()=>{if(t===null)return;let e=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=`ylcwf-config.json`,r.click(),URL.revokeObjectURL(n)},x=(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 rounded-lg border p-1`,children:g.map(e=>{let t=e.icon;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>h(e.id),className:p===e.id?`flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium`:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,H.jsx)(t,{className:`size-3.5`}),e.label]},e.id)})});return(0,H.jsxs)(H.Fragment,{children:[x,p===`profile`?(0,H.jsx)(fp,{}):null,p===`docs`?(0,H.jsx)(pp,{}):null,p===`terminals`?(0,H.jsx)(vp,{}):null,p===`backups`?(0,H.jsx)(xp,{}):null,p===`about`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rp,{title:`配置文件`,description:`CLI 与桌面端共享配置`,children:(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`路径`}),e===null?null:s>0?(0,H.jsxs)(W,{variant:`destructive`,children:[s,` 项 error`]}):c>0?(0,H.jsxs)(W,{variant:`warning`,children:[c,` 项 warning`]}):(0,H.jsx)(W,{variant:`success`,children:`配置健康`})]}),(0,H.jsx)(`p`,{className:`truncate font-mono text-xs`,title:e?.configPath,children:e?.configPath??`—`})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 gap-1.5`,children:[(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`gap-1.5 text-xs`,onClick:()=>{G.revealConfig()},children:[(0,H.jsx)(ze,{className:`size-3.5`}),`打开目录`]}),(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`gap-1.5 text-xs`,onClick:b,children:[(0,H.jsx)(je,{className:`size-3.5`}),`导出 JSON`]})]})]}),(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,H.jsxs)(`div`,{className:`rounded-lg border px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`应用版本`}),(0,H.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`span`,{className:`font-mono text-sm`,children:[`v`,e?.meta.version??`—`]}),l?.hasUpdate===!0?(0,H.jsxs)(W,{variant:`warning`,children:[`有新版 v`,l.latest]}):l!==null&&l.error===null&&l.latest!==null?(0,H.jsx)(W,{variant:`success`,children:`已是最新`}):null,(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-[11px]`,disabled:d===!0,onClick:()=>void _(),children:[d===!0?(0,H.jsx)(rt,{className:`size-3 animate-spin`}):null,`检查更新`]})]}),l?.error===null||l===null?null:(0,H.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:l.error}),l?.hasUpdate===!0&&l.downloadUrl!==null?(0,H.jsxs)(`button`,{type:`button`,onClick:()=>window.open(l.downloadUrl??``,`_blank`),className:`mt-1 text-[11px] text-primary underline-offset-2 hover:underline`,children:[`前往下载 v`,l.latest]}):null]}),(0,H.jsxs)(`div`,{className:`rounded-lg border px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`运行模式`}),(0,H.jsx)(`p`,{className:`mt-1 text-sm`,children:G.mode===`electron`?`桌面端`:`本地浏览器`})]})]}),(0,H.jsx)(cp,{children:`「打开目录」会调用系统文件管理器;浏览器模式同样可用(由本地服务执行)。系统目录选择器仅桌面端提供,浏览器模式使用内置目录浏览器。`})]})}),(0,H.jsx)(rp,{title:`快捷键`,description:`常用操作`,children:(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg bg-muted/40 px-4 py-2.5`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(Ze,{className:`size-3.5`}),`保存配置`]}),(0,H.jsxs)(`div`,{className:`flex gap-1`,children:[(0,H.jsx)(Li,{children:`⌘`}),(0,H.jsx)(Li,{children:`S`})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg bg-muted/40 px-4 py-2.5`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(Ye,{className:`size-3.5`}),`未保存修改时关闭窗口会提示确认`]}),(0,H.jsx)(W,{variant:`muted`,children:`自动`})]}),(0,H.jsxs)(`div`,{className:`rounded-lg border px-4 py-3`,children:[(0,H.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`状态变更后的 git 行为(`,(0,H.jsx)(`span`,{className:`font-medium`,children:`仅作用于文档仓库,不影响业务代码仓库`}),`)`]}),(0,H.jsx)(`div`,{className:`mt-2 grid gap-3 sm:grid-cols-2`,children:[`cli`,`ui`].map(e=>{let r=t?.docs.git?.[e]??{commit:!0,push:!1};return(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`p`,{className:`text-xs font-medium`,children:e===`cli`?`CLI / Agent 调用`:`界面操作`}),(0,H.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`size-3.5 accent-primary`,checked:r.commit,onChange:t=>n(n=>{n.docs.git[e].commit=t.target.checked,t.target.checked||(n.docs.git[e].push=!1)})}),`自动提交`]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`size-3.5 accent-primary`,checked:r.push,disabled:!r.commit,onChange:t=>n(n=>{n.docs.git[e].push=t.target.checked,t.target.checked&&(n.docs.git[e].commit=!0)})}),`提交后推送`]})]},e)})})]})]})}),(0,H.jsx)(rp,{title:`清除配置`,description:`删除本机配置与备份,下次启动会重新进入首次引导`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-destructive/25 bg-destructive/5 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:`从零重新开始`}),(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`将删除 ~/.ylcwf/config.yaml 与 backups/ 下的全部内容,不可撤销。`})]}),(0,H.jsxs)(U,{variant:`destructive`,size:`sm`,className:`shrink-0 gap-1.5`,onClick:()=>i(!0),children:[(0,H.jsx)(zt,{className:`size-3.5`}),`清除配置`]})]})}),(0,H.jsxs)(rp,{title:`命令行`,description:`桌面端写入的配置,CLI 立即可见`,children:[(0,H.jsxs)(`div`,{className:`space-y-2 rounded-lg bg-muted/40 p-4 font-mono text-[11px] leading-relaxed text-muted-foreground`,children:[(0,H.jsx)(`p`,{children:`ylcwf show # 查看配置`}),(0,H.jsx)(`p`,{children:`ylcwf doctor # 校验配置`}),(0,H.jsx)(`p`,{children:`ylcwf resolve 示例终端-A --side frontend --field path`}),(0,H.jsx)(`p`,{children:`ylcwf terminal repo add 示例终端-A --side backend --path /path/to/repo`})]}),(0,H.jsxs)(cp,{children:[`Agent 约定:只读配置,不自行修改;遇到多仓库歧义或未命中时必须询问开发者。`,(0,H.jsxs)(`a`,{className:`ml-1 inline-flex items-center gap-0.5 underline underline-offset-2`,href:`https://www.npmjs.com/package/ylcwf`,target:`_blank`,rel:`noreferrer`,children:[`npm`,(0,H.jsx)(Ne,{className:`size-3`})]})]})]}),(0,H.jsx)(Hf,{open:r,onOpenChange:e=>e?void 0:i(!1),children:(0,H.jsxs)(Uf,{className:`max-w-md`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:`确认清除配置`}),(0,H.jsx)(Gf,{children:`将删除配置文件与历史备份,并回到首次引导。此操作不可撤销。`})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3.5 py-2.5 text-xs text-warning`,children:[(0,H.jsx)(Vt,{className:`mt-0.5 size-3.5 shrink-0`}),`如果你的配置是由管理员分发的,清除后需要重新走接入流程。`]}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>i(!1),children:`取消`}),(0,H.jsx)(U,{variant:`destructive`,size:`sm`,disabled:a,onClick:()=>void y(),children:`确认清除`})]})]})})]}):null]})}function Tp(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ep=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Op={};function kp(e,t){return((t||Op).jsx?Dp:Ep).test(e)}var Ap=/[ \t\n\f\r]/g;function jp(e){return typeof e==`object`?e.type===`text`&&Mp(e.value):Mp(e)}function Mp(e){return e.replace(Ap,``)===``}var Np=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Np.prototype.normal={},Np.prototype.property={},Np.prototype.space=void 0;function Pp(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Np(n,r,t)}function Fp(e){return e.toLowerCase()}var Ip=class{constructor(e,t){this.attribute=t,this.property=e}};Ip.prototype.attribute=``,Ip.prototype.booleanish=!1,Ip.prototype.boolean=!1,Ip.prototype.commaOrSpaceSeparated=!1,Ip.prototype.commaSeparated=!1,Ip.prototype.defined=!1,Ip.prototype.mustUseProperty=!1,Ip.prototype.number=!1,Ip.prototype.overloadedBoolean=!1,Ip.prototype.property=``,Ip.prototype.spaceSeparated=!1,Ip.prototype.space=void 0;var Lp=s({boolean:()=>X,booleanish:()=>zp,commaOrSpaceSeparated:()=>Up,commaSeparated:()=>Hp,number:()=>Z,overloadedBoolean:()=>Bp,spaceSeparated:()=>Vp}),Rp=0,X=Wp(),zp=Wp(),Bp=Wp(),Z=Wp(),Vp=Wp(),Hp=Wp(),Up=Wp();function Wp(){return 2**++Rp}var Gp=Object.keys(Lp),Kp=class extends Ip{constructor(e,t,n,r){let i=-1;if(super(e,t),qp(this,`space`,r),typeof n==`number`)for(;++i<Gp.length;){let e=Gp[i];qp(this,Gp[i],(n&Lp[e])===Lp[e])}}};Kp.prototype.defined=!0;function qp(e,t,n){n&&(e[t]=n)}function Jp(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Kp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Fp(r)]=r,n[Fp(a.attribute)]=r}return new Np(t,n,e.space)}var Yp=Jp({properties:{ariaActiveDescendant:null,ariaAtomic:zp,ariaAutoComplete:null,ariaBusy:zp,ariaChecked:zp,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:Vp,ariaCurrent:null,ariaDescribedBy:Vp,ariaDetails:null,ariaDisabled:zp,ariaDropEffect:Vp,ariaErrorMessage:null,ariaExpanded:zp,ariaFlowTo:Vp,ariaGrabbed:zp,ariaHasPopup:null,ariaHidden:zp,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vp,ariaLevel:Z,ariaLive:null,ariaModal:zp,ariaMultiLine:zp,ariaMultiSelectable:zp,ariaOrientation:null,ariaOwns:Vp,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:zp,ariaReadOnly:zp,ariaRelevant:null,ariaRequired:zp,ariaRoleDescription:Vp,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:zp,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Xp(e,t){return t in e?e[t]:t}function Zp(e,t){return Xp(e,t.toLowerCase())}var Qp=Jp({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Hp,acceptCharset:Vp,accessKey:Vp,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:Vp,autoFocus:X,autoPlay:X,blocking:Vp,capture:null,charSet:null,checked:X,cite:null,className:Vp,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:zp,controls:X,controlsList:Vp,coords:Z|Hp,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:Bp,draggable:zp,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:Vp,height:Z,hidden:Bp,high:Z,href:null,hrefLang:null,htmlFor:Vp,httpEquiv:Vp,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:Vp,itemRef:Vp,itemScope:X,itemType:Vp,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:X,optimum:Z,pattern:null,ping:Vp,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:Vp,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:Vp,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootCustomElementRegistry:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shadowRootSerializable:X,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:zp,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:zp,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vp,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:zp,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:X,disablePictureInPicture:X,disableRemotePlayback:X,exportParts:Hp,part:Vp,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:Zp}),$p=Jp({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Up,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:Vp,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Hp,g2:Hp,glyphName:Hp,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:Up,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vp,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Up,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Up,rev:Up,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Up,requiredFeatures:Up,requiredFonts:Up,requiredFormats:Up,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:Up,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Up,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Up,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Xp}),em=Jp({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),tm=Jp({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Zp}),nm=Jp({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),rm={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},im=/[A-Z]/g,am=/-[a-z]/g,om=/^data[-\w.:]+$/i;function sm(e,t){let n=Fp(t),r=t,i=Ip;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&om.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(am,lm);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!am.test(e)){let n=e.replace(im,cm);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Kp}return new i(r,t)}function cm(e){return`-`+e.toLowerCase()}function lm(e){return e.charAt(1).toUpperCase()}var um=Pp([Yp,Qp,em,tm,nm],`html`),dm=Pp([Yp,$p,em,tm,nm],`svg`);function fm(e){return e.join(` `).trim()}var pm=/\/\*(?:[^*]|\*(?!\/))*\*\//g,mm=/\n/g,hm=/^\s*/,gm=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,_m=/^:\s*/,vm=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,ym=/^[;\s]*/,bm=`
49
+ `},Js=0,Ys=[];function Xs(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Js++)[0],a=v.useState(vs)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Jo([e.lockRef.current],(e.shards||[]).map(Gs),!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=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Us(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=Is(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Is(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 Hs(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(Ys.length&&Ys[Ys.length-1]===a){var r=`deltaY`in n?Ws(n):Us(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ks(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Gs).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=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Zs(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Us(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Ws(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Us(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Ys.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,js),document.addEventListener(`touchmove`,c,js),document.addEventListener(`touchstart`,u,js),function(){Ys=Ys.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,js),document.removeEventListener(`touchmove`,c,js),document.removeEventListener(`touchstart`,u,js)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:qs(i)}):null,p?v.createElement(Os,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zs(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Qs=cs(ls,Xs),$s=v.forwardRef(function(e,t){return v.createElement(ds,Ko({},e,{ref:t,sideCar:Qs}))});$s.classNames=ds.classNames;var ec=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},tc=new WeakMap,nc=new WeakMap,rc={},ic=0,ac=function(e){return e&&(e.host||ac(e.parentNode))},oc=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ac(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})},sc=function(e,t,n,r){var i=oc(t,Array.isArray(e)?e:[e]);rc[n]||(rc[n]=new WeakMap);var a=rc[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=(tc.get(e)||0)+1,l=(a.get(e)||0)+1;tc.set(e,c),a.set(e,l),o.push(e),c===1&&i&&nc.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(),ic++,function(){o.forEach(function(e){var t=tc.get(e)-1,i=a.get(e)-1;tc.set(e,t),a.set(e,i),t||(nc.has(e)||e.removeAttribute(r),nc.delete(e)),i||e.removeAttribute(n)}),ic--,ic||(tc=new WeakMap,tc=new WeakMap,nc=new WeakMap,rc={})}},cc=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ec(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),sc(r,i,n,`aria-hidden`)):function(){return null}},lc=Object.defineProperty,uc=(e,t)=>lc(e,`name`,{value:t,configurable:!0}),dc=`Dialog`,[fc,pc]=va(dc),[mc,hc]=fc(dc),gc=uc(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),{nodes:l,registry:u}=go(),[d,f]=Pa({prop:r,defaultProp:i??!1,onChange:a,caller:dc}),[p,m]=v.useState(0),[h,g]=v.useState(0);return(0,H.jsx)(mc,{scope:t,triggerRef:s,contentRef:c,contentId:Ta(),titleId:Ta(),descriptionId:Ta(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),_c=`DialogPortal`,[vc,yc]=fc(_c,{forceMount:void 0}),bc=uc(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=hc(_c,t);return(0,H.jsx)(vc,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,H.jsx)(Po,{present:n||a.open,children:(0,H.jsx)(Ao,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),xc=`DialogOverlay`,Sc=v.forwardRef(uc(function(e,t){let n=yc(xc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hc(xc,e.__scopeDialog);return a.modal?(0,H.jsx)(Po,{present:r||a.open,children:(0,H.jsx)(wc,{...i,ref:t})}):null},`DialogOverlay`)),Cc=Ln(`DialogOverlay.RemoveScroll`),wc=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,...r}=e,i=hc(xc,n),a=Pn(t,to());return(0,H.jsx)($s,{as:Cc,allowPinchZoom:!0,shards:v.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,H.jsx)(Va.div,{"data-state":Fc(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Tc=`DialogContent`,Ec=v.forwardRef(uc(function(e,t){let n=yc(Tc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hc(Tc,e.__scopeDialog);return(0,H.jsx)(Po,{present:r||a.open,children:a.modal?(0,H.jsx)(Dc,{...i,ref:t}):(0,H.jsx)(Oc,{...i,ref:t})})},`DialogContent`)),Dc=v.forwardRef(uc(function(e,t){let n=hc(Tc,e.__scopeDialog),r=v.useRef(null),i=Pn(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return cc(e)},[]),(0,H.jsx)(kc,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ua(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ua(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ua(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Oc=v.forwardRef(uc(function(e,t){let n=hc(Tc,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,H.jsx)(kc,{...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`)),kc=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=hc(Tc,n);return Wo(),(0,H.jsx)(ho,{registry:l.branchRegistry,children:(0,H.jsx)(po,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(eo,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Pc(o,l.descriptionId):o,"data-state":Fc(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Ac=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,...r}=e,i=hc(`DialogTitle`,n),{setTitleCount:a}=i;return ba(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(Va.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),jc=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,...r}=e,i=hc(`DialogDescription`,n),{setDescriptionCount:a}=i;return ba(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(Va.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Mc=`DialogClose`,Nc=v.forwardRef(uc(function(e,t){let{__scopeDialog:n,...r}=e,i=hc(Mc,n);return(0,H.jsx)(Va.button,{type:`button`,...r,ref:t,onClick:ua(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Pc(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}uc(Pc,`concatAriaDescribedby`);function Fc(e){return e?`open`:`closed`}uc(Fc,`getState`);var Ic=Object.defineProperty,Lc=(e,t)=>Ic(e,`name`,{value:t,configurable:!0});function Rc(e,[t,n]){return Math.min(n,Math.max(t,e))}Lc(Rc,`clamp`);var zc=Object.defineProperty,Bc=(e,t)=>zc(e,`name`,{value:t,configurable:!0});function Vc(e){let t=e+`CollectionProvider`,[n,r]=va(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Bc(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,H.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Ln(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Pn(t,a(s,n).collectionRef);return(0,H.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Ln(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=Pn(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,H.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Bc(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Bc(Vc,`createCollection`);var Hc=new WeakMap,Uc=class e extends Map{static{Bc(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Hc.set(this,!0)}set(e,t){return Hc.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=Kc(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Wc(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Wc(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Wc(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Wc(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Gc(e,t);return n===-1?void 0:e[n]}Bc(Wc,`at`);function Gc(e,t){let n=e.length,r=Kc(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Bc(Gc,`toSafeIndex`);function Kc(e){return e!==e||e===0?0:Math.trunc(e)}Bc(Kc,`toSafeInteger`);function qc(e){let t=e+`CollectionProvider`,[n,r]=va(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=Bc(({state:e,...t})=>e?(0,H.jsx)(u,{...t,state:e}):(0,H.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=Bc(e=>{let t=_();return(0,H.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=Bc(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[s,c]=v.useState(null),l=Pn(a,c),[u,d]=r,f=v.useRef(new Uc),p=v.useCallback(()=>{let e=f.current;return Xc(e)||e.sort(Zc),e},[]);return v.useEffect(()=>{if(!s)return;let e=Qc(()=>{d(e=>{let t=e.toSorted(Zc);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,H.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,H.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=Ln(d),p=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Pn(t,a(d,n).collectionElementRef);return(0,H.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Ln(m),g=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=v.useRef(i);Jc(l.current,i)||(l.current=i);let u=l.current,d=Pn(t,v.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);ba(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=v.useRef(null);return v.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new Uc(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(Zc)}))}),v.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new Uc(t);return n.delete(e.element),n})},[s]),(0,H.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return v.useState(new Uc)}Bc(_,`useInitCollection`);function y(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}Bc(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Bc(b,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:_}]}Bc(qc,`createCollection`);function Jc(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Bc(Jc,`shallowEqual`);function Yc(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Bc(Yc,`isElementPreceding`);function Xc(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Bc(Xc,`isInDocumentOrder`);function Zc(e,t){return!e[1].element||!t[1].element?0:Yc(e[1].element,t[1].element)?-1:1}Bc(Zc,`sortByDocumentPosition`);function Qc(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Bc(Qc,`getChildListObserver`);var $c=Object.defineProperty,el=(e,t)=>$c(e,`name`,{value:t,configurable:!0}),tl={LTR:`ltr`,RTL:`rtl`},nl=v.createContext(void 0);function rl(e){let t=v.useContext(nl);return e||t||tl.LTR}el(rl,`useDirection`);var il=[`top`,`right`,`bottom`,`left`],al=Math.min,ol=Math.max,sl=Math.round,cl=Math.floor,ll=e=>({x:e,y:e}),ul={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function dl(e,t,n){return ol(e,al(t,n))}function fl(e,t){return typeof e==`function`?e(t):e}function pl(e){return e.split(`-`)[0]}function ml(e){return e.split(`-`)[1]}function hl(e){return e===`x`?`y`:`x`}function gl(e){return e===`y`?`height`:`width`}function _l(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function vl(e){return hl(_l(e))}function yl(e,t,n){n===void 0&&(n=!1);let r=ml(e),i=vl(e),a=gl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ol(o)),[o,Ol(o)]}function bl(e){let t=Ol(e);return[xl(e),t,xl(t)]}function xl(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Sl=[`left`,`right`],Cl=[`right`,`left`],wl=[`top`,`bottom`],Tl=[`bottom`,`top`];function El(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Cl:Sl:t?Sl:Cl;case`left`:case`right`:return t?wl:Tl;default:return[]}}function Dl(e,t,n,r){let i=ml(e),a=El(pl(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(xl)))),a}function Ol(e){let t=pl(e);return ul[t]+e.slice(t.length)}function kl(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Al(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:kl(e)}function jl(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 Ml(e,t,n){let{reference:r,floating:i}=e,a=_l(t),o=vl(t),s=gl(o),c=pl(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=ml(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Nl(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=fl(t,e),p=Al(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=jl(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=jl(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 Pl=50,Fl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Nl},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ml(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<Pl&&(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}=Ml(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Il=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}=fl(e,t)||{};if(l==null)return{};let d=Al(u),f={x:n,y:r},p=vl(i),m=gl(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=al(d[_],T),D=al(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=dl(E,k,O),j=!c.arrow&&ml(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Ll=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}=fl(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=pl(r),_=_l(o),v=pl(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ol(o)]:bl(o)),x=p!==`none`;!d&&x&&b.push(...Dl(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=yl(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`||_===_l(t)||T.every(e=>_l(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=_l(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}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 zl(e){return il.some(t=>e[t]>=0)}var Bl=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=fl(e,t);switch(i){case`referenceHidden`:{let e=Rl(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zl(e)}}}case`escaped`:{let e=Rl(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:zl(e)}}}default:return{}}}}},Vl=new Set([`left`,`top`]);async function Hl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=pl(n),s=ml(n),c=_l(n)===`y`,l=Vl.has(o)?-1:1,u=a&&c?-1:1,d=fl(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 Ul=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 Hl(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}}}}},Wl=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}=fl(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=_l(i),p=hl(f),m=u[p],h=u[f],g=(e,t)=>dl(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}}}}}},Gl=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}=fl(e,t),u={x:n,y:r},d=_l(i),f=hl(d),p=u[f],m=u[d],h=fl(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=Vl.has(pl(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}}}},Kl=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}=fl(e,t),c=await i.detectOverflow(t,s),l=pl(n),u=ml(n),d=_l(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=al(p-c[m],g),y=al(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*ol(c.left,c.right):S=p-2*ol(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 ql(){return typeof window<`u`}function Jl(e){return Zl(e)?(e.nodeName||``).toLowerCase():`#document`}function Yl(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xl(e){return((Zl(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Zl(e){return ql()?e instanceof Node||e instanceof Yl(e).Node:!1}function Ql(e){return ql()?e instanceof Element||e instanceof Yl(e).Element:!1}function $l(e){return ql()?e instanceof HTMLElement||e instanceof Yl(e).HTMLElement:!1}function eu(e){return!ql()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Yl(e).ShadowRoot}function tu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=fu(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function nu(e){return/^(table|td|th)$/.test(Jl(e))}function ru(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var iu=/transform|translate|scale|rotate|perspective|filter/,au=/paint|layout|strict|content/,ou=e=>!!e&&e!==`none`,su;function cu(e){let t=Ql(e)?fu(e):e;return ou(t.transform)||ou(t.translate)||ou(t.scale)||ou(t.rotate)||ou(t.perspective)||!uu()&&(ou(t.backdropFilter)||ou(t.filter))||iu.test(t.willChange||``)||au.test(t.contain||``)}function lu(e){let t=mu(e);for(;$l(t)&&!du(t);){if(cu(t))return t;if(ru(t))return null;t=mu(t)}return null}function uu(){return su??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),su}function du(e){return/^(html|body|#document)$/.test(Jl(e))}function fu(e){return Yl(e).getComputedStyle(e)}function pu(e){return Ql(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mu(e){if(Jl(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||eu(e)&&e.host||Xl(e);return eu(t)?t.host:t}function hu(e){let t=mu(e);return du(t)?(e.ownerDocument||e).body:$l(t)&&tu(t)?t:hu(t)}function gu(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=hu(e),i=r===e.ownerDocument?.body,a=Yl(r);if(i){let e=_u(a);return t.concat(a,a.visualViewport||[],tu(r)?r:[],e&&n?gu(e):[])}return t.concat(r,gu(r,[],n))}function _u(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vu(e){let t=fu(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=$l(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=sl(n)!==a||sl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function yu(e){return Ql(e)?e:e.contextElement}function bu(e){let t=yu(e);if(!$l(t))return ll(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=vu(t),o=(a?sl(n.width):n.width)/r,s=(a?sl(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var xu=ll(0);function Su(e){let t=Yl(e);return!uu()||!t.visualViewport?xu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Cu(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Yl(e)}function wu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=yu(e),o=ll(1);t&&(r?Ql(r)&&(o=bu(r)):o=bu(e));let s=Cu(a,n,r)?Su(a):ll(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=Yl(a),t=Ql(r)?Yl(r):r,n=e,i=_u(n);for(;i&&t!==n;){let e=bu(i),t=i.getBoundingClientRect(),r=fu(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=Yl(i),i=_u(n)}}return jl({width:u,height:d,x:c,y:l})}function Tu(e,t){let n=pu(e).scrollLeft;return t?t.left+n:wu(Xl(e)).left+n}function Eu(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Tu(e,n),y:n.top+t.scrollTop}}function Du(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Xl(r),s=t?ru(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ll(1),u=ll(0),d=$l(r);if((d||!a)&&((Jl(r)!==`body`||tu(o))&&(c=pu(r)),d)){let e=wu(r);l=bu(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Eu(o,c):ll(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 Ou(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ku(e){let t=pu(e),n=e.ownerDocument.body,r=ol(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ol(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Tu(e),o=-t.scrollTop;return fu(n).direction===`rtl`&&(a+=ol(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Au=25;function ju(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Yl(e),a=Xl(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!uu()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Tu(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<=Au&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Mu(e,t){let n=wu(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=bu(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Nu(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ju(e,n,t);else if(t===`document`)r=ku(Xl(e));else if(Ql(t))r=Mu(t,n);else{let n=Su(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return jl(r)}function Pu(e,t){let n=t.get(e);if(n)return n;let r=gu(e,[],!1).filter(e=>Ql(e)&&Jl(e)!==`body`),i=null,a=fu(e).position===`fixed`,o=a?mu(e):e;for(;Ql(o)&&!du(o);){let e=fu(o),t=cu(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=mu(o)}return t.set(e,r),r}function Fu(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ru(t)?[]:Pu(t,this._c):[].concat(n),r],o=Nu(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=Nu(t,a[e],i);s=ol(n.top,s),c=al(n.right,c),l=al(n.bottom,l),u=ol(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Iu(e){let{width:t,height:n}=vu(e);return{width:t,height:n}}function Lu(e,t,n){let r=$l(t),i=Xl(t),a=n===`fixed`,o=wu(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ll(0);if((r||!a)&&((Jl(t)!==`body`||tu(i))&&(s=pu(t)),r)){let e=wu(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Tu(i));let l=i&&!r&&!a?Eu(i,s):ll(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 Ru(e){return fu(e).position===`static`}function zu(e,t){if(!$l(e)||fu(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Xl(e)===n&&(n=n.ownerDocument.body),n}function Bu(e,t){let n=Yl(e);if(ru(e))return n;if(!$l(e)){let t=mu(e);for(;t&&!du(t);){if(Ql(t)&&!Ru(t))return t;t=mu(t)}return n}let r=zu(e,t);for(;r&&nu(r)&&Ru(r);)r=zu(r,t);return r&&du(r)&&Ru(r)&&!cu(r)?n:r||lu(e)||n}var Vu=async function(e){let t=this.getOffsetParent||Bu,n=this.getDimensions,r=await n(e.floating);return{reference:Lu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hu(e){return fu(e).direction===`rtl`}var Uu={convertOffsetParentRelativeRectToViewportRelativeRect:Du,getDocumentElement:Xl,getClippingRect:Fu,getOffsetParent:Bu,getElementRects:Vu,getClientRects:Ou,getDimensions:Iu,getScale:bu,isElement:Ql,isRTL:Hu};function Wu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gu(e,t,n){let r=null,i,a=Xl(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=cl(d),h=cl(a.clientWidth-(u+f)),g=cl(a.clientHeight-(d+p)),_=cl(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ol(0,al(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Wu(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=Yl(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ku(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=yu(e),u=i||a?[...l?gu(l):[],...t?gu(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Gu(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?wu(e):null;c&&g();function g(){let t=wu(e);h&&!Wu(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 qu=Ul,Ju=Wl,Yu=Ll,Xu=Kl,Zu=Bl,Qu=Il,$u=Gl,ed=(e,t,n)=>{let r=new Map,i=n??{},a={...Uu,...i.platform,_c:r};return Fl(e,t,{...i,platform:a})},J=typeof document<`u`?v.useLayoutEffect:function(){};function td(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(!td(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)&&!td(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function nd(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rd(e,t){let n=nd(e);return Math.round(t*n)/n}function id(e){let t=v.useRef(e);return J(()=>{t.current=e}),t}function ad(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);td(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=id(c),O=id(i),k=id(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),ed(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!td(T.current,t)&&(T.current=t,Xt.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);J(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);J(()=>(j.current=!0,()=>{j.current=!1}),[]),J(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=rd(N.floating,u.x),r=rd(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...nd(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var od=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?{}:Qu({element:r.current,padding:i}).fn(n):r?Qu({element:r,padding:i}).fn(n):{}}}},sd=(e,t)=>{let n=qu(e);return{name:n.name,fn:n.fn,options:[e,t]}},cd=(e,t)=>{let n=Ju(e);return{name:n.name,fn:n.fn,options:[e,t]}},ld=(e,t)=>({fn:$u(e).fn,options:[e,t]}),ud=(e,t)=>{let n=Yu(e);return{name:n.name,fn:n.fn,options:[e,t]}},dd=(e,t)=>{let n=Xu(e);return{name:n.name,fn:n.fn,options:[e,t]}},fd=(e,t)=>{let n=Zu(e);return{name:n.name,fn:n.fn,options:[e,t]}},pd=(e,t)=>{let n=od(e);return{name:n.name,fn:n.fn,options:[e,t]}},md=Object.defineProperty,hd=(e,t)=>md(e,`name`,{value:t,configurable:!0});function gd(e){let[t,n]=v.useState(void 0);return ba(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}hd(gd,`useSize`);var _d=Object.defineProperty,vd=(e,t)=>_d(e,`name`,{value:t,configurable:!0}),yd={Partial:`partial`,Always:`always`},bd={Optimized:`optimized`,Always:`always`},xd=`Popper`,[Sd,Cd]=va(xd),[wd,Td]=Sd(xd),Ed=vd(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,H.jsx)(wd,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Dd=`PopperAnchor`,Od=v.forwardRef(vd(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Td(Dd,n),o=v.useRef(null),s=a.onAnchorChange,c=Pn(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Fd(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(Va.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),kd=`PopperContent`,[Ad,jd]=Sd(kd),Md=v.forwardRef(vd(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=yd.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=bd.Optimized,onPlaced:m,...h}=e,g=Td(kd,n),[_,y]=v.useState(null),b=Pn(t,y),[x,S]=v.useState(null),C=gd(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Nd),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:ee,middlewareData:P}=ad({strategy:`fixed`,placement:E,whileElementsMounted:vd((...e)=>Ku(...e,{animationFrame:p===bd.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[sd({mainAxis:i+T,alignmentAxis:o}),c&&cd({mainAxis:!0,crossAxis:!1,...d===yd.Partial?{limiter:ld()}:{},...A}),c&&ud({...A}),dd({...A,apply:vd(({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&&pd({element:x,padding:s}),Pd({arrowWidth:w,arrowHeight:T}),f&&fd(k?{strategy:`referenceHidden`,...A}:{strategy:`referenceHidden`,padding:A.padding,altBoundary:A.altBoundary})]}),F=g.setPlacementState;ba(()=>(F(N),()=>{F(void 0)}),[N,F]);let[te,ne]=Fd(N),re=Ka(m);ba(()=>{ee&&re?.()},[ee,re]);let ie=P.arrow?.x,ae=P.arrow?.y,oe=P.arrow?.centerOffset!==0,[se,ce]=v.useState();return ba(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:ee?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(Ad,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:S,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,H.jsx)(Va.div,{"data-side":te,"data-align":ne,...h,ref:b,style:{...h.style,animation:ee?h.style?.animation:`none`}})})})},`PopperContent`));function Nd(e){return e!==null}vd(Nd,`isNotNull`);var Pd=vd(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]=Fd(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 Fd(e){let[t,n=`center`]=e.split(`-`);return[t,n]}vd(Fd,`getSideAndAlignFromPlacement`);var Id=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ld=Object.defineProperty,Rd=(e,t)=>Ld(e,`name`,{value:t,configurable:!0}),zd={ItemAligned:`item-aligned`,Popper:`popper`},Bd={LTR:`ltr`,RTL:`rtl`},Vd=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Hd=[` `,`Enter`],Ud=`Select`,[Wd,Gd,Kd]=Vc(Ud),[qd,Jd]=va(Ud,[Kd,Cd]),Yd=Cd(),[Xd,Zd]=qd(Ud),[Qd,$d]=qd(Ud);function ef(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=Yd(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=rl(l),[T,E]=Pa({prop:r,defaultProp:i??!1,onChange:a,caller:Ud}),[D,O]=Pa({prop:o,defaultProp:s,onChange:c,caller:Ud}),k=v.useRef(null),A=v.useRef(!1),[j,M]=v.useState(null),N=Rd(e=>{M({value:e,hasConsumerStoppedPropagation:A.current}),O(e)},`handleUserSelect`),ee=v.useRef(D);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=Rd(()=>O(ee.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let P=!_||!!m||!!_.closest(`form`),[F,te]=v.useState(new Set),ne=Ta(),re=Array.from(F).map(e=>e.props.value).join(`;`),ie=v.useCallback(e=>{te(t=>new Set(t).add(e))},[]),ae=v.useCallback(e=>{te(t=>{let n=new Set(t);return n.delete(e),n})},[]),oe={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:ne,value:D,onValueChange:O,hasConsumerStoppedPropagationRef:A,userSelection:j,onUserSelect:N,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:F,nativeSelectKey:re,isFormControl:P};return(0,H.jsx)(Ed,{...g,children:(0,H.jsx)(Xd,{scope:t,...oe,children:(0,H.jsx)(Wd.Provider,{scope:t,children:(0,H.jsx)(Qd,{scope:t,onNativeOptionAdd:ie,onNativeOptionRemove:ae,children:Lf(h)?h(oe):n})})})})}Rd(ef,`SelectProvider`);var tf=Rd(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,H.jsx)(ef,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[n,e?(0,H.jsx)(If,{__scopeSelect:t}):null]})})},`Select`),nf=`SelectTrigger`,rf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Yd(n),o=Zd(nf,n),s=o.disabled||r,c=Pn(t,o.onTriggerChange),l=Gd(n),u=v.useRef(`touch`),[d,f,p]=zf(e=>{let t=l().filter(e=>!e.disabled),n=Bf(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),m=Rd(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,H.jsx)(Od,{asChild:!0,...a,children:(0,H.jsx)(Va.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Rf(o.value)?``:void 0,...i,ref:c,onClick:ua(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:ua(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:ua(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),f(e.key)),t&&e.key===` `||Vd.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),af=`SelectValue`,of=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Zd(af,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Pn(t,c.onValueNodeChange);ba(()=>{l(u)},[l,u]);let f=Rf(c.value);return(0,H.jsx)(Va.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,H.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),sf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,H.jsx)(Va.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[cf,lf]=qd(`SelectPortal`,{forceMount:void 0}),uf=Rd(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,H.jsx)(cf,{scope:e.__scopeSelect,forceMount:n,children:(0,H.jsx)(Ao,{asChild:!0,...r})})},`SelectPortal`),df=`SelectContent`,ff=v.forwardRef(Rd(function(e,t){let n=lf(df,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Zd(df,e.__scopeSelect),[o,s]=v.useState();return ba(()=>{s(new DocumentFragment)},[]),(0,H.jsx)(Po,{present:r||a.open,children:({present:e})=>e?(0,H.jsx)(vf,{...i,ref:t}):(0,H.jsx)(pf,{...i,fragment:o})})},`SelectContent`)),pf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Xt.createPortal((0,H.jsx)(hf,{scope:n,children:(0,H.jsx)(Wd.Slot,{scope:n,children:(0,H.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),mf=10,[hf,gf]=qd(df),_f=Ln(`SelectContent.RemoveScroll`),vf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n}=e,{position:r=zd.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=Zd(df,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=Pn(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=Gd(n),[A,j]=v.useState(!1),M=v.useRef(!1),N=v.useRef(!1),ee=v.useRef(!1);v.useEffect(()=>{if(b)return cc(b)},[b]),Wo();let P=v.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),F=v.useCallback(()=>P([T,b]),[P,T,b]);v.useEffect(()=>{A&&F()},[A,F]);let{onOpenChange:te,triggerPointerDownPosRef:ne}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=Rd(t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},`handlePointerMove`),n=Rd(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||te(!1),document.removeEventListener(`pointermove`,t),ne.current=null},`handlePointerUp`);return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,te,ne]),v.useEffect(()=>{let e=Rd(()=>te(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[te]);let[re,ie]=zf(e=>{let t=k().filter(e=>!e.disabled),n=Bf(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=v.useCallback((e,t,n)=>{let r=!N.current;r&&(N.current=!0);let i=!M.current&&!n;y.value!==void 0&&y.value===t||i?(E(e),i&&(M.current=!0)):r&&E(e)},[y.value]),oe=v.useCallback(()=>b?.focus(),[b]),se=v.useCallback((e,t,n)=>{if(!e)return;let r=!ee.current;r&&(ee.current=!0);let i=!M.current&&!n;(y.value!==void 0&&y.value===t||i||r)&&O(e)},[y.value]),ce=r===zd.Popper?bf:yf,le=ce===bf?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,H.jsx)(hf,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ae,selectedItem:T,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:F,selectedItemText:D,position:r,isPositioned:A,searchRef:re,children:(0,H.jsx)($s,{as:_f,allowPinchZoom:!0,children:(0,H.jsx)(po,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ua(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,H.jsx)(eo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,H.jsx)(ce,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:ua(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),yf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Zd(df,n),o=gf(df,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=Pn(t,u),f=Gd(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==Bd.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-mf,d=Rc(a,[mf,Math.max(mf,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-mf,d=Rc(a,[mf,Math.max(mf,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-mf*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-mf,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${mf}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);ba(()=>b(),[b]);let[x,S]=v.useState();ba(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]);return(0,H.jsx)(xf,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,H.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,H.jsx)(Va.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),bf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=mf,...a}=e,o=Yd(n);return(0,H.jsx)(Md,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[xf,Sf]=qd(df,{}),Cf=`SelectViewport`,wf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=gf(Cf,n),o=Sf(Cf,n),s=Pn(t,a.onViewportChange),c=v.useRef(0);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,H.jsx)(Wd.Slot,{scope:n,children:(0,H.jsx)(Va.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:ua(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-mf*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Tf,Ef]=qd(`SelectGroup`),Df=`SelectItem`,[Of,kf]=qd(Df),Af=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Zd(Df,n),c=gf(Df,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=Pn(t,Ka(e=>c.itemRefCallback?.(e,r,i))),h=Ta(),g=v.useRef(`touch`);function _(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return Rd(_,`handleSelect`),(0,H.jsx)(Of,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,H.jsx)(Wd.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,H.jsx)(Va.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:ua(o.onFocus,()=>p(!0)),onBlur:ua(o.onBlur,()=>p(!1)),onClick:ua(o.onClick,e=>{i||g.current!==`mouse`&&_(e)}),onPointerUp:ua(o.onPointerUp,e=>{i||g.current===`mouse`&&_(e)}),onPointerDown:ua(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:ua(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ua(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ua(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Hd.includes(e.key)&&_(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),jf=`SelectItemText`,Mf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Zd(jf,n),s=gf(jf,n),c=kf(jf,n),l=$d(jf,n),[u,d]=v.useState(null),f=Ka(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Pn(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,H.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return ba(()=>(g(h),()=>_(h)),[g,_,h]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Va.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Rf(o.value)?Xt.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Nf=`SelectItemIndicator`,Pf=v.forwardRef(Rd(function(e,t){let{__scopeSelect:n,...r}=e;return kf(Nf,n).isSelected?(0,H.jsx)(Va.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Ff=`SelectBubbleInput`,If=v.forwardRef(Rd(function({__scopeSelect:e,...t},n){let r=Zd(Ff,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=v.useRef(null),h=Pn(n,m),g=i??``,_=v.useRef(g),y=v.useRef(d),b=v.useRef(!1),x=Array.from(f).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=d!==null&&d!==y.current;y.current=d;let i=_.current!==g;_.current=g;let a=r&&i;if(r&&!i&&d.value!==g&&!d.hasConsumerStoppedPropagation&&n){b.current=!0;try{n.call(e,d.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{b.current=!1,n.call(e,g)}return}let o=a&&!d.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,g),e.dispatchEvent(t)}},[g,d]),(0,H.jsxs)(Va.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{b.current||a(e.target.value)},...t,style:{...Id,...t.style},ref:h,defaultValue:g,children:[Rf(i)&&!x?(0,H.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function Lf(e){return typeof e==`function`}Rd(Lf,`isFunction`);function Rf(e){return e===``||e===void 0}Rd(Rf,`shouldShowPlaceholder`);function zf(e){let t=Ka(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}Rd(a,`updateSearch`),a(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Rd(zf,`useTypeaheadSearch`);function Bf(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Vf(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Rd(Bf,`findNextItem`);function Vf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Rd(Vf,`wrapArray`);var Hf=gc;function Uf({className:e,children:t,...n}){let r=v.useRef(null);return(0,H.jsxs)(bc,{children:[(0,H.jsx)(Sc,{className:`fixed inset-0 z-50 bg-black/45 backdrop-blur-[2px]`}),(0,H.jsxs)(Ec,{ref:r,tabIndex:-1,onOpenAutoFocus:e=>{e.preventDefault(),r.current?.focus({preventScroll:!0})},className:V(`animate-fade-up fixed left-1/2 top-1/2 z-50 grid w-full max-w-xl -translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl border bg-card p-6 shadow-2xl focus:outline-none`,e),...n,children:[t,(0,H.jsxs)(Nc,{className:`absolute right-4 top-4 rounded-md p-1 text-muted-foreground opacity-70 transition hover:bg-accent hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:outline-none`,children:[(0,H.jsx)(Yt,{className:`size-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`关闭`})]})]})]})}function Wf({className:e,...t}){return(0,H.jsx)(`div`,{className:V(`flex flex-col gap-1.5 pr-8`,e),...t})}function Y({className:e,...t}){return(0,H.jsx)(Ac,{className:V(`text-lg font-semibold tracking-tight`,e),...t})}function Gf({className:e,...t}){return(0,H.jsx)(jc,{className:V(`text-sm text-muted-foreground`,e),...t})}function Kf({className:e,...t}){return(0,H.jsx)(`div`,{className:V(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}var qf=tf,Jf=of;function Yf({className:e,children:t,...n}){return(0,H.jsxs)(rf,{className:V(`flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:[t,(0,H.jsx)(sf,{asChild:!0,children:(0,H.jsx)(de,{className:`size-4 opacity-50`})})]})}function Xf({className:e,children:t,...n}){return(0,H.jsx)(uf,{children:(0,H.jsx)(ff,{position:`popper`,className:V(`z-50 max-h-72 min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg`,e),...n,children:(0,H.jsx)(wf,{children:t})})})}function Zf({className:e,children:t,...n}){return(0,H.jsxs)(Af,{className:V(`relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground`,e),...n,children:[(0,H.jsx)(Mf,{children:t}),(0,H.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,H.jsx)(Pf,{children:(0,H.jsx)(le,{className:`size-4`})})})]})}function Qf({open:e,initialPath:t,onOpenChange:n,onPick:r}){let[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),f=async e=>{s(!0),l(null);try{let t=await G.listDirectories(e);a(t),d(t.path),localStorage.setItem(`ylcwf-last-dir`,t.path)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}};(0,v.useEffect)(()=>{if(!e)return;a(null);let n=localStorage.getItem(`ylcwf-last-dir`);f(t??n??void 0)},[e,t]);let p=[],m=localStorage.getItem(`ylcwf-last-dir`);return m!==null&&p.push({label:`上次位置`,path:m,icon:Ft}),t!==void 0&&t.trim().length>0&&t!==m&&p.push({label:`当前配置`,path:t,icon:Ft}),(0,H.jsx)(Hf,{open:e,onOpenChange:n,children:(0,H.jsxs)(Uf,{className:`max-w-2xl`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:`选择文档仓库目录`}),(0,H.jsx)(Gf,{children:`逐层进入目标目录后点「选择此目录」;需包含 skills/iteration-task-docs。`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(U,{variant:`outline`,size:`icon`,className:`shrink-0`,disabled:i?.parent===null||i?.parent===void 0||o,onClick:()=>i?.parent!=null&&void f(i.parent),title:`上一级`,children:(0,H.jsx)(re,{className:`size-4`})}),(0,H.jsx)(Ni,{value:u,spellCheck:!1,className:`font-mono text-xs`,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f(u)}}),(0,H.jsx)(U,{variant:`ghost`,size:`sm`,className:`shrink-0`,onClick:()=>void f(u),disabled:o,children:`前往`})]}),p.length===0?null:(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:p.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>void f(e.path),className:`flex max-w-full items-center gap-1.5 rounded-md border px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground`,children:[(0,H.jsx)(e.icon,{className:`size-3`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.label})]},`${e.label}-${e.path}`))}),(0,H.jsx)(`div`,{className:`h-72 overflow-y-auto rounded-lg border`,children:o?(0,H.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}),`正在读取目录…`]}):c===null?i===null||i.entries.length===0?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center text-xs text-muted-foreground`,children:`该目录下没有子目录`}):(0,H.jsx)(`ul`,{className:`divide-y`,children:i.entries.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>void f(e.path),className:V(`flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-accent/60`,e.hidden?`text-muted-foreground`:``),children:[(0,H.jsx)(Ue,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.path))}):(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs text-destructive`,children:c})}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>n(!1),children:`取消`}),(0,H.jsxs)(U,{size:`sm`,className:`gap-1.5`,disabled:i===null,onClick:()=>{i!==null&&(r(i.path),n(!1))},children:[(0,H.jsx)(ze,{className:`size-3.5`}),`选择此目录`]})]})]})})}function $f(e){return[{label:`本地配置`,ok:e.hasConfig&&e.configValid,detail:e.hasConfig?e.configValid?`已就绪`:`结构不合法`:`未创建`},{label:`Git 环境`,ok:e.gitAvailable,detail:e.gitAvailable?`已安装`:`未检测到 git 命令`},{label:`文档仓库`,ok:e.docsConfigured,detail:e.docsConfigured?e.docsRoot:`尚未选择`},{label:`访问权限`,ok:e.docsAccessible,detail:e.docsAccessible?`可读取(${e.iterationCount} 个迭代)`:e.reason??`待检测`}]}function ep(e){switch(e.nextStep){case`install-git`:case`fix-config`:return`blocked`;case`set-docs-root`:return`docs`;default:return`detect`}}function tp({state:e,onDone:t}){let{snapshot:n}=oa(),[r,i]=(0,v.useState)(ep(e)),[a,o]=(0,v.useState)(e.docsRoot),[s,c]=(0,v.useState)(e.developer),[l,u]=(0,v.useState)(e.role),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(!1),b=async e=>{f(!0),m(null);try{await e()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}},x=()=>b(async()=>{g(await G.inspect(a.trim()))}),S=()=>b(async()=>{let e=n?.config,r={profile:{developer:s.trim(),role:l},docs:{root:a.trim(),git:e?.docs.git??{cli:{commit:!0,push:!1},ui:{commit:!0,push:!1}}},terminals:e?.terminals??{}};await G.completeOnboarding(r),await t()}),C=()=>b(async()=>{let e=await G.pickDirectory();e!==null&&(o(e),g(await G.inspect(e)))}),w=/^[a-z][a-z0-9]*$/.test(s.trim()),T=a.trim().length>0&&h?.hasDocsSkill===!0;return(0,H.jsx)(`div`,{className:`app-glow flex min-h-full items-center justify-center px-6 py-10`,children:(0,H.jsxs)(`div`,{className:`relative z-10 w-full max-w-2xl`,children:[(0,H.jsxs)(`div`,{className:`mb-6 flex items-center gap-2.5`,children:[(0,H.jsx)(`div`,{className:`flex size-9 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm`,children:(0,H.jsx)(lt,{className:`size-4`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-sm font-semibold tracking-tight`,children:`ylcwf 工作台`}),(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`首次启动配置`})]})]}),(0,H.jsxs)(`div`,{className:`animate-fade-up rounded-xl border bg-card p-7 shadow-xl`,children:[r===`detect`?(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`启动环境检测`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`确认为你准备好文档仓库与访问权限后进入工作台。`})]}),(0,H.jsx)(`ul`,{className:`space-y-2`,children:$f(e).map(e=>(0,H.jsxs)(`li`,{className:`flex items-center justify-between gap-3 rounded-lg border px-3.5 py-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[e.ok?(0,H.jsx)(I,{className:`size-4 text-success`}):(0,H.jsx)(Ce,{className:`size-4 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`text-sm`,children:e.label})]}),(0,H.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,title:e.detail,children:e.detail})]},e.label))}),(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsxs)(U,{onClick:()=>i(`docs`),children:[`继续`,(0,H.jsx)(te,{className:`size-3.5`})]})})]}):null,r===`docs`?(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`迭代任务文档仓库`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`选择你本地已克隆的文档仓库;需要包含 skills/iteration-task-docs。`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Pi,{children:`本地仓库路径`}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(Ni,{value:a,placeholder:`/Users/you/develop/iteration-task-repo`,spellCheck:!1,className:`font-mono text-xs`,onChange:e=>{o(e.target.value),g(null)}}),(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`shrink-0 gap-1.5`,onClick:()=>{G.mode===`electron`?C():y(!0)},children:[(0,H.jsx)(Ve,{className:`size-3.5`}),`选择`]}),(0,H.jsx)(U,{variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>void x(),disabled:a.trim().length===0,children:`校验`})]}),G.mode===`http`?(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`「选择」会打开本地目录浏览器;也可以直接粘贴绝对路径后点「校验」。`}):null,h===null?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[11px]`,children:[(0,H.jsx)(W,{variant:h.exists?`success`:`destructive`,children:h.exists?`路径存在`:`路径不存在`}),(0,H.jsx)(W,{variant:h.isGit?`success`:`warning`,children:h.isGit?`git 仓库`:`非 git 仓库`}),h.hasDocsSkill===void 0?null:(0,H.jsx)(W,{variant:h.hasDocsSkill?`success`:`destructive`,children:h.hasDocsSkill?`含 iteration-task-docs`:`缺少 iteration-task-docs`})]})]}),(0,H.jsxs)(`div`,{className:`flex justify-between`,children:[(0,H.jsx)(U,{variant:`ghost`,onClick:()=>i(`detect`),children:`返回`}),(0,H.jsxs)(U,{onClick:()=>i(`profile`),disabled:!T,children:[`继续`,(0,H.jsx)(te,{className:`size-3.5`})]})]})]}):null,r===`profile`?(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`身份信息`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`用于确定个人文档文件名,并在迭代看板里默认高亮你自己。`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Pi,{htmlFor:`onboarding-developer`,children:`开发者标识`}),(0,H.jsx)(Ni,{id:`onboarding-developer`,value:s,placeholder:`yourname`,spellCheck:!1,className:`font-mono`,onChange:e=>c(e.target.value.trim())}),w||s.length===0?null:(0,H.jsx)(`p`,{className:`text-xs text-destructive`,children:`必须是小写字母开头的字母数字串(姓名小写全拼)`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Pi,{children:`默认角色`}),(0,H.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:qi.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:V(`rounded-lg border p-3 text-left text-xs transition-all`,l===e?`border-primary/60 bg-primary/5`:`hover:bg-accent/40`),children:[(0,H.jsx)(`p`,{className:`font-medium`,children:Yi[e]}),(0,H.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:Xi[e]})]},e))})]}),(0,H.jsxs)(`div`,{className:`flex justify-between`,children:[(0,H.jsx)(U,{variant:`ghost`,onClick:()=>i(`docs`),children:`返回`}),(0,H.jsxs)(U,{onClick:()=>void S(),disabled:!w||!T||d,children:[d?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(le,{className:`size-3.5`}),`完成配置`]})]})]}):null,r===`blocked`?(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`需要先解决环境问题`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.reason??`当前环境不满足启动条件`})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3.5 py-3 text-xs text-warning`,children:[(0,H.jsx)(Vt,{className:`mt-0.5 size-4 shrink-0`}),(0,H.jsxs)(`div`,{className:`space-y-1.5 leading-relaxed`,children:[e.nextStep===`install-git`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{children:`请先安装 Git:`}),(0,H.jsx)(`code`,{className:`block rounded bg-background/60 px-2 py-1 font-mono`,children:`brew install git`})]}):null,e.nextStep===`fix-config`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{children:`配置文件结构不合法(可能来自旧版本),请重新初始化:`}),(0,H.jsx)(`code`,{className:`block rounded bg-background/60 px-2 py-1 font-mono`,children:`ylcwf init`}),(0,H.jsx)(`p`,{className:`opacity-80`,children:`或查看详情:`}),(0,H.jsx)(`code`,{className:`block rounded bg-background/60 px-2 py-1 font-mono`,children:`ylcwf doctor`})]}):null]})]}),(0,H.jsx)(`div`,{className:`flex justify-end gap-2`,children:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:()=>void t(),children:[(0,H.jsx)(_t,{className:`size-3.5`}),`重新检测`]})})]}):null,p===null?null:(0,H.jsxs)(`div`,{className:`mt-4 flex items-start gap-2 rounded-lg border border-destructive/25 bg-destructive/8 px-3.5 py-2.5 text-xs text-destructive`,children:[(0,H.jsx)(Vt,{className:`mt-0.5 size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`leading-relaxed`,children:p})]})]}),(0,H.jsx)(Qf,{open:_,initialPath:a.trim().length>0?a.trim():void 0,onOpenChange:y,onPick:e=>{o(e),g(null),(async()=>{try{g(await G.inspect(e))}catch{}})()}}),(0,H.jsxs)(`p`,{className:`mt-4 text-center text-[11px] text-muted-foreground`,children:[(0,H.jsx)(qe,{className:`mr-1 inline size-3`}),`配置保存在 ~/.ylcwf/config.yaml,与命令行工具共用`]})]})})}var np=class extends v.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[ylcwf] ${this.props.area} 渲染失败`,e,t.componentStack)}render(){let{error:e}=this.state;return e===null?this.props.children:(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 px-6 py-12 text-center`,children:[(0,H.jsx)(Vt,{className:`size-6 text-warning`}),(0,H.jsxs)(`p`,{className:`text-sm font-medium`,children:[this.props.area,`渲染失败`]}),(0,H.jsxs)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:[e.message,(0,H.jsx)(`br`,{}),`如果刚升级过,请重启 `,(0,H.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono`,children:`ylcwf serve`}),`(或重开桌面端)后刷新。`]}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>this.setState({error:null}),children:`重试`}),(0,H.jsx)(U,{size:`sm`,onClick:()=>window.location.reload(),children:`刷新页面`})]})]})}};function rp({title:e,description:t,actions:n,children:r,className:i}){return(0,H.jsxs)(ji,{className:V(`gap-4`,i),children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight`,children:e}),t===void 0?null:(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),n]}),(0,H.jsx)(Ii,{}),(0,H.jsx)(Mi,{className:`space-y-4`,children:r})]})}function ip({label:e,hint:t,error:n,htmlFor:r,children:i}){return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Pi,{htmlFor:r,children:e}),i,n===void 0?t===void 0?null:(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):(0,H.jsx)(`p`,{className:`text-xs text-destructive`,children:n})]})}function ap({issues:e}){return e.length===0?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-success/25 bg-success/8 px-4 py-3 text-sm text-success`,children:[(0,H.jsx)(I,{className:`size-4`}),`未发现问题,配置健康`]}):(0,H.jsx)(`ul`,{className:`space-y-2`,children:e.map((e,t)=>{let n=e.level===`error`;return(0,H.jsxs)(`li`,{className:V(`flex items-start gap-2.5 rounded-lg border px-3.5 py-2.5 text-sm`,n?`border-destructive/25 bg-destructive/6 text-destructive`:`border-warning/30 bg-warning/8 text-warning`),children:[n?(0,H.jsx)(Ce,{className:`mt-0.5 size-4 shrink-0`}):(0,H.jsx)(Vt,{className:`mt-0.5 size-4 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,H.jsx)(`p`,{className:`leading-snug`,children:e.message}),(0,H.jsxs)(`p`,{className:`font-mono text-[11px] opacity-70`,children:[e.code,e.where===void 0?``:` · ${e.where}`]})]})]},`${e.code}-${e.where??``}-${t}`)})})}function op({ok:e,text:t}){return e?(0,H.jsxs)(W,{variant:`success`,children:[(0,H.jsx)(I,{className:`size-3`}),t]}):(0,H.jsxs)(W,{variant:`destructive`,children:[(0,H.jsx)(Ce,{className:`size-3`}),t]})}function sp({icon:e,title:t,description:n,action:r}){return(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-14 text-center`,children:[(0,H.jsx)(`div`,{className:`flex size-11 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:e}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:t}),(0,H.jsx)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:n})]}),r]})}function cp({children:e}){return(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg bg-muted/60 px-3.5 py-2.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(Ye,{className:`mt-0.5 size-3.5 shrink-0`}),(0,H.jsx)(`div`,{className:`leading-relaxed`,children:e})]})}function lp({icon:e,label:t,value:n,hint:r}){return(0,H.jsx)(ji,{className:`gap-0 py-5`,children:(0,H.jsxs)(Mi,{className:`flex items-start justify-between`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),(0,H.jsx)(`p`,{className:`text-2xl font-semibold tracking-tight`,children:n}),r===void 0?null:(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:r})]}),(0,H.jsx)(`div`,{className:`flex size-9 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:e})]})})}function up(){let{snapshot:e,draft:t}=oa(),n=t?.terminals??{},r=Object.keys(n),i=r.reduce((e,t)=>e+Ki.reduce((e,r)=>e+(n[t]?.repos[r].length??0),0),0),a=e?.issues.filter(e=>e.level===`error`).length??0,o=e?.issues.filter(e=>e.level===`warning`).length??0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,H.jsx)(lp,{icon:(0,H.jsx)(lt,{className:`size-4`}),label:`PRD 终端`,value:r.length,hint:`已配置的终端数量`}),(0,H.jsx)(lp,{icon:(0,H.jsx)(Le,{className:`size-4`}),label:`本地仓库`,value:i,hint:`前后端仓库合计`}),(0,H.jsx)(lp,{icon:(0,H.jsx)(kt,{className:`size-4`}),label:`健康状态`,value:a>0?`${a} error`:o>0?`${o} warning`:`健康`,hint:a>0?`需要修复后才能正常使用`:o>0?`可继续使用,建议处理`:`doctor 校验通过`})]}),(0,H.jsx)(rp,{title:`当前身份`,description:`用于个人任务文档命名与模板选择`,children:(0,H.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`开发者标识`}),(0,H.jsx)(`p`,{className:`mt-1 font-mono text-sm`,children:t?.profile.developer||`—`})]}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`默认角色`}),(0,H.jsx)(`p`,{className:`mt-1 text-sm`,children:t===null?`—`:Yi[t.profile.role]})]}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`文档仓库`}),(0,H.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs`,title:t?.docs.root,children:t?.docs.root||`—`})]})]})}),(0,H.jsx)(rp,{title:`校验结果`,description:`与 ylcwf doctor 使用同一套规则`,children:(0,H.jsx)(ap,{issues:e?.issues??[]})})]})}var dp=/^[a-z][a-z0-9]*$/;function fp(){let{draft:e,mutate:t}=oa(),n=e?.profile.developer??``,r=e?.profile.role??`frontend`,i=n.length===0||dp.test(n)?void 0:`必须是小写字母开头的字母数字串(姓名小写全拼)`;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rp,{title:`开发者标识`,description:`个人任务文档文件名,也是文档中「负责人」的取值`,children:(0,H.jsx)(ip,{label:`developer`,htmlFor:`developer`,hint:`姓名小写全拼,例如 zhangsan。仅允许小写字母开头,可含数字与字母。`,error:i,children:(0,H.jsx)(Ni,{id:`developer`,value:n,placeholder:`yourname`,spellCheck:!1,autoComplete:`off`,className:`max-w-sm font-mono`,onChange:e=>t(t=>{t.profile.developer=e.target.value.trim()})})})}),(0,H.jsx)(rp,{title:`默认角色`,description:`决定写文档时使用的模板与「负责范围」;不影响可录入的仓库数量`,children:(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:qi.map(e=>{let n=r===e;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>t(t=>{t.profile.role=e}),className:V(`group relative flex flex-col gap-2 rounded-xl border p-4 text-left transition-all`,n?`border-primary/60 bg-primary/5 shadow-sm ring-1 ring-primary/20`:`hover:border-border hover:bg-accent/40`),children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:Yi[e]}),(0,H.jsx)(`span`,{className:V(`flex size-4 items-center justify-center rounded-full border transition`,n?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/30`),children:n?(0,H.jsx)(le,{className:`size-2.5`}):null})]}),(0,H.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:Xi[e]})]},e)})})})]})}function pp(){let{draft:e,mutate:t,snapshot:n}=oa(),r=e?.docs.root??``,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),c=async()=>{if(r.trim().length!==0){a(!0);try{s(await G.inspect(r.trim()))}finally{a(!1)}}},l=n?.issues.find(e=>e.where===`docs.root`&&e.level===`error`);return(0,H.jsx)(H.Fragment,{children:(0,H.jsxs)(rp,{title:`文档仓库路径`,description:`迭代任务文档仓库的绝对路径,需包含 skills/iteration-task-docs/`,actions:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,onClick:()=>void c(),disabled:i||r.length===0,children:[i?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(Ve,{className:`size-3.5`}),`检查路径`]}),children:[(0,H.jsx)(ip,{label:`docs.root`,htmlFor:`docs-root`,error:l?.message,children:(0,H.jsx)(Ni,{id:`docs-root`,value:r,placeholder:`/Users/you/develop/iteration-task-repo`,spellCheck:!1,autoComplete:`off`,className:`font-mono text-xs`,onChange:e=>t(t=>{t.docs.root=e.target.value.trim(),s(null)})})}),o===null?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,H.jsx)(op,{ok:o.exists,text:o.exists?`路径存在`:`路径不存在`}),(0,H.jsx)(op,{ok:o.isGit,text:o.isGit?`git 仓库`:`非 git 仓库`}),o.hasDocsSkill===void 0?null:(0,H.jsx)(op,{ok:o.hasDocsSkill,text:o.hasDocsSkill?`含 iteration-task-docs`:`缺少 iteration-task-docs`})]}),(0,H.jsx)(cp,{children:`该路径只存于本机配置,不写进业务仓库。修改后点击右上角「保存」,再回到概览确认校验结果。`})]})})}function mp(e,t){return{name:e,aliasesText:t.aliases.join(`, `),frontend:[...t.repos.frontend],backend:[...t.repos.backend]}}function hp(e){return e.split(/[,,;;]/).map(e=>e.trim()).filter(e=>e.length>0)}function gp({side:e,path:t,status:n,onChange:r,onRemove:i}){return(0,H.jsxs)(`div`,{className:`group flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-10 shrink-0 text-[11px] text-muted-foreground`,children:Ji[e]}),(0,H.jsx)(Ni,{value:t,spellCheck:!1,autoComplete:`off`,placeholder:`/Users/you/develop/.../repo`,className:`font-mono text-xs`,onChange:e=>r(e.target.value)}),n===void 0?null:n.exists?(0,H.jsx)(I,{className:V(`size-4 shrink-0`,n.isGit?`text-success`:`text-warning`)}):(0,H.jsx)(Ce,{className:`size-4 shrink-0 text-destructive`}),(0,H.jsx)(U,{variant:`ghost`,size:`icon`,className:`shrink-0`,onClick:i,children:(0,H.jsx)(zt,{className:`size-3.5 text-muted-foreground`})})]})}function _p({open:e,initial:t,existingNames:n,onOpenChange:r,onSubmit:i}){let[a,o]=(0,v.useState)(t??{name:``,aliasesText:``,frontend:[],backend:[]}),[s,c]=(0,v.useState)(null);(0,v.useEffect)(()=>{e&&(o(t??{name:``,aliasesText:``,frontend:[],backend:[]}),c(null))},[e,t]);let l=t?.name??null,u=n.filter(e=>e!==l),d=(e,t,n)=>{o(r=>{let i={...r,[e]:[...r[e]]};return i[e][t]=n,i})},f=(e,t)=>{o(n=>({...n,[e]:n[e].filter((e,n)=>n!==t)}))};return(0,H.jsx)(Hf,{open:e,onOpenChange:r,children:(0,H.jsxs)(Uf,{children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:t===null?`新增终端`:`编辑「${t.name}」`}),(0,H.jsx)(Gf,{children:`终端名取自 PRD 中的写法,可含中文;每端可配置多个仓库。`})]}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(ip,{label:`终端名`,htmlFor:`terminal-name`,hint:`例如:业务运营平台-IEP、AI学习机`,children:(0,H.jsx)(Ni,{id:`terminal-name`,value:a.name,placeholder:`示例终端-A`,onChange:e=>{o(t=>({...t,name:e.target.value})),c(null)}})}),(0,H.jsx)(ip,{label:`别名`,htmlFor:`terminal-alias`,hint:`同一终端的其它写法,逗号分隔;空格/全角/大小写差异无需别名`,children:(0,H.jsx)(Ni,{id:`terminal-alias`,value:a.aliasesText,placeholder:`别名1, 别名2`,onChange:e=>o(t=>({...t,aliasesText:e.target.value}))})}),Ki.map(e=>(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`span`,{className:`text-sm font-medium`,children:[Ji[e],`仓库`]}),(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,className:`h-7 gap-1 text-xs`,onClick:()=>o(t=>({...t,[e]:[...t[e],``]})),children:[(0,H.jsx)(ht,{className:`size-3`}),`添加`]})]}),a[e].length===0?(0,H.jsxs)(`p`,{className:`rounded-md border border-dashed px-3 py-2.5 text-xs text-muted-foreground`,children:[`未配置`,Ji[e],`仓库`]}):(0,H.jsx)(`div`,{className:`space-y-2`,children:a[e].map((t,n)=>(0,H.jsx)(gp,{side:e,path:t,status:void 0,onChange:t=>d(e,n,t),onRemove:()=>f(e,n)},`${e}-${n}`))})]},e)),s===null?null:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/8 px-3 py-2 text-xs text-destructive`,children:[(0,H.jsx)(Vt,{className:`size-3.5`}),s]})]}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>r(!1),children:`取消`}),(0,H.jsx)(U,{size:`sm`,onClick:()=>{let e=a.name.trim();if(e.length===0)return c(`终端名不能为空`);if(e.includes(`.`))return c(`终端名不能包含「.」`);if(u.includes(e))return c(`终端名已存在`);let t=a.frontend.map(e=>e.trim()).filter(e=>e.length>0),n=a.backend.map(e=>e.trim()).filter(e=>e.length>0);for(let e of[...t,...n])if(!e.startsWith(`/`))return c(`仓库路径必须是绝对路径:${e}`);if(new Set(t).size!==t.length)return c(`前端仓库存在重复路径`);if(new Set(n).size!==n.length)return c(`后端仓库存在重复路径`);i({name:e,aliasesText:a.aliasesText,frontend:t,backend:n},l),r(!1)},children:t===null?`添加`:`保存修改`})]})]})})}function vp(){let{draft:e,mutate:t,snapshot:n}=oa(),[r,i]=(0,v.useState)(()=>new URLSearchParams(window.location.search).get(`q`)??``),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)({}),h=e?.terminals??{},g=(0,v.useMemo)(()=>Object.keys(h).sort((e,t)=>e.localeCompare(t,`zh-CN`)),[h]);(0,v.useEffect)(()=>{let e=r.trim();if(e.length===0){o(null);return}let t=!1,n=setTimeout(()=>{G.resolve(e).then(e=>{t||o(e)}).catch(()=>{t||o(null)})},250);return()=>{t=!0,clearTimeout(n)}},[r]);let _=r.trim(),y=_.length===0?g:a?.matched===!0&&a.terminal!==null?g.filter(e=>e===a.terminal):g.filter(e=>e.toLowerCase().includes(_.toLowerCase())),b=(0,v.useMemo)(()=>g.flatMap(e=>Ki.flatMap(t=>h[e]?.repos[t]??[])),[g,h]),x=b.join(`\0`);(0,v.useEffect)(()=>{if(b.length===0){m({});return}let e=!1;return Promise.all(b.map(e=>G.inspect(e).then(t=>[e,t]))).then(t=>{e||m(Object.fromEntries(t))}).catch(()=>void 0),()=>{e=!0}},[x]);let S=(e,n)=>{t(t=>{n!==null&&n!==e.name&&delete t.terminals[n],t.terminals[e.name]={aliases:hp(e.aliasesText),repos:{frontend:e.frontend,backend:e.backend}}})},C=e=>{t(t=>{delete t.terminals[e]}),f(null)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(rp,{title:`PRD终端-本地仓库映射表`,description:`终端名用 PRD 中的写法;一端多个仓库时,解析会要求显式选择`,actions:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative hidden sm:block`,children:[(0,H.jsx)(Tt,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(Ni,{value:r,placeholder:`搜索终端`,className:`h-8 w-44 pl-8 text-xs`,onChange:e=>i(e.target.value)})]}),(0,H.jsxs)(U,{size:`sm`,onClick:()=>{u(null),c(!0)},children:[(0,H.jsx)(ht,{className:`size-3.5`}),`新增终端`]})]}),children:[_.length===0?null:(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-lg border bg-muted/40 px-3 py-2 text-[11px]`,children:a===null?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`解析中…`}):a.matched?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(W,{variant:`success`,children:`命中`}),(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[a.matchedBy===null?``:Zi[a.matchedBy],` →`]}),(0,H.jsx)(`span`,{className:`font-medium`,children:a.terminal}),[...a.repos.frontend,...a.repos.backend].length>1?(0,H.jsx)(W,{variant:`warning`,children:`多仓库,Agent 会先询问`}):null]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`未命中,候选(需人工确认):`}),a.candidates.length===0?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`无`}):a.candidates.map(e=>(0,H.jsx)(`button`,{type:`button`,className:`rounded border bg-background px-2 py-0.5 transition-colors hover:bg-accent`,onClick:()=>i(e),children:e},e))]})}),g.length===0?(0,H.jsx)(sp,{icon:(0,H.jsx)(lt,{className:`size-5`}),title:`还没有配置终端`,description:`添加一个终端,把 PRD 里的写法映射到本地仓库;支持中文名与多个仓库。`,action:(0,H.jsxs)(U,{size:`sm`,onClick:()=>{u(null),c(!0)},children:[(0,H.jsx)(ht,{className:`size-3.5`}),`新增终端`]})}):y.length===0?(0,H.jsxs)(`p`,{className:`rounded-lg border border-dashed px-4 py-8 text-center text-xs text-muted-foreground`,children:[`没有匹配「`,r,`」的终端`]}):(0,H.jsx)(`div`,{className:`space-y-3`,children:y.map(e=>{let t=h[e];return t===void 0?null:(0,H.jsx)(ji,{className:`gap-3 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 space-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:e}),t.aliases.length===0?(0,H.jsx)(W,{variant:`muted`,children:`无别名`}):t.aliases.map(e=>(0,H.jsx)(W,{variant:`secondary`,children:e},e))]}),(0,H.jsx)(`p`,{className:`font-mono text-[11px] text-muted-foreground`,children:Ki.map(e=>`${Ji[e]} ${t.repos[e].length}`).join(` · `)})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,H.jsx)(U,{variant:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>{u(mp(e,t)),c(!0)},children:`编辑`}),(0,H.jsx)(U,{variant:`ghost`,size:`icon`,onClick:()=>f(e),children:(0,H.jsx)(zt,{className:`size-3.5 text-muted-foreground`})})]})]}),(0,H.jsx)(`div`,{className:`space-y-1.5`,children:Ki.map(e=>{let n=t.repos[e];return n.length===0?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`w-10`,children:Ji[e]}),(0,H.jsx)(`span`,{className:`rounded border border-dashed px-2 py-0.5`,children:`未配置`})]},e):n.map(t=>{let n=p[t];return(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-10 shrink-0 text-[11px] text-muted-foreground`,children:Ji[e]}),(0,H.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded bg-muted/60 px-2 py-1 font-mono text-[11px]`,children:t}),n===void 0?null:n.exists?(0,H.jsx)(W,{variant:n.isGit?`success`:`warning`,children:n.isGit?`存在`:`非 git`}):(0,H.jsx)(W,{variant:`destructive`,children:`不存在`})]},`${e}-${t}`)})})})]})},e)})}),n!==null&&n.issues.some(e=>e.where?.startsWith(`terminals`))?(0,H.jsx)(cp,{children:`终端相关的问题会显示在「概览 → 校验结果」中;保存后即可看到最新结果。`}):null]}),(0,H.jsx)(_p,{open:s,initial:l,existingNames:g,onOpenChange:c,onSubmit:S}),(0,H.jsx)(Hf,{open:d!==null,onOpenChange:e=>e?void 0:f(null),children:(0,H.jsxs)(Uf,{className:`max-w-md`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:`删除终端`}),(0,H.jsxs)(Gf,{children:[`确认删除「`,d,`」?该操作会在保存后写入配置文件。`]})]}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>f(null),children:`取消`}),(0,H.jsx)(U,{variant:`destructive`,size:`sm`,onClick:()=>d!==null&&C(d),children:`删除`})]})]})})]})}function yp(e){return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}function bp(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function xp(){let{snapshot:e,restore:t,saving:n}=oa(),[r,i]=(0,v.useState)(null),a=e?.backups??[];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(rp,{title:`配置备份`,description:`每次保存前自动备份,最多保留 10 份;回滚会先备份当前文件`,actions:(0,H.jsxs)(W,{variant:`muted`,children:[a.length,` 份`]}),children:[a.length===0?(0,H.jsx)(sp,{icon:(0,H.jsx)(yt,{className:`size-5`}),title:`暂无备份`,description:`第一次保存配置后,这里会出现历史版本,可用于对比与回滚。`}):(0,H.jsx)(`div`,{className:`space-y-2`,children:a.map((e,t)=>(0,H.jsx)(ji,{className:`gap-0 py-3`,children:(0,H.jsxs)(Mi,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs font-medium`,children:yp(e.mtime)}),t===0?(0,H.jsx)(W,{variant:`secondary`,children:`最新`}):null]}),(0,H.jsxs)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,title:e.name,children:[e.name,` · `,bp(e.size)]})]}),(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`shrink-0 gap-1.5 text-xs`,onClick:()=>i(e.name),children:[(0,H.jsx)(xt,{className:`size-3`}),`回滚`]})]})},e.name))}),(0,H.jsx)(cp,{children:`回滚会覆盖当前配置文件。若当前存在未保存的修改,回滚后这些修改会被丢弃。`})]}),(0,H.jsx)(Hf,{open:r!==null,onOpenChange:e=>e?void 0:i(null),children:(0,H.jsxs)(Uf,{className:`max-w-md`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:`回滚到该备份`}),(0,H.jsxs)(Gf,{children:[`将用 `,(0,H.jsx)(`code`,{className:`font-mono text-[11px]`,children:r}),` 覆盖当前配置,系统会先把当前文件再备份一次。`]})]}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>i(null),children:`取消`}),(0,H.jsxs)(U,{size:`sm`,disabled:n,onClick:()=>{if(r===null)return;let e=r;i(null),t(e)},children:[n?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(xt,{className:`size-3.5`}),`确认回滚`]})]})]})})]})}var Sp={profile:`profile`,docs:`docs`,terminals:`terminals`,backups:`backups`};function Cp(){let[e,t]=window.location.hash.replace(`#`,``).split(`?`);return new URLSearchParams(t??``).get(`tab`)??Sp[e??``]??`about`}function wp(){let{snapshot:e,draft:t,mutate:n}=oa(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),s=e?.issues.filter(e=>e.level===`error`).length??0,c=e?.issues.filter(e=>e.level===`warning`).length??0,[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(()=>Cp());(0,v.useEffect)(()=>{let e=()=>m(Cp());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let h=e=>{m(e);let t=new URL(window.location.href);t.hash=`settings?tab=${e}`,window.history.replaceState(null,``,t)},g=[{id:`profile`,label:`身份`,icon:Gt},{id:`docs`,label:`文档仓库`,icon:Le},{id:`terminals`,label:`PRD终端映射`,icon:lt},{id:`backups`,label:`备份`,icon:yt},{id:`about`,label:`关于`,icon:Ye}],_=async()=>{f(!0);try{u(await G.updateCheck(!0))}catch(t){u({current:e?.meta.version??``,latest:null,hasUpdate:!1,downloadUrl:null,source:`none`,checkedAt:new Date().toISOString(),error:t instanceof Error?t.message:String(t)})}finally{f(!1)}};(0,v.useEffect)(()=>{G.updateCheck(!1).then(u).catch(()=>void 0)},[]);let y=async()=>{o(!0);try{await G.reset(!0),window.location.reload()}finally{o(!1),i(!1)}},b=()=>{if(t===null)return;let e=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=`ylcwf-config.json`,r.click(),URL.revokeObjectURL(n)},x=(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 rounded-lg border p-1`,children:g.map(e=>{let t=e.icon;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>h(e.id),className:p===e.id?`flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium`:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,H.jsx)(t,{className:`size-3.5`}),e.label]},e.id)})});return(0,H.jsxs)(H.Fragment,{children:[x,p===`profile`?(0,H.jsx)(fp,{}):null,p===`docs`?(0,H.jsx)(pp,{}):null,p===`terminals`?(0,H.jsx)(vp,{}):null,p===`backups`?(0,H.jsx)(xp,{}):null,p===`about`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rp,{title:`配置文件`,description:`CLI 与桌面端共享配置`,children:(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`路径`}),e===null?null:s>0?(0,H.jsxs)(W,{variant:`destructive`,children:[s,` 项 error`]}):c>0?(0,H.jsxs)(W,{variant:`warning`,children:[c,` 项 warning`]}):(0,H.jsx)(W,{variant:`success`,children:`配置健康`})]}),(0,H.jsx)(`p`,{className:`truncate font-mono text-xs`,title:e?.configPath,children:e?.configPath??`—`})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 gap-1.5`,children:[(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`gap-1.5 text-xs`,onClick:()=>{G.revealConfig()},children:[(0,H.jsx)(ze,{className:`size-3.5`}),`打开目录`]}),(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`gap-1.5 text-xs`,onClick:b,children:[(0,H.jsx)(je,{className:`size-3.5`}),`导出 JSON`]})]})]}),(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,H.jsxs)(`div`,{className:`rounded-lg border px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`应用版本`}),(0,H.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`span`,{className:`font-mono text-sm`,children:[`v`,e?.meta.version??`—`]}),l?.hasUpdate===!0?(0,H.jsxs)(W,{variant:`warning`,children:[`有新版 v`,l.latest]}):l!==null&&l.error===null&&l.latest!==null?(0,H.jsx)(W,{variant:`success`,children:`已是最新`}):null,(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-[11px]`,disabled:d===!0,onClick:()=>void _(),children:[d===!0?(0,H.jsx)(rt,{className:`size-3 animate-spin`}):null,`检查更新`]})]}),l?.error===null||l===null?null:(0,H.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:l.error}),l?.hasUpdate===!0?l.downloadUrl===null?G.mode===`electron`?(0,H.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:[`v`,l.latest,` 的安装包请到 GitLab 仓库`,` `,(0,H.jsx)(`span`,{className:`font-mono`,children:`zhanyoulin/ylcwf`}),` 的`,` `,(0,H.jsx)(`span`,{className:`font-mono`,children:`release`}),` 目录下载`]}):(0,H.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:[`当前界面由本地 CLI 提供,升级 CLI 后刷新即可:`,(0,H.jsx)(`code`,{className:`mx-1 rounded bg-muted px-1 py-0.5 font-mono`,children:`ylcwf upgrade`})]}):(0,H.jsxs)(`button`,{type:`button`,onClick:()=>window.open(l.downloadUrl??``,`_blank`),className:`mt-1 text-[11px] text-primary underline-offset-2 hover:underline`,children:[`下载 v`,l.latest]}):null]}),(0,H.jsxs)(`div`,{className:`rounded-lg border px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`运行模式`}),(0,H.jsx)(`p`,{className:`mt-1 text-sm`,children:G.mode===`electron`?`桌面端`:`本地浏览器`})]})]}),(0,H.jsx)(cp,{children:`「打开目录」会调用系统文件管理器;浏览器模式同样可用(由本地服务执行)。系统目录选择器仅桌面端提供,浏览器模式使用内置目录浏览器。`})]})}),(0,H.jsx)(rp,{title:`快捷键`,description:`常用操作`,children:(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg bg-muted/40 px-4 py-2.5`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(Ze,{className:`size-3.5`}),`保存配置`]}),(0,H.jsxs)(`div`,{className:`flex gap-1`,children:[(0,H.jsx)(Li,{children:`⌘`}),(0,H.jsx)(Li,{children:`S`})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg bg-muted/40 px-4 py-2.5`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(Ye,{className:`size-3.5`}),`未保存修改时关闭窗口会提示确认`]}),(0,H.jsx)(W,{variant:`muted`,children:`自动`})]}),(0,H.jsxs)(`div`,{className:`rounded-lg border px-4 py-3`,children:[(0,H.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`状态变更后的 git 行为(`,(0,H.jsx)(`span`,{className:`font-medium`,children:`仅作用于文档仓库,不影响业务代码仓库`}),`)`]}),(0,H.jsx)(`div`,{className:`mt-2 grid gap-3 sm:grid-cols-2`,children:[`cli`,`ui`].map(e=>{let r=t?.docs.git?.[e]??{commit:!0,push:!1};return(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`p`,{className:`text-xs font-medium`,children:e===`cli`?`CLI / Agent 调用`:`界面操作`}),(0,H.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`size-3.5 accent-primary`,checked:r.commit,onChange:t=>n(n=>{n.docs.git[e].commit=t.target.checked,t.target.checked||(n.docs.git[e].push=!1)})}),`自动提交`]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`size-3.5 accent-primary`,checked:r.push,disabled:!r.commit,onChange:t=>n(n=>{n.docs.git[e].push=t.target.checked,t.target.checked&&(n.docs.git[e].commit=!0)})}),`提交后推送`]})]},e)})})]})]})}),(0,H.jsx)(rp,{title:`清除配置`,description:`删除本机配置与备份,下次启动会重新进入首次引导`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-destructive/25 bg-destructive/5 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:`从零重新开始`}),(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`将删除 ~/.ylcwf/config.yaml 与 backups/ 下的全部内容,不可撤销。`})]}),(0,H.jsxs)(U,{variant:`destructive`,size:`sm`,className:`shrink-0 gap-1.5`,onClick:()=>i(!0),children:[(0,H.jsx)(zt,{className:`size-3.5`}),`清除配置`]})]})}),(0,H.jsxs)(rp,{title:`命令行`,description:`桌面端写入的配置,CLI 立即可见`,children:[(0,H.jsxs)(`div`,{className:`space-y-2 rounded-lg bg-muted/40 p-4 font-mono text-[11px] leading-relaxed text-muted-foreground`,children:[(0,H.jsx)(`p`,{children:`ylcwf show # 查看配置`}),(0,H.jsx)(`p`,{children:`ylcwf doctor # 校验配置`}),(0,H.jsx)(`p`,{children:`ylcwf resolve 示例终端-A --side frontend --field path`}),(0,H.jsx)(`p`,{children:`ylcwf terminal repo add 示例终端-A --side backend --path /path/to/repo`})]}),(0,H.jsxs)(cp,{children:[`Agent 约定:只读配置,不自行修改;遇到多仓库歧义或未命中时必须询问开发者。`,(0,H.jsxs)(`a`,{className:`ml-1 inline-flex items-center gap-0.5 underline underline-offset-2`,href:`https://www.npmjs.com/package/ylcwf`,target:`_blank`,rel:`noreferrer`,children:[`npm`,(0,H.jsx)(Ne,{className:`size-3`})]})]})]}),(0,H.jsx)(Hf,{open:r,onOpenChange:e=>e?void 0:i(!1),children:(0,H.jsxs)(Uf,{className:`max-w-md`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{children:`确认清除配置`}),(0,H.jsx)(Gf,{children:`将删除配置文件与历史备份,并回到首次引导。此操作不可撤销。`})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3.5 py-2.5 text-xs text-warning`,children:[(0,H.jsx)(Vt,{className:`mt-0.5 size-3.5 shrink-0`}),`如果你的配置是由管理员分发的,清除后需要重新走接入流程。`]}),(0,H.jsxs)(Kf,{children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>i(!1),children:`取消`}),(0,H.jsx)(U,{variant:`destructive`,size:`sm`,disabled:a,onClick:()=>void y(),children:`确认清除`})]})]})})]}):null]})}function Tp(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ep=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Op={};function kp(e,t){return((t||Op).jsx?Dp:Ep).test(e)}var Ap=/[ \t\n\f\r]/g;function jp(e){return typeof e==`object`?e.type===`text`&&Mp(e.value):Mp(e)}function Mp(e){return e.replace(Ap,``)===``}var Np=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Np.prototype.normal={},Np.prototype.property={},Np.prototype.space=void 0;function Pp(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Np(n,r,t)}function Fp(e){return e.toLowerCase()}var Ip=class{constructor(e,t){this.attribute=t,this.property=e}};Ip.prototype.attribute=``,Ip.prototype.booleanish=!1,Ip.prototype.boolean=!1,Ip.prototype.commaOrSpaceSeparated=!1,Ip.prototype.commaSeparated=!1,Ip.prototype.defined=!1,Ip.prototype.mustUseProperty=!1,Ip.prototype.number=!1,Ip.prototype.overloadedBoolean=!1,Ip.prototype.property=``,Ip.prototype.spaceSeparated=!1,Ip.prototype.space=void 0;var Lp=s({boolean:()=>X,booleanish:()=>zp,commaOrSpaceSeparated:()=>Up,commaSeparated:()=>Hp,number:()=>Z,overloadedBoolean:()=>Bp,spaceSeparated:()=>Vp}),Rp=0,X=Wp(),zp=Wp(),Bp=Wp(),Z=Wp(),Vp=Wp(),Hp=Wp(),Up=Wp();function Wp(){return 2**++Rp}var Gp=Object.keys(Lp),Kp=class extends Ip{constructor(e,t,n,r){let i=-1;if(super(e,t),qp(this,`space`,r),typeof n==`number`)for(;++i<Gp.length;){let e=Gp[i];qp(this,Gp[i],(n&Lp[e])===Lp[e])}}};Kp.prototype.defined=!0;function qp(e,t,n){n&&(e[t]=n)}function Jp(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Kp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Fp(r)]=r,n[Fp(a.attribute)]=r}return new Np(t,n,e.space)}var Yp=Jp({properties:{ariaActiveDescendant:null,ariaAtomic:zp,ariaAutoComplete:null,ariaBusy:zp,ariaChecked:zp,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:Vp,ariaCurrent:null,ariaDescribedBy:Vp,ariaDetails:null,ariaDisabled:zp,ariaDropEffect:Vp,ariaErrorMessage:null,ariaExpanded:zp,ariaFlowTo:Vp,ariaGrabbed:zp,ariaHasPopup:null,ariaHidden:zp,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vp,ariaLevel:Z,ariaLive:null,ariaModal:zp,ariaMultiLine:zp,ariaMultiSelectable:zp,ariaOrientation:null,ariaOwns:Vp,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:zp,ariaReadOnly:zp,ariaRelevant:null,ariaRequired:zp,ariaRoleDescription:Vp,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:zp,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Xp(e,t){return t in e?e[t]:t}function Zp(e,t){return Xp(e,t.toLowerCase())}var Qp=Jp({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Hp,acceptCharset:Vp,accessKey:Vp,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:Vp,autoFocus:X,autoPlay:X,blocking:Vp,capture:null,charSet:null,checked:X,cite:null,className:Vp,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:zp,controls:X,controlsList:Vp,coords:Z|Hp,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:Bp,draggable:zp,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:Vp,height:Z,hidden:Bp,high:Z,href:null,hrefLang:null,htmlFor:Vp,httpEquiv:Vp,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:Vp,itemRef:Vp,itemScope:X,itemType:Vp,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:X,optimum:Z,pattern:null,ping:Vp,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:Vp,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:Vp,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootCustomElementRegistry:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shadowRootSerializable:X,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:zp,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:zp,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vp,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:zp,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:X,disablePictureInPicture:X,disableRemotePlayback:X,exportParts:Hp,part:Vp,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:Zp}),$p=Jp({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Up,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:Vp,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Hp,g2:Hp,glyphName:Hp,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:Up,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vp,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Up,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Up,rev:Up,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Up,requiredFeatures:Up,requiredFonts:Up,requiredFormats:Up,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:Up,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Up,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Up,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Xp}),em=Jp({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),tm=Jp({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Zp}),nm=Jp({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),rm={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},im=/[A-Z]/g,am=/-[a-z]/g,om=/^data[-\w.:]+$/i;function sm(e,t){let n=Fp(t),r=t,i=Ip;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&om.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(am,lm);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!am.test(e)){let n=e.replace(im,cm);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Kp}return new i(r,t)}function cm(e){return`-`+e.toLowerCase()}function lm(e){return e.charAt(1).toUpperCase()}var um=Pp([Yp,Qp,em,tm,nm],`html`),dm=Pp([Yp,$p,em,tm,nm],`svg`);function fm(e){return e.join(` `).trim()}var pm=/\/\*(?:[^*]|\*(?!\/))*\*\//g,mm=/\n/g,hm=/^\s*/,gm=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,_m=/^:\s*/,vm=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,ym=/^[;\s]*/,bm=`
50
50
  `,xm=`/`,Sm=`*`,Cm=``,wm=`comment`,Tm=`declaration`;function Em(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(mm);t&&(n+=t.length);var i=e.lastIndexOf(bm);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(hm)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(xm==e.charAt(0)&&Sm==e.charAt(1)){for(var n=2;Cm!=e.charAt(n)&&(Sm!=e.charAt(n)||xm!=e.charAt(n+1));)++n;if(n+=2,Cm===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:wm,comment:o})}}function f(){var e=a(),t=c(gm);if(t){if(d(),!c(_m))return s(`property missing ':'`);var n=c(vm),r=e({type:Tm,property:t[0].replace(pm,Cm).trim(),value:n?n[0].replace(pm,Cm).trim():Cm});return c(ym),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function Dm(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Em(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var Om=Am(`end`),km=Am(`start`);function Am(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function jm(e){let t=km(e),n=Om(e);if(t&&n)return{start:t,end:n}}function Mm(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Pm(e.position):`start`in e||`end`in e?Pm(e):`line`in e||`column`in e?Nm(e):``}function Nm(e){return Fm(e&&e.line)+`:`+Fm(e&&e.column)}function Pm(e){return Nm(e&&e.start)+`-`+Nm(e&&e.end)}function Fm(e){return e&&typeof e==`number`?e:1}var Im=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Mm(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(Im.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var Lm={}.hasOwnProperty,Rm=new Map,zm=/[A-Z]/g,Bm=/-([a-z])/g,Vm=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Hm=new Set([`td`,`th`]),Um=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Wm(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=th(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=eh(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?dm:um,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Gm(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Gm(e,t,n){if(t.type===`element`)return Km(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return qm(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ym(e,t,n);if(t.type===`mdxjsEsm`)return Jm(e,t);if(t.type===`root`)return Xm(e,t,n);if(t.type===`text`)return Zm(e,t)}function Km(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=dm,e.schema=i),e.ancestors.push(t);let a=sh(e,t.tagName,!1),o=nh(e,t),s=ih(e,t);return Vm.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!jp(e)})),Qm(e,o,a,t),$m(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qm(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ch(e,t.position)}function Jm(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ch(e,t.position)}function Ym(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=dm,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:sh(e,t.name,!0),o=rh(e,t),s=ih(e,t);return Qm(e,o,a,t),$m(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Xm(e,t,n){let r={};return $m(r,ih(e,t)),e.create(t,e.Fragment,r,n)}function Zm(e,t){return t.value}function Qm(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $m(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function eh(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function th(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=km(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function nh(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Lm.call(t.properties,i)){let a=ah(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Hm.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function rh(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ch(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else ch(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function ih(e,t){let n=[],r=-1,i=e.passKeys?new Map:Rm;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Gm(e,a,o);s!==void 0&&n.push(s)}return n}function ah(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=sm(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?Tp(n):fm(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:lh(n):oh(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?rm[r.property]||r.property:r.attribute,n]}function oh(e,t){let n={};try{Dm(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(Bm,fh))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Im("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Um+`#cannot-parse-style-attribute`,r}return n}function sh(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=kp(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=kp(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Lm.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);ch(e)}function ch(e,t){let n=new Im("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Um+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function lh(e){let t={},n;for(n in e)Lm.call(e,n)&&(t[uh(n)]=e[n]);return t}function uh(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(zm,dh);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function dh(e){return`-`+e.toLowerCase()}function fh(e,t){return t.toUpperCase()}var ph={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},mh={};function hh(e,t){let n=t||mh;return gh(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function gh(e,t,n){if(vh(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return _h(e.children,t,n)}return Array.isArray(e)?_h(e,t,n):``}function _h(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=gh(e[i],t,n);return r.join(``)}function vh(e){return!!(e&&typeof e==`object`)}var yh=document.createElement(`i`);function bh(e){let t=`&`+e+`;`;yh.innerHTML=t;let n=yh.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function xh(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Sh(e,t){return e.length>0?(xh(e,e.length,0,t),e):t}var Ch={}.hasOwnProperty;function wh(e){let t={},n=-1;for(;++n<e.length;)Th(t,e[n]);return t}function Th(e,t){let n;for(n in t){let r=(Ch.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ch.call(r,a)||(r[a]=[]);let e=i[a];Eh(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Eh(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);xh(e,0,0,r)}function Dh(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Oh(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var kh=zh(/[A-Za-z]/),Ah=zh(/[\dA-Za-z]/),jh=zh(/[#-'*+\--9=?A-Z^-~]/);function Mh(e){return e!==null&&(e<32||e===127)}var Nh=zh(/\d/),Ph=zh(/[\dA-Fa-f]/),Fh=zh(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function Ih(e){return e!==null&&(e<0||e===32)}function $(e){return e===-2||e===-1||e===32}var Lh=zh(/\p{P}|\p{S}/u),Rh=zh(/\s/);function zh(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Bh(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Ah(e.charCodeAt(n+1))&&Ah(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Vh(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $(r)?(e.enter(n),s(r)):t(r)}function s(r){return $(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Hh(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&$(t)?(e.enter(r),c(t)):l(t)}function c(t){return $(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Uh={tokenize:Wh};function Wh(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Vh(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Gh=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Kh(this,e,t,n,!1)}addBefore(e,t,n){Kh(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Kh(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var qh={tokenize:Yh},Jh={tokenize:Xh};function Yh(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Gh;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Jh,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Jh,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return Q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Gh;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Xh(e,t,n){return Vh(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Zh(e){if(e===null||Ih(e)||Rh(e))return 1;if(Lh(e))return 2}function Qh(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var $h={name:`attention`,resolveAll:eg,tokenize:tg};function eg(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};ng(o,-a),ng(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Sh(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Sh(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Sh(r,Qh(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Sh(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=Sh(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),xh(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function tg(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Zh(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Zh(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ng(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var rg={name:`autolink`,tokenize:ig};function ig(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return kh(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Ah(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Ah(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Mh(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):jh(t)?(e.consume(t),l):n(t)}function u(e){return Ah(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Ah(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ag={partial:!0,tokenize:og};function og(e,t,n){return r;function r(t){return $(t)?Vh(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var sg={continuation:{tokenize:lg},exit:ug,name:`blockQuote`,tokenize:cg};function cg(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return $(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function lg(e,t,n){let r=this;return i;function i(t){return $(t)?Vh(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(sg,t,n)(r)}}function ug(e){e.exit(`blockQuote`)}var dg={name:`characterEscape`,tokenize:fg};function fg(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Fh(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var pg={name:`characterReference`,tokenize:mg};function mg(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Ah,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Ph,u):(e.enter(`characterReferenceValue`),a=7,o=Nh,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Ah&&!bh(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var hg={partial:!0,tokenize:gg};function gg(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var _g={concrete:!0,name:`codeFenced`,tokenize:vg};function vg(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),$(t)?Vh(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(hg,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Vh(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&$(t)?Vh(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(hg,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),$(t)?Vh(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),$(t)?Vh(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var yg={name:`codeIndented`,tokenize:xg},bg={partial:!0,tokenize:Sg};function xg(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Hh(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Q(t)?e.attempt(bg,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Sg(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Hh(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Q(e)?i(e):n(e)}}var Cg={name:`codeText`,previous:Tg,resolve:wg,tokenize:Eg};function wg(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Tg(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Eg(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Dg=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Og(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Og(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Og(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Og(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Og(this.left,t.reverse())}}}};function Og(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function kg(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Dg(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ag(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return xh(e,0,1/0,u.slice(0)),!l}function Ag(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var jg={resolve:Ng,tokenize:Pg},Mg={partial:!0,tokenize:Fg};function Ng(e){return kg(e),e}function Pg(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Q(t)?e.check(Mg,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Fg(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Vh(e,a,`linePrefix`)}function a(i){if(i===null||Q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ig(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Mh(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Ih(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Mh(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Lg(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Rg(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Vh(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function zg(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$(i)?Vh(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Bg={name:`definition`,tokenize:Hg},Vg={partial:!0,tokenize:Ug};function Hg(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Lg.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Oh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Ih(t)?zg(e,l)(t):l(t)}function l(t){return Ig(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Vg,d,d)(t)}function d(t){return $(t)?Vh(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ug(e,t,n){return r;function r(t){return Ih(t)?zg(e,i)(t):n(t)}function i(t){return Rg(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $(t)?Vh(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var Wg={name:`hardBreakEscape`,tokenize:Gg};function Gg(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Kg={name:`headingAtx`,resolve:qg,tokenize:Jg};function qg(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};xh(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Jg(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Ih(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):$(n)?Vh(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Ih(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Yg=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Xg=[`pre`,`script`,`style`,`textarea`],Zg={concrete:!0,name:`htmlFlow`,resolveTo:$g,tokenize:e_},Qg={partial:!0,tokenize:t_};function $g(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function e_(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):kh(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):kh(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return kh(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Ih(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Xg.includes(l)?(i=1,r.interrupt?t(s):O(s)):Yg.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Ah(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return $(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||kh(t)?(e.consume(t),b):$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Ah(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Ih(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Q(t)?O(t):$(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Qg,ne,k)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(hg,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return Xg.includes(n)?(e.consume(t),te):O(t)}return kh(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),F):O(t)}function te(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function t_(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ag,t,n)}}var n_={name:`htmlText`,tokenize:r_};function r_(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):kh(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):kh(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Q(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Q(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Q(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return kh(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Ah(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,N(t)):$(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Ah(t)?(e.consume(t),w):t===47||t===62||Ih(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||kh(t)?(e.consume(t),E):Q(t)?(o=T,N(t)):$(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Ah(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Q(t)?(o=D,N(t)):$(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Q(t)?(o=O,N(t)):$(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Q(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Ih(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Ih(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return $(t)?Vh(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}var i_={name:`labelEnd`,resolveAll:c_,resolveTo:l_,tokenize:u_},a_={tokenize:d_},o_={tokenize:f_},s_={tokenize:p_};function c_(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&xh(e,0,e.length,n),e}function l_(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=Sh(o,e.slice(i+1,i+r+3)),o=Sh(o,[[`enter`,l,t]]),o=Sh(o,Qh(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Sh(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Sh(o,e.slice(a+1)),o=Sh(o,[[`exit`,s,t]]),xh(e,i,e.length,o),e}function u_(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Oh(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(a_,u,o?u:d)(t):t===91?e.attempt(o_,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(s_,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function d_(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Ih(t)?zg(e,a)(t):a(t)}function a(t){return t===41?u(t):Ig(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Ih(t)?zg(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Rg(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Ih(t)?zg(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function f_(e,t,n){let r=this;return i;function i(t){return Lg.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Oh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function p_(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var m_={name:`labelStartImage`,resolveAll:i_.resolveAll,tokenize:h_};function h_(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var g_={name:`labelStartLink`,resolveAll:i_.resolveAll,tokenize:__};function __(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var v_={name:`lineEnding`,tokenize:y_};function y_(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Vh(e,t,`linePrefix`)}}var b_={name:`thematicBreak`,tokenize:x_};function x_(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$(t)?Vh(e,s,`whitespace`)(t):s(t))}}var S_={continuation:{tokenize:E_},exit:O_,name:`list`,tokenize:T_},C_={partial:!0,tokenize:k_},w_={partial:!0,tokenize:D_};function T_(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Nh(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(b_,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Nh(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ag,r.interrupt?n:u,e.attempt(C_,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function E_(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ag,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vh(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(w_,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vh(e,e.attempt(S_,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function D_(e,t,n){let r=this;return Vh(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function O_(e){e.exit(this.containerState.type)}function k_(e,t,n){let r=this;return Vh(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var A_={name:`setextUnderline`,resolveTo:j_,tokenize:M_};function j_(e,t){let n=new Gh,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function M_(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),$(t)?Vh(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var N_={tokenize:P_};function P_(e){let t=this,n=e.attempt(ag,r,e.attempt(this.parser.constructs.flowInitial,i,Vh(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jg,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var F_={resolveAll:z_()},I_=R_(`string`),L_=R_(`text`);function R_(e){return{resolveAll:z_(e===`text`?B_:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function z_(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function B_(e,t){let n=new Gh,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var V_=s({attentionMarkers:()=>Y_,contentInitial:()=>U_,disable:()=>X_,document:()=>H_,flow:()=>G_,flowInitial:()=>W_,insideSpan:()=>J_,string:()=>K_,text:()=>q_}),H_={42:S_,43:S_,45:S_,48:S_,49:S_,50:S_,51:S_,52:S_,53:S_,54:S_,55:S_,56:S_,57:S_,62:sg},U_={91:Bg},W_={[-2]:yg,[-1]:yg,32:yg},G_={35:Kg,42:b_,45:[A_,b_],60:Zg,61:A_,95:b_,96:_g,126:_g},K_={38:pg,92:dg},q_={[-5]:v_,[-4]:v_,[-3]:v_,33:m_,38:pg,42:$h,60:[rg,n_],91:g_,92:[Wg,dg],93:i_,95:$h,96:Cg},J_={null:[$h,F_]},Y_={null:[42,95]},X_={null:[]};function Z_(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Sh(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Qh(a,l.events,l),l.events):[]}function f(e,t){return $_(p(e),t)}function p(e){return Q_(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&xh(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Q_(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function $_(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
51
51
  `;break;case-3:o=`\r
52
52
  `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function ev(e){let t={constructs:wh([V_,...(e||{}).extensions||[]]),content:n(Uh),defined:[],document:n(qh),flow:n(N_),lazy:{},string:n(I_),text:n(L_)};return t;function n(e){return n;function n(n){return Z_(t,e,n)}}}function tv(e){for(;!kg(e););return e}var nv=/[\0\t\n\r]/g;function rv(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){nv.lastIndex=c;let n=nv.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var iv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function av(e){return e.replace(iv,ov)}function ov(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Dh(n.slice(t?2:1),t?16:10)}return bh(n)||e}var sv={}.hasOwnProperty;function cv(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),lv(n)(tv(ev(n).document().write(rv()(e,t,!0))))}function lv(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ve),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(L),blockQuote:o(de),characterEscape:E,characterReference:E,codeFenced:o(fe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(fe,s),codeText:o(pe,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(me),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(I),hardBreakEscape:o(he),hardBreakTrailing:o(he),htmlFlow:o(ge,s),htmlFlowData:E,htmlText:o(ge,s),htmlTextData:E,image:o(_e),label:s,link:o(ve),listItem:o(be),listItemValue:p,listOrdered:o(ye,f),listUnordered:o(ye),paragraph:o(xe),reference:ie,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(L),strong:o(Se),thematicBreak:o(we)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ue,autolinkProtocol:le,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:se,characterReference:ce,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(ee),label:F,labelText:P,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:te,resourceTitleString:ne,resource:re,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};dv(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),sv.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||pv).call(o,void 0,e[0])}for(r.position={start:uv(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:uv(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:uv(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Mm({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||pv).call(this,e,r[0])),n.position.end=uv(e.end)}function d(){return hh(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Oh(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Ce(),n.position={start:uv(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=uv(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=uv(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=av(t),n.identifier=Oh(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function ie(){this.data.referenceType=`collapsed`}function ae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Oh(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function oe(e){this.data.characterReferenceType=e.type}function se(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Dh(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=bh(t);let i=this.stack[this.stack.length-1];i.value+=r}function ce(e){let t=this.stack.pop();t.position.end=uv(e.end)}function le(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function de(){return{type:`blockquote`,children:[],position:void 0}}function fe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function pe(){return{type:`inlineCode`,value:``,position:void 0}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function I(){return{type:`emphasis`,children:[],position:void 0}}function L(){return{type:`heading`,depth:0,children:[],position:void 0}}function he(){return{type:`break`,position:void 0}}function ge(){return{type:`html`,value:``,position:void 0}}function _e(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ve(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function xe(){return{type:`paragraph`,children:[],position:void 0}}function Se(){return{type:`strong`,children:[],position:void 0}}function Ce(){return{type:`text`,value:``,position:void 0}}function we(){return{type:`thematicBreak`,position:void 0}}}function uv(e){return{line:e.line,column:e.column,offset:e.offset}}function dv(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?dv(e,r):fv(e,r)}}function fv(e,t){let n;for(n in t)if(sv.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function pv(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Mm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Mm({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Mm({start:t.start,end:t.end})+`) is still open`)}function mv(e){let t=this;t.parser=n;function n(n){return cv(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function hv(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function gv(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -77,4 +77,4 @@ Error generating stack: `+e.message+`
77
77
  `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=zx(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}oS.peek=sS;function oS(e){return e.value||``}function sS(){return`<`}cS.peek=lS;function cS(e,t,n,r){let i=Px(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function lS(){return`!`}uS.peek=dS;function uS(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function dS(){return`!`}fS.peek=pS;function fS(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function pS(){return"`"}function mS(e,t){let n=hh(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}hS.peek=gS;function hS(e,t,n,r){let i=Px(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(mS(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,{before:l,after:`](`,...o.current()});l+=o.move(u),c(),l+=o.move(`](`);let d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
78
78
  `||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function gS(e,t,n){return mS(e,n)?`<`:`[`}_S.peek=vS;function _S(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function vS(){return`[`}function yS(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function bS(e){let t=yS(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function xS(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function SS(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function CS(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?xS(n):yS(n),s=e.ordered?o===`.`?`)`:`.`:bS(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),SS(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function wS(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function TS(e,t,n,r){let i=wS(n),a=n.bulletCurrent||yS(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ES(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function DS(e,t,n,r){if(!e.children.some(function(e){return Cx(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function OS(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}kS.attention=AS,kS.peek=jS;function kS(e,t,n,r){let i=n.enter(`phrasing`),a=Xx(e,AS,n,n.createTracker(r)),o=a?eS([a],r.before,r.after):``;return i(),o}function AS(e,t){return{construct:`strong`,markers:OS(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function jS(e,t,n){return n.options.strong||`*`}function MS(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function NS(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function PS(e,t,n){let r=(SS(n)+(n.options.ruleSpaces?` `:``)).repeat(NS(n));return n.options.ruleSpaces?r.slice(0,-1):r}var FS={blockquote:wx,break:Ox,code:Mx,definition:Fx,emphasis:tS,hardBreak:Ox,heading:aS,html:oS,image:cS,imageReference:uS,inlineCode:fS,link:hS,linkReference:_S,list:CS,listItem:TS,paragraph:ES,root:DS,strong:kS,text:MS,thematicBreak:PS};function IS(){return{enter:{table:LS,tableData:VS,tableHeader:VS,tableRow:zS},exit:{codeText:HS,table:RS,tableData:BS,tableHeader:BS,tableRow:BS}}}function LS(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function RS(e){this.exit(e),this.data.inTable=void 0}function zS(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function BS(e){this.exit(e)}function VS(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function HS(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,US));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function US(e,t){return t===`|`?t:e}function WS(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[GS],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
79
79
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
80
- `))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return bx(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=FS.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function GS(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&KS(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function KS(e,t){let n=!1;return Sy(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&hh(e)&&(t.options.setext||n))}function qS(){return{exit:{taskListCheckValueChecked:YS,taskListCheckValueUnchecked:YS,paragraph:XS}}}function JS(){return{handlers:{paragraph:ZS},join:[QS]}}function YS(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function XS(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function ZS(e,t,n,r){if(!t||t.type!==`listItem`||$S(t)!==e)return FS.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+FS.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function QS(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=$S(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function $S(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function eC(){return[Fb(),sx(),fx(),IS(),qS()]}function tC(e){return{extensions:[Ib(),cx(e),px(),WS(e),JS()]}}var nC={tokenize:gC,partial:!0},rC={tokenize:_C,partial:!0},iC={tokenize:vC,partial:!0},aC={tokenize:yC,partial:!0},oC={tokenize:bC,partial:!0},sC={name:`wwwAutolink`,tokenize:mC,previous:xC},cC={name:`protocolAutolink`,tokenize:hC,previous:SC},lC={name:`emailAutolink`,tokenize:pC,previous:CC},uC={};function dC(){return{text:uC}}for(var fC=48;fC<123;)uC[fC]=lC,fC++,fC===58?fC=65:fC===91&&(fC=97);uC[43]=lC,uC[45]=lC,uC[46]=lC,uC[95]=lC,uC[72]=[lC,cC],uC[104]=[lC,cC],uC[87]=[lC,sC],uC[119]=[lC,sC];function pC(e,t,n){let r=this,i,a;return o;function o(t){return!wC(t)||!CC.call(r,r.previous)||TC(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return wC(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(oC,u,l)(t):t===45||t===95||Ah(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&kh(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function mC(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!xC.call(r,r.previous)||TC(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nC,e.attempt(rC,e.attempt(iC,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function hC(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&SC.call(r,r.previous)&&!TC(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(kh(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Mh(t)||Ih(t)||Rh(t)||Lh(t)?n(t):e.attempt(rC,e.attempt(iC,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function gC(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function _C(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(aC,c,s)(t):t===null||Ih(t)||Rh(t)||t!==45&&Lh(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function vC(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(aC,t,a)(o):o===null||Ih(o)||Rh(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function yC(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Ih(o)||Rh(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Ih(e)||Rh(e)?t(e):r(e)}function a(e){return kh(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):kh(t)?(e.consume(t),o):n(t)}}function bC(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ah(e)?n(e):t(e)}}function xC(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ih(e)}function SC(e){return!kh(e)}function CC(e){return!(e===47||wC(e))}function wC(e){return e===43||e===45||e===46||e===95||Ah(e)}function TC(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var EC={tokenize:PC,partial:!0};function DC(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jC,continuation:{tokenize:MC},exit:NC}},text:{91:{name:`gfmFootnoteCall`,tokenize:AC},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:OC,resolveTo:kC}}}}function OC(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Oh(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function kC(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function AC(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Ih(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Oh(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Ih(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function jC(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Ih(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Oh(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Ih(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Vh(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function MC(e,t,n){return e.check(ag,t,e.attempt(EC,t,n))}function NC(e){e.exit(`gfmFootnoteDefinition`)}function PC(e,t,n){let r=this;return Vh(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function FC(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&xh(o,o.length,0,Qh(s,e.slice(r+1,n),t)),xh(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),xh(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Zh(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Zh(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var IC=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){LC(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function LC(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function RC(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function zC(){return{flow:{null:{name:`table`,tokenize:BC,resolveAll:VC}}}}function BC(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?Vh(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Ih(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,$(t)?Vh(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return $(t)?Vh(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return $(t)?Vh(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?Vh(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Ih(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function VC(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new IC;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(UC(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=HC(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=HC(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=HC(f,t,o,i,n,d)):(o[0]=o[1],d=HC(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&UC(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=RC(t.events,n))}return e}function HC(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},WC(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=WC(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=WC(t.events,n[2]),a=WC(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},WC(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function UC(e,t,n,r,i){let a=[],o=WC(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function WC(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var GC={name:`tasklistCheck`,tokenize:qC};function KC(){return{text:{91:GC}}}function qC(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Ih(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):$(r)?e.check({tokenize:JC},t,n)(r):n(r)}}function JC(e,t,n){return Vh(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function YC(e){return wh([dC(),DC(),FC(e),zC(),KC()])}var XC={};function ZC(e){let t=this,n=e||XC,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(YC(n)),a.push(eC()),o.push(tC(n))}var QC={muted:`text-muted-foreground`,progress:`text-primary`,warning:`text-warning`,success:`text-success`,destructive:`text-destructive`},$C={muted:`bg-muted-foreground/35`,progress:`bg-primary`,warning:`bg-warning`,success:`bg-success`,destructive:`bg-destructive`},ew=[{key:`未开始`,label:`未开始`,icon:he,tone:`muted`},{key:`进行中`,label:`进行中`,icon:_e,tone:`progress`},{key:`待验收`,label:`待验收`,icon:De,tone:`warning`},{key:`已完成`,label:`已完成`,icon:I,tone:`success`}],tw=[{key:`未开始`,label:`未开始`,icon:he,tone:`muted`},{key:`进行中`,label:`进行中`,icon:_e,tone:`progress`},{key:`已完成`,label:`已完成`,icon:I,tone:`success`}],nw=[{key:`通过`,label:`通过`,icon:I,tone:`success`},{key:`免测`,label:`免测`,icon:ye,tone:`muted`},{key:`未执行`,label:`未执行`,icon:he,tone:`warning`},{key:`失败`,label:`失败`,icon:Ce,tone:`destructive`}],rw=[{key:`待验收`,label:`待验收`,icon:De,tone:`warning`},{key:`验收通过`,label:`通过`,icon:I,tone:`success`},{key:`验收驳回`,label:`驳回`,icon:Ce,tone:`destructive`}];function iw(e){return e??{}}function aw(e,t){let n=iw(e),r=new Set(t.map(e=>e.key)),i=Object.keys(n).filter(e=>!r.has(e)).sort().map(e=>({key:e,label:e,icon:xe,tone:`muted`}));return[...t,...i]}function ow(e,t){let n=iw(e),r=t.reduce((e,t)=>e+(n[t.key]??0),0);return r===0?[]:t.map(e=>({tone:e.tone,width:(n[e.key]??0)/r*100})).filter(e=>e.width>0)}function sw({counts:e,defs:t,className:n}){let r=iw(e),i=ow(r,aw(r,t));return(0,H.jsx)(`div`,{className:V(`flex h-1.5 w-full overflow-hidden rounded-full bg-border/70`,n),children:i.length===0?null:i.map((e,t)=>(0,H.jsx)(`div`,{className:V(`h-full`,$C[e.tone]),style:{width:`${e.width}%`}},`${e.tone}-${t}`))})}function cw({label:e,icon:t,counts:n,defs:r}){let i=iw(n),a=aw(i,r),o=a.reduce((e,t)=>e+(i[t.key]??0),0);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 py-1.5 sm:flex-row sm:items-center sm:gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex w-24 shrink-0 items-center gap-1.5 text-[11px] font-medium text-muted-foreground`,children:[(0,H.jsx)(t,{className:`size-3.5`}),e]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1`,children:[a.map(e=>{let t=i[e.key]??0;return(0,H.jsxs)(`span`,{className:V(`flex items-center gap-1 text-[11px]`,t===0?`text-muted-foreground/45`:`text-foreground`),title:`${e.label}:${t}`,children:[(0,H.jsx)(e.icon,{className:V(`size-3`,t===0?`text-muted-foreground/45`:QC[e.tone])}),(0,H.jsx)(`span`,{children:e.label}),(0,H.jsx)(`span`,{className:`font-mono tabular-nums`,children:t})]},e.key)}),o===0?(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:`暂无数据`}):null]}),(0,H.jsx)(`div`,{className:`w-full shrink-0 sm:w-32`,children:(0,H.jsx)(sw,{counts:i,defs:r})})]})}function lw({taskCounts:e,requirementCounts:t,selfTestCounts:n,acceptanceCounts:r}){return(0,H.jsxs)(`div`,{className:`divide-y`,children:[(0,H.jsx)(cw,{label:`需求状态`,icon:Te,counts:t,defs:tw}),(0,H.jsx)(cw,{label:`任务状态`,icon:tt,counts:e,defs:ew}),(0,H.jsx)(cw,{label:`AI 自测`,icon:ae,counts:n,defs:nw}),(0,H.jsx)(cw,{label:`人工验收`,icon:Ut,counts:r,defs:rw})]})}function uw(e){let t=e.trim();return t.length===0?`未执行`:t.startsWith(`免测`)?`免测`:t}function dw(e){let t=e.trim();return t.length===0?`待验收`:t}function fw(e,t){let n={};for(let r of e){let e=t(r).trim(),i=e.length===0?`未知`:e;n[i]=(n[i]??0)+1}return n}function pw(e){let t=new Date(e).getTime();if(Number.isNaN(t))return`—`;let n=Date.now()-t,r=6e4,i=60*r,a=24*i;return n<r?`刚刚`:n<i?`${Math.floor(n/r)} 分钟前`:n<a?`${Math.floor(n/i)} 小时前`:n<7*a?`${Math.floor(n/a)} 天前`:new Date(e).toLocaleDateString(`zh-CN`)}function mw({value:e}){return(0,H.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-border`,children:(0,H.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-all`,style:{width:`${Math.max(0,Math.min(100,e))}%`}})})}function hw({status:e}){let t=Qi[e]??`muted`;return(0,H.jsx)(W,{variant:t,children:e.length===0?`—`:e})}function gw({value:e}){if(e.length===0)return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});if(e.startsWith(`免测`)){let t=e.replace(/^免测\s*[((]/,``).replace(/[))]$/,``);return(0,H.jsx)(W,{variant:`warning`,title:t.length>0?`免测:${t}`:`免测`,children:`免测`})}return e===`通过`?(0,H.jsx)(W,{variant:`success`,children:`通过`}):e===`失败`?(0,H.jsx)(W,{variant:`destructive`,children:`失败`}):(0,H.jsx)(W,{variant:`muted`,children:e})}function _w({value:e}){return e.length===0?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):(0,H.jsx)(W,{variant:e===`验收通过`?`success`:e===`验收驳回`?`destructive`:`warning`,children:e.replace(/^验收/,``)})}function vw({summary:e,active:t,onSelect:n}){return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,H.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:[`开发者(`,e.developers.length,`)`]}),(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`任务 `,e.totals.tasks]})]}),e.developers.map(e=>{let r=e.stats.tasks===0?0:Math.round(e.stats.completedTasks/e.stats.tasks*100);return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:V(`w-full rounded-lg border px-3 py-3 text-left transition-all`,e.id===t?`border-primary/50 bg-primary/5 shadow-sm`:`bg-card hover:border-border hover:bg-accent/40`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,H.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium uppercase`,children:e.id.slice(0,2)}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.id}),(0,H.jsx)(W,{variant:`muted`,children:Yi[e.roleInferred]})]}),(0,H.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[pw(e.mtime),` 更新`]})]})]}),(0,H.jsxs)(`div`,{className:`mt-2.5 space-y-1.5`,children:[(0,H.jsx)(mw,{value:r}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,H.jsxs)(`span`,{children:[e.stats.completedTasks,`/`,e.stats.tasks,` 完成 · `,r,`%`]}),(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[e.errors>0?(0,H.jsxs)(`span`,{className:`text-destructive`,children:[e.errors,` error`]}):null,e.warnings>0?(0,H.jsxs)(`span`,{className:`text-warning`,children:[e.warnings,` warn`]}):null,e.parser===`fallback`?(0,H.jsx)(`span`,{className:`text-warning`,children:`未校验`}):null]})]})]})]},e.id)})]})}function yw({summary:e,onOpenTask:t,onSelectDeveloper:n}){let{totals:r}=e;return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-4`,children:[{label:`开发者`,value:r.developers},{label:`需求`,value:r.requirements},{label:`任务`,value:r.tasks,hint:`${r.completedTasks} 已完成`},{label:`整体进度`,value:`${r.progress}%`}].map(e=>(0,H.jsx)(ji,{className:`gap-0 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,H.jsx)(`p`,{className:`text-xl font-semibold tracking-tight`,children:e.value}),e.hint===void 0?null:(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.hint})]})},e.label))}),(0,H.jsx)(ji,{className:`gap-3 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(se,{className:`size-4 text-muted-foreground`}),`状态分布`,(0,H.jsx)(`span`,{className:`text-[11px] font-normal text-muted-foreground`,children:`按当前迭代全部成员聚合`})]}),(0,H.jsx)(lw,{taskCounts:r.taskStatusCounts,requirementCounts:r.requirementStatusCounts,selfTestCounts:r.selfTestCounts,acceptanceCounts:r.acceptanceCounts})]})}),(0,H.jsx)(ji,{className:`gap-3 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(qt,{className:`size-4 text-muted-foreground`}),`成员进度`,(0,H.jsx)(`span`,{className:`text-[11px] font-normal text-muted-foreground`,children:`点击成员可查看其任务`})]}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border`,children:(0,H.jsxs)(`table`,{className:`w-full min-w-[560px] text-left text-xs`,children:[(0,H.jsx)(`thead`,{className:`bg-muted/50 text-muted-foreground`,children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`开发者`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`角色`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`需求`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`任务`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`进度`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`问题`})]})}),(0,H.jsx)(`tbody`,{children:e.developers.map(e=>{let t=e.stats.tasks===0?0:Math.round(e.stats.completedTasks/e.stats.tasks*100);return(0,H.jsxs)(`tr`,{tabIndex:0,role:`button`,onClick:()=>n(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.id))},className:`cursor-pointer border-t transition-colors hover:bg-accent/40 focus:bg-accent/40 focus:outline-none`,children:[(0,H.jsx)(`td`,{className:`px-3 py-2 font-medium`,children:e.id}),(0,H.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:Yi[e.roleInferred]}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:e.stats.requirements}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:e.stats.tasks}),(0,H.jsx)(`td`,{className:`w-48 px-3 py-2`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(sw,{counts:e.statusCounts,defs:ew,className:`h-1.5`}),(0,H.jsxs)(`span`,{className:`w-8 shrink-0 text-right font-mono text-[11px] text-muted-foreground`,children:[t,`%`]})]})}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:e.errors===0&&e.warnings===0?(0,H.jsx)(`span`,{className:`text-success`,children:`—`}):(0,H.jsxs)(`span`,{className:`space-x-1.5`,children:[e.errors>0?(0,H.jsxs)(`span`,{className:`text-destructive`,children:[e.errors,`E`]}):null,e.warnings>0?(0,H.jsxs)(`span`,{className:`text-warning`,children:[e.warnings,`W`]}):null]})})]},e.id)})})]})})]})}),(0,H.jsx)(ji,{className:`gap-3 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(Vt,{className:`size-4 text-warning`}),`被阻塞的任务(`,e.blocked.length,`)`]}),e.blocked.length===0?(0,H.jsx)(`p`,{className:`rounded-lg border border-success/25 bg-success/8 px-3 py-2 text-xs text-success`,children:`没有被阻塞的任务`}):(0,H.jsx)(`ul`,{className:`max-h-80 space-y-1.5 overflow-y-auto pr-1`,children:e.blocked.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>t(e.developer,e.taskId),title:`点击查看任务详情`,className:`flex w-full flex-col gap-1 rounded-lg bg-muted/50 px-3 py-2 text-left text-xs transition-colors hover:bg-accent/60`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(W,{variant:`muted`,children:e.developer}),(0,H.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),(0,H.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.taskId})]}),(e.blocking??[]).length===0?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 pl-0.5 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(De,{className:`size-3 shrink-0`}),(0,H.jsx)(`span`,{children:`等待前置任务完成:`}),(e.blocking??[]).map(e=>(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono`,children:[e.id,(0,H.jsx)(`span`,{className:`rounded bg-warning/12 px-1 py-0.5 font-sans text-warning`,children:e.status})]},e.id))]})]})},`${e.developer}-${e.taskId}`))})]})})]})}function bw({validation:e}){let t=e.iterationInfo,n=[{label:`迭代版本`,value:t.迭代版本},{label:`负责人`,value:t.负责人},{label:`负责范围`,value:t.负责范围},{label:`PRD`,value:t[`PRD 来源`],link:!0}].filter(e=>(e.value??``).length>0);return(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[n.map(e=>(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-3.5 py-2.5`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.label}),e.link===!0&&e.value!==void 0?(0,H.jsx)(`a`,{href:e.value,target:`_blank`,rel:`noreferrer`,className:`mt-0.5 block truncate text-xs text-primary underline-offset-2 hover:underline`,children:e.value}):(0,H.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:e.value})]},e.label)),e.iterationInfo.排期计划===void 0?null:(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-3.5 py-2.5 sm:col-span-2 lg:col-span-4`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`排期计划`}),(0,H.jsx)(`p`,{className:`mt-0.5 text-xs`,children:e.iterationInfo.排期计划})]})]})}function xw({validation:e}){let t=[...e.errors,...e.warnings];return t.length===0?null:(0,H.jsx)(`div`,{className:`space-y-1.5`,children:t.map((e,t)=>(0,H.jsxs)(`div`,{className:V(`flex items-start gap-2 rounded-lg border px-3 py-2 text-xs`,e.level===`error`?`border-destructive/25 bg-destructive/6 text-destructive`:`border-warning/30 bg-warning/8 text-warning`),children:[(0,H.jsx)(Vt,{className:`mt-0.5 size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`leading-snug`,children:e.message})]},`${e.code}-${t}`))})}var Sw={start:`开始实施`,submit:`提交验收`,accept:`验收通过`,reject:`验收驳回`},Cw={start:{status:`进行中`,acceptance:null},submit:{status:`待验收`,acceptance:null},accept:{status:`已完成`,acceptance:`验收通过`},reject:{status:`进行中`,acceptance:`验收驳回`}};function ww({validation:e,onOpenDetail:t,editable:n,actions:r,actingTaskId:i,onAction:a,onBatchAction:o}){let[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(`all`),[p,m]=(0,v.useState)(`all`),[h,g]=(0,v.useState)(`all`),[_,y]=(0,v.useState)(``),b=(0,v.useMemo)(()=>Array.from(new Set(e.tasks.map(e=>e.status).filter(e=>e.length>0))),[e.tasks]),x=(0,v.useMemo)(()=>Array.from(new Set(e.tasks.map(e=>e.type).filter(e=>e.length>0))),[e.tasks]),S=e.tasks.filter(e=>{if(d!==`all`&&e.status!==d||p!==`all`&&e.type!==p||h!==`all`&&e.requirementId!==h)return!1;if(_.trim().length>0){let t=_.trim().toLowerCase();if(!`${e.id} ${e.name} ${e.terminal}`.toLowerCase().includes(t))return!1}return!0});return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(Tt,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(Ni,{value:_,placeholder:`搜索任务编号 / 名称 / 终端`,className:`h-8 w-56 pl-8 text-xs`,onChange:e=>y(e.target.value)})]}),(0,H.jsxs)(qf,{value:d,onValueChange:f,children:[(0,H.jsx)(Yf,{className:`h-8 w-32 text-xs`,children:(0,H.jsx)(Jf,{})}),(0,H.jsxs)(Xf,{children:[(0,H.jsx)(Zf,{value:`all`,children:`全部状态`}),b.map(e=>(0,H.jsx)(Zf,{value:e,children:e},e))]})]}),(0,H.jsxs)(qf,{value:p,onValueChange:m,children:[(0,H.jsx)(Yf,{className:`h-8 w-32 text-xs`,children:(0,H.jsx)(Jf,{})}),(0,H.jsxs)(Xf,{children:[(0,H.jsx)(Zf,{value:`all`,children:`全部类型`}),x.map(e=>(0,H.jsx)(Zf,{value:e,children:e},e))]})]}),(0,H.jsxs)(qf,{value:h,onValueChange:g,children:[(0,H.jsx)(Yf,{className:`h-8 w-56 text-xs`,children:(0,H.jsx)(Jf,{})}),(0,H.jsxs)(Xf,{children:[(0,H.jsx)(Zf,{value:`all`,children:`全部需求`}),e.requirements.map(e=>(0,H.jsxs)(Zf,{value:e.id,children:[e.id,` `,e.title]},e.id))]})]}),(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[S.length,`/`,e.tasks.length]}),n&&s.length>0?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-primary/30 bg-primary/5 px-2.5 py-1.5`,children:[(0,H.jsxs)(`span`,{className:`text-[11px] text-primary`,children:[`已选 `,s.length,` 项`]}),(0,H.jsx)(U,{size:`sm`,className:`h-6 px-2 text-[11px]`,onClick:()=>u({kind:`batch`,taskIds:[...s],action:`accept`}),children:`批量验收通过`}),(0,H.jsx)(U,{size:`sm`,variant:`outline`,className:`h-6 px-2 text-[11px]`,onClick:()=>u({kind:`batch`,taskIds:[...s],action:`reject`}),children:`批量驳回`}),(0,H.jsx)(U,{size:`sm`,variant:`ghost`,className:`h-6 px-2 text-[11px]`,onClick:()=>c([]),children:`清空`})]}):null]}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border`,children:(0,H.jsxs)(`table`,{className:`w-full min-w-[760px] table-fixed text-left text-xs`,children:[(0,H.jsx)(`thead`,{className:`bg-muted/50 text-muted-foreground`,children:(0,H.jsxs)(`tr`,{children:[n?(0,H.jsx)(`th`,{className:`w-[32px] px-1.5 py-2`}):null,(0,H.jsx)(`th`,{className:`w-[76px] whitespace-nowrap px-2 py-2 font-medium`,children:`编号`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`任务名称`}),(0,H.jsx)(`th`,{className:`hidden w-[76px] whitespace-nowrap px-2.5 py-2 font-medium 2xl:table-cell`,children:`类型`}),(0,H.jsx)(`th`,{className:`w-[76px] whitespace-nowrap px-2 py-2 font-medium`,children:`终端`}),(0,H.jsx)(`th`,{className:`w-[80px] whitespace-nowrap px-2 py-2 font-medium`,children:`AI自测状态`}),(0,H.jsx)(`th`,{className:`w-[88px] whitespace-nowrap px-2 py-2 font-medium`,children:`开发人工验收`}),(0,H.jsx)(`th`,{className:`w-[80px] whitespace-nowrap px-2 py-2 font-medium`,children:`任务状态`}),(0,H.jsx)(`th`,{className:`hidden w-[112px] whitespace-nowrap px-2 py-2 font-medium 2xl:table-cell`,children:`最后更新`}),n?(0,H.jsx)(`th`,{className:`sticky right-0 z-20 w-[148px] whitespace-nowrap border-l bg-muted px-2 py-2 font-medium`,children:`操作`}):null]})}),(0,H.jsxs)(`tbody`,{children:[S.map(e=>(0,H.jsxs)(`tr`,{className:`group cursor-pointer border-t transition-colors hover:bg-accent/40`,onClick:()=>t(e.id),children:[n?(0,H.jsx)(`td`,{className:`px-2 py-2`,onClick:e=>e.stopPropagation(),children:(0,H.jsx)(`input`,{type:`checkbox`,className:`size-3.5 accent-primary`,checked:s.includes(e.id),onChange:t=>c(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id))})}):null,(0,H.jsx)(`td`,{className:`whitespace-nowrap px-2.5 py-2 font-mono text-[11px]`,children:e.id}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:(0,H.jsx)(`div`,{className:`truncate`,title:e.name,children:e.name})}),(0,H.jsx)(`td`,{className:`hidden px-2.5 py-2 text-muted-foreground 2xl:table-cell`,children:(0,H.jsx)(`div`,{className:`truncate`,title:e.type,children:e.type})}),(0,H.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:(0,H.jsx)(`div`,{className:`truncate`,title:e.terminal,children:e.terminal})}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:(0,H.jsx)(gw,{value:e.selfTest})}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:(0,H.jsx)(_w,{value:e.acceptance})}),(0,H.jsx)(`td`,{className:`px-2.5 py-2`,children:(0,H.jsx)(hw,{status:e.status})}),(0,H.jsx)(`td`,{className:`hidden whitespace-nowrap px-2 py-2 font-mono text-[11px] text-muted-foreground 2xl:table-cell`,children:e.updatedAt}),n?(0,H.jsx)(`td`,{className:`sticky right-0 z-10 border-l bg-card px-2.5 py-2 group-hover:bg-accent`,onClick:e=>e.stopPropagation(),children:(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(r[e.id]??[]).map(t=>(0,H.jsxs)(U,{size:`sm`,variant:t.action===`accept`?`default`:(t.action,`outline`),className:V(`h-6 whitespace-nowrap px-2 text-[11px]`,t.action===`reject`?`text-destructive hover:text-destructive`:``),disabled:t.enabled===!1||i===e.id,title:t.enabled===!1?t.reason:``,onClick:()=>u({kind:`single`,taskId:e.id,action:t.action}),children:[i===e.id?(0,H.jsx)(rt,{className:`size-3 animate-spin`}):null,Sw[t.action]]},t.action)),(r[e.id]??[]).length===0?(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`—`}):null]})}):null]},e.id)),S.length===0?(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:n?9:7,className:`px-3 py-8 text-center text-muted-foreground`,children:`没有符合条件的任务`})}):null]})]})}),(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`点击任意行查看任务详情。`}),(0,H.jsx)(Hf,{open:l!==null,onOpenChange:e=>e?void 0:u(null),children:(0,H.jsxs)(Uf,{className:`max-w-md`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsxs)(Y,{children:[`确认`,l===null?``:l.kind===`batch`?`批量「${Sw[l.action]}」`:`「${Sw[l.action]}」`,`?`]}),(0,H.jsx)(Gf,{children:l?.kind===`single`?e.tasks.find(e=>e.id===l.taskId)?.name??l.taskId:l===null?``:`将对 ${l.taskIds.length} 个任务执行该动作`})]}),l===null?null:(0,H.jsxs)(`div`,{className:`space-y-1.5 rounded-lg bg-muted/50 px-3 py-2.5 text-xs`,children:[(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`任务状态:`,l.kind===`single`?`${e.tasks.find(e=>e.id===l.taskId)?.status??`—`} → ${Cw[l.action].status}`:`→ ${Cw[l.action].status}`]}),Cw[l.action].acceptance===null?null:(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`开发人工验收:`,l.kind===`single`?`${e.tasks.find(e=>e.id===l.taskId)?.acceptance??`—`} → ${Cw[l.action].acceptance}`:`→ ${Cw[l.action].acceptance}`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`所属需求的状态与进度会同步重算,写入后可执行 git diff 核对。`})]}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>u(null),children:`取消`}),(0,H.jsx)(U,{size:`sm`,variant:l?.action===`reject`?`destructive`:`default`,onClick:()=>{l!==null&&(l.kind===`single`?a(l.taskId,l.action):(o(l.taskIds,l.action),c([])),u(null))},children:`确认执行`})]})]})})]})}function Tw({validation:e}){let[t,n]=(0,v.useState)(`all`),[r,i]=(0,v.useState)(``),a=(0,v.useMemo)(()=>Array.from(new Set(e.requirements.map(e=>e.terminal).filter(e=>e.length>0))),[e.requirements]),o=e.requirements.filter(e=>{if(t!==`all`&&e.terminal!==t)return!1;if(r.trim().length>0){let t=r.trim().toLowerCase().replace(/^#/,``);if(!`${e.id.replace(/^#/,``)} ${e.title}`.toLowerCase().includes(t))return!1}return!0});return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(Tt,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(Ni,{value:r,placeholder:`搜索需求编号 / 名称`,className:`h-8 w-52 pl-8 text-xs`,onChange:e=>i(e.target.value)})]}),(0,H.jsxs)(qf,{value:t,onValueChange:n,children:[(0,H.jsx)(Yf,{className:`h-8 w-40 text-xs`,children:(0,H.jsx)(Jf,{})}),(0,H.jsxs)(Xf,{children:[(0,H.jsx)(Zf,{value:`all`,children:`全部终端`}),a.map(e=>(0,H.jsx)(Zf,{value:e,children:e},e))]})]}),(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[o.length,`/`,e.requirements.length]})]}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border`,children:(0,H.jsxs)(`table`,{className:`w-full min-w-[760px] table-fixed text-left text-xs`,children:[(0,H.jsx)(`thead`,{className:`bg-muted/50 text-muted-foreground`,children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:`w-[76px] whitespace-nowrap px-2 py-2 font-medium`,children:`编号`}),(0,H.jsx)(`th`,{className:`w-[26%] px-3 py-2 font-medium`,children:`需求名称`}),(0,H.jsx)(`th`,{className:`w-[76px] whitespace-nowrap px-2 py-2 font-medium`,children:`终端`}),(0,H.jsx)(`th`,{className:`w-[104px] whitespace-nowrap px-3 py-2 font-medium`,children:`状态`}),(0,H.jsx)(`th`,{className:`w-[72px] whitespace-nowrap px-3 py-2 font-medium`,children:`进度`}),(0,H.jsx)(`th`,{className:`w-[120px] whitespace-nowrap px-2 py-2 font-medium`,children:`最后更新`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`备注`})]})}),(0,H.jsxs)(`tbody`,{children:[o.map(t=>{let n=e.tasks.filter(e=>e.requirementId===t.id),r=n.length>0&&n.every(e=>e.status===`待验收`)&&t.status!==`已完成`;return(0,H.jsxs)(`tr`,{className:`border-t`,children:[(0,H.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 font-mono text-[11px]`,children:t.id}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`truncate`,title:t.title,children:t.title}),r?(0,H.jsx)(W,{variant:`warning`,children:`待人工验收`}):null]})}),(0,H.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:(0,H.jsx)(`div`,{className:`truncate`,title:t.terminal,children:t.terminal})}),(0,H.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2`,children:(0,H.jsx)(hw,{status:t.status})}),(0,H.jsxs)(`td`,{className:`whitespace-nowrap px-3 py-2`,children:[t.progress,`%`]}),(0,H.jsx)(`td`,{className:`whitespace-nowrap px-2 py-2 font-mono text-[11px] text-muted-foreground`,children:t.updatedAt}),(0,H.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:(0,H.jsx)(`div`,{className:`truncate`,title:t.note,children:t.note.length===0?`—`:t.note})})]},t.id)}),o.length===0?(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:6,className:`px-3 py-8 text-center text-muted-foreground`,children:`没有符合条件的需求`})}):null]})]})})]})}function Ew({doc:e,developer:t,onOpenDetail:n,editable:r,actions:i,actingTaskId:a,onAction:o,onBatchAction:s}){let{validation:c}=e,l=c.stats.tasks===0?0:Math.round(c.stats.completedTasks/c.stats.tasks*100);return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Fe,{className:`size-4 text-muted-foreground`}),(0,H.jsxs)(`span`,{className:`text-sm font-medium`,children:[e.developer,`.md`]}),(0,H.jsx)(W,{variant:`muted`,children:Yi[e.roleInferred]}),e.source===`remote`?(0,H.jsxs)(W,{variant:`secondary`,children:[(0,H.jsx)(ke,{className:`size-3`}),`远程 `,e.ref?.sha.slice(0,7)??``]}):(0,H.jsxs)(W,{variant:`muted`,children:[(0,H.jsx)(qe,{className:`size-3`}),`本地`]}),e.parser===`fallback`?(0,H.jsx)(W,{variant:`warning`,children:`降级解析`}):null]}),(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[pw(e.mtime),` 更新`]})]}),e.parser===`fallback`?(0,H.jsx)(cp,{children:`当前环境未找到 python3 或文档仓库缺少 scripts/validate_task_doc.py,已使用降级解析:数据仅供参考, 未经校验器校验。建议安装 Python 3 后刷新。`}):null,(0,H.jsx)(bw,{validation:c}),(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-4`,children:[{label:`需求`,value:c.stats.requirements},{label:`任务`,value:c.stats.tasks},{label:`已完成`,value:c.stats.completedTasks},{label:`进度`,value:`${l}%`}].map(e=>(0,H.jsxs)(`div`,{className:`rounded-lg border px-3.5 py-2.5`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,H.jsx)(`p`,{className:`mt-0.5 text-lg font-semibold tracking-tight`,children:e.value})]},e.label))}),(0,H.jsx)(mw,{value:l}),(0,H.jsx)(`div`,{className:`rounded-lg border px-4 py-2`,children:(0,H.jsx)(lw,{taskCounts:fw(c.tasks,e=>e.status),requirementCounts:fw(c.requirements,e=>e.status),selfTestCounts:fw(c.tasks,e=>uw(e.selfTest)),acceptanceCounts:fw(c.tasks,e=>dw(e.acceptance))})}),(0,H.jsx)(xw,{validation:c}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(pe,{className:`size-3.5 text-muted-foreground`}),`需求清单`,(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:c.requirements.length})]}),(0,H.jsx)(Tw,{validation:c})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(pe,{className:`size-3.5 text-muted-foreground`}),`任务清单`,(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:c.tasks.length})]}),(0,H.jsx)(ww,{validation:c,onOpenDetail:n,editable:r,actions:i,actingTaskId:a,onAction:o,onBatchAction:s})]})]})}function Dw(){let e=new URLSearchParams(window.location.search),t=oa(e=>e.snapshot),n=t?.config?.profile.developer??``,r=e.get(`tab`),i=r===`doc`||r===`overview`?r:`doc`,a=e.get(`dev`),o=e.get(`task`),s=e.get(`source`)===`remote`?`remote`:`local`,[c,l]=(0,v.useState)(s),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)([]),[x,S]=(0,v.useState)(e.get(`ref`)),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(null),[D,O]=(0,v.useState)(null),[k,A]=(0,v.useState)(null),[j,M]=(0,v.useState)(a),[N,ee]=(0,v.useState)(null),[F,te]=(0,v.useState)(i),[ne,re]=(0,v.useState)(!1),[ie,ae]=(0,v.useState)(null),[oe,se]=(0,v.useState)(null),ce=t!==null&&(t.meta.features??[]).includes(`status-breakdown`)===!1,[le,ue]=(0,v.useState)(0),de=(0,v.useRef)(null),fe=(0,v.useRef)(o),pe=(0,v.useRef)(Date.now()),me=(0,v.useRef)(null),I=async(e,t={})=>{let n=t.silent===!0;n||re(!0),ae(null);try{let t=e===`remote`?x??void 0:void 0,[n,r,i]=await Promise.all([G.listIterations(e,t),G.gitStatus(),G.gitBranches().catch(()=>null)]);E(n),d(r),p(i),O(e=>n.iterations.some(t=>t.name===e)?e:n.iterations[0]?.name??null),n.iterations.length===0&&(O(null),A(null),ee(null),se(null))}catch(e){E(null),ae(e instanceof Error?e.message:String(e))}finally{n||re(!1)}};(0,v.useEffect)(()=>{I(c)},[c,x]),(0,v.useEffect)(()=>{let e=new URL(window.location.href);c===`remote`?(e.searchParams.set(`source`,`remote`),x===null?e.searchParams.delete(`ref`):e.searchParams.set(`ref`,x)):e.searchParams.delete(`ref`),window.history.replaceState(null,``,e)},[c,x]),(0,v.useEffect)(()=>{if(D===null)return;let e=!1;return re(!0),ae(null),G.iterationSummary(D,c,c===`remote`?x??void 0:void 0).then(t=>{e||(A(t),M(e=>t.developers.some(t=>t.id===e)?e:(n.length===0?void 0:t.developers.find(e=>e.id===n))?.id??t.developers[0]?.id??null))}).catch(t=>{e||(A(null),ae(t instanceof Error?t.message:String(t)))}).finally(()=>{e||re(!1)}),()=>{e=!0}},[D,c,x,le,n]),(0,v.useEffect)(()=>{if(D===null||j===null)return;let e=!1;return G.iterationDoc(D,j,c,c===`remote`?x??void 0:void 0).then(t=>{if(e)return;ee(t);let n=de.current??fe.current;if(n!==null){let e=t.details.find(e=>e.id===n||e.id===n.replace(/^#/,``));e!==void 0&&se(e),de.current=null,fe.current=null}else se(e=>e===null?null:t.details.find(t=>t.id===e.id||t.id===e.id.replace(/^#/,``))??e)}).catch(t=>{e||(ee(null),ae(t instanceof Error?t.message:String(t)))}),()=>{e=!0}},[D,j,c,x,le]),(0,v.useEffect)(()=>{let e=()=>{if(document.visibilityState!==`visible`)return;let e=Date.now();e-pe.current<5e3||(pe.current=e,I(c,{silent:!0}),ue(e=>e+1))};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[c]);let L=c===`local`&&j!==null&&n.length>0&&j===n&&m?.editable===!0;(0,v.useEffect)(()=>{if(D===null||j===null||j!==n||c!==`local`){h(null);return}let e=!1;return G.taskActions(D,j).then(t=>{e||h(t)}).catch(()=>{e||h(null)}),()=>{e=!0}},[D,j,c,le,N,n]);let he=async()=>{await I(c,{silent:!0}),ue(e=>e+1)},ge=async(e,t)=>{if(D!==null&&j!==null){_(e);try{let n=await G.taskAction(D,j,e,t);mn.success(n.message,{description:n.changes.slice(0,3).join(`;`)}),await he()}catch(e){mn.error(`操作失败`,{description:e instanceof Error?e.message:String(e)})}finally{_(null)}}},_e=async(e,t)=>{if(D!==null&&j!==null&&e.length!==0){_(e[0]??null);try{let n=await G.taskBatch(D,j,e,t);mn.success(n.message,{description:n.changes.slice(0,3).join(`;`)}),await he()}catch(e){mn.error(`批量操作失败`,{description:e instanceof Error?e.message:String(e)})}finally{_(null)}}},ve=async()=>{w(!0);try{let e=await G.gitFetch();e.ok&&await I(c),ae(e.ok?null:e.message)}catch(e){ae(e instanceof Error?e.message:String(e))}finally{w(!1)}};(0,v.useEffect)(()=>{let e=Number.parseInt(new URLSearchParams(window.location.search).get(`scroll`)??`0`,10);if(!Number.isFinite(e)||e<=0)return;let t=setTimeout(()=>{me.current!==null&&(me.current.scrollTop=e)},300);return()=>clearTimeout(t)},[N,F]);let ye=k?.developers.find(e=>e.id===j),be=(e,t)=>{if(e===j){let e=N?.details.find(e=>e.id===t||e.id===t.replace(/^#/,``));e!==void 0&&se(e)}else de.current=t,M(e)};(0,v.useEffect)(()=>{if(oe===null||D===null||j===null){b([]);return}let e=!1;return G.taskHistory(D,j,oe.id).then(t=>{e||b(t)}).catch(()=>{e||b([])}),()=>{e=!0}},[oe,D,j,le]);let xe=k?.blocked.find(e=>e.taskId===oe?.id)?.blocking??[],Se=e=>{let t=N?.details.find(t=>t.id===e||t.id===e.replace(/^#/,``));se(t??null)},Ce=()=>(0,H.jsx)(`div`,{className:`shrink-0 border-b bg-background px-8 py-3`,children:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1 rounded-lg border p-0.5`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>l(`local`),title:`读取当前工作区的文档文件`,className:V(`flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs transition-colors`,c===`local`?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:[(0,H.jsx)(qe,{className:`size-3`}),`本地`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>l(`remote`),disabled:u!==null&&!u.hasRemote,title:`读取 git 提交快照:不 pull、不 checkout、不改动工作区`,className:V(`flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs transition-colors`,c===`remote`?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`,u!==null&&!u.hasRemote?`cursor-not-allowed opacity-40`:``),children:[(0,H.jsx)(ke,{className:`size-3`}),`远程`]})]}),c===`local`?(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs text-muted-foreground`,title:f?.dirty===!0?`工作区有未提交改动`:`当前检出分支`,children:[(0,H.jsx)(Ge,{className:`size-3`}),(0,H.jsx)(`span`,{className:`max-w-56 truncate font-mono text-[11px]`,children:f===null?`…`:f.current??`detached HEAD`}),f?.dirty===!0?(0,H.jsx)(`span`,{className:`size-1.5 rounded-full bg-warning`}):null]}):null,c===`remote`&&f!==null&&f.remote.length>0?(0,H.jsxs)(qf,{value:x??f.upstream??f.remote[0]??``,onValueChange:e=>S(e),children:[(0,H.jsx)(Yf,{className:`h-9 w-64 text-xs`,title:`选择远程分支(只读快照,不改工作区)`,children:(0,H.jsx)(`span`,{className:`truncate font-mono text-[11px]`,children:x??f.upstream??f.remote[0]??`选择远程分支`})}),(0,H.jsx)(Xf,{children:f.remote.map(e=>(0,H.jsxs)(Zf,{value:e,children:[e,e===f.upstream?`(当前上游)`:``]},e))})]}):null,T===null||T.iterations.length===0?null:(0,H.jsxs)(qf,{value:D??``,onValueChange:e=>O(e),children:[(0,H.jsx)(Yf,{className:`h-9 w-64 text-sm`,children:(0,H.jsx)(Jf,{placeholder:`选择迭代`})}),(0,H.jsx)(Xf,{children:T.iterations.map(e=>(0,H.jsxs)(Zf,{value:e.name,children:[e.name,`(`,e.developers.length,` 人)`]},e.name))})]}),(0,H.jsx)(U,{variant:`outline`,size:`icon`,onClick:()=>void I(c),disabled:ne,title:c===`local`?`重新扫描工作区(不联网):IDE 里改过文档、终端切过分支后点这里`:`重新读取本地保存的远程快照(不联网);要拉取远端最新提交请用「同步远程」`,"aria-label":c===`local`?`重新扫描工作区`:`重新读取远程快照`,children:ne?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(_t,{className:`size-3.5`})}),c===`remote`?(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`h-8 gap-1.5 text-xs`,onClick:()=>void ve(),disabled:C,title:`执行 git fetch --prune origin:拉取远端最新提交并清理已删除的分支,不改动工作区`,children:[C?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(P,{className:`size-3.5`}),`同步远程`]}):null]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 rounded-lg border p-0.5`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>te(`doc`),className:V(`rounded-md px-3 py-1.5 text-xs transition-colors`,F===`doc`?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:`个人文档`}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>te(`overview`),className:V(`rounded-md px-3 py-1.5 text-xs transition-colors`,F===`overview`?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:`跨人总览`})]})]})});if(T===null)return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 py-16 text-sm text-muted-foreground`,children:[(0,H.jsx)(rt,{className:`size-4 animate-spin`}),`正在读取迭代…`]});if(!T.configured)return(0,H.jsx)(sp,{icon:(0,H.jsx)(jt,{className:`size-5`}),title:`尚未配置文档仓库`,description:"当前账号还没有可用的迭代任务文档仓库。请联系管理员开通访问权限,或用 `ylcwf init` 完成配置后刷新。",action:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,onClick:()=>void I(c),children:[(0,H.jsx)(_t,{className:`size-3.5`}),`重新检测`]})});if(!T.accessible)return(0,H.jsx)(sp,{icon:(0,H.jsx)(jt,{className:`size-5`}),title:`无法访问文档仓库`,description:`${T.reason??`未知原因`}。如果这是团队共享仓库,请联系管理员开通文档仓库访问权限。`,action:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,onClick:()=>void I(c),children:[(0,H.jsx)(_t,{className:`size-3.5`}),`重新检测`]})});if(T.iterations.length===0){let e=c===`remote`?T.ref?.name??x??`当前远程分支`:`当前工作区`;return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[Ce(),(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,H.jsx)(sp,{icon:(0,H.jsx)(Le,{className:`size-5`}),title:`${e} 上没有迭代文档`,description:c===`remote`?`该分支未包含「迭代目录/开发者.md」结构的文档。可切换到其他远程分支,或切回本地视图查看当前工作区。`:`已读取 ${T.docsRoot},但未找到包含个人文档的迭代目录。确认仓库路径正确,且目录下存在 {开发者}.md。`,action:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,onClick:()=>void I(c),children:[(0,H.jsx)(_t,{className:`size-3.5`}),`重新扫描`]})})})]})}return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[Ce(),c===`remote`&&u!==null?(0,H.jsx)(`div`,{className:`shrink-0`,children:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-lg border bg-muted/40 px-3.5 py-2 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(ke,{className:`size-3.5`}),(0,H.jsx)(`span`,{className:`font-mono`,children:u.upstream??`无上游`}),T?.ref===null||T?.ref===void 0?null:(0,H.jsxs)(`span`,{className:`font-mono`,children:[`@`,T.ref.sha.slice(0,7)]}),u.behind>0?(0,H.jsxs)(W,{variant:`warning`,children:[`落后 `,u.behind,` 个提交`]}):null,u.ahead>0?(0,H.jsxs)(W,{variant:`secondary`,children:[`本地领先 `,u.ahead,` 个提交`]}):null,u.dirty?(0,H.jsx)(W,{variant:`muted`,children:`工作区有未提交修改`}):null,(0,H.jsx)(`span`,{className:`ml-auto`,children:`'远程只读快照,不会改动工作区'`})]})}):null,ce?(0,H.jsx)(`div`,{className:`shrink-0 px-8 py-2`,children:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-lg border border-warning/35 bg-warning/8 px-3.5 py-2.5 text-xs text-warning`,children:[(0,H.jsx)(Vt,{className:`size-3.5 shrink-0`}),(0,H.jsxs)(`span`,{className:`flex-1`,children:[`本地服务版本比界面旧(升级后未重启):状态统计等新数据可能为空。请在终端重启`,` `,(0,H.jsx)(`code`,{className:`rounded bg-warning/15 px-1 py-0.5 font-mono`,children:`ylcwf serve`}),` 后刷新。`]})]})}):null,ie===null?null:(0,H.jsx)(`div`,{className:`shrink-0 px-8 py-2`,children:(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-lg border border-destructive/25 bg-destructive/8 px-3.5 py-2.5 text-xs text-destructive`,children:(0,H.jsx)(`span`,{className:`flex-1`,children:ie})})}),(0,H.jsxs)(`div`,{className:V(`grid min-h-0 flex-1 gap-0`,F===`doc`?`lg:grid-cols-[224px_1fr]`:`grid-cols-1`),children:[F===`doc`?(0,H.jsx)(`aside`,{className:`min-h-0 overflow-y-auto border-r px-4 py-4`,children:k===null?(0,H.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`加载中…`}):(0,H.jsx)(vw,{summary:k,active:j,onSelect:e=>M(e)})}):null,(0,H.jsx)(`div`,{ref:me,className:`min-h-0 min-w-0 overflow-y-auto px-6 py-5`,children:(0,H.jsx)(`div`,{className:`space-y-4`,children:k===null?(0,H.jsx)(ji,{className:`py-16`,children:(0,H.jsx)(Mi,{className:`text-center text-sm text-muted-foreground`,children:`正在汇总该迭代…`})}):F===`overview`?(0,H.jsx)(yw,{summary:k,onOpenTask:be,onSelectDeveloper:e=>{M(e),te(`doc`)}}):N===null?(0,H.jsx)(ji,{className:`py-16`,children:(0,H.jsx)(Mi,{className:`text-center text-sm text-muted-foreground`,children:`选择左侧开发者查看文档`})}):(0,H.jsx)(Ew,{doc:N,developer:ye,onOpenDetail:Se,editable:L,actions:m?.actions??{},actingTaskId:g,onAction:(e,t)=>void ge(e,t),onBatchAction:(e,t)=>void _e(e,t)})})})]}),(0,H.jsx)(Hf,{open:oe!==null,onOpenChange:e=>e?void 0:se(null),children:(0,H.jsxs)(Uf,{className:`flex max-h-[82vh] max-w-2xl flex-col gap-0 overflow-hidden p-0`,children:[(0,H.jsx)(`div`,{className:`shrink-0 border-b px-6 py-4 pr-12`,children:(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{className:`line-clamp-2 leading-snug`,children:oe?.name??``}),(0,H.jsxs)(Gf,{children:[oe?.id??``,` · 只读视图,修改请通过 Agent 流程`]})]})}),xe.length>0?(0,H.jsxs)(`div`,{className:`mx-6 mt-4 flex flex-wrap items-center gap-2 rounded-lg border border-warning/35 bg-warning/8 px-3 py-2 text-[11px] text-warning`,children:[(0,H.jsx)(De,{className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{children:`该任务被前置任务阻塞:`}),xe.map(e=>(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono`,children:[e.id,(0,H.jsx)(`span`,{className:`rounded bg-warning/15 px-1 py-0.5`,children:e.status})]},e.id))]}):null,y.length===0?null:(0,H.jsxs)(`div`,{className:`mx-6 mt-3 space-y-1 rounded-lg border bg-muted/40 px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`text-[11px] font-medium text-muted-foreground`,children:`最近变更`}),y.map(e=>(0,H.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`font-mono`,children:new Date(e.at).toLocaleString(`zh-CN`)}),` · `,e.changes.slice(0,2).join(`;`)]},`${e.at}-${e.action}`))]}),(0,H.jsx)(`div`,{className:`prose prose-sm min-h-0 max-w-none flex-1 overflow-y-auto px-6 py-4 dark:prose-invert prose-code:rounded prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:font-mono prose-code:text-[12px] prose-code:before:content-none prose-code:after:content-none prose-pre:bg-muted/60 prose-table:text-xs prose-headings:font-semibold`,children:oe===null?null:(0,H.jsx)(Sb,{remarkPlugins:[ZC],skipHtml:!0,children:oe.markdown})})]})})]})}var Ow=[{id:`overview`,label:`概览`,description:`配置健康状态与关键指标`,icon:$e,component:up},{id:`iterations`,label:`迭代看板`,description:`迭代进度、成员文档与任务详情`,icon:Nt,component:Dw,wide:!0,fullHeight:!0},{id:`settings`,label:`设置`,description:`身份、文档仓库、终端映射、备份与关于`,icon:Dt,component:wp}];function kw(e){return Ow.some(t=>t.id===e)}var Aw={system:`跟随系统`,light:`浅色模式`,dark:`深色模式`};function jw(){let[e,t]=(0,v.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`dark`||e===`light`)return e;let t=localStorage.getItem(`ylcwf-theme`);return t===`dark`||t===`light`||t===`system`?t:`system`}),[n,r]=(0,v.useState)(()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches);(0,v.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>r(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let i=e===`system`?n:e===`dark`;return(0,v.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,i),localStorage.setItem(`ylcwf-theme`,e)},[i,e]),{mode:e,dark:i,cycle:()=>{t(e=>e===`system`?`light`:e===`light`?`dark`:`system`)}}}function Mw(){return(0,H.jsxs)(`svg`,{viewBox:`0 0 32 32`,className:`size-8`,"aria-hidden":`true`,children:[(0,H.jsx)(`defs`,{children:(0,H.jsxs)(`linearGradient`,{id:`brandBg`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,H.jsx)(`stop`,{offset:`0`,stopColor:`#A283FF`}),(0,H.jsx)(`stop`,{offset:`0.45`,stopColor:`#6E4BF7`}),(0,H.jsx)(`stop`,{offset:`1`,stopColor:`#3A1DAE`})]})}),(0,H.jsx)(`rect`,{width:`32`,height:`32`,rx:`9`,fill:`url(#brandBg)`}),(0,H.jsx)(`rect`,{x:`5.5`,y:`6.5`,width:`11`,height:`8`,rx:`2.6`,fill:`#FFFFFF`,fillOpacity:`0.6`}),(0,H.jsx)(`rect`,{x:`10.5`,y:`12.8`,width:`11`,height:`8`,rx:`2.6`,fill:`#FFFFFF`,fillOpacity:`0.84`}),(0,H.jsx)(`rect`,{x:`15.5`,y:`19`,width:`11`,height:`8`,rx:`2.6`,fill:`#FFFFFF`}),(0,H.jsx)(`rect`,{x:`17.8`,y:`21.6`,width:`4.6`,height:`1.5`,rx:`0.75`,fill:`#6E4BF7`,fillOpacity:`0.8`}),(0,H.jsx)(`rect`,{x:`17.8`,y:`24.2`,width:`6.4`,height:`1.5`,rx:`0.75`,fill:`#6E4BF7`,fillOpacity:`0.35`})]})}var Nw={profile:`settings`,docs:`settings`,terminals:`settings`,backups:`settings`};function Pw(){let e=window.location.hash.replace(`#`,``).split(`?`)[0]??``,t=Nw[e]??e;return kw(t)?t:`overview`}function Fw(){let[e,t]=(0,v.useState)(Pw),[n,r]=(0,v.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`sidebar`);return e===`collapsed`||e!==`expanded`&&localStorage.getItem(`ylcwf-sidebar`)===`collapsed`}),{mode:i,cycle:a}=jw(),{onboarding:o,loading:s,saving:c,snapshot:l,draft:u,dirty:d,error:f,save:p,discard:m}=oa();(0,v.useEffect)(()=>{let e=()=>t(Pw());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let h=e=>{window.location.hash=e,t(e)};(0,v.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),d&&!c&&p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,c,p]),(0,v.useEffect)(()=>{if(!d)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[d]),(0,v.useEffect)(()=>{localStorage.setItem(`ylcwf-sidebar`,n?`collapsed`:`expanded`)},[n]);let g=Ow;(0,v.useEffect)(()=>{g.some(t=>t.id===e)||t(g[0]?.id??`iterations`)},[e,g]);let _=Ow.find(t=>t.id===e)??Ow[0],y=_?.component??up;return f===null?o===null?(0,H.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(rt,{className:`size-4 animate-spin`}),`正在检测运行环境…`]}):o.nextStep===`ready`?l===null?(0,H.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(rt,{className:`size-4 animate-spin`}),`正在读取配置…`]}):(0,H.jsxs)(`div`,{className:`app-glow flex h-full`,children:[(0,H.jsxs)(`aside`,{className:V(`relative z-10 flex shrink-0 flex-col border-r bg-card/50 backdrop-blur-xl transition-[width] duration-200`,n?`w-[64px]`:`w-56`),children:[(0,H.jsxs)(`div`,{className:V(`flex items-center gap-2.5 py-5`,n?`justify-center px-2`:`px-5`),children:[(0,H.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-lg shadow-sm`,children:(0,H.jsx)(Mw,{})}),n?null:(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 leading-tight`,children:[(0,H.jsx)(`p`,{className:`truncate text-sm font-semibold tracking-tight`,children:`ylcwf`}),(0,H.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,children:`研发工作台`})]})]}),(0,H.jsx)(`nav`,{className:V(`flex-1 space-y-0.5`,n?`px-2`:`px-3`),children:g.map(t=>{let r=t.icon,i=t.id===e;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>h(t.id),title:n?t.label:void 0,className:V(`group relative flex w-full items-center rounded-md py-2 text-sm transition-colors`,n?`justify-center px-0`:`gap-2.5 px-3`,i?`bg-accent font-medium text-accent-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:[i?(0,H.jsx)(`span`,{className:`absolute inset-y-1.5 left-0 w-0.5 rounded-full bg-primary`}):null,(0,H.jsx)(r,{className:`size-4 shrink-0`}),n?null:(0,H.jsx)(`span`,{className:`truncate`,children:t.label})]},t.id)})}),(0,H.jsxs)(`div`,{className:V(`space-y-2 border-t py-3`,n?`px-2`:`px-4`),children:[(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,className:V(`w-full gap-2 text-xs`,n?`justify-center px-0`:`justify-start`),title:Aw[i],onClick:a,children:[i===`system`?(0,H.jsx)(at,{className:`size-3.5`}):i===`dark`?(0,H.jsx)(st,{className:`size-3.5`}):(0,H.jsx)(Lt,{className:`size-3.5`}),n?null:Aw[i]]}),(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,className:V(`w-full gap-2 text-xs`,n?`justify-center px-0`:`justify-start`),title:n?`展开侧边栏`:`收起侧边栏`,onClick:()=>r(e=>!e),children:[n?(0,H.jsx)(pt,{className:`size-3.5`}):(0,H.jsx)(dt,{className:`size-3.5`}),n?null:`收起侧边栏`]})]})]}),(0,H.jsxs)(`main`,{className:`relative z-10 flex min-w-0 flex-1 flex-col`,children:[(0,H.jsxs)(`header`,{className:`flex items-center justify-between gap-4 border-b bg-background/60 px-8 py-4 backdrop-blur-xl`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h1`,{className:`text-base font-semibold tracking-tight`,children:_?.label}),(0,H.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:_?.description})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:d?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,onClick:m,disabled:c,children:[(0,H.jsx)(xt,{className:`size-3.5`}),`放弃更改`]}),(0,H.jsxs)(U,{size:`sm`,onClick:()=>void p(),disabled:c,children:[c?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(Ct,{className:`size-3.5`}),`保存`,(0,H.jsx)(`kbd`,{className:`ml-1 rounded border bg-primary-foreground/15 px-1 font-mono text-[10px]`,children:`⌘S`})]})]}):(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`已同步`})})]}),(0,H.jsx)(`div`,{className:V(`min-h-0 flex-1`,_?.fullHeight===!0?`overflow-hidden`:`overflow-y-auto px-8 py-6`),children:(0,H.jsx)(`div`,{className:V(`mx-auto w-full`,_?.fullHeight===!0?`h-full max-w-none`:V(`animate-fade-up space-y-5`,_?.wide===!0?`max-w-[1600px]`:`max-w-4xl`)),children:(0,H.jsx)(np,{area:_?.label??`页面`,children:(0,H.jsx)(y,{})})},e)})]}),(0,H.jsx)(kn,{position:`bottom-right`,toastOptions:{classNames:{toast:`rounded-lg border bg-card text-card-foreground shadow-lg`}}})]}):(0,H.jsx)(tp,{state:o,onDone:async()=>{window.location.reload()}}):(0,H.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,H.jsx)(jt,{className:`size-6 text-destructive`}),(0,H.jsx)(`p`,{className:`max-w-md text-sm font-medium text-destructive`,children:f}),(0,H.jsxs)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:[`在终端重新执行`,` `,(0,H.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono`,children:`ylcwf serve`}),` `,`后打开它打印的地址。令牌已持久化,正常重启不会让已打开的链接失效。`]}),(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`刷新页面`})]})}var Iw=document.getElementById(`root`);if(Iw===null)throw Error(`缺少 #root 容器`);oa.getState().bootstrap(),(0,y.createRoot)(Iw).render((0,H.jsx)(v.StrictMode,{children:(0,H.jsx)(Fw,{})}));
80
+ `))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return bx(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=FS.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function GS(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&KS(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function KS(e,t){let n=!1;return Sy(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&hh(e)&&(t.options.setext||n))}function qS(){return{exit:{taskListCheckValueChecked:YS,taskListCheckValueUnchecked:YS,paragraph:XS}}}function JS(){return{handlers:{paragraph:ZS},join:[QS]}}function YS(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function XS(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function ZS(e,t,n,r){if(!t||t.type!==`listItem`||$S(t)!==e)return FS.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+FS.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function QS(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=$S(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function $S(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function eC(){return[Fb(),sx(),fx(),IS(),qS()]}function tC(e){return{extensions:[Ib(),cx(e),px(),WS(e),JS()]}}var nC={tokenize:gC,partial:!0},rC={tokenize:_C,partial:!0},iC={tokenize:vC,partial:!0},aC={tokenize:yC,partial:!0},oC={tokenize:bC,partial:!0},sC={name:`wwwAutolink`,tokenize:mC,previous:xC},cC={name:`protocolAutolink`,tokenize:hC,previous:SC},lC={name:`emailAutolink`,tokenize:pC,previous:CC},uC={};function dC(){return{text:uC}}for(var fC=48;fC<123;)uC[fC]=lC,fC++,fC===58?fC=65:fC===91&&(fC=97);uC[43]=lC,uC[45]=lC,uC[46]=lC,uC[95]=lC,uC[72]=[lC,cC],uC[104]=[lC,cC],uC[87]=[lC,sC],uC[119]=[lC,sC];function pC(e,t,n){let r=this,i,a;return o;function o(t){return!wC(t)||!CC.call(r,r.previous)||TC(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return wC(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(oC,u,l)(t):t===45||t===95||Ah(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&kh(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function mC(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!xC.call(r,r.previous)||TC(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nC,e.attempt(rC,e.attempt(iC,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function hC(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&SC.call(r,r.previous)&&!TC(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(kh(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Mh(t)||Ih(t)||Rh(t)||Lh(t)?n(t):e.attempt(rC,e.attempt(iC,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function gC(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function _C(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(aC,c,s)(t):t===null||Ih(t)||Rh(t)||t!==45&&Lh(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function vC(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(aC,t,a)(o):o===null||Ih(o)||Rh(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function yC(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Ih(o)||Rh(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Ih(e)||Rh(e)?t(e):r(e)}function a(e){return kh(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):kh(t)?(e.consume(t),o):n(t)}}function bC(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ah(e)?n(e):t(e)}}function xC(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ih(e)}function SC(e){return!kh(e)}function CC(e){return!(e===47||wC(e))}function wC(e){return e===43||e===45||e===46||e===95||Ah(e)}function TC(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var EC={tokenize:PC,partial:!0};function DC(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jC,continuation:{tokenize:MC},exit:NC}},text:{91:{name:`gfmFootnoteCall`,tokenize:AC},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:OC,resolveTo:kC}}}}function OC(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Oh(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function kC(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function AC(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Ih(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Oh(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Ih(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function jC(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Ih(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Oh(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Ih(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Vh(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function MC(e,t,n){return e.check(ag,t,e.attempt(EC,t,n))}function NC(e){e.exit(`gfmFootnoteDefinition`)}function PC(e,t,n){let r=this;return Vh(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function FC(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&xh(o,o.length,0,Qh(s,e.slice(r+1,n),t)),xh(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),xh(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Zh(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Zh(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var IC=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){LC(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function LC(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function RC(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function zC(){return{flow:{null:{name:`table`,tokenize:BC,resolveAll:VC}}}}function BC(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?Vh(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Ih(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,$(t)?Vh(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return $(t)?Vh(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return $(t)?Vh(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?Vh(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Ih(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function VC(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new IC;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(UC(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=HC(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=HC(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=HC(f,t,o,i,n,d)):(o[0]=o[1],d=HC(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&UC(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=RC(t.events,n))}return e}function HC(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},WC(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=WC(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=WC(t.events,n[2]),a=WC(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},WC(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function UC(e,t,n,r,i){let a=[],o=WC(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function WC(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var GC={name:`tasklistCheck`,tokenize:qC};function KC(){return{text:{91:GC}}}function qC(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Ih(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):$(r)?e.check({tokenize:JC},t,n)(r):n(r)}}function JC(e,t,n){return Vh(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function YC(e){return wh([dC(),DC(),FC(e),zC(),KC()])}var XC={};function ZC(e){let t=this,n=e||XC,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(YC(n)),a.push(eC()),o.push(tC(n))}var QC={muted:`text-muted-foreground`,progress:`text-primary`,warning:`text-warning`,success:`text-success`,destructive:`text-destructive`},$C={muted:`bg-muted-foreground/35`,progress:`bg-primary`,warning:`bg-warning`,success:`bg-success`,destructive:`bg-destructive`},ew=[{key:`未开始`,label:`未开始`,icon:he,tone:`muted`},{key:`进行中`,label:`进行中`,icon:_e,tone:`progress`},{key:`待验收`,label:`待验收`,icon:De,tone:`warning`},{key:`已完成`,label:`已完成`,icon:I,tone:`success`}],tw=[{key:`未开始`,label:`未开始`,icon:he,tone:`muted`},{key:`进行中`,label:`进行中`,icon:_e,tone:`progress`},{key:`已完成`,label:`已完成`,icon:I,tone:`success`}],nw=[{key:`通过`,label:`通过`,icon:I,tone:`success`},{key:`免测`,label:`免测`,icon:ye,tone:`muted`},{key:`未执行`,label:`未执行`,icon:he,tone:`warning`},{key:`失败`,label:`失败`,icon:Ce,tone:`destructive`}],rw=[{key:`待验收`,label:`待验收`,icon:De,tone:`warning`},{key:`验收通过`,label:`通过`,icon:I,tone:`success`},{key:`验收驳回`,label:`驳回`,icon:Ce,tone:`destructive`}];function iw(e){return e??{}}function aw(e,t){let n=iw(e),r=new Set(t.map(e=>e.key)),i=Object.keys(n).filter(e=>!r.has(e)).sort().map(e=>({key:e,label:e,icon:xe,tone:`muted`}));return[...t,...i]}function ow(e,t){let n=iw(e),r=t.reduce((e,t)=>e+(n[t.key]??0),0);return r===0?[]:t.map(e=>({tone:e.tone,width:(n[e.key]??0)/r*100})).filter(e=>e.width>0)}function sw({counts:e,defs:t,className:n}){let r=iw(e),i=ow(r,aw(r,t));return(0,H.jsx)(`div`,{className:V(`flex h-1.5 w-full overflow-hidden rounded-full bg-border/70`,n),children:i.length===0?null:i.map((e,t)=>(0,H.jsx)(`div`,{className:V(`h-full`,$C[e.tone]),style:{width:`${e.width}%`}},`${e.tone}-${t}`))})}function cw({label:e,icon:t,counts:n,defs:r}){let i=iw(n),a=aw(i,r),o=a.reduce((e,t)=>e+(i[t.key]??0),0);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 py-1.5 sm:flex-row sm:items-center sm:gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex w-24 shrink-0 items-center gap-1.5 text-[11px] font-medium text-muted-foreground`,children:[(0,H.jsx)(t,{className:`size-3.5`}),e]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1`,children:[a.map(e=>{let t=i[e.key]??0;return(0,H.jsxs)(`span`,{className:V(`flex items-center gap-1 text-[11px]`,t===0?`text-muted-foreground/45`:`text-foreground`),title:`${e.label}:${t}`,children:[(0,H.jsx)(e.icon,{className:V(`size-3`,t===0?`text-muted-foreground/45`:QC[e.tone])}),(0,H.jsx)(`span`,{children:e.label}),(0,H.jsx)(`span`,{className:`font-mono tabular-nums`,children:t})]},e.key)}),o===0?(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:`暂无数据`}):null]}),(0,H.jsx)(`div`,{className:`w-full shrink-0 sm:w-32`,children:(0,H.jsx)(sw,{counts:i,defs:r})})]})}function lw({taskCounts:e,requirementCounts:t,selfTestCounts:n,acceptanceCounts:r}){return(0,H.jsxs)(`div`,{className:`divide-y`,children:[(0,H.jsx)(cw,{label:`需求状态`,icon:Te,counts:t,defs:tw}),(0,H.jsx)(cw,{label:`任务状态`,icon:tt,counts:e,defs:ew}),(0,H.jsx)(cw,{label:`AI 自测`,icon:ae,counts:n,defs:nw}),(0,H.jsx)(cw,{label:`人工验收`,icon:Ut,counts:r,defs:rw})]})}function uw(e){let t=e.trim();return t.length===0?`未执行`:t.startsWith(`免测`)?`免测`:t}function dw(e){let t=e.trim();return t.length===0?`待验收`:t}function fw(e,t){let n={};for(let r of e){let e=t(r).trim(),i=e.length===0?`未知`:e;n[i]=(n[i]??0)+1}return n}function pw(e){let t=new Date(e).getTime();if(Number.isNaN(t))return`—`;let n=Date.now()-t,r=6e4,i=60*r,a=24*i;return n<r?`刚刚`:n<i?`${Math.floor(n/r)} 分钟前`:n<a?`${Math.floor(n/i)} 小时前`:n<7*a?`${Math.floor(n/a)} 天前`:new Date(e).toLocaleDateString(`zh-CN`)}function mw({value:e}){return(0,H.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-border`,children:(0,H.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-all`,style:{width:`${Math.max(0,Math.min(100,e))}%`}})})}function hw({status:e}){let t=Qi[e]??`muted`;return(0,H.jsx)(W,{variant:t,children:e.length===0?`—`:e})}function gw({value:e}){if(e.length===0)return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});if(e.startsWith(`免测`)){let t=e.replace(/^免测\s*[((]/,``).replace(/[))]$/,``);return(0,H.jsx)(W,{variant:`warning`,title:t.length>0?`免测:${t}`:`免测`,children:`免测`})}return e===`通过`?(0,H.jsx)(W,{variant:`success`,children:`通过`}):e===`失败`?(0,H.jsx)(W,{variant:`destructive`,children:`失败`}):(0,H.jsx)(W,{variant:`muted`,children:e})}function _w({value:e}){return e.length===0?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):(0,H.jsx)(W,{variant:e===`验收通过`?`success`:e===`验收驳回`?`destructive`:`warning`,children:e.replace(/^验收/,``)})}function vw({summary:e,active:t,onSelect:n}){return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,H.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:[`开发者(`,e.developers.length,`)`]}),(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`任务 `,e.totals.tasks]})]}),e.developers.map(e=>{let r=e.stats.tasks===0?0:Math.round(e.stats.completedTasks/e.stats.tasks*100);return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:V(`w-full rounded-lg border px-3 py-3 text-left transition-all`,e.id===t?`border-primary/50 bg-primary/5 shadow-sm`:`bg-card hover:border-border hover:bg-accent/40`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,H.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium uppercase`,children:e.id.slice(0,2)}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.id}),(0,H.jsx)(W,{variant:`muted`,children:Yi[e.roleInferred]})]}),(0,H.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[pw(e.mtime),` 更新`]})]})]}),(0,H.jsxs)(`div`,{className:`mt-2.5 space-y-1.5`,children:[(0,H.jsx)(mw,{value:r}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,H.jsxs)(`span`,{children:[e.stats.completedTasks,`/`,e.stats.tasks,` 完成 · `,r,`%`]}),(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[e.errors>0?(0,H.jsxs)(`span`,{className:`text-destructive`,children:[e.errors,` error`]}):null,e.warnings>0?(0,H.jsxs)(`span`,{className:`text-warning`,children:[e.warnings,` warn`]}):null,e.parser===`fallback`?(0,H.jsx)(`span`,{className:`text-warning`,children:`未校验`}):null]})]})]})]},e.id)})]})}function yw({summary:e,onOpenTask:t,onSelectDeveloper:n}){let{totals:r}=e;return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-4`,children:[{label:`开发者`,value:r.developers},{label:`需求`,value:r.requirements},{label:`任务`,value:r.tasks,hint:`${r.completedTasks} 已完成`},{label:`整体进度`,value:`${r.progress}%`}].map(e=>(0,H.jsx)(ji,{className:`gap-0 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,H.jsx)(`p`,{className:`text-xl font-semibold tracking-tight`,children:e.value}),e.hint===void 0?null:(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.hint})]})},e.label))}),(0,H.jsx)(ji,{className:`gap-3 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(se,{className:`size-4 text-muted-foreground`}),`状态分布`,(0,H.jsx)(`span`,{className:`text-[11px] font-normal text-muted-foreground`,children:`按当前迭代全部成员聚合`})]}),(0,H.jsx)(lw,{taskCounts:r.taskStatusCounts,requirementCounts:r.requirementStatusCounts,selfTestCounts:r.selfTestCounts,acceptanceCounts:r.acceptanceCounts})]})}),(0,H.jsx)(ji,{className:`gap-3 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(qt,{className:`size-4 text-muted-foreground`}),`成员进度`,(0,H.jsx)(`span`,{className:`text-[11px] font-normal text-muted-foreground`,children:`点击成员可查看其任务`})]}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border`,children:(0,H.jsxs)(`table`,{className:`w-full min-w-[560px] text-left text-xs`,children:[(0,H.jsx)(`thead`,{className:`bg-muted/50 text-muted-foreground`,children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`开发者`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`角色`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`需求`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`任务`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`进度`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`问题`})]})}),(0,H.jsx)(`tbody`,{children:e.developers.map(e=>{let t=e.stats.tasks===0?0:Math.round(e.stats.completedTasks/e.stats.tasks*100);return(0,H.jsxs)(`tr`,{tabIndex:0,role:`button`,onClick:()=>n(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.id))},className:`cursor-pointer border-t transition-colors hover:bg-accent/40 focus:bg-accent/40 focus:outline-none`,children:[(0,H.jsx)(`td`,{className:`px-3 py-2 font-medium`,children:e.id}),(0,H.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:Yi[e.roleInferred]}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:e.stats.requirements}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:e.stats.tasks}),(0,H.jsx)(`td`,{className:`w-48 px-3 py-2`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(sw,{counts:e.statusCounts,defs:ew,className:`h-1.5`}),(0,H.jsxs)(`span`,{className:`w-8 shrink-0 text-right font-mono text-[11px] text-muted-foreground`,children:[t,`%`]})]})}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:e.errors===0&&e.warnings===0?(0,H.jsx)(`span`,{className:`text-success`,children:`—`}):(0,H.jsxs)(`span`,{className:`space-x-1.5`,children:[e.errors>0?(0,H.jsxs)(`span`,{className:`text-destructive`,children:[e.errors,`E`]}):null,e.warnings>0?(0,H.jsxs)(`span`,{className:`text-warning`,children:[e.warnings,`W`]}):null]})})]},e.id)})})]})})]})}),(0,H.jsx)(ji,{className:`gap-3 py-4`,children:(0,H.jsxs)(Mi,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(Vt,{className:`size-4 text-warning`}),`被阻塞的任务(`,e.blocked.length,`)`]}),e.blocked.length===0?(0,H.jsx)(`p`,{className:`rounded-lg border border-success/25 bg-success/8 px-3 py-2 text-xs text-success`,children:`没有被阻塞的任务`}):(0,H.jsx)(`ul`,{className:`max-h-80 space-y-1.5 overflow-y-auto pr-1`,children:e.blocked.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>t(e.developer,e.taskId),title:`点击查看任务详情`,className:`flex w-full flex-col gap-1 rounded-lg bg-muted/50 px-3 py-2 text-left text-xs transition-colors hover:bg-accent/60`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(W,{variant:`muted`,children:e.developer}),(0,H.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),(0,H.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.taskId})]}),(e.blocking??[]).length===0?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 pl-0.5 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(De,{className:`size-3 shrink-0`}),(0,H.jsx)(`span`,{children:`等待前置任务完成:`}),(e.blocking??[]).map(e=>(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono`,children:[e.id,(0,H.jsx)(`span`,{className:`rounded bg-warning/12 px-1 py-0.5 font-sans text-warning`,children:e.status})]},e.id))]})]})},`${e.developer}-${e.taskId}`))})]})})]})}function bw({validation:e}){let t=e.iterationInfo,n=[{label:`迭代版本`,value:t.迭代版本},{label:`负责人`,value:t.负责人},{label:`负责范围`,value:t.负责范围},{label:`PRD`,value:t[`PRD 来源`],link:!0}].filter(e=>(e.value??``).length>0);return(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[n.map(e=>(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-3.5 py-2.5`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.label}),e.link===!0&&e.value!==void 0?(0,H.jsx)(`a`,{href:e.value,target:`_blank`,rel:`noreferrer`,className:`mt-0.5 block truncate text-xs text-primary underline-offset-2 hover:underline`,children:e.value}):(0,H.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:e.value})]},e.label)),e.iterationInfo.排期计划===void 0?null:(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 px-3.5 py-2.5 sm:col-span-2 lg:col-span-4`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`排期计划`}),(0,H.jsx)(`p`,{className:`mt-0.5 text-xs`,children:e.iterationInfo.排期计划})]})]})}function xw({validation:e}){let t=[...e.errors,...e.warnings];return t.length===0?null:(0,H.jsx)(`div`,{className:`space-y-1.5`,children:t.map((e,t)=>(0,H.jsxs)(`div`,{className:V(`flex items-start gap-2 rounded-lg border px-3 py-2 text-xs`,e.level===`error`?`border-destructive/25 bg-destructive/6 text-destructive`:`border-warning/30 bg-warning/8 text-warning`),children:[(0,H.jsx)(Vt,{className:`mt-0.5 size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`leading-snug`,children:e.message})]},`${e.code}-${t}`))})}var Sw={start:`开始实施`,submit:`提交验收`,accept:`验收通过`,reject:`验收驳回`},Cw={start:{status:`进行中`,acceptance:null},submit:{status:`待验收`,acceptance:null},accept:{status:`已完成`,acceptance:`验收通过`},reject:{status:`进行中`,acceptance:`验收驳回`}};function ww({validation:e,onOpenDetail:t,editable:n,actions:r,actingTaskId:i,onAction:a,onBatchAction:o}){let[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(`all`),[p,m]=(0,v.useState)(`all`),[h,g]=(0,v.useState)(`all`),[_,y]=(0,v.useState)(``),b=(0,v.useMemo)(()=>Array.from(new Set(e.tasks.map(e=>e.status).filter(e=>e.length>0))),[e.tasks]),x=(0,v.useMemo)(()=>Array.from(new Set(e.tasks.map(e=>e.type).filter(e=>e.length>0))),[e.tasks]),S=e.tasks.filter(e=>{if(d!==`all`&&e.status!==d||p!==`all`&&e.type!==p||h!==`all`&&e.requirementId!==h)return!1;if(_.trim().length>0){let t=_.trim().toLowerCase();if(!`${e.id} ${e.name} ${e.terminal}`.toLowerCase().includes(t))return!1}return!0});return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(Tt,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(Ni,{value:_,placeholder:`搜索任务编号 / 名称 / 终端`,className:`h-8 w-56 pl-8 text-xs`,onChange:e=>y(e.target.value)})]}),(0,H.jsxs)(qf,{value:d,onValueChange:f,children:[(0,H.jsx)(Yf,{className:`h-8 w-32 text-xs`,children:(0,H.jsx)(Jf,{})}),(0,H.jsxs)(Xf,{children:[(0,H.jsx)(Zf,{value:`all`,children:`全部状态`}),b.map(e=>(0,H.jsx)(Zf,{value:e,children:e},e))]})]}),(0,H.jsxs)(qf,{value:p,onValueChange:m,children:[(0,H.jsx)(Yf,{className:`h-8 w-32 text-xs`,children:(0,H.jsx)(Jf,{})}),(0,H.jsxs)(Xf,{children:[(0,H.jsx)(Zf,{value:`all`,children:`全部类型`}),x.map(e=>(0,H.jsx)(Zf,{value:e,children:e},e))]})]}),(0,H.jsxs)(qf,{value:h,onValueChange:g,children:[(0,H.jsx)(Yf,{className:`h-8 w-56 text-xs`,children:(0,H.jsx)(Jf,{})}),(0,H.jsxs)(Xf,{children:[(0,H.jsx)(Zf,{value:`all`,children:`全部需求`}),e.requirements.map(e=>(0,H.jsxs)(Zf,{value:e.id,children:[e.id,` `,e.title]},e.id))]})]}),(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[S.length,`/`,e.tasks.length]}),n&&s.length>0?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-primary/30 bg-primary/5 px-2.5 py-1.5`,children:[(0,H.jsxs)(`span`,{className:`text-[11px] text-primary`,children:[`已选 `,s.length,` 项`]}),(0,H.jsx)(U,{size:`sm`,className:`h-6 px-2 text-[11px]`,onClick:()=>u({kind:`batch`,taskIds:[...s],action:`accept`}),children:`批量验收通过`}),(0,H.jsx)(U,{size:`sm`,variant:`outline`,className:`h-6 px-2 text-[11px]`,onClick:()=>u({kind:`batch`,taskIds:[...s],action:`reject`}),children:`批量驳回`}),(0,H.jsx)(U,{size:`sm`,variant:`ghost`,className:`h-6 px-2 text-[11px]`,onClick:()=>c([]),children:`清空`})]}):null]}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border`,children:(0,H.jsxs)(`table`,{className:`w-full min-w-[760px] table-fixed text-left text-xs`,children:[(0,H.jsx)(`thead`,{className:`bg-muted/50 text-muted-foreground`,children:(0,H.jsxs)(`tr`,{children:[n?(0,H.jsx)(`th`,{className:`w-[32px] px-1.5 py-2`}):null,(0,H.jsx)(`th`,{className:`w-[76px] whitespace-nowrap px-2 py-2 font-medium`,children:`编号`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`任务名称`}),(0,H.jsx)(`th`,{className:`hidden w-[76px] whitespace-nowrap px-2.5 py-2 font-medium 2xl:table-cell`,children:`类型`}),(0,H.jsx)(`th`,{className:`w-[76px] whitespace-nowrap px-2 py-2 font-medium`,children:`终端`}),(0,H.jsx)(`th`,{className:`w-[80px] whitespace-nowrap px-2 py-2 font-medium`,children:`AI自测状态`}),(0,H.jsx)(`th`,{className:`w-[88px] whitespace-nowrap px-2 py-2 font-medium`,children:`开发人工验收`}),(0,H.jsx)(`th`,{className:`w-[80px] whitespace-nowrap px-2 py-2 font-medium`,children:`任务状态`}),(0,H.jsx)(`th`,{className:`hidden w-[112px] whitespace-nowrap px-2 py-2 font-medium 2xl:table-cell`,children:`最后更新`}),n?(0,H.jsx)(`th`,{className:`sticky right-0 z-20 w-[148px] whitespace-nowrap border-l bg-muted px-2 py-2 font-medium`,children:`操作`}):null]})}),(0,H.jsxs)(`tbody`,{children:[S.map(e=>(0,H.jsxs)(`tr`,{className:`group cursor-pointer border-t transition-colors hover:bg-accent/40`,onClick:()=>t(e.id),children:[n?(0,H.jsx)(`td`,{className:`px-2 py-2`,onClick:e=>e.stopPropagation(),children:(0,H.jsx)(`input`,{type:`checkbox`,className:`size-3.5 accent-primary`,checked:s.includes(e.id),onChange:t=>c(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id))})}):null,(0,H.jsx)(`td`,{className:`whitespace-nowrap px-2.5 py-2 font-mono text-[11px]`,children:e.id}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:(0,H.jsx)(`div`,{className:`truncate`,title:e.name,children:e.name})}),(0,H.jsx)(`td`,{className:`hidden px-2.5 py-2 text-muted-foreground 2xl:table-cell`,children:(0,H.jsx)(`div`,{className:`truncate`,title:e.type,children:e.type})}),(0,H.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:(0,H.jsx)(`div`,{className:`truncate`,title:e.terminal,children:e.terminal})}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:(0,H.jsx)(gw,{value:e.selfTest})}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:(0,H.jsx)(_w,{value:e.acceptance})}),(0,H.jsx)(`td`,{className:`px-2.5 py-2`,children:(0,H.jsx)(hw,{status:e.status})}),(0,H.jsx)(`td`,{className:`hidden whitespace-nowrap px-2 py-2 font-mono text-[11px] text-muted-foreground 2xl:table-cell`,children:e.updatedAt}),n?(0,H.jsx)(`td`,{className:`sticky right-0 z-10 border-l bg-card px-2.5 py-2 group-hover:bg-accent`,onClick:e=>e.stopPropagation(),children:(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(r[e.id]??[]).map(t=>(0,H.jsxs)(U,{size:`sm`,variant:t.action===`accept`?`default`:(t.action,`outline`),className:V(`h-6 whitespace-nowrap px-2 text-[11px]`,t.action===`reject`?`text-destructive hover:text-destructive`:``),disabled:t.enabled===!1||i===e.id,title:t.enabled===!1?t.reason:``,onClick:()=>u({kind:`single`,taskId:e.id,action:t.action}),children:[i===e.id?(0,H.jsx)(rt,{className:`size-3 animate-spin`}):null,Sw[t.action]]},t.action)),(r[e.id]??[]).length===0?(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`—`}):null]})}):null]},e.id)),S.length===0?(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:n?9:7,className:`px-3 py-8 text-center text-muted-foreground`,children:`没有符合条件的任务`})}):null]})]})}),(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`点击任意行查看任务详情。`}),(0,H.jsx)(Hf,{open:l!==null,onOpenChange:e=>e?void 0:u(null),children:(0,H.jsxs)(Uf,{className:`max-w-md`,children:[(0,H.jsxs)(Wf,{children:[(0,H.jsxs)(Y,{children:[`确认`,l===null?``:l.kind===`batch`?`批量「${Sw[l.action]}」`:`「${Sw[l.action]}」`,`?`]}),(0,H.jsx)(Gf,{children:l?.kind===`single`?e.tasks.find(e=>e.id===l.taskId)?.name??l.taskId:l===null?``:`将对 ${l.taskIds.length} 个任务执行该动作`})]}),l===null?null:(0,H.jsxs)(`div`,{className:`space-y-1.5 rounded-lg bg-muted/50 px-3 py-2.5 text-xs`,children:[(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`任务状态:`,l.kind===`single`?`${e.tasks.find(e=>e.id===l.taskId)?.status??`—`} → ${Cw[l.action].status}`:`→ ${Cw[l.action].status}`]}),Cw[l.action].acceptance===null?null:(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`开发人工验收:`,l.kind===`single`?`${e.tasks.find(e=>e.id===l.taskId)?.acceptance??`—`} → ${Cw[l.action].acceptance}`:`→ ${Cw[l.action].acceptance}`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`所属需求的状态与进度会同步重算,写入后可执行 git diff 核对。`})]}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>u(null),children:`取消`}),(0,H.jsx)(U,{size:`sm`,variant:l?.action===`reject`?`destructive`:`default`,onClick:()=>{l!==null&&(l.kind===`single`?a(l.taskId,l.action):(o(l.taskIds,l.action),c([])),u(null))},children:`确认执行`})]})]})})]})}function Tw({validation:e}){let[t,n]=(0,v.useState)(`all`),[r,i]=(0,v.useState)(``),a=(0,v.useMemo)(()=>Array.from(new Set(e.requirements.map(e=>e.terminal).filter(e=>e.length>0))),[e.requirements]),o=e.requirements.filter(e=>{if(t!==`all`&&e.terminal!==t)return!1;if(r.trim().length>0){let t=r.trim().toLowerCase().replace(/^#/,``);if(!`${e.id.replace(/^#/,``)} ${e.title}`.toLowerCase().includes(t))return!1}return!0});return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(Tt,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(Ni,{value:r,placeholder:`搜索需求编号 / 名称`,className:`h-8 w-52 pl-8 text-xs`,onChange:e=>i(e.target.value)})]}),(0,H.jsxs)(qf,{value:t,onValueChange:n,children:[(0,H.jsx)(Yf,{className:`h-8 w-40 text-xs`,children:(0,H.jsx)(Jf,{})}),(0,H.jsxs)(Xf,{children:[(0,H.jsx)(Zf,{value:`all`,children:`全部终端`}),a.map(e=>(0,H.jsx)(Zf,{value:e,children:e},e))]})]}),(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[o.length,`/`,e.requirements.length]})]}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border`,children:(0,H.jsxs)(`table`,{className:`w-full min-w-[760px] table-fixed text-left text-xs`,children:[(0,H.jsx)(`thead`,{className:`bg-muted/50 text-muted-foreground`,children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:`w-[76px] whitespace-nowrap px-2 py-2 font-medium`,children:`编号`}),(0,H.jsx)(`th`,{className:`w-[26%] px-3 py-2 font-medium`,children:`需求名称`}),(0,H.jsx)(`th`,{className:`w-[76px] whitespace-nowrap px-2 py-2 font-medium`,children:`终端`}),(0,H.jsx)(`th`,{className:`w-[104px] whitespace-nowrap px-3 py-2 font-medium`,children:`状态`}),(0,H.jsx)(`th`,{className:`w-[72px] whitespace-nowrap px-3 py-2 font-medium`,children:`进度`}),(0,H.jsx)(`th`,{className:`w-[136px] whitespace-nowrap px-3 py-2 font-medium`,children:`分端`}),(0,H.jsx)(`th`,{className:`w-[120px] whitespace-nowrap px-2 py-2 font-medium`,children:`最后更新`}),(0,H.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`备注`})]})}),(0,H.jsxs)(`tbody`,{children:[o.map(t=>{let n=e.tasks.filter(e=>e.requirementId===t.id),r=n.length>0&&n.every(e=>e.status===`待验收`)&&t.status!==`已完成`,i=e=>{let t=n.filter(t=>t.scope===e);return{done:t.filter(e=>e.status===`已完成`).length,total:t.length}},a=i(`前端`),o=i(`后端`),s=a.total>0&&o.total>0;return(0,H.jsxs)(`tr`,{className:`border-t`,children:[(0,H.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 font-mono text-[11px]`,children:t.id}),(0,H.jsx)(`td`,{className:`px-3 py-2`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`truncate`,title:t.title,children:t.title}),r?(0,H.jsx)(W,{variant:`warning`,children:`待人工验收`}):null]})}),(0,H.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:(0,H.jsx)(`div`,{className:`truncate`,title:t.terminal,children:t.terminal})}),(0,H.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2`,children:(0,H.jsx)(hw,{status:t.status})}),(0,H.jsxs)(`td`,{className:`whitespace-nowrap px-3 py-2`,children:[t.progress,`%`]}),(0,H.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2`,children:s?(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`前端 `,a.done,`/`,a.total,` · 后端 `,o.done,`/`,o.total]}):(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,H.jsx)(`td`,{className:`whitespace-nowrap px-2 py-2 font-mono text-[11px] text-muted-foreground`,children:t.updatedAt}),(0,H.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:(0,H.jsx)(`div`,{className:`truncate`,title:t.note,children:t.note.length===0?`—`:t.note})})]},t.id)}),o.length===0?(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:6,className:`px-3 py-8 text-center text-muted-foreground`,children:`没有符合条件的需求`})}):null]})]})})]})}function Ew({doc:e,developer:t,onOpenDetail:n,editable:r,actions:i,actingTaskId:a,onAction:o,onBatchAction:s}){let{validation:c}=e,l=c.stats.tasks===0?0:Math.round(c.stats.completedTasks/c.stats.tasks*100);return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Fe,{className:`size-4 text-muted-foreground`}),(0,H.jsxs)(`span`,{className:`text-sm font-medium`,children:[e.developer,`.md`]}),(0,H.jsx)(W,{variant:`muted`,children:Yi[e.roleInferred]}),e.source===`remote`?(0,H.jsxs)(W,{variant:`secondary`,children:[(0,H.jsx)(ke,{className:`size-3`}),`远程 `,e.ref?.sha.slice(0,7)??``]}):(0,H.jsxs)(W,{variant:`muted`,children:[(0,H.jsx)(qe,{className:`size-3`}),`本地`]}),e.parser===`fallback`?(0,H.jsx)(W,{variant:`warning`,children:`降级解析`}):null]}),(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[pw(e.mtime),` 更新`]})]}),e.parser===`fallback`?(0,H.jsx)(cp,{children:`当前环境未找到 python3 或文档仓库缺少 scripts/validate_task_doc.py,已使用降级解析:数据仅供参考, 未经校验器校验。建议安装 Python 3 后刷新。`}):null,(0,H.jsx)(bw,{validation:c}),(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-4`,children:[{label:`需求`,value:c.stats.requirements},{label:`任务`,value:c.stats.tasks},{label:`已完成`,value:c.stats.completedTasks},{label:`进度`,value:`${l}%`}].map(e=>(0,H.jsxs)(`div`,{className:`rounded-lg border px-3.5 py-2.5`,children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,H.jsx)(`p`,{className:`mt-0.5 text-lg font-semibold tracking-tight`,children:e.value})]},e.label))}),(0,H.jsx)(mw,{value:l}),(0,H.jsx)(`div`,{className:`rounded-lg border px-4 py-2`,children:(0,H.jsx)(lw,{taskCounts:fw(c.tasks,e=>e.status),requirementCounts:fw(c.requirements,e=>e.status),selfTestCounts:fw(c.tasks,e=>uw(e.selfTest)),acceptanceCounts:fw(c.tasks,e=>dw(e.acceptance))})}),(0,H.jsx)(xw,{validation:c}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(pe,{className:`size-3.5 text-muted-foreground`}),`需求清单`,(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:c.requirements.length})]}),(0,H.jsx)(Tw,{validation:c})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(pe,{className:`size-3.5 text-muted-foreground`}),`任务清单`,(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:c.tasks.length})]}),(0,H.jsx)(ww,{validation:c,onOpenDetail:n,editable:r,actions:i,actingTaskId:a,onAction:o,onBatchAction:s})]})]})}function Dw(){let e=new URLSearchParams(window.location.search),t=oa(e=>e.snapshot),n=t?.config?.profile.developer??``,r=e.get(`tab`),i=r===`doc`||r===`overview`?r:`doc`,a=e.get(`dev`),o=e.get(`task`),s=e.get(`source`)===`remote`?`remote`:`local`,[c,l]=(0,v.useState)(s),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)([]),[x,S]=(0,v.useState)(e.get(`ref`)),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(null),[D,O]=(0,v.useState)(null),[k,A]=(0,v.useState)(null),[j,M]=(0,v.useState)(a),[N,ee]=(0,v.useState)(null),[F,te]=(0,v.useState)(i),[ne,re]=(0,v.useState)(!1),[ie,ae]=(0,v.useState)(null),[oe,se]=(0,v.useState)(null),ce=t!==null&&(t.meta.features??[]).includes(`status-breakdown`)===!1,[le,ue]=(0,v.useState)(0),de=(0,v.useRef)(null),fe=(0,v.useRef)(o),pe=(0,v.useRef)(Date.now()),me=(0,v.useRef)(null),I=async(e,t={})=>{let n=t.silent===!0;n||re(!0),ae(null);try{let t=e===`remote`?x??void 0:void 0,[n,r,i]=await Promise.all([G.listIterations(e,t),G.gitStatus(),G.gitBranches().catch(()=>null)]);E(n),d(r),p(i),O(e=>n.iterations.some(t=>t.name===e)?e:n.iterations[0]?.name??null),n.iterations.length===0&&(O(null),A(null),ee(null),se(null))}catch(e){E(null),ae(e instanceof Error?e.message:String(e))}finally{n||re(!1)}};(0,v.useEffect)(()=>{I(c)},[c,x]),(0,v.useEffect)(()=>{let e=new URL(window.location.href);c===`remote`?(e.searchParams.set(`source`,`remote`),x===null?e.searchParams.delete(`ref`):e.searchParams.set(`ref`,x)):e.searchParams.delete(`ref`),window.history.replaceState(null,``,e)},[c,x]),(0,v.useEffect)(()=>{if(D===null)return;let e=!1;return re(!0),ae(null),G.iterationSummary(D,c,c===`remote`?x??void 0:void 0).then(t=>{e||(A(t),M(e=>t.developers.some(t=>t.id===e)?e:(n.length===0?void 0:t.developers.find(e=>e.id===n))?.id??t.developers[0]?.id??null))}).catch(t=>{e||(A(null),ae(t instanceof Error?t.message:String(t)))}).finally(()=>{e||re(!1)}),()=>{e=!0}},[D,c,x,le,n]),(0,v.useEffect)(()=>{if(D===null||j===null)return;let e=!1;return G.iterationDoc(D,j,c,c===`remote`?x??void 0:void 0).then(t=>{if(e)return;ee(t);let n=de.current??fe.current;if(n!==null){let e=t.details.find(e=>e.id===n||e.id===n.replace(/^#/,``));e!==void 0&&se(e),de.current=null,fe.current=null}else se(e=>e===null?null:t.details.find(t=>t.id===e.id||t.id===e.id.replace(/^#/,``))??e)}).catch(t=>{e||(ee(null),ae(t instanceof Error?t.message:String(t)))}),()=>{e=!0}},[D,j,c,x,le]),(0,v.useEffect)(()=>{let e=()=>{if(document.visibilityState!==`visible`)return;let e=Date.now();e-pe.current<5e3||(pe.current=e,I(c,{silent:!0}),ue(e=>e+1))};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[c]);let L=c===`local`&&j!==null&&n.length>0&&j===n&&m?.editable===!0;(0,v.useEffect)(()=>{if(D===null||j===null||j!==n||c!==`local`){h(null);return}let e=!1;return G.taskActions(D,j).then(t=>{e||h(t)}).catch(()=>{e||h(null)}),()=>{e=!0}},[D,j,c,le,N,n]);let he=async()=>{await I(c,{silent:!0}),ue(e=>e+1)},ge=async(e,t)=>{if(D!==null&&j!==null){_(e);try{let n=await G.taskAction(D,j,e,t);mn.success(n.message,{description:n.changes.slice(0,3).join(`;`)}),await he()}catch(e){mn.error(`操作失败`,{description:e instanceof Error?e.message:String(e)})}finally{_(null)}}},_e=async(e,t)=>{if(D!==null&&j!==null&&e.length!==0){_(e[0]??null);try{let n=await G.taskBatch(D,j,e,t);mn.success(n.message,{description:n.changes.slice(0,3).join(`;`)}),await he()}catch(e){mn.error(`批量操作失败`,{description:e instanceof Error?e.message:String(e)})}finally{_(null)}}},ve=async()=>{w(!0);try{let e=await G.gitFetch();e.ok&&await I(c),ae(e.ok?null:e.message)}catch(e){ae(e instanceof Error?e.message:String(e))}finally{w(!1)}};(0,v.useEffect)(()=>{let e=Number.parseInt(new URLSearchParams(window.location.search).get(`scroll`)??`0`,10);if(!Number.isFinite(e)||e<=0)return;let t=setTimeout(()=>{me.current!==null&&(me.current.scrollTop=e)},300);return()=>clearTimeout(t)},[N,F]);let ye=k?.developers.find(e=>e.id===j),be=(e,t)=>{if(e===j){let e=N?.details.find(e=>e.id===t||e.id===t.replace(/^#/,``));e!==void 0&&se(e)}else de.current=t,M(e)};(0,v.useEffect)(()=>{if(oe===null||D===null||j===null){b([]);return}let e=!1;return G.taskHistory(D,j,oe.id).then(t=>{e||b(t)}).catch(()=>{e||b([])}),()=>{e=!0}},[oe,D,j,le]);let xe=k?.blocked.find(e=>e.taskId===oe?.id)?.blocking??[],Se=e=>{let t=N?.details.find(t=>t.id===e||t.id===e.replace(/^#/,``));se(t??null)},Ce=()=>(0,H.jsx)(`div`,{className:`shrink-0 border-b bg-background px-8 py-3`,children:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1 rounded-lg border p-0.5`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>l(`local`),title:`读取当前工作区的文档文件`,className:V(`flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs transition-colors`,c===`local`?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:[(0,H.jsx)(qe,{className:`size-3`}),`本地`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>l(`remote`),disabled:u!==null&&!u.hasRemote,title:`读取 git 提交快照:不 pull、不 checkout、不改动工作区`,className:V(`flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs transition-colors`,c===`remote`?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`,u!==null&&!u.hasRemote?`cursor-not-allowed opacity-40`:``),children:[(0,H.jsx)(ke,{className:`size-3`}),`远程`]})]}),c===`local`?(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs text-muted-foreground`,title:f?.dirty===!0?`工作区有未提交改动`:`当前检出分支`,children:[(0,H.jsx)(Ge,{className:`size-3`}),(0,H.jsx)(`span`,{className:`max-w-56 truncate font-mono text-[11px]`,children:f===null?`…`:f.current??`detached HEAD`}),f?.dirty===!0?(0,H.jsx)(`span`,{className:`size-1.5 rounded-full bg-warning`}):null]}):null,c===`remote`&&f!==null&&f.remote.length>0?(0,H.jsxs)(qf,{value:x??f.upstream??f.remote[0]??``,onValueChange:e=>S(e),children:[(0,H.jsx)(Yf,{className:`h-9 w-64 text-xs`,title:`选择远程分支(只读快照,不改工作区)`,children:(0,H.jsx)(`span`,{className:`truncate font-mono text-[11px]`,children:x??f.upstream??f.remote[0]??`选择远程分支`})}),(0,H.jsx)(Xf,{children:f.remote.map(e=>(0,H.jsxs)(Zf,{value:e,children:[e,e===f.upstream?`(当前上游)`:``]},e))})]}):null,T===null||T.iterations.length===0?null:(0,H.jsxs)(qf,{value:D??``,onValueChange:e=>O(e),children:[(0,H.jsx)(Yf,{className:`h-9 w-64 text-sm`,children:(0,H.jsx)(Jf,{placeholder:`选择迭代`})}),(0,H.jsx)(Xf,{children:T.iterations.map(e=>(0,H.jsxs)(Zf,{value:e.name,children:[e.name,`(`,e.developers.length,` 人)`]},e.name))})]}),(0,H.jsx)(U,{variant:`outline`,size:`icon`,onClick:()=>void I(c),disabled:ne,title:c===`local`?`重新扫描工作区(不联网):IDE 里改过文档、终端切过分支后点这里`:`重新读取本地保存的远程快照(不联网);要拉取远端最新提交请用「同步远程」`,"aria-label":c===`local`?`重新扫描工作区`:`重新读取远程快照`,children:ne?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(_t,{className:`size-3.5`})}),c===`remote`?(0,H.jsxs)(U,{variant:`outline`,size:`sm`,className:`h-8 gap-1.5 text-xs`,onClick:()=>void ve(),disabled:C,title:`执行 git fetch --prune origin:拉取远端最新提交并清理已删除的分支,不改动工作区`,children:[C?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(P,{className:`size-3.5`}),`同步远程`]}):null]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 rounded-lg border p-0.5`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>te(`doc`),className:V(`rounded-md px-3 py-1.5 text-xs transition-colors`,F===`doc`?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:`个人文档`}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>te(`overview`),className:V(`rounded-md px-3 py-1.5 text-xs transition-colors`,F===`overview`?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:`跨人总览`})]})]})});if(T===null)return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 py-16 text-sm text-muted-foreground`,children:[(0,H.jsx)(rt,{className:`size-4 animate-spin`}),`正在读取迭代…`]});if(!T.configured)return(0,H.jsx)(sp,{icon:(0,H.jsx)(jt,{className:`size-5`}),title:`尚未配置文档仓库`,description:"当前账号还没有可用的迭代任务文档仓库。请联系管理员开通访问权限,或用 `ylcwf init` 完成配置后刷新。",action:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,onClick:()=>void I(c),children:[(0,H.jsx)(_t,{className:`size-3.5`}),`重新检测`]})});if(!T.accessible)return(0,H.jsx)(sp,{icon:(0,H.jsx)(jt,{className:`size-5`}),title:`无法访问文档仓库`,description:`${T.reason??`未知原因`}。如果这是团队共享仓库,请联系管理员开通文档仓库访问权限。`,action:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,onClick:()=>void I(c),children:[(0,H.jsx)(_t,{className:`size-3.5`}),`重新检测`]})});if(T.iterations.length===0){let e=c===`remote`?T.ref?.name??x??`当前远程分支`:`当前工作区`;return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[Ce(),(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,H.jsx)(sp,{icon:(0,H.jsx)(Le,{className:`size-5`}),title:`${e} 上没有迭代文档`,description:c===`remote`?`该分支未包含「迭代目录/开发者.md」结构的文档。可切换到其他远程分支,或切回本地视图查看当前工作区。`:`已读取 ${T.docsRoot},但未找到包含个人文档的迭代目录。确认仓库路径正确,且目录下存在 {开发者}.md。`,action:(0,H.jsxs)(U,{variant:`outline`,size:`sm`,onClick:()=>void I(c),children:[(0,H.jsx)(_t,{className:`size-3.5`}),`重新扫描`]})})})]})}return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[Ce(),c===`remote`&&u!==null?(0,H.jsx)(`div`,{className:`shrink-0`,children:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-lg border bg-muted/40 px-3.5 py-2 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(ke,{className:`size-3.5`}),(0,H.jsx)(`span`,{className:`font-mono`,children:u.upstream??`无上游`}),T?.ref===null||T?.ref===void 0?null:(0,H.jsxs)(`span`,{className:`font-mono`,children:[`@`,T.ref.sha.slice(0,7)]}),u.behind>0?(0,H.jsxs)(W,{variant:`warning`,children:[`落后 `,u.behind,` 个提交`]}):null,u.ahead>0?(0,H.jsxs)(W,{variant:`secondary`,children:[`本地领先 `,u.ahead,` 个提交`]}):null,u.dirty?(0,H.jsx)(W,{variant:`muted`,children:`工作区有未提交修改`}):null,(0,H.jsx)(`span`,{className:`ml-auto`,children:`'远程只读快照,不会改动工作区'`})]})}):null,ce?(0,H.jsx)(`div`,{className:`shrink-0 px-8 py-2`,children:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-lg border border-warning/35 bg-warning/8 px-3.5 py-2.5 text-xs text-warning`,children:[(0,H.jsx)(Vt,{className:`size-3.5 shrink-0`}),(0,H.jsxs)(`span`,{className:`flex-1`,children:[`本地服务版本比界面旧(升级后未重启):状态统计等新数据可能为空。请在终端重启`,` `,(0,H.jsx)(`code`,{className:`rounded bg-warning/15 px-1 py-0.5 font-mono`,children:`ylcwf serve`}),` 后刷新。`]})]})}):null,ie===null?null:(0,H.jsx)(`div`,{className:`shrink-0 px-8 py-2`,children:(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-lg border border-destructive/25 bg-destructive/8 px-3.5 py-2.5 text-xs text-destructive`,children:(0,H.jsx)(`span`,{className:`flex-1`,children:ie})})}),(0,H.jsxs)(`div`,{className:V(`grid min-h-0 flex-1 gap-0`,F===`doc`?`lg:grid-cols-[224px_1fr]`:`grid-cols-1`),children:[F===`doc`?(0,H.jsx)(`aside`,{className:`min-h-0 overflow-y-auto border-r px-4 py-4`,children:k===null?(0,H.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`加载中…`}):(0,H.jsx)(vw,{summary:k,active:j,onSelect:e=>M(e)})}):null,(0,H.jsx)(`div`,{ref:me,className:`min-h-0 min-w-0 overflow-y-auto px-6 py-5`,children:(0,H.jsx)(`div`,{className:`space-y-4`,children:k===null?(0,H.jsx)(ji,{className:`py-16`,children:(0,H.jsx)(Mi,{className:`text-center text-sm text-muted-foreground`,children:`正在汇总该迭代…`})}):F===`overview`?(0,H.jsx)(yw,{summary:k,onOpenTask:be,onSelectDeveloper:e=>{M(e),te(`doc`)}}):N===null?(0,H.jsx)(ji,{className:`py-16`,children:(0,H.jsx)(Mi,{className:`text-center text-sm text-muted-foreground`,children:`选择左侧开发者查看文档`})}):(0,H.jsx)(Ew,{doc:N,developer:ye,onOpenDetail:Se,editable:L,actions:m?.actions??{},actingTaskId:g,onAction:(e,t)=>void ge(e,t),onBatchAction:(e,t)=>void _e(e,t)})})})]}),(0,H.jsx)(Hf,{open:oe!==null,onOpenChange:e=>e?void 0:se(null),children:(0,H.jsxs)(Uf,{className:`flex max-h-[82vh] max-w-2xl flex-col gap-0 overflow-hidden p-0`,children:[(0,H.jsx)(`div`,{className:`shrink-0 border-b px-6 py-4 pr-12`,children:(0,H.jsxs)(Wf,{children:[(0,H.jsx)(Y,{className:`line-clamp-2 leading-snug`,children:oe?.name??``}),(0,H.jsxs)(Gf,{children:[oe?.id??``,` · 只读视图,修改请通过 Agent 流程`]})]})}),xe.length>0?(0,H.jsxs)(`div`,{className:`mx-6 mt-4 flex flex-wrap items-center gap-2 rounded-lg border border-warning/35 bg-warning/8 px-3 py-2 text-[11px] text-warning`,children:[(0,H.jsx)(De,{className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{children:`该任务被前置任务阻塞:`}),xe.map(e=>(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono`,children:[e.id,(0,H.jsx)(`span`,{className:`rounded bg-warning/15 px-1 py-0.5`,children:e.status})]},e.id))]}):null,y.length===0?null:(0,H.jsxs)(`div`,{className:`mx-6 mt-3 space-y-1 rounded-lg border bg-muted/40 px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`text-[11px] font-medium text-muted-foreground`,children:`最近变更`}),y.map(e=>(0,H.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`font-mono`,children:new Date(e.at).toLocaleString(`zh-CN`)}),` · `,e.changes.slice(0,2).join(`;`)]},`${e.at}-${e.action}`))]}),(0,H.jsx)(`div`,{className:`prose prose-sm min-h-0 max-w-none flex-1 overflow-y-auto px-6 py-4 dark:prose-invert prose-code:rounded prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:font-mono prose-code:text-[12px] prose-code:before:content-none prose-code:after:content-none prose-pre:bg-muted/60 prose-table:text-xs prose-headings:font-semibold`,children:oe===null?null:(0,H.jsx)(Sb,{remarkPlugins:[ZC],skipHtml:!0,children:oe.markdown})})]})})]})}var Ow=[{id:`overview`,label:`概览`,description:`配置健康状态与关键指标`,icon:$e,component:up},{id:`iterations`,label:`迭代看板`,description:`迭代进度、成员文档与任务详情`,icon:Nt,component:Dw,wide:!0,fullHeight:!0},{id:`settings`,label:`设置`,description:`身份、文档仓库、终端映射、备份与关于`,icon:Dt,component:wp}];function kw(e){return Ow.some(t=>t.id===e)}var Aw={system:`跟随系统`,light:`浅色模式`,dark:`深色模式`};function jw(){let[e,t]=(0,v.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`dark`||e===`light`)return e;let t=localStorage.getItem(`ylcwf-theme`);return t===`dark`||t===`light`||t===`system`?t:`system`}),[n,r]=(0,v.useState)(()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches);(0,v.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>r(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let i=e===`system`?n:e===`dark`;return(0,v.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,i),localStorage.setItem(`ylcwf-theme`,e)},[i,e]),{mode:e,dark:i,cycle:()=>{t(e=>e===`system`?`light`:e===`light`?`dark`:`system`)}}}function Mw(){return(0,H.jsxs)(`svg`,{viewBox:`0 0 32 32`,className:`size-8`,"aria-hidden":`true`,children:[(0,H.jsx)(`defs`,{children:(0,H.jsxs)(`linearGradient`,{id:`brandBg`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,H.jsx)(`stop`,{offset:`0`,stopColor:`#A283FF`}),(0,H.jsx)(`stop`,{offset:`0.45`,stopColor:`#6E4BF7`}),(0,H.jsx)(`stop`,{offset:`1`,stopColor:`#3A1DAE`})]})}),(0,H.jsx)(`rect`,{width:`32`,height:`32`,rx:`9`,fill:`url(#brandBg)`}),(0,H.jsx)(`rect`,{x:`5.5`,y:`6.5`,width:`11`,height:`8`,rx:`2.6`,fill:`#FFFFFF`,fillOpacity:`0.6`}),(0,H.jsx)(`rect`,{x:`10.5`,y:`12.8`,width:`11`,height:`8`,rx:`2.6`,fill:`#FFFFFF`,fillOpacity:`0.84`}),(0,H.jsx)(`rect`,{x:`15.5`,y:`19`,width:`11`,height:`8`,rx:`2.6`,fill:`#FFFFFF`}),(0,H.jsx)(`rect`,{x:`17.8`,y:`21.6`,width:`4.6`,height:`1.5`,rx:`0.75`,fill:`#6E4BF7`,fillOpacity:`0.8`}),(0,H.jsx)(`rect`,{x:`17.8`,y:`24.2`,width:`6.4`,height:`1.5`,rx:`0.75`,fill:`#6E4BF7`,fillOpacity:`0.35`})]})}var Nw={profile:`settings`,docs:`settings`,terminals:`settings`,backups:`settings`};function Pw(){let e=window.location.hash.replace(`#`,``).split(`?`)[0]??``,t=Nw[e]??e;return kw(t)?t:`overview`}function Fw(){let[e,t]=(0,v.useState)(Pw),[n,r]=(0,v.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`sidebar`);return e===`collapsed`||e!==`expanded`&&localStorage.getItem(`ylcwf-sidebar`)===`collapsed`}),{mode:i,cycle:a}=jw(),{onboarding:o,loading:s,saving:c,snapshot:l,draft:u,dirty:d,error:f,save:p,discard:m}=oa();(0,v.useEffect)(()=>{let e=()=>t(Pw());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let h=e=>{window.location.hash=e,t(e)};(0,v.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),d&&!c&&p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,c,p]),(0,v.useEffect)(()=>{if(!d)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[d]),(0,v.useEffect)(()=>{localStorage.setItem(`ylcwf-sidebar`,n?`collapsed`:`expanded`)},[n]);let g=Ow;(0,v.useEffect)(()=>{g.some(t=>t.id===e)||t(g[0]?.id??`iterations`)},[e,g]);let _=Ow.find(t=>t.id===e)??Ow[0],y=_?.component??up;return f===null?o===null?(0,H.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(rt,{className:`size-4 animate-spin`}),`正在检测运行环境…`]}):o.nextStep===`ready`?l===null?(0,H.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(rt,{className:`size-4 animate-spin`}),`正在读取配置…`]}):(0,H.jsxs)(`div`,{className:`app-glow flex h-full`,children:[(0,H.jsxs)(`aside`,{className:V(`relative z-10 flex shrink-0 flex-col border-r bg-card/50 backdrop-blur-xl transition-[width] duration-200`,n?`w-[64px]`:`w-56`),children:[(0,H.jsxs)(`div`,{className:V(`flex items-center gap-2.5 py-5`,n?`justify-center px-2`:`px-5`),children:[(0,H.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-lg shadow-sm`,children:(0,H.jsx)(Mw,{})}),n?null:(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 leading-tight`,children:[(0,H.jsx)(`p`,{className:`truncate text-sm font-semibold tracking-tight`,children:`ylcwf`}),(0,H.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,children:`研发工作台`})]})]}),(0,H.jsx)(`nav`,{className:V(`flex-1 space-y-0.5`,n?`px-2`:`px-3`),children:g.map(t=>{let r=t.icon,i=t.id===e;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>h(t.id),title:n?t.label:void 0,className:V(`group relative flex w-full items-center rounded-md py-2 text-sm transition-colors`,n?`justify-center px-0`:`gap-2.5 px-3`,i?`bg-accent font-medium text-accent-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:[i?(0,H.jsx)(`span`,{className:`absolute inset-y-1.5 left-0 w-0.5 rounded-full bg-primary`}):null,(0,H.jsx)(r,{className:`size-4 shrink-0`}),n?null:(0,H.jsx)(`span`,{className:`truncate`,children:t.label})]},t.id)})}),(0,H.jsxs)(`div`,{className:V(`space-y-2 border-t py-3`,n?`px-2`:`px-4`),children:[(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,className:V(`w-full gap-2 text-xs`,n?`justify-center px-0`:`justify-start`),title:Aw[i],onClick:a,children:[i===`system`?(0,H.jsx)(at,{className:`size-3.5`}):i===`dark`?(0,H.jsx)(st,{className:`size-3.5`}):(0,H.jsx)(Lt,{className:`size-3.5`}),n?null:Aw[i]]}),(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,className:V(`w-full gap-2 text-xs`,n?`justify-center px-0`:`justify-start`),title:n?`展开侧边栏`:`收起侧边栏`,onClick:()=>r(e=>!e),children:[n?(0,H.jsx)(pt,{className:`size-3.5`}):(0,H.jsx)(dt,{className:`size-3.5`}),n?null:`收起侧边栏`]})]})]}),(0,H.jsxs)(`main`,{className:`relative z-10 flex min-w-0 flex-1 flex-col`,children:[(0,H.jsxs)(`header`,{className:`flex items-center justify-between gap-4 border-b bg-background/60 px-8 py-4 backdrop-blur-xl`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h1`,{className:`text-base font-semibold tracking-tight`,children:_?.label}),(0,H.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:_?.description})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:d?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(U,{variant:`ghost`,size:`sm`,onClick:m,disabled:c,children:[(0,H.jsx)(xt,{className:`size-3.5`}),`放弃更改`]}),(0,H.jsxs)(U,{size:`sm`,onClick:()=>void p(),disabled:c,children:[c?(0,H.jsx)(rt,{className:`size-3.5 animate-spin`}):(0,H.jsx)(Ct,{className:`size-3.5`}),`保存`,(0,H.jsx)(`kbd`,{className:`ml-1 rounded border bg-primary-foreground/15 px-1 font-mono text-[10px]`,children:`⌘S`})]})]}):(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`已同步`})})]}),(0,H.jsx)(`div`,{className:V(`min-h-0 flex-1`,_?.fullHeight===!0?`overflow-hidden`:`overflow-y-auto px-8 py-6`),children:(0,H.jsx)(`div`,{className:V(`mx-auto w-full`,_?.fullHeight===!0?`h-full max-w-none`:V(`animate-fade-up space-y-5`,_?.wide===!0?`max-w-[1600px]`:`max-w-4xl`)),children:(0,H.jsx)(np,{area:_?.label??`页面`,children:(0,H.jsx)(y,{})})},e)})]}),(0,H.jsx)(kn,{position:`bottom-right`,toastOptions:{classNames:{toast:`rounded-lg border bg-card text-card-foreground shadow-lg`}}})]}):(0,H.jsx)(tp,{state:o,onDone:async()=>{window.location.reload()}}):(0,H.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,H.jsx)(jt,{className:`size-6 text-destructive`}),(0,H.jsx)(`p`,{className:`max-w-md text-sm font-medium text-destructive`,children:f}),(0,H.jsxs)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:[`在终端重新执行`,` `,(0,H.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono`,children:`ylcwf serve`}),` `,`后打开它打印的地址。令牌已持久化,正常重启不会让已打开的链接失效。`]}),(0,H.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`刷新页面`})]})}var Iw=document.getElementById(`root`);if(Iw===null)throw Error(`缺少 #root 容器`);oa.getState().bootstrap(),(0,y.createRoot)(Iw).render((0,H.jsx)(v.StrictMode,{children:(0,H.jsx)(Fw,{})}));