PageSourceSearch

https://zenx566-qwen-edit-image.hf.space/assets/Blocks-CGGdLdT-.js

js zenx566-qwen-edit-image.hf.space collected 2026-10-03 17:33:01 UTC 32,397 bytes, 5 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ApiDocs-BxFCNq4v.js","./i18n-DhLovEFo.js","./index-9Ev7iYt6.js","./index-CJjI6XC6.css","./i18n-BGEK-qBj.css","./clear-DzKqjVu1.js","./Button-U40IzBe8.js","./snippet-xbRfGdXG.js","./Image-CVAEcPj3.js","./Image-Da_XA0w6.css","./ImagePreview-DJ7FK62O.js","./ScrollFade.svelte_svelte_type_style_lang-ogAEaD61.js","./ScrollFade-DV-0xzhB.css","./BlockLabel-CqQRDPfZ.js","./DownloadLink-hEoT-mAd.js","./Empty-B_oS1nZx.js","./ShareButton-qU8V1sqI.js","./Download-BvDI8Efl.js","./Image-BtruDAal.js","./IconButtonWrapper-DATTLsrh.js","./FullscreenButton-CgU9eLeA.js","./Maximize-DX4p_OSq.js","./ImagePreview-CCVfwC4m.css","./Button-BZ4d-rtD.css","./index-BKfLiH8b.js","./StreamingBar.svelte_svelte_type_style_lang-D07DuzRz.js","./html-CfSn455r.js","./index-B_pwUImq.js","./StreamingBar-CMuqaV2j.css","./Clear-D8pztZ4O.js","./Block-MCGnkHAA.js","./input-BhZahYna.js","./size-COeWeQdF.js","./state.svelte-x6BRflgj.js","./index-BlQXYsaG.js","./index-tFQomdd2.js","./ApiDocs-y7Md9q8F.css","./ApiRecorder-q6iyVcNe.js","./ApiRecorder-CoSLrx_1.css","./Settings-B_MwYVmo.js","./Dropdown-DpToUdib.js","./window-CWHy3o9R.js","./BlockTitle-C13HXRtc.js","./Info-CgD-fkwu.js","./DropdownArrow-BMS-fktN.js","./Dropdown--Uz_kS2s.css","./Checkbox-gSai2vcm.js","./universal-B2tAZ-5T.js","./Checkbox-BbySKLMz.css","./Settings-CLQaonub.css","./Example-BeU1J4ps.css","./Index-Ndq1pfS0.js","./Code-BPhHpuUj.js","./Code-wZDUWKrz.css","./Index.svelte_svelte_type_style_lang-CrnWSkSn.js","./actions-DWbx7e_v.js","./Check-Co0nFbKx.js","./Copy-BpOY43se.js","./MarkdownCode-Z0ZAv0RM.js","./prism-python-GAh9CqE4.js","./MarkdownCode-sGRY2bbQ.css","./Index-cY7HT1Ac.css","./Index-DP8ihX8q.css","./Example-BK-tWmkG.css","./Example-CgIc4GLa.css"])))=>i.map(i=>d[i]);
2import{aK as Lt,B as St,aL as zt,h as Se,an as ze,s as Oe,i as dt,X as l,e as Ot,aG as Mt,ak as Rt,p as At,aM as Dt,C as Tt,j as Ke,g as Ft,M as qe,aN as ct,aO as Fe,a8 as be,aa as _t,aP as jt,a as v,O as Ie,R as H,$ as j,a1 as Z,N as A,a9 as $e,v as Pt,a5 as qt,S as y,t as K,Y as De,ad as pe,Q as q,U as me,W as ie,aQ as It,T as I,aR as Ut,a2 as et}from"./index-9Ev7iYt6.js";import{e as ut,q as tt,w as it,i as k,g as Gt,r as Bt,X as ft,p as Le,Y as at,f as st,u as nt,t as Nt,b as rt,a as V,D as Vt,F as Zt}from"./i18n-DhLovEFo.js";import{h as Ht}from"./html-CfSn455r.js";import{c as we}from"./ScrollFade.svelte_svelte_type_style_lang-ogAEaD61.js";import{b as Qt}from"./size-COeWeQdF.js";import"./StreamingBar.svelte_svelte_type_style_lang-D07DuzRz.js";import{L as Wt,T as Xt}from"./state.svelte-x6BRflgj.js";import{AppTree as Yt}from"./index-BlQXYsaG.js";function $(d,e=[],i=[],a){var t=Lt(),n=St,o=t.is_rendered();t.update_pending_count(1),n.increment(o);var c=Se;if(c){Ot();var g=dt,h=Mt(!1);Oe(h)}zt(e,[],i,w=>{c&&(ze(!0),Oe(g));try{for(const E of w)l(E);a(d,...w)}finally{c&&ze(!1),t.update_pending_count(-1),n.decrement(o)}})}function Jt(d,e){let i=null,a=Se;var t;if(Se){i=dt;for(var n=Ft(document.head);n!==null&&(n.nodeType!==Tt||n.data!==d);)n=Ke(n);if(n===null)ze(!1);else{var o=Ke(n);n.remove(),Oe(o)}}Se||(t=document.head.appendChild(Rt()));try{At(()=>e(t),Dt)}finally{a&&(ze(!0),Oe(i))}}var Kt=H("<span></span>");function $t(d,e){qe(e,!0);var i,a,t,n=ct([async()=>i=await Fe(()=>e.node.component),async()=>a=await Fe(()=>e.node.runtime),()=>t=be(null),()=>{_t(()=>{if(!l(t)||!l(a)||!l(i))return;const c=e.node.props.shared_props,g=e.node.props.props,h=l(a),w=h.mount(l(i).default,{target:l(t),props:{shared_props:c,props:g,children:e.children}});return()=>{h.unmount(w)}})}]),o=Kt();jt([n[2]],()=>{ut(o,c=>j(t,c),()=>l(t))}),v(d,o),Ie()}function je(d,e){qe(e,!0);let i=Bt(e,["$$slots","$$events","$$legacy","node"]);var a,t=ct([async()=>a=await Fe(()=>e.node.component)]),n=Z(),o=A(n);$(o,[t[0]],[()=>e.node&&l(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,L=>{we(x,()=>l(a).default,(G,D)=>{D(G,{get shared_props(){return e.node.props.shared_props},get props(){return e.node.props.props},children:(S,ae)=>{var B=Z(),N=A(B);$(N,[t[0]],[()=>e.node.children&&e.node.children.length],(W,ee)=>{var fe=se=>{var ne=Z(),re=A(ne);$(re,[t[0]],[()=>e.node.children],(X,oe)=>{tt(X,17,()=>l(oe),it,(Y,le)=>{je(Y,{get node(){return l(le)}})})}),v(se,ne)};k(W,se=>{l(ee)&&se(fe)})}),v(S,B)},$$slots:{default:!0}})})}),v(m,b)},Q=m=>{var b=Z(),x=A(b);$(x,[t[0]],[()=>e.node.props.shared_props.visible&&e.node.runtime],(L,G)=>{var D=S=>{$(S,[t[0]],void 0,ae=>{$t(ae,Gt(()=>
2i,{get node(){return e.node},children:(B,N)=>{var W=Z(),ee=A(W);$(ee,[t[0]],[()=>e.node.children&&e.node.children.length],(fe,se)=>{var ne=re=>{var X=Z(),oe=A(X);$(oe,[t[0]],[()=>e.node.children],(Y,le)=>{tt(Y,17,()=>l(le),it,(Me,Re)=>{je(Me,{get node(){return l(Re)}})})}),v(re,X)};k(fe,re=>{l(se)&&re(ne)})}),v(B,W)},$$slots:{default:!0}}))})};k(L,S=>{l(G)&&S(D)},!0)}),v(m,b)};k(C,m=>{l(P)?m(_):m(Q,!1)})}),v(w,E)};k(c,w=>{l(g)&&w(h)})}),v(d,n),Ie()}const ei="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",ti="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",ii="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",ai="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,Ue=[],si=0,ye={},ni,Pe,ri=null,Te=[];async function oi(){if(!xe)try{const d=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=d;const i={videoBitsPerSecond:5e6};ue=new MediaRecorder(e,i),Ue=[],ye={},ue.ondataavailable=di,ue.onstop=ci,ue.start(1e3),xe=!0,si=Date.now()}catch(d){Pe("Recording Error","Failed to start recording: "+d.message,"error")}}function li(){!xe||!ue||(ue.stop(),xe=!1)}function di(d){d.data.size>0&&Ue.push(d.data)}function ci(){xe=!1;const d=new Blob(Ue,{type:"video/mp4"});_i(d),(ue?.stream?.getTracks()||[]).forEach(i=>i.stop())}async function _i(d){try{Pe("Processing video","This may take a few seconds...","info");const e=new FormData;e.append("video",d,"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())),Te.length>0&&e.append("zoom_effects",JSON.stringify(Te));const i=await fetch(ni+"/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`;ot(a,t),Te=[]}catch{Pe("Processing Error","Failed to process recording. Saving original version.","warning");const i=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;ot(d,i)}}function ot(d,e){const i=URL.createObjectURL(d),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 ui=/^'([^]+)'$/,lt=Symbol("NOVALUE");class fi{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?pi(e.js,e.backend_fn,e.inputs.length,e.outputs.length):void 0,backend:e.backend_fn,backend_js:e.js_implementation?new ft(`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 gi{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 Wt;connection_lost=!1;constructor(e,i,a,t,n,o,c,g){this.add_to_api_calls=c,this.log_cb=o,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:o,by_event:c}=this.create(e);this.dependencies_by_event=c,this.dependencies_by_fn=o,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(o)}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=vi(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 o=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:o,event_data:e.event_data};C.send_chunk(P),c.forEach(_=>_());continue}this.add_to_api_calls({fn_index:t.id,data:o,event_data:e.event_data,trigger_id:E});const u=await t.run(this.client,o,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(Q=>{this.update_state_cb(Q,{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:Q,...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"||_.stage==="streaming")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,L)=>{this.update_state_cb(t.inputs[L],{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(ui,(x,L)=>L);throw this.log_cb(_?._title??"Error",b||"",Q,"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:Q,components:m,render_id:b,dependencies:x}=_.data;this.rerender_cb(m,Q);const{by_id:L,by_event:G}=this.create(x);
3this.register_loading_stati(L),L.forEach(S=>this.dependencies_by_fn.set(S.id,S)),G.forEach((S,ae)=>this.dependencies_by_event.set(ae,S));const D=this.render_id_deps.get(b);D&&D.forEach(S=>{L.has(S)||this.dependencies_by_fn.delete(S)}),this.render_id_deps.set(b,new Set(Array.from(L.keys()))),this.register_loading_stati(L);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 o=new fi(n);for(const[c,g]of n.targets)a.has(`${g}-${c}`)||a.set(`${g}-${c}`,[]),a.get(`${g}-${c}`)?.push(o);if(i.set(n.id,o),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,o,c]of t){const g=i.get(o);g&&(g.add_trigger(n,c),g.original_trigger_id=mi(e,o))}return{by_id:i,by_event:a}}handle_log(e){const{title:i,log:a,fn_index:t,level:n,duration:o,visible:c}=e;this.log_cb(i,a,t,n,o,c)}async handle_data(e,i){await Promise.all(e.map(async(a,t)=>{const n=i[t]===void 0?lt:i[t];if(n!==lt)if(hi(n)){let o=!1,c=null;for(const[g,h]of Object.entries(n))if(g!=="__type__"){if(g==="visible"){o=!0,c=h;continue}await this.update_state_cb(e[t],{[g]:h},!1)}o&&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(o=>{this.dispatch({type:"fn",fn_index:o,event_data:null,target_id:i})}),n.forEach(o=>{this.dispatch({type:"fn",fn_index:o,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(o=>{i.push(o.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 hi(d){return typeof d=="object"&&d!==null&&"__type__"in d&&d?.__type__==="update"}function vi(d,e){return e?d==="always_last"?"defer":d==="multiple"?"run":d==="once"?"skip":"run":"run"}function pi(d,e,i,a){const t=e?i===1:a===1;try{return new ft("__fn_args",`  let result = await (${d})(...__fn_args);
4  if (typeof result === "undefined") return [];
5  return (${t} && !Array.isArray(result)) ? [result] : result;`)}catch(n){throw n}}function mi(d,e){let i=new Map,a=e,t=0;for(;t<100;){const n=i.get(a)||d.find(o=>o.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 bi=H("<!> <!>",1),wi=H('<button class="show-api svelte-zxu34v"><!> <img class="svelte-zxu34v"/></button>'),yi=H('<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),xi=H('<div>·</div> <button class="settings svelte-zxu34v"> <img class="svelte-zxu34v"/></button>',1),ki=H('<footer aria-label="Gradio footer navigation" class="svelte-zxu34v"><!> <!> <button> <img class="svelte-zxu34v"/></button> <div class="divider svelte-zxu34v">·</div> <!></footer>'),Ei=H('<div id="api-recorder-container" class="svelte-zxu34v"><!></div>'),Ci=H('<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>'),Li=H('<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>'),Si=H('<div class="wrap svelte-zxu34v"><main class="contain svelte-zxu34v"><!></main> <!> <!> <!> <!> <!></div> <!>',1);function zi(d,e){qe(e,!0);const i=()=>nt(at,"$reactive_formatter",t),a=()=>nt(Re,"$is_screen_recording",t),[t,n]=Nt();Le(e,"render_complete",11,!1);let o=Le(e,"ready",15,!1),c=Le(e,"reload_count",11,0),g=Le(e,"add_new_message",15);
5e.components.forEach(s=>{s.props.i18n||(s.props.i18n=i()),s.props.i18n_store=at});let h=be($e([])),w=null;function E(s,r,f){if(r==="share"){const{title:p,description:O}=f}else if(r==="error")Y("Error",f,-1,r,10,!0);else if(r==="warning")Y("Warning",f,-1,r,10,!0);else if(r==="info")Y("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 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($e([])),_=be(null),Q=s=>{j(_,s,!0),l(D)&&j(P,[...l(P),l(_)],!0)};function m(){j(h,l(h).filter(s=>s.type!=="error"),!0),++le,l(h).push({title:"Connection Lost",message:Me,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 gi(e.dependencies,e.app,u.update_state.bind(u),u.get_state.bind(u),u.rerender.bind(u),Y,Q,m);_t(()=>{c(),Pt(()=>{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,L=De(()=>e.search_params.get("view")==="api"&&e.footer_links.includes("api")),G=De(()=>e.search_params.get("view")==="settings"),D=De(()=>e.search_params.get("view")==="api-recorder"&&e.footer_links.includes("api")),S=!0,ae=!0,B=null,N=null,W=null,ee=be(null);async function fe(){if(!B||!N){const s=await pe(()=>import("./ApiDocs-BxFCNq4v.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,30,31,32,33,34,35,36]),import.meta.url),r=await pe(()=>import("./ApiRecorder-q6iyVcNe.js"),__vite__mapDeps([37,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,38]),import.meta.url);B||(B=s?.default),N||(N=r?.default)}}async function se(){N||(N=(await pe(()=>import("./ApiRecorder-q6iyVcNe.js"),__vite__mapDeps([37,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,38]),import.meta.url)).default)}async function ne(){W||(W=(await pe(()=>import("./Settings-B_MwYVmo.js"),__vite__mapDeps([39,1,2,3,4,5,11,7,12,40,31,25,26,27,28,41,42,43,44,19,45,46,47,48,32,33,24,29,34,35,49,50]),import.meta.url)).default)}async function re(){if(!l(ee)){const s=await pe(()=>import("./Index-Ndq1pfS0.js"),__vite__mapDeps([51,1,2,3,4,31,25,26,11,7,12,27,28,52,53,54,55,56,57,19,58,59,60,61,62,63,64]),import.meta.url);j(ee,s.default,!0)}}async function X(s){j(D,!1),s&&await fe(),j(L,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()),j(G,!l(G))}function Y(s,r,f,p,O=10,R=!1){R&&l(h).push({title:s,message:r,fn_index:f,type:p,id:++le,duration:O,visible:R})}g(Y);let le=-1;i()("blocks.long_requests_queue"),i()("blocks.connection_can_break");const Me="Connection to the server was lost. Attempting reconnection...";i()("blocks.waiting_for_inputs");let Re=Vt(!1),Ge=0,ge,Ae=0,ke=0;function Be(){if(!("parentIFrame"in window))return;const s=ge.children[0].getBoundingClientRect();if(!s)return;const r=s.bottom+Ge+32,f=window.innerHeight;if(Math.abs(r-Ae)<2){ke=0;return}if(r>Ae){if(r>f&&s.bottom<=f+2||(ke+=1,ke>4))return}else ke=0;Ae=r,window.parentIFrame?.size(r)}function Ne(){a()?li():oi()}qt(()=>{"parentIFrame"in window&&window.parentIFrame?.autoResize(!1);const s=new MutationObserver(Be),r=new ResizeObserver(Be);return s.observe(ge,{childList:!0,subtree:!0,attributes:!0}),r.observe(ge),u.ready.then(()=>{o(!0),b.dispatch_load_events()}),e.vibe_mode&&re(),()=>{s.disconnect(),r.disconnect(),w&&clearInterval(w)}});function gt(s){j(h,l(h).filter(r=>r.id!==s),!0)}var Ve=Si();Jt("zxu34v",s=>{var r=bi(),f=A(r);{var p=z=>{It(()=>{Ut.title=e.title??""})};k(f,z=>{e.control_page_title&&z(p)})}var O=y(f,2);{var R=z=>{var U=Z(),Ce=A(U);Ht(Ce,()=>`<style>${Zt(e.css,e.version)}</style>
5`),v(z,U)};k(O,z=>{e.css&&z(R)})}v(s,r)});var Ee=A(Ve);let Ze;var he=q(Ee);let He;var ht=q(he);je(ht,{get node(){return u.root}}),I(he),ut(he,s=>ge=s,()=>ge);var Qe=y(he,2);{var vt=s=>{var r=ki(),f=q(r);{var p=M=>{var T=wi(),te=q(T);{var de=F=>{var _e=et();K(ve=>me(_e,ve),[()=>i()("errors.use_via_api_or_mcp")]),v(F,_e)},J=F=>{var _e=et();K(ve=>me(_e,ve),[()=>i()("errors.use_via_api")]),v(F,_e)};k(te,F=>{e.app.config?.mcp_server?F(de):F(J,!1)})}var ce=y(te,2);I(T),K(F=>{V(ce,"src",ti),V(ce,"alt",F)},[()=>i()("common.logo")]),ie("click",T,()=>{X(!l(L))}),ie("mouseenter",T,()=>{fe(),se()}),v(M,T)};k(f,M=>{e.footer_links.includes("api")&&M(p)})}var O=y(f,2);{var R=M=>{var T=yi(),te=y(A(T),2),de=q(te),J=y(de);I(te),K((ce,F)=>{me(de,`${ce??""} `),V(J,"src",ei),V(J,"alt",F)},[()=>i()("common.built_with_gradio"),()=>i()("common.logo")]),v(M,T)};k(O,M=>{e.footer_links.includes("gradio")&&M(R)})}var z=y(O,2);let U;var Ce=q(z),Je=y(Ce);I(z);var Et=y(z,4);{var Ct=M=>{var T=xi(),te=A(T);let de;var J=y(te,2),ce=q(J),F=y(ce);I(J),K((_e,ve)=>{de=rt(te,1,"divider svelte-zxu34v",null,de,{hidden:!a()}),me(ce,`${_e??""} `),V(F,"src",ii),V(F,"alt",ve)},[()=>i()("common.settings"),()=>i()("common.settings")]),ie("click",J,()=>{oe(!l(G))}),ie("mouseenter",J,()=>{ne()}),v(M,T)};k(Et,M=>{e.footer_links.includes("settings")&&M(Ct)})}I(r),K((M,T)=>{U=rt(z,1,"record svelte-zxu34v",null,U,{hidden:!a()}),me(Ce,`${M??""} `),V(Je,"src",ai),V(Je,"alt",T)},[()=>i()("common.stop_recording"),()=>i()("common.stop_recording")]),ie("click",z,()=>{Ne()}),Qt(r,"clientHeight",M=>Ge=M),v(s,r)};k(Qe,s=>{e.footer_links.length>0&&s(vt)})}var We=y(Qe,2);{var pt=s=>{var r=Ei(),f=q(r);we(f,()=>N,(p,O)=>{O(p,{get api_calls(){return l(P)},get dependencies(){return e.dependencies}})}),I(r),ie("click",r,()=>{X(!0),j(D,!1)}),v(s,r)};k(We,s=>{l(D)&&N&&s(pt)})}var Xe=y(We,2);{var mt=s=>{var r=Ci(),f=q(r),p=y(f,2),O=q(p);we(O,()=>B,(R,z)=>{z(R,{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 l(P)},get username(){return e.username},get last_api_call(){return l(_)},$$events:{close:U=>{X(!1),j(P,[],!0),j(D,j(D,U.detail?.api_recorder_visible))}}})}),I(p),I(r),K(R=>V(r,"aria-label",R),[()=>i()("errors.use_via_api")]),ie("click",f,()=>{X(!1)}),v(s,r)};k(Xe,s=>{l(L)&&u.root&&B&&s(mt)})}var Ye=y(Xe,2);{var bt=s=>{var r=Li(),f=q(r),p=y(f,2),O=q(p);we(O,()=>W,(R,z)=>{z(R,{onclose:()=>{oe(!1)},start_recording:()=>{Ne()},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 S},set allow_zoom(U){S=U},get allow_video_trim(){return ae},set allow_video_trim(U){ae=U}})}),I(p),I(r),K(R=>V(r,"aria-label",R),[()=>i()("common.settings")]),ie("click",f,()=>{oe(!1)}),v(s,r)};k(Ye,s=>{l(G)&&e.app.config&&u.root&&W&&s(bt)})}var wt=y(Ye,2);{var yt=s=>{var r=Z(),f=A(r);we(f,()=>l(ee),(p,O)=>{O(p,{get app(){return e.app},get root(){return e.root}})}),v(s,r)};k(wt,s=>{e.vibe_mode&&l(ee)&&s(yt)})}I(Ee);var xt=y(Ee,2);{var kt=s=>{Xt(s,{get messages(){return l(h)},on_close:gt})};k(xt,s=>{l(h)&&s(kt)})}K(()=>{Ze=st(Ee,"",Ze,{"min-height":e.app_mode?"100%":"auto"}),He=st(he,"",He,{"flex-grow":e.app_mode?"1":"auto","margin-right":e.vibe_mode?`${x}px`:"0"})}),v(d,Ve),Ie(),n()}const Pi=Object.freeze(Object.defineProperty({__proto__:null,default:zi},Symbol.toStringTag,{value:"Module"}));export{Pi as B,ti as a,ei as g,ii 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.