1import { a as TABS } from './Tabs-71f34096.js'; 2import Index$1 from './Index-24a33ce1.js'; 3import './Index-2cec2c56.js'; 4import './index-5550136d.js'; 5import './svelte/svelte.js'; 6 7const TabItem_svelte_svelte_type_style_lang = ''; 8 9/* home/runner/work/gradio/gradio/js/tabitem/shared/TabItem.svelte generated by Svelte v4.2.2 */ 10const { 11 SvelteComponent: SvelteComponent$1, 12 attr, 13 component_subscribe, 14 create_component: create_component$1, 15 create_slot: create_slot$1, 16 destroy_component: destroy_component$1, 17 detach, 18 element, 19 get_all_dirty_from_scope: get_all_dirty_from_scope$1, 20 get_slot_changes: get_slot_changes$1, 21 init: init$1, 22 insert, 23 mount_component: mount_component$1, 24 safe_not_equal: safe_not_equal$1, 25 set_style, 26 transition_in: transition_in$1, 27 transition_out: transition_out$1, 28 update_slot_base: update_slot_base$1 29} = window.__gradio__svelte__internal; 30const { getContext, onMount, createEventDispatcher, tick } = window.__gradio__svelte__internal; 31function create_default_slot$1(ctx) { 32 let current; 33 const default_slot_template = /*#slots*/ ctx[8].default; 34 const default_slot = create_slot$1(default_slot_template, ctx, /*$$scope*/ ctx[9], null); 35 36 return { 37 c() { 38 if (default_slot) default_slot.c(); 39 }, 40 m(target, anchor) { 41 if (default_slot) { 42 default_slot.m(target, anchor); 43 } 44 45 current = true; 46 }, 47 p(ctx, dirty) { 48 if (default_slot) { 49 if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) { 50 update_slot_base$1( 51 default_slot, 52 default_slot_template, 53 ctx, 54 /*$$scope*/ ctx[9], 55 !current 56 ? get_all_dirty_from_scope$1(/*$$scope*/ ctx[9]) 57 : get_slot_changes$1(default_slot_template, /*$$scope*/ ctx[9], dirty, null), 58 null 59 ); 60 } 61 } 62 }, 63 i(local) { 64 if (current) return; 65 transition_in$1(default_slot, local); 66 current = true; 67 }, 68 o(local) { 69 transition_out$1(default_slot, local); 70 current = false; 71 }, 72 d(detaching) { 73 if (default_slot) default_slot.d(detaching); 74 } 75 }; 76} 77 78function create_fragment$1(ctx) { 79 let div; 80 let column; 81 let div_class_value; 82 let current; 83 84 column = new Index$1({ 85 props: { 86 $$slots: { default: [create_default_slot$1] }, 87 $$scope: { ctx } 88 } 89 }); 90 91 return { 92 c() { 93 div = element("div"); 94 create_component$1(column.$$.fragment); 95 attr(div, "id", /*elem_id*/ ctx[0]); 96 attr(div, "class", div_class_value = "tabitem " + /*elem_classes*/ ctx[1].join(' ') + " svelte-19hvt5v"); 97 98 set_style(div, "display", /*$selected_tab*/ ctx[3] === /*id*/ ctx[2] 99 ? "block" 100 : "none"); 101 }, 102 m(target, anchor) { 103 insert(target, div, anchor); 104 mount_component$1(column, div, null); 105 current = true; 106 }, 107 p(ctx, [dirty]) { 108 const column_changes = {}; 109 110 if (dirty & /*$$scope*/ 512) { 111 column_changes.$$scope = { dirty, ctx }; 112 } 113 114 column.$set(column_changes); 115 116 if (!current || dirty & /*elem_id*/ 1) { 117 attr(div, "id", /*elem_id*/ ctx[0]); 118 } 119 120 if (!current || dirty & /*elem_classes*/ 2 && div_class_value !== (div_class_value = "tabitem " + /*elem_classes*/ ctx[1].join(' ') + " svelte-19hvt5v")) { 121 attr(div, "class", div_class_value); 122 } 123 124 if (dirty & /*$selected_tab, id*/ 12) { 125 set_style(div, "display", /*$selected_tab*/ ctx[3] === /*id*/ ctx[2] 126 ? "block" 127 : "none"); 128 } 129 }, 130 i(local) { 131 if (current) return; 132 transition_in$1(column.$$.fragment, local); 133 current = true; 134 }, 135 o(local) { 136 transition_out$1(column.$$.fragment, local); 137 current = false; 138 }, 139 d(detaching) { 140 if (detaching) { 141 detach(div); 142 } 143 144 destroy_component$1(column); 145 } 146 }; 147} 148 149function instance$1($$self, $$props, $$invalidate) { 150 let $selected_tab_index; 151 let $selected_tab; 152 let { $$slots: slots = {}, $$scope } = $$props; 153 let { elem_id = "" } = $$props; 154 let { elem_classes = [] } = $$props; 155 let { name } = $$props; 156 let { id = {} } = $$props; 157 const dispatch = createEventDispatcher(); 158 const { register_tab, unregister_tab, selected_tab, selected_tab_index } = getContext(TABS); 159 component_subscribe($$self, selected_tab, value => $$invalidate(3, $selected_tab = value)); 160 component_subscribe($$self, selected_tab_index, value =>
160 $$invalidate(7, $selected_tab_index = value)); 161 let tab_index = register_tab({ name, id, elem_id }); 162 163 onMount(() => { 164 return () => unregister_tab({ name, id, elem_id }); 165 }); 166 167 $$self.$$set = $$props => { 168 if ('elem_id' in $$props) $$invalidate(0, elem_id = $$props.elem_id); 169 if ('elem_classes' in $$props) $$invalidate(1, elem_classes = $$props.elem_classes); 170 if ('name' in $$props) $$invalidate(6, name = $$props.name); 171 if ('id' in $$props) $$invalidate(2, id = $$props.id); 172 if ('$$scope' in $$props) $$invalidate(9, $$scope = $$props.$$scope); 173 }; 174 175 $$self.$$.update = () => { 176 if ($$self.$$.dirty & /*$selected_tab_index, name*/ 192) { 177 $selected_tab_index === tab_index && tick().then(() => dispatch("select", { value: name, index: tab_index })); 178 } 179 }; 180 181 return [ 182 elem_id, 183 elem_classes, 184 id, 185 $selected_tab, 186 selected_tab, 187 selected_tab_index, 188 name, 189 $selected_tab_index, 190 slots, 191 $$scope 192 ]; 193} 194 195class TabItem extends SvelteComponent$1 { 196 constructor(options) { 197 super(); 198 199 init$1(this, options, instance$1, create_fragment$1, safe_not_equal$1, { 200 elem_id: 0, 201 elem_classes: 1, 202 name: 6, 203 id: 2 204 }); 205 } 206} 207 208/* home/runner/work/gradio/gradio/js/tabitem/Index.svelte generated by Svelte v4.2.2 */ 209const { 210 SvelteComponent, 211 create_component, 212 create_slot, 213 destroy_component, 214 get_all_dirty_from_scope, 215 get_slot_changes, 216 init, 217 mount_component, 218 safe_not_equal, 219 transition_in, 220 transition_out, 221 update_slot_base 222} = window.__gradio__svelte__internal; 223function create_default_slot(ctx) { 224 let current; 225 const default_slot_template = /*#slots*/ ctx[5].default; 226 const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[7], null); 227 228 return { 229 c() { 230 if (default_slot) default_slot.c(); 231 }, 232 m(target, anchor) { 233 if (default_slot) { 234 default_slot.m(target, anchor); 235 } 236 237 current = true; 238 }, 239 p(ctx, dirty) { 240 if (default_slot) { 241 if (default_slot.p && (!current || dirty & /*$$scope*/ 128)) { 242 update_slot_base( 243 default_slot, 244 default_slot_template, 245 ctx, 246 /*$$scope*/ ctx[7], 247 !current 248 ? get_all_dirty_from_scope(/*$$scope*/ ctx[7]) 249 : get_slot_changes(default_slot_template, /*$$scope*/ ctx[7], dirty, null), 250 null 251 ); 252 } 253 } 254 }, 255 i(local) { 256 if (current) return; 257 transition_in(default_slot, local); 258 current = true; 259 }, 260 o(local) { 261 transition_out(default_slot, local); 262 current = false; 263 }, 264 d(detaching) { 265 if (default_slot) default_slot.d(detaching); 266 } 267 }; 268} 269 270function create_fragment(ctx) { 271 let tabitem; 272 let current; 273 274 tabitem = new TabItem({ 275 props: { 276 elem_id: /*elem_id*/ ctx[0], 277 elem_classes: /*elem_classes*/ ctx[1], 278 name: /*label*/ ctx[2], 279 id: /*id*/ ctx[3], 280 $$slots: { default: [create_default_slot] }, 281 $$scope: { ctx } 282 } 283 }); 284 285 tabitem.$on("select", /*select_handler*/ ctx[6]); 286 287 return { 288 c() { 289 create_component(tabitem.$$.fragment); 290 }, 291 m(target, anchor) { 292 mount_component(tabitem, target, anchor); 293 current = true; 294 }, 295 p(ctx, [dirty]) { 296 const tabitem_changes = {}; 297 if (dirty & /*elem_id*/ 1) tabitem_changes.elem_id = /*elem_id*/ ctx[0]; 298 if (dirty & /*elem_classes*/ 2) tabitem_changes.elem_classes = /*elem_classes*/ ctx[1]; 299 if (dirty & /*label*/ 4) tabitem_changes.name = /*label*/ ctx[2]; 300 if (dirty & /*id*/ 8) tabitem_changes.id = /*id*/ ctx[3]; 301 302 if (dirty & /*$$scope*/ 128) { 303 tabitem_changes.$$scope = { dirty, ctx }; 304 } 305 306 tabitem.$set(tabitem_changes); 307 }, 308 i(local) { 309 if (current) return; 310 transition_in(tabitem.$$.fragment, local); 311 current = true; 312 }, 313 o(local) { 314 transition_out(tabitem.$$.fragment, local); 315 current = false; 316 }, 317 d(detaching) { 318 destroy_component(tabitem, detaching); 319 } 320 }; 321} 322 323function instance($$self, $$props, $$invalidate) { 324 let { $$slots: slots = {}, $$scope } = $$props; 325 let { elem_id = "" } = $$props; 326 let { elem_classes = [] } = $$props; 327 let { label } = $$props; 328 let { id } = $$props; 329 let { gradio } = $$props; 330 const select_handler = ({ detail }) => gradio.dispatch("select", detail); 331 332 $$self.$$set = $$props => {
333 if ('elem_id' in $$props) $$invalidate(0, elem_id = $$props.elem_id); 334 if ('elem_classes' in $$props) $$invalidate(1, elem_classes = $$props.elem_classes); 335 if ('label' in $$props) $$invalidate(2, label = $$props.label); 336 if ('id' in $$props) $$invalidate(3, id = $$props.id); 337 if ('gradio' in $$props) $$invalidate(4, gradio = $$props.gradio); 338 if ('$$scope' in $$props) $$invalidate(7, $$scope = $$props.$$scope); 339 }; 340 341 return [elem_id, elem_classes, label, id, gradio, slots, select_handler, $$scope]; 342} 343 344class Index extends SvelteComponent { 345 constructor(options) { 346 super(); 347 348 init(this, options, instance, create_fragment, safe_not_equal, { 349 elem_id: 0, 350 elem_classes: 1, 351 label: 2, 352 id: 3, 353 gradio: 4 354 }); 355 } 356} 357 358export { Index as default }; 359//# sourceMappingURL=Index-83f3dcd3.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.