1import"./index-Dk9f0nDu.js";import{u as pl,S as Lo,a as Mo}from"./utils-BsGrhMNe.js";import{I as Xt}from"./Image-CnqB5dbD.js";/* empty css */import"./MarkdownCode.svelte_svelte_type_style_lang-583j2ysC.js";import"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";/* empty css */import{I as ue}from"./IconButton-C_HS7fTi.js";import{C as Yt}from"./Check-CEkiXcyC.js";import{C as cn}from"./Copy-CxQ9EyK2.js";import{C as No}from"./Clear-By3xiIwg.js";import{E as jo}from"./Edit-BpRIf5rU.js";import{U as Vo}from"./Undo-DCjBnnSO.js";import{I as io}from"./IconButtonWrapper--EIOWuEM.js";import{F as ol}from"./File-BQ_9P3Ye.js";import{M as sl}from"./MarkdownCode-CjP5Lux8.js";import{s as vl}from"./index-Cvn1BJB1.js";import{d as Do}from"./index-CnqicUFC.js";import{C as Io}from"./Community-Dw1micSV.js";import{T as Bo}from"./Trash-RbZEwH-j.js";import{M as oo}from"./Music-CDm0RGMk.js";import{B as Eo}from"./Block-CJdXVpa7.js";import{B as To}from"./BlockLabel-3KxTaaiM.js";import{S as Ao}from"./index-DZMPOpBC.js";import"./StreamingBar.svelte_svelte_type_style_lang-DlRzv56K.js";import"./svelte/svelte.js";import"./file-url-DoxvUUVV.js";import"./prism-python-DxQhhusZ.js";const{SvelteComponent:Fo,append:$l,attr:be,detach:Zo,init:Uo,insert:Wo,noop:Vn,safe_not_equal:Po,svg_element:Dn}=window.__gradio__svelte__internal;function Oo(l){let e,t,n;return{c(){e=Dn("svg"),t=Dn("path"),n=Dn("path"),be(t,"fill","currentColor"),be(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"),be(n,"fill","currentColor"),be(n,"d","M8 10h16v2H8zm0 6h10v2H8z"),be(e,"xmlns","http://www.w3.org/2000/svg"),be(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),be(e,"aria-hidden","true"),be(e,"role","img"),be(e,"class","iconify iconify--carbon"),be(e,"width","100%"),be(e,"height","100%"),be(e,"preserveAspectRatio","xMidYMid meet"),be(e,"viewBox","0 0 32 32")},m(i,o){Wo(i,e,o),$l(e,t),$l(e,n)},p:Vn,i:Vn,o:Vn,d(i){i&&Zo(e)}}}class Ro extends Fo{constructor(e){super(),Uo(this,e,null,Oo,Po,{})}}const{SvelteComponent:Jo,append:Cl,attr:Ne,detach:Go,init:Yo,insert:Ko,noop:In,safe_not_equal:Qo,svg_element:Bn}=window.__gradio__svelte__internal;function Xo(l){let e,t,n;return{c(){e=Bn("svg"),t=Bn("circle"),n=Bn("path"),Ne(t,"cx","9"),Ne(t,"cy","9"),Ne(t,"r","8"),Ne(t,"class","circle svelte-1m886t3"),Ne(n,"d","M5 8l4 4 4-4z"),Ne(e,"class","dropdown-arrow svelte-1m886t3"),Ne(e,"xmlns","http://www.w3.org/2000/svg"),Ne(e,"width","100%"),Ne(e,"height","100%"),Ne(e,"viewBox","0 0 18 18")},m(i,o){Ko(i,e,o),Cl(e,t),Cl(e,n)},p:In,i:In,o:In,d(i){i&&Go(e)}}}class xo extends Jo{constructor(e){super(),Yo(this,e,null,Xo,Qo,{})}}const{SvelteComponent:es,append:on,attr:D,detach:ts,init:ns,insert:ls,noop:En,safe_not_equal:is,svg_element:Jt}=window.__gradio__svelte__internal;function os(l){let e,t,n,i,o;return{c(){e=Jt("svg"),t=Jt("path"),n=Jt("path"),i=Jt("path"),o=Jt("path"),D(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"),D(t,"stroke","currentColor"),D(t,"stroke-width","1.5"),D(t,"stroke-linecap","round"),D(t,"stroke-linejoin","round"),D(n,"d","M16 9H19.4C19.7314 9 20 8.73137 20 8.4V5"),D(n,"stroke","currentColor"),D(n,"stroke-width","1.5"),D(n,"stroke-linecap","round"),D(n,"stroke-linejoin","round"),D(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"),D(i,"stroke","currentColor"),D(i,"stroke-width","1.5"),D(i,"stroke-linecap","round"),D(i,"stroke-linejoin","round"),D(o,"d","M8.04932 15H4.64932C4.31795 15 4.04932 15.2686 4.04932 15.6V19"),D(o,"stroke","currentColor"),D(o,"stroke-width","1.5"),D(o,"stroke-linecap","round"),D(o,"stroke-linejoin","round"),D(e,"width","100%"),D(e,"height","100%"),D(e,"stroke-width","1.5"),D(e,"viewBox","0 0 24 24"),D(e,"fill","none"),D(e,"xmlns","http://www.w3.org/2000/svg"),D(e,"color","currentColor")},m(s,r){ls(s,e,r),on(e,t),on(e,n),on(e,i),on(e,o)},p:En,i:En,o:En,d(s){s&&ts(e)}}}class ss extends es{constructor(e){super(),ns(this,e,null,os,is,{})}}const{SvelteComponent:as,append:rs,attr:je,detach:_s,init:fs,insert:us,noop:Tn,safe_not_equal:cs,svg_element:yl}=window.__gradio__svelte__internal;function ms(l){let e,t;return{c(){e=yl("svg"),t=yl("path"),je(t,"d","M12 20L12 4M12 20L7 15M12 20L17 15"),je(t,"stroke","currentColor"),je(t,"stroke-width","2"),je(t,"stroke-linecap","round"),je(t,"stroke-linejoin","round"),je(e,"width","100%"),je(e,"height","100%"),je(e,"viewBox","0 0 24 24"),je(e,"fill","none"),je(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){us(n,e,i),rs(e,t)},p:Tn,i:Tn,o:Tn,d(n){n&&_s(e)}}}class hs extends as{constructor(e){super(),fs(this,e,null,ms,cs,{})}}const ds=async(l,e=1800)=>{let t=[...l],n=await An(t);if(n.length>e&&t.length>2){const i=t[0],o=t[t.length-1];t=[i,o],n=await An(t)}return n.length>e&&t.length>0&&(t=t.map(o=>{if(o.type==="text"){const s=Math.floor(e/t.length)-20;if(o.content.length>s)return{...o,content:o.content.substring(0,s)+"..."}}return o}
vendor: 23,123 bytes, lines 1-9
1),n=await An(t)),n},An=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 o={audio:/<audio.*?src="(\/file=.*?)"/g,video:/<video.*?src="(\/file=.*?)"/g,image:/<img.*?src="(\/file=.*?)".*?\/>|!\[.*?\]\((\/file=.*?)\)/g};i=t.content;for(let[s,r]of Object.entries(o)){let a;for(;(a=r.exec(t.content))!==null;){const _=a[1]||a[2],f=await pl(_);i=i.replace(_,f)}}}else{if(!t.content.value)return"";const o=t.content.component==="video"?t.content.value?.video.path:t.content.value,s=await pl(o);t.content.component==="audio"?i=`<audio controls src="${s}"></audio>`:t.content.component==="video"?i=s:t.content.component==="image"&&(i=`<img src="${s}" />`)}return`${n}: ${i}`}))).filter(t=>t!=="").join(` 2`),so=(l,e)=>l.replace('src="/file',`src="${e}file`);function gs(l,e){if(!l){const t=e?.path;if(t){const n=t.toLowerCase();if(n.endsWith(".glb")||n.endsWith(".gltf")||n.endsWith(".obj")||n.endsWith(".stl")||n.endsWith(".splat")||n.endsWith(".ply"))return"model3d"}return"file"}return l.includes("audio")?"audio":l.includes("video")?"video":l.includes("image")?"image":l.includes("model")?"model3d":"file"}function ao(l){const e=Array.isArray(l.file)?l.file[0]:l.file;return{component:gs(e?.mime_type,e),value:l.file,alt_text:l.alt_text,constructor_args:{},props:{}}}function bs(l,e){if(l===null)return l;const t=new Map;return l.map((n,i)=>{let o=typeof n.content=="string"?{role:n.role,metadata:n.metadata,content:so(n.content,e),type:"text",index:i,options:n.options}:"file"in n.content?{content:ao(n.content),metadata:n.metadata,role:n.role,type:"component",index:i,options:n.options}:{type:"component",...n};const{id:s,title:r,parent_id:a}=n.metadata||{};if(a){const _=t.get(String(a));if(_){const f={...o,children:[]};return _.children.push(f),s&&r&&t.set(String(s),f),null}}if(s&&r){const _={...o,children:[]};return t.set(String(s),_),_}return o}).filter(n=>n!==null)}function ws(l,e){return l===null?l:l.flatMap((n,i)=>n.map((o,s)=>{if(o==null)return null;const r=s==0?"user":"assistant";return typeof o=="string"?{role:r,type:"text",content:so(o,e),metadata:{title:null},index:[i,s]}:"file"in o?{content:ao(o),role:r,type:"component",index:[i,s]}:{role:r,content:o,type:"component",index:[i,s]}})).filter(n=>n!=null)}function zl(l){return l.type==="component"}function sn(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 ks(l,e){const t=[];let n=[],i=null;for(const o of l)(o.role==="assistant"||o.role==="user")&&(o.role===i?n.push(o):(n.length>0&&t.push(n),n=[o],i=o.role));return n.length>0&&t.push(n),t}async function ps(l,e,t){let n=[],i=[];return l.forEach(r=>{if(e[r]||r==="file")return;const a=r==="dataframe"||r==="model3d"?"component":"base",{name:_,component:f}=t(r,a);n.push(_),i.push(f)}),(await Promise.allSettled(i)).map((r,a)=>r.status==="fulfilled"?[a,r.value]:null).filter(r=>r!==null).forEach(([r,a])=>{e[n[r]]=a.default}),e}function vs(l){if(!l)return[];let e=new Set;return l.forEach(t=>{t.type==="component"&&e.add(t.content.component)}),Array.from(e)}function Kn(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(o=>Kn(o,e+1)).join("")),t}function $s(l){return Array.isArray(l)?l.map(e=>e.metadata?.title?Kn(e):e.content).join(` 5`):l.metadata?.title?Kn(l):l.content}function ql(l){return Array.isArray(l)&&l.every(e=>typeof e.content=="string")||!Array.isArray(l)&&typeof l.content=="string"}const{SvelteComponent:Cs,append:ys,attr:zt,detach:zs,init:qs,insert:Ss,noop:Fn,safe_not_equal:Hs,svg_element:Sl}=window.__gradio__svelte__internal;function Ls(l){let e,t;return{c(){e=Sl("svg"),t=Sl("path"),zt(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"),zt(t,"fill","currentColor"),zt(e,"width","100%"),zt(e,"height","100%"),zt(e,"viewBox","0 0 12 12"),zt(e,"fill","none"),zt(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){Ss(n,e,i),ys(e,t)},p:Fn,i:Fn,o:Fn,d(n){n&&zs(e)}}}class Hl extends Cs{constructor(e){super(),qs(this,e,null,Ls,Hs,{})}}const{SvelteComponent:Ms,append:Ns,attr:qt,detach:js,init:Vs,insert:Ds,noop:Zn,safe_not_equal:Is,svg_element:Ll}=window.__gradio__svelte__internal;function Bs(l){let e,t;return{c(){e=Ll("svg"),t=Ll("path"),qt(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"),qt(t,"fill","currentColor"),qt(e,"width","100%"),qt(e,"height","100%"),qt(e,"viewBox","0 0 12 12"),qt(e,"fill","none"),qt(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){Ds(n,e,i),Ns(e,t)},p:Zn,i:Zn,o:Zn,d(n){n&&js(e)}}}class Ml extends Ms{constructor(e){super(),Vs(this,e,null,Bs,Is,{})}}const{SvelteComponent:Es,append:Ts,attr:St,detach:As,init:Fs,insert:Zs,noop:Un,safe_not_equal:Us,svg_element:Nl}=window.__gradio__svelte__internal;function Ws(l){let e,t;return{c(){e=Nl("svg"),t=Nl("path"),St(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"),St(t,"fill","currentColor"),St(e,"width","100%"),St(e,"height","100%"),St(e,"viewBox","0 0 12 12"),St(e,"fill","none"),St(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){Zs(n,e,i),Ts(e,t)},p:Un,i:Un,o:Un,d(n){n&&As(e)}}}class jl extends Es{constructor(e){super(),Fs(this,e,null,Ws,Us,{})}}const{SvelteComponent:Ps,append:Os,attr:Ht,detach:Rs,init:Js,insert:Gs,noop:Wn,safe_not_equal:Ys,svg_element:Vl}=window.__gradio__svelte__internal;function Ks(l){let e,t;return{c(){e=Vl("svg"),t=Vl("path"),Ht(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"),Ht(t,"fill","currentColor"),Ht(e,"width","100%"),Ht(e,"height","100%"),Ht(e,"viewBox","0 0 12 12"),Ht(e,"fill","none"),Ht(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){Gs(n,e,i),Os(e,t)},p:Wn,i:Wn,o:Wn,d(n){n&&Rs(e)}}}class Dl extends Ps{constructor(e){super(),Js(this,e,null,Ks,Ys,{})}}const{SvelteComponent:Qs,append:Xs,attr:Et,detach:xs,init:ea,insert:ta,noop:Pn,safe_not_equal:na,svg_element:Il}=window.__gradio__svelte__internal;function la(l){let e,t;return{c(){e=Il("svg"),t=Il("path"),Et(t,"fill","currentColor"),Et(t,"d","M6,30H4V2H28l-5.8,9L28,20H6ZM6,18H24.33L19.8,11l4.53-7H6Z"),Et(e,"id","icon"),Et(e,"xmlns","http://www.w3.org/2000/svg"),Et(e,"viewBox","0 0 32 32"),Et(e,"fill","none")},m(n,i){ta(n,e,i),Xs(e,t)},p:Pn,i:Pn,o:Pn,d(n){n&&xs(e)}}}class Bl extends Qs{constructor(e){super(),ea(this,e,null,la,na,{})}}const{SvelteComponent:ia,append:oa,attr:Tt,detach:sa,init:aa,insert:ra,noop:On,safe_not_equal:_a,svg_element:El}=window.__gradio__svelte__internal;function fa(l){let e,t;return{c(){e=El("svg"),t=El("path"),Tt(t,"fill","currentColor"),Tt(t,"d","M4,2H28l-5.8,9L28,20H6v10H4V2z"),Tt(e,"id","icon"),Tt(e,"xmlns","http://www.w3.org/2000/svg"),Tt(e,"viewBox","0 0 32 32"),Tt(e,"fill","none")},m(n,i){ra(n,e,i),oa(e,t)},p:On,i:On,o:On,d(n){n&&sa(e)}}}class Tl extends ia{constructor(e){super(),aa(this,e,null,fa,_a,{})}}const{SvelteComponent:ua,append:Qn,attr:Xn,check_outros:mn,create_component:al,destroy_component:rl,destroy_each:ca,detach:Wt,element:xn,empty:ro,ensure_array_like:Al,flush:an,group_outros:hn,init:ma,insert:Pt,listen:ha,mount_component:_l,safe_not_equal:da,set_data:ga,set_style:Fl,space:fl,text:ba,transition_in:re,transition_out:Me}=window.__gradio__svelte__internal;function Zl(l,e,t){const n=l.slice();return n[9]=e[t],n}function Ul(l){let e=l[3].includes("Dislike"),t,n=l[3].includes("Like"),i,o,s=e&&Wl(l),r=n&&Pl(l);return{c(){s&&s.c(),t=fl(),r&&r.c(),i=ro()},m(a,_){s&&s.m(a,_),Pt(a,t,_),r&&r.m(a,_),Pt(a,i,_),o=!0},p(a,_){_&8&&(e=a[3].includes("Dislike")),e?s?(s.p(a,_),_&8&&re(s,1)):(s=Wl(a),s.c(),re(s,1),s.m(t.parentNode,t)):s&&(hn(),Me(s,1,1,()=>{s=null}),mn()),_&8&&(n=a[3].includes("Like")),n?r?(r.p(a,_),_&8&&re(r,1)):(r=Pl(a),r.c(),re(r,1),r.m(i.parentNode,i)):r&&(hn(),Me(r,1,1,()=>{r=null}),mn())},i(a){o||(re(s),re(r),o=!0)},o(a){Me(s),Me(r),o=!1},d(a){a&&(Wt(t),Wt(i)),s&&s.d(a),r&&r.d(a)}}}function Wl(l){let e,t;return e=new ue({props:{Icon:l[0]==="Dislike"?Hl:Ml,label:l[0]==="Dislike"?"clicked dislike":l[1]("chatbot.dislike"),color:l[0]==="Dislike"?"var(--color-accent)":"var(--block-label-text-color)"}}),e.$on("click",l[6]),{c(){al(e.$$.fragment)},m(n,i){_l(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.Icon=n[0]==="Dislike"?Hl:Ml),i&3&&(o.label=n[0]==="Dislike"?"clicked dislike":n[1]("chatbot.dislike")),i&1&&(o.color=n[0]==="Dislike"?"var(--color-accent)":"var(--block-label-text-color)"),e.$set(o)},i(n){t||(re(e.$$.fragment,n),t=!0)},o(n){Me(e.$$.fragment,n),t=!1},d(n){rl(e,n)}}}function Pl(l){let e,t;return e=new ue({props:{Icon:l[0]==="Like"?jl:Dl,label:l[0]==="Like"?"clicked like":l[1]("chatbot.like"),color:l[0]==="Like"?"var(--color-accent)":"var(--block-label-text-color)"}}),e.$on("click",l[7]),{c(){al(e.$$.fragment)},m(n,i){_l(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.Icon=n[0]==="Like"?jl:Dl),i&3&&(o.label=n[0]==="Like"?"clicked like":n[1]("chatbot.like")),i&1&&(o.color=n[0]==="Like"?"var(--color-accent)":"var(--block-label-text-color)"),e.$set(o)},i(n){t||(re(e.$$.fragment,n),t=!0)},o(n){Me(e.$$.fragment,n),t=!1},d(n){rl(e,n)}}}function Ol(l){let e,t,n,i,o;t=new ue({props:{Icon:l[0]&&l[4].includes(l[0])?Tl:Bl,label:"Feedback",color:l[0]&&l[4].includes(l[0])?"var(--color-accent)":"var(--block-label-text-color)"}});let s=Al(l[4]),r=[];for(let a=0;a<s.length;a+=1)r[a]=Rl(Zl(l,s,a));return{c(){e=xn("div"),al(t.$$.fragment),n=fl(),i=xn("div");for(let a=0;a<r.length;a+=1)r[a].c();Xn(i,"class","extra-feedback-options svelte-14rmxes"),Xn(e,"class","extra-feedback no-border svelte-14rmxes")},m(a,_){Pt(a,e,_),_l(t,e,null),Qn(e,n),Qn(e,i);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(i,null);o=!0},p(a,_){const f={};if(_&17&&(f.Icon=a[0]&&a[4].includes(a[0])?Tl:Bl),_&17&&(f.color=a[0]&&a[4].includes(a[0])?"var(--color-accent)":"var(--block-label-text-color)"),t.$set(f),_&53){s=Al(a[4]);let u;for(u=0;u<s.length;u+=1){const c=Zl(a,s,u);r[u]?r[u].p(c,_):(r[u]=Rl(c),r[u].c(),r[u].m(i,null))}for(;u<r.length;u+=1)r[u].d(1);r.length=s.length}},i(a){o||(re(t.$$.fragment,a),o=!0)},o(a){Me(t.$$.fragment,a),o=!1},d(a){a&&Wt(e),rl(t),ca(r,a)}}}function Rl(l){let e,t=l[9]+"",n,i,o;function s(){return l[8](l[9])}return{c(){e=xn("button"),n=ba(t),Xn(e,"class","extra-feedback-option svelte-14rmxes"),Fl(e,"font-weight",l[0]===l[9]?"bold":"normal")},m(r,a){Pt(r,e,a),Qn(e,n),i||(o=ha(e,"click",s),i=!0)},p(r,a){l=r,a&16&&t!==(t=l[9]+"")&&ga(n,t),a&17&&Fl(e,"font-weight",l[0]===l[9]?"bold":"normal")},d(r){r&&Wt(e),i=!1,o()}}}function wa(l){let e=l[3].includes("Like")||l[3].includes("Dislike"),t,n,i,o=e&&Ul(l),s=l[4].length>0&&Ol(l);return{c(){o&&o.c(),t=fl(),s&&s.c(),n=ro()},m(r,a){o&&o.m(r,a),Pt(r,t,a),s&&s.m(r,a),Pt(r,n,a),i=!0},p(r,[a]){a&8&&(e=r[3].includes("Like")||r[3].includes("Dislike")),e?o?(o.p(r,a),a&8&&re(o,1)):(o=Ul(r),o.c(),re(o,1),o.m(t.parentNode,t)):o&&(hn(),Me(o,1,1,()=>{o=null}),mn()),r[4].length>0?s?(s.p(r,a),a&16&&re(s,1)):(s=Ol(r),s.c(),re(s,1),s.m(n.parentNode,n)):s&&(hn(),Me(s,1,1,()=>{s=null}),mn())},i(r){i||(re(o),re(s),i=!0)},o(r){Me(o),Me(s),i=!1},d(r){r&&(Wt(t),Wt(n)),o&&o.d(r),s&&s.d(r)}}}function ka(l,e,t){let n,{i18n:i}=e,{handle_action:o}=e,{feedback_options:s}=e,{selected:r=null}=e;function a(c){t(0,r=r===c?null:c),o(r)}const _=()=>a("Dislike"),f=()=>a("Like"),u=c=>{a(c),o(r||null)};return l.$$set=c=>{"i18n"in c&&t(1,i=c.i18n),"handle_action"in c&&t(2,o=c.handle_action),"feedback_options"in c&&t(3,s=c.feedback_options),"selected"in c&&t(0,r=c.selected)},l.$$.update=()=>{l.$$.dirty&8&&t(4,n=s.filter(c=>c!=="Like"&&c!=="Dislike"))},[r,i,o,s,n,a,_,f,u]}class pa extends ua{constructor(e){super(),ma(this,e,ka,wa,da,{i18n:1,handle_action:2,feedback_options:3,selected:0})}get i18n(){return this.$$.ctx[1]}set i18n(e){this.$$set({i18n:e}),an()}get handle_action(){return this.$$.ctx[2]}set handle_action(e){this.$$set({handle_action:e}),an()}get feedback_options(){return this.$$.ctx[3]}set feedback_options(e){this.$$set({feedback_options:e}),an()}get selected(){return this.$$.ctx[0]}set selected(e){this.$$set({selected:e}),an()}}const{SvelteComponent:va,create_component:$a,destroy_component:Ca,flush:Jl,init:ya,mount_component:za,safe_not_equal:qa,transition_in:Sa,transition_out:Ha}=window.__gradio__svelte__internal,{createEventDispatcher:La}=window.__gradio__svelte__internal,{onDestroy:Ma}=window.__gradio__svelte__internal;function Na(l){let e,t;return e=new ue({props:{label:l[0]?"Copied message":"Copy message",Icon:l[0]?Yt:cn}}),e.$on("click",l[1]),{c(){$a(e.$$.fragment)},m(n,i){za(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.label=n[0]?"Copied message":"Copy message"),i&1&&(o.Icon=n[0]?Yt:cn),e.$set(o)},i(n){t||(Sa(e.$$.fragment,n),t=!0)},o(n){Ha(e.$$.fragment,n),t=!1},d(n){Ca(e,n)}}}function ja(l,e,t){const n=La();let i=!1,{value:o}=e,{watermark:s=null}=e,r;function a(){t(0,i=!0),r&&clearTimeout(r),r=setTimeout(()=>{t(0,i=!1)},2e3)}async function _(){if("clipboard"in navigator){n("copy",{value:o});const f=s?`${o} 6 7${s}`:o;await navigator.clipboard.writeText(f),a()}else{const f=document.createElement("textarea"),u=s?`${o} 8 9${s}`:o;f.value=u,f.style.position="absolute",f.style.left="-999999px",document.body.prepend(f),f.select();try{document.execCommand("copy"),a()}catch(c){console.error(c)}finally{f.remove()}}}return Ma(()=>{r&&clearTimeout(r)}),l.$$set=f=>{"value"in f&&t(2,o=f.value),"watermark"in f&&t(3,s=f.watermark)},[i,_,o,s]}class Va extends va{constructor(e){super(),ya(this,e,ja,Na,qa,{value:2,watermark:3})}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),Jl()}get watermark(){return this.$$.ctx[3]}set watermark(e){this.$$set({watermark:e}),Jl()}}const{SvelteComponent:Da,attr:Gl,check_outros:Mt,create_component:gt,destroy_component:bt,detach:Oe,element:Ia,empty:ul,flush:K,group_outros:Nt,init:Ba,insert:Re,mount_component:wt,safe_not_equal:Ea,space:Gt,transition_in:j,transition_out:Z}=window.__gradio__svelte__internal;function Yl(l){let e,t,n,i;return t=new io({props:{top_panel:!1,$$slots:{default:[Fa]},$$scope:{ctx:l}}}),{c(){e=Ia("div"),gt(t.$$.fragment),Gl(e,"class",n="message-buttons-"+l[8]+" "+l[13]+" message-buttons "+(l[9]!==null&&"with-avatar")+" svelte-j7nkv7")},m(o,s){Re(o,e,s),wt(t,e,null),i=!0},p(o,s){const r={};s&33676543&&(r.$$scope={dirty:s,ctx:o}),t.$set(r),(!i||s&8960&&n!==(n="message-buttons-"+o[8]+" "+o[13]+" message-buttons "+(o[9]!==null&&"with-avatar")+" svelte-j7nkv7"))&&Gl(e,"class",n)},i(o){i||(j(t.$$.fragment,o),i=!0)},o(o){Z(t.$$.fragment,o),i=!1},d(o){o&&Oe(e),bt(t)}}}function Ta(l){let e,t,n,i,o,s,r=l[15]&&Kl(l),a=l[3]&&Ql(l),_=l[4]&&Xl(l),f=l[5]&&xl(l),u=l[1]&&ei(l);return{c(){r&&r.c(),e=Gt(),a&&a.c(),t=Gt(),_&&_.c(),n=Gt(),f&&f.c(),i=Gt(),u&&u.c(),o=ul()},m(c,w){r&&r.m(c,w),Re(c,e,w),a&&a.m(c,w),Re(c,t,w),_&&_.m(c,w),Re(c,n,w),f&&f.m(c,w),Re(c,i,w),u&&u.m(c,w),Re(c,o,w),s=!0},p(c,w){c[15]?r?(r.p(c,w),w&32768&&j(r,1)):(r=Kl(c),r.c(),j(r,1),r.m(e.parentNode,e)):r&&(Nt(),Z(r,1,1,()=>{r=null}),Mt()),c[3]?a?(a.p(c,w),w&8&&j(a,1)):(a=Ql(c),a.c(),j(a,1),a.m(t.parentNode,t)):a&&(Nt(),Z(a,1,1,()=>{a=null}),Mt()),c[4]?_?(_.p(c,w),w&16&&j(_,1)):(_=Xl(c),_.c(),j(_,1),_.m(n.parentNode,n)):_&&(Nt(),Z(_,1,1,()=>{_=null}),Mt()),c[5]?f?(f.p(c,w),w&32&&j(f,1)):(f=xl(c),f.c(),j(f,1),f.m(i.parentNode,i)):f&&(Nt(),Z(f,1,1,()=>{f=null}),Mt()),c[1]?u?(u.p(c,w),w&2&&j(u,1)):(u=ei(c),u.c(),j(u,1),u.m(o.parentNode,o)):u&&(Nt(),Z(u,1,1,()=>{u=null}),Mt())},i(c){s||(j(r),j(a),j(_),j(f),j(u),s=!0)},o(c){Z(r),Z(a),Z(_),Z(f),Z(u),s=!1},d(c){c&&(Oe(e),Oe(t),Oe(n),Oe(i),Oe(o)),r&&r.d(c),a&&a.d(c),_&&_.d(c),f&&f.d(c),u&&u.d(c)}}}function Aa(l){let e,t,n,i;return e=new ue({props:{label:l[0]("chatbot.submit"),Icon:Yt,disabled:l[10]}}),e.$on("click",l[19]),n=new ue({props:{label:l[0]("chatbot.cancel"),Icon:No,disabled:l[10]}}),n.$on("click",l[20]),{c(){gt(e.$$.fragment),t=Gt(),gt(n.$$.fragment)},m(o,s){wt(e,o,s),Re(o,t,s),wt(n,o,s),i=!0},p(o,s){const r={};s&1&&(r.label=o[0]("chatbot.submit")),s&1024&&(r.disabled=o[10]),e.$set(r);const a={};s&1&&(a.label=o[0]("chatbot.cancel")),s&1024&&(a.disabled=o[10]),n.$set(a)},i(o){i||(j(e.$$.fragment,o),j(n.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),Z(n.$$.fragment,o),i=!1},d(o){o&&Oe(t),bt(e,o),bt(n,o)}}}function Kl(l){let e,t;return e=new Va({props:{value:l[16],watermark:l[7]}}),e.$on("copy",l[21]),{c(){gt(e.$$.fragment)},m(n,i){wt(e,n,i),t=!0},p(n,i){const o={};i&65536&&(o.value=n[16]),i&128&&(o.watermark=n[7]),e.$set(o)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){Z(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function Ql(l){let e,t;return e=new ue({props:{Icon:ss,label:l[0]("chatbot.retry"),disabled:l[10]}}),e.$on("click",l[22]),{c(){gt(e.$$.fragment)},m(n,i){wt(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.label=n[0]("chatbot.retry")),i&1024&&(o.disabled=n[10]),e.$set(o)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){Z(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function Xl(l){let e,t;return e=new ue({props:{label:l[0]("chatbot.undo"),Icon:Vo,disabled:l[10]}}),e.$on("click",l[23]),{c(){gt(e.$$.fragment)},m(n,i){wt(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.label=n[0]("chatbot.undo")),i&1024&&(o.disabled=n[10]),e.$set(o)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){Z(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function xl(l){let e,t;return e=new ue({props:{label:l[0]("chatbot.edit"),Icon:jo,disabled:l[10]}}),e.$on("click",l[24]),{c(){gt(e.$$.fragment)},m(n,i){wt(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.label=n[0]("chatbot.edit")),i&1024&&(o.disabled=n[10]),e.$set(o)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){Z(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function ei(l){let e,t;return e=new pa({props:{handle_action:l[12],feedback_options:l[2],selected:l[11],i18n:l[0]}}),{c(){gt(e.$$.fragment)},m(n,i){wt(e,n,i),t=!0},p(n,i){const o={};i&4096&&(o.handle_action=n[12]),i&4&&(o.feedback_options=n[2]),i&2048&&(o.selected=n[11]),i&1&&(o.i18n=n[0]),e.$set(o)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){Z(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function Fa(l){let e,t,n,i;const o=[Aa,Ta],s=[];function r(a,_){return a[6]?0:1}return e=r(l),t=s[e]=o[e](l),{c(){t.c(),n=ul()},m(a,_){s[e].m(a,_),Re(a,n,_),i=!0},p(a,_){let f=e;e=r(a),e===f?s[e].p(a,_):(Nt(),Z(s[f],1,1,()=>{s[f]=null}),Mt(),t=s[e],t?t.p(a,_):(t=s[e]=o[e](a),t.c()),j(t,1),t.m(n.parentNode,n))},i(a){i||(j(t),i=!0)},o(a){Z(t),i=!1},d(a){a&&Oe(n),s[e].d(a)}}}function Za(l){let e,t,n=(l[15]||l[3]||l[4]||l[5]||l[1])&&Yl(l);return{c(){n&&n.c(),e=ul()},m(i,o){n&&n.m(i,o),Re(i,e,o),t=!0},p(i,[o]){i[15]||i[3]||i[4]||i[5]||i[1]?n?(n.p(i,o),o&32826&&j(n,1)):(n=Yl(i),n.c(),j(n,1),n.m(e.parentNode,e)):n&&(Nt(),Z(n,1,1,()=>{n=null}),Mt())},i(i){t||(j(n),t=!0)},o(i){Z(n),t=!1},d(i){i&&Oe(e),n&&n.d(i)}}}function Ua(l,e,t){let n,i,{i18n:o}=e,{likeable:s}=e,{feedback_options:r}=e,{show_retry:a}=e,{show_undo:_}=e,{show_edit:f}=e,{in_edit_mode:u}=e,{show_copy_button:c}=e,{watermark:w=null}=e,{message:m}=e,{position:h}=e,{avatar:k}=e,{generating:d}=e,{current_feedback:$}=e,{handle_action:q}=e,{layout:I}=e,{dispatch:C}=e;const y=()=>q("edit_submit"),x=()=>q("edit_cancel"),T=S=>C("copy",S.detail),_e=()=>q("retry"),fe=()=>q("undo"),he=()=>q("edit");return l.$$set=S=>{"i18n"in S&&t(0,o=S.i18n),"likeable"in S&&t(1,s=S.likeable),"feedback_options"in S&&t(2,r=S.feedback_options),"show_retry"in S&&t(3,a=S.show_retry),"show_undo"in S&&t(4,_=S.show_undo),"show_edit"in S&&t(5,f=S.show_edit),"in_edit_mode"in S&&t(6,u=S.in_edit_mode),"show_copy_button"in S&&t(17,c=S.show_copy_button),"watermark"in S&&t(7,w=S.watermark),"message"in S&&t(18,m=S.message),"position"in S&&t(8,h=S.position),"avatar"in S&&t(9,k=S.avatar),"generating"in S&&t(10,d=S.generating),"current_feedback"in S&&t(11,$=S.current_feedback),"handle_action"in S&&t(12,q=S.handle_action),"layout"in S&&t(13,I=S.layout),"dispatch"in S&&t(14,C=S.dispatch)},l.$$.update=()=>{l.$$.dirty&262144&&t(16,n=ql(m)?$s(m):""),l.$$.dirty&393216&&t(15,i=c&&m&&ql(m))},[o,s,r,a,_,f,u,w,h,k,d,$,q,I,C,i,n,c,m,y,x,T,_e,fe,he]}class _o extends Da{constructor(e){super(),Ba(this,e,Ua,Za,Ea,{i18n:0,likeable:1,feedback_options:2,show_retry:3,show_undo:4,show_edit:5,in_edit_mode:6,show_copy_button:17,watermark:7,message:18,position:8,avatar:9,generating:10,current_feedback:11,handle_action:12,layout:13,dispatch:14})}get i18n(){return this.$$.ctx[0]}set i18n(e){this.$$set({i18n:e}),K()}get likeable(){return this.$$.ctx[1]}set likeable(e){this.$$set({likeable:e}),K()}get feedback_options(){return this.$$.ctx[2]}set feedback_options(e){this.$$set({feedback_options:e}),K()}get show_retry(){return this.$$.ctx[3]}set show_retry(e){this.$$set({show_retry:e}),K()}get show_undo(){return this.$$.ctx[4]}set show_undo(e){this.$$set({show_undo:e}),K()}
9get show_edit(){return this.$$.ctx[5]}set show_edit(e){this.$$set({show_edit:e}),K()}get in_edit_mode(){return this.$$.ctx[6]}set in_edit_mode(e){this.$$set({in_edit_mode:e}),K()}get show_copy_button(){return this.$$.ctx[17]}set show_copy_button(e){this.$$set({show_copy_button:e}),K()}get watermark(){return this.$$.ctx[7]}set watermark(e){this.$$set({watermark:e}),K()}get message(){return this.$$.ctx[18]}set message(e){this.$$set({message:e}),K()}get position(){return this.$$.ctx[8]}set position(e){this.$$set({position:e}),K()}get avatar(){return this.$$.ctx[9]}set avatar(e){this.$$set({avatar:e}),K()}get generating(){return this.$$.ctx[10]}set generating(e){this.$$set({generating:e}),K()}get current_feedback(){return this.$$.ctx[11]}set current_feedback(e){this.$$set({current_feedback:e}),K()}get handle_action(){return this.$$.ctx[12]}set handle_action(e){this.$$set({handle_action:e}),K()}get layout(){return this.$$.ctx[13]}set layout(e){this.$$set({layout:e}),K()}get dispatch(){return this.$$.ctx[14]}set dispatch(e){this.$$set({dispatch:e}),K()}}const{SvelteComponent:Wa,assign:ti,attr:Pa,bubble:ft,check_outros:Xe,construct_svelte_component:ie,create_component:oe,destroy_component:se,detach:Ie,element:fo,empty:vt,flush:He,get_spread_object:ni,get_spread_update:li,group_outros:xe,init:Oa,insert:Be,mount_component:ae,noop:Ra,safe_not_equal:Ja,set_style:Ga,transition_in:G,transition_out:Y}=window.__gradio__svelte__internal;function Ya(l){let e,t,n;const i=[{value:l[2]},{clear_color:l[5].clear_color},{display_mode:l[5].display_mode},{zoom_speed:l[5].zoom_speed},{pan_speed:l[5].pan_speed},l[5].camera_position!==void 0&&{camera_position:l[5].camera_position},{has_change_history:!0},{show_label:!1},{root:""},{interactive:!1},{label:"chatbot-model3d"},{show_share_button:!0},{gradio:{dispatch:Rn,i18n:l[6]}}];var o=l[1][l[0]];function s(r,a){let _={};for(let f=0;f<i.length;f+=1)_=ti(_,i[f]);return a!==void 0&&a&100&&(_=ti(_,li(i,[a&4&&{value:r[2]},a&32&&{clear_color:r[5].clear_color},a&32&&{display_mode:r[5].display_mode},a&32&&{zoom_speed:r[5].zoom_speed},a&32&&{pan_speed:r[5].pan_speed},a&32&&ni(r[5].camera_position!==void 0&&{camera_position:r[5].camera_position}),i[6],i[7],i[8],i[9],i[10],i[11],a&64&&{gradio:{dispatch:Rn,i18n:r[6]}}]))),{props:_}}return o&&(e=ie(o,s(l)),e.$on("load",l[18])),{c(){e&&oe(e.$$.fragment),t=vt()},m(r,a){e&&ae(e,r,a),Be(r,t,a),n=!0},p(r,a){if(a&3&&o!==(o=r[1][r[0]])){if(e){xe();const _=e;Y(_.$$.fragment,1,0,()=>{se(_,1)}),Xe()}o?(e=ie(o,s(r,a)),e.$on("load",r[18]),oe(e.$$.fragment),G(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(o){const _=a&100?li(i,[a&4&&{value:r[2]},a&32&&{clear_color:r[5].clear_color},a&32&&{display_mode:r[5].display_mode},a&32&&{zoom_speed:r[5].zoom_speed},a&32&&{pan_speed:r[5].pan_speed},a&32&&ni(r[5].camera_position!==void 0&&{camera_position:r[5].camera_position}),i[6],i[7],i[8],i[9],i[10],i[11],a&64&&{gradio:{dispatch:Rn,i18n:r[6]}}]):{};e.$set(_)}},i(r){n||(e&&G(e.$$.fragment,r),n=!0)},o(r){e&&Y(e.$$.fragment,r),n=!1},d(r){r&&Ie(t),e&&se(e,r)}}}function Ka(l){let e,t,n;var i=l[1][l[0]];function o(s,r){return{props:{value:s[2],show_label:!1,label:"chatbot-html",show_share_button:!0,i18n:s[6],gradio:{dispatch:or}}}}return i&&(e=ie(i,o(l)),e.$on("load",l[17])),{c(){e&&oe(e.$$.fragment),t=vt()},m(s,r){e&&ae(e,s,r),Be(s,t,r),n=!0},p(s,r){if(r&3&&i!==(i=s[1][s[0]])){if(e){xe();const a=e;Y(a.$$.fragment,1,0,()=>{se(a,1)}),Xe()}i?(e=ie(i,o(s)),e.$on("load",s[17]),oe(e.$$.fragment),G(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=s[2]),r&64&&(a.i18n=s[6]),e.$set(a)}},i(s){n||(e&&G(e.$$.fragment,s),n=!0)},o(s){e&&Y(e.$$.fragment,s),n=!1},d(s){s&&Ie(t),e&&se(e,s)}}}function Qa(l){let e,t,n;var i=l[1][l[0]];function o(s,r){return{props:{value:s[2],show_label:!1,label:"chatbot-image",show_download_button:s[9],display_icon_button_wrapper_top_corner:s[10],i18n:s[6]}}}return i&&(e=ie(i,o(l)),e.$on("load",l[16])),{c(){e&&oe(e.$$.fragment),t=vt()},m(s,r){e&&ae(e,s,r),Be(s,t,r),n=!0},p(s,r){if(r&3&&i!==(i=s[1][s[0]])){if(e){xe();const a=e;Y(a.$$.fragment,1,0,()=>{se(a,1)}),Xe()}i?(e=ie(i,o(s)),e.$on("load",s[16]),oe(e.$$.fragment),G(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=s[2]),r&512&&(a.show_download_button=s[9]),r&1024&&(a.display_icon_button_wrapper_top_corner=s[10]),r&64&&(a.i18n=s[6]),e.$set(a
9)}},i(s){n||(e&&G(e.$$.fragment,s),n=!0)},o(s){e&&Y(e.$$.fragment,s),n=!1},d(s){s&&Ie(t),e&&se(e,s)}}}function Xa(l){let e,t,n;var i=l[1][l[0]];function o(s,r){return{props:{autoplay:s[5].autoplay,value:s[2].video||s[2],show_label:!1,show_share_button:!0,i18n:s[6],upload:s[7],display_icon_button_wrapper_top_corner:s[10],show_download_button:s[9],$$slots:{default:[lr]},$$scope:{ctx:s}}}}return i&&(e=ie(i,o(l)),e.$on("load",l[15])),{c(){e&&oe(e.$$.fragment),t=vt()},m(s,r){e&&ae(e,s,r),Be(s,t,r),n=!0},p(s,r){if(r&3&&i!==(i=s[1][s[0]])){if(e){xe();const a=e;Y(a.$$.fragment,1,0,()=>{se(a,1)}),Xe()}i?(e=ie(i,o(s)),e.$on("load",s[15]),oe(e.$$.fragment),G(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&32&&(a.autoplay=s[5].autoplay),r&4&&(a.value=s[2].video||s[2]),r&64&&(a.i18n=s[6]),r&128&&(a.upload=s[7]),r&1024&&(a.display_icon_button_wrapper_top_corner=s[10]),r&512&&(a.show_download_button=s[9]),r&524288&&(a.$$scope={dirty:r,ctx:s}),e.$set(a)}},i(s){n||(e&&G(e.$$.fragment,s),n=!0)},o(s){e&&Y(e.$$.fragment,s),n=!1},d(s){s&&Ie(t),e&&se(e,s)}}}function xa(l){let e,t,n;var i=l[1][l[0]];function o(s,r){return{props:{value:s[2],show_label:!1,show_share_button:!0,i18n:s[6],label:"",waveform_settings:{autoplay:s[5].autoplay},show_download_button:s[9],display_icon_button_wrapper_top_corner:s[10]}}}return i&&(t=ie(i,o(l)),t.$on("load",l[14])),{c(){e=fo("div"),t&&oe(t.$$.fragment),Ga(e,"position","relative")},m(s,r){Be(s,e,r),t&&ae(t,e,null),n=!0},p(s,r){if(r&3&&i!==(i=s[1][s[0]])){if(t){xe();const a=t;Y(a.$$.fragment,1,0,()=>{se(a,1)}),Xe()}i?(t=ie(i,o(s)),t.$on("load",s[14]),oe(t.$$.fragment),G(t.$$.fragment,1),ae(t,e,null)):t=null}else if(i){const a={};r&4&&(a.value=s[2]),r&64&&(a.i18n=s[6]),r&32&&(a.waveform_settings={autoplay:s[5].autoplay}),r&512&&(a.show_download_button=s[9]),r&1024&&(a.display_icon_button_wrapper_top_corner=s[10]),t.$set(a)}},i(s){n||(t&&G(t.$$.fragment,s),n=!0)},o(s){t&&Y(t.$$.fragment,s),n=!1},d(s){s&&Ie(e),t&&se(t)}}}function er(l){let e,t,n;var i=l[1][l[0]];function o(s,r){return{props:{value:s[2],target:s[3],theme_mode:s[4],bokeh_version:s[5].bokeh_version,caption:"",show_actions_button:!0}}}return i&&(e=ie(i,o(l)),e.$on("load",l[13])),{c(){e&&oe(e.$$.fragment),t=vt()},m(s,r){e&&ae(e,s,r),Be(s,t,r),n=!0},p(s,r){if(r&3&&i!==(i=s[1][s[0]])){if(e){xe();const a=e;Y(a.$$.fragment,1,0,()=>{se(a,1)}),Xe()}i?(e=ie(i,o(s)),e.$on("load",s[13]),oe(e.$$.fragment),G(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=s[2]),r&8&&(a.target=s[3]),r&16&&(a.theme_mode=s[4]),r&32&&(a.bokeh_version=s[5].bokeh_version),e.$set(a
vendor: 35,453 bytes, line 9
9)}},i(s){n||(e&&G(e.$$.fragment,s),n=!0)},o(s){e&&Y(e.$$.fragment,s),n=!1},d(s){s&&Ie(t),e&&se(e,s)}}}function tr(l){let e,t,n;var i=l[1][l[0]];function o(s,r){return{props:{value:s[2],show_label:!1,i18n:s[6],label:"",interactive:!1,line_breaks:s[5].line_breaks,wrap:!0,root:"",gradio:{dispatch:ii,i18n:s[6]},datatype:s[5].datatype,latex_delimiters:s[5].latex_delimiters,col_count:s[5].col_count,row_count:s[5].row_count}}}return i&&(e=ie(i,o(l)),e.$on("load",l[12])),{c(){e&&oe(e.$$.fragment),t=vt()},m(s,r){e&&ae(e,s,r),Be(s,t,r),n=!0},p(s,r){if(r&3&&i!==(i=s[1][s[0]])){if(e){xe();const a=e;Y(a.$$.fragment,1,0,()=>{se(a,1)}),Xe()}i?(e=ie(i,o(s)),e.$on("load",s[12]),oe(e.$$.fragment),G(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=s[2]),r&64&&(a.i18n=s[6]),r&32&&(a.line_breaks=s[5].line_breaks),r&64&&(a.gradio={dispatch:ii,i18n:s[6]}),r&32&&(a.datatype=s[5].datatype),r&32&&(a.latex_delimiters=s[5].latex_delimiters),r&32&&(a.col_count=s[5].col_count),r&32&&(a.row_count=s[5].row_count),e.$set(a)}},i(s){n||(e&&G(e.$$.fragment,s),n=!0)},o(s){e&&Y(e.$$.fragment,s),n=!1},d(s){s&&Ie(t),e&&se(e,s)}}}function nr(l){let e,t,n;var i=l[1][l[0]];function o(s,r){return{props:{value:s[2],display_icon_button_wrapper_top_corner:s[10],show_label:!1,i18n:s[6],label:"",_fetch:s[8],allow_preview:!1,interactive:!1,mode:"minimal",fixed_height:1}}}return i&&(e=ie(i,o(l)),e.$on("load",l[11])),{c(){e&&oe(e.$$.fragment),t=vt()},m(s,r){e&&ae(e,s,r),Be(s,t,r),n=!0},p(s,r){if(r&3&&i!==(i=s[1][s[0]])){if(e){xe();const a=e;Y(a.$$.fragment,1,0,()=>{se(a,1)}),Xe()}i?(e=ie(i,o(s)),e.$on("load",s[11]),oe(e.$$.fragment),G(e.$$.fragment,1),ae(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=s[2]),r&1024&&(a.display_icon_button_wrapper_top_corner=s[10]),r&64&&(a.i18n=s[6]),r&256&&(a._fetch=s[8]),e.$set(a)}},i(s){n||(e&&G(e.$$.fragment,s),n=!0)},o(s){e&&Y(e.$$.fragment,s),n=!1},d(s){s&&Ie(t),e&&se(e,s)}}}function lr(l){let e;return{c(){e=fo("track"),Pa(e,"kind","captions")},m(t,n){Be(t,e,n)},p:Ra,d(t){t&&Ie(e)}}}function ir(l){let e,t,n,i;const o=[nr,tr,er,xa,Xa,Qa,Ka,Ya],s=[];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:a[0]==="model3d"?7:-1}return~(e=r(l))&&(t=s[e]=o[e](l)),{c(){t&&t.c(),n=vt()},m(a,_){~e&&s[e].m(a,_),Be(a,n,_),i=!0},p(a,[_]){let f=e;e=r(a),e===f?~e&&s[e].p(a,_):(t&&(xe(),Y(s[f],1,1,()=>{s[f]=null}),Xe()),~e?(t=s[e],t?t.p(a,_):(t=s[e]=o[e](a),t.c()),G(t,1),t.m(n.parentNode,n)):t=null)},i(a){i||(G(t),i=!0)},o(a){Y(t),i=!1},d(a){a&&Ie(n),~e&&s[e].d(a)}}}const ii=()=>{},or=()=>{},Rn=()=>{};function sr(l,e,t){let{type:n}=e,{components:i}=e,{value:o}=e,{target:s}=e,{theme_mode:r}=e,{props:a}=e,{i18n:_}=e,{upload:f}=e,{_fetch:u}=e,{allow_file_downloads:c}=e,{display_icon_button_wrapper_top_corner:w=!1}=e;function m(y){ft.call(this,l,y)}function h(y){ft.call(this,l,y)}function k(y){ft.call(this,l,y)}function d(y){ft.call(this,l,y)}function $(y){ft.call(this,l,y)}function q(y){ft.call(this,l,y)}function I(y){ft.call(this,l,y)}function C(y){ft.call(this,l,y)}return l.$$set=y=>{"type"in y&&t(0,n=y.type),"components"in y&&t(1,i=y.components),"value"in y&&t(2,o=y.value),"target"in y&&t(3,s=y.target),"theme_mode"in y&&t(4,r=y.theme_mode),"props"in y&&t(5,a=y.props),"i18n"in y&&t(6,_=y.i18n),"upload"in y&&t(7,f=y.upload),"_fetch"in y&&t(8,u=y._fetch),"allow_file_downloads"in y&&t(9,c=y.allow_file_downloads),"display_icon_button_wrapper_top_corner"in y&&t(10,w=y.display_icon_button_wrapper_top_corner)},[n,i,o,s,r,a,_,f,u,c,w,m,h,k,d,$,q,I,C]}class ar extends Wa{constructor(e){super(),Oa(this,e,sr,ir,Ja,{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}),He()}get components(){return this.$$.ctx[1]}set components(e){this.$$set({components:e}),He()}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),He()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),He()}get theme_mode(){return this.$$.ctx[4]}set theme_mode(e){this.$$set({theme_mode:e}),He()}get props(){return this.$$.ctx[5]}set props(e){this.$$set({props:e}),He()}get i18n(){return this.$$.ctx[6]}set i18n(e){this.$$set({i18n:e}),He()}get upload(){return this.$$.ctx[7]}set upload(e){this.$$set({upload:e}),He()}get _fetch(){return this.$$.ctx[8]}set _fetch(e){this.$$set({_fetch:e}),He()}get allow_file_downloads(){return this.$$.ctx[9]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),He()}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}),He()}}const{SvelteComponent:rr,append:Pe,attr:we,check_outros:_r,create_component:cl,destroy_component:ml,detach:hl,element:Lt,empty:fr,flush:Q,group_outros:ur,init:cr,insert:dl,is_function:mr,mount_component:gl,safe_not_equal:hr,set_data:oi,space:si,text:ai,transition_in:Kt,transition_out:Qt}=window.__gradio__svelte__internal;function dr(l){let e,t,n,i,o,s,r,a=(l[16].content.value?.orig_name||l[16].content.value?.path.split("/").pop()||"file")+"",_,f,u,c,w,m=(l[16].content.value?.orig_name||l[16].content.value?.path||"").split(".").pop().toUpperCase()+"",h,k;return n=new ol({}),{c(){e=Lt("div"),t=Lt("div"),cl(n.$$.fragment),i=si(),o=Lt("div"),s=Lt("a"),r=Lt("span"),_=ai(a),c=si(),w=Lt("span"),h=ai(m),we(t,"class","file-icon svelte-ulpe0d"),we(r,"class","file-name svelte-ulpe0d"),we(s,"data-testid","chatbot-file"),we(s,"class","file-link svelte-ulpe0d"),we(s,"href",f=l[16].content.value.url),we(s,"target","_blank"),we(s,"download",u=window.__is_colab__?null:l[16].content.value?.orig_name||l[16].content.value?.path.split("/").pop()||"file"),we(w,"class","file-type svelte-ulpe0d"),we(o,"class","file-info svelte-ulpe0d"),we(e,"class","file-container svelte-ulpe0d")},m(d,$){dl(d,e,$),Pe(e,t),gl(n,t,null),Pe(e,i),Pe(e,o),Pe(o,s),Pe(s,r),Pe(r,_),Pe(o,c),Pe(o,w),Pe(w,h),k=!0},p(d,$){(!k||$&65536)&&a!==(a=(d[16].content.value?.orig_name||d[16].content.value?.path.split("/").pop()||"file")+"")&&oi(_,a),(!k||$&65536&&f!==(f=d[16].content.value.url))&&we(s,"href",f),(!k||$&65536&&u!==(u=window.__is_colab__?null:d[16].content.value?.orig_name||d[16].content.value?.path.split("/").pop()||"file"))&&we(s,"download",u),(!k||$&65536)&&m!==(m=(d[16].content.value?.orig_name||d[16].content.value?.path||"").split(".").pop().toUpperCase()+"")&&oi(h,m)},i(d){k||(Kt(n.$$.fragment,d),k=!0)},o(d){Qt(n.$$.fragment,d),k=!1},d(d){d&&hl(e),ml(n)}}}function gr(l){let e,t;return e=new ar({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(){cl(e.$$.fragment)},m(n,i){gl(e,n,i),t=!0},p(n,i){const o={};i&64&&(o.target=n[6]),i&256&&(o.theme_mode=n[8]),i&65536&&(o.props=n[16].content.props),i&65536&&(o.type=n[16].content.component),i&512&&(o.components=n[9]),i&65536&&(o.value=n[16].content.value),i&24576&&(o.display_icon_button_wrapper_top_corner=n[14]>0&&n[13]),i&8&&(o.i18n=n[3]),i&32&&(o.upload=n[5]),i&4&&(o._fetch=n[2]),i&4096&&(o.allow_file_downloads=n[12]),e.$set(o)},i(n){t||(Kt(e.$$.fragment,n),t=!0)},o(n){Qt(e.$$.fragment,n),t=!1},d(n){ml(e,n)}}}function br(l){let e,t,n;return t=new sl({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],theme_mode:l[8]}}),t.$on("load",function(){mr(l[11])&&l[11].apply(this,arguments)}),{c(){e=Lt("div"),cl(t.$$.fragment),we(e,"class","message-content")},m(i,o){dl(i,e,o),gl(t,e,null),n=!0},p(i,o){l=i;const s={};o&65536&&(s.message=l[16].content),o&1&&(s.latex_delimiters=l[0]),o&2&&(s.sanitize_html=l[1]),o&1024&&(s.render_markdown=l[10]),o&16&&(s.line_breaks=l[4]),o&128&&(s.root=l[7]),o&32768&&(s.allow_tags=l[15]),o&256&&(s.theme_mode=l[8]),t.$set(s)},i(i){n||(Kt(t.$$.fragment,i),n=!0)},o(i){Qt(t.$$.fragment,i),n=!1},d(i){i&&hl(e),ml(t)}}}function wr(l){let e,t,n,i;const o=[br,gr,dr],s=[];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=s[e]=o[e](l)),{c(){t&&t.c(),n=fr()},m(a,_){~e&&s[e].m(a,_),dl(a,n,_),i=!0},p(a,[_]){let f=e;e=r(a),e===f?~e&&s[e].p(a,_):(t&&(ur(),Qt(s[f],1,1,()=>{s[f]=null}),_r()),~e?(t=s[e],t?t.p(a,_):(t=s[e]=o[e](a),t.c()),Kt(t,1),t.m(n.parentNode,n)):t=null)},i(a){i||(Kt(t),i=!0)},o(a){Qt(t),i=!1},d(a){a&&hl(n),~e&&s[e].d(a)}}}function kr(l,e,t){let{latex_delimiters:n}=e,{sanitize_html:i}=e,{_fetch:o}=e,{i18n:s}=e,{line_breaks:r}=e,{upload:a}=e,{target:_}=e,{root:f}=e,{theme_mode:u}=e,{_components:c}=e,{render_markdown:w}=e,{scroll:m}=e,{allow_file_downloads:h}=e,{display_consecutive_in_same_bubble:k}=e,{thought_index:d}=e,{allow_tags:$=!1}=e,{message:q}=e;const I=()=>m();return l.$$set=C=>{"latex_delimiters"in C&&t(0,n=C.latex_delimiters),"sanitize_html"in C&&t(1,i=C.sanitize_html),"_fetch"in C&&t(2,o=C._fetch),"i18n"in C&&t(3,s=C.i18n),"line_breaks"in C&&t(4,r=C.line_breaks),"upload"in C&&t(5,a=C.upload),"target"in C&&t(6,_=C.target),"root"in C&&t(7,f=C.root),"theme_mode"in C&&t(8,u=C.theme_mode),"_components"in C&&t(9,c=C._components),"render_markdown"in C&&t(10,w=C.render_markdown),"scroll"in C&&t(11,m=C.scroll),"allow_file_downloads"in C&&t(12,h=C.allow_file_downloads),"display_consecutive_in_same_bubble"in C&&t(13,k=C.display_consecutive_in_same_bubble),"thought_index"in C&&t(14,d=C.thought_index),"allow_tags"in C&&t(15,$=C.allow_tags),"message"in C&&t(16,q=C.message)},[n,i,o,s,r,a,_,f,u,c,w,m,h,k,d,$,q,I]}class uo extends rr{constructor(e){super(),cr(this,e,kr,wr,hr,{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}),Q()}get sanitize_html(){return this.$$.ctx[1]}set sanitize_html(e){this.$$set({sanitize_html:e}),Q()}get _fetch(){return this.$$.ctx[2]}set _fetch(e){this.$$set({_fetch:e}),Q()}get i18n(){return this.$$.ctx[3]}set i18n(e){this.$$set({i18n:e}),Q()}get line_breaks(){return this.$$.ctx[4]}set line_breaks(e){this.$$set({line_breaks:e}),Q()}get upload(){return this.$$.ctx[5]}set upload(e){this.$$set({upload:e}),Q()}get target(){return this.$$.ctx[6]}set target(e){this.$$set({target:e}),Q()}get root(){return this.$$.ctx[7]}set root(e){this.$$set({root:e}),Q()}get theme_mode(){return this.$$.ctx[8]}set theme_mode(e){this.$$set({theme_mode:e}),Q()}get _components(){return this.$$.ctx[9]}set _components(e){this.$$set({_components:e}),Q()}get render_markdown(){return this.$$.ctx[10]}set render_markdown(e){this.$$set({render_markdown:e}),Q()}get scroll(){return this.$$.ctx[11]}set scroll(e){this.$$set({scroll:e}),Q()}get allow_file_downloads(){return this.$$.ctx[12]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),Q()}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}),Q()}get thought_index(){return this.$$.ctx[14]}set thought_index(e){this.$$set({thought_index:e}),Q()}get allow_tags(){return this.$$.ctx[15]}set allow_tags(e){this.$$set({allow_tags:e}),Q()}get message(){return this.$$.ctx[16]}set message(e){this.$$set({message:e}),Q()}}const{SvelteComponent:pr,add_render_callback:vr,append:ct,attr:Le,binding_callbacks:$r,check_outros:bl,create_bidirectional_transition:ri,create_component:dn,destroy_component:gn,destroy_each:Cr,detach:ce,element:jt,ensure_array_like:_i,flush:J,group_outros:wl,init:yr,insert:me,listen:el,mount_component:bn,run_all:zr,safe_not_equal:qr,set_data:$n,set_style:fi,space:At,stop_propagation:Sr,text:Qe,toggle_class:Ft,transition_in:ke,transition_out:De}=window.__gradio__svelte__internal;function ui(l,e,t){const n=l.slice();return n[28]=e[t],n[30]=t,n}function ci(l){let e;return{c(){e=jt("span"),Le(e,"class","loading-spinner svelte-1qn6r4f")},m(t,n){me(t,e,n)},d(t){t&&ce(e)}}}function mi(l){let e,t,n=l[17].metadata.log&&hi(l),i=l[17].metadata.duration!==void 0&&di(l);return{c(){e=jt("span"),n&&n.c(),t=At(),i&&i.c(),Le(e,"class","duration svelte-1qn6r4f")},m(o,s){me(o,e,s),n&&n.m(e,null),ct(e,t),i&&i.m(e,null)},p(o,s){o[17].metadata.log?n?n.p(o,s):(n=hi(o),n.c(),n.m(e,t)):n&&(n.d(1),n=null),o[17].metadata.duration!==void 0?i?i.p(o,s):(i=di(o),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(o){o&&ce(e),n&&n.d(),i&&i.d()}}}function hi(l){let e=l[17].metadata.log+"",t;return{c(){t=Qe(e)},m(n,i){me(n,t,i)},p(n,i){i&131072&&e!==(e=n[17].metadata.log+"")&&$n(t,e)},d(n){n&&ce(t)}}}function di(l){let e,t,n;function i(r,a){return a&131072&&(t=null),t==null&&(t=!!Number.isInteger(r[17].metadata.duration)),t?Mr:r[17].metadata.duration>=.1?Lr:Hr}let o=i(l,-1),s=o(l);return{c(){e=Qe("("),s.c(),n=Qe(")")},m(r,a){me(r,e,a),s.m(r,a),me(r,n,a)},p(r,a){o===(o=i(r,a))&&s?s.p(r,a):(s.d(1),s=o(r),s&&(s.c(),s.m(n.parentNode,n)))},d(r){r&&(ce(e),ce(n)),s.d(r)}}}function Hr(l){let e=(l[17].metadata.duration*1e3).toFixed(1)+"",t,n;return{c(){t=Qe(e),n=Qe("ms")},m(i,o){me(i,t,o),me(i,n,o)},p(i,o){o&131072&&e!==(e=(i[17].metadata.duration*1e3).toFixed(1)+"")&&$n(t,e)},d(i){i&&(ce(t),ce(n))}}}function Lr(l){let e=l[17].metadata.duration.toFixed(1)+"",t,n;return{c(){t=Qe(e),n=Qe("s")},m(i,o){me(i,t,o),me(i,n,o)},p(i,o){o&131072&&e!==(e=i[17].metadata.duration.toFixed(1)+"")&&$n(t,e)},d(i){i&&(ce(t),ce(n))}}}function Mr(l){let e=l[17].metadata.duration+"",t,n;return{c(){t=Qe(e),n=Qe("s")},m(i,o){me(i,t,o),me(i,n,o)},p(i,o){o&131072&&e!==(e=i[17].metadata.duration+"")&&$n(t,e)},d(i){i&&(ce(t),ce(n))}}}function gi(l){let e,t,n,i,o,s,r;t=new uo({props:{message:l[17],sanitize_html:l[1],allow_tags:l[16],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 a=l[17].children?.length>0&&bi(l);return{c(){e=jt("div"),dn(t.$$.fragment),n=At(),a&&a.c(),Le(e,"class","svelte-1qn6r4f"),Ft(e,"content",l[19]),Ft(e,"content-preview",!l[19]&&l[17].metadata?.status!=="done")},m(_,f){me(_,e,f),bn(t,e,null),ct(e,n),a&&a.m(e,null),l[25](e),o=!0,s||(r=el(e,"scroll",l[21]),s=!0)},p(_,f){const u={};f&131072&&(u.message=_[17]),f&2&&(u.sanitize_html=_[1]),f&65536&&(u.allow_tags=_[16]),f&4&&(u.latex_delimiters=_[2]),f&8&&(u.render_markdown=_[3]),f&16&&(u._components=_[4]),f&32&&(u.upload=_[5]),f&64&&(u.thought_index=_[6]),f&128&&(u.target=_[7]),f&256&&(u.root=_[8]),f&512&&(u.theme_mode=_[9]),f&1024&&(u._fetch=_[10]),f&2048&&(u.scroll=_[11]),f&4096&&(u.allow_file_downloads=_[12]),f&8192&&(u.display_consecutive_in_same_bubble=_[13]),f&16384&&(u.i18n=_[14]),f&32768&&(u.line_breaks=_[15]),t.$set(u),_[17].children?.length>0?a?(a.p(_,f),f&131072&&ke(a,1)):(a=bi(_),a.c(),ke(a,1),a.m(e,null)):a&&(wl(),De(a,1,1,()=>{a=null}),bl()),(!o||f&524288)&&Ft(e,"content",_[19]),(!o||f&655360)&&Ft(e,"content-preview",!_[19]&&_[17].metadata?.status!=="done")},i(_){o||(ke(t.$$.fragment,_),ke(a),_&&vr(()=>{o&&(i||(i=ri(e,vl,{},!0)),i.run(1))}),o=!0)},o(_){De(t.$$.fragment,_),De(a),_&&(i||(i=ri(e,vl,{},!1)),i.run(0)),o=!1},d(_){_&&ce(e),gn(t),a&&a.d(),l[25](null),_&&i&&i.end(),s=!1,r()}}}function bi(l){let e,t,n=_i(l[17].children),i=[];for(let s=0;s<n.length;s+=1)i[s]=wi(ui(l,n,s));const o=s=>De(i[s],1,1,()=>{i[s]=null});return{c(){e=jt("div");for(let s=0;s<i.length;s+=1)i[s].c();Le(e,"class","children svelte-1qn6r4f")},m(s,r){me(s,e,r);for(let a=0;a<i.length;a+=1)i[a]&&i[a].m(e,null);t=!0},p(s,r){if(r&196607){n=_i(s[17].children);let a;for(a=0;a<n.length;a+=1){const _=ui(s,n,a);i[a]?(i[a].p(_,r),ke(i[a],1)):(i[a]=wi(_),i[a].c(),ke(i[a],1),i[a].m(e,null))}for(wl(),a=n.length;a<i.length;a+=1)o(a);bl()}},i(s){if(!t){for(let r=0;r<n.length;r+=1)ke(i[r]);t=!0}},o(s){i=i.filter(Boolean);for(let r=0;r<i.length;r+=1)De(i[r]);t=!1},d(s){s&&ce(e),Cr(i,s)}}}function wi(l){let e,t;return e=new co({props:{thought:l[28],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(){dn(e.$$.fragment)},m(n,i){bn(e,n,i),t=!0},p(n,i){const o={};i&131072&&(o.thought=n[28]),i&1&&(o.rtl=n[0]),i&2&&(o.sanitize_html=n[1]),i&4&&(o.latex_delimiters=n[2]),i&8&&(o.render_markdown=n[3]),i&16&&(o._components=n[4]),i&32&&(o.upload=n[5]),i&64&&(o.thought_index=n[6]+1),i&128&&(o.target=n[7]),i&256&&(o.root=n[8]),i&512&&(o.theme_mode=n[9]),i&1024&&(o._fetch=n[10]),i&2048&&(o.scroll=n[11]),i&4096&&(o.allow_file_downloads=n[12]),i&8192&&(o.display_consecutive_in_same_bubble=n[13]),i&16384&&(o.i18n=n[14]),i&32768&&(o.line_breaks=n[15]),e.$set(o)},i(n){t||(ke(e.$$.fragment,n),t=!0)},o(n){De(e.$$.fragment,n),t=!1},d(n){gn(e,n)}}}function Nr(l){let e,t,n,i,o,s,r,a,_,f,u,c,w;i=new ue({props:{Icon:xo}}),s=new sl({props:{message:l[17].metadata?.title||"",render_markdown:l[3],latex_delimiters:l[2],sanitize_html:l[1],root:l[8],allow_tags:l[16]}});let m=l[17].metadata?.status==="pending"&&ci(),h=(l[17]?.metadata?.log||l[17]?.metadata?.duration)&&mi(l),k=l[19]&&gi(l);return{c(){e=jt("div"),t=jt("div"),n=jt("span"),dn(i.$$.fragment),o=At(),dn(s.$$.fragment),r=At(),m&&m.c(),a=At(),h&&h.c(),f=At(),k&&k.c(),Le(n,"class","arrow svelte-1qn6r4f"),fi(n,"transform",l[19]?"rotate(180deg)":"rotate(0deg)"),Le(t,"class","title svelte-1qn6r4f"),Le(t,"aria-busy",_=l[17].content===""||l[17].content===null),Le(t,"role","button"),Le(t,"tabindex","0"),Ft(t,"expanded",l[19]),Le(e,"class","thought-group svelte-1qn6r4f")},m(d,$){me(d,e,$),ct(e,t),ct(t,n),bn(i,n,null),ct(t,o),bn(s,t,null),ct(t,r),m&&m.m(t,null),ct(t,a),h&&h.m(t,null),ct(e,f),k&&k.m(e,null),u=!0,c||(w=[el(t,"click",Sr(l[20])),el(t,"keydown",l[24])],c=!0)},p(d,[$]){$&524288&&fi(n,"transform",d[19]?"rotate(180deg)":"rotate(0deg)");const q={};$&131072&&(q.message=d[17].metadata?.title||""),$&8&&(q.render_markdown=d[3]),$&4&&(q.latex_delimiters=d[2]),$&2&&(q.sanitize_html=d[1]),$&256&&(q.root=d[8]),$&65536&&(q.allow_tags=d[16]),s.$set(q),d[17].metadata?.status==="pending"?m||(m=ci(),m.c(),m.m(t,a)):m&&(m.d(1),m=null),d[17]?.metadata?.log||d[17]?.metadata?.duration?h?h.p(d,$):(h=mi(d),h.c(),h.m(t,null)):h&&(h.d(1),h=null),(!u||$&131072&&_!==(_=d[17].content===""||d[17].content===null))&&Le(t,"aria-busy",_),(!u||$&524288)&&Ft(t,"expanded",d[19]),d[19]?k?(k.p(d,$),$&524288&&ke(k,1)):(k=gi(d),k.c(),ke(k,1),k.m(e,null)):k&&(wl(),De(k,1,1,()=>{k=null}),bl())},i(d){u||(ke(i.$$.fragment,d),ke(s.$$.fragment,d),ke(k),u=!0)},o(d){De(i.$$.fragment,d),De(s.$$.fragment,d),De(k),u=!1},d(d){d&&ce(e),gn(i),gn(s),m&&m.d(),h&&h.d(),k&&k.d(),c=!1,zr(w)}}}function jr(l){return"children"in l}function Vr(l,e,t){let{thought:n}=e,{rtl:i=!1}=e,{sanitize_html:o}=e,{latex_delimiters:s}=e,{render_markdown:r}=e,{_components:a}=e,{upload:_}=e,{thought_index:f}=e,{target:u}=e,{root:c}=e,{theme_mode:w}=e,{_fetch:m}=e,{scroll:h}=e,{allow_file_downloads:k}=e,{display_consecutive_in_same_bubble:d}=e,{i18n:$}=e,{line_breaks:q}=e,{allow_tags:I=!1}=e,C,y=!1,x=!1,T,_e=!1;function fe(){t(19,y=!y),t(23,x=!0)}function he(){T&&!_e&&t(18,T.scrollTop=T.scrollHeight,T)}function S(){T&&(T.scrollHeight-T.scrollTop<=T.clientHeight+10||(_e=!0))}const Ce=v=>v.key==="Enter"&&fe();function de(v){$r[v?"unshift":"push"](()=>{T=v,t(18,T)})}return l.$$set=v=>{"thought"in v&&t(22,n=v.thought),"rtl"in v&&t(0,i=v.rtl),"sanitize_html"in v&&t(1,o=v.sanitize_html),"latex_delimiters"in v&&t(2,s=v.latex_delimiters),"render_markdown"in v&&t(3,r=v.render_markdown),"_components"in v&&t(4,a=v._components),"upload"in v&&t(5,_=v.upload),"thought_index"in v&&t(6,f=v.thought_index),"target"in v&&t(7,u=v.target),"root"in v&&t(8,c=v.root),"theme_mode"in v&&t(9,w=v.theme_mode),"_fetch"in v&&t(10,m=v._fetch),"scroll"in v&&t(11,h=v.scroll),"allow_file_downloads"in v&&t(12,k=v.allow_file_downloads),"display_consecutive_in_same_bubble"in v&&t(13,d=v.display_consecutive_in_same_bubble),"i18n"in v&&t(14,$=v.i18n),"line_breaks"in v&&t(15,q=v.line_breaks),"allow_tags"in v&&t(16,I=v.allow_tags)},l.$$.update=()=>{l.$$.dirty&4194304&&t(17,C={...n,children:jr(n)?n.children:[]}),l.$$.dirty&8519680&&(x||t(19,y=C?.metadata?.status!=="done")),l.$$.dirty&393216&&C.content&&T&&C.metadata?.status!=="done"&&setTimeout(he,0)},[i,o,s,r,a,_,f,u,c,w,m,h,k,d,$,q,I,C,T,y,fe,S,n,x,Ce,de]}class co extends pr{constructor(e){super(),yr(this,e,Vr,Nr,qr,{thought:22,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,allow_tags:16})}get thought(){return this.$$.ctx[22]}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()}get allow_tags(){return this.$$.ctx[16]}set allow_tags(e){this.$$set({allow_tags:e}),J()}}const{SvelteComponent:Dr,append:Jn,assign:mo,attr:le,binding_callbacks:Ir,check_outros:Zt,create_component:xt,destroy_component:en,destroy_each:Br,detach:Ye,element:Vt,empty:ho,ensure_array_like:ki,flush:L,get_spread_object:go,get_spread_update:bo,group_outros:Ut,init:Er,insert:Ke,listen:tl,mount_component:tn,noop:pi,null_to_empty:vi,run_all:Tr,safe_not_equal:Ar,set_input_value:$i,set_style:Je,space:nl,toggle_class:B,transition_in:U,transition_out:X}=window.__gradio__svelte__internal;function Ci(l,e,t){const n=l.slice();return n[48]=e[t],n[49]=e,n[50]=t,n}function yi(l){let e,t,n;return t=new Xt({props:{class:"avatar-image",src:l[2]?.url,alt:l[4]+" avatar"}}),{c(){e=Vt("div"),xt(t.$$.fragment),le(e,"class","avatar-container svelte-1csv61q")},m(i,o){Ke(i,e,o),tn(t,e,null),n=!0},p(i,o){const s={};o[0]&4&&(s.src=i[2]?.url),o[0]&16&&(s.alt=i[4]+" avatar"),t.$set(s)},i(i){n||(U(t.$$.fragment,i),n=!0)},o(i){X(t.$$.fragment,i),n=!1},d(i){i&&Ye(e),en(t)}}}function Fr(l){let e,t,n,i,o,s=l[50],r,a,_;const f=[Wr,Ur],u=[];function c(d,$){return d[48]?.metadata?.title?0:1}t=c(l),n=u[t]=f[t](l);const w=()=>l[44](e,s),m=()=>l[44](null,s);function h(){return l[45](l[48])}function k(...d){return l[46](l[48],...d)}return{c(){e=Vt("div"),n.c(),le(e,"data-testid",l[4]),le(e,"dir",i=l[12]?"rtl":"ltr"),le(e,"aria-label",o=l[4]+"'s message: "+Hi(l[48])),le(e,"class","svelte-1csv61q"),B(e,"latest",l[21]===l[1].length-1),B(e,"message-markdown-disabled",!l[7]),B(e,"selectable",l[10]),Je(e,"user-select","text"),Je(e,"cursor",l[10]?"pointer":"auto"),Je(e,"text-align",l[12]?"right":"left")},m(d,$){Ke(d,e,$),u[t].m(e,null),w(),r=!0,a||(_=[tl(e,"click",h),tl(e,"keydown",k)],a=!0)},p(d,$){l=d;let q=t;t=c(l),t===q?u[t].p(l,$):(Ut(),X(u[q],1,1,()=>{u[q]=null}),Zt(),n=u[t],n?n.p(l,$):(n=u[t]=f[t](l),n.c()),U(n,1),n.m(e,null)),(!r||$[0]&16)&&le(e,"data-testid",l[4]),(!r||$[0]&4096&&i!==(i=l[12]?"rtl":"ltr"))&&le(e,"dir",i),(!r||$[0]&48&&o!==(o=l[4]+"'s message: "+Hi(l[48])))&&le(e,"aria-label",o),s!==l[50]&&(m(),s=l[50],w()),(!r||$[0]&2097154)&&B(e,"latest",l[21]===l[1].length-1),(!r||$[0]&128)&&B(e,"message-markdown-disabled",!l[7]),(!r||$[0]&1024)&&B(e,"selectable",l[10]),$[0]&1024&&Je(e,"cursor",l[10]?"pointer":"auto"),$[0]&4096&&Je(e,"text-align",l[12]?"right":"left")},i(d){r||(U(n),r=!0)},o(d){X(n),r=!1},d(d){d&&Ye(e),u[t].d(),m(),a=!1,Tr(_)}}}function Zr(l){let e,t,n;function i(){l[43].call(e,l[50])}return{c(){e=Vt("textarea"),le(e,"class","edit-textarea svelte-1csv61q"),e.autofocus=!0,Je(e,"width",`max(${l[30][l[50]]}px, 160px)`),Je(e,"min-height",`${l[31][l[50]]}px`)},m(o,s){Ke(o,e,s),$i(e,l[0][l[50]]),e.focus(),t||(n=tl(e,"input",i),t=!0)},p(o,s){l=o,s[0]&1&&$i(e,l[0][l[50]]),s[0]&1073741824&&Je(e,"width",`max(${l[30][l[50]]}px, 160px)`),s[1]&1&&Je(e,"min-height",`${l[31][l[50]]}px`)},i:pi,o:pi,d(o){o&&Ye(e),t=!1,n()}}}function Ur(l){let e,t;return e=new uo({props:{message:l[48],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[50],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(){xt(e.$$.fragment)},m(n,i){tn(e,n,i),t=!0},p(n,i){const o={};i[0]&32&&(o.message=n[48]),i[0]&512&&(o.sanitize_html=n[9]),i[0]&134217728&&(o.allow_tags=n[27]),i[0]&256&&(o.latex_delimiters=n[8]),i[0]&128&&(o.render_markdown=n[7]),i[0]&1048576&&(o._components=n[20]),i[0]&65536&&(o.upload=n[16]),i[0]&131072&&(o.target=n[17]),i[0]&262144&&(o.root=n[18]),i[0]&524288&&(o.theme_mode=n[19]),i[0]&2048&&(o._fetch=n[11]),i[0]&4194304&&(o.scroll=n[22]),i[0]&8388608&&(o.allow_file_downloads=n[23]),i[0]&33554432&&(o.display_consecutive_in_same_bubble=n[25]),i[0]&16384&&(o.i18n=n[14]),i[0]&32768&&(o.line_breaks=n[15]),e.$set(o)},i(n){t||(U(e.$$.fragment,n),t=!0)},o(n){X(e.$$.fragment,n),t=!1},d(n){en(e,n)}}}function Wr(l){let e,t;return e=new co({props:{thought:l[48],rtl:l[12],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[50],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(){xt(e.$$.fragment)},m(n,i){tn(e,n,i),t=!0},p(n,i){const o={};i[0]&32&&(o.thought=n[48]),i[0]&4096&&(o.rtl=n[12]),i[0]&512&&(o.sanitize_html=n[9]),i[0]&134217728&&(o.allow_tags=n[27]),i[0]&256&&(o.latex_delimiters=n[8]),i[0]&128&&(o.render_markdown=n[7]),i[0]&1048576&&(o._components=n[20]),i[0]&65536&&(o.upload=n[16]),i[0]&131072&&(o.target=n[17]),i[0]&262144&&(o.root=n[18]),i[0]&524288&&(o.theme_mode=n[19]),i[0]&2048&&(o._fetch=n[11]),i[0]&4194304&&(o.scroll=n[22]),i[0]&8388608&&(o.allow_file_downloads=n[23]),i[0]&33554432&&(o.display_consecutive_in_same_bubble=n[25]),i[0]&16384&&(o.i18n=n[14]),i[0]&32768&&(o.line_breaks=n[15]),e.$set(o)},i(n){t||(U(e.$$.fragment,n),t=!0)},o(n){X(e.$$.fragment,n),t=!1},d(n){en(e,n)}}}function zi(l){let e,t;const n=[l[32],{current_feedback:l[26]},{watermark:l[28]},{i18n:l[14]}];let i={};for(let o=0;o<n.length;o+=1)i=mo(i,n[o]);return e=new _o({props:i}),e.$on("copy",l[47]),{c(){xt(e.$$.fragment)},m(o,s){tn(e,o,s),t=!0},p(o,s){const r=s[0]&335560704|s[1]&2?bo(n,[s[1]&2&&go(o[32]),s[0]&67108864&&{current_feedback:o[26]},s[0]&268435456&&{watermark:o[28]},s[0]&16384&&{i18n:o[14]}]):{};e.$set(r)},i(o){t||(U(e.$$.fragment,o),t=!0)},o(o){X(e.$$.fragment,o),t=!1},d(o){en(e,o)}}}function qi(l){let e,t,n,i,o,s,r;const a=[Zr,Fr],_=[];function f(c,w){return c[24]&&c[48].type==="text"?0:1}t=f(l),n=_[t]=a[t](l);let u=l[6]==="panel"&&zi(l);return{c(){e=Vt("div"),n.c(),o=nl(),u&&u.c(),s=ho(),le(e,"class",i="message "+(l[25]?"":l[4])+" svelte-1csv61q"),B(e,"panel-full-width",!0),B(e,"message-markdown-disabled",!l[7]),B(e,"component",l[48].type==="component"),B(e,"html",zl(l[48])&&l[48].content.component==="html"),B(e,"thought",l[50]>0)},m(c,w){Ke(c,e,w),_[t].m(e,null),Ke(c,o,w),u&&u.m(c,w),Ke(c,s,w),r=!0},p(c,w){let m=t;t=f(c),t===m?_[t].p(c,w):(Ut(),X(_[m],1,1,()=>{_[m]=null}),Zt(),n=_[t],n?n.p(c,w):(n=_[t]=a[t](c),n.c()),U(n,1),n.m(e,null)),(!r||w[0]&33554448&&i!==(i="message "+(c[25]?"":c[4])+" svelte-1csv61q"))&&le(e,"class",i),(!r||w[0]&33554448)&&B(e,"panel-full-width",!0),(!r||w[0]&33554576)&&B(e,"message-markdown-disabled",!c[7]),(!r||w[0]&33554480)&&B(e,"component",c[48].type==="component"),(!r||w[0]&33554480)&&B(e,"html",zl(c[48])&&c[48].content.component==="html"),(!r||w[0]&33554448)&&B(e,"thought",c[50]>0),c[6]==="panel"?u?(u.p(c,w),w[0]&64&&U(u,1)):(u=zi(c),u.c(),U(u,1),u.m(s.parentNode,s)):u&&(Ut(),X(u,1,1,()=>{u=null}),Zt())},i(c){r||(U(n),U(u),r=!0)},o(c){X(n),X(u),r=!1},d(c){c&&(Ye(e),Ye(o),Ye(s)),_[t].d(),u&&u.d(c)}}}function Si(l){let e,t;const n=[l[32],{i18n:l[14]}];let i={};for(let o=0;o<n.length;o+=1)i=mo(i,n[o]);return e=new _o({props:i}),{c(){xt(e.$$.fragment)},m(o,s){tn(e,o,s),t=!0},p(o,s){const r=s[0]&16384|s[1]&2?bo(n,[s[1]&2&&go(o[32]),s[0]&16384&&{i18n:o[14]}]):{};e.$set(r)},i(o){t||(U(e.$$.fragment,o),t=!0)},o(o){X(e.$$.fragment,o),t=!1},d(o){en(e,o)}}}function Pr(l){let e,t,n,i,o,s,r,a,_,f=l[2]!==null&&yi(l),u=ki(l[5]),c=[];for(let h=0;h<u.length;h+=1)c[h]=qi(Ci(l,u,h));const w=h=>X(c[h],1,1,()=>{c[h]=null});let m=l[6]==="bubble"&&Si(l);return{c(){e=Vt("div"),f&&f.c(),t=nl(),n=Vt("div"),i=Vt("div");for(let h=0;h<c.length;h+=1)c[h].c();r=nl(),m&&m.c(),a=ho(),le(i,"class",o=vi(l[25]?l[4]:"")+" svelte-1csv61q"),B(i,"message",l[25]),le(n,"class","flex-wrap svelte-1csv61q"),B(n,"role",l[4]),B(n,"component-wrap",l[5][0].type==="component"),le(e,"class",s="message-row "+l[6]+" "+l[4]+"-row svelte-1csv61q"),B(e,"with_avatar",l[2]!==null),B(e,"with_opposite_avatar",l[3]!==null)},m(h,k){Ke(h,e,k),f&&f.m(e,null),Jn(e,t),Jn(e,n),Jn(n,i);for(let d=0;d<c.length;d+=1)c[d]&&c[d].m(i,null);Ke(h,r,k),m&&m.m(h,k),Ke(h,a,k),_=!0},p(h,k){if(h[2]!==null?f?(f.p(h,k),k[0]&4&&U(f,1)):(f=yi(h),f.c(),U(f,1),f.m(e,t)):f&&(Ut(),X(f,1,1,()=>{f=null}),Zt()),k[0]&2147483635|k[1]&7){u=ki(h[5]);let d;for(d=0;d<u.length;d+=1){const $=Ci(h,u,d);c[d]?(c[d].p($,k),U(c[d],1)):(c[d]=qi($),c[d].c(),U(c[d],1),c[d].m(i,null))}for(Ut(),d=u.length;d<c.length;d+=1)w(d);Zt()}(!_||k[0]&33554448&&o!==(o=vi(h[25]?h[4]:"")+" svelte-1csv61q"))&&le(i,"class",o),(!_||k[0]&33554448)&&B(i,"message",h[25]),(!_||k[0]&16)&&B(n,"role",h[4]),(!_||k[0]&32)&&B(n,"component-wrap",h[5][0].type==="component"),(!_||k[0]&80&&s!==(s="message-row "+h[6]+" "+h[4]+"-row svelte-1csv61q"))&&le(e,"class",s),(!_||k[0]&84)&&B(e,"with_avatar",h[2]!==null),(!_||k[0]&88)&&B(e,"with_opposite_avatar",h[3]!==null),h[6]==="bubble"?m?(m.p(h,k),k[0]&64&&U(m,1)):(m=Si(h),m.c(),U(m,1),m.m(a.parentNode,a)):m&&(Ut(),X(m,1,1,()=>{m=null}),Zt())},i(h){if(!_){U(f);for(let k=0;k<u.length;k+=1)U(c[k]);U(m),_=!0}},o(h){X(f),c=c.filter(Boolean);for(let k=0;k<c.length;k+=1)X(c[k]);X(m),_=!1},d(h){h&&(Ye(e),Ye(r),Ye(a)),f&&f.d(),Br(c,h),m&&m.d(h)}}}let Or=!1;function Hi(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 Rr(l,e,t){let{value:n}=e,{avatar_img:i}=e,{opposite_avatar_img:o=null}=e,{role:s="user"}=e,{messages:r=[]}=e,{layout:a}=e,{render_markdown:_}=e,{latex_delimiters:f}=e,{sanitize_html:u}=e,{selectable:c}=e,{_fetch:w}=e,{rtl:m}=e,{dispatch:h}=e,{i18n:k}=e,{line_breaks:d}=e,{upload:$}=e,{target:q}=e,{root:I}=e,{theme_mode:C}=e,{_components:y}=e,{i:x}=e,{show_copy_button:T}=e,{generating:_e}=e,{feedback_options:fe}=e,{show_like:he}=e,{show_edit:S}=e,{show_retry:Ce}=e,{show_undo:de}=e,{msg_format:v}=e,{handle_action:Ee}=e,{scroll:lt}=e,{allow_file_downloads:it}=e,{in_edit_mode:ye}=e,{edit_messages:ze}=e,{display_consecutive_in_same_bubble:ot}=e,{current_feedback:Te=null}=e,{allow_tags:st=!1}=e,{watermark:Ae=null}=e,ge=[],Fe=Array(r.length).fill(160),Ze=Array(r.length).fill(0);function Ue(p,W){h("select",{index:W.index,value:W.content})}let at;function rt(p){ze[p]=this.value,t(0,ze)}function qe(p,W){Ir[p?"unshift":"push"](()=>{ge[W]=p,t(29,ge)})}const ee=p=>Ue(x,p),_t=(p,W)=>{W.key==="Enter"&&Ue(x,p)},te=p=>h("copy",p.detail);return l.$$set=p=>{"value"in p&&t(1,n=p.value),"avatar_img"in p&&t(2,i=p.avatar_img),"opposite_avatar_img"in p&&t(3,o=p.opposite_avatar_img),"role"in p&&t(4,s=p.role),"messages"in p&&t(5,r=p.messages),"layout"in p&&t(6,a=p.layout),"render_markdown"in p&&t(7,_=p.render_markdown),"latex_delimiters"in p&&t(8,f=p.latex_delimiters),"sanitize_html"in p&&t(9,u=p.sanitize_html),"selectable"in p&&t(10,c=p.selectable),"_fetch"in p&&t(11,w=p._fetch),"rtl"in p&&t(12,m=p.rtl),"dispatch"in p&&t(13,h=p.dispatch),"i18n"in p&&t(14,k=p.i18n),"line_breaks"in p&&t(15,d=p.line_breaks),"upload"in p&&t(16,$=p.upload),"target"in p&&t(17,q=p.target),"root"in p&&t(18,I=p.root),"theme_mode"in p&&t(19,C=p.theme_mode),"_components"in p&&t(20,y=p._components),"i"in p&&t(21,x=p.i),"show_copy_button"in p&&t(34,T=p.show_copy_button),"generating"in p&&t(35,_e=p.generating),"feedback_options"in p&&t(36,fe=p.feedback_options),"show_like"in p&&t(37,he=p.show_like),"show_edit"in p&&t(38,S=p.show_edit),"show_retry"in p&&t(39,Ce=p.show_retry),"show_undo"in p&&t(40,de=p.show_undo),"msg_format"in p&&t(41,v=p.msg_format),"handle_action"in p&&t(42,Ee=p.handle_action),"scroll"in p&&t(22,lt=p.scroll),"allow_file_downloads"in p&&t(23,it=p.allow_file_downloads),"in_edit_mode"in p&&t(24,ye=p.in_edit_mode),"edit_messages"in p&&t(0,ze=p.edit_messages),"display_consecutive_in_same_bubble"in p&&t(25,ot=p.display_consecutive_in_same_bubble),"current_feedback"in p&&t(26,Te=p.current_feedback),"allow_tags"in p&&t(27,st=p.allow_tags),"watermark"in p&&t(28,Ae=p.watermark)},l.$$.update=()=>{if(l.$$.dirty[0]&553648160&&ye&&!Or){const p=ge.length-r.length;for(let W=p;W<ge.length;W++)W>=0&&(t(30,Fe[W-p]=ge[W]?.clientWidth,Fe),t(31,Ze[W-p]=ge[W]?.clientHeight,Ze))}l.$$.dirty[0]&352329844|l.$$.dirty[1]&4088&&t(32,at={handle_action:Ee,likeable:he,feedback_options:fe,show_retry:Ce,show_undo:de,show_edit:S,in_edit_mode:ye,generating:_e,show_copy_button:T,message:v==="tuples"?r[0]:r,position:s==="user"?"right":"left",avatar:i,layout:a,dispatch:h,current_feedback:Te,watermark:Ae})},[ze,n,i,o,s,r,a,_,f,u,c,w,m,h,k,d,$,q,I,C,y,x,lt,it,ye,ot,Te,st,Ae,ge,Fe,Ze,at,Ue,T,_e,fe,he,S,Ce,de,v,
9Ee,rt,qe,ee,_t,te]}class Jr extends Dr{constructor(e){super(),Er(this,e,Rr,Pr,Ar,{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:34,generating:35,feedback_options:36,show_like:37,show_edit:38,show_retry:39,show_undo:40,msg_format:41,handle_action:42,scroll:22,allow_file_downloads:23,in_edit_mode:24,edit_messages:0,display_consecutive_in_same_bubble:25,current_feedback:26,allow_tags:27,watermark:28},null,[-1,-1])}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),L()}get avatar_img(){return this.$$.ctx[2]}set avatar_img(e){this.$$set({avatar_img:e}),L()}get opposite_avatar_img(){return this.$$.ctx[3]}set opposite_avatar_img(e){this.$$set({opposite_avatar_img:e}),L()}get role(){return this.$$.ctx[4]}set role(e){this.$$set({role:e}),L()}get messages(){return this.$$.ctx[5]}set messages(e){this.$$set({messages:e}),L()}get layout(){return this.$$.ctx[6]}set layout(e){this.$$set({layout:e}),L()}get render_markdown(){return this.$$.ctx[7]}set render_markdown(e){this.$$set({render_markdown:e}),L()}get latex_delimiters(){return this.$$.ctx[8]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),L()}get sanitize_html(){return this.$$.ctx[9]}set sanitize_html(e){this.$$set({sanitize_html:e}),L()}get selectable(){return this.$$.ctx[10]}set selectable(e){this.$$set({selectable:e}),L()}get _fetch(){return this.$$.ctx[11]}set _fetch(e){this.$$set({_fetch:e}),L()}get rtl(){return this.$$.ctx[12]}set rtl(e){this.$$set({rtl:e}),L()}get dispatch(){return this.$$.ctx[13]}set dispatch(e){this.$$set({dispatch:e}),L()}get i18n(){return this.$$.ctx[14]}set i18n(e){this.$$set({i18n:e}),L()}get line_breaks(){return this.$$.ctx[15]}set line_breaks(e){this.$$set({line_breaks:e}),L()}get upload(){return this.$$.ctx[16]}set upload(e){this.$$set({upload:e}),L()}get target(){return this.$$.ctx[17]}set target(e){this.$$set({target:e}),L()}get root(){return this.$$.ctx[18]}set root(e){this.$$set({root:e}),L()}get theme_mode(){return this.$$.ctx[19]}set theme_mode(e){this.$$set({theme_mode:e}),L()}get _components(){return this.$$.ctx[20]}set _components(e){this.$$set({_components:e}),L()}get i(){return this.$$.ctx[21]}set i(e){this.$$set({i:e}),L()}get show_copy_button(){return this.$$.ctx[34]}set show_copy_button(e){this.$$set({show_copy_button:e}),L()}
vendor: 48,797 bytes, lines 9-14
9get generating(){return this.$$.ctx[35]}set generating(e){this.$$set({generating:e}),L()}get feedback_options(){return this.$$.ctx[36]}set feedback_options(e){this.$$set({feedback_options:e}),L()}get show_like(){return this.$$.ctx[37]}set show_like(e){this.$$set({show_like:e}),L()}get show_edit(){return this.$$.ctx[38]}set show_edit(e){this.$$set({show_edit:e}),L()}get show_retry(){return this.$$.ctx[39]}set show_retry(e){this.$$set({show_retry:e}),L()}get show_undo(){return this.$$.ctx[40]}set show_undo(e){this.$$set({show_undo:e}),L()}get msg_format(){return this.$$.ctx[41]}set msg_format(e){this.$$set({msg_format:e}),L()}get handle_action(){return this.$$.ctx[42]}set handle_action(e){this.$$set({handle_action:e}),L()}get scroll(){return this.$$.ctx[22]}set scroll(e){this.$$set({scroll:e}),L()}get allow_file_downloads(){return this.$$.ctx[23]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),L()}get in_edit_mode(){return this.$$.ctx[24]}set in_edit_mode(e){this.$$set({in_edit_mode:e}),L()}get edit_messages(){return this.$$.ctx[0]}set edit_messages(e){this.$$set({edit_messages:e}),L()}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}),L()}get current_feedback(){return this.$$.ctx[26]}set current_feedback(e){this.$$set({current_feedback:e}),L()}get allow_tags(){return this.$$.ctx[27]}set allow_tags(e){this.$$set({allow_tags:e}),L()}get watermark(){return this.$$.ctx[28]}set watermark(e){this.$$set({watermark:e}),L()}}const{SvelteComponent:Gr,append:Gn,attr:ut,check_outros:Yr,create_component:Kr,destroy_component:Qr,detach:wo,element:fn,flush:Li,group_outros:Xr,init:xr,insert:ko,mount_component:e_,safe_not_equal:t_,space:n_,toggle_class:rn,transition_in:un,transition_out:ll}=window.__gradio__svelte__internal;function Mi(l){let e,t,n;return t=new Xt({props:{class:"avatar-image",src:l[1][1].url,alt:"bot avatar"}}),{c(){e=fn("div"),Kr(t.$$.fragment),ut(e,"class","avatar-container svelte-134ihlx")},m(i,o){ko(i,e,o),e_(t,e,null),n=!0},p(i,o){const s={};o&2&&(s.src=i[1][1].url),t.$set(s)},i(i){n||(un(t.$$.fragment,i),n=!0)},o(i){ll(t.$$.fragment,i),n=!1},d(i){i&&wo(e),Qr(t)}}}function l_(l){let e,t,n,i,o,s,r=l[1][1]!==null&&Mi(l);return{c(){e=fn("div"),r&&r.c(),t=n_(),n=fn("div"),i=fn("div"),i.innerHTML='<span class="sr-only">Loading content</span> <div class="dots svelte-134ihlx"><div class="dot svelte-134ihlx"></div> <div class="dot svelte-134ihlx"></div> <div class="dot svelte-134ihlx"></div></div>',ut(i,"class","message-content svelte-134ihlx"),ut(n,"class",o="message bot pending "+l[0]+" svelte-134ihlx"),ut(n,"role","status"),ut(n,"aria-label","Loading response"),ut(n,"aria-live","polite"),rn(n,"with_avatar",l[1][1]!==null),rn(n,"with_opposite_avatar",l[1][0]!==null),ut(e,"class","container svelte-134ihlx")},m(a,_){ko(a,e,_),r&&r.m(e,null),Gn(e,t),Gn(e,n),Gn(n,i),s=!0},p(a,[_]){a[1][1]!==null?r?(r.p(a,_),_&2&&un(r,1)):(r=Mi(a),r.c(),un(r,1),r.m(e,t)):r&&(Xr(),ll(r,1,1,()=>{r=null}),Yr()),(!s||_&1&&o!==(o="message bot pending "+a[0]+" svelte-134ihlx"))&&ut(n,"class",o),(!s||_&3)&&rn(n,"with_avatar",a[1][1]!==null),(!s||_&3)&&rn(n,"with_opposite_avatar",a[1][0]!==null)},i(a){s||(un(r),s=!0)},o(a){ll(r),s=!1},d(a){a&&wo(e),r&&r.d()}}}function i_(l,e,t){let{layout:n="bubble"}=e,{avatar_images:i=[null,null]}=e;return l.$$set=o=>{"layout"in o&&t(0,n=o.layout),"avatar_images"in o&&t(1,i=o.avatar_images)},[n,i]}class po extends Gr{constructor(e){super(),xr(this,e,i_,l_,t_,{layout:0,avatar_images:1})}get layout(){return this.$$.ctx[0]}set layout(e){this.$$set({layout:e}),Li()}get avatar_images(){return this.$$.ctx[1]}set avatar_images(e){this.$$set({avatar_images:e}),Li()}}const{SvelteComponent:o_,append:P,attr:z,check_outros:kt,create_component:$t,destroy_component:Ct,destroy_each:vo,detach:O,element:F,empty:$o,ensure_array_like:wn,flush:_n,group_outros:pt,init:s_,insert:R,listen:a_,mount_component:yt,noop:Dt,safe_not_equal:r_,set_data:Cn,space:Ot,src_url_equal:kn,text:It,transition_in:V,transition_out:A}=window.__gradio__svelte__internal,{createEventDispatcher:__}=window.__gradio__svelte__internal;function Ni(l,e,t){const n=l.slice();return n[7]=e[t],n[9]=t,n}function ji(l,e,t){const n=l.slice();return n[10]=e[t],n[9]=t,n}function Vi(l){let e,t,n;return t=new sl({props:{message:l[1],latex_delimiters:l[2],root:l[3]}}),{c(){e=F("div"),$t(t.$$.fragment),z(e,"class","placeholder svelte-9pi8y1")},m(i,o){R(i,e,o),yt(t,e,null),n=!0},p(i,o){const s={};o&2&&(s.message=i[1]),o&4&&(s.latex_delimiters=i[2]),o&8&&(s.root=i[3]),t.$set(s)},i(i){n||(V(t.$$.fragment,i),n=!0)},o(i){A(t.$$.fragment,i),n=!1},d(i){i&&O(e),Ct(t)}}}function Di(l){let e,t,n=wn(l[0]),i=[];for(let s=0;s<n.length;s+=1)i[s]=Ai(Ni(l,n,s));const o=s=>A(i[s],1,1,()=>{i[s]=null});return{c(){e=F("div");for(let s=0;s<i.length;s+=1)i[s].c();z(e,"class","examples svelte-9pi8y1"),z(e,"role","list")},m(s,r){R(s,e,r);for(let a=0;a<i.length;a+=1)i[a]&&i[a].m(e,null);t=!0},p(s,r){if(r&17){n=wn(s[0]);let a;for(a=0;a<n.length;a+=1){const _=Ni(s,n,a);i[a]?(i[a].p(_,r),V(i[a],1)):(i[a]=Ai(_),i[a].c(),V(i[a],1),i[a].m(e,null))}for(pt(),a=n.length;a<i.length;a+=1)o(a);kt()}},i(s){if(!t){for(let r=0;r<n.length;r+=1)V(i[r]);t=!0}},o(s){i=i.filter(Boolean);for(let r=0;r<i.length;r+=1)A(i[r]);t=!1},d(s){s&&O(e),vo(i,s)}}}function f_(l){let e,t,n,i,o,s,r;const a=[b_,g_,d_,h_,m_],_=[];function f(u,c){return c&1&&(e=null),c&1&&(t=null),c&1&&(n=null),u[7].files.length>1?0:(e==null&&(e=!!u[7].files[0].mime_type?.includes("image")),e?1:(t==null&&(t=!!u[7].files[0].mime_type?.includes("video")),t?2:(n==null&&(n=!!u[7].files[0].mime_type?.includes("audio")),n?3:4)))}return i=f(l,-1),o=_[i]=a[i](l),{c(){o.c(),s=$o()},m(u,c){_[i].m(u,c),R(u,s,c),r=!0},p(u,c){let w=i;i=f(u,c),i===w?_[i].p(u,c):(pt(),A(_[w],1,1,()=>{_[w]=null}),kt(),o=_[i],o?o.p(u,c):(o=_[i]=a[i](u),o.c()),V(o,1),o.m(s.parentNode,s))},i(u){r||(V(o),r=!0)},o(u){A(o),r=!1},d(u){u&&O(s),_[i].d(u)}}}function u_(l){let e;return{c(){e=F("div"),e.innerHTML='<span class="text-icon-aa svelte-9pi8y1">Aa</span>',z(e,"class","example-icon svelte-9pi8y1"),z(e,"aria-hidden","true")},m(t,n){R(t,e,n)},p:Dt,i:Dt,o:Dt,d(t){t&&O(e)}}}function c_(l){let e,t,n;return t=new Xt({props:{class:"example-image",src:l[7].icon.url,alt:"Example icon"}}),{c(){e=F("div"),$t(t.$$.fragment),z(e,"class","example-image-container svelte-9pi8y1")},m(i,o){R(i,e,o),yt(t,e,null),n=!0},p(i,o){const s={};o&1&&(s.src=i[7].icon.url),t.$set(s)},i(i){n||(V(t.$$.fragment,i),n=!0)},o(i){A(t.$$.fragment,i),n=!1},d(i){i&&O(e),Ct(t)}}}function m_(l){let e,t,n,i;return t=new ol({}),{c(){e=F("div"),$t(t.$$.fragment),z(e,"class","example-icon svelte-9pi8y1"),z(e,"aria-label",n=`File: ${l[7].files[0].orig_name}`)},m(o,s){R(o,e,s),yt(t,e,null),i=!0},p(o,s){(!i||s&1&&n!==(n=`File: ${o[7].files[0].orig_name}`))&&z(e,"aria-label",n)},i(o){i||(V(t.$$.fragment,o),i=!0)},o(o){A(t.$$.fragment,o),i=!1},d(o){o&&O(e),Ct(t)}}}function h_(l){let e,t,n,i;return t=new oo({}),{c(){e=F("div"),$t(t.$$.fragment),z(e,"class","example-icon svelte-9pi8y1"),z(e,"aria-label",n=`File: ${l[7].files[0].orig_name}`)},m(o,s){R(o,e,s),yt(t,e,null),i=!0},p(o,s){(!i||s&1&&n!==(n=`File: ${o[7].files[0].orig_name}`))&&z(e,"aria-label",n)},i(o){i||(V(t.$$.fragment,o),i=!0)},o(o){A(t.$$.fragment,o),i=!1},d(o){o&&O(e),Ct(t)}}}function d_(l){let e,t,n;return{c(){e=F("div"),t=F("video"),z(t,"class","example-image"),kn(t.src,n=l[7].files[0].url)||z(t,"src",n),z(t,"aria-hidden","true"),z(e,"class","example-image-container svelte-9pi8y1")},m(i,o){R(i,e,o),P(e,t)},p(i,o){o&1&&!kn(t.src,n=i[7].files[0].url)&&z(t,"src",n)},i:Dt,o:Dt,d(i){i&&O(e)}}}function g_(l){let e,t,n;return t=new Xt({props:{class:"example-image",src:l[7].files[0].url,alt:l[7].files[0].orig_name||"Example image"}}),{c(){e=F("div"),$t(t.$$.fragment),z(e,"class","example-image-container svelte-9pi8y1")},m(i,o){R(i,e,o),yt(t,e,null),n=!0},p(i,o){const s={};o&1&&(s.src=i[7].files[0].url),o&1&&(s.alt=i[7].files[0].orig_name||"Example image"),t.$set(s)},i(i){n||(V(t.$$.fragment,i),n=!0)},o(i){A(t.$$.fragment,i),n=!1},d(i){i&&O(e),Ct(t)}}}function b_(l){let e,t,n,i=wn(l[7].files.slice(0,4)),o=[];for(let a=0;a<i.length;a+=1)o[a]=Ei(ji(l,i,a));const s=a=>A(o[a],1,1,()=>{o[a]=null});let r=l[7].files.length>4&&Ti(l);return{c(){e=F("div");for(let a=0;a<o.length;a+=1)o[a].c();t=Ot(),r&&r.c(),z(e,"class","example-icons-grid svelte-9pi8y1"),z(e,"role","group"),z(e,"aria-label","Example attachments")},m(a,_){R(a,e,_);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(e,null);P(e,t),r&&r.m(e,null),n=!0},p(a,_){if(_&1){i=wn(a[7].files.slice(0,4));let f;for(f=0;f<i.length;f+=1){const u=ji(a,i,f);o[f]?(o[f].p(u,_),V(o[f],1)):(o[f]=Ei(u),o[f].c(),V(o[f],1),o[f].m(e,t))}for(pt(),f=i.length;f<o.length;f+=1)s(f);kt()}a[7].files.length>4?r?r.p(a,_):(r=Ti(a),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i(a){if(!n){for(let _=0;_<i.length;_+=1)V(o[_]);n=!0}},o(a){o=o.filter(Boolean);for(let _=0;_<o.length;_+=1)A(o[_]);n=!1},d(a){a&&O(e),vo(o,a),r&&r.d()}}}function w_(l){let e,t,n,i,o,s;const r=[$_,v_],a=[];function _(f,u){return u&1&&(t=null),t==null&&(t=!!f[10].mime_type?.includes("audio")),t?0:1}return n=_(l,-1),i=a[n]=r[n](l),{c(){e=F("div"),i.c(),z(e,"class","example-icon svelte-9pi8y1"),z(e,"aria-label",o=`File: ${l[10].orig_name}`)},m(f,u){R(f,e,u),a[n].m(e,null),s=!0},p(f,u){let c=n;n=_(f,u),n!==c&&(pt(),A(a[c],1,1,()=>{a[c]=null}),kt(),i=a[n],i||(i=a[n]=r[n](f),i.c()),V(i,1),i.m(e,null)),(!s||u&1&&o!==(o=`File: ${f[10].orig_name}`))&&z(e,"aria-label",o)},i(f){s||(V(i),s=!0)},o(f){A(i),s=!1},d(f){f&&O(e),a[n].d()}}}function k_(l){let e,t,n,i,o=l[9]===3&&l[7].files.length>4&&Ii(l);return{c(){e=F("div"),t=F("video"),i=Ot(),o&&o.c(),z(t,"class","example-image"),kn(t.src,n=l[10].url)||z(t,"src",n),z(t,"aria-hidden","true"),z(e,"class","example-image-container svelte-9pi8y1")},m(s,r){R(s,e,r),P(e,t),P(e,i),o&&o.m(e,null)},p(s,r){r&1&&!kn(t.src,n=s[10].url)&&z(t,"src",n),s[9]===3&&s[7].files.length>4?o?o.p(s,r):(o=Ii(s),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},i:Dt,o:Dt,d(s){s&&O(e),o&&o.d()}}}function p_(l){let e,t,n,i;t=new Xt({props:{class:"example-image",src:l[10].url,alt:l[10].orig_name||`Example image ${l[9]+1}`}});let o=l[9]===3&&l[7].files.length>4&&Bi(l);return{c(){e=F("div"),$t(t.$$.fragment),n=Ot(),o&&o.c(),z(e,"class","example-image-container svelte-9pi8y1")},m(s,r){R(s,e,r),yt(t,e,null),P(e,n),o&&o.m(e,null),i=!0},p(s,r){const a={};r&1&&(a.src=s[10].url),r&1&&(a.alt=s[10].orig_name||`Example image ${s[9]+1}`),t.$set(a),s[9]===3&&s[7].files.length>4?o?o.p(s,r):(o=Bi(s),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},i(s){i||(V(t.$$.fragment,s),i=!0)},o(s){A(t.$$.fragment,s),i=!1},d(s){s&&O(e),Ct(t),o&&o.d()}}}function v_(l){let e,t;return e=new ol({}),{c(){$t(e.$$.fragment)},m(n,i){yt(e,n,i),t=!0},i(n){t||(V(e.$$.fragment,n),t=!0)},o(n){A(e.$$.fragment,n),t=!1},d(n){Ct(e,n)}}}function $_(l){let e,t;return e=new oo({}),{c(){$t(e.$$.fragment)},m(n,i){yt(e,n,i),t=!0},i(n){t||(V(e.$$.fragment,n),t=!0)},o(n){A(e.$$.fragment,n),t=!1},d(n){Ct(e,n)}}}function Ii(l){let e,t,n=l[7].files.length-4+"",i,o;return{c(){e=F("div"),t=It("+"),i=It(n),z(e,"class","image-overlay svelte-9pi8y1"),z(e,"role","status"),z(e,"aria-label",o=`${l[7].files.length-4} more files`)},m(s,r){R(s,e,r),P(e,t),P(e,i)},p(s,r){r&1&&n!==(n=s[7].files.length-4+"")&&Cn(i,n),r&1&&o!==(o=`${s[7].files.length-4} more files`)&&z(e,"aria-label",o)},d(s){s&&O(e)}}}function Bi(l){let e,t,n=l[7].files.length-4+"",i,o;return{c(){e=F("div"),t=It("+"),i=It(n),z(e,"class","image-overlay svelte-9pi8y1"),z(e,"role","status"),z(e,"aria-label",o=`${l[7].files.length-4} more files`)},m(s,r){R(s,e,r),P(e,t),P(e,i)},p(s,r){r&1&&n!==(n=s[7].files.length-4+"")&&Cn(i,n),r&1&&o!==(o=`${s[7].files.length-4} more files`)&&z(e,"aria-label",o)},d(s){s&&O(e)}}}function Ei(l){let e,t,n,i,o,s;const r=[p_,k_,w_],a=[];function _(f,u){return u&1&&(e=null),u&1&&(t=null),e==null&&(e=!!f[10].mime_type?.includes("image")),e?0:(t==null&&(t=!!f[10].mime_type?.includes("video")),t?1:2)}return n=_(l,-1),i=a[n]=r[n](l),{c(){i.c(),o=$o()},m(f,u){a[n].m(f,u),R(f,o,u),s=!0},p(f,u){let c=n;n=_(f,u),n===c?a[n].p(f,u):(pt(),A(a[c],1,1,()=>{a[c]=null}),kt(),i=a[n],i?i.p(f,u):(i=a[n]=r[n](f),i.c()),V(i,1),i.m(o.parentNode,o))},i(f){s||(V(i),s=!0)},o(f){A(i),s=!1},d(f){f&&O(o),a[n].d(f)}}}function Ti(l){let e,t,n,i=l[7].files.length-4+"",o,s;return{c(){e=F("div"),t=F("div"),n=It("+"),o=It(i),z(t,"class","file-overlay svelte-9pi8y1"),z(t,"role","status"),z(t,"aria-label",s=`${l[7].files.length-4} more files`),z(e,"class","example-icon svelte-9pi8y1")},m(r,a){R(r,e,a),P(e,t),P(t,n),P(t,o)},p(r,a){a&1&&i!==(i=r[7].files.length-4+"")&&Cn(o,i),a&1&&s!==(s=`${r[7].files.length-4} more files`)&&z(t,"aria-label",s)},d(r){r&&O(e)}}}function Ai(l){let e,t,n,i,o,s,r,a=(l[7].display_text||l[7].text)+"",_,f,u,c,w,m;const h=[c_,u_,f_],k=[];function d(q,I){return q[7]?.icon?.url?0:q[7]?.icon?.mime_type==="text"?1:q[7].files!==void 0&&q[7].files.length>0?2:-1}~(n=d(l))&&(i=k[n]=h[n](l));function $(){return l[5](l[9],l[7])}return{c(){e=F("button"),t=F("div"),i&&i.c(),o=Ot(),s=F("div"),r=F("span"),_=It(a),f=Ot(),z(r,"class","example-text svelte-9pi8y1"),z(s,"class","example-text-content svelte-9pi8y1"),z(t,"class","example-content svelte-9pi8y1"),z(e,"class","example svelte-9pi8y1"),z(e,"aria-label",u=`Select example ${l[9]+1}: ${l[7].display_text||l[7].text}`)},m(q,I){R(q,e,I),P(e,t),~n&&k[n].m(t,null),P(t,o),P(t,s),P(s,r),P(r,_),P(e,f),c=!0,w||(m=a_(e,"click",$),w=!0)},p(q,I){l=q;let C=n;n=d(l),n===C?~n&&k[n].p(l,I):(i&&(pt(),A(k[C],1,1,()=>{k[C]=null}),kt()),~n?(i=k[n],i?i.p(l,I):(i=k[n]=h[n](l),i.c()),V(i,1),i.m(t,o)):i=null),(!c||I&1)&&a!==(a=(l[7].display_text||l[7].text)+"")&&Cn(_,a),(!c||I&1&&u!==(u=`Select example ${l[9]+1}: ${l[7].display_text||l[7].text}`))&&z(e,"aria-label",u)},i(q){c||(V(i),c=!0)},o(q){A(i),c=!1},d(q){q&&O(e),~n&&k[n].d(),w=!1,m()}}}function C_(l){let e,t,n,i=l[1]!==null&&Vi(l),o=l[0]!==null&&Di(l);return{c(){e=F("div"),i&&i.c(),t=Ot(),o&&o.c(),z(e,"class","placeholder-content svelte-9pi8y1"),z(e,"role","complementary")},m(s,r){R(s,e,r),i&&i.m(e,null),P(e,t),o&&o.m(e,null),n=!0},p(s,[r]){s[1]!==null?i?(i.p(s,r),r&2&&V(i,1)):(i=Vi(s),i.c(),V(i,1),i.m(e,t)):i&&(pt(),A(i,1,1,()=>{i=null}),kt()),s[0]!==null?o?(o.p(s,r),r&1&&V(o,1)):(o=Di(s),o.c(),V(o,1),o.m(e,null)):o&&(pt(),A(o,1,1,()=>{o=null}),kt())},i(s){n||(V(i),V(o),n=!0)},o(s){A(i),A(o),n=!1},d(s){s&&O(e),i&&i.d(),o&&o.d()}}}function y_(l,e,t){let{examples:n=null}=e,{placeholder:i=null}=e,{latex_delimiters:o}=e,{root:s}=e;const r=__();function a(f,u){const c=typeof u=="string"?{text:u}:u;r("example_select",{index:f,value:{text:c.text,files:c.files}})}const _=(f,u)=>a(f,typeof u=="string"?{text:u}:u);return l.$$set=f=>{"examples"in f&&t(0,n=f.examples),"placeholder"in f&&t(1,i=f.placeholder),"latex_delimiters"in f&&t(2,o=f.latex_delimiters),"root"in f&&t(3,s=f.root)},[n,i,o,s,a,_]}class z_ extends o_{constructor(e){super(),s_(this,e,y_,C_,r_,{examples:0,placeholder:1,latex_delimiters:2,root:3})}get examples(){return this.$$.ctx[0]}set examples(e){this.$$set({examples:e}),_n()}get placeholder(){return this.$$.ctx[1]}set placeholder(e){this.$$set({placeholder:e}),_n()}get latex_delimiters(){return this.$$.ctx[2]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),_n()}get root(){return this.$$.ctx[3]}set root(e){this.$$set({root:e}),_n()}}const{SvelteComponent:q_,create_component:S_,destroy_component:H_,flush:Fi,init:L_,mount_component:M_,safe_not_equal:N_,transition_in:j_,transition_out:V_}=window.__gradio__svelte__internal,{onDestroy:D_}=window.__gradio__svelte__internal;function I_(l){let e,t;return e=new ue({props:{Icon:l[0]?Yt:cn,label:l[0]?"Copied conversation":"Copy conversation"}}),e.$on("click",l[1]),{c(){S_(e.$$.fragment)},m(n,i){M_(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.Icon=n[0]?Yt:cn),i&1&&(o.label=n[0]?"Copied conversation":"Copy conversation"),e.$set(o)},i(n){t||(j_(e.$$.fragment,n),t=!0)},o(n){V_(e.$$.fragment,n),t=!1},d(n){H_(e,n)}}}function B_(l,e,t){let n=!1,{value:i}=e,{watermark:o=null}=e,s;function r(){t(0,n=!0),s&&clearTimeout(s),s=setTimeout(()=>{t(0,n=!1)},1e3)}const a=()=>{if(i){const f=i.map(c=>c.type==="text"?`${c.role}: ${c.content}`:`${c.role}: ${c.content.value.url}`).join(` 10 11`),u=o?`${f} 12 13${o}`:f;navigator.clipboard.writeText(u).catch(c=>{console.error("Failed to copy conversation: ",c)})}};async function _(){"clipboard"in navigator&&(a(),r())}return D_(()=>{s&&clearTimeout(s)}),l.$$set=f=>{"value"in f&&t(2,i=f.value),"watermark"in f&&t(3,o=f.watermark)},[n,_,i,o]}class E_ extends q_{constructor(e){super(),L_(this,e,B_,I_,N_,{value:2,watermark:3})}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),Fi()}get watermark(){return this.$$.ctx[3]}set watermark(e){this.$$set({watermark:e}),Fi()}}const{SvelteComponent:T_,action_destroyer:A_,add_flush_callback:F_,append:il,attr:Ge,bind:Z_,binding_callbacks:Co,check_outros:ht,create_component:et,destroy_component:tt,destroy_each:yo,detach:pe,element:nn,empty:kl,ensure_array_like:pn,flush:M,group_outros:dt,init:U_,insert:ve,listen:W_,mount_component:nt,noop:vn,null_to_empty:Zi,safe_not_equal:P_,set_data:O_,space:Bt,text:R_,transition_in:N,transition_out:E}=window.__gradio__svelte__internal,{createEventDispatcher:J_,tick:G_,onMount:Yn}=window.__gradio__svelte__internal;function Ui(l,e,t){const n=l.slice();return n[62]=e[t],n[64]=t,n}function Wi(l,e,t){const n=l.slice();n[65]=e[t],n[72]=t;const i=n[65][0].role==="user"?"user":"bot";n[66]=i;const o=n[16][n[66]==="user"?0:1];n[67]=o;const s=n[16][n[66]==="user"?0:1];n[68]=s;const r=n[40].slice(0,n[72]).filter(_=>_[0].role==="assistant").length;n[69]=r;const a=n[66]==="bot"&&n[10]&&n[10][n[69]]?n[10][n[69]]:null;return n[70]=a,n}function Pi(l){let e,t;return e=new io({props:{$$slots:{default:[Y_]},$$scope:{ctx:l}}}),{c(){et(e.$$.fragment)},m(n,i){nt(e,n,i),t=!0},p(n,i){const o={};i[0]&2109441|i[1]&2|i[2]&2048&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){t||(N(e.$$.fragment,n),t=!0)},o(n){E(e.$$.fragment,n),t=!1},d(n){tt(e,n)}}}function Oi(l){let e,t;return e=new ue({props:{Icon:Io}}),e.$on("click",l[49]),{c(){et(e.$$.fragment)},m(n,i){nt(e,n,i),t=!0},p:vn,i(n){t||(N(e.$$.fragment,n),t=!0)},o(n){E(e.$$.fragment,n),t=!1},d(n){tt(e,n)}}}function Ri(l){let e,t;return e=new E_({props:{value:l[0],watermark:l[32]}}),{c(){et(e.$$.fragment)},m(n,i){nt(e,n,i),t=!0},p(n,i){const o={};i[0]&1&&(o.value=n[0]),i[1]&2&&(o.watermark=n[32]),e.$set(o)},i(n){t||(N(e.$$.fragment,n),t=!0)},o(n){E(e.$$.fragment,n),t=!1},d(n){tt(e,n)}}}function Y_(l){let e,t,n,i,o,s=l[12]&&Oi(l);t=new ue({props:{Icon:Bo,label:l[21]("chatbot.clear")}}),t.$on("click",l[50]);let r=l[13]&&Ri(l);return{c(){s&&s.c(),e=Bt(),et(t.$$.fragment),n=Bt(),r&&r.c(),i=kl()},m(a,_){s&&s.m(a,_),ve(a,e,_),nt(t,a,_),ve(a,n,_),r&&r.m(a,_),ve(a,i,_),o=!0},p(a,_){a[12]?s?(s.p(a,_),_[0]&4096&&N(s,1)):(s=Oi(a),s.c(),N(s,1),s.m(e.parentNode,e)):s&&(dt(),E(s,1,1,()=>{s=null}),ht());const f={};_[0]&2097152&&(f.label=a[21]("chatbot.clear")),t.$set(f),a[13]?r?(r.p(a,_),_[0]&8192&&N(r,1)):(r=Ri(a),r.c(),N(r,1),r.m(i.parentNode,i)):r&&(dt(),E(r,1,1,()=>{r=null}),ht())},i(a){o||(N(s),N(t.$$.fragment,a),N(r),o=!0)},o(a){E(s),E(t.$$.fragment,a),E(r),o=!1},d(a){a&&(pe(e),pe(n),pe(i)),s&&s.d(a),tt(t,a),r&&r.d(a)}}}function K_(l){let e,t;return e=new z_({props:{examples:l[26],placeholder:l[23],latex_delimiters:l[4],root:l[30]}}),e.$on("example_select",l[55]),{c(){et(e.$$.fragment)},m(n,i){nt(e,n,i),t=!0},p(n,i){const o={};i[0]&67108864&&(o.examples=n[26]),i[0]&8388608&&(o.placeholder=n[23]),i[0]&16&&(o.latex_delimiters=n[4]),i[0]&1073741824&&(o.root=n[30]),e.$set(o)},i(n){t||(N(e.$$.fragment,n),t=!0)},o(n){E(e.$$.fragment,n),t=!1},d(n){tt(e,n)}}}function Q_(l){let e,t,n,i,o,s,r,a=pn(l[40]),_=[];for(let m=0;m<a.length;m+=1)_[m]=Gi(Wi(l,a,m));const f=m=>E(_[m],1,1,()=>{_[m]=null}),u=[x_,X_],c=[];function w(m,h){return m[33]!=="hidden"&&m[5]?0:m[41]?1:-1}return~(n=w(l))&&(i=c[n]=u[n](l)),{c(){e=nn("div");for(let m=0;m<_.length;m+=1)_[m].c();t=Bt(),i&&i.c(),Ge(e,"class","message-wrap svelte-gjtrl6")},m(m,h){ve(m,e,h);for(let k=0;k<_.length;k+=1)_[k]&&_[k].m(e,null);il(e,t),~n&&c[n].m(e,null),o=!0,s||(r=A_(Mo.call(null,e)),s=!0)},p(m,h){if(h[0]&2071973855|h[1]&23167){a=pn(m[40]);let d;for(d=0;d<a.length;d+=1){const $=Wi(m,a,d);_[d]?(_[d].p($,h),N(_[d],1)):(_[d]=Gi($),_[d].c(),N(_[d],1),_[d].m(e,t))}for(dt(),d=a.length;d<_.length;d+=1)f(d);ht()}let k=n;n=w(m),n===k?~n&&c[n].p(m,h):(i&&(dt(),E(c[k],1,1,()=>{c[k]=null}),ht()),~n?(i=c[n],i?i.p(m,h):(i=c[n]=u[n](m),i.c()),N(i,1),i.m(e,null)):i=null)},i(m){if(!o){for(let h=0;h<a.length;h+=1)N(_[h]);N(i),o=!0}},o(m){_=_.filter(Boolean);for(let h=0;h<_.length;h+=1)E(_[h]);E(i),o=!1},d(m){m&&pe(e),yo(_,m),~n&&c[n].d(),s=!1,r()}}}function Ji(l){let e,t;return e=new po({props:{layout:l[22],avatar_images:l[16]}}),{c(){et(e.$$.fragment)},m(n,i){nt(e,n,i),t=!0},p(n,i){const o={};i[0]&4194304&&(o.layout=n[22]),i[0]&65536&&(o.avatar_images=n[16]),e.$set(o)},i(n){t||(N(e.$$.fragment,n),t=!0)},o(n){E(e.$$.fragment,n),t=!1},d(n){tt(e,n)}}}function Gi(l){let e,t,n,i,o;function s(...f){return l[51](l[65],l[72],...f)}function r(f){l[52](f)}let a={messages:l[65],display_consecutive_in_same_bubble:l[3],opposite_avatar_img:l[68],avatar_img:l[67],role:l[66],layout:l[22],dispatch:l[43],i18n:l[21],_fetch:l[1],line_breaks:l[19],theme_mode:l[20],target:l[35],root:l[30],upload:l[24],selectable:l[7],sanitize_html:l[17],render_markdown:l[18],rtl:l[14],i:l[72],value:l[0],latex_delimiters:l[4],_components:l[34],generating:l[6],msg_format:l[25],feedback_options:l[9],current_feedback:l[70],allow_tags:l[31],watermark:l[32],show_like:l[66]==="user"?l[8]&&l[29]:l[8],show_retry:l[27]&&sn(l[65],l[0]),show_undo:l[28]&&sn(l[65],l[0]),show_edit:l[11]==="all"||l[11]=="user"&&l[66]==="user"&&l[65].length>0&&l[65][l[65].length-1].type=="text",in_edit_mode:l[36]===l[72],show_copy_button:l[15],handle_action:s,scroll:l[42]?scroll:tf,allow_file_downloads:l[2]};l[37]!==void 0&&(a.edit_messages=l[37]),e=new Jr({props:a}),Co.push(()=>Z_(e,"edit_messages",r)),e.$on("copy",l[53]);let _=l[33]!=="hidden"&&l[6]&&l[65][l[65].length-1].role==="assistant"&&l[65][l[65].length-1].metadata?.status==="done"&&Ji(l);return{c(){et(e.$$.fragment),n=Bt(),_&&_.c(),i=kl()},m(f,u){nt(e,f,u),ve(f,n,u),_&&_.m(f,u),ve(f,i,u),o=!0},p(f,u){l=f;const c={};u[1]&512&&(c.messages=l[65]),u[0]&8&&(c.display_consecutive_in_same_bubble=l[3]),u[0]&65536|u[1]&512&&(c.opposite_avatar_img=l[68]),u[0]&65536|u[1]&512&&(c.avatar_img=l[67]),u[1]&512&&(c.role=l[66]),u[0]&4194304&&(c.layout=l[22]),u[0]&2097152&&(c.i18n=l[21]),u[0]&2&&(c._fetch=l[1]),u[0]&524288&&(c.line_breaks=l[19]),u[0]&1048576&&(c.theme_mode=l[20]),u[1]&16&&(c.target=l[35]),u[0]&1073741824&&(c.root=l[30]),u[0]&16777216&&(c.upload=l[24]),u[0]&128&&(c.selectable=l[7]),u[0]&131072&&(c.sanitize_html=l[17]),u[0]&262144&&(c.render_markdown=l[18]),u[0]&16384&&(c.rtl=l[14]),u[0]&1&&(c.value=l[0]),u[0]&16&&(c.latex_delimiters=l[4]),u[1]&8&&(c._components=l[34]),u[0]&64&&(c.generating=l[6]),u[0]&33554432&&(c.msg_format=l[25]),u[0]&512&&(c.feedback_options=l[9]),u[0]&1024|u[1]&512&&(c.current_feedback=l[70]),u[1]&1&&(c.allow_tags=l[31]),u[1]&2&&(c.watermark=l[32]),u[0]&536871168|u[1]&512&&(c.show_like=l[66]==="user"?l[8]&&l[29]:l[8]),u[0]&134217729|u[1]&512&&(c.show_retry=l[27]&&sn(l[65],l[0])),u[0]&268435457|u[1]&512&&(c.show_undo=l[28]&&sn(l[65],l[0])),u[0]&2048|u[1]&512&&(c.show_edit=l[11]==="all"||l[11]=="user"&&l[66]==="user"&&l[65].length>0&&l[65][l[65].length-1].type=="text"),u[1]&32&&(c.in_edit_mode=l[36]===l[72]),u[0]&32768&&(c.show_copy_button=l[15]),u[1]&576&&(c.handle_action=s),u[0]&4&&(c.allow_file_downloads=l[2]),!t&&u[1]&64&&(t=!0,c.edit_messages=l[37],F_(()=>t=!1)),e.$set(c),l[33]!=="hidden"&&l[6]&&l[65][l[65].length-1].role==="assistant"&&l[65][l[65].length-1].metadata?.status==="done"?_?(_.p(l,u),u[0]&64|u[1]&516&&N(_,1)):(_=Ji(l),_.c(),N(_,1),_.m(i.parentNode,i)):_&&(dt(),E(_,1,1,()=>{_=null}),ht())},i(f){o||(N(e.$$.fragment,f),N(_),o=!0)},o(f){E(e.$$.fragment,f),E(_),o=!1},d(f){f&&(pe(n),pe(i)),tt(e,f),_&&_.d(f)}}}function X_(l){let e,t=pn(l[41]),n=[];for(let i=0;i<t.length;i+=1)n[i]=Yi(Ui(l,t,i));return{c(){e=nn("div");for(let i=0;i<n.length;i+=1)n[i].c();Ge(e,"class","options svelte-gjtrl6")},m(i,o){ve(i,e,o);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(e,null)},p(i,o){if(o[1]&5120){t=pn(i[41]);let s;for(s=0;s<t.length;s+=1){const r=Ui(i,t,s);n[s]?n[s].p(r,o):(n[s]=Yi(r),n[s].c(),n[s].m(e,null))}for(;s<n.length;s+=1)n[s].d(1);n.length=t.length}},i:vn,o:vn,d(i){i&&pe(e),yo(n,i)}}}function x_(l){let e,t;return e=new po({props:{layout:l[22],avatar_images:l[16]}}),{c(){et(e.$$.fragment)},m(n,i){nt(e,n,i),t=!0},p(n,i){const o={};i[0]&4194304&&(o.layout=n[22]),i[0]&65536&&(o.avatar_images=n[16]),e.$set(o)},i(n){t||(N(e.$$.fragment,n),t=!0)},o(n){E(e.$$.fragment,n),t=!1},d(n){tt(e,n)}}}function Yi(l){let e,t=(l[62].label||l[62].value)+"",n,i,o,s;function r(){return l[54](l[64],l[62])}return{c(){e=nn("button"),n=R_(t),i=Bt(),Ge(e,"class","option svelte-gjtrl6")},m(a,_){ve(a,e,_),il(e,n),il(e,i),o||(s=W_(e,"click",r),o=!0)},p(a,_){l=a,_[1]&1024&&t!==(t=(l[62].label||l[62].value)+"")&&O_(n,t)},d(a){a&&pe(e),o=!1,s()}}}function Ki(l){let e,t,n;return t=new ue({props:{Icon:hs,label:"Scroll down",size:"large"}}),t.$on("click",l[44]),{c(){e=nn("div"),et(t.$$.fragment),Ge(e,"class","scroll-down-button-container svelte-gjtrl6")},m(i,o){ve(i,e,o),nt(t,e,null),n=!0},p:vn,i(i){n||(N(t.$$.fragment,i),n=!0)},o(i){E(t.$$.fragment,i),n=!1},d(i){i&&pe(e),tt(t)}}}function ef(l){let e,t,n,i,o,s,r,a,_=l[0]!==null&&l[0].length>0&&Pi(l);const f=[Q_,K_],u=[];function c(m,h){return m[0]!==null&&m[0].length>0&&m[40]!==null?0:1}n=c(l),i=u[n]=f[n](l);let w=l[39]&&Ki(l);return{c(){_&&_.c(),e=Bt(),t=nn("div"),i.c(),s=Bt(),w&&w.c(),r=kl(),Ge(t,"class",o=Zi(l[22]==="bubble"?"bubble-wrap":"panel-wrap")+" svelte-gjtrl6"),Ge(t,"role","log"),Ge(t,"aria-label","chatbot conversation"),Ge(t,"aria-live","polite")},m(m,h){_&&_.m(m,h),ve(m,e,h),ve(m,t,h),u[n].m(t,null),l[56](t),ve(m,s,h),w&&w.m(m,h),ve(m,r,h),a=!0},p(m,h){m[0]!==null&&m[0].length>0?_?(_.p(m,h),h[0]&1&&N(_,1)):(_=Pi(m),_.c(),N(_,1),_.m(e.parentNode,e)):_&&(dt(),E(_,1,1,()=>{_=null}),ht());let k=n;n=c(m),n===k?u[n].p(m,h):(dt(),E(u[k],1,1,()=>{u[k]=null}),ht(),i=u[n],i?i.p(m,h):(i=u[n]=f[n](m),i.c()),N(i,1),i.m(t,null)),(!a||h[0]&4194304&&o!==(o=Zi(m[22]==="bubble"?"bubble-wrap":"panel-wrap")+" svelte-gjtrl6"))&&Ge(t,"class",o),m[39]?w?(w.p(m,h),h[1]&256&&N(w,1)):(w=Ki(m),w.c(),N(w,1),w.m(r.parentNode,r)):w&&(dt(),E(w,1,1,()=>{w=null}),ht())},i(m){a||(N(_),N(i),N(w),a=!0)},o(m){E(_),E(i),E(w),a=!1},d(m){m&&(pe(e),pe(t),pe(s),pe(r)),_&&_.d(m),u[n].d(),l[56](null),w&&w.d(m)}}}const tf=()=>{};function nf(l,e,t){let n,i,{value:o=[]}=e,s=null,{_fetch:r}=e,{load_component:a}=e,{allow_file_downloads:_}=e,{display_consecutive_in_same_bubble:f}=e,u={};const c=typeof window<"u";async function w(){t(34,u=await ps(vs(o),u,a))}let{latex_delimiters:m}=e,{pending_message:h=!1}=e,{generating:k=!1}=e,{selectable:d=!1}=e,{likeable:$=!1}=e,{feedback_options:q}=e,{feedback_value:I=null}=e,{editable:C=null}=e,{show_share_button:y=!1}=e,{show_copy_all_button:x=!1}=e,{rtl:T=!1}=e,{show_copy_button:_e=!1}=e,{avatar_images:fe=[null,null]}=e,{sanitize_html:he=!0}=e,{render_markdown:S=!0}=e,{line_breaks:Ce=!0}=e,{autoscroll:de=!0}=e,{theme_mode:v}=e,{i18n:Ee}=e,{layout:lt="bubble"}=e,{placeholder:it=null}=e,{upload:ye}=e,{msg_format:ze="tuples"}=e,{examples:ot=null}=e,{_retryable:Te=!1}=e,{_undoable:st=!1}=e,{like_user_message:Ae=!1}=e,{root:ge}=e,{allow_tags:Fe=!1}=e,{watermark:Ze=null}=e,{show_progress:Ue="full"}=e,at=null,rt=null,qe=[];Yn(()=>{t(35,at=document.querySelector("div.gradio-container"))});let ee,_t=!1;const te=J_();function p(){return ee&&ee.offsetHeight+ee.scrollTop>ee.scrollHeight-100}function W(){ee&&(ee.scrollTo(0,ee.scrollHeight),t(39,_t=!1))}async function ln(){de&&p()&&(await G_(),await new Promise(b=>setTimeout(b,300)),W())}Yn(()=>{de&&W(),ln()}),Yn(()=>{function b(){p()?t(39,_t=!1):t(39,_t=!0)}return ee?.addEventListener("scroll",b),()=>{ee?.removeEventListener("scroll",b)}});function Rt(b,$e,ne){if(ne==="undo"||ne==="retry"){const We=o;let Se=We.length-1;for(;We[Se].role==="assistant";)Se--;te(ne,{index:We[Se].index,value:We[Se].content})}else if(ne=="edit")t(36,rt=b),qe.push($e.content);else if(ne=="edit_cancel")t(36,rt=null);else if(ne=="edit_submit")t(36,rt=null),te("edit",{index:$e.index,value:qe[b].slice(),previous_value:$e.content});else{let We=ne==="Like"?!0:ne==="Dislike"?!1:ne||"";if(ze==="tuples")te("like",{index:$e.index,value:$e.content,liked:We});else{if(!n)return;const Se=n[b],[So,wf]=[Se[0],Se[Se.length-1]];te("like",{index:So.index,value:Se.map(Ho=>Ho.content),liked:We})}}}function Sn(){if(!o||!n||n.length===0)return;const b=n[n.length-1];if(b[0].role==="assistant")return b[b.length-1].options}const Hn=async()=>{try{const b=await ds(o);te("share",{description:b})}catch(b){console.error(b);let $e=b instanceof Lo?b.message:"Share failed.";te("error",$e)}},Ln=()=>te("clear"),Mn=(b,$e,ne)=>{ne=="edit"&&qe.splice(0,qe.length),ne==="edit"||ne==="edit_submit"?b.forEach((We,Se)=>{Rt(ne==="edit"?$e:Se,We,ne)}):Rt($e,b[0],ne)};function Nn(b){qe=b,t(37,qe)}const jn=b=>te("copy",b.detail),g=(b,$e)=>te("option_select",{index:b,value:$e.value}),zo=b=>te("example_select",b.detail);function qo(b){Co[b?"unshift":"push"](()=>{ee=b,t(38,ee)})}return l.$$set=b=>{"value"in b&&t(0,o=b.value),"_fetch"in b&&t(1,r=b._fetch),"load_component"in b&&t(46,a=b.load_component),"allow_file_downloads"in b&&t(2,_=b.allow_file_downloads),"display_consecutive_in_same_bubble"in b&&t(3,f=b.display_consecutive_in_same_bubble),"latex_delimiters"in b&&t(4,m=b.latex_delimiters),"pending_message"in b&&t(5,h=b.pending_message),"generating"in b&&t(6,k=b.generating),"selectable"in b&&t(7,d=b.selectable),"likeable"in b&&t(8,$=b.likeable),"feedback_options"in b&&t(9,q=b.feedback_options),"feedback_value"in b&&t(10,I=b.feedback_value),"editable"in b&&t(11,C=b.editable),"show_share_button"in b&&t(12,y=b.show_share_button),"show_copy_all_button"in b&&t(13,x=b.show_copy_all_button),"rtl"in b&&t(14,T=b.rtl),"show_copy_button"in b&&t(15,_e=b.show_copy_button),"avatar_images"in b&&t(16,fe=b.avatar_images),"sanitize_html"in b&&t(17,he=b.sanitize_html),"render_markdown"in b&&t(18,S=b.render_markdown),"line_breaks"in b&&t(19,Ce=b.line_breaks),"autoscroll"in b&&t(47,de=b.autoscroll),"theme_mode"in b&&t(20,v=b.theme_mode),"i18n"in b&&t(21,Ee=b.i18n),"layout"in b&&t(22,lt=b.layout),"placeholder"in b&&t(23,it=b.placeholder),"upload"in b&&t(24,ye=b.upload),"msg_format"in b&&t(25,ze=b.msg_format),"examples"in b&&t(26,ot=b.examples),"_retryable"in b&&t(27,Te=b._retryable),"_undoable"in b&&t(28,st=b._undoable),"like_user_message"in b&&t(29,Ae=b.like_user_message),"root"in b&&t(30,ge=b.root),"allow_tags"in b&&t(31,Fe=b.allow_tags),"watermark"in b&&t(32,Ze=b.watermark),"show_progress"in b&&t(33,Ue=b.show_progress)},l.$$.update=()=>{l.$$.dirty[0]&1&&w(),l.$$.dirty[0]&33|l.$$.dirty[1]&8&&(o||h||u)&&ln(),l.$$.dirty[0]&1|l.$$.dirty[1]&131072&&(Do(o,s)||(t(48,s=o),te("change"))),l.$$.dirty[0]&33554433&&t(40,n=o&&ks(o)),l.$$.dirty[0]&1&&t(41,i=o&&Sn())},[o,r,_,f,m,h,k,d,$,q,I,C,y,x,T,_e,fe,he,S,Ce,v,Ee,lt,it,ye,ze,ot,Te,st,Ae,ge,Fe,Ze,Ue,u,at,rt,qe,ee,_t,n,i,c,te,W,Rt,a,de,s,Hn,Ln,Mn,Nn,jn,g,zo,qo]}class lf extends T_{constructor(e){super(),U_(this,e,nf,ef,P_,{value:0,_fetch:1,load_component:46,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:47,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,watermark:32,show_progress:33},null,[-1,-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),M()}get _fetch(){return this.$$.ctx[1]}set _fetch(e){this.$$set({_fetch:e}),M()}get load_component(){return this.$$.ctx[46]}set load_component(e){this.$$set({load_component:e}),M()}get allow_file_downloads(){return this.$$.ctx[2]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),M()}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}),M()}get latex_delimiters(){return this.$$.ctx[4]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),M()}get pending_message(){return this.$$.ctx[5]}set pending_message(e){this.$$set({pending_message:e}),M()}get generating(){return this.$$.ctx[6]}set generating(e){this.$$set({generating:e}),M()}get selectable(){return this.$$.ctx[7]}set selectable(e){this.$$set({selectable:e}),M()}get likeable(){return this.$$.ctx[8]}set likeable(e){this.$$set({likeable:e}),M()}get feedback_options(){return this.$$.ctx[9]}set feedback_options(e){this.$$set({feedback_options:e}),M()}get feedback_value(){return this.$$.ctx[10]}set feedback_value(e){this.$$set({feedback_value:e}),M()}get editable(){return this.$$.ctx[11]}set editable(e){this.$$set({editable:e}),M()}get show_share_button(){return this.$$.ctx[12]}set show_share_button(e){this.$$set({show_share_button:e}),M()}get show_copy_all_button(){return this.$$.ctx[13]}set show_copy_all_button(e){this.$$set({show_copy_all_button:e}),M()}get rtl(){return this.$$.ctx[14]}set rtl(e){this.$$set({rtl:e}),M()}get show_copy_button(){return this.$$.ctx[15]}set show_copy_button(e){this.$$set({show_copy_button:e}),M()}get avatar_images(){return this.$$.ctx[16]}set avatar_images(e){this.$$set({avatar_images:e}),M()}get sanitize_html(){return this.$$.ctx[17]}set sanitize_html(e){this.$$set({sanitize_html:e}),M()}get render_markdown(){return this.$$.ctx[18]}set render_markdown(e){this.$$set({render_markdown:e}),M()}get line_breaks(){return this.$$.ctx[19]}set line_breaks(e){this.$$set({line_breaks:e}),M()}get autoscroll(){return this.$$.ctx[47]}set autoscroll(e){this.$$set({autoscroll:e}),M()}get theme_mode(){return this.$$.ctx[20]}set theme_mode(e){this.$$set({theme_mode:e}),M()}get i18n(){return this.$$.ctx[21]}set i18n(e){this.$$set({i18n:e}),M()}get layout(){return this.$$.ctx[22]}set layout(e){this.$$set({layout:e}),M()}get placeholder(){return this.$$.ctx[23]}set placeholder(e){this.$$set({placeholder:e}),M()}get upload(){return this.$$.ctx[24]}set upload(e){this.$$set({upload:e}),M()}get msg_format(){return this.$$.ctx[25]}set msg_format(e){this.$$set({msg_format:e}),M()}get examples(){return this.$$.ctx[26]}set examples(e){this.$$set({examples:e}),M()}get _retryable(){return this.$$.ctx[27]}set _retryable(e){this.$$set({_retryable:e}),M()}get _undoable(){return this.$$.ctx[28]}set _undoable(e){this.$$set({_undoable:e}),M()}get like_user_message(){return this.$$.ctx[29]}set like_user_message(e){this.$$set({like_user_message:e}),M()}get root(){return this.$$.ctx[30]}set root(e){this.$$set({root:e}),M()}get allow_tags(){return this.$$.ctx[31]}set allow_tags(e){this.$$set({allow_tags:e}),M()}get watermark(){return this.$$.ctx[32]}set watermark(e){this.$$set({watermark:e}),M()}get show_progress(){return this.$$.ctx[33]}set show_progress(e){this.$$set({show_progress:e}),M()}}const of=lf,{SvelteComponent:sf,append:af,assign:rf,attr:_f,check_outros:Qi,create_component:yn,destroy_component:zn,detach:Xi,element:ff,flush:H,get_spread_object:uf,get_spread_update:cf,group_outros:xi,init:mf,insert:eo,mount_component:qn,safe_not_equal:hf,space:to,transition_in:Ve,transition_out:mt}=window.__gradio__svelte__internal;function no(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 o=0;o<n.length;o+=1)i=rf(i,n[o]);return e=new Ao({props:i}),e.$on("clear_status",l[43]),{c(){yn(e.$$.fragment)},m(o,s){qn(e,o,s),t=!0},p(o,s){const r=s[0]&1207959552?cf(n,[s[0]&134217728&&{autoscroll:o[27].autoscroll},s[0]&134217728&&{i18n:o[27].i18n},s[0]&1073741824&&uf(o[30]),s[0]&1073741824&&{show_progress:o[30].show_progress==="hidden"?"hidden":"minimal"}]):{};e.$set(r)},i(o){t||(Ve(e.$$.fragment,o),t=!0)},o(o){mt(e.$$.fragment,o),t=!1},d(o){zn(e,o)}}}function lo(l){let e,t;return e=new To({props:{show_label:l[7],Icon:Ro,float:!0,label:l[6]||"Chatbot"}}),{c(){yn(e.$$.fragment)},m(n,i){qn(e,n,i),t=!0},p(n,i){const o={};i[0]&128&&(o.show_label=n[7]),i[0]&64&&(o.label=n[6]||"Chatbot"),e.$set(o)},i(n){t||(Ve(e.$$.fragment,n),t=!0)},o(n){mt(e.$$.fragment,n),t=!1},d(n){zn(e,n)}}}function df(l){let e,t,n,i,o,s=l[30]&&no(l),r=l[7]&&lo(l);return i=new of({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[41],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],show_progress:l[30]?.show_progress||"full",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[44],_fetch:l[45],load_component:l[27].load_component,msg_format:l[18],root:l[27].root,allow_file_downloads:l[39],allow_tags:l[25],watermark:l[40]}}),i.$on("change",l[46]),i.$on("select",l[47]),i.$on("like",l[48]),i.$on("share",l[49]),i.$on("error",l[50]),i.$on("example_select",l[51]),i.$on("option_select",l[52]),i.$on("retry",l[53]),i.$on("undo",l[54]),i.$on("clear",l[55]),i.$on("copy",l[56]),i.$on("edit",l[57]),{c(){s&&s.c(),e=to(),t=ff("div"),r&&r.c(),n=to(),yn(i.$$.fragment),_f(t,"class","wrapper svelte-g3p8na")},m(a,_){s&&s.m(a,_),eo(a,e,_),eo(a,t,_),r&&r.m(t,null),af(t,n),qn(i,t,null),o=!0},p(a,_){a[30]?s?(s.p(a,_),_[0]&1073741824&&Ve(s,1)):(s=no(a),s.c(),Ve(s,1),s.m(e.parentNode,e)):s&&(xi(),mt(s,1,1,()=>{s=null}),Qi()),a[7]?r?(r.p(a,_),_[0]&128&&Ve(r,1)):(r=lo(a),r.c(),Ve(r,1),r.m(t,n)):r&&(xi(),mt(r,1,1,()=>{r=null}),Qi());const f={};_[0]&134217728&&(f.i18n=a[27].i18n),_[0]&256&&(f.selectable=a[8]),_[0]&512&&(f.likeable=a[9]),_[0]&1024&&(f.feedback_options=a[10]),_[0]&2048&&(f.feedback_value=a[11]),_[0]&4096&&(f.show_share_button=a[12]),_[0]&32768&&(f.show_copy_all_button=a[15]),_[1]&1024&&(f.value=a[41]),_[0]&67108864&&(f.latex_delimiters=a[26]),_[0]&16777216&&(f.display_consecutive_in_same_bubble=a[24]),_[0]&524288&&(f.render_markdown=a[19]),_[1]&128&&(f.theme_mode=a[38]),_[1]&16&&(f.editable=a[35]),_[0]&1073741824&&(f.pending_message=a[30]?.status==="pending"),_[0]&1073741824&&(f.generating=a[30]?.status==="generating"),_[0]&8192&&(f.rtl=a[13]),_[0]&16384&&(f.show_copy_button=a[14]),_[0]&536870912&&(f.like_user_message=a[29]),_[0]&1073741824&&(f.show_progress=a[30]?.show_progress||"full"),_[0]&268435456&&(f.avatar_images=a[28]),_[0]&65536&&(f.sanitize_html=a[16]),_[0]&1048576&&(f.line_breaks=a[20]),_[0]&2097152&&(f.autoscroll=a[21]),_[0]&131072&&(f.layout=a[17]),_[1]&32&&(f.placeholder=a[36]),_[1]&64&&(f.examples=a[37]),_[0]&4194304&&(f._retryable=a[22]),_[0]&8388608&&(f._undoable=a[23]),_[0]&134217728&&(f.upload=a[44]),_[0]&134217728&&(f._fetch=a[45]),_[0]&134217728&&(f.load_component=a[27].load_component),_[0]&262144&&(f.msg_format=a[18]),_[0]&134217728&&(f.root=a[27].root),_[1]&256&&(f.allow_file_downloads=a[39]),_[0]&33554432&&(f.allow_tags=a[25]),_[1]&512&&(f.watermark=a[40]),i.$set(f)},i(a){o||(Ve(s),Ve(r),Ve(i.$$.fragment,a),o=!0)},o(a){mt(s),mt(r),mt(i.$$.fragment,a),o=!1},d(a){a&&(Xi(e),Xi(t)),s&&s.d(a),r&&r.d(),zn(i)}}}function gf(l){let e,t;return e=new Eo({props:{elem_id:l[1],elem_classes:l[2],visible:l[3],padding:!1,scale:l[4],min_width:l[5],height:l[31],resizable:l[32],min_height:l[33],max_height:l[34],allow_overflow:!0,flex:!0,overflow_behavior:"auto",$$slots:{default:[df]},$$scope:{ctx:l}}}),{c(){yn(e.$$.fragment)},m(n,i){qn(e,n,i),t=!0},p(n,i){const o={};i[0]&2&&(o.elem_id=n[1]),i[0]&4&&(o.elem_classes=n[2]),i[0]&8&&(o.visible=n[3]),i[0]&16&&(o.scale=n[4]),i[0]&32&&(o.min_width=n[5]),i[1]&1&&(o.height=n[31]),i[1]&2&&(o.resizable=n[32]),i[1]&4&&(o.min_height=n[33]),i[1]&8&&(o.max_height=n[34]),i[0]&2147483585|i[1]&134219760&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){t||(Ve(e.$$.fragment,n),t=!0)},o(n){mt(e.$$.fragment,n),t=!1},d(n){zn(e,n)}}}function bf(l,e,t){let{elem_id:n=""}=e,{elem_classes:i=[]}=e,{visible:o=!0}=e,{value:s=[]}=e,{scale:r=null}=e,{min_width:a=void 0}=e,{label:_}=e,{show_label:f=!0}=e,{root:u}=e,{_selectable:c=!1}=e,{likeable:w=!1}=e,{feedback_options:m=["Like","Dislike"]}=e,{feedback_value:h=null}=e,{show_share_button:k=!1}=e,{rtl:d=!1}=e,{show_copy_button:$=!0}=e,{show_copy_all_button:q=!1}=e,{sanitize_html:I=!0}=e,{layout:C="bubble"}=e,{type:y="tuples"}=e,{render_markdown:x=!0}=e,{line_breaks:T=!0}=e,{autoscroll:_e=!0}=e,{_retryable:fe=!1}=e,{_undoable:he=!1}=e,{group_consecutive_messages:S=!0}=e,{allow_tags:Ce=!1}=e,{latex_delimiters:de}=e,{gradio:v}=e,Ee=[],{avatar_images:lt=[null,null]}=e,{like_user_message:it=!1}=e,{loading_status:ye=void 0}=e,{height:ze}=e,{resizable:ot}=e,{min_height:Te}=e,{max_height:st}=e,{editable:Ae=null}=e,{placeholder:ge=null}=e,{examples:Fe=null}=e,{theme_mode:Ze}=e,{allow_file_downloads:Ue=!0}=e,{watermark:at=null}=e;const rt=()=>v.dispatch("clear_status",ye),qe=(...g)=>v.client.upload(...g),ee=(...g)=>v.client.fetch(...g),_t=()=>v.dispatch("change",s),te=g=>v.dispatch("select",g.detail),p=g=>v.dispatch("like",g.detail),W=g=>v.dispatch("share",g.detail),ln=g=>v.dispatch("error",g.detail),Rt=g=>v.dispatch("example_select",g.detail),Sn=g=>v.dispatch("option_select",g.detail),Hn=g=>v.dispatch("retry",g.detail),Ln=g=>v.dispatch("undo",g.detail),Mn=()=>{t(0,s=[]),v.dispatch("clear")},Nn=g=>v.dispatch("copy",g.detail),jn=g=>{s===null||s.length===0||(y==="messages"?t(0,s[g.detail.index].content=g.detail.value,s):t(0,s[g.detail.index[0]][g.detail.index[1]]=g.detail.value,s),t(0,s),v.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,o=g.visible),"value"in g&&t(0,s=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,f=g.show_label),"root"in g&&t(42,u=g.root),"_selectable"in g&&t(8,c=g._selectable),"likeable"in g&&t(9,w=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,k=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,q=g.show_copy_all_button),"sanitize_html"in g&&t(16,I=g.sanitize_html),"layout"in g&&t(17,C=g.layout),"type"in g&&t(18,y=g.type),"render_markdown"in g&&t(19,x=g.render_markdown),"line_breaks"in g&&t(20,T=g.line_breaks),"autoscroll"in g&&t(21,_e=g.autoscroll),"_retryable"in g&&t(22,fe=g._retryable),"_undoable"in g&&t(23,he=g._undoable),"group_consecutive_messages"in g&&t(24,S=g.group_consecutive_messages),"allow_tags"in g&&t(25,Ce=g.allow_tags),"latex_delimiters"in g&&t(26,de=g.latex_delimiters),"gradio"in g&&t(27,v=g.gradio),"avatar_images"in g&&t(28,lt=g.avatar_images),"like_user_message"in g&&t(29,it=g.like_user_message),"loading_status"in g&&t(30,ye=g.loading_status),"height"in g&&t(31,ze=g.height),"resizable"in g&&t(32,ot=g.resizable),"min_height"in g&&t(33,Te=g.min_height),"max_height"in g&&t(34,st=g.max_height),"editable"in g&&t(35,Ae=g.editable),"placeholder"in g&&t(36,ge=g.placeholder),"examples"in g&&t(37,Fe=g.examples),"theme_mode"in g&&t(38,Ze=g.theme_mode),"allow_file_downloads"in g&&t(39,Ue=g.allow_file_downloads),"watermark"in g&&t(40,at=g.watermark)},l.$$.update=()=>{l.$$.dirty[0]&262145|l.$$.dirty[1]&2048&&t(41,Ee=y==="tuples"?ws(s,u):bs(s,u))},[s,n,i,o,r,a,_,f,c,w,m,h,k,d,$,q,I,C,y,x,T,_e,fe,he,S,Ce,de,v,lt,it,ye,ze,ot,Te,st,Ae,ge,Fe,Ze,Ue,at,Ee,u,rt,qe,ee,_t,te,p,W,ln,Rt,Sn,Hn,Ln,Mn,Nn,jn]}class Jf extends sf{constructor(e){super(),mf(this,e,bf,gf,hf,{elem_id:1,elem_classes:2,visible:3,value:0,scale:4,min_width:5,label:6,show_label:7,root:42,_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,resizable:32,min_height:33,max_height:34,editable:35,placeholder:36,examples:37,theme_mode:38,allow_file_downloads:39,watermark:40},null,[-1,-1])}get elem_id(){return this.$$.ctx[1]}set elem_id(e){this.$$set({elem_id:e}),H()}get elem_classes(){return this.$$.ctx[2]}set elem_classes(e){this.$$set({elem_classes:e}),H()}get visible(){return this.$$.ctx[3]}set visible(e){this.$$set({visible:e}),H()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),H()}get scale(){return this.$$.ctx[4]}set scale(e){this.$$set({scale:e}),H()}get min_width(){return this.$$.ctx[5]}set min_width(e){this.$$set({min_width:e}),H()}get label(){return this.$$.ctx[6]}set label(e){this.$$set({label:e}),H()}get show_label(){return this.$$.ctx[7]}set show_label(e){this.$$set({show_label:e}),H()}get root(){return this.$$.ctx[42]}set root(e){this.$$set({root:e}),H()}get _selectable(){return this.$$.ctx[8]}set _selectable(e){this.$$set({_selectable:e}),H()}get likeable(){return this.$$.ctx[9]}set likeable(e){this.$$set({likeable:e}),H()}get feedback_options(){return this.$$.ctx[10]}set feedback_options(e){this.$$set({feedback_options:e}),H()}get feedback_value(){return this.$$.ctx[11]}set feedback_value(e){this.$$set({feedback_value:e}),H()}get show_share_button(){return this.$$.ctx[12]}set show_share_button(e){this.$$set({show_share_button:e}),H()}get rtl(){return this.$$.ctx[13]}set rtl(e){this.$$set({rtl:e}),H()}get show_copy_button(){return this.$$.ctx[14]}set show_copy_button(e){this.$$set({show_copy_button:e}),H()}get show_copy_all_button(){return this.$$.ctx[15]}set show_copy_all_button(e){this.$$set({show_copy_all_button:e}),H()}get sanitize_html(){return this.$$.ctx[16]}set sanitize_html(e){this.$$set({sanitize_html:e}),H()}get layout(){return this.$$.ctx[17]}set layout(e){this.$$set({layout:e}),H()}get type(){return this.$$.ctx[18]}set type(e){this.$$set({type:e}),H()}get render_markdown(){return this.$$.ctx[19]}set render_markdown(e){this.$$set({render_markdown:e}),H()}get line_breaks(){return this.$$.ctx[20]}set line_breaks(e){this.$$set({line_breaks:e}),H()}get autoscroll(){return this.$$.ctx[21]}set autoscroll(e){this.$$set({autoscroll:e}),H()}get _retryable(){return this.$$.ctx[22]}set _retryable(e){this.$$set({_retryable:e}),H()}get _undoable(){return this.$$.ctx[23]}set _undoable(e){this.$$set({_undoable:e}),H()}get group_consecutive_messages(){return this.$$.ctx[24]}set group_consecutive_messages(e){this.$$set({group_consecutive_messages:e}),H()}get allow_tags(){return this.$$.ctx[25]}set allow_tags(e){this.$$set({allow_tags:e}),H()}get latex_delimiters(){return this.$$.ctx[26]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),H()}get gradio(){return this.$$.ctx[27]}set gradio(e){this.$$set({gradio:e}),H()}get avatar_images(){return this.$$.ctx[28]}set avatar_images(e){this.$$set({avatar_images:e}),H()}get like_user_message(){return this.$$.ctx[29]}set like_user_message(e){this.$$set({like_user_message:e}),H()}get loading_status(){return this.$$.ctx[30]}set loading_status(e){this.$$set({loading_status:e}),H()}get height(){return this.$$.ctx[31]}set height(e){this.$$set({height:e}),H()}get resizable(){return this.$$.ctx[32]}set resizable(e){this.$$set({resizable:e}),H()}get min_height(){return this.$$.ctx[33]}set min_height(e){this.$$set({min_height:e}),H()}get max_height(){return this.$$.ctx[34]}set max_height(e){this.$$set({max_height:e}),H()}get editable(){return this.$$.ctx[35]}set editable(e){this.$$set({editable:e}),H()}get placeholder(){return this.$$.ctx[36]}set placeholder(e){this.$$set({placeholder:e}),H()}get examples(){return this.$$.ctx[37]}set examples(e){this.$$set({examples:e}),H()}get theme_mode(){return this.$$.ctx[38]}set theme_mode(e){this.$$set({theme_mode:e}),H()}get allow_file_downloads(){return this.$$.ctx[39]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),H()}get watermark(){return this.$$.ctx[40]}set watermark(e){this.$$set({watermark:e}),H()}}export{of as BaseChatBot,Jf as default}; 14//# sourceMappingURL=Index-BklySo5T.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.