1import{$ as Qn,s as Ol,l as Mo,k as Po,b as Io,o as Oo,q as Do,c as Fo,p as ti,A as Uo}from"./index-DUPwsM33.js";import{B as Jn}from"./Button-A48gDDZQ.js";import{L as Vs}from"./index-bSCVAeem.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-BOpxTcdu.js";import"./MarkdownCode.svelte_svelte_type_style_lang-BB-itM20.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import{B as hn}from"./Block-DdQws7Te.js";import{c as Ro}from"./Dropdown-CGMZLBsY.js";/* empty css */import{T as Bo}from"./Toast-B8Ve8dJw.js";import{G as Go}from"./utils-BsGrhMNe.js";import"./svelte/svelte.js";import"./IconButton-B-aAVSzy.js";import"./Clear-By3xiIwg.js";import"./prism-python-DJXBfrTF.js";import"./index-D9DTd3JP.js";import"./BlockTitle-1YbGWoMD.js";import"./Info-T4M00DRE.js";import"./MarkdownCode-CKlPsAWp.js";import"./DropdownArrow-dYuMZY9s.js";const{SvelteComponent:Ho,append:cl,attr:rt,detach:Vo,init:Wo,insert:Zo,noop:_l,safe_not_equal:Qo,set_style:on,svg_element:En}=window.__gradio__svelte__internal;function Jo(l){let e,t,n,i;return{c(){e=En("svg"),t=En("g"),n=En("path"),i=En("path"),rt(n,"d","M3.789,0.09C3.903,-0.024 4.088,-0.024 4.202,0.09L4.817,0.705C4.931,0.819 4.931,1.004 4.817,1.118L1.118,4.817C1.004,4.931 0.819,4.931 0.705,4.817L0.09,4.202C-0.024,4.088 -0.024,3.903 0.09,3.789L3.789,0.09Z"),rt(i,"d","M4.825,3.797C4.934,3.907 4.934,4.084 4.825,4.193L4.193,4.825C4.084,4.934 3.907,4.934 3.797,4.825L0.082,1.11C-0.027,1.001 -0.027,0.823 0.082,0.714L0.714,0.082C0.823,-0.027 1.001,-0.027 1.11,0.082L4.825,3.797Z"),rt(e,"width","100%"),rt(e,"height","100%"),rt(e,"viewBox","0 0 5 5"),rt(e,"version","1.1"),rt(e,"xmlns","http://www.w3.org/2000/svg"),rt(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),rt(e,"xml:space","preserve"),on(e,"fill","currentColor"),on(e,"fill-rule","evenodd"),on(e,"clip-rule","evenodd"),on(e,"stroke-linejoin","round"),on(e,"stroke-miterlimit","2")},m(s,o){Zo(s,e,o),cl(e,t),cl(t,n),cl(t,i)},p:_l,i:_l,o:_l,d(s){s&&Vo(e)}}}class Dl extends Ho{constructor(e){super(),Wo(this,e,null,Jo,Qo,{})}}const{SvelteComponent:Yo,append:ut,attr:Sn,create_component:Ko,destroy_component:Xo,detach:ul,element:Rt,flush:xo,init:er,insert:fl,listen:tr,mount_component:nr,safe_not_equal:lr,set_data:ir,space:pl,text:ni,transition_in:sr,transition_out:or}=window.__gradio__svelte__internal,{createEventDispatcher:rr}=window.__gradio__svelte__internal;function ar(l){let e,t,n,i,s,o,a,c,r,_,u,m,p,b,d;return m=new Dl({}),{c(){e=Rt("div"),t=Rt("h1"),t.textContent="API Docs",n=pl(),i=Rt("p"),s=ni(`No API Routes found for 2 `),o=Rt("code"),a=ni(l[0]),c=pl(),r=Rt("p"),r.innerHTML=`To expose an API endpoint of your app in this page, set the <code>api_name</code> 3 parameter of the event listener. 4 <br/> 5 For more information, visit the 6 <a href="https://gradio.app/sharing_your_app/#api-page" target="_blank">API Page guide</a> 7 . To hide the API documentation button and this page, set 8 <code>show_api=False</code> 9 in the 10 <code>Blocks.launch()</code> 11 method.`,_=pl(),u=Rt("button"),Ko(m.$$.fragment),Sn(o,"class","svelte-e1ha0f"),Sn(i,"class","attention svelte-e1ha0f"),Sn(e,"class","wrap prose svelte-e1ha0f"),Sn(u,"class","svelte-e1ha0f")},m($,f){fl($,e,f),ut(e,t),ut(e,n),ut(e,i),ut(i,s),ut(i,o),ut(o,a),ut(e,c),ut(e,r),fl($,_,f),fl($,u,f),nr(m,u,null),p=!0,b||(d=tr(u,"click",l[2]),b=!0)},p($,[f]){(!p||f&1)&&ir(a,$[0])},i($){p||(sr(m.$$.fragment,$),p=!0)},o($){or(m.$$.fragment,$),p=!1},d($){$&&(ul(e),ul(_),ul(u)),Xo(m),b=!1,d()}}}function cr(l,e,t){const n=rr();let{root:i}=e;const s=()=>n("close");return l.$$set=o=>{"root"in o&&t(0,i=o.root)},[i,n,s]}class _r extends Yo{constructor(e){super(),er(this,e,cr,ar,lr,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),xo()}}const Ws="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9425%202.94265C27.4632%202.42195%2027.4632%201.57773%2026.9425%201.05703C26.4218%200.536329%2025.5776%200.536329%2025.0569%201.05703L22.5713%203.54256C21.1213%202.59333%2019.5367%202.43378%2018.1753%202.64006C16.5495%202.88638%2015.1127%203.66838%2014.3905%204.39053L12.3905%206.39053C12.1405%206.64058%2012%206.97972%2012%207.33334C12%207.68697%2012.1405%208.0261%2012.3905%208.27615L19.7239%2015.6095C20.2446%2016.1302%2021.0888%2016.1302%2021.6095%2015.6095L23.6095%2013.6095C24.3316%2012.8873%2025.1136%2011.4505%2025.36%209.82475C25.5663%208.46312%2025.4066%206.87827%2024.4571%205.42807L26.9425%202.94265Z'%20fill='%233c4555'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.276%2012.9426C12.7967%2012.4219%2012.7967%2011.5777%2012.276%2011.057C11.7553%2010.5363%2010.9111%2010.5363%2010.3904%2011.057L8.66651%2012.7809L8.27615%2012.3905C8.0261%2012.1405%207.68697%2012%207.33334%2012C6.97972%2012%206.64058%2012.1405%206.39053%2012.3905L4.39053%2014.3905C3.66838%2015.1127%202.88638%2016.5495%202.64006%2018.1753C2.43377%2019.5367%202.59333%2021.1214%203.54262%2022.5714L1.05703%2025.057C0.536329%2025.5777%200.536329%2026.4219%201.05703%2026.9426C1.57773%2027.4633%202.42195%2027.4633%202.94265%2026.9426L5.42817%2024.4571C6.87835%2025.4066%208.46315%2025.5663%209.82475%2025.36C11.4505%2025.1136%2012.8873%2024.3316%2013.6095%2023.6095L15.6095%2021.6095C16.1302%2021.0888%2016.1302%2020.2446%2015.6095%2019.7239L15.2188%2019.3332L16.9426%2017.6093C17.4633%2017.0886%2017.4633%2016.2444%2016.9426%2015.7237C16.4219%2015.203%2015.5777%2015.203%2015.057%2015.7237L13.3332%2017.4475L10.5521%2014.6665L12.276%2012.9426Z'%20fill='%23FF7C00'/%3e%3c/svg%3e",{SvelteComponent:ur,append:Ue,attr:Ye,create_component:li,destroy_component:ii,detach:It,element:Ke,flush:si,init:fr,insert:Ot,listen:pr,mount_component:oi,noop:dr,safe_not_equal:mr,set_data:ri,space:un,src_url_equal:hr,text:fn,transition_in:ai,transition_out:ci}=window.__gradio__svelte__internal,{createEventDispatcher:gr}=window.__gradio__svelte__internal;function br(l){let e,t,n;return{c(){e=Ke("div"),t=un(),n=Ke("p"),n.textContent="API Recorder",Ye(e,"class","loading-dot self-baseline svelte-1i1gjw2"),Ye(n,"class","self-baseline btn-text svelte-1i1gjw2")},m(i,s){Ot(i,e,s),Ot(i,t,s),Ot(i,n,s)},p:dr,d(i){i&&(It(e),It(t),It(n))}}}function _i(l){let e;return{c(){e=fn("s")}
vendor: 39,776 bytes, lines 11-64
11,m(t,n){Ot(t,e,n)},d(t){t&&It(e)}}}function vr(l){let e,t,n,i,s,o,a,c,r,_,u,m,p,b,d,$,f,k,y,g,w,v,h;u=new Jn({props:{size:"sm",variant:"secondary",elem_id:"start-api-recorder",$$slots:{default:[br]},$$scope:{ctx:l}}}),u.$on("click",l[3]);let E=l[1]>1&&_i();return g=new Dl({}),{c(){e=Ke("h2"),t=Ke("img"),i=un(),s=Ke("div"),o=fn(`API documentation 12 `),a=Ke("div"),c=fn(l[0]),r=un(),_=Ke("span"),li(u.$$.fragment),m=un(),p=Ke("p"),b=Ke("span"),d=fn(l[1]),$=fn(" API endpoint"),E&&E.c(),f=Ke("br"),k=un(),y=Ke("button"),li(g.$$.fragment),hr(t.src,n=Ws)||Ye(t,"src",n),Ye(t,"alt",""),Ye(t,"class","svelte-1i1gjw2"),Ye(a,"class","url svelte-1i1gjw2"),Ye(s,"class","title svelte-1i1gjw2"),Ye(b,"class","url svelte-1i1gjw2"),Ye(_,"class","counts svelte-1i1gjw2"),Ye(e,"class","svelte-1i1gjw2"),Ye(y,"class","svelte-1i1gjw2")},m(S,C){Ot(S,e,C),Ue(e,t),Ue(e,i),Ue(e,s),Ue(s,o),Ue(s,a),Ue(a,c),Ue(e,r),Ue(e,_),oi(u,_,null),Ue(_,m),Ue(_,p),Ue(p,b),Ue(b,d),Ue(p,$),E&&E.m(p,null),Ue(p,f),Ot(S,k,C),Ot(S,y,C),oi(g,y,null),w=!0,v||(h=pr(y,"click",l[4]),v=!0)},p(S,[C]){(!w||C&1)&&ri(c,S[0]);const z={};C&32&&(z.$$scope={dirty:C,ctx:S}),u.$set(z),(!w||C&2)&&ri(d,S[1]),S[1]>1?E||(E=_i(),E.c(),E.m(p,f)):E&&(E.d(1),E=null)},i(S){w||(ai(u.$$.fragment,S),ai(g.$$.fragment,S),w=!0)},o(S){ci(u.$$.fragment,S),ci(g.$$.fragment,S),w=!1},d(S){S&&(It(e),It(k),It(y)),ii(u),E&&E.d(),ii(g),v=!1,h()}}}function $r(l,e,t){let{root:n}=e,{api_count:i}=e;const s=gr(),o=()=>s("close",{api_recorder_visible:!0}),a=()=>s("close");return l.$$set=c=>{"root"in c&&t(0,n=c.root),"api_count"in c&&t(1,i=c.api_count)},[n,i,s,o,a]}class kr extends ur{constructor(e){super(),fr(this,e,$r,vr,mr,{root:0,api_count:1})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),si()}get api_count(){return this.$$.ctx[1]}set api_count(e){this.$$set({api_count:e}),si()}}function Ze(l,e,t=null){return e===void 0?t==="py"?"None":null:l===null&&t==="py"?"None":e==="string"||e==="str"?t===null?l:'"'+l+'"':e==="number"?t===null?parseFloat(l):l:e==="boolean"||e=="bool"?t==="py"?(l=String(l),l==="true"?"True":"False"):t==="js"||t==="bash"?l:l==="true":e==="List[str]"?(l=JSON.stringify(l),l):e.startsWith("Literal['")?'"'+l+'"':t===null?l===""?null:JSON.parse(l):typeof l=="string"?l===""?t==="py"?"None":"null":l:(t==="bash"&&(l=Cl(l)),t==="py"&&(l=ql(l)),wr(l))}function Zs(l){if(typeof l=="object"&&l!==null&&l.hasOwnProperty("url")&&l.hasOwnProperty("meta")&&typeof l.meta=="object"&&l.meta!==null&&l.meta._type==="gradio.FileData")return!0;if(typeof l=="object"&&l!==null){for(let e in l)if(typeof l[e]=="object"&&Zs(l[e]))return!0}return!1}function Cl(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)&&"url"in l&&l.url&&"meta"in l&&l.meta?._type==="gradio.FileData"?{path:l.url}:(Array.isArray(l)?l.forEach((e,t)=>{typeof e=="object"&&e!==null&&(l[t]=Cl(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=Cl(l[e])}),l)}function ql(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)&&"url"in l&&l.url&&"meta"in l&&l.meta?._type==="gradio.FileData"?`handle_file('${l.url}')`:(Array.isArray(l)?l.forEach((e,t)=>{typeof e=="object"&&e!==null&&(l[t]=ql(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=ql(l[e])}),l)}function wr(l){let e=JSON.stringify(l,(i,s)=>s===null?"UNQUOTEDNone":typeof s=="string"&&s.startsWith("handle_file(")&&s.endsWith(")")?`UNQUOTED${s}`:s);const t=/"UNQUOTEDhandle_file\(([^)]*)\)"/g;e=e.replace(t,(i,s)=>`handle_file(${s})`);const n=/"UNQUOTEDNone"/g;return e.replace(n,"None")}const{SvelteComponent:yr,append:_e,attr:dt,check_outros:Cr,create_component:qr,destroy_component:Er,destroy_each:Sr,detach:ze,element:Be,empty:Qs,ensure_array_like:ui,flush:zn,group_outros:zr,init:Lr,insert:Le,mount_component:Nr,noop:jr,safe_not_equal:Ar,set_data:mt,set_style:jt,space:At,text:Pe,toggle_class:fi,transition_in:Mn,transition_out:El}=window.__gradio__svelte__internal;function pi(l,e,t){const n=l.slice();return n[4]=e[t].label,n[5]=e[t].python_type,n[6]=e[t].component,n[7]=e[t].parameter_name,n[8]=e[t].parameter_has_default,n[9]=e[t].parameter_default,n[11]=t,n}function di(l){let e;return{c(){e=Pe("s")},m(t,n){Le(t,e,n)},d(t){t&&ze(e)}}}function Tr(l){let e=(l[2][l[11]].type||"any")+"",t;return{c(){t=Pe(e)},m(n,i){Le(n,t,i)},p(n,i){i&4&&e!==(e=(n[2][n[11]].type||"any")+"")&&mt(t,e)},d(n){n&&ze(t)}}}function Mr(l){let e=l[5].type+"",t,n,i=l[8]&&l[9]===null&&mi();return{c(){t=Pe(e),i&&i.c(),n=Qs()},m(s,o){Le(s,t,o),i&&i.m(s,o),Le(s,n,o)},p(s,o){o&2&&e!==(e=s[5].type+"")&&mt(t,e),s[8]&&s[9]===null?i||(i=mi(),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},d(s){s&&(ze(t),ze(n)),i&&i.d(s)}}}function mi(l){let e;return{c(){e=Pe(`Â | 13 None`)},m(t,n){Le(t,e,n)},d(t){t&&ze(e)}}}function Pr(l){let e,t,n=Ze(l[9],l[5].type,"py")+"",i;return{c(){e=Be("span"),e.textContent="Default: ",t=Be("span"),i=Pe(n),dt(t,"class","code svelte-1yt946s"),jt(t,"font-size","var(--text-sm)")},m(s,o){Le(s,e,o),Le(s,t,o),_e(t,i)},p(s,o){o&2&&n!==(n=Ze(s[9],s[5].type,"py")+"")&&mt(i,n)},d(s){s&&(ze(e),ze(t))}}}function Ir(l){let e;return{c(){e=Be("span"),e.textContent="Required",jt(e,"font-weight","bold")},m(t,n){Le(t,e,n)},p:jr,d(t){t&&ze(e)}}}function hi(l){let e,t,n,i,s,o=(l[3]!=="bash"&&l[7]?l[7]:"["+l[11]+"]")+"",a,c,r,_,u,m,p,b=l[4]+"",d,$,f=l[6]+"",k,y,g=l[5].description+"",w,v;function h(N,M){return N[3]==="python"?Mr:Tr}let E=h(l),S=E(l);function C(N,M){return!N[8]||N[3]=="bash"?Ir:Pr}let z=C(l),A=z(l);return{c(){e=Be("hr"),t=At(),n=Be("div"),i=Be("p"),s=Be("span"),a=Pe(o),c=At(),r=Be("span"),S.c(),_=At(),A.c(),u=At(),m=Be("p"),p=Pe('The input value that is provided in the "'),d=Pe(b),$=Pe('" '),k=Pe(f),y=Pe(` 14 component. `),w=Pe(g),v=At(),dt(e,"class","hr svelte-1yt946s"),dt(s,"class","code svelte-1yt946s"),jt(s,"margin-right","10px"),dt(r,"class","code highlight svelte-1yt946s"),jt(r,"margin-right","10px"),jt(i,"white-space","nowrap"),jt(i,"overflow-x","auto"),dt(m,"class","desc svelte-1yt946s"),jt(n,"margin","10px")},m(N,M){Le(N,e,M),Le(N,t,M),Le(N,n,M),_e(n,i),_e(i,s),_e(s,a),_e(i,c),_e(i,r),S.m(r,null),_e(i,_),A.m(i,null),_e(n,u),_e(n,m),_e(m,p),_e(m,d),_e(m,$),_e(m,k),_e(m,y),_e(m,w),_e(n,v)},p(N,M){M&10&&o!==(o=(N[3]!=="bash"&&N[7]?N[7]:"["+N[11]+"]")+"")&&mt(a,o),E===(E=h(N))&&S?S.p(N,M):(S.d(1),S=E(N),S&&(S.c(),S.m(r,null))),z===(z=C(N))&&A?A.p(N,M):(A.d(1),A=z(N),A&&(A.c(),A.m(i,null))),M&2&&b!==(b=N[4]+"")&&mt(d,b),M&2&&f!==(f=N[6]+"")&&mt(k,f),M&2&&g!==(g=N[5].description+"")&&mt(w,g)},d(N){N&&(ze(e),ze(t),ze(n)),S.d(),A.d()}}}function gi(l){let e,t,n;return t=new Vs({props:{margin:!1}}),{c(){e=Be("div"),qr(t.$$.fragment),dt(e,"class","load-wrap")},m(i,s){Le(i,e,s),Nr(t,e,null),n=!0},i(i){n||(Mn(t.$$.fragment,i),n=!0)},o(i){El(t.$$.fragment,i),n=!1},d(i){i&&ze(e),Er(t)}}}function Or(l){let e,t,n,i=l[1].length+"",s,o,a,c,r,_,u,m,p=l[1].length!=1&&di(),b=ui(l[1]),d=[];for(let f=0;f<b.length;f+=1)d[f]=hi(pi(l,b,f));let $=l[0]&&gi();return{c(){e=Be("h4"),t=Be("div"),t.innerHTML='<div class="toggle-dot svelte-1yt946s"></div>',n=Pe(` 15 Accepts `),s=Pe(i),o=Pe(" parameter"),p&&p.c(),a=Pe(":"),c=At(),r=Be("div");for(let f=0;f<d.length;f+=1)d[f].c();_=At(),$&&$.c(),u=Qs(),dt(t,"class","toggle-icon svelte-1yt946s"),dt(e,"class","svelte-1yt946s"),fi(r,"hide",l[0])},m(f,k){Le(f,e,k),_e(e,t),_e(e,n),_e(e,s),_e(e,o),p&&p.m(e,null),_e(e,a),Le(f,c,k),Le(f,r,k);for(let y=0;y<d.length;y+=1)d[y]&&d[y].m(r,null);Le(f,_,k),$&&$.m(f,k),Le(f,u,k),m=!0},p(f,[k]){if((!m||k&2)&&i!==(i=f[1].length+"")&&mt(s,i),f[1].length!=1?p||(p=di(),p.c(),p.m(e,a)):p&&(p.d(1),p=null),k&14){b=ui(f[1]);let y;for(y=0;y<b.length;y+=1){const g=pi(f,b,y);d[y]?d[y].p(g,k):(d[y]=hi(g),d[y].c(),d[y].m(r,null))}for(;y<d.length;y+=1)d[y].d(1);d.length=b.length}(!m||k&1)&&fi(r,"hide",f[0]),f[0]?$?k&1&&Mn($,1):($=gi(),$.c(),Mn($,1),$.m(u.parentNode,u)):$&&(zr(),El($,1,1,()=>{$=null}),Cr())},i(f){m||(Mn($),m=!0)},o(f){El($),m=!1},d(f){f&&(ze(e),ze(c),ze(r),ze(_),ze(u)),p&&p.d(),Sr(d,f),$&&$.d(f)}}}function Dr(l,e,t){let{is_running:n}=e,{endpoint_returns:i}=e,{js_returns:s}=e,{current_language:o}=e;return l.$$set=a=>{"is_running"in a&&t(0,n=a.is_running),"endpoint_returns"in a&&t(1,i=a.endpoint_returns),"js_returns"in a&&t(2,s=a.js_returns),"current_language"in a&&t(3,o=a.current_language)},[n,i,s,o]}class Fr extends yr{constructor(e){super(),Lr(this,e,Dr,Or,Ar,{is_running:0,endpoint_returns:1,js_returns:2,current_language:3})}get is_running(){return this.$$.ctx[0]}set is_running(e){this.$$set({is_running:e}),zn()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),zn()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),zn()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),zn()}}const{SvelteComponent:Ur,create_component:Rr,destroy_component:Br,detach:Gr,flush:Hr,init:Vr,insert:Wr,mount_component:Zr,safe_not_equal:Qr,set_data:Jr,text:Yr,transition_in:Kr,transition_out:Xr}=window.__gradio__svelte__internal;function xr(l){let e;return{c(){e=Yr(l[0])},m(t,n){Wr(t,e,n)},p(t,n){n&1&&Jr(e,t[0])},d(t){t&&Gr(e)}}}function ea(l){let e,t;return e=new Jn({props:{size:"sm",$$slots:{default:[xr]},$$scope:{ctx:l}}}),e.$on("click",l[1]),{c(){Rr(e.$$.fragment)},m(n,i){Zr(e,n,i),t=!0},p(n,[i]){const s={};i&9&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Kr(e.$$.fragment,n),t=!0)},o(n){Xr(e.$$.fragment,n),t=!1},d(n){Br(e,n)}}}function ta(l,e,t){let{code:n}=e,i="copy";function s(){navigator.clipboard.writeText(n),t(0,i="copied!"),setTimeout(()=>{t(0,i="copy")},1500)}return l.$$set=o=>{"code"in o&&t(2,n=o.code)},[i,s,n]}class _t extends Ur{constructor(e){super(),Vr(this,e,ta,ea,Qr,{code:2})}get code(){return this.$$.ctx[2]}set code(e){this.$$set({code:e}),Hr()}}const{SvelteComponent:na,append:Fl,attr:Ft,check_outros:la,create_component:Yn,destroy_component:Kn,detach:et,element:tt,flush:ia,group_outros:sa,init:oa,insert:nt,mount_component:Xn,noop:Ul,safe_not_equal:ra,space:Rl,transition_in:Zt,transition_out:Qt}=window.__gradio__svelte__internal;function aa(l){let e,t,n,i,s,o;return t=new _t({props:{code:$i}}),{c(){e=tt("div"),Yn(t.$$.fragment),n=Rl(),i=tt("div"),s=tt("pre"),s.textContent=`$ ${$i}`,Ft(e,"class","copy svelte-hq8ezf"),Ft(s,"class","svelte-hq8ezf")},m(a,c){nt(a,e,c),Xn(t,e,null),nt(a,n,c),nt(a,i,c),Fl(i,s),o=!0},p:Ul,i(a){o||(Zt(t.$$.fragment,a),o=!0)},o(a){Qt(t.$$.fragment,a),o=!1},d(a){a&&(et(e),et(n),et(i)),Kn(t)}}}function ca(l){let e,t,n,i,s,o;return t=new _t({props:{code:vi}}),{c(){e=tt("div"),Yn(t.$$.fragment),n=Rl(),i=tt("div"),s=tt("pre"),s.textContent=`$ ${vi}`,Ft(e,"class","copy svelte-hq8ezf"),Ft(s,"class","svelte-hq8ezf")},m(a,c){nt(a,e,c),Xn(t,e,null),nt(a,n,c),nt(a,i,c),Fl(i,s),o=!0},p:Ul,i(a){o||(Zt(t.$$.fragment,a),o=!0)},o(a){Qt(t.$$.fragment,a),o=!1},d(a){a&&(et(e),et(n),et(i)),Kn(t)}}}function _a(l){let e,t,n,i,s,o;return t=new _t({props:{code:bi}}),{c(){e=tt("div"),Yn(t.$$.fragment),n=Rl(),i=tt("div"),s=tt("pre"),s.textContent=`$ ${bi}`,Ft(e,"class","copy svelte-hq8ezf"),Ft(s,"class","svelte-hq8ezf")},m(a,c){nt(a,e,c),Xn(t,e,null),nt(a,n,c),nt(a,i,c),Fl(i,s),o=!0},p:Ul,i(a){o||(Zt(t.$$.fragment,a),o=!0)},o(a){Qt(t.$$.fragment,a),o=!1},d(a){a&&(et(e),et(n),et(i)),Kn(t)}}}function ua(l){let e,t,n,i;const s=[_a,ca,aa],o=[];function a(c,r){return c[0]==="python"?0:c[0]==="javascript"?1:c[0]==="bash"?2:-1}return~(t=a(l))&&(n=o[t]=s[t](l)),{c(){e=tt("code"),n&&n.c(),Ft(e,"class","svelte-hq8ezf")},m(c,r){nt(c,e,r),~t&&o[t].m(e,null),i=!0},p(c,r){let _=t;t=a(c),t===_?~t&&o[t].p(c,r):(n&&(sa(),Qt(o[_],1,1,()=>{o[_]=null}),la()),~t?(n=o[t],n?n.p(c,r):(n=o[t]=s[t](c),n.c()),Zt(n,1),n.m(e,null)):n=null)},i(c){i||(Zt(n),i=!0)},o(c){Qt(n),i=!1},d(c){c&&et(e),~t&&o[t].d()}}}function fa(l){let e,t;return e=new hn({props:{$$slots:{default:[ua]},$$scope:{ctx:l}}}),{c(){Yn(e.$$.fragment)},m(n,i){Xn(e,n,i),t=!0},p(n,[i]){const s={};i&3&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Zt(e.$$.fragment,n),t=!0)},o(n){Qt(e.$$.fragment,n),t=!1},d(n){Kn(e,n)}}}let bi="pip install gradio_client",vi="npm i -D @gradio/client",$i="curl --version";function pa(l,e,t){let{current_language:n}=e;return l.$$set=i=>{"current_language"in i&&t(0,n=i.current_language)},[n]}class da extends na{constructor(e){super(),oa(this,e,pa,fa,ra,{current_language:0})}get current_language(){return this.$$.ctx[0]}set current_language(e){this.$$set({current_language:e}),ia()}}const{SvelteComponent:ma,append:Vt,attr:Dn,detach:Bl,element:Fn,empty:ha,flush:dl,init:ga,insert:Gl,noop:ki,safe_not_equal:ba,set_data:Js,text:Un}=window.__gradio__svelte__internal;function va(l){let e,t,n,i;return{c(){e=Fn("h3"),t=Un(`fn_index: 16 `),n=Fn("span"),i=Un(l[1]),Dn(n,"class","post svelte-41kcm6"),Dn(e,"class","svelte-41kcm6")},m(s,o){Gl(s,e,o),Vt(e,t),Vt(e,n),Vt(n,i)},p(s,o){o&2&&Js(i,s[1])},d(s){s&&Bl(e)}}}function $a(l){let e,t,n,i="/"+l[0],s;return{c(){e=Fn("h3"),t=Un(`api_name: 17 `),n=Fn("span"),s=Un(i),Dn(n,"class","post svelte-41kcm6"),Dn(e,"class","svelte-41kcm6")},m(o,a){Gl(o,e,a),Vt(e,t),Vt(e,n),Vt(n,s)},p(o,a){a&1&&i!==(i="/"+o[0])&&Js(s,i)},d(o){o&&Bl(e)}}}function ka(l){let e;function t(s,o){return s[2]?$a:va}let n=t(l),i=n(l);return{c(){i.c(),e=ha()},m(s,o){i.m(s,o),Gl(s,e,o)},p(s,[o]){n===(n=t(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},i:ki,o:ki,d(s){s&&Bl(e),i.d(s)}}}function wa(l,e,t){let{api_name:n=null}=e,{fn_index:i=null}=e,{named:s}=e;return l.$$set=o=>{"api_name"in o&&t(0,n=o.api_name),"fn_index"in o&&t(1,i=o.fn_index),"named"in o&&t(2,s=o.named)},[n,i,s]}class Ys extends ma{constructor(e){super(),ga(this,e,wa,ka,ba,{api_name:0,fn_index:1,named:2})}get api_name(){return this.$$.ctx[0]}set api_name(e){this.$$set({api_name:e}),dl()}get fn_index(){return this.$$.ctx[1]}set fn_index(e){this.$$set({fn_index:e}),dl()}get named(){return this.$$.ctx[2]}set named(e){this.$$set({named:e}),dl()}}const{SvelteComponent:ya,append:j,attr:fe,binding_callbacks:ml,check_outros:wi,create_component:kt,destroy_component:wt,destroy_each:Rn,detach:G,element:re,empty:Ks,ensure_array_like:ht,flush:at,group_outros:yi,init:Ca,insert:H,mount_component:yt,noop:qa,safe_not_equal:Ea,set_data:be,space:xn,text:L,transition_in:Qe,transition_out:Je}=window.__gradio__svelte__internal;function Ci(l,e,t){const n=l.slice();return n[28]=e[t].label,n[23]=e[t].parameter_name,n[29]=e[t].type,n[21]=e[t].python_type,n[30]=e[t].component,n[22]=e[t].example_input,n[31]=e[t].serializer,n[27]=t,n}function qi(l,e,t){const n=l.slice();return n[28]=e[t].label,n[23]=e[t].parameter_name,n[29]=e[t].type,n[21]=e[t].python_type,n[30]=e[t].component,n[22]=e[t].example_input,n[31]=e[t].serializer,n[27]=t,n}function Ei(l,e,t){const n=l.slice();return n[30]=e[t].component,n[22]=e[t].example_input,n[27]=t,n}function Si(l,e,t){const n=l.slice();return n[21]=e[t].python_type,n[22]=e[t].example_input,n[23]=e[t].parameter_name,n[24]=e[t].parameter_has_default,n[25]=e[t].parameter_default,n[27]=t,n}function Sa(l){let e,t;return e=new Ys({props:{named:l[5],fn_index:l[1]}}),{c(){kt(e.$$.fragment)},m(n,i){yt(e,n,i),t=!0},p(n,i){const s={};i[0]&32&&(s.named=n[5]),i[0]&2&&(s.fn_index=n[1]),e.$set(s)},i(n){t||(Qe(e.$$.fragment,n),t=!0)},o(n){Je(e.$$.fragment,n),t=!1},d(n){wt(e,n)}}}function za(l){let e,t;return e=new Ys({props:{named:l[5],api_name:l[0].api_name}}),{c(){kt(e.$$.fragment)},m(n,i){yt(e,n,i),t=!0},p(n,i){const s={};i[0]&32&&(s.named=n[5]),i[0]&1&&(s.api_name=n[0].api_name),e.$set(s)},i(n){t||(Qe(e.$$.fragment,n),t=!0)},o(n){Je(e.$$.fragment,n),t=!1},d(n){wt(e,n)}}}function La(l){let e,t;return e=new hn({props:{$$slots:{default:[Aa]},$$scope:{ctx:l}}}),{c(){kt(e.$$.fragment)},m(n,i){yt(e,n,i),t=!0},p(n,i){const s={};i[0]&7185|i[1]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Qe(e.$$.fragment,n),t=!0)},o(n){Je(e.$$.fragment,n),t=!1},d(n){wt(e,n)}}}function Na(l){let e,t;return e=new hn({props:{$$slots:{default:[Oa]},$$scope:{ctx:l}}}),{c(){kt(e.$$.fragment)},m(n,i){yt(e,n,i),t=!0},p(n,i){const s={};i[0]&639|i[1]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Qe(e.$$.fragment,n),t=!0)},o(n){Je(e.$$.fragment,n),t=!1},d(n){wt(e,n)}}}function ja(l){let e,t;return e=new hn({props:{$$slots:{default:[Fa]},$$scope:{ctx:l}}}),{c(){kt(e.$$.fragment)},m(n,i){yt(e,n,i),t=!0},p(n,i){const s={};i[0]&349|i[1]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Qe(e.$$.fragment,n),t=!0)},o(n){Je(e.$$.fragment,n),t=!1},d(n){wt(e,n)}}}function zi(l){let e;return{c(){e=L(",")},m(t,n){H(t,e,n)},d(t){t&&G(e)}}}function Li(l){let e,t=Ze(l[22],l[21].type,"bash")+"",n,i,s=l[27]<l[4].length-1&&zi();return{c(){e=L(` 18 `),n=L(t),s&&s.c(),i=Ks()},m(o,a){H(o,e,a),H(o,n,a),s&&s.m(o,a),H(o,i,a)},p(o,a){a[0]&16&&t!==(t=Ze(o[22],o[21].type,"bash")+"")&&be(n,t),o[27]<o[4].length-1?s||(s=zi(),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(o){o&&(G(e),G(n),G(i)),s&&s.d(o)}}}function Aa(l){let e,t,n,i,s,o,a,c,r,_,u=l[0].api_name+"",m,p,b="{",d,$,f,k="}",y,g,w="{",v,h,E="}",S,C,z,A,N,M=l[0].api_name+"",W,ke,K;n=new _t({props:{code:l[10]?.innerText}});let V=ht(l[4]),te=[];for(let U=0;U<V.length;U+=1)te[U]=Li(Ci(l,V,U));return{c(){e=re("code"),t=re("div"),kt(n.$$.fragment),i=xn(),s=re("div"),o=re("pre"),a=L("curl -X POST "),c=L(l[11]),r=L(l[12]),_=L("/call/"),m=L(u),p=L(` -s -H "Content-Type: application/json" -d '`),d=L(b),$=L(` 19 "data": [`);for(let U=0;U<te.length;U+=1)te[U].c();f=L(` 20]`),y=L(k),g=L(`' \\ 21 | awk -F'"' '`),v=L(w),h=L(" print $4"),S=L(E),C=L(`' \\ 22 | read EVENT_ID; curl -N `),z=L(l[11]),A=L(l[12]),N=L("/call/"),W=L(M),ke=L("/$EVENT_ID"),fe(t,"class","copy svelte-114qcyq"),fe(o,"class","svelte-114qcyq"),fe(e,"class","svelte-114qcyq")},m(U,ie){H(U,e,ie),j(e,t),yt(n,t,null),j(e,i),j(e,s),j(s,o),j(o,a),j(o,c),j(o,r),j(o,_),j(o,m),j(o,p),j(o,d),j(o,$);for(let Ce=0;Ce<te.length;Ce+=1)te[Ce]&&te[Ce].m(o,null);j(o,f),j(o,y),j(o,g),j(o,v),j(o,h),j(o,S),j(o,C),j(o,z),j(o,A),j(o,N),j(o,W),j(o,ke),l[19](s),K=!0},p(U,ie){const Ce={};if(ie[0]&1024&&(Ce.code=U[10]?.innerText),n.$set(Ce),(!K||ie[0]&2048)&&be(c,U[11]),(!K||ie[0]&4096)&&be(r,U[12]),(!K||ie[0]&1)&&u!==(u=U[0].api_name+"")&&be(m,u),ie[0]&16){V=ht(U[4]);let Te;for(Te=0;Te<V.length;Te+=1){const kn=Ci(U,V,Te);te[Te]?te[Te].p(kn,ie):(te[Te]=Li(kn),te[Te].c(),te[Te].m(o,f))}for(;Te<te.length;Te+=1)te[Te].d(1);te.length=V.length}(!K||ie[0]&2048)&&be(z,U[11]),(!K||ie[0]&4096)&&be(A,U[12]),(!K||ie[0]&1)&&M!==(M=U[0].api_name+"")&&be(W,M)},i(U){K||(Qe(n.$$.fragment,U),K=!0)},o(U){Je(n.$$.fragment,U),K=!1},d(U){U&&G(e),wt(n),Rn(te,U),l[19](null)}}}function Ni(l){let e,t,n,i=l[22].url+"",s,o,a=l[30]+"",c,r,_,u;return{c(){e=L(` 23const response_`),t=L(l[27]),n=L(' = await fetch("'),s=L(i),o=L(`"); 24const example`),c=L(a),r=L(" = await response_"),_=L(l[27]),u=L(`.blob(); 25 `)},m(m,p){H(m,e,p),H(m,t,p),H(m,n,p),H(m,s,p),H(m,o,p),H(m,c,p),H(m,r,p),H(m,_,p),H(m,u,p)},p:qa,d(m){m&&(G(e),G(t),G(n),G(s),G(o),G(c),G(r),G(_),G(u))}}}function ji(l){let e,t,n;return{c(){e=L(', {auth: ["'),t=L(l[6]),n=L('", **password**]}')},m(i,s){H(i,e,s),H(i,t,s),H(i,n,s)},p(i,s){s[0]&64&&be(t,i[6])},d(i){i&&(G(e),G(t),G(n))}}}function Ta(l){let e;return{c(){e=L(l[1])},m(t,n){H(t,e,n)},p(t,n){n[0]&2&&be(e,t[1])},d(t){t&&G(e)}}}function Ma(l){let e,t,n=l[0].api_name+"",i,s;return{c(){e=re("span"),t=L('"/'),i=L(n),s=L('"'),fe(e,"class","api-name svelte-114qcyq")},m(o,a){H(o,e,a),j(e,t),j(e,i),j(e,s)},p(o,a){a[0]&1&&n!==(n=o[0].api_name+"")&&be(i,n)},d(o){o&&G(e)}}}function Pa(l){let e,t,n=l[23]+"",i,s,o=Ze(l[22],l[21].type,"js")+"",a,c;return{c(){e=L(` 26 `),t=re("span"),i=L(n),s=L(": "),a=L(o),c=L(", "),fe(t,"class","example-inputs")},m(r,_){H(r,e,_),H(r,t,_),j(t,i),j(t,s),j(t,a),H(r,c,_)},p(r,_){_[0]&16&&n!==(n=r[23]+"")&&be(i,n),_[0]&16&&o!==(o=Ze(r[22],r[21].type,"js")+"")&&be(a,o)},d(r){r&&(G(e),G(t),G(c))}}}function Ia(l){let e,t,n=l[23]+"",i,s,o=l[30]+"",a,c,r;return{c(){e=L(` 27 `),t=re("span"),i=L(n),s=L(": example"),a=L(o),c=L(", "),r=re("span"),r.innerHTML="",fe(t,"class","example-inputs"),fe(r,"class","desc svelte-114qcyq")},m(_,u){H(_,e,u),H(_,t,u),j(t,i),j(t,s),j(t,a),H(_,c,u),H(_,r,u)},p(_,u){u[0]&16&&n!==(n=_[23]+"")&&be(i,n),u[0]&16&&o!==(o=_[30]+"")&&be(a,o)},d(_){_&&(G(e),G(t),G(c),G(r))}}}function Ai(l){let e,t;function n(o,a){return a[0]&16&&(e=null),e==null&&(e=!!o[14].includes(o[30])),e?Ia:Pa}let i=n(l,[-1,-1]),s=i(l);return{c(){s.c(),t=Ks()},m(o,a){s.m(o,a),H(o,t,a)},p(o,a){i===(i=n(o,a))&&s?s.p(o,a):(s.d(1),s=i(o),s&&(s.c(),s.m(t.parentNode,t)))},d(o){o&&G(t),s.d(o)}}}function Oa(l){let e,t,n,i,s,o,a,c,r,_,u=(l[3]||l[2])+"",m,p,b,d,$,f;n=new _t({props:{code:l[9]?.innerText}});let k=ht(l[15]),y=[];for(let C=0;C<k.length;C+=1)y[C]=Ni(Ei(l,k,C));let g=l[6]!==null&&ji(l);function w(C,z){return C[5]?Ma:Ta}let v=w(l),h=v(l),E=ht(l[4]),S=[];for(let C=0;C<E.length;C+=1)S[C]=Ai(qi(l,E,C));return{c(){e=re("code"),t=re("div"),kt(n.$$.fragment),i=xn(),s=re("div"),o=re("pre"),a=L(`import { Client } from "@gradio/client"; 28`);for(let C=0;C<y.length;C+=1)y[C].c();c=L(` 29const client = await Client.connect(`),r=re("span"),_=L('"'),m=L(u),p=L('"'),g&&g.c(),b=L(`); 30const result = await client.predict(`),h.c(),d=L(", { ");for(let C=0;C<S.length;C+=1)S[C].c();$=L(` 31}); 32 33console.log(result.data); 34`),fe(t,"class","copy svelte-114qcyq"),fe(r,"class","token string svelte-114qcyq"),fe(o,"class","svelte-114qcyq"),fe(e,"class","svelte-114qcyq")},m(C,z){H(C,e,z),j(e,t),yt(n,t,null),j(e,i),j(e,s),j(s,o),j(o,a);for(let A=0;A<y.length;A+=1)y[A]&&y[A].m(o,null);j(o,c),j(o,r),j(r,_),j(r,m),j(r,p),g&&g.m(o,null),j(o,b),h.m(o,null),j(o,d);for(let A=0;A<S.length;A+=1)S[A]&&S[A].m(o,null);j(o,$),l[18](s),f=!0},p(C,z){const A={};if(z[0]&512&&(A.code=C[9]?.innerText),n.$set(A),z[0]&32768){k=ht(C[15]);let N;for(N=0;N<k.length;N+=1){const M=Ei(C,k,N);y[N]?y[N].p(M,z):(y[N]=Ni(M),y[N].c(),y[N].m(o,c))}for(;N<y.length;N+=1)y[N].d(1);y.length=k.length}if((!f||z[0]&12)&&u!==(u=(C[3]||C[2])+"")&&be(m,u),C[6]!==null?g?g.p(C,z):(g=ji(C),g.c(),g.m(o,b)):g&&(g.d(1),g=null),v===(v=w(C))&&h?h.p(C,z):(h.d(1),h=v(C),h&&(h.c(),h.m(o,d))),z[0]&16400){E=ht(C[4]);let N;for(N=0;N<E.length;N+=1){const M=qi(C,E,N);S[N]?S[N].p(M,z):(S[N]=Ai(M),S[N].c(),S[N].m(o,$))}for(;N<S.length;N+=1)S[N].d(1);S.length=E.length}},i(C){f||(Qe(n.$$.fragment,C),f=!0)},o(C){Je(n.$$.fragment,C),f=!1},d(C){C&&G(e),wt(n),Rn(y,C),g&&g.d(),h.d(),Rn(S,C),l[18](null)}}}function Da(l){let e;return{c(){e=L(", handle_file")},m(t,n){H(t,e,n)},d(t){t&&G(e)}}}function Ti(l){let e,t,n;return{c(){e=L(', auth=("'),t=L(l[6]),n=L('", **password**)')},m(i,s){H(i,e,s),H(i,t,s),H(i,n,s)},p(i,s){s[0]&64&&be(t,i[6])},d(i){i&&(G(e),G(t),G(n))}}}function Mi(l){let e,t=l[23]?l[23]+"=":"",n,i,s=Ze(l[24]?l[25]:l[22],l[21].type,"py")+"",o,a;return{c(){e=L(` 35 `),n=L(t),i=re("span"),o=L(s),a=L(",")},m(c,r){H(c,e,r),H(c,n,r),H(c,i,r),j(i,o),H(c,a,r)},p(c,r){r[0]&16&&t!==(t=c[23]?c[23]+"=":"")&&be(n,t),r[0]&16&&s!==(s=Ze(c[24]?c[25]:c[22],c[21].type,"py")+"")&&be(o,s)},d(c){c&&(G(e),G(n),G(i),G(a))}}}function Fa(l){let e,t,n,i,s,o,a,c,r,_,u,m,p,b=(l[3]||l[2])+"",d,$,f,k,y,g,w,v,h=l[0].api_name+"",E,S,C,z,A,N;n=new _t({props:{code:l[8]?.innerText}});let M=l[13]&&Da(),W=l[6]!==null&&Ti(l),ke=ht(l[4]),K=[];for(let V=0;V<ke.length;V+=1)K[V]=Mi(Si(l,ke,V));return{c(){e=re("code"),t=re("div"),kt(n.$$.fragment),i=xn(),s=re("div"),o=re("pre"),a=re("span"),a.textContent="from",c=L(" gradio_client "),r=re("span"),r.textContent="import",_=L(" Client"),M&&M.c(),u=L(` 36 37client = Client(`),m=re("span"),p=L('"'),d=L(b),$=L('"'),W&&W.c(),f=L(`) 38result = client.`),k=re("span"),k.textContent="predict",y=L("(");for(let V=0;V<K.length;V+=1)K[V].c();g=L(` 39 api_name=`),w=re("span"),v=L('"/'),E=L(h),S=L('"'),C=L(` 40) 41`),z=re("span"),z.textContent="print",A=L("(result)"),fe(t,"class","copy svelte-114qcyq"),fe(a,"class","highlight"),fe(r,"class","highlight"),fe(m,"class","token string svelte-114qcyq"),fe(k,"class","highlight"),fe(w,"class","api-name svelte-114qcyq"),fe(z,"class","highlight"),fe(o,"class","svelte-114qcyq"),fe(e,"class","svelte-114qcyq")},m(V,te){H(V,e,te),j(e,t),yt(n,t,null),j(e,i),j(e,s),j(s,o),j(o,a),j(o,c),j(o,r),j(o,_),M&&M.m(o,null),j(o,u),j(o,m),j(m,p),j(m,d),j(m,$),W&&W.m(o,null),j(o,f),j(o,k),j(o,y);for(let U=0;U<K.length;U+=1)K[U]&&K[U].m(o,null);j(o,g),j(o,w),j(w,v),j(w,E),j(w,S),j(o,C),j(o,z),j(o,A),l[17](s),N=!0},p(V,te){const U={};if(te[0]&256&&(U.code=V[8]?.innerText),n.$set(U),(!N||te[0]&12)&&b!==(b=(V[3]||V[2])+"")&&be(d,b),V[6]!==null?W?W.p(V,te):(W=Ti(V),W.c(),W.m(o,f)):W&&(W.d(1),W=null),te[0]&16){ke=ht(V[4]);let ie;for(ie=0;ie<ke.length;ie+=1){const Ce=Si(V,ke,ie);K[ie]?K[ie].p(Ce,te):(K[ie]=Mi(Ce),K[ie].c(),K[ie].m(o,g))}for(;ie<K.length;ie+=1)K[ie].d(1);K.length=ke.length}(!N||te[0]&1)&&h!==(h=V[0].api_name+"")&&be(E,h)},i(V){N||(Qe(n.$$.fragment,V),N=!0)},o(V){Je(n.$$.fragment,V),N=!1},d(V){V&&G(e),wt(n),M&&M.d(),W&&W.d(),Rn(K,V),l[17](null)}}}function Ua(l){let e,t,n,i,s,o,a;const c=[za,Sa],r=[];function _(b,d){return b[5]?0:1}t=_(l),n=r[t]=c[t](l);const u=[ja,Na,La],m=[];function p(b,d){return b[7]==="python"?0:b[7]==="javascript"?1:b[7]==="bash"?2:-1}return~(s=p(l))&&(o=m[s]=u[s](l)),{c(){e=re("div"),n.c(),i=xn(),o&&o.c(),fe(e,"class","container svelte-114qcyq")},m(b,d){H(b,e,d),r[t].m(e,null),j(e,i),~s&&m[s].m(e,null),a=!0},p(b,d){let $=t;t=_(b),t===$?r[t].p(b,d):(yi(),Je(r[$],1,1,()=>{r[$]=null}),wi(),n=r[t],n?n.p(b,d):(n=r[t]=c[t](b),n.c()),Qe(n,1),n.m(e,i));let f=s;s=p(b),s===f?~s&&m[s].p(b,d):(o&&(yi(),Je(m[f],1,1,()=>{m[f]=null}),wi()),~s?(o=m[s],o?o.p(b,d):(o=m[s]=u[s](b),o.c()),Qe(o,1),o.m(e,null)):o=null)},i(b){a||(Qe(n),Qe(o),a=!0)},o(b){Je(n),Je(o),a=!1},d(b){b&&G(e),r[t].d(),~s&&m[s].d()}}}function Ra(l,e,t){let n,i,{dependency:s}=e,{dependency_index:o}=e,{root:a}=e,{api_prefix:c}=e,{space_id:r}=e,{endpoint_parameters:_}=e,{named:u}=e,{username:m}=e,{current_language:p}=e,b,d,$,f=_.some(h=>Zs(h.example_input)),k=["Audio","File","Image","Video"],y=_.filter(h=>k.includes(h.component));function g(h){ml[h?"unshift":"push"](()=>{b=h,t(8,b)})}function w(h){ml[h?"unshift":"push"](()=>{d=h,t(9,d)})}function v(h){ml[h?"unshift":"push"](()=>{$=h,t(10,$)})}return l.$$set=h=>{"dependency"in h&&t(0,s=h.dependency),"dependency_index"in h&&t(1,o=h.dependency_index),"root"in h&&t(2,a=h.root),"api_prefix"in h&&t(16,c=h.api_prefix),"space_id"in h&&t(3,r=h.space_id),"endpoint_parameters"in h&&t(4,_=h.endpoint_parameters),"named"in h&&t(5,u=h.named),"username"in h&&t(6,m=h.username),"current_language"in h&&t(7,p=h.current_language)},l.$$.update=()=>{l.$$.dirty[0]&65536&&t(12,n=c||"/"),l.$$.dirty[0]&4&&t(11,i=a.replace(/\/$/,""))},[s,o,a,r,_,u,m,p,b,d,$,i,n,f,k,y,c,g,w,v]}class Ba extends ya{constructor(e){super(),Ca(this,e,Ra,Ua,Ea,{dependency:0,dependency_index:1,root:2,api_prefix:16,space_id:3,endpoint_parameters:4,named:5,username:6,current_language:7},null,[-1,-1])}get dependency(){return this.$$.ctx[0]}set dependency(e){this.$$set({dependency:e}),at()}get dependency_index(){return this.$$.ctx[1]}set dependency_index(e){this.$$set({dependency_index:e}),at()}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),at()}get api_prefix(){return this.$$.ctx[16]}set api_prefix(e){this.$$set({api_prefix:e}),at()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),at()}get endpoint_parameters(){return this.$$.ctx[4]}set endpoint_parameters(e){this.$$set({endpoint_parameters:e}),at()}get named(){return this.$$.ctx[5]}set named(e){this.$$set({named:e}),at()}get username(){return this.$$.ctx[6]}set username(e){this.$$set({username:e}),at()}get current_language(){return this.$$.ctx[7]}set current_language(e){this.$$set({current_language:e}),at()}}const{SvelteComponent:Ga,append:T,attr:Se,binding_callbacks:hl,check_outros:Ha,create_component:el,destroy_component:tl,destroy_each:Hl,detach:de,element:pe,empty:Va,ensure_array_like:Jt,flush:Et,group_outros:Wa,init:Za,insert:me,mount_component:nl,safe_not_equal:Qa,set_data:Ve,space:ll,text:O,transition_in:Yt,transition_out:Kt}=window.__gradio__svelte__internal,{onMount:Ja,tick:Ya}=window.__gradio__svelte__internal;function Pi(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function Ii(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function Oi(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function Ka(l){let e,t,n,i,s,o;n=new _t({props:{code:l[6]?.innerText}});let a=Jt(l[9]),c=[];for(let r=0;r<a.length;r+=1)c[r]=Di(Pi(l,a,r));return{c(){e=pe("code"),t=pe("div"),el(n.$$.fragment),i=ll(),s=pe("div");for(let r=0;r<c.length;r+=1)c[r].c();Se(t,"class","copy svelte-j71ub0"),Se(e,"class","svelte-j71ub0")},m(r,_){me(r,e,_),T(e,t),nl(n,t,null),T(e,i),T(e,s);for(let u=0;u<c.length;u+=1)c[u]&&c[u].m(s,null);l[16](s),o=!0},p(r,_){const u={};if(_&64&&(u.code=r[6]?.innerText),n.$set(u),_&513){a=Jt(r[9]);let m;for(m=0;m<a.length;m+=1){const p=Pi(r,a,m);c[m]?c[m].p(p,_):(c[m]=Di(p),c[m].c(),c[m].m(s,null))}for(;m<c.length;m+=1)c[m].d(1);c.length=a.length}},i(r){o||(Yt(n.$$.fragment,r),o=!0)},o(r){Kt(n.$$.fragment,r),o=!1},d(r){r&&de(e),tl(n),Hl(c,r),l[16](null)}}}function Xa(l){let e,t,n,i,s,o,a,c,r,_,u,m,p;n=new _t({props:{code:l[5]?.innerText}});let b=l[2]!==null&&Fi(l),d=Jt(l[8]),$=[];for(let f=0;f<d.length;f+=1)$[f]=Ri(Ii(l,d,f));return{c(){e=pe("code"),t=pe("div"),el(n.$$.fragment),i=ll(),s=pe("div"),o=pe("pre"),a=O(`import { Client } from "@gradio/client"; 42 43const app = await Client.connect(`),c=pe("span"),r=O('"'),_=O(l[0]),u=O('"'),b&&b.c(),m=O(`); 44 `);for(let f=0;f<$.length;f+=1)$[f].c();Se(t,"class","copy svelte-j71ub0"),Se(c,"class","token string svelte-j71ub0"),Se(o,"class","svelte-j71ub0"),Se(e,"class","svelte-j71ub0")},m(f,k){me(f,e,k),T(e,t),nl(n,t,null),T(e,i),T(e,s),T(s,o),T(o,a),T(o,c),T(c,r),T(c,_),T(c,u),b&&b.m(o,null),T(o,m);for(let y=0;y<$.length;y+=1)$[y]&&$[y].m(o,null);l[15](s),p=!0},p(f,k){const y={};if(k&32&&(y.code=f[5]?.innerText),n.$set(y),(!p||k&1)&&Ve(_,f[0]),f[2]!==null?b?b.p(f,k):(b=Fi(f),b.c(),b.m(o,m)):b&&(b.d(1),b=null),k&256){d=Jt(f[8]);let g;for(g=0;g<d.length;g+=1){const w=Ii(f,d,g);$[g]?$[g].p(w,k):($[g]=Ri(w),$[g].c(),$[g].m(o,null))}for(;g<$.length;g+=1)$[g].d(1);$.length=d.length}},i(f){p||(Yt(n.$$.fragment,f),p=!0)},o(f){Kt(n.$$.fragment,f),p=!1},d(f){f&&de(e),tl(n),b&&b.d(),Hl($,f),l[15](null)}}}function xa(l){let e,t,n,i,s,o,a,c,r,_,u,m,p,b,d,$;n=new _t({props:{code:l[4]}});let f=l[2]!==null&&Bi(l),k=Jt(l[7]),y=[];for(let g=0;g<k.length;g+=1)y[g]=Gi(Oi(l,k,g));return{c(){e=pe("code"),t=pe("div"),el(n.$$.fragment),i=ll(),s=pe("div"),o=pe("pre"),a=pe("span"),a.textContent="from",c=O(" gradio_client "),r=pe("span"),r.textContent="import",_=O(` Client, file 45 46client = Client(`),u=pe("span"),m=O('"'),p=O(l[0]),b=O('"'),f&&f.c(),d=O(`) 47`);for(let g=0;g<y.length;g+=1)y[g].c();Se(t,"class","copy svelte-j71ub0"),Se(a,"class","highlight"),Se(r,"class","highlight"),Se(u,"class","token string svelte-j71ub0"),Se(o,"class","svelte-j71ub0"),Se(e,"class","svelte-j71ub0")},m(g,w){me(g,e,w),T(e,t),nl(n,t,null),T(e,i),T(e,s),T(s,o),T(o,a),T(o,c),T(o,r),T(o,_),T(o,u),T(u,m),T(u,p),T(u,b),f&&f.m(o,null),T(o,d);for(let v=0;v<y.length;v+=1)y[v]&&y[v].m(o,null);l[14](s),$=!0},p(g,w){const v={};if(w&16&&(v.code=g[4]),n.$set(v),(!$||w&1)&&Ve(p,g[0]),g[2]!==null?f?f.p(g,w):(f=Bi(g),f.c(),f.m(o,d)):f&&(f.d(1),f=null),w&128){k=Jt(g[7]);let h;for(h=0;h<k.length;h+=1){const E=Oi(g,k,h);y[h]?y[h].p(E,w):(y[h]=Gi(E),y[h].c(),y[h].m(o,null))}for(;h<y.length;h+=1)y[h].d(1);y.length=k.length}},i(g){$||(Yt(n.$$.fragment,g),$=!0)},o(g){Kt(n.$$.fragment,g),$=!1},d(g){g&&de(e),tl(n),f&&f.d(),Hl(y,g),l[14](null)}}}function Di(l){let e,t,n,i,s=l[21]+"",o,a,c="{",r,_,u=l[20]+"",m,p,b="}",d,$,f="{",k,y,g="}",w,v,h,E,S=l[21]+"",C,z,A,N;return{c(){e=pe("pre"),t=O("curl -X POST "),n=O(l[0]),i=O("call/"),o=O(s),a=O(` -s -H "Content-Type: application/json" -d '`),r=O(c),_=O(` 48 "data": [`),m=O(u),p=O("]"),d=O(b),$=O(`' \\ 49 | awk -F'"' '`),k=O(f),y=O(" print $4"),w=O(g),v=O(`' \\ 50 | read EVENT_ID; curl -N `),h=O(l[0]),E=O("call/"),C=O(S),z=O("/$EVENT_ID"),A=ll(),N=pe("br"),Se(e,"class","svelte-j71ub0")},m(M,W){me(M,e,W),T(e,t),T(e,n),T(e,i),T(e,o),T(e,a),T(e,r),T(e,_),T(e,m),T(e,p),T(e,d),T(e,$),T(e,k),T(e,y),T(e,w),T(e,v),T(e,h),T(e,E),T(e,C),T(e,z),me(M,A,W),me(M,N,W)},p(M,W){W&1&&Ve(n,M[0]),W&512&&s!==(s=M[21]+"")&&Ve(o,s),W&512&&u!==(u=M[20]+"")&&Ve(m,u),W&1&&Ve(h,M[0]),W&512&&S!==(S=M[21]+"")&&Ve(C,S)},d(M){M&&(de(e),de(A),de(N))}}}function Fi(l){let e,t,n;return{c(){e=O(', {auth: ["'),t=O(l[2]),n=O('", **password**]}')},m(i,s){me(i,e,s),me(i,t,s),me(i,n,s)},p(i,s){s&4&&Ve(t,i[2])},d(i){i&&(de(e),de(t),de(n))}}}function Ui(l){let e,t=l[20]+"",n;return{c(){e=O(", "),n=O(t)},m(i,s){me(i,e,s),me(i,n,s)},p(i,s){s&256&&t!==(t=i[20]+"")&&Ve(n,t)},d(i){i&&(de(e),de(n))}}}function Ri(l){let e,t,n,i=l[21]+"",s,o,a,c=l[20]&&Ui(l);return{c(){e=O(` 51await client.predict(`),t=pe("span"),n=O(` 52 "/`),s=O(i),o=O('"'),c&&c.c(),a=O(`); 53 `),Se(t,"class","api-name svelte-j71ub0")},m(r,_){me(r,e,_),me(r,t,_),T(t,n),T(t,s),T(t,o),c&&c.m(r,_),me(r,a,_)},p(r,_){_&256&&i!==(i=r[21]+"")&&Ve(s,i),r[20]?c?c.p(r,_):(c=Ui(r),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(r){r&&(de(e),de(t),de(a)),c&&c.d(r)}}}function Bi(l){let e,t,n;return{c(){e=O(', auth=("'),t=O(l[2]),n=O('", **password**)')},m(i,s){me(i,e,s),me(i,t,s),me(i,n,s)},p(i,s){s&4&&Ve(t,i[2])},d(i){i&&(de(e),de(t),de(n))}}}function Gi(l){let e,t,n,i=l[20]+"",s,o,a,c,r=l[21]+"",_,u,m;return{c(){e=O(` 54client.`),t=pe("span"),n=O(`predict( 55`),s=O(i),o=O(" api_name="),a=pe("span"),c=O('"/'),_=O(r),u=O('"'),m=O(` 56) 57`),Se(a,"class","api-name svelte-j71ub0"),Se(t,"class","highlight")},m(p,b){me(p,e,b),me(p,t,b),T(t,n),T(t,s),T(t,o),T(t,a),T(a,c),T(a,_),T(a,u),T(t,m)},p(p,b){b&128&&i!==(i=p[20]+"")&&Ve(s,i),b&128&&r!==(r=p[21]+"")&&Ve(_,r)},d(p){p&&(de(e),de(t))}}}function ec(l){let e,t,n,i;const s=[xa,Xa,Ka],o=[];function a(c,r){return c[1]==="python"?0:c[1]==="javascript"?1:c[1]==="bash"?2:-1}return~(e=a(l))&&(t=o[e]=s[e](l)),{c(){t&&t.c(),n=Va()},m(c,r){~e&&o[e].m(c,r),me(c,n,r),i=!0},p(c,r){let _=e;e=a(c),e===_?~e&&o[e].p(c,r):(t&&(Wa(),Kt(o[_],1,1,()=>{o[_]=null}),Ha()),~e?(t=o[e],t?t.p(c,r):(t=o[e]=s[e](c),t.c()),Yt(t,1),t.m(n.parentNode,n)):t=null)},i(c){i||(Yt(t),i=!0)},o(c){Kt(t),i=!1},d(c){c&&de(n),~e&&o[e].d(c)}}}function tc(l){let e,t,n;return t=new hn({props:{border_mode:"focus",$$slots:{default:[ec]},$$scope:{ctx:l}}}),{c(){e=pe("div"),el(t.$$.fragment),Se(e,"class","container svelte-j71ub0")},m(i,s){me(i,e,s),nl(t,e,null),n=!0},p(i,[s]){const o={};s&268436479&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(Yt(t.$$.fragment,i),n=!0)},o(i){Kt(t.$$.fragment,i),n=!1},d(i){i&&de(e),tl(t)}}}function nc(l,e,t){let{dependencies:n}=e,{short_root:i}=e,{root:s}=e,{api_prefix:o=""}=e,{current_language:a}=e,{username:c}=e,r,_,u,m,{api_calls:p=[]}=e;async function b(){return await(await fetch(s.replace(/\/$/,"")+o+"/info/?all_endpoints=true")).json()}let d,$=[],f=[],k=[];function y(h,E){const S=`/${n[h.fn_index].api_name}`,z=h.data.filter(A=>typeof A<"u").map((A,N)=>{if(d[S]){const M=d[S].parameters[N];if(!M)return;const W=M.parameter_name,ke=M.python_type.type;if(E==="py")return` ${W}=${Ze(A,ke,"py")}`;if(E==="js")return` ${W}: ${Ze(A,ke,"js")}`;if(E==="bash")return` ${Ze(A,ke,"bash")}`}return` ${Ze(A,void 0,E)}`}).filter(A=>typeof A<"u").join(`, 58`);if(z){if(E==="py")return`${z}, 59`;if(E==="js")return`{ 60${z}, 61}`;if(E==="bash")return` 62${z} 63`}return E==="py"?"":` 64`}Ja(async()=>{d=(await b()).named_endpoints;let E=p.map(A=>y(A,"py")),S=p.map(A=>y(A,"js")),C=p.map(A=>y(A,"bash")),z=p.map(A=>n[A.fn_index].api_name||"");t(7,$=E.map((A,N)=>({call:A,api_name:z[N]}))),t(8,f=S.map((A,N)=>({call:A,api_name:z[N]}))),t(9,k=C.map((A,N)=>({call:A,api_name:z[N]}))),await Ya(),t(4,_=r.innerText)});function g(h){hl[h?"unshift":"push"](()=>{r=h,t(3,r)})}function w(h){hl[h?"unshift":"push"](()=>{u=h,t(5,u)})}function v(h){hl[h?"unshift":"push"](()=>{m=h,t(6,m)})}return l.$$set=h=>{"dependencies"in h&&t(10,n=h.dependencies),"short_root"in h&&t(0,i=h.short_root),"root"in h&&t(11,s=h.root),"api_prefix"in h&&t(12,o=h.api_prefix),"current_language"in h&&t(1,a=h.current_language),"username"in h&&t(2,c=h.username),"api_calls"in h&&t(13,p=h.api_calls)},[i,a,c,r,_,u,m,$,f,k,n,s,o,p,g,w,v]}class lc extends Ga{constructor(e){super(),Za(this,e,nc,tc,Qa,{dependencies:10,short_root:0,root:11,api_prefix:12,current_language:1,username:2,api_calls:13})}get dependencies(){return this.$$.ctx[10]}set dependencies(e){this.$$set({dependencies:e}),Et()}get short_root(){return this.$$.ctx[0]}set short_root(e){this.$$set({short_root:e}),Et()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),Et()}get api_prefix(){return this.$$.ctx[12]}set api_prefix(e){this.$$set({api_prefix:e}),Et()}get current_language(){return this.$$.ctx[1]}set current_language(e){this.$$set({current_language:e}),Et()}get username(){return this.$$.ctx[2]}set username(e){this.$$set({username:e}),Et()}get api_calls(){return this.$$.ctx[13]}set api_calls(e){this.$$set({api_calls:e}),Et()}}const ic="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20focusable='false'%20role='img'%20width='1em'%20height='1em'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%2032%2032'%20%3e%3cpath%20d='M15.84.5a16.4,16.4,0,0,0-3.57.32C9.1,1.39,8.53,2.53,8.53,4.64V7.48H16v1H5.77a4.73,4.73,0,0,0-4.7,3.74,14.82,14.82,0,0,0,0,7.54c.57,2.28,1.86,3.82,4,3.82h2.6V20.14a4.73,4.73,0,0,1,4.63-4.63h7.38a3.72,3.72,0,0,0,3.73-3.73V4.64A4.16,4.16,0,0,0,19.65.82,20.49,20.49,0,0,0,15.84.5ZM11.78,2.77a1.39,1.39,0,0,1,1.38,1.46,1.37,1.37,0,0,1-1.38,1.38A1.42,1.42,0,0,1,10.4,4.23,1.44,1.44,0,0,1,11.78,2.77Z'%20fill='%235a9fd4'%20%3e%3c/path%3e%3cpath%20d='M16.16,31.5a16.4,16.4,0,0,0,3.57-.32c3.17-.57,3.74-1.71,3.74-3.82V24.52H16v-1H26.23a4.73,4.73,0,0,0,4.7-3.74,14.82,14.82,0,0,0,0-7.54c-.57-2.28-1.86-3.82-4-3.82h-2.6v3.41a4.73,4.73,0,0,1-4.63,4.63H12.35a3.72,3.72,0,0,0-3.73,3.73v7.14a4.16,4.16,0,0,0,3.73,3.82A20.49,20.49,0,0,0,16.16,31.5Zm4.06-2.27a1.39,1.39,0,0,1-1.38-1.46,1.37,1.37,0,0,1,1.38-1.38,1.42,1.42,0,0,1,1.38,1.38A1.44,1.44,0,0,1,20.22,29.23Z'%20fill='%23ffd43b'%20%3e%3c/path%3e%3c/svg%3e",sc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20focusable='false'%20role='img'%20width='1em'%20height='1em'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%2032%2032'%20%3e%3crect%20width='32'%20height='32'%20fill='%23f7df1e'%3e%3c/rect%3e%3cpath%20d='M21.5,25a3.27,3.27,0,0,0,3,1.83c1.25,0,2-.63,2-1.49,0-1-.81-1.39-2.19-2L23.56,23C21.39,22.1,20,20.94,20,18.49c0-2.25,1.72-4,4.41-4a4.44,4.44,0,0,1,4.27,2.41l-2.34,1.5a2,2,0,0,0-1.93-1.29,1.31,1.31,0,0,0-1.44,1.29c0,.9.56,1.27,1.85,1.83l.75.32c2.55,1.1,4,2.21,4,4.72,0,2.71-2.12,4.19-5,4.19a5.78,5.78,0,0,1-5.48-3.07Zm-10.63.26c.48.84.91,1.55,1.94,1.55s1.61-.39,1.61-1.89V14.69h3V25c0,3.11-1.83,4.53-4.49,4.53a4.66,4.66,0,0,1-4.51-2.75Z'%20%3e%3c/path%3e%3c/svg%3e",oc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20version='1.1'%20id='Layer_1'%20x='0px'%20y='0px'%20viewBox='0%200%20150%20150'%20style='enable-background:new%200%200%20150%20150;%20background-color:%20%2372a824;'%20xml:space='preserve'%3e%3cscript%20xmlns=''/%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23FFFFFF;}%20%3c/style%3e%3cg%3e%3cpath%20class='st0'%20d='M118.9,40.3L81.7,18.2c-2.2-1.3-4.7-2-7.2-2s-5,0.7-7.2,2L30.1,40.3c-4.4,2.6-7.2,7.5-7.2,12.8v44.2%20c0,5.3,2.7,10.1,7.2,12.8l37.2,22.1c2.2,1.3,4.7,2,7.2,2c2.5,0,5-0.7,7.2-2l37.2-22.1c4.4-2.6,7.2-7.5,7.2-12.8V53%20C126.1,47.8,123.4,42.9,118.9,40.3z%20M90.1,109.3l0.1,3.2c0,0.4-0.2,0.8-0.5,1l-1.9,1.1c-0.3,0.2-0.5,0-0.6-0.4l0-3.1%20c-1.
646,0.7-3.2,0.8-4.3,0.4c-0.2-0.1-0.3-0.4-0.2-0.7l0.7-2.9c0.1-0.2,0.2-0.5,0.3-0.6c0.1-0.1,0.1-0.1,0.2-0.1%20c0.1-0.1,0.2-0.1,0.3,0c1.1,0.4,2.6,0.2,3.9-0.5c1.8-0.9,2.9-2.7,2.9-4.5c0-1.6-0.9-2.3-3-2.3c-2.7,0-5.2-0.5-5.3-4.5%20c0-3.3,1.7-6.7,4.4-8.8l0-3.2c0-0.4,0.2-0.8,0.5-1l1.8-1.2c0.3-0.2,0.5,0,0.6,0.4l0,3.2c1.3-0.5,2.5-0.7,3.6-0.4%20c0.2,0.1,0.3,0.4,0.2,0.7l-0.7,2.8c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.2,0.1-0.3,0%20c-0.5-0.1-1.6-0.4-3.4,0.6c-1.9,1-2.6,2.6-2.5,3.8c0,1.5,0.8,1.9,3.3,1.9c3.4,0.1,4.9,1.6,5,5C94.7,103.4,92.9,107,90.1,109.3z%20M109.6,103.9c0,0.3,0,0.6-0.3,0.7l-9.4,5.7c-0.2,0.1-0.4,0-0.4-0.3v-2.4c0-0.3,0.2-0.5,0.4-0.6l9.3-5.5c0.2-0.1,0.4,0,0.4,0.3%20V103.9z%20M116.1,49.6L80.9,71.3c-4.4,2.6-7.6,5.4-7.6,10.7v43.4c0,3.2,1.3,5.2,3.2,5.8c-0.6,0.1-1.3,0.2-2,0.2%20c-2.1,0-4.1-0.6-5.9-1.6l-37.2-22.1c-3.6-2.2-5.9-6.2-5.9-10.5V53c0-4.3,2.3-8.4,5.9-10.5l37.2-22.1c1.8-1.1,3.8-1.6,5.9-1.6%20s4.1,0.6,5.9,1.6l37.2,22.1c3.1,1.8,5.1,5,5.7,8.5C122.1,48.4,119.3,47.7,116.1,49.6z'/%3e%3c/g%3e%3c/svg%3e",{SvelteComponent:rc,append:Re,attr:Dt,check_outros:ac,create_component:cc,destroy_component:_c,destroy_each:uc,detach:Ne,element:xe,empty:fc,ensure_array_like:Hi,flush:Ln,group_outros:pc,init:dc,insert:je,mount_component:mc,noop:hc,safe_not_equal:gc,set_data:Xt,set_style:bc,space:Bt,text:We,toggle_class:Vi,transition_in:Pn,transition_out:Sl}=window.__gradio__svelte__internal;function Wi(l,e,t){const n=l.slice();return n[4]=e[t].label,n[5]=e[t].type,n[6]=e[t].python_type,n[7]=e[t].component,n[8]=e[t].serializer,n[10]=t,n}function vc(l){let e;return{c(){e=We("1 element")},m(t,n){je(t,e,n)},p:hc,d(t){t&&Ne(e)}}}function $c(l){let e=l[3]=="python"?"tuple":"list",t,n,i=l[1].length+"",s,o;return{c(){t=We(e),n=We(" of "),s=We(i),o=We(` 65 elements`)},m(a,c){je(a,t,c),je(a,n,c),je(a,s,c),je(a,o,c)},p(a,c){c&8&&e!==(e=a[3]=="python"?"tuple":"list")&&Xt(t,e),c&2&&i!==(i=a[1].length+"")&&Xt(s,i)},d(a){a&&(Ne(t),Ne(n),Ne(s),Ne(o))}}}function Zi(l){let e;return{c(){e=xe("span"),e.textContent=`[${l[10]}]`,Dt(e,"class","code svelte-16h224k")},m(t,n){je(t,e,n)},d(t){t&&Ne(e)}}}function kc(l){let e=l[2][l[10]].type+"",t;return{c(){t=We(e)},m(n,i){je(n,t,i)},p(n,i){i&4&&e!==(e=n[2][n[10]].type+"")&&Xt(t,e)},d(n){n&&Ne(t)}}}function wc(l){let e=l[6].type+"",t;return{c(){t=We(e)},m(n,i){je(n,t,i)},p(n,i){i&2&&e!==(e=n[6].type+"")&&Xt(t,e)},d(n){n&&Ne(t)}}}function Qi(l){let e,t,n,i,s,o,a,c,r,_=l[4]+"",u,m,p=l[7]+"",b,d,$,f=l[1].length>1&&Zi(l);function k(w,v){return w[3]==="python"?wc:kc}let y=k(l),g=y(l);return{c(){e=xe("hr"),t=Bt(),n=xe("div"),i=xe("p"),f&&f.c(),s=Bt(),o=xe("span"),g.c(),a=Bt(),c=xe("p"),r=We('The output value that appears in the "'),u=We(_),m=We('" '),b=We(p),d=We(` 66 component.`),$=Bt(),Dt(e,"class","hr svelte-16h224k"),Dt(o,"class","code highlight svelte-16h224k"),Dt(c,"class","desc svelte-16h224k"),bc(n,"margin","10px")},m(w,v){je(w,e,v),je(w,t,v),je(w,n,v),Re(n,i),f&&f.m(i,null),Re(i,s),Re(i,o),g.m(o,null),Re(n,a),Re(n,c),Re(c,r),Re(c,u),Re(c,m),Re(c,b),Re(c,d),Re(n,$)},p(w,v){w[1].length>1?f||(f=Zi(w),f.c(),f.m(i,s)):f&&(f.d(1),f=null),y===(y=k(w))&&g?g.p(w,v):(g.d(1),g=y(w),g&&(g.c(),g.m(o,null))),v&2&&_!==(_=w[4]+"")&&Xt(u,_),v&2&&p!==(p=w[7]+"")&&Xt(b,p)},d(w){w&&(Ne(e),Ne(t),Ne(n)),f&&f.d(),g.d()}}}function Ji(l){let e,t,n;return t=new Vs({props:{margin:!1}}),{c(){e=xe("div"),cc(t.$$.fragment),Dt(e,"class","load-wrap")},m(i,s){je(i,e,s),mc(t,e,null),n=!0},i(i){n||(Pn(t.$$.fragment,i),n=!0)},o(i){Sl(t.$$.fragment,i),n=!1},d(i){i&&Ne(e),_c(t)}}}function yc(l){let e,t,n,i,s,o,a,c;function r(d,$){return d[1].length>1?$c:vc}let _=r(l),u=_(l),m=Hi(l[1]),p=[];for(let d=0;d<m.length;d+=1)p[d]=Qi(Wi(l,m,d));let b=l[0]&&Ji();return{c(){e=xe("h4"),t=xe("div"),t.innerHTML='<div class="toggle-dot toggle-right svelte-16h224k"></div>',n=We(` 67 Returns `),u.c(),i=Bt(),s=xe("div");for(let d=0;d<p.length;d+=1)p[d].c();o=Bt(),b&&b.c(),a=fc(),Dt(t,"class","toggle-icon svelte-16h224k"),Dt(e,"class","svelte-16h224k"),Vi(s,"hide",l[0])},m(d,$){je(d,e,$),Re(e,t),Re(e,n),u.m(e,null),je(d,i,$),je(d,s,$);for(let f=0;f<p.length;f+=1)p[f]&&p[f].m(s,null);je(d,o,$),b&&b.m(d,$),je(d,a,$),c=!0},p(d,[$]){if(_===(_=r(d))&&u?u.p(d,$):(u.d(1),u=_(d),u&&(u.c(),u.m(e,null))),$&14){m=Hi(d[1]);let f;for(f=0;f<m.length;f+=1){const k=Wi(d,m,f);p[f]?p[f].p(k,$):(p[f]=Qi(k),p[f].c(),p[f].m(s,null))}for(;f<p.length;f+=1)p[f].d(1);p.length=m.length}(!c||$&1)&&Vi(s,"hide",d[0]),d[0]?b?$&1&&Pn(b,1):(b=Ji(),b.c(),Pn(b,1),b.m(a.parentNode,a)):b&&(pc(),Sl(b,1,1,()=>{b=null}),ac())},i(d){c||(Pn(b),c=!0)},o(d){Sl(b),c=!1},d(d){d&&(Ne(e),Ne(i),Ne(s),Ne(o),Ne(a)),u.d(),uc(p,d),b&&b.d(d)}}}function Cc(l,e,t){let{is_running:n}=e,{endpoint_returns:i}=e,{js_returns:s}=e,{current_language:o}=e;return l.$$set=a=>{"is_running"in a&&t(0,n=a.is_running),"endpoint_returns"in a&&t(1,i=a.endpoint_returns),"js_returns"in a&&t(2,s=a.js_returns),"current_language"in a&&t(3,o=a.current_language)},[n,i,s,o]}class qc extends rc{constructor(e){super(),dc(this,e,Cc,yc,gc,{is_running:0,endpoint_returns:1,js_returns:2,current_language:3})}get is_running(){return this.$$.ctx[0]}set is_running(e){this.$$set({is_running:e}),Ln()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),Ln()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),Ln()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),Ln()}}const{SvelteComponent:Ec,append:J,attr:Q,bubble:Yi,check_outros:Bn,create_component:gt,destroy_component:bt,destroy_each:Ki,detach:P,element:x,empty:Vl,ensure_array_like:Nn,flush:St,group_outros:Gn,init:Sc,insert:I,listen:zc,mou
vendor: 10,307 bytes, lines 67-94
67nt_component:vt,noop:Xs,safe_not_equal:Lc,set_data:zl,set_style:Nt,space:Ie,src_url_equal:Nc,text:Y,transition_in:ve,transition_out:Ae}=window.__gradio__svelte__internal,{onMount:jc,createEventDispatcher:Ac}=window.__gradio__svelte__internal;function Xi(l,e,t){const n=l.slice();return n[19]=e[t],n[21]=t,n}function xi(l,e,t){const n=l.slice();return n[22]=e[t][0],n[23]=e[t][1],n}function es(l){let e,t,n,i;const s=[Mc,Tc],o=[];function a(c,r){return c[9]?0:1}return e=a(l),t=o[e]=s[e](l),{c(){t.c(),n=Vl()},m(c,r){o[e].m(c,r),I(c,n,r),i=!0},p(c,r){t.p(c,r)},i(c){i||(ve(t),i=!0)},o(c){Ae(t),i=!1},d(c){c&&P(n),o[e].d(c)}}}function Tc(l){let e,t;return e=new _r({props:{root:l[0]}}),e.$on("close",l[16]),{c(){gt(e.$$.fragment)},m(n,i){vt(e,n,i),t=!0},p(n,i){const s={};i&1&&(s.root=n[0]),e.$set(s)},i(n){t||(ve(e.$$.fragment,n),t=!0)},o(n){Ae(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function Mc(l){let e,t,n,i,s,o,a,c,r,_,u,m,p;t=new kr({props:{root:l[3]||l[0],api_count:l[9]}}),t.$on("close",l[13]);let b=Nn(l[10]),d=[];for(let v=0;v<b.length;v+=1)d[v]=ts(xi(l,b,v));const $=[Ic,Pc],f=[];function k(v,h){return v[5].length?0:1}_=k(l),u=f[_]=$[_](l);let y=Nn(l[1]),g=[];for(let v=0;v<y.length;v+=1)g[v]=os(Xi(l,y,v));const w=v=>Ae(g[v],1,1,()=>{g[v]=null});return{c(){e=x("div"),gt(t.$$.fragment),n=Ie(),i=x("div"),s=x("div"),s.innerHTML=`<p style="font-size: var(--text-lg);">Choose a language to see the code snippets for interacting with the 68 API.</p>`,o=Ie(),a=x("div"),c=x("div");for(let v=0;v<d.length;v+=1)d[v].c();r=Ie(),u.c(),m=Ie();for(let v=0;v<g.length;v+=1)g[v].c();Q(e,"class","banner-wrap svelte-1y3yua6"),Q(s,"class","client-doc svelte-1y3yua6"),Q(c,"class","snippets svelte-1y3yua6"),Q(a,"class","endpoint svelte-1y3yua6"),Q(i,"class","docs-wrap svelte-1y3yua6")},m(v,h){I(v,e,h),vt(t,e,null),I(v,n,h),I(v,i,h),J(i,s),J(i,o),J(i,a),J(a,c);for(let E=0;E<d.length;E+=1)d[E]&&d[E].m(c,null);J(a,r),f[_].m(a,null),J(a,m);for(let E=0;E<g.length;E+=1)g[E]&&g[E].m(a,null);p=!0},p(v,h){const E={};if(h&9&&(E.root=v[3]||v[0]),t.$set(E),h&1088){b=Nn(v[10]);let C;for(C=0;C<b.length;C+=1){const z=xi(v,b,C);d[C]?d[C].p(z,h):(d[C]=ts(z),d[C].c(),d[C].m(c,null))}for(;C<d.length;C+=1)d[C].d(1);d.length=b.length}let S=_;if(_=k(v),_===S?f[_].p(v,h):(Gn(),Ae(f[S],1,1,()=>{f[S]=null}),Bn(),u=f[_],u?u.p(v,h):(u=f[_]=$[_](v),u.c()),ve(u,1),u.m(a,m)),h&479){y=Nn(v[1]);let C;for(C=0;C<y.length;C+=1){const z=Xi(v,y,C);g[C]?(g[C].p(z,h),ve(g[C],1)):(g[C]=os(z),g[C].c(),ve(g[C],1),g[C].m(a,null))}for(Gn(),C=y.length;C<g.length;C+=1)w(C);Bn()}},i(v){if(!p){ve(t.$$.fragment,v),ve(u);for(let h=0;h<y.length;h+=1)ve(g[h]);p=!0}},o(v){Ae(t.$$.fragment,v),Ae(u),g=g.filter(Boolean);for(let h=0;h<g.length;h+=1)Ae(g[h]);p=!1},d(v){v&&(P(e),P(n),P(i)),bt(t),Ki(d,v),f[_].d(),Ki(g,v)}}}function ts(l){let e,t,n,i,s=l[22]+"",o,a,c,r,_;function u(){return l[14](l[22])}return{c(){e=x("li"),t=x("img"),i=Ie(),o=Y(s),a=Ie(),Nc(t.src,n=l[23])||Q(t,"src",n),Q(t,"alt",""),Q(t,"class","svelte-1y3yua6"),Q(e,"class",c="snippet "+(l[6]===l[22]?"current-lang":"inactive-lang")+" svelte-1y3yua6")},m(m,p){I(m,e,p),J(e,t),J(e,i),J(e,o),J(e,a),r||(_=zc(e,"click",u),r=!0)},p(m,p){l=m,p&64&&c!==(c="snippet "+(l[6]===l[22]?"current-lang":"inactive-lang")+" svelte-1y3yua6")&&Q(e,"class",c)},d(m){m&&P(e),r=!1,_()}}}function Pc(l){let e,t,n,i,s,o,a,c,r,_;function u($,f){return $[6]=="python"||$[6]=="javascript"?Dc:Oc}let m=u(l),p=m(l);n=new da({props:{current_language:l[6]}});let b=l[3]&&ns(l);c=new Jn({props:{size:"sm",variant:"secondary",$$slots:{default:[Fc]},$$scope:{ctx:l}}}),c.$on("click",l[15]);let d=l[6]=="bash"&&ls(l);return{c(){e=x("p"),p.c(),t=Ie(),gt(n.$$.fragment),i=Ie(),s=x("p"),o=Y(`2. Find the API endpoint below corresponding to your desired 69 function in the app. Copy the code snippet, replacing the 70 placeholder values with your own input data. 71 `),b&&b.c(),a=Y(` 72 73 Or use the 74 `),gt(c.$$.fragment),r=Y(` 75 to automatically generate your API requests. 76 `),d&&d.c(),Q(e,"class","padded svelte-1y3yua6"),Q(s,"class","padded svelte-1y3yua6")},m($,f){I($,e,f),p.m(e,null),I($,t,f),vt(n,$,f),I($,i,f),I($,s,f),J(s,o),b&&b.m(s,null),J(s,a),vt(c,s,null),J(s,r),d&&d.m(s,null),_=!0},p($,f){m===(m=u($))&&p?p.p($,f):(p.d(1),p=m($),p&&(p.c(),p.m(e,null)));const k={};f&64&&(k.current_language=$[6]),n.$set(k),$[3]?b?b.p($,f):(b=ns($),b.c(),b.m(s,a)):b&&(b.d(1),b=null);const y={};f&67108864&&(y.$$scope={dirty:f,ctx:$}),c.$set(y),$[6]=="bash"?d?d.p($,f):(d=ls($),d.c(),d.m(s,null)):d&&(d.d(1),d=null)},i($){_||(ve(n.$$.fragment,$),ve(c.$$.fragment,$),_=!0)},o($){Ae(n.$$.fragment,$),Ae(c.$$.fragment,$),_=!1},d($){$&&(P(e),P(t),P(i),P(s)),p.d(),bt(n,$),b&&b.d(),bt(c),d&&d.d()}}}function Ic(l){let e,t,n,i,s,o=l[5].length+"",a,c,r,_,u,m,p,b,d,$,f,k,y,g;return d=new lc({props:{current_language:l[6],api_calls:l[5],dependencies:l[1],root:l[0],api_prefix:l[2].api_prefix,short_root:l[3]||l[0],username:l[4]}}),{c(){e=x("div"),t=x("p"),n=Y("ðª Recorded API Calls "),i=x("span"),s=Y("["),a=Y(o),c=Y("]"),r=Ie(),_=x("p"),u=Y(`Here is the code snippet to replay the most recently recorded API 77 calls using the `),m=Y(l[6]),p=Y(` 78 client.`),b=Ie(),gt(d.$$.fragment),$=Ie(),f=x("p"),f.textContent=`Note: Some API calls only affect the UI, so when using the 79 clients, the desired result may be achieved with only a subset of 80 the recorded calls.`,k=Ie(),y=x("p"),y.textContent="API Documentation",Q(i,"class","api-count svelte-1y3yua6"),Q(t,"id","num-recorded-api-calls"),Nt(t,"font-size","var(--text-lg)"),Nt(t,"font-weight","bold"),Nt(t,"margin","10px 0px"),Nt(y,"font-size","var(--text-lg)"),Nt(y,"font-weight","bold"),Nt(y,"margin","30px 0px 10px")},m(w,v){I(w,e,v),J(e,t),J(t,n),J(t,i),J(i,s),J(i,a),J(i,c),J(e,r),J(e,_),J(_,u),J(_,m),J(_,p),J(e,b),vt(d,e,null),J(e,$),J(e,f),I(w,k,v),I(w,y,v),g=!0},p(w,v){(!g||v&32)&&o!==(o=w[5].length+"")&&zl(a,o),(!g||v&64)&&zl(m,w[6]);const h={};v&64&&(h.current_language=w[6]),v&32&&(h.api_calls=w[5]),v&2&&(h.dependencies=w[1]),v&1&&(h.root=w[0]),v&4&&(h.api_prefix=w[2].api_prefix),v&9&&(h.short_root=w[3]||w[0]),v&16&&(h.username=w[4]),d.$set(h)},i(w){g||(ve(d.$$.fragment,w),g=!0)},o(w){Ae(d.$$.fragment,w),g=!1},d(w){w&&(P(e),P(k),P(y)),bt(d)}}}function Oc(l){let e;return{c(){e=Y("1. Confirm that you have cURL installed on your system.")},m(t,n){I(t,e,n)},p:Xs,d(t){t&&P(e)}}}function Dc(l){let e,t,n,i,s,o,a,c;return{c(){e=Y(`1. Install the 81 `),t=x("span"),n=Y(l[6]),i=Y(` 82 client (`),s=x("a"),o=Y("docs"),c=Y(") if you don't already have it installed."),Nt(t,"text-transform","capitalize"),Q(s,"href",a=l[6]=="python"?Vn:Hn),Q(s,"target","_blank"),Q(s,"class","svelte-1y3yua6")},m(r,_){I(r,e,_),I(r,t,_),J(t,n),I(r,i,_),I(r,s,_),J(s,o),I(r,c,_)},p(r,_){_&64&&zl(n,r[6]),_&64&&a!==(a=r[6]=="python"?Vn:Hn)&&Q(s,"href",a)},d(r){r&&(P(e),P(t),P(i),P(s),P(c))}}}function ns(l){let e,t,n,i,s;return{c(){e=Y(`If this is a private Space, you may need to pass your 83 Hugging Face token as well (`),t=x("a"),n=Y("read more"),s=Y(")."),Q(t,"href",i=l[6]=="python"?Vn+jn:l[6]=="javascript"?Hn+jn:Ll),Q(t,"class","underline svelte-1y3yua6"),Q(t,"target","_blank")},m(o,a){I(o,e,a),I(o,t,a),J(t,n),I(o,s,a)},p(o,a){a&64&&i!==(i=o[6]=="python"?Vn+jn:o[6]=="javascript"?Hn+jn:Ll)&&Q(t,"href",i)},d(o){o&&(P(e),P(t),P(s))}}}function Fc(l){let e,t,n;return{c(){e=x("div"),t=Ie(),n=x("p"),n.textContent="API Recorder",Q(e,"class","loading-dot svelte-1y3yua6"),Q(n,"class","self-baseline svelte-1y3yua6")},m(i,s){I(i,e,s),I(i,t,s),I(i,n,s)},p:Xs,d(i){i&&(P(e),P(t),P(n))}}}function ls(l){let e,t,n,i,s,o,a,c,r,_,u,m,p,b,d,$,f,k,y,g,w,v,h,E,S=l[4]!==null&&is();return{c(){e=x("br"),t=Y(" "),n=x("br"),i=Y(`Making a 84 prediction and getting a result requires 85 `),s=x("strong"),s.textContent="2 requests",o=Y(`: a 86 `),a=x("code"),a.textContent="POST",c=Y(` 87 and a `),r=x("code"),r.textContent="GET",_=Y(" request. The "),u=x("code"),u.textContent="POST",m=Y(` request 88 returns an `),p=x("code"),p.textContent="EVENT_ID",b=Y(`, which is used in the second 89 `),d=x("code"),d.textContent="GET",$=Y(` request to fetch the results. In these snippets, 90 we've used `),f=x("code"),f.textContent="awk",k=Y(" and "),y=x("code"),y.textContent="read",g=Y(` to parse the 91 results, combining these two requests into one command for ease of 92 use. `),S&&S.c(),w=Y(` See 93 `),v=x("a"),h=Y("curl docs"),E=Y("."),Q(a,"class","svelte-1y3yua6"),Q(r,"class","svelte-1y3yua6"),Q(u,"class","svelte-1y3yua6"),Q(p,"class","svelte-1y3yua6"),Q(d,"class","svelte-1y3yua6"),Q(f,"class","svelte-1y3yua6"),Q(y,"class","svelte-1y3yua6"),Q(v,"href",Ll),Q(v,"target","_blank"),Q(v,"class","svelte-1y3yua6")},m(C,z){I(C,e,z),I(C,t,z),I(C,n,z),I(C,i,z),I(C,s,z),I(C,o,z),I(C,a,z),I(C,c,z),I(C,r,z),I(C,_,z),I(C,u,z),I(C,m,z),I(C,p,z),I(C,b,z),I(C,d,z),I(C,$,z),I(C,f,z),I(C,k,z),I(C,y,z),I(C,g,z),S&&S.m(C,z),I(C,w,z),I(C,v,z),J(v,h),I(C,E,z)},p(C,z){C[4]!==null?S||(S=is(),S.c(),S.m(w.parentNode,w)):S&&(S.d(1),S=null)},d(C){C&&(P(e),P(t),P(n),P(i),P(s),P(o),P(a),P(c),P(r),P(_),P(u),P(m),P(p),P(b),P(d),P($),P(f),P(k),P(y),P(g),P(w),P(v),P(E)),S&&S.d(C)}}}function is(l){let e;return{c(){e=Y(`Note: connecting to an authenticated app requires an additional 94 request.`)},m(t,n){I(t,e,n)},d(t){t&&P(e)}}}function ss(l){let e,t,n,i,s,o,a,c;return t=new Ba({props:{named:!0,endpoint_parameters:l[7].named_endpoints["/"+l[19].api_name].parameters,dependency:l[19],dependency_index:l[21],current_language:l[6],root:l[0],space_id:l[3],username:l[4],api_prefix:l[2].api_prefix}}),i=new Fr({props:{endpoint_returns:l[7].named_endpoints["/"+l[19].api_name].parameters,js_returns:l[8].named_endpoints["/"+l[19].api_name].parameters,is_running:rs,current_language:l[6]}}),o=new qc({props:{endpoint_returns:l[7].named_endpoints["/"+l[19].api_name].returns,js_returns:l[8].named_endpoints["/"+l[19].api_name].returns,is_running:rs,current_language:l[6]}}),{c(){e=x("div"),gt(t.$$.fragment),n=Ie(),gt(i.$$.fragment),s=Ie(),gt(o.$$.fragment),a=Ie(),Q(e,"class","endpoint-container svelte-1y3yua6")},m(r,_){I(r,e,_),vt(t,e,null),J(e,n),vt(i,e,null),J(e,s),vt(o,e,null),J(e,a),c=!0},p(r,_){const u={};_&130&&(u.endpoint_parameters=r[7].named_endpoints["/"+r[19].api_name].parameters),_&2&&(u.depen
94dency=r[19]),_&64&&(u.current_language=r[6]),_&1&&(u.root=r[0]),_&8&&(u.space_id=r[3]),_&16&&(u.username=r[4]),_&4&&(u.api_prefix=r[2].api_prefix),t.$set(u);const m={};_&130&&(m.endpoint_returns=r[7].named_endpoints["/"+r[19].api_name].parameters),_&258&&(m.js_returns=r[8].named_endpoints["/"+r[19].api_name].parameters),_&64&&(m.current_language=r[6]),i.$set(m);const p={};_&130&&(p.endpoint_returns=r[7].named_endpoints["/"+r[19].api_name].returns),_&258&&(p.js_returns=r[8].named_endpoints["/"+r[19].api_name].returns),_&64&&(p.current_language=r[6]),o.$set(p)},i(r){c||(ve(t.$$.fragment,r),ve(i.$$.fragment,r),ve(o.$$.fragment,r),c=!0)},o(r){Ae(t.$$.fragment,r),Ae(i.$$.fragment,r),Ae(o.$$.fragment,r),c=!1},d(r){r&&P(e),bt(t),bt(i),bt(o)}}}function os(l){let e,t,n=l[19].show_api&&l[7].named_endpoints["/"+l[19].api_name]&&ss(l);return{c(){n&&n.c(),e=Vl()},m(i,s){n&&n.m(i,s),I(i,e,s),t=!0},p(i,s){i[19].show_api&&i[7].named_endpoints["/"+i[19].api_name]?n?(n.p(i,s),s&130&&ve(n,1)):(n=ss(i),n.c(),ve(n,1),n.m(e.parentNode,e)):n&&(Gn(),Ae(n,1,1,()=>{n=null}),Bn())},i(i){t||(ve(n),t=!0)},o(i){Ae(n),t=!1},d(i){i&&P(e),n&&n.d(i)}}}function Uc(l){let e,t,n=l[7]&&es(l);return{c(){n&&n.c(),e=Vl()},m(i,s){n&&n.m(i,s),I(i,e,s),t=!0},p(i,[s]){i[7]?n?(n.p(i,s),s&128&&ve(n,1)):(n=es(i),n.c(),ve(n,1),n.m(e.parentNode,e)):n&&(Gn(),Ae(n,1,1,()=>{n=null}),Bn())},i(i){t||(ve(n),t=!0)},o(i){Ae(n),t=!1},d(i){i&&P(e),n&&n.d(i)}}}const Hn="https://www.gradio.app/guides/getting-started-with-the-js-client",Vn="https://www.gradio.app/guides/getting-started-with-the-python-client",Ll="https://www.gradio.app/guides/querying-gradio-apps-with-curl",jn="#connecting-to-a-hugging-face-space";let rs=!1;function Rc(l,e,t){let{dependencies:n}=e,{root:i}=e,{app:s}=e,{space_id:o}=e,{root_node:a}=e,{username:c}=e,r=n.filter(v=>v.show_api).length;i===""&&(i=location.protocol+"//"+location.host+location.pathname),i.endsWith("/")||(i+="/");let{api_calls:_=[]}=e,u="python";const m=[["python",ic],["javascript",sc],["bash",oc]];async function p(){return await(await fetch(i.replace(/\/$/,"")+s.api_prefix+"/info")).json()}async function b(){return await s.view_api()}let d,$;p().then(v=>{t(7,d=v)}),b().then(v=>{t(8,$=v)});const f=Ac();jc(()=>(document.body.style.overflow="hidden","parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0),()=>{document.body.style.overflow="auto"}));function k(v){Yi.call(this,l,v)}const y=v=>t(6,u=v),g=()=>f("close",{api_recorder_visible:!0});function w(v){Yi.call(this,l,v)}return l.$$set=v=>{"dependencies"in v&&t(1,n=v.dependencies),"root"in v&&t(0,i=v.root),"app"in v&&t(2,s=v.app),"space_id"in v&&t(3,o=v.space_id),"root_node"in v&&t(12,a=v.root_node),"username"in v&&t(4,c=v.username),"api_calls"in v&&t(5,_=v.api_calls)},[i,n,s,o,c,_,u,d,$,r,m,f,a,k,y,g,w]}class Bc extends Ec{constructor(e){super(),Sc(this,e,Rc,Uc,Lc,{dependencies:1,root:0,app:2,space_id:3,root_node:12,username:4,api_calls:5})}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),St()}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),St()}get app(){return this.$$.ctx[2]}set app(e){this.$$set({app:e}),St()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),St()}get root_node(){return this.$$.ctx[12]}set root_node(e){this.$$set({root_node:e}),St()}get username(){return this.$$.ctx[4]}set username(e){this.$$set({username:e}),St()}get api_calls(){return this.$$.ctx[5]}set api_calls(e){this.$$set({api_calls:e}),St()}}const{SvelteComponent:Gc,append:Tt,attr:Gt,create_component:Hc,destroy_component:Vc,detach:Mt,element:Ht,flush:as,init:Wc,insert:Pt,mount_component:Zc,safe_not_equal:Qc,set_data:xs,space:gl,text:dn,transition_in:Jc,transition_out:Yc}=window.__gradio__svelte__internal;function cs(l){let e,t,n=l[1][l[0][l[0].length-1].fn_index].api_name+"",i;return{c(){e=Ht("span"),t=dn("/"),i=dn(n),Gt(e,"class","api-name svelte-sy28j6")},m(s,o){Pt(s,e,o),Tt(e,t),Tt(e,i)},p(s,o){o&3&&n!==(n=s[1][s[0][s[0].length-1].fn_index].api_name+"")&&xs(i,n)},d(s){s&&Mt(e)}}}function Kc(l){let e,t,n,i,s,o,a,c=l[0].length+"",r,_,u,m=l[0].length>0&&cs(l);return{c(){e=Ht("div"),t=gl(),n=Ht("p"),n.textContent="Recording API Calls:",i=gl(),s=Ht("p"),o=Ht("span"),a=dn("["),r=dn(c),_=dn("]"),u=gl(),m&&m.c(),Gt(e,"class","loading-dot self-baseline svelte-sy28j6"),Gt(n,"class","self-baseline svelte-sy28j6"),Gt(o,"class","api-count svelte-sy28j6"),Gt(s,"class","self-baseline api-section svelte-sy28j6")},m(p,b){Pt(p,e,b),Pt(p,t,b),Pt(p,n,b),Pt(p,i,b),Pt(p,s,b),Tt(s,o),Tt(o,a),Tt(o,r),Tt(o,_),Tt(s,u),m&&m.m(s,null)},p(p,b){b&1&&c!==(c=p[0].length+"")&&xs(r,c),p[0].length>0?m?m.p(p,b):(m=cs(p),m.c(),m.m(s,null)):m&&(m.d(1),m=null)},d(p){p&&(Mt(e),Mt(t),Mt(n),Mt(i),Mt(s)),m&&m.d()}}}function Xc(l){let e,t,n;return t=new Jn({props:{size:"sm",variant:"secondary",$$slots:{default:[Kc]},$$scope:{ctx:l}}}),{c(){e=Ht("div"),Hc(t.$$.fragment),Gt(e,"id","api-recorder")},m(i,s){Pt(i,e,s),Zc(t,e,null),n=!0},p(i,[s]){const o={};s&7&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(Jc(t.$$.fragment,i),n=!0)},o(i){Yc(t.$$.fragment,i),n=!1},d(i){i&&Mt(e),Vc(t)}}}function xc(l,e,t){let{api_calls:n=[]}=e,{dependencies:i}=e;return l.$$set=s=>{"api_calls"in s&&t(0,n=s.api_calls),"dependencies"in s&&t(1,i=s.dependencies)},[n,i]}class e_ extends Gc{constructor(e){super(),Wc(this,e,xc,Xc,Qc,{api_calls:0,dependencies:1})}get api_calls(){return this.$$.ctx[0]}set api_calls(e){this.$$set({api_calls:e}),as()}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),as()}}const eo="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20Outer%20gear%20teeth%20(gray)%20--%3e%3cpath%20d='M19.14%2012.94c.04-.3.06-.61.06-.94%200-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24%200-.43.17-.47.41l-.36%202.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47%200-.59.22L2.74%208.87c-.12.21-.08.47.12.61l2.03%201.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03%201.58c-.18.14-.23.41-.12.61l1.92%203.32c.12.22.37.29.59.22l2.39-.96c.5.38%201.03.7%201.62.94l.36%202.54c.05.24.24.41.48.41h3.84c.24%200%20.44-.17.47-.41l.36-2.54c.59-.24%201.13-.56%201.62-.94l2.39.96c.22.08.47%200%20.59
94-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12%2015.6c-1.98%200-3.6-1.62-3.6-3.6s1.62-3.6%203.6-3.6%203.6%201.62%203.6%203.6-1.62%203.6-3.6%203.6z'%20fill='%23808080'/%3e%3c!--%20Inner%20circle%20(now%20gray)%20--%3e%3ccircle%20cx='12'%20cy='12'%20r='2.5'%20fill='%23808080'/%3e%3c/svg%3e",{SvelteComponent:t_,append:zt,attr:Lt,component_subscribe:n_,create_component:l_,destroy_component:i_,detach:bl,element:rn,flush:s_,init:o_,insert:vl,listen:r_,mount_component:a_,safe_not_equal:c_,set_data:_s,space:$l,src_url_equal:__,text:us,transition_in:u_,transition_out:f_}=window.__gradio__svelte__internal,{createEventDispatcher:p_}=window.__gradio__svelte__internal;function d_(l){let e,t,n,i,s,o=l[1]("common.settings")+"",a,c,r,_,u,m,p,b,d,$;return p=new Dl({}),{c(){e=rn("h2"),t=rn("img"),i=$l(),s=rn("div"),a=us(o),c=$l(),r=rn("div"),_=us(l[0]),u=$l(),m=rn("button"),l_(p.$$.fragment),__(t.src,n=eo)||Lt(t,"src",n),Lt(t,"alt",""),Lt(t,"class","svelte-1b2d8fn"),Lt(r,"class","url svelte-1b2d8fn"),Lt(s,"class","title svelte-1b2d8fn"),Lt(e,"class","svelte-1b2d8fn"),Lt(m,"class","svelte-1b2d8fn")},m(f,k){vl(f,e,k),zt(e,t),zt(e,i),zt(e,s),zt(s,a),zt(s,c),zt(s,r),zt(r,_),vl(f,u,k),vl(f,m,k),a_(p,m,null),b=!0,d||($=r_(m,"click",l[3]),d=!0)},p(f,[k]){(!b||k&2)&&o!==(o=f[1]("common.settings")+"")&&_s(a,o),(!b||k&1)&&_s(_,f[0])},i(f){b||(u_(p.$$.fragment,f),b=!0)},o(f){f_(p.$$.fragment,f),b=!1},d(f){f&&(bl(e),bl(u),bl(m)),i_(p),d=!1,$()}}}function m_(l,e,t){let n;n_(l,Qn,a=>t(1,n=a));let{root:i}=e;const s=p_();Ol();const o=()=>s("close");return l.$$set=a=>{"root"in a&&t(0,i=a.root)},[i,n,s,o]}class h_ extends t_{constructor(e){super(),o_(this,e,m_,d_,c_,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),s_()}}const{SvelteComponent:g_,append:ue,attr:ce,bubble:b_,component_subscribe:v_,create_component:fs,destroy_component:ps,detach:Ge,element:we,flush:kl,init:$_,insert:He,listen:wl,mount_component:ds,noop:k_,run_all:w_,safe_not_equal:y_,set_data:Wn,space:pt,text:$t,transition_in:ms,transition_out:hs}=window.__gradio__svelte__internal,{onMount:C_}=window.__gradio__svelte__internal;function gs(l){let e,t,n=l[5]("common.display_theme")+"",i,s,o,a,c,r,_,u,m,p,b,d,$,f,k,y;return{c(){e=we("div"),t=we("h2"),i=$t(n),s=pt(),o=we("p"),a=we("li"),c=we("button"),c.textContent="âï¸ Â Light",_=pt(),u=we("li"),m=we("button"),m.textContent="â¾ Â Dark",b=pt(),d=we("li"),$=we("button"),$.textContent="ð¥ï¸  System",ce(t,"class","svelte-npavty"),ce(c,"class","svelte-npavty"),ce(a,"class",r="theme-button "+(l[4]==="light"?"current-theme":"inactive-theme")+" svelte-npavty"),ce(m,"class","svelte-npavty"),ce(u,"class",p="theme-button "+(l[4]==="dark"?"current-theme":"inactive-theme")+" svelte-npavty"),ce($,"class","svelte-npavty"),ce(d,"class",f="theme-button "+(l[4]==="system"?"current-theme":"inactive-theme")+" svelte-npavty"),ce(o,"class","padded theme-buttons svelte-npavty"),ce(e,"class","banner-wrap svelte-npavty")},m(g,w){He(g,e,w),ue(e,t),ue(t,i),ue(e,s),ue(e,o),ue(o,a),ue(a,c),ue(o,_),ue(o,u),ue(u,m),ue(o,b),ue(o,d),ue(d,$),k||(y=[wl(a,"click",l[9]),wl(u,"click",l[10]),wl(d,"click",l[11])],k=!0)},p(g,w){w&32&&n!==(n=g[5]("common.display_theme")+"")&&Wn(i,n),w&16&&r!==(r="theme-button "+(g[4]==="light"?"current-theme":"inactive-theme")+" svelte-npavty")&&ce(a,"class",r),w&16&&p!==(p="theme-button "+(g[4]==="dark"?"current-theme":"inactive-theme")+" svelte-npavty")&&ce(u,"class",p),w&16&&f!==(f="theme-button "+(g[4]==="system"?"current-theme":"inactive-theme")+" svelte-npavty")&&ce(d,"class",f)},d(g){g&&Ge(e),k=!1,w_(y)}}}function q_(l){let e,t,n;return{c(){e=$t(`Progressive Web App is not enabled for this app. To enable it, start your 95 Gradio app with `),t=we("code"),t.textContent="launch(pwa=True)",n=$t(".")},m(i,s){He(i,e,s),He(i,t,s),He(i,n,s)},p:k_,d(i){i&&(Ge(e),Ge(t),Ge(n))}}}function E_(l){let e,t,n,i;return{c(){e=$t("You can install this app as a Progressive Web App on your device. Visit "),t=we("a"),n=$t(l[0]),i=$t(" and click the install button in the URL address bar of your browser."),ce(t,"href",l[0]),ce(t,"target","_blank"),ce(t,"class","svelte-npavty")},m(s,o){He(s,e,o),He(s,t,o),ue(t,n),He(s,i,o)},p(s,o){o&1&&Wn(n,s[0]),o&1&&ce(t,"href",s[0])}
95,d(s){s&&(Ge(e),Ge(t),Ge(i))}}}function S_(l){let e,t,n,i,s,o,a=l[5]("common.language")+"",c,r,_,u,m,p,b,d=l[5]("common.pwa")+"",$,f,k,y;t=new h_({props:{root:l[0]}}),t.$on("close",l[8]);let g=l[1]===null&&gs(l);u=new Ro({props:{label:"Language",choices:Mo,show_label:!1,root:l[0],value:l[3]}}),u.$on("change",l[7]);function w(E,S){return E[2]?E_:q_}let v=w(l),h=v(l);return{c(){e=we("div"),fs(t.$$.fragment),n=pt(),g&&g.c(),i=pt(),s=we("div"),o=we("h2"),c=$t(a),r=pt(),_=we("p"),fs(u.$$.fragment),m=pt(),p=we("div"),b=we("h2"),$=$t(d),f=pt(),k=we("p"),h.c(),ce(e,"class","banner-wrap svelte-npavty"),ce(o,"class","svelte-npavty"),ce(_,"class","padded svelte-npavty"),ce(s,"class","banner-wrap svelte-npavty"),ce(b,"class","svelte-npavty"),ce(k,"class","padded svelte-npavty"),ce(p,"class","banner-wrap svelte-npavty")},m(E,S){He(E,e,S),ds(t,e,null),He(E,n,S),g&&g.m(E,S),He(E,i,S),He(E,s,S),ue(s,o),ue(o,c),ue(s,r),ue(s,_),ds(u,_,null),He(E,m,S),He(E,p,S),ue(p,b),ue(b,$),ue(p,f),ue(p,k),h.m(k,null),y=!0},p(E,[S]){const C={};S&1&&(C.root=E[0]),t.$set(C),E[1]===null?g?g.p(E,S):(g=gs(E),g.c(),g.m(i.parentNode,i)):g&&(g.d(1),g=null),(!y||S&32)&&a!==(a=E[5]("common.language")+"")&&Wn(c,a);const z={};S&1&&(z.root=E[0]),S&8&&(z.value=E[3]),u.$set(z),(!y||S&32)&&d!==(d=E[5]("common.pwa")+"")&&Wn($,d),v===(v=w(E))&&h?h.p(E,S):(h.d(1),h=v(E),h&&(h.c(),h.m(k,null)))},i(E){y||(ms(t.$$.fragment,E),ms(u.$$.fragment,E),y=!0)},o(E){hs(t.$$.fragment,E),hs(u.$$.fragment,E),y=!1},d(E){E&&(Ge(e),Ge(n),Ge(i),Ge(s),Ge(m),Ge(p)),ps(t),g&&g.d(E),ps(u),h.d()}}}function z_(l,e,t){let n;v_(l,Qn,d=>t(5,n=d));let{root:i}=e,{space_id:s}=e,{pwa_enabled:o}=e;i===""&&(i=location.protocol+"//"+location.host+location.pathname),i.endsWith("/")||(i+="/");function a(d){const $=new URL(window.location.href);d==="system"?($.searchParams.delete("__theme"),t(4,r="system")):($.searchParams.set("__theme",d),t(4,r=d)),window.location.href=$.toString()}C_(()=>{document.body.style.overflow="hidden","parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0);const $=new URL(window.location.href).searchParams.get("__theme");return t(4,r=$||"system"),()=>{document.body.style.overflow="auto"}});let c,r="system";Po.subscribe(d=>{d&&t(3,c=d)});function _(d){const $=d.detail;Io($)}Ol();function u(d){b_.call(this,l,d)}const m=()=>a("light"),p=()=>a("dark"),b=()=>a("system");return l.$$set=d=>{"root"in d&&t(0,i=d.root),"space_id"in d&&t(1,s=d.space_id),"pwa_enabled"in d&&t(2,o=d.pwa_enabled)},[i,s,o,c,r,n,a,_,u,m,p,b]}class L_ extends g_{constructor(e){super(),$_(this,e,z_,S_,y_,{root:0,space_id:1,pwa_enabled:2})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),kl()}get space_id(){return this.$$.ctx[1]}set space_id(e){this.$$set({space_id:e}),kl()}get pwa_enabled(){return this.$$.ctx[2]}set pwa_enabled(e){this.$$set({pwa_enabled:e}),kl()}}const N_=Oo(Qn),{SvelteComponent:j_,add_flush_callback:A_,assign:Zn,bind:bs,binding_callbacks:Nl,bubble:T_,check_outros:M_,compute_rest_props:vs,construct_svelte_component:$s,create_component:ks,create_slot:P_,destroy_component:ws,detach:I_,empty:O_,exclude_internal_props:D_,flush:Xe,get_all_dirty_from_scope:F_,get_slot_changes:U_,get_spread_object:ys,get_spread_update:Cs,group_outros:R_,init:B_,insert:G_,mount_component:qs,not_equal:H_,transition_in:jl,transition_out:Al,update_slot_base:V_}=window.__gradio__svelte__internal,{bind:W_,binding_callbacks:Z_}=window.__gradio__svelte__internal;function Q_(l){let e;const t=l[12].default,n=P_(t,l,l[16],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&65536)&&V_(n,t,i,i[16],e?U_(t,i[16],s,null):F_(i[16]),null)},i(i){e||(jl(n,i),e=!0)},o(i){Al(n,i),e=!1},d(i){n&&n.d(i)}}}function J_(l){let e,t,n,i;const s=[{elem_id:l[5]},{elem_classes:l[6]},{target:l[3]},{visible:l[7]},l[9],{theme_mode:l[4]},{root:l[2]}];function o(r){l[14](r)}var a=l[8];function c(r,_){let u={$$slots:{default:[Q_]},$$scope:{ctx:r}};for(let m=0;m<s.length;m+=1)u=Zn(u,s[m]);return _!==void 0&&_&764&&(u=Zn(u,Cs(s,[_&32&&{elem_id:r[5]},_&64&&{elem_classes:r[6]},_&8&&{target:r[3]},_&128&&{visible:r[7]},_&512&&ys(r[9]),_&16&&{theme_mode:r[4]},_&4&&{root:r[2]}]))),r[1]!==void 0&&(u.value=r[1]),{props:u}}return a&&(e=$s(a,c(l)),l[13](e),Nl.push(()=>bs(e,"value",o)),e.$on("prop_change",l[15])),{c(){e&&ks(e.$$.fragment),n=O_()},m(r,_){e&&qs(e,r,_),G_(r,n,_),i=!0},p(r,[_]){if(a!==(a=r[8])){if(e){R_();const u=e;Al(u.$$.fragment,1,0,()=>{ws(u,1)}),M_()}a?(e=$s(a,c(r,_)),r[13](e),Nl.push(()=>bs(e,"value",o)),e.$on("prop_change",r[15]),ks(e.$$.fragment),jl(e.$$.fragment,1),qs(e,n.parentNode,n)):e=null}else if(a){const u=_&764?Cs(s,[_&32&&{elem_id:r[5]},_&64&&{elem_classes:r[6]},_&8&&{target:r[3]},_&128&&{visible:r[7]},_&512&&ys(r[9]),_&16&&{theme_mode:r[4]},_&4&&{root:r[2]}]):{};_&65536&&(u.$$scope={dirty:_,ctx:r}),!t&&_&2&&(t=!0,u.value=r[1],A_(()=>t=!1)),e.$set(u)}}
vendor: 13,461 bytes, line 95
95,i(r){i||(e&&jl(e.$$.fragment,r),i=!0)},o(r){e&&Al(e.$$.fragment,r),i=!1},d(r){r&&I_(n),l[13](null),e&&ws(e,r)}}}function Y_(l,e,t){const n=["root","component","target","theme_mode","instance","value","elem_id","elem_classes","_id","visible"];let i=vs(e,n),{$$slots:s={},$$scope:o}=e,{root:a}=e,{component:c}=e,{target:r}=e,{theme_mode:_}=e,{instance:u}=e,{value:m}=e,{elem_id:p}=e,{elem_classes:b}=e,{_id:d}=e,{visible:$}=e;const f=(h,E,S)=>new CustomEvent("prop_change",{detail:{id:h,prop:E,value:S}});function k(h){return new Proxy(h,{construct(S,C){const z=new S(...C),A=Object.keys(z.$$.props);function N(M){return function(W){if(!r)return;const ke=f(d,M,W);r.dispatchEvent(ke)}}return A.forEach(M=>{Z_.push(()=>W_(z,M,N(M)))}),z}})}const y=k(c);function g(h){Nl[h?"unshift":"push"](()=>{u=h,t(0,u)})}function w(h){m=h,t(1,m)}function v(h){T_.call(this,l,h)}return l.$$set=h=>{e=Zn(Zn({},e),D_(h)),t(9,i=vs(e,n)),"root"in h&&t(2,a=h.root),"component"in h&&t(10,c=h.component),"target"in h&&t(3,r=h.target),"theme_mode"in h&&t(4,_=h.theme_mode),"instance"in h&&t(0,u=h.instance),"value"in h&&t(1,m=h.value),"elem_id"in h&&t(5,p=h.elem_id),"elem_classes"in h&&t(6,b=h.elem_classes),"_id"in h&&t(11,d=h._id),"visible"in h&&t(7,$=h.visible),"$$scope"in h&&t(16,o=h.$$scope)},[u,m,a,r,_,p,b,$,y,i,c,d,s,g,w,v,o]}class K_ extends j_{constructor(e){super(),B_(this,e,Y_,J_,H_,{root:2,component:10,target:3,theme_mode:4,instance:0,value:1,elem_id:5,elem_classes:6,_id:11,visible:7})}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),Xe()}get component(){return this.$$.ctx[10]}set component(e){this.$$set({component:e}),Xe()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),Xe()}get theme_mode(){return this.$$.ctx[4]}set theme_mode(e){this.$$set({theme_mode:e}),Xe()}get instance(){return this.$$.ctx[0]}set instance(e){this.$$set({instance:e}),Xe()}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),Xe()}get elem_id(){return this.$$.ctx[5]}set elem_id(e){this.$$set({elem_id:e}),Xe()}get elem_classes(){return this.$$.ctx[6]}set elem_classes(e){this.$$set({elem_classes:e}),Xe()}get _id(){return this.$$.ctx[11]}set _id(e){this.$$set({_id:e}),Xe()}get visible(){return this.$$.ctx[7]}set visible(e){this.$$set({visible:e}),Xe()}}const{SvelteComponent:X_,add_flush_callback:Es,assign:x_,bind:Ss,binding_callbacks:zs,bubble:Ls,check_outros:to,create_component:no,destroy_component:lo,detach:Wl,empty:Zl,ensure_array_like:Ns,flush:ct,get_spread_object:eu,get_spread_update:tu,group_outros:io,init:nu,insert:Ql,mount_component:so,outro_and_destroy_block:lu,safe_not_equal:iu,transition_in:Wt,transition_out:mn,update_keyed_each:su}=window.__gradio__svelte__internal,{onMount:ou,createEventDispatcher:ru,setContext:au}=window.__gradio__svelte__internal;function js(l,e,t){const n=l.slice();return n[15]=e[t],n}function As(l){let e=[],t=new Map,n,i,s=Ns(l[0].children);const o=a=>a[15].id;for(let a=0;a<s.length;a+=1){let c=js(l,s,a),r=o(c);t.set(r,e[a]=Ts(r,c))}return{c(){for(let a=0;a<e.length;a+=1)e[a].c();n=Zl()},m(a,c){for(let r=0;r<e.length;r+=1)e[r]&&e[r].m(a,c);Ql(a,n,c),i=!0},p(a,c){c&63&&(s=Ns(a[0].children),io(),e=su(e,c,o,1,a,s,t,n.parentNode,lu,Ts,n,js),to())},i(a){if(!i){for(let c=0;c<s.length;c+=1)Wt(e[c]);i=!0}},o(a){for(let c=0;c<e.length;c+=1)mn(e[c]);i=!1},d(a){a&&Wl(n);for(let c=0;c<e.length;c+=1)e[c].d(a)}}}function Ts(l,e){let t,n,i;return n=new oo({props:{node:e[15],component:e[15].component,target:e[2],id:e[15].id,root:e[1],theme_mode:e[3],max_file_size:e[4],client:e[5]}}),n.$on("destroy",e[9]),n.$on("mount",e[10]),{key:l,first:null,c(){t=Zl(),no(n.$$.fragment),this.first=t},m(s,o){Ql(s,t,o),so(n,s,o),i=!0},p(s,o){e=s;const a={};o&1&&(a.node=e[15]),o&1&&(a.component=e[15].component),o&4&&(a.target=e[2]),o&1&&(a.id=e[15].id),o&2&&(a.root=e[1]),o&8&&(a.theme_mode=e[3]),o&16&&(a.max_file_size=e[4]),o&32&&(a.client=e[5]),n.$set(a)},i(s){i||(Wt(n.$$.fragment,s),i=!0)},o(s){mn(n.$$.fragment,s),i=!1},d(s){s&&Wl(t),lo(n,s)}}}function cu(l){let e,t,n=l[0].children&&l[0].children.length&&As(l);return{c(){n&&n.c(),e=Zl()},m(i,s){n&&n.m(i,s),Ql(i,e,s),t=!0},p(i,s){i[0].children&&i[0].children.length?n?(n.p(i,s),s&1&&Wt(n,1)):(n=As(i),n.c(),Wt(n,1),n.m(e.parentNode,e)):n&&(io(),mn(n,1,1,()=>{n=null}),to())},i(i){t||(Wt(n),t=!0)},o(i){mn(n),t=!1},d(i){i&&Wl(e),n&&n.d(i)}}}function _u(l){let e,t,n,i;const s=[{_id:l[0]?.id},{component:l[0].component},{elem_id:"elem_id"in l[0].props&&l[0].props.elem_id||`component-${l[0].id}`},{elem_classes:"elem_classes"in l[0].props&&l[0].props.elem_classes||[]},{target:l[2]},l[0].props,{theme_mode:l[3]},{root:l[1]},{visible:typeof l[0].props.visible=="boolean"?l[0].props.visible:!0}];function o(r){l[11](r)}function a(r){l[12](r)}let c={$$slots:{default:[cu]},$$scope:{ctx:l}};for(let r=0;r<s.length;r+=1)c=x_(c,s[r]);return l[0].instance!==void 0&&(c.instance=l[0].instance),l[0].props.value!==void 0&&(c.value=l[0].props.value),e=new K_({props:c}),zs.push(()=>Ss(e,"instance",o)),zs.push(()=>Ss(e,"value",a)),{c(){no(e.$$.fragment)},m(r,_){so(e,r,_),i=!0},p(r,[_]){const u=_&15?tu(s,[_&1&&{_id:r[0]?.id},_&1&&{component:r[0].component},_&1&&{elem_id:"elem_id"in r[0].props&&r[0].props.elem_id||`component-${r[0].id}`},_&1&&{elem_classes:"elem_classes"in r[0].props&&r[0].props.elem_classes||[]},_&4&&{target:r[2]},_&1&&eu(r[0].props),_&8&&{theme_mode:r[3]},_&2&&{root:r[1]},_&1&&{visible:typeof r[0].props.visible=="boolean"?r[0].props.visible:!0}]):{};_&262207&&(u.$$scope={dirty:_,ctx:r}),!t&&_&1&&(t=!0,u.instance=r[0].instance,Es(()=>t=!1)),!n&&_&1&&(n=!0,u.value=r[0].props.value,Es(()=>n=!1)),e.$set(u)},i(r){i||(Wt(e.$$.fragment,r),i=!0)},o(r){mn(e.$$.fragment,r),i=!1},d(r){lo(e,r)}}}function uu(l,e,t){let{root:n}=e,{node:i}=e,{parent:s=null}=e,{target:o}=e,{theme_mode:a}=e,{version:c}=e,{autoscroll:r}=e,{max_file_size:_}=e,{client:u}=e;const m=ru();let p=[];ou(()=>{m("mount",i.id);for(const k of p)m("mount",k.id);return()=>{m("destroy",i.id);for(const k of p)m("mount",k.id)}}),au("BLOCK_KEY",s);function b(k){Ls.call(this,l,k)}function d(k){Ls.call(this,l,k)}function $(k){l.$$.not_equal(i.instance,k)&&(i.instance=k,t(0,i),t(14,p),t(2,o),t(3,a),t(7,c),t(1,n),t(8,r),t(4,_),t(5,u))}function f(k){l.$$.not_equal(i.props.value,k)&&(i.props.value=k,t(0,i),t(14,p),t(2,o),t(3,a),t(7,c),t(1,n),t(8,r),t(4,_),t(5,u))}return l.$$set=k=>{"root"in k&&t(1,n=k.root),"node"in k&&t(0,i=k.node),"parent"in k&&t(6,s=k.parent),"target"in k&&t(2,o=k.target),"theme_mode"in k&&t(3,a=k.theme_mode),"version"in k&&t(7,c=k.version),"autoscroll"in k&&t(8,r=k.autoscroll),"max_file_size"in k&&t(4,_=k.max_file_size),"client"in k&&t(5,u=k.client)},l.$$.update=()=>{l.$$.dirty&1&&i&&t(0,i.children=i.children&&i.children.filter(k=>{const y=i.type!=="statustracker";return y||p.push(k),y}),i),l.$$.dirty&1&&i&&i.type==="form"&&(i.children?.every(k=>!k.props.visible)?t(0,i.props.visible=!1,i):t(0,i.props.visible=!0,i)),l.$$.dirty&447&&t(0,i.props.gradio=new Go(i.id,o,a,c,n,r,_,N_,u,Do),i)},[i,n,o,a,_,u,s,c,r,b,d,$,f]}class oo extends X_{constructor(e){super(),nu(this,e,uu,_u,iu,{root:1,node:0,parent:6,target:2,theme_mode:3,version:7,autoscroll:8,max_file_size:4,client:5})}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),ct()}get node(){return this.$$.ctx[0]}set node(e){this.$$set({node:e}),ct()}get parent(){return this.$$.ctx[6]}set parent(e){this.$$set({parent:e}),ct()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),ct()}get theme_mode(){return this.$$.ctx[3]}set theme_mode(e){this.$$set({theme_mode:e}),ct()}get version(){return this.$$.ctx[7]}set version(e){this.$$set({version:e}),ct()}get autoscroll(){return this.$$.ctx[8]}set autoscroll(e){this.$$set({autoscroll:e}),ct()}get max_file_size(){return this.$$.ctx[4]}set max_file_size(e){this.$$set({max_file_size:e}),ct()}get client(){return this.$$.ctx[5]}set client(e){this.$$set({client:e}),ct()}}const{SvelteComponent:fu,check_outros:pu,create_component:du,destroy_component:mu,detach:hu,empty:gu,flush:ft,group_outros:bu,init:vu,insert:$u,mount_component:ku,safe_not_equal:wu,transition_in:In,transition_out:Tl}=window.__gradio__svelte__internal,{onMount:yu,createEventDispatcher:Cu}=window.__gradio__svelte__internal;function Ms(l){let e,t;return e=new oo({props:{node:l[0],root:l[1],target:l[2],theme_mode:l[3],version:l[4],autoscroll:l[5],max_file_size:l[6],client:l[7]}}),{c(){du(e.$$.fragment)},m(n,i){ku(e,n,i),t=!0},p(n,i){const s={};i&1&&(s.node=n[0]),i&2&&(s.root=n[1]),i&4&&(s.target=n[2]),i&8&&(s.theme_mode=n[3]),i&16&&(s.version=n[4]),i&32&&(s.autoscroll=n[5]),i&64&&(s.max_file_size=n[6]),i&128&&(s.client=n[7]),e.$set(s)},i(n){t||(In(e.$$.fragment,n),t=!0)},o(n){Tl(e.$$.fragment,n),t=!1},d(n){mu(e,n)}}}function qu(l){let e,t,n=l[0]&&Ms(l);return{c(){n&&n.c(),e=gu()},m(i,s){n&&n.m(i,s),$u(i,e,s),t=!0},p(i,[s]){i[0]?n?(n.p(i,s),s&1&&In(n,1)):(n=Ms(i),n.c(),In(n,1),n.m(e.parentNode,e)):n&&(bu(),Tl(n,1,1,()=>{n=null}),pu())},i(i){t||(In(n),t=!0)},o(i){Tl(n),t=!1},d(i){i&&hu(e),n&&n.d(i)}}}function Eu(l,e,t){let{rootNode:n}=e,{root:i}=e,{target:s}=e,{theme_mode:o}=e,{version:a}=e,{autoscroll:c}=e,{max_file_size:r=null}=e,{client:_}=e;const u=Cu();return yu(()=>{u("mount")}),l.$$set=m=>{"rootNode"in m&&t(0,n=m.rootNode),"root"in m&&t(1,i=m.root),"target"in m&&t(2,s=m.target),"theme_mode"in m&&t(3,o=m.theme_mode),"version"in m&&t(4,a=m.version),"autoscroll"in m&&t(5,c=m.autoscroll),"max_file_size"in m&&t(6,r=m.max_file_size),"client"in m&&t(7,_=m.client)},[n,i,s,o,a,c,r,_]}class Su extends fu{constructor(e){super(),vu(this,e,Eu,qu,wu,{rootNode:0,root:1,target:2,theme_mode:3,version:4,autoscroll:5,max_file_size:6,client:7})}get rootNode(){return this.$$.ctx[0]}set rootNode(e){this.$$set({rootNode:e}),ft()}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),ft()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),ft()}get theme_mode(){return this.$$.ctx[3]}set theme_mode(e){this.$$set({theme_mode:e}),ft()}get version(){return this.$$.ctx[4]}set version(e){this.$$set({version:e}),ft()}get autoscroll(){return this.$$.ctx[5]}set autoscroll(e){this.$$set({autoscroll:e}),ft()}get max_file_size(){return this.$$.ctx[6]}set max_file_size(e){this.$$set({max_file_size:e}),ft()}get client(){return this.$$.ctx[7]}set client(e){this.$$set({client:e}),ft()}}const zu="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='576'%20height='576'%20viewBox='0%200%20576%20576'%20fill='none'%3e%3cpath%20d='M287.5%20229L86%20344.5L287.5%20460L489%20344.5L287.5%20229Z'%20stroke='url(%23paint0_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M287.5%20116L86%20231.5L287.5%20347L489%20231.5L287.5%20116Z'%20stroke='url(%23paint1_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M86%20344L288%20229'%20stroke='url(%23paint2_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='bevel'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_102_7'%20x1='60'%20y1='341'%20x2='429.5'%20y2='344'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_102_7'%20x1='513.5'%20y1='231'%20x2='143.5'%20y2='231'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_102_7'%20x1='60'%20y1='344'%20x2='428.987'%20y2='341.811'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",{HtmlTag:Lu,SvelteComponent:Nu,append:oe,attr:ee,check_outros:an,component_subscribe:cn,create_component:gn,destroy_component:bn,detach:Ee,element:ye,empty:On,flush:se,globals:ju,group_outros:_n,init:Au,insert:De,listen:vn,mount_component:$n,noop:yl,safe_not_equal:Tu,set_data:Ml,set_style:An,space:Fe,src_url_equal:Pl,text:Il,transition_in:ge,transition_out:Oe}=window.__gradio__svelte__internal,{document:pn}=ju,{tick:Tn,onMount:Mu}=window.__gradio__svelte__internal;function Ps(l){return pn.title=l[2],{c:yl,m:yl,d:yl}}function Is(l){let e,t=`<style>${ti(l[15],l[12])}</style>`,n;return{c(){e=new Lu(!1),n=On(),e.a=n},m(i,s){e.m(t,i,s),De(i,n,s)},p(i,s){s[0]&36864&&t!==(t=`<style>${ti(i[15],i[12])}</style>`)&&e.p(t)},d(i){i&&(Ee(n),e.d())}}}function Os(l){let e,t;return e=new Su({props:{rootNode:l[16],root:l[0],target:l[3],theme_mode:l[9],version:l[12],autoscroll:l[4],max_file_size:l[14],client:l[10]}}),e.$on("mount",l[30]),{c(){gn(e.$$.fragment)},m(n,i){$n(e,n,i),t=!0},p(n,i){const s={};i[0]&65536&&(s.rootNode=n[16]),i[0]&1&&(s.root=n[0]),i[0]&8&&(s.target=n[3]),i[0]&512&&(s.theme_mode=n[9]),i[0]&4096&&(s.version=n[12]),i[0]&16&&(s.autoscroll=n[4]),i[0]&16384&&(s.max_file_size=n[14]),i[0]&1024&&(s.client=n[10]),e.$set(s)},i(n){t||(ge(e.$$.fragment,n),t=!0)},o(n){Oe(e.$$.fragment,n),t=!1},d(n){bn(e,n)}}}function Ds(l){let e,t,n,i=l[22]("common.built_with_gradio")+"",s,o,a,c,r,_,u,m,p,b=l[22]("common.settings")+"",d,$,f,k,y,g,w,v=l[5]&&Fs(l);return{c(){e=ye("footer"),v&&v.c(),t=Fe(),n=ye("a"),s=Il(i),o=Fe(),a=ye("img"),_=Fe(),u=ye("div"),u.textContent="·",m=Fe(),p=ye("button"),d=Il(b),$=Fe(),f=ye("img"),Pl(a.src,c=zu)||ee(a,"src",c),ee(a,"alt",r=l[22]("common.logo")),ee(a,"class","svelte-1byz9vf"),ee(n,"href","https://gradio.app"),ee(n,"class","built-with
95svelte-1byz9vf"),ee(n,"target","_blank"),ee(n,"rel","noreferrer"),ee(u,"class","divider svelte-1byz9vf"),Pl(f.src,k=eo)||ee(f,"src",k),ee(f,"alt",y=l[22]("common.settings")),ee(f,"class","svelte-1byz9vf"),ee(p,"class","settings svelte-1byz9vf"),ee(e,"class","svelte-1byz9vf")},m(h,E){De(h,e,E),v&&v.m(e,null),oe(e,t),oe(e,n),oe(n,s),oe(n,o),oe(n,a),oe(e,_),oe(e,u),oe(e,m),oe(e,p),oe(p,d),oe(p,$),oe(p,f),g||(w=vn(p,"click",l[44]),g=!0)},p(h,E){h[5]?v?v.p(h,E):(v=Fs(h),v.c(),v.m(e,t)):v&&(v.d(1),v=null),E[0]&4194304&&i!==(i=h[22]("common.built_with_gradio")+"")&&Ml(s,i),E[0]&4194304&&r!==(r=h[22]("common.logo"))&&ee(a,"alt",r),E[0]&4194304&&b!==(b=h[22]("common.settings")+"")&&Ml(d,b),E[0]&4194304&&y!==(y=h[22]("common.settings"))&&ee(f,"alt",y)},d(h){h&&Ee(e),v&&v.d(),g=!1,w()}}}function Fs(l){let e,t=l[22]("errors.use_via_api")+"",n,i,s,o,a,c,r,_,u;return{c(){e=ye("button"),n=Il(t),i=Fe(),s=ye("img"),c=Fe(),r=ye("div"),r.textContent="·",Pl(s.src,o=Ws)||ee(s,"src",o),ee(s,"alt",a=l[22]("common.logo")),ee(s,"class","svelte-1byz9vf"),ee(e,"class","show-api svelte-1byz9vf"),ee(r,"class","divider show-api-divider svelte-1byz9vf")},m(m,p){De(m,e,p),oe(e,n),oe(e,i),oe(e,s),De(m,c,p),De(m,r,p),_||(u=vn(e,"click",l[43]),_=!0)},p(m,p){p[0]&4194304&&t!==(t=m[22]("errors.use_via_api")+"")&&Ml(n,t),p[0]&4194304&&a!==(a=m[22]("common.logo"))&&ee(s,"alt",a)},d(m){m&&(Ee(e),Ee(c),Ee(r)),_=!1,u()}}}function Us(l){let e,t,n,i,s;return t=new e_({props:{api_calls:l[20],dependencies:l[1]}}
vendor: 4,262 bytes, line 95
95),{c(){e=ye("div"),gn(t.$$.fragment),ee(e,"id","api-recorder-container"),ee(e,"class","svelte-1byz9vf")},m(o,a){De(o,e,a),$n(t,e,null),n=!0,i||(s=vn(e,"click",l[45]),i=!0)},p(o,a){const c={};a[0]&1048576&&(c.api_calls=o[20]),a[0]&2&&(c.dependencies=o[1]),t.$set(c)},i(o){n||(ge(t.$$.fragment,o),n=!0)},o(o){Oe(t.$$.fragment,o),n=!1},d(o){o&&Ee(e),bn(t),i=!1,s()}}}function Rs(l){let e,t,n,i,s,o,a,c;return s=new Bc({props:{root_node:l[16],dependencies:l[1],root:l[0],app:l[10],space_id:l[11],api_calls:l[20],username:l[13]}}),s.$on("close",l[47]),{c(){e=ye("div"),t=ye("div"),n=Fe(),i=ye("div"),gn(s.$$.fragment),ee(t,"class","backdrop svelte-1byz9vf"),ee(i,"class","api-docs-wrap svelte-1byz9vf"),ee(e,"class","api-docs svelte-1byz9vf")},m(r,_){De(r,e,_),oe(e,t),oe(e,n),oe(e,i),$n(s,i,null),o=!0,a||(c=vn(t,"click",l[46]),a=!0)},p(r,_){const u={};_[0]&65536&&(u.root_node=r[16]),_[0]&2&&(u.dependencies=r[1]),_[0]&1&&(u.root=r[0]),_[0]&1024&&(u.app=r[10]),_[0]&2048&&(u.space_id=r[11]),_[0]&1048576&&(u.api_calls=r[20]),_[0]&8192&&(u.username=r[13]),s.$set(u)},i(r){o||(ge(s.$$.fragment,r),o=!0)},o(r){Oe(s.$$.fragment,r),o=!1},d(r){r&&Ee(e),bn(s),a=!1,c()}}}function Bs(l){let e,t,n,i,s,o,a,c;return s=new L_({props:{pwa_enabled:l[10].config.pwa,root:l[0],space_id:l[11]}}),s.$on("close",l[49]),{c(){e=ye("div"),t=ye("div"),n=Fe(),i=ye("div"),gn(s.$$.fragment),ee(t,"class","backdrop svelte-1byz9vf"),ee(i,"class","api-docs-wrap svelte-1byz9vf"),ee(e,"class","api-docs svelte-1byz9vf")},m(r,_){De(r,e,_),oe(e,t),oe(e,n),oe(e,i),$n(s,i,null),o=!0,a||(c=vn(t,"click",l[48]),a=!0)},p(r,_){const u={};_[0]&1024&&(u.pwa_enabled=r[10].config.pwa),_[0]&1&&(u.root=r[0]),_[0]&2048&&(u.space_id=r[11]),s.$set(u)},i(r){o||(ge(s.$$.fragment,r),o=!0)},o(r){Oe(s.$$.fragment,r),o=!1},d(r){r&&Ee(e),bn(s),a=!1,c()}}}function Gs(l){let e,t;return e=new Bo({props:{messages:l[21]}}),e.$on("close",l[29]),{c(){gn(e.$$.fragment)},m(n,i){$n(e,n,i),t=!0},p(n,i){const s={};i[0]&2097152&&(s.messages=n[21]),e.$set(s)},i(n){t||(ge(e.$$.fragment,n),t=!0)},o(n){Oe(e.$$.fragment,n),t=!1},d(n){bn(e,n)}}}function Pu(l){let e,t,n,i,s,o,a,c,r,_,u,m,p=l[7]&&Ps(l),b=l[15]&&Is(l),d=l[16]&&l[10].config&&Os(l),$=l[6]&&Ds(l),f=l[19]&&Us(l),k=l[17]&&l[16]&&Rs(l),y=l[18]&&l[16]&&l[10].config&&Bs(l),g=l[21]&&Gs(l);return{c(){p&&p.c(),e=On(),b&&b.c(),t=On(),n=Fe(),i=ye("div"),s=ye("div"),d&&d.c(),o=Fe(),$&&$.c(),a=Fe(),f&&f.c(),c=Fe(),k&&k.c(),r=Fe(),y&&y.c(),_=Fe(),g&&g.c(),u=On(),ee(s,"class","contain svelte-1byz9vf"),An(s,"flex-grow",l[8]?"1":"auto"),ee(i,"class","wrap svelte-1byz9vf"),An(i,"min-height",l[8]?"100%":"auto")},m(w,v){p&&p.m(pn.head,null),oe(pn.head,e),b&&b.m(pn.head,null),oe(pn.head,t),De(w,n,v),De(w,i,v),oe(i,s),d&&d.m(s,null),oe(i,o),$&&$.m(i,null),De(w,a,v),f&&f.m(w,v),De(w,c,v),k&&k.m(w,v),De(w,r,v),y&&y.m(w,v),De(w,_,v),g&&g.m(w,v),De(w,u,v),m=!0},p(w,v){w[7]?p||(p=Ps(w),p.c(),p.m(e.parentNode,e)):p&&(p.d(1),p=null),w[15]?b?b.p(w,v):(b=Is(w),b.c(),b.m(t.parentNode,t)):b&&(b.d(1),b=null),w[16]&&w[10].config?d?(d.p(w,v),v[0]&66560&&ge(d,1)):(d=Os(w),d.c(),ge(d,1),d.m(s,null)):d&&(_n(),Oe(d,1,1,()=>{d=null}),an()),v[0]&256&&An(s,"flex-grow",w[8]?"1":"auto"),w[6]?$?$.p(w,v):($=Ds(w),$.c(),$.m(i,null)):$&&($.d(1),$=null),v[0]&256&&An(i,"min-height",w[8]?"100%":"auto"),w[19]?f?(f.p(w,v),v[0]&524288&&ge(f,1)):(f=Us(w),f.c(),ge(f,1),f.m(c.parentNode,c)):f&&(_n(),Oe(f,1,1,()=>{f=null}),an()),w[17]&&w[16]?k?(k.p(w,v),v[0]&196608&&ge(k,1)):(k=Rs(w),k.c(),ge(k,1),k.m(r.parentNode,r)):k&&(_n(),Oe(k,1,1,()=>{k=null}),an()),w[18]&&w[16]&&w[10].config?y?(y.p(w,v),v[0]&328704&&ge(y,1)):(y=Bs(w),y.c(),ge(y,1),y.m(_.parentNode,_)):y&&(_n(),Oe(y,1,1,()=>{y=null}),an()),w[21]?g?(g.p(w,v),v[0]&2097152&&ge(g,1)):(g=Gs(w),g.c(),ge(g,1),g.m(u.parentNode,u)):g&&(_n(),Oe(g,1,1,()=>{g=null}),an())},i(w){m||(ge(d),ge(f),ge(k),ge(y),ge(g),m=!0)},o(w){Oe(d),Oe(f),Oe(k),Oe(y),Oe(g),m=!1},d(w){w&&(Ee(n),Ee(i),Ee(a),Ee(c),Ee(r),Ee(_),Ee(u)),p&&p.d(w),Ee(e),b&&b.d(w),Ee(t),d&&d.d(),$&&$.d(),f&&f.d(w),k&&k.d(w),y&&y.d(w),g&&g.d(w)}}}const Iu=/^'([^]+)'$/,Ou=15,Du=10;function Hs(l){return"detail"in l}function Fu(l,e,t){let n,i,s,o,a;cn(l,Qn,q=>t(22,o=q)),Ol();let{root:c}=e,{components:r}=e,{layout:_}=e,{dependencies:u}=e,{title:m="Gradio"}=e,{target:p}=e,{autoscroll:b}
95=e,{show_api:d=!0}=e,{show_footer:$=!0}=e,{control_page_title:f=!1}=e,{app_mode:k}=e,{theme_mode:y}=e,{app:g}=e,{space_id:w}=e,{version:v}=e,{js:h}=e,{fill_height:E=!1}=e,{ready:S}=e,{username:C}=e,{api_prefix:z=""}=e,{max_file_size:A=void 0}=e,{initial_layout:N=void 0}=e,{css:M=null}=e,{layout:W,targets:ke,update_value:K,get_data:V,modify_stream:te,get_stream_state:U,set_time_limit:ie,loading_status:Ce,scheduled_updates:Te,create_layout:kn,rerender_layout:ro}=Fo(N);cn(l,W,q=>t(16,a=q)),cn(l,ke,q=>t(56,i=q)),cn(l,Ce,q=>t(42,n=q)),cn(l,Te,q=>t(57,s=q));let il=u;async function ao(){await kn({components:r,layout:_,dependencies:u,root:c+z,app:g,options:{fill_height:E}})}let{search_params:xt}=e,sl=xt.get("view")==="api"&&d,wn=xt.get("view")==="settings",en=xt.get("view")==="api-recorder"&&d;function tn(q){t(19,en=!1),t(17,sl=q);let R=new URLSearchParams(window.location.search);q?R.set("view","api"):R.delete("view"),history.replaceState(null,"","?"+R.toString())}function yn(q){let R=new URLSearchParams(window.location.search);q?R.set("view","settings"):R.delete("view"),history.replaceState(null,"","?"+R.toString()),t(18,wn=!wn)}let Cn=[],{render_complete:nn=!1}=e;async function Jl(q,R){const B=u.find(Z=>Z.id==R).outputs,D=q?.map((Z,qe)=>({id:B[qe],prop:"value_is_output",value:!0}));K(D),await Tn();const ne=[];q?.forEach((Z,qe)=>{if(typeof Z=="object"&&Z!==null&&Z.__type__==="update")for(const[Me,F]of Object.entries(Z))Me!=="__type__"&&ne.push({id:B[qe],prop:Me,value:F});else ne.push({id:B[qe],prop:"value",value:Z})}),K(ne),await Tn()}let lt=new Map,ae=[];function it(q,R,B,D,ne=10,Z=!0){return{title:q,message:R,fn_index:B,type:D,id:++co,duration:ne,visible:Z}}function Yl(q,R,B){t(21,ae=[it(q,R,-1,B),...ae])}let co=-1,ol=!1;const _o=o("blocks.long_requests_queue"),uo=o("blocks.connection_can_break"),fo=o("blocks.lost_connection"),po=o("blocks.waiting_for_inputs");let rl=!1,Kl=!1,Xl=!1,ln=[];function Ut(q,R=null,B=null){let D=()=>{};function ne(){D()}s?D=Te.subscribe(Z=>{Z||Tn().then(()=>{xl(q,R,B),ne()})}):xl(q,R,B)}async function mo(q,R,B){return q===R&&B&&B.is_value_data===!0?B.value:V(q)}async function xl(q,R=null,B=null){let D=u.find(F=>F.id===q);if(ln.length>0){for(const F of ln)if(D.inputs.includes(F)){Yl("Warning",po,"warning");return}}const ne=Ce.get_status_for_fn(q);t(21,ae=ae.filter(({fn_index:F})=>F!==q)),(ne==="pending"||ne==="generating")&&(D.pending_request=!0);let Z={fn_index:q,data:await Promise.all(D.inputs.map(F=>mo(F,R,B))),event_data:D.collects_event_data?B:null,trigger_id:R};D.frontend_fn?D.frontend_fn(Z.data.concat(await Promise.all(D.outputs.map(F=>V(F))))).then(F=>{D.backend_fn?(Z.data=F,qe(D,Z)):Jl(F,q)}):D.types.cancel&&D.cancels?await Promise.all(D.cancels.map(async F=>{const st=lt.get(F);return st?.cancel(),st})):D.backend_fn&&qe(D,Z);function qe(F,st){F.trigger_mode==="once"?F.pending_request||Me(st,F.connection=="stream"):F.trigger_mode==="multiple"?Me(st,F.connection=="stream"):F.trigger_mode==="always_last"&&(F.pending_request?F.final_event=st:Me(st,F.connection=="stream"))}async function Me(F,st=!1){en&&t(20,Cn=[...Cn,JSON.parse(JSON.stringify(F))]);let al;if(g.set_current_payload(F),st)if(!lt.has(q))D.inputs.forEach(le=>te(le,"waiting"));else{if(lt.has(q)&&D.inputs.some(le=>U(le)==="waiting"))return;if(lt.has(q)&&D.inputs.some(le=>U(le)==="open")){await g.send_ws_message(`${g.config.root+g.config.api_prefix}/stream/${lt.get(q).event_id()}`,{...F,session_hash:g.session_hash});return}}try{al=g.submit(F.fn_index,F.data,F.event_data,F.trigger_id)}catch(le){if(!g.stream_status.open)return;t(21,ae=[it("Error",String(le),0,"error"),...ae]),Ce.update({status:"error",fn_index:0,eta:0,queue:!1,queue_position:null}),qn(n);return}lt.set(q,al);for await(const le of al)le.type==="data"?zo(le):le.type==="render"?Lo(le):le.type==="status"?Ao(le):le.type==="log"&&No(le);function zo(le){const{data:$e,fn_index:X}=le;D.pending_request&&D.final_event&&(D.pending_request=!1,Me(D.final_event,D.connection=="stream")),D.pending_request=!1,Jl($e,X),qn(n)}function Lo(le){const{data:$e}=le;let X=$e.components,he=$e.layout,ot=$e.dependencies,Ct=$e.render_id,qt=[];u.forEach((sn,To)=>{sn.rendered_in===Ct&&qt.push(To)}
95),qt.reverse().forEach(sn=>{u.splice(sn,1)}),ot.forEach(sn=>{u.push(sn)}),ro({components:X,layout:he,root:c+z,dependencies:u,render_id:Ct})}function No(le){const{title:$e,log:X,fn_index:he,level:ot,duration:Ct,visible:qt}=le;t(21,ae=[it($e,X,he,ot,Ct,qt),...ae])}function jo(le,$e,X){le.original_msg==="process_starts"&&X.connection==="stream"&&te($e,"open")}function Ao(le){const{fn_index:$e,...X}=le;if(X.stage==="streaming"&&X.time_limit&&D.inputs.forEach(he=>{ie(he,X.time_limit)}),D.inputs.forEach(he=>{jo(le,he,D)}),Ce.update({...X,time_limit:X.time_limit,status:X.stage,progress:X.progress_data,fn_index:$e}),qn(n),!Kl&&w!==null&&X.position!==void 0&&X.position>=2&&X.eta!==void 0&&X.eta>Ou&&(Kl=!0,t(21,ae=[it("Warning",_o,$e,"warning"),...ae])),!Xl&&rl&&X.eta!==void 0&&X.eta>Du&&(Xl=!0,t(21,ae=[it("Warning",uo,$e,"warning"),...ae])),(X.stage==="complete"||X.stage==="generating")&&X.changed_state_ids?.forEach(he=>{u.filter(ot=>ot.targets.some(([Ct,qt])=>Ct===he)).forEach(ot=>{Ut(ot.id,F.trigger_id)})}),X.stage==="complete"&&(u.forEach(async he=>{he.trigger_after===$e&&Ut(he.id,F.trigger_id)}),D.inputs.forEach(he=>{te(he,"closed")}),lt.delete(q)),X.broken&&rl&&ol)window.setTimeout(()=>{t(21,ae=[it("Error",fo,$e,"error"),...ae])},0),Ut(D.id,F.trigger_id,B),ol=!1;else if(X.stage==="error"){if(X.message){const he=X.message.replace(Iu,(Ct,qt)=>qt),ot=X.title??"Error";t(21,ae=[it(ot,he,$e,"error",X.duration,X.visible),...ae])}u.map(async he=>{he.trigger_after===$e&&!he.trigger_only_on_success&&Ut(he.id,F.trigger_id)})}}}}function ho(q,R){if(w===null)return;const B=new URL(`https://huggingface.co/spaces/${w}/discussions/new`);q!==void 0&&q.length>0&&B.searchParams.set("title",q),B.searchParams.set("description",R),window.open(B.toString(),"_blank")}function go(q){const R=q.detail;t(21,ae=ae.filter(B=>B.id!==R))}const bo=q=>!!(q&&new URL(q,location.href).origin!==location.origin);async function vo(){h&&await new Uo(`let result = await (${h})(); 96 return (!Array.isArray(result)) ? [result] : result;`)(),await Tn();for(var q=p.getElementsByTagName("a"),R=0;R<q.length;R++){const B=q[R].getAttribute("target"),D=q[R].getAttribute("href");bo(D)&&B!=="_blank"&&q[R].setAttribute("target","_blank")}ei(),!(!p||nn)&&(p.addEventListener("prop_change",B=>{if(!Hs(B))throw new Error("not a custom event");const{id:D,prop:ne,value:Z}=B.detail;K([{id:D,prop:ne,value:Z}]),ne==="input_ready"&&Z===!1&&ln.push(D),ne==="input_ready"&&Z===!0&&(ln=ln.filter(qe=>qe!==D))}),p.addEventListener("gradio",B=>{if(!Hs(B))throw new Error("not a custom event");const{id:D,event:ne,data:Z}=B.detail;if(ne==="share"){const{title:qe,description:Me}=Z;ho(qe,Me)}else ne==="error"?t(21,ae=[it("Error",Z,-1,ne),...ae]):ne==="warning"?t(21,ae=[it("Warning",Z,-1,ne),...ae]):ne=="clear_status"?$o(D,"complete",Z):ne=="close_stream"?i[D]?.[Z]?.forEach(Me=>{if(lt.has(Me)){const F=`${g.config.root+g.config.api_prefix}/stream/${lt.get(Me).event_id()}`;g.post_data(`${F}/close`,{}),g.close_ws(F)}}):i[D]?.[ne]?.forEach(Me=>{requestAnimationFrame(()=>{Ut(Me,D,Z)})})}),t(31,nn=!0))}const ei=()=>{u.forEach(q=>{q.targets.some(R=>R[1]==="load")&&Ut(q.id)})};function $o(q,R,B){B.status=R,K([{id:q,prop:"loading_status",value:B}])}function qn(q){let R=[];Object.entries(q).forEach(([ne,Z])=>{if(!g.stream_status.open&&Z.status==="error")return;let qe=u.find(Me=>Me.id==Z.fn_index);qe!==void 0&&(Z.scroll_to_output=qe.scroll_to_output,Z.show_progress=qe.show_progress,R.push({id:parseInt(ne),prop:"loading_status",value:Z}))});const B=Ce.get_inputs_to_update(),D=Array.from(B).map(([ne,Z])=>({id:ne,prop:"pending",value:Z==="pending"}));K([...R,...D])}Mu(()=>{document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&(ol=!0)}),rl=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)});const ko=()=>{tn(!sl)},wo=()=>{yn(!wn)},yo=()=>{tn(!0),t(19,en=!1)},Co=()=>{tn(!1)},qo=q=>{tn(!1),t(20,Cn=[]),t(19,en=q.detail?.api_recorder_visible)},Eo=()=>{yn(!1)},So=q=>{yn(!1)};return l.$$set=q=>{"root"in q&&t(0,c=q.root),"components"in q&&t(33,r=q.components),"layout"in q&&t(34,_=q.layout),"depen
96dencies"in q&&t(1,u=q.dependencies),"title"in q&&t(2,m=q.title),"target"in q&&t(3,p=q.target),"autoscroll"in q&&t(4,b=q.autoscroll),"show_api"in q&&t(5,d=q.show_api),"show_footer"in q&&t(6,$=q.show_footer),"control_page_title"in q&&t(7,f=q.control_page_title),"app_mode"in q&&t(8,k=q.app_mode),"theme_mode"in q&&t(9,y=q.theme_mode),"app"in q&&t(10,g=q.app),"space_id"in q&&t(11,w=q.space_id),"version"in q&&t(12,v=q.version),"js"in q&&t(35,h=q.js),"fill_height"in q&&t(36,E=q.fill_height),"ready"in q&&t(32,S=q.ready),"username"in q&&t(13,C=q.username),"api_prefix"in q&&t(37,z=q.api_prefix),"max_file_size"in q&&t(14,A=q.max_file_size),"initial_layout"in q&&t(38,N=q.initial_layout),"css"in q&&t(15,M=q.css),"search_params"in q&&t(39,xt=q.search_params),"render_complete"in q&&t(31,nn=q.render_complete)},l.$$.update=()=>{l.$$.dirty[0]&1035|l.$$.dirty[1]&44&&ao(),l.$$.dirty[0]&65536&&t(32,S=!!a),l.$$.dirty[0]&2|l.$$.dirty[1]&1025&&u!==il&&nn&&(ei(),t(41,il=u)),l.$$.dirty[1]&2048&&qn(n)},[c,u,m,p,b,d,$,f,k,y,g,w,v,C,A,M,a,sl,wn,en,Cn,ae,o,W,ke,Ce,Te,tn,yn,go,vo,nn,S,r,_,h,E,z,N,xt,Yl,il,n,ko,wo,yo,Co,qo,Eo,So]}class rf extends Nu{constructor(e){super(),Au(this,e,Fu,Pu,Tu,{root:0,components:33,layout:34,dependencies:1,title:2,target:3,autoscroll:4,show_api:5,show_footer:6,control_page_title:7,app_mode:8,theme_mode:9,app:10,space_id:11,version:12,js:35,fill_height:36,ready:32,username:13,api_prefix:37,max_file_size:14,initial_layout:38,css:15,search_params:39,render_complete:31,add_new_message:40},null,[-1,-1,-1])}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),se()}get components(){return this.$$.ctx[33]}set components(e){this.$$set({components:e}),se()}get layout(){return this.$$.ctx[34]}set layout(e){this.$$set({layout:e}),se()}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),se()}get title(){return this.$$.ctx[2]}set title(e){this.$$set({title:e}),se()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),se()}get autoscroll(){return this.$$.ctx[4]}set autoscroll(e){this.$$set({autoscroll:e}),se()}get show_api(){return this.$$.ctx[5]}set show_api(e){this.$$set({show_api:e}),se()}get show_footer(){return this.$$.ctx[6]}set show_footer(e){this.$$set({show_footer:e}),se()}get control_page_title(){return this.$$.ctx[7]}set control_page_title(e){this.$$set({control_page_title:e}),se()}get app_mode(){return this.$$.ctx[8]}set app_mode(e){this.$$set({app_mode:e}),se()}get theme_mode(){return this.$$.ctx[9]}set theme_mode(e){this.$$set({theme_mode:e}),se()}get app(){return this.$$.ctx[10]}set app(e){this.$$set({app:e}),se()}get space_id(){return this.$$.ctx[11]}set space_id(e){this.$$set({space_id:e}),se()}get version(){return this.$$.ctx[12]}set version(e){this.$$set({version:e}),se()}get js(){return this.$$.ctx[35]}set js(e){this.$$set({js:e}),se()}get fill_height(){return this.$$.ctx[36]}set fill_height(e){this.$$set({fill_height:e}),se()}get ready(){return this.$$.ctx[32]}set ready(e){this.$$set({ready:e}),se()}get username(){return this.$$.ctx[13]}set username(e){this.$$set({username:e}),se()}get api_prefix(){return this.$$.ctx[37]}set api_prefix(e){this.$$set({api_prefix:e}),se()}get max_file_size(){return this.$$.ctx[14]}set max_file_size(e){this.$$set({max_file_size:e}),se()}get initial_layout(){return this.$$.ctx[38]}set initial_layout(e){this.$$set({initial_layout:e}),se()}get css(){return this.$$.ctx[15]}set css(e){this.$$set({css:e}),se()}get search_params(){return this.$$.ctx[39]}set search_params(e){this.$$set({search_params:e}),se()}get render_complete(){return this.$$.ctx[31]}set render_complete(e){this.$$set({render_complete:e}),se()}get add_new_message(){return this.$$.ctx[40]}}export{rf as default}; 97//# sourceMappingURL=Blocks-C5Dl1NWu.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.