import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_async.js";import*as t from"./svelte/svelte_internal_client.js";import{onMount as w}from"./svelte/svelte_svelte.js";import{I as A}from"./Image-Bdf4wQSw.js";import"./ImagePreview-Cx854cRW.js";import{V as B}from"./Video-06U9X4-1.js";import"./i18n-BldJSFLV.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"./utils.svelte-Ceck75cM.js";import"./IconButtonWrapper-Cljb5D-5.js";import"./MarkdownCode-C2b9iIxl.js";import"./prism-python-CpYAgONt.js";import"./ShareButton-DCJS4lh5.js";import"./FullscreenButton-Cqzqqtq6.js";var C=t.from_html("<audio controls></audio>"),D=t.from_html("<div><p> </p> <!></div>");function ut(x,l){t.push(l,!1);let a=t.prop(l,"value",28,()=>({text:"",files:[]})),n=t.prop(l,"type",12),u=t.prop(l,"selected",12,!1),_=t.mutable_source(),c=t.mutable_source();function h(r,e){r.style.setProperty("--local-text-width",`${e&&e<150?e:200}px`),r.style.whiteSpace="unset"}w(()=>{h(t.get(c),t.get(_))});var b={get value(){return a()},set value(r){a(r),t.flush()},get type(){return n()},set type(r){n(r),t.flush()},get selected(){return u()},set selected(r){u(r),t.flush()}};t.init();var o=D();let g;var d=t.child(o),k=t.child(d,!0);t.reset(d);var z=t.sibling(d,2);return t.each(z,1,()=>(t.deep_read_state(a()),t.untrack(()=>a().files)),t.index,(r,e)=>{var v=t.comment(),I=t.first_child(v);{var V=m=>{A(m,{get src(){return t.get(e),t.untrack(()=>t.get(e).url)},alt:""})},E=m=>{var f=t.comment(),M=t.first_child(f);{var P=p=>{B(p,{get src(){return t.get(e),t.untrack(()=>t.get(e).url)},alt:"",loop:!0,is_stream:!1})},S=p=>{var y=t.comment(),W=t.first_child(y);{var j=s=>{var i=C();t.template_effect(()=>t.set_attribute(i,"src",(t.get(e),t.untrack(()=>t.get(e).url)))),t.append(s,i)},q=s=>{var i=t.text();t.template_effect(()=>t.set_text(i,(t.get(e),t.untrack(()=>t.get(e).orig_name)))),t.append(s,i)};t.if(W,s=>{t.get(e),t.untrack(()=>t.get(e).mime_type&&t.get(e).mime_type.includes("audio"))?s(j):s(q,!1)},!0)}t.append(p,y)};t.if(M,p=>{t.get(e),t.untrack(()=>t.get(e).mime_type&&t.get(e).mime_type.includes("video"))?p(P):p(S,!1)},!0)}t.append(m,f)};t.if(I,m=>{t.get(e),t.untrack(()=>t.get(e).mime_type&&t.get(e).mime_type.includes("image"))?m(V):m(E,!1)})}t.append(r,v)}),t.reset(o),t.bind_this(o,r=>t.set(c,r),()=>t.get(c)),t.template_effect(()=>{g=t.set_class(o,1,"container svelte-xz0m7l",null,g,{table:n()==="table",gallery:n()==="gallery",selected:u(),border:a()}),t.set_text(k,(t.deep_read_state(a()),t.untrack(()=>a().text?a().text:"")))}),t.bind_element_size(o,"clientWidth",r=>t.set(_,r)),t.append(x,o),t.pop(b)}export{ut as default};
