!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a08eb6-304c-7b33-995b-cd68c12237f2")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,492009,e=>{"use strict";var t=e.i(270401);let n=t.forwardRef(function({title:e,titleId:n,...r},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"}))});e.s(["VideoCameraIcon",0,n],492009)},634061,e=>{"use strict";let t=(0,e.i(202913).default)("expand",[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]]);e.s(["Expand",0,t],634061)},145891,e=>{"use strict";let t=(0,e.i(202913).default)("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);e.s(["Pause",0,t],145891)},130868,e=>{"use strict";var t=e.i(222666),n=e.i(505962),r=e.i(452473),a=e.i(201459),i=e.i(145891),s=e.i(197070),l=e.i(270401),o=e.i(528164);let c=(0,l.createContext)(null),d=(0,l.createContext)(null);function u(){return(0,l.useContext)(c)}function m(){return(0,l.useContext)(d)}function h({audioProps:e,children:n,src:r}){let a=(0,l.useRef)(null),i=(0,l.useRef)(null),[s,o]=(0,l.useState)(),[u,m]=(0,l.useState)(null),[x,v]=(0,l.useState)(0),[p,f]=(0,l.useState)(!0),[g,y]=(0,l.useState)(0),[b,j]=(0,l.useState)(0),w=(0,l.useCallback)(async()=>{let e=a.current;if(!e)return;if(i.current)try{await i.current}catch{}finally{i.current=null}let t=e.play();i.current=t;try{await t}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;throw e}finally{i.current=null}},[]),N=(0,l.useCallback)(()=>{a.current?.pause()},[]),k=(0,l.useCallback)(e=>{let t=a.current;if(!t||void 0===s||!Number.isFinite(s))return;let n=Math.max(0,Math.min(e,s));t.currentTime=n,j(n)},[s]);(0,l.useEffect)(()=>{let e=a.current;e&&(o(void 0),m(null),v(e.networkState),f(!0),y(e.readyState),j(0),e.load())},[r]),(0,l.useEffect)(()=>{let e=a.current;if(!e)return;let t=()=>{v(e.networkState),y(e.readyState)},n=()=>{o(e.duration)},r=()=>{m(e.error)},i=()=>{f(!0)},s=()=>{f(!1)},l=()=>{j(e.currentTime)};return e.addEventListener("canplay",t),e.addEventListener("durationchange",n),e.addEventListener("ended",i),e.addEventListener("error",r),e.addEventListener("loadedmetadata",n),e.addEventListener("loadstart",t),e.addEventListener("pause",i),e.addEventListener("play",s),e.addEventListener("playing",t),e.addEventListener("timeupdate",l),e.addEventListener("waiting",t),()=>{e.removeEventListener("canplay",t),e.removeEventListener("durationchange",n),e.removeEventListener("ended",i),e.removeEventListener("error",r),e.removeEventListener("loadedmetadata",n),e.removeEventListener("loadstart",t),e.removeEventListener("pause",i),e.removeEventListener("play",s),e.removeEventListener("playing",t),e.removeEventListener("timeupdate",l),e.removeEventListener("waiting",t)}},[]);let E=!p,L=g<3&&2===x,z=(0,l.useMemo)(()=>({duration:s,error:u,isBuffering:L,isPlaying:E,pause:N,play:w,ref:a,seek:k}),[s,u,L,E,N,w,k]);return(0,t.jsx)(c.Provider,{value:z,children:(0,t.jsxs)(d.Provider,{value:b,children:[(0,t.jsx)("audio",{ref:a,src:r,className:"hidden",preload:"metadata",...e}),n]})})}function x(e){let l,c,d,m,h,x,v,p,f,g,y,b,j=(0,n.c)(30);j[0]!==e?({children:l,className:c,isLoading:d,size:h,type:x,variant:v,...m}=e,j[0]=e,j[1]=l,j[2]=c,j[3]=d,j[4]=m,j[5]=h,j[6]=x,j[7]=v):(l=j[1],c=j[2],d=j[3],m=j[4],h=j[5],x=j[6],v=j[7]);let w=void 0===h?"icon":h,N=void 0===x?"button":x,k=void 0===v?"outline":v,E=u();if(!E)return null;let L=d??E.isBuffering;j[8]!==E.isPlaying?(p=E.isPlaying?(0,t.jsx)(i.Pause,{}):(0,t.jsx)(s.Play,{}),j[8]=E.isPlaying,j[9]=p):p=j[9];let z=p,P=L||void 0,A=E.isPlaying?"Pause audio":"Play audio";j[10]!==c?(f=(0,r.cn)("shrink-0 rounded-full",c),j[10]=c,j[11]=f):f=j[11];let S=!0===d;return j[12]!==E?(g=()=>{E.isPlaying?E.pause():E.play()},j[12]=E,j[13]=g):g=j[13],j[14]!==l||j[15]!==z||j[16]!==L||j[17]!==d?(y=L&&!0!==d?(0,t.jsx)(a.Loader2,{className:"animate-spin"}):l??z,j[14]=l,j[15]=z,j[16]=L,j[17]=d,j[18]=y):y=j[18],j[19]!==m||j[20]!==w||j[21]!==y||j[22]!==P||j[23]!==A||j[24]!==f||j[25]!==S||j[26]!==g||j[27]!==N||j[28]!==k?(b=(0,t.jsx)(o.Button,{"aria-busy":P,"aria-label":A,className:f,isLoading:S,onClick:g,size:w,type:N,variant:k,...m,children:y}),j[19]=m,j[20]=w,j[21]=y,j[22]=P,j[23]=A,j[24]=f,j[25]=S,j[26]=g,j[27]=N,j[28]=k,j[29]=b):b=j[29],b}function v(e){let a,i,s,o,c,d,h,x,v,f,g,y,b,j,w,N,k,E,L,z,P,A,S,C=(0,n.c)(55);C[0]!==e?({"aria-label":x,className:a,disabled:i,onPointerCancel:s,onPointerDown:o,onPointerUp:c,onValueChange:d,step:v,...h}=e,C[0]=e,C[1]=a,C[2]=i,C[3]=s,C[4]=o,C[5]=c,C[6]=d,C[7]=h,C[8]=x,C[9]=v):(a=C[1],i=C[2],s=C[3],o=C[4],c=C[5],d=C[6],h=C[7],x=C[8],v=C[9]);let D=void 0===x?"Seek audio":x,T=void 0===v?.25:v,_=u(),I=m(),M=(0,l.useRef)(!1),[R,B]=(0,l.useState)(!1),[F,$]=(0,l.useState)(null);if(!_||null===I)return null;let{duration:O}=_;C[10]!==O?(f=void 0!==O&&Number.isFinite(O)&&O>0,C[10]=O,C[11]=f):f=C[11];let V=f,K=R&&null!==F?F:I,U=V?Math.min(100,Math.max(0,K/O*100)):0,H=i||!V;C[12]!==_?(g=()=>{B(!1),$(null),M.current&&_.play().catch(p)},C[12]=_,C[13]=g):g=C[13];let W=g;C[14]!==W||C[15]!==c?(y=e=>{W(),c?.(e)},C[14]=W,C[15]=c,C[16]=y):y=C[16];let q=y;C[17]!==W||C[18]!==s?(b=e=>{W(),s?.(e)},C[17]=W,C[18]=s,C[19]=b):b=C[19];let X=b;C[20]!==a?(j=(0,r.cn)("group/audio-progress relative flex h-4 min-w-20 flex-1 items-center",a),C[20]=a,C[21]=j):j=C[21],C[22]===Symbol.for("react.memo_cache_sentinel")?(w=(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 h-1 rounded-full bg-secondary"}),C[22]=w):w=C[22];let Z=`${U}%`;C[23]!==Z?(N=(0,t.jsx)("div",{className:"pointer-events-none absolute left-0 h-1 rounded-full bg-primary","data-allow-inline-style":!0,style:{width:Z}}),C[23]=Z,C[24]=N):N=C[24];let G=!H&&"group-hover/audio-progress:opacity-100",J=!H&&R&&"opacity-100";C[25]!==G||C[26]!==J?(k=(0,r.cn)("pointer-events-none absolute size-3 rounded-full bg-foreground opacity-0 shadow-sm transition-opacity",G,J),C[25]=G,C[26]=J,C[27]=k):k=C[27];let Q=`calc(${U}% - 0.375rem)`;C[28]!==Q?(E={left:Q},C[28]=Q,C[29]=E):E=C[29],C[30]!==k||C[31]!==E?(L=(0,t.jsx)("span",{className:k,"data-allow-inline-style":!0,style:E}),C[30]=k,C[31]=E,C[32]=L):L=C[32];let Y=V?O:0;return C[33]!==d||C[34]!==_?(z=e=>{let t=e.currentTarget.valueAsNumber;$(t),_.seek(t),d?.(t)},C[33]=d,C[34]=_,C[35]=z):z=C[35],C[36]!==o||C[37]!==_?(P=e=>{M.current=_.isPlaying,B(!0),_.pause(),o?.(e)},C[36]=o,C[37]=_,C[38]=P):P=C[38],C[39]!==D||C[40]!==K||C[41]!==X||C[42]!==q||C[43]!==H||C[44]!==h||C[45]!==T||C[46]!==Y||C[47]!==z||C[48]!==P?(A=(0,t.jsx)("input",{"aria-label":D,className:"absolute inset-0 h-full w-full cursor-pointer appearance-none bg-transparent opacity-0 disabled:cursor-not-allowed",disabled:H,max:Y,min:0,onChange:z,onPointerDown:P,onPointerUp:q,onPointerCancel:X,step:T,type:"range",value:K,...h}),C[39]=D,C[40]=K,C[41]=X,C[42]=q,C[43]=H,C[44]=h,C[45]=T,C[46]=Y,C[47]=z,C[48]=P,C[49]=A):A=C[49],C[50]!==N||C[51]!==L||C[52]!==A||C[53]!==j?(S=(0,t.jsxs)("div",{className:j,children:[w,N,L,A]}),C[50]=N,C[51]=L,C[52]=A,C[53]=j,C[54]=S):S=C[54],S}function p(){}function f(e){let a,i,s,l,o,c=(0,n.c)(11);c[0]!==e?({className:a,...i}=e,c[0]=e,c[1]=a,c[2]=i):(a=c[1],i=c[2]);let d=m();return null===d?null:(c[3]!==a?(s=(0,r.cn)("w-10 text-overline tabular-nums text-muted-foreground",a),c[3]=a,c[4]=s):s=c[4],c[5]!==d?(l=b(d),c[5]=d,c[6]=l):l=c[6],c[7]!==i||c[8]!==s||c[9]!==l?(o=(0,t.jsx)("span",{className:s,...i,children:l}),c[7]=i,c[8]=s,c[9]=l,c[10]=o):o=c[10],o)}function g(e){let a,i,s,l,o,c=(0,n.c)(11);c[0]!==e?({className:a,...i}=e,c[0]=e,c[1]=a,c[2]=i):(a=c[1],i=c[2]);let d=u();if(!d)return null;let{duration:m}=d;return c[3]!==a?(s=(0,r.cn)("w-10 text-right text-overline tabular-nums text-muted-foreground",a),c[3]=a,c[4]=s):s=c[4],c[5]!==m?(l=void 0!==m&&Number.isFinite(m)?b(m):"--:--",c[5]=m,c[6]=l):l=c[6],c[7]!==i||c[8]!==s||c[9]!==l?(o=(0,t.jsx)("span",{className:s,...i,children:l}),c[7]=i,c[8]=s,c[9]=l,c[10]=o):o=c[10],o}function y(e){let a,i,s,l,o,c=(0,n.c)(10);c[0]!==e?({className:a,children:s,...i}=e,c[0]=e,c[1]=a,c[2]=i,c[3]=s):(a=c[1],i=c[2],s=c[3]);let d=void 0===s?"Audio could not be loaded.":s,m=u();return m?.error?(c[4]!==a?(l=(0,r.cn)("text-overline text-negative-text",a),c[4]=a,c[5]=l):l=c[5],c[6]!==d||c[7]!==i||c[8]!==l?(o=(0,t.jsx)("div",{className:l,role:"status",...i,children:d}),c[6]=d,c[7]=i,c[8]=l,c[9]=o):o=c[9],o):null}function b(e){let t=Number.isFinite(e)?Math.max(0,e):0,n=Math.floor(t/3600),r=Math.floor(t%3600/60),a=Math.floor(t%60),i=n>0?r.toString().padStart(2,"0"):r.toString(),s=a.toString().padStart(2,"0");return n>0?`${n}:${i}:${s}`:`${i}:${s}`}e.s(["AudioPlayer",0,function(e){let a,i,s,l,o,c,d,u,m,p,b,j,w=(0,n.c)(24);w[0]!==e?({audioProps:a,children:i,className:s,description:l,metadata:o,src:d,title:u,...c}=e,w[0]=e,w[1]=a,w[2]=i,w[3]=s,w[4]=l,w[5]=o,w[6]=c,w[7]=d,w[8]=u):(a=w[1],i=w[2],s=w[3],l=w[4],o=w[5],c=w[6],d=w[7],u=w[8]);let N=void 0===u?"Audio preview":u;return w[9]!==s?(m=(0,r.cn)("flex w-full items-center gap-3 rounded-lg border border-border bg-card p-3 text-card-foreground shadow-sm",s),w[9]=s,w[10]=m):m=w[10],w[11]!==i||w[12]!==l||w[13]!==o||w[14]!==N?(p=i??(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x,{}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 flex flex-col gap-y-2",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex flex-col gap-y-0.5",children:[(0,t.jsx)("div",{className:"truncate text-xs font-medium",children:N}),l&&(0,t.jsx)("div",{className:"truncate text-overline text-muted-foreground",children:l})]}),o&&(0,t.jsx)("div",{className:"shrink-0 text-overline text-muted-foreground",children:o})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(f,{}),(0,t.jsx)(v,{}),(0,t.jsx)(g,{})]}),(0,t.jsx)(y,{})]})]}),w[11]=i,w[12]=l,w[13]=o,w[14]=N,w[15]=p):p=w[15],w[16]!==c||w[17]!==m||w[18]!==p?(b=(0,t.jsx)("div",{className:m,...c,children:p}),w[16]=c,w[17]=m,w[18]=p,w[19]=b):b=w[19],w[20]!==a||w[21]!==d||w[22]!==b?(j=(0,t.jsx)(h,{src:d,audioProps:a,children:b}),w[20]=a,w[21]=d,w[22]=b,w[23]=j):j=w[23],j},"AudioPlayerButton",0,x,"AudioPlayerDuration",0,g,"AudioPlayerProgress",0,v,"AudioPlayerProvider",0,h,"AudioPlayerTime",0,f,"useAudioPlayer",0,u,"useAudioPlayerTime",0,m])},573503,570655,705113,e=>{"use strict";var t=e.i(222666),n=e.i(505962),r=e.i(452473);e.s(["AiResponseDisclaimer",0,function(e){let a,i,s,l=(0,n.c)(7);l[0]!==e?(a=void 0===e?{}:e,l[0]=e,l[1]=a):a=l[1];let{isCompact:o,className:c}=a;l[2]!==c?(i=(0,r.cn)("mt-1 text-center text-3xs text-muted-foreground/60",c),l[2]=c,l[3]=i):i=l[3];let d=void 0!==o&&o?"Responses are AI-generated. Verify before relying on them.":"Responses are AI-generated and can be inaccurate. Review all outputs before relying on them.";return l[4]!==i||l[5]!==d?(s=(0,t.jsx)("p",{className:i,children:d}),l[4]=i,l[5]=d,l[6]=s):s=l[6],s}],573503);var a=e.i(270401),i=e.i(399695);function s(e){if("file"!==e.kind)return!1;let t=(e.type||"").toLowerCase();return!t.startsWith("video/")||!!i.allowedVideoFiles.has(t)}function l(){}e.s(["useDragDrop",0,function(e,t){let r,i,o,c,d,u,m,h,x,v,p=(0,n.c)(34);p[0]!==t?(r=void 0===t?{}:t,p[0]=t,p[1]=r):r=p[1];let{shouldPreventDefault:f,animationDelay:g,typeValidator:y,onDrop:b}=r,j=void 0===f||f,w=void 0===g?200:g,N=void 0===y?s:y,[k,E]=(0,a.useState)(!1),[L,z]=(0,a.useState)(!0),P=(0,a.useRef)(0);p[2]!==w?(i=()=>{setTimeout(()=>E(!1),w)},p[2]=w,p[3]=i):i=p[3];let A=i;p[4]!==j?(o=e=>{j&&e.preventDefault(),P.current=P.current+1,E(!0)},p[4]=j,p[5]=o):o=p[5];let S=o;p[6]!==j||p[7]!==A?(c=e=>{j&&e.preventDefault(),P.current=P.current-1,0===P.current&&A()},p[6]=j,p[7]=A,p[8]=c):c=p[8];let C=c;p[9]!==j||p[10]!==N?(d=e=>{j&&e.preventDefault();let t=e.dataTransfer?.items;z(!!t&&Array.from(t).every(e=>N(e)))},p[9]=j,p[10]=N,p[11]=d):d=p[11];let D=d;p[12]!==b||p[13]!==j||p[14]!==A?(u=e=>{if(j&&e.preventDefault(),z(!0),P.current=0,A(),b)try{Promise.resolve(b(e)).catch(l)}catch(e){}},p[12]=b,p[13]=j,p[14]=A,p[15]=u):u=p[15];let T=u;p[16]!==A?(m=()=>{A(),z(!1)},p[16]=A,p[17]=m):m=p[17];let _=m;return p[18]!==e||p[19]!==_||p[20]!==S||p[21]!==C||p[22]!==D||p[23]!==T?(h=()=>{let t=e.current;if(t)return t.addEventListener("dragenter",S),t.addEventListener("dragleave",C),t.addEventListener("dragover",D),t.addEventListener("dragend",_),t.addEventListener("drop",T),()=>{t.removeEventListener("dragenter",S),t.removeEventListener("dragleave",C),t.removeEventListener("dragover",D),t.removeEventListener("dragend",_),t.removeEventListener("drop",T)}},p[18]=e,p[19]=_,p[20]=S,p[21]=C,p[22]=D,p[23]=T,p[24]=h):h=p[24],p[25]!==_||p[26]!==S||p[27]!==C||p[28]!==D||p[29]!==T?(x=[S,C,D,_,T],p[25]=_,p[26]=S,p[27]=C,p[28]=D,p[29]=T,p[30]=x):x=p[30],(0,a.useEffect)(h,x),p[31]!==k||p[32]!==L?(v={isDragging:k,isValid:L},p[31]=k,p[32]=L,p[33]=v):v=p[33],v}],570655);var o=e.i(528164),c=e.i(648156),d=e.i(249656),u=e.i(968076),m=e.i(652942),h=e.i(159119),x=e.i(235856),v=e.i(614991),p=e.i(519202),f=e.i(492009),g=e.i(126154),y=e.i(910939),b=e.i(634061),j=e.i(795672);let w={[u.AttachmentType.Image]:{label:"Image",icon:(0,t.jsx)(v.PhotoIcon,{className:"size-6"})},[u.AttachmentType.Text]:{label:"Text",icon:(0,t.jsx)(x.DocumentTextIcon,{className:"size-6"})},[u.AttachmentType.File]:{label:"PDF",icon:(0,t.jsx)(h.DocumentIcon,{className:"size-6"})},[u.AttachmentType.Audio]:{label:"Audio",icon:(0,t.jsx)(p.SpeakerWaveIcon,{className:"size-6"})},[u.AttachmentType.Video]:{label:"Video",icon:(0,t.jsx)(f.VideoCameraIcon,{className:"size-6"})}};function N(e){let a,i,s,l,o,c,d,m,h,x,v=(0,n.c)(39),{attachment:p,variant:f,isLoading:N}=e,k=(0,j.useFormatters)();if(void 0!==N&&N){let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{"aria-label":"Loading attachment",className:"flex size-16 shrink-0 items-center justify-center rounded-lg bg-muted",role:"status",children:(0,t.jsx)(y.Spinner,{className:"size-6 text-muted-foreground"})}),v[0]=e):e=v[0],e}let E=w[p.type],L=p.type===u.AttachmentType.Image&&void 0!==p.url;if(L&&"composer"===f){let e;return v[1]!==p.name||v[2]!==p.url?(e=(0,t.jsx)("img",{alt:p.name,className:"size-16 shrink-0 rounded-lg object-cover ph-no-capture","data-dd-privacy":"hidden",src:p.url}),v[1]=p.name,v[2]=p.url,v[3]=e):e=v[3],e}let z=p.name===E.label&&0===p.size,P="composer"===f?"h-16 w-56 gap-2.5 px-3 py-2":"h-14 min-w-40 max-w-56 gap-2.5 px-3 py-2";v[4]!==P?(a=(0,r.cn)("relative flex min-w-0 cursor-pointer select-none items-center overflow-hidden rounded-lg border bg-background ph-no-capture transition-colors hover:bg-card-hover group-focus-within:ring-2 group-focus-within:ring-ring",P),v[4]=P,v[5]=a):a=v[5],v[6]!==p.name||v[7]!==p.url||v[8]!==L||v[9]!==E.icon||v[10]!==f?(i=L?(0,t.jsx)("img",{alt:p.name,className:(0,r.cn)("shrink-0 rounded-md object-cover","composer"===f?"size-10":"size-9"),src:p.url}):(0,t.jsx)("div",{className:(0,r.cn)("flex shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground","composer"===f?"size-10":"size-9"),children:E.icon}),v[6]=p.name,v[7]=p.url,v[8]=L,v[9]=E.icon,v[10]=f,v[11]=i):i=v[11];let A="composer"===f&&"pr-7";v[12]!==A?(s=(0,r.cn)("min-w-0 text-left",A),v[12]=A,v[13]=s):s=v[13];let S="composer"===f?"text-sm leading-5":"text-xs";v[14]!==S?(l=(0,r.cn)("truncate font-medium text-foreground",S),v[14]=S,v[15]=l):l=v[15];let C=z?E.label:p.name;v[16]!==p.name||v[17]!==l||v[18]!==C?(o=(0,t.jsx)("p",{className:l,title:p.name,children:C}),v[16]=p.name,v[17]=l,v[18]=C,v[19]=o):o=v[19],v[20]!==p.name||v[21]!==p.size||v[22]!==k||v[23]!==z||v[24]!==E.label?(c=z?null:(0,t.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[function(e){let t=e.lastIndexOf(".");if(t<=0||t===e.length-1)return null;let n=e.slice(t+1);return n.length>5||!/^[a-zA-Z0-9]+$/.test(n)?null:n.toUpperCase()}(p.name)??E.label,p.size>0?(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)(g.DotSeparator,{})," ",k.bytes(p.size)??"—"]}):null]}),v[20]=p.name,v[21]=p.size,v[22]=k,v[23]=z,v[24]=E.label,v[25]=c):c=v[25],v[26]!==o||v[27]!==c||v[28]!==s?(d=(0,t.jsxs)("div",{className:s,children:[o,c]}),v[26]=o,v[27]=c,v[28]=s,v[29]=d):d=v[29];let D="composer"===f?"bottom-2 right-3 size-4":"bottom-1.5 right-1.5 size-3.5";return v[30]!==D?(m=(0,r.cn)("absolute text-muted-foreground opacity-60 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100",D),v[30]=D,v[31]=m):m=v[31],v[32]!==m?(h=(0,t.jsx)(b.Expand,{"aria-hidden":"true",className:m}),v[32]=m,v[33]=h):h=v[33],v[34]!==d||v[35]!==h||v[36]!==a||v[37]!==i?(x=(0,t.jsxs)("div",{className:a,"data-dd-privacy":"hidden",children:[i,d,h]}),v[34]=d,v[35]=h,v[36]=a,v[37]=i,v[38]=x):x=v[38],x}var k=e.i(130868),E=e.i(389097),L=e.i(394333);let z=(0,a.lazy)(()=>e.A(339052));function P(e){let r=(0,n.c)(19),{attachment:i}=e;switch(i.type){case"image":{let e;return r[0]!==i.name||r[1]!==i.url?(e=(0,t.jsx)("div",{className:"bg-background h-max w-full max-w-max overflow-auto rounded-md border",children:(0,t.jsx)("picture",{className:"flex shrink-0 self-center",children:(0,t.jsx)("img",{alt:i.name,className:"max-h-screen max-w-full rounded-md",src:i.url})})}),r[0]=i.name,r[1]=i.url,r[2]=e):e=r[2],e}case"text":{let e,n;return r[3]!==i.content?(e=i.content?.slice(0,42e4)??"",r[3]=i.content,r[4]=e):e=r[4],r[5]!==e?(n=(0,t.jsx)("div",{className:"bg-background h-max w-full overflow-auto rounded-md border px-4 py-2",children:(0,t.jsx)("pre",{className:"max-h-[calc(100vh-16rem)] max-w-96 whitespace-pre-wrap break-words rounded-md text-sm",children:e})}),r[5]=e,r[6]=n):n=r[6],n}case"file":{let e,n;return r[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(L.Skeleton,{className:"size-full"}),r[7]=e):e=r[7],r[8]!==i.content?(n=(0,t.jsx)(a.Suspense,{fallback:e,children:(0,t.jsx)(z,{base64DataURL:i.content,showControls:!0,className:"size-full overflow-hidden rounded-md border"})}),r[8]=i.content,r[9]=n):n=r[9],n}case"audio":{let e,n,a,s,l,o=i.url??"";return r[10]===Symbol.for("react.memo_cache_sentinel")?(e={crossOrigin:"anonymous"},r[10]=e):e=r[10],r[11]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)(k.AudioPlayerButton,{size:"icon",variant:"outline"}),r[11]=n):n=r[11],r[12]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"font-medium",children:"Audio Input"}),r[12]=a):a=r[12],r[13]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[n,(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[a,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(k.AudioPlayerTime,{}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"/"}),(0,t.jsx)(k.AudioPlayerDuration,{})]})]}),(0,t.jsx)(k.AudioPlayerProgress,{})]})]}),r[13]=s):s=r[13],r[14]!==o?(l=(0,t.jsx)("div",{className:"bg-background w-full max-w-md rounded-md border p-6",children:(0,t.jsx)(k.AudioPlayerProvider,{src:o,audioProps:e,children:s})}),r[14]=o,r[15]=l):l=r[15],l}case"video":{let e,n;return r[16]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("track",{kind:"captions"}),r[16]=e):e=r[16],r[17]!==i.url?(n=(0,t.jsx)("div",{className:"bg-background w-full max-w-2xl rounded-md border",children:(0,t.jsx)("video",{className:"max-h-[70vh] w-full rounded-md",src:i.url,controls:!0,autoPlay:!1,children:e})}),r[17]=i.url,r[18]=n):n=r[18],n}default:return null}}function A(e){let i,s,l,c,u,m,h,x,v,p,f,g,y=(0,n.c)(33),{children:b,attachments:j,initialIndex:w}=e,[N,k]=(0,a.useState)(!1),L=j[void 0===w?0:w]??j[0];if(!L)return null;let z="file"===L.type,A=`Open attachment preview: ${L.name}`;y[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>k(!0),y[0]=i):i=y[0],y[1]!==b||y[2]!==A?(s=(0,t.jsx)(o.Button,{variant:"ghost",className:"contents h-auto w-auto p-0 hover:bg-transparent","aria-label":A,onClick:i,children:b}),y[1]=b,y[2]=A,y[3]=s):s=y[3];let S=!z,C=z&&"flex h-[90vh] flex-col";y[4]!==C?(l=(0,r.cn)("w-full max-w-4xl",C),y[4]=C,y[5]=l):l=y[5],y[6]!==L.name?(c=(0,t.jsx)(E.DialogTitle,{className:"sr-only",children:L.name}),y[6]=L.name,y[7]=c):c=y[7],y[8]!==z?(u=z&&(0,t.jsx)(E.DialogClose,{className:(0,r.cn)("absolute right-3 top-3 z-20 flex items-center justify-center","size-8 rounded-full border border-border bg-popover text-popover-foreground","shadow-md transition-colors hover:bg-accent-subtle hover:text-accent-foreground","focus-visible:border-focus-border focus-visible:shadow-focus focus-visible:outline-none"),"aria-label":"Close",children:(0,t.jsx)(d.X,{className:"size-4"})}),y[8]=z,y[9]=u):u=y[9];let D=z&&"min-h-0 w-full flex-1";y[10]!==D?(m=(0,r.cn)("flex flex-col items-center justify-center gap-2 ph-no-capture",D),y[10]=D,y[11]=m):m=y[11],y[12]!==L?(h=(0,t.jsx)(P,{attachment:L}),y[12]=L,y[13]=h):h=y[13];let T=L.size>0&&` (${Math.round(L.size/1024/1024*10)/10} MB)`;return y[14]!==L.name||y[15]!==T?(x=(0,t.jsxs)("pre",{className:"text-muted-foreground text-wrap break-all text-center text-xs",children:[L.name,T]}),y[14]=L.name,y[15]=T,y[16]=x):x=y[16],y[17]!==m||y[18]!==h||y[19]!==x?(v=(0,t.jsxs)("div",{className:m,"data-dd-privacy":"hidden",children:[h,x]}),y[17]=m,y[18]=h,y[19]=x,y[20]=v):v=y[20],y[21]!==v||y[22]!==S||y[23]!==l||y[24]!==c||y[25]!==u?(p=(0,t.jsxs)(E.DialogContent,{keepMounted:!1,showCloseButton:S,className:l,children:[c,u,v]}),y[21]=v,y[22]=S,y[23]=l,y[24]=c,y[25]=u,y[26]=p):p=y[26],y[27]!==N||y[28]!==p?(f=(0,t.jsx)(E.Dialog,{open:N,onOpenChange:k,children:p}),y[27]=N,y[28]=p,y[29]=f):f=y[29],y[30]!==f||y[31]!==s?(g=(0,t.jsxs)(t.Fragment,{children:[s,f]}),y[30]=f,y[31]=s,y[32]=g):g=y[32],g}let S=[];function C(e){return e.type===u.AttachmentType.Image}e.s(["AttachmentPreview",0,e=>{let a,i,s,l,h,x=(0,n.c)(18),{attachment:v,attachments:p,onDismiss:f,isLoading:g}=e,y=void 0===p?S:p,b=void 0!==g&&g,j=v.type===u.AttachmentType.Image;x[0]!==v||x[1]!==y||x[2]!==j?(a=j?(y.length>0?y:[v]).filter(C):[],i=j?a.indexOf(v):-1,x[0]=v,x[1]=y,x[2]=j,x[3]=a,x[4]=i):(a=x[3],i=x[4]);let w=i,k=f?"composer":"message",E=j&&"composer"===k&&void 0!==v.url;return x[5]!==E||x[6]!==f?(s=f&&(0,t.jsx)(c.Tooltip,{content:"Remove attachment",side:"left",children:(0,t.jsx)(o.Button,{size:"icon-sm",variant:"ghost",className:(0,r.cn)("absolute z-10",E?"right-1 top-1 size-5 rounded-full border border-border/60 bg-background/80 p-0 shadow-sm backdrop-blur-sm hover:bg-background":"right-1 top-1 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"),"aria-label":"Remove attachment",onClick:f,children:(0,t.jsx)(d.X,{className:E?"size-3":"size-4"})})}),x[5]=E,x[6]=f,x[7]=s):s=x[7],x[8]!==v||x[9]!==a||x[10]!==w||x[11]!==j||x[12]!==b||x[13]!==k?(l=j?(0,t.jsx)(m.ImagePreviewDialog,{images:a,initialIndex:Math.max(w,0),children:(0,t.jsx)(N,{attachment:v,variant:k,isLoading:b})}):(0,t.jsx)(A,{attachments:[v],initialIndex:0,children:(0,t.jsx)(N,{attachment:v,variant:k,isLoading:b})}),x[8]=v,x[9]=a,x[10]=w,x[11]=j,x[12]=b,x[13]=k,x[14]=l):l=x[14],x[15]!==s||x[16]!==l?(h=(0,t.jsx)("div",{className:"min-w-0 duration-200 animate-in fade-in slide-in-from-left-8",children:(0,t.jsxs)("div",{className:"group relative flex min-w-0",children:[s,l]})}),x[15]=s,x[16]=l,x[17]=h):h=x[17],h}],705113)},19379,e=>{"use strict";var t=e.i(505962),n=e.i(270401);e.s(["useKeydown",0,function(e,r){let a,i,s,l=(0,t.c)(6);l[0]!==e||l[1]!==r?(a=t=>{if(null===e||!t.key)return;let n=t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement;("function"==typeof e?!e(t):t.key!==e||n||t.ctrlKey||t.metaKey)||(t.preventDefault(),r(t))},l[0]=e,l[1]=r,l[2]=a):a=l[2];let o=(0,n.useEffectEvent)(a);l[3]!==o?(i=()=>{let e=e=>o(e);return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},l[3]=o,l[4]=i):i=l[4],l[5]===Symbol.for("react.memo_cache_sentinel")?(s=[],l[5]=s):s=l[5],(0,n.useEffect)(i,s)}])},652942,e=>{"use strict";var t=e.i(222666),n=e.i(505962),r=e.i(452473),a=e.i(528164),i=e.i(389097),s=e.i(607296),l=e.i(379497),o=e.i(270401),c=e.i(19379);function d(e){let i,s,l,o,c,d,u=(0,n.c)(12);u[0]!==e?({side:o,onClick:s,className:i,...l}=e,u[0]=e,u[1]=i,u[2]=s,u[3]=l,u[4]=o):(i=u[1],s=u[2],l=u[3],o=u[4]);let m="left"===o?"left-0":"right-0";return u[5]!==i||u[6]!==m?(c=(0,r.cn)("absolute top-0 h-full w-1/3 z-20",m,"rounded-none bg-transparent p-0 hover:bg-transparent",i),u[5]=i,u[6]=m,u[7]=c):c=u[7],u[8]!==s||u[9]!==l||u[10]!==c?(d=(0,t.jsx)(a.Button,{variant:"ghost",size:"sm",onClick:s,className:c,...l}),u[8]=s,u[9]=l,u[10]=c,u[11]=d):d=u[11],d}e.s(["ImagePreviewDialog",0,function(e){let u,m,h,x,v,p,f,g,y,b,j,w,N,k,E,L,z,P,A,S=(0,n.c)(45),{images:C,initialIndex:D,children:T}=e,_=void 0===D?0:D,[I,M]=(0,o.useState)(!1),[R,B]=(0,o.useState)(_),F=C.length,$=C[R];if(S[0]!==_||S[1]!==I?(u=()=>{I&&B(_)},m=[I,_],S[0]=_,S[1]=I,S[2]=u,S[3]=m):(u=S[2],m=S[3]),(0,o.useEffect)(u,m),S[4]!==I?(h=e=>I&&"ArrowRight"===e.key,S[4]=I,S[5]=h):h=S[5],S[6]!==F?(x=()=>B(e=>(e+1)%F),S[6]=F,S[7]=x):x=S[7],(0,c.useKeydown)(h,x),S[8]!==I?(v=e=>I&&"ArrowLeft"===e.key,S[8]=I,S[9]=v):v=S[9],S[10]!==F?(p=()=>B(e=>(e-1+F)%F),S[10]=F,S[11]=p):p=S[11],(0,c.useKeydown)(v,p),!$)return null;let O=`Open image preview: ${$.name}`;S[12]===Symbol.for("react.memo_cache_sentinel")?(f=()=>M(!0),S[12]=f):f=S[12],S[13]!==T||S[14]!==O?(g=(0,t.jsx)(a.Button,{variant:"ghost",className:"contents h-auto w-auto p-0 hover:bg-transparent","aria-label":O,onClick:f,children:T}),S[13]=T,S[14]=O,S[15]=g):g=S[15],S[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,r.cn)("w-full max-w-4xl flex flex-col items-center"),S[16]=y):y=S[16],S[17]!==$.name?(b=(0,t.jsx)(i.DialogHeader,{children:(0,t.jsx)(i.DialogTitle,{children:$.name})}),S[17]=$.name,S[18]=b):b=S[18],S[19]!==F?(j=F>1&&(0,t.jsx)(d,{"aria-label":"Previous image",side:"left",onClick:()=>B(e=>(e-1+F)%F)}),S[19]=F,S[20]=j):j=S[20],S[21]!==F?(w=F>1&&(0,t.jsx)(d,{"aria-label":"Next image",side:"right",onClick:()=>B(e=>(e+1)%F)}),S[21]=F,S[22]=w):w=S[22],S[23]!==F?(N=F>1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Button,{variant:"outline",size:"icon-sm",className:(0,r.cn)("absolute left-0 top-1/2 -translate-y-1/2 z-30 pointer-events-none","opacity-0 group-hover:opacity-100 transition-opacity duration-200"),tabIndex:-1,children:(0,t.jsx)(s.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(a.Button,{variant:"outline",size:"icon-sm",className:(0,r.cn)("absolute right-0 top-1/2 -translate-y-1/2 z-30 pointer-events-none","opacity-0 group-hover:opacity-100 transition-opacity duration-200"),tabIndex:-1,children:(0,t.jsx)(l.ChevronRight,{className:"size-4"})})]}),S[23]=F,S[24]=N):N=S[24],S[25]!==$.name||S[26]!==$.url?(k=(0,t.jsx)("img",{src:$.url,alt:$.name,className:"relative z-0 object-contain max-h-[65vh] w-auto max-w-full select-none mx-auto rounded-sm",draggable:!1}),S[25]=$.name,S[26]=$.url,S[27]=k):k=S[27],S[28]!==j||S[29]!==w||S[30]!==N||S[31]!==k?(E=(0,t.jsxs)("div",{className:"relative flex items-center justify-center w-full max-h-[70vh] min-h-[320px] group ph-no-capture","data-dd-privacy":"hidden",children:[j,w,N,k]}),S[28]=j,S[29]=w,S[30]=N,S[31]=k,S[32]=E):E=S[32];let V=F>1?`${R+1} / ${F}`:"";return S[33]!==V?(L=(0,t.jsx)("div",{className:"text-xs text-muted-foreground py-2 text-center w-full",children:V}),S[33]=V,S[34]=L):L=S[34],S[35]!==b||S[36]!==E||S[37]!==L?(z=(0,t.jsxs)(i.DialogContent,{keepMounted:!1,className:y,children:[b,E,L]}),S[35]=b,S[36]=E,S[37]=L,S[38]=z):z=S[38],S[39]!==I||S[40]!==z?(P=(0,t.jsx)(i.Dialog,{open:I,onOpenChange:M,children:z}),S[39]=I,S[40]=z,S[41]=P):P=S[41],S[42]!==g||S[43]!==P?(A=(0,t.jsxs)(t.Fragment,{children:[g,P]}),S[42]=g,S[43]=P,S[44]=A):A=S[44],A}])}]); //# sourceMappingURL=3_acts0ihw7-j.js.map //# chunkId=01a08eb6-304c-7b33-995b-cd68c12237f2