From baae0c221c54d2cc01dff649470ae5a8e39686f0 Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:03:25 +0530 Subject: [PATCH 01/13] =?UTF-8?q?Fix=20the=20a11y=20gate's=20320px=20reflo?= =?UTF-8?q?w=20failure=20=E2=80=94=20red=20since=20the=20gate=20landed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gate has never passed on CI. It was added in d2ca476 and pushed in the same batch as 27 other commits, so its very first run was already red, and it has stayed red for sixteen consecutive runs across six days (last green 623aa05, 2026-07-26) — through all three npm publishes: 0.9.0, 0.9.1 and 0.9.2. The failure was real, not flaky. `Updated` rendered item.updated_at as a bare ISO timestamp with no break-all, while every other value in that card (project, source/reporter, assignee, route) already had one. An ISO string is a single 24-char token with no break opportunity, so at 200% text zoom it set a 236px min-content floor that the Section's min-w-0 could not shrink. On macOS that lands at 301px and passes at a 320px viewport; on CI's Linux font metrics the same string measures ~325px, which is exactly the {"s":325,"c":320} in every failing run — and why this reproduced on CI but not locally. Adding break-all clears 320px with 40px of headroom: measured passing down to 280px, against a ~24px macOS/Linux metric delta. Co-Authored-By: Claude Fable 5 --- dashboard/src/views/ItemDetail.tsx | 5 ++++- .../assets/{index-s4C-2lo9.js => index-IgT9fk7g.js} | 2 +- public/dashboard/index.html | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) rename public/dashboard/assets/{index-s4C-2lo9.js => index-IgT9fk7g.js} (99%) diff --git a/dashboard/src/views/ItemDetail.tsx b/dashboard/src/views/ItemDetail.tsx index 8b9e966..2e79821 100644 --- a/dashboard/src/views/ItemDetail.tsx +++ b/dashboard/src/views/ItemDetail.tsx @@ -424,7 +424,10 @@ export function ItemDetail({
- {item.updated_at} + {/* An ISO timestamp is one 24-char token with no break opportunity, so + at 200% zoom it sets a 236px floor that min-w-0 cannot shrink — + the same break-all every other value in this card already carries. */} + {item.updated_at}
{item.resolution && (
diff --git a/public/dashboard/assets/index-s4C-2lo9.js b/public/dashboard/assets/index-IgT9fk7g.js similarity index 99% rename from public/dashboard/assets/index-s4C-2lo9.js rename to public/dashboard/assets/index-IgT9fk7g.js index 155676e..7d6d6fc 100644 --- a/public/dashboard/assets/index-s4C-2lo9.js +++ b/public/dashboard/assets/index-IgT9fk7g.js @@ -46,5 +46,5 @@ Error generating stack: `+a.message+` `)},Yg=function(){var l=parseInt(document.body.getAttribute(Ao)||"0",10);return isFinite(l)?l:0},vw=function(){b.useEffect(function(){return document.body.setAttribute(Ao,(Yg()+1).toString()),function(){var l=Yg()-1;l<=0?document.body.removeAttribute(Ao):document.body.setAttribute(Ao,l.toString())}},[])},yw=function(l){var o=l.noRelative,r=l.noImportant,i=l.gapMode,u=i===void 0?"margin":i;vw();var f=b.useMemo(function(){return hw(u)},[u]);return b.createElement(pw,{styles:gw(f,!o,u,r?"":"!important")})},qf=!1;if(typeof window<"u")try{var cs=Object.defineProperty({},"passive",{get:function(){return qf=!0,!0}});window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{qf=!1}var So=qf?{passive:!1}:!1,bw=function(l){return l.tagName==="TEXTAREA"},yy=function(l,o){if(!(l instanceof Element))return!1;var r=window.getComputedStyle(l);return r[o]!=="hidden"&&!(r.overflowY===r.overflowX&&!bw(l)&&r[o]==="visible")},xw=function(l){return yy(l,"overflowY")},Sw=function(l){return yy(l,"overflowX")},Vg=function(l,o){var r=o.ownerDocument,i=o;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=by(l,i);if(u){var f=xy(l,i),m=f[1],v=f[2];if(m>v)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},ww=function(l){var o=l.scrollTop,r=l.scrollHeight,i=l.clientHeight;return[o,r,i]},Ew=function(l){var o=l.scrollLeft,r=l.scrollWidth,i=l.clientWidth;return[o,r,i]},by=function(l,o){return l==="v"?xw(o):Sw(o)},xy=function(l,o){return l==="v"?ww(o):Ew(o)},Cw=function(l,o){return l==="h"&&o==="rtl"?-1:1},Tw=function(l,o,r,i,u){var f=Cw(l,window.getComputedStyle(o).direction),m=f*i,v=r.target,y=o.contains(v),p=!1,w=m>0,g=0,E=0;do{if(!v)break;var O=xy(l,v),A=O[0],C=O[1],T=O[2],S=C-T-f*A;(A||S)&&by(l,v)&&(g+=S,E+=A);var D=v.parentNode;v=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!y&&v!==document.body||y&&(o.contains(v)||o===v));return(w&&Math.abs(g)<1||!w&&Math.abs(E)<1)&&(p=!0),p},us=function(l){return"changedTouches"in l?[l.changedTouches[0].clientX,l.changedTouches[0].clientY]:[0,0]},Gg=function(l){return[l.deltaX,l.deltaY]},Xg=function(l){return l&&"current"in l?l.current:l},Aw=function(l,o){return l[0]===o[0]&&l[1]===o[1]},_w=function(l){return` .block-interactivity-`.concat(l,` {pointer-events: none;} .allow-interactivity-`).concat(l,` {pointer-events: all;} -`)},Ow=0,wo=[];function Rw(l){var o=b.useRef([]),r=b.useRef([0,0]),i=b.useRef(),u=b.useState(Ow++)[0],f=b.useState(vy)[0],m=b.useRef(l);b.useEffect(function(){m.current=l},[l]),b.useEffect(function(){if(l.inert){document.body.classList.add("block-interactivity-".concat(u));var C=JS([l.lockRef.current],(l.shards||[]).map(Xg),!0).filter(Boolean);return C.forEach(function(T){return T.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),C.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(u))})}}},[l.inert,l.lockRef.current,l.shards]);var v=b.useCallback(function(C,T){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!m.current.allowPinchZoom;var S=us(C),D=r.current,z="deltaX"in C?C.deltaX:D[0]-S[0],k="deltaY"in C?C.deltaY:D[1]-S[1],I,X=C.target,K=Math.abs(z)>Math.abs(k)?"h":"v";if("touches"in C&&K==="h"&&X.type==="range")return!1;var G=window.getSelection(),ae=G&&G.anchorNode,me=ae?ae===X||ae.contains(X):!1;if(me)return!1;var ge=Vg(K,X);if(!ge)return!0;if(ge?I=K:(I=K==="v"?"h":"v",ge=Vg(K,X)),!ge)return!1;if(!i.current&&"changedTouches"in C&&(z||k)&&(i.current=I),!I)return!0;var U=i.current||I;return Tw(U,T,C,U==="h"?z:k)},[]),y=b.useCallback(function(C){var T=C;if(!(!wo.length||wo[wo.length-1]!==f)){var S="deltaY"in T?Gg(T):us(T),D=o.current.filter(function(I){return I.name===T.type&&(I.target===T.target||T.target===I.shadowParent)&&Aw(I.delta,S)})[0];if(D&&D.should){T.cancelable&&T.preventDefault();return}if(!D){var z=(m.current.shards||[]).map(Xg).filter(Boolean).filter(function(I){return I.contains(T.target)}),k=z.length>0?v(T,z[0]):!m.current.noIsolation;k&&T.cancelable&&T.preventDefault()}}},[]),p=b.useCallback(function(C,T,S,D){var z={name:C,delta:T,target:S,should:D,shadowParent:Nw(S)};o.current.push(z),setTimeout(function(){o.current=o.current.filter(function(k){return k!==z})},1)},[]),w=b.useCallback(function(C){r.current=us(C),i.current=void 0},[]),g=b.useCallback(function(C){p(C.type,Gg(C),C.target,v(C,l.lockRef.current))},[]),E=b.useCallback(function(C){p(C.type,us(C),C.target,v(C,l.lockRef.current))},[]);b.useEffect(function(){return wo.push(f),l.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:E}),document.addEventListener("wheel",y,So),document.addEventListener("touchmove",y,So),document.addEventListener("touchstart",w,So),function(){wo=wo.filter(function(C){return C!==f}),document.removeEventListener("wheel",y,So),document.removeEventListener("touchmove",y,So),document.removeEventListener("touchstart",w,So)}},[]);var O=l.removeScrollBar,A=l.inert;return b.createElement(b.Fragment,null,A?b.createElement(f,{styles:_w(u)}):null,O?b.createElement(yw,{noRelative:l.noRelative,gapMode:l.gapMode}):null)}function Nw(l){for(var o=null;l!==null;)l instanceof ShadowRoot&&(o=l.host,l=l.host),l=l.parentNode;return o}const jw=ow(gy,Rw);var rd=b.forwardRef(function(l,o){return b.createElement(Us,Mn({},l,{ref:o,sideCar:jw}))});rd.classNames=Us.classNames;var Dw=function(l){if(typeof document>"u")return null;var o=Array.isArray(l)?l[0]:l;return o.ownerDocument.body},Eo=new WeakMap,fs=new WeakMap,ds={},xf=0,Sy=function(l){return l&&(l.host||Sy(l.parentNode))},zw=function(l,o){return o.map(function(r){if(l.contains(r))return r;var i=Sy(r);return i&&l.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",l,". Doing nothing"),null)}).filter(function(r){return!!r})},Mw=function(l,o,r,i){var u=zw(o,Array.isArray(l)?l:[l]);ds[r]||(ds[r]=new WeakMap);var f=ds[r],m=[],v=new Set,y=new Set(u),p=function(g){!g||v.has(g)||(v.add(g),p(g.parentNode))};u.forEach(p);var w=function(g){!g||y.has(g)||Array.prototype.forEach.call(g.children,function(E){if(v.has(E))w(E);else try{var O=E.getAttribute(i),A=O!==null&&O!=="false",C=(Eo.get(E)||0)+1,T=(f.get(E)||0)+1;Eo.set(E,C),f.set(E,T),m.push(E),C===1&&A&&fs.set(E,!0),T===1&&E.setAttribute(r,"true"),A||E.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",E,S)}})};return w(o),v.clear(),xf++,function(){m.forEach(function(g){var E=Eo.get(g)-1,O=f.get(g)-1;Eo.set(g,E),f.set(g,O),E||(fs.has(g)||g.removeAttribute(i),fs.delete(g)),O||g.removeAttribute(r)}),xf--,xf||(Eo=new WeakMap,Eo=new WeakMap,fs=new WeakMap,ds={})}},wy=function(l,o,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(l)?l:[l]),u=Dw(l);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),Mw(i,u,r,"aria-hidden")):function(){return null}},Uw=Object.defineProperty,nn=(l,o)=>Uw(l,"name",{value:o,configurable:!0}),sd="Dialog",[Ey,Cy]=Pa(sd),[kw,En]=Ey(sd),Lw=nn(l=>{const{__scopeDialog:o,children:r,open:i,defaultOpen:u,onOpenChange:f,modal:m=!0}=l,v=b.useRef(null),y=b.useRef(null),[p,w]=ki({prop:i,defaultProp:u??!1,onChange:f,caller:sd}),[g,E]=b.useState(0),[O,A]=b.useState(0);return h.jsx(kw,{scope:o,triggerRef:v,contentRef:y,contentId:Tl(),titleId:Tl(),descriptionId:Tl(),titlePresent:g>0,descriptionPresent:O>0,setTitleCount:E,setDescriptionCount:A,open:p,onOpenChange:w,onOpenToggle:b.useCallback(()=>w(C=>!C),[w]),modal:m,children:r})},"Dialog"),Hw="DialogTrigger",Bw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Hw,i),m=Xe(r,f.triggerRef);return h.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":ks(f.open),...u,ref:m,onClick:De(o.onClick,f.onOpenToggle)})},"DialogTrigger")),Ty="DialogPortal",[qw,Ay]=Ey(Ty,{forceMount:void 0}),Yw=nn(l=>{const{__scopeDialog:o,forceMount:r,children:i,container:u}=l,f=En(Ty,o);return h.jsx(qw,{scope:o,forceMount:r,children:b.Children.map(i,m=>h.jsx(jo,{present:r||f.open,children:h.jsx(od,{asChild:!0,container:u,children:m})}))})},"DialogPortal"),Yf="DialogOverlay",Vw=b.forwardRef(nn(function(o,r){const i=Ay(Yf,o.__scopeDialog),{forceMount:u=i.forceMount,...f}=o,m=En(Yf,o.__scopeDialog);return m.modal?h.jsx(jo,{present:u||m.open,children:h.jsx(Xw,{...f,ref:r})}):null},"DialogOverlay")),Gw=ua("DialogOverlay.RemoveScroll"),Xw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Yf,i),m=ly(),v=Xe(r,m);return h.jsx(rd,{as:Gw,allowPinchZoom:!0,shards:[f.contentRef],children:h.jsx(Ie.div,{"data-state":ks(f.open),...u,ref:v,style:{pointerEvents:"auto",...u.style}})})},"DialogOverlayImpl")),Li="DialogContent",Qw=b.forwardRef(nn(function(o,r){const i=Ay(Li,o.__scopeDialog),{forceMount:u=i.forceMount,...f}=o,m=En(Li,o.__scopeDialog);return h.jsx(jo,{present:u||m.open,children:m.modal?h.jsx(Zw,{...f,ref:r}):h.jsx(Kw,{...f,ref:r})})},"DialogContent")),Zw=b.forwardRef(nn(function(o,r){const i=En(Li,o.__scopeDialog),u=b.useRef(null),f=Xe(r,i.contentRef,u);return b.useEffect(()=>{const m=u.current;if(m)return wy(m)},[]),h.jsx(_y,{...o,ref:f,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:De(o.onCloseAutoFocus,m=>{m.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:De(o.onPointerDownOutside,m=>{const v=m.detail.originalEvent,y=v.button===0&&v.ctrlKey===!0;(v.button===2||y)&&m.preventDefault()}),onFocusOutside:De(o.onFocusOutside,m=>m.preventDefault())})},"DialogContentModal")),Kw=b.forwardRef(nn(function(o,r){const i=En(Li,o.__scopeDialog),u=b.useRef(!1),f=b.useRef(!1);return h.jsx(_y,{...o,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{o.onCloseAutoFocus?.(m),m.defaultPrevented||(u.current||i.triggerRef.current?.focus(),m.preventDefault()),u.current=!1,f.current=!1},onInteractOutside:m=>{o.onInteractOutside?.(m),m.defaultPrevented||(u.current=!0,m.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const v=m.target;i.triggerRef.current?.contains(v)&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&f.current&&m.preventDefault()}})},"DialogContentNonModal")),_y=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:m,...v}=o,y=En(Li,i);return Ms(),h.jsx(h.Fragment,{children:h.jsx(ry,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:f,onUnmountAutoFocus:m,children:h.jsx(nd,{role:"dialog",id:y.contentId,"aria-describedby":y.descriptionPresent?y.descriptionId:void 0,"aria-labelledby":y.titlePresent?y.titleId:void 0,"data-state":ks(y.open),...v,ref:r,deferPointerDownOutside:!0,onDismiss:()=>y.onOpenChange(!1)})})})},"DialogContentImpl")),$w="DialogTitle",Pw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En($w,i),{setTitleCount:m}=f;return at(()=>(m(v=>v+1),()=>m(v=>v-1)),[m]),h.jsx(Ie.h2,{id:f.titleId,...u,ref:r})},"DialogTitle")),Jw="DialogDescription",Iw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Jw,i),{setDescriptionCount:m}=f;return at(()=>(m(v=>v+1),()=>m(v=>v-1)),[m]),h.jsx(Ie.p,{id:f.descriptionId,...u,ref:r})},"DialogDescription")),Fw="DialogClose",Oy=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Fw,i);return h.jsx(Ie.button,{type:"button",...u,ref:r,onClick:De(o.onClick,()=>f.onOpenChange(!1))})},"DialogClose"));function ks(l){return l?"open":"closed"}nn(ks,"getState");var Ww=Object.defineProperty,ma=(l,o)=>Ww(l,"name",{value:o,configurable:!0}),e2="AlertDialog",[t2,HA]=Pa(e2,[Cy]),ha=Cy(),n2=ma(l=>{const{__scopeAlertDialog:o,...r}=l,i=ha(o);return h.jsx(Lw,{...i,...r,modal:!0})},"AlertDialog"),a2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Bw,{...f,...u,ref:r})},"AlertDialogTrigger")),l2=ma(l=>{const{__scopeAlertDialog:o,...r}=l,i=ha(o);return h.jsx(Yw,{...i,...r})},"AlertDialogPortal"),o2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Vw,{...f,...u,ref:r})},"AlertDialogOverlay")),i2="AlertDialogContent",[r2,s2]=t2(i2),c2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,children:u,...f}=o,m=ha(i),v=b.useRef(null),y=Xe(r,v),p=b.useRef(null);return h.jsx(r2,{scope:i,cancelRef:p,children:h.jsx(Qw,{role:"alertdialog",...m,...f,ref:y,onOpenAutoFocus:De(f.onOpenAutoFocus,w=>{w.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:w=>w.preventDefault(),onInteractOutside:w=>w.preventDefault(),children:u})})},"AlertDialogContent")),u2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Pw,{...f,...u,ref:r})},"AlertDialogTitle")),f2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Iw,{...f,...u,ref:r})},"AlertDialogDescription")),d2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Oy,{...f,...u,ref:r})},"AlertDialogAction")),m2="AlertDialogCancel",h2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,{cancelRef:f}=s2(m2,i),m=ha(i),v=Xe(r,f);return h.jsx(Oy,{...m,...u,ref:v})},"AlertDialogCancel")),p2=n2,g2=a2,v2=l2,y2=o2,b2=c2,x2=d2,S2=h2,w2=u2,E2=f2,C2=Object.defineProperty,T2=(l,o)=>C2(l,"name",{value:o,configurable:!0});function Ry(l){const[o,r]=b.useState(void 0);return at(()=>{if(l){r({width:l.offsetWidth,height:l.offsetHeight});const i=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const f=u[0];let m,v;if("borderBoxSize"in f){const y=f.borderBoxSize,p=Array.isArray(y)?y[0]:y;m=p.inlineSize,v=p.blockSize}else m=l.offsetWidth,v=l.offsetHeight;r({width:m,height:v})});return i.observe(l,{box:"border-box"}),()=>i.unobserve(l)}else r(void 0)},[l]),o}T2(Ry,"useSize");const A2=["top","right","bottom","left"],Ka=Math.min,ra=Math.max,Os=Math.round,ms=Math.floor,sa=l=>({x:l,y:l}),_2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ny(l,o,r){return ra(l,Ka(o,r))}function da(l,o){return typeof l=="function"?l(o):l}function $a(l){return l.split("-")[0]}function Do(l){return l.split("-")[1]}function cd(l){return l==="x"?"y":"x"}function ud(l){return l==="y"?"height":"width"}function Un(l){const o=l[0];return o==="t"||o==="b"?"y":"x"}function fd(l){return cd(Un(l))}function O2(l,o,r){r===void 0&&(r=!1);const i=Do(l),u=fd(l),f=ud(u);let m=u==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(m=Rs(m)),[m,Rs(m)]}function R2(l){const o=Rs(l);return[Vf(l),o,Vf(o)]}function Vf(l){return l.includes("start")?l.replace("start","end"):l.replace("end","start")}const Qg=["left","right"],Zg=["right","left"],N2=["top","bottom"],j2=["bottom","top"];function D2(l,o,r){switch(l){case"top":case"bottom":return r?o?Zg:Qg:o?Qg:Zg;case"left":case"right":return o?N2:j2;default:return[]}}function z2(l,o,r,i){const u=Do(l);let f=D2($a(l),r==="start",i);return u&&(f=f.map(m=>m+"-"+u),o&&(f=f.concat(f.map(Vf)))),f}function Rs(l){const o=$a(l);return _2[o]+l.slice(o.length)}function M2(l){var o,r,i,u;return{top:(o=l.top)!=null?o:0,right:(r=l.right)!=null?r:0,bottom:(i=l.bottom)!=null?i:0,left:(u=l.left)!=null?u:0}}function jy(l){return typeof l!="number"?M2(l):{top:l,right:l,bottom:l,left:l}}function Ns(l){const{x:o,y:r,width:i,height:u}=l;return{width:i,height:u,top:r,left:o,right:o+i,bottom:r+u,x:o,y:r}}function Kg(l,o,r){let{reference:i,floating:u}=l;const f=Un(o),m=fd(o),v=ud(m),y=$a(o),p=f==="y",w=i.x+i.width/2-u.width/2,g=i.y+i.height/2-u.height/2,E=i[v]/2-u[v]/2;let O;switch(y){case"top":O={x:w,y:i.y-u.height};break;case"bottom":O={x:w,y:i.y+i.height};break;case"right":O={x:i.x+i.width,y:g};break;case"left":O={x:i.x-u.width,y:g};break;default:O={x:i.x,y:i.y}}const A=Do(o);return A&&(O[m]+=E*(A==="end"?1:-1)*(r&&p?-1:1)),O}async function U2(l,o){var r;o===void 0&&(o={});const{x:i,y:u,platform:f,rects:m,elements:v,strategy:y}=l,{boundary:p="clippingAncestors",rootBoundary:w="viewport",elementContext:g="floating",altBoundary:E=!1,padding:O=0}=da(o,l),A=jy(O),T=v[E?g==="floating"?"reference":"floating":g],S=Ns(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(T)))==null||r?T:T.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(v.floating)),boundary:p,rootBoundary:w,strategy:y})),D=g==="floating"?{x:i,y:u,width:m.floating.width,height:m.floating.height}:m.reference,z=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v.floating)),k=await(f.isElement==null?void 0:f.isElement(z))&&await(f.getScale==null?void 0:f.getScale(z))||{x:1,y:1},I=Ns(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:D,offsetParent:z,strategy:y}):D);return{top:(S.top-I.top+A.top)/k.y,bottom:(I.bottom-S.bottom+A.bottom)/k.y,left:(S.left-I.left+A.left)/k.x,right:(I.right-S.right+A.right)/k.x}}const k2=50,L2=async(l,o,r)=>{const{placement:i="bottom",strategy:u="absolute",middleware:f=[],platform:m}=r,v=m.detectOverflow?m:{...m,detectOverflow:U2},y=await(m.isRTL==null?void 0:m.isRTL(o));let p=await m.getElementRects({reference:l,floating:o,strategy:u}),{x:w,y:g}=Kg(p,i,y),E=i,O=0;const A={};for(let C=0;C({name:"arrow",options:l,async fn(o){const{x:r,y:i,placement:u,rects:f,platform:m,elements:v,middlewareData:y}=o,{element:p,padding:w=0}=da(l,o)||{};if(p==null)return{};const g=jy(w),E={x:r,y:i},O=fd(u),A=ud(O),C=await m.getDimensions(p),T=O==="y",S=T?"top":"left",D=T?"bottom":"right",z=T?"clientHeight":"clientWidth",k=f.reference[A]+f.reference[O]-E[O]-f.floating[A],I=E[O]-f.reference[O],X=await(m.getOffsetParent==null?void 0:m.getOffsetParent(p));let K=X?X[z]:0;(!K||!await(m.isElement==null?void 0:m.isElement(X)))&&(K=v.floating[z]||f.floating[A]);const G=k/2-I/2,ae=K/2-C[A]/2-1,me=Ka(g[S],ae),ge=Ka(g[D],ae),U=K-C[A]-ge,te=K/2-C[A]/2+G,fe=Ny(me,te,U),he=!y.arrow&&Do(u)!=null&&te!==fe&&f.reference[A]/2-(tefe<=0)){var ge,U;const fe=(((ge=f.flip)==null?void 0:ge.index)||0)+1,he=K[fe];if(he&&(!(g==="alignment"?D!==Un(he):!1)||me.every(F=>Un(F.placement)===D?F.overflows[0]>0:!0)))return{data:{index:fe,overflows:me},reset:{placement:he}};let j=(U=me.filter(Y=>Y.overflows[0]<=0).sort((Y,F)=>Y.overflows[1]-F.overflows[1])[0])==null?void 0:U.placement;if(!j)switch(O){case"bestFit":{var te;const Y=(te=me.filter(F=>{if(X){const oe=Un(F.placement);return oe===D||oe==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(oe=>oe>0).reduce((oe,P)=>oe+P,0)]).sort((F,oe)=>F[1]-oe[1])[0])==null?void 0:te[0];Y&&(j=Y);break}case"initialPlacement":j=v;break}if(u!==j)return{reset:{placement:j}}}return{}}}};function $g(l,o){return{top:l.top-o.height,right:l.right-o.width,bottom:l.bottom-o.height,left:l.left-o.width}}function Pg(l){return A2.some(o=>l[o]>=0)}const q2=function(l){return l===void 0&&(l={}),{name:"hide",options:l,async fn(o){const{rects:r,platform:i}=o,{strategy:u="referenceHidden",...f}=da(l,o);switch(u){case"referenceHidden":{const m=await i.detectOverflow(o,{...f,elementContext:"reference"}),v=$g(m,r.reference);return{data:{referenceHiddenOffsets:v,referenceHidden:Pg(v)}}}case"escaped":{const m=await i.detectOverflow(o,{...f,altBoundary:!0}),v=$g(m,r.floating);return{data:{escapedOffsets:v,escaped:Pg(v)}}}default:return{}}}}},Dy=new Set(["left","top"]);async function Y2(l,o){const{placement:r,platform:i,elements:u}=l,f=await(i.isRTL==null?void 0:i.isRTL(u.floating)),m=$a(r),v=Do(r),y=Un(r)==="y",p=Dy.has(m)?-1:1,w=f&&y?-1:1,g=da(o,l);let{mainAxis:E,crossAxis:O,alignmentAxis:A}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return v&&typeof A=="number"&&(O=v==="end"?A*-1:A),y?{x:O*w,y:E*p}:{x:E*p,y:O*w}}const V2=function(l){return l===void 0&&(l=0),{name:"offset",options:l,async fn(o){var r,i;const{x:u,y:f,placement:m,middlewareData:v}=o,y=await Y2(o,l);return m===((r=v.offset)==null?void 0:r.placement)&&(i=v.arrow)!=null&&i.alignmentOffset?{}:{x:u+y.x,y:f+y.y,data:{...y,placement:m}}}}},G2=function(l){return l===void 0&&(l={}),{name:"shift",options:l,async fn(o){const{x:r,y:i,placement:u,platform:f}=o,{mainAxis:m=!0,crossAxis:v=!1,limiter:y={fn:D=>{let{x:z,y:k}=D;return{x:z,y:k}}},...p}=da(l,o),w={x:r,y:i},g=await f.detectOverflow(o,p),E=Un(u),O=cd(E);let A=w[O],C=w[E];const T=(D,z)=>Ny(z+g[D==="y"?"top":"left"],z,z-g[D==="y"?"bottom":"right"]);m&&(A=T(O,A)),v&&(C=T(E,C));const S=y.fn({...o,[O]:A,[E]:C});return{...S,data:{x:S.x-r,y:S.y-i,enabled:{[O]:m,[E]:v}}}}}},X2=function(l){return l===void 0&&(l={}),{options:l,fn(o){var r,i;const{x:u,y:f,placement:m,rects:v,middlewareData:y}=o,{offset:p=0,mainAxis:w=!0,crossAxis:g=!0}=da(l,o),E={x:u,y:f},O=Un(m),A=cd(O);let C=E[A],T=E[O];const S=da(p,o),D=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(r=S.mainAxis)!=null?r:0,crossAxis:(i=S.crossAxis)!=null?i:0};if(w){const I=A==="y"?"height":"width",X=v.reference[A]-v.floating[I]+D.mainAxis,K=v.reference[A]+v.reference[I]-D.mainAxis;CK&&(C=K)}if(g){var z,k;const I=A==="y"?"width":"height",X=Dy.has($a(m)),K=v.reference[O]-v.floating[I]+(X&&((z=y.offset)==null?void 0:z[O])||0)+(X?0:D.crossAxis),G=v.reference[O]+v.reference[I]+(X?0:((k=y.offset)==null?void 0:k[O])||0)-(X?D.crossAxis:0);TG&&(T=G)}return{[A]:C,[O]:T}}}},Q2=function(l){return l===void 0&&(l={}),{name:"size",options:l,async fn(o){const{placement:r,rects:i,platform:u,elements:f}=o,{apply:m=()=>{},...v}=da(l,o),y=await u.detectOverflow(o,v),p=$a(r),w=Do(r),g=Un(r)==="y",{width:E,height:O}=i.floating;let A,C;p==="top"||p==="bottom"?(A=p,C=w===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(C=p,A=w==="end"?"top":"bottom");const T=O-y.top-y.bottom,S=E-y.left-y.right,D=Ka(O-y[A],T),z=Ka(E-y[C],S),k=o.middlewareData.shift,I=!k;let X=D,K=z;k!=null&&k.enabled.x&&(K=S),k!=null&&k.enabled.y&&(X=T),I&&!w&&(g?K=E-2*ra(y.left,y.right):X=O-2*ra(y.top,y.bottom)),await m({...o,availableWidth:K,availableHeight:X});const G=await u.getDimensions(f.floating);return E!==G.width||O!==G.height?{reset:{rects:!0}}:{}}}};function Ls(){return typeof window<"u"}function zo(l){return zy(l)?(l.nodeName||"").toLowerCase():"#document"}function Zt(l){var o;return(l==null||(o=l.ownerDocument)==null?void 0:o.defaultView)||window}function pa(l){var o;return(o=(zy(l)?l.ownerDocument:l.document)||window.document)==null?void 0:o.documentElement}function zy(l){return Ls()?l instanceof Node||l instanceof Zt(l).Node:!1}function Ln(l){return Ls()?l instanceof Element||l instanceof Zt(l).Element:!1}function Ja(l){return Ls()?l instanceof HTMLElement||l instanceof Zt(l).HTMLElement:!1}function Jg(l){return!Ls()||typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof Zt(l).ShadowRoot}function Hs(l){const{overflow:o,overflowX:r,overflowY:i,display:u}=Hn(l);return/auto|scroll|overlay|hidden|clip/.test(o+i+r)&&u!=="inline"&&u!=="contents"}function Z2(l){return/^(table|td|th)$/.test(zo(l))}function Bs(l){try{if(l.matches(":popover-open"))return!0}catch{}try{return l.matches(":modal")}catch{return!1}}const K2=/transform|translate|scale|rotate|perspective|filter/,$2=/paint|layout|strict|content/,wl=l=>!!l&&l!=="none";let Sf;function dd(l){const o=Ln(l)?Hn(l):l;return wl(o.transform)||wl(o.translate)||wl(o.scale)||wl(o.rotate)||wl(o.perspective)||!md()&&(wl(o.backdropFilter)||wl(o.filter))||K2.test(o.willChange||"")||$2.test(o.contain||"")}function P2(l){let o=Al(l);for(;Ja(o)&&!Hi(o);){if(dd(o))return o;if(Bs(o))return null;o=Al(o)}return null}function md(){return Sf==null&&(Sf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Sf}function Hi(l){return/^(html|body|#document)$/.test(zo(l))}function Hn(l){return Zt(l).getComputedStyle(l)}function qs(l){return Ln(l)?{scrollLeft:l.scrollLeft,scrollTop:l.scrollTop}:{scrollLeft:l.scrollX,scrollTop:l.scrollY}}function Al(l){if(zo(l)==="html")return l;const o=l.assignedSlot||l.parentNode||Jg(l)&&l.host||pa(l);return Jg(o)?o.host:o}function My(l){const o=Al(l);return Hi(o)?(l.ownerDocument||l).body:Ja(o)&&Hs(o)?o:My(o)}function Bi(l,o,r){var i;o===void 0&&(o=[]),r===void 0&&(r=!0);const u=My(l),f=u===((i=l.ownerDocument)==null?void 0:i.body),m=Zt(u);if(f){const v=Gf(m);return o.concat(m,m.visualViewport||[],Hs(u)?u:[],v&&r?Bi(v):[])}else return o.concat(u,Bi(u,[],r))}function Gf(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}function Uy(l){const o=Hn(l);let r=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const u=Ja(l),f=u?l.offsetWidth:r,m=u?l.offsetHeight:i,v=Os(r)!==f||Os(i)!==m;return v&&(r=f,i=m),{width:r,height:i,$:v}}function hd(l){return Ln(l)?l:l.contextElement}function _o(l){const o=hd(l);if(!Ja(o))return sa(1);const r=o.getBoundingClientRect(),{width:i,height:u,$:f}=Uy(o);let m=(f?Os(r.width):r.width)/i,v=(f?Os(r.height):r.height)/u;return(!m||!Number.isFinite(m))&&(m=1),(!v||!Number.isFinite(v))&&(v=1),{x:m,y:v}}const J2=sa(0);function ky(l){const o=Zt(l);return!md()||!o.visualViewport?J2:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function I2(l,o,r){return o===void 0&&(o=!1),!!r&&o&&r===Zt(l)}function _l(l,o,r,i){o===void 0&&(o=!1),r===void 0&&(r=!1);const u=l.getBoundingClientRect(),f=hd(l);let m=sa(1);o&&(i?Ln(i)&&(m=_o(i)):m=_o(l));const v=I2(f,r,i)?ky(f):sa(0);let y=(u.left+v.x)/m.x,p=(u.top+v.y)/m.y,w=u.width/m.x,g=u.height/m.y;if(f&&i){const E=Zt(f),O=Ln(i)?Zt(i):i;let A=E,C=Gf(A);for(;C&&O!==A;){const T=_o(C),S=C.getBoundingClientRect(),D=Hn(C),z=S.left+(C.clientLeft+parseFloat(D.paddingLeft))*T.x,k=S.top+(C.clientTop+parseFloat(D.paddingTop))*T.y;y*=T.x,p*=T.y,w*=T.x,g*=T.y,y+=z,p+=k,A=Zt(C),C=Gf(A)}}return Ns({width:w,height:g,x:y,y:p})}function Ys(l,o){const r=qs(l).scrollLeft;return o?o.left+r:_l(pa(l)).left+r}function Ly(l,o){const r=l.getBoundingClientRect(),i=r.left+o.scrollLeft-Ys(l,r),u=r.top+o.scrollTop;return{x:i,y:u}}function F2(l){let{elements:o,rect:r,offsetParent:i,strategy:u}=l;const f=u==="fixed",m=pa(i),v=o?Bs(o.floating):!1;if(i===m||v&&f)return r;let y={scrollLeft:0,scrollTop:0},p=sa(1);const w=sa(0),g=Ja(i);if((g||!f)&&((zo(i)!=="body"||Hs(m))&&(y=qs(i)),g)){const O=_l(i);p=_o(i),w.x=O.x+i.clientLeft,w.y=O.y+i.clientTop}const E=m&&!g&&!f?Ly(m,y):sa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-y.scrollLeft*p.x+w.x+E.x,y:r.y*p.y-y.scrollTop*p.y+w.y+E.y}}function W2(l){return l.getClientRects?Array.from(l.getClientRects()):[]}function eE(l){const o=qs(l),r=l.ownerDocument.body,i=ra(l.scrollWidth,l.clientWidth,r.scrollWidth,r.clientWidth),u=ra(l.scrollHeight,l.clientHeight,r.scrollHeight,r.clientHeight);let f=-o.scrollLeft+Ys(l);const m=-o.scrollTop;return Hn(r).direction==="rtl"&&(f+=ra(l.clientWidth,r.clientWidth)-i),{width:i,height:u,x:f,y:m}}const tE=25;function nE(l,o,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",u=Zt(l),f=pa(l),m=u.visualViewport;let v=f.clientWidth,y=f.clientHeight,p=0,w=0;if(m){const E=!md()||o==="fixed";i?E||(p=-m.offsetLeft,w=-m.offsetTop):(v=m.width,y=m.height,E&&(p=m.offsetLeft,w=m.offsetTop))}if(Ys(f)<=0){const E=f.ownerDocument,O=E.body,A=getComputedStyle(O),C=E.compatMode==="CSS1Compat"&&parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0,T=Math.abs(f.clientWidth-O.clientWidth-C),S=getComputedStyle(f).scrollbarGutter==="stable both-edges"?T/2:T;S<=tE&&(v-=S)}return{width:v,height:y,x:p,y:w}}function aE(l,o){const r=_l(l,!0,o==="fixed"),i=r.top+l.clientTop,u=r.left+l.clientLeft,f=_o(l),m=l.clientWidth*f.x,v=l.clientHeight*f.y,y=u*f.x,p=i*f.y;return{width:m,height:v,x:y,y:p}}function Ig(l,o,r){let i;if(o==="viewport"||o==="layoutViewport")i=nE(l,r,o);else if(o==="document")i=eE(pa(l));else if(Ln(o))i=aE(o,r);else{const u=ky(l);i={x:o.x-u.x,y:o.y-u.y,width:o.width,height:o.height}}return Ns(i)}function lE(l,o){const r=o.get(l);if(r)return r;let i=Bi(l,[],!1).filter(v=>Ln(v)&&zo(v)!=="body"),u=null;const f=Hn(l).position==="fixed";let m=f?Al(l):l;for(;Ln(m)&&!Hi(m);){const v=Hn(m),y=dd(m),p=u?u.position:f?"fixed":"";!y&&(p==="fixed"||p==="absolute"&&v.position==="static")?i=i.filter(g=>g!==m):u=v,m=Al(m)}return o.set(l,i),i}function oE(l){let{element:o,boundary:r,rootBoundary:i,strategy:u}=l;const m=[...r==="clippingAncestors"?Bs(o)?[]:lE(o,this._c):[].concat(r),i],v=Ig(o,m[0],u);let y=v.top,p=v.right,w=v.bottom,g=v.left;for(let E=1;E{v(!1,1e-7)},1e3)}K=!1}try{i=new IntersectionObserver(G,{...X,root:f.ownerDocument})}catch{i=new IntersectionObserver(G,X)}i.observe(l)}const y=Zt(l),p=()=>v(r);return y.addEventListener("resize",p),v(!0),()=>{y.removeEventListener("resize",p),m()}}function dE(l,o,r,i){i===void 0&&(i={});const{ancestorScroll:u=!0,ancestorResize:f=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:y=!1}=i,p=hd(l),w=u||f?[...p?Bi(p):[],...o?Bi(o):[]]:[];w.forEach(S=>{u&&S.addEventListener("scroll",r),f&&S.addEventListener("resize",r)});const g=p&&v?fE(p,r,f):null;let E=-1,O=null;m&&(O=new ResizeObserver(S=>{let[D]=S;D&&D.target===p&&O&&o&&(O.unobserve(o),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var z;(z=O)==null||z.observe(o)})),r()}),p&&!y&&O.observe(p),o&&O.observe(o));let A,C=y?_l(l):null;y&&T();function T(){const S=_l(l);C&&!By(C,S)&&r(),C=S,A=requestAnimationFrame(T)}return r(),()=>{var S;w.forEach(D=>{u&&D.removeEventListener("scroll",r),f&&D.removeEventListener("resize",r)}),g?.(),(S=O)==null||S.disconnect(),O=null,y&&cancelAnimationFrame(A)}}const mE=V2,hE=G2,pE=B2,gE=Q2,vE=q2,Wg=H2,yE=X2,bE=(l,o,r)=>{const i=new Map,u=r??{},f={...uE,...u.platform,_c:i};return L2(l,o,{...u,platform:f})};var xE=typeof document<"u",SE=function(){},_s=xE?b.useLayoutEffect:SE;function js(l,o){if(l===o)return!0;if(typeof l!=typeof o)return!1;if(typeof l=="function"&&l.toString()===o.toString())return!0;let r,i,u;if(l&&o&&typeof l=="object"){if(Array.isArray(l)){if(r=l.length,r!==o.length)return!1;for(i=r;i--!==0;)if(!js(l[i],o[i]))return!1;return!0}if(u=Object.keys(l),r=u.length,r!==Object.keys(o).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(o,u[i]))return!1;for(i=r;i--!==0;){const f=u[i];if(!(f==="_owner"&&l.$$typeof)&&!js(l[f],o[f]))return!1}return!0}return l!==l&&o!==o}function qy(l){return typeof window>"u"?1:(l.ownerDocument.defaultView||window).devicePixelRatio||1}function ev(l,o){const r=qy(l);return Math.round(o*r)/r}function Ef(l){const o=b.useRef(l);return _s(()=>{o.current=l}),o}function wE(l){l===void 0&&(l={});const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:u,elements:{reference:f,floating:m}={},transform:v=!0,whileElementsMounted:y,open:p}=l,[w,g]=b.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[E,O]=b.useState(i);js(E,i)||O(i);const[A,C]=b.useState(null),[T,S]=b.useState(null),D=b.useCallback(F=>{F!==X.current&&(X.current=F,C(F))},[]),z=b.useCallback(F=>{F!==K.current&&(K.current=F,S(F))},[]),k=f||A,I=m||T,X=b.useRef(null),K=b.useRef(null),G=b.useRef(w),ae=y!=null,me=Ef(y),ge=Ef(u),U=Ef(p),te=b.useCallback(()=>{if(!X.current||!K.current)return;const F={placement:o,strategy:r,middleware:E};ge.current&&(F.platform=ge.current),bE(X.current,K.current,F).then(oe=>{const P={...oe,isPositioned:U.current!==!1};fe.current&&!js(G.current,P)&&(G.current=P,Ro.flushSync(()=>{g(P)}))})},[E,o,r,ge,U]);_s(()=>{p===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[p]);const fe=b.useRef(!1);_s(()=>(fe.current=!0,()=>{fe.current=!1}),[]),_s(()=>{if(k&&(X.current=k),I&&(K.current=I),k&&I){if(me.current)return me.current(k,I,te);te()}},[k,I,te,me,ae]);const he=b.useMemo(()=>({reference:X,floating:K,setReference:D,setFloating:z}),[D,z]),j=b.useMemo(()=>({reference:k,floating:I}),[k,I]),Y=b.useMemo(()=>{const F={position:r,left:0,top:0};if(!j.floating)return F;const oe=ev(j.floating,w.x),P=ev(j.floating,w.y);return v?{...F,transform:"translate("+oe+"px, "+P+"px)",...qy(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:oe,top:P}},[r,v,j.floating,w.x,w.y]);return b.useMemo(()=>({...w,update:te,refs:he,elements:j,floatingStyles:Y}),[w,te,he,j,Y])}const EE=l=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:l,fn(r){const{element:i,padding:u}=typeof l=="function"?l(r):l;return i&&o(i)?i.current!=null?Wg({element:i.current,padding:u}).fn(r):{}:i?Wg({element:i,padding:u}).fn(r):{}}}},CE=(l,o)=>{const r=mE(l);return{name:r.name,fn:r.fn,options:[l,o]}},TE=(l,o)=>{const r=hE(l);return{name:r.name,fn:r.fn,options:[l,o]}},AE=(l,o)=>({fn:yE(l).fn,options:[l,o]}),_E=(l,o)=>{const r=pE(l);return{name:r.name,fn:r.fn,options:[l,o]}},OE=(l,o)=>{const r=gE(l);return{name:r.name,fn:r.fn,options:[l,o]}},RE=(l,o)=>{const r=vE(l);return{name:r.name,fn:r.fn,options:[l,o]}},NE=(l,o)=>{const r=EE(l);return{name:r.name,fn:r.fn,options:[l,o]}};var jE=Object.defineProperty,DE=(l,o)=>jE(l,"name",{value:o,configurable:!0}),zE=b.forwardRef(DE(function(o,r){const{children:i,width:u=10,height:f=5,...m}=o;return h.jsx(Ie.svg,{...m,ref:r,width:u,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:o.asChild?i:h.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),ME=zE,UE=Object.defineProperty,ca=(l,o)=>UE(l,"name",{value:o,configurable:!0}),Yy="Popper",[Vy,Vs]=Pa(Yy),[kE,Gy]=Vy(Yy),LE=ca(l=>{const{__scopePopper:o,children:r}=l,[i,u]=b.useState(null),[f,m]=b.useState(void 0);return h.jsx(kE,{scope:o,anchor:i,onAnchorChange:u,placementState:f,setPlacementState:m,children:r})},"Popper"),HE="PopperAnchor",BE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,virtualRef:u,...f}=o,m=Gy(HE,i),v=b.useRef(null),y=m.onAnchorChange,p=b.useCallback(C=>{v.current=C,C&&y(C)},[y]),w=Xe(r,p),g=b.useRef(null);b.useEffect(()=>{if(!u)return;const C=g.current;g.current=u.current,C!==g.current&&y(g.current)});const E=m.placementState&&Gs(m.placementState),O=E?.[0],A=E?.[1];return u?null:h.jsx(Ie.div,{"data-radix-popper-side":O,"data-radix-popper-align":A,...f,ref:w})},"PopperAnchor")),Xy="PopperContent",[qE,YE]=Vy(Xy),VE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,side:u="bottom",sideOffset:f=0,align:m="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:p=!0,collisionBoundary:w=[],collisionPadding:g=0,sticky:E="partial",hideWhenDetached:O=!1,updatePositionStrategy:A="optimized",onPlaced:C,...T}=o,S=Gy(Xy,i),[D,z]=b.useState(null),k=Xe(r,z),[I,X]=b.useState(null),K=Ry(I),G=K?.width??0,ae=K?.height??0,me=u+(m!=="center"?"-"+m:""),ge=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(w)?w:[w],te=U.length>0,fe={padding:ge,boundary:U.filter(Qy),altBoundary:te},{refs:he,floatingStyles:j,placement:Y,isPositioned:F,middlewareData:oe}=wE({strategy:"fixed",placement:me,whileElementsMounted:ca((...re)=>dE(...re,{animationFrame:A==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[CE({mainAxis:f+ae,alignmentAxis:v}),p&&TE({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?AE():void 0,...fe}),p&&_E({...fe}),OE({...fe,apply:ca(({elements:re,rects:Le,availableWidth:Ce,availableHeight:Te})=>{const{width:He,height:Ze}=Le.reference,dt=re.floating.style;dt.setProperty("--radix-popper-available-width",`${Ce}px`),dt.setProperty("--radix-popper-available-height",`${Te}px`),dt.setProperty("--radix-popper-anchor-width",`${He}px`),dt.setProperty("--radix-popper-anchor-height",`${Ze}px`)},"apply")}),I&&NE({element:I,padding:y}),ZE({arrowWidth:G,arrowHeight:ae}),O&&RE({strategy:"referenceHidden",...fe,boundary:te?fe.boundary:void 0})]}),P=S.setPlacementState;at(()=>(P(Y),()=>{P(void 0)}),[Y,P]);const[R,V]=Gs(Y),Z=kn(C);at(()=>{F&&Z?.()},[F,Z]);const W=oe.arrow?.x,ee=oe.arrow?.y,ie=oe.arrow?.centerOffset!==0,[ye,ne]=b.useState();return at(()=>{D&&ne(window.getComputedStyle(D).zIndex)},[D]),h.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:F?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(" "),...oe.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:o.dir,children:h.jsx(qE,{scope:i,placedSide:R,placedAlign:V,onArrowChange:X,arrowX:W,arrowY:ee,shouldHideArrow:ie,children:h.jsx(Ie.div,{"data-side":R,"data-align":V,...T,ref:k,style:{...T.style,animation:F?T.style?.animation:"none"}})})})},"PopperContent")),GE="PopperArrow",XE={top:"bottom",right:"left",bottom:"top",left:"right"},QE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,...u}=o,f=YE(GE,i),m=XE[f.placedSide];return h.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:h.jsx(ME,{...u,ref:r,style:{...u.style,display:"block"}})})},"PopperArrow"));function Qy(l){return l!==null}ca(Qy,"isNotNull");var ZE=ca(l=>({name:"transformOrigin",options:l,fn(o){const{placement:r,rects:i,middlewareData:u}=o,m=u.arrow?.centerOffset!==0,v=m?0:l.arrowWidth,y=m?0:l.arrowHeight,[p,w]=Gs(r),g={start:"0%",center:"50%",end:"100%"}[w],E=(u.arrow?.x??0)+v/2,O=(u.arrow?.y??0)+y/2;let A="",C="";return p==="bottom"?(A=m?g:`${E}px`,C=`${-y}px`):p==="top"?(A=m?g:`${E}px`,C=`${i.floating.height+y}px`):p==="right"?(A=`${-y}px`,C=m?g:`${O}px`):p==="left"&&(A=`${i.floating.width+y}px`,C=m?g:`${O}px`),{data:{x:A,y:C}}}}),"transformOrigin");function Gs(l){const[o,r="center"]=l.split("-");return[o,r]}ca(Gs,"getSideAndAlignFromPlacement");var Zy=LE,Ky=BE,$y=VE,KE=QE,$E=Object.defineProperty,PE=(l,o)=>$E(l,"name",{value:o,configurable:!0}),JE=b.forwardRef(PE(function(o,r){return h.jsx(Ie.label,{...o,ref:r,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(o.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}})},"Label")),IE=JE,FE=Object.defineProperty,WE=(l,o)=>FE(l,"name",{value:o,configurable:!0});function Py(l){const o=b.useRef({value:l,previous:l});return b.useMemo(()=>(o.current.value!==l&&(o.current.previous=o.current.value,o.current.value=l),o.current.previous),[l])}WE(Py,"usePrevious");var eC=Object.defineProperty,tC=(l,o)=>eC(l,"name",{value:o,configurable:!0});function Xf(l,[o,r]){return Math.min(r,Math.max(o,l))}tC(Xf,"clamp");var nC=Object.defineProperty,ze=(l,o)=>nC(l,"name",{value:o,configurable:!0}),aC=[" ","Enter","ArrowUp","ArrowDown"],lC=[" ","Enter"],Oo="Select",[Xs,Qs,oC]=Yv(Oo),[Rl,BA]=Pa(Oo,[oC,Vs]),pd=Vs(),[iC,Ia]=Rl(Oo),[rC,sC]=Rl(Oo);function Jy(l){const{__scopeSelect:o,children:r,open:i,defaultOpen:u,onOpenChange:f,value:m,defaultValue:v,onValueChange:y,dir:p,name:w,autoComplete:g,disabled:E,required:O,form:A,internal_do_not_use_render:C}=l,T=pd(o),[S,D]=b.useState(null),[z,k]=b.useState(null),[I,X]=b.useState(!1),K=ny(p),[G,ae]=ki({prop:i,defaultProp:u??!1,onChange:f,caller:Oo}),[me,ge]=ki({prop:m,defaultProp:v,onChange:y,caller:Oo}),U=b.useRef(null),te=b.useRef(me);b.useEffect(()=>{const V=A?S?.ownerDocument.getElementById(A):S?.form;if(V instanceof HTMLFormElement){const Z=ze(()=>ge(te.current),"reset");return V.addEventListener("reset",Z),()=>V.removeEventListener("reset",Z)}},[A,S,ge]);const fe=S?!!A||!!S.closest("form"):!0,[he,j]=b.useState(new Set),Y=Tl(),F=Array.from(he).map(V=>V.props.value).join(";"),oe=b.useCallback(V=>{j(Z=>new Set(Z).add(V))},[]),P=b.useCallback(V=>{j(Z=>{const W=new Set(Z);return W.delete(V),W})},[]),R={required:O,trigger:S,onTriggerChange:D,valueNode:z,onValueNodeChange:k,valueNodeHasChildren:I,onValueNodeHasChildrenChange:X,contentId:Y,value:me,onValueChange:ge,open:G,onOpenChange:ae,dir:K,triggerPointerDownPosRef:U,disabled:E,name:w,autoComplete:g,form:A,nativeOptions:he,nativeSelectKey:F,isFormControl:fe};return h.jsx(Zy,{...T,children:h.jsx(iC,{scope:o,...R,children:h.jsx(Xs.Provider,{scope:o,children:h.jsx(rC,{scope:o,onNativeOptionAdd:oe,onNativeOptionRemove:P,children:e0(C)?C(R):r})})})})}ze(Jy,"SelectProvider");var cC=ze(l=>{const{__scopeSelect:o,children:r,...i}=l;return h.jsx(Jy,{__scopeSelect:o,...i,internal_do_not_use_render:({isFormControl:u})=>h.jsxs(h.Fragment,{children:[r,u?h.jsx(UC,{__scopeSelect:o}):null]})})},"Select"),uC="SelectTrigger",fC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,disabled:u=!1,...f}=o,m=pd(i),v=Ia(uC,i),y=v.disabled||u,p=Xe(r,v.onTriggerChange),w=Qs(i),g=b.useRef("touch"),[E,O,A]=vd(T=>{const S=w().filter(k=>!k.disabled),D=S.find(k=>k.value===v.value),z=yd(S,T,D);z!==void 0&&v.onValueChange(z.value)}),C=ze(T=>{y||(v.onOpenChange(!0),A()),T&&(v.triggerPointerDownPosRef.current={x:Math.round(T.pageX),y:Math.round(T.pageY)})},"handleOpen");return h.jsx(Ky,{asChild:!0,...m,children:h.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":v.open?v.contentId:void 0,"aria-expanded":v.open,"aria-required":v.required,"aria-autocomplete":"none",dir:v.dir,"data-state":v.open?"open":"closed",disabled:y,"data-disabled":y?"":void 0,"data-placeholder":Xi(v.value)?"":void 0,...f,ref:p,onClick:De(f.onClick,T=>{T.currentTarget.focus(),g.current!=="mouse"&&C(T)}),onPointerDown:De(f.onPointerDown,T=>{g.current=T.pointerType;const S=T.target;S.hasPointerCapture(T.pointerId)&&S.releasePointerCapture(T.pointerId),T.button===0&&T.ctrlKey===!1&&T.pointerType==="mouse"&&(C(T),T.preventDefault())}),onKeyDown:De(f.onKeyDown,T=>{const S=E.current!=="";!(T.ctrlKey||T.altKey||T.metaKey)&&T.key.length===1&&O(T.key),!(S&&T.key===" ")&&aC.includes(T.key)&&(C(),T.preventDefault())})})})},"SelectTrigger")),dC="SelectValue",mC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,className:u,style:f,children:m,placeholder:v="",...y}=o,p=Ia(dC,i),{onValueNodeHasChildrenChange:w}=p,g=m!==void 0,E=Xe(r,p.onValueNodeChange);at(()=>{w(g)},[w,g]);const O=Xi(p.value);return h.jsx(Ie.span,{...y,asChild:O?!1:y.asChild,ref:E,style:{pointerEvents:"none"},children:h.jsx(b.Fragment,{children:O?v:m},O?"placeholder":"value")})},"SelectValue")),hC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,children:u,...f}=o;return h.jsx(Ie.span,{"aria-hidden":!0,...f,ref:r,children:u||"▼"})},"SelectIcon")),pC="SelectPortal",[gC,vC]=Rl(pC,{forceMount:void 0}),yC=ze(l=>{const{__scopeSelect:o,forceMount:r,...i}=l;return h.jsx(gC,{scope:l.__scopeSelect,forceMount:r,children:h.jsx(od,{asChild:!0,...i})})},"SelectPortal"),Ol="SelectContent",bC=b.forwardRef(ze(function(o,r){const i=vC(Ol,o.__scopeSelect),{forceMount:u=i.forceMount,...f}=o,m=Ia(Ol,o.__scopeSelect),[v,y]=b.useState();return at(()=>{y(new DocumentFragment)},[]),h.jsx(jo,{present:u||m.open,children:({present:p})=>p?h.jsx(wC,{...f,ref:r}):h.jsx(xC,{...f,fragment:v})})},"SelectContent")),xC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,children:u,fragment:f}=o;return f?Ro.createPortal(h.jsx(Iy,{scope:i,children:h.jsx(Xs.Slot,{scope:i,children:h.jsx("div",{ref:r,children:u})})}),f):null},"SelectContentFragment")),Sn=10,[Iy,Nl]=Rl(Ol),SC=ua("SelectContent.RemoveScroll"),wC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i}=o,{position:u="item-aligned",onCloseAutoFocus:f,onEscapeKeyDown:m,onPointerDownOutside:v,side:y,sideOffset:p,align:w,alignOffset:g,arrowPadding:E,collisionBoundary:O,collisionPadding:A,sticky:C,hideWhenDetached:T,avoidCollisions:S,...D}=o,z=Ia(Ol,i),[k,I]=b.useState(null),[X,K]=b.useState(null),G=Xe(r,I),[ae,me]=b.useState(null),[ge,U]=b.useState(null),te=Qs(i),[fe,he]=b.useState(!1),j=b.useRef(!1);b.useEffect(()=>{if(k)return wy(k)},[k]),Ms();const Y=b.useCallback(ne=>{const[re,...Le]=te().map(He=>He.ref.current),[Ce]=Le.slice(-1),Te=document.activeElement;for(const He of ne)if(He===Te||(He?.scrollIntoView({block:"nearest"}),He===re&&X&&(X.scrollTop=0),He===Ce&&X&&(X.scrollTop=X.scrollHeight),He?.focus(),document.activeElement!==Te))return},[te,X]),F=b.useCallback(()=>Y([ae,k]),[Y,ae,k]);b.useEffect(()=>{fe&&F()},[fe,F]);const{onOpenChange:oe,triggerPointerDownPosRef:P}=z;b.useEffect(()=>{if(k){let ne={x:0,y:0};const re=ze(Ce=>{ne={x:Math.abs(Math.round(Ce.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(Ce.pageY)-(P.current?.y??0))}},"handlePointerMove"),Le=ze(Ce=>{ne.x<=10&&ne.y<=10?Ce.preventDefault():Ce.composedPath().includes(k)||oe(!1),document.removeEventListener("pointermove",re),P.current=null},"handlePointerUp");return P.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Le,{capture:!0})}}},[k,oe,P]),b.useEffect(()=>{const ne=ze(()=>oe(!1),"close");return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[oe]);const[R,V]=vd(ne=>{const re=te().filter(Te=>!Te.disabled),Le=re.find(Te=>Te.ref.current===document.activeElement),Ce=yd(re,ne,Le);Ce&&setTimeout(()=>Ce.ref.current?.focus())}),Z=b.useCallback((ne,re,Le)=>{const Ce=!j.current&&!Le;(z.value!==void 0&&z.value===re||Ce)&&(me(ne),Ce&&(j.current=!0))},[z.value]),W=b.useCallback(()=>k?.focus(),[k]),ee=b.useCallback((ne,re,Le)=>{const Ce=!j.current&&!Le;(z.value!==void 0&&z.value===re||Ce)&&U(ne)},[z.value]),ie=u==="popper"?tv:EC,ye=ie===tv?{side:y,sideOffset:p,align:w,alignOffset:g,arrowPadding:E,collisionBoundary:O,collisionPadding:A,sticky:C,hideWhenDetached:T,avoidCollisions:S}:{};return h.jsx(Iy,{scope:i,content:k,viewport:X,onViewportChange:K,itemRefCallback:Z,selectedItem:ae,onItemLeave:W,itemTextRefCallback:ee,focusSelectedItem:F,selectedItemText:ge,position:u,isPositioned:fe,searchRef:R,children:h.jsx(rd,{as:SC,allowPinchZoom:!0,children:h.jsx(ry,{asChild:!0,trapped:z.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:De(f,ne=>{z.trigger?.focus({preventScroll:!0}),ne.preventDefault()}),children:h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>z.onOpenChange(!1),children:h.jsx(ie,{role:"listbox",id:z.contentId,"data-state":z.open?"open":"closed",dir:z.dir,onContextMenu:ne=>ne.preventDefault(),...D,...ye,onPlaced:()=>he(!0),ref:G,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:De(D.onKeyDown,ne=>{const re=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!re&&ne.key.length===1&&V(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let Ce=te().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Te=ne.target,He=Ce.indexOf(Te);Ce=Ce.slice(He+1)}setTimeout(()=>Y(Ce)),ne.preventDefault()}})})})})})})},"SelectContentImpl")),EC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,onPlaced:u,...f}=o,m=Ia(Ol,i),v=Nl(Ol,i),[y,p]=b.useState(null),[w,g]=b.useState(null),E=Xe(r,g),O=Qs(i),A=b.useRef(!1),C=b.useRef(!0),{viewport:T,selectedItem:S,selectedItemText:D,focusSelectedItem:z}=v,k=b.useCallback(()=>{if(m.trigger&&m.valueNode&&y&&w&&T&&S&&D){const G=m.trigger.getBoundingClientRect(),ae=w.getBoundingClientRect(),me=m.valueNode.getBoundingClientRect(),ge=D.getBoundingClientRect();if(m.dir!=="rtl"){const Te=ge.left-ae.left,He=me.left-Te,Ze=G.left-He,dt=G.width+Ze,Cn=Math.max(dt,ae.width),pn=window.innerWidth-Sn,Bn=Xf(He,[Sn,Math.max(Sn,pn-Cn)]);y.style.minWidth=dt+"px",y.style.left=Bn+"px"}else{const Te=ae.right-ge.right,He=window.innerWidth-me.right-Te,Ze=window.innerWidth-G.right-He,dt=G.width+Ze,Cn=Math.max(dt,ae.width),pn=window.innerWidth-Sn,Bn=Xf(He,[Sn,Math.max(Sn,pn-Cn)]);y.style.minWidth=dt+"px",y.style.right=Bn+"px"}const U=O(),te=window.innerHeight-Sn*2,fe=T.scrollHeight,he=window.getComputedStyle(w),j=parseInt(he.borderTopWidth,10),Y=parseInt(he.paddingTop,10),F=parseInt(he.borderBottomWidth,10),oe=parseInt(he.paddingBottom,10),P=j+Y+fe+oe+F,R=Math.min(S.offsetHeight*5,P),V=window.getComputedStyle(T),Z=parseInt(V.paddingTop,10),W=parseInt(V.paddingBottom,10),ee=G.top+G.height/2-Sn,ie=te-ee,ye=S.offsetHeight/2,ne=S.offsetTop+ye,re=j+Y+ne,Le=P-re;if(re<=ee){const Te=U.length>0&&S===U[U.length-1].ref.current;y.style.bottom="0px";const He=w.clientHeight-T.offsetTop-T.offsetHeight,Ze=Math.max(ie,ye+(Te?W:0)+He+F),dt=re+Ze;y.style.height=dt+"px"}else{const Te=U.length>0&&S===U[0].ref.current;y.style.top="0px";const Ze=Math.max(ee,j+T.offsetTop+(Te?Z:0)+ye)+Le;y.style.height=Ze+"px",T.scrollTop=re-ee+T.offsetTop}y.style.margin=`${Sn}px 0`,y.style.minHeight=R+"px",y.style.maxHeight=te+"px",u?.(),requestAnimationFrame(()=>A.current=!0)}},[O,m.trigger,m.valueNode,y,w,T,S,D,m.dir,u]);at(()=>k(),[k]);const[I,X]=b.useState();at(()=>{w&&X(window.getComputedStyle(w).zIndex)},[w]);const K=b.useCallback(G=>{G&&C.current===!0&&(k(),z?.(),C.current=!1)},[k,z]);return h.jsx(CC,{scope:i,contentWrapper:y,shouldExpandOnScrollRef:A,onScrollButtonChange:K,children:h.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:h.jsx(Ie.div,{...f,ref:E,style:{boxSizing:"border-box",maxHeight:"100%",...f.style}})})})},"SelectItemAlignedPosition")),tv=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,align:u="start",collisionPadding:f=Sn,...m}=o,v=pd(i);return h.jsx($y,{...v,...m,ref:r,align:u,collisionPadding:f,style:{boxSizing:"border-box",...m.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[CC,gd]=Rl(Ol,{}),nv="SelectViewport",TC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,nonce:u,...f}=o,m=Nl(nv,i),v=gd(nv,i),y=Xe(r,m.onViewportChange),p=b.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),h.jsx(Xs.Slot,{scope:i,children:h.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...f,ref:y,style:{position:"relative",flex:1,overflow:"hidden auto",...f.style},onScroll:De(f.onScroll,w=>{const g=w.currentTarget,{contentWrapper:E,shouldExpandOnScrollRef:O}=v;if(O?.current&&E){const A=Math.abs(p.current-g.scrollTop);if(A>0){const C=window.innerHeight-Sn*2,T=parseFloat(E.style.minHeight),S=parseFloat(E.style.height),D=Math.max(T,S);if(D0?I:0,E.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),AC="SelectGroup",[qA,YA]=Rl(AC),Qf="SelectItem",[_C,Fy]=Rl(Qf),OC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,value:u,disabled:f=!1,textValue:m,...v}=o,y=Ia(Qf,i),p=Nl(Qf,i),w=y.value===u,[g,E]=b.useState(m??""),[O,A]=b.useState(!1),C=kn(k=>p.itemRefCallback?.(k,u,f)),T=Xe(r,C),S=Tl(),D=b.useRef("touch"),z=ze(()=>{f||(y.onValueChange(u),y.onOpenChange(!1))},"handleSelect");return h.jsx(_C,{scope:i,value:u,disabled:f,textId:S,isSelected:w,onItemTextChange:b.useCallback(k=>{E(I=>I||(k?.textContent??"").trim())},[]),children:h.jsx(Xs.ItemSlot,{scope:i,value:u,disabled:f,textValue:g,children:h.jsx(Ie.div,{role:"option","aria-labelledby":S,"data-highlighted":O?"":void 0,"aria-selected":w&&O,"data-state":w?"checked":"unchecked","aria-disabled":f||void 0,"data-disabled":f?"":void 0,tabIndex:f?void 0:-1,...v,ref:T,onFocus:De(v.onFocus,()=>A(!0)),onBlur:De(v.onBlur,()=>A(!1)),onClick:De(v.onClick,()=>{D.current!=="mouse"&&z()}),onPointerUp:De(v.onPointerUp,()=>{D.current==="mouse"&&z()}),onPointerDown:De(v.onPointerDown,k=>{D.current=k.pointerType}),onPointerMove:De(v.onPointerMove,k=>{D.current=k.pointerType,f?p.onItemLeave?.():D.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:De(v.onPointerLeave,k=>{k.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:De(v.onKeyDown,k=>{f||k.target!==k.currentTarget||p.searchRef?.current!==""&&k.key===" "||(lC.includes(k.key)&&z(),k.key===" "&&k.preventDefault())})})})})},"SelectItem")),hs="SelectItemText",RC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,className:u,style:f,...m}=o,v=Ia(hs,i),y=Nl(hs,i),p=Fy(hs,i),w=sC(hs,i),[g,E]=b.useState(null),O=kn(z=>y.itemTextRefCallback?.(z,p.value,p.disabled)),A=Xe(r,E,p.onItemTextChange,O),C=g?.textContent,T=b.useMemo(()=>h.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:S,onNativeOptionRemove:D}=w;return at(()=>(S(T),()=>D(T)),[S,D,T]),h.jsxs(h.Fragment,{children:[h.jsx(Ie.span,{id:p.textId,...m,ref:A}),p.isSelected&&v.valueNode&&!v.valueNodeHasChildren&&!Xi(v.value)?Ro.createPortal(m.children,v.valueNode):null]})},"SelectItemText")),NC="SelectItemIndicator",jC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,...u}=o;return Fy(NC,i).isSelected?h.jsx(Ie.span,{"aria-hidden":!0,...u,ref:r}):null},"SelectItemIndicator")),av="SelectScrollUpButton",DC=b.forwardRef(ze(function(o,r){const i=Nl(av,o.__scopeSelect),u=gd(av,o.__scopeSelect),[f,m]=b.useState(!1),v=Xe(r,u.onScrollButtonChange);return at(()=>{if(i.viewport&&i.isPositioned){let y=function(){const w=p.scrollTop>0;m(w)};ze(y,"handleScroll");const p=i.viewport;return y(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,i.isPositioned]),f?h.jsx(Wy,{...o,ref:v,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=i;y&&p&&(y.scrollTop=y.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),lv="SelectScrollDownButton",zC=b.forwardRef(ze(function(o,r){const i=Nl(lv,o.__scopeSelect),u=gd(lv,o.__scopeSelect),[f,m]=b.useState(!1),v=Xe(r,u.onScrollButtonChange);return at(()=>{if(i.viewport&&i.isPositioned){let y=function(){const w=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",y)}},[i.viewport,i.isPositioned]),f?h.jsx(Wy,{...o,ref:v,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=i;y&&p&&(y.scrollTop=y.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),Wy=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,onAutoScroll:u,...f}=o,m=Nl("SelectScrollButton",i),v=b.useRef(null),y=Qs(i),p=b.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null)},[]);return b.useEffect(()=>()=>p(),[p]),at(()=>{y().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[y]),h.jsx(Ie.div,{"aria-hidden":!0,...f,ref:r,style:{flexShrink:0,...f.style},onPointerDown:De(f.onPointerDown,()=>{v.current===null&&(v.current=window.setInterval(u,50))}),onPointerMove:De(f.onPointerMove,()=>{m.onItemLeave?.(),v.current===null&&(v.current=window.setInterval(u,50))}),onPointerLeave:De(f.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),MC="SelectBubbleInput",UC=b.forwardRef(ze(function({__scopeSelect:o,...r},i){const u=Ia(MC,o),{value:f,onValueChange:m,required:v,disabled:y,name:p,autoComplete:w,form:g}=u,{nativeOptions:E,nativeSelectKey:O}=u,A=b.useRef(null),C=Xe(i,A),T=f??"",S=Py(T),D=Array.from(E).some(z=>(z.props.value??"")==="");return b.useEffect(()=>{const z=A.current;if(!z)return;const k=window.HTMLSelectElement.prototype,X=Object.getOwnPropertyDescriptor(k,"value").set;if(S!==T&&X){const K=new Event("change",{bubbles:!0});X.call(z,T),z.dispatchEvent(K)}},[S,T]),h.jsxs(Ie.select,{"aria-hidden":!0,required:v,tabIndex:-1,name:p,autoComplete:w,disabled:y,form:g,onChange:z=>m(z.target.value),...r,style:{...Bv,...r.style},ref:C,defaultValue:T,children:[Xi(f)&&!D?h.jsx("option",{value:""}):null,Array.from(E)]},O)},"SelectBubbleInput"));function e0(l){return typeof l=="function"}ze(e0,"isFunction");function Xi(l){return l===""||l===void 0}ze(Xi,"shouldShowPlaceholder");function vd(l){const o=kn(l),r=b.useRef(""),i=b.useRef(0),u=b.useCallback(m=>{const v=r.current+m;o(v),ze((function y(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>y(""),1e3))}),"updateSearch")(v)},[o]),f=b.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,u,f]}ze(vd,"useTypeaheadSearch");function yd(l,o,r){const u=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,f=r?l.indexOf(r):-1;let m=t0(l,Math.max(f,0));u.length===1&&(m=m.filter(p=>p!==r));const y=m.find(p=>p.textValue.toLowerCase().startsWith(u.toLowerCase()));return y!==r?y:void 0}ze(yd,"findNextItem");function t0(l,o){return l.map((r,i)=>l[(o+i)%l.length])}ze(t0,"wrapArray");var kC=Object.defineProperty,ft=(l,o)=>kC(l,"name",{value:o,configurable:!0}),[bd,VA]=Pa("Tooltip",[Vs]),Zs=Vs(),LC="TooltipProvider",HC=700,Zf="tooltip.open",[BC,xd]=bd(LC),qC=ft(l=>{const{__scopeTooltip:o,delayDuration:r=HC,skipDelayDuration:i=300,disableHoverableContent:u=!1,children:f}=l,m=b.useRef(!0),v=b.useRef(!1),y=b.useRef(0);return b.useEffect(()=>{const p=y.current;return()=>window.clearTimeout(p)},[]),h.jsx(BC,{scope:o,isOpenDelayedRef:m,delayDuration:r,onOpen:b.useCallback(()=>{i<=0||(window.clearTimeout(y.current),m.current=!1)},[i]),onClose:b.useCallback(()=>{i<=0||(window.clearTimeout(y.current),y.current=window.setTimeout(()=>m.current=!0,i))},[i]),isPointerInTransitRef:v,onPointerInTransitChange:b.useCallback(p=>{v.current=p},[]),disableHoverableContent:u,children:f})},"TooltipProvider"),Kf="Tooltip",[YC,Qi]=bd(Kf),VC=ft(l=>{const{__scopeTooltip:o,children:r,open:i,defaultOpen:u,onOpenChange:f,disableHoverableContent:m,delayDuration:v}=l,y=xd(Kf,l.__scopeTooltip),p=Zs(o),[w,g]=b.useState(null),[E,O]=b.useState(void 0),A=Tl(),C=b.useRef(0),T=m??y.disableHoverableContent,S=v??y.delayDuration,D=b.useRef(!1),[z,k]=ki({prop:i,defaultProp:u??!1,onChange:ft(me=>{me?(y.onOpen(),document.dispatchEvent(new CustomEvent(Zf))):y.onClose(),f?.(me)},"onChange"),caller:Kf}),I=b.useMemo(()=>z?D.current?"delayed-open":"instant-open":"closed",[z]),X=b.useCallback(()=>{window.clearTimeout(C.current),C.current=0,D.current=!1,k(!0)},[k]),K=b.useCallback(()=>{window.clearTimeout(C.current),C.current=0,k(!1)},[k]),G=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{D.current=!0,k(!0),C.current=0},S)},[S,k]);b.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]);const ae=E??A;return h.jsx(Zy,{...p,children:h.jsx(YC,{scope:o,contentId:ae,setContentId:O,open:z,stateAttribute:I,trigger:w,onTriggerChange:g,onTriggerEnter:b.useCallback(()=>{y.isOpenDelayedRef.current?G():X()},[y.isOpenDelayedRef,G,X]),onTriggerLeave:b.useCallback(()=>{T?K():(window.clearTimeout(C.current),C.current=0)},[K,T]),onOpen:X,onClose:K,disableHoverableContent:T,children:r})})},"Tooltip"),ov="TooltipTrigger",GC=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,...u}=o,f=Qi(ov,i),m=xd(ov,i),v=Zs(i),y=b.useRef(null),p=Xe(r,y,f.onTriggerChange),w=b.useRef(!1),g=b.useRef(!1),E=b.useCallback(()=>w.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",E),[E]),h.jsx(Ky,{asChild:!0,...v,children:h.jsx(Ie.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...u,ref:p,onPointerMove:De(o.onPointerMove,O=>{O.pointerType!=="touch"&&!g.current&&!m.isPointerInTransitRef.current&&(f.onTriggerEnter(),g.current=!0)}),onPointerLeave:De(o.onPointerLeave,()=>{f.onTriggerLeave(),g.current=!1}),onPointerDown:De(o.onPointerDown,()=>{f.open&&f.onClose(),w.current=!0,document.addEventListener("pointerup",E,{once:!0})}),onFocus:De(o.onFocus,()=>{w.current||f.onOpen()}),onBlur:De(o.onBlur,f.onClose),onClick:De(o.onClick,f.onClose)})})},"TooltipTrigger")),n0="TooltipPortal",[XC,QC]=bd(n0,{forceMount:void 0}),ZC=ft(l=>{const{__scopeTooltip:o,forceMount:r,children:i,container:u}=l,f=Qi(n0,o);return h.jsx(XC,{scope:o,forceMount:r,children:h.jsx(jo,{present:r||f.open,children:h.jsx(od,{asChild:!0,container:u,children:i})})})},"TooltipPortal"),qi="TooltipContent",KC=b.forwardRef(ft(function(o,r){const i=QC(qi,o.__scopeTooltip),{forceMount:u=i.forceMount,side:f="top",...m}=o,v=Qi(qi,o.__scopeTooltip);return h.jsx(jo,{present:u||v.open,children:v.disableHoverableContent?h.jsx(a0,{side:f,...m,ref:r}):h.jsx($C,{side:f,...m,ref:r})})},"TooltipContent")),$C=b.forwardRef(ft(function(o,r){const i=Qi(qi,o.__scopeTooltip),u=xd(qi,o.__scopeTooltip),f=b.useRef(null),m=Xe(r,f),[v,y]=b.useState(null),{trigger:p,onClose:w}=i,g=f.current,{onPointerInTransitChange:E}=u,O=b.useCallback(()=>{y(null),E(!1)},[E]),A=b.useCallback((C,T)=>{const S=C.currentTarget,D={x:C.clientX,y:C.clientY},z=l0(D,S.getBoundingClientRect()),k=o0(D,z),I=i0(T.getBoundingClientRect()),X=s0([...k,...I]);y(X),E(!0)},[E]);return b.useEffect(()=>()=>O(),[O]),b.useEffect(()=>{if(p&&g){const C=ft(S=>A(S,g),"handleTriggerLeave"),T=ft(S=>A(S,p),"handleContentLeave");return p.addEventListener("pointerleave",C),g.addEventListener("pointerleave",T),()=>{p.removeEventListener("pointerleave",C),g.removeEventListener("pointerleave",T)}}},[p,g,A,O]),b.useEffect(()=>{if(v){const C=ft(T=>{const S=T.target,D={x:T.clientX,y:T.clientY},z=p?.contains(S)||g?.contains(S),k=!r0(D,v);z?O():k&&(O(),w())},"handleTrackPointerGrace");return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,g,v,w,O]),h.jsx(a0,{...o,ref:m})},"TooltipContentHoverable")),PC=zv("TooltipContent"),a0=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,children:u,"aria-label":f,id:m,onEscapeKeyDown:v,onPointerDownOutside:y,...p}=o,w=Qi(qi,i),g=Zs(i),{onClose:E}=w;b.useEffect(()=>(document.addEventListener(Zf,E),()=>document.removeEventListener(Zf,E)),[E]),b.useEffect(()=>{if(w.trigger){const A=ft(C=>{C.target instanceof Node&&C.target.contains(w.trigger)&&E()},"handleScroll");return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[w.trigger,E]);const{setContentId:O}=w;return at(()=>(O(m),()=>{O(void 0)}),[m,O]),h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:v,onPointerDownOutside:y,onFocusOutside:A=>A.preventDefault(),onDismiss:E,children:h.jsxs($y,{"data-state":w.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:w.contentId,...g,...p,ref:r,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(PC,{children:u}),f?h.jsx(bS,{id:w.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl")),JC=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,...u}=o,f=Zs(i);return h.jsx(KE,{...f,...u,ref:r})},"TooltipArrow"));function l0(l,o){const r=Math.abs(o.top-l.y),i=Math.abs(o.bottom-l.y),u=Math.abs(o.right-l.x),f=Math.abs(o.left-l.x);switch(Math.min(r,i,u,f)){case f:return"left";case u:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}ft(l0,"getExitSideFromRect");function o0(l,o,r=5){const i=[];switch(o){case"top":i.push({x:l.x-r,y:l.y+r},{x:l.x+r,y:l.y+r});break;case"bottom":i.push({x:l.x-r,y:l.y-r},{x:l.x+r,y:l.y-r});break;case"left":i.push({x:l.x+r,y:l.y-r},{x:l.x+r,y:l.y+r});break;case"right":i.push({x:l.x-r,y:l.y-r},{x:l.x-r,y:l.y+r});break}return i}ft(o0,"getPaddedExitPoints");function i0(l){const{top:o,right:r,bottom:i,left:u}=l;return[{x:u,y:o},{x:r,y:o},{x:r,y:i},{x:u,y:i}]}ft(i0,"getPointsFromRect");function r0(l,o){const{x:r,y:i}=l;let u=!1;for(let f=0,m=o.length-1;fi!=E>i&&r<(g-p)*(i-w)/(E-w)+p&&(u=!u)}return u}ft(r0,"isPointInPolygon");function s0(l){const o=l.slice();return o.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),c0(o)}ft(s0,"getHull");function c0(l){if(l.length<=1)return l.slice();const o=[];for(let i=0;i=2;){const f=o[o.length-1],m=o[o.length-2];if((f.x-m.x)*(u.y-m.y)>=(f.y-m.y)*(u.x-m.x))o.pop();else break}o.push(u)}o.pop();const r=[];for(let i=l.length-1;i>=0;i--){const u=l[i];for(;r.length>=2;){const f=r[r.length-1],m=r[r.length-2];if((f.x-m.x)*(u.y-m.y)>=(f.y-m.y)*(u.x-m.x))r.pop();else break}r.push(u)}return r.pop(),o.length===1&&r.length===1&&o[0].x===r[0].x&&o[0].y===r[0].y?o:o.concat(r)}ft(c0,"getHullPresorted");var IC=qC,FC=VC,WC=GC,eT=ZC,tT=KC,nT=JC;const aT=(l,o)=>{const r=new Array(l.length+o.length);for(let i=0;i({classGroupId:l,validator:o}),u0=(l=new Map,o=null,r)=>({nextPart:l,validators:o,classGroupId:r}),Ds="-",iv=[],oT="arbitrary..",iT=l=>{const o=sT(l),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=l;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return rT(m);const v=m.split(Ds),y=v[0]===""&&v.length>1?1:0;return f0(v,y,o)},getConflictingClassGroupIds:(m,v)=>{if(v){const y=i[m],p=r[m];return y?p?aT(p,y):y:p||iv}return r[m]||iv}}},f0=(l,o,r)=>{if(l.length-o===0)return r.classGroupId;const u=l[o],f=r.nextPart.get(u);if(f){const p=f0(l,o+1,f);if(p)return p}const m=r.validators;if(m===null)return;const v=o===0?l.join(Ds):l.slice(o).join(Ds),y=m.length;for(let p=0;pl.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=l.slice(1,-1),r=o.indexOf(":"),i=o.slice(0,r);return i?oT+i:void 0})(),sT=l=>{const{theme:o,classGroups:r}=l;return cT(r,o)},cT=(l,o)=>{const r=u0();for(const i in l){const u=l[i];Sd(u,r,i,o)}return r},Sd=(l,o,r,i)=>{const u=l.length;for(let f=0;f{if(typeof l=="string"){fT(l,o,r);return}if(typeof l=="function"){dT(l,o,r,i);return}mT(l,o,r,i)},fT=(l,o,r)=>{const i=l===""?o:d0(o,l);i.classGroupId=r},dT=(l,o,r,i)=>{if(hT(l)){Sd(l(i),o,r,i);return}o.validators===null&&(o.validators=[]),o.validators.push(lT(r,l))},mT=(l,o,r,i)=>{const u=Object.entries(l),f=u.length;for(let m=0;m{let r=l;const i=o.split(Ds),u=i.length;for(let f=0;f"isThemeGetter"in l&&l.isThemeGetter===!0,pT=l=>{if(l<1)return{get:()=>{},set:()=>{}};let o=0,r=Object.create(null),i=Object.create(null);const u=(f,m)=>{r[f]=m,o++,o>l&&(o=0,i=r,r=Object.create(null))};return{get(f){let m=r[f];if(m!==void 0)return m;if((m=i[f])!==void 0)return u(f,m),m},set(f,m){f in r?r[f]=m:u(f,m)}}},$f="!",rv=":",gT=[],sv=(l,o,r,i,u)=>({modifiers:l,hasImportantModifier:o,baseClassName:r,maybePostfixModifierPosition:i,isExternal:u}),vT=l=>{const{prefix:o,experimentalParseClassName:r}=l;let i=u=>{const f=[];let m=0,v=0,y=0,p;const w=u.length;for(let C=0;Cy?p-y:void 0;return sv(f,O,E,A)};if(o){const u=o+rv,f=i;i=m=>m.startsWith(u)?f(m.slice(u.length)):sv(gT,!1,m,void 0,!0)}if(r){const u=i;i=f=>r({className:f,parseClassName:u})}return i},yT=l=>{const o=new Map;return l.orderSensitiveModifiers.forEach((r,i)=>{o.set(r,1e6+i)}),r=>{const i=[];let u=[];for(let f=0;f0&&(u.sort(),i.push(...u),u=[]),i.push(m)):u.push(m)}return u.length>0&&(u.sort(),i.push(...u)),i}},bT=l=>({cache:pT(l.cacheSize),parseClassName:vT(l),sortModifiers:yT(l),postfixLookupClassGroupIds:xT(l),...iT(l)}),xT=l=>{const o=Object.create(null),r=l.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:u,sortModifiers:f,postfixLookupClassGroupIds:m}=o,v=[],y=l.trim().split(ST);let p="";for(let w=y.length-1;w>=0;w-=1){const g=y[w],{isExternal:E,modifiers:O,hasImportantModifier:A,baseClassName:C,maybePostfixModifierPosition:T}=r(g);if(E){p=g+(p.length>0?" "+p:p);continue}let S=!!T,D;if(S){const K=C.substring(0,T);D=i(K);const G=D&&m[D]?i(C):void 0;G&&G!==D&&(D=G,S=!1)}else D=i(C);if(!D){if(!S){p=g+(p.length>0?" "+p:p);continue}if(D=i(C),!D){p=g+(p.length>0?" "+p:p);continue}S=!1}const z=O.length===0?"":O.length===1?O[0]:f(O).join(":"),k=A?z+$f:z,I=k+D;if(v.indexOf(I)>-1)continue;v.push(I);const X=u(D,S);for(let K=0;K0?" "+p:p)}return p},ET=(...l)=>{let o=0,r,i,u="";for(;o{if(typeof l=="string")return l;let o,r="";for(let i=0;i{let r,i,u,f;const m=y=>{const p=o.reduce((w,g)=>g(w),l());return r=bT(p),i=r.cache.get,u=r.cache.set,f=v,v(y)},v=y=>{const p=i(y);if(p)return p;const w=wT(y,r);return u(y,w),w};return f=m,(...y)=>f(ET(...y))},TT=[],ut=l=>{const o=r=>r[l]||TT;return o.isThemeGetter=!0,o},h0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,p0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,AT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_T=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,RT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,NT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=l=>AT.test(l),Ae=l=>!!l&&!Number.isNaN(Number(l)),Dn=l=>!!l&&Number.isInteger(Number(l)),Cf=l=>l.endsWith("%")&&Ae(l.slice(0,-1)),oa=l=>_T.test(l),g0=()=>!0,DT=l=>OT.test(l)&&!RT.test(l),wd=()=>!1,zT=l=>NT.test(l),MT=l=>jT.test(l),UT=l=>!se(l)&&!ce(l),kT=l=>l.startsWith("@container")&&(l[10]==="/"&&l[11]!==void 0||l[11]==="s"&&l[16]!==void 0&&l.startsWith("-size/",10)||l[11]==="n"&&l[18]!==void 0&&l.startsWith("-normal/",10)),LT=l=>Fa(l,b0,wd),se=l=>h0.test(l),El=l=>Fa(l,x0,DT),cv=l=>Fa(l,QT,Ae),HT=l=>Fa(l,w0,g0),BT=l=>Fa(l,S0,wd),uv=l=>Fa(l,v0,wd),qT=l=>Fa(l,y0,MT),ps=l=>Fa(l,E0,zT),ce=l=>p0.test(l),Ni=l=>jl(l,x0),YT=l=>jl(l,S0),fv=l=>jl(l,v0),VT=l=>jl(l,b0),GT=l=>jl(l,y0),gs=l=>jl(l,E0,!0),XT=l=>jl(l,w0,!0),Fa=(l,o,r)=>{const i=h0.exec(l);return i?i[1]?o(i[1]):r(i[2]):!1},jl=(l,o,r=!1)=>{const i=p0.exec(l);return i?i[1]?o(i[1]):r:!1},v0=l=>l==="position"||l==="percentage",y0=l=>l==="image"||l==="url",b0=l=>l==="length"||l==="size"||l==="bg-size",x0=l=>l==="length",QT=l=>l==="number",S0=l=>l==="family-name",w0=l=>l==="number"||l==="weight",E0=l=>l==="shadow",ZT=()=>{const l=ut("color"),o=ut("font"),r=ut("text"),i=ut("font-weight"),u=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),v=ut("container"),y=ut("spacing"),p=ut("radius"),w=ut("shadow"),g=ut("inset-shadow"),E=ut("text-shadow"),O=ut("drop-shadow"),A=ut("blur"),C=ut("perspective"),T=ut("aspect"),S=ut("ease"),D=ut("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...k(),ce,se],X=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],G=()=>[ce,se,y],ae=()=>[Ga,"full","auto",...G()],me=()=>[Dn,"none","subgrid",ce,se],ge=()=>["auto",{span:["full",Dn,ce,se]},Dn,ce,se],U=()=>[Dn,"auto",ce,se],te=()=>["auto","min","max","fr",ce,se],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...G()],Y=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],F=()=>[Ga,"screen","full","dvw","lvw","svw","min","max","fit",...G()],oe=()=>[Ga,"screen","full","lh","dvh","lvh","svh","min","max","fit",...G()],P=()=>[l,ce,se],R=()=>[...k(),fv,uv,{position:[ce,se]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",VT,LT,{size:[ce,se]}],W=()=>[Cf,Ni,El],ee=()=>["","none","full",p,ce,se],ie=()=>["",Ae,Ni,El],ye=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ae,Cf,fv,uv],Le=()=>["","none",A,ce,se],Ce=()=>["none",Ae,ce,se],Te=()=>["none",Ae,ce,se],He=()=>[Ae,ce,se],Ze=()=>[Ga,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oa],breakpoint:[oa],color:[g0],container:[oa],"drop-shadow":[oa],ease:["in","out","in-out"],font:[UT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oa],shadow:[oa],spacing:["px",Ae],text:[oa],"text-shadow":[oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,se,ce,T]}],container:["container"],"container-type":[{"@container":["","normal","size",ce,se]}],"container-named":[kT],columns:[{columns:[Ae,se,ce,v]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",ce,se]}],basis:[{basis:[Ga,"full","auto",v,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,Ga,"auto","initial","none",se]}],grow:[{grow:["",Ae,ce,se]}],shrink:[{shrink:["",Ae,ce,se]}],order:[{order:[Dn,"first","last","none",ce,se]}],"grid-cols":[{"grid-cols":me()}],"col-start-end":[{col:ge()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":me()}],"row-start-end":[{row:ge()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pbs:[{pbs:G()}],pbe:[{pbe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...oe()]}],"min-block-size":[{"min-block":["auto",...oe()]}],"max-block-size":[{"max-block":["none",...oe()]}],w:[{w:[v,"screen",...Y()]}],"min-w":[{"min-w":[v,"screen","none",...Y()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[m]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",r,Ni,El]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,XT,HT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cf,se]}],"font-family":[{font:[YT,BT,o]}],"font-features":[{"font-features":[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,ce,se]}],"line-clamp":[{"line-clamp":[Ae,"none",ce,cv]}],leading:[{leading:[f,...G()]}],"list-image":[{"list-image":["none",ce,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",ce,El]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ae,"auto",ce,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"tab-size":[{tab:[Dn,ce,se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,ce,se],radial:["",ce,se],conic:[Dn,ce,se]},GT,qT]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,ce,se]}],"outline-w":[{outline:["",Ae,Ni,El]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",w,gs,ps]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",g,gs,ps]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ae,El]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",E,gs,ps]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ae,ce,se]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ce,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,se]}],filter:[{filter:["","none",ce,se]}],blur:[{blur:Le()}],brightness:[{brightness:[Ae,ce,se]}],contrast:[{contrast:[Ae,ce,se]}],"drop-shadow":[{"drop-shadow":["","none",O,gs,ps]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Ae,ce,se]}],"hue-rotate":[{"hue-rotate":[Ae,ce,se]}],invert:[{invert:["",Ae,ce,se]}],saturate:[{saturate:[Ae,ce,se]}],sepia:[{sepia:["",Ae,ce,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,se]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,ce,se]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,ce,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,ce,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,ce,se]}],"backdrop-invert":[{"backdrop-invert":["",Ae,ce,se]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,ce,se]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,ce,se]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,ce,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",ce,se]}],ease:[{ease:["linear","initial",S,ce,se]}],delay:[{delay:[Ae,ce,se]}],animate:[{animate:["none",D,ce,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ce,se]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[ce,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ze()}],"translate-x":[{"translate-x":Ze()}],"translate-y":[{"translate-y":Ze()}],"translate-z":[{"translate-z":Ze()}],"translate-none":["translate-none"],zoom:[{zoom:[Dn,ce,se]}],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mbs":[{"scroll-mbs":G()}],"scroll-mbe":[{"scroll-mbe":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pbs":[{"scroll-pbs":G()}],"scroll-pbe":[{"scroll-pbe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,se]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Ae,Ni,El,cv]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},KT=CT(ZT);function Se(...l){return KT(Rv(l))}const $T=Vi("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Cl({className:l,variant:o="default",asChild:r=!1,...i}){const u=r?jv:"span";return h.jsx(u,{"data-slot":"badge","data-variant":o,className:Se($T({variant:o}),l),...i})}const PT=Vi("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ct({className:l,variant:o="default",size:r="default",asChild:i=!1,...u}){const f=i?jv:"button";return h.jsx(f,{"data-slot":"button","data-variant":o,"data-size":r,className:Se(PT({variant:o,size:r,className:l})),...u})}function Ui({className:l,type:o,...r}){return h.jsx("input",{type:o,"data-slot":"input",className:Se("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",l),...r})}function JT({className:l,...o}){return h.jsx("div",{"data-slot":"table-container",tabIndex:0,role:"region","aria-label":"Feedback queue, scrollable",className:"relative w-full overflow-x-auto focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ring)]",children:h.jsx("table",{"data-slot":"table",className:Se("w-full caption-bottom text-sm",l),...o})})}function IT({className:l,...o}){return h.jsx("thead",{"data-slot":"table-header",className:Se("[&_tr]:border-b",l),...o})}function FT({className:l,...o}){return h.jsx("tbody",{"data-slot":"table-body",className:Se("[&_tr:last-child]:border-0",l),...o})}function vs({className:l,...o}){return h.jsx("tr",{"data-slot":"table-row",className:Se("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",l),...o})}function Xa({className:l,...o}){return h.jsx("th",{"data-slot":"table-head",className:Se("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...o})}function zn({className:l,...o}){return h.jsx("td",{"data-slot":"table-cell",className:Se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...o})}function WT({className:l,...o}){return h.jsx("caption",{"data-slot":"table-caption",className:Se("mt-4 text-sm text-muted-foreground",l),...o})}const eA=Vi("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Pf({className:l,variant:o,...r}){return h.jsx("div",{"data-slot":"alert",role:"alert",className:Se(eA({variant:o}),l),...r})}function Jf({className:l,...o}){return h.jsx("div",{"data-slot":"alert-title",className:Se("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",l),...o})}function If({className:l,...o}){return h.jsx("div",{"data-slot":"alert-description",className:Se("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",l),...o})}function dv({className:l,...o}){return h.jsx("div",{"data-slot":"empty",className:Se("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",l),...o})}function mv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-header",className:Se("flex max-w-sm flex-col items-center gap-2 text-center",l),...o})}function hv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-title",className:Se("text-lg font-medium tracking-tight",l),...o})}function pv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-description",className:Se("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",l),...o})}function To({className:l,...o}){return h.jsx("div",{"data-slot":"skeleton",className:Se("animate-pulse rounded-md bg-accent",l),...o})}function tA({delayDuration:l=0,...o}){return h.jsx(IC,{"data-slot":"tooltip-provider",delayDuration:l,...o})}function gv({...l}){return h.jsx(FC,{"data-slot":"tooltip",...l})}function vv({...l}){return h.jsx(WC,{"data-slot":"tooltip-trigger",...l})}function yv({className:l,sideOffset:o=0,children:r,...i}){return h.jsx(eT,{children:h.jsxs(tT,{"data-slot":"tooltip-content",sideOffset:o,className:Se("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",l),...i,children:[r,h.jsx(nT,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const ys=1e3;function Ff(l){const o=new Date(l).getTime();if(Number.isNaN(o))return"—";const r=Math.max(0,Math.round((Date.now()-o)/6e4));if(r<1)return"just now";if(r<60)return`${r}m`;const i=Math.round(r/60);if(i<24)return`${i}h`;const u=Math.round(i/24);return u<30?`${u}d`:`${Math.round(u/30)}mo`}function nA(){const l=new URLSearchParams(window.location.search),o=r=>l.get(r)??void 0;return{project:o("project"),status:o("status"),type:o("type"),severity:o("severity"),assignee_agent:o("assignee_agent")}}function aA(){return new URLSearchParams(window.location.search).get("q")??""}let bv;function lA(l,o){clearTimeout(bv),bv=setTimeout(()=>{try{oA(l,o)}catch{}},150)}function oA(l,o){const r=new URLSearchParams;for(const[u,f]of Object.entries(l))f&&r.set(u,f);o.trim()&&r.set("q",o.trim());const i=r.toString();window.history.replaceState({},"",i?`/queue?${i}`:"/queue")}function iA(){const[l,o]=b.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches);return b.useEffect(()=>{const r=window.matchMedia("(min-width: 1024px)"),i=()=>o(r.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),l}function rA({navigate:l,themeToggle:o}){const[r,i]=b.useState(nA),[u,f]=b.useState([]),[m,v]=b.useState(aA),[y,p]=b.useState(!0),[w,g]=b.useState(null);b.useEffect(()=>{p(!0),Qa.list({project:r.project},ys).then(S=>{f(S.items),g(null)}).catch(S=>g(S.message)).finally(()=>p(!1))},[r.project]),b.useEffect(()=>lA(r,m),[r,m]),b.useEffect(()=>{const D=setInterval(()=>{document.hidden||Qa.list({project:r.project},ys).then(z=>f(z.items)).catch(()=>{})},1e4);return()=>clearInterval(D)},[r.project]);const E=b.useMemo(()=>{const S=new Map;for(const D of u)S.set(D.status,(S.get(D.status)??0)+1);return S},[u]),O=b.useMemo(()=>{const S=m.trim().toLowerCase();return u.filter(D=>(!r.status||D.status===r.status)&&(!r.type||D.type===r.type)&&(!r.severity||D.severity===r.severity)&&(!r.assignee_agent||D.assignee_agent===r.assignee_agent)&&(!S||D.title.toLowerCase().includes(S)||D.body.toLowerCase().includes(S)||D.id.toLowerCase().includes(S)))},[u,r,m]),A=(S,D)=>i(z=>({...z,[S]:z[S]===D?void 0:D})),C=Object.entries(r).filter(([,S])=>S),T=iA();return h.jsxs(h.Fragment,{children:[h.jsxs("header",{className:"flex min-w-0 flex-wrap items-baseline gap-3",children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:h.jsxs("span",{className:"break-all",children:["Loopback queue",r.project?` — ${r.project}`:""]})}),h.jsx("span",{className:"text-sm text-muted-foreground",role:"status","aria-live":"polite",children:y?"Loading feedback…":`${O.length}${O.length!==u.length?` of ${u.length}`:""} item${O.length===1?"":"s"}${u.length===ys?` (first ${ys})`:""}`}),h.jsxs("div",{className:"ml-auto flex w-full min-w-0 flex-1 basis-full items-center justify-end gap-2 sm:w-auto sm:min-w-56 sm:basis-auto",children:[h.jsx(Ui,{value:m,onChange:S=>v(S.target.value),placeholder:"Search title, body, id…","aria-label":"Search feedback",className:"h-11 w-full min-w-0 sm:w-56"}),o]})]}),h.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Something wrong or clumsy on ",h.jsx("em",{children:"this"})," page? Pin it — feedback about Loopback files to the ",h.jsx("code",{className:"font-mono text-xs",children:"loopback"})," ","project, the same loop everything else uses."]}),h.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[_v.filter(S=>E.get(S)).map(S=>h.jsxs(gv,{children:[h.jsx(vv,{asChild:!0,children:h.jsx("button",{onClick:()=>A("status",S),"aria-pressed":r.status===S,"aria-label":`${E.get(S)} ${S}. ${r.status===S?"Clear this filter":`Show only ${S} items`}`,className:"inline-flex h-11 items-center rounded-md px-1",children:h.jsxs(Cl,{className:`${Es[S]} pointer-events-none transition ${r.status===S?"ring-2 ring-ring ring-offset-1 ring-offset-background":"hover:opacity-85"}`,children:[E.get(S)," ",S]})})}),h.jsx(yv,{children:r.status===S?"Clear this filter":`Show only ${S}`})]},S)),C.length>0&&h.jsxs("div",{className:"ml-1 flex flex-wrap items-center gap-1.5 text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"·"}),C.map(([S,D])=>h.jsxs(gv,{children:[h.jsx(vv,{asChild:!0,children:h.jsx("button",{onClick:()=>i(z=>({...z,[S]:void 0})),"aria-label":`${S.replace("_agent","")}: ${D} — remove this filter`,className:"inline-flex h-11 min-w-0 max-w-full items-center rounded-md px-1",children:h.jsxs(Cl,{variant:"outline",className:"pointer-events-none min-w-0 max-w-full gap-1 whitespace-normal",children:[h.jsxs("span",{className:"min-w-0 break-all",children:[S.replace("_agent",""),": ",h.jsx("strong",{children:D})]}),h.jsx(O1,{className:"size-3 shrink-0"})]})})}),h.jsx(yv,{children:"Remove this filter"})]},S)),h.jsx("button",{onClick:()=>{i({}),v("")},"aria-label":"Clear all filters and search",className:"inline-flex h-11 items-center rounded-md px-1",children:h.jsx(Cl,{variant:"outline",className:"pointer-events-none",children:"clear all"})})]})]}),w&&h.jsxs(Pf,{variant:"destructive",className:"mt-6",children:[h.jsx(Jf,{children:"Could not reach the hub"}),h.jsx(If,{children:w})]}),!T&&h.jsxs("div",{className:"mt-4 grid gap-2",children:[y&&Array.from({length:4},(S,D)=>h.jsx(To,{className:"h-24 w-full rounded-lg"},`msk-${D}`)),!y&&O.map(S=>h.jsxs("button",{onClick:()=>l(`/queue/${encodeURIComponent(S.id)}`),className:"grid min-w-0 gap-1.5 rounded-lg border p-3 text-left hover:bg-muted/50 [&>*]:min-w-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Cl,{className:Es[S.status],children:S.status}),h.jsx("span",{className:`font-mono text-xs ${Of[S.severity]} ${Rf[S.severity]}`,children:S.severity}),h.jsx("span",{className:"text-xs text-muted-foreground",children:S.type}),(S.attachments?.length??0)>0&&h.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(Af,{className:"size-3","aria-hidden":!0}),h.jsx("span",{className:"sr-only",children:"Attachments:"}),S.attachments?.length]})]}),h.jsx("div",{className:"font-medium break-all",children:S.title}),h.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground",children:[h.jsx("span",{className:"break-all",children:S.project}),h.jsx("span",{"aria-hidden":!0,children:"·"}),h.jsx("span",{children:Ff(S.created_at)}),S.assignee_agent&&h.jsxs(h.Fragment,{children:[h.jsx("span",{"aria-hidden":!0,children:"·"}),h.jsx("span",{className:"break-all",children:S.assignee_agent})]})]})]},S.id)),!y&&O.length===0&&h.jsx(dv,{className:"border",children:h.jsxs(mv,{children:[h.jsx(hv,{children:C.length>0||m?"Nothing matches":"The queue is empty"}),h.jsx(pv,{children:C.length>0||m?"No item matches the current filters.":"Pin something with the widget and it lands here."})]})})]}),T&&h.jsx("div",{className:"mt-4 rounded-lg border",children:h.jsxs(JT,{children:[h.jsx(WT,{className:"mt-3 text-xs",children:"Click a row to open it. Filters live in the URL — this view is linkable."}),h.jsx(IT,{children:h.jsxs(vs,{children:[h.jsx(Xa,{children:"id"}),h.jsx(Xa,{children:"project"}),h.jsx(Xa,{children:"sev / type"}),h.jsx(Xa,{children:"title"}),h.jsx(Xa,{children:"age"}),h.jsx(Xa,{children:"status"}),h.jsx(Xa,{children:"assignee"}),h.jsx(Xa,{children:"change"})]})}),h.jsxs(FT,{children:[y&&Array.from({length:5},(S,D)=>h.jsx(vs,{children:h.jsx(zn,{colSpan:8,children:h.jsx(To,{className:"h-5 w-full"})})},`sk-${D}`)),!y&&O.length===0&&h.jsx(vs,{children:h.jsx(zn,{colSpan:8,children:h.jsxs(dv,{className:"border-0 bg-transparent",children:[h.jsxs(mv,{children:[h.jsx(hv,{children:C.length>0||m?"Nothing matches":"The queue is empty"}),h.jsx(pv,{children:C.length>0||m?"No item matches the current filters.":"Pin something with the widget and it lands here."})]}),(C.length>0||m)&&h.jsx(Ct,{variant:"outline",size:"sm",onClick:()=>{i({}),v("")},children:"Clear filters"})]})})}),O.map(S=>h.jsxs(vs,{className:"cursor-pointer",onClick:()=>l(`/queue/${encodeURIComponent(S.id)}`),children:[h.jsx(zn,{children:h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 font-mono text-xs",onClick:D=>{D.stopPropagation(),l(`/queue/${encodeURIComponent(S.id)}`)},children:S.id})}),h.jsx(zn,{children:h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 text-sm","aria-pressed":r.project===S.project,"aria-label":`Filter by project ${S.project}`,onClick:D=>{D.stopPropagation(),A("project",S.project)},children:S.project})}),h.jsxs(zn,{className:"whitespace-nowrap",children:[h.jsx(Ct,{variant:"link",className:`h-auto min-h-6 min-w-6 p-0 font-mono text-xs ${Of[S.severity]} ${Rf[S.severity]}`,"aria-pressed":r.severity===S.severity,"aria-label":`Filter by severity ${S.severity}`,onClick:D=>{D.stopPropagation(),A("severity",S.severity)},children:S.severity})," ",h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 text-xs text-muted-foreground","aria-pressed":r.type===S.type,"aria-label":`Filter by type ${S.type}`,onClick:D=>{D.stopPropagation(),A("type",S.type)},children:S.type})]}),h.jsxs(zn,{className:"min-w-[16rem] font-medium break-all whitespace-normal",children:[S.title,(S.attachments?.length??0)>0&&h.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(Af,{className:"size-3","aria-hidden":!0}),h.jsx("span",{className:"sr-only",children:"Attachments:"}),S.attachments?.length]})]}),h.jsx(zn,{className:"whitespace-nowrap text-sm text-muted-foreground",children:h.jsx("time",{dateTime:S.created_at,children:Ff(S.created_at)})}),h.jsx(zn,{children:h.jsx(Cl,{asChild:!0,className:`${Es[S.status]} min-h-6 cursor-pointer`,children:h.jsx("button",{"aria-pressed":r.status===S.status,"aria-label":`Filter by status ${S.status}`,onClick:D=>{D.stopPropagation(),A("status",S.status)},children:S.status})})}),h.jsx(zn,{className:"text-sm",children:S.assignee_agent??h.jsx("span",{className:"text-muted-foreground",children:"—"})}),h.jsx(zn,{className:"text-sm",children:Za(S.links.pr_url)?h.jsx("a",{href:Za(S.links.pr_url)??void 0,onClick:D=>D.stopPropagation(),target:"_blank",rel:"noreferrer noopener",className:"inline-flex min-h-6 min-w-6 items-center justify-center underline",children:"PR"}):S.links.commit?h.jsx("code",{className:"font-mono text-xs",children:S.links.commit.slice(0,9)}):h.jsx("span",{className:"text-muted-foreground",children:"—"})})]},S.id))]})]})})]})}function ji({className:l,...o}){return h.jsx("div",{"data-slot":"card",className:Se("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",l),...o})}function xv({className:l,...o}){return h.jsx("textarea",{"data-slot":"textarea",className:Se("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",l),...o})}function bs({...l}){return h.jsx(cC,{"data-slot":"select",...l})}function xs({...l}){return h.jsx(mC,{"data-slot":"select-value",...l})}function Ss({className:l,size:o="default",children:r,...i}){return h.jsxs(fC,{"data-slot":"select-trigger","data-size":o,className:Se("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground 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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",l),...i,children:[r,h.jsx(hC,{asChild:!0,children:h.jsx(Av,{className:"size-4 opacity-50"})})]})}function ws({className:l,children:o,position:r="item-aligned",align:i="center",...u}){return h.jsx(yC,{children:h.jsxs(bC,{"data-slot":"select-content",className:Se("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 bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",r==="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",l),position:r,align:i,...u,children:[h.jsx(sA,{}),h.jsx(TC,{className:Se("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),h.jsx(cA,{})]})})}function Di({className:l,children:o,...r}){return h.jsxs(OC,{"data-slot":"select-item",className:Se("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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",l),...r,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(jC,{children:h.jsx(n1,{className:"size-4"})})}),h.jsx(RC,{children:o})]})}function sA({className:l,...o}){return h.jsx(DC,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",l),...o,children:h.jsx(o1,{className:"size-4"})})}function cA({className:l,...o}){return h.jsx(zC,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",l),...o,children:h.jsx(Av,{className:"size-4"})})}const C0="lb-author";function T0(){try{return localStorage.getItem(C0)}catch{return null}}function uA(l){try{localStorage.setItem(C0,l)}catch{}}const fA="unknown-human";function dA(){return T0()?.trim()||fA}function Sv(l){const o=l.trim().slice(0,40);o&&uA(o)}function mA(){return!!T0()?.trim()}function zi({className:l,...o}){return h.jsx(IE,{"data-slot":"label",className:Se("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",l),...o})}const hA=Vi("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-0 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function pA({className:l,state:o="done",size:r="default",orientation:i="horizontal",...u}){return h.jsx("div",{"data-slot":"attachment","data-state":o,"data-size":r,"data-orientation":i,className:Se(hA({size:r,orientation:i}),l),...u})}const gA=Vi("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function vA({className:l,variant:o="icon",...r}){return h.jsx("div",{"data-slot":"attachment-media","data-variant":o,className:Se(gA({variant:o}),l),...r})}function yA({className:l,...o}){return h.jsx("div",{"data-slot":"attachment-content",className:Se("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",l),...o})}function bA({className:l,...o}){return h.jsx("span",{"data-slot":"attachment-title",className:Se("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",l),...o})}function xA({className:l,...o}){return h.jsx("span",{"data-slot":"attachment-description",className:Se("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",l),...o})}function SA({className:l,...o}){return h.jsx("div",{"data-slot":"attachment-actions",className:Se("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",l),...o})}function wA({className:l,variant:o,size:r="icon-xs",...i}){return h.jsx(Ct,{"data-slot":"attachment-action",variant:o??"ghost",size:r,className:Se(l),...i})}function EA({...l}){return h.jsx(p2,{"data-slot":"alert-dialog",...l})}function CA({...l}){return h.jsx(g2,{"data-slot":"alert-dialog-trigger",...l})}function TA({...l}){return h.jsx(v2,{"data-slot":"alert-dialog-portal",...l})}function AA({className:l,...o}){return h.jsx(y2,{"data-slot":"alert-dialog-overlay",className:Se("fixed inset-0 z-50 bg-[color-mix(in_oklch,var(--lb-scrim)_60%,transparent)] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",l),...o})}function _A({className:l,size:o="default",...r}){return h.jsxs(TA,{children:[h.jsx(AA,{}),h.jsx(b2,{"data-slot":"alert-dialog-content","data-size":o,className:Se("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",l),...r})]})}function OA({className:l,...o}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:Se("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",l),...o})}function RA({className:l,...o}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:Se("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",l),...o})}function NA({className:l,...o}){return h.jsx(w2,{"data-slot":"alert-dialog-title",className:Se("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",l),...o})}function jA({className:l,...o}){return h.jsx(E2,{"data-slot":"alert-dialog-description",className:Se("text-sm text-muted-foreground",l),...o})}function DA({className:l,variant:o="default",size:r="default",...i}){return h.jsx(Ct,{variant:o,size:r,asChild:!0,children:h.jsx(x2,{"data-slot":"alert-dialog-action",className:Se(l),...i})})}function zA({className:l,variant:o="outline",size:r="default",...i}){return h.jsx(Ct,{variant:o,size:r,asChild:!0,children:h.jsx(S2,{"data-slot":"alert-dialog-cancel",className:Se(l),...i})})}const Mi=()=>dA(),zs="text-[11px] font-medium text-muted-foreground";function gt({label:l,children:o,region:r}){return r?h.jsxs("section",{className:"grid min-w-0 gap-1.5","aria-label":l,children:[h.jsx("h2",{className:zs,children:l}),h.jsx("div",{className:"min-w-0",children:o})]}):h.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[h.jsx("span",{className:zs,children:l}),h.jsx("div",{className:"min-w-0",children:o})]})}const Tf=({children:l,label:o})=>h.jsx("pre",{tabIndex:0,role:"group","aria-label":o,className:"mt-0.5 overflow-x-auto whitespace-pre-wrap rounded-md border bg-background p-2.5 font-mono text-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ring)]",children:l});function MA({id:l,navigate:o,themeToggle:r}){const[i,u]=b.useState(null),[f,m]=b.useState(null),[v,y]=b.useState(!1),[p,w]=b.useState({}),[g,E]=b.useState(""),[O,A]=b.useState(""),[C,T]=b.useState("reference"),[S,D]=b.useState(""),[z,k]=b.useState(!1),I=b.useRef(null),X=()=>{Qa.get(l).then(U=>{u(U),m(null)}).catch(U=>m(U.message))};if(b.useEffect(X,[l]),b.useEffect(()=>{const U=setInterval(()=>{!document.hidden&&!z&&!v&&X()},1e4);return()=>clearInterval(U)},[l,z,v]),f)return h.jsxs("div",{className:"grid gap-4",children:[h.jsxs("h1",{className:"text-xl font-semibold tracking-tight",children:["Could not load ",l]}),h.jsxs(Pf,{variant:"destructive",children:[h.jsx(Jf,{children:"The hub did not return this item"}),h.jsx(If,{children:f})]}),h.jsx(Ct,{variant:"outline",onClick:()=>o("/queue"),children:"Back to the queue"})]});if(!i)return h.jsxs("div",{className:"grid gap-4",children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Loading feedback item"}),h.jsxs("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:["Loading ",l,"…"]}),h.jsx(To,{className:"h-8 w-40"}),h.jsx(To,{className:"h-7 w-2/3"}),h.jsx(To,{className:"h-28 w-full"}),h.jsx(To,{className:"h-40 w-full"})]});const K=i.extra.failed_responses,G=i.extra.context,ae=async(U,te)=>{if(z)return;const fe=document.activeElement,he=fe?.closest("[data-slot=card], header"),j=te??fe?.closest("[data-lb-region]")?.getAttribute("data-lb-region")??null;k(!0);try{await U()}catch(Y){Sl.error(Y.message)}finally{k(!1),requestAnimationFrame(()=>{if(fe&&document.contains(fe)&&!fe.disabled){fe.focus();return}const oe=(j?document.querySelector(`[data-lb-region="${j}"]`):null)??(he&&document.contains(he)?he:null);oe&&(oe.setAttribute("tabindex","-1"),oe.focus({preventScroll:!0}))})}},me=()=>ae(async()=>{await Qa.update(l,{...p,author:Mi()}),Sl.success("Saved — the change is on the audit trail"),y(!1),w({}),X()},"detail-header"),ge=async U=>{if(C==="asset"&&!S.trim()){Sl.error("An asset needs a target path — where should it land in the repo?");return}return ae(async()=>{await Qa.attach(l,U,{intent:C,target:C==="asset"?S.trim():void 0,author:Mi()}),Sl.success(C==="asset"?`Attached as an asset — an agent will copy it to ${S.trim()}`:"Attached as reference — context for the fix"),D(""),X()})};return h.jsxs("div",{className:"grid min-w-0 gap-4 [&>*]:min-w-0",children:[h.jsxs("header",{"data-lb-region":"detail-header",className:"flex flex-wrap items-center gap-3",children:[h.jsxs(Ct,{variant:"ghost",size:"sm",className:"h-11",onClick:()=>o("/queue"),children:[h.jsx(e1,{className:"size-4"})," Queue"]}),h.jsx(Cl,{className:Es[i.status],children:i.status}),h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[!v&&h.jsxs(Ct,{variant:"outline",size:"sm",onClick:()=>{w({title:i.title,body:i.body,severity:i.severity,type:i.type}),y(!0),requestAnimationFrame(()=>{document.getElementById("lb-edit-title")?.focus()})},children:[h.jsx(x1,{className:"size-4"})," Edit"]}),r]})]}),h.jsx("h1",{className:"text-xl font-semibold tracking-tight break-all",children:i.title}),v?h.jsxs(ji,{"data-lb-region":"edit",className:"grid min-w-0 gap-3 p-4 [&>*]:min-w-0",children:[h.jsx(zi,{htmlFor:"lb-edit-title",className:"sr-only",children:"Title"}),h.jsx(Ui,{id:"lb-edit-title",value:p.title??"",onChange:U=>w(te=>({...te,title:U.target.value})),className:"text-base font-medium"}),h.jsx(zi,{htmlFor:"lb-edit-body",className:"sr-only",children:"Report"}),h.jsx(xv,{id:"lb-edit-body",value:p.body??"",rows:6,onChange:U=>w(te=>({...te,body:U.target.value}))}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsxs(bs,{value:p.severity,onValueChange:U=>w(te=>({...te,severity:U})),children:[h.jsx(Ss,{className:"w-32","aria-label":"Severity",children:h.jsx(xs,{})}),h.jsx(ws,{children:lS.map(U=>h.jsx(Di,{value:U,children:U},U))})]}),h.jsxs(bs,{value:p.type,onValueChange:U=>w(te=>({...te,type:U})),children:[h.jsx(Ss,{className:"w-36","aria-label":"Type",children:h.jsx(xs,{})}),h.jsx(ws,{children:oS.map(U=>h.jsx(Di,{value:U,children:U},U))})]}),h.jsx(Ct,{size:"sm",onClick:me,disabled:z,children:z?"Saving…":"Save"}),h.jsx(Ct,{variant:"ghost",size:"sm",onClick:()=>{y(!1),w({}),requestAnimationFrame(()=>{const U=document.querySelector('[data-lb-region="detail-header"]');U?.setAttribute("tabindex","-1"),U?.focus({preventScroll:!0})})},children:"Cancel"})]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Every edit is recorded on the trail with its old value — nothing is rewritten silently."})]}):h.jsx("code",{className:"font-mono text-xs break-all text-muted-foreground",children:i.id}),h.jsxs(ji,{className:"grid grid-cols-[repeat(auto-fit,minmax(170px,1fr))] gap-3 p-4",children:[h.jsx(gt,{label:"Project",children:h.jsx("span",{className:"break-all",children:i.project})}),h.jsxs(gt,{label:"Severity / type",children:[h.jsx("span",{className:`font-mono text-xs ${Of[i.severity]} ${Rf[i.severity]}`,children:i.severity})," ",h.jsx("span",{className:"text-sm text-muted-foreground",children:i.type})]}),h.jsx(gt,{label:"Source / reporter",children:h.jsxs("span",{className:"text-sm break-all",children:[i.source," · ",i.reporter]})}),h.jsx(gt,{label:"Assignee",children:h.jsx("span",{className:"text-sm break-all",children:i.assignee_agent??"unclaimed"})}),h.jsx(gt,{label:"Route",children:h.jsx("code",{className:"font-mono text-xs break-all",children:i.route??"—"})}),h.jsx(gt,{label:"Age",children:h.jsx("time",{dateTime:i.created_at,className:"text-sm",title:i.created_at,children:Ff(i.created_at)})}),h.jsx(gt,{label:"Updated",children:h.jsx("span",{className:"text-sm text-muted-foreground",children:i.updated_at})}),i.resolution&&h.jsx(gt,{label:"Resolution",children:h.jsx("span",{className:"text-sm",children:i.resolution})})]}),h.jsxs("div",{className:"grid gap-3.5",children:[i.body&&!v&&h.jsx(gt,{region:!0,label:"Report",children:h.jsx("div",{className:"whitespace-pre-wrap break-all text-sm",children:i.body})}),i.repro_steps.length>0&&h.jsx(gt,{region:!0,label:"Repro steps",children:h.jsx("ol",{className:"list-decimal pl-5 text-sm break-all",children:i.repro_steps.map((U,te)=>h.jsx("li",{children:U},te))})}),K&&K.length>0&&h.jsx(gt,{region:!0,label:"Failed requests (captured at report time)",children:K.map((U,te)=>h.jsxs("div",{className:"mb-2",children:[h.jsxs("code",{className:"font-mono text-xs break-all",children:[U.status," ",U.url]}),U.body&&h.jsx(Tf,{label:`Response body for ${U.status} ${U.url}`,children:U.body})]},te))}),G&&h.jsx(gt,{region:!0,label:"Run context (AI / automation)",children:h.jsx(Tf,{label:"Run context JSON",children:JSON.stringify(G,null,2)})}),i.console.length>0&&h.jsx(gt,{region:!0,label:`Console (${i.console.length})`,children:h.jsx(Tf,{label:"Console capture",children:i.console.join(` +`)},Ow=0,wo=[];function Rw(l){var o=b.useRef([]),r=b.useRef([0,0]),i=b.useRef(),u=b.useState(Ow++)[0],f=b.useState(vy)[0],m=b.useRef(l);b.useEffect(function(){m.current=l},[l]),b.useEffect(function(){if(l.inert){document.body.classList.add("block-interactivity-".concat(u));var C=JS([l.lockRef.current],(l.shards||[]).map(Xg),!0).filter(Boolean);return C.forEach(function(T){return T.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),C.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(u))})}}},[l.inert,l.lockRef.current,l.shards]);var v=b.useCallback(function(C,T){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!m.current.allowPinchZoom;var S=us(C),D=r.current,z="deltaX"in C?C.deltaX:D[0]-S[0],k="deltaY"in C?C.deltaY:D[1]-S[1],I,X=C.target,K=Math.abs(z)>Math.abs(k)?"h":"v";if("touches"in C&&K==="h"&&X.type==="range")return!1;var G=window.getSelection(),ae=G&&G.anchorNode,me=ae?ae===X||ae.contains(X):!1;if(me)return!1;var ge=Vg(K,X);if(!ge)return!0;if(ge?I=K:(I=K==="v"?"h":"v",ge=Vg(K,X)),!ge)return!1;if(!i.current&&"changedTouches"in C&&(z||k)&&(i.current=I),!I)return!0;var U=i.current||I;return Tw(U,T,C,U==="h"?z:k)},[]),y=b.useCallback(function(C){var T=C;if(!(!wo.length||wo[wo.length-1]!==f)){var S="deltaY"in T?Gg(T):us(T),D=o.current.filter(function(I){return I.name===T.type&&(I.target===T.target||T.target===I.shadowParent)&&Aw(I.delta,S)})[0];if(D&&D.should){T.cancelable&&T.preventDefault();return}if(!D){var z=(m.current.shards||[]).map(Xg).filter(Boolean).filter(function(I){return I.contains(T.target)}),k=z.length>0?v(T,z[0]):!m.current.noIsolation;k&&T.cancelable&&T.preventDefault()}}},[]),p=b.useCallback(function(C,T,S,D){var z={name:C,delta:T,target:S,should:D,shadowParent:Nw(S)};o.current.push(z),setTimeout(function(){o.current=o.current.filter(function(k){return k!==z})},1)},[]),w=b.useCallback(function(C){r.current=us(C),i.current=void 0},[]),g=b.useCallback(function(C){p(C.type,Gg(C),C.target,v(C,l.lockRef.current))},[]),E=b.useCallback(function(C){p(C.type,us(C),C.target,v(C,l.lockRef.current))},[]);b.useEffect(function(){return wo.push(f),l.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:E}),document.addEventListener("wheel",y,So),document.addEventListener("touchmove",y,So),document.addEventListener("touchstart",w,So),function(){wo=wo.filter(function(C){return C!==f}),document.removeEventListener("wheel",y,So),document.removeEventListener("touchmove",y,So),document.removeEventListener("touchstart",w,So)}},[]);var O=l.removeScrollBar,A=l.inert;return b.createElement(b.Fragment,null,A?b.createElement(f,{styles:_w(u)}):null,O?b.createElement(yw,{noRelative:l.noRelative,gapMode:l.gapMode}):null)}function Nw(l){for(var o=null;l!==null;)l instanceof ShadowRoot&&(o=l.host,l=l.host),l=l.parentNode;return o}const jw=ow(gy,Rw);var rd=b.forwardRef(function(l,o){return b.createElement(Us,Mn({},l,{ref:o,sideCar:jw}))});rd.classNames=Us.classNames;var Dw=function(l){if(typeof document>"u")return null;var o=Array.isArray(l)?l[0]:l;return o.ownerDocument.body},Eo=new WeakMap,fs=new WeakMap,ds={},xf=0,Sy=function(l){return l&&(l.host||Sy(l.parentNode))},zw=function(l,o){return o.map(function(r){if(l.contains(r))return r;var i=Sy(r);return i&&l.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",l,". Doing nothing"),null)}).filter(function(r){return!!r})},Mw=function(l,o,r,i){var u=zw(o,Array.isArray(l)?l:[l]);ds[r]||(ds[r]=new WeakMap);var f=ds[r],m=[],v=new Set,y=new Set(u),p=function(g){!g||v.has(g)||(v.add(g),p(g.parentNode))};u.forEach(p);var w=function(g){!g||y.has(g)||Array.prototype.forEach.call(g.children,function(E){if(v.has(E))w(E);else try{var O=E.getAttribute(i),A=O!==null&&O!=="false",C=(Eo.get(E)||0)+1,T=(f.get(E)||0)+1;Eo.set(E,C),f.set(E,T),m.push(E),C===1&&A&&fs.set(E,!0),T===1&&E.setAttribute(r,"true"),A||E.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",E,S)}})};return w(o),v.clear(),xf++,function(){m.forEach(function(g){var E=Eo.get(g)-1,O=f.get(g)-1;Eo.set(g,E),f.set(g,O),E||(fs.has(g)||g.removeAttribute(i),fs.delete(g)),O||g.removeAttribute(r)}),xf--,xf||(Eo=new WeakMap,Eo=new WeakMap,fs=new WeakMap,ds={})}},wy=function(l,o,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(l)?l:[l]),u=Dw(l);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),Mw(i,u,r,"aria-hidden")):function(){return null}},Uw=Object.defineProperty,nn=(l,o)=>Uw(l,"name",{value:o,configurable:!0}),sd="Dialog",[Ey,Cy]=Pa(sd),[kw,En]=Ey(sd),Lw=nn(l=>{const{__scopeDialog:o,children:r,open:i,defaultOpen:u,onOpenChange:f,modal:m=!0}=l,v=b.useRef(null),y=b.useRef(null),[p,w]=ki({prop:i,defaultProp:u??!1,onChange:f,caller:sd}),[g,E]=b.useState(0),[O,A]=b.useState(0);return h.jsx(kw,{scope:o,triggerRef:v,contentRef:y,contentId:Tl(),titleId:Tl(),descriptionId:Tl(),titlePresent:g>0,descriptionPresent:O>0,setTitleCount:E,setDescriptionCount:A,open:p,onOpenChange:w,onOpenToggle:b.useCallback(()=>w(C=>!C),[w]),modal:m,children:r})},"Dialog"),Hw="DialogTrigger",Bw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Hw,i),m=Xe(r,f.triggerRef);return h.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":ks(f.open),...u,ref:m,onClick:De(o.onClick,f.onOpenToggle)})},"DialogTrigger")),Ty="DialogPortal",[qw,Ay]=Ey(Ty,{forceMount:void 0}),Yw=nn(l=>{const{__scopeDialog:o,forceMount:r,children:i,container:u}=l,f=En(Ty,o);return h.jsx(qw,{scope:o,forceMount:r,children:b.Children.map(i,m=>h.jsx(jo,{present:r||f.open,children:h.jsx(od,{asChild:!0,container:u,children:m})}))})},"DialogPortal"),Yf="DialogOverlay",Vw=b.forwardRef(nn(function(o,r){const i=Ay(Yf,o.__scopeDialog),{forceMount:u=i.forceMount,...f}=o,m=En(Yf,o.__scopeDialog);return m.modal?h.jsx(jo,{present:u||m.open,children:h.jsx(Xw,{...f,ref:r})}):null},"DialogOverlay")),Gw=ua("DialogOverlay.RemoveScroll"),Xw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Yf,i),m=ly(),v=Xe(r,m);return h.jsx(rd,{as:Gw,allowPinchZoom:!0,shards:[f.contentRef],children:h.jsx(Ie.div,{"data-state":ks(f.open),...u,ref:v,style:{pointerEvents:"auto",...u.style}})})},"DialogOverlayImpl")),Li="DialogContent",Qw=b.forwardRef(nn(function(o,r){const i=Ay(Li,o.__scopeDialog),{forceMount:u=i.forceMount,...f}=o,m=En(Li,o.__scopeDialog);return h.jsx(jo,{present:u||m.open,children:m.modal?h.jsx(Zw,{...f,ref:r}):h.jsx(Kw,{...f,ref:r})})},"DialogContent")),Zw=b.forwardRef(nn(function(o,r){const i=En(Li,o.__scopeDialog),u=b.useRef(null),f=Xe(r,i.contentRef,u);return b.useEffect(()=>{const m=u.current;if(m)return wy(m)},[]),h.jsx(_y,{...o,ref:f,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:De(o.onCloseAutoFocus,m=>{m.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:De(o.onPointerDownOutside,m=>{const v=m.detail.originalEvent,y=v.button===0&&v.ctrlKey===!0;(v.button===2||y)&&m.preventDefault()}),onFocusOutside:De(o.onFocusOutside,m=>m.preventDefault())})},"DialogContentModal")),Kw=b.forwardRef(nn(function(o,r){const i=En(Li,o.__scopeDialog),u=b.useRef(!1),f=b.useRef(!1);return h.jsx(_y,{...o,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{o.onCloseAutoFocus?.(m),m.defaultPrevented||(u.current||i.triggerRef.current?.focus(),m.preventDefault()),u.current=!1,f.current=!1},onInteractOutside:m=>{o.onInteractOutside?.(m),m.defaultPrevented||(u.current=!0,m.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const v=m.target;i.triggerRef.current?.contains(v)&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&f.current&&m.preventDefault()}})},"DialogContentNonModal")),_y=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:m,...v}=o,y=En(Li,i);return Ms(),h.jsx(h.Fragment,{children:h.jsx(ry,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:f,onUnmountAutoFocus:m,children:h.jsx(nd,{role:"dialog",id:y.contentId,"aria-describedby":y.descriptionPresent?y.descriptionId:void 0,"aria-labelledby":y.titlePresent?y.titleId:void 0,"data-state":ks(y.open),...v,ref:r,deferPointerDownOutside:!0,onDismiss:()=>y.onOpenChange(!1)})})})},"DialogContentImpl")),$w="DialogTitle",Pw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En($w,i),{setTitleCount:m}=f;return at(()=>(m(v=>v+1),()=>m(v=>v-1)),[m]),h.jsx(Ie.h2,{id:f.titleId,...u,ref:r})},"DialogTitle")),Jw="DialogDescription",Iw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Jw,i),{setDescriptionCount:m}=f;return at(()=>(m(v=>v+1),()=>m(v=>v-1)),[m]),h.jsx(Ie.p,{id:f.descriptionId,...u,ref:r})},"DialogDescription")),Fw="DialogClose",Oy=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Fw,i);return h.jsx(Ie.button,{type:"button",...u,ref:r,onClick:De(o.onClick,()=>f.onOpenChange(!1))})},"DialogClose"));function ks(l){return l?"open":"closed"}nn(ks,"getState");var Ww=Object.defineProperty,ma=(l,o)=>Ww(l,"name",{value:o,configurable:!0}),e2="AlertDialog",[t2,HA]=Pa(e2,[Cy]),ha=Cy(),n2=ma(l=>{const{__scopeAlertDialog:o,...r}=l,i=ha(o);return h.jsx(Lw,{...i,...r,modal:!0})},"AlertDialog"),a2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Bw,{...f,...u,ref:r})},"AlertDialogTrigger")),l2=ma(l=>{const{__scopeAlertDialog:o,...r}=l,i=ha(o);return h.jsx(Yw,{...i,...r})},"AlertDialogPortal"),o2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Vw,{...f,...u,ref:r})},"AlertDialogOverlay")),i2="AlertDialogContent",[r2,s2]=t2(i2),c2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,children:u,...f}=o,m=ha(i),v=b.useRef(null),y=Xe(r,v),p=b.useRef(null);return h.jsx(r2,{scope:i,cancelRef:p,children:h.jsx(Qw,{role:"alertdialog",...m,...f,ref:y,onOpenAutoFocus:De(f.onOpenAutoFocus,w=>{w.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:w=>w.preventDefault(),onInteractOutside:w=>w.preventDefault(),children:u})})},"AlertDialogContent")),u2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Pw,{...f,...u,ref:r})},"AlertDialogTitle")),f2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Iw,{...f,...u,ref:r})},"AlertDialogDescription")),d2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Oy,{...f,...u,ref:r})},"AlertDialogAction")),m2="AlertDialogCancel",h2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,{cancelRef:f}=s2(m2,i),m=ha(i),v=Xe(r,f);return h.jsx(Oy,{...m,...u,ref:v})},"AlertDialogCancel")),p2=n2,g2=a2,v2=l2,y2=o2,b2=c2,x2=d2,S2=h2,w2=u2,E2=f2,C2=Object.defineProperty,T2=(l,o)=>C2(l,"name",{value:o,configurable:!0});function Ry(l){const[o,r]=b.useState(void 0);return at(()=>{if(l){r({width:l.offsetWidth,height:l.offsetHeight});const i=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const f=u[0];let m,v;if("borderBoxSize"in f){const y=f.borderBoxSize,p=Array.isArray(y)?y[0]:y;m=p.inlineSize,v=p.blockSize}else m=l.offsetWidth,v=l.offsetHeight;r({width:m,height:v})});return i.observe(l,{box:"border-box"}),()=>i.unobserve(l)}else r(void 0)},[l]),o}T2(Ry,"useSize");const A2=["top","right","bottom","left"],Ka=Math.min,ra=Math.max,Os=Math.round,ms=Math.floor,sa=l=>({x:l,y:l}),_2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ny(l,o,r){return ra(l,Ka(o,r))}function da(l,o){return typeof l=="function"?l(o):l}function $a(l){return l.split("-")[0]}function Do(l){return l.split("-")[1]}function cd(l){return l==="x"?"y":"x"}function ud(l){return l==="y"?"height":"width"}function Un(l){const o=l[0];return o==="t"||o==="b"?"y":"x"}function fd(l){return cd(Un(l))}function O2(l,o,r){r===void 0&&(r=!1);const i=Do(l),u=fd(l),f=ud(u);let m=u==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(m=Rs(m)),[m,Rs(m)]}function R2(l){const o=Rs(l);return[Vf(l),o,Vf(o)]}function Vf(l){return l.includes("start")?l.replace("start","end"):l.replace("end","start")}const Qg=["left","right"],Zg=["right","left"],N2=["top","bottom"],j2=["bottom","top"];function D2(l,o,r){switch(l){case"top":case"bottom":return r?o?Zg:Qg:o?Qg:Zg;case"left":case"right":return o?N2:j2;default:return[]}}function z2(l,o,r,i){const u=Do(l);let f=D2($a(l),r==="start",i);return u&&(f=f.map(m=>m+"-"+u),o&&(f=f.concat(f.map(Vf)))),f}function Rs(l){const o=$a(l);return _2[o]+l.slice(o.length)}function M2(l){var o,r,i,u;return{top:(o=l.top)!=null?o:0,right:(r=l.right)!=null?r:0,bottom:(i=l.bottom)!=null?i:0,left:(u=l.left)!=null?u:0}}function jy(l){return typeof l!="number"?M2(l):{top:l,right:l,bottom:l,left:l}}function Ns(l){const{x:o,y:r,width:i,height:u}=l;return{width:i,height:u,top:r,left:o,right:o+i,bottom:r+u,x:o,y:r}}function Kg(l,o,r){let{reference:i,floating:u}=l;const f=Un(o),m=fd(o),v=ud(m),y=$a(o),p=f==="y",w=i.x+i.width/2-u.width/2,g=i.y+i.height/2-u.height/2,E=i[v]/2-u[v]/2;let O;switch(y){case"top":O={x:w,y:i.y-u.height};break;case"bottom":O={x:w,y:i.y+i.height};break;case"right":O={x:i.x+i.width,y:g};break;case"left":O={x:i.x-u.width,y:g};break;default:O={x:i.x,y:i.y}}const A=Do(o);return A&&(O[m]+=E*(A==="end"?1:-1)*(r&&p?-1:1)),O}async function U2(l,o){var r;o===void 0&&(o={});const{x:i,y:u,platform:f,rects:m,elements:v,strategy:y}=l,{boundary:p="clippingAncestors",rootBoundary:w="viewport",elementContext:g="floating",altBoundary:E=!1,padding:O=0}=da(o,l),A=jy(O),T=v[E?g==="floating"?"reference":"floating":g],S=Ns(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(T)))==null||r?T:T.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(v.floating)),boundary:p,rootBoundary:w,strategy:y})),D=g==="floating"?{x:i,y:u,width:m.floating.width,height:m.floating.height}:m.reference,z=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v.floating)),k=await(f.isElement==null?void 0:f.isElement(z))&&await(f.getScale==null?void 0:f.getScale(z))||{x:1,y:1},I=Ns(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:D,offsetParent:z,strategy:y}):D);return{top:(S.top-I.top+A.top)/k.y,bottom:(I.bottom-S.bottom+A.bottom)/k.y,left:(S.left-I.left+A.left)/k.x,right:(I.right-S.right+A.right)/k.x}}const k2=50,L2=async(l,o,r)=>{const{placement:i="bottom",strategy:u="absolute",middleware:f=[],platform:m}=r,v=m.detectOverflow?m:{...m,detectOverflow:U2},y=await(m.isRTL==null?void 0:m.isRTL(o));let p=await m.getElementRects({reference:l,floating:o,strategy:u}),{x:w,y:g}=Kg(p,i,y),E=i,O=0;const A={};for(let C=0;C({name:"arrow",options:l,async fn(o){const{x:r,y:i,placement:u,rects:f,platform:m,elements:v,middlewareData:y}=o,{element:p,padding:w=0}=da(l,o)||{};if(p==null)return{};const g=jy(w),E={x:r,y:i},O=fd(u),A=ud(O),C=await m.getDimensions(p),T=O==="y",S=T?"top":"left",D=T?"bottom":"right",z=T?"clientHeight":"clientWidth",k=f.reference[A]+f.reference[O]-E[O]-f.floating[A],I=E[O]-f.reference[O],X=await(m.getOffsetParent==null?void 0:m.getOffsetParent(p));let K=X?X[z]:0;(!K||!await(m.isElement==null?void 0:m.isElement(X)))&&(K=v.floating[z]||f.floating[A]);const G=k/2-I/2,ae=K/2-C[A]/2-1,me=Ka(g[S],ae),ge=Ka(g[D],ae),U=K-C[A]-ge,te=K/2-C[A]/2+G,fe=Ny(me,te,U),he=!y.arrow&&Do(u)!=null&&te!==fe&&f.reference[A]/2-(tefe<=0)){var ge,U;const fe=(((ge=f.flip)==null?void 0:ge.index)||0)+1,he=K[fe];if(he&&(!(g==="alignment"?D!==Un(he):!1)||me.every(F=>Un(F.placement)===D?F.overflows[0]>0:!0)))return{data:{index:fe,overflows:me},reset:{placement:he}};let j=(U=me.filter(Y=>Y.overflows[0]<=0).sort((Y,F)=>Y.overflows[1]-F.overflows[1])[0])==null?void 0:U.placement;if(!j)switch(O){case"bestFit":{var te;const Y=(te=me.filter(F=>{if(X){const oe=Un(F.placement);return oe===D||oe==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(oe=>oe>0).reduce((oe,P)=>oe+P,0)]).sort((F,oe)=>F[1]-oe[1])[0])==null?void 0:te[0];Y&&(j=Y);break}case"initialPlacement":j=v;break}if(u!==j)return{reset:{placement:j}}}return{}}}};function $g(l,o){return{top:l.top-o.height,right:l.right-o.width,bottom:l.bottom-o.height,left:l.left-o.width}}function Pg(l){return A2.some(o=>l[o]>=0)}const q2=function(l){return l===void 0&&(l={}),{name:"hide",options:l,async fn(o){const{rects:r,platform:i}=o,{strategy:u="referenceHidden",...f}=da(l,o);switch(u){case"referenceHidden":{const m=await i.detectOverflow(o,{...f,elementContext:"reference"}),v=$g(m,r.reference);return{data:{referenceHiddenOffsets:v,referenceHidden:Pg(v)}}}case"escaped":{const m=await i.detectOverflow(o,{...f,altBoundary:!0}),v=$g(m,r.floating);return{data:{escapedOffsets:v,escaped:Pg(v)}}}default:return{}}}}},Dy=new Set(["left","top"]);async function Y2(l,o){const{placement:r,platform:i,elements:u}=l,f=await(i.isRTL==null?void 0:i.isRTL(u.floating)),m=$a(r),v=Do(r),y=Un(r)==="y",p=Dy.has(m)?-1:1,w=f&&y?-1:1,g=da(o,l);let{mainAxis:E,crossAxis:O,alignmentAxis:A}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return v&&typeof A=="number"&&(O=v==="end"?A*-1:A),y?{x:O*w,y:E*p}:{x:E*p,y:O*w}}const V2=function(l){return l===void 0&&(l=0),{name:"offset",options:l,async fn(o){var r,i;const{x:u,y:f,placement:m,middlewareData:v}=o,y=await Y2(o,l);return m===((r=v.offset)==null?void 0:r.placement)&&(i=v.arrow)!=null&&i.alignmentOffset?{}:{x:u+y.x,y:f+y.y,data:{...y,placement:m}}}}},G2=function(l){return l===void 0&&(l={}),{name:"shift",options:l,async fn(o){const{x:r,y:i,placement:u,platform:f}=o,{mainAxis:m=!0,crossAxis:v=!1,limiter:y={fn:D=>{let{x:z,y:k}=D;return{x:z,y:k}}},...p}=da(l,o),w={x:r,y:i},g=await f.detectOverflow(o,p),E=Un(u),O=cd(E);let A=w[O],C=w[E];const T=(D,z)=>Ny(z+g[D==="y"?"top":"left"],z,z-g[D==="y"?"bottom":"right"]);m&&(A=T(O,A)),v&&(C=T(E,C));const S=y.fn({...o,[O]:A,[E]:C});return{...S,data:{x:S.x-r,y:S.y-i,enabled:{[O]:m,[E]:v}}}}}},X2=function(l){return l===void 0&&(l={}),{options:l,fn(o){var r,i;const{x:u,y:f,placement:m,rects:v,middlewareData:y}=o,{offset:p=0,mainAxis:w=!0,crossAxis:g=!0}=da(l,o),E={x:u,y:f},O=Un(m),A=cd(O);let C=E[A],T=E[O];const S=da(p,o),D=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(r=S.mainAxis)!=null?r:0,crossAxis:(i=S.crossAxis)!=null?i:0};if(w){const I=A==="y"?"height":"width",X=v.reference[A]-v.floating[I]+D.mainAxis,K=v.reference[A]+v.reference[I]-D.mainAxis;CK&&(C=K)}if(g){var z,k;const I=A==="y"?"width":"height",X=Dy.has($a(m)),K=v.reference[O]-v.floating[I]+(X&&((z=y.offset)==null?void 0:z[O])||0)+(X?0:D.crossAxis),G=v.reference[O]+v.reference[I]+(X?0:((k=y.offset)==null?void 0:k[O])||0)-(X?D.crossAxis:0);TG&&(T=G)}return{[A]:C,[O]:T}}}},Q2=function(l){return l===void 0&&(l={}),{name:"size",options:l,async fn(o){const{placement:r,rects:i,platform:u,elements:f}=o,{apply:m=()=>{},...v}=da(l,o),y=await u.detectOverflow(o,v),p=$a(r),w=Do(r),g=Un(r)==="y",{width:E,height:O}=i.floating;let A,C;p==="top"||p==="bottom"?(A=p,C=w===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(C=p,A=w==="end"?"top":"bottom");const T=O-y.top-y.bottom,S=E-y.left-y.right,D=Ka(O-y[A],T),z=Ka(E-y[C],S),k=o.middlewareData.shift,I=!k;let X=D,K=z;k!=null&&k.enabled.x&&(K=S),k!=null&&k.enabled.y&&(X=T),I&&!w&&(g?K=E-2*ra(y.left,y.right):X=O-2*ra(y.top,y.bottom)),await m({...o,availableWidth:K,availableHeight:X});const G=await u.getDimensions(f.floating);return E!==G.width||O!==G.height?{reset:{rects:!0}}:{}}}};function Ls(){return typeof window<"u"}function zo(l){return zy(l)?(l.nodeName||"").toLowerCase():"#document"}function Zt(l){var o;return(l==null||(o=l.ownerDocument)==null?void 0:o.defaultView)||window}function pa(l){var o;return(o=(zy(l)?l.ownerDocument:l.document)||window.document)==null?void 0:o.documentElement}function zy(l){return Ls()?l instanceof Node||l instanceof Zt(l).Node:!1}function Ln(l){return Ls()?l instanceof Element||l instanceof Zt(l).Element:!1}function Ja(l){return Ls()?l instanceof HTMLElement||l instanceof Zt(l).HTMLElement:!1}function Jg(l){return!Ls()||typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof Zt(l).ShadowRoot}function Hs(l){const{overflow:o,overflowX:r,overflowY:i,display:u}=Hn(l);return/auto|scroll|overlay|hidden|clip/.test(o+i+r)&&u!=="inline"&&u!=="contents"}function Z2(l){return/^(table|td|th)$/.test(zo(l))}function Bs(l){try{if(l.matches(":popover-open"))return!0}catch{}try{return l.matches(":modal")}catch{return!1}}const K2=/transform|translate|scale|rotate|perspective|filter/,$2=/paint|layout|strict|content/,wl=l=>!!l&&l!=="none";let Sf;function dd(l){const o=Ln(l)?Hn(l):l;return wl(o.transform)||wl(o.translate)||wl(o.scale)||wl(o.rotate)||wl(o.perspective)||!md()&&(wl(o.backdropFilter)||wl(o.filter))||K2.test(o.willChange||"")||$2.test(o.contain||"")}function P2(l){let o=Al(l);for(;Ja(o)&&!Hi(o);){if(dd(o))return o;if(Bs(o))return null;o=Al(o)}return null}function md(){return Sf==null&&(Sf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Sf}function Hi(l){return/^(html|body|#document)$/.test(zo(l))}function Hn(l){return Zt(l).getComputedStyle(l)}function qs(l){return Ln(l)?{scrollLeft:l.scrollLeft,scrollTop:l.scrollTop}:{scrollLeft:l.scrollX,scrollTop:l.scrollY}}function Al(l){if(zo(l)==="html")return l;const o=l.assignedSlot||l.parentNode||Jg(l)&&l.host||pa(l);return Jg(o)?o.host:o}function My(l){const o=Al(l);return Hi(o)?(l.ownerDocument||l).body:Ja(o)&&Hs(o)?o:My(o)}function Bi(l,o,r){var i;o===void 0&&(o=[]),r===void 0&&(r=!0);const u=My(l),f=u===((i=l.ownerDocument)==null?void 0:i.body),m=Zt(u);if(f){const v=Gf(m);return o.concat(m,m.visualViewport||[],Hs(u)?u:[],v&&r?Bi(v):[])}else return o.concat(u,Bi(u,[],r))}function Gf(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}function Uy(l){const o=Hn(l);let r=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const u=Ja(l),f=u?l.offsetWidth:r,m=u?l.offsetHeight:i,v=Os(r)!==f||Os(i)!==m;return v&&(r=f,i=m),{width:r,height:i,$:v}}function hd(l){return Ln(l)?l:l.contextElement}function _o(l){const o=hd(l);if(!Ja(o))return sa(1);const r=o.getBoundingClientRect(),{width:i,height:u,$:f}=Uy(o);let m=(f?Os(r.width):r.width)/i,v=(f?Os(r.height):r.height)/u;return(!m||!Number.isFinite(m))&&(m=1),(!v||!Number.isFinite(v))&&(v=1),{x:m,y:v}}const J2=sa(0);function ky(l){const o=Zt(l);return!md()||!o.visualViewport?J2:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function I2(l,o,r){return o===void 0&&(o=!1),!!r&&o&&r===Zt(l)}function _l(l,o,r,i){o===void 0&&(o=!1),r===void 0&&(r=!1);const u=l.getBoundingClientRect(),f=hd(l);let m=sa(1);o&&(i?Ln(i)&&(m=_o(i)):m=_o(l));const v=I2(f,r,i)?ky(f):sa(0);let y=(u.left+v.x)/m.x,p=(u.top+v.y)/m.y,w=u.width/m.x,g=u.height/m.y;if(f&&i){const E=Zt(f),O=Ln(i)?Zt(i):i;let A=E,C=Gf(A);for(;C&&O!==A;){const T=_o(C),S=C.getBoundingClientRect(),D=Hn(C),z=S.left+(C.clientLeft+parseFloat(D.paddingLeft))*T.x,k=S.top+(C.clientTop+parseFloat(D.paddingTop))*T.y;y*=T.x,p*=T.y,w*=T.x,g*=T.y,y+=z,p+=k,A=Zt(C),C=Gf(A)}}return Ns({width:w,height:g,x:y,y:p})}function Ys(l,o){const r=qs(l).scrollLeft;return o?o.left+r:_l(pa(l)).left+r}function Ly(l,o){const r=l.getBoundingClientRect(),i=r.left+o.scrollLeft-Ys(l,r),u=r.top+o.scrollTop;return{x:i,y:u}}function F2(l){let{elements:o,rect:r,offsetParent:i,strategy:u}=l;const f=u==="fixed",m=pa(i),v=o?Bs(o.floating):!1;if(i===m||v&&f)return r;let y={scrollLeft:0,scrollTop:0},p=sa(1);const w=sa(0),g=Ja(i);if((g||!f)&&((zo(i)!=="body"||Hs(m))&&(y=qs(i)),g)){const O=_l(i);p=_o(i),w.x=O.x+i.clientLeft,w.y=O.y+i.clientTop}const E=m&&!g&&!f?Ly(m,y):sa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-y.scrollLeft*p.x+w.x+E.x,y:r.y*p.y-y.scrollTop*p.y+w.y+E.y}}function W2(l){return l.getClientRects?Array.from(l.getClientRects()):[]}function eE(l){const o=qs(l),r=l.ownerDocument.body,i=ra(l.scrollWidth,l.clientWidth,r.scrollWidth,r.clientWidth),u=ra(l.scrollHeight,l.clientHeight,r.scrollHeight,r.clientHeight);let f=-o.scrollLeft+Ys(l);const m=-o.scrollTop;return Hn(r).direction==="rtl"&&(f+=ra(l.clientWidth,r.clientWidth)-i),{width:i,height:u,x:f,y:m}}const tE=25;function nE(l,o,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",u=Zt(l),f=pa(l),m=u.visualViewport;let v=f.clientWidth,y=f.clientHeight,p=0,w=0;if(m){const E=!md()||o==="fixed";i?E||(p=-m.offsetLeft,w=-m.offsetTop):(v=m.width,y=m.height,E&&(p=m.offsetLeft,w=m.offsetTop))}if(Ys(f)<=0){const E=f.ownerDocument,O=E.body,A=getComputedStyle(O),C=E.compatMode==="CSS1Compat"&&parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0,T=Math.abs(f.clientWidth-O.clientWidth-C),S=getComputedStyle(f).scrollbarGutter==="stable both-edges"?T/2:T;S<=tE&&(v-=S)}return{width:v,height:y,x:p,y:w}}function aE(l,o){const r=_l(l,!0,o==="fixed"),i=r.top+l.clientTop,u=r.left+l.clientLeft,f=_o(l),m=l.clientWidth*f.x,v=l.clientHeight*f.y,y=u*f.x,p=i*f.y;return{width:m,height:v,x:y,y:p}}function Ig(l,o,r){let i;if(o==="viewport"||o==="layoutViewport")i=nE(l,r,o);else if(o==="document")i=eE(pa(l));else if(Ln(o))i=aE(o,r);else{const u=ky(l);i={x:o.x-u.x,y:o.y-u.y,width:o.width,height:o.height}}return Ns(i)}function lE(l,o){const r=o.get(l);if(r)return r;let i=Bi(l,[],!1).filter(v=>Ln(v)&&zo(v)!=="body"),u=null;const f=Hn(l).position==="fixed";let m=f?Al(l):l;for(;Ln(m)&&!Hi(m);){const v=Hn(m),y=dd(m),p=u?u.position:f?"fixed":"";!y&&(p==="fixed"||p==="absolute"&&v.position==="static")?i=i.filter(g=>g!==m):u=v,m=Al(m)}return o.set(l,i),i}function oE(l){let{element:o,boundary:r,rootBoundary:i,strategy:u}=l;const m=[...r==="clippingAncestors"?Bs(o)?[]:lE(o,this._c):[].concat(r),i],v=Ig(o,m[0],u);let y=v.top,p=v.right,w=v.bottom,g=v.left;for(let E=1;E{v(!1,1e-7)},1e3)}K=!1}try{i=new IntersectionObserver(G,{...X,root:f.ownerDocument})}catch{i=new IntersectionObserver(G,X)}i.observe(l)}const y=Zt(l),p=()=>v(r);return y.addEventListener("resize",p),v(!0),()=>{y.removeEventListener("resize",p),m()}}function dE(l,o,r,i){i===void 0&&(i={});const{ancestorScroll:u=!0,ancestorResize:f=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:y=!1}=i,p=hd(l),w=u||f?[...p?Bi(p):[],...o?Bi(o):[]]:[];w.forEach(S=>{u&&S.addEventListener("scroll",r),f&&S.addEventListener("resize",r)});const g=p&&v?fE(p,r,f):null;let E=-1,O=null;m&&(O=new ResizeObserver(S=>{let[D]=S;D&&D.target===p&&O&&o&&(O.unobserve(o),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var z;(z=O)==null||z.observe(o)})),r()}),p&&!y&&O.observe(p),o&&O.observe(o));let A,C=y?_l(l):null;y&&T();function T(){const S=_l(l);C&&!By(C,S)&&r(),C=S,A=requestAnimationFrame(T)}return r(),()=>{var S;w.forEach(D=>{u&&D.removeEventListener("scroll",r),f&&D.removeEventListener("resize",r)}),g?.(),(S=O)==null||S.disconnect(),O=null,y&&cancelAnimationFrame(A)}}const mE=V2,hE=G2,pE=B2,gE=Q2,vE=q2,Wg=H2,yE=X2,bE=(l,o,r)=>{const i=new Map,u=r??{},f={...uE,...u.platform,_c:i};return L2(l,o,{...u,platform:f})};var xE=typeof document<"u",SE=function(){},_s=xE?b.useLayoutEffect:SE;function js(l,o){if(l===o)return!0;if(typeof l!=typeof o)return!1;if(typeof l=="function"&&l.toString()===o.toString())return!0;let r,i,u;if(l&&o&&typeof l=="object"){if(Array.isArray(l)){if(r=l.length,r!==o.length)return!1;for(i=r;i--!==0;)if(!js(l[i],o[i]))return!1;return!0}if(u=Object.keys(l),r=u.length,r!==Object.keys(o).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(o,u[i]))return!1;for(i=r;i--!==0;){const f=u[i];if(!(f==="_owner"&&l.$$typeof)&&!js(l[f],o[f]))return!1}return!0}return l!==l&&o!==o}function qy(l){return typeof window>"u"?1:(l.ownerDocument.defaultView||window).devicePixelRatio||1}function ev(l,o){const r=qy(l);return Math.round(o*r)/r}function Ef(l){const o=b.useRef(l);return _s(()=>{o.current=l}),o}function wE(l){l===void 0&&(l={});const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:u,elements:{reference:f,floating:m}={},transform:v=!0,whileElementsMounted:y,open:p}=l,[w,g]=b.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[E,O]=b.useState(i);js(E,i)||O(i);const[A,C]=b.useState(null),[T,S]=b.useState(null),D=b.useCallback(F=>{F!==X.current&&(X.current=F,C(F))},[]),z=b.useCallback(F=>{F!==K.current&&(K.current=F,S(F))},[]),k=f||A,I=m||T,X=b.useRef(null),K=b.useRef(null),G=b.useRef(w),ae=y!=null,me=Ef(y),ge=Ef(u),U=Ef(p),te=b.useCallback(()=>{if(!X.current||!K.current)return;const F={placement:o,strategy:r,middleware:E};ge.current&&(F.platform=ge.current),bE(X.current,K.current,F).then(oe=>{const P={...oe,isPositioned:U.current!==!1};fe.current&&!js(G.current,P)&&(G.current=P,Ro.flushSync(()=>{g(P)}))})},[E,o,r,ge,U]);_s(()=>{p===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[p]);const fe=b.useRef(!1);_s(()=>(fe.current=!0,()=>{fe.current=!1}),[]),_s(()=>{if(k&&(X.current=k),I&&(K.current=I),k&&I){if(me.current)return me.current(k,I,te);te()}},[k,I,te,me,ae]);const he=b.useMemo(()=>({reference:X,floating:K,setReference:D,setFloating:z}),[D,z]),j=b.useMemo(()=>({reference:k,floating:I}),[k,I]),Y=b.useMemo(()=>{const F={position:r,left:0,top:0};if(!j.floating)return F;const oe=ev(j.floating,w.x),P=ev(j.floating,w.y);return v?{...F,transform:"translate("+oe+"px, "+P+"px)",...qy(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:oe,top:P}},[r,v,j.floating,w.x,w.y]);return b.useMemo(()=>({...w,update:te,refs:he,elements:j,floatingStyles:Y}),[w,te,he,j,Y])}const EE=l=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:l,fn(r){const{element:i,padding:u}=typeof l=="function"?l(r):l;return i&&o(i)?i.current!=null?Wg({element:i.current,padding:u}).fn(r):{}:i?Wg({element:i,padding:u}).fn(r):{}}}},CE=(l,o)=>{const r=mE(l);return{name:r.name,fn:r.fn,options:[l,o]}},TE=(l,o)=>{const r=hE(l);return{name:r.name,fn:r.fn,options:[l,o]}},AE=(l,o)=>({fn:yE(l).fn,options:[l,o]}),_E=(l,o)=>{const r=pE(l);return{name:r.name,fn:r.fn,options:[l,o]}},OE=(l,o)=>{const r=gE(l);return{name:r.name,fn:r.fn,options:[l,o]}},RE=(l,o)=>{const r=vE(l);return{name:r.name,fn:r.fn,options:[l,o]}},NE=(l,o)=>{const r=EE(l);return{name:r.name,fn:r.fn,options:[l,o]}};var jE=Object.defineProperty,DE=(l,o)=>jE(l,"name",{value:o,configurable:!0}),zE=b.forwardRef(DE(function(o,r){const{children:i,width:u=10,height:f=5,...m}=o;return h.jsx(Ie.svg,{...m,ref:r,width:u,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:o.asChild?i:h.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),ME=zE,UE=Object.defineProperty,ca=(l,o)=>UE(l,"name",{value:o,configurable:!0}),Yy="Popper",[Vy,Vs]=Pa(Yy),[kE,Gy]=Vy(Yy),LE=ca(l=>{const{__scopePopper:o,children:r}=l,[i,u]=b.useState(null),[f,m]=b.useState(void 0);return h.jsx(kE,{scope:o,anchor:i,onAnchorChange:u,placementState:f,setPlacementState:m,children:r})},"Popper"),HE="PopperAnchor",BE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,virtualRef:u,...f}=o,m=Gy(HE,i),v=b.useRef(null),y=m.onAnchorChange,p=b.useCallback(C=>{v.current=C,C&&y(C)},[y]),w=Xe(r,p),g=b.useRef(null);b.useEffect(()=>{if(!u)return;const C=g.current;g.current=u.current,C!==g.current&&y(g.current)});const E=m.placementState&&Gs(m.placementState),O=E?.[0],A=E?.[1];return u?null:h.jsx(Ie.div,{"data-radix-popper-side":O,"data-radix-popper-align":A,...f,ref:w})},"PopperAnchor")),Xy="PopperContent",[qE,YE]=Vy(Xy),VE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,side:u="bottom",sideOffset:f=0,align:m="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:p=!0,collisionBoundary:w=[],collisionPadding:g=0,sticky:E="partial",hideWhenDetached:O=!1,updatePositionStrategy:A="optimized",onPlaced:C,...T}=o,S=Gy(Xy,i),[D,z]=b.useState(null),k=Xe(r,z),[I,X]=b.useState(null),K=Ry(I),G=K?.width??0,ae=K?.height??0,me=u+(m!=="center"?"-"+m:""),ge=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(w)?w:[w],te=U.length>0,fe={padding:ge,boundary:U.filter(Qy),altBoundary:te},{refs:he,floatingStyles:j,placement:Y,isPositioned:F,middlewareData:oe}=wE({strategy:"fixed",placement:me,whileElementsMounted:ca((...re)=>dE(...re,{animationFrame:A==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[CE({mainAxis:f+ae,alignmentAxis:v}),p&&TE({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?AE():void 0,...fe}),p&&_E({...fe}),OE({...fe,apply:ca(({elements:re,rects:Le,availableWidth:Ce,availableHeight:Te})=>{const{width:He,height:Ze}=Le.reference,dt=re.floating.style;dt.setProperty("--radix-popper-available-width",`${Ce}px`),dt.setProperty("--radix-popper-available-height",`${Te}px`),dt.setProperty("--radix-popper-anchor-width",`${He}px`),dt.setProperty("--radix-popper-anchor-height",`${Ze}px`)},"apply")}),I&&NE({element:I,padding:y}),ZE({arrowWidth:G,arrowHeight:ae}),O&&RE({strategy:"referenceHidden",...fe,boundary:te?fe.boundary:void 0})]}),P=S.setPlacementState;at(()=>(P(Y),()=>{P(void 0)}),[Y,P]);const[R,V]=Gs(Y),Z=kn(C);at(()=>{F&&Z?.()},[F,Z]);const W=oe.arrow?.x,ee=oe.arrow?.y,ie=oe.arrow?.centerOffset!==0,[ye,ne]=b.useState();return at(()=>{D&&ne(window.getComputedStyle(D).zIndex)},[D]),h.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:F?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(" "),...oe.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:o.dir,children:h.jsx(qE,{scope:i,placedSide:R,placedAlign:V,onArrowChange:X,arrowX:W,arrowY:ee,shouldHideArrow:ie,children:h.jsx(Ie.div,{"data-side":R,"data-align":V,...T,ref:k,style:{...T.style,animation:F?T.style?.animation:"none"}})})})},"PopperContent")),GE="PopperArrow",XE={top:"bottom",right:"left",bottom:"top",left:"right"},QE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,...u}=o,f=YE(GE,i),m=XE[f.placedSide];return h.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:h.jsx(ME,{...u,ref:r,style:{...u.style,display:"block"}})})},"PopperArrow"));function Qy(l){return l!==null}ca(Qy,"isNotNull");var ZE=ca(l=>({name:"transformOrigin",options:l,fn(o){const{placement:r,rects:i,middlewareData:u}=o,m=u.arrow?.centerOffset!==0,v=m?0:l.arrowWidth,y=m?0:l.arrowHeight,[p,w]=Gs(r),g={start:"0%",center:"50%",end:"100%"}[w],E=(u.arrow?.x??0)+v/2,O=(u.arrow?.y??0)+y/2;let A="",C="";return p==="bottom"?(A=m?g:`${E}px`,C=`${-y}px`):p==="top"?(A=m?g:`${E}px`,C=`${i.floating.height+y}px`):p==="right"?(A=`${-y}px`,C=m?g:`${O}px`):p==="left"&&(A=`${i.floating.width+y}px`,C=m?g:`${O}px`),{data:{x:A,y:C}}}}),"transformOrigin");function Gs(l){const[o,r="center"]=l.split("-");return[o,r]}ca(Gs,"getSideAndAlignFromPlacement");var Zy=LE,Ky=BE,$y=VE,KE=QE,$E=Object.defineProperty,PE=(l,o)=>$E(l,"name",{value:o,configurable:!0}),JE=b.forwardRef(PE(function(o,r){return h.jsx(Ie.label,{...o,ref:r,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(o.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}})},"Label")),IE=JE,FE=Object.defineProperty,WE=(l,o)=>FE(l,"name",{value:o,configurable:!0});function Py(l){const o=b.useRef({value:l,previous:l});return b.useMemo(()=>(o.current.value!==l&&(o.current.previous=o.current.value,o.current.value=l),o.current.previous),[l])}WE(Py,"usePrevious");var eC=Object.defineProperty,tC=(l,o)=>eC(l,"name",{value:o,configurable:!0});function Xf(l,[o,r]){return Math.min(r,Math.max(o,l))}tC(Xf,"clamp");var nC=Object.defineProperty,ze=(l,o)=>nC(l,"name",{value:o,configurable:!0}),aC=[" ","Enter","ArrowUp","ArrowDown"],lC=[" ","Enter"],Oo="Select",[Xs,Qs,oC]=Yv(Oo),[Rl,BA]=Pa(Oo,[oC,Vs]),pd=Vs(),[iC,Ia]=Rl(Oo),[rC,sC]=Rl(Oo);function Jy(l){const{__scopeSelect:o,children:r,open:i,defaultOpen:u,onOpenChange:f,value:m,defaultValue:v,onValueChange:y,dir:p,name:w,autoComplete:g,disabled:E,required:O,form:A,internal_do_not_use_render:C}=l,T=pd(o),[S,D]=b.useState(null),[z,k]=b.useState(null),[I,X]=b.useState(!1),K=ny(p),[G,ae]=ki({prop:i,defaultProp:u??!1,onChange:f,caller:Oo}),[me,ge]=ki({prop:m,defaultProp:v,onChange:y,caller:Oo}),U=b.useRef(null),te=b.useRef(me);b.useEffect(()=>{const V=A?S?.ownerDocument.getElementById(A):S?.form;if(V instanceof HTMLFormElement){const Z=ze(()=>ge(te.current),"reset");return V.addEventListener("reset",Z),()=>V.removeEventListener("reset",Z)}},[A,S,ge]);const fe=S?!!A||!!S.closest("form"):!0,[he,j]=b.useState(new Set),Y=Tl(),F=Array.from(he).map(V=>V.props.value).join(";"),oe=b.useCallback(V=>{j(Z=>new Set(Z).add(V))},[]),P=b.useCallback(V=>{j(Z=>{const W=new Set(Z);return W.delete(V),W})},[]),R={required:O,trigger:S,onTriggerChange:D,valueNode:z,onValueNodeChange:k,valueNodeHasChildren:I,onValueNodeHasChildrenChange:X,contentId:Y,value:me,onValueChange:ge,open:G,onOpenChange:ae,dir:K,triggerPointerDownPosRef:U,disabled:E,name:w,autoComplete:g,form:A,nativeOptions:he,nativeSelectKey:F,isFormControl:fe};return h.jsx(Zy,{...T,children:h.jsx(iC,{scope:o,...R,children:h.jsx(Xs.Provider,{scope:o,children:h.jsx(rC,{scope:o,onNativeOptionAdd:oe,onNativeOptionRemove:P,children:e0(C)?C(R):r})})})})}ze(Jy,"SelectProvider");var cC=ze(l=>{const{__scopeSelect:o,children:r,...i}=l;return h.jsx(Jy,{__scopeSelect:o,...i,internal_do_not_use_render:({isFormControl:u})=>h.jsxs(h.Fragment,{children:[r,u?h.jsx(UC,{__scopeSelect:o}):null]})})},"Select"),uC="SelectTrigger",fC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,disabled:u=!1,...f}=o,m=pd(i),v=Ia(uC,i),y=v.disabled||u,p=Xe(r,v.onTriggerChange),w=Qs(i),g=b.useRef("touch"),[E,O,A]=vd(T=>{const S=w().filter(k=>!k.disabled),D=S.find(k=>k.value===v.value),z=yd(S,T,D);z!==void 0&&v.onValueChange(z.value)}),C=ze(T=>{y||(v.onOpenChange(!0),A()),T&&(v.triggerPointerDownPosRef.current={x:Math.round(T.pageX),y:Math.round(T.pageY)})},"handleOpen");return h.jsx(Ky,{asChild:!0,...m,children:h.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":v.open?v.contentId:void 0,"aria-expanded":v.open,"aria-required":v.required,"aria-autocomplete":"none",dir:v.dir,"data-state":v.open?"open":"closed",disabled:y,"data-disabled":y?"":void 0,"data-placeholder":Xi(v.value)?"":void 0,...f,ref:p,onClick:De(f.onClick,T=>{T.currentTarget.focus(),g.current!=="mouse"&&C(T)}),onPointerDown:De(f.onPointerDown,T=>{g.current=T.pointerType;const S=T.target;S.hasPointerCapture(T.pointerId)&&S.releasePointerCapture(T.pointerId),T.button===0&&T.ctrlKey===!1&&T.pointerType==="mouse"&&(C(T),T.preventDefault())}),onKeyDown:De(f.onKeyDown,T=>{const S=E.current!=="";!(T.ctrlKey||T.altKey||T.metaKey)&&T.key.length===1&&O(T.key),!(S&&T.key===" ")&&aC.includes(T.key)&&(C(),T.preventDefault())})})})},"SelectTrigger")),dC="SelectValue",mC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,className:u,style:f,children:m,placeholder:v="",...y}=o,p=Ia(dC,i),{onValueNodeHasChildrenChange:w}=p,g=m!==void 0,E=Xe(r,p.onValueNodeChange);at(()=>{w(g)},[w,g]);const O=Xi(p.value);return h.jsx(Ie.span,{...y,asChild:O?!1:y.asChild,ref:E,style:{pointerEvents:"none"},children:h.jsx(b.Fragment,{children:O?v:m},O?"placeholder":"value")})},"SelectValue")),hC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,children:u,...f}=o;return h.jsx(Ie.span,{"aria-hidden":!0,...f,ref:r,children:u||"▼"})},"SelectIcon")),pC="SelectPortal",[gC,vC]=Rl(pC,{forceMount:void 0}),yC=ze(l=>{const{__scopeSelect:o,forceMount:r,...i}=l;return h.jsx(gC,{scope:l.__scopeSelect,forceMount:r,children:h.jsx(od,{asChild:!0,...i})})},"SelectPortal"),Ol="SelectContent",bC=b.forwardRef(ze(function(o,r){const i=vC(Ol,o.__scopeSelect),{forceMount:u=i.forceMount,...f}=o,m=Ia(Ol,o.__scopeSelect),[v,y]=b.useState();return at(()=>{y(new DocumentFragment)},[]),h.jsx(jo,{present:u||m.open,children:({present:p})=>p?h.jsx(wC,{...f,ref:r}):h.jsx(xC,{...f,fragment:v})})},"SelectContent")),xC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,children:u,fragment:f}=o;return f?Ro.createPortal(h.jsx(Iy,{scope:i,children:h.jsx(Xs.Slot,{scope:i,children:h.jsx("div",{ref:r,children:u})})}),f):null},"SelectContentFragment")),Sn=10,[Iy,Nl]=Rl(Ol),SC=ua("SelectContent.RemoveScroll"),wC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i}=o,{position:u="item-aligned",onCloseAutoFocus:f,onEscapeKeyDown:m,onPointerDownOutside:v,side:y,sideOffset:p,align:w,alignOffset:g,arrowPadding:E,collisionBoundary:O,collisionPadding:A,sticky:C,hideWhenDetached:T,avoidCollisions:S,...D}=o,z=Ia(Ol,i),[k,I]=b.useState(null),[X,K]=b.useState(null),G=Xe(r,I),[ae,me]=b.useState(null),[ge,U]=b.useState(null),te=Qs(i),[fe,he]=b.useState(!1),j=b.useRef(!1);b.useEffect(()=>{if(k)return wy(k)},[k]),Ms();const Y=b.useCallback(ne=>{const[re,...Le]=te().map(He=>He.ref.current),[Ce]=Le.slice(-1),Te=document.activeElement;for(const He of ne)if(He===Te||(He?.scrollIntoView({block:"nearest"}),He===re&&X&&(X.scrollTop=0),He===Ce&&X&&(X.scrollTop=X.scrollHeight),He?.focus(),document.activeElement!==Te))return},[te,X]),F=b.useCallback(()=>Y([ae,k]),[Y,ae,k]);b.useEffect(()=>{fe&&F()},[fe,F]);const{onOpenChange:oe,triggerPointerDownPosRef:P}=z;b.useEffect(()=>{if(k){let ne={x:0,y:0};const re=ze(Ce=>{ne={x:Math.abs(Math.round(Ce.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(Ce.pageY)-(P.current?.y??0))}},"handlePointerMove"),Le=ze(Ce=>{ne.x<=10&&ne.y<=10?Ce.preventDefault():Ce.composedPath().includes(k)||oe(!1),document.removeEventListener("pointermove",re),P.current=null},"handlePointerUp");return P.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Le,{capture:!0})}}},[k,oe,P]),b.useEffect(()=>{const ne=ze(()=>oe(!1),"close");return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[oe]);const[R,V]=vd(ne=>{const re=te().filter(Te=>!Te.disabled),Le=re.find(Te=>Te.ref.current===document.activeElement),Ce=yd(re,ne,Le);Ce&&setTimeout(()=>Ce.ref.current?.focus())}),Z=b.useCallback((ne,re,Le)=>{const Ce=!j.current&&!Le;(z.value!==void 0&&z.value===re||Ce)&&(me(ne),Ce&&(j.current=!0))},[z.value]),W=b.useCallback(()=>k?.focus(),[k]),ee=b.useCallback((ne,re,Le)=>{const Ce=!j.current&&!Le;(z.value!==void 0&&z.value===re||Ce)&&U(ne)},[z.value]),ie=u==="popper"?tv:EC,ye=ie===tv?{side:y,sideOffset:p,align:w,alignOffset:g,arrowPadding:E,collisionBoundary:O,collisionPadding:A,sticky:C,hideWhenDetached:T,avoidCollisions:S}:{};return h.jsx(Iy,{scope:i,content:k,viewport:X,onViewportChange:K,itemRefCallback:Z,selectedItem:ae,onItemLeave:W,itemTextRefCallback:ee,focusSelectedItem:F,selectedItemText:ge,position:u,isPositioned:fe,searchRef:R,children:h.jsx(rd,{as:SC,allowPinchZoom:!0,children:h.jsx(ry,{asChild:!0,trapped:z.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:De(f,ne=>{z.trigger?.focus({preventScroll:!0}),ne.preventDefault()}),children:h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>z.onOpenChange(!1),children:h.jsx(ie,{role:"listbox",id:z.contentId,"data-state":z.open?"open":"closed",dir:z.dir,onContextMenu:ne=>ne.preventDefault(),...D,...ye,onPlaced:()=>he(!0),ref:G,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:De(D.onKeyDown,ne=>{const re=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!re&&ne.key.length===1&&V(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let Ce=te().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Te=ne.target,He=Ce.indexOf(Te);Ce=Ce.slice(He+1)}setTimeout(()=>Y(Ce)),ne.preventDefault()}})})})})})})},"SelectContentImpl")),EC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,onPlaced:u,...f}=o,m=Ia(Ol,i),v=Nl(Ol,i),[y,p]=b.useState(null),[w,g]=b.useState(null),E=Xe(r,g),O=Qs(i),A=b.useRef(!1),C=b.useRef(!0),{viewport:T,selectedItem:S,selectedItemText:D,focusSelectedItem:z}=v,k=b.useCallback(()=>{if(m.trigger&&m.valueNode&&y&&w&&T&&S&&D){const G=m.trigger.getBoundingClientRect(),ae=w.getBoundingClientRect(),me=m.valueNode.getBoundingClientRect(),ge=D.getBoundingClientRect();if(m.dir!=="rtl"){const Te=ge.left-ae.left,He=me.left-Te,Ze=G.left-He,dt=G.width+Ze,Cn=Math.max(dt,ae.width),pn=window.innerWidth-Sn,Bn=Xf(He,[Sn,Math.max(Sn,pn-Cn)]);y.style.minWidth=dt+"px",y.style.left=Bn+"px"}else{const Te=ae.right-ge.right,He=window.innerWidth-me.right-Te,Ze=window.innerWidth-G.right-He,dt=G.width+Ze,Cn=Math.max(dt,ae.width),pn=window.innerWidth-Sn,Bn=Xf(He,[Sn,Math.max(Sn,pn-Cn)]);y.style.minWidth=dt+"px",y.style.right=Bn+"px"}const U=O(),te=window.innerHeight-Sn*2,fe=T.scrollHeight,he=window.getComputedStyle(w),j=parseInt(he.borderTopWidth,10),Y=parseInt(he.paddingTop,10),F=parseInt(he.borderBottomWidth,10),oe=parseInt(he.paddingBottom,10),P=j+Y+fe+oe+F,R=Math.min(S.offsetHeight*5,P),V=window.getComputedStyle(T),Z=parseInt(V.paddingTop,10),W=parseInt(V.paddingBottom,10),ee=G.top+G.height/2-Sn,ie=te-ee,ye=S.offsetHeight/2,ne=S.offsetTop+ye,re=j+Y+ne,Le=P-re;if(re<=ee){const Te=U.length>0&&S===U[U.length-1].ref.current;y.style.bottom="0px";const He=w.clientHeight-T.offsetTop-T.offsetHeight,Ze=Math.max(ie,ye+(Te?W:0)+He+F),dt=re+Ze;y.style.height=dt+"px"}else{const Te=U.length>0&&S===U[0].ref.current;y.style.top="0px";const Ze=Math.max(ee,j+T.offsetTop+(Te?Z:0)+ye)+Le;y.style.height=Ze+"px",T.scrollTop=re-ee+T.offsetTop}y.style.margin=`${Sn}px 0`,y.style.minHeight=R+"px",y.style.maxHeight=te+"px",u?.(),requestAnimationFrame(()=>A.current=!0)}},[O,m.trigger,m.valueNode,y,w,T,S,D,m.dir,u]);at(()=>k(),[k]);const[I,X]=b.useState();at(()=>{w&&X(window.getComputedStyle(w).zIndex)},[w]);const K=b.useCallback(G=>{G&&C.current===!0&&(k(),z?.(),C.current=!1)},[k,z]);return h.jsx(CC,{scope:i,contentWrapper:y,shouldExpandOnScrollRef:A,onScrollButtonChange:K,children:h.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:h.jsx(Ie.div,{...f,ref:E,style:{boxSizing:"border-box",maxHeight:"100%",...f.style}})})})},"SelectItemAlignedPosition")),tv=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,align:u="start",collisionPadding:f=Sn,...m}=o,v=pd(i);return h.jsx($y,{...v,...m,ref:r,align:u,collisionPadding:f,style:{boxSizing:"border-box",...m.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[CC,gd]=Rl(Ol,{}),nv="SelectViewport",TC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,nonce:u,...f}=o,m=Nl(nv,i),v=gd(nv,i),y=Xe(r,m.onViewportChange),p=b.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),h.jsx(Xs.Slot,{scope:i,children:h.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...f,ref:y,style:{position:"relative",flex:1,overflow:"hidden auto",...f.style},onScroll:De(f.onScroll,w=>{const g=w.currentTarget,{contentWrapper:E,shouldExpandOnScrollRef:O}=v;if(O?.current&&E){const A=Math.abs(p.current-g.scrollTop);if(A>0){const C=window.innerHeight-Sn*2,T=parseFloat(E.style.minHeight),S=parseFloat(E.style.height),D=Math.max(T,S);if(D0?I:0,E.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),AC="SelectGroup",[qA,YA]=Rl(AC),Qf="SelectItem",[_C,Fy]=Rl(Qf),OC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,value:u,disabled:f=!1,textValue:m,...v}=o,y=Ia(Qf,i),p=Nl(Qf,i),w=y.value===u,[g,E]=b.useState(m??""),[O,A]=b.useState(!1),C=kn(k=>p.itemRefCallback?.(k,u,f)),T=Xe(r,C),S=Tl(),D=b.useRef("touch"),z=ze(()=>{f||(y.onValueChange(u),y.onOpenChange(!1))},"handleSelect");return h.jsx(_C,{scope:i,value:u,disabled:f,textId:S,isSelected:w,onItemTextChange:b.useCallback(k=>{E(I=>I||(k?.textContent??"").trim())},[]),children:h.jsx(Xs.ItemSlot,{scope:i,value:u,disabled:f,textValue:g,children:h.jsx(Ie.div,{role:"option","aria-labelledby":S,"data-highlighted":O?"":void 0,"aria-selected":w&&O,"data-state":w?"checked":"unchecked","aria-disabled":f||void 0,"data-disabled":f?"":void 0,tabIndex:f?void 0:-1,...v,ref:T,onFocus:De(v.onFocus,()=>A(!0)),onBlur:De(v.onBlur,()=>A(!1)),onClick:De(v.onClick,()=>{D.current!=="mouse"&&z()}),onPointerUp:De(v.onPointerUp,()=>{D.current==="mouse"&&z()}),onPointerDown:De(v.onPointerDown,k=>{D.current=k.pointerType}),onPointerMove:De(v.onPointerMove,k=>{D.current=k.pointerType,f?p.onItemLeave?.():D.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:De(v.onPointerLeave,k=>{k.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:De(v.onKeyDown,k=>{f||k.target!==k.currentTarget||p.searchRef?.current!==""&&k.key===" "||(lC.includes(k.key)&&z(),k.key===" "&&k.preventDefault())})})})})},"SelectItem")),hs="SelectItemText",RC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,className:u,style:f,...m}=o,v=Ia(hs,i),y=Nl(hs,i),p=Fy(hs,i),w=sC(hs,i),[g,E]=b.useState(null),O=kn(z=>y.itemTextRefCallback?.(z,p.value,p.disabled)),A=Xe(r,E,p.onItemTextChange,O),C=g?.textContent,T=b.useMemo(()=>h.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:S,onNativeOptionRemove:D}=w;return at(()=>(S(T),()=>D(T)),[S,D,T]),h.jsxs(h.Fragment,{children:[h.jsx(Ie.span,{id:p.textId,...m,ref:A}),p.isSelected&&v.valueNode&&!v.valueNodeHasChildren&&!Xi(v.value)?Ro.createPortal(m.children,v.valueNode):null]})},"SelectItemText")),NC="SelectItemIndicator",jC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,...u}=o;return Fy(NC,i).isSelected?h.jsx(Ie.span,{"aria-hidden":!0,...u,ref:r}):null},"SelectItemIndicator")),av="SelectScrollUpButton",DC=b.forwardRef(ze(function(o,r){const i=Nl(av,o.__scopeSelect),u=gd(av,o.__scopeSelect),[f,m]=b.useState(!1),v=Xe(r,u.onScrollButtonChange);return at(()=>{if(i.viewport&&i.isPositioned){let y=function(){const w=p.scrollTop>0;m(w)};ze(y,"handleScroll");const p=i.viewport;return y(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,i.isPositioned]),f?h.jsx(Wy,{...o,ref:v,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=i;y&&p&&(y.scrollTop=y.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),lv="SelectScrollDownButton",zC=b.forwardRef(ze(function(o,r){const i=Nl(lv,o.__scopeSelect),u=gd(lv,o.__scopeSelect),[f,m]=b.useState(!1),v=Xe(r,u.onScrollButtonChange);return at(()=>{if(i.viewport&&i.isPositioned){let y=function(){const w=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",y)}},[i.viewport,i.isPositioned]),f?h.jsx(Wy,{...o,ref:v,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=i;y&&p&&(y.scrollTop=y.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),Wy=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,onAutoScroll:u,...f}=o,m=Nl("SelectScrollButton",i),v=b.useRef(null),y=Qs(i),p=b.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null)},[]);return b.useEffect(()=>()=>p(),[p]),at(()=>{y().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[y]),h.jsx(Ie.div,{"aria-hidden":!0,...f,ref:r,style:{flexShrink:0,...f.style},onPointerDown:De(f.onPointerDown,()=>{v.current===null&&(v.current=window.setInterval(u,50))}),onPointerMove:De(f.onPointerMove,()=>{m.onItemLeave?.(),v.current===null&&(v.current=window.setInterval(u,50))}),onPointerLeave:De(f.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),MC="SelectBubbleInput",UC=b.forwardRef(ze(function({__scopeSelect:o,...r},i){const u=Ia(MC,o),{value:f,onValueChange:m,required:v,disabled:y,name:p,autoComplete:w,form:g}=u,{nativeOptions:E,nativeSelectKey:O}=u,A=b.useRef(null),C=Xe(i,A),T=f??"",S=Py(T),D=Array.from(E).some(z=>(z.props.value??"")==="");return b.useEffect(()=>{const z=A.current;if(!z)return;const k=window.HTMLSelectElement.prototype,X=Object.getOwnPropertyDescriptor(k,"value").set;if(S!==T&&X){const K=new Event("change",{bubbles:!0});X.call(z,T),z.dispatchEvent(K)}},[S,T]),h.jsxs(Ie.select,{"aria-hidden":!0,required:v,tabIndex:-1,name:p,autoComplete:w,disabled:y,form:g,onChange:z=>m(z.target.value),...r,style:{...Bv,...r.style},ref:C,defaultValue:T,children:[Xi(f)&&!D?h.jsx("option",{value:""}):null,Array.from(E)]},O)},"SelectBubbleInput"));function e0(l){return typeof l=="function"}ze(e0,"isFunction");function Xi(l){return l===""||l===void 0}ze(Xi,"shouldShowPlaceholder");function vd(l){const o=kn(l),r=b.useRef(""),i=b.useRef(0),u=b.useCallback(m=>{const v=r.current+m;o(v),ze((function y(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>y(""),1e3))}),"updateSearch")(v)},[o]),f=b.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,u,f]}ze(vd,"useTypeaheadSearch");function yd(l,o,r){const u=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,f=r?l.indexOf(r):-1;let m=t0(l,Math.max(f,0));u.length===1&&(m=m.filter(p=>p!==r));const y=m.find(p=>p.textValue.toLowerCase().startsWith(u.toLowerCase()));return y!==r?y:void 0}ze(yd,"findNextItem");function t0(l,o){return l.map((r,i)=>l[(o+i)%l.length])}ze(t0,"wrapArray");var kC=Object.defineProperty,ft=(l,o)=>kC(l,"name",{value:o,configurable:!0}),[bd,VA]=Pa("Tooltip",[Vs]),Zs=Vs(),LC="TooltipProvider",HC=700,Zf="tooltip.open",[BC,xd]=bd(LC),qC=ft(l=>{const{__scopeTooltip:o,delayDuration:r=HC,skipDelayDuration:i=300,disableHoverableContent:u=!1,children:f}=l,m=b.useRef(!0),v=b.useRef(!1),y=b.useRef(0);return b.useEffect(()=>{const p=y.current;return()=>window.clearTimeout(p)},[]),h.jsx(BC,{scope:o,isOpenDelayedRef:m,delayDuration:r,onOpen:b.useCallback(()=>{i<=0||(window.clearTimeout(y.current),m.current=!1)},[i]),onClose:b.useCallback(()=>{i<=0||(window.clearTimeout(y.current),y.current=window.setTimeout(()=>m.current=!0,i))},[i]),isPointerInTransitRef:v,onPointerInTransitChange:b.useCallback(p=>{v.current=p},[]),disableHoverableContent:u,children:f})},"TooltipProvider"),Kf="Tooltip",[YC,Qi]=bd(Kf),VC=ft(l=>{const{__scopeTooltip:o,children:r,open:i,defaultOpen:u,onOpenChange:f,disableHoverableContent:m,delayDuration:v}=l,y=xd(Kf,l.__scopeTooltip),p=Zs(o),[w,g]=b.useState(null),[E,O]=b.useState(void 0),A=Tl(),C=b.useRef(0),T=m??y.disableHoverableContent,S=v??y.delayDuration,D=b.useRef(!1),[z,k]=ki({prop:i,defaultProp:u??!1,onChange:ft(me=>{me?(y.onOpen(),document.dispatchEvent(new CustomEvent(Zf))):y.onClose(),f?.(me)},"onChange"),caller:Kf}),I=b.useMemo(()=>z?D.current?"delayed-open":"instant-open":"closed",[z]),X=b.useCallback(()=>{window.clearTimeout(C.current),C.current=0,D.current=!1,k(!0)},[k]),K=b.useCallback(()=>{window.clearTimeout(C.current),C.current=0,k(!1)},[k]),G=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{D.current=!0,k(!0),C.current=0},S)},[S,k]);b.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]);const ae=E??A;return h.jsx(Zy,{...p,children:h.jsx(YC,{scope:o,contentId:ae,setContentId:O,open:z,stateAttribute:I,trigger:w,onTriggerChange:g,onTriggerEnter:b.useCallback(()=>{y.isOpenDelayedRef.current?G():X()},[y.isOpenDelayedRef,G,X]),onTriggerLeave:b.useCallback(()=>{T?K():(window.clearTimeout(C.current),C.current=0)},[K,T]),onOpen:X,onClose:K,disableHoverableContent:T,children:r})})},"Tooltip"),ov="TooltipTrigger",GC=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,...u}=o,f=Qi(ov,i),m=xd(ov,i),v=Zs(i),y=b.useRef(null),p=Xe(r,y,f.onTriggerChange),w=b.useRef(!1),g=b.useRef(!1),E=b.useCallback(()=>w.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",E),[E]),h.jsx(Ky,{asChild:!0,...v,children:h.jsx(Ie.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...u,ref:p,onPointerMove:De(o.onPointerMove,O=>{O.pointerType!=="touch"&&!g.current&&!m.isPointerInTransitRef.current&&(f.onTriggerEnter(),g.current=!0)}),onPointerLeave:De(o.onPointerLeave,()=>{f.onTriggerLeave(),g.current=!1}),onPointerDown:De(o.onPointerDown,()=>{f.open&&f.onClose(),w.current=!0,document.addEventListener("pointerup",E,{once:!0})}),onFocus:De(o.onFocus,()=>{w.current||f.onOpen()}),onBlur:De(o.onBlur,f.onClose),onClick:De(o.onClick,f.onClose)})})},"TooltipTrigger")),n0="TooltipPortal",[XC,QC]=bd(n0,{forceMount:void 0}),ZC=ft(l=>{const{__scopeTooltip:o,forceMount:r,children:i,container:u}=l,f=Qi(n0,o);return h.jsx(XC,{scope:o,forceMount:r,children:h.jsx(jo,{present:r||f.open,children:h.jsx(od,{asChild:!0,container:u,children:i})})})},"TooltipPortal"),qi="TooltipContent",KC=b.forwardRef(ft(function(o,r){const i=QC(qi,o.__scopeTooltip),{forceMount:u=i.forceMount,side:f="top",...m}=o,v=Qi(qi,o.__scopeTooltip);return h.jsx(jo,{present:u||v.open,children:v.disableHoverableContent?h.jsx(a0,{side:f,...m,ref:r}):h.jsx($C,{side:f,...m,ref:r})})},"TooltipContent")),$C=b.forwardRef(ft(function(o,r){const i=Qi(qi,o.__scopeTooltip),u=xd(qi,o.__scopeTooltip),f=b.useRef(null),m=Xe(r,f),[v,y]=b.useState(null),{trigger:p,onClose:w}=i,g=f.current,{onPointerInTransitChange:E}=u,O=b.useCallback(()=>{y(null),E(!1)},[E]),A=b.useCallback((C,T)=>{const S=C.currentTarget,D={x:C.clientX,y:C.clientY},z=l0(D,S.getBoundingClientRect()),k=o0(D,z),I=i0(T.getBoundingClientRect()),X=s0([...k,...I]);y(X),E(!0)},[E]);return b.useEffect(()=>()=>O(),[O]),b.useEffect(()=>{if(p&&g){const C=ft(S=>A(S,g),"handleTriggerLeave"),T=ft(S=>A(S,p),"handleContentLeave");return p.addEventListener("pointerleave",C),g.addEventListener("pointerleave",T),()=>{p.removeEventListener("pointerleave",C),g.removeEventListener("pointerleave",T)}}},[p,g,A,O]),b.useEffect(()=>{if(v){const C=ft(T=>{const S=T.target,D={x:T.clientX,y:T.clientY},z=p?.contains(S)||g?.contains(S),k=!r0(D,v);z?O():k&&(O(),w())},"handleTrackPointerGrace");return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,g,v,w,O]),h.jsx(a0,{...o,ref:m})},"TooltipContentHoverable")),PC=zv("TooltipContent"),a0=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,children:u,"aria-label":f,id:m,onEscapeKeyDown:v,onPointerDownOutside:y,...p}=o,w=Qi(qi,i),g=Zs(i),{onClose:E}=w;b.useEffect(()=>(document.addEventListener(Zf,E),()=>document.removeEventListener(Zf,E)),[E]),b.useEffect(()=>{if(w.trigger){const A=ft(C=>{C.target instanceof Node&&C.target.contains(w.trigger)&&E()},"handleScroll");return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[w.trigger,E]);const{setContentId:O}=w;return at(()=>(O(m),()=>{O(void 0)}),[m,O]),h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:v,onPointerDownOutside:y,onFocusOutside:A=>A.preventDefault(),onDismiss:E,children:h.jsxs($y,{"data-state":w.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:w.contentId,...g,...p,ref:r,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(PC,{children:u}),f?h.jsx(bS,{id:w.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl")),JC=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,...u}=o,f=Zs(i);return h.jsx(KE,{...f,...u,ref:r})},"TooltipArrow"));function l0(l,o){const r=Math.abs(o.top-l.y),i=Math.abs(o.bottom-l.y),u=Math.abs(o.right-l.x),f=Math.abs(o.left-l.x);switch(Math.min(r,i,u,f)){case f:return"left";case u:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}ft(l0,"getExitSideFromRect");function o0(l,o,r=5){const i=[];switch(o){case"top":i.push({x:l.x-r,y:l.y+r},{x:l.x+r,y:l.y+r});break;case"bottom":i.push({x:l.x-r,y:l.y-r},{x:l.x+r,y:l.y-r});break;case"left":i.push({x:l.x+r,y:l.y-r},{x:l.x+r,y:l.y+r});break;case"right":i.push({x:l.x-r,y:l.y-r},{x:l.x-r,y:l.y+r});break}return i}ft(o0,"getPaddedExitPoints");function i0(l){const{top:o,right:r,bottom:i,left:u}=l;return[{x:u,y:o},{x:r,y:o},{x:r,y:i},{x:u,y:i}]}ft(i0,"getPointsFromRect");function r0(l,o){const{x:r,y:i}=l;let u=!1;for(let f=0,m=o.length-1;fi!=E>i&&r<(g-p)*(i-w)/(E-w)+p&&(u=!u)}return u}ft(r0,"isPointInPolygon");function s0(l){const o=l.slice();return o.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),c0(o)}ft(s0,"getHull");function c0(l){if(l.length<=1)return l.slice();const o=[];for(let i=0;i=2;){const f=o[o.length-1],m=o[o.length-2];if((f.x-m.x)*(u.y-m.y)>=(f.y-m.y)*(u.x-m.x))o.pop();else break}o.push(u)}o.pop();const r=[];for(let i=l.length-1;i>=0;i--){const u=l[i];for(;r.length>=2;){const f=r[r.length-1],m=r[r.length-2];if((f.x-m.x)*(u.y-m.y)>=(f.y-m.y)*(u.x-m.x))r.pop();else break}r.push(u)}return r.pop(),o.length===1&&r.length===1&&o[0].x===r[0].x&&o[0].y===r[0].y?o:o.concat(r)}ft(c0,"getHullPresorted");var IC=qC,FC=VC,WC=GC,eT=ZC,tT=KC,nT=JC;const aT=(l,o)=>{const r=new Array(l.length+o.length);for(let i=0;i({classGroupId:l,validator:o}),u0=(l=new Map,o=null,r)=>({nextPart:l,validators:o,classGroupId:r}),Ds="-",iv=[],oT="arbitrary..",iT=l=>{const o=sT(l),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=l;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return rT(m);const v=m.split(Ds),y=v[0]===""&&v.length>1?1:0;return f0(v,y,o)},getConflictingClassGroupIds:(m,v)=>{if(v){const y=i[m],p=r[m];return y?p?aT(p,y):y:p||iv}return r[m]||iv}}},f0=(l,o,r)=>{if(l.length-o===0)return r.classGroupId;const u=l[o],f=r.nextPart.get(u);if(f){const p=f0(l,o+1,f);if(p)return p}const m=r.validators;if(m===null)return;const v=o===0?l.join(Ds):l.slice(o).join(Ds),y=m.length;for(let p=0;pl.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=l.slice(1,-1),r=o.indexOf(":"),i=o.slice(0,r);return i?oT+i:void 0})(),sT=l=>{const{theme:o,classGroups:r}=l;return cT(r,o)},cT=(l,o)=>{const r=u0();for(const i in l){const u=l[i];Sd(u,r,i,o)}return r},Sd=(l,o,r,i)=>{const u=l.length;for(let f=0;f{if(typeof l=="string"){fT(l,o,r);return}if(typeof l=="function"){dT(l,o,r,i);return}mT(l,o,r,i)},fT=(l,o,r)=>{const i=l===""?o:d0(o,l);i.classGroupId=r},dT=(l,o,r,i)=>{if(hT(l)){Sd(l(i),o,r,i);return}o.validators===null&&(o.validators=[]),o.validators.push(lT(r,l))},mT=(l,o,r,i)=>{const u=Object.entries(l),f=u.length;for(let m=0;m{let r=l;const i=o.split(Ds),u=i.length;for(let f=0;f"isThemeGetter"in l&&l.isThemeGetter===!0,pT=l=>{if(l<1)return{get:()=>{},set:()=>{}};let o=0,r=Object.create(null),i=Object.create(null);const u=(f,m)=>{r[f]=m,o++,o>l&&(o=0,i=r,r=Object.create(null))};return{get(f){let m=r[f];if(m!==void 0)return m;if((m=i[f])!==void 0)return u(f,m),m},set(f,m){f in r?r[f]=m:u(f,m)}}},$f="!",rv=":",gT=[],sv=(l,o,r,i,u)=>({modifiers:l,hasImportantModifier:o,baseClassName:r,maybePostfixModifierPosition:i,isExternal:u}),vT=l=>{const{prefix:o,experimentalParseClassName:r}=l;let i=u=>{const f=[];let m=0,v=0,y=0,p;const w=u.length;for(let C=0;Cy?p-y:void 0;return sv(f,O,E,A)};if(o){const u=o+rv,f=i;i=m=>m.startsWith(u)?f(m.slice(u.length)):sv(gT,!1,m,void 0,!0)}if(r){const u=i;i=f=>r({className:f,parseClassName:u})}return i},yT=l=>{const o=new Map;return l.orderSensitiveModifiers.forEach((r,i)=>{o.set(r,1e6+i)}),r=>{const i=[];let u=[];for(let f=0;f0&&(u.sort(),i.push(...u),u=[]),i.push(m)):u.push(m)}return u.length>0&&(u.sort(),i.push(...u)),i}},bT=l=>({cache:pT(l.cacheSize),parseClassName:vT(l),sortModifiers:yT(l),postfixLookupClassGroupIds:xT(l),...iT(l)}),xT=l=>{const o=Object.create(null),r=l.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:u,sortModifiers:f,postfixLookupClassGroupIds:m}=o,v=[],y=l.trim().split(ST);let p="";for(let w=y.length-1;w>=0;w-=1){const g=y[w],{isExternal:E,modifiers:O,hasImportantModifier:A,baseClassName:C,maybePostfixModifierPosition:T}=r(g);if(E){p=g+(p.length>0?" "+p:p);continue}let S=!!T,D;if(S){const K=C.substring(0,T);D=i(K);const G=D&&m[D]?i(C):void 0;G&&G!==D&&(D=G,S=!1)}else D=i(C);if(!D){if(!S){p=g+(p.length>0?" "+p:p);continue}if(D=i(C),!D){p=g+(p.length>0?" "+p:p);continue}S=!1}const z=O.length===0?"":O.length===1?O[0]:f(O).join(":"),k=A?z+$f:z,I=k+D;if(v.indexOf(I)>-1)continue;v.push(I);const X=u(D,S);for(let K=0;K0?" "+p:p)}return p},ET=(...l)=>{let o=0,r,i,u="";for(;o{if(typeof l=="string")return l;let o,r="";for(let i=0;i{let r,i,u,f;const m=y=>{const p=o.reduce((w,g)=>g(w),l());return r=bT(p),i=r.cache.get,u=r.cache.set,f=v,v(y)},v=y=>{const p=i(y);if(p)return p;const w=wT(y,r);return u(y,w),w};return f=m,(...y)=>f(ET(...y))},TT=[],ut=l=>{const o=r=>r[l]||TT;return o.isThemeGetter=!0,o},h0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,p0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,AT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_T=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,RT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,NT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=l=>AT.test(l),Ae=l=>!!l&&!Number.isNaN(Number(l)),Dn=l=>!!l&&Number.isInteger(Number(l)),Cf=l=>l.endsWith("%")&&Ae(l.slice(0,-1)),oa=l=>_T.test(l),g0=()=>!0,DT=l=>OT.test(l)&&!RT.test(l),wd=()=>!1,zT=l=>NT.test(l),MT=l=>jT.test(l),UT=l=>!se(l)&&!ce(l),kT=l=>l.startsWith("@container")&&(l[10]==="/"&&l[11]!==void 0||l[11]==="s"&&l[16]!==void 0&&l.startsWith("-size/",10)||l[11]==="n"&&l[18]!==void 0&&l.startsWith("-normal/",10)),LT=l=>Fa(l,b0,wd),se=l=>h0.test(l),El=l=>Fa(l,x0,DT),cv=l=>Fa(l,QT,Ae),HT=l=>Fa(l,w0,g0),BT=l=>Fa(l,S0,wd),uv=l=>Fa(l,v0,wd),qT=l=>Fa(l,y0,MT),ps=l=>Fa(l,E0,zT),ce=l=>p0.test(l),Ni=l=>jl(l,x0),YT=l=>jl(l,S0),fv=l=>jl(l,v0),VT=l=>jl(l,b0),GT=l=>jl(l,y0),gs=l=>jl(l,E0,!0),XT=l=>jl(l,w0,!0),Fa=(l,o,r)=>{const i=h0.exec(l);return i?i[1]?o(i[1]):r(i[2]):!1},jl=(l,o,r=!1)=>{const i=p0.exec(l);return i?i[1]?o(i[1]):r:!1},v0=l=>l==="position"||l==="percentage",y0=l=>l==="image"||l==="url",b0=l=>l==="length"||l==="size"||l==="bg-size",x0=l=>l==="length",QT=l=>l==="number",S0=l=>l==="family-name",w0=l=>l==="number"||l==="weight",E0=l=>l==="shadow",ZT=()=>{const l=ut("color"),o=ut("font"),r=ut("text"),i=ut("font-weight"),u=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),v=ut("container"),y=ut("spacing"),p=ut("radius"),w=ut("shadow"),g=ut("inset-shadow"),E=ut("text-shadow"),O=ut("drop-shadow"),A=ut("blur"),C=ut("perspective"),T=ut("aspect"),S=ut("ease"),D=ut("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...k(),ce,se],X=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],G=()=>[ce,se,y],ae=()=>[Ga,"full","auto",...G()],me=()=>[Dn,"none","subgrid",ce,se],ge=()=>["auto",{span:["full",Dn,ce,se]},Dn,ce,se],U=()=>[Dn,"auto",ce,se],te=()=>["auto","min","max","fr",ce,se],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...G()],Y=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],F=()=>[Ga,"screen","full","dvw","lvw","svw","min","max","fit",...G()],oe=()=>[Ga,"screen","full","lh","dvh","lvh","svh","min","max","fit",...G()],P=()=>[l,ce,se],R=()=>[...k(),fv,uv,{position:[ce,se]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",VT,LT,{size:[ce,se]}],W=()=>[Cf,Ni,El],ee=()=>["","none","full",p,ce,se],ie=()=>["",Ae,Ni,El],ye=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ae,Cf,fv,uv],Le=()=>["","none",A,ce,se],Ce=()=>["none",Ae,ce,se],Te=()=>["none",Ae,ce,se],He=()=>[Ae,ce,se],Ze=()=>[Ga,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oa],breakpoint:[oa],color:[g0],container:[oa],"drop-shadow":[oa],ease:["in","out","in-out"],font:[UT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oa],shadow:[oa],spacing:["px",Ae],text:[oa],"text-shadow":[oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,se,ce,T]}],container:["container"],"container-type":[{"@container":["","normal","size",ce,se]}],"container-named":[kT],columns:[{columns:[Ae,se,ce,v]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",ce,se]}],basis:[{basis:[Ga,"full","auto",v,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,Ga,"auto","initial","none",se]}],grow:[{grow:["",Ae,ce,se]}],shrink:[{shrink:["",Ae,ce,se]}],order:[{order:[Dn,"first","last","none",ce,se]}],"grid-cols":[{"grid-cols":me()}],"col-start-end":[{col:ge()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":me()}],"row-start-end":[{row:ge()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pbs:[{pbs:G()}],pbe:[{pbe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...oe()]}],"min-block-size":[{"min-block":["auto",...oe()]}],"max-block-size":[{"max-block":["none",...oe()]}],w:[{w:[v,"screen",...Y()]}],"min-w":[{"min-w":[v,"screen","none",...Y()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[m]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",r,Ni,El]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,XT,HT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cf,se]}],"font-family":[{font:[YT,BT,o]}],"font-features":[{"font-features":[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,ce,se]}],"line-clamp":[{"line-clamp":[Ae,"none",ce,cv]}],leading:[{leading:[f,...G()]}],"list-image":[{"list-image":["none",ce,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",ce,El]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ae,"auto",ce,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"tab-size":[{tab:[Dn,ce,se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,ce,se],radial:["",ce,se],conic:[Dn,ce,se]},GT,qT]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,ce,se]}],"outline-w":[{outline:["",Ae,Ni,El]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",w,gs,ps]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",g,gs,ps]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ae,El]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",E,gs,ps]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ae,ce,se]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ce,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,se]}],filter:[{filter:["","none",ce,se]}],blur:[{blur:Le()}],brightness:[{brightness:[Ae,ce,se]}],contrast:[{contrast:[Ae,ce,se]}],"drop-shadow":[{"drop-shadow":["","none",O,gs,ps]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Ae,ce,se]}],"hue-rotate":[{"hue-rotate":[Ae,ce,se]}],invert:[{invert:["",Ae,ce,se]}],saturate:[{saturate:[Ae,ce,se]}],sepia:[{sepia:["",Ae,ce,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,se]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,ce,se]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,ce,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,ce,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,ce,se]}],"backdrop-invert":[{"backdrop-invert":["",Ae,ce,se]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,ce,se]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,ce,se]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,ce,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",ce,se]}],ease:[{ease:["linear","initial",S,ce,se]}],delay:[{delay:[Ae,ce,se]}],animate:[{animate:["none",D,ce,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ce,se]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[ce,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ze()}],"translate-x":[{"translate-x":Ze()}],"translate-y":[{"translate-y":Ze()}],"translate-z":[{"translate-z":Ze()}],"translate-none":["translate-none"],zoom:[{zoom:[Dn,ce,se]}],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mbs":[{"scroll-mbs":G()}],"scroll-mbe":[{"scroll-mbe":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pbs":[{"scroll-pbs":G()}],"scroll-pbe":[{"scroll-pbe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,se]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Ae,Ni,El,cv]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},KT=CT(ZT);function Se(...l){return KT(Rv(l))}const $T=Vi("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Cl({className:l,variant:o="default",asChild:r=!1,...i}){const u=r?jv:"span";return h.jsx(u,{"data-slot":"badge","data-variant":o,className:Se($T({variant:o}),l),...i})}const PT=Vi("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ct({className:l,variant:o="default",size:r="default",asChild:i=!1,...u}){const f=i?jv:"button";return h.jsx(f,{"data-slot":"button","data-variant":o,"data-size":r,className:Se(PT({variant:o,size:r,className:l})),...u})}function Ui({className:l,type:o,...r}){return h.jsx("input",{type:o,"data-slot":"input",className:Se("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",l),...r})}function JT({className:l,...o}){return h.jsx("div",{"data-slot":"table-container",tabIndex:0,role:"region","aria-label":"Feedback queue, scrollable",className:"relative w-full overflow-x-auto focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ring)]",children:h.jsx("table",{"data-slot":"table",className:Se("w-full caption-bottom text-sm",l),...o})})}function IT({className:l,...o}){return h.jsx("thead",{"data-slot":"table-header",className:Se("[&_tr]:border-b",l),...o})}function FT({className:l,...o}){return h.jsx("tbody",{"data-slot":"table-body",className:Se("[&_tr:last-child]:border-0",l),...o})}function vs({className:l,...o}){return h.jsx("tr",{"data-slot":"table-row",className:Se("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",l),...o})}function Xa({className:l,...o}){return h.jsx("th",{"data-slot":"table-head",className:Se("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...o})}function zn({className:l,...o}){return h.jsx("td",{"data-slot":"table-cell",className:Se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...o})}function WT({className:l,...o}){return h.jsx("caption",{"data-slot":"table-caption",className:Se("mt-4 text-sm text-muted-foreground",l),...o})}const eA=Vi("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Pf({className:l,variant:o,...r}){return h.jsx("div",{"data-slot":"alert",role:"alert",className:Se(eA({variant:o}),l),...r})}function Jf({className:l,...o}){return h.jsx("div",{"data-slot":"alert-title",className:Se("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",l),...o})}function If({className:l,...o}){return h.jsx("div",{"data-slot":"alert-description",className:Se("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",l),...o})}function dv({className:l,...o}){return h.jsx("div",{"data-slot":"empty",className:Se("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",l),...o})}function mv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-header",className:Se("flex max-w-sm flex-col items-center gap-2 text-center",l),...o})}function hv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-title",className:Se("text-lg font-medium tracking-tight",l),...o})}function pv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-description",className:Se("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",l),...o})}function To({className:l,...o}){return h.jsx("div",{"data-slot":"skeleton",className:Se("animate-pulse rounded-md bg-accent",l),...o})}function tA({delayDuration:l=0,...o}){return h.jsx(IC,{"data-slot":"tooltip-provider",delayDuration:l,...o})}function gv({...l}){return h.jsx(FC,{"data-slot":"tooltip",...l})}function vv({...l}){return h.jsx(WC,{"data-slot":"tooltip-trigger",...l})}function yv({className:l,sideOffset:o=0,children:r,...i}){return h.jsx(eT,{children:h.jsxs(tT,{"data-slot":"tooltip-content",sideOffset:o,className:Se("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",l),...i,children:[r,h.jsx(nT,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const ys=1e3;function Ff(l){const o=new Date(l).getTime();if(Number.isNaN(o))return"—";const r=Math.max(0,Math.round((Date.now()-o)/6e4));if(r<1)return"just now";if(r<60)return`${r}m`;const i=Math.round(r/60);if(i<24)return`${i}h`;const u=Math.round(i/24);return u<30?`${u}d`:`${Math.round(u/30)}mo`}function nA(){const l=new URLSearchParams(window.location.search),o=r=>l.get(r)??void 0;return{project:o("project"),status:o("status"),type:o("type"),severity:o("severity"),assignee_agent:o("assignee_agent")}}function aA(){return new URLSearchParams(window.location.search).get("q")??""}let bv;function lA(l,o){clearTimeout(bv),bv=setTimeout(()=>{try{oA(l,o)}catch{}},150)}function oA(l,o){const r=new URLSearchParams;for(const[u,f]of Object.entries(l))f&&r.set(u,f);o.trim()&&r.set("q",o.trim());const i=r.toString();window.history.replaceState({},"",i?`/queue?${i}`:"/queue")}function iA(){const[l,o]=b.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches);return b.useEffect(()=>{const r=window.matchMedia("(min-width: 1024px)"),i=()=>o(r.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),l}function rA({navigate:l,themeToggle:o}){const[r,i]=b.useState(nA),[u,f]=b.useState([]),[m,v]=b.useState(aA),[y,p]=b.useState(!0),[w,g]=b.useState(null);b.useEffect(()=>{p(!0),Qa.list({project:r.project},ys).then(S=>{f(S.items),g(null)}).catch(S=>g(S.message)).finally(()=>p(!1))},[r.project]),b.useEffect(()=>lA(r,m),[r,m]),b.useEffect(()=>{const D=setInterval(()=>{document.hidden||Qa.list({project:r.project},ys).then(z=>f(z.items)).catch(()=>{})},1e4);return()=>clearInterval(D)},[r.project]);const E=b.useMemo(()=>{const S=new Map;for(const D of u)S.set(D.status,(S.get(D.status)??0)+1);return S},[u]),O=b.useMemo(()=>{const S=m.trim().toLowerCase();return u.filter(D=>(!r.status||D.status===r.status)&&(!r.type||D.type===r.type)&&(!r.severity||D.severity===r.severity)&&(!r.assignee_agent||D.assignee_agent===r.assignee_agent)&&(!S||D.title.toLowerCase().includes(S)||D.body.toLowerCase().includes(S)||D.id.toLowerCase().includes(S)))},[u,r,m]),A=(S,D)=>i(z=>({...z,[S]:z[S]===D?void 0:D})),C=Object.entries(r).filter(([,S])=>S),T=iA();return h.jsxs(h.Fragment,{children:[h.jsxs("header",{className:"flex min-w-0 flex-wrap items-baseline gap-3",children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:h.jsxs("span",{className:"break-all",children:["Loopback queue",r.project?` — ${r.project}`:""]})}),h.jsx("span",{className:"text-sm text-muted-foreground",role:"status","aria-live":"polite",children:y?"Loading feedback…":`${O.length}${O.length!==u.length?` of ${u.length}`:""} item${O.length===1?"":"s"}${u.length===ys?` (first ${ys})`:""}`}),h.jsxs("div",{className:"ml-auto flex w-full min-w-0 flex-1 basis-full items-center justify-end gap-2 sm:w-auto sm:min-w-56 sm:basis-auto",children:[h.jsx(Ui,{value:m,onChange:S=>v(S.target.value),placeholder:"Search title, body, id…","aria-label":"Search feedback",className:"h-11 w-full min-w-0 sm:w-56"}),o]})]}),h.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Something wrong or clumsy on ",h.jsx("em",{children:"this"})," page? Pin it — feedback about Loopback files to the ",h.jsx("code",{className:"font-mono text-xs",children:"loopback"})," ","project, the same loop everything else uses."]}),h.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[_v.filter(S=>E.get(S)).map(S=>h.jsxs(gv,{children:[h.jsx(vv,{asChild:!0,children:h.jsx("button",{onClick:()=>A("status",S),"aria-pressed":r.status===S,"aria-label":`${E.get(S)} ${S}. ${r.status===S?"Clear this filter":`Show only ${S} items`}`,className:"inline-flex h-11 items-center rounded-md px-1",children:h.jsxs(Cl,{className:`${Es[S]} pointer-events-none transition ${r.status===S?"ring-2 ring-ring ring-offset-1 ring-offset-background":"hover:opacity-85"}`,children:[E.get(S)," ",S]})})}),h.jsx(yv,{children:r.status===S?"Clear this filter":`Show only ${S}`})]},S)),C.length>0&&h.jsxs("div",{className:"ml-1 flex flex-wrap items-center gap-1.5 text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"·"}),C.map(([S,D])=>h.jsxs(gv,{children:[h.jsx(vv,{asChild:!0,children:h.jsx("button",{onClick:()=>i(z=>({...z,[S]:void 0})),"aria-label":`${S.replace("_agent","")}: ${D} — remove this filter`,className:"inline-flex h-11 min-w-0 max-w-full items-center rounded-md px-1",children:h.jsxs(Cl,{variant:"outline",className:"pointer-events-none min-w-0 max-w-full gap-1 whitespace-normal",children:[h.jsxs("span",{className:"min-w-0 break-all",children:[S.replace("_agent",""),": ",h.jsx("strong",{children:D})]}),h.jsx(O1,{className:"size-3 shrink-0"})]})})}),h.jsx(yv,{children:"Remove this filter"})]},S)),h.jsx("button",{onClick:()=>{i({}),v("")},"aria-label":"Clear all filters and search",className:"inline-flex h-11 items-center rounded-md px-1",children:h.jsx(Cl,{variant:"outline",className:"pointer-events-none",children:"clear all"})})]})]}),w&&h.jsxs(Pf,{variant:"destructive",className:"mt-6",children:[h.jsx(Jf,{children:"Could not reach the hub"}),h.jsx(If,{children:w})]}),!T&&h.jsxs("div",{className:"mt-4 grid gap-2",children:[y&&Array.from({length:4},(S,D)=>h.jsx(To,{className:"h-24 w-full rounded-lg"},`msk-${D}`)),!y&&O.map(S=>h.jsxs("button",{onClick:()=>l(`/queue/${encodeURIComponent(S.id)}`),className:"grid min-w-0 gap-1.5 rounded-lg border p-3 text-left hover:bg-muted/50 [&>*]:min-w-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Cl,{className:Es[S.status],children:S.status}),h.jsx("span",{className:`font-mono text-xs ${Of[S.severity]} ${Rf[S.severity]}`,children:S.severity}),h.jsx("span",{className:"text-xs text-muted-foreground",children:S.type}),(S.attachments?.length??0)>0&&h.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(Af,{className:"size-3","aria-hidden":!0}),h.jsx("span",{className:"sr-only",children:"Attachments:"}),S.attachments?.length]})]}),h.jsx("div",{className:"font-medium break-all",children:S.title}),h.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground",children:[h.jsx("span",{className:"break-all",children:S.project}),h.jsx("span",{"aria-hidden":!0,children:"·"}),h.jsx("span",{children:Ff(S.created_at)}),S.assignee_agent&&h.jsxs(h.Fragment,{children:[h.jsx("span",{"aria-hidden":!0,children:"·"}),h.jsx("span",{className:"break-all",children:S.assignee_agent})]})]})]},S.id)),!y&&O.length===0&&h.jsx(dv,{className:"border",children:h.jsxs(mv,{children:[h.jsx(hv,{children:C.length>0||m?"Nothing matches":"The queue is empty"}),h.jsx(pv,{children:C.length>0||m?"No item matches the current filters.":"Pin something with the widget and it lands here."})]})})]}),T&&h.jsx("div",{className:"mt-4 rounded-lg border",children:h.jsxs(JT,{children:[h.jsx(WT,{className:"mt-3 text-xs",children:"Click a row to open it. Filters live in the URL — this view is linkable."}),h.jsx(IT,{children:h.jsxs(vs,{children:[h.jsx(Xa,{children:"id"}),h.jsx(Xa,{children:"project"}),h.jsx(Xa,{children:"sev / type"}),h.jsx(Xa,{children:"title"}),h.jsx(Xa,{children:"age"}),h.jsx(Xa,{children:"status"}),h.jsx(Xa,{children:"assignee"}),h.jsx(Xa,{children:"change"})]})}),h.jsxs(FT,{children:[y&&Array.from({length:5},(S,D)=>h.jsx(vs,{children:h.jsx(zn,{colSpan:8,children:h.jsx(To,{className:"h-5 w-full"})})},`sk-${D}`)),!y&&O.length===0&&h.jsx(vs,{children:h.jsx(zn,{colSpan:8,children:h.jsxs(dv,{className:"border-0 bg-transparent",children:[h.jsxs(mv,{children:[h.jsx(hv,{children:C.length>0||m?"Nothing matches":"The queue is empty"}),h.jsx(pv,{children:C.length>0||m?"No item matches the current filters.":"Pin something with the widget and it lands here."})]}),(C.length>0||m)&&h.jsx(Ct,{variant:"outline",size:"sm",onClick:()=>{i({}),v("")},children:"Clear filters"})]})})}),O.map(S=>h.jsxs(vs,{className:"cursor-pointer",onClick:()=>l(`/queue/${encodeURIComponent(S.id)}`),children:[h.jsx(zn,{children:h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 font-mono text-xs",onClick:D=>{D.stopPropagation(),l(`/queue/${encodeURIComponent(S.id)}`)},children:S.id})}),h.jsx(zn,{children:h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 text-sm","aria-pressed":r.project===S.project,"aria-label":`Filter by project ${S.project}`,onClick:D=>{D.stopPropagation(),A("project",S.project)},children:S.project})}),h.jsxs(zn,{className:"whitespace-nowrap",children:[h.jsx(Ct,{variant:"link",className:`h-auto min-h-6 min-w-6 p-0 font-mono text-xs ${Of[S.severity]} ${Rf[S.severity]}`,"aria-pressed":r.severity===S.severity,"aria-label":`Filter by severity ${S.severity}`,onClick:D=>{D.stopPropagation(),A("severity",S.severity)},children:S.severity})," ",h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 text-xs text-muted-foreground","aria-pressed":r.type===S.type,"aria-label":`Filter by type ${S.type}`,onClick:D=>{D.stopPropagation(),A("type",S.type)},children:S.type})]}),h.jsxs(zn,{className:"min-w-[16rem] font-medium break-all whitespace-normal",children:[S.title,(S.attachments?.length??0)>0&&h.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(Af,{className:"size-3","aria-hidden":!0}),h.jsx("span",{className:"sr-only",children:"Attachments:"}),S.attachments?.length]})]}),h.jsx(zn,{className:"whitespace-nowrap text-sm text-muted-foreground",children:h.jsx("time",{dateTime:S.created_at,children:Ff(S.created_at)})}),h.jsx(zn,{children:h.jsx(Cl,{asChild:!0,className:`${Es[S.status]} min-h-6 cursor-pointer`,children:h.jsx("button",{"aria-pressed":r.status===S.status,"aria-label":`Filter by status ${S.status}`,onClick:D=>{D.stopPropagation(),A("status",S.status)},children:S.status})})}),h.jsx(zn,{className:"text-sm",children:S.assignee_agent??h.jsx("span",{className:"text-muted-foreground",children:"—"})}),h.jsx(zn,{className:"text-sm",children:Za(S.links.pr_url)?h.jsx("a",{href:Za(S.links.pr_url)??void 0,onClick:D=>D.stopPropagation(),target:"_blank",rel:"noreferrer noopener",className:"inline-flex min-h-6 min-w-6 items-center justify-center underline",children:"PR"}):S.links.commit?h.jsx("code",{className:"font-mono text-xs",children:S.links.commit.slice(0,9)}):h.jsx("span",{className:"text-muted-foreground",children:"—"})})]},S.id))]})]})})]})}function ji({className:l,...o}){return h.jsx("div",{"data-slot":"card",className:Se("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",l),...o})}function xv({className:l,...o}){return h.jsx("textarea",{"data-slot":"textarea",className:Se("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",l),...o})}function bs({...l}){return h.jsx(cC,{"data-slot":"select",...l})}function xs({...l}){return h.jsx(mC,{"data-slot":"select-value",...l})}function Ss({className:l,size:o="default",children:r,...i}){return h.jsxs(fC,{"data-slot":"select-trigger","data-size":o,className:Se("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground 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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",l),...i,children:[r,h.jsx(hC,{asChild:!0,children:h.jsx(Av,{className:"size-4 opacity-50"})})]})}function ws({className:l,children:o,position:r="item-aligned",align:i="center",...u}){return h.jsx(yC,{children:h.jsxs(bC,{"data-slot":"select-content",className:Se("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 bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",r==="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",l),position:r,align:i,...u,children:[h.jsx(sA,{}),h.jsx(TC,{className:Se("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),h.jsx(cA,{})]})})}function Di({className:l,children:o,...r}){return h.jsxs(OC,{"data-slot":"select-item",className:Se("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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",l),...r,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(jC,{children:h.jsx(n1,{className:"size-4"})})}),h.jsx(RC,{children:o})]})}function sA({className:l,...o}){return h.jsx(DC,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",l),...o,children:h.jsx(o1,{className:"size-4"})})}function cA({className:l,...o}){return h.jsx(zC,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",l),...o,children:h.jsx(Av,{className:"size-4"})})}const C0="lb-author";function T0(){try{return localStorage.getItem(C0)}catch{return null}}function uA(l){try{localStorage.setItem(C0,l)}catch{}}const fA="unknown-human";function dA(){return T0()?.trim()||fA}function Sv(l){const o=l.trim().slice(0,40);o&&uA(o)}function mA(){return!!T0()?.trim()}function zi({className:l,...o}){return h.jsx(IE,{"data-slot":"label",className:Se("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",l),...o})}const hA=Vi("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-0 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function pA({className:l,state:o="done",size:r="default",orientation:i="horizontal",...u}){return h.jsx("div",{"data-slot":"attachment","data-state":o,"data-size":r,"data-orientation":i,className:Se(hA({size:r,orientation:i}),l),...u})}const gA=Vi("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function vA({className:l,variant:o="icon",...r}){return h.jsx("div",{"data-slot":"attachment-media","data-variant":o,className:Se(gA({variant:o}),l),...r})}function yA({className:l,...o}){return h.jsx("div",{"data-slot":"attachment-content",className:Se("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",l),...o})}function bA({className:l,...o}){return h.jsx("span",{"data-slot":"attachment-title",className:Se("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",l),...o})}function xA({className:l,...o}){return h.jsx("span",{"data-slot":"attachment-description",className:Se("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",l),...o})}function SA({className:l,...o}){return h.jsx("div",{"data-slot":"attachment-actions",className:Se("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",l),...o})}function wA({className:l,variant:o,size:r="icon-xs",...i}){return h.jsx(Ct,{"data-slot":"attachment-action",variant:o??"ghost",size:r,className:Se(l),...i})}function EA({...l}){return h.jsx(p2,{"data-slot":"alert-dialog",...l})}function CA({...l}){return h.jsx(g2,{"data-slot":"alert-dialog-trigger",...l})}function TA({...l}){return h.jsx(v2,{"data-slot":"alert-dialog-portal",...l})}function AA({className:l,...o}){return h.jsx(y2,{"data-slot":"alert-dialog-overlay",className:Se("fixed inset-0 z-50 bg-[color-mix(in_oklch,var(--lb-scrim)_60%,transparent)] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",l),...o})}function _A({className:l,size:o="default",...r}){return h.jsxs(TA,{children:[h.jsx(AA,{}),h.jsx(b2,{"data-slot":"alert-dialog-content","data-size":o,className:Se("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",l),...r})]})}function OA({className:l,...o}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:Se("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",l),...o})}function RA({className:l,...o}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:Se("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",l),...o})}function NA({className:l,...o}){return h.jsx(w2,{"data-slot":"alert-dialog-title",className:Se("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",l),...o})}function jA({className:l,...o}){return h.jsx(E2,{"data-slot":"alert-dialog-description",className:Se("text-sm text-muted-foreground",l),...o})}function DA({className:l,variant:o="default",size:r="default",...i}){return h.jsx(Ct,{variant:o,size:r,asChild:!0,children:h.jsx(x2,{"data-slot":"alert-dialog-action",className:Se(l),...i})})}function zA({className:l,variant:o="outline",size:r="default",...i}){return h.jsx(Ct,{variant:o,size:r,asChild:!0,children:h.jsx(S2,{"data-slot":"alert-dialog-cancel",className:Se(l),...i})})}const Mi=()=>dA(),zs="text-[11px] font-medium text-muted-foreground";function gt({label:l,children:o,region:r}){return r?h.jsxs("section",{className:"grid min-w-0 gap-1.5","aria-label":l,children:[h.jsx("h2",{className:zs,children:l}),h.jsx("div",{className:"min-w-0",children:o})]}):h.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[h.jsx("span",{className:zs,children:l}),h.jsx("div",{className:"min-w-0",children:o})]})}const Tf=({children:l,label:o})=>h.jsx("pre",{tabIndex:0,role:"group","aria-label":o,className:"mt-0.5 overflow-x-auto whitespace-pre-wrap rounded-md border bg-background p-2.5 font-mono text-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ring)]",children:l});function MA({id:l,navigate:o,themeToggle:r}){const[i,u]=b.useState(null),[f,m]=b.useState(null),[v,y]=b.useState(!1),[p,w]=b.useState({}),[g,E]=b.useState(""),[O,A]=b.useState(""),[C,T]=b.useState("reference"),[S,D]=b.useState(""),[z,k]=b.useState(!1),I=b.useRef(null),X=()=>{Qa.get(l).then(U=>{u(U),m(null)}).catch(U=>m(U.message))};if(b.useEffect(X,[l]),b.useEffect(()=>{const U=setInterval(()=>{!document.hidden&&!z&&!v&&X()},1e4);return()=>clearInterval(U)},[l,z,v]),f)return h.jsxs("div",{className:"grid gap-4",children:[h.jsxs("h1",{className:"text-xl font-semibold tracking-tight",children:["Could not load ",l]}),h.jsxs(Pf,{variant:"destructive",children:[h.jsx(Jf,{children:"The hub did not return this item"}),h.jsx(If,{children:f})]}),h.jsx(Ct,{variant:"outline",onClick:()=>o("/queue"),children:"Back to the queue"})]});if(!i)return h.jsxs("div",{className:"grid gap-4",children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Loading feedback item"}),h.jsxs("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:["Loading ",l,"…"]}),h.jsx(To,{className:"h-8 w-40"}),h.jsx(To,{className:"h-7 w-2/3"}),h.jsx(To,{className:"h-28 w-full"}),h.jsx(To,{className:"h-40 w-full"})]});const K=i.extra.failed_responses,G=i.extra.context,ae=async(U,te)=>{if(z)return;const fe=document.activeElement,he=fe?.closest("[data-slot=card], header"),j=te??fe?.closest("[data-lb-region]")?.getAttribute("data-lb-region")??null;k(!0);try{await U()}catch(Y){Sl.error(Y.message)}finally{k(!1),requestAnimationFrame(()=>{if(fe&&document.contains(fe)&&!fe.disabled){fe.focus();return}const oe=(j?document.querySelector(`[data-lb-region="${j}"]`):null)??(he&&document.contains(he)?he:null);oe&&(oe.setAttribute("tabindex","-1"),oe.focus({preventScroll:!0}))})}},me=()=>ae(async()=>{await Qa.update(l,{...p,author:Mi()}),Sl.success("Saved — the change is on the audit trail"),y(!1),w({}),X()},"detail-header"),ge=async U=>{if(C==="asset"&&!S.trim()){Sl.error("An asset needs a target path — where should it land in the repo?");return}return ae(async()=>{await Qa.attach(l,U,{intent:C,target:C==="asset"?S.trim():void 0,author:Mi()}),Sl.success(C==="asset"?`Attached as an asset — an agent will copy it to ${S.trim()}`:"Attached as reference — context for the fix"),D(""),X()})};return h.jsxs("div",{className:"grid min-w-0 gap-4 [&>*]:min-w-0",children:[h.jsxs("header",{"data-lb-region":"detail-header",className:"flex flex-wrap items-center gap-3",children:[h.jsxs(Ct,{variant:"ghost",size:"sm",className:"h-11",onClick:()=>o("/queue"),children:[h.jsx(e1,{className:"size-4"})," Queue"]}),h.jsx(Cl,{className:Es[i.status],children:i.status}),h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[!v&&h.jsxs(Ct,{variant:"outline",size:"sm",onClick:()=>{w({title:i.title,body:i.body,severity:i.severity,type:i.type}),y(!0),requestAnimationFrame(()=>{document.getElementById("lb-edit-title")?.focus()})},children:[h.jsx(x1,{className:"size-4"})," Edit"]}),r]})]}),h.jsx("h1",{className:"text-xl font-semibold tracking-tight break-all",children:i.title}),v?h.jsxs(ji,{"data-lb-region":"edit",className:"grid min-w-0 gap-3 p-4 [&>*]:min-w-0",children:[h.jsx(zi,{htmlFor:"lb-edit-title",className:"sr-only",children:"Title"}),h.jsx(Ui,{id:"lb-edit-title",value:p.title??"",onChange:U=>w(te=>({...te,title:U.target.value})),className:"text-base font-medium"}),h.jsx(zi,{htmlFor:"lb-edit-body",className:"sr-only",children:"Report"}),h.jsx(xv,{id:"lb-edit-body",value:p.body??"",rows:6,onChange:U=>w(te=>({...te,body:U.target.value}))}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsxs(bs,{value:p.severity,onValueChange:U=>w(te=>({...te,severity:U})),children:[h.jsx(Ss,{className:"w-32","aria-label":"Severity",children:h.jsx(xs,{})}),h.jsx(ws,{children:lS.map(U=>h.jsx(Di,{value:U,children:U},U))})]}),h.jsxs(bs,{value:p.type,onValueChange:U=>w(te=>({...te,type:U})),children:[h.jsx(Ss,{className:"w-36","aria-label":"Type",children:h.jsx(xs,{})}),h.jsx(ws,{children:oS.map(U=>h.jsx(Di,{value:U,children:U},U))})]}),h.jsx(Ct,{size:"sm",onClick:me,disabled:z,children:z?"Saving…":"Save"}),h.jsx(Ct,{variant:"ghost",size:"sm",onClick:()=>{y(!1),w({}),requestAnimationFrame(()=>{const U=document.querySelector('[data-lb-region="detail-header"]');U?.setAttribute("tabindex","-1"),U?.focus({preventScroll:!0})})},children:"Cancel"})]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Every edit is recorded on the trail with its old value — nothing is rewritten silently."})]}):h.jsx("code",{className:"font-mono text-xs break-all text-muted-foreground",children:i.id}),h.jsxs(ji,{className:"grid grid-cols-[repeat(auto-fit,minmax(170px,1fr))] gap-3 p-4",children:[h.jsx(gt,{label:"Project",children:h.jsx("span",{className:"break-all",children:i.project})}),h.jsxs(gt,{label:"Severity / type",children:[h.jsx("span",{className:`font-mono text-xs ${Of[i.severity]} ${Rf[i.severity]}`,children:i.severity})," ",h.jsx("span",{className:"text-sm text-muted-foreground",children:i.type})]}),h.jsx(gt,{label:"Source / reporter",children:h.jsxs("span",{className:"text-sm break-all",children:[i.source," · ",i.reporter]})}),h.jsx(gt,{label:"Assignee",children:h.jsx("span",{className:"text-sm break-all",children:i.assignee_agent??"unclaimed"})}),h.jsx(gt,{label:"Route",children:h.jsx("code",{className:"font-mono text-xs break-all",children:i.route??"—"})}),h.jsx(gt,{label:"Age",children:h.jsx("time",{dateTime:i.created_at,className:"text-sm",title:i.created_at,children:Ff(i.created_at)})}),h.jsx(gt,{label:"Updated",children:h.jsx("span",{className:"text-sm break-all text-muted-foreground",children:i.updated_at})}),i.resolution&&h.jsx(gt,{label:"Resolution",children:h.jsx("span",{className:"text-sm",children:i.resolution})})]}),h.jsxs("div",{className:"grid gap-3.5",children:[i.body&&!v&&h.jsx(gt,{region:!0,label:"Report",children:h.jsx("div",{className:"whitespace-pre-wrap break-all text-sm",children:i.body})}),i.repro_steps.length>0&&h.jsx(gt,{region:!0,label:"Repro steps",children:h.jsx("ol",{className:"list-decimal pl-5 text-sm break-all",children:i.repro_steps.map((U,te)=>h.jsx("li",{children:U},te))})}),K&&K.length>0&&h.jsx(gt,{region:!0,label:"Failed requests (captured at report time)",children:K.map((U,te)=>h.jsxs("div",{className:"mb-2",children:[h.jsxs("code",{className:"font-mono text-xs break-all",children:[U.status," ",U.url]}),U.body&&h.jsx(Tf,{label:`Response body for ${U.status} ${U.url}`,children:U.body})]},te))}),G&&h.jsx(gt,{region:!0,label:"Run context (AI / automation)",children:h.jsx(Tf,{label:"Run context JSON",children:JSON.stringify(G,null,2)})}),i.console.length>0&&h.jsx(gt,{region:!0,label:`Console (${i.console.length})`,children:h.jsx(Tf,{label:"Console capture",children:i.console.join(` `)})}),Object.values(i.links).some(Boolean)&&h.jsx(gt,{region:!0,label:"Linked change",children:h.jsx("div",{className:"text-sm",children:Object.entries(i.links).filter(([,U])=>U).map(([U,te])=>h.jsxs("div",{children:[h.jsxs("span",{className:"text-muted-foreground",children:[U,":"]})," ",U==="pr_url"&&Za(String(te))?h.jsx("a",{className:"inline-block min-h-6 break-all underline",href:Za(String(te))??void 0,target:"_blank",rel:"noreferrer noopener",children:String(te)}):h.jsx("code",{className:"font-mono text-xs break-all",children:String(te)})]},U))})}),i.dom_selector&&h.jsx(gt,{region:!0,label:"Anchor",children:h.jsx("code",{className:"font-mono text-xs break-all",children:i.dom_selector})}),i.url&&h.jsx(gt,{region:!0,label:"Reported from",children:Za(i.url)?h.jsx("a",{className:"inline-block min-h-6 text-sm break-all underline",href:Za(i.url)??void 0,target:"_blank",rel:"noreferrer noopener",children:i.url}):h.jsx("span",{className:"text-sm break-all",children:i.url})}),i.network.length>0&&h.jsx(gt,{region:!0,label:`Network at report time (${i.network.length})`,children:h.jsx("div",{className:"grid gap-1",children:i.network.slice(-8).map((U,te)=>h.jsxs("div",{className:"flex flex-wrap items-baseline gap-2 font-mono text-xs",children:[h.jsx("span",{className:(U.status??0)>=400||U.status===0?"text-lb-p0 font-semibold":"text-muted-foreground",children:U.status??"—"}),h.jsx("span",{className:"text-muted-foreground",children:U.method??"GET"}),h.jsx("span",{className:"break-all",children:U.url}),U.ms!==void 0&&h.jsxs("span",{className:"text-muted-foreground",children:[U.ms,"ms"]})]},te))})})]}),h.jsxs(ji,{"data-lb-region":"attachments",className:"grid gap-3 p-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Af,{className:"size-4"}),h.jsxs("span",{className:"text-sm font-medium",children:["Attachments",i.attachments?.length?` (${i.attachments.length})`:""]})]}),i.attachments?.map(U=>h.jsxs(pA,{className:"w-full",children:[h.jsx(vA,{variant:U.mime.startsWith("image/")?"image":"icon",children:U.mime.startsWith("image/")?h.jsx("img",{src:U.url,alt:""}):h.jsx(c1,{"aria-hidden":!0})}),h.jsxs(yA,{className:"min-w-0",children:[h.jsx(bA,{className:"whitespace-normal",title:U.name,children:Za(U.url)?h.jsx("a",{className:"inline-block min-h-6 break-all underline",href:Za(U.url)??void 0,target:"_blank",rel:"noreferrer noopener",children:U.name}):h.jsx("span",{className:"break-all",children:U.name})}),h.jsxs(xA,{className:"whitespace-normal break-all",title:U.target_path??void 0,children:[h.jsx(Cl,{variant:U.intent==="asset"?"default":"secondary",children:U.intent})," ",iS(U.size),U.target_path?` → ${U.target_path}`:""]})]}),h.jsx(SA,{children:h.jsxs(EA,{children:[h.jsx(CA,{asChild:!0,children:h.jsx(wA,{"aria-label":`Remove attachment ${U.name}`,disabled:z,children:h.jsx(C1,{})})}),h.jsxs(_A,{className:"max-w-[calc(100vw-2rem)]",children:[h.jsxs(OA,{className:"min-w-0",children:[h.jsxs(NA,{className:"min-w-0 break-all",children:["Remove “",U.name,"”?"]}),h.jsx(jA,{children:"The file is deleted from the hub. This cannot be undone."})]}),h.jsxs(RA,{children:[h.jsx(zA,{children:"Keep it"}),h.jsx(DA,{onClick:()=>ae(async()=>{await Qa.detach(l,U.id,Mi()),Sl.success("Removed"),X()},"attachments"),children:"Remove"})]})]})]})})]},U.id)),h.jsxs("div",{className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,auto)_minmax(0,1fr)_auto] sm:items-center [&>*]:min-w-0",children:[h.jsxs(bs,{value:C,onValueChange:U=>T(U),children:[h.jsx(Ss,{"aria-label":"Attachment intent",children:h.jsx(xs,{})}),h.jsxs(ws,{children:[h.jsx(Di,{value:"reference",children:"reference"}),h.jsx(Di,{value:"asset",children:"asset"})]})]}),h.jsx(Ui,{"aria-label":"Target path in the repo",placeholder:C==="asset"?"Target path in the repo, e.g. public/logos/acme.svg":"Context for the fix — no target path needed",value:S,disabled:C==="reference",onChange:U=>D(U.target.value)}),h.jsx(Ct,{variant:"outline",size:"sm",disabled:z,onClick:()=>I.current?.click(),children:z?"Uploading…":"Choose file"}),h.jsx("input",{ref:I,type:"file","aria-label":"Choose a file to attach",tabIndex:-1,className:"hidden",onChange:U=>{const te=U.target.files?.[0];te&&ge(te),U.target.value=""}})]}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.jsx("strong",{children:"reference"})," is context for the fix and never ships."," ",h.jsx("strong",{children:"asset"})," is a deliverable — an agent copies it to the target path in the repo and commits it."]})]}),i.comments&&i.comments.length>0&&h.jsx(gt,{region:!0,label:`Trail (${i.comments.length})`,children:h.jsx("div",{className:"grid gap-2",children:i.comments.map(U=>h.jsxs("div",{className:"min-w-0 py-2 not-last:border-b",children:[h.jsxs("div",{className:"text-xs break-all text-muted-foreground",children:[U.author," · ",U.created_at]}),h.jsx("div",{className:"mt-0.5 whitespace-pre-wrap break-all text-sm",children:U.body})]},U.id))})}),!mA()&&h.jsxs(Pf,{children:[h.jsx(Jf,{children:"Who is writing to this trail?"}),h.jsx(If,{children:h.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[h.jsx(zi,{htmlFor:"lb-author",className:"sr-only",children:"Your name"}),h.jsx(Ui,{id:"lb-author",className:"h-11 w-full max-w-48 min-w-0",placeholder:"Your name or handle",defaultValue:"",onKeyDown:U=>{U.key==="Enter"&&(Sv(U.target.value),X())}}),h.jsx(Ct,{size:"sm",className:"h-11",onClick:()=>{const U=document.getElementById("lb-author");U&&Sv(U.value),X(),requestAnimationFrame(()=>{const te=document.querySelector('[data-lb-region="comment"]');te?.setAttribute("tabindex","-1"),te?.focus({preventScroll:!0})})},children:"Save"}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:["Stored in this browser only. Until then, writes are recorded as"," ",h.jsx("code",{className:"font-mono",children:"unknown-human"}),"."]})]})})]}),h.jsxs("div",{className:"grid min-w-0 gap-4 sm:grid-cols-2 [&>*]:min-w-0",children:[h.jsxs(ji,{"data-lb-region":"comment",className:"grid gap-2 p-4",children:[h.jsx(zi,{htmlFor:"lb-comment",className:zs,children:"Add a comment"}),h.jsx(xv,{id:"lb-comment",rows:3,value:g,onChange:U=>E(U.target.value),placeholder:"What you noticed, decided, or want the agent to know"}),h.jsx(Ct,{size:"sm",disabled:z||!g.trim(),onClick:()=>ae(async()=>{await Qa.comment(l,g,Mi()),E(""),Sl.success("Comment added"),X()}),children:z?"Adding…":"Comment"})]}),h.jsxs(ji,{"data-lb-region":"status",className:"grid gap-2 p-4",children:[h.jsx(zi,{htmlFor:"lb-status-note",className:zs,children:"Change status"}),h.jsx(Ui,{id:"lb-status-note",placeholder:"Why — recorded on the trail. Type this first.",value:O,onChange:U=>A(U.target.value)}),h.jsxs(bs,{value:i.status,onValueChange:U=>ae(async()=>{await Qa.setStatus(l,U,O,Mi()),A(""),Sl.success(`Status is now ${U}`),X()},"status"),children:[h.jsx(Ss,{"aria-label":"Status",disabled:z,children:h.jsx(xs,{})}),h.jsx(ws,{children:_v.map(U=>h.jsx(Di,{value:U,children:U},U))})]})]})]})]})}function UA(){const[l,o]=b.useState(window.location.pathname);b.useEffect(()=>{const f=()=>o(window.location.pathname);return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[]);const r=b.useCallback(f=>{window.history.pushState({},"",f),o(new URL(f,window.location.origin).pathname)},[]),i=/^\/queue\/(.+)$/.exec(l),u=i?decodeURIComponent(i[1]):null;return b.useEffect(()=>{document.title=u?`${u} — Loopback`:"Loopback queue";const f=document.getElementById("lb-main");f&&f.focus({preventScroll:!0})},[u]),{id:u,navigate:r}}function wv(){const[l,o]=b.useState(()=>document.documentElement.classList.contains("dark"));return h.jsx(Ct,{variant:"outline",size:"sm",className:"size-11",onClick:()=>{const r=document.documentElement.classList.toggle("dark");try{localStorage.setItem("lb-theme",r?"dark":"light")}catch{}o(r)},"aria-pressed":l,"aria-label":l?"Dark theme on. Switch to light.":"Light theme on. Switch to dark.",children:l?h.jsx(w1,{className:"size-4"}):h.jsx(p1,{className:"size-4"})})}function kA(){const{id:l,navigate:o}=UA();return h.jsxs(tA,{delayDuration:200,children:[h.jsx("main",{id:"lb-main",tabIndex:-1,className:"mx-auto max-w-[1180px] px-4 py-8 outline-none sm:px-6",children:l?h.jsx(MA,{id:l,navigate:o,themeToggle:h.jsx(wv,{})}):h.jsx(rA,{navigate:o,themeToggle:h.jsx(wv,{})})}),h.jsx(aS,{position:"bottom-right"})]})}Zx.createRoot(document.getElementById("root")).render(h.jsx(b.StrictMode,{children:h.jsx(kA,{})})); diff --git a/public/dashboard/index.html b/public/dashboard/index.html index 6679344..cb2d5e1 100644 --- a/public/dashboard/index.html +++ b/public/dashboard/index.html @@ -15,7 +15,7 @@ } catch (e) {} })(); - + From c80fbad56acdaddc84a72614524c71dcd0b7a21c Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:03:35 +0530 Subject: [PATCH 02/13] Refuse to publish a commit whose CI is not green MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0.9.0, 0.9.1 and 0.9.2 were all published while ci.yml was failing. Nothing in the pipeline objected, because nothing in it ever asked. The gates verify the source; verify:release deliberately runs after publishing, against published artifacts, where npm's immutability means it can only report damage. release-preflight asks the missing question before the fact: clean tree, commit actually pushed, and a completed successful ci.yml run for that exact sha. It is wired as prepublishOnly, so `npm publish` enforces it rather than trusting anyone to remember. It fails closed. An unreachable GitHub is a refusal, not a pass — "unknown" is the state that let the last three releases through. LOOPBACK_ALLOW_RED_CI=1 is the explicit, auditable override. One trap found by testing rather than reading: the GitHub API matches head_sha on the full 40-char sha only, so an abbreviated sha returns an empty run list — indistinguishable from "never tested". Shas are resolved locally first. Fail-closed gates have their own failure mode: one that refuses everything would sail through a canary that only checks for a non-zero exit. So the sweep gets both directions, anchored to two immutable commits — 10a1c6d (red) must fail, 623aa05 (green) must pass — and `expect` in the harness to express the second. The canary job now gets GH_TOKEN, without which the red case would pass for the wrong reason. Co-Authored-By: Claude Fable 5 --- .github/workflows/canary.yml | 7 ++ package.json | 2 + scripts/bump-version.mjs | 4 +- scripts/canary-all.mjs | 38 ++++++++- scripts/release-preflight.mjs | 144 ++++++++++++++++++++++++++++++++++ 5 files changed, 192 insertions(+), 3 deletions(-) create mode 100644 scripts/release-preflight.mjs diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 8edd6d4..9b87600 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -42,4 +42,11 @@ jobs: - run: npm ci - run: npm run build - run: npx playwright install --with-deps chromium + # The release-preflight cases read a commit's CI conclusion through `gh`, + # which needs a token. github.token is the run's own credential, not event + # data, and it is passed via env rather than interpolated into a command. + # Without it the gate fails closed and its red case would pass for the + # wrong reason — which is exactly what its green case catches. - run: node scripts/canary-all.mjs + env: + GH_TOKEN: ${{ github.token }} diff --git a/package.json b/package.json index 92f3739..86ca8ae 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,8 @@ "build": "tsc", "bump": "node scripts/bump-version.mjs", "prepare": "npm run build", + "prepublishOnly": "node scripts/release-preflight.mjs", + "preflight": "node scripts/release-preflight.mjs", "start": "node dist/index.js", "dev": "tsx src/index.ts", "smoke": "npm run build && node dist/smoke-test.js", diff --git a/scripts/bump-version.mjs b/scripts/bump-version.mjs index 24334b0..0bdaa8c 100644 --- a/scripts/bump-version.mjs +++ b/scripts/bump-version.mjs @@ -82,7 +82,9 @@ for (const e of edits) console.log(` ✅ ${e}`); console.log(` Next: npm run build && npm run smoke && node scripts/init-gate.mjs # parity gates - git commit && git push # push BEFORE verifying + git commit && git push # push BEFORE publishing + # …then WAIT for CI to go green on that commit. npm publish now runs + # release-preflight first and refuses a red or still-running commit. npm publish --otp= mcp-publisher publish npm run verify:release diff --git a/scripts/canary-all.mjs b/scripts/canary-all.mjs index 521a449..e3106d6 100644 --- a/scripts/canary-all.mjs +++ b/scripts/canary-all.mjs @@ -61,7 +61,15 @@ function run([bin, args]) { } } -/** Each entry: the gate, one mutation to what it guards, and any build it needs. */ +/** + * Each entry: the gate, one mutation to what it guards, and any build it needs. + * + * A few gates take their broken subject as INPUT rather than from a file — the + * release preflight reads a commit's CI result, so its "mutation" is being + * pointed at a commit that really is red. Those cases carry `expect` and no + * file mutation; `expect: 0` asserts the complement, which a fail-closed gate + * needs: a gate that refuses everything would otherwise pass its own canary. + */ const CASES = [ { gate: "impeccable-gate", @@ -258,6 +266,22 @@ const CASES = [ s.replaceAll("${a.name}", "FILE").replaceAll("${a.path}", "PATH"), ), }, + // 10a1c6d is permanently red (the a11y reflow failure) and 623aa05 is + // permanently green. Both are immutable history, so these two anchors cannot + // rot the way a mutation's anchor text can. + { + gate: "release-preflight (red CI)", + cmd: ["node", ["scripts/release-preflight.mjs", "--sha", "10a1c6d6544aae6bd27416cf5c7aec6125406078"]], + guards: "the CI result of the commit being published", + apply: () => {}, + }, + { + gate: "release-preflight (green CI)", + cmd: ["node", ["scripts/release-preflight.mjs", "--sha", "623aa05a2d75e4bbeffcc5cfde903babc2a332d7"]], + guards: "a green commit still being publishable", + expect: 0, + apply: () => {}, + }, ]; process.on("SIGINT", () => { @@ -276,7 +300,17 @@ try { ); continue; } - if (run(c.cmd) !== 0) { + const code = run(c.cmd); + if (c.expect === 0) { + if (code === 0) { + console.log(`✅ ${c.gate} still passes on ${c.guards}`); + } else { + failures++; + console.error( + `❌ ${c.gate} FAILED on ${c.guards} — it refuses everything, so its red-case canary proves nothing`, + ); + } + } else if (code !== 0) { console.log(`✅ ${c.gate} fails when ${c.guards} is broken`); } else { failures++; diff --git a/scripts/release-preflight.mjs b/scripts/release-preflight.mjs new file mode 100644 index 0000000..ad8f9ff --- /dev/null +++ b/scripts/release-preflight.mjs @@ -0,0 +1,144 @@ +/** + * Pre-publish gate: refuse to release a commit whose CI is not green. + * + * Every other gate in this repo answers "is the source correct?". None of them + * answered "did the suite actually pass on what I am about to publish?" — and + * that gap is not hypothetical. The a11y gate went red the moment it landed + * (d2ca476) and stayed red for sixteen consecutive runs across six days — last + * green 623aa05 on 2026-07-26 — while 0.9.0, 0.9.1 and 0.9.2 were all published + * on top of it. Three releases shipped two real WCAG 1.4.4/1.4.10 failures, and + * nothing in the pipeline objected. + * + * `verify:release` is the mirror of this check and deliberately runs AFTER a + * publish, against the published artifacts. By then npm versions are immutable, + * so it can only report damage. This runs BEFORE, where refusing is still free. + * + * Wired as `prepublishOnly`, so `npm publish` enforces it rather than trusting + * anyone to remember. Run it directly with: + * + * node scripts/release-preflight.mjs # checks HEAD + * node scripts/release-preflight.mjs --sha # checks one commit + * + * It FAILS CLOSED: if CI status cannot be determined (no `gh`, no auth, no + * network), that is a refusal, not a pass — an unknown answer is exactly the + * state that let the last three releases through. The escape hatch is explicit + * and auditable rather than a silent skip: + * + * LOOPBACK_ALLOW_RED_CI=1 npm publish + */ +import { execFileSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import { join } from "node:path"; + +const ROOT = process.cwd(); +const WORKFLOW = "ci.yml"; + +let failures = 0; +const ok = (m) => console.log(`✅ ${m}`); +const bad = (m) => { + failures++; + console.error(`❌ ${m}`); +}; + +/** No shell: argv arrays only, so nothing is interpolated into a command line. */ +function run(bin, args) { + return execFileSync(bin, args, { cwd: ROOT, encoding: "utf-8", stdio: "pipe" }).trim(); +} +function tryRun(bin, args) { + try { + return { out: run(bin, args), err: null }; + } catch (e) { + return { out: null, err: e.stderr?.toString().trim() || e.message }; + } +} + +const argv = process.argv.slice(2); +const shaFlag = argv.indexOf("--sha"); +const wantSha = shaFlag !== -1 ? argv[shaFlag + 1] : null; + +if (process.env.LOOPBACK_ALLOW_RED_CI === "1") { + console.warn( + "\n⚠️ LOOPBACK_ALLOW_RED_CI=1 — publishing WITHOUT a green CI run.\n" + + " This is the override, not a pass. Say so in the release notes.\n", + ); + process.exit(0); +} + +// ── which repo ─────────────────────────────────────────────────────────────── +const pkg = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf-8")); +const slug = (pkg.repository?.url ?? "").match(/github\.com[/:]([^/]+\/[^/.]+)/)?.[1]; +if (!slug) { + bad("could not read an owner/repo out of package.json repository.url"); + process.exit(1); +} + +// ── which commit ───────────────────────────────────────────────────────────── +// The GitHub API matches head_sha on the FULL 40-char sha only: an +// abbreviation returns an empty run list, which is indistinguishable from +// "never tested". Resolve it locally so a short sha cannot read as untested. +const resolved = tryRun("git", ["rev-parse", wantSha ?? "HEAD"]); +if (!resolved.out) { + bad(`could not resolve ${wantSha ?? "HEAD"} — ${resolved.err}`); + process.exit(1); +} +let sha = resolved.out; + +if (!wantSha) { + + // A dirty tree means the artifact about to be published is not the commit + // whose CI result we are about to trust. + const dirty = tryRun("git", ["status", "--porcelain"]); + if (dirty.out === null) bad(`could not read git status — ${dirty.err}`); + else if (dirty.out !== "") bad(`working tree is dirty — publishing something CI never saw:\n${dirty.out}`); + else ok("working tree is clean, so the tarball matches the commit CI tested"); + + // An unpushed commit has no CI result at all, and the run found below would + // silently belong to some ancestor. + const onRemote = tryRun("git", ["branch", "-r", "--contains", sha]); + if (onRemote.out === null || onRemote.out === "") { + bad(`${sha.slice(0, 7)} is not on any remote branch — push it, let CI run, then publish`); + } else { + ok(`${sha.slice(0, 7)} is pushed (${onRemote.out.split("\n")[0].trim()})`); + } +} + +// ── did CI pass on it ──────────────────────────────────────────────────────── +const q = `repos/${slug}/actions/workflows/${WORKFLOW}/runs?head_sha=${sha}&per_page=20`; +const res = tryRun("gh", ["api", q, "--jq", ".workflow_runs[] | \"\\(.status) \\(.conclusion) \\(.html_url)\""]); + +if (res.out === null) { + bad( + `could not reach GitHub to check ${WORKFLOW} for ${sha.slice(0, 7)} — ${res.err}\n` + + " Failing closed. An unknown CI result is what shipped 0.9.0-0.9.2 on red.", + ); +} else if (res.out === "") { + bad(`no ${WORKFLOW} run exists for ${sha.slice(0, 7)} — nothing has tested this commit`); +} else { + const runs = res.out.split("\n").map((l) => { + const [status, conclusion, url] = l.split(" "); + return { status, conclusion, url }; + }); + const pending = runs.filter((r) => r.status !== "completed"); + const success = runs.filter((r) => r.conclusion === "success"); + const failed = runs.filter((r) => r.status === "completed" && r.conclusion !== "success"); + + if (pending.length) { + bad(`${WORKFLOW} is still running for ${sha.slice(0, 7)} — wait for it\n ${pending[0].url}`); + } else if (!success.length) { + bad( + `${WORKFLOW} did not pass on ${sha.slice(0, 7)} — ${failed[0]?.conclusion ?? "no successful run"}\n` + + ` ${failed[0]?.url ?? ""}`, + ); + } else { + ok(`${WORKFLOW} passed on ${sha.slice(0, 7)}`); + } +} + +if (failures) { + console.error( + `\nRELEASE PREFLIGHT FAILED — ${failures} check(s). Nothing was published.\n` + + "Fix CI, or publish deliberately with LOOPBACK_ALLOW_RED_CI=1 and say so in the notes.", + ); + process.exit(1); +} +console.log("\nRELEASE PREFLIGHT PASSED 🎉 green CI on the exact commit being published"); From 869bc8ef5eb2724ce97a9ed19086303475cb6956 Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:10:31 +0530 Subject: [PATCH 03/13] Re-measure every number the docs assert, and make two dead checks work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The structural gates were all green while the docs drifted, because none of them ever read a claim. Everything that had rotted was a hand-typed figure. Corrected against the code: - the widget was quoted four ways — 46KB/15KB, 57KB/19KB, 57,183 B, ~29KB — against a real 59,443 B. Two separate commits each said they had "corrected the widget size" while fixing one occurrence of two; - "The MCP bus — 10 tools" sat above a 9-row table, missing loopback_update_feedback, which the 0.8.0 changelog had announced; - the HTTP surface table omitted all three attachment endpoints; - the shadcn section documented two registry items and shipped three, and its prose had a sentence cut off mid-clause with a contradictory paste over it and an orphan "free)." — live on GitHub and in the npm readme; - the repo map said init writes .claude-plugin/ (it does not) and that init-gate re-renders it (it asserts a version), and omitted .github/ and .impeccable/ entirely. docs-facts-gate now re-derives all of it: size, tool count, every registered route, every registry item, the canary count, the published version. Measuring it exposed a smaller lie inside the bigger one. "19,751 B gzipped on the wire" was measured with the gzip(1) CLI, but the server serves gzipSync at zlib's default level — 19,770 B. Three plausible numbers for one file, so the gate measures it the way src/http.ts actually produces it. link-gate replaces a CI step that had never checked anything. `linkinator README.md docs integrations` silently ignores every path after the first, and `--skip "127.0.0.1|..."` matched the root linkinator serves the files from, so the crawl never started: that one pattern took the scan from 24 links to 0, and "Successfully scanned 0 links" exits 0. It now asserts a minimum link count per target, because the failure was never a broken link — it was an empty crawl. Both new gates are canaried, and the sweep is 26 checks. Co-Authored-By: Claude Fable 5 --- .github/workflows/ci.yml | 4 + .github/workflows/readme-checks.yml | 11 +- CHANGELOG.md | 2 +- README.md | 51 +++++--- design/README.md | 2 +- docs/05-surface-compatibility.md | 5 +- docs/ROADMAP.md | 33 +++-- integrations/claude.md | 2 +- scripts/canary-all.mjs | 33 +++++ scripts/docs-facts-gate.mjs | 181 ++++++++++++++++++++++++++++ scripts/link-gate.mjs | 93 ++++++++++++++ server.json | 1 + 12 files changed, 385 insertions(+), 33 deletions(-) create mode 100644 scripts/docs-facts-gate.mjs create mode 100644 scripts/link-gate.mjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff4a3b3..ed30892 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,10 @@ jobs: # Design anti-patterns in the shipped UI. Runs after dashboard-gate # because it scans the built output, which that gate proves is current. - run: node scripts/impeccable-gate.mjs + # Re-measures the numbers the docs assert (widget size, tool count, HTTP + # routes, registry items). Every other gate checks structure; the drift + # that actually accumulated was entirely in hand-typed figures. + - run: node scripts/docs-facts-gate.mjs e2e: runs-on: ubuntu-latest diff --git a/.github/workflows/readme-checks.yml b/.github/workflows/readme-checks.yml index 6763192..3eece0d 100644 --- a/.github/workflows/readme-checks.yml +++ b/.github/workflows/readme-checks.yml @@ -17,10 +17,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + # This step used to invoke linkinator directly and scanned ZERO links + # while reporting success — extra path arguments are ignored, and the + # bare 127.0.0.1 skip matched linkinator's own local server root. The + # gate asserts a minimum link count per target so an empty crawl fails. - name: Link check (README, docs, integrations) - run: > - npx --yes linkinator README.md docs integrations --markdown - --skip "127.0.0.1|localhost|^#|shields.io" + run: node scripts/link-gate.mjs - name: Star-begging guard (growth-kit disqualifier class) run: | ! grep -riE "star (us|this|the repo)|give (us|it) a star|drop a star|smash[^.]*star" README.md docs integrations diff --git a/CHANGELOG.md b/CHANGELOG.md index b10dfab..fda8ff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -119,7 +119,7 @@ manifests that do different jobs — `registry.json` for shadcn, `server.json` for the MCP Registry. Also corrected the widget size, still quoted as 46KB/15KB against a measured 57KB/19KB. -## [0.9.1] — 2026-07-27 — published to npm and the MCP Registry +## [0.9.1] — 2026-08-01 — published to npm; listed on the MCP Registry 2026-08-02 ### Added — MCP Registry identity (`mcpName` + `server.json`) The official MCP Registry proves package ownership by fetching the **published** diff --git a/README.md b/README.md index 3f37144..19ef8a6 100644 --- a/README.md +++ b/README.md @@ -201,17 +201,24 @@ its pieces and the **shadcn MCP** can discover them: ```bash npx shadcn@latest add https://raw.githubusercontent.com/joshidikshant/loopback/main/public/r/loopback-theme.json +npx shadcn@latest add https://raw.githubusercontent.com/joshidikshant/loopback/main/public/r/loopback-components.json npx shadcn@latest add https://raw.githubusercontent.com/joshidikshant/loopback/main/public/r/loopback-widget.json ``` -`loopback-theme` adds the `--lb-*` feedback status/severity tokens to your - `loopback-theme` ships the FULL shadcn theme contract (background, foreground, - primary, muted, ring, radius…) alongside the `--lb-*` domain tokens, so - installing it REPLACES your palette. If you only want the Loopback-specific - tokens, copy the `--lb-*` block out of `design/tokens.css` instead. -free). `loopback-widget` drops the capture widget into `public/`. Register -`"@loopback"` in your `components.json` to install by name and let an agent -with the shadcn MCP browse the registry. +Three items: + +- **`loopback-theme`** ships the FULL shadcn theme contract (background, + foreground, primary, muted, ring, radius…) alongside the `--lb-*` feedback + status/severity tokens, so **installing it replaces your palette**. If you + only want the Loopback-specific tokens, copy the `--lb-*` block out of + [`design/tokens.css`](design/tokens.css) instead. +- **`loopback-components`** — vanilla CSS recipes for the shadcn component + vocabulary (`lb-btn`, `lb-badge`, `lb-card`…), for surfaces that want the + look without React. +- **`loopback-widget`** drops the capture widget into `public/`. + +Register `"@loopback"` in your `components.json` to install by name and let an +agent with the shadcn MCP browse the registry. ## Where it works (surfaces) @@ -230,18 +237,19 @@ Full matrix, native snippets (Swift/Kotlin/C#/shell), and the honest edges: ## The widget -~46KB (15KB gzipped) of dependency-free vanilla JS in a shadow-DOM host — it never fights +~58KB (19KB gzipped) of dependency-free vanilla JS in a shadow-DOM host — it never fights your app's CSS or framework. - **Capture**: pin mode highlights elements on hover; a click opens a viewport-clamped form (title / what happened / what you expected / type / severity). Type is pre-guessed: `backend` when failed requests exist, `usage` when AI context is present. -- **Functional context, always on**: ring buffers from page load — last 30 - console lines (log/warn/error + window errors + unhandled rejections), all - fetch/XHR calls (url/method/status/ms), and for failures (status ≥ 400 or - network error) up to **2KB of response body** into - `extra.failed_responses`. Calls to Loopback itself are never recorded. +- **Functional context, always on**: ring buffers from page load keep the last + 30 console lines (log/warn/error + window errors + unhandled rejections) and + the last 30 fetch/XHR calls (url/method/status/ms); a filed report carries + the most recent **15 of each**, plus — for failures (status ≥ 400 or network + error) — up to **2KB of response body** into `extra.failed_responses`. Calls + to Loopback itself are never recorded. - **AI/automation context**: the nearest ancestor with `data-loopback-context='{"run_id":...}'` is parsed into `extra.context`. - **Selector + element**: stable CSS selector (`#id` / `[data-testid]` @@ -270,6 +278,7 @@ your app's CSS or framework. | `loopback_submit_feedback` | File an item: project, type `ui\|backend\|usage\|ux`, severity `p0–p3`, route/url/selector, console[], network[], repro[], `extra` (run context…) | | `loopback_list_feedback` | Filter (project/route/status/type/severity/source/assignee) + paginate (`total`/`has_more`/`next_offset`); severity-then-newest | | `loopback_get_feedback` | Full item: all context + linked change + comment trail | +| `loopback_update_feedback` | Correct an item after filing: title, body, severity, type, project, or route — re-rank a severity, fix a mis-guessed type, move it to the right project | | `loopback_claim_feedback` | **Atomic** claim; a conflict names the holder; `force` to take over; `open/triaged → in_progress` | | `loopback_update_status` | `open → triaged → in_progress → fixed → verified \| wontfix`; note becomes an audit comment | | `loopback_add_comment` | Root-cause notes, questions, reasoning trail | @@ -290,6 +299,9 @@ Responses are markdown (default) or JSON via `response_format`, always with | `GET /queue/:id` | Full item view — all captured context + comment/status actions | | `POST /queue/:id/comment` · `POST /queue/:id/status` | Human triage writes (**same-origin only**) | | `GET /feedback/:id` | One item with its full trail, as JSON | +| `POST /feedback/:id/attachments` | Attach a screenshot or asset to an item (`name`/`intent`/`target` as query params, body is the bytes) | +| `GET /blob/:id/:attachmentId` | Fetch one attachment's bytes | +| `DELETE /feedback/:id/attachments/:attachmentId` | Remove an attachment | | `GET /widget.js` | The embeddable widget | | `GET /health` | Liveness | @@ -436,7 +448,7 @@ interaction-layer analysis, technical path). Calls made in this build: 6. **`/ingest` accepts unknown extra fields** (no `.strict()`) — older hubs must not reject newer widgets; forward compatibility beats strictness at the ingestion boundary. -7. **Widget is 57KB / 19KB gzipped, not the ~10KB sketch** — ring buffers, failure-body +7. **Widget is 58KB / 19KB gzipped, not the ~10KB sketch** — ring buffers, failure-body capture, live pins, repro steps, the route journey and the walkthrough earn their bytes; still zero deps, one file, served pre-compressed with an ETag. 8. **Marker-based merges** — `init` re-runs are byte-idempotent; files a human @@ -457,8 +469,11 @@ skills/ CANONICAL loopback SKILL.md — every other copy is rendered fro integrations/ canonical playbook + per-agent setup + widget embed + keep-alive plugin/ Claude Code plugin (skill + MCP registration); repo doubles as its marketplace scripts/ e2e.mjs · the six gates · canary-all.mjs · screenshot.mjs + release-preflight.mjs (pre-publish) · release-verify.mjs (post-publish) · bump-version.mjs docs/ the decision history (spec → memo → paths → technical path) + ROADMAP assets/ the README screenshot (generated by scripts/screenshot.mjs) +.github/ ci.yml · canary.yml · readme-checks.yml +.impeccable/ design-detector config (the skill itself is not vendored — see .gitignore) ``` Two manifests at the root do different jobs: `registry.json` publishes the @@ -475,7 +490,11 @@ AGENTS.md · CLAUDE.md · GEMINI.md the queue playbook, per agent .claude/ .agents/ the loopback skill for Claude Code / Codex .codex/ .gemini/ per-agent MCP + command registration .mcp.json MCP server registration for this repo -.claude-plugin/ marketplace manifest (repo hosts its own plugin) ``` +`.claude-plugin/` is the one root dot-directory `init` does **not** write: it is +the marketplace manifest for the plugin this repo hosts, maintained by hand and +bumped by `npm run bump`. `init-gate` asserts its version matches rather than +re-rendering it. + MIT © Dikshant Joshi diff --git a/design/README.md b/design/README.md index e020c1f..cae8e70 100644 --- a/design/README.md +++ b/design/README.md @@ -22,7 +22,7 @@ components theme themselves from that project's palette. What was deliberately **not** done: React, Tailwind, and Radix are not dependencies and never will be. The widget is injected into arbitrary host -pages and must stay a single ~29KB dependency-free file; the server must stay +pages and must stay a single ~58KB dependency-free file; the server must stay `npx`-installable with `tsc` as its only build. ## The tokens diff --git a/docs/05-surface-compatibility.md b/docs/05-surface-compatibility.md index 1d24cca..07cb788 100644 --- a/docs/05-surface-compatibility.md +++ b/docs/05-surface-compatibility.md @@ -43,7 +43,7 @@ crash/replay capture. | **WebView inside a native app** (WKWebView / Android WebView) | 1 | ✅ | Widget inside the webview; native shell unaffected | | **Native macOS / Windows** (SwiftUI·AppKit / WinUI·WPF) | 2 | ✅ | No DOM → no pins. A ~10-line debug-menu/hotkey handler POSTs `/ingest` with `route`=screen name, `console`=log tail, `extra`=build info (snippets below) | | **iOS / Android — simulator & emulator** | 2 | ✅ | iOS simulator shares the host's loopback; Android: `adb reverse tcp:7077 tcp:7077`. Then POST `/ingest` from a shake gesture or debug menu | -| **iOS / Android — physical device on LAN** | 2 | ✅ v0.4.0 | Run the hub with `--host 0.0.0.0` (opt-in; **no auth — trusted networks only**, the server warns loudly) and point the app at `http://:7077` | +| **iOS / Android — physical device on LAN** | 2 | ✅ v0.4.0 | Run the hub with `--host 0.0.0.0` (opt-in; **prints a bearer token — trusted networks only**, the server warns loudly) and point the app at `http://:7077` | | **iOS / Android — production** | 3 | ✅ via rails | Sentry SDK (crashes/errors) + PostHog SDK (replays/analytics) in the app; agents reach them via their MCPs today; a scheduled bridge into `/ingest` (`source: "sentry"|"posthog"`) is the roadmap ingestor | | **CLI / TUI / scripts / CI / cron** | 2 | ✅ | `curl -X POST :7077/ingest` with `reporter:"system"` — this repo's own CI-adjacent path; how the dogfood run filed most items | | **Coding agents / LLM automations** | 2 | ✅ | MCP tools directly (`reporter:"agent"`), or `/ingest` with `extra.context` run metadata — the `data-loopback-context` pattern, hand-rolled | @@ -121,8 +121,7 @@ curl -s -X POST http://127.0.0.1:7077/ingest -H 'Content-Type: application/json' - `--host 0.0.0.0` requires a bearer token (auto-generated, or `LOOPBACK_TOKEN`); `POST /ingest`, `/widget.js` and the pins projection stay open so the widget works; use it for device testing on networks you trust, and front it with a - token-gated reverse proxy for anything else. A built-in bearer token is the - next security milestone before any non-LAN exposure. + token-gated reverse proxy for anything else. - Native surfaces get no pins by design — pins are a DOM concept. The visible loop for Tier 2 is the `/queue` page (and, later, notifications). - Per the project's own rules (three manual reps before automating): native diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 60dee73..789f598 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -1,17 +1,23 @@ # Roadmap -Updated 2026-07-27. Open work lives here; shipped work — including the 21-pass +Updated 2026-08-02. Open work lives here; shipped work — including the 21-pass audit arc that took the suite from 11/20 to 20/20 — lives in the [CHANGELOG](../CHANGELOG.md). ## Open -**Nothing.** Distribution is complete end to end: +**CI on `main` has been red since 2026-07-27** — 16 consecutive `ci.yml` +failures, last green `623aa05` on 2026-07-26 — and 0.9.0, 0.9.1 and 0.9.2 were +all published on top of it. This branch fixes the failing check and makes the +release preflight refuse a commit whose CI is not green, so a red `main` stops +being publishable. + +Distribution itself is complete end to end: | Surface | State | |---|---| | GitHub | [joshidikshant/loopback](https://github.com/joshidikshant/loopback) | -| npm | `loopback-mcp-server@0.9.1` — cold-verified from the registry | +| npm | `loopback-mcp-server@0.9.2` — cold-verified from the registry | | MCP Registry | `io.github.joshidikshant/loopback` — status `active` | Every P1–P3 shipped or moved to Deliberate with a measured rationale. What the @@ -41,13 +47,24 @@ project needs next is not code: it is an adopter who is not DJ. a host page inert; claiming modality without enforcing it is worse. - **The widget is vanilla JS in a shadow DOM** — injected into arbitrary pages; React is not available to it. -- **Widget stays unminified:** 57,183 B raw / 18,945 B gzipped on the wire, +- **Widget stays unminified:** 59,443 B raw / 19,770 B gzipped on the wire + (measured the way the server compresses it, `gzipSync` at zlib's default level), 304 on repeats. Readable source is worth more to an auditing adopter than ~10KB of minifier savings. Revisit if adopters name first-load cost. ## Verification -Six gates + `smoke` + `e2e` in CI on every push; `npm run canary` (own -workflow: path-triggered + weekly) proves all 15 checks fail when their -subject breaks. Every gate's failure path is mutation-verified — the full -history and the nine false-green findings are in the CHANGELOG. +Seven gates + `smoke` + `e2e` in CI on every push; `npm run canary` (own +workflow: path-triggered + weekly) runs 26 checks proving each subject's gate +fails when the subject breaks — `release-preflight` in both directions, since a +gate that refuses everything would otherwise pass its own canary: it blocks a +commit whose CI is red and still clears one whose CI is green. Every gate's +failure path is mutation-verified — the full history and the nine false-green +findings are in the CHANGELOG. + +The seventh gate is `docs-facts-gate`, added after this audit: it re-measures +the widget's size, the tool count, the HTTP routes and the registry items +against the code, because every claim that had drifted was a hand-typed number +no gate had ever read. `link-gate` (own workflow) replaced a link check that had +been green since the day it was added while scanning zero links, and now asserts +a minimum link count per target so an empty crawl fails instead of passing. diff --git a/integrations/claude.md b/integrations/claude.md index fb3dbd3..6963abe 100644 --- a/integrations/claude.md +++ b/integrations/claude.md @@ -12,7 +12,7 @@ machine (recommended) or per project. ```bash # local checkout (fast startup): claude mcp add --scope user loopback -- node /ABS/PATH/loopback/dist/index.js -# or zero-install from GitHub: +# or zero-install from npm: claude mcp add --scope user loopback -- npx -y loopback-mcp-server ``` diff --git a/scripts/canary-all.mjs b/scripts/canary-all.mjs index e3106d6..713cb00 100644 --- a/scripts/canary-all.mjs +++ b/scripts/canary-all.mjs @@ -266,6 +266,39 @@ const CASES = [ s.replaceAll("${a.name}", "FILE").replaceAll("${a.path}", "PATH"), ), }, + { + gate: "link-gate", + cmd: ["node", ["scripts/link-gate.mjs"]], + guards: "a dead link in the README being caught", + apply: () => + mutate("README.md", (s) => + s.replace( + "https://github.com/getsentry/sentry-mcp", + "https://github.com/joshidikshant/loopback/tree/main/this-path-does-not-exist-canary", + ), + ), + }, + { + gate: "docs-facts-gate (tool count)", + cmd: ["node", ["scripts/docs-facts-gate.mjs"]], + guards: "the README's tool count matching the tools actually registered", + apply: () => + mutate("README.md", (s) => s.replace("## The MCP bus — 10 tools", "## The MCP bus — 9 tools")), + }, + { + gate: "docs-facts-gate (widget size)", + cmd: ["node", ["scripts/docs-facts-gate.mjs"]], + guards: "the documented widget size matching the file on disk", + apply: () => + mutate("README.md", (s) => s.replace("~58KB (19KB gzipped)", "~46KB (15KB gzipped)")), + }, + { + gate: "docs-facts-gate (undocumented route)", + cmd: ["node", ["scripts/docs-facts-gate.mjs"]], + guards: "every HTTP route appearing in the README surface table", + apply: () => + mutate("README.md", (s) => s.replace("| `GET /blob/:id/:attachmentId` |", "| `GET /blob-REMOVED` |")), + }, // 10a1c6d is permanently red (the a11y reflow failure) and 623aa05 is // permanently green. Both are immutable history, so these two anchors cannot // rot the way a mutation's anchor text can. diff --git a/scripts/docs-facts-gate.mjs b/scripts/docs-facts-gate.mjs new file mode 100644 index 0000000..54a85b6 --- /dev/null +++ b/scripts/docs-facts-gate.mjs @@ -0,0 +1,181 @@ +/** + * Docs-facts gate: the numbers in the docs must match the code they describe. + * + * Every other gate protects structure — that a file exists, renders, or matches + * its canonical source. None of them ever read a *claim*. So the drift that + * accumulated was entirely in hand-typed figures, and it was invisible: + * + * - the widget's size was quoted four different ways across four files + * (46KB/15KB, 57KB/19KB, 57,183 B, ~29KB) against a real 59,443 B, and TWO + * separate commits claimed to have "corrected the widget size" while each + * fixed only one of the occurrences; + * - "The MCP bus — 10 tools" sat above a table with 9 rows for two releases, + * with loopback_update_feedback — announced in the 0.8.0 changelog — + * missing; + * - the HTTP surface table silently omitted all three attachment endpoints. + * + * A number nobody re-measures is a claim, not a fact. This re-measures them. + * + * Deliberately NOT checked here: prose. This asserts only things with one + * correct answer that can be derived from the tree. + * + * Run: node scripts/docs-facts-gate.mjs + */ +import { execFileSync } from "node:child_process"; +import { readFileSync, statSync } from "node:fs"; +import { gzipSync } from "node:zlib"; +import { join } from "node:path"; + +const ROOT = process.cwd(); +const read = (rel) => readFileSync(join(ROOT, rel), "utf-8"); + +let failures = 0; +const ok = (m) => console.log(`✅ ${m}`); +const bad = (m) => { + failures++; + console.error(`❌ ${m}`); +}; +const check = (cond, m) => (cond ? ok(m) : bad(m)); + +// ── the widget's size, measured ────────────────────────────────────────────── +// The docs describe this figure as "on the wire", so it is measured the way the +// server actually produces it: gzipSync with no options (src/http.ts:396). That +// distinction is not pedantic — the same file is 19,770 B at zlib's default +// level, 19,753 B at level 9, and 19,751 B through the gzip(1) CLI. The +// previous figure had been measured with the CLI and labelled "on the wire", +// so it was wrong by both method and 19 bytes. +const widget = readFileSync(join(ROOT, "widget/loopback-widget.js")); +const rawB = statSync(join(ROOT, "widget/loopback-widget.js")).size; +const gzB = gzipSync(widget).length; +const rawKB = Math.round(rawB / 1024); +const gzKB = Math.round(gzB / 1024); +console.log(` widget measured: ${rawB} B raw / ${gzB} B gzipped as served → ~${rawKB}KB / ${gzKB}KB\n`); + +const readme = read("README.md"); +const roadmap = read("docs/ROADMAP.md"); +const designReadme = read("design/README.md"); + +// Any "KB" adjacent to a gzip claim in the README must be the real rounded +// size. Catching every KB figure in the file would be noisy, so this anchors on +// the two sentences that actually describe the bundle. +const kbClaims = [ + ...readme.matchAll(/~?(\d+)KB \((\d+)KB gzipped\)/g), + ...readme.matchAll(/Widget is (\d+)KB \/ (\d+)KB gzipped/g), +]; +check( + kbClaims.length >= 2, + `README still states the widget size in both places (found ${kbClaims.length})`, +); +for (const m of kbClaims) { + check( + Number(m[1]) === rawKB && Number(m[2]) === gzKB, + `README "${m[0]}" matches the measured ~${rawKB}KB / ${gzKB}KB`, + ); +} + +const exact = roadmap.match(/([\d,]+) B raw \/ ([\d,]+) B gzipped/); +check(!!exact, "docs/ROADMAP.md still states the widget's exact byte size"); +if (exact) { + const n = (s) => Number(s.replace(/,/g, "")); + check( + n(exact[1]) === rawB && n(exact[2]) === gzB, + `ROADMAP "${exact[0]}" matches the measured ${rawB} B / ${gzB} B`, + ); +} + +const designKB = designReadme.match(/single ~(\d+)KB dependency-free file/); +check(!!designKB, "design/README.md still states the widget size"); +if (designKB) { + check( + Number(designKB[1]) === rawKB, + `design/README.md "~${designKB[1]}KB" matches the measured ~${rawKB}KB`, + ); +} + +// ── the MCP tool count, counted ────────────────────────────────────────────── +const serverTs = read("src/server.ts"); +const tools = [...new Set([...serverTs.matchAll(/"(loopback_[a-z_]+)"/g)].map((m) => m[1]))].sort(); +const claimed = readme.match(/## The MCP bus — (\d+) tools/); +check(!!claimed, "README still has the 'The MCP bus — N tools' heading"); +if (claimed) { + check( + Number(claimed[1]) === tools.length, + `README claims ${claimed[1]} tools; src/server.ts registers ${tools.length}`, + ); +} +// The heading agreeing with the code is not enough — the table itself went a +// whole tool short while the heading was right. +const missingRows = tools.filter((t) => !readme.includes(`\`${t}\``)); +check( + missingRows.length === 0, + `every registered tool has a README row${missingRows.length ? ` — missing: ${missingRows.join(", ")}` : ""}`, +); + +// ── the HTTP surface, enumerated ───────────────────────────────────────────── +// Express route strings, normalised to the README's ":id" style. +const httpTs = read("src/http.ts"); +const routes = [...httpTs.matchAll(/app\.(get|post|delete|put)\(\s*"([^"]+)"/g)] + .map((m) => `${m[1].toUpperCase()} ${m[2]}`) + // /queue and /queue/:id are the dashboard SPA shell, documented as a page + // rather than an API endpoint; /mcp's GET+DELETE are the 405 pair the /mcp + // row already describes. + .filter((r) => !["GET /queue", "GET /queue/:id", "GET /mcp", "DELETE /mcp"].includes(r)); +const undocumented = routes.filter((r) => { + const path = r.split(" ")[1]; + return !readme.includes(path); +}); +check( + undocumented.length === 0, + `every HTTP route appears in the README surface table${ + undocumented.length ? ` — missing: ${undocumented.join(", ")}` : "" + }`, +); + +// ── the shadcn registry, enumerated ────────────────────────────────────────── +const registry = JSON.parse(read("registry.json")); +const items = (registry.items ?? []).map((i) => i.name); +const undocItems = items.filter((n) => !readme.includes(`\`${n}\``)); +check( + undocItems.length === 0, + `every shadcn registry item is documented${undocItems.length ? ` — missing: ${undocItems.join(", ")}` : ""}`, +); + +// ── the canary count, counted ──────────────────────────────────────────────── +// ROADMAP quotes how many checks the sweep runs; it said 15 while the array +// held 20. +const canary = read("scripts/canary-all.mjs"); +const caseCount = (canary.match(/^\s{2}\{$/gm) ?? []).length; +const canaryClaim = roadmap.match(/runs (\d+) checks/); +if (canaryClaim) { + check( + Number(canaryClaim[1]) === caseCount, + `ROADMAP claims ${canaryClaim[1]} canary checks; canary-all.mjs defines ${caseCount}`, + ); +} else { + ok("ROADMAP does not quote a canary count (nothing to drift)"); +} + +// ── npm's published version vs the tree ────────────────────────────────────── +// Only a warning: the tree is legitimately ahead between a bump and a publish. +const pkg = JSON.parse(read("package.json")); +try { + const latest = execFileSync("npm", ["view", "loopback-mcp-server", "version"], { + encoding: "utf-8", + stdio: "pipe", + }).trim(); + const quoted = [...roadmap.matchAll(/loopback-mcp-server@([\d.]+)/g)].map((m) => m[1]); + for (const v of quoted) { + check( + v === latest || v === pkg.version, + `ROADMAP quotes loopback-mcp-server@${v}; npm latest is ${latest}, tree is ${pkg.version}`, + ); + } +} catch { + console.log("⚠️ could not reach npm to compare the published version — skipped"); +} + +if (failures) { + console.error(`\nDOCS FACTS GATE FAILED — ${failures} claim(s) do not match the code`); + process.exit(1); +} +console.log("\nDOCS FACTS GATE PASSED 🎉 sizes, tool count, routes and registry items re-measured"); diff --git a/scripts/link-gate.mjs b/scripts/link-gate.mjs new file mode 100644 index 0000000..0fa4958 --- /dev/null +++ b/scripts/link-gate.mjs @@ -0,0 +1,93 @@ +/** + * Link gate: check the docs' links, and prove the check actually looked. + * + * The workflow step this replaces had been green since the day it was added + * without ever checking a single link. Two independent reasons, both silent: + * + * 1. `linkinator README.md docs integrations` takes ONE path. The extra + * arguments were ignored, and the run reported success. + * 2. `--skip "127.0.0.1|localhost|^#|shields.io"` is matched against every + * URL including the ROOT linkinator serves the files from — which is + * http://127.0.0.1:/. The skip matched the root, so the crawl + * never started. On its own that pattern took the scan from 24 links to 0, + * and "Successfully scanned 0 links" exits 0. + * + * A link checker that scans nothing is worse than no link checker: it is a + * green tick that means nothing. So this asserts a MINIMUM link count per + * target — the failure mode was never a broken link, it was an empty crawl. + * + * The localhost skip is anchored to the two ports the docs actually document + * (5173 demo, 7077 hub) so it cannot match linkinator's own random root port. + * + * Run: node scripts/link-gate.mjs + */ +import { execFileSync } from "node:child_process"; + +// Minimums are floors, not exact counts — docs grow. They exist to catch a +// crawl that collapsed to nothing, which is the failure that actually happened. +const TARGETS = [ + { glob: "README.md", min: 15 }, + { glob: "docs/*.md", min: 5 }, + { glob: "integrations/*.md", min: 3 }, +]; + +// Only the documented localhost endpoints, never a bare host: a bare 127.0.0.1 +// also matches the server linkinator itself spins up. +const SKIP = "^https?://(127\\.0\\.0\\.1|localhost):(5173|7077)"; + +let failures = 0; + +for (const { glob, min } of TARGETS) { + let out; + try { + out = execFileSync( + "npx", + ["--yes", "linkinator", glob, "--markdown", "--directory-listing", "--skip", SKIP, "--format", "json"], + { encoding: "utf-8", stdio: "pipe", maxBuffer: 32 * 1024 * 1024 }, + ); + } catch (e) { + // linkinator exits non-zero when it finds broken links; the JSON is still + // on stdout, so parse it rather than reporting a bare exit code. + out = e.stdout?.toString() ?? ""; + if (!out) { + failures++; + console.error(`❌ ${glob}: linkinator produced no output — ${e.message}`); + continue; + } + } + + let report; + try { + report = JSON.parse(out); + } catch { + failures++; + console.error(`❌ ${glob}: could not parse linkinator output`); + continue; + } + + const links = report.links ?? []; + const broken = links.filter((l) => l.state === "BROKEN"); + const scanned = links.filter((l) => l.state !== "SKIPPED").length; + + if (scanned < min) { + failures++; + console.error( + `❌ ${glob}: scanned only ${scanned} links (expected >= ${min}) — the crawl collapsed, ` + + "which is exactly how this check passed for weeks while looking at nothing", + ); + continue; + } + if (broken.length) { + failures++; + console.error(`❌ ${glob}: ${broken.length} broken link(s)`); + for (const b of broken) console.error(` [${b.status}] ${b.url}`); + continue; + } + console.log(`✅ ${glob}: ${scanned} links, none broken`); +} + +if (failures) { + console.error(`\nLINK GATE FAILED — ${failures} target(s)`); + process.exit(1); +} +console.log("\nLINK GATE PASSED 🎉 every target actually crawled, every link resolves"); diff --git a/server.json b/server.json index 9226d2e..521f336 100644 --- a/server.json +++ b/server.json @@ -7,6 +7,7 @@ "source": "github" }, "version": "0.9.2", + "websiteUrl": "https://github.com/joshidikshant/loopback", "packages": [ { "registryType": "npm", From 01fae5624570db128d4ecb6ed83c19b0a16464f3 Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:13:19 +0530 Subject: [PATCH 04/13] Gate the seam between the two canonical sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every parity check ran from one canonical source down to its renderings — canonical→installed, instructions-src→AGENTS block, plugin→canonical. Nothing compared the two canonical sources to EACH OTHER, and instructions-src.md's own header admits the sync is manual: the skill body "mirrors this text and must be updated with it". That was the last drift class in the repo with no check. They are deliberately not byte-identical — the skill carries frontmatter and resolves its own project slug, the playbook gets {{PROJECT}} substituted — so a diff cannot be the gate. The invariant is the loop: both must drive the same tools in the same order. An extra step in one is an agent working a different loop depending on which file it read. Also untracks dashboard/tsconfig.tsbuildinfo, tsc's incremental cache and the only tracked build artifact that was not deliberate. public/ stays committed — that one IS the distribution mechanism. Co-Authored-By: Claude Fable 5 --- .gitignore | 4 ++++ dashboard/tsconfig.tsbuildinfo | 1 - docs/ROADMAP.md | 2 +- scripts/canary-all.mjs | 14 ++++++++++++++ scripts/init-gate.mjs | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 2 deletions(-) delete mode 100644 dashboard/tsconfig.tsbuildinfo diff --git a/.gitignore b/.gitignore index 064b782..40e2e45 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,10 @@ dist/ dashboard/src/tokens.generated.css dashboard/node_modules/ .dashboard-freshness/ +# tsc's incremental cache — machine-generated churn, and the only build artifact +# that was ever tracked. public/ build output IS committed, deliberately: it is +# how the shadcn registry and the dashboard are served. +*.tsbuildinfo # Impeccable (design anti-pattern detector). # The CI gate runs the version-pinned npm devDependency, so nothing here is diff --git a/dashboard/tsconfig.tsbuildinfo b/dashboard/tsconfig.tsbuildinfo deleted file mode 100644 index 75093e8..0000000 --- a/dashboard/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/components/ui/alert-dialog.tsx","./src/components/ui/alert.tsx","./src/components/ui/attachment.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/empty.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/skeleton.tsx","./src/components/ui/sonner.tsx","./src/components/ui/table.tsx","./src/components/ui/textarea.tsx","./src/components/ui/tooltip.tsx","./src/lib/api.ts","./src/lib/identity.ts","./src/lib/utils.ts","./src/views/itemdetail.tsx","./src/views/queuelist.tsx","./vite.config.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 789f598..063a250 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -55,7 +55,7 @@ project needs next is not code: it is an adopter who is not DJ. ## Verification Seven gates + `smoke` + `e2e` in CI on every push; `npm run canary` (own -workflow: path-triggered + weekly) runs 26 checks proving each subject's gate +workflow: path-triggered + weekly) runs 27 checks proving each subject's gate fails when the subject breaks — `release-preflight` in both directions, since a gate that refuses everything would otherwise pass its own canary: it blocks a commit whose CI is red and still clears one whose CI is green. Every gate's diff --git a/scripts/canary-all.mjs b/scripts/canary-all.mjs index 713cb00..6b568d7 100644 --- a/scripts/canary-all.mjs +++ b/scripts/canary-all.mjs @@ -266,6 +266,20 @@ const CASES = [ s.replaceAll("${a.name}", "FILE").replaceAll("${a.path}", "PATH"), ), }, + { + gate: "init-gate (canonical ↔ canonical)", + cmd: ["node", ["scripts/init-gate.mjs"]], + guards: "the repo's two canonical sources driving the same loop", + apply: () => + // A step added to the playbook and not to the skill: the exact manual-sync + // failure the check exists for. + mutate("integrations/instructions-src.md", (s) => + s.replace( + "### The loop\n", + "### The loop\n\n0. `loopback_get_stats()` — check which projects have open items.\n", + ), + ), + }, { gate: "link-gate", cmd: ["node", ["scripts/link-gate.mjs"]], diff --git a/scripts/init-gate.mjs b/scripts/init-gate.mjs index 1ef8aa1..2c9a2f1 100644 --- a/scripts/init-gate.mjs +++ b/scripts/init-gate.mjs @@ -294,6 +294,40 @@ for (const dir of [fresh, seeded, subset]) rmSync(dir, { recursive: true, force: "plugin/skills/loopback/SKILL.md matches the canonical template (the plugin ships its own copy)", ); + // There are TWO self-declared canonical sources, and every check above runs + // from one of them down to its renderings. Nothing compared them to EACH + // OTHER — instructions-src.md says the skill body "mirrors this text and must + // be updated with it", and that sync was purely manual. It is the one drift + // class in this repo with no automated check. + // + // They are not byte-identical by design (the skill carries frontmatter and + // resolves its own project slug, the playbook gets {{PROJECT}} substituted), + // so the invariant is the loop itself: both must drive the same tools in the + // same order. Adding a step to one and not the other is the failure that + // matters — an agent reading the skill would work a different loop than one + // reading AGENTS.md. + const instructionsSrc = readFileSync(join(process.cwd(), "integrations", "instructions-src.md"), "utf-8"); + const playbook = instructionsSrc.split("")[1]?.split("")[0]; + const loopTools = (text, heading) => { + const m = new RegExp(`${heading}\\n(.*?)(?=\\n#{2,3} )`, "s").exec(text); + if (!m) return null; + return [...new Set(m[1].match(/loopback_[a-z_]+/g) ?? [])]; + }; + const srcLoop = playbook ? loopTools(playbook, "### The loop") : null; + const skillLoop = loopTools(canonical, "## The loop"); + assert( + srcLoop !== null && skillLoop !== null, + "both canonical sources still have a parseable 'The loop' section", + ); + assert( + JSON.stringify(srcLoop) === JSON.stringify(skillLoop), + `the two canonical sources drive the same loop in the same order${ + srcLoop && skillLoop && JSON.stringify(srcLoop) !== JSON.stringify(skillLoop) + ? `\n instructions-src: ${srcLoop.join(" → ")}\n SKILL.md: ${skillLoop.join(" → ")}` + : "" + }`, + ); + // Three version fields the npm release does not touch, so they rot silently: // both were still 0.8.0 two published releases later. const pkgVersion = JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8")).version; From 21cebd30af0a20959e101c88d13f10f05a84c7f4 Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:15:31 +0530 Subject: [PATCH 05/13] Date docs/04 and name the zip it points at MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Its opening line says "see the attached zip", which dangles here: this file is committed verbatim from the workspace repo, and no zip exists in this one. The note names what the archive was (now commit b9d1567) and flags which of its figures are Phase-0 rather than current — 9 tools, no dashboard, no HTTP auth. Applied identically in the workspace repo so both copies stay byte-identical. Co-Authored-By: Claude Fable 5 --- docs/04-technical-path.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/04-technical-path.md b/docs/04-technical-path.md index 8bec9e0..99e4b28 100644 --- a/docs/04-technical-path.md +++ b/docs/04-technical-path.md @@ -2,6 +2,13 @@ *Companion to the build-vs-borrow memo. This is the concrete "how": what to install, what was built, and the exact wiring. The Loopback Phase-0 server described here is **already built and passing its end-to-end tests** — see the attached zip.* +> **Historical, written 2026-07-20.** "The attached zip" was the v0.2.0 kickoff +> archive; its contents are the Loopback product repo's first commit, +> `b9d1567`. Every figure below describes that Phase-0 snapshot — 9 tools, no +> dashboard, no auth on the HTTP surface, SDK v1.29 — and none of it is +> current: the shipped product has ten tools, a dashboard, and a bearer token on +> non-loopback binds. For what is true today, read the product repo's README. + --- ## 1. The path in one picture From 9498b67fcdbc922c90b8389ddf42fbec34869f7c Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:17:57 +0530 Subject: [PATCH 06/13] Require a release tag, and backfill the three that were never cut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tag discipline stopped exactly when public publishing began. v0.3.0 through v0.8.0 are all tagged; 0.9.0, 0.9.1 and 0.9.2 — the only three versions that ever reached npm — were not, so the releases people actually installed are the ones nobody can check out. v0.9.0 (f472687), v0.9.1 (17bd8ba) and v0.9.2 (2f96190) are now tagged retroactively, each verified against the package.json version at that commit. release-preflight now refuses to publish unless v exists AND points at the commit being published, so this cannot silently lapse again, and `npm run bump` prints the tag command as part of the release sequence. Co-Authored-By: Claude Fable 5 --- scripts/bump-version.mjs | 6 ++++-- scripts/release-preflight.mjs | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/bump-version.mjs b/scripts/bump-version.mjs index 0bdaa8c..f18e5f7 100644 --- a/scripts/bump-version.mjs +++ b/scripts/bump-version.mjs @@ -83,8 +83,10 @@ console.log(` Next: npm run build && npm run smoke && node scripts/init-gate.mjs # parity gates git commit && git push # push BEFORE publishing - # …then WAIT for CI to go green on that commit. npm publish now runs - # release-preflight first and refuses a red or still-running commit. + git tag -a v${NEXT} -m "v${NEXT}" && git push origin v${NEXT} + # …then WAIT for CI to go green on that commit. npm publish runs + # release-preflight first and refuses a commit that is red, still running, + # unpushed, or untagged. npm publish --otp= mcp-publisher publish npm run verify:release diff --git a/scripts/release-preflight.mjs b/scripts/release-preflight.mjs index ad8f9ff..3d61617 100644 --- a/scripts/release-preflight.mjs +++ b/scripts/release-preflight.mjs @@ -100,6 +100,20 @@ if (!wantSha) { } else { ok(`${sha.slice(0, 7)} is pushed (${onRemote.out.split("\n")[0].trim()})`); } + + // Tag discipline stopped exactly when public publishing began: v0.3.0-v0.8.0 + // are all tagged, and 0.9.0, 0.9.1 and 0.9.2 — the only versions that ever + // reached npm — were not. An untagged release is one nobody can check out. + const pkgVersion = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf-8")).version; + const tag = `v${pkgVersion}`; + const tagged = tryRun("git", ["rev-list", "-n", "1", tag]); + if (!tagged.out) { + bad(`${tag} does not exist — tag the release commit before publishing:\n git tag -a ${tag} -m "${tag}" && git push origin ${tag}`); + } else if (tagged.out !== sha) { + bad(`${tag} points at ${tagged.out.slice(0, 7)}, not the commit being published (${sha.slice(0, 7)})`); + } else { + ok(`${tag} points at the commit being published`); + } } // ── did CI pass on it ──────────────────────────────────────────────────────── From 560c4c960bf7ba2757290150caad1b2c75bab2cd Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:19:15 +0530 Subject: [PATCH 07/13] Add CONTRIBUTING, SECURITY and issue/PR templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub scored this repo's community health at 42%: LICENSE and README and nothing else. For a project whose whole pitch is that an adopter can wire it into their own agents in two minutes, the absence of a contributing guide and a private disclosure channel is a real barrier, not a metadata gap. CONTRIBUTING states the doctrine the repo already runs on rather than inventing a new one: a gate that cannot fail is decorative, so a new gate needs a canary case and a new number in the docs needs a docs-facts-gate check. It lists the gate suite as CI actually invokes it, and points at the README's repo map instead of copying it, so it cannot drift. SECURITY documents the model that already exists in the code, verified line by line rather than described from memory: origins pinned at startup instead of read from Host (DNS rebinding), the cross-origin pin projection that keeps captured response bodies from ever leaving, the token on non-loopback binds moved into an HttpOnly SameSite=Lax cookie and compared with timingSafeEqual over SHA-256, the four endpoints deliberately left open, and the 60/min intake limit. It is equally explicit about what is NOT a vulnerability — unauthenticated local filing is the product, and deployed public sites are an unsupported surface since Chrome 142+ blocks them. Also gives docs-facts-gate and link-gate the `npm run` aliases every other gate already had. Co-Authored-By: Claude Fable 5 --- .github/ISSUE_TEMPLATE/bug_report.yml | 82 ++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 11 ++ .github/ISSUE_TEMPLATE/feature_request.yml | 44 +++++++ .github/pull_request_template.md | 19 +++ CONTRIBUTING.md | 146 +++++++++++++++++++++ SECURITY.md | 108 +++++++++++++++ package.json | 6 +- 7 files changed, 414 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/pull_request_template.md create mode 100644 CONTRIBUTING.md create mode 100644 SECURITY.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..91964ef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,82 @@ +name: Bug report +description: Something behaves differently from what the docs say it does. +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Every field below is something the first triage question would ask for + anyway. If the problem is exploitable, do not file it here — see + SECURITY.md for the private channel. + + - type: textarea + id: what + attributes: + label: What happened, and what you expected instead + validations: + required: true + + - type: textarea + id: repro + attributes: + label: Steps to reproduce + description: The smallest sequence that shows it, including the command you ran. + placeholder: | + 1. loopback-mcp-server --http + 2. ... + 3. ... + validations: + required: true + + - type: input + id: version + attributes: + label: Loopback version + description: >- + `loopback-mcp-server --help` prints it on the first line; a running hub + also reports it at `GET /health`. Or read `version` from package.json. + validations: + required: true + + - type: input + id: node + attributes: + label: Node version + description: "`node -v` — Loopback needs >= 22.13 for built-in node:sqlite." + validations: + required: true + + - type: dropdown + id: agent + attributes: + label: Agent / client + options: + - Claude Code + - Codex + - Gemini CLI + - Another MCP client + - No agent — widget or HTTP only + validations: + required: true + + - type: dropdown + id: transport + attributes: + label: Transport + description: How the server was running when it happened. + options: + - stdio (the agent spawns the server) + - --http on 127.0.0.1 (the hub) + - --http --host (LAN bind, bearer token) + - Not applicable + validations: + required: true + + - type: textarea + id: evidence + attributes: + label: Server output, failing request, console trail + description: >- + Server stderr, the browser console, the response body of a failing call. + Redact any token before pasting. + render: text diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..26a7c1a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +# Blank issues stay enabled on purpose: this project needs adopters more than it +# needs tidy metadata, and a stranger with a question should not be turned away +# at the door. The two forms are the guided path, not a toll gate. +blank_issues_enabled: true +contact_links: + - name: Docs, quickstart and the surface matrix + url: https://github.com/joshidikshant/loopback#readme + about: Setup for Claude Code / Codex / Gemini CLI, the HTTP surface, and where the widget does and does not work. + - name: Report a security vulnerability + url: https://github.com/joshidikshant/loopback/security/advisories/new + about: Anything exploitable goes here privately, never in a public issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..fd3028b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,44 @@ +name: Feature request +description: Propose something Loopback should do that it does not. +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Loopback is deliberately only the bus and the capture layer — crash + capture, session replay and browser driving are borrowed from mature + MCP-native tools rather than rebuilt (docs/02-build-vs-borrow-memo.md). + A proposal that moves that line needs to say why borrowing does not work. + + - type: textarea + id: problem + attributes: + label: The problem + description: What you hit in real use — not the feature, the thing that made you want it. + validations: + required: true + + - type: textarea + id: proposal + attributes: + label: What you want it to do + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: What you tried instead + description: >- + The existing doors are the widget, `POST /ingest`, the MCP tools and the + /queue page. Which came closest, and where did it stop? + + - type: checkboxes + id: evidence + attributes: + label: Evidence + description: >- + Deferred-until-demanded is the default here — the roadmap holds several + features waiting for exactly this. + options: + - label: I have hit this in real use, not just in principle diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..6e788b8 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,19 @@ +## What this changes + + + +## Why + + + +## Checks + +- [ ] `npm run build` and `npm run smoke` pass locally +- [ ] the gates this change touches pass — the list is in CONTRIBUTING.md +- [ ] a new gate comes with its canary case in `scripts/canary-all.mjs`, so it is + proven to fail when its subject breaks +- [ ] a new number in the docs comes with a check in `scripts/docs-facts-gate.mjs` +- [ ] no generated file was hand-edited — playbook changes go into + `integrations/instructions-src.md` and `skills/loopback/SKILL.md` first + +Delete a line that does not apply rather than leaving it unticked. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..484c010 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,146 @@ +# Contributing + +One rule governs everything below: **a gate that cannot fail is decorative.** +Twenty audit passes on this repo found the same defect nine separate times — a +check reporting green on something it could not see. So a passing suite is not +evidence here. Evidence is a check that has been *shown* to fail when the thing +it guards breaks. + +Loopback is solo-maintained and pre-1.0. Issues and PRs are welcome; expect a +human on their own schedule, not a rota. + +## Prerequisites + +Node **≥ 22.13** (`package.json` → `engines`). The store is built-in +`node:sqlite`, so there is nothing native to compile and no toolchain to +install. + +```bash +npm ci +npm ci --prefix dashboard # dashboard/ is its own package with its own lockfile +npm run build +``` + +That is exactly what CI installs (`.github/workflows/ci.yml`). The dashboard +install matters even if you never touch React: `dashboard-gate` rebuilds +`dashboard/src` and compares it against the committed output in +`public/dashboard/`, and it cannot do that without those dependencies. + +## The gate suite + +`ci.yml` runs all of these on every pull request and every push to `main`. The +commands below are the ones CI actually invokes; each also has an +`npm run ` alias in `package.json`. + +| Command | What it guards | +|---|---| +| `npm run build` | `tsc` | +| `npm run smoke` | a real MCP client over stdio — every tool, the full loop, the atomic-claim conflict, and the coupled registry-identity fields (`mcpName` = `server.json` name, the 100-char description cap) | +| `node scripts/init-gate.mjs` | `init` renders for all three agents, byte-idempotently, without clobbering a file a human has taken over | +| `node scripts/registry-gate.mjs` | the published shadcn registry still resolves and installs, and its theme still matches `design/tokens.css` | +| `node scripts/dashboard-gate.mjs` | the committed dashboard build has not drifted from `dashboard/src` | +| `node scripts/widget-token-gate.mjs` | the widget's *inlined* token copy still equals `design/tokens.css` — it ships as one file and cannot `@import` them, so it is the one surface that can drift silently | +| `node scripts/impeccable-gate.mjs` | design anti-patterns in the shipped UI | +| `node scripts/docs-facts-gate.mjs` | the numbers the docs assert, re-measured against the code | +| `node scripts/e2e.mjs` | Playwright: pin capture → 500-body and run-context assertions → an agent over MCP-HTTP → green pins; also the LAN auth split in both directions and the ingest rate limit | +| `node scripts/a11y-gate.mjs` | contrast, target size, accessible names, landmarks and motion, measured in a real browser | + +Two more run in their own workflows, because they are slow or externally paced: + +| Command | What it guards | When | +|---|---|---| +| `node scripts/link-gate.mjs` | every link in `README.md`, `docs/` and `integrations/` resolves — **and that the crawl was not empty**, which is how its predecessor stayed green for weeks while scanning zero links | `readme-checks.yml`: on changes to those paths, and weekly | +| `npm run canary` | that every gate above fails when its subject breaks | `canary.yml`: on changes to what it mutates, weekly, and on demand | + +## A gate that cannot fail is decorative + +`scripts/canary-all.mjs` makes that claim executable instead of asserting it in +a checklist. For each gate it applies **one surgical mutation** to the thing +that gate protects, runs the gate, and requires a non-zero exit. A gate that +still passes with its subject broken is reported as decorative and the sweep +fails. + +The sweep is built to resist passing for the wrong reason, the same way the +gates are: + +- every mutation is reverted in a `finally`, including on SIGINT, so a run + cannot leave the tree dirty; +- a "mutation" that changed nothing is itself a failure — that is how a moved + anchor gets caught instead of quietly recording a false pass; +- a mutation that breaks `tsc` is a failure too, because then the gate would + fail for the wrong reason and prove nothing; +- fail-closed gates carry the complement (`expect: 0`), asserting the gate + still passes on a healthy subject — a gate that refuses everything would + otherwise sail through its own canary. + +Two consequences for a pull request: + +**A new gate needs a canary case** in `scripts/canary-all.mjs`: the gate's +command, one mutation to what it guards, and the build it needs. Without one, +the gate is an unverified claim. + +**A new number in the docs needs a check** in `scripts/docs-facts-gate.mjs`. +Every figure that had drifted in this repo was hand-typed and read by no gate: +the widget's size was quoted four different ways across four files, and "10 +tools" sat above a nine-row table for two releases. That gate re-measures the +widget's size, the tool count, the HTTP routes and the registry items. It +deliberately checks nothing with more than one correct answer, so prose stays +out — and it reads `README.md`, `docs/ROADMAP.md` and `design/README.md`, so put +a measurable claim where a gate can see it. + +## Publishing + +`scripts/release-preflight.mjs` is wired as `prepublishOnly`, so `npm publish` +enforces it rather than trusting anyone to remember. It refuses a dirty tree +(the tarball would not be the commit CI tested), a commit that is on no remote +branch (nothing has tested it), a run still in flight, and any `ci.yml` +conclusion that is not `success`. + +It **fails closed**: no `gh`, no auth, or no network is a refusal, not a pass — +an unknown CI result is exactly the state that let 0.9.0, 0.9.1 and 0.9.2 all +ship on top of a red `main`. The override is explicit and auditable — +`LOOPBACK_ALLOW_RED_CI=1` — and it prints a warning telling you to say so in the +release notes. + +## Where things live + +The repo map is in the [README](README.md#repo-map); it is not repeated here so +it cannot drift. + +## Canonical sources — edit these, never the renderings + +`init` renders one playbook into every agent's native mechanism, so a number of +files in this tree are generated. Editing a rendering gets reverted by the next +`init` run, and `init-gate` fails in CI before that. + +[`integrations/instructions-src.md`](integrations/instructions-src.md) is the +one source of truth for how an agent works the queue; its own header carries the +rendering table. `init` reads the block between the `playbook:begin` / +`playbook:end` markers and substitutes `{{PROJECT}}` with the repo's slug. It +renders into: + +- `AGENTS.md` § "Working the Loopback queue" — canonical for Codex and Gemini + CLI, which read it natively; Claude Code reaches it through the `@AGENTS.md` + import in `CLAUDE.md` +- `.claude/skills/loopback/SKILL.md` (Claude Code, also installed by the plugin) +- `.agents/skills/loopback/SKILL.md` (Codex) +- `.gemini/commands/loopback.toml` (Gemini CLI's `/loopback`) + +[`skills/loopback/SKILL.md`](skills/loopback/SKILL.md) is the canonical skill +every adopter gets. It mirrors the playbook text and must be updated with it; +`plugin/skills/loopback/SKILL.md` is the plugin's own copy, and `init-gate` +asserts both match. + +Because this repo onboards *itself*, its root `AGENTS.md`, `CLAUDE.md`, +`GEMINI.md` and agent dot-directories are those renderings — working proof the +command produces what it claims. `init-gate` re-renders them on every CI run and +fails on any drift. + +## Filing what you find + +Loopback is its own reference integration. With the hub running, the widget is +embedded on `/queue` under `data-project=loopback`, and every defect in this +repo's history was filed and closed through its own queue — see [Giving feedback +*about* Loopback](README.md#giving-feedback-about-loopback). GitHub issues are +for anything a stranger should see. Anything exploitable goes to +[SECURITY.md](SECURITY.md) instead. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..9085239 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,108 @@ +# Security + +## Reporting a vulnerability + +Report it **privately**, through GitHub: the repository's **Security** tab → +**Report a vulnerability** +(). That opens +a draft GitHub Security Advisory visible only to you and the maintainer, and it +is the only private channel — there is no security mailing address to write to. + +Please do not open a public issue for something exploitable. If the Security tab +shows no report button, open an issue that says *only* that you have a security +report and nothing else, and it will be moved to a private advisory. + +Loopback is solo-maintained. Expect one human on their own schedule, not a +triage rota or an SLA. + +## Supported versions + +| Version | Supported | +|---|---| +| the latest version published to npm | yes | +| anything older | no — upgrade | + +There is no backport branch and no LTS line. A fix lands on `main`, CI has to be +green on that exact commit before it can be published (see +[CONTRIBUTING.md](CONTRIBUTING.md#publishing)), and it ships as a new release. +`npm view loopback-mcp-server version` is the authority on what "latest" is. + +## The security model + +Loopback is a local development tool. The whole model follows from one thing +that is easy to get wrong: **the trust boundary is not "localhost"** — a +loopback port is reachable from every page open in your browser. + +**Bound to `127.0.0.1:7077` by default**, and there is no token on a loopback +bind: it would protect nothing the OS does not already protect, and every local +MCP client, script and browser tab would have to carry it (`src/index.ts`). + +**Trusted origins are pinned at startup from the bind config**, never derived +from the request's `Host` header (`trustedOrigins()` in `src/http.ts`). `Host` +is attacker-influenced: a domain that resolves to 127.0.0.1 (DNS rebinding) +arrives with `Host` *and* `Origin` both set to that domain, so a "does Origin +equal my own Host" test passes for a site that is not us. + +**Everything that reads full context or changes state requires a trusted +origin** and answers 403 otherwise (`requireTrustedOrigin()` in `src/http.ts`): +the triage writes `POST /queue/:id/comment` and `POST /queue/:id/status`, full +item reads, blob reads, attachment deletes, and `POST /mcp` — which exposes +every tool, so leaving it open would let any page in the operator's browser read +every project's queue and silently resolve items. Local tooling that sends no +`Origin` (curl, MCP clients) still works. + +**Cross-origin reads get the pin projection only** (`pinProjection()` in +`src/http.ts`, applied to every untrusted-origin read of `GET /feedback`): id, +project, route, title, type, severity, status, assignee, selector, PR link, +timestamps. `extra` — captured response bodies, which routinely contain auth +headers — is never served cross-origin. + +**A non-loopback bind is opt-in and requires a bearer token.** `--host` / +`LOOPBACK_HOST` widening the bind makes the server generate a token, or take +`LOOPBACK_TOKEN`, and print a `?token=…` URL (`src/index.ts`). The token is +accepted once from the query string, moved into an `HttpOnly; SameSite=Lax` +cookie and stripped from the URL by a redirect, so it does not persist in +history or referrers. Tools send `Authorization: Bearer `. Comparison is +constant-time over a SHA-256 digest, so neither the value nor its length leaks +through timing (`safeEqual()` in `src/http.ts`). + +**Four things stay open on a token bind, deliberately** (`requireAuth()` in +`src/http.ts`): `POST /ingest` and `GET /widget.js`, because the widget runs on +a phone against an arbitrary host page and has nowhere to keep a secret; +`GET /feedback?view=pins`, a strict projection of what is already drawn on the +screen; and `GET /health`. Everything else answers 401. `scripts/e2e.mjs` +asserts that split in both directions, and `npm run canary` proves the assertion +fails when the check is disabled. + +**Intake is rate limited**: 60 requests per minute per IP on `POST /ingest`, +429 past that, active only when a token is — i.e. on a non-loopback bind +(`ingestLimited()` in `src/http.ts`). Append-only intake means a LAN caller can +file noise; the limit means they cannot fill the disk. + +**Item URLs render as links only when they are `http(s)`** — `safeHref()` in +`dashboard/src/lib/api.ts` resolves the URL and reads its protocol; `data:`, +`vbscript:` and `file:` render as plain text. + +## Out of scope + +**Unauthenticated local feedback is the product.** On a loopback bind, anything +that can reach the port can file an item. That is the design — the widget runs +on whatever origin your dev app serves from and has no credential to present. + +**Deployed public sites are not a supported surface.** Chrome 142+ Local Network +Access blocks a public page from reaching `127.0.0.1`, so the widget is a +build-time tool, not production feedback capture +([docs/05-surface-compatibility.md](docs/05-surface-compatibility.md)). Use the +Sentry/PostHog rails for production signal. A report that the widget cannot +reach the hub from a deployed site is a compatibility note, not a vulnerability. + +**A token on a LAN bind is a shared secret on a trusted network, not real +auth.** It exists so device testing is not wide open. Exposing Loopback beyond a +LAN without a token-gated reverse proxy in front is a deployment choice, and the +server warns loudly about it at startup. + +**What the queue stores is sensitive by nature.** Pins carry console tails and +up to 2KB of failed response bodies, which routinely include auth headers, and +they live in `~/.loopback/loopback.db` and `~/.loopback/blobs/` on the +operator's own machine. Treat that database as secret material — that is exactly +why `extra` never crosses an origin. diff --git a/package.json b/package.json index 86ca8ae..f2373aa 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "loopback-mcp-server", "mcpName": "io.github.joshidikshant/loopback", "author": "Dikshant Joshi", - "version": "0.9.2", + "version": "0.9.3", "files": [ "dist", "widget", @@ -13,7 +13,7 @@ "registry.json", "CHANGELOG.md" ], - "description": "Loopback \u2014 a project-tagged feedback bus for coding agents (Claude Code, Codex, Gemini CLI) over MCP. Capture UI/backend/usage/UX feedback once; let any agent claim, fix, and write the change back.", + "description": "Loopback — a project-tagged feedback bus for coding agents (Claude Code, Codex, Gemini CLI) over MCP. Capture UI/backend/usage/UX feedback once; let any agent claim, fix, and write the change back.", "type": "module", "main": "dist/index.js", "bin": { @@ -39,6 +39,8 @@ "impeccable-gate": "node scripts/impeccable-gate.mjs", "widget-token-gate": "node scripts/widget-token-gate.mjs", "a11y-gate": "node scripts/a11y-gate.mjs", + "docs-facts-gate": "node scripts/docs-facts-gate.mjs", + "link-gate": "node scripts/link-gate.mjs", "canary": "node scripts/canary-all.mjs", "verify:release": "node scripts/release-verify.mjs" }, From 7664df726da20e51732e15a2c5ec0f84a0021779 Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:19:22 +0530 Subject: [PATCH 08/13] Release 0.9.3 Six coupled version fields via `npm run bump`, plus the changelog entry for the accuracy pass: the a11y fix that unsticks CI, release-preflight, docs-facts-gate, link-gate, the canonical-source seam check, and the backfilled 0.9.x tags. This one has to be a release rather than a docs commit: the mangled shadcn paragraph is in the published 0.9.2 readme, and an npm readme can only be replaced by publishing over it. Co-Authored-By: Claude Fable 5 --- .claude-plugin/marketplace.json | 2 +- CHANGELOG.md | 112 ++++++++++++++++++++++++++++-- plugin/.claude-plugin/plugin.json | 2 +- server.json | 4 +- src/server.ts | 2 +- 5 files changed, 113 insertions(+), 9 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 87b183f..cd58e6d 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -10,7 +10,7 @@ "name": "loopback", "source": "./plugin", "description": "Feedback hub: pin feedback on your live app; agents claim, fix, and write back over MCP; the pin turns green.", - "version": "0.9.2" + "version": "0.9.3" } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index fda8ff9..f5f0df9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,107 @@ All notable changes to Loopback are documented here. The format follows ## [Unreleased] +## [0.9.3] — accuracy pass: a red CI nobody was watching, and docs nothing checked + +### Fixed — CI had been red for six days, and three releases shipped on top of it +`ci.yml` failed on **sixteen consecutive runs**, from 2026-07-27 (`f7dfa27`) +through 2026-08-02. Last green was `623aa05`. 0.9.0, 0.9.1 and 0.9.2 were all +published inside that window, so all three shipped two real WCAG 1.4.4/1.4.10 +failures as product defects, not just a red badge. + +The a11y gate had **never passed on CI at all**: it was added in `d2ca476` and +pushed in a batch with 27 other commits, so its first run was already red. + +The bug was real and one line. `Updated` rendered `item.updated_at` as a bare +ISO timestamp with no `break-all`, while every other value in that card +(project, source/reporter, assignee, route) had one. An ISO string is a single +24-char token with no break opportunity, so at 200% text zoom it set a 236px +min-content floor that the section's `min-w-0` could not shrink. On macOS that +lands at 301px and passes a 320px viewport; on CI's Linux font metrics it +measures ~325px — exactly the `{"s":325,"c":320}` in every failing run, and why +it never reproduced locally. Now clears 320px with 40px of headroom. + +### Added — `release-preflight`: publishing requires a green, pushed, tagged commit +The gates verify the source. `verify:release` deliberately runs *after* a +publish, against published artifacts, where npm's immutability means it can only +report damage. Nothing ever asked the question in between, which is how a red +`main` stayed publishable three times. + +`release-preflight` runs as `prepublishOnly`: clean tree, commit pushed, a +completed successful `ci.yml` run for that exact sha, and a `v` tag +pointing at it. It **fails closed** — an unreachable GitHub is a refusal, not a +pass, since "unknown" is the state that let the last three releases through. +`LOOPBACK_ALLOW_RED_CI=1` is the explicit, auditable override. + +Two traps found by running it rather than reading it: the GitHub API matches +`head_sha` on the full 40-char sha only, so an abbreviated sha returns an empty +run list — indistinguishable from "never tested"; and a fail-closed gate sails +through a canary that only checks for a non-zero exit, so the sweep asserts +**both** directions against two immutable commits (`10a1c6d` red must fail, +`623aa05` green must pass). + +Tags `v0.9.0`, `v0.9.1` and `v0.9.2` were created retroactively. Tag discipline +had stopped exactly when public publishing began: everything from v0.3.0 to +v0.8.0 is tagged, and the only three versions that ever reached npm were not. + +### Added — `docs-facts-gate`: the numbers in the docs are re-derived from the code +Every structural gate was green while the docs drifted, because none of them +ever read a *claim*. Everything that had rotted was a hand-typed figure: + +- the widget was quoted **four** ways — 46KB/15KB, 57KB/19KB, 57,183 B, ~29KB — + against a real 59,443 B, and two separate commits each claimed to have + "corrected the widget size" while fixing one occurrence out of two; +- "The MCP bus — 10 tools" sat above a 9-row table, missing + `loopback_update_feedback`, which the 0.8.0 entry below announced; +- the HTTP surface table omitted all three attachment endpoints; +- the shadcn section documented two registry items and shipped three; +- the repo map claimed `init` writes `.claude-plugin/` (it does not) and that + `init-gate` re-renders it (it asserts a version), and omitted `.github/` and + `.impeccable/`. + +Measuring it exposed a smaller error inside the bigger one: "19,751 B gzipped on +the wire" was measured with the `gzip(1)` CLI, but the server serves `gzipSync` +at zlib's default level — 19,770 B. Three plausible numbers for one file, so the +gate measures it the way `src/http.ts` actually produces it. + +### Fixed — the README's shadcn section was mangled, on GitHub and on npm +A sentence cut off mid-clause, a contradictory replacement pasted over it, and +an orphan `free).` fragment. Live on `main` and in the published 0.9.2 readme, +which is why this needed a release rather than a docs commit. + +### Fixed — `link-gate`: the link check had never checked a link +The CI step had been green since the day it was added while scanning **zero** +links, for two independent reasons: `linkinator README.md docs integrations` +silently ignores every path after the first, and `--skip "127.0.0.1|…"` matched +the root linkinator serves the files from, so the crawl never started. That one +pattern took the scan from 24 links to 0, and "Successfully scanned 0 links" +exits 0. The gate now asserts a **minimum link count per target**, because the +failure was never a broken link — it was an empty crawl. + +### Added — `init-gate` covers the seam between the two canonical sources +Every parity check ran from one canonical source down to its renderings. +Nothing compared the two canonical sources to *each other*, and +`integrations/instructions-src.md` says outright that the skill body "mirrors +this text and must be updated with it" — a manual sync, and the last drift class +with no check. They are deliberately not byte-identical, so the invariant is the +loop: both must drive the same tools in the same order. + +### Fixed — smaller corrections +- `docs/05-surface-compatibility.md` stated three different LAN-auth realities + in one document; the bearer token shipped, so the "next security milestone" + text is gone. +- `docs/ROADMAP.md` was stale on its own date, the npm version and the canary + count, and claimed "Open: **Nothing**" while CI was red. +- CHANGELOG dated 0.9.1 to the version-bump commit (2026-07-27) rather than its + actual npm publish (2026-08-01) and registry listing (2026-08-02). +- `integrations/claude.md` labelled an npm install "zero-install from GitHub". +- `server.json` had `websiteUrl: null`, so the registry entry carried no link. +- README overstated capture: buffers hold 30 console lines and 30 network calls, + but a filed report carries the most recent **15 of each**. +- `dashboard/tsconfig.tsbuildinfo`, tsc's incremental cache, was tracked. +- Added `CONTRIBUTING.md`, `SECURITY.md` and issue/PR templates — community + health was 42%. + ### Fixed — the hub exited 0 on a taken port A second `--http --port ` printed its success banner and exited **0**, having served nothing: express's listen callback fires even when the bind failed @@ -39,10 +140,13 @@ remainder: serialised Error). The cold handshake is guarded, so a dead install is one red check instead of a lost run that skipped two whole channels. -Sweep is 20. Two of these were caught being decorative by their own canaries -before landing — a port-collision mutation that fell through to a branch whose -message still matched, and a collision probe pointed at a `0.0.0.0` hub from a -`127.0.0.1` client, which never collided at all. +Two of these were caught being decorative by their own canaries before landing — +a port-collision mutation that fell through to a branch whose message still +matched, and a collision probe pointed at a `0.0.0.0` hub from a `127.0.0.1` +client, which never collided at all. + +The canary sweep ends this release at **27** checks (20 before the gates above), +and every gate added here is canaried in both directions where it can refuse. ## [0.9.2] — 2026-08-02 diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json index 312d3c4..594d878 100644 --- a/plugin/.claude-plugin/plugin.json +++ b/plugin/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "loopback", - "version": "0.9.2", + "version": "0.9.3", "description": "Loopback feedback hub for Claude Code: the loopback skill (work the feedback queue) + MCP registration for the project-tagged feedback bus. Codex gets the same via .agents/skills + config.toml; Gemini via AGENTS.md + settings.json.", "author": { "name": "Dikshant Joshi", diff --git a/server.json b/server.json index 521f336..39f9f53 100644 --- a/server.json +++ b/server.json @@ -6,13 +6,13 @@ "url": "https://github.com/joshidikshant/loopback", "source": "github" }, - "version": "0.9.2", + "version": "0.9.3", "websiteUrl": "https://github.com/joshidikshant/loopback", "packages": [ { "registryType": "npm", "identifier": "loopback-mcp-server", - "version": "0.9.2", + "version": "0.9.3", "transport": { "type": "stdio" } diff --git a/src/server.ts b/src/server.ts index 1332398..c7e3127 100644 --- a/src/server.ts +++ b/src/server.ts @@ -22,7 +22,7 @@ import { import { itemMarkdown, listMarkdown } from "./format.js"; import type { FeedbackItem } from "./types.js"; -export const SERVER_VERSION = "0.9.2"; +export const SERVER_VERSION = "0.9.3"; type ToolResult = { content: { type: "text"; text: string }[]; From dc5890d7f3902b9ad17dfb35d28163e5d433c779 Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:21:22 +0530 Subject: [PATCH 09/13] Fix a security claim the new gate could have caught, and let it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The README said "Three endpoints stay open on a LAN bind" and listed three, while requireAuth lets four through — GET /health was open in the code and absent from the table. A wrong count in the security section is the worst place for one, and it was found by a reviewer reading src/http.ts, not by anything in CI. docs-facts-gate now derives the open set from requireAuth itself and checks three things against it: every open path appears in the table, the row count matches, and the English number in the sentence above the table matches too. That sentence is exactly what went stale, so counting only the rows would have missed it. Canaried, and the sweep is 28. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 2 +- README.md | 3 ++- docs/ROADMAP.md | 2 +- scripts/canary-all.mjs | 14 ++++++++++++++ scripts/docs-facts-gate.mjs | 29 +++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5f0df9..33c1f8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -145,7 +145,7 @@ a port-collision mutation that fell through to a branch whose message still matched, and a collision probe pointed at a `0.0.0.0` hub from a `127.0.0.1` client, which never collided at all. -The canary sweep ends this release at **27** checks (20 before the gates above), +The canary sweep ends this release at **28** checks (20 before the gates above), and every gate added here is canaried in both directions where it can refuse. ## [0.9.2] — 2026-08-02 diff --git a/README.md b/README.md index 19ef8a6..c67d361 100644 --- a/README.md +++ b/README.md @@ -329,13 +329,14 @@ it does not persist in history or referrers. Tools send `Authorization: Bearer `. Comparison is constant-time over a digest, so neither the value nor its length leaks through timing. -Three endpoints stay open on a LAN bind, deliberately: +Four endpoints stay open on a LAN bind, deliberately: | Open | Why | |---|---| | `POST /ingest` | The widget runs on a phone against an arbitrary host page and has nowhere to keep a secret. Intake is append-only and rate-limited (60/min per IP, 429 past that): a LAN caller can file noise, not read or change anything, and not fill the disk. | | `GET /widget.js` | Anything embedded in a served script is readable by anyone who can fetch it. | | `GET /feedback?view=pins` | The minimum needed to draw pins and show one turn green. A strict projection — no body, console, network, repro steps, comments or attachments — of what is already visible on the page. | +| `GET /health` | Liveness only — `{ok, name, version}`. A keep-alive probe cannot be made to carry a token. | Everything else — the dashboard, full reads, every write, and `/mcp`, which exposes all ten tools — refuses an unauthenticated caller with 401. The split diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 063a250..0dc5178 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -55,7 +55,7 @@ project needs next is not code: it is an adopter who is not DJ. ## Verification Seven gates + `smoke` + `e2e` in CI on every push; `npm run canary` (own -workflow: path-triggered + weekly) runs 27 checks proving each subject's gate +workflow: path-triggered + weekly) runs 28 checks proving each subject's gate fails when the subject breaks — `release-preflight` in both directions, since a gate that refuses everything would otherwise pass its own canary: it blocks a commit whose CI is red and still clears one whose CI is green. Every gate's diff --git a/scripts/canary-all.mjs b/scripts/canary-all.mjs index 6b568d7..ab09107 100644 --- a/scripts/canary-all.mjs +++ b/scripts/canary-all.mjs @@ -306,6 +306,20 @@ const CASES = [ apply: () => mutate("README.md", (s) => s.replace("~58KB (19KB gzipped)", "~46KB (15KB gzipped)")), }, + { + gate: "docs-facts-gate (open-endpoint count)", + cmd: ["node", ["scripts/docs-facts-gate.mjs"]], + guards: "the README's open-on-LAN list matching what requireAuth allows", + apply: () => + // /health was genuinely open in the code and missing from the table, with + // the sentence above it still saying "Three". + mutate("README.md", (s) => + s.replace( + "| `GET /health` | Liveness only", + "| `GET /health-REMOVED` | Liveness only", + ), + ), + }, { gate: "docs-facts-gate (undocumented route)", cmd: ["node", ["scripts/docs-facts-gate.mjs"]], diff --git a/scripts/docs-facts-gate.mjs b/scripts/docs-facts-gate.mjs index 54a85b6..f60e126 100644 --- a/scripts/docs-facts-gate.mjs +++ b/scripts/docs-facts-gate.mjs @@ -131,6 +131,35 @@ check( }`, ); +// ── the endpoints left open on a token bind ────────────────────────────────── +// README said "Three endpoints stay open" and listed three while requireAuth +// let four through — /health was open in the code and absent from the table. +// This is a security claim, so it is worth deriving rather than trusting. +const authFn = httpTs.slice(httpTs.indexOf("requireAuth")); +const authBody = authFn.slice(0, authFn.indexOf("const presented")); +const openPaths = [...new Set([...authBody.matchAll(/req\.path === "([^"]+)"/g)].map((m) => m[1]))]; +const openSection = readme.slice(readme.indexOf("stay open on a LAN bind")); +const openTable = openSection.slice(0, openSection.indexOf("\n\n", openSection.indexOf("|---|---|"))); +const openRows = (openTable.match(/^\| `/gm) ?? []).length; +const NUMBER = { One: 1, Two: 2, Three: 3, Four: 4, Five: 5, Six: 6 }; +const stated = readme.match(/(\w+) endpoints stay open on a LAN bind/); +check( + openPaths.every((p) => openTable.includes(p)), + `every endpoint requireAuth leaves open is in the README table${ + openPaths.filter((p) => !openTable.includes(p)).length + ? ` — missing: ${openPaths.filter((p) => !openTable.includes(p)).join(", ")}` + : "" + }`, +); +check( + openRows === openPaths.length, + `README lists ${openRows} open endpoints; requireAuth leaves ${openPaths.length} open`, +); +check( + !!stated && NUMBER[stated[1]] === openPaths.length, + `README says "${stated?.[1]} endpoints stay open" and ${openPaths.length} actually do`, +); + // ── the shadcn registry, enumerated ────────────────────────────────────────── const registry = JSON.parse(read("registry.json")); const items = (registry.items ?? []).map((i) => i.name); From 48ed54e841401894cf20ddec0637d108382062cf Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 16:24:17 +0530 Subject: [PATCH 10/13] The canary caught my own gate being decorative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The open-endpoint check I added one commit ago substring-searched the README table for each path requireAuth leaves open. The canary mutation renames that row to `/health-REMOVED` — which still CONTAINS `/health`, so the check passed with its subject broken and the sweep correctly reported it as decorative. It now parses the path out of each row's `METHOD /path` cell and compares sets in both directions, so a renamed row, a missing row and an invented row all fail. Re-canaried: the mutation trips it. Worth noting how close this came to shipping green. The first time I ran this case in isolation it reported a pass — but the gate was failing on an unrelated stale canary count, not on the mutation. A gate failing for the wrong reason looks exactly like a gate working, which is the same false-green class the sweep's own no-op-mutation guard exists to catch. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 12 ++++++++++++ scripts/docs-facts-gate.mjs | 20 ++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33c1f8e..d788485 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,18 @@ the wire" was measured with the `gzip(1)` CLI, but the server serves `gzipSync` at zlib's default level — 19,770 B. Three plausible numbers for one file, so the gate measures it the way `src/http.ts` actually produces it. +The gate also caught a security claim CI never could: the README said "Three +endpoints stay open on a LAN bind" and listed three, while `requireAuth` lets +four through — `GET /health` was open in the code and absent from the table. It +now derives the open set from `requireAuth` itself. + +And then the canary caught **this gate** being decorative, which is the whole +argument for having one. The first version substring-searched the table for each +open path, so the canary's mutation — renaming the row to `/health-REMOVED` — +still *contained* `/health` and the check passed with its subject broken. It now +parses the path out of each row's `METHOD /path` cell and compares sets in both +directions, so a renamed, missing or invented row all fail. + ### Fixed — the README's shadcn section was mangled, on GitHub and on npm A sentence cut off mid-clause, a contradictory replacement pasted over it, and an orphan `free).` fragment. Live on `main` and in the published 0.9.2 readme, diff --git a/scripts/docs-facts-gate.mjs b/scripts/docs-facts-gate.mjs index f60e126..84091c2 100644 --- a/scripts/docs-facts-gate.mjs +++ b/scripts/docs-facts-gate.mjs @@ -140,16 +140,24 @@ const authBody = authFn.slice(0, authFn.indexOf("const presented")); const openPaths = [...new Set([...authBody.matchAll(/req\.path === "([^"]+)"/g)].map((m) => m[1]))]; const openSection = readme.slice(readme.indexOf("stay open on a LAN bind")); const openTable = openSection.slice(0, openSection.indexOf("\n\n", openSection.indexOf("|---|---|"))); +// Parse the path out of each row's leading `METHOD /path` cell rather than +// substring-searching the table. A substring test is not good enough here and +// the canary proved it: renaming the row to `/health-REMOVED` still CONTAINS +// "/health", so the check passed with its subject broken — decorative, by this +// repo's own definition. +const documentedOpen = [...new Set( + [...openTable.matchAll(/^\| `[A-Z]+ ([^`?]+)[^`]*`/gm)].map((m) => m[1].trim()), +)]; const openRows = (openTable.match(/^\| `/gm) ?? []).length; const NUMBER = { One: 1, Two: 2, Three: 3, Four: 4, Five: 5, Six: 6 }; const stated = readme.match(/(\w+) endpoints stay open on a LAN bind/); +const missingOpen = openPaths.filter((p) => !documentedOpen.includes(p)); +const extraOpen = documentedOpen.filter((p) => !openPaths.includes(p)); check( - openPaths.every((p) => openTable.includes(p)), - `every endpoint requireAuth leaves open is in the README table${ - openPaths.filter((p) => !openTable.includes(p)).length - ? ` — missing: ${openPaths.filter((p) => !openTable.includes(p)).join(", ")}` - : "" - }`, + missingOpen.length === 0 && extraOpen.length === 0, + `the README's open-on-LAN table is exactly what requireAuth allows${ + missingOpen.length ? ` — undocumented: ${missingOpen.join(", ")}` : "" + }${extraOpen.length ? ` — documented but not open: ${extraOpen.join(", ")}` : ""}`, ); check( openRows === openPaths.length, From 761e273c6c1078bbdad89c8cb4555301ef26556a Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 20:09:07 +0530 Subject: [PATCH 11/13] Humanise the Updated timestamp instead of breaking it mid-number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit My own break-all fix, caught by testing the running app rather than the gate. It satisfied the 320px reflow rule and passed CI, but at 1280px the grid column is ~166px and a 24-char ISO string does not fit — so break-all did exactly what it says and split the timestamp across two lines mid-number. Rendered like the Age field directly above it instead: humanised text in a
- {/* An ISO timestamp is one 24-char token with no break opportunity, so - at 200% zoom it sets a 236px floor that min-w-0 cannot shrink — - the same break-all every other value in this card already carries. */} - {item.updated_at} + {/* Rendered like Age above, and for the same reason it has to be: a raw + ISO string is one 24-char token with no break opportunity, so it set + a 236px floor that min-w-0 could not shrink and pushed the page over + 320px at 200% zoom. break-all cleared that but split the timestamp + mid-number at desktop width. Humanising it removes the long token + instead of breaking it; the exact value stays in title/dateTime. */} +
{item.resolution && (
diff --git a/public/dashboard/assets/index-IgT9fk7g.js b/public/dashboard/assets/index-r3d60Fjf.js similarity index 90% rename from public/dashboard/assets/index-IgT9fk7g.js rename to public/dashboard/assets/index-r3d60Fjf.js index 7d6d6fc..6ed9e51 100644 --- a/public/dashboard/assets/index-IgT9fk7g.js +++ b/public/dashboard/assets/index-r3d60Fjf.js @@ -1,12 +1,12 @@ -var hg=l=>{throw TypeError(l)};var pg=(l,o,r)=>o.has(l)||hg("Cannot "+r);var _t=(l,o,r)=>(pg(l,o,"read from private field"),r?r.call(l):o.get(l)),gg=(l,o,r)=>o.has(l)?hg("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(l):o.set(l,r),of=(l,o,r,i)=>(pg(l,o,"write to private field"),i?i.call(l,r):o.set(l,r),r);function Lx(l,o){for(var r=0;ri[u]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function r(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(u){if(u.ep)return;u.ep=!0;const f=r(u);fetch(u.href,f)}})();function Ev(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var rf={exports:{}},_i={};var vg;function Hx(){if(vg)return _i;vg=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(i,u,f){var m=null;if(f!==void 0&&(m=""+f),u.key!==void 0&&(m=""+u.key),"key"in u){f={};for(var v in u)v!=="key"&&(f[v]=u[v])}else f=u;return u=f.ref,{$$typeof:l,type:i,key:m,ref:u!==void 0?u:null,props:f}}return _i.Fragment=o,_i.jsx=r,_i.jsxs=r,_i}var yg;function Bx(){return yg||(yg=1,rf.exports=Hx()),rf.exports}var h=Bx(),sf={exports:{}},xe={};var bg;function qx(){if(bg)return xe;bg=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),E=Symbol.iterator;function O(R){return R===null||typeof R!="object"?null:(R=E&&R[E]||R["@@iterator"],typeof R=="function"?R:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function S(R,V,Z){this.props=R,this.context=V,this.refs=T,this.updater=Z||A}S.prototype.isReactComponent={},S.prototype.setState=function(R,V){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,V,"setState")},S.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function D(){}D.prototype=S.prototype;function z(R,V,Z){this.props=R,this.context=V,this.refs=T,this.updater=Z||A}var k=z.prototype=new D;k.constructor=z,C(k,S.prototype),k.isPureReactComponent=!0;var I=Array.isArray;function X(){}var K={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function ae(R,V,Z){var W=Z.ref;return{$$typeof:l,type:R,key:V,ref:W!==void 0?W:null,props:Z}}function me(R,V){return ae(R.type,V,R.props)}function ge(R){return typeof R=="object"&&R!==null&&R.$$typeof===l}function U(R){var V={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(Z){return V[Z]})}var te=/\/+/g;function fe(R,V){return typeof R=="object"&&R!==null&&R.key!=null?U(""+R.key):V.toString(36)}function he(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(X,X):(R.status="pending",R.then(function(V){R.status==="pending"&&(R.status="fulfilled",R.value=V)},function(V){R.status==="pending"&&(R.status="rejected",R.reason=V)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function j(R,V,Z,W,ee){var ie=typeof R;(ie==="undefined"||ie==="boolean")&&(R=null);var ye=!1;if(R===null)ye=!0;else switch(ie){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(R.$$typeof){case l:case o:ye=!0;break;case w:return ye=R._init,j(ye(R._payload),V,Z,W,ee)}}if(ye)return ee=ee(R),ye=W===""?"."+fe(R,0):W,I(ee)?(Z="",ye!=null&&(Z=ye.replace(te,"$&/")+"/"),j(ee,V,Z,"",function(Le){return Le})):ee!=null&&(ge(ee)&&(ee=me(ee,Z+(ee.key==null||R&&R.key===ee.key?"":(""+ee.key).replace(te,"$&/")+"/")+ye)),V.push(ee)),1;ye=0;var ne=W===""?".":W+":";if(I(R))for(var re=0;re>>1,P=j[oe];if(0>>1;oeu(Z,F))Wu(ee,Z)?(j[oe]=ee,j[W]=F,oe=W):(j[oe]=Z,j[V]=F,oe=V);else if(Wu(ee,F))j[oe]=ee,j[W]=F,oe=W;else break e}}return Y}function u(j,Y){var F=j.sortIndex-Y.sortIndex;return F!==0?F:j.id-Y.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();l.unstable_now=function(){return m.now()-v}}var y=[],p=[],w=1,g=null,E=3,O=!1,A=!1,C=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function k(j){for(var Y=r(p);Y!==null;){if(Y.callback===null)i(p);else if(Y.startTime<=j)i(p),Y.sortIndex=Y.expirationTime,o(y,Y);else break;Y=r(p)}}function I(j){if(C=!1,k(j),!A)if(r(y)!==null)A=!0,X||(X=!0,U());else{var Y=r(p);Y!==null&&he(I,Y.startTime-j)}}var X=!1,K=-1,G=5,ae=-1;function me(){return T?!0:!(l.unstable_now()-aej&&me());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,E=g.priorityLevel;var P=oe(g.expirationTime<=j);if(j=l.unstable_now(),typeof P=="function"){g.callback=P,k(j),Y=!0;break t}g===r(y)&&i(y),k(j)}else i(y);g=r(y)}if(g!==null)Y=!0;else{var R=r(p);R!==null&&he(I,R.startTime-j),Y=!1}}break e}finally{g=null,E=F,O=!1}Y=void 0}}finally{Y?U():X=!1}}}var U;if(typeof z=="function")U=function(){z(ge)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,fe=te.port2;te.port1.onmessage=ge,U=function(){fe.postMessage(null)}}else U=function(){S(ge,0)};function he(j,Y){K=S(function(){j(l.unstable_now())},Y)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(j){j.callback=null},l.unstable_forceFrameRate=function(j){0>j||125oe?(j.sortIndex=F,o(p,j),r(y)===null&&j===r(p)&&(C?(D(K),K=-1):C=!0,he(I,F-oe))):(j.sortIndex=P,o(y,j),A||O||(A=!0,X||(X=!0,U()))),j},l.unstable_shouldYield=me,l.unstable_wrapCallback=function(j){var Y=E;return function(){var F=E;E=Y;try{return j.apply(this,arguments)}finally{E=F}}}})(ff)),ff}var wg;function Vx(){return wg||(wg=1,uf.exports=Yx()),uf.exports}var df={exports:{}},Ot={};var Eg;function Gx(){if(Eg)return Ot;Eg=1;var l=Wf();function o(y){var p="https://react.dev/errors/"+y;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),df.exports=Gx(),df.exports}var Tg;function Xx(){if(Tg)return Oi;Tg=1;var l=Vx(),o=Wf(),r=Cv();function i(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=oe[P],oe[P]=null,P--)}function Z(e,t){P++,oe[P]=e.current,e.current=t}var W=R(null),ee=R(null),ie=R(null),ye=R(null);function ne(e,t){switch(Z(ie,t),Z(ee,e),Z(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lp(t),e=Hp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(W),Z(W,e)}function re(){V(W),V(ee),V(ie)}function Le(e){e.memoizedState!==null&&Z(ye,e);var t=W.current,n=Hp(t,e.type);t!==n&&(Z(ee,e),Z(W,n))}function Ce(e){ee.current===e&&(V(W),V(ee)),ye.current===e&&(V(ye),Ei._currentValue=F)}var Te,He;function Ze(e){if(Te===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||"",He=-1{throw TypeError(l)};var pg=(l,o,r)=>o.has(l)||hg("Cannot "+r);var _t=(l,o,r)=>(pg(l,o,"read from private field"),r?r.call(l):o.get(l)),gg=(l,o,r)=>o.has(l)?hg("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(l):o.set(l,r),rf=(l,o,r,i)=>(pg(l,o,"write to private field"),i?i.call(l,r):o.set(l,r),r);function Lx(l,o){for(var r=0;ri[u]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function r(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(u){if(u.ep)return;u.ep=!0;const f=r(u);fetch(u.href,f)}})();function Ev(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var sf={exports:{}},_i={};var vg;function Hx(){if(vg)return _i;vg=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(i,u,f){var m=null;if(f!==void 0&&(m=""+f),u.key!==void 0&&(m=""+u.key),"key"in u){f={};for(var v in u)v!=="key"&&(f[v]=u[v])}else f=u;return u=f.ref,{$$typeof:l,type:i,key:m,ref:u!==void 0?u:null,props:f}}return _i.Fragment=o,_i.jsx=r,_i.jsxs=r,_i}var yg;function Bx(){return yg||(yg=1,sf.exports=Hx()),sf.exports}var h=Bx(),cf={exports:{}},xe={};var bg;function qx(){if(bg)return xe;bg=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),E=Symbol.iterator;function O(R){return R===null||typeof R!="object"?null:(R=E&&R[E]||R["@@iterator"],typeof R=="function"?R:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function S(R,V,Z){this.props=R,this.context=V,this.refs=T,this.updater=Z||A}S.prototype.isReactComponent={},S.prototype.setState=function(R,V){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,V,"setState")},S.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function D(){}D.prototype=S.prototype;function z(R,V,Z){this.props=R,this.context=V,this.refs=T,this.updater=Z||A}var k=z.prototype=new D;k.constructor=z,C(k,S.prototype),k.isPureReactComponent=!0;var I=Array.isArray;function X(){}var K={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function ae(R,V,Z){var W=Z.ref;return{$$typeof:l,type:R,key:V,ref:W!==void 0?W:null,props:Z}}function me(R,V){return ae(R.type,V,R.props)}function ge(R){return typeof R=="object"&&R!==null&&R.$$typeof===l}function U(R){var V={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(Z){return V[Z]})}var te=/\/+/g;function fe(R,V){return typeof R=="object"&&R!==null&&R.key!=null?U(""+R.key):V.toString(36)}function he(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(X,X):(R.status="pending",R.then(function(V){R.status==="pending"&&(R.status="fulfilled",R.value=V)},function(V){R.status==="pending"&&(R.status="rejected",R.reason=V)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function j(R,V,Z,W,ee){var ie=typeof R;(ie==="undefined"||ie==="boolean")&&(R=null);var ye=!1;if(R===null)ye=!0;else switch(ie){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(R.$$typeof){case l:case o:ye=!0;break;case w:return ye=R._init,j(ye(R._payload),V,Z,W,ee)}}if(ye)return ee=ee(R),ye=W===""?"."+fe(R,0):W,I(ee)?(Z="",ye!=null&&(Z=ye.replace(te,"$&/")+"/"),j(ee,V,Z,"",function(Le){return Le})):ee!=null&&(ge(ee)&&(ee=me(ee,Z+(ee.key==null||R&&R.key===ee.key?"":(""+ee.key).replace(te,"$&/")+"/")+ye)),V.push(ee)),1;ye=0;var ne=W===""?".":W+":";if(I(R))for(var re=0;re>>1,P=j[oe];if(0>>1;oeu(Z,F))Wu(ee,Z)?(j[oe]=ee,j[W]=F,oe=W):(j[oe]=Z,j[V]=F,oe=V);else if(Wu(ee,F))j[oe]=ee,j[W]=F,oe=W;else break e}}return Y}function u(j,Y){var F=j.sortIndex-Y.sortIndex;return F!==0?F:j.id-Y.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();l.unstable_now=function(){return m.now()-v}}var y=[],p=[],w=1,g=null,E=3,O=!1,A=!1,C=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function k(j){for(var Y=r(p);Y!==null;){if(Y.callback===null)i(p);else if(Y.startTime<=j)i(p),Y.sortIndex=Y.expirationTime,o(y,Y);else break;Y=r(p)}}function I(j){if(C=!1,k(j),!A)if(r(y)!==null)A=!0,X||(X=!0,U());else{var Y=r(p);Y!==null&&he(I,Y.startTime-j)}}var X=!1,K=-1,G=5,ae=-1;function me(){return T?!0:!(l.unstable_now()-aej&&me());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,E=g.priorityLevel;var P=oe(g.expirationTime<=j);if(j=l.unstable_now(),typeof P=="function"){g.callback=P,k(j),Y=!0;break t}g===r(y)&&i(y),k(j)}else i(y);g=r(y)}if(g!==null)Y=!0;else{var R=r(p);R!==null&&he(I,R.startTime-j),Y=!1}}break e}finally{g=null,E=F,O=!1}Y=void 0}}finally{Y?U():X=!1}}}var U;if(typeof z=="function")U=function(){z(ge)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,fe=te.port2;te.port1.onmessage=ge,U=function(){fe.postMessage(null)}}else U=function(){S(ge,0)};function he(j,Y){K=S(function(){j(l.unstable_now())},Y)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(j){j.callback=null},l.unstable_forceFrameRate=function(j){0>j||125oe?(j.sortIndex=F,o(p,j),r(y)===null&&j===r(p)&&(C?(D(K),K=-1):C=!0,he(I,F-oe))):(j.sortIndex=P,o(y,j),A||O||(A=!0,X||(X=!0,U()))),j},l.unstable_shouldYield=me,l.unstable_wrapCallback=function(j){var Y=E;return function(){var F=E;E=Y;try{return j.apply(this,arguments)}finally{E=F}}}})(df)),df}var wg;function Vx(){return wg||(wg=1,ff.exports=Yx()),ff.exports}var mf={exports:{}},Ot={};var Eg;function Gx(){if(Eg)return Ot;Eg=1;var l=Wf();function o(y){var p="https://react.dev/errors/"+y;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),mf.exports=Gx(),mf.exports}var Tg;function Xx(){if(Tg)return Oi;Tg=1;var l=Vx(),o=Wf(),r=Cv();function i(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=oe[P],oe[P]=null,P--)}function Z(e,t){P++,oe[P]=e.current,e.current=t}var W=R(null),ee=R(null),ie=R(null),ye=R(null);function ne(e,t){switch(Z(ie,t),Z(ee,e),Z(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lp(t),e=Hp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(W),Z(W,e)}function re(){V(W),V(ee),V(ie)}function Le(e){e.memoizedState!==null&&Z(ye,e);var t=W.current,n=Hp(t,e.type);t!==n&&(Z(ee,e),Z(W,n))}function Ce(e){ee.current===e&&(V(W),V(ee)),ye.current===e&&(V(ye),Ei._currentValue=F)}var Te,He;function Ze(e){if(Te===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||"",He=-1)":-1s||_[a]!==H[s]){var Q=` `+_[a].replace(" at new "," at ");return e.displayName&&Q.includes("")&&(Q=Q.replace("",e.displayName)),Q}while(1<=a&&0<=s);break}}}finally{dt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ze(n):""}function pn(e,t){switch(e.tag){case 26:case 27:case 5:return Ze(e.type);case 16:return Ze("Lazy");case 13:return e.child!==t&&t!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return Cn(e.type,!1);case 11:return Cn(e.type.render,!1);case 1:return Cn(e.type,!0);case 31:return Ze("Activity");default:return""}}function Bn(e){try{var t="",n=null;do t+=pn(e,n),n=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` -`+a.stack}}var Kt=Object.prototype.hasOwnProperty,Mo=l.unstable_scheduleCallback,Uo=l.unstable_cancelCallback,Nt=l.unstable_shouldYield,ga=l.unstable_requestPaint,jt=l.unstable_now,Ks=l.unstable_getCurrentPriorityLevel,Wa=l.unstable_ImmediatePriority,Zi=l.unstable_UserBlockingPriority,el=l.unstable_NormalPriority,ko=l.unstable_LowPriority,qn=l.unstable_IdlePriority,Ki=l.log,va=l.unstable_setDisableYieldValue,tl=null,Dt=null;function gn(e){if(typeof Ki=="function"&&va(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(tl,e)}catch{}}var Tt=Math.clz32?Math.clz32:Tn,$s=Math.log,Lo=Math.LN2;function Tn(e){return e>>>=0,e===0?32:31-($s(e)/Lo|0)|0}var Dl=256,zl=262144,nl=4194304;function An(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function be(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var s=0,c=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var x=a&134217727;return x!==0?(a=x&~c,a!==0?s=An(a):(d&=x,d!==0?s=An(d):n||(n=x&~e,n!==0&&(s=An(n))))):(x=a&~c,x!==0?s=An(x):d!==0?s=An(d):n||(n=a&~e,n!==0&&(s=An(n)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:s}function Pe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function At(){var e=nl;return nl<<=1,(nl&62914560)===0&&(nl=4194304),e}function ya(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ut(e,t,n,a,s,c){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var x=e.entanglements,_=e.expirationTimes,H=e.hiddenUpdates;for(n=d&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var j0=/[\n"\\]/g;function ln(e){return e.replace(j0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ws(e,t,n,a,s,c,d,x){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+an(t)):e.value!==""+an(t)&&(e.value=""+an(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?ec(e,d,an(t)):n!=null?ec(e,d,an(n)):a!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+an(x):e.removeAttribute("name")}function jd(e,t,n,a,s,c,d,x){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Fs(e);return}n=n!=null?""+an(n):"",t=t!=null?""+an(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=x?e.checked:!!a,e.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Fs(e)}function ec(e,t,n){t==="number"&&Ji(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ql(e,t,n,a){if(e=e.options,t){t={};for(var s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oc=!1;if(Gn)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){oc=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{oc=!1}var xa=null,ic=null,Fi=null;function Hd(){if(Fi)return Fi;var e,t=ic,n=t.length,a,s="value"in xa?xa.value:xa.textContent,c=s.length;for(e=0;e=Xo),Xd=" ",Qd=!1;function Zd(e,t){switch(e){case"keyup":return ob.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xl=!1;function rb(e,t){switch(e){case"compositionend":return Kd(t);case"keypress":return t.which!==32?null:(Qd=!0,Xd);case"textInput":return e=t.data,e===Xd&&Qd?null:e;default:return null}}function sb(e,t){if(Xl)return e==="compositionend"||!fc&&Zd(e,t)?(e=Hd(),Fi=ic=xa=null,Xl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=tm(n)}}function am(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?am(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ji(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ji(e.document)}return t}function hc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var gb=Gn&&"documentMode"in document&&11>=document.documentMode,Ql=null,pc=null,$o=null,gc=!1;function om(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gc||Ql==null||Ql!==Ji(a)||(a=Ql,"selectionStart"in a&&hc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),$o&&Ko($o,a)||($o=a,a=Qr(pc,"onSelect"),0>=d,s-=d,_n=1<<32-Tt(t)+s|n<Ee?(Ne=de,de=null):Ne=de.sibling;var Ue=B(M,de,L[Ee],$);if(Ue===null){de===null&&(de=Ne);break}e&&de&&Ue.alternate===null&&t(M,de),N=c(Ue,N,Ee),Me===null?pe=Ue:Me.sibling=Ue,Me=Ue,de=Ne}if(Ee===L.length)return n(M,de),je&&Qn(M,Ee),pe;if(de===null){for(;EeEe?(Ne=de,de=null):Ne=de.sibling;var Va=B(M,de,Ue.value,$);if(Va===null){de===null&&(de=Ne);break}e&&de&&Va.alternate===null&&t(M,de),N=c(Va,N,Ee),Me===null?pe=Va:Me.sibling=Va,Me=Va,de=Ne}if(Ue.done)return n(M,de),je&&Qn(M,Ee),pe;if(de===null){for(;!Ue.done;Ee++,Ue=L.next())Ue=J(M,Ue.value,$),Ue!==null&&(N=c(Ue,N,Ee),Me===null?pe=Ue:Me.sibling=Ue,Me=Ue);return je&&Qn(M,Ee),pe}for(de=a(de);!Ue.done;Ee++,Ue=L.next())Ue=q(de,M,Ee,Ue.value,$),Ue!==null&&(e&&Ue.alternate!==null&&de.delete(Ue.key===null?Ee:Ue.key),N=c(Ue,N,Ee),Me===null?pe=Ue:Me.sibling=Ue,Me=Ue);return e&&de.forEach(function(kx){return t(M,kx)}),je&&Qn(M,Ee),pe}function Ge(M,N,L,$){if(typeof L=="object"&&L!==null&&L.type===C&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case O:e:{for(var pe=L.key;N!==null;){if(N.key===pe){if(pe=L.type,pe===C){if(N.tag===7){n(M,N.sibling),$=s(N,L.props.children),$.return=M,M=$;break e}}else if(N.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===G&&hl(pe)===N.type){n(M,N.sibling),$=s(N,L.props),ei($,L),$.return=M,M=$;break e}n(M,N);break}else t(M,N);N=N.sibling}L.type===C?($=cl(L.props.children,M.mode,$,L.key),$.return=M,M=$):($=sr(L.type,L.key,L.props,null,M.mode,$),ei($,L),$.return=M,M=$)}return d(M);case A:e:{for(pe=L.key;N!==null;){if(N.key===pe)if(N.tag===4&&N.stateNode.containerInfo===L.containerInfo&&N.stateNode.implementation===L.implementation){n(M,N.sibling),$=s(N,L.children||[]),$.return=M,M=$;break e}else{n(M,N);break}else t(M,N);N=N.sibling}$=Ec(L,M.mode,$),$.return=M,M=$}return d(M);case G:return L=hl(L),Ge(M,N,L,$)}if(he(L))return ue(M,N,L,$);if(U(L)){if(pe=U(L),typeof pe!="function")throw Error(i(150));return L=pe.call(L),ve(M,N,L,$)}if(typeof L.then=="function")return Ge(M,N,pr(L),$);if(L.$$typeof===z)return Ge(M,N,fr(M,L),$);gr(M,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,N!==null&&N.tag===6?(n(M,N.sibling),$=s(N,L),$.return=M,M=$):(n(M,N),$=wc(L,M.mode,$),$.return=M,M=$),d(M)):n(M,N)}return function(M,N,L,$){try{Wo=0;var pe=Ge(M,N,L,$);return no=null,pe}catch(de){if(de===to||de===mr)throw de;var Me=Pt(29,de,null,M.mode);return Me.lanes=$,Me.return=M,Me}}}var gl=Om(!0),Rm=Om(!1),Ta=!1;function Uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _a(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ke&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=rr(e),dm(e,null,n),t}return ir(e,a,t,n),rr(e)}function ti(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,kt(e,n)}}function Lc(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var s=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?s=c=d:c=c.next=d,n=n.next}while(n!==null);c===null?s=c=t:c=c.next=t}else s=c=t;n={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Hc=!1;function ni(){if(Hc){var e=eo;if(e!==null)throw e}}function ai(e,t,n,a){Hc=!1;var s=e.updateQueue;Ta=!1;var c=s.firstBaseUpdate,d=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var _=x,H=_.next;_.next=null,d===null?c=H:d.next=H,d=_;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,x=Q.lastBaseUpdate,x!==d&&(x===null?Q.firstBaseUpdate=H:x.next=H,Q.lastBaseUpdate=_))}if(c!==null){var J=s.baseState;d=0,Q=H=_=null,x=c;do{var B=x.lane&-536870913,q=B!==x.lane;if(q?(Re&B)===B:(a&B)===B){B!==0&&B===Wl&&(Hc=!0),Q!==null&&(Q=Q.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ue=e,ve=x;B=t;var Ge=n;switch(ve.tag){case 1:if(ue=ve.payload,typeof ue=="function"){J=ue.call(Ge,J,B);break e}J=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ve.payload,B=typeof ue=="function"?ue.call(Ge,J,B):ue,B==null)break e;J=g({},J,B);break e;case 2:Ta=!0}}B=x.callback,B!==null&&(e.flags|=64,q&&(e.flags|=8192),q=s.callbacks,q===null?s.callbacks=[B]:q.push(B))}else q={lane:B,tag:x.tag,payload:x.payload,callback:x.callback,next:null},Q===null?(H=Q=q,_=J):Q=Q.next=q,d|=B;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;q=x,x=q.next,q.next=null,s.lastBaseUpdate=q,s.shared.pending=null}}while(!0);Q===null&&(_=J),s.baseState=_,s.firstBaseUpdate=H,s.lastBaseUpdate=Q,c===null&&(s.shared.lanes=0),Da|=d,e.lanes=d,e.memoizedState=J}}function Nm(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function jm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ec?c:8;var d=j.T,x={};j.T=x,au(e,!1,t,n);try{var _=s(),H=j.S;if(H!==null&&H(x,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var Q=Tb(_,a);ii(e,t,Q,en(e))}else ii(e,t,a,en(e))}catch(J){ii(e,t,{then:function(){},status:"rejected",reason:J},en())}finally{Y.p=c,d!==null&&x.types!==null&&(d.types=x.types),j.T=d}}function jb(){}function tu(e,t,n,a){if(e.tag!==5)throw Error(i(476));var s=ch(e).queue;sh(e,s,t,F,n===null?jb:function(){return uh(e),n(a)})}function ch(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function uh(e){var t=ch(e);t.next===null&&(t=e.alternate.memoizedState),ii(e,t.next.queue,{},en())}function nu(){return St(Ei)}function fh(){return nt().memoizedState}function dh(){return nt().memoizedState}function Db(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=en();e=Aa(n);var a=_a(t,e,n);a!==null&&(Xt(a,t,n),ti(a,t,n)),t={cache:jc()},e.payload=t;return}t=t.return}}function zb(e,t,n){var a=en();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ar(e)?hh(t,n):(n=xc(e,t,n,a),n!==null&&(Xt(n,e,a),ph(n,t,a)))}function mh(e,t,n){var a=en();ii(e,t,n,a)}function ii(e,t,n,a){var s={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ar(e))hh(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var d=t.lastRenderedState,x=c(d,n);if(s.hasEagerState=!0,s.eagerState=x,$t(x,d))return ir(e,t,s,0),Qe===null&&or(),!1}catch{}if(n=xc(e,t,s,a),n!==null)return Xt(n,e,a),ph(n,t,a),!0}return!1}function au(e,t,n,a){if(a={lane:2,revertLane:Uu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ar(e)){if(t)throw Error(i(479))}else t=xc(e,n,a,2),t!==null&&Xt(t,e,2)}function Ar(e){var t=e.alternate;return e===we||t!==null&&t===we}function hh(e,t){lo=br=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ph(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,kt(e,n)}}var ri={readContext:St,use:wr,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};ri.useEffectEvent=We;var gh={readContext:St,use:wr,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Wm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Cr(4194308,4,ah.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cr(4194308,4,e,t)},useInsertionEffect:function(e,t){Cr(4,2,e,t)},useMemo:function(e,t){var n=zt();t=t===void 0?null:t;var a=e();if(vl){gn(!0);try{e()}finally{gn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=zt();if(n!==void 0){var s=n(t);if(vl){gn(!0);try{n(t)}finally{gn(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=zb.bind(null,we,e),[a.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Jc(e);var t=e.queue,n=mh.bind(null,we,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Wc,useDeferredValue:function(e,t){var n=zt();return eu(n,e,t)},useTransition:function(){var e=Jc(!1);return e=sh.bind(null,we,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=we,s=zt();if(je){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Qe===null)throw Error(i(349));(Re&127)!==0||Lm(a,t,n)}s.memoizedState=n;var c={value:n,getSnapshot:t};return s.queue=c,Wm(Bm.bind(null,a,c,e),[e]),a.flags|=2048,io(9,{destroy:void 0},Hm.bind(null,a,c,n,t),null),n},useId:function(){var e=zt(),t=Qe.identifierPrefix;if(je){var n=On,a=_n;n=(a&~(1<<32-Tt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=xr++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?c.multiple=!0:a.size&&(c.size=a.size);break;default:c=typeof a.is=="string"?d.createElement(s,{is:a.is}):d.createElement(s)}}c[bt]=t,c[Ht]=a;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)c.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=c;e:switch(Et(c,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&In(t)}}return $e(t),vu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(i(166));if(e=ie.current,Il(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,s=xt,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[bt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Up(e.nodeValue,n)),e||Ea(t,!0)}else e=Zr(e).createTextNode(a),e[bt]=t,t.stateNode=e}return $e(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Il(t),n!==null){if(e===null){if(!a)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[bt]=t}else ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else n=_c(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(i(558))}return $e(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Il(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(i(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));s[bt]=t}else ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),s=!1}else s=_c(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(It(t),t):(It(t),null)}return It(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),jr(t,t.updateQueue),$e(t),null);case 4:return re(),e===null&&Bu(t.stateNode.containerInfo),$e(t),null;case 10:return Kn(t.type),$e(t),null;case 19:if(V(tt),a=t.memoizedState,a===null)return $e(t),null;if(s=(t.flags&128)!==0,c=a.rendering,c===null)if(s)ci(a,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=yr(e),c!==null){for(t.flags|=128,ci(a,!1),e=c.updateQueue,t.updateQueue=e,jr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mm(n,e),n=n.sibling;return Z(tt,tt.current&1|2),je&&Qn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&jt()>kr&&(t.flags|=128,s=!0,ci(a,!1),t.lanes=4194304)}else{if(!s)if(e=yr(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,jr(t,e),ci(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!je)return $e(t),null}else 2*jt()-a.renderingStartTime>kr&&n!==536870912&&(t.flags|=128,s=!0,ci(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(e=a.last,e!==null?e.sibling=c:t.child=c,a.last=c)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=jt(),e.sibling=null,n=tt.current,Z(tt,s?n&1|2:n&1),je&&Qn(t,a.treeForkCount),e):($e(t),null);case 22:case 23:return It(t),qc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),n=t.updateQueue,n!==null&&jr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&V(ml),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Kn(lt),$e(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hb(e,t){switch(Tc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kn(lt),re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(i(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(tt),null;case 4:return re(),null;case 10:return Kn(t.type),null;case 22:case 23:return It(t),qc(),e!==null&&V(ml),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Kn(lt),null;case 25:return null;default:return null}}function qh(e,t){switch(Tc(t),t.tag){case 3:Kn(lt),re();break;case 26:case 27:case 5:Ce(t);break;case 4:re();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:V(tt);break;case 10:Kn(t.type);break;case 22:case 23:It(t),qc(),e!==null&&V(ml);break;case 24:Kn(lt)}}function ui(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&e)===e){a=void 0;var c=n.create,d=n.inst;a=c(),d.destroy=a}n=n.next}while(n!==s)}}catch(x){qe(t,t.return,x)}}function Na(e,t,n){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){var d=a.inst,x=d.destroy;if(x!==void 0){d.destroy=void 0,s=t;var _=n,H=x;try{H()}catch(Q){qe(s,_,Q)}}}a=a.next}while(a!==c)}}catch(Q){qe(t,t.return,Q)}}function Yh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{jm(t,n)}catch(a){qe(e,e.return,a)}}}function Vh(e,t,n){n.props=yl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){qe(e,t,a)}}function fi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(s){qe(e,t,s)}}function Rn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(s){qe(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){qe(e,t,s)}else n.current=null}function Gh(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(s){qe(e,e.return,s)}}function yu(e,t,n){try{var a=e.stateNode;ix(a,e.type,n,t),a[Ht]=t}catch(s){qe(e,e.return,s)}}function Xh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&La(e.type)||e.tag===4}function bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&La(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vn));else if(a!==4&&(a===27&&La(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(xu(e,t,n),e=e.sibling;e!==null;)xu(e,t,n),e=e.sibling}function Dr(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&La(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Dr(e,t,n),e=e.sibling;e!==null;)Dr(e,t,n),e=e.sibling}function Qh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Et(t,a,n),t[bt]=e,t[Ht]=n}catch(c){qe(e,e.return,c)}}var Fn=!1,rt=!1,Su=!1,Zh=typeof WeakSet=="function"?WeakSet:Set,pt=null;function Bb(e,t){if(e=e.containerInfo,Vu=Wr,e=lm(e),hc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var s=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var d=0,x=-1,_=-1,H=0,Q=0,J=e,B=null;t:for(;;){for(var q;J!==n||s!==0&&J.nodeType!==3||(x=d+s),J!==c||a!==0&&J.nodeType!==3||(_=d+a),J.nodeType===3&&(d+=J.nodeValue.length),(q=J.firstChild)!==null;)B=J,J=q;for(;;){if(J===e)break t;if(B===n&&++H===s&&(x=d),B===c&&++Q===a&&(_=d),(q=J.nextSibling)!==null)break;J=B,B=J.parentNode}J=q}n=x===-1||_===-1?null:{start:x,end:_}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gu={focusedElem:e,selectionRange:n},Wr=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),Et(c,a,n),c[bt]=e,ht(c),a=c;break e;case"link":var d=Fp("link","href",s).get(a+(n.href||""));if(d){for(var x=0;xGe&&(d=Ge,Ge=ve,ve=d);var M=nm(x,ve),N=nm(x,Ge);if(M&&N&&(q.rangeCount!==1||q.anchorNode!==M.node||q.anchorOffset!==M.offset||q.focusNode!==N.node||q.focusOffset!==N.offset)){var L=J.createRange();L.setStart(M.node,M.offset),q.removeAllRanges(),ve>Ge?(q.addRange(L),q.extend(N.node,N.offset)):(L.setEnd(N.node,N.offset),q.addRange(L))}}}}for(J=[],q=x;q=q.parentNode;)q.nodeType===1&&J.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;xn?32:n,j.T=null,n=Ou,Ou=null;var c=Ma,d=aa;if(ct=0,fo=Ma=null,aa=0,(ke&6)!==0)throw Error(i(331));var x=ke;if(ke|=4,ap(c.current),ep(c,c.current,d,n),ke=x,vi(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(tl,c)}catch{}return!0}finally{Y.p=s,j.T=a,Sp(e,t)}}function Ep(e,t,n){t=rn(n,t),t=ru(e.stateNode,t,2),e=_a(e,t,2),e!==null&&(Fe(e,2),Nn(e))}function qe(e,t,n){if(e.tag===3)Ep(e,e,n);else for(;t!==null;){if(t.tag===3){Ep(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(za===null||!za.has(a))){e=rn(n,e),n=Ch(2),a=_a(t,n,2),a!==null&&(Th(n,a,t,e),Fe(a,2),Nn(a));break}}t=t.return}}function Du(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Vb;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(n)||(Cu=!0,s.add(n),e=Kb.bind(null,e,t,n),t.then(e,e))}function Kb(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Qe===e&&(Re&n)===n&&(et===4||et===3&&(Re&62914560)===Re&&300>jt()-Ur?(ke&2)===0&&mo(e,0):Tu|=n,uo===Re&&(uo=0)),Nn(e)}function Cp(e,t){t===0&&(t=At()),e=sl(e,t),e!==null&&(Fe(e,t),Nn(e))}function $b(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cp(e,n)}function Pb(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(i(314))}a!==null&&a.delete(t),Cp(e,n)}function Jb(e,t){return Mo(e,t)}var Vr=null,po=null,zu=!1,Gr=!1,Mu=!1,ka=0;function Nn(e){e!==po&&e.next===null&&(po===null?Vr=po=e:po=po.next=e),Gr=!0,zu||(zu=!0,Fb())}function vi(e,t){if(!Mu&&Gr){Mu=!0;do for(var n=!1,a=Vr;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var c=0;else{var d=a.suspendedLanes,x=a.pingedLanes;c=(1<<31-Tt(42|e)+1)-1,c&=s&~(d&~x),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Op(a,c))}else c=Re,c=be(a,a===Qe?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||Pe(a,c)||(n=!0,Op(a,c));a=a.next}while(n);Mu=!1}}function Ib(){Tp()}function Tp(){Gr=zu=!1;var e=0;ka!==0&&sx()&&(e=ka);for(var t=jt(),n=null,a=Vr;a!==null;){var s=a.next,c=Ap(a,t);c===0?(a.next=null,n===null?Vr=s:n.next=s,s===null&&(po=n)):(n=a,(e!==0||(c&3)!==0)&&(Gr=!0)),a=s}ct!==0&&ct!==5||vi(e),ka!==0&&(ka=0)}function Ap(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0x)break;var Q=_.transferSize,J=_.initiatorType;Q&&kp(J)&&(_=_.responseEnd,d+=Q*(_"u"?null:document;function $p(e,t,n){var a=go;if(a&&typeof t=="string"&&t){var s=ln(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),Kp.has(s)||(Kp.add(s),e={rel:e,crossOrigin:n,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),Et(t,"link",e),ht(t),a.head.appendChild(t)))}}function vx(e){la.D(e),$p("dns-prefetch",e,null)}function yx(e,t){la.C(e,t),$p("preconnect",e,t)}function bx(e,t,n){la.L(e,t,n);var a=go;if(a&&e&&t){var s='link[rel="preload"][as="'+ln(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+ln(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+ln(n.imageSizes)+'"]')):s+='[href="'+ln(e)+'"]';var c=s;switch(t){case"style":c=vo(e);break;case"script":c=yo(e)}mn.has(c)||(e=g({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),mn.set(c,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Si(c))||t==="script"&&a.querySelector(wi(c))||(t=a.createElement("link"),Et(t,"link",e),ht(t),a.head.appendChild(t)))}}function xx(e,t){la.m(e,t);var n=go;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+ln(a)+'"][href="'+ln(e)+'"]',c=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=yo(e)}if(!mn.has(c)&&(e=g({rel:"modulepreload",href:e},t),mn.set(c,e),n.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wi(c)))return}a=n.createElement("link"),Et(a,"link",e),ht(a),n.head.appendChild(a)}}}function Sx(e,t,n){la.S(e,t,n);var a=go;if(a&&e){var s=Hl(a).hoistableStyles,c=vo(e);t=t||"default";var d=s.get(c);if(!d){var x={loading:0,preload:null};if(d=a.querySelector(Si(c)))x.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},n),(n=mn.get(c))&&Ju(e,n);var _=d=a.createElement("link");ht(_),Et(_,"link",e),_._p=new Promise(function(H,Q){_.onload=H,_.onerror=Q}),_.addEventListener("load",function(){x.loading|=1}),_.addEventListener("error",function(){x.loading|=2}),x.loading|=4,$r(d,t,a)}d={type:"stylesheet",instance:d,count:1,state:x},s.set(c,d)}}}function wx(e,t){la.X(e,t);var n=go;if(n&&e){var a=Hl(n).hoistableScripts,s=yo(e),c=a.get(s);c||(c=n.querySelector(wi(s)),c||(e=g({src:e,async:!0},t),(t=mn.get(s))&&Iu(e,t),c=n.createElement("script"),ht(c),Et(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(s,c))}}function Ex(e,t){la.M(e,t);var n=go;if(n&&e){var a=Hl(n).hoistableScripts,s=yo(e),c=a.get(s);c||(c=n.querySelector(wi(s)),c||(e=g({src:e,async:!0,type:"module"},t),(t=mn.get(s))&&Iu(e,t),c=n.createElement("script"),ht(c),Et(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(s,c))}}function Pp(e,t,n,a){var s=(s=ie.current)?Kr(s):null;if(!s)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=vo(n.href),n=Hl(s).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=vo(n.href);var c=Hl(s).hoistableStyles,d=c.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=s.querySelector(Si(e)))&&!c._p&&(d.instance=c,d.state.loading=5),mn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mn.set(e,n),c||Cx(s,e,n,d.state))),t&&a===null)throw Error(i(528,""));return d}if(t&&a!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=yo(n),n=Hl(s).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function vo(e){return'href="'+ln(e)+'"'}function Si(e){return'link[rel="stylesheet"]['+e+"]"}function Jp(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Cx(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Et(t,"link",n),ht(t),e.head.appendChild(t))}function yo(e){return'[src="'+ln(e)+'"]'}function wi(e){return"script[async]"+e}function Ip(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+ln(n.href)+'"]');if(a)return t.instance=a,ht(a),a;var s=g({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ht(a),Et(a,"style",s),$r(a,n.precedence,e),t.instance=a;case"stylesheet":s=vo(n.href);var c=e.querySelector(Si(s));if(c)return t.state.loading|=4,t.instance=c,ht(c),c;a=Jp(n),(s=mn.get(s))&&Ju(a,s),c=(e.ownerDocument||e).createElement("link"),ht(c);var d=c;return d._p=new Promise(function(x,_){d.onload=x,d.onerror=_}),Et(c,"link",a),t.state.loading|=4,$r(c,n.precedence,e),t.instance=c;case"script":return c=yo(n.src),(s=e.querySelector(wi(c)))?(t.instance=s,ht(s),s):(a=n,(s=mn.get(c))&&(a=g({},n),Iu(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),ht(s),Et(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,$r(a,n.precedence,e));return t.instance}function $r(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,c=s,d=0;d title"):null)}function Tx(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function eg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ax(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=vo(a.href),c=t.querySelector(Si(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Jr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,ht(c);return}c=t.ownerDocument||t,a=Jp(a),(s=mn.get(s))&&Ju(a,s),c=c.createElement("link"),ht(c);var d=c;d._p=new Promise(function(x,_){d.onload=x,d.onerror=_}),Et(c,"link",a),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Jr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Fu=0;function _x(e,t){return e.stylesheets&&e.count===0&&Fr(e,e.stylesheets),0Fu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function Jr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ir=null;function Fr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ir=new Map,t.forEach(Ox,e),Ir=null,Jr.call(e))}function Ox(e,t){if(!(t.state.loading&4)){var n=Ir.get(e);if(n)var a=n.get(null);else{n=new Map,Ir.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),cf.exports=Xx(),cf.exports}var Zx=Qx();const Tv=(...l)=>l.filter((o,r,i)=>!!o&&o.trim()!==""&&i.indexOf(o)===r).join(" ").trim();const Kx=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const $x=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,r,i)=>i?i.toUpperCase():r.toLowerCase());const _g=l=>{const o=$x(l);return o.charAt(0).toUpperCase()+o.slice(1)};var mf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Px=l=>{for(const o in l)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},Jx=b.createContext({}),Ix=()=>b.useContext(Jx),Fx=b.forwardRef(({color:l,size:o,strokeWidth:r,absoluteStrokeWidth:i,className:u="",children:f,iconNode:m,...v},y)=>{const{size:p=24,strokeWidth:w=2,absoluteStrokeWidth:g=!1,color:E="currentColor",className:O=""}=Ix()??{},A=i??g?Number(r??w)*24/Number(o??p):r??w;return b.createElement("svg",{ref:y,...mf,width:o??p??mf.width,height:o??p??mf.height,stroke:l??E,strokeWidth:A,className:Tv("lucide",O,u),...!f&&!Px(v)&&{"aria-hidden":"true"},...v},[...m.map(([C,T])=>b.createElement(C,T)),...Array.isArray(f)?f:[f]])});const Rt=(l,o)=>{const r=b.forwardRef(({className:i,...u},f)=>b.createElement(Fx,{ref:f,iconNode:o,className:Tv(`lucide-${Kx(_g(l))}`,`lucide-${l}`,i),...u}));return r.displayName=_g(l),r};const Wx=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],e1=Rt("arrow-left",Wx);const t1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],n1=Rt("check",t1);const a1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Av=Rt("chevron-down",a1);const l1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],o1=Rt("chevron-up",l1);const i1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],r1=Rt("circle-check",i1);const s1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],c1=Rt("file",s1);const u1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],f1=Rt("info",u1);const d1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],m1=Rt("loader-circle",d1);const h1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],p1=Rt("moon",h1);const g1=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],v1=Rt("octagon-x",g1);const y1=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Af=Rt("paperclip",y1);const b1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],x1=Rt("pencil",b1);const S1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],w1=Rt("sun",S1);const E1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],C1=Rt("trash-2",E1);const T1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],A1=Rt("triangle-alert",T1);const _1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],O1=Rt("x",_1);var Ro=Cv();const R1=Ev(Ro);function N1(l){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",o.appendChild(r),r.styleSheet?r.styleSheet.cssText=l:r.appendChild(document.createTextNode(l))}const j1=l=>{switch(l){case"success":return M1;case"info":return k1;case"warning":return U1;case"error":return L1;default:return null}},D1=Array(12).fill(0),z1=({visible:l,className:o})=>le.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":l},le.createElement("div",{className:"sonner-spinner"},D1.map((r,i)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),M1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),U1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),k1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),L1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),H1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),B1=()=>{const[l,o]=le.useState(document.hidden);return le.useEffect(()=>{const r=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),l};let _f=1;class q1{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const r=this.subscribers.indexOf(o);this.subscribers.splice(r,1)}),this.publish=o=>{this.subscribers.forEach(r=>r(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var r;const{message:i,...u}=o,f=typeof o?.id=="number"||((r=o.id)==null?void 0:r.length)>0?o.id:_f++,m=this.toasts.find(y=>y.id===f),v=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),m?this.toasts=this.toasts.map(y=>y.id===f?(this.publish({...y,...o,id:f,title:i}),{...y,...o,id:f,dismissible:v,title:i}):y):this.addToast({title:i,...u,dismissible:v,id:f}),f},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:o,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),o),this.message=(o,r)=>this.create({...r,message:o}),this.error=(o,r)=>this.create({...r,message:o,type:"error"}),this.success=(o,r)=>this.create({...r,type:"success",message:o}),this.info=(o,r)=>this.create({...r,type:"info",message:o}),this.warning=(o,r)=>this.create({...r,type:"warning",message:o}),this.loading=(o,r)=>this.create({...r,type:"loading",message:o}),this.promise=(o,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:o,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const u=Promise.resolve(o instanceof Function?o():o);let f=i!==void 0,m;const v=u.then(async p=>{if(m=["resolve",p],le.isValidElement(p))f=!1,this.create({id:i,type:"default",message:p});else if(V1(p)&&!p.ok){f=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${p.status}`):r.error,E=typeof r.description=="function"?await r.description(`HTTP error! status: ${p.status}`):r.description,A=typeof g=="object"&&!le.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:E,...A})}else if(p instanceof Error){f=!1;const g=typeof r.error=="function"?await r.error(p):r.error,E=typeof r.description=="function"?await r.description(p):r.description,A=typeof g=="object"&&!le.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:E,...A})}else if(r.success!==void 0){f=!1;const g=typeof r.success=="function"?await r.success(p):r.success,E=typeof r.description=="function"?await r.description(p):r.description,A=typeof g=="object"&&!le.isValidElement(g)?g:{message:g};this.create({id:i,type:"success",description:E,...A})}}).catch(async p=>{if(m=["reject",p],r.error!==void 0){f=!1;const w=typeof r.error=="function"?await r.error(p):r.error,g=typeof r.description=="function"?await r.description(p):r.description,O=typeof w=="object"&&!le.isValidElement(w)?w:{message:w};this.create({id:i,type:"error",description:g,...O})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),y=()=>new Promise((p,w)=>v.then(()=>m[0]==="reject"?w(m[1]):p(m[1])).catch(w));return typeof i!="string"&&typeof i!="number"?{unwrap:y}:Object.assign(i,{unwrap:y})},this.custom=(o,r)=>{const i=r?.id||_f++;return this.create({jsx:o(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(o=>!this.dismissedToasts.has(o.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Qt=new q1,Y1=(l,o)=>{const r=o?.id||_f++;return Qt.addToast({title:l,...o,id:r}),r},V1=l=>l&&typeof l=="object"&&"ok"in l&&typeof l.ok=="boolean"&&"status"in l&&typeof l.status=="number",G1=Y1,X1=()=>Qt.toasts,Q1=()=>Qt.getActiveToasts(),Sl=Object.assign(G1,{success:Qt.success,info:Qt.info,warning:Qt.warning,error:Qt.error,custom:Qt.custom,message:Qt.message,promise:Qt.promise,dismiss:Qt.dismiss,loading:Qt.loading},{getHistory:X1,getToasts:Q1});N1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function is(l){return l.label!==void 0}const Z1=3,K1="24px",$1="16px",Og=4e3,P1=356,J1=14,I1=45,F1=200;function jn(...l){return l.filter(Boolean).join(" ")}function W1(l){const[o,r]=l.split("-"),i=[];return o&&i.push(o),r&&i.push(r),i}const eS=l=>{var o,r,i,u,f,m,v,y,p;const{invert:w,toast:g,unstyled:E,interacting:O,setHeights:A,visibleToasts:C,heights:T,index:S,toasts:D,expanded:z,removeToast:k,defaultRichColors:I,closeButton:X,style:K,cancelButtonStyle:G,actionButtonStyle:ae,className:me="",descriptionClassName:ge="",duration:U,position:te,gap:fe,expandByDefault:he,classNames:j,icons:Y,closeButtonAriaLabel:F="Close toast"}=l,[oe,P]=le.useState(null),[R,V]=le.useState(null),[Z,W]=le.useState(!1),[ee,ie]=le.useState(!1),[ye,ne]=le.useState(!1),[re,Le]=le.useState(!1),[Ce,Te]=le.useState(!1),[He,Ze]=le.useState(0),[dt,Cn]=le.useState(0),pn=le.useRef(g.duration||U||Og),Bn=le.useRef(null),Kt=le.useRef(null),Mo=S===0,Uo=S+1<=C,Nt=g.type,ga=g.dismissible!==!1,jt=g.className||"",Ks=g.descriptionClassName||"",Wa=le.useMemo(()=>T.findIndex(be=>be.toastId===g.id)||0,[T,g.id]),Zi=le.useMemo(()=>{var be;return(be=g.closeButton)!=null?be:X},[g.closeButton,X]),el=le.useMemo(()=>g.duration||U||Og,[g.duration,U]),ko=le.useRef(0),qn=le.useRef(0),Ki=le.useRef(0),va=le.useRef(null),[tl,Dt]=te.split("-"),gn=le.useMemo(()=>T.reduce((be,Pe,mt)=>mt>=Wa?be:be+Pe.height,0),[T,Wa]),Tt=B1(),$s=g.invert||w,Lo=Nt==="loading";qn.current=le.useMemo(()=>Wa*fe+gn,[Wa,gn]),le.useEffect(()=>{pn.current=el},[el]),le.useEffect(()=>{W(!0)},[]),le.useEffect(()=>{const be=Kt.current;if(be){const Pe=be.getBoundingClientRect().height;return Cn(Pe),A(mt=>[{toastId:g.id,height:Pe,position:g.position},...mt]),()=>A(mt=>mt.filter(At=>At.toastId!==g.id))}},[A,g.id]),le.useLayoutEffect(()=>{if(!Z)return;const be=Kt.current,Pe=be.style.height;be.style.height="auto";const mt=be.getBoundingClientRect().height;be.style.height=Pe,Cn(mt),A(At=>At.find(Fe=>Fe.toastId===g.id)?At.map(Fe=>Fe.toastId===g.id?{...Fe,height:mt}:Fe):[{toastId:g.id,height:mt,position:g.position},...At])},[Z,g.title,g.description,A,g.id,g.jsx,g.action,g.cancel]);const Tn=le.useCallback(()=>{ie(!0),Ze(qn.current),A(be=>be.filter(Pe=>Pe.toastId!==g.id)),setTimeout(()=>{k(g)},F1)},[g,k,A,qn]);le.useEffect(()=>{if(g.promise&&Nt==="loading"||g.duration===1/0||g.type==="loading")return;let be;return z||O||Tt?(()=>{if(Ki.current{g.onAutoClose==null||g.onAutoClose.call(g,g),Tn()},pn.current)),()=>clearTimeout(be)},[z,O,g,Nt,Tt,Tn]),le.useEffect(()=>{g.delete&&(Tn(),g.onDismiss==null||g.onDismiss.call(g,g))},[Tn,g.delete]);function Dl(){var be;if(Y?.loading){var Pe;return le.createElement("div",{className:jn(j?.loader,g==null||(Pe=g.classNames)==null?void 0:Pe.loader,"sonner-loader"),"data-visible":Nt==="loading"},Y.loading)}return le.createElement(z1,{className:jn(j?.loader,g==null||(be=g.classNames)==null?void 0:be.loader),visible:Nt==="loading"})}const zl=g.icon||Y?.[Nt]||j1(Nt);var nl,An;return le.createElement("li",{tabIndex:0,ref:Kt,className:jn(me,jt,j?.toast,g==null||(o=g.classNames)==null?void 0:o.toast,j?.default,j?.[Nt],g==null||(r=g.classNames)==null?void 0:r[Nt]),"data-sonner-toast":"","data-rich-colors":(nl=g.richColors)!=null?nl:I,"data-styled":!(g.jsx||g.unstyled||E),"data-mounted":Z,"data-promise":!!g.promise,"data-swiped":Ce,"data-removed":ee,"data-visible":Uo,"data-y-position":tl,"data-x-position":Dt,"data-index":S,"data-front":Mo,"data-swiping":ye,"data-dismissible":ga,"data-type":Nt,"data-invert":$s,"data-swipe-out":re,"data-swipe-direction":R,"data-expanded":!!(z||he&&Z),"data-testid":g.testId,style:{"--index":S,"--toasts-before":S,"--z-index":D.length-S,"--offset":`${ee?He:qn.current}px`,"--initial-height":he?"auto":`${dt}px`,...K,...g.style},onDragEnd:()=>{ne(!1),P(null),va.current=null},onPointerDown:be=>{be.button!==2&&(Lo||!ga||(Bn.current=new Date,Ze(qn.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(ne(!0),va.current={x:be.clientX,y:be.clientY})))},onPointerUp:()=>{var be,Pe,mt;if(re||!ga)return;va.current=null;const At=Number(((be=Kt.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ya=Number(((Pe=Kt.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Fe=new Date().getTime()-((mt=Bn.current)==null?void 0:mt.getTime()),Ut=oe==="x"?At:ya,al=Math.abs(Ut)/Fe;if(Math.abs(Ut)>=I1||al>.11){Ze(qn.current),g.onDismiss==null||g.onDismiss.call(g,g),V(oe==="x"?At>0?"right":"left":ya>0?"down":"up"),Tn(),Le(!0);return}else{var kt,Lt;(kt=Kt.current)==null||kt.style.setProperty("--swipe-amount-x","0px"),(Lt=Kt.current)==null||Lt.style.setProperty("--swipe-amount-y","0px")}Te(!1),ne(!1),P(null)},onPointerMove:be=>{var Pe,mt,At;if(!va.current||!ga||((Pe=window.getSelection())==null?void 0:Pe.toString().length)>0)return;const Fe=be.clientY-va.current.y,Ut=be.clientX-va.current.x;var al;const kt=(al=l.swipeDirections)!=null?al:W1(te);!oe&&(Math.abs(Ut)>1||Math.abs(Fe)>1)&&P(Math.abs(Ut)>Math.abs(Fe)?"x":"y");let Lt={x:0,y:0};const Ml=vn=>1/(1.5+Math.abs(vn)/20);if(oe==="y"){if(kt.includes("top")||kt.includes("bottom"))if(kt.includes("top")&&Fe<0||kt.includes("bottom")&&Fe>0)Lt.y=Fe;else{const vn=Fe*Ml(Fe);Lt.y=Math.abs(vn)0)Lt.x=Ut;else{const vn=Ut*Ml(Ut);Lt.x=Math.abs(vn)0||Math.abs(Lt.y)>0)&&Te(!0),(mt=Kt.current)==null||mt.style.setProperty("--swipe-amount-x",`${Lt.x}px`),(At=Kt.current)==null||At.style.setProperty("--swipe-amount-y",`${Lt.y}px`)}},Zi&&!g.jsx&&Nt!=="loading"?le.createElement("button",{"aria-label":F,"data-disabled":Lo,"data-close-button":!0,onClick:Lo||!ga?()=>{}:()=>{Tn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:jn(j?.closeButton,g==null||(i=g.classNames)==null?void 0:i.closeButton)},(An=Y?.close)!=null?An:H1):null,(Nt||g.icon||g.promise)&&g.icon!==null&&(Y?.[Nt]!==null||g.icon)?le.createElement("div",{"data-icon":"",className:jn(j?.icon,g==null||(u=g.classNames)==null?void 0:u.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Dl():null,g.type!=="loading"?zl:null):null,le.createElement("div",{"data-content":"",className:jn(j?.content,g==null||(f=g.classNames)==null?void 0:f.content)},le.createElement("div",{"data-title":"",className:jn(j?.title,g==null||(m=g.classNames)==null?void 0:m.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?le.createElement("div",{"data-description":"",className:jn(ge,Ks,j?.description,g==null||(v=g.classNames)==null?void 0:v.description)},typeof g.description=="function"?g.description():g.description):null),le.isValidElement(g.cancel)?g.cancel:g.cancel&&is(g.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||G,onClick:be=>{is(g.cancel)&&ga&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,be),Tn())},className:jn(j?.cancelButton,g==null||(y=g.classNames)==null?void 0:y.cancelButton)},g.cancel.label):null,le.isValidElement(g.action)?g.action:g.action&&is(g.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||ae,onClick:be=>{is(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,be),!be.defaultPrevented&&Tn())},className:jn(j?.actionButton,g==null||(p=g.classNames)==null?void 0:p.actionButton)},g.action.label):null)};function Rg(){if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?window.getComputedStyle(document.documentElement).direction:l}function tS(l,o){const r={};return[l,o].forEach((i,u)=>{const f=u===1,m=f?"--mobile-offset":"--offset",v=f?$1:K1;function y(p){["top","right","bottom","left"].forEach(w=>{r[`${m}-${w}`]=typeof p=="number"?`${p}px`:p})}typeof i=="number"||typeof i=="string"?y(i):typeof i=="object"?["top","right","bottom","left"].forEach(p=>{i[p]===void 0?r[`${m}-${p}`]=v:r[`${m}-${p}`]=typeof i[p]=="number"?`${i[p]}px`:i[p]}):y(v)}),r}const nS=le.forwardRef(function(o,r){const{id:i,invert:u,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:v,closeButton:y,className:p,offset:w,mobileOffset:g,theme:E="light",richColors:O,duration:A,style:C,visibleToasts:T=Z1,toastOptions:S,dir:D=Rg(),gap:z=J1,icons:k,containerAriaLabel:I="Notifications"}=o,[X,K]=le.useState([]),G=le.useMemo(()=>i?X.filter(Z=>Z.toasterId===i):X.filter(Z=>!Z.toasterId),[X,i]),ae=le.useMemo(()=>Array.from(new Set([f].concat(G.filter(Z=>Z.position).map(Z=>Z.position)))),[G,f]),[me,ge]=le.useState([]),[U,te]=le.useState(!1),[fe,he]=le.useState(!1),[j,Y]=le.useState(E!=="system"?E:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=le.useRef(null),oe=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=le.useRef(null),R=le.useRef(!1),V=le.useCallback(Z=>{K(W=>{var ee;return(ee=W.find(ie=>ie.id===Z.id))!=null&&ee.delete||Qt.dismiss(Z.id),W.filter(({id:ie})=>ie!==Z.id)})},[]);return le.useEffect(()=>Qt.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{K(W=>W.map(ee=>ee.id===Z.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{R1.flushSync(()=>{K(W=>{const ee=W.findIndex(ie=>ie.id===Z.id);return ee!==-1?[...W.slice(0,ee),{...W[ee],...Z},...W.slice(ee+1)]:[Z,...W]})})})}),[X]),le.useEffect(()=>{if(E!=="system"){Y(E);return}if(E==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:W})=>{Y(W?"dark":"light")})}catch{Z.addListener(({matches:ee})=>{try{Y(ee?"dark":"light")}catch(ie){console.error(ie)}})}},[E]),le.useEffect(()=>{X.length<=1&&te(!1)},[X]),le.useEffect(()=>{const Z=W=>{var ee;if(m.every(ne=>W[ne]||W.code===ne)){var ye;te(!0),(ye=F.current)==null||ye.focus()}W.code==="Escape"&&(document.activeElement===F.current||(ee=F.current)!=null&&ee.contains(document.activeElement))&&te(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[m]),le.useEffect(()=>{if(F.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,R.current=!1)}},[F.current]),le.createElement("section",{ref:r,"aria-label":`${I} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ae.map((Z,W)=>{var ee;const[ie,ye]=Z.split("-");return G.length?le.createElement("ol",{key:Z,dir:D==="auto"?Rg():D,tabIndex:-1,ref:F,className:p,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":ie,"data-x-position":ye,style:{"--front-toast-height":`${((ee=me[0])==null?void 0:ee.height)||0}px`,"--width":`${P1}px`,"--gap":`${z}px`,...C,...tS(w,g)},onBlur:ne=>{R.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(R.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||R.current||(R.current=!0,P.current=ne.relatedTarget)},onMouseEnter:()=>te(!0),onMouseMove:()=>te(!0),onMouseLeave:()=>{fe||te(!1)},onDragEnd:()=>te(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||he(!0)},onPointerUp:()=>he(!1)},G.filter(ne=>!ne.position&&W===0||ne.position===Z).map((ne,re)=>{var Le,Ce;return le.createElement(eS,{key:ne.id,icons:k,index:re,toast:ne,defaultRichColors:O,duration:(Le=S?.duration)!=null?Le:A,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:u,visibleToasts:T,closeButton:(Ce=S?.closeButton)!=null?Ce:y,interacting:fe,position:Z,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:V,toasts:G.filter(Te=>Te.position==ne.position),heights:me.filter(Te=>Te.position==ne.position),setHeights:ge,expandByDefault:v,gap:z,expanded:U,swipeDirections:o.swipeDirections})})):null}))}),aS=({...l})=>{const[o,r]=b.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light");return b.useEffect(()=>{const i=()=>r(document.documentElement.classList.contains("dark")?"dark":"light");i();const u=new MutationObserver(i);return u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>u.disconnect()},[]),h.jsx(nS,{theme:o,className:"toaster group",icons:{success:h.jsx(r1,{className:"size-4"}),info:h.jsx(f1,{className:"size-4"}),warning:h.jsx(A1,{className:"size-4"}),error:h.jsx(v1,{className:"size-4"}),loading:h.jsx(m1,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...l})},_v=["open","triaged","in_progress","fixed","verified","wontfix"],lS=["p0","p1","p2","p3"],oS=["ui","backend","usage","ux"];async function Ri(l){if(!l.ok){const o=await l.json().catch(()=>({}));throw new Error(o.error??`${l.status} ${l.statusText}`)}return await l.json()}async function Ng(l,o){if(l.ok)return l;const r=await l.text().catch(()=>"");let i="";try{i=JSON.parse(r).error??""}catch{i=r.slice(0,200).trim()}throw new Error(i?`${o}: ${i}`:`${o} (${l.status} ${l.statusText})`)}const Qa={list(l,o=200){const r=new URLSearchParams({limit:String(o),view:"list"});for(const[i,u]of Object.entries(l))u&&r.set(i,u);return fetch(`/feedback?${r}`).then(Ri)},get(l){return fetch(`/feedback/${encodeURIComponent(l)}`).then(Ri)},update(l,o){return fetch(`/feedback/${encodeURIComponent(l)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(r=>Ri(r))},comment(l,o,r){return fetch(`/queue/${encodeURIComponent(l)}/comment`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({body:o,author:r})}).then(i=>Ng(i,"Comment failed"))},setStatus(l,o,r,i){return fetch(`/queue/${encodeURIComponent(l)}/status`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({status:o,note:r,author:i})}).then(u=>Ng(u,"Status change failed"))},attach(l,o,r){const i=new URLSearchParams({name:o.name,intent:r.intent});return r.target&&i.set("target",r.target),r.author&&i.set("author",r.author),fetch(`/feedback/${encodeURIComponent(l)}/attachments?${i}`,{method:"POST",headers:{"Content-Type":o.type||"application/octet-stream"},body:o}).then(u=>Ri(u))},detach(l,o,r){const i=new URLSearchParams({author:r});return fetch(`/feedback/${encodeURIComponent(l)}/attachments/${encodeURIComponent(o)}?${i}`,{method:"DELETE"}).then(Ri)}},iS=l=>l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(1)} KB`:`${(l/1048576).toFixed(1)} MB`,Es={open:"bg-lb-open text-lb-open-foreground",triaged:"bg-lb-triaged text-lb-triaged-foreground",in_progress:"bg-lb-in-progress text-lb-in-progress-foreground",fixed:"bg-lb-fixed text-lb-fixed-foreground",verified:"bg-lb-verified text-lb-verified-foreground",wontfix:"bg-lb-wontfix text-lb-wontfix-foreground"},Of={p0:"text-lb-p0",p1:"text-lb-p1",p2:"text-lb-p2",p3:"text-lb-p3"},Rf={p0:"font-bold",p1:"font-semibold",p2:"font-medium",p3:"font-normal"};function Za(l){if(!l)return null;try{const o=new URL(l,window.location.origin);return o.protocol==="http:"||o.protocol==="https:"?o.href:null}catch{return null}}function Ov(l){var o,r,i="";if(typeof l=="string"||typeof l=="number")i+=l;else if(typeof l=="object")if(Array.isArray(l)){var u=l.length;for(o=0;otypeof l=="boolean"?`${l}`:l===0?"0":l,Dg=Rv,Vi=(l,o)=>r=>{var i;if(o?.variants==null)return Dg(l,r?.class,r?.className);const{variants:u,defaultVariants:f}=o,m=Object.keys(u).map(p=>{const w=r?.[p],g=f?.[p];if(w===null)return null;const E=jg(w)||jg(g);return u[p][E]}),v=r&&Object.entries(r).reduce((p,w)=>{let[g,E]=w;return E===void 0||(p[g]=E),p},{}),y=o==null||(i=o.compoundVariants)===null||i===void 0?void 0:i.reduce((p,w)=>{let{class:g,className:E,...O}=w;return Object.entries(O).every(A=>{let[C,T]=A;return Array.isArray(T)?T.includes({...f,...v}[C]):{...f,...v}[C]===T})?[...p,g,E]:p},[]);return Dg(l,m,y,r?.class,r?.className)};var rS=Object.defineProperty,ed=(l,o)=>rS(l,"name",{value:o,configurable:!0});function Nf(l,o){if(typeof l=="function")return l(o);l!=null&&(l.current=o)}ed(Nf,"setRef");function Nv(...l){return o=>{let r=!1;const i=l.map(u=>{const f=Nf(u,o);return!r&&typeof f=="function"&&(r=!0),f});if(r)return()=>{for(let u=0;usS(l,"name",{value:o,configurable:!0});function ua(l){const o=b.forwardRef((r,i)=>{let{children:u,...f}=r,m=null,v=!1;const y=[];jf(u)&&typeof rs=="function"&&(u=rs(u._payload)),b.Children.forEach(u,E=>{if(kv(E)){v=!0;const O=E;let A="child"in O.props?O.props.child:O.props.children;jf(A)&&typeof rs=="function"&&(A=rs(A._payload)),m=cS(O,A),y.push(m?.props?.children)}else y.push(E)}),m?m=b.cloneElement(m,void 0,y):!v&&b.Children.count(u)===1&&b.isValidElement(u)&&(m=u);const p=m?Uv(m):void 0,w=Xe(i,p);if(!m){if(u||u===0)throw new Error(v?dS(l):fS(l));return u}const g=Mv(f,m.props??{});return m.type!==b.Fragment&&(g.ref=i?w:p),b.cloneElement(m,g)});return o.displayName=`${l}.Slot`,o}wn(ua,"createSlot");var jv=ua("Slot"),Dv=Symbol.for("radix.slottable");function zv(l){const o=wn(r=>"child"in r?r.children(r.child):r.children,"Slottable");return o.displayName=`${l}.Slottable`,o.__radixId=Dv,o}wn(zv,"createSlottable");var cS=wn((l,o)=>{if("child"in l.props){const r=l.props.child;return b.isValidElement(r)?b.cloneElement(r,void 0,l.props.children(r.props.children)):null}return b.isValidElement(o)?o:null},"getSlottableElementFromSlottable");function Mv(l,o){const r={...o};for(const i in o){const u=l[i],f=o[i];/^on[A-Z]/.test(i)?u&&f?r[i]=(...v)=>{const y=f(...v);return u(...v),y}:u&&(r[i]=u):i==="style"?r[i]={...u,...f}:i==="className"&&(r[i]=[u,f].filter(Boolean).join(" "))}return{...l,...r}}wn(Mv,"mergeProps");function Uv(l){let o=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,r=o&&"isReactWarning"in o&&o.isReactWarning;return r?l.ref:(o=Object.getOwnPropertyDescriptor(l,"ref")?.get,r=o&&"isReactWarning"in o&&o.isReactWarning,r?l.props.ref:l.props.ref||l.ref)}wn(Uv,"getElementRef");function kv(l){return b.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Dv}wn(kv,"isSlottable");var uS=Symbol.for("react.lazy");function jf(l){return l!=null&&typeof l=="object"&&"$$typeof"in l&&l.$$typeof===uS&&"_payload"in l&&Lv(l._payload)}wn(jf,"isLazyComponent");function Lv(l){return typeof l=="object"&&l!==null&&"then"in l}wn(Lv,"isPromiseLike");var fS=wn(l=>`${l} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),dS=wn(l=>`${l} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),rs=Yi[" use ".trim().toString()],mS=Object.defineProperty,hS=(l,o)=>mS(l,"name",{value:o,configurable:!0}),pS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=pS.reduce((l,o)=>{const r=ua(`Primitive.${o}`),i=b.forwardRef((u,f)=>{const{asChild:m,...v}=u,y=m?r:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(y,{...v,ref:f})});return i.displayName=`Primitive.${o}`,{...l,[o]:i}},{});function Hv(l,o){l&&Ro.flushSync(()=>l.dispatchEvent(o))}hS(Hv,"dispatchDiscreteCustomEvent");var gS=Object.defineProperty,vS=(l,o)=>gS(l,"name",{value:o,configurable:!0}),Bv=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"}),yS=b.forwardRef(vS(function(o,r){return h.jsx(Ie.span,{...o,ref:r,style:{...Bv,...o.style}})},"VisuallyHidden")),bS=yS,xS=Object.defineProperty,hn=(l,o)=>xS(l,"name",{value:o,configurable:!0});function SS(l,o){const r=b.createContext(o);r.displayName=l+"Context";const i=hn(f=>{const{children:m,...v}=f,y=b.useMemo(()=>v,Object.values(v));return h.jsx(r.Provider,{value:y,children:m})},"Provider");i.displayName=l+"Provider";function u(f,m={}){const{optional:v=!1}=m,y=b.useContext(r);if(y)return y;if(o!==void 0)return o;if(!v)throw new Error(`\`${f}\` must be used within \`${l}\``)}return hn(u,"useContext"),[i,u]}hn(SS,"createContext");function Pa(l,o=[]){let r=[];function i(f,m){const v=b.createContext(m);v.displayName=f+"Context";const y=r.length;r=[...r,m];const p=hn(g=>{const{scope:E,children:O,...A}=g,C=E?.[l]?.[y]||v,T=b.useMemo(()=>A,Object.values(A));return h.jsx(C.Provider,{value:T,children:O})},"Provider");p.displayName=f+"Provider";function w(g,E,O={}){const{optional:A=!1}=O,C=E?.[l]?.[y]||v,T=b.useContext(C);if(T)return T;if(m!==void 0)return m;if(!A)throw new Error(`\`${g}\` must be used within \`${f}\``)}return hn(w,"useContext"),[p,w]}hn(i,"createContext");const u=hn(()=>{const f=r.map(m=>b.createContext(m));return hn(function(v){const y=v?.[l]||f;return b.useMemo(()=>({[`__scope${l}`]:{...v,[l]:y}}),[v,y])},"useScope")},"createScope");return u.scopeName=l,[i,qv(u,...o)]}hn(Pa,"createContextScope");function qv(...l){const o=l[0];if(l.length===1)return o;const r=hn(()=>{const i=l.map(u=>({useScope:u(),scopeName:u.scopeName}));return hn(function(f){const m=i.reduce((v,{useScope:y,scopeName:p})=>{const g=y(f)[`__scope${p}`];return{...v,...g}},{});return b.useMemo(()=>({[`__scope${o.scopeName}`]:m}),[m])},"useComposedScopes")},"createScope");return r.scopeName=o.scopeName,r}hn(qv,"composeContextScopes");var wS=Object.defineProperty,yt=(l,o)=>wS(l,"name",{value:o,configurable:!0});function Yv(l){const o=l+"CollectionProvider",[r,i]=Pa(o),[u,f]=r(o,{collectionRef:{current:null},itemMap:new Map}),m=yt(C=>{const{scope:T,children:S}=C,D=b.useRef(null),z=b.useRef(new Map).current;return h.jsx(u,{scope:T,itemMap:z,collectionRef:D,children:S})},"CollectionProvider");m.displayName=o;const v=l+"CollectionSlot",y=ua(v),p=b.forwardRef((C,T)=>{const{scope:S,children:D}=C,z=f(v,S),k=Xe(T,z.collectionRef);return h.jsx(y,{ref:k,children:D})});p.displayName=v;const w=l+"CollectionItemSlot",g="data-radix-collection-item",E=ua(w),O=b.forwardRef((C,T)=>{const{scope:S,children:D,...z}=C,k=b.useRef(null),I=Xe(T,k),X=f(w,S);return b.useEffect(()=>(X.itemMap.set(k,{ref:k,...z}),()=>{X.itemMap.delete(k)})),h.jsx(E,{[g]:"",ref:I,children:D})});O.displayName=w;function A(C){const T=f(l+"CollectionConsumer",C);return b.useCallback(()=>{const D=T.collectionRef.current;if(!D)return[];const z=Array.from(D.querySelectorAll(`[${g}]`));return Array.from(T.itemMap.values()).sort((X,K)=>z.indexOf(X.ref.current)-z.indexOf(K.ref.current))},[T.collectionRef,T.itemMap])}return yt(A,"useCollection"),[{Provider:m,Slot:p,ItemSlot:O},A,i]}yt(Yv,"createCollection");var zg=new WeakMap,st,tn,hf=(tn=class extends Map{constructor(r){super(r);gg(this,st);of(this,st,[...super.keys()]),zg.set(this,!0)}set(r,i){return zg.get(this)&&(this.has(r)?_t(this,st)[_t(this,st).indexOf(r)]=r:_t(this,st).push(r)),super.set(r,i),this}insert(r,i,u){const f=this.has(i),m=_t(this,st).length,v=td(r);let y=v>=0?v:m+v;const p=y<0||y>=m?-1:y;if(p===this.size||f&&p===this.size-1||p===-1)return this.set(i,u),this;const w=this.size+(f?0:1);v<0&&y++;const g=[..._t(this,st)];let E,O=!1;for(let A=y;A=this.size&&(f=this.size-1),this.at(f)}keyFrom(r,i){const u=this.indexOf(r);if(u===-1)return;let f=u+i;return f<0&&(f=0),f>=this.size&&(f=this.size-1),this.keyAt(f)}find(r,i){let u=0;for(const f of this){if(Reflect.apply(r,i,[f,u,this]))return f;u++}}findIndex(r,i){let u=0;for(const f of this){if(Reflect.apply(r,i,[f,u,this]))return u;u++}return-1}filter(r,i){const u=[];let f=0;for(const m of this)Reflect.apply(r,i,[m,f,this])&&u.push(m),f++;return new tn(u)}map(r,i){const u=[];let f=0;for(const m of this)u.push([m[0],Reflect.apply(r,i,[m,f,this])]),f++;return new tn(u)}reduce(...r){const[i,u]=r;let f=0,m=u??this.at(0);for(const v of this)f===0&&r.length===1?m=v:m=Reflect.apply(i,this,[m,v,f,this]),f++;return m}reduceRight(...r){const[i,u]=r;let f=u??this.at(-1);for(let m=this.size-1;m>=0;m--){const v=this.at(m);m===this.size-1&&r.length===1?f=v:f=Reflect.apply(i,this,[f,v,m,this])}return f}toSorted(r){const i=[...this.entries()].sort(r);return new tn(i)}toReversed(){const r=new tn;for(let i=this.size-1;i>=0;i--){const u=this.keyAt(i),f=this.get(u);r.set(u,f)}return r}toSpliced(...r){const i=[...this.entries()];return i.splice(...r),new tn(i)}slice(r,i){const u=new tn;let f=this.size-1;if(r===void 0)return u;r<0&&(r=r+this.size),i!==void 0&&i>0&&(f=i-1);for(let m=r;m<=f;m++){const v=this.keyAt(m),y=this.get(v);u.set(v,y)}return u}every(r,i){let u=0;for(const f of this){if(!Reflect.apply(r,i,[f,u,this]))return!1;u++}return!0}some(r,i){let u=0;for(const f of this){if(Reflect.apply(r,i,[f,u,this]))return!0;u++}return!1}},st=new WeakMap,yt(tn,"OrderedDict"),tn);function Cs(l,o){if("at"in Array.prototype)return Array.prototype.at.call(l,o);const r=Vv(l,o);return r===-1?void 0:l[r]}yt(Cs,"at");function Vv(l,o){const r=l.length,i=td(o),u=i>=0?i:r+i;return u<0||u>=r?-1:u}yt(Vv,"toSafeIndex");function td(l){return l!==l||l===0?0:Math.trunc(l)}yt(td,"toSafeInteger");function ES(l){const o=l+"CollectionProvider",[r,i]=Pa(o),[u,f]=r(o,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new hf,setItemMap:yt(()=>{},"setItemMap")}),m=yt(({state:z,...k})=>z?h.jsx(y,{...k,state:z}):h.jsx(v,{...k}),"CollectionProvider");m.displayName=o;const v=yt(z=>{const k=T();return h.jsx(y,{...z,state:k})},"CollectionInit");v.displayName=o+"Init";const y=yt(z=>{const{scope:k,children:I,state:X}=z,K=b.useRef(null),[G,ae]=b.useState(null),me=Xe(K,ae),[ge,U]=X;return b.useEffect(()=>{if(!G)return;const te=Qv(()=>{});return te.observe(G,{childList:!0,subtree:!0}),()=>{te.disconnect()}},[G]),h.jsx(u,{scope:k,itemMap:ge,setItemMap:U,collectionRef:me,collectionRefObject:K,collectionElement:G,children:I})},"CollectionProviderImpl");y.displayName=o+"Impl";const p=l+"CollectionSlot",w=ua(p),g=b.forwardRef((z,k)=>{const{scope:I,children:X}=z,K=f(p,I),G=Xe(k,K.collectionRef);return h.jsx(w,{ref:G,children:X})});g.displayName=p;const E=l+"CollectionItemSlot",O="data-radix-collection-item",A=ua(E),C=b.forwardRef((z,k)=>{const{scope:I,children:X,...K}=z,G=b.useRef(null),[ae,me]=b.useState(null),ge=Xe(k,G,me),U=f(E,I),{setItemMap:te}=U,fe=b.useRef(K);Gv(fe.current,K)||(fe.current=K);const he=fe.current;return b.useEffect(()=>{const j=he;return te(Y=>ae?Y.has(ae)?Y.set(ae,{...j,element:ae}).toSorted(Df):(Y.set(ae,{...j,element:ae}),Y.toSorted(Df)):Y),()=>{te(Y=>!ae||!Y.has(ae)?Y:(Y.delete(ae),new hf(Y)))}},[ae,he,te]),h.jsx(A,{[O]:"",ref:ge,children:X})});C.displayName=E;function T(){return b.useState(new hf)}yt(T,"useInitCollection");function S(z){const{itemMap:k}=f(l+"CollectionConsumer",z);return k}return yt(S,"useCollection"),[{Provider:m,Slot:g,ItemSlot:C},{createCollectionScope:i,useCollection:S,useInitCollection:T}]}yt(ES,"createCollection");function Gv(l,o){if(l===o)return!0;if(typeof l!="object"||typeof o!="object"||l==null||o==null)return!1;const r=Object.keys(l),i=Object.keys(o);if(r.length!==i.length)return!1;for(const u of r)if(!Object.prototype.hasOwnProperty.call(o,u)||l[u]!==o[u])return!1;return!0}yt(Gv,"shallowEqual");function Xv(l,o){return!!(o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_PRECEDING)}yt(Xv,"isElementPreceding");function Df(l,o){return!l[1].element||!o[1].element?0:Xv(l[1].element,o[1].element)?-1:1}yt(Df,"sortByDocumentPosition");function Qv(l){return new MutationObserver(r=>{for(const i of r)if(i.type==="childList"){l();return}})}yt(Qv,"getChildListObserver");var CS=Object.defineProperty,No=(l,o)=>CS(l,"name",{value:o,configurable:!0}),Zv=!!(typeof window<"u"&&window.document&&window.document.createElement);function De(l,o,{checkForDefaultPrevented:r=!0}={}){return No(function(u){if(l?.(u),r===!1||!u||!u.defaultPrevented)return o?.(u)},"handleEvent")}No(De,"composeEventHandlers");function TS(l){if(!Zv)throw new Error("Cannot access window outside of the DOM");return l?.ownerDocument?.defaultView??window}No(TS,"getOwnerWindow");function zf(l){if(!Zv)throw new Error("Cannot access document outside of the DOM");return l?.ownerDocument??document}No(zf,"getOwnerDocument");function Kv(l,o=!1){const{activeElement:r}=zf(l);if(!r?.nodeName)return null;if($v(r)&&r.contentDocument)return Kv(r.contentDocument.body,o);if(o){const i=r.getAttribute("aria-activedescendant");if(i){const u=zf(r).getElementById(i);if(u)return u}}return r}No(Kv,"getActiveElement");function $v(l){return l.tagName==="IFRAME"}No($v,"isFrame");var at=globalThis?.document?b.useLayoutEffect:()=>{},AS=Object.defineProperty,_S=(l,o)=>AS(l,"name",{value:o,configurable:!0}),Mg=Yi[" useEffectEvent ".trim().toString()],Ug=Yi[" useInsertionEffect ".trim().toString()];function Pv(l){if(typeof Mg=="function")return Mg(l);const o=b.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ug=="function"?Ug(()=>{o.current=l}):at(()=>{o.current=l}),b.useMemo(()=>((...r)=>o.current?.(...r)),[])}_S(Pv,"useEffectEvent");var OS=Object.defineProperty,Gi=(l,o)=>OS(l,"name",{value:o,configurable:!0}),RS=Yi[" useInsertionEffect ".trim().toString()]||at;function ki({prop:l,defaultProp:o,onChange:r=Gi(()=>{},"onChange"),caller:i}){const[u,f,m]=Jv({defaultProp:o,onChange:r}),v=l!==void 0,y=v?l:u,p=b.useCallback(w=>{if(v){const g=Iv(w)?w(l):w;g!==l&&m.current?.(g)}else f(w)},[v,l,f,m]);return[y,p]}Gi(ki,"useControllableState");function Jv({defaultProp:l,onChange:o}){const[r,i]=b.useState(l),u=b.useRef(r),f=b.useRef(o);return RS(()=>{f.current=o},[o]),b.useEffect(()=>{u.current!==r&&(f.current?.(r),u.current=r)},[r,u]),[r,i,f]}Gi(Jv,"useUncontrolledState");function Iv(l){return typeof l=="function"}Gi(Iv,"isFunction");var kg=Symbol("RADIX:SYNC_STATE");function NS(l,o,r,i){const{prop:u,defaultProp:f,onChange:m,caller:v}=o,y=u!==void 0,p=Pv(m),w=[{...r,state:f}];i&&w.push(i);const[g,E]=b.useReducer((T,S)=>{if(S.type===kg)return{...T,state:S.state};const D=l(T,S);return y&&!Object.is(D.state,T.state)&&p(D.state),D},...w),O=g.state,A=b.useRef(O);b.useEffect(()=>{A.current!==O&&(A.current=O,y||p(O))},[O,A,y]);const C=b.useMemo(()=>u!==void 0?{...g,state:u}:g,[g,u]);return b.useEffect(()=>{y&&!Object.is(u,g.state)&&E({type:kg,state:u})},[u,g.state,y]),[C,E]}Gi(NS,"useControllableStateReducer");var jS=Object.defineProperty,fa=(l,o)=>jS(l,"name",{value:o,configurable:!0});function Fv(l,o){return b.useReducer((r,i)=>o[r][i]??r,l)}fa(Fv,"useStateMachine");var jo=fa(l=>{const{present:o,children:r}=l,i=Wv(o),u=typeof r=="function"?r({present:i.isPresent}):b.Children.only(r),f=ey(i.ref,ty(u));return typeof r=="function"||i.isPresent?b.cloneElement(u,{ref:f}):null},"Presence");function Wv(l){const[o,r]=b.useState(),i=b.useRef(null),u=b.useRef(l),f=b.useRef("none"),m=b.useRef(void 0),v=l?"mounted":"unmounted",[y,p]=Fv(v,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{y==="mounted"?(f.current=m.current??Co(i.current),m.current=void 0):f.current="none"},[y]),at(()=>{const w=i.current,g=u.current;if(g!==l){const O=f.current,A=Co(w);l?(m.current=A,p("MOUNT")):A==="none"||w?.display==="none"?p("UNMOUNT"):p(g&&O!==A?"ANIMATION_OUT":"UNMOUNT"),u.current=l}},[l,p]),at(()=>{if(o){let w;const g=o.ownerDocument.defaultView??window,E=fa(A=>{const T=Co(i.current).includes(CSS.escape(A.animationName));if(A.target===o&&T&&(p("ANIMATION_END"),!u.current)){const S=o.style.animationFillMode;o.style.animationFillMode="forwards",w=g.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=S)})}},"handleAnimationEnd"),O=fa(A=>{A.target===o&&(f.current=Co(i.current))},"handleAnimationStart");return o.addEventListener("animationstart",O),o.addEventListener("animationcancel",E),o.addEventListener("animationend",E),()=>{g.clearTimeout(w),o.removeEventListener("animationstart",O),o.removeEventListener("animationcancel",E),o.removeEventListener("animationend",E)}}else p("ANIMATION_END")},[o,p]),{isPresent:["mounted","unmountSuspended"].includes(y),ref:b.useCallback(w=>{if(w){const g=getComputedStyle(w);i.current=g,m.current=Co(g)}else i.current=null;r(w)},[])}}fa(Wv,"usePresence");function Mf(l,o){if(typeof l=="function")return l(o);l!=null&&(l.current=o)}fa(Mf,"setRef");function ey(...l){const o=b.useRef(l);return o.current=l,b.useCallback(r=>{const i=o.current;let u=!1;const f=i.map(m=>{const v=Mf(m,r);return!u&&typeof v=="function"&&(u=!0),v});if(u)return()=>{for(let m=0;mDS(l,"name",{value:o,configurable:!0}),MS=Yi[" useId ".trim().toString()]||(()=>{}),US=0;function Tl(l){const[o,r]=b.useState(MS());return at(()=>{l||r(i=>i??String(US++))},[l]),l||(o?`radix-${o}`:"")}zS(Tl,"useId");var kS=Object.defineProperty,LS=(l,o)=>kS(l,"name",{value:o,configurable:!0}),HS=b.createContext(void 0);function ny(l){const o=b.useContext(HS);return l||o||"ltr"}LS(ny,"useDirection");var BS=Object.defineProperty,qS=(l,o)=>BS(l,"name",{value:o,configurable:!0});function kn(l){const o=b.useRef(l);return b.useEffect(()=>{o.current=l}),b.useMemo(()=>((...r)=>o.current?.(...r)),[])}qS(kn,"useCallbackRef");var YS=Object.defineProperty,vt=(l,o)=>YS(l,"name",{value:o,configurable:!0}),Uf="dismissableLayer.update",VS="dismissableLayer.pointerDownOutside",GS="dismissableLayer.focusOutside",Lg,ay=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nd=b.forwardRef(vt(function(o,r){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:u=!1,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:v,onInteractOutside:y,onDismiss:p,...w}=o,g=b.useContext(ay),[E,O]=b.useState(null),A=E?.ownerDocument??globalThis?.document,[,C]=b.useState({}),T=Xe(r,O),S=Array.from(g.layers),[D]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),z=D?S.indexOf(D):-1,k=E?S.indexOf(E):-1,I=g.layersWithOutsidePointerEventsDisabled.size>0,X=k>=z,K=b.useRef(!1),G=oy(U=>{m?.(U),y?.(U),U.defaultPrevented||p?.()},{ownerDocument:A,deferPointerDownOutside:u,isDeferredPointerDownOutsideRef:K,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:b.useCallback(U=>{if(!(U instanceof Node))return!1;const te=[...g.branches].some(fe=>fe.contains(U));return X&&!te},[g.branches,X])}),ae=iy(U=>{if(u&&K.current)return;const te=U.target;[...g.branches].some(he=>he.contains(te))||(v?.(U),y?.(U),U.defaultPrevented||p?.())},A),me=E?k===S.length-1:!1,ge=kn(U=>{U.key==="Escape"&&(f?.(U),!U.defaultPrevented&&p&&(U.preventDefault(),p()))});return b.useEffect(()=>{if(me)return A.addEventListener("keydown",ge,{capture:!0}),()=>A.removeEventListener("keydown",ge,{capture:!0})},[A,me,ge]),b.useEffect(()=>{if(E)return i&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Lg=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(E)),g.layers.add(E),kf(),()=>{i&&(g.layersWithOutsidePointerEventsDisabled.delete(E),g.layersWithOutsidePointerEventsDisabled.size===0&&(A.body.style.pointerEvents=Lg))}},[E,A,i,g]),b.useEffect(()=>()=>{E&&(g.layers.delete(E),g.layersWithOutsidePointerEventsDisabled.delete(E),kf())},[E,g]),b.useEffect(()=>{const U=vt(()=>C({}),"handleUpdate");return document.addEventListener(Uf,U),()=>document.removeEventListener(Uf,U)},[]),h.jsx(Ie.div,{...w,ref:T,style:{pointerEvents:I?X?"auto":"none":void 0,...o.style},onFocusCapture:De(o.onFocusCapture,ae.onFocusCapture),onBlurCapture:De(o.onBlurCapture,ae.onBlurCapture),onPointerDownCapture:De(o.onPointerDownCapture,G.onPointerDownCapture)})},"DismissableLayer"));function ly(){const l=b.useContext(ay),[o,r]=b.useState(null);return b.useEffect(()=>{if(o)return l.dismissableSurfaces.add(o),()=>{l.dismissableSurfaces.delete(o)}},[o,l.dismissableSurfaces]),r}vt(ly,"useDismissableLayerSurface");var XS=vt(()=>!0,"IS_TRUE");function oy(l,o){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:f,shouldHandlePointerDownOutside:m=XS}=o,v=kn(l),y=b.useRef(!1),p=b.useRef(!1),w=b.useRef(new Map),g=b.useRef(()=>{});return b.useEffect(()=>{function E(){p.current=!1,u.current=!1,w.current.clear()}vt(E,"resetOutsideInteraction");function O(){return Array.from(w.current.values()).some(Boolean)}vt(O,"isOutsideInteractionIntercepted");function A(z){if(!p.current)return;const k=z.target;k instanceof Node&&[...f].some(X=>X.contains(k))||w.current.set(z.type,!0),z.type==="click"&&window.setTimeout(()=>{p.current&&g.current()},0)}vt(A,"handleInteractionCapture");function C(z){p.current&&w.current.set(z.type,!1)}vt(C,"handleInteractionBubble");const T=vt(z=>{if(z.target&&!y.current){let k=function(){r.removeEventListener("click",g.current);const X=O();E(),X||ad(VS,v,I,{discrete:!0})};if(vt(k,"handleAndDispatchPointerDownOutsideEvent"),!m(z.target)){r.removeEventListener("click",g.current),E(),y.current=!1;return}const I={originalEvent:z};p.current=!0,u.current=i&&z.button===0,w.current.clear(),!i||z.button!==0?k():(r.removeEventListener("click",g.current),g.current=k,r.addEventListener("click",g.current,{once:!0}))}else r.removeEventListener("click",g.current),E();y.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const z of S)r.addEventListener(z,A,!0),r.addEventListener(z,C);const D=window.setTimeout(()=>{r.addEventListener("pointerdown",T)},0);return()=>{window.clearTimeout(D),r.removeEventListener("pointerdown",T),r.removeEventListener("click",g.current);for(const z of S)r.removeEventListener(z,A,!0),r.removeEventListener(z,C)}},[r,v,i,u,f,m]),{onPointerDownCapture:vt(()=>y.current=!0,"onPointerDownCapture")}}vt(oy,"usePointerDownOutside");function iy(l,o=globalThis?.document){const r=kn(l),i=b.useRef(!1);return b.useEffect(()=>{const u=vt(f=>{f.target&&!i.current&&ad(GS,r,{originalEvent:f},{discrete:!1})},"handleFocus");return o.addEventListener("focusin",u),()=>o.removeEventListener("focusin",u)},[o,r]),{onFocusCapture:vt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:vt(()=>i.current=!1,"onBlurCapture")}}vt(iy,"useFocusOutside");function kf(){const l=new CustomEvent(Uf);document.dispatchEvent(l)}vt(kf,"dispatchUpdate");function ad(l,o,r,{discrete:i}){const u=r.originalEvent.target,f=new CustomEvent(l,{bubbles:!1,cancelable:!0,detail:r});o&&u.addEventListener(l,o,{once:!0}),i?Hv(u,f):u.dispatchEvent(f)}vt(ad,"handleAndDispatchCustomEvent");var QS=Object.defineProperty,Mt=(l,o)=>QS(l,"name",{value:o,configurable:!0}),pf="focusScope.autoFocusOnMount",gf="focusScope.autoFocusOnUnmount",Hg={bubbles:!1,cancelable:!0},ry=b.forwardRef(Mt(function(o,r){const{loop:i=!1,trapped:u=!1,onMountAutoFocus:f,onUnmountAutoFocus:m,...v}=o,[y,p]=b.useState(null),w=kn(f),g=kn(m),E=b.useRef(null),O=Xe(r,p),A=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(u){let T=function(k){if(A.paused||!y)return;const I=k.target;y.contains(I)?E.current=I:ia(E.current,{select:!0})},S=function(k){if(A.paused||!y)return;const I=k.relatedTarget;I!==null&&(y.contains(I)||ia(E.current,{select:!0}))},D=function(k){if(document.activeElement===document.body)for(const X of k)X.removedNodes.length>0&&ia(y)};Mt(T,"handleFocusIn"),Mt(S,"handleFocusOut"),Mt(D,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",S);const z=new MutationObserver(D);return y&&z.observe(y,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",S),z.disconnect()}}},[u,y,A.paused]),b.useEffect(()=>{if(y){Bg.add(A);const T=document.activeElement;if(!y.contains(T)){const D=new CustomEvent(pf,Hg);y.addEventListener(pf,w),y.dispatchEvent(D),D.defaultPrevented||(sy(my(ld(y)),{select:!0}),document.activeElement===T&&ia(y))}return()=>{y.removeEventListener(pf,w),setTimeout(()=>{const D=new CustomEvent(gf,Hg);y.addEventListener(gf,g),y.dispatchEvent(D),D.defaultPrevented||ia(T??document.body,{select:!0}),y.removeEventListener(gf,g),Bg.remove(A)},0)}}},[y,w,g,A]);const C=b.useCallback(T=>{if(!i&&!u||A.paused)return;const S=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,D=document.activeElement;if(S&&D){const z=T.currentTarget,[k,I]=cy(z);k&&I?!T.shiftKey&&D===I?(T.preventDefault(),i&&ia(k,{select:!0})):T.shiftKey&&D===k&&(T.preventDefault(),i&&ia(I,{select:!0})):D===z&&T.preventDefault()}},[i,u,A.paused]);return h.jsx(Ie.div,{tabIndex:-1,...v,ref:O,onKeyDown:C})},"FocusScope"));function sy(l,{select:o=!1}={}){const r=document.activeElement;for(const i of l)if(ia(i,{select:o}),document.activeElement!==r)return}Mt(sy,"focusFirst");function cy(l){const o=ld(l),r=Lf(o,l),i=Lf(o.reverse(),l);return[r,i]}Mt(cy,"getTabbableEdges");function ld(l){const o=[],r=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:Mt(i=>{const u=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||u?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)o.push(r.currentNode);return o}Mt(ld,"getTabbableCandidates");function Lf(l,o){const r=typeof o.checkVisibility=="function"&&o.checkVisibility({checkVisibilityCSS:!0});for(const i of l)if(!(r?!i.checkVisibility({checkVisibilityCSS:!0}):uy(i,{upTo:o})))return i}Mt(Lf,"findVisible");function uy(l,{upTo:o}){if(getComputedStyle(l).visibility==="hidden")return!0;for(;l;){if(o!==void 0&&l===o)return!1;if(getComputedStyle(l).display==="none")return!0;l=l.parentElement}return!1}Mt(uy,"isHidden");function fy(l){return l instanceof HTMLInputElement&&"select"in l}Mt(fy,"isSelectableInput");function ia(l,{select:o=!1}={}){if(l&&l.focus){const r=document.activeElement;l.focus({preventScroll:!0}),l!==r&&fy(l)&&o&&l.select()}}Mt(ia,"focus");var Bg=dy();function dy(){let l=[];return{add(o){const r=l[0];o!==r&&r?.pause(),l=Hf(l,o),l.unshift(o)},remove(o){l=Hf(l,o),l[0]?.resume()}}}Mt(dy,"createFocusScopesStack");function Hf(l,o){const r=[...l],i=r.indexOf(o);return i!==-1&&r.splice(i,1),r}Mt(Hf,"arrayRemove");function my(l){return l.filter(o=>o.tagName!=="A")}Mt(my,"removeLinks");var ZS=Object.defineProperty,KS=(l,o)=>ZS(l,"name",{value:o,configurable:!0}),od=b.forwardRef(KS(function(o,r){const{container:i,...u}=o,[f,m]=b.useState(!1);at(()=>m(!0),[]);const v=i||f&&globalThis?.document?.body;return v?Ro.createPortal(h.jsx(Ie.div,{...u,ref:r}),v):null},"Portal")),$S=Object.defineProperty,id=(l,o)=>$S(l,"name",{value:o,configurable:!0}),ss=0,xo=null;function PS(l){return Ms(),l.children}id(PS,"FocusGuards");function Ms(){b.useEffect(()=>{xo||(xo={start:Bf(),end:Bf()});const{start:l,end:o}=xo;return document.body.firstElementChild!==l&&document.body.insertAdjacentElement("afterbegin",l),document.body.lastElementChild!==o&&document.body.insertAdjacentElement("beforeend",o),ss++,()=>{ss===1&&(xo?.start.remove(),xo?.end.remove(),xo=null),ss=Math.max(0,ss-1)}},[])}id(Ms,"useFocusGuards");function Bf(){const l=document.createElement("span");return l.setAttribute("data-radix-focus-guard",""),l.tabIndex=0,l.style.outline="none",l.style.opacity="0",l.style.position="fixed",l.style.pointerEvents="none",l}id(Bf,"createFocusGuard");var Mn=function(){return Mn=Object.assign||function(o){for(var r,i=1,u=arguments.length;i"u")return dw;var o=mw(l),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,i-r+o[2]-o[0])}},pw=vy(),Ao="data-scroll-locked",gw=function(l,o,r,i){var u=l.left,f=l.top,m=l.right,v=l.gap;return r===void 0&&(r="margin"),` +`+a.stack}}var Kt=Object.prototype.hasOwnProperty,Mo=l.unstable_scheduleCallback,Uo=l.unstable_cancelCallback,Nt=l.unstable_shouldYield,ga=l.unstable_requestPaint,jt=l.unstable_now,$s=l.unstable_getCurrentPriorityLevel,Wa=l.unstable_ImmediatePriority,Zi=l.unstable_UserBlockingPriority,el=l.unstable_NormalPriority,ko=l.unstable_LowPriority,qn=l.unstable_IdlePriority,Ki=l.log,va=l.unstable_setDisableYieldValue,tl=null,Dt=null;function gn(e){if(typeof Ki=="function"&&va(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(tl,e)}catch{}}var Tt=Math.clz32?Math.clz32:Tn,Ps=Math.log,Lo=Math.LN2;function Tn(e){return e>>>=0,e===0?32:31-(Ps(e)/Lo|0)|0}var Dl=256,zl=262144,nl=4194304;function An(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function be(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var s=0,c=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var x=a&134217727;return x!==0?(a=x&~c,a!==0?s=An(a):(d&=x,d!==0?s=An(d):n||(n=x&~e,n!==0&&(s=An(n))))):(x=a&~c,x!==0?s=An(x):d!==0?s=An(d):n||(n=a&~e,n!==0&&(s=An(n)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:s}function Pe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function At(){var e=nl;return nl<<=1,(nl&62914560)===0&&(nl=4194304),e}function ya(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ut(e,t,n,a,s,c){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var x=e.entanglements,_=e.expirationTimes,H=e.hiddenUpdates;for(n=d&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var j0=/[\n"\\]/g;function ln(e){return e.replace(j0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ec(e,t,n,a,s,c,d,x){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+an(t)):e.value!==""+an(t)&&(e.value=""+an(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?tc(e,d,an(t)):n!=null?tc(e,d,an(n)):a!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+an(x):e.removeAttribute("name")}function jd(e,t,n,a,s,c,d,x){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Ws(e);return}n=n!=null?""+an(n):"",t=t!=null?""+an(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=x?e.checked:!!a,e.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Ws(e)}function tc(e,t,n){t==="number"&&Ji(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ql(e,t,n,a){if(e=e.options,t){t={};for(var s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ic=!1;if(Gn)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){ic=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{ic=!1}var xa=null,rc=null,Fi=null;function Hd(){if(Fi)return Fi;var e,t=rc,n=t.length,a,s="value"in xa?xa.value:xa.textContent,c=s.length;for(e=0;e=Xo),Xd=" ",Qd=!1;function Zd(e,t){switch(e){case"keyup":return ob.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xl=!1;function rb(e,t){switch(e){case"compositionend":return Kd(t);case"keypress":return t.which!==32?null:(Qd=!0,Xd);case"textInput":return e=t.data,e===Xd&&Qd?null:e;default:return null}}function sb(e,t){if(Xl)return e==="compositionend"||!dc&&Zd(e,t)?(e=Hd(),Fi=rc=xa=null,Xl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=tm(n)}}function am(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?am(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ji(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ji(e.document)}return t}function pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var gb=Gn&&"documentMode"in document&&11>=document.documentMode,Ql=null,gc=null,$o=null,vc=!1;function om(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vc||Ql==null||Ql!==Ji(a)||(a=Ql,"selectionStart"in a&&pc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),$o&&Ko($o,a)||($o=a,a=Qr(gc,"onSelect"),0>=d,s-=d,_n=1<<32-Tt(t)+s|n<Ee?(Ne=de,de=null):Ne=de.sibling;var Ue=B(M,de,L[Ee],$);if(Ue===null){de===null&&(de=Ne);break}e&&de&&Ue.alternate===null&&t(M,de),N=c(Ue,N,Ee),Me===null?pe=Ue:Me.sibling=Ue,Me=Ue,de=Ne}if(Ee===L.length)return n(M,de),je&&Qn(M,Ee),pe;if(de===null){for(;EeEe?(Ne=de,de=null):Ne=de.sibling;var Va=B(M,de,Ue.value,$);if(Va===null){de===null&&(de=Ne);break}e&&de&&Va.alternate===null&&t(M,de),N=c(Va,N,Ee),Me===null?pe=Va:Me.sibling=Va,Me=Va,de=Ne}if(Ue.done)return n(M,de),je&&Qn(M,Ee),pe;if(de===null){for(;!Ue.done;Ee++,Ue=L.next())Ue=J(M,Ue.value,$),Ue!==null&&(N=c(Ue,N,Ee),Me===null?pe=Ue:Me.sibling=Ue,Me=Ue);return je&&Qn(M,Ee),pe}for(de=a(de);!Ue.done;Ee++,Ue=L.next())Ue=q(de,M,Ee,Ue.value,$),Ue!==null&&(e&&Ue.alternate!==null&&de.delete(Ue.key===null?Ee:Ue.key),N=c(Ue,N,Ee),Me===null?pe=Ue:Me.sibling=Ue,Me=Ue);return e&&de.forEach(function(kx){return t(M,kx)}),je&&Qn(M,Ee),pe}function Ge(M,N,L,$){if(typeof L=="object"&&L!==null&&L.type===C&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case O:e:{for(var pe=L.key;N!==null;){if(N.key===pe){if(pe=L.type,pe===C){if(N.tag===7){n(M,N.sibling),$=s(N,L.props.children),$.return=M,M=$;break e}}else if(N.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===G&&hl(pe)===N.type){n(M,N.sibling),$=s(N,L.props),ei($,L),$.return=M,M=$;break e}n(M,N);break}else t(M,N);N=N.sibling}L.type===C?($=cl(L.props.children,M.mode,$,L.key),$.return=M,M=$):($=sr(L.type,L.key,L.props,null,M.mode,$),ei($,L),$.return=M,M=$)}return d(M);case A:e:{for(pe=L.key;N!==null;){if(N.key===pe)if(N.tag===4&&N.stateNode.containerInfo===L.containerInfo&&N.stateNode.implementation===L.implementation){n(M,N.sibling),$=s(N,L.children||[]),$.return=M,M=$;break e}else{n(M,N);break}else t(M,N);N=N.sibling}$=Cc(L,M.mode,$),$.return=M,M=$}return d(M);case G:return L=hl(L),Ge(M,N,L,$)}if(he(L))return ue(M,N,L,$);if(U(L)){if(pe=U(L),typeof pe!="function")throw Error(i(150));return L=pe.call(L),ve(M,N,L,$)}if(typeof L.then=="function")return Ge(M,N,pr(L),$);if(L.$$typeof===z)return Ge(M,N,fr(M,L),$);gr(M,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,N!==null&&N.tag===6?(n(M,N.sibling),$=s(N,L),$.return=M,M=$):(n(M,N),$=Ec(L,M.mode,$),$.return=M,M=$),d(M)):n(M,N)}return function(M,N,L,$){try{Wo=0;var pe=Ge(M,N,L,$);return no=null,pe}catch(de){if(de===to||de===mr)throw de;var Me=Pt(29,de,null,M.mode);return Me.lanes=$,Me.return=M,Me}}}var gl=Om(!0),Rm=Om(!1),Ta=!1;function kc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _a(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ke&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=rr(e),dm(e,null,n),t}return ir(e,a,t,n),rr(e)}function ti(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,kt(e,n)}}function Hc(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var s=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?s=c=d:c=c.next=d,n=n.next}while(n!==null);c===null?s=c=t:c=c.next=t}else s=c=t;n={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Bc=!1;function ni(){if(Bc){var e=eo;if(e!==null)throw e}}function ai(e,t,n,a){Bc=!1;var s=e.updateQueue;Ta=!1;var c=s.firstBaseUpdate,d=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var _=x,H=_.next;_.next=null,d===null?c=H:d.next=H,d=_;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,x=Q.lastBaseUpdate,x!==d&&(x===null?Q.firstBaseUpdate=H:x.next=H,Q.lastBaseUpdate=_))}if(c!==null){var J=s.baseState;d=0,Q=H=_=null,x=c;do{var B=x.lane&-536870913,q=B!==x.lane;if(q?(Re&B)===B:(a&B)===B){B!==0&&B===Wl&&(Bc=!0),Q!==null&&(Q=Q.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ue=e,ve=x;B=t;var Ge=n;switch(ve.tag){case 1:if(ue=ve.payload,typeof ue=="function"){J=ue.call(Ge,J,B);break e}J=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ve.payload,B=typeof ue=="function"?ue.call(Ge,J,B):ue,B==null)break e;J=g({},J,B);break e;case 2:Ta=!0}}B=x.callback,B!==null&&(e.flags|=64,q&&(e.flags|=8192),q=s.callbacks,q===null?s.callbacks=[B]:q.push(B))}else q={lane:B,tag:x.tag,payload:x.payload,callback:x.callback,next:null},Q===null?(H=Q=q,_=J):Q=Q.next=q,d|=B;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;q=x,x=q.next,q.next=null,s.lastBaseUpdate=q,s.shared.pending=null}}while(!0);Q===null&&(_=J),s.baseState=_,s.firstBaseUpdate=H,s.lastBaseUpdate=Q,c===null&&(s.shared.lanes=0),Da|=d,e.lanes=d,e.memoizedState=J}}function Nm(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function jm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ec?c:8;var d=j.T,x={};j.T=x,lu(e,!1,t,n);try{var _=s(),H=j.S;if(H!==null&&H(x,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var Q=Tb(_,a);ii(e,t,Q,en(e))}else ii(e,t,a,en(e))}catch(J){ii(e,t,{then:function(){},status:"rejected",reason:J},en())}finally{Y.p=c,d!==null&&x.types!==null&&(d.types=x.types),j.T=d}}function jb(){}function nu(e,t,n,a){if(e.tag!==5)throw Error(i(476));var s=ch(e).queue;sh(e,s,t,F,n===null?jb:function(){return uh(e),n(a)})}function ch(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function uh(e){var t=ch(e);t.next===null&&(t=e.alternate.memoizedState),ii(e,t.next.queue,{},en())}function au(){return St(Ei)}function fh(){return nt().memoizedState}function dh(){return nt().memoizedState}function Db(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=en();e=Aa(n);var a=_a(t,e,n);a!==null&&(Xt(a,t,n),ti(a,t,n)),t={cache:Dc()},e.payload=t;return}t=t.return}}function zb(e,t,n){var a=en();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ar(e)?hh(t,n):(n=Sc(e,t,n,a),n!==null&&(Xt(n,e,a),ph(n,t,a)))}function mh(e,t,n){var a=en();ii(e,t,n,a)}function ii(e,t,n,a){var s={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ar(e))hh(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var d=t.lastRenderedState,x=c(d,n);if(s.hasEagerState=!0,s.eagerState=x,$t(x,d))return ir(e,t,s,0),Qe===null&&or(),!1}catch{}if(n=Sc(e,t,s,a),n!==null)return Xt(n,e,a),ph(n,t,a),!0}return!1}function lu(e,t,n,a){if(a={lane:2,revertLane:ku(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ar(e)){if(t)throw Error(i(479))}else t=Sc(e,n,a,2),t!==null&&Xt(t,e,2)}function Ar(e){var t=e.alternate;return e===we||t!==null&&t===we}function hh(e,t){lo=br=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ph(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,kt(e,n)}}var ri={readContext:St,use:wr,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};ri.useEffectEvent=We;var gh={readContext:St,use:wr,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Wm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Cr(4194308,4,ah.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cr(4194308,4,e,t)},useInsertionEffect:function(e,t){Cr(4,2,e,t)},useMemo:function(e,t){var n=zt();t=t===void 0?null:t;var a=e();if(vl){gn(!0);try{e()}finally{gn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=zt();if(n!==void 0){var s=n(t);if(vl){gn(!0);try{n(t)}finally{gn(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=zb.bind(null,we,e),[a.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ic(e);var t=e.queue,n=mh.bind(null,we,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:eu,useDeferredValue:function(e,t){var n=zt();return tu(n,e,t)},useTransition:function(){var e=Ic(!1);return e=sh.bind(null,we,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=we,s=zt();if(je){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Qe===null)throw Error(i(349));(Re&127)!==0||Lm(a,t,n)}s.memoizedState=n;var c={value:n,getSnapshot:t};return s.queue=c,Wm(Bm.bind(null,a,c,e),[e]),a.flags|=2048,io(9,{destroy:void 0},Hm.bind(null,a,c,n,t),null),n},useId:function(){var e=zt(),t=Qe.identifierPrefix;if(je){var n=On,a=_n;n=(a&~(1<<32-Tt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=xr++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?c.multiple=!0:a.size&&(c.size=a.size);break;default:c=typeof a.is=="string"?d.createElement(s,{is:a.is}):d.createElement(s)}}c[bt]=t,c[Ht]=a;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)c.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=c;e:switch(Et(c,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&In(t)}}return $e(t),yu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(i(166));if(e=ie.current,Il(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,s=xt,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[bt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Up(e.nodeValue,n)),e||Ea(t,!0)}else e=Zr(e).createTextNode(a),e[bt]=t,t.stateNode=e}return $e(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Il(t),n!==null){if(e===null){if(!a)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[bt]=t}else ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else n=Oc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(i(558))}return $e(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Il(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(i(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));s[bt]=t}else ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),s=!1}else s=Oc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(It(t),t):(It(t),null)}return It(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),jr(t,t.updateQueue),$e(t),null);case 4:return re(),e===null&&qu(t.stateNode.containerInfo),$e(t),null;case 10:return Kn(t.type),$e(t),null;case 19:if(V(tt),a=t.memoizedState,a===null)return $e(t),null;if(s=(t.flags&128)!==0,c=a.rendering,c===null)if(s)ci(a,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=yr(e),c!==null){for(t.flags|=128,ci(a,!1),e=c.updateQueue,t.updateQueue=e,jr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mm(n,e),n=n.sibling;return Z(tt,tt.current&1|2),je&&Qn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&jt()>kr&&(t.flags|=128,s=!0,ci(a,!1),t.lanes=4194304)}else{if(!s)if(e=yr(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,jr(t,e),ci(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!je)return $e(t),null}else 2*jt()-a.renderingStartTime>kr&&n!==536870912&&(t.flags|=128,s=!0,ci(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(e=a.last,e!==null?e.sibling=c:t.child=c,a.last=c)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=jt(),e.sibling=null,n=tt.current,Z(tt,s?n&1|2:n&1),je&&Qn(t,a.treeForkCount),e):($e(t),null);case 22:case 23:return It(t),Yc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),n=t.updateQueue,n!==null&&jr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&V(ml),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Kn(lt),$e(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hb(e,t){switch(Ac(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kn(lt),re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(i(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(tt),null;case 4:return re(),null;case 10:return Kn(t.type),null;case 22:case 23:return It(t),Yc(),e!==null&&V(ml),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Kn(lt),null;case 25:return null;default:return null}}function qh(e,t){switch(Ac(t),t.tag){case 3:Kn(lt),re();break;case 26:case 27:case 5:Ce(t);break;case 4:re();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:V(tt);break;case 10:Kn(t.type);break;case 22:case 23:It(t),Yc(),e!==null&&V(ml);break;case 24:Kn(lt)}}function ui(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&e)===e){a=void 0;var c=n.create,d=n.inst;a=c(),d.destroy=a}n=n.next}while(n!==s)}}catch(x){qe(t,t.return,x)}}function Na(e,t,n){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){var d=a.inst,x=d.destroy;if(x!==void 0){d.destroy=void 0,s=t;var _=n,H=x;try{H()}catch(Q){qe(s,_,Q)}}}a=a.next}while(a!==c)}}catch(Q){qe(t,t.return,Q)}}function Yh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{jm(t,n)}catch(a){qe(e,e.return,a)}}}function Vh(e,t,n){n.props=yl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){qe(e,t,a)}}function fi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(s){qe(e,t,s)}}function Rn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(s){qe(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){qe(e,t,s)}else n.current=null}function Gh(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(s){qe(e,e.return,s)}}function bu(e,t,n){try{var a=e.stateNode;ix(a,e.type,n,t),a[Ht]=t}catch(s){qe(e,e.return,s)}}function Xh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&La(e.type)||e.tag===4}function xu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&La(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Su(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vn));else if(a!==4&&(a===27&&La(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Su(e,t,n),e=e.sibling;e!==null;)Su(e,t,n),e=e.sibling}function Dr(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&La(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Dr(e,t,n),e=e.sibling;e!==null;)Dr(e,t,n),e=e.sibling}function Qh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Et(t,a,n),t[bt]=e,t[Ht]=n}catch(c){qe(e,e.return,c)}}var Fn=!1,rt=!1,wu=!1,Zh=typeof WeakSet=="function"?WeakSet:Set,pt=null;function Bb(e,t){if(e=e.containerInfo,Gu=Wr,e=lm(e),pc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var s=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var d=0,x=-1,_=-1,H=0,Q=0,J=e,B=null;t:for(;;){for(var q;J!==n||s!==0&&J.nodeType!==3||(x=d+s),J!==c||a!==0&&J.nodeType!==3||(_=d+a),J.nodeType===3&&(d+=J.nodeValue.length),(q=J.firstChild)!==null;)B=J,J=q;for(;;){if(J===e)break t;if(B===n&&++H===s&&(x=d),B===c&&++Q===a&&(_=d),(q=J.nextSibling)!==null)break;J=B,B=J.parentNode}J=q}n=x===-1||_===-1?null:{start:x,end:_}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xu={focusedElem:e,selectionRange:n},Wr=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),Et(c,a,n),c[bt]=e,ht(c),a=c;break e;case"link":var d=Fp("link","href",s).get(a+(n.href||""));if(d){for(var x=0;xGe&&(d=Ge,Ge=ve,ve=d);var M=nm(x,ve),N=nm(x,Ge);if(M&&N&&(q.rangeCount!==1||q.anchorNode!==M.node||q.anchorOffset!==M.offset||q.focusNode!==N.node||q.focusOffset!==N.offset)){var L=J.createRange();L.setStart(M.node,M.offset),q.removeAllRanges(),ve>Ge?(q.addRange(L),q.extend(N.node,N.offset)):(L.setEnd(N.node,N.offset),q.addRange(L))}}}}for(J=[],q=x;q=q.parentNode;)q.nodeType===1&&J.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;xn?32:n,j.T=null,n=Ru,Ru=null;var c=Ma,d=aa;if(ct=0,fo=Ma=null,aa=0,(ke&6)!==0)throw Error(i(331));var x=ke;if(ke|=4,ap(c.current),ep(c,c.current,d,n),ke=x,vi(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(tl,c)}catch{}return!0}finally{Y.p=s,j.T=a,Sp(e,t)}}function Ep(e,t,n){t=rn(n,t),t=su(e.stateNode,t,2),e=_a(e,t,2),e!==null&&(Fe(e,2),Nn(e))}function qe(e,t,n){if(e.tag===3)Ep(e,e,n);else for(;t!==null;){if(t.tag===3){Ep(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(za===null||!za.has(a))){e=rn(n,e),n=Ch(2),a=_a(t,n,2),a!==null&&(Th(n,a,t,e),Fe(a,2),Nn(a));break}}t=t.return}}function zu(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Vb;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(n)||(Tu=!0,s.add(n),e=Kb.bind(null,e,t,n),t.then(e,e))}function Kb(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Qe===e&&(Re&n)===n&&(et===4||et===3&&(Re&62914560)===Re&&300>jt()-Ur?(ke&2)===0&&mo(e,0):Au|=n,uo===Re&&(uo=0)),Nn(e)}function Cp(e,t){t===0&&(t=At()),e=sl(e,t),e!==null&&(Fe(e,t),Nn(e))}function $b(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cp(e,n)}function Pb(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(i(314))}a!==null&&a.delete(t),Cp(e,n)}function Jb(e,t){return Mo(e,t)}var Vr=null,po=null,Mu=!1,Gr=!1,Uu=!1,ka=0;function Nn(e){e!==po&&e.next===null&&(po===null?Vr=po=e:po=po.next=e),Gr=!0,Mu||(Mu=!0,Fb())}function vi(e,t){if(!Uu&&Gr){Uu=!0;do for(var n=!1,a=Vr;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var c=0;else{var d=a.suspendedLanes,x=a.pingedLanes;c=(1<<31-Tt(42|e)+1)-1,c&=s&~(d&~x),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Op(a,c))}else c=Re,c=be(a,a===Qe?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||Pe(a,c)||(n=!0,Op(a,c));a=a.next}while(n);Uu=!1}}function Ib(){Tp()}function Tp(){Gr=Mu=!1;var e=0;ka!==0&&sx()&&(e=ka);for(var t=jt(),n=null,a=Vr;a!==null;){var s=a.next,c=Ap(a,t);c===0?(a.next=null,n===null?Vr=s:n.next=s,s===null&&(po=n)):(n=a,(e!==0||(c&3)!==0)&&(Gr=!0)),a=s}ct!==0&&ct!==5||vi(e),ka!==0&&(ka=0)}function Ap(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0x)break;var Q=_.transferSize,J=_.initiatorType;Q&&kp(J)&&(_=_.responseEnd,d+=Q*(_"u"?null:document;function $p(e,t,n){var a=go;if(a&&typeof t=="string"&&t){var s=ln(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),Kp.has(s)||(Kp.add(s),e={rel:e,crossOrigin:n,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),Et(t,"link",e),ht(t),a.head.appendChild(t)))}}function vx(e){la.D(e),$p("dns-prefetch",e,null)}function yx(e,t){la.C(e,t),$p("preconnect",e,t)}function bx(e,t,n){la.L(e,t,n);var a=go;if(a&&e&&t){var s='link[rel="preload"][as="'+ln(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+ln(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+ln(n.imageSizes)+'"]')):s+='[href="'+ln(e)+'"]';var c=s;switch(t){case"style":c=vo(e);break;case"script":c=yo(e)}mn.has(c)||(e=g({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),mn.set(c,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Si(c))||t==="script"&&a.querySelector(wi(c))||(t=a.createElement("link"),Et(t,"link",e),ht(t),a.head.appendChild(t)))}}function xx(e,t){la.m(e,t);var n=go;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+ln(a)+'"][href="'+ln(e)+'"]',c=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=yo(e)}if(!mn.has(c)&&(e=g({rel:"modulepreload",href:e},t),mn.set(c,e),n.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wi(c)))return}a=n.createElement("link"),Et(a,"link",e),ht(a),n.head.appendChild(a)}}}function Sx(e,t,n){la.S(e,t,n);var a=go;if(a&&e){var s=Hl(a).hoistableStyles,c=vo(e);t=t||"default";var d=s.get(c);if(!d){var x={loading:0,preload:null};if(d=a.querySelector(Si(c)))x.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},n),(n=mn.get(c))&&Iu(e,n);var _=d=a.createElement("link");ht(_),Et(_,"link",e),_._p=new Promise(function(H,Q){_.onload=H,_.onerror=Q}),_.addEventListener("load",function(){x.loading|=1}),_.addEventListener("error",function(){x.loading|=2}),x.loading|=4,$r(d,t,a)}d={type:"stylesheet",instance:d,count:1,state:x},s.set(c,d)}}}function wx(e,t){la.X(e,t);var n=go;if(n&&e){var a=Hl(n).hoistableScripts,s=yo(e),c=a.get(s);c||(c=n.querySelector(wi(s)),c||(e=g({src:e,async:!0},t),(t=mn.get(s))&&Fu(e,t),c=n.createElement("script"),ht(c),Et(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(s,c))}}function Ex(e,t){la.M(e,t);var n=go;if(n&&e){var a=Hl(n).hoistableScripts,s=yo(e),c=a.get(s);c||(c=n.querySelector(wi(s)),c||(e=g({src:e,async:!0,type:"module"},t),(t=mn.get(s))&&Fu(e,t),c=n.createElement("script"),ht(c),Et(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(s,c))}}function Pp(e,t,n,a){var s=(s=ie.current)?Kr(s):null;if(!s)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=vo(n.href),n=Hl(s).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=vo(n.href);var c=Hl(s).hoistableStyles,d=c.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=s.querySelector(Si(e)))&&!c._p&&(d.instance=c,d.state.loading=5),mn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mn.set(e,n),c||Cx(s,e,n,d.state))),t&&a===null)throw Error(i(528,""));return d}if(t&&a!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=yo(n),n=Hl(s).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function vo(e){return'href="'+ln(e)+'"'}function Si(e){return'link[rel="stylesheet"]['+e+"]"}function Jp(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Cx(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Et(t,"link",n),ht(t),e.head.appendChild(t))}function yo(e){return'[src="'+ln(e)+'"]'}function wi(e){return"script[async]"+e}function Ip(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+ln(n.href)+'"]');if(a)return t.instance=a,ht(a),a;var s=g({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ht(a),Et(a,"style",s),$r(a,n.precedence,e),t.instance=a;case"stylesheet":s=vo(n.href);var c=e.querySelector(Si(s));if(c)return t.state.loading|=4,t.instance=c,ht(c),c;a=Jp(n),(s=mn.get(s))&&Iu(a,s),c=(e.ownerDocument||e).createElement("link"),ht(c);var d=c;return d._p=new Promise(function(x,_){d.onload=x,d.onerror=_}),Et(c,"link",a),t.state.loading|=4,$r(c,n.precedence,e),t.instance=c;case"script":return c=yo(n.src),(s=e.querySelector(wi(c)))?(t.instance=s,ht(s),s):(a=n,(s=mn.get(c))&&(a=g({},n),Fu(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),ht(s),Et(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,$r(a,n.precedence,e));return t.instance}function $r(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,c=s,d=0;d title"):null)}function Tx(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function eg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ax(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=vo(a.href),c=t.querySelector(Si(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Jr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,ht(c);return}c=t.ownerDocument||t,a=Jp(a),(s=mn.get(s))&&Iu(a,s),c=c.createElement("link"),ht(c);var d=c;d._p=new Promise(function(x,_){d.onload=x,d.onerror=_}),Et(c,"link",a),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Jr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Wu=0;function _x(e,t){return e.stylesheets&&e.count===0&&Fr(e,e.stylesheets),0Wu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function Jr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ir=null;function Fr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ir=new Map,t.forEach(Ox,e),Ir=null,Jr.call(e))}function Ox(e,t){if(!(t.state.loading&4)){var n=Ir.get(e);if(n)var a=n.get(null);else{n=new Map,Ir.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),uf.exports=Xx(),uf.exports}var Zx=Qx();const Tv=(...l)=>l.filter((o,r,i)=>!!o&&o.trim()!==""&&i.indexOf(o)===r).join(" ").trim();const Kx=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const $x=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,r,i)=>i?i.toUpperCase():r.toLowerCase());const _g=l=>{const o=$x(l);return o.charAt(0).toUpperCase()+o.slice(1)};var hf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Px=l=>{for(const o in l)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},Jx=b.createContext({}),Ix=()=>b.useContext(Jx),Fx=b.forwardRef(({color:l,size:o,strokeWidth:r,absoluteStrokeWidth:i,className:u="",children:f,iconNode:m,...v},y)=>{const{size:p=24,strokeWidth:w=2,absoluteStrokeWidth:g=!1,color:E="currentColor",className:O=""}=Ix()??{},A=i??g?Number(r??w)*24/Number(o??p):r??w;return b.createElement("svg",{ref:y,...hf,width:o??p??hf.width,height:o??p??hf.height,stroke:l??E,strokeWidth:A,className:Tv("lucide",O,u),...!f&&!Px(v)&&{"aria-hidden":"true"},...v},[...m.map(([C,T])=>b.createElement(C,T)),...Array.isArray(f)?f:[f]])});const Rt=(l,o)=>{const r=b.forwardRef(({className:i,...u},f)=>b.createElement(Fx,{ref:f,iconNode:o,className:Tv(`lucide-${Kx(_g(l))}`,`lucide-${l}`,i),...u}));return r.displayName=_g(l),r};const Wx=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],e1=Rt("arrow-left",Wx);const t1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],n1=Rt("check",t1);const a1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Av=Rt("chevron-down",a1);const l1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],o1=Rt("chevron-up",l1);const i1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],r1=Rt("circle-check",i1);const s1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],c1=Rt("file",s1);const u1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],f1=Rt("info",u1);const d1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],m1=Rt("loader-circle",d1);const h1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],p1=Rt("moon",h1);const g1=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],v1=Rt("octagon-x",g1);const y1=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],_f=Rt("paperclip",y1);const b1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],x1=Rt("pencil",b1);const S1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],w1=Rt("sun",S1);const E1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],C1=Rt("trash-2",E1);const T1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],A1=Rt("triangle-alert",T1);const _1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],O1=Rt("x",_1);var Ro=Cv();const R1=Ev(Ro);function N1(l){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",o.appendChild(r),r.styleSheet?r.styleSheet.cssText=l:r.appendChild(document.createTextNode(l))}const j1=l=>{switch(l){case"success":return M1;case"info":return k1;case"warning":return U1;case"error":return L1;default:return null}},D1=Array(12).fill(0),z1=({visible:l,className:o})=>le.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":l},le.createElement("div",{className:"sonner-spinner"},D1.map((r,i)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),M1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),U1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),k1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),L1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),H1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),B1=()=>{const[l,o]=le.useState(document.hidden);return le.useEffect(()=>{const r=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),l};let Of=1;class q1{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const r=this.subscribers.indexOf(o);this.subscribers.splice(r,1)}),this.publish=o=>{this.subscribers.forEach(r=>r(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var r;const{message:i,...u}=o,f=typeof o?.id=="number"||((r=o.id)==null?void 0:r.length)>0?o.id:Of++,m=this.toasts.find(y=>y.id===f),v=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),m?this.toasts=this.toasts.map(y=>y.id===f?(this.publish({...y,...o,id:f,title:i}),{...y,...o,id:f,dismissible:v,title:i}):y):this.addToast({title:i,...u,dismissible:v,id:f}),f},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:o,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),o),this.message=(o,r)=>this.create({...r,message:o}),this.error=(o,r)=>this.create({...r,message:o,type:"error"}),this.success=(o,r)=>this.create({...r,type:"success",message:o}),this.info=(o,r)=>this.create({...r,type:"info",message:o}),this.warning=(o,r)=>this.create({...r,type:"warning",message:o}),this.loading=(o,r)=>this.create({...r,type:"loading",message:o}),this.promise=(o,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:o,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const u=Promise.resolve(o instanceof Function?o():o);let f=i!==void 0,m;const v=u.then(async p=>{if(m=["resolve",p],le.isValidElement(p))f=!1,this.create({id:i,type:"default",message:p});else if(V1(p)&&!p.ok){f=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${p.status}`):r.error,E=typeof r.description=="function"?await r.description(`HTTP error! status: ${p.status}`):r.description,A=typeof g=="object"&&!le.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:E,...A})}else if(p instanceof Error){f=!1;const g=typeof r.error=="function"?await r.error(p):r.error,E=typeof r.description=="function"?await r.description(p):r.description,A=typeof g=="object"&&!le.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:E,...A})}else if(r.success!==void 0){f=!1;const g=typeof r.success=="function"?await r.success(p):r.success,E=typeof r.description=="function"?await r.description(p):r.description,A=typeof g=="object"&&!le.isValidElement(g)?g:{message:g};this.create({id:i,type:"success",description:E,...A})}}).catch(async p=>{if(m=["reject",p],r.error!==void 0){f=!1;const w=typeof r.error=="function"?await r.error(p):r.error,g=typeof r.description=="function"?await r.description(p):r.description,O=typeof w=="object"&&!le.isValidElement(w)?w:{message:w};this.create({id:i,type:"error",description:g,...O})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),y=()=>new Promise((p,w)=>v.then(()=>m[0]==="reject"?w(m[1]):p(m[1])).catch(w));return typeof i!="string"&&typeof i!="number"?{unwrap:y}:Object.assign(i,{unwrap:y})},this.custom=(o,r)=>{const i=r?.id||Of++;return this.create({jsx:o(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(o=>!this.dismissedToasts.has(o.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Qt=new q1,Y1=(l,o)=>{const r=o?.id||Of++;return Qt.addToast({title:l,...o,id:r}),r},V1=l=>l&&typeof l=="object"&&"ok"in l&&typeof l.ok=="boolean"&&"status"in l&&typeof l.status=="number",G1=Y1,X1=()=>Qt.toasts,Q1=()=>Qt.getActiveToasts(),Sl=Object.assign(G1,{success:Qt.success,info:Qt.info,warning:Qt.warning,error:Qt.error,custom:Qt.custom,message:Qt.message,promise:Qt.promise,dismiss:Qt.dismiss,loading:Qt.loading},{getHistory:X1,getToasts:Q1});N1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function is(l){return l.label!==void 0}const Z1=3,K1="24px",$1="16px",Og=4e3,P1=356,J1=14,I1=45,F1=200;function jn(...l){return l.filter(Boolean).join(" ")}function W1(l){const[o,r]=l.split("-"),i=[];return o&&i.push(o),r&&i.push(r),i}const eS=l=>{var o,r,i,u,f,m,v,y,p;const{invert:w,toast:g,unstyled:E,interacting:O,setHeights:A,visibleToasts:C,heights:T,index:S,toasts:D,expanded:z,removeToast:k,defaultRichColors:I,closeButton:X,style:K,cancelButtonStyle:G,actionButtonStyle:ae,className:me="",descriptionClassName:ge="",duration:U,position:te,gap:fe,expandByDefault:he,classNames:j,icons:Y,closeButtonAriaLabel:F="Close toast"}=l,[oe,P]=le.useState(null),[R,V]=le.useState(null),[Z,W]=le.useState(!1),[ee,ie]=le.useState(!1),[ye,ne]=le.useState(!1),[re,Le]=le.useState(!1),[Ce,Te]=le.useState(!1),[He,Ze]=le.useState(0),[dt,Cn]=le.useState(0),pn=le.useRef(g.duration||U||Og),Bn=le.useRef(null),Kt=le.useRef(null),Mo=S===0,Uo=S+1<=C,Nt=g.type,ga=g.dismissible!==!1,jt=g.className||"",$s=g.descriptionClassName||"",Wa=le.useMemo(()=>T.findIndex(be=>be.toastId===g.id)||0,[T,g.id]),Zi=le.useMemo(()=>{var be;return(be=g.closeButton)!=null?be:X},[g.closeButton,X]),el=le.useMemo(()=>g.duration||U||Og,[g.duration,U]),ko=le.useRef(0),qn=le.useRef(0),Ki=le.useRef(0),va=le.useRef(null),[tl,Dt]=te.split("-"),gn=le.useMemo(()=>T.reduce((be,Pe,mt)=>mt>=Wa?be:be+Pe.height,0),[T,Wa]),Tt=B1(),Ps=g.invert||w,Lo=Nt==="loading";qn.current=le.useMemo(()=>Wa*fe+gn,[Wa,gn]),le.useEffect(()=>{pn.current=el},[el]),le.useEffect(()=>{W(!0)},[]),le.useEffect(()=>{const be=Kt.current;if(be){const Pe=be.getBoundingClientRect().height;return Cn(Pe),A(mt=>[{toastId:g.id,height:Pe,position:g.position},...mt]),()=>A(mt=>mt.filter(At=>At.toastId!==g.id))}},[A,g.id]),le.useLayoutEffect(()=>{if(!Z)return;const be=Kt.current,Pe=be.style.height;be.style.height="auto";const mt=be.getBoundingClientRect().height;be.style.height=Pe,Cn(mt),A(At=>At.find(Fe=>Fe.toastId===g.id)?At.map(Fe=>Fe.toastId===g.id?{...Fe,height:mt}:Fe):[{toastId:g.id,height:mt,position:g.position},...At])},[Z,g.title,g.description,A,g.id,g.jsx,g.action,g.cancel]);const Tn=le.useCallback(()=>{ie(!0),Ze(qn.current),A(be=>be.filter(Pe=>Pe.toastId!==g.id)),setTimeout(()=>{k(g)},F1)},[g,k,A,qn]);le.useEffect(()=>{if(g.promise&&Nt==="loading"||g.duration===1/0||g.type==="loading")return;let be;return z||O||Tt?(()=>{if(Ki.current{g.onAutoClose==null||g.onAutoClose.call(g,g),Tn()},pn.current)),()=>clearTimeout(be)},[z,O,g,Nt,Tt,Tn]),le.useEffect(()=>{g.delete&&(Tn(),g.onDismiss==null||g.onDismiss.call(g,g))},[Tn,g.delete]);function Dl(){var be;if(Y?.loading){var Pe;return le.createElement("div",{className:jn(j?.loader,g==null||(Pe=g.classNames)==null?void 0:Pe.loader,"sonner-loader"),"data-visible":Nt==="loading"},Y.loading)}return le.createElement(z1,{className:jn(j?.loader,g==null||(be=g.classNames)==null?void 0:be.loader),visible:Nt==="loading"})}const zl=g.icon||Y?.[Nt]||j1(Nt);var nl,An;return le.createElement("li",{tabIndex:0,ref:Kt,className:jn(me,jt,j?.toast,g==null||(o=g.classNames)==null?void 0:o.toast,j?.default,j?.[Nt],g==null||(r=g.classNames)==null?void 0:r[Nt]),"data-sonner-toast":"","data-rich-colors":(nl=g.richColors)!=null?nl:I,"data-styled":!(g.jsx||g.unstyled||E),"data-mounted":Z,"data-promise":!!g.promise,"data-swiped":Ce,"data-removed":ee,"data-visible":Uo,"data-y-position":tl,"data-x-position":Dt,"data-index":S,"data-front":Mo,"data-swiping":ye,"data-dismissible":ga,"data-type":Nt,"data-invert":Ps,"data-swipe-out":re,"data-swipe-direction":R,"data-expanded":!!(z||he&&Z),"data-testid":g.testId,style:{"--index":S,"--toasts-before":S,"--z-index":D.length-S,"--offset":`${ee?He:qn.current}px`,"--initial-height":he?"auto":`${dt}px`,...K,...g.style},onDragEnd:()=>{ne(!1),P(null),va.current=null},onPointerDown:be=>{be.button!==2&&(Lo||!ga||(Bn.current=new Date,Ze(qn.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(ne(!0),va.current={x:be.clientX,y:be.clientY})))},onPointerUp:()=>{var be,Pe,mt;if(re||!ga)return;va.current=null;const At=Number(((be=Kt.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ya=Number(((Pe=Kt.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Fe=new Date().getTime()-((mt=Bn.current)==null?void 0:mt.getTime()),Ut=oe==="x"?At:ya,al=Math.abs(Ut)/Fe;if(Math.abs(Ut)>=I1||al>.11){Ze(qn.current),g.onDismiss==null||g.onDismiss.call(g,g),V(oe==="x"?At>0?"right":"left":ya>0?"down":"up"),Tn(),Le(!0);return}else{var kt,Lt;(kt=Kt.current)==null||kt.style.setProperty("--swipe-amount-x","0px"),(Lt=Kt.current)==null||Lt.style.setProperty("--swipe-amount-y","0px")}Te(!1),ne(!1),P(null)},onPointerMove:be=>{var Pe,mt,At;if(!va.current||!ga||((Pe=window.getSelection())==null?void 0:Pe.toString().length)>0)return;const Fe=be.clientY-va.current.y,Ut=be.clientX-va.current.x;var al;const kt=(al=l.swipeDirections)!=null?al:W1(te);!oe&&(Math.abs(Ut)>1||Math.abs(Fe)>1)&&P(Math.abs(Ut)>Math.abs(Fe)?"x":"y");let Lt={x:0,y:0};const Ml=vn=>1/(1.5+Math.abs(vn)/20);if(oe==="y"){if(kt.includes("top")||kt.includes("bottom"))if(kt.includes("top")&&Fe<0||kt.includes("bottom")&&Fe>0)Lt.y=Fe;else{const vn=Fe*Ml(Fe);Lt.y=Math.abs(vn)0)Lt.x=Ut;else{const vn=Ut*Ml(Ut);Lt.x=Math.abs(vn)0||Math.abs(Lt.y)>0)&&Te(!0),(mt=Kt.current)==null||mt.style.setProperty("--swipe-amount-x",`${Lt.x}px`),(At=Kt.current)==null||At.style.setProperty("--swipe-amount-y",`${Lt.y}px`)}},Zi&&!g.jsx&&Nt!=="loading"?le.createElement("button",{"aria-label":F,"data-disabled":Lo,"data-close-button":!0,onClick:Lo||!ga?()=>{}:()=>{Tn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:jn(j?.closeButton,g==null||(i=g.classNames)==null?void 0:i.closeButton)},(An=Y?.close)!=null?An:H1):null,(Nt||g.icon||g.promise)&&g.icon!==null&&(Y?.[Nt]!==null||g.icon)?le.createElement("div",{"data-icon":"",className:jn(j?.icon,g==null||(u=g.classNames)==null?void 0:u.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Dl():null,g.type!=="loading"?zl:null):null,le.createElement("div",{"data-content":"",className:jn(j?.content,g==null||(f=g.classNames)==null?void 0:f.content)},le.createElement("div",{"data-title":"",className:jn(j?.title,g==null||(m=g.classNames)==null?void 0:m.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?le.createElement("div",{"data-description":"",className:jn(ge,$s,j?.description,g==null||(v=g.classNames)==null?void 0:v.description)},typeof g.description=="function"?g.description():g.description):null),le.isValidElement(g.cancel)?g.cancel:g.cancel&&is(g.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||G,onClick:be=>{is(g.cancel)&&ga&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,be),Tn())},className:jn(j?.cancelButton,g==null||(y=g.classNames)==null?void 0:y.cancelButton)},g.cancel.label):null,le.isValidElement(g.action)?g.action:g.action&&is(g.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||ae,onClick:be=>{is(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,be),!be.defaultPrevented&&Tn())},className:jn(j?.actionButton,g==null||(p=g.classNames)==null?void 0:p.actionButton)},g.action.label):null)};function Rg(){if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?window.getComputedStyle(document.documentElement).direction:l}function tS(l,o){const r={};return[l,o].forEach((i,u)=>{const f=u===1,m=f?"--mobile-offset":"--offset",v=f?$1:K1;function y(p){["top","right","bottom","left"].forEach(w=>{r[`${m}-${w}`]=typeof p=="number"?`${p}px`:p})}typeof i=="number"||typeof i=="string"?y(i):typeof i=="object"?["top","right","bottom","left"].forEach(p=>{i[p]===void 0?r[`${m}-${p}`]=v:r[`${m}-${p}`]=typeof i[p]=="number"?`${i[p]}px`:i[p]}):y(v)}),r}const nS=le.forwardRef(function(o,r){const{id:i,invert:u,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:v,closeButton:y,className:p,offset:w,mobileOffset:g,theme:E="light",richColors:O,duration:A,style:C,visibleToasts:T=Z1,toastOptions:S,dir:D=Rg(),gap:z=J1,icons:k,containerAriaLabel:I="Notifications"}=o,[X,K]=le.useState([]),G=le.useMemo(()=>i?X.filter(Z=>Z.toasterId===i):X.filter(Z=>!Z.toasterId),[X,i]),ae=le.useMemo(()=>Array.from(new Set([f].concat(G.filter(Z=>Z.position).map(Z=>Z.position)))),[G,f]),[me,ge]=le.useState([]),[U,te]=le.useState(!1),[fe,he]=le.useState(!1),[j,Y]=le.useState(E!=="system"?E:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=le.useRef(null),oe=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=le.useRef(null),R=le.useRef(!1),V=le.useCallback(Z=>{K(W=>{var ee;return(ee=W.find(ie=>ie.id===Z.id))!=null&&ee.delete||Qt.dismiss(Z.id),W.filter(({id:ie})=>ie!==Z.id)})},[]);return le.useEffect(()=>Qt.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{K(W=>W.map(ee=>ee.id===Z.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{R1.flushSync(()=>{K(W=>{const ee=W.findIndex(ie=>ie.id===Z.id);return ee!==-1?[...W.slice(0,ee),{...W[ee],...Z},...W.slice(ee+1)]:[Z,...W]})})})}),[X]),le.useEffect(()=>{if(E!=="system"){Y(E);return}if(E==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:W})=>{Y(W?"dark":"light")})}catch{Z.addListener(({matches:ee})=>{try{Y(ee?"dark":"light")}catch(ie){console.error(ie)}})}},[E]),le.useEffect(()=>{X.length<=1&&te(!1)},[X]),le.useEffect(()=>{const Z=W=>{var ee;if(m.every(ne=>W[ne]||W.code===ne)){var ye;te(!0),(ye=F.current)==null||ye.focus()}W.code==="Escape"&&(document.activeElement===F.current||(ee=F.current)!=null&&ee.contains(document.activeElement))&&te(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[m]),le.useEffect(()=>{if(F.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,R.current=!1)}},[F.current]),le.createElement("section",{ref:r,"aria-label":`${I} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ae.map((Z,W)=>{var ee;const[ie,ye]=Z.split("-");return G.length?le.createElement("ol",{key:Z,dir:D==="auto"?Rg():D,tabIndex:-1,ref:F,className:p,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":ie,"data-x-position":ye,style:{"--front-toast-height":`${((ee=me[0])==null?void 0:ee.height)||0}px`,"--width":`${P1}px`,"--gap":`${z}px`,...C,...tS(w,g)},onBlur:ne=>{R.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(R.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||R.current||(R.current=!0,P.current=ne.relatedTarget)},onMouseEnter:()=>te(!0),onMouseMove:()=>te(!0),onMouseLeave:()=>{fe||te(!1)},onDragEnd:()=>te(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||he(!0)},onPointerUp:()=>he(!1)},G.filter(ne=>!ne.position&&W===0||ne.position===Z).map((ne,re)=>{var Le,Ce;return le.createElement(eS,{key:ne.id,icons:k,index:re,toast:ne,defaultRichColors:O,duration:(Le=S?.duration)!=null?Le:A,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:u,visibleToasts:T,closeButton:(Ce=S?.closeButton)!=null?Ce:y,interacting:fe,position:Z,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:V,toasts:G.filter(Te=>Te.position==ne.position),heights:me.filter(Te=>Te.position==ne.position),setHeights:ge,expandByDefault:v,gap:z,expanded:U,swipeDirections:o.swipeDirections})})):null}))}),aS=({...l})=>{const[o,r]=b.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light");return b.useEffect(()=>{const i=()=>r(document.documentElement.classList.contains("dark")?"dark":"light");i();const u=new MutationObserver(i);return u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>u.disconnect()},[]),h.jsx(nS,{theme:o,className:"toaster group",icons:{success:h.jsx(r1,{className:"size-4"}),info:h.jsx(f1,{className:"size-4"}),warning:h.jsx(A1,{className:"size-4"}),error:h.jsx(v1,{className:"size-4"}),loading:h.jsx(m1,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...l})},_v=["open","triaged","in_progress","fixed","verified","wontfix"],lS=["p0","p1","p2","p3"],oS=["ui","backend","usage","ux"];async function Ri(l){if(!l.ok){const o=await l.json().catch(()=>({}));throw new Error(o.error??`${l.status} ${l.statusText}`)}return await l.json()}async function Ng(l,o){if(l.ok)return l;const r=await l.text().catch(()=>"");let i="";try{i=JSON.parse(r).error??""}catch{i=r.slice(0,200).trim()}throw new Error(i?`${o}: ${i}`:`${o} (${l.status} ${l.statusText})`)}const Qa={list(l,o=200){const r=new URLSearchParams({limit:String(o),view:"list"});for(const[i,u]of Object.entries(l))u&&r.set(i,u);return fetch(`/feedback?${r}`).then(Ri)},get(l){return fetch(`/feedback/${encodeURIComponent(l)}`).then(Ri)},update(l,o){return fetch(`/feedback/${encodeURIComponent(l)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(r=>Ri(r))},comment(l,o,r){return fetch(`/queue/${encodeURIComponent(l)}/comment`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({body:o,author:r})}).then(i=>Ng(i,"Comment failed"))},setStatus(l,o,r,i){return fetch(`/queue/${encodeURIComponent(l)}/status`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({status:o,note:r,author:i})}).then(u=>Ng(u,"Status change failed"))},attach(l,o,r){const i=new URLSearchParams({name:o.name,intent:r.intent});return r.target&&i.set("target",r.target),r.author&&i.set("author",r.author),fetch(`/feedback/${encodeURIComponent(l)}/attachments?${i}`,{method:"POST",headers:{"Content-Type":o.type||"application/octet-stream"},body:o}).then(u=>Ri(u))},detach(l,o,r){const i=new URLSearchParams({author:r});return fetch(`/feedback/${encodeURIComponent(l)}/attachments/${encodeURIComponent(o)}?${i}`,{method:"DELETE"}).then(Ri)}},iS=l=>l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(1)} KB`:`${(l/1048576).toFixed(1)} MB`,Es={open:"bg-lb-open text-lb-open-foreground",triaged:"bg-lb-triaged text-lb-triaged-foreground",in_progress:"bg-lb-in-progress text-lb-in-progress-foreground",fixed:"bg-lb-fixed text-lb-fixed-foreground",verified:"bg-lb-verified text-lb-verified-foreground",wontfix:"bg-lb-wontfix text-lb-wontfix-foreground"},Rf={p0:"text-lb-p0",p1:"text-lb-p1",p2:"text-lb-p2",p3:"text-lb-p3"},Nf={p0:"font-bold",p1:"font-semibold",p2:"font-medium",p3:"font-normal"};function Za(l){if(!l)return null;try{const o=new URL(l,window.location.origin);return o.protocol==="http:"||o.protocol==="https:"?o.href:null}catch{return null}}function Ov(l){var o,r,i="";if(typeof l=="string"||typeof l=="number")i+=l;else if(typeof l=="object")if(Array.isArray(l)){var u=l.length;for(o=0;otypeof l=="boolean"?`${l}`:l===0?"0":l,Dg=Rv,Vi=(l,o)=>r=>{var i;if(o?.variants==null)return Dg(l,r?.class,r?.className);const{variants:u,defaultVariants:f}=o,m=Object.keys(u).map(p=>{const w=r?.[p],g=f?.[p];if(w===null)return null;const E=jg(w)||jg(g);return u[p][E]}),v=r&&Object.entries(r).reduce((p,w)=>{let[g,E]=w;return E===void 0||(p[g]=E),p},{}),y=o==null||(i=o.compoundVariants)===null||i===void 0?void 0:i.reduce((p,w)=>{let{class:g,className:E,...O}=w;return Object.entries(O).every(A=>{let[C,T]=A;return Array.isArray(T)?T.includes({...f,...v}[C]):{...f,...v}[C]===T})?[...p,g,E]:p},[]);return Dg(l,m,y,r?.class,r?.className)};var rS=Object.defineProperty,ed=(l,o)=>rS(l,"name",{value:o,configurable:!0});function jf(l,o){if(typeof l=="function")return l(o);l!=null&&(l.current=o)}ed(jf,"setRef");function Nv(...l){return o=>{let r=!1;const i=l.map(u=>{const f=jf(u,o);return!r&&typeof f=="function"&&(r=!0),f});if(r)return()=>{for(let u=0;usS(l,"name",{value:o,configurable:!0});function ua(l){const o=b.forwardRef((r,i)=>{let{children:u,...f}=r,m=null,v=!1;const y=[];Df(u)&&typeof rs=="function"&&(u=rs(u._payload)),b.Children.forEach(u,E=>{if(kv(E)){v=!0;const O=E;let A="child"in O.props?O.props.child:O.props.children;Df(A)&&typeof rs=="function"&&(A=rs(A._payload)),m=cS(O,A),y.push(m?.props?.children)}else y.push(E)}),m?m=b.cloneElement(m,void 0,y):!v&&b.Children.count(u)===1&&b.isValidElement(u)&&(m=u);const p=m?Uv(m):void 0,w=Xe(i,p);if(!m){if(u||u===0)throw new Error(v?dS(l):fS(l));return u}const g=Mv(f,m.props??{});return m.type!==b.Fragment&&(g.ref=i?w:p),b.cloneElement(m,g)});return o.displayName=`${l}.Slot`,o}wn(ua,"createSlot");var jv=ua("Slot"),Dv=Symbol.for("radix.slottable");function zv(l){const o=wn(r=>"child"in r?r.children(r.child):r.children,"Slottable");return o.displayName=`${l}.Slottable`,o.__radixId=Dv,o}wn(zv,"createSlottable");var cS=wn((l,o)=>{if("child"in l.props){const r=l.props.child;return b.isValidElement(r)?b.cloneElement(r,void 0,l.props.children(r.props.children)):null}return b.isValidElement(o)?o:null},"getSlottableElementFromSlottable");function Mv(l,o){const r={...o};for(const i in o){const u=l[i],f=o[i];/^on[A-Z]/.test(i)?u&&f?r[i]=(...v)=>{const y=f(...v);return u(...v),y}:u&&(r[i]=u):i==="style"?r[i]={...u,...f}:i==="className"&&(r[i]=[u,f].filter(Boolean).join(" "))}return{...l,...r}}wn(Mv,"mergeProps");function Uv(l){let o=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,r=o&&"isReactWarning"in o&&o.isReactWarning;return r?l.ref:(o=Object.getOwnPropertyDescriptor(l,"ref")?.get,r=o&&"isReactWarning"in o&&o.isReactWarning,r?l.props.ref:l.props.ref||l.ref)}wn(Uv,"getElementRef");function kv(l){return b.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Dv}wn(kv,"isSlottable");var uS=Symbol.for("react.lazy");function Df(l){return l!=null&&typeof l=="object"&&"$$typeof"in l&&l.$$typeof===uS&&"_payload"in l&&Lv(l._payload)}wn(Df,"isLazyComponent");function Lv(l){return typeof l=="object"&&l!==null&&"then"in l}wn(Lv,"isPromiseLike");var fS=wn(l=>`${l} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),dS=wn(l=>`${l} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),rs=Yi[" use ".trim().toString()],mS=Object.defineProperty,hS=(l,o)=>mS(l,"name",{value:o,configurable:!0}),pS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=pS.reduce((l,o)=>{const r=ua(`Primitive.${o}`),i=b.forwardRef((u,f)=>{const{asChild:m,...v}=u,y=m?r:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(y,{...v,ref:f})});return i.displayName=`Primitive.${o}`,{...l,[o]:i}},{});function Hv(l,o){l&&Ro.flushSync(()=>l.dispatchEvent(o))}hS(Hv,"dispatchDiscreteCustomEvent");var gS=Object.defineProperty,vS=(l,o)=>gS(l,"name",{value:o,configurable:!0}),Bv=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"}),yS=b.forwardRef(vS(function(o,r){return h.jsx(Ie.span,{...o,ref:r,style:{...Bv,...o.style}})},"VisuallyHidden")),bS=yS,xS=Object.defineProperty,hn=(l,o)=>xS(l,"name",{value:o,configurable:!0});function SS(l,o){const r=b.createContext(o);r.displayName=l+"Context";const i=hn(f=>{const{children:m,...v}=f,y=b.useMemo(()=>v,Object.values(v));return h.jsx(r.Provider,{value:y,children:m})},"Provider");i.displayName=l+"Provider";function u(f,m={}){const{optional:v=!1}=m,y=b.useContext(r);if(y)return y;if(o!==void 0)return o;if(!v)throw new Error(`\`${f}\` must be used within \`${l}\``)}return hn(u,"useContext"),[i,u]}hn(SS,"createContext");function Pa(l,o=[]){let r=[];function i(f,m){const v=b.createContext(m);v.displayName=f+"Context";const y=r.length;r=[...r,m];const p=hn(g=>{const{scope:E,children:O,...A}=g,C=E?.[l]?.[y]||v,T=b.useMemo(()=>A,Object.values(A));return h.jsx(C.Provider,{value:T,children:O})},"Provider");p.displayName=f+"Provider";function w(g,E,O={}){const{optional:A=!1}=O,C=E?.[l]?.[y]||v,T=b.useContext(C);if(T)return T;if(m!==void 0)return m;if(!A)throw new Error(`\`${g}\` must be used within \`${f}\``)}return hn(w,"useContext"),[p,w]}hn(i,"createContext");const u=hn(()=>{const f=r.map(m=>b.createContext(m));return hn(function(v){const y=v?.[l]||f;return b.useMemo(()=>({[`__scope${l}`]:{...v,[l]:y}}),[v,y])},"useScope")},"createScope");return u.scopeName=l,[i,qv(u,...o)]}hn(Pa,"createContextScope");function qv(...l){const o=l[0];if(l.length===1)return o;const r=hn(()=>{const i=l.map(u=>({useScope:u(),scopeName:u.scopeName}));return hn(function(f){const m=i.reduce((v,{useScope:y,scopeName:p})=>{const g=y(f)[`__scope${p}`];return{...v,...g}},{});return b.useMemo(()=>({[`__scope${o.scopeName}`]:m}),[m])},"useComposedScopes")},"createScope");return r.scopeName=o.scopeName,r}hn(qv,"composeContextScopes");var wS=Object.defineProperty,yt=(l,o)=>wS(l,"name",{value:o,configurable:!0});function Yv(l){const o=l+"CollectionProvider",[r,i]=Pa(o),[u,f]=r(o,{collectionRef:{current:null},itemMap:new Map}),m=yt(C=>{const{scope:T,children:S}=C,D=b.useRef(null),z=b.useRef(new Map).current;return h.jsx(u,{scope:T,itemMap:z,collectionRef:D,children:S})},"CollectionProvider");m.displayName=o;const v=l+"CollectionSlot",y=ua(v),p=b.forwardRef((C,T)=>{const{scope:S,children:D}=C,z=f(v,S),k=Xe(T,z.collectionRef);return h.jsx(y,{ref:k,children:D})});p.displayName=v;const w=l+"CollectionItemSlot",g="data-radix-collection-item",E=ua(w),O=b.forwardRef((C,T)=>{const{scope:S,children:D,...z}=C,k=b.useRef(null),I=Xe(T,k),X=f(w,S);return b.useEffect(()=>(X.itemMap.set(k,{ref:k,...z}),()=>{X.itemMap.delete(k)})),h.jsx(E,{[g]:"",ref:I,children:D})});O.displayName=w;function A(C){const T=f(l+"CollectionConsumer",C);return b.useCallback(()=>{const D=T.collectionRef.current;if(!D)return[];const z=Array.from(D.querySelectorAll(`[${g}]`));return Array.from(T.itemMap.values()).sort((X,K)=>z.indexOf(X.ref.current)-z.indexOf(K.ref.current))},[T.collectionRef,T.itemMap])}return yt(A,"useCollection"),[{Provider:m,Slot:p,ItemSlot:O},A,i]}yt(Yv,"createCollection");var zg=new WeakMap,st,tn,pf=(tn=class extends Map{constructor(r){super(r);gg(this,st);rf(this,st,[...super.keys()]),zg.set(this,!0)}set(r,i){return zg.get(this)&&(this.has(r)?_t(this,st)[_t(this,st).indexOf(r)]=r:_t(this,st).push(r)),super.set(r,i),this}insert(r,i,u){const f=this.has(i),m=_t(this,st).length,v=td(r);let y=v>=0?v:m+v;const p=y<0||y>=m?-1:y;if(p===this.size||f&&p===this.size-1||p===-1)return this.set(i,u),this;const w=this.size+(f?0:1);v<0&&y++;const g=[..._t(this,st)];let E,O=!1;for(let A=y;A=this.size&&(f=this.size-1),this.at(f)}keyFrom(r,i){const u=this.indexOf(r);if(u===-1)return;let f=u+i;return f<0&&(f=0),f>=this.size&&(f=this.size-1),this.keyAt(f)}find(r,i){let u=0;for(const f of this){if(Reflect.apply(r,i,[f,u,this]))return f;u++}}findIndex(r,i){let u=0;for(const f of this){if(Reflect.apply(r,i,[f,u,this]))return u;u++}return-1}filter(r,i){const u=[];let f=0;for(const m of this)Reflect.apply(r,i,[m,f,this])&&u.push(m),f++;return new tn(u)}map(r,i){const u=[];let f=0;for(const m of this)u.push([m[0],Reflect.apply(r,i,[m,f,this])]),f++;return new tn(u)}reduce(...r){const[i,u]=r;let f=0,m=u??this.at(0);for(const v of this)f===0&&r.length===1?m=v:m=Reflect.apply(i,this,[m,v,f,this]),f++;return m}reduceRight(...r){const[i,u]=r;let f=u??this.at(-1);for(let m=this.size-1;m>=0;m--){const v=this.at(m);m===this.size-1&&r.length===1?f=v:f=Reflect.apply(i,this,[f,v,m,this])}return f}toSorted(r){const i=[...this.entries()].sort(r);return new tn(i)}toReversed(){const r=new tn;for(let i=this.size-1;i>=0;i--){const u=this.keyAt(i),f=this.get(u);r.set(u,f)}return r}toSpliced(...r){const i=[...this.entries()];return i.splice(...r),new tn(i)}slice(r,i){const u=new tn;let f=this.size-1;if(r===void 0)return u;r<0&&(r=r+this.size),i!==void 0&&i>0&&(f=i-1);for(let m=r;m<=f;m++){const v=this.keyAt(m),y=this.get(v);u.set(v,y)}return u}every(r,i){let u=0;for(const f of this){if(!Reflect.apply(r,i,[f,u,this]))return!1;u++}return!0}some(r,i){let u=0;for(const f of this){if(Reflect.apply(r,i,[f,u,this]))return!0;u++}return!1}},st=new WeakMap,yt(tn,"OrderedDict"),tn);function Cs(l,o){if("at"in Array.prototype)return Array.prototype.at.call(l,o);const r=Vv(l,o);return r===-1?void 0:l[r]}yt(Cs,"at");function Vv(l,o){const r=l.length,i=td(o),u=i>=0?i:r+i;return u<0||u>=r?-1:u}yt(Vv,"toSafeIndex");function td(l){return l!==l||l===0?0:Math.trunc(l)}yt(td,"toSafeInteger");function ES(l){const o=l+"CollectionProvider",[r,i]=Pa(o),[u,f]=r(o,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new pf,setItemMap:yt(()=>{},"setItemMap")}),m=yt(({state:z,...k})=>z?h.jsx(y,{...k,state:z}):h.jsx(v,{...k}),"CollectionProvider");m.displayName=o;const v=yt(z=>{const k=T();return h.jsx(y,{...z,state:k})},"CollectionInit");v.displayName=o+"Init";const y=yt(z=>{const{scope:k,children:I,state:X}=z,K=b.useRef(null),[G,ae]=b.useState(null),me=Xe(K,ae),[ge,U]=X;return b.useEffect(()=>{if(!G)return;const te=Qv(()=>{});return te.observe(G,{childList:!0,subtree:!0}),()=>{te.disconnect()}},[G]),h.jsx(u,{scope:k,itemMap:ge,setItemMap:U,collectionRef:me,collectionRefObject:K,collectionElement:G,children:I})},"CollectionProviderImpl");y.displayName=o+"Impl";const p=l+"CollectionSlot",w=ua(p),g=b.forwardRef((z,k)=>{const{scope:I,children:X}=z,K=f(p,I),G=Xe(k,K.collectionRef);return h.jsx(w,{ref:G,children:X})});g.displayName=p;const E=l+"CollectionItemSlot",O="data-radix-collection-item",A=ua(E),C=b.forwardRef((z,k)=>{const{scope:I,children:X,...K}=z,G=b.useRef(null),[ae,me]=b.useState(null),ge=Xe(k,G,me),U=f(E,I),{setItemMap:te}=U,fe=b.useRef(K);Gv(fe.current,K)||(fe.current=K);const he=fe.current;return b.useEffect(()=>{const j=he;return te(Y=>ae?Y.has(ae)?Y.set(ae,{...j,element:ae}).toSorted(zf):(Y.set(ae,{...j,element:ae}),Y.toSorted(zf)):Y),()=>{te(Y=>!ae||!Y.has(ae)?Y:(Y.delete(ae),new pf(Y)))}},[ae,he,te]),h.jsx(A,{[O]:"",ref:ge,children:X})});C.displayName=E;function T(){return b.useState(new pf)}yt(T,"useInitCollection");function S(z){const{itemMap:k}=f(l+"CollectionConsumer",z);return k}return yt(S,"useCollection"),[{Provider:m,Slot:g,ItemSlot:C},{createCollectionScope:i,useCollection:S,useInitCollection:T}]}yt(ES,"createCollection");function Gv(l,o){if(l===o)return!0;if(typeof l!="object"||typeof o!="object"||l==null||o==null)return!1;const r=Object.keys(l),i=Object.keys(o);if(r.length!==i.length)return!1;for(const u of r)if(!Object.prototype.hasOwnProperty.call(o,u)||l[u]!==o[u])return!1;return!0}yt(Gv,"shallowEqual");function Xv(l,o){return!!(o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_PRECEDING)}yt(Xv,"isElementPreceding");function zf(l,o){return!l[1].element||!o[1].element?0:Xv(l[1].element,o[1].element)?-1:1}yt(zf,"sortByDocumentPosition");function Qv(l){return new MutationObserver(r=>{for(const i of r)if(i.type==="childList"){l();return}})}yt(Qv,"getChildListObserver");var CS=Object.defineProperty,No=(l,o)=>CS(l,"name",{value:o,configurable:!0}),Zv=!!(typeof window<"u"&&window.document&&window.document.createElement);function De(l,o,{checkForDefaultPrevented:r=!0}={}){return No(function(u){if(l?.(u),r===!1||!u||!u.defaultPrevented)return o?.(u)},"handleEvent")}No(De,"composeEventHandlers");function TS(l){if(!Zv)throw new Error("Cannot access window outside of the DOM");return l?.ownerDocument?.defaultView??window}No(TS,"getOwnerWindow");function Mf(l){if(!Zv)throw new Error("Cannot access document outside of the DOM");return l?.ownerDocument??document}No(Mf,"getOwnerDocument");function Kv(l,o=!1){const{activeElement:r}=Mf(l);if(!r?.nodeName)return null;if($v(r)&&r.contentDocument)return Kv(r.contentDocument.body,o);if(o){const i=r.getAttribute("aria-activedescendant");if(i){const u=Mf(r).getElementById(i);if(u)return u}}return r}No(Kv,"getActiveElement");function $v(l){return l.tagName==="IFRAME"}No($v,"isFrame");var at=globalThis?.document?b.useLayoutEffect:()=>{},AS=Object.defineProperty,_S=(l,o)=>AS(l,"name",{value:o,configurable:!0}),Mg=Yi[" useEffectEvent ".trim().toString()],Ug=Yi[" useInsertionEffect ".trim().toString()];function Pv(l){if(typeof Mg=="function")return Mg(l);const o=b.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ug=="function"?Ug(()=>{o.current=l}):at(()=>{o.current=l}),b.useMemo(()=>((...r)=>o.current?.(...r)),[])}_S(Pv,"useEffectEvent");var OS=Object.defineProperty,Gi=(l,o)=>OS(l,"name",{value:o,configurable:!0}),RS=Yi[" useInsertionEffect ".trim().toString()]||at;function ki({prop:l,defaultProp:o,onChange:r=Gi(()=>{},"onChange"),caller:i}){const[u,f,m]=Jv({defaultProp:o,onChange:r}),v=l!==void 0,y=v?l:u,p=b.useCallback(w=>{if(v){const g=Iv(w)?w(l):w;g!==l&&m.current?.(g)}else f(w)},[v,l,f,m]);return[y,p]}Gi(ki,"useControllableState");function Jv({defaultProp:l,onChange:o}){const[r,i]=b.useState(l),u=b.useRef(r),f=b.useRef(o);return RS(()=>{f.current=o},[o]),b.useEffect(()=>{u.current!==r&&(f.current?.(r),u.current=r)},[r,u]),[r,i,f]}Gi(Jv,"useUncontrolledState");function Iv(l){return typeof l=="function"}Gi(Iv,"isFunction");var kg=Symbol("RADIX:SYNC_STATE");function NS(l,o,r,i){const{prop:u,defaultProp:f,onChange:m,caller:v}=o,y=u!==void 0,p=Pv(m),w=[{...r,state:f}];i&&w.push(i);const[g,E]=b.useReducer((T,S)=>{if(S.type===kg)return{...T,state:S.state};const D=l(T,S);return y&&!Object.is(D.state,T.state)&&p(D.state),D},...w),O=g.state,A=b.useRef(O);b.useEffect(()=>{A.current!==O&&(A.current=O,y||p(O))},[O,A,y]);const C=b.useMemo(()=>u!==void 0?{...g,state:u}:g,[g,u]);return b.useEffect(()=>{y&&!Object.is(u,g.state)&&E({type:kg,state:u})},[u,g.state,y]),[C,E]}Gi(NS,"useControllableStateReducer");var jS=Object.defineProperty,fa=(l,o)=>jS(l,"name",{value:o,configurable:!0});function Fv(l,o){return b.useReducer((r,i)=>o[r][i]??r,l)}fa(Fv,"useStateMachine");var jo=fa(l=>{const{present:o,children:r}=l,i=Wv(o),u=typeof r=="function"?r({present:i.isPresent}):b.Children.only(r),f=ey(i.ref,ty(u));return typeof r=="function"||i.isPresent?b.cloneElement(u,{ref:f}):null},"Presence");function Wv(l){const[o,r]=b.useState(),i=b.useRef(null),u=b.useRef(l),f=b.useRef("none"),m=b.useRef(void 0),v=l?"mounted":"unmounted",[y,p]=Fv(v,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{y==="mounted"?(f.current=m.current??Co(i.current),m.current=void 0):f.current="none"},[y]),at(()=>{const w=i.current,g=u.current;if(g!==l){const O=f.current,A=Co(w);l?(m.current=A,p("MOUNT")):A==="none"||w?.display==="none"?p("UNMOUNT"):p(g&&O!==A?"ANIMATION_OUT":"UNMOUNT"),u.current=l}},[l,p]),at(()=>{if(o){let w;const g=o.ownerDocument.defaultView??window,E=fa(A=>{const T=Co(i.current).includes(CSS.escape(A.animationName));if(A.target===o&&T&&(p("ANIMATION_END"),!u.current)){const S=o.style.animationFillMode;o.style.animationFillMode="forwards",w=g.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=S)})}},"handleAnimationEnd"),O=fa(A=>{A.target===o&&(f.current=Co(i.current))},"handleAnimationStart");return o.addEventListener("animationstart",O),o.addEventListener("animationcancel",E),o.addEventListener("animationend",E),()=>{g.clearTimeout(w),o.removeEventListener("animationstart",O),o.removeEventListener("animationcancel",E),o.removeEventListener("animationend",E)}}else p("ANIMATION_END")},[o,p]),{isPresent:["mounted","unmountSuspended"].includes(y),ref:b.useCallback(w=>{if(w){const g=getComputedStyle(w);i.current=g,m.current=Co(g)}else i.current=null;r(w)},[])}}fa(Wv,"usePresence");function Uf(l,o){if(typeof l=="function")return l(o);l!=null&&(l.current=o)}fa(Uf,"setRef");function ey(...l){const o=b.useRef(l);return o.current=l,b.useCallback(r=>{const i=o.current;let u=!1;const f=i.map(m=>{const v=Uf(m,r);return!u&&typeof v=="function"&&(u=!0),v});if(u)return()=>{for(let m=0;mDS(l,"name",{value:o,configurable:!0}),MS=Yi[" useId ".trim().toString()]||(()=>{}),US=0;function Tl(l){const[o,r]=b.useState(MS());return at(()=>{l||r(i=>i??String(US++))},[l]),l||(o?`radix-${o}`:"")}zS(Tl,"useId");var kS=Object.defineProperty,LS=(l,o)=>kS(l,"name",{value:o,configurable:!0}),HS=b.createContext(void 0);function ny(l){const o=b.useContext(HS);return l||o||"ltr"}LS(ny,"useDirection");var BS=Object.defineProperty,qS=(l,o)=>BS(l,"name",{value:o,configurable:!0});function kn(l){const o=b.useRef(l);return b.useEffect(()=>{o.current=l}),b.useMemo(()=>((...r)=>o.current?.(...r)),[])}qS(kn,"useCallbackRef");var YS=Object.defineProperty,vt=(l,o)=>YS(l,"name",{value:o,configurable:!0}),kf="dismissableLayer.update",VS="dismissableLayer.pointerDownOutside",GS="dismissableLayer.focusOutside",Lg,ay=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nd=b.forwardRef(vt(function(o,r){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:u=!1,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:v,onInteractOutside:y,onDismiss:p,...w}=o,g=b.useContext(ay),[E,O]=b.useState(null),A=E?.ownerDocument??globalThis?.document,[,C]=b.useState({}),T=Xe(r,O),S=Array.from(g.layers),[D]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),z=D?S.indexOf(D):-1,k=E?S.indexOf(E):-1,I=g.layersWithOutsidePointerEventsDisabled.size>0,X=k>=z,K=b.useRef(!1),G=oy(U=>{m?.(U),y?.(U),U.defaultPrevented||p?.()},{ownerDocument:A,deferPointerDownOutside:u,isDeferredPointerDownOutsideRef:K,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:b.useCallback(U=>{if(!(U instanceof Node))return!1;const te=[...g.branches].some(fe=>fe.contains(U));return X&&!te},[g.branches,X])}),ae=iy(U=>{if(u&&K.current)return;const te=U.target;[...g.branches].some(he=>he.contains(te))||(v?.(U),y?.(U),U.defaultPrevented||p?.())},A),me=E?k===S.length-1:!1,ge=kn(U=>{U.key==="Escape"&&(f?.(U),!U.defaultPrevented&&p&&(U.preventDefault(),p()))});return b.useEffect(()=>{if(me)return A.addEventListener("keydown",ge,{capture:!0}),()=>A.removeEventListener("keydown",ge,{capture:!0})},[A,me,ge]),b.useEffect(()=>{if(E)return i&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Lg=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(E)),g.layers.add(E),Lf(),()=>{i&&(g.layersWithOutsidePointerEventsDisabled.delete(E),g.layersWithOutsidePointerEventsDisabled.size===0&&(A.body.style.pointerEvents=Lg))}},[E,A,i,g]),b.useEffect(()=>()=>{E&&(g.layers.delete(E),g.layersWithOutsidePointerEventsDisabled.delete(E),Lf())},[E,g]),b.useEffect(()=>{const U=vt(()=>C({}),"handleUpdate");return document.addEventListener(kf,U),()=>document.removeEventListener(kf,U)},[]),h.jsx(Ie.div,{...w,ref:T,style:{pointerEvents:I?X?"auto":"none":void 0,...o.style},onFocusCapture:De(o.onFocusCapture,ae.onFocusCapture),onBlurCapture:De(o.onBlurCapture,ae.onBlurCapture),onPointerDownCapture:De(o.onPointerDownCapture,G.onPointerDownCapture)})},"DismissableLayer"));function ly(){const l=b.useContext(ay),[o,r]=b.useState(null);return b.useEffect(()=>{if(o)return l.dismissableSurfaces.add(o),()=>{l.dismissableSurfaces.delete(o)}},[o,l.dismissableSurfaces]),r}vt(ly,"useDismissableLayerSurface");var XS=vt(()=>!0,"IS_TRUE");function oy(l,o){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:f,shouldHandlePointerDownOutside:m=XS}=o,v=kn(l),y=b.useRef(!1),p=b.useRef(!1),w=b.useRef(new Map),g=b.useRef(()=>{});return b.useEffect(()=>{function E(){p.current=!1,u.current=!1,w.current.clear()}vt(E,"resetOutsideInteraction");function O(){return Array.from(w.current.values()).some(Boolean)}vt(O,"isOutsideInteractionIntercepted");function A(z){if(!p.current)return;const k=z.target;k instanceof Node&&[...f].some(X=>X.contains(k))||w.current.set(z.type,!0),z.type==="click"&&window.setTimeout(()=>{p.current&&g.current()},0)}vt(A,"handleInteractionCapture");function C(z){p.current&&w.current.set(z.type,!1)}vt(C,"handleInteractionBubble");const T=vt(z=>{if(z.target&&!y.current){let k=function(){r.removeEventListener("click",g.current);const X=O();E(),X||ad(VS,v,I,{discrete:!0})};if(vt(k,"handleAndDispatchPointerDownOutsideEvent"),!m(z.target)){r.removeEventListener("click",g.current),E(),y.current=!1;return}const I={originalEvent:z};p.current=!0,u.current=i&&z.button===0,w.current.clear(),!i||z.button!==0?k():(r.removeEventListener("click",g.current),g.current=k,r.addEventListener("click",g.current,{once:!0}))}else r.removeEventListener("click",g.current),E();y.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const z of S)r.addEventListener(z,A,!0),r.addEventListener(z,C);const D=window.setTimeout(()=>{r.addEventListener("pointerdown",T)},0);return()=>{window.clearTimeout(D),r.removeEventListener("pointerdown",T),r.removeEventListener("click",g.current);for(const z of S)r.removeEventListener(z,A,!0),r.removeEventListener(z,C)}},[r,v,i,u,f,m]),{onPointerDownCapture:vt(()=>y.current=!0,"onPointerDownCapture")}}vt(oy,"usePointerDownOutside");function iy(l,o=globalThis?.document){const r=kn(l),i=b.useRef(!1);return b.useEffect(()=>{const u=vt(f=>{f.target&&!i.current&&ad(GS,r,{originalEvent:f},{discrete:!1})},"handleFocus");return o.addEventListener("focusin",u),()=>o.removeEventListener("focusin",u)},[o,r]),{onFocusCapture:vt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:vt(()=>i.current=!1,"onBlurCapture")}}vt(iy,"useFocusOutside");function Lf(){const l=new CustomEvent(kf);document.dispatchEvent(l)}vt(Lf,"dispatchUpdate");function ad(l,o,r,{discrete:i}){const u=r.originalEvent.target,f=new CustomEvent(l,{bubbles:!1,cancelable:!0,detail:r});o&&u.addEventListener(l,o,{once:!0}),i?Hv(u,f):u.dispatchEvent(f)}vt(ad,"handleAndDispatchCustomEvent");var QS=Object.defineProperty,Mt=(l,o)=>QS(l,"name",{value:o,configurable:!0}),gf="focusScope.autoFocusOnMount",vf="focusScope.autoFocusOnUnmount",Hg={bubbles:!1,cancelable:!0},ry=b.forwardRef(Mt(function(o,r){const{loop:i=!1,trapped:u=!1,onMountAutoFocus:f,onUnmountAutoFocus:m,...v}=o,[y,p]=b.useState(null),w=kn(f),g=kn(m),E=b.useRef(null),O=Xe(r,p),A=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(u){let T=function(k){if(A.paused||!y)return;const I=k.target;y.contains(I)?E.current=I:ia(E.current,{select:!0})},S=function(k){if(A.paused||!y)return;const I=k.relatedTarget;I!==null&&(y.contains(I)||ia(E.current,{select:!0}))},D=function(k){if(document.activeElement===document.body)for(const X of k)X.removedNodes.length>0&&ia(y)};Mt(T,"handleFocusIn"),Mt(S,"handleFocusOut"),Mt(D,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",S);const z=new MutationObserver(D);return y&&z.observe(y,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",S),z.disconnect()}}},[u,y,A.paused]),b.useEffect(()=>{if(y){Bg.add(A);const T=document.activeElement;if(!y.contains(T)){const D=new CustomEvent(gf,Hg);y.addEventListener(gf,w),y.dispatchEvent(D),D.defaultPrevented||(sy(my(ld(y)),{select:!0}),document.activeElement===T&&ia(y))}return()=>{y.removeEventListener(gf,w),setTimeout(()=>{const D=new CustomEvent(vf,Hg);y.addEventListener(vf,g),y.dispatchEvent(D),D.defaultPrevented||ia(T??document.body,{select:!0}),y.removeEventListener(vf,g),Bg.remove(A)},0)}}},[y,w,g,A]);const C=b.useCallback(T=>{if(!i&&!u||A.paused)return;const S=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,D=document.activeElement;if(S&&D){const z=T.currentTarget,[k,I]=cy(z);k&&I?!T.shiftKey&&D===I?(T.preventDefault(),i&&ia(k,{select:!0})):T.shiftKey&&D===k&&(T.preventDefault(),i&&ia(I,{select:!0})):D===z&&T.preventDefault()}},[i,u,A.paused]);return h.jsx(Ie.div,{tabIndex:-1,...v,ref:O,onKeyDown:C})},"FocusScope"));function sy(l,{select:o=!1}={}){const r=document.activeElement;for(const i of l)if(ia(i,{select:o}),document.activeElement!==r)return}Mt(sy,"focusFirst");function cy(l){const o=ld(l),r=Hf(o,l),i=Hf(o.reverse(),l);return[r,i]}Mt(cy,"getTabbableEdges");function ld(l){const o=[],r=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:Mt(i=>{const u=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||u?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)o.push(r.currentNode);return o}Mt(ld,"getTabbableCandidates");function Hf(l,o){const r=typeof o.checkVisibility=="function"&&o.checkVisibility({checkVisibilityCSS:!0});for(const i of l)if(!(r?!i.checkVisibility({checkVisibilityCSS:!0}):uy(i,{upTo:o})))return i}Mt(Hf,"findVisible");function uy(l,{upTo:o}){if(getComputedStyle(l).visibility==="hidden")return!0;for(;l;){if(o!==void 0&&l===o)return!1;if(getComputedStyle(l).display==="none")return!0;l=l.parentElement}return!1}Mt(uy,"isHidden");function fy(l){return l instanceof HTMLInputElement&&"select"in l}Mt(fy,"isSelectableInput");function ia(l,{select:o=!1}={}){if(l&&l.focus){const r=document.activeElement;l.focus({preventScroll:!0}),l!==r&&fy(l)&&o&&l.select()}}Mt(ia,"focus");var Bg=dy();function dy(){let l=[];return{add(o){const r=l[0];o!==r&&r?.pause(),l=Bf(l,o),l.unshift(o)},remove(o){l=Bf(l,o),l[0]?.resume()}}}Mt(dy,"createFocusScopesStack");function Bf(l,o){const r=[...l],i=r.indexOf(o);return i!==-1&&r.splice(i,1),r}Mt(Bf,"arrayRemove");function my(l){return l.filter(o=>o.tagName!=="A")}Mt(my,"removeLinks");var ZS=Object.defineProperty,KS=(l,o)=>ZS(l,"name",{value:o,configurable:!0}),od=b.forwardRef(KS(function(o,r){const{container:i,...u}=o,[f,m]=b.useState(!1);at(()=>m(!0),[]);const v=i||f&&globalThis?.document?.body;return v?Ro.createPortal(h.jsx(Ie.div,{...u,ref:r}),v):null},"Portal")),$S=Object.defineProperty,id=(l,o)=>$S(l,"name",{value:o,configurable:!0}),ss=0,xo=null;function PS(l){return Us(),l.children}id(PS,"FocusGuards");function Us(){b.useEffect(()=>{xo||(xo={start:qf(),end:qf()});const{start:l,end:o}=xo;return document.body.firstElementChild!==l&&document.body.insertAdjacentElement("afterbegin",l),document.body.lastElementChild!==o&&document.body.insertAdjacentElement("beforeend",o),ss++,()=>{ss===1&&(xo?.start.remove(),xo?.end.remove(),xo=null),ss=Math.max(0,ss-1)}},[])}id(Us,"useFocusGuards");function qf(){const l=document.createElement("span");return l.setAttribute("data-radix-focus-guard",""),l.tabIndex=0,l.style.outline="none",l.style.opacity="0",l.style.position="fixed",l.style.pointerEvents="none",l}id(qf,"createFocusGuard");var Mn=function(){return Mn=Object.assign||function(o){for(var r,i=1,u=arguments.length;i"u")return dw;var o=mw(l),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,i-r+o[2]-o[0])}},pw=vy(),Ao="data-scroll-locked",gw=function(l,o,r,i){var u=l.left,f=l.top,m=l.right,v=l.gap;return r===void 0&&(r="margin"),` .`.concat(IS,` { overflow: hidden `).concat(i,`; padding-right: `).concat(v,"px ").concat(i,`; @@ -43,8 +43,8 @@ Error generating stack: `+a.message+` body[`).concat(Ao,`] { `).concat(FS,": ").concat(v,`px; } -`)},Yg=function(){var l=parseInt(document.body.getAttribute(Ao)||"0",10);return isFinite(l)?l:0},vw=function(){b.useEffect(function(){return document.body.setAttribute(Ao,(Yg()+1).toString()),function(){var l=Yg()-1;l<=0?document.body.removeAttribute(Ao):document.body.setAttribute(Ao,l.toString())}},[])},yw=function(l){var o=l.noRelative,r=l.noImportant,i=l.gapMode,u=i===void 0?"margin":i;vw();var f=b.useMemo(function(){return hw(u)},[u]);return b.createElement(pw,{styles:gw(f,!o,u,r?"":"!important")})},qf=!1;if(typeof window<"u")try{var cs=Object.defineProperty({},"passive",{get:function(){return qf=!0,!0}});window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{qf=!1}var So=qf?{passive:!1}:!1,bw=function(l){return l.tagName==="TEXTAREA"},yy=function(l,o){if(!(l instanceof Element))return!1;var r=window.getComputedStyle(l);return r[o]!=="hidden"&&!(r.overflowY===r.overflowX&&!bw(l)&&r[o]==="visible")},xw=function(l){return yy(l,"overflowY")},Sw=function(l){return yy(l,"overflowX")},Vg=function(l,o){var r=o.ownerDocument,i=o;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=by(l,i);if(u){var f=xy(l,i),m=f[1],v=f[2];if(m>v)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},ww=function(l){var o=l.scrollTop,r=l.scrollHeight,i=l.clientHeight;return[o,r,i]},Ew=function(l){var o=l.scrollLeft,r=l.scrollWidth,i=l.clientWidth;return[o,r,i]},by=function(l,o){return l==="v"?xw(o):Sw(o)},xy=function(l,o){return l==="v"?ww(o):Ew(o)},Cw=function(l,o){return l==="h"&&o==="rtl"?-1:1},Tw=function(l,o,r,i,u){var f=Cw(l,window.getComputedStyle(o).direction),m=f*i,v=r.target,y=o.contains(v),p=!1,w=m>0,g=0,E=0;do{if(!v)break;var O=xy(l,v),A=O[0],C=O[1],T=O[2],S=C-T-f*A;(A||S)&&by(l,v)&&(g+=S,E+=A);var D=v.parentNode;v=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!y&&v!==document.body||y&&(o.contains(v)||o===v));return(w&&Math.abs(g)<1||!w&&Math.abs(E)<1)&&(p=!0),p},us=function(l){return"changedTouches"in l?[l.changedTouches[0].clientX,l.changedTouches[0].clientY]:[0,0]},Gg=function(l){return[l.deltaX,l.deltaY]},Xg=function(l){return l&&"current"in l?l.current:l},Aw=function(l,o){return l[0]===o[0]&&l[1]===o[1]},_w=function(l){return` +`)},Yg=function(){var l=parseInt(document.body.getAttribute(Ao)||"0",10);return isFinite(l)?l:0},vw=function(){b.useEffect(function(){return document.body.setAttribute(Ao,(Yg()+1).toString()),function(){var l=Yg()-1;l<=0?document.body.removeAttribute(Ao):document.body.setAttribute(Ao,l.toString())}},[])},yw=function(l){var o=l.noRelative,r=l.noImportant,i=l.gapMode,u=i===void 0?"margin":i;vw();var f=b.useMemo(function(){return hw(u)},[u]);return b.createElement(pw,{styles:gw(f,!o,u,r?"":"!important")})},Yf=!1;if(typeof window<"u")try{var cs=Object.defineProperty({},"passive",{get:function(){return Yf=!0,!0}});window.addEventListener("test",cs,cs),window.removeEventListener("test",cs,cs)}catch{Yf=!1}var So=Yf?{passive:!1}:!1,bw=function(l){return l.tagName==="TEXTAREA"},yy=function(l,o){if(!(l instanceof Element))return!1;var r=window.getComputedStyle(l);return r[o]!=="hidden"&&!(r.overflowY===r.overflowX&&!bw(l)&&r[o]==="visible")},xw=function(l){return yy(l,"overflowY")},Sw=function(l){return yy(l,"overflowX")},Vg=function(l,o){var r=o.ownerDocument,i=o;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=by(l,i);if(u){var f=xy(l,i),m=f[1],v=f[2];if(m>v)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},ww=function(l){var o=l.scrollTop,r=l.scrollHeight,i=l.clientHeight;return[o,r,i]},Ew=function(l){var o=l.scrollLeft,r=l.scrollWidth,i=l.clientWidth;return[o,r,i]},by=function(l,o){return l==="v"?xw(o):Sw(o)},xy=function(l,o){return l==="v"?ww(o):Ew(o)},Cw=function(l,o){return l==="h"&&o==="rtl"?-1:1},Tw=function(l,o,r,i,u){var f=Cw(l,window.getComputedStyle(o).direction),m=f*i,v=r.target,y=o.contains(v),p=!1,w=m>0,g=0,E=0;do{if(!v)break;var O=xy(l,v),A=O[0],C=O[1],T=O[2],S=C-T-f*A;(A||S)&&by(l,v)&&(g+=S,E+=A);var D=v.parentNode;v=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!y&&v!==document.body||y&&(o.contains(v)||o===v));return(w&&Math.abs(g)<1||!w&&Math.abs(E)<1)&&(p=!0),p},us=function(l){return"changedTouches"in l?[l.changedTouches[0].clientX,l.changedTouches[0].clientY]:[0,0]},Gg=function(l){return[l.deltaX,l.deltaY]},Xg=function(l){return l&&"current"in l?l.current:l},Aw=function(l,o){return l[0]===o[0]&&l[1]===o[1]},_w=function(l){return` .block-interactivity-`.concat(l,` {pointer-events: none;} .allow-interactivity-`).concat(l,` {pointer-events: all;} -`)},Ow=0,wo=[];function Rw(l){var o=b.useRef([]),r=b.useRef([0,0]),i=b.useRef(),u=b.useState(Ow++)[0],f=b.useState(vy)[0],m=b.useRef(l);b.useEffect(function(){m.current=l},[l]),b.useEffect(function(){if(l.inert){document.body.classList.add("block-interactivity-".concat(u));var C=JS([l.lockRef.current],(l.shards||[]).map(Xg),!0).filter(Boolean);return C.forEach(function(T){return T.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),C.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(u))})}}},[l.inert,l.lockRef.current,l.shards]);var v=b.useCallback(function(C,T){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!m.current.allowPinchZoom;var S=us(C),D=r.current,z="deltaX"in C?C.deltaX:D[0]-S[0],k="deltaY"in C?C.deltaY:D[1]-S[1],I,X=C.target,K=Math.abs(z)>Math.abs(k)?"h":"v";if("touches"in C&&K==="h"&&X.type==="range")return!1;var G=window.getSelection(),ae=G&&G.anchorNode,me=ae?ae===X||ae.contains(X):!1;if(me)return!1;var ge=Vg(K,X);if(!ge)return!0;if(ge?I=K:(I=K==="v"?"h":"v",ge=Vg(K,X)),!ge)return!1;if(!i.current&&"changedTouches"in C&&(z||k)&&(i.current=I),!I)return!0;var U=i.current||I;return Tw(U,T,C,U==="h"?z:k)},[]),y=b.useCallback(function(C){var T=C;if(!(!wo.length||wo[wo.length-1]!==f)){var S="deltaY"in T?Gg(T):us(T),D=o.current.filter(function(I){return I.name===T.type&&(I.target===T.target||T.target===I.shadowParent)&&Aw(I.delta,S)})[0];if(D&&D.should){T.cancelable&&T.preventDefault();return}if(!D){var z=(m.current.shards||[]).map(Xg).filter(Boolean).filter(function(I){return I.contains(T.target)}),k=z.length>0?v(T,z[0]):!m.current.noIsolation;k&&T.cancelable&&T.preventDefault()}}},[]),p=b.useCallback(function(C,T,S,D){var z={name:C,delta:T,target:S,should:D,shadowParent:Nw(S)};o.current.push(z),setTimeout(function(){o.current=o.current.filter(function(k){return k!==z})},1)},[]),w=b.useCallback(function(C){r.current=us(C),i.current=void 0},[]),g=b.useCallback(function(C){p(C.type,Gg(C),C.target,v(C,l.lockRef.current))},[]),E=b.useCallback(function(C){p(C.type,us(C),C.target,v(C,l.lockRef.current))},[]);b.useEffect(function(){return wo.push(f),l.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:E}),document.addEventListener("wheel",y,So),document.addEventListener("touchmove",y,So),document.addEventListener("touchstart",w,So),function(){wo=wo.filter(function(C){return C!==f}),document.removeEventListener("wheel",y,So),document.removeEventListener("touchmove",y,So),document.removeEventListener("touchstart",w,So)}},[]);var O=l.removeScrollBar,A=l.inert;return b.createElement(b.Fragment,null,A?b.createElement(f,{styles:_w(u)}):null,O?b.createElement(yw,{noRelative:l.noRelative,gapMode:l.gapMode}):null)}function Nw(l){for(var o=null;l!==null;)l instanceof ShadowRoot&&(o=l.host,l=l.host),l=l.parentNode;return o}const jw=ow(gy,Rw);var rd=b.forwardRef(function(l,o){return b.createElement(Us,Mn({},l,{ref:o,sideCar:jw}))});rd.classNames=Us.classNames;var Dw=function(l){if(typeof document>"u")return null;var o=Array.isArray(l)?l[0]:l;return o.ownerDocument.body},Eo=new WeakMap,fs=new WeakMap,ds={},xf=0,Sy=function(l){return l&&(l.host||Sy(l.parentNode))},zw=function(l,o){return o.map(function(r){if(l.contains(r))return r;var i=Sy(r);return i&&l.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",l,". Doing nothing"),null)}).filter(function(r){return!!r})},Mw=function(l,o,r,i){var u=zw(o,Array.isArray(l)?l:[l]);ds[r]||(ds[r]=new WeakMap);var f=ds[r],m=[],v=new Set,y=new Set(u),p=function(g){!g||v.has(g)||(v.add(g),p(g.parentNode))};u.forEach(p);var w=function(g){!g||y.has(g)||Array.prototype.forEach.call(g.children,function(E){if(v.has(E))w(E);else try{var O=E.getAttribute(i),A=O!==null&&O!=="false",C=(Eo.get(E)||0)+1,T=(f.get(E)||0)+1;Eo.set(E,C),f.set(E,T),m.push(E),C===1&&A&&fs.set(E,!0),T===1&&E.setAttribute(r,"true"),A||E.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",E,S)}})};return w(o),v.clear(),xf++,function(){m.forEach(function(g){var E=Eo.get(g)-1,O=f.get(g)-1;Eo.set(g,E),f.set(g,O),E||(fs.has(g)||g.removeAttribute(i),fs.delete(g)),O||g.removeAttribute(r)}),xf--,xf||(Eo=new WeakMap,Eo=new WeakMap,fs=new WeakMap,ds={})}},wy=function(l,o,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(l)?l:[l]),u=Dw(l);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),Mw(i,u,r,"aria-hidden")):function(){return null}},Uw=Object.defineProperty,nn=(l,o)=>Uw(l,"name",{value:o,configurable:!0}),sd="Dialog",[Ey,Cy]=Pa(sd),[kw,En]=Ey(sd),Lw=nn(l=>{const{__scopeDialog:o,children:r,open:i,defaultOpen:u,onOpenChange:f,modal:m=!0}=l,v=b.useRef(null),y=b.useRef(null),[p,w]=ki({prop:i,defaultProp:u??!1,onChange:f,caller:sd}),[g,E]=b.useState(0),[O,A]=b.useState(0);return h.jsx(kw,{scope:o,triggerRef:v,contentRef:y,contentId:Tl(),titleId:Tl(),descriptionId:Tl(),titlePresent:g>0,descriptionPresent:O>0,setTitleCount:E,setDescriptionCount:A,open:p,onOpenChange:w,onOpenToggle:b.useCallback(()=>w(C=>!C),[w]),modal:m,children:r})},"Dialog"),Hw="DialogTrigger",Bw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Hw,i),m=Xe(r,f.triggerRef);return h.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":ks(f.open),...u,ref:m,onClick:De(o.onClick,f.onOpenToggle)})},"DialogTrigger")),Ty="DialogPortal",[qw,Ay]=Ey(Ty,{forceMount:void 0}),Yw=nn(l=>{const{__scopeDialog:o,forceMount:r,children:i,container:u}=l,f=En(Ty,o);return h.jsx(qw,{scope:o,forceMount:r,children:b.Children.map(i,m=>h.jsx(jo,{present:r||f.open,children:h.jsx(od,{asChild:!0,container:u,children:m})}))})},"DialogPortal"),Yf="DialogOverlay",Vw=b.forwardRef(nn(function(o,r){const i=Ay(Yf,o.__scopeDialog),{forceMount:u=i.forceMount,...f}=o,m=En(Yf,o.__scopeDialog);return m.modal?h.jsx(jo,{present:u||m.open,children:h.jsx(Xw,{...f,ref:r})}):null},"DialogOverlay")),Gw=ua("DialogOverlay.RemoveScroll"),Xw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Yf,i),m=ly(),v=Xe(r,m);return h.jsx(rd,{as:Gw,allowPinchZoom:!0,shards:[f.contentRef],children:h.jsx(Ie.div,{"data-state":ks(f.open),...u,ref:v,style:{pointerEvents:"auto",...u.style}})})},"DialogOverlayImpl")),Li="DialogContent",Qw=b.forwardRef(nn(function(o,r){const i=Ay(Li,o.__scopeDialog),{forceMount:u=i.forceMount,...f}=o,m=En(Li,o.__scopeDialog);return h.jsx(jo,{present:u||m.open,children:m.modal?h.jsx(Zw,{...f,ref:r}):h.jsx(Kw,{...f,ref:r})})},"DialogContent")),Zw=b.forwardRef(nn(function(o,r){const i=En(Li,o.__scopeDialog),u=b.useRef(null),f=Xe(r,i.contentRef,u);return b.useEffect(()=>{const m=u.current;if(m)return wy(m)},[]),h.jsx(_y,{...o,ref:f,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:De(o.onCloseAutoFocus,m=>{m.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:De(o.onPointerDownOutside,m=>{const v=m.detail.originalEvent,y=v.button===0&&v.ctrlKey===!0;(v.button===2||y)&&m.preventDefault()}),onFocusOutside:De(o.onFocusOutside,m=>m.preventDefault())})},"DialogContentModal")),Kw=b.forwardRef(nn(function(o,r){const i=En(Li,o.__scopeDialog),u=b.useRef(!1),f=b.useRef(!1);return h.jsx(_y,{...o,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{o.onCloseAutoFocus?.(m),m.defaultPrevented||(u.current||i.triggerRef.current?.focus(),m.preventDefault()),u.current=!1,f.current=!1},onInteractOutside:m=>{o.onInteractOutside?.(m),m.defaultPrevented||(u.current=!0,m.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const v=m.target;i.triggerRef.current?.contains(v)&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&f.current&&m.preventDefault()}})},"DialogContentNonModal")),_y=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:m,...v}=o,y=En(Li,i);return Ms(),h.jsx(h.Fragment,{children:h.jsx(ry,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:f,onUnmountAutoFocus:m,children:h.jsx(nd,{role:"dialog",id:y.contentId,"aria-describedby":y.descriptionPresent?y.descriptionId:void 0,"aria-labelledby":y.titlePresent?y.titleId:void 0,"data-state":ks(y.open),...v,ref:r,deferPointerDownOutside:!0,onDismiss:()=>y.onOpenChange(!1)})})})},"DialogContentImpl")),$w="DialogTitle",Pw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En($w,i),{setTitleCount:m}=f;return at(()=>(m(v=>v+1),()=>m(v=>v-1)),[m]),h.jsx(Ie.h2,{id:f.titleId,...u,ref:r})},"DialogTitle")),Jw="DialogDescription",Iw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Jw,i),{setDescriptionCount:m}=f;return at(()=>(m(v=>v+1),()=>m(v=>v-1)),[m]),h.jsx(Ie.p,{id:f.descriptionId,...u,ref:r})},"DialogDescription")),Fw="DialogClose",Oy=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Fw,i);return h.jsx(Ie.button,{type:"button",...u,ref:r,onClick:De(o.onClick,()=>f.onOpenChange(!1))})},"DialogClose"));function ks(l){return l?"open":"closed"}nn(ks,"getState");var Ww=Object.defineProperty,ma=(l,o)=>Ww(l,"name",{value:o,configurable:!0}),e2="AlertDialog",[t2,HA]=Pa(e2,[Cy]),ha=Cy(),n2=ma(l=>{const{__scopeAlertDialog:o,...r}=l,i=ha(o);return h.jsx(Lw,{...i,...r,modal:!0})},"AlertDialog"),a2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Bw,{...f,...u,ref:r})},"AlertDialogTrigger")),l2=ma(l=>{const{__scopeAlertDialog:o,...r}=l,i=ha(o);return h.jsx(Yw,{...i,...r})},"AlertDialogPortal"),o2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Vw,{...f,...u,ref:r})},"AlertDialogOverlay")),i2="AlertDialogContent",[r2,s2]=t2(i2),c2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,children:u,...f}=o,m=ha(i),v=b.useRef(null),y=Xe(r,v),p=b.useRef(null);return h.jsx(r2,{scope:i,cancelRef:p,children:h.jsx(Qw,{role:"alertdialog",...m,...f,ref:y,onOpenAutoFocus:De(f.onOpenAutoFocus,w=>{w.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:w=>w.preventDefault(),onInteractOutside:w=>w.preventDefault(),children:u})})},"AlertDialogContent")),u2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Pw,{...f,...u,ref:r})},"AlertDialogTitle")),f2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Iw,{...f,...u,ref:r})},"AlertDialogDescription")),d2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Oy,{...f,...u,ref:r})},"AlertDialogAction")),m2="AlertDialogCancel",h2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,{cancelRef:f}=s2(m2,i),m=ha(i),v=Xe(r,f);return h.jsx(Oy,{...m,...u,ref:v})},"AlertDialogCancel")),p2=n2,g2=a2,v2=l2,y2=o2,b2=c2,x2=d2,S2=h2,w2=u2,E2=f2,C2=Object.defineProperty,T2=(l,o)=>C2(l,"name",{value:o,configurable:!0});function Ry(l){const[o,r]=b.useState(void 0);return at(()=>{if(l){r({width:l.offsetWidth,height:l.offsetHeight});const i=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const f=u[0];let m,v;if("borderBoxSize"in f){const y=f.borderBoxSize,p=Array.isArray(y)?y[0]:y;m=p.inlineSize,v=p.blockSize}else m=l.offsetWidth,v=l.offsetHeight;r({width:m,height:v})});return i.observe(l,{box:"border-box"}),()=>i.unobserve(l)}else r(void 0)},[l]),o}T2(Ry,"useSize");const A2=["top","right","bottom","left"],Ka=Math.min,ra=Math.max,Os=Math.round,ms=Math.floor,sa=l=>({x:l,y:l}),_2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ny(l,o,r){return ra(l,Ka(o,r))}function da(l,o){return typeof l=="function"?l(o):l}function $a(l){return l.split("-")[0]}function Do(l){return l.split("-")[1]}function cd(l){return l==="x"?"y":"x"}function ud(l){return l==="y"?"height":"width"}function Un(l){const o=l[0];return o==="t"||o==="b"?"y":"x"}function fd(l){return cd(Un(l))}function O2(l,o,r){r===void 0&&(r=!1);const i=Do(l),u=fd(l),f=ud(u);let m=u==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(m=Rs(m)),[m,Rs(m)]}function R2(l){const o=Rs(l);return[Vf(l),o,Vf(o)]}function Vf(l){return l.includes("start")?l.replace("start","end"):l.replace("end","start")}const Qg=["left","right"],Zg=["right","left"],N2=["top","bottom"],j2=["bottom","top"];function D2(l,o,r){switch(l){case"top":case"bottom":return r?o?Zg:Qg:o?Qg:Zg;case"left":case"right":return o?N2:j2;default:return[]}}function z2(l,o,r,i){const u=Do(l);let f=D2($a(l),r==="start",i);return u&&(f=f.map(m=>m+"-"+u),o&&(f=f.concat(f.map(Vf)))),f}function Rs(l){const o=$a(l);return _2[o]+l.slice(o.length)}function M2(l){var o,r,i,u;return{top:(o=l.top)!=null?o:0,right:(r=l.right)!=null?r:0,bottom:(i=l.bottom)!=null?i:0,left:(u=l.left)!=null?u:0}}function jy(l){return typeof l!="number"?M2(l):{top:l,right:l,bottom:l,left:l}}function Ns(l){const{x:o,y:r,width:i,height:u}=l;return{width:i,height:u,top:r,left:o,right:o+i,bottom:r+u,x:o,y:r}}function Kg(l,o,r){let{reference:i,floating:u}=l;const f=Un(o),m=fd(o),v=ud(m),y=$a(o),p=f==="y",w=i.x+i.width/2-u.width/2,g=i.y+i.height/2-u.height/2,E=i[v]/2-u[v]/2;let O;switch(y){case"top":O={x:w,y:i.y-u.height};break;case"bottom":O={x:w,y:i.y+i.height};break;case"right":O={x:i.x+i.width,y:g};break;case"left":O={x:i.x-u.width,y:g};break;default:O={x:i.x,y:i.y}}const A=Do(o);return A&&(O[m]+=E*(A==="end"?1:-1)*(r&&p?-1:1)),O}async function U2(l,o){var r;o===void 0&&(o={});const{x:i,y:u,platform:f,rects:m,elements:v,strategy:y}=l,{boundary:p="clippingAncestors",rootBoundary:w="viewport",elementContext:g="floating",altBoundary:E=!1,padding:O=0}=da(o,l),A=jy(O),T=v[E?g==="floating"?"reference":"floating":g],S=Ns(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(T)))==null||r?T:T.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(v.floating)),boundary:p,rootBoundary:w,strategy:y})),D=g==="floating"?{x:i,y:u,width:m.floating.width,height:m.floating.height}:m.reference,z=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v.floating)),k=await(f.isElement==null?void 0:f.isElement(z))&&await(f.getScale==null?void 0:f.getScale(z))||{x:1,y:1},I=Ns(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:D,offsetParent:z,strategy:y}):D);return{top:(S.top-I.top+A.top)/k.y,bottom:(I.bottom-S.bottom+A.bottom)/k.y,left:(S.left-I.left+A.left)/k.x,right:(I.right-S.right+A.right)/k.x}}const k2=50,L2=async(l,o,r)=>{const{placement:i="bottom",strategy:u="absolute",middleware:f=[],platform:m}=r,v=m.detectOverflow?m:{...m,detectOverflow:U2},y=await(m.isRTL==null?void 0:m.isRTL(o));let p=await m.getElementRects({reference:l,floating:o,strategy:u}),{x:w,y:g}=Kg(p,i,y),E=i,O=0;const A={};for(let C=0;C({name:"arrow",options:l,async fn(o){const{x:r,y:i,placement:u,rects:f,platform:m,elements:v,middlewareData:y}=o,{element:p,padding:w=0}=da(l,o)||{};if(p==null)return{};const g=jy(w),E={x:r,y:i},O=fd(u),A=ud(O),C=await m.getDimensions(p),T=O==="y",S=T?"top":"left",D=T?"bottom":"right",z=T?"clientHeight":"clientWidth",k=f.reference[A]+f.reference[O]-E[O]-f.floating[A],I=E[O]-f.reference[O],X=await(m.getOffsetParent==null?void 0:m.getOffsetParent(p));let K=X?X[z]:0;(!K||!await(m.isElement==null?void 0:m.isElement(X)))&&(K=v.floating[z]||f.floating[A]);const G=k/2-I/2,ae=K/2-C[A]/2-1,me=Ka(g[S],ae),ge=Ka(g[D],ae),U=K-C[A]-ge,te=K/2-C[A]/2+G,fe=Ny(me,te,U),he=!y.arrow&&Do(u)!=null&&te!==fe&&f.reference[A]/2-(tefe<=0)){var ge,U;const fe=(((ge=f.flip)==null?void 0:ge.index)||0)+1,he=K[fe];if(he&&(!(g==="alignment"?D!==Un(he):!1)||me.every(F=>Un(F.placement)===D?F.overflows[0]>0:!0)))return{data:{index:fe,overflows:me},reset:{placement:he}};let j=(U=me.filter(Y=>Y.overflows[0]<=0).sort((Y,F)=>Y.overflows[1]-F.overflows[1])[0])==null?void 0:U.placement;if(!j)switch(O){case"bestFit":{var te;const Y=(te=me.filter(F=>{if(X){const oe=Un(F.placement);return oe===D||oe==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(oe=>oe>0).reduce((oe,P)=>oe+P,0)]).sort((F,oe)=>F[1]-oe[1])[0])==null?void 0:te[0];Y&&(j=Y);break}case"initialPlacement":j=v;break}if(u!==j)return{reset:{placement:j}}}return{}}}};function $g(l,o){return{top:l.top-o.height,right:l.right-o.width,bottom:l.bottom-o.height,left:l.left-o.width}}function Pg(l){return A2.some(o=>l[o]>=0)}const q2=function(l){return l===void 0&&(l={}),{name:"hide",options:l,async fn(o){const{rects:r,platform:i}=o,{strategy:u="referenceHidden",...f}=da(l,o);switch(u){case"referenceHidden":{const m=await i.detectOverflow(o,{...f,elementContext:"reference"}),v=$g(m,r.reference);return{data:{referenceHiddenOffsets:v,referenceHidden:Pg(v)}}}case"escaped":{const m=await i.detectOverflow(o,{...f,altBoundary:!0}),v=$g(m,r.floating);return{data:{escapedOffsets:v,escaped:Pg(v)}}}default:return{}}}}},Dy=new Set(["left","top"]);async function Y2(l,o){const{placement:r,platform:i,elements:u}=l,f=await(i.isRTL==null?void 0:i.isRTL(u.floating)),m=$a(r),v=Do(r),y=Un(r)==="y",p=Dy.has(m)?-1:1,w=f&&y?-1:1,g=da(o,l);let{mainAxis:E,crossAxis:O,alignmentAxis:A}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return v&&typeof A=="number"&&(O=v==="end"?A*-1:A),y?{x:O*w,y:E*p}:{x:E*p,y:O*w}}const V2=function(l){return l===void 0&&(l=0),{name:"offset",options:l,async fn(o){var r,i;const{x:u,y:f,placement:m,middlewareData:v}=o,y=await Y2(o,l);return m===((r=v.offset)==null?void 0:r.placement)&&(i=v.arrow)!=null&&i.alignmentOffset?{}:{x:u+y.x,y:f+y.y,data:{...y,placement:m}}}}},G2=function(l){return l===void 0&&(l={}),{name:"shift",options:l,async fn(o){const{x:r,y:i,placement:u,platform:f}=o,{mainAxis:m=!0,crossAxis:v=!1,limiter:y={fn:D=>{let{x:z,y:k}=D;return{x:z,y:k}}},...p}=da(l,o),w={x:r,y:i},g=await f.detectOverflow(o,p),E=Un(u),O=cd(E);let A=w[O],C=w[E];const T=(D,z)=>Ny(z+g[D==="y"?"top":"left"],z,z-g[D==="y"?"bottom":"right"]);m&&(A=T(O,A)),v&&(C=T(E,C));const S=y.fn({...o,[O]:A,[E]:C});return{...S,data:{x:S.x-r,y:S.y-i,enabled:{[O]:m,[E]:v}}}}}},X2=function(l){return l===void 0&&(l={}),{options:l,fn(o){var r,i;const{x:u,y:f,placement:m,rects:v,middlewareData:y}=o,{offset:p=0,mainAxis:w=!0,crossAxis:g=!0}=da(l,o),E={x:u,y:f},O=Un(m),A=cd(O);let C=E[A],T=E[O];const S=da(p,o),D=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(r=S.mainAxis)!=null?r:0,crossAxis:(i=S.crossAxis)!=null?i:0};if(w){const I=A==="y"?"height":"width",X=v.reference[A]-v.floating[I]+D.mainAxis,K=v.reference[A]+v.reference[I]-D.mainAxis;CK&&(C=K)}if(g){var z,k;const I=A==="y"?"width":"height",X=Dy.has($a(m)),K=v.reference[O]-v.floating[I]+(X&&((z=y.offset)==null?void 0:z[O])||0)+(X?0:D.crossAxis),G=v.reference[O]+v.reference[I]+(X?0:((k=y.offset)==null?void 0:k[O])||0)-(X?D.crossAxis:0);TG&&(T=G)}return{[A]:C,[O]:T}}}},Q2=function(l){return l===void 0&&(l={}),{name:"size",options:l,async fn(o){const{placement:r,rects:i,platform:u,elements:f}=o,{apply:m=()=>{},...v}=da(l,o),y=await u.detectOverflow(o,v),p=$a(r),w=Do(r),g=Un(r)==="y",{width:E,height:O}=i.floating;let A,C;p==="top"||p==="bottom"?(A=p,C=w===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(C=p,A=w==="end"?"top":"bottom");const T=O-y.top-y.bottom,S=E-y.left-y.right,D=Ka(O-y[A],T),z=Ka(E-y[C],S),k=o.middlewareData.shift,I=!k;let X=D,K=z;k!=null&&k.enabled.x&&(K=S),k!=null&&k.enabled.y&&(X=T),I&&!w&&(g?K=E-2*ra(y.left,y.right):X=O-2*ra(y.top,y.bottom)),await m({...o,availableWidth:K,availableHeight:X});const G=await u.getDimensions(f.floating);return E!==G.width||O!==G.height?{reset:{rects:!0}}:{}}}};function Ls(){return typeof window<"u"}function zo(l){return zy(l)?(l.nodeName||"").toLowerCase():"#document"}function Zt(l){var o;return(l==null||(o=l.ownerDocument)==null?void 0:o.defaultView)||window}function pa(l){var o;return(o=(zy(l)?l.ownerDocument:l.document)||window.document)==null?void 0:o.documentElement}function zy(l){return Ls()?l instanceof Node||l instanceof Zt(l).Node:!1}function Ln(l){return Ls()?l instanceof Element||l instanceof Zt(l).Element:!1}function Ja(l){return Ls()?l instanceof HTMLElement||l instanceof Zt(l).HTMLElement:!1}function Jg(l){return!Ls()||typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof Zt(l).ShadowRoot}function Hs(l){const{overflow:o,overflowX:r,overflowY:i,display:u}=Hn(l);return/auto|scroll|overlay|hidden|clip/.test(o+i+r)&&u!=="inline"&&u!=="contents"}function Z2(l){return/^(table|td|th)$/.test(zo(l))}function Bs(l){try{if(l.matches(":popover-open"))return!0}catch{}try{return l.matches(":modal")}catch{return!1}}const K2=/transform|translate|scale|rotate|perspective|filter/,$2=/paint|layout|strict|content/,wl=l=>!!l&&l!=="none";let Sf;function dd(l){const o=Ln(l)?Hn(l):l;return wl(o.transform)||wl(o.translate)||wl(o.scale)||wl(o.rotate)||wl(o.perspective)||!md()&&(wl(o.backdropFilter)||wl(o.filter))||K2.test(o.willChange||"")||$2.test(o.contain||"")}function P2(l){let o=Al(l);for(;Ja(o)&&!Hi(o);){if(dd(o))return o;if(Bs(o))return null;o=Al(o)}return null}function md(){return Sf==null&&(Sf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Sf}function Hi(l){return/^(html|body|#document)$/.test(zo(l))}function Hn(l){return Zt(l).getComputedStyle(l)}function qs(l){return Ln(l)?{scrollLeft:l.scrollLeft,scrollTop:l.scrollTop}:{scrollLeft:l.scrollX,scrollTop:l.scrollY}}function Al(l){if(zo(l)==="html")return l;const o=l.assignedSlot||l.parentNode||Jg(l)&&l.host||pa(l);return Jg(o)?o.host:o}function My(l){const o=Al(l);return Hi(o)?(l.ownerDocument||l).body:Ja(o)&&Hs(o)?o:My(o)}function Bi(l,o,r){var i;o===void 0&&(o=[]),r===void 0&&(r=!0);const u=My(l),f=u===((i=l.ownerDocument)==null?void 0:i.body),m=Zt(u);if(f){const v=Gf(m);return o.concat(m,m.visualViewport||[],Hs(u)?u:[],v&&r?Bi(v):[])}else return o.concat(u,Bi(u,[],r))}function Gf(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}function Uy(l){const o=Hn(l);let r=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const u=Ja(l),f=u?l.offsetWidth:r,m=u?l.offsetHeight:i,v=Os(r)!==f||Os(i)!==m;return v&&(r=f,i=m),{width:r,height:i,$:v}}function hd(l){return Ln(l)?l:l.contextElement}function _o(l){const o=hd(l);if(!Ja(o))return sa(1);const r=o.getBoundingClientRect(),{width:i,height:u,$:f}=Uy(o);let m=(f?Os(r.width):r.width)/i,v=(f?Os(r.height):r.height)/u;return(!m||!Number.isFinite(m))&&(m=1),(!v||!Number.isFinite(v))&&(v=1),{x:m,y:v}}const J2=sa(0);function ky(l){const o=Zt(l);return!md()||!o.visualViewport?J2:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function I2(l,o,r){return o===void 0&&(o=!1),!!r&&o&&r===Zt(l)}function _l(l,o,r,i){o===void 0&&(o=!1),r===void 0&&(r=!1);const u=l.getBoundingClientRect(),f=hd(l);let m=sa(1);o&&(i?Ln(i)&&(m=_o(i)):m=_o(l));const v=I2(f,r,i)?ky(f):sa(0);let y=(u.left+v.x)/m.x,p=(u.top+v.y)/m.y,w=u.width/m.x,g=u.height/m.y;if(f&&i){const E=Zt(f),O=Ln(i)?Zt(i):i;let A=E,C=Gf(A);for(;C&&O!==A;){const T=_o(C),S=C.getBoundingClientRect(),D=Hn(C),z=S.left+(C.clientLeft+parseFloat(D.paddingLeft))*T.x,k=S.top+(C.clientTop+parseFloat(D.paddingTop))*T.y;y*=T.x,p*=T.y,w*=T.x,g*=T.y,y+=z,p+=k,A=Zt(C),C=Gf(A)}}return Ns({width:w,height:g,x:y,y:p})}function Ys(l,o){const r=qs(l).scrollLeft;return o?o.left+r:_l(pa(l)).left+r}function Ly(l,o){const r=l.getBoundingClientRect(),i=r.left+o.scrollLeft-Ys(l,r),u=r.top+o.scrollTop;return{x:i,y:u}}function F2(l){let{elements:o,rect:r,offsetParent:i,strategy:u}=l;const f=u==="fixed",m=pa(i),v=o?Bs(o.floating):!1;if(i===m||v&&f)return r;let y={scrollLeft:0,scrollTop:0},p=sa(1);const w=sa(0),g=Ja(i);if((g||!f)&&((zo(i)!=="body"||Hs(m))&&(y=qs(i)),g)){const O=_l(i);p=_o(i),w.x=O.x+i.clientLeft,w.y=O.y+i.clientTop}const E=m&&!g&&!f?Ly(m,y):sa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-y.scrollLeft*p.x+w.x+E.x,y:r.y*p.y-y.scrollTop*p.y+w.y+E.y}}function W2(l){return l.getClientRects?Array.from(l.getClientRects()):[]}function eE(l){const o=qs(l),r=l.ownerDocument.body,i=ra(l.scrollWidth,l.clientWidth,r.scrollWidth,r.clientWidth),u=ra(l.scrollHeight,l.clientHeight,r.scrollHeight,r.clientHeight);let f=-o.scrollLeft+Ys(l);const m=-o.scrollTop;return Hn(r).direction==="rtl"&&(f+=ra(l.clientWidth,r.clientWidth)-i),{width:i,height:u,x:f,y:m}}const tE=25;function nE(l,o,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",u=Zt(l),f=pa(l),m=u.visualViewport;let v=f.clientWidth,y=f.clientHeight,p=0,w=0;if(m){const E=!md()||o==="fixed";i?E||(p=-m.offsetLeft,w=-m.offsetTop):(v=m.width,y=m.height,E&&(p=m.offsetLeft,w=m.offsetTop))}if(Ys(f)<=0){const E=f.ownerDocument,O=E.body,A=getComputedStyle(O),C=E.compatMode==="CSS1Compat"&&parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0,T=Math.abs(f.clientWidth-O.clientWidth-C),S=getComputedStyle(f).scrollbarGutter==="stable both-edges"?T/2:T;S<=tE&&(v-=S)}return{width:v,height:y,x:p,y:w}}function aE(l,o){const r=_l(l,!0,o==="fixed"),i=r.top+l.clientTop,u=r.left+l.clientLeft,f=_o(l),m=l.clientWidth*f.x,v=l.clientHeight*f.y,y=u*f.x,p=i*f.y;return{width:m,height:v,x:y,y:p}}function Ig(l,o,r){let i;if(o==="viewport"||o==="layoutViewport")i=nE(l,r,o);else if(o==="document")i=eE(pa(l));else if(Ln(o))i=aE(o,r);else{const u=ky(l);i={x:o.x-u.x,y:o.y-u.y,width:o.width,height:o.height}}return Ns(i)}function lE(l,o){const r=o.get(l);if(r)return r;let i=Bi(l,[],!1).filter(v=>Ln(v)&&zo(v)!=="body"),u=null;const f=Hn(l).position==="fixed";let m=f?Al(l):l;for(;Ln(m)&&!Hi(m);){const v=Hn(m),y=dd(m),p=u?u.position:f?"fixed":"";!y&&(p==="fixed"||p==="absolute"&&v.position==="static")?i=i.filter(g=>g!==m):u=v,m=Al(m)}return o.set(l,i),i}function oE(l){let{element:o,boundary:r,rootBoundary:i,strategy:u}=l;const m=[...r==="clippingAncestors"?Bs(o)?[]:lE(o,this._c):[].concat(r),i],v=Ig(o,m[0],u);let y=v.top,p=v.right,w=v.bottom,g=v.left;for(let E=1;E{v(!1,1e-7)},1e3)}K=!1}try{i=new IntersectionObserver(G,{...X,root:f.ownerDocument})}catch{i=new IntersectionObserver(G,X)}i.observe(l)}const y=Zt(l),p=()=>v(r);return y.addEventListener("resize",p),v(!0),()=>{y.removeEventListener("resize",p),m()}}function dE(l,o,r,i){i===void 0&&(i={});const{ancestorScroll:u=!0,ancestorResize:f=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:y=!1}=i,p=hd(l),w=u||f?[...p?Bi(p):[],...o?Bi(o):[]]:[];w.forEach(S=>{u&&S.addEventListener("scroll",r),f&&S.addEventListener("resize",r)});const g=p&&v?fE(p,r,f):null;let E=-1,O=null;m&&(O=new ResizeObserver(S=>{let[D]=S;D&&D.target===p&&O&&o&&(O.unobserve(o),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var z;(z=O)==null||z.observe(o)})),r()}),p&&!y&&O.observe(p),o&&O.observe(o));let A,C=y?_l(l):null;y&&T();function T(){const S=_l(l);C&&!By(C,S)&&r(),C=S,A=requestAnimationFrame(T)}return r(),()=>{var S;w.forEach(D=>{u&&D.removeEventListener("scroll",r),f&&D.removeEventListener("resize",r)}),g?.(),(S=O)==null||S.disconnect(),O=null,y&&cancelAnimationFrame(A)}}const mE=V2,hE=G2,pE=B2,gE=Q2,vE=q2,Wg=H2,yE=X2,bE=(l,o,r)=>{const i=new Map,u=r??{},f={...uE,...u.platform,_c:i};return L2(l,o,{...u,platform:f})};var xE=typeof document<"u",SE=function(){},_s=xE?b.useLayoutEffect:SE;function js(l,o){if(l===o)return!0;if(typeof l!=typeof o)return!1;if(typeof l=="function"&&l.toString()===o.toString())return!0;let r,i,u;if(l&&o&&typeof l=="object"){if(Array.isArray(l)){if(r=l.length,r!==o.length)return!1;for(i=r;i--!==0;)if(!js(l[i],o[i]))return!1;return!0}if(u=Object.keys(l),r=u.length,r!==Object.keys(o).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(o,u[i]))return!1;for(i=r;i--!==0;){const f=u[i];if(!(f==="_owner"&&l.$$typeof)&&!js(l[f],o[f]))return!1}return!0}return l!==l&&o!==o}function qy(l){return typeof window>"u"?1:(l.ownerDocument.defaultView||window).devicePixelRatio||1}function ev(l,o){const r=qy(l);return Math.round(o*r)/r}function Ef(l){const o=b.useRef(l);return _s(()=>{o.current=l}),o}function wE(l){l===void 0&&(l={});const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:u,elements:{reference:f,floating:m}={},transform:v=!0,whileElementsMounted:y,open:p}=l,[w,g]=b.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[E,O]=b.useState(i);js(E,i)||O(i);const[A,C]=b.useState(null),[T,S]=b.useState(null),D=b.useCallback(F=>{F!==X.current&&(X.current=F,C(F))},[]),z=b.useCallback(F=>{F!==K.current&&(K.current=F,S(F))},[]),k=f||A,I=m||T,X=b.useRef(null),K=b.useRef(null),G=b.useRef(w),ae=y!=null,me=Ef(y),ge=Ef(u),U=Ef(p),te=b.useCallback(()=>{if(!X.current||!K.current)return;const F={placement:o,strategy:r,middleware:E};ge.current&&(F.platform=ge.current),bE(X.current,K.current,F).then(oe=>{const P={...oe,isPositioned:U.current!==!1};fe.current&&!js(G.current,P)&&(G.current=P,Ro.flushSync(()=>{g(P)}))})},[E,o,r,ge,U]);_s(()=>{p===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[p]);const fe=b.useRef(!1);_s(()=>(fe.current=!0,()=>{fe.current=!1}),[]),_s(()=>{if(k&&(X.current=k),I&&(K.current=I),k&&I){if(me.current)return me.current(k,I,te);te()}},[k,I,te,me,ae]);const he=b.useMemo(()=>({reference:X,floating:K,setReference:D,setFloating:z}),[D,z]),j=b.useMemo(()=>({reference:k,floating:I}),[k,I]),Y=b.useMemo(()=>{const F={position:r,left:0,top:0};if(!j.floating)return F;const oe=ev(j.floating,w.x),P=ev(j.floating,w.y);return v?{...F,transform:"translate("+oe+"px, "+P+"px)",...qy(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:oe,top:P}},[r,v,j.floating,w.x,w.y]);return b.useMemo(()=>({...w,update:te,refs:he,elements:j,floatingStyles:Y}),[w,te,he,j,Y])}const EE=l=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:l,fn(r){const{element:i,padding:u}=typeof l=="function"?l(r):l;return i&&o(i)?i.current!=null?Wg({element:i.current,padding:u}).fn(r):{}:i?Wg({element:i,padding:u}).fn(r):{}}}},CE=(l,o)=>{const r=mE(l);return{name:r.name,fn:r.fn,options:[l,o]}},TE=(l,o)=>{const r=hE(l);return{name:r.name,fn:r.fn,options:[l,o]}},AE=(l,o)=>({fn:yE(l).fn,options:[l,o]}),_E=(l,o)=>{const r=pE(l);return{name:r.name,fn:r.fn,options:[l,o]}},OE=(l,o)=>{const r=gE(l);return{name:r.name,fn:r.fn,options:[l,o]}},RE=(l,o)=>{const r=vE(l);return{name:r.name,fn:r.fn,options:[l,o]}},NE=(l,o)=>{const r=EE(l);return{name:r.name,fn:r.fn,options:[l,o]}};var jE=Object.defineProperty,DE=(l,o)=>jE(l,"name",{value:o,configurable:!0}),zE=b.forwardRef(DE(function(o,r){const{children:i,width:u=10,height:f=5,...m}=o;return h.jsx(Ie.svg,{...m,ref:r,width:u,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:o.asChild?i:h.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),ME=zE,UE=Object.defineProperty,ca=(l,o)=>UE(l,"name",{value:o,configurable:!0}),Yy="Popper",[Vy,Vs]=Pa(Yy),[kE,Gy]=Vy(Yy),LE=ca(l=>{const{__scopePopper:o,children:r}=l,[i,u]=b.useState(null),[f,m]=b.useState(void 0);return h.jsx(kE,{scope:o,anchor:i,onAnchorChange:u,placementState:f,setPlacementState:m,children:r})},"Popper"),HE="PopperAnchor",BE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,virtualRef:u,...f}=o,m=Gy(HE,i),v=b.useRef(null),y=m.onAnchorChange,p=b.useCallback(C=>{v.current=C,C&&y(C)},[y]),w=Xe(r,p),g=b.useRef(null);b.useEffect(()=>{if(!u)return;const C=g.current;g.current=u.current,C!==g.current&&y(g.current)});const E=m.placementState&&Gs(m.placementState),O=E?.[0],A=E?.[1];return u?null:h.jsx(Ie.div,{"data-radix-popper-side":O,"data-radix-popper-align":A,...f,ref:w})},"PopperAnchor")),Xy="PopperContent",[qE,YE]=Vy(Xy),VE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,side:u="bottom",sideOffset:f=0,align:m="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:p=!0,collisionBoundary:w=[],collisionPadding:g=0,sticky:E="partial",hideWhenDetached:O=!1,updatePositionStrategy:A="optimized",onPlaced:C,...T}=o,S=Gy(Xy,i),[D,z]=b.useState(null),k=Xe(r,z),[I,X]=b.useState(null),K=Ry(I),G=K?.width??0,ae=K?.height??0,me=u+(m!=="center"?"-"+m:""),ge=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(w)?w:[w],te=U.length>0,fe={padding:ge,boundary:U.filter(Qy),altBoundary:te},{refs:he,floatingStyles:j,placement:Y,isPositioned:F,middlewareData:oe}=wE({strategy:"fixed",placement:me,whileElementsMounted:ca((...re)=>dE(...re,{animationFrame:A==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[CE({mainAxis:f+ae,alignmentAxis:v}),p&&TE({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?AE():void 0,...fe}),p&&_E({...fe}),OE({...fe,apply:ca(({elements:re,rects:Le,availableWidth:Ce,availableHeight:Te})=>{const{width:He,height:Ze}=Le.reference,dt=re.floating.style;dt.setProperty("--radix-popper-available-width",`${Ce}px`),dt.setProperty("--radix-popper-available-height",`${Te}px`),dt.setProperty("--radix-popper-anchor-width",`${He}px`),dt.setProperty("--radix-popper-anchor-height",`${Ze}px`)},"apply")}),I&&NE({element:I,padding:y}),ZE({arrowWidth:G,arrowHeight:ae}),O&&RE({strategy:"referenceHidden",...fe,boundary:te?fe.boundary:void 0})]}),P=S.setPlacementState;at(()=>(P(Y),()=>{P(void 0)}),[Y,P]);const[R,V]=Gs(Y),Z=kn(C);at(()=>{F&&Z?.()},[F,Z]);const W=oe.arrow?.x,ee=oe.arrow?.y,ie=oe.arrow?.centerOffset!==0,[ye,ne]=b.useState();return at(()=>{D&&ne(window.getComputedStyle(D).zIndex)},[D]),h.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:F?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(" "),...oe.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:o.dir,children:h.jsx(qE,{scope:i,placedSide:R,placedAlign:V,onArrowChange:X,arrowX:W,arrowY:ee,shouldHideArrow:ie,children:h.jsx(Ie.div,{"data-side":R,"data-align":V,...T,ref:k,style:{...T.style,animation:F?T.style?.animation:"none"}})})})},"PopperContent")),GE="PopperArrow",XE={top:"bottom",right:"left",bottom:"top",left:"right"},QE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,...u}=o,f=YE(GE,i),m=XE[f.placedSide];return h.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:h.jsx(ME,{...u,ref:r,style:{...u.style,display:"block"}})})},"PopperArrow"));function Qy(l){return l!==null}ca(Qy,"isNotNull");var ZE=ca(l=>({name:"transformOrigin",options:l,fn(o){const{placement:r,rects:i,middlewareData:u}=o,m=u.arrow?.centerOffset!==0,v=m?0:l.arrowWidth,y=m?0:l.arrowHeight,[p,w]=Gs(r),g={start:"0%",center:"50%",end:"100%"}[w],E=(u.arrow?.x??0)+v/2,O=(u.arrow?.y??0)+y/2;let A="",C="";return p==="bottom"?(A=m?g:`${E}px`,C=`${-y}px`):p==="top"?(A=m?g:`${E}px`,C=`${i.floating.height+y}px`):p==="right"?(A=`${-y}px`,C=m?g:`${O}px`):p==="left"&&(A=`${i.floating.width+y}px`,C=m?g:`${O}px`),{data:{x:A,y:C}}}}),"transformOrigin");function Gs(l){const[o,r="center"]=l.split("-");return[o,r]}ca(Gs,"getSideAndAlignFromPlacement");var Zy=LE,Ky=BE,$y=VE,KE=QE,$E=Object.defineProperty,PE=(l,o)=>$E(l,"name",{value:o,configurable:!0}),JE=b.forwardRef(PE(function(o,r){return h.jsx(Ie.label,{...o,ref:r,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(o.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}})},"Label")),IE=JE,FE=Object.defineProperty,WE=(l,o)=>FE(l,"name",{value:o,configurable:!0});function Py(l){const o=b.useRef({value:l,previous:l});return b.useMemo(()=>(o.current.value!==l&&(o.current.previous=o.current.value,o.current.value=l),o.current.previous),[l])}WE(Py,"usePrevious");var eC=Object.defineProperty,tC=(l,o)=>eC(l,"name",{value:o,configurable:!0});function Xf(l,[o,r]){return Math.min(r,Math.max(o,l))}tC(Xf,"clamp");var nC=Object.defineProperty,ze=(l,o)=>nC(l,"name",{value:o,configurable:!0}),aC=[" ","Enter","ArrowUp","ArrowDown"],lC=[" ","Enter"],Oo="Select",[Xs,Qs,oC]=Yv(Oo),[Rl,BA]=Pa(Oo,[oC,Vs]),pd=Vs(),[iC,Ia]=Rl(Oo),[rC,sC]=Rl(Oo);function Jy(l){const{__scopeSelect:o,children:r,open:i,defaultOpen:u,onOpenChange:f,value:m,defaultValue:v,onValueChange:y,dir:p,name:w,autoComplete:g,disabled:E,required:O,form:A,internal_do_not_use_render:C}=l,T=pd(o),[S,D]=b.useState(null),[z,k]=b.useState(null),[I,X]=b.useState(!1),K=ny(p),[G,ae]=ki({prop:i,defaultProp:u??!1,onChange:f,caller:Oo}),[me,ge]=ki({prop:m,defaultProp:v,onChange:y,caller:Oo}),U=b.useRef(null),te=b.useRef(me);b.useEffect(()=>{const V=A?S?.ownerDocument.getElementById(A):S?.form;if(V instanceof HTMLFormElement){const Z=ze(()=>ge(te.current),"reset");return V.addEventListener("reset",Z),()=>V.removeEventListener("reset",Z)}},[A,S,ge]);const fe=S?!!A||!!S.closest("form"):!0,[he,j]=b.useState(new Set),Y=Tl(),F=Array.from(he).map(V=>V.props.value).join(";"),oe=b.useCallback(V=>{j(Z=>new Set(Z).add(V))},[]),P=b.useCallback(V=>{j(Z=>{const W=new Set(Z);return W.delete(V),W})},[]),R={required:O,trigger:S,onTriggerChange:D,valueNode:z,onValueNodeChange:k,valueNodeHasChildren:I,onValueNodeHasChildrenChange:X,contentId:Y,value:me,onValueChange:ge,open:G,onOpenChange:ae,dir:K,triggerPointerDownPosRef:U,disabled:E,name:w,autoComplete:g,form:A,nativeOptions:he,nativeSelectKey:F,isFormControl:fe};return h.jsx(Zy,{...T,children:h.jsx(iC,{scope:o,...R,children:h.jsx(Xs.Provider,{scope:o,children:h.jsx(rC,{scope:o,onNativeOptionAdd:oe,onNativeOptionRemove:P,children:e0(C)?C(R):r})})})})}ze(Jy,"SelectProvider");var cC=ze(l=>{const{__scopeSelect:o,children:r,...i}=l;return h.jsx(Jy,{__scopeSelect:o,...i,internal_do_not_use_render:({isFormControl:u})=>h.jsxs(h.Fragment,{children:[r,u?h.jsx(UC,{__scopeSelect:o}):null]})})},"Select"),uC="SelectTrigger",fC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,disabled:u=!1,...f}=o,m=pd(i),v=Ia(uC,i),y=v.disabled||u,p=Xe(r,v.onTriggerChange),w=Qs(i),g=b.useRef("touch"),[E,O,A]=vd(T=>{const S=w().filter(k=>!k.disabled),D=S.find(k=>k.value===v.value),z=yd(S,T,D);z!==void 0&&v.onValueChange(z.value)}),C=ze(T=>{y||(v.onOpenChange(!0),A()),T&&(v.triggerPointerDownPosRef.current={x:Math.round(T.pageX),y:Math.round(T.pageY)})},"handleOpen");return h.jsx(Ky,{asChild:!0,...m,children:h.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":v.open?v.contentId:void 0,"aria-expanded":v.open,"aria-required":v.required,"aria-autocomplete":"none",dir:v.dir,"data-state":v.open?"open":"closed",disabled:y,"data-disabled":y?"":void 0,"data-placeholder":Xi(v.value)?"":void 0,...f,ref:p,onClick:De(f.onClick,T=>{T.currentTarget.focus(),g.current!=="mouse"&&C(T)}),onPointerDown:De(f.onPointerDown,T=>{g.current=T.pointerType;const S=T.target;S.hasPointerCapture(T.pointerId)&&S.releasePointerCapture(T.pointerId),T.button===0&&T.ctrlKey===!1&&T.pointerType==="mouse"&&(C(T),T.preventDefault())}),onKeyDown:De(f.onKeyDown,T=>{const S=E.current!=="";!(T.ctrlKey||T.altKey||T.metaKey)&&T.key.length===1&&O(T.key),!(S&&T.key===" ")&&aC.includes(T.key)&&(C(),T.preventDefault())})})})},"SelectTrigger")),dC="SelectValue",mC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,className:u,style:f,children:m,placeholder:v="",...y}=o,p=Ia(dC,i),{onValueNodeHasChildrenChange:w}=p,g=m!==void 0,E=Xe(r,p.onValueNodeChange);at(()=>{w(g)},[w,g]);const O=Xi(p.value);return h.jsx(Ie.span,{...y,asChild:O?!1:y.asChild,ref:E,style:{pointerEvents:"none"},children:h.jsx(b.Fragment,{children:O?v:m},O?"placeholder":"value")})},"SelectValue")),hC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,children:u,...f}=o;return h.jsx(Ie.span,{"aria-hidden":!0,...f,ref:r,children:u||"▼"})},"SelectIcon")),pC="SelectPortal",[gC,vC]=Rl(pC,{forceMount:void 0}),yC=ze(l=>{const{__scopeSelect:o,forceMount:r,...i}=l;return h.jsx(gC,{scope:l.__scopeSelect,forceMount:r,children:h.jsx(od,{asChild:!0,...i})})},"SelectPortal"),Ol="SelectContent",bC=b.forwardRef(ze(function(o,r){const i=vC(Ol,o.__scopeSelect),{forceMount:u=i.forceMount,...f}=o,m=Ia(Ol,o.__scopeSelect),[v,y]=b.useState();return at(()=>{y(new DocumentFragment)},[]),h.jsx(jo,{present:u||m.open,children:({present:p})=>p?h.jsx(wC,{...f,ref:r}):h.jsx(xC,{...f,fragment:v})})},"SelectContent")),xC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,children:u,fragment:f}=o;return f?Ro.createPortal(h.jsx(Iy,{scope:i,children:h.jsx(Xs.Slot,{scope:i,children:h.jsx("div",{ref:r,children:u})})}),f):null},"SelectContentFragment")),Sn=10,[Iy,Nl]=Rl(Ol),SC=ua("SelectContent.RemoveScroll"),wC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i}=o,{position:u="item-aligned",onCloseAutoFocus:f,onEscapeKeyDown:m,onPointerDownOutside:v,side:y,sideOffset:p,align:w,alignOffset:g,arrowPadding:E,collisionBoundary:O,collisionPadding:A,sticky:C,hideWhenDetached:T,avoidCollisions:S,...D}=o,z=Ia(Ol,i),[k,I]=b.useState(null),[X,K]=b.useState(null),G=Xe(r,I),[ae,me]=b.useState(null),[ge,U]=b.useState(null),te=Qs(i),[fe,he]=b.useState(!1),j=b.useRef(!1);b.useEffect(()=>{if(k)return wy(k)},[k]),Ms();const Y=b.useCallback(ne=>{const[re,...Le]=te().map(He=>He.ref.current),[Ce]=Le.slice(-1),Te=document.activeElement;for(const He of ne)if(He===Te||(He?.scrollIntoView({block:"nearest"}),He===re&&X&&(X.scrollTop=0),He===Ce&&X&&(X.scrollTop=X.scrollHeight),He?.focus(),document.activeElement!==Te))return},[te,X]),F=b.useCallback(()=>Y([ae,k]),[Y,ae,k]);b.useEffect(()=>{fe&&F()},[fe,F]);const{onOpenChange:oe,triggerPointerDownPosRef:P}=z;b.useEffect(()=>{if(k){let ne={x:0,y:0};const re=ze(Ce=>{ne={x:Math.abs(Math.round(Ce.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(Ce.pageY)-(P.current?.y??0))}},"handlePointerMove"),Le=ze(Ce=>{ne.x<=10&&ne.y<=10?Ce.preventDefault():Ce.composedPath().includes(k)||oe(!1),document.removeEventListener("pointermove",re),P.current=null},"handlePointerUp");return P.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Le,{capture:!0})}}},[k,oe,P]),b.useEffect(()=>{const ne=ze(()=>oe(!1),"close");return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[oe]);const[R,V]=vd(ne=>{const re=te().filter(Te=>!Te.disabled),Le=re.find(Te=>Te.ref.current===document.activeElement),Ce=yd(re,ne,Le);Ce&&setTimeout(()=>Ce.ref.current?.focus())}),Z=b.useCallback((ne,re,Le)=>{const Ce=!j.current&&!Le;(z.value!==void 0&&z.value===re||Ce)&&(me(ne),Ce&&(j.current=!0))},[z.value]),W=b.useCallback(()=>k?.focus(),[k]),ee=b.useCallback((ne,re,Le)=>{const Ce=!j.current&&!Le;(z.value!==void 0&&z.value===re||Ce)&&U(ne)},[z.value]),ie=u==="popper"?tv:EC,ye=ie===tv?{side:y,sideOffset:p,align:w,alignOffset:g,arrowPadding:E,collisionBoundary:O,collisionPadding:A,sticky:C,hideWhenDetached:T,avoidCollisions:S}:{};return h.jsx(Iy,{scope:i,content:k,viewport:X,onViewportChange:K,itemRefCallback:Z,selectedItem:ae,onItemLeave:W,itemTextRefCallback:ee,focusSelectedItem:F,selectedItemText:ge,position:u,isPositioned:fe,searchRef:R,children:h.jsx(rd,{as:SC,allowPinchZoom:!0,children:h.jsx(ry,{asChild:!0,trapped:z.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:De(f,ne=>{z.trigger?.focus({preventScroll:!0}),ne.preventDefault()}),children:h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>z.onOpenChange(!1),children:h.jsx(ie,{role:"listbox",id:z.contentId,"data-state":z.open?"open":"closed",dir:z.dir,onContextMenu:ne=>ne.preventDefault(),...D,...ye,onPlaced:()=>he(!0),ref:G,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:De(D.onKeyDown,ne=>{const re=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!re&&ne.key.length===1&&V(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let Ce=te().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Te=ne.target,He=Ce.indexOf(Te);Ce=Ce.slice(He+1)}setTimeout(()=>Y(Ce)),ne.preventDefault()}})})})})})})},"SelectContentImpl")),EC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,onPlaced:u,...f}=o,m=Ia(Ol,i),v=Nl(Ol,i),[y,p]=b.useState(null),[w,g]=b.useState(null),E=Xe(r,g),O=Qs(i),A=b.useRef(!1),C=b.useRef(!0),{viewport:T,selectedItem:S,selectedItemText:D,focusSelectedItem:z}=v,k=b.useCallback(()=>{if(m.trigger&&m.valueNode&&y&&w&&T&&S&&D){const G=m.trigger.getBoundingClientRect(),ae=w.getBoundingClientRect(),me=m.valueNode.getBoundingClientRect(),ge=D.getBoundingClientRect();if(m.dir!=="rtl"){const Te=ge.left-ae.left,He=me.left-Te,Ze=G.left-He,dt=G.width+Ze,Cn=Math.max(dt,ae.width),pn=window.innerWidth-Sn,Bn=Xf(He,[Sn,Math.max(Sn,pn-Cn)]);y.style.minWidth=dt+"px",y.style.left=Bn+"px"}else{const Te=ae.right-ge.right,He=window.innerWidth-me.right-Te,Ze=window.innerWidth-G.right-He,dt=G.width+Ze,Cn=Math.max(dt,ae.width),pn=window.innerWidth-Sn,Bn=Xf(He,[Sn,Math.max(Sn,pn-Cn)]);y.style.minWidth=dt+"px",y.style.right=Bn+"px"}const U=O(),te=window.innerHeight-Sn*2,fe=T.scrollHeight,he=window.getComputedStyle(w),j=parseInt(he.borderTopWidth,10),Y=parseInt(he.paddingTop,10),F=parseInt(he.borderBottomWidth,10),oe=parseInt(he.paddingBottom,10),P=j+Y+fe+oe+F,R=Math.min(S.offsetHeight*5,P),V=window.getComputedStyle(T),Z=parseInt(V.paddingTop,10),W=parseInt(V.paddingBottom,10),ee=G.top+G.height/2-Sn,ie=te-ee,ye=S.offsetHeight/2,ne=S.offsetTop+ye,re=j+Y+ne,Le=P-re;if(re<=ee){const Te=U.length>0&&S===U[U.length-1].ref.current;y.style.bottom="0px";const He=w.clientHeight-T.offsetTop-T.offsetHeight,Ze=Math.max(ie,ye+(Te?W:0)+He+F),dt=re+Ze;y.style.height=dt+"px"}else{const Te=U.length>0&&S===U[0].ref.current;y.style.top="0px";const Ze=Math.max(ee,j+T.offsetTop+(Te?Z:0)+ye)+Le;y.style.height=Ze+"px",T.scrollTop=re-ee+T.offsetTop}y.style.margin=`${Sn}px 0`,y.style.minHeight=R+"px",y.style.maxHeight=te+"px",u?.(),requestAnimationFrame(()=>A.current=!0)}},[O,m.trigger,m.valueNode,y,w,T,S,D,m.dir,u]);at(()=>k(),[k]);const[I,X]=b.useState();at(()=>{w&&X(window.getComputedStyle(w).zIndex)},[w]);const K=b.useCallback(G=>{G&&C.current===!0&&(k(),z?.(),C.current=!1)},[k,z]);return h.jsx(CC,{scope:i,contentWrapper:y,shouldExpandOnScrollRef:A,onScrollButtonChange:K,children:h.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:h.jsx(Ie.div,{...f,ref:E,style:{boxSizing:"border-box",maxHeight:"100%",...f.style}})})})},"SelectItemAlignedPosition")),tv=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,align:u="start",collisionPadding:f=Sn,...m}=o,v=pd(i);return h.jsx($y,{...v,...m,ref:r,align:u,collisionPadding:f,style:{boxSizing:"border-box",...m.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[CC,gd]=Rl(Ol,{}),nv="SelectViewport",TC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,nonce:u,...f}=o,m=Nl(nv,i),v=gd(nv,i),y=Xe(r,m.onViewportChange),p=b.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),h.jsx(Xs.Slot,{scope:i,children:h.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...f,ref:y,style:{position:"relative",flex:1,overflow:"hidden auto",...f.style},onScroll:De(f.onScroll,w=>{const g=w.currentTarget,{contentWrapper:E,shouldExpandOnScrollRef:O}=v;if(O?.current&&E){const A=Math.abs(p.current-g.scrollTop);if(A>0){const C=window.innerHeight-Sn*2,T=parseFloat(E.style.minHeight),S=parseFloat(E.style.height),D=Math.max(T,S);if(D0?I:0,E.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),AC="SelectGroup",[qA,YA]=Rl(AC),Qf="SelectItem",[_C,Fy]=Rl(Qf),OC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,value:u,disabled:f=!1,textValue:m,...v}=o,y=Ia(Qf,i),p=Nl(Qf,i),w=y.value===u,[g,E]=b.useState(m??""),[O,A]=b.useState(!1),C=kn(k=>p.itemRefCallback?.(k,u,f)),T=Xe(r,C),S=Tl(),D=b.useRef("touch"),z=ze(()=>{f||(y.onValueChange(u),y.onOpenChange(!1))},"handleSelect");return h.jsx(_C,{scope:i,value:u,disabled:f,textId:S,isSelected:w,onItemTextChange:b.useCallback(k=>{E(I=>I||(k?.textContent??"").trim())},[]),children:h.jsx(Xs.ItemSlot,{scope:i,value:u,disabled:f,textValue:g,children:h.jsx(Ie.div,{role:"option","aria-labelledby":S,"data-highlighted":O?"":void 0,"aria-selected":w&&O,"data-state":w?"checked":"unchecked","aria-disabled":f||void 0,"data-disabled":f?"":void 0,tabIndex:f?void 0:-1,...v,ref:T,onFocus:De(v.onFocus,()=>A(!0)),onBlur:De(v.onBlur,()=>A(!1)),onClick:De(v.onClick,()=>{D.current!=="mouse"&&z()}),onPointerUp:De(v.onPointerUp,()=>{D.current==="mouse"&&z()}),onPointerDown:De(v.onPointerDown,k=>{D.current=k.pointerType}),onPointerMove:De(v.onPointerMove,k=>{D.current=k.pointerType,f?p.onItemLeave?.():D.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:De(v.onPointerLeave,k=>{k.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:De(v.onKeyDown,k=>{f||k.target!==k.currentTarget||p.searchRef?.current!==""&&k.key===" "||(lC.includes(k.key)&&z(),k.key===" "&&k.preventDefault())})})})})},"SelectItem")),hs="SelectItemText",RC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,className:u,style:f,...m}=o,v=Ia(hs,i),y=Nl(hs,i),p=Fy(hs,i),w=sC(hs,i),[g,E]=b.useState(null),O=kn(z=>y.itemTextRefCallback?.(z,p.value,p.disabled)),A=Xe(r,E,p.onItemTextChange,O),C=g?.textContent,T=b.useMemo(()=>h.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:S,onNativeOptionRemove:D}=w;return at(()=>(S(T),()=>D(T)),[S,D,T]),h.jsxs(h.Fragment,{children:[h.jsx(Ie.span,{id:p.textId,...m,ref:A}),p.isSelected&&v.valueNode&&!v.valueNodeHasChildren&&!Xi(v.value)?Ro.createPortal(m.children,v.valueNode):null]})},"SelectItemText")),NC="SelectItemIndicator",jC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,...u}=o;return Fy(NC,i).isSelected?h.jsx(Ie.span,{"aria-hidden":!0,...u,ref:r}):null},"SelectItemIndicator")),av="SelectScrollUpButton",DC=b.forwardRef(ze(function(o,r){const i=Nl(av,o.__scopeSelect),u=gd(av,o.__scopeSelect),[f,m]=b.useState(!1),v=Xe(r,u.onScrollButtonChange);return at(()=>{if(i.viewport&&i.isPositioned){let y=function(){const w=p.scrollTop>0;m(w)};ze(y,"handleScroll");const p=i.viewport;return y(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,i.isPositioned]),f?h.jsx(Wy,{...o,ref:v,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=i;y&&p&&(y.scrollTop=y.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),lv="SelectScrollDownButton",zC=b.forwardRef(ze(function(o,r){const i=Nl(lv,o.__scopeSelect),u=gd(lv,o.__scopeSelect),[f,m]=b.useState(!1),v=Xe(r,u.onScrollButtonChange);return at(()=>{if(i.viewport&&i.isPositioned){let y=function(){const w=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",y)}},[i.viewport,i.isPositioned]),f?h.jsx(Wy,{...o,ref:v,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=i;y&&p&&(y.scrollTop=y.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),Wy=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,onAutoScroll:u,...f}=o,m=Nl("SelectScrollButton",i),v=b.useRef(null),y=Qs(i),p=b.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null)},[]);return b.useEffect(()=>()=>p(),[p]),at(()=>{y().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[y]),h.jsx(Ie.div,{"aria-hidden":!0,...f,ref:r,style:{flexShrink:0,...f.style},onPointerDown:De(f.onPointerDown,()=>{v.current===null&&(v.current=window.setInterval(u,50))}),onPointerMove:De(f.onPointerMove,()=>{m.onItemLeave?.(),v.current===null&&(v.current=window.setInterval(u,50))}),onPointerLeave:De(f.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),MC="SelectBubbleInput",UC=b.forwardRef(ze(function({__scopeSelect:o,...r},i){const u=Ia(MC,o),{value:f,onValueChange:m,required:v,disabled:y,name:p,autoComplete:w,form:g}=u,{nativeOptions:E,nativeSelectKey:O}=u,A=b.useRef(null),C=Xe(i,A),T=f??"",S=Py(T),D=Array.from(E).some(z=>(z.props.value??"")==="");return b.useEffect(()=>{const z=A.current;if(!z)return;const k=window.HTMLSelectElement.prototype,X=Object.getOwnPropertyDescriptor(k,"value").set;if(S!==T&&X){const K=new Event("change",{bubbles:!0});X.call(z,T),z.dispatchEvent(K)}},[S,T]),h.jsxs(Ie.select,{"aria-hidden":!0,required:v,tabIndex:-1,name:p,autoComplete:w,disabled:y,form:g,onChange:z=>m(z.target.value),...r,style:{...Bv,...r.style},ref:C,defaultValue:T,children:[Xi(f)&&!D?h.jsx("option",{value:""}):null,Array.from(E)]},O)},"SelectBubbleInput"));function e0(l){return typeof l=="function"}ze(e0,"isFunction");function Xi(l){return l===""||l===void 0}ze(Xi,"shouldShowPlaceholder");function vd(l){const o=kn(l),r=b.useRef(""),i=b.useRef(0),u=b.useCallback(m=>{const v=r.current+m;o(v),ze((function y(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>y(""),1e3))}),"updateSearch")(v)},[o]),f=b.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,u,f]}ze(vd,"useTypeaheadSearch");function yd(l,o,r){const u=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,f=r?l.indexOf(r):-1;let m=t0(l,Math.max(f,0));u.length===1&&(m=m.filter(p=>p!==r));const y=m.find(p=>p.textValue.toLowerCase().startsWith(u.toLowerCase()));return y!==r?y:void 0}ze(yd,"findNextItem");function t0(l,o){return l.map((r,i)=>l[(o+i)%l.length])}ze(t0,"wrapArray");var kC=Object.defineProperty,ft=(l,o)=>kC(l,"name",{value:o,configurable:!0}),[bd,VA]=Pa("Tooltip",[Vs]),Zs=Vs(),LC="TooltipProvider",HC=700,Zf="tooltip.open",[BC,xd]=bd(LC),qC=ft(l=>{const{__scopeTooltip:o,delayDuration:r=HC,skipDelayDuration:i=300,disableHoverableContent:u=!1,children:f}=l,m=b.useRef(!0),v=b.useRef(!1),y=b.useRef(0);return b.useEffect(()=>{const p=y.current;return()=>window.clearTimeout(p)},[]),h.jsx(BC,{scope:o,isOpenDelayedRef:m,delayDuration:r,onOpen:b.useCallback(()=>{i<=0||(window.clearTimeout(y.current),m.current=!1)},[i]),onClose:b.useCallback(()=>{i<=0||(window.clearTimeout(y.current),y.current=window.setTimeout(()=>m.current=!0,i))},[i]),isPointerInTransitRef:v,onPointerInTransitChange:b.useCallback(p=>{v.current=p},[]),disableHoverableContent:u,children:f})},"TooltipProvider"),Kf="Tooltip",[YC,Qi]=bd(Kf),VC=ft(l=>{const{__scopeTooltip:o,children:r,open:i,defaultOpen:u,onOpenChange:f,disableHoverableContent:m,delayDuration:v}=l,y=xd(Kf,l.__scopeTooltip),p=Zs(o),[w,g]=b.useState(null),[E,O]=b.useState(void 0),A=Tl(),C=b.useRef(0),T=m??y.disableHoverableContent,S=v??y.delayDuration,D=b.useRef(!1),[z,k]=ki({prop:i,defaultProp:u??!1,onChange:ft(me=>{me?(y.onOpen(),document.dispatchEvent(new CustomEvent(Zf))):y.onClose(),f?.(me)},"onChange"),caller:Kf}),I=b.useMemo(()=>z?D.current?"delayed-open":"instant-open":"closed",[z]),X=b.useCallback(()=>{window.clearTimeout(C.current),C.current=0,D.current=!1,k(!0)},[k]),K=b.useCallback(()=>{window.clearTimeout(C.current),C.current=0,k(!1)},[k]),G=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{D.current=!0,k(!0),C.current=0},S)},[S,k]);b.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]);const ae=E??A;return h.jsx(Zy,{...p,children:h.jsx(YC,{scope:o,contentId:ae,setContentId:O,open:z,stateAttribute:I,trigger:w,onTriggerChange:g,onTriggerEnter:b.useCallback(()=>{y.isOpenDelayedRef.current?G():X()},[y.isOpenDelayedRef,G,X]),onTriggerLeave:b.useCallback(()=>{T?K():(window.clearTimeout(C.current),C.current=0)},[K,T]),onOpen:X,onClose:K,disableHoverableContent:T,children:r})})},"Tooltip"),ov="TooltipTrigger",GC=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,...u}=o,f=Qi(ov,i),m=xd(ov,i),v=Zs(i),y=b.useRef(null),p=Xe(r,y,f.onTriggerChange),w=b.useRef(!1),g=b.useRef(!1),E=b.useCallback(()=>w.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",E),[E]),h.jsx(Ky,{asChild:!0,...v,children:h.jsx(Ie.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...u,ref:p,onPointerMove:De(o.onPointerMove,O=>{O.pointerType!=="touch"&&!g.current&&!m.isPointerInTransitRef.current&&(f.onTriggerEnter(),g.current=!0)}),onPointerLeave:De(o.onPointerLeave,()=>{f.onTriggerLeave(),g.current=!1}),onPointerDown:De(o.onPointerDown,()=>{f.open&&f.onClose(),w.current=!0,document.addEventListener("pointerup",E,{once:!0})}),onFocus:De(o.onFocus,()=>{w.current||f.onOpen()}),onBlur:De(o.onBlur,f.onClose),onClick:De(o.onClick,f.onClose)})})},"TooltipTrigger")),n0="TooltipPortal",[XC,QC]=bd(n0,{forceMount:void 0}),ZC=ft(l=>{const{__scopeTooltip:o,forceMount:r,children:i,container:u}=l,f=Qi(n0,o);return h.jsx(XC,{scope:o,forceMount:r,children:h.jsx(jo,{present:r||f.open,children:h.jsx(od,{asChild:!0,container:u,children:i})})})},"TooltipPortal"),qi="TooltipContent",KC=b.forwardRef(ft(function(o,r){const i=QC(qi,o.__scopeTooltip),{forceMount:u=i.forceMount,side:f="top",...m}=o,v=Qi(qi,o.__scopeTooltip);return h.jsx(jo,{present:u||v.open,children:v.disableHoverableContent?h.jsx(a0,{side:f,...m,ref:r}):h.jsx($C,{side:f,...m,ref:r})})},"TooltipContent")),$C=b.forwardRef(ft(function(o,r){const i=Qi(qi,o.__scopeTooltip),u=xd(qi,o.__scopeTooltip),f=b.useRef(null),m=Xe(r,f),[v,y]=b.useState(null),{trigger:p,onClose:w}=i,g=f.current,{onPointerInTransitChange:E}=u,O=b.useCallback(()=>{y(null),E(!1)},[E]),A=b.useCallback((C,T)=>{const S=C.currentTarget,D={x:C.clientX,y:C.clientY},z=l0(D,S.getBoundingClientRect()),k=o0(D,z),I=i0(T.getBoundingClientRect()),X=s0([...k,...I]);y(X),E(!0)},[E]);return b.useEffect(()=>()=>O(),[O]),b.useEffect(()=>{if(p&&g){const C=ft(S=>A(S,g),"handleTriggerLeave"),T=ft(S=>A(S,p),"handleContentLeave");return p.addEventListener("pointerleave",C),g.addEventListener("pointerleave",T),()=>{p.removeEventListener("pointerleave",C),g.removeEventListener("pointerleave",T)}}},[p,g,A,O]),b.useEffect(()=>{if(v){const C=ft(T=>{const S=T.target,D={x:T.clientX,y:T.clientY},z=p?.contains(S)||g?.contains(S),k=!r0(D,v);z?O():k&&(O(),w())},"handleTrackPointerGrace");return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,g,v,w,O]),h.jsx(a0,{...o,ref:m})},"TooltipContentHoverable")),PC=zv("TooltipContent"),a0=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,children:u,"aria-label":f,id:m,onEscapeKeyDown:v,onPointerDownOutside:y,...p}=o,w=Qi(qi,i),g=Zs(i),{onClose:E}=w;b.useEffect(()=>(document.addEventListener(Zf,E),()=>document.removeEventListener(Zf,E)),[E]),b.useEffect(()=>{if(w.trigger){const A=ft(C=>{C.target instanceof Node&&C.target.contains(w.trigger)&&E()},"handleScroll");return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[w.trigger,E]);const{setContentId:O}=w;return at(()=>(O(m),()=>{O(void 0)}),[m,O]),h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:v,onPointerDownOutside:y,onFocusOutside:A=>A.preventDefault(),onDismiss:E,children:h.jsxs($y,{"data-state":w.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:w.contentId,...g,...p,ref:r,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(PC,{children:u}),f?h.jsx(bS,{id:w.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl")),JC=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,...u}=o,f=Zs(i);return h.jsx(KE,{...f,...u,ref:r})},"TooltipArrow"));function l0(l,o){const r=Math.abs(o.top-l.y),i=Math.abs(o.bottom-l.y),u=Math.abs(o.right-l.x),f=Math.abs(o.left-l.x);switch(Math.min(r,i,u,f)){case f:return"left";case u:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}ft(l0,"getExitSideFromRect");function o0(l,o,r=5){const i=[];switch(o){case"top":i.push({x:l.x-r,y:l.y+r},{x:l.x+r,y:l.y+r});break;case"bottom":i.push({x:l.x-r,y:l.y-r},{x:l.x+r,y:l.y-r});break;case"left":i.push({x:l.x+r,y:l.y-r},{x:l.x+r,y:l.y+r});break;case"right":i.push({x:l.x-r,y:l.y-r},{x:l.x-r,y:l.y+r});break}return i}ft(o0,"getPaddedExitPoints");function i0(l){const{top:o,right:r,bottom:i,left:u}=l;return[{x:u,y:o},{x:r,y:o},{x:r,y:i},{x:u,y:i}]}ft(i0,"getPointsFromRect");function r0(l,o){const{x:r,y:i}=l;let u=!1;for(let f=0,m=o.length-1;fi!=E>i&&r<(g-p)*(i-w)/(E-w)+p&&(u=!u)}return u}ft(r0,"isPointInPolygon");function s0(l){const o=l.slice();return o.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),c0(o)}ft(s0,"getHull");function c0(l){if(l.length<=1)return l.slice();const o=[];for(let i=0;i=2;){const f=o[o.length-1],m=o[o.length-2];if((f.x-m.x)*(u.y-m.y)>=(f.y-m.y)*(u.x-m.x))o.pop();else break}o.push(u)}o.pop();const r=[];for(let i=l.length-1;i>=0;i--){const u=l[i];for(;r.length>=2;){const f=r[r.length-1],m=r[r.length-2];if((f.x-m.x)*(u.y-m.y)>=(f.y-m.y)*(u.x-m.x))r.pop();else break}r.push(u)}return r.pop(),o.length===1&&r.length===1&&o[0].x===r[0].x&&o[0].y===r[0].y?o:o.concat(r)}ft(c0,"getHullPresorted");var IC=qC,FC=VC,WC=GC,eT=ZC,tT=KC,nT=JC;const aT=(l,o)=>{const r=new Array(l.length+o.length);for(let i=0;i({classGroupId:l,validator:o}),u0=(l=new Map,o=null,r)=>({nextPart:l,validators:o,classGroupId:r}),Ds="-",iv=[],oT="arbitrary..",iT=l=>{const o=sT(l),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=l;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return rT(m);const v=m.split(Ds),y=v[0]===""&&v.length>1?1:0;return f0(v,y,o)},getConflictingClassGroupIds:(m,v)=>{if(v){const y=i[m],p=r[m];return y?p?aT(p,y):y:p||iv}return r[m]||iv}}},f0=(l,o,r)=>{if(l.length-o===0)return r.classGroupId;const u=l[o],f=r.nextPart.get(u);if(f){const p=f0(l,o+1,f);if(p)return p}const m=r.validators;if(m===null)return;const v=o===0?l.join(Ds):l.slice(o).join(Ds),y=m.length;for(let p=0;pl.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=l.slice(1,-1),r=o.indexOf(":"),i=o.slice(0,r);return i?oT+i:void 0})(),sT=l=>{const{theme:o,classGroups:r}=l;return cT(r,o)},cT=(l,o)=>{const r=u0();for(const i in l){const u=l[i];Sd(u,r,i,o)}return r},Sd=(l,o,r,i)=>{const u=l.length;for(let f=0;f{if(typeof l=="string"){fT(l,o,r);return}if(typeof l=="function"){dT(l,o,r,i);return}mT(l,o,r,i)},fT=(l,o,r)=>{const i=l===""?o:d0(o,l);i.classGroupId=r},dT=(l,o,r,i)=>{if(hT(l)){Sd(l(i),o,r,i);return}o.validators===null&&(o.validators=[]),o.validators.push(lT(r,l))},mT=(l,o,r,i)=>{const u=Object.entries(l),f=u.length;for(let m=0;m{let r=l;const i=o.split(Ds),u=i.length;for(let f=0;f"isThemeGetter"in l&&l.isThemeGetter===!0,pT=l=>{if(l<1)return{get:()=>{},set:()=>{}};let o=0,r=Object.create(null),i=Object.create(null);const u=(f,m)=>{r[f]=m,o++,o>l&&(o=0,i=r,r=Object.create(null))};return{get(f){let m=r[f];if(m!==void 0)return m;if((m=i[f])!==void 0)return u(f,m),m},set(f,m){f in r?r[f]=m:u(f,m)}}},$f="!",rv=":",gT=[],sv=(l,o,r,i,u)=>({modifiers:l,hasImportantModifier:o,baseClassName:r,maybePostfixModifierPosition:i,isExternal:u}),vT=l=>{const{prefix:o,experimentalParseClassName:r}=l;let i=u=>{const f=[];let m=0,v=0,y=0,p;const w=u.length;for(let C=0;Cy?p-y:void 0;return sv(f,O,E,A)};if(o){const u=o+rv,f=i;i=m=>m.startsWith(u)?f(m.slice(u.length)):sv(gT,!1,m,void 0,!0)}if(r){const u=i;i=f=>r({className:f,parseClassName:u})}return i},yT=l=>{const o=new Map;return l.orderSensitiveModifiers.forEach((r,i)=>{o.set(r,1e6+i)}),r=>{const i=[];let u=[];for(let f=0;f0&&(u.sort(),i.push(...u),u=[]),i.push(m)):u.push(m)}return u.length>0&&(u.sort(),i.push(...u)),i}},bT=l=>({cache:pT(l.cacheSize),parseClassName:vT(l),sortModifiers:yT(l),postfixLookupClassGroupIds:xT(l),...iT(l)}),xT=l=>{const o=Object.create(null),r=l.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:u,sortModifiers:f,postfixLookupClassGroupIds:m}=o,v=[],y=l.trim().split(ST);let p="";for(let w=y.length-1;w>=0;w-=1){const g=y[w],{isExternal:E,modifiers:O,hasImportantModifier:A,baseClassName:C,maybePostfixModifierPosition:T}=r(g);if(E){p=g+(p.length>0?" "+p:p);continue}let S=!!T,D;if(S){const K=C.substring(0,T);D=i(K);const G=D&&m[D]?i(C):void 0;G&&G!==D&&(D=G,S=!1)}else D=i(C);if(!D){if(!S){p=g+(p.length>0?" "+p:p);continue}if(D=i(C),!D){p=g+(p.length>0?" "+p:p);continue}S=!1}const z=O.length===0?"":O.length===1?O[0]:f(O).join(":"),k=A?z+$f:z,I=k+D;if(v.indexOf(I)>-1)continue;v.push(I);const X=u(D,S);for(let K=0;K0?" "+p:p)}return p},ET=(...l)=>{let o=0,r,i,u="";for(;o{if(typeof l=="string")return l;let o,r="";for(let i=0;i{let r,i,u,f;const m=y=>{const p=o.reduce((w,g)=>g(w),l());return r=bT(p),i=r.cache.get,u=r.cache.set,f=v,v(y)},v=y=>{const p=i(y);if(p)return p;const w=wT(y,r);return u(y,w),w};return f=m,(...y)=>f(ET(...y))},TT=[],ut=l=>{const o=r=>r[l]||TT;return o.isThemeGetter=!0,o},h0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,p0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,AT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_T=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,RT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,NT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=l=>AT.test(l),Ae=l=>!!l&&!Number.isNaN(Number(l)),Dn=l=>!!l&&Number.isInteger(Number(l)),Cf=l=>l.endsWith("%")&&Ae(l.slice(0,-1)),oa=l=>_T.test(l),g0=()=>!0,DT=l=>OT.test(l)&&!RT.test(l),wd=()=>!1,zT=l=>NT.test(l),MT=l=>jT.test(l),UT=l=>!se(l)&&!ce(l),kT=l=>l.startsWith("@container")&&(l[10]==="/"&&l[11]!==void 0||l[11]==="s"&&l[16]!==void 0&&l.startsWith("-size/",10)||l[11]==="n"&&l[18]!==void 0&&l.startsWith("-normal/",10)),LT=l=>Fa(l,b0,wd),se=l=>h0.test(l),El=l=>Fa(l,x0,DT),cv=l=>Fa(l,QT,Ae),HT=l=>Fa(l,w0,g0),BT=l=>Fa(l,S0,wd),uv=l=>Fa(l,v0,wd),qT=l=>Fa(l,y0,MT),ps=l=>Fa(l,E0,zT),ce=l=>p0.test(l),Ni=l=>jl(l,x0),YT=l=>jl(l,S0),fv=l=>jl(l,v0),VT=l=>jl(l,b0),GT=l=>jl(l,y0),gs=l=>jl(l,E0,!0),XT=l=>jl(l,w0,!0),Fa=(l,o,r)=>{const i=h0.exec(l);return i?i[1]?o(i[1]):r(i[2]):!1},jl=(l,o,r=!1)=>{const i=p0.exec(l);return i?i[1]?o(i[1]):r:!1},v0=l=>l==="position"||l==="percentage",y0=l=>l==="image"||l==="url",b0=l=>l==="length"||l==="size"||l==="bg-size",x0=l=>l==="length",QT=l=>l==="number",S0=l=>l==="family-name",w0=l=>l==="number"||l==="weight",E0=l=>l==="shadow",ZT=()=>{const l=ut("color"),o=ut("font"),r=ut("text"),i=ut("font-weight"),u=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),v=ut("container"),y=ut("spacing"),p=ut("radius"),w=ut("shadow"),g=ut("inset-shadow"),E=ut("text-shadow"),O=ut("drop-shadow"),A=ut("blur"),C=ut("perspective"),T=ut("aspect"),S=ut("ease"),D=ut("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...k(),ce,se],X=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],G=()=>[ce,se,y],ae=()=>[Ga,"full","auto",...G()],me=()=>[Dn,"none","subgrid",ce,se],ge=()=>["auto",{span:["full",Dn,ce,se]},Dn,ce,se],U=()=>[Dn,"auto",ce,se],te=()=>["auto","min","max","fr",ce,se],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...G()],Y=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],F=()=>[Ga,"screen","full","dvw","lvw","svw","min","max","fit",...G()],oe=()=>[Ga,"screen","full","lh","dvh","lvh","svh","min","max","fit",...G()],P=()=>[l,ce,se],R=()=>[...k(),fv,uv,{position:[ce,se]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",VT,LT,{size:[ce,se]}],W=()=>[Cf,Ni,El],ee=()=>["","none","full",p,ce,se],ie=()=>["",Ae,Ni,El],ye=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ae,Cf,fv,uv],Le=()=>["","none",A,ce,se],Ce=()=>["none",Ae,ce,se],Te=()=>["none",Ae,ce,se],He=()=>[Ae,ce,se],Ze=()=>[Ga,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oa],breakpoint:[oa],color:[g0],container:[oa],"drop-shadow":[oa],ease:["in","out","in-out"],font:[UT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oa],shadow:[oa],spacing:["px",Ae],text:[oa],"text-shadow":[oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,se,ce,T]}],container:["container"],"container-type":[{"@container":["","normal","size",ce,se]}],"container-named":[kT],columns:[{columns:[Ae,se,ce,v]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",ce,se]}],basis:[{basis:[Ga,"full","auto",v,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,Ga,"auto","initial","none",se]}],grow:[{grow:["",Ae,ce,se]}],shrink:[{shrink:["",Ae,ce,se]}],order:[{order:[Dn,"first","last","none",ce,se]}],"grid-cols":[{"grid-cols":me()}],"col-start-end":[{col:ge()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":me()}],"row-start-end":[{row:ge()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pbs:[{pbs:G()}],pbe:[{pbe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...oe()]}],"min-block-size":[{"min-block":["auto",...oe()]}],"max-block-size":[{"max-block":["none",...oe()]}],w:[{w:[v,"screen",...Y()]}],"min-w":[{"min-w":[v,"screen","none",...Y()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[m]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",r,Ni,El]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,XT,HT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cf,se]}],"font-family":[{font:[YT,BT,o]}],"font-features":[{"font-features":[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,ce,se]}],"line-clamp":[{"line-clamp":[Ae,"none",ce,cv]}],leading:[{leading:[f,...G()]}],"list-image":[{"list-image":["none",ce,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",ce,El]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ae,"auto",ce,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"tab-size":[{tab:[Dn,ce,se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,ce,se],radial:["",ce,se],conic:[Dn,ce,se]},GT,qT]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,ce,se]}],"outline-w":[{outline:["",Ae,Ni,El]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",w,gs,ps]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",g,gs,ps]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ae,El]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",E,gs,ps]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ae,ce,se]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ce,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,se]}],filter:[{filter:["","none",ce,se]}],blur:[{blur:Le()}],brightness:[{brightness:[Ae,ce,se]}],contrast:[{contrast:[Ae,ce,se]}],"drop-shadow":[{"drop-shadow":["","none",O,gs,ps]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Ae,ce,se]}],"hue-rotate":[{"hue-rotate":[Ae,ce,se]}],invert:[{invert:["",Ae,ce,se]}],saturate:[{saturate:[Ae,ce,se]}],sepia:[{sepia:["",Ae,ce,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,se]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,ce,se]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,ce,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,ce,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,ce,se]}],"backdrop-invert":[{"backdrop-invert":["",Ae,ce,se]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,ce,se]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,ce,se]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,ce,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",ce,se]}],ease:[{ease:["linear","initial",S,ce,se]}],delay:[{delay:[Ae,ce,se]}],animate:[{animate:["none",D,ce,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ce,se]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[ce,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ze()}],"translate-x":[{"translate-x":Ze()}],"translate-y":[{"translate-y":Ze()}],"translate-z":[{"translate-z":Ze()}],"translate-none":["translate-none"],zoom:[{zoom:[Dn,ce,se]}],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mbs":[{"scroll-mbs":G()}],"scroll-mbe":[{"scroll-mbe":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pbs":[{"scroll-pbs":G()}],"scroll-pbe":[{"scroll-pbe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,se]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Ae,Ni,El,cv]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},KT=CT(ZT);function Se(...l){return KT(Rv(l))}const $T=Vi("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Cl({className:l,variant:o="default",asChild:r=!1,...i}){const u=r?jv:"span";return h.jsx(u,{"data-slot":"badge","data-variant":o,className:Se($T({variant:o}),l),...i})}const PT=Vi("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ct({className:l,variant:o="default",size:r="default",asChild:i=!1,...u}){const f=i?jv:"button";return h.jsx(f,{"data-slot":"button","data-variant":o,"data-size":r,className:Se(PT({variant:o,size:r,className:l})),...u})}function Ui({className:l,type:o,...r}){return h.jsx("input",{type:o,"data-slot":"input",className:Se("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",l),...r})}function JT({className:l,...o}){return h.jsx("div",{"data-slot":"table-container",tabIndex:0,role:"region","aria-label":"Feedback queue, scrollable",className:"relative w-full overflow-x-auto focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ring)]",children:h.jsx("table",{"data-slot":"table",className:Se("w-full caption-bottom text-sm",l),...o})})}function IT({className:l,...o}){return h.jsx("thead",{"data-slot":"table-header",className:Se("[&_tr]:border-b",l),...o})}function FT({className:l,...o}){return h.jsx("tbody",{"data-slot":"table-body",className:Se("[&_tr:last-child]:border-0",l),...o})}function vs({className:l,...o}){return h.jsx("tr",{"data-slot":"table-row",className:Se("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",l),...o})}function Xa({className:l,...o}){return h.jsx("th",{"data-slot":"table-head",className:Se("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...o})}function zn({className:l,...o}){return h.jsx("td",{"data-slot":"table-cell",className:Se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...o})}function WT({className:l,...o}){return h.jsx("caption",{"data-slot":"table-caption",className:Se("mt-4 text-sm text-muted-foreground",l),...o})}const eA=Vi("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Pf({className:l,variant:o,...r}){return h.jsx("div",{"data-slot":"alert",role:"alert",className:Se(eA({variant:o}),l),...r})}function Jf({className:l,...o}){return h.jsx("div",{"data-slot":"alert-title",className:Se("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",l),...o})}function If({className:l,...o}){return h.jsx("div",{"data-slot":"alert-description",className:Se("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",l),...o})}function dv({className:l,...o}){return h.jsx("div",{"data-slot":"empty",className:Se("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",l),...o})}function mv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-header",className:Se("flex max-w-sm flex-col items-center gap-2 text-center",l),...o})}function hv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-title",className:Se("text-lg font-medium tracking-tight",l),...o})}function pv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-description",className:Se("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",l),...o})}function To({className:l,...o}){return h.jsx("div",{"data-slot":"skeleton",className:Se("animate-pulse rounded-md bg-accent",l),...o})}function tA({delayDuration:l=0,...o}){return h.jsx(IC,{"data-slot":"tooltip-provider",delayDuration:l,...o})}function gv({...l}){return h.jsx(FC,{"data-slot":"tooltip",...l})}function vv({...l}){return h.jsx(WC,{"data-slot":"tooltip-trigger",...l})}function yv({className:l,sideOffset:o=0,children:r,...i}){return h.jsx(eT,{children:h.jsxs(tT,{"data-slot":"tooltip-content",sideOffset:o,className:Se("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",l),...i,children:[r,h.jsx(nT,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const ys=1e3;function Ff(l){const o=new Date(l).getTime();if(Number.isNaN(o))return"—";const r=Math.max(0,Math.round((Date.now()-o)/6e4));if(r<1)return"just now";if(r<60)return`${r}m`;const i=Math.round(r/60);if(i<24)return`${i}h`;const u=Math.round(i/24);return u<30?`${u}d`:`${Math.round(u/30)}mo`}function nA(){const l=new URLSearchParams(window.location.search),o=r=>l.get(r)??void 0;return{project:o("project"),status:o("status"),type:o("type"),severity:o("severity"),assignee_agent:o("assignee_agent")}}function aA(){return new URLSearchParams(window.location.search).get("q")??""}let bv;function lA(l,o){clearTimeout(bv),bv=setTimeout(()=>{try{oA(l,o)}catch{}},150)}function oA(l,o){const r=new URLSearchParams;for(const[u,f]of Object.entries(l))f&&r.set(u,f);o.trim()&&r.set("q",o.trim());const i=r.toString();window.history.replaceState({},"",i?`/queue?${i}`:"/queue")}function iA(){const[l,o]=b.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches);return b.useEffect(()=>{const r=window.matchMedia("(min-width: 1024px)"),i=()=>o(r.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),l}function rA({navigate:l,themeToggle:o}){const[r,i]=b.useState(nA),[u,f]=b.useState([]),[m,v]=b.useState(aA),[y,p]=b.useState(!0),[w,g]=b.useState(null);b.useEffect(()=>{p(!0),Qa.list({project:r.project},ys).then(S=>{f(S.items),g(null)}).catch(S=>g(S.message)).finally(()=>p(!1))},[r.project]),b.useEffect(()=>lA(r,m),[r,m]),b.useEffect(()=>{const D=setInterval(()=>{document.hidden||Qa.list({project:r.project},ys).then(z=>f(z.items)).catch(()=>{})},1e4);return()=>clearInterval(D)},[r.project]);const E=b.useMemo(()=>{const S=new Map;for(const D of u)S.set(D.status,(S.get(D.status)??0)+1);return S},[u]),O=b.useMemo(()=>{const S=m.trim().toLowerCase();return u.filter(D=>(!r.status||D.status===r.status)&&(!r.type||D.type===r.type)&&(!r.severity||D.severity===r.severity)&&(!r.assignee_agent||D.assignee_agent===r.assignee_agent)&&(!S||D.title.toLowerCase().includes(S)||D.body.toLowerCase().includes(S)||D.id.toLowerCase().includes(S)))},[u,r,m]),A=(S,D)=>i(z=>({...z,[S]:z[S]===D?void 0:D})),C=Object.entries(r).filter(([,S])=>S),T=iA();return h.jsxs(h.Fragment,{children:[h.jsxs("header",{className:"flex min-w-0 flex-wrap items-baseline gap-3",children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:h.jsxs("span",{className:"break-all",children:["Loopback queue",r.project?` — ${r.project}`:""]})}),h.jsx("span",{className:"text-sm text-muted-foreground",role:"status","aria-live":"polite",children:y?"Loading feedback…":`${O.length}${O.length!==u.length?` of ${u.length}`:""} item${O.length===1?"":"s"}${u.length===ys?` (first ${ys})`:""}`}),h.jsxs("div",{className:"ml-auto flex w-full min-w-0 flex-1 basis-full items-center justify-end gap-2 sm:w-auto sm:min-w-56 sm:basis-auto",children:[h.jsx(Ui,{value:m,onChange:S=>v(S.target.value),placeholder:"Search title, body, id…","aria-label":"Search feedback",className:"h-11 w-full min-w-0 sm:w-56"}),o]})]}),h.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Something wrong or clumsy on ",h.jsx("em",{children:"this"})," page? Pin it — feedback about Loopback files to the ",h.jsx("code",{className:"font-mono text-xs",children:"loopback"})," ","project, the same loop everything else uses."]}),h.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[_v.filter(S=>E.get(S)).map(S=>h.jsxs(gv,{children:[h.jsx(vv,{asChild:!0,children:h.jsx("button",{onClick:()=>A("status",S),"aria-pressed":r.status===S,"aria-label":`${E.get(S)} ${S}. ${r.status===S?"Clear this filter":`Show only ${S} items`}`,className:"inline-flex h-11 items-center rounded-md px-1",children:h.jsxs(Cl,{className:`${Es[S]} pointer-events-none transition ${r.status===S?"ring-2 ring-ring ring-offset-1 ring-offset-background":"hover:opacity-85"}`,children:[E.get(S)," ",S]})})}),h.jsx(yv,{children:r.status===S?"Clear this filter":`Show only ${S}`})]},S)),C.length>0&&h.jsxs("div",{className:"ml-1 flex flex-wrap items-center gap-1.5 text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"·"}),C.map(([S,D])=>h.jsxs(gv,{children:[h.jsx(vv,{asChild:!0,children:h.jsx("button",{onClick:()=>i(z=>({...z,[S]:void 0})),"aria-label":`${S.replace("_agent","")}: ${D} — remove this filter`,className:"inline-flex h-11 min-w-0 max-w-full items-center rounded-md px-1",children:h.jsxs(Cl,{variant:"outline",className:"pointer-events-none min-w-0 max-w-full gap-1 whitespace-normal",children:[h.jsxs("span",{className:"min-w-0 break-all",children:[S.replace("_agent",""),": ",h.jsx("strong",{children:D})]}),h.jsx(O1,{className:"size-3 shrink-0"})]})})}),h.jsx(yv,{children:"Remove this filter"})]},S)),h.jsx("button",{onClick:()=>{i({}),v("")},"aria-label":"Clear all filters and search",className:"inline-flex h-11 items-center rounded-md px-1",children:h.jsx(Cl,{variant:"outline",className:"pointer-events-none",children:"clear all"})})]})]}),w&&h.jsxs(Pf,{variant:"destructive",className:"mt-6",children:[h.jsx(Jf,{children:"Could not reach the hub"}),h.jsx(If,{children:w})]}),!T&&h.jsxs("div",{className:"mt-4 grid gap-2",children:[y&&Array.from({length:4},(S,D)=>h.jsx(To,{className:"h-24 w-full rounded-lg"},`msk-${D}`)),!y&&O.map(S=>h.jsxs("button",{onClick:()=>l(`/queue/${encodeURIComponent(S.id)}`),className:"grid min-w-0 gap-1.5 rounded-lg border p-3 text-left hover:bg-muted/50 [&>*]:min-w-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Cl,{className:Es[S.status],children:S.status}),h.jsx("span",{className:`font-mono text-xs ${Of[S.severity]} ${Rf[S.severity]}`,children:S.severity}),h.jsx("span",{className:"text-xs text-muted-foreground",children:S.type}),(S.attachments?.length??0)>0&&h.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(Af,{className:"size-3","aria-hidden":!0}),h.jsx("span",{className:"sr-only",children:"Attachments:"}),S.attachments?.length]})]}),h.jsx("div",{className:"font-medium break-all",children:S.title}),h.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground",children:[h.jsx("span",{className:"break-all",children:S.project}),h.jsx("span",{"aria-hidden":!0,children:"·"}),h.jsx("span",{children:Ff(S.created_at)}),S.assignee_agent&&h.jsxs(h.Fragment,{children:[h.jsx("span",{"aria-hidden":!0,children:"·"}),h.jsx("span",{className:"break-all",children:S.assignee_agent})]})]})]},S.id)),!y&&O.length===0&&h.jsx(dv,{className:"border",children:h.jsxs(mv,{children:[h.jsx(hv,{children:C.length>0||m?"Nothing matches":"The queue is empty"}),h.jsx(pv,{children:C.length>0||m?"No item matches the current filters.":"Pin something with the widget and it lands here."})]})})]}),T&&h.jsx("div",{className:"mt-4 rounded-lg border",children:h.jsxs(JT,{children:[h.jsx(WT,{className:"mt-3 text-xs",children:"Click a row to open it. Filters live in the URL — this view is linkable."}),h.jsx(IT,{children:h.jsxs(vs,{children:[h.jsx(Xa,{children:"id"}),h.jsx(Xa,{children:"project"}),h.jsx(Xa,{children:"sev / type"}),h.jsx(Xa,{children:"title"}),h.jsx(Xa,{children:"age"}),h.jsx(Xa,{children:"status"}),h.jsx(Xa,{children:"assignee"}),h.jsx(Xa,{children:"change"})]})}),h.jsxs(FT,{children:[y&&Array.from({length:5},(S,D)=>h.jsx(vs,{children:h.jsx(zn,{colSpan:8,children:h.jsx(To,{className:"h-5 w-full"})})},`sk-${D}`)),!y&&O.length===0&&h.jsx(vs,{children:h.jsx(zn,{colSpan:8,children:h.jsxs(dv,{className:"border-0 bg-transparent",children:[h.jsxs(mv,{children:[h.jsx(hv,{children:C.length>0||m?"Nothing matches":"The queue is empty"}),h.jsx(pv,{children:C.length>0||m?"No item matches the current filters.":"Pin something with the widget and it lands here."})]}),(C.length>0||m)&&h.jsx(Ct,{variant:"outline",size:"sm",onClick:()=>{i({}),v("")},children:"Clear filters"})]})})}),O.map(S=>h.jsxs(vs,{className:"cursor-pointer",onClick:()=>l(`/queue/${encodeURIComponent(S.id)}`),children:[h.jsx(zn,{children:h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 font-mono text-xs",onClick:D=>{D.stopPropagation(),l(`/queue/${encodeURIComponent(S.id)}`)},children:S.id})}),h.jsx(zn,{children:h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 text-sm","aria-pressed":r.project===S.project,"aria-label":`Filter by project ${S.project}`,onClick:D=>{D.stopPropagation(),A("project",S.project)},children:S.project})}),h.jsxs(zn,{className:"whitespace-nowrap",children:[h.jsx(Ct,{variant:"link",className:`h-auto min-h-6 min-w-6 p-0 font-mono text-xs ${Of[S.severity]} ${Rf[S.severity]}`,"aria-pressed":r.severity===S.severity,"aria-label":`Filter by severity ${S.severity}`,onClick:D=>{D.stopPropagation(),A("severity",S.severity)},children:S.severity})," ",h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 text-xs text-muted-foreground","aria-pressed":r.type===S.type,"aria-label":`Filter by type ${S.type}`,onClick:D=>{D.stopPropagation(),A("type",S.type)},children:S.type})]}),h.jsxs(zn,{className:"min-w-[16rem] font-medium break-all whitespace-normal",children:[S.title,(S.attachments?.length??0)>0&&h.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(Af,{className:"size-3","aria-hidden":!0}),h.jsx("span",{className:"sr-only",children:"Attachments:"}),S.attachments?.length]})]}),h.jsx(zn,{className:"whitespace-nowrap text-sm text-muted-foreground",children:h.jsx("time",{dateTime:S.created_at,children:Ff(S.created_at)})}),h.jsx(zn,{children:h.jsx(Cl,{asChild:!0,className:`${Es[S.status]} min-h-6 cursor-pointer`,children:h.jsx("button",{"aria-pressed":r.status===S.status,"aria-label":`Filter by status ${S.status}`,onClick:D=>{D.stopPropagation(),A("status",S.status)},children:S.status})})}),h.jsx(zn,{className:"text-sm",children:S.assignee_agent??h.jsx("span",{className:"text-muted-foreground",children:"—"})}),h.jsx(zn,{className:"text-sm",children:Za(S.links.pr_url)?h.jsx("a",{href:Za(S.links.pr_url)??void 0,onClick:D=>D.stopPropagation(),target:"_blank",rel:"noreferrer noopener",className:"inline-flex min-h-6 min-w-6 items-center justify-center underline",children:"PR"}):S.links.commit?h.jsx("code",{className:"font-mono text-xs",children:S.links.commit.slice(0,9)}):h.jsx("span",{className:"text-muted-foreground",children:"—"})})]},S.id))]})]})})]})}function ji({className:l,...o}){return h.jsx("div",{"data-slot":"card",className:Se("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",l),...o})}function xv({className:l,...o}){return h.jsx("textarea",{"data-slot":"textarea",className:Se("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",l),...o})}function bs({...l}){return h.jsx(cC,{"data-slot":"select",...l})}function xs({...l}){return h.jsx(mC,{"data-slot":"select-value",...l})}function Ss({className:l,size:o="default",children:r,...i}){return h.jsxs(fC,{"data-slot":"select-trigger","data-size":o,className:Se("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground 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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",l),...i,children:[r,h.jsx(hC,{asChild:!0,children:h.jsx(Av,{className:"size-4 opacity-50"})})]})}function ws({className:l,children:o,position:r="item-aligned",align:i="center",...u}){return h.jsx(yC,{children:h.jsxs(bC,{"data-slot":"select-content",className:Se("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 bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",r==="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",l),position:r,align:i,...u,children:[h.jsx(sA,{}),h.jsx(TC,{className:Se("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),h.jsx(cA,{})]})})}function Di({className:l,children:o,...r}){return h.jsxs(OC,{"data-slot":"select-item",className:Se("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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",l),...r,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(jC,{children:h.jsx(n1,{className:"size-4"})})}),h.jsx(RC,{children:o})]})}function sA({className:l,...o}){return h.jsx(DC,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",l),...o,children:h.jsx(o1,{className:"size-4"})})}function cA({className:l,...o}){return h.jsx(zC,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",l),...o,children:h.jsx(Av,{className:"size-4"})})}const C0="lb-author";function T0(){try{return localStorage.getItem(C0)}catch{return null}}function uA(l){try{localStorage.setItem(C0,l)}catch{}}const fA="unknown-human";function dA(){return T0()?.trim()||fA}function Sv(l){const o=l.trim().slice(0,40);o&&uA(o)}function mA(){return!!T0()?.trim()}function zi({className:l,...o}){return h.jsx(IE,{"data-slot":"label",className:Se("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",l),...o})}const hA=Vi("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-0 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function pA({className:l,state:o="done",size:r="default",orientation:i="horizontal",...u}){return h.jsx("div",{"data-slot":"attachment","data-state":o,"data-size":r,"data-orientation":i,className:Se(hA({size:r,orientation:i}),l),...u})}const gA=Vi("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function vA({className:l,variant:o="icon",...r}){return h.jsx("div",{"data-slot":"attachment-media","data-variant":o,className:Se(gA({variant:o}),l),...r})}function yA({className:l,...o}){return h.jsx("div",{"data-slot":"attachment-content",className:Se("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",l),...o})}function bA({className:l,...o}){return h.jsx("span",{"data-slot":"attachment-title",className:Se("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",l),...o})}function xA({className:l,...o}){return h.jsx("span",{"data-slot":"attachment-description",className:Se("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",l),...o})}function SA({className:l,...o}){return h.jsx("div",{"data-slot":"attachment-actions",className:Se("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",l),...o})}function wA({className:l,variant:o,size:r="icon-xs",...i}){return h.jsx(Ct,{"data-slot":"attachment-action",variant:o??"ghost",size:r,className:Se(l),...i})}function EA({...l}){return h.jsx(p2,{"data-slot":"alert-dialog",...l})}function CA({...l}){return h.jsx(g2,{"data-slot":"alert-dialog-trigger",...l})}function TA({...l}){return h.jsx(v2,{"data-slot":"alert-dialog-portal",...l})}function AA({className:l,...o}){return h.jsx(y2,{"data-slot":"alert-dialog-overlay",className:Se("fixed inset-0 z-50 bg-[color-mix(in_oklch,var(--lb-scrim)_60%,transparent)] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",l),...o})}function _A({className:l,size:o="default",...r}){return h.jsxs(TA,{children:[h.jsx(AA,{}),h.jsx(b2,{"data-slot":"alert-dialog-content","data-size":o,className:Se("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",l),...r})]})}function OA({className:l,...o}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:Se("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",l),...o})}function RA({className:l,...o}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:Se("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",l),...o})}function NA({className:l,...o}){return h.jsx(w2,{"data-slot":"alert-dialog-title",className:Se("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",l),...o})}function jA({className:l,...o}){return h.jsx(E2,{"data-slot":"alert-dialog-description",className:Se("text-sm text-muted-foreground",l),...o})}function DA({className:l,variant:o="default",size:r="default",...i}){return h.jsx(Ct,{variant:o,size:r,asChild:!0,children:h.jsx(x2,{"data-slot":"alert-dialog-action",className:Se(l),...i})})}function zA({className:l,variant:o="outline",size:r="default",...i}){return h.jsx(Ct,{variant:o,size:r,asChild:!0,children:h.jsx(S2,{"data-slot":"alert-dialog-cancel",className:Se(l),...i})})}const Mi=()=>dA(),zs="text-[11px] font-medium text-muted-foreground";function gt({label:l,children:o,region:r}){return r?h.jsxs("section",{className:"grid min-w-0 gap-1.5","aria-label":l,children:[h.jsx("h2",{className:zs,children:l}),h.jsx("div",{className:"min-w-0",children:o})]}):h.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[h.jsx("span",{className:zs,children:l}),h.jsx("div",{className:"min-w-0",children:o})]})}const Tf=({children:l,label:o})=>h.jsx("pre",{tabIndex:0,role:"group","aria-label":o,className:"mt-0.5 overflow-x-auto whitespace-pre-wrap rounded-md border bg-background p-2.5 font-mono text-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ring)]",children:l});function MA({id:l,navigate:o,themeToggle:r}){const[i,u]=b.useState(null),[f,m]=b.useState(null),[v,y]=b.useState(!1),[p,w]=b.useState({}),[g,E]=b.useState(""),[O,A]=b.useState(""),[C,T]=b.useState("reference"),[S,D]=b.useState(""),[z,k]=b.useState(!1),I=b.useRef(null),X=()=>{Qa.get(l).then(U=>{u(U),m(null)}).catch(U=>m(U.message))};if(b.useEffect(X,[l]),b.useEffect(()=>{const U=setInterval(()=>{!document.hidden&&!z&&!v&&X()},1e4);return()=>clearInterval(U)},[l,z,v]),f)return h.jsxs("div",{className:"grid gap-4",children:[h.jsxs("h1",{className:"text-xl font-semibold tracking-tight",children:["Could not load ",l]}),h.jsxs(Pf,{variant:"destructive",children:[h.jsx(Jf,{children:"The hub did not return this item"}),h.jsx(If,{children:f})]}),h.jsx(Ct,{variant:"outline",onClick:()=>o("/queue"),children:"Back to the queue"})]});if(!i)return h.jsxs("div",{className:"grid gap-4",children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Loading feedback item"}),h.jsxs("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:["Loading ",l,"…"]}),h.jsx(To,{className:"h-8 w-40"}),h.jsx(To,{className:"h-7 w-2/3"}),h.jsx(To,{className:"h-28 w-full"}),h.jsx(To,{className:"h-40 w-full"})]});const K=i.extra.failed_responses,G=i.extra.context,ae=async(U,te)=>{if(z)return;const fe=document.activeElement,he=fe?.closest("[data-slot=card], header"),j=te??fe?.closest("[data-lb-region]")?.getAttribute("data-lb-region")??null;k(!0);try{await U()}catch(Y){Sl.error(Y.message)}finally{k(!1),requestAnimationFrame(()=>{if(fe&&document.contains(fe)&&!fe.disabled){fe.focus();return}const oe=(j?document.querySelector(`[data-lb-region="${j}"]`):null)??(he&&document.contains(he)?he:null);oe&&(oe.setAttribute("tabindex","-1"),oe.focus({preventScroll:!0}))})}},me=()=>ae(async()=>{await Qa.update(l,{...p,author:Mi()}),Sl.success("Saved — the change is on the audit trail"),y(!1),w({}),X()},"detail-header"),ge=async U=>{if(C==="asset"&&!S.trim()){Sl.error("An asset needs a target path — where should it land in the repo?");return}return ae(async()=>{await Qa.attach(l,U,{intent:C,target:C==="asset"?S.trim():void 0,author:Mi()}),Sl.success(C==="asset"?`Attached as an asset — an agent will copy it to ${S.trim()}`:"Attached as reference — context for the fix"),D(""),X()})};return h.jsxs("div",{className:"grid min-w-0 gap-4 [&>*]:min-w-0",children:[h.jsxs("header",{"data-lb-region":"detail-header",className:"flex flex-wrap items-center gap-3",children:[h.jsxs(Ct,{variant:"ghost",size:"sm",className:"h-11",onClick:()=>o("/queue"),children:[h.jsx(e1,{className:"size-4"})," Queue"]}),h.jsx(Cl,{className:Es[i.status],children:i.status}),h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[!v&&h.jsxs(Ct,{variant:"outline",size:"sm",onClick:()=>{w({title:i.title,body:i.body,severity:i.severity,type:i.type}),y(!0),requestAnimationFrame(()=>{document.getElementById("lb-edit-title")?.focus()})},children:[h.jsx(x1,{className:"size-4"})," Edit"]}),r]})]}),h.jsx("h1",{className:"text-xl font-semibold tracking-tight break-all",children:i.title}),v?h.jsxs(ji,{"data-lb-region":"edit",className:"grid min-w-0 gap-3 p-4 [&>*]:min-w-0",children:[h.jsx(zi,{htmlFor:"lb-edit-title",className:"sr-only",children:"Title"}),h.jsx(Ui,{id:"lb-edit-title",value:p.title??"",onChange:U=>w(te=>({...te,title:U.target.value})),className:"text-base font-medium"}),h.jsx(zi,{htmlFor:"lb-edit-body",className:"sr-only",children:"Report"}),h.jsx(xv,{id:"lb-edit-body",value:p.body??"",rows:6,onChange:U=>w(te=>({...te,body:U.target.value}))}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsxs(bs,{value:p.severity,onValueChange:U=>w(te=>({...te,severity:U})),children:[h.jsx(Ss,{className:"w-32","aria-label":"Severity",children:h.jsx(xs,{})}),h.jsx(ws,{children:lS.map(U=>h.jsx(Di,{value:U,children:U},U))})]}),h.jsxs(bs,{value:p.type,onValueChange:U=>w(te=>({...te,type:U})),children:[h.jsx(Ss,{className:"w-36","aria-label":"Type",children:h.jsx(xs,{})}),h.jsx(ws,{children:oS.map(U=>h.jsx(Di,{value:U,children:U},U))})]}),h.jsx(Ct,{size:"sm",onClick:me,disabled:z,children:z?"Saving…":"Save"}),h.jsx(Ct,{variant:"ghost",size:"sm",onClick:()=>{y(!1),w({}),requestAnimationFrame(()=>{const U=document.querySelector('[data-lb-region="detail-header"]');U?.setAttribute("tabindex","-1"),U?.focus({preventScroll:!0})})},children:"Cancel"})]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Every edit is recorded on the trail with its old value — nothing is rewritten silently."})]}):h.jsx("code",{className:"font-mono text-xs break-all text-muted-foreground",children:i.id}),h.jsxs(ji,{className:"grid grid-cols-[repeat(auto-fit,minmax(170px,1fr))] gap-3 p-4",children:[h.jsx(gt,{label:"Project",children:h.jsx("span",{className:"break-all",children:i.project})}),h.jsxs(gt,{label:"Severity / type",children:[h.jsx("span",{className:`font-mono text-xs ${Of[i.severity]} ${Rf[i.severity]}`,children:i.severity})," ",h.jsx("span",{className:"text-sm text-muted-foreground",children:i.type})]}),h.jsx(gt,{label:"Source / reporter",children:h.jsxs("span",{className:"text-sm break-all",children:[i.source," · ",i.reporter]})}),h.jsx(gt,{label:"Assignee",children:h.jsx("span",{className:"text-sm break-all",children:i.assignee_agent??"unclaimed"})}),h.jsx(gt,{label:"Route",children:h.jsx("code",{className:"font-mono text-xs break-all",children:i.route??"—"})}),h.jsx(gt,{label:"Age",children:h.jsx("time",{dateTime:i.created_at,className:"text-sm",title:i.created_at,children:Ff(i.created_at)})}),h.jsx(gt,{label:"Updated",children:h.jsx("span",{className:"text-sm break-all text-muted-foreground",children:i.updated_at})}),i.resolution&&h.jsx(gt,{label:"Resolution",children:h.jsx("span",{className:"text-sm",children:i.resolution})})]}),h.jsxs("div",{className:"grid gap-3.5",children:[i.body&&!v&&h.jsx(gt,{region:!0,label:"Report",children:h.jsx("div",{className:"whitespace-pre-wrap break-all text-sm",children:i.body})}),i.repro_steps.length>0&&h.jsx(gt,{region:!0,label:"Repro steps",children:h.jsx("ol",{className:"list-decimal pl-5 text-sm break-all",children:i.repro_steps.map((U,te)=>h.jsx("li",{children:U},te))})}),K&&K.length>0&&h.jsx(gt,{region:!0,label:"Failed requests (captured at report time)",children:K.map((U,te)=>h.jsxs("div",{className:"mb-2",children:[h.jsxs("code",{className:"font-mono text-xs break-all",children:[U.status," ",U.url]}),U.body&&h.jsx(Tf,{label:`Response body for ${U.status} ${U.url}`,children:U.body})]},te))}),G&&h.jsx(gt,{region:!0,label:"Run context (AI / automation)",children:h.jsx(Tf,{label:"Run context JSON",children:JSON.stringify(G,null,2)})}),i.console.length>0&&h.jsx(gt,{region:!0,label:`Console (${i.console.length})`,children:h.jsx(Tf,{label:"Console capture",children:i.console.join(` -`)})}),Object.values(i.links).some(Boolean)&&h.jsx(gt,{region:!0,label:"Linked change",children:h.jsx("div",{className:"text-sm",children:Object.entries(i.links).filter(([,U])=>U).map(([U,te])=>h.jsxs("div",{children:[h.jsxs("span",{className:"text-muted-foreground",children:[U,":"]})," ",U==="pr_url"&&Za(String(te))?h.jsx("a",{className:"inline-block min-h-6 break-all underline",href:Za(String(te))??void 0,target:"_blank",rel:"noreferrer noopener",children:String(te)}):h.jsx("code",{className:"font-mono text-xs break-all",children:String(te)})]},U))})}),i.dom_selector&&h.jsx(gt,{region:!0,label:"Anchor",children:h.jsx("code",{className:"font-mono text-xs break-all",children:i.dom_selector})}),i.url&&h.jsx(gt,{region:!0,label:"Reported from",children:Za(i.url)?h.jsx("a",{className:"inline-block min-h-6 text-sm break-all underline",href:Za(i.url)??void 0,target:"_blank",rel:"noreferrer noopener",children:i.url}):h.jsx("span",{className:"text-sm break-all",children:i.url})}),i.network.length>0&&h.jsx(gt,{region:!0,label:`Network at report time (${i.network.length})`,children:h.jsx("div",{className:"grid gap-1",children:i.network.slice(-8).map((U,te)=>h.jsxs("div",{className:"flex flex-wrap items-baseline gap-2 font-mono text-xs",children:[h.jsx("span",{className:(U.status??0)>=400||U.status===0?"text-lb-p0 font-semibold":"text-muted-foreground",children:U.status??"—"}),h.jsx("span",{className:"text-muted-foreground",children:U.method??"GET"}),h.jsx("span",{className:"break-all",children:U.url}),U.ms!==void 0&&h.jsxs("span",{className:"text-muted-foreground",children:[U.ms,"ms"]})]},te))})})]}),h.jsxs(ji,{"data-lb-region":"attachments",className:"grid gap-3 p-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Af,{className:"size-4"}),h.jsxs("span",{className:"text-sm font-medium",children:["Attachments",i.attachments?.length?` (${i.attachments.length})`:""]})]}),i.attachments?.map(U=>h.jsxs(pA,{className:"w-full",children:[h.jsx(vA,{variant:U.mime.startsWith("image/")?"image":"icon",children:U.mime.startsWith("image/")?h.jsx("img",{src:U.url,alt:""}):h.jsx(c1,{"aria-hidden":!0})}),h.jsxs(yA,{className:"min-w-0",children:[h.jsx(bA,{className:"whitespace-normal",title:U.name,children:Za(U.url)?h.jsx("a",{className:"inline-block min-h-6 break-all underline",href:Za(U.url)??void 0,target:"_blank",rel:"noreferrer noopener",children:U.name}):h.jsx("span",{className:"break-all",children:U.name})}),h.jsxs(xA,{className:"whitespace-normal break-all",title:U.target_path??void 0,children:[h.jsx(Cl,{variant:U.intent==="asset"?"default":"secondary",children:U.intent})," ",iS(U.size),U.target_path?` → ${U.target_path}`:""]})]}),h.jsx(SA,{children:h.jsxs(EA,{children:[h.jsx(CA,{asChild:!0,children:h.jsx(wA,{"aria-label":`Remove attachment ${U.name}`,disabled:z,children:h.jsx(C1,{})})}),h.jsxs(_A,{className:"max-w-[calc(100vw-2rem)]",children:[h.jsxs(OA,{className:"min-w-0",children:[h.jsxs(NA,{className:"min-w-0 break-all",children:["Remove “",U.name,"”?"]}),h.jsx(jA,{children:"The file is deleted from the hub. This cannot be undone."})]}),h.jsxs(RA,{children:[h.jsx(zA,{children:"Keep it"}),h.jsx(DA,{onClick:()=>ae(async()=>{await Qa.detach(l,U.id,Mi()),Sl.success("Removed"),X()},"attachments"),children:"Remove"})]})]})]})})]},U.id)),h.jsxs("div",{className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,auto)_minmax(0,1fr)_auto] sm:items-center [&>*]:min-w-0",children:[h.jsxs(bs,{value:C,onValueChange:U=>T(U),children:[h.jsx(Ss,{"aria-label":"Attachment intent",children:h.jsx(xs,{})}),h.jsxs(ws,{children:[h.jsx(Di,{value:"reference",children:"reference"}),h.jsx(Di,{value:"asset",children:"asset"})]})]}),h.jsx(Ui,{"aria-label":"Target path in the repo",placeholder:C==="asset"?"Target path in the repo, e.g. public/logos/acme.svg":"Context for the fix — no target path needed",value:S,disabled:C==="reference",onChange:U=>D(U.target.value)}),h.jsx(Ct,{variant:"outline",size:"sm",disabled:z,onClick:()=>I.current?.click(),children:z?"Uploading…":"Choose file"}),h.jsx("input",{ref:I,type:"file","aria-label":"Choose a file to attach",tabIndex:-1,className:"hidden",onChange:U=>{const te=U.target.files?.[0];te&&ge(te),U.target.value=""}})]}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.jsx("strong",{children:"reference"})," is context for the fix and never ships."," ",h.jsx("strong",{children:"asset"})," is a deliverable — an agent copies it to the target path in the repo and commits it."]})]}),i.comments&&i.comments.length>0&&h.jsx(gt,{region:!0,label:`Trail (${i.comments.length})`,children:h.jsx("div",{className:"grid gap-2",children:i.comments.map(U=>h.jsxs("div",{className:"min-w-0 py-2 not-last:border-b",children:[h.jsxs("div",{className:"text-xs break-all text-muted-foreground",children:[U.author," · ",U.created_at]}),h.jsx("div",{className:"mt-0.5 whitespace-pre-wrap break-all text-sm",children:U.body})]},U.id))})}),!mA()&&h.jsxs(Pf,{children:[h.jsx(Jf,{children:"Who is writing to this trail?"}),h.jsx(If,{children:h.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[h.jsx(zi,{htmlFor:"lb-author",className:"sr-only",children:"Your name"}),h.jsx(Ui,{id:"lb-author",className:"h-11 w-full max-w-48 min-w-0",placeholder:"Your name or handle",defaultValue:"",onKeyDown:U=>{U.key==="Enter"&&(Sv(U.target.value),X())}}),h.jsx(Ct,{size:"sm",className:"h-11",onClick:()=>{const U=document.getElementById("lb-author");U&&Sv(U.value),X(),requestAnimationFrame(()=>{const te=document.querySelector('[data-lb-region="comment"]');te?.setAttribute("tabindex","-1"),te?.focus({preventScroll:!0})})},children:"Save"}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:["Stored in this browser only. Until then, writes are recorded as"," ",h.jsx("code",{className:"font-mono",children:"unknown-human"}),"."]})]})})]}),h.jsxs("div",{className:"grid min-w-0 gap-4 sm:grid-cols-2 [&>*]:min-w-0",children:[h.jsxs(ji,{"data-lb-region":"comment",className:"grid gap-2 p-4",children:[h.jsx(zi,{htmlFor:"lb-comment",className:zs,children:"Add a comment"}),h.jsx(xv,{id:"lb-comment",rows:3,value:g,onChange:U=>E(U.target.value),placeholder:"What you noticed, decided, or want the agent to know"}),h.jsx(Ct,{size:"sm",disabled:z||!g.trim(),onClick:()=>ae(async()=>{await Qa.comment(l,g,Mi()),E(""),Sl.success("Comment added"),X()}),children:z?"Adding…":"Comment"})]}),h.jsxs(ji,{"data-lb-region":"status",className:"grid gap-2 p-4",children:[h.jsx(zi,{htmlFor:"lb-status-note",className:zs,children:"Change status"}),h.jsx(Ui,{id:"lb-status-note",placeholder:"Why — recorded on the trail. Type this first.",value:O,onChange:U=>A(U.target.value)}),h.jsxs(bs,{value:i.status,onValueChange:U=>ae(async()=>{await Qa.setStatus(l,U,O,Mi()),A(""),Sl.success(`Status is now ${U}`),X()},"status"),children:[h.jsx(Ss,{"aria-label":"Status",disabled:z,children:h.jsx(xs,{})}),h.jsx(ws,{children:_v.map(U=>h.jsx(Di,{value:U,children:U},U))})]})]})]})]})}function UA(){const[l,o]=b.useState(window.location.pathname);b.useEffect(()=>{const f=()=>o(window.location.pathname);return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[]);const r=b.useCallback(f=>{window.history.pushState({},"",f),o(new URL(f,window.location.origin).pathname)},[]),i=/^\/queue\/(.+)$/.exec(l),u=i?decodeURIComponent(i[1]):null;return b.useEffect(()=>{document.title=u?`${u} — Loopback`:"Loopback queue";const f=document.getElementById("lb-main");f&&f.focus({preventScroll:!0})},[u]),{id:u,navigate:r}}function wv(){const[l,o]=b.useState(()=>document.documentElement.classList.contains("dark"));return h.jsx(Ct,{variant:"outline",size:"sm",className:"size-11",onClick:()=>{const r=document.documentElement.classList.toggle("dark");try{localStorage.setItem("lb-theme",r?"dark":"light")}catch{}o(r)},"aria-pressed":l,"aria-label":l?"Dark theme on. Switch to light.":"Light theme on. Switch to dark.",children:l?h.jsx(w1,{className:"size-4"}):h.jsx(p1,{className:"size-4"})})}function kA(){const{id:l,navigate:o}=UA();return h.jsxs(tA,{delayDuration:200,children:[h.jsx("main",{id:"lb-main",tabIndex:-1,className:"mx-auto max-w-[1180px] px-4 py-8 outline-none sm:px-6",children:l?h.jsx(MA,{id:l,navigate:o,themeToggle:h.jsx(wv,{})}):h.jsx(rA,{navigate:o,themeToggle:h.jsx(wv,{})})}),h.jsx(aS,{position:"bottom-right"})]})}Zx.createRoot(document.getElementById("root")).render(h.jsx(b.StrictMode,{children:h.jsx(kA,{})})); +`)},Ow=0,wo=[];function Rw(l){var o=b.useRef([]),r=b.useRef([0,0]),i=b.useRef(),u=b.useState(Ow++)[0],f=b.useState(vy)[0],m=b.useRef(l);b.useEffect(function(){m.current=l},[l]),b.useEffect(function(){if(l.inert){document.body.classList.add("block-interactivity-".concat(u));var C=JS([l.lockRef.current],(l.shards||[]).map(Xg),!0).filter(Boolean);return C.forEach(function(T){return T.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),C.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(u))})}}},[l.inert,l.lockRef.current,l.shards]);var v=b.useCallback(function(C,T){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!m.current.allowPinchZoom;var S=us(C),D=r.current,z="deltaX"in C?C.deltaX:D[0]-S[0],k="deltaY"in C?C.deltaY:D[1]-S[1],I,X=C.target,K=Math.abs(z)>Math.abs(k)?"h":"v";if("touches"in C&&K==="h"&&X.type==="range")return!1;var G=window.getSelection(),ae=G&&G.anchorNode,me=ae?ae===X||ae.contains(X):!1;if(me)return!1;var ge=Vg(K,X);if(!ge)return!0;if(ge?I=K:(I=K==="v"?"h":"v",ge=Vg(K,X)),!ge)return!1;if(!i.current&&"changedTouches"in C&&(z||k)&&(i.current=I),!I)return!0;var U=i.current||I;return Tw(U,T,C,U==="h"?z:k)},[]),y=b.useCallback(function(C){var T=C;if(!(!wo.length||wo[wo.length-1]!==f)){var S="deltaY"in T?Gg(T):us(T),D=o.current.filter(function(I){return I.name===T.type&&(I.target===T.target||T.target===I.shadowParent)&&Aw(I.delta,S)})[0];if(D&&D.should){T.cancelable&&T.preventDefault();return}if(!D){var z=(m.current.shards||[]).map(Xg).filter(Boolean).filter(function(I){return I.contains(T.target)}),k=z.length>0?v(T,z[0]):!m.current.noIsolation;k&&T.cancelable&&T.preventDefault()}}},[]),p=b.useCallback(function(C,T,S,D){var z={name:C,delta:T,target:S,should:D,shadowParent:Nw(S)};o.current.push(z),setTimeout(function(){o.current=o.current.filter(function(k){return k!==z})},1)},[]),w=b.useCallback(function(C){r.current=us(C),i.current=void 0},[]),g=b.useCallback(function(C){p(C.type,Gg(C),C.target,v(C,l.lockRef.current))},[]),E=b.useCallback(function(C){p(C.type,us(C),C.target,v(C,l.lockRef.current))},[]);b.useEffect(function(){return wo.push(f),l.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:E}),document.addEventListener("wheel",y,So),document.addEventListener("touchmove",y,So),document.addEventListener("touchstart",w,So),function(){wo=wo.filter(function(C){return C!==f}),document.removeEventListener("wheel",y,So),document.removeEventListener("touchmove",y,So),document.removeEventListener("touchstart",w,So)}},[]);var O=l.removeScrollBar,A=l.inert;return b.createElement(b.Fragment,null,A?b.createElement(f,{styles:_w(u)}):null,O?b.createElement(yw,{noRelative:l.noRelative,gapMode:l.gapMode}):null)}function Nw(l){for(var o=null;l!==null;)l instanceof ShadowRoot&&(o=l.host,l=l.host),l=l.parentNode;return o}const jw=ow(gy,Rw);var rd=b.forwardRef(function(l,o){return b.createElement(ks,Mn({},l,{ref:o,sideCar:jw}))});rd.classNames=ks.classNames;var Dw=function(l){if(typeof document>"u")return null;var o=Array.isArray(l)?l[0]:l;return o.ownerDocument.body},Eo=new WeakMap,fs=new WeakMap,ds={},Sf=0,Sy=function(l){return l&&(l.host||Sy(l.parentNode))},zw=function(l,o){return o.map(function(r){if(l.contains(r))return r;var i=Sy(r);return i&&l.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",l,". Doing nothing"),null)}).filter(function(r){return!!r})},Mw=function(l,o,r,i){var u=zw(o,Array.isArray(l)?l:[l]);ds[r]||(ds[r]=new WeakMap);var f=ds[r],m=[],v=new Set,y=new Set(u),p=function(g){!g||v.has(g)||(v.add(g),p(g.parentNode))};u.forEach(p);var w=function(g){!g||y.has(g)||Array.prototype.forEach.call(g.children,function(E){if(v.has(E))w(E);else try{var O=E.getAttribute(i),A=O!==null&&O!=="false",C=(Eo.get(E)||0)+1,T=(f.get(E)||0)+1;Eo.set(E,C),f.set(E,T),m.push(E),C===1&&A&&fs.set(E,!0),T===1&&E.setAttribute(r,"true"),A||E.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",E,S)}})};return w(o),v.clear(),Sf++,function(){m.forEach(function(g){var E=Eo.get(g)-1,O=f.get(g)-1;Eo.set(g,E),f.set(g,O),E||(fs.has(g)||g.removeAttribute(i),fs.delete(g)),O||g.removeAttribute(r)}),Sf--,Sf||(Eo=new WeakMap,Eo=new WeakMap,fs=new WeakMap,ds={})}},wy=function(l,o,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(l)?l:[l]),u=Dw(l);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),Mw(i,u,r,"aria-hidden")):function(){return null}},Uw=Object.defineProperty,nn=(l,o)=>Uw(l,"name",{value:o,configurable:!0}),sd="Dialog",[Ey,Cy]=Pa(sd),[kw,En]=Ey(sd),Lw=nn(l=>{const{__scopeDialog:o,children:r,open:i,defaultOpen:u,onOpenChange:f,modal:m=!0}=l,v=b.useRef(null),y=b.useRef(null),[p,w]=ki({prop:i,defaultProp:u??!1,onChange:f,caller:sd}),[g,E]=b.useState(0),[O,A]=b.useState(0);return h.jsx(kw,{scope:o,triggerRef:v,contentRef:y,contentId:Tl(),titleId:Tl(),descriptionId:Tl(),titlePresent:g>0,descriptionPresent:O>0,setTitleCount:E,setDescriptionCount:A,open:p,onOpenChange:w,onOpenToggle:b.useCallback(()=>w(C=>!C),[w]),modal:m,children:r})},"Dialog"),Hw="DialogTrigger",Bw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Hw,i),m=Xe(r,f.triggerRef);return h.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":Ls(f.open),...u,ref:m,onClick:De(o.onClick,f.onOpenToggle)})},"DialogTrigger")),Ty="DialogPortal",[qw,Ay]=Ey(Ty,{forceMount:void 0}),Yw=nn(l=>{const{__scopeDialog:o,forceMount:r,children:i,container:u}=l,f=En(Ty,o);return h.jsx(qw,{scope:o,forceMount:r,children:b.Children.map(i,m=>h.jsx(jo,{present:r||f.open,children:h.jsx(od,{asChild:!0,container:u,children:m})}))})},"DialogPortal"),Vf="DialogOverlay",Vw=b.forwardRef(nn(function(o,r){const i=Ay(Vf,o.__scopeDialog),{forceMount:u=i.forceMount,...f}=o,m=En(Vf,o.__scopeDialog);return m.modal?h.jsx(jo,{present:u||m.open,children:h.jsx(Xw,{...f,ref:r})}):null},"DialogOverlay")),Gw=ua("DialogOverlay.RemoveScroll"),Xw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Vf,i),m=ly(),v=Xe(r,m);return h.jsx(rd,{as:Gw,allowPinchZoom:!0,shards:[f.contentRef],children:h.jsx(Ie.div,{"data-state":Ls(f.open),...u,ref:v,style:{pointerEvents:"auto",...u.style}})})},"DialogOverlayImpl")),Li="DialogContent",Qw=b.forwardRef(nn(function(o,r){const i=Ay(Li,o.__scopeDialog),{forceMount:u=i.forceMount,...f}=o,m=En(Li,o.__scopeDialog);return h.jsx(jo,{present:u||m.open,children:m.modal?h.jsx(Zw,{...f,ref:r}):h.jsx(Kw,{...f,ref:r})})},"DialogContent")),Zw=b.forwardRef(nn(function(o,r){const i=En(Li,o.__scopeDialog),u=b.useRef(null),f=Xe(r,i.contentRef,u);return b.useEffect(()=>{const m=u.current;if(m)return wy(m)},[]),h.jsx(_y,{...o,ref:f,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:De(o.onCloseAutoFocus,m=>{m.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:De(o.onPointerDownOutside,m=>{const v=m.detail.originalEvent,y=v.button===0&&v.ctrlKey===!0;(v.button===2||y)&&m.preventDefault()}),onFocusOutside:De(o.onFocusOutside,m=>m.preventDefault())})},"DialogContentModal")),Kw=b.forwardRef(nn(function(o,r){const i=En(Li,o.__scopeDialog),u=b.useRef(!1),f=b.useRef(!1);return h.jsx(_y,{...o,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{o.onCloseAutoFocus?.(m),m.defaultPrevented||(u.current||i.triggerRef.current?.focus(),m.preventDefault()),u.current=!1,f.current=!1},onInteractOutside:m=>{o.onInteractOutside?.(m),m.defaultPrevented||(u.current=!0,m.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const v=m.target;i.triggerRef.current?.contains(v)&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&f.current&&m.preventDefault()}})},"DialogContentNonModal")),_y=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:m,...v}=o,y=En(Li,i);return Us(),h.jsx(h.Fragment,{children:h.jsx(ry,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:f,onUnmountAutoFocus:m,children:h.jsx(nd,{role:"dialog",id:y.contentId,"aria-describedby":y.descriptionPresent?y.descriptionId:void 0,"aria-labelledby":y.titlePresent?y.titleId:void 0,"data-state":Ls(y.open),...v,ref:r,deferPointerDownOutside:!0,onDismiss:()=>y.onOpenChange(!1)})})})},"DialogContentImpl")),$w="DialogTitle",Pw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En($w,i),{setTitleCount:m}=f;return at(()=>(m(v=>v+1),()=>m(v=>v-1)),[m]),h.jsx(Ie.h2,{id:f.titleId,...u,ref:r})},"DialogTitle")),Jw="DialogDescription",Iw=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Jw,i),{setDescriptionCount:m}=f;return at(()=>(m(v=>v+1),()=>m(v=>v-1)),[m]),h.jsx(Ie.p,{id:f.descriptionId,...u,ref:r})},"DialogDescription")),Fw="DialogClose",Oy=b.forwardRef(nn(function(o,r){const{__scopeDialog:i,...u}=o,f=En(Fw,i);return h.jsx(Ie.button,{type:"button",...u,ref:r,onClick:De(o.onClick,()=>f.onOpenChange(!1))})},"DialogClose"));function Ls(l){return l?"open":"closed"}nn(Ls,"getState");var Ww=Object.defineProperty,ma=(l,o)=>Ww(l,"name",{value:o,configurable:!0}),e2="AlertDialog",[t2,HA]=Pa(e2,[Cy]),ha=Cy(),n2=ma(l=>{const{__scopeAlertDialog:o,...r}=l,i=ha(o);return h.jsx(Lw,{...i,...r,modal:!0})},"AlertDialog"),a2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Bw,{...f,...u,ref:r})},"AlertDialogTrigger")),l2=ma(l=>{const{__scopeAlertDialog:o,...r}=l,i=ha(o);return h.jsx(Yw,{...i,...r})},"AlertDialogPortal"),o2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Vw,{...f,...u,ref:r})},"AlertDialogOverlay")),i2="AlertDialogContent",[r2,s2]=t2(i2),c2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,children:u,...f}=o,m=ha(i),v=b.useRef(null),y=Xe(r,v),p=b.useRef(null);return h.jsx(r2,{scope:i,cancelRef:p,children:h.jsx(Qw,{role:"alertdialog",...m,...f,ref:y,onOpenAutoFocus:De(f.onOpenAutoFocus,w=>{w.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:w=>w.preventDefault(),onInteractOutside:w=>w.preventDefault(),children:u})})},"AlertDialogContent")),u2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Pw,{...f,...u,ref:r})},"AlertDialogTitle")),f2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Iw,{...f,...u,ref:r})},"AlertDialogDescription")),d2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,f=ha(i);return h.jsx(Oy,{...f,...u,ref:r})},"AlertDialogAction")),m2="AlertDialogCancel",h2=b.forwardRef(ma(function(o,r){const{__scopeAlertDialog:i,...u}=o,{cancelRef:f}=s2(m2,i),m=ha(i),v=Xe(r,f);return h.jsx(Oy,{...m,...u,ref:v})},"AlertDialogCancel")),p2=n2,g2=a2,v2=l2,y2=o2,b2=c2,x2=d2,S2=h2,w2=u2,E2=f2,C2=Object.defineProperty,T2=(l,o)=>C2(l,"name",{value:o,configurable:!0});function Ry(l){const[o,r]=b.useState(void 0);return at(()=>{if(l){r({width:l.offsetWidth,height:l.offsetHeight});const i=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const f=u[0];let m,v;if("borderBoxSize"in f){const y=f.borderBoxSize,p=Array.isArray(y)?y[0]:y;m=p.inlineSize,v=p.blockSize}else m=l.offsetWidth,v=l.offsetHeight;r({width:m,height:v})});return i.observe(l,{box:"border-box"}),()=>i.unobserve(l)}else r(void 0)},[l]),o}T2(Ry,"useSize");const A2=["top","right","bottom","left"],Ka=Math.min,ra=Math.max,Os=Math.round,ms=Math.floor,sa=l=>({x:l,y:l}),_2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ny(l,o,r){return ra(l,Ka(o,r))}function da(l,o){return typeof l=="function"?l(o):l}function $a(l){return l.split("-")[0]}function Do(l){return l.split("-")[1]}function cd(l){return l==="x"?"y":"x"}function ud(l){return l==="y"?"height":"width"}function Un(l){const o=l[0];return o==="t"||o==="b"?"y":"x"}function fd(l){return cd(Un(l))}function O2(l,o,r){r===void 0&&(r=!1);const i=Do(l),u=fd(l),f=ud(u);let m=u==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(m=Rs(m)),[m,Rs(m)]}function R2(l){const o=Rs(l);return[Gf(l),o,Gf(o)]}function Gf(l){return l.includes("start")?l.replace("start","end"):l.replace("end","start")}const Qg=["left","right"],Zg=["right","left"],N2=["top","bottom"],j2=["bottom","top"];function D2(l,o,r){switch(l){case"top":case"bottom":return r?o?Zg:Qg:o?Qg:Zg;case"left":case"right":return o?N2:j2;default:return[]}}function z2(l,o,r,i){const u=Do(l);let f=D2($a(l),r==="start",i);return u&&(f=f.map(m=>m+"-"+u),o&&(f=f.concat(f.map(Gf)))),f}function Rs(l){const o=$a(l);return _2[o]+l.slice(o.length)}function M2(l){var o,r,i,u;return{top:(o=l.top)!=null?o:0,right:(r=l.right)!=null?r:0,bottom:(i=l.bottom)!=null?i:0,left:(u=l.left)!=null?u:0}}function jy(l){return typeof l!="number"?M2(l):{top:l,right:l,bottom:l,left:l}}function Ns(l){const{x:o,y:r,width:i,height:u}=l;return{width:i,height:u,top:r,left:o,right:o+i,bottom:r+u,x:o,y:r}}function Kg(l,o,r){let{reference:i,floating:u}=l;const f=Un(o),m=fd(o),v=ud(m),y=$a(o),p=f==="y",w=i.x+i.width/2-u.width/2,g=i.y+i.height/2-u.height/2,E=i[v]/2-u[v]/2;let O;switch(y){case"top":O={x:w,y:i.y-u.height};break;case"bottom":O={x:w,y:i.y+i.height};break;case"right":O={x:i.x+i.width,y:g};break;case"left":O={x:i.x-u.width,y:g};break;default:O={x:i.x,y:i.y}}const A=Do(o);return A&&(O[m]+=E*(A==="end"?1:-1)*(r&&p?-1:1)),O}async function U2(l,o){var r;o===void 0&&(o={});const{x:i,y:u,platform:f,rects:m,elements:v,strategy:y}=l,{boundary:p="clippingAncestors",rootBoundary:w="viewport",elementContext:g="floating",altBoundary:E=!1,padding:O=0}=da(o,l),A=jy(O),T=v[E?g==="floating"?"reference":"floating":g],S=Ns(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(T)))==null||r?T:T.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(v.floating)),boundary:p,rootBoundary:w,strategy:y})),D=g==="floating"?{x:i,y:u,width:m.floating.width,height:m.floating.height}:m.reference,z=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v.floating)),k=await(f.isElement==null?void 0:f.isElement(z))&&await(f.getScale==null?void 0:f.getScale(z))||{x:1,y:1},I=Ns(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:D,offsetParent:z,strategy:y}):D);return{top:(S.top-I.top+A.top)/k.y,bottom:(I.bottom-S.bottom+A.bottom)/k.y,left:(S.left-I.left+A.left)/k.x,right:(I.right-S.right+A.right)/k.x}}const k2=50,L2=async(l,o,r)=>{const{placement:i="bottom",strategy:u="absolute",middleware:f=[],platform:m}=r,v=m.detectOverflow?m:{...m,detectOverflow:U2},y=await(m.isRTL==null?void 0:m.isRTL(o));let p=await m.getElementRects({reference:l,floating:o,strategy:u}),{x:w,y:g}=Kg(p,i,y),E=i,O=0;const A={};for(let C=0;C({name:"arrow",options:l,async fn(o){const{x:r,y:i,placement:u,rects:f,platform:m,elements:v,middlewareData:y}=o,{element:p,padding:w=0}=da(l,o)||{};if(p==null)return{};const g=jy(w),E={x:r,y:i},O=fd(u),A=ud(O),C=await m.getDimensions(p),T=O==="y",S=T?"top":"left",D=T?"bottom":"right",z=T?"clientHeight":"clientWidth",k=f.reference[A]+f.reference[O]-E[O]-f.floating[A],I=E[O]-f.reference[O],X=await(m.getOffsetParent==null?void 0:m.getOffsetParent(p));let K=X?X[z]:0;(!K||!await(m.isElement==null?void 0:m.isElement(X)))&&(K=v.floating[z]||f.floating[A]);const G=k/2-I/2,ae=K/2-C[A]/2-1,me=Ka(g[S],ae),ge=Ka(g[D],ae),U=K-C[A]-ge,te=K/2-C[A]/2+G,fe=Ny(me,te,U),he=!y.arrow&&Do(u)!=null&&te!==fe&&f.reference[A]/2-(tefe<=0)){var ge,U;const fe=(((ge=f.flip)==null?void 0:ge.index)||0)+1,he=K[fe];if(he&&(!(g==="alignment"?D!==Un(he):!1)||me.every(F=>Un(F.placement)===D?F.overflows[0]>0:!0)))return{data:{index:fe,overflows:me},reset:{placement:he}};let j=(U=me.filter(Y=>Y.overflows[0]<=0).sort((Y,F)=>Y.overflows[1]-F.overflows[1])[0])==null?void 0:U.placement;if(!j)switch(O){case"bestFit":{var te;const Y=(te=me.filter(F=>{if(X){const oe=Un(F.placement);return oe===D||oe==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(oe=>oe>0).reduce((oe,P)=>oe+P,0)]).sort((F,oe)=>F[1]-oe[1])[0])==null?void 0:te[0];Y&&(j=Y);break}case"initialPlacement":j=v;break}if(u!==j)return{reset:{placement:j}}}return{}}}};function $g(l,o){return{top:l.top-o.height,right:l.right-o.width,bottom:l.bottom-o.height,left:l.left-o.width}}function Pg(l){return A2.some(o=>l[o]>=0)}const q2=function(l){return l===void 0&&(l={}),{name:"hide",options:l,async fn(o){const{rects:r,platform:i}=o,{strategy:u="referenceHidden",...f}=da(l,o);switch(u){case"referenceHidden":{const m=await i.detectOverflow(o,{...f,elementContext:"reference"}),v=$g(m,r.reference);return{data:{referenceHiddenOffsets:v,referenceHidden:Pg(v)}}}case"escaped":{const m=await i.detectOverflow(o,{...f,altBoundary:!0}),v=$g(m,r.floating);return{data:{escapedOffsets:v,escaped:Pg(v)}}}default:return{}}}}},Dy=new Set(["left","top"]);async function Y2(l,o){const{placement:r,platform:i,elements:u}=l,f=await(i.isRTL==null?void 0:i.isRTL(u.floating)),m=$a(r),v=Do(r),y=Un(r)==="y",p=Dy.has(m)?-1:1,w=f&&y?-1:1,g=da(o,l);let{mainAxis:E,crossAxis:O,alignmentAxis:A}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return v&&typeof A=="number"&&(O=v==="end"?A*-1:A),y?{x:O*w,y:E*p}:{x:E*p,y:O*w}}const V2=function(l){return l===void 0&&(l=0),{name:"offset",options:l,async fn(o){var r,i;const{x:u,y:f,placement:m,middlewareData:v}=o,y=await Y2(o,l);return m===((r=v.offset)==null?void 0:r.placement)&&(i=v.arrow)!=null&&i.alignmentOffset?{}:{x:u+y.x,y:f+y.y,data:{...y,placement:m}}}}},G2=function(l){return l===void 0&&(l={}),{name:"shift",options:l,async fn(o){const{x:r,y:i,placement:u,platform:f}=o,{mainAxis:m=!0,crossAxis:v=!1,limiter:y={fn:D=>{let{x:z,y:k}=D;return{x:z,y:k}}},...p}=da(l,o),w={x:r,y:i},g=await f.detectOverflow(o,p),E=Un(u),O=cd(E);let A=w[O],C=w[E];const T=(D,z)=>Ny(z+g[D==="y"?"top":"left"],z,z-g[D==="y"?"bottom":"right"]);m&&(A=T(O,A)),v&&(C=T(E,C));const S=y.fn({...o,[O]:A,[E]:C});return{...S,data:{x:S.x-r,y:S.y-i,enabled:{[O]:m,[E]:v}}}}}},X2=function(l){return l===void 0&&(l={}),{options:l,fn(o){var r,i;const{x:u,y:f,placement:m,rects:v,middlewareData:y}=o,{offset:p=0,mainAxis:w=!0,crossAxis:g=!0}=da(l,o),E={x:u,y:f},O=Un(m),A=cd(O);let C=E[A],T=E[O];const S=da(p,o),D=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(r=S.mainAxis)!=null?r:0,crossAxis:(i=S.crossAxis)!=null?i:0};if(w){const I=A==="y"?"height":"width",X=v.reference[A]-v.floating[I]+D.mainAxis,K=v.reference[A]+v.reference[I]-D.mainAxis;CK&&(C=K)}if(g){var z,k;const I=A==="y"?"width":"height",X=Dy.has($a(m)),K=v.reference[O]-v.floating[I]+(X&&((z=y.offset)==null?void 0:z[O])||0)+(X?0:D.crossAxis),G=v.reference[O]+v.reference[I]+(X?0:((k=y.offset)==null?void 0:k[O])||0)-(X?D.crossAxis:0);TG&&(T=G)}return{[A]:C,[O]:T}}}},Q2=function(l){return l===void 0&&(l={}),{name:"size",options:l,async fn(o){const{placement:r,rects:i,platform:u,elements:f}=o,{apply:m=()=>{},...v}=da(l,o),y=await u.detectOverflow(o,v),p=$a(r),w=Do(r),g=Un(r)==="y",{width:E,height:O}=i.floating;let A,C;p==="top"||p==="bottom"?(A=p,C=w===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(C=p,A=w==="end"?"top":"bottom");const T=O-y.top-y.bottom,S=E-y.left-y.right,D=Ka(O-y[A],T),z=Ka(E-y[C],S),k=o.middlewareData.shift,I=!k;let X=D,K=z;k!=null&&k.enabled.x&&(K=S),k!=null&&k.enabled.y&&(X=T),I&&!w&&(g?K=E-2*ra(y.left,y.right):X=O-2*ra(y.top,y.bottom)),await m({...o,availableWidth:K,availableHeight:X});const G=await u.getDimensions(f.floating);return E!==G.width||O!==G.height?{reset:{rects:!0}}:{}}}};function Hs(){return typeof window<"u"}function zo(l){return zy(l)?(l.nodeName||"").toLowerCase():"#document"}function Zt(l){var o;return(l==null||(o=l.ownerDocument)==null?void 0:o.defaultView)||window}function pa(l){var o;return(o=(zy(l)?l.ownerDocument:l.document)||window.document)==null?void 0:o.documentElement}function zy(l){return Hs()?l instanceof Node||l instanceof Zt(l).Node:!1}function Ln(l){return Hs()?l instanceof Element||l instanceof Zt(l).Element:!1}function Ja(l){return Hs()?l instanceof HTMLElement||l instanceof Zt(l).HTMLElement:!1}function Jg(l){return!Hs()||typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof Zt(l).ShadowRoot}function Bs(l){const{overflow:o,overflowX:r,overflowY:i,display:u}=Hn(l);return/auto|scroll|overlay|hidden|clip/.test(o+i+r)&&u!=="inline"&&u!=="contents"}function Z2(l){return/^(table|td|th)$/.test(zo(l))}function qs(l){try{if(l.matches(":popover-open"))return!0}catch{}try{return l.matches(":modal")}catch{return!1}}const K2=/transform|translate|scale|rotate|perspective|filter/,$2=/paint|layout|strict|content/,wl=l=>!!l&&l!=="none";let wf;function dd(l){const o=Ln(l)?Hn(l):l;return wl(o.transform)||wl(o.translate)||wl(o.scale)||wl(o.rotate)||wl(o.perspective)||!md()&&(wl(o.backdropFilter)||wl(o.filter))||K2.test(o.willChange||"")||$2.test(o.contain||"")}function P2(l){let o=Al(l);for(;Ja(o)&&!Hi(o);){if(dd(o))return o;if(qs(o))return null;o=Al(o)}return null}function md(){return wf==null&&(wf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wf}function Hi(l){return/^(html|body|#document)$/.test(zo(l))}function Hn(l){return Zt(l).getComputedStyle(l)}function Ys(l){return Ln(l)?{scrollLeft:l.scrollLeft,scrollTop:l.scrollTop}:{scrollLeft:l.scrollX,scrollTop:l.scrollY}}function Al(l){if(zo(l)==="html")return l;const o=l.assignedSlot||l.parentNode||Jg(l)&&l.host||pa(l);return Jg(o)?o.host:o}function My(l){const o=Al(l);return Hi(o)?(l.ownerDocument||l).body:Ja(o)&&Bs(o)?o:My(o)}function Bi(l,o,r){var i;o===void 0&&(o=[]),r===void 0&&(r=!0);const u=My(l),f=u===((i=l.ownerDocument)==null?void 0:i.body),m=Zt(u);if(f){const v=Xf(m);return o.concat(m,m.visualViewport||[],Bs(u)?u:[],v&&r?Bi(v):[])}else return o.concat(u,Bi(u,[],r))}function Xf(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}function Uy(l){const o=Hn(l);let r=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const u=Ja(l),f=u?l.offsetWidth:r,m=u?l.offsetHeight:i,v=Os(r)!==f||Os(i)!==m;return v&&(r=f,i=m),{width:r,height:i,$:v}}function hd(l){return Ln(l)?l:l.contextElement}function _o(l){const o=hd(l);if(!Ja(o))return sa(1);const r=o.getBoundingClientRect(),{width:i,height:u,$:f}=Uy(o);let m=(f?Os(r.width):r.width)/i,v=(f?Os(r.height):r.height)/u;return(!m||!Number.isFinite(m))&&(m=1),(!v||!Number.isFinite(v))&&(v=1),{x:m,y:v}}const J2=sa(0);function ky(l){const o=Zt(l);return!md()||!o.visualViewport?J2:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function I2(l,o,r){return o===void 0&&(o=!1),!!r&&o&&r===Zt(l)}function _l(l,o,r,i){o===void 0&&(o=!1),r===void 0&&(r=!1);const u=l.getBoundingClientRect(),f=hd(l);let m=sa(1);o&&(i?Ln(i)&&(m=_o(i)):m=_o(l));const v=I2(f,r,i)?ky(f):sa(0);let y=(u.left+v.x)/m.x,p=(u.top+v.y)/m.y,w=u.width/m.x,g=u.height/m.y;if(f&&i){const E=Zt(f),O=Ln(i)?Zt(i):i;let A=E,C=Xf(A);for(;C&&O!==A;){const T=_o(C),S=C.getBoundingClientRect(),D=Hn(C),z=S.left+(C.clientLeft+parseFloat(D.paddingLeft))*T.x,k=S.top+(C.clientTop+parseFloat(D.paddingTop))*T.y;y*=T.x,p*=T.y,w*=T.x,g*=T.y,y+=z,p+=k,A=Zt(C),C=Xf(A)}}return Ns({width:w,height:g,x:y,y:p})}function Vs(l,o){const r=Ys(l).scrollLeft;return o?o.left+r:_l(pa(l)).left+r}function Ly(l,o){const r=l.getBoundingClientRect(),i=r.left+o.scrollLeft-Vs(l,r),u=r.top+o.scrollTop;return{x:i,y:u}}function F2(l){let{elements:o,rect:r,offsetParent:i,strategy:u}=l;const f=u==="fixed",m=pa(i),v=o?qs(o.floating):!1;if(i===m||v&&f)return r;let y={scrollLeft:0,scrollTop:0},p=sa(1);const w=sa(0),g=Ja(i);if((g||!f)&&((zo(i)!=="body"||Bs(m))&&(y=Ys(i)),g)){const O=_l(i);p=_o(i),w.x=O.x+i.clientLeft,w.y=O.y+i.clientTop}const E=m&&!g&&!f?Ly(m,y):sa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-y.scrollLeft*p.x+w.x+E.x,y:r.y*p.y-y.scrollTop*p.y+w.y+E.y}}function W2(l){return l.getClientRects?Array.from(l.getClientRects()):[]}function eE(l){const o=Ys(l),r=l.ownerDocument.body,i=ra(l.scrollWidth,l.clientWidth,r.scrollWidth,r.clientWidth),u=ra(l.scrollHeight,l.clientHeight,r.scrollHeight,r.clientHeight);let f=-o.scrollLeft+Vs(l);const m=-o.scrollTop;return Hn(r).direction==="rtl"&&(f+=ra(l.clientWidth,r.clientWidth)-i),{width:i,height:u,x:f,y:m}}const tE=25;function nE(l,o,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",u=Zt(l),f=pa(l),m=u.visualViewport;let v=f.clientWidth,y=f.clientHeight,p=0,w=0;if(m){const E=!md()||o==="fixed";i?E||(p=-m.offsetLeft,w=-m.offsetTop):(v=m.width,y=m.height,E&&(p=m.offsetLeft,w=m.offsetTop))}if(Vs(f)<=0){const E=f.ownerDocument,O=E.body,A=getComputedStyle(O),C=E.compatMode==="CSS1Compat"&&parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0,T=Math.abs(f.clientWidth-O.clientWidth-C),S=getComputedStyle(f).scrollbarGutter==="stable both-edges"?T/2:T;S<=tE&&(v-=S)}return{width:v,height:y,x:p,y:w}}function aE(l,o){const r=_l(l,!0,o==="fixed"),i=r.top+l.clientTop,u=r.left+l.clientLeft,f=_o(l),m=l.clientWidth*f.x,v=l.clientHeight*f.y,y=u*f.x,p=i*f.y;return{width:m,height:v,x:y,y:p}}function Ig(l,o,r){let i;if(o==="viewport"||o==="layoutViewport")i=nE(l,r,o);else if(o==="document")i=eE(pa(l));else if(Ln(o))i=aE(o,r);else{const u=ky(l);i={x:o.x-u.x,y:o.y-u.y,width:o.width,height:o.height}}return Ns(i)}function lE(l,o){const r=o.get(l);if(r)return r;let i=Bi(l,[],!1).filter(v=>Ln(v)&&zo(v)!=="body"),u=null;const f=Hn(l).position==="fixed";let m=f?Al(l):l;for(;Ln(m)&&!Hi(m);){const v=Hn(m),y=dd(m),p=u?u.position:f?"fixed":"";!y&&(p==="fixed"||p==="absolute"&&v.position==="static")?i=i.filter(g=>g!==m):u=v,m=Al(m)}return o.set(l,i),i}function oE(l){let{element:o,boundary:r,rootBoundary:i,strategy:u}=l;const m=[...r==="clippingAncestors"?qs(o)?[]:lE(o,this._c):[].concat(r),i],v=Ig(o,m[0],u);let y=v.top,p=v.right,w=v.bottom,g=v.left;for(let E=1;E{v(!1,1e-7)},1e3)}K=!1}try{i=new IntersectionObserver(G,{...X,root:f.ownerDocument})}catch{i=new IntersectionObserver(G,X)}i.observe(l)}const y=Zt(l),p=()=>v(r);return y.addEventListener("resize",p),v(!0),()=>{y.removeEventListener("resize",p),m()}}function dE(l,o,r,i){i===void 0&&(i={});const{ancestorScroll:u=!0,ancestorResize:f=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:y=!1}=i,p=hd(l),w=u||f?[...p?Bi(p):[],...o?Bi(o):[]]:[];w.forEach(S=>{u&&S.addEventListener("scroll",r),f&&S.addEventListener("resize",r)});const g=p&&v?fE(p,r,f):null;let E=-1,O=null;m&&(O=new ResizeObserver(S=>{let[D]=S;D&&D.target===p&&O&&o&&(O.unobserve(o),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var z;(z=O)==null||z.observe(o)})),r()}),p&&!y&&O.observe(p),o&&O.observe(o));let A,C=y?_l(l):null;y&&T();function T(){const S=_l(l);C&&!By(C,S)&&r(),C=S,A=requestAnimationFrame(T)}return r(),()=>{var S;w.forEach(D=>{u&&D.removeEventListener("scroll",r),f&&D.removeEventListener("resize",r)}),g?.(),(S=O)==null||S.disconnect(),O=null,y&&cancelAnimationFrame(A)}}const mE=V2,hE=G2,pE=B2,gE=Q2,vE=q2,Wg=H2,yE=X2,bE=(l,o,r)=>{const i=new Map,u=r??{},f={...uE,...u.platform,_c:i};return L2(l,o,{...u,platform:f})};var xE=typeof document<"u",SE=function(){},_s=xE?b.useLayoutEffect:SE;function js(l,o){if(l===o)return!0;if(typeof l!=typeof o)return!1;if(typeof l=="function"&&l.toString()===o.toString())return!0;let r,i,u;if(l&&o&&typeof l=="object"){if(Array.isArray(l)){if(r=l.length,r!==o.length)return!1;for(i=r;i--!==0;)if(!js(l[i],o[i]))return!1;return!0}if(u=Object.keys(l),r=u.length,r!==Object.keys(o).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(o,u[i]))return!1;for(i=r;i--!==0;){const f=u[i];if(!(f==="_owner"&&l.$$typeof)&&!js(l[f],o[f]))return!1}return!0}return l!==l&&o!==o}function qy(l){return typeof window>"u"?1:(l.ownerDocument.defaultView||window).devicePixelRatio||1}function ev(l,o){const r=qy(l);return Math.round(o*r)/r}function Cf(l){const o=b.useRef(l);return _s(()=>{o.current=l}),o}function wE(l){l===void 0&&(l={});const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:u,elements:{reference:f,floating:m}={},transform:v=!0,whileElementsMounted:y,open:p}=l,[w,g]=b.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[E,O]=b.useState(i);js(E,i)||O(i);const[A,C]=b.useState(null),[T,S]=b.useState(null),D=b.useCallback(F=>{F!==X.current&&(X.current=F,C(F))},[]),z=b.useCallback(F=>{F!==K.current&&(K.current=F,S(F))},[]),k=f||A,I=m||T,X=b.useRef(null),K=b.useRef(null),G=b.useRef(w),ae=y!=null,me=Cf(y),ge=Cf(u),U=Cf(p),te=b.useCallback(()=>{if(!X.current||!K.current)return;const F={placement:o,strategy:r,middleware:E};ge.current&&(F.platform=ge.current),bE(X.current,K.current,F).then(oe=>{const P={...oe,isPositioned:U.current!==!1};fe.current&&!js(G.current,P)&&(G.current=P,Ro.flushSync(()=>{g(P)}))})},[E,o,r,ge,U]);_s(()=>{p===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[p]);const fe=b.useRef(!1);_s(()=>(fe.current=!0,()=>{fe.current=!1}),[]),_s(()=>{if(k&&(X.current=k),I&&(K.current=I),k&&I){if(me.current)return me.current(k,I,te);te()}},[k,I,te,me,ae]);const he=b.useMemo(()=>({reference:X,floating:K,setReference:D,setFloating:z}),[D,z]),j=b.useMemo(()=>({reference:k,floating:I}),[k,I]),Y=b.useMemo(()=>{const F={position:r,left:0,top:0};if(!j.floating)return F;const oe=ev(j.floating,w.x),P=ev(j.floating,w.y);return v?{...F,transform:"translate("+oe+"px, "+P+"px)",...qy(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:oe,top:P}},[r,v,j.floating,w.x,w.y]);return b.useMemo(()=>({...w,update:te,refs:he,elements:j,floatingStyles:Y}),[w,te,he,j,Y])}const EE=l=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:l,fn(r){const{element:i,padding:u}=typeof l=="function"?l(r):l;return i&&o(i)?i.current!=null?Wg({element:i.current,padding:u}).fn(r):{}:i?Wg({element:i,padding:u}).fn(r):{}}}},CE=(l,o)=>{const r=mE(l);return{name:r.name,fn:r.fn,options:[l,o]}},TE=(l,o)=>{const r=hE(l);return{name:r.name,fn:r.fn,options:[l,o]}},AE=(l,o)=>({fn:yE(l).fn,options:[l,o]}),_E=(l,o)=>{const r=pE(l);return{name:r.name,fn:r.fn,options:[l,o]}},OE=(l,o)=>{const r=gE(l);return{name:r.name,fn:r.fn,options:[l,o]}},RE=(l,o)=>{const r=vE(l);return{name:r.name,fn:r.fn,options:[l,o]}},NE=(l,o)=>{const r=EE(l);return{name:r.name,fn:r.fn,options:[l,o]}};var jE=Object.defineProperty,DE=(l,o)=>jE(l,"name",{value:o,configurable:!0}),zE=b.forwardRef(DE(function(o,r){const{children:i,width:u=10,height:f=5,...m}=o;return h.jsx(Ie.svg,{...m,ref:r,width:u,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:o.asChild?i:h.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),ME=zE,UE=Object.defineProperty,ca=(l,o)=>UE(l,"name",{value:o,configurable:!0}),Yy="Popper",[Vy,Gs]=Pa(Yy),[kE,Gy]=Vy(Yy),LE=ca(l=>{const{__scopePopper:o,children:r}=l,[i,u]=b.useState(null),[f,m]=b.useState(void 0);return h.jsx(kE,{scope:o,anchor:i,onAnchorChange:u,placementState:f,setPlacementState:m,children:r})},"Popper"),HE="PopperAnchor",BE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,virtualRef:u,...f}=o,m=Gy(HE,i),v=b.useRef(null),y=m.onAnchorChange,p=b.useCallback(C=>{v.current=C,C&&y(C)},[y]),w=Xe(r,p),g=b.useRef(null);b.useEffect(()=>{if(!u)return;const C=g.current;g.current=u.current,C!==g.current&&y(g.current)});const E=m.placementState&&Xs(m.placementState),O=E?.[0],A=E?.[1];return u?null:h.jsx(Ie.div,{"data-radix-popper-side":O,"data-radix-popper-align":A,...f,ref:w})},"PopperAnchor")),Xy="PopperContent",[qE,YE]=Vy(Xy),VE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,side:u="bottom",sideOffset:f=0,align:m="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:p=!0,collisionBoundary:w=[],collisionPadding:g=0,sticky:E="partial",hideWhenDetached:O=!1,updatePositionStrategy:A="optimized",onPlaced:C,...T}=o,S=Gy(Xy,i),[D,z]=b.useState(null),k=Xe(r,z),[I,X]=b.useState(null),K=Ry(I),G=K?.width??0,ae=K?.height??0,me=u+(m!=="center"?"-"+m:""),ge=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(w)?w:[w],te=U.length>0,fe={padding:ge,boundary:U.filter(Qy),altBoundary:te},{refs:he,floatingStyles:j,placement:Y,isPositioned:F,middlewareData:oe}=wE({strategy:"fixed",placement:me,whileElementsMounted:ca((...re)=>dE(...re,{animationFrame:A==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[CE({mainAxis:f+ae,alignmentAxis:v}),p&&TE({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?AE():void 0,...fe}),p&&_E({...fe}),OE({...fe,apply:ca(({elements:re,rects:Le,availableWidth:Ce,availableHeight:Te})=>{const{width:He,height:Ze}=Le.reference,dt=re.floating.style;dt.setProperty("--radix-popper-available-width",`${Ce}px`),dt.setProperty("--radix-popper-available-height",`${Te}px`),dt.setProperty("--radix-popper-anchor-width",`${He}px`),dt.setProperty("--radix-popper-anchor-height",`${Ze}px`)},"apply")}),I&&NE({element:I,padding:y}),ZE({arrowWidth:G,arrowHeight:ae}),O&&RE({strategy:"referenceHidden",...fe,boundary:te?fe.boundary:void 0})]}),P=S.setPlacementState;at(()=>(P(Y),()=>{P(void 0)}),[Y,P]);const[R,V]=Xs(Y),Z=kn(C);at(()=>{F&&Z?.()},[F,Z]);const W=oe.arrow?.x,ee=oe.arrow?.y,ie=oe.arrow?.centerOffset!==0,[ye,ne]=b.useState();return at(()=>{D&&ne(window.getComputedStyle(D).zIndex)},[D]),h.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:F?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(" "),...oe.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:o.dir,children:h.jsx(qE,{scope:i,placedSide:R,placedAlign:V,onArrowChange:X,arrowX:W,arrowY:ee,shouldHideArrow:ie,children:h.jsx(Ie.div,{"data-side":R,"data-align":V,...T,ref:k,style:{...T.style,animation:F?T.style?.animation:"none"}})})})},"PopperContent")),GE="PopperArrow",XE={top:"bottom",right:"left",bottom:"top",left:"right"},QE=b.forwardRef(ca(function(o,r){const{__scopePopper:i,...u}=o,f=YE(GE,i),m=XE[f.placedSide];return h.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:h.jsx(ME,{...u,ref:r,style:{...u.style,display:"block"}})})},"PopperArrow"));function Qy(l){return l!==null}ca(Qy,"isNotNull");var ZE=ca(l=>({name:"transformOrigin",options:l,fn(o){const{placement:r,rects:i,middlewareData:u}=o,m=u.arrow?.centerOffset!==0,v=m?0:l.arrowWidth,y=m?0:l.arrowHeight,[p,w]=Xs(r),g={start:"0%",center:"50%",end:"100%"}[w],E=(u.arrow?.x??0)+v/2,O=(u.arrow?.y??0)+y/2;let A="",C="";return p==="bottom"?(A=m?g:`${E}px`,C=`${-y}px`):p==="top"?(A=m?g:`${E}px`,C=`${i.floating.height+y}px`):p==="right"?(A=`${-y}px`,C=m?g:`${O}px`):p==="left"&&(A=`${i.floating.width+y}px`,C=m?g:`${O}px`),{data:{x:A,y:C}}}}),"transformOrigin");function Xs(l){const[o,r="center"]=l.split("-");return[o,r]}ca(Xs,"getSideAndAlignFromPlacement");var Zy=LE,Ky=BE,$y=VE,KE=QE,$E=Object.defineProperty,PE=(l,o)=>$E(l,"name",{value:o,configurable:!0}),JE=b.forwardRef(PE(function(o,r){return h.jsx(Ie.label,{...o,ref:r,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(o.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}})},"Label")),IE=JE,FE=Object.defineProperty,WE=(l,o)=>FE(l,"name",{value:o,configurable:!0});function Py(l){const o=b.useRef({value:l,previous:l});return b.useMemo(()=>(o.current.value!==l&&(o.current.previous=o.current.value,o.current.value=l),o.current.previous),[l])}WE(Py,"usePrevious");var eC=Object.defineProperty,tC=(l,o)=>eC(l,"name",{value:o,configurable:!0});function Qf(l,[o,r]){return Math.min(r,Math.max(o,l))}tC(Qf,"clamp");var nC=Object.defineProperty,ze=(l,o)=>nC(l,"name",{value:o,configurable:!0}),aC=[" ","Enter","ArrowUp","ArrowDown"],lC=[" ","Enter"],Oo="Select",[Qs,Zs,oC]=Yv(Oo),[Rl,BA]=Pa(Oo,[oC,Gs]),pd=Gs(),[iC,Ia]=Rl(Oo),[rC,sC]=Rl(Oo);function Jy(l){const{__scopeSelect:o,children:r,open:i,defaultOpen:u,onOpenChange:f,value:m,defaultValue:v,onValueChange:y,dir:p,name:w,autoComplete:g,disabled:E,required:O,form:A,internal_do_not_use_render:C}=l,T=pd(o),[S,D]=b.useState(null),[z,k]=b.useState(null),[I,X]=b.useState(!1),K=ny(p),[G,ae]=ki({prop:i,defaultProp:u??!1,onChange:f,caller:Oo}),[me,ge]=ki({prop:m,defaultProp:v,onChange:y,caller:Oo}),U=b.useRef(null),te=b.useRef(me);b.useEffect(()=>{const V=A?S?.ownerDocument.getElementById(A):S?.form;if(V instanceof HTMLFormElement){const Z=ze(()=>ge(te.current),"reset");return V.addEventListener("reset",Z),()=>V.removeEventListener("reset",Z)}},[A,S,ge]);const fe=S?!!A||!!S.closest("form"):!0,[he,j]=b.useState(new Set),Y=Tl(),F=Array.from(he).map(V=>V.props.value).join(";"),oe=b.useCallback(V=>{j(Z=>new Set(Z).add(V))},[]),P=b.useCallback(V=>{j(Z=>{const W=new Set(Z);return W.delete(V),W})},[]),R={required:O,trigger:S,onTriggerChange:D,valueNode:z,onValueNodeChange:k,valueNodeHasChildren:I,onValueNodeHasChildrenChange:X,contentId:Y,value:me,onValueChange:ge,open:G,onOpenChange:ae,dir:K,triggerPointerDownPosRef:U,disabled:E,name:w,autoComplete:g,form:A,nativeOptions:he,nativeSelectKey:F,isFormControl:fe};return h.jsx(Zy,{...T,children:h.jsx(iC,{scope:o,...R,children:h.jsx(Qs.Provider,{scope:o,children:h.jsx(rC,{scope:o,onNativeOptionAdd:oe,onNativeOptionRemove:P,children:e0(C)?C(R):r})})})})}ze(Jy,"SelectProvider");var cC=ze(l=>{const{__scopeSelect:o,children:r,...i}=l;return h.jsx(Jy,{__scopeSelect:o,...i,internal_do_not_use_render:({isFormControl:u})=>h.jsxs(h.Fragment,{children:[r,u?h.jsx(UC,{__scopeSelect:o}):null]})})},"Select"),uC="SelectTrigger",fC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,disabled:u=!1,...f}=o,m=pd(i),v=Ia(uC,i),y=v.disabled||u,p=Xe(r,v.onTriggerChange),w=Zs(i),g=b.useRef("touch"),[E,O,A]=vd(T=>{const S=w().filter(k=>!k.disabled),D=S.find(k=>k.value===v.value),z=yd(S,T,D);z!==void 0&&v.onValueChange(z.value)}),C=ze(T=>{y||(v.onOpenChange(!0),A()),T&&(v.triggerPointerDownPosRef.current={x:Math.round(T.pageX),y:Math.round(T.pageY)})},"handleOpen");return h.jsx(Ky,{asChild:!0,...m,children:h.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":v.open?v.contentId:void 0,"aria-expanded":v.open,"aria-required":v.required,"aria-autocomplete":"none",dir:v.dir,"data-state":v.open?"open":"closed",disabled:y,"data-disabled":y?"":void 0,"data-placeholder":Xi(v.value)?"":void 0,...f,ref:p,onClick:De(f.onClick,T=>{T.currentTarget.focus(),g.current!=="mouse"&&C(T)}),onPointerDown:De(f.onPointerDown,T=>{g.current=T.pointerType;const S=T.target;S.hasPointerCapture(T.pointerId)&&S.releasePointerCapture(T.pointerId),T.button===0&&T.ctrlKey===!1&&T.pointerType==="mouse"&&(C(T),T.preventDefault())}),onKeyDown:De(f.onKeyDown,T=>{const S=E.current!=="";!(T.ctrlKey||T.altKey||T.metaKey)&&T.key.length===1&&O(T.key),!(S&&T.key===" ")&&aC.includes(T.key)&&(C(),T.preventDefault())})})})},"SelectTrigger")),dC="SelectValue",mC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,className:u,style:f,children:m,placeholder:v="",...y}=o,p=Ia(dC,i),{onValueNodeHasChildrenChange:w}=p,g=m!==void 0,E=Xe(r,p.onValueNodeChange);at(()=>{w(g)},[w,g]);const O=Xi(p.value);return h.jsx(Ie.span,{...y,asChild:O?!1:y.asChild,ref:E,style:{pointerEvents:"none"},children:h.jsx(b.Fragment,{children:O?v:m},O?"placeholder":"value")})},"SelectValue")),hC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,children:u,...f}=o;return h.jsx(Ie.span,{"aria-hidden":!0,...f,ref:r,children:u||"▼"})},"SelectIcon")),pC="SelectPortal",[gC,vC]=Rl(pC,{forceMount:void 0}),yC=ze(l=>{const{__scopeSelect:o,forceMount:r,...i}=l;return h.jsx(gC,{scope:l.__scopeSelect,forceMount:r,children:h.jsx(od,{asChild:!0,...i})})},"SelectPortal"),Ol="SelectContent",bC=b.forwardRef(ze(function(o,r){const i=vC(Ol,o.__scopeSelect),{forceMount:u=i.forceMount,...f}=o,m=Ia(Ol,o.__scopeSelect),[v,y]=b.useState();return at(()=>{y(new DocumentFragment)},[]),h.jsx(jo,{present:u||m.open,children:({present:p})=>p?h.jsx(wC,{...f,ref:r}):h.jsx(xC,{...f,fragment:v})})},"SelectContent")),xC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,children:u,fragment:f}=o;return f?Ro.createPortal(h.jsx(Iy,{scope:i,children:h.jsx(Qs.Slot,{scope:i,children:h.jsx("div",{ref:r,children:u})})}),f):null},"SelectContentFragment")),Sn=10,[Iy,Nl]=Rl(Ol),SC=ua("SelectContent.RemoveScroll"),wC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i}=o,{position:u="item-aligned",onCloseAutoFocus:f,onEscapeKeyDown:m,onPointerDownOutside:v,side:y,sideOffset:p,align:w,alignOffset:g,arrowPadding:E,collisionBoundary:O,collisionPadding:A,sticky:C,hideWhenDetached:T,avoidCollisions:S,...D}=o,z=Ia(Ol,i),[k,I]=b.useState(null),[X,K]=b.useState(null),G=Xe(r,I),[ae,me]=b.useState(null),[ge,U]=b.useState(null),te=Zs(i),[fe,he]=b.useState(!1),j=b.useRef(!1);b.useEffect(()=>{if(k)return wy(k)},[k]),Us();const Y=b.useCallback(ne=>{const[re,...Le]=te().map(He=>He.ref.current),[Ce]=Le.slice(-1),Te=document.activeElement;for(const He of ne)if(He===Te||(He?.scrollIntoView({block:"nearest"}),He===re&&X&&(X.scrollTop=0),He===Ce&&X&&(X.scrollTop=X.scrollHeight),He?.focus(),document.activeElement!==Te))return},[te,X]),F=b.useCallback(()=>Y([ae,k]),[Y,ae,k]);b.useEffect(()=>{fe&&F()},[fe,F]);const{onOpenChange:oe,triggerPointerDownPosRef:P}=z;b.useEffect(()=>{if(k){let ne={x:0,y:0};const re=ze(Ce=>{ne={x:Math.abs(Math.round(Ce.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(Ce.pageY)-(P.current?.y??0))}},"handlePointerMove"),Le=ze(Ce=>{ne.x<=10&&ne.y<=10?Ce.preventDefault():Ce.composedPath().includes(k)||oe(!1),document.removeEventListener("pointermove",re),P.current=null},"handlePointerUp");return P.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Le,{capture:!0})}}},[k,oe,P]),b.useEffect(()=>{const ne=ze(()=>oe(!1),"close");return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[oe]);const[R,V]=vd(ne=>{const re=te().filter(Te=>!Te.disabled),Le=re.find(Te=>Te.ref.current===document.activeElement),Ce=yd(re,ne,Le);Ce&&setTimeout(()=>Ce.ref.current?.focus())}),Z=b.useCallback((ne,re,Le)=>{const Ce=!j.current&&!Le;(z.value!==void 0&&z.value===re||Ce)&&(me(ne),Ce&&(j.current=!0))},[z.value]),W=b.useCallback(()=>k?.focus(),[k]),ee=b.useCallback((ne,re,Le)=>{const Ce=!j.current&&!Le;(z.value!==void 0&&z.value===re||Ce)&&U(ne)},[z.value]),ie=u==="popper"?tv:EC,ye=ie===tv?{side:y,sideOffset:p,align:w,alignOffset:g,arrowPadding:E,collisionBoundary:O,collisionPadding:A,sticky:C,hideWhenDetached:T,avoidCollisions:S}:{};return h.jsx(Iy,{scope:i,content:k,viewport:X,onViewportChange:K,itemRefCallback:Z,selectedItem:ae,onItemLeave:W,itemTextRefCallback:ee,focusSelectedItem:F,selectedItemText:ge,position:u,isPositioned:fe,searchRef:R,children:h.jsx(rd,{as:SC,allowPinchZoom:!0,children:h.jsx(ry,{asChild:!0,trapped:z.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:De(f,ne=>{z.trigger?.focus({preventScroll:!0}),ne.preventDefault()}),children:h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>z.onOpenChange(!1),children:h.jsx(ie,{role:"listbox",id:z.contentId,"data-state":z.open?"open":"closed",dir:z.dir,onContextMenu:ne=>ne.preventDefault(),...D,...ye,onPlaced:()=>he(!0),ref:G,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:De(D.onKeyDown,ne=>{const re=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!re&&ne.key.length===1&&V(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let Ce=te().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Te=ne.target,He=Ce.indexOf(Te);Ce=Ce.slice(He+1)}setTimeout(()=>Y(Ce)),ne.preventDefault()}})})})})})})},"SelectContentImpl")),EC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,onPlaced:u,...f}=o,m=Ia(Ol,i),v=Nl(Ol,i),[y,p]=b.useState(null),[w,g]=b.useState(null),E=Xe(r,g),O=Zs(i),A=b.useRef(!1),C=b.useRef(!0),{viewport:T,selectedItem:S,selectedItemText:D,focusSelectedItem:z}=v,k=b.useCallback(()=>{if(m.trigger&&m.valueNode&&y&&w&&T&&S&&D){const G=m.trigger.getBoundingClientRect(),ae=w.getBoundingClientRect(),me=m.valueNode.getBoundingClientRect(),ge=D.getBoundingClientRect();if(m.dir!=="rtl"){const Te=ge.left-ae.left,He=me.left-Te,Ze=G.left-He,dt=G.width+Ze,Cn=Math.max(dt,ae.width),pn=window.innerWidth-Sn,Bn=Qf(He,[Sn,Math.max(Sn,pn-Cn)]);y.style.minWidth=dt+"px",y.style.left=Bn+"px"}else{const Te=ae.right-ge.right,He=window.innerWidth-me.right-Te,Ze=window.innerWidth-G.right-He,dt=G.width+Ze,Cn=Math.max(dt,ae.width),pn=window.innerWidth-Sn,Bn=Qf(He,[Sn,Math.max(Sn,pn-Cn)]);y.style.minWidth=dt+"px",y.style.right=Bn+"px"}const U=O(),te=window.innerHeight-Sn*2,fe=T.scrollHeight,he=window.getComputedStyle(w),j=parseInt(he.borderTopWidth,10),Y=parseInt(he.paddingTop,10),F=parseInt(he.borderBottomWidth,10),oe=parseInt(he.paddingBottom,10),P=j+Y+fe+oe+F,R=Math.min(S.offsetHeight*5,P),V=window.getComputedStyle(T),Z=parseInt(V.paddingTop,10),W=parseInt(V.paddingBottom,10),ee=G.top+G.height/2-Sn,ie=te-ee,ye=S.offsetHeight/2,ne=S.offsetTop+ye,re=j+Y+ne,Le=P-re;if(re<=ee){const Te=U.length>0&&S===U[U.length-1].ref.current;y.style.bottom="0px";const He=w.clientHeight-T.offsetTop-T.offsetHeight,Ze=Math.max(ie,ye+(Te?W:0)+He+F),dt=re+Ze;y.style.height=dt+"px"}else{const Te=U.length>0&&S===U[0].ref.current;y.style.top="0px";const Ze=Math.max(ee,j+T.offsetTop+(Te?Z:0)+ye)+Le;y.style.height=Ze+"px",T.scrollTop=re-ee+T.offsetTop}y.style.margin=`${Sn}px 0`,y.style.minHeight=R+"px",y.style.maxHeight=te+"px",u?.(),requestAnimationFrame(()=>A.current=!0)}},[O,m.trigger,m.valueNode,y,w,T,S,D,m.dir,u]);at(()=>k(),[k]);const[I,X]=b.useState();at(()=>{w&&X(window.getComputedStyle(w).zIndex)},[w]);const K=b.useCallback(G=>{G&&C.current===!0&&(k(),z?.(),C.current=!1)},[k,z]);return h.jsx(CC,{scope:i,contentWrapper:y,shouldExpandOnScrollRef:A,onScrollButtonChange:K,children:h.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:h.jsx(Ie.div,{...f,ref:E,style:{boxSizing:"border-box",maxHeight:"100%",...f.style}})})})},"SelectItemAlignedPosition")),tv=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,align:u="start",collisionPadding:f=Sn,...m}=o,v=pd(i);return h.jsx($y,{...v,...m,ref:r,align:u,collisionPadding:f,style:{boxSizing:"border-box",...m.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[CC,gd]=Rl(Ol,{}),nv="SelectViewport",TC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,nonce:u,...f}=o,m=Nl(nv,i),v=gd(nv,i),y=Xe(r,m.onViewportChange),p=b.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),h.jsx(Qs.Slot,{scope:i,children:h.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...f,ref:y,style:{position:"relative",flex:1,overflow:"hidden auto",...f.style},onScroll:De(f.onScroll,w=>{const g=w.currentTarget,{contentWrapper:E,shouldExpandOnScrollRef:O}=v;if(O?.current&&E){const A=Math.abs(p.current-g.scrollTop);if(A>0){const C=window.innerHeight-Sn*2,T=parseFloat(E.style.minHeight),S=parseFloat(E.style.height),D=Math.max(T,S);if(D0?I:0,E.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),AC="SelectGroup",[qA,YA]=Rl(AC),Zf="SelectItem",[_C,Fy]=Rl(Zf),OC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,value:u,disabled:f=!1,textValue:m,...v}=o,y=Ia(Zf,i),p=Nl(Zf,i),w=y.value===u,[g,E]=b.useState(m??""),[O,A]=b.useState(!1),C=kn(k=>p.itemRefCallback?.(k,u,f)),T=Xe(r,C),S=Tl(),D=b.useRef("touch"),z=ze(()=>{f||(y.onValueChange(u),y.onOpenChange(!1))},"handleSelect");return h.jsx(_C,{scope:i,value:u,disabled:f,textId:S,isSelected:w,onItemTextChange:b.useCallback(k=>{E(I=>I||(k?.textContent??"").trim())},[]),children:h.jsx(Qs.ItemSlot,{scope:i,value:u,disabled:f,textValue:g,children:h.jsx(Ie.div,{role:"option","aria-labelledby":S,"data-highlighted":O?"":void 0,"aria-selected":w&&O,"data-state":w?"checked":"unchecked","aria-disabled":f||void 0,"data-disabled":f?"":void 0,tabIndex:f?void 0:-1,...v,ref:T,onFocus:De(v.onFocus,()=>A(!0)),onBlur:De(v.onBlur,()=>A(!1)),onClick:De(v.onClick,()=>{D.current!=="mouse"&&z()}),onPointerUp:De(v.onPointerUp,()=>{D.current==="mouse"&&z()}),onPointerDown:De(v.onPointerDown,k=>{D.current=k.pointerType}),onPointerMove:De(v.onPointerMove,k=>{D.current=k.pointerType,f?p.onItemLeave?.():D.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:De(v.onPointerLeave,k=>{k.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:De(v.onKeyDown,k=>{f||k.target!==k.currentTarget||p.searchRef?.current!==""&&k.key===" "||(lC.includes(k.key)&&z(),k.key===" "&&k.preventDefault())})})})})},"SelectItem")),hs="SelectItemText",RC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,className:u,style:f,...m}=o,v=Ia(hs,i),y=Nl(hs,i),p=Fy(hs,i),w=sC(hs,i),[g,E]=b.useState(null),O=kn(z=>y.itemTextRefCallback?.(z,p.value,p.disabled)),A=Xe(r,E,p.onItemTextChange,O),C=g?.textContent,T=b.useMemo(()=>h.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:S,onNativeOptionRemove:D}=w;return at(()=>(S(T),()=>D(T)),[S,D,T]),h.jsxs(h.Fragment,{children:[h.jsx(Ie.span,{id:p.textId,...m,ref:A}),p.isSelected&&v.valueNode&&!v.valueNodeHasChildren&&!Xi(v.value)?Ro.createPortal(m.children,v.valueNode):null]})},"SelectItemText")),NC="SelectItemIndicator",jC=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,...u}=o;return Fy(NC,i).isSelected?h.jsx(Ie.span,{"aria-hidden":!0,...u,ref:r}):null},"SelectItemIndicator")),av="SelectScrollUpButton",DC=b.forwardRef(ze(function(o,r){const i=Nl(av,o.__scopeSelect),u=gd(av,o.__scopeSelect),[f,m]=b.useState(!1),v=Xe(r,u.onScrollButtonChange);return at(()=>{if(i.viewport&&i.isPositioned){let y=function(){const w=p.scrollTop>0;m(w)};ze(y,"handleScroll");const p=i.viewport;return y(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,i.isPositioned]),f?h.jsx(Wy,{...o,ref:v,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=i;y&&p&&(y.scrollTop=y.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),lv="SelectScrollDownButton",zC=b.forwardRef(ze(function(o,r){const i=Nl(lv,o.__scopeSelect),u=gd(lv,o.__scopeSelect),[f,m]=b.useState(!1),v=Xe(r,u.onScrollButtonChange);return at(()=>{if(i.viewport&&i.isPositioned){let y=function(){const w=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",y)}},[i.viewport,i.isPositioned]),f?h.jsx(Wy,{...o,ref:v,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=i;y&&p&&(y.scrollTop=y.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),Wy=b.forwardRef(ze(function(o,r){const{__scopeSelect:i,onAutoScroll:u,...f}=o,m=Nl("SelectScrollButton",i),v=b.useRef(null),y=Zs(i),p=b.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null)},[]);return b.useEffect(()=>()=>p(),[p]),at(()=>{y().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[y]),h.jsx(Ie.div,{"aria-hidden":!0,...f,ref:r,style:{flexShrink:0,...f.style},onPointerDown:De(f.onPointerDown,()=>{v.current===null&&(v.current=window.setInterval(u,50))}),onPointerMove:De(f.onPointerMove,()=>{m.onItemLeave?.(),v.current===null&&(v.current=window.setInterval(u,50))}),onPointerLeave:De(f.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),MC="SelectBubbleInput",UC=b.forwardRef(ze(function({__scopeSelect:o,...r},i){const u=Ia(MC,o),{value:f,onValueChange:m,required:v,disabled:y,name:p,autoComplete:w,form:g}=u,{nativeOptions:E,nativeSelectKey:O}=u,A=b.useRef(null),C=Xe(i,A),T=f??"",S=Py(T),D=Array.from(E).some(z=>(z.props.value??"")==="");return b.useEffect(()=>{const z=A.current;if(!z)return;const k=window.HTMLSelectElement.prototype,X=Object.getOwnPropertyDescriptor(k,"value").set;if(S!==T&&X){const K=new Event("change",{bubbles:!0});X.call(z,T),z.dispatchEvent(K)}},[S,T]),h.jsxs(Ie.select,{"aria-hidden":!0,required:v,tabIndex:-1,name:p,autoComplete:w,disabled:y,form:g,onChange:z=>m(z.target.value),...r,style:{...Bv,...r.style},ref:C,defaultValue:T,children:[Xi(f)&&!D?h.jsx("option",{value:""}):null,Array.from(E)]},O)},"SelectBubbleInput"));function e0(l){return typeof l=="function"}ze(e0,"isFunction");function Xi(l){return l===""||l===void 0}ze(Xi,"shouldShowPlaceholder");function vd(l){const o=kn(l),r=b.useRef(""),i=b.useRef(0),u=b.useCallback(m=>{const v=r.current+m;o(v),ze((function y(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>y(""),1e3))}),"updateSearch")(v)},[o]),f=b.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,u,f]}ze(vd,"useTypeaheadSearch");function yd(l,o,r){const u=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,f=r?l.indexOf(r):-1;let m=t0(l,Math.max(f,0));u.length===1&&(m=m.filter(p=>p!==r));const y=m.find(p=>p.textValue.toLowerCase().startsWith(u.toLowerCase()));return y!==r?y:void 0}ze(yd,"findNextItem");function t0(l,o){return l.map((r,i)=>l[(o+i)%l.length])}ze(t0,"wrapArray");var kC=Object.defineProperty,ft=(l,o)=>kC(l,"name",{value:o,configurable:!0}),[bd,VA]=Pa("Tooltip",[Gs]),Ks=Gs(),LC="TooltipProvider",HC=700,Kf="tooltip.open",[BC,xd]=bd(LC),qC=ft(l=>{const{__scopeTooltip:o,delayDuration:r=HC,skipDelayDuration:i=300,disableHoverableContent:u=!1,children:f}=l,m=b.useRef(!0),v=b.useRef(!1),y=b.useRef(0);return b.useEffect(()=>{const p=y.current;return()=>window.clearTimeout(p)},[]),h.jsx(BC,{scope:o,isOpenDelayedRef:m,delayDuration:r,onOpen:b.useCallback(()=>{i<=0||(window.clearTimeout(y.current),m.current=!1)},[i]),onClose:b.useCallback(()=>{i<=0||(window.clearTimeout(y.current),y.current=window.setTimeout(()=>m.current=!0,i))},[i]),isPointerInTransitRef:v,onPointerInTransitChange:b.useCallback(p=>{v.current=p},[]),disableHoverableContent:u,children:f})},"TooltipProvider"),$f="Tooltip",[YC,Qi]=bd($f),VC=ft(l=>{const{__scopeTooltip:o,children:r,open:i,defaultOpen:u,onOpenChange:f,disableHoverableContent:m,delayDuration:v}=l,y=xd($f,l.__scopeTooltip),p=Ks(o),[w,g]=b.useState(null),[E,O]=b.useState(void 0),A=Tl(),C=b.useRef(0),T=m??y.disableHoverableContent,S=v??y.delayDuration,D=b.useRef(!1),[z,k]=ki({prop:i,defaultProp:u??!1,onChange:ft(me=>{me?(y.onOpen(),document.dispatchEvent(new CustomEvent(Kf))):y.onClose(),f?.(me)},"onChange"),caller:$f}),I=b.useMemo(()=>z?D.current?"delayed-open":"instant-open":"closed",[z]),X=b.useCallback(()=>{window.clearTimeout(C.current),C.current=0,D.current=!1,k(!0)},[k]),K=b.useCallback(()=>{window.clearTimeout(C.current),C.current=0,k(!1)},[k]),G=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{D.current=!0,k(!0),C.current=0},S)},[S,k]);b.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]);const ae=E??A;return h.jsx(Zy,{...p,children:h.jsx(YC,{scope:o,contentId:ae,setContentId:O,open:z,stateAttribute:I,trigger:w,onTriggerChange:g,onTriggerEnter:b.useCallback(()=>{y.isOpenDelayedRef.current?G():X()},[y.isOpenDelayedRef,G,X]),onTriggerLeave:b.useCallback(()=>{T?K():(window.clearTimeout(C.current),C.current=0)},[K,T]),onOpen:X,onClose:K,disableHoverableContent:T,children:r})})},"Tooltip"),ov="TooltipTrigger",GC=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,...u}=o,f=Qi(ov,i),m=xd(ov,i),v=Ks(i),y=b.useRef(null),p=Xe(r,y,f.onTriggerChange),w=b.useRef(!1),g=b.useRef(!1),E=b.useCallback(()=>w.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",E),[E]),h.jsx(Ky,{asChild:!0,...v,children:h.jsx(Ie.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...u,ref:p,onPointerMove:De(o.onPointerMove,O=>{O.pointerType!=="touch"&&!g.current&&!m.isPointerInTransitRef.current&&(f.onTriggerEnter(),g.current=!0)}),onPointerLeave:De(o.onPointerLeave,()=>{f.onTriggerLeave(),g.current=!1}),onPointerDown:De(o.onPointerDown,()=>{f.open&&f.onClose(),w.current=!0,document.addEventListener("pointerup",E,{once:!0})}),onFocus:De(o.onFocus,()=>{w.current||f.onOpen()}),onBlur:De(o.onBlur,f.onClose),onClick:De(o.onClick,f.onClose)})})},"TooltipTrigger")),n0="TooltipPortal",[XC,QC]=bd(n0,{forceMount:void 0}),ZC=ft(l=>{const{__scopeTooltip:o,forceMount:r,children:i,container:u}=l,f=Qi(n0,o);return h.jsx(XC,{scope:o,forceMount:r,children:h.jsx(jo,{present:r||f.open,children:h.jsx(od,{asChild:!0,container:u,children:i})})})},"TooltipPortal"),qi="TooltipContent",KC=b.forwardRef(ft(function(o,r){const i=QC(qi,o.__scopeTooltip),{forceMount:u=i.forceMount,side:f="top",...m}=o,v=Qi(qi,o.__scopeTooltip);return h.jsx(jo,{present:u||v.open,children:v.disableHoverableContent?h.jsx(a0,{side:f,...m,ref:r}):h.jsx($C,{side:f,...m,ref:r})})},"TooltipContent")),$C=b.forwardRef(ft(function(o,r){const i=Qi(qi,o.__scopeTooltip),u=xd(qi,o.__scopeTooltip),f=b.useRef(null),m=Xe(r,f),[v,y]=b.useState(null),{trigger:p,onClose:w}=i,g=f.current,{onPointerInTransitChange:E}=u,O=b.useCallback(()=>{y(null),E(!1)},[E]),A=b.useCallback((C,T)=>{const S=C.currentTarget,D={x:C.clientX,y:C.clientY},z=l0(D,S.getBoundingClientRect()),k=o0(D,z),I=i0(T.getBoundingClientRect()),X=s0([...k,...I]);y(X),E(!0)},[E]);return b.useEffect(()=>()=>O(),[O]),b.useEffect(()=>{if(p&&g){const C=ft(S=>A(S,g),"handleTriggerLeave"),T=ft(S=>A(S,p),"handleContentLeave");return p.addEventListener("pointerleave",C),g.addEventListener("pointerleave",T),()=>{p.removeEventListener("pointerleave",C),g.removeEventListener("pointerleave",T)}}},[p,g,A,O]),b.useEffect(()=>{if(v){const C=ft(T=>{const S=T.target,D={x:T.clientX,y:T.clientY},z=p?.contains(S)||g?.contains(S),k=!r0(D,v);z?O():k&&(O(),w())},"handleTrackPointerGrace");return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,g,v,w,O]),h.jsx(a0,{...o,ref:m})},"TooltipContentHoverable")),PC=zv("TooltipContent"),a0=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,children:u,"aria-label":f,id:m,onEscapeKeyDown:v,onPointerDownOutside:y,...p}=o,w=Qi(qi,i),g=Ks(i),{onClose:E}=w;b.useEffect(()=>(document.addEventListener(Kf,E),()=>document.removeEventListener(Kf,E)),[E]),b.useEffect(()=>{if(w.trigger){const A=ft(C=>{C.target instanceof Node&&C.target.contains(w.trigger)&&E()},"handleScroll");return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[w.trigger,E]);const{setContentId:O}=w;return at(()=>(O(m),()=>{O(void 0)}),[m,O]),h.jsx(nd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:v,onPointerDownOutside:y,onFocusOutside:A=>A.preventDefault(),onDismiss:E,children:h.jsxs($y,{"data-state":w.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:w.contentId,...g,...p,ref:r,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(PC,{children:u}),f?h.jsx(bS,{id:w.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl")),JC=b.forwardRef(ft(function(o,r){const{__scopeTooltip:i,...u}=o,f=Ks(i);return h.jsx(KE,{...f,...u,ref:r})},"TooltipArrow"));function l0(l,o){const r=Math.abs(o.top-l.y),i=Math.abs(o.bottom-l.y),u=Math.abs(o.right-l.x),f=Math.abs(o.left-l.x);switch(Math.min(r,i,u,f)){case f:return"left";case u:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}ft(l0,"getExitSideFromRect");function o0(l,o,r=5){const i=[];switch(o){case"top":i.push({x:l.x-r,y:l.y+r},{x:l.x+r,y:l.y+r});break;case"bottom":i.push({x:l.x-r,y:l.y-r},{x:l.x+r,y:l.y-r});break;case"left":i.push({x:l.x+r,y:l.y-r},{x:l.x+r,y:l.y+r});break;case"right":i.push({x:l.x-r,y:l.y-r},{x:l.x-r,y:l.y+r});break}return i}ft(o0,"getPaddedExitPoints");function i0(l){const{top:o,right:r,bottom:i,left:u}=l;return[{x:u,y:o},{x:r,y:o},{x:r,y:i},{x:u,y:i}]}ft(i0,"getPointsFromRect");function r0(l,o){const{x:r,y:i}=l;let u=!1;for(let f=0,m=o.length-1;fi!=E>i&&r<(g-p)*(i-w)/(E-w)+p&&(u=!u)}return u}ft(r0,"isPointInPolygon");function s0(l){const o=l.slice();return o.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),c0(o)}ft(s0,"getHull");function c0(l){if(l.length<=1)return l.slice();const o=[];for(let i=0;i=2;){const f=o[o.length-1],m=o[o.length-2];if((f.x-m.x)*(u.y-m.y)>=(f.y-m.y)*(u.x-m.x))o.pop();else break}o.push(u)}o.pop();const r=[];for(let i=l.length-1;i>=0;i--){const u=l[i];for(;r.length>=2;){const f=r[r.length-1],m=r[r.length-2];if((f.x-m.x)*(u.y-m.y)>=(f.y-m.y)*(u.x-m.x))r.pop();else break}r.push(u)}return r.pop(),o.length===1&&r.length===1&&o[0].x===r[0].x&&o[0].y===r[0].y?o:o.concat(r)}ft(c0,"getHullPresorted");var IC=qC,FC=VC,WC=GC,eT=ZC,tT=KC,nT=JC;const aT=(l,o)=>{const r=new Array(l.length+o.length);for(let i=0;i({classGroupId:l,validator:o}),u0=(l=new Map,o=null,r)=>({nextPart:l,validators:o,classGroupId:r}),Ds="-",iv=[],oT="arbitrary..",iT=l=>{const o=sT(l),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=l;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return rT(m);const v=m.split(Ds),y=v[0]===""&&v.length>1?1:0;return f0(v,y,o)},getConflictingClassGroupIds:(m,v)=>{if(v){const y=i[m],p=r[m];return y?p?aT(p,y):y:p||iv}return r[m]||iv}}},f0=(l,o,r)=>{if(l.length-o===0)return r.classGroupId;const u=l[o],f=r.nextPart.get(u);if(f){const p=f0(l,o+1,f);if(p)return p}const m=r.validators;if(m===null)return;const v=o===0?l.join(Ds):l.slice(o).join(Ds),y=m.length;for(let p=0;pl.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=l.slice(1,-1),r=o.indexOf(":"),i=o.slice(0,r);return i?oT+i:void 0})(),sT=l=>{const{theme:o,classGroups:r}=l;return cT(r,o)},cT=(l,o)=>{const r=u0();for(const i in l){const u=l[i];Sd(u,r,i,o)}return r},Sd=(l,o,r,i)=>{const u=l.length;for(let f=0;f{if(typeof l=="string"){fT(l,o,r);return}if(typeof l=="function"){dT(l,o,r,i);return}mT(l,o,r,i)},fT=(l,o,r)=>{const i=l===""?o:d0(o,l);i.classGroupId=r},dT=(l,o,r,i)=>{if(hT(l)){Sd(l(i),o,r,i);return}o.validators===null&&(o.validators=[]),o.validators.push(lT(r,l))},mT=(l,o,r,i)=>{const u=Object.entries(l),f=u.length;for(let m=0;m{let r=l;const i=o.split(Ds),u=i.length;for(let f=0;f"isThemeGetter"in l&&l.isThemeGetter===!0,pT=l=>{if(l<1)return{get:()=>{},set:()=>{}};let o=0,r=Object.create(null),i=Object.create(null);const u=(f,m)=>{r[f]=m,o++,o>l&&(o=0,i=r,r=Object.create(null))};return{get(f){let m=r[f];if(m!==void 0)return m;if((m=i[f])!==void 0)return u(f,m),m},set(f,m){f in r?r[f]=m:u(f,m)}}},Pf="!",rv=":",gT=[],sv=(l,o,r,i,u)=>({modifiers:l,hasImportantModifier:o,baseClassName:r,maybePostfixModifierPosition:i,isExternal:u}),vT=l=>{const{prefix:o,experimentalParseClassName:r}=l;let i=u=>{const f=[];let m=0,v=0,y=0,p;const w=u.length;for(let C=0;Cy?p-y:void 0;return sv(f,O,E,A)};if(o){const u=o+rv,f=i;i=m=>m.startsWith(u)?f(m.slice(u.length)):sv(gT,!1,m,void 0,!0)}if(r){const u=i;i=f=>r({className:f,parseClassName:u})}return i},yT=l=>{const o=new Map;return l.orderSensitiveModifiers.forEach((r,i)=>{o.set(r,1e6+i)}),r=>{const i=[];let u=[];for(let f=0;f0&&(u.sort(),i.push(...u),u=[]),i.push(m)):u.push(m)}return u.length>0&&(u.sort(),i.push(...u)),i}},bT=l=>({cache:pT(l.cacheSize),parseClassName:vT(l),sortModifiers:yT(l),postfixLookupClassGroupIds:xT(l),...iT(l)}),xT=l=>{const o=Object.create(null),r=l.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:u,sortModifiers:f,postfixLookupClassGroupIds:m}=o,v=[],y=l.trim().split(ST);let p="";for(let w=y.length-1;w>=0;w-=1){const g=y[w],{isExternal:E,modifiers:O,hasImportantModifier:A,baseClassName:C,maybePostfixModifierPosition:T}=r(g);if(E){p=g+(p.length>0?" "+p:p);continue}let S=!!T,D;if(S){const K=C.substring(0,T);D=i(K);const G=D&&m[D]?i(C):void 0;G&&G!==D&&(D=G,S=!1)}else D=i(C);if(!D){if(!S){p=g+(p.length>0?" "+p:p);continue}if(D=i(C),!D){p=g+(p.length>0?" "+p:p);continue}S=!1}const z=O.length===0?"":O.length===1?O[0]:f(O).join(":"),k=A?z+Pf:z,I=k+D;if(v.indexOf(I)>-1)continue;v.push(I);const X=u(D,S);for(let K=0;K0?" "+p:p)}return p},ET=(...l)=>{let o=0,r,i,u="";for(;o{if(typeof l=="string")return l;let o,r="";for(let i=0;i{let r,i,u,f;const m=y=>{const p=o.reduce((w,g)=>g(w),l());return r=bT(p),i=r.cache.get,u=r.cache.set,f=v,v(y)},v=y=>{const p=i(y);if(p)return p;const w=wT(y,r);return u(y,w),w};return f=m,(...y)=>f(ET(...y))},TT=[],ut=l=>{const o=r=>r[l]||TT;return o.isThemeGetter=!0,o},h0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,p0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,AT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_T=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,RT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,NT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=l=>AT.test(l),Ae=l=>!!l&&!Number.isNaN(Number(l)),Dn=l=>!!l&&Number.isInteger(Number(l)),Tf=l=>l.endsWith("%")&&Ae(l.slice(0,-1)),oa=l=>_T.test(l),g0=()=>!0,DT=l=>OT.test(l)&&!RT.test(l),wd=()=>!1,zT=l=>NT.test(l),MT=l=>jT.test(l),UT=l=>!se(l)&&!ce(l),kT=l=>l.startsWith("@container")&&(l[10]==="/"&&l[11]!==void 0||l[11]==="s"&&l[16]!==void 0&&l.startsWith("-size/",10)||l[11]==="n"&&l[18]!==void 0&&l.startsWith("-normal/",10)),LT=l=>Fa(l,b0,wd),se=l=>h0.test(l),El=l=>Fa(l,x0,DT),cv=l=>Fa(l,QT,Ae),HT=l=>Fa(l,w0,g0),BT=l=>Fa(l,S0,wd),uv=l=>Fa(l,v0,wd),qT=l=>Fa(l,y0,MT),ps=l=>Fa(l,E0,zT),ce=l=>p0.test(l),Ni=l=>jl(l,x0),YT=l=>jl(l,S0),fv=l=>jl(l,v0),VT=l=>jl(l,b0),GT=l=>jl(l,y0),gs=l=>jl(l,E0,!0),XT=l=>jl(l,w0,!0),Fa=(l,o,r)=>{const i=h0.exec(l);return i?i[1]?o(i[1]):r(i[2]):!1},jl=(l,o,r=!1)=>{const i=p0.exec(l);return i?i[1]?o(i[1]):r:!1},v0=l=>l==="position"||l==="percentage",y0=l=>l==="image"||l==="url",b0=l=>l==="length"||l==="size"||l==="bg-size",x0=l=>l==="length",QT=l=>l==="number",S0=l=>l==="family-name",w0=l=>l==="number"||l==="weight",E0=l=>l==="shadow",ZT=()=>{const l=ut("color"),o=ut("font"),r=ut("text"),i=ut("font-weight"),u=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),v=ut("container"),y=ut("spacing"),p=ut("radius"),w=ut("shadow"),g=ut("inset-shadow"),E=ut("text-shadow"),O=ut("drop-shadow"),A=ut("blur"),C=ut("perspective"),T=ut("aspect"),S=ut("ease"),D=ut("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...k(),ce,se],X=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],G=()=>[ce,se,y],ae=()=>[Ga,"full","auto",...G()],me=()=>[Dn,"none","subgrid",ce,se],ge=()=>["auto",{span:["full",Dn,ce,se]},Dn,ce,se],U=()=>[Dn,"auto",ce,se],te=()=>["auto","min","max","fr",ce,se],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...G()],Y=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],F=()=>[Ga,"screen","full","dvw","lvw","svw","min","max","fit",...G()],oe=()=>[Ga,"screen","full","lh","dvh","lvh","svh","min","max","fit",...G()],P=()=>[l,ce,se],R=()=>[...k(),fv,uv,{position:[ce,se]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",VT,LT,{size:[ce,se]}],W=()=>[Tf,Ni,El],ee=()=>["","none","full",p,ce,se],ie=()=>["",Ae,Ni,El],ye=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ae,Tf,fv,uv],Le=()=>["","none",A,ce,se],Ce=()=>["none",Ae,ce,se],Te=()=>["none",Ae,ce,se],He=()=>[Ae,ce,se],Ze=()=>[Ga,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oa],breakpoint:[oa],color:[g0],container:[oa],"drop-shadow":[oa],ease:["in","out","in-out"],font:[UT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oa],shadow:[oa],spacing:["px",Ae],text:[oa],"text-shadow":[oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,se,ce,T]}],container:["container"],"container-type":[{"@container":["","normal","size",ce,se]}],"container-named":[kT],columns:[{columns:[Ae,se,ce,v]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",ce,se]}],basis:[{basis:[Ga,"full","auto",v,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,Ga,"auto","initial","none",se]}],grow:[{grow:["",Ae,ce,se]}],shrink:[{shrink:["",Ae,ce,se]}],order:[{order:[Dn,"first","last","none",ce,se]}],"grid-cols":[{"grid-cols":me()}],"col-start-end":[{col:ge()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":me()}],"row-start-end":[{row:ge()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pbs:[{pbs:G()}],pbe:[{pbe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...oe()]}],"min-block-size":[{"min-block":["auto",...oe()]}],"max-block-size":[{"max-block":["none",...oe()]}],w:[{w:[v,"screen",...Y()]}],"min-w":[{"min-w":[v,"screen","none",...Y()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[m]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",r,Ni,El]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,XT,HT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Tf,se]}],"font-family":[{font:[YT,BT,o]}],"font-features":[{"font-features":[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,ce,se]}],"line-clamp":[{"line-clamp":[Ae,"none",ce,cv]}],leading:[{leading:[f,...G()]}],"list-image":[{"list-image":["none",ce,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",ce,El]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ae,"auto",ce,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"tab-size":[{tab:[Dn,ce,se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,ce,se],radial:["",ce,se],conic:[Dn,ce,se]},GT,qT]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,ce,se]}],"outline-w":[{outline:["",Ae,Ni,El]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",w,gs,ps]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",g,gs,ps]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ae,El]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",E,gs,ps]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ae,ce,se]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ce,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,se]}],filter:[{filter:["","none",ce,se]}],blur:[{blur:Le()}],brightness:[{brightness:[Ae,ce,se]}],contrast:[{contrast:[Ae,ce,se]}],"drop-shadow":[{"drop-shadow":["","none",O,gs,ps]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Ae,ce,se]}],"hue-rotate":[{"hue-rotate":[Ae,ce,se]}],invert:[{invert:["",Ae,ce,se]}],saturate:[{saturate:[Ae,ce,se]}],sepia:[{sepia:["",Ae,ce,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,se]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,ce,se]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,ce,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,ce,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,ce,se]}],"backdrop-invert":[{"backdrop-invert":["",Ae,ce,se]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,ce,se]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,ce,se]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,ce,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",ce,se]}],ease:[{ease:["linear","initial",S,ce,se]}],delay:[{delay:[Ae,ce,se]}],animate:[{animate:["none",D,ce,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ce,se]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[ce,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ze()}],"translate-x":[{"translate-x":Ze()}],"translate-y":[{"translate-y":Ze()}],"translate-z":[{"translate-z":Ze()}],"translate-none":["translate-none"],zoom:[{zoom:[Dn,ce,se]}],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mbs":[{"scroll-mbs":G()}],"scroll-mbe":[{"scroll-mbe":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pbs":[{"scroll-pbs":G()}],"scroll-pbe":[{"scroll-pbe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,se]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Ae,Ni,El,cv]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},KT=CT(ZT);function Se(...l){return KT(Rv(l))}const $T=Vi("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Cl({className:l,variant:o="default",asChild:r=!1,...i}){const u=r?jv:"span";return h.jsx(u,{"data-slot":"badge","data-variant":o,className:Se($T({variant:o}),l),...i})}const PT=Vi("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ct({className:l,variant:o="default",size:r="default",asChild:i=!1,...u}){const f=i?jv:"button";return h.jsx(f,{"data-slot":"button","data-variant":o,"data-size":r,className:Se(PT({variant:o,size:r,className:l})),...u})}function Ui({className:l,type:o,...r}){return h.jsx("input",{type:o,"data-slot":"input",className:Se("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",l),...r})}function JT({className:l,...o}){return h.jsx("div",{"data-slot":"table-container",tabIndex:0,role:"region","aria-label":"Feedback queue, scrollable",className:"relative w-full overflow-x-auto focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ring)]",children:h.jsx("table",{"data-slot":"table",className:Se("w-full caption-bottom text-sm",l),...o})})}function IT({className:l,...o}){return h.jsx("thead",{"data-slot":"table-header",className:Se("[&_tr]:border-b",l),...o})}function FT({className:l,...o}){return h.jsx("tbody",{"data-slot":"table-body",className:Se("[&_tr:last-child]:border-0",l),...o})}function vs({className:l,...o}){return h.jsx("tr",{"data-slot":"table-row",className:Se("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",l),...o})}function Xa({className:l,...o}){return h.jsx("th",{"data-slot":"table-head",className:Se("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...o})}function zn({className:l,...o}){return h.jsx("td",{"data-slot":"table-cell",className:Se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...o})}function WT({className:l,...o}){return h.jsx("caption",{"data-slot":"table-caption",className:Se("mt-4 text-sm text-muted-foreground",l),...o})}const eA=Vi("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Jf({className:l,variant:o,...r}){return h.jsx("div",{"data-slot":"alert",role:"alert",className:Se(eA({variant:o}),l),...r})}function If({className:l,...o}){return h.jsx("div",{"data-slot":"alert-title",className:Se("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",l),...o})}function Ff({className:l,...o}){return h.jsx("div",{"data-slot":"alert-description",className:Se("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",l),...o})}function dv({className:l,...o}){return h.jsx("div",{"data-slot":"empty",className:Se("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",l),...o})}function mv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-header",className:Se("flex max-w-sm flex-col items-center gap-2 text-center",l),...o})}function hv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-title",className:Se("text-lg font-medium tracking-tight",l),...o})}function pv({className:l,...o}){return h.jsx("div",{"data-slot":"empty-description",className:Se("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",l),...o})}function To({className:l,...o}){return h.jsx("div",{"data-slot":"skeleton",className:Se("animate-pulse rounded-md bg-accent",l),...o})}function tA({delayDuration:l=0,...o}){return h.jsx(IC,{"data-slot":"tooltip-provider",delayDuration:l,...o})}function gv({...l}){return h.jsx(FC,{"data-slot":"tooltip",...l})}function vv({...l}){return h.jsx(WC,{"data-slot":"tooltip-trigger",...l})}function yv({className:l,sideOffset:o=0,children:r,...i}){return h.jsx(eT,{children:h.jsxs(tT,{"data-slot":"tooltip-content",sideOffset:o,className:Se("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",l),...i,children:[r,h.jsx(nT,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const ys=1e3;function zs(l){const o=new Date(l).getTime();if(Number.isNaN(o))return"—";const r=Math.max(0,Math.round((Date.now()-o)/6e4));if(r<1)return"just now";if(r<60)return`${r}m`;const i=Math.round(r/60);if(i<24)return`${i}h`;const u=Math.round(i/24);return u<30?`${u}d`:`${Math.round(u/30)}mo`}function nA(){const l=new URLSearchParams(window.location.search),o=r=>l.get(r)??void 0;return{project:o("project"),status:o("status"),type:o("type"),severity:o("severity"),assignee_agent:o("assignee_agent")}}function aA(){return new URLSearchParams(window.location.search).get("q")??""}let bv;function lA(l,o){clearTimeout(bv),bv=setTimeout(()=>{try{oA(l,o)}catch{}},150)}function oA(l,o){const r=new URLSearchParams;for(const[u,f]of Object.entries(l))f&&r.set(u,f);o.trim()&&r.set("q",o.trim());const i=r.toString();window.history.replaceState({},"",i?`/queue?${i}`:"/queue")}function iA(){const[l,o]=b.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches);return b.useEffect(()=>{const r=window.matchMedia("(min-width: 1024px)"),i=()=>o(r.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),l}function rA({navigate:l,themeToggle:o}){const[r,i]=b.useState(nA),[u,f]=b.useState([]),[m,v]=b.useState(aA),[y,p]=b.useState(!0),[w,g]=b.useState(null);b.useEffect(()=>{p(!0),Qa.list({project:r.project},ys).then(S=>{f(S.items),g(null)}).catch(S=>g(S.message)).finally(()=>p(!1))},[r.project]),b.useEffect(()=>lA(r,m),[r,m]),b.useEffect(()=>{const D=setInterval(()=>{document.hidden||Qa.list({project:r.project},ys).then(z=>f(z.items)).catch(()=>{})},1e4);return()=>clearInterval(D)},[r.project]);const E=b.useMemo(()=>{const S=new Map;for(const D of u)S.set(D.status,(S.get(D.status)??0)+1);return S},[u]),O=b.useMemo(()=>{const S=m.trim().toLowerCase();return u.filter(D=>(!r.status||D.status===r.status)&&(!r.type||D.type===r.type)&&(!r.severity||D.severity===r.severity)&&(!r.assignee_agent||D.assignee_agent===r.assignee_agent)&&(!S||D.title.toLowerCase().includes(S)||D.body.toLowerCase().includes(S)||D.id.toLowerCase().includes(S)))},[u,r,m]),A=(S,D)=>i(z=>({...z,[S]:z[S]===D?void 0:D})),C=Object.entries(r).filter(([,S])=>S),T=iA();return h.jsxs(h.Fragment,{children:[h.jsxs("header",{className:"flex min-w-0 flex-wrap items-baseline gap-3",children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:h.jsxs("span",{className:"break-all",children:["Loopback queue",r.project?` — ${r.project}`:""]})}),h.jsx("span",{className:"text-sm text-muted-foreground",role:"status","aria-live":"polite",children:y?"Loading feedback…":`${O.length}${O.length!==u.length?` of ${u.length}`:""} item${O.length===1?"":"s"}${u.length===ys?` (first ${ys})`:""}`}),h.jsxs("div",{className:"ml-auto flex w-full min-w-0 flex-1 basis-full items-center justify-end gap-2 sm:w-auto sm:min-w-56 sm:basis-auto",children:[h.jsx(Ui,{value:m,onChange:S=>v(S.target.value),placeholder:"Search title, body, id…","aria-label":"Search feedback",className:"h-11 w-full min-w-0 sm:w-56"}),o]})]}),h.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Something wrong or clumsy on ",h.jsx("em",{children:"this"})," page? Pin it — feedback about Loopback files to the ",h.jsx("code",{className:"font-mono text-xs",children:"loopback"})," ","project, the same loop everything else uses."]}),h.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[_v.filter(S=>E.get(S)).map(S=>h.jsxs(gv,{children:[h.jsx(vv,{asChild:!0,children:h.jsx("button",{onClick:()=>A("status",S),"aria-pressed":r.status===S,"aria-label":`${E.get(S)} ${S}. ${r.status===S?"Clear this filter":`Show only ${S} items`}`,className:"inline-flex h-11 items-center rounded-md px-1",children:h.jsxs(Cl,{className:`${Es[S]} pointer-events-none transition ${r.status===S?"ring-2 ring-ring ring-offset-1 ring-offset-background":"hover:opacity-85"}`,children:[E.get(S)," ",S]})})}),h.jsx(yv,{children:r.status===S?"Clear this filter":`Show only ${S}`})]},S)),C.length>0&&h.jsxs("div",{className:"ml-1 flex flex-wrap items-center gap-1.5 text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:"·"}),C.map(([S,D])=>h.jsxs(gv,{children:[h.jsx(vv,{asChild:!0,children:h.jsx("button",{onClick:()=>i(z=>({...z,[S]:void 0})),"aria-label":`${S.replace("_agent","")}: ${D} — remove this filter`,className:"inline-flex h-11 min-w-0 max-w-full items-center rounded-md px-1",children:h.jsxs(Cl,{variant:"outline",className:"pointer-events-none min-w-0 max-w-full gap-1 whitespace-normal",children:[h.jsxs("span",{className:"min-w-0 break-all",children:[S.replace("_agent",""),": ",h.jsx("strong",{children:D})]}),h.jsx(O1,{className:"size-3 shrink-0"})]})})}),h.jsx(yv,{children:"Remove this filter"})]},S)),h.jsx("button",{onClick:()=>{i({}),v("")},"aria-label":"Clear all filters and search",className:"inline-flex h-11 items-center rounded-md px-1",children:h.jsx(Cl,{variant:"outline",className:"pointer-events-none",children:"clear all"})})]})]}),w&&h.jsxs(Jf,{variant:"destructive",className:"mt-6",children:[h.jsx(If,{children:"Could not reach the hub"}),h.jsx(Ff,{children:w})]}),!T&&h.jsxs("div",{className:"mt-4 grid gap-2",children:[y&&Array.from({length:4},(S,D)=>h.jsx(To,{className:"h-24 w-full rounded-lg"},`msk-${D}`)),!y&&O.map(S=>h.jsxs("button",{onClick:()=>l(`/queue/${encodeURIComponent(S.id)}`),className:"grid min-w-0 gap-1.5 rounded-lg border p-3 text-left hover:bg-muted/50 [&>*]:min-w-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Cl,{className:Es[S.status],children:S.status}),h.jsx("span",{className:`font-mono text-xs ${Rf[S.severity]} ${Nf[S.severity]}`,children:S.severity}),h.jsx("span",{className:"text-xs text-muted-foreground",children:S.type}),(S.attachments?.length??0)>0&&h.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(_f,{className:"size-3","aria-hidden":!0}),h.jsx("span",{className:"sr-only",children:"Attachments:"}),S.attachments?.length]})]}),h.jsx("div",{className:"font-medium break-all",children:S.title}),h.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground",children:[h.jsx("span",{className:"break-all",children:S.project}),h.jsx("span",{"aria-hidden":!0,children:"·"}),h.jsx("span",{children:zs(S.created_at)}),S.assignee_agent&&h.jsxs(h.Fragment,{children:[h.jsx("span",{"aria-hidden":!0,children:"·"}),h.jsx("span",{className:"break-all",children:S.assignee_agent})]})]})]},S.id)),!y&&O.length===0&&h.jsx(dv,{className:"border",children:h.jsxs(mv,{children:[h.jsx(hv,{children:C.length>0||m?"Nothing matches":"The queue is empty"}),h.jsx(pv,{children:C.length>0||m?"No item matches the current filters.":"Pin something with the widget and it lands here."})]})})]}),T&&h.jsx("div",{className:"mt-4 rounded-lg border",children:h.jsxs(JT,{children:[h.jsx(WT,{className:"mt-3 text-xs",children:"Click a row to open it. Filters live in the URL — this view is linkable."}),h.jsx(IT,{children:h.jsxs(vs,{children:[h.jsx(Xa,{children:"id"}),h.jsx(Xa,{children:"project"}),h.jsx(Xa,{children:"sev / type"}),h.jsx(Xa,{children:"title"}),h.jsx(Xa,{children:"age"}),h.jsx(Xa,{children:"status"}),h.jsx(Xa,{children:"assignee"}),h.jsx(Xa,{children:"change"})]})}),h.jsxs(FT,{children:[y&&Array.from({length:5},(S,D)=>h.jsx(vs,{children:h.jsx(zn,{colSpan:8,children:h.jsx(To,{className:"h-5 w-full"})})},`sk-${D}`)),!y&&O.length===0&&h.jsx(vs,{children:h.jsx(zn,{colSpan:8,children:h.jsxs(dv,{className:"border-0 bg-transparent",children:[h.jsxs(mv,{children:[h.jsx(hv,{children:C.length>0||m?"Nothing matches":"The queue is empty"}),h.jsx(pv,{children:C.length>0||m?"No item matches the current filters.":"Pin something with the widget and it lands here."})]}),(C.length>0||m)&&h.jsx(Ct,{variant:"outline",size:"sm",onClick:()=>{i({}),v("")},children:"Clear filters"})]})})}),O.map(S=>h.jsxs(vs,{className:"cursor-pointer",onClick:()=>l(`/queue/${encodeURIComponent(S.id)}`),children:[h.jsx(zn,{children:h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 font-mono text-xs",onClick:D=>{D.stopPropagation(),l(`/queue/${encodeURIComponent(S.id)}`)},children:S.id})}),h.jsx(zn,{children:h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 text-sm","aria-pressed":r.project===S.project,"aria-label":`Filter by project ${S.project}`,onClick:D=>{D.stopPropagation(),A("project",S.project)},children:S.project})}),h.jsxs(zn,{className:"whitespace-nowrap",children:[h.jsx(Ct,{variant:"link",className:`h-auto min-h-6 min-w-6 p-0 font-mono text-xs ${Rf[S.severity]} ${Nf[S.severity]}`,"aria-pressed":r.severity===S.severity,"aria-label":`Filter by severity ${S.severity}`,onClick:D=>{D.stopPropagation(),A("severity",S.severity)},children:S.severity})," ",h.jsx(Ct,{variant:"link",className:"h-auto min-h-6 min-w-6 p-0 text-xs text-muted-foreground","aria-pressed":r.type===S.type,"aria-label":`Filter by type ${S.type}`,onClick:D=>{D.stopPropagation(),A("type",S.type)},children:S.type})]}),h.jsxs(zn,{className:"min-w-[16rem] font-medium break-all whitespace-normal",children:[S.title,(S.attachments?.length??0)>0&&h.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(_f,{className:"size-3","aria-hidden":!0}),h.jsx("span",{className:"sr-only",children:"Attachments:"}),S.attachments?.length]})]}),h.jsx(zn,{className:"whitespace-nowrap text-sm text-muted-foreground",children:h.jsx("time",{dateTime:S.created_at,children:zs(S.created_at)})}),h.jsx(zn,{children:h.jsx(Cl,{asChild:!0,className:`${Es[S.status]} min-h-6 cursor-pointer`,children:h.jsx("button",{"aria-pressed":r.status===S.status,"aria-label":`Filter by status ${S.status}`,onClick:D=>{D.stopPropagation(),A("status",S.status)},children:S.status})})}),h.jsx(zn,{className:"text-sm",children:S.assignee_agent??h.jsx("span",{className:"text-muted-foreground",children:"—"})}),h.jsx(zn,{className:"text-sm",children:Za(S.links.pr_url)?h.jsx("a",{href:Za(S.links.pr_url)??void 0,onClick:D=>D.stopPropagation(),target:"_blank",rel:"noreferrer noopener",className:"inline-flex min-h-6 min-w-6 items-center justify-center underline",children:"PR"}):S.links.commit?h.jsx("code",{className:"font-mono text-xs",children:S.links.commit.slice(0,9)}):h.jsx("span",{className:"text-muted-foreground",children:"—"})})]},S.id))]})]})})]})}function ji({className:l,...o}){return h.jsx("div",{"data-slot":"card",className:Se("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",l),...o})}function xv({className:l,...o}){return h.jsx("textarea",{"data-slot":"textarea",className:Se("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",l),...o})}function bs({...l}){return h.jsx(cC,{"data-slot":"select",...l})}function xs({...l}){return h.jsx(mC,{"data-slot":"select-value",...l})}function Ss({className:l,size:o="default",children:r,...i}){return h.jsxs(fC,{"data-slot":"select-trigger","data-size":o,className:Se("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground 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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",l),...i,children:[r,h.jsx(hC,{asChild:!0,children:h.jsx(Av,{className:"size-4 opacity-50"})})]})}function ws({className:l,children:o,position:r="item-aligned",align:i="center",...u}){return h.jsx(yC,{children:h.jsxs(bC,{"data-slot":"select-content",className:Se("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 bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",r==="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",l),position:r,align:i,...u,children:[h.jsx(sA,{}),h.jsx(TC,{className:Se("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),h.jsx(cA,{})]})})}function Di({className:l,children:o,...r}){return h.jsxs(OC,{"data-slot":"select-item",className:Se("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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",l),...r,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(jC,{children:h.jsx(n1,{className:"size-4"})})}),h.jsx(RC,{children:o})]})}function sA({className:l,...o}){return h.jsx(DC,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",l),...o,children:h.jsx(o1,{className:"size-4"})})}function cA({className:l,...o}){return h.jsx(zC,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",l),...o,children:h.jsx(Av,{className:"size-4"})})}const C0="lb-author";function T0(){try{return localStorage.getItem(C0)}catch{return null}}function uA(l){try{localStorage.setItem(C0,l)}catch{}}const fA="unknown-human";function dA(){return T0()?.trim()||fA}function Sv(l){const o=l.trim().slice(0,40);o&&uA(o)}function mA(){return!!T0()?.trim()}function zi({className:l,...o}){return h.jsx(IE,{"data-slot":"label",className:Se("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",l),...o})}const hA=Vi("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-0 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function pA({className:l,state:o="done",size:r="default",orientation:i="horizontal",...u}){return h.jsx("div",{"data-slot":"attachment","data-state":o,"data-size":r,"data-orientation":i,className:Se(hA({size:r,orientation:i}),l),...u})}const gA=Vi("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function vA({className:l,variant:o="icon",...r}){return h.jsx("div",{"data-slot":"attachment-media","data-variant":o,className:Se(gA({variant:o}),l),...r})}function yA({className:l,...o}){return h.jsx("div",{"data-slot":"attachment-content",className:Se("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",l),...o})}function bA({className:l,...o}){return h.jsx("span",{"data-slot":"attachment-title",className:Se("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",l),...o})}function xA({className:l,...o}){return h.jsx("span",{"data-slot":"attachment-description",className:Se("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",l),...o})}function SA({className:l,...o}){return h.jsx("div",{"data-slot":"attachment-actions",className:Se("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",l),...o})}function wA({className:l,variant:o,size:r="icon-xs",...i}){return h.jsx(Ct,{"data-slot":"attachment-action",variant:o??"ghost",size:r,className:Se(l),...i})}function EA({...l}){return h.jsx(p2,{"data-slot":"alert-dialog",...l})}function CA({...l}){return h.jsx(g2,{"data-slot":"alert-dialog-trigger",...l})}function TA({...l}){return h.jsx(v2,{"data-slot":"alert-dialog-portal",...l})}function AA({className:l,...o}){return h.jsx(y2,{"data-slot":"alert-dialog-overlay",className:Se("fixed inset-0 z-50 bg-[color-mix(in_oklch,var(--lb-scrim)_60%,transparent)] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",l),...o})}function _A({className:l,size:o="default",...r}){return h.jsxs(TA,{children:[h.jsx(AA,{}),h.jsx(b2,{"data-slot":"alert-dialog-content","data-size":o,className:Se("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",l),...r})]})}function OA({className:l,...o}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:Se("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",l),...o})}function RA({className:l,...o}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:Se("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",l),...o})}function NA({className:l,...o}){return h.jsx(w2,{"data-slot":"alert-dialog-title",className:Se("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",l),...o})}function jA({className:l,...o}){return h.jsx(E2,{"data-slot":"alert-dialog-description",className:Se("text-sm text-muted-foreground",l),...o})}function DA({className:l,variant:o="default",size:r="default",...i}){return h.jsx(Ct,{variant:o,size:r,asChild:!0,children:h.jsx(x2,{"data-slot":"alert-dialog-action",className:Se(l),...i})})}function zA({className:l,variant:o="outline",size:r="default",...i}){return h.jsx(Ct,{variant:o,size:r,asChild:!0,children:h.jsx(S2,{"data-slot":"alert-dialog-cancel",className:Se(l),...i})})}const Mi=()=>dA(),Ms="text-[11px] font-medium text-muted-foreground";function gt({label:l,children:o,region:r}){return r?h.jsxs("section",{className:"grid min-w-0 gap-1.5","aria-label":l,children:[h.jsx("h2",{className:Ms,children:l}),h.jsx("div",{className:"min-w-0",children:o})]}):h.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[h.jsx("span",{className:Ms,children:l}),h.jsx("div",{className:"min-w-0",children:o})]})}const Af=({children:l,label:o})=>h.jsx("pre",{tabIndex:0,role:"group","aria-label":o,className:"mt-0.5 overflow-x-auto whitespace-pre-wrap rounded-md border bg-background p-2.5 font-mono text-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ring)]",children:l});function MA({id:l,navigate:o,themeToggle:r}){const[i,u]=b.useState(null),[f,m]=b.useState(null),[v,y]=b.useState(!1),[p,w]=b.useState({}),[g,E]=b.useState(""),[O,A]=b.useState(""),[C,T]=b.useState("reference"),[S,D]=b.useState(""),[z,k]=b.useState(!1),I=b.useRef(null),X=()=>{Qa.get(l).then(U=>{u(U),m(null)}).catch(U=>m(U.message))};if(b.useEffect(X,[l]),b.useEffect(()=>{const U=setInterval(()=>{!document.hidden&&!z&&!v&&X()},1e4);return()=>clearInterval(U)},[l,z,v]),f)return h.jsxs("div",{className:"grid gap-4",children:[h.jsxs("h1",{className:"text-xl font-semibold tracking-tight",children:["Could not load ",l]}),h.jsxs(Jf,{variant:"destructive",children:[h.jsx(If,{children:"The hub did not return this item"}),h.jsx(Ff,{children:f})]}),h.jsx(Ct,{variant:"outline",onClick:()=>o("/queue"),children:"Back to the queue"})]});if(!i)return h.jsxs("div",{className:"grid gap-4",children:[h.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Loading feedback item"}),h.jsxs("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:["Loading ",l,"…"]}),h.jsx(To,{className:"h-8 w-40"}),h.jsx(To,{className:"h-7 w-2/3"}),h.jsx(To,{className:"h-28 w-full"}),h.jsx(To,{className:"h-40 w-full"})]});const K=i.extra.failed_responses,G=i.extra.context,ae=async(U,te)=>{if(z)return;const fe=document.activeElement,he=fe?.closest("[data-slot=card], header"),j=te??fe?.closest("[data-lb-region]")?.getAttribute("data-lb-region")??null;k(!0);try{await U()}catch(Y){Sl.error(Y.message)}finally{k(!1),requestAnimationFrame(()=>{if(fe&&document.contains(fe)&&!fe.disabled){fe.focus();return}const oe=(j?document.querySelector(`[data-lb-region="${j}"]`):null)??(he&&document.contains(he)?he:null);oe&&(oe.setAttribute("tabindex","-1"),oe.focus({preventScroll:!0}))})}},me=()=>ae(async()=>{await Qa.update(l,{...p,author:Mi()}),Sl.success("Saved — the change is on the audit trail"),y(!1),w({}),X()},"detail-header"),ge=async U=>{if(C==="asset"&&!S.trim()){Sl.error("An asset needs a target path — where should it land in the repo?");return}return ae(async()=>{await Qa.attach(l,U,{intent:C,target:C==="asset"?S.trim():void 0,author:Mi()}),Sl.success(C==="asset"?`Attached as an asset — an agent will copy it to ${S.trim()}`:"Attached as reference — context for the fix"),D(""),X()})};return h.jsxs("div",{className:"grid min-w-0 gap-4 [&>*]:min-w-0",children:[h.jsxs("header",{"data-lb-region":"detail-header",className:"flex flex-wrap items-center gap-3",children:[h.jsxs(Ct,{variant:"ghost",size:"sm",className:"h-11",onClick:()=>o("/queue"),children:[h.jsx(e1,{className:"size-4"})," Queue"]}),h.jsx(Cl,{className:Es[i.status],children:i.status}),h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[!v&&h.jsxs(Ct,{variant:"outline",size:"sm",onClick:()=>{w({title:i.title,body:i.body,severity:i.severity,type:i.type}),y(!0),requestAnimationFrame(()=>{document.getElementById("lb-edit-title")?.focus()})},children:[h.jsx(x1,{className:"size-4"})," Edit"]}),r]})]}),h.jsx("h1",{className:"text-xl font-semibold tracking-tight break-all",children:i.title}),v?h.jsxs(ji,{"data-lb-region":"edit",className:"grid min-w-0 gap-3 p-4 [&>*]:min-w-0",children:[h.jsx(zi,{htmlFor:"lb-edit-title",className:"sr-only",children:"Title"}),h.jsx(Ui,{id:"lb-edit-title",value:p.title??"",onChange:U=>w(te=>({...te,title:U.target.value})),className:"text-base font-medium"}),h.jsx(zi,{htmlFor:"lb-edit-body",className:"sr-only",children:"Report"}),h.jsx(xv,{id:"lb-edit-body",value:p.body??"",rows:6,onChange:U=>w(te=>({...te,body:U.target.value}))}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsxs(bs,{value:p.severity,onValueChange:U=>w(te=>({...te,severity:U})),children:[h.jsx(Ss,{className:"w-32","aria-label":"Severity",children:h.jsx(xs,{})}),h.jsx(ws,{children:lS.map(U=>h.jsx(Di,{value:U,children:U},U))})]}),h.jsxs(bs,{value:p.type,onValueChange:U=>w(te=>({...te,type:U})),children:[h.jsx(Ss,{className:"w-36","aria-label":"Type",children:h.jsx(xs,{})}),h.jsx(ws,{children:oS.map(U=>h.jsx(Di,{value:U,children:U},U))})]}),h.jsx(Ct,{size:"sm",onClick:me,disabled:z,children:z?"Saving…":"Save"}),h.jsx(Ct,{variant:"ghost",size:"sm",onClick:()=>{y(!1),w({}),requestAnimationFrame(()=>{const U=document.querySelector('[data-lb-region="detail-header"]');U?.setAttribute("tabindex","-1"),U?.focus({preventScroll:!0})})},children:"Cancel"})]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Every edit is recorded on the trail with its old value — nothing is rewritten silently."})]}):h.jsx("code",{className:"font-mono text-xs break-all text-muted-foreground",children:i.id}),h.jsxs(ji,{className:"grid grid-cols-[repeat(auto-fit,minmax(170px,1fr))] gap-3 p-4",children:[h.jsx(gt,{label:"Project",children:h.jsx("span",{className:"break-all",children:i.project})}),h.jsxs(gt,{label:"Severity / type",children:[h.jsx("span",{className:`font-mono text-xs ${Rf[i.severity]} ${Nf[i.severity]}`,children:i.severity})," ",h.jsx("span",{className:"text-sm text-muted-foreground",children:i.type})]}),h.jsx(gt,{label:"Source / reporter",children:h.jsxs("span",{className:"text-sm break-all",children:[i.source," · ",i.reporter]})}),h.jsx(gt,{label:"Assignee",children:h.jsx("span",{className:"text-sm break-all",children:i.assignee_agent??"unclaimed"})}),h.jsx(gt,{label:"Route",children:h.jsx("code",{className:"font-mono text-xs break-all",children:i.route??"—"})}),h.jsx(gt,{label:"Age",children:h.jsx("time",{dateTime:i.created_at,className:"text-sm",title:i.created_at,children:zs(i.created_at)})}),h.jsx(gt,{label:"Updated",children:h.jsx("time",{dateTime:i.updated_at,className:"text-sm text-muted-foreground",title:i.updated_at,children:zs(i.updated_at)})}),i.resolution&&h.jsx(gt,{label:"Resolution",children:h.jsx("span",{className:"text-sm",children:i.resolution})})]}),h.jsxs("div",{className:"grid gap-3.5",children:[i.body&&!v&&h.jsx(gt,{region:!0,label:"Report",children:h.jsx("div",{className:"whitespace-pre-wrap break-all text-sm",children:i.body})}),i.repro_steps.length>0&&h.jsx(gt,{region:!0,label:"Repro steps",children:h.jsx("ol",{className:"list-decimal pl-5 text-sm break-all",children:i.repro_steps.map((U,te)=>h.jsx("li",{children:U},te))})}),K&&K.length>0&&h.jsx(gt,{region:!0,label:"Failed requests (captured at report time)",children:K.map((U,te)=>h.jsxs("div",{className:"mb-2",children:[h.jsxs("code",{className:"font-mono text-xs break-all",children:[U.status," ",U.url]}),U.body&&h.jsx(Af,{label:`Response body for ${U.status} ${U.url}`,children:U.body})]},te))}),G&&h.jsx(gt,{region:!0,label:"Run context (AI / automation)",children:h.jsx(Af,{label:"Run context JSON",children:JSON.stringify(G,null,2)})}),i.console.length>0&&h.jsx(gt,{region:!0,label:`Console (${i.console.length})`,children:h.jsx(Af,{label:"Console capture",children:i.console.join(` +`)})}),Object.values(i.links).some(Boolean)&&h.jsx(gt,{region:!0,label:"Linked change",children:h.jsx("div",{className:"text-sm",children:Object.entries(i.links).filter(([,U])=>U).map(([U,te])=>h.jsxs("div",{children:[h.jsxs("span",{className:"text-muted-foreground",children:[U,":"]})," ",U==="pr_url"&&Za(String(te))?h.jsx("a",{className:"inline-block min-h-6 break-all underline",href:Za(String(te))??void 0,target:"_blank",rel:"noreferrer noopener",children:String(te)}):h.jsx("code",{className:"font-mono text-xs break-all",children:String(te)})]},U))})}),i.dom_selector&&h.jsx(gt,{region:!0,label:"Anchor",children:h.jsx("code",{className:"font-mono text-xs break-all",children:i.dom_selector})}),i.url&&h.jsx(gt,{region:!0,label:"Reported from",children:Za(i.url)?h.jsx("a",{className:"inline-block min-h-6 text-sm break-all underline",href:Za(i.url)??void 0,target:"_blank",rel:"noreferrer noopener",children:i.url}):h.jsx("span",{className:"text-sm break-all",children:i.url})}),i.network.length>0&&h.jsx(gt,{region:!0,label:`Network at report time (${i.network.length})`,children:h.jsx("div",{className:"grid gap-1",children:i.network.slice(-8).map((U,te)=>h.jsxs("div",{className:"flex flex-wrap items-baseline gap-2 font-mono text-xs",children:[h.jsx("span",{className:(U.status??0)>=400||U.status===0?"text-lb-p0 font-semibold":"text-muted-foreground",children:U.status??"—"}),h.jsx("span",{className:"text-muted-foreground",children:U.method??"GET"}),h.jsx("span",{className:"break-all",children:U.url}),U.ms!==void 0&&h.jsxs("span",{className:"text-muted-foreground",children:[U.ms,"ms"]})]},te))})})]}),h.jsxs(ji,{"data-lb-region":"attachments",className:"grid gap-3 p-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(_f,{className:"size-4"}),h.jsxs("span",{className:"text-sm font-medium",children:["Attachments",i.attachments?.length?` (${i.attachments.length})`:""]})]}),i.attachments?.map(U=>h.jsxs(pA,{className:"w-full",children:[h.jsx(vA,{variant:U.mime.startsWith("image/")?"image":"icon",children:U.mime.startsWith("image/")?h.jsx("img",{src:U.url,alt:""}):h.jsx(c1,{"aria-hidden":!0})}),h.jsxs(yA,{className:"min-w-0",children:[h.jsx(bA,{className:"whitespace-normal",title:U.name,children:Za(U.url)?h.jsx("a",{className:"inline-block min-h-6 break-all underline",href:Za(U.url)??void 0,target:"_blank",rel:"noreferrer noopener",children:U.name}):h.jsx("span",{className:"break-all",children:U.name})}),h.jsxs(xA,{className:"whitespace-normal break-all",title:U.target_path??void 0,children:[h.jsx(Cl,{variant:U.intent==="asset"?"default":"secondary",children:U.intent})," ",iS(U.size),U.target_path?` → ${U.target_path}`:""]})]}),h.jsx(SA,{children:h.jsxs(EA,{children:[h.jsx(CA,{asChild:!0,children:h.jsx(wA,{"aria-label":`Remove attachment ${U.name}`,disabled:z,children:h.jsx(C1,{})})}),h.jsxs(_A,{className:"max-w-[calc(100vw-2rem)]",children:[h.jsxs(OA,{className:"min-w-0",children:[h.jsxs(NA,{className:"min-w-0 break-all",children:["Remove “",U.name,"”?"]}),h.jsx(jA,{children:"The file is deleted from the hub. This cannot be undone."})]}),h.jsxs(RA,{children:[h.jsx(zA,{children:"Keep it"}),h.jsx(DA,{onClick:()=>ae(async()=>{await Qa.detach(l,U.id,Mi()),Sl.success("Removed"),X()},"attachments"),children:"Remove"})]})]})]})})]},U.id)),h.jsxs("div",{className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,auto)_minmax(0,1fr)_auto] sm:items-center [&>*]:min-w-0",children:[h.jsxs(bs,{value:C,onValueChange:U=>T(U),children:[h.jsx(Ss,{"aria-label":"Attachment intent",children:h.jsx(xs,{})}),h.jsxs(ws,{children:[h.jsx(Di,{value:"reference",children:"reference"}),h.jsx(Di,{value:"asset",children:"asset"})]})]}),h.jsx(Ui,{"aria-label":"Target path in the repo",placeholder:C==="asset"?"Target path in the repo, e.g. public/logos/acme.svg":"Context for the fix — no target path needed",value:S,disabled:C==="reference",onChange:U=>D(U.target.value)}),h.jsx(Ct,{variant:"outline",size:"sm",disabled:z,onClick:()=>I.current?.click(),children:z?"Uploading…":"Choose file"}),h.jsx("input",{ref:I,type:"file","aria-label":"Choose a file to attach",tabIndex:-1,className:"hidden",onChange:U=>{const te=U.target.files?.[0];te&&ge(te),U.target.value=""}})]}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.jsx("strong",{children:"reference"})," is context for the fix and never ships."," ",h.jsx("strong",{children:"asset"})," is a deliverable — an agent copies it to the target path in the repo and commits it."]})]}),i.comments&&i.comments.length>0&&h.jsx(gt,{region:!0,label:`Trail (${i.comments.length})`,children:h.jsx("div",{className:"grid gap-2",children:i.comments.map(U=>h.jsxs("div",{className:"min-w-0 py-2 not-last:border-b",children:[h.jsxs("div",{className:"text-xs break-all text-muted-foreground",children:[U.author," · ",U.created_at]}),h.jsx("div",{className:"mt-0.5 whitespace-pre-wrap break-all text-sm",children:U.body})]},U.id))})}),!mA()&&h.jsxs(Jf,{children:[h.jsx(If,{children:"Who is writing to this trail?"}),h.jsx(Ff,{children:h.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[h.jsx(zi,{htmlFor:"lb-author",className:"sr-only",children:"Your name"}),h.jsx(Ui,{id:"lb-author",className:"h-11 w-full max-w-48 min-w-0",placeholder:"Your name or handle",defaultValue:"",onKeyDown:U=>{U.key==="Enter"&&(Sv(U.target.value),X())}}),h.jsx(Ct,{size:"sm",className:"h-11",onClick:()=>{const U=document.getElementById("lb-author");U&&Sv(U.value),X(),requestAnimationFrame(()=>{const te=document.querySelector('[data-lb-region="comment"]');te?.setAttribute("tabindex","-1"),te?.focus({preventScroll:!0})})},children:"Save"}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:["Stored in this browser only. Until then, writes are recorded as"," ",h.jsx("code",{className:"font-mono",children:"unknown-human"}),"."]})]})})]}),h.jsxs("div",{className:"grid min-w-0 gap-4 sm:grid-cols-2 [&>*]:min-w-0",children:[h.jsxs(ji,{"data-lb-region":"comment",className:"grid gap-2 p-4",children:[h.jsx(zi,{htmlFor:"lb-comment",className:Ms,children:"Add a comment"}),h.jsx(xv,{id:"lb-comment",rows:3,value:g,onChange:U=>E(U.target.value),placeholder:"What you noticed, decided, or want the agent to know"}),h.jsx(Ct,{size:"sm",disabled:z||!g.trim(),onClick:()=>ae(async()=>{await Qa.comment(l,g,Mi()),E(""),Sl.success("Comment added"),X()}),children:z?"Adding…":"Comment"})]}),h.jsxs(ji,{"data-lb-region":"status",className:"grid gap-2 p-4",children:[h.jsx(zi,{htmlFor:"lb-status-note",className:Ms,children:"Change status"}),h.jsx(Ui,{id:"lb-status-note",placeholder:"Why — recorded on the trail. Type this first.",value:O,onChange:U=>A(U.target.value)}),h.jsxs(bs,{value:i.status,onValueChange:U=>ae(async()=>{await Qa.setStatus(l,U,O,Mi()),A(""),Sl.success(`Status is now ${U}`),X()},"status"),children:[h.jsx(Ss,{"aria-label":"Status",disabled:z,children:h.jsx(xs,{})}),h.jsx(ws,{children:_v.map(U=>h.jsx(Di,{value:U,children:U},U))})]})]})]})]})}function UA(){const[l,o]=b.useState(window.location.pathname);b.useEffect(()=>{const f=()=>o(window.location.pathname);return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[]);const r=b.useCallback(f=>{window.history.pushState({},"",f),o(new URL(f,window.location.origin).pathname)},[]),i=/^\/queue\/(.+)$/.exec(l),u=i?decodeURIComponent(i[1]):null;return b.useEffect(()=>{document.title=u?`${u} — Loopback`:"Loopback queue";const f=document.getElementById("lb-main");f&&f.focus({preventScroll:!0})},[u]),{id:u,navigate:r}}function wv(){const[l,o]=b.useState(()=>document.documentElement.classList.contains("dark"));return h.jsx(Ct,{variant:"outline",size:"sm",className:"size-11",onClick:()=>{const r=document.documentElement.classList.toggle("dark");try{localStorage.setItem("lb-theme",r?"dark":"light")}catch{}o(r)},"aria-pressed":l,"aria-label":l?"Dark theme on. Switch to light.":"Light theme on. Switch to dark.",children:l?h.jsx(w1,{className:"size-4"}):h.jsx(p1,{className:"size-4"})})}function kA(){const{id:l,navigate:o}=UA();return h.jsxs(tA,{delayDuration:200,children:[h.jsx("main",{id:"lb-main",tabIndex:-1,className:"mx-auto max-w-[1180px] px-4 py-8 outline-none sm:px-6",children:l?h.jsx(MA,{id:l,navigate:o,themeToggle:h.jsx(wv,{})}):h.jsx(rA,{navigate:o,themeToggle:h.jsx(wv,{})})}),h.jsx(aS,{position:"bottom-right"})]})}Zx.createRoot(document.getElementById("root")).render(h.jsx(b.StrictMode,{children:h.jsx(kA,{})})); diff --git a/public/dashboard/index.html b/public/dashboard/index.html index cb2d5e1..1e89966 100644 --- a/public/dashboard/index.html +++ b/public/dashboard/index.html @@ -15,7 +15,7 @@ } catch (e) {} })(); - + From 681407db9a03b092fc8c990b8a4d9cc3f5d7a15a Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 20:44:55 +0530 Subject: [PATCH 12/13] Bring the registry description back under the 100-char cap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 9a6acfd made the server.json description scope-honest and took it to 137 characters. The MCP Registry caps it at 100, and `npm run smoke` asserts exactly that — so main went red the moment it landed. Caught by rebasing onto it, not by anything that ran before the push. Keeps the intent (the app you're building, a fix turning the pin green) at 98 characters. Also lists CONTRIBUTING.md, SECURITY.md and CHANGELOG.md in the repo map, and corrects "the six gates" to seven now docs-facts-gate is in CI. Co-Authored-By: Claude Fable 5 --- README.md | 8 ++++++-- server.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c67d361..f97aed0 100644 --- a/README.md +++ b/README.md @@ -469,12 +469,16 @@ public/ built dashboard + the published shadcn registry (public/r) skills/ CANONICAL loopback SKILL.md — every other copy is rendered from it integrations/ canonical playbook + per-agent setup + widget embed + keep-alive plugin/ Claude Code plugin (skill + MCP registration); repo doubles as its marketplace -scripts/ e2e.mjs · the six gates · canary-all.mjs · screenshot.mjs +scripts/ e2e.mjs · the seven gates · canary-all.mjs · screenshot.mjs release-preflight.mjs (pre-publish) · release-verify.mjs (post-publish) · bump-version.mjs docs/ the decision history (spec → memo → paths → technical path) + ROADMAP assets/ the README screenshot (generated by scripts/screenshot.mjs) -.github/ ci.yml · canary.yml · readme-checks.yml +.github/ ci.yml · canary.yml · readme-checks.yml · issue and PR templates .impeccable/ design-detector config (the skill itself is not vendored — see .gitignore) + +CONTRIBUTING.md how to run the gates, and why a new gate needs a canary case +SECURITY.md the trust boundary, what is deliberately open, and what is out of scope +CHANGELOG.md every release, with the reasoning that produced it ``` Two manifests at the root do different jobs: `registry.json` publishes the diff --git a/server.json b/server.json index 39f9f53..63f1e52 100644 --- a/server.json +++ b/server.json @@ -1,7 +1,7 @@ { "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", "name": "io.github.joshidikshant/loopback", - "description": "Feedback bus for coding agents: pin feedback on the app you're building; an agent claims it; the pin turns green when the fix is verified", + "description": "Feedback bus for coding agents: pin feedback on the app you're building; a fix turns the pin green", "repository": { "url": "https://github.com/joshidikshant/loopback", "source": "github" From 385491a45a2ca164c6886680fd81ef6d755867e9 Mon Sep 17 00:00:00 2001 From: Dikshant Date: Sun, 2 Aug 2026 21:28:13 +0530 Subject: [PATCH 13/13] Unknown CLI args and blank-after-trim input both failed silently MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs found by driving the built CLI rather than reading it. `--version` printed nothing and hung. It was not a known flag, so it fell through to the default branch, started a stdio server, and waited on a stdin a human terminal never closes — having already opened the user's real ~/.loopback/loopback.db. Any typo behaved identically. argv is now checked BEFORE the store is constructed, which is the part that matters: --version and -v print the version and exit 0, anything unrecognised names itself on stderr and exits 1, and neither opens a database. The e2e assertion points the run at a directory that must stay empty afterwards, because an exit code alone would not have caught the DB being touched. A whitespace-only title was accepted while an empty string was correctly rejected: " " is three characters and cleared min(3), so the queue could hold an item nothing could act on. The length checks now run on the trimmed value — title, project, claiming agent, comment author and comment body, on submit and update alike, since the same mistake was sitting in all of them. It also stops padded slugs being stored with their padding. Both canaried, in the direction that matters: drop the trim and " " is three characters again; let unknown args fall through and the hang comes back. Sweep is 30. Co-Authored-By: Claude Fable 5 --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- CHANGELOG.md | 22 ++++++++++++- docs/ROADMAP.md | 2 +- scripts/canary-all.mjs | 25 ++++++++++++++ scripts/e2e.mjs | 46 +++++++++++++++++++++++++- src/index.ts | 47 +++++++++++++++++++++++++++ src/schemas.ts | 15 ++++++--- src/smoke-test.ts | 36 ++++++++++++++++++++ 8 files changed, 187 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 91964ef..a5e7be8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -33,7 +33,7 @@ body: attributes: label: Loopback version description: >- - `loopback-mcp-server --help` prints it on the first line; a running hub + `loopback-mcp-server --version` prints it; a running hub also reports it at `GET /health`. Or read `version` from package.json. validations: required: true diff --git a/CHANGELOG.md b/CHANGELOG.md index d788485..ae4eda1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,6 +102,26 @@ this text and must be updated with it" — a manual sync, and the last drift cla with no check. They are deliberately not byte-identical, so the invariant is the loop: both must drive the same tools in the same order. +### Fixed — two bugs found by driving the built CLI, not by reading it +`--version` printed nothing and **hung**. It was not a known flag, so it fell +through to the default branch, started a stdio server and waited on a stdin that +a human terminal never closes — after opening the user's real +`~/.loopback/loopback.db` on the way. Any typo did the same, silently. argv is +now validated *before* the store is constructed: `--version`/`-v` print the +version and exit 0, anything unrecognised names itself on stderr and exits 1, +and neither touches a database. The e2e check asserts that last part by pointing +the run at a directory that has to stay empty — an exit code alone would not +have caught the database being opened. + +A whitespace-only title was accepted while an empty string was correctly +rejected: `" "` is three characters, so it cleared `min(3)`, and the queue +could hold an item nothing could act on. Length checks now run on the trimmed +value across the fields where a blank is meaningless — title, project, claiming +agent, comment author and body, on both submit and update — which also +normalises the padding people paste into slugs instead of storing it. + +Both are canaried; the sweep is 30. + ### Fixed — smaller corrections - `docs/05-surface-compatibility.md` stated three different LAN-auth realities in one document; the bearer token shipped, so the "next security milestone" @@ -157,7 +177,7 @@ a port-collision mutation that fell through to a branch whose message still matched, and a collision probe pointed at a `0.0.0.0` hub from a `127.0.0.1` client, which never collided at all. -The canary sweep ends this release at **28** checks (20 before the gates above), +The canary sweep ends this release at **30** checks (20 before the gates above), and every gate added here is canaried in both directions where it can refuse. ## [0.9.2] — 2026-08-02 diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 0dc5178..6df03a6 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -55,7 +55,7 @@ project needs next is not code: it is an adopter who is not DJ. ## Verification Seven gates + `smoke` + `e2e` in CI on every push; `npm run canary` (own -workflow: path-triggered + weekly) runs 28 checks proving each subject's gate +workflow: path-triggered + weekly) runs 30 checks proving each subject's gate fails when the subject breaks — `release-preflight` in both directions, since a gate that refuses everything would otherwise pass its own canary: it blocks a commit whose CI is red and still clears one whose CI is green. Every gate's diff --git a/scripts/canary-all.mjs b/scripts/canary-all.mjs index ab09107..761dfa2 100644 --- a/scripts/canary-all.mjs +++ b/scripts/canary-all.mjs @@ -266,6 +266,31 @@ const CASES = [ s.replaceAll("${a.name}", "FILE").replaceAll("${a.path}", "PATH"), ), }, + { + gate: "smoke (blank-after-trim input)", + cmd: ["npm", ["run", "-s", "smoke"]], + build: BUILD, + guards: "a whitespace-only title being rejected rather than filed", + apply: () => + // Drop the trim and " " is three characters again, which clears min(3). + mutate("src/schemas.ts", (s) => + s.replace( + ` title: z\n .string()\n .trim()\n .min(3)`, + ` title: z\n .string()\n .min(3)`, + ), + ), + }, + { + gate: "e2e (unknown CLI argument)", + cmd: ["npm", ["run", "-s", "e2e"]], + build: BUILD, + guards: "an unknown argument exiting instead of silently starting a server", + apply: () => + // Let unknown arguments fall through again, exactly as they used to. + mutate("src/index.ts", (s) => + s.replace(" if (unknown.length) {", " if (false && unknown.length) {"), + ), + }, { gate: "init-gate (canonical ↔ canonical)", cmd: ["node", ["scripts/init-gate.mjs"]], diff --git a/scripts/e2e.mjs b/scripts/e2e.mjs index 4b9c463..e08548e 100644 --- a/scripts/e2e.mjs +++ b/scripts/e2e.mjs @@ -14,7 +14,7 @@ */ import { pathToFileURL } from "node:url"; import { spawn, spawnSync } from "node:child_process"; -import { rmSync } from "node:fs"; +import { mkdtempSync, readdirSync, readFileSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { request as httpRequest } from "node:http"; @@ -902,6 +902,50 @@ async function main() { rmSync(COLLIDE_DB, { force: true }); console.log("✅ port collision: exits 1, names the port, no misleading banner"); + // ---- unknown arguments must not become a silent server ------------------- + // `--version` printed nothing and hung: it fell through to the stdio branch + // and waited on a stdin a human terminal never closes, having already opened + // the user's real ~/.loopback/loopback.db. A typo did the same. Both are + // spawned with a DB path in a directory that must stay EMPTY afterwards — + // asserting the exit code alone would not catch the database being touched. + const ARG_DIR = mkdtempSync(join(tmpdir(), `loopback-e2e-args-${process.pid}-`)); + const runCli = (args) => + spawnSync("node", [join(ROOT, "dist", "index.js"), ...args], { + encoding: "utf-8", + timeout: 15_000, + killSignal: "SIGKILL", + env: { ...process.env, LOOPBACK_DB: join(ARG_DIR, "must-not-exist.db") }, + }); + + const SERVER_VERSION_EXPECTED = JSON.parse( + readFileSync(join(ROOT, "package.json"), "utf-8"), + ).version; + const version = runCli(["--version"]); + assert( + version.signal !== "SIGKILL", + "--version exits on its own instead of hanging as a stdio server", + ); + assert(version.status === 0, `--version exits 0 (got ${version.status})`); + assert( + version.stdout.trim() === SERVER_VERSION_EXPECTED, + `--version prints the version and nothing else (got ${JSON.stringify(version.stdout.trim().slice(0, 40))})`, + ); + + const typoArg = runCli(["--no-such-flag"]); + assert(typoArg.signal !== "SIGKILL", "an unknown argument exits instead of hanging"); + assert(typoArg.status === 1, `an unknown argument exits 1 (got ${typoArg.status})`); + assert( + /unknown argument/i.test(typoArg.stderr) && /--no-such-flag/.test(typoArg.stderr), + `and names the argument (stderr: ${typoArg.stderr.split("\n")[0]?.slice(0, 100)})`, + ); + + assert( + readdirSync(ARG_DIR).length === 0, + `neither --version nor a typo opened a database (found: ${readdirSync(ARG_DIR).join(", ")})`, + ); + rmSync(ARG_DIR, { recursive: true, force: true }); + console.log("✅ unknown args: exit 1, name the argument, and never touch the DB"); + console.log("\nFULL-LOOP E2E PASSED 🎉 human pin → bus → agent fix → visible closure → human triage"); } diff --git a/src/index.ts b/src/index.ts index 712e761..087b164 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,6 +9,7 @@ * Options: * --db SQLite file (default: $LOOPBACK_DB or ~/.loopback/loopback.db) * --port HTTP port (default: $LOOPBACK_HTTP_PORT or 7077) + * --version print the version and exit * --help usage */ @@ -31,6 +32,37 @@ function hasFlag(flag: string): boolean { return process.argv.includes(flag); } +/** + * Flags that take a value, so the token after them is data and not an argument. + * Kept next to the boolean set because getting these two out of sync is how an + * argument checker starts rejecting valid input. + */ +const VALUE_FLAGS = new Set(["--db", "--port", "--host"]); +const BOOL_FLAGS = new Set(["--http", "--help", "-h", "--version", "-v"]); + +/** + * Anything in argv that is not a known flag or the value of one. + * + * Without this, an unrecognised argument fell through to the default branch and + * silently started a stdio server: `loopback-mcp-server --version` printed + * nothing, hung forever waiting on a stdin that a human terminal never closes, + * and opened the user's real ~/.loopback/loopback.db on the way. A typo did the + * same. Validation therefore has to run BEFORE the store is constructed. + */ +function unknownArgs(argv: string[]): string[] { + const unknown: string[] = []; + for (let i = 0; i < argv.length; i++) { + const arg = argv[i]; + if (VALUE_FLAGS.has(arg)) { + i++; // skip its value + continue; + } + if (BOOL_FLAGS.has(arg)) continue; + unknown.push(arg); + } + return unknown; +} + const USAGE = `loopback-mcp-server v${SERVER_VERSION} — feedback bus for coding agents (MCP) One instance serves ALL projects: every item is tagged with a project slug and @@ -45,6 +77,7 @@ Usage: loopback-mcp-server --db /path/to/loopback.db loopback-mcp-server init --project [--agents claude,codex,gemini] [--write] # onboard the current repo (AGENTS.md, skills, MCP configs ×3) + loopback-mcp-server --version # print the version and exit Environment: LOOPBACK_DB SQLite path (default ~/.loopback/loopback.db) @@ -65,10 +98,24 @@ async function main(): Promise { await runInit(process.argv.slice(3)); return; } + if (hasFlag("--version") || hasFlag("-v")) { + console.log(SERVER_VERSION); + return; + } if (hasFlag("--help") || hasFlag("-h")) { console.log(USAGE); return; } + // Before the store: an unknown argument must not open the user's database. + const unknown = unknownArgs(process.argv.slice(2)); + if (unknown.length) { + console.error( + `loopback-mcp-server: unknown argument${unknown.length > 1 ? "s" : ""} ${unknown + .map((a) => `'${a}'`) + .join(", ")}\nRun 'loopback-mcp-server --help' for usage.`, + ); + process.exit(1); + } const dbPath = argValue("--db") ?? diff --git a/src/schemas.ts b/src/schemas.ts index fbd1c23..b3d8d7e 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -144,8 +144,13 @@ export const statsResultShape = { /** Shape for submitting a new feedback item (also validates HTTP POST /ingest bodies). */ export const submitShape = { + // .trim() runs BEFORE the length check, so " " is rejected rather than + // counted as three characters. Without it a blank title cleared min(3) and + // filed an item nothing in the queue could act on. It also normalises the + // padding people paste into slugs and agent names. project: z .string() + .trim() .min(1) .max(100) .describe("Project/repo slug this feedback belongs to, e.g. 'appbroda-web'"), @@ -154,6 +159,7 @@ export const submitShape = { ), title: z .string() + .trim() .min(3) .max(200) .describe("Short summary, e.g. 'Checkout button dead on mobile Safari'"), @@ -269,6 +275,7 @@ export const claimShape = { ...idShape, agent: z .string() + .trim() .min(1) .max(100) .describe("Name of the claiming agent, e.g. 'claude-code', 'codex', 'gemini'"), @@ -297,8 +304,8 @@ export const updateStatusShape = { export const addCommentShape = { ...idShape, - author: z.string().min(1).max(100).describe("Comment author, e.g. 'claude-code' or 'dj'"), - body: z.string().min(1).max(10000).describe("Comment text (markdown ok)"), + author: z.string().trim().min(1).max(100).describe("Comment author, e.g. 'claude-code' or 'dj'"), + body: z.string().trim().min(1).max(10000).describe("Comment text (markdown ok)"), }; export const linkChangeShape = { @@ -343,11 +350,11 @@ export const statsShape = { /** Editing an item after it was filed. Every field optional — patch semantics. */ export const updateShape = { - title: z.string().min(3).max(200).optional().describe("Corrected summary"), + title: z.string().trim().min(3).max(200).optional().describe("Corrected summary"), body: z.string().max(10000).optional().describe("Corrected description"), severity: severityEnum.optional().describe("Re-ranked severity"), type: typeEnum.optional().describe("Corrected dimension"), - project: z.string().min(1).max(100).optional().describe("Move to another project slug"), + project: z.string().trim().min(1).max(100).optional().describe("Move to another project slug"), route: z.string().max(500).optional().describe("Corrected route"), author: z .string() diff --git a/src/smoke-test.ts b/src/smoke-test.ts index 5f367a7..974fd34 100644 --- a/src/smoke-test.ts +++ b/src/smoke-test.ts @@ -292,6 +292,42 @@ async function main(): Promise { ); console.log("✅ strict tool inputs: a typo'd argument errors instead of filing the wrong thing"); + // 7b. A blank title cleared min(3) because three spaces are three characters, + // so an item nothing could act on filed successfully. Length checks now run + // on the trimmed value. + const blankTitle = await callExpectError("loopback_submit_feedback", { + project: "demo-web", + type: "ui", + title: " ", + }); + assert( + /too_small|at least|validation/i.test(blankTitle), + `a whitespace-only title is rejected (got: ${blankTitle.slice(0, 80)})`, + ); + const blankProject = await callExpectError("loopback_submit_feedback", { + project: " ", + type: "ui", + title: "Real enough title", + }); + assert( + /too_small|at least|validation/i.test(blankProject), + `a whitespace-only project is rejected (got: ${blankProject.slice(0, 80)})`, + ); + // The same trim normalises padding rather than storing it. + const padded = await call("loopback_submit_feedback", { + project: " demo-web ", + type: "ui", + title: " Padded title needs trimming ", + }); + const paddedId = padded.structured.id as string; + const paddedBack = await call("loopback_get_feedback", { id: paddedId, response_format: "json" }); + const paddedItem = paddedBack.structured as unknown as { title: string; project: string }; + assert( + paddedItem.title === "Padded title needs trimming" && paddedItem.project === "demo-web", + `padding is trimmed, not stored (got title=${JSON.stringify(paddedItem.title)} project=${JSON.stringify(paddedItem.project)})`, + ); + console.log("✅ blank-after-trim titles and slugs are rejected; padding is normalised"); + await mcp.close(); console.log("\nALL SMOKE TESTS PASSED 🎉"); }