import{S as E,i as U,s as x,f as p,h as S,m as v,b as _,c as d,d as h,j as B,e as g,n as H,o as A,A as D,a2 as K,a3 as L,a4 as T,C as M,q as b,u as y,v as k,w,x as C,K as z,L as F,M as G,E as I}from"./index.43a672aa.js";import{B as J}from"./Block.dd660513.js";import{S as N}from"./StatusTracker.a32689a5.js";function j(r,t,n){const l=r.slice();return l[9]=t[n],l}function q(r){let t,n=r[9][0]+"",l,s,a,c,e=r[9][1]+"",o,m,f;return{c(){t=p("div"),l=S(n),a=v(),c=p("div"),o=S(e),m=v(),_(t,"data-testid","user"),_(t,"class","px-3 py-2 rounded-[22px] rounded-br-none text-white ml-7 text-sm"),_(t,"style",s="background-color:"+r[2][0]),_(c,"data-testid","bot"),_(c,"class","px-3 py-2 rounded-[22px] rounded-bl-none place-self-start text-white ml-7 text-sm"),_(c,"style",f="background-color:"+r[2][1])},m(u,i){d(u,t,i),h(t,l),d(u,a,i),d(u,c,i),h(c,o),h(c,m)},p(u,i){i&1&&n!==(n=u[9][0]+"")&&B(l,n),i&4&&s!==(s="background-color:"+u[2][0])&&_(t,"style",s),i&1&&e!==(e=u[9][1]+"")&&B(o,e),i&4&&f!==(f="background-color:"+u[2][1])&&_(c,"style",f)},d(u){u&&g(t),u&&g(a),u&&g(c)}}}function O(r){let t,n,l=r[0],s=[];for(let a=0;a<l.length;a+=1)s[a]=q(j(r,l,a));return{c(){t=p("div"),n=p("div");for(let a=0;a<s.length;a+=1)s[a].c();_(n,"class","flex flex-col items-end space-y-4 p-3"),_(t,"class","overflow-y-auto h-[40vh]")},m(a,c){d(a,t,c),h(t,n);for(let e=0;e<s.length;e+=1)s[e].m(n,null);r[5](t)},p(a,[c]){if(c&5){l=a[0];let e;for(e=0;e<l.length;e+=1){const o=j(a,l,e);s[e]?s[e].p(o,c):(s[e]=q(o),s[e].c(),s[e].m(n,null))}for(;e<s.length;e+=1)s[e].d(1);s.length=l.length}},i:H,o:H,d(a){a&&g(t),A(s,a),r[5](null)}}}function P(r,t,n){let l,{value:s}=t,{style:a=""}=t,{color_map:c=void 0}=t,e,o;const m=D();K(()=>{o=e&&e.offsetHeight+e.scrollTop>e.scrollHeight-20}),L(()=>{o&&e.scrollTo(0,e.scrollHeight)});function f(){return c?c.map(i=>i in T?T[i].primary:i):["#fb923c","#9ca3af"]}function u(i){M[i?"unshift":"push"](()=>{e=i,n(1,e)})}return r.$$set=i=>{"value"in i&&n(0,s=i.value),"style"in i&&n(3,a=i.style),"color_map"in i&&n(4,c=i.color_map)},r.$$.update=()=>{r.$$.dirty&1&&s&&m("change")},n(2,l=f()),[s,e,l,a,c,u]}class Q extends E{constructor(t){super(),U(this,t,P,O,x,{value:0,style:3,color_map:4})}}function R(r){let t,n,l,s;const a=[r[3]];let c={};for(let e=0;e<a.length;e+=1)c=z(c,a[e]);return t=new N({props:c}),l=new Q({props:{value:r[0],style:r[1],color_map:r[2]}}),l.$on("change",r[4]),{c(){b(t.$$.fragment),n=v(),b(l.$$.fragment)},m(e,o){y(t,e,o),d(e,n,o),y(l,e,o),s=!0},p(e,o){const m=o&8?F(a,[G(e[3])]):{};t.$set(m);const f={};o&1&&(f.value=e[0]),o&2&&(f.style=e[1]),o&4&&(f.color_map=e[2]),l.$set(f)},i(e){s||(k(t.$$.fragment,e),k(l.$$.fragment,e),s=!0)},o(e){w(t.$$.fragment,e),w(l.$$.fragment,e),s=!1},d(e){C(t,e),e&&g(n),C(l,e)}}}function V(r){let t,n;return t=new J({props:{padding:!1,$$slots:{default:[R]},$$scope:{ctx:r}}}),{c(){b(t.$$.fragment)},m(l,s){y(t,l,s),n=!0},p(l,[s]){const a={};s&47&&(a.$$scope={dirty:s,ctx:l}),t.$set(a)},i(l){n||(k(t.$$.fragment,l),n=!0)},o(l){w(t.$$.fragment,l),n=!1},d(l){C(t,l)}}}function W(r,t,n){let{value:l=[]}=t,{style:s=""}=t,{color_map:a}=t,{loading_status:c}=t;function e(o){I.call(this,r,o)}return r.$$set=o=>{"value"in o&&n(0,l=o.value),"style"in o&&n(1,s=o.style),"color_map"in o&&n(2,a=o.color_map),"loading_status"in o&&n(3,c=o.loading_status)},[l,s,a,c,e]}class X extends E{constructor(t){super(),U(this,t,W,V,x,{value:0,style:1,color_map:2,loading_status:3})}}var ee=X;const te=["static"];export{ee as Component,te as modes};
