import{S as C,i as g,s as z,k as u,a as T,l as d,m as y,c as R,h as f,b as E,D as i,E as L,n as B,F as M,R as O,G as D,q as k,r as P}from"./index.463cc238.js";function N(m){let e,n,a,r,s,t,l,o,v,p,F,b,h;return{c(){e=u("p"),n=k(`Files successfully indexed!
      `),a=u("br"),r=k(`
      Proceed to chatbot :)`),s=T(),t=u("form"),l=u("button"),o=u("a"),v=k("Proceed To Chatbot"),p=T(),F=u("br"),this.h()},l(c){e=d(c,"P",{});var _=y(e);n=P(_,`Files successfully indexed!
      `),a=d(_,"BR",{}),r=P(_,`
      Proceed to chatbot :)`),_.forEach(f),s=R(c),t=d(c,"FORM",{});var S=y(t);l=d(S,"BUTTON",{type:!0});var U=y(l);o=d(U,"A",{href:!0});var w=y(o);v=P(w,"Proceed To Chatbot"),w.forEach(f),U.forEach(f),p=R(S),F=d(S,"BR",{}),S.forEach(f),this.h()},h(){B(o,"href","/chatbot"),B(l,"type","submit"),l.value="chatbot"},m(c,_){E(c,e,_),i(e,n),i(e,a),i(e,r),E(c,s,_),E(c,t,_),i(t,l),i(l,o),i(o,v),i(t,p),i(t,F),b||(h=M(t,"submit",O(m[3])),b=!0)},p:L,d(c){c&&f(e),c&&f(s),c&&f(t),b=!1,h()}}}function $(m){let e,n,a,r,s,t,l,o,v,p,F,b;return{c(){e=u("p"),n=k(`These are the files your LLM will use to learn from.
      `),a=u("br"),r=k(`
      Select more, or click Process Files to continue.`),s=T(),t=u("form"),l=u("button"),o=k("Index Files"),v=T(),p=u("br"),this.h()},l(h){e=d(h,"P",{});var c=y(e);n=P(c,`These are the files your LLM will use to learn from.
      `),a=d(c,"BR",{}),r=P(c,`
      Select more, or click Process Files to continue.`),c.forEach(f),s=R(h),t=d(h,"FORM",{});var _=y(t);l=d(_,"BUTTON",{type:!0});var S=y(l);o=P(S,"Index Files"),S.forEach(f),v=R(_),p=d(_,"BR",{}),_.forEach(f),this.h()},h(){B(l,"type","submit"),l.value="index"},m(h,c){E(h,e,c),i(e,n),i(e,a),i(e,r),E(h,s,c),E(h,t,c),i(t,l),i(l,o),i(t,v),i(t,p),F||(b=M(t,"submit",O(m[3])),F=!0)},p:L,d(h){h&&f(e),h&&f(s),h&&f(t),F=!1,b()}}}function x(m){let e,n,a,r,s,t;return{c(){e=u("div"),n=u("h3"),a=k("Upload Files"),r=T(),s=u("p"),t=k("Select the files your LLM will use to learn from.")},l(l){e=d(l,"DIV",{});var o=y(e);n=d(o,"H3",{});var v=y(n);a=P(v,"Upload Files"),v.forEach(f),r=R(o),s=d(o,"P",{});var p=y(s);t=P(p,"Select the files your LLM will use to learn from."),p.forEach(f),o.forEach(f)},m(l,o){E(l,e,o),i(e,n),i(n,a),i(e,r),i(e,s),i(s,t)},p:L,d(l){l&&f(e)}}}function I(m){let e,n,a,r,s,t;return{c(){e=u("form"),n=u("br"),a=T(),r=u("input"),this.h()},l(l){e=d(l,"FORM",{});var o=y(e);n=d(o,"BR",{}),a=R(o),r=d(o,"INPUT",{type:!0}),o.forEach(f),this.h()},h(){B(r,"type","file"),r.multiple=!0},m(l,o){E(l,e,o),i(e,n),i(e,a),i(e,r),s||(t=[M(r,"change",m[2]),M(e,"submit",O(m[4]))],s=!0)},p:L,d(l){l&&f(e),s=!1,D(t)}}}function j(m){let e,n;function a(l,o){return l[0]?l[1]?N:$:x}let r=a(m),s=r(m),t=!m[1]&&I(m);return{c(){e=u("div"),s.c(),n=T(),t&&t.c()},l(l){e=d(l,"DIV",{});var o=y(e);s.l(o),n=R(o),t&&t.l(o),o.forEach(f)},m(l,o){E(l,e,o),s.m(e,null),i(e,n),t&&t.m(e,null)},p(l,[o]){r===(r=a(l))&&s?s.p(l,o):(s.d(1),s=r(l),s&&(s.c(),s.m(e,n))),l[1]?t&&(t.d(1),t=null):t?t.p(l,o):(t=I(l),t.c(),t.m(e,null))},i:L,o:L,d(l){l&&f(e),s.d(),t&&t.d()}}}function q(m,e,n){let a=[],r=!1,s,t=!1;const l=p=>{const F=p.target.files;s=Array.from(F).map(b=>({name:b.name,size:b.size,extension:b.name.split(".").pop()})),s.forEach(b=>console.log(`Size of ${b.name}: ${b.size} bytes`)),a=s,n(0,r=!0)};async function o(){console.log("running inference");const F=await(await fetch("/api/index",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"hey"})})).json();console.log("response",F),n(1,t=!0)}return[r,t,l,o,p=>{p.preventDefault(),console.log(a),console.log("submit!")}]}class V extends C{constructor(e){super(),g(this,e,q,j,z,{})}}export{V as U};
