@mono-agent/web 0.20.9 → 0.20.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts.d.ts +7 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/service.d.ts +17 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +130 -4
- package/dist/service.js.map +1 -1
- package/dist/store.d.ts +27 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +43 -2
- package/dist/store.js.map +1 -1
- package/package.json +4 -4
- package/webapp/dist/assets/{assistant-ui-CxqQJmH9.js → assistant-ui-BzN2E6n6.js} +1 -1
- package/webapp/dist/assets/index-BT463dRM.css +1 -0
- package/webapp/dist/assets/index-Co-qDQPq.js +155 -0
- package/webapp/dist/assets/{markdown-8pwMczg6.js → markdown-Vq23xgh7.js} +1 -1
- package/webapp/dist/index.html +4 -4
- package/webapp/dist/sw.js +1 -1
- package/webapp/dist/assets/index-BWVWkCJ2.js +0 -152
- package/webapp/dist/assets/index-SugvifaX.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mono-agent/web",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.11",
|
|
4
4
|
"description": "Always-on assistant-ui web console for discovering and chatting with local mono-agent instances.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "GPL-3.0-only",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"README.md"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@mono-agent/agent-contracts": "0.20.
|
|
31
|
-
"@mono-agent/config": "0.20.
|
|
32
|
-
"@mono-agent/observability": "0.20.
|
|
30
|
+
"@mono-agent/agent-contracts": "0.20.11",
|
|
31
|
+
"@mono-agent/config": "0.20.11",
|
|
32
|
+
"@mono-agent/observability": "0.20.11",
|
|
33
33
|
"express": "^5.1.0",
|
|
34
34
|
"web-push": "3.6.7"
|
|
35
35
|
},
|
|
@@ -67,4 +67,4 @@ ${r.system}`:n.system=r.system),r.tools)for(const[i,a]of Object.entries(r.tools)
|
|
|
67
67
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
68
68
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
69
69
|
`)},Vv=0,ct=[];function Hv(t){var e=_.useRef([]),s=_.useRef([0,0]),n=_.useRef(),r=_.useState(Vv++)[0],o=_.useState(ac)[0],i=_.useRef(t);_.useEffect(function(){i.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var p=uv([t.lockRef.current],(t.shards||[]).map(To),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var a=_.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var y=Kt(p),C=s.current,S="deltaX"in p?p.deltaX:C[0]-y[0],b="deltaY"in p?p.deltaY:C[1]-y[1],x,E=p.target,I=Math.abs(S)>Math.abs(b)?"h":"v";if("touches"in p&&I==="h"&&E.type==="range")return!1;var R=window.getSelection(),P=R&&R.anchorNode,O=P?P===E||P.contains(E):!1;if(O)return!1;var k=wo(I,E);if(!k)return!0;if(k?x=I:(x=I==="v"?"h":"v",k=wo(I,E)),!k)return!1;if(!n.current&&"changedTouches"in p&&(S||b)&&(n.current=x),!x)return!0;var $=n.current||x;return Bv($,g,p,$==="h"?S:b)},[]),c=_.useCallback(function(p){var g=p;if(!(!ct.length||ct[ct.length-1]!==o)){var y="deltaY"in g?Co(g):Kt(g),C=e.current.filter(function(x){return x.name===g.type&&(x.target===g.target||g.target===x.shadowParent)&&Fv(x.delta,y)})[0];if(C&&C.should){g.cancelable&&g.preventDefault();return}if(!C){var S=(i.current.shards||[]).map(To).filter(Boolean).filter(function(x){return x.contains(g.target)}),b=S.length>0?a(g,S[0]):!i.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),l=_.useCallback(function(p,g,y,C){var S={name:p,delta:g,target:y,should:C,shadowParent:qv(y)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(b){return b!==S})},1)},[]),u=_.useCallback(function(p){s.current=Kt(p),n.current=void 0},[]),d=_.useCallback(function(p){l(p.type,Co(p),p.target,a(p,t.lockRef.current))},[]),f=_.useCallback(function(p){l(p.type,Kt(p),p.target,a(p,t.lockRef.current))},[]);_.useEffect(function(){return ct.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,at),document.addEventListener("touchmove",c,at),document.addEventListener("touchstart",u,at),function(){ct=ct.filter(function(p){return p!==o}),document.removeEventListener("wheel",c,at),document.removeEventListener("touchmove",c,at),document.removeEventListener("touchstart",u,at)}},[]);var h=t.removeScrollBar,m=t.inert;return _.createElement(_.Fragment,null,m?_.createElement(o,{styles:Uv(r)}):null,h?_.createElement(Dv,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function qv(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const zv=yv(ic,Hv);var dc=_.forwardRef(function(t,e){return _.createElement(Ms,Ce({},t,{ref:e,sideCar:zv}))});dc.classNames=Ms.classNames;var Wv=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},lt=new WeakMap,Yt=new WeakMap,Qt={},tn=0,fc=function(t){return t&&(t.host||fc(t.parentNode))},Gv=function(t,e){return e.map(function(s){if(t.contains(s))return s;var n=fc(s);return n&&t.contains(n)?n:(console.error("aria-hidden",s,"in not contained inside",t,". Doing nothing"),null)}).filter(function(s){return!!s})},Kv=function(t,e,s,n){var r=Gv(e,Array.isArray(t)?t:[t]);Qt[s]||(Qt[s]=new WeakMap);var o=Qt[s],i=[],a=new Set,c=new Set(r),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};r.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(n),m=h!==null&&h!=="false",p=(lt.get(f)||0)+1,g=(o.get(f)||0)+1;lt.set(f,p),o.set(f,g),i.push(f),p===1&&m&&Yt.set(f,!0),g===1&&f.setAttribute(s,"true"),m||f.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(e),a.clear(),tn++,function(){i.forEach(function(d){var f=lt.get(d)-1,h=o.get(d)-1;lt.set(d,f),o.set(d,h),f||(Yt.has(d)||d.removeAttribute(n),Yt.delete(d)),h||d.removeAttribute(s)}),tn--,tn||(lt=new WeakMap,lt=new WeakMap,Yt=new WeakMap,Qt={})}},Yv=function(t,e,s){s===void 0&&(s="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),r=Wv(t);return r?(n.push.apply(n,Array.from(r.querySelectorAll("[aria-live], script"))),Kv(n,r,s,"aria-hidden")):function(){return null}},Ds="Dialog",[hc]=Xa(Ds),[Qv,xe]=hc(Ds),Jv=t=>{const{__scopeDialog:e,children:s,open:n,defaultOpen:r,onOpenChange:o,modal:i=!0}=t,a=_.useRef(null),c=_.useRef(null),[l,u]=$g({prop:n,defaultProp:r??!1,onChange:o,caller:Ds});return v.jsx(Qv,{scope:e,triggerRef:a,contentRef:c,contentId:Ys(),titleId:Ys(),descriptionId:Ys(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:i,children:s})};Jv.displayName=Ds;var mc="DialogTrigger",Xv=_.forwardRef((t,e)=>{const{__scopeDialog:s,...n}=t,r=xe(mc,s),o=ae(e,r.triggerRef);return v.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":rr(r.open),...n,ref:o,onClick:K(t.onClick,r.onOpenToggle)})});Xv.displayName=mc;var nr="DialogPortal",[Zv,pc]=hc(nr,{forceMount:void 0}),eb=t=>{const{__scopeDialog:e,forceMount:s,children:n,container:r}=t,o=xe(nr,e);return v.jsx(Zv,{scope:e,forceMount:s,children:_.Children.map(n,i=>v.jsx(Ps,{present:s||o.open,children:v.jsx(nc,{asChild:!0,container:r,children:i})}))})};eb.displayName=nr;var gs="DialogOverlay",tb=_.forwardRef((t,e)=>{const s=pc(gs,t.__scopeDialog),{forceMount:n=s.forceMount,...r}=t,o=xe(gs,t.__scopeDialog);return o.modal?v.jsx(Ps,{present:n||o.open,children:v.jsx(nb,{...r,ref:e})}):null});tb.displayName=gs;var sb=kt("DialogOverlay.RemoveScroll"),nb=_.forwardRef((t,e)=>{const{__scopeDialog:s,...n}=t,r=xe(gs,s),o=Jg(),i=ae(e,o);return v.jsx(dc,{as:sb,allowPinchZoom:!0,shards:[r.contentRef],children:v.jsx(Ae.div,{"data-state":rr(r.open),...n,ref:i,style:{pointerEvents:"auto",...n.style}})})}),bt="DialogContent",rb=_.forwardRef((t,e)=>{const s=pc(bt,t.__scopeDialog),{forceMount:n=s.forceMount,...r}=t,o=xe(bt,t.__scopeDialog);return v.jsx(Ps,{present:n||o.open,children:o.modal?v.jsx(ob,{...r,ref:e}):v.jsx(ib,{...r,ref:e})})});rb.displayName=bt;var ob=_.forwardRef((t,e)=>{const s=xe(bt,t.__scopeDialog),n=_.useRef(null),r=ae(e,s.contentRef,n);return _.useEffect(()=>{const o=n.current;if(o)return Yv(o)},[]),v.jsx(gc,{...t,ref:r,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:K(t.onCloseAutoFocus,o=>{o.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:K(t.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:K(t.onFocusOutside,o=>o.preventDefault())})}),ib=_.forwardRef((t,e)=>{const s=xe(bt,t.__scopeDialog),n=_.useRef(!1),r=_.useRef(!1);return v.jsx(gc,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||s.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=o.target;s.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&r.current&&o.preventDefault()}})}),gc=_.forwardRef((t,e)=>{const{__scopeDialog:s,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:o,...i}=t,a=xe(bt,s);return lv(),v.jsx(v.Fragment,{children:v.jsx(tc,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:o,children:v.jsx(Za,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":rr(a.open),...i,ref:e,deferPointerDownOutside:!0,onDismiss:()=>a.onOpenChange(!1)})})})}),vc="DialogTitle",ab=_.forwardRef((t,e)=>{const{__scopeDialog:s,...n}=t,r=xe(vc,s);return v.jsx(Ae.h2,{id:r.titleId,...n,ref:e})});ab.displayName=vc;var bc="DialogDescription",cb=_.forwardRef((t,e)=>{const{__scopeDialog:s,...n}=t,r=xe(bc,s);return v.jsx(Ae.p,{id:r.descriptionId,...n,ref:e})});cb.displayName=bc;var yc="DialogClose",lb=_.forwardRef((t,e)=>{const{__scopeDialog:s,...n}=t,r=xe(yc,s);return v.jsx(Ae.button,{type:"button",...n,ref:e,onClick:K(t.onClick,()=>r.onOpenChange(!1))})});lb.displayName=yc;function rr(t){return t?"open":"closed"}const ub=["top","right","bottom","left"],yt=Math.min,Me=Math.max,vs=Math.round,Jt=Math.floor,De=t=>({x:t,y:t}),db={left:"right",right:"left",bottom:"top",top:"bottom"};function fb(t,e,s){return Me(t,yt(e,s))}function Be(t,e){return typeof t=="function"?t(e):t}function Fe(t){return t.split("-")[0]}function jt(t){return t.split("-")[1]}function or(t){return t==="x"?"y":"x"}function _c(t){return t==="y"?"height":"width"}function Ee(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Sc(t){return or(Ee(t))}function hb(t,e,s){s===void 0&&(s=!1);const n=jt(t),r=Sc(t),o=_c(r);let i=r==="x"?n===(s?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=bs(i)),[i,bs(i)]}function mb(t){const e=bs(t);return[wn(t),e,wn(e)]}function wn(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Eo=["left","right"],Io=["right","left"],pb=["top","bottom"],gb=["bottom","top"];function vb(t,e,s){switch(t){case"top":case"bottom":return s?e?Io:Eo:e?Eo:Io;case"left":case"right":return e?pb:gb;default:return[]}}function bb(t,e,s,n){const r=jt(t);let o=vb(Fe(t),s==="start",n);return r&&(o=o.map(i=>i+"-"+r),e&&(o=o.concat(o.map(wn)))),o}function bs(t){const e=Fe(t);return db[e]+t.slice(e.length)}function yb(t){var e,s,n,r;return{top:(e=t.top)!=null?e:0,right:(s=t.right)!=null?s:0,bottom:(n=t.bottom)!=null?n:0,left:(r=t.left)!=null?r:0}}function _b(t){return typeof t!="number"?yb(t):{top:t,right:t,bottom:t,left:t}}function ys(t){const{x:e,y:s,width:n,height:r}=t;return{width:n,height:r,top:s,left:e,right:e+n,bottom:s+r,x:e,y:s}}function Ro(t,e,s){let{reference:n,floating:r}=t;const o=Ee(e),i=Sc(e),a=_c(i),c=Fe(e),l=o==="y",u=n.x+n.width/2-r.width/2,d=n.y+n.height/2-r.height/2,f=n[a]/2-r[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-r.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-r.width,y:d};break;default:h={x:n.x,y:n.y}}const m=jt(e);return m&&(h[i]+=f*(m==="end"?1:-1)*(s&&l?-1:1)),h}async function Sb(t,e){var s;e===void 0&&(e={});const{x:n,y:r,platform:o,rects:i,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Be(e,t),m=_b(h),g=a[f?d==="floating"?"reference":"floating":d],y=ys(await o.getClippingRect({element:(s=await(o.isElement==null?void 0:o.isElement(g)))==null||s?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),C=d==="floating"?{x:n,y:r,width:i.floating.width,height:i.floating.height}:i.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),b=await(o.isElement==null?void 0:o.isElement(S))&&await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1},x=ys(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:S,strategy:c}):C);return{top:(y.top-x.top+m.top)/b.y,bottom:(x.bottom-y.bottom+m.bottom)/b.y,left:(y.left-x.left+m.left)/b.x,right:(x.right-y.right+m.right)/b.x}}const xb=50,wb=async(t,e,s)=>{const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i}=s,a=i.detectOverflow?i:{...i,detectOverflow:Sb},c=await(i.isRTL==null?void 0:i.isRTL(e));let l=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=Ro(l,n,c),f=n,h=0;const m={};for(let p=0;p<o.length;p++){const g=o[p];if(!g)continue;const{name:y,fn:C}=g,{x:S,y:b,data:x,reset:E}=await C({x:u,y:d,initialPlacement:n,placement:f,strategy:r,middlewareData:m,rects:l,platform:a,elements:{reference:t,floating:e}});u=S??u,d=b??d,m[y]={...m[y],...x},E&&h<xb&&(h++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(l=E.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):E.rects),{x:u,y:d}=Ro(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:m}},Cb=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var s,n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=Be(t,e);if((s=o.arrow)!=null&&s.alignmentOffset)return{};const y=Fe(r),C=Ee(a),S=Fe(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),x=f||(S||!p?[bs(a)]:mb(a)),E=m!=="none";!f&&E&&x.push(...bb(a,p,m,b));const I=[a,...x],R=await c.detectOverflow(e,g),P=[];let O=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&P.push(R[y]),d){const B=hb(r,i,b);P.push(R[B[0]],R[B[1]])}if(O=[...O,{placement:r,overflows:P}],!P.every(B=>B<=0)){var k,$;const B=(((k=o.flip)==null?void 0:k.index)||0)+1,U=I[B];if(U&&(!(d==="alignment"?C!==Ee(U):!1)||O.every(j=>Ee(j.placement)===C?j.overflows[0]>0:!0)))return{data:{index:B,overflows:O},reset:{placement:U}};let V=($=O.filter(Q=>Q.overflows[0]<=0).sort((Q,j)=>Q.overflows[1]-j.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(h){case"bestFit":{var M;const Q=(M=O.filter(j=>{if(E){const ee=Ee(j.placement);return ee===C||ee==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(ee=>ee>0).reduce((ee,w)=>ee+w,0)]).sort((j,ee)=>j[1]-ee[1])[0])==null?void 0:M[0];Q&&(V=Q);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function Ao(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Po(t){return ub.some(e=>t[e]>=0)}const Tb=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:s,platform:n}=e,{strategy:r="referenceHidden",...o}=Be(t,e);switch(r){case"referenceHidden":{const i=await n.detectOverflow(e,{...o,elementContext:"reference"}),a=Ao(i,s.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Po(a)}}}case"escaped":{const i=await n.detectOverflow(e,{...o,altBoundary:!0}),a=Ao(i,s.floating);return{data:{escapedOffsets:a,escaped:Po(a)}}}default:return{}}}}},xc=new Set(["left","top"]);async function Eb(t,e){const{placement:s,platform:n,elements:r}=t,o=await(n.isRTL==null?void 0:n.isRTL(r.floating)),i=Fe(s),a=jt(s),c=Ee(s)==="y",l=xc.has(i)?-1:1,u=o&&c?-1:1,d=Be(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const Ib=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var s,n;const{x:r,y:o,placement:i,middlewareData:a}=e,c=await Eb(e,t);return i===((s=a.offset)==null?void 0:s.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:r+c.x,y:o+c.y,data:{...c,placement:i}}}}},Rb=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:s,y:n,placement:r,platform:o}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:C=>{let{x:S,y:b}=C;return{x:S,y:b}}},...l}=Be(t,e),u={x:s,y:n},d=await o.detectOverflow(e,l),f=Ee(r),h=or(f);let m=u[h],p=u[f];const g=(C,S)=>fb(S+d[C==="y"?"top":"left"],S,S-d[C==="y"?"bottom":"right"]);i&&(m=g(h,m)),a&&(p=g(f,p));const y=c.fn({...e,[h]:m,[f]:p});return{...y,data:{x:y.x-s,y:y.y-n,enabled:{[h]:i,[f]:a}}}}}},Ab=function(t){return t===void 0&&(t={}),{options:t,fn(e){var s,n;const{x:r,y:o,placement:i,rects:a,middlewareData:c}=e,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Be(t,e),f={x:r,y:o},h=Ee(i),m=or(h);let p=f[m],g=f[h];const y=Be(l,e),C=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(s=y.mainAxis)!=null?s:0,crossAxis:(n=y.crossAxis)!=null?n:0};if(u){const x=m==="y"?"height":"width",E=a.reference[m]-a.floating[x]+C.mainAxis,I=a.reference[m]+a.reference[x]-C.mainAxis;p<E?p=E:p>I&&(p=I)}if(d){var S,b;const x=m==="y"?"width":"height",E=xc.has(Fe(i)),I=a.reference[h]-a.floating[x]+(E&&((S=c.offset)==null?void 0:S[h])||0)+(E?0:C.crossAxis),R=a.reference[h]+a.reference[x]+(E?0:((b=c.offset)==null?void 0:b[h])||0)-(E?C.crossAxis:0);g<I?g=I:g>R&&(g=R)}return{[m]:p,[h]:g}}}},Pb=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:s,rects:n,platform:r,elements:o}=e,{apply:i=()=>{},...a}=Be(t,e),c=await r.detectOverflow(e,a),l=Fe(s),u=jt(s),d=Ee(s)==="y",{width:f,height:h}=n.floating;let m,p;l==="top"||l==="bottom"?(m=l,p=u===(await(r.isRTL==null?void 0:r.isRTL(o.floating))?"start":"end")?"left":"right"):(p=l,m=u==="end"?"top":"bottom");const g=h-c.top-c.bottom,y=f-c.left-c.right,C=yt(h-c[m],g),S=yt(f-c[p],y),b=e.middlewareData.shift,x=!b;let E=C,I=S;b!=null&&b.enabled.x&&(I=y),b!=null&&b.enabled.y&&(E=g),x&&!u&&(d?I=f-2*Me(c.left,c.right):E=h-2*Me(c.top,c.bottom)),await i({...e,availableWidth:I,availableHeight:E});const R=await r.getDimensions(o.floating);return f!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}};function ks(){return typeof window<"u"}function wt(t){return wc(t)?(t.nodeName||"").toLowerCase():"#document"}function fe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $e(t){var e;return(e=(wc(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function wc(t){return ks()?t instanceof Node||t instanceof fe(t).Node:!1}function Ie(t){return ks()?t instanceof Element||t instanceof fe(t).Element:!1}function Ve(t){return ks()?t instanceof HTMLElement||t instanceof fe(t).HTMLElement:!1}function Mo(t){return!ks()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof fe(t).ShadowRoot}function Os(t){const{overflow:e,overflowX:s,overflowY:n,display:r}=Re(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+s)&&r!=="inline"&&r!=="contents"}function Mb(t){return/^(table|td|th)$/.test(wt(t))}function $s(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Db=/transform|translate|scale|rotate|perspective|filter/,kb=/paint|layout|strict|content/,We=t=>!!t&&t!=="none";let sn;function ir(t){const e=Ie(t)?Re(t):t;return We(e.transform)||We(e.translate)||We(e.scale)||We(e.rotate)||We(e.perspective)||!ar()&&(We(e.backdropFilter)||We(e.filter))||Db.test(e.willChange||"")||kb.test(e.contain||"")}function Ob(t){let e=Ze(t);for(;Ve(e)&&!$t(e);){if(ir(e))return e;if($s(e))return null;e=Ze(e)}return null}function ar(){return sn==null&&(sn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),sn}function $t(t){return/^(html|body|#document)$/.test(wt(t))}function Re(t){return fe(t).getComputedStyle(t)}function Ls(t){return Ie(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ze(t){if(wt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Mo(t)&&t.host||$e(t);return Mo(e)?e.host:e}function Cc(t){const e=Ze(t);return $t(e)?(t.ownerDocument||t).body:Ve(e)&&Os(e)?e:Cc(e)}function Lt(t,e,s){var n;e===void 0&&(e=[]),s===void 0&&(s=!0);const r=Cc(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=fe(r);if(o){const a=Cn(i);return e.concat(i,i.visualViewport||[],Os(r)?r:[],a&&s?Lt(a):[])}else return e.concat(r,Lt(r,[],s))}function Cn(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Tc(t){const e=Re(t);let s=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const r=Ve(t),o=r?t.offsetWidth:s,i=r?t.offsetHeight:n,a=vs(s)!==o||vs(n)!==i;return a&&(s=o,n=i),{width:s,height:n,$:a}}function cr(t){return Ie(t)?t:t.contextElement}function pt(t){const e=cr(t);if(!Ve(e))return De(1);const s=e.getBoundingClientRect(),{width:n,height:r,$:o}=Tc(e);let i=(o?vs(s.width):s.width)/n,a=(o?vs(s.height):s.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const $b=De(0);function Ec(t){const e=fe(t);return!ar()||!e.visualViewport?$b:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Lb(t,e,s){return e===void 0&&(e=!1),!!s&&e&&s===fe(t)}function et(t,e,s,n){e===void 0&&(e=!1),s===void 0&&(s=!1);const r=t.getBoundingClientRect(),o=cr(t);let i=De(1);e&&(n?Ie(n)&&(i=pt(n)):i=pt(t));const a=Lb(o,s,n)?Ec(o):De(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(o&&n){const f=fe(o),h=Ie(n)?fe(n):n;let m=f,p=Cn(m);for(;p&&h!==m;){const g=pt(p),y=p.getBoundingClientRect(),C=Re(p),S=y.left+(p.clientLeft+parseFloat(C.paddingLeft))*g.x,b=y.top+(p.clientTop+parseFloat(C.paddingTop))*g.y;c*=g.x,l*=g.y,u*=g.x,d*=g.y,c+=S,l+=b,m=fe(p),p=Cn(m)}}return ys({width:u,height:d,x:c,y:l})}function Ns(t,e){const s=Ls(t).scrollLeft;return e?e.left+s:et($e(t)).left+s}function Ic(t,e){const s=t.getBoundingClientRect(),n=s.left+e.scrollLeft-Ns(t,s),r=s.top+e.scrollTop;return{x:n,y:r}}function Nb(t){let{elements:e,rect:s,offsetParent:n,strategy:r}=t;const o=r==="fixed",i=$e(n),a=e?$s(e.floating):!1;if(n===i||a&&o)return s;let c={scrollLeft:0,scrollTop:0},l=De(1);const u=De(0),d=Ve(n);if((d||!o)&&((wt(n)!=="body"||Os(i))&&(c=Ls(n)),d)){const h=et(n);l=pt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const f=i&&!d&&!o?Ic(i,c):De(0);return{width:s.width*l.x,height:s.height*l.y,x:s.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:s.y*l.y-c.scrollTop*l.y+u.y+f.y}}function jb(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Bb(t){const e=Ls(t),s=t.ownerDocument.body,n=Me(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),r=Me(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-e.scrollLeft+Ns(t);const i=-e.scrollTop;return Re(s).direction==="rtl"&&(o+=Me(t.clientWidth,s.clientWidth)-n),{width:n,height:r,x:o,y:i}}const Fb=25;function Ub(t,e,s){s===void 0&&(s="viewport");const n=s==="layoutViewport",r=fe(t),o=$e(t),i=r.visualViewport;let a=o.clientWidth,c=o.clientHeight,l=0,u=0;if(i){const f=!ar()||e==="fixed";n?f||(l=-i.offsetLeft,u=-i.offsetTop):(a=i.width,c=i.height,f&&(l=i.offsetLeft,u=i.offsetTop))}if(Ns(o)<=0){const f=o.ownerDocument,h=f.body,m=getComputedStyle(h),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(o.clientWidth-h.clientWidth-p),y=getComputedStyle(o).scrollbarGutter==="stable both-edges"?g/2:g;y<=Fb&&(a-=y)}return{width:a,height:c,x:l,y:u}}function Vb(t,e){const s=et(t,!0,e==="fixed"),n=s.top+t.clientTop,r=s.left+t.clientLeft,o=pt(t),i=t.clientWidth*o.x,a=t.clientHeight*o.y,c=r*o.x,l=n*o.y;return{width:i,height:a,x:c,y:l}}function Do(t,e,s){let n;if(e==="viewport"||e==="layoutViewport")n=Ub(t,s,e);else if(e==="document")n=Bb($e(t));else if(Ie(e))n=Vb(e,s);else{const r=Ec(t);n={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ys(n)}function Hb(t,e){const s=e.get(t);if(s)return s;let n=Lt(t,[],!1).filter(a=>Ie(a)&&wt(a)!=="body"),r=null;const o=Re(t).position==="fixed";let i=o?Ze(t):t;for(;Ie(i)&&!$t(i);){const a=Re(i),c=ir(i),l=r?r.position:o?"fixed":"";!c&&(l==="fixed"||l==="absolute"&&a.position==="static")?n=n.filter(d=>d!==i):r=a,i=Ze(i)}return e.set(t,n),n}function qb(t){let{element:e,boundary:s,rootBoundary:n,strategy:r}=t;const i=[...s==="clippingAncestors"?$s(e)?[]:Hb(e,this._c):[].concat(s),n],a=Do(e,i[0],r);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let f=1;f<i.length;f++){const h=Do(e,i[f],r);c=Me(h.top,c),l=yt(h.right,l),u=yt(h.bottom,u),d=Me(h.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function zb(t){const{width:e,height:s}=Tc(t);return{width:e,height:s}}function Wb(t,e,s){const n=Ve(e),r=$e(e),o=s==="fixed",i=et(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const c=De(0);if((n||!o)&&((wt(e)!=="body"||Os(r))&&(a=Ls(e)),n)){const f=et(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}!n&&r&&(c.x=Ns(r));const l=r&&!n&&!o?Ic(r,a):De(0),u=i.left+a.scrollLeft-c.x-l.x,d=i.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:i.width,height:i.height}}function nn(t){return Re(t).position==="static"}function ko(t,e){if(!Ve(t)||Re(t).position==="fixed")return null;if(e)return e(t);let s=t.offsetParent;return $e(t)===s&&(s=s.ownerDocument.body),s}function Rc(t,e){const s=fe(t);if($s(t))return s;if(!Ve(t)){let r=Ze(t);for(;r&&!$t(r);){if(Ie(r)&&!nn(r))return r;r=Ze(r)}return s}let n=ko(t,e);for(;n&&Mb(n)&&nn(n);)n=ko(n,e);return n&&$t(n)&&nn(n)&&!ir(n)?s:n||Ob(t)||s}const Gb=async function(t){const e=this.getOffsetParent||Rc,s=this.getDimensions,n=await s(t.floating);return{reference:Wb(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Kb(t){return Re(t).direction==="rtl"}const Yb={convertOffsetParentRelativeRectToViewportRelativeRect:Nb,getDocumentElement:$e,getClippingRect:qb,getOffsetParent:Rc,getElementRects:Gb,getClientRects:jb,getDimensions:zb,getScale:pt,isElement:Ie,isRTL:Kb};function Ac(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Qb(t,e,s){let n=null,r;const o=$e(t);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function a(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=t.getBoundingClientRect(),{left:h,top:m,width:p,height:g}=f;if(u||e(),!p||!g)return;const y=Jt(m),C=Jt(o.clientWidth-(h+p)),S=Jt(o.clientHeight-(m+g)),b=Jt(h),E={rootMargin:-y+"px "+-C+"px "+-S+"px "+-b+"px",threshold:Me(0,yt(1,d))||1};let I=!0;function R(P){const O=P[0].intersectionRatio;if(!Ac(f,t.getBoundingClientRect()))return a();if(O!==d){if(!I)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}I=!1}try{n=new IntersectionObserver(R,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,E)}n.observe(t)}const c=fe(t),l=()=>a(s);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),i()}}function tS(t,e,s,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=cr(t),u=r||o?[...l?Lt(l):[],...e?Lt(e):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",s),o&&y.addEventListener("resize",s)});const d=l&&a?Qb(l,s,o):null;let f=-1,h=null;i&&(h=new ResizeObserver(y=>{let[C]=y;C&&C.target===l&&h&&e&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(e)})),s()}),l&&!c&&h.observe(l),e&&h.observe(e));let m,p=c?et(t):null;c&&g();function g(){const y=et(t);p&&!Ac(p,y)&&s(),p=y,m=requestAnimationFrame(g)}return s(),()=>{var y;u.forEach(C=>{r&&C.removeEventListener("scroll",s),o&&C.removeEventListener("resize",s)}),d?.(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const Jb=Ib,Xb=Rb,Zb=Cb,ey=Pb,ty=Tb,sy=Ab,ny=(t,e,s)=>{const n=new Map,r=s??{},o={...Yb,...r.platform,_c:n};return wb(t,e,{...r,platform:o})};var ry=typeof document<"u",oy=function(){},ns=ry?_.useLayoutEffect:oy;function _s(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let s,n,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(s=t.length,s!==e.length)return!1;for(n=s;n--!==0;)if(!_s(t[n],e[n]))return!1;return!0}if(r=Object.keys(t),s=r.length,s!==Object.keys(e).length)return!1;for(n=s;n--!==0;)if(!{}.hasOwnProperty.call(e,r[n]))return!1;for(n=s;n--!==0;){const o=r[n];if(!(o==="_owner"&&t.$$typeof)&&!_s(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Pc(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Oo(t,e){const s=Pc(t);return Math.round(e*s)/s}function rn(t){const e=_.useRef(t);return ns(()=>{e.current=t}),e}function sS(t){t===void 0&&(t={});const{placement:e="bottom",strategy:s="absolute",middleware:n=[],platform:r,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,d]=_.useState({x:0,y:0,strategy:s,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=_.useState(n);_s(f,n)||h(n);const[m,p]=_.useState(null),[g,y]=_.useState(null),C=_.useCallback(j=>{j!==E.current&&(E.current=j,p(j))},[]),S=_.useCallback(j=>{j!==I.current&&(I.current=j,y(j))},[]),b=o||m,x=i||g,E=_.useRef(null),I=_.useRef(null),R=_.useRef(u),P=c!=null,O=rn(c),k=rn(r),$=rn(l),M=_.useCallback(()=>{if(!E.current||!I.current)return;const j={placement:e,strategy:s,middleware:f};k.current&&(j.platform=k.current),ny(E.current,I.current,j).then(ee=>{const w={...ee,isPositioned:$.current!==!1};B.current&&!_s(R.current,w)&&(R.current=w,As.flushSync(()=>{d(w)}))})},[f,e,s,k,$]);ns(()=>{l===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(j=>({...j,isPositioned:!1})))},[l]);const B=_.useRef(!1);ns(()=>(B.current=!0,()=>{B.current=!1}),[]),ns(()=>{if(b&&(E.current=b),x&&(I.current=x),b&&x){if(O.current)return O.current(b,x,M);M()}},[b,x,M,O,P]);const U=_.useMemo(()=>({reference:E,floating:I,setReference:C,setFloating:S}),[C,S]),V=_.useMemo(()=>({reference:b,floating:x}),[b,x]),Q=_.useMemo(()=>{const j={position:s,left:0,top:0};if(!V.floating)return j;const ee=Oo(V.floating,u.x),w=Oo(V.floating,u.y);return a?{...j,transform:"translate("+ee+"px, "+w+"px)",...Pc(V.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ee,top:w}},[s,a,V.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:M,refs:U,elements:V,floatingStyles:Q}),[u,M,U,V,Q])}const nS=(t,e)=>{const s=Jb(t);return{name:s.name,fn:s.fn,options:[t,e]}},rS=(t,e)=>{const s=Xb(t);return{name:s.name,fn:s.fn,options:[t,e]}},oS=(t,e)=>({fn:sy(t).fn,options:[t,e]}),iS=(t,e)=>{const s=Zb(t);return{name:s.name,fn:s.fn,options:[t,e]}},aS=(t,e)=>{const s=ey(t);return{name:s.name,fn:s.fn,options:[t,e]}},cS=(t,e)=>{const s=ty(t);return{name:s.name,fn:s.fn,options:[t,e]}},Mc=_.forwardRef((t,e)=>{const s=T(3);let n;return s[0]!==t||s[1]!==e?(n=v.jsx(J.div,{...t,ref:e}),s[0]=t,s[1]=e,s[2]=n):n=s[2],n});Mc.displayName="AttachmentPrimitive.Root";const Dc=_.forwardRef((t,e)=>{const s=T(4),n=D(iy);let r;return s[0]!==n||s[1]!==t||s[2]!==e?(r=v.jsxs(J.div,{...t,ref:e,children:[".",n]}),s[0]=n,s[1]=t,s[2]=e,s[3]=r):r=s[3],r});Dc.displayName="AttachmentPrimitive.unstable_Thumb";function iy(t){const e=t.attachment.name.split(".");return e.length>1?e.pop():""}const kc=()=>{const t=T(2),e=D(ay);let s;return t[0]!==e?(s=v.jsx(v.Fragment,{children:e}),t[0]=e,t[1]=s):s=t[1],s};kc.displayName="AttachmentPrimitive.Name";function ay(t){return t.attachment.name}const cy=()=>{const t=T(2),e=H();let s;return t[0]!==e?(s=()=>{e.attachment().remove()},t[0]=e,t[1]=s):s=t[1],s},ly=ce("AttachmentPrimitive.Remove",cy);var lS=Oe({Name:()=>kc,Remove:()=>ly,Root:()=>Mc,unstable_Thumb:()=>Dc});const uy=t=>{const e=T(12);let s;return e[0]!==t.assistant||e[1]!==t.copied||e[2]!==t.hasAttachments||e[3]!==t.hasBranches||e[4]!==t.hasContent||e[5]!==t.last||e[6]!==t.lastOrHover||e[7]!==t.speaking||e[8]!==t.submittedFeedback||e[9]!==t.system||e[10]!==t.user?(s=n=>{const{role:r,attachments:o,parts:i,branchCount:a,isLast:c,speech:l,isCopied:u,isHovering:d}=n.message;return!(t.hasBranches===!0&&a<2||t.user&&r!=="user"||t.assistant&&r!=="assistant"||t.system&&r!=="system"||t.lastOrHover===!0&&!d&&!c||t.last!==void 0&&t.last!==c||t.copied===!0&&!u||t.copied===!1&&u||t.speaking===!0&&l==null||t.speaking===!1&&l!=null||t.hasAttachments===!0&&(r!=="user"||!o?.length)||t.hasAttachments===!1&&r==="user"&&o?.length||t.hasContent===!0&&i.length===0||t.hasContent===!1&&i.length>0||t.submittedFeedback!==void 0&&(n.message.metadata.submittedFeedback?.type??null)!==t.submittedFeedback)},e[0]=t.assistant,e[1]=t.copied,e[2]=t.hasAttachments,e[3]=t.hasBranches,e[4]=t.hasContent,e[5]=t.last,e[6]=t.lastOrHover,e[7]=t.speaking,e[8]=t.submittedFeedback,e[9]=t.system,e[10]=t.user,e[11]=s):s=e[11],D(s)},Oc=t=>{const e=T(3);let s,n;return e[0]!==t?({children:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]),uy(n)?s:null};Oc.displayName="MessagePrimitive.If";const $c=ue(null),js=()=>he($c),dy=t=>{const e=T(8),{children:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=new Map,e[0]=n):n=e[0];const r=W(n);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[1]=o):o=e[1];const i=W(o);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const g=Array.from(r.current.entries());g.sort(fy),i.current=g.map(hy)},e[2]=a):a=e[2];const c=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(g,y)=>{const C=y?.priority??0;return r.current.set(g,C),c(),()=>{r.current.delete(g),c()}},e[3]=l):l=e[3];const u=l;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i.current,e[4]=d):d=e[4];const f=d;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h={register:u,getPlugins:f},e[5]=h):h=e[5];const m=h;let p;return e[6]!==s?(p=v.jsx($c.Provider,{value:m,children:s}),e[6]=s,e[7]=p):p=e[7],p};function fy(t,e){return e[1]-t[1]}function hy(t){const[e]=t;return e}const lr=ue(null),Lc=ue(null),ur=()=>{const t=he(lr);if(!t)throw new Error("useTriggerPopoverRootContext must be used within ComposerPrimitive.TriggerPopoverRoot");return t},dr=()=>he(lr),my=()=>{const t=he(Lc);if(!t)throw new Error("useTriggerPopoverAriaPublish must be used within ComposerPrimitive.TriggerPopoverRoot");return t},py=()=>{const t=ur();return St(t.subscribe,t.getTriggers,t.getTriggers)},gy=new Map,Nc=()=>()=>{},$o=()=>gy,vy=()=>{const t=dr();return St(t?t.subscribe:Nc,t?t.getTriggers:$o,t?t.getTriggers:$o)},Lo=()=>null,by=()=>{const t=dr();return St(t?t.subscribeAria:Nc,t?t.getActiveAria:Lo,t?t.getActiveAria:Lo)};function No(){const t=T(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Set,t[0]=e):e=t[0];const s=W(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{for(const c of s.current)c()},t[1]=n):n=t[1];const r=n;let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=c=>(s.current.add(c),()=>{s.current.delete(c)}),t[2]=o):o=t[2];const i=o;let a;return t[3]===Symbol.for("react.memo_cache_sentinel")?(a={notify:r,subscribe:i},t[3]=a):a=t[3],a}const jo=t=>{const e=T(21),{children:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=new Map,e[0]=n):n=e[0];const r=W(n);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=new Set,e[1]=o):o=e[1];const i=W(o),{notify:a,subscribe:c}=No();let l;e[2]!==a?(l=M=>{const{char:B}=M;if(r.current.has(B))return yy;const U=new Map(r.current);U.set(B,M),r.current=U,a();for(const V of i.current)V.added(M);return()=>{const V=new Map(r.current);V.delete(B),r.current=V,a();for(const Q of i.current)Q.removed(B)}},e[2]=a,e[3]=l):l=e[3];const u=l;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>r.current,e[4]=d):d=e[4];const f=d;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=M=>(i.current.add(M),()=>{i.current.delete(M)}),e[5]=h):h=e[5];const m=h,p=W(null),g=W(null),{notify:y,subscribe:C}=No();let S;e[6]!==y?(S=(M,B)=>{if(B===null){if(g.current!==M)return;p.current=null,g.current=null,y();return}const U=p.current;g.current===M&&U!==null&&U.popoverId===B.popoverId&&U.highlightedItemId===B.highlightedItemId||(p.current=B,g.current=M,y())},e[6]=y,e[7]=S):S=e[7];const b=S;let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=()=>p.current,e[8]=x):x=e[8];const E=x;let I;e[9]!==u||e[10]!==c||e[11]!==C?(I={register:u,getTriggers:f,subscribe:c,subscribeLifecycle:m,getActiveAria:E,subscribeAria:C},e[9]=u,e[10]=c,e[11]=C,e[12]=I):I=e[12];const R=I;let P;e[13]!==b?(P={setActiveAria:b},e[13]=b,e[14]=P):P=e[14];const O=P;let k;e[15]!==O||e[16]!==s?(k=v.jsx(Lc.Provider,{value:O,children:s}),e[15]=O,e[16]=s,e[17]=k):k=e[17];let $;return e[18]!==k||e[19]!==R?($=v.jsx(lr.Provider,{value:R,children:k}),e[18]=k,e[19]=R,e[20]=$):$=e[20],$},jc=t=>{const e=T(4),{children:s}=t;if(js()){let r;return e[0]!==s?(r=v.jsx(jo,{children:s}),e[0]=s,e[1]=r):r=e[1],r}let n;return e[2]!==s?(n=v.jsx(dy,{children:v.jsx(jo,{children:s})}),e[2]=s,e[3]=n):n=e[3],n};jc.displayName="ComposerPrimitive.TriggerPopoverRoot";function yy(){}const Bo=/\s/u;function _y(t,e,s){const n=t.slice(0,s);for(let r=n.length-1;r>=0;r--){const o=n[r];if(Bo.test(o))return null;if(n.startsWith(e,r)){if(r>0&&!Bo.test(n[r-1]))continue;return{query:n.slice(r+e.length),offset:r}}}return null}const Sy=t=>{const e=T(7),{text:s,triggerChar:n}=t,[r,o]=Z(s.length),i=Math.min(r,s.length);let a;e[0]!==i||e[1]!==s||e[2]!==n?(a=_y(s,n,i),e[0]=i,e[1]=s,e[2]=n,e[3]=a):a=e[3];const c=a,l=c?.query??"";let u;return e[4]!==l||e[5]!==c?(u={trigger:c,query:l,setCursorPosition:o},e[4]=l,e[5]=c,e[6]=u):u=e[6],u},xy=Y(Sy);function wy(t){return"type"in t}const Cy=t=>{const e=T(25),{navigableList:s,isSearchMode:n,activeCategoryId:r,query:o,popoverId:i,open:a,selectItem:c,selectCategory:l,goBack:u,close:d}=t,[f,h]=Z(0);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{h(0)},e[0]=m):m=e[0];let p;e[1]!==s?(p=[s],e[1]=s,e[2]=p):p=e[2],q(m,p);let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{h(0)},e[3]=g):g=e[3];let y;e[4]!==r||e[5]!==n?(y=[n,r],e[4]=r,e[5]=n,e[6]=y):y=e[6],q(g,y);let C;e[7]!==f||e[8]!==s.length?(C=P=>{P<0||P>=s.length||P!==f&&h(P)},e[7]=f,e[8]=s.length,e[9]=C):C=e[9];const S=ye(C);let b;e[10]!==r||e[11]!==d||e[12]!==u||e[13]!==f||e[14]!==s||e[15]!==a||e[16]!==o||e[17]!==l||e[18]!==c?(b=P=>{if(!a)return!1;switch(P.key){case"ArrowDown":return P.preventDefault(),h(O=>{const k=s.length;return k===0?0:O<k-1?O+1:0}),!0;case"ArrowUp":return P.preventDefault(),h(O=>{const k=s.length;return k===0?0:O>0?O-1:k-1}),!0;case"Enter":case"Tab":{if(P.shiftKey)return!1;P.preventDefault();const O=s[f];return O&&(wy(O)?c(O):l(O.id)),!0}case"Escape":return P.preventDefault(),d(),!0;case"Backspace":return r&&o===""?(P.preventDefault(),u(),!0):!1;default:return!1}},e[10]=r,e[11]=d,e[12]=u,e[13]=f,e[14]=s,e[15]=a,e[16]=o,e[17]=l,e[18]=c,e[19]=b):b=e[19];const x=ye(b),E=s[f],I=a&&E?`${i}-option-${E.id}`:void 0;let R;return e[20]!==x||e[21]!==S||e[22]!==f||e[23]!==I?(R={highlightedIndex:f,highlightedItemId:I,highlightIndex:S,handleKeyDown:x},e[20]=x,e[21]=S,e[22]=f,e[23]=I,e[24]=R):R=e[24],R},Ty=Y(Cy);function Fo(t,e){return t.id.toLowerCase().includes(e)||t.label.toLowerCase().includes(e)||(t.description?.toLowerCase().includes(e)??!1)}const Ey=t=>{const e=T(38),{adapter:s,query:n,open:r}=t,[o,i]=Z(null);let a,c;e[0]!==r?(a=()=>{r||i(null)},c=[r],e[0]=r,e[1]=a,e[2]=c):(a=e[1],c=e[2]),q(a,c);let l;e:{if(!r||!s){let M;e[3]===Symbol.for("react.memo_cache_sentinel")?(M=[],e[3]=M):M=e[3],l=M;break e}let $;e[4]!==s?($=s.categories(),e[4]=s,e[5]=$):$=e[5],l=$}const u=l,d=r?o:null;let f;e:{if(!d||!s){let M;e[6]===Symbol.for("react.memo_cache_sentinel")?(M=[],e[6]=M):M=e[6],f=M;break e}let $;e[7]!==s||e[8]!==d?($=s.categoryItems(d),e[7]=s,e[8]=d,e[9]=$):$=e[9],f=$}const h=f;let m;e:{if(!r||!s||d){m=null;break e}if(!n&&u.length>0){m=null;break e}if(s.search){let M;e[10]!==s||e[11]!==n?(M=s.search(n),e[10]=s,e[11]=n,e[12]=M):M=e[12],m=M;break e}let $;if(e[13]!==s||e[14]!==u||e[15]!==n){$=[];const M=n.toLowerCase();for(const B of u)for(const U of s.categoryItems(B.id))Fo(U,M)&&$.push(U);e[13]=s,e[14]=u,e[15]=n,e[16]=$}else $=e[16];m=$}const p=m,g=p!==null;let y;e:{if(g){let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=[],e[17]=M):M=e[17],y=M;break e}if(!n){y=u;break e}let $;if(e[18]!==u||e[19]!==n){const M=n.toLowerCase();$=u.filter(B=>B.label.toLowerCase().includes(M)),e[18]=u,e[19]=n,e[20]=$}else $=e[20];y=$}const C=y;let S;e:{if(g){let M;e[21]!==p?(M=p??[],e[21]=p,e[22]=M):M=e[22],S=M;break e}if(!n){S=h;break e}let $;if(e[23]!==h||e[24]!==n){const M=n.toLowerCase();$=h.filter(B=>Fo(B,M)),e[23]=h,e[24]=n,e[25]=$}else $=e[25];S=$}const b=S;let x;e:{if(g){let $;e[26]!==p?($=p??[],e[26]=p,e[27]=$):$=e[27],x=$;break e}if(d){x=b;break e}x=C}const E=x;let I;e[28]===Symbol.for("react.memo_cache_sentinel")?(I=$=>{i($)},e[28]=I):I=e[28];const R=ye(I);let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{i(null)},e[29]=P):P=e[29];const O=ye(P);let k;return e[30]!==d||e[31]!==C||e[32]!==b||e[33]!==O||e[34]!==g||e[35]!==E||e[36]!==R?(k={categories:C,items:b,isSearchMode:g,activeCategoryId:d,navigableList:E,selectCategory:R,goBack:O},e[30]=d,e[31]=C,e[32]=b,e[33]=O,e[34]=g,e[35]=E,e[36]=R,e[37]=k):k=e[37],k},Iy=Y(Ey),Ry=t=>{const e=T(15),{behavior:s,trigger:n,aui:r,triggerChar:o,setCursorPosition:i,onSelected:a}=t,c=W(null);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=g=>(c.current=g,()=>{c.current===g&&(c.current=null)}),e[0]=l):l=e[0];const u=ye(l);let d;e[1]!==r||e[2]!==s||e[3]!==a||e[4]!==n||e[5]!==o?(d=g=>{if(!n||!s)return;if(c.current?.(g)){a();return}const y=r.composer().getState().text,C=y.slice(0,n.offset),S=y.slice(n.offset+o.length+n.query.length),b=()=>{const x=s.formatter.serialize(g);r.composer().setText(C+x+(S.startsWith(" ")?S:` ${S}`))};s.kind==="directive"?(b(),s.onInserted?.(g)):(s.removeOnExecute?r.composer().setText(C+(S.startsWith(" ")?S.slice(1):S)):b(),s.onExecute(g)),a()},e[1]=r,e[2]=s,e[3]=a,e[4]=n,e[5]=o,e[6]=d):d=e[6];const f=ye(d);let h;e[7]!==a||e[8]!==i||e[9]!==n?(h=()=>{a(),n&&i(n.offset)},e[7]=a,e[8]=i,e[9]=n,e[10]=h):h=e[10];const m=ye(h);let p;return e[11]!==m||e[12]!==u||e[13]!==f?(p={selectItem:f,close:m,registerSelectItemOverride:u},e[11]=m,e[12]=u,e[13]=f,e[14]=p):p=e[14],p},Ay=Y(Ry),Py=t=>{const e=T(46),{adapter:s,text:n,triggerChar:r,behavior:o,aui:i,popoverId:a,isLoading:c}=t;let l;e[0]!==n||e[1]!==r?(l=xy({text:n,triggerChar:r}),e[0]=n,e[1]=r,e[2]=l):l=e[2];const u=de(l),d=u.trigger!==null&&s!==void 0&&o!==void 0;let f;e[3]!==s||e[4]!==u.query||e[5]!==d?(f=Iy({adapter:s,query:u.query,open:d}),e[3]=s,e[4]=u.query,e[5]=d,e[6]=f):f=e[6];const h=de(f);let m;e[7]!==h?(m=()=>{h.goBack()},e[7]=h,e[8]=m):m=e[8];const p=ye(m);let g;e[9]!==i||e[10]!==o||e[11]!==u.setCursorPosition||e[12]!==u.trigger||e[13]!==p||e[14]!==r?(g=Ay({behavior:o,trigger:u.trigger,aui:i,triggerChar:r,setCursorPosition:u.setCursorPosition,onSelected:p}),e[9]=i,e[10]=o,e[11]=u.setCursorPosition,e[12]=u.trigger,e[13]=p,e[14]=r,e[15]=g):g=e[15];const y=de(g);let C;e[16]!==u.query||e[17]!==h.activeCategoryId||e[18]!==h.goBack||e[19]!==h.isSearchMode||e[20]!==h.navigableList||e[21]!==h.selectCategory||e[22]!==d||e[23]!==a||e[24]!==y.close||e[25]!==y.selectItem?(C=Ty({navigableList:h.navigableList,isSearchMode:h.isSearchMode,activeCategoryId:h.activeCategoryId,query:u.query,popoverId:a,open:d,selectItem:y.selectItem,selectCategory:h.selectCategory,goBack:h.goBack,close:y.close}),e[16]=u.query,e[17]=h.activeCategoryId,e[18]=h.goBack,e[19]=h.isSearchMode,e[20]=h.navigableList,e[21]=h.selectCategory,e[22]=d,e[23]=a,e[24]=y.close,e[25]=y.selectItem,e[26]=C):C=e[26];const S=de(C);let b;return e[27]!==u.query||e[28]!==u.setCursorPosition||e[29]!==c||e[30]!==S.handleKeyDown||e[31]!==S.highlightIndex||e[32]!==S.highlightedIndex||e[33]!==S.highlightedItemId||e[34]!==h.activeCategoryId||e[35]!==h.categories||e[36]!==h.goBack||e[37]!==h.isSearchMode||e[38]!==h.items||e[39]!==h.selectCategory||e[40]!==d||e[41]!==a||e[42]!==y.close||e[43]!==y.registerSelectItemOverride||e[44]!==y.selectItem?(b={open:d,query:u.query,activeCategoryId:h.activeCategoryId,categories:h.categories,items:h.items,highlightedIndex:S.highlightedIndex,isSearchMode:h.isSearchMode,isLoading:c,popoverId:a,highlightedItemId:S.highlightedItemId,selectCategory:h.selectCategory,goBack:h.goBack,selectItem:y.selectItem,close:y.close,highlightIndex:S.highlightIndex,handleKeyDown:S.handleKeyDown,setCursorPosition:u.setCursorPosition,registerSelectItemOverride:y.registerSelectItemOverride},e[27]=u.query,e[28]=u.setCursorPosition,e[29]=c,e[30]=S.handleKeyDown,e[31]=S.highlightIndex,e[32]=S.highlightedIndex,e[33]=S.highlightedItemId,e[34]=h.activeCategoryId,e[35]=h.categories,e[36]=h.goBack,e[37]=h.isSearchMode,e[38]=h.items,e[39]=h.selectCategory,e[40]=d,e[41]=a,e[42]=y.close,e[43]=y.registerSelectItemOverride,e[44]=y.selectItem,e[45]=b):b=e[45],b},My=Y(Py),fr=ue(null),Ct=()=>{const t=he(fr);if(!t)throw new Error("useTriggerPopoverScopeContext must be used within ComposerPrimitive.TriggerPopover");return t},Dy=()=>he(fr),Bc=ue(null),Fc=()=>{const t=he(Bc);if(!t)throw new Error("TriggerPopover.Directive / TriggerPopover.Action must be rendered inside ComposerPrimitive.TriggerPopover");return t},Uc=_.forwardRef((t,e)=>{const s=T(61);let n,r,o,i,a,c;s[0]!==t?({char:o,adapter:n,isLoading:c,"aria-label":r,children:i,...a}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o,s[4]=i,s[5]=a,s[6]=c):(n=s[1],r=s[2],o=s[3],i=s[4],a=s[5],c=s[6]);const l=c===void 0?!1:c,u=H(),d=D(ky),f=_.useId(),h=W(null),[m,p]=Z(null),g=W(0);let y;s[7]!==o?(y=X=>(g.current=g.current+1,h.current=X,p(X),()=>{g.current=Math.max(0,g.current-1),h.current===X&&(h.current=null,p(null))}),s[7]=o,s[8]=y):y=s[8];const C=y;let S;s[9]!==C?(S={register:C},s[9]=C,s[10]=S):S=s[10];const b=S,x=m??void 0;let E;s[11]!==n||s[12]!==u||s[13]!==o||s[14]!==l||s[15]!==f||s[16]!==x||s[17]!==d?(E=My({adapter:n,text:d,triggerChar:o,behavior:x,aui:u,popoverId:f,isLoading:l}),s[11]=n,s[12]=u,s[13]=o,s[14]=l,s[15]=f,s[16]=x,s[17]=d,s[18]=E):E=s[18];const I=de(E);let R;s[19]!==I?(R=()=>I,s[19]=I,s[20]=R):R=s[20];const P=ye(R),O=ur();let k;s[21]!==m||s[22]!==o||s[23]!==P||s[24]!==O?(k=()=>O.register({char:o,...m?{behavior:m}:{},resource:P()}),s[21]=m,s[22]=o,s[23]=P,s[24]=O,s[25]=k):k=s[25];let $;s[26]!==m||s[27]!==o||s[28]!==O?($=[O,o,m],s[26]=m,s[27]=o,s[28]=O,s[29]=$):$=s[29],q(k,$);const M=js();let B;s[30]!==P||s[31]!==M?(B=()=>{if(M)return M.register(P())},s[30]=P,s[31]=M,s[32]=B):B=s[32];let U;s[33]!==M?(U=[M],s[33]=M,s[34]=U):U=s[34],q(B,U);const V=m!==null&&I.open,Q=my();let j,ee;s[35]!==Q||s[36]!==o||s[37]!==V?(j=()=>{if(V)return()=>{Q.setActiveAria(o,null)}},ee=[Q,o,V],s[35]=Q,s[36]=o,s[37]=V,s[38]=j,s[39]=ee):(j=s[38],ee=s[39]),q(j,ee);let w,A;s[40]!==Q||s[41]!==o||s[42]!==V||s[43]!==f||s[44]!==I.highlightedItemId?(w=()=>{V&&Q.setActiveAria(o,{popoverId:f,highlightedItemId:I.highlightedItemId})},A=[Q,o,f,V,I.highlightedItemId],s[40]=Q,s[41]=o,s[42]=V,s[43]=f,s[44]=I.highlightedItemId,s[45]=w,s[46]=A):(w=s[45],A=s[46]),q(w,A);let L;s[47]!==r||s[48]!==i||s[49]!==e||s[50]!==V||s[51]!==f||s[52]!==a||s[53]!==I.highlightedItemId?(L=V?v.jsx(J.div,{role:"listbox",id:f,"aria-label":r??"Suggestions","aria-activedescendant":I.highlightedItemId,"data-state":"open",...a,ref:e,children:i}):i,s[47]=r,s[48]=i,s[49]=e,s[50]=V,s[51]=f,s[52]=a,s[53]=I.highlightedItemId,s[54]=L):L=s[54];let N;s[55]!==I||s[56]!==L?(N=v.jsx(fr.Provider,{value:I,children:L}),s[55]=I,s[56]=L,s[57]=N):N=s[57];let F;return s[58]!==b||s[59]!==N?(F=v.jsx(Bc.Provider,{value:b,children:N}),s[58]=b,s[59]=N,s[60]=F):F=s[60],F});Uc.displayName="ComposerPrimitive.TriggerPopover";function ky(t){return t.composer.text}const Vc=()=>{const t=T(2),{disabled:e,send:s}=Ua();let n;t[0]!==s?(n=()=>s(),t[0]=s,t[1]=n):n=t[1];const r=n;return e?null:r},Oy=ce("ComposerPrimitive.Send",Vc),Hc=ue(null),$y=()=>he(Hc),qc=_.forwardRef((t,e)=>{const s=T(20);let n,r,o;s[0]!==t?({onSubmit:r,compact:n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const i=Vc(),[a,c]=Z(!1);let l;s[4]===Symbol.for("react.memo_cache_sentinel")?(l={setMultiline:c},s[4]=l):l=s[4];const u=l;let d;s[5]!==n?(d=b=>n?b.composer.attachments.length===0&&b.composer.quote==null&&b.composer.queue.length===0&&b.composer.dictation==null&&!b.composer.text.includes(`
|
|
70
|
-
`):!1,s[5]=n,s[6]=d):d=s[6];const f=D(d)&&!a;let h;s[7]!==i?(h=b=>{b.preventDefault(),i&&i()},s[7]=i,s[8]=h):h=s[8];const m=h,p=n?u:null,g=f?"":void 0;let y;s[9]!==m||s[10]!==r?(y=K(r,m),s[9]=m,s[10]=r,s[11]=y):y=s[11];let C;s[12]!==e||s[13]!==o||s[14]!==g||s[15]!==y?(C=v.jsx(J.form,{...o,"data-compact":g,ref:e,onSubmit:y}),s[12]=e,s[13]=o,s[14]=g,s[15]=y,s[16]=C):C=s[16];let S;return s[17]!==p||s[18]!==C?(S=v.jsx(Hc.Provider,{value:p,children:C}),s[17]=p,s[18]=C,s[19]=S):S=s[19],S});qc.displayName="ComposerPrimitive.Root";const zc=t=>{const e=T(4),s=ke(t),n=nt(Ly);let r,o;e[0]!==s||e[1]!==n?(r=()=>n(s),o=[n,s],e[0]=s,e[1]=n,e[2]=r,e[3]=o):(r=e[2],o=e[3]),q(r,o)};function Ly(t){return t.onScrollToBottom}const Ny=()=>!1,jy=()=>{},Wc=t=>{const e=T(4);let s;e[0]!==t?(s=o=>{if(typeof window>"u"||t===null||!window.matchMedia)return jy;const i=window.matchMedia(t);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},e[0]=t,e[1]=s):s=e[1];const n=s;let r;return e[2]!==t?(r=()=>typeof window>"u"||t===null||!window.matchMedia?!1:window.matchMedia(t).matches,e[2]=t,e[3]=r):r=e[3],St(n,r,Ny)};function Gc(){return D(By)}function By(t){return t.composer.isEditing?t.composer.text:""}function Kc(t){return!!D(Fy)||!!t}function Fy(t){return t.thread.isDisabled||t.composer.dictation?.inputDisabled}function Uy(){const t=T(4),e=by();if(!e){let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n={},t[0]=n):n=t[0],n}let s;return t[1]!==e.highlightedItemId||t[2]!==e.popoverId?(s={"aria-controls":e.popoverId,"aria-expanded":!0,"aria-haspopup":"listbox","aria-activedescendant":e.highlightedItemId},t[1]=e.highlightedItemId,t[2]=e.popoverId,t[3]=s):s=t[3],s}function Tn(){return Tn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},Tn.apply(null,arguments)}function Vy(t,e){if(t==null)return{};var s={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;s[n]=t[n]}return s}var Hy=_.useLayoutEffect,qy=function(e){var s=ne.useRef(e);return Hy(function(){s.current=e}),s},Uo=function(e,s){if(typeof e=="function"){e(s);return}e.current=s},zy=function(e,s){var n=ne.useRef();return ne.useCallback(function(r){e.current=r,n.current&&Uo(n.current,null),n.current=s,s&&Uo(s,r)},[s])},Vo={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},Wy=function(e){Object.keys(Vo).forEach(function(s){e.style.setProperty(s,Vo[s],"important")})},Ho=Wy,le=null,qo=function(e,s){var n=e.scrollHeight;return s.sizingStyle.boxSizing==="border-box"?n+s.borderSize:n-s.paddingSize};function Gy(t,e,s,n){s===void 0&&(s=1),n===void 0&&(n=1/0),le||(le=document.createElement("textarea"),le.setAttribute("tabindex","-1"),le.setAttribute("aria-hidden","true"),Ho(le)),le.parentNode===null&&document.body.appendChild(le);var r=t.paddingSize,o=t.borderSize,i=t.sizingStyle,a=i.boxSizing;Object.keys(i).forEach(function(f){var h=f;le.style[h]=i[h]}),Ho(le),le.value=e;var c=qo(le,t);le.value=e,c=qo(le,t),le.value="x";var l=le.scrollHeight-r,u=l*s;a==="border-box"&&(u=u+r+o),c=Math.max(u,c);var d=l*n;return a==="border-box"&&(d=d+r+o),c=Math.min(d,c),[c,l]}var zo=function(){},Ky=function(e,s){return e.reduce(function(n,r){return n[r]=s[r],n},{})},Yy=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],Qy=!!document.documentElement.currentStyle,Jy=function(e){var s=window.getComputedStyle(e);if(s===null)return null;var n=Ky(Yy,s),r=n.boxSizing;if(r==="")return null;Qy&&r==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var o=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),i=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:o,borderSize:i}},Xy=Jy;function hr(t,e,s){var n=qy(s);_.useLayoutEffect(function(){var r=function(i){return n.current(i)};if(t)return t.addEventListener(e,r),function(){return t.removeEventListener(e,r)}},[])}var Zy=function(e,s){hr(document.body,"reset",function(n){e.current.form===n.target&&s(n)})},e_=function(e){hr(window,"resize",e)},t_=function(e){hr(document.fonts,"loadingdone",e)},s_=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],n_=function(e,s){var n=e.cacheMeasurements,r=e.maxRows,o=e.minRows,i=e.onChange,a=i===void 0?zo:i,c=e.onHeightChange,l=c===void 0?zo:c,u=Vy(e,s_),d=u.value!==void 0,f=_.useRef(null),h=zy(f,s),m=_.useRef(0),p=_.useRef(),g=function(){var S=f.current,b=n&&p.current?p.current:Xy(S);if(b){p.current=b;var x=Gy(b,S.value||S.placeholder||"x",o,r),E=x[0],I=x[1];m.current!==E&&(m.current=E,S.style.setProperty("height",E+"px","important"),l(E,{rowHeight:I}))}},y=function(S){d||g(),a(S)};return _.useLayoutEffect(g),Zy(f,function(){if(!d){var C=f.current.value;requestAnimationFrame(function(){var S=f.current;S&&C!==S.value&&g()})}}),e_(g),t_(g),_.createElement("textarea",Tn({},u,{onChange:y,ref:h}))},r_=_.forwardRef(n_);const o_="(pointer: coarse) and (not (any-pointer: fine))",Yc=_.forwardRef(({autoFocus:t=!1,asChild:e,render:s,disabled:n,onChange:r,onKeyDown:o,onPaste:i,onSelect:a,submitOnEnter:c,submitMode:l,cancelOnEscape:u=!0,unstable_focusOnRunStart:d=!0,unstable_focusOnScrollToBottom:f=!0,unstable_focusOnThreadSwitched:h=!0,unstable_insertNewlineOnTouchEnter:m=!1,addAttachmentOnPaste:p=!0,onHeightChange:g,...y},C)=>{const S=H(),b=js(),x=$y(),E=l??(c===!1?"none":"enter"),I=Wc(m?o_:null),R=m&&I&&E==="enter"?"none":E,P=Gc(),O=Kc(n),k=W(null),$=ae(C,k),M=W(!1);Ga(A=>{if(!k.current?.contains(A.target))return;if(b){for(const N of b.getPlugins())if(N.handleKeyDown(A))return}if(!u)return;const L=S.composer();L.getState().canCancel&&(L.cancel(),A.preventDefault())});const B=A=>{if(!O&&!A.nativeEvent.isComposing){if(b){for(const L of b.getPlugins())if(L.handleKeyDown(A))return}if(A.key==="Enter"){const L=S.thread().getState(),N=L.capabilities.queue;if(A.shiftKey&&(A.ctrlKey||A.metaKey)&&N&&E!=="none"&&S.composer().getState().canSend){A.preventDefault(),S.composer().send({steer:!0});return}if(A.shiftKey||L.isRunning&&!N)return;let F=!1;R==="ctrlEnter"?F=A.ctrlKey||A.metaKey:R==="enter"&&(F=!0),F&&(A.preventDefault(),k.current?.closest("form")?.requestSubmit())}}},U=async A=>{if(!p)return;const L=S.thread().getState().capabilities,N=Array.from(A.clipboardData?.files||[]);if(L.attachments&&N.length>0)try{A.preventDefault(),await Promise.all(N.map(F=>S.composer().addAttachment(F)))}catch(F){console.error("Error adding attachment:",F)}},V=(A,L)=>{if(g?.(A,L),!x)return;const N=k.current;if(!N||N.value==="")return;const F=getComputedStyle(N),X=F.boxSizing==="border-box"?A-parseFloat(F.paddingTop)-parseFloat(F.paddingBottom)-parseFloat(F.borderTopWidth)-parseFloat(F.borderBottomWidth):A;Math.round(X/L.rowHeight)>1&&x.setMultiline(!0)},Q=t&&!O,j=Ke(()=>{const A=k.current;!A||!Q||(A.focus({preventScroll:!0}),A.setSelectionRange(A.value.length,A.value.length))},[Q]);q(()=>j(),[j]),zc(()=>{S.composer().getState().type==="thread"&&f&&j()}),q(()=>{if(!(S.composer().getState().type!=="thread"||!d))return S.on("thread.runStart",j)},[d,j,S]),q(()=>{if(!(S.composer().getState().type!=="thread"||!h))return S.on("threadListItem.switchedTo",j)},[h,j,S]),q(()=>{P===""&&x?.setMultiline(!1)},[P,x]);const ee=Uy(),w={name:"input",value:P,...y,...ee,ref:$,disabled:O,onChange:K(r,A=>{if(!S.composer().getState().isEditing)return;const L=A.nativeEvent.isComposing===!0;M.current&&!L&&(M.current=!1);const N=L||M.current;if(ln(()=>{S.composer().setText(A.target.value)}),N)return;const F=A.target.selectionStart??A.target.value.length;if(b)for(const X of b.getPlugins())X.setCursorPosition(F)}),onKeyDown:K(o,B),onCompositionStart:K(y.onCompositionStart,()=>{M.current=!0}),onCompositionEnd:K(y.onCompositionEnd,A=>{if(M.current=!1,!S.composer().getState().isEditing)return;const L=A.target;ln(()=>{S.composer().setText(L.value)});const N=L.selectionStart??L.value.length;if(b)for(const F of b.getPlugins())F.setCursorPosition(N)}),onSelect:K(a,A=>{if(M.current)return;const L=A.target,N=L.selectionStart??L.value.length;if(b)for(const F of b.getPlugins())F.setCursorPosition(N)}),onPaste:K(i,U),...x?{onHeightChange:V}:g!==void 0?{onHeightChange:g}:{}};if(s&&_.isValidElement(s)){const A=y.children!==void 0?y.children:s.props.children;return v.jsx(ps,{...w,children:_.cloneElement(s,void 0,A)})}return v.jsx(e?ps:r_,{...w})});Yc.displayName="ComposerPrimitive.Input";const i_=()=>{const{disabled:t,cancel:e}=op();return t?null:e},a_=ce("ComposerPrimitive.Cancel",i_),c_=t=>{const e=T(6);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{multiple:n}=s,r=n===void 0?!0:n,{disabled:o,addAttachment:i}=lp(),a=H();let c;e[2]!==i||e[3]!==a||e[4]!==r?(c=()=>{const u=document.createElement("input");u.type="file",u.multiple=r,u.hidden=!0;const d=a.composer().getState().attachmentAccept;d!=="*"&&(u.accept=d),document.body.appendChild(u),u.onchange=f=>{const h=f.target.files;if(h){for(const m of h)i(m);document.body.removeChild(u)}},u.oncancel=()=>{(!u.files||u.files.length===0)&&document.body.removeChild(u)},u.click()},e[2]=i,e[3]=a,e[4]=r,e[5]=c):c=e[5];const l=c;return o?null:l},l_=ce("ComposerPrimitive.AddAttachment",c_,["multiple"]),Qc=_.forwardRef((t,e)=>{const s=T(30),{disabled:n,asChild:r,render:o,children:i,...a}=t,c=r===void 0?!1:r,[l,u]=Z(!1),d=H();let f;s[0]!==n?(f=M=>{n||(M.preventDefault(),u(!0))},s[0]=n,s[1]=f):f=s[1];const h=f;let m;s[2]!==n||s[3]!==l?(m=M=>{n||(M.preventDefault(),l||u(!0))},s[2]=n,s[3]=l,s[4]=m):m=s[4];const p=m;let g;s[5]!==n?(g=M=>{if(n)return;M.preventDefault();const B=M.relatedTarget;B&&M.currentTarget.contains(B)||u(!1)},s[5]=n,s[6]=g):g=s[6];const y=g;let C;s[7]!==d||s[8]!==n?(C=async M=>{if(n)return;M.preventDefault(),u(!1);const B=Array.from(M.dataTransfer.files);await Promise.all(B.map(async U=>{try{await d.composer().addAttachment(U)}catch(V){console.error("Failed to add attachment:",V)}}))},s[7]=d,s[8]=n,s[9]=C):C=s[9];const S=C;let b;s[10]!==l?(b=l?{"data-dragging":"true"}:null,s[10]=l,s[11]=b):b=s[11];const x=K(a.onDragEnterCapture,h),E=K(a.onDragOverCapture,p),I=K(a.onDragLeaveCapture,y),R=K(a.onDropCapture,S);let P;s[12]!==e||s[13]!==a||s[14]!==R||s[15]!==b||s[16]!==x||s[17]!==E||s[18]!==I?(P={...b,...a,onDragEnterCapture:x,onDragOverCapture:E,onDragLeaveCapture:I,onDropCapture:R,ref:e},s[12]=e,s[13]=a,s[14]=R,s[15]=b,s[16]=x,s[17]=E,s[18]=I,s[19]=P):P=s[19];const O=P;if(o&&_.isValidElement(o)){const M=i!==void 0?i:o.props.children;let B;s[20]!==o||s[21]!==M?(B=_.cloneElement(o,void 0,M),s[20]=o,s[21]=M,s[22]=B):B=s[22];let U;return s[23]!==O||s[24]!==B?(U=v.jsx(ps,{...O,children:B}),s[23]=O,s[24]=B,s[25]=U):U=s[25],U}const k=c?ps:"div";let $;return s[26]!==k||s[27]!==i||s[28]!==O?($=v.jsx(k,{...O,children:i}),s[26]=k,s[27]=i,s[28]=O,s[29]=$):$=s[29],$});Qc.displayName="ComposerPrimitive.AttachmentDropzone";const u_=()=>{const{disabled:t,startDictation:e}=ap();return t?null:e},d_=ce("ComposerPrimitive.Dictate",u_),f_=()=>{const t=T(2),e=H(),s=D(m_);let n;t[0]!==e?(n=()=>{e.composer().stopDictation()},t[0]=e,t[1]=n):n=t[1];const r=n;return s?r:null},h_=ce("ComposerPrimitive.StopDictation",f_);function m_(t){return t.composer.dictation!=null}const Jc=_.forwardRef((t,e)=>{const s=T(7);let n,r;s[0]!==t?({children:n,...r}=t,s[0]=t,s[1]=n,s[2]=r):(n=s[1],r=s[2]);const o=D(p_);if(!o)return null;const i=n??o;let a;return s[3]!==e||s[4]!==r||s[5]!==i?(a=v.jsx(J.span,{...r,ref:e,children:i}),s[3]=e,s[4]=r,s[5]=i,s[6]=a):a=s[6],a});Jc.displayName="ComposerPrimitive.DictationTranscript";function p_(t){return t.composer.dictation?.transcript}const Xc=_.forwardRef((t,e)=>{const s=T(3);if(!D(g_))return null;let n;return s[0]!==e||s[1]!==t?(n=v.jsx(J.div,{...t,ref:e}),s[0]=e,s[1]=t,s[2]=n):n=s[2],n});Xc.displayName="ComposerPrimitive.Quote";const Zc=_.forwardRef((t,e)=>{const s=T(7);let n,r;s[0]!==t?({children:n,...r}=t,s[0]=t,s[1]=n,s[2]=r):(n=s[1],r=s[2]);const o=D(v_);if(!o)return null;const i=n??o;let a;return s[3]!==e||s[4]!==r||s[5]!==i?(a=v.jsx(J.span,{...r,ref:e,children:i}),s[3]=e,s[4]=r,s[5]=i,s[6]=a):a=s[6],a});Zc.displayName="ComposerPrimitive.QuoteText";const el=_.forwardRef((t,e)=>{const s=T(12);let n,r;s[0]!==t?({onClick:n,...r}=t,s[0]=t,s[1]=n,s[2]=r):(n=s[1],r=s[2]);const o=H();let i;s[3]!==o?(i=()=>{o.composer().setQuote(void 0)},s[3]=o,s[4]=i):i=s[4];const a=i;let c;s[5]!==a||s[6]!==n?(c=K(n,a),s[5]=a,s[6]=n,s[7]=c):c=s[7];let l;return s[8]!==e||s[9]!==r||s[10]!==c?(l=v.jsx(J.button,{type:"button",...r,ref:e,onClick:c}),s[8]=e,s[9]=r,s[10]=c,s[11]=l):l=s[11],l});el.displayName="ComposerPrimitive.QuoteDismiss";function g_(t){return t.composer.quote}function v_(t){return t.composer.quote?.text}const tl=_.forwardRef((t,e)=>{const s=T(12);let n,r,o;s[0]!==t?({children:r,"aria-label":n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const{categories:i,activeCategoryId:a,isSearchMode:c,open:l}=Ct();if(!l||a||c)return null;const u=n??"Categories";let d;s[4]!==i||s[5]!==r?(d=r(i),s[4]=i,s[5]=r,s[6]=d):d=s[6];let f;return s[7]!==e||s[8]!==o||s[9]!==u||s[10]!==d?(f=v.jsx(J.div,{role:"group","aria-label":u,...o,ref:e,children:d}),s[7]=e,s[8]=o,s[9]=u,s[10]=d,s[11]=f):f=s[11],f});tl.displayName="ComposerPrimitive.TriggerPopoverCategories";const sl=_.forwardRef((t,e)=>{const s=T(30);let n,r,o,i;s[0]!==t?({categoryId:n,onClick:r,onMouseMove:o,...i}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o,s[4]=i):(n=s[1],r=s[2],o=s[3],i=s[4]);const{selectCategory:a,highlightIndex:c,categories:l,highlightedIndex:u,activeCategoryId:d,isSearchMode:f,popoverId:h}=Ct();let m;s[5]!==n||s[6]!==a?(m=()=>{a(n)},s[5]=n,s[6]=a,s[7]=m):m=s[7];const p=m;let g;if(s[8]!==l||s[9]!==n){let O;s[11]!==n?(O=k=>k.id===n,s[11]=n,s[12]=O):O=s[12],g=l.findIndex(O),s[8]=l,s[9]=n,s[10]=g}else g=s[10];const y=g,C=!d&&!f&&y===u;let S;s[13]!==y||s[14]!==c?(S=()=>{c(y)},s[13]=y,s[14]=c,s[15]=S):S=s[15];const b=S,x=`${h}-option-${n}`,E=C?"":void 0;let I;s[16]!==p||s[17]!==r?(I=K(r,p),s[16]=p,s[17]=r,s[18]=I):I=s[18];let R;s[19]!==b||s[20]!==o?(R=K(o,b),s[19]=b,s[20]=o,s[21]=R):R=s[21];let P;return s[22]!==e||s[23]!==C||s[24]!==i||s[25]!==x||s[26]!==E||s[27]!==I||s[28]!==R?(P=v.jsx(J.button,{type:"button",role:"option",id:x,"aria-selected":C,"data-highlighted":E,...i,ref:e,onClick:I,onMouseMove:R}),s[22]=e,s[23]=C,s[24]=i,s[25]=x,s[26]=E,s[27]=I,s[28]=R,s[29]=P):P=s[29],P});sl.displayName="ComposerPrimitive.TriggerPopoverCategoryItem";const nl=_.forwardRef((t,e)=>{const s=T(12);let n,r,o;s[0]!==t?({children:r,"aria-label":n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const{items:i,activeCategoryId:a,isSearchMode:c,open:l}=Ct();if(!l||!a&&!c)return null;const u=n??"Items";let d;s[4]!==r||s[5]!==i?(d=r(i),s[4]=r,s[5]=i,s[6]=d):d=s[6];let f;return s[7]!==e||s[8]!==o||s[9]!==u||s[10]!==d?(f=v.jsx(J.div,{role:"group","aria-label":u,...o,ref:e,children:d}),s[7]=e,s[8]=o,s[9]=u,s[10]=d,s[11]=f):f=s[11],f});nl.displayName="ComposerPrimitive.TriggerPopoverItems";const rl=_.forwardRef((t,e)=>{const s=T(30);let n,r,o,i,a;s[0]!==t?({item:r,index:n,onClick:o,onMouseMove:i,...a}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o,s[4]=i,s[5]=a):(n=s[1],r=s[2],o=s[3],i=s[4],a=s[5]);const{selectItem:c,highlightIndex:l,items:u,highlightedIndex:d,activeCategoryId:f,isSearchMode:h,popoverId:m}=Ct();let p;s[6]!==r||s[7]!==c?(p=()=>{c(r)},s[6]=r,s[7]=c,s[8]=p):p=s[8];const g=p;let y;s[9]!==n||s[10]!==r.id||s[11]!==u?(y=n??u.findIndex(k=>k.id===r.id),s[9]=n,s[10]=r.id,s[11]=u,s[12]=y):y=s[12];const C=y,S=(h||f!==null)&&C===d;let b;s[13]!==l||s[14]!==C?(b=()=>{l(C)},s[13]=l,s[14]=C,s[15]=b):b=s[15];const x=b,E=`${m}-option-${r.id}`,I=S?"":void 0;let R;s[16]!==g||s[17]!==o?(R=K(o,g),s[16]=g,s[17]=o,s[18]=R):R=s[18];let P;s[19]!==x||s[20]!==i?(P=K(i,x),s[19]=x,s[20]=i,s[21]=P):P=s[21];let O;return s[22]!==e||s[23]!==S||s[24]!==a||s[25]!==E||s[26]!==I||s[27]!==R||s[28]!==P?(O=v.jsx(J.button,{type:"button",role:"option",id:E,"aria-selected":S,"data-highlighted":I,...a,ref:e,onClick:R,onMouseMove:P}),s[22]=e,s[23]=S,s[24]=a,s[25]=E,s[26]=I,s[27]=R,s[28]=P,s[29]=O):O=s[29],O});rl.displayName="ComposerPrimitive.TriggerPopoverItem";const ol=_.forwardRef((t,e)=>{const s=T(10);let n,r;s[0]!==t?({onClick:n,...r}=t,s[0]=t,s[1]=n,s[2]=r):(n=s[1],r=s[2]);const{activeCategoryId:o,isSearchMode:i,goBack:a,open:c}=Ct();if(!c||!o||i)return null;let l;s[3]!==a||s[4]!==n?(l=K(n,a),s[3]=a,s[4]=n,s[5]=l):l=s[5];let u;return s[6]!==e||s[7]!==r||s[8]!==l?(u=v.jsx(J.button,{type:"button",...r,ref:e,onClick:l}),s[6]=e,s[7]=r,s[8]=l,s[9]=u):u=s[9],u});ol.displayName="ComposerPrimitive.TriggerPopoverBack";const il=({formatter:t,onExecute:e,removeOnExecute:s})=>{const{register:n}=Fc(),r=W(e);return r.current=e,q(()=>{const o={kind:"action",formatter:t??Va,onExecute:i=>r.current(i),...s!==void 0?{removeOnExecute:s}:{}};return n(o)},[n,t,s]),null};il.displayName="ComposerPrimitive.TriggerPopoverAction";const al=({formatter:t,onInserted:e})=>{const{register:s}=Fc(),n=W(e);return n.current=e,q(()=>s({kind:"directive",formatter:t??Va,onInserted:r=>n.current?.(r)}),[s,t]),null};al.displayName="ComposerPrimitive.TriggerPopoverDirective";const b_=Object.assign(Uc,{Directive:al,Action:il});var uS=Oe({AddAttachment:()=>l_,AttachmentByIndex:()=>Ma,AttachmentDropzone:()=>Qc,Attachments:()=>Da,Cancel:()=>a_,Dictate:()=>d_,DictationTranscript:()=>Jc,If:()=>Fa,Input:()=>Yc,Queue:()=>ka,Quote:()=>Xc,QuoteDismiss:()=>el,QuoteText:()=>Zc,Root:()=>qc,Send:()=>Oy,StopDictation:()=>h_,Unstable_TriggerPopover:()=>b_,Unstable_TriggerPopoverBack:()=>ol,Unstable_TriggerPopoverCategories:()=>tl,Unstable_TriggerPopoverCategoryItem:()=>sl,Unstable_TriggerPopoverItem:()=>rl,Unstable_TriggerPopoverItems:()=>nl,Unstable_TriggerPopoverRoot:()=>jc,unstable_useTriggerPopoverRootContext:()=>ur,unstable_useTriggerPopoverRootContextOptional:()=>dr,unstable_useTriggerPopoverScopeContext:()=>Ct,unstable_useTriggerPopoverScopeContextOptional:()=>Dy,unstable_useTriggerPopoverTriggers:()=>py,unstable_useTriggerPopoverTriggersOptional:()=>vy});const y_=()=>D(__);function __(t){if(t.part.type!=="text"&&t.part.type!=="reasoning")throw new Error("MessagePartText can only be used inside text or reasoning message parts.");return t.part}const cl=ue(null),S_=t=>({useSmoothStatus:Fi(()=>t)}),x_=t=>{const e=T(6),{children:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={optional:!0},e[0]=n):n=e[0];const r=ll(n),o=H();let i;e[1]!==o?(i=()=>S_(o.part().getState().status),e[1]=o,e[2]=i):i=e[2];const[a]=Z(i);if(r)return s;let c;return e[3]!==s||e[4]!==a?(c=v.jsx(cl.Provider,{value:a,children:s}),e[3]=s,e[4]=a,e[5]=c):c=e[5],c},w_=t=>{const e=_.forwardRef((s,n)=>{const r=T(3),o=s;let i;return r[0]!==n||r[1]!==o?(i=v.jsx(x_,{children:v.jsx(t,{...o,ref:n})}),r[0]=n,r[1]=o,r[2]=i):i=r[2],i});return e.displayName=t.displayName,e};function ll(t){const e=he(cl);if(!t?.optional&&!e)throw new Error("This component must be used within a SmoothContextProvider.");return e}const{useSmoothStatus:C_,useSmoothStatusStore:T_}=Ha(ll,"useSmoothStatus"),ul=250,dl=5;var E_=class{currentText;setText;animationFrameId=null;lastUpdateTime=Date.now();lastCommitTime=0;targetText="";drainMs=ul;maxCharIntervalMs=dl;maxCharsPerFrame=1/0;minCommitMs=0;constructor(t,e){this.currentText=t,this.setText=e}start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}animate=()=>{const t=Date.now();let e=t-this.lastUpdateTime;const s=this.targetText.length-this.currentText.length,n=Math.min(this.maxCharIntervalMs,this.drainMs/s),r=Math.min(s,this.maxCharsPerFrame);let o=0;for(;e>=n&&o<r;)o++,e-=n;o===r&&r===this.maxCharsPerFrame&&(e=0),o!==s?this.animationFrameId=requestAnimationFrame(this.animate):this.animationFrameId=null,o!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+o),this.lastUpdateTime=t-e,(o===s||t-this.lastCommitTime>=this.minCommitMs)&&(this.lastCommitTime=t,this.setText(this.currentText)))}};const on=Object.freeze({type:"running"}),Xt=(t,e)=>t!==void 0&&t>0?t:e,fl=(t,e=!1)=>{const{text:s}=t,n=Wc("(prefers-reduced-motion: reduce)"),r=typeof e=="object"&&e!==null?e:void 0,o=e!==!1&&e!==null&&!n,i=Xt(r?.drainMs,ul),a=Xt(r?.maxCharIntervalMs,dl),c=Xt(r?.maxCharsPerFrame,1/0),l=Xt(r?.minCommitMs,0),[u,d]=Z(t.status.type==="running"?"":s),f=H(),h=D(()=>f.part()),[m,p]=Z(h);(h!==m||!s.startsWith(u))&&(p(h),d(t.status.type==="running"?"":s));const g=T_({optional:!0}),y=ke(b=>{if(d(b),g){const x=u!==b||t.status.type==="running"?on:t.status;ms(g).setState(x,!0)}});q(()=>{if(g){const b=o&&(u!==s||t.status.type==="running")?on:t.status;ms(g).setState(b,!0)}},[g,o,s,u,t.status]);const[C]=Z(new E_(u,y));q(()=>{C.drainMs=i,C.maxCharIntervalMs=a,C.maxCharsPerFrame=c,C.minCommitMs=l},[C,i,a,c,l]);const S=W(h);return q(()=>{if(!o){C.stop();return}const b=S.current!==h;if(S.current=h,b||!s.startsWith(C.targetText)){t.status.type==="running"?(C.currentText="",C.targetText=s,C.lastCommitTime=0,C.start()):(C.currentText=s,C.targetText=s,C.stop());return}C.targetText=s,C.start()},[C,o,s,t.status.type,h]),q(()=>()=>{C.stop()},[C]),te(()=>o?{...t,text:u,status:s===u?t.status:on}:t,[o,u,t,s])},I_=()=>D(R_);function R_(t){if(t.part.type!=="image")throw new Error("MessagePartImage can only be used inside image message parts.");return t.part}const mr=_.forwardRef((t,e)=>{const s=T(10);let n,r,o;s[0]!==t?({smooth:r,component:o,...n}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const i=r===void 0?!0:r,a=o===void 0?"span":o,{text:c,status:l}=fl(y_(),i);let u;return s[4]!==a||s[5]!==e||s[6]!==n||s[7]!==l.type||s[8]!==c?(u=v.jsx(a,{"data-status":l.type,...n,ref:e,children:c}),s[4]=a,s[5]=e,s[6]=n,s[7]=l.type,s[8]=c,s[9]=u):u=s[9],u});mr.displayName="MessagePartPrimitive.Text";const pr=_.forwardRef((t,e)=>{const s=T(4),{image:n}=I_();let r;return s[0]!==e||s[1]!==n||s[2]!==t?(r=v.jsx(J.img,{src:n,...t,ref:e}),s[0]=e,s[1]=n,s[2]=t,s[3]=r):r=s[3],r});pr.displayName="MessagePartPrimitive.Image";const ot=t=>{const e=T(2),s=W(void 0);let n;return e[0]!==t?(n=r=>{s.current&&(s.current(),s.current=void 0),r&&(s.current=t(r))},e[0]=t,e[1]=n):n=e[1],n},Wo=(t,e)=>{const s=t.trim().match(/^(\d+(?:\.\d+)?|\.\d+)(em|px|rem)$/);if(!s)return Number.POSITIVE_INFINITY;const n=Number(s[1]),r=s[2];return r==="px"?n:r==="em"?n*(parseFloat(getComputedStyle(e).fontSize)||16):r==="rem"?n*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):Number.POSITIVE_INFINITY},A_=t=>t.dataset.messageId,P_=()=>{const t=document.createElement("div");return t.dataset.auiTopAnchorReserve="",t.style.height="0px",t.style.flexShrink="0",t.style.pointerEvents="none",t.setAttribute("aria-hidden","true"),t},Go=(t,e)=>{const s=`${e}px`;return t.style.height!==s?(t.style.height=s,!0):!1},M_=t=>{const e=window.devicePixelRatio||1;return Math.round(t*e)/e},hl=()=>{const t=T(4),e=H();let s;t[0]!==e?(s=()=>e.message(),t[0]=e,t[1]=s):s=t[1];const n=D(s);let r;return t[2]!==n?(r=o=>{const i=()=>{n.setIsHovering(!0)},a=()=>{n.setIsHovering(!1)};return o.addEventListener("mouseenter",i),o.addEventListener("mouseleave",a),o.matches(":hover")&&queueMicrotask(()=>n.setIsHovering(!0)),()=>{o.removeEventListener("mouseenter",i),o.removeEventListener("mouseleave",a),n.setIsHovering(!1)}},t[2]=n,t[3]=r):r=t[3],ot(r)},D_=()=>{const t=T(2),e=nt(j_);let s;return t[0]!==e?(s=n=>n.message.role==="user"&&n.message.index>0&&n.message.index===n.thread.messages.length-2&&n.thread.messages.at(-1)?.role==="assistant"&&(n.message.id===e||n.thread.isRunning),t[0]=e,t[1]=s):s=t[1],D(s)},k_=()=>{const t=T(2),e=nt(B_);let s;return t[0]!==e?(s=n=>n.message.isLast&&n.message.role==="assistant"&&n.message.index>=1&&n.thread.messages.at(n.message.index-1)?.role==="user"&&(n.message.id===e||n.thread.isRunning),t[0]=e,t[1]=s):s=t[1],D(s)},O_=(t,e)=>{const s=T(3);let n;return s[0]!==t||s[1]!==e?(n=r=>{if(t)return e.getState().registerAnchorElement(r)},s[0]=t,s[1]=e,s[2]=n):n=s[2],ot(n)},$_=t=>{const e=T(3),{active:s,threadViewportStore:n}=t;let r;return e[0]!==s||e[1]!==n?(r=o=>{if(!s)return;const i=n.getState(),a=i.topAnchorMessageClamp;return i.registerAnchorTargetElement(o,{tallerThan:Wo(a.tallerThan,o),visibleHeight:Wo(a.visibleHeight,o)})},e[0]=s,e[1]=n,e[2]=r):r=e[2],ot(r)},L_=t=>{const e=T(7);let s,n;e[0]!==t?({forwardedRef:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);const r=hl(),o=ae(s,r),i=D(F_);let a;return e[3]!==i||e[4]!==n||e[5]!==o?(a=v.jsx(J.div,{...n,ref:o,"data-message-id":i}),e[3]=i,e[4]=n,e[5]=o,e[6]=a):a=e[6],a},N_=t=>{const e=T(13);let s,n,r;e[0]!==t?({forwardedRef:s,threadViewportStore:r,...n}=t,e[0]=t,e[1]=s,e[2]=n,e[3]=r):(s=e[1],n=e[2],r=e[3]);const o=hl(),i=D_(),a=k_(),c=O_(i,r);let l;e[4]!==a||e[5]!==r?(l={active:a,threadViewportStore:r},e[4]=a,e[5]=r,e[6]=l):l=e[6];const u=$_(l),d=ae(s,o,c,u),f=D(U_),h=i?"":void 0,m=a?"":void 0;let p;return e[7]!==f||e[8]!==n||e[9]!==d||e[10]!==h||e[11]!==m?(p=v.jsx(J.div,{...n,ref:d,"data-message-id":f,"data-aui-top-anchor-user":h,"data-aui-top-anchor-target":m}),e[7]=f,e[8]=n,e[9]=d,e[10]=h,e[11]=m,e[12]=p):p=e[12],p},ml=_.forwardRef((t,e)=>{const s=T(7),n=rt();if(n.getState().turnAnchor==="top"){let o;return s[0]!==e||s[1]!==t||s[2]!==n?(o=v.jsx(N_,{...t,forwardedRef:e,threadViewportStore:n}),s[0]=e,s[1]=t,s[2]=n,s[3]=o):o=s[3],o}let r;return s[4]!==e||s[5]!==t?(r=v.jsx(L_,{...t,forwardedRef:e}),s[4]=e,s[5]=t,s[6]=r):r=s[6],r});ml.displayName="MessagePrimitive.Root";function j_(t){return t.topAnchorTurn?.anchorId}function B_(t){return t.topAnchorTurn?.targetId}function F_(t){return t.message.id}function U_(t){return t.message.id}const an={...oe,Text:()=>v.jsxs("p",{style:{whiteSpace:"pre-line"},children:[v.jsx(mr,{}),v.jsx(er,{children:v.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Image:()=>v.jsx(pr,{})},En=t=>{const e=T(10);if("children"in t){let a;return e[0]!==t.children?(a=v.jsx(_n,{children:t.children}),e[0]=t.children,e[1]=a):a=e[1],a}let s,n;e[2]!==t?({components:s,...n}=t,e[2]=t,e[3]=s,e[4]=n):(s=e[3],n=e[4]);let r;e[5]!==s?(r=s?{Text:s.Text??an.Text,Image:s.Image??an.Image,Reasoning:s.Reasoning??oe.Reasoning,Source:s.Source??oe.Source,File:s.File??oe.File,Unstable_Audio:s.Unstable_Audio??oe.Unstable_Audio,..."ChainOfThought"in s?{ChainOfThought:s.ChainOfThought}:{tools:s.tools,data:s.data,ToolGroup:s.ToolGroup??oe.ToolGroup,ReasoningGroup:s.ReasoningGroup??oe.ReasoningGroup},Empty:s.Empty,Quote:s.Quote,generativeUI:s.generativeUI}:an,e[5]=s,e[6]=r):r=e[6];const o=r;let i;return e[7]!==n||e[8]!==o?(i=v.jsx(_n,{components:o,...n}),e[7]=n,e[8]=o,e[9]=i):i=e[9],i};En.displayName="MessagePrimitive.Parts";const pl=t=>{const{children:e}=t;return Up()!==void 0?e:null};pl.displayName="MessagePrimitive.Error";const V_=t=>{const e=new Map;for(let n=0;n<t.length;n++){const r=t[n]?.parentId??`__ungrouped_${n}`,o=e.get(r)??[];o.push(n),e.set(r,o)}const s=[];for(const[n,r]of e){const o=n.startsWith("__ungrouped_")?void 0:n;s.push({groupKey:o,indices:r})}return s},H_=t=>{const e=T(4),s=D(Z_);let n;e:{if(s.length===0){let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0],n=o;break e}let r;e[1]!==t||e[2]!==s?(r=t(s),e[1]=t,e[2]=s,e[3]=r):r=e[3],n=r}return n},q_=t=>{const e=T(9);let s,n;e[0]!==t?({Fallback:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let r;e[3]!==s||e[4]!==n.toolName?(r=a=>{const c=a.tools.tools[n.toolName]??s;return Array.isArray(c)?c[0]??s:c},e[3]=s,e[4]=n.toolName,e[5]=r):r=e[5];const o=D(r);if(!o)return null;let i;return e[6]!==o||e[7]!==n?(i=v.jsx(o,{...n}),e[6]=o,e[7]=n,e[8]=i):i=e[8],i},z_=t=>{const e=T(9);let s,n;e[0]!==t?({Fallback:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let r;e[3]!==s||e[4]!==n.name?(r=a=>{const c=a.dataRenderers.renderers[n.name]??s;return Array.isArray(c)?c[0]??s:c},e[3]=s,e[4]=n.name,e[5]=r):r=e[5];const o=D(r);if(!o)return null;let i;return e[6]!==o||e[7]!==n?(i=v.jsx(o,{...n}),e[6]=o,e[7]=n,e[8]=i):i=e[8],i},je={Text:()=>v.jsxs("p",{style:{whiteSpace:"pre-line"},children:[v.jsx(mr,{}),v.jsx(er,{children:v.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>v.jsx(pr,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:t})=>t},W_=t=>{const e=T(43),{components:s}=t;let n;e[0]!==s?(n=s===void 0?{}:s,e[0]=s,e[1]=n):n=e[1];const{Text:r,Reasoning:o,Image:i,Source:a,File:c,Unstable_Audio:l,tools:u,data:d}=n,f=r===void 0?je.Text:r,h=o===void 0?je.Reasoning:o,m=i===void 0?je.Image:i,p=a===void 0?je.Source:a,g=c===void 0?je.File:c,y=l===void 0?je.Unstable_Audio:l;let C;e[2]!==u?(C=u===void 0?{}:u,e[2]=u,e[3]=C):C=e[3];const S=C,b=H(),x=D(e1),E=x.type;if(E==="tool-call"){let I;e[4]!==b?(I=b.part(),e[4]=b,e[5]=I):I=e[5];const R=I.addToolResult;let P;e[6]!==b?(P=b.part(),e[6]=b,e[7]=P):P=e[7];const O=P.resumeToolCall;let k;e[8]!==b?(k=b.part(),e[8]=b,e[9]=k):k=e[9];const $=k.respondToToolApproval;if("Override"in S){let U;return e[10]!==R||e[11]!==x||e[12]!==$||e[13]!==O||e[14]!==S.Override?(U=v.jsx(S.Override,{...x,addResult:R,resume:O,respondToApproval:$}),e[10]=R,e[11]=x,e[12]=$,e[13]=O,e[14]=S.Override,e[15]=U):U=e[15],U}const M=S.by_name?.[x.toolName]??S.Fallback;let B;return e[16]!==M||e[17]!==R||e[18]!==x||e[19]!==$||e[20]!==O?(B=v.jsx(q_,{...x,Fallback:M,addResult:R,resume:O,respondToApproval:$}),e[16]=M,e[17]=R,e[18]=x,e[19]=$,e[20]=O,e[21]=B):B=e[21],B}if(x.status?.type==="requires-action")throw new Error("Encountered unexpected requires-action status");switch(E){case"text":{let I;return e[22]!==f||e[23]!==x?(I=v.jsx(f,{...x}),e[22]=f,e[23]=x,e[24]=I):I=e[24],I}case"reasoning":{let I;return e[25]!==h||e[26]!==x?(I=v.jsx(h,{...x}),e[25]=h,e[26]=x,e[27]=I):I=e[27],I}case"source":{let I;return e[28]!==p||e[29]!==x?(I=v.jsx(p,{...x}),e[28]=p,e[29]=x,e[30]=I):I=e[30],I}case"image":{let I;return e[31]!==m||e[32]!==x?(I=v.jsx(m,{...x}),e[31]=m,e[32]=x,e[33]=I):I=e[33],I}case"file":{let I;return e[34]!==g||e[35]!==x?(I=v.jsx(g,{...x}),e[34]=g,e[35]=x,e[36]=I):I=e[36],I}case"audio":{let I;return e[37]!==y||e[38]!==x?(I=v.jsx(y,{...x}),e[37]=y,e[38]=x,e[39]=I):I=e[39],I}case"data":{const I=d?.by_name?.[x.name]??d?.Fallback;let R;return e[40]!==I||e[41]!==x?(R=v.jsx(z_,{...x,Fallback:I}),e[40]=I,e[41]=x,e[42]=R):R=e[42],R}default:return console.warn(`Unknown message part type: ${E}`),null}},G_=t=>{const e=T(5),{partIndex:s,components:n}=t;let r;e[0]!==n?(r=v.jsx(W_,{components:n}),e[0]=n,e[1]=r):r=e[1];let o;return e[2]!==s||e[3]!==r?(o=v.jsx(zn,{index:s,children:r}),e[2]=s,e[3]=r,e[4]=o):o=e[4],o},K_=_.memo(G_,(t,e)=>t.partIndex===e.partIndex&&t.components?.Text===e.components?.Text&&t.components?.Reasoning===e.components?.Reasoning&&t.components?.Source===e.components?.Source&&t.components?.Image===e.components?.Image&&t.components?.File===e.components?.File&&t.components?.Unstable_Audio===e.components?.Unstable_Audio&&t.components?.tools===e.components?.tools&&t.components?.data===e.components?.data&&t.components?.Group===e.components?.Group),Y_=t=>{const e=T(6),{status:s,component:n}=t,r=s.type==="running";let o;e[0]!==n||e[1]!==s?(o=v.jsx(n,{type:"text",text:"",status:s}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let i;return e[3]!==r||e[4]!==o?(i=v.jsx(Wn,{text:"",isRunning:r,children:o}),e[3]=r,e[4]=o,e[5]=i):i=e[5],i},Q_=Object.freeze({type:"complete"}),J_=t=>{const e=T(6),{components:s}=t,n=D(t1);if(s?.Empty){let i;return e[0]!==s.Empty||e[1]!==n?(i=v.jsx(s.Empty,{status:n}),e[0]=s.Empty,e[1]=n,e[2]=i):i=e[2],i}const r=s?.Text??je.Text;let o;return e[3]!==n||e[4]!==r?(o=v.jsx(Y_,{status:n,component:r}),e[3]=n,e[4]=r,e[5]=o):o=e[5],o},X_=_.memo(J_,(t,e)=>t.components?.Empty===e.components?.Empty&&t.components?.Text===e.components?.Text),gr=t=>{const e=T(9),{groupingFunction:s,components:n}=t,r=D(s1),o=H_(s);let i;e:{if(r===0){let u;e[0]!==n?(u=v.jsx(X_,{components:n}),e[0]=n,e[1]=u):u=e[1],i=u;break e}let l;if(e[2]!==n||e[3]!==o){let u;e[5]!==n?(u=(d,f)=>v.jsx(n?.Group??je.Group,{groupKey:d.groupKey,indices:d.indices,children:d.indices.map(h=>v.jsx(K_,{partIndex:h,components:n},h))},`group-${f}-${d.groupKey??"ungrouped"}`),e[5]=n,e[6]=u):u=e[6],l=o.map(u),e[2]=n,e[3]=o,e[4]=l}else l=e[4];i=l}const a=i;let c;return e[7]!==a?(c=v.jsx(v.Fragment,{children:a}),e[7]=a,e[8]=c):c=e[8],c};gr.displayName="MessagePrimitive.Unstable_PartsGrouped";const gl=t=>{const e=T(6);let s,n;e[0]!==t?({components:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let r;return e[3]!==s||e[4]!==n?(r=v.jsx(gr,{...n,components:s,groupingFunction:V_}),e[3]=s,e[4]=n,e[5]=r):r=e[5],r};gl.displayName="MessagePrimitive.Unstable_PartsGroupedByParentId";function Z_(t){return t.message.parts}function e1(t){return t.part}function t1(t){return t.message.status??Q_}function s1(t){return t.message.parts.length}var dS=Oe({AttachmentByIndex:()=>Ra,Attachments:()=>Aa,Content:()=>En,Error:()=>pl,GenerativeUI:()=>pa,GroupedParts:()=>Ta,If:()=>Oc,PartByIndex:()=>At,Parts:()=>En,Quote:()=>Ea,Root:()=>ml,Unstable_PartsGrouped:()=>gr,Unstable_PartsGroupedByParentId:()=>gl});const n1=t=>{const e=T(2),s=ke(t);let n;return e[0]!==s?(n=r=>{const o=new ResizeObserver(()=>{s()}),i=new MutationObserver(a=>{a.some(r1)&&s()});return o.observe(r),i.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{o.disconnect(),i.disconnect()}},e[0]=s,e[1]=n):n=e[1],ot(n)};function r1(t){return t.type!=="attributes"||t.attributeName!=="style"}const o1=({autoScroll:t,scrollToBottomOnRunStart:e=!0,scrollToBottomOnInitialize:s=!0,scrollToBottomOnThreadSwitch:n=!0})=>{const r=W(null),o=D(b=>b.thread.messages.length>0),i=W(!1),a=W(null),c=rt();t===void 0&&(t=c.getState().turnAnchor!=="top");const l=W(0),u=W(0),d=W(0),f=W(0),h=W(null),m=Ke(b=>{const x=r.current;x&&(h.current=b,x.scrollTo({top:x.scrollHeight,behavior:b}))},[]),p=Ke(b=>{h.current=b,a.current!==null&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{a.current=null,m(b)})},[m]);is(()=>()=>{a.current!==null&&cancelAnimationFrame(a.current)},[]);const g=Ke(()=>{const b=c.getState();return b.turnAnchor==="top"&&b.element.viewport===r.current&&b.element.anchor!==null},[c]),y=()=>{const b=r.current;if(!b)return;const x=c.getState().isAtBottom,E=Math.abs(b.scrollHeight-b.scrollTop-b.clientHeight)<=1||b.scrollHeight<=b.clientHeight;!E&&l.current<b.scrollTop||(E?b.scrollHeight>b.clientHeight+1&&(h.current=null):l.current>b.scrollTop&&u.current===b.scrollHeight&&(h.current=null),(E||h.current===null)&&E!==x&&ms(c).setState({isAtBottom:E})),l.current=b.scrollTop,u.current=b.scrollHeight},C=n1(()=>{const b=r.current;if(!b)return;const{scrollHeight:x,clientHeight:E}=b;if(x===d.current&&E===f.current)return;d.current=x,f.current=E;const I=h.current;I&&g()?h.current=null:I?m(I):t&&c.getState().isAtBottom&&m("instant"),y()}),S=ot(b=>{const x=()=>{h.current=null};return b.addEventListener("scroll",y),b.addEventListener("pointerdown",x),()=>{b.removeEventListener("scroll",y),b.removeEventListener("pointerdown",x)}});return is(()=>{if(s){if(!o){i.current=!1;return}i.current||(i.current=!0,h.current===null&&p("instant"))}},[o,p,s]),zc(({behavior:b})=>{m(b)}),cs("thread.runStart",()=>{e&&c.getState().turnAnchor!=="top"&&p("auto")}),cs("threadListItem.switchedTo",()=>{n&&p("instant")}),ae(C,S,r)},vl=_.forwardRef((t,e)=>{const s=T(3);let n;return s[0]!==t||s[1]!==e?(n=v.jsx(J.div,{...t,ref:e}),s[0]=t,s[1]=e,s[2]=n):n=s[2],n});vl.displayName="ThreadPrimitive.Root";const bl=t=>{const{children:e}=t;return D(i1)?e:null};bl.displayName="ThreadPrimitive.Empty";function i1(t){return t.thread.isEmpty}const a1=t=>{const e=T(4);let s;return e[0]!==t.disabled||e[1]!==t.empty||e[2]!==t.running?(s=n=>!(t.empty===!0&&!n.thread.isEmpty||t.empty===!1&&n.thread.isEmpty||t.running===!0&&!n.thread.isRunning||t.running===!1&&n.thread.isRunning||t.disabled===!0&&!n.thread.isDisabled||t.disabled===!1&&n.thread.isDisabled),e[0]=t.disabled,e[1]=t.empty,e[2]=t.running,e[3]=s):s=e[3],D(s)},yl=t=>{const e=T(3);let s,n;return e[0]!==t?({children:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]),a1(n)?s:null};yl.displayName="ThreadPrimitive.If";const _l=(t,e)=>{const s=T(3);let n;return s[0]!==e||s[1]!==t?(n=r=>{if(!t)return;const o=t(),i=()=>{const c=e?e(r):r.offsetHeight;o.setHeight(c)},a=new ResizeObserver(i);return a.observe(r),i(),()=>{a.disconnect(),o.unregister()}},s[0]=e,s[1]=t,s[2]=n):n=s[2],ot(n)},Ko=t=>{let e=0,s=t;for(;s;)e+=s.offsetTop,s=s.offsetParent;return e},c1=(t,e)=>{let s=0,n=t;for(;n&&n!==e;)s+=n.offsetTop,n=n.offsetParent;return n===e?s:Ko(t)-Ko(e)},Sl=({viewport:t,anchor:e,tallerThan:s,visibleHeight:n})=>{const r=c1(e,t),o=e.offsetHeight;return r+Math.max(0,o-(o<=s?o:n))},l1=({scrollHeight:t,...e})=>{const{viewport:s}=e,n=Sl(e)+s.clientHeight;return Math.max(0,n-t)},u1=({viewport:t,reserve:e,...s})=>l1({viewport:t,...s,scrollHeight:t.scrollHeight-e.offsetHeight}),d1=t=>{const e=new ResizeObserver(t),s=new MutationObserver(t);let n=null,r=null,o=null;const i=()=>{e.disconnect(),s.disconnect(),n=null,r=null,o=null};return{target:(a,c,l)=>{n===a&&r===c&&o===l||(i(),e.observe(a),e.observe(c),e.observe(l),s.observe(l,{childList:!0,subtree:!0,characterData:!0}),n=a,r=c,o=l)},disconnect:i}},f1=t=>{let e=null;return{schedule:()=>{e===null&&(e=requestAnimationFrame(()=>{e=null,t()}))},cancel:()=>{e!==null&&(cancelAnimationFrame(e),e=null)}}},h1=t=>{let e=null,s;function n(){const a=t.getState(),{viewport:c,anchor:l,target:u}=a.element,d=a.targetConfig;if(a.turnAnchor!=="top"||!c||!l||!u||!d){o.disconnect(),e&&(Go(e,0),e.remove());return}if(e??=P_(),(e.parentElement!==u.parentElement||e.previousElementSibling!==u)&&u.after(e),o.target(c,l,u),Go(e,u1({viewport:c,anchor:l,reserve:e,...d}))){r.schedule();return}const f=A_(l);if(f!==void 0&&s===f)return;const h=M_(Sl({viewport:c,anchor:l,...d}));Math.abs(c.scrollTop-h)>1&&c.scrollTo({top:h,behavior:"smooth"}),f!==void 0&&(s=f)}const r=f1(n),o=d1(r.schedule);r.schedule();const i=t.subscribe(r.schedule);return()=>{r.cancel(),i(),o.disconnect(),e?.remove()}},m1=t=>{const e=T(4),s=rt();let n,r;e[0]!==t||e[1]!==s?(n=()=>{if(t)return h1(s)},r=[t,s],e[0]=t,e[1]=s,e[2]=n,e[3]=r):(n=e[2],r=e[3]),is(n,r)},xl=({isRunning:t,messages:e})=>{if(!t)return null;const s=e.at(-1),n=e.at(-2);return n?.role!=="user"||s?.role!=="assistant"?null:{anchorId:n.id,targetId:s.id}},p1=t=>xl(t)?.anchorId,g1=t=>xl(t)?.targetId,v1=()=>_l(nt(_1),S1),b1=()=>ot(nt(x1)),y1=t=>{const e=T(13),s=rt();let n;e[0]!==t?(n=h=>{if(t)return p1(h.thread)},e[0]=t,e[1]=n):n=e[1];const r=D(n);let o;e[2]!==t?(o=h=>{if(t)return g1(h.thread)},e[2]=t,e[3]=o):o=e[3];const i=D(o);let a;e:{if(!r||!i){a=null;break e}let h;e[4]!==r||e[5]!==i?(h={anchorId:r,targetId:i},e[4]=r,e[5]=i,e[6]=h):h=e[6],a=h}const c=a;let l,u;e[7]!==c||e[8]!==s?(l=()=>{if(!c)return;const h=s.getState(),m=h.topAnchorTurn;m?.anchorId===c.anchorId&&m.targetId===c.targetId||h.setTopAnchorTurn(c)},u=[c,s],e[7]=c,e[8]=s,e[9]=l,e[10]=u):(l=e[9],u=e[10]),is(l,u);let d;e[11]!==s?(d=()=>{s.getState().setTopAnchorTurn(null)},e[11]=s,e[12]=d):d=e[12];const f=d;cs("thread.initialize",f),cs("threadListItem.switchedTo",f)},wl=_.forwardRef((t,e)=>{const s=T(18);let n,r,o,i,a,c;s[0]!==t?({autoScroll:n,scrollToBottomOnRunStart:a,scrollToBottomOnInitialize:i,scrollToBottomOnThreadSwitch:c,children:r,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o,s[4]=i,s[5]=a,s[6]=c):(n=s[1],r=s[2],o=s[3],i=s[4],a=s[5],c=s[6]);let l;s[7]!==n||s[8]!==i||s[9]!==a||s[10]!==c?(l={autoScroll:n,scrollToBottomOnRunStart:a,scrollToBottomOnInitialize:i,scrollToBottomOnThreadSwitch:c},s[7]=n,s[8]=i,s[9]=a,s[10]=c,s[11]=l):l=s[11];const u=o1(l),d=v1(),f=b1(),h=rt();let m;s[12]!==h?(m=h.getState(),s[12]=h,s[13]=m):m=s[13];const p=m.turnAnchor==="top";y1(p),m1(p);const g=ae(e,u,d,f);let y;return s[14]!==r||s[15]!==g||s[16]!==o?(y=v.jsx(J.div,{...o,ref:g,children:r}),s[14]=r,s[15]=g,s[16]=o,s[17]=y):y=s[17],y});wl.displayName="ThreadPrimitive.ViewportScrollable";const Cl=_.forwardRef((t,e)=>{const s=T(13);let n,r,o;s[0]!==t?({turnAnchor:o,topAnchorMessageClamp:r,...n}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);let i;s[4]!==r||s[5]!==o?(i={turnAnchor:o,topAnchorMessageClamp:r},s[4]=r,s[5]=o,s[6]=i):i=s[6];let a;s[7]!==n||s[8]!==e?(a=v.jsx(wl,{...n,ref:e}),s[7]=n,s[8]=e,s[9]=a):a=s[9];let c;return s[10]!==i||s[11]!==a?(c=v.jsx(tr,{options:i,children:a}),s[10]=i,s[11]=a,s[12]=c):c=s[12],c});Cl.displayName="ThreadPrimitive.Viewport";function _1(t){return t.registerViewport}function S1(t){return t.clientHeight}function x1(t){return t.registerViewportElement}const Tl=_.forwardRef((t,e)=>{const s=T(3),n=ae(e,_l(nt(w1),C1));let r;return s[0]!==t||s[1]!==n?(r=v.jsx(J.div,{...t,ref:n}),s[0]=t,s[1]=n,s[2]=r):r=s[2],r});Tl.displayName="ThreadPrimitive.ViewportFooter";function w1(t){return t.registerContentInset}function C1(t){const e=parseFloat(getComputedStyle(t).marginTop)||0;return t.offsetHeight+e}const T1=t=>{const e=T(5);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{behavior:n}=s,r=nt(I1),o=rt();let i;e[2]!==n||e[3]!==o?(i=()=>{o.getState().scrollToBottom({behavior:n})},e[2]=n,e[3]=o,e[4]=i):i=e[4];const a=i;return r?null:a},E1=ce("ThreadPrimitive.ScrollToBottom",T1,["behavior"]);function I1(t){return t.isAtBottom}const R1=t=>{const e=T(4),{prompt:s,send:n,clearComposer:r,autoSend:o}=t,i=n??o??!1;let a;e[0]!==r||e[1]!==s||e[2]!==i?(a={prompt:s,send:i,clearComposer:r},e[0]=r,e[1]=s,e[2]=i,e[3]=a):a=e[3];const{disabled:c,trigger:l}=Dp(a);return c?null:l},A1=ce("ThreadPrimitive.Suggestion",R1,["prompt","send","clearComposer","autoSend","method"]);var fS=Oe({Empty:()=>bl,If:()=>yl,MessageByIndex:()=>ua,Messages:()=>rm,Root:()=>vl,ScrollToBottom:()=>E1,Suggestion:()=>A1,SuggestionByIndex:()=>ja,Suggestions:()=>sp,Unstable_MessageById:()=>da,Viewport:()=>Cl,ViewportFooter:()=>Tl,ViewportProvider:()=>tr});const El=_.forwardRef((t,e)=>{const s=T(15);let n,r,o;s[0]!==t?({onClick:r,disabled:n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const i=D(P1),{switchToNewThread:a}=jp();let c;s[4]!==i?(c=i?{"data-active":"true","aria-current":"true"}:null,s[4]=i,s[5]=c):c=s[5];let l;s[6]!==r||s[7]!==a?(l=K(r,a),s[6]=r,s[7]=a,s[8]=l):l=s[8];let u;return s[9]!==n||s[10]!==e||s[11]!==o||s[12]!==c||s[13]!==l?(u=v.jsx(J.button,{type:"button",...c,...o,ref:e,disabled:n,onClick:l}),s[9]=n,s[10]=e,s[11]=o,s[12]=c,s[13]=l,s[14]=u):u=s[14],u});El.displayName="ThreadListPrimitive.New";function P1(t){return t.threads.newThreadId===t.threads.mainThreadId}const M1=()=>{const{loadMore:t,disabled:e}=Bp();return e?null:t},D1=ce("ThreadListPrimitive.LoadMore",M1),[k1,O1]=kg("ThreadList"),In=k1,Il=ue(null),$1=Il.Provider,L1=()=>he(Il),Rl=_.forwardRef((t,e)=>{const s=T(3);let n;return s[0]!==t||s[1]!==e?(n=v.jsx(In.Provider,{scope:void 0,children:v.jsx(In.Slot,{scope:void 0,children:v.jsx(J.div,{...t,ref:e})})}),s[0]=t,s[1]=e,s[2]=n):n=s[2],n});Rl.displayName="ThreadListPrimitive.Root";var hS=Oe({ItemByIndex:()=>Oa,Items:()=>$a,LoadMore:()=>D1,New:()=>El,Root:()=>Rl});const Al=_.forwardRef((t,e)=>{const s=D(l=>l.threads.mainThreadId===l.threadListItem.id),n=W(null),r=W(null),o=te(()=>({triggerRef:n,moreRef:r}),[]),i=O1(void 0),a=zg(),c=l=>{const u=a==="rtl"?"ArrowLeft":"ArrowRight",d=a==="rtl"?"ArrowRight":"ArrowLeft",f=n.current,h=r.current;if(f&&l.target===f)if(l.key==="ArrowDown"||l.key==="ArrowUp"){const m=i().map(g=>g.ref.current).filter(g=>g!==null),p=m[m.indexOf(f)+(l.key==="ArrowDown"?1:-1)];p&&(p.focus(),l.preventDefault())}else l.key===u&&h&&(h.focus(),l.preventDefault());else h&&l.target===h&&l.key===d&&(f?.focus(),l.preventDefault())};return v.jsx($1,{value:o,children:v.jsx(J.div,{...s?{"data-active":"true","aria-current":"true"}:null,...t,onKeyDown:K(t.onKeyDown,c),ref:e})})});Al.displayName="ThreadListItemPrimitive.Root";const N1=()=>{const{archive:t}=Op();return t},j1=ce("ThreadListItemPrimitive.Archive",N1),B1=()=>{const{unarchive:t}=Lp();return t},F1=ce("ThreadListItemPrimitive.Unarchive",B1),U1=()=>{const{delete:t}=$p();return t},V1=ce("ThreadListItemPrimitive.Delete",U1),H1=()=>{const{switchTo:t}=Np();return t},q1=ce("ThreadListItemPrimitive.Trigger",H1),Pl=_.forwardRef((t,e)=>{const s=T(3),n=ae(e,L1()?.triggerRef);let r;return s[0]!==t||s[1]!==n?(r=v.jsx(In.ItemSlot,{scope:void 0,children:v.jsx(q1,{...t,ref:n})}),s[0]=t,s[1]=n,s[2]=r):r=s[2],r});Pl.displayName="ThreadListItemPrimitive.Trigger";var mS=Oe({Archive:()=>j1,Delete:()=>V1,Root:()=>Al,Title:()=>La,Trigger:()=>Pl,Unarchive:()=>F1});const Rn="[data-aui-quote-selectable]",z1=t=>t instanceof HTMLElement?t:t?.parentElement??null,Yo=t=>{let e=t instanceof HTMLElement?t:t?.parentElement??null;for(;e;){if(e.getAttribute("data-message-id"))return e;e=e.parentElement}return null},Ss=t=>t.getAttribute("data-aui-quote-selectable")==="false",W1=t=>{if(t.matches(Rn)&&!Ss(t))return!0;for(const e of t.querySelectorAll(Rn))if(!Ss(e))return!0;return!1},Qo=(t,e)=>{const s=z1(t)?.closest(Rn);return!(s instanceof HTMLElement)||!e.contains(s)?null:s},G1=t=>{const{anchorNode:e,focusNode:s}=t;if(!e||!s)return null;const n=Yo(e),r=Yo(s);if(!n||n!==r)return null;const o=n.getAttribute("data-message-id");if(!o)return null;const i=Qo(e,n),a=Qo(s,n);return i&&Ss(i)||a&&Ss(a)||W1(n)&&(!i||i!==a)?null:o},Ml=ue(null),K1=()=>he(Ml),Dl=_.forwardRef((t,e)=>{const s=T(20);let n,r,o;s[0]!==t?({onMouseDown:n,style:o,...r}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const[i,a]=Z(null);let c,l;if(s[4]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const y=()=>{requestAnimationFrame(()=>{const b=window.getSelection();if(!b||b.isCollapsed){a(null);return}const x=b.toString().trim();if(!x){a(null);return}const E=G1(b);if(!E){a(null);return}const I=b.getRangeAt(0).getBoundingClientRect();a({text:x,messageId:E,rect:I})})},C=()=>{const b=window.getSelection();(!b||b.isCollapsed)&&a(null)},S=()=>{a(null)};return document.addEventListener("mouseup",y),document.addEventListener("keyup",y),document.addEventListener("selectionchange",C),document.addEventListener("scroll",S,!0),()=>{document.removeEventListener("mouseup",y),document.removeEventListener("keyup",y),document.removeEventListener("selectionchange",C),document.removeEventListener("scroll",S,!0)}},l=[],s[4]=c,s[5]=l):(c=s[4],l=s[5]),q(c,l),!i)return null;const u=`${i.rect.top-8}px`,d=`${i.rect.left+i.rect.width/2}px`;let f;s[6]!==o||s[7]!==u||s[8]!==d?(f={position:"fixed",top:u,left:d,transform:"translate(-50%, -100%)",zIndex:50,...o},s[6]=o,s[7]=u,s[8]=d,s[9]=f):f=s[9];const h=f;let m;s[10]!==n?(m=y=>{y.preventDefault(),n?.(y)},s[10]=n,s[11]=m):m=s[11];let p;s[12]!==e||s[13]!==h||s[14]!==r||s[15]!==m?(p=v.jsx(J.div,{...r,ref:e,style:h,onMouseDown:m}),s[12]=e,s[13]=h,s[14]=r,s[15]=m,s[16]=p):p=s[16];let g;return s[17]!==i||s[18]!==p?(g=As.createPortal(v.jsx(Ml.Provider,{value:i,children:p}),document.body),s[17]=i,s[18]=p,s[19]=g):g=s[19],g});Dl.displayName="SelectionToolbarPrimitive.Root";const kl=_.forwardRef((t,e)=>{const s=T(15);let n,r,o;s[0]!==t?({onClick:r,disabled:n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const i=H(),a=K1();let c;s[4]!==i||s[5]!==a?(c=()=>{a&&(i.thread().composer().setQuote({text:a.text,messageId:a.messageId}),window.getSelection()?.removeAllRanges())},s[4]=i,s[5]=a,s[6]=c):c=s[6];const l=c,u=n||!a;let d;s[7]!==l||s[8]!==r?(d=K(r,l),s[7]=l,s[8]=r,s[9]=d):d=s[9];let f;return s[10]!==e||s[11]!==o||s[12]!==u||s[13]!==d?(f=v.jsx(J.button,{type:"button",...o,ref:e,disabled:u,onClick:d}),s[10]=e,s[11]=o,s[12]=u,s[13]=d,s[14]=f):f=s[14],f});kl.displayName="SelectionToolbarPrimitive.Quote";var pS=Oe({Quote:()=>kl,Root:()=>Dl});const gS=(t,e)=>{const s=T(5),n=W(null),r=W(null);let o,i;s[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>()=>{r.current?.()},i=[],s[0]=o,s[1]=i):(o=s[0],i=s[1]),q(o,i);let a;return s[2]!==t||s[3]!==e?(a=()=>{r.current?.(),(function(){if(n.current||!t.current)return;let S=t.current;for(;S;){const{overflowY:b}=getComputedStyle(S);if(b==="scroll"||b==="auto"){n.current=S;break}S=S.parentElement}})();const c=n.current;if(!c)return;const l=c.scrollTop,u=c.style.scrollbarWidth,d=getComputedStyle(c),f=d.direction==="rtl"?"paddingLeft":"paddingRight",h=c.style[f],m=c.offsetWidth-c.clientWidth-parseFloat(d.borderLeftWidth)-parseFloat(d.borderRightWidth);c.style.scrollbarWidth="none",m>0&&(c.style[f]=`${parseFloat(d[f])+m}px`);const p=()=>{c.style.scrollbarWidth=u,c.style[f]=h},g=()=>c.scrollTop=l;c.addEventListener("scroll",g);const y=setTimeout(()=>{c.removeEventListener("scroll",g),p(),r.current=null},e);r.current=()=>{clearTimeout(y),c.removeEventListener("scroll",g),p()}},s[2]=t,s[3]=e,s[4]=a):a=s[4],a};var vS=Oe({AssistantRuntimeImpl:()=>oa,BaseAssistantRuntimeCore:()=>ia,CompositeContextProvider:()=>Bn,DefaultThreadComposerRuntimeCore:()=>la,MessageRepository:()=>Kn,ThreadRuntimeImpl:()=>ra,getAutoStatus:()=>hs,splitLocalRuntimeOptions:()=>Hp,useComposerInputPluginRegistryOptional:()=>js,useSmooth:()=>fl,useSmoothStatus:()=>C_,withSmoothContextProvider:()=>w_});function bS(t){const{commands:e,removeOnExecute:s}=t,n=W(e);return n.current=e,te(()=>({adapter:{categories:()=>[],categoryItems:()=>[],search:r=>{const o=r.toLowerCase();return n.current.filter(i=>Q1(i,o)).map(Y1)}},action:{onExecute:r=>{n.current.find(o=>o.id===r.id)?.execute()},...s!==void 0?{removeOnExecute:s}:{}},...t.iconMap?{iconMap:t.iconMap}:{},...t.fallbackIcon?{fallbackIcon:t.fallbackIcon}:{}}),[s,t.iconMap,t.fallbackIcon])}function Y1(t){return{id:t.id,type:"command",label:t.label??`/${t.id}`,...t.description!==void 0?{description:t.description}:{},...t.icon!==void 0?{metadata:{icon:t.icon}}:{}}}function Q1(t,e){return!!(!e||t.id.toLowerCase().includes(e)||t.label?.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))}function yS(t){const e=H(),s=Gc(),n=Kc(t?.disabled),r=Ke(c=>{e.composer().getState().isEditing&&ln(()=>{e.composer().setText(c)})},[e]),{send:o,disabled:i}=Ua(),a=!i&&!n;return{value:s,setText:r,send:Ke(c=>{a&&o(c)},[a,o]),isDisabled:n,canSend:a}}export{bS as $,Fe as A,iS as B,aS as C,Ee as D,tS as E,nS as F,rS as G,oS as H,Os as I,Ys as J,Jv as K,eb as L,tb as M,rb as N,Qp as O,Ae as P,pS as Q,An as R,uS as S,dS as T,cs as U,H as V,D as W,lS as X,X1 as Y,gS as Z,eS as _,y_ as a,Va as a0,Ct as a1,yS as a2,fS as a3,hS as a4,mS as a5,J1 as a6,Z1 as a7,Xo as b,Fl as c,Mo as d,Ve as e,Ie as f,Jo as g,Re as h,vS as i,v as j,wt as k,As as l,wc as m,fe as n,$t as o,Ze as p,sS as q,_ as r,Be as s,_b as t,ke as u,Sc as v,jt as w,_c as x,fb as y,cS as z};
|
|
70
|
+
`):!1,s[5]=n,s[6]=d):d=s[6];const f=D(d)&&!a;let h;s[7]!==i?(h=b=>{b.preventDefault(),i&&i()},s[7]=i,s[8]=h):h=s[8];const m=h,p=n?u:null,g=f?"":void 0;let y;s[9]!==m||s[10]!==r?(y=K(r,m),s[9]=m,s[10]=r,s[11]=y):y=s[11];let C;s[12]!==e||s[13]!==o||s[14]!==g||s[15]!==y?(C=v.jsx(J.form,{...o,"data-compact":g,ref:e,onSubmit:y}),s[12]=e,s[13]=o,s[14]=g,s[15]=y,s[16]=C):C=s[16];let S;return s[17]!==p||s[18]!==C?(S=v.jsx(Hc.Provider,{value:p,children:C}),s[17]=p,s[18]=C,s[19]=S):S=s[19],S});qc.displayName="ComposerPrimitive.Root";const zc=t=>{const e=T(4),s=ke(t),n=nt(Ly);let r,o;e[0]!==s||e[1]!==n?(r=()=>n(s),o=[n,s],e[0]=s,e[1]=n,e[2]=r,e[3]=o):(r=e[2],o=e[3]),q(r,o)};function Ly(t){return t.onScrollToBottom}const Ny=()=>!1,jy=()=>{},Wc=t=>{const e=T(4);let s;e[0]!==t?(s=o=>{if(typeof window>"u"||t===null||!window.matchMedia)return jy;const i=window.matchMedia(t);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},e[0]=t,e[1]=s):s=e[1];const n=s;let r;return e[2]!==t?(r=()=>typeof window>"u"||t===null||!window.matchMedia?!1:window.matchMedia(t).matches,e[2]=t,e[3]=r):r=e[3],St(n,r,Ny)};function Gc(){return D(By)}function By(t){return t.composer.isEditing?t.composer.text:""}function Kc(t){return!!D(Fy)||!!t}function Fy(t){return t.thread.isDisabled||t.composer.dictation?.inputDisabled}function Uy(){const t=T(4),e=by();if(!e){let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n={},t[0]=n):n=t[0],n}let s;return t[1]!==e.highlightedItemId||t[2]!==e.popoverId?(s={"aria-controls":e.popoverId,"aria-expanded":!0,"aria-haspopup":"listbox","aria-activedescendant":e.highlightedItemId},t[1]=e.highlightedItemId,t[2]=e.popoverId,t[3]=s):s=t[3],s}function Tn(){return Tn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},Tn.apply(null,arguments)}function Vy(t,e){if(t==null)return{};var s={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;s[n]=t[n]}return s}var Hy=_.useLayoutEffect,qy=function(e){var s=ne.useRef(e);return Hy(function(){s.current=e}),s},Uo=function(e,s){if(typeof e=="function"){e(s);return}e.current=s},zy=function(e,s){var n=ne.useRef();return ne.useCallback(function(r){e.current=r,n.current&&Uo(n.current,null),n.current=s,s&&Uo(s,r)},[s])},Vo={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},Wy=function(e){Object.keys(Vo).forEach(function(s){e.style.setProperty(s,Vo[s],"important")})},Ho=Wy,le=null,qo=function(e,s){var n=e.scrollHeight;return s.sizingStyle.boxSizing==="border-box"?n+s.borderSize:n-s.paddingSize};function Gy(t,e,s,n){s===void 0&&(s=1),n===void 0&&(n=1/0),le||(le=document.createElement("textarea"),le.setAttribute("tabindex","-1"),le.setAttribute("aria-hidden","true"),Ho(le)),le.parentNode===null&&document.body.appendChild(le);var r=t.paddingSize,o=t.borderSize,i=t.sizingStyle,a=i.boxSizing;Object.keys(i).forEach(function(f){var h=f;le.style[h]=i[h]}),Ho(le),le.value=e;var c=qo(le,t);le.value=e,c=qo(le,t),le.value="x";var l=le.scrollHeight-r,u=l*s;a==="border-box"&&(u=u+r+o),c=Math.max(u,c);var d=l*n;return a==="border-box"&&(d=d+r+o),c=Math.min(d,c),[c,l]}var zo=function(){},Ky=function(e,s){return e.reduce(function(n,r){return n[r]=s[r],n},{})},Yy=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],Qy=!!document.documentElement.currentStyle,Jy=function(e){var s=window.getComputedStyle(e);if(s===null)return null;var n=Ky(Yy,s),r=n.boxSizing;if(r==="")return null;Qy&&r==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var o=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),i=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:o,borderSize:i}},Xy=Jy;function hr(t,e,s){var n=qy(s);_.useLayoutEffect(function(){var r=function(i){return n.current(i)};if(t)return t.addEventListener(e,r),function(){return t.removeEventListener(e,r)}},[])}var Zy=function(e,s){hr(document.body,"reset",function(n){e.current.form===n.target&&s(n)})},e_=function(e){hr(window,"resize",e)},t_=function(e){hr(document.fonts,"loadingdone",e)},s_=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],n_=function(e,s){var n=e.cacheMeasurements,r=e.maxRows,o=e.minRows,i=e.onChange,a=i===void 0?zo:i,c=e.onHeightChange,l=c===void 0?zo:c,u=Vy(e,s_),d=u.value!==void 0,f=_.useRef(null),h=zy(f,s),m=_.useRef(0),p=_.useRef(),g=function(){var S=f.current,b=n&&p.current?p.current:Xy(S);if(b){p.current=b;var x=Gy(b,S.value||S.placeholder||"x",o,r),E=x[0],I=x[1];m.current!==E&&(m.current=E,S.style.setProperty("height",E+"px","important"),l(E,{rowHeight:I}))}},y=function(S){d||g(),a(S)};return _.useLayoutEffect(g),Zy(f,function(){if(!d){var C=f.current.value;requestAnimationFrame(function(){var S=f.current;S&&C!==S.value&&g()})}}),e_(g),t_(g),_.createElement("textarea",Tn({},u,{onChange:y,ref:h}))},r_=_.forwardRef(n_);const o_="(pointer: coarse) and (not (any-pointer: fine))",Yc=_.forwardRef(({autoFocus:t=!1,asChild:e,render:s,disabled:n,onChange:r,onKeyDown:o,onPaste:i,onSelect:a,submitOnEnter:c,submitMode:l,cancelOnEscape:u=!0,unstable_focusOnRunStart:d=!0,unstable_focusOnScrollToBottom:f=!0,unstable_focusOnThreadSwitched:h=!0,unstable_insertNewlineOnTouchEnter:m=!1,addAttachmentOnPaste:p=!0,onHeightChange:g,...y},C)=>{const S=H(),b=js(),x=$y(),E=l??(c===!1?"none":"enter"),I=Wc(m?o_:null),R=m&&I&&E==="enter"?"none":E,P=Gc(),O=Kc(n),k=W(null),$=ae(C,k),M=W(!1);Ga(A=>{if(!k.current?.contains(A.target))return;if(b){for(const N of b.getPlugins())if(N.handleKeyDown(A))return}if(!u)return;const L=S.composer();L.getState().canCancel&&(L.cancel(),A.preventDefault())});const B=A=>{if(!O&&!A.nativeEvent.isComposing){if(b){for(const L of b.getPlugins())if(L.handleKeyDown(A))return}if(A.key==="Enter"){const L=S.thread().getState(),N=L.capabilities.queue;if(A.shiftKey&&(A.ctrlKey||A.metaKey)&&N&&E!=="none"&&S.composer().getState().canSend){A.preventDefault(),S.composer().send({steer:!0});return}if(A.shiftKey||L.isRunning&&!N)return;let F=!1;R==="ctrlEnter"?F=A.ctrlKey||A.metaKey:R==="enter"&&(F=!0),F&&(A.preventDefault(),k.current?.closest("form")?.requestSubmit())}}},U=async A=>{if(!p)return;const L=S.thread().getState().capabilities,N=Array.from(A.clipboardData?.files||[]);if(L.attachments&&N.length>0)try{A.preventDefault(),await Promise.all(N.map(F=>S.composer().addAttachment(F)))}catch(F){console.error("Error adding attachment:",F)}},V=(A,L)=>{if(g?.(A,L),!x)return;const N=k.current;if(!N||N.value==="")return;const F=getComputedStyle(N),X=F.boxSizing==="border-box"?A-parseFloat(F.paddingTop)-parseFloat(F.paddingBottom)-parseFloat(F.borderTopWidth)-parseFloat(F.borderBottomWidth):A;Math.round(X/L.rowHeight)>1&&x.setMultiline(!0)},Q=t&&!O,j=Ke(()=>{const A=k.current;!A||!Q||(A.focus({preventScroll:!0}),A.setSelectionRange(A.value.length,A.value.length))},[Q]);q(()=>j(),[j]),zc(()=>{S.composer().getState().type==="thread"&&f&&j()}),q(()=>{if(!(S.composer().getState().type!=="thread"||!d))return S.on("thread.runStart",j)},[d,j,S]),q(()=>{if(!(S.composer().getState().type!=="thread"||!h))return S.on("threadListItem.switchedTo",j)},[h,j,S]),q(()=>{P===""&&x?.setMultiline(!1)},[P,x]);const ee=Uy(),w={name:"input",value:P,...y,...ee,ref:$,disabled:O,onChange:K(r,A=>{if(!S.composer().getState().isEditing)return;const L=A.nativeEvent.isComposing===!0;M.current&&!L&&(M.current=!1);const N=L||M.current;if(ln(()=>{S.composer().setText(A.target.value)}),N)return;const F=A.target.selectionStart??A.target.value.length;if(b)for(const X of b.getPlugins())X.setCursorPosition(F)}),onKeyDown:K(o,B),onCompositionStart:K(y.onCompositionStart,()=>{M.current=!0}),onCompositionEnd:K(y.onCompositionEnd,A=>{if(M.current=!1,!S.composer().getState().isEditing)return;const L=A.target;ln(()=>{S.composer().setText(L.value)});const N=L.selectionStart??L.value.length;if(b)for(const F of b.getPlugins())F.setCursorPosition(N)}),onSelect:K(a,A=>{if(M.current)return;const L=A.target,N=L.selectionStart??L.value.length;if(b)for(const F of b.getPlugins())F.setCursorPosition(N)}),onPaste:K(i,U),...x?{onHeightChange:V}:g!==void 0?{onHeightChange:g}:{}};if(s&&_.isValidElement(s)){const A=y.children!==void 0?y.children:s.props.children;return v.jsx(ps,{...w,children:_.cloneElement(s,void 0,A)})}return v.jsx(e?ps:r_,{...w})});Yc.displayName="ComposerPrimitive.Input";const i_=()=>{const{disabled:t,cancel:e}=op();return t?null:e},a_=ce("ComposerPrimitive.Cancel",i_),c_=t=>{const e=T(6);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{multiple:n}=s,r=n===void 0?!0:n,{disabled:o,addAttachment:i}=lp(),a=H();let c;e[2]!==i||e[3]!==a||e[4]!==r?(c=()=>{const u=document.createElement("input");u.type="file",u.multiple=r,u.hidden=!0;const d=a.composer().getState().attachmentAccept;d!=="*"&&(u.accept=d),document.body.appendChild(u),u.onchange=f=>{const h=f.target.files;if(h){for(const m of h)i(m);document.body.removeChild(u)}},u.oncancel=()=>{(!u.files||u.files.length===0)&&document.body.removeChild(u)},u.click()},e[2]=i,e[3]=a,e[4]=r,e[5]=c):c=e[5];const l=c;return o?null:l},l_=ce("ComposerPrimitive.AddAttachment",c_,["multiple"]),Qc=_.forwardRef((t,e)=>{const s=T(30),{disabled:n,asChild:r,render:o,children:i,...a}=t,c=r===void 0?!1:r,[l,u]=Z(!1),d=H();let f;s[0]!==n?(f=M=>{n||(M.preventDefault(),u(!0))},s[0]=n,s[1]=f):f=s[1];const h=f;let m;s[2]!==n||s[3]!==l?(m=M=>{n||(M.preventDefault(),l||u(!0))},s[2]=n,s[3]=l,s[4]=m):m=s[4];const p=m;let g;s[5]!==n?(g=M=>{if(n)return;M.preventDefault();const B=M.relatedTarget;B&&M.currentTarget.contains(B)||u(!1)},s[5]=n,s[6]=g):g=s[6];const y=g;let C;s[7]!==d||s[8]!==n?(C=async M=>{if(n)return;M.preventDefault(),u(!1);const B=Array.from(M.dataTransfer.files);await Promise.all(B.map(async U=>{try{await d.composer().addAttachment(U)}catch(V){console.error("Failed to add attachment:",V)}}))},s[7]=d,s[8]=n,s[9]=C):C=s[9];const S=C;let b;s[10]!==l?(b=l?{"data-dragging":"true"}:null,s[10]=l,s[11]=b):b=s[11];const x=K(a.onDragEnterCapture,h),E=K(a.onDragOverCapture,p),I=K(a.onDragLeaveCapture,y),R=K(a.onDropCapture,S);let P;s[12]!==e||s[13]!==a||s[14]!==R||s[15]!==b||s[16]!==x||s[17]!==E||s[18]!==I?(P={...b,...a,onDragEnterCapture:x,onDragOverCapture:E,onDragLeaveCapture:I,onDropCapture:R,ref:e},s[12]=e,s[13]=a,s[14]=R,s[15]=b,s[16]=x,s[17]=E,s[18]=I,s[19]=P):P=s[19];const O=P;if(o&&_.isValidElement(o)){const M=i!==void 0?i:o.props.children;let B;s[20]!==o||s[21]!==M?(B=_.cloneElement(o,void 0,M),s[20]=o,s[21]=M,s[22]=B):B=s[22];let U;return s[23]!==O||s[24]!==B?(U=v.jsx(ps,{...O,children:B}),s[23]=O,s[24]=B,s[25]=U):U=s[25],U}const k=c?ps:"div";let $;return s[26]!==k||s[27]!==i||s[28]!==O?($=v.jsx(k,{...O,children:i}),s[26]=k,s[27]=i,s[28]=O,s[29]=$):$=s[29],$});Qc.displayName="ComposerPrimitive.AttachmentDropzone";const u_=()=>{const{disabled:t,startDictation:e}=ap();return t?null:e},d_=ce("ComposerPrimitive.Dictate",u_),f_=()=>{const t=T(2),e=H(),s=D(m_);let n;t[0]!==e?(n=()=>{e.composer().stopDictation()},t[0]=e,t[1]=n):n=t[1];const r=n;return s?r:null},h_=ce("ComposerPrimitive.StopDictation",f_);function m_(t){return t.composer.dictation!=null}const Jc=_.forwardRef((t,e)=>{const s=T(7);let n,r;s[0]!==t?({children:n,...r}=t,s[0]=t,s[1]=n,s[2]=r):(n=s[1],r=s[2]);const o=D(p_);if(!o)return null;const i=n??o;let a;return s[3]!==e||s[4]!==r||s[5]!==i?(a=v.jsx(J.span,{...r,ref:e,children:i}),s[3]=e,s[4]=r,s[5]=i,s[6]=a):a=s[6],a});Jc.displayName="ComposerPrimitive.DictationTranscript";function p_(t){return t.composer.dictation?.transcript}const Xc=_.forwardRef((t,e)=>{const s=T(3);if(!D(g_))return null;let n;return s[0]!==e||s[1]!==t?(n=v.jsx(J.div,{...t,ref:e}),s[0]=e,s[1]=t,s[2]=n):n=s[2],n});Xc.displayName="ComposerPrimitive.Quote";const Zc=_.forwardRef((t,e)=>{const s=T(7);let n,r;s[0]!==t?({children:n,...r}=t,s[0]=t,s[1]=n,s[2]=r):(n=s[1],r=s[2]);const o=D(v_);if(!o)return null;const i=n??o;let a;return s[3]!==e||s[4]!==r||s[5]!==i?(a=v.jsx(J.span,{...r,ref:e,children:i}),s[3]=e,s[4]=r,s[5]=i,s[6]=a):a=s[6],a});Zc.displayName="ComposerPrimitive.QuoteText";const el=_.forwardRef((t,e)=>{const s=T(12);let n,r;s[0]!==t?({onClick:n,...r}=t,s[0]=t,s[1]=n,s[2]=r):(n=s[1],r=s[2]);const o=H();let i;s[3]!==o?(i=()=>{o.composer().setQuote(void 0)},s[3]=o,s[4]=i):i=s[4];const a=i;let c;s[5]!==a||s[6]!==n?(c=K(n,a),s[5]=a,s[6]=n,s[7]=c):c=s[7];let l;return s[8]!==e||s[9]!==r||s[10]!==c?(l=v.jsx(J.button,{type:"button",...r,ref:e,onClick:c}),s[8]=e,s[9]=r,s[10]=c,s[11]=l):l=s[11],l});el.displayName="ComposerPrimitive.QuoteDismiss";function g_(t){return t.composer.quote}function v_(t){return t.composer.quote?.text}const tl=_.forwardRef((t,e)=>{const s=T(12);let n,r,o;s[0]!==t?({children:r,"aria-label":n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const{categories:i,activeCategoryId:a,isSearchMode:c,open:l}=Ct();if(!l||a||c)return null;const u=n??"Categories";let d;s[4]!==i||s[5]!==r?(d=r(i),s[4]=i,s[5]=r,s[6]=d):d=s[6];let f;return s[7]!==e||s[8]!==o||s[9]!==u||s[10]!==d?(f=v.jsx(J.div,{role:"group","aria-label":u,...o,ref:e,children:d}),s[7]=e,s[8]=o,s[9]=u,s[10]=d,s[11]=f):f=s[11],f});tl.displayName="ComposerPrimitive.TriggerPopoverCategories";const sl=_.forwardRef((t,e)=>{const s=T(30);let n,r,o,i;s[0]!==t?({categoryId:n,onClick:r,onMouseMove:o,...i}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o,s[4]=i):(n=s[1],r=s[2],o=s[3],i=s[4]);const{selectCategory:a,highlightIndex:c,categories:l,highlightedIndex:u,activeCategoryId:d,isSearchMode:f,popoverId:h}=Ct();let m;s[5]!==n||s[6]!==a?(m=()=>{a(n)},s[5]=n,s[6]=a,s[7]=m):m=s[7];const p=m;let g;if(s[8]!==l||s[9]!==n){let O;s[11]!==n?(O=k=>k.id===n,s[11]=n,s[12]=O):O=s[12],g=l.findIndex(O),s[8]=l,s[9]=n,s[10]=g}else g=s[10];const y=g,C=!d&&!f&&y===u;let S;s[13]!==y||s[14]!==c?(S=()=>{c(y)},s[13]=y,s[14]=c,s[15]=S):S=s[15];const b=S,x=`${h}-option-${n}`,E=C?"":void 0;let I;s[16]!==p||s[17]!==r?(I=K(r,p),s[16]=p,s[17]=r,s[18]=I):I=s[18];let R;s[19]!==b||s[20]!==o?(R=K(o,b),s[19]=b,s[20]=o,s[21]=R):R=s[21];let P;return s[22]!==e||s[23]!==C||s[24]!==i||s[25]!==x||s[26]!==E||s[27]!==I||s[28]!==R?(P=v.jsx(J.button,{type:"button",role:"option",id:x,"aria-selected":C,"data-highlighted":E,...i,ref:e,onClick:I,onMouseMove:R}),s[22]=e,s[23]=C,s[24]=i,s[25]=x,s[26]=E,s[27]=I,s[28]=R,s[29]=P):P=s[29],P});sl.displayName="ComposerPrimitive.TriggerPopoverCategoryItem";const nl=_.forwardRef((t,e)=>{const s=T(12);let n,r,o;s[0]!==t?({children:r,"aria-label":n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const{items:i,activeCategoryId:a,isSearchMode:c,open:l}=Ct();if(!l||!a&&!c)return null;const u=n??"Items";let d;s[4]!==r||s[5]!==i?(d=r(i),s[4]=r,s[5]=i,s[6]=d):d=s[6];let f;return s[7]!==e||s[8]!==o||s[9]!==u||s[10]!==d?(f=v.jsx(J.div,{role:"group","aria-label":u,...o,ref:e,children:d}),s[7]=e,s[8]=o,s[9]=u,s[10]=d,s[11]=f):f=s[11],f});nl.displayName="ComposerPrimitive.TriggerPopoverItems";const rl=_.forwardRef((t,e)=>{const s=T(30);let n,r,o,i,a;s[0]!==t?({item:r,index:n,onClick:o,onMouseMove:i,...a}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o,s[4]=i,s[5]=a):(n=s[1],r=s[2],o=s[3],i=s[4],a=s[5]);const{selectItem:c,highlightIndex:l,items:u,highlightedIndex:d,activeCategoryId:f,isSearchMode:h,popoverId:m}=Ct();let p;s[6]!==r||s[7]!==c?(p=()=>{c(r)},s[6]=r,s[7]=c,s[8]=p):p=s[8];const g=p;let y;s[9]!==n||s[10]!==r.id||s[11]!==u?(y=n??u.findIndex(k=>k.id===r.id),s[9]=n,s[10]=r.id,s[11]=u,s[12]=y):y=s[12];const C=y,S=(h||f!==null)&&C===d;let b;s[13]!==l||s[14]!==C?(b=()=>{l(C)},s[13]=l,s[14]=C,s[15]=b):b=s[15];const x=b,E=`${m}-option-${r.id}`,I=S?"":void 0;let R;s[16]!==g||s[17]!==o?(R=K(o,g),s[16]=g,s[17]=o,s[18]=R):R=s[18];let P;s[19]!==x||s[20]!==i?(P=K(i,x),s[19]=x,s[20]=i,s[21]=P):P=s[21];let O;return s[22]!==e||s[23]!==S||s[24]!==a||s[25]!==E||s[26]!==I||s[27]!==R||s[28]!==P?(O=v.jsx(J.button,{type:"button",role:"option",id:E,"aria-selected":S,"data-highlighted":I,...a,ref:e,onClick:R,onMouseMove:P}),s[22]=e,s[23]=S,s[24]=a,s[25]=E,s[26]=I,s[27]=R,s[28]=P,s[29]=O):O=s[29],O});rl.displayName="ComposerPrimitive.TriggerPopoverItem";const ol=_.forwardRef((t,e)=>{const s=T(10);let n,r;s[0]!==t?({onClick:n,...r}=t,s[0]=t,s[1]=n,s[2]=r):(n=s[1],r=s[2]);const{activeCategoryId:o,isSearchMode:i,goBack:a,open:c}=Ct();if(!c||!o||i)return null;let l;s[3]!==a||s[4]!==n?(l=K(n,a),s[3]=a,s[4]=n,s[5]=l):l=s[5];let u;return s[6]!==e||s[7]!==r||s[8]!==l?(u=v.jsx(J.button,{type:"button",...r,ref:e,onClick:l}),s[6]=e,s[7]=r,s[8]=l,s[9]=u):u=s[9],u});ol.displayName="ComposerPrimitive.TriggerPopoverBack";const il=({formatter:t,onExecute:e,removeOnExecute:s})=>{const{register:n}=Fc(),r=W(e);return r.current=e,q(()=>{const o={kind:"action",formatter:t??Va,onExecute:i=>r.current(i),...s!==void 0?{removeOnExecute:s}:{}};return n(o)},[n,t,s]),null};il.displayName="ComposerPrimitive.TriggerPopoverAction";const al=({formatter:t,onInserted:e})=>{const{register:s}=Fc(),n=W(e);return n.current=e,q(()=>s({kind:"directive",formatter:t??Va,onInserted:r=>n.current?.(r)}),[s,t]),null};al.displayName="ComposerPrimitive.TriggerPopoverDirective";const b_=Object.assign(Uc,{Directive:al,Action:il});var uS=Oe({AddAttachment:()=>l_,AttachmentByIndex:()=>Ma,AttachmentDropzone:()=>Qc,Attachments:()=>Da,Cancel:()=>a_,Dictate:()=>d_,DictationTranscript:()=>Jc,If:()=>Fa,Input:()=>Yc,Queue:()=>ka,Quote:()=>Xc,QuoteDismiss:()=>el,QuoteText:()=>Zc,Root:()=>qc,Send:()=>Oy,StopDictation:()=>h_,Unstable_TriggerPopover:()=>b_,Unstable_TriggerPopoverBack:()=>ol,Unstable_TriggerPopoverCategories:()=>tl,Unstable_TriggerPopoverCategoryItem:()=>sl,Unstable_TriggerPopoverItem:()=>rl,Unstable_TriggerPopoverItems:()=>nl,Unstable_TriggerPopoverRoot:()=>jc,unstable_useTriggerPopoverRootContext:()=>ur,unstable_useTriggerPopoverRootContextOptional:()=>dr,unstable_useTriggerPopoverScopeContext:()=>Ct,unstable_useTriggerPopoverScopeContextOptional:()=>Dy,unstable_useTriggerPopoverTriggers:()=>py,unstable_useTriggerPopoverTriggersOptional:()=>vy});const y_=()=>D(__);function __(t){if(t.part.type!=="text"&&t.part.type!=="reasoning")throw new Error("MessagePartText can only be used inside text or reasoning message parts.");return t.part}const cl=ue(null),S_=t=>({useSmoothStatus:Fi(()=>t)}),x_=t=>{const e=T(6),{children:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={optional:!0},e[0]=n):n=e[0];const r=ll(n),o=H();let i;e[1]!==o?(i=()=>S_(o.part().getState().status),e[1]=o,e[2]=i):i=e[2];const[a]=Z(i);if(r)return s;let c;return e[3]!==s||e[4]!==a?(c=v.jsx(cl.Provider,{value:a,children:s}),e[3]=s,e[4]=a,e[5]=c):c=e[5],c},w_=t=>{const e=_.forwardRef((s,n)=>{const r=T(3),o=s;let i;return r[0]!==n||r[1]!==o?(i=v.jsx(x_,{children:v.jsx(t,{...o,ref:n})}),r[0]=n,r[1]=o,r[2]=i):i=r[2],i});return e.displayName=t.displayName,e};function ll(t){const e=he(cl);if(!t?.optional&&!e)throw new Error("This component must be used within a SmoothContextProvider.");return e}const{useSmoothStatus:C_,useSmoothStatusStore:T_}=Ha(ll,"useSmoothStatus"),ul=250,dl=5;var E_=class{currentText;setText;animationFrameId=null;lastUpdateTime=Date.now();lastCommitTime=0;targetText="";drainMs=ul;maxCharIntervalMs=dl;maxCharsPerFrame=1/0;minCommitMs=0;constructor(t,e){this.currentText=t,this.setText=e}start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}animate=()=>{const t=Date.now();let e=t-this.lastUpdateTime;const s=this.targetText.length-this.currentText.length,n=Math.min(this.maxCharIntervalMs,this.drainMs/s),r=Math.min(s,this.maxCharsPerFrame);let o=0;for(;e>=n&&o<r;)o++,e-=n;o===r&&r===this.maxCharsPerFrame&&(e=0),o!==s?this.animationFrameId=requestAnimationFrame(this.animate):this.animationFrameId=null,o!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+o),this.lastUpdateTime=t-e,(o===s||t-this.lastCommitTime>=this.minCommitMs)&&(this.lastCommitTime=t,this.setText(this.currentText)))}};const on=Object.freeze({type:"running"}),Xt=(t,e)=>t!==void 0&&t>0?t:e,fl=(t,e=!1)=>{const{text:s}=t,n=Wc("(prefers-reduced-motion: reduce)"),r=typeof e=="object"&&e!==null?e:void 0,o=e!==!1&&e!==null&&!n,i=Xt(r?.drainMs,ul),a=Xt(r?.maxCharIntervalMs,dl),c=Xt(r?.maxCharsPerFrame,1/0),l=Xt(r?.minCommitMs,0),[u,d]=Z(t.status.type==="running"?"":s),f=H(),h=D(()=>f.part()),[m,p]=Z(h);(h!==m||!s.startsWith(u))&&(p(h),d(t.status.type==="running"?"":s));const g=T_({optional:!0}),y=ke(b=>{if(d(b),g){const x=u!==b||t.status.type==="running"?on:t.status;ms(g).setState(x,!0)}});q(()=>{if(g){const b=o&&(u!==s||t.status.type==="running")?on:t.status;ms(g).setState(b,!0)}},[g,o,s,u,t.status]);const[C]=Z(new E_(u,y));q(()=>{C.drainMs=i,C.maxCharIntervalMs=a,C.maxCharsPerFrame=c,C.minCommitMs=l},[C,i,a,c,l]);const S=W(h);return q(()=>{if(!o){C.stop();return}const b=S.current!==h;if(S.current=h,b||!s.startsWith(C.targetText)){t.status.type==="running"?(C.currentText="",C.targetText=s,C.lastCommitTime=0,C.start()):(C.currentText=s,C.targetText=s,C.stop());return}C.targetText=s,C.start()},[C,o,s,t.status.type,h]),q(()=>()=>{C.stop()},[C]),te(()=>o?{...t,text:u,status:s===u?t.status:on}:t,[o,u,t,s])},I_=()=>D(R_);function R_(t){if(t.part.type!=="image")throw new Error("MessagePartImage can only be used inside image message parts.");return t.part}const mr=_.forwardRef((t,e)=>{const s=T(10);let n,r,o;s[0]!==t?({smooth:r,component:o,...n}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const i=r===void 0?!0:r,a=o===void 0?"span":o,{text:c,status:l}=fl(y_(),i);let u;return s[4]!==a||s[5]!==e||s[6]!==n||s[7]!==l.type||s[8]!==c?(u=v.jsx(a,{"data-status":l.type,...n,ref:e,children:c}),s[4]=a,s[5]=e,s[6]=n,s[7]=l.type,s[8]=c,s[9]=u):u=s[9],u});mr.displayName="MessagePartPrimitive.Text";const pr=_.forwardRef((t,e)=>{const s=T(4),{image:n}=I_();let r;return s[0]!==e||s[1]!==n||s[2]!==t?(r=v.jsx(J.img,{src:n,...t,ref:e}),s[0]=e,s[1]=n,s[2]=t,s[3]=r):r=s[3],r});pr.displayName="MessagePartPrimitive.Image";const ot=t=>{const e=T(2),s=W(void 0);let n;return e[0]!==t?(n=r=>{s.current&&(s.current(),s.current=void 0),r&&(s.current=t(r))},e[0]=t,e[1]=n):n=e[1],n},Wo=(t,e)=>{const s=t.trim().match(/^(\d+(?:\.\d+)?|\.\d+)(em|px|rem)$/);if(!s)return Number.POSITIVE_INFINITY;const n=Number(s[1]),r=s[2];return r==="px"?n:r==="em"?n*(parseFloat(getComputedStyle(e).fontSize)||16):r==="rem"?n*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):Number.POSITIVE_INFINITY},A_=t=>t.dataset.messageId,P_=()=>{const t=document.createElement("div");return t.dataset.auiTopAnchorReserve="",t.style.height="0px",t.style.flexShrink="0",t.style.pointerEvents="none",t.setAttribute("aria-hidden","true"),t},Go=(t,e)=>{const s=`${e}px`;return t.style.height!==s?(t.style.height=s,!0):!1},M_=t=>{const e=window.devicePixelRatio||1;return Math.round(t*e)/e},hl=()=>{const t=T(4),e=H();let s;t[0]!==e?(s=()=>e.message(),t[0]=e,t[1]=s):s=t[1];const n=D(s);let r;return t[2]!==n?(r=o=>{const i=()=>{n.setIsHovering(!0)},a=()=>{n.setIsHovering(!1)};return o.addEventListener("mouseenter",i),o.addEventListener("mouseleave",a),o.matches(":hover")&&queueMicrotask(()=>n.setIsHovering(!0)),()=>{o.removeEventListener("mouseenter",i),o.removeEventListener("mouseleave",a),n.setIsHovering(!1)}},t[2]=n,t[3]=r):r=t[3],ot(r)},D_=()=>{const t=T(2),e=nt(j_);let s;return t[0]!==e?(s=n=>n.message.role==="user"&&n.message.index>0&&n.message.index===n.thread.messages.length-2&&n.thread.messages.at(-1)?.role==="assistant"&&(n.message.id===e||n.thread.isRunning),t[0]=e,t[1]=s):s=t[1],D(s)},k_=()=>{const t=T(2),e=nt(B_);let s;return t[0]!==e?(s=n=>n.message.isLast&&n.message.role==="assistant"&&n.message.index>=1&&n.thread.messages.at(n.message.index-1)?.role==="user"&&(n.message.id===e||n.thread.isRunning),t[0]=e,t[1]=s):s=t[1],D(s)},O_=(t,e)=>{const s=T(3);let n;return s[0]!==t||s[1]!==e?(n=r=>{if(t)return e.getState().registerAnchorElement(r)},s[0]=t,s[1]=e,s[2]=n):n=s[2],ot(n)},$_=t=>{const e=T(3),{active:s,threadViewportStore:n}=t;let r;return e[0]!==s||e[1]!==n?(r=o=>{if(!s)return;const i=n.getState(),a=i.topAnchorMessageClamp;return i.registerAnchorTargetElement(o,{tallerThan:Wo(a.tallerThan,o),visibleHeight:Wo(a.visibleHeight,o)})},e[0]=s,e[1]=n,e[2]=r):r=e[2],ot(r)},L_=t=>{const e=T(7);let s,n;e[0]!==t?({forwardedRef:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);const r=hl(),o=ae(s,r),i=D(F_);let a;return e[3]!==i||e[4]!==n||e[5]!==o?(a=v.jsx(J.div,{...n,ref:o,"data-message-id":i}),e[3]=i,e[4]=n,e[5]=o,e[6]=a):a=e[6],a},N_=t=>{const e=T(13);let s,n,r;e[0]!==t?({forwardedRef:s,threadViewportStore:r,...n}=t,e[0]=t,e[1]=s,e[2]=n,e[3]=r):(s=e[1],n=e[2],r=e[3]);const o=hl(),i=D_(),a=k_(),c=O_(i,r);let l;e[4]!==a||e[5]!==r?(l={active:a,threadViewportStore:r},e[4]=a,e[5]=r,e[6]=l):l=e[6];const u=$_(l),d=ae(s,o,c,u),f=D(U_),h=i?"":void 0,m=a?"":void 0;let p;return e[7]!==f||e[8]!==n||e[9]!==d||e[10]!==h||e[11]!==m?(p=v.jsx(J.div,{...n,ref:d,"data-message-id":f,"data-aui-top-anchor-user":h,"data-aui-top-anchor-target":m}),e[7]=f,e[8]=n,e[9]=d,e[10]=h,e[11]=m,e[12]=p):p=e[12],p},ml=_.forwardRef((t,e)=>{const s=T(7),n=rt();if(n.getState().turnAnchor==="top"){let o;return s[0]!==e||s[1]!==t||s[2]!==n?(o=v.jsx(N_,{...t,forwardedRef:e,threadViewportStore:n}),s[0]=e,s[1]=t,s[2]=n,s[3]=o):o=s[3],o}let r;return s[4]!==e||s[5]!==t?(r=v.jsx(L_,{...t,forwardedRef:e}),s[4]=e,s[5]=t,s[6]=r):r=s[6],r});ml.displayName="MessagePrimitive.Root";function j_(t){return t.topAnchorTurn?.anchorId}function B_(t){return t.topAnchorTurn?.targetId}function F_(t){return t.message.id}function U_(t){return t.message.id}const an={...oe,Text:()=>v.jsxs("p",{style:{whiteSpace:"pre-line"},children:[v.jsx(mr,{}),v.jsx(er,{children:v.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Image:()=>v.jsx(pr,{})},En=t=>{const e=T(10);if("children"in t){let a;return e[0]!==t.children?(a=v.jsx(_n,{children:t.children}),e[0]=t.children,e[1]=a):a=e[1],a}let s,n;e[2]!==t?({components:s,...n}=t,e[2]=t,e[3]=s,e[4]=n):(s=e[3],n=e[4]);let r;e[5]!==s?(r=s?{Text:s.Text??an.Text,Image:s.Image??an.Image,Reasoning:s.Reasoning??oe.Reasoning,Source:s.Source??oe.Source,File:s.File??oe.File,Unstable_Audio:s.Unstable_Audio??oe.Unstable_Audio,..."ChainOfThought"in s?{ChainOfThought:s.ChainOfThought}:{tools:s.tools,data:s.data,ToolGroup:s.ToolGroup??oe.ToolGroup,ReasoningGroup:s.ReasoningGroup??oe.ReasoningGroup},Empty:s.Empty,Quote:s.Quote,generativeUI:s.generativeUI}:an,e[5]=s,e[6]=r):r=e[6];const o=r;let i;return e[7]!==n||e[8]!==o?(i=v.jsx(_n,{components:o,...n}),e[7]=n,e[8]=o,e[9]=i):i=e[9],i};En.displayName="MessagePrimitive.Parts";const pl=t=>{const{children:e}=t;return Up()!==void 0?e:null};pl.displayName="MessagePrimitive.Error";const V_=t=>{const e=new Map;for(let n=0;n<t.length;n++){const r=t[n]?.parentId??`__ungrouped_${n}`,o=e.get(r)??[];o.push(n),e.set(r,o)}const s=[];for(const[n,r]of e){const o=n.startsWith("__ungrouped_")?void 0:n;s.push({groupKey:o,indices:r})}return s},H_=t=>{const e=T(4),s=D(Z_);let n;e:{if(s.length===0){let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0],n=o;break e}let r;e[1]!==t||e[2]!==s?(r=t(s),e[1]=t,e[2]=s,e[3]=r):r=e[3],n=r}return n},q_=t=>{const e=T(9);let s,n;e[0]!==t?({Fallback:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let r;e[3]!==s||e[4]!==n.toolName?(r=a=>{const c=a.tools.tools[n.toolName]??s;return Array.isArray(c)?c[0]??s:c},e[3]=s,e[4]=n.toolName,e[5]=r):r=e[5];const o=D(r);if(!o)return null;let i;return e[6]!==o||e[7]!==n?(i=v.jsx(o,{...n}),e[6]=o,e[7]=n,e[8]=i):i=e[8],i},z_=t=>{const e=T(9);let s,n;e[0]!==t?({Fallback:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let r;e[3]!==s||e[4]!==n.name?(r=a=>{const c=a.dataRenderers.renderers[n.name]??s;return Array.isArray(c)?c[0]??s:c},e[3]=s,e[4]=n.name,e[5]=r):r=e[5];const o=D(r);if(!o)return null;let i;return e[6]!==o||e[7]!==n?(i=v.jsx(o,{...n}),e[6]=o,e[7]=n,e[8]=i):i=e[8],i},je={Text:()=>v.jsxs("p",{style:{whiteSpace:"pre-line"},children:[v.jsx(mr,{}),v.jsx(er,{children:v.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>v.jsx(pr,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:t})=>t},W_=t=>{const e=T(43),{components:s}=t;let n;e[0]!==s?(n=s===void 0?{}:s,e[0]=s,e[1]=n):n=e[1];const{Text:r,Reasoning:o,Image:i,Source:a,File:c,Unstable_Audio:l,tools:u,data:d}=n,f=r===void 0?je.Text:r,h=o===void 0?je.Reasoning:o,m=i===void 0?je.Image:i,p=a===void 0?je.Source:a,g=c===void 0?je.File:c,y=l===void 0?je.Unstable_Audio:l;let C;e[2]!==u?(C=u===void 0?{}:u,e[2]=u,e[3]=C):C=e[3];const S=C,b=H(),x=D(e1),E=x.type;if(E==="tool-call"){let I;e[4]!==b?(I=b.part(),e[4]=b,e[5]=I):I=e[5];const R=I.addToolResult;let P;e[6]!==b?(P=b.part(),e[6]=b,e[7]=P):P=e[7];const O=P.resumeToolCall;let k;e[8]!==b?(k=b.part(),e[8]=b,e[9]=k):k=e[9];const $=k.respondToToolApproval;if("Override"in S){let U;return e[10]!==R||e[11]!==x||e[12]!==$||e[13]!==O||e[14]!==S.Override?(U=v.jsx(S.Override,{...x,addResult:R,resume:O,respondToApproval:$}),e[10]=R,e[11]=x,e[12]=$,e[13]=O,e[14]=S.Override,e[15]=U):U=e[15],U}const M=S.by_name?.[x.toolName]??S.Fallback;let B;return e[16]!==M||e[17]!==R||e[18]!==x||e[19]!==$||e[20]!==O?(B=v.jsx(q_,{...x,Fallback:M,addResult:R,resume:O,respondToApproval:$}),e[16]=M,e[17]=R,e[18]=x,e[19]=$,e[20]=O,e[21]=B):B=e[21],B}if(x.status?.type==="requires-action")throw new Error("Encountered unexpected requires-action status");switch(E){case"text":{let I;return e[22]!==f||e[23]!==x?(I=v.jsx(f,{...x}),e[22]=f,e[23]=x,e[24]=I):I=e[24],I}case"reasoning":{let I;return e[25]!==h||e[26]!==x?(I=v.jsx(h,{...x}),e[25]=h,e[26]=x,e[27]=I):I=e[27],I}case"source":{let I;return e[28]!==p||e[29]!==x?(I=v.jsx(p,{...x}),e[28]=p,e[29]=x,e[30]=I):I=e[30],I}case"image":{let I;return e[31]!==m||e[32]!==x?(I=v.jsx(m,{...x}),e[31]=m,e[32]=x,e[33]=I):I=e[33],I}case"file":{let I;return e[34]!==g||e[35]!==x?(I=v.jsx(g,{...x}),e[34]=g,e[35]=x,e[36]=I):I=e[36],I}case"audio":{let I;return e[37]!==y||e[38]!==x?(I=v.jsx(y,{...x}),e[37]=y,e[38]=x,e[39]=I):I=e[39],I}case"data":{const I=d?.by_name?.[x.name]??d?.Fallback;let R;return e[40]!==I||e[41]!==x?(R=v.jsx(z_,{...x,Fallback:I}),e[40]=I,e[41]=x,e[42]=R):R=e[42],R}default:return console.warn(`Unknown message part type: ${E}`),null}},G_=t=>{const e=T(5),{partIndex:s,components:n}=t;let r;e[0]!==n?(r=v.jsx(W_,{components:n}),e[0]=n,e[1]=r):r=e[1];let o;return e[2]!==s||e[3]!==r?(o=v.jsx(zn,{index:s,children:r}),e[2]=s,e[3]=r,e[4]=o):o=e[4],o},K_=_.memo(G_,(t,e)=>t.partIndex===e.partIndex&&t.components?.Text===e.components?.Text&&t.components?.Reasoning===e.components?.Reasoning&&t.components?.Source===e.components?.Source&&t.components?.Image===e.components?.Image&&t.components?.File===e.components?.File&&t.components?.Unstable_Audio===e.components?.Unstable_Audio&&t.components?.tools===e.components?.tools&&t.components?.data===e.components?.data&&t.components?.Group===e.components?.Group),Y_=t=>{const e=T(6),{status:s,component:n}=t,r=s.type==="running";let o;e[0]!==n||e[1]!==s?(o=v.jsx(n,{type:"text",text:"",status:s}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let i;return e[3]!==r||e[4]!==o?(i=v.jsx(Wn,{text:"",isRunning:r,children:o}),e[3]=r,e[4]=o,e[5]=i):i=e[5],i},Q_=Object.freeze({type:"complete"}),J_=t=>{const e=T(6),{components:s}=t,n=D(t1);if(s?.Empty){let i;return e[0]!==s.Empty||e[1]!==n?(i=v.jsx(s.Empty,{status:n}),e[0]=s.Empty,e[1]=n,e[2]=i):i=e[2],i}const r=s?.Text??je.Text;let o;return e[3]!==n||e[4]!==r?(o=v.jsx(Y_,{status:n,component:r}),e[3]=n,e[4]=r,e[5]=o):o=e[5],o},X_=_.memo(J_,(t,e)=>t.components?.Empty===e.components?.Empty&&t.components?.Text===e.components?.Text),gr=t=>{const e=T(9),{groupingFunction:s,components:n}=t,r=D(s1),o=H_(s);let i;e:{if(r===0){let u;e[0]!==n?(u=v.jsx(X_,{components:n}),e[0]=n,e[1]=u):u=e[1],i=u;break e}let l;if(e[2]!==n||e[3]!==o){let u;e[5]!==n?(u=(d,f)=>v.jsx(n?.Group??je.Group,{groupKey:d.groupKey,indices:d.indices,children:d.indices.map(h=>v.jsx(K_,{partIndex:h,components:n},h))},`group-${f}-${d.groupKey??"ungrouped"}`),e[5]=n,e[6]=u):u=e[6],l=o.map(u),e[2]=n,e[3]=o,e[4]=l}else l=e[4];i=l}const a=i;let c;return e[7]!==a?(c=v.jsx(v.Fragment,{children:a}),e[7]=a,e[8]=c):c=e[8],c};gr.displayName="MessagePrimitive.Unstable_PartsGrouped";const gl=t=>{const e=T(6);let s,n;e[0]!==t?({components:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let r;return e[3]!==s||e[4]!==n?(r=v.jsx(gr,{...n,components:s,groupingFunction:V_}),e[3]=s,e[4]=n,e[5]=r):r=e[5],r};gl.displayName="MessagePrimitive.Unstable_PartsGroupedByParentId";function Z_(t){return t.message.parts}function e1(t){return t.part}function t1(t){return t.message.status??Q_}function s1(t){return t.message.parts.length}var dS=Oe({AttachmentByIndex:()=>Ra,Attachments:()=>Aa,Content:()=>En,Error:()=>pl,GenerativeUI:()=>pa,GroupedParts:()=>Ta,If:()=>Oc,PartByIndex:()=>At,Parts:()=>En,Quote:()=>Ea,Root:()=>ml,Unstable_PartsGrouped:()=>gr,Unstable_PartsGroupedByParentId:()=>gl});const n1=t=>{const e=T(2),s=ke(t);let n;return e[0]!==s?(n=r=>{const o=new ResizeObserver(()=>{s()}),i=new MutationObserver(a=>{a.some(r1)&&s()});return o.observe(r),i.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{o.disconnect(),i.disconnect()}},e[0]=s,e[1]=n):n=e[1],ot(n)};function r1(t){return t.type!=="attributes"||t.attributeName!=="style"}const o1=({autoScroll:t,scrollToBottomOnRunStart:e=!0,scrollToBottomOnInitialize:s=!0,scrollToBottomOnThreadSwitch:n=!0})=>{const r=W(null),o=D(b=>b.thread.messages.length>0),i=W(!1),a=W(null),c=rt();t===void 0&&(t=c.getState().turnAnchor!=="top");const l=W(0),u=W(0),d=W(0),f=W(0),h=W(null),m=Ke(b=>{const x=r.current;x&&(h.current=b,x.scrollTo({top:x.scrollHeight,behavior:b}))},[]),p=Ke(b=>{h.current=b,a.current!==null&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{a.current=null,m(b)})},[m]);is(()=>()=>{a.current!==null&&cancelAnimationFrame(a.current)},[]);const g=Ke(()=>{const b=c.getState();return b.turnAnchor==="top"&&b.element.viewport===r.current&&b.element.anchor!==null},[c]),y=()=>{const b=r.current;if(!b)return;const x=c.getState().isAtBottom,E=Math.abs(b.scrollHeight-b.scrollTop-b.clientHeight)<=1||b.scrollHeight<=b.clientHeight;!E&&l.current<b.scrollTop||(E?b.scrollHeight>b.clientHeight+1&&(h.current=null):l.current>b.scrollTop&&u.current===b.scrollHeight&&(h.current=null),(E||h.current===null)&&E!==x&&ms(c).setState({isAtBottom:E})),l.current=b.scrollTop,u.current=b.scrollHeight},C=n1(()=>{const b=r.current;if(!b)return;const{scrollHeight:x,clientHeight:E}=b;if(x===d.current&&E===f.current)return;d.current=x,f.current=E;const I=h.current;I&&g()?h.current=null:I?m(I):t&&c.getState().isAtBottom&&m("instant"),y()}),S=ot(b=>{const x=()=>{h.current=null};return b.addEventListener("scroll",y),b.addEventListener("pointerdown",x),()=>{b.removeEventListener("scroll",y),b.removeEventListener("pointerdown",x)}});return is(()=>{if(s){if(!o){i.current=!1;return}i.current||(i.current=!0,h.current===null&&p("instant"))}},[o,p,s]),zc(({behavior:b})=>{m(b)}),cs("thread.runStart",()=>{e&&c.getState().turnAnchor!=="top"&&p("auto")}),cs("threadListItem.switchedTo",()=>{n&&p("instant")}),ae(C,S,r)},vl=_.forwardRef((t,e)=>{const s=T(3);let n;return s[0]!==t||s[1]!==e?(n=v.jsx(J.div,{...t,ref:e}),s[0]=t,s[1]=e,s[2]=n):n=s[2],n});vl.displayName="ThreadPrimitive.Root";const bl=t=>{const{children:e}=t;return D(i1)?e:null};bl.displayName="ThreadPrimitive.Empty";function i1(t){return t.thread.isEmpty}const a1=t=>{const e=T(4);let s;return e[0]!==t.disabled||e[1]!==t.empty||e[2]!==t.running?(s=n=>!(t.empty===!0&&!n.thread.isEmpty||t.empty===!1&&n.thread.isEmpty||t.running===!0&&!n.thread.isRunning||t.running===!1&&n.thread.isRunning||t.disabled===!0&&!n.thread.isDisabled||t.disabled===!1&&n.thread.isDisabled),e[0]=t.disabled,e[1]=t.empty,e[2]=t.running,e[3]=s):s=e[3],D(s)},yl=t=>{const e=T(3);let s,n;return e[0]!==t?({children:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]),a1(n)?s:null};yl.displayName="ThreadPrimitive.If";const _l=(t,e)=>{const s=T(3);let n;return s[0]!==e||s[1]!==t?(n=r=>{if(!t)return;const o=t(),i=()=>{const c=e?e(r):r.offsetHeight;o.setHeight(c)},a=new ResizeObserver(i);return a.observe(r),i(),()=>{a.disconnect(),o.unregister()}},s[0]=e,s[1]=t,s[2]=n):n=s[2],ot(n)},Ko=t=>{let e=0,s=t;for(;s;)e+=s.offsetTop,s=s.offsetParent;return e},c1=(t,e)=>{let s=0,n=t;for(;n&&n!==e;)s+=n.offsetTop,n=n.offsetParent;return n===e?s:Ko(t)-Ko(e)},Sl=({viewport:t,anchor:e,tallerThan:s,visibleHeight:n})=>{const r=c1(e,t),o=e.offsetHeight;return r+Math.max(0,o-(o<=s?o:n))},l1=({scrollHeight:t,...e})=>{const{viewport:s}=e,n=Sl(e)+s.clientHeight;return Math.max(0,n-t)},u1=({viewport:t,reserve:e,...s})=>l1({viewport:t,...s,scrollHeight:t.scrollHeight-e.offsetHeight}),d1=t=>{const e=new ResizeObserver(t),s=new MutationObserver(t);let n=null,r=null,o=null;const i=()=>{e.disconnect(),s.disconnect(),n=null,r=null,o=null};return{target:(a,c,l)=>{n===a&&r===c&&o===l||(i(),e.observe(a),e.observe(c),e.observe(l),s.observe(l,{childList:!0,subtree:!0,characterData:!0}),n=a,r=c,o=l)},disconnect:i}},f1=t=>{let e=null;return{schedule:()=>{e===null&&(e=requestAnimationFrame(()=>{e=null,t()}))},cancel:()=>{e!==null&&(cancelAnimationFrame(e),e=null)}}},h1=t=>{let e=null,s;function n(){const a=t.getState(),{viewport:c,anchor:l,target:u}=a.element,d=a.targetConfig;if(a.turnAnchor!=="top"||!c||!l||!u||!d){o.disconnect(),e&&(Go(e,0),e.remove());return}if(e??=P_(),(e.parentElement!==u.parentElement||e.previousElementSibling!==u)&&u.after(e),o.target(c,l,u),Go(e,u1({viewport:c,anchor:l,reserve:e,...d}))){r.schedule();return}const f=A_(l);if(f!==void 0&&s===f)return;const h=M_(Sl({viewport:c,anchor:l,...d}));Math.abs(c.scrollTop-h)>1&&c.scrollTo({top:h,behavior:"smooth"}),f!==void 0&&(s=f)}const r=f1(n),o=d1(r.schedule);r.schedule();const i=t.subscribe(r.schedule);return()=>{r.cancel(),i(),o.disconnect(),e?.remove()}},m1=t=>{const e=T(4),s=rt();let n,r;e[0]!==t||e[1]!==s?(n=()=>{if(t)return h1(s)},r=[t,s],e[0]=t,e[1]=s,e[2]=n,e[3]=r):(n=e[2],r=e[3]),is(n,r)},xl=({isRunning:t,messages:e})=>{if(!t)return null;const s=e.at(-1),n=e.at(-2);return n?.role!=="user"||s?.role!=="assistant"?null:{anchorId:n.id,targetId:s.id}},p1=t=>xl(t)?.anchorId,g1=t=>xl(t)?.targetId,v1=()=>_l(nt(_1),S1),b1=()=>ot(nt(x1)),y1=t=>{const e=T(13),s=rt();let n;e[0]!==t?(n=h=>{if(t)return p1(h.thread)},e[0]=t,e[1]=n):n=e[1];const r=D(n);let o;e[2]!==t?(o=h=>{if(t)return g1(h.thread)},e[2]=t,e[3]=o):o=e[3];const i=D(o);let a;e:{if(!r||!i){a=null;break e}let h;e[4]!==r||e[5]!==i?(h={anchorId:r,targetId:i},e[4]=r,e[5]=i,e[6]=h):h=e[6],a=h}const c=a;let l,u;e[7]!==c||e[8]!==s?(l=()=>{if(!c)return;const h=s.getState(),m=h.topAnchorTurn;m?.anchorId===c.anchorId&&m.targetId===c.targetId||h.setTopAnchorTurn(c)},u=[c,s],e[7]=c,e[8]=s,e[9]=l,e[10]=u):(l=e[9],u=e[10]),is(l,u);let d;e[11]!==s?(d=()=>{s.getState().setTopAnchorTurn(null)},e[11]=s,e[12]=d):d=e[12];const f=d;cs("thread.initialize",f),cs("threadListItem.switchedTo",f)},wl=_.forwardRef((t,e)=>{const s=T(18);let n,r,o,i,a,c;s[0]!==t?({autoScroll:n,scrollToBottomOnRunStart:a,scrollToBottomOnInitialize:i,scrollToBottomOnThreadSwitch:c,children:r,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o,s[4]=i,s[5]=a,s[6]=c):(n=s[1],r=s[2],o=s[3],i=s[4],a=s[5],c=s[6]);let l;s[7]!==n||s[8]!==i||s[9]!==a||s[10]!==c?(l={autoScroll:n,scrollToBottomOnRunStart:a,scrollToBottomOnInitialize:i,scrollToBottomOnThreadSwitch:c},s[7]=n,s[8]=i,s[9]=a,s[10]=c,s[11]=l):l=s[11];const u=o1(l),d=v1(),f=b1(),h=rt();let m;s[12]!==h?(m=h.getState(),s[12]=h,s[13]=m):m=s[13];const p=m.turnAnchor==="top";y1(p),m1(p);const g=ae(e,u,d,f);let y;return s[14]!==r||s[15]!==g||s[16]!==o?(y=v.jsx(J.div,{...o,ref:g,children:r}),s[14]=r,s[15]=g,s[16]=o,s[17]=y):y=s[17],y});wl.displayName="ThreadPrimitive.ViewportScrollable";const Cl=_.forwardRef((t,e)=>{const s=T(13);let n,r,o;s[0]!==t?({turnAnchor:o,topAnchorMessageClamp:r,...n}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);let i;s[4]!==r||s[5]!==o?(i={turnAnchor:o,topAnchorMessageClamp:r},s[4]=r,s[5]=o,s[6]=i):i=s[6];let a;s[7]!==n||s[8]!==e?(a=v.jsx(wl,{...n,ref:e}),s[7]=n,s[8]=e,s[9]=a):a=s[9];let c;return s[10]!==i||s[11]!==a?(c=v.jsx(tr,{options:i,children:a}),s[10]=i,s[11]=a,s[12]=c):c=s[12],c});Cl.displayName="ThreadPrimitive.Viewport";function _1(t){return t.registerViewport}function S1(t){return t.clientHeight}function x1(t){return t.registerViewportElement}const Tl=_.forwardRef((t,e)=>{const s=T(3),n=ae(e,_l(nt(w1),C1));let r;return s[0]!==t||s[1]!==n?(r=v.jsx(J.div,{...t,ref:n}),s[0]=t,s[1]=n,s[2]=r):r=s[2],r});Tl.displayName="ThreadPrimitive.ViewportFooter";function w1(t){return t.registerContentInset}function C1(t){const e=parseFloat(getComputedStyle(t).marginTop)||0;return t.offsetHeight+e}const T1=t=>{const e=T(5);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{behavior:n}=s,r=nt(I1),o=rt();let i;e[2]!==n||e[3]!==o?(i=()=>{o.getState().scrollToBottom({behavior:n})},e[2]=n,e[3]=o,e[4]=i):i=e[4];const a=i;return r?null:a},E1=ce("ThreadPrimitive.ScrollToBottom",T1,["behavior"]);function I1(t){return t.isAtBottom}const R1=t=>{const e=T(4),{prompt:s,send:n,clearComposer:r,autoSend:o}=t,i=n??o??!1;let a;e[0]!==r||e[1]!==s||e[2]!==i?(a={prompt:s,send:i,clearComposer:r},e[0]=r,e[1]=s,e[2]=i,e[3]=a):a=e[3];const{disabled:c,trigger:l}=Dp(a);return c?null:l},A1=ce("ThreadPrimitive.Suggestion",R1,["prompt","send","clearComposer","autoSend","method"]);var fS=Oe({Empty:()=>bl,If:()=>yl,MessageByIndex:()=>ua,Messages:()=>rm,Root:()=>vl,ScrollToBottom:()=>E1,Suggestion:()=>A1,SuggestionByIndex:()=>ja,Suggestions:()=>sp,Unstable_MessageById:()=>da,Viewport:()=>Cl,ViewportFooter:()=>Tl,ViewportProvider:()=>tr});const El=_.forwardRef((t,e)=>{const s=T(15);let n,r,o;s[0]!==t?({onClick:r,disabled:n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const i=D(P1),{switchToNewThread:a}=jp();let c;s[4]!==i?(c=i?{"data-active":"true","aria-current":"true"}:null,s[4]=i,s[5]=c):c=s[5];let l;s[6]!==r||s[7]!==a?(l=K(r,a),s[6]=r,s[7]=a,s[8]=l):l=s[8];let u;return s[9]!==n||s[10]!==e||s[11]!==o||s[12]!==c||s[13]!==l?(u=v.jsx(J.button,{type:"button",...c,...o,ref:e,disabled:n,onClick:l}),s[9]=n,s[10]=e,s[11]=o,s[12]=c,s[13]=l,s[14]=u):u=s[14],u});El.displayName="ThreadListPrimitive.New";function P1(t){return t.threads.newThreadId===t.threads.mainThreadId}const M1=()=>{const{loadMore:t,disabled:e}=Bp();return e?null:t},D1=ce("ThreadListPrimitive.LoadMore",M1),[k1,O1]=kg("ThreadList"),In=k1,Il=ue(null),$1=Il.Provider,L1=()=>he(Il),Rl=_.forwardRef((t,e)=>{const s=T(3);let n;return s[0]!==t||s[1]!==e?(n=v.jsx(In.Provider,{scope:void 0,children:v.jsx(In.Slot,{scope:void 0,children:v.jsx(J.div,{...t,ref:e})})}),s[0]=t,s[1]=e,s[2]=n):n=s[2],n});Rl.displayName="ThreadListPrimitive.Root";var hS=Oe({ItemByIndex:()=>Oa,Items:()=>$a,LoadMore:()=>D1,New:()=>El,Root:()=>Rl});const Al=_.forwardRef((t,e)=>{const s=D(l=>l.threads.mainThreadId===l.threadListItem.id),n=W(null),r=W(null),o=te(()=>({triggerRef:n,moreRef:r}),[]),i=O1(void 0),a=zg(),c=l=>{const u=a==="rtl"?"ArrowLeft":"ArrowRight",d=a==="rtl"?"ArrowRight":"ArrowLeft",f=n.current,h=r.current;if(f&&l.target===f)if(l.key==="ArrowDown"||l.key==="ArrowUp"){const m=i().map(g=>g.ref.current).filter(g=>g!==null),p=m[m.indexOf(f)+(l.key==="ArrowDown"?1:-1)];p&&(p.focus(),l.preventDefault())}else l.key===u&&h&&(h.focus(),l.preventDefault());else h&&l.target===h&&l.key===d&&(f?.focus(),l.preventDefault())};return v.jsx($1,{value:o,children:v.jsx(J.div,{...s?{"data-active":"true","aria-current":"true"}:null,...t,onKeyDown:K(t.onKeyDown,c),ref:e})})});Al.displayName="ThreadListItemPrimitive.Root";const N1=()=>{const{archive:t}=Op();return t},j1=ce("ThreadListItemPrimitive.Archive",N1),B1=()=>{const{unarchive:t}=Lp();return t},F1=ce("ThreadListItemPrimitive.Unarchive",B1),U1=()=>{const{delete:t}=$p();return t},V1=ce("ThreadListItemPrimitive.Delete",U1),H1=()=>{const{switchTo:t}=Np();return t},q1=ce("ThreadListItemPrimitive.Trigger",H1),Pl=_.forwardRef((t,e)=>{const s=T(3),n=ae(e,L1()?.triggerRef);let r;return s[0]!==t||s[1]!==n?(r=v.jsx(In.ItemSlot,{scope:void 0,children:v.jsx(q1,{...t,ref:n})}),s[0]=t,s[1]=n,s[2]=r):r=s[2],r});Pl.displayName="ThreadListItemPrimitive.Trigger";var mS=Oe({Archive:()=>j1,Delete:()=>V1,Root:()=>Al,Title:()=>La,Trigger:()=>Pl,Unarchive:()=>F1});const Rn="[data-aui-quote-selectable]",z1=t=>t instanceof HTMLElement?t:t?.parentElement??null,Yo=t=>{let e=t instanceof HTMLElement?t:t?.parentElement??null;for(;e;){if(e.getAttribute("data-message-id"))return e;e=e.parentElement}return null},Ss=t=>t.getAttribute("data-aui-quote-selectable")==="false",W1=t=>{if(t.matches(Rn)&&!Ss(t))return!0;for(const e of t.querySelectorAll(Rn))if(!Ss(e))return!0;return!1},Qo=(t,e)=>{const s=z1(t)?.closest(Rn);return!(s instanceof HTMLElement)||!e.contains(s)?null:s},G1=t=>{const{anchorNode:e,focusNode:s}=t;if(!e||!s)return null;const n=Yo(e),r=Yo(s);if(!n||n!==r)return null;const o=n.getAttribute("data-message-id");if(!o)return null;const i=Qo(e,n),a=Qo(s,n);return i&&Ss(i)||a&&Ss(a)||W1(n)&&(!i||i!==a)?null:o},Ml=ue(null),K1=()=>he(Ml),Dl=_.forwardRef((t,e)=>{const s=T(20);let n,r,o;s[0]!==t?({onMouseDown:n,style:o,...r}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const[i,a]=Z(null);let c,l;if(s[4]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const y=()=>{requestAnimationFrame(()=>{const b=window.getSelection();if(!b||b.isCollapsed){a(null);return}const x=b.toString().trim();if(!x){a(null);return}const E=G1(b);if(!E){a(null);return}const I=b.getRangeAt(0).getBoundingClientRect();a({text:x,messageId:E,rect:I})})},C=()=>{const b=window.getSelection();(!b||b.isCollapsed)&&a(null)},S=()=>{a(null)};return document.addEventListener("mouseup",y),document.addEventListener("keyup",y),document.addEventListener("selectionchange",C),document.addEventListener("scroll",S,!0),()=>{document.removeEventListener("mouseup",y),document.removeEventListener("keyup",y),document.removeEventListener("selectionchange",C),document.removeEventListener("scroll",S,!0)}},l=[],s[4]=c,s[5]=l):(c=s[4],l=s[5]),q(c,l),!i)return null;const u=`${i.rect.top-8}px`,d=`${i.rect.left+i.rect.width/2}px`;let f;s[6]!==o||s[7]!==u||s[8]!==d?(f={position:"fixed",top:u,left:d,transform:"translate(-50%, -100%)",zIndex:50,...o},s[6]=o,s[7]=u,s[8]=d,s[9]=f):f=s[9];const h=f;let m;s[10]!==n?(m=y=>{y.preventDefault(),n?.(y)},s[10]=n,s[11]=m):m=s[11];let p;s[12]!==e||s[13]!==h||s[14]!==r||s[15]!==m?(p=v.jsx(J.div,{...r,ref:e,style:h,onMouseDown:m}),s[12]=e,s[13]=h,s[14]=r,s[15]=m,s[16]=p):p=s[16];let g;return s[17]!==i||s[18]!==p?(g=As.createPortal(v.jsx(Ml.Provider,{value:i,children:p}),document.body),s[17]=i,s[18]=p,s[19]=g):g=s[19],g});Dl.displayName="SelectionToolbarPrimitive.Root";const kl=_.forwardRef((t,e)=>{const s=T(15);let n,r,o;s[0]!==t?({onClick:r,disabled:n,...o}=t,s[0]=t,s[1]=n,s[2]=r,s[3]=o):(n=s[1],r=s[2],o=s[3]);const i=H(),a=K1();let c;s[4]!==i||s[5]!==a?(c=()=>{a&&(i.thread().composer().setQuote({text:a.text,messageId:a.messageId}),window.getSelection()?.removeAllRanges())},s[4]=i,s[5]=a,s[6]=c):c=s[6];const l=c,u=n||!a;let d;s[7]!==l||s[8]!==r?(d=K(r,l),s[7]=l,s[8]=r,s[9]=d):d=s[9];let f;return s[10]!==e||s[11]!==o||s[12]!==u||s[13]!==d?(f=v.jsx(J.button,{type:"button",...o,ref:e,disabled:u,onClick:d}),s[10]=e,s[11]=o,s[12]=u,s[13]=d,s[14]=f):f=s[14],f});kl.displayName="SelectionToolbarPrimitive.Quote";var pS=Oe({Quote:()=>kl,Root:()=>Dl});const gS=(t,e)=>{const s=T(5),n=W(null),r=W(null);let o,i;s[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>()=>{r.current?.()},i=[],s[0]=o,s[1]=i):(o=s[0],i=s[1]),q(o,i);let a;return s[2]!==t||s[3]!==e?(a=()=>{r.current?.(),(function(){if(n.current||!t.current)return;let S=t.current;for(;S;){const{overflowY:b}=getComputedStyle(S);if(b==="scroll"||b==="auto"){n.current=S;break}S=S.parentElement}})();const c=n.current;if(!c)return;const l=c.scrollTop,u=c.style.scrollbarWidth,d=getComputedStyle(c),f=d.direction==="rtl"?"paddingLeft":"paddingRight",h=c.style[f],m=c.offsetWidth-c.clientWidth-parseFloat(d.borderLeftWidth)-parseFloat(d.borderRightWidth);c.style.scrollbarWidth="none",m>0&&(c.style[f]=`${parseFloat(d[f])+m}px`);const p=()=>{c.style.scrollbarWidth=u,c.style[f]=h},g=()=>c.scrollTop=l;c.addEventListener("scroll",g);const y=setTimeout(()=>{c.removeEventListener("scroll",g),p(),r.current=null},e);r.current=()=>{clearTimeout(y),c.removeEventListener("scroll",g),p()}},s[2]=t,s[3]=e,s[4]=a):a=s[4],a};var vS=Oe({AssistantRuntimeImpl:()=>oa,BaseAssistantRuntimeCore:()=>ia,CompositeContextProvider:()=>Bn,DefaultThreadComposerRuntimeCore:()=>la,MessageRepository:()=>Kn,ThreadRuntimeImpl:()=>ra,getAutoStatus:()=>hs,splitLocalRuntimeOptions:()=>Hp,useComposerInputPluginRegistryOptional:()=>js,useSmooth:()=>fl,useSmoothStatus:()=>C_,withSmoothContextProvider:()=>w_});function bS(t){const{commands:e,removeOnExecute:s}=t,n=W(e);return n.current=e,te(()=>({adapter:{categories:()=>[],categoryItems:()=>[],search:r=>{const o=r.toLowerCase();return n.current.filter(i=>Q1(i,o)).map(Y1)}},action:{onExecute:r=>{n.current.find(o=>o.id===r.id)?.execute()},...s!==void 0?{removeOnExecute:s}:{}},...t.iconMap?{iconMap:t.iconMap}:{},...t.fallbackIcon?{fallbackIcon:t.fallbackIcon}:{}}),[s,t.iconMap,t.fallbackIcon])}function Y1(t){return{id:t.id,type:"command",label:t.label??`/${t.id}`,...t.description!==void 0?{description:t.description}:{},...t.icon!==void 0?{metadata:{icon:t.icon}}:{}}}function Q1(t,e){return!!(!e||t.id.toLowerCase().includes(e)||t.label?.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))}function yS(t){const e=H(),s=Gc(),n=Kc(t?.disabled),r=Ke(c=>{e.composer().getState().isEditing&&ln(()=>{e.composer().setText(c)})},[e]),{send:o,disabled:i}=Ua(),a=!i&&!n;return{value:s,setText:r,send:Ke(c=>{a&&o(c)},[a,o]),isDisabled:n,canSend:a}}export{bS as $,Fe as A,iS as B,aS as C,Ee as D,tS as E,nS as F,rS as G,oS as H,Os as I,Ys as J,Jv as K,eb as L,tb as M,rb as N,Qp as O,Ae as P,pS as Q,An as R,uS as S,dS as T,cs as U,D as V,H as W,lS as X,X1 as Y,gS as Z,eS as _,y_ as a,Va as a0,Ct as a1,yS as a2,fS as a3,hS as a4,mS as a5,J1 as a6,Z1 as a7,Xo as b,Fl as c,Mo as d,Ve as e,Ie as f,Jo as g,Re as h,vS as i,v as j,wt as k,As as l,wc as m,fe as n,$t as o,Ze as p,sS as q,_ as r,Be as s,_b as t,ke as u,Sc as v,jt as w,_c as x,fb as y,cS as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;color-scheme:light dark;--app-bg: #eeefeb;--panel: #f7f7f4;--surface: #fdfdfb;--surface-raised: #ffffff;--surface-subtle: #f0f1ed;--surface-hover: #e9ebe6;--rail: #171a18;--rail-hover: #252a26;--rail-active: #2b332e;--rail-accent: #84cbb7;--rail-accent-glow: rgba(132, 203, 183, .18);--text: #191d1a;--text-soft: #565d58;--text-muted: #626a64;--line: #dfe2dc;--line-strong: #cfd4cc;--accent: #24725f;--accent-strong: #185b4c;--on-accent: #ffffff;--accent-soft: #dcece6;--accent-glow: rgba(36, 114, 95, .16);--brand-primary: #84cbb7;--brand-secondary: #e6b566;--brand-tail: #f0f3ee;--cat-4: #84528f;--danger: #a3423b;--danger-soft: #f4dfdc;--warning: #a46618;--success: #2f7a4d;--shadow-sm: 0 1px 2px rgba(22, 29, 25, .06), 0 3px 12px rgba(22, 29, 25, .04);--shadow-lg: 0 24px 80px rgba(13, 19, 15, .2), 0 4px 20px rgba(13, 19, 15, .1);--radius-sm: 8px;--radius-md: 12px;--radius-lg: 18px;--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}:root[data-console-theme=ocean]{--app-bg: #edf1f4;--panel: #f6f8fa;--rail: #111a21;--rail-hover: #1d2c37;--rail-active: #233845;--rail-accent: #72b5dc;--rail-accent-glow: rgba(114, 181, 220, .2);--accent: #266a91;--accent-strong: #1b5477;--accent-soft: #dcebf4;--accent-glow: rgba(38, 106, 145, .16);--brand-primary: #72b5dc;--brand-secondary: #80cec2}:root[data-console-theme=plum]{--app-bg: #f2eef3;--panel: #faf7fa;--rail: #1b151d;--rail-hover: #302536;--rail-active: #3a2b41;--rail-accent: #c18dcc;--rail-accent-glow: rgba(193, 141, 204, .2);--accent: #7b4c87;--accent-strong: #62396d;--accent-soft: #eadfed;--accent-glow: rgba(123, 76, 135, .16);--brand-primary: #c18dcc;--brand-secondary: #e3a0bd}:root[data-console-theme=terracotta]{--app-bg: #f4efec;--panel: #faf7f5;--rail: #201611;--rail-hover: #36241c;--rail-active: #432d23;--rail-accent: #df8e70;--rail-accent-glow: rgba(223, 142, 112, .2);--accent: #9b5037;--accent-strong: #7d3c28;--accent-soft: #f1e1da;--accent-glow: rgba(155, 80, 55, .16);--brand-primary: #df8e70;--brand-secondary: #e5bd69}@media(prefers-color-scheme:dark){:root{--app-bg: #0f1110;--panel: #141715;--surface: #191c1a;--surface-raised: #1d211e;--surface-subtle: #202420;--surface-hover: #272c28;--rail: #0b0d0c;--rail-hover: #202421;--rail-active: #273029;--text: #f0f2ed;--text-soft: #b5bbb5;--text-muted: #9aa39b;--line: #2a2f2b;--line-strong: #383f39;--accent: #68b8a2;--accent-strong: #8bd0bd;--on-accent: #0a1713;--accent-soft: #1d3a32;--accent-glow: rgba(104, 184, 162, .12);--cat-4: #c18dcc;--danger: #eb8d83;--danger-soft: #3b2523;--warning: #daa258;--success: #79c995;--shadow-sm: 0 1px 2px rgba(0, 0, 0, .25), 0 3px 12px rgba(0, 0, 0, .14);--shadow-lg: 0 24px 90px rgba(0, 0, 0, .55), 0 4px 24px rgba(0, 0, 0, .3)}:root[data-console-theme=ocean]{--app-bg: #0d1115;--panel: #13191e;--rail: #091017;--rail-hover: #192733;--rail-active: #203442;--rail-accent: #72b5dc;--rail-accent-glow: rgba(114, 181, 220, .2);--accent: #72b5dc;--accent-strong: #94c9e8;--on-accent: #08151c;--accent-soft: #193548;--accent-glow: rgba(114, 181, 220, .13)}:root[data-console-theme=plum]{--app-bg: #120f14;--panel: #18141a;--rail: #0f0b11;--rail-hover: #2b2030;--rail-active: #38283f;--rail-accent: #c18dcc;--rail-accent-glow: rgba(193, 141, 204, .2);--accent: #c18dcc;--accent-strong: #d5a9dd;--on-accent: #1b0c1e;--accent-soft: #3a2640;--accent-glow: rgba(193, 141, 204, .13)}:root[data-console-theme=terracotta]{--app-bg: #130f0d;--panel: #191411;--rail: #100b09;--rail-hover: #2d1e18;--rail-active: #3b2720;--rail-accent: #df8e70;--rail-accent-glow: rgba(223, 142, 112, .2);--accent: #df8e70;--accent-strong: #efa98f;--on-accent: #22100a;--accent-soft: #432a21;--accent-glow: rgba(223, 142, 112, .13)}}*{box-sizing:border-box}html,body,#root{width:100%;min-width:320px;height:100%;margin:0;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{overflow:hidden;background:var(--app-bg);color:var(--text)}button,input,textarea,select{font:inherit;color:inherit}button{border:0}button,select{-webkit-tap-highlight-color:transparent}button:disabled,select:disabled{cursor:not-allowed;opacity:.45}::selection{color:var(--text);background:var(--accent-soft)}.sr-only,.sr-only-focusable:not(:focus){position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.icon-button{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;flex:none;color:var(--text-soft);background:transparent;border-radius:10px;cursor:pointer}.icon-button:hover{color:var(--text);background:var(--surface-hover)}.primary-button{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 16px;color:var(--on-accent);background:var(--accent-strong);border-radius:10px;font-weight:650;cursor:pointer;box-shadow:var(--shadow-sm)}.eyebrow{display:block;margin-bottom:5px;color:var(--text-muted);font-size:10px;font-weight:700;line-height:1;letter-spacing:.14em;text-transform:uppercase}.app-shell{width:100%;height:100dvh;display:grid;grid-template-columns:var(--agent-rail-width, 72px) 304px minmax(0,1fr);grid-template-rows:minmax(0,1fr);overflow:hidden;background:var(--surface)}.desktop-agent-rail,.desktop-thread-sidebar{min-width:0;height:100%}.desktop-agent-rail{position:relative;z-index:8}.mobile-agent-drawer,.mobile-thread-drawer,.drawer-scrim{display:none}.agent-rail{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;gap:13px;padding:max(16px,env(safe-area-inset-top)) 10px max(15px,env(safe-area-inset-bottom));color:#d8ded8;background:var(--rail);border-right:1px solid rgba(255,255,255,.04)}.rail-toggle,.rail-command,.rail-connection{align-self:center}.rail-brand{width:46px;height:42px;display:flex;align-items:center;justify-content:center;gap:10px;flex:none;margin-bottom:4px}.rail-brand-copy{display:none;overflow:hidden;color:#eef2ed;font-size:13px;font-weight:680;text-overflow:ellipsis;white-space:nowrap}.brand-mark{position:relative;width:28px;height:28px;display:inline-block}.brand-mark span{position:absolute;display:block;border-radius:999px;background:var(--brand-primary)}.brand-mark span:nth-child(1){width:9px;height:9px;top:2px;left:2px}.brand-mark span:nth-child(2){width:9px;height:9px;top:2px;right:2px;background:var(--brand-secondary)}.brand-mark span:nth-child(3){width:22px;height:9px;bottom:2px;left:3px;background:var(--brand-tail)}.agent-list{width:100%;min-height:0;flex:1;display:flex;flex-direction:column;align-items:center;gap:9px;padding-block-start:5px;overflow-y:auto;scrollbar-width:none}.agent-list::-webkit-scrollbar{display:none}.agent-item{position:relative;width:48px;display:flex;align-items:center;justify-content:center;flex:none}.agent-button{position:relative;width:48px;height:48px;display:grid;place-items:center;padding:0;color:#d5dbd5;background:transparent;border-radius:15px;cursor:pointer;transition:background .15s ease,transform .15s ease}.agent-button:hover{background:var(--rail-hover);transform:translateY(-1px)}.agent-button.is-active{background:var(--rail-active);box-shadow:inset 0 0 0 1px var(--rail-accent-glow)}.agent-button.is-active:before{content:"";position:absolute;left:-10px;width:3px;height:22px;border-radius:0 4px 4px 0;background:var(--rail-accent)}.agent-avatar-wrap{position:relative;width:34px;height:34px;display:grid;place-items:center;flex:none}.agent-avatar{font-size:12px;font-weight:760;letter-spacing:.02em}.agent-label{display:none;min-width:0;overflow:hidden;color:#e1e6e1;font-size:12px;font-weight:620;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.agent-status{position:absolute;right:4px;bottom:4px;width:9px;height:9px;border:2px solid var(--rail);border-radius:50%;background:#727972}.agent-status.is-online{background:#6bc495}.agent-status.is-degraded{background:#e3a756}.agent-pin{position:absolute;top:-5px;right:-5px;width:23px;height:23px;display:grid;place-items:center;padding:0;opacity:0;color:#98a099;background:#252a26;border:1px solid rgba(255,255,255,.08);border-radius:7px;cursor:pointer;transition:color .13s ease,opacity .13s ease,background .13s ease;z-index:2}.agent-item:hover .agent-pin,.agent-pin:focus-visible,.agent-pin.is-pinned{opacity:1}.agent-pin:hover,.agent-pin.is-pinned{color:#e6b566;background:#303630}.rail-offline-toggle{position:relative;width:44px;min-height:36px;display:flex;align-items:center;justify-content:center;gap:8px;flex:none;margin-top:3px;padding:0;color:#78817a;background:transparent;border:1px solid rgba(255,255,255,.06);border-radius:10px;cursor:pointer;font-size:10px}.rail-offline-toggle:hover,.rail-offline-toggle.is-active{color:#d8ded8;background:var(--rail-hover)}.rail-offline-copy{display:none}.rail-offline-count{position:absolute;top:-5px;right:-5px;min-width:17px;height:17px;display:grid;place-items:center;padding:0 4px;color:#1d231f;background:#d2d9d2;border:2px solid var(--rail);border-radius:999px;font-family:var(--font-mono);font-size:8px;font-weight:750}.rail-toggle{width:42px;height:36px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0;color:#78817a;background:transparent;border-radius:10px;cursor:pointer;font-size:10px}.rail-toggle:hover{color:#eef2ed;background:var(--rail-hover)}.rail-toggle-copy{display:none}.agent-rail.is-expanded .rail-toggle>svg{transform:rotate(180deg)}.agent-rail.is-expanded{align-items:stretch}.agent-rail.is-expanded .rail-brand{width:100%;justify-content:flex-start;padding:0 9px}.agent-rail.is-expanded .rail-brand-copy{display:block}.agent-rail.is-expanded .agent-list{align-items:stretch}.agent-rail.is-expanded .agent-item{width:100%;gap:4px}.agent-rail.is-expanded .agent-button{width:auto;height:auto;min-height:48px;min-width:0;flex:1;display:flex;grid-template:none;justify-content:flex-start;gap:10px;padding:7px 9px}.agent-rail.is-expanded .agent-button.is-active:before{left:-10px}.agent-rail.is-expanded .agent-label{display:block;flex:1;overflow-wrap:anywhere;text-align:left;text-overflow:clip;white-space:normal}.agent-rail.is-expanded .agent-pin{position:static;width:31px;height:31px;flex:none;border-color:transparent;background:transparent}.agent-rail.is-expanded .agent-item:hover .agent-pin,.agent-rail.is-expanded .agent-pin:focus-visible,.agent-rail.is-expanded .agent-pin.is-pinned{opacity:1}.agent-rail.is-expanded .agent-pin:hover,.agent-rail.is-expanded .agent-pin.is-pinned{background:var(--rail-hover)}.agent-rail.is-expanded .rail-offline-toggle,.agent-rail.is-expanded .rail-toggle{width:100%;justify-content:flex-start;padding:0 10px}.agent-rail.is-expanded .rail-offline-copy,.agent-rail.is-expanded .rail-toggle-copy{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(hover:none),(pointer:coarse){.agent-pin{opacity:1}}.rail-empty{width:44px;height:44px;display:grid;place-items:center;color:#687069;border:1px dashed #333a35;border-radius:13px}.rail-command{width:42px;height:42px;display:grid;place-items:center;color:#8d978f;background:transparent;border-radius:11px;cursor:pointer}.rail-command:hover{color:#eef2ed;background:var(--rail-hover)}.rail-connection{width:7px;height:7px;flex:none;border-radius:50%;background:#626963}.rail-connection.is-live{background:#66bf91;box-shadow:0 0 0 4px #66bf9117}.rail-connection.is-connecting,.rail-connection.is-reconnecting{background:#dba65b;animation:pulse 1.4s ease infinite}.mobile-agent-picker{width:100%;height:100%;display:flex;flex-direction:column;color:var(--text);background:var(--panel);box-shadow:var(--shadow-lg)}.mobile-agent-picker>header{min-height:82px;display:flex;align-items:center;gap:14px;padding:max(17px,env(safe-area-inset-top)) 18px 12px;border-bottom:1px solid var(--line)}.mobile-agent-picker>header .brand-mark{flex:none;transform:scale(.86)}.mobile-agent-picker h2{margin:0;font-size:18px}.mobile-agent-list{min-height:0;flex:1;padding:10px;overflow-y:auto}.mobile-agent-row{width:100%;display:flex;align-items:center;gap:4px;border-radius:11px}.mobile-agent-select{position:relative;min-width:0;min-height:62px;display:flex;align-items:center;gap:12px;flex:1;padding:8px 10px;color:var(--text);background:transparent;border-radius:11px;cursor:pointer;text-align:left}.mobile-agent-select:hover,.mobile-agent-select.is-active{background:var(--surface-raised);box-shadow:inset 0 0 0 1px var(--line)}.mobile-agent-avatar{width:40px;height:40px;display:grid;place-items:center;flex:none;color:#dfe5df;background:var(--rail);border-radius:12px;font-size:11px;font-weight:750}.mobile-agent-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}.mobile-agent-copy strong{overflow-wrap:anywhere;font-size:13px;line-height:1.35}.mobile-agent-copy small{color:var(--text-muted);font-size:10px;text-transform:capitalize}.mobile-agent-list .agent-status{position:static;width:8px;height:8px;border:0}.mobile-agent-select>svg{flex:none;color:var(--accent)}.mobile-agent-pin{width:40px;height:40px;display:grid;place-items:center;flex:none;padding:0;color:var(--text-muted);background:transparent;border-radius:10px;cursor:pointer}.mobile-agent-pin:hover,.mobile-agent-pin.is-pinned{color:#b77b21;background:var(--surface-hover)}.mobile-offline-toggle{width:100%;min-height:42px;display:flex;align-items:center;justify-content:center;gap:8px;margin-top:8px;padding:0 12px;color:var(--text-muted);background:transparent;border:1px solid var(--line);border-radius:10px;cursor:pointer;font-size:11px}.mobile-offline-toggle:hover,.mobile-offline-toggle.is-active{color:var(--text);background:var(--surface-subtle)}.mobile-agent-list p{padding:30px 18px;color:var(--text-muted);text-align:center;font-size:12px;line-height:1.5}.thread-sidebar{width:100%;height:100%;display:flex;flex-direction:column;min-width:0;background:var(--panel);border-right:1px solid var(--line)}.sidebar-header{min-height:85px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:max(18px,env(safe-area-inset-top)) 17px 13px}.sidebar-header h1{max-width:205px;margin:0;overflow:hidden;color:var(--text);font-size:17px;font-weight:680;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.new-thread-button{width:38px;height:38px;display:grid;place-items:center;flex:none;color:var(--text-soft);background:var(--surface-raised);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow-sm);cursor:pointer}.new-thread-button:hover{color:var(--accent);border-color:var(--line-strong)}.thread-search{height:38px;display:flex;align-items:center;gap:8px;margin:0 14px 10px;padding:0 10px;color:var(--text-muted);background:var(--surface-subtle);border:1px solid transparent;border-radius:9px}.thread-search:focus-within{color:var(--accent);background:var(--surface-raised);border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-glow)}.thread-search input{min-width:0;height:100%;flex:1;padding:0;color:var(--text);background:transparent;border:0;outline:0;font-size:13px}.thread-search input::placeholder{color:var(--text-muted)}.thread-search input::-webkit-search-cancel-button{display:none}.thread-search button{width:26px;height:26px;display:grid;place-items:center;padding:0;color:var(--text-muted);background:transparent;border-radius:7px;cursor:pointer}.thread-list{min-height:0;flex:1}.thread-list-scroll{height:100%;padding:2px 8px 12px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}.thread-item{position:relative;display:flex;align-items:stretch;min-height:68px;margin:2px 0;border-radius:10px;transition:background .13s ease}.thread-item:hover{background:var(--surface-hover)}.thread-item.is-active{background:var(--surface-raised);box-shadow:var(--shadow-sm),inset 0 0 0 1px var(--line)}.thread-item.is-active:before{content:"";position:absolute;left:0;top:18px;width:3px;height:30px;border-radius:0 4px 4px 0;background:var(--accent)}.thread-trigger{min-width:0;flex:1;display:flex;flex-direction:column;justify-content:center;gap:7px;padding:10px 8px 10px 12px;text-align:left;background:transparent;border-radius:10px;cursor:pointer}.thread-title-line{min-width:0;display:flex;align-items:baseline;gap:7px}.thread-title{min-width:0;flex:1;overflow:hidden;color:var(--text);font-size:13px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.trigger-badge{flex:none;padding:2px 5px;color:var(--accent);background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 30%,transparent);border-radius:5px;font-size:8px;font-weight:760;line-height:1.1;text-transform:uppercase;letter-spacing:.07em}.thread-title-line time{flex:none;color:var(--text-muted);font-family:var(--font-mono);font-size:9px}.thread-preview{min-width:0;display:flex;align-items:center;gap:6px;overflow:hidden;color:var(--text-muted);font-size:11.5px;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.thread-preview-text{min-width:0;flex:1;overflow:hidden;font:inherit;line-height:inherit;text-overflow:ellipsis;white-space:nowrap}.thread-running{width:6px;height:6px;flex:none;border-radius:50%;background:var(--accent);box-shadow:0 0 0 3px var(--accent-glow);animation:pulse 1.4s ease infinite}.thread-action{width:34px;display:grid;place-items:center;align-self:center;height:34px;margin-right:5px;padding:0;opacity:0;color:var(--text-muted);background:transparent;border-radius:8px;cursor:pointer}.thread-item:hover .thread-action,.thread-action:focus-visible{opacity:1}.thread-action:hover{color:var(--text);background:var(--surface-subtle)}.thread-search-results{display:flex;flex-direction:column;gap:4px}.thread-search-group{margin:10px 4px 2px;color:var(--text-muted);font-size:9px;font-weight:750;letter-spacing:.1em;text-transform:uppercase}.thread-search-hit{min-height:68px;display:flex;flex-direction:column;justify-content:center;gap:7px;width:100%;margin:2px 0;padding:10px 12px;color:var(--text);background:transparent;border-radius:10px;cursor:pointer;text-align:left}.thread-search-hit:hover{background:var(--surface-hover)}.thread-search-hit.is-active{background:var(--surface-raised);box-shadow:var(--shadow-sm),inset 0 0 0 1px var(--line)}.thread-search-hit mark{padding:0 1px;color:var(--accent);background:var(--accent-soft);border-radius:3px;font-weight:650}.thread-search-count{flex:none;color:var(--text-muted);font-family:var(--font-mono);font-size:8.5px}.thread-search-truncated{margin:10px 6px 0;color:var(--text-muted);font-size:10.5px;line-height:1.4}.thread-list-empty{min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;color:var(--text-muted);text-align:center;font-size:12px}.archive-toggle{min-height:49px;display:flex;align-items:center;gap:9px;margin:0 10px max(8px,env(safe-area-inset-bottom));padding:0 11px;color:var(--text-muted);background:transparent;border-top:1px solid var(--line);cursor:pointer;font-size:12px;text-align:left}.archive-toggle:hover,.archive-toggle.is-active{color:var(--text)}.archive-count{min-width:16px;margin-left:auto;color:var(--text-muted);font-family:var(--font-mono);font-size:10px;text-align:right}.chat-panel{position:relative;min-width:0;height:100%;display:flex;flex-direction:column;overflow:hidden;background:var(--surface)}.chat-header{min-height:64px;display:flex;align-items:center;gap:15px;padding:max(10px,env(safe-area-inset-top)) max(17px,env(safe-area-inset-right)) 10px max(17px,env(safe-area-inset-left));background:color-mix(in srgb,var(--surface) 94%,transparent);border-bottom:1px solid var(--line);z-index:5}.mobile-navigation{display:none}.chat-title-block{min-width:0;flex:1;display:flex;align-items:center;gap:10px}.conversation-title-group{min-width:0;max-width:min(62vw,650px);display:flex;align-items:center;gap:7px}.conversation-title{min-width:0;max-width:min(52vw,560px);overflow:hidden;padding:3px 5px;color:var(--text);background:transparent;border-radius:6px;font-size:14px;font-weight:650;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text}.trigger-badge-header{padding:3px 6px;font-size:8.5px}.title-input{min-width:180px;max-width:min(52vw,560px);height:34px;padding:0 8px;color:var(--text);background:var(--surface-subtle);border:1px solid var(--accent);border-radius:7px;outline:0;font-size:14px;font-weight:650}.chat-status{display:inline-flex;align-items:center;gap:5px;flex:none;color:var(--text-muted);font-size:10px;font-weight:650;text-transform:uppercase;letter-spacing:.07em}.chat-status i{width:6px;height:6px;border-radius:50%;background:var(--text-muted)}.chat-status.is-ready i{background:var(--accent)}.chat-status.is-working i{background:var(--accent);box-shadow:0 0 0 3px var(--accent-glow);animation:pulse 1.2s ease infinite}.chat-status.is-failed,.chat-status.is-offline,.chat-status.is-browser{color:var(--danger)}.chat-status.is-failed i,.chat-status.is-offline i,.chat-status.is-browser i{background:var(--danger)}.chat-status.is-reconnecting,.chat-status.is-degraded{color:var(--warning)}.chat-status.is-reconnecting i,.chat-status.is-degraded i{background:var(--warning);animation:pulse 1.4s ease infinite}.chat-header-actions{display:flex;align-items:center;gap:8px;flex:none}.cron-channel-header{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:7px 14px;padding:10px max(17px,env(safe-area-inset-right)) 10px max(17px,env(safe-area-inset-left));background:var(--surface-subtle);border-bottom:1px solid var(--line);z-index:4}.cron-channel-facts{min-width:0;display:grid;grid-template-columns:repeat(6,minmax(86px,auto));gap:8px 18px;margin:0}.cron-channel-facts>div{min-width:0;display:flex;flex-direction:column;gap:2px}.cron-channel-facts dt{color:var(--text-muted);font-size:8px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.cron-channel-facts dd{min-width:0;margin:0;overflow:hidden;color:var(--text-soft);font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cron-channel-facts dd>small{display:block;overflow:hidden;color:var(--text-muted);font-size:8.5px;text-overflow:ellipsis}.cron-channel-facts code,.cron-session-link code{font-family:var(--font-mono);font-size:9.5px}.cron-channel-facts a{color:var(--accent);text-decoration:none}.cron-channel-facts a:hover{text-decoration:underline}.cron-health{text-transform:capitalize}.cron-health.is-healthy{color:var(--accent)}.cron-health.is-warning,.cron-health.is-unknown{color:var(--warning)}.cron-health.is-unhealthy{color:var(--danger)}.cron-channel-actions{min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:6px;margin-left:auto}.cron-channel-actions>button,.cron-dialog footer>button{min-height:32px;padding:0 10px;color:var(--text-soft);background:var(--surface-raised);border:1px solid var(--line);border-radius:8px;cursor:pointer;font-size:10px;font-weight:650}.cron-channel-actions>button:hover:not(:disabled),.cron-dialog footer>button:hover:not(:disabled){color:var(--text);border-color:var(--line-strong)}.cron-channel-actions>.cron-action-primary,.cron-dialog footer>.cron-action-primary{display:inline-flex;align-items:center;justify-content:center;gap:5px;color:var(--on-accent);background:var(--accent-strong);border-color:transparent}.cron-session-link{min-width:0;max-width:180px;overflow:hidden;color:var(--text-muted);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.cron-refreshing{position:absolute;right:18px;bottom:1px;color:var(--text-muted);font-size:8px}.cron-action-error{margin:0;color:var(--danger);font-size:10px}.cron-unavailable-reason{flex-basis:100%;margin:0;color:var(--text-muted);font-size:9px;line-height:1.35}.cron-unavailable-reason:focus-visible{outline:1px solid var(--accent);outline-offset:2px;border-radius:2px}.cron-channel-header>.cron-action-error{position:absolute;right:18px;bottom:0}.cron-dialog{width:min(100%,560px);max-height:min(78dvh,720px);display:flex;flex-direction:column;gap:15px;overflow:hidden;padding:18px;color:var(--text);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:16px;box-shadow:var(--shadow-lg);outline:none}.cron-dialog>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.cron-dialog h2{margin:3px 0 0;font-size:19px;letter-spacing:-.02em}.cron-dialog>p{margin:0;color:var(--text-soft);font-size:13px;line-height:1.6}.cron-dialog>small{color:var(--text-muted);font-size:10px}.cron-dialog>footer{display:flex;justify-content:flex-end;gap:8px;margin-top:auto}.cron-config-fields{min-height:0;display:grid;gap:8px;margin:0;padding-right:4px;overflow-y:auto}.cron-config-fields>div{display:grid;grid-template-columns:minmax(110px,.7fr) minmax(0,1.5fr) auto;align-items:center;gap:8px;padding:9px 10px;background:var(--surface-subtle);border:1px solid var(--line);border-radius:8px}.cron-config-fields dt{color:var(--text-soft);font-size:11px}.cron-config-fields dd{min-width:0;margin:0;overflow:auto}.cron-config-fields code{font-family:var(--font-mono);font-size:10px;white-space:pre-wrap;overflow-wrap:anywhere}.cron-config-fields small{color:var(--text-muted);font-size:8px}.model-controls{min-width:0;display:flex;align-items:center;gap:6px}.model-selector__trigger{max-width:min(270px,30vw);height:36px;display:inline-flex;align-items:center;justify-content:space-between;gap:8px;padding:0 10px;color:var(--text-soft);background:var(--surface-subtle);border:1px solid var(--line);border-radius:9px;cursor:pointer;text-align:left}.model-selector__trigger:hover:not(:disabled),.model-selector__trigger[aria-expanded=true]{color:var(--text);background:var(--surface-hover);border-color:var(--line-strong)}.model-selector__trigger>svg{flex:none;color:var(--text-muted)}.model-selector__value{min-width:0;display:flex;align-items:center;gap:7px}.model-selector__model-name{min-width:0;overflow:hidden;font-size:10.5px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.model-selector__effort-value{flex:none;padding:2px 5px;color:var(--accent);background:var(--accent-soft);border-radius:5px;font-size:8.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.model-selector__badge{flex:none;padding:2px 5px;color:var(--text-muted);background:var(--surface-subtle);border-radius:5px;font-size:7.5px;font-weight:750;letter-spacing:.05em;text-transform:uppercase}.model-selector__badge.is-custom{color:var(--warning);background:color-mix(in srgb,var(--warning) 12%,transparent)}.model-selector__item-default{flex:none;padding:2px 5px;color:var(--text-muted);background:var(--surface-subtle);border-radius:4px;font-size:8px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}.model-selector__reset{padding:4px 8px 8px;border-top:1px solid var(--line)}.model-selector__reset button{width:100%;min-height:34px;display:flex;align-items:center;justify-content:center;gap:6px;color:var(--accent);background:var(--accent-soft);border-radius:8px;cursor:pointer;font-size:11.5px;font-weight:650}.model-selector__backdrop{display:none}.model-selector__positioner{z-index:112}.model-selector__content{width:min(370px,calc(100vw - 24px));max-height:min(70dvh,620px);overflow:hidden;color:var(--text);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:14px;box-shadow:var(--shadow-lg);transform-origin:var(--transform-origin)}.model-selector__command{min-height:0;display:flex;flex-direction:column;background:transparent}.model-selector__search-wrapper{min-height:47px;display:flex;align-items:center;gap:9px;padding:0 12px;color:var(--text-muted);border-bottom:1px solid var(--line)}.model-selector__search{min-width:0;height:46px;flex:1;padding:0;color:var(--text);background:transparent;border:0;outline:0;font-size:13px}.model-selector__search::placeholder{color:var(--text-muted)}.model-selector__list{max-height:min(43dvh,360px);padding:6px;overflow-y:auto;overscroll-behavior:contain}.model-selector__group{display:flex;flex-direction:column;gap:2px}.model-selector__item{min-height:52px;display:flex;align-items:center;gap:10px;padding:7px 9px;color:var(--text-soft);border-radius:9px;cursor:pointer;outline:0}.model-selector__item[data-selected=true],.model-selector__item:hover{color:var(--text);background:var(--surface-subtle)}.model-selector__item-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:3px}.model-selector__item-name{overflow:hidden;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.model-selector__item-description{overflow:hidden;color:var(--text-muted);font-family:var(--font-mono);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.model-selector__selected-indicator{width:25px;height:25px;display:grid;place-items:center;flex:none;color:var(--accent);background:var(--accent-soft);border-radius:7px}.model-selector__empty{padding:30px 18px;color:var(--text-muted);text-align:center;font-size:12px}.model-selector__effort{display:grid;gap:8px;padding:10px 12px 12px;background:var(--surface-subtle);border-top:1px solid var(--line)}.model-selector__effort-label{color:var(--text-muted);font-size:9px;font-weight:750;text-transform:uppercase;letter-spacing:.09em}.model-selector__effort-options{display:flex;flex-wrap:wrap;gap:5px}.model-selector__effort-option{min-width:44px;min-height:31px;display:inline-flex;align-items:center;justify-content:center;padding:0 9px;color:var(--text-soft);background:var(--surface-raised);border:1px solid var(--line);border-radius:8px;cursor:pointer;font-size:10px;font-weight:650}.model-selector__effort-option:hover{border-color:var(--line-strong)}.model-selector__effort-option[data-checked]{color:var(--on-accent);background:var(--accent-strong);border-color:var(--accent-strong)}.context-display-trigger{height:32px;display:inline-flex;align-items:center;gap:5px;padding:0 7px;color:var(--text-muted);background:transparent;border-radius:8px;cursor:pointer;font-family:var(--font-mono);font-size:9px;white-space:nowrap}.context-display-trigger:hover,.context-display-trigger[aria-expanded=true]{color:var(--text);background:var(--surface-subtle)}.context-display-icon{color:var(--accent)}.context-display-trigger-percent{color:var(--accent);font-weight:700}.context-display-trigger[data-state=updating] .context-display-trigger-percent{color:var(--accent)}.context-display-trigger[data-state=awaiting_measurement] .context-display-trigger-percent{color:var(--warning)}.context-display-trigger[data-state=last_measured] .context-display-trigger-percent,.context-display-trigger[data-state=unavailable] .context-display-trigger-percent{color:var(--text-soft)}.context-display-positioner{z-index:111}.context-display-popover{width:min(300px,calc(100vw - 24px));padding:14px;color:var(--text);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:13px;box-shadow:var(--shadow-lg)}.context-display-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 12px}.context-display-title{margin:0;font-size:12px;font-weight:720}.context-display-status{color:var(--text-soft);font-family:var(--font-mono);font-size:8px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.context-display-status[data-state=updating]{color:var(--accent)}.context-display-status[data-state=awaiting_measurement]{color:var(--warning)}.context-display-unavailable{margin:0 0 12px;color:var(--text-muted);font-size:10px;line-height:1.5}.context-display-state-note{margin:-2px 0 10px;color:var(--text-muted);font-size:10px;line-height:1.5}.context-display-model{display:grid;gap:3px;margin:0 0 11px;color:var(--text-muted);font-size:9px}.context-display-model code{overflow-wrap:anywhere;color:var(--text-soft);font-family:var(--font-mono);font-size:9px}.context-display-section+.context-display-section,.context-display-cost-breakdown{margin-top:14px}.context-display-section-title{margin:0 0 8px;color:var(--text-soft);font-size:10px;font-weight:720}.context-display-window{display:grid;gap:7px;margin-bottom:12px}.context-display-window-summary{display:flex;justify-content:space-between;gap:12px;color:var(--text-muted);font-size:10px}.context-display-percent{color:var(--accent);font-family:var(--font-mono);font-weight:700}.context-display-progress{height:5px;overflow:hidden;background:var(--surface-subtle);border-radius:999px}.context-display-progress-value{height:100%;display:block;background:var(--accent);border-radius:inherit}.context-display-breakdown{display:grid;gap:6px;margin:0}.context-display-breakdown-row{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--text-muted);font-size:10px}.context-display-breakdown-row dt,.context-display-breakdown-row dd{margin:0}.context-display-breakdown-row dd{color:var(--text-soft);font-family:var(--font-mono)}.context-display-breakdown-total,.context-display-breakdown-cost{padding-top:6px;color:var(--text);border-top:1px solid var(--line);font-weight:700}.header-archive{width:36px;height:36px}.header-delete{width:36px;height:36px;color:var(--danger)}.header-notifications{width:36px;height:36px}.header-notifications.is-enabled{color:var(--accent);background:var(--accent-soft)}.header-notifications.is-degraded{color:var(--warning);background:color-mix(in srgb,var(--warning) 12%,transparent)}.process-job-card{border:1px solid var(--border);border-radius:12px;padding:12px 14px;background:var(--surface-raised, var(--surface));max-width:720px}.process-job-header{display:flex;align-items:center;gap:8px}.process-job-header strong{flex:1}.process-job-state{font-size:12px;text-transform:capitalize;color:var(--muted)}.process-job-state-dot{width:9px;height:9px;border-radius:50%;background:var(--warning);box-shadow:0 0 0 3px color-mix(in srgb,var(--warning) 15%,transparent)}.process-job-card.is-succeeded .process-job-state-dot{background:var(--success, #24804a);box-shadow:0 0 0 3px color-mix(in srgb,var(--success, #24804a) 15%,transparent)}.process-job-card:is(.is-failed,.is-timed_out,.is-spawn_failed,.is-interrupted) .process-job-state-dot{background:var(--danger, #b42318);box-shadow:0 0 0 3px color-mix(in srgb,var(--danger, #b42318) 15%,transparent)}.process-job-summary{margin:10px 0;overflow-wrap:anywhere}.process-job-facts{display:flex;flex-wrap:wrap;gap:8px 18px;margin:0;font-size:12px;color:var(--muted)}.process-job-facts div{display:flex;gap:5px}.process-job-facts dt{font-weight:600}.process-job-facts dd{margin:0}.process-job-output{margin-top:10px}.process-job-output summary{cursor:pointer;font-size:13px}.process-job-output pre{max-height:320px;overflow:auto;padding:10px;border-radius:8px;background:var(--surface-sunken, color-mix(in srgb, currentColor 5%, transparent));white-space:pre-wrap;overflow-wrap:anywhere}.process-job-output ul{margin:8px 0 0;padding-left:20px;overflow-wrap:anywhere}.process-job-error{color:var(--danger, #b42318);font-size:13px}.process-job-response{margin:12px 0 0;padding-top:10px;border-top:1px solid var(--border);white-space:pre-wrap}.connection-banner{min-height:34px;display:flex;align-items:center;justify-content:center;gap:8px;padding:7px 16px;color:var(--warning);background:color-mix(in srgb,var(--warning) 9%,var(--surface));border-bottom:1px solid color-mix(in srgb,var(--warning) 25%,var(--line));font-size:11px;text-align:center;z-index:4}.connection-pulse{width:6px;height:6px;flex:none;border-radius:50%;background:currentColor;animation:pulse 1.5s ease infinite}.thread-root{position:relative;min-height:0;display:flex;flex:1 1 0;flex-direction:column;overflow:hidden}.thread-viewport{width:100%;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}.message-column{--column-padding: 32px;width:min(100%,880px);min-height:calc(100% - 160px);margin:0 auto;padding:38px var(--column-padding) 20px}.thread-footer{position:sticky;bottom:0;width:100%;padding:28px max(24px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));background:linear-gradient(to bottom,transparent 0,color-mix(in srgb,var(--surface) 94%,transparent) 28px,var(--surface) 70%);z-index:3}.scroll-bottom{position:sticky;left:50%;bottom:143px;width:36px;height:36px;display:grid;place-items:center;margin-left:-18px;color:var(--text-soft);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:50%;box-shadow:var(--shadow-sm);cursor:pointer;z-index:4}.detail-loading{position:absolute;inset:64px 0 0;display:grid;place-items:center;pointer-events:none;background:color-mix(in srgb,var(--surface) 74%,transparent);z-index:4}.detail-loading span{width:22px;height:22px;border:2px solid var(--line-strong);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}.message{position:relative;width:100%;margin-bottom:28px;user-select:none}.message-user{display:flex;flex-direction:column;align-items:flex-end}.message-user-content{max-width:min(78%,650px);padding:11px 15px;color:var(--text);background:var(--surface-subtle);border:1px solid var(--line);border-radius:16px 16px 4px}.live-input-status{margin:5px 3px 0;color:var(--text-muted);font-size:9.5px;letter-spacing:.01em}.live-input-status.is-applied{color:var(--accent)}.live-input-status.is-cancelled{color:var(--danger)}.assistant-content{min-width:0;container-type:inline-size;container-name:assistant}.message-system{margin:18px auto;padding:8px 12px;color:var(--text-muted);border-left:2px solid var(--line-strong);font-size:12px}.markdown{color:var(--text);font-size:14px;line-height:1.68;overflow-wrap:anywhere;user-select:text}.markdown>:first-child{margin-top:0}.markdown>:last-child{margin-bottom:0}.markdown p,.markdown ul,.markdown ol,.markdown blockquote,.markdown pre{margin:0 0 .85em}.markdown ul,.markdown ol{padding-left:1.45em}.markdown li+li{margin-top:.3em}.markdown a{color:var(--accent);text-decoration-thickness:1px;text-underline-offset:3px}.markdown blockquote{padding-left:13px;color:var(--text-soft);border-left:2px solid var(--line-strong)}.markdown code{padding:.13em .35em;background:var(--surface-subtle);border:1px solid var(--line);border-radius:5px;font-family:var(--font-mono);font-size:.88em}.markdown pre{max-width:100%;padding:13px 15px;overflow-x:auto;color:var(--text);background:var(--rail);border:1px solid var(--line);border-radius:10px}.markdown pre code{padding:0;color:#e8eee8;background:transparent;border:0}.markdown-table{max-width:100%;margin:0 0 .85em;overflow-x:auto;overscroll-behavior-x:contain;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm)}.markdown-table:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.markdown table{width:100%;min-width:max-content;border-collapse:collapse;overflow-wrap:normal;font-size:12px}.markdown th,.markdown td{padding:7px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}.markdown thead th{color:var(--text-soft);background:var(--surface-subtle);border-bottom-color:var(--line-strong);font-weight:650;white-space:nowrap}.markdown tbody tr:nth-child(2n){background:color-mix(in srgb,var(--surface-hover) 55%,transparent)}.markdown tbody tr:last-child>*{border-bottom:0}.markdown del{color:var(--text-muted);text-decoration-thickness:1px}.markdown .contains-task-list{padding-left:0;list-style:none}.markdown .contains-task-list .contains-task-list{padding-left:1.2em}.markdown .task-list-item input[type=checkbox]{margin:0 .45em 0 0;vertical-align:-.08em;accent-color:var(--accent)}.markdown .footnotes{margin-top:1.3em;padding-top:.9em;color:var(--text-soft);border-top:1px solid var(--line);font-size:12px}.markdown .footnotes p{margin-bottom:.35em}.markdown [data-footnote-ref],.markdown .data-footnote-backref{text-decoration:none}.message-quote{max-width:100%;display:flex;gap:8px;margin:0 0 9px;padding:8px 10px;overflow:hidden;color:var(--text-muted);background:color-mix(in srgb,var(--surface) 68%,transparent);border-left:2px solid var(--accent);border-radius:7px;font-size:11px;line-height:1.45}.message-quote svg{flex:none;margin-top:1px;color:var(--accent)}.message-quote span{display:-webkit-box;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:4}.selection-toolbar{display:flex;padding:4px;color:#f8faf6;background:#242a26;border:1px solid rgba(255,255,255,.12);border-radius:9px;box-shadow:var(--shadow-lg)}.selection-toolbar-quote{height:30px;display:inline-flex;align-items:center;gap:6px;padding:0 9px;color:inherit;background:transparent;border-radius:6px;cursor:pointer;font-size:11px;font-weight:650}.selection-toolbar-quote:hover{background:#ffffff17}.message-actions{min-height:26px;display:flex;gap:4px;margin-top:5px;opacity:0;pointer-events:none;transition:opacity .1s ease}.message:hover .message-actions,.message:focus-within .message-actions,.message-actions.is-persistent{opacity:1;pointer-events:auto}.message-user .message-actions{justify-content:flex-end}.message-action{height:27px;display:inline-flex;align-items:center;gap:5px;padding:0 7px;color:var(--text-muted);background:transparent;border-radius:7px;cursor:pointer;font-size:10px}.message-action:hover{color:var(--text);background:var(--surface-subtle)}.message-action.is-success{color:var(--accent)}.message-action.is-error{color:var(--danger)}@media(hover:none),(pointer:coarse){.message-actions{opacity:1;pointer-events:auto}}.thinking-indicator{height:24px;display:inline-flex;align-items:center;gap:4px}.thinking-indicator i{width:5px;height:5px;border-radius:50%;background:var(--text-muted);animation:bounce 1.1s ease-in-out infinite}.thinking-indicator i:nth-child(2){animation-delay:.12s}.thinking-indicator i:nth-child(3){animation-delay:.24s}.message-error{display:flex;flex-direction:column;gap:3px;margin:10px 0;padding:10px 12px;color:var(--danger);background:var(--danger-soft);border:1px solid color-mix(in srgb,var(--danger) 25%,transparent);border-radius:9px;font-size:12px}.message-error strong{font-size:10px;letter-spacing:.06em;text-transform:uppercase}.reply-attachment,.mcp-app{margin:12px 0;color:var(--text-soft);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:11px;box-shadow:var(--shadow-sm)}.reply-attachment{min-height:52px;display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:8px 10px}.reply-part-icon{width:30px;height:30px;display:grid;place-items:center;flex:none;color:var(--accent);background:var(--accent-soft);border-radius:8px}.reply-part-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:2px}.reply-part-copy strong{overflow:hidden;color:var(--text);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.reply-part-copy>span{overflow:hidden;color:var(--text-muted);font-size:10px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.reply-part-action{min-height:34px;display:inline-flex;align-items:center;justify-content:center;flex:none;padding:0 10px;color:var(--accent);background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 24%,var(--line));border-radius:8px;cursor:pointer;font-size:10px;font-weight:700;text-decoration:none}.reply-part-action:hover{color:var(--on-accent);background:var(--accent-strong)}.reply-part-action:disabled{opacity:.58;cursor:wait}.reply-part-action:focus-visible,.mcp-app-confirmation button:focus-visible,.mcp-app-frame:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.reply-part-status{flex-basis:100%;margin-left:40px;color:var(--text-muted);font-size:10px;line-height:1.4}.reply-part-status.is-unavailable{color:var(--danger);font-weight:650}.reply-part-error{display:flex;flex-direction:column;gap:3px;margin:10px 0;padding:10px 12px;color:var(--danger);background:var(--danger-soft);border:1px solid color-mix(in srgb,var(--danger) 25%,transparent);border-radius:9px;font-size:11px}.reply-part-error strong{font-size:9px;letter-spacing:.06em;text-transform:uppercase}.mcp-app{--mcp-app-bleed: 0px;position:relative;overflow:clip;margin-inline:calc(-1 * var(--mcp-app-bleed));max-width:calc(100% + 2 * var(--mcp-app-bleed))}@container assistant (min-width: 816px){.mcp-app{--mcp-app-bleed: var(--column-padding, 0px)}}.mcp-app>header{min-height:55px;display:flex;align-items:center;gap:10px;padding:8px 10px}.mcp-app-status{margin:0;padding:5px 10px;color:var(--text-muted);background:var(--surface-subtle);border-top:1px solid var(--line);font-size:10px}.mcp-app-status.is-error{color:var(--danger);background:var(--danger-soft)}.mcp-app-status.is-ready{color:var(--accent)}.mcp-app-frame{width:100%;min-height:160px;max-height:1600px;display:block;background:#fff;border:0;border-top:1px solid var(--line);color-scheme:light}.mcp-app-confirmation{position:absolute;inset:0;min-height:160px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:9px;padding:18px;color:var(--text);background:color-mix(in srgb,var(--surface-raised) 96%,transparent);backdrop-filter:blur(8px);z-index:2}.mcp-app-confirmation>strong{font-size:14px}.mcp-app-confirmation>span:not(.mcp-app-confirm-actions){color:var(--text-soft);font-size:12px;line-height:1.5;overflow-wrap:anywhere}.mcp-app-confirm-preview{width:100%;max-height:150px;overflow:auto;margin:0;padding:9px 10px;color:var(--text-soft);background:var(--surface-subtle);border:1px solid var(--line);border-radius:7px;font:10px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow-wrap:anywhere}.mcp-app-confirm-actions{display:flex;align-self:stretch;justify-content:flex-end;gap:8px;margin-top:4px}.mcp-app-confirmation button{min-width:76px;min-height:38px;padding:0 11px;color:var(--text-soft);background:var(--surface-subtle);border:1px solid var(--line);border-radius:8px;cursor:pointer;font-size:11px;font-weight:650}.mcp-app-confirmation button.is-primary{color:var(--on-accent);background:var(--accent-strong);border-color:transparent}.reasoning-root{margin:5px 0 11px}.assistant-content>.activity-root:first-child{margin-top:-4px}.reasoning-trigger{min-height:32px;display:inline-flex;align-items:center;gap:7px;padding:0 7px 0 3px;color:var(--text-muted);background:transparent;border-radius:8px;cursor:pointer;font-size:11px}.reasoning-trigger:hover{color:var(--text-soft);background:var(--surface-subtle)}.reasoning-trigger[data-active=true] .reasoning-trigger-label{color:var(--accent)}.reasoning-trigger-icon{width:22px;height:22px;display:grid;place-items:center;color:var(--accent)}.reasoning-trigger[data-active=true] .reasoning-trigger-icon{animation:pulse 1.4s ease infinite}.reasoning-trigger-chevron{transition:transform .16s ease}.reasoning-trigger[data-panel-open] .reasoning-trigger-chevron{transform:rotate(90deg)}.activity-root{overflow:hidden;background:color-mix(in srgb,var(--panel) 32%,var(--surface));border:1px solid var(--line);border-radius:12px}.activity-trigger{width:100%;min-height:44px;gap:8px;padding:2px 16px 0;border-radius:0}.activity-trigger:hover{background:transparent}.activity-trigger .reasoning-trigger-label{flex:none;color:var(--text-muted);font-size:9.5px;font-weight:750;letter-spacing:.12em;text-transform:uppercase}.activity-glyph{flex:none;color:var(--accent)}.activity-glyph.is-running{animation:pulse 1.2s ease infinite}.activity-meta{min-width:0;flex:1;overflow:hidden;color:var(--text-muted);font-size:10px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.activity-chevron{flex:none;transition:transform .15s ease}.activity-trigger[data-panel-open] .activity-chevron{transform:rotate(180deg)}.reasoning-content{overflow:hidden}.reasoning-text{position:relative;max-height:256px;margin:5px 0 5px 13px;padding:4px 0 4px 16px;overflow-y:auto;color:var(--text-muted);border-left:1px solid var(--line-strong);font-size:12px;line-height:1.58}.reasoning-text-content{display:grid;grid-template-columns:minmax(0,1fr);gap:9px}.activity-content .reasoning-text{min-width:0;max-height:none;margin:0;padding:0 12px 12px;overflow-y:visible;color:inherit;border-left:0;font-size:inherit}.reasoning-part p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.reasoning-root:not(.activity-root)[data-streaming=true] .reasoning-text{mask-image:linear-gradient(to bottom,#000 70%,transparent 100%)}.activity-root .reasoning-text-content{gap:2px}.activity-note{margin:0;padding:0 2px;color:var(--text-soft);font-size:11.5px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}.context-compaction-row{min-height:33px;display:flex;align-items:center;gap:8px;padding:6px 9px;color:var(--text-soft);background:var(--surface-subtle);border:1px solid var(--line);border-radius:9px;font-size:10px;line-height:1.35}.context-compaction-status{width:7px;height:7px;flex:none;background:var(--accent);border-radius:50%}.context-compaction-row.is-running .context-compaction-status{animation:pulse 1.2s ease infinite}.context-compaction-row.is-failed .context-compaction-status,.context-compaction-row.is-interrupted .context-compaction-status{background:var(--danger)}.cron-run-row{display:flex;flex-wrap:wrap;align-items:center;gap:5px 9px;margin-top:10px;padding-top:8px;color:var(--text-muted);border-top:1px solid var(--line);font-size:9.5px;scroll-margin-top:140px}.cron-run-link{color:var(--accent);font-weight:700;text-decoration:none}.cron-run-link:hover{text-decoration:underline}.cron-run-state{color:var(--text-soft);text-transform:capitalize}.cron-run-row.is-failed .cron-run-state,.cron-run-row.is-dropped .cron-run-state{color:var(--danger)}.cron-run-row.is-skipped_overlap .cron-run-state,.cron-run-row.is-cancelled .cron-run-state{color:var(--warning)}.cron-run-row time{font-variant-numeric:tabular-nums}.cron-activity-button{padding:2px 7px;border-radius:999px;font-size:9px}.cron-activity-truncated{flex-basis:100%;color:var(--warning);line-height:1.35}.cron-artifact-link{min-width:0;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cron-artifact-link code{font-family:var(--font-mono);font-size:9px}.cron-session-button{display:inline-flex;align-items:center;gap:4px;padding:2px 5px;color:var(--text-muted);background:transparent;border-radius:5px;cursor:pointer;font-size:9.5px}.cron-session-button:hover{color:var(--accent);background:var(--accent-soft)}.context-compaction-row.is-skipped .context-compaction-status{background:var(--text-muted)}.context-compaction-label{color:var(--text-soft);font-weight:650}.context-compaction-trigger{color:var(--text-muted)}.context-compaction-counts{margin-left:auto;color:var(--text-muted);font-family:var(--font-mono);white-space:nowrap}.tool-status{width:7px;height:7px;flex:none;border-radius:50%;background:var(--accent)}.tool-status.is-running{animation:pulse 1.2s ease infinite}.ask-user-card{display:grid;gap:14px;padding:16px;color:var(--text);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:var(--radius-md);box-shadow:var(--shadow-sm)}.ask-user-heading{display:flex;align-items:center;gap:9px;font-size:13px}.ask-user-context{max-height:280px;overflow:auto;padding:12px;white-space:pre-wrap;color:var(--text-soft);background:var(--surface-subtle);border-radius:var(--radius-sm);font-size:12px;line-height:1.55}.ask-user-card form{display:grid;gap:16px}.ask-user-card fieldset{display:grid;gap:10px;min-width:0;margin:0;padding:0 0 16px;border:0;border-bottom:1px solid var(--line)}.ask-user-card fieldset:last-of-type{padding-bottom:0;border-bottom:0}.ask-user-card legend{display:grid;gap:4px;width:100%;padding:0;font-size:13px;font-weight:650;line-height:1.45}.ask-user-card legend span{color:var(--accent);font-size:10px;font-weight:750;letter-spacing:.08em;text-transform:uppercase}.ask-user-options{display:grid;gap:7px}.ask-user-option{display:grid;grid-template-columns:18px minmax(0,1fr);gap:9px;align-items:start;padding:10px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer}.ask-user-option:hover,.ask-user-option.is-selected{border-color:var(--accent);background:var(--accent-soft)}.ask-user-option input{margin:3px 0 0;accent-color:var(--accent)}.ask-user-option span{display:grid;gap:2px}.ask-user-option strong{font-size:12px}.ask-user-option small{color:var(--text-soft);font-size:11px;line-height:1.45}.ask-user-other{display:grid;gap:6px;color:var(--text-soft);font-size:11px}.ask-user-other textarea{width:100%;resize:vertical;padding:9px 10px;color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);line-height:1.45}.ask-user-submit{justify-self:end;min-height:36px;padding:0 14px;color:var(--on-accent);background:var(--accent);border-radius:var(--radius-sm);cursor:pointer;font-size:12px;font-weight:700}.ask-user-submit:hover:not(:disabled){background:var(--accent-strong)}.ask-user-loading,.ask-user-complete,.ask-user-error{margin:0;color:var(--text-soft);font-size:12px}.ask-user-complete{display:grid;gap:4px}.ask-user-complete>p{margin:0}.ask-user-summary{display:grid;gap:2px;margin:0;padding:0;color:var(--text);list-style:none}.ask-user-summary-line{margin:0;color:var(--text);line-height:1.45;overflow-wrap:anywhere;white-space:pre-wrap}.ask-user-error{color:var(--danger)}.ask-user-result{max-width:100%;overflow:auto;margin:0;font:11px/1.5 var(--font-mono)}.message-attachments,.composer-attachments{display:flex;flex-wrap:wrap;gap:7px}.message-attachments{justify-content:flex-end;margin-bottom:8px}.composer-attachments{max-height:108px;margin-bottom:6px;overflow-y:auto}.composer-attachments:empty,.message-attachments:empty{display:none}.attachment-chip{position:relative;min-width:0;max-width:250px;height:34px;display:flex;align-items:center;gap:7px;padding:0 8px;overflow:hidden;color:var(--text-soft);background:var(--surface-raised);border:1px solid var(--line);border-radius:9px;font-size:11px}.attachment-chip.is-error{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 40%,var(--line))}.attachment-icon{width:20px;height:20px;display:grid;place-items:center;flex:none;color:var(--accent);background:var(--accent-soft);border-radius:6px}.attachment-icon img{width:100%;height:100%;display:block;object-fit:cover;border-radius:6px}.attachment-link{min-width:0;display:flex;align-items:center;gap:7px;flex:1;color:inherit;text-decoration:none}.attachment-link:hover .attachment-name{color:var(--accent);text-decoration:underline;text-underline-offset:2px}.attachment-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-progress{position:absolute;left:0;bottom:0;width:var(--upload-progress);height:2px;background:var(--accent);transition:width .12s linear}.attachment-error{flex:none;font-size:9px}.attachment-remove{width:24px;height:24px;margin-left:1px}.composer-root{position:relative;width:min(100%,820px);margin:0 auto;background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:16px;box-shadow:0 10px 32px #19231d12,var(--shadow-sm);transition:border-color .15s ease,box-shadow .15s ease}.composer-root:focus-within{border-color:color-mix(in srgb,var(--accent) 65%,var(--line));box-shadow:0 0 0 3px var(--accent-glow),0 12px 36px #19231d12}.composer-quote{min-height:38px;display:flex;align-items:center;gap:8px;margin:9px 9px 0;padding:7px 8px 7px 10px;color:var(--text-muted);background:var(--surface-subtle);border-left:2px solid var(--accent);border-radius:7px;font-size:11px}.composer-quote>svg{flex:none;color:var(--accent)}.composer-quote-text{min-width:0;display:block;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.composer-quote-dismiss{width:26px;height:26px;display:grid;place-items:center;flex:none;color:var(--text-muted);background:transparent;border-radius:6px;cursor:pointer}.composer-quote-dismiss:hover{color:var(--text);background:var(--surface-raised)}.composer-dropzone{padding:10px 10px 8px;border-radius:15px}.composer-dropzone[data-dragging=true]{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent)}.composer-input-row{min-height:37px;display:flex}.composer-input{width:100%;max-height:180px;min-height:37px;resize:none;padding:7px 5px;color:var(--text);background:transparent;border:0;outline:0;font-size:14px;line-height:1.55}.composer-input::placeholder{color:var(--text-muted)}.composer-toolbar{min-height:34px;display:flex;align-items:center;justify-content:space-between;gap:10px}.composer-tools{min-width:0;display:flex;align-items:center;gap:5px}.composer-tool{width:32px;height:32px}.composer-hint{overflow:hidden;color:var(--text-muted);font-size:9.5px;text-overflow:ellipsis;white-space:nowrap}.composer-actions{display:flex;align-items:center;gap:6px}.composer-trigger-popover{position:absolute;left:9px;bottom:calc(100% + 9px);width:min(320px,calc(100vw - 24px));padding:5px;color:var(--text);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:12px;box-shadow:var(--shadow-lg);z-index:12}.composer-trigger-list{max-height:min(310px,48dvh);overflow-y:auto;overscroll-behavior:contain}.composer-trigger-item{width:100%;min-height:49px;display:flex;align-items:center;gap:10px;padding:6px 8px;color:var(--text-soft);background:transparent;border-radius:9px;cursor:pointer;outline:0;text-align:left}.composer-trigger-item[aria-selected=true],.composer-trigger-item:hover{color:var(--text);background:var(--surface-subtle)}.composer-trigger-item-icon{width:30px;height:30px;display:grid;place-items:center;flex:none;color:var(--accent);background:var(--accent-soft);border-radius:8px}.composer-trigger-item-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:2px}.composer-trigger-item-copy strong{font-size:11.5px;font-weight:680}.composer-trigger-item-copy small{overflow:hidden;color:var(--text-muted);font-size:9.5px;text-overflow:ellipsis;white-space:nowrap}.composer-trigger-empty{padding:20px 12px;color:var(--text-muted);text-align:center;font-size:11px}.skill-result{gap:8px}.skill-status{flex:none;padding:3px 6px;color:var(--text-muted);background:var(--surface-subtle);border:1px solid var(--line);border-radius:999px;font-size:8.5px;font-weight:650;letter-spacing:.02em;white-space:nowrap}.skill-status[data-availability=inlined]{color:var(--success)}.skill-status[data-availability=on-demand]{color:var(--accent)}.skill-browser-backdrop{position:fixed;inset:0;background:#070a086b;backdrop-filter:blur(6px);z-index:100}.skill-browser-popup{position:fixed;left:50%;top:50%;width:min(560px,calc(100vw - 32px));max-height:min(680px,calc(100dvh - 48px));display:flex;flex-direction:column;overflow:hidden;color:var(--text);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:16px;box-shadow:var(--shadow-lg);outline:0;transform:translate(-50%,-50%);z-index:101}.skill-browser-header{min-height:68px;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:14px 14px 11px 16px;border-bottom:1px solid var(--line)}.skill-browser-header>span{min-width:0}.skill-browser-header h2{margin:0 0 4px;font-size:15px}.skill-browser-header p{margin:0;color:var(--text-muted);font-size:10.5px;line-height:1.45}.skill-browser-command{min-height:0;display:flex;flex:1;flex-direction:column}.skill-browser-search{height:50px;display:flex;align-items:center;gap:9px;flex:none;padding:0 15px;color:var(--text-muted);border-bottom:1px solid var(--line)}.skill-browser-search input{min-width:0;height:100%;flex:1;color:var(--text);background:transparent;border:0;outline:0;font-size:13px}.skill-browser-notice{margin:0;padding:9px 15px;color:var(--text-muted);background:var(--surface-subtle);border-bottom:1px solid var(--line);font-size:10px;line-height:1.45}.skill-browser-list{min-height:90px;max-height:min(520px,calc(100dvh - 190px));padding:7px;overflow-y:auto;overscroll-behavior:contain}.skill-browser-item{width:100%;min-height:56px;display:flex;align-items:center;gap:10px;padding:7px 9px;color:var(--text-soft);background:transparent;border-radius:9px;cursor:pointer;outline:0;text-align:left}.skill-browser-item[data-selected=true]:not([data-disabled=true]),.skill-browser-item:hover:not([data-disabled=true]){color:var(--text);background:var(--surface-subtle)}.skill-browser-item[data-disabled=true]{cursor:not-allowed;opacity:.58}.skill-browser-item-icon{width:30px;height:30px;display:grid;place-items:center;flex:none;color:var(--accent);background:var(--accent-soft);border-radius:8px}.skill-browser-item-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:3px}.skill-browser-item-copy strong{font-size:11.5px}.skill-browser-item-copy small{display:-webkit-box;overflow:hidden;color:var(--text-muted);font-size:9.5px;line-height:1.4;-webkit-box-orient:vertical;-webkit-line-clamp:2}.skill-browser-empty{padding:34px 16px;color:var(--text-muted);text-align:center;font-size:11px}.composer-send{width:34px;height:34px;display:grid;place-items:center;flex:none;padding:0;color:var(--on-accent);background:var(--accent-strong);border-radius:10px;cursor:pointer}.composer-send:hover:not(:disabled){filter:brightness(1.06);transform:translateY(-1px)}.composer-stop{min-width:70px;height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 10px;color:var(--text);background:var(--surface-subtle);border:1px solid var(--line);border-radius:10px;cursor:pointer;font-size:11px}.archived-footer{width:min(100%,820px);min-height:52px;display:flex;align-items:center;justify-content:center;gap:10px;margin:0 auto;padding:10px 16px;color:var(--text-muted);background:var(--surface-subtle);border:1px solid var(--line);border-radius:12px;font-size:12px}.archived-footer button{color:var(--accent);background:transparent;cursor:pointer;font-weight:650}.cron-readonly-footer{width:min(100%,820px);min-height:48px;display:flex;align-items:center;justify-content:center;margin:0 auto;padding:10px 16px;color:var(--text-muted);background:var(--surface-subtle);border:1px solid var(--line);border-radius:12px;font-size:11px;text-align:center}.chat-empty{min-height:420px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:44px 20px;text-align:center}.empty-orbit{position:relative;width:60px;height:60px;display:grid;place-items:center;margin-bottom:23px;color:var(--accent);background:var(--accent-soft);border-radius:20px}.empty-orbit:before{content:"";position:absolute;inset:-9px;border:1px solid color-mix(in srgb,var(--accent) 20%,transparent);border-radius:25px;transform:rotate(12deg)}.empty-orbit span{position:absolute;right:-6px;top:8px;width:7px;height:7px;border-radius:50%;background:var(--warning);box-shadow:0 0 0 4px color-mix(in srgb,var(--warning) 12%,transparent)}.chat-empty h2{max-width:520px;margin:3px 0 9px;color:var(--text);font-size:clamp(22px,3vw,31px);line-height:1.18;letter-spacing:-.025em}.chat-empty p{max-width:500px;margin:0 0 20px;color:var(--text-muted);font-size:13px;line-height:1.55}.initial-state,.fatal-state{width:100%;height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;background:var(--surface);text-align:center}.initial-state .brand-mark,.fatal-state .brand-mark{width:38px;height:38px;margin-bottom:25px;transform:scale(1.35);filter:drop-shadow(0 5px 15px var(--accent-glow))}.initial-state>span:last-child{margin-top:11px;color:var(--text-muted);font-size:11px;letter-spacing:.08em;text-transform:uppercase}.initial-loader{display:flex;gap:5px}.initial-loader span{width:5px;height:5px;border-radius:50%;background:var(--accent);animation:bounce 1.1s ease infinite}.initial-loader span:nth-child(2){animation-delay:.12s}.initial-loader span:nth-child(3){animation-delay:.24s}.fatal-state h1{max-width:600px;margin:7px 0 10px;font-size:clamp(24px,4vw,38px);letter-spacing:-.03em}.fatal-state p{max-width:580px;margin:0 0 22px;color:var(--text-muted);line-height:1.6}.fatal-state small{max-width:560px;margin-top:18px;color:var(--text-muted);font-size:11px}.fatal-state code{padding:2px 5px;color:var(--text-soft);background:var(--surface-subtle);border-radius:4px;font-family:var(--font-mono)}.dialog-layer{position:fixed;inset:0;display:flex;align-items:flex-start;justify-content:center;padding:min(15vh,130px) 16px 16px;background:#070a086b;backdrop-filter:blur(6px);z-index:100}.command-palette{width:min(100%,560px);overflow:hidden;color:var(--text);background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:16px;box-shadow:var(--shadow-lg)}.palette-search{height:56px;display:flex;align-items:center;gap:10px;padding:0 14px;color:var(--text-muted);border-bottom:1px solid var(--line)}.palette-search input{min-width:0;flex:1;height:100%;color:var(--text);background:transparent;border:0;outline:0;font-size:14px}kbd{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 5px;color:var(--text-muted);background:var(--surface-subtle);border:1px solid var(--line);border-radius:5px;box-shadow:0 1px 0 var(--line-strong);font-family:var(--font-mono);font-size:9px}.palette-results{max-height:min(48vh,390px);padding:7px;overflow-y:auto}.palette-results button{width:100%;min-height:44px;display:flex;align-items:center;gap:10px;padding:6px 9px;color:var(--text-soft);background:transparent;border-radius:9px;cursor:pointer;text-align:left;font-size:12px}.palette-results button:hover,.palette-results button[aria-selected=true]{color:var(--text);background:var(--surface-subtle)}.palette-results button>span:nth-child(2){min-width:0;flex:1}.palette-icon{width:28px;height:28px;display:grid;place-items:center;flex:none;color:var(--accent);background:var(--accent-soft);border-radius:7px}.palette-results p{margin:30px;color:var(--text-muted);text-align:center;font-size:12px}.command-palette footer{min-height:40px;display:flex;align-items:center;justify-content:flex-end;gap:14px;padding:0 13px;color:var(--text-muted);background:var(--surface-subtle);border-top:1px solid var(--line);font-size:9px}.command-palette footer span{display:inline-flex;align-items:center;gap:4px}.toast{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));max-width:min(420px,calc(100vw - 36px));min-height:48px;display:flex;align-items:center;gap:12px;padding:9px 9px 9px 14px;color:#f8faf6;background:#242a26;border:1px solid rgba(255,255,255,.1);border-radius:11px;box-shadow:var(--shadow-lg);font-size:12px;line-height:1.4;z-index:120}.toast span{min-width:0;flex:1}.toast button{width:30px;height:30px;display:grid;place-items:center;flex:none;color:#b8c0b9;background:transparent;border-radius:7px;cursor:pointer}.toast button:hover{color:#fff;background:#ffffff14}.activity-row{min-width:0;border-radius:9px}.activity-row>summary{min-height:38px;display:flex;align-items:center;gap:8px;padding:0 8px;border-radius:9px;cursor:pointer;list-style:none}.activity-row>summary::-webkit-details-marker{display:none}.activity-row-glyph{width:18px;display:grid;place-items:center;flex:none}.activity-dot{width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}.activity-row.is-running .activity-dot{background:var(--warning);box-shadow:0 0 0 3px color-mix(in srgb,var(--warning) 12%,transparent);animation:pulse 1.2s ease infinite}.activity-row.is-failed .activity-dot{background:var(--danger);box-shadow:0 0 0 3px color-mix(in srgb,var(--danger) 12%,transparent)}.activity-row.is-thinking .activity-row-glyph{color:var(--text-muted)}.activity-row.is-subagent .activity-row-glyph{color:var(--cat-4)}.activity-row.is-subagent.is-running .activity-row-glyph{color:var(--warning)}.activity-row.is-subagent.is-failed .activity-row-glyph{color:var(--danger)}.activity-row-label{flex:none;color:var(--text);font-size:11.5px;font-weight:650;white-space:nowrap}.activity-row-summary{min-width:0;flex:1;overflow:hidden;color:var(--text-muted);font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.activity-row-time{min-width:0;flex:0 1 auto;overflow:hidden;color:var(--text-muted);font-family:var(--font-mono);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.activity-row-chevron{flex:none;color:var(--text-muted);transition:transform .15s ease}.activity-row[open]>summary .activity-row-chevron{transform:rotate(180deg)}.failed-tag{flex:none;padding:2px 6px;color:var(--danger);background:color-mix(in srgb,var(--danger) 10%,transparent);border-radius:5px;font-size:8.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap}.activity-steps{min-width:0;margin:0 2px 6px 16px;padding-left:10px;border-left:1px solid var(--line)}.activity-step{min-width:0;border-radius:8px}.activity-step>summary{min-height:34px;display:grid;grid-template-columns:minmax(0,auto) minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:0 8px;border-radius:8px;cursor:pointer;list-style:none}.activity-step>summary::-webkit-details-marker{display:none}.activity-step-tool{min-width:0;overflow:hidden;color:var(--text-soft);font-family:var(--font-mono);font-size:10.5px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.activity-step-summary{min-width:0;overflow:hidden;color:var(--text-muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}.activity-step-time{color:var(--text-muted);font-family:var(--font-mono);font-size:9px;white-space:nowrap}.subagent-empty{margin:0;padding:4px 8px;color:var(--text-muted);font-size:10px}.activity-payload{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:7px;padding:2px 8px 10px}.activity-payload.is-indented{padding-left:34px}.activity-payload>span{color:var(--text-muted);font-size:8.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.activity-payload pre{min-width:0;max-width:100%;max-height:280px;margin:0;padding:8px 9px;overflow:auto;overscroll-behavior:contain;color:var(--text-soft);background:color-mix(in srgb,var(--app-bg) 60%,var(--surface));border:1px solid var(--line);border-radius:8px;font-family:var(--font-mono);font-size:10px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text}.activity-error{min-width:0;display:flex;align-items:center;gap:6px;overflow-wrap:anywhere;margin:0;padding:7px 9px;color:var(--danger);background:color-mix(in srgb,var(--danger) 8%,transparent);border:1px solid color-mix(in srgb,var(--danger) 25%,transparent);border-radius:8px;font-size:10.5px;line-height:1.45;user-select:text}.activity-thought{padding:2px 12px 12px 34px;color:var(--text-muted);font-size:12px;line-height:1.6;overflow-wrap:anywhere}@media(hover:hover){.activity-row>summary:hover,.activity-step>summary:hover{background:var(--surface-subtle)}}@media(hover:none),(pointer:coarse){.activity-row>summary{min-height:44px}.activity-step>summary{min-height:40px}}.image-row{display:flex;gap:6px;margin:10px 0;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}.image-row:empty{display:none}.image-tile{height:190px;aspect-ratio:4 / 3;flex:none;min-width:0;padding:0;overflow:hidden;background:var(--surface-subtle);border:1px solid var(--line);border-radius:12px;cursor:pointer}.image-tile img{width:100%;height:100%;display:block;object-fit:cover}.image-row>.reply-attachment{flex:1 1 100%;margin:0}@media(hover:hover){.image-tile:hover{border-color:var(--accent)}}.image-tile:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.lightbox-backdrop{position:fixed;inset:0;z-index:100;background:#070a08d1;backdrop-filter:blur(6px)}.lightbox-popup{position:fixed;inset:0;z-index:101;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px 32px 32px}.lightbox-image{max-width:calc(100vw - 64px);max-height:calc(100dvh - 96px);object-fit:contain;border-radius:10px}.lightbox-bar{display:flex;align-items:center;gap:6px;max-width:100%;padding:6px 8px;color:var(--text-soft);background:var(--surface);border:1px solid var(--line);border-radius:11px}.lightbox-name{min-width:0;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.lightbox-count{flex:none;color:var(--text-muted);font-family:var(--font-mono);font-size:10px;white-space:nowrap}@media(max-width:560px){.lightbox-popup{padding:12px}.lightbox-image{max-width:calc(100vw - 24px)}.image-tile{height:150px}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.38}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes bounce{0%,60%,to{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}@media(max-width:1100px){.model-selector__trigger{max-width:210px}.cron-channel-header{align-items:flex-start;flex-direction:column;gap:8px}.cron-channel-facts{width:100%;grid-template-columns:repeat(6,minmax(0,1fr))}.cron-channel-actions{width:100%;justify-content:flex-start;margin-left:0}}@media(max-width:1100px)and (min-width:901px){.app-shell{grid-template-columns:var(--agent-rail-width, 72px) 270px minmax(0,1fr)}.message-column{--column-padding: 24px}.composer-hint{display:none}}@media(max-width:900px){.app-shell{grid-template-columns:minmax(0,1fr)}.desktop-agent-rail,.desktop-thread-sidebar{display:none}.mobile-navigation{display:flex;align-items:center;gap:2px;margin-left:-6px}.chat-header{min-height:58px;gap:8px;padding-block:max(7px,env(safe-area-inset-top)) 7px}.conversation-title{max-width:min(42vw,340px)}.chat-status{display:none}.header-archive{display:inline-flex}.message-column{--column-padding: 18px;padding-block:28px 16px}.thread-footer{padding-inline:max(14px,env(safe-area-inset-left)) max(14px,env(safe-area-inset-right))}.mobile-agent-drawer,.mobile-thread-drawer{position:fixed;top:0;bottom:0;display:block;opacity:0;visibility:hidden;transition:transform .18s ease,opacity .18s ease,visibility .18s;z-index:40}.mobile-agent-drawer{left:0;width:min(310px,calc(100vw - 44px));transform:translate(-100%)}.mobile-thread-drawer{left:0;width:min(340px,calc(100vw - 36px));transform:translate(-110%)}.mobile-agent-drawer.is-open,.mobile-thread-drawer.is-open{opacity:1;visibility:visible;transform:translate(0)}.drawer-scrim{position:fixed;inset:0;display:block;width:100%;height:100%;padding:0;background:#070a0875;backdrop-filter:blur(3px);z-index:35}.mobile-thread-drawer .thread-sidebar{box-shadow:var(--shadow-lg)}.mobile-thread-drawer .thread-action{opacity:1}}@media(max-width:560px){.chat-header{flex-wrap:wrap;align-content:center;padding-left:max(9px,env(safe-area-inset-left));padding-right:max(9px,env(safe-area-inset-right));padding-bottom:8px}.mobile-navigation{order:1}.mobile-navigation .icon-button{width:36px;height:38px}.chat-title-block{order:2;flex:1;gap:0}.conversation-title{max-width:calc(100vw - 118px);min-width:64px;padding-inline:2px;font-size:13px}.title-input{width:calc(100vw - 118px);min-width:84px}.chat-header-actions{width:100%;order:3;gap:5px}.model-controls{min-width:0;flex:1;gap:3px}.model-selector__trigger{min-width:0;max-width:none;flex:1}.model-selector__backdrop{position:fixed;inset:0;display:block;background:#070a087a;backdrop-filter:blur(4px);z-index:110}.model-selector__positioner{position:fixed!important;inset:auto 0 0!important;width:100%;transform:none!important}.model-selector__content{width:100%;max-height:78dvh;padding-bottom:env(safe-area-inset-bottom);border-right:0;border-bottom:0;border-left:0;border-radius:20px 20px 0 0}.model-selector__search-wrapper{min-height:54px;padding-inline:16px}.model-selector__search{height:53px;font-size:16px}.model-selector__list{max-height:48dvh;padding:8px}.model-selector__item{min-height:58px;padding-inline:11px}.model-selector__item-name{font-size:13px}.model-selector__effort{padding:12px 14px 14px}.model-selector__effort-option{min-height:38px;padding-inline:12px;font-size:11px}.message-column{--column-padding: 12px;padding-block:24px 8px}.message{margin-bottom:23px}.message-user-content{max-width:88%;padding:9px 12px}.assistant-content>.activity-root:first-child{margin-top:-6px}.reply-attachment{align-items:flex-start;flex-wrap:wrap}.reply-attachment .reply-part-action{min-height:42px;margin-left:40px}.mcp-app>header{align-items:flex-start;flex-wrap:wrap}.mcp-app>header .reply-part-action{min-height:42px;margin-left:40px}.mcp-app-frame{max-height:70dvh}.mcp-app-confirmation{padding:14px}.mcp-app-confirmation button{min-height:44px}.markdown{font-size:13.5px;line-height:1.62}.markdown table{font-size:11.5px}.markdown th,.markdown td{padding:6px 8px}.reasoning-text{margin-left:4px;padding-left:11px}.activity-root .reasoning-text{max-height:none;overflow-y:visible}.thread-footer{padding:24px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}.composer-root{border-radius:14px}.composer-dropzone{padding:8px 8px 6px}.composer-hint{display:none}.composer-input{font-size:16px}.skill-browser-popup{inset:auto 0 0;width:100%;max-height:min(78dvh,680px);border-right:0;border-bottom:0;border-left:0;border-radius:16px 16px 0 0;transform:none}.skill-browser-list{max-height:calc(78dvh - 150px);padding-bottom:max(8px,env(safe-area-inset-bottom))}.chat-empty{min-height:330px;padding:32px 10px}.chat-empty h2{font-size:23px}.connection-banner{font-size:10px}.cron-channel-header{padding:9px max(9px,env(safe-area-inset-right)) 9px max(9px,env(safe-area-inset-left))}.cron-channel-facts{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:7px}.cron-channel-actions{flex-wrap:wrap}.cron-channel-actions>button{flex:1 1 auto}.cron-session-link{width:100%;max-width:none}.cron-dialog{max-height:calc(100dvh - 24px);padding:15px;border-radius:13px}.cron-config-fields>div{grid-template-columns:1fr;gap:3px}.cron-run-row{align-items:flex-start;flex-direction:column}.dialog-layer{padding:max(12px,env(safe-area-inset-top)) 8px 8px;align-items:flex-start}.command-palette{border-radius:13px}.command-palette footer{display:none}.toast{right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));max-width:calc(100vw - 16px)}}@media(max-width:420px){.chat-header-actions{justify-content:flex-end}}@media(max-width:360px){.message-column{--column-padding: 9px}.mobile-thread-drawer{width:calc(100vw - 28px);left:0}.mobile-agent-drawer{width:calc(100vw - 36px)}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:1ms!important;animation-iteration-count:1!important;transition-duration:1ms!important}}
|