PageSourceSearch

https://vbonetti-triagem-ouvidoria-albertina.hf.space/assets/ApiDocs-B7xG8uq0.js

js vbonetti-triagem-ouvidoria-albertina.hf.space collected 2026-10-03 17:29:07 UTC 89,655 bytes, 129 lines download raw bytes

vendor: 10,098 bytes, lines 1-14
1import{C as Kl}from"./clear-CvR6Cdu7.js";import{a as ps}from"./Blocks-BEaKnzuj.js";import{BaseButton as Pn}from"./Index-Dwn46RCV.js";import{L as xl}from"./StreamingBar-BtwDBaPl.js";import{c as ut,a7 as es,a8 as ts,a9 as ns}from"./FullscreenButton-D7DmzQQ9.js";import"./index-DputZZxm.js";import"./svelte/svelte.js";import"./init-CYI6iZYC.js";import"./Image-0bVIZe-w.js";import"./ImagePreview-BiSVoKtP.js";import"./MarkdownCode-DTX-UkhB.js";import"./prism-python-oCRsS_S4.js";const{SvelteComponent:ds,append:_t,attr:Zt,create_component:ms,destroy_component:hs,detach:mn,element:Tt,flush:gs,init:vs,insert:hn,listen:$s,mount_component:bs,safe_not_equal:ks,set_data:ys,space:gn,text:Dn,transition_in:ws,transition_out:Cs}=window.__gradio__svelte__internal,{createEventDispatcher:Ss}=window.__gradio__svelte__internal;function js(l){let e,t,n,s,r,i,a,o,c,u,_,f,d,v,m;return f=new Kl({}),{c(){e=Tt("div"),t=Tt("h1"),t.textContent="API Docs",n=gn(),s=Tt("p"),r=Dn(`No API Routes found for
2		`),i=Tt("code"),a=Dn(l[0]),o=gn(),c=Tt("p"),c.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.`,u=gn(),_=Tt("button"),ms(f.$$.fragment),Zt(i,"class","svelte-e1ha0f"),Zt(s,"class","attention svelte-e1ha0f"),Zt(e,"class","wrap prose svelte-e1ha0f"),Zt(_,"class","svelte-e1ha0f")},m($,p){hn($,e,p),_t(e,t),_t(e,n),_t(e,s),_t(s,r),_t(s,i),_t(i,a),_t(e,o),_t(e,c),hn($,u,p),hn($,_,p),bs(f,_,null),d=!0,v||(m=$s(_,"click",l[2]),v=!0)},p($,[p]){(!d||p&1)&&ys(a,$[0])},i($){d||(ws(f.$$.fragment,$),d=!0)},o($){Cs(f.$$.fragment,$),d=!1},d($){$&&(mn(e),mn(u),mn(_)),hs(f),v=!1,m()}}}function qs(l,e,t){const n=Ss();let{root:s}=e;const r=()=>n("close");return l.$$set=i=>{"root"in i&&t(0,s=i.root)},[s,n,r]}class Ts extends ds{constructor(e){super(),vs(this,e,qs,js,ks,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),gs()}}const{SvelteComponent:Ns,append:Oe,attr:We,check_outros:Ps,create_component:ls,destroy_component:ss,detach:Qe,element:Ze,empty:As,flush:vn,group_outros:Os,init:Es,insert:Xe,listen:Ms,mount_component:is,noop:Is,safe_not_equal:Ds,set_data:zn,space:Nt,src_url_equal:zs,text:mt,transition_in:Ht,transition_out:xt}=window.__gradio__svelte__internal,{createEventDispatcher:Rs}=window.__gradio__svelte__internal;function Ls(l){let e;return{c(){e=mt("API")},m(t,n){Xe(t,e,n)},d(t){t&&Qe(e)}}}function Fs(l){let e;return{c(){e=mt("MCP")},m(t,n){Xe(t,e,n)},d(t){t&&Qe(e)}}}function Rn(l){let e,t;return e=new Pn({props:{size:"sm",variant:"secondary",elem_id:"start-api-recorder",$$slots:{default:[Us]},$$scope:{ctx:l}}}),e.$on("click",l[4]),{c(){ls(e.$$.fragment)},m(n,s){is(e,n,s),t=!0},p(n,s){const r={};s&64&&(r.$$scope={dirty:s,ctx:n}),e.$set(r)},i(n){t||(Ht(e.$$.fragment,n),t=!0)},o(n){xt(e.$$.fragment,n),t=!1},d(n){ss(e,n)}}}function Us(l){let e,t,n;return{c(){e=Ze("div"),t=Nt(),n=Ze("p"),n.textContent="API Recorder",We(e,"class","loading-dot self-baseline svelte-1i1gjw2"),We(n,"class","self-baseline btn-text svelte-1i1gjw2")},m(s,r){Xe(s,e,r),Xe(s,t,r),Xe(s,n,r)},p:Is,d(s){s&&(Qe(e),Qe(t),Qe(n))}}}function Hs(l){let e;return{c(){e=mt("MCP Tool")},m(t,n){Xe(t,e,n)},d(t){t&&Qe(e)}}}function Js(l){let e;return{c(){e=mt("API endpoint")},m(t,n){Xe(t,e,n)},d(t){t&&Qe(e)}}}function Ln(l){let e;return{c(){e=mt("s")},m(t,n){Xe(t,e,n)},d(t){t&&Qe(e)}}}function Vs(l){let e,t,n,s,r,i,a,o,c,u,_,f,d,v,m,$,p,S,h,g,y,j,b;function M(H,G){return H[2]==="mcp"?Fs:Ls}let T=M(l),P=T(l),k=l[2]!=="mcp"&&Rn(l);function C(H,G){return H[2]!=="mcp"?Js:Hs}let w=C(l),A=w(l),q=l[1]>1&&Ln();return g=new Kl({}),{c(){e=Ze("h2"),t=Ze("img"),s=Nt(),r=Ze("div"),P.c(),i=mt(` documentation
12		`),a=Ze("div"),o=mt(l[0]),c=Nt(),u=Ze("span"),k&&k.c(),_=Nt(),f=Ze("p"),d=Ze("span"),v=mt(l[1]),m=Nt(),A.c(),$=As(),q&&q.c(),p=Ze("br"),S=Nt(),h=Ze("button"),ls(g.$$.fragment),zs(t.src,n=ps)||We(t,"src",n),We(t,"alt",""),We(t,"class","svelte-1i1gjw2"),We(a,"class","url svelte-1i1gjw2"),We(r,"class","title svelte-1i1gjw2"),We(d,"class","url svelte-1i1gjw2"),We(u,"class","counts svelte-1i1gjw2"),We(e,"class","svelte-1i1gjw2"),We(h,"class","svelte-1i1gjw2")},m(H,G){Xe(H,e,G),Oe(e,t),Oe(e,s),Oe(e,r),P.m(r,null),Oe(r,i),Oe(r,a),Oe(a,o),Oe(e,c),Oe(e,u),k&&k.m(u,null),Oe(u,_),Oe(u,f),Oe(f,d),Oe(d,v),Oe(f,m),A.m(f,null),Oe(f,$),q&&q.m(f,null),Oe(f,p),Xe(H,S,G),Xe(H,h,G),is(g,h,null),y=!0,j||(b=Ms(h,"click",l[5]),j=!0)},p(H,[G]){T!==(T=M(H))&&(P.d(1),P=T(H),P&&(P.c(),P.m(r,i))),(!y||G&1)&&zn(o,H[0]),H[2]!=="mcp"?k?(k.p(H,G),G&4&&Ht(k,1)):(k=Rn(H),k.c(),Ht(k,1),k.m(u,_)):k&&(Os(),xt(k,1,1,()=>{k=null}),Ps()),(!y||G&2)&&zn(v,H[1]),w!==(w=C(H))&&(A.d(1),A=w(H),A&&(A.c(),A.m(f,$))),H[1]>1?q||(q=Ln(),q.c(),q.m(f,p)):q&&(q.d(1),q=null)},i(H){y||(Ht(k),Ht(g.$$.fragment,H),y=!0)},o(H){xt(k),xt(g.$$.fragment,H),y=!1},d(H){H&&(Qe(e),Qe(S),Qe(h)),P.d(),k&&k.d(),A.d(),q&&q.d(),ss(g),j=!1,b()}}}function Bs(l,e,t){let{root:n}=e,{api_count:s}=e,{current_language:r="python"}=e;const i=Rs(),a=()=>i("close",{api_recorder_visible:!0}),o=()=>i("close");return l.$$set=c=>{"root"in c&&t(0,n=c.root),"api_count"in c&&t(1,s=c.api_count),"current_language"in c&&t(2,r=c.current_language)},[n,s,r,i,a,o]}class Gs extends Ns{constructor(e){super(),Es(this,e,Bs,Vs,Ds,{root:0,api_count:1,current_language:2})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),vn()}get api_count(){return this.$$.ctx[1]}set api_count(e){this.$$set({api_count:e}),vn()}get current_language(){return this.$$.ctx[2]}set current_language(e){this.$$set({current_language:e}),vn()}}function Je(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=wn(l)),t==="py"&&(l=Cn(l)),Ys(l))}function rs(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"&&rs(l[e]))return!0}return!1}function wn(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,meta:{_type:"gradio.FileData"}}:(Array.isArray(l)?l.forEach((e,t)=>{typeof e=="object"&&e!==null&&(l[t]=wn(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=wn(l[e])}),l)}function Cn(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]=Cn(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=Cn(l[e])}),l)}function Ys(l){let e=JSON.stringify(l,(s,r)=>r===null?"UNQUOTEDNone":typeof r=="string"&&r.startsWith("handle_file(")&&r.endsWith(")")?`UNQUOTED${r}`:r);const t=/"UNQUOTEDhandle_file\(([^)]*)\)"/g;e=e.replace(t,(s,r)=>`handle_file(${r})`);const n=/"UNQUOTEDNone"/g;return e.replace(n,"None")}function Ue(l){return l<1?`${Math.round(l*1e3)} ms`:`${l.toFixed(2)} s`}function os(l){return l>.9?"color: green;":l>.1?"color: orange;":"color: red;"}const{SvelteComponent:Ws,append:he,attr:ft,check_outros:Zs,create_component:Qs,destroy_component:Xs,destroy_each:Ks,detach:Se,element:ze,empty:as,ensure_array_like:Fn,flush:Qt,group_outros:xs,init:ei,insert:je,mount_component:ti,noop:ni,safe_not_equal:li,set_data:pt,set_style:$t,space:bt,text:Pe,toggle_class:Un,transition_in:en,transition_out:Sn}=window.__gradio__svelte__internal;function Hn(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 Jn(l){let e;return{c(){e=Pe("s")},m(t,n){je(t,e,n)},d(t){t&&Se(e)}}}function si(l){let e=(l[2][l[11]].type||"any")+"",t;return{c(){t=Pe(e)},m(n,s){je(n,t,s)},p(n,s){s&4&&e!==(e=(n[2][n[11]].type||"any")+"")&&pt(t,e)},d(n){n&&Se(t)}}}function ii(l){let e=l[5].type+"",t,n,s=l[8]&&l[9]===null&&Vn();return{c(){t=Pe(e),s&&s.c(),n=as()},m(r,i){je(r,t,i),s&&s.m(r,i),je(r,n,i)},p(r,i){i&2&&e!==(e=r[5].type+"")&&pt(t,e),r[8]&&r[9]===null?s||(s=Vn(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null)},d(r){r&&(Se(t),Se(n)),s&&s.d(r)}}}function Vn(l){let e;return{c(){e=Pe(` |
13							None`)},m(t,n){je(t,e,n)},d(t){t&&Se(e)}}}function ri(l){let e,t,n=Je(l[9],l[5].type,"py")+"",s;return{c(){e=ze("span"),e.textContent="Default: ",t=ze("span"),s=Pe(n),ft(t,"class","code svelte-1yt946s"),$t(t,"font-size","var(--text-sm)")},m(r,i){je(r,e,i),je(r,t,i),he(t,s)},p(r,i){i&2&&n!==(n=Je(r[9],r[5].type,"py")+"")&&pt(s,n)},d(r){r&&(Se(e),Se(t))}}}function oi(l){let e;return{c(){e=ze("span"),e.textContent="Required",$t(e,"font-weight","bold")},m(t,n){je(t,e,n)},p:ni,d(t){t&&Se(e)}}}function Bn(l){let e,t,n,s,r,i=(l[3]!=="bash"&&l[7]?l[7]:"["+l[11]+"]")+"",a,o,c,u,_,f,d,v=l[4]+"",m,$,p=l[6]+"",S,h,g=l[5].description+"",y,j;function b(w,A){return w[3]==="python"?ii:si}let M=b(l),T=M(l);function P(w,A){return!w[8]||w[3]=="bash"?oi:ri}let k=P(l),C=k(l);return{c(){e=ze("hr"),t=bt(),n=ze("div"),s=ze("p"),r=ze("span"),a=Pe(i),o=bt(),c=ze("span"),T.c(),u=bt(),C.c(),_=bt(),f=ze("p"),d=Pe('The input value that is provided in the "'),m=Pe(v),$=Pe('" '),S=Pe(p),h=Pe(`
14				component. `),y=Pe(g),j=bt(),ft(e,"class","hr svelte-1yt946s"),ft(r,"class","code svelte-1yt946s"),$t(r,"margin-right","10px"),ft(c,"class","code highlight svelte-1yt946s"),$t(c,"margin-right","10px"),$t(s,"white-space","nowrap"),$t(s,"overflow-x","auto"),ft(f,"class","desc 
14svelte-1yt946s"),$t(n,"margin","10px")},m(w,A){je(w,e,A),je(w,t,A),je(w,n,A),he(n,s),he(s,r),he(r,a),he(s,o),he(s,c),T.m(c,null),he(s,u),C.m(s,null),he(n,_),he(n,f),he(f,d),he(f,m),he(f,$),he(f,S),he(f,h),he(f,y),he(n,j)},p(w,A){A&10&&i!==(i=(w[3]!=="bash"&&w[7]?w[7]:"["+w[11]+"]")+"")&&pt(a,i),M===(M=b(w))&&T?T.p(w,A):(T.d(1),T=M(w),T&&(T.c(),T.m(c,null))),k===(k=P(w))&&C?C.p(w,A):(C.d(1),C=k(w),C&&(C.c(),C.m(s,null))),A&2&&v!==(v=w[4]+"")&&pt(m,v),A&2&&p!==(p=w[6]+"")&&pt(S,p),A&2&&g!==(g=w[5].description+"")&&pt(y,g)},d(w){w&&(Se(e),Se(t),Se(n)),T.d(),C.d()}}}function Gn(l){let e,t,n;return t=new xl({props:{margin:!1}}),{c(){e=ze("div"),Qs(t.$$.fragment),ft(e,"class","load-wrap")},m(s,r){je(s,e,r),ti(t,e,null),n=!0},i(s){n||(en(t.$$.fragment,s),n=!0)},o(s){Sn(t.$$.fragment,s),n=!1},d(s){s&&Se(e),Xs(t)}}}function ai(l){let e,t,n,s=l[1].length+"",r,i,a,o,c,u,_,f,d=l[1].length!=1&&Jn(),v=Fn(l[1]),m=[];for(let p=0;p<v.length;p+=1)m[p]=Bn(Hn(l,v,p));let $=l[0]&&Gn();return{c(){e=ze("h4"),t=ze("div"),t.innerHTML='<div class="toggle-dot svelte-1yt946s"></div>',n=Pe(`
15	Accepts `),r=Pe(s),i=Pe(" parameter"),d&&d.c(),a=Pe(":"),o=bt(),c=ze("div");for(let p=0;p<m.length;p+=1)m[p].c();u=bt(),$&&$.c(),_=as(),ft(t,"class","toggle-icon svelte-1yt946s"),ft(e,"class","svelte-1yt946s"),Un(c,"hide",l[0])},m(p,S){je(p,e,S),he(e,t),he(e,n),he(e,r),he(e,i),d&&d.m(e,null),he(e,a),je(p,o,S),je(p,c,S);for(let h=0;h<m.length;h+=1)m[h]&&m[h].m(c,null);je(p,u,S),$&&$.m(p,S),je(p,_,S),f=!0},p(p,[S]){if((!f||S&2)&&s!==(s=p[1].length+"")&&pt(r,s),p[1].length!=1?d||(d=Jn(),d.c(),d.m(e,a)):d&&(d.d(1),d=null),S&14){v=Fn(p[1]);let h;for(h=0;h<v.length;h+=1){const g=Hn(p,v,h);m[h]?m[h].p(g,S):(m[h]=Bn(g),m[h].c(),m[h].m(c,null))}for(;h<m.length;h+=1)m[h].d(1);m.length=v.length}(!f||S&1)&&Un(c,"hide",p[0]),p[0]?$?S&1&&en($,1):($=Gn(),$.c(),en($,1),$.m(_.parentNode,_)):$&&(xs(),Sn($,1,1,()=>{$=null}),Zs())},i(p){f||(en($),f=!0)},o(p){Sn($),f=!1},d(p){p&&(Se(e),Se(o),Se(c),Se(u),Se(_)),d&&d.d(),Ks(m,p),$&&$.d(p)}}}function ci(l,e,t){let{is_running:n}=e,{endpoint_returns:s}=e,{js_returns:r}=e,{current_language:i}=e;return l.$$set=a=>{"is_running"in a&&t(0,n=a.is_running),"endpoint_returns"in a&&t(1,s=a.endpoint_returns),"js_returns"in a&&t(2,r=a.js_returns),"current_language"in a&&t(3,i=a.current_language)},[n,s,r,i]}class ui extends Ws{constructor(e){super(),ei(this,e,ci,ai,li,{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}),Qt()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),Qt()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),Qt()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),Qt()}}const{SvelteComponent:_i,create_component:fi,destroy_component:pi,detach:di,flush:mi,init:hi,insert:gi,mount_component:vi,safe_not_equal:$i,set_data:bi,text:ki,transition_in:yi,transition_out:wi}=window.__gradio__svelte__internal;function Ci(l){let e;return{c(){e=ki(l[0])},m(t,n){gi(t,e,n)},p(t,n){n&1&&bi(e,t[0])},d(t){t&&di(e)}}}function Si(l){let e,t;return e=new Pn({props:{size:"sm",$$slots:{default:[Ci]},$$scope:{ctx:l}}}),e.$on("click",l[1]),{c(){fi(e.$$.fragment)},m(n,s){vi(e,n,s),t=!0},p(n,[s]){const r={};s&9&&(r.$$scope={dirty:s,ctx:n}),e.$set(r)},i(n){t||(yi(e.$$.fragment,n),t=!0)},o(n){wi(e.$$.fragment,n),t=!1},d(n){pi(e,n)}}}function ji(l,e,t){let{code:n}=e,s="copy";function r(){navigator.clipboard.writeText(n),t(0,s="copied!"),setTimeout(()=>{t(0,s="copy")},1500)}return l.$$set=i=>{"code"in i&&t(2,n=i.code)},[s,r,n]}class Fe extends _i{constructor(e){super(),hi(this,e,ji,Si,$i,{code:2})}get code(){return this.$$.ctx[2]}set code(e){this.$$set({code:e}),mi()}}const{SvelteComponent:qi,append:An,attr:yt,check_outros:Ti,create_component:on,destroy_component:an,detach:tt,element:nt,flush:Ni,group_outros:Pi,init:Ai,insert:lt,mount_component:cn,noop:On,safe_not_equal:Oi,space:En,transition_in:Mt,transition_out:It}=window.__gradio__svelte__internal;function Ei(l){let e,t,n,s,r,i;return t=new Fe({props:{code:Zn}}),{c(){e=nt("div"),on(t.$$.fragment),n=En(),s=nt("div"),r=nt("pre"),r.textContent=`$ ${Zn}
15`,yt(e,"class","copy svelte-hq8ezf"),yt(r,"class","svelte-hq8ezf")},m(a,o){lt(a,e,o),cn(t,e,null),lt(a,n,o),lt(a,s,o),An(s,r),i=!0},p:On,i(a){i||(Mt(t.$$.fragment,a),i=!0)},o(a){It(t.$$.fragment,a),i=!1},d(a){a&&(tt(e),tt(n),tt(s)),an(t)}}}function Mi(l){let e,t,n,s,r,i;return t=new Fe({props:{code:Wn}}),{c(){e=nt("div"),on(t.$$.fragment),n=En(),s=nt("div"),r=nt("pre"),r.textContent=`$ ${Wn}`,yt(e,"class","copy svelte-hq8ezf"),yt(r,"class","svelte-hq8ezf")},m(a,o){lt(a,e,o),cn(t,e,null),lt(a,n,o),lt(a,s,o),An(s,r),i=!0},p:On,i(a){i||(Mt(t.$$.fragment,a),i=!0)},o(a){It(t.$$.fragment,a),i=!1},d(a){a&&(tt(e),tt(n),tt(s)),an(t)}}}function Ii(l){let e,t,n,s,r,i;return t=new Fe({props:{code:Yn}}),{c(){e=nt("div"),on(t.$$.fragment),n=En(),s=nt("div"),r=nt("pre"),r.textContent=`$ ${Yn}`,yt(e,"class","copy svelte-hq8ezf"),yt(r,"class","svelte-hq8ezf")},m(a,o){lt(a,e,o),cn(t,e,null),lt(a,n,o),lt(a,s,o),An(s,r),i=!0},p:On,i(a){i||(Mt(t.$$.fragment,a),i=!0)},o(a){It(t.$$.fragment,a),i=!1},d(a){a&&(tt(e),tt(n),tt(s)),an(t)}}}function Di(l){let e,t,n,s;const r=[Ii,Mi,Ei],i=[];function a(o,c){return o[0]==="python"?0:o[0]==="javascript"?1:o[0]==="bash"?2:-1}return~(t=a(l))&&(n=i[t]=r[t](l)),{c(){e=nt("code"),n&&n.c(),yt(e,"class","svelte-hq8ezf")},m(o,c){lt(o,e,c),~t&&i[t].m(e,null),s=!0},p(o,c){let u=t;t=a(o),t===u?~t&&i[t].p(o,c):(n&&(Pi(),It(i[u],1,1,()=>{i[u]=null}),Ti()),~t?(n=i[t],n?n.p(o,c):(n=i[t]=r[t](o),n.c()),Mt(n,1),n.m(e,null)):n=null)},i(o){s||(Mt(n),s=!0)},o(o){It(n),s=!1},d(o){o&&tt(e),~t&&i[t].d()}}}function zi(l){let e,t;return e=new ut({props:{$$slots:{default:[Di]},$$scope:{ctx:l}}}),{c(){on(e.$$.fragment)},m(n,s){cn(e,n,s),t=!0},p(n,[s]){const r={};s&3&&(r.$$scope={dirty:s,ctx:n}),e.$set(r)},i(n){t||(Mt(e.$$.fragment,n),t=!0)},o(n){It(e.$$.fragment,n),t=!1},d(n){an(e,n)}}}let Yn="pip install gradio_client",Wn="npm i -D @gradio/client",Zn="curl --version";function Ri(l,e,t){let{current_language:n}=e;return l.$$set=s=>{"current_language"in s&&t(0,n=s.current_language)},[n]}class Li extends qi{constructor(e){super(),Ai(this,e,Ri,zi,Oi,{current_language:0})}get current_language(){return this.$$.ctx[0]}set current_language(e){this.$$set({current_language:e}),Ni()}}const{SvelteComponent:Fi,append:ye,attr:Jt,detach:cs,element:Vt,flush:$n,init:Ui,insert:us,noop:Qn,safe_not_equal:Hi,set_data:Pt,space:Xn,text:Me}=window.__gradio__svelte__internal;function Kn(l){let e,t,n=l[2][l[0]].total_requests+"",s,r,i,a=Math.round(l[3]*100)+"",o,c,u,_=Ue(l[2][l[0]].process_time_percentiles["50th"])+"",f,d,v=Ue(l[2][l[0]].process_time_percentiles["90th"])+"",m,$,p=Ue(l[2][l[0]].process_time_percentiles["99th"])+"",S;return{c(){e=Vt("span"),t=Me("Total requests: "),s=Me(n),r=Me(" ("),i=Vt("span"),o=Me(a),c=Me("%"),u=Me(`
16			successful)  |  p50/p90/p99:
17			`),f=Me(_),d=Me(`
18			/
19			`),m=Me(v),$=Me(`
20			/
21			`),S=Me(p),Jt(i,"style",l[4]),Jt(e,"class","analytics svelte-1xzad0z")},m(h,g){us(h,e,g),ye(e,t),ye(e,s),ye(e,r),ye(e,i),ye(i,o),ye(i,c),ye(e,u),ye(e,f),ye(e,d),ye(e,m),ye(e,$),ye(e,S)},p(h,g){g&5&&n!==(n=h[2][h[0]].total_requests+"")&&Pt(s,n),g&5&&_!==(_=Ue(h[2][h[0]].process_time_percentiles["50th"])+"")&&Pt(f,_),g&5&&v!==(v=Ue(h[2][h[0]].process_time_percentiles["90th"])+"")&&Pt(m,v),g&5&&p!==(p=Ue(h[2][h[0]].process_time_percentiles["99th"])+"")&&Pt(S,p)},d(h){h&&cs(e)}}}function Ji(l){let e,t,n,s="/"+l[0],r,i,a,o,c,u=l[2]&&l[0]&&l[2][l[0]]&&Kn(l);return{c(){e=Vt("h3"),t=Me(`API name:
22	`),n=Vt("span"),r=Me(s),i=Xn(),a=Vt("span"),o=Me(l[1]),c=Xn(),u&&u.c(),Jt(n,"class","post svelte-1xzad0z"),Jt(a,"class","desc svelte-1xzad0z"),Jt(e,"class","svelte-1xzad0z")},m(_,f){us(_,e,f),ye(e,t),ye(e,n),ye(n,r),ye(e,i),ye(e,a),ye(a,o),ye(e,c),u&&u.m(e,null)},p(_,[f]){f&1&&s!==(s="/"+_[0])&&Pt(r,s),f&2&&Pt(o,_[1]),_[2]&&_[0]&&_[2][_[0]]?u?u.p(_,f):(u=Kn(_),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i:Qn,o:Qn,d(_){_&&cs(e),u&&u.d()}}}function Vi(l,e,t){let{api_name:n=null}=e,{description:s=null}=e,{analytics:r}=e;const i=n?r[n]?.success_rate:0,a=os(i);return l.$$set=o=>{"api_name"in o&&t(0,n=o.api_name),"description"in o&&t(1,s=o.description),"analytics"in o&&t(2,r=o.analytics)},[n,s,r,i,a]}class Bi extends Fi{constructor(e){super(),Ui(this,e,Vi,Ji,Hi,{api_name:0,description:1,analytics:2})}get api_name(){return this.$$.ctx[0]}set api_name(e){this.$$set({api_name:e}),$n()}get description(){return this.$$.ctx[1]}set description(e){this.$$set({description:e}),$n()}get analytics(){return this.$$.ctx[2]}set analytics(e){this.$$set({analytics:e}),$n()}}const{SvelteComponent:Gi,append:I,attr:ge,binding_callbacks:bn,check_outros:Yi,create_component:St,de
vendor: 24,938 bytes, lines 22-69
22stroy_component:jt,destroy_each:nn,detach:X,element:fe,empty:_s,ensure_array_like:dt,flush:st,group_outros:Wi,init:Zi,insert:K,mount_component:qt,noop:Qi,safe_not_equal:Xi,set_data:we,space:un,text:E,transition_in:it,transition_out:rt}=window.__gradio__svelte__internal;function xn(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 el(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 tl(l,e,t){const n=l.slice();return n[30]=e[t].component,n[22]=e[t].example_input,n[27]=t,n}function nl(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 Ki(l){let e,t;return e=new ut({props:{$$slots:{default:[tr]},$$scope:{ctx:l}}}),{c(){St(e.$$.fragment)},m(n,s){qt(e,n,s),t=!0},p(n,s){const r={};s[0]&7177|s[1]&16&&(r.$$scope={dirty:s,ctx:n}),e.$set(r)},i(n){t||(it(e.$$.fragment,n),t=!0)},o(n){rt(e.$$.fragment,n),t=!1},d(n){jt(e,n)}}}function xi(l){let e,t;return e=new ut({props:{$$slots:{default:[sr]},$$scope:{ctx:l}}}),{c(){St(e.$$.fragment)},m(n,s){qt(e,n,s),t=!0},p(n,s){const r={};s[0]&543|s[1]&16&&(r.$$scope={dirty:s,ctx:n}),e.$set(r)},i(n){t||(it(e.$$.fragment,n),t=!0)},o(n){rt(e.$$.fragment,n),t=!1},d(n){jt(e,n)}}}function er(l){let e,t;return e=new ut({props:{$$slots:{default:[rr]},$$scope:{ctx:l}}}),{c(){St(e.$$.fragment)},m(n,s){qt(e,n,s),t=!0},p(n,s){const r={};s[0]&287|s[1]&16&&(r.$$scope={dirty:s,ctx:n}),e.$set(r)},i(n){t||(it(e.$$.fragment,n),t=!0)},o(n){rt(e.$$.fragment,n),t=!1},d(n){jt(e,n)}}}function ll(l){let e;return{c(){e=E(",")},m(t,n){K(t,e,n)},d(t){t&&X(e)}}}function sl(l){let e,t=Je(l[22],l[21].type,"bash")+"",n,s,r=l[27]<l[3].length-1&&ll();return{c(){e=E(`
23							`),n=E(t),r&&r.c(),s=_s()},m(i,a){K(i,e,a),K(i,n,a),r&&r.m(i,a),K(i,s,a)},p(i,a){a[0]&8&&t!==(t=Je(i[22],i[21].type,"bash")+"")&&we(n,t),i[27]<i[3].length-1?r||(r=ll(),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(i){i&&(X(e),X(n),X(s)),r&&r.d(i)}}}function tr(l){let e,t,n,s,r,i,a,o,c,u,_=l[0].api_name+"",f,d,v="{",m,$,p,S="}",h,g,y="{",j,b,M="}",T,P,k,C,w,A=l[0].api_name+"",q,H,G;n=new Fe({props:{code:l[10]?.innerText}});let Y=dt(l[3]),re=[];for(let W=0;W<Y.length;W+=1)re[W]=sl(xn(l,Y,W));return{c(){e=fe("code"),t=fe("div"),St(n.$$.fragment),s=un(),r=fe("div"),i=fe("pre"),a=E("curl -X POST "),o=E(l[11]),c=E(l[12]),u=E("/call/"),f=E(_),d=E(` -s -H "Content-Type: application/json" -d '`),m=E(v),$=E(`
24	"data": [`);for(let W=0;W<re.length;W+=1)re[W].c();p=E(`
25	]`),h=E(S),g=E(`' \\
26	| awk -F'"' '`),j=E(y),b=E(" print $4"),T=E(M),P=E(`'  \\
27	| read EVENT_ID; curl -N `),k=E(l[11]),C=E(l[12]),w=E("/call/"),q=E(A),H=E("/$EVENT_ID"),ge(t,"class","copy svelte-114qcyq"),ge(i,"class","svelte-114qcyq"),ge(e,"class","svelte-114qcyq")},m(W,ne){K(W,e,ne),I(e,t),qt(n,t,null),I(e,s),I(e,r),I(r,i),I(i,a),I(i,o),I(i,c),I(i,u),I(i,f),I(i,d),I(i,m),I(i,$);for(let ae=0;ae<re.length;ae+=1)re[ae]&&re[ae].m(i,null);I(i,p),I(i,h),I(i,g),I(i,j),I(i,b),I(i,T),I(i,P),I(i,k),I(i,C),I(i,w),I(i,q),I(i,H),l[19](r),G=!0},p(W,ne){const ae={};if(ne[0]&1024&&(ae.code=W[10]?.innerText),n.$set(ae),(!G||ne[0]&2048)&&we(o,W[11]),(!G||ne[0]&4096)&&we(c,W[12]),(!G||ne[0]&1)&&_!==(_=W[0].api_name+"")&&we(f,_),ne[0]&8){Y=dt(W[3]);let le;for(le=0;le<Y.length;le+=1){const ke=xn(W,Y,le);re[le]?re[le].p(ke,ne):(re[le]=sl(ke),re[le].c(),re[le].m(i,p))}for(;le<re.length;le+=1)re[le].d(1);re.length=Y.length}(!G||ne[0]&2048)&&we(k,W[11]),(!G||ne[0]&4096)&&we(C,W[12]),(!G||ne[0]&1)&&A!==(A=W[0].api_name+"")&&we(q,A)},i(W){G||(it(n.$$.fragment,W),G=!0)},o(W){rt(n.$$.fragment,W),G=!1},d(W){W&&X(e),jt(n),nn(re,W),l[19](null)}}}function il(l){let e,t,n,s=l[22].url+"",r,i,a=l[30]+"",o,c,u,_;return{c(){e=E(`
28	const response_`),t=E(l[27]),n=E(' = await fetch("'),r=E(s),i=E(`");
29	const example`),o=E(a),c=E(" = await response_"),u=E(l[27]),_=E(`.blob();
30						`)},m(f,d){K(f,e,d),K(f,t,d),K(f,n,d),K(f,r,d),K(f,i,d),K(f,o,d),K(f,c,d),K(f,u,d),K(f,_,d)},p:Qi,d(f){f&&(X(e),X(t),X(n),X(r),X(i),X(o),X(c),X(u),X(_))}}}function rl(l){let e,t,n;return{c(){e=E(', {auth: ["'),t=E(l[4]),n=E('", **password**]}')},m(s,r){K(s,e,r),K(s,t,r),K(s,n,r)},p(s,r){r[0]&16&&we(t,s[4])},d(s){s&&(X(e),X(t),X(n))}}}function nr(l){let e,t,n=l[23]+"",s,r,i=Je(l[22],l[21].type,"js")+"",a,o;return{c(){e=E(`		
31			`),t=fe("span"),s=E(n),r=E(": "),a=E(i),o=E(", "),ge(t,"class","example-inputs")},m(c,u){K(c,e,u),K(c,t,u),I(t,s),I(t,r),I(t,a),K(c,o,u)},p(c,u){u[0]&8&&n!==(n=c[23]+"")&&we(s,n),u[0]&8&&i!==(i=Je(c[22],c[21].type,"js")+"")&&we(a,i)},d(c){c&&(X(e),X(t),X(o))}}}function lr(l){let e,t,n=l[23]+"",s,r,i=l[30]+"",a,o,c;return{c(){e=E(`
32					`),t=fe("span"),s=E(n),r=E(": example"),a=E(i),o=E(", "),c=fe("span"),c.innerHTML="",ge(t,"class","example-inputs"),ge(c,"class","desc svelte-114qcyq")},m(u,_){K(u,e,_),K(u,t,_),I(t,s),I(t,r),I(t,a),K(u,o,_),K(u,c,_)},p(u,_){_[0]&8&&n!==(n=u[23]+"")&&we(s,n),_[0]&8&&i!==(i=u[30]+"")&&we(a,i)},d(u){u&&(X(e),X(t),X(o),X(c))}}}function ol(l){let e,t;function n(i,a){return a[0]&8&&(e=null),e==null&&(e=!!i[14].includes(i[30])),e?lr:nr}let s=n(l,[-1,-1]),r=s(l);return{c(){r.c(),t=_s()},m(i,a){r.m(i,a),K(i,t,a)},p(i,a){s===(s=n(i,a))&&r?r.p(i,a):(r.d(1),r=s(i),r&&(r.c(),r.m(t.parentNode,t)))},d(i){i&&X(t),r.d(i)}}}function sr(l){let e,t,n,s,r,i,a,o,c,u,_=(l[2]||l[1])+"",f,d,v,m,$,p=l[0].api_name+"",S,h,g,y,j;n=new Fe({props:{code:l[9]?.innerText}});let b=dt(l[15]),M=[];for(let C=0;C<b.length;C+=1)M[C]=il(tl(l,b,C));let T=l[4]!==null&&rl(l),P=dt(l[3]),k=[];for(let C=0;C<P.length;C+=1)k[C]=ol(el(l,P,C));return{c(){e=fe("code"),t=fe("div"),St(n.$$.fragment),s=un(),r=fe("div"),i=fe("pre"),a=E(`import { Client } from "@gradio/client";
33	`);for(let C=0;C<M.length;C+=1)M[C].c();o=E(`
34	const client = await Client.connect(`),c=fe("span"),u=E('"'),f=E(_),d=E('"'),T&&T.c(),v=E(`);
35	const result = await client.predict(`),m=fe("span"),$=E('"/'),S=E(p),h=E('"'),g=E(", { ");for(let C=0;C<k.length;C+=1)k[C].c();y=E(`
36	});
37
38	console.log(result.data);
39	`),ge(t,"class","copy svelte-114qcyq"),ge(c,"class","token string svelte-114qcyq"),ge(m,"class","api-name svelte-114qcyq"),ge(i,"class","svelte-114qcyq"),ge(e,"class","svelte-114qcyq")},m(C,w){K(C,e,w),I(e,t),qt(n,t,null),I(e,s),I(e,r),I(r,i),I(i,a);for(let A=0;A<M.length;A+=1)M[A]&&M[A].m(i,null);I(i,o),I(i,c),I(c,u),I(c,f),I(c,d),T&&T.m(i,null),I(i,v),I(i,m),I(m,$),I(m,S),I(m,h),I(i,g);for(let A=0;A<k.length;A+=1)k[A]&&k[A].m(i,null);I(i,y),l[18](r),j=!0},p(C,w){const A={};if(w[0]&512&&(A.code=C[9]?.innerText),n.$set(A),w[0]&32768){b=dt(C[15]);let q;for(q=0;q<b.length;q+=1){const H=tl(C,b,q);M[q]?M[q].p(H,w):(M[q]=il(H),M[q].c(),M[q].m(i,o))}for(;q<M.length;q+=1)M[q].d(1);M.length=b.length}if((!j||w[0]&6)&&_!==(_=(C[2]||C[1])+"")&&we(f,_),C[4]!==null?T?T.p(C,w):(T=rl(C),T.c(),T.m(i,v)):T&&(T.d(1),T=null),(!j||w[0]&1)&&p!==(p=C[0].api_name+"")&&we(S,p),w[0]&16392){P=dt(C[3]);let q;for(q=0;q<P.length;q+=1){const H=el(C,P,q);k[q]?k[q].p(H,w):(k[q]=ol(H),k[q].c(),k[q].m(i,y))}for(;q<k.length;q+=1)k[q].d(1);k.length=P.length}},i(C){j||(it(n.$$.fragment,C),j=!0)},o(C){rt(n.$$.fragment,C),j=!1},d(C){C&&X(e),jt(n),nn(M,C),T&&T.d(),nn(k,C),l[18](null)}}}function ir(l){let e;return{c(){e=E(", handle_file")},m(t,n){K(t,e,n)},d(t){t&&X(e)}}}function al(l){let e,t,n;return{c(){e=E(', auth=("'),t=E(l[4]),n=E('", **password**)')},m(s,r){K(s,e,r),K(s,t,r),K(s,n,r)},p(s,r){r[0]&16&&we(t,s[4])},d(s){s&&(X(e),X(t),X(n))}}}function cl(l){let e,t=l[23]?l[23]+"=":"",n,s,r=Je(l[24]?l[25]:l[22],l[21].type,"py")+"",i,a;return{c(){e=E(`
40	`),n=E(t),s=fe("span"),i=E(r),a=E(",")},m(o,c){K(o,e,c),K(o,n,c),K(o,s,c),I(s,i),K(o,a,c)},p(o,c){c[0]&8&&t!==(t=o[23]?o[23]+"=":"")&&we(n,t),c[0]&8&&r!==(r=Je(o[24]?o[25]:o[22],o[21].type,"py")+"")&&we(i,r)},d(o){o&&(X(e),X(n),X(s),X(a))}}}function rr(l){let e,t,n,s,r,i,a,o,c,u,_,f,d,v=(l[2]||l[1])+"",m,$,p,S,h,g,y,j,b=l[0].api_name+"",M,T,P,k,C,w;n=new Fe({props:{code:l[8]?.innerText}});let A=l[13]&&ir(),q=l[4]!==null&&al(l),H=dt(l[3]),G=[];for(let Y=0;Y<H.length;Y+=1)G[Y]=cl(nl(l,H,Y));return{c(){e=fe("code"),t=fe("div"),St(n.$$.fragment),s=un(),r=fe("div"),i=fe("pre"),a=fe("span"),a.textContent="from",o=E(" gradio_client "),c=fe("span"),c.textContent="import",u=E(" Client"),A&&A.c(),_=E(`
41
42client = Client(`),f=fe("span"),d=E('"'),m=E(v),$=E('"'),q&&q.c(),p=E(`)
43result = client.`),S=fe("span"),S.textContent="predict",h=E("(");for(let Y=0;Y<G.length;Y+=1)G[Y].c();g=E(`
44	api_name=`),y=fe("span"),j=E('"/'),M=E(b),T=E('"'),P=E(`
45)
46`),k=fe("span"),k.textContent="print",C=E("(result)"),ge(t,"class","copy svelte-114qcyq"),ge(a,"class","highlight"),ge(c,"class","highlight"),ge(f,"class","token string svelte-114qcyq"),ge(S,"class","highlight"),ge(y,"class","api-name svelte-114qcyq"),ge(k,"class","highlight"),ge(i,"class","svelte-114qcyq"),ge(e,"class","svelte-114qcyq")},m(Y,re){K(Y,e,re),I(e,t),qt(n,t,null),I(e,s),I(e,r),I(r,i),I(i,a),I(i,o),I(i,c),I(i,u),A&&A.m(i,null),I(i,_),I(i,f),I(f,d),I(f,m),I(f,$),q&&q.m(i,null),I(i,p),I(i,S),I(i,h);for(let W=0;W<G.length;W+=1)G[W]&&G[W].m(i,null);I(i,g),I(i,y),I(y,j),I(y,M),I(y,T),I(i,P),I(i,k),I(i,C),l[17](r),w=!0},p(Y,re){const W={};if(re[0]&256&&(W.code=Y[8]?.innerText),n.$set(W),(!w||re[0]&6)&&v!==(v=(Y[2]||Y[1])+"")&&we(m,v),Y[4]!==null?q?q.p(Y,re):(q=al(Y),q.c(),q.m(i,p)):q&&(q.d(1),q=null),re[0]&8){H=dt(Y[3]);let ne;for(ne=0;ne<H.length;ne+=1){const ae=nl(Y,H,ne);G[ne]?G[ne].p(ae,re):(G[ne]=cl(ae),G[ne].c(),G[ne].m(i,g))}for(;ne<G.length;ne+=1)G[ne].d(1);G.length=H.length}(!w||re[0]&1)&&b!==(b=Y[0].api_name+"")&&we(M,b)},i(Y){w||(it(n.$$.fragment,Y),w=!0)},o(Y){rt(n.$$.fragment,Y),w=!1},d(Y){Y&&X(e),jt(n),A&&A.d(),q&&q.d(),nn(G,Y),l[17](null)}}}function or(l){let e,t,n,s,r,i;t=new Bi({props:{api_name:l[0].api_name,description:l[6],analytics:l[7]}});const a=[er,xi,Ki],o=[];function c(u,_){return u[5]==="python"?0:u[5]==="javascript"?1:u[5]==="bash"?2:-1}return~(s=c(l))&&(r=o[s]=a[s](l)),{c(){e=fe("div"),St(t.$$.fragment),n=un(),r&&r.c(),ge(e,"class","container svelte-114qcyq")},m(u,_){K(u,e,_),qt(t,e,null),I(e,n),~s&&o[s].m(e,null),i=!0},p(u,_){const f={};_[0]&1&&(f.api_name=u[0].api_name),_[0]&64&&(f.description=u[6]),_[0]&128&&(f.analytics=u[7]),t.$set(f);let d=s;s=c(u),s===d?~s&&o[s].p(u,_):(r&&(Wi(),rt(o[d],1,1,()=>{o[d]=null}),Yi()),~s?(r=o[s],r?r.p(u,_):(r=o[s]=a[s](u),r.c()),it(r,1),r.m(e,null)):r=null)},i(u){i||(it(t.$$.fragment,u),it(r),i=!0)},o(u){rt(t.$$.fragment,u),rt(r),i=!1},d(u){u&&X(e),jt(t),~s&&o[s].d()}}}function ar(l,e,t){let n,s,{dependency:r}=e,{root:i}=e,{api_prefix:a}=e,{space_id:o}=e,{endpoint_parameters:c}=e,{username:u}=e,{current_language:_}=e,{api_description:f=null}=e,{analytics:d}=e,v,m,$,p=c.some(b=>rs(b.example_input)),S=["Audio","File","Image","Video"],h=c.filter(b=>S.includes(b.component));function g(b){bn[b?"unshift":"push"](()=>{v=b,t(8,v)})}function y(b){bn[b?"unshift":"push"](()=>{m=b,t(9,m)})}function j(b){bn[b?"unshift":"push"](()=>{$=b,t(10,$)})}return l.$$set=b=>{"dependency"in b&&t(0,r=b.dependency),"root"in b&&t(1,i=b.root),"api_prefix"in b&&t(16,a=b.api_prefix),"space_id"in b&&t(2,o=b.space_id),"endpoint_parameters"in b&&t(3,c=b.endpoint_parameters),"username"in b&&t(4,u=b.username),"current_language"in b&&t(5,_=b.current_language),"api_description"in b&&t(6,f=b.api_description),"analytics"in b&&t(7,d=b.analytics)},l.$$.update=()=>{l.$$.dirty[0]&65536&&t(12,n=a||"/"),l.$$.dirty[0]&2&&t(11,s=i.replace(/\/$/,""))},[r,i,o,c,u,_,f,d,v,m,$,s,n,p,S,h,a,g,y,j]}class cr extends Gi{constructor(e){super(),Zi(this,e,ar,or,Xi,{dependency:0,root:1,api_prefix:16,space_id:2,endpoint_parameters:3,username:4,current_language:5,api_description:6,analytics:7},null,[-1,-1])}get dependency(){return this.$$.ctx[0]}set dependency(e){this.$$set({dependency:e}),st()}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),st()}get api_prefix(){return this.$$.ctx[16]}set api_prefix(e){this.$$set({api_prefix:e}),st()}get space_id(){return this.$$.ctx[2]}set space_id(e){this.$$set({space_id:e}),st()}get endpoint_parameters(){return this.$$.ctx[3]}set endpoint_parameters(e){this.$$set({endpoint_parameters:e}),st()}get username(){return this.$$.ctx[4]}set username(e){this.$$set({username:e}),st()}get current_language(){return this.$$.ctx[5]}set current_language(e){this.$$set({current_language:e}),st()}get api_description(){return this.$$.ctx[6]}set api_description(e){this.$$set({api_description:e}),st()}get analytics(){return this.$$.ctx[7]}set analytics(e){this.$$set({analytics:e}),st()}}const{SvelteComponent:ur,append:L,attr:Ce,binding_callbacks:kn,check_outros:_r,create_component:_n,destroy_component:fn,destroy_each:Mn,detach:$e,element:ve,empty:fr,ensure_array_like:Dt,flush:ht,group_outros:pr,init:dr,insert:be,mount_component:pn,safe_not_equal:mr,set_data:Re,space:dn,text:B,transition_in:zt,transition_out:Rt}=window.__gradio__svelte__internal,{onMount:hr,tick:gr}=window.__gradio__svelte__internal;function ul(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function _l(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function fl(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function vr(l){let e,t,n,s,r,i;n=new Fe({props:{code:l[6]?.innerText}});let a=Dt(l[9]),o=[];for(let c=0;c<a.length;c+=1)o[c]=pl(ul(l,a,c));return{c(){e=ve("code"),t=ve("div"),_n(n.$$.fragment),s=dn(),r=ve("div");for(let c=0;c<o.length;c+=1)o[c].c();Ce(t,"class","copy svelte-j71ub0"),Ce(e,"class","svelte-j71ub0")},m(c,u){be(c,e,u),L(e,t),pn(n,t,null),L(e,s),L(e,r);for(let _=0;_<o.length;_+=1)o[_]&&o[_].m(r,null);l[16](r),i=!0},p(c,u){const _={};if(u&64&&(_.code=c[6]?.innerText),n.$set(_),u&513){a=Dt(c[9]);let f;for(f=0;f<a.length;f+=1){const d=ul(c,a,f);o[f]?o[f].p(d,u):(o[f]=pl(d),o[f].c(),o[f].m(r,null))}for(;f<o.length;f+=1)o[f].d(1);o.length=a.length}},i(c){i||(zt(n.$$.fragment,c),i=!0)},o(c){Rt(n.$$.fragment,c),i=!1},d(c){c&&$e(e),fn(n),Mn(o,c),l[16](null)}}}function $r(l){let e,t,n,s,r,i,a,o,c,u,_,f,d;n=new Fe({props:{code:l[5]?.innerText}});let v=l[2]!==null&&dl(l),m=Dt(l[8]),$=[];for(let p=0;p<m.length;p+=1)$[p]=hl(_l(l,m,p));return{c(){e=ve("code"),t=ve("div"),_n(n.$$.fragment),s=dn(),r=ve("div"),i=ve("pre"),a=B(`import { Client } from "@gradio/client";
47
48const app = await Client.connect(`),o=ve("span"),c=B('"'),u=B(l[0]),_=B('"'),v&&v.c(),f=B(`);
49					`);for(let p=0;p<$.length;p+=1)$[p].c();Ce(t,"class","copy svelte-j71ub0"),Ce(o,"class","token string svelte-j71ub0"),Ce(i,"class","svelte-j71ub0"),Ce(e,"class","svelte-j71ub0")},m(p,S){be(p,e,S),L(e,t),pn(n,t,null),L(e,s),L(e,r),L(r,i),L(i,a),L(i,o),L(o,c),L(o,u),L(o,_),v&&v.m(i,null),L(i,f);for(let h=0;h<$.length;h+=1)$[h]&&$[h].m(i,null);l[15](r),d=!0},p(p,S){const h={};if(S&32&&(h.code=p[5]?.innerText),n.$set(h),(!d||S&1)&&Re(u,p[0]),p[2]!==null?v?v.p(p,S):(v=dl(p),v.c(),v.m(i,f)):v&&(v.d(1),v=null),S&256){m=Dt(p[8]);let g;for(g=0;g<m.length;g+=1){const y=_l(p,m,g);$[g]?$[g].p(y,S):($[g]=hl(y),$[g].c(),$[g].m(i,null))}for(;g<$.length;g+=1)$[g].d(1);$.length=m.length}},i(p){d||(zt(n.$$.fragment,p),d=!0)},o(p){Rt(n.$$.fragment,p),d=!1},d(p){p&&$e(e),fn(n),v&&v.d(),Mn($,p),l[15](null)}}}function br(l){let e,t,n,s,r,i,a,o,c,u,_,f,d,v,m,$;n=new Fe({props:{code:l[4]}});let p=l[2]!==null&&gl(l),S=Dt(l[7]),h=[];for(let g=0;g<S.length;g+=1)h[g]=vl(fl(l,S,g));return{c(){e=ve("code"),t=ve("div"),_n(n.$$.fragment),s=dn(),r=ve("div"),i=ve("pre"),a=ve("span"),a.textContent="from",o=B(" gradio_client "),c=ve("span"),c.textContent="import",u=B(` Client, file
50
51client = Client(`),_=ve("span"),f=B('"'),d=B(l[0]),v=B('"'),p&&p.c(),m=B(`)
52`);for(let g=0;g<h.length;g+=1)h[g].c();Ce(t,"class","copy svelte-j71ub0"),Ce(a,"class","highlight"),Ce(c,"class","highlight"),Ce(_,"class","token string svelte-j71ub0"),Ce(i,"class","svelte-j71ub0"),Ce(e,"class","svelte-j71ub0")},m(g,y){be(g,e,y),L(e,t),pn(n,t,null),L(e,s),L(e,r),L(r,i),L(i,a),L(i,o),L(i,c),L(i,u),L(i,_),L(_,f),L(_,d),L(_,v),p&&p.m(i,null),L(i,m);for(let j=0;j<h.length;j+=1)h[j]&&h[j].m(i,null);l[14](r),$=!0},p(g,y){const j={};if(y&16&&(j.code=g[4]),n.$set(j),(!$||y&1)&&Re(d,g[0]),g[2]!==null?p?p.p(g,y):(p=gl(g),p.c(),p.m(i,m)):p&&(p.d(1),p=null),y&128){S=Dt(g[7]);let b;for(b=0;b<S.length;b+=1){const M=fl(g,S,b);h[b]?h[b].p(M,y):(h[b]=vl(M),h[b].c(),h[b].m(i,null))}for(;b<h.length;b+=1)h[b].d(1);h.length=S.length}},i(g){$||(zt(n.$$.fragment,g),$=!0)},o(g){Rt(n.$$.fragment,g),$=!1},d(g){g&&$e(e),fn(n),p&&p.d(),Mn(h,g),l[14](null)}}}function pl(l){let e,t,n,s,r=l[21]+"",i,a,o="{",c,u,_=l[20]+"",f,d,v="}",m,$,p="{",S,h,g="}",y,j,b,M,T=l[21]+"",P,k,C,w;return{c(){e=ve("pre"),t=B("curl -X POST "),n=B(l[0]),s=B("call/"),i=B(r),a=B(` -s -H "Content-Type: application/json" -d '`),c=B(o),u=B(` 
53	"data": [`),f=B(_),d=B("]"),m=B(v),$=B(`' \\
54  | awk -F'"' '`),S=B(p),h=B(" print $4"),y=B(g),j=B(`' \\
55  | read EVENT_ID; curl -N `),b=B(l[0]),M=B("call/"),P=B(T),k=B("/$EVENT_ID"),C=dn(),w=ve("br"),Ce(e,"class","svelte-j71ub0")},m(A,q){be(A,e,q),L(e,t),L(e,n),L(e,s),L(e,i),L(e,a),L(e,c),L(e,u),L(e,f),L(e,d),L(e,m),L(e,$),L(e,S),L(e,h),L(e,y),L(e,j),L(e,b),L(e,M),L(e,P),L(e,k),be(A,C,q),be(A,w,q)},p(A,q){q&1&&Re(n,A[0]),q&512&&r!==(r=A[21]+"")&&Re(i,r),q&512&&_!==(_=A[20]+"")&&Re(f,_),q&1&&Re(b,A[0]),q&512&&T!==(T=A[21]+"")&&Re(P,T)},d(A){A&&($e(e),$e(C),$e(w))}}}function dl(l){let e,t,n;return{c(){e=B(', {auth: ["'),t=B(l[2]),n=B('", **password**]}')},m(s,r){be(s,e,r),be(s,t,r),be(s,n,r)},p(s,r){r&4&&Re(t,s[2])},d(s){s&&($e(e),$e(t),$e(n))}}}function ml(l){let e,t=l[20]+"",n;return{c(){e=B(", "),n=B(t)},m(s,r){be(s,e,r),be(s,n,r)},p(s,r){r&256&&t!==(t=s[20]+"")&&Re(n,t)},d(s){s&&($e(e),$e(n))}}}function hl(l){let e,t,n,s=l[21]+"",r,i,a,o=l[20]&&ml(l);return{c(){e=B(`
56await client.predict(`),t=ve("span"),n=B(`
57  "/`),r=B(s),i=B('"'),o&&o.c(),a=B(`);
58						`),Ce(t,"class","api-name svelte-j71ub0")},m(c,u){be(c,e,u),be(c,t,u),L(t,n),L(t,r),L(t,i),o&&o.m(c,u),be(c,a,u)},p(c,u){u&256&&s!==(s=c[21]+"")&&Re(r,s),c[20]?o?o.p(c,u):(o=ml(c),o.c(),o.m(a.parentNode,a)):o&&(o.d(1),o=null)},d(c){c&&($e(e),$e(t),$e(a)),o&&o.d(c)}}}function gl(l){let e,t,n;return{c(){e=B(', auth=("'),t=B(l[2]),n=B('", **password**)')},m(s,r){be(s,e,r),be(s,t,r),be(s,n,r)},p(s,r){r&4&&Re(t,s[2])},d(s){s&&($e(e),$e(t),$e(n))}}}function vl(l){let e,t,n,s=l[20]+"",r,i,a,o,c=l[21]+"",u,_,f;return{c(){e=B(`
59client.`),t=ve("span"),n=B(`predict(
60`),r=B(s),i=B("  api_name="),a=ve("span"),o=B('"/'),u=B(c),_=B('"'),f=B(`
61)
62`),Ce(a,"class","api-name svelte-j71ub0"),Ce(t,"class","highlight")},m(d,v){be(d,e,v),be(d,t,v),L(t,n),L(t,r),L(t,i),L(t,a),L(a,o),L(a,u),L(a,_),L(t,f)},p(d,v){v&128&&s!==(s=d[20]+"")&&Re(r,s),v&128&&c!==(c=d[21]+"")&&Re(u,c)},d(d){d&&($e(e),$e(t))}}}function kr(l){let e,t,n,s;const r=[br,$r,vr],i=[];function a(o,c){return o[1]==="python"?0:o[1]==="javascript"?1:o[1]==="bash"?2:-1}return~(e=a(l))&&(t=i[e]=r[e](l)),{c(){t&&t.c(),n=fr()},m(o,c){~e&&i[e].m(o,c),be(o,n,c),s=!0},p(o,c){let u=e;e=a(o),e===u?~e&&i[e].p(o,c):(t&&(pr(),Rt(i[u],1,1,()=>{i[u]=null}),_r()),~e?(t=i[e],t?t.p(o,c):(t=i[e]=r[e](o),t.c()),zt(t,1),t.m(n.parentNode,n)):t=null)},i(o){s||(zt(t),s=!0)},o(o){Rt(t),s=!1},d(o){o&&$e(n),~e&&i[e].d(o)}}}function yr(l){let e,t,n;return t=new ut({props:{border_mode:"focus",$$slots:{default:[kr]},$$scope:{ctx:l}}}),{c(){e=ve("div"),_n(t.$$.fragment),Ce(e,"class","container svelte-j71ub0")},m(s,r){be(s,e,r),pn(t,e,null),n=!0},p(s,[r]){const i={};r&268436479&&(i.$$scope={dirty:r,ctx:s}),t.$set(i)},i(s){n||(zt(t.$$.fragment,s),n=!0)},o(s){Rt(t.$$.fragment,s),n=!1},d(s){s&&$e(e),fn(t)}}}function wr(l,e,t){let{dependencies:n}=e,{short_root:s}=e,{root:r}=e,{api_prefix:i=""}=e,{current_language:a}=e,{username:o}=e,c,u,_,f,{api_calls:d=[]}=e;async function v(){return await(await fetch(r.replace(/\/$/,"")+i+"/info/?all_endpoints=true")).json()}let m,$=[],p=[],S=[];function h(b,M){const T=`/${n[b.fn_index].api_name}`,k=b.data.filter(C=>typeof C<"u").map((C,w)=>{if(m[T]){const A=m[T].parameters[w];if(!A)return;const q=A.parameter_name,H=A.python_type.type;if(M==="py")return`  ${q}=${Je(C,H,"py")}`;if(M==="js")return`    ${q}: ${Je(C,H,"js")}`;if(M==="bash")return`    ${Je(C,H,"bash")}`}return`  ${Je(C,void 0,M)}`}).filter(C=>typeof C<"u").join(`,
63`);if(k){if(M==="py")return`${k},
64`;if(M==="js")return`{
65${k},
66}`;if(M==="bash")return`
67${k}
68`}return M==="py"?"":`
69`}hr(async()=>{m=(await v()).named_endpoints;let M=d.map(C=>h(C,"py")),T=d.map(C=>h(C,"js")),P=d.map(C=>h(C,"bash")),k=d.map(C=>n[C.fn_index].api_name||"");t(7,$=M.map((C,w)=>({call:C,api_name:k[w]}))),t(8,p=T.map((C,w)=>({call:C,api_name:k[w]}))),t(9,S=P.map((C,w)=>({call:C,api_name:k[w]}))),await gr(),t(4,u=c.innerText)});function g(b){kn[b?"unshift":"push"](()=>{c=b,t(3,c)})}function y(b){kn[b?"unshift":"push"](()=>{_=b,t(5,_)})}function j(b){kn[b?"unshift":"push"](()=>{f=b,t(6,f)})}return l.$$set=b=>{"dependencies"in b&&t(10,n=b.dependencies),"short_root"in b&&t(0,s=b.short_root),"root"in b&&t(11,r=b.root),"api_prefix"in b&&t(12,i=b.api_prefix),"current_language"in b&&t(1,a=b.current_language),"username"in b&&t(2,o=b.username),"api_calls"in b&&t(13,d=b.api_calls)},[s,a,o,c,u,_,f,$,p,S,n,r,i,d,g,y,j]}class Cr extends ur{constructor(e){super(),dr(this,e,wr,yr,mr,{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}),ht()}get short_root(){return this.$$.ctx[0]}set short_root(e){this.$$set({short_root:e}),ht()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),ht()}get api_prefix(){return this.$$.ctx[12]}set api_prefix(e){this.$$set({api_prefix:e}),ht()}get current_language(){return this.$$.ctx[1]}set current_language(e){this.$$set({current_language:e}),ht()}get username(){return this.$$.ctx[2]}set username(e){this.$$set({username:e}),ht()}get api_calls(){return this.$$.ctx[13]}set api_calls(e){this.$$set({api_calls:e}),ht()}}const Sr="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",jr="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",qr="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.
696,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:Tr,append:De,attr:kt,check_outros:Nr,create_component:Pr,destroy_component:Ar,destroy_each:Or,detach:qe,element:et,empty:Er,ensure_array_like:$l,flush:Xt,group_outros:Mr,init:Ir,insert:Te,mount_component:Dr,noop:zr,safe_not_equal:Rr,set_data:Lt,set_style:Lr,space:At,text:Le,toggle_class:bl,transition_in:tn,transition_out:jn}=window.__gradio__svelte__internal;function kl(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 Fr(l){let e;return{c(){e=Le("1 element")},m(t,n){Te(t,e,n)},p:zr,d(t){t&&qe(e)}}}function Ur(l){let e=l[3]=="python"?"tuple":"list",t,n,s=l[1].length+"",r,i;return{c(){t=Le(e),n=Le(" of "),r=Le(s),i=Le(`
70		elements`)},m(a,o){Te(a,t,o),Te(a,n,o),Te(a,r,o),Te(a,i,o)},p(a,o){o&8&&e!==(e=a[3]=="python"?"tuple":"list")&&Lt(t,e),o&2&&s!==(s=a[1].length+"")&&Lt(r,s)},d(a){a&&(qe(t),qe(n),qe(r),qe(i))}}}function yl(l){let e;return{c(){e=et("span"),e.textContent=`[${l[10]}]`,kt(e,"class","code svelte-16h224k")},m(t,n){Te(t,e,n)},d(t){t&&qe(e)}}}function Hr(l){let e=l[2][l[10]].type+"",t;return{c(){t=Le(e)},m(n,s){Te(n,t,s)},p(n,s){s&4&&e!==(e=n[2][n[10]].type+"")&&Lt(t,e)},d(n){n&&qe(t)}}}function Jr(l){let e=l[6].type+"",t;return{c(){t=Le(e)},m(n,s){Te(n,t,s)},p(n,s){s&2&&e!==(e=n[6].type+"")&&Lt(t,e)},d(n){n&&qe(t)}}}function wl(l){let e,t,n,s,r,i,a,o,c,u=l[4]+"",_,f,d=l[7]+"",v,m,$,p=l[1].length>1&&yl(l);function S(y,j){return y[3]==="python"?Jr:Hr}let h=S(l),g=h(l);return{c(){e=et("hr"),t=At(),n=et("div"),s=et("p"),p&&p.c(),r=At(),i=et("span"),g.c(),a=At(),o=et("p"),c=Le('The output value that appears in the "'),_=Le(u),f=Le('" '),v=Le(d),m=Le(`
71				component.`),$=At(),kt(e,"class","hr svelte-16h224k"),kt(i,"class","code highlight svelte-16h224k"),kt(o,"class","desc svelte-16h224k"),Lr(n,"margin","10px")},m(y,j){Te(y,e,j),Te(y,t,j),Te(y,n,j),De(n,s),p&&p.m(s,null),De(s,r),De(s,i),g.m(i,null),De(n,a),De(n,o),De(o,c),De(o,_),De(o,f),De(o,v),De(o,m),De(n,$)},p(y,j){y[1].length>1?p||(p=yl(y),p.c(),p.m(s,r)):p&&(p.d(1),p=null),h===(h=S(y))&&g?g.p(y,j):(g.d(1),g=h(y),g&&(g.c(),g.m(i,null))),j&2&&u!==(u=y[4]+"")&&Lt(_,u),j&2&&d!==(d=y[7]+"")&&Lt(v,d)},d(y){y&&(qe(e),qe(t),qe(n)),p&&p.d(),g.d()}}}function Cl(l){let e,t,n;return t=new xl({props:{margin:!1}}),{c(){e=et("div"),Pr(t.$$.fragment),kt(e,"class","load-wrap")},m(s,r){Te(s,e,r),Dr(t,e,null),n=!0},i(s){n||(tn(t.$$.fragment,s),n=!0)},o(s){jn(t.$$.fragment,s),n=!1},d(s){s&&qe(e),Ar(t)}}}function Vr(l){let e,t,n,s,r,i,a,o;function c(m,$){return m[1].length>1?Ur:Fr}let u=c(l),_=u(l),f=$l(l[1]),d=[];for(let m=0;m<f.length;m+=1)d[m]=wl(kl(l,f,m));let v=l[0]&&Cl();return{c(){e=et("h4"),t=et("div"),t.innerHTML='<div class="toggle-dot toggle-right svelte-16h224k"></div>',n=Le(`
72	Returns `),_.c(),s=At(),r=et("div");for(let m=0;m<d.length;m+=1)d[m].c();i=At(),v&&v.c(),a=Er(),kt(t,"class","toggle-icon svelte-16h224k"),kt(e,"class","svelte-16h224k"),bl(r,"hide",l[0])},m(m,$){Te(m,e,$),De(e,t),De(e,n),_.m(e,null),Te(m,s,$),Te(m,r,$);for(let p=0;p<d.length;p+=1)d[p]&&d[p].m(r,null);Te(m,i,$),v&&v.m(m,$),Te(m,a,$),o=!0},p(m,[$]){if(u===(u=c(m))&&_?_.p(m,$):(_.d(1),_=u(m),_&&(_.c(),_.m(e,null))),$&14){f=$l(m[1]);let p;for(p=0;p<f.length;p+=1){const S=kl(m,f,p);d[p]?d[p].p(S,$):(d[p]=wl(S),d[p].c(),d[p].m(r,null))}for(;p<d.length;p+=1)d[p].d(1);d.length=f.length}(!o||$&1)&&bl(r,"hide",m[0]),m[0]?v?$&1&&tn(v,1):(v=Cl(),v.c(),tn(v,1),v.m(a.parentNode,a)):v&&(Mr(),jn(v,1,1,()=>{v=null}),Nr())},i(m){o||(tn(v),o=!0)},o(m){jn(v),o=!1},d(m){m&&(qe(e),qe(s),qe(r),qe(i),qe(a)),_.d(),Or(d,m),v&&v.d(m)}}}function Br(l,e,t){let{is_running:n}=e,{endpoint_returns:s}=e,{js_returns:r}=e,{current_language:i}=e;return l.$$set=a=>{"is_running"in a&&t(0,n=a.is_running),"endpoint_returns"in a&&t(1,s=a.endpoint_returns),"js_returns"in a&&t(2,r=a.js_returns),"current_language"in a&&t(3,i=a.current_language)},[n,s,r,i]}class Gr extends Tr{constructor(e){super(),Ir(this,e,Br,Vr,Rr,{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}),Xt()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),Xt()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),Xt()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),Xt()}}const Yr=""+new URL("mcp-DNm9doVd.svg",import.meta.url).href,{SvelteComponent:Wr,append:N,attr:z,check_outros:Bt,create_component:Ve,destroy_component:Be,destroy_each:qn,detach:J,element:D,empty:Zr,ensure_array_like:Ot,flush:Ye,group_outros:Gt,init:Qr,insert:V,listen:Ft,mount_component:Ge,noop:Yt,run_all:Xr,safe_not_equal:Kr,set_data:Ne,set_style:He,space:ie,text:Z,transition_in:_e,transition_out:me}=window.__gradio__svelte__internal;function Sl(l,e,t){const n=l.slice();n[26]=e[t],n[29]=e,n[30]=t;const s=n[6][n[26].meta.endpoint_name]?.success_rate||0;n[27]=s;const r=os(n[27]);return n[28]=r,n}function jl(l,e,t){const n=l.slice();return n[31]=e[t][0],n[32]=e[t][1],n}function ql(l){const e=l.slice(),t=e[14][e[26].meta.mcp_type];return e[35]=t,e}function Tl(l,e,t){const n=l.slice();return n[36]=e[t][0],n[37]=e[t][1],n}function xr(l){let e,t,n,s,r,i,a;return{c(){e=Z(`This Gradio app can also serve as an MCP server, with an MCP tool
73	corresponding to each API endpoint. To enable this, launch this Gradio app
74	with `),t=D("code"),t.textContent=".launch(mcp_server=True)",n=Z(` or set the
75	`),s=D("code"),s.textContent="GRADIO_MCP_SERVER",r=Z(`
76	env variable to
77	`),i=D("code"),i.textContent='"True"',a=Z(".")},m(o,c){V(o,e,c),V(o,t,c),V(o,n,c),V(o,s,c),V(o,r,c),V(o,i,c),V(o,a,c)},p:Yt,i:Yt,o:Yt,d(o){o&&(J(e),J(t),J(n),J(s),J(r),J(i),J(a))}}}function eo(l){let e,t,n,s,r,i,a,o,c=(l[1].length>0?l[1].length:l[0].length)+"",u,_,f,d,v,m,$,p,S,h,g,y,j,b,M,T,P,k,C,w,A,q,H,G,Y,re,W,ne=Ot(l[13]),ae=[];for(let O=0;O<ne.length;O+=1)ae[O]=Nl(Tl(l,ne,O));let le=l[7]!=="stdio"&&Pl(l);d=new ns({}),$=new ts({}),h=new es({});let ke=l[1].length>0&&Al(l),R=Ot(l[1].length>0?l[1]:l[0]),ue=[];for(let O=0;O<R.length;O+=1)ue[O]=zl(Sl(l,R,O));const Ke=O=>me(ue[O],1,1,()=>{ue[O]=null}),de=[ro,io,so],xe=[];function In(O,Q){return O[7]==="streamable_http"?0:O[7]==="sse"?1:O[7]==="stdio"?2:-1}~(k=In(l))&&(C=xe[k]=de[k](l));let Ee=l[4]&&Rl(l);return{c(){e=D("div"),t=D("div"),n=D("span"),n.textContent="Trans
77port:",s=ie();for(let O=0;O<ae.length;O+=1)ae[O].c();r=ie(),le&&le.c(),i=ie(),a=D("div"),o=D("strong"),u=Z(c),_=Z(` Available MCP Tools
78			(`),f=D("span"),Ve(d.$$.fragment),v=Z("), Resources ("),m=D("span"),Ve($.$$.fragment),p=Z("), and Prompts ("),S=D("span"),Ve(h.$$.fragment),g=Z(")"),y=ie(),ke&&ke.c(),j=ie(),b=D("div");for(let O=0;O<ue.length;O+=1)ue[O].c();M=ie(),T=D("p"),T.textContent=" ",P=ie(),C&&C.c(),w=ie(),Ee&&Ee.c(),A=ie(),q=D("p"),q.textContent=" ",H=ie(),G=D("p"),Y=D("a"),re=Z("Read more about MCP in the Gradio docs"),z(n,"class","transport-label svelte-97rvku"),z(t,"class","snippets svelte-97rvku"),z(e,"class","transport-selection svelte-97rvku"),He(f,"display","inline-block"),He(f,"vertical-align","sub"),He(m,"display","inline-block"),He(m,"vertical-align","sub"),He(S,"display","inline-block"),He(S,"vertical-align","sub"),z(a,"class","tool-selection svelte-97rvku"),z(b,"class","mcp-tools svelte-97rvku"),z(Y,"href",l[5]),z(Y,"target","_blank"),z(Y,"class","svelte-97rvku")},m(O,Q){V(O,e,Q),N(e,t),N(t,n),N(t,s);for(let Ie=0;Ie<ae.length;Ie+=1)ae[Ie]&&ae[Ie].m(t,null);V(O,r,Q),le&&le.m(O,Q),V(O,i,Q),V(O,a,Q),N(a,o),N(o,u),N(o,_),N(o,f),Ge(d,f,null),N(o,v),N(o,m),Ge($,m,null),N(o,p),N(o,S),Ge(h,S,null),N(o,g),N(a,y),ke&&ke.m(a,null),V(O,j,Q),V(O,b,Q);for(let Ie=0;Ie<ue.length;Ie+=1)ue[Ie]&&ue[Ie].m(b,null);V(O,M,Q),V(O,T,Q),V(O,P,Q),~k&&xe[k].m(O,Q),V(O,w,Q),Ee&&Ee.m(O,Q),V(O,A,Q),V(O,q,Q),V(O,H,Q),V(O,G,Q),N(G,Y),N(Y,re),W=!0},p(O,Q){if(Q[0]&8320){ne=Ot(O[13]);let ce;for(ce=0;ce<ne.length;ce+=1){const Ut=Tl(O,ne,ce);ae[ce]?ae[ce].p(Ut,Q):(ae[ce]=Nl(Ut),ae[ce].c(),ae[ce].m(t,null))}for(;ce<ae.length;ce+=1)ae[ce].d(1);ae.length=ne.length}if(O[7]!=="stdio"?le?(le.p(O,Q),Q[0]&128&&_e(le,1)):(le=Pl(O),le.c(),_e(le,1),le.m(i.parentNode,i)):le&&(Gt(),me(le,1,1,()=>{le=null}),Bt()),(!W||Q[0]&3)&&c!==(c=(O[1].length>0?O[1].length:O[0].length)+"")&&Ne(u,c),O[1].length>0?ke?ke.p(O,Q):(ke=Al(O),ke.c(),ke.m(a,null)):ke&&(ke.d(1),ke=null),Q[0]&16583){R=Ot(O[1].length>0?O[1]:O[0]);let ce;for(ce=0;ce<R.length;ce+=1){const Ut=Sl(O,R,ce);ue[ce]?(ue[ce].p(Ut,Q),_e(ue[ce],1)):(ue[ce]=zl(Ut),ue[ce].c(),_e(ue[ce],1),ue[ce].m(b,null))}for(Gt(),ce=R.length;ce<ue.length;ce+=1)Ke(ce);Bt()}let Ie=k;k=In(O),k===Ie?~k&&xe[k].p(O,Q):(C&&(Gt(),me(xe[Ie],1,1,()=>{xe[Ie]=null}),Bt()),~k?(C=xe[k],C?C.p(O,Q):(C=xe[k]=de[k](O),C.c()),_e(C,1),
vendor: 35,918 bytes, lines 78-129
78C.m(w.parentNode,w)):C=null),O[4]?Ee?Ee.p(O,Q):(Ee=Rl(O),Ee.c(),Ee.m(A.parentNode,A)):Ee&&(Ee.d(1),Ee=null),(!W||Q[0]&32)&&z(Y,"href",O[5])},i(O){if(!W){_e(le),_e(d.$$.fragment,O),_e($.$$.fragment,O),_e(h.$$.fragment,O);for(let Q=0;Q<R.length;Q+=1)_e(ue[Q]);_e(C),W=!0}},o(O){me(le),me(d.$$.fragment,O),me($.$$.fragment,O),me(h.$$.fragment,O),ue=ue.filter(Boolean);for(let Q=0;Q<ue.length;Q+=1)me(ue[Q]);me(C),W=!1},d(O){O&&(J(e),J(r),J(i),J(a),J(j),J(b),J(M),J(T),J(P),J(w),J(A),J(q),J(H),J(G)),qn(ae,O),le&&le.d(O),Be(d),Be($),Be(h),ke&&ke.d(),qn(ue,O),~k&&xe[k].d(O),Ee&&Ee.d(O)}}}function Nl(l){let e,t=l[37]+"",n,s,r,i,a;function o(){return l[19](l[36])}return{c(){e=D("button"),n=Z(t),s=ie(),z(e,"type","button"),z(e,"class",r="snippet "+(l[7]===l[36]?"current-lang":"inactive-lang")+" svelte-97rvku")},m(c,u){V(c,e,u),N(e,n),N(e,s),i||(a=Ft(e,"click",o),i=!0)},p(c,u){l=c,u[0]&128&&r!==(r="snippet "+(l[7]===l[36]?"current-lang":"inactive-lang")+" svelte-97rvku")&&z(e,"class",r)},d(c){c&&J(e),i=!1,a()}}}function Pl(l){let e,t,n,s;return e=new ut({props:{$$slots:{default:[to]},$$scope:{ctx:l}}}),{c(){Ve(e.$$.fragment),t=ie(),n=D("p"),n.textContent=" "},m(r,i){Ge(e,r,i),V(r,t,i),V(r,n,i),s=!0},p(r,i){const a={};i[0]&4224|i[1]&512&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){s||(_e(e.$$.fragment,r),s=!0)},o(r){me(e.$$.fragment,r),s=!1},d(r){r&&(J(t),J(n)),Be(e,r)}}}function to(l){let e,t,n,s,r=l[7]==="sse"?"SSE":"Streamable HTTP",i,a,o,c,u,_,f,d;return f=new Fe({props:{code:l[12]}}),{c(){e=D("div"),t=D("label"),n=D("span"),n.textContent="●",s=Z("MCP Server URL ("),i=Z(r),a=Z(")"),o=ie(),c=D("div"),u=D("input"),_=ie(),Ve(f.$$.fragment),z(n,"class","status-indicator active svelte-97rvku"),z(t,"for","mcp-server-url"),z(t,"class","svelte-97rvku"),z(u,"id","mcp-server-url"),z(u,"type","text"),u.readOnly=!0,u.value=l[12],z(u,"class","svelte-97rvku"),z(c,"class","textbox svelte-97rvku"),z(e,"class","mcp-url svelte-97rvku")},m(v,m){V(v,e,m),N(e,t),N(t,n),N(t,s),N(t,i),N(t,a),N(e,o),N(e,c),N(c,u),N(c,_),Ge(f,c,null),d=!0},p(v,m){(!d||m[0]&128)&&r!==(r=v[7]==="sse"?"SSE":"Streamable HTTP")&&Ne(i,r),(!d||m[0]&4096&&u.value!==v[12])&&(u.value=v[12]);const $={};m[0]&4096&&($.code=v[12]),f.$set($)},i(v){d||(_e(f.$$.fragment,v),d=!0)},o(v){me(f.$$.fragment,v),d=!1},d(v){v&&J(e),Be(f)}}}function Al(l){let e,t,n,s,r,i;return{c(){e=D("div"),t=D("button"),t.textContent="Select All",n=ie(),s=D("button"),s.textContent="Select None",z(t,"class","select-all-btn svelte-97rvku"),z(s,"class","select-none-btn svelte-97rvku"),z(e,"class","tool-selection-controls svelte-97rvku")},m(a,o){V(a,e,o),N(e,t),N(e,n),N(e,s),r||(i=[Ft(t,"click",l[20]),Ft(s,"click",l[21])],r=!0)},p:Yt,d(a){a&&J(e),r=!1,Xr(i)}}}function Ol(l){let e,t,n,s,r,i;function a(...o){return l[22](l[26],...o)}return{c(){e=D("input"),z(e,"type","checkbox"),z(e,"class","tool-checkbox svelte-97rvku"),e.checked=t=l[2].has(l[26].name)||l[7]!=="streamable_http",e.disabled=n=l[7]!=="streamable_http",z(e,"style",s=l[7]!=="streamable_http"?"opacity: 0.5; cursor: not-allowed;":"")},m(o,c){V(o,e,c),r||(i=Ft(e,"change",a),r=!0)},p(o,c){l=o,c[0]&135&&t!==(t=l[2].has(l[26].name)||l[7]!=="streamable_http")&&(e.checked=t),c[0]&128&&n!==(n=l[7]!=="streamable_http")&&(e.disabled=n),c[0]&128&&s!==(s=l[7]!=="streamable_http"?"opacity: 0.5; cursor: not-allowed;":"")&&z(e,"style",s)},d(o){o&&J(e),r=!1,i()}}}function El(l){let e,t;return e=new l[35]({}),{c(){Ve(e.$$.fragment)},m(n,s){Ge(e,n,s),t=!0},i(n){t||(_e(e.$$.fragment,n),t=!0)},o(n){me(e.$$.fragment,n),t=!1},d(n){Be(e,n)}}}function Ml(l){let e,t,n=l[6][l[26].meta.endpoint_name].total_requests+"",s,r,i,a,o=Math.round(l[27]*100)+"",c,u,_,f,d=Ue(l[6][l[26].meta.endpoint_name].process_time_percentiles["50th"])+"",v,m,$=Ue(l[6][l[26].meta.endpoint_name].process_time_percentiles["90th"])+"",p,S,h=Ue(l[6][l[26].meta.endpoint_name].process_time_percentiles["99th"])+"",g;return{c(){e=D("span"),t=Z("Total requests: "),s=Z(n),r=ie(),i=D("span"),a=Z("("),c=Z(o),u=Z("% successful)"),f=Z(`
79									 |  p50/p90/p99:
80									`),v=Z(d),m=Z(`
81									/
82									`),p=Z($),S=Z(`
83									/
84									`),g=Z(h),z(i,"style",_=l[28]),z(e,"class","tool-analytics svelte-97rvku"),He(e,"color","var(--body-text-color-subdued)"),He(e,"margin-left","1em")},m(y,j){V(y,e,j),N(e,t),N(e,s),N(e,r),N(e,i),N(i,a),N(i,c),N(i,u),N(e,f),N(e,v),N(e,m),N(e,p),N(e,S),N(e,g)},p(y,j){j[0]&67&&n!==(n=y[6][y[26].meta.endpoint_name].total_requests+"")&&Ne(s,n),j[0]&67&&o!==(o=Math.round(y[27]*100)+"")&&Ne(c,o),j[0]&67&&_!==(_=y[28])&&z(i,"style",_),j[0]&67&&d!==(d=Ue(y[6][y[26].meta.endpoint_name].process_time_percentiles["50th"])+"")&&Ne(v,d),j[0]&67&&$!==($=Ue(y[6][y[26].meta.endpoint_name].process_time_percentiles["90th"])+"")&&Ne(p,$),j[0]&67&&h!==(h=Ue(y[6][y[26].meta.endpoint_name].process_time_percentiles["99th"])+"")&&Ne(g,h)},d(y){y&&J(e)}}}function Il(l){let e,t;function n(i,a){return a[0]&3&&(t=null),t==null&&(t=Object.keys(i[26].parameters).length>0),t?lo:no}let s=n(l,[-1,-1]),r=s(l);return{c(){e=D("div"),r.c(),z(e,"class","tool-content svelte-97rvku")},m(i,a){V(i,e,a),r.m(e,null)},p(i,a){s===(s=n(i,a))&&r?r.p(i,a):(r.d(1),r=s(i),r&&(r.c(),r.m(e,null)))},d(i){i&&J(e),r.d()}}}function no(l){let e;return{c(){e=D("p"),e.textContent="Takes no input parameters"},m(t,n){V(t,e,n)},p:Yt,d(t){t&&J(e)}}}function lo(l){let e,t=Ot(Object.entries(l[26].parameters)),n=[];for(let s=0;s<t.length;s+=1)n[s]=Dl(jl(l,t,s));return{c(){e=D("div");for(let s=0;s<n.length;s+=1)n[s].c();z(e,"class","tool-parameters")},m(s,r){V(s,e,r);for(let i=0;i<n.length;i+=1)n[i]&&n[i].m(e,null)},p(s,r){if(r[0]&3){t=Ot(Object.entries(s[26].parameters));let i;for(i=0;i<t.length;i+=1){const a=jl(s,t,i);n[i]?n[i].p(a,r):(n[i]=Dl(a),n[i].c(),n[i].m(e,null))}for(;i<n.length;i+=1)n[i].d(1);n.length=t.length}},d(s){s&&J(e),qn(n,s)}}}function Dl(l){let e,t,n=l[31]+"",s,r,i,a,o=l[32].type+"",c,u=l[32].default!==void 0?`, default: ${JSON.stringify(l[32].default)}`:"",_,f,d,v,m=(l[32].description?l[32].description:"⚠︎ No description for this parameter in function docstring")+"",$,p;return{c(){e=D("div"),t=D("code"),s=Z(n),r=ie(),i=D("span"),a=Z("("),c=Z(o),_=Z(u),f=Z(")"),d=ie(),v=D("p"),$=Z(m),p=ie(),z(t,"class","svelte-97rvku"),z(i,"class","parameter-type svelte-97rvku"),z(v,"class","parameter-description svelte-97rvku"),z(e,"class","parameter svelte-97rvku")},m(S,h){V(S,e,h),N(e,t),N(t,s),N(e,r),N(e,i),N(i,a),N(i,c),N(i,_),N(i,f),N(e,d),N(e,v),N(v,$),N(e,p)},p(S,h){h[0]&3&&n!==(n=S[31]+"")&&Ne(s,n),h[0]&3&&o!==(o=S[32].type+"")&&Ne(c,o),h[0]&3&&u!==(u=S[32].default!==void 0?`, default: ${JSON.stringify(S[32].default)}`:"")&&Ne(_,u),h[0]&3&&m!==(m=(S[32].description?S[32].description:"⚠︎ No description for this parameter in function docstring")+"")&&Ne($,m)},d(S){S&&J(e)}}}function zl(l){let e,t,n,s,r,i,a,o,c=l[26].name+"",u,_,f,d=(l[26].description?l[26].description:"⚠︎ No description provided in function docstring")+"",v,m,$,p,S=l[26].expanded?"▼":"▶",h,g,y,j,b,M,T=l[1].length>0&&Ol(l),P=l[14][l[26].meta.mcp_type]&&El(ql(l)),k=l[6][l[26].meta.endpoint_name]&&Ml(l);function C(){return l[23](l[26],l[29],l[30])}let w=l[26].expanded&&Il(l);return{c(){e=D("div"),t=D("div"),T&&T.c(),n=ie(),s=D("button"),r=D("span"),i=D("span"),P&&P.c(),a=ie(),o=D("span"),u=Z(c),_=Z(`
85							 
86							`),f=D("span"),v=Z(d),m=ie(),k&&k.c(),$=ie(),p=D("span"),h=Z(S),g=ie(),w&&w.c(),y=ie(),He(i,"display","inline-block"),He(i,"padding-right","6px"),He(i,"vertical-align","sub"),z(o,"class","tool-name svelte-97rvku"),z(f,"class","tool-description svelte-97rvku"),He(r,"display","inline-block"),z(p,"class","tool-arrow svelte-97rvku"),z(s,"class","tool-header svelte-97rvku"),z(t,"class","tool-header-wrapper svelte-97rvku"),z(e,"class","tool-item svelte-97rvku")},m(A,q){V(A,e,q),N(e,t),T&&T.m(t,null),N(t,n),N(t,s),N(s,r),N(r,i),P&&P.m(i,null),N(r,a),N(r,o),N(o,u),N(r,_),N(r,f),N(f,v),N(r,m),k&&k.m(r,null),N(s,$),N(s,p),N(p,h),N(e,g),w&&w.m(e,null),N(e,y),j=!0,b||(M=Ft(s,"click",C),b=!0)},p(A,q){l=A,l[1].length>0?T?T.p(l,q):(T=Ol(l),T.c(),T.m(t,n)):T&&(T.d(1),T=null),l[14][l[26].meta.mcp_type]?P?q[0]&3&&_e(P,1):(P=El(ql(l)),P.c(),_e(P,1),P.m(i,null)):P&&(Gt(),me(P,1,1,()=>{P=null}),Bt()),(!j||q[0]&3)&&c!==(c=l[26].name+"")&&Ne(u,c),(!j||q[0]&3)&&d!==(d=(l[26].description?l[26].description:"⚠︎ No description provided in function docstring")+"")&&Ne(v,d),l[6][l[26].meta.endpoint_name]?k?k.p(l,q):(k=Ml(l),k.c(),k.m(r,null)):k&&(k.d(1),k=null),(!j||q[0]&3)&&S!==(S=l[26].expanded?"▼":"▶")&&Ne(h,S),l[26].expanded?w?w.p(l,q):(w=Il(l),w.c(),w.m(e,y)):w&&(w.d(1),w=null)},i(A){j||(_e(P),j=!0)},o(A){me(P),j=!1},d(A){A&&J(e),T&&T.d(),P&&P.d(),k&&k.d(),w&&w.d(),b=!1,M()}}}function so(l){let e,t,n,s,r,i,a,o;return a=new ut({props:{$$slots:{default:[oo]},$$scope:{ctx:l}}}),{c(){e=D("strong"),e.textContent="STDIO Transport",t=Z(`: For clients that only support stdio (e.g.
87		Claude Desktop), first
88		`),n=D("a"),n.textContent="install Node.js",s=Z(`. Then, you can use the following command:
89		`),r=D("p"),r.textContent=" ",i=ie(),Ve(a.$$.fragment),z(n,"href","https://nodejs.org/en/download/"),z(n,"target","_blank"),z(n,"class","svelte-97rvku")},m(c,u){V(c,e,u),V(c,t,u),V(c,n,u),V(c,s,u),V(c,r,u),V(c,i,u),Ge(a,c,u),o=!0},p(c,u){const _={};u[0]&512|u[1]&512&&(_.$$scope={dirty:u,ctx:c}),a.$set(_)},i(c){o||(_e(a.$$.fragment,c),o=!0)},o(c){me(a.$$.fragment,c),o=!1},d(c){c&&(J(e),J(t),J(n),J(s),J(r),J(i)),Be(a,c)}}}function io(l){let e,t,n,s,r,i;return r=new ut({props:{$$slots:{default:[ao]},$$scope:{ctx:l}}}),{c(){e=D("strong"),e.textContent="SSE Transport",t=Z(`: The SSE transport has been deprecated by the
90		MCP spec. We recommend using the Streamable HTTP transport instead. But to
91		add this MCP to clients that only support server-sent events (SSE), simply
92		add the following configuration to your MCP config.
93		`),n=D("p"),n.textContent=" ",s=ie(),Ve(r.$$.fragment)},m(a,o){V(a,e,o),V(a,t,o),V(a,n,o),V(a,s,o),Ge(r,a,o),i=!0},p(a,o){const c={};o[0]&1024|o[1]&512&&(c.$$scope={dirty:o,ctx:a}),r.$set(c)},i(a){i||(_e(r.$$.fragment,a),i=!0)},o(a){me(r.$$.fragment,a),i=!1},d(a){a&&(J(e),J(t),J(n),J(s)),Be(r,a)}}}function ro(l){let e,t,n,s,r,i;return r=new ut({props:{$$slots:{default:[co]},$$scope:{ctx:l}}}),{c(){e=D("strong"),e.textContent="Streamable HTTP Transport",t=Z(`: To add this MCP to clients that
94		support Streamable HTTP, simply add the following configuration to your MCP
95		config.
96		`),n=D("p"),n.textContent=" ",s=ie(),Ve(r.$$.fragment)},m(a,o){V(a,e,o),V(a,t,o),V(a,n,o),V(a,s,o),Ge(r,a,o),i=!0},p(a,o){const c={};o[0]&2048|o[1]&512&&(c.$$scope={dirty:o,ctx:a}),r.$set(c)},i(a){i||(_e(r.$$.fragment,a),i=!0)},o(a){me(r.$$.fragment,a),i=!1},d(a){a&&(J(e),J(t),J(n),J(s)),Be(r,a)}}}function oo(l){let e,t,n,s,r,i,a=JSON.stringify(l[9],null,2)+"",o,c;return n=new Fe({props:{code:JSON.stringify(l[9],null,2)}}),{c(){e=D("code"),t=D("div"),Ve(n.$$.fragment),s=ie(),r=D("div"),i=D("pre"),o=Z(a),z(t,"class","copy svelte-97rvku"),z(i,"class","svelte-97rvku"),z(e,"class","svelte-97rvku")},m(u,_){V(u,e,_),N(e,t),Ge(n,t,null),N(e,s),N(e,r),N(r,i),N(i,o),c=!0},p(u,_){const f={};_[0]&512&&(f.code=JSON.stringify(u[9],null,2)),n.$set(f),(!c||_[0]&512)&&a!==(a=JSON.stringify(u[9],null,2)+"")&&Ne(o,a)},i(u){c||(_e(n.$$.fragment,u),c=!0)},o(u){me(n.$$.fragment,u),c=!1},d(u){u&&J(e),Be(n)}}}function ao(l){let e,t,n,s,r,i,a=JSON.stringify(l[10],null,2)+"",o,c;return n=new Fe({props:{code:JSON.stringify(l[10],null,2)}}),{c(){e=D("code"),t=D("div"),Ve(n.$$.fragment),s=ie(),r=D("div"),i=D("pre"),o=Z(a),z(t,"class","copy svelte-97rvku"),z(i,"class","svelte-97rvku"),z(e,"class","svelte-97rvku")},m(u,_){V(u,e,_),N(e,t),Ge(n,t,null),N(e,s),N(e,r),N(r,i),N(i,o),c=!0},p(u,_){const f={};_[0]&1024&&(f.code=JSON.stringify(u[10],null,2)),n.$set(f),(!c||_[0]&1024)&&a!==(a=JSON.stringify(u[10],null,2)+"")&&Ne(o,a)},i(u){c||(_e(n.$$.fragment,u),c=!0)},o(u){me(n.$$.fragment,u),c=!1},d(u){u&&J(e),Be(n)}}}function co(l){let e,t,n,s,r,i,a=JSON.stringify(l[11],null,2)+"",o,c;return n=new Fe({props:{code:JSON.stringify(l[11],null,2)}}),{c(){e=D("code"),t=D("div"),Ve(n.$$.fragment),s=ie(),r=D("div"),i=D("pre"),o=Z(a),z(t,"class","copy svelte-97rvku"),z(i,"class","svelte-97rvku"),z(e,"class","svelte-97rvku")},m(u,_){V(u,e,_),N(e,t),Ge(n,t,null),N(e,s),N(e,r),N(r,i),N(i,o),c=!0},p(u,_){const f={};_[0]&2048&&(f.code=JSON.stringify(u[11],null,2)),n.$set(f),(!c||_[0]&2048)&&a!==(a=JSON.stringify(u[11],null,2)+"")&&Ne(o,a)},i(u){c||(_e(n.$$.fragment,u),c=!0)},o(u){me(n.$$.fragment,u),c=!1},d(u){u&&J(e),Be(n)}}}function Rl(l){let e,t,n,s,r,i,a,o;return{c(){e=D("div"),t=D("label"),n=D("input"),s=Z(`
97				Include Gradio file upload tool`),r=ie(),i=D("p"),i.innerHTML=`The <code>upload_files_to_gradio</code> tool uploads files from your
98				local <code>UPLOAD_DIRECTORY</code> (or any of its subdirectories) to
99				the Gradio app. This is needed because MCP servers require files to be
100				provided as URLs. You can omit this tool if you prefer to upload files
101				manually. This tool requires
102				<a href="https://docs.astral.sh/uv/getting-started/installation/" target="_blank" class="svelte-97rvku">uv</a> to be installed.`,z(n,"type","checkbox"),z(n,"class","checkbox svelte-97rvku"),z(t,"class","checkbox-label svelte-97rvku"),z(i,"class","file-upload-explanation svelte-97rvku"),z(e,"class","file-upload-section svelte-97rvku")},m(c,u){V(c,e,u),N(e,t),N(t,n),n.checked=l[8],N(t,s),N(e,r),N(e,i),a||(o=Ft(n,"change",l[24]),a=!0)},p(c,u){u[0]&256&&(n.checked=c[8])},d(c){c&&J(e),a=!1,o()}}}function uo(l){let e,t,n,s;const r=[eo,xr],i=[];function a(o,c){return o[3]?0:1}return e=a(l),t=i[e]=r[e](l),{c(){t.c(),n=Zr()},m(o,c){i[e].m(o,c),V(o,n,c),s=!0},p(o,c){let u=e;e=a(o),e===u?i[e].p(o,c):(Gt(),me(i[u],1,1,()=>{i[u]=null}),Bt(),t=i[e],t?t.p(o,c):(t=i[e]=r[e](o),t.c()),_e(t,1),t.m(n.parentNode,n))},i(o){s||(_e(t),s=!0)},o(o){me(t),s=!1},d(o){o&&J(n),i[e].d(o)}}}function _o(l,e,t){let n,s,r,i,{mcp_server_active:a}=e,{mcp_server_url:o}=e,{mcp_server_url_streamable:c}=e,{tools:u}=e,{all_tools:_=[]}=e,{selected_tools:f=new Set}=e,{mcp_json_sse:d}=e,{mcp_json_stdio:v}=e,{file_data_present:m}=e,{mcp_docs:$}=e,{analytics:p}=e,S="streamable_http",h=!0;const g=[["streamable_http","Streamable HTTP"],["sse","SSE"],["stdio","STDIO"]],y={tool:ns,resource:ts,prompt:es};function j(w,A){if(!w)return null;const q=JSON.parse(JSON.stringify(w));if(A&&m){const H={command:"uvx",args:["--from","gradio[mcp]","gradio","upload-mcp",S==="sse"?o:c,"<UPLOAD_DIRECTORY>"]};q.mcpServers.upload_files_to_gradio=H}else delete q.mcpServers?.upload_files_to_gradio;return q}const b=w=>t(7,S=w),M=()=>{t(2,f=new Set(_.map(w=>w.name)))},T=()=>{t(2,f=new Set)},P=(w,A)=>{A.currentTarget.checked?f.add(w.name):f.delete(w.name),t(2,f)},k=(w,A,q)=>t(1,A[q].expanded=!w.expanded,_,t(0,u));function C(){h=this.checked,t(8,h)}return l.$$set=w=>{"mcp_server_active"in w&&t(3,a=w.mcp_server_active),"mcp_server_url"in w&&t(15,o=w.mcp_server_url),"mcp_server_url_streamable"in w&&t(16,c=w.mcp_server_url_streamable),"tools"in w&&t(0,u=w.tools),"all_tools"in w&&t(1,_=w.all_tools),"selected_tools"in w&&t(2,f=w.selected_tools),"mcp_json_sse"in w&&t(17,d=w.mcp_json_sse),"mcp_json_stdio"in w&&t(18,v=w.mcp_json_stdio),"file_data_present"in w&&t(4,m=w.file_data_present),"mcp_docs"in w&&t(5,$=w.mcp_docs),"analytics"in w&&t(6,p=w.analytics)},l.$$.update=()=>{l.$$.dirty[0]&98432&&t(12,n=S==="sse"?o:c),l.$$.dirty[0]&196864&&t(11,s=j(d?{...d,mcpServers:{...d.mcpServers,gradio:{...d.mcpServers.gradio,url:c}}}:null,h)),l.$$.dirty[0]&131328&&t(10,r=j(d,h)),l.$$.dirty[0]&262400&&t(9,i=j(v,h))},[u,_,f,a,m,$,p,S,h,i,r,s,n,g,y,o,c,d,v,b,M,T,P,k,C]}class fo extends Wr{constructor(e){super(),Qr(this,e,_o,uo,Kr,{mcp_server_active:3,mcp_server_url:15,mcp_server_url_streamable:16,tools:0,all_tools:1,selected_tools:2,mcp_json_sse:17,mcp_json_stdio:18,file_data_present:4,mcp_docs:5,analytics:6},null,[-1,-1])}get mcp_server_active(){return this.$$.ctx[3]}set mcp_server_active(e){this.$$set({mcp_server_active:e}),Ye()}get mcp_server_url(){return this.$$.ctx[15]}set mcp_server_url(e){this.$$set({mcp_server_url:e}),Ye()}get mcp_server_url_streamable(){return this.$$.ctx[16]}set mcp_server_url_streamable(e){this.$$set({mcp_server_url_streamable:e}),Ye()}get tools(){return this.$$.ctx[0]}set tools(e){this.$$set({tools:e}),Ye()}get all_tools(){return this.$$.ctx[1]}set all_tools(e){this.$$set({all_tools:e}),Ye()}get selected_tools(){return this.$$.ctx[2]}set selected_tools(e){this.$$set({selected_tools:e}),Ye()}get mcp_json_sse(){return this.$$.ctx[17]}set mcp_json_sse(e){this.$$set({mcp_json_sse:e}),Ye()}get mcp_json_stdio(){return this.$$.ctx[18]}set mcp_json_stdio(e){this.$$set({mcp_json_stdio:e}),Ye()}get file_data_present(){return this.$$.ctx[4]}set file_data_present(e){this.$$set({file_data_present:e}),Ye()}get mcp_docs(){return this.$$.ctx[5]}set mcp_docs(e){this.$$set({mcp_docs:e}),Ye()}get analytics(){return this.$$.ctx[6]}set analytics(e){this.$$set({analytics:e}),Ye()}}const{SvelteComponent:po,add_flush_callback:mo,append:ee,attr:x,bind:ho,binding_callbacks:go,bubble:Ll,check_outros:wt,create_component:ot,destroy_component:at,destroy_each:fs,detach:F,element:se,empty:Wt,ensure_array_like:ln,flush:gt,group_outros:Ct,init:vo,insert:U,listen:$o,mount_component:ct,noop:Et,safe_not_equal:bo,set_data:Tn,set_style:vt,space:Ae,src_url_equal:ko,text:te,transition_in:oe,transition_out:pe}=window.__gradio__svelte__internal,{onMount:yo,createEventDispatcher:wo}=window.__gradio__svelte__internal;function Fl(l,e,t){const n=l.slice();return n[38]=e[t],n}function Ul(l,e,t){const n=l.slice();return n[41]=e[t][0],n[42]=e[t][1],n[43]=e[t][2],n}function Hl(l){let e,t,n,s;const r=[So,Co],i=[];function a(o,c){return o[18]?0:1}return e=a(l),t=i[e]=r[e](l),{c(){t.c(),n=Wt()},m(o,c){i[e].m(o,c),U(o,n,c),s=!0},p(o,c){t.p(o,c)},i(o){s||(oe(t),s=!0)},o(o){pe(t),s=!1},d(o){o&&F(n),i[e].d(o)}}}function Co(l){let e,t;return e=new Ts({props:{root:l[0]}}),e.$on("close",l[29]),{c(){ot(e.$$.fragment)},m(n,s){ct(e,n,s),t=!0},p(n,s){const r={};s[0]&1&&(r.root=n[0]),e.$set(r)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){pe(e.$$.fragment,n),t=!1},d(n){at(e,n)}}}function So(l){let e,t,n,s,r,i,a,o,c,u,_,f,d;t=new Gs({props:{root:l[3]||l[0],api_count:l[18],current_language:l[10]}}),t.$on("close",l[24]);let v=ln(l[19]),m=[];for(let g=0;g<v.length;g+=1)m[g]=Jl(Ul(l,v,g));const $=[qo,jo],p=[];function S(g,y){return g[5].length?0:1}u=S(l),_=p[u]=$[u](l);let h=l[10]!=="mcp"&&Wl(l);return{c(){e=se("div"),ot(t.$$.fragment),n=Ae(),s=se("div"),r=se("div"),r.innerHTML='<p style="font-size: var(--text-lg);">Choose one of the following ways to interact with the API.</p>',i=Ae(),a=se("div"),o=se("div");for(let g=0;g<m.length;g+=1)m[g].c();c=Ae(),_.c(),f=Ae(),h&&h.c(),x(e,"class","banner-wrap svelte-1b8jye8"),x(r,"class","client-doc svelte-1b8jye8"),x(o,"class","snippets svelte-1b8jye8"),x(a,"class","endpoint svelte-1b8jye8"),x(s,"class","docs-wrap svelte-1b8jye8")},m(g,y){U(g,e,y),ct(t,e,null),U(g,n,y),U(g,s,y),ee(s,r),ee(s,i),ee(s,a),ee(a,o);for(let j=0;j<m.length;j+=1)m[j]&&m[j].m(o,null);ee(a,c),p[u].m(a,null),ee(a,f),h&&h.m(a,null),d=!0},p(g,y){const j={};if(y[0]&9&&(j.root=g[3]||g[0]),y[0]&1024&&(j.current_language=g[10]),t.$set(j),y[0]&525312){v=ln(g[19]);let M;for(M=0;M<v.length;M+=1){const T=Ul(g,v,M);m[M]?m[M].p(T,y):(m[M]=Jl(T),m[M].c(),m[M].m(o,null))}for(;M<m.length;M+=1)m[M].d(1);m.length=v.length}let b=u;u=S(g),u===b?p[u].p(g,y):(Ct(),pe(p[b],1,1,()=>{p[b]=null}),wt(),_=p[u],_?_.p(g,y):(_=p[u]=$[u](g),_.c()),oe(_,1),_.m(a,f)),g[10]!=="mcp"?h?(h.p(g,y),y[0]&1024&&oe(h,1)):(h=Wl(g),h.c(),oe(h,1),h.m(a,null)):h&&(Ct(),pe(h,1,1,()=>{h=null}),wt())},i(g){d||(oe(t.$$.fragment,g),oe(_),oe(h),d=!0)},o(g){pe(t.$$.fragment,g),pe(_),pe(h),d=!1},d(g){g&&(F(e),F(n),F(s)),at(t),fs(m,g),p[u].d(),h&&h.d()}}}function Jl(l){let e,t,n,s,r=l[42]+"",i,a,o,c,u;function _(){return l[25](l[41])}return{c(){e=se("li"),t=se("img"),s=Ae(),i=te(r),a=Ae(),ko(t.src,n=l[43])||x(t,"src",n),x(t,"alt",""),x(t,"class","svelte-1b8jye8"),x(e,"class",o="snippet "+(l[10]===l[41]?"current-lang":"inactive-lang")+" svelte-1b8jye8")},m(f,d){U(f,e,d),ee(e,t),ee(e,s),ee(e,i),ee(e,a),c||(u=$o(e,"click",_),c=!0)},p(f,d){l=f,d[0]&1024&&o!==(o="snippet "+(l[10]===l[41]?"current-lang":"inactive-lang")+" svelte-1b8jye8")&&x(e,"class",o)},d(f){f&&F(e),c=!1,u()}}}function jo(l){let e,t,n,s,r,i;const a=[Po,No,To],o=[];function c(_,f){return _[10]=="python"||_[10]=="javascript"?0:_[10]=="mcp"?1:2}t=c(l),n=o[t]=a[t](l);let u=l[10]!=="mcp"&&Vl(l);return{c(){e=se("p"),n.c(),s=Ae(),u&&u.c(),r=Wt(),x(e,"class","padded svelte-1b8jye8")},m(_,f){U(_,e,f),o[t].m(e,null),U(_,s,f),u&&u.m(_,f),U(_,r,f),i=!0},p(_,f){let d=t;t=c(_),t===d?o[t].p(_,f):(Ct(),pe(o[d],1,1,()=>{o[d]=null}),wt(),n=o[t],n?n.p(_,f):(n=o[t]=a[t](_),n.c()),oe(n,1),n.m(e,null)),_[10]!=="mcp"?u?(u.p(_,f),f[0]&1024&&oe(u,1)):(u=Vl(_),u.c(),oe(u,1),u.m(r.parentNode,r)):u&&(Ct(),pe(u,1,1,()=>{u=null}),wt())},i(_){i||(oe(n),oe(u),i=!0)},o(_){pe(n),pe(u),i=!1},d(_){_&&(F(e),F(s),F(r)),o[t].d(),u&&u.d(_)}}}function qo(l){let e,t,n,s,r,i=l[5].length+"",a,o,c,u,_,f,d,v,m,$,p,S,h,g;return m=new Cr({props:{current_language:l[10],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=se("div"),t=se("p"),n=te("🪄 Recorded API Calls "),s=se("span"),r=te("["),a=te(i),o=te("]"),c=Ae(),u=se("p"),_=te(`Here is the code snippet to replay the most recently recorded API
103							calls using the `),f=te(l[10]),d=te(`
104							client.`),v=Ae(),ot(m.$$.fragment),$=Ae(),p=se("p"),p.textContent=`Note: Some API calls only affect the UI, so when using the
105							clients, the desired result may be achieved with only a subset of
106							the recorded calls.`,S=Ae(),h=se("p"),h.textContent="API Documentation",x(s,"class","api-count svelte-1b8jye8"),x(t,"id","num-recorded-api-calls"),vt(t,"font-size","var(--text-lg)"),vt(t,"font-weight","bold"),vt(t,"margin","10px 0px"),vt(h,"font-size","var(--text-lg)"),vt(h,"font-weight","bold"),vt(h,"margin","30px 0px 10px")},m(y,j){U(y,e,j),ee(e,t),ee(t,n),ee(t,s),ee(s,r),ee(s,a),ee(s,o),ee(e,c),ee(e,u),ee(u,_),ee(u,f),ee(u,d),ee(e,v),ct(m,e,null),ee(e,$),ee(e,p),U(y,S,j),U(y,h,j),g=!0},p(y,j){(!g||j[0]&32)&&i!==(i=y[5].length+"")&&Tn(a,i),(!g||j[0]&1024)&&Tn(f,y[10]);const b={};j[0]&1024&&(b.current_language=y[10]),j[0]&32&&(b.api_calls=y[5]),j[0]&2&&(b.dependencies=y[1]),j[0]&1&&(b.root=y[0]),j[0]&4&&(b.api_prefix=y[2].api_prefix),j[0]&9&&(b.short_root=y[3]||y[0]),j[0]&16&&(b.username=y[4]),m.$set(b)},i(y){g||(oe(m.$$.fragment,y),g=!0)},o(y){pe(m.$$.fragment,y),g=!1},d(y){y&&(F(e),F(S),F(h)),at(m)}}}function To(l){let e;return{c(){e=te("1. Confirm that you have cURL installed on your system.")},m(t,n){U(t,e,n)},p:Et,i:Et,o:Et,d(t){t&&F(e)}}}function No(l){let e,t,n;function s(i){l[27](i)}let r={mcp_server_active:l[11],mcp_server_url:l[16],mcp_server_url_streamable:l[17],tools:l[6].filter(l[26]),all_tools:l[6],mcp_json_sse:l[7],mcp_json_stdio:l[8],file_data_present:l[15],mcp_docs:Eo,analytics:l[14]};return l[9]!==void 0&&(r.selected_tools=l[9]),e=new fo({props:r}),go.push(()=>ho(e,"selected_tools",s)),{c(){ot(e.$$.fragment)},m(i,a){ct(e,i,a),n=!0},p(i,a){const o={};a[0]&2048&&(o.mcp_server_active=i[11]),a[0]&65536&&(o.mcp_server_url=i[16]),a[0]&131072&&(o.mcp_server_url_streamable=i[17]),a[0]&576&&(o.tools=i[6].filter(i[26])),a[0]&64&&(o.all_tools=i[6]),a[0]&128&&(o.mcp_json_sse=i[7]),a[0]&256&&(o.mcp_json_stdio=i[8]),a[0]&32768&&(o.file_data_present=i[15]),a[0]&16384&&(o.analytics=i[14]),!t&&a[0]&512&&(t=!0,o.selected_tools=i[9],mo(()=>t=!1)),e.$set(o)},i(i){n||(oe(e.$$.fragment,i),n=!0)},o(i){pe(e.$$.fragment,i),n=!1},d(i){at(e,i)}}}function Po(l){let e,t,n,s,r,i,a,o;return{c(){e=te(`1. Install the
107							`),t=se("span"),n=te(l[10]),s=te(`
108							client (`),r=se("a"),i=te("docs"),o=te(") if you don't already have it installed."),vt(t,"text-transform","capitalize"),x(r,"href",a=l[10]=="python"?rn:sn),x(r,"target","_blank"),x(r,"class","svelte-1b8jye8")},m(c,u){U(c,e,u),U(c,t,u),ee(t,n),U(c,s,u),U(c,r,u),ee(r,i),U(c,o,u)},p(c,u){u[0]&1024&&Tn(n,c[10]),u[0]&1024&&a!==(a=c[10]=="python"?rn:sn)&&x(r,"href",a)},i:Et,o:Et,d(c){c&&(F(e),F(t),F(s),F(r),F(o))}}}function Vl(l){let e,t,n,s,r,i,a,o;e=new Li({props:{current_language:l[10]}});let c=l[3]&&Bl(l);i=new Pn({props:{size:"sm",variant:"secondary",$$slots:{default:[Ao]},$$scope:{ctx:l}}}),i.$on("click",l[28]);let u=l[10]=="bash"&&Gl(l);return{c(){ot(e.$$.fragment),t=Ae(),n=se("p"),s=te(`2. Find the API endpoint below corresponding to your desired
109							function in the app. Copy the code snippet, replacing the
110							placeholder values with your own input data.
111							`),c&&c.c(),r=te(`
112
113							Or use the
114							`),ot(i.$$.fragment),a=te(`
115							to automatically generate your API requests.
116							`),u&&u.c(),x(n,"class","padded svelte-1b8jye8")},m(_,f){ct(e,_,f),U(_,t,f),U(_,n,f),ee(n,s),c&&c.m(n,null),ee(n,r),ct(i,n,null),ee(n,a),u&&u.m(n,null),o=!0},p(_,f){const d={};f[0]&1024&&(d.current_language=_[10]),e.$set(d),_[3]?c?c.p(_,f):(c=Bl(_),c.c(),c.m(n,r)):c&&(c.d(1),c=null);const v={};f[1]&32768&&(v.$$scope={dirty:f,ctx:_}),i.$set(v),_[10]=="bash"?u?u.p(_,f):(u=Gl(_),u.c(),u.m(n,null)):u&&(u.d(1),u=null)},i(_){o||(oe(e.$$.fragment,_),oe(i.$$.fragment,_),o=!0)},o(_){pe(e.$$.fragment,_),pe(i.$$.fragment,_),o=!1},d(_){_&&(F(t),F(n)),at(e,_),c&&c.d(),at(i),u&&u.d()}}}function Bl(l){let e,t,n,s,r;return{c(){e=te(`If this is a private Space, you may need to pass
117								your Hugging Face token as well (`),t=se("a"),n=te("read more"),r=te(")."),x(t,"href",s=l[10]=="python"?rn+Kt:l[10]=="javascript"?sn+Kt:Nn),x(t,"class","underline svelte-1b8jye8"),x(t,"target","_blank")},m(i,a){U(i,e,a),U(i,t,a),ee(t,n),U(i,r,a)},p(i,a){a[0]&1024&&s!==(s=i[10]=="python"?rn+Kt:i[10]=="javascript"?sn+Kt:Nn)&&x(t,"href",s)},d(i){i&&(F(e),F(t),F(r))}}}function Ao(l){let e,t,n;return{c(){e=se("div"),t=Ae(),n=se("p"),n.textContent="API Recorder",x(e,"class","loading-dot svelte-1b8jye8"),x(n,"class","self-baseline svelte-1b8jye8")},m(s,r){U(s,e,r),U(s,t,r),U(s,n,r)},p:Et,d(s){s&&(F(e),F(t),F(n))}}}function Gl(l){let e,t,n,s,r,i,a,o,c,u,_,f,d,v,m,$,p,S,h,g,y,j,b,M,T=l[4]!==null&&Yl();return{c(){e=se("br"),t=te(" "),n=se("br"),s=te(`Making a
118								prediction and getting a result requires
119								`),r=se("strong"),r.textContent="2 requests",i=te(`: a
120								`),a=se("code"),a.textContent="POST",o=te(`
121								and a `),c=se("code"),c.textContent="GET",u=te(" request. The "),_=se("code"),_.textContent="POST",f=te(` request
122								returns an `),d=se("code"),d.textContent="EVENT_ID",v=te(`, which is used in the second
123								`),m=se("code"),m.textContent="GET",$=te(` request to fetch the results. In these
124								snippets, we've used `),p=se("code"),p.textContent="awk",S=te(" and "),h=se("code"),h.textContent="read",g=te(` to
125								parse the results, combining these two requests into one command
126								for ease of use. `),T&&T.c(),y=te(` See
127								`),j=se("a"),b=te("curl docs"),M=te("."),x(a,"class","svelte-1b8jye8"),x(c,"class","svelte-1b8jye8"),x(_,"class","svelte-1b8jye8"),x(d,"class","svelte-1b8jye8"),x(m,"class","svelte-1b8jye8"),x(p,"class","svelte-1b8jye8"),x(h,"class","svelte-1b8jye8"),x(j,"href",Nn),x(j,"target","_blank"),x(j,"class","svelte-1b8jye8")},m(P,k){U(P,e,k),U(P,t,k),U(P,n,k),U(P,s,k),U(P,r,k),U(P,i,k),U(P,a,k),U(P,o,k),U(P,c,k),U(P,u,k),U(P,_,k),U(P,f,k),U(P,d,k),U(P,v,k),U(P,m,k),U(P,$,k),U(P,p,k),U(P,S,k),U(P,h,k),U(P,g,k),T&&T.m(P,k),U(P,y,k),U(P,j,k),ee(j,b),U(P,M,k)},p(P,k){P[4]!==null?T||(T=Yl(),T.c(),T.m(y.parentNode,y)):T&&(T.d(1),T=null)},d(P){P&&(F(e),F(t),F(n),F(s),F(r),F(i),F(a),F(o),F(c),F(u),F(_),F(f),F(d),F(v),F(m),F($),F(p),F(S),F(h),F(g),F(y),F(j),F(M)),T&&T.d(P)}}}function Yl(l){let e;return{c(){e=te(`Note: connecting to an authenticated app requires an
128									additional request.`)},m(t,n){U(t,e,n)},d(t){t&&F(e)}}}function Wl(l){let e,t,n=ln(l[1]),s=[];for(let i=0;i<n.length;i+=1)s[i]=Ql(Fl(l,n,i));const r=i=>pe(s[i],1,1,()=>{s[i]=null});return{c(){for(let i=0;i<s.length;i+=1)s[i].c();e=Wt()},m(i,a){for(let o=0;o<s.length;o+=1)s[o]&&s[o].m(i,a);U(i,e,a),t=!0},p(i,a){if(a[0]&29727){n=ln(i[1]);let o;for(o=0;o<n.length;o+=1){const c=Fl(i,n,o);s[o]?(s[o].p(c,a),oe(s[o],1)):(s[o]=Ql(c),s[o].c(),oe(s[o],1),s[o].m(e.parentNode,e))}for(Ct(),o=n.length;o<s.length;o+=1)r(o);wt()}},i(i){if(!t){for(let a=0;a<n.length;a+=1)oe(s[a]);t=!0}},o(i){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)pe(s[a]);t=!1},d(i){i&&F(e),fs(s,i)}}}function Zl(l){let e,t,n,s,r,i,a,o;return t=new cr({props:{endpoint_parameters:l[12].named_endpoints["/"+l[38].api_name].parameters,dependency:l[38],current_language:l[10],root:l[0],space_id:l[3],username:l[4],api_prefix:l[2].api_prefix,api_description:l[12].named_endpoints["/"+l[38].api_name].description,analytics:l[14]}}),s=new ui({props:{endpoint_returns:l[12].named_endpoints["/"+l[38].api_name].parameters,js_returns:l[13].named_endpoints["/"+l[38].api_name].parameters,is_running:Xl,current_language:l[10]}}),i=new Gr({props:{endpoint_returns:l[12].named_endpoints["/"+l[38].api_name].returns,js_returns:l[13].named_endpoints["/"+l[38].api_name].returns,is_running:Xl,current_language:l[10]}}),{c(){e=se("div"),ot(t.$$.fragment),n=Ae(),ot(s.$$.fragment),r=Ae(),ot(i.$$.fragment),a=Ae(),x(e,"class","endpoint-container svelte-1b8jye8")},m(c,u){U(c,e,u),ct(t,e,null),ee(e,n),ct(s,e,null),ee(e,r),ct(i,e,null),ee(e,a),o=!0},p(c,u){const _={};u[0]&4098&&(_.endpoint_parameters=c[12].named_endpoints["/"+c[38].api_name].parameters),u[0]&2&&(_.dependency=c[38]),u[0]&1024&&(_.current_language=c[10]),u[0]&1&&(_.root=c[0]),u[0]&8&&(_.space_id=c[3]),u[0]&16&&(_.username=c[4]),u[0]&4&&(_.api_prefix=c[2].api_prefix),u[0]&4098&&(_.api_description=c[12].named_endpoints["/"+c[38].api_name].description),u[0]&16384&&(_.analytics=c[14]),t.$set(_);const f={};u[0]&4098&&(f.endpoint_returns=c[12].named_endpoints["/"+c[38].api_name].parameters),u[0]&8194&&(f.js_returns=c[13].named_endpoints["/"+c[38].api_name].parameters),u[0]&1024&&(f.current_language=c[10]),s.$set(f);const d={};u[0]&4098&&(d.endpoint_returns=c[12].named_endpoints["/"+c[38].api_name].returns),u[0]&8194&&(d.js_returns=c[13].named_endpoints["/"+c[38].api_name].returns),u[0]&1024&&(d.current_language=c[10]),i.$set(d)},i(c){o||(oe(t.$$.fragment,c),oe(s.$$.fragment,c),oe(i.$$.fragment,c),o=!0)},o(c){pe(t.$$.fragment,c),pe(s.$$.fragment,c),pe(i.$$.fragment,c),o=!1},d(c){c&&F(e),at(t),at(s),at(i)}}}function Ql(l){let e,t,n=l[38].show_api&&l[12].named_endpoints["/"+l[38].api_name]&&Zl(l);return{c(){n&&n.c(),e=Wt()},m(s,r){n&&n.m(s,r),U(s,e,r),t=!0},p(s,r){s[38].show_api&&s[12].named_endpoints["/"+s[38].api_name]?n?(n.p(s,r),r[0]&4098&&oe(n,1)):(n=Zl(s),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(Ct(),pe(n,1,1,()=>{n=null}),wt())},i(s){t||(oe(n),t=!0)},o(s){pe(n),t=!1},d(s){s&&F(e),n&&n.d(s)}}}function Oo(l){let e,t,n=l[12]&&l[14]&&Hl(l);return{c(){n&&n.c(),e=Wt()},m(s,r){n&&n.m(s,r),U(s,e,r),t=!0},p(s,r){s[12]&&s[14]?n?(n.p(s,r),r[0]&20480&&oe(n,1)):(n=Hl(s),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(Ct(),pe(n,1,1,()=>{n=null}),wt())},i(s){t||(oe(n),t=!0)},o(s){pe(n),t=!1},d(s){s&&F(e),n&&n.d(s)}}}const sn="https://www.gradio.app/guides/getting-started-with-the-js-client",rn="https://www.gradio.app/guides/getting-started-with-the-python-client",Nn="https://www.gradio.app/guides/querying-gradio-apps-with-curl",Kt="#connecting-to-a-hugging-face-space",Eo="https://www.gradio.app/guides/building-mcp-server-with-gradio";let Xl=!1;function Mo(l,e){const t=new URL(window.location.href);t.searchParams.set(l,e),history.replaceState(null,"",t.toString())}function Io(l){return new URL(window.location.href).searchParams.get(l)}function yn(l){return["python","javascript","bash","mcp"].includes(l??"")}function Do(l,e,t){let n,s,r,i,{dependencies:a}=e,{root:o}=e,{app:c}=e,{space_id:u}=e,{root_node:_}=e,{username:f}=e,d=a.filter(R=>R.show_api).length;o===""&&(o=location.protocol+"//"+location.host+location.pathname),o.endsWith("/")||(o+="/");let{api_calls:v=[]}=e,m="python";const $=[["python","Python",Sr],["javascript","JavaScript",jr],["bash","cURL",qr],["mcp","MCP",Yr]];let p=!1;async function S(){return await(await fetch(o.replace(/\/$/,"")+c.api_prefix+"/info")).json()}async function h(){return await c.view_api()}let g,y,j;S().then(R=>{t(12,g=R)}),h().then(R=>{t(13,y=R)});async function b(){return await(await fetch(o.replace(/\/$/,"")+"/monitoring/summary")).json()}b().then(R=>{t(14,j=R.functions)});const M=wo();let T=[],P=[],k,C,w=!1,A=new Set,q=u?u.split("/").pop()+"_":"";function H(R){return q&&R.startsWith(q)?R.slice(q.length):R}const G={command:"uvx",args:["--from","gradio[mcp]","gradio","upload-mcp",o,"<UPLOAD_DIRECTORY>"]};async function Y(){try{let R=`${o}gradio_api/mcp/schema`;const Ke=await(await fetch(R)).json();t(15,w=Ke.map(de=>de.meta?.file_data_present).some(de=>de)),t(6,T=Ke.map(de=>({name:de.name,description:de.description||"",parameters:de.inputSchema?.properties||{},meta:de.meta,expanded:!1,endpoint_name:de.endpoint_name}))),t(9,A=new Set(T.map(de=>de.name))),P=Ke.map(de=>de.meta?.headers||[]).flat(),P.length>0?(t(7,k={mcpServers:{gradio:{url:r,headers:P.reduce((de,xe)=>(de[xe]="<YOUR_HEADER_VALUE>",de),{})}}}),t(8,C={mcpServers:{gradio:{command:"npx",args:["mcp-remote",r,"--transport","sse-only",...P.map(de=>["--header",`${de}: <YOUR_HEADER_VALUE>`]).flat()]}}})):(t(7,k={mcpServers:{gradio:{url:r}}}),t(8,C={mcpServers:{gradio:{command:"npx",args:["mcp-remote",r,"--transport","sse-only"]}}}),w&&(t(7,k.mcpServers.upload_files_to_gradio=G,k),t(8,C.mcpServers.upload_files_to_gradio=G,C)))}catch(R){console.error("Failed to fetch MCP tools:",R),t(6,T=[])}}yo(()=>{const R=new AbortController,ue=R.signal;document.body.style.overflow="hidden","parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0);const Ke=Io("lang");return yn(Ke)&&t(10,m=Ke),fetch(r,{signal:ue}).then(de=>{t(11,p=de.ok),p?(Y(),yn(Ke)||t(10,m="mcp")):yn(Ke)||t(10,m="python"),R.abort()}).catch(()=>{t(11,p=!1)}),()=>{document.body.style.overflow="auto"}});function re(R){Ll.call(this,l,R)}const W=R=>{t(10,m=R),Mo("lang",R)},ne=R=>A.has(R.name);function ae(R){A=R,t(9,A)}const le=()=>M("close",{api_recorder_visible:!0});function ke(R){Ll.call(this,l,R)}return l.$$set=R=>{"dependencies"in R&&t(1,a=R.dependencies),"root"in R&&t(0,o=R.root),"app"in R&&t(2,c=R.app),"space_id"in R&&t(3,u=R.space_id),"root_node"in R&&t(21,_=R.root_node),"username"in R&&t(4,f=R.username),"api_calls"in R&&t(5,v=R.api_calls)},l.$$.update=()=>{if(l.$$.dirty[0]&512&&t(23,n=Array.from(A)),l.$$.dirty[0]&8388608&&t(22,s=n.map(H)),l.$$.dirty[0]&1&&t(16,r=`${o}gradio_api/mcp/sse`),l.$$.dirty[0]&12582977&&t(17,i=n.length>0&&n.length<T.length?`${o}gradio_api/mcp/?tools=${s.join(",")}`:`${o}gradio_api/mcp/`),l.$$.dirty[0]&12583873&&k&&A.size>0){const R=n.length>0&&n.length<T.length?`${o}gradio_api/mcp/sse?tools=${s.join(",")}`:`${o}gradio_api/mcp/sse`;t(7,k.mcpServers.gradio.url=R,k),C&&t(8,C.mcpServers.gradio.args[1]=R,C)}},[o,a,c,u,f,v,T,k,C,A,m,p,g,y,j,w,r,i,d,$,M,_,s,n,re,W,ne,ae,le,ke]}class Zo extends po{constructor(e){super(),vo(this,e,Do,Oo,bo,{dependencies:1,root:0,app:2,space_id:3,root_node:21,username:4,api_calls:5},null,[-1,-1])}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),gt()}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),gt()}get app(){return this.$$.ctx[2]}set app(e){this.$$set({app:e}),gt()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),gt()}get root_node(){return this.$$.ctx[21]}set root_node(e){this.$$set({root_node:e}),gt()}get username(){return this.$$.ctx[4]}set username(e){this.$$set({username:e}),gt()}get api_calls(){return this.$$.ctx[5]}set api_calls(e){this.$$set({api_calls:e}),gt()}}export{Zo as default};
129//# sourceMappingURL=ApiDocs-B7xG8uq0.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.