DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
import{s as re,k as W,l as X,m as ie,d as g,o as A,i as z,j as U,p as ne,B as q,e as v,t as Z,c as b,a as k,b as x,f as y,g as d,h as $,E as C,N as O}from"../chunks/scheduler.DB3Sqaa-.js";import{S as ue,i as me,t as H,a as F,c as ce,f as T,b as de,d as fe,m as _e,e as ge,g as pe}from"../chunks/index.CidI1d1E.js";import{g as ee}from"../chunks/entry.JtQ7vg2d.js";import{p as he}from"../chunks/stores.m3IJIQGn.js";import{d as se}from"../chunks/dayjs.min.CnqrW7zs.js";import{h as te,W as ve,m as be}from"../chunks/index.DPWiq6NR.js";import{a as ye}from"../chunks/index.DYGdzELC.js";import{g as Ie,a as we}from"../chunks/index.CKAPQz6-.js";import{M as Me}from"../chunks/Messages.B-ODG6LJ.js";import"../chunks/Toaster.svelte_svelte_type_style_lang.C-7zrEBl.js";import"../chunks/Modal.DcRcsIox.js";import"../chunks/create.DJSy4-Dz.js";import{g as Ee}from"../chunks/index.BS8UhGmM.js";import"../chunks/Selector.svelte_svelte_type_style_lang.WKCdmVFr.js";import"../chunks/FileSaver.min.CimDdHIv.js";import"../chunks/index.DQfRr7yB.js";function ae(s){let u,t,r,i,a,o,m,I,h=se(s[4].chat.timestamp).format(s[10].t("MMMM DD, YYYY"))+"",S,w,D,V,M,c,n,f,Y,B,N,e;function E(l){s[14](l)}function oe(l){s[15](l)}function le(l){s[16](l)}let j={user:s[5],chatId:s[8],readOnly:!0,selectedModels:s[3],processing:Se,bottomPadding:s[12].length>0,sendPrompt:De,continueResponse:Ve,regenerateResponse:Ye};return s[0]!==void 0&&(j.history=s[0]),s[7]!==void 0&&(j.messages=s[7]),s[2]!==void 0&&(j.autoScroll=s[2]),f=new Me({props:j}),q.push(()=>T(f,"history",E)),q.push(()=>T(f,"messages",oe)),q.push(()=>T(f,"autoScroll",le)),{c(){u=v("div"),t=v("div"),r=v("div"),i=v("div"),a=v("div"),o=Z(s[6]),m=W(),I=v("div"),S=Z(h),w=W(),D=v("hr"),V=W(),M=v("div"),c=v("div"),n=v("div"),de(f.$$.fragment),this.h()},l(l){u=b(l,"DIV",{class:!0});var _=k(u);t=b(_,"DIV",{class:!0});var p=k(t);r=b(p,"DIV",{class:!0});var P=k(r);i=b(P,"DIV",{});var R=k(i);a=b(R,"DIV",{class:!0});var G=k(a);o=x(G,s[6]),G.forEach(g),m=A(R),I=b(R,"DIV",{class:!0});var J=k(I);S=x(J,h),J.forEach(g),R.forEach(g),w=A(P),D=b(P,"HR",{class:!0}),P.forEach(g),V=A(p),M=b(p,"DIV",{class:!0,id:!0});var K=k(M);c=b(K,"DIV",{class:!0});var L=k(c);n=b(L,"DIV",{class:!0});var Q=k(n);fe(f.$$.fragment,Q),Q.forEach(g),L.forEach(g),K.forEach(g),p.forEach(g),_.forEach(g),this.h()},h(){y(a,"class","text-3xl font-semibold line-clamp-1"),y(I,"class","mt-1 text-gray-400"),y(D,"class","dark:border-gray-800 mt-6 mb-2"),y(r,"class","px-3 w-full max-w-5xl mx-auto"),y(n,"class","py-2"),y(c,"class","h-full w-full flex flex-col py-4"),y(M,"class","flex flex-col w-full flex-auto overflow-auto h-0"),y(M,"id","messages-container"),y(t,"class","flex flex-col flex-auto justify-center py-8"),y(u,"class","min-h-screen max-h-screen w-full flex flex-col text-gray-700 dark:text-gray-100 bg-white dark:bg-gray-900")},m(l,_){z(l,u,_),d(u,t),d(t,r),d(r,i),d(i,a),d(a,o),d(i,m),d(i,I),d(I,S),d(r,w),d(r,D),d(t,V),d(t,M),d(M,c),d(c,n),_e(f,n,null),e=!0},p(l,_){(!e||_&64)&&$(o,l[6]),(!e||_&1040)&&h!==(h=se(l[4].chat.timestamp).format(l[10].t("MMMM DD, YYYY"))+"")&&$(S,h);const p={};_&32&&(p.user=l[5]),_&256&&(p.chatId=l[8]),_&8&&(p.selectedModels=l[3]),!Y&&_&1&&(Y=!0,p.history=l[0],C(()=>Y=!1)),!B&&_&128&&(B=!0,p.messages=l[7],C(()=>B=!1)),!N&&_&4&&(N=!0,p.autoScroll=l[2],C(()=>N=!1)),f.$set(p)},i(l){e||(H(f.$$.fragment,l),e=!0)},o(l){F(f.$$.fragment,l),e=!1},d(l){l&&g(u),ge(f)}}}function ke(s){let u,t,r,i;document.title=u=`
`+(s[6]?`${s[6].length>30?`${s[6].slice(0,30)}...`:s[6]} | ${s[9]}`:`${s[9]}`)+`
`;let a=s[1]&&ae(s);return{c(){t=W(),a&&a.c(),r=X()},l(o){ie("svelte-1123lr8",document.head).forEach(g),t=A(o),a&&a.l(o),r=X()},m(o,m){z(o,t,m),a&&a.m(o,m),z(o,r,m),i=!0},p(o,[m]){(!i||m&576)&&u!==(u=`
`+(o[6]?`${o[6].length>30?`${o[6].slice(0,30)}...`:o[6]} | ${o[9]}`:`${o[9]}`)+`
`)&&(document.title=u),o[1]?a?(a.p(o,m),m&2&&H(a,1)):(a=ae(o),a.c(),H(a,1),a.m(r.parentNode,r)):a&&(pe(),F(a,1,1,()=>{a=null}),ce())},i(o){i||(H(a),i=!0)},o(o){F(a),i=!1},d(o){o&&(g(t),g(r)),a&&a.d(o)}}}let Se="";const De=()=>{},Ve=()=>{},Ye=()=>{};function Be(s,u,t){let r,i,a,o;U(s,te,e=>t(8,r=e)),U(s,he,e=>t(13,i=e)),U(s,ve,e=>t(9,a=e));const m=ne("i18n");U(s,m,e=>t(10,o=e));let I=!1,h=!0,S=[""],w=null,D=null,V="",M=[],c=[],n={messages:{},currentId:null};const f=async()=>{if(await be.set(await Ee(localStorage.token)),await te.set(i.params.id),t(4,w=await Ie(localStorage.token,r).catch(async e=>(await ee("/"),null))),w){t(5,D=await we(localStorage.token,w.user_id).catch(E=>(console.error(E),null)));const e=w.chat;return e?(console.log(e),t(3,S=((e==null?void 0:e.models)??void 0)!==void 0?e.models:[e.models??""]),t(0,n=((e==null?void 0:e.history)??void 0)!==void 0?e.history:ye(e.messages)),t(6,V=e.title),t(2,h=!0),await O(),c.length>0&&t(0,n.messages[c.at(-1).id].done=!0,n),await O(),!0):null}};function Y(e){n=e,t(0,n)}function B(e){c=e,t(7,c),t(0,n)}function N(e){h=e,t(2,h)}return s.$$.update=()=>{if(s.$$.dirty&1)if(n.currentId!==null){let e=[],E=n.messages[n.currentId];for(;E!==null;)e.unshift({...E}),E=E.parentId!==null?n.messages[E.parentId]:null;t(7,c=e)}else t(7,c=[]);s.$$.dirty&8192&&i.params.id&&(async()=>await f()?(await O(),t(1,I=!0)):await ee("/"))()},[n,I,h,S,w,D,V,c,r,a,o,m,M,i,Y,B,N]}class Ke extends ue{constructor(u){super(),me(this,u,Be,ke,re,{})}}export{Ke as component};
//# sourceMappingURL=27.BbX2jbub.js.map