1import { S as Static } from './Index-7fdff9d2.js'; 2import { B as Block } from './Button-bd009e9a.js'; 3import { B as BlockLabel } from './BlockLabel-5d99d786.js'; 4import { E as Empty } from './Empty-dc0720f3.js'; 5import './index-10ead756.js'; 6import './svelte/svelte.js'; 7 8/* home/runner/work/gradio/gradio/js/icons/src/LineChart.svelte generated by Svelte v4.2.2 */ 9const { 10 SvelteComponent: SvelteComponent$2, 11 append: append$1, 12 attr: attr$1, 13 detach: detach$2, 14 init: init$2, 15 insert: insert$2, 16 noop: noop$1, 17 safe_not_equal: safe_not_equal$2, 18 svg_element 19} = window.__gradio__svelte__internal; 20function create_fragment$2(ctx) { 21 let svg; 22 let path; 23 24 return { 25 c() { 26 svg = svg_element("svg"); 27 path = svg_element("path"); 28 attr$1(path, "fill", "currentColor"); 29 attr$1(path, "d", "M4 2H2v26a2 2 0 0 0 2 2h26v-2H4v-3h22v-8H4v-4h14V5H4Zm20 17v4H4v-4ZM16 7v4H4V7Z"); 30 attr$1(svg, "xmlns", "http://www.w3.org/2000/svg"); 31 attr$1(svg, "xmlns:xlink", "http://www.w3.org/1999/xlink"); 32 attr$1(svg, "aria-hidden", "true"); 33 attr$1(svg, "role", "img"); 34 attr$1(svg, "class", "iconify iconify--carbon"); 35 attr$1(svg, "width", "100%"); 36 attr$1(svg, "height", "100%"); 37 attr$1(svg, "preserveAspectRatio", "xMidYMid meet"); 38 attr$1(svg, "viewBox", "0 0 32 32"); 39 }, 40 m(target, anchor) { 41 insert$2(target, svg, anchor); 42 append$1(svg, path); 43 }, 44 p: noop$1, 45 i: noop$1, 46 o: noop$1, 47 d(detaching) { 48 if (detaching) { 49 detach$2(svg); 50 } 51 } 52 }; 53} 54 55class LineChart extends SvelteComponent$2 { 56 constructor(options) { 57 super(); 58 init$2(this, options, null, create_fragment$2, safe_not_equal$2, {}); 59 } 60} 61 62const Label_svelte_svelte_type_style_lang = ''; 63 64/* home/runner/work/gradio/gradio/js/label/shared/Label.svelte generated by Svelte v4.2.2 */ 65const { 66 SvelteComponent: SvelteComponent$1, 67 append, 68 attr, 69 destroy_each, 70 detach: detach$1, 71 element, 72 empty: empty$1, 73 ensure_array_like, 74 init: init$1, 75 insert: insert$1, 76 listen, 77 noop, 78 safe_not_equal: safe_not_equal$1, 79 set_data, 80 set_style, 81 space: space$1, 82 text, 83 toggle_class 84} = window.__gradio__svelte__internal; 85const { createEventDispatcher } = window.__gradio__svelte__internal; 86function get_each_context(ctx, list, i) { 87 const child_ctx = ctx.slice(); 88 child_ctx[5] = list[i]; 89 child_ctx[7] = i; 90 return child_ctx; 91} 92 93// (18:1) {#if typeof value === "object" && value.confidences} 94function create_if_block$1(ctx) { 95 let each_1_anchor; 96 let each_value = ensure_array_like(/*value*/ ctx[0].confidences); 97 let each_blocks = []; 98 99 for (let i = 0; i < each_value.length; i += 1) { 100 each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); 101 } 102 103 return { 104 c() { 105 for (let i = 0; i < each_blocks.length; i += 1) { 106 each_blocks[i].c(); 107 } 108 109 each_1_anchor = empty$1(); 110 }, 111 m(target, anchor) { 112 for (let i = 0; i < each_blocks.length; i += 1) { 113 if (each_blocks[i]) { 114 each_blocks[i].m(target, anchor); 115 } 116 } 117 118 insert$1(target, each_1_anchor, anchor); 119 }, 120 p(ctx, dirty) { 121 if (dirty & /*value, selectable, dispatch, Math*/ 13) { 122 each_value = ensure_array_like(/*value*/ ctx[0].confidences); 123 let i; 124 125 for (i = 0; i < each_value.length; i += 1) { 126 const child_ctx = get_each_context(ctx, each_value, i); 127 128 if (each_blocks[i]) { 129 each_blocks[i].p(child_ctx, dirty); 130 } else { 131 each_blocks[i] = create_each_block(child_ctx); 132 each_blocks[i].c(); 133 each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); 134 } 135 } 136 137 for (; i < each_blocks.length; i += 1) { 138 each_blocks[i].d(1); 139 } 140 141 each_blocks.length = each_value.length; 142 } 143 }, 144 d(detaching) { 145 if (detaching) { 146 detach$1(each_1_anchor); 147 } 148 149 destroy_each(each_blocks, detaching); 150 } 151 }; 152} 153 154// (45:6) {#if value.confidences} 155function create_if_block_1$1(ctx) { 156 let div; 157 let dd; 158 let t0_value = Math.round(/*confidence_set*/ ctx[5].confidence * 100) + ""; 159 let t0; 160 let t1; 161 162 return { 163 c() { 164 div = element("div"); 165 dd = element("dd"); 166 t0 = text(t0_value); 167 t1 = text("%"); 168 attr(div, "class", "line svelte-1pq4gst"); 169 attr(dd, "class", "confidence svelte-1pq4gst"); 170 }, 171 m(target, anchor) { 172 insert$1(target, div, anchor); 173 insert$1(target, dd, anchor); 174 append(dd, t0); 175 append(dd, t1); 176 }, 177 p(ctx, dirty) {
178 if (dirty & /*value*/ 1 && t0_value !== (t0_value = Math.round(/*confidence_set*/ ctx[5].confidence * 100) + "")) set_data(t0, t0_value); 179 }, 180 d(detaching) { 181 if (detaching) { 182 detach$1(div); 183 detach$1(dd); 184 } 185 } 186 }; 187} 188 189// (19:2) {#each value.confidences as confidence_set, i} 190function create_each_block(ctx) { 191 let button; 192 let div; 193 let meter; 194 let meter_aria_label_value; 195 let t0; 196 let dl; 197 let dt; 198 let t1_value = /*confidence_set*/ ctx[5].label + ""; 199 let t1; 200 let t2; 201 let dt_id_value; 202 let t3; 203 let button_data_testid_value; 204 let mounted; 205 let dispose; 206 let if_block = /*value*/ ctx[0].confidences && create_if_block_1$1(ctx); 207 208 function click_handler() { 209 return /*click_handler*/ ctx[4](/*i*/ ctx[7], /*confidence_set*/ ctx[5]); 210 } 211 212 return { 213 c() { 214 button = element("button"); 215 div = element("div"); 216 meter = element("meter"); 217 t0 = space$1(); 218 dl = element("dl"); 219 dt = element("dt"); 220 t1 = text(t1_value); 221 t2 = space$1(); 222 if (if_block) if_block.c(); 223 t3 = space$1(); 224 attr(meter, "aria-labelledby", "meter-text"); 225 attr(meter, "class", "bar svelte-1pq4gst"); 226 attr(meter, "min", "0"); 227 attr(meter, "max", "100"); 228 set_style(meter, "width", /*confidence_set*/ ctx[5].confidence * 100 + "%"); 229 set_style(meter, "background", "var(--stat-background-fill)"); 230 meter.value = "100"; 231 attr(meter, "aria-label", meter_aria_label_value = Math.round(/*confidence_set*/ ctx[5].confidence * 100) + "%"); 232 attr(dt, "id", dt_id_value = `meter-text-${/*confidence_set*/ ctx[5].label}`); 233 attr(dt, "class", "text svelte-1pq4gst"); 234 attr(dl, "class", "label svelte-1pq4gst"); 235 attr(div, "class", "inner-wrap svelte-1pq4gst"); 236 attr(button, "class", "confidence-set group svelte-1pq4gst"); 237 attr(button, "data-testid", button_data_testid_value = `${/*confidence_set*/ ctx[5].label}-confidence-set`); 238 toggle_class(button, "selectable", /*selectable*/ ctx[2]); 239 }, 240 m(target, anchor) { 241 insert$1(target, button, anchor); 242 append(button, div); 243 append(div, meter); 244 append(div, t0); 245 append(div, dl); 246 append(dl, dt); 247 append(dt, t1); 248 append(dt, t2); 249 if (if_block) if_block.m(dl, null); 250 append(button, t3); 251 252 if (!mounted) { 253 dispose = listen(button, "click", click_handler); 254 mounted = true; 255 } 256 }, 257 p(new_ctx, dirty) { 258 ctx = new_ctx; 259 260 if (dirty & /*value*/ 1) { 261 set_style(meter, "width", /*confidence_set*/ ctx[5].confidence * 100 + "%"); 262 } 263 264 if (dirty & /*value*/ 1 && meter_aria_label_value !== (meter_aria_label_value = Math.round(/*confidence_set*/ ctx[5].confidence * 100) + "%")) { 265 attr(meter, "aria-label", meter_aria_label_value); 266 } 267 268 if (dirty & /*value*/ 1 && t1_value !== (t1_value = /*confidence_set*/ ctx[5].label + "")) set_data(t1, t1_value); 269 270 if (dirty & /*value*/ 1 && dt_id_value !== (dt_id_value = `meter-text-${/*confidence_set*/ ctx[5].label}`)) { 271 attr(dt, "id", dt_id_value); 272 } 273 274 if (/*value*/ ctx[0].confidences) { 275 if (if_block) { 276 if_block.p(ctx, dirty); 277 } else { 278 if_block = create_if_block_1$1(ctx); 279 if_block.c(); 280 if_block.m(dl, null); 281 } 282 } else if (if_block) { 283 if_block.d(1); 284 if_block = null; 285 } 286 287 if (dirty & /*value*/ 1 && button_data_testid_value !== (button_data_testid_value = `${/*confidence_set*/ ctx[5].label}-confidence-set`)) { 288 attr(button, "data-testid", button_data_testid_value); 289 } 290 291 if (dirty & /*selectable*/ 4) { 292 toggle_class(button, "selectable", /*selectable*/ ctx[2]); 293 } 294 }, 295 d(detaching) { 296 if (detaching) { 297 detach$1(button); 298 } 299 300 if (if_block) if_block.d(); 301 mounted = false; 302 dispose(); 303 } 304 }; 305} 306 307function create_fragment$1(ctx) { 308 let div; 309 let h2; 310 let t0_value = /*value*/ ctx[0].label + ""; 311 let t0; 312 let t1; 313 let if_block = typeof /*value*/ ctx[0] === "object" && /*value*/ ctx[0].confidences && create_if_block$1(ctx); 314 315 return { 316 c() { 317 div = element("div"); 318 h2 = element("h2"); 319 t0 = text(t0_value); 320 t1 = space$1(); 321 if (if_block) if_block.c(); 322 attr(h2, "class", "output-class svelte-1pq4gst"); 323 attr(h2, "data-testid", "label-output-value");
324 toggle_class(h2, "no-confidence", !("confidences" in /*value*/ ctx[0])); 325 set_style(h2, "background-color", /*color*/ ctx[1] || "transparent"); 326 attr(div, "class", "container svelte-1pq4gst"); 327 }, 328 m(target, anchor) { 329 insert$1(target, div, anchor); 330 append(div, h2); 331 append(h2, t0); 332 append(div, t1); 333 if (if_block) if_block.m(div, null); 334 }, 335 p(ctx, [dirty]) { 336 if (dirty & /*value*/ 1 && t0_value !== (t0_value = /*value*/ ctx[0].label + "")) set_data(t0, t0_value); 337 338 if (dirty & /*value*/ 1) { 339 toggle_class(h2, "no-confidence", !("confidences" in /*value*/ ctx[0])); 340 } 341 342 if (dirty & /*color*/ 2) { 343 set_style(h2, "background-color", /*color*/ ctx[1] || "transparent"); 344 } 345 346 if (typeof /*value*/ ctx[0] === "object" && /*value*/ ctx[0].confidences) { 347 if (if_block) { 348 if_block.p(ctx, dirty); 349 } else { 350 if_block = create_if_block$1(ctx); 351 if_block.c(); 352 if_block.m(div, null); 353 } 354 } else if (if_block) { 355 if_block.d(1); 356 if_block = null; 357 } 358 }, 359 i: noop, 360 o: noop, 361 d(detaching) { 362 if (detaching) { 363 detach$1(div); 364 } 365 366 if (if_block) if_block.d(); 367 } 368 }; 369} 370 371function instance$1($$self, $$props, $$invalidate) { 372 let { value } = $$props; 373 const dispatch = createEventDispatcher(); 374 let { color = undefined } = $$props; 375 let { selectable = false } = $$props; 376 377 const click_handler = (i, confidence_set) => { 378 dispatch("select", { index: i, value: confidence_set.label }); 379 }; 380 381 $$self.$$set = $$props => {
382 if ('value' in $$props) $$invalidate(0, value = $$props.value); 383 if ('color' in $$props) $$invalidate(1, color = $$props.color); 384 if ('selectable' in $$props) $$invalidate(2, selectable = $$props.selectable); 385 }; 386 387 return [value, color, selectable, dispatch, click_handler]; 388} 389 390class Label extends SvelteComponent$1 { 391 constructor(options) { 392 super(); 393 init$1(this, options, instance$1, create_fragment$1, safe_not_equal$1, { value: 0, color: 1, selectable: 2 }); 394 } 395} 396 397const Label$1 = Label; 398 399/* home/runner/work/gradio/gradio/js/label/Index.svelte generated by Svelte v4.2.2 */ 400const { 401 SvelteComponent, 402 assign, 403 check_outros, 404 create_component, 405 destroy_component, 406 detach, 407 empty, 408 get_spread_object, 409 get_spread_update, 410 group_outros, 411 init, 412 insert, 413 mount_component, 414 safe_not_equal, 415 space, 416 transition_in, 417 transition_out 418} = window.__gradio__svelte__internal; 419function create_if_block_1(ctx) { 420 let blocklabel; 421 let current; 422 423 blocklabel = new BlockLabel({ 424 props: { 425 Icon: LineChart, 426 label: /*label*/ ctx[6], 427 disable: /*container*/ ctx[7] === false 428 } 429 }); 430 431 return { 432 c() { 433 create_component(blocklabel.$$.fragment); 434 }, 435 m(target, anchor) { 436 mount_component(blocklabel, target, anchor); 437 current = true; 438 }, 439 p(ctx, dirty) { 440 const blocklabel_changes = {}; 441 if (dirty & /*label*/ 64) blocklabel_changes.label = /*label*/ ctx[6]; 442 if (dirty & /*container*/ 128) blocklabel_changes.disable = /*container*/ ctx[7] === false; 443 blocklabel.$set(blocklabel_changes); 444 }, 445 i(local) { 446 if (current) return; 447 transition_in(blocklabel.$$.fragment, local); 448 current = true; 449 }, 450 o(local) { 451 transition_out(blocklabel.$$.fragment, local); 452 current = false; 453 }, 454 d(detaching) { 455 destroy_component(blocklabel, detaching); 456 } 457 }; 458} 459 460// (50:1) {:else} 461function create_else_block(ctx) { 462 let empty_1; 463 let current; 464 465 empty_1 = new Empty({ 466 props: { 467 unpadded_box: true, 468 $$slots: { default: [create_default_slot_1] }, 469 $$scope: { ctx } 470 } 471 }); 472 473 return { 474 c() { 475 create_component(empty_1.$$.fragment); 476 }, 477 m(target, anchor) { 478 mount_component(empty_1, target, anchor); 479 current = true; 480 }, 481 p(ctx, dirty) { 482 const empty_1_changes = {}; 483 484 if (dirty & /*$$scope*/ 65536) { 485 empty_1_changes.$$scope = { dirty, ctx }; 486 } 487 488 empty_1.$set(empty_1_changes); 489 }, 490 i(local) { 491 if (current) return; 492 transition_in(empty_1.$$.fragment, local); 493 current = true; 494 }, 495 o(local) { 496 transition_out(empty_1.$$.fragment, local); 497 current = false; 498 }, 499 d(detaching) { 500 destroy_component(empty_1, detaching); 501 } 502 }; 503} 504 505// (43:1) {#if _label !== undefined && _label !== null} 506function create_if_block(ctx) { 507 let label_1; 508 let current; 509 510 label_1 = new Label$1({ 511 props: { 512 selectable: /*_selectable*/ ctx[12], 513 value: /*value*/ ctx[5], 514 color: /*color*/ ctx[4] 515 } 516 }); 517 518 label_1.$on("select", /*select_handler*/ ctx[15]); 519 520 return { 521 c() { 522 create_component(label_1.$$.fragment); 523 }, 524 m(target, anchor) { 525 mount_component(label_1, target, anchor); 526 current = true; 527 }, 528 p(ctx, dirty) { 529 const label_1_changes = {}; 530 if (dirty & /*_selectable*/ 4096) label_1_changes.selectable = /*_selectable*/ ctx[12]; 531 if (dirty & /*value*/ 32) label_1_changes.value = /*value*/ ctx[5]; 532 if (dirty & /*color*/ 16) label_1_changes.color = /*color*/ ctx[4]; 533 label_1.$set(label_1_changes); 534 }, 535 i(local) { 536 if (current) return; 537 transition_in(label_1.$$.fragment, local); 538 current = true; 539 }, 540 o(local) { 541 transition_out(label_1.$$.fragment, local); 542 current = false; 543 }, 544 d(detaching) { 545 destroy_component(label_1, detaching); 546 } 547 }; 548} 549 550// (51:2) <Empty unpadded_box={true}> 551function create_default_slot_1(ctx) { 552 let labelicon; 553 let current; 554 labelicon = new LineChart({}); 555 556 return { 557 c() { 558 create_component(labelicon.$$.fragment); 559 }, 560 m(target, anchor) { 561 mount_component(labelicon, target, anchor); 562 current = true; 563 }, 564 i(local) { 565 if (current) return; 566 transition_in(labelicon.$$.fragment, local); 567 current = true; 568 }, 569 o(local) { 570 transition_out(labelicon.$$.fragment, local); 571 current = false;
572 }, 573 d(detaching) { 574 destroy_component(labelicon, detaching); 575 } 576 }; 577} 578 579// (25:0) <Block test_id="label" {visible} {elem_id} {elem_classes} {container} {scale} {min_width} padding={false} > 580function create_default_slot(ctx) { 581 let statustracker; 582 let t0; 583 let t1; 584 let current_block_type_index; 585 let if_block1; 586 let if_block1_anchor; 587 let current; 588 589 const statustracker_spread_levels = [ 590 { autoscroll: /*gradio*/ ctx[0].autoscroll }, 591 { i18n: /*gradio*/ ctx[0].i18n }, 592 /*loading_status*/ ctx[10] 593 ]; 594 595 let statustracker_props = {}; 596 597 for (let i = 0; i < statustracker_spread_levels.length; i += 1) { 598 statustracker_props = assign(statustracker_props, statustracker_spread_levels[i]); 599 } 600 601 statustracker = new Static({ props: statustracker_props }); 602 let if_block0 = /*show_label*/ ctx[11] && create_if_block_1(ctx); 603 const if_block_creators = [create_if_block, create_else_block]; 604 const if_blocks = []; 605 606 function select_block_type(ctx, dirty) { 607 if (/*_label*/ ctx[13] !== undefined && /*_label*/ ctx[13] !== null) return 0; 608 return 1; 609 } 610 611 current_block_type_index = select_block_type(ctx); 612 if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); 613 614 return { 615 c() { 616 create_component(statustracker.$$.fragment); 617 t0 = space(); 618 if (if_block0) if_block0.c(); 619 t1 = space(); 620 if_block1.c(); 621 if_block1_anchor = empty(); 622 }, 623 m(target, anchor) { 624 mount_component(statustracker, target, anchor); 625 insert(target, t0, anchor); 626 if (if_block0) if_block0.m(target, anchor); 627 insert(target, t1, anchor); 628 if_blocks[current_block_type_index].m(target, anchor); 629 insert(target, if_block1_anchor, anchor); 630 current = true; 631 }, 632 p(ctx, dirty) { 633 const statustracker_changes = (dirty & /*gradio, loading_status*/ 1025) 634 ? get_spread_update(statustracker_spread_levels, [ 635 dirty & /*gradio*/ 1 && { autoscroll: /*gradio*/ ctx[0].autoscroll }, 636 dirty & /*gradio*/ 1 && { i18n: /*gradio*/ ctx[0].i18n }, 637 dirty & /*loading_status*/ 1024 && get_spread_object(/*loading_status*/ ctx[10]) 638 ]) 639 : {}; 640 641 statustracker.$set(statustracker_changes); 642 643 if (/*show_label*/ ctx[11]) { 644 if (if_block0) { 645 if_block0.p(ctx, dirty); 646 647 if (dirty & /*show_label*/ 2048) { 648 transition_in(if_block0, 1); 649 } 650 } else { 651 if_block0 = create_if_block_1(ctx); 652 if_block0.c(); 653 transition_in(if_block0, 1); 654 if_block0.m(t1.parentNode, t1); 655 } 656 } else if (if_block0) { 657 group_outros(); 658 659 transition_out(if_block0, 1, 1, () => { 660 if_block0 = null; 661 }); 662 663 check_outros(); 664 } 665 666 let previous_block_index = current_block_type_index; 667 current_block_type_index = select_block_type(ctx); 668 669 if (current_block_type_index === previous_block_index) { 670 if_blocks[current_block_type_index].p(ctx, dirty); 671 } else { 672 group_outros(); 673 674 transition_out(if_blocks[previous_block_index], 1, 1, () => { 675 if_blocks[previous_block_index] = null; 676 }); 677 678 check_outros(); 679 if_block1 = if_blocks[current_block_type_index]; 680 681 if (!if_block1) { 682 if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); 683 if_block1.c(); 684 } else { 685 if_block1.p(ctx, dirty); 686 } 687 688 transition_in(if_block1, 1); 689 if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); 690 } 691 }, 692 i(local) { 693 if (current) return; 694 transition_in(statustracker.$$.fragment, local); 695 transition_in(if_block0); 696 transition_in(if_block1); 697 current = true; 698 }, 699 o(local) { 700 transition_out(statustracker.$$.fragment, local); 701 transition_out(if_block0); 702 transition_out(if_block1); 703 current = false; 704 }, 705 d(detaching) { 706 if (detaching) { 707 detach(t0); 708 detach(t1); 709 detach(if_block1_anchor); 710 } 711 712 destroy_component(statustracker, detaching); 713 if (if_block0) if_block0.d(detaching); 714 if_blocks[current_block_type_index].d(detaching); 715 } 716 }; 717} 718 719function create_fragment(ctx) { 720 let block; 721 let current; 722 723 block = new Block({ 724 props: { 725 test_id: "label", 726 visible: /*visible*/ ctx[3], 727 elem_id: /*elem_id*/ ctx[1], 728 elem_classes: /*elem_classes*/ ctx[2], 729 container: /*container*/ ctx[7], 730 scale: /*scale*/ ctx[8], 731 min_width: /*min_width*/ ctx[9], 732 padding: false, 733 $$slots: { default: [create_default_slot] }, 734 $$scope: { ctx } 735 } 736 }); 737 738 return { 739 c() { 740 create_component(block.$$.fragment); 741 }, 742 m(target, anchor) { 743 mount_component(block, target, anchor); 744 current = true; 745 }, 746 p(ctx, [dirty]) { 747 const block_changes = {};
748 if (dirty & /*visible*/ 8) block_changes.visible = /*visible*/ ctx[3]; 749 if (dirty & /*elem_id*/ 2) block_changes.elem_id = /*elem_id*/ ctx[1]; 750 if (dirty & /*elem_classes*/ 4) block_changes.elem_classes = /*elem_classes*/ ctx[2]; 751 if (dirty & /*container*/ 128) block_changes.container = /*container*/ ctx[7]; 752 if (dirty & /*scale*/ 256) block_changes.scale = /*scale*/ ctx[8]; 753 if (dirty & /*min_width*/ 512) block_changes.min_width = /*min_width*/ ctx[9]; 754 755 if (dirty & /*$$scope, _selectable, value, color, gradio, _label, label, container, show_label, loading_status*/ 81137) { 756 block_changes.$$scope = { dirty, ctx }; 757 } 758 759 block.$set(block_changes); 760 }, 761 i(local) { 762 if (current) return; 763 transition_in(block.$$.fragment, local); 764 current = true; 765 }, 766 o(local) { 767 transition_out(block.$$.fragment, local); 768 current = false; 769 }, 770 d(detaching) { 771 destroy_component(block, detaching); 772 } 773 }; 774} 775 776function instance($$self, $$props, $$invalidate) { 777 let confidences; 778 let _label; 779 let { gradio } = $$props; 780 let { elem_id = "" } = $$props; 781 let { elem_classes = [] } = $$props; 782 let { visible = true } = $$props; 783 let { color = undefined } = $$props; 784 let { value = {} } = $$props; 785 let { label = gradio.i18n("label.label") } = $$props; 786 let { container = true } = $$props; 787 let { scale = null } = $$props; 788 let { min_width = undefined } = $$props; 789 let { loading_status } = $$props; 790 let { show_label = true } = $$props; 791 let { _selectable = false } = $$props; 792 const select_handler = ({ detail }) => gradio.dispatch("select", detail); 793 794 $$self.$$set = $$props => {
795 if ('gradio' in $$props) $$invalidate(0, gradio = $$props.gradio); 796 if ('elem_id' in $$props) $$invalidate(1, elem_id = $$props.elem_id); 797 if ('elem_classes' in $$props) $$invalidate(2, elem_classes = $$props.elem_classes); 798 if ('visible' in $$props) $$invalidate(3, visible = $$props.visible); 799 if ('color' in $$props) $$invalidate(4, color = $$props.color); 800 if ('value' in $$props) $$invalidate(5, value = $$props.value); 801 if ('label' in $$props) $$invalidate(6, label = $$props.label); 802 if ('container' in $$props) $$invalidate(7, container = $$props.container); 803 if ('scale' in $$props) $$invalidate(8, scale = $$props.scale); 804 if ('min_width' in $$props) $$invalidate(9, min_width = $$props.min_width); 805 if ('loading_status' in $$props) $$invalidate(10, loading_status = $$props.loading_status); 806 if ('show_label' in $$props) $$invalidate(11, show_label = $$props.show_label); 807 if ('_selectable' in $$props) $$invalidate(12, _selectable = $$props._selectable); 808 }; 809 810 $$self.$$.update = () => { 811 if ($$self.$$.dirty & /*value*/ 32) { 812 $$invalidate(14, { confidences, label: _label } = value, confidences, ($$invalidate(13, _label), $$invalidate(5, value))); 813 } 814 815 if ($$self.$$.dirty & /*_label, confidences, gradio*/ 24577) { 816 (gradio.dispatch("change")); 817 } 818 }; 819 820 return [ 821 gradio, 822 elem_id, 823 elem_classes, 824 visible, 825 color, 826 value, 827 label, 828 container, 829 scale, 830 min_width, 831 loading_status, 832 show_label, 833 _selectable, 834 _label, 835 confidences, 836 select_handler 837 ]; 838} 839 840class Index extends SvelteComponent { 841 constructor(options) { 842 super(); 843 844 init(this, options, instance, create_fragment, safe_not_equal, { 845 gradio: 0, 846 elem_id: 1, 847 elem_classes: 2, 848 visible: 3, 849 color: 4, 850 value: 5, 851 label: 6, 852 container: 7, 853 scale: 8, 854 min_width: 9, 855 loading_status: 10, 856 show_label: 11, 857 _selectable: 12 858 }); 859 } 860} 861 862export { Label$1 as BaseLabel, Index as default }; 863//# sourceMappingURL=Index-0d5b04e1.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.