1import{$ as Qn,s as Ol,l as zo,k as Po,b as Io,o as Oo,q as Do,c as Fo,p as ti,A as Uo}from"./index-DblUErZU.js";import{B as Jn}from"./Button-mfKmlxW1.js";import{L as Vs}from"./index-D29jzgdp.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-BOpxTcdu.js";import"./MarkdownCode.svelte_svelte_type_style_lang-D4hyIukF.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import{B as hn}from"./Block-DdQws7Te.js";import{c as Ro}from"./Dropdown-DZ7xz0Ll.js";/* empty css */import{T as Bo}from"./Toast-IlYPj9Ta.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-CHJl5SWg.js";import"./index-DcK7hFxz.js";import"./BlockTitle-2iiXf15h.js";import"./Info-DGu0eRQE.js";import"./MarkdownCode-rVYWo3Q5.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,d,m,b,p;return d=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(d.$$.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(d,u,null),m=!0,b||(p=tr(u,"click",l[2]),b=!0)},p($,[f]){(!m||f&1)&&ir(a,$[0])},i($){m||(sr(d.$$.fragment,$),m=!0)},o($){or(d.$$.fragment,$),m=!1},d($){$&&(ul(e),ul(_),ul(u)),Xo(d),b=!1,p()}}}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:
vendor: 40,429 bytes, lines 11-64
11Fe,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")},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,d,m,b,p,$,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),d=un(),m=Ke("p"),b=Ke("span"),p=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),Fe(e,t),Fe(e,i),Fe(e,s),Fe(s,o),Fe(s,a),Fe(a,c),Fe(e,r),Fe(e,_),oi(u,_,null),Fe(_,d),Fe(_,m),Fe(m,b),Fe(b,p),Fe(m,$),E&&E.m(m,null),Fe(m,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 L={};C&32&&(L.$$scope={dirty:C,ctx:S}),u.$set(L),(!w||C&2)&&ri(p,S[1]),S[1]>1?E||(E=_i(),E.c(),E.m(m,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:Se,element:Be,empty:Qs,ensure_array_like:ui,flush:Ln,group_outros:Lr,init:Nr,insert:Le,mount_component:jr,noop:Ar,safe_not_equal:Tr,set_data:mt,set_style:At,space:Tt,text:ze,toggle_class:fi,transition_in:zn,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=ze("s")},m(t,n){Le(t,e,n)},d(t){t&&Se(e)}}}function Mr(l){let e=(l[2][l[11]].type||"any")+"",t;return{c(){t=ze(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&&Se(t)}}}function zr(l){let e=l[5].type+"",t,n,i=l[8]&&l[9]===null&&mi();return{c(){t=ze(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&&(Se(t),Se(n)),i&&i.d(s)}}}function mi(l){let e;return{c(){e=ze(`Â | 13 None`)},m(t,n){Le(t,e,n)},d(t){t&&Se(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=ze(n),dt(t,"class","code svelte-1yt946s"),At(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&&(Se(e),Se(t))}}}function Ir(l){let e;return{c(){e=Be("span"),e.textContent="Required",At(e,"font-weight","bold")},m(t,n){Le(t,e,n)},p:Ar,d(t){t&&Se(e)}}}function hi(l){let e,t,n,i,s,o=(l[3]!=="bash"&&l[7]?l[7]:"["+l[11]+"]")+"",a,c,r,_,u,d,m,b=l[4]+"",p,$,f=l[6]+"",k,y,g=l[5].description+"",w,v;function h(j,z){return j[3]==="python"?zr:Mr}let E=h(l),S=E(l);function C(j,z){return!j[8]||j[3]=="bash"?Ir:Pr}let L=C(l),T=L(l);return{c(){e=Be("hr"),t=Tt(),n=Be("div"),i=Be("p"),s=Be("span"),a=ze(o),c=Tt(),r=Be("span"),S.c(),_=Tt(),T.c(),u=Tt(),d=Be("p"),m=ze('The input value that is provided in the "'),p=ze(b),$=ze('" '),k=ze(f),y=ze(` 14 component. `),w=ze(g),v=Tt(),dt(e,"class","hr svelte-1yt946s"),dt(s,"class","code svelte-1yt946s"),At(s,"margin-right","10px"),dt(r,"class","code highlight svelte-1yt946s"),At(r,"margin-right","10px"),At(i,"white-space","nowrap"),At(i,"overflow-x","auto"),dt(d,"class","desc svelte-1yt946s"),At(n,"margin","10px")},m(j,z){Le(j,e,z),Le(j,t,z),Le(j,n,z),_e(n,i),_e(i,s),_e(s,a),_e(i,c),_e(i,r),S.m(r,null),_e(i,_),T.m(i,null),_e(n,u),_e(n,d),_e(d,m),_e(d,p),_e(d,$),_e(d,k),_e(d,y),_e(d,w),_e(n,v)},p(j,z){z&10&&o!==(o=(j[3]!=="bash"&&j[7]?j[7]:"["+j[11]+"]")+"")&&mt(a,o),E===(E=h(j))&&S?S.p(j,z):(S.d(1),S=E(j),S&&(S.c(),S.m(r,null))),L===(L=C(j))&&T?T.p(j,z):(T.d(1),T=L(j),T&&(T.c(),T.m(i,null))),z&2&&b!==(b=j[4]+"")&&mt(p,b),z&2&&f!==(f=j[6]+"")&&mt(k,f),z&2&&g!==(g=j[5].description+"")&&mt(w,g)},d(j){j&&(Se(e),Se(t),Se(n)),S.d(),T.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),jr(t,e,null),n=!0},i(i){n||(zn(t.$$.fragment,i),n=!0)},o(i){El(t.$$.fragment,i),n=!1},d(i){i&&Se(e),Er(t)}}}function Or(l){let e,t,n,i=l[1].length+"",s,o,a,c,r,_,u,d,m=l[1].length!=1&&di(),b=ui(l[1]),p=[];for(let f=0;f<b.length;f+=1)p[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=ze(` 15 Accepts `),s=ze(i),o=ze(" parameter"),m&&m.c(),a=ze(":"),c=Tt(),r=Be("div");for(let f=0;f<p.length;f+=1)p[f].c();_=Tt(),$&&$.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),m&&m.m(e,null),_e(e,a),Le(f,c,k),Le(f,r,k);for(let y=0;y<p.length;y+=1)p[y]&&p[y].m(r,null);Le(f,_,k),$&&$.m(f,k),Le(f,u,k),d=!0},p(f,[k]){if((!d||k&2)&&i!==(i=f[1].length+"")&&mt(s,i),f[1].length!=1?m||(m=di(),m.c(),m.m(e,a)):m&&(m.d(1),m=null),k&14){b=ui(f[1]);let y;for(y=0;y<b.length;y+=1){const g=pi(f,b,y);p[y]?p[y].p(g,k):(p[y]=hi(g),p[y].c(),p[y].m(r,null))}for(;y<p.length;y+=1)p[y].d(1);p.length=b.length}(!d||k&1)&&fi(r,"hide",f[0]),f[0]?$?k&1&&zn($,1):($=gi(),$.c(),zn($,1),$.m(u.parentNode,u)):$&&(Lr(),El($,1,1,()=>{$=null}),Cr())},i(f){d||(zn($),d=!0)},o(f){El($),d=!1},d(f){f&&(Se(e),Se(c),Se(r),Se(_),Se(u)),m&&m.d(),Sr(p,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(),Nr(this,e,Dr,Or,Tr,{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: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:A,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:N,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 La(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 Na(l){let e,t;return e=new hn({props:{$$slots:{default:[Ta]},$$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 ja(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 Aa(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 Li(l){let e;return{c(){e=N(",")},m(t,n){H(t,e,n)},d(t){t&&G(e)}}}function Ni(l){let e,t=Ze(l[22],l[21].type,"bash")+"",n,i,s=l[27]<l[4].length-1&&Li();return{c(){e=N(` 18 `),n=N(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=Li(),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 Ta(l){let e,t,n,i,s,o,a,c,r,_,u=l[0].api_name+"",d,m,b="{",p,$,f,k="}",y,g,w="{",v,h,E="}",S,C,L,T,j,z=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]=Ni(Ci(l,V,U));return{c(){e=re("code"),t=re("div"),kt(n.$$.fragment),i=xn(),s=re("div"),o=re("pre"),a=N("curl -X POST "),c=N(l[11]),r=N(l[12]),_=N("/call/"),d=N(u),m=N(` -s -H "Content-Type: application/json" -d '`),p=N(b),$=N(` 19 "data": [`);for(let U=0;U<te.length;U+=1)te[U].c();f=N(` 20]`),y=N(k),g=N(`' \\ 21 | awk -F'"' '`),v=N(w),h=N(" print $4"),S=N(E),C=N(`' \\ 22 | read EVENT_ID; curl -N `),L=N(l[11]),T=N(l[12]),j=N("/call/"),W=N(z),ke=N("/$EVENT_ID"),fe(t,"class","copy svelte-114qcyq"),fe(o,"class","svelte-114qcyq"),fe(e,"class","svelte-114qcyq")},m(U,se){H(U,e,se),A(e,t),yt(n,t,null),A(e,i),A(e,s),A(s,o),A(o,a),A(o,c),A(o,r),A(o,_),A(o,d),A(o,m),A(o,p),A(o,$);for(let Ce=0;Ce<te.length;Ce+=1)te[Ce]&&te[Ce].m(o,null);A(o,f),A(o,y),A(o,g),A(o,v),A(o,h),A(o,S),A(o,C),A(o,L),A(o,T),A(o,j),A(o,W),A(o,ke),l[19](s),K=!0},p(U,se){const Ce={};if(se[0]&1024&&(Ce.code=U[10]?.innerText),n.$set(Ce),(!K||se[0]&2048)&&be(c,U[11]),(!K||se[0]&4096)&&be(r,U[12]),(!K||se[0]&1)&&u!==(u=U[0].api_name+"")&&be(d,u),se[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,se):(te[Te]=Ni(kn),te[Te].c(),te[Te].m(o,f))}for(;Te<te.length;Te+=1)te[Te].d(1);te.length=V.length}(!K||se[0]&2048)&&be(L,U[11]),(!K||se[0]&4096)&&be(T,U[12]),(!K||se[0]&1)&&z!==(z=U[0].api_name+"")&&be(W,z)},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 ji(l){let e,t,n,i=l[22].url+"",s,o,a=l[30]+"",c,r,_,u;return{c(){e=N(` 23const response_`),t=N(l[27]),n=N(' = await fetch("'),s=N(i),o=N(`"); 24const example`),c=N(a),r=N(" = await response_"),_=N(l[27]),u=N(`.blob(); 25 `)},m(d,m){H(d,e,m),H(d,t,m),H(d,n,m),H(d,s,m),H(d,o,m),H(d,c,m),H(d,r,m),H(d,_,m),H(d,u,m)},p:qa,d(d){d&&(G(e),G(t),G(n),G(s),G(o),G(c),G(r),G(_),G(u))}}}function Ai(l){let e,t,n;return{c(){e=N(', {auth: ["'),t=N(l[6]),n=N('", **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 Ma(l){let e;return{c(){e=N(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 za(l){let e,t,n=l[0].api_name+"",i,s;return{c(){e=re("span"),t=N('"/'),i=N(n),s=N('"'),fe(e,"class","api-name svelte-114qcyq")},m(o,a){H(o,e,a),A(e,t),A(e,i),A(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=N(` 26 `),t=re("span"),i=N(n),s=N(": "),a=N(o),c=N(", "),fe(t,"class","example-inputs")},m(r,_){H(r,e,_),H(r,t,_),A(t,i),A(t,s),A(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=N(` 27 `),t=re("span"),i=N(n),s=N(": example"),a=N(o),c=N(", "),r=re("span"),r.innerHTML="",fe(t,"class","example-inputs"),fe(r,"class","desc svelte-114qcyq")},m(_,u){H(_,e,u),H(_,t,u),A(t,i),A(t,s),A(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 Ti(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])+"",d,m,b,p,$,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]=ji(Ei(l,k,C));let g=l[6]!==null&&Ai(l);function w(C,L){return C[5]?za:Ma}let v=w(l),h=v(l),E=ht(l[4]),S=[];for(let C=0;C<E.length;C+=1)S[C]=Ti(qi(l,E,C));return{c(){e=re("code"),t=re("div"),kt(n.$$.fragment),i=xn(),s=re("div"),o=re("pre"),a=N(`import { Client } from "@gradio/client"; 28`);for(let C=0;C<y.length;C+=1)y[C].c();c=N(` 29const client = await Client.connect(`),r=re("span"),_=N('"'),d=N(u),m=N('"'),g&&g.c(),b=N(`); 30const result = await client.predict(`),h.c(),p=N(", { ");for(let C=0;C<S.length;C+=1)S[C].c();$=N(` 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,L){H(C,e,L),A(e,t),yt(n,t,null),A(e,i),A(e,s),A(s,o),A(o,a);for(let T=0;T<y.length;T+=1)y[T]&&y[T].m(o,null);A(o,c),A(o,r),A(r,_),A(r,d),A(r,m),g&&g.m(o,null),A(o,b),h.m(o,null),A(o,p);for(let T=0;T<S.length;T+=1)S[T]&&S[T].m(o,null);A(o,$),l[18](s),f=!0},p(C,L){const T={};if(L[0]&512&&(T.code=C[9]?.innerText),n.$set(T),L[0]&32768){k=ht(C[15]);let j;for(j=0;j<k.length;j+=1){const z=Ei(C,k,j);y[j]?y[j].p(z,L):(y[j]=ji(z),y[j].c(),y[j].m(o,c))}for(;j<y.length;j+=1)y[j].d(1);y.length=k.length}if((!f||L[0]&12)&&u!==(u=(C[3]||C[2])+"")&&be(d,u),C[6]!==null?g?g.p(C,L):(g=Ai(C),g.c(),g.m(o,b)):g&&(g.d(1),g=null),v===(v=w(C))&&h?h.p(C,L):(h.d(1),h=v(C),h&&(h.c(),h.m(o,p))),L[0]&16400){E=ht(C[4]);let j;for(j=0;j<E.length;j+=1){const z=qi(C,E,j);S[j]?S[j].p(z,L):(S[j]=Ti(z),S[j].c(),S[j].m(o,$))}for(;j<S.length;j+=1)S[j].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=N(", handle_file")},m(t,n){H(t,e,n)},d(t){t&&G(e)}}}function Mi(l){let e,t,n;return{c(){e=N(', auth=("'),t=N(l[6]),n=N('", **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 zi(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=N(` 35 `),n=N(t),i=re("span"),o=N(s),a=N(",")},m(c,r){H(c,e,r),H(c,n,r),H(c,i,r),A(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,d,m,b=(l[3]||l[2])+"",p,$,f,k,y,g,w,v,h=l[0].api_name+"",E,S,C,L,T,j;n=new _t({props:{code:l[8]?.innerText}});let z=l[13]&&Da(),W=l[6]!==null&&Mi(l),ke=ht(l[4]),K=[];for(let V=0;V<ke.length;V+=1)K[V]=zi(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=N(" gradio_client "),r=re("span"),r.textContent="import",_=N(" Client"),z&&z.c(),u=N(` 36 37client = Client(`),d=re("span"),m=N('"'),p=N(b),$=N('"'),W&&W.c(),f=N(`) 38result = client.`),k=re("span"),k.textContent="predict",y=N("(");for(let V=0;V<K.length;V+=1)K[V].c();g=N(` 39 api_name=`),w=re("span"),v=N('"/'),E=N(h),S=N('"'),C=N(` 40) 41`),L=re("span"),L.textContent="print",T=N("(result)"),fe(t,"class","copy svelte-114qcyq"),fe(a,"class","highlight"),fe(r,"class","highlight"),fe(d,"class","token string svelte-114qcyq"),fe(k,"class","highlight"),fe(w,"class","api-name svelte-114qcyq"),fe(L,"class","highlight"),fe(o,"class","svelte-114qcyq"),fe(e,"class","svelte-114qcyq")},m(V,te){H(V,e,te),A(e,t),yt(n,t,null),A(e,i),A(e,s),A(s,o),A(o,a),A(o,c),A(o,r),A(o,_),z&&z.m(o,null),A(o,u),A(o,d),A(d,m),A(d,p),A(d,$),W&&W.m(o,null),A(o,f),A(o,k),A(o,y);for(let U=0;U<K.length;U+=1)K[U]&&K[U].m(o,null);A(o,g),A(o,w),A(w,v),A(w,E),A(w,S),A(o,C),A(o,L),A(o,T),l[17](s),j=!0},p(V,te){const U={};if(te[0]&256&&(U.code=V[8]?.innerText),n.$set(U),(!j||te[0]&12)&&b!==(b=(V[3]||V[2])+"")&&be(p,b),V[6]!==null?W?W.p(V,te):(W=Mi(V),W.c(),W.m(o,f)):W&&(W.d(1),W=null),te[0]&16){ke=ht(V[4]);let se;for(se=0;se<ke.length;se+=1){const Ce=Si(V,ke,se);K[se]?K[se].p(Ce,te):(K[se]=zi(Ce),K[se].c(),K[se].m(o,g))}for(;se<K.length;se+=1)K[se].d(1);K.length=ke.length}(!j||te[0]&1)&&h!==(h=V[0].api_name+"")&&be(E,h)},i(V){j||(Qe(n.$$.fragment,V),j=!0)},o(V){Je(n.$$.fragment,V),j=!1},d(V){V&&G(e),wt(n),z&&z.d(),W&&W.d(),Rn(K,V),l[17](null)}}}function Ua(l){let e,t,n,i,s,o,a;const c=[La,Sa],r=[];function _(b,p){return b[5]?0:1}t=_(l),n=r[t]=c[t](l);const u=[Aa,ja,Na],d=[];function m(b,p){return b[7]==="python"?0:b[7]==="javascript"?1:b[7]==="bash"?2:-1}return~(s=m(l))&&(o=d[s]=u[s](l)),{c(){e=re("div"),n.c(),i=xn(),o&&o.c(),fe(e,"class","container svelte-114qcyq")},m(b,p){H(b,e,p),r[t].m(e,null),A(e,i),~s&&d[s].m(e,null),a=!0},p(b,p){let $=t;t=_(b),t===$?r[t].p(b,p):(yi(),Je(r[$],1,1,()=>{r[$]=null}),wi(),n=r[t],n?n.p(b,p):(n=r[t]=c[t](b),n.c()),Qe(n,1),n.m(e,i));let f=s;s=m(b),s===f?~s&&d[s].p(b,p):(o&&(yi(),Je(d[f],1,1,()=>{d[f]=null}),wi()),~s?(o=d[s],o?o.p(b,p):(o=d[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&&d[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:d}=e,{current_language:m}=e,b,p,$,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"](()=>{p=h,t(9,p)})}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,d=h.username),"current_language"in h&&t(7,m=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,d,m,b,p,$,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:M,attr:Ee,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();Ee(t,"class","copy svelte-j71ub0"),Ee(e,"class","svelte-j71ub0")},m(r,_){me(r,e,_),M(e,t),nl(n,t,null),M(e,i),M(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 d;for(d=0;d<a.length;d+=1){const m=Pi(r,a,d);c[d]?c[d].p(m,_):(c[d]=Di(m),c[d].c(),c[d].m(s,null))}for(;d<c.length;d+=1)c[d].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,d,m;n=new _t({props:{code:l[5]?.innerText}});let b=l[2]!==null&&Fi(l),p=Jt(l[8]),$=[];for(let f=0;f<p.length;f+=1)$[f]=Ri(Ii(l,p,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(),d=O(`); 44 `);for(let f=0;f<$.length;f+=1)$[f].c();Ee(t,"class","copy svelte-j71ub0"),Ee(c,"class","token string svelte-j71ub0"),Ee(o,"class","svelte-j71ub0"),Ee(e,"class","svelte-j71ub0")},m(f,k){me(f,e,k),M(e,t),nl(n,t,null),M(e,i),M(e,s),M(s,o),M(o,a),M(o,c),M(c,r),M(c,_),M(c,u),b&&b.m(o,null),M(o,d);for(let y=0;y<$.length;y+=1)$[y]&&$[y].m(o,null);l[15](s),m=!0},p(f,k){const y={};if(k&32&&(y.code=f[5]?.innerText),n.$set(y),(!m||k&1)&&Ve(_,f[0]),f[2]!==null?b?b.p(f,k):(b=Fi(f),b.c(),b.m(o,d)):b&&(b.d(1),b=null),k&256){p=Jt(f[8]);let g;for(g=0;g<p.length;g+=1){const w=Ii(f,p,g);$[g]?$[g].p(w,k):($[g]=Ri(w),$[g].c(),$[g].m(o,null))}for(;g<$.length;g+=1)$[g].d(1);$.length=p.length}},i(f){m||(Yt(n.$$.fragment,f),m=!0)},o(f){Kt(n.$$.fragment,f),m=!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,d,m,b,p,$;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"),d=O('"'),m=O(l[0]),b=O('"'),f&&f.c(),p=O(`) 47`);for(let g=0;g<y.length;g+=1)y[g].c();Ee(t,"class","copy svelte-j71ub0"),Ee(a,"class","highlight"),Ee(r,"class","highlight"),Ee(u,"class","token string svelte-j71ub0"),Ee(o,"class","svelte-j71ub0"),Ee(e,"class","svelte-j71ub0")},m(g,w){me(g,e,w),M(e,t),nl(n,t,null),M(e,i),M(e,s),M(s,o),M(o,a),M(o,c),M(o,r),M(o,_),M(o,u),M(u,d),M(u,m),M(u,b),f&&f.m(o,null),M(o,p);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(m,g[0]),g[2]!==null?f?f.p(g,w):(f=Bi(g),f.c(),f.m(o,p)):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]+"",d,m,b="}",p,$,f="{",k,y,g="}",w,v,h,E,S=l[21]+"",C,L,T,j;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": [`),d=O(u),m=O("]"),p=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),L=O("/$EVENT_ID"),T=ll(),j=pe("br"),Ee(e,"class","svelte-j71ub0")},m(z,W){me(z,e,W),M(e,t),M(e,n),M(e,i),M(e,o),M(e,a),M(e,r),M(e,_),M(e,d),M(e,m),M(e,p),M(e,$),M(e,k),M(e,y),M(e,w),M(e,v),M(e,h),M(e,E),M(e,C),M(e,L),me(z,T,W),me(z,j,W)},p(z,W){W&1&&Ve(n,z[0]),W&512&&s!==(s=z[21]+"")&&Ve(o,s),W&512&&u!==(u=z[20]+"")&&Ve(d,u),W&1&&Ve(h,z[0]),W&512&&S!==(S=z[21]+"")&&Ve(C,S)},d(z){z&&(de(e),de(T),de(j))}}}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 `),Ee(t,"class","api-name svelte-j71ub0")},m(r,_){me(r,e,_),me(r,t,_),M(t,n),M(t,s),M(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,d;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('"'),d=O(` 56) 57`),Ee(a,"class","api-name svelte-j71ub0"),Ee(t,"class","highlight")},m(m,b){me(m,e,b),me(m,t,b),M(t,n),M(t,s),M(t,o),M(t,a),M(a,c),M(a,_),M(a,u),M(t,d)},p(m,b){b&128&&i!==(i=m[20]+"")&&Ve(s,i),b&128&&r!==(r=m[21]+"")&&Ve(_,r)},d(m){m&&(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),Ee(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,d,{api_calls:m=[]}=e;async function b(){return await(await fetch(s.replace(/\/$/,"")+o+"/info/?all_endpoints=true")).json()}let p,$=[],f=[],k=[];function y(h,E){const S=`/${n[h.fn_index].api_name}`,L=h.data.filter(T=>typeof T<"u").map((T,j)=>{if(p[S]){const z=p[S].parameters[j];if(!z)return;const W=z.parameter_name,ke=z.python_type.type;if(E==="py")return` ${W}=${Ze(T,ke,"py")}`;if(E==="js")return` ${W}: ${Ze(T,ke,"js")}`;if(E==="bash")return` ${Ze(T,ke,"bash")}`}return` ${Ze(T,void 0,E)}`}).filter(T=>typeof T<"u").join(`, 58`);if(L){if(E==="py")return`${L}, 59`;if(E==="js")return`{ 60${L}, 61}`;if(E==="bash")return` 62${L} 63`}return E==="py"?"":` 64`}Ja(async()=>{p=(await b()).named_endpoints;let E=m.map(T=>y(T,"py")),S=m.map(T=>y(T,"js")),C=m.map(T=>y(T,"bash")),L=m.map(T=>n[T.fn_index].api_name||"");t(7,$=E.map((T,j)=>({call:T,api_name:L[j]}))),t(8,f=S.map((T,j)=>({call:T,api_name:L[j]}))),t(9,k=C.map((T,j)=>({call:T,api_name:L[j]}))),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"](()=>{d=h,t(6,d)})}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,m=h.api_calls)},[i,a,c,r,_,u,d,$,f,k,n,s,o,m,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:Ue,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:Nn,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,d,m=l[7]+"",b,p,$,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(_),d=We('" '),b=We(m),p=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),Ue(n,i),f&&f.m(i,null),Ue(i,s),Ue(i,o),g.m(o,null),Ue(n,a),Ue(n,c),Ue(c,r),Ue(c,u),Ue(c,d),Ue(c,b),Ue(c,p),Ue(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&&m!==(m=w[7]+"")&&Xt(b,m)},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(p,$){return p[1].length>1?$c:vc}let _=r(l),u=_(l),d=Hi(l[1]),m=[];for(let p=0;p<d.length;p+=1)m[p]=Qi(Wi(l,d,p));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 p=0;p<m.length;p+=1)m[p].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(p,$){je(p,e,$),Ue(e,t),Ue(e,n),u.m(e,null),je(p,i,$),je(p,s,$);for(let f=0;f<m.length;f+=1)m[f]&&m[f].m(s,null);je(p,o,$),b&&b.m(p,$),je(p,a,$),c=!0},p(p,[$]){if(_===(_=r(p))&&u?u.p(p,$):(u.d(1),u=_(p),u&&(u.c(),u.m(e,null))),$&14){d=Hi(p[1]);let f;for(f=0;f<d.length;f+=1){const k=Wi(p,d,f);m[f]?m[f].p(k,$):(m[f]=Qi(k),m[f].c(),m[f].m(s,null))}for(;f<m.length;f+=1)m[f].d(1);m.length=d.length}(!c||$&1)&&Vi(s,"hide",p[0]),p[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(p){c||(Pn(b),c=!0)},o(p){Sl(b),c=!1},d(p){p&&(Ne(e),Ne(i),Ne(s),Ne(o),Ne(a)),u.d(),uc(m,p),b&&b.d(p)}}}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}),Nn()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),Nn()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),Nn()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),Nn()}}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:jn,flush:St,group_outros:Gn,init:Sc,insert:I,listen:Lc,mount_component:vt,noop:Xs,safe_not_equal:Nc,set_data:Ll,set_style:jt,space
vendor: 10,876 bytes, lines 67-94
67:Pe,src_url_equal:jc,text:Y,transition_in:ve,transition_out:Ae}=window.__gradio__svelte__internal,{onMount:Ac,createEventDispatcher:Tc}=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=[zc,Mc],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 Mc(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 zc(l){let e,t,n,i,s,o,a,c,r,_,u,d,m;t=new kr({props:{root:l[3]||l[0],api_count:l[9]}}),t.$on("close",l[13]);let b=jn(l[10]),p=[];for(let v=0;v<b.length;v+=1)p[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=jn(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=Pe(),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=Pe(),a=x("div"),c=x("div");for(let v=0;v<p.length;v+=1)p[v].c();r=Pe(),u.c(),d=Pe();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<p.length;E+=1)p[E]&&p[E].m(c,null);J(a,r),f[_].m(a,null),J(a,d);for(let E=0;E<g.length;E+=1)g[E]&&g[E].m(a,null);m=!0},p(v,h){const E={};if(h&9&&(E.root=v[3]||v[0]),t.$set(E),h&1088){b=jn(v[10]);let C;for(C=0;C<b.length;C+=1){const L=xi(v,b,C);p[C]?p[C].p(L,h):(p[C]=ts(L),p[C].c(),p[C].m(c,null))}for(;C<p.length;C+=1)p[C].d(1);p.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,d)),h&479){y=jn(v[1]);let C;for(C=0;C<y.length;C+=1){const L=Xi(v,y,C);g[C]?(g[C].p(L,h),ve(g[C],1)):(g[C]=os(L),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(!m){ve(t.$$.fragment,v),ve(u);for(let h=0;h<y.length;h+=1)ve(g[h]);m=!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]);m=!1},d(v){v&&(P(e),P(n),P(i)),bt(t),Ki(p,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=Pe(),o=Y(s),a=Pe(),jc(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(d,m){I(d,e,m),J(e,t),J(e,i),J(e,o),J(e,a),r||(_=Lc(e,"click",u),r=!0)},p(d,m){l=d,m&64&&c!==(c="snippet "+(l[6]===l[22]?"current-lang":"inactive-lang")+" svelte-1y3yua6")&&Q(e,"class",c)},d(d){d&&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 d=u(l),m=d(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 p=l[6]=="bash"&&ls(l);return{c(){e=x("p"),m.c(),t=Pe(),gt(n.$$.fragment),i=Pe(),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 `),p&&p.c(),Q(e,"class","padded svelte-1y3yua6"),Q(s,"class","padded svelte-1y3yua6")},m($,f){I($,e,f),m.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),p&&p.m(s,null),_=!0},p($,f){d===(d=u($))&&m?m.p($,f):(m.d(1),m=d($),m&&(m.c(),m.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"?p?p.p($,f):(p=ls($),p.c(),p.m(s,null)):p&&(p.d(1),p=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)),m.d(),bt(n,$),b&&b.d(),bt(c),p&&p.d()}}}function Ic(l){let e,t,n,i,s,o=l[5].length+"",a,c,r,_,u,d,m,b,p,$,f,k,y,g;return p=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=Pe(),_=x("p"),u=Y(`Here is the code snippet to replay the most recently recorded API 77 calls using the `),d=Y(l[6]),m=Y(` 78 client.`),b=Pe(),gt(p.$$.fragment),$=Pe(),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=Pe(),y=x("p"),y.textContent="API Documentation",Q(i,"class","api-count svelte-1y3yua6"),Q(t,"id","num-recorded-api-calls"),jt(t,"font-size","var(--text-lg)"),jt(t,"font-weight","bold"),jt(t,"margin","10px 0px"),jt(y,"font-size","var(--text-lg)"),jt(y,"font-weight","bold"),jt(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(_,d),J(_,m),J(e,b),vt(p,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+"")&&Ll(a,o),(!g||v&64)&&Ll(d,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]),p.$set(h)},i(w){g||(ve(p.$$.fragment,w),g=!0)},o(w){Ae(p.$$.fragment,w),g=!1},d(w){w&&(P(e),P(k),P(y)),bt(p)}}}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."),jt(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&&Ll(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+An:l[6]=="javascript"?Hn+An:Nl),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+An:o[6]=="javascript"?Hn+An:Nl)&&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=Pe(),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,d,m,b,p,$,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",d=Y(` request 88 returns an `),m=x("code"),m.textContent="EVENT_ID",b=Y(`, which is used in the second 89 `),p=x("code"),p.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(m,"class","svelte-1y3yua6"),Q(p,"class","svelte-1y3yua6"),Q(f,"class","svelte-1y3yua6"),Q(y,"class","svelte-1y3yua6"),Q(v,"href",Nl),Q(v,"target","_blank"),Q(v,"class","svelte-1y3yua6")},m(C,L){I(C,e,L),I(C,t,L),I(C,n,L),I(C,i,L),I(C,s,L),I(C,o,L),I(C,a,L),I(C,c,L),I(C,r,L),I(C,_,L),I(C,u,L),I(C,d,L),I(C,m,L),I(C,b,L),I(C,p,L),I(C,$,L),I(C,f,L),I(C,k,L),I(C,y,L),I(C,g,L),S&&S.m(C,L),I(C,w,L),I(C,v,L),J(v,h),I(C,E,L)},p(C,L){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(d),P(m),P(b),P(p),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=Pe(),gt(i.$$.fragment),s=Pe(),gt(o.$$.fragment),a=Pe(),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.dependency=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 d={};_&130&&(d.endpoint_returns=r[7].named_endpoints["/"+r[19].api_name].parameters),_&258&&(d.js_returns=r[8].named_endpoints["/"+r[19].api_name].parameters),_&64&&(d.current_language=r[6]),i.$set(d);const m={};_&130&&(m.endpoint_returns=r[7].named_endpoints["/"+r[19].api_name].returns),_&258&&(m.js_returns=r[8].named_endpoints["/"+r[19].api_name].returns),_&64&&(m.current_language=r[6]),o.$set(m)},i(r){c||(ve(t.$$.fragment,r),ve(i.$$.fragment,r),ve(o.$$.fragment,r),c=!0)}
94,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",Nl="https://www.gradio.app/guides/querying-gradio-apps-with-curl",An="#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 d=[["python",ic],["javascript",sc],["bash",oc]];async function m(){return await(await fetch(i.replace(/\/$/,"")+s.api_prefix+"/info")).json()}async function b(){return await s.view_api()}let p,$;m().then(v=>{t(7,p=v)}),b().then(v=>{t(8,$=v)});const f=Tc();Ac(()=>(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,p,$,r,d,f,a,k,y,g,w]}class Bc extends Ec{constructor(e){super(),Sc(this,e,Rc,Uc,Nc,{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:Mt,attr:Gt,create_component:Hc,destroy_component:Vc,detach:zt,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),Mt(e,t),Mt(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&&zt(e)}}}function Kc(l){let e,t,n,i,s,o,a,c=l[0].length+"",r,_,u,d=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(),d&&d.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(m,b){Pt(m,e,b),Pt(m,t,b),Pt(m,n,b),Pt(m,i,b),Pt(m,s,b),Mt(s,o),Mt(o,a),Mt(o,r),Mt(o,_),Mt(s,u),d&&d.m(s,null)},p(m,b){b&1&&c!==(c=m[0].length+"")&&xs(r,c),m[0].length>0?d?d.p(m,b):(d=cs(m),d.c(),d.m(s,null)):d&&(d.d(1),d=null)},d(m){m&&(zt(e),zt(t),zt(n),zt(i),zt(s)),d&&d.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&&zt(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:Lt,attr:Nt,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,d,m,b,p,$;return m=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(),d=rn("button"),l_(m.$$.fragment),__(t.src,n=eo)||Nt(t,"src",n),Nt(t,"alt",""),Nt(t,"class","svelte-1b2d8fn"),Nt(r,"class","url svelte-1b2d8fn"),Nt(s,"class","title svelte-1b2d8fn"),Nt(e,"class","svelte-1b2d8fn"),Nt(d,"class","svelte-1b2d8fn")},m(f,k){vl(f,e,k),Lt(e,t),Lt(e,i),Lt(e,s),Lt(s,a),Lt(s,c),Lt(s,r),Lt(r,_),vl(f,u,k),vl(f,d,k),a_(m,d,null),b=!0,p||($=r_(d,"click",l[3]),p=!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_(m.$$.fragment,f),b=!0)},o(f){f_(m.$$.fragment,f),b=!1},d(f){f&&(bl(e),bl(u),bl(d)),i_(m),p=!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,d,m,b,p,$,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"),d=we("button"),d.textContent="â¾ Â Dark",b=pt(),p=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(d,"class","svelte-npavty"),ce(u,"class",m="theme-button "+(l[4]==="dark"?"current-theme":"inactive-theme")+" svelte-npavty"),ce($,"class","svelte-npavty"),ce(p,"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,d),ue(o,b),ue(o,p),ue(p,$),k||(y=[wl(a,"click",l[9]),wl(u,"click",l[10]),wl(p,"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&&m!==(m="theme-button "+(g[4]==="dark"?"current-theme":"inactive-theme")+" svelte-npavty")&&ce(u,"class",m),w&16&&f!==(f="theme-button "+(g[4]==="system"?"current-theme":"inactive-theme")+" svelte-npavty")&&ce(p,"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,d,m,b,p=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:zo,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),d=pt(),m=we("div"),b=we("h2"),$=$t(p),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(m,"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,d,S),He(E,m,S),ue(m,b),ue(b,$),ue(m,f),ue(m,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 L={};S&1&&(L.root=E[0]),S&8&&(L.value=E[3]),u.$set(L),(!y||S&32)&&p!==(p=E[5]("common.pwa")+"")&&Wn($,p),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(d),Ge(m)),ps(t),g&&g.d(E),ps(u),h.d()}}}function L_(l,e,t){let n;v_(l,Qn,p=>t(5,n=p));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(p){const $=new URL(window.location.href);p==="system"?($.searchParams.delete("__theme"),t(4,r="system")):($.searchParams.set("__theme",p),t(4,r=p)),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(p=>{p&&t(3,c=p)});function _(p){const $=p.detail;Io($)}Ol();function u(p){b_.call(this,l,p)}const d=()=>a("light"),m=()=>a("dark"),b=()=>a("system");return l.$$set=p=>{"root"in p&&t(0,i=p.root),"space_id"in p&&t(1,s=p.space_id),"pwa_enabled"in p&&t(2,o=p.pwa_enabled)},[i,s,o,c,r,n,a,_,u,d,m,b]}class N_ extends g_{constructor(e){super(),$_(this,e,L_,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 j_=Oo(Qn),{SvelteComponent:A_,add_flush_callback:T_,assign:Zn,bind:bs,binding_callbacks:jl,bubble:M_,check_outros:z_,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:Al,transition_out:Tl,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||(Al(n,i),e=!0)},o(i){Tl(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 d=0;d<s.length;d+=1)u=Zn(u,s[d]);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),jl.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;Tl(u.$$.fragment,1,0,()=>{ws(u,1)}),z_()}a?(e=$s(a,c(r,_)),r[13](e),jl.push(()=>bs(e,"value",o)),e.$on("prop_change",r[15]),ks(e.$$.fragment),Al(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],T_(()=>t=!1)),e.$set(u)}}
vendor: 13,463 bytes, line 95
95,i(r){i||(e&&Al(e.$$.fragment,r),i=!0)},o(r){e&&Tl(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:d}=e,{elem_id:m}=e,{elem_classes:b}=e,{_id:p}=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 L=new S(...C),T=Object.keys(L.$$.props);function j(z){return function(W){if(!r)return;const ke=f(p,z,W);r.dispatchEvent(ke)}}return T.forEach(z=>{Z_.push(()=>W_(L,z,j(z)))}),L}})}const y=k(c);function g(h){jl[h?"unshift":"push"](()=>{u=h,t(0,u)})}function w(h){d=h,t(1,d)}function v(h){M_.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,d=h.value),"elem_id"in h&&t(5,m=h.elem_id),"elem_classes"in h&&t(6,b=h.elem_classes),"_id"in h&&t(11,p=h._id),"visible"in h&&t(7,$=h.visible),"$$scope"in h&&t(16,o=h.$$scope)},[u,d,a,r,_,m,b,$,y,i,c,p,s,g,w,v,o]}class K_ extends A_{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:Ls,bubble:Ns,check_outros:to,create_component:no,destroy_component:lo,detach:Wl,empty:Zl,ensure_array_like:js,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 As(l,e,t){const n=l.slice();return n[15]=e[t],n}function Ts(l){let e=[],t=new Map,n,i,s=js(l[0].children);const o=a=>a[15].id;for(let a=0;a<s.length;a+=1){let c=As(l,s,a),r=o(c);t.set(r,e[a]=Ms(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=js(a[0].children),io(),e=su(e,c,o,1,a,s,t,n.parentNode,lu,Ms,n,As),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 Ms(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&&Ts(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=Ts(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}),Ls.push(()=>Ss(e,"instance",o)),Ls.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 d=ru();let m=[];ou(()=>{d("mount",i.id);for(const k of m)d("mount",k.id);return()=>{d("destroy",i.id);for(const k of m)d("mount",k.id)}}),au("BLOCK_KEY",s);function b(k){Ns.call(this,l,k)}function p(k){Ns.call(this,l,k)}function $(k){l.$$.not_equal(i.instance,k)&&(i.instance=k,t(0,i),t(14,m),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,m),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||m.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,_,j_,u,Do),i)},[i,n,o,a,_,u,s,c,r,b,p,$,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:Ml}=window.__gradio__svelte__internal,{onMount:yu,createEventDispatcher:Cu}=window.__gradio__svelte__internal;function zs(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){Ml(e.$$.fragment,n),t=!1},d(n){mu(e,n)}}}function qu(l){let e,t,n=l[0]&&zs(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=zs(i),n.c(),In(n,1),n.m(e.parentNode,e)):n&&(bu(),Ml(n,1,1,()=>{n=null}),pu())},i(i){t||(In(n),t=!0)},o(i){Ml(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=d=>{"rootNode"in d&&t(0,n=d.rootNode),"root"in d&&t(1,i=d.root),"target"in d&&t(2,s=d.target),"theme_mode"in d&&t(3,o=d.theme_mode),"version"in d&&t(4,a=d.version),"autoscroll"in d&&t(5,c=d.autoscroll),"max_file_size"in d&&t(6,r=d.max_file_size),"client"in d&&t(7,_=d.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 Lu="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:Nu,SvelteComponent:ju,append:ie,attr:ee,check_outros:an,component_subscribe:cn,create_component:gn,destroy_component:bn,detach:Oe,element:ye,empty:On,flush:oe,globals:Au,group_outros:_n,init:Tu,insert:Re,listen:vn,mount_component:$n,noop:yl,safe_not_equal:Mu,set_data:zl,set_style:Tn,space:De,src_url_equal:Pl,text:Il,transition_in:ge,transition_out:Ie}=window.__gradio__svelte__internal,{document:pn}=Au,{tick:Mn,onMount:zu}=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 Nu(!1),n=On(),e.a=n},m(i,s){e.m(t,i,s),Re(i,n,s)},p(i,s){s[0]&36864&&t!==(t=`<style>${ti(i[15],i[12])}</style>`)&&e.p(t)},d(i){i&&(Oe(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){Ie(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,d,m,b=l[22]("common.settings")+"",p,$,f,k,y,g,w,v=l[5]&&Fs(l);return{c(){e=ye("footer"),v&&v.c(),t=De(),n=ye("a"),s=Il(i),o=De(),a=ye("img"),_=De(),u=ye("button"),d=ye("div"),d.textContent="·  ",m=De(),p=Il(b),$=De(),f=ye("img"),Pl(a.src,c=Lu)||ee(a,"src",c),ee(a,"alt",r=l[22]("common.logo")),ee(a,"class","svelte-sar7eh"),ee(n,"href","https://gradio.app"),ee(n,"class","built-with
95svelte-sar7eh"),ee(n,"target","_blank"),ee(n,"rel","noreferrer"),Pl(f.src,k=eo)||ee(f,"src",k),ee(f,"alt",y=l[22]("common.settings")),ee(f,"class","svelte-sar7eh"),ee(u,"class","settings svelte-sar7eh"),ee(e,"class","svelte-sar7eh")},m(h,E){Re(h,e,E),v&&v.m(e,null),ie(e,t),ie(e,n),ie(n,s),ie(n,o),ie(n,a),ie(e,_),ie(e,u),ie(u,d),ie(u,m),ie(u,p),ie(u,$),ie(u,f),g||(w=vn(u,"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")+"")&&zl(s,i),E[0]&4194304&&r!==(r=h[22]("common.logo"))&&ee(a,"alt",r),E[0]&4194304&&b!==(b=h[22]("common.settings")+"")&&zl(p,b),E[0]&4194304&&y!==(y=h[22]("common.settings"))&&ee(f,"alt",y)},d(h){h&&Oe(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=De(),s=ye("img"),c=De(),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-sar7eh"),ee(e,"class","show-api svelte-sar7eh")},m(d,m){Re(d,e,m),ie(e,n),ie(e,i),ie(e,s),ie(e,c),ie(e,r),_||(u=vn(e,"click",l[43]),_=!0)},p(d,m){m[0]&4194304&&t!==(t=d[22]("errors.use_via_api")+"")&&zl(n,t),m[0]&4194304&&a!==(a=d[22]("common.logo"))&&ee(s,"alt",a)},d(d){d&&Oe(e),_=!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,253 bytes, line 95
95),{c(){e=ye("div"),gn(t.$$.fragment),ee(e,"id","api-recorder-container"),ee(e,"class","svelte-sar7eh")},m(o,a){Re(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){Ie(t.$$.fragment,o),n=!1},d(o){o&&Oe(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=De(),i=ye("div"),gn(s.$$.fragment),ee(t,"class","backdrop svelte-sar7eh"),ee(i,"class","api-docs-wrap svelte-sar7eh"),ee(e,"class","api-docs svelte-sar7eh")},m(r,_){Re(r,e,_),ie(e,t),ie(e,n),ie(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){Ie(s.$$.fragment,r),o=!1},d(r){r&&Oe(e),bn(s),a=!1,c()}}}function Bs(l){let e,t,n,i,s,o,a,c;return s=new N_({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=De(),i=ye("div"),gn(s.$$.fragment),ee(t,"class","backdrop svelte-sar7eh"),ee(i,"class","api-docs-wrap svelte-sar7eh"),ee(e,"class","api-docs svelte-sar7eh")},m(r,_){Re(r,e,_),ie(e,t),ie(e,n),ie(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){Ie(s.$$.fragment,r),o=!1},d(r){r&&Oe(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){Ie(e.$$.fragment,n),t=!1},d(n){bn(e,n)}}}function Pu(l){let e,t,n,i,s,o,a,c,r,_,u,d,m=l[7]&&Ps(l),b=l[15]&&Is(l),p=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(){m&&m.c(),e=On(),b&&b.c(),t=On(),n=De(),i=ye("div"),s=ye("div"),p&&p.c(),o=De(),$&&$.c(),a=De(),f&&f.c(),c=De(),k&&k.c(),r=De(),y&&y.c(),_=De(),g&&g.c(),u=On(),ee(s,"class","contain svelte-sar7eh"),Tn(s,"flex-grow",l[8]?"1":"auto"),ee(i,"class","wrap svelte-sar7eh"),Tn(i,"min-height",l[8]?"100%":"auto")},m(w,v){m&&m.m(pn.head,null),ie(pn.head,e),b&&b.m(pn.head,null),ie(pn.head,t),Re(w,n,v),Re(w,i,v),ie(i,s),p&&p.m(s,null),ie(i,o),$&&$.m(i,null),Re(w,a,v),f&&f.m(w,v),Re(w,c,v),k&&k.m(w,v),Re(w,r,v),y&&y.m(w,v),Re(w,_,v),g&&g.m(w,v),Re(w,u,v),d=!0},p(w,v){w[7]?m||(m=Ps(w),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=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?p?(p.p(w,v),v[0]&66560&&ge(p,1)):(p=Os(w),p.c(),ge(p,1),p.m(s,null)):p&&(_n(),Ie(p,1,1,()=>{p=null}),an()),v[0]&256&&Tn(s,"flex-grow",w[8]?"1":"auto"),w[6]?$?$.p(w,v):($=Ds(w),$.c(),$.m(i,null)):$&&($.d(1),$=null),v[0]&256&&Tn(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(),Ie(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(),Ie(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(),Ie(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(),Ie(g,1,1,()=>{g=null}),an())},i(w){d||(ge(p),ge(f),ge(k),ge(y),ge(g),d=!0)},o(w){Ie(p),Ie(f),Ie(k),Ie(y),Ie(g),d=!1},d(w){w&&(Oe(n),Oe(i),Oe(a),Oe(c),Oe(r),Oe(_),Oe(u)),m&&m.d(w),Oe(e),b&&b.d(w),Oe(t),p&&p.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:d="Gradio"}=e,{target:m}=e,{autoscroll:b}
95=e,{show_api:p=!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:L=""}=e,{max_file_size:T=void 0}=e,{initial_layout:j=void 0}=e,{css:z=null}=e,{layout:W,targets:ke,update_value:K,get_data:V,modify_stream:te,get_stream_state:U,set_time_limit:se,loading_status:Ce,scheduled_updates:Te,create_layout:kn,rerender_layout:ro}=Fo(j);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+L,app:g,options:{fill_height:E}})}let{search_params:xt}=e,sl=xt.get("view")==="api"&&p,wn=xt.get("view")==="settings",en=xt.get("view")==="api-recorder"&&p;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 Mn();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 Mn()}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||Mn().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"?Lo(le):le.type==="render"?No(le):le.type==="status"?To(le):le.type==="log"&&jo(le);function Lo(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 No(le){const{data:$e}=le;let X=$e.components,he=$e.layout,ot=$e.dependencies,Ct=$e.render_id,qt=[];u.forEach((sn,Mo)=>{sn.rendered_in===Ct&&qt.push(Mo)}
95),qt.reverse().forEach(sn=>{u.splice(sn,1)}),ot.forEach(sn=>{u.push(sn)}),ro({components:X,layout:he,root:c+L,dependencies:u,render_id:Ct})}function jo(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 Ao(le,$e,X){le.original_msg==="process_starts"&&X.connection==="stream"&&te($e,"open")}function To(le){const{fn_index:$e,...X}=le;if(X.stage==="streaming"&&X.time_limit&&D.inputs.forEach(he=>{se(he,X.time_limit)}),D.inputs.forEach(he=>{Ao(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 Mn();for(var q=m.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(),!(!m||nn)&&(m.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))}),m.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])}zu(()=>{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,d=q.title),"target"in q&&t(3,m=q.target),"autoscroll"in q&&t(4,b=q.autoscroll),"show_api"in q&&t(5,p=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,L=q.api_prefix),"max_file_size"in q&&t(14,T=q.max_file_size),"initial_layout"in q&&t(38,j=q.initial_layout),"css"in q&&t(15,z=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,d,m,b,p,$,f,k,y,g,w,v,C,T,z,a,sl,wn,en,Cn,ae,o,W,ke,Ce,Te,tn,yn,go,vo,nn,S,r,_,h,E,L,j,xt,Yl,il,n,ko,wo,yo,Co,qo,Eo,So]}class rf extends ju{constructor(e){super(),Tu(this,e,Fu,Pu,Mu,{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}),oe()}get components(){return this.$$.ctx[33]}set components(e){this.$$set({components:e}),oe()}get layout(){return this.$$.ctx[34]}set layout(e){this.$$set({layout:e}),oe()}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),oe()}get title(){return this.$$.ctx[2]}set title(e){this.$$set({title:e}),oe()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),oe()}get autoscroll(){return this.$$.ctx[4]}set autoscroll(e){this.$$set({autoscroll:e}),oe()}get show_api(){return this.$$.ctx[5]}set show_api(e){this.$$set({show_api:e}),oe()}get show_footer(){return this.$$.ctx[6]}set show_footer(e){this.$$set({show_footer:e}),oe()}get control_page_title(){return this.$$.ctx[7]}set control_page_title(e){this.$$set({control_page_title:e}),oe()}get app_mode(){return this.$$.ctx[8]}set app_mode(e){this.$$set({app_mode:e}),oe()}get theme_mode(){return this.$$.ctx[9]}set theme_mode(e){this.$$set({theme_mode:e}),oe()}get app(){return this.$$.ctx[10]}set app(e){this.$$set({app:e}),oe()}get space_id(){return this.$$.ctx[11]}set space_id(e){this.$$set({space_id:e}),oe()}get version(){return this.$$.ctx[12]}set version(e){this.$$set({version:e}),oe()}get js(){return this.$$.ctx[35]}set js(e){this.$$set({js:e}),oe()}get fill_height(){return this.$$.ctx[36]}set fill_height(e){this.$$set({fill_height:e}),oe()}get ready(){return this.$$.ctx[32]}set ready(e){this.$$set({ready:e}),oe()}get username(){return this.$$.ctx[13]}set username(e){this.$$set({username:e}),oe()}get api_prefix(){return this.$$.ctx[37]}set api_prefix(e){this.$$set({api_prefix:e}),oe()}get max_file_size(){return this.$$.ctx[14]}set max_file_size(e){this.$$set({max_file_size:e}),oe()}get initial_layout(){return this.$$.ctx[38]}set initial_layout(e){this.$$set({initial_layout:e}),oe()}get css(){return this.$$.ctx[15]}set css(e){this.$$set({css:e}),oe()}get search_params(){return this.$$.ctx[39]}set search_params(e){this.$$set({search_params:e}),oe()}get render_complete(){return this.$$.ctx[31]}set render_complete(e){this.$$set({render_complete:e}),oe()}get add_new_message(){return this.$$.ctx[40]}}export{rf as default}; 97//# sourceMappingURL=Blocks-CyttC55f.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.