1import { I as Image } from './Image-90d75330.js'; 2/* empty css */import './file-url-84e08b20.js'; 3import './Index-9d23d982.js'; 4import './index-12d4b00b.js'; 5import './svelte/svelte.js'; 6 7/* home/runner/work/gradio/gradio/js/image/Example.svelte generated by Svelte v4.2.2 */ 8const { 9 SvelteComponent, 10 attr, 11 check_outros, 12 create_component, 13 destroy_component, 14 detach, 15 element, 16 group_outros, 17 init, 18 insert, 19 mount_component, 20 safe_not_equal, 21 toggle_class, 22 transition_in, 23 transition_out 24} = window.__gradio__svelte__internal; 25function create_if_block(ctx) { 26 let image; 27 let current; 28 29 image = new Image({ 30 props: { src: /*value*/ ctx[0].url, alt: "" } 31 }); 32 33 return { 34 c() { 35 create_component(image.$$.fragment); 36 }, 37 m(target, anchor) { 38 mount_component(image, target, anchor); 39 current = true; 40 }, 41 p(ctx, dirty) { 42 const image_changes = {}; 43 if (dirty & /*value*/ 1) image_changes.src = /*value*/ ctx[0].url; 44 image.$set(image_changes); 45 }, 46 i(local) { 47 if (current) return; 48 transition_in(image.$$.fragment, local); 49 current = true; 50 }, 51 o(local) { 52 transition_out(image.$$.fragment, local); 53 current = false; 54 }, 55 d(detaching) { 56 destroy_component(image, detaching); 57 } 58 }; 59} 60 61function create_fragment(ctx) { 62 let div; 63 let current; 64 let if_block = /*value*/ ctx[0] && create_if_block(ctx); 65 66 return { 67 c() { 68 div = element("div"); 69 if (if_block) if_block.c(); 70 attr(div, "class", "container svelte-a9zvka"); 71 toggle_class(div, "table", /*type*/ ctx[1] === "table"); 72 toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery"); 73 toggle_class(div, "selected", /*selected*/ ctx[2]); 74 toggle_class(div, "border", /*value*/ ctx[0]); 75 }, 76 m(target, anchor) { 77 insert(target, div, anchor); 78 if (if_block) if_block.m(div, null); 79 current = true; 80 }, 81 p(ctx, [dirty]) { 82 if (/*value*/ ctx[0]) { 83 if (if_block) { 84 if_block.p(ctx, dirty); 85 86 if (dirty & /*value*/ 1) { 87 transition_in(if_block, 1); 88 } 89 } else { 90 if_block = create_if_block(ctx); 91 if_block.c(); 92 transition_in(if_block, 1); 93 if_block.m(div, null); 94 } 95 } else if (if_block) { 96 group_outros(); 97 98 transition_out(if_block, 1, 1, () => { 99 if_block = null; 100 }); 101 102 check_outros(); 103 } 104 105 if (!current || dirty & /*type*/ 2) { 106 toggle_class(div, "table", /*type*/ ctx[1] === "table"); 107 } 108 109 if (!current || dirty & /*type*/ 2) { 110 toggle_class(div, "gallery", /*type*/ ctx[1] === "gallery"); 111 } 112 113 if (!current || dirty & /*selected*/ 4) { 114 toggle_class(div, "selected", /*selected*/ ctx[2]); 115 } 116 117 if (!current || dirty & /*value*/ 1) { 118 toggle_class(div, "border", /*value*/ ctx[0]); 119 } 120 }, 121 i(local) { 122 if (current) return; 123 transition_in(if_block); 124 current = true; 125 }, 126 o(local) { 127 transition_out(if_block); 128 current = false; 129 }, 130 d(detaching) { 131 if (detaching) { 132 detach(div); 133 } 134 135 if (if_block) if_block.d(); 136 } 137 }; 138} 139 140function instance($$self, $$props, $$invalidate) { 141 let { value } = $$props; 142 let { type } = $$props; 143 let { selected = false } = $$props; 144 145 $$self.$$set = $$props => {
146 if ('value' in $$props) $$invalidate(0, value = $$props.value); 147 if ('type' in $$props) $$invalidate(1, type = $$props.type); 148 if ('selected' in $$props) $$invalidate(2, selected = $$props.selected); 149 }; 150 151 return [value, type, selected]; 152} 153 154class Example extends SvelteComponent { 155 constructor(options) { 156 super(); 157 init(this, options, instance, create_fragment, safe_not_equal, { value: 0, type: 1, selected: 2 }); 158 } 159} 160 161export { Example as default }; 162//# sourceMappingURL=Example-d25c55e3.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.