1import { S as SvelteComponent, i as init, s as safe_not_equal, f as element, h as text, b as attr, c as insert, d as append, j as set_data, n as noop, e as detach, k as empty, a9 as onMount, D as binding_callbacks, H as src_url_equal, l as listen, g as is_function, r as run_all, m as space, o as destroy_each, Y as set_style, t as toggle_class, v as transition_in, w as transition_out, A as createEventDispatcher, y as group_outros, x as destroy_component, z as check_outros, q as create_component, u as mount_component } from './index.230aa104.js'; 2import { E as ExampleImage } from './Image.a2b3c088.js'; 3import { E as ExampleModel3D } from './Model3D.46df4dc6.js'; 4 5/* src/components/Dataset/ExampleComponents/Number.svelte generated by Svelte v3.49.0 */ 6 7function create_fragment$c(ctx) { 8 let div; 9 let t; 10 11 return { 12 c() { 13 div = element("div"); 14 t = text(/*value*/ ctx[0]); 15 attr(div, "class", "gr-sample-number"); 16 }, 17 m(target, anchor) { 18 insert(target, div, anchor); 19 append(div, t); 20 }, 21 p(ctx, [dirty]) { 22 if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]); 23 }, 24 i: noop, 25 o: noop, 26 d(detaching) { 27 if (detaching) detach(div); 28 } 29 }; 30} 31 32function instance$c($$self, $$props, $$invalidate) { 33 let { value } = $$props; 34 35 $$self.$$set = $$props => {
36 if ('value' in $$props) $$invalidate(0, value = $$props.value); 37 }; 38 39 return [value]; 40} 41 42class Number extends SvelteComponent { 43 constructor(options) { 44 super(); 45 init(this, options, instance$c, create_fragment$c, safe_not_equal, { value: 0 }); 46 } 47} 48 49/* src/components/Dataset/ExampleComponents/Dropdown.svelte generated by Svelte v3.49.0 */ 50 51function create_fragment$b(ctx) { 52 let div; 53 let t; 54 55 return { 56 c() { 57 div = element("div"); 58 t = text(/*value*/ ctx[0]); 59 attr(div, "class", "gr-sample-dropdown"); 60 }, 61 m(target, anchor) { 62 insert(target, div, anchor); 63 append(div, t); 64 }, 65 p(ctx, [dirty]) { 66 if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]); 67 }, 68 i: noop, 69 o: noop, 70 d(detaching) { 71 if (detaching) detach(div); 72 } 73 }; 74} 75 76function instance$b($$self, $$props, $$invalidate) { 77 let { value } = $$props; 78 79 $$self.$$set = $$props => { 80 if ('value' in $$props) $$invalidate(0, value = $$props.value); 81 }; 82 83 return [value]; 84} 85 86class Dropdown extends SvelteComponent { 87 constructor(options) { 88 super(); 89 init(this, options, instance$b, create_fragment$b, safe_not_equal, { value: 0 }); 90 } 91} 92 93/* src/components/Dataset/ExampleComponents/Checkbox.svelte generated by Svelte v3.49.0 */ 94 95function create_fragment$a(ctx) { 96 let div; 97 let t_value = /*value*/ ctx[0].toLocaleString() + ""; 98 let t; 99 100 return { 101 c() { 102 div = element("div"); 103 t = text(t_value); 104 attr(div, "class", "gr-sample-checkbox"); 105 }, 106 m(target, anchor) { 107 insert(target, div, anchor); 108 append(div, t); 109 }, 110 p(ctx, [dirty]) { 111 if (dirty & /*value*/ 1 && t_value !== (t_value = /*value*/ ctx[0].toLocaleString() + "")) set_data(t, t_value); 112 }, 113 i: noop, 114 o: noop, 115 d(detaching) { 116 if (detaching) detach(div); 117 } 118 }; 119} 120 121function instance$a($$self, $$props, $$invalidate) { 122 let { value } = $$props; 123 124 $$self.$$set = $$props => {
125 if ('value' in $$props) $$invalidate(0, value = $$props.value); 126 }; 127 128 return [value]; 129} 130 131class Checkbox extends SvelteComponent { 132 constructor(options) { 133 super(); 134 init(this, options, instance$a, create_fragment$a, safe_not_equal, { value: 0 }); 135 } 136} 137 138/* src/components/Dataset/ExampleComponents/CheckboxGroup.svelte generated by Svelte v3.49.0 */ 139 140function create_fragment$9(ctx) { 141 let div; 142 let t_value = /*value*/ ctx[0].join(", ") + ""; 143 let t; 144 145 return { 146 c() { 147 div = element("div"); 148 t = text(t_value); 149 attr(div, "class", "gr-sample-checkboxgroup"); 150 }, 151 m(target, anchor) { 152 insert(target, div, anchor); 153 append(div, t); 154 }, 155 p(ctx, [dirty]) { 156 if (dirty & /*value*/ 1 && t_value !== (t_value = /*value*/ ctx[0].join(", ") + "")) set_data(t, t_value); 157 }, 158 i: noop, 159 o: noop, 160 d(detaching) { 161 if (detaching) detach(div); 162 } 163 }; 164} 165 166function instance$9($$self, $$props, $$invalidate) { 167 let { value } = $$props; 168 169 $$self.$$set = $$props => { 170 if ('value' in $$props) $$invalidate(0, value = $$props.value); 171 }; 172 173 return [value]; 174} 175 176class CheckboxGroup extends SvelteComponent { 177 constructor(options) { 178 super(); 179 init(this, options, instance$9, create_fragment$9, safe_not_equal, { value: 0 }); 180 } 181} 182 183/* src/components/Dataset/ExampleComponents/Slider.svelte generated by Svelte v3.49.0 */ 184 185function create_fragment$8(ctx) { 186 let div; 187 let t; 188 189 return { 190 c() { 191 div = element("div"); 192 t = text(/*value*/ ctx[0]); 193 attr(div, "class", "gr-sample-slider"); 194 }, 195 m(target, anchor) { 196 insert(target, div, anchor); 197 append(div, t); 198 }, 199 p(ctx, [dirty]) { 200 if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]); 201 }, 202 i: noop, 203 o: noop, 204 d(detaching) { 205 if (detaching) detach(div); 206 } 207 }; 208} 209 210function instance$8($$self, $$props, $$invalidate) { 211 let { value } = $$props; 212 213 $$self.$$set = $$props => {
214 if ('value' in $$props) $$invalidate(0, value = $$props.value); 215 }; 216 217 return [value]; 218} 219 220class Slider extends SvelteComponent { 221 constructor(options) { 222 super(); 223 init(this, options, instance$8, create_fragment$8, safe_not_equal, { value: 0 }); 224 } 225} 226 227/* src/components/Dataset/ExampleComponents/Radio.svelte generated by Svelte v3.49.0 */ 228 229function create_fragment$7(ctx) { 230 let div; 231 let t; 232 233 return { 234 c() { 235 div = element("div"); 236 t = text(/*value*/ ctx[0]); 237 attr(div, "class", "gr-sample-radio"); 238 }, 239 m(target, anchor) { 240 insert(target, div, anchor); 241 append(div, t); 242 }, 243 p(ctx, [dirty]) { 244 if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]); 245 }, 246 i: noop, 247 o: noop, 248 d(detaching) { 249 if (detaching) detach(div); 250 } 251 }; 252} 253 254function instance$7($$self, $$props, $$invalidate) { 255 let { value } = $$props; 256 257 $$self.$$set = $$props => { 258 if ('value' in $$props) $$invalidate(0, value = $$props.value); 259 }; 260 261 return [value]; 262} 263 264class Radio extends SvelteComponent { 265 constructor(options) { 266 super(); 267 init(this, options, instance$7, create_fragment$7, safe_not_equal, { value: 0 }); 268 } 269} 270 271/* src/components/Dataset/ExampleComponents/Textbox.svelte generated by Svelte v3.49.0 */ 272 273function create_fragment$6(ctx) { 274 let div; 275 let t; 276 277 return { 278 c() { 279 div = element("div"); 280 t = text(/*value*/ ctx[0]); 281 attr(div, "class", "gr-sample-textbox"); 282 }, 283 m(target, anchor) { 284 insert(target, div, anchor); 285 append(div, t); 286 }, 287 p(ctx, [dirty]) { 288 if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]); 289 }, 290 i: noop, 291 o: noop, 292 d(detaching) { 293 if (detaching) detach(div); 294 } 295 }; 296} 297 298function instance$6($$self, $$props, $$invalidate) { 299 let { value } = $$props; 300 301 $$self.$$set = $$props => {
302 if ('value' in $$props) $$invalidate(0, value = $$props.value); 303 }; 304 305 return [value]; 306} 307 308class Textbox extends SvelteComponent { 309 constructor(options) { 310 super(); 311 init(this, options, instance$6, create_fragment$6, safe_not_equal, { value: 0 }); 312 } 313} 314 315/* src/components/Dataset/ExampleComponents/Audio.svelte generated by Svelte v3.49.0 */ 316 317function create_fragment$5(ctx) { 318 let div; 319 let t; 320 321 return { 322 c() { 323 div = element("div"); 324 t = text(/*value*/ ctx[0]); 325 attr(div, "class", "gr-sample-audio"); 326 }, 327 m(target, anchor) { 328 insert(target, div, anchor); 329 append(div, t); 330 }, 331 p(ctx, [dirty]) { 332 if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]); 333 }, 334 i: noop, 335 o: noop, 336 d(detaching) { 337 if (detaching) detach(div); 338 } 339 }; 340} 341 342function instance$5($$self, $$props, $$invalidate) { 343 let { value } = $$props; 344 345 $$self.$$set = $$props => { 346 if ('value' in $$props) $$invalidate(0, value = $$props.value); 347 }; 348 349 return [value]; 350} 351 352class Audio extends SvelteComponent { 353 constructor(options) { 354 super(); 355 init(this, options, instance$5, create_fragment$5, safe_not_equal, { value: 0 }); 356 } 357} 358 359/* src/components/Dataset/ExampleComponents/Video.svelte generated by Svelte v3.49.0 */ 360 361// (18:0) {#if playable()} 362function create_if_block$2(ctx) { 363 let video_1; 364 let video_1_src_value; 365 let mounted; 366 let dispose; 367 368 return { 369 c() { 370 video_1 = element("video"); 371 video_1.muted = true; 372 video_1.playsInline = true; 373 attr(video_1, "class", "gr-sample-video"); 374 if (!src_url_equal(video_1.src, video_1_src_value = /*samples_dir*/ ctx[1] + /*value*/ ctx[0])) attr(video_1, "src", video_1_src_value); 375 }, 376 m(target, anchor) { 377 insert(target, video_1, anchor); 378 /*video_1_binding*/ ctx[3](video_1); 379 380 if (!mounted) { 381 dispose = [ 382 listen(video_1, "mouseover", function () { 383 if (is_function(/*video*/ ctx[2].play)) /*video*/ ctx[2].play.apply(this, arguments); 384 }), 385 listen(video_1, "mouseout", function () { 386 if (is_function(/*video*/ ctx[2].pause)) /*video*/ ctx[2].pause.apply(this, arguments); 387 }) 388 ]; 389 390 mounted = true; 391 } 392 }, 393 p(new_ctx, dirty) { 394 ctx = new_ctx; 395 396 if (dirty & /*samples_dir, value*/ 3 && !src_url_equal(video_1.src, video_1_src_value = /*samples_dir*/ ctx[1] + /*value*/ ctx[0])) { 397 attr(video_1, "src", video_1_src_value); 398 } 399 }, 400 d(detaching) { 401 if (detaching) detach(video_1); 402 /*video_1_binding*/ ctx[3](null); 403 mounted = false; 404 run_all(dispose); 405 } 406 }; 407} 408 409function create_fragment$4(ctx) { 410 let if_block_anchor; 411 412 function select_block_type(ctx, dirty) { 413 return create_if_block$2; 414 } 415 416 let current_block_type = select_block_type(); 417 let if_block = current_block_type(ctx); 418 419 return { 420 c() { 421 if_block.c(); 422 if_block_anchor = empty(); 423 }, 424 m(target, anchor) { 425 if_block.m(target, anchor); 426 insert(target, if_block_anchor, anchor); 427 }, 428 p(ctx, [dirty]) { 429 if_block.p(ctx, dirty); 430 }, 431 i: noop, 432 o: noop, 433 d(detaching) { 434 if_block.d(detaching); 435 if (detaching) detach(if_block_anchor); 436 } 437 }; 438} 439 440function instance$4($$self, $$props, $$invalidate) { 441 let { value } = $$props; 442 let { samples_dir } = $$props; 443 let video; 444 445 onMount(() => { 446 $$invalidate(2, video.muted = true, video); 447 $$invalidate(2, video.playsInline = true, video); 448 $$invalidate(2, video.controls = false, video); 449 video.setAttribute("muted", ""); 450 video.play(); 451 video.pause(); 452 }); 453 454 function video_1_binding($$value) { 455 binding_callbacks[$$value ? 'unshift' : 'push'](() => { 456 video = $$value; 457 $$invalidate(2, video); 458 }); 459 } 460 461 $$self.$$set = $$props => {
462 if ('value' in $$props) $$invalidate(0, value = $$props.value); 463 if ('samples_dir' in $$props) $$invalidate(1, samples_dir = $$props.samples_dir); 464 }; 465 466 return [value, samples_dir, video, video_1_binding]; 467} 468 469class Video extends SvelteComponent { 470 constructor(options) { 471 super(); 472 init(this, options, instance$4, create_fragment$4, safe_not_equal, { value: 0, samples_dir: 1 }); 473 } 474} 475 476/* src/components/Dataset/ExampleComponents/File.svelte generated by Svelte v3.49.0 */ 477 478function create_fragment$3(ctx) { 479 let div; 480 let t; 481 482 return { 483 c() { 484 div = element("div"); 485 t = text(/*value*/ ctx[0]); 486 attr(div, "class", "truncate"); 487 }, 488 m(target, anchor) { 489 insert(target, div, anchor); 490 append(div, t); 491 }, 492 p(ctx, [dirty]) { 493 if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]); 494 }, 495 i: noop, 496 o: noop, 497 d(detaching) { 498 if (detaching) detach(div); 499 } 500 }; 501} 502 503function instance$3($$self, $$props, $$invalidate) { 504 let { value } = $$props; 505 506 $$self.$$set = $$props => { 507 if ('value' in $$props) $$invalidate(0, value = $$props.value); 508 }; 509 510 return [value]; 511} 512 513class File extends SvelteComponent { 514 constructor(options) { 515 super(); 516 init(this, options, instance$3, create_fragment$3, safe_not_equal, { value: 0 }); 517 } 518} 519 520/* src/components/Dataset/ExampleComponents/Dataframe.svelte generated by Svelte v3.49.0 */ 521 522function get_each_context$1(ctx, list, i) { 523 const child_ctx = ctx.slice(); 524 child_ctx[1] = list[i]; 525 return child_ctx; 526} 527 528function get_each_context_1$1(ctx, list, i) { 529 const child_ctx = ctx.slice(); 530 child_ctx[4] = list[i]; 531 return child_ctx; 532} 533 534function get_each_context_2$1(ctx, list, i) { 535 const child_ctx = ctx.slice(); 536 child_ctx[7] = list[i]; 537 return child_ctx; 538} 539 540// (7:3) {#each row.slice(0, 3) as cell} 541function create_each_block_2$1(ctx) { 542 let td; 543 let t_value = /*cell*/ ctx[7] + ""; 544 let t; 545 546 return { 547 c() { 548 td = element("td"); 549 t = text(t_value); 550 attr(td, "class", "p-2"); 551 }, 552 m(target, anchor) { 553 insert(target, td, anchor); 554 append(td, t); 555 }, 556 p(ctx, dirty) { 557 if (dirty & /*value*/ 1 && t_value !== (t_value = /*cell*/ ctx[7] + "")) set_data(t, t_value); 558 }, 559 d(detaching) { 560 if (detaching) detach(td); 561 } 562 }; 563} 564 565// (10:3) {#if row.length > 3} 566function create_if_block_1$1(ctx) { 567 let td; 568 569 return { 570 c() { 571 td = element("td"); 572 td.textContent = "..."; 573 attr(td, "class", "p-2"); 574 }, 575 m(target, anchor) { 576 insert(target, td, anchor); 577 }, 578 d(detaching) { 579 if (detaching) detach(td); 580 } 581 }; 582} 583 584// (5:1) {#each value.slice(0, 3) as row} 585function create_each_block_1$1(ctx) { 586 let tr; 587 let t; 588 let each_value_2 = /*row*/ ctx[4].slice(0, 3); 589 let each_blocks = []; 590 591 for (let i = 0; i < each_value_2.length; i += 1) { 592 each_blocks[i] = create_each_block_2$1(get_each_context_2$1(ctx, each_value_2, i)); 593 } 594 595 let if_block = /*row*/ ctx[4].length > 3 && create_if_block_1$1(); 596 597 return { 598 c() { 599 tr = element("tr"); 600 601 for (let i = 0; i < each_blocks.length; i += 1) { 602 each_blocks[i].c(); 603 } 604 605 t = space(); 606 if (if_block) if_block.c(); 607 }, 608 m(target, anchor) { 609 insert(target, tr, anchor); 610 611 for (let i = 0; i < each_blocks.length; i += 1) { 612 each_blocks[i].m(tr, null); 613 } 614 615 append(tr, t); 616 if (if_block) if_block.m(tr, null); 617 }, 618 p(ctx, dirty) { 619 if (dirty & /*value*/ 1) { 620 each_value_2 = /*row*/ ctx[4].slice(0, 3); 621 let i; 622 623 for (i = 0; i < each_value_2.length; i += 1) { 624 const child_ctx = get_each_context_2$1(ctx, each_value_2, i); 625 626 if (each_blocks[i]) { 627 each_blocks[i].p(child_ctx, dirty); 628 } else { 629 each_blocks[i] = create_each_block_2$1(child_ctx); 630 each_blocks[i].c(); 631 each_blocks[i].m(tr, t); 632 } 633 } 634 635 for (; i < each_blocks.length; i += 1) { 636 each_blocks[i].d(1); 637 } 638 639 each_blocks.length = each_value_2.length; 640 } 641 642 if (/*row*/ ctx[4].length > 3) { 643 if (if_block) ; else { 644 if_block = create_if_block_1$1(); 645 if_block.c(); 646 if_block.m(tr, null); 647 } 648 } else if (if_block) { 649 if_block.d(1); 650 if_block = null; 651 } 652 }, 653 d(detaching) { 654 if (detaching) detach(tr); 655 destroy_each(each_blocks, detaching); 656 if (if_block) if_block.d(); 657 } 658 }; 659} 660 661// (15:1) {#if value.length > 3} 662function create_if_block$1(ctx) { 663 let tr; 664 let each_value = Array(Math.min(4, /*value*/ ctx[0][0].length)); 665 let each_blocks = []; 666 667 for (let i = 0; i < each_value.length; i += 1) { 668 each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); 669 } 670 671 return { 672 c() { 673 tr = element("tr"); 674 675 for (let i = 0; i < each_blocks.length; i += 1) { 676 each_blocks[i].c(); 677 } 678 }, 679 m(target, anchor) { 680 insert(target, tr, anchor); 681 682 for (let i = 0; i < each_blocks.length; i += 1) { 683 each_blocks[i].m(tr, null); 684 } 685 }, 686 p(ctx, dirty) {
687 if (dirty & /*value*/ 1) { 688 each_value = Array(Math.min(4, /*value*/ ctx[0][0].length)); 689 let i; 690 691 for (i = 0; i < each_value.length; i += 1) { 692 const child_ctx = get_each_context$1(ctx, each_value, i); 693 694 if (each_blocks[i]) { 695 each_blocks[i].p(child_ctx, dirty); 696 } else { 697 each_blocks[i] = create_each_block$1(); 698 each_blocks[i].c(); 699 each_blocks[i].m(tr, null); 700 } 701 } 702 703 for (; i < each_blocks.length; i += 1) { 704 each_blocks[i].d(1); 705 } 706 707 each_blocks.length = each_value.length; 708 } 709 }, 710 d(detaching) { 711 if (detaching) detach(tr); 712 destroy_each(each_blocks, detaching); 713 } 714 }; 715} 716 717// (17:3) {#each Array(Math.min(4, value[0].length)) as _} 718function create_each_block$1(ctx) { 719 let td; 720 721 return { 722 c() { 723 td = element("td"); 724 td.textContent = "..."; 725 attr(td, "class", "p-2"); 726 }, 727 m(target, anchor) { 728 insert(target, td, anchor); 729 }, 730 p: noop, 731 d(detaching) { 732 if (detaching) detach(td); 733 } 734 }; 735} 736 737function create_fragment$2(ctx) { 738 let table; 739 let t; 740 let each_value_1 = /*value*/ ctx[0].slice(0, 3); 741 let each_blocks = []; 742 743 for (let i = 0; i < each_value_1.length; i += 1) { 744 each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i)); 745 } 746 747 let if_block = /*value*/ ctx[0].length > 3 && create_if_block$1(ctx); 748 749 return { 750 c() { 751 table = element("table"); 752 753 for (let i = 0; i < each_blocks.length; i += 1) { 754 each_blocks[i].c(); 755 } 756 757 t = space(); 758 if (if_block) if_block.c(); 759 attr(table, "class", "gr-sample-dataframe"); 760 }, 761 m(target, anchor) { 762 insert(target, table, anchor); 763 764 for (let i = 0; i < each_blocks.length; i += 1) { 765 each_blocks[i].m(table, null); 766 } 767 768 append(table, t); 769 if (if_block) if_block.m(table, null); 770 }, 771 p(ctx, [dirty]) { 772 if (dirty & /*value*/ 1) { 773 each_value_1 = /*value*/ ctx[0].slice(0, 3); 774 let i; 775 776 for (i = 0; i < each_value_1.length; i += 1) { 777 const child_ctx = get_each_context_1$1(ctx, each_value_1, i); 778 779 if (each_blocks[i]) { 780 each_blocks[i].p(child_ctx, dirty); 781 } else { 782 each_blocks[i] = create_each_block_1$1(child_ctx); 783 each_blocks[i].c(); 784 each_blocks[i].m(table, t); 785 } 786 } 787 788 for (; i < each_blocks.length; i += 1) { 789 each_blocks[i].d(1); 790 } 791 792 each_blocks.length = each_value_1.length; 793 } 794 795 if (/*value*/ ctx[0].length > 3) { 796 if (if_block) { 797 if_block.p(ctx, dirty); 798 } else { 799 if_block = create_if_block$1(ctx); 800 if_block.c(); 801 if_block.m(table, null); 802 } 803 } else if (if_block) { 804 if_block.d(1); 805 if_block = null; 806 } 807 }, 808 i: noop, 809 o: noop, 810 d(detaching) { 811 if (detaching) detach(table); 812 destroy_each(each_blocks, detaching); 813 if (if_block) if_block.d(); 814 } 815 }; 816} 817 818function instance$2($$self, $$props, $$invalidate) { 819 let { value } = $$props; 820 821 $$self.$$set = $$props => {
822 if ('value' in $$props) $$invalidate(0, value = $$props.value); 823 }; 824 825 return [value]; 826} 827 828class Dataframe extends SvelteComponent { 829 constructor(options) { 830 super(); 831 init(this, options, instance$2, create_fragment$2, safe_not_equal, { value: 0 }); 832 } 833} 834 835/* src/components/Dataset/ExampleComponents/ColorPicker.svelte generated by Svelte v3.49.0 */ 836 837function create_fragment$1(ctx) { 838 let div; 839 840 return { 841 c() { 842 div = element("div"); 843 attr(div, "class", "w-10 h-10 border dark:border-slate-300"); 844 set_style(div, "background-color", /*value*/ ctx[0]); 845 }, 846 m(target, anchor) { 847 insert(target, div, anchor); 848 }, 849 p(ctx, [dirty]) { 850 if (dirty & /*value*/ 1) { 851 set_style(div, "background-color", /*value*/ ctx[0]); 852 } 853 }, 854 i: noop, 855 o: noop, 856 d(detaching) { 857 if (detaching) detach(div); 858 } 859 }; 860} 861 862function instance$1($$self, $$props, $$invalidate) { 863 let { value } = $$props; 864 865 $$self.$$set = $$props => { 866 if ('value' in $$props) $$invalidate(0, value = $$props.value); 867 }; 868 869 return [value]; 870} 871 872class ColorPicker extends SvelteComponent { 873 constructor(options) { 874 super(); 875 init(this, options, instance$1, create_fragment$1, safe_not_equal, { value: 0 }); 876 } 877} 878 879const component_map = { 880 dropdown: Dropdown,
881 checkbox: Checkbox, 882 checkboxgroup: CheckboxGroup, 883 number: Number, 884 slider: Slider, 885 radio: Radio, 886 image: ExampleImage, 887 textbox: Textbox, 888 audio: Audio, 889 video: Video, 890 file: File, 891 dataframe: Dataframe, 892 model3d: ExampleModel3D, 893 colorpicker: ColorPicker 894}; 895 896/* src/components/Dataset/Dataset.svelte generated by Svelte v3.49.0 */ 897 898function get_each_context(ctx, list, i) { 899 const child_ctx = ctx.slice(); 900 child_ctx[20] = list[i]; 901 return child_ctx; 902} 903 904function get_each_context_2(ctx, list, i) { 905 const child_ctx = ctx.slice(); 906 child_ctx[23] = list[i]; 907 child_ctx[25] = i; 908 return child_ctx; 909} 910 911function get_each_context_3(ctx, list, i) { 912 const child_ctx = ctx.slice(); 913 child_ctx[0] = list[i].value; 914 child_ctx[27] = list[i].component; 915 child_ctx[29] = i; 916 return child_ctx; 917} 918 919function get_each_context_4(ctx, list, i) { 920 const child_ctx = ctx.slice(); 921 child_ctx[30] = list[i]; 922 return child_ctx; 923} 924 925function get_each_context_1(ctx, list, i) { 926 const child_ctx = ctx.slice(); 927 child_ctx[23] = list[i]; 928 child_ctx[25] = i; 929 return child_ctx; 930} 931 932// (91:1) {:else} 933function create_else_block_1(ctx) { 934 let div; 935 let table; 936 let thead; 937 let tr; 938 let t; 939 let tbody; 940 let current; 941 let each_value_4 = /*headers*/ ctx[2]; 942 let each_blocks_1 = []; 943 944 for (let i = 0; i < each_value_4.length; i += 1) { 945 each_blocks_1[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); 946 } 947 948 let each_value_2 = /*component_meta*/ ctx[9]; 949 let each_blocks = []; 950 951 for (let i = 0; i < each_value_2.length; i += 1) { 952 each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); 953 } 954 955 const out = i => transition_out(each_blocks[i], 1, 1, () => { 956 each_blocks[i] = null; 957 }); 958 959 return { 960 c() { 961 div = element("div"); 962 table = element("table"); 963 thead = element("thead"); 964 tr = element("tr"); 965 966 for (let i = 0; i < each_blocks_1.length; i += 1) { 967 each_blocks_1[i].c(); 968 } 969 970 t = space(); 971 tbody = element("tbody"); 972 973 for (let i = 0; i < each_blocks.length; i += 1) { 974 each_blocks[i].c(); 975 } 976 977 attr(tr, "class", "border-b dark:border-gray-800 divide-x dark:divide-gray-800 shadow-sm"); 978 attr(table, "class", "gr-samples-table"); 979 attr(div, "class", "overflow-x-auto border table-auto rounded-lg w-full text-sm"); 980 }, 981 m(target, anchor) { 982 insert(target, div, anchor); 983 append(div, table); 984 append(table, thead); 985 append(thead, tr); 986 987 for (let i = 0; i < each_blocks_1.length; i += 1) { 988 each_blocks_1[i].m(tr, null); 989 } 990 991 append(table, t); 992 append(table, tbody); 993 994 for (let i = 0; i < each_blocks.length; i += 1) { 995 each_blocks[i].m(tbody, null); 996 } 997 998 current = true; 999 }, 1000 p(ctx, dirty) { 1001 if (dirty[0] & /*headers*/ 4) { 1002 each_value_4 = /*headers*/ ctx[2]; 1003 let i; 1004 1005 for (i = 0; i < each_value_4.length; i += 1) { 1006 const child_ctx = get_each_context_4(ctx, each_value_4, i); 1007 1008 if (each_blocks_1[i]) { 1009 each_blocks_1[i].p(child_ctx, dirty); 1010 } else { 1011 each_blocks_1[i] = create_each_block_4(child_ctx); 1012 each_blocks_1[i].c(); 1013 each_blocks_1[i].m(tr, null); 1014 } 1015 } 1016 1017 for (; i < each_blocks_1.length; i += 1) { 1018 each_blocks_1[i].d(1); 1019 } 1020 1021 each_blocks_1.length = each_value_4.length; 1022 } 1023 1024 if (dirty[0] & /*value, page, samples_per_page, dispatch, component_meta, samples_dir, components*/ 3683) { 1025 each_value_2 = /*component_meta*/ ctx[9]; 1026 let i; 1027 1028 for (i = 0; i < each_value_2.length; i += 1) { 1029 const child_ctx = get_each_context_2(ctx, each_value_2, i); 1030 1031 if (each_blocks[i]) { 1032 each_blocks[i].p(child_ctx, dirty); 1033 transition_in(each_blocks[i], 1); 1034 } else { 1035 each_blocks[i] = create_each_block_2(child_ctx); 1036 each_blocks[i].c(); 1037 transition_in(each_blocks[i], 1); 1038 each_blocks[i].m(tbody, null); 1039 } 1040 } 1041 1042 group_outros(); 1043 1044 for (i = each_value_2.length; i < each_blocks.length; i += 1) { 1045 out(i); 1046 } 1047 1048 check_outros(); 1049 } 1050 }, 1051 i(local) { 1052 if (current) return; 1053 1054 for (let i = 0; i < each_value_2.length; i += 1) { 1055 transition_in(each_blocks[i]); 1056 } 1057 1058 current = true; 1059 }, 1060 o(local) {
1061 each_blocks = each_blocks.filter(Boolean); 1062 1063 for (let i = 0; i < each_blocks.length; i += 1) { 1064 transition_out(each_blocks[i]); 1065 } 1066 1067 current = false; 1068 }, 1069 d(detaching) { 1070 if (detaching) detach(div); 1071 destroy_each(each_blocks_1, detaching); 1072 destroy_each(each_blocks, detaching); 1073 } 1074 }; 1075} 1076 1077// (69:1) {#if gallery} 1078function create_if_block_2(ctx) { 1079 let div; 1080 let current; 1081 let each_value_1 = /*selected_samples*/ ctx[7]; 1082 let each_blocks = []; 1083 1084 for (let i = 0; i < each_value_1.length; i += 1) { 1085 each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); 1086 } 1087 1088 const out = i => transition_out(each_blocks[i], 1, 1, () => { 1089 each_blocks[i] = null; 1090 }); 1091 1092 return { 1093 c() { 1094 div = element("div"); 1095 1096 for (let i = 0; i < each_blocks.length; i += 1) { 1097 each_blocks[i].c(); 1098 } 1099 1100 attr(div, "class", "gr-samples-gallery"); 1101 }, 1102 m(target, anchor) { 1103 insert(target, div, anchor); 1104 1105 for (let i = 0; i < each_blocks.length; i += 1) { 1106 each_blocks[i].m(div, null); 1107 } 1108 1109 current = true; 1110 }, 1111 p(ctx, dirty) { 1112 if (dirty[0] & /*value, page, samples_per_page, dispatch, component_meta, selected_samples, samples_dir, components*/ 3811) { 1113 each_value_1 = /*selected_samples*/ ctx[7]; 1114 let i; 1115 1116 for (i = 0; i < each_value_1.length; i += 1) { 1117 const child_ctx = get_each_context_1(ctx, each_value_1, i); 1118 1119 if (each_blocks[i]) { 1120 each_blocks[i].p(child_ctx, dirty); 1121 transition_in(each_blocks[i], 1); 1122 } else { 1123 each_blocks[i] = create_each_block_1(child_ctx); 1124 each_blocks[i].c(); 1125 transition_in(each_blocks[i], 1); 1126 each_blocks[i].m(div, null); 1127 } 1128 } 1129 1130 group_outros(); 1131 1132 for (i = each_value_1.length; i < each_blocks.length; i += 1) { 1133 out(i); 1134 } 1135 1136 check_outros(); 1137 } 1138 }, 1139 i(local) { 1140 if (current) return; 1141 1142 for (let i = 0; i < each_value_1.length; i += 1) { 1143 transition_in(each_blocks[i]); 1144 } 1145 1146 current = true; 1147 }, 1148 o(local) {
1149 each_blocks = each_blocks.filter(Boolean); 1150 1151 for (let i = 0; i < each_blocks.length; i += 1) { 1152 transition_out(each_blocks[i]); 1153 } 1154 1155 current = false; 1156 }, 1157 d(detaching) { 1158 if (detaching) detach(div); 1159 destroy_each(each_blocks, detaching); 1160 } 1161 }; 1162} 1163 1164// (98:6) {#each headers as header} 1165function create_each_block_4(ctx) { 1166 let th; 1167 let t0_value = /*header*/ ctx[30] + ""; 1168 let t0; 1169 let t1; 1170 1171 return { 1172 c() { 1173 th = element("th"); 1174 t0 = text(t0_value); 1175 t1 = space(); 1176 attr(th, "class", "p-2 whitespace-nowrap min-w-lg text-left"); 1177 }, 1178 m(target, anchor) { 1179 insert(target, th, anchor); 1180 append(th, t0); 1181 append(th, t1); 1182 }, 1183 p(ctx, dirty) { 1184 if (dirty[0] & /*headers*/ 4 && t0_value !== (t0_value = /*header*/ ctx[30] + "")) set_data(t0, t0_value); 1185 }, 1186 d(detaching) { 1187 if (detaching) detach(th); 1188 } 1189 }; 1190} 1191 1192// (115:8) {#if components[j] !== undefined && component_map[components[j]] !== undefined} 1193function create_if_block_4(ctx) { 1194 let td; 1195 let switch_instance; 1196 let current; 1197 var switch_value = /*component*/ ctx[27]; 1198 1199 function switch_props(ctx) { 1200 return { 1201 props: { 1202 value: /*value*/ ctx[0], 1203 samples_dir: /*samples_dir*/ ctx[11] 1204 } 1205 }; 1206 } 1207 1208 if (switch_value) { 1209 switch_instance = new switch_value(switch_props(ctx)); 1210 } 1211 1212 return { 1213 c() { 1214 td = element("td"); 1215 if (switch_instance) create_component(switch_instance.$$.fragment); 1216 attr(td, "class", "p-2"); 1217 }, 1218 m(target, anchor) { 1219 insert(target, td, anchor); 1220 1221 if (switch_instance) { 1222 mount_component(switch_instance, td, null); 1223 } 1224 1225 current = true; 1226 }, 1227 p(ctx, dirty) { 1228 const switch_instance_changes = {}; 1229 if (dirty[0] & /*component_meta*/ 512) switch_instance_changes.value = /*value*/ ctx[0]; 1230 1231 if (switch_value !== (switch_value = /*component*/ ctx[27])) { 1232 if (switch_instance) { 1233 group_outros(); 1234 const old_component = switch_instance; 1235 1236 transition_out(old_component.$$.fragment, 1, 0, () => { 1237 destroy_component(old_component, 1); 1238 }); 1239 1240 check_outros(); 1241 } 1242 1243 if (switch_value) { 1244 switch_instance = new switch_value(switch_props(ctx)); 1245 create_component(switch_instance.$$.fragment); 1246 transition_in(switch_instance.$$.fragment, 1); 1247 mount_component(switch_instance, td, null); 1248 } else { 1249 switch_instance = null; 1250 } 1251 } else if (switch_value) { 1252 switch_instance.$set(switch_instance_changes); 1253 } 1254 }, 1255 i(local) { 1256 if (current) return; 1257 if (switch_instance) transition_in(switch_instance.$$.fragment, local); 1258 current = true; 1259 }, 1260 o(local) { 1261 if (switch_instance) transition_out(switch_instance.$$.fragment, local); 1262 current = false; 1263 }, 1264 d(detaching) { 1265 if (detaching) detach(td); 1266 if (switch_instance) destroy_component(switch_instance); 1267 } 1268 }; 1269} 1270 1271// (114:7) {#each sample_row as { value, component } 1272function create_each_block_3(ctx) { 1273 let if_block_anchor; 1274 let current; 1275 let if_block = /*components*/ ctx[1][/*j*/ ctx[29]] !== undefined && component_map[/*components*/ ctx[1][/*j*/ ctx[29]]] !== undefined && create_if_block_4(ctx); 1276 1277 return { 1278 c() { 1279 if (if_block) if_block.c(); 1280 if_block_anchor = empty(); 1281 }, 1282 m(target, anchor) { 1283 if (if_block) if_block.m(target, anchor); 1284 insert(target, if_block_anchor, anchor); 1285 current = true; 1286 }, 1287 p(ctx, dirty) { 1288 if (/*components*/ ctx[1][/*j*/ ctx[29]] !== undefined && component_map[/*components*/ ctx[1][/*j*/ ctx[29]]] !== undefined) { 1289 if (if_block) { 1290 if_block.p(ctx, dirty); 1291 1292 if (dirty[0] & /*components*/ 2) { 1293 transition_in(if_block, 1); 1294 } 1295 } else { 1296 if_block = create_if_block_4(ctx); 1297 if_block.c(); 1298 transition_in(if_block, 1); 1299 if_block.m(if_block_anchor.parentNode, if_block_anchor); 1300 } 1301 } else if (if_block) { 1302 group_outros(); 1303 1304 transition_out(if_block, 1, 1, () => { 1305 if_block = null; 1306 }); 1307 1308 check_outros(); 1309 } 1310 }, 1311 i(local) { 1312 if (current) return; 1313 transition_in(if_block); 1314 current = true; 1315 }, 1316 o(local) { 1317 transition_out(if_block); 1318 current = false; 1319 }, 1320 d(detaching) { 1321 if (if_block) if_block.d(detaching); 1322 if (detaching) detach(if_block_anchor); 1323 } 1324 }; 1325} 1326 1327// (106:5) {#each component_meta as sample_row, i} 1328function create_each_block_2(ctx) { 1329 let tr; 1330 let t; 1331 let current; 1332 let mounted; 1333 let dispose; 1334 let each_value_3 = /*sample_row*/ ctx[23]; 1335 let each_blocks = []; 1336 1337 for (let i = 0; i < each_value_3.length; i += 1) { 1338 each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); 1339 } 1340 1341 const out = i => transition_out(each_blocks[i], 1, 1, () => { 1342 each_blocks[i] = null; 1343 }); 1344 1345 function click_handler_1() { 1346 return /*click_handler_1*/ ctx[18](/*i*/ ctx[25]); 1347 } 1348 1349 return { 1350 c() { 1351 tr = element("tr"); 1352 1353 for (let i = 0; i < each_blocks.length; i += 1) { 1354 each_blocks[i].c(); 1355 } 1356 1357 t = space(); 1358 attr(tr, "class", "group cursor-pointer odd:bg-gray-50 border-b dark:border-gray-800 divide-x dark:divide-gray-800 last:border-none hover:bg-orange-50 hover:divide-orange-100 dar
1358k:hover:bg-gray-700"); 1359 }, 1360 m(target, anchor) { 1361 insert(target, tr, anchor); 1362 1363 for (let i = 0; i < each_blocks.length; i += 1) { 1364 each_blocks[i].m(tr, null); 1365 } 1366 1367 append(tr, t); 1368 current = true; 1369 1370 if (!mounted) { 1371 dispose = listen(tr, "click", click_handler_1); 1372 mounted = true; 1373 } 1374 }, 1375 p(new_ctx, dirty) { 1376 ctx = new_ctx; 1377 1378 if (dirty[0] & /*component_meta, samples_dir, components*/ 2562) { 1379 each_value_3 = /*sample_row*/ ctx[23]; 1380 let i; 1381 1382 for (i = 0; i < each_value_3.length; i += 1) { 1383 const child_ctx = get_each_context_3(ctx, each_value_3, i); 1384 1385 if (each_blocks[i]) { 1386 each_blocks[i].p(child_ctx, dirty); 1387 transition_in(each_blocks[i], 1); 1388 } else { 1389 each_blocks[i] = create_each_block_3(child_ctx); 1390 each_blocks[i].c(); 1391 transition_in(each_blocks[i], 1); 1392 each_blocks[i].m(tr, t); 1393 } 1394 } 1395 1396 group_outros(); 1397 1398 for (i = each_value_3.length; i < each_blocks.length; i += 1) { 1399 out(i); 1400 } 1401 1402 check_outros(); 1403 } 1404 }, 1405 i(local) { 1406 if (current) return; 1407 1408 for (let i = 0; i < each_value_3.length; i += 1) { 1409 transition_in(each_blocks[i]); 1410 } 1411 1412 current = true; 1413 }, 1414 o(local) {
1415 each_blocks = each_blocks.filter(Boolean); 1416 1417 for (let i = 0; i < each_blocks.length; i += 1) { 1418 transition_out(each_blocks[i]); 1419 } 1420 1421 current = false; 1422 }, 1423 d(detaching) { 1424 if (detaching) detach(tr); 1425 destroy_each(each_blocks, detaching); 1426 mounted = false; 1427 dispose(); 1428 } 1429 }; 1430} 1431 1432// (81:5) {#if Object.keys(component_map).includes(components[0]) && component_map[components[0]]} 1433function create_if_block_3(ctx) { 1434 let switch_instance; 1435 let switch_instance_anchor; 1436 let current; 1437 var switch_value = /*component_meta*/ ctx[9][0][0].component; 1438 1439 function switch_props(ctx) { 1440 return { 1441 props: { 1442 value: /*sample_row*/ ctx[23][0], 1443 samples_dir: /*samples_dir*/ ctx[11] 1444 } 1445 }; 1446 } 1447 1448 if (switch_value) { 1449 switch_instance = new switch_value(switch_props(ctx)); 1450 } 1451 1452 return { 1453 c() { 1454 if (switch_instance) create_component(switch_instance.$$.fragment); 1455 switch_instance_anchor = empty(); 1456 }, 1457 m(target, anchor) { 1458 if (switch_instance) { 1459 mount_component(switch_instance, target, anchor); 1460 } 1461 1462 insert(target, switch_instance_anchor, anchor); 1463 current = true; 1464 }, 1465 p(ctx, dirty) { 1466 const switch_instance_changes = {}; 1467 if (dirty[0] & /*selected_samples*/ 128) switch_instance_changes.value = /*sample_row*/ ctx[23][0]; 1468 1469 if (switch_value !== (switch_value = /*component_meta*/ ctx[9][0][0].component)) { 1470 if (switch_instance) { 1471 group_outros(); 1472 const old_component = switch_instance; 1473 1474 transition_out(old_component.$$.fragment, 1, 0, () => { 1475 destroy_component(old_component, 1); 1476 }); 1477 1478 check_outros(); 1479 } 1480 1481 if (switch_value) { 1482 switch_instance = new switch_value(switch_props(ctx)); 1483 create_component(switch_instance.$$.fragment); 1484 transition_in(switch_instance.$$.fragment, 1); 1485 mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor); 1486 } else { 1487 switch_instance = null; 1488 } 1489 } else if (switch_value) { 1490 switch_instance.$set(switch_instance_changes); 1491 } 1492 }, 1493 i(local) { 1494 if (current) return; 1495 if (switch_instance) transition_in(switch_instance.$$.fragment, local); 1496 current = true; 1497 }, 1498 o(local) { 1499 if (switch_instance) transition_out(switch_instance.$$.fragment, local); 1500 current = false; 1501 }, 1502 d(detaching) { 1503 if (detaching) detach(switch_instance_anchor); 1504 if (switch_instance) destroy_component(switch_instance, detaching); 1505 } 1506 }; 1507} 1508 1509// (71:3) {#each selected_samples as sample_row, i} 1510function create_each_block_1(ctx) { 1511 let button; 1512 let show_if = Object.keys(component_map).includes(/*components*/ ctx[1][0]) && component_map[/*components*/ ctx[1][0]]; 1513 let t; 1514 let current; 1515 let mounted; 1516 let dispose; 1517 let if_block = show_if && create_if_block_3(ctx); 1518 1519 function click_handler() { 1520 return /*click_handler*/ ctx[17](/*i*/ ctx[25]); 1521 } 1522 1523 return { 1524 c() { 1525 button = element("button"); 1526 if (if_block) if_block.c(); 1527 t = space(); 1528 attr(button, "class", "group rounded-lg"); 1529 }, 1530 m(target, anchor) { 1531 insert(target, button, anchor); 1532 if (if_block) if_block.m(button, null); 1533 append(button, t); 1534 current = true; 1535 1536 if (!mounted) { 1537 dispose = listen(button, "click", click_handler); 1538 mounted = true; 1539 } 1540 }, 1541 p(new_ctx, dirty) { 1542 ctx = new_ctx; 1543 if (dirty[0] & /*components*/ 2) show_if = Object.keys(component_map).includes(/*components*/ ctx[1][0]) && component_map[/*components*/ ctx[1][0]]; 1544 1545 if (show_if) { 1546 if (if_block) { 1547 if_block.p(ctx, dirty); 1548 1549 if (dirty[0] & /*components*/ 2) { 1550 transition_in(if_block, 1); 1551 } 1552 } else { 1553 if_block = create_if_block_3(ctx); 1554 if_block.c(); 1555 transition_in(if_block, 1); 1556 if_block.m(button, t); 1557 } 1558 } else if (if_block) { 1559 group_outros(); 1560 1561 transition_out(if_block, 1, 1, () => { 1562 if_block = null; 1563 }); 1564 1565 check_outros(); 1566 } 1567 }, 1568 i(local) { 1569 if (current) return; 1570 transition_in(if_block); 1571 current = true; 1572 }, 1573 o(local) { 1574 transition_out(if_block); 1575 current = false; 1576 }, 1577 d(detaching) { 1578 if (detaching) detach(button); 1579 if (if_block) if_block.d(); 1580 mounted = false;
1581 dispose(); 1582 } 1583 }; 1584} 1585 1586// (128:0) {#if paginate} 1587function create_if_block(ctx) { 1588 let div; 1589 let t; 1590 let each_value = /*visible_pages*/ ctx[8]; 1591 let each_blocks = []; 1592 1593 for (let i = 0; i < each_value.length; i += 1) { 1594 each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); 1595 } 1596 1597 return { 1598 c() { 1599 div = element("div"); 1600 t = text("Pages:\n\t\t"); 1601 1602 for (let i = 0; i < each_blocks.length; i += 1) { 1603 each_blocks[i].c(); 1604 } 1605 1606 attr(div, "class", "flex gap-2 items-center justify-center text-sm"); 1607 }, 1608 m(target, anchor) { 1609 insert(target, div, anchor); 1610 append(div, t); 1611 1612 for (let i = 0; i < each_blocks.length; i += 1) { 1613 each_blocks[i].m(div, null); 1614 } 1615 }, 1616 p(ctx, dirty) { 1617 if (dirty[0] & /*visible_pages, page*/ 320) { 1618 each_value = /*visible_pages*/ ctx[8]; 1619 let i; 1620 1621 for (i = 0; i < each_value.length; i += 1) { 1622 const child_ctx = get_each_context(ctx, each_value, i); 1623 1624 if (each_blocks[i]) { 1625 each_blocks[i].p(child_ctx, dirty); 1626 } else { 1627 each_blocks[i] = create_each_block(child_ctx); 1628 each_blocks[i].c(); 1629 each_blocks[i].m(div, null); 1630 } 1631 } 1632 1633 for (; i < each_blocks.length; i += 1) { 1634 each_blocks[i].d(1); 1635 } 1636 1637 each_blocks.length = each_value.length; 1638 } 1639 }, 1640 d(detaching) { 1641 if (detaching) detach(div); 1642 destroy_each(each_blocks, detaching); 1643 } 1644 }; 1645} 1646 1647// (134:3) {:else} 1648function create_else_block(ctx) { 1649 let button; 1650 let t0_value = /*visible_page*/ ctx[20] + 1 + ""; 1651 let t0; 1652 let t1; 1653 let mounted; 1654 let dispose; 1655 1656 function click_handler_2() { 1657 return /*click_handler_2*/ ctx[19](/*visible_page*/ ctx[20]); 1658 } 1659 1660 return { 1661 c() { 1662 button = element("button"); 1663 t0 = text(t0_value); 1664 t1 = space(); 1665 toggle_class(button, "font-bold", /*page*/ ctx[6] === /*visible_page*/ ctx[20]); 1666 }, 1667 m(target, anchor) { 1668 insert(target, button, anchor); 1669 append(button, t0); 1670 append(button, t1); 1671 1672 if (!mounted) { 1673 dispose = listen(button, "click", click_handler_2); 1674 mounted = true; 1675 } 1676 }, 1677 p(new_ctx, dirty) { 1678 ctx = new_ctx; 1679 if (dirty[0] & /*visible_pages*/ 256 && t0_value !== (t0_value = /*visible_page*/ ctx[20] + 1 + "")) set_data(t0, t0_value); 1680 1681 if (dirty[0] & /*page, visible_pages*/ 320) { 1682 toggle_class(button, "font-bold", /*page*/ ctx[6] === /*visible_page*/ ctx[20]); 1683 } 1684 }, 1685 d(detaching) { 1686 if (detaching) detach(button); 1687 mounted = false; 1688 dispose(); 1689 } 1690 }; 1691} 1692 1693// (132:3) {#if visible_page === -1} 1694function create_if_block_1(ctx) { 1695 let div; 1696 1697 return { 1698 c() { 1699 div = element("div"); 1700 div.textContent = "..."; 1701 }, 1702 m(target, anchor) { 1703 insert(target, div, anchor); 1704 }, 1705 p: noop, 1706 d(detaching) { 1707 if (detaching) detach(div); 1708 } 1709 }; 1710} 1711 1712// (131:2) {#each visible_pages as visible_page} 1713function create_each_block(ctx) { 1714 let if_block_anchor; 1715 1716 function select_block_type_1(ctx, dirty) { 1717 if (/*visible_page*/ ctx[20] === -1) return create_if_block_1; 1718 return create_else_block; 1719 } 1720 1721 let current_block_type = select_block_type_1(ctx); 1722 let if_block = current_block_type(ctx); 1723 1724 return { 1725 c() { 1726 if_block.c(); 1727 if_block_anchor = empty(); 1728 }, 1729 m(target, anchor) { 1730 if_block.m(target, anchor); 1731 insert(target, if_block_anchor, anchor); 1732 }, 1733 p(ctx, dirty) { 1734 if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block) { 1735 if_block.p(ctx, dirty); 1736 } else { 1737 if_block.d(1); 1738 if_block = current_block_type(ctx); 1739 1740 if (if_block) { 1741 if_block.c(); 1742 if_block.m(if_block_anchor.parentNode, if_block_anchor); 1743 } 1744 } 1745 }, 1746 d(detaching) { 1747 if_block.d(detaching); 1748 if (detaching) detach(if_block_anchor); 1749 } 1750 }; 1751} 1752 1753function create_fragment(ctx) { 1754 let div1; 1755 let div0; 1756 let t1; 1757 let current_block_type_index; 1758 let if_block0; 1759 let t2; 1760 let if_block1_anchor; 1761 let current; 1762 const if_block_creators = [create_if_block_2, create_else_block_1]; 1763 const if_blocks = []; 1764 1765 function select_block_type(ctx, dirty) { 1766 if (/*gallery*/ ctx[12]) return 0; 1767 return 1; 1768 } 1769 1770 current_block_type_index = select_block_type(ctx); 1771 if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); 1772 let if_block1 = /*paginate*/ ctx[13] && create_if_block(ctx); 1773 1774 return { 1775 c() { 1776 div1 = element("div"); 1777 div0 = element("div"); 1778 1779 div0.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="mr-1" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32">
1779<path fill="currentColor" d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z"></path></svg> 1780 Examples`; 1781 1782 t1 = space(); 1783 if_block0.c(); 1784 t2 = space(); 1785 if (if_block1) if_block1.c(); 1786 if_block1_anchor = empty(); 1787 attr(div0, "class", "text-xs mb-2 flex items-center text-gray-500"); 1788 attr(div1, "id", /*elem_id*/ ctx[3]); 1789 attr(div1, "class", "mt-4 inline-block max-w-full text-gray-700 w-full"); 1790 toggle_class(div1, "!hidden", !/*visible*/ ctx[4]); 1791 }, 1792 m(target, anchor) { 1793 insert(target, div1, anchor); 1794 append(div1, div0); 1795 append(div1, t1); 1796 if_blocks[current_block_type_index].m(div1, null); 1797 insert(target, t2, anchor); 1798 if (if_block1) if_block1.m(target, anchor); 1799 insert(target, if_block1_anchor, anchor); 1800 current = true; 1801 }, 1802 p(ctx, dirty) { 1803 if_block0.p(ctx, dirty); 1804 1805 if (!current || dirty[0] & /*elem_id*/ 8) { 1806 attr(div1, "id", /*elem_id*/ ctx[3]); 1807 } 1808 1809 if (dirty[0] & /*visible*/ 16) { 1810 toggle_class(div1, "!hidden", !/*visible*/ ctx[4]); 1811 } 1812 1813 if (/*paginate*/ ctx[13]) if_block1.p(ctx, dirty); 1814 }, 1815 i(local) { 1816 if (current) return; 1817 transition_in(if_block0); 1818 current = true; 1819 }, 1820 o(local) { 1821 transition_out(if_block0); 1822 current = false; 1823 }, 1824 d(detaching) { 1825 if (detaching) detach(div1); 1826 if_blocks[current_block_type_index].d(); 1827 if (detaching) detach(t2); 1828 if (if_block1) if_block1.d(detaching); 1829 if (detaching) detach(if_block1_anchor); 1830 } 1831 }; 1832} 1833 1834function instance($$self, $$props, $$invalidate) { 1835 let component_meta; 1836 let { components } = $$props; 1837 let { headers } = $$props; 1838 let { samples } = $$props; 1839 let { elem_id = "" } = $$props; 1840 let { visible = true } = $$props; 1841 let { value = null } = $$props; 1842 let { root } = $$props; 1843 let { samples_per_page = 10 } = $$props; 1844 const dispatch = createEventDispatcher(); 1845 let samples_dir = root + "file/"; 1846 let page = 0; 1847 let gallery = headers.length === 1; 1848 let paginate = samples.length > samples_per_page; 1849 let selected_samples; 1850 let page_count; 1851 let visible_pages = []; 1852 1853 const click_handler = i => { 1854 $$invalidate(0, value = i + page * samples_per_page); 1855 dispatch("click", value); 1856 }; 1857 1858 const click_handler_1 = i => { 1859 $$invalidate(0, value = i + page * samples_per_page); 1860 dispatch("click", value); 1861 }; 1862 1863 const click_handler_2 = visible_page => $$invalidate(6, page = visible_page); 1864 1865 $$self.$$set = $$props => {
1866 if ('components' in $$props) $$invalidate(1, components = $$props.components); 1867 if ('headers' in $$props) $$invalidate(2, headers = $$props.headers); 1868 if ('samples' in $$props) $$invalidate(14, samples = $$props.samples); 1869 if ('elem_id' in $$props) $$invalidate(3, elem_id = $$props.elem_id); 1870 if ('visible' in $$props) $$invalidate(4, visible = $$props.visible); 1871 if ('value' in $$props) $$invalidate(0, value = $$props.value); 1872 if ('root' in $$props) $$invalidate(15, root = $$props.root); 1873 if ('samples_per_page' in $$props) $$invalidate(5, samples_per_page = $$props.samples_per_page); 1874 }; 1875 1876 $$self.$$.update = () => { 1877 if ($$self.$$.dirty[0] & /*samples, page, samples_per_page, page_count, visible_pages*/ 82272) { 1878 { 1879 if (paginate) { 1880 $$invalidate(8, visible_pages = []); 1881 $$invalidate(7, selected_samples = samples.slice(page * samples_per_page, (page + 1) * samples_per_page)); 1882 $$invalidate(16, page_count = Math.ceil(samples.length / samples_per_page)); 1883 1884 [0, page, page_count - 1].forEach(anchor => { 1885 for (let i = anchor - 2; i <= anchor + 2; i++) { 1886 if (i >= 0 && i < page_count && !visible_pages.includes(i)) { 1887 if (visible_pages.length > 0 && i - visible_pages[visible_pages.length - 1] > 1) { 1888 visible_pages.push(-1); 1889 } 1890 1891 visible_pages.push(i); 1892 } 1893 } 1894 }); 1895 } else { 1896 $$invalidate(7, selected_samples = samples.slice()); 1897 } 1898 } 1899 } 1900 1901 if ($$self.$$.dirty[0] & /*selected_samples, components*/ 130) { 1902 $$invalidate(9, component_meta = selected_samples.map(sample_row => sample_row.map((sample_cell, j) => ({ 1903 value: sample_cell, 1904 component: component_map[components[j]] 1905 })))); 1906 } 1907 }; 1908 1909 return [ 1910 value, 1911 components, 1912 headers, 1913 elem_id, 1914 visible, 1915 samples_per_page, 1916 page, 1917 selected_samples, 1918 visible_pages, 1919 component_meta, 1920 dispatch, 1921 samples_dir, 1922 gallery, 1923 paginate, 1924 samples, 1925 root, 1926 page_count, 1927 click_handler, 1928 click_handler_1, 1929 click_handler_2 1930 ]; 1931} 1932 1933class Dataset extends SvelteComponent { 1934 constructor(options) { 1935 super(); 1936 1937 init( 1938 this, 1939 options, 1940 instance, 1941 create_fragment, 1942 safe_not_equal, 1943 { 1944 components: 1, 1945 headers: 2, 1946 samples: 14, 1947 elem_id: 3, 1948 visible: 4, 1949 value: 0, 1950 root: 15, 1951 samples_per_page: 5 1952 }, 1953 null, 1954 [-1, -1] 1955 ); 1956 } 1957} 1958 1959var Dataset$1 = Dataset; 1960 1961const modes = ["dynamic"]; 1962 1963export { Dataset$1 as Component, modes };
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.