1const __vite__fileDeps=["./Blocks-CvpDAyLR.js","./index-Ccc2t4AG.js","./index-Dz5CWoA7.css","./Button-Dy8yxofg.js","./Image-CnqB5dbD.js","./file-url-DoxvUUVV.js","./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js","./DownloadLink-CqD3Uu0l.css","./Image-B8dFOee4.css","./MarkdownCode.svelte_svelte_type_style_lang-DzFJaVYu.js","./prism-python-D8O99YiR.js","./MarkdownCode-Dw1-H2nG.css","./Button-DTh9AgeE.css","./IconButtonWrapper-BqcF4N5S.css","./ImagePreview-C_qhEOxI.css","./index-BFBcOI-E.js","./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js","./StreamingBar-DOagx4HU.css","./IconButton-C_HS7fTi.js","./Clear-By3xiIwg.js","./Block-CJdXVpa7.js","./Dropdown-Ib2nGkdD.js","./index-CRyThWY1.js","./BlockTitle-D2VH9_Na.js","./Info-BpelqhYn.js","./MarkdownCode-BRQ4PUpt.js","./DropdownArrow-DYWFcSFn.js","./Dropdown-CWxB-qJp.css","./Checkbox-1fK2t2Mh.js","./Checkbox-WIAKB-_s.css","./Toast-DTlCeY7K.js","./utils-BsGrhMNe.js","./Blocks-CDJynZ58.css","./Example-D7K5RtQ2.css","./Login-VqR_0Hqf.js","./Index-DE1Sah7F.js","./Index-12OnbRhk.css","./Textbox-DI9Q41tU.js","./Check-CEkiXcyC.js","./Copy-CxQ9EyK2.js","./Send-DyoOovnk.js","./Square-oAGqOwsh.js","./Textbox-jWD3sCxr.css","./Index-C_pBLFQL.js","./Index-CptIZeFZ.css","./Login-BCwzjozv.css","./Example-ClKJOMGh.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); 2import{$ as Be,s as Fe,w as He,m as Ve,p as me,_ as he}from"./index-Ccc2t4AG.js";import{E as Ge}from"./Embed-yYAfXBkj.js";import{S as We}from"./index-BFBcOI-E.js";/* empty css */import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import{s as Ze}from"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";import"./svelte/svelte.js";import"./MarkdownCode.svelte_svelte_type_style_lang-DzFJaVYu.js";import"./prism-python-D8O99YiR.js";import"./IconButton-C_HS7fTi.js";import"./Clear-By3xiIwg.js";var xe=()=>{const t=document.createElement("link");t.href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap",t.rel="stylesheet";const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap",e.rel="stylesheet",document.head.appendChild(t),document.head.appendChild(e)},Ye=()=>{const t=document.createElement("div");return t.style.backgroundImage="linear-gradient(to top, #f9fafb, white)",t.style.border="1px solid #e5e7eb",t.style.borderRadius="0.75rem",t.style.boxShadow="0 0 10px rgba(0, 0, 0, 0.1)",t.style.color="#374151",t.style.display="flex",t.style.flexDirection="row",t.style.alignItems="center",t.style.height="40px",t.style.justifyContent="space-between",t.style.overflow="hidden",t.style.position="fixed",t.style.right=".75rem",t.style.top=".75rem",t.style.width="auto",t.style.zIndex="20",t.style.paddingLeft="1rem",t.setAttribute("id","huggingface-space-header"),window.matchMedia("(max-width: 768px)").addEventListener("change",e=>{e.matches?t.style.display="none":t.style.display="flex"}),t},Je=()=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("xmlns:link","http://www.w3.org/1999/xlink"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.setAttribute("role","img"),t.setAttribute("width","1em"),t.setAttribute("height","1em"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("viewBox","0 0 12 12"),t.setAttribute("fill","currentColor");const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d","M0.375001 10.3828L0.375 1.61719C0.375 1.104 0.816001 0.687501 1.35938 0.687501L10.6406 0.6875C10.9017 0.6875 11.1521 0.785449 11.3367 0.959797C11.5213 1.13415 11.625 1.37062 11.625 1.61719V10.3828C11.625 10.6294 11.5213 10.8659 11.3367 11.0402C11.1521 11.2145 10.9017 11.3125 10.6406 11.3125H1.35938C0.816001 11.3125 0.375001 10.896 0.375001 10.3828ZM1.35938 10.5156H10.6406C10.7183 10.5156 10.7813 10.4561 10.7813 10.3828V4.40625H1.21875V10.3828C1.21875 10.418 1.23356 10.4518 1.25994 10.4767C1.28631 10.5017 1.32208 10.5156 1.35938 10.5156ZM4.61052 6.38251L5.9999 7.69472L7.38927 6.38251C7.44083 6.33007 7.50645 6.29173 7.57913 6.27153C7.6518 6.25134 7.72898 6.25003 7.8024 6.26776C7.87583 6.28549 7.9428 6.3216 7.99628 6.37227C8.04983 6.42295 8.08785 6.48631 8.10645 6.5557C8.12528 6.62497 8.12393 6.69773 8.10263 6.76635C8.0814 6.83497 8.0409 6.8969 7.98555 6.94564L6.29802 8.53936C6.21892 8.61399 6.11169 8.65592 5.9999 8.65592C5.8881 8.65592 5.78087 8.61399 5.70177 8.53936L4.01427 6.94564C3.95874 6.89694 3.91814 6.835 3.89676 6.76633C3.87538 6.69766 3.874 6.62483 3.89277 6.55549C3.91154 6.48615 3.94977 6.42287 4.00343 6.37233C4.05708 6.32179 4.12418 6.28585 4.19765 6.2683C4.27098 6.25054 4.34803 6.25178 4.42068 6.27188C4.49334 6.29198 4.55891 6.3302 4.610
252 6.38251Z"),t.appendChild(e),t},Ke=(t,e)=>{const n=document.createElement("div");return n.setAttribute("id","space-header__collapse"),n.style.display="flex",n.style.flexDirection="row",n.style.alignItems="center",n.style.justifyContent="center",n.style.fontSize="16px",n.style.paddingLeft="10px",n.style.paddingRight="10px",n.style.height="40px",n.style.cursor="pointer",n.style.color="#40546e",n.style.transitionDuration="0.1s",n.style.transitionProperty="all",n.style.transitionTimingFunction="ease-in-out",n.appendChild(Je()),n.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),e()}),n.addEventListener("mouseenter",()=>{n.style.color="#213551"}),n.addEventListener("mouseleave",()=>{n.style.color="#40546e"}),n},Qe=t=>{const e=document.createElement("p");return e.style.margin="0",e.style.padding="0",e.style.color="#9ca3af",e.style.fontSize="14px",e.style.fontFamily="Source Sans Pro, sans-serif",e.style.padding="0px 6px",e.style.borderLeft="1px solid #e5e7eb",e.style.marginLeft="4px",e.textContent=(t??0).toString(),e},Xe=()=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("xmlns:link","http://www.w3.org/1999/xlink"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.setAttribute("role","img"),t.setAttribute("width","1em"),t.setAttribute("height","1em"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("viewBox","0 0 32 32"),t.setAttribute("fill","#6b7280");const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d","M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z"),t.appendChild(e),t},$e=t=>{const e=document.createElement("a");return e.setAttribute("href",`https://huggingface.co/spaces/${t.id}`),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e.style.border="1px solid #e5e7eb",e.style.borderRadius="6px",e.style.display="flex",e.style.flexDirection="row",e.style.alignItems="center",e.style.margin="0 0 0 12px",e.style.fontSize="14px",e.style.paddingLeft="4px",e.style.textDecoration="none",e.appendChild(Xe()),e.appendChild(Qe(t.likes)),e},et=t=>{const e=document.createElement("img");return e.src=`https://huggingface.co/api/users/${t}/avatar`,e.style.width="0.875rem",e.style.height="0.875rem",e.style.borderRadius="50%",e.style.flex="none",e.style.marginRight="0.375rem",e},tt=t=>{const[e,n]=t.split("/"),r=document.createElement("a");return r.setAttribute("href",`https://huggingface.co/spaces/${t}`),r.setAttribute("rel","noopener noreferrer"),r.setAttribute("target","_blank"),r.style.color="#1f2937",r.style.textDecoration="none",r.style.fontWeight="600",r.style.fontSize="15px",r.style.lineHeight="24px",r.style.flex="none",r.style.fontFamily="IBM Plex Mono, sans-serif",r.addEventListener("mouseover",()=>{r.style.color="#2563eb"}),r.addEventListener("mouseout",()=>{r.style.color="#1f2937"}),r.textContent=n,r},nt=()=>{const t=document.createElement("div");return t.style.marginLeft=".125rem",t.style.marginRight=".125rem",t.style.color="#d1d5db",t.textContent="/",t},rt=t=>{const e=document.createElement("a");return e.setAttribute("href",`https://huggingface.co/${t}`),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e.style.color="rgb(107, 114, 128)",e.style.textDecoration="none",e.style.fontWeight="400",e.style.fontSize="16px",e.style.lineHeight="24px",e.style.flex="none",e.style.fontFamily="Source Sans Pro, sans-serif",e.addEventListener("mouseover",()=>{e.style.color="#2563eb"}),e.addEventListener("mouseout",()=>{e.style.color="rgb(107, 114, 128)"}),e.textContent=t,e},st=t=>{const e=document.createElement("div");return e.style.display="flex",e.style.flexDirection="row",e.style.alignItems="center",e.style.justifyContent="center",e.style.borderRight="1px solid #e5e7eb",e.style.paddingRight="12px",e.style.height="40px",e.appendChild(et(t.author)),e.appendChild(rt(t.author)),e.appendChild(nt()),e.appendChild(tt(t.id)),e.appendChild($e(t)),e},ot=t=>{const e=Ye(),n=()=>e.style.display="none";return e.appendChild(st(t)),e.appendChild(Ke(t,n)),e},it=async t=>{try{return await(await fetch(`https://huggingface.co/api/spaces/${t}`)).json()}catch{return null}},at=(t,e)=>{if(document.body===null)return console.error("document.body is null");document.body.appendChild(t)};async function lt(t,e){var n,r;if(window===void 0)return console.error("Please run this script in a browser environment");
vendor: 15,605 bytes, lines 2-11
2if(Object.values((r=(n=window.location)==null?void 0:n.ancestorOrigins)!=null?r:{0:window.document.referrer}).some(d=>{var u;return((u=new URL(d))==null?void 0:u.origin)==="https://huggingface.co"}))return;xe();let a;if(typeof t=="string"){if(a=await it(t),a===null)return console.error("Space not found")}else a=t;const s=ot(a);return at(s),{element:s}}var ct=(t,e)=>lt(t);const{SvelteComponent:dt,add_flush_callback:H,append:k,assign:ut,attr:y,bind:V,binding_callbacks:G,check_outros:ge,component_subscribe:we,create_component:W,destroy_component:Z,detach:L,element:E,empty:_t,flush:g,get_spread_object:ft,get_spread_update:pt,group_outros:be,init:mt,insert:R,mount_component:x,noop:ht,safe_not_equal:gt,set_data:Ee,space:Ae,text:z,transition_in:v,transition_out:C}=window.__gradio__svelte__internal,{onMount:ye,createEventDispatcher:wt,onDestroy:bt}=window.__gradio__svelte__internal;function ve(t){let e,n;return e=new We({props:{absolute:!t[4],status:t[19],timer:!1,queue_position:null,queue_size:null,translucent:!0,loading_text:t[20],i18n:t[25],autoscroll:t[0],$$slots:{error:[Et],"additional-loading-text":[vt]},$$scope:{ctx:t}}}),{c(){W(e.$$.fragment)},m(r,i){x(e,r,i),n=!0},p(r,i){const a={};i[0]&16&&(a.absolute=!r[4]),i[0]&524288&&(a.status=r[19]),i[0]&1048576&&(a.loading_text=r[20]),i[0]&33554432&&(a.i18n=r[25]),i[0]&1&&(a.autoscroll=r[0]),i[0]&33562880|i[1]&67108864&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){n||(v(e.$$.fragment,r),n=!0)},o(r){C(e.$$.fragment,r),n=!1},d(r){Z(e,r)}}}function yt(t){let e;return{c(){e=E("p"),e.innerHTML='If your custom component never loads, consult the troubleshooting <a style="color: blue;" href="https://www.gradio.app/guides/frequently-asked-questions#the-development-server-didnt-work-for-me" class="svelte-y6l4b">guide</a>.'},m(n,r){R(n,e,r)},d(n){n&&L(e)}}}function vt(t){let e,n=t[27]==="dev"&&yt();return{c(){e=E("div"),n&&n.c(),y(e,"class","load-text"),y(e,"slot","additional-loading-text")},m(r,i){R(r,e,i),n&&n.m(e,null)},p:ht,d(r){r&&L(e),n&&n.d()}}}function kt(t){let e,n=t[25]("errors.contact_page_author")+"",r;return{c(){e=E("p"),r=z(n),y(e,"class","svelte-y6l4b")},m(i,a){R(i,e,a),k(e,r)},p(i,a){a[0]&33554432&&n!==(n=i[25]("errors.contact_page_author")+"")&&Ee(r,n)},d(i){i&&L(e)}}}function Ct(t){let e,n,r,i,a,s;return{c(){e=E("p"),n=z("Please "),r=E("a"),i=z("contact the author of the space"),s=z(" to let them know."),y(r,"href",a="https://huggingface.co/spaces/"+t[8]+"/discussions/new?title="+t[28].title(t[13]?.detail)+"&description="+t[28].description(t[13]?.detail,location.origin)),y(r,"class","svelte-y6l4b"),y(e,"class","svelte-y6l4b")},m(d,u){R(d,e,u),k(e,n),k(e,r),k(r,i),k(e,s)},p(d,u){u[0]&8448&&a!==(a="https://huggingface.co/spaces/"+d[8]+"/discussions/new?title="+d[28].title(d[13]?.detail)+"&description="+d[28].description(d[13]?.detail,location.origin))&&y(r,"href",a)},d(d){d&&L(e)}}}function Et(t){let e,n,r,i=(t[13]?.message||"")+"",a,s;function d(c,l){return(c[13].status==="space_error"||c[13].status==="paused")&&c[13].discussions_enabled?Ct:kt}let u=d(t),p=u(t);return{c(){e=E("div"),n=E("p"),r=E("strong"),a=z(i),s=Ae(),p.c(),y(n,"class","svelte-y6l4b"),y(e,"class","error svelte-y6l4b"),y(e,"slot","error")},m(c,l){R(c,e,l),k(e,n),k(n,r),k(r,a),k(e,s),p.m(e,null)},p(c,l){l[0]&8192&&i!==(i=(c[13]?.message||"")+"")&&Ee(a,i),u===(u=d(c))&&p?p.p(c,l):(p.d(1),p=u(c),p&&(p.c(),p.m(e,null)))},d(c){c&&L(e),p.d()}}}function At(t){let e,n,r,i,a;const s=[{app:t[14]},t[12],{fill_height:!t[4]&&t[12].fill_height},{theme_mode:t[21]},{control_page_title:t[5]},{target:t[9]},{autoscroll:t[0]},{show_footer:!t[4]},{app_mode:t[3]},{version:t[1]},{api_prefix:t[12].api_prefix||""},{max_file_size:t[12].max_file_size},{initial_layout:void 0},{search_params:new URLSearchParams(window.location.search)}];function d(l){t[37](l)}function u(l){t[38](l)}function p(l){t[39](l)}let c={};for(let l=0;l<s.length;l+=1)c=ut(c,s[l]);return t[10]!==void 0&&(c.ready=t[10]),t[11]!==void 0&&(c.render_complete=t[11]),t[15]!==void 0&&(c.add_new_message=t[15]),e=new t[23]({props:c}),G.push(()=>V(e,"ready",d)),G.push(()=>V(e,"render_complete",u)),G.push(()=>V(e,"add_new_message",p)),{c(){W(e.$$.fragment)},m(l,_){x(e,l,_),a=!0},p(l,_){const A=_[0]&2118203?pt(s,[_[0]&16384&&{app:l[14]},_[0]&4096&&ft(l[12]),_[0]&4112&&{fill_height:!l[4]&&l[12].fill_height},_[0]&2097152&&{theme_mode:l[21]},_[0]&32&&{control_page_title:l[5]},_[0]&512&&{target:l[9]},_[0]&1&&{autoscroll:l[0]},_[0]&16&&{show_footer:!l[4]},_[0]&8&&{app_mode:l[3]},_[0]&2&&{version:l[1]},_[0]&4096&&{api_prefix:l[12].api_prefix||""},_[0]&4096&&{max_file_size:l[12].max_file_size},_&0&&{initial_layout:void 0},_&0&&{search_params:new URLSearchParams(window.location.search)}]):{};!n&&_[0]&1024&&(n=!0,A.ready=l[10],H(()=>n=!1)),!r&&_[0]&2048&&(r=!0,A.render_complete=l[11],H(()=>r=!1)),!i&&_[0]&32768&&(i=!0,A.add_new_message=l[15],H(()=>i=!1)),e.$set(A)},i(l){a||(v(e.$$.fragment,l),a=!0)},o(l){C(e.$$.fragment,l),a=!1},d(l){Z(e,l)}}}function Lt(t){let e,n;return e=new t[24]({props:{auth_message:t[12].auth_message,root:t[12].root,space_id:t[8],app_mode:t[3]}}),{c(){W(e.$$.fragment)},m(r,i){x(e,r,i),n=!0},p(r,i){const a={};i[0]&4096&&(a.auth_message=r[12].auth_message),i[0]&4096&&(a.root=r[12].root),i[0]&256&&(a.space_id=r[8]),i[0]&8&&(a.app_mode=r[3]),e.$set(a)},i(r){n||(v(e.$$.fragment,r),n=!0)},o(r){C(e.$$.fragment,r),n=!1},d(r){Z(e,r)}}}function Rt(t){let e,n,r,i,a,s=(t[19]==="pending"||t[19]==="error")&&!(t[12]&&t[12]?.auth_required)&&ve(t);const d=[Lt,At],u=[];function p(c,l){return c[12]?.auth_required&&c[24]?0:c[12]&&c[23]&&c[22]?1:-1}return~(n=p(t))&&(r=u[n]=d[n](t)),{c(){s&&s.c(),e=Ae(),r&&r.c(),i=_t()},m(c,l){s&&s.m(c,l),R(c,e,l),~n&&u[n].m(c,l),R(c,i,l),a=!0},p(c,l){(c[19]==="pending"||c[19]==="error")&&!(c[12]&&c[12]?.auth_required)?s?(s.p(c,l),l[0]&528384&&v(s,1)):(s=ve(c),s.c(),v(s,1),s.m(e.parentNode,e)):s&&(be(),C(s,1,1,()=>{s=null}),ge());let _=n;n=p(c),n===_?~n&&u[n].p(c,l):(r&&(be(),C(u[_],1,1,()=>{u[_]=null}),ge()),~n?(r=u[n],r?r.p(c,l):(r=u[n]=d[n](c),r.c()),v(r,1),r.m(i.parentNode,i)):r=null)},i(c){a||(v(s),v(r),a=!0)},o(c){C(s),C(r),a=!1},d(c){c&&(L(e),L(i)),s&&s.d(c),~n&&u[n].d(c)}}}function St(t){let e,n,r;function i(s){t[40](s)}let a={display:t[6]&&t[4],is_embed:t[4],info:!!t[8]&&t[7],version:t[1],initial_height:t[2],space:t[8],loaded:t[19]==="complete",fill_width:t[12]?.fill_width||!1,pages:t[16],current_page:t[17],root:t[18],is_lite:t[26],$$slots:{default:[Rt]},$$scope:{ctx:t}};return t[9]!==void 0&&(a.wrapper=t[9]),e=new Ge({props:a}),G.push(()=>V(e,"wrapper",i)),{c(){W(e.$$.fragment)},m(s,d){x(e,s,d),r=!0},p(s,d){const u={};d[0]&80&&(u.display=s[6]&&s[4]),d[0]&16&&(u.is_embed=s[4]),d[0]&384&&(u.info=!!s[8]&&s[7]),d[0]&2&&(u.version=s[1]),d[0]&4&&(u.initial_height=s[2]),d[0]&256&&(u.space=s[8]),d[0]&524288&&(u.loaded=s[19]==="complete"),d[0]&4096&&(u.fill_width=s[12]?.fill_width||!1),d[0]&65536&&(u.pages=s[16]),d[0]&131072&&(u.current_page=s[17]),d[0]&262144&&(u.root=s[18]),d[0]&66649915|d[1]&67108864&&(u.$$scope={dirty:d,ctx:s}),!n&&d[0]&512&&(n=!0,u.wrapper=s[9],H(()=>n=!1)),e.$set(u)},i(s){r||(v(e.$$.fragment,s),r=!0)},o(s){C(e.$$.fragment,s),r=!1},d(s){Z(e,s)}}}let It=-1;function Mt(){const t=He({}),e=new Map,n=new IntersectionObserver(i=>{i.forEach(a=>{if(a.isIntersecting){let s=e.get(a.target);s!==void 0&&t.update(d=>({...d,[s]:!0}))}})});function r(i,a){e.set(a,i),n.observe(a)}return{register:r,subscribe:t.subscribe}}const ke=Mt();async function Ce(t){if(t){const e=new DOMParser,n=Array.from(e.parseFromString(t,"text/html").head.children);if(n)for(let r of n){let i=document.createElement(r.tagName);if(Array.from(r.attributes).forEach(a=>{i.setAttribute(a.name,a.value)}),i.textContent=r.textContent,i.tagName=="META"){const a=i.getAttribute("property"),s=i.getAttribute("name");if(a||s){const u=Array.from(document.head.getElementsByTagName("meta")??[]).find(p=>a&&p.getAttribute("property")===a||s&&p.getAttribute("name")===s?!p.isEqualNode(i):!1);if(u){document.head.replaceChild(i,u);continue}}}document.head.appendChild(i)}}}function Pt(t,e,n){let r,i;we(t,Be,o=>n(25,r=o)),we(t,ke,o=>n(36,i=o)),Fe();const a=wt();let{autoscroll:s}=e,{version:d}=e,{initial_height:u}=e,{app_mode:p}=e,{is_embed:c}=e,{theme_mode:l="system"}=e,{control_page_title:_}=e,{container:A}=e,{info:ee}=e,{eager:Y}=e,J,te=[],ne,re,{mount_css:U=Ve}=e,{Client:q}=e,{worker_proxy:S=void 0}=e;S&&(Ze(S),S.addEventListener("progress-update",o=>{n(20,ie=o.detail+"...")}));let Le=S!==void 0,{space:K}=e,{src:Q}=e,se=It++,oe="pending",I,N=!1,T=!1,f,ie=r("common.loading")+"...",ae,j,D=null;async function le(o){o&&(D||(D=document.createElement("style"),document.head.appendChild(D)),D.textContent=me(o,d,D)),await U(f.root+"/theme.css?v="+f.theme_hash,document.head),f.stylesheets&&await Promise.all(f.stylesheets.map(h=>h.startsWith("http:")||h.startsWith("https:")?U(h,document.head):fetch(f.root+"/"+h).then(b=>b.text()).then(b=>{me(b,d)})))}function Re(o){const h=window.__gradio_mode__==="website";let m;if(h)m="light";else{const F=new URL(window.location.toString()).searchParams.get("__theme");m=l||F||"system"}return m==="dark"||m==="light"?ce(o,m):m=Se(o),m}function Se(o){const h=m();window?.matchMedia("(prefers-color-scheme: dark)")?.addEventListener("change",m);function m(){let b=window?.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light";return ce(o,b),b}return h}function ce(o,h){const m=c?o.parentElement:document.body,b=c?o:o.parentElement;b.style.background="var(--body-background-fill)",h==="dark"?m.classList.add("dark"):m.classList.remove("dark")}let M={message:"",load_status:"pending",status:"sleeping",detail:"SLEEPING"},w,X=!1;function de(o){n(13,M=o)}const ue=window.__GRADIO_DEV__;let B=!1,P;ye(async()=>{n(21,ae=Re(I));const o=window.__GRADIO__SERVER_PORT__;j=ue==="dev"?`http://localhost:${typeof o=="number"?o:7860}`:K||Q||location.origin;const h=new URLSearchParams(window.location.search).get("deep_link"),m={};if(h&&(m.deep_link=h),n(14,w=await q.connect(j,{status_callback:de,with_null_state:!0,events:["data","log","status","render"],query_params:m})),window.addEventListener("beforeunload",()=>{w.close()}),!w.config)throw new Error("Could not resolve app config");n(12,f=w.get_url_config()),window.__gradio_space__=f.space_id,window.__gradio_session_hash__=w.session_hash,n(13,M={message:"",load_status:"complete",status:"running",detail:"RUNNING"}),await le(f.css),await Ce(f.head),n(22,X=!0),window.__is_colab__=f.is_colab;const b="supports-zerogpu-headers";window.addEventListener("message",$=>{$.data===b&&(window.supports_zerogpu_headers=!0)});const F=window.location.hostname,Te=F.includes(".dev.")?`https://moon-${F.split(".")[1]}.dev.spaces.huggingface.tech`:"https://huggingface.co";window.parent.postMessage(b,Te),a("loaded"),n(16,te=f.pages),n(17,ne=f.current_page),n(18,re=f.root),f.deep_link_state==="invalid"&&n(35,B=!0),f.dev_mode&&setTimeout(()=>{const{host:$}=new URL(j);let je=new URL(`http://${$}${w.api_prefix}/dev/reload`);J=new EventSource(je),J.addEventListener("error",async pe=>{P("Error","Error reloading app","error"),console.error(JSON.parse(pe.data))}),J.addEventListener("reload",async pe=>{if(w.close(),n(14,w=await q.connect(j,{status_callback:de,with_null_state:!0,events:["data","log","status","render"]})),!w.config)throw new Error("Could not resolve app config");n(12,f=w.get_url_config()),window.__gradio_space__=f.space_id,await le(f.css),await Ce(f.head),n(22,X=!0),window.__is_colab__=f.is_colab,a("loaded")})},200)});let _e,fe;async function Ie(){n(23,_e=(await he(()=>import("./Blocks-CvpDAyLR.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]),import.meta.url)).default)}async function Me(){n(24,fe=(await he(()=>import("./Login-VqR_0Hqf.js"),__vite__mapDeps([34,35,36,37,23,24,25,1,2,9,10,11,13,38,39,40,41,22,42,20,16,17,3,4,5,6,7,8,12,14,43,15,18,19,44,45,46]),import.meta.url)).default)}function Pe(){f.auth_required?Me():Ie()}const Ne={readable_error:{NO_APP_FILE:r("errors.no_app_file"),CONFIG_ERROR:r("errors.config_error"),BUILD_ERROR:r("errors.build_error"),RUNTIME_ERROR:r("errors.runtime_error"),PAUSED:r("errors.space_paused")},title(o){return encodeURIComponent(r("errors.space_not_working"))},description(o,h){return encodeURIComponent(`Hello, 3 4Firstly, thanks for creating this space! 5 6I noticed that the space isn't working correctly because there is ${this.readable_error[o]||"an error"}. 7 8It would be great if you could take a look at this because this space is being embedded on ${h}. 9 10Thanks!`)}};ye(async()=>{ke.register(se,I)});let O;async function De(o,h){if(o&&!h&&window.self===window.top){O&&(O.remove(),O=void 0);const m=await ct(o);m&&(O=m.element)}}bt(()=>{O?.remove()});function Oe(o){N=o,n(10,N)}function ze(o){T=o,n(11,T)}function Ue(o){P=o,n(15,P)}function qe(o){I=o,n(9,I)}return t.$$set=o=>{"autoscroll"in o&&n(0,s=o.autoscroll),"version"in o&&n(1,d=o.version),"initial_height"in o&&n(2,u=o.initial_height),"app_mode"in o&&n(3,p=o.app_mode),"is_embed"in o&&n(4,c=o.is_embed),"theme_mode"in o&&n(29,l=o.theme_mode),"control_page_title"in o&&n(5,_=o.control_page_title),"container"in o&&n(6,A=o.container),"info"in o&&n(7,ee=o.info),"eager"in o&&n(30,Y=o.eager),"mount_css"in o&&n(31,U=o.mount_css),"Client"in o&&n(32,q=o.Client),"worker_proxy"in o&&n(33,S=o.worker_proxy),"space"in o&&n(8,K=o.space),"src"in o&&n(34,Q=o.src)},t.$$.update=()=>{t.$$.dirty[0]&4096&&f?.app_id&&f.app_id,t.$$.dirty[0]&32768|t.$$.dirty[1]&16&&P&&B&&(P("Error","Deep link was not valid","error"),n(35,B=!1)),t.$$.dirty[0]&9216&&n(19,oe=!N&&M.load_status!=="error"?"pending":!N&&M.load_status==="error"?"error":M.load_status),t.$$.dirty[0]&1073745920|t.$$.dirty[1]&32&&f&&(Y||i[se])&&Pe(),t.$$.dirty[0]&2560&&T&&I.dispatchEvent(new CustomEvent("render",{bubbles:!0,cancelable:!1,composed:!0})),t.$$.dirty[0]&16400&&w?.config&&De(w?.config?.space_id,c)},[s,d,u,p,c,_,A,ee,K,I,N,T,f,M,w,P,te,ne,re,oe,ie,ae,X,_e,fe,r,Le,ue,Ne,l,Y,U,q,S,Q,B,i,Oe,ze,Ue,qe]}class Vt extends dt{constructor(e){super(),mt(this,e,Pt,St,gt,{autoscroll:0,version:1,initial_height:2,app_mode:3,is_embed:4,theme_mode:29,control_page_title:5,container:6,info:7,eager:30,mount_css:31,Client:32,worker_proxy:33,space:8,src:34},null,[-1,-1])}get autoscroll(){return this.$$.ctx[0]}set autoscroll(e){this.$$set({autoscroll:e}),g()}get version(){return this.$$.ctx[1]}set version(e){this.$$set({version:e}),g()}get initial_height(){return this.$$.ctx[2]}set initial_height(e){this.$$set({initial_height:e}),g()}get app_mode(){return this.$$.ctx[3]}set app_mode(e){this.$$set({app_mode:e}),g()}get is_embed(){return this.$$.ctx[4]}set is_embed(e){this.$$set({is_embed:e}),g()}get theme_mode(){return this.$$.ctx[29]}set theme_mode(e){this.$$set({theme_mode:e}),g()}get control_page_title(){return this.$$.ctx[5]}set control_page_title(e){this.$$set({control_page_title:e}),g()}get container(){return this.$$.ctx[6]}set container(e){this.$$set({container:e}),g()}get info(){return this.$$.ctx[7]}set info(e){this.$$set({info:e}),g()}get eager(){return this.$$.ctx[30]}set eager(e){this.$$set({eager:e}),g()}get mount_css(){return this.$$.ctx[31]}set mount_css(e){this.$$set({mount_css:e}),g()}get Client(){return this.$$.ctx[32]}set Client(e){this.$$set({Client:e}),g()}get worker_proxy(){return this.$$.ctx[33]}set worker_proxy(e){this.$$set({worker_proxy:e}),g()}get space(){return this.$$.ctx[8]}set space(e){this.$$set({space:e}),g()}get src(){return this.$$.ctx[34]}set src(e){this.$$set({src:e}),g()}}export{Vt as default}; 11//# sourceMappingURL=Index-BzI0zy4H.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.