1import { S as SvelteComponent, i as init, s as safe_not_equal, e as element, U as set_attributes, d as toggle_class, f as insert, u as update_slot_base, q as get_all_dirty_from_scope, r as get_slot_changes, R as get_spread_update, j as transition_in, k as transition_out, n as detach, A as empty, V as getContext, p as create_slot, P as assign } from './index.492dc174.js'; 2import { g as get_styles } from './styles.c72835fa.js'; 3 4/* home/runner/work/gradio/gradio/ui/packages/atoms/src/Block.svelte generated by Svelte v3.49.0 */ 5 6function create_dynamic_element(ctx) { 7 let svelte_element; 8 let svelte_element_class_value; 9 let svelte_element_style_value; 10 let current; 11 const default_slot_template = /*#slots*/ ctx[17].default; 12 const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[16], null); 13 14 let svelte_element_levels = [ 15 { "data-testid": /*test_id*/ ctx[4] }, 16 { id: /*elem_id*/ ctx[0] }, 17 { 18 class: svelte_element_class_value = "gr-block gr-box relative w-full overflow-hidden " + /*styles*/ ctx[10][/*variant*/ ctx[1]] + " " + (/*rounded*/ ctx[6] 19 ? /*styles*/ ctx[10][/*color*/ ctx[2]] 20 : '') + " " + /*classes*/ ctx[9] + " " + /*rounded_style*/ ctx[8] 21 }, 22 { 23 style: svelte_element_style_value = /*size_style*/ ctx[7] || null 24 } 25 ]; 26 27 let svelte_element_data = {}; 28 29 for (let i = 0; i < svelte_element_levels.length; i += 1) { 30 svelte_element_data = assign(svelte_element_data, svelte_element_levels[i]); 31 } 32 33 return { 34 c() { 35 svelte_element = element(/*tag*/ ctx[11]); 36 if (default_slot) default_slot.c(); 37 set_attributes(svelte_element, svelte_element_data); 38 toggle_class(svelte_element, "!hidden", /*visible*/ ctx[5] === false); 39 toggle_class(svelte_element, "gr-panel", /*padding*/ ctx[3]); 40 }, 41 m(target, anchor) { 42 insert(target, svelte_element, anchor); 43 44 if (default_slot) { 45 default_slot.m(svelte_element, null); 46 } 47 48 current = true; 49 }, 50 p(ctx, dirty) { 51 if (default_slot) { 52 if (default_slot.p && (!current || dirty & /*$$scope*/ 65536)) { 53 update_slot_base( 54 default_slot, 55 default_slot_template, 56 ctx, 57 /*$$scope*/ ctx[16], 58 !current 59 ? get_all_dirty_from_scope(/*$$scope*/ ctx[16]) 60 : get_slot_changes(default_slot_template, /*$$scope*/ ctx[16], dirty, null), 61 null 62 ); 63 } 64 } 65 66 set_attributes(svelte_element, svelte_element_data = get_spread_update(svelte_element_levels, [ 67 (!current || dirty & /*test_id*/ 16) && { "data-testid": /*test_id*/ ctx[4] }, 68 (!current || dirty & /*elem_id*/ 1) && { id: /*elem_id*/ ctx[0] }, 69 (!current || dirty & /*variant, rounded, color, classes, rounded_style*/ 838 && svelte_element_class_value !== (svelte_element_class_value = "gr-block gr-box relative w-full overflow-hidden " + /*styles*/ ctx[10][/*variant*/ ctx[1]] + " " + (/*rounded*/ ctx[6] 70 ? /*styles*/ ctx[10][/*color*/ ctx[2]] 71 : '') + " " + /*classes*/ ctx[9] + " " + /*rounded_style*/ ctx[8])) && { class: svelte_element_class_value }, 72 (!current || dirty & /*size_style*/ 128 && svelte_element_style_value !== (svelte_element_style_value = /*size_style*/ ctx[7] || null)) && { style: svelte_element_style_value } 73 ])); 74 75 toggle_class(svelte_element, "!hidden", /*visible*/ ctx[5] === false); 76 toggle_class(svelte_element, "gr-panel", /*padding*/ ctx[3]); 77 }, 78 i(local) { 79 if (current) return; 80 transition_in(default_slot, local); 81 current = true; 82 }, 83 o(local) { 84 transition_out(default_slot, local); 85 current = false; 86 }, 87 d(detaching) { 88 if (detaching) detach(svelte_element); 89 if (default_slot) default_slot.d(detaching); 90 } 91 }; 92} 93 94function create_fragment(ctx) { 95 let previous_tag = /*tag*/ ctx[11]; 96 let svelte_element_anchor; 97 let current; 98 let svelte_element = /*tag*/ ctx[11] && create_dynamic_element(ctx); 99 100 return { 101 c() { 102 if (svelte_element) svelte_element.c(); 103 svelte_element_anchor = empty(); 104 }, 105 m(target, anchor) { 106 if (svelte_element) svelte_element.m(target, anchor); 107 insert(target, svelte_element_anchor, anchor); 108 current = true; 109 }, 110 p(ctx, [dirty]) { 111 if (/*tag*/ ctx[11]) { 112 if (!previous_tag) { 113 svelte_element = create_dynamic_element(ctx); 114 svelte_element.c(); 115 svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor); 116 } else if (safe_not_equal(previous_tag, /*tag*/ ctx[11])) { 117 svelte_element.d(1); 118 svelte_element = create_dynamic_element(ctx); 119 svelte_element.c(); 120 svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor); 121 } else { 122 svelte_element.p(ctx, dirty); 123 } 124 } else if (previous_tag) { 125 svelte_element.d(1); 126 svelte_element = null; 127 } 128 129 previous_tag = /*tag*/ ctx[11]; 130 }, 131 i(local) { 132 if (current) return; 133 transition_in(svelte_element); 134 current = true; 135 }, 136 o(local) { 137 transition_out(svelte_element); 138 current = false;
139 }, 140 d(detaching) { 141 if (detaching) detach(svelte_element_anchor); 142 if (svelte_element) svelte_element.d(detaching); 143 } 144 }; 145} 146 147function instance($$self, $$props, $$invalidate) { 148 let classes; 149 let rounded; 150 let rounded_style; 151 let size_style; 152 let { $$slots: slots = {}, $$scope } = $$props; 153 let { style = {} } = $$props; 154 let { elem_id = "" } = $$props; 155 let { variant = "solid" } = $$props; 156 let { color = "grey" } = $$props; 157 let { padding = true } = $$props; 158 let { type = "normal" } = $$props; 159 let { test_id = undefined } = $$props; 160 let { disable = false } = $$props; 161 let { explicit_call = false } = $$props; 162 let { visible = true } = $$props; 163 164 const styles = { 165 dashed: "border-dashed border border-gray-300", 166 solid: "border-solid border", 167 grey: "border-gray-200", 168 green: "border-green-400", 169 none: "!border-0" 170 }; 171 172 let tag = type === "fieldset" ? "fieldset" : "div"; 173 getContext("BLOCK_KEY"); 174 175 $$self.$$set = $$props => { 176 if ('style' in $$props) $$invalidate(12, style = $$props.style); 177 if ('elem_id' in $$props) $$invali
177date(0, elem_id = $$props.elem_id); 178 if ('variant' in $$props) $$invalidate(1, variant = $$props.variant); 179 if ('color' in $$props) $$invalidate(2, color = $$props.color); 180 if ('padding' in $$props) $$invalidate(3, padding = $$props.padding); 181 if ('type' in $$props) $$invalidate(13, type = $$props.type); 182 if ('test_id' in $$props) $$invalidate(4, test_id = $$props.test_id); 183 if ('disable' in $$props) $$invalidate(14, disable = $$props.disable); 184 if ('explicit_call' in $$props) $$invalidate(15, explicit_call = $$props.explicit_call); 185 if ('visible' in $$props) $$invalidate(5, visible = $$props.visible); 186 if ('$$scope' in $$props) $$invalidate(16, $$scope = $$props.$$scope); 187 }; 188 189 $$self.$$.update = () => { 190 if ($$self.$$.dirty & /*explicit_call, style, disable*/ 53248) { 191 $$invalidate( 192 9, 193 { classes } = explicit_call 194 ? get_styles(style, ["rounded", "border"]) 195 : disable 196 ? get_styles({ container: false }, ["container"]) 197 : { classes: "" }, 198 classes 199 ); 200 } 201 202 if ($$self.$$.dirty & /*style*/ 4096) { 203 $$invalidate(6, rounded = typeof style.rounded !== "boolean" || typeof style.rounded === "boolean" && style.rounded); 204 } 205 206 if ($$self.$$.dirty & /*style, rounded*/ 4160) { 207 $$invalidate(8, rounded_style = typeof style.rounded === "boolean" 208 ? get_styles({ rounded }, ["rounded"]).classes 209 : ""); 210 } 211 212 if ($$self.$$.dirty & /*style*/ 4096) { 213 $$invalidate(7, size_style = "" + (typeof style.height === "number" 214 ? `height: ${style.height}px; ` 215 : "") + (typeof style.width === "number" 216 ? `width: ${style.width}px;` 217 : "")); 218 } 219 }; 220 221 return [ 222 elem_id, 223 variant, 224 color, 225 padding, 226 test_id, 227 visible, 228 rounded, 229 size_style, 230 rounded_style, 231 classes, 232 styles, 233 tag, 234 style, 235 type, 236 disable, 237 explicit_call, 238 $$scope, 239 slots 240 ]; 241} 242 243class Block extends SvelteComponent { 244 constructor(options) { 245 super(); 246 247 init(this, options, instance, create_fragment, safe_not_equal, { 248 style: 12, 249 elem_id: 0, 250 variant: 1, 251 color: 2, 252 padding: 3, 253 type: 13, 254 test_id: 4, 255 disable: 14, 256 explicit_call: 15, 257 visible: 5 258 }); 259 } 260} 261 262export { Block as B };
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.