nsthorat's picture
Push
e39b632
raw
history blame
No virus
25.6 kB
import{S as W,i as X,s as Y,E as R,k as P,a as j,l as L,m as V,c as H,h as p,n as M,H as E,I as O,b as I,J as D,K as q,g as k,v as Z,d as T,f as w,O as ie,P as ae,D as K,ab as Ve,aa as Ge,R as le,F as re,G as se,L as oe,M as ue,N as fe,Q as B,w as U,q as J,r as Q,u as ce,a1 as x,C as Me,T as Re,o as je,a4 as _e,ap as He,U as $,y as F,z as A,A as C,V as ee,B as G,e as y,a5 as qe,a3 as ze}from"../chunks/index.4fe0636c.js";import{w as Oe,B as Ke,g as Ue}from"../chunks/navigation.1d956f81.js";import{T as de,$ as Je,a0 as Qe,a1 as Ye,E as ye,I as Ne,S as We,O as Xe}from"../chunks/utils.72a3bae8.js";import{P as Ze}from"../chunks/Page.a668fc01.js";import{b as Be}from"../chunks/taskQueries.00b1e24e.js";import{C as we}from"../chunks/ComboBox.5f87ed5e.js";import{w as Fe}from"../chunks/index.d0787736.js";const xe=l=>({}),be=l=>({});function ge(l){let e,t;const n=l[16].labelText,i=se(n,l,l[15],be),r=i||$e(l);return{c(){e=P("span"),r&&r.c(),this.h()},l(a){e=L(a,"SPAN",{});var o=V(e);r&&r.l(o),o.forEach(p),this.h()},h(){E(e,"bx--visually-hidden",l[7])},m(a,o){I(a,e,o),r&&r.m(e,null),t=!0},p(a,o){i?i.p&&(!t||o&32768)&&oe(i,n,a,a[15],t?fe(n,a[15],o,xe):ue(a[15]),be):r&&r.p&&(!t||o&64)&&r.p(a,t?o:-1),(!t||o&128)&&E(e,"bx--visually-hidden",a[7])},i(a){t||(k(r,a),t=!0)},o(a){T(r,a),t=!1},d(a){a&&p(e),r&&r.d(a)}}}function $e(l){let e;return{c(){e=J(l[6])},l(t){e=Q(t,l[6])},m(t,n){I(t,e,n)},p(t,n){n&64&&ce(e,t[6])},d(t){t&&p(e)}}}function et(l){let e,t,n,i,r,a,o,s,u,d=(l[6]||l[13].labelText)&&ge(l),_=[l[12]],c={};for(let m=0;m<_.length;m+=1)c=R(c,_[m]);return{c(){e=P("div"),t=P("input"),n=j(),i=P("label"),r=P("span"),a=j(),d&&d.c(),this.h()},l(m){e=L(m,"DIV",{});var g=V(e);t=L(g,"INPUT",{type:!0,id:!0,name:!0}),n=H(g),i=L(g,"LABEL",{for:!0});var f=V(i);r=L(f,"SPAN",{}),V(r).forEach(p),a=H(f),d&&d.l(f),f.forEach(p),g.forEach(p),this.h()},h(){M(t,"type","radio"),M(t,"id",l[8]),M(t,"name",l[9]),t.checked=l[0],t.disabled=l[3],t.required=l[4],t.value=l[2],E(t,"bx--radio-button",!0),E(r,"bx--radio-button__appearance",!0),M(i,"for",l[8]),E(i,"bx--radio-button__label",!0),O(e,c),E(e,"bx--radio-button-wrapper",!0),E(e,"bx--radio-button-wrapper--label-left",l[5]==="left")},m(m,g){I(m,e,g),D(e,t),l[18](t),D(e,n),D(e,i),D(i,r),D(i,a),d&&d.m(i,null),o=!0,s||(u=[q(t,"change",l[17]),q(t,"change",l[19])],s=!0)},p(m,[g]){(!o||g&256)&&M(t,"id",m[8]),(!o||g&512)&&M(t,"name",m[9]),(!o||g&1)&&(t.checked=m[0]),(!o||g&8)&&(t.disabled=m[3]),(!o||g&16)&&(t.required=m[4]),(!o||g&4)&&(t.value=m[2]),m[6]||m[13].labelText?d?(d.p(m,g),g&8256&&k(d,1)):(d=ge(m),d.c(),k(d,1),d.m(i,null)):d&&(Z(),T(d,1,1,()=>{d=null}),w()),(!o||g&256)&&M(i,"for",m[8]),O(e,c=ie(_,[g&4096&&m[12]])),E(e,"bx--radio-button-wrapper",!0),E(e,"bx--radio-button-wrapper--label-left",m[5]==="left")},i(m){o||(k(d),o=!0)},o(m){T(d),o=!1},d(m){m&&p(e),l[18](null),d&&d.d(),s=!1,ae(u)}}}function tt(l,e,t){const n=["value","checked","disabled","required","labelPosition","labelText","hideLabel","id","name","ref"];let i=K(e,n),r,{$$slots:a={},$$scope:o}=e;const s=Ve(a);let{value:u=""}=e,{checked:d=!1}=e,{disabled:_=!1}=e,{required:c=!1}=e,{labelPosition:m="right"}=e,{labelText:g=""}=e,{hideLabel:f=!1}=e,{id:h="ccs-"+Math.random().toString(36)}=e,{name:b=""}=e,{ref:N=null}=e;const z=Ge("RadioButtonGroup"),te=z?z.selectedValue:Fe(d?u:void 0);le(l,te,S=>t(14,r=S)),z&&z.add({id:h,checked:d,disabled:_,value:u});function ne(S){B.call(this,l,S)}function v(S){U[S?"unshift":"push"](()=>{N=S,t(1,N)})}const me=()=>{z&&z.update(u)};return l.$$set=S=>{e=R(R({},e),re(S)),t(12,i=K(e,n)),"value"in S&&t(2,u=S.value),"checked"in S&&t(0,d=S.checked),"disabled"in S&&t(3,_=S.disabled),"required"in S&&t(4,c=S.required),"labelPosition"in S&&t(5,m=S.labelPosition),"labelText"in S&&t(6,g=S.labelText),"hideLabel"in S&&t(7,f=S.hideLabel),"id"in S&&t(8,h=S.id),"name"in S&&t(9,b=S.name),"ref"in S&&t(1,N=S.ref),"$$scope"in S&&t(15,o=S.$$scope)},l.$$.update=()=>{l.$$.dirty&16388&&t(0,d=r===u)},[d,N,u,_,c,m,g,f,h,b,z,te,i,s,r,o,a,ne,v,me]}class lt extends W{constructor(e){super(),X(this,e,tt,et,Y,{value:2,checked:0,disabled:3,required:4,labelPosition:5,labelText:6,hideLabel:7,id:8,name:9,ref:1})}}const nt=lt;function it(l){let e,t,n,i;const r=l[3].default,a=se(r,l,l[2],null);let o=[l[1]],s={};for(let u=0;u<o.length;u+=1)s=R(s,o[u]);return{c(){e=P("form"),a&&a.c(),this.h()},l(u){e=L(u,"FORM",{});var d=V(e);a&&a.l(d),d.forEach(p),this.h()},h(){O(e,s),E(e,"bx--form",!0)},m(u,d){I(u,e,d),a&&a.m(e,null),l[10](e),t=!0,n||(i=[q(e,"click",l[4]),q(e,"keydown",l[5]),q(e,"mouseover",l[6]),q(e,"mouseenter",l[7]),q(e,"mouseleave",l[8]),q(e,"submit",l[9])],n=!0)},p(u,[d]){a&&a.p&&(!t||d&4)&&oe(a,r,u,u[2],t?fe(r,u[2],d,null):ue(u[2]),null),O(e,s=ie(o,[d&2&&u[1]])),E(e,"bx--form",!0)},i(u){t||(k(a,u),t=!0)},o(u){T(a,u),t=!1},d(u){u&&p(e),a&&a.d(u),l[10](null),n=!1,ae(i)}}}function at(l,e,t){const n=["ref"];let i=K(e,n),{$$slots:r={},$$scope:a}=e,{ref:o=null}=e;function s(f){B.call(this,l,f)}function u(f){B.call(this,l,f)}function d(f){B.call(this,l,f)}function _(f){B.call(this,l,f)}function c(f){B.call(this,l,f)}function m(f){B.call(this,l,f)}function g(f){U[f?"unshift":"push"](()=>{o=f,t(0,o)})}return l.$$set=f=>{e=R(R({},e),re(f)),t(1,i=K(e,n)),"ref"in f&&t(0,o=f.ref),"$$scope"in f&&t(2,a=f.$$scope)},[o,i,a,r,s,u,d,_,c,m,g]}class rt extends W{constructor(e){super(),X(this,e,at,it,Y,{ref:0})}}const st=rt;function he(l){let e,t,n;return{c(){e=P("legend"),t=J(l[4]),this.h()},l(i){e=L(i,"LEGEND",{id:!0});var r=V(e);t=Q(r,l[4]),r.forEach(p),this.h()},h(){M(e,"id",n=l[5]||l[6]["aria-labelledby"]),E(e,"bx--label",!0)},m(i,r){I(i,e,r),D(e,t)},p(i,r){r&16&&ce(t,i[4]),r&96&&n!==(n=i[5]||i[6]["aria-labelledby"])&&M(e,"id",n)},d(i){i&&p(e)}}}function ve(l){let e,t;return{c(){e=P("div"),t=J(l[3]),this.h()},l(n){e=L(n,"DIV",{});var i=V(e);t=Q(i,l[3]),i.forEach(p),this.h()},h(){E(e,"bx--form__requirement",!0)},m(n,i){I(n,e,i),D(e,t)},p(n,i){i&8&&ce(t,n[3])},d(n){n&&p(e)}}}function ot(l){let e,t,n,i,r,a,o,s,u=l[4]&&he(l);const d=l[8].default,_=se(d,l,l[7],null);let c=l[2]&&ve(l),m=[{"data-invalid":i=l[1]||void 0},{"aria-labelledby":r=l[6]["aria-labelledby"]||l[5]},l[6]],g={};for(let f=0;f<m.length;f+=1)g=R(g,m[f]);return{c(){e=P("fieldset"),u&&u.c(),t=j(),_&&_.c(),n=j(),c&&c.c(),this.h()},l(f){e=L(f,"FIELDSET",{"data-invalid":!0,"aria-labelledby":!0});var h=V(e);u&&u.l(h),t=H(h),_&&_.l(h),n=H(h),c&&c.l(h),h.forEach(p),this.h()},h(){O(e,g),E(e,"bx--fieldset",!0),E(e,"bx--fieldset--no-margin",l[0])},m(f,h){I(f,e,h),u&&u.m(e,null),D(e,t),_&&_.m(e,null),D(e,n),c&&c.m(e,null),a=!0,o||(s=[q(e,"click",l[9]),q(e,"mouseover",l[10]),q(e,"mouseenter",l[11]),q(e,"mouseleave",l[12])],o=!0)},p(f,[h]){f[4]?u?u.p(f,h):(u=he(f),u.c(),u.m(e,t)):u&&(u.d(1),u=null),_&&_.p&&(!a||h&128)&&oe(_,d,f,f[7],a?fe(d,f[7],h,null):ue(f[7]),null),f[2]?c?c.p(f,h):(c=ve(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null),O(e,g=ie(m,[(!a||h&2&&i!==(i=f[1]||void 0))&&{"data-invalid":i},(!a||h&96&&r!==(r=f[6]["aria-labelledby"]||f[5]))&&{"aria-labelledby":r},h&64&&f[6]])),E(e,"bx--fieldset",!0),E(e,"bx--fieldset--no-margin",f[0])},i(f){a||(k(_,f),a=!0)},o(f){T(_,f),a=!1},d(f){f&&p(e),u&&u.d(),_&&_.d(f),c&&c.d(),o=!1,ae(s)}}}function ut(l,e,t){const n=["noMargin","invalid","message","messageText","legendText","legendId"];let i=K(e,n),{$$slots:r={},$$scope:a}=e,{noMargin:o=!1}=e,{invalid:s=!1}=e,{message:u=!1}=e,{messageText:d=""}=e,{legendText:_=""}=e,{legendId:c=""}=e;function m(b){B.call(this,l,b)}function g(b){B.call(this,l,b)}function f(b){B.call(this,l,b)}function h(b){B.call(this,l,b)}return l.$$set=b=>{e=R(R({},e),re(b)),t(6,i=K(e,n)),"noMargin"in b&&t(0,o=b.noMargin),"invalid"in b&&t(1,s=b.invalid),"message"in b&&t(2,u=b.message),"messageText"in b&&t(3,d=b.messageText),"legendText"in b&&t(4,_=b.legendText),"legendId"in b&&t(5,c=b.legendId),"$$scope"in b&&t(7,a=b.$$scope)},[o,s,u,d,_,c,i,a,r,m,g,f,h]}class ft extends W{constructor(e){super(),X(this,e,ut,ot,Y,{noMargin:0,invalid:1,message:2,messageText:3,legendText:4,legendId:5})}}const pe=ft;function dt(l){let e,t,n,i,r,a,o=[l[0]],s={};for(let u=0;u<o.length;u+=1)s=R(s,o[u]);return{c(){e=P("div"),t=P("div"),n=j(),i=P("span"),this.h()},l(u){e=L(u,"DIV",{});var d=V(e);t=L(d,"DIV",{}),V(t).forEach(p),n=H(d),i=L(d,"SPAN",{}),V(i).forEach(p),d.forEach(p),this.h()},h(){E(t,"bx--radio-button",!0),E(t,"bx--skeleton",!0),E(i,"bx--radio-button__label",!0),E(i,"bx--skeleton",!0),O(e,s),E(e,"bx--radio-button-wrapper",!0)},m(u,d){I(u,e,d),D(e,t),D(e,n),D(e,i),r||(a=[q(e,"click",l[1]),q(e,"mouseover",l[2]),q(e,"mouseenter",l[3]),q(e,"mouseleave",l[4])],r=!0)},p(u,[d]){O(e,s=ie(o,[d&1&&u[0]])),E(e,"bx--radio-button-wrapper",!0)},i:x,o:x,d(u){u&&p(e),r=!1,ae(a)}}}function ct(l,e,t){const n=[];let i=K(e,n);function r(u){B.call(this,l,u)}function a(u){B.call(this,l,u)}function o(u){B.call(this,l,u)}function s(u){B.call(this,l,u)}return l.$$set=u=>{e=R(R({},e),re(u)),t(0,i=K(e,n))},[i,r,a,o,s]}class mt extends W{constructor(e){super(),X(this,e,ct,dt,Y,{})}}const _t=mt,bt=l=>({}),ke=l=>({});function Te(l){let e,t;const n=l[11].legendText,i=se(n,l,l[10],ke),r=i||gt(l);return{c(){e=P("legend"),r&&r.c(),this.h()},l(a){e=L(a,"LEGEND",{});var o=V(e);r&&r.l(o),o.forEach(p),this.h()},h(){E(e,"bx--label",!0),E(e,"bx--visually-hidden",l[2])},m(a,o){I(a,e,o),r&&r.m(e,null),t=!0},p(a,o){i?i.p&&(!t||o&1024)&&oe(i,n,a,a[10],t?fe(n,a[10],o,bt):ue(a[10]),ke):r&&r.p&&(!t||o&2)&&r.p(a,t?o:-1),(!t||o&4)&&E(e,"bx--visually-hidden",a[2])},i(a){t||(k(r,a),t=!0)},o(a){T(r,a),t=!1},d(a){a&&p(e),r&&r.d(a)}}}function gt(l){let e;return{c(){e=J(l[1])},l(t){e=Q(t,l[1])},m(t,n){I(t,e,n)},p(t,n){n&2&&ce(e,t[1])},d(t){t&&p(e)}}}function ht(l){let e,t,n,i,r,a,o=(l[1]||l[8].legendText)&&Te(l);const s=l[11].default,u=se(s,l,l[10],null);let d=[{id:l[5]},l[7]],_={};for(let c=0;c<d.length;c+=1)_=R(_,d[c]);return{c(){e=P("div"),t=P("fieldset"),o&&o.c(),n=j(),u&&u.c(),this.h()},l(c){e=L(c,"DIV",{id:!0});var m=V(e);t=L(m,"FIELDSET",{});var g=V(t);o&&o.l(g),n=H(g),u&&u.l(g),g.forEach(p),m.forEach(p),this.h()},h(){t.disabled=l[0],E(t,"bx--radio-button-group",!0),E(t,"bx--radio-button-group--vertical",l[4]==="vertical"),E(t,"bx--radio-button-group--label-left",l[3]==="left"),E(t,"bx--radio-button-group--label-right",l[3]==="right"),O(e,_),E(e,"bx--form-item",!0)},m(c,m){I(c,e,m),D(e,t),o&&o.m(t,null),D(t,n),u&&u.m(t,null),i=!0,r||(a=[q(e,"click",l[12]),q(e,"mouseover",l[13]),q(e,"mouseenter",l[14]),q(e,"mouseleave",l[15])],r=!0)},p(c,[m]){c[1]||c[8].legendText?o?(o.p(c,m),m&258&&k(o,1)):(o=Te(c),o.c(),k(o,1),o.m(t,n)):o&&(Z(),T(o,1,1,()=>{o=null}),w()),u&&u.p&&(!i||m&1024)&&oe(u,s,c,c[10],i?fe(s,c[10],m,null):ue(c[10]),null),(!i||m&1)&&(t.disabled=c[0]),(!i||m&16)&&E(t,"bx--radio-button-group--vertical",c[4]==="vertical"),(!i||m&8)&&E(t,"bx--radio-button-group--label-left",c[3]==="left"),(!i||m&8)&&E(t,"bx--radio-button-group--label-right",c[3]==="right"),O(e,_=ie(d,[(!i||m&32)&&{id:c[5]},m&128&&c[7]])),E(e,"bx--form-item",!0)},i(c){i||(k(o),k(u,c),i=!0)},o(c){T(o),T(u,c),i=!1},d(c){c&&p(e),o&&o.d(),u&&u.d(c),r=!1,ae(a)}}}function vt(l,e,t){const n=["selected","disabled","legendText","hideLegend","labelPosition","orientation","id"];let i=K(e,n),r,{$$slots:a={},$$scope:o}=e;const s=Ve(a);let{selected:u=void 0}=e,{disabled:d=!1}=e,{legendText:_=""}=e,{hideLegend:c=!1}=e,{labelPosition:m="right"}=e,{orientation:g="horizontal"}=e,{id:f=void 0}=e;const h=Me(),b=Fe(u);le(l,b,v=>t(16,r=v)),Re("RadioButtonGroup",{selectedValue:b,add:({checked:v,value:me})=>{v&&b.set(me)},update:v=>{t(9,u=v)}}),je(()=>{_e(b,r=u,r)}),He(()=>{_e(b,r=u,r)}),b.subscribe(v=>{t(9,u=v),h("change",v)});function N(v){B.call(this,l,v)}function z(v){B.call(this,l,v)}function te(v){B.call(this,l,v)}function ne(v){B.call(this,l,v)}return l.$$set=v=>{e=R(R({},e),re(v)),t(7,i=K(e,n)),"selected"in v&&t(9,u=v.selected),"disabled"in v&&t(0,d=v.disabled),"legendText"in v&&t(1,_=v.legendText),"hideLegend"in v&&t(2,c=v.hideLegend),"labelPosition"in v&&t(3,m=v.labelPosition),"orientation"in v&&t(4,g=v.orientation),"id"in v&&t(5,f=v.id),"$$scope"in v&&t(10,o=v.$$scope)},[d,_,c,m,g,f,b,i,s,u,o,a,N,z,te,ne]}class pt extends W{constructor(e){super(),X(this,e,vt,ht,Y,{selected:9,disabled:0,legendText:1,hideLegend:2,labelPosition:3,orientation:4,id:5})}}const kt=pt,Ae="huggingface",Ce=()=>Be({queryFn:()=>fetch("https://datasets-server.huggingface.co/valid").then(l=>l.json()),queryKey:[Ae,"listDatasets"],select:l=>l.valid}),Tt=l=>Be({queryFn:()=>fetch(`https://datasets-server.huggingface.co/splits?dataset=${l}`).then(e=>e.json()),queryKey:[Ae,"getSplits",l],select:e=>e.splits});function Et(l){let e,t,n;function i(a){l[6](a)}let r={invalid:l[1],invalidText:l[2],warn:!l[3],warnText:"Dataset doesn't exist"};return l[0]!==void 0&&(r.value=l[0]),e=new de({props:r}),U.push(()=>$(e,"value",i)),{c(){F(e.$$.fragment)},l(a){A(e.$$.fragment,a)},m(a,o){C(e,a,o),n=!0},p(a,[o]){const s={};o&2&&(s.invalid=a[1]),o&4&&(s.invalidText=a[2]),o&8&&(s.warn=!a[3]),!t&&o&1&&(t=!0,s.value=a[0],ee(()=>t=!1)),e.$set(s)},i(a){n||(k(e.$$.fragment,a),n=!0)},o(a){T(e.$$.fragment,a),n=!1},d(a){G(e,a)}}}function St(l,e,t){let n,i,{value:r}=e,{invalid:a}=e,{invalidText:o}=e;const s=Ce();le(l,s,d=>t(5,i=d));function u(d){r=d,t(0,r)}return l.$$set=d=>{"value"in d&&t(0,r=d.value),"invalid"in d&&t(1,a=d.invalid),"invalidText"in d&&t(2,o=d.invalidText)},l.$$.update=()=>{var d;l.$$.dirty&33&&t(3,n=(d=i.data)==null?void 0:d.includes(r))},[r,a,o,n,s,i,u]}class Ee extends W{constructor(e){super(),X(this,e,St,Et,Y,{value:0,invalid:1,invalidText:2})}}function Dt(l){let e,t,n;function i(a){l[11](a)}let r={invalid:l[1],invalidText:l[2],labelText:"Split",placeholder:"(optional)"};return l[0]!==void 0&&(r.value=l[0]),e=new de({props:r}),U.push(()=>$(e,"value",i)),{c(){F(e.$$.fragment)},l(a){A(e.$$.fragment,a)},m(a,o){C(e,a,o),n=!0},p(a,o){const s={};o&2&&(s.invalid=a[1]),o&4&&(s.invalidText=a[2]),!t&&o&1&&(t=!0,s.value=a[0],ee(()=>t=!1)),e.$set(s)},i(a){n||(k(e.$$.fragment,a),n=!0)},o(a){T(e.$$.fragment,a),n=!1},d(a){G(e,a)}}}function It(l){var n,i;let e,t;return e=new we({props:{value:l[0]||"",invalid:l[1],invalidText:l[2],warn:!l[3],warnText:"Dataset doesn't exist",titleText:"Split",placeholder:"(optional)",items:((i=(n=l[5])==null?void 0:n.data)==null?void 0:i.map(Se))||[]}}),e.$on("select",l[10]),{c(){F(e.$$.fragment)},l(r){A(e.$$.fragment,r)},m(r,a){C(e,r,a),t=!0},p(r,a){var s,u;const o={};a&1&&(o.value=r[0]||""),a&2&&(o.invalid=r[1]),a&4&&(o.invalidText=r[2]),a&8&&(o.warn=!r[3]),a&32&&(o.items=((u=(s=r[5])==null?void 0:s.data)==null?void 0:u.map(Se))||[]),e.$set(o)},i(r){t||(k(e.$$.fragment,r),t=!0)},o(r){T(e.$$.fragment,r),t=!1},d(r){G(e,r)}}}function Pt(l){let e,t,n,i;const r=[It,Dt],a=[];function o(s,u){var d;return(d=s[5])!=null&&d.data&&s[3]?0:1}return e=o(l),t=a[e]=r[e](l),{c(){t.c(),n=y()},l(s){t.l(s),n=y()},m(s,u){a[e].m(s,u),I(s,n,u),i=!0},p(s,[u]){let d=e;e=o(s),e===d?a[e].p(s,u):(Z(),T(a[d],1,1,()=>{a[d]=null}),w(),t=a[e],t?t.p(s,u):(t=a[e]=r[e](s),t.c()),k(t,1),t.m(n.parentNode,n))},i(s){i||(k(t),i=!0)},o(s){T(t),i=!1},d(s){a[e].d(s),s&&p(n)}}}const Se=l=>({id:l.split,text:l.split});function Lt(l,e,t){let n,i,r,a,o,s=x,u=()=>(s(),s=qe(r,b=>t(5,o=b)),r);l.$$.on_destroy.push(()=>s());let{value:d}=e,{invalid:_}=e,{invalidText:c}=e,{rootValue:m}=e;const g=Ce();le(l,g,b=>t(9,a=b));const f=b=>{var N;return t(0,d=(N=b.detail.selectedItem)==null?void 0:N.id)};function h(b){d=b,t(0,d)}return l.$$set=b=>{"value"in b&&t(0,d=b.value),"invalid"in b&&t(1,_=b.invalid),"invalidText"in b&&t(2,c=b.invalidText),"rootValue"in b&&t(7,m=b.rootValue)},l.$$.update=()=>{var b;l.$$.dirty&128&&t(8,n=m.dataset_name),l.$$.dirty&768&&t(3,i=(b=a.data)==null?void 0:b.includes(n)),l.$$.dirty&264&&u(t(4,r=i?Tt(n):void 0))},[d,_,c,i,r,o,g,m,n,a,f,h]}class De extends W{constructor(e){super(),X(this,e,Lt,Pt,Y,{value:0,invalid:1,invalidText:2,rootValue:7})}}function Vt(l){const e=l.slice(),t=e[7].data;return e[17]=t,e}function Ie(l,e,t){const n=l.slice();return n[18]=e[t],n}function qt(l){let e,t,n,i,r,a,o,s,u,d;function _(f){l[11](f)}let c={labelText:"namespace",invalid:!l[0]};l[0]!==void 0&&(c.value=l[0]),t=new de({props:c}),U.push(()=>$(t,"value",_));function m(f){l[12](f)}let g={labelText:"name",invalid:!l[1]};return l[1]!==void 0&&(g.value=l[1]),s=new de({props:g}),U.push(()=>$(s,"value",m)),{c(){e=P("div"),F(t.$$.fragment),i=j(),r=P("span"),a=J("/"),o=j(),F(s.$$.fragment),this.h()},l(f){e=L(f,"DIV",{class:!0});var h=V(e);A(t.$$.fragment,h),i=H(h),r=L(h,"SPAN",{class:!0});var b=V(r);a=Q(b,"/"),b.forEach(p),o=H(h),A(s.$$.fragment,h),h.forEach(p),this.h()},h(){M(r,"class","mx-4 mt-6 text-lg"),M(e,"class","flex flex-row content-start")},m(f,h){I(f,e,h),C(t,e,null),D(e,i),D(e,r),D(r,a),D(e,o),C(s,e,null),d=!0},p(f,h){const b={};h&1&&(b.invalid=!f[0]),!n&&h&1&&(n=!0,b.value=f[0],ee(()=>n=!1)),t.$set(b);const N={};h&2&&(N.invalid=!f[1]),!u&&h&2&&(u=!0,N.value=f[1],ee(()=>u=!1)),s.$set(N)},i(f){d||(k(t.$$.fragment,f),k(s.$$.fragment,f),d=!0)},o(f){T(t.$$.fragment,f),T(s.$$.fragment,f),d=!1},d(f){f&&p(e),G(t),G(s)}}}function Nt(l){let e,t;return e=new _t({}),{c(){F(e.$$.fragment)},l(n){A(e.$$.fragment,n)},m(n,i){C(e,n,i),t=!0},p:x,i(n){t||(k(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){G(e,n)}}}function Bt(l){let e,t;return e=new Ne({props:{kind:"error",title:"Error",subtitle:l[6].error.message,hideCloseButton:!0}}),{c(){F(e.$$.fragment)},l(n){A(e.$$.fragment,n)},m(n,i){C(e,n,i),t=!0},p(n,i){const r={};i&64&&(r.subtitle=n[6].error.message),e.$set(r)},i(n){t||(k(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){G(e,n)}}}function Ft(l){let e,t,n,i;function r(o){l[13](o)}let a={$$slots:{default:[At]},$$scope:{ctx:l}};return l[2]!==void 0&&(a.selected=l[2]),t=new kt({props:a}),U.push(()=>$(t,"selected",r)),{c(){e=P("div"),F(t.$$.fragment)},l(o){e=L(o,"DIV",{});var s=V(e);A(t.$$.fragment,s),s.forEach(p)},m(o,s){I(o,e,s),C(t,e,null),i=!0},p(o,s){const u={};s&2097216&&(u.$$scope={dirty:s,ctx:o}),!n&&s&4&&(n=!0,u.selected=o[2],ee(()=>n=!1)),t.$set(u)},i(o){i||(k(t.$$.fragment,o),i=!0)},o(o){T(t.$$.fragment,o),i=!1},d(o){o&&p(e),G(t)}}}function Pe(l){let e,t;return e=new nt({props:{labelText:l[18],value:l[18]}}),{c(){F(e.$$.fragment)},l(n){A(e.$$.fragment,n)},m(n,i){C(e,n,i),t=!0},p(n,i){const r={};i&64&&(r.labelText=n[18]),i&64&&(r.value=n[18]),e.$set(r)},i(n){t||(k(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){G(e,n)}}}function At(l){let e,t,n=l[6].data.sources,i=[];for(let a=0;a<n.length;a+=1)i[a]=Pe(Ie(l,n,a));const r=a=>T(i[a],1,1,()=>{i[a]=null});return{c(){for(let a=0;a<i.length;a+=1)i[a].c();e=y()},l(a){for(let o=0;o<i.length;o+=1)i[o].l(a);e=y()},m(a,o){for(let s=0;s<i.length;s+=1)i[s]&&i[s].m(a,o);I(a,e,o),t=!0},p(a,o){if(o&64){n=a[6].data.sources;let s;for(s=0;s<n.length;s+=1){const u=Ie(a,n,s);i[s]?(i[s].p(u,o),k(i[s],1)):(i[s]=Pe(u),i[s].c(),k(i[s],1),i[s].m(e.parentNode,e))}for(Z(),s=n.length;s<i.length;s+=1)r(s);w()}},i(a){if(!t){for(let o=0;o<n.length;o+=1)k(i[o]);t=!0}},o(a){i=i.filter(Boolean);for(let o=0;o<i.length;o+=1)T(i[o]);t=!1},d(a){ze(i,a),a&&p(e)}}}function Ct(l){let e,t,n,i,r,a;return r=new We({}),{c(){e=P("div"),t=P("h3"),n=J("Schema"),i=j(),F(r.$$.fragment),this.h()},l(o){e=L(o,"DIV",{class:!0});var s=V(e);t=L(s,"H3",{class:!0});var u=V(t);n=Q(u,"Schema"),u.forEach(p),i=H(s),A(r.$$.fragment,s),s.forEach(p),this.h()},h(){M(t,"class","text-lg"),M(e,"class","mt-4")},m(o,s){I(o,e,s),D(e,t),D(t,n),D(e,i),C(r,e,null),a=!0},p:x,i(o){a||(k(r.$$.fragment,o),a=!0)},o(o){T(r.$$.fragment,o),a=!1},d(o){o&&p(e),G(r)}}}function Gt(l){let e,t;return e=new Ne({props:{kind:"error",title:"Error",hideCloseButton:!0,subtitle:l[7].error.message}}),{c(){F(e.$$.fragment)},l(n){A(e.$$.fragment,n)},m(n,i){C(e,n,i),t=!0},p(n,i){const r={};i&128&&(r.subtitle=n[7].error.message),e.$set(r)},i(n){t||(k(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){G(e,n)}}}function Mt(l){let e=l[2],t,n,i=Le(l);return{c(){i.c(),t=y()},l(r){i.l(r),t=y()},m(r,a){i.m(r,a),I(r,t,a),n=!0},p(r,a){a&4&&Y(e,e=r[2])?(Z(),T(i,1,1,x),w(),i=Le(r),i.c(),k(i,1),i.m(t.parentNode,t)):i.p(r,a)},i(r){n||(k(i),n=!0)},o(r){T(i),n=!1},d(r){r&&p(t),i.d(r)}}}function Le(l){let e,t,n,i;function r(s){l[14](s)}function a(s){l[15](s)}let o={schema:l[17],hiddenProperties:["/source_name"],customComponents:l[2]==="huggingface"?{"/dataset_name":Ee,"/split":De}:{}};return l[4]!==void 0&&(o.value=l[4]),l[3]!==void 0&&(o.validationErrors=l[3]),e=new Xe({props:o}),U.push(()=>$(e,"value",r)),U.push(()=>$(e,"validationErrors",a)),{c(){F(e.$$.fragment)},l(s){A(e.$$.fragment,s)},m(s,u){C(e,s,u),i=!0},p(s,u){const d={};u&128&&(d.schema=s[17]),u&4&&(d.customComponents=s[2]==="huggingface"?{"/dataset_name":Ee,"/split":De}:{}),!t&&u&16&&(t=!0,d.value=s[4],ee(()=>t=!1)),!n&&u&8&&(n=!0,d.validationErrors=s[3],ee(()=>n=!1)),e.$set(d)},i(s){i||(k(e.$$.fragment,s),i=!0)},o(s){T(e.$$.fragment,s),i=!1},d(s){G(e,s)}}}function Rt(l){let e,t,n,i,r,a,o;const s=[Ft,Bt,Nt],u=[];function d(f,h){return f[6].isSuccess?0:f[6].isError?1:f[6].isLoading?2:-1}~(e=d(l))&&(t=u[e]=s[e](l));const _=[Mt,Gt,Ct],c=[];function m(f,h){return f[7].isSuccess?0:f[7].isError?1:f[7].isLoading?2:-1}function g(f,h){return h===0?Vt(f):f}return~(i=m(l))&&(r=c[i]=_[i](g(l,i))),{c(){t&&t.c(),n=j(),r&&r.c(),a=y()},l(f){t&&t.l(f),n=H(f),r&&r.l(f),a=y()},m(f,h){~e&&u[e].m(f,h),I(f,n,h),~i&&c[i].m(f,h),I(f,a,h),o=!0},p(f,h){let b=e;e=d(f),e===b?~e&&u[e].p(f,h):(t&&(Z(),T(u[b],1,1,()=>{u[b]=null}),w()),~e?(t=u[e],t?t.p(f,h):(t=u[e]=s[e](f),t.c()),k(t,1),t.m(n.parentNode,n)):t=null);let N=i;i=m(f),i===N?~i&&c[i].p(g(f,i),h):(r&&(Z(),T(c[N],1,1,()=>{c[N]=null}),w()),~i?(r=c[i],r?r.p(g(f,i),h):(r=c[i]=_[i](g(f,i)),r.c()),k(r,1),r.m(a.parentNode,a)):r=null)},i(f){o||(k(t),k(r),o=!0)},o(f){T(t),T(r),o=!1},d(f){~e&&u[e].d(f),f&&p(n),~i&&c[i].d(f),f&&p(a)}}}function jt(l){let e;return{c(){e=J("Add")},l(t){e=Q(t,"Add")},m(t,n){I(t,e,n)},d(t){t&&p(e)}}}function Ht(l){var o;let e,t,n,i,r,a;return e=new pe({props:{legendText:"Name",$$slots:{default:[qt]},$$scope:{ctx:l}}}),n=new pe({props:{legendText:"Data Loader",$$slots:{default:[Rt]},$$scope:{ctx:l}}}),r=new Ke({props:{disabled:((o=l[3])==null?void 0:o.length)>0||!l[1]||!l[0],$$slots:{default:[jt]},$$scope:{ctx:l}}}),r.$on("click",l[10]),{c(){F(e.$$.fragment),t=j(),F(n.$$.fragment),i=j(),F(r.$$.fragment)},l(s){A(e.$$.fragment,s),t=H(s),A(n.$$.fragment,s),i=H(s),A(r.$$.fragment,s)},m(s,u){C(e,s,u),I(s,t,u),C(n,s,u),I(s,i,u),C(r,s,u),a=!0},p(s,u){var m;const d={};u&2097155&&(d.$$scope={dirty:u,ctx:s}),e.$set(d);const _={};u&2097372&&(_.$$scope={dirty:u,ctx:s}),n.$set(_);const c={};u&11&&(c.disabled=((m=s[3])==null?void 0:m.length)>0||!s[1]||!s[0]),u&2097152&&(c.$$scope={dirty:u,ctx:s}),r.$set(c)},i(s){a||(k(e.$$.fragment,s),k(n.$$.fragment,s),k(r.$$.fragment,s),a=!0)},o(s){T(e.$$.fragment,s),T(n.$$.fragment,s),T(r.$$.fragment,s),a=!1},d(s){G(e,s),s&&p(t),G(n,s),s&&p(i),G(r,s)}}}function zt(l){let e,t,n,i,r,a,o,s,u,d;return a=new st({props:{class:"pt-8",$$slots:{default:[Ht]},$$scope:{ctx:l}}}),{c(){e=P("div"),t=P("div"),n=P("h2"),i=J("Add dataset"),r=j(),F(a.$$.fragment),o=j(),s=P("style"),u=J(`:global(.bx--form-item) {
margin-bottom: 1.5rem
}
:global(.bx--fieldset) {
border-radius: 0.25rem;
border-width: 1px;
--tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity));
padding: 1rem
}
:global(legend.bx--label) {
padding-left: 0.5rem;
padding-right: 0.5rem;
font-size: 1.125rem;
line-height: 1.75rem
}`),this.h()},l(_){e=L(_,"DIV",{class:!0});var c=V(e);t=L(c,"DIV",{class:!0});var m=V(t);n=L(m,"H2",{});var g=V(n);i=Q(g,"Add dataset"),g.forEach(p),r=H(m),A(a.$$.fragment,m),m.forEach(p),c.forEach(p),o=H(_),s=L(_,"STYLE",{lang:!0});var f=V(s);u=Q(f,`:global(.bx--form-item) {
margin-bottom: 1.5rem
}
:global(.bx--fieldset) {
border-radius: 0.25rem;
border-width: 1px;
--tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity));
padding: 1rem
}
:global(legend.bx--label) {
padding-left: 0.5rem;
padding-right: 0.5rem;
font-size: 1.125rem;
line-height: 1.75rem
}`),f.forEach(p),this.h()},h(){M(t,"class","mx-auto flex max-w-xl flex-col"),M(e,"class","h-full w-full overflow-y-auto py-8"),M(s,"lang","postcss")},m(_,c){I(_,e,c),D(e,t),D(t,n),D(n,i),D(t,r),C(a,t,null),I(_,o,c),I(_,s,c),D(s,u),d=!0},p(_,c){const m={};c&2097375&&(m.$$scope={dirty:c,ctx:_}),a.$set(m)},i(_){d||(k(a.$$.fragment,_),d=!0)},o(_){T(a.$$.fragment,_),d=!1},d(_){_&&p(e),G(a),_&&p(o),_&&p(s)}}}function Ot(l){let e,t;return e=new Ze({props:{title:"Datasets",$$slots:{default:[zt]},$$scope:{ctx:l}}}),{c(){F(e.$$.fragment)},l(n){A(e.$$.fragment,n)},m(n,i){C(e,n,i),t=!0},p(n,[i]){const r={};i&2097375&&(r.$$scope={dirty:i,ctx:n}),e.$set(r)},i(n){t||(k(e.$$.fragment,n),t=!0)},o(n){T(e.$$.fragment,n),t=!1},d(n){G(e,n)}}}function Kt(l,e,t){let n,i,r,a,o=x,s=()=>(o(),o=qe(n,v=>t(7,a=v)),n);l.$$.on_destroy.push(()=>o());const u=Je();le(l,u,v=>t(6,r=v));const d=Qe();le(l,d,v=>t(16,i=v));let _="local",c="",m="huggingface",g=[],f={};function h(){g.length||i.mutate([m,{namespace:_,dataset_name:c,config:f}],{onSuccess:v=>{Oe(v.task_id,()=>{Ue(ye(_,c))})}})}function b(v){_=v,t(0,_)}function N(v){c=v,t(1,c)}function z(v){m=v,t(2,m)}function te(v){f=v,t(4,f),t(0,_),t(1,c)}function ne(v){g=v,t(3,g)}return l.$$.update=()=>{l.$$.dirty&4&&s(t(5,n=Ye(m))),l.$$.dirty&3&&t(4,f.source_name=`${_}/${c}`,f)},[_,c,m,g,f,n,r,a,u,d,h,b,N,z,te,ne]}class Zt extends W{constructor(e){super(),X(this,e,Kt,Ot,Y,{})}}export{Zt as component};