var ai=Object.defineProperty;var ii=(e,t,n)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Cn=(e,t,n)=>ii(e,typeof t!="symbol"?t+"":t,n);import{r as a,j as s,R as Ne,u as te,c as Nt,a as is,g as ci,b as li,d as F,S as di,e as ui,f as ne,h as cs,i as Pt,C as fe,k as pe,l as fi,B as ee,m as Ft,n as $t,o as Bt,X as Mr,p as pi}from"./i18n.js";function D(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ze(e,t=[]){let n=[];function r(i,l){const c=a.createContext(l),d=n.length;n=[...n,l];const u=f=>{const{scope:g,children:h,...v}=f,m=g?.[e]?.[d]||c,w=a.useMemo(()=>v,Object.values(v));return s.jsx(m.Provider,{value:w,children:h})};u.displayName=i+"Provider";function p(f,g){const h=g?.[e]?.[d]||c,v=a.useContext(h);if(v)return v;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,p]}const o=()=>{const i=n.map(l=>a.createContext(l));return function(c){const d=c?.[e]||i;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return o.scopeName=e,[r,mi(o,...t)]}function mi(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((c,{useScope:d,scopeName:u})=>{const f=d(i)[`__scope${u}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Gn(e){const t=e+"CollectionProvider",[n,r]=ze(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:w,children:y}=m,S=Ne.useRef(null),N=Ne.useRef(new Map).current;return s.jsx(o,{scope:w,itemMap:N,collectionRef:S,children:y})};l.displayName=t;const c=e+"CollectionSlot",d=Nt(c),u=Ne.forwardRef((m,w)=>{const{scope:y,children:S}=m,N=i(c,y),j=te(w,N.collectionRef);return s.jsx(d,{ref:j,children:S})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",g=Nt(p),h=Ne.forwardRef((m,w)=>{const{scope:y,children:S,...N}=m,j=Ne.useRef(null),E=te(w,j),I=i(p,y);return Ne.useEffect(()=>(I.itemMap.set(j,{ref:j,...N}),()=>void I.itemMap.delete(j))),s.jsx(g,{[f]:"",ref:E,children:S})});h.displayName=p;function v(m){const w=i(e+"CollectionConsumer",m);return Ne.useCallback(()=>{const S=w.collectionRef.current;if(!S)return[];const N=Array.from(S.querySelectorAll(`[${f}]`));return Array.from(w.itemMap.values()).sort((I,C)=>N.indexOf(I.ref.current)-N.indexOf(C.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:u,ItemSlot:h},v,r]}var ce=globalThis?.document?a.useLayoutEffect:()=>{},hi=is[" useId ".trim().toString()]||(()=>{}),gi=0;function We(e){const[t,n]=a.useState(hi());return ce(()=>{n(r=>r??String(gi++))},[e]),t?`radix-${t}`:""}var kt=li();const xi=ci(kt);var vi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=vi.reduce((e,t)=>{const n=Nt(`Primitive.${t}`),r=a.forwardRef((o,i)=>{const{asChild:l,...c}=o,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ls(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function ke(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}var wi=is[" useInsertionEffect ".trim().toString()]||ce;function Ct({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,l]=bi({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:o;{const p=a.useRef(e!==void 0);a.useEffect(()=>{const f=p.current;f!==c&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const u=a.useCallback(p=>{if(c){const f=yi(p)?p(e):p;f!==e&&l.current?.(f)}else i(p)},[c,e,i,l]);return[d,u]}function bi({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),i=a.useRef(t);return wi(()=>{i.current=t},[t]),a.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function yi(e){return typeof e=="function"}var Si=a.createContext(void 0);function on(e){const t=a.useContext(Si);return e||t||"ltr"}var jn="rovingFocusGroup.onEntryFocus",Ni={bubbles:!1,cancelable:!0},At="RovingFocusGroup",[Dn,ds,Ci]=Gn(At),[ji,an]=ze(At,[Ci]),[Ei,Ri]=ji(At),us=a.forwardRef((e,t)=>s.jsx(Dn.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Dn.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Mi,{...e,ref:t})})}));us.displayName=At;var Mi=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...f}=e,g=a.useRef(null),h=te(t,g),v=on(i),[m,w]=Ct({prop:l,defaultProp:c??null,onChange:d,caller:At}),[y,S]=a.useState(!1),N=ke(u),j=ds(n),E=a.useRef(!1),[I,C]=a.useState(0);return a.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(jn,N),()=>M.removeEventListener(jn,N)},[N]),s.jsx(Ei,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:m,onItemFocus:a.useCallback(M=>w(M),[w]),onItemShiftTab:a.useCallback(()=>S(!0),[]),onFocusableItemAdd:a.useCallback(()=>C(M=>M+1),[]),onFocusableItemRemove:a.useCallback(()=>C(M=>M-1),[]),children:s.jsx(W.div,{tabIndex:y||I===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:D(e.onMouseDown,()=>{E.current=!0}),onFocus:D(e.onFocus,M=>{const V=!E.current;if(M.target===M.currentTarget&&V&&!y){const O=new CustomEvent(jn,Ni);if(M.currentTarget.dispatchEvent(O),!O.defaultPrevented){const $=j().filter(T=>T.focusable),B=$.find(T=>T.active),z=$.find(T=>T.id===m),K=[B,z,...$].filter(Boolean).map(T=>T.ref.current);ms(K,p)}}E.current=!1}),onBlur:D(e.onBlur,()=>S(!1))})})}),fs="RovingFocusGroupItem",ps=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:l,...c}=e,d=We(),u=i||d,p=Ri(fs,n),f=p.currentTabStopId===u,g=ds(n),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:m}=p;return a.useEffect(()=>{if(r)return h(),()=>v()},[r,h,v]),s.jsx(Dn.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:s.jsx(W.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:D(e.onMouseDown,w=>{r?p.onItemFocus(u):w.preventDefault()}),onFocus:D(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:D(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const y=Ai(w,p.orientation,p.dir);if(y!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let N=g().filter(j=>j.focusable).map(j=>j.ref.current);if(y==="last")N.reverse();else if(y==="prev"||y==="next"){y==="prev"&&N.reverse();const j=N.indexOf(w.currentTarget);N=p.loop?Ti(N,j+1):N.slice(j+1)}setTimeout(()=>ms(N))}}),children:typeof l=="function"?l({isCurrentTabStop:f,hasTabStop:m!=null}):l})})});ps.displayName=fs;var Pi={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ki(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ai(e,t,n){const r=ki(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Pi[r]}function ms(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ti(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hs=us,gs=ps;function Ii(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var lt=e=>{const{present:t,children:n}=e,r=_i(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=te(r.ref,Di(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};lt.displayName="Presence";function _i(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),l=e?"mounted":"unmounted",[c,d]=Ii(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=zt(r.current);i.current=c==="mounted"?u:"none"},[c]),ce(()=>{const u=r.current,p=o.current;if(p!==e){const g=i.current,h=zt(u);e?d("MOUNT"):h==="none"||u?.display==="none"?d("UNMOUNT"):d(p&&g!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),ce(()=>{if(t){let u;const p=t.ownerDocument.defaultView??window,f=h=>{const m=zt(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(d("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",u=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=h=>{h.target===t&&(i.current=zt(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function zt(e){return e?.animationName||"none"}function Di(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cn="Tabs",[Oi,up]=ze(cn,[an]),xs=an(),[Li,qn]=Oi(cn),vs=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:c,activationMode:d="automatic",...u}=e,p=on(c),[f,g]=Ct({prop:r,onChange:o,defaultProp:i??"",caller:cn});return s.jsx(Li,{scope:n,baseId:We(),value:f,onValueChange:g,orientation:l,dir:p,activationMode:d,children:s.jsx(W.div,{dir:p,"data-orientation":l,...u,ref:t})})});vs.displayName=cn;var ws="TabsList",bs=a.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=qn(ws,n),l=xs(n);return s.jsx(hs,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});bs.displayName=ws;var ys="TabsTrigger",Ss=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,l=qn(ys,n),c=xs(n),d=js(l.baseId,r),u=Es(l.baseId,r),p=r===l.value;return s.jsx(gs,{asChild:!0,...c,focusable:!o,active:p,children:s.jsx(W.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":u,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:d,...i,ref:t,onMouseDown:D(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?l.onValueChange(r):f.preventDefault()}),onKeyDown:D(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&l.onValueChange(r)}),onFocus:D(e.onFocus,()=>{const f=l.activationMode!=="manual";!p&&!o&&f&&l.onValueChange(r)})})})});Ss.displayName=ys;var Ns="TabsContent",Cs=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...l}=e,c=qn(Ns,n),d=js(c.baseId,r),u=Es(c.baseId,r),p=r===c.value,f=a.useRef(p);return a.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(lt,{present:o||p,children:({present:g})=>s.jsx(W.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:g&&i})})});Cs.displayName=Ns;function js(e,t){return`${e}-trigger-${t}`}function Es(e,t){return`${e}-content-${t}`}var Fi=vs,$i=bs,Bi=Ss,zi=Cs;function Vi({className:e,...t}){return s.jsx(Fi,{"data-slot":"tabs",className:F("flex flex-col gap-2",e),...t})}function Ui({className:e,...t}){return s.jsx($i,{"data-slot":"tabs-list",className:F("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]","[body.vscode-light_&]:border [body.vscode-light_&]:border-border/20 [body.vscode-light_&]:shadow-sm",e),...t})}function Je({className:e,...t}){return s.jsx(Bi,{"data-slot":"tabs-trigger",className:F("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function et({className:e,...t}){return s.jsx(zi,{"data-slot":"tabs-content",className:F("flex-1 outline-none",e),...t})}const Hi=ui("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Vt({className:e,variant:t,asChild:n=!1,...r}){const o=n?di:"span";return s.jsx(o,{"data-slot":"badge",className:F(Hi({variant:t}),e),...r})}var Yn="Progress",Zn=100,[Wi,fp]=ze(Yn),[Ki,Gi]=Wi(Yn),Rs=a.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=qi,...l}=e;(o||o===0)&&!Pr(o)&&console.error(Yi(`${o}`,"Progress"));const c=Pr(o)?o:Zn;r!==null&&!kr(r,c)&&console.error(Zi(`${r}`,"Progress"));const d=kr(r,c)?r:null,u=Xt(d)?i(d,c):void 0;return s.jsx(Ki,{scope:n,value:d,max:c,children:s.jsx(W.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Xt(d)?d:void 0,"aria-valuetext":u,role:"progressbar","data-state":ks(d,c),"data-value":d??void 0,"data-max":c,...l,ref:t})})});Rs.displayName=Yn;var Ms="ProgressIndicator",Ps=a.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=Gi(Ms,n);return s.jsx(W.div,{"data-state":ks(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});Ps.displayName=Ms;function qi(e,t){return`${Math.round(e/t*100)}%`}function ks(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Xt(e){return typeof e=="number"}function Pr(e){return Xt(e)&&!isNaN(e)&&e>0}function kr(e,t){return Xt(e)&&!isNaN(e)&&e<=t&&e>=0}function Yi(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Zn}\`.`}function Zi(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${Zn} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var Xi=Rs,Qi=Ps;function Ar({className:e,value:t,...n}){return s.jsx(Xi,{"data-slot":"progress",className:F("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:s.jsx(Qi,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Tr(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ji(e,t=globalThis?.document){const n=ke(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ec="DismissableLayer",On="dismissableLayer.update",tc="dismissableLayer.pointerDownOutside",nc="dismissableLayer.focusOutside",Ir,As=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xn=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...d}=e,u=a.useContext(As),[p,f]=a.useState(null),g=p?.ownerDocument??globalThis?.document,[,h]=a.useState({}),v=te(t,C=>f(C)),m=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(w),S=p?m.indexOf(p):-1,N=u.layersWithOutsidePointerEventsDisabled.size>0,j=S>=y,E=oc(C=>{const M=C.target,V=[...u.branches].some(O=>O.contains(M));!j||V||(o?.(C),l?.(C),C.defaultPrevented||c?.())},g),I=ac(C=>{const M=C.target;[...u.branches].some(O=>O.contains(M))||(i?.(C),l?.(C),C.defaultPrevented||c?.())},g);return Ji(C=>{S===u.layers.size-1&&(r?.(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},g),a.useEffect(()=>{if(p)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ir=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),_r(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Ir)}},[p,g,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),_r())},[p,u]),a.useEffect(()=>{const C=()=>h({});return document.addEventListener(On,C),()=>document.removeEventListener(On,C)},[]),s.jsx(W.div,{...d,ref:v,style:{pointerEvents:N?j?"auto":"none":void 0,...e.style},onFocusCapture:D(e.onFocusCapture,I.onFocusCapture),onBlurCapture:D(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:D(e.onPointerDownCapture,E.onPointerDownCapture)})});Xn.displayName=ec;var rc="DismissableLayerBranch",sc=a.forwardRef((e,t)=>{const n=a.useContext(As),r=a.useRef(null),o=te(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(W.div,{...e,ref:o})});sc.displayName=rc;function oc(e,t=globalThis?.document){const n=ke(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){Ts(tc,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ac(e,t=globalThis?.document){const n=ke(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ts(nc,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _r(){const e=new CustomEvent(On);document.dispatchEvent(e)}function Ts(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ls(o,i):o.dispatchEvent(i)}var En=0;function Is(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dr()),document.body.insertAdjacentElement("beforeend",e[1]??Dr()),En++,()=>{En===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),En--}},[])}function Dr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Rn="focusScope.autoFocusOnMount",Mn="focusScope.autoFocusOnUnmount",Or={bubbles:!1,cancelable:!0},ic="FocusScope",Qn=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...l}=e,[c,d]=a.useState(null),u=ke(o),p=ke(i),f=a.useRef(null),g=te(t,m=>d(m)),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let m=function(N){if(h.paused||!c)return;const j=N.target;c.contains(j)?f.current=j:Le(f.current,{select:!0})},w=function(N){if(h.paused||!c)return;const j=N.relatedTarget;j!==null&&(c.contains(j)||Le(f.current,{select:!0}))},y=function(N){if(document.activeElement===document.body)for(const E of N)E.removedNodes.length>0&&Le(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",w);const S=new MutationObserver(y);return c&&S.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),S.disconnect()}}},[r,c,h.paused]),a.useEffect(()=>{if(c){Fr.add(h);const m=document.activeElement;if(!c.contains(m)){const y=new CustomEvent(Rn,Or);c.addEventListener(Rn,u),c.dispatchEvent(y),y.defaultPrevented||(cc(pc(_s(c)),{select:!0}),document.activeElement===m&&Le(c))}return()=>{c.removeEventListener(Rn,u),setTimeout(()=>{const y=new CustomEvent(Mn,Or);c.addEventListener(Mn,p),c.dispatchEvent(y),y.defaultPrevented||Le(m??document.body,{select:!0}),c.removeEventListener(Mn,p),Fr.remove(h)},0)}}},[c,u,p,h]);const v=a.useCallback(m=>{if(!n&&!r||h.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(w&&y){const S=m.currentTarget,[N,j]=lc(S);N&&j?!m.shiftKey&&y===j?(m.preventDefault(),n&&Le(N,{select:!0})):m.shiftKey&&y===N&&(m.preventDefault(),n&&Le(j,{select:!0})):y===S&&m.preventDefault()}},[n,r,h.paused]);return s.jsx(W.div,{tabIndex:-1,...l,ref:g,onKeyDown:v})});Qn.displayName=ic;function cc(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Le(r,{select:t}),document.activeElement!==n)return}function lc(e){const t=_s(e),n=Lr(t,e),r=Lr(t.reverse(),e);return[n,r]}function _s(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Lr(e,t){for(const n of e)if(!dc(n,{upTo:t}))return n}function dc(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uc(e){return e instanceof HTMLInputElement&&"select"in e}function Le(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uc(e)&&t&&e.select()}}var Fr=fc();function fc(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=$r(e,t),e.unshift(t)},remove(t){e=$r(e,t),e[0]?.resume()}}}function $r(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pc(e){return e.filter(t=>t.tagName!=="A")}const mc=["top","right","bottom","left"],$e=Math.min,me=Math.max,Qt=Math.round,Ut=Math.floor,Pe=e=>({x:e,y:e}),hc={left:"right",right:"left",bottom:"top",top:"bottom"},gc={start:"end",end:"start"};function Ln(e,t,n){return me(e,$e(t,n))}function _e(e,t){return typeof e=="function"?e(t):e}function De(e){return e.split("-")[0]}function dt(e){return e.split("-")[1]}function Jn(e){return e==="x"?"y":"x"}function er(e){return e==="y"?"height":"width"}const xc=new Set(["top","bottom"]);function Me(e){return xc.has(De(e))?"y":"x"}function tr(e){return Jn(Me(e))}function vc(e,t,n){n===void 0&&(n=!1);const r=dt(e),o=tr(e),i=er(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Jt(l)),[l,Jt(l)]}function wc(e){const t=Jt(e);return[Fn(e),t,Fn(t)]}function Fn(e){return e.replace(/start|end/g,t=>gc[t])}const Br=["left","right"],zr=["right","left"],bc=["top","bottom"],yc=["bottom","top"];function Sc(e,t,n){switch(e){case"top":case"bottom":return n?t?zr:Br:t?Br:zr;case"left":case"right":return t?bc:yc;default:return[]}}function Nc(e,t,n,r){const o=dt(e);let i=Sc(De(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(Fn)))),i}function Jt(e){return e.replace(/left|right|bottom|top/g,t=>hc[t])}function Cc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ds(e){return typeof e!="number"?Cc(e):{top:e,right:e,bottom:e,left:e}}function en(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Vr(e,t,n){let{reference:r,floating:o}=e;const i=Me(t),l=tr(t),c=er(l),d=De(t),u=i==="y",p=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,g=r[c]/2-o[c]/2;let h;switch(d){case"top":h={x:p,y:r.y-o.height};break;case"bottom":h={x:p,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(dt(t)){case"start":h[l]-=g*(n&&u?-1:1);break;case"end":h[l]+=g*(n&&u?-1:1);break}return h}const jc=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=Vr(u,r,d),g=r,h={},v=0;for(let m=0;m<c.length;m++){const{name:w,fn:y}=c[m],{x:S,y:N,data:j,reset:E}=await y({x:p,y:f,initialPlacement:r,placement:g,strategy:o,middlewareData:h,rects:u,platform:l,elements:{reference:e,floating:t}});p=S??p,f=N??f,h={...h,[w]:{...h[w],...j}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(u=E.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:p,y:f}=Vr(u,g,d)),m=-1)}return{x:p,y:f,placement:g,strategy:o,middlewareData:h}};async function jt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:h=0}=_e(t,e),v=Ds(h),w=c[g?f==="floating"?"reference":"floating":f],y=en(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:p,strategy:d})),S=f==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),j=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},E=en(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:N,strategy:d}):S);return{top:(y.top-E.top+v.top)/j.y,bottom:(E.bottom-y.bottom+v.bottom)/j.y,left:(y.left-E.left+v.left)/j.x,right:(E.right-y.right+v.right)/j.x}}const Ec=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:d}=t,{element:u,padding:p=0}=_e(e,t)||{};if(u==null)return{};const f=Ds(p),g={x:n,y:r},h=tr(o),v=er(h),m=await l.getDimensions(u),w=h==="y",y=w?"top":"left",S=w?"bottom":"right",N=w?"clientHeight":"clientWidth",j=i.reference[v]+i.reference[h]-g[h]-i.floating[v],E=g[h]-i.reference[h],I=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let C=I?I[N]:0;(!C||!await(l.isElement==null?void 0:l.isElement(I)))&&(C=c.floating[N]||i.floating[v]);const M=j/2-E/2,V=C/2-m[v]/2-1,O=$e(f[y],V),$=$e(f[S],V),B=O,z=C-m[v]-$,L=C/2-m[v]/2+M,K=Ln(B,L,z),T=!d.arrow&&dt(o)!=null&&L!==K&&i.reference[v]/2-(L<B?O:$)-m[v]/2<0,U=T?L<B?L-B:L-z:0;return{[h]:g[h]+U,data:{[h]:K,centerOffset:L-K-U,...T&&{alignmentOffset:U}},reset:T}}}),Rc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:d,elements:u}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...w}=_e(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=De(o),S=Me(c),N=De(c)===c,j=await(d.isRTL==null?void 0:d.isRTL(u.floating)),E=g||(N||!m?[Jt(c)]:wc(c)),I=v!=="none";!g&&I&&E.push(...Nc(c,m,v,j));const C=[c,...E],M=await jt(t,w),V=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&V.push(M[y]),f){const L=vc(o,l,j);V.push(M[L[0]],M[L[1]])}if(O=[...O,{placement:o,overflows:V}],!V.every(L=>L<=0)){var $,B;const L=((($=i.flip)==null?void 0:$.index)||0)+1,K=C[L];if(K&&(!(f==="alignment"?S!==Me(K):!1)||O.every(P=>Me(P.placement)===S?P.overflows[0]>0:!0)))return{data:{index:L,overflows:O},reset:{placement:K}};let T=(B=O.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:B.placement;if(!T)switch(h){case"bestFit":{var z;const U=(z=O.filter(P=>{if(I){const k=Me(P.placement);return k===S||k==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(k=>k>0).reduce((k,G)=>k+G,0)]).sort((P,k)=>P[1]-k[1])[0])==null?void 0:z[0];U&&(T=U);break}case"initialPlacement":T=c;break}if(o!==T)return{reset:{placement:T}}}return{}}}};function Ur(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hr(e){return mc.some(t=>e[t]>=0)}const Mc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=_e(e,t);switch(r){case"referenceHidden":{const i=await jt(t,{...o,elementContext:"reference"}),l=Ur(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Hr(l)}}}case"escaped":{const i=await jt(t,{...o,altBoundary:!0}),l=Ur(i,n.floating);return{data:{escapedOffsets:l,escaped:Hr(l)}}}default:return{}}}}},Os=new Set(["left","top"]);async function Pc(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=De(n),c=dt(n),d=Me(n)==="y",u=Os.has(l)?-1:1,p=i&&d?-1:1,f=_e(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof v=="number"&&(h=c==="end"?v*-1:v),d?{x:h*p,y:g*u}:{x:g*u,y:h*p}}const kc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,d=await Pc(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:i+d.y,data:{...d,placement:l}}}}},Ac=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x:y,y:S}=w;return{x:y,y:S}}},...d}=_e(e,t),u={x:n,y:r},p=await jt(t,d),f=Me(De(o)),g=Jn(f);let h=u[g],v=u[f];if(i){const w=g==="y"?"top":"left",y=g==="y"?"bottom":"right",S=h+p[w],N=h-p[y];h=Ln(S,h,N)}if(l){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",S=v+p[w],N=v-p[y];v=Ln(S,v,N)}const m=c.fn({...t,[g]:h,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:i,[f]:l}}}}}},Tc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:c=0,mainAxis:d=!0,crossAxis:u=!0}=_e(e,t),p={x:n,y:r},f=Me(o),g=Jn(f);let h=p[g],v=p[f];const m=_e(c,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(d){const N=g==="y"?"height":"width",j=i.reference[g]-i.floating[N]+w.mainAxis,E=i.reference[g]+i.reference[N]-w.mainAxis;h<j?h=j:h>E&&(h=E)}if(u){var y,S;const N=g==="y"?"width":"height",j=Os.has(De(o)),E=i.reference[f]-i.floating[N]+(j&&((y=l.offset)==null?void 0:y[f])||0)+(j?0:w.crossAxis),I=i.reference[f]+i.reference[N]+(j?0:((S=l.offset)==null?void 0:S[f])||0)-(j?w.crossAxis:0);v<E?v=E:v>I&&(v=I)}return{[g]:h,[f]:v}}}},Ic=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:c}=t,{apply:d=()=>{},...u}=_e(e,t),p=await jt(t,u),f=De(o),g=dt(o),h=Me(o)==="y",{width:v,height:m}=i.floating;let w,y;f==="top"||f==="bottom"?(w=f,y=g===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(y=f,w=g==="end"?"top":"bottom");const S=m-p.top-p.bottom,N=v-p.left-p.right,j=$e(m-p[w],S),E=$e(v-p[y],N),I=!t.middlewareData.shift;let C=j,M=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=S),I&&!g){const O=me(p.left,0),$=me(p.right,0),B=me(p.top,0),z=me(p.bottom,0);h?M=v-2*(O!==0||$!==0?O+$:me(p.left,p.right)):C=m-2*(B!==0||z!==0?B+z:me(p.top,p.bottom))}await d({...t,availableWidth:M,availableHeight:C});const V=await l.getDimensions(c.floating);return v!==V.width||m!==V.height?{reset:{rects:!0}}:{}}}};function ln(){return typeof window<"u"}function ut(e){return Ls(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Te(e){var t;return(t=(Ls(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ls(e){return ln()?e instanceof Node||e instanceof he(e).Node:!1}function Ce(e){return ln()?e instanceof Element||e instanceof he(e).Element:!1}function Ae(e){return ln()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function Wr(e){return!ln()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}const _c=new Set(["inline","contents"]);function Tt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_c.has(o)}const Dc=new Set(["table","td","th"]);function Oc(e){return Dc.has(ut(e))}const Lc=[":popover-open",":modal"];function dn(e){return Lc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Fc=["transform","translate","scale","rotate","perspective"],$c=["transform","translate","scale","rotate","perspective","filter"],Bc=["paint","layout","strict","content"];function nr(e){const t=rr(),n=Ce(e)?je(e):e;return Fc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||$c.some(r=>(n.willChange||"").includes(r))||Bc.some(r=>(n.contain||"").includes(r))}function zc(e){let t=Be(e);for(;Ae(t)&&!ct(t);){if(nr(t))return t;if(dn(t))return null;t=Be(t)}return null}function rr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vc=new Set(["html","body","#document"]);function ct(e){return Vc.has(ut(e))}function je(e){return he(e).getComputedStyle(e)}function un(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Be(e){if(ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wr(e)&&e.host||Te(e);return Wr(t)?t.host:t}function Fs(e){const t=Be(e);return ct(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ae(t)&&Tt(t)?t:Fs(t)}function Et(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Fs(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=he(o);if(i){const c=$n(l);return t.concat(l,l.visualViewport||[],Tt(o)?o:[],c&&n?Et(c):[])}return t.concat(o,Et(o,[],n))}function $n(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $s(e){const t=je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ae(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=Qt(n)!==i||Qt(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function sr(e){return Ce(e)?e:e.contextElement}function at(e){const t=sr(e);if(!Ae(t))return Pe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=$s(t);let l=(i?Qt(n.width):n.width)/r,c=(i?Qt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const Uc=Pe(0);function Bs(e){const t=he(e);return!rr()||!t.visualViewport?Uc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==he(e)?!1:t}function Ke(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=sr(e);let l=Pe(1);t&&(r?Ce(r)&&(l=at(r)):l=at(e));const c=Hc(i,n,r)?Bs(i):Pe(0);let d=(o.left+c.x)/l.x,u=(o.top+c.y)/l.y,p=o.width/l.x,f=o.height/l.y;if(i){const g=he(i),h=r&&Ce(r)?he(r):r;let v=g,m=$n(v);for(;m&&r&&h!==v;){const w=at(m),y=m.getBoundingClientRect(),S=je(m),N=y.left+(m.clientLeft+parseFloat(S.paddingLeft))*w.x,j=y.top+(m.clientTop+parseFloat(S.paddingTop))*w.y;d*=w.x,u*=w.y,p*=w.x,f*=w.y,d+=N,u+=j,v=he(m),m=$n(v)}}return en({width:p,height:f,x:d,y:u})}function or(e,t){const n=un(e).scrollLeft;return t?t.left+n:Ke(Te(e)).left+n}function zs(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:or(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Wc(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=Te(r),c=t?dn(t.floating):!1;if(r===l||c&&i)return n;let d={scrollLeft:0,scrollTop:0},u=Pe(1);const p=Pe(0),f=Ae(r);if((f||!f&&!i)&&((ut(r)!=="body"||Tt(l))&&(d=un(r)),Ae(r))){const h=Ke(r);u=at(r),p.x=h.x+r.clientLeft,p.y=h.y+r.clientTop}const g=l&&!f&&!i?zs(l,d,!0):Pe(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+p.x+g.x,y:n.y*u.y-d.scrollTop*u.y+p.y+g.y}}function Kc(e){return Array.from(e.getClientRects())}function Gc(e){const t=Te(e),n=un(e),r=e.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+or(e);const c=-n.scrollTop;return je(r).direction==="rtl"&&(l+=me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}function qc(e,t){const n=he(e),r=Te(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,d=0;if(o){i=o.width,l=o.height;const u=rr();(!u||u&&t==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}return{width:i,height:l,x:c,y:d}}const Yc=new Set(["absolute","fixed"]);function Zc(e,t){const n=Ke(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ae(e)?at(e):Pe(1),l=e.clientWidth*i.x,c=e.clientHeight*i.y,d=o*i.x,u=r*i.y;return{width:l,height:c,x:d,y:u}}function Kr(e,t,n){let r;if(t==="viewport")r=qc(e,n);else if(t==="document")r=Gc(Te(e));else if(Ce(t))r=Zc(t,n);else{const o=Bs(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return en(r)}function Vs(e,t){const n=Be(e);return n===t||!Ce(n)||ct(n)?!1:je(n).position==="fixed"||Vs(n,t)}function Xc(e,t){const n=t.get(e);if(n)return n;let r=Et(e,[],!1).filter(c=>Ce(c)&&ut(c)!=="body"),o=null;const i=je(e).position==="fixed";let l=i?Be(e):e;for(;Ce(l)&&!ct(l);){const c=je(l),d=nr(l);!d&&c.position==="fixed"&&(o=null),(i?!d&&!o:!d&&c.position==="static"&&!!o&&Yc.has(o.position)||Tt(l)&&!d&&Vs(e,l))?r=r.filter(p=>p!==l):o=c,l=Be(l)}return t.set(e,r),r}function Qc(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?dn(t)?[]:Xc(t,this._c):[].concat(n),r],c=l[0],d=l.reduce((u,p)=>{const f=Kr(t,p,o);return u.top=me(f.top,u.top),u.right=$e(f.right,u.right),u.bottom=$e(f.bottom,u.bottom),u.left=me(f.left,u.left),u},Kr(t,c,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Jc(e){const{width:t,height:n}=$s(e);return{width:t,height:n}}function el(e,t,n){const r=Ae(t),o=Te(t),i=n==="fixed",l=Ke(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=Pe(0);function u(){d.x=or(o)}if(r||!r&&!i)if((ut(t)!=="body"||Tt(o))&&(c=un(t)),r){const h=Ke(t,!0,i,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const p=o&&!r&&!i?zs(o,c):Pe(0),f=l.left+c.scrollLeft-d.x-p.x,g=l.top+c.scrollTop-d.y-p.y;return{x:f,y:g,width:l.width,height:l.height}}function Pn(e){return je(e).position==="static"}function Gr(e,t){if(!Ae(e)||je(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Te(e)===n&&(n=n.ownerDocument.body),n}function Us(e,t){const n=he(e);if(dn(e))return n;if(!Ae(e)){let o=Be(e);for(;o&&!ct(o);){if(Ce(o)&&!Pn(o))return o;o=Be(o)}return n}let r=Gr(e,t);for(;r&&Oc(r)&&Pn(r);)r=Gr(r,t);return r&&ct(r)&&Pn(r)&&!nr(r)?n:r||zc(e)||n}const tl=async function(e){const t=this.getOffsetParent||Us,n=this.getDimensions,r=await n(e.floating);return{reference:el(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nl(e){return je(e).direction==="rtl"}const rl={convertOffsetParentRelativeRectToViewportRelativeRect:Wc,getDocumentElement:Te,getClippingRect:Qc,getOffsetParent:Us,getElementRects:tl,getClientRects:Kc,getDimensions:Jc,getScale:at,isElement:Ce,isRTL:nl};function Hs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sl(e,t){let n=null,r;const o=Te(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:p,top:f,width:g,height:h}=u;if(c||t(),!g||!h)return;const v=Ut(f),m=Ut(o.clientWidth-(p+g)),w=Ut(o.clientHeight-(f+h)),y=Ut(p),N={rootMargin:-v+"px "+-m+"px "+-w+"px "+-y+"px",threshold:me(0,$e(1,d))||1};let j=!0;function E(I){const C=I[0].intersectionRatio;if(C!==d){if(!j)return l();C?l(!1,C):r=setTimeout(()=>{l(!1,1e-7)},1e3)}C===1&&!Hs(u,e.getBoundingClientRect())&&l(),j=!1}try{n=new IntersectionObserver(E,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,N)}n.observe(e)}return l(!0),i}function ol(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,u=sr(e),p=o||i?[...u?Et(u):[],...Et(t)]:[];p.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&c?sl(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(y=>{let[S]=y;S&&S.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=h)==null||N.observe(t)})),n()}),u&&!d&&h.observe(u),h.observe(t));let v,m=d?Ke(e):null;d&&w();function w(){const y=Ke(e);m&&!Hs(m,y)&&n(),m=y,v=requestAnimationFrame(w)}return n(),()=>{var y;p.forEach(S=>{o&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),f?.(),(y=h)==null||y.disconnect(),h=null,d&&cancelAnimationFrame(v)}}const al=kc,il=Ac,cl=Rc,ll=Ic,dl=Mc,qr=Ec,ul=Tc,fl=(e,t,n)=>{const r=new Map,o={platform:rl,...n},i={...o.platform,_c:r};return jc(e,t,{...o,platform:i})};var pl=typeof document<"u",ml=function(){},qt=pl?a.useLayoutEffect:ml;function tn(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,o;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(!tn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!tn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ws(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yr(e,t){const n=Ws(e);return Math.round(t*n)/n}function kn(e){const t=a.useRef(e);return qt(()=>{t.current=e}),t}function hl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[p,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=a.useState(r);tn(g,r)||h(r);const[v,m]=a.useState(null),[w,y]=a.useState(null),S=a.useCallback(P=>{P!==I.current&&(I.current=P,m(P))},[]),N=a.useCallback(P=>{P!==C.current&&(C.current=P,y(P))},[]),j=i||v,E=l||w,I=a.useRef(null),C=a.useRef(null),M=a.useRef(p),V=d!=null,O=kn(d),$=kn(o),B=kn(u),z=a.useCallback(()=>{if(!I.current||!C.current)return;const P={placement:t,strategy:n,middleware:g};$.current&&(P.platform=$.current),fl(I.current,C.current,P).then(k=>{const G={...k,isPositioned:B.current!==!1};L.current&&!tn(M.current,G)&&(M.current=G,kt.flushSync(()=>{f(G)}))})},[g,t,n,$,B]);qt(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[u]);const L=a.useRef(!1);qt(()=>(L.current=!0,()=>{L.current=!1}),[]),qt(()=>{if(j&&(I.current=j),E&&(C.current=E),j&&E){if(O.current)return O.current(j,E,z);z()}},[j,E,z,O,V]);const K=a.useMemo(()=>({reference:I,floating:C,setReference:S,setFloating:N}),[S,N]),T=a.useMemo(()=>({reference:j,floating:E}),[j,E]),U=a.useMemo(()=>{const P={position:n,left:0,top:0};if(!T.floating)return P;const k=Yr(T.floating,p.x),G=Yr(T.floating,p.y);return c?{...P,transform:"translate("+k+"px, "+G+"px)",...Ws(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:G}},[n,c,T.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:z,refs:K,elements:T,floatingStyles:U}),[p,z,K,T,U])}const gl=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qr({element:r.current,padding:o}).fn(n):{}:r?qr({element:r,padding:o}).fn(n):{}}}},xl=(e,t)=>({...al(e),options:[e,t]}),vl=(e,t)=>({...il(e),options:[e,t]}),wl=(e,t)=>({...ul(e),options:[e,t]}),bl=(e,t)=>({...cl(e),options:[e,t]}),yl=(e,t)=>({...ll(e),options:[e,t]}),Sl=(e,t)=>({...dl(e),options:[e,t]}),Nl=(e,t)=>({...gl(e),options:[e,t]});var Cl="Arrow",Ks=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return s.jsx(W.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ks.displayName=Cl;var jl=Ks;function El(e){const[t,n]=a.useState(void 0);return ce(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,c;if("borderBoxSize"in i){const d=i.borderBoxSize,u=Array.isArray(d)?d[0]:d;l=u.inlineSize,c=u.blockSize}else l=e.offsetWidth,c=e.offsetHeight;n({width:l,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ar="Popper",[Gs,fn]=ze(ar),[Rl,qs]=Gs(ar),Ys=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null);return s.jsx(Rl,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ys.displayName=ar;var Zs="PopperAnchor",Xs=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=qs(Zs,n),l=a.useRef(null),c=te(t,l),d=a.useRef(null);return a.useEffect(()=>{const u=d.current;d.current=r?.current||l.current,u!==d.current&&i.onAnchorChange(d.current)}),r?null:s.jsx(W.div,{...o,ref:c})});Xs.displayName=Zs;var ir="PopperContent",[Ml,Pl]=Gs(ir),Qs=a.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:v,...m}=e,w=qs(ir,n),[y,S]=a.useState(null),N=te(t,A=>S(A)),[j,E]=a.useState(null),I=El(j),C=I?.width??0,M=I?.height??0,V=r+(i!=="center"?"-"+i:""),O=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},$=Array.isArray(u)?u:[u],B=$.length>0,z={padding:O,boundary:$.filter(Al),altBoundary:B},{refs:L,floatingStyles:K,placement:T,isPositioned:U,middlewareData:P}=hl({strategy:"fixed",placement:V,whileElementsMounted:(...A)=>ol(...A,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[xl({mainAxis:o+M,alignmentAxis:l}),d&&vl({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?wl():void 0,...z}),d&&bl({...z}),yl({...z,apply:({elements:A,rects:Y,availableWidth:X,availableHeight:q})=>{const{width:Z,height:Q}=Y.reference,J=A.floating.style;J.setProperty("--radix-popper-available-width",`${X}px`),J.setProperty("--radix-popper-available-height",`${q}px`),J.setProperty("--radix-popper-anchor-width",`${Z}px`),J.setProperty("--radix-popper-anchor-height",`${Q}px`)}}),j&&Nl({element:j,padding:c}),Tl({arrowWidth:C,arrowHeight:M}),g&&Sl({strategy:"referenceHidden",...z})]}),[k,G]=to(T),se=ke(v);ce(()=>{U&&se?.()},[U,se]);const oe=P.arrow?.x,ie=P.arrow?.y,re=P.arrow?.centerOffset!==0,[be,ae]=a.useState();return ce(()=>{y&&ae(window.getComputedStyle(y).zIndex)},[y]),s.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:U?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Ml,{scope:n,placedSide:k,onArrowChange:E,arrowX:oe,arrowY:ie,shouldHideArrow:re,children:s.jsx(W.div,{"data-side":k,"data-align":G,...m,ref:N,style:{...m.style,animation:U?void 0:"none"}})})})});Qs.displayName=ir;var Js="PopperArrow",kl={top:"bottom",right:"left",bottom:"top",left:"right"},eo=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Pl(Js,r),l=kl[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(jl,{...o,ref:n,style:{...o.style,display:"block"}})})});eo.displayName=Js;function Al(e){return e!==null}var Tl=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,l=o.arrow?.centerOffset!==0,c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[u,p]=to(n),f={start:"0%",center:"50%",end:"100%"}[p],g=(o.arrow?.x??0)+c/2,h=(o.arrow?.y??0)+d/2;let v="",m="";return u==="bottom"?(v=l?f:`${g}px`,m=`${-d}px`):u==="top"?(v=l?f:`${g}px`,m=`${r.floating.height+d}px`):u==="right"?(v=`${-d}px`,m=l?f:`${h}px`):u==="left"&&(v=`${r.floating.width+d}px`,m=l?f:`${h}px`),{data:{x:v,y:m}}}});function to(e){const[t,n="center"]=e.split("-");return[t,n]}var no=Ys,ro=Xs,so=Qs,oo=eo,Il="Portal",cr=a.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=a.useState(!1);ce(()=>i(!0),[]);const l=n||o&&globalThis?.document?.body;return l?xi.createPortal(s.jsx(W.div,{...r,ref:t}),l):null});cr.displayName=Il;function _l(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ao=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"}),Dl="VisuallyHidden",Ol=a.forwardRef((e,t)=>s.jsx(W.span,{...e,ref:t,style:{...ao,...e.style}}));Ol.displayName=Dl;var Ll=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},tt=new WeakMap,Ht=new WeakMap,Wt={},An=0,io=function(e){return e&&(e.host||io(e.parentNode))},Fl=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=io(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},$l=function(e,t,n,r){var o=Fl(t,Array.isArray(e)?e:[e]);Wt[n]||(Wt[n]=new WeakMap);var i=Wt[n],l=[],c=new Set,d=new Set(o),u=function(f){!f||c.has(f)||(c.add(f),u(f.parentNode))};o.forEach(u);var p=function(f){!f||d.has(f)||Array.prototype.forEach.call(f.children,function(g){if(c.has(g))p(g);else try{var h=g.getAttribute(r),v=h!==null&&h!=="false",m=(tt.get(g)||0)+1,w=(i.get(g)||0)+1;tt.set(g,m),i.set(g,w),l.push(g),m===1&&v&&Ht.set(g,!0),w===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",g,y)}})};return p(t),c.clear(),An++,function(){l.forEach(function(f){var g=tt.get(f)-1,h=i.get(f)-1;tt.set(f,g),i.set(f,h),g||(Ht.has(f)||f.removeAttribute(r),Ht.delete(f)),h||f.removeAttribute(n)}),An--,An||(tt=new WeakMap,tt=new WeakMap,Ht=new WeakMap,Wt={})}},co=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Ll(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),$l(r,o,n,"aria-hidden")):function(){return null}},Re=function(){return Re=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Re.apply(this,arguments)};function lo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Bl(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Yt="right-scroll-bar-position",Zt="width-before-scroll-bar",zl="with-scroll-bars-hidden",Vl="--removed-body-scroll-bar-size";function Tn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ul(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Hl=typeof window<"u"?a.useLayoutEffect:a.useEffect,Zr=new WeakMap;function Wl(e,t){var n=Ul(null,function(r){return e.forEach(function(o){return Tn(o,r)})});return Hl(function(){var r=Zr.get(n);if(r){var o=new Set(r),i=new Set(e),l=n.current;o.forEach(function(c){i.has(c)||Tn(c,null)}),i.forEach(function(c){o.has(c)||Tn(c,l)})}Zr.set(n,e)},[e]),n}function Kl(e){return e}function Gl(e,t){t===void 0&&(t=Kl);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(i),l=n}var d=function(){var p=l;l=[],p.forEach(i)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(p){l.push(p),u()},filter:function(p){return l=l.filter(p),n}}}};return o}function ql(e){e===void 0&&(e={});var t=Gl(null);return t.options=Re({async:!0,ssr:!1},e),t}var uo=function(e){var t=e.sideCar,n=lo(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return a.createElement(r,Re({},n))};uo.isSideCarExport=!0;function Yl(e,t){return e.useMedium(t),uo}var fo=ql(),In=function(){},pn=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:In,onWheelCapture:In,onTouchMoveCapture:In}),o=r[0],i=r[1],l=e.forwardProps,c=e.children,d=e.className,u=e.removeScrollBar,p=e.enabled,f=e.shards,g=e.sideCar,h=e.noRelative,v=e.noIsolation,m=e.inert,w=e.allowPinchZoom,y=e.as,S=y===void 0?"div":y,N=e.gapMode,j=lo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,I=Wl([n,t]),C=Re(Re({},j),o);return a.createElement(a.Fragment,null,p&&a.createElement(E,{sideCar:fo,removeScrollBar:u,shards:f,noRelative:h,noIsolation:v,inert:m,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:N}),l?a.cloneElement(a.Children.only(c),Re(Re({},C),{ref:I})):a.createElement(S,Re({},C,{className:d,ref:I}),c))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};pn.classNames={fullWidth:Zt,zeroRight:Yt};var Zl=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xl(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zl();return t&&e.setAttribute("nonce",t),e}function Ql(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Jl(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ed=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xl())&&(Ql(t,n),Jl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},td=function(){var e=ed();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},po=function(){var e=td(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},nd={left:0,top:0,right:0,gap:0},_n=function(e){return parseInt(e||"",10)||0},rd=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[_n(n),_n(r),_n(o)]},sd=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nd;var t=rd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},od=po(),it="data-scroll-locked",ad=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
.`.concat(zl,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(c,"px ").concat(r,`;
}
body[`).concat(it,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(l,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(c,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(Yt,` {
right: `).concat(c,"px ").concat(r,`;
}
.`).concat(Zt,` {
margin-right: `).concat(c,"px ").concat(r,`;
}
.`).concat(Yt," .").concat(Yt,` {
right: 0 `).concat(r,`;
}
.`).concat(Zt," .").concat(Zt,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(it,`] {
`).concat(Vl,": ").concat(c,`px;
}
`)},Xr=function(){var e=parseInt(document.body.getAttribute(it)||"0",10);return isFinite(e)?e:0},id=function(){a.useEffect(function(){return document.body.setAttribute(it,(Xr()+1).toString()),function(){var e=Xr()-1;e<=0?document.body.removeAttribute(it):document.body.setAttribute(it,e.toString())}},[])},cd=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;id();var i=a.useMemo(function(){return sd(o)},[o]);return a.createElement(od,{styles:ad(i,!t,o,n?"":"!important")})},Bn=!1;if(typeof window<"u")try{var Kt=Object.defineProperty({},"passive",{get:function(){return Bn=!0,!0}});window.addEventListener("test",Kt,Kt),window.removeEventListener("test",Kt,Kt)}catch{Bn=!1}var nt=Bn?{passive:!1}:!1,ld=function(e){return e.tagName==="TEXTAREA"},mo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ld(e)&&n[t]==="visible")},dd=function(e){return mo(e,"overflowY")},ud=function(e){return mo(e,"overflowX")},Qr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ho(e,r);if(o){var i=go(e,r),l=i[1],c=i[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fd=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pd=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ho=function(e,t){return e==="v"?dd(t):ud(t)},go=function(e,t){return e==="v"?fd(t):pd(t)},md=function(e,t){return e==="h"&&t==="rtl"?-1:1},hd=function(e,t,n,r,o){var i=md(e,window.getComputedStyle(t).direction),l=i*r,c=n.target,d=t.contains(c),u=!1,p=l>0,f=0,g=0;do{if(!c)break;var h=go(e,c),v=h[0],m=h[1],w=h[2],y=m-w-i*v;(v||y)&&ho(e,c)&&(f+=y,g+=v);var S=c.parentNode;c=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(f)<1||!p&&Math.abs(g)<1)&&(u=!0),u},Gt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jr=function(e){return[e.deltaX,e.deltaY]},es=function(e){return e&&"current"in e?e.current:e},gd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xd=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},vd=0,rt=[];function wd(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(vd++)[0],i=a.useState(po)[0],l=a.useRef(e);a.useEffect(function(){l.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Bl([e.lockRef.current],(e.shards||[]).map(es),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(m,w){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!l.current.allowPinchZoom;var y=Gt(m),S=n.current,N="deltaX"in m?m.deltaX:S[0]-y[0],j="deltaY"in m?m.deltaY:S[1]-y[1],E,I=m.target,C=Math.abs(N)>Math.abs(j)?"h":"v";if("touches"in m&&C==="h"&&I.type==="range")return!1;var M=Qr(C,I);if(!M)return!0;if(M?E=C:(E=C==="v"?"h":"v",M=Qr(C,I)),!M)return!1;if(!r.current&&"changedTouches"in m&&(N||j)&&(r.current=E),!E)return!0;var V=r.current||E;return hd(V,w,m,V==="h"?N:j)},[]),d=a.useCallback(function(m){var w=m;if(!(!rt.length||rt[rt.length-1]!==i)){var y="deltaY"in w?Jr(w):Gt(w),S=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&gd(E.delta,y)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}if(!S){var N=(l.current.shards||[]).map(es).filter(Boolean).filter(function(E){return E.contains(w.target)}),j=N.length>0?c(w,N[0]):!l.current.noIsolation;j&&w.cancelable&&w.preventDefault()}}},[]),u=a.useCallback(function(m,w,y,S){var N={name:m,delta:w,target:y,should:S,shadowParent:bd(y)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(j){return j!==N})},1)},[]),p=a.useCallback(function(m){n.current=Gt(m),r.current=void 0},[]),f=a.useCallback(function(m){u(m.type,Jr(m),m.target,c(m,e.lockRef.current))},[]),g=a.useCallback(function(m){u(m.type,Gt(m),m.target,c(m,e.lockRef.current))},[]);a.useEffect(function(){return rt.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",d,nt),document.addEventListener("touchmove",d,nt),document.addEventListener("touchstart",p,nt),function(){rt=rt.filter(function(m){return m!==i}),document.removeEventListener("wheel",d,nt),document.removeEventListener("touchmove",d,nt),document.removeEventListener("touchstart",p,nt)}},[]);var h=e.removeScrollBar,v=e.inert;return a.createElement(a.Fragment,null,v?a.createElement(i,{styles:xd(o)}):null,h?a.createElement(cd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const yd=Yl(fo,wd);var lr=a.forwardRef(function(e,t){return a.createElement(pn,Re({},e,{ref:t,sideCar:yd}))});lr.classNames=pn.classNames;var Sd=[" ","Enter","ArrowUp","ArrowDown"],Nd=[" ","Enter"],Ge="Select",[mn,hn,Cd]=Gn(Ge),[ft,pp]=ze(Ge,[Cd,fn]),gn=fn(),[jd,Ve]=ft(Ge),[Ed,Rd]=ft(Ge),xo=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:f,disabled:g,required:h,form:v}=e,m=gn(t),[w,y]=a.useState(null),[S,N]=a.useState(null),[j,E]=a.useState(!1),I=on(u),[C,M]=Ct({prop:r,defaultProp:o??!1,onChange:i,caller:Ge}),[V,O]=Ct({prop:l,defaultProp:c,onChange:d,caller:Ge}),$=a.useRef(null),B=w?v||!!w.closest("form"):!0,[z,L]=a.useState(new Set),K=Array.from(z).map(T=>T.props.value).join(";");return s.jsx(no,{...m,children:s.jsxs(jd,{required:h,scope:t,trigger:w,onTriggerChange:y,valueNode:S,onValueNodeChange:N,valueNodeHasChildren:j,onValueNodeHasChildrenChange:E,contentId:We(),value:V,onValueChange:O,open:C,onOpenChange:M,dir:I,triggerPointerDownPosRef:$,disabled:g,children:[s.jsx(mn.Provider,{scope:t,children:s.jsx(Ed,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(T=>{L(U=>new Set(U).add(T))},[]),onNativeOptionRemove:a.useCallback(T=>{L(U=>{const P=new Set(U);return P.delete(T),P})},[]),children:n})}),B?s.jsxs($o,{"aria-hidden":!0,required:h,tabIndex:-1,name:p,autoComplete:f,value:V,onChange:T=>O(T.target.value),disabled:g,form:v,children:[V===void 0?s.jsx("option",{value:""}):null,Array.from(z)]},K):null]})})};xo.displayName=Ge;var vo="SelectTrigger",wo=a.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=gn(n),l=Ve(vo,n),c=l.disabled||r,d=te(t,l.onTriggerChange),u=hn(n),p=a.useRef("touch"),[f,g,h]=zo(m=>{const w=u().filter(N=>!N.disabled),y=w.find(N=>N.value===l.value),S=Vo(w,m,y);S!==void 0&&l.onValueChange(S.value)}),v=m=>{c||(l.onOpenChange(!0),h()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return s.jsx(ro,{asChild:!0,...i,children:s.jsx(W.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Bo(l.value)?"":void 0,...o,ref:d,onClick:D(o.onClick,m=>{m.currentTarget.focus(),p.current!=="mouse"&&v(m)}),onPointerDown:D(o.onPointerDown,m=>{p.current=m.pointerType;const w=m.target;w.hasPointerCapture(m.pointerId)&&w.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(v(m),m.preventDefault())}),onKeyDown:D(o.onKeyDown,m=>{const w=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(w&&m.key===" ")&&Sd.includes(m.key)&&(v(),m.preventDefault())})})})});wo.displayName=vo;var bo="SelectValue",yo=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:l="",...c}=e,d=Ve(bo,n),{onValueNodeHasChildrenChange:u}=d,p=i!==void 0,f=te(t,d.onValueNodeChange);return ce(()=>{u(p)},[u,p]),s.jsx(W.span,{...c,ref:f,style:{pointerEvents:"none"},children:Bo(d.value)?s.jsx(s.Fragment,{children:l}):i})});yo.displayName=bo;var Md="SelectIcon",So=a.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});So.displayName=Md;var Pd="SelectPortal",No=e=>s.jsx(cr,{asChild:!0,...e});No.displayName=Pd;var qe="SelectContent",Co=a.forwardRef((e,t)=>{const n=Ve(qe,e.__scopeSelect),[r,o]=a.useState();if(ce(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?kt.createPortal(s.jsx(jo,{scope:e.__scopeSelect,children:s.jsx(mn.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(Eo,{...e,ref:t})});Co.displayName=qe;var Se=10,[jo,Ue]=ft(qe),kd="SelectContentImpl",Ad=Nt("SelectContent.RemoveScroll"),Eo=a.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:m,avoidCollisions:w,...y}=e,S=Ve(qe,n),[N,j]=a.useState(null),[E,I]=a.useState(null),C=te(t,A=>j(A)),[M,V]=a.useState(null),[O,$]=a.useState(null),B=hn(n),[z,L]=a.useState(!1),K=a.useRef(!1);a.useEffect(()=>{if(N)return co(N)},[N]),Is();const T=a.useCallback(A=>{const[Y,...X]=B().map(Q=>Q.ref.current),[q]=X.slice(-1),Z=document.activeElement;for(const Q of A)if(Q===Z||(Q?.scrollIntoView({block:"nearest"}),Q===Y&&E&&(E.scrollTop=0),Q===q&&E&&(E.scrollTop=E.scrollHeight),Q?.focus(),document.activeElement!==Z))return},[B,E]),U=a.useCallback(()=>T([M,N]),[T,M,N]);a.useEffect(()=>{z&&U()},[z,U]);const{onOpenChange:P,triggerPointerDownPosRef:k}=S;a.useEffect(()=>{if(N){let A={x:0,y:0};const Y=q=>{A={x:Math.abs(Math.round(q.pageX)-(k.current?.x??0)),y:Math.abs(Math.round(q.pageY)-(k.current?.y??0))}},X=q=>{A.x<=10&&A.y<=10?q.preventDefault():N.contains(q.target)||P(!1),document.removeEventListener("pointermove",Y),k.current=null};return k.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",X,{capture:!0})}}},[N,P,k]),a.useEffect(()=>{const A=()=>P(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[P]);const[G,se]=zo(A=>{const Y=B().filter(Z=>!Z.disabled),X=Y.find(Z=>Z.ref.current===document.activeElement),q=Vo(Y,A,X);q&&setTimeout(()=>q.ref.current.focus())}),oe=a.useCallback((A,Y,X)=>{const q=!K.current&&!X;(S.value!==void 0&&S.value===Y||q)&&(V(A),q&&(K.current=!0))},[S.value]),ie=a.useCallback(()=>N?.focus(),[N]),re=a.useCallback((A,Y,X)=>{const q=!K.current&&!X;(S.value!==void 0&&S.value===Y||q)&&$(A)},[S.value]),be=r==="popper"?zn:Ro,ae=be===zn?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:m,avoidCollisions:w}:{};return s.jsx(jo,{scope:n,content:N,viewport:E,onViewportChange:I,itemRefCallback:oe,selectedItem:M,onItemLeave:ie,itemTextRefCallback:re,focusSelectedItem:U,selectedItemText:O,position:r,isPositioned:z,searchRef:G,children:s.jsx(lr,{as:Ad,allowPinchZoom:!0,children:s.jsx(Qn,{asChild:!0,trapped:S.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:D(o,A=>{S.trigger?.focus({preventScroll:!0}),A.preventDefault()}),children:s.jsx(Xn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:s.jsx(be,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:A=>A.preventDefault(),...y,...ae,onPlaced:()=>L(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:D(y.onKeyDown,A=>{const Y=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!Y&&A.key.length===1&&se(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let q=B().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);if(["ArrowUp","End"].includes(A.key)&&(q=q.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const Z=A.target,Q=q.indexOf(Z);q=q.slice(Q+1)}setTimeout(()=>T(q)),A.preventDefault()}})})})})})})});Eo.displayName=kd;var Td="SelectItemAlignedPosition",Ro=a.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ve(qe,n),l=Ue(qe,n),[c,d]=a.useState(null),[u,p]=a.useState(null),f=te(t,C=>p(C)),g=hn(n),h=a.useRef(!1),v=a.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:y,focusSelectedItem:S}=l,N=a.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&m&&w&&y){const C=i.trigger.getBoundingClientRect(),M=u.getBoundingClientRect(),V=i.valueNode.getBoundingClientRect(),O=y.getBoundingClientRect();if(i.dir!=="rtl"){const Z=O.left-M.left,Q=V.left-Z,J=C.left-Q,Ee=C.width+J,Oe=Math.max(Ee,M.width),He=window.innerWidth-Se,pt=Tr(Q,[Se,Math.max(Se,He-Oe)]);c.style.minWidth=Ee+"px",c.style.left=pt+"px"}else{const Z=M.right-O.right,Q=window.innerWidth-V.right-Z,J=window.innerWidth-C.right-Q,Ee=C.width+J,Oe=Math.max(Ee,M.width),He=window.innerWidth-Se,pt=Tr(Q,[Se,Math.max(Se,He-Oe)]);c.style.minWidth=Ee+"px",c.style.right=pt+"px"}const $=g(),B=window.innerHeight-Se*2,z=m.scrollHeight,L=window.getComputedStyle(u),K=parseInt(L.borderTopWidth,10),T=parseInt(L.paddingTop,10),U=parseInt(L.borderBottomWidth,10),P=parseInt(L.paddingBottom,10),k=K+T+z+P+U,G=Math.min(w.offsetHeight*5,k),se=window.getComputedStyle(m),oe=parseInt(se.paddingTop,10),ie=parseInt(se.paddingBottom,10),re=C.top+C.height/2-Se,be=B-re,ae=w.offsetHeight/2,A=w.offsetTop+ae,Y=K+T+A,X=k-Y;if(Y<=re){const Z=$.length>0&&w===$[$.length-1].ref.current;c.style.bottom="0px";const Q=u.clientHeight-m.offsetTop-m.offsetHeight,J=Math.max(be,ae+(Z?ie:0)+Q+U),Ee=Y+J;c.style.height=Ee+"px"}else{const Z=$.length>0&&w===$[0].ref.current;c.style.top="0px";const J=Math.max(re,K+m.offsetTop+(Z?oe:0)+ae)+X;c.style.height=J+"px",m.scrollTop=Y-re+m.offsetTop}c.style.margin=`${Se}px 0`,c.style.minHeight=G+"px",c.style.maxHeight=B+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[g,i.trigger,i.valueNode,c,u,m,w,y,i.dir,r]);ce(()=>N(),[N]);const[j,E]=a.useState();ce(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const I=a.useCallback(C=>{C&&v.current===!0&&(N(),S?.(),v.current=!1)},[N,S]);return s.jsx(_d,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:I,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:s.jsx(W.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Ro.displayName=Td;var Id="SelectPopperPosition",zn=a.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Se,...i}=e,l=gn(n);return s.jsx(so,{...l,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})});zn.displayName=Id;var[_d,dr]=ft(qe,{}),Vn="SelectViewport",Mo=a.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Ue(Vn,n),l=dr(Vn,n),c=te(t,i.onViewportChange),d=a.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(mn.Slot,{scope:n,children:s.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:D(o.onScroll,u=>{const p=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=l;if(g?.current&&f){const h=Math.abs(d.current-p.scrollTop);if(h>0){const v=window.innerHeight-Se*2,m=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),y=Math.max(m,w);if(y<v){const S=y+h,N=Math.min(v,S),j=S-N;f.style.height=N+"px",f.style.bottom==="0px"&&(p.scrollTop=j>0?j:0,f.style.justifyContent="flex-end")}}}d.current=p.scrollTop})})})]})});Mo.displayName=Vn;var Po="SelectGroup",[Dd,Od]=ft(Po),Ld=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=We();return s.jsx(Dd,{scope:n,id:o,children:s.jsx(W.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Ld.displayName=Po;var ko="SelectLabel",Fd=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Od(ko,n);return s.jsx(W.div,{id:o.id,...r,ref:t})});Fd.displayName=ko;var nn="SelectItem",[$d,Ao]=ft(nn),To=a.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...l}=e,c=Ve(nn,n),d=Ue(nn,n),u=c.value===r,[p,f]=a.useState(i??""),[g,h]=a.useState(!1),v=te(t,S=>d.itemRefCallback?.(S,r,o)),m=We(),w=a.useRef("touch"),y=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx($d,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:a.useCallback(S=>{f(N=>N||(S?.textContent??"").trim())},[]),children:s.jsx(mn.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:s.jsx(W.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:v,onFocus:D(l.onFocus,()=>h(!0)),onBlur:D(l.onBlur,()=>h(!1)),onClick:D(l.onClick,()=>{w.current!=="mouse"&&y()}),onPointerUp:D(l.onPointerUp,()=>{w.current==="mouse"&&y()}),onPointerDown:D(l.onPointerDown,S=>{w.current=S.pointerType}),onPointerMove:D(l.onPointerMove,S=>{w.current=S.pointerType,o?d.onItemLeave?.():w.current==="mouse"&&S.currentTarget.focus({preventScroll:!0})}),onPointerLeave:D(l.onPointerLeave,S=>{S.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:D(l.onKeyDown,S=>{d.searchRef?.current!==""&&S.key===" "||(Nd.includes(S.key)&&y(),S.key===" "&&S.preventDefault())})})})})});To.displayName=nn;var xt="SelectItemText",Io=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,l=Ve(xt,n),c=Ue(xt,n),d=Ao(xt,n),u=Rd(xt,n),[p,f]=a.useState(null),g=te(t,y=>f(y),d.onItemTextChange,y=>c.itemTextRefCallback?.(y,d.value,d.disabled)),h=p?.textContent,v=a.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:h},d.value),[d.disabled,d.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=u;return ce(()=>(m(v),()=>w(v)),[m,w,v]),s.jsxs(s.Fragment,{children:[s.jsx(W.span,{id:d.textId,...i,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?kt.createPortal(i.children,l.valueNode):null]})});Io.displayName=xt;var _o="SelectItemIndicator",Do=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ao(_o,n).isSelected?s.jsx(W.span,{"aria-hidden":!0,...r,ref:t}):null});Do.displayName=_o;var Un="SelectScrollUpButton",Oo=a.forwardRef((e,t)=>{const n=Ue(Un,e.__scopeSelect),r=dr(Un,e.__scopeSelect),[o,i]=a.useState(!1),l=te(t,r.onScrollButtonChange);return ce(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollTop>0;i(u)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?s.jsx(Fo,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});Oo.displayName=Un;var Hn="SelectScrollDownButton",Lo=a.forwardRef((e,t)=>{const n=Ue(Hn,e.__scopeSelect),r=dr(Hn,e.__scopeSelect),[o,i]=a.useState(!1),l=te(t,r.onScrollButtonChange);return ce(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollHeight-d.clientHeight,p=Math.ceil(d.scrollTop)<u;i(p)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?s.jsx(Fo,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});Lo.displayName=Hn;var Fo=a.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ue("SelectScrollButton",n),l=a.useRef(null),c=hn(n),d=a.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),ce(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:D(o.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:D(o.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:D(o.onPointerLeave,()=>{d()})})}),Bd="SelectSeparator",zd=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(W.div,{"aria-hidden":!0,...r,ref:t})});zd.displayName=Bd;var Wn="SelectArrow",Vd=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=gn(n),i=Ve(Wn,n),l=Ue(Wn,n);return i.open&&l.position==="popper"?s.jsx(oo,{...o,...r,ref:t}):null});Vd.displayName=Wn;var Ud="SelectBubbleInput",$o=a.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=a.useRef(null),i=te(r,o),l=_l(t);return a.useEffect(()=>{const c=o.current;if(!c)return;const d=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&p){const f=new Event("change",{bubbles:!0});p.call(c,t),c.dispatchEvent(f)}},[l,t]),s.jsx(W.select,{...n,style:{...ao,...n.style},ref:i,defaultValue:t})});$o.displayName=Ud;function Bo(e){return e===""||e===void 0}function zo(e){const t=ke(e),n=a.useRef(""),r=a.useRef(0),o=a.useCallback(l=>{const c=n.current+l;t(c),(function d(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=a.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Vo(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=Hd(e,Math.max(i,0));o.length===1&&(l=l.filter(u=>u!==n));const d=l.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function Hd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Wd=xo,Kd=wo,Gd=yo,qd=So,Yd=No,Zd=Co,Xd=Mo,Qd=To,Jd=Io,eu=Do,tu=Oo,nu=Lo;/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ru=ne("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const su=ne("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ou=ne("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ot=ne("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ur=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Uo=ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ho=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const au=ne("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iu=ne("Coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ts=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cu=ne("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lu=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ns=ne("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const du=ne("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uu=ne("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fu=ne("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rs=ne("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pu=ne("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mu=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hu=ne("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ss=ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
* @license lucide-react v0.468.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gu=ne("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function vt({...e}){return s.jsx(Wd,{"data-slot":"select",...e})}function wt({...e}){return s.jsx(Gd,{"data-slot":"select-value",...e})}function bt({className:e,size:t="default",children:n,...r}){return s.jsxs(Kd,{"data-slot":"select-trigger","data-size":t,className:F("border-gray-300 dark:border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-foreground dark:[&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 hover:border-gray-400 dark:hover:border-gray-500 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow,border-color] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,s.jsx(qd,{asChild:!0,children:s.jsx(ur,{className:"size-4 opacity-70"})})]})}function yt({className:e,children:t,position:n="popper",...r}){return s.jsx(Yd,{children:s.jsxs(Zd,{"data-slot":"select-content",className:F("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(xu,{}),s.jsx(Xd,{className:F("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),s.jsx(vu,{})]})})}function Fe({className:e,children:t,...n}){return s.jsxs(Qd,{"data-slot":"select-item",className:F("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(eu,{children:s.jsx(ot,{className:"size-4"})})}),s.jsx(Jd,{children:t})]})}function xu({className:e,...t}){return s.jsx(tu,{"data-slot":"select-scroll-up-button",className:F("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Ho,{className:"size-4"})})}function vu({className:e,...t}){return s.jsx(nu,{"data-slot":"select-scroll-down-button",className:F("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(ur,{className:"size-4"})})}var Kn=["Enter"," "],wu=["ArrowDown","PageUp","Home"],Wo=["ArrowUp","PageDown","End"],bu=[...wu,...Wo],yu={ltr:[...Kn,"ArrowRight"],rtl:[...Kn,"ArrowLeft"]},Su={ltr:["ArrowLeft"],rtl:["ArrowRight"]},It="Menu",[Rt,Nu,Cu]=Gn(It),[Ye,Ko]=ze(It,[Cu,fn,an]),xn=fn(),Go=an(),[ju,Ze]=Ye(It),[Eu,_t]=Ye(It),qo=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:l=!0}=e,c=xn(t),[d,u]=a.useState(null),p=a.useRef(!1),f=ke(i),g=on(o);return a.useEffect(()=>{const h=()=>{p.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>p.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),s.jsx(no,{...c,children:s.jsx(ju,{scope:t,open:n,onOpenChange:f,content:d,onContentChange:u,children:s.jsx(Eu,{scope:t,onClose:a.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:g,modal:l,children:r})})})};qo.displayName=It;var Ru="MenuAnchor",fr=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=xn(n);return s.jsx(ro,{...o,...r,ref:t})});fr.displayName=Ru;var pr="MenuPortal",[Mu,Yo]=Ye(pr,{forceMount:void 0}),Zo=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Ze(pr,t);return s.jsx(Mu,{scope:t,forceMount:n,children:s.jsx(lt,{present:n||i.open,children:s.jsx(cr,{asChild:!0,container:o,children:r})})})};Zo.displayName=pr;var we="MenuContent",[Pu,mr]=Ye(we),Xo=a.forwardRef((e,t)=>{const n=Yo(we,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ze(we,e.__scopeMenu),l=_t(we,e.__scopeMenu);return s.jsx(Rt.Provider,{scope:e.__scopeMenu,children:s.jsx(lt,{present:r||i.open,children:s.jsx(Rt.Slot,{scope:e.__scopeMenu,children:l.modal?s.jsx(ku,{...o,ref:t}):s.jsx(Au,{...o,ref:t})})})})}),ku=a.forwardRef((e,t)=>{const n=Ze(we,e.__scopeMenu),r=a.useRef(null),o=te(t,r);return a.useEffect(()=>{const i=r.current;if(i)return co(i)},[]),s.jsx(hr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:D(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Au=a.forwardRef((e,t)=>{const n=Ze(we,e.__scopeMenu);return s.jsx(hr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Tu=Nt("MenuContent.ScrollLock"),hr=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:g,onDismiss:h,disableOutsideScroll:v,...m}=e,w=Ze(we,n),y=_t(we,n),S=xn(n),N=Go(n),j=Nu(n),[E,I]=a.useState(null),C=a.useRef(null),M=te(t,C,w.onContentChange),V=a.useRef(0),O=a.useRef(""),$=a.useRef(0),B=a.useRef(null),z=a.useRef("right"),L=a.useRef(0),K=v?lr:a.Fragment,T=v?{as:Tu,allowPinchZoom:!0}:void 0,U=k=>{const G=O.current+k,se=j().filter(A=>!A.disabled),oe=document.activeElement,ie=se.find(A=>A.ref.current===oe)?.textValue,re=se.map(A=>A.textValue),be=Hu(re,G,ie),ae=se.find(A=>A.textValue===be)?.ref.current;(function A(Y){O.current=Y,window.clearTimeout(V.current),Y!==""&&(V.current=window.setTimeout(()=>A(""),1e3))})(G),ae&&setTimeout(()=>ae.focus())};a.useEffect(()=>()=>window.clearTimeout(V.current),[]),Is();const P=a.useCallback(k=>z.current===B.current?.side&&Ku(k,B.current?.area),[]);return s.jsx(Pu,{scope:n,searchRef:O,onItemEnter:a.useCallback(k=>{P(k)&&k.preventDefault()},[P]),onItemLeave:a.useCallback(k=>{P(k)||(C.current?.focus(),I(null))},[P]),onTriggerLeave:a.useCallback(k=>{P(k)&&k.preventDefault()},[P]),pointerGraceTimerRef:$,onPointerGraceIntentChange:a.useCallback(k=>{B.current=k},[]),children:s.jsx(K,{...T,children:s.jsx(Qn,{asChild:!0,trapped:o,onMountAutoFocus:D(i,k=>{k.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:s.jsx(Xn,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:g,onDismiss:h,children:s.jsx(hs,{asChild:!0,...N,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:I,onEntryFocus:D(d,k=>{y.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(so,{role:"menu","aria-orientation":"vertical","data-state":pa(w.open),"data-radix-menu-content":"",dir:y.dir,...S,...m,ref:M,style:{outline:"none",...m.style},onKeyDown:D(m.onKeyDown,k=>{const se=k.target.closest("[data-radix-menu-content]")===k.currentTarget,oe=k.ctrlKey||k.altKey||k.metaKey,ie=k.key.length===1;se&&(k.key==="Tab"&&k.preventDefault(),!oe&&ie&&U(k.key));const re=C.current;if(k.target!==re||!bu.includes(k.key))return;k.preventDefault();const ae=j().filter(A=>!A.disabled).map(A=>A.ref.current);Wo.includes(k.key)&&ae.reverse(),Vu(ae)}),onBlur:D(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(V.current),O.current="")}),onPointerMove:D(e.onPointerMove,Mt(k=>{const G=k.target,se=L.current!==k.clientX;if(k.currentTarget.contains(G)&&se){const oe=k.clientX>L.current?"right":"left";z.current=oe,L.current=k.clientX}}))})})})})})})});Xo.displayName=we;var Iu="MenuGroup",gr=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(W.div,{role:"group",...r,ref:t})});gr.displayName=Iu;var _u="MenuLabel",Qo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(W.div,{...r,ref:t})});Qo.displayName=_u;var rn="MenuItem",os="menu.itemSelect",vn=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=a.useRef(null),l=_t(rn,e.__scopeMenu),c=mr(rn,e.__scopeMenu),d=te(t,i),u=a.useRef(!1),p=()=>{const f=i.current;if(!n&&f){const g=new CustomEvent(os,{bubbles:!0,cancelable:!0});f.addEventListener(os,h=>r?.(h),{once:!0}),ls(f,g),g.defaultPrevented?u.current=!1:l.onClose()}};return s.jsx(Jo,{...o,ref:d,disabled:n,onClick:D(e.onClick,p),onPointerDown:f=>{e.onPointerDown?.(f),u.current=!0},onPointerUp:D(e.onPointerUp,f=>{u.current||f.currentTarget?.click()}),onKeyDown:D(e.onKeyDown,f=>{const g=c.searchRef.current!=="";n||g&&f.key===" "||Kn.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});vn.displayName=rn;var Jo=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,l=mr(rn,n),c=Go(n),d=a.useRef(null),u=te(t,d),[p,f]=a.useState(!1),[g,h]=a.useState("");return a.useEffect(()=>{const v=d.current;v&&h((v.textContent??"").trim())},[i.children]),s.jsx(Rt.ItemSlot,{scope:n,disabled:r,textValue:o??g,children:s.jsx(gs,{asChild:!0,...c,focusable:!r,children:s.jsx(W.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:D(e.onPointerMove,Mt(v=>{r?l.onItemLeave(v):(l.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:D(e.onPointerLeave,Mt(v=>l.onItemLeave(v))),onFocus:D(e.onFocus,()=>f(!0)),onBlur:D(e.onBlur,()=>f(!1))})})})}),Du="MenuCheckboxItem",ea=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return s.jsx(oa,{scope:e.__scopeMenu,checked:n,children:s.jsx(vn,{role:"menuitemcheckbox","aria-checked":sn(n)?"mixed":n,...o,ref:t,"data-state":vr(n),onSelect:D(o.onSelect,()=>r?.(sn(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ea.displayName=Du;var ta="MenuRadioGroup",[Ou,Lu]=Ye(ta,{value:void 0,onValueChange:()=>{}}),na=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=ke(r);return s.jsx(Ou,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(gr,{...o,ref:t})})});na.displayName=ta;var ra="MenuRadioItem",sa=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=Lu(ra,e.__scopeMenu),i=n===o.value;return s.jsx(oa,{scope:e.__scopeMenu,checked:i,children:s.jsx(vn,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":vr(i),onSelect:D(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});sa.displayName=ra;var xr="MenuItemIndicator",[oa,Fu]=Ye(xr,{checked:!1}),aa=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Fu(xr,n);return s.jsx(lt,{present:r||sn(i.checked)||i.checked===!0,children:s.jsx(W.span,{...o,ref:t,"data-state":vr(i.checked)})})});aa.displayName=xr;var $u="MenuSeparator",ia=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(W.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});ia.displayName=$u;var Bu="MenuArrow",ca=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=xn(n);return s.jsx(oo,{...o,...r,ref:t})});ca.displayName=Bu;var zu="MenuSub",[mp,la]=Ye(zu),St="MenuSubTrigger",da=a.forwardRef((e,t)=>{const n=Ze(St,e.__scopeMenu),r=_t(St,e.__scopeMenu),o=la(St,e.__scopeMenu),i=mr(St,e.__scopeMenu),l=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,u={__scopeMenu:e.__scopeMenu},p=a.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return a.useEffect(()=>p,[p]),a.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),d(null)}},[c,d]),s.jsx(fr,{asChild:!0,...u,children:s.jsx(Jo,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":pa(n.open),...e,ref:cs(t,o.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:D(e.onPointerMove,Mt(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:D(e.onPointerLeave,Mt(f=>{p();const g=n.content?.getBoundingClientRect();if(g){const h=n.content?.dataset.side,v=h==="right",m=v?-5:5,w=g[v?"left":"right"],y=g[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+m,y:f.clientY},{x:w,y:g.top},{x:y,y:g.top},{x:y,y:g.bottom},{x:w,y:g.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:D(e.onKeyDown,f=>{const g=i.searchRef.current!=="";e.disabled||g&&f.key===" "||yu[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});da.displayName=St;var ua="MenuSubContent",fa=a.forwardRef((e,t)=>{const n=Yo(we,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ze(we,e.__scopeMenu),l=_t(we,e.__scopeMenu),c=la(ua,e.__scopeMenu),d=a.useRef(null),u=te(t,d);return s.jsx(Rt.Provider,{scope:e.__scopeMenu,children:s.jsx(lt,{present:r||i.open,children:s.jsx(Rt.Slot,{scope:e.__scopeMenu,children:s.jsx(hr,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:u,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{l.isUsingKeyboardRef.current&&d.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:D(e.onFocusOutside,p=>{p.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:D(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:D(e.onKeyDown,p=>{const f=p.currentTarget.contains(p.target),g=Su[l.dir].includes(p.key);f&&g&&(i.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});fa.displayName=ua;function pa(e){return e?"open":"closed"}function sn(e){return e==="indeterminate"}function vr(e){return sn(e)?"indeterminate":e?"checked":"unchecked"}function Vu(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Uu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Hu(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=Uu(e,Math.max(i,0));o.length===1&&(l=l.filter(u=>u!==n));const d=l.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function Wu(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const c=t[i],d=t[l],u=c.x,p=c.y,f=d.x,g=d.y;p>r!=g>r&&n<(f-u)*(r-p)/(g-p)+u&&(o=!o)}return o}function Ku(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Wu(n,t)}function Mt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Gu=qo,qu=fr,Yu=Zo,Zu=Xo,Xu=gr,Qu=Qo,Ju=vn,ef=ea,tf=na,nf=sa,rf=aa,sf=ia,of=ca,af=da,cf=fa,wn="DropdownMenu",[lf,hp]=ze(wn,[Ko]),le=Ko(),[df,ma]=lf(wn),ha=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,d=le(t),u=a.useRef(null),[p,f]=Ct({prop:o,defaultProp:i??!1,onChange:l,caller:wn});return s.jsx(df,{scope:t,triggerId:We(),triggerRef:u,contentId:We(),open:p,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(g=>!g),[f]),modal:c,children:s.jsx(Gu,{...d,open:p,onOpenChange:f,dir:r,modal:c,children:n})})};ha.displayName=wn;var ga="DropdownMenuTrigger",xa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=ma(ga,n),l=le(n);return s.jsx(qu,{asChild:!0,...l,children:s.jsx(W.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:cs(t,i.triggerRef),onPointerDown:D(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:D(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});xa.displayName=ga;var uf="DropdownMenuPortal",va=e=>{const{__scopeDropdownMenu:t,...n}=e,r=le(t);return s.jsx(Yu,{...r,...n})};va.displayName=uf;var wa="DropdownMenuContent",ba=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ma(wa,n),i=le(n),l=a.useRef(!1);return s.jsx(Zu,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:D(e.onCloseAutoFocus,c=>{l.current||o.triggerRef.current?.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:D(e.onInteractOutside,c=>{const d=c.detail.originalEvent,u=d.button===0&&d.ctrlKey===!0,p=d.button===2||u;(!o.modal||p)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ba.displayName=wa;var ff="DropdownMenuGroup",pf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(Xu,{...o,...r,ref:t})});pf.displayName=ff;var mf="DropdownMenuLabel",ya=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(Qu,{...o,...r,ref:t})});ya.displayName=mf;var hf="DropdownMenuItem",Sa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(Ju,{...o,...r,ref:t})});Sa.displayName=hf;var gf="DropdownMenuCheckboxItem",Na=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(ef,{...o,...r,ref:t})});Na.displayName=gf;var xf="DropdownMenuRadioGroup",vf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(tf,{...o,...r,ref:t})});vf.displayName=xf;var wf="DropdownMenuRadioItem",Ca=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(nf,{...o,...r,ref:t})});Ca.displayName=wf;var bf="DropdownMenuItemIndicator",ja=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(rf,{...o,...r,ref:t})});ja.displayName=bf;var yf="DropdownMenuSeparator",Ea=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(sf,{...o,...r,ref:t})});Ea.displayName=yf;var Sf="DropdownMenuArrow",Nf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(of,{...o,...r,ref:t})});Nf.displayName=Sf;var Cf="DropdownMenuSubTrigger",Ra=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(af,{...o,...r,ref:t})});Ra.displayName=Cf;var jf="DropdownMenuSubContent",Ma=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=le(n);return s.jsx(cf,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ma.displayName=jf;var Ef=ha,Rf=xa,Mf=va,Pa=ba,ka=ya,Aa=Sa,Ta=Na,Ia=Ca,_a=ja,Da=Ea,Oa=Ra,La=Ma;const Pf=Ef,kf=Rf,Af=a.forwardRef(({className:e,inset:t,children:n,...r},o)=>s.jsxs(Oa,{ref:o,className:F("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,s.jsx(Uo,{className:"ml-auto h-4 w-4"})]}));Af.displayName=Oa.displayName;const Tf=a.forwardRef(({className:e,...t},n)=>s.jsx(La,{ref:n,className:F("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Tf.displayName=La.displayName;const Fa=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Mf,{children:s.jsx(Pa,{ref:r,sideOffset:t,className:F("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Fa.displayName=Pa.displayName;const ue=a.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(Aa,{ref:r,className:F("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ue.displayName=Aa.displayName;const If=a.forwardRef(({className:e,children:t,checked:n,...r},o)=>s.jsxs(Ta,{ref:o,className:F("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(_a,{children:s.jsx(ot,{className:"h-4 w-4"})})}),t]}));If.displayName=Ta.displayName;const _f=a.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Ia,{ref:r,className:F("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(_a,{children:s.jsx(cu,{className:"h-4 w-4 fill-current"})})}),t]}));_f.displayName=Ia.displayName;const Df=a.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(ka,{ref:r,className:F("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Df.displayName=ka.displayName;const Of=a.forwardRef(({className:e,...t},n)=>s.jsx(Da,{ref:n,className:F("-mx-1 my-1 h-px bg-muted",e),...t}));Of.displayName=Da.displayName;class Lf{constructor(){Cn(this,"api",null);Cn(this,"messageListeners",new Map);window.acquireVsCodeApi&&(this.api=window.acquireVsCodeApi()),window.addEventListener("message",t=>{const n=t.data;this.notifyListeners(n.type,n)})}postMessage(t){this.api?this.api.postMessage(t):console.warn("VSCode API not available, message not sent:",t)}onMessage(t,n){return this.messageListeners.has(t)||this.messageListeners.set(t,new Set),this.messageListeners.get(t).add(n),()=>{this.messageListeners.get(t)?.delete(n)}}notifyListeners(t,n){const r=this.messageListeners.get(t);r&&r.forEach(o=>o(n))}setState(t){this.api&&this.api.setState(t)}getState(){return this.api?this.api.getState():null}refreshAll(){this.postMessage({type:"refresh-all"})}getSpecs(){this.postMessage({type:"get-specs"})}getTasks(t){this.postMessage({type:"get-tasks",specName:t})}updateTaskStatus(t,n,r){this.postMessage({type:"update-task-status",specName:t,taskId:n,status:r})}saveDocument(t,n,r){this.postMessage({type:"save-document",specName:t,docType:n,content:r})}getApprovals(){this.postMessage({type:"get-approvals"})}getApprovalCategories(){this.postMessage({type:"get-approval-categories"})}approveRequest(t,n){this.postMessage({type:"approve-request",id:t,response:n})}rejectRequest(t,n){this.postMessage({type:"reject-request",id:t,response:n})}requestRevisionRequest(t,n,r,o){this.postMessage({type:"request-revision-request",id:t,response:n,annotations:r,comments:o})}getApprovalContent(t){this.postMessage({type:"get-approval-content",id:t})}batchApprove(t,n){this.postMessage({type:"batch-approve",ids:t,response:n})}batchReject(t,n){this.postMessage({type:"batch-reject",ids:t,response:n})}batchRequestRevision(t,n){this.postMessage({type:"batch-request-revision",ids:t,response:n})}batchUndo(t){this.postMessage({type:"batch-undo",ids:t})}getSteering(){this.postMessage({type:"get-steering"})}getSpecDocuments(t){this.postMessage({type:"get-spec-documents",specName:t})}getSteeringDocuments(){this.postMessage({type:"get-steering-documents"})}openDocument(t,n){this.postMessage({type:"open-document",specName:t,docType:n})}openSteeringDocument(t){this.postMessage({type:"open-steering-document",docType:t})}getSelectedSpec(){this.postMessage({type:"get-selected-spec"})}setSelectedSpec(t){this.postMessage({type:"set-selected-spec",specName:t})}getConfig(){this.postMessage({type:"get-config"})}getArchivedSpecs(){this.postMessage({type:"get-archived-specs"})}archiveSpec(t){this.postMessage({type:"archive-spec",specName:t})}unarchiveSpec(t){this.postMessage({type:"unarchive-spec",specName:t})}openExternalUrl(t){this.postMessage({type:"open-external-url",url:t})}getLanguagePreference(){this.postMessage({type:"get-language-preference"})}setLanguagePreference(t){this.postMessage({type:"set-language-preference",language:t})}getWorkflowRoot(){this.postMessage({type:"get-workflow-root"})}setWorkflowRoot(t){this.postMessage({type:"set-workflow-root",path:t})}browseWorkflowRoot(){this.postMessage({type:"browse-workflow-root"})}resetWorkflowRoot(){this.postMessage({type:"reset-workflow-root"})}getLogs(t){this.postMessage({type:"get-logs",specName:t})}searchLogs(t,n){this.postMessage({type:"search-logs",specName:t,query:n})}}const _=new Lf;function Ff(e={}){const{enabled:t=!0,volume:n=.3,soundUris:r=null}=e,o=a.useRef(new Map),i=a.useRef(!1);a.useEffect(()=>{const h=()=>{i.current=!0,console.log("User interaction detected - audio playback now allowed"),document.removeEventListener("click",h),document.removeEventListener("keydown",h),document.removeEventListener("touchstart",h)};return document.addEventListener("click",h,{passive:!0}),document.addEventListener("keydown",h,{passive:!0}),document.addEventListener("touchstart",h,{passive:!0}),()=>{document.removeEventListener("click",h),document.removeEventListener("keydown",h),document.removeEventListener("touchstart",h)}},[]);const l=a.useCallback(h=>{if(r&&r[h])return console.log("Found sound URI via PostMessage:",r[h]),r[h];const v=window.soundURIs;if(v&&v[h])return console.log("Found sound URI via window.soundURIs:",v[h]),v[h];const m=document.getElementById("root");if(m){const w=h==="approval-pending"?m.getAttribute("data-approval-sound-uri"):m.getAttribute("data-task-completed-sound-uri");if(w)return console.log("Found sound URI via data attribute:",w),w}return console.warn(`Sound URI not found for: ${h}`,{postMessageUris:r,windowSoundURIs:v,requestedSound:h,soundURIsReady:window.soundURIsReady}),null},[r]),c=a.useCallback(h=>{if(!t)return null;let v=o.current.get(h);if(!v)try{v=new Audio;const m=l(h);if(!m)return null;v.src=m,console.log("Set audio source to:",v.src),v.volume=n,v.preload="auto",v.addEventListener("error",w=>{console.warn(`Failed to load sound: ${h}`,w),o.current.delete(h)}),o.current.set(h,v)}catch(m){return console.warn(`Failed to create audio element for ${h}:`,m),null}return v&&(v.volume=n),v},[t,n,l]),d=a.useCallback(async h=>{if(console.log("playNotification called with:",{sound:h,enabled:t,userHasInteracted:i.current}),!t){console.log("Sound notifications disabled");return}if(!i.current){console.warn("Cannot play sound - user has not interacted with page yet (browser autoplay restriction)");return}try{const v=c(h);if(!v){console.warn("No audio element available for sound:",h);return}console.log("Playing sound:",h,"with audio element:",v),v.currentTime=0;const m=v.play();m?(console.log("Awaiting audio playback..."),await m,console.log("Audio playback completed successfully")):console.log("Audio play() did not return promise (legacy browser)")}catch(v){console.warn(`Sound notification blocked or failed for ${h}:`,v)}},[t,c]),u=a.useCallback(()=>d("approval-pending"),[d]),p=a.useCallback(()=>d("task-completed"),[d]),f=a.useCallback(h=>d(h),[d]),g=a.useCallback(()=>{o.current.forEach(h=>{h.pause(),h.removeAttribute("src"),h.load()}),o.current.clear()},[]);return{playApprovalPending:u,playTaskCompleted:p,testSound:f,cleanup:g,isEnabled:t}}const $a=a.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:F("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));$a.displayName="Input";function $f({stats:e}){const{t}=Pt();return e?s.jsx(fe,{className:"mb-6",children:s.jsx(pe,{className:"p-4",children:s.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-2xl font-bold",children:e.totalEntries}),s.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.stats.totalEntries")})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.totalLinesAdded}),s.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.stats.linesAdded")})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-2xl font-bold text-red-600",children:e.totalLinesRemoved}),s.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.stats.linesRemoved")})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.totalFilesChanged}),s.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.stats.filesChanged")})]})]})})}):null}function Bf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const Ba=a.forwardRef(Bf);function zf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const za=a.forwardRef(zf);function Vf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M21 6.375c0 2.692-4.03 4.875-9 4.875S3 9.067 3 6.375 7.03 1.5 12 1.5s9 2.183 9 4.875Z"}),a.createElement("path",{d:"M12 12.75c2.685 0 5.19-.586 7.078-1.609a8.283 8.283 0 0 0 1.897-1.384c.016.121.025.244.025.368C21 12.817 16.97 15 12 15s-9-2.183-9-4.875c0-.124.009-.247.025-.368a8.285 8.285 0 0 0 1.897 1.384C6.809 12.164 9.315 12.75 12 12.75Z"}),a.createElement("path",{d:"M12 16.5c2.685 0 5.19-.586 7.078-1.609a8.282 8.282 0 0 0 1.897-1.384c.016.121.025.244.025.368 0 2.692-4.03 4.875-9 4.875s-9-2.183-9-4.875c0-.124.009-.247.025-.368a8.284 8.284 0 0 0 1.897 1.384C6.809 15.914 9.315 16.5 12 16.5Z"}),a.createElement("path",{d:"M12 20.25c2.685 0 5.19-.586 7.078-1.609a8.282 8.282 0 0 0 1.897-1.384c.016.121.025.244.025.368 0 2.692-4.03 4.875-9 4.875s-9-2.183-9-4.875c0-.124.009-.247.025-.368a8.284 8.284 0 0 0 1.897 1.384C6.809 19.664 9.315 20.25 12 20.25Z"}))}const Uf=a.forwardRef(Vf);function Hf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Zm14.25 6a.75.75 0 0 1-.22.53l-2.25 2.25a.75.75 0 1 1-1.06-1.06L15.44 12l-1.72-1.72a.75.75 0 1 1 1.06-1.06l2.25 2.25c.141.14.22.331.22.53Zm-10.28-.53a.75.75 0 0 0 0 1.06l2.25 2.25a.75.75 0 1 0 1.06-1.06L8.56 12l1.72-1.72a.75.75 0 1 0-1.06-1.06l-2.25 2.25Z",clipRule:"evenodd"}))}const Wf=a.forwardRef(Hf);function Kf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M12.378 1.602a.75.75 0 0 0-.756 0L3 6.632l9 5.25 9-5.25-8.622-5.03ZM21.75 7.93l-9 5.25v9l8.628-5.032a.75.75 0 0 0 .372-.648V7.93ZM11.25 22.18v-9l-9-5.25v8.57a.75.75 0 0 0 .372.648l8.628 5.033Z"}))}const Gf=a.forwardRef(Kf);function qf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 0 0-.945-5.003 12.754 12.754 0 0 1-4.339 2.708 18.991 18.991 0 0 1-.214 4.772 17.165 17.165 0 0 0 5.498-2.477ZM14.634 15.55a17.324 17.324 0 0 0 .332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 0 0 .332 4.647 17.385 17.385 0 0 0 5.268 0ZM9.772 17.119a18.963 18.963 0 0 0 4.456 0A17.182 17.182 0 0 1 12 21.724a17.18 17.18 0 0 1-2.228-4.605ZM7.777 15.23a18.87 18.87 0 0 1-.214-4.774 12.753 12.753 0 0 1-4.34-2.708 9.711 9.711 0 0 0-.944 5.004 17.165 17.165 0 0 0 5.498 2.477ZM21.356 14.752a9.765 9.765 0 0 1-7.478 6.817 18.64 18.64 0 0 0 1.988-4.718 18.627 18.627 0 0 0 5.49-2.098ZM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 0 0 1.988 4.718 9.765 9.765 0 0 1-7.478-6.816ZM13.878 2.43a9.755 9.755 0 0 1 6.116 3.986 11.267 11.267 0 0 1-3.746 2.504 18.63 18.63 0 0 0-2.37-6.49ZM12 2.276a17.152 17.152 0 0 1 2.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0 1 12 2.276ZM10.122 2.43a18.629 18.629 0 0 0-2.37 6.49 11.266 11.266 0 0 1-3.746-2.504 9.754 9.754 0 0 1 6.116-3.985Z"}))}const Yf=a.forwardRef(qf);function Zf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M19.902 4.098a3.75 3.75 0 0 0-5.304 0l-4.5 4.5a3.75 3.75 0 0 0 1.035 6.037.75.75 0 0 1-.646 1.353 5.25 5.25 0 0 1-1.449-8.45l4.5-4.5a5.25 5.25 0 1 1 7.424 7.424l-1.757 1.757a.75.75 0 1 1-1.06-1.06l1.757-1.757a3.75 3.75 0 0 0 0-5.304Zm-7.389 4.267a.75.75 0 0 1 1-.353 5.25 5.25 0 0 1 1.449 8.45l-4.5 4.5a5.25 5.25 0 1 1-7.424-7.424l1.757-1.757a.75.75 0 1 1 1.06 1.06l-1.757 1.757a3.75 3.75 0 1 0 5.304 5.304l4.5-4.5a3.75 3.75 0 0 0-1.035-6.037.75.75 0 0 1-.354-1Z",clipRule:"evenodd"}))}const Xf=a.forwardRef(Zf),Qf={apiEndpoints:Yf,components:Gf,functions:Wf,classes:Uf,integrations:Xf},Jf={apiEndpoints:"text-blue-500",components:"text-purple-500",functions:"text-green-500",classes:"text-orange-500",integrations:"text-indigo-500"};function gt({type:e,artifacts:t,className:n=""}){const{t:r}=Pt(),[o,i]=a.useState(!1);if(!t||t.length===0)return null;const l={apiEndpoints:r("logs.artifacts.apiEndpoints"),components:r("logs.artifacts.components"),functions:r("logs.artifacts.functions"),classes:r("logs.artifacts.classes"),integrations:r("logs.artifacts.integrations")},c=Qf[e],d=l[e],u=Jf[e];return s.jsxs("div",{className:`mb-6 ${n}`,children:[s.jsxs("button",{onClick:()=>i(!o),className:"w-full flex items-center justify-between hover:opacity-80 transition-opacity py-2 px-3 rounded hover:bg-muted/50",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(c,{className:`w-5 h-5 ${u}`}),s.jsxs("h3",{className:`text-sm font-semibold ${u}`,children:[d," (",t.length,")"]})]}),o?s.jsx(Ba,{className:`w-4 h-4 ${u}`}):s.jsx(za,{className:`w-4 h-4 ${u}`})]}),o&&s.jsxs("div",{className:"space-y-3 pl-7 mt-3 pt-3 border-t border-muted",children:[e==="apiEndpoints"&&ep(t,r),e==="components"&&tp(t,r),e==="functions"&&np(t,r),e==="classes"&&rp(t,r),e==="integrations"&&sp(t,r)]})]})}function ep(e,t){return e.map((n,r)=>s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"font-mono font-semibold text-blue-600",children:[n.method," ",n.path]}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.purpose}),n.requestFormat&&s.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.request")," ",n.requestFormat]}),n.responseFormat&&s.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.response")," ",n.responseFormat]}),s.jsx("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:n.location})]},r))}function tp(e,t){return e.map((n,r)=>s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"font-semibold",children:[n.name," ",s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",n.type,")"]})]}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.purpose}),n.props&&s.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.props")," ",n.props]}),n.exports&&n.exports.length>0&&s.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.exports")," ",n.exports.join(", ")]}),s.jsx("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:n.location})]},r))}function np(e,t){return e.map((n,r)=>s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"font-semibold",children:[n.name," ",n.isExported&&s.jsx("span",{className:"text-xs text-green-600",children:t("logs.artifacts.exported")})]}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.purpose}),n.signature&&s.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[t("logs.artifacts.signature")," ",n.signature]}),s.jsx("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:n.location})]},r))}function rp(e,t){return e.map((n,r)=>s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"font-semibold",children:[n.name," ",n.isExported&&s.jsx("span",{className:"text-xs text-green-600",children:t("logs.artifacts.exported")})]}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.purpose}),n.methods&&n.methods.length>0&&s.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.methods")," ",n.methods.join(", ")]}),s.jsx("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:n.location})]},r))}function sp(e,t){return e.map((n,r)=>s.jsxs("div",{className:"text-sm",children:[s.jsx("div",{className:"font-semibold",children:n.description}),s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[t("logs.artifacts.frontend")," ",n.frontendComponent]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.backend")," ",n.backendEndpoint]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.dataFlow")," ",n.dataFlow]})]},r))}function op({entry:e}){const{t}=Pt(),[n,r]=a.useState(!1),o=i=>new Date(i).toLocaleString();return s.jsx(fe,{className:"mb-4 hover:shadow-md transition-shadow cursor-pointer",children:s.jsxs(pe,{className:"p-4",children:[s.jsxs("div",{className:"flex items-start gap-4 hover:bg-muted/50 p-2 rounded -m-2",onClick:()=>r(!n),children:[s.jsx("div",{className:"mt-0.5 flex-shrink-0",children:n?s.jsx(Ba,{className:"w-5 h-5"}):s.jsx(za,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"px-2 py-1 bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-100 text-xs font-mono rounded",children:e.taskId}),s.jsx("span",{className:"text-sm text-muted-foreground",children:o(e.timestamp)})]}),s.jsx("p",{className:"text-sm font-medium mt-1",children:e.summary})]})]}),n&&s.jsxs("div",{className:"mt-4 pl-9 space-y-4 border-l-2 border-muted pl-4",children:[s.jsxs("div",{className:"grid grid-cols-4 gap-2 text-center",children:[s.jsxs("div",{className:"p-2 bg-muted rounded",children:[s.jsxs("div",{className:"text-lg font-bold text-green-600",children:["+",e.statistics.linesAdded]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.entry.added")})]}),s.jsxs("div",{className:"p-2 bg-muted rounded",children:[s.jsxs("div",{className:"text-lg font-bold text-red-600",children:["-",e.statistics.linesRemoved]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.entry.removed")})]}),s.jsxs("div",{className:"p-2 bg-muted rounded",children:[s.jsx("div",{className:"text-lg font-bold text-blue-600",children:e.statistics.filesChanged}),s.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.entry.filesChanged")})]}),s.jsxs("div",{className:"p-2 bg-muted rounded",children:[s.jsx("div",{className:"text-lg font-bold text-purple-600",children:e.statistics.linesAdded-e.statistics.linesRemoved}),s.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.entry.netChange")})]})]}),e.filesModified&&e.filesModified.length>0&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-2",children:t("logs.entry.filesModified")}),s.jsx("ul",{className:"space-y-1",children:e.filesModified.map((i,l)=>s.jsxs("li",{className:"text-xs text-muted-foreground font-mono",children:["• ",i]},l))})]}),e.filesCreated&&e.filesCreated.length>0&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-2",children:t("logs.entry.filesCreated")}),s.jsx("ul",{className:"space-y-1",children:e.filesCreated.map((i,l)=>s.jsxs("li",{className:"text-xs text-muted-foreground font-mono",children:["• ",i]},l))})]}),e.artifacts&&s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx(gt,{type:"apiEndpoints",artifacts:e.artifacts.apiEndpoints||[]}),s.jsx(gt,{type:"components",artifacts:e.artifacts.components||[]}),s.jsx(gt,{type:"functions",artifacts:e.artifacts.functions||[]}),s.jsx(gt,{type:"classes",artifacts:e.artifacts.classes||[]}),s.jsx(gt,{type:"integrations",artifacts:e.artifacts.integrations||[]})]})]})]})})}function ap({specs:e,selectedSpec:t,onSpecChange:n}){const{t:r}=Pt(),[o,i]=a.useState(null),[l,c]=a.useState(""),[d,u]=a.useState([]),[p,f]=a.useState(new Set),[g,h]=a.useState("timestamp"),[v,m]=a.useState("desc"),[w,y]=a.useState(!1),S=a.useRef(void 0);a.useEffect(()=>_.onMessage("logs-updated",M=>{M.data&&(i(M.data),f(new Set),c(""))}),[]),a.useEffect(()=>_.onMessage("logs-search-results",M=>{if(M.data){const{entries:V}=M.data;N(V,new Set,g,v),y(!1)}}),[g,v]),a.useEffect(()=>{t&&(y(!0),_.getLogs(t))},[t]),a.useEffect(()=>{o&&y(!1)},[o]),a.useEffect(()=>{o&&N(o.entries,p,g,v)},[o,p,g,v]),a.useEffect(()=>{if(S.current&&clearTimeout(S.current),!t||!l.trim()){o&&N(o.entries,p,g,v);return}return y(!0),S.current=setTimeout(()=>{_.searchLogs(t,l)},300),()=>{S.current&&clearTimeout(S.current)}},[l,t,o]);const N=(C,M,V,O)=>{let $=[...C];M.size>0&&($=$.filter(B=>M.has(B.taskId))),$.sort((B,z)=>{let L=0;switch(V){case"timestamp":L=new Date(B.timestamp).getTime()-new Date(z.timestamp).getTime();break;case"taskId":L=B.taskId.localeCompare(z.taskId);break;case"linesAdded":L=B.statistics.linesAdded-z.statistics.linesAdded;break;case"filesChanged":L=B.statistics.filesChanged-z.statistics.filesChanged;break}return O==="desc"?-L:L}),u($)},j=o?Array.from(new Set(o.entries.map(C=>C.taskId))).sort():[],E=C=>{const M=new Set(p);M.has(C)?M.delete(C):M.add(C),f(M)},I=C=>{g===C?m(v==="asc"?"desc":"asc"):(h(C),m("desc"))};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold",children:r("logs.title")}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r("logs.subtitle")})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(vt,{value:t||"",onValueChange:n,children:[s.jsx(bt,{className:"w-full",children:s.jsx(wt,{placeholder:r("logs.selectSpec")})}),s.jsx(yt,{children:e.map(C=>s.jsx(Fe,{value:C.name,children:C.displayName||C.name},C.name))})]}),s.jsx($a,{placeholder:r("logs.searchPlaceholder"),value:l,onChange:C=>c(C.target.value),disabled:!t}),o&&j.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:j.map(C=>s.jsx("button",{onClick:()=>E(C),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors ${p.has(C)?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:C},C))}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{onClick:()=>I("timestamp"),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${g==="timestamp"?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:[r("logs.sort.timestamp")," ",g==="timestamp"&&(v==="asc"?"↑":"↓")]}),s.jsxs("button",{onClick:()=>I("taskId"),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${g==="taskId"?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:[r("logs.sort.taskId")," ",g==="taskId"&&(v==="asc"?"↑":"↓")]}),s.jsxs("button",{onClick:()=>I("linesAdded"),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${g==="linesAdded"?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:[r("logs.sort.linesAdded")," ",g==="linesAdded"&&(v==="asc"?"↑":"↓")]}),s.jsxs("button",{onClick:()=>I("filesChanged"),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${g==="filesChanged"?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:[r("logs.sort.filesChanged")," ",g==="filesChanged"&&(v==="asc"?"↑":"↓")]})]})]}),o&&s.jsx($f,{stats:o.stats}),w&&s.jsx(fe,{children:s.jsx(pe,{className:"p-8 text-center text-muted-foreground",children:r("logs.loading")})}),!w&&!t&&s.jsx(fe,{children:s.jsx(pe,{className:"p-8 text-center text-muted-foreground",children:r("logs.selectSpecMessage")})}),!w&&t&&d.length===0&&s.jsx(fe,{children:s.jsx(pe,{className:"p-8 text-center text-muted-foreground",children:r(l?"logs.noSearchResults":"logs.noLogs")})}),!w&&d.length>0&&s.jsx("div",{className:"space-y-2",children:d.map(C=>s.jsx(op,{entry:C},C.id))})]})}const st=100,ip=2e3;function cp(){const{t:e,i18n:t}=Pt();console.log("=== WEBVIEW APP.TSX STARTING ===");const n=fi();console.log("Current VS Code theme:",n);const[r,o]=a.useState([]),[i,l]=a.useState([]),[c,d]=a.useState(null),[u,p]=a.useState(null),[f,g]=a.useState([]),[h,v]=a.useState([]),[m,w]=a.useState("all"),[y,S]=a.useState([]),[N,j]=a.useState([]),[,E]=a.useState(null),[I,C]=a.useState(!1),[M,V]=a.useState("overview"),[O,$]=a.useState(null),[B,z]=a.useState(null),[L,K]=a.useState(null),[T,U]=a.useState(!1),[P,k]=a.useState(new Set),[G,se]=a.useState(!1),oe=a.useRef(!1),ie=a.useRef(null),re=a.useRef(null),[be,ae]=a.useState(!1),[A,Y]=a.useState(""),[X,q]=a.useState(null),[Z,Q]=a.useState(!1),J=a.useRef(null),[Ee,Oe]=a.useState(!1),[He,pt]=a.useState(new Set),[Va,Ua]=a.useState(!1),[Xe,Ha]=a.useState({enabled:!0,volume:.3,approvalSound:!0,taskCompletionSound:!0}),[Wa,Ka]=a.useState(null),[de,wr]=a.useState("active"),[Ie,br]=a.useState(null),[ge,yr]=a.useState("auto"),[mt,Ga]=a.useState({path:"",isDefault:!0}),bn=Ne.useRef(null),Dt=Ff({enabled:Xe.enabled,volume:Xe.volume,soundUris:Wa}),Ot=a.useRef([]),Qe=a.useRef(null),qa=x=>{pt(b=>{const R=new Set(b);return R.has(x)?R.delete(x):R.add(x),R})},Ya=x=>{if(!c)return;const b=x.prompt||e("task.copyPrompt",'Please work on task {{taskId}} for spec "{{specName}}"',{taskId:x.id,specName:c});navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(b).then(()=>{K(x.id),setTimeout(()=>K(null),2e3)}).catch(()=>{Sr(b,x.id)}):Sr(b,x.id)},Sr=(x,b)=>{const R=document.createElement("textarea");R.value=x,R.style.position="fixed",R.style.left="-999999px",R.style.top="-999999px",document.body.appendChild(R),R.focus(),R.select();try{document.execCommand("copy")&&(K(b),setTimeout(()=>K(null),2e3))}catch(H){console.error("Failed to copy text: ",H)}document.body.removeChild(R)},Za=()=>{T&&G||(T&&k(new Set),U(!T))},Nr=x=>{k(b=>{const R=new Set(b);return R.has(x)?R.delete(x):R.add(x),R})},Xa=x=>{P.size===x.length?k(new Set):k(new Set(x))},yn=(x=!1,b,R)=>{oe.current=!1,se(!1),k(new Set),U(!1),ie.current&&(clearTimeout(ie.current),ie.current=null),x&&b&&R&&R.length>0&&(J.current&&clearTimeout(J.current),q({ids:R,action:b}),Q(!0),J.current=setTimeout(()=>{Q(!1),q(null)},3e4))},Sn=(x,b,R)=>{G||oe.current||(re.current={ids:[...R],action:b},se(!0),oe.current=!0,x(),ie.current=setTimeout(()=>{if(oe.current){const H=re.current;re.current=null,yn(!0,H?.action,H?.ids)}},ip*5))},Qa=()=>{X&&(J.current&&(clearTimeout(J.current),J.current=null),Q(!1),_.batchUndo(X.ids),q(null))},Ja=()=>{if(P.size===0)return;if(P.size>st){$({message:e("approvals.batch.tooMany",{limit:st}),level:"warning"});return}const x=Array.from(P);Sn(()=>_.batchApprove(x,e("approvals.response.approved")),"approve",x)},ei=()=>{if(P.size!==0){if(P.size>st){$({message:e("approvals.batch.tooMany",{limit:st}),level:"warning"});return}Y(""),ae(!0)}},ti=()=>{if(!A.trim()){$({message:e("approvals.batch.feedbackRequired"),level:"warning"});return}ae(!1);const x=Array.from(P);Sn(()=>_.batchReject(x,A.trim()),"reject",x)},ni=()=>{if(P.size===0)return;if(P.size>st){$({message:e("approvals.batch.tooMany",{limit:st}),level:"warning"});return}const x=Array.from(P);Sn(()=>_.batchRequestRevision(x,e("approvals.response.needsRevision")),"revision",x)},xe=x=>{yr(x),x==="auto"?(localStorage.removeItem("spec-workflow-language"),t.changeLanguage(void 0)):(localStorage.setItem("spec-workflow-language",x),t.changeLanguage(x)),_.setLanguagePreference(x),$({message:e("language.changed"),level:"success"})},ri=()=>{const x=`Please help me create or update the steering documents for my project. The steering documents include:
- product.md: Define the product vision, target users, key features, and business objectives
- tech.md: Document technical architecture decisions, technology stack, and development principles
- structure.md: Describe the codebase organization, directory structure, and module architecture
Review the existing steering documents (if any) and help me improve or complete them based on my project requirements.`;navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(x).then(()=>{Oe(!0),setTimeout(()=>Oe(!1),2e3)}).catch(()=>{Cr(x)}):Cr(x)},Cr=x=>{const b=document.createElement("textarea");b.value=x,b.style.position="fixed",b.style.left="-999999px",b.style.top="-999999px",document.body.appendChild(b),b.focus(),b.select();try{document.execCommand("copy")&&(Oe(!0),setTimeout(()=>Oe(!1),2e3))}catch(R){console.error("Failed to copy text: ",R)}document.body.removeChild(b)},si=()=>{bn.current?.scrollTo({top:0,behavior:"smooth"})};a.useEffect(()=>{const x=[_.onMessage("specs-updated",b=>{o(b.data||[]),C(!1)}),_.onMessage("tasks-updated",b=>{console.log("=== App.tsx tasks-updated message ==="),console.log("Message data:",b.data),console.log("Selected spec:",c),console.log("Message spec:",b.data?.specName),b.data&&(console.log("Setting taskData with taskList count:",b.data.taskList?.length),console.log("Sample task (2.2) from message:",b.data.taskList?.find(R=>R.id==="2.2")),console.log("Tasks with metadata:",b.data.taskList?.filter(R=>R.requirements?.length||R.implementationDetails?.length||R.files?.length||R.purposes?.length||R.leverage).map(R=>({id:R.id,requirements:R.requirements,implementationDetails:R.implementationDetails}))),p(b.data),!c&&b.data.specName&&(console.log("Setting selected spec from task data:",b.data.specName),d(b.data.specName)))}),_.onMessage("approvals-updated",b=>{console.log("=== Received approvals-updated message ==="),console.log("Current tab:",M),console.log("Approvals count:",b.data?.length||0),console.log("Pending approvals:",b.data?.filter(H=>H.status==="pending").length||0),console.log("About to setApprovals - this should trigger badge counter update");const R=b.data||[];if(g(R),oe.current){const H=re.current;re.current=null,yn(!0,H?.action,H?.ids)}if(P.size>0){const H=new Set(R.map(ht=>ht.id));k(ht=>{const Lt=new Set([...ht].filter(ve=>H.has(ve)));return Lt.size===0&&T&&U(!1),Lt})}_.getApprovalCategories()}),_.onMessage("approval-categories-updated",b=>{console.log("=== Received approval-categories-updated message ==="),console.log("Categories:",b.data),v(b.data||[])}),_.onMessage("steering-updated",b=>{E(b.data)}),_.onMessage("spec-documents-updated",b=>{S(b.data||[])}),_.onMessage("steering-documents-updated",b=>{j(b.data||[])}),_.onMessage("selected-spec-updated",b=>{d(b.data||null)}),_.onMessage("error",b=>{console.error("Extension error:",b.message),C(!1)}),_.onMessage("notification",b=>{if($({message:b.message,level:b.level}),setTimeout(()=>$(null),3e3),oe.current&&(b.message.includes("requests")||b.message.includes("failed"))){const R=re.current;re.current=null,yn(!0,R?.action,R?.ids)}}),_.onMessage("config-updated",b=>{Ha(b.data||{enabled:!0,volume:.3,approvalSound:!0,taskCompletionSound:!0})}),_.onMessage("sound-uris-updated",b=>{console.log("Received sound URIs from extension:",b.data),Ka(b.data||null)}),_.onMessage("navigate-to-approvals",b=>{console.log("Navigating to approvals from native notification:",b.data);const{specName:R,approvalId:H}=b.data;V("approvals"),d(R),console.log("Switched to approvals tab, selected spec:",R)}),_.onMessage("archived-specs-updated",b=>{console.log("=== Received archived-specs-updated message ==="),console.log("Archived specs count:",b.data?.length||0),l(b.data||[])}),_.onMessage("language-preference-updated",b=>{console.log("=== Received language-preference-updated message ==="),console.log("Language preference:",b.data);const R=b.data||"auto";yr(R),R==="auto"?(localStorage.removeItem("spec-workflow-language"),t.changeLanguage(void 0)):(localStorage.setItem("spec-workflow-language",R),t.changeLanguage(R))}),_.onMessage("workflow-root-updated",b=>{console.log("=== Received workflow-root-updated message ==="),console.log("Workflow root:",b.data),Ga(b.data||{path:"",isDefault:!0})})];return jr(),_.getApprovals(),_.getLanguagePreference(),_.getWorkflowRoot(),()=>{x.forEach(b=>b()),ie.current&&(clearTimeout(ie.current),ie.current=null),J.current&&(clearTimeout(J.current),J.current=null)}},[]),a.useEffect(()=>{c&&(_.getTasks(c),_.getSpecDocuments(c))},[c]),a.useEffect(()=>{Ie&&_.getSpecDocuments(Ie)},[Ie]),a.useEffect(()=>{_.getSteeringDocuments()},[]),a.useEffect(()=>{const x=bn.current;if(!x)return;const b=()=>{Ua(x.scrollTop>200)};return x.addEventListener("scroll",b),()=>x.removeEventListener("scroll",b)},[]),a.useEffect(()=>{if(f.length===0){Ot.current=f;return}const x=f.filter(R=>R.status==="pending").length,b=Ot.current.filter(R=>R.status==="pending").length;x>b&&Ot.current.length>0&&Xe.approvalSound&&(console.log(`New pending approval detected: ${x} vs ${b}`),Dt.playApprovalPending()),Ot.current=f},[f,Dt,Xe.approvalSound]),a.useEffect(()=>{if(!u||!u.taskList){Qe.current=u;return}if(!Qe.current||!Qe.current.taskList){Qe.current=u;return}const x=u.taskList.filter(R=>R.status==="completed").length,b=Qe.current.taskList.filter(R=>R.status==="completed").length;x>b&&Xe.taskCompletionSound&&(console.log(`Task completion detected: ${x} vs ${b}`),Dt.playTaskCompleted()),Qe.current=u},[u,Dt,Xe.taskCompletionSound]),a.useEffect(()=>{M==="approvals"?(_.getApprovals(),_.getApprovalCategories()):M==="archives"&&_.getArchivedSpecs()},[M]);const jr=()=>{C(!0),_.refreshAll(),_.getSelectedSpec(),_.getConfig(),_.getArchivedSpecs()},Er=x=>{_.setSelectedSpec(x)},oi=(x,b)=>{c&&_.updateTaskStatus(c,x,b)},ye=Ne.useMemo(()=>{const x=r.filter(ve=>!ve.isArchived).length,b=i.length,R=x+b,H=r.filter(ve=>ve.taskProgress&&ve.taskProgress.completed===ve.taskProgress.total&&ve.taskProgress.total>0).length,ht=r.reduce((ve,Nn)=>ve+(Nn.taskProgress?.total||0),0),Lt=r.reduce((ve,Nn)=>ve+(Nn.taskProgress?.completed||0),0);return{activeSpecs:x,archivedSpecs:b,totalSpecs:R,completedSpecs:H,totalTasks:ht,completedTasks:Lt}},[r,i]),Rr=Ne.useMemo(()=>{const x=f.filter(b=>b.status==="pending").length;return console.log("Badge counter recalculated:",x,"from",f.length,"total approvals"),x},[f]);return s.jsx("div",{className:F("sidebar-root",`vscode-${n}`),children:s.jsxs(Vi,{value:M,onValueChange:V,className:"w-full h-full flex flex-col",children:[s.jsxs("div",{className:"sidebar-sticky-header space-y-3",children:[O&&s.jsx("div",{className:F("p-2 rounded text-xs font-medium",O.level==="success"&&"bg-green-100 text-green-800 border border-green-200",O.level==="error"&&"bg-red-100 text-red-800 border border-red-200",O.level==="warning"&&"bg-yellow-100 text-yellow-800 border border-yellow-200",O.level==="info"&&"bg-blue-100 text-blue-800 border border-blue-200"),children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:O.message}),s.jsx("button",{type:"button",onClick:()=>$(null),className:"ml-2 hover:opacity-70",children:"×"})]})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"text-lg font-semibold",children:e("header.title")}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs(Pf,{children:[s.jsx(kf,{asChild:!0,children:s.jsx(ee,{variant:"ghost",size:"sm",className:"flex items-center space-x-1",title:e("language.selector"),children:s.jsx(du,{className:"h-4 w-4"})})}),s.jsxs(Fa,{align:"end",children:[s.jsx(ue,{onClick:()=>xe("auto"),className:F(ge==="auto"&&"bg-accent"),children:e("language.auto")}),s.jsx(ue,{onClick:()=>xe("en"),className:F(ge==="en"&&"bg-accent"),children:e("language.english")}),s.jsx(ue,{onClick:()=>xe("ja"),className:F(ge==="ja"&&"bg-accent"),children:e("language.japanese")}),s.jsx(ue,{onClick:()=>xe("zh"),className:F(ge==="zh"&&"bg-accent"),children:e("language.chinese")}),s.jsx(ue,{onClick:()=>xe("es"),className:F(ge==="es"&&"bg-accent"),children:e("language.spanish")}),s.jsx(ue,{onClick:()=>xe("pt"),className:F(ge==="pt"&&"bg-accent"),children:e("language.portuguese")}),s.jsx(ue,{onClick:()=>xe("de"),className:F(ge==="de"&&"bg-accent"),children:e("language.german")}),s.jsx(ue,{onClick:()=>xe("fr"),className:F(ge==="fr"&&"bg-accent"),children:e("language.french")}),s.jsx(ue,{onClick:()=>xe("ru"),className:F(ge==="ru"&&"bg-accent"),children:e("language.russian")}),s.jsx(ue,{onClick:()=>xe("it"),className:F(ge==="it"&&"bg-accent"),children:e("language.italian")}),s.jsx(ue,{onClick:()=>xe("ko"),className:F(ge==="ko"&&"bg-accent"),children:e("language.korean")}),s.jsx(ue,{onClick:()=>xe("ar"),className:F(ge==="ar"&&"bg-accent"),children:e("language.arabic")})]})]}),s.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>_.openExternalUrl("https://buymeacoffee.com/pimzino"),title:e("header.support"),className:"text-orange-600 hover:text-orange-700 hover:bg-orange-50",children:s.jsx(iu,{className:"h-4 w-4"})}),s.jsx(ee,{variant:"ghost",size:"sm",onClick:jr,disabled:I,children:s.jsx(fu,{className:F("h-4 w-4",I&&"animate-spin")})})]})]}),s.jsxs(Ui,{className:"grid w-full grid-cols-6",children:[s.jsx(Je,{value:"overview",className:"text-xs",title:e("tabs.overview"),children:s.jsx(ru,{className:"h-3 w-3"})}),s.jsx(Je,{value:"steering",className:"text-xs",title:e("tabs.steering"),children:s.jsx(pu,{className:"h-3 w-3"})}),s.jsx(Je,{value:"specs",className:"text-xs",title:e("tabs.specs"),children:s.jsx(su,{className:"h-3 w-3"})}),s.jsx(Je,{value:"tasks",className:"text-xs",title:e("tabs.tasks"),children:s.jsx(mu,{className:"h-3 w-3"})}),s.jsx(Je,{value:"logs",className:"text-xs",title:e("tabs.logs"),children:s.jsx(lu,{className:"h-3 w-3"})}),s.jsxs(Je,{value:"approvals",className:"text-xs relative",title:e("tabs.approvals"),children:[s.jsx(au,{className:"h-3 w-3"}),Rr>0&&s.jsx(Vt,{variant:"destructive",className:"absolute -top-1 -right-1 h-4 w-4 p-0 text-xs flex items-center justify-center rounded-full min-w-[16px]",children:Rr})]})]})]}),s.jsxs("div",{className:"sidebar-scrollable-content",ref:bn,children:[s.jsxs(et,{value:"overview",className:"space-y-3",children:[s.jsxs(fe,{children:[s.jsx(Ft,{className:"pb-2",children:s.jsx($t,{className:"text-sm",children:e("overview.projectTitle")})}),s.jsxs(pe,{className:"space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-muted-foreground",children:e("overview.activeSpecs")}),s.jsxs("div",{className:"font-medium",children:[ye.completedSpecs," / ",ye.activeSpecs]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-muted-foreground",children:e("overview.archivedSpecs")}),s.jsx("div",{className:"font-medium",children:ye.archivedSpecs})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-muted-foreground",children:e("overview.totalSpecs")}),s.jsx("div",{className:"font-medium",children:ye.totalSpecs})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-muted-foreground",children:e("overview.tasks")}),s.jsxs("div",{className:"font-medium",children:[ye.completedTasks," / ",ye.totalTasks]})]})]}),ye.totalTasks>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{children:e("overview.overallProgress")}),s.jsxs("span",{children:[Math.round(ye.completedTasks/ye.totalTasks*100),"%"]})]}),s.jsx(Ar,{value:ye.completedTasks/ye.totalTasks*100,className:"h-2"})]})]})]}),s.jsxs(fe,{children:[s.jsx(Ft,{className:"pb-2",children:s.jsx($t,{className:"text-sm",children:e("overview.recentActivity")})}),s.jsx(pe,{children:s.jsxs("div",{className:"space-y-2",children:[r.slice(0,3).map(x=>s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:F("w-2 h-2 rounded-full",x.taskProgress&&x.taskProgress.completed===x.taskProgress.total&&x.taskProgress.total>0?"bg-green-500":"bg-blue-500")}),s.jsx("span",{className:"truncate",children:x.displayName})]}),s.jsx("span",{className:"text-muted-foreground",children:e("overview.modified",{time:Bt(x.lastModified)})})]},x.name)),r.length===0&&s.jsx("div",{className:"text-muted-foreground text-xs text-center py-2",children:e("overview.noSpecs")})]})})]})]}),s.jsxs(et,{value:"tasks",className:"space-y-3",children:[s.jsx("div",{className:"space-y-3",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("label",{className:"text-sm font-medium",children:[e("tasks.specLabel"),":"]}),s.jsxs(vt,{value:c||"",onValueChange:Er,children:[s.jsx(bt,{className:"w-full",children:s.jsx(wt,{placeholder:e("tasks.specPlaceholder")})}),s.jsx(yt,{children:r.map(x=>s.jsx(Fe,{value:x.name,children:x.displayName},x.name))})]})]})}),c?u?s.jsxs(s.Fragment,{children:[s.jsx(fe,{children:s.jsx(pe,{className:"p-4",children:s.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-lg",children:u.total}),s.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.total")})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-lg text-green-600",children:u.completed}),s.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.done")})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-lg text-amber-600",children:u.total-u.completed}),s.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.left")})]}),s.jsxs("div",{className:"text-center",children:[s.jsxs("div",{className:"font-medium text-lg text-blue-600",children:[Math.round(u.progress),"%"]}),s.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.progress")})]})]})})}),s.jsx(fe,{children:s.jsxs(pe,{className:"p-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm font-medium",children:e("tasks.overallProgress")}),s.jsxs("span",{className:"text-sm",children:[Math.round(u.progress),"%"]})]}),s.jsx(Ar,{value:u.progress,className:"h-2"})]})}),s.jsx("div",{className:"space-y-2",children:u.taskList?.map(x=>(console.log(`🔍 TASK DEBUG [${x.id}]:`,{id:x.id,status:x.status,completed:x.completed,inProgress:x.inProgress,hasInProgress:"inProgress"in x,allProps:Object.keys(x)}),s.jsx(fe,{className:F("transition-colors",x.isHeader&&"border-purple-200 dark:border-slate-600 bg-purple-50 dark:bg-slate-800/60",x.status==="in-progress"&&"border-orange-500",x.completed&&"border-green-500"),children:s.jsx(pe,{className:"p-3",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:F("text-sm flex-1",x.isHeader?"font-semibold text-purple-900 dark:text-purple-100":"font-medium"),children:[x.isHeader?e("tasks.section","Section"):e("tasks.task","Task")," ",x.id]}),!x.isHeader&&s.jsxs(s.Fragment,{children:[s.jsx(ee,{variant:"ghost",size:"sm",className:F("h-6 w-6 p-0",L===x.id&&"text-green-600"),onClick:b=>{b.stopPropagation(),Ya(x)},title:L===x.id?e("tasks.copied"):e("tasks.copyPromptTitle"),disabled:L===x.id,children:s.jsx(ts,{className:"h-3 w-3"})}),s.jsxs(vt,{value:x.completed?"completed":x.status||"pending",onValueChange:b=>oi(x.id,b),children:[s.jsx(bt,{className:F("w-auto h-6 px-2 text-xs border-0 focus:ring-0 focus:ring-offset-0",x.completed?"bg-green-500 text-white [&_svg]:!text-white [&_svg]:opacity-100":x.status==="in-progress"?"bg-orange-500 text-white [&_svg]:!text-white [&_svg]:opacity-100":"bg-transparent border border-border text-foreground [&_svg]:text-foreground"),children:s.jsx(wt,{})}),s.jsxs(yt,{children:[s.jsx(Fe,{value:"pending",children:e("tasks.status.pending")}),s.jsx(Fe,{value:"in-progress",children:e("tasks.status.inProgress")}),s.jsx(Fe,{value:"completed",children:e("tasks.status.completed")})]})]})]}),x.isHeader&&s.jsx(Vt,{variant:"secondary",className:"text-xs bg-purple-100 dark:bg-slate-700 text-purple-700 dark:text-slate-200 border-purple-300 dark:border-slate-500",children:e("tasks.taskGroup")})]}),s.jsx("p",{className:F("text-xs",x.isHeader?"text-slate-600 dark:text-slate-300":"text-muted-foreground"),children:x.description}),s.jsxs("div",{className:"space-y-2 border-t border-gray-100 dark:border-gray-700 pt-2",children:[x.files&&x.files.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-purple-600 dark:text-purple-400 flex items-center gap-1",children:[e("tasks.meta.files"),":"]}),s.jsx("div",{className:"task-files-container",children:s.jsx("div",{className:"task-files-list",children:x.files.map((b,R)=>s.jsx("span",{className:"px-2 py-1 bg-purple-50 dark:bg-purple-950/30 text-purple-700 dark:text-purple-300 text-xs rounded border border-purple-200 dark:border-purple-800 font-mono whitespace-nowrap flex-shrink-0",children:b},R))})})]}),x.implementationDetails&&x.implementationDetails.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-blue-600 dark:text-blue-400 flex items-center gap-1",children:[e("tasks.meta.implementation"),":"]}),s.jsx("ul",{className:"text-xs text-muted-foreground list-disc list-inside space-y-0.5 ml-2",children:x.implementationDetails.map((b,R)=>s.jsx("li",{className:"leading-relaxed",children:b},R))})]}),x.purposes&&x.purposes.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-green-600 dark:text-green-400 flex items-center gap-1",children:[e("tasks.meta.purposes"),":"]}),s.jsx("ul",{className:"text-xs text-muted-foreground list-disc list-inside space-y-0.5 ml-2",children:x.purposes.map((b,R)=>s.jsx("li",{className:"leading-relaxed",children:b},R))})]}),x.requirements&&x.requirements.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-orange-600 dark:text-orange-400 flex items-center gap-1",children:[e("tasks.meta.requirements"),":"]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:x.requirements.join(", ")})]}),x.leverage&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-cyan-600 dark:text-cyan-400 flex items-center gap-1",children:[e("tasks.meta.leverage"),":"]}),s.jsx("div",{className:"text-xs text-cyan-900 dark:text-cyan-100 bg-cyan-50 dark:bg-cyan-950/30 border border-cyan-200 dark:border-cyan-800 rounded px-2 py-1 font-mono",children:x.leverage})]}),x.prompt&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"text-xs font-medium text-indigo-600 dark:text-indigo-400 flex items-center gap-1",children:[s.jsx(ou,{className:"w-3 h-3"}),e("tasks.meta.prompt","AI Prompt"),":"]}),s.jsx("button",{onClick:()=>qa(x.id),className:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200 transition-colors",title:He.has(x.id)?"Collapse prompt":"Expand prompt",children:He.has(x.id)?s.jsx(ur,{className:"w-3 h-3"}):s.jsx(Uo,{className:"w-3 h-3"})})]}),He.has(x.id)&&s.jsx("div",{className:"text-xs text-indigo-900 dark:text-indigo-100 bg-indigo-50 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 rounded px-2 py-1.5 whitespace-pre-wrap break-words",children:x.prompt})]})," "]})]})})},x.id)))})]}):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("tasks.loading")}):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:r.length===0?e("tasks.noSpecs"):e("tasks.selectSpec")})]}),s.jsx(et,{value:"logs",className:"space-y-3",children:s.jsx(ap,{specs:r,selectedSpec:c,onSpecChange:x=>{d(x),_.setSelectedSpec(x)}})}),s.jsxs(et,{value:"approvals",className:"space-y-3 relative",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("label",{className:"text-sm font-medium",children:[e("approvals.docLabel"),":"]}),s.jsxs(vt,{value:m,onValueChange:w,children:[s.jsx(bt,{className:"w-full",children:s.jsx(wt,{placeholder:e("approvals.categoryPlaceholder")})}),s.jsx(yt,{children:h.map(x=>s.jsx(Fe,{value:x.value,children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{children:x.label}),x.count>0&&s.jsx(Vt,{variant:"secondary",className:"ml-2 h-4 w-4 p-0 text-xs flex items-center justify-center rounded-full min-w-[16px]",children:x.count})]})},x.value))})]})]}),m&&(()=>{const x=m==="all"?f.filter(H=>H.status==="pending"):f.filter(H=>H.status==="pending"&&H.categoryName===m);if(x.length===0)return null;const b=x.length>0&&x.every(H=>P.has(H.id)),R=x.some(H=>P.has(H.id));return s.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted rounded-md",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[T&&s.jsx("button",{onClick:()=>Xa(x.map(H=>H.id)),className:"flex items-center justify-center w-4 h-4 rounded border border-gray-400 hover:border-primary transition-colors",title:e(b?"approvals.deselectAll":"approvals.selectAll"),children:b?s.jsx(ot,{className:"w-3 h-3 text-primary"}):R?s.jsx(uu,{className:"w-3 h-3 text-primary"}):null}),s.jsx("span",{className:"text-xs text-muted-foreground",children:T?e("approvals.selectedCount",{count:P.size}):e("approvals.pendingCount",{count:x.length})})]}),s.jsx(ee,{variant:T?"outline":"secondary",size:"sm",className:"h-6 px-2 text-xs",onClick:Za,children:T?s.jsxs(s.Fragment,{children:[s.jsx(Mr,{className:"w-3 h-3 mr-1"}),e("approvals.cancel")]}):s.jsxs(s.Fragment,{children:[s.jsx(hu,{className:"w-3 h-3 mr-1"}),e("approvals.select")]})})]})})()]}),m?(()=>{const x=m==="all"?f.filter(b=>b.status==="pending"):f.filter(b=>b.status==="pending"&&b.categoryName===m);return x.length>0?s.jsx("div",{className:F("space-y-2",T&&P.size>0&&"pb-16"),children:x.map(b=>{const R=P.has(b.id);return s.jsx(fe,{className:F("transition-colors cursor-pointer",T&&R&&"border-primary bg-primary/5"),onClick:T?()=>Nr(b.id):void 0,children:s.jsx(pe,{className:"p-3",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[T&&s.jsx("button",{onClick:H=>{H.stopPropagation(),Nr(b.id)},className:F("flex items-center justify-center w-4 h-4 rounded border transition-colors flex-shrink-0",R?"bg-primary border-primary":"border-gray-400 hover:border-primary"),children:R&&s.jsx(ot,{className:"w-3 h-3 text-white"})}),s.jsxs("div",{className:"flex items-center justify-between flex-1 min-w-0",children:[s.jsx("h3",{className:"font-medium text-sm truncate",children:b.title}),s.jsx(Vt,{variant:"secondary",className:"text-xs flex-shrink-0 ml-2",children:e("approvals.status.pending")})]})]}),b.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:b.description}),b.filePath&&s.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate",children:b.filePath}),s.jsx("div",{className:"text-xs text-muted-foreground",children:e("approvals.created",{time:Bt(b.createdAt)})}),!T&&s.jsxs("div",{className:"flex gap-1 flex-wrap",children:[s.jsx(ee,{size:"sm",className:"h-6 px-2 text-xs",disabled:B===b.id,onClick:H=>{H.stopPropagation(),z(b.id),_.approveRequest(b.id,e("approvals.response.approved")),setTimeout(()=>z(null),2e3)},children:B===b.id?e("approvals.processing"):e("approvals.approve")}),s.jsx(ee,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",disabled:B===b.id,onClick:H=>{H.stopPropagation(),z(b.id),_.rejectRequest(b.id,e("approvals.response.rejected")),setTimeout(()=>z(null),2e3)},children:B===b.id?e("approvals.processing"):e("approvals.reject")}),s.jsx(ee,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",disabled:B===b.id,onClick:H=>{H.stopPropagation(),z(b.id),_.requestRevisionRequest(b.id,e("approvals.response.needsRevision")),setTimeout(()=>z(null),2e3)},children:B===b.id?e("approvals.processing"):e("approvals.requestRevision")}),b.filePath&&s.jsx(ee,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:H=>{H.stopPropagation(),_.getApprovalContent(b.id)},children:e("approvals.openInEditor")})]})]})})},b.id)})}):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("approvals.noPending")})})():s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:h.length<=1?e("approvals.noPendingDocuments"):e("approvals.selectCategory")}),T&&P.size>0&&s.jsxs("div",{className:"fixed bottom-0 left-0 right-0 p-3 bg-background border-t shadow-lg z-10",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e("approvals.selectedCount",{count:P.size})}),s.jsx("button",{className:"text-xs text-muted-foreground hover:text-foreground hover:underline",onClick:()=>k(new Set),disabled:G,children:e("approvals.clearSelection")})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsxs(ee,{size:"sm",className:"w-full h-7 text-xs justify-start bg-green-600 hover:bg-green-700",disabled:G,onClick:Ja,children:[s.jsx(ot,{className:"w-3.5 h-3.5 mr-2 flex-shrink-0","aria-hidden":"true"}),G?e("approvals.processing"):e("approvals.approveAllCount",{count:P.size})]}),s.jsxs(ee,{variant:"outline",size:"sm",className:"w-full h-7 text-xs justify-start border-amber-400 text-amber-600 hover:bg-amber-50 dark:hover:bg-amber-900/30",disabled:G,onClick:ni,children:[s.jsx(rs,{className:"w-3.5 h-3.5 mr-2 flex-shrink-0","aria-hidden":"true"}),G?e("approvals.processing"):e("approvals.revisionAllCount",{count:P.size})]}),s.jsxs(ee,{variant:"outline",size:"sm",className:"w-full h-7 text-xs justify-start border-red-400 text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/30",disabled:G,onClick:ei,children:[s.jsx(ss,{className:"w-3.5 h-3.5 mr-2 flex-shrink-0","aria-hidden":"true"}),G?e("approvals.processing"):e("approvals.rejectAllCount",{count:P.size})]})]})]})]}),s.jsxs(et,{value:"specs",className:"space-y-3",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex items-center justify-center",children:s.jsxs("div",{className:"inline-flex items-center space-x-1 p-1 bg-muted rounded-md",children:[s.jsx(ee,{variant:de==="active"?"default":"ghost",size:"sm",className:F("h-7 px-3 text-xs font-medium transition-all",de==="active"?"bg-primary text-primary-foreground shadow-sm":"hover:bg-muted-foreground/10"),onClick:()=>{wr("active"),br(null)},children:e("specs.active")}),s.jsx(ee,{variant:de==="archived"?"default":"ghost",size:"sm",className:F("h-7 px-3 text-xs font-medium transition-all",de==="archived"?"bg-primary text-primary-foreground shadow-sm":"hover:bg-muted-foreground/10"),onClick:()=>{wr("archived"),d(null)},children:e("specs.archived")})]})}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("label",{className:"text-sm font-medium",children:[e("specs.specLabel"),":"]}),s.jsxs(vt,{value:de==="active"?c||"":Ie||"",onValueChange:de==="active"?Er:br,children:[s.jsx(bt,{className:"w-full",children:s.jsx(wt,{placeholder:e("specs.specPlaceholder")})}),s.jsx(yt,{children:de==="active"?r.filter(x=>!x.isArchived).map(x=>s.jsx(Fe,{value:x.name,children:x.displayName},x.name)):i.map(x=>s.jsx(Fe,{value:x.name,children:x.displayName},x.name))})]}),de==="active"&&c&&s.jsx(ee,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs whitespace-nowrap",onClick:()=>_.archiveSpec(c),children:e("specs.archive")}),de==="archived"&&Ie&&s.jsx(ee,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs whitespace-nowrap",onClick:()=>_.unarchiveSpec(Ie),children:e("specs.unarchive")})]})]}),s.jsxs(fe,{children:[s.jsx(Ft,{className:"pb-2",children:s.jsx($t,{className:"text-sm",children:e("specs.docsTitle")})}),s.jsxs(pe,{children:[(de==="active"?c:Ie)&&s.jsx("div",{className:"space-y-2",children:y.length>0?y.map(x=>s.jsxs("div",{className:"flex items-center justify-between p-2 border rounded",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"font-medium text-sm",children:[s.jsx("span",{className:"capitalize",children:x.name}),".md"]}),x.exists&&x.lastModified&&s.jsx("div",{className:"text-xs text-muted-foreground",children:e("specs.modified",{time:Bt(x.lastModified)})}),!x.exists&&s.jsx("div",{className:"text-xs text-muted-foreground",children:e("specs.fileNotFound")})]}),s.jsx(ee,{size:"sm",className:"h-6 px-2 text-xs",disabled:!x.exists,onClick:()=>_.openDocument(de==="active"?c:Ie,x.name),children:e("specs.open")})]},x.name)):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("specs.noDocs")})}),!(de==="active"?c:Ie)&&s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:de==="active"?r.filter(x=>!x.isArchived).length===0?e("specs.noActiveSpecs"):e("specs.selectSpec"):i.length===0?e("specs.noArchivedSpecs"):e("specs.selectSpec")})]})]})]}),s.jsx(et,{value:"steering",className:"space-y-3",children:s.jsxs(fe,{children:[s.jsx(Ft,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($t,{className:"text-sm",children:e("steering.title")}),s.jsxs(ee,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:ri,title:e(Ee?"steering.copied":"steering.copyInstructions"),children:[s.jsx(ts,{className:"h-3 w-3 mr-1"}),e(Ee?"steering.copied":"steering.copyInstructions")]})]})}),s.jsx(pe,{children:s.jsx("div",{className:"space-y-2",children:N.length>0?N.map(x=>s.jsxs("div",{className:"flex items-center justify-between p-2 border rounded",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"font-medium text-sm",children:[s.jsx("span",{className:"capitalize",children:x.name}),".md"]}),x.exists&&x.lastModified&&s.jsx("div",{className:"text-xs text-muted-foreground",children:e("steering.modified",{time:Bt(x.lastModified)})}),!x.exists&&s.jsx("div",{className:"text-xs text-muted-foreground",children:e("steering.fileNotFound")})]}),s.jsx(ee,{size:"sm",className:"h-6 px-2 text-xs",disabled:!x.exists,onClick:()=>_.openSteeringDocument(x.name),children:e("steering.open")})]},x.name)):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("steering.noDocs")})})})]})})]}),s.jsx("div",{className:"sidebar-sticky-footer",children:s.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1 cursor-help",title:e("workflowRoot.description"),children:[s.jsx(ns,{className:"h-3 w-3 flex-shrink-0"}),s.jsx("span",{className:"truncate font-mono",title:mt.path||e("workflowRoot.notSet"),children:mt.path||e("workflowRoot.notSet")}),mt.isDefault&&mt.path&&s.jsxs("span",{className:"text-[9px] text-muted-foreground/70",children:["(",e("workflowRoot.default"),")"]})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[s.jsx(ee,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>_.browseWorkflowRoot(),title:e("workflowRoot.browse"),children:s.jsx(ns,{className:"h-3 w-3"})}),!mt.isDefault&&s.jsx(ee,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>_.resetWorkflowRoot(),title:e("workflowRoot.reset"),children:s.jsx(rs,{className:"h-3 w-3"})})]})]})}),Va&&s.jsx(ee,{className:"fixed bottom-4 right-4 z-20 rounded-full w-10 h-10 p-0 shadow-lg",onClick:si,title:e("common.scrollToTop"),children:s.jsx(Ho,{className:"h-4 w-4"})}),Z&&X&&s.jsxs("div",{role:"alert","aria-live":"polite",className:"fixed bottom-16 left-2 right-2 z-50 bg-foreground text-background rounded-lg shadow-lg overflow-hidden mx-auto max-w-[95%]",children:[s.jsx("div",{className:"h-1 bg-background/30",children:s.jsx("div",{className:"h-full bg-primary animate-[shrink_30s_linear]",style:{animation:"shrink 30s linear forwards"}})}),s.jsxs("div",{className:"flex items-center justify-between p-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ot,{className:"w-4 h-4 text-green-400 flex-shrink-0","aria-hidden":"true"}),s.jsxs("span",{className:"text-sm",children:[X.action==="approve"&&e("approvals.batch.undoApproved",{count:X.ids.length}),X.action==="reject"&&e("approvals.batch.undoRejected",{count:X.ids.length}),X.action==="revision"&&e("approvals.batch.undoRevision",{count:X.ids.length})]})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsxs(ee,{size:"sm",className:"h-7 px-2 text-xs bg-background/20 hover:bg-background/30 text-background border border-background/40",onClick:Qa,children:[s.jsx(gu,{className:"w-3.5 h-3.5 mr-1","aria-hidden":"true"}),e("approvals.batch.undo")]}),s.jsx("button",{onClick:()=>{Q(!1),q(null),J.current&&(clearTimeout(J.current),J.current=null)},className:"p-1 hover:bg-background/20 rounded","aria-label":e("common.dismiss"),children:s.jsx(Mr,{className:"w-4 h-4","aria-hidden":"true"})})]})]})]}),be&&s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>ae(!1)}),s.jsxs("div",{className:"relative bg-background border rounded-lg shadow-lg p-4 w-[90%] max-w-md mx-4",children:[s.jsx("h3",{className:"text-sm font-semibold mb-3",children:e("approvals.batch.rejectTitle",{count:P.size})}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:e("approvals.batch.rejectDescription")}),s.jsx("textarea",{className:"w-full h-24 p-2 text-sm border rounded bg-background resize-none focus:outline-none focus:ring-2 focus:ring-primary",placeholder:e("approvals.batch.rejectPlaceholder"),value:A,onChange:x=>Y(x.target.value),autoFocus:!0}),s.jsxs("div",{className:"flex justify-end gap-2 mt-3",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>ae(!1),children:e("approvals.cancel")}),s.jsxs(ee,{size:"sm",className:"bg-red-600 hover:bg-red-700",onClick:ti,disabled:!A.trim(),children:[s.jsx(ss,{className:"w-3.5 h-3.5 mr-1"}),e("approvals.batch.confirmReject")]})]})]})]})]})})}const as=document.getElementById("root");as&&(pi.createRoot(as).render(s.jsx(Ne.StrictMode,{children:s.jsx(a.Suspense,{fallback:"Loading...",children:s.jsx(cp,{})})})),document.body.classList.add("loaded"));