PageSourceSearch

https://manika123456789-black-tea-powder-classifier.hf.space/assets/Blocks-D6_IyY-z.js

js manika123456789-black-tea-powder-classifier.hf.space collected 2026-10-04 17:05:43 UTC 32,243 bytes, 5 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ApiDocs-D66OUv1H.js","./i18n-Dnhn5Rxr.js","./index-DWyDLubb.js","./index-CyHPbdIk.css","./i18n-9kYrHpuJ.css","./misc-vsnLZ-Y1.js","./clear-CEoTtSVi.js","./Button-D-_s2ksk.js","./snippet-BWgYNF9D.js","./Image-CeW7PJs4.js","./Image-Da_XA0w6.css","./ScrollFade.svelte_svelte_type_style_lang-DPHOQHBm.js","./ScrollFade-DV-0xzhB.css","./Button-BZ4d-rtD.css","./ImagePreview-CCVfwC4m.css","./index-CglBvmLb.js","./StreamingBar.svelte_svelte_type_style_lang-Y9omZ2gK.js","./html-Ih_5QVTo.js","./index-B_pwUImq.js","./StreamingBar-CMuqaV2j.css","./Clear-BF6j078A.js","./Block-J4oodUWp.js","./input-DrerMDOL.js","./size-CtOeLwIl.js","./state.svelte-CXxGByZZ.js","./utils.svelte-CCyS_0CY.js","./clone-BkeCM4Nl.js","./index-DkrWwIux.js","./index-tFQomdd2.js","./ApiDocs-y7Md9q8F.css","./ApiRecorder-y0lpz3M9.js","./ApiRecorder-CoSLrx_1.css","./Settings-Bwz4Nb_m.js","./Dropdown-Beu8JVME.js","./window-Uydxco8n.js","./BlockTitle-BMm9LakX.js","./Info-Dzjhnd64.js","./DropdownArrow-BOSZEGSp.js","./IconButtonWrapper-D0s9l4wW.js","./Dropdown--Uz_kS2s.css","./Checkbox-HhbcVSTv.js","./universal-CFOISHmx.js","./Checkbox-BbySKLMz.css","./Settings-CLQaonub.css","./Example-BeU1J4ps.css","./Index-C-RstoJU.js","./Code-BLWhl1y6.js","./Code-wZDUWKrz.css","./Index.svelte_svelte_type_style_lang-D9os8tfr.js","./actions-CLThs9VH.js","./Check-DUAHzS2-.js","./Copy-ChCbTvli.js","./MarkdownCode-B8HQ3LiU.js","./prism-python-B4lzO_Nz.js","./MarkdownCode-7h5zEbas.css","./Index-cY7HT1Ac.css","./Index-DP8ihX8q.css","./Example-BK-tWmkG.css","./Example-CgIc4GLa.css"])))=>i.map(i=>d[i]);
2import{aO as Et,L as Ct,aP as St,h as Se,ar as Le,s as ze,i as rt,w as d,e as Lt,aJ as zt,ao as Ot,p as Rt,aQ as Mt,C as At,j as Ke,g as Dt,R as Fe,aR as ot,aS as De,u as be,y as lt,aT as Tt,a as v,T as Pe,W,x as F,a6 as Z,S as A,v as Xe,z as jt,aa as Ft,X as y,t as Y,a5 as Me,af as pe,V as I,a0 as me,Z as ie,aU as Pt,Y as q,aV as It,a7 as Ye}from"./index-DWyDLubb.js";import{d as dt,k as $e,u as et,i as k,g as qt,r as Ut,O as Vt,z as ct,j as Gt,P as _t,p as Ce,f as tt,q as it,m as Bt,b as at,a as N,w as Nt,A as Zt}from"./i18n-Dnhn5Rxr.js";import{h as Wt}from"./html-Ih_5QVTo.js";import{c as we}from"./ScrollFade.svelte_svelte_type_style_lang-DPHOQHBm.js";import{b as Ht}from"./size-CtOeLwIl.js";import"./StreamingBar.svelte_svelte_type_style_lang-Y9omZ2gK.js";import{L as Jt,T as Qt}from"./state.svelte-CXxGByZZ.js";import{I as Kt,t as Xt}from"./utils.svelte-CCyS_0CY.js";import{AppTree as Yt}from"./index-DkrWwIux.js";function $(o,e=[],i=[],a){var t=Et(),n=Ct,l=t.is_rendered();t.update_pending_count(1),n.increment(l);var c=Se;if(c){Lt();var g=rt,h=zt(!1);ze(h)}St(e,[],i,w=>{c&&(Le(!0),ze(g));try{for(const E of w)d(E);a(o,...w)}finally{c&&Le(!1),t.update_pending_count(-1),n.decrement(l)}})}function $t(o,e){let i=null,a=Se;var t;if(Se){i=rt;for(var n=Dt(document.head);n!==null&&(n.nodeType!==At||n.data!==o);)n=Ke(n);if(n===null)Le(!1);else{var l=Ke(n);n.remove(),ze(l)}}Se||(t=document.head.appendChild(Ot()));try{Rt(()=>e(t),Mt)}finally{a&&(Le(!0),ze(i))}}var ei=W("<span></span>");function ti(o,e){Fe(e,!0);var i,a,t,n=ot([async()=>i=await De(()=>e.node.component),async()=>a=await De(()=>e.node.runtime),()=>t=be(null),()=>{lt(()=>{if(!d(t)||!d(a)||!d(i))return;const c=e.node.props.shared_props,g=e.node.props.props,h=d(a),w=h.mount(d(i).default,{target:d(t),props:{shared_props:c,props:g,children:e.children}});return()=>{h.unmount(w)}})}]),l=ei();Tt([n[2]],()=>{dt(l,c=>F(t,c),()=>d(t))}),v(o,l),Pe()}function Te(o,e){Fe(e,!0);let i=Ut(e,["$$slots","$$events","$$legacy","node"]);var a,t=ot([async()=>a=await De(()=>e.node.component)]),n=Z(),l=A(n);$(l,[t[0]],[()=>e.node&&d(a)],(c,g)=>{var h=w=>{var E=Z(),u=A(E);$(u,[t[0]],[()=>e.node.props.shared_props.visible&&!e.node.runtime],(C,P)=>{var _=m=>{var b=Z(),x=A(b);$(x,[t[0]],void 0,S=>{we(x,()=>d(a).default,(V,D)=>{D(V,{get shared_props(){return e.node.props.shared_props},get props(){return e.node.props.props},children:(L,ae)=>{var G=Z(),B=A(G);$(B,[t[0]],[()=>e.node.children&&e.node.children.length],(J,ee)=>{var fe=se=>{var ne=Z(),re=A(ne);$(re,[t[0]],[()=>e.node.children],(Q,oe)=>{$e(Q,17,()=>d(oe),et,(K,le)=>{Te(K,{get node(){return d(le)}})})}),v(se,ne)};k(J,se=>{d(ee)&&se(fe)})}),v(L,G)},$$slots:{default:!0}})})}),v(m,b)},H=m=>{var b=Z(),x=A(b);$(x,[t[0]],[()=>e.node.props.shared_props.visible&&e.node.runtime],(S,V)=>{var D=L=>{$(L,[t[0]],void 0,ae=>{ti(ae,qt(()=>
2i,{get node(){return e.node},children:(G,B)=>{var J=Z(),ee=A(J);$(ee,[t[0]],[()=>e.node.children&&e.node.children.length],(fe,se)=>{var ne=re=>{var Q=Z(),oe=A(Q);$(oe,[t[0]],[()=>e.node.children],(K,le)=>{$e(K,17,()=>d(le),et,(Oe,Re)=>{Te(Oe,{get node(){return d(Re)}})})}),v(re,Q)};k(fe,re=>{d(se)&&re(ne)})}),v(G,J)},$$slots:{default:!0}}))})};k(S,L=>{d(V)&&L(D)},!0)}),v(m,b)};k(C,m=>{d(P)?m(_):m(H,!1)})}),v(w,E)};k(c,w=>{d(g)&&w(h)})}),v(o,n),Pe()}function ii(o){if(o==null)return"";const e=String(o),i=Gt(ct);if(e.includes(Kt))return Xt(e,i);const a=i(e);return typeof a=="string"&&a!==e?a:e}const ai=Vt(ct,()=>ii),si="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",ni="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",ri="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
2-.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",oi="data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'%3e%3c/g%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3ctitle%3erecord%20[%23982]%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3c/defs%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Dribbble-Light-Preview'%20transform='translate(-380.000000,%20-3839.000000)'%20fill='%23FF0000'%3e%3cg%20id='icons'%20transform='translate(56.000000,%20160.000000)'%3e%3cpath%20d='M338,3689%20C338,3691.209%20336.209,3693%20334,3693%20C331.791,3693%20330,3691.209%20330,3689%20C330,3686.791%20331.791,3685%20334,3685%20C336.209,3685%20338,3686.791%20338,3689%20M334,3697%20C329.589,3697%20326,3693.411%20326,3689%20C326,3684.589%20329.589,3681%20334,3681%20C338.411,3681%20342,3684.589%20342,3689%20C342,3693.411%20338.411,3697%20334,3697%20M334,3679%20C328.477,3679%20324,3683.477%20324,3689%20C324,3694.523%20328.477,3699%20334,3699%20C339.523,3699%20344,3694.523%20344,3689%20C344,3683.477%20339.523,3679%20334,3679'%20id='record-[%23982]'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";let xe=!1,ue=null,Ie=[],li=0,ye={},di,je,ci=null,Ae=[];async function _i(){if(!xe)try{const o=document.title;document.title="[Sharing] Gradio Tab";const e=await navigator.mediaDevices.getDisplayMedia({video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!0,selfBrowserSurface:"include"});document.title=o;const i={videoBitsPerSecond:5e6};ue=new MediaRecorder(e,i),Ie=[],ye={},ue.ondataavailable=fi,ue.onstop=gi,ue.start(1e3),xe=!0,li=Date.now()}catch(o){je("Recording Error","Failed to start recording: "+o.message,"error")}}function ui(){!xe||!ue||(ue.stop(),xe=!1)}function fi(o){o.data.size>0&&Ie.push(o.data)}function gi(){xe=!1;const o=new Blob(Ie,{type:"video/mp4"});hi(o),(ue?.stream?.getTracks()||[]).forEach(i=>i.stop())}async function hi(o){try{je("Processing video","This may take a few seconds...","info");const e=new FormData;e.append("video",o,"recording.mp4"),ye.start!==void 0&&ye.end!==void 0&&(e.append("remove_segment_start",ye.start.toString()),e.append("remove_segment_end",ye.end.toString())),Ae.length>0&&e.append("zoom_effects",JSON.stringify(Ae));const i=await fetch(di+"/gradio_api/process_recording",{method:"POST",body:e});if(!i.ok)throw new Error(`Server returned ${i.status}: ${i.statusText}`);const a=await i.blob(),t=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;st(a,t),Ae=[]}catch{je("Processing Error","Failed to process recording. Saving original version.","warning");const i=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;st(o,i)}}function st(o,e){const i=URL.createObjectURL(o),a=document.createElement("a");a.style.display="none",a.href=i,a.download=e,document.body.appendChild(a),a.click(),setTimeout(()=>{document.body.removeChild(a),URL.revokeObjectURL(i)},100)}const vi=/^'([^]+)'$/,nt=Symbol("NOVALUE");class pi{id;inputs;outputs;cancels;pending=!1;trigger_modes;event_args={};targets=[];connection_type;triggers=[];original_trigger_id=null;show_progress_on=null;component_prop_inputs=[];show_progress;functions;constructor(e){this.id=e.id,this.original_trigger_id=e.id,this.inputs=e.inputs,this.outputs=e.outputs,this.connection_type=e.connection,this.show_progress=e.show_progress,this.functions={frontend:e.js?yi(e.js,e.backend_fn,e.inputs.length,e.outputs.length):void 0,backend:e.backend_fn,backend_js:e.js_implementation?new _t(`let result = await (${e.js_implementation})(...arguments);
3						return (!Array.isArray(result)) ? [result] : result;`):void 0},this.targets=e.targets,this.cancels=e.cancels,this.trigger_modes=e.trigger_mode,this.show_progress_on=e.show_progress_on||null,this.component_prop_input
3s=e.component_prop_inputs||[];for(let i=0;i<e.event_specific_args?.length;i++){const a=e.event_specific_args[i];this.event_args[a]=e[a]??null}}async run(e,i,a,t){let n=i;return this.functions.backend_js?{type:"data",data:await this.functions.backend_js(...n)}:(this.functions.frontend&&(n=await this.functions.frontend(i)),this.functions.backend?{type:"submit",data:e.submit(this.id,n,a,t,void 0,{"x-gradio-user":"app"})}:this.functions.frontend?{type:"data",data:n}:{type:"void",data:null})}add_trigger(e,i){this.triggers.push([e,i])}get_triggers(){return{success:this.triggers.filter(([,e])=>e==="success").map(([e])=>e),failure:this.triggers.filter(([,e])=>e==="failure").map(([e])=>e),all:this.triggers.filter(([,e])=>e==="all").map(([e])=>e)}}}class mi{dependencies_by_fn=new Map;dependencies_by_event=new Map;render_id_deps=new Map;submissions=new Map;client;queue=new Set;add_to_api_calls;update_state_cb;get_state_cb;rerender_cb;log_cb;on_connection_lost_cb;loading_stati=new Jt;connection_lost=!1;constructor(e,i,a,t,n,l,c,g){this.add_to_api_calls=c,this.log_cb=l,this.update_state_cb=a,this.get_state_cb=t,this.rerender_cb=n,this.on_connection_lost_cb=g,this.client=i,this.reload(e,a,t,n,i)}reload(e,i,a,t,n){const{by_id:l,by_event:c}=this.create(e);this.dependencies_by_event=c,this.dependencies_by_fn=l,this.client=n,this.update_state_cb=i,this.get_state_cb=a,this.rerender_cb=t;for(const[g,h]of this.dependencies_by_fn)for(const[w]of h.targets)this.set_event_args(w,h.event_args);this.register_loading_stati(l)}register_loading_stati(e){for(const[i,a]of e)this.loading_stati.register(a.id,a.show_progress_on||a.outputs,a.inputs,a.show_progress)}clear_loading_status(e){this.loading_stati.clear(e)}async update_loading_stati_state(){for(const[e,i]of Object.entries(this.loading_stati.current))this.update_state_cb(Number(e),{loading_status:i},!1)}dispatch_state_change_events(e){if(e.changed_state_ids)for(const i of e.changed_state_ids)this.dependencies_by_event.get("change-"+i)?.forEach(t=>{this.dispatch({type:"fn",fn_index:t.id,target_id:i,event_data:null})})}async dispatch(e){if(this.connection_lost)return;let i;if(e.type==="fn"){const a=this.dependencies_by_fn.get(e.fn_index);a&&(i=[a])}else i=this.dependencies_by_event.get(`${e.event_name}-${e.target_id}`);for(let a=0;a<(i?.length||0);a++){const t=i?i[a]:void 0;if(t){this.cancel(t.cancels);const n=wi(t.trigger_modes,this.submissions.has(t.id));if(n==="skip")continue;if(n==="defer"){this.queue.add(t.id);continue}t.functions.backend&&(this.loading_stati.update({status:"pending",fn_index:t.id,stream_state:null}),this.update_loading_stati_state());const l=await this.gather_state(t.inputs,t.component_prop_inputs),c=await Promise.all(t.targets.map(([E])=>this.set_event_args(E,t.event_args))),{success:g,failure:h,all:w}=t.get_triggers();try{let E=null;if(e.target_id!==void 0||e.type==="event"?E=e.target_id||null:E=t.original_trigger_id,t.connection_type==="stream"&&this.submissions.has(t.id)){const C=this.submissions.get(t.id);let P={fn_index:t.id,data:l,event_data:e.event_data};C.send_chunk(P),c.forEach(_=>_());continue}this.add_to_api_calls({fn_index:t.id,data:l,event_data:e.event_data,trigger_id:E});const u=await t.run(this.client,l,e.event_data,E);if(u.type==="void")c.forEach(C=>C());else if(u.type==="data")await this.handle_data(t.outputs,u.data),c.forEach(C=>C());else{let C=null;t.connection_type==="stream"&&!this.submissions.has(t.id)&&(C="waiting"),this.submissions.set(t.id,u.data);let P=0;
3e:for await(const _ of u.data)if(P===0&&t.inputs.forEach(H=>{this.update_state_cb(H,{loading_status:{validation_error:null}},!1)}),P+=1,_!==null){if(_.type==="data"&&await this.handle_data(t.outputs,_.data),_.type==="status"){_.original_msg==="process_starts"&&t.connection_type==="stream"&&(C="open");const{fn_index:H,...m}=_;if(_.stage==="complete"){C="closed",g.forEach(b=>{this.dispatch({type:"fn",fn_index:b,event_data:null,target_id:E})}),this.dispatch_state_change_events(_),this.loading_stati.update({...m,status:m.stage,fn_index:t.id,stream_state:C}),this.update_loading_stati_state();break e}else if(_.stage==="generating")this.dispatch_state_change_events(_),this.loading_stati.update({...m,status:m.stage,fn_index:t.id,stream_state:C}),this.update_loading_stati_state();else if(_.stage==="error"){if(_.broken||_.session_not_found){this.connection_lost||(this.connection_lost=!0,this.on_connection_lost_cb()),this.loading_stati.update({status:"complete",fn_index:t.id,stream_state:null}),this.update_loading_stati_state();break e}if(Array.isArray(_?.message)){_.message.forEach((x,S)=>{this.update_state_cb(t.inputs[S],{loading_status:{validation_error:x.is_valid?null:x.message,show_validation_error:!0}},!1)}),t.outputs.forEach(x=>{t.inputs.includes(x)||this.update_state_cb(x,{loading_status:{status:null}},!1)}),c.forEach(x=>x()),this.submissions.delete(t.id),this.queue.has(t.id)&&(this.queue.delete(t.id),this.dispatch(e));return}const b=_?.message?.replace(vi,(x,S)=>S);throw this.log_cb(_?._title??"Error",b||"",H,"error",m.duration,m.visible),new Error("Dependency function failed")}else this.loading_stati.update({...m,status:m.stage,fn_index:t.id,stream_state:C}),this.update_loading_stati_state()}if(_.type==="render"){this.loading_stati.update({status:"complete",fn_index:t.id,stream_state:null}),this.update_loading_stati_state();const{layout:H,components:m,render_id:b,dependencies:x}=_.data;this.rerender_cb(m,H);const{by_id:S,by_event:V}=this.create(x);this.register_loading_stati(S),S.forEach(L=>this.dependencies_by_fn.set(L.id,L)),V.forEach((L,ae)=>this.dependencies_by_event.set(ae,L));const D=this.render_id_deps.get(b);D&&D.forEach(L=>{S.has(L)||this.dependencies_by_fn.delete(L)}),this.render_id_deps.set(b,new Set(Array.from(S.keys()))),this.register_loading_stati(S);break e}_.type==="log"&&this.handle_log(_)}w.forEach(_=>{this.dispatch({type:"fn",fn_index:_,event_data:null,target_id:E})}),c.forEach(_=>_()),this.submissions.delete(t.id),this.queue.has(t.id)&&(this.queue.delete(t.id),this.dispatch(e))}}catch{this.loading_stati.update({status:"error",fn_index:t.id,eta:0,queue:!1,stream_state:null}),this.update_loading_stati_state(),this.submissions.delete(t.id),h.forEach(u=>{this.dispatch({type:"fn",fn_index:u,event_data:null})})}}}}create(e){const i=new Map,a=new Map,t=[];for(const n of e){const l=new pi(n);for(const[c,g]of n.targets)a.has(`${g}-${c}`)||a.set(`${g}-${c}`,[]),a.get(`${g}-${c}`)?.push(l);if(i.set(n.id,l),n.trigger_after!==void 0){const c=n.trigger_only_on_failure?"failure":n.trigger_only_on_success?"success":"all";t.push([n.id,n.trigger_after,c])}}for(const[n,l,c]of t){const g=i.get(l);g&&(g.add_trigger(n,c),g.original_trigger_id=xi(e,l))}return{by_id:i,by_event:a}}handle_log(e){const{title:i,log:a,fn_index:t,level:n,duration:l,visible:c}=e;this.log_cb(i,a,t,n,l,c)}async handle_data(e,i){await Promise.all(e.map(async(a,t)=>{const n=i[t]===void 0?nt:i[t];if(n!==nt)if(bi(n)){let l=!1,c=null;for(const[g,h]of Object.entries(n))if(g!=="__type__"){if(g==="visible"){l=!0,c=h;continue}await this.update_state_cb(e[t],{[g]:h},!1)}l&&await this.update_state_cb(e[t],{visible:c},!0)}else await this.update_state_cb(a,{value:n},!1)}))}async gather_state(e,i=[]){return(await Promise.all(e.map(a=>this.get_state_cb(a)))).map((a,t)=>i.includes(t)?a??null:a?.value??null)}async set_event_args(e,i){let a={};const t=await this.get_state_cb?.(e);if(!t)return()=>{};for(const[n]of Object.entries(i))a[n]=t?.[n]??null;return Object.keys(i).length===0?()=>{}:(await this.update_state_cb(e,i,!1),()=>{this.update_state_cb(e,a,!1)})}async cancel(e){if(e)for(const i of e){const a=this.submissions.get(i);if(a){await a.cancel(),this.loading_stati.update({status:"complete",fn_index:i,eta:0,queue:!1,stream_state:null}),this.update_loading_stati_state(),this.submissions.delete(i);const{failure:t,all:n}=this.dependencies_by_fn.get(i)?.get_triggers()||{failure:[],all:[]};t.forEach(l=>{this.dispatch({type:"fn",fn_index:l,event_data:null,target_id:i})}
3),n.forEach(l=>{this.dispatch({type:"fn",fn_index:l,event_data:null,target_id:i})})}}}dispatch_load_events(){this.dependencies_by_fn.forEach(e=>{e.targets.forEach(([i,a])=>{a==="load"&&this.dispatch({type:"fn",fn_index:e.id,event_data:null,target_id:i})})})}get_fns_from_targets(e){const i=[];return this.dependencies_by_event.forEach((a,t)=>{const[,n]=t.split("-");Number(n)===e&&a.forEach(l=>{i.push(l.id)})}),i}close_stream(e){const i=this.get_fns_from_targets(e);for(const a of i){const t=this.submissions.get(a);t&&(t.close_stream(),this.submissions.delete(a)),this.loading_stati.update({status:"complete",fn_index:a,eta:0,queue:!1,stream_state:"closed"})}this.update_loading_stati_state()}}function bi(o){return typeof o=="object"&&o!==null&&"__type__"in o&&o?.__type__==="update"}function wi(o,e){return e?o==="always_last"?"defer":o==="multiple"?"run":o==="once"?"skip":"run":"run"}function yi(o,e,i,a){const t=e?i===1:a===1;try{return new _t("__fn_args",`  let result = await (${o})(...__fn_args);
4  if (typeof result === "undefined") return [];
5  return (${t} && !Array.isArray(result)) ? [result] : result;`)}catch(n){throw n}}function xi(o,e){let i=new Map,a=e,t=0;for(;t<100;){const n=i.get(a)||o.find(l=>l.id===a);if(!n||(i.set(n.id,n),n.trigger_after===null||n.trigger_after===void 0))break;a=n.trigger_after,t+=1}return a}var ki=W("<!> <!>",1),Ei=W('<button class="show-api svelte-zxu34v"><!> <img class="svelte-zxu34v"/></button>'),Ci=W('<div class="divider show-api-divider svelte-zxu34v">·</div> <a href="https://gradio.app" class="built-with svelte-zxu34v" target="_blank" rel="noreferrer"> <img class="svelte-zxu34v"/></a>',1),Si=W('<div>·</div> <button class="settings svelte-zxu34v"> <img class="svelte-zxu34v"/></button>',1),Li=W('<footer aria-label="Gradio footer navigation" class="svelte-zxu34v"><!> <!> <button> <img class="svelte-zxu34v"/></button> <div class="divider svelte-zxu34v">·</div> <!></footer>'),zi=W('<div id="api-recorder-container" class="svelte-zxu34v"><!></div>'),Oi=W('<div class="api-docs svelte-zxu34v" role="dialog" aria-modal="true"><div class="backdrop svelte-zxu34v"></div> <div class="api-docs-wrap svelte-zxu34v" role="document"><!></div></div>'),Ri=W('<div class="api-docs svelte-zxu34v" role="dialog" aria-modal="true"><div class="backdrop svelte-zxu34v"></div> <div class="api-docs-wrap svelte-zxu34v" role="document"><!></div></div>'),Mi=W('<div class="wrap svelte-zxu34v"><main class="contain svelte-zxu34v"><!></main> <!> <!> <!> <!> <!></div> <!>',1);function Ai(o,e){Fe(e,!0);const i=()=>it(ai,"$reactive_formatter",t),a=()=>it(Re,"$is_screen_recording",t),[t,n]=Bt();Ce(e,"render_complete",3,!1);let l=Ce(e,"ready",15,!1),c=Ce(e,"reload_count",11,0),g=Ce(e,"add_new_message",15);e.components.forEach(s=>{s.props.i18n||(s.props.i18n=i())});let h=be(Xe([])),w=null;function E(s,r,f){if(r==="share"){const{title:p,description:O}=f}else if(r==="error")K("Error",f,-1,r,10,!0);else if(r==="warning")K("Warning",f,-1,r,10,!0);else if(r==="info")K("Info",f,-1,r,10,!0);else if(r==="gradio_expand"||r==="gradio_tab_select"){const p=r==="gradio_expand"?s:f.component_id;u.render_previously_invisible_children(p)}else if(r=="clear_status")u.update_state(s,{loading_status:{}},!1),b.clear_loading_status(s);else if(r=="close_stream")b.close_stream(s);else if(r==="custom_button_click"){const p=f.id;C(p,"click",null)}else r==="select"&&s in u.initial_tabs&&(s=f.id),b.dispatch({type:"event",event_name:r,target_id:s,event_data:f})}let u=new Yt(e.components,e.layout,e.dependencies,{root:e.root,theme:e.theme_mode,version:e.version,api_prefix:e.api_prefix,max_file_size:e.max_file_size,autoscroll:e.autoscroll,fill_height:e.fill_height},e.app,i(),E);function C(s,r,f){b.dispatch({type:"event",event_name:r,target_id:s,event_data:f})}let P=be(Xe([])),_=be(null),H=s=>{F(_,s,!0),d(D)&&F(P,[...d(P),d(_)],!0)};function m(){F(h,d(h).filter(s=>s.type!=="error"),!0),++le,d(h).push({title:"Connection Lost",message:Oe,fn_index:-1,type:"error",id:le,duration:null,visible:!0}),w=setInterval(async()=>{try{const s=await e.app.reconnect();(s==="connected"||s==="changed")&&(clearInterval(w),w=null,window.location.reload())}catch(s){console.debug(s)}},2e3)}let b=new mi(e.dependencies,e.app,u.update_state.bind(u),u.get_state.bind(u),u.rerender.bind(u),K,H,m);lt(()=>
5{c(),jt(()=>{u.reload(e.components,e.layout,e.dependencies,{root:e.root,theme:e.theme_mode,version:e.version,api_prefix:e.api_prefix,max_file_size:e.max_file_size,autoscroll:e.autoscroll,fill_height:e.fill_height}),b.reload(e.dependencies,u.update_state.bind(u),u.get_state.bind(u),u.rerender.bind(u),e.app)})});let x=350,S=Me(()=>e.search_params.get("view")==="api"&&e.footer_links.includes("api")),V=Me(()=>e.search_params.get("view")==="settings"),D=Me(()=>e.search_params.get("view")==="api-recorder"&&e.footer_links.includes("api")),L=!0,ae=!0,G=null,B=null,J=null,ee=be(null);async function fe(){if(!G||!B){const s=await pe(()=>import("./ApiDocs-D66OUv1H.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]),import.meta.url),r=await pe(()=>import("./ApiRecorder-y0lpz3M9.js"),__vite__mapDeps([30,1,2,3,4,7,8,9,5,10,11,12,13,14,31]),import.meta.url);G||(G=s?.default),B||(B=r?.default)}}async function se(){B||(B=(await pe(()=>import("./ApiRecorder-y0lpz3M9.js"),__vite__mapDeps([30,1,2,3,4,7,8,9,5,10,11,12,13,14,31]),import.meta.url)).default)}async function ne(){J||(J=(await pe(()=>import("./Settings-Bwz4Nb_m.js"),__vite__mapDeps([32,1,2,3,4,6,11,8,12,33,22,16,17,18,19,34,35,36,37,38,39,40,26,41,42,23,24,15,20,25,27,28,43,44]),import.meta.url)).default)}async function re(){if(!d(ee)){const s=await pe(()=>import("./Index-C-RstoJU.js"),__vite__mapDeps([45,1,2,3,4,22,16,17,11,8,12,18,19,46,47,48,49,25,26,50,51,38,52,53,54,55,56,57,58]),import.meta.url);F(ee,s.default,!0)}}async function Q(s){F(D,!1),s&&await fe(),F(S,s);let r=new URLSearchParams(window.location.search);s?r.set("view","api"):r.delete("view"),history.replaceState(null,"","?"+r.toString())}async function oe(s){s&&await ne();let r=new URLSearchParams(window.location.search);s?r.set("view","settings"):r.delete("view"),history.replaceState(null,"","?"+r.toString()),F(V,!d(V))}function K(s,r,f,p,O=10,M=!1){M&&d(h).push({title:s,message:r,fn_index:f,type:p,id:++le,duration:O,visible:M})}g(K);let le=-1;i()("blocks.long_requests_queue"),i()("blocks.connection_can_break");const Oe="Connection to the server was lost. Attempting reconnection...";i()("blocks.waiting_for_inputs");let Re=Nt(!1),qe=0,ge;function Ue(){if("parentIFrame"in window){const s=ge.children[0].getBoundingClientRect();if(!s)return;window.parentIFrame?.size(s.bottom+qe+32)}}function Ve(){a()?ui():_i()}Ft(()=>{"parentIFrame"in window&&window.parentIFrame?.autoResize(!1);const s=new MutationObserver(Ue),r=new ResizeObserver(Ue);return s.observe(ge,{childList:!0,subtree:!0,attributes:!0}),r.observe(ge),u.ready.then(()=>{l(!0),b.dispatch_load_events()}),e.vibe_mode&&re(),()=>{s.disconnect(),r.disconnect(),w&&clearInterval(w)}});function ut(s){F(h,d(h).filter(r=>r.id!==s),!0)}var Ge=Mi();$t("zxu34v",s=>{var r=ki(),f=A(r);{var p=z=>{Pt(()=>{It.title=e.title??""})};k(f,z=>{e.control_page_title&&z(p)})}var O=y(f,2);{var M=z=>{var U=Z(),Ee=A(U);Wt(Ee,()=>`<style>${Zt(e.css,e.version)}</style>
5`),v(z,U)};k(O,z=>{e.css&&z(M)})}v(s,r)});var ke=A(Ge);let Be;var he=I(ke);let Ne;var ft=I(he);Te(ft,{get node(){return u.root}}),q(he),dt(he,s=>ge=s,()=>ge);var Ze=y(he,2);{var gt=s=>{var r=Li(),f=I(r);{var p=R=>{var T=Ei(),te=I(T);{var de=j=>{var _e=Ye();Y(ve=>me(_e,ve),[()=>i()("errors.use_via_api_or_mcp")]),v(j,_e)},X=j=>{var _e=Ye();Y(ve=>me(_e,ve),[()=>i()("errors.use_via_api")]),v(j,_e)};k(te,j=>{e.app.config?.mcp_server?j(de):j(X,!1)})}var ce=y(te,2);q(T),Y(j=>{N(ce,"src",ni),N(ce,"alt",j)},[()=>i()("common.logo")]),ie("click",T,()=>{Q(!d(S))}),ie("mouseenter",T,()=>{fe(),se()}),v(R,T)};k(f,R=>{e.footer_links.includes("api")&&R(p)})}var O=y(f,2);{var M=R=>{var T=Ci(),te=y(A(T),2),de=I(te),X=y(de);q(te),Y((ce,j)=>{me(de,`${ce??""} `),N(X,"src",si),N(X,"alt",j)},[()=>i()("common.built_with_gradio"),()=>i()("common.logo")]),v(R,T)};k(O,R=>{e.footer_links.includes("gradio")&&R(M)})}var z=y(O,2);let U;var Ee=I(z),Qe=y(Ee);q(z);var xt=y(z,4);{var kt=R=>{var T=Si(),te=A(T);let de;var X=y(te,2),ce=I(X),j=y(ce);q(X),Y((_e,ve)=>{de=at(te,1,"divider svelte-zxu34v",null,de,{hidden:!a()}),me(ce,`${_e??""} `),N(j,"src",ri),N(j,"alt",ve)},[()=>i()("common.settings"),()=>i()("common.settings")]),ie("click",X,()=>{oe(!d(V))}),ie("mouseenter",X,()=>{ne()}),v(R,T)};k(xt,R=>{e.footer_links.includes("settings")&&R(kt)})}q(r),Y((R,T)=>{U=at(z,1,"record svelte-zxu34v",null,U,{hidden:!a()}),me(Ee,`${R??""} `),N(Qe,"src",oi),N(Qe,"alt",T)},[()=>i()("common.stop_recording"),()=>i()("common.stop_recording")]),ie("click",z,()=>{Ve()}),Ht(r,"clientHeight",R=>qe=R),v(s,r)};k(Ze,s=>{e.footer_links.length>0&&s(gt)})}var We=y(Ze,2);{var ht=s=>{var r=zi(),f=I(r);we(f,()=>B,(p,O)=>{O(p,{get api_calls(){return d(P)},get dependencies(){return e.dependencies}})}),q(r),ie("click",r,()=>{Q(!0),F(D,!1)}),v(s,r)};k(We,s=>{d(D)&&B&&s(ht)})}
5var He=y(We,2);{var vt=s=>{var r=Oi(),f=I(r),p=y(f,2),O=I(p);we(O,()=>G,(M,z)=>{z(M,{get root_node(){return u.root},get dependencies(){return e.dependencies},get root(){return e.root},get app(){return e.app},get space_id(){return e.space_id},get api_calls(){return d(P)},get username(){return e.username},get last_api_call(){return d(_)},$$events:{close:U=>{Q(!1),F(P,[],!0),F(D,F(D,U.detail?.api_recorder_visible))}}})}),q(p),q(r),Y(M=>N(r,"aria-label",M),[()=>i()("errors.use_via_api")]),ie("click",f,()=>{Q(!1)}),v(s,r)};k(He,s=>{d(S)&&u.root&&G&&s(vt)})}var Je=y(He,2);{var pt=s=>{var r=Ri(),f=I(r),p=y(f,2),O=I(p);we(O,()=>J,(M,z)=>{z(M,{onclose:()=>{oe(!1)},start_recording:()=>{Ve()},get pwa_enabled(){return e.app.config.pwa},get root(){return e.root},get space_id(){return e.space_id},get i18n(){return i()},get allow_zoom(){return L},set allow_zoom(U){L=U},get allow_video_trim(){return ae},set allow_video_trim(U){ae=U}})}),q(p),q(r),Y(M=>N(r,"aria-label",M),[()=>i()("common.settings")]),ie("click",f,()=>{oe(!1)}),v(s,r)};k(Je,s=>{d(V)&&e.app.config&&u.root&&J&&s(pt)})}var mt=y(Je,2);{var bt=s=>{var r=Z(),f=A(r);we(f,()=>d(ee),(p,O)=>{O(p,{get app(){return e.app},get root(){return e.root}})}),v(s,r)};k(mt,s=>{e.vibe_mode&&d(ee)&&s(bt)})}q(ke);var wt=y(ke,2);{var yt=s=>{Qt(s,{get messages(){return d(h)},on_close:ut})};k(wt,s=>{d(h)&&s(yt)})}Y(()=>{Be=tt(ke,"",Be,{"min-height":e.app_mode?"100%":"auto"}),Ne=tt(he,"",Ne,{"flex-grow":e.app_mode?"1":"auto","margin-right":e.vibe_mode?`${x}px`:"0"})}),v(o,Ge),Pe(),n()}const Gi=Object.freeze(Object.defineProperty({__proto__:null,default:Ai},Symbol.toStringTag,{value:"Module"}));export{Gi as B,ni as a,si as g,ri as s};

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.