import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import{onMount as O}from"./svelte/svelte_svelte.js";import{s as Q,$ as X,q as $,l as ee,d as te}from"./i18n-BldJSFLV.js";import{s as re}from"./Blocks-DAzkvuqA.js";import{C as ae}from"./clear-BJfJ8fXC.js";import{BaseDropdown as ie}from"./Index-BXdwxmHL.js";import{BaseCheckbox as I}from"./Index-aAgh1OXe.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_store.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./StreamingBar-b2qVLPYU.js";import"./IconButtonWrapper-Cljb5D-5.js";import"./MarkdownCode-C2b9iIxl.js";import"./prism-python-CpYAgONt.js";import"./utils.svelte-Ceck75cM.js";import"./init.svelte-1j0vhaZC.js";import"./index-tFQomdd2.js";import"./state.svelte-DFm6rEHb.js";import"./Example-Ctdnw0MA.js";var oe=e.from_html('<h2 class="svelte-xaoy31"><img alt="" class="svelte-xaoy31"/> <div class="title svelte-xaoy31"> <div class="url svelte-xaoy31"> </div></div></h2> <button class="svelte-xaoy31"><!></button>',1);function se(w,a){e.push(a,!0);const i=()=>e.store_get(X,"$_",d),[d,v]=e.setup_stores();Q();var c=oe(),l=e.first_child(c),o=e.child(l),m=e.sibling(o,2),h=e.child(m),b=e.sibling(h),u=e.child(b,!0);e.reset(b),e.reset(m),e.reset(l);var n=e.sibling(l,2),f=e.child(n);ae(f),e.reset(n),e.template_effect(g=>{e.set_attribute(o,"src",re),e.set_text(h,`${g??""} `),e.set_text(u,a.root)},[()=>i()("common.settings")]),e.event("click",n,()=>a.onclose?.()),e.append(w,c),e.pop(),v()}const le="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='%23808080'%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";var ne=e.from_html('<div class="banner-wrap svelte-1t60wb3"><h2 class="svelte-1t60wb3"> </h2> <ul class="padded theme-buttons svelte-1t60wb3"><li><button class="svelte-1t60wb3">☀︎ &nbsp;Light</button></li> <li><button class="svelte-1t60wb3">⏾ &nbsp; Dark</button></li> <li><button class="svelte-1t60wb3">🖥︎ &nbsp;System</button></li></ul></div>'),ce=e.from_html('You can install this app as a Progressive Web App on your device. Visit <a target="_blank" class="svelte-1t60wb3"> </a> and click the install button in the URL address bar of your browser.',1),de=e.from_html(`Progressive Web App is not enabled for this app. To enable it, start your
			Gradio app with <code>launch(pwa=True)</code>.`,1),ve=e.from_html(`<div class="banner-wrap svelte-1t60wb3"><!></div> <!> <div class="banner-wrap svelte-1t60wb3"><h2 class="svelte-1t60wb3"> </h2> <p class="padded svelte-1t60wb3"><!></p></div> <div class="banner-wrap svelte-1t60wb3"><h2 class="svelte-1t60wb3"> </h2> <p class="padded svelte-1t60wb3"><!></p></div> <div class="banner-wrap svelte-1t60wb3"><h2 class="svelte-1t60wb3"> <span class="beta-tag svelte-1t60wb3">beta</span></h2> <p class="padded svelte-1t60wb3">Screen Studio allows you to record your screen and generates a video of your
		app with automatically adding zoom in and zoom out effects as well as
		trimming the video to remove the prediction time. <br/><br/> Start recording by clicking the <i>Start Recording</i> button below and then
		sharing the current browser tab of your Gradio demo. Use your app as you
		would normally to generate a prediction. <br/> Stop recording by clicking the <i>Stop Recording</i> button in the footer of
		the demo. <br/><br/> <!> <!></p> <button class="record-button svelte-1t60wb3"><img alt="Start Recording" class="svelte-1t60wb3"/> Start Recording</button></div>`,1);function Ye(w,a){e.push(a,!0);let i=e.prop(a,"root",7),d=e.prop(a,"allow_zoom",15),v=e.prop(a,"allow_video_trim",15);i()===""&&i(location.protocol+"//"+location.host+location.pathname),i().endsWith("/")||i(i()+"/");function c(t){const r=new URL(window.location.href);t==="system"?(r.searchParams.delete("__theme"),e.set(o,"system")):(r.searchParams.set("__theme",t),e.set(o,t,!0)),r.searchParams.delete("view"),window.location.href=r.toString()}O(()=>{"parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0);const r=new URL(window.location.href).searchParams.get("__theme");return e.set(o,r||"system",!0),()=>{document.body.style.overflow="auto"}});let l=e.state("en"),o=e.state("system");$.subscribe(t=>{t&&e.set(l,t,!0)});function m(t){te(t)}function h(t){d(t.detail)}function b(t){v(t.detail)}var u=ve(),n=e.first_child(u),f=e.child(n);se(f,{onclose:()=>a.onclose(),get root(){return i()}}),e.reset(n);var g=e.sibling(n,2);{var M=t=>{var r=ne(),s=e.child(r),P=e.child(s,!0);e.reset(s);var D=e.sibling(s,2),p=e.child(D),H=e.child(p);e.reset(p);var _=e.sibling(p,2),J=e.child(_);e.reset(_);var z=e.sibling(_,2),K=e.child(z);e.reset(z),e.reset(D),e.reset(r),e.template_effect(N=>{e.set_text(P,N),e.set_class(p,1,`theme-button ${e.get(o)==="light"?"current-theme":"inactive-theme"}`,"svelte-1t60wb3"),e.set_class(_,1,`theme-button ${e.get(o)==="dark"?"current-theme":"inactive-theme"}`,"svelte-1t60wb3"),e.set_class(z,1,`theme-button ${e.get(o)==="system"?"current-theme":"inactive-theme"}`,"svelte-1t60wb3")},[()=>a.i18n("common.display_theme")]),e.event("click",H,()=>c("light")),e.event("click",J,()=>c("dark")),e.event("click",K,()=>c("system")),e.append(t,r)};e.if(g,t=>{a.space_id===null&&t(M)})}var x=e.sibling(g,2),y=e.child(x),U=e.child(y,!0);e.reset(y);var G=e.sibling(y,2),W=e.child(G);ie(W,{label:"Language",get choices(){return ee},show_label:!1,on_change:()=>m(e.get(l)),get value(){return e.get(l)},set value(t){e.set(l,t,!0)}}),e.reset(G),e.reset(x);var C=e.sibling(x,2),k=e.child(C),A=e.child(k,!0);e.reset(k);var T=e.sibling(k,2),F=e.child(T);{var j=t=>{var r=ce(),s=e.sibling(e.first_child(r)),P=e.child(s,!0);e.reset(s),e.next(),e.template_effect(()=>{e.set_attribute(s,"href",i()),e.set_text(P,i())}),e.append(t,r)},q=t=>{var r=de();e.next(2),e.append(t,r)};e.if(F,t=>{a.pwa_enabled?t(j):t(q,!1)})}e.reset(T),e.reset(C);var V=e.sibling(C,2),S=e.child(V),Y=e.child(S);e.next(),e.reset(S);var R=e.sibling(S,2),B=e.sibling(e.child(R),13);I(B,{label:"Include automatic zoom in/out",interactive:!0,get value(){return d()},$$events:{change:h}});var Z=e.sibling(B,2);I(Z,{label:"Include automatic video trimming",interactive:!0,get value(){return v()},$$events:{change:b}}),e.reset(R);var L=e.sibling(R,2),E=e.child(L);e.next(),e.reset(L),e.reset(V),e.template_effect((t,r,s)=>{e.set_text(U,t),e.set_text(A,r),e.set_text(Y,`${s??""} `),e.set_attribute(E,"src",le)},[()=>a.i18n("common.language"),()=>a.i18n("common.pwa"),()=>a.i18n("common.screen_studio")]),e.event("click",L,()=>{a.onclose?.(),a.start_recording?.()}),e.append(w,u),e.pop()}export{Ye as default};
