1import { M as Markdown } from './Index.svelte_svelte_type_style_lang-7fd1e462.js'; 2import { S as Static } from './Index-9d23d982.js'; 3import { B as Block } from './Button-c2bc75a7.js'; 4export { default as BaseExample } from './Example-df165c7d.js'; 5export { M as MarkdownCode } from './Example.svelte_svelte_type_style_lang-183af30f.js'; 6import './utils-013c0d40.js'; 7import './index-12d4b00b.js'; 8import './svelte/svelte.js'; 9import './prism-python-9de6db01.js'; 10 11/* home/runner/work/gradio/gradio/js/markdown/Index.svelte generated by Svelte v4.2.2 */ 12const { 13 SvelteComponent, 14 assign, 15 attr, 16 create_component, 17 destroy_component, 18 detach, 19 element, 20 get_spread_object, 21 get_spread_update, 22 init, 23 insert, 24 mount_component, 25 safe_not_equal, 26 space, 27 toggle_class, 28 transition_in, 29 transition_out 30} = window.__gradio__svelte__internal; 31function create_default_slot(ctx) { 32 let statustracker; 33 let t; 34 let div; 35 let markdown; 36 let current; 37 38 const statustracker_spread_levels = [ 39 { autoscroll: /*gradio*/ ctx[8].autoscroll }, 40 { i18n: /*gradio*/ ctx[8].i18n }, 41 /*loading_status*/ ctx[4], 42 { variant: "center" } 43 ]; 44 45 let statustracker_props = {}; 46 47 for (let i = 0; i < statustracker_spread_levels.length; i += 1) { 48 statustracker_props = assign(statustracker_props, statustracker_spread_levels[i]); 49 } 50 51 statustracker = new Static({ props: statustracker_props }); 52 53 markdown = new Markdown({ 54 props: { 55 min_height: /*loading_status*/ ctx[4] && /*loading_status*/ ctx[4].status !== "complete", 56 value: /*value*/ ctx[3], 57 elem_classes: /*elem_classes*/ ctx[1], 58 visible: /*visible*/ ctx[2], 59 rtl: /*rtl*/ ctx[5], 60 latex_delimiters: /*latex_delimiters*/ ctx[9], 61 sanitize_html: /*sanitize_html*/ ctx[6], 62 line_breaks: /*line_breaks*/ ctx[7], 63 header_links: /*header_links*/ ctx[10] 64 } 65 }); 66 67 markdown.$on("change", /*change_handler*/ ctx[12]); 68 69 return { 70 c() { 71 create_component(statustracker.$$.fragment); 72 t = space(); 73 div = element("div"); 74 create_component(markdown.$$.fragment); 75 attr(div, "class", "svelte-1ed2p3z"); 76 toggle_class(div, "pending", /*loading_status*/ ctx[4]?.status === "pending"); 77 }, 78 m(target, anchor) { 79 mount_component(statustracker, target, anchor); 80 insert(target, t, anchor); 81 insert(target, div, anchor); 82 mount_component(markdown, div, null); 83 current = true; 84 }, 85 p(ctx, dirty) { 86 const statustracker_changes = (dirty & /*gradio, loading_status*/ 272) 87 ? get_spread_update(statustracker_spread_levels, [ 88 dirty & /*gradio*/ 256 && { autoscroll: /*gradio*/ ctx[8].autoscroll }, 89 dirty & /*gradio*/ 256 && { i18n: /*gradio*/ ctx[8].i18n }, 90 dirty & /*loading_status*/ 16 && get_spread_object(/*loading_status*/ ctx[4]), 91 statustracker_spread_levels[3] 92 ]) 93 : {}; 94 95 statustracker.$set(statustracker_changes); 96 const markdown_changes = {}; 97 if (dirty & /*loading_status*/ 16) markdown_changes.min_height = /*loading_status*/ ctx[4] && /*loading_status*/ ctx[4].status !== "complete"; 98 if (dirty & /*value*/ 8) markdown_changes.value = /*value*/ ctx[3]; 99 if (dirty & /*elem_classes*/ 2) markdown_changes.elem_classes = /*elem_classes*/ ctx[1]; 100 if (dirty & /*visible*/ 4) markdown_changes.visible = /*visible*/ ctx[2]; 101 if (dirty & /*rtl*/ 32) markdown_changes.rtl = /*rtl*/ ctx[5]; 102 if (dirty & /*latex_delimiters*/ 512) markdown_changes.latex_delimiters = /*latex_delimiters*/ ctx[9]; 103 if (dirty & /*sanitize_html*/ 64) markdown_changes.sanitize_html = /*sanitize_html*/ ctx[6]; 104 if (dirty & /*line_breaks*/ 128) markdown_changes.line_breaks = /*line_breaks*/ ctx[7]; 105 if (dirty & /*header_links*/ 1024) markdown_changes.header_links = /*header_links*/ ctx[10]; 106 markdown.$set(markdown_changes); 107 108 if (!current || dirty & /*loading_status*/ 16) { 109 toggle_class(div, "pending", /*loading_status*/ ctx[4]?.status === "pending"); 110 } 111 }, 112 i(local) { 113 if (current) return; 114 transition_in(statustracker.$$.fragment, local); 115 transition_in(markdown.$$.fragment, local); 116 current = true; 117 }, 118 o(local) { 119 transition_out(statustracker.$$.fragment, local); 120 transition_out(markdown.$$.fragment, local); 121 current = false;
122 }, 123 d(detaching) { 124 if (detaching) { 125 detach(t); 126 detach(div); 127 } 128 129 destroy_component(statustracker, detaching); 130 destroy_component(markdown); 131 } 132 }; 133} 134 135function create_fragment(ctx) { 136 let block; 137 let current; 138 139 block = new Block({ 140 props: { 141 visible: /*visible*/ ctx[2], 142 elem_id: /*elem_id*/ ctx[0], 143 elem_classes: /*elem_classes*/ ctx[1], 144 container: false, 145 allow_overflow: true, 146 $$slots: { default: [create_default_slot] }, 147 $$scope: { ctx } 148 } 149 }); 150 151 return { 152 c() { 153 create_component(block.$$.fragment); 154 }, 155 m(target, anchor) { 156 mount_component(block, target, anchor); 157 current = true; 158 }, 159 p(ctx, [dirty]) { 160 const block_changes = {}; 161 if (dirty & /*visible*/ 4) block_changes.visible = /*visible*/ ctx[2]; 162 if (dirty & /*elem_id*/ 1) block_changes.elem_id = /*elem_id*/ ctx[0]; 163 if (dirty & /*elem_classes*/ 2) block_changes.elem_classes = /*elem_classes*/ ctx[1]; 164 165 if (dirty & /*$$scope, loading_status, value, elem_classes, visible, rtl, latex_delimiters, sanitize_html, line_breaks, header_links, gradio*/ 10238) { 166 block_changes.$$scope = { dirty, ctx }; 167 } 168 169 block.$set(block_changes); 170 }, 171 i(local) { 172 if (current) return; 173 transition_in(block.$$.fragment, local); 174 current = true; 175 }, 176 o(local) { 177 transition_out(block.$$.fragment, local); 178 current = false; 179 }, 180 d(detaching) { 181 destroy_component(block, detaching); 182 } 183 }; 184} 185 186function instance($$self, $$props, $$invalidate) { 187 let { label } = $$props; 188 let { elem_id = "" } = $$props; 189 let { elem_classes = [] } = $$props; 190 let { visible = true } = $$props; 191 let { value = "" } = $$props; 192 let { loading_status } = $$props; 193 let { rtl = false } = $$props; 194 let { sanitize_html = true } = $$props; 195 let { line_breaks = false } = $$props; 196 let { gradio } = $$props; 197 let { latex_delimiters } = $$props; 198 let { header_links = false } = $$props; 199 const change_handler = () => gradio.dispatch("change"); 200 201 $$self.$$set = $$props => {
202 if ('label' in $$props) $$invalidate(11, label = $$props.label); 203 if ('elem_id' in $$props) $$invalidate(0, elem_id = $$props.elem_id); 204 if ('elem_classes' in $$props) $$invalidate(1, elem_classes = $$props.elem_classes); 205 if ('visible' in $$props) $$invalidate(2, visible = $$props.visible); 206 if ('value' in $$props) $$invalidate(3, value = $$props.value); 207 if ('loading_status' in $$props) $$invalidate(4, loading_status = $$props.loading_status); 208 if ('rtl' in $$props) $$invalidate(5, rtl = $$props.rtl); 209 if ('sanitize_html' in $$props) $$invalidate(6, sanitize_html = $$props.sanitize_html); 210 if ('line_breaks' in $$props) $$invalidate(7, line_breaks = $$props.line_breaks); 211 if ('gradio' in $$props) $$invalidate(8, gradio = $$props.gradio); 212 if ('latex_delimiters' in $$props) $$invalidate(9, latex_delimiters = $$props.latex_delimiters); 213 if ('header_links' in $$props) $$invalidate(10, header_links = $$props.header_links); 214 }; 215 216 $$self.$$.update = () => { 217 if ($$self.$$.dirty & /*label, gradio*/ 2304) { 218 (gradio.dispatch("change")); 219 } 220 }; 221 222 return [ 223 elem_id, 224 elem_classes, 225 visible, 226 value, 227 loading_status, 228 rtl, 229 sanitize_html, 230 line_breaks, 231 gradio, 232 latex_delimiters, 233 header_links, 234 label, 235 change_handler 236 ]; 237} 238 239class Index extends SvelteComponent { 240 constructor(options) { 241 super(); 242 243 init(this, options, instance, create_fragment, safe_not_equal, { 244 label: 11, 245 elem_id: 0, 246 elem_classes: 1, 247 visible: 2, 248 value: 3, 249 loading_status: 4, 250 rtl: 5, 251 sanitize_html: 6, 252 line_breaks: 7, 253 gradio: 8, 254 latex_delimiters: 9, 255 header_links: 10 256 }); 257 } 258} 259 260export { Markdown as BaseMarkdown, Index as default }; 261//# sourceMappingURL=Index-1678d762.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.