PageSourceSearch

https://stavanshah01-grownxt-server.hf.space/assets/Index-DIOz2Pkb.js

js stavanshah01-grownxt-server.hf.space collected 2026-10-03 17:24:49 UTC 115,146 bytes, 8 lines download raw bytes

1import"./IconButtonWrapper.svelte_svelte_type_style_lang-BOpxTcdu.js";import{u as hl,S as bo,a as wo}from"./utils-BsGrhMNe.js";import{I as Yt}from"./Image-BRVH1yXn.js";import"./MarkdownCode.svelte_svelte_type_style_lang-BB-itM20.js";/* empty css                                                   *//* empty css                                                   */import{I as le}from"./IconButton-B-aAVSzy.js";import{C as Jt}from"./Check-BiRlaMNo.js";import{C as rn}from"./Copy-CxQ9EyK2.js";import{C as ko}from"./Clear-By3xiIwg.js";import{E as po}from"./Edit-BpRIf5rU.js";import{U as vo}from"./Undo-DCjBnnSO.js";import{I as Wi}from"./IconButtonWrapper-Cg16aIPK.js";import{F as el}from"./File-BQ_9P3Ye.js";import{M as tl}from"./MarkdownCode-CKlPsAWp.js";import{s as dl}from"./index-D9DTd3JP.js";import{d as $o}from"./index-CnqicUFC.js";import{C as Co}from"./Community-Dw1micSV.js";import{T as yo}from"./Trash-RbZEwH-j.js";import{M as Gi}from"./Music-CDm0RGMk.js";import{B as zo}from"./Block-DdQws7Te.js";import{B as So}from"./BlockLabel-DqHge3FF.js";import{S as jo}from"./index-bSCVAeem.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import"./file-url-DgijyRSD.js";import"./context-TgWPFwN2.js";import"./prism-python-DJXBfrTF.js";import"./index-DUPwsM33.js";import"./svelte/svelte.js";const{SvelteComponent:Ho,append:gl,attr:fe,detach:qo,init:Lo,insert:Mo,noop:Ln,safe_not_equal:No,svg_element:Mn}=window.__gradio__svelte__internal;function Vo(l){let e,t,n;return{c(){e=Mn("svg"),t=Mn("path"),n=Mn("path"),fe(t,"fill","currentColor"),fe(t,"d","M17.74 30L16 29l4-7h6a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h9v2H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h20a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4h-4.84Z"),fe(n,"fill","currentColor"),fe(n,"d","M8 10h16v2H8zm0 6h10v2H8z"),fe(e,"xmlns","http://www.w3.org/2000/svg"),fe(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),fe(e,"aria-hidden","true"),fe(e,"role","img"),fe(e,"class","iconify iconify--carbon"),fe(e,"width","100%"),fe(e,"height","100%"),fe(e,"preserveAspectRatio","xMidYMid meet"),fe(e,"viewBox","0 0 32 32")},m(i,s){Mo(i,e,s),gl(e,t),gl(e,n)},p:Ln,i:Ln,o:Ln,d(i){i&&qo(e)}}}class Do extends Ho{constructor(e){super(),Lo(this,e,null,Vo,No,{})}}const{SvelteComponent:Io,append:bl,attr:je,detach:Bo,init:Eo,insert:Ao,noop:Nn,safe_not_equal:To,svg_element:Vn}=window.__gradio__svelte__internal;function Fo(l){let e,t,n;return{c(){e=Vn("svg"),t=Vn("circle"),n=Vn("path"),je(t,"cx","9"),je(t,"cy","9"),je(t,"r","8"),je(t,"class","circle svelte-1m886t3"),je(n,"d","M5 8l4 4 4-4z"),je(e,"class","dropdown-arrow svelte-1m886t3"),je(e,"xmlns","http://www.w3.org/2000/svg"),je(e,"width","100%"),je(e,"height","100%"),je(e,"viewBox","0 0 18 18")},m(i,s){Ao(i,e,s),bl(e,t),bl(e,n)},p:Nn,i:Nn,o:Nn,d(i){i&&Bo(e)}}}class Zo extends Io{constructor(e){super(),Eo(this,e,null,Fo,To,{})}}const{SvelteComponent:Uo,append:tn,attr:N,detach:Po,init:Ro,insert:Oo,noop:Dn,safe_not_equal:Jo,svg_element:Rt}=window.__gradio__svelte__internal;function Wo(l){let e,t,n,i,s;return{c(){e=Rt("svg"),t=Rt("path"),n=Rt("path"),i=Rt("path"),s=Rt("path"),N(t,"d","M19.1679 9C18.0247 6.46819 15.3006 4.5 11.9999 4.5C8.31459 4.5 5.05104 7.44668 4.54932 11"),N(t,"stroke","currentColor"),N(t,"stroke-width","1.5"),N(t,"stroke-linecap","round"),N(t,"stroke-linejoin","round"),N(n,"d","M16 9H19.4C19.7314 9 20 8.73137 20 8.4V5"),N(n,"stroke","currentColor"),N(n,"stroke-width","1.5"),N(n,"stroke-linecap","round"),N(n,"stroke-linejoin","round"),N(i,"d","M4.88146 15C5.92458 17.5318 8.64874 19.5 12.0494 19.5C15.7347 19.5 18.9983 16.5533 19.5 13"),N(i,"stroke","currentColor"),N(i,"stroke-width","1.5"),N(i,"stroke-linecap","round"),N(i,"stroke-linejoin","round"),N(s,"d","M8.04932 15H4.64932C4.31795 15 4.04932 15.2686 4.04932 15.6V19"),N(s,"stroke","currentColor"),N(s,"stroke-width","1.5"),N(s,"stroke-linecap","round"),N(s,"stroke-linejoin","round"),N(e,"width","100%"),N(e,"height","100%"),N(e,"stroke-width","1.5"),N(e,"viewBox","0 0 24 24"),N(e,"fill","none"),N(e,"xmlns","http://www.w3.org/2000/svg"),N(e,"color","currentColor")},m(o,r){Oo(o,e,r),tn(e,t),tn(e,n),tn(e,i),tn(e,s)},p:Dn,i:Dn,o:Dn,d(o){o&&Po(e)}}}class Go extends Uo{constructor(e){super(),Ro(this,e,null,Wo,Jo,{})}}const{SvelteComponent:Yo,append:Ko,attr:He,detach:Qo,init:Xo,insert:xo,noop:In,safe_not_equal:es,svg_element:wl}=window.__gradio__svelte__internal;function ts(l){let e,t;return{c(){e=wl("svg"),t=wl("path"),He(t,"d","M12 20L12 4M12 20L7 15M12 20L17 15"),He(t,"stroke","currentColor"),He(t,"stroke-width","2"),He(t,"stroke-linecap","round"),He(t,"stroke-linejoin","round"),He(e,"width","100%"),He(e,"height","100%"),He(e,"viewBox","0 0 24 24"),He(e,"fill","none"),He(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){xo(n,e,i),Ko(e,t)},p:In,i:In,o:In,d(n){n&&Qo(e)}}}class ns extends Yo{constructor(e){super(),Xo(this,e,null,ts,es,{})}}const ls=async l=>(await Promise.all(l.map(async t=>{if(t.role==="system")return"";let n=t.role==="user"?"😃":"🤖",i="";if(t.type==="text"){const s={audio:/<audio.*?src="(\/file=.*?)"/g,video:/<video.*?src="(\/file=.*?)"/g,image:/<img.*?src="(\/file=.*?)".*?\/>|!\[.*?\]\((\/file=.*?)\)/g};i=t.content;for(let[o,r]of Object.entries(s)){let a;for(;(a=r.exec(t.content))!==null;){const _=a[1]||a[2],u=await hl(_);i=i.replace(_,u)}}}else{if(!t.content.value)return"";const s=t.content.component==="video"?t.content.value?.video.path:t.content.value,o=await hl(s);t.content.component==="audio"?i=`<audio controls src="${o}"></audio>`:t.content.component==="video"?i=o:t.content.component==="image"&&(i=`<img src="${o}" />`)}return`${n}: ${i}`}))).join(`
2`),Yi=(l,e)=>l.replace('src="/file',`src="${e}file`);function is(l){return l?l.includes("audio")?"audio":l.includes("video")?"video":l.includes("image")?"image":"file":"file"}function Ki(l){const e=Array.isArray(l.file)?l.file[0]:l.file;return{component:is(e?.mime_type),value:l.file,alt_text:l.alt_text,constructor_args:{},props:{}}}function os(l,e){if(l===null)return l;const t=new Map;return l.map((n,i)=>{let s=typeof n.content=="string"?{role:n.role,metadata:n.metadata,content:Yi(n.content,e),t
vendor: 5,196 bytes, lines 2-5
2ype:"text",index:i,options:n.options}:"file"in n.content?{content:Ki(n.content),metadata:n.metadata,role:n.role,type:"component",index:i,options:n.options}:{type:"component",...n};const{id:o,title:r,parent_id:a}=n.metadata||{};if(a){const _=t.get(String(a));if(_){const u={...s,children:[]};return _.children.push(u),o&&r&&t.set(String(o),u),null}}if(o&&r){const _={...s,children:[]};return t.set(String(o),_),_}return s}).filter(n=>n!==null)}function ss(l,e){return l===null?l:l.flatMap((n,i)=>n.map((s,o)=>{if(s==null)return null;const r=o==0?"user":"assistant";return typeof s=="string"?{role:r,type:"text",content:Yi(s,e),metadata:{title:null},index:[i,o]}:"file"in s?{content:Ki(s),role:r,type:"component",index:[i,o]}:{role:r,content:s,type:"component",index:[i,o]}})).filter(n=>n!=null)}function kl(l){return l.type==="component"}function nn(l,e){const t=l[l.length-1].role==="assistant",n=l[l.length-1].index;return JSON.stringify(n)===JSON.stringify(e[e.length-1].index)&&t}function as(l,e){const t=[];let n=[],i=null;for(const s of l)(s.role==="assistant"||s.role==="user")&&(s.role===i?n.push(s):(n.length>0&&t.push(n),n=[s],i=s.role));return n.length>0&&t.push(n),t}async function rs(l,e,t){let n=[],i=[];return l.forEach(o=>{if(e[o]||o==="file")return;const r=o==="dataframe"?"component":"base",{name:a,component:_}=t(o,r);n.push(a),i.push(_)}),(await Promise.all(i)).forEach((o,r)=>{e[n[r]]=o.default}),e}function _s(l){if(!l)return[];let e=new Set;return l.forEach(t=>{t.type==="component"&&e.add(t.content.component)}),Array.from(e)}function Jn(l,e=0){let t="";const n="  ".repeat(e);l.metadata?.title&&(t+=`${n}${e>0?"- ":""}${l.metadata.title}
3`),typeof l.content=="string"&&(t+=`${n}  ${l.content}
4`);const i=l;return i.children?.length>0&&(t+=i.children.map(s=>Jn(s,e+1)).join("")),t}function us(l){return Array.isArray(l)?l.map(e=>e.metadata?.title?Jn(e):e.content).join(`
5`):l.metadata?.title?Jn(l):l.content}function pl(l){return Array.isArray(l)&&l.every(e=>typeof e.content=="string")||!Array.isArray(l)&&typeof l.content=="string"}const{SvelteComponent:fs,append:cs,attr:kt,detach:ms,init:hs,insert:ds,noop:Bn,safe_not_equal:gs,svg_element:vl}=window.__gradio__svelte__internal;function bs(l){let e,t;return{c(){e=vl("svg"),t=vl("path"),kt(t,"d","M11.25 6.61523H9.375V1.36523H11.25V6.61523ZM3.375 1.36523H8.625V6.91636L7.48425 8.62748L7.16737 10.8464C7.14108 11.0248 7.05166 11.1879 6.91535 11.3061C6.77904 11.4242 6.60488 11.4896 6.4245 11.4902H6.375C6.07672 11.4899 5.79075 11.3713 5.57983 11.1604C5.36892 10.9495 5.2503 10.6635 5.25 10.3652V8.11523H2.25C1.85233 8.11474 1.47109 7.95654 1.18989 7.67535C0.908691 7.39415 0.750496 7.01291 0.75 6.61523V3.99023C0.750992 3.29435 1.02787 2.62724 1.51994 2.13517C2.01201 1.64311 2.67911 1.36623 3.375 1.36523Z"),kt(t,"fill","currentColor"),kt(e,"width","100%"),kt(e,"height","100%"),kt(e,"viewBox","0 0 12 12"),kt(e,"fill","none"),kt(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){ds(n,e,i),cs(e,t)},p:Bn,i:Bn,o:Bn,d(n){n&&ms(e)}}}class $l extends fs{constructor(e){super(),hs(this,e,null,bs,gs,{})}}const{SvelteComponent:ws,append:ks,attr:pt,detach:ps,init:vs,insert:$s,noop:En,safe_not_equal:Cs,svg_element:Cl}=window.__gradio__svelte__internal;function ys(l){let e,t;return{c(){e=Cl("svg"),t=Cl("path"),pt(t,"d","M2.25 8.11523H4.5V10.3652C4.5003 10.6635 4.61892 10.9495 4.82983 11.1604C5.04075 11.3713 5.32672 11.4899 5.625 11.4902H6.42488C6.60519 11.4895 6.77926 11.4241 6.91549 11.3059C7.05172 11.1878 7.14109 11.0248 7.16737 10.8464L7.48425 8.62748L8.82562 6.61523H11.25V1.36523H3.375C2.67911 1.36623 2.01201 1.64311 1.51994 2.13517C1.02787 2.62724 0.750992 3.29435 0.75 3.99023V6.61523C0.750496 7.01291 0.908691 7.39415 1.18989 7.67535C1.47109 7.95654 1.85233 8.11474 2.25 8.11523ZM9 2.11523H10.5V5.86523H9V2.11523ZM1.5 3.99023C1.5006 3.49314 1.69833 3.01657 2.04983 2.66507C2.40133 2.31356 2.8779 2.11583 3.375 2.11523H8.25V6.12661L6.76575 8.35298L6.4245 10.7402H5.625C5.52554 10.7402 5.43016 10.7007 5.35983 10.6304C5.28951 10.5601 5.25 10.4647 5.25 10.3652V7.36523H2.25C2.05118 7.36494 1.86059 7.28582 1.72 7.14524C1.57941 7.00465 1.5003 6.81406 1.5 6.61523V3.99023Z"),pt(t,"fill","currentColor"),pt(e,"width","100%"),pt(e,"height","100%"),pt(e,"viewBox","0 0 12 12"),pt(e,"fill","none"),pt(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){$s(n,e,i),ks(e,t)},p:En,i:En,o:En,d(n){n&&ps(e)}}}class yl extends ws{constructor(e){super(),vs(this,e,null,ys,Cs,{})}}const{SvelteComponent:zs,append:Ss,attr:vt,detach:js,init:Hs,insert:qs,noop:An,safe_not_equal:Ls,svg_element:zl}=window.__gradio__svelte__internal;function Ms(l){let e,t;return{c(){e=zl("svg"),t=zl("path"),vt(t,"d","M0.75 6.24023H2.625V11.4902H0.75V6.24023ZM8.625 11.4902H3.375V5.93911L4.51575 4.22798L4.83263 2.00911C4.85892 1.83065 4.94834 1.66754 5.08465 1.5494C5.22096 1.43125 5.39512 1.36591 5.5755 1.36523H5.625C5.92328 1.36553 6.20925 1.48415 6.42017 1.69507C6.63108 1.90598 6.7497 2.19196 6.75 2.49023V4.74023H9.75C10.1477 4.74073 10.5289 4.89893 10.8101 5.18012C11.0913 5.46132 11.2495 5.84256 11.25 6.24023V8.86523C11.249 9.56112 10.9721 10.2282 10.4801 10.7203C9.98799 11.2124 9.32089 11.4892 8.625 11.4902Z"),vt(t,"fill","currentColor"),vt(e,"
5width","100%"),vt(e,"height","100%"),vt(e,"viewBox","0 0 12 12"),vt(e,"fill","none"),vt(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){qs(n,e,i),Ss(e,t)},p:An,i:An,o:An,d(n){n&&js(e)}}}class Sl extends zs{constructor(e){super(),Hs(this,e,null,Ms,Ls,{})}}const{SvelteComponent:Ns,append:Vs,attr:$t,detach:Ds,init:Is,insert:Bs,noop:Tn,safe_not_equal:Es,svg_element:jl}=window.__gradio__svelte__internal;function As(l){let e,t;return{c(){e=jl("svg"),t=jl("path"),$t(t,"d","M9.75 4.74023H7.5V2.49023C7.4997 2.19196 7.38108 1.90598 7.17017 1.69507C6.95925 1.48415 6.67328 1.36553 6.375 1.36523H5.57512C5.39481 1.366 5.22074 1.43138 5.08451 1.54952C4.94828 1.66766 4.85891 1.83072 4.83262 2.00911L4.51575 4.22798L3.17438 6.24023H0.75V11.4902H8.625C9.32089 11.4892 9.98799 11.2124 10.4801 10.7203C10.9721 10.2282 11.249 9.56112 11.25 8.86523V6.24023C11.2495 5.84256 11.0913 5.46132 10.8101 5.18012C10.5289 4.89893 10.1477 4.74073 9.75 4.74023ZM3 10.7402H1.5V6.99023H3V10.7402ZM10.5 8.86523C10.4994 9.36233 10.3017 9.8389 9.95017 10.1904C9.59867 10.5419 9.1221 10.7396 8.625 10.7402H3.75V6.72886L5.23425 4.50248L5.5755 2.11523H6.375C6.47446 2.11523 6.56984 2.15474 6.64017 2.22507C6.71049 2.2954 6.75 2.39078 6.75 2.49023V5.49023H9.75C9.94882 5.49053 10.1394 5.56965 10.28 5.71023C10.4206 5.85082 10.4997 6.04141 10.5 6.24023V8.86523Z"),$t(t,"fill","currentColor"),$t(e,"width","100%"),$t(e,"height","100%"),$t(e,"viewBox","0 0 12 12"),$t(e,"fill","none"),$t(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){Bs(n,e,i),Vs(e,t)},p:Tn,i:Tn,o:Tn,d(n){n&&Ds(e)}}}class Hl extends Ns{constructor(e){super(),Is(this,e,null,As,Es,{})}}const{SvelteComponent:Ts,append:Fs,attr:It,detach:Zs,init:Us,insert:Ps,noop:Fn,safe_not_equal:Rs,svg_element:ql}=window.__gradio__svelte__internal;function Os(l){let e,t;return{c(){e=ql("svg"),t=ql("path"),It(t,"fill","currentColor"),It(t,"d","M6,30H4V2H28l-5.8,9L28,20H6ZM6,18H24.33L19.8,11l4.53-7H6Z"),It(e,"id","icon"),It(e,"xmlns","http://www.w3.org/2000/svg"),It(e,"viewBox","0 0 32 32"),It(e,"fill","none")},m(n,i){Ps(n,e,i),Fs(e,t)},p:Fn,i:Fn,o:Fn,d(n){n&&Zs(e)}}}class Ll extends Ts{constructor(e){super(),Us(this,e,null,Os,Rs,{})}}const{SvelteComponent:Js,append:Ws,attr:Bt,detach:Gs,init:Ys,insert:Ks,noop:Zn,safe_not_equal:Qs,svg_element:Ml}=window.__gradio__svelte__internal;function Xs(l){let e,t;return{c(){e=Ml("svg"),t=Ml("path"),Bt(t,"fill","currentColor"),Bt(t,"d","M4,2H28l-5.8,9L28,20H6v10H4V2z"),Bt(e,"id","icon"),Bt(e,"xmlns","http://www.w3.org/2000/svg"),Bt(e,"viewBox","0 0 32 32"),Bt(e,"fill","none")},m(n,i){Ks(n,e,i),Ws(e,t)},p:Zn,i:Zn,o:Zn,d(n){n&&Gs(e)}}}class Nl extends Js{constructor(e){super(),Ys(this,e,null,Xs,Qs,{})}}const{SvelteComponent:xs,append:Wn,attr:Gn,check_outros:_n,create_component:nl,destroy_component:ll,destroy_each:ea,detach:Ft,element:Yn,empty:Qi,ensure_array_like:Vl,flush:Un,group_outros:un,init:ta,insert:Zt,listen:na,mount_component:il,safe_not_equal:la,set_data:ia,set_style:Dl,space:ol,text:oa,transition_in:te,transition_out:$e}=window.__gradio__svelte__internal;function Il(l,e,t){const n=l.slice();return n[8]=e[t],n}function Bl(l){let e=l[2].includes("Dislike"),t,n=l[2].includes("Like"),i,s,o=e&&El(l),r=n&&Al(l);return{c(){o&&o.c(),t=ol(),r&&r.c(),i=Qi()},m(a,_){o&&o.m(a,_),Zt(a,t,_),r&&r.m(a,_),Zt(a,i,_),s=!0},p(a,_){_&4&&(e=a[2].includes("Dislike")),e?o?(o.p(a,_),_&4&&te(o,1)):(o=El(a),o.c(),te(o,1),o.m(t.parentNode,t)):o&&(un(),$e(o,1,1,()=>{o=null}),_n()),_&4&&(n=a[2].includes("Like")),n?r?(r.p(a,_),_&4&&te(r,1)):(r=Al(a),r.c(),te(r,1),r.m(i.parentNode,i)):r&&(un(),$e(r,1,1,()=>{r=null}),_n())},i(a){s||(te(o),te(r),s=!0)},o(a){$e(o),$e(r),s=!1}
vendor: 11,757 bytes, line 5
5,d(a){a&&(Ft(t),Ft(i)),o&&o.d(a),r&&r.d(a)}}}function El(l){let e,t;return e=new le({props:{Icon:l[0]==="Dislike"?$l:yl,label:l[0]==="Dislike"?"clicked dislike":"dislike",color:l[0]==="Dislike"?"var(--color-accent)":"var(--block-label-text-color)"}}),e.$on("click",l[5]),{c(){nl(e.$$.fragment)},m(n,i){il(e,n,i),t=!0},p(n,i){const s={};i&1&&(s.Icon=n[0]==="Dislike"?$l:yl),i&1&&(s.label=n[0]==="Dislike"?"clicked dislike":"dislike"),i&1&&(s.color=n[0]==="Dislike"?"var(--color-accent)":"var(--block-label-text-color)"),e.$set(s)},i(n){t||(te(e.$$.fragment,n),t=!0)},o(n){$e(e.$$.fragment,n),t=!1},d(n){ll(e,n)}}}function Al(l){let e,t;return e=new le({props:{Icon:l[0]==="Like"?Sl:Hl,label:l[0]==="Like"?"clicked like":"like",color:l[0]==="Like"?"var(--color-accent)":"var(--block-label-text-color)"}}),e.$on("click",l[6]),{c(){nl(e.$$.fragment)},m(n,i){il(e,n,i),t=!0},p(n,i){const s={};i&1&&(s.Icon=n[0]==="Like"?Sl:Hl),i&1&&(s.label=n[0]==="Like"?"clicked like":"like"),i&1&&(s.color=n[0]==="Like"?"var(--color-accent)":"var(--block-label-text-color)"),e.$set(s)},i(n){t||(te(e.$$.fragment,n),t=!0)},o(n){$e(e.$$.fragment,n),t=!1},d(n){ll(e,n)}}}function Tl(l){let e,t,n,i,s;t=new le({props:{Icon:l[0]&&l[3].includes(l[0])?Nl:Ll,label:"Feedback",color:l[0]&&l[3].includes(l[0])?"var(--color-accent)":"var(--block-label-text-color)"}});let o=Vl(l[3]),r=[];for(let a=0;a<o.length;a+=1)r[a]=Fl(Il(l,o,a));return{c(){e=Yn("div"),nl(t.$$.fragment),n=ol(),i=Yn("div");for(let a=0;a<r.length;a+=1)r[a].c();Gn(i,"class","extra-feedback-options svelte-14rmxes"),Gn(e,"class","extra-feedback no-border svelte-14rmxes")},m(a,_){Zt(a,e,_),il(t,e,null),Wn(e,n),Wn(e,i);for(let u=0;u<r.length;u+=1)r[u]&&r[u].m(i,null);s=!0},p(a,_){const u={};if(_&9&&(u.Icon=a[0]&&a[3].includes(a[0])?Nl:Ll),_&9&&(u.color=a[0]&&a[3].includes(a[0])?"var(--color-accent)":"var(--block-label-text-color)"),t.$set(u),_&27){o=Vl(a[3]);let f;for(f=0;f<o.length;f+=1){const c=Il(a,o,f);r[f]?r[f].p(c,_):(r[f]=Fl(c),r[f].c(),r[f].m(i,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=o.length}},i(a){s||(te(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Ft(e),ll(t),ea(r,a)}}}function Fl(l){let e,t=l[8]+"",n,i,s;function o(){return l[7](l[8])}return{c(){e=Yn("button"),n=oa(t),Gn(e,"class","extra-feedback-option svelte-14rmxes"),Dl(e,"font-weight",l[0]===l[8]?"bold":"normal")},m(r,a){Zt(r,e,a),Wn(e,n),i||(s=na(e,"click",o),i=!0)},p(r,a){l=r,a&8&&t!==(t=l[8]+"")&&ia(n,t),a&9&&Dl(e,"font-weight",l[0]===l[8]?"bold":"normal")},d(r){r&&Ft(e),i=!1,s()}}}function sa(l){let e=l[2].includes("Like")||l[2].includes("Dislike"),t,n,i,s=e&&Bl(l),o=l[3].length>0&&Tl(l);return{c(){s&&s.c(),t=ol(),o&&o.c(),n=Qi()},m(r,a){s&&s.m(r,a),Zt(r,t,a),o&&o.m(r,a),Zt(r,n,a),i=!0},p(r,[a]){a&4&&(e=r[2].includes("Like")||r[2].includes("Dislike")),e?s?(s.p(r,a),a&4&&te(s,1)):(s=Bl(r),s.c(),te(s,1),s.m(t.parentNode,t)):s&&(un(),$e(s,1,1,()=>{s=null}),_n()),r[3].length>0?o?(o.p(r,a),a&8&&te(o,1)):(o=Tl(r),o.c(),te(o,1),o.m(n.parentNode,n)):o&&(un(),$e(o,1,1,()=>{o=null}),_n())},i(r){i||(te(s),te(o),i=!0)},o(r){$e(s),$e(o),i=!1},d(r){r&&(Ft(t),Ft(n)),s&&s.d(r),o&&o.d(r)}}}function aa(l,e,t){let n,{handle_action:i}=e,{feedback_options:s}=e,{selected:o=null}=e;function r(f){t(0,o=o===f?null:f),i(o)}const a=()=>r("Dislike"),_=()=>r("Like"),u=f=>{r(f),i(o||null)};return l.$$set=f=>{"handle_action"in f&&t(1,i=f.handle_action),"feedback_options"in f&&t(2,s=f.feedback_options),"selected"in f&&t(0,o=f.selected)},l.$$.update=()=>{l.$$.dirty&4&&t(3,n=s.filter(f=>f!=="Like"&&f!=="Dislike"))},[o,i,s,n,r,a,_,u]}class ra extends xs{constructor(e){super(),ta(this,e,aa,sa,la,{handle_action:1,feedback_options:2,selected:0})}get handle_action(){return this.$$.ctx[1]}set handle_action(e){this.$$set({handle_action:e}),Un()}get feedback_options(){return this.$$.ctx[2]}set feedback_options(e){this.$$set({feedback_options:e}),Un()}get selected(){return this.$$.ctx[0]}set selected(e){this.$$set({selected:e}),Un()}}const{SvelteComponent:_a,create_component:ua,destroy_component:fa,flush:ca,init:ma,mount_component:ha,safe_not_equal:da,transition_in:ga,transition_out:ba}=window.__gradio__svelte__internal,{createEventDispatcher:wa}=window.__gradio__svelte__internal,{onDestroy:ka}=window.__gradio__svelte__internal;function pa(l){let e,t;return e=new le({props:{label:l[0]?"Copied message":"Copy message",Icon:l[0]?Jt:rn}}),e.$on("click",l[1]),{c(){ua(e.$$.fragment)},m(n,i){ha(e,n,i),t=!0},p(n,[i]){const s={};i&1&&(s.label=n[0]?"Copied message":"Copy message"),i&1&&(s.Icon=n[0]?Jt:rn),e.$set(s)},i(n){t||(ga(e.$$.fragment,n),t=!0)},o(n){ba(e.$$.fragment,n),t=!1},d(n){fa(e,n)}}}function va(l,e,t){const n=wa();let i=!1,{value:s}=e,o;function r(){t(0,i=!0),o&&clearTimeout(o),o=setTimeout(()=>{t(0,i=!1)},2e3)}async function a(){if("clipboard"in navigator)n("copy",{value:s}),await navigator.clipboard.writeText(s),r();else{const _=document.createElement("textarea");_.value=s,_.style.position="absolute",_.style.left="-999999px",document.body.prepend(_),_.select();try{document.execCommand("copy"),r()}catch(u){console.error(u)}finally{_.remove()}}}return ka(()=>{o&&clearTimeout(o)}),l.$$set=_=>{"value"in _&&t(2,s=_.value)},[i,a,s]}class $a extends _a{constructor(e){super(),ma(this,e,va,pa,da,{value:2})}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),ca()}}const{SvelteComponent:Ca,attr:Zl,check_outros:zt,create_component:ot,destroy_component:st,detach:Fe,element:ya,empty:sl,flush:ee,group_outros:St,init:za,insert:Ze,mount_component:at,safe_not_equal:Sa,space:Ot,transition_in:L,transition_out:T}=window.__gradio__svelte__internal;function Ul(l){let e,t,n,i;return t=new Wi({props:{top_panel:!1,$$slots:{default:[qa]},$$scope:{ctx:l}}}),{c(){e=ya("div"),ot(t.$$.fragment),Zl(e,"class",n="message-buttons-"+l[6]+" "+l[11]+" message-buttons "+(l[7]!==null&&"with-avatar")+" svelte-j7nkv7")},m(s,o){Ze(s,e,o),at(t,e,null),i=!0},p(s,o){const r={};o&8419135&&(r.$$scope={dirty:o,ctx:s}),t.$set(r),(!i||o&2240&&n!==(n="message-buttons-"+s[6]+" "+s[11]+" message-buttons "+(s[7]!==null&&"with-avatar")+" svelte-j7nkv7"))&&Zl(e,"class",n)},i(s){i||(L(t.$$.fragment,s),i=!0)},o(s){T(t.$$.fragment,s),i=!1},d(s){s&&Fe(e),st(t)}}}function ja(l){let e,t,n,i,s,o,r=l[13]&&Pl(l),a=l[2]&&Rl(l),_=l[3]&&Ol(l),u=l[4]&&Jl(l),f=l[0]&&Wl(l);return{c(){r&&r.c(),e=Ot(),a&&a.c(),t=Ot(),_&&_.c(),n=Ot(),u&&u.c(),i=Ot(),f&&f.c(),s=sl()},m(c,b){r&&r.m(c,b),Ze(c,e,b),a&&a.m(c,b),Ze(c,t,b),_&&_.m(c,b),Ze(c,n,b),u&&u.m(c,b),Ze(c,i,b),f&&f.m(c,b),Ze(c,s,b),o=!0},p(c,b){c[13]?r?(r.p(c,b),b&8192&&L(r,1)):(r=Pl(c),r.c(),L(r,1),r.m(e.parentNode,e)):r&&(St(),T(r,1,1,()=>{r=null}),zt()),c[2]?a?(a.p(c,b),b&4&&L(a,1)):(a=Rl(c),a.c(),L(a,1),a.m(t.parentNode,t)):a&&(St(),T(a,1,1,()=>{a=null}),zt()),c[3]?_?(_.p(c,b),b&8&&L(_,1)):(_=Ol(c),_.c(),L(_,1),_.m(n.parentNode,n)):_&&(St(),T(_,1,1,()=>{_=null}),zt()),c[4]?u?(u.p(c,b),b&16&&L(u,1)):(u=Jl(c),u.c(),L(u,1),u.m(i.parentNode,i)):u&&(St(),T(u,1,1,()=>{u=null}),zt()),c[0]?f?(f.p(c,b),b&1&&L(f,1)):(f=Wl(c),f.c(),L(f,1),f.m(s.parentNode,s)):f&&(St(),T(f,1,1,()=>{f=null}),zt())},i(c){o||(L(r),L(a),L(_),L(u),L(f),o=!0)},o(c){T(r),T(a),T(_),T(u),T(f),o=!1},d(c){c&&(Fe(e),Fe(t),Fe(n),Fe(i),Fe(s)),r&&r.d(c),a&&a.d(c),_&&_.d(c),u&&u.d(c),f&&f.d(c)}}}function Ha(l){let e,t,n,i;return e=new le({props:{label:"Submit",Icon:Jt,disabled:l[8]}}),e.$on("click",l[17]),n=new le({props:{label:"Cancel",Icon:ko,disabled:l[8]}}),n.$on("click",l[18]),{c(){ot(e.$$.fragment),t=Ot(),ot(n.$$.fragment)},m(s,o){at(e,s,o),Ze(s,t,o),at(n,s,o),i=!0},p(s,o){const r={};o&256&&(r.disabled=s[8]),e.$set(r);const a={};o&256&&(a.disabled=s[8]),n.$set(a)},i(s){i||(L(e.$$.fragment,s),L(n.$$.fragment,s),i=!0)},o(s){T(e.$$.fragment,s),T(n.$$.fragment,s),i=!1},d(s){s&&Fe(t),st(e,s),st(n,s)}}}function Pl(l){let e,t;return e=new $a({props:{value:l[14]}}),e.$on("copy",l[19]),{c(){ot(e.$$.fragment)},m(n,i){at(e,n,i),t=!0},p(n,i){const s={};i&16384&&(s.value=n[14]),e.$set(s)},i(n){t||(L(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){st(e,n)}}}function Rl(l){let e,t;return e=new le({props:{Icon:Go,label:"Retry",disabled:l[8]}}),e.$on("click",l[20]),{c(){ot(e.$$.fragment)},m(n,i){at(e,n,i),t=!0},p(n,i){const s={};i&256&&(s.disabled=n[8]),e.$set(s)},i(n){t||(L(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){st(e,n)}}}function Ol(l){let e,t;return e=new le({props:{label:"Undo",Icon:vo,disabled:l[8]}}),e.$on("click",l[21]),{c(){ot(e.$$.fragment)},m(n,i){at(e,n,i),t=!0},p(n,i){const s={};i&256&&(s.disabled=n[8]),e.$set(s)},i(n){t||(L(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){st(e,n)}}}function Jl(l){let e,t;return e=new le({props:{label:"Edit",Icon:po,disabled:l[8]}}),e.$on("click",l[22]),{c(){ot(e.$$.fragment)},m(n,i){at(e,n,i),t=!0},p(n,i){const s={};i&256&&(s.disabled=n[8]),e.$set(s)},i(n){t||(L(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){st(e,n)}}}function Wl(l){let e,t;return e=new ra({props:{handle_action:l[10],feedback_options:l[1],selected:l[9]}}),{c(){ot(e.$$.fragment)},m(n,i){at(e,n,i),t=!0},p(n,i){const s={};i&1024&&(s.handle_action=n[10]),i&2&&(s.feedback_options=n[1]),i&512&&(s.selected=n[9]),e.$set(s)},i(n){t||(L(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){st(e,n)}}}function qa(l){let e,t,n,i;const s=[Ha,ja],o=[];function r(a,_){return a[5]?0:1}return e=r(l),t=o[e]=s[e](l),{c(){t.c(),n=sl()},m(a,_){o[e].m(a,_),Ze(a,n,_),i=!0},p(a,_){let u=e;e=r(a),e===u?o[e].p(a,_):(St(),T(o[u],1,1,()=>{o[u]=null}),zt(),t=o[e],t?t.p(a,_):(t=o[e]=s[e](a),t.c()),L(t,1),t.m(n.parentNode,n))},i(a){i||(L(t),i=!0)},o(a){T(t),i=!1},d(a){a&&Fe(n),o[e].d(a)}}}function La(l){let e,t,n=(l[13]||l[2]||l[3]||l[4]||l[0])&&Ul(l);return{c(){n&&n.c(),e=sl()},m(i,s){n&&n.m(i,s),Ze(i,e,s),t=!0},p(i,[s]){i[13]||i[2]||i[3]||i[4]||i[0]?n?(n.p(i,s),s&8221&&L(n,1)):(n=Ul(i),n.c(),L(n,1),n.m(e.parentNode,e)):n&&(St(),T(n,1,1,()=>{n=null}),zt())},i(i){t||(L(n),t=!0)},o(i){T(n),t=!1},d(i){i&&Fe(e),n&&n.d(i)}}}function Ma(l,e,t){let n,i,{likeable:s}=e,{feedback_options:o}=e,{show_retry:r}=e,{show_undo:a}=e,{show_edit:_}=e,{in_edit_mode:u}=e,{show_copy_button:f}=e,{message:c}=e,{position:b}=e,{avatar:m}=e,{generating:h}=e,{current_feedback:w}=e,{handle_action:d}=e,{layout:$}=e,{dispatch:z}=e;const I=()=>d("edit_submit"),p=()=>d("edit_cancel"),x=S=>z("copy",S.detail),ne=()=>d("retry"),y=()=>d("undo"),he=()=>d("edit");return l.$$set=S=>{"likeable"in S&&t(0,s=S.likeable),"feedback_options"in S&&t(1,o=S.feedback_options),"show_retry"in S&&t(2,r=S.show_retry),"show_undo"in S&&t(3,a=S.show_undo),"show_edit"in S&&t(4,_=S.show_edit),"in_edit_mode"in S&&t(5,u=S.in_edit_mode),"show_copy_button"in S&&t(15,f=S.show_copy_button),"message"in S&&t(16,c=S.message),"position"in S&&t(6,b=S.position),"avatar"in S&&t(7,m=S.avatar),"generating"in S&&t(8,h=S.generating),"current_feedback"in S&&t(9,w=S.current_feedback),"handle_action"in S&&t(10,d=S.handle_action),"layout"in S&&t(11,$=S.layout),"dispatch"in S&&t(12,z=S.dispatch)},l.$$.update=()=>{l.$$.dirty&65536&&t(14,n=pl(c)?us(c):""),l.$$.dirty&98304&&t(13,i=f&&c&&pl(c))},[s,o,r,a,_,u,b,m,h,w,d,$,z,i,n,f,c,I,p,x,ne,y,he]}class Xi extends Ca{constructor(e){super(),za(this,e,Ma,La,Sa,{likeable:0,feedback_options:1,show_retry:2,show_undo:3,show_edit:4,in_edit_mode:5,show_copy_button:15,message:16,position:6,avatar:7,generating:8,current_feedback:9,handle_action:10,layout:11,dispatch:12})}get likeable(){return this.$$.ctx[0]}set likeable(e){this.$$set({likeable:e}),ee()}get feedback_options(){return this.$$.ctx[1]}set feedback_options(e){this.$$set({feedback_options:e}),ee()}get show_retry(){return this.$$.ctx[2]}set show_retry(e){this.$$set({show_retry:e}),ee()}get show_undo(){return this.$$.ctx[3]}set show_undo(e){this.$$set({show_undo:e}),ee()}
5get show_edit(){return this.$$.ctx[4]}set show_edit(e){this.$$set({show_edit:e}),ee()}get in_edit_mode(){return this.$$.ctx[5]}set in_edit_mode(e){this.$$set({in_edit_mode:e}),ee()}get show_copy_button(){return this.$$.ctx[15]}set show_copy_button(e){this.$$set({show_copy_button:e}),ee()}get message(){return this.$$.ctx[16]}set message(e){this.$$set({message:e}),ee()}get position(){return this.$$.ctx[6]}set position(e){this.$$set({position:e}),ee()}get avatar(){return this.$$.ctx[7]}set avatar(e){this.$$set({avatar:e}),ee()}get generating(){return this.$$.ctx[8]}set generating(e){this.$$set({generating:e}),ee()}get current_feedback(){return this.$$.ctx[9]}set current_feedback(e){this.$$set({current_feedback:e}),ee()}get handle_action(){return this.$$.ctx[10]}set handle_action(e){this.$$set({handle_action:e}),ee()}get layout(){return this.$$.ctx[11]}set layout(e){this.$$set({layout:e}),ee()}get dispatch(){return this.$$.ctx[12]}set dispatch(e){this.$$set({dispatch:e}),ee()}}const{SvelteComponent:Na,attr:Va,bubble:Ct,check_outros:ut,construct_svelte_component:ie,create_component:oe,destroy_component:se,detach:We,element:xi,empty:Vt,flush:pe,group_outros:ft,init:Da,insert:Ge,mount_component:ae,noop:Ia,safe_not_equal:Ba,set_style:Ea,transition_in:Q,transition_out:X}=window.__gradio__svelte__internal;function Aa(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],show_label:!1,label:"chatbot-image",show_share_button:!0,i18n:o[6],gradio:{dispatch:Ga}}}}return i&&(e=ie(i,s(l)),e.$on("load",l[17])),{c(){e&&oe(e.$$.fragment),t=Vt()},m(o,r){e&&ae(e,o,r),Ge(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){ft();const a=e;X(a.$$.fragment,1,0,()=>{se(a,1)}),ut()}i?(e=ie(i,s(o)),e.$on("load",o[17]),oe(e.$$.fragment),Q(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&64&&(a.i18n=o[6]),e.$set(a)}},i(o){n||(e&&Q(e.$$.fragment,o),n=!0)},o(o){e&&X(e.$$.fragment,o),n=!1},d(o){o&&We(t),e&&se(e,o)}}}function Ta(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],show_label:!1,label:"chatbot-image",show_download_button:o[9],display_icon_button_wrapper_top_corner:o[10],i18n:o[6]}}}return i&&(e=ie(i,s(l)),e.$on("load",l[16])),{c(){e&&oe(e.$$.fragment),t=Vt()},m(o,r){e&&ae(e,o,r),Ge(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){ft();const a=e;X(a.$$.fragment,1,0,()=>{se(a,1)}),ut()}i?(e=ie(i,s(o)),e.$on("load",o[16]),oe(e.$$.fragment),Q(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&512&&(a.show_download_button=o[9]),r&1024&&(a.display_icon_button_wrapper_top_corner=o[10]),r&64&&(a.i18n=o[6]),e.$set(a)}},i(o){n||(e&&Q(e.$$.fragment,o),n=!0)},o(o){e&&X(e.$$.fragment,o),n=!1},d(o){o&&We(t),e&&se(e,o)}}}function Fa(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{autoplay:o[5].autoplay,value:o[2].video||o[2],show_label:!1,show_share_button:!0,i18n:o[6],upload:o[7],display_icon_button_wrapper_top_corner:o[10],show_download_button:o[9],$$slots:{default:[Oa]},$$scope:{ctx:o}}}}return i&&(e=ie(i,s(l)),e.$on("load",l[15])),{c(){e&&oe(e.$$.fragment),t=Vt()},m(o,r){e&&ae(e,o,r),Ge(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){ft();const a=e;X(a.$$.fragment,1,0,()=>{se(a,1)}),ut()}i?(e=ie(i,s(o)),e.$on("load",o[15]),oe(e.$$.fragment),Q(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&32&&(a.autoplay=o[5].autoplay),r&4&&(a.value=o[2].video||o[2]),r&64&&(a.i18n=o[6]),r&128&&(a.upload=o[7]),r&1024&&(a.display_icon_button_wrapper_top_corner=o[10]),r&512&&(a.show_download_button=o[9]),r&262144&&(a.$$scope={dirty:r,ctx:o}),e.$set(a)}},i(o){n||(e&&Q(e.$$.fragment,o),n=!0)},o(o){e&&X(e.$$.fragment,o),n=!1},d(o){o&&We(t),e&&se(e,o)}}}function Za(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],show_label:!1,show_share_button:!0,i18n:o[6],label:"",waveform_settings:{autoplay:o[5].autoplay},show_download_button:o[9],display_icon_button_wrapper_top_corner:o[10]}}}return i&&(t=ie(i,s(l)),t.$on("load",l[14])),{c(){e=xi("div"),t&&oe(t.$$.fragment),Ea(e,"position","relative")},m(o,r){Ge(o,e,r),t&&ae(t,e,null),n=!0}
5,p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(t){ft();const a=t;X(a.$$.fragment,1,0,()=>{se(a,1)}),ut()}i?(t=ie(i,s(o)),t.$on("load",o[14]),oe(t.$$.fragment),Q(t.$$.fragment,1),ae(t,e,null)):t=null}else if(i){const a={};r&4&&(a.value=o[2]),r&64&&(a.i18n=o[6]),r&32&&(a.waveform_settings={autoplay:o[5].autoplay}),r&512&&(a.show_download_button=o[9]),r&1024&&(a.display_icon_button_wrapper_top_corner=o[10]),t.$set(a)}},i(o){n||(t&&Q(t.$$.fragment,o),n=!0)},o(o){t&&X(t.$$.fragment,o),n=!1},d(o){o&&We(e),t&&se(t)}}}function Ua(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],target:o[3],theme_mode:o[4],bokeh_version:o[5].bokeh_version,caption:"",show_actions_button:!0}}}return i&&(e=ie(i,s(l)),e.$on("load",l[13])),{c(){e&&oe(e.$$.fragment),t=Vt()},m(o,r){e&&ae(e,o,r),Ge(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){ft();const a=e;X(a.$$.fragment,1,0,()=>{se(a,1)}),ut()}i?(e=ie(i,s(o)),e.$on("load",o[13]),oe(e.$$.fragment),Q(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&8&&(a.target=o[3]),r&16&&(a.theme_mode=o[4]),r&32&&(a.bokeh_version=o[5].bokeh_version),e.$set(a
vendor: 31,952 bytes, line 5
5)}},i(o){n||(e&&Q(e.$$.fragment,o),n=!0)},o(o){e&&X(e.$$.fragment,o),n=!1},d(o){o&&We(t),e&&se(e,o)}}}function Pa(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],show_label:!1,i18n:o[6],label:"",interactive:!1,line_breaks:o[5].line_breaks,wrap:!0,root:"",gradio:{dispatch:Wa},datatype:o[5].datatype,latex_delimiters:o[5].latex_delimiters,col_count:o[5].col_count,row_count:o[5].row_count}}}return i&&(e=ie(i,s(l)),e.$on("load",l[12])),{c(){e&&oe(e.$$.fragment),t=Vt()},m(o,r){e&&ae(e,o,r),Ge(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){ft();const a=e;X(a.$$.fragment,1,0,()=>{se(a,1)}),ut()}i?(e=ie(i,s(o)),e.$on("load",o[12]),oe(e.$$.fragment),Q(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&64&&(a.i18n=o[6]),r&32&&(a.line_breaks=o[5].line_breaks),r&32&&(a.datatype=o[5].datatype),r&32&&(a.latex_delimiters=o[5].latex_delimiters),r&32&&(a.col_count=o[5].col_count),r&32&&(a.row_count=o[5].row_count),e.$set(a)}},i(o){n||(e&&Q(e.$$.fragment,o),n=!0)},o(o){e&&X(e.$$.fragment,o),n=!1},d(o){o&&We(t),e&&se(e,o)}}}function Ra(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],display_icon_button_wrapper_top_corner:o[10],show_label:!1,i18n:o[6],label:"",_fetch:o[8],allow_preview:!1,interactive:!1,mode:"minimal",fixed_height:1}}}return i&&(e=ie(i,s(l)),e.$on("load",l[11])),{c(){e&&oe(e.$$.fragment),t=Vt()},m(o,r){e&&ae(e,o,r),Ge(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){ft();const a=e;X(a.$$.fragment,1,0,()=>{se(a,1)}),ut()}i?(e=ie(i,s(o)),e.$on("load",o[11]),oe(e.$$.fragment),Q(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&1024&&(a.display_icon_button_wrapper_top_corner=o[10]),r&64&&(a.i18n=o[6]),r&256&&(a._fetch=o[8]),e.$set(a)}},i(o){n||(e&&Q(e.$$.fragment,o),n=!0)},o(o){e&&X(e.$$.fragment,o),n=!1},d(o){o&&We(t),e&&se(e,o)}}}function Oa(l){let e;return{c(){e=xi("track"),Va(e,"kind","captions")},m(t,n){Ge(t,e,n)},p:Ia,d(t){t&&We(e)}}}function Ja(l){let e,t,n,i;const s=[Ra,Pa,Ua,Za,Fa,Ta,Aa],o=[];function r(a,_){return a[0]==="gallery"?0:a[0]==="dataframe"?1:a[0]==="plot"?2:a[0]==="audio"?3:a[0]==="video"?4:a[0]==="image"?5:a[0]==="html"?6:-1}return~(e=r(l))&&(t=o[e]=s[e](l)),{c(){t&&t.c(),n=Vt()},m(a,_){~e&&o[e].m(a,_),Ge(a,n,_),i=!0},p(a,[_]){let u=e;e=r(a),e===u?~e&&o[e].p(a,_):(t&&(ft(),X(o[u],1,1,()=>{o[u]=null}),ut()),~e?(t=o[e],t?t.p(a,_):(t=o[e]=s[e](a),t.c()),Q(t,1),t.m(n.parentNode,n)):t=null)},i(a){i||(Q(t),i=!0)},o(a){X(t),i=!1},d(a){a&&We(n),~e&&o[e].d(a)}}}const Wa=()=>{},Ga=()=>{};function Ya(l,e,t){let{type:n}=e,{components:i}=e,{value:s}=e,{target:o}=e,{theme_mode:r}=e,{props:a}=e,{i18n:_}=e,{upload:u}=e,{_fetch:f}=e,{allow_file_downloads:c}=e,{display_icon_button_wrapper_top_corner:b=!1}=e;function m(p){Ct.call(this,l,p)}function h(p){Ct.call(this,l,p)}function w(p){Ct.call(this,l,p)}function d(p){Ct.call(this,l,p)}function $(p){Ct.call(this,l,p)}function z(p){Ct.call(this,l,p)}function I(p){Ct.call(this,l,p)}return l.$$set=p=>{"type"in p&&t(0,n=p.type),"components"in p&&t(1,i=p.components),"value"in p&&t(2,s=p.value),"target"in p&&t(3,o=p.target),"theme_mode"in p&&t(4,r=p.theme_mode),"props"in p&&t(5,a=p.props),"i18n"in p&&t(6,_=p.i18n),"upload"in p&&t(7,u=p.upload),"_fetch"in p&&t(8,f=p._fetch),"allow_file_downloads"in p&&t(9,c=p.allow_file_downloads),"display_icon_button_wrapper_top_corner"in p&&t(10,b=p.display_icon_button_wrapper_top_corner)},[n,i,s,o,r,a,_,u,f,c,b,m,h,w,d,$,z,I]}class Ka extends Na{constructor(e){super(),Da(this,e,Ya,Ja,Ba,{type:0,components:1,value:2,target:3,theme_mode:4,props:5,i18n:6,upload:7,_fetch:8,allow_file_downloads:9,display_icon_button_wrapper_top_corner:10})}get type(){return this.$$.ctx[0]}set type(e){this.$$set({type:e}),pe()}get components(){return this.$$.ctx[1]}set components(e){this.$$set({components:e}),pe()}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),pe()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),pe()}get theme_mode(){return this.$$.ctx[4]}set theme_mode(e){this.$$set({theme_mode:e}),pe()}get props(){return this.$$.ctx[5]}set props(e){this.$$set({props:e}),pe()}get i18n(){return this.$$.ctx[6]}set i18n(e){this.$$set({i18n:e}),pe()}get upload(){return this.$$.ctx[7]}set upload(e){this.$$set({upload:e}),pe()}get _fetch(){return this.$$.ctx[8]}set _fetch(e){this.$$set({_fetch:e}),pe()}get allow_file_downloads(){return this.$$.ctx[9]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),pe()}get display_icon_button_wrapper_top_corner(){return this.$$.ctx[10]}set display_icon_button_wrapper_top_corner(e){this.$$set({display_icon_button_wrapper_top_corner:e}),pe()}}const{SvelteComponent:Qa,append:Te,attr:ce,check_outros:Xa,create_component:al,destroy_component:rl,detach:_l,element:yt,empty:xa,flush:O,group_outros:er,init:tr,insert:ul,is_function:nr,mount_component:fl,safe_not_equal:lr,set_data:Gl,space:Yl,text:Kl,transition_in:Wt,transition_out:Gt}=window.__gradio__svelte__internal;function ir(l){let e,t,n,i,s,o,r,a=(l[16].content.value?.orig_name||l[16].content.value?.path.split("/").pop()||"file")+"",_,u,f,c,b,m=(l[16].content.value?.orig_name||l[16].content.value?.path||"").split(".").pop().toUpperCase()+"",h,w;return n=new el({}),{c(){e=yt("div"),t=yt("div"),al(n.$$.fragment),i=Yl(),s=yt("div"),o=yt("a"),r=yt("span"),_=Kl(a),c=Yl(),b=yt("span"),h=Kl(m),ce(t,"class","file-icon svelte-ulpe0d"),ce(r,"class","file-name svelte-ulpe0d"),ce(o,"data-testid","chatbot-file"),ce(o,"class","file-link svelte-ulpe0d"),ce(o,"href",u=l[16].content.value.url),ce(o,"target","_blank"),ce(o,"download",f=window.__is_colab__?null:l[16].content.value?.orig_name||l[16].content.value?.path.split("/").pop()||"file"),ce(b,"class","file-type svelte-ulpe0d"),ce(s,"class","file-info svelte-ulpe0d"),ce(e,"class","file-container svelte-ulpe0d")},m(d,$){ul(d,e,$),Te(e,t),fl(n,t,null),Te(e,i),Te(e,s),Te(s,o),Te(o,r),Te(r,_),Te(s,c),Te(s,b),Te(b,h),w=!0},p(d,$){(!w||$&65536)&&a!==(a=(d[16].content.value?.orig_name||d[16].content.value?.path.split("/").pop()||"file")+"")&&Gl(_,a),(!w||$&65536&&u!==(u=d[16].content.value.url))&&ce(o,"href",u),(!w||$&65536&&f!==(f=window.__is_colab__?null:d[16].content.value?.orig_name||d[16].content.value?.path.split("/").pop()||"file"))&&ce(o,"download",f),(!w||$&65536)&&m!==(m=(d[16].content.value?.orig_name||d[16].content.value?.path||"").split(".").pop().toUpperCase()+"")&&Gl(h,m)},i(d){w||(Wt(n.$$.fragment,d),w=!0)},o(d){Gt(n.$$.fragment,d),w=!1},d(d){d&&_l(e),rl(n)}}}function or(l){let e,t;return e=new Ka({props:{target:l[6],theme_mode:l[8],props:l[16].content.props,type:l[16].content.component,components:l[9],value:l[16].content.value,display_icon_button_wrapper_top_corner:l[14]>0&&l[13],i18n:l[3],upload:l[5],_fetch:l[2],allow_file_downloads:l[12]}}),e.$on("load",l[17]),{c(){al(e.$$.fragment)},m(n,i){fl(e,n,i),t=!0},p(n,i){const s={};i&64&&(s.target=n[6]),i&256&&(s.theme_mode=n[8]),i&65536&&(s.props=n[16].content.props),i&65536&&(s.type=n[16].content.component),i&512&&(s.components=n[9]),i&65536&&(s.value=n[16].content.value),i&24576&&(s.display_icon_button_wrapper_top_corner=n[14]>0&&n[13]),i&8&&(s.i18n=n[3]),i&32&&(s.upload=n[5]),i&4&&(s._fetch=n[2]),i&4096&&(s.allow_file_downloads=n[12]),e.$set(s)},i(n){t||(Wt(e.$$.fragment,n),t=!0)},o(n){Gt(e.$$.fragment,n),t=!1},d(n){rl(e,n)}}}function sr(l){let e,t,n;return t=new tl({props:{message:l[16].content,latex_delimiters:l[0],sanitize_html:l[1],render_markdown:l[10],line_breaks:l[4],root:l[7],allow_tags:l[15]}}),t.$on("load",function(){nr(l[11])&&l[11].apply(this,arguments)}),{c(){e=yt("div"),al(t.$$.fragment),ce(e,"class","message-content")},m(i,s){ul(i,e,s),fl(t,e,null),n=!0},p(i,s){l=i;const o={};s&65536&&(o.message=l[16].content),s&1&&(o.latex_delimiters=l[0]),s&2&&(o.sanitize_html=l[1]),s&1024&&(o.render_markdown=l[10]),s&16&&(o.line_breaks=l[4]),s&128&&(o.root=l[7]),s&32768&&(o.allow_tags=l[15]),t.$set(o)},i(i){n||(Wt(t.$$.fragment,i),n=!0)},o(i){Gt(t.$$.fragment,i),n=!1},d(i){i&&_l(e),rl(t)}}}function ar(l){let e,t,n,i;const s=[sr,or,ir],o=[];function r(a,_){return a[16].type==="text"?0:a[16].type==="component"&&a[16].content.component in a[9]?1:a[16].type==="component"&&a[16].content.component==="file"?2:-1}return~(e=r(l))&&(t=o[e]=s[e](l)),{c(){t&&t.c(),n=xa()},m(a,_){~e&&o[e].m(a,_),ul(a,n,_),i=!0},p(a,[_]){let u=e;e=r(a),e===u?~e&&o[e].p(a,_):(t&&(er(),Gt(o[u],1,1,()=>{o[u]=null}),Xa()),~e?(t=o[e],t?t.p(a,_):(t=o[e]=s[e](a),t.c()),Wt(t,1),t.m(n.parentNode,n)):t=null)},i(a){i||(Wt(t),i=!0)},o(a){Gt(t),i=!1},d(a){a&&_l(n),~e&&o[e].d(a)}}}function rr(l,e,t){let{latex_delimiters:n}=e,{sanitize_html:i}=e,{_fetch:s}=e,{i18n:o}=e,{line_breaks:r}=e,{upload:a}=e,{target:_}=e,{root:u}=e,{theme_mode:f}=e,{_components:c}=e,{render_markdown:b}=e,{scroll:m}=e,{allow_file_downloads:h}=e,{display_consecutive_in_same_bubble:w}=e,{thought_index:d}=e,{allow_tags:$=null}=e,{message:z}=e;const I=()=>m();return l.$$set=p=>{"latex_delimiters"in p&&t(0,n=p.latex_delimiters),"sanitize_html"in p&&t(1,i=p.sanitize_html),"_fetch"in p&&t(2,s=p._fetch),"i18n"in p&&t(3,o=p.i18n),"line_breaks"in p&&t(4,r=p.line_breaks),"upload"in p&&t(5,a=p.upload),"target"in p&&t(6,_=p.target),"root"in p&&t(7,u=p.root),"theme_mode"in p&&t(8,f=p.theme_mode),"_components"in p&&t(9,c=p._components),"render_markdown"in p&&t(10,b=p.render_markdown),"scroll"in p&&t(11,m=p.scroll),"allow_file_downloads"in p&&t(12,h=p.allow_file_downloads),"display_consecutive_in_same_bubble"in p&&t(13,w=p.display_consecutive_in_same_bubble),"thought_index"in p&&t(14,d=p.thought_index),"allow_tags"in p&&t(15,$=p.allow_tags),"message"in p&&t(16,z=p.message)},[n,i,s,o,r,a,_,u,f,c,b,m,h,w,d,$,z,I]}class eo extends Qa{constructor(e){super(),tr(this,e,rr,ar,lr,{latex_delimiters:0,sanitize_html:1,_fetch:2,i18n:3,line_breaks:4,upload:5,target:6,root:7,theme_mode:8,_components:9,render_markdown:10,scroll:11,allow_file_downloads:12,display_consecutive_in_same_bubble:13,thought_index:14,allow_tags:15,message:16})}get latex_delimiters(){return this.$$.ctx[0]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),O()}get sanitize_html(){return this.$$.ctx[1]}set sanitize_html(e){this.$$set({sanitize_html:e}),O()}get _fetch(){return this.$$.ctx[2]}set _fetch(e){this.$$set({_fetch:e}),O()}get i18n(){return this.$$.ctx[3]}set i18n(e){this.$$set({i18n:e}),O()}get line_breaks(){return this.$$.ctx[4]}set line_breaks(e){this.$$set({line_breaks:e}),O()}get upload(){return this.$$.ctx[5]}set upload(e){this.$$set({upload:e}),O()}get target(){return this.$$.ctx[6]}set target(e){this.$$set({target:e}),O()}get root(){return this.$$.ctx[7]}set root(e){this.$$set({root:e}),O()}get theme_mode(){return this.$$.ctx[8]}set theme_mode(e){this.$$set({theme_mode:e}),O()}get _components(){return this.$$.ctx[9]}set _components(e){this.$$set({_components:e}),O()}get render_markdown(){return this.$$.ctx[10]}set render_markdown(e){this.$$set({render_markdown:e}),O()}get scroll(){return this.$$.ctx[11]}set scroll(e){this.$$set({scroll:e}),O()}get allow_file_downloads(){return this.$$.ctx[12]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),O()}get display_consecutive_in_same_bubble(){return this.$$.ctx[13]}set display_consecutive_in_same_bubble(e){this.$$set({display_consecutive_in_same_bubble:e}),O()}get thought_index(){return this.$$.ctx[14]}set thought_index(e){this.$$set({thought_index:e}),O()}get allow_tags(){return this.$$.ctx[15]}set allow_tags(e){this.$$set({allow_tags:e}),O()}get message(){return this.$$.ctx[16]}set message(e){this.$$set({message:e}),O()}}const{SvelteComponent:_r,add_render_callback:ur,append:lt,attr:ve,check_outros:cl,create_bidirectional_transition:Ql,create_component:fn,destroy_component:cn,destroy_each:fr,detach:re,element:jt,ensure_array_like:Xl,flush:J,group_outros:ml,init:cr,insert:_e,listen:xl,mount_component:mn,run_all:mr,safe_not_equal:hr,set_data:wn,set_style:ei,space:Et,stop_propagation:dr,text:Je,toggle_class:ti,transition_in:me,transition_out:Le}=window.__gradio__svelte__internal;function ni(l,e,t){const n=l.slice();return n[21]=e[t],n[23]=t,n}function li(l){let e;return{c(){e=jt("span"),ve(e,"class","loading-spinner svelte-i6yrue")},m(t,n){_e(t,e,n)},d(t){t&&re(e)}}}function ii(l){let e,t,n=l[16].metadata.log&&oi(l),i=l[16].metadata.duration!==void 0&&si(l);return{c(){e=jt("span"),n&&n.c(),t=Et(),i&&i.c(),ve(e,"class","duration svelte-i6yrue")},m(s,o){_e(s,e,o),n&&n.m(e,null),lt(e,t),i&&i.m(e,null)},p(s,o){s[16].metadata.log?n?n.p(s,o):(n=oi(s),n.c(),n.m(e,t)):n&&(n.d(1),n=null),s[16].metadata.duration!==void 0?i?i.p(s,o):(i=si(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&re(e),n&&n.d(),i&&i.d()}}}function oi(l){let e=l[16].metadata.log+"",t;return{c(){t=Je(e)},m(n,i){_e(n,t,i)},p(n,i){i&65536&&e!==(e=n[16].metadata.log+"")&&wn(t,e)},d(n){n&&re(t)}}}function si(l){let e,t,n;function i(r,a){return a&65536&&(t=null),t==null&&(t=!!Number.isInteger(r[16].metadata.duration)),t?wr:r[16].metadata.duration>=.1?br:gr}let s=i(l,-1),o=s(l);return{c(){e=Je("("),o.c(),n=Je(")")},m(r,a){_e(r,e,a),o.m(r,a),_e(r,n,a)},p(r,a){s===(s=i(r,a))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(n.parentNode,n)))},d(r){r&&(re(e),re(n)),o.d(r)}}}function gr(l){let e=(l[16].metadata.duration*1e3).toFixed(1)+"",t,n;return{c(){t=Je(e),n=Je("ms")},m(i,s){_e(i,t,s),_e(i,n,s)},p(i,s){s&65536&&e!==(e=(i[16].metadata.duration*1e3).toFixed(1)+"")&&wn(t,e)},d(i){i&&(re(t),re(n))}}}function br(l){let e=l[16].metadata.duration.toFixed(1)+"",t,n;return{c(){t=Je(e),n=Je("s")},m(i,s){_e(i,t,s),_e(i,n,s)},p(i,s){s&65536&&e!==(e=i[16].metadata.duration.toFixed(1)+"")&&wn(t,e)},d(i){i&&(re(t),re(n))}}}function wr(l){let e=l[16].metadata.duration+"",t,n;return{c(){t=Je(e),n=Je("s")},m(i,s){_e(i,t,s),_e(i,n,s)},p(i,s){s&65536&&e!==(e=i[16].metadata.duration+"")&&wn(t,e)},d(i){i&&(re(t),re(n))}}}function ai(l){let e,t,n,i,s;t=new eo({props:{message:l[16],sanitize_html:l[1],latex_delimiters:l[2],render_markdown:l[3],_components:l[4],upload:l[5],thought_index:l[6],target:l[7],root:l[8],theme_mode:l[9],_fetch:l[10],scroll:l[11],allow_file_downloads:l[12],display_consecutive_in_same_bubble:l[13],i18n:l[14],line_breaks:l[15]}});let o=l[16].children?.length>0&&ri(l);return{c(){e=jt("div"),fn(t.$$.fragment),n=Et(),o&&o.c(),ve(e,"class","content svelte-i6yrue")},m(r,a){_e(r,e,a),mn(t,e,null),lt(e,n),o&&o.m(e,null),s=!0},p(r,a){const _={};a&65536&&(_.message=r[16]),a&2&&(_.sanitize_html=r[1]),a&4&&(_.latex_delimiters=r[2]),a&8&&(_.render_markdown=r[3]),a&16&&(_._components=r[4]),a&32&&(_.upload=r[5]),a&64&&(_.thought_index=r[6]),a&128&&(_.target=r[7]),a&256&&(_.root=r[8]),a&512&&(_.theme_mode=r[9]),a&1024&&(_._fetch=r[10]),a&2048&&(_.scroll=r[11]),a&4096&&(_.allow_file_downloads=r[12]),a&8192&&(_.display_consecutive_in_same_bubble=r[13]),a&16384&&(_.i18n=r[14]),a&32768&&(_.line_breaks=r[15]),t.$set(_),r[16].children?.length>0?o?(o.p(r,a),a&65536&&me(o,1)):(o=ri(r),o.c(),me(o,1),o.m(e,null)):o&&(ml(),Le(o,1,1,()=>{o=null}),cl())},i(r){s||(me(t.$$.fragment,r),me(o),r&&ur(()=>{s&&(i||(i=Ql(e,dl,{},!0)),i.run(1))}),s=!0)},o(r){Le(t.$$.fragment,r),Le(o),r&&(i||(i=Ql(e,dl,{},!1)),i.run(0)),s=!1},d(r){r&&re(e),cn(t),o&&o.d(),r&&i&&i.end()}}}function ri(l){let e,t,n=Xl(l[16].children),i=[];for(let o=0;o<n.length;o+=1)i[o]=_i(ni(l,n,o));const s=o=>Le(i[o],1,1,()=>{i[o]=null});return{c(){e=jt("div");for(let o=0;o<i.length;o+=1)i[o].c();ve(e,"class","children svelte-i6yrue")},m(o,r){_e(o,e,r);for(let a=0;a<i.length;a+=1)i[a]&&i[a].m(e,null);t=!0},p(o,r){if(r&131071){n=Xl(o[16].children);let a;for(a=0;a<n.length;a+=1){const _=ni(o,n,a);i[a]?(i[a].p(_,r),me(i[a],1)):(i[a]=_i(_),i[a].c(),me(i[a],1),i[a].m(e,null))}for(ml(),a=n.length;a<i.length;a+=1)s(a);cl()}},i(o){if(!t){for(let r=0;r<n.length;r+=1)me(i[r]);t=!0}},o(o){i=i.filter(Boolean);for(let r=0;r<i.length;r+=1)Le(i[r]);t=!1},d(o){o&&re(e),fr(i,o)}}}function _i(l){let e,t;return e=new to({props:{thought:l[21],rtl:l[0],sanitize_html:l[1],latex_delimiters:l[2],render_markdown:l[3],_components:l[4],upload:l[5],thought_index:l[6]+1,target:l[7],root:l[8],theme_mode:l[9],_fetch:l[10],scroll:l[11],allow_file_downloads:l[12],display_consecutive_in_same_bubble:l[13],i18n:l[14],line_breaks:l[15]}}),{c(){fn(e.$$.fragment)},m(n,i){mn(e,n,i),t=!0},p(n,i){const s={};i&65536&&(s.thought=n[21]),i&1&&(s.rtl=n[0]),i&2&&(s.sanitize_html=n[1]),i&4&&(s.latex_delimiters=n[2]),i&8&&(s.render_markdown=n[3]),i&16&&(s._components=n[4]),i&32&&(s.upload=n[5]),i&64&&(s.thought_index=n[6]+1),i&128&&(s.target=n[7]),i&256&&(s.root=n[8]),i&512&&(s.theme_mode=n[9]),i&1024&&(s._fetch=n[10]),i&2048&&(s.scroll=n[11]),i&4096&&(s.allow_file_downloads=n[12]),i&8192&&(s.display_consecutive_in_same_bubble=n[13]),i&16384&&(s.i18n=n[14]),i&32768&&(s.line_breaks=n[15]),e.$set(s)},i(n){t||(me(e.$$.fragment,n),t=!0)},o(n){Le(e.$$.fragment,n),t=!1},d(n){cn(e,n)}}}function kr(l){let e,t,n,i,s,o,r,a,_,u,f,c,b;i=new le({props:{Icon:Zo}}),o=new tl({props:{message:l[16].metadata?.title||"",render_markdown:l[3],latex_delimiters:l[2],sanitize_html:l[1],root:l[8]}});let m=l[16].metadata?.status==="pending"&&li(),h=(l[16]?.metadata?.log||l[16]?.metadata?.duration)&&ii(l),w=l[17]&&ai(l);return{c(){e=jt("div"),t=jt("div"),n=jt("span"),fn(i.$$.fragment),s=Et(),fn(o.$$.fragment),r=Et(),m&&m.c(),a=Et(),h&&h.c(),u=Et(),w&&w.c(),ve(n,"class","arrow svelte-i6yrue"),ei(n,"transform",l[17]?"rotate(180deg)":"rotate(0deg)"),ve(t,"class","title svelte-i6yrue"),ve(t,"aria-busy",_=l[16].content===""||l[16].content===null),ve(t,"role","button"),ve(t,"tabindex","0"),ti(t,"expanded",l[17]),ve(e,"class","thought-group svelte-i6yrue")},m(d,$){_e(d,e,$),lt(e,t),lt(t,n),mn(i,n,null),lt(t,s),mn(o,t,null),lt(t,r),m&&m.m(t,null),lt(t,a),h&&h.m(t,null),lt(e,u),w&&w.m(e,null),f=!0,c||(b=[xl(t,"click",dr(l[18])),xl(t,"keydown",l[20])],c=!0)},p(d,[$]){$&131072&&ei(n,"transform",d[17]?"rotate(180deg)":"rotate(0deg)");const z={};$&65536&&(z.message=d[16].metadata?.title||""),$&8&&(z.render_markdown=d[3]),$&4&&(z.latex_delimiters=d[2]),$&2&&(z.sanitize_html=d[1]),$&256&&(z.root=d[8]),o.$set(z),d[16].metadata?.status==="pending"?m||(m=li(),m.c(),m.m(t,a)):m&&(m.d(1),m=null),d[16]?.metadata?.log||d[16]?.metadata?.duration?h?h.p(d,$):(h=ii(d),h.c(),h.m(t,null)):h&&(h.d(1),h=null),(!f||$&65536&&_!==(_=d[16].content===""||d[16].content===null))&&ve(t,"aria-busy",_),(!f||$&131072)&&ti(t,"expanded",d[17]),d[17]?w?(w.p(d,$),$&131072&&me(w,1)):(w=ai(d),w.c(),me(w,1),w.m(e,null)):w&&(ml(),Le(w,1,1,()=>{w=null}),cl())},i(d){f||(me(i.$$.fragment,d),me(o.$$.fragment,d),me(w),f=!0)},o(d){Le(i.$$.fragment,d),Le(o.$$.fragment,d),Le(w),f=!1},d(d){d&&re(e),cn(i),cn(o),m&&m.d(),h&&h.d(),w&&w.d(),c=!1,mr(b)}}}function pr(l){return"children"in l}function vr(l,e,t){let n,{thought:i}=e,{rtl:s=!1}=e,{sanitize_html:o}=e,{latex_delimiters:r}=e,{render_markdown:a}=e,{_components:_}=e,{upload:u}=e,{thought_index:f}=e,{target:c}=e,{root:b}=e,{theme_mode:m}=e,{_fetch:h}=e,{scroll:w}=e,{allow_file_downloads:d}=e,{display_consecutive_in_same_bubble:$}=e,{i18n:z}=e,{line_breaks:I}=e,p;function x(){t(17,n=!n)}const ne=y=>y.key==="Enter"&&x();return l.$$set=y=>{"thought"in y&&t(19,i=y.thought),"rtl"in y&&t(0,s=y.rtl),"sanitize_html"in y&&t(1,o=y.sanitize_html),"latex_delimiters"in y&&t(2,r=y.latex_delimiters),"render_markdown"in y&&t(3,a=y.render_markdown),"_components"in y&&t(4,_=y._components),"upload"in y&&t(5,u=y.upload),"thought_index"in y&&t(6,f=y.thought_index),"target"in y&&t(7,c=y.target),"root"in y&&t(8,b=y.root),"theme_mode"in y&&t(9,m=y.theme_mode),"_fetch"in y&&t(10,h=y._fetch),"scroll"in y&&t(11,w=y.scroll),"allow_file_downloads"in y&&t(12,d=y.allow_file_downloads),"display_consecutive_in_same_bubble"in y&&t(13,$=y.display_consecutive_in_same_bubble),"i18n"in y&&t(14,z=y.i18n),"line_breaks"in y&&t(15,I=y.line_breaks)},l.$$.update=()=>{l.$$.dirty&524288&&t(16,p={...i,children:pr(i)?i.children:[]}),l.$$.dirty&65536&&t(17,n=p.metadata?.status!=="done")},[s,o,r,a,_,u,f,c,b,m,h,w,d,$,z,I,p,n,x,i,ne]}class to extends _r{constructor(e){super(),cr(this,e,vr,kr,hr,{thought:19,rtl:0,sanitize_html:1,latex_delimiters:2,render_markdown:3,_components:4,upload:5,thought_index:6,target:7,root:8,theme_mode:9,_fetch:10,scroll:11,allow_file_downloads:12,display_consecutive_in_same_bubble:13,i18n:14,line_breaks:15})}get thought(){return this.$$.ctx[19]}set thought(e){this.$$set({thought:e}),J()}get rtl(){return this.$$.ctx[0]}set rtl(e){this.$$set({rtl:e}),J()}get sanitize_html(){return this.$$.ctx[1]}set sanitize_html(e){this.$$set({sanitize_html:e}),J()}get latex_delimiters(){return this.$$.ctx[2]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),J()}get render_markdown(){return this.$$.ctx[3]}set render_markdown(e){this.$$set({render_markdown:e}),J()}get _components(){return this.$$.ctx[4]}set _components(e){this.$$set({_components:e}),J()}get upload(){return this.$$.ctx[5]}set upload(e){this.$$set({upload:e}),J()}get thought_index(){return this.$$.ctx[6]}set thought_index(e){this.$$set({thought_index:e}),J()}get target(){return this.$$.ctx[7]}set target(e){this.$$set({target:e}),J()}get root(){return this.$$.ctx[8]}set root(e){this.$$set({root:e}),J()}get theme_mode(){return this.$$.ctx[9]}set theme_mode(e){this.$$set({theme_mode:e}),J()}get _fetch(){return this.$$.ctx[10]}set _fetch(e){this.$$set({_fetch:e}),J()}get scroll(){return this.$$.ctx[11]}set scroll(e){this.$$set({scroll:e}),J()}get allow_file_downloads(){return this.$$.ctx[12]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),J()}get display_consecutive_in_same_bubble(){return this.$$.ctx[13]}set display_consecutive_in_same_bubble(e){this.$$set({display_consecutive_in_same_bubble:e}),J()}get i18n(){return this.$$.ctx[14]}set i18n(e){this.$$set({i18n:e}),J()}get line_breaks(){return this.$$.ctx[15]}set line_breaks(e){this.$$set({line_breaks:e}),J()}}const{SvelteComponent:$r,append:Pn,assign:no,attr:K,binding_callbacks:Cr,check_outros:At,create_component:Kt,destroy_component:Qt,destroy_each:yr,detach:Re,element:Ht,empty:lo,ensure_array_like:ui,flush:H,get_spread_object:io,get_spread_update:oo,group_outros:Tt,init:zr,insert:Oe,listen:Kn,mount_component:Xt,noop:fi,null_to_empty:ci,run_all:Sr,safe_not_equal:jr,set_input_value:mi,set_style:Ue,space:Qn,toggle_class:D,transition_in:Z,transition_out:W}=window.__gradio__svelte__internal;function hi(l,e,t){const n=l.slice();return n[47]=e[t],n[48]=e,n[49]=t,n}function di(l){let e,t,n;return t=new Yt({props:{class:"avatar-image",src:l[2]?.url,alt:l[4]+" avatar"}}),{c(){e=Ht("div"),Kt(t.$$.fragment),K(e,"class","avatar-container svelte-pcjl1g")},m(i,s){Oe(i,e,s),Xt(t,e,null),n=!0},p(i,s){const o={};s[0]&4&&(o.src=i[2]?.url),s[0]&16&&(o.alt=i[4]+" avatar"),t.$set(o)},i(i){n||(Z(t.$$.fragment,i),n=!0)},o(i){W(t.$$.fragment,i),n=!1},d(i){i&&Re(e),Qt(t)}}}function Hr(l){let e,t,n,i,s,o=l[49],r,a,_;const u=[Mr,Lr],f=[];function c(d,$){return d[47]?.metadata?.title?0:1}t=c(l),n=f[t]=u[t](l);const b=()=>l[43](e,o),m=()=>l[43](null,o);function h(){return l[44](l[47])}function w(...d){return l[45](l[47],...d)}return{c(){e=Ht("div"),n.c(),K(e,"data-testid",l[4]),K(e,"dir",i=l[12]?"rtl":"ltr"),K(e,"aria-label",s=l[4]+"'s message: "+ki(l[47])),K(e,"class","svelte-pcjl1g"),D(e,"latest",l[21]===l[1].length-1),D(e,"message-markdown-disabled",!l[7]),D(e,"selectable",l[10]),Ue(e,"user-select","text"),Ue(e,"cursor",l[10]?"pointer":"auto"),Ue(e,"text-align",l[12]?"right":"left")},m(d,$){Oe(d,e,$),f[t].m(e,null),b(),r=!0,a||(_=[Kn(e,"click",h),Kn(e,"keydown",w)],a=!0)},p(d,$){l=d;let z=t;t=c(l),t===z?f[t].p(l,$):(Tt(),W(f[z],1,1,()=>{f[z]=null}),At(),n=f[t],n?n.p(l,$):(n=f[t]=u[t](l),n.c()),Z(n,1),n.m(e,null)),(!r||$[0]&16)&&K(e,"data-testid",l[4]),(!r||$[0]&4096&&i!==(i=l[12]?"rtl":"ltr"))&&K(e,"dir",i),(!r||$[0]&48&&s!==(s=l[4]+"'s message: "+ki(l[47])))&&K(e,"aria-label",s),o!==l[49]&&(m(),o=l[49],b()),(!r||$[0]&2097154)&&D(e,"latest",l[21]===l[1].length-1),(!r||$[0]&128)&&D(e,"message-markdown-disabled",!l[7]),(!r||$[0]&1024)&&D(e,"selectable",l[10]),$[0]&1024&&Ue(e,"cursor",l[10]?"pointer":"auto"),$[0]&4096&&Ue(e,"text-align",l[12]?"right":"left")},i(d){r||(Z(n),r=!0)},o(d){W(n),r=!1},d(d){d&&Re(e),f[t].d(),m(),a=!1,Sr(_)}}}function qr(l){let e,t,n;return{c(){e=Ht("textarea"),K(e,"class","edit-textarea svelte-pcjl1g"),e.autofocus=!0,Ue(e,"width",`max(${l[29]}px, 160px)`),Ue(e,"min-height",`${l[30]}px`)},m(i,s){Oe(i,e,s),mi(e,l[0]),e.focus(),t||(n=Kn(e,"input",l[42]),t=!0)},p(i,s){s[0]&1&&mi(e,i[0]),s[0]&536870912&&Ue(e,"width",`max(${i[29]}px, 160px)`),s[0]&1073741824&&Ue(e,"min-height",`${i[30]}px`)},i:fi,o:fi,d(i){i&&Re(e),t=!1,n()}}}function Lr(l){let e,t;return e=new eo({props:{message:l[47],sanitize_html:l[9],allow_tags:l[27],latex_delimiters:l[8],render_markdown:l[7],_components:l[20],upload:l[16],thought_index:l[49],target:l[17],root:l[18],theme_mode:l[19],_fetch:l[11],scroll:l[22],allow_file_downloads:l[23],display_consecutive_in_same_bubble:l[25],i18n:l[14],line_breaks:l[15]}}),{c(){Kt(e.$$.fragment)},m(n,i){Xt(e,n,i),t=!0},p(n,i){const s={};i[0]&32&&(s.message=n[47]),i[0]&512&&(s.sanitize_html=n[9]),i[0]&134217728&&(s.allow_tags=n[27]),i[0]&256&&(s.latex_delimiters=n[8]),i[0]&128&&(s.render_markdown=n[7]),i[0]&1048576&&(s._components=n[20]),i[0]&65536&&(s.upload=n[16]),i[0]&131072&&(s.target=n[17]),i[0]&262144&&(s.root=n[18]),i[0]&524288&&(s.theme_mode=n[19]),i[0]&2048&&(s._fetch=n[11]),i[0]&4194304&&(s.scroll=n[22]),i[0]&8388608&&(s.allow_file_downloads=n[23]),i[0]&33554432&&(s.display_consecutive_in_same_bubble=n[25]),i[0]&16384&&(s.i18n=n[14]),i[0]&32768&&(s.line_breaks=n[15]),e.$set(s)},i(n){t||(Z(e.$$.fragment,n),t=!0)},o(n){W(e.$$.fragment,n),t=!1},d(n){Qt(e,n)}}}function Mr(l){let e,t;return e=new to({props:{thought:l[47],rtl:l[12],sanitize_html:l[9],latex_delimiters:l[8],render_markdown:l[7],_components:l[20],upload:l[16],thought_index:l[49],target:l[17],root:l[18],theme_mode:l[19],_fetch:l[11],scroll:l[22],allow_file_downloads:l[23],display_consecutive_in_same_bubble:l[25],i18n:l[14],line_breaks:l[15]}}),{c(){Kt(e.$$.fragment)},m(n,i){Xt(e,n,i),t=!0},p(n,i){const s={};i[0]&32&&(s.thought=n[47]),i[0]&4096&&(s.rtl=n[12]),i[0]&512&&(s.sanitize_html=n[9]),i[0]&256&&(s.latex_delimiters=n[8]),i[0]&128&&(s.render_markdown=n[7]),i[0]&1048576&&(s._components=n[20]),i[0]&65536&&(s.upload=n[16]),i[0]&131072&&(s.target=n[17]),i[0]&262144&&(s.root=n[18]),i[0]&524288&&(s.theme_mode=n[19]),i[0]&2048&&(s._fetch=n[11]),i[0]&4194304&&(s.scroll=n[22]),i[0]&8388608&&(s.allow_file_downloads=n[23]),i[0]&33554432&&(s.display_consecutive_in_same_bubble=n[25]),i[0]&16384&&(s.i18n=n[14]),i[0]&32768&&(s.line_breaks=n[15]),e.$set(s)},i(n){t||(Z(e.$$.fragment,n),t=!0)},o(n){W(e.$$.fragment,n),t=!1},d(n){Qt(e,n)}}}function gi(l){let e,t;const n=[l[31],{current_feedback:l[26]}];let i={};for(let s=0;s<n.length;s+=1)i=no(i,n[s]);return e=new Xi({props:i}),e.$on("copy",l[46]),{c(){Kt(e.$$.fragment)},m(s,o){Xt(e,s,o),t=!0},p(s,o){const r=o[0]&67108864|o[1]&1?oo(n,[o[1]&1&&io(s[31]),o[0]&67108864&&{current_feedback:s[26]}]):{};e.$set(r)},i(s){t||(Z(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){Qt(e,s)}}}function bi(l){let e,t,n,i,s,o,r;const a=[qr,Hr],_=[];function u(c,b){return c[24]&&c[49]===c[5].length-1&&c[47].type==="text"?0:1}t=u(l),n=_[t]=a[t](l);let f=l[6]==="panel"&&gi(l);return{c(){e=Ht("div"),n.c(),s=Qn(),f&&f.c(),o=lo(),K(e,"class",i="message "+(l[25]?"":l[4])+" svelte-pcjl1g"),D(e,"panel-full-width",!0),D(e,"message-markdown-disabled",!l[7]),D(e,"component",l[47].type==="component"),D(e,"html",kl(l[47])&&l[47].content.component==="html"),D(e,"thought",l[49]>0)},m(c,b){Oe(c,e,b),_[t].m(e,null),Oe(c,s,b),f&&f.m(c,b),Oe(c,o,b),r=!0},p(c,b){let m=t;t=u(c),t===m?_[t].p(c,b):(Tt(),W(_[m],1,1,()=>{_[m]=null}),At(),n=_[t],n?n.p(c,b):(n=_[t]=a[t](c),n.c()),Z(n,1),n.m(e,null)),(!r||b[0]&33554448&&i!==(i="message "+(c[25]?"":c[4])+" svelte-pcjl1g"))&&K(e,"class",i),(!r||b[0]&33554448)&&D(e,"panel-full-width",!0),(!r||b[0]&33554576)&&D(e,"message-markdown-disabled",!c[7]),(!r||b[0]&33554480)&&D(e,"component",c[47].type==="component"),(!r||b[0]&33554480)&&D(e,"html",kl(c[47])&&c[47].content.component==="html"),(!r||b[0]&33554448)&&D(e,"thought",c[49]>0),c[6]==="panel"?f?(f.p(c,b),b[0]&64&&Z(f,1)):(f=gi(c),f.c(),Z(f,1),f.m(o.parentNode,o)):f&&(Tt(),W(f,1,1,()=>{f=null}),At())},i(c){r||(Z(n),Z(f),r=!0)},o(c){W(n),W(f),r=!1},d(c){c&&(Re(e),Re(s),Re(o)),_[t].d(),f&&f.d(c)}}}function wi(l){let e,t;const n=[l[31]];let i={};for(let s=0;s<n.length;s+=1)i=no(i,n[s]);return e=new Xi({props:i}),{c(){Kt(e.$$.fragment)},m(s,o){Xt(e,s,o),t=!0},p(s,o){const r=o[1]&1?oo(n,[io(s[31])]):{};e.$set(r)},i(s){t||(Z(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){Qt(e,s)}}}function Nr(l){let e,t,n,i,s,o,r,a,_,u=l[2]!==null&&di(l),f=ui(l[5]),c=[];for(let h=0;h<f.length;h+=1)c[h]=bi(hi(l,f,h));const b=h=>W(c[h],1,1,()=>{c[h]=null});let m=l[6]==="bubble"&&wi(l);return{c(){e=Ht("div"),u&&u.c(),t=Qn(),n=Ht("div"),i=Ht("div");for(let h=0;h<c.length;h+=1)c[h].c();r=Qn(),m&&m.c(),a=lo(),K(i,"class",s=ci(l[25]?l[4]:"")+" svelte-pcjl1g"),D(i,"message",l[25]),K(n,"class","flex-wrap svelte-pcjl1g"),D(n,"role",l[4]),D(n,"component-wrap",l[5][0].type==="component"),K(e,"class",o="message-row "+l[6]+" "+l[4]+"-row svelte-pcjl1g"),D(e,"with_avatar",l[2]!==null),D(e,"with_opposite_avatar",l[3]!==null)},m(h,w){Oe(h,e,w),u&&u.m(e,null),Pn(e,t),Pn(e,n),Pn(n,i);for(let d=0;d<c.length;d+=1)c[d]&&c[d].m(i,null);Oe(h,r,w),m&&m.m(h,w),Oe(h,a,w),_=!0},p(h,w){if(h[2]!==null?u?(u.p(h,w),w[0]&4&&Z(u,1)):(u=di(h),u.c(),Z(u,1),u.m(e,t)):u&&(Tt(),W(u,1,1,()=>{u=null}),At()),w[0]&2147483635|w[1]&3){f=ui(h[5]);let d;for(d=0;d<f.length;d+=1){const $=hi(h,f,d);c[d]?(c[d].p($,w),Z(c[d],1)):(c[d]=bi($),c[d].c(),Z(c[d],1),c[d].m(i,null))}for(Tt(),d=f.length;d<c.length;d+=1)b(d);At()}(!_||w[0]&33554448&&s!==(s=ci(h[25]?h[4]:"")+" svelte-pcjl1g"))&&K(i,"class",s),(!_||w[0]&33554448)&&D(i,"message",h[25]),(!_||w[0]&16)&&D(n,"role",h[4]),(!_||w[0]&32)&&D(n,"component-wrap",h[5][0].type==="component"),(!_||w[0]&80&&o!==(o="message-row "+h[6]+" "+h[4]+"-row svelte-pcjl1g"))&&K(e,"class",o),(!_||w[0]&84)&&D(e,"with_avatar",h[2]!==null),(!_||w[0]&88)&&D(e,"with_opposite_avatar",h[3]!==null),h[6]==="bubble"?m?(m.p(h,w),w[0]&64&&Z(m,1)):(m=wi(h),m.c(),Z(m,1),m.m(a.parentNode,a)):m&&(Tt(),W(m,1,1,()=>{m=null}),At())},i(h){if(!_){Z(u);for(let w=0;w<f.length;w+=1)Z(c[w]);Z(m),_=!0}},o(h){W(u),c=c.filter(Boolean);for(let w=0;w<c.length;w+=1)W(c[w]);W(m),_=!1},d(h){h&&(Re(e),Re(r),Re(a)),u&&u.d(),yr(c,h),m&&m.d(h)}}}let Vr=!1;function ki(l){return l.type==="text"?l.content:l.type==="component"&&l.content.component==="file"?Array.isArray(l.content.value)?`file of extension type: ${l.content.value[0].orig_name?.split(".").pop()}`:`file of extension type: ${l.content.value?.orig_name?.split(".").pop()}`+(l.content.value?.orig_name??""):`a component of type ${l.content.component??"unknown"}`}function Dr(l,e,t){let{value:n}=e,{avatar_img:i}=e,{opposite_avatar_img:s=null}=e,{role:o="user"}=e,{messages:r=[]}=e,{layout:a}=e,{render_markdown:_}=e,{latex_delimiters:u}=e,{sanitize_html:f}=e,{selectable:c}=e,{_fetch:b}=e,{rtl:m}=e,{dispatch:h}=e,{i18n:w}=e,{line_breaks:d}=e,{upload:$}=e,{target:z}=e,{root:I}=e,{theme_mode:p}=e,{_components:x}=e,{i:ne}=e,{show_copy_button:y}=e,{generating:he}=e,{feedback_options:S}=e,{show_like:Me}=e,{show_edit:Ne}=e,{show_retry:Ve}=e,{show_undo:ze}=e,{msg_format:B}=e,{handle_action:De}=e,{scroll:Ye}=e,{allow_file_downloads:Ke}=e,{in_edit_mode:de}=e,{edit_message:ge}=e,{display_consecutive_in_same_bubble:Qe}=e,{current_feedback:Ie=null}=e,{allow_tags:Xe=null}=e,ue=[],xe=0,et=0;function Be(v,be){h("select",{index:be.index,value:be.content})}let Se;function Ee(){ge=this.value,t(0,ge)}function G(v,be){Cr[v?"unshift":"push"](()=>{ue[be]=v,t(28,ue)})}const tt=v=>Be(ne,v),Y=(v,be)=>{be.key==="Enter"&&Be(ne,v)},Dt=v=>h("copy",v.detail);return l.$$set=v=>
5{"value"in v&&t(1,n=v.value),"avatar_img"in v&&t(2,i=v.avatar_img),"opposite_avatar_img"in v&&t(3,s=v.opposite_avatar_img),"role"in v&&t(4,o=v.role),"messages"in v&&t(5,r=v.messages),"layout"in v&&t(6,a=v.layout),"render_markdown"in v&&t(7,_=v.render_markdown),"latex_delimiters"in v&&t(8,u=v.latex_delimiters),"sanitize_html"in v&&t(9,f=v.sanitize_html),"selectable"in v&&t(10,c=v.selectable),"_fetch"in v&&t(11,b=v._fetch),"rtl"in v&&t(12,m=v.rtl),"dispatch"in v&&t(13,h=v.dispatch),"i18n"in v&&t(14,w=v.i18n),"line_breaks"in v&&t(15,d=v.line_breaks),"upload"in v&&t(16,$=v.upload),"target"in v&&t(17,z=v.target),"root"in v&&t(18,I=v.root),"theme_mode"in v&&t(19,p=v.theme_mode),"_components"in v&&t(20,x=v._components),"i"in v&&t(21,ne=v.i),"show_copy_button"in v&&t(33,y=v.show_copy_button),"generating"in v&&t(34,he=v.generating),"feedback_options"in v&&t(35,S=v.feedback_options),"show_like"in v&&t(36,Me=v.show_like),"show_edit"in v&&t(37,Ne=v.show_edit),"show_retry"in v&&t(38,Ve=v.show_retry),"show_undo"in v&&t(39,ze=v.show_undo),"msg_format"in v&&t(40,B=v.msg_format),"handle_action"in v&&t(41,De=v.handle_action),"scroll"in v&&t(22,Ye=v.scroll),"allow_file_downloads"in v&&t(23,Ke=v.allow_file_downloads),"in_edit_mode"in v&&t(24,de=v.in_edit_mode),"edit_message"in v&&t(0,ge=v.edit_message),"display_consecutive_in_same_bubble"in v&&t(25,Qe=v.display_consecutive_in_same_bubble),"current_feedback"in v&&t(26,Ie=v.current_feedback),"allow_tags"in v&&t(27,Xe=v.allow_tags)},l.$$.update=()=>{l.$$.dirty[0]&285212672&&de&&!Vr&&(t(29,xe=ue[ue.length-1]?.clientWidth),t(30,et=ue[ue.length-1]?.clientHeight)),l.$$.dirty[0]&83894388|l.$$.dirty[1]&2044&&t(31,Se={handle_action:De,likeable:Me,feedback_options:S,show_retry:Ve,show_undo:ze,show_edit:Ne,in_edit_mode:de,generating:he,show_copy_button:y,message:B==="tuples"?r[0]:r,position:o==="user"?"right":"left",avatar:i,layout:a,dispatch:h,current_feedback:Ie})},[ge,n,i,s,o,r,a,_,u,f,c,b,m,h,w,d,$,z,I,p,x,ne,Ye,Ke,de,Qe,Ie,Xe,ue,xe,et,Se,Be,y,he,S,Me,Ne,Ve,ze,B,De,Ee,G,tt,Y,Dt]}class Ir extends $r{constructor(e){super(),zr(this,e,Dr,Nr,jr,{value:1,avatar_img:2,opposite_avatar_img:3,role:4,messages:5,layout:6,render_markdown:7,latex_delimiters:8,sanitize_html:9,selectable:10,_fetch:11,rtl:12,dispatch:13,i18n:14,line_breaks:15,upload:16,target:17,root:18,theme_mode:19,_components:20,i:21,show_copy_button:33,generating:34,feedback_options:35,show_like:36,show_edit:37,show_retry:38,show_undo:39,msg_format:40,handle_action:41,scroll:22,allow_file_downloads:23,in_edit_mode:24,edit_message:0,display_consecutive_in_same_bubble:25,current_feedback:26,allow_tags:27},null,[-1,-1])}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),H()}get avatar_img(){return this.$$.ctx[2]}set avatar_img(e){this.$$set({avatar_img:e}),H()}get opposite_avatar_img(){return this.$$.ctx[3]}set opposite_avatar_img(e){this.$$set({opposite_avatar_img:e}),H()}get role(){return this.$$.ctx[4]}set role(e){this.$$set({role:e}),H()}get messages(){return this.$$.ctx[5]}set messages(e){this.$$set({messages:e}),H()}get layout(){return this.$$.ctx[6]}set layout(e){this.$$set({layout:e}),H()}get render_markdown(){return this.$$.ctx[7]}set render_markdown(e){this.$$set({render_markdown:e}),H()}get latex_delimiters(){return this.$$.ctx[8]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),H()}get sanitize_html(){return this.$$.ctx[9]}set sanitize_html(e){this.$$set({sanitize_html:e}),H()}get selectable(){return this.$$.ctx[10]}set selectable(e){this.$$set({selectable:e}),H()}get _fetch(){return this.$$.ctx[11]}set _fetch(e){this.$$set({_fetch:e}),H()}get rtl(){return this.$$.ctx[12]}set rtl(e){this.$$set({rtl:e}),H()}get dispatch(){return this.$$.ctx[13]}set dispatch(e){this.$$set({dispatch:e}),H()}get i18n(){return this.$$.ctx[14]}set i18n(e){this.$$set({i18n:e}),H()}get line_breaks(){return this.$$.ctx[15]}set line_breaks(e){this.$$set({line_breaks:e}),H()}get upload(){return this.$$.ctx[16]}set upload(e){this.$$set({upload:e}),H()}get target(){return this.$$.ctx[17]}set target(e){this.$$set({target:e}),H()}get root(){return this.$$.ctx[18]}set root(e){this.$$set({root:e}),H()}get theme_mode(){return this.$$.ctx[19]}set theme_mode(e){this.$$set({theme_mode:e}),H()}get _components(){return this.$$.ctx[20]}set _components(e){this.$$set({_components:e}),H()}get i(){return this.$$.ctx[21]}set i(e){this.$$set({i:e}),H()}get show_copy_button(){return this.$$.ctx[33]}set show_copy_button(e){this.$$set({show_copy_button:e}),H()}
vendor: 46,711 bytes, lines 5-8
5get generating(){return this.$$.ctx[34]}set generating(e){this.$$set({generating:e}),H()}get feedback_options(){return this.$$.ctx[35]}set feedback_options(e){this.$$set({feedback_options:e}),H()}get show_like(){return this.$$.ctx[36]}set show_like(e){this.$$set({show_like:e}),H()}get show_edit(){return this.$$.ctx[37]}set show_edit(e){this.$$set({show_edit:e}),H()}get show_retry(){return this.$$.ctx[38]}set show_retry(e){this.$$set({show_retry:e}),H()}get show_undo(){return this.$$.ctx[39]}set show_undo(e){this.$$set({show_undo:e}),H()}get msg_format(){return this.$$.ctx[40]}set msg_format(e){this.$$set({msg_format:e}),H()}get handle_action(){return this.$$.ctx[41]}set handle_action(e){this.$$set({handle_action:e}),H()}get scroll(){return this.$$.ctx[22]}set scroll(e){this.$$set({scroll:e}),H()}get allow_file_downloads(){return this.$$.ctx[23]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),H()}get in_edit_mode(){return this.$$.ctx[24]}set in_edit_mode(e){this.$$set({in_edit_mode:e}),H()}get edit_message(){return this.$$.ctx[0]}set edit_message(e){this.$$set({edit_message:e}),H()}get display_consecutive_in_same_bubble(){return this.$$.ctx[25]}set display_consecutive_in_same_bubble(e){this.$$set({display_consecutive_in_same_bubble:e}),H()}get current_feedback(){return this.$$.ctx[26]}set current_feedback(e){this.$$set({current_feedback:e}),H()}get allow_tags(){return this.$$.ctx[27]}set allow_tags(e){this.$$set({allow_tags:e}),H()}}const{SvelteComponent:Br,append:Rn,attr:nt,check_outros:Er,create_component:Ar,destroy_component:Tr,detach:so,element:sn,flush:pi,group_outros:Fr,init:Zr,insert:ao,mount_component:Ur,safe_not_equal:Pr,space:Rr,toggle_class:ln,transition_in:an,transition_out:Xn}=window.__gradio__svelte__internal;function vi(l){let e,t,n;return t=new Yt({props:{class:"avatar-image",src:l[1][1].url,alt:"bot avatar"}}),{c(){e=sn("div"),Ar(t.$$.fragment),nt(e,"class","avatar-container svelte-1u5aj92")},m(i,s){ao(i,e,s),Ur(t,e,null),n=!0},p(i,s){const o={};s&2&&(o.src=i[1][1].url),t.$set(o)},i(i){n||(an(t.$$.fragment,i),n=!0)},o(i){Xn(t.$$.fragment,i),n=!1},d(i){i&&so(e),Tr(t)}}}function Or(l){let e,t,n,i,s,o,r=l[1][1]!==null&&vi(l);return{c(){e=sn("div"),r&&r.c(),t=Rr(),n=sn("div"),i=sn("div"),i.innerHTML='<span class="sr-only">Loading content</span> <div class="dots svelte-1u5aj92"><div class="dot svelte-1u5aj92"></div> <div class="dot svelte-1u5aj92"></div> <div class="dot svelte-1u5aj92"></div></div>',nt(i,"class","message-content svelte-1u5aj92"),nt(n,"class",s="message bot pending "+l[0]+" svelte-1u5aj92"),nt(n,"role","status"),nt(n,"aria-label","Loading response"),nt(n,"aria-live","polite"),ln(n,"with_avatar",l[1][1]!==null),ln(n,"with_opposite_avatar",l[1][0]!==null),nt(e,"class","container svelte-1u5aj92")},m(a,_){ao(a,e,_),r&&r.m(e,null),Rn(e,t),Rn(e,n),Rn(n,i),o=!0},p(a,[_]){a[1][1]!==null?r?(r.p(a,_),_&2&&an(r,1)):(r=vi(a),r.c(),an(r,1),r.m(e,t)):r&&(Fr(),Xn(r,1,1,()=>{r=null}),Er()),(!o||_&1&&s!==(s="message bot pending "+a[0]+" svelte-1u5aj92"))&&nt(n,"class",s),(!o||_&3)&&ln(n,"with_avatar",a[1][1]!==null),(!o||_&3)&&ln(n,"with_opposite_avatar",a[1][0]!==null)},i(a){o||(an(r),o=!0)},o(a){Xn(r),o=!1},d(a){a&&so(e),r&&r.d()}}}function Jr(l,e,t){let{layout:n="bubble"}=e,{avatar_images:i=[null,null]}=e;return l.$$set=s=>{"layout"in s&&t(0,n=s.layout),"avatar_images"in s&&t(1,i=s.avatar_images)},[n,i]}class Wr extends Br{constructor(e){super(),Zr(this,e,Jr,Or,Pr,{layout:0,avatar_images:1})}get layout(){return this.$$.ctx[0]}set layout(e){this.$$set({layout:e}),pi()}get avatar_images(){return this.$$.ctx[1]}set avatar_images(e){this.$$set({avatar_images:e}),pi()}}const{SvelteComponent:Gr,append:U,attr:C,check_outros:rt,create_component:ct,destroy_component:mt,destroy_each:ro,detach:P,element:A,empty:_o,ensure_array_like:hn,flush:on,group_outros:_t,init:Yr,insert:R,listen:Kr,mount_component:ht,noop:qt,safe_not_equal:Qr,set_data:kn,space:Ut,src_url_equal:dn,text:Nt,transition_in:M,transition_out:E}=window.__gradio__svelte__internal,{createEventDispatcher:Xr}=window.__gradio__svelte__internal;function $i(l,e,t){const n=l.slice();return n[7]=e[t],n[9]=t,n}function Ci(l,e,t){const n=l.slice();return n[10]=e[t],n[9]=t,n}function yi(l){let e,t,n;return t=new tl({props:{message:l[1],latex_delimiters:l[2],root:l[3]}}),{c(){e=A("div"),ct(t.$$.fragment),C(e,"class","placeholder svelte-9pi8y1")},m(i,s){R(i,e,s),ht(t,e,null),n=!0},p(i,s){const o={};s&2&&(o.message=i[1]),s&4&&(o.latex_delimiters=i[2]),s&8&&(o.root=i[3]),t.$set(o)},i(i){n||(M(t.$$.fragment,i),n=!0)},o(i){E(t.$$.fragment,i),n=!1},d(i){i&&P(e),mt(t)}}}function zi(l){let e,t,n=hn(l[0]),i=[];for(let o=0;o<n.length;o+=1)i[o]=Li($i(l,n,o));const s=o=>E(i[o],1,1,()=>{i[o]=null});return{c(){e=A("div");for(let o=0;o<i.length;o+=1)i[o].c();C(e,"class","examples svelte-9pi8y1"),C(e,"role","list")},m(o,r){R(o,e,r);for(let a=0;a<i.length;a+=1)i[a]&&i[a].m(e,null);t=!0},p(o,r){if(r&17){n=hn(o[0]);let a;for(a=0;a<n.length;a+=1){const _=$i(o,n,a);i[a]?(i[a].p(_,r),M(i[a],1)):(i[a]=Li(_),i[a].c(),M(i[a],1),i[a].m(e,null))}for(_t(),a=n.length;a<i.length;a+=1)s(a);rt()}},i(o){if(!t){for(let r=0;r<n.length;r+=1)M(i[r]);t=!0}},o(o){i=i.filter(Boolean);for(let r=0;r<i.length;r+=1)E(i[r]);t=!1},d(o){o&&P(e),ro(i,o)}}}function xr(l){let e,t,n,i,s,o,r;const a=[s_,o_,i_,l_,n_],_=[];function u(f,c){return c&1&&(e=null),c&1&&(t=null),c&1&&(n=null),f[7].files.length>1?0:(e==null&&(e=!!f[7].files[0].mime_type?.includes("image")),e?1:(t==null&&(t=!!f[7].files[0].mime_type?.includes("video")),t?2:(n==null&&(n=!!f[7].files[0].mime_type?.includes("audio")),n?3:4)))}return i=u(l,-1),s=_[i]=a[i](l),{c(){s.c(),o=_o()},m(f,c){_[i].m(f,c),R(f,o,c),r=!0},p(f,c){let b=i;i=u(f,c),i===b?_[i].p(f,c):(_t(),E(_[b],1,1,()=>{_[b]=null}),rt(),s=_[i],s?s.p(f,c):(s=_[i]=a[i](f),s.c()),M(s,1),s.m(o.parentNode,o))},i(f){r||(M(s),r=!0)},o(f){E(s),r=!1},d(f){f&&P(o),_[i].d(f)}}}function e_(l){let e;return{c(){e=A("div"),e.innerHTML='<span class="text-icon-aa svelte-9pi8y1">Aa</span>',C(e,"class","example-icon svelte-9pi8y1"),C(e,"aria-hidden","true")},m(t,n){R(t,e,n)},p:qt,i:qt,o:qt,d(t){t&&P(e)}}}function t_(l){let e,t,n;return t=new Yt({props:{class:"example-image",src:l[7].icon.url,alt:"Example icon"}}),{c(){e=A("div"),ct(t.$$.fragment),C(e,"class","example-image-container svelte-9pi8y1")},m(i,s){R(i,e,s),ht(t,e,null),n=!0},p(i,s){const o={};s&1&&(o.src=i[7].icon.url),t.$set(o)},i(i){n||(M(t.$$.fragment,i),n=!0)},o(i){E(t.$$.fragment,i),n=!1},d(i){i&&P(e),mt(t)}}}function n_(l){let e,t,n,i;return t=new el({}),{c(){e=A("div"),ct(t.$$.fragment),C(e,"class","example-icon svelte-9pi8y1"),C(e,"aria-label",n=`File: ${l[7].files[0].orig_name}`)},m(s,o){R(s,e,o),ht(t,e,null),i=!0},p(s,o){(!i||o&1&&n!==(n=`File: ${s[7].files[0].orig_name}`))&&C(e,"aria-label",n)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){E(t.$$.fragment,s),i=!1},d(s){s&&P(e),mt(t)}}}function l_(l){let e,t,n,i;return t=new Gi({}),{c(){e=A("div"),ct(t.$$.fragment),C(e,"class","example-icon svelte-9pi8y1"),C(e,"aria-label",n=`File: ${l[7].files[0].orig_name}`)},m(s,o){R(s,e,o),ht(t,e,null),i=!0},p(s,o){(!i||o&1&&n!==(n=`File: ${s[7].files[0].orig_name}`))&&C(e,"aria-label",n)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){E(t.$$.fragment,s),i=!1},d(s){s&&P(e),mt(t)}}}function i_(l){let e,t,n;return{c(){e=A("div"),t=A("video"),C(t,"class","example-image"),dn(t.src,n=l[7].files[0].url)||C(t,"src",n),C(t,"aria-hidden","true"),C(e,"class","example-image-container svelte-9pi8y1")},m(i,s){R(i,e,s),U(e,t)},p(i,s){s&1&&!dn(t.src,n=i[7].files[0].url)&&C(t,"src",n)},i:qt,o:qt,d(i){i&&P(e)}}}function o_(l){let e,t,n;return t=new Yt({props:{class:"example-image",src:l[7].files[0].url,alt:l[7].files[0].orig_name||"Example image"}}),{c(){e=A("div"),ct(t.$$.fragment),C(e,"class","example-image-container svelte-9pi8y1")},m(i,s){R(i,e,s),ht(t,e,null),n=!0},p(i,s){const o={};s&1&&(o.src=i[7].files[0].url),s&1&&(o.alt=i[7].files[0].orig_name||"Example image"),t.$set(o)},i(i){n||(M(t.$$.fragment,i),n=!0)},o(i){E(t.$$.fragment,i),n=!1},d(i){i&&P(e),mt(t)}}}function s_(l){let e,t,n,i=hn(l[7].files.slice(0,4)),s=[];for(let a=0;a<i.length;a+=1)s[a]=Hi(Ci(l,i,a));const o=a=>E(s[a],1,1,()=>{s[a]=null});let r=l[7].files.length>4&&qi(l);return{c(){e=A("div");for(let a=0;a<s.length;a+=1)s[a].c();t=Ut(),r&&r.c(),C(e,"class","example-icons-grid svelte-9pi8y1"),C(e,"role","group"),C(e,"aria-label","Example attachments")},m(a,_){R(a,e,_);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null);U(e,t),r&&r.m(e,null),n=!0},p(a,_){if(_&1){i=hn(a[7].files.slice(0,4));let u;for(u=0;u<i.length;u+=1){const f=Ci(a,i,u);s[u]?(s[u].p(f,_),M(s[u],1)):(s[u]=Hi(f),s[u].c(),M(s[u],1),s[u].m(e,t))}for(_t(),u=i.length;u<s.length;u+=1)o(u);rt()}a[7].files.length>4?r?r.p(a,_):(r=qi(a),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i(a){if(!n){for(let _=0;_<i.length;_+=1)M(s[_]);n=!0}},o(a){s=s.filter(Boolean);for(let _=0;_<s.length;_+=1)E(s[_]);n=!1},d(a){a&&P(e),ro(s,a),r&&r.d()}}}function a_(l){let e,t,n,i,s,o;const r=[f_,u_],a=[];function _(u,f){return f&1&&(t=null),t==null&&(t=!!u[10].mime_type?.includes("audio")),t?0:1}return n=_(l,-1),i=a[n]=r[n](l),{c(){e=A("div"),i.c(),C(e,"class","example-icon svelte-9pi8y1"),C(e,"aria-label",s=`File: ${l[10].orig_name}`)},m(u,f){R(u,e,f),a[n].m(e,null),o=!0},p(u,f){let c=n;n=_(u,f),n!==c&&(_t(),E(a[c],1,1,()=>{a[c]=null}),rt(),i=a[n],i||(i=a[n]=r[n](u),i.c()),M(i,1),i.m(e,null)),(!o||f&1&&s!==(s=`File: ${u[10].orig_name}`))&&C(e,"aria-label",s)},i(u){o||(M(i),o=!0)},o(u){E(i),o=!1},d(u){u&&P(e),a[n].d()}}}function r_(l){let e,t,n,i,s=l[9]===3&&l[7].files.length>4&&Si(l);return{c(){e=A("div"),t=A("video"),i=Ut(),s&&s.c(),C(t,"class","example-image"),dn(t.src,n=l[10].url)||C(t,"src",n),C(t,"aria-hidden","true"),C(e,"class","example-image-container svelte-9pi8y1")},m(o,r){R(o,e,r),U(e,t),U(e,i),s&&s.m(e,null)},p(o,r){r&1&&!dn(t.src,n=o[10].url)&&C(t,"src",n),o[9]===3&&o[7].files.length>4?s?s.p(o,r):(s=Si(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},i:qt,o:qt,d(o){o&&P(e),s&&s.d()}}}function __(l){let e,t,n,i;t=new Yt({props:{class:"example-image",src:l[10].url,alt:l[10].orig_name||`Example image ${l[9]+1}`}});let s=l[9]===3&&l[7].files.length>4&&ji(l);return{c(){e=A("div"),ct(t.$$.fragment),n=Ut(),s&&s.c(),C(e,"class","example-image-container svelte-9pi8y1")},m(o,r){R(o,e,r),ht(t,e,null),U(e,n),s&&s.m(e,null),i=!0},p(o,r){const a={};r&1&&(a.src=o[10].url),r&1&&(a.alt=o[10].orig_name||`Example image ${o[9]+1}`),t.$set(a),o[9]===3&&o[7].files.length>4?s?s.p(o,r):(s=ji(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},i(o){i||(M(t.$$.fragment,o),i=!0)},o(o){E(t.$$.fragment,o),i=!1},d(o){o&&P(e),mt(t),s&&s.d()}}}function u_(l){let e,t;return e=new el({}),{c(){ct(e.$$.fragment)},m(n,i){ht(e,n,i),t=!0},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){E(e.$$.fragment,n),t=!1},d(n){mt(e,n)}}}function f_(l){let e,t;return e=new Gi({}),{c(){ct(e.$$.fragment)},m(n,i){ht(e,n,i),t=!0},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){E(e.$$.fragment,n),t=!1},d(n){mt(e,n)}}}function Si(l){let e,t,n=l[7].files.length-4+"",i,s;return{c(){e=A("div"),t=Nt("+"),i=Nt(n),C(e,"class","image-overlay svelte-9pi8y1"),C(e,"role","status"),C(e,"aria-label",s=`${l[7].files.length-4} more files`)},m(o,r){R(o,e,r),U(e,t),U(e,i)},p(o,r){r&1&&n!==(n=o[7].files.length-4+"")&&kn(i,n),r&1&&s!==(s=`${o[7].files.length-4} more files`)&&C(e,"aria-label",s)},d(o){o&&P(e)}}}function ji(l){let e,t,n=l[7].files.length-4+"",i,s;return{c(){e=A("div"),t=Nt("+"),i=Nt(n),C(e,"class","image-overlay svelte-9pi8y1"),C(e,"role","status"),C(e,"aria-label",s=`${l[7].files.length-4} more files`)},m(o,r){R(o,e,r),U(e,t),U(e,i)},p(o,r){r&1&&n!==(n=o[7].files.length-4+"")&&kn(i,n),r&1&&s!==(s=`${o[7].files.length-4} more files`)&&C(e,"aria-label",s)},d(o){o&&P(e)}}}function Hi(l){let e,t,n,i,s,o;const r=[__,r_,a_],a=[];function _(u,f){return f&1&&(e=null),f&1&&(t=null),e==null&&(e=!!u[10].mime_type?.includes("image")),e?0:(t==null&&(t=!!u[10].mime_type?.includes("video")),t?1:2)}return n=_(l,-1),i=a[n]=r[n](l),{c(){i.c(),s=_o()},m(u,f){a[n].m(u,f),R(u,s,f),o=!0},p(u,f){let c=n;n=_(u,f),n===c?a[n].p(u,f):(_t(),E(a[c],1,1,()=>{a[c]=null}),rt(),i=a[n],i?i.p(u,f):(i=a[n]=r[n](u),i.c()),M(i,1),i.m(s.parentNode,s))},i(u){o||(M(i),o=!0)},o(u){E(i),o=!1},d(u){u&&P(s),a[n].d(u)}}}function qi(l){let e,t,n,i=l[7].files.length-4+"",s,o;return{c(){e=A("div"),t=A("div"),n=Nt("+"),s=Nt(i),C(t,"class","file-overlay svelte-9pi8y1"),C(t,"role","status"),C(t,"aria-label",o=`${l[7].files.length-4} more files`),C(e,"class","example-icon svelte-9pi8y1")},m(r,a){R(r,e,a),U(e,t),U(t,n),U(t,s)},p(r,a){a&1&&i!==(i=r[7].files.length-4+"")&&kn(s,i),a&1&&o!==(o=`${r[7].files.length-4} more files`)&&C(t,"aria-label",o)},d(r){r&&P(e)}}}function Li(l){let e,t,n,i,s,o,r,a=(l[7].display_text||l[7].text)+"",_,u,f,c,b,m;const h=[t_,e_,xr],w=[];function d(z,I){return z[7]?.icon?.url?0:z[7]?.icon?.mime_type==="text"?1:z[7].files!==void 0&&z[7].files.length>0?2:-1}~(n=d(l))&&(i=w[n]=h[n](l));function $(){return l[5](l[9],l[7])}return{c(){e=A("button"),t=A("div"),i&&i.c(),s=Ut(),o=A("div"),r=A("span"),_=Nt(a),u=Ut(),C(r,"class","example-text svelte-9pi8y1"),C(o,"class","example-text-content svelte-9pi8y1"),C(t,"class","example-content svelte-9pi8y1"),C(e,"class","example svelte-9pi8y1"),C(e,"aria-label",f=`Select example ${l[9]+1}: ${l[7].display_text||l[7].text}`)},m(z,I){R(z,e,I),U(e,t),~n&&w[n].m(t,null),U(t,s),U(t,o),U(o,r),U(r,_),U(e,u),c=!0,b||(m=Kr(e,"click",$),b=!0)},p(z,I){l=z;let p=n;n=d(l),n===p?~n&&w[n].p(l,I):(i&&(_t(),E(w[p],1,1,()=>{w[p]=null}),rt()),~n?(i=w[n],i?i.p(l,I):(i=w[n]=h[n](l),i.c()),M(i,1),i.m(t,s)):i=null),(!c||I&1)&&a!==(a=(l[7].display_text||l[7].text)+"")&&kn(_,a),(!c||I&1&&f!==(f=`Select example ${l[9]+1}: ${l[7].display_text||l[7].text}`))&&C(e,"aria-label",f)},i(z){c||(M(i),c=!0)},o(z){E(i),c=!1},d(z){z&&P(e),~n&&w[n].d(),b=!1,m()}}}function c_(l){let e,t,n,i=l[1]!==null&&yi(l),s=l[0]!==null&&zi(l);return{c(){e=A("div"),i&&i.c(),t=Ut(),s&&s.c(),C(e,"class","placeholder-content svelte-9pi8y1"),C(e,"role","complementary")},m(o,r){R(o,e,r),i&&i.m(e,null),U(e,t),s&&s.m(e,null),n=!0},p(o,[r]){o[1]!==null?i?(i.p(o,r),r&2&&M(i,1)):(i=yi(o),i.c(),M(i,1),i.m(e,t)):i&&(_t(),E(i,1,1,()=>{i=null}),rt()),o[0]!==null?s?(s.p(o,r),r&1&&M(s,1)):(s=zi(o),s.c(),M(s,1),s.m(e,null)):s&&(_t(),E(s,1,1,()=>{s=null}),rt())},i(o){n||(M(i),M(s),n=!0)},o(o){E(i),E(s),n=!1},d(o){o&&P(e),i&&i.d(),s&&s.d()}}}function m_(l,e,t){let{examples:n=null}=e,{placeholder:i=null}=e,{latex_delimiters:s}=e,{root:o}=e;const r=Xr();function a(u,f){const c=typeof f=="string"?{text:f}:f;r("example_select",{index:u,value:{text:c.text,files:c.files}})}const _=(u,f)=>a(u,typeof f=="string"?{text:f}:f);return l.$$set=u=>{"examples"in u&&t(0,n=u.examples),"placeholder"in u&&t(1,i=u.placeholder),"latex_delimiters"in u&&t(2,s=u.latex_delimiters),"root"in u&&t(3,o=u.root)},[n,i,s,o,a,_]}class h_ extends Gr{constructor(e){super(),Yr(this,e,m_,c_,Qr,{examples:0,placeholder:1,latex_delimiters:2,root:3})}get examples(){return this.$$.ctx[0]}set examples(e){this.$$set({examples:e}),on()}get placeholder(){return this.$$.ctx[1]}set placeholder(e){this.$$set({placeholder:e}),on()}get latex_delimiters(){return this.$$.ctx[2]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),on()}get root(){return this.$$.ctx[3]}set root(e){this.$$set({root:e}),on()}}const{SvelteComponent:d_,create_component:g_,destroy_component:b_,flush:w_,init:k_,mount_component:p_,safe_not_equal:v_,transition_in:$_,transition_out:C_}=window.__gradio__svelte__internal,{onDestroy:y_}=window.__gradio__svelte__internal;function z_(l){let e,t;return e=new le({props:{Icon:l[0]?Jt:rn,label:l[0]?"Copied conversation":"Copy conversation"}}),e.$on("click",l[1]),{c(){g_(e.$$.fragment)},m(n,i){p_(e,n,i),t=!0},p(n,[i]){const s={};i&1&&(s.Icon=n[0]?Jt:rn),i&1&&(s.label=n[0]?"Copied conversation":"Copy conversation"),e.$set(s)},i(n){t||($_(e.$$.fragment,n),t=!0)},o(n){C_(e.$$.fragment,n),t=!1},d(n){b_(e,n)}}}function S_(l,e,t){let n=!1,{value:i}=e,s;function o(){t(0,n=!0),s&&clearTimeout(s),s=setTimeout(()=>{t(0,n=!1)},1e3)}const r=()=>{if(i){const _=i.map(u=>u.type==="text"?`${u.role}: ${u.content}`:`${u.role}: ${u.content.value.url}`).join(`
6
7`);navigator.clipboard.writeText(_).catch(u=>{console.error("Failed to copy conversation: ",u)})}};async function a(){"clipboard"in navigator&&(r(),o())}return y_(()=>{s&&clearTimeout(s)}),l.$$set=_=>{"value"in _&&t(2,i=_.value)},[n,a,i]}class j_ extends d_{constructor(e){super(),k_(this,e,S_,z_,v_,{value:2})}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),w_()}}const{SvelteComponent:H_,action_destroyer:q_,add_flush_callback:L_,append:xn,attr:Pe,bind:M_,binding_callbacks:uo,check_outros:Lt,create_component:dt,destroy_component:gt,destroy_each:fo,detach:Ce,element:xt,empty:co,ensure_array_like:gn,flush:q,group_outros:Mt,init:N_,insert:ye,listen:V_,mount_component:bt,noop:bn,null_to_empty:Mi,safe_not_equal:D_,set_data:I_,space:Pt,text:B_,transition_in:V,transition_out:F}=window.__gradio__svelte__internal,{createEventDispatcher:E_,tick:A_,onMount:On}=window.__gradio__svelte__internal;function Ni(l,e,t){const n=l.slice();return n[60]=e[t],n[62]=t,n}function Vi(l,e,t){const n=l.slice();n[63]=e[t],n[70]=t;const i=n[63][0].role==="user"?"user":"bot";n[64]=i;const s=n[16][n[64]==="user"?0:1];n[65]=s;const o=n[16][n[64]==="user"?0:1];n[66]=o;const r=n[38].slice(0,n[70]).filter(_=>_[0].role==="assistant").length;n[67]=r;const a=n[64]==="bot"&&n[10]&&n[10][n[67]]?n[10][n[67]]:null;return n[68]=a,n}function Di(l){let e,t;return e=new Wi({props:{$$slots:{default:[T_]},$$scope:{ctx:l}}}),{c(){dt(e.$$.fragment)},m(n,i){bt(e,n,i),t=!0},p(n,i){const s={};i[0]&12289|i[2]&512&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(V(e.$$.fragment,n),t=!0)},o(n){F(e.$$.fragment,n),t=!1},d(n){gt(e,n)}}}function Ii(l){let e,t;return e=new le({props:{Icon:Co}}),e.$on("click",l[47]),{c(){dt(e.$$.fragment)},m(n,i){bt(e,n,i),t=!0},p:bn,i(n){t||(V(e.$$.fragment,n),t=!0)},o(n){F(e.$$.fragment,n),t=!1},d(n){gt(e,n)}}}function Bi(l){let e,t;return e=new j_({props:{value:l[0]}}),{c(){dt(e.$$.fragment)},m(n,i){bt(e,n,i),t=!0},p(n,i){const s={};i[0]&1&&(s.value=n[0]),e.$set(s)},i(n){t||(V(e.$$.fragment,n),t=!0)},o(n){F(e.$$.fragment,n),t=!1},d(n){gt(e,n)}}}function T_(l){let e,t,n,i,s,o=l[12]&&Ii(l);t=new le({props:{Icon:yo,label:"Clear"}}),t.$on("click",l[48]);let r=l[13]&&Bi(l);return{c(){o&&o.c(),e=Pt(),dt(t.$$.fragment),n=Pt(),r&&r.c(),i=co()},m(a,_){o&&o.m(a,_),ye(a,e,_),bt(t,a,_),ye(a,n,_),r&&r.m(a,_),ye(a,i,_),s=!0},p(a,_){a[12]?o?(o.p(a,_),_[0]&4096&&V(o,1)):(o=Ii(a),o.c(),V(o,1),o.m(e.parentNode,e)):o&&(Mt(),F(o,1,1,()=>{o=null}),Lt()),a[13]?r?(r.p(a,_),_[0]&8192&&V(r,1)):(r=Bi(a),r.c(),V(r,1),r.m(i.parentNode,i)):r&&(Mt(),F(r,1,1,()=>{r=null}),Lt())},i(a){s||(V(o),V(t.$$.fragment,a),V(r),s=!0)},o(a){F(o),F(t.$$.fragment,a),F(r),s=!1},d(a){a&&(Ce(e),Ce(n),Ce(i)),o&&o.d(a),gt(t,a),r&&r.d(a)}}}function F_(l){let e,t;return e=new h_({props:{examples:l[26],placeholder:l[23],latex_delimiters:l[4],root:l[30]}}),e.$on("example_select",l[53]),{c(){dt(e.$$.fragment)},m(n,i){bt(e,n,i),t=!0},p(n,i){const s={};i[0]&67108864&&(s.examples=n[26]),i[0]&8388608&&(s.placeholder=n[23]),i[0]&16&&(s.latex_delimiters=n[4]),i[0]&1073741824&&(s.root=n[30]),e.$set(s)},i(n){t||(V(e.$$.fragment,n),t=!0)},o(n){F(e.$$.fragment,n),t=!1},d(n){gt(e,n)}}}function Z_(l){let e,t,n,i,s,o,r,a=gn(l[38]),_=[];for(let m=0;m<a.length;m+=1)_[m]=Ei(Vi(l,a,m));const u=m=>F(_[m],1,1,()=>{_[m]=null}),f=[P_,U_],c=[];function b(m,h){return m[5]?0:m[39]?1:-1}return~(n=b(l))&&(i=c[n]=f[n](l)),{c(){e=xt("div");for(let m=0;m<_.length;m+=1)_[m].c();t=Pt(),i&&i.c(),Pe(e,"class","message-wrap svelte-gjtrl6")},m(m,h){ye(m,e,h);for(let w=0;w<_.length;w+=1)_[w]&&_[w].m(e,null);xn(e,t),~n&&c[n].m(e,null),s=!0,o||(r=q_(wo.call(null,e)),o=!0)},p(m,h){if(h[0]&2071973855|h[1]&5791){a=gn(m[38]);let d;for(d=0;d<a.length;d+=1){const $=Vi(m,a,d);_[d]?(_[d].p($,h),V(_[d],1)):(_[d]=Ei($),_[d].c(),V(_[d],1),_[d].m(e,t))}for(Mt(),d=a.length;d<_.length;d+=1)u(d);Lt()}let w=n;n=b(m),n===w?~n&&c[n].p(m,h):(i&&(Mt(),F(c[w],1,1,()=>{c[w]=null}),Lt()),~n?(i=c[n],i?i.p(m,h):(i=c[n]=f[n](m),i.c()),V(i,1),i.m(e,null)):i=null)},i(m){if(!s){for(let h=0;h<a.length;h+=1)V(_[h]);V(i),s=!0}},o(m){_=_.filter(Boolean);for(let h=0;h<_.length;h+=1)F(_[h]);F(i),s=!1},d(m){m&&Ce(e),fo(_,m),~n&&c[n].d(),o=!1,r()}}}function Ei(l){let e,t,n;function i(...r){return l[49](l[70],l[63],...r)}function s(r){l[50](r)}let o={messages:l[63],display_consecutive_in_same_bubble:l[3],opposite_avatar_img:l[66],avatar_img:l[65],role:l[64],layout:l[22],dispatch:l[41],i18n:l[21],_fetch:l[1],line_breaks:l[19],theme_mode:l[20],target:l[33],root:l[30],upload:l[24],selectable:l[7],sanitize_html:l[17],render_markdown:l[18],rtl:l[14],i:l[70],value:l[0],latex_delimiters:l[4],_components:l[32],generating:l[6],msg_format:l[25],feedback_options:l[9],current_feedback:l[68],allow_tags:l[31],show_like:l[64]==="user"?l[8]&&l[29]:l[8],show_retry:l[27]&&nn(l[63],l[0]),show_undo:l[28]&&nn(l[63],l[0]),show_edit:l[11]==="all"||l[11]=="user"&&l[64]==="user"&&l[63].length>0&&l[63][l[63].length-1].type=="text",in_edit_mode:l[34]===l[70],show_copy_button:l[15],handle_action:i,scroll:l[40]?scroll:O_,allow_file_downloads:l[2]};return l[35]!==void 0&&(o.edit_message=l[35]),e=new Ir({props:o}),uo.push(()=>M_(e,"edit_message",s)),e.$on("copy",l[51]),{c(){dt(e.$$.fragment)},m(r,a){bt(e,r,a),n=!0},p(r,a){l=r;const _={};a[1]&128&&(_.messages=l[63]),a[0]&8&&(_.display_consecutive_in_same_bubble=l[3]),a[0]&65536|a[1]&128&&(_.opposite_avatar_img=l[66]),a[0]&65536|a[1]&128&&(_.avatar_img=l[65]),a[1]&128&&(_.role=l[64]),a[0]&4194304&&(_.layout=l[22]),a[0]&2097152&&(_.i18n=l[21]),a[0]&2&&(_._fetch=l[1]),a[0]&524288&&(_.line_breaks=l[19]),a[0]&1048576&&(_.theme_mode=l[20]),a[1]&4&&(_.target=l[33]),a[0]&1073741824&&(_.root=l[30]),a[0]&16777216&&(_.upload=l[24]),a[0]&128&&(_.selectable=l[7]),a[0]&131072&&(_.sanitize_html=l[17]),a[0]&262144&&(_.render_markdown=l[18]),a[0]&16384&&(_.rtl=l[14]),a[0]&1&&(_.value=l[0]),a[0]&16&&(_.latex_delimiters=l[4]),a[1]&2&&(_._components=l[32]),a[0]&64&&(_.generating=l[6]),a[0]&33554432&&(_.msg_format=l[25]),a[0]&512&&(_.feedback_options=l[9]),a[0]&1024|a[1]&128&&(_.current_feedback=l[68]),a[1]&1&&(_.allow_tags=l[31]),a[0]&536871168|a[1]&128&&(_.show_like=l[64]==="user"?l[8]&&l[29]:l[8]),a[0]&134217729|a[1]&128&&(_.show_retry=l[27]&&nn(l[63],l[0])),a[0]&268435457|a[1]&128&&(_.show_undo=l[28]&&nn(l[63],l[0])),a[0]&2048|a[1]&128&&(_.show_edit=l[11]==="all"||l[11]=="user"&&l[64]==="user"&&l[63].length>0&&l[63][l[63].length-1].type=="text"),a[1]&8&&(_.in_edit_mode=l[34]===l[70]),a[0]&32768&&(_.show_copy_button=l[15]),a[1]&128&&(_.handle_action=i),a[0]&4&&(_.allow_file_downloads=l[2]),!t&&a[1]&16&&(t=!0,_.edit_message=l[35],L_(()=>t=!1)),e.$set(_)},i(r){n||(V(e.$$.fragment,r),n=!0)},o(r){F(e.$$.fragment,r),n=!1},d(r){gt(e,r)}}}function U_(l){let e,t=gn(l[39]),n=[];for(let i=0;i<t.length;i+=1)n[i]=Ai(Ni(l,t,i));return{c(){e=xt("div");for(let i=0;i<n.length;i+=1)n[i].c();Pe(e,"class","options svelte-gjtrl6")},m(i,s){ye(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,s){if(s[1]&1280){t=gn(i[39]);let o;for(o=0;o<t.length;o+=1){const r=Ni(i,t,o);n[o]?n[o].p(r,s):(n[o]=Ai(r),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},i:bn,o:bn,d(i){i&&Ce(e),fo(n,i)}}}function P_(l){let e,t;return e=new Wr({props:{layout:l[22],avatar_images:l[16]}}),{c(){dt(e.$$.fragment)},m(n,i){bt(e,n,i),t=!0},p(n,i){const s={};i[0]&4194304&&(s.layout=n[22]),i[0]&65536&&(s.avatar_images=n[16]),e.$set(s)},i(n){t||(V(e.$$.fragment,n),t=!0)},o(n){F(e.$$.fragment,n),t=!1},d(n){gt(e,n)}}}function Ai(l){let e,t=(l[60].label||l[60].value)+"",n,i,s,o;function r(){return l[52](l[62],l[60])}return{c(){e=xt("button"),n=B_(t),i=Pt(),Pe(e,"class","option svelte-gjtrl6")},m(a,_){ye(a,e,_),xn(e,n),xn(e,i),s||(o=V_(e,"click",r),s=!0)},p(a,_){l=a,_[1]&256&&t!==(t=(l[60].label||l[60].value)+"")&&I_(n,t)},d(a){a&&Ce(e),s=!1,o()}}}function Ti(l){let e,t,n;return t=new le({props:{Icon:ns,label:"Scroll down",size:"large"}}),t.$on("click",l[42]),{c(){e=xt("div"),dt(t.$$.fragment),Pe(e,"class","scroll-down-button-container svelte-gjtrl6")},m(i,s){ye(i,e,s),bt(t,e,null),n=!0},p:bn,i(i){n||(V(t.$$.fragment,i),n=!0)},o(i){F(t.$$.fragment,i),n=!1},d(i){i&&Ce(e),gt(t)}}}function R_(l){let e,t,n,i,s,o,r,a,_=l[0]!==null&&l[0].length>0&&Di(l);const u=[Z_,F_],f=[];function c(m,h){return m[0]!==null&&m[0].length>0&&m[38]!==null?0:1}n=c(l),i=f[n]=u[n](l);let b=l[37]&&Ti(l);return{c(){_&&_.c(),e=Pt(),t=xt("div"),i.c(),o=Pt(),b&&b.c(),r=co(),Pe(t,"class",s=Mi(l[22]==="bubble"?"bubble-wrap":"panel-wrap")+" svelte-gjtrl6"),Pe(t,"role","log"),Pe(t,"aria-label","chatbot conversation"),Pe(t,"aria-live","polite")},m(m,h){_&&_.m(m,h),ye(m,e,h),ye(m,t,h),f[n].m(t,null),l[54](t),ye(m,o,h),b&&b.m(m,h),ye(m,r,h),a=!0},p(m,h){m[0]!==null&&m[0].length>0?_?(_.p(m,h),h[0]&1&&V(_,1)):(_=Di(m),_.c(),V(_,1),_.m(e.parentNode,e)):_&&(Mt(),F(_,1,1,()=>{_=null}),Lt());let w=n;n=c(m),n===w?f[n].p(m,h):(Mt(),F(f[w],1,1,()=>{f[w]=null}),Lt(),i=f[n],i?i.p(m,h):(i=f[n]=u[n](m),i.c()),V(i,1),i.m(t,null)),(!a||h[0]&4194304&&s!==(s=Mi(m[22]==="bubble"?"bubble-wrap":"panel-wrap")+" svelte-gjtrl6"))&&Pe(t,"class",s),m[37]?b?(b.p(m,h),h[1]&64&&V(b,1)):(b=Ti(m),b.c(),V(b,1),b.m(r.parentNode,r)):b&&(Mt(),F(b,1,1,()=>{b=null}),Lt())},i(m){a||(V(_),V(i),V(b),a=!0)},o(m){F(_),F(i),F(b),a=!1},d(m){m&&(Ce(e),Ce(t),Ce(o),Ce(r)),_&&_.d(m),f[n].d(),l[54](null),b&&b.d(m)}}}const O_=()=>{};function J_(l,e,t){let n,i,{value:s=[]}=e,o=null,{_fetch:r}=e,{load_component:a}=e,{allow_file_downloads:_}=e,{display_consecutive_in_same_bubble:u}=e,f={};const c=typeof window<"u";async function b(){t(32,f=await rs(_s(s),f,a))}let{latex_delimiters:m}=e,{pending_message:h=!1}=e,{generating:w=!1}=e,{selectable:d=!1}=e,{likeable:$=!1}=e,{feedback_options:z}=e,{feedback_value:I=null}=e,{editable:p=null}=e,{show_share_button:x=!1}=e,{show_copy_all_button:ne=!1}=e,{rtl:y=!1}=e,{show_copy_button:he=!1}=e,{avatar_images:S=[null,null]}=e,{sanitize_html:Me=!0}=e,{render_markdown:Ne=!0}=e,{line_breaks:Ve=!0}=e,{autoscroll:ze=!0}=e,{theme_mode:B}=e,{i18n:De}=e,{layout:Ye="bubble"}=e,{placeholder:Ke=null}=e,{upload:de}=e,{msg_format:ge="tuples"}=e,{examples:Qe=null}=e,{_retryable:Ie=!1}=e,{_undoable:Xe=!1}=e,{like_user_message:ue=!1}=e,{root:xe}=e,{allow_tags:et=null}=e,Be=null,Se=null,Ee="";On(()=>{t(33,Be=document.querySelector("div.gradio-container"))});let G,tt=!1;const Y=E_();function Dt(){return G&&G.offsetHeight+G.scrollTop>G.scrollHeight-100}function v(){G&&(G.scrollTo(0,G.scrollHeight),t(37,tt=!1))}async function be(){ze&&(Dt()?(await A_(),v()):t(37,tt=!0))}On(()=>{be()}),On(()=>{function k(){Dt()&&t(37,tt=!1)}return G?.addEventListener("scroll",k),()=>{G?.removeEventListener("scroll",k)}});function en(k,we,ke){if(ke==="undo"||ke==="retry"){const wt=s;let Ae=wt.length-1;for(;wt[Ae].role==="assistant";)Ae--;Y(ke,{index:wt[Ae].index,value:wt[Ae].content})}else if(ke=="edit")t(34,Se=k),t(35,Ee=we.content);else if(ke=="edit_cancel")t(34,Se=null);else if(ke=="edit_submit")t(34,Se=null),Y("edit",{index:we.index,value:Ee,previous_value:we.content});else{let wt=ke==="Like"?!0:ke==="Dislike"?!1:ke||"";if(ge==="tuples")Y("like",{index:we.index,value:we.content,liked:wt});else{if(!n)return;const Ae=n[k],[ho,au]=[Ae[0],Ae[Ae.length-1]];Y("like",{index:ho.index,value:Ae.map(go=>go.content),liked:wt})}}}function Cn(){if(!s||!n||n.length===0)return;const k=n[n.length-1];if(k[0].role==="assistant")return k[k.length-1].options}const yn=async()=>{try{const k=await ls(s);Y("share",{description:k})}catch(k){console.error(k);let we=k instanceof bo?k.message:"Share failed.";Y("error",we)}},zn=()=>Y("clear"),Sn=(k,we,ke)=>en(k,we[0],ke);function jn(k){Ee=k,t(35,Ee)}const Hn=k=>Y("copy",k.detail),qn=(k,we)=>Y("option_select",{index:k,value:we.value}),g=k=>Y("example_select",k.detail);function mo(k){uo[k?"unshift":"push"](()=>{G=k,t(36,G)})}return l.$$set=k=>{"value"in k&&t(0,s=k.value),"_fetch"in k&&t(1,r=k._fetch),"load_component"in k&&t(44,a=k.load_component),"allow_file_downloads"in k&&t(2,_=k.allow_file_downloads),"display_consecutive_in_same_bubble"in k&&t(3,u=k.display_consecutive_in_same_bubble),"latex_delimiters"in k&&t(4,m=k.latex_delimiters),"pending_message"in k&&t(5,h=k.pending_message),"generating"in k&&t(6,w=k.generating),"selectable"in k&&t(7,d=k.selectable),"likeable"in k&&t(8,$=k.likeable),"feedback_options"in k&&t(9,z=k.feedback_options),"feedback_value"in k&&t(10,I=k.feedback_value),"editable"in k&&t(11,p=k.editable),"show_share_button"in k&&t(12,x=k.show_share_button),"show_copy_all_button"in k&&t(13,ne=k.show_copy_all_button),"rtl"in k&&t(14,y=k.rtl),"show_copy_button"in k&&t(15,he=k.show_copy_button),"avatar_images"in k&&t(16,S=k.avatar_images),"sanitize_html"in k&&t(17,Me=k.sanitize_html),"render_markdown"in k&&t(18,Ne=k.render_markdown),"line_breaks"in k&&t(19,Ve=k.line_breaks),"autoscroll"in k&&t(45,ze=k.autoscroll),"theme_mode"in k&&t(20,B=k.theme_mode),"i18n"in k&&t(21,De=k.i18n),"layout"in k&&t(22,Ye=k.layout),"placeholder"in k&&t(23,Ke=k.placeholder),"upload"in k&&t(24,de=k.upload),"msg_format"in k&&t(25,ge=k.msg_format),"examples"in k&&t(26,Qe=k.examples),"_retryable"in k&&t(27,Ie=k._retryable),"_undoable"in k&&t(28,Xe=k._undoable),"like_user_message"in k&&t(29,ue=k.like_user_message),"root"in k&&t(30,xe=k.root),"allow_tags"in k&&t(31,et=k.allow_tags)},l.$$.update=()=>{l.$$.dirty[0]&1&&b(),l.$$.dirty[0]&33|l.$$.dirty[1]&2&&(s||h||f)&&be(),l.$$.dirty[0]&1|l.$$.dirty[1]&32768&&($o(s,o)||(t(46,o=s),Y("change"))),l.$$.dirty[0]&33554433&&t(38,n=s&&as(s)),l.$$.dirty[0]&1&&t(39,i=s&&Cn())},[s,r,_,u,m,h,w,d,$,z,I,p,x,ne,y,he,S,Me,Ne,Ve,B,De,Ye,Ke,de,ge,Qe,Ie,Xe,ue,xe,et,f,Be,Se,Ee,G,tt,n,i,c,Y,v,en,a,ze,o,yn,zn,Sn,jn,Hn,qn,g,mo]}class W_ extends H_{constructor(e){super(),N_(this,e,J_,R_,D_,{value:0,_fetch:1,load_component:44,allow_file_downloads:2,display_consecutive_in_same_bubble:3,latex_delimiters:4,pending_message:5,generating:6,selectable:7,likeable:8,feedback_options:9,feedback_value:10,editable:11,show_share_button:12,show_copy_all_button:13,rtl:14,show_copy_button:15,avatar_images:16,sanitize_html:17,render_markdown:18,line_breaks:19,autoscroll:45,theme_mode:20,i18n:21,layout:22,placeholder:23,upload:24,msg_format:25,examples:26,_retryable:27,_undoable:28,like_user_message:29,root:30,allow_tags:31},null,[-1,-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),q()}get _fetch(){return this.$$.ctx[1]}set _fetch(e){this.$$set({_fetch:e}),q()}get load_component(){return this.$$.ctx[44]}set load_component(e){this.$$set({load_component:e}),q()}get allow_file_downloads(){return this.$$.ctx[2]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),q()}get display_consecutive_in_same_bubble(){return this.$$.ctx[3]}set display_consecutive_in_same_bubble(e){this.$$set({display_consecutive_in_same_bubble:e}),q()}get latex_delimiters(){return this.$$.ctx[4]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),q()}get pending_message(){return this.$$.ctx[5]}set pending_message(e){this.$$set({pending_message:e}),q()}get generating(){return this.$$.ctx[6]}set generating(e){this.$$set({generating:e}),q()}get selectable(){return this.$$.ctx[7]}set selectable(e){this.$$set({selectable:e}),q()}get likeable(){return this.$$.ctx[8]}set likeable(e){this.$$set({likeable:e}),q()}get feedback_options(){return this.$$.ctx[9]}set feedback_options(e){this.$$set({feedback_options:e}),q()}get feedback_value(){return this.$$.ctx[10]}set feedback_value(e){this.$$set({feedback_value:e}),q()}get editable(){return this.$$.ctx[11]}set editable(e){this.$$set({editable:e}),q()}get show_share_button(){return this.$$.ctx[12]}set show_share_button(e){this.$$set({show_share_button:e}),q()}get show_copy_all_button(){return this.$$.ctx[13]}set show_copy_all_button(e){this.$$set({show_copy_all_button:e}),q()}get rtl(){return this.$$.ctx[14]}set rtl(e){this.$$set({rtl:e}),q()}get show_copy_button(){return this.$$.ctx[15]}set show_copy_button(e){this.$$set({show_copy_button:e}),q()}get avatar_images(){return this.$$.ctx[16]}set avatar_images(e){this.$$set({avatar_images:e}),q()}get sanitize_html(){return this.$$.ctx[17]}set sanitize_html(e){this.$$set({sanitize_html:e}),q()}get render_markdown(){return this.$$.ctx[18]}set render_markdown(e){this.$$set({render_markdown:e}),q()}get line_breaks(){return this.$$.ctx[19]}set line_breaks(e){this.$$set({line_breaks:e}),q()}get autoscroll(){return this.$$.ctx[45]}set autoscroll(e){this.$$set({autoscroll:e}),q()}get theme_mode(){return this.$$.ctx[20]}set theme_mode(e){this.$$set({theme_mode:e}),q()}get i18n(){return this.$$.ctx[21]}set i18n(e){this.$$set({i18n:e}),q()}get layout(){return this.$$.ctx[22]}set layout(e){this.$$set({layout:e}),q()}get placeholder(){return this.$$.ctx[23]}set placeholder(e){this.$$set({placeholder:e}),q()}get upload(){return this.$$.ctx[24]}set upload(e){this.$$set({upload:e}),q()}get msg_format(){return this.$$.ctx[25]}set msg_format(e){this.$$set({msg_format:e}),q()}get examples(){return this.$$.ctx[26]}set examples(e){this.$$set({examples:e}),q()}get _retryable(){return this.$$.ctx[27]}set _retryable(e){this.$$set({_retryable:e}),q()}get _undoable(){return this.$$.ctx[28]}set _undoable(e){this.$$set({_undoable:e}),q()}get like_user_message(){return this.$$.ctx[29]}set like_user_message(e){this.$$set({like_user_message:e}),q()}get root(){return this.$$.ctx[30]}set root(e){this.$$set({root:e}),q()}get allow_tags(){return this.$$.ctx[31]}set allow_tags(e){this.$$set({allow_tags:e}),q()}}const G_=W_,{SvelteComponent:Y_,append:K_,assign:Q_,attr:X_,check_outros:Fi,create_component:pn,destroy_component:vn,detach:Zi,element:x_,flush:j,get_spread_object:eu,get_spread_update:tu,group_outros:Ui,init:nu,insert:Pi,mount_component:$n,safe_not_equal:lu,space:Ri,transition_in:qe,transition_out:it}=window.__gradio__svelte__internal;function Oi(l){let e,t;const n=[{autoscroll:l[27].autoscroll},{i18n:l[27].i18n},l[30],{show_progress:l[30].show_progress==="hidden"?"hidden":"minimal"}];let i={};for(let s=0;s<n.length;s+=1)i=Q_(i,n[s]);return e=new jo({props:i}),e.$on("clear_status",l[42]),{c(){pn(e.$$.fragment)},m(s,o){$n(e,s,o),t=!0},p(s,o){const r=o[0]&1207959552?tu(n,[o[0]&134217728&&{autoscroll:s[27].autoscroll},o[0]&134217728&&{i18n:s[27].i18n},o[0]&1073741824&&eu(s[30]),o[0]&1073741824&&{show_progress:s[30].show_progress==="hidden"?"hidden":"minimal"}]):{};e.$set(r)},i(s){t||(qe(e.$$.fragment,s),t=!0)},o(s){it(e.$$.fragment,s),t=!1},d(s){vn(e,s)}}}function Ji(l){let e,t;return e=new So({props:{show_label:l[7],Icon:Do,float:!0,label:l[6]||"Chatbot"}}),{c(){pn(e.$$.fragment)},m(n,i){$n(e,n,i),t=!0},p(n,i){const s={};i[0]&128&&(s.show_label=n[7]),i[0]&64&&(s.label=n[6]||"Chatbot"),e.$set(s)},i(n){t||(qe(e.$$.fragment,n),t=!0)},o(n){it(e.$$.fragment,n),t=!1},d(n){vn(e,n)}}}function iu(l){let e,t,n,i,s,o=l[30]&&Oi(l),r=l[7]&&Ji(l);return i=new G_({props:{i18n:l[27].i18n,selectable:l[8],likeable:l[9],feedback_options:l[10],feedback_value:l[11],show_share_button:l[12],show_copy_all_button:l[15],value:l[40],latex_delimiters:l[26],display_consecutive_in_same_bubble:l[24],render_markdown:l[19],theme_mode:l[38],editable:l[35],pending_message:l[30]?.status==="pending",generating:l[30]?.status==="generating",rtl:l[13],show_copy_button:l[14],like_user_message:l[29],avatar_images:l[28],sanitize_html:l[16],line_breaks:l[20],autoscroll:l[21],layout:l[17],placeholder:l[36],examples:l[37],_retryable:l[22],_undoable:l[23],upload:l[43],_fetch:l[44],load_component:l[27].load_component,msg_format:l[18],root:l[27].root,allow_file_downloads:l[39],allow_tags:l[25]}}),i.$on("change",l[45]),i.$on("select",l[46]),i.$on("like",l[47]),i.$on("share",l[48]),i.$on("error",l[49]),i.$on("example_select",l[50]),i.$on("option_select",l[51]),i.$on("retry",l[52]),i.$on("undo",l[53]),i.$on("clear",l[54]),i.$on("copy",l[55]),i.$on("edit",l[56]),{c(){o&&o.c(),e=Ri(),t=x_("div"),r&&r.c(),n=Ri(),pn(i.$$.fragment),X_(t,"class","wrapper svelte-g3p8na")},m(a,_){o&&o.m(a,_),Pi(a,e,_),Pi(a,t,_),r&&r.m(t,null),K_(t,n),$n(i,t,null),s=!0},p(a,_){a[30]?o?(o.p(a,_),_[0]&1073741824&&qe(o,1)):(o=Oi(a),o.c(),qe(o,1),o.m(e.parentNode,e)):o&&(Ui(),it(o,1,1,()=>{o=null}),Fi()),a[7]?r?(r.p(a,_),_[0]&128&&qe(r,1)):(r=Ji(a),r.c(),qe(r,1),r.m(t,n)):r&&(Ui(),it(r,1,1,()=>{r=null}),Fi());const u={};_[0]&134217728&&(u.i18n=a[27].i18n),_[0]&256&&(u.selectable=a[8]),_[0]&512&&(u.likeable=a[9]),_[0]&1024&&(u.feedback_options=a[10]),_[0]&2048&&(u.feedback_value=a[11]),_[0]&4096&&(u.show_share_button=a[12]),_[0]&32768&&(u.show_copy_all_button=a[15]),_[1]&512&&(u.value=a[40]),_[0]&67108864&&(u.latex_delimiters=a[26]),_[0]&16777216&&(u.display_consecutive_in_same_bubble=a[24]),_[0]&524288&&(u.render_markdown=a[19]),_[1]&128&&(u.theme_mode=a[38]),_[1]&16&&(u.editable=a[35]),_[0]&1073741824&&(u.pending_message=a[30]?.status==="pending"),_[0]&1073741824&&(u.generating=a[30]?.status==="generating"),_[0]&8192&&(u.rtl=a[13]),_[0]&16384&&(u.show_copy_button=a[14]),_[0]&536870912&&(u.like_user_message=a[29]),_[0]&268435456&&(u.avatar_images=a[28]),_[0]&65536&&(u.sanitize_html=a[16]),_[0]&1048576&&(u.line_breaks=a[20]),_[0]&2097152&&(u.autoscroll=a[21]),_[0]&131072&&(u.layout=a[17]),_[1]&32&&(u.placeholder=a[36]),_[1]&64&&(u.examples=a[37]),_[0]&4194304&&(u._retryable=a[22]),_[0]&8388608&&(u._undoable=a[23]),_[0]&134217728&&(u.upload=a[43]),_[0]&134217728&&(u._fetch=a[44]),_[0]&134217728&&(u.load_component=a[27].load_component),_[0]&262144&&(u.msg_format=a[18]),_[0]&134217728&&(u.root=a[27].root),_[1]&256&&(u.allow_file_downloads=a[39]),_[0]&33554432&&(u.allow_tags=a[25]),i.$set(u)},i(a){s||(qe(o),qe(r),qe(i.$$.fragment,a),s=!0)},o(a){it(o),it(r),it(i.$$.fragment,a),s=!1},d(a){a&&(Zi(e),Zi(t)),o&&o.d(a),r&&r.d(),vn(i)}}}function ou(l){let e,t;return e=new zo({props:{elem_id:l[1],elem_classes:l[2],visible:l[3],padding:!1,scale:l[4],min_width:l[5],height:l[31],resizeable:l[32],min_height:l[33],max_height:l[34],allow_overflow:!0,flex:!0,overflow_behavior:"auto",$$slots:{default:[iu]},$$scope:{ctx:l}}}),{c(){pn(e.$$.fragment)},m(n,i){$n(e,n,i),t=!0},p(n,i){const s={};i[0]&2&&(s.elem_id=n[1]),i[0]&4&&(s.elem_classes=n[2]),i[0]&8&&(s.visible=n[3]),i[0]&16&&(s.scale=n[4]),i[0]&32&&(s.min_width=n[5]),i[1]&1&&(s.height=n[31]),i[1]&2&&(s.resizeable=n[32]),i[1]&4&&(s.min_height=n[33]),i[1]&8&&(s.max_height=n[34]),i[0]&2147483585|i[1]&67109872&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(qe(e.$$.fragment,n),t=!0)},o(n){it(e.$$.fragment,n),t=!1},d(n){vn(e,n)}}}function su(l,e,t){let{elem_id:n=""}=e,{elem_classes:i=[]}=e,{visible:s=!0}=e,{value:o=[]}=e,{scale:r=null}=e,{min_width:a=void 0}=e,{label:_}=e,{show_label:u=!0}=e,{root:f}=e,{_selectable:c=!1}=e,{likeable:b=!1}=e,{feedback_options:m=["Like","Dislike"]}=e,{feedback_value:h=null}=e,{show_share_button:w=!1}=e,{rtl:d=!1}=e,{show_copy_button:$=!0}=e,{show_copy_all_button:z=!1}=e,{sanitize_html:I=!0}=e,{layout:p="bubble"}=e,{type:x="tuples"}=e,{render_markdown:ne=!0}=e,{line_breaks:y=!0}=e,{autoscroll:he=!0}=e,{_retryable:S=!1}=e,{_undoable:Me=!1}=e,{group_consecutive_messages:Ne=!0}=e,{allow_tags:Ve=null}=e,{latex_delimiters:ze}=e,{gradio:B}=e,De=[],{avatar_images:Ye=[null,null]}=e,{like_user_message:Ke=!1}=e,{loading_status:de=void 0}=e,{height:ge}=e,{resizeable:Qe}=e,{min_height:Ie}=e,{max_height:Xe}=e,{editable:ue=null}=e,{placeholder:xe=null}=e,{examples:et=null}=e,{theme_mode:Be}=e,{allow_file_downloads:Se=!0}=e;const Ee=()=>B.dispatch("clear_status",de),G=(...g)=>B.client.upload(...g),tt=(...g)=>B.client.fetch(...g),Y=()=>B.dispatch("change",o),Dt=g=>B.dispatch("select",g.detail),v=g=>B.dispatch("like",g.detail),be=g=>B.dispatch("share",g.detail),en=g=>B.dispatch("error",g.detail),Cn=g=>B.dispatch("example_select",g.detail),yn=g=>B.dispatch("option_select",g.detail),zn=g=>B.dispatch("retry",g.detail),Sn=g=>B.dispatch("undo",g.detail),jn=()=>{t(0,o=[]),B.dispatch("clear")},Hn=g=>B.dispatch("copy",g.detail),qn=g=>{o===null||o.length===0||(x==="messages"?t(0,o[g.detail.index].content=g.detail.value,o):t(0,o[g.detail.index[0]][g.detail.index[1]]=g.detail.value,o),t(0,o),B.dispatch("edit",g.detail))};return l.$$set=g=>{"elem_id"in g&&t(1,n=g.elem_id),"elem_classes"in g&&t(2,i=g.elem_classes),"visible"in g&&t(3,s=g.visible),"value"in g&&t(0,o=g.value),"scale"in g&&t(4,r=g.scale),"min_width"in g&&t(5,a=g.min_width),"label"in g&&t(6,_=g.label),"show_label"in g&&t(7,u=g.show_label),"root"in g&&t(41,f=g.root),"_selectable"in g&&t(8,c=g._selectable),"likeable"in g&&t(9,b=g.likeable),"feedback_options"in g&&t(10,m=g.feedback_options),"feedback_value"in g&&t(11,h=g.feedback_value),"show_share_button"in g&&t(12,w=g.show_share_button),"rtl"in g&&t(13,d=g.rtl),"show_copy_button"in g&&t(14,$=g.show_copy_button),"show_copy_all_button"in g&&t(15,z=g.show_copy_all_button),"sanitize_html"in g&&t(16,I=g.sanitize_html),"layout"in g&&t(17,p=g.layout),"type"in g&&t(18,x=g.type),"render_markdown"in g&&t(19,ne=g.render_markdown),"line_breaks"in g&&t(20,y=g.line_breaks),"autoscroll"in g&&t(21,he=g.autoscroll),"_retryable"in g&&t(22,S=g._retryable),"_undoable"in g&&t(23,Me=g._undoable),"group_consecutive_messages"in g&&t(24,Ne=g.group_consecutive_messages),"allow_tags"in g&&t(25,Ve=g.allow_tags),"latex_delimiters"in g&&t(26,ze=g.latex_delimiters),"gradio"in g&&t(27,B=g.gradio),"avatar_images"in g&&t(28,Ye=g.avatar_images),"like_user_message"in g&&t(29,Ke=g.like_user_message),"loading_status"in g&&t(30,de=g.loading_status),"height"in g&&t(31,ge=g.height),"resizeable"in g&&t(32,Qe=g.resizeable),"min_height"in g&&t(33,Ie=g.min_height),"max_height"in g&&t(34,Xe=g.max_height),"editable"in g&&t(35,ue=g.editable),"placeholder"in g&&t(36,xe=g.placeholder),"examples"in g&&t(37,et=g.examples),"theme_mode"in g&&t(38,Be=g.theme_mode),"allow_file_downloads"in g&&t(39,Se=g.allow_file_downloads)},l.$$.update=()=>{l.$$.dirty[0]&262145|l.$$.dirty[1]&1024&&t(40,De=x==="tuples"?ss(o,f):os(o,f))},[o,n,i,s,r,a,_,u,c,b,m,h,w,d,$,z,I,p,x,ne,y,he,S,Me,Ne,Ve,ze,B,Ye,Ke,de,ge,Qe,Ie,Xe,ue,xe,et,Be,Se,De,f,Ee,G,tt,Y,Dt,v,be,en,Cn,yn,zn,Sn,jn,Hn,qn]}class Eu extends Y_{constructor(e){super(),nu(this,e,su,ou,lu,{elem_id:1,elem_classes:2,visible:3,value:0,scale:4,min_width:5,label:6,show_label:7,root:41,_selectable:8,likeable:9,feedback_options:10,feedback_value:11,show_share_button:12,rtl:13,show_copy_button:14,show_copy_all_button:15,sanitize_html:16,layout:17,type:18,render_markdown:19,line_breaks:20,autoscroll:21,_retryable:22,_undoable:23,group_consecutive_messages:24,allow_tags:25,latex_delimiters:26,gradio:27,avatar_images:28,like_user_message:29,loading_status:30,height:31,resizeable:32,min_height:33,max_height:34,editable:35,placeholder:36,examples:37,theme_mode:38,allow_file_downloads:39},null,[-1,-1])}get elem_id(){return this.$$.ctx[1]}set elem_id(e){this.$$set({elem_id:e}),j()}get elem_classes(){return this.$$.ctx[2]}set elem_classes(e){this.$$set({elem_classes:e}),j()}get visible(){return this.$$.ctx[3]}set visible(e){this.$$set({visible:e}),j()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),j()}get scale(){return this.$$.ctx[4]}set scale(e){this.$$set({scale:e}),j()}get min_width(){return this.$$.ctx[5]}set min_width(e){this.$$set({min_width:e}),j()}get label(){return this.$$.ctx[6]}set label(e){this.$$set({label:e}),j()}get show_label(){return this.$$.ctx[7]}set show_label(e){this.$$set({show_label:e}),j()}get root(){return this.$$.ctx[41]}set root(e){this.$$set({root:e}),j()}get _selectable(){return this.$$.ctx[8]}set _selectable(e){this.$$set({_selectable:e}),j()}get likeable(){return this.$$.ctx[9]}set likeable(e){this.$$set({likeable:e}),j()}get feedback_options(){return this.$$.ctx[10]}set feedback_options(e){this.$$set({feedback_options:e}),j()}get feedback_value(){return this.$$.ctx[11]}set feedback_value(e){this.$$set({feedback_value:e}),j()}get show_share_button(){return this.$$.ctx[12]}set show_share_button(e){this.$$set({show_share_button:e}),j()}get rtl(){return this.$$.ctx[13]}set rtl(e){this.$$set({rtl:e}),j()}get show_copy_button(){return this.$$.ctx[14]}set show_copy_button(e){this.$$set({show_copy_button:e}),j()}get show_copy_all_button(){return this.$$.ctx[15]}set show_copy_all_button(e){this.$$set({show_copy_all_button:e}),j()}get sanitize_html(){return this.$$.ctx[16]}set sanitize_html(e){this.$$set({sanitize_html:e}),j()}get layout(){return this.$$.ctx[17]}set layout(e){this.$$set({layout:e}),j()}get type(){return this.$$.ctx[18]}set type(e){this.$$set({type:e}),j()}get render_markdown(){return this.$$.ctx[19]}set render_markdown(e){this.$$set({render_markdown:e}),j()}get line_breaks(){return this.$$.ctx[20]}set line_breaks(e){this.$$set({line_breaks:e}),j()}get autoscroll(){return this.$$.ctx[21]}set autoscroll(e){this.$$set({autoscroll:e}),j()}get _retryable(){return this.$$.ctx[22]}set _retryable(e){this.$$set({_retryable:e}),j()}get _undoable(){return this.$$.ctx[23]}set _undoable(e){this.$$set({_undoable:e}),j()}get group_consecutive_messages(){return this.$$.ctx[24]}set group_consecutive_messages(e){this.$$set({group_consecutive_messages:e}),j()}get allow_tags(){return this.$$.ctx[25]}set allow_tags(e){this.$$set({allow_tags:e}),j()}get latex_delimiters(){return this.$$.ctx[26]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),j()}get gradio(){return this.$$.ctx[27]}set gradio(e){this.$$set({gradio:e}),j()}get avatar_images(){return this.$$.ctx[28]}set avatar_images(e){this.$$set({avatar_images:e}),j()}get like_user_message(){return this.$$.ctx[29]}set like_user_message(e){this.$$set({like_user_message:e}),j()}get loading_status(){return this.$$.ctx[30]}set loading_status(e){this.$$set({loading_status:e}),j()}get height(){return this.$$.ctx[31]}set height(e){this.$$set({height:e}),j()}get resizeable(){return this.$$.ctx[32]}set resizeable(e){this.$$set({resizeable:e}),j()}get min_height(){return this.$$.ctx[33]}set min_height(e){this.$$set({min_height:e}),j()}get max_height(){return this.$$.ctx[34]}set max_height(e){this.$$set({max_height:e}),j()}get editable(){return this.$$.ctx[35]}set editable(e){this.$$set({editable:e}),j()}get placeholder(){return this.$$.ctx[36]}set placeholder(e){this.$$set({placeholder:e}),j()}get examples(){return this.$$.ctx[37]}set examples(e){this.$$set({examples:e}),j()}get theme_mode(){return this.$$.ctx[38]}set theme_mode(e){this.$$set({theme_mode:e}),j()}get allow_file_downloads(){return this.$$.ctx[39]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),j()}}export{G_ as BaseChatBot,Eu as default};
8//# sourceMappingURL=Index-DIOz2Pkb.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.