muryshev commited on
Commit
05a241e
1 Parent(s): c9979ed
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. build/client/_app/immutable/assets/0.Cn2YjZcW.css +0 -0
  2. build/client/_app/immutable/assets/3.zBATg92h.css +1 -0
  3. build/client/_app/immutable/assets/4.wLw7i_OC.css +1 -0
  4. build/client/_app/immutable/assets/_layout.1AEKjBid.css +0 -0
  5. build/client/_app/immutable/assets/_page.wLw7i_OC.css +1 -0
  6. build/client/_app/immutable/assets/_page.zBATg92h.css +1 -0
  7. build/client/_app/immutable/chunks/LogService.hUlSDADx.js +1 -0
  8. build/client/_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js +1 -0
  9. build/client/_app/immutable/chunks/each.N0yHvFdK.js +1 -0
  10. build/client/_app/immutable/chunks/entry.vZ4dQZZ-.js +3 -0
  11. build/client/_app/immutable/chunks/index.JlSaLmPP.js +4 -0
  12. build/client/_app/immutable/chunks/index.UTqYide5.js +1 -0
  13. build/client/_app/immutable/chunks/scheduler.OwA2AG0M.js +1 -0
  14. build/client/_app/immutable/entry/app.nf8b2onw.js +7 -0
  15. build/client/_app/immutable/entry/start.wAhvLgW-.js +1 -0
  16. build/client/_app/immutable/nodes/0.UBYIs98P.js +1 -0
  17. build/client/_app/immutable/nodes/1.aTX1quDl.js +1 -0
  18. build/client/_app/immutable/nodes/2.lbs4H3Jw.js +0 -0
  19. build/client/_app/immutable/nodes/3.0Qr5_Ol8.js +1 -0
  20. build/client/_app/immutable/nodes/4.WM9VxzNR.js +6 -0
  21. build/client/_app/version.json +1 -1
  22. build/server/chunks/0-VxnFtOWB.js +9 -0
  23. build/server/chunks/0-VxnFtOWB.js.map +1 -0
  24. build/server/chunks/1-zFqe38Kb.js +9 -0
  25. build/server/chunks/1-zFqe38Kb.js.map +1 -0
  26. build/server/chunks/2-Hcaa79bn.js +33 -0
  27. build/server/chunks/2-Hcaa79bn.js.map +1 -0
  28. build/server/chunks/3-CK6H8qlV.js +9 -0
  29. build/server/chunks/3-CK6H8qlV.js.map +1 -0
  30. build/server/chunks/4-x-_yQ3I4.js +9 -0
  31. build/server/chunks/4-x-_yQ3I4.js.map +1 -0
  32. build/server/chunks/LlamaCppService-XtF0SQo9.js +292 -0
  33. build/server/chunks/LlamaCppService-XtF0SQo9.js.map +1 -0
  34. build/server/chunks/LogService-b0lb4PC5.js +295 -0
  35. build/server/chunks/LogService-b0lb4PC5.js.map +1 -0
  36. build/server/chunks/_page.svelte-E0YaQIXg.js +28 -0
  37. build/server/chunks/_page.svelte-E0YaQIXg.js.map +1 -0
  38. build/server/chunks/_page.svelte-lDFDd0lS.js +1743 -0
  39. build/server/chunks/_page.svelte-lDFDd0lS.js.map +0 -0
  40. build/server/chunks/_page.svelte-sUWsV2Jl.js +32 -0
  41. build/server/chunks/_page.svelte-sUWsV2Jl.js.map +1 -0
  42. build/server/chunks/_server.ts-8mYiDGIH.js +30 -0
  43. build/server/chunks/_server.ts-8mYiDGIH.js.map +1 -0
  44. build/server/chunks/_server.ts-FEch4V3G.js +44 -0
  45. build/server/chunks/_server.ts-FEch4V3G.js.map +1 -0
  46. build/server/chunks/_server.ts-YFmGk0Au.js +19 -0
  47. build/server/chunks/_server.ts-YFmGk0Au.js.map +1 -0
  48. build/server/chunks/_server.ts-dKSZf0JA.js +44 -0
  49. build/server/chunks/_server.ts-dKSZf0JA.js.map +1 -0
  50. build/server/chunks/_server.ts-qLni9m0O.js +33 -0
build/client/_app/immutable/assets/0.Cn2YjZcW.css ADDED
The diff for this file is too large to render. See raw diff
 
build/client/_app/immutable/assets/3.zBATg92h.css ADDED
@@ -0,0 +1 @@
 
 
1
+ pre.svelte-1m09ey3{font-size:.875rem;line-height:1.25rem;overflow:auto;border:none;box-shadow:none;background:none;padding:0;font-family:system-ui;color:#000;white-space:pre-wrap}
build/client/_app/immutable/assets/4.wLw7i_OC.css ADDED
@@ -0,0 +1 @@
 
 
1
+ .export_bar.svelte-1szjsif,.filters.svelte-1szjsif{display:flex;align-items:center;gap:10px;margin:20px}.export_bar.svelte-1szjsif{justify-content:space-between}#fields_container.svelte-1szjsif{display:flex;flex-direction:column}
build/client/_app/immutable/assets/_layout.1AEKjBid.css ADDED
The diff for this file is too large to render. See raw diff
 
build/client/_app/immutable/assets/_page.wLw7i_OC.css ADDED
@@ -0,0 +1 @@
 
 
1
+ .export_bar.svelte-1szjsif,.filters.svelte-1szjsif{display:flex;align-items:center;gap:10px;margin:20px}.export_bar.svelte-1szjsif{justify-content:space-between}#fields_container.svelte-1szjsif{display:flex;flex-direction:column}
build/client/_app/immutable/assets/_page.zBATg92h.css ADDED
@@ -0,0 +1 @@
 
 
1
+ pre.svelte-1m09ey3{font-size:.875rem;line-height:1.25rem;overflow:auto;border:none;box-shadow:none;background:none;padding:0;font-family:system-ui;color:#000;white-space:pre-wrap}
build/client/_app/immutable/chunks/LogService.hUlSDADx.js ADDED
@@ -0,0 +1 @@
 
 
1
+ const s="/api/log";class c{static async log(t){try{const o=await fetch(`${s}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok)throw new Error("Failed to record log entry");return(await o.json()).id}catch(o){console.error("Error while sending log to server:",o)}}static async exportToJson(t,o){try{const r=new URLSearchParams;t&&r.append("dateFrom",t.toISOString()),o&&r.append("dateTo",o.toISOString());const e=await fetch(`${s}/export/json?${r.toString()}`);if(!e.ok)throw new Error("Failed to export logs to JSON");const a=await e.json();console.log(a.message)}catch(r){console.error("Error while exporting logs to JSON:",r)}}static async exportToExcel(t,o,r){try{const e=new URLSearchParams;t&&e.append("dateFrom",t.toISOString()),o&&e.append("dateTo",o.toISOString()),r&&r.length>0&&e.append("fields",r.join(","));const a=await fetch(`${s}/export/excel?${e.toString()}`);if(!a.ok)throw new Error("Failed to export logs to Excel");return await a.blob()}catch(e){console.error("Error while exporting logs to Excel:",e)}return null}static async logUserScore(t,o,r){const e=await fetch("/api/log/write/userScore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t,score:o,comment:r})});if(!e.ok)throw new Error("Failed to update user score");if((await e.json()).message!=="User score updated successfully")throw new Error("User score update failed")}}export{c as L};
build/client/_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{w as q,r as j}from"./index.UTqYide5.js";import{C as Q}from"./scheduler.OwA2AG0M.js";const R=q(void 0);function J(t,e){const{computePosition:u,autoUpdate:c,offset:m,shift:w,flip:d,arrow:p,size:v,autoPlacement:i,hide:l,inline:E}=Q(R),r={open:!1,autoUpdateCleanup:()=>{}},S=':is(a[href], button, input, textarea, select, details, [tabindex]):not([tabindex="-1"])';let b;const f="https://www.skeleton.dev/utilities/popups";let o,y;function P(){o=document.querySelector(`[data-popup="${e.target}"]`)??document.createElement("div"),y=o.querySelector(".arrow")??document.createElement("div")}P();function L(){if(!o)throw new Error(`The data-popup="${e.target}" element was not found. ${f}`);if(!u)throw new Error(`Floating UI 'computePosition' not found for data-popup="${e.target}". ${f}`);if(!m)throw new Error(`Floating UI 'offset' not found for data-popup="${e.target}". ${f}`);if(!w)throw new Error(`Floating UI 'shift' not found for data-popup="${e.target}". ${f}`);if(!d)throw new Error(`Floating UI 'flip' not found for data-popup="${e.target}". ${f}`);if(!p)throw new Error(`Floating UI 'arrow' not found for data-popup="${e.target}". ${f}`);const n=[];v&&n.push(v(e.middleware?.size)),i&&n.push(i(e.middleware?.autoPlacement)),l&&n.push(l(e.middleware?.hide)),E&&n.push(E(e.middleware?.inline)),u(t,o,{placement:e.placement??"bottom",middleware:[m(e.middleware?.offset??8),w(e.middleware?.shift??{padding:8}),d(e.middleware?.flip),p(e.middleware?.arrow??{element:y||null}),...n]}).then(({x:a,y:M,placement:U,middlewareData:z})=>{if(Object.assign(o.style,{left:`${a}px`,top:`${M}px`}),y){const{x:F,y:D}=z.arrow,O={top:"bottom",right:"left",bottom:"top",left:"right"}[U.split("-")[0]];Object.assign(y.style,{left:F!=null?`${F}px`:"",top:D!=null?`${D}px`:"",right:"",bottom:"",[O]:"-4px"})}})}function h(){o&&(r.open=!0,e.state&&e.state({state:r.open}),L(),o.style.display="block",o.style.opacity="1",o.style.pointerEvents="auto",o.removeAttribute("inert"),r.autoUpdateCleanup=c(t,o,L),b=Array.from(o?.querySelectorAll(S)))}function s(n){if(!o)return;const a=parseFloat(window.getComputedStyle(o).transitionDuration.replace("s",""))*1e3;setTimeout(()=>{r.open=!1,e.state&&e.state({state:r.open}),o.style.opacity="0",o.setAttribute("inert",""),r.autoUpdateCleanup&&r.autoUpdateCleanup(),n&&n()},a)}function $(){r.open===!1?h():s()}function k(n){if(r.open===!1||t.contains(n.target))return;if(o&&o.contains(n.target)===!1){s();return}const a=e.closeQuery===void 0?"a[href], button":e.closeQuery;if(a==="")return;o?.querySelectorAll(a)?.forEach(U=>{U.contains(n.target)&&s()})}const C=n=>{if(r.open===!1)return;const a=n.key;if(a==="Escape"){n.preventDefault(),t.focus(),s();return}b=Array.from(o?.querySelectorAll(S)),r.open&&document.activeElement===t&&(a==="ArrowDown"||a==="Tab")&&S.length>0&&b.length>0&&(n.preventDefault(),b[0].focus())};switch(e.event){case"click":t.addEventListener("click",$,!0),window.addEventListener("click",k,!0);break;case"hover":t.addEventListener("mouseover",h,!0),t.addEventListener("mouseleave",()=>s(),!0);break;case"focus-blur":t.addEventListener("focus",$,!0),t.addEventListener("blur",()=>s(),!0);break;case"focus-click":t.addEventListener("focus",h,!0),window.addEventListener("click",k,!0);break;default:throw new Error(`Event value of '${e.event}' is not supported. ${f}`)}return window.addEventListener("keydown",C,!0),L(),{update(n){s(()=>{e=n,L(),P()})},destroy(){t.removeEventListener("click",$,!0),t.removeEventListener("mouseover",h,!0),t.removeEventListener("mouseleave",()=>s(),!0),t.removeEventListener("focus",$,!0),t.removeEventListener("focus",h,!0),t.removeEventListener("blur",()=>s(),!0),window.removeEventListener("click",k,!0),window.removeEventListener("keydown",C,!0)}}}const x={};function I(t){return t==="local"?localStorage:sessionStorage}function A(t,e,u){const c=u?.serializer??JSON,m=u?.storage??"local";function w(d,p){I(m).setItem(d,c.stringify(p))}if(!x[t]){const d=q(e,i=>{const l=I(m).getItem(t);l&&i(c.parse(l));{const E=r=>{r.key===t&&i(r.newValue?c.parse(r.newValue):null)};return window.addEventListener("storage",E),()=>window.removeEventListener("storage",E)}}),{subscribe:p,set:v}=d;x[t]={set(i){w(t,i),v(i)},update(i){const l=i(Q(d));w(t,l),v(l)},subscribe:p}}return x[t]}A("modeOsPrefers",!1);A("modeUserPrefers",void 0);A("modeCurrent",!1);const T="(prefers-reduced-motion: reduce)";function V(){return window.matchMedia(T).matches}const K=j(V(),t=>{{const e=c=>{t(c.matches)},u=window.matchMedia(T);return u.addEventListener("change",e),()=>{u.removeEventListener("change",e)}}});export{K as a,J as p,R as s};
build/client/_app/immutable/chunks/each.N0yHvFdK.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{t as q,a as z}from"./index.JlSaLmPP.js";import{r as B}from"./scheduler.OwA2AG0M.js";function F(n){return n?.length!==void 0?n:Array.from(n)}function C(n,f){z(n,1,1,()=>{f.delete(n.key)})}function G(n,f){n.f(),C(n,f)}function H(n,f,M,v,x,y,c,S,m,A,h,j){let i=n.length,o=y.length,a=i;const _={};for(;a--;)_[n[a].key]=a;const d=[],r=new Map,u=new Map,g=[];for(a=o;a--;){const e=j(x,y,a),t=M(e);let s=c.get(t);s?v&&g.push(()=>s.p(e,f)):(s=A(t,e),s.c()),r.set(t,d[a]=s),t in _&&u.set(t,Math.abs(a-_[t]))}const p=new Set,k=new Set;function w(e){q(e,1),e.m(S,h),c.set(e.key,e),h=e.first,o--}for(;i&&o;){const e=d[o-1],t=n[i-1],s=e.key,l=t.key;e===t?(h=e.first,i--,o--):r.has(l)?!c.has(s)||p.has(s)?w(e):k.has(l)?i--:u.get(s)>u.get(l)?(k.add(s),w(e)):(p.add(l),i--):(m(t,c),i--)}for(;i--;){const e=n[i];r.has(e.key)||m(e,c)}for(;o;)w(d[o-1]);return B(g),d}export{F as e,G as f,H as u};
build/client/_app/immutable/chunks/entry.vZ4dQZZ-.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import{B as tt}from"./scheduler.OwA2AG0M.js";import{w as de}from"./index.UTqYide5.js";new URL("sveltekit-internal://");function nt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function at(e){return e.split("%25").map(decodeURI).join("%25")}function rt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function se({href:e}){return e.split("#")[0]}const ot=["href","pathname","search","toString","toJSON"];function st(e,t,n){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(r,o){if(o==="get"||o==="getAll"||o==="has")return s=>(n(s),r[o](s));t();const i=Reflect.get(r,o);return typeof i=="function"?i.bind(r):i}}),enumerable:!0,configurable:!0});for(const r of ot)Object.defineProperty(a,r,{get(){return t(),e[r]},enumerable:!0,configurable:!0});return a}const it="/__data.json",ct=".html__data.json";function lt(e){return e.endsWith(".html")?e.replace(/\.html$/,ct):e.replace(/\/$/,"")+it}function ft(...e){let t=5381;for(const n of e)if(typeof n=="string"){let a=n.length;for(;a;)t=t*33^n.charCodeAt(--a)}else if(ArrayBuffer.isView(n)){const a=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let r=a.length;for(;r;)t=t*33^a[--r]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}const Ue=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&$.delete(he(e)),Ue(e,t));const $=new Map;function ut(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n.buffer}function dt(e,t){const n=he(e,t),a=document.querySelector(n);if(a?.textContent){let{body:r,...o}=JSON.parse(a.textContent);const i=a.getAttribute("data-ttl");return i&&$.set(n,{body:r,init:o,ttl:1e3*Number(i)}),a.getAttribute("data-b64")!==null&&(r=ut(r)),Promise.resolve(new Response(r,o))}return window.fetch(e,t)}function ht(e,t,n){if($.size>0){const a=he(e,n),r=$.get(a);if(r){if(performance.now()<r.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(r.body,r.init);$.delete(a)}}return window.fetch(t,n)}function he(e,t){let a=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const r=[];t.headers&&r.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&r.push(t.body),a+=`[data-hash="${ft(...r)}"]`}return a}const pt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function gt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${mt(e).map(a=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(a);if(r)return t.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(a);if(o)return t.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!a)return;const i=a.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return ie(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return ie(String.fromCharCode(...c.slice(2).split("-").map(p=>parseInt(p,16))));const d=pt.exec(c),[,g,u,f,h]=d;return t.push({name:f,matcher:h,optional:!!g,rest:!!u,chained:u?l===1&&i[0]==="":!1}),u?"(.*?)":g?"([^/]*)?":"([^/]+?)"}return ie(c)}).join("")}).join("")}/?$`),params:t}}function _t(e){return!/^\([^)]+\)$/.test(e)}function mt(e){return e.slice(1).split("/").filter(_t)}function yt(e,t,n){const a={},r=e.slice(1),o=r.filter(s=>s!==void 0);let i=0;for(let s=0;s<t.length;s+=1){const c=t[s];let l=r[s-i];if(c.chained&&c.rest&&i&&(l=r.slice(s-i,s+1).filter(d=>d).join("/"),i=0),l===void 0){c.rest&&(a[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){a[c.name]=l;const d=t[s+1],g=r[s+1];d&&!d.rest&&d.optional&&g&&c.chained&&(i=0),!d&&!g&&Object.keys(a).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return a}function ie(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function wt({nodes:e,server_loads:t,dictionary:n,matchers:a}){const r=new Set(t);return Object.entries(n).map(([s,[c,l,d]])=>{const{pattern:g,params:u}=gt(s),f={id:s,exec:h=>{const p=g.exec(h);if(p)return yt(p,u,a)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...l||[]].map(i),leaf:o(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function o(s){const c=s<0;return c&&(s=~s),[c,e[s]]}function i(s){return s===void 0?s:[r.has(s),e[s]]}}function xe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Ae(e,t,n=JSON.stringify){const a=n(t);try{sessionStorage[e]=a}catch{}}const S=globalThis.__sveltekit_yynwj7?.base??"",vt=globalThis.__sveltekit_yynwj7?.assets??S,bt="1726650043044",Ne="sveltekit:snapshot",Oe="sveltekit:scroll",je="sveltekit:states",Et="sveltekit:pageurl",x="sveltekit:history",V="sveltekit:navigation",K={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},q=location.origin;function De(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function pe(){return{x:pageXOffset,y:pageYOffset}}function U(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Se={...K,"":K.hover};function $e(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ce(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=$e(e)}}function le(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!a||ee(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=n?.origin===q&&e.hasAttribute("download");return{url:n,external:r,target:a,download:o}}function Y(e){let t=null,n=null,a=null,r=null,o=null,i=null,s=e;for(;s&&s!==document.documentElement;)a===null&&(a=U(s,"preload-code")),r===null&&(r=U(s,"preload-data")),t===null&&(t=U(s,"keepfocus")),n===null&&(n=U(s,"noscroll")),o===null&&(o=U(s,"reload")),i===null&&(i=U(s,"replacestate")),s=$e(s);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Se[a??"off"],preload_data:Se[r??"off"],keepfocus:c(t),noscroll:c(n),reload:c(o),replace_state:c(i)}}function Re(e){const t=de(e);let n=!0;function a(){n=!0,t.update(i=>i)}function r(i){n=!1,t.set(i)}function o(i){let s;return t.subscribe(c=>{(s===void 0||n&&c!==s)&&i(s=c)})}return{notify:a,set:r,subscribe:o}}function kt(){const{set:e,subscribe:t}=de(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${vt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const i=(await r.json()).version!==bt;return i&&(e(!0),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:a}}function ee(e,t){return e.origin!==q||!e.pathname.startsWith(t)}const At=-1,St=-2,Rt=-3,It=-4,Lt=-5,Pt=-6;function Tt(e,t){if(typeof e=="number")return r(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,a=Array(n.length);function r(o,i=!1){if(o===At)return;if(o===Rt)return NaN;if(o===It)return 1/0;if(o===Lt)return-1/0;if(o===Pt)return-0;if(i)throw new Error("Invalid input");if(o in a)return a[o];const s=n[o];if(!s||typeof s!="object")a[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],l=t?.[c];if(l)return a[o]=l(r(s[1]));switch(c){case"Date":a[o]=new Date(s[1]);break;case"Set":const d=new Set;a[o]=d;for(let f=1;f<s.length;f+=1)d.add(r(s[f]));break;case"Map":const g=new Map;a[o]=g;for(let f=1;f<s.length;f+=2)g.set(r(s[f]),r(s[f+1]));break;case"RegExp":a[o]=new RegExp(s[1],s[2]);break;case"Object":a[o]=Object(s[1]);break;case"BigInt":a[o]=BigInt(s[1]);break;case"null":const u=Object.create(null);a[o]=u;for(let f=1;f<s.length;f+=2)u[s[f]]=r(s[f+1]);break;default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(s.length);a[o]=c;for(let l=0;l<s.length;l+=1){const d=s[l];d!==St&&(c[l]=r(d))}}else{const c={};a[o]=c;for(const l in s){const d=s[l];c[l]=r(d)}}return a[o]}return r(0)}const Ve=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...Ve];const Ut=new Set([...Ve]);[...Ut];function xt(e){return e.filter(t=>t!=null)}class te{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Fe{constructor(t,n){this.status=t,this.location=n}}class ge extends Error{constructor(t,n,a){super(a),this.status=t,this.text=n}}const Nt="x-sveltekit-invalidated",Ot="x-sveltekit-trailing-slash";function J(e){return e instanceof te||e instanceof ge?e.status:500}function jt(e){return e instanceof ge?e.text:"Internal Error"}const T=xe(Oe)??{},F=xe(Ne)??{},Dt=history.pushState,_e=history.replaceState,L={url:Re({}),page:Re({}),navigating:de(null),updated:kt()};function me(e){T[e]=pe()}function $t(e,t){let n=e+1;for(;T[n];)delete T[n],n+=1;for(n=t+1;F[n];)delete F[n],n+=1}function O(e){return location.href=e.href,new Promise(()=>{})}function Ie(){}let ne,fe,W,I,ue,j;const Ge=[],z=[];let N=null;const Me=[],Ct=[];let C=[],y={branch:[],error:null,url:null},ye=!1,X=!1,Le=!0,G=!1,D=!1,qe=!1,we=!1,ve,w,k,A,Z;async function Wt(e,t,n){document.URL!==location.href&&(location.href=location.href),j=e,ne=wt(e),I=document.documentElement,ue=t,fe=e.nodes[0],W=e.nodes[1],fe(),W(),w=history.state?.[x],k=history.state?.[V],w||(w=k=Date.now(),_e.call(history,{...history.state,[x]:w,[V]:k},""));const a=T[w];a&&(history.scrollRestoration="manual",scrollTo(a.x,a.y)),n?await Ht(ue,n):qt(location.href,{replaceState:!0}),Bt()}function Be(e){z.some(t=>t?.snapshot)&&(F[e]=z.map(t=>t?.snapshot?.capture()))}function He(e){F[e]?.forEach((t,n)=>{z[n]?.snapshot?.restore(t)})}function Pe(){me(w),Ae(Oe,T),Be(k),Ae(Ne,F)}async function Ke(e,t,n,a){return H({type:"goto",url:De(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:a,accept:()=>{t.invalidateAll&&(we=!0)}})}async function Vt(e){return N={id:e.id,promise:Je(e).then(t=>(t.type==="loaded"&&t.state.error&&(N=null),t))},N.promise}async function ce(e){const t=ne.find(n=>n.exec(We(e)));t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}function Ye(e,t){y=e.state;const n=document.querySelector("style[data-sveltekit]");n&&n.remove(),A=e.props.page,ve=new j.root({target:t,props:{...e.props,stores:L,components:z},hydrate:!0}),He(k);const a={from:null,to:{params:y.params,route:{id:y.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};C.forEach(r=>r(a)),X=!0}async function Q({url:e,params:t,branch:n,status:a,error:r,route:o,form:i}){let s="never";if(S&&(e.pathname===S||e.pathname===S+"/"))s="always";else for(const f of n)f?.slash!==void 0&&(s=f.slash);e.pathname=nt(e.pathname,s),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:r,route:o},props:{constructors:xt(n).map(f=>f.node.component),page:A}};i!==void 0&&(c.props.form=i);let l={},d=!A,g=0;for(let f=0;f<Math.max(n.length,y.branch.length);f+=1){const h=n[f],p=y.branch[f];h?.data!==p?.data&&(d=!0),h&&(l={...l,...h.data},d&&(c.props[`data_${g}`]=l),g+=1)}return(!y.url||e.href!==y.url.href||y.error!==r||i!==void 0&&i!==A.form||d)&&(c.props.page={error:r,params:t,route:{id:o?.id??null},state:{},status:a,url:new URL(e),form:i??null,data:d?l:A.data}),c}async function be({loader:e,parent:t,url:n,params:a,route:r,server_data_node:o}){let i=null,s=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if(l.universal?.load){let d=function(...u){for(const f of u){const{href:h}=new URL(f,n);c.dependencies.add(h)}};const g={route:new Proxy(r,{get:(u,f)=>(s&&(c.route=!0),u[f])}),params:new Proxy(a,{get:(u,f)=>(s&&c.params.add(f),u[f])}),data:o?.data??null,url:st(n,()=>{s&&(c.url=!0)},u=>{s&&c.search_params.add(u)}),async fetch(u,f){let h;u instanceof Request?(h=u.url,f={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:u.headers,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...f}):h=u;const p=new URL(h,n);return s&&d(p.href),p.origin===n.origin&&(h=p.href.slice(n.origin.length)),X?ht(h,p.href,f):dt(h,f)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),t()},untrack(u){s=!1;try{return u()}finally{s=!0}}};i=await l.universal.load.call(null,g)??null}return{node:l,loader:e,server:o,universal:l.universal?.load?{type:"data",data:i,uses:c}:null,data:i??o?.data??null,slash:l.universal?.trailingSlash??o?.slash}}function Te(e,t,n,a,r,o){if(we)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&n)return!0;for(const i of r.search_params)if(a.has(i))return!0;for(const i of r.params)if(o[i]!==y.params[i])return!0;for(const i of r.dependencies)if(Ge.some(s=>s(new URL(i))))return!0;return!1}function Ee(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Ft(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const a of n){const r=e.searchParams.getAll(a),o=t.searchParams.getAll(a);r.every(i=>o.includes(i))&&o.every(i=>r.includes(i))&&n.delete(a)}return n}async function Je({id:e,invalidating:t,url:n,params:a,route:r}){if(N?.id===e)return N.promise;const{errors:o,layouts:i,leaf:s}=r,c=[...i,s];o.forEach(_=>_?.().catch(()=>{})),c.forEach(_=>_?.[1]().catch(()=>{}));let l=null;const d=y.url?e!==y.url.pathname+y.url.search:!1,g=y.route?r.id!==y.route.id:!1,u=Ft(y.url,n);let f=!1;const h=c.map((_,m)=>{const v=y.branch[m],b=!!_?.[0]&&(v?.loader!==_[1]||Te(f,g,d,u,v.server?.uses,a));return b&&(f=!0),b});if(h.some(Boolean)){try{l=await Ze(n,h)}catch(_){return ae({status:J(_),error:await M(_,{url:n,params:a,route:{id:r.id}}),url:n,route:r})}if(l.type==="redirect")return l}const p=l?.nodes;let R=!1;const E=c.map(async(_,m)=>{if(!_)return;const v=y.branch[m],b=p?.[m];if((!b||b.type==="skip")&&_[1]===v?.loader&&!Te(R,g,d,u,v.universal?.uses,a))return v;if(R=!0,b?.type==="error")throw b;return be({loader:_[1],url:n,params:a,route:r,parent:async()=>{const re={};for(let oe=0;oe<m;oe+=1)Object.assign(re,(await E[oe])?.data);return re},server_data_node:Ee(b===void 0&&_[0]?{type:"skip"}:b??null,_[0]?v?.server:void 0)})});for(const _ of E)_.catch(()=>{});const P=[];for(let _=0;_<c.length;_+=1)if(c[_])try{P.push(await E[_])}catch(m){if(m instanceof Fe)return{type:"redirect",location:m.location};let v=J(m),b;if(p?.includes(m))v=m.status??v,b=m.error;else if(m instanceof te)b=m.body;else{if(await L.updated.check())return await O(n);b=await M(m,{params:a,url:n,route:{id:r.id}})}const B=await Gt(_,P,o);return B?await Q({url:n,params:a,branch:P.slice(0,B.idx).concat(B.node),status:v,error:b,route:r}):await Xe(n,{id:r.id},b,v)}else P.push(void 0);return await Q({url:n,params:a,branch:P,status:200,error:null,route:r,form:t?void 0:null})}async function Gt(e,t,n){for(;e--;)if(n[e]){let a=e;for(;!t[a];)a-=1;try{return{idx:a+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ae({status:e,error:t,url:n,route:a}){const r={};let o=null;if(j.server_loads[0]===0)try{const l=await Ze(n,[!0]);if(l.type!=="data"||l.nodes[0]&&l.nodes[0].type!=="data")throw 0;o=l.nodes[0]??null}catch{(n.origin!==q||n.pathname!==location.pathname||ye)&&await O(n)}const s=await be({loader:fe,url:n,params:r,route:a,parent:()=>Promise.resolve({}),server_data_node:Ee(o)}),c={node:await W(),loader:W,universal:null,server:null,data:null};return await Q({url:n,params:r,branch:[s,c],status:e,error:t,route:null})}function ke(e,t){if(!e||ee(e,S))return;let n;try{n=j.hooks.reroute({url:new URL(e)})??e.pathname}catch{return}const a=We(n);for(const r of ne){const o=r.exec(a);if(o)return{id:e.pathname+e.search,invalidating:t,route:r,params:rt(o),url:e}}}function We(e){return at(e.slice(S.length)||"/")}function ze({url:e,type:t,intent:n,delta:a}){let r=!1;const o=et(y,n,e,t);a!==void 0&&(o.navigation.delta=a);const i={...o.navigation,cancel:()=>{r=!0,o.reject(new Error("navigation cancelled"))}};return G||Me.forEach(s=>s(i)),r?null:o}async function H({type:e,url:t,popped:n,keepfocus:a,noscroll:r,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:l=Ie,block:d=Ie}){const g=ke(t,!1),u=ze({url:t,type:e,delta:n?.delta,intent:g});if(!u){d();return}const f=w,h=k;l(),G=!0,X&&L.navigating.set(u.navigation),Z=c;let p=g&&await Je(g);if(!p){if(ee(t,S))return await O(t);p=await Xe(t,{id:null},await M(new ge(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404)}if(t=g?.url||t,Z!==c)return u.reject(new Error("navigation aborted")),!1;if(p.type==="redirect")if(s>=20)p=await ae({status:500,error:await M(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}});else return Ke(new URL(p.location,t).href,{},s+1,c),!1;else p.props.page.status>=400&&await L.updated.check()&&await O(t);if(Ge.length=0,we=!1,me(f),Be(h),p.props.page.url.pathname!==t.pathname&&(t.pathname=p.props.page.url.pathname),i=n?n.state:i,!n){const _=o?0:1,m={[x]:w+=_,[V]:k+=_,[je]:i};(o?_e:Dt).call(history,m,"",t),o||$t(w,k)}if(N=null,p.props.page.state=i,X){y=p.state,p.props.page&&(p.props.page.url=t);const _=(await Promise.all(Ct.map(m=>m(u.navigation)))).filter(m=>typeof m=="function");if(_.length>0){let m=function(){C=C.filter(v=>!_.includes(v))};_.push(m),callbacks.after_navigate.push(..._)}ve.$set(p.props),qe=!0}else Ye(p,ue);const{activeElement:R}=document;await tt();const E=n?n.scroll:r?pe():null;if(Le){const _=t.hash&&document.getElementById(decodeURIComponent(t.hash.slice(1)));E?scrollTo(E.x,E.y):_?_.scrollIntoView():scrollTo(0,0)}const P=document.activeElement!==R&&document.activeElement!==document.body;!a&&!P&&Kt(),Le=!0,p.props.page&&(A=p.props.page),G=!1,e==="popstate"&&He(k),u.fulfil(void 0),C.forEach(_=>_(u.navigation)),L.navigating.set(null)}async function Xe(e,t,n,a){return e.origin===q&&e.pathname===location.pathname&&!ye?await ae({status:a,error:n,url:e,route:t}):await O(e)}function Mt(){let e;I.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(e),e=setTimeout(()=>{a(i,2)},20)});function t(o){a(o.composedPath()[0],1)}I.addEventListener("mousedown",t),I.addEventListener("touchstart",t,{passive:!0});const n=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ce(i.target.href),n.unobserve(i.target))},{threshold:0});function a(o,i){const s=Ce(o,I);if(!s)return;const{url:c,external:l,download:d}=le(s,S);if(l||d)return;const g=Y(s);if(!g.reload)if(i<=g.preload_data){const u=ke(c,!1);u&&Vt(u)}else i<=g.preload_code&&ce(c.pathname)}function r(){n.disconnect();for(const o of I.querySelectorAll("a")){const{url:i,external:s,download:c}=le(o,S);if(s||c)continue;const l=Y(o);l.reload||(l.preload_code===K.viewport&&n.observe(o),l.preload_code===K.eager&&ce(i.pathname))}}C.push(r),r()}function M(e,t){if(e instanceof te)return e.body;const n=J(e),a=jt(e);return j.hooks.handleError({error:e,event:t,status:n,message:a})??{message:a}}function qt(e,t={}){return e=De(e),e.origin!==q?Promise.reject(new Error("goto: invalid URL")):Ke(e,t,0)}function Bt(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Pe(),!G){const a=et(y,void 0,null,"leave"),r={...a.navigation,cancel:()=>{n=!0,a.reject(new Error("navigation cancelled"))}};Me.forEach(o=>o(r))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Pe()}),navigator.connection?.saveData||Mt(),I.addEventListener("click",t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Ce(t.composedPath()[0],I);if(!n)return;const{url:a,external:r,target:o,download:i}=le(n,S);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const s=Y(n);if(!(n instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||i)return;if(r||s.reload){ze({url:a,type:"link"})?G=!0:t.preventDefault();return}const[l,d]=a.href.split("#");if(d!==void 0&&l===se(location)){const[,g]=y.url.href.split("#");if(g===d){t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):n.ownerDocument.getElementById(d)?.scrollIntoView();return}if(D=!0,me(w),e(a),!s.replace_state)return;D=!1}t.preventDefault(),H({type:"link",url:a,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??a.href===location.href})}),I.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),a=t.submitter;if((a?.formMethod||n.method)!=="get")return;const o=new URL(a?.hasAttribute("formaction")&&a?.formAction||n.action);if(ee(o,S))return;const i=t.target,s=Y(i);if(s.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(i),l=a?.getAttribute("name");l&&c.append(l,a?.getAttribute("value")??""),o.search=new URLSearchParams(c).toString(),H({type:"form",url:o,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??o.href===location.href})}),addEventListener("popstate",async t=>{if(t.state?.[x]){const n=t.state[x];if(Z={},n===w)return;const a=T[n],r=t.state[je]??{},o=new URL(t.state[Et]??location.href),i=t.state[V],s=se(location)===se(y.url);if(i===k&&(qe||s)){e(o),T[w]=pe(),a&&scrollTo(a.x,a.y),r!==A.state&&(A={...A,state:r},ve.$set({page:A})),w=n;return}const l=n-w;await H({type:"popstate",url:o,popped:{state:r,scroll:a,delta:l},accept:()=>{w=n,k=i},block:()=>{history.go(-l)},nav_token:Z})}else if(!D){const n=new URL(location.href);e(n)}}),addEventListener("hashchange",()=>{D&&(D=!1,_e.call(history,{...history.state,[x]:++w,[V]:k},"",location.href))});for(const t of document.querySelectorAll("link"))t.rel==="icon"&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&L.navigating.set(null)});function e(t){y.url=t,L.page.set({...A,url:t}),L.page.notify()}}async function Ht(e,{status:t=200,error:n,node_ids:a,params:r,route:o,data:i,form:s}){ye=!0;const c=new URL(location.href);({params:r={},route:o={id:null}}=ke(c,!1)||{});let l;try{const d=a.map(async(f,h)=>{const p=i[h];return p?.uses&&(p.uses=Qe(p.uses)),be({loader:j.nodes[f],url:c,params:r,route:o,parent:async()=>{const R={};for(let E=0;E<h;E+=1)Object.assign(R,(await d[E]).data);return R},server_data_node:Ee(p)})}),g=await Promise.all(d),u=ne.find(({id:f})=>f===o.id);if(u){const f=u.layouts;for(let h=0;h<f.length;h++)f[h]||g.splice(h,0,void 0)}l=await Q({url:c,params:r,branch:g,status:t,error:n,form:s,route:u??null})}catch(d){if(d instanceof Fe){await O(new URL(d.location,location.href));return}l=await ae({status:J(d),error:await M(d,{url:c,params:r,route:o}),url:c,route:o})}l.props.page&&(l.props.page.state={}),Ye(l,e)}async function Ze(e,t){const n=new URL(e);n.pathname=lt(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(Ot,"1"),n.searchParams.append(Nt,t.map(r=>r?"1":"0").join(""));const a=await Ue(n.href);if(!a.ok){let r;throw a.headers.get("content-type")?.includes("application/json")?r=await a.json():a.status===404?r="Not Found":a.status===500&&(r="Internal Error"),new te(a.status,r)}return new Promise(async r=>{const o=new Map,i=a.body.getReader(),s=new TextDecoder;function c(d){return Tt(d,{Promise:g=>new Promise((u,f)=>{o.set(g,{fulfil:u,reject:f})})})}let l="";for(;;){const{done:d,value:g}=await i.read();if(d&&!l)break;for(l+=!g&&l?`
2
+ `:s.decode(g,{stream:!0});;){const u=l.indexOf(`
3
+ `);if(u===-1)break;const f=JSON.parse(l.slice(0,u));if(l=l.slice(u+1),f.type==="redirect")return r(f);if(f.type==="data")f.nodes?.forEach(h=>{h?.type==="data"&&(h.uses=Qe(h.uses),h.data=c(h.data))}),r(f);else if(f.type==="chunk"){const{id:h,data:p,error:R}=f,E=o.get(h);o.delete(h),R?E.reject(c(R)):E.fulfil(c(p))}}}})}function Qe(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}function Kt(){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const t=document.body,n=t.getAttribute("tabindex");t.tabIndex=-1,t.focus({preventScroll:!0,focusVisible:!1}),n!==null?t.setAttribute("tabindex",n):t.removeAttribute("tabindex");const a=getSelection();if(a&&a.type!=="None"){const r=[];for(let o=0;o<a.rangeCount;o+=1)r.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===r.length){for(let o=0;o<a.rangeCount;o+=1){const i=r[o],s=a.getRangeAt(o);if(i.commonAncestorContainer!==s.commonAncestorContainer||i.startContainer!==s.startContainer||i.endContainer!==s.endContainer||i.startOffset!==s.startOffset||i.endOffset!==s.endOffset)return}a.removeAllRanges()}})}}}function et(e,t,n,a){let r,o;const i=new Promise((c,l)=>{r=c,o=l});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n},willUnload:!t,type:a,complete:i},fulfil:r,reject:o}}export{Wt as a,L as s};
build/client/_app/immutable/chunks/index.JlSaLmPP.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ import{n as w,D as Q,f as A,E as T,r as v,F as R,G as b,H as U,I as D,J as N,b as V,K as q,L as W,M as X,N as Y,O as z,P as Z,Q as tt,R as et,S as nt,T as st}from"./scheduler.OwA2AG0M.js";const F=typeof window<"u";let L=F?()=>window.performance.now():()=>Date.now(),I=F?t=>requestAnimationFrame(t):w;const p=new Set;function B(t){p.forEach(e=>{e.c(t)||(p.delete(e),e.f())}),p.size!==0&&I(B)}function G(t){let e;return p.size===0&&I(B),{promise:new Promise(n=>{p.add(e={c:t,f:n})}),abort(){p.delete(e)}}}const k=new Map;let O=0;function it(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function rt(t,e){const n={stylesheet:T(e),rules:{}};return k.set(t,n),n}function H(t,e,n,s,r,a,u,l=0){const d=16.666/s;let i=`{
2
+ `;for(let g=0;g<=1;g+=d){const m=e+(n-e)*a(g);i+=g*100+`%{${u(m,1-m)}}
3
+ `}const f=i+`100% {${u(n,1-n)}}
4
+ }`,o=`__svelte_${it(f)}_${l}`,_=Q(t),{stylesheet:c,rules:$}=k.get(_)||rt(_,t);$[o]||($[o]=!0,c.insertRule(`@keyframes ${o} ${f}`,c.cssRules.length));const h=t.style.animation||"";return t.style.animation=`${h?`${h}, `:""}${o} ${s}ms linear ${r}ms 1 both`,O+=1,o}function C(t,e){const n=(t.style.animation||"").split(", "),s=n.filter(e?a=>a.indexOf(e)<0:a=>a.indexOf("__svelte")===-1),r=n.length-s.length;r&&(t.style.animation=s.join(", "),O-=r,O||at())}function at(){I(()=>{O||(k.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&A(e)}),k.clear())})}let x;function J(){return x||(x=Promise.resolve(),x.then(()=>{x=null})),x}function P(t,e,n){t.dispatchEvent(U(`${e?"intro":"outro"}${n}`))}const S=new Set;let y;function _t(){y={r:0,c:[],p:y}}function $t(){y.r||v(y.c),y=y.p}function ot(t,e){t&&t.i&&(S.delete(t),t.i(e))}function ht(t,e,n,s){if(t&&t.o){if(S.has(t))return;S.add(t),y.c.push(()=>{S.delete(t),s&&(n&&t.d(1),s())}),t.o(e)}else s&&s()}const K={duration:0};function mt(t,e,n){const s={direction:"in"};let r=e(t,n,s),a=!1,u,l,d=0;function i(){u&&C(t,u)}function f(){const{delay:_=0,duration:c=300,easing:$=D,tick:h=w,css:g}=r||K;g&&(u=H(t,0,1,c,_,$,g,d++)),h(0,1);const m=L()+_,E=m+c;l&&l.abort(),a=!0,b(()=>P(t,!0,"start")),l=G(j=>{if(a){if(j>=E)return h(1,0),P(t,!0,"end"),i(),a=!1;if(j>=m){const M=$((j-m)/c);h(M,1-M)}}return a})}let o=!1;return{start(){o||(o=!0,C(t),R(r)?(r=r(s),J().then(f)):f())},invalidate(){o=!1},end(){a&&(i(),a=!1)}}}function gt(t,e,n){const s={direction:"out"};let r=e(t,n,s),a=!0,u;const l=y;l.r+=1;let d;function i(){const{delay:f=0,duration:o=300,easing:_=D,tick:c=w,css:$}=r||K;$&&(u=H(t,1,0,o,f,_,$));const h=L()+f,g=h+o;b(()=>P(t,!1,"start")),"inert"in t&&(d=t.inert,t.inert=!0),G(m=>{if(a){if(m>=g)return c(0,1),P(t,!1,"end"),--l.r||v(l.c),!1;if(m>=h){const E=_((m-h)/o);c(1-E,E)}}return a})}return R(r)?J().then(()=>{r=r(s),i()}):i(),{end(f){f&&"inert"in t&&(t.inert=d),f&&r.tick&&r.tick(1,0),a&&(u&&C(t,u),a=!1)}}}function yt(t,e,n){const s=t.$$.props[e];s!==void 0&&(t.$$.bound[s]=n,n(t.$$.ctx[s]))}function pt(t){t&&t.c()}function wt(t,e){t&&t.l(e)}function ft(t,e,n){const{fragment:s,after_update:r}=t.$$;s&&s.m(e,n),b(()=>{const a=t.$$.on_mount.map(Z).filter(R);t.$$.on_destroy?t.$$.on_destroy.push(...a):v(a),t.$$.on_mount=[]}),r.forEach(b)}function ut(t,e){const n=t.$$;n.fragment!==null&&(X(n.after_update),v(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ct(t,e){t.$$.dirty[0]===-1&&(tt.push(t),et(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function xt(t,e,n,s,r,a,u=null,l=[-1]){const d=Y;z(t);const i=t.$$={fragment:null,ctx:[],props:a,update:w,not_equal:r,bound:N(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(d?d.$$.context:[])),callbacks:N(),dirty:l,skip_bound:!1,root:e.target||d.$$.root};u&&u(i.root);let f=!1;if(i.ctx=n?n(t,e.props||{},(o,_,...c)=>{const $=c.length?c[0]:_;return i.ctx&&r(i.ctx[o],i.ctx[o]=$)&&(!i.skip_bound&&i.bound[o]&&i.bound[o]($),f&&ct(t,o)),_}):[],i.update(),f=!0,v(i.before_update),i.fragment=s?s(i.ctx):!1,e.target){if(e.hydrate){nt();const o=V(e.target);i.fragment&&i.fragment.l(o),o.forEach(A)}else i.fragment&&i.fragment.c();e.intro&&ot(t.$$.fragment),ft(t,e.target,e.anchor),st(),q()}z(d)}class vt{$$=void 0;$$set=void 0;$destroy(){ut(this,1),this.$destroy=w}$on(e,n){if(!R(n))return w;const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(n),()=>{const r=s.indexOf(n);r!==-1&&s.splice(r,1)}}$set(e){this.$$set&&!W(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const lt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(lt);export{vt as S,ht as a,pt as b,$t as c,wt as d,ut as e,H as f,_t as g,C as h,xt as i,mt as j,gt as k,G as l,ft as m,L as n,yt as o,ot as t};
build/client/_app/immutable/chunks/index.UTqYide5.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{n as b,s as l}from"./scheduler.OwA2AG0M.js";const n=[];function h(e,o){return{subscribe:p(e,o).subscribe}}function p(e,o=b){let r;const i=new Set;function u(t){if(l(e,t)&&(e=t,r)){const c=!n.length;for(const s of i)s[1](),n.push(s,e);if(c){for(let s=0;s<n.length;s+=2)n[s][0](n[s+1]);n.length=0}}}function f(t){u(t(e))}function a(t,c=b){const s=[t,c];return i.add(s),i.size===1&&(r=o(u,f)||b),t(e),()=>{i.delete(s),i.size===0&&r&&(r(),r=null)}}return{set:u,update:f,subscribe:a}}export{h as r,p as w};
build/client/_app/immutable/chunks/scheduler.OwA2AG0M.js ADDED
@@ -0,0 +1 @@
 
 
1
+ function C(){}const st=t=>t;function B(t,e){for(const n in e)t[n]=e[n];return t}function R(t){return t()}function ct(){return Object.create(null)}function q(t){t.forEach(R)}function F(t){return typeof t=="function"}function rt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function lt(t){return Object.keys(t).length===0}function D(t,...e){if(t==null){for(const i of e)i(void 0);return C}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function ot(t){let e;return D(t,n=>e=n)(),e}function at(t,e,n){t.$$.on_destroy.push(D(e,n))}function ut(t,e,n,i){if(t){const s=H(t,e,n,i);return t[0](s)}}function H(t,e,n,i){return t[1]&&i?B(n.ctx.slice(),t[1](i(e))):n.ctx}function ft(t,e,n,i){if(t[2]&&i){const s=t[2](i(n));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],c=Math.max(e.dirty.length,s.length);for(let o=0;o<c;o+=1)l[o]=e.dirty[o]|s[o];return l}return e.dirty|s}return e.dirty}function _t(t,e,n,i,s,l){if(s){const c=H(e,n,i,l);t.p(c,s)}}function ht(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let i=0;i<n;i++)e[i]=-1;return e}return-1}function dt(t){const e={};for(const n in t)n[0]!=="$"&&(e[n]=t[n]);return e}function mt(t,e){const n={};e=new Set(e);for(const i in t)!e.has(i)&&i[0]!=="$"&&(n[i]=t[i]);return n}function pt(t){const e={};for(const n in t)e[n]=!0;return e}function yt(t,e,n){return t.set(n),e}function gt(t){return t&&F(t.destroy)?t.destroy:C}function bt(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}let p=!1;function xt(){p=!0}function Et(){p=!1}function G(t,e,n,i){for(;t<e;){const s=t+(e-t>>1);n(s)<=i?t=s+1:e=s}return t}function z(t){if(t.hydrate_init)return;t.hydrate_init=!0;let e=t.childNodes;if(t.nodeName==="HEAD"){const r=[];for(let a=0;a<e.length;a++){const u=e[a];u.claim_order!==void 0&&r.push(u)}e=r}const n=new Int32Array(e.length+1),i=new Int32Array(e.length);n[0]=-1;let s=0;for(let r=0;r<e.length;r++){const a=e[r].claim_order,u=(s>0&&e[n[s]].claim_order<=a?s+1:G(1,s,O=>e[n[O]].claim_order,a))-1;i[r]=n[u]+1;const N=u+1;n[N]=r,s=Math.max(N,s)}const l=[],c=[];let o=e.length-1;for(let r=n[s]+1;r!=0;r=i[r-1]){for(l.push(e[r-1]);o>=r;o--)c.push(e[o]);o--}for(;o>=0;o--)c.push(e[o]);l.reverse(),c.sort((r,a)=>r.claim_order-a.claim_order);for(let r=0,a=0;r<c.length;r++){for(;a<l.length&&c[r].claim_order>=l[a].claim_order;)a++;const u=a<l.length?l[a]:null;t.insertBefore(c[r],u)}}function I(t,e){t.appendChild(e)}function U(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function vt(t){const e=w("style");return e.textContent="/* empty */",W(U(t),e),e.sheet}function W(t,e){return I(t.head||t,e),e.sheet}function J(t,e){if(p){for(z(t),(t.actual_end_child===void 0||t.actual_end_child!==null&&t.actual_end_child.parentNode!==t)&&(t.actual_end_child=t.firstChild);t.actual_end_child!==null&&t.actual_end_child.claim_order===void 0;)t.actual_end_child=t.actual_end_child.nextSibling;e!==t.actual_end_child?(e.claim_order!==void 0||e.parentNode!==t)&&t.insertBefore(e,t.actual_end_child):t.actual_end_child=e.nextSibling}else(e.parentNode!==t||e.nextSibling!==null)&&t.appendChild(e)}function K(t,e,n){t.insertBefore(e,n||null)}function Q(t,e,n){p&&!n?J(t,e):(e.parentNode!==t||e.nextSibling!=n)&&t.insertBefore(e,n||null)}function x(t){t.parentNode&&t.parentNode.removeChild(t)}function wt(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function w(t){return document.createElement(t)}function L(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function T(t){return document.createTextNode(t)}function Tt(){return T(" ")}function Nt(){return T("")}function At(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function V(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const X=["width","height"];function kt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const i in e)e[i]==null?t.removeAttribute(i):i==="style"?t.style.cssText=e[i]:i==="__value"?t.value=t[i]=e[i]:n[i]&&n[i].set&&X.indexOf(i)===-1?t[i]=e[i]:V(t,i,e[i])}function Ct(t){return t.dataset.svelteH}function Dt(t){let e;return{p(...n){e=n,e.forEach(i=>t.push(i))},r(){e.forEach(n=>t.splice(t.indexOf(n),1))}}}function Ht(t){return Array.from(t.childNodes)}function M(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function S(t,e,n,i,s=!1){M(t);const l=(()=>{for(let c=t.claim_info.last_index;c<t.length;c++){const o=t[c];if(e(o)){const r=n(o);return r===void 0?t.splice(c,1):t[c]=r,s||(t.claim_info.last_index=c),o}}for(let c=t.claim_info.last_index-1;c>=0;c--){const o=t[c];if(e(o)){const r=n(o);return r===void 0?t.splice(c,1):t[c]=r,s?r===void 0&&t.claim_info.last_index--:t.claim_info.last_index=c,o}}return i()})();return l.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,l}function j(t,e,n,i){return S(t,s=>s.nodeName===e,s=>{const l=[];for(let c=0;c<s.attributes.length;c++){const o=s.attributes[c];n[o.name]||l.push(o.name)}l.forEach(c=>s.removeAttribute(c))},()=>i(e))}function Lt(t,e,n){return j(t,e,n,w)}function Mt(t,e,n){return j(t,e,n,L)}function Y(t,e){return S(t,n=>n.nodeType===3,n=>{const i=""+e;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>T(e),!0)}function St(t){return Y(t," ")}function A(t,e,n){for(let i=n;i<t.length;i+=1){const s=t[i];if(s.nodeType===8&&s.textContent.trim()===e)return i}return-1}function jt(t,e){const n=A(t,"HTML_TAG_START",0),i=A(t,"HTML_TAG_END",n+1);if(n===-1||i===-1)return new y(e);M(t);const s=t.splice(n,i-n+1);x(s[0]),x(s[s.length-1]);const l=s.slice(1,s.length-1);if(l.length===0)return new y(e);for(const c of l)c.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1;return new y(e,l)}function Pt(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ot(t,e){t.value=e??""}function Bt(t,e,n,i){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function Rt(t,e,n){t.classList.toggle(e,!!n)}function Z(t,e,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:i})}function qt(t,e){const n=[];let i=0;for(const s of e.childNodes)if(s.nodeType===8){const l=s.textContent.trim();l===`HEAD_${t}_END`?(i-=1,n.push(s)):l===`HEAD_${t}_START`&&(i+=1,n.push(s))}else i>0&&n.push(s);return n}class ${is_svg=!1;e=void 0;n=void 0;t=void 0;a=void 0;constructor(e=!1){this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=L(n.nodeName):this.e=w(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n<this.n.length;n+=1)K(this.t,this.n[n],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(x)}}class y extends ${l=void 0;constructor(e=!1,n){super(e),this.e=this.n=null,this.l=n}c(e){this.l?this.n=this.l:super.c(e)}i(e){for(let n=0;n<this.n.length;n+=1)Q(this.t,this.n[n],e)}}function Ft(t,e){return new t(e)}let m;function g(t){m=t}function h(){if(!m)throw new Error("Function called outside component initialization");return m}function Gt(t){h().$$.on_mount.push(t)}function zt(t){h().$$.after_update.push(t)}function It(t){h().$$.on_destroy.push(t)}function Ut(){const t=h();return(e,n,{cancelable:i=!1}={})=>{const s=t.$$.callbacks[e];if(s){const l=Z(e,n,{cancelable:i});return s.slice().forEach(c=>{c.call(t,l)}),!l.defaultPrevented}return!0}}function Wt(t,e){return h().$$.context.set(t,e),e}function Jt(t){return h().$$.context.get(t)}function Kt(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const d=[],k=[];let _=[];const E=[],P=Promise.resolve();let v=!1;function tt(){v||(v=!0,P.then(nt))}function Qt(){return tt(),P}function et(t){_.push(t)}function Vt(t){E.push(t)}const b=new Set;let f=0;function nt(){if(f!==0)return;const t=m;do{try{for(;f<d.length;){const e=d[f];f++,g(e),it(e.$$)}}catch(e){throw d.length=0,f=0,e}for(g(null),d.length=0,f=0;k.length;)k.pop()();for(let e=0;e<_.length;e+=1){const n=_[e];b.has(n)||(b.add(n),n())}_.length=0}while(d.length);for(;E.length;)E.pop()();v=!1,b.clear(),g(t)}function it(t){if(t.fragment!==null){t.update(),q(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(et)}}function Xt(t){const e=[],n=[];_.forEach(i=>t.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),_=e}export{B as $,Ft as A,Qt as B,ot as C,U as D,vt as E,F,et as G,Z as H,st as I,ct as J,nt as K,lt as L,Xt as M,m as N,g as O,R as P,d as Q,tt as R,xt as S,Et as T,ut as U,_t as V,ht as W,ft as X,Wt as Y,Jt as Z,bt as _,Tt as a,dt as a0,pt as a1,Ut as a2,D as a3,Kt as a4,y as a5,jt as a6,Dt as a7,kt as a8,mt as a9,Rt as aa,yt as ab,It as ac,L as ad,Mt as ae,Vt as af,qt as ag,Ht as b,Lt as c,Y as d,w as e,x as f,St as g,J as h,Q as i,Pt as j,at as k,Ct as l,V as m,C as n,Ot as o,At as p,wt as q,q as r,rt as s,T as t,gt as u,Gt as v,Nt as w,zt as x,Bt as y,k as z};
build/client/_app/immutable/entry/app.nf8b2onw.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import{s as C,a as U,w as h,g as q,i as b,f as p,x as j,v as z,e as M,c as W,b as F,m as A,y as d,t as G,d as H,j as J,z as D,A as k,B as K}from"../chunks/scheduler.OwA2AG0M.js";import{S as Q,i as X,a as g,c as P,t as w,g as L,b as v,d as I,m as E,e as y}from"../chunks/index.JlSaLmPP.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},N={},R=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in N)return;N[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let u=c.length-1;u>=0;u--){const m=c[u];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((u,m)=>{o.addEventListener("load",u),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&I(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){L();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),P()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&I(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){L();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),P()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&I(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){L();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),P()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[10](null),e&&y(e,t)}}}function O(a){let e,n=a[6]&&S(a);return{c(){e=M("div"),n&&n.c(),this.h()},l(i){e=W(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=F(e);n&&n.l(s),s.forEach(p),this.h()},h(){A(e,"id","svelte-announcer"),A(e,"aria-live","assertive"),A(e,"aria-atomic","true"),d(e,"position","absolute"),d(e,"left","0"),d(e,"top","0"),d(e,"clip","rect(0 0 0 0)"),d(e,"clip-path","inset(50%)"),d(e,"overflow","hidden"),d(e,"white-space","nowrap"),d(e,"width","1px"),d(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=S(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&p(e),n&&n.d()}}}function S(a){let e;return{c(){e=G(a[7])},l(n){e=H(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&J(e,n[7])},d(n){n&&p(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,u){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let _=a[5]&&O(a);return{c(){n.c(),i=U(),_&&_.c(),s=h()},l(o){n.l(o),i=q(o),_&&_.l(o),s=h()},m(o,u){r[e].m(o,u),b(o,i,u),_&&_.m(o,u),b(o,s,u),c=!0},p(o,[u]){let m=e;e=l(o),e===m?r[e].p(o,u):(L(),g(r[m],1,1,()=>{r[m]=null}),P(),n=r[e],n?n.p(o,u):(n=r[e]=t[e](o),n.c()),w(n,1),n.m(i.parentNode,i)),o[5]?_?_.p(o,u):(_=O(o),_.c(),_.m(s.parentNode,s)):_&&(_.d(1),_=null)},i(o){c||(w(n),c=!0)},o(o){g(n),c=!1},d(o){o&&(p(i),p(s)),r[e].d(o),_&&_.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:_=null}=e;j(i.page.notify);let o=!1,u=!1,m=null;z(()=>{const f=i.page.subscribe(()=>{o&&(n(6,u=!0),K().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){D[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){D[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function B(f){D[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,_=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,_,o,u,m,i,s,T,V,B]}class oe extends Q{constructor(e){super(),X(this,e,ne,te,C,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>R(()=>import("../nodes/0.UBYIs98P.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),()=>R(()=>import("../nodes/1.aTX1quDl.js"),__vite__mapDeps([7,1,2,8,4]),import.meta.url),()=>R(()=>import("../nodes/2.lbs4H3Jw.js"),__vite__mapDeps([9,1,2,8,4,10,3,5,11,12]),import.meta.url),()=>R(()=>import("../nodes/3.0Qr5_Ol8.js"),__vite__mapDeps([13,1,10,2,14]),import.meta.url),()=>R(()=>import("../nodes/4.WM9VxzNR.js"),__vite__mapDeps([15,1,2,11,3,4,5,16]),import.meta.url)],le=[],fe={"/":[-3],"/chat":[3],"/logs":[4]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads};
2
+ function __vite__mapDeps(indexes) {
3
+ if (!__vite__mapDeps.viteFileDeps) {
4
+ __vite__mapDeps.viteFileDeps = ["../nodes/0.UBYIs98P.js","../chunks/scheduler.OwA2AG0M.js","../chunks/index.JlSaLmPP.js","../chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js","../chunks/index.UTqYide5.js","../assets/ProgressBar.oq5aOWfL.css","../assets/0.Cn2YjZcW.css","../nodes/1.aTX1quDl.js","../chunks/entry.vZ4dQZZ-.js","../nodes/2.lbs4H3Jw.js","../chunks/each.N0yHvFdK.js","../chunks/LogService.hUlSDADx.js","../assets/2.VP-gOi1X.css","../nodes/3.0Qr5_Ol8.js","../assets/3.zBATg92h.css","../nodes/4.WM9VxzNR.js","../assets/4.wLw7i_OC.css"]
5
+ }
6
+ return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
7
+ }
build/client/_app/immutable/entry/start.wAhvLgW-.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{a as t}from"../chunks/entry.vZ4dQZZ-.js";export{t as start};
build/client/_app/immutable/nodes/0.UBYIs98P.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{s as yt,e as ft,c as ut,b as dt,f as Q,y as k,i as Dt,n as mt,v as Kt,U as Gt,a as Jt,g as Qt,m as $t,h as Tt,V as Zt,W as te,X as ee}from"../chunks/scheduler.OwA2AG0M.js";import{S as vt,i as bt,b as kt,d as Ft,m as Vt,t as pt,a as gt,e as Mt}from"../chunks/index.JlSaLmPP.js";import{s as ne}from"../chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js";function oe(t){let e;return{c(){e=ft("div"),this.h()},l(o){e=ut(o,"DIV",{style:!0}),dt(e).forEach(Q),this.h()},h(){k(e,"width","50px"),k(e,"height","50px"),k(e,"background-color",t[0]),k(e,"position","absolute"),k(e,"opacity","0.6"),k(e,"top","10px"),k(e,"left","10px")},m(o,n){Dt(o,e,n)},p(o,[n]){n&1&&k(e,"background-color",o[0])},i:mt,o:mt,d(o){o&&Q(e)}}}function ie(t,e,o){const n=async()=>{const s=await fetch("/api/env/search_version"),{value:r}=await s.json();return r};let i="rgb(0, 110, 255)";return Kt(async()=>{const s=await n();console.log(s),s=="e5"?o(0,i="red"):s=="combined"&&o(0,i="green")}),[i,n]}class se extends vt{constructor(e){super(),bt(this,e,ie,oe,yt,{loadVersion:1})}get loadVersion(){return this.$$.ctx[1]}}function re(t){let e,o;return e=new se({}),{c(){kt(e.$$.fragment)},l(n){Ft(e.$$.fragment,n)},m(n,i){Vt(e,n,i),o=!0},p:mt,i(n){o||(pt(e.$$.fragment,n),o=!0)},o(n){gt(e.$$.fragment,n),o=!1},d(n){Mt(e,n)}}}class ce extends vt{constructor(e){super(),bt(this,e,null,re,yt,{})}}const X=Math.min,B=Math.max,it=Math.round,ot=Math.floor,F=t=>({x:t,y:t}),le={left:"right",right:"left",bottom:"top",top:"bottom"},ae={start:"end",end:"start"};function ht(t,e,o){return B(t,X(e,o))}function tt(t,e){return typeof t=="function"?t(e):t}function H(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Nt(t){return t==="x"?"y":"x"}function At(t){return t==="y"?"height":"width"}function Y(t){return["top","bottom"].includes(H(t))?"y":"x"}function Rt(t){return Nt(Y(t))}function fe(t,e,o){o===void 0&&(o=!1);const n=et(t),i=Rt(t),s=At(i);let r=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=st(r)),[r,st(r)]}function ue(t){const e=st(t);return[wt(t),e,wt(e)]}function wt(t){return t.replace(/start|end/g,e=>ae[e])}function de(t,e,o){const n=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return o?e?i:n:e?n:i;case"left":case"right":return e?s:r;default:return[]}}function me(t,e,o,n){const i=et(t);let s=de(H(t),o==="start",n);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(wt)))),s}function st(t){return t.replace(/left|right|bottom|top/g,e=>le[e])}function pe(t){return{top:0,right:0,bottom:0,left:0,...t}}function Wt(t){return typeof t!="number"?pe(t):{top:t,right:t,bottom:t,left:t}}function rt(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function _t(t,e,o){let{reference:n,floating:i}=t;const s=Y(e),r=Rt(e),c=At(r),l=H(e),a=s==="y",d=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[c]/2-i[c]/2;let f;switch(l){case"top":f={x:d,y:n.y-i.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-i.width,y:u};break;default:f={x:n.x,y:n.y}}switch(et(e)){case"start":f[r]-=p*(o&&a?-1:1);break;case"end":f[r]+=p*(o&&a?-1:1);break}return f}const ge=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:r}=o,c=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=_t(a,n,l),p=n,f={},m=0;for(let g=0;g<c.length;g++){const{name:w,fn:h}=c[g],{x,y,data:b,reset:v}=await h({x:d,y:u,initialPlacement:n,placement:p,strategy:i,middlewareData:f,rects:a,platform:r,elements:{reference:t,floating:e}});d=x??d,u=y??u,f={...f,[w]:{...f[w],...b}},v&&m<=50&&(m++,typeof v=="object"&&(v.placement&&(p=v.placement),v.rects&&(a=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:d,y:u}=_t(a,p,l)),g=-1)}return{x:d,y:u,placement:p,strategy:i,middlewareData:f}};async function Bt(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=tt(e,t),m=Wt(f),w=c[p?u==="floating"?"reference":"floating":u],h=rt(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(w)))==null||o?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),x=u==="floating"?{x:n,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},v=rt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:l}):x);return{top:(h.top-v.top+m.top)/b.y,bottom:(v.bottom-h.bottom+m.bottom)/b.y,left:(h.left-v.left+m.left)/b.x,right:(v.right-h.right+m.right)/b.x}}const he=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:n,placement:i,rects:s,platform:r,elements:c,middlewareData:l}=e,{element:a,padding:d=0}=tt(t,e)||{};if(a==null)return{};const u=Wt(d),p={x:o,y:n},f=Rt(i),m=At(f),g=await r.getDimensions(a),w=f==="y",h=w?"top":"left",x=w?"bottom":"right",y=w?"clientHeight":"clientWidth",b=s.reference[m]+s.reference[f]-p[f]-s.floating[m],v=p[f]-s.reference[f],E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a));let M=E?E[y]:0;(!M||!await(r.isElement==null?void 0:r.isElement(E)))&&(M=c.floating[y]||s.floating[m]);const K=b/2-v/2,N=M/2-g[m]/2-1,S=X(u[h],N),G=X(u[x],N),W=S,J=M-g[m]-G,A=M/2-g[m]/2+K,z=ht(W,A,J),_=!l.arrow&&et(i)!=null&&A!==z&&s.reference[m]/2-(A<W?S:G)-g[m]/2<0,$=_?A<W?A-W:A-J:0;return{[f]:p[f]+$,data:{[f]:z,centerOffset:A-z-$,..._&&{alignmentOffset:$}},reset:_}}}),we=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...w}=tt(t,e);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const h=H(i),x=Y(c),y=H(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),v=p||(y||!g?[st(c)]:ue(c)),E=m!=="none";!p&&E&&v.push(...me(c,g,m,b));const M=[c,...v],K=await Bt(e,w),N=[];let S=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&N.push(K[h]),u){const A=fe(i,r,b);N.push(K[A[0]],K[A[1]])}if(S=[...S,{placement:i,overflows:N}],!N.every(A=>A<=0)){var G,W;const A=(((G=s.flip)==null?void 0:G.index)||0)+1,z=M[A];if(z)return{data:{index:A,overflows:S},reset:{placement:z}};let _=(W=S.filter($=>$.overflows[0]<=0).sort(($,P)=>$.overflows[1]-P.overflows[1])[0])==null?void 0:W.placement;if(!_)switch(f){case"bestFit":{var J;const $=(J=S.filter(P=>{if(E){const D=Y(P.placement);return D===x||D==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(D=>D>0).reduce((D,qt)=>D+qt,0)]).sort((P,D)=>P[1]-D[1])[0])==null?void 0:J[0];$&&(_=$);break}case"initialPlacement":_=c;break}if(i!==_)return{reset:{placement:_}}}return{}}}};async function xe(t,e){const{placement:o,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),r=H(o),c=et(o),l=Y(o)==="y",a=["left","top"].includes(r)?-1:1,d=s&&l?-1:1,u=tt(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&typeof m=="number"&&(f=c==="end"?m*-1:m),l?{x:f*d,y:p*a}:{x:p*a,y:f*d}}const ye=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:s,placement:r,middlewareData:c}=e,l=await xe(e,t);return r===((o=c.offset)==null?void 0:o.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},ve=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:c={fn:w=>{let{x:h,y:x}=w;return{x:h,y:x}}},...l}=tt(t,e),a={x:o,y:n},d=await Bt(e,l),u=Y(H(i)),p=Nt(u);let f=a[p],m=a[u];if(s){const w=p==="y"?"top":"left",h=p==="y"?"bottom":"right",x=f+d[w],y=f-d[h];f=ht(x,f,y)}if(r){const w=u==="y"?"top":"left",h=u==="y"?"bottom":"right",x=m+d[w],y=m-d[h];m=ht(x,m,y)}const g=c.fn({...e,[p]:f,[u]:m});return{...g,data:{x:g.x-o,y:g.y-n}}}}};function q(t){return Ht(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function L(t){var e;return(e=(Ht(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ht(t){return t instanceof Node||t instanceof R(t).Node}function O(t){return t instanceof Element||t instanceof R(t).Element}function T(t){return t instanceof HTMLElement||t instanceof R(t).HTMLElement}function Lt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!["inline","contents"].includes(i)}function be(t){return["table","td","th"].includes(q(t))}function ct(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Ot(t){const e=Ct(),o=O(t)?C(t):t;return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function Ae(t){let e=V(t);for(;T(e)&&!U(e);){if(Ot(e))return e;if(ct(e))return null;e=V(e)}return null}function Ct(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function U(t){return["html","body","#document"].includes(q(t))}function C(t){return R(t).getComputedStyle(t)}function lt(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function V(t){if(q(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||L(t);return Lt(e)?e.host:e}function It(t){const e=V(t);return U(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&nt(e)?e:It(e)}function Z(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=It(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),r=R(i);if(s){const c=xt(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],c&&o?Z(c):[])}return e.concat(i,Z(i,[],o))}function xt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function zt(t){const e=C(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=T(t),s=i?t.offsetWidth:o,r=i?t.offsetHeight:n,c=it(o)!==s||it(n)!==r;return c&&(o=s,n=r),{width:o,height:n,$:c}}function Et(t){return O(t)?t:t.contextElement}function j(t){const e=Et(t);if(!T(e))return F(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:s}=zt(e);let r=(s?it(o.width):o.width)/n,c=(s?it(o.height):o.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Re=F(0);function jt(t){const e=R(t);return!Ct()||!e.visualViewport?Re:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Oe(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==R(t)?!1:e}function I(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),s=Et(t);let r=F(1);e&&(n?O(n)&&(r=j(n)):r=j(t));const c=Oe(s,o,n)?jt(s):F(0);let l=(i.left+c.x)/r.x,a=(i.top+c.y)/r.y,d=i.width/r.x,u=i.height/r.y;if(s){const p=R(s),f=n&&O(n)?R(n):n;let m=p,g=xt(m);for(;g&&n&&f!==m;){const w=j(g),h=g.getBoundingClientRect(),x=C(g),y=h.left+(g.clientLeft+parseFloat(x.paddingLeft))*w.x,b=h.top+(g.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,a*=w.y,d*=w.x,u*=w.y,l+=y,a+=b,m=R(g),g=xt(m)}}return rt({width:d,height:u,x:l,y:a})}function Ce(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const s=i==="fixed",r=L(n),c=e?ct(e.floating):!1;if(n===r||c&&s)return o;let l={scrollLeft:0,scrollTop:0},a=F(1);const d=F(0),u=T(n);if((u||!u&&!s)&&((q(n)!=="body"||nt(r))&&(l=lt(n)),T(n))){const p=I(n);a=j(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}return{width:o.width*a.x,height:o.height*a.y,x:o.x*a.x-l.scrollLeft*a.x+d.x,y:o.y*a.y-l.scrollTop*a.y+d.y}}function Ee(t){return Array.from(t.getClientRects())}function Xt(t){return I(L(t)).left+lt(t).scrollLeft}function $e(t){const e=L(t),o=lt(t),n=t.ownerDocument.body,i=B(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=B(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-o.scrollLeft+Xt(t);const c=-o.scrollTop;return C(n).direction==="rtl"&&(r+=B(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:r,y:c}}function Te(t,e){const o=R(t),n=L(t),i=o.visualViewport;let s=n.clientWidth,r=n.clientHeight,c=0,l=0;if(i){s=i.width,r=i.height;const a=Ct();(!a||a&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:s,height:r,x:c,y:l}}function _e(t,e){const o=I(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,s=T(t)?j(t):F(1),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,a=n*s.y;return{width:r,height:c,x:l,y:a}}function St(t,e,o){let n;if(e==="viewport")n=Te(t,o);else if(e==="document")n=$e(L(t));else if(O(e))n=_e(e,o);else{const i=jt(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return rt(n)}function Yt(t,e){const o=V(t);return o===e||!O(o)||U(o)?!1:C(o).position==="fixed"||Yt(o,e)}function Le(t,e){const o=e.get(t);if(o)return o;let n=Z(t,[],!1).filter(c=>O(c)&&q(c)!=="body"),i=null;const s=C(t).position==="fixed";let r=s?V(t):t;for(;O(r)&&!U(r);){const c=C(r),l=Ot(r);!l&&c.position==="fixed"&&(i=null),(s?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||nt(r)&&!l&&Yt(t,r))?n=n.filter(d=>d!==r):i=c,r=V(r)}return e.set(t,n),n}function Se(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const r=[...o==="clippingAncestors"?ct(e)?[]:Le(e,this._c):[].concat(o),n],c=r[0],l=r.reduce((a,d)=>{const u=St(e,d,i);return a.top=B(u.top,a.top),a.right=X(u.right,a.right),a.bottom=X(u.bottom,a.bottom),a.left=B(u.left,a.left),a},St(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Pe(t){const{width:e,height:o}=zt(t);return{width:e,height:o}}function De(t,e,o){const n=T(e),i=L(e),s=o==="fixed",r=I(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=F(0);if(n||!n&&!s)if((q(e)!=="body"||nt(i))&&(c=lt(e)),n){const u=I(e,!0,s,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}else i&&(l.x=Xt(i));const a=r.left+c.scrollLeft-l.x,d=r.top+c.scrollTop-l.y;return{x:a,y:d,width:r.width,height:r.height}}function at(t){return C(t).position==="static"}function Pt(t,e){return!T(t)||C(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ut(t,e){const o=R(t);if(ct(t))return o;if(!T(t)){let i=V(t);for(;i&&!U(i);){if(O(i)&&!at(i))return i;i=V(i)}return o}let n=Pt(t,e);for(;n&&be(n)&&at(n);)n=Pt(n,e);return n&&U(n)&&at(n)&&!Ot(n)?o:n||Ae(t)||o}const ke=async function(t){const e=this.getOffsetParent||Ut,o=this.getDimensions,n=await o(t.floating);return{reference:De(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Fe(t){return C(t).direction==="rtl"}const Ve={convertOffsetParentRelativeRectToViewportRelativeRect:Ce,getDocumentElement:L,getClippingRect:Se,getOffsetParent:Ut,getElementRects:ke,getClientRects:Ee,getDimensions:Pe,getScale:j,isElement:O,isRTL:Fe};function Me(t,e){let o=null,n;const i=L(t);function s(){var c;clearTimeout(n),(c=o)==null||c.disconnect(),o=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const{left:a,top:d,width:u,height:p}=t.getBoundingClientRect();if(c||e(),!u||!p)return;const f=ot(d),m=ot(i.clientWidth-(a+u)),g=ot(i.clientHeight-(d+p)),w=ot(a),x={rootMargin:-f+"px "+-m+"px "+-g+"px "+-w+"px",threshold:B(0,X(1,l))||1};let y=!0;function b(v){const E=v[0].intersectionRatio;if(E!==l){if(!y)return r();E?r(!1,E):n=setTimeout(()=>{r(!1,1e-7)},1e3)}y=!1}try{o=new IntersectionObserver(b,{...x,root:i.ownerDocument})}catch{o=new IntersectionObserver(b,x)}o.observe(t)}return r(!0),s}function Ne(t,e,o,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,a=Et(t),d=i||s?[...a?Z(a):[],...Z(e)]:[];d.forEach(h=>{i&&h.addEventListener("scroll",o,{passive:!0}),s&&h.addEventListener("resize",o)});const u=a&&c?Me(a,o):null;let p=-1,f=null;r&&(f=new ResizeObserver(h=>{let[x]=h;x&&x.target===a&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(e)})),o()}),a&&!l&&f.observe(a),f.observe(e));let m,g=l?I(t):null;l&&w();function w(){const h=I(t);g&&(h.x!==g.x||h.y!==g.y||h.width!==g.width||h.height!==g.height)&&o(),g=h,m=requestAnimationFrame(w)}return o(),()=>{var h;d.forEach(x=>{i&&x.removeEventListener("scroll",o),s&&x.removeEventListener("resize",o)}),u?.(),(h=f)==null||h.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const We=ye,Be=ve,He=we,Ie=he,ze=(t,e,o)=>{const n=new Map,i={platform:Ve,...o},s={...i.platform,_c:n};return ge(t,e,{...i,platform:s})};function je(t){let e,o,n,i,s;o=new ce({});const r=t[1].default,c=Gt(r,t,t[0],null);return{c(){e=ft("div"),kt(o.$$.fragment),n=Jt(),i=ft("main"),c&&c.c(),this.h()},l(l){e=ut(l,"DIV",{class:!0});var a=dt(e);Ft(o.$$.fragment,a),n=Qt(a),i=ut(a,"MAIN",{class:!0});var d=dt(i);c&&c.l(d),d.forEach(Q),a.forEach(Q),this.h()},h(){$t(i,"class","svelte-1aienip"),$t(e,"class","app svelte-1aienip")},m(l,a){Dt(l,e,a),Vt(o,e,null),Tt(e,n),Tt(e,i),c&&c.m(i,null),s=!0},p(l,[a]){c&&c.p&&(!s||a&1)&&Zt(c,r,l,l[0],s?ee(r,l[0],a,null):te(l[0]),null)},i(l){s||(pt(o.$$.fragment,l),pt(c,l),s=!0)},o(l){gt(o.$$.fragment,l),gt(c,l),s=!1},d(l){l&&Q(e),Mt(o),c&&c.d(l)}}}function Xe(t,e,o){let{$$slots:n={},$$scope:i}=e;return ne.set({computePosition:ze,autoUpdate:Ne,offset:We,shift:Be,flip:He,arrow:Ie}),t.$$set=s=>{"$$scope"in s&&o(0,i=s.$$scope)},[i,n]}class Ke extends vt{constructor(e){super(),bt(this,e,Xe,je,yt,{})}}export{Ke as component};
build/client/_app/immutable/nodes/1.aTX1quDl.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{s as E,e as b,t as _,a as S,c as f,b as d,d as g,f as p,g as x,i as l,h,j as v,n as $,k as j}from"../chunks/scheduler.OwA2AG0M.js";import{S as k,i as q}from"../chunks/index.JlSaLmPP.js";import{s as y}from"../chunks/entry.vZ4dQZZ-.js";const C=()=>{const s=y;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},H={subscribe(s){return C().page.subscribe(s)}};function P(s){let t,r=s[0].status+"",o,n,i,c=s[0].error?.message+"",u;return{c(){t=b("h1"),o=_(r),n=S(),i=b("p"),u=_(c)},l(e){t=f(e,"H1",{});var a=d(t);o=g(a,r),a.forEach(p),n=x(e),i=f(e,"P",{});var m=d(i);u=g(m,c),m.forEach(p)},m(e,a){l(e,t,a),h(t,o),l(e,n,a),l(e,i,a),h(i,u)},p(e,[a]){a&1&&r!==(r=e[0].status+"")&&v(o,r),a&1&&c!==(c=e[0].error?.message+"")&&v(u,c)},i:$,o:$,d(e){e&&(p(t),p(n),p(i))}}}function w(s,t,r){let o;return j(s,H,n=>r(0,o=n)),[o]}let D=class extends k{constructor(t){super(),q(this,t,w,P,E,{})}};export{D as component};
build/client/_app/immutable/nodes/2.lbs4H3Jw.js ADDED
The diff for this file is too large to render. See raw diff
 
build/client/_app/immutable/nodes/3.0Qr5_Ol8.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{s as Y,e as g,a as P,c as v,b as B,f as b,g as I,l as q,m as p,i as U,h as o,o as K,p as L,n as O,q as Z,r as $,t as z,d as J,j as M}from"../chunks/scheduler.OwA2AG0M.js";import{e as X}from"../chunks/each.N0yHvFdK.js";import{S as ee,i as te}from"../chunks/index.JlSaLmPP.js";function G(r,e,t){const i=r.slice();return i[13]=e[t],i}function H(r){let e,t,i,n="Вы:",u,f,d,y=r[13][0]+"",_,x,w,F="Бот:",T,A,D,m=r[13][1]+"",k,C;return{c(){e=g("div"),t=g("div"),i=g("p"),i.textContent=n,u=P(),f=g("div"),d=g("p"),_=z(y),x=P(),w=g("p"),w.textContent=F,T=P(),A=g("div"),D=g("pre"),k=z(m),C=P(),this.h()},l(l){e=v(l,"DIV",{class:!0});var a=B(e);t=v(a,"DIV",{class:!0});var c=B(t);i=v(c,"P",{class:!0,"data-svelte-h":!0}),q(i)!=="svelte-rp9yxd"&&(i.textContent=n),u=I(c),f=v(c,"DIV",{class:!0});var s=B(f);d=v(s,"P",{class:!0});var E=B(d);_=J(E,y),E.forEach(b),s.forEach(b),x=I(c),w=v(c,"P",{class:!0,"data-svelte-h":!0}),q(w)!=="svelte-1l7fbwv"&&(w.textContent=F),T=I(c),A=v(c,"DIV",{class:!0});var h=B(A);D=v(h,"PRE",{class:!0});var V=B(D);k=J(V,m),V.forEach(b),h.forEach(b),c.forEach(b),C=I(a),a.forEach(b),this.h()},h(){p(i,"class","font-bold text-sm"),p(d,"class","text-sm"),p(f,"class","self-start bg-blue-500 text-white p-2 rounded-lg"),p(w,"class","font-bold text-sm"),p(D,"class","text-sm svelte-1m09ey3"),p(A,"class","self-start bg-slate-100 text-black p-2 rounded-lg"),p(t,"class","mb-2 flex flex-col"),p(e,"class","mb-2 flex flex-col")},m(l,a){U(l,e,a),o(e,t),o(t,i),o(t,u),o(t,f),o(f,d),o(d,_),o(t,x),o(t,w),o(t,T),o(t,A),o(A,D),o(D,k),o(e,C)},p(l,a){a&3&&y!==(y=l[13][0]+"")&&M(_,y),a&3&&m!==(m=l[13][1]+"")&&M(k,m)},d(l){l&&b(e)}}}function Q(r){let e,t="Остановить",i,n;return{c(){e=g("button"),e.textContent=t,this.h()},l(u){e=v(u,"BUTTON",{class:!0,"data-svelte-h":!0}),q(e)!=="svelte-9vttci"&&(e.textContent=t),this.h()},h(){p(e,"class","ml-2 px-4 py-2 mb-8 bg-cyan-800 text-white rounded-md")},m(u,f){U(u,e,f),i||(n=L(e,"click",r[6]),i=!0)},p:O,d(u){u&&b(e),i=!1,n()}}}function W(r){let e,t="Отправить",i,n;return{c(){e=g("button"),e.textContent=t,this.h()},l(u){e=v(u,"BUTTON",{class:!0,"data-svelte-h":!0}),q(e)!=="svelte-n2s9cz"&&(e.textContent=t),this.h()},h(){p(e,"class","ml-2 px-4 py-2 mb-8 bg-blue-500 text-white rounded-md")},m(u,f){U(u,e,f),i||(n=L(e,"click",r[4]),i=!0)},p:O,d(u){u&&b(e),i=!1,n()}}}function ue(r){let e,t,i,n,u,f,d,y,_,x,w,F,T="Использовать системный промпт",A,D,m,k,C=X(r[0]?r[1].slice(1):r[1]),l=[];for(let s=0;s<C.length;s+=1)l[s]=H(G(r,C,s));let a=r[3]&&Q(r),c=!r[3]&&W(r);return{c(){e=g("div"),t=g("div");for(let s=0;s<l.length;s+=1)l[s].c();i=P(),n=g("div"),u=g("div"),f=g("div"),d=g("textarea"),y=P(),_=g("label"),x=g("input"),w=P(),F=g("p"),F.textContent=T,A=P(),a&&a.c(),D=P(),c&&c.c(),this.h()},l(s){e=v(s,"DIV",{class:!0});var E=B(e);t=v(E,"DIV",{class:!0});var h=B(t);for(let j=0;j<l.length;j+=1)l[j].l(h);h.forEach(b),i=I(E),n=v(E,"DIV",{class:!0});var V=B(n);u=v(V,"DIV",{class:!0});var R=B(u);f=v(R,"DIV",{class:!0});var S=B(f);d=v(S,"TEXTAREA",{class:!0,placeholder:!0}),B(d).forEach(b),y=I(S),_=v(S,"LABEL",{class:!0});var N=B(_);x=v(N,"INPUT",{class:!0,type:!0}),w=I(N),F=v(N,"P",{"data-svelte-h":!0}),q(F)!=="svelte-15ltrgi"&&(F.textContent=T),N.forEach(b),S.forEach(b),A=I(R),a&&a.l(R),D=I(R),c&&c.l(R),R.forEach(b),V.forEach(b),E.forEach(b),this.h()},h(){p(t,"class","flex-1 overflow-y-auto p-4 bg-gray-200"),p(d,"class","flex-1 py-2 px-3 rounded-md border-gray-300 w-full"),p(d,"placeholder","Введите ваше сообщение..."),p(x,"class","checkbox accent-white"),p(x,"type","checkbox"),p(_,"class","flex items-center space-x-2"),p(f,"class","w-full"),p(u,"class","flex"),p(n,"class","p-4 bg-gray-300"),p(e,"class","h-screen flex flex-col py-8")},m(s,E){U(s,e,E),o(e,t);for(let h=0;h<l.length;h+=1)l[h]&&l[h].m(t,null);o(e,i),o(e,n),o(n,u),o(u,f),o(f,d),K(d,r[2]),o(f,y),o(f,_),o(_,x),x.checked=r[0],o(_,w),o(_,F),o(u,A),a&&a.m(u,null),o(u,D),c&&c.m(u,null),m||(k=[L(d,"input",r[7]),L(d,"keydown",r[5]),L(x,"change",r[8])],m=!0)},p(s,[E]){if(E&3){C=X(s[0]?s[1].slice(1):s[1]);let h;for(h=0;h<C.length;h+=1){const V=G(s,C,h);l[h]?l[h].p(V,E):(l[h]=H(V),l[h].c(),l[h].m(t,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=C.length}E&4&&K(d,s[2]),E&1&&(x.checked=s[0]),s[3]?a?a.p(s,E):(a=Q(s),a.c(),a.m(u,D)):a&&(a.d(1),a=null),s[3]?c&&(c.d(1),c=null):c?c.p(s,E):(c=W(s),c.c(),c.m(u,null))},i:O,o:O,d(s){s&&b(e),Z(l,s),a&&a.d(),c&&c.d(),m=!1,$(k)}}}function le(r,e,t){const i=["Ты - бот, ассистент. Ты помогаешь пользователю с его запросами. Отвечай на русском языке, если пользователь не указал иное. Обращайся на Вы. Следуй инструкциям и указаниям пользователя.","Я отвечаю на русском языке!"];let n=[],u="",f=!1,d=new AbortController,y=!0;async function _(){u.trim()!==""&&(t(1,n=[...n,[u,""]]),t(2,u=""),await w())}function x(m){m.key==="Enter"&&!m.shiftKey&&(m.stopPropagation(),m.preventDefault(),_())}const w=async()=>{t(3,f=!0);const m=await fetch("/llm/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({history:n}),signal:d.signal});try{if(d.signal.aborted){console.log("Request was cancelled.");return}if(!m.body){console.log("Response has no body");return}const k=m.body.pipeThrough(new TextDecoderStream).getReader();let C=!0;for(;C;)try{if(d.signal.aborted){console.log("Request was cancelled during reading.");break}const{value:l,done:a}=await k.read();if(a){C=!1;break}l&&t(1,n[n.length-1][1]+=l,n)}catch(l){if(l.name==="AbortError"){C=!1,console.log("Fetch was aborted during reading.");break}else{C=!1,console.error("Error during reading:",l);break}}t(3,f=!1)}catch(k){k.name==="AbortError"?console.log("Fetch was aborted."):console.error("Error during fetch:",k)}},F=()=>{d.abort("user canceled"),d=new AbortController};function T(m){m?n.unshift(i):t(1,n=n.filter(k=>k!==i))}function A(){u=this.value,t(2,u)}function D(){y=this.checked,t(0,y)}return r.$$.update=()=>{r.$$.dirty&1&&T(y)},[y,n,u,f,_,x,F,A,D]}class ne extends ee{constructor(e){super(),te(this,e,le,ue,Y,{})}}export{ne as component};
build/client/_app/immutable/nodes/4.WM9VxzNR.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{s as pt,e as t,a as c,t as ut,c as l,l as _,g as o,b as h,d as it,f as r,m as a,i as We,h as e,p as k,u as ft,n as ht,r as vt,v as bt}from"../chunks/scheduler.OwA2AG0M.js";import{S as xt,i as _t}from"../chunks/index.JlSaLmPP.js";import{L as dt}from"../chunks/LogService.hUlSDADx.js";import{p as kt}from"../chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js";function mt(s){let w,v="Пользовательские логи",D,m,b,d,C,A,y,S,g,z,P,R,E,be=`Поля для экспорта
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 20" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M12 14.5a.75.75 0 01-.53-.22l-4.25-4.25a.75.75 0 011.06-1.06L12 12.69l3.72-3.72a.75.75 0 011.06 1.06l-4.25 4.25a.75.75 0 01-.53.22z" clip-rule="evenodd"></path></svg>`,de,N,le,n,T,I,pe,j,xe="Промпт",fe,U,B,_e,x,L="Ответ LLM",ve,f,V,Ue,ae,Xe="Результаты поиска",Be,F,q,De,ne,Ye="Выбранные результаты поиска",Ne,M,H,Ae,se,Ze="Параметры",Se,O,J,ze,ce,$e="Релевантные консультации",Re,G,K,je,oe,et="Запрос",Ve,Q,W,Fe,re,tt="Комментарий",qe,X,Y,Me,ue,lt="Дата создания",He,Z,$,Oe,ie,at="Дата обновления",Je,he,ee,nt="Экспорт Excel",Ge,st;return{c(){w=t("h1"),w.textContent=v,D=c(),m=t("div"),b=t("div"),d=t("div"),C=t("label"),A=ut(`Дата начала:
3
+ `),y=t("input"),S=c(),g=t("label"),z=ut(`Дата конца:
4
+ `),P=t("input"),R=c(),E=t("button"),E.innerHTML=be,de=c(),N=t("div"),le=t("div"),n=t("label"),T=t("div"),I=t("input"),pe=c(),j=t("p"),j.textContent=xe,fe=c(),U=t("label"),B=t("input"),_e=c(),x=t("p"),x.textContent=L,ve=c(),f=t("label"),V=t("input"),Ue=c(),ae=t("p"),ae.textContent=Xe,Be=c(),F=t("label"),q=t("input"),De=c(),ne=t("p"),ne.textContent=Ye,Ne=c(),M=t("label"),H=t("input"),Ae=c(),se=t("p"),se.textContent=Ze,Se=c(),O=t("label"),J=t("input"),ze=c(),ce=t("p"),ce.textContent=$e,Re=c(),G=t("label"),K=t("input"),je=c(),oe=t("p"),oe.textContent=et,Ve=c(),Q=t("label"),W=t("input"),Fe=c(),re=t("p"),re.textContent=tt,qe=c(),X=t("label"),Y=t("input"),Me=c(),ue=t("p"),ue.textContent=lt,He=c(),Z=t("label"),$=t("input"),Oe=c(),ie=t("p"),ie.textContent=at,Je=c(),he=t("div"),ee=t("button"),ee.textContent=nt,this.h()},l(u){w=l(u,"H1",{"data-svelte-h":!0}),_(w)!=="svelte-pofs8j"&&(w.textContent=v),D=o(u),m=l(u,"DIV",{});var p=h(m);b=l(p,"DIV",{class:!0});var ke=h(b);d=l(ke,"DIV",{class:!0});var te=h(d);C=l(te,"LABEL",{});var Ke=h(C);A=it(Ke,`Дата начала:
5
+ `),y=l(Ke,"INPUT",{type:!0}),Ke.forEach(r),S=o(te),g=l(te,"LABEL",{});var Qe=h(g);z=it(Qe,`Дата конца:
6
+ `),P=l(Qe,"INPUT",{type:!0}),Qe.forEach(r),R=o(te),E=l(te,"BUTTON",{class:!0,"data-svelte-h":!0}),_(E)!=="svelte-szcpq9"&&(E.innerHTML=be),de=o(te),N=l(te,"DIV",{class:!0,"data-popup":!0});var ct=h(N);le=l(ct,"DIV",{});var ot=h(le);n=l(ot,"LABEL",{class:!0,id:!0});var i=h(n);T=l(i,"DIV",{class:!0});var me=h(T);I=l(me,"INPUT",{class:!0,type:!0}),pe=o(me),j=l(me,"P",{"data-svelte-h":!0}),_(j)!=="svelte-1r1lhxs"&&(j.textContent=xe),me.forEach(r),fe=o(i),U=l(i,"LABEL",{class:!0});var Ce=h(U);B=l(Ce,"INPUT",{class:!0,type:!0}),_e=o(Ce),x=l(Ce,"P",{"data-svelte-h":!0}),_(x)!=="svelte-1t98vry"&&(x.textContent=L),Ce.forEach(r),ve=o(i),f=l(i,"LABEL",{class:!0});var ge=h(f);V=l(ge,"INPUT",{class:!0,type:!0}),Ue=o(ge),ae=l(ge,"P",{"data-svelte-h":!0}),_(ae)!=="svelte-15yeo0d"&&(ae.textContent=Xe),ge.forEach(r),Be=o(i),F=l(i,"LABEL",{class:!0});var Ee=h(F);q=l(Ee,"INPUT",{class:!0,type:!0}),De=o(Ee),ne=l(Ee,"P",{"data-svelte-h":!0}),_(ne)!=="svelte-2trpqh"&&(ne.textContent=Ye),Ee.forEach(r),Ne=o(i),M=l(i,"LABEL",{class:!0});var Le=h(M);H=l(Le,"INPUT",{class:!0,type:!0}),Ae=o(Le),se=l(Le,"P",{"data-svelte-h":!0}),_(se)!=="svelte-1fv4577"&&(se.textContent=Ze),Le.forEach(r),Se=o(i),O=l(i,"LABEL",{class:!0});var we=h(O);J=l(we,"INPUT",{class:!0,type:!0}),ze=o(we),ce=l(we,"P",{"data-svelte-h":!0}),_(ce)!=="svelte-1ajbauh"&&(ce.textContent=$e),we.forEach(r),Re=o(i),G=l(i,"LABEL",{class:!0});var ye=h(G);K=l(ye,"INPUT",{class:!0,type:!0}),je=o(ye),oe=l(ye,"P",{"data-svelte-h":!0}),_(oe)!=="svelte-1s3b98z"&&(oe.textContent=et),ye.forEach(r),Ve=o(i),Q=l(i,"LABEL",{class:!0});var Pe=h(Q);W=l(Pe,"INPUT",{class:!0,type:!0}),Fe=o(Pe),re=l(Pe,"P",{"data-svelte-h":!0}),_(re)!=="svelte-16cwydz"&&(re.textContent=tt),Pe.forEach(r),qe=o(i),X=l(i,"LABEL",{class:!0});var Te=h(X);Y=l(Te,"INPUT",{class:!0,type:!0}),Me=o(Te),ue=l(Te,"P",{"data-svelte-h":!0}),_(ue)!=="svelte-tv34i0"&&(ue.textContent=lt),Te.forEach(r),He=o(i),Z=l(i,"LABEL",{class:!0});var Ie=h(Z);$=l(Ie,"INPUT",{class:!0,type:!0}),Oe=o(Ie),ie=l(Ie,"P",{"data-svelte-h":!0}),_(ie)!=="svelte-1g2zmpw"&&(ie.textContent=at),Ie.forEach(r),i.forEach(r),ot.forEach(r),ct.forEach(r),te.forEach(r),Je=o(ke),he=l(ke,"DIV",{class:!0});var rt=h(he);ee=l(rt,"BUTTON",{class:!0,"data-svelte-h":!0}),_(ee)!=="svelte-77urvm"&&(ee.textContent=nt),rt.forEach(r),ke.forEach(r),p.forEach(r),this.h()},h(){a(y,"type","date"),a(P,"type","date"),a(E,"class","btn variant-outline-tertiary w-48 justify-between"),a(I,"class","checkbox accent-white"),a(I,"type","checkbox"),a(T,"class","flex items-center space-x-2 mx-2"),a(B,"class","checkbox accent-white"),a(B,"type","checkbox"),a(U,"class","flex items-center space-x-2"),a(V,"class","checkbox accent-white"),a(V,"type","checkbox"),a(f,"class","flex items-center space-x-2"),a(q,"class","checkbox accent-white"),a(q,"type","checkbox"),a(F,"class","flex items-center space-x-2"),a(H,"class","checkbox accent-white"),a(H,"type","checkbox"),a(M,"class","flex items-center space-x-2"),a(J,"class","checkbox accent-white"),a(J,"type","checkbox"),a(O,"class","flex items-center space-x-2"),a(K,"class","checkbox accent-white"),a(K,"type","checkbox"),a(G,"class","flex items-center space-x-2"),a(W,"class","checkbox accent-white"),a(W,"type","checkbox"),a(Q,"class","flex items-center space-x-2"),a(Y,"class","checkbox accent-white"),a(Y,"type","checkbox"),a(X,"class","flex items-center space-x-2"),a($,"class","checkbox accent-white"),a($,"type","checkbox"),a(Z,"class","flex items-center space-x-2"),a(n,"class","flex items-left space-x-2 svelte-1szjsif"),a(n,"id","fields_container"),a(N,"class","card p-4 w-150 shadow-xl z-10"),a(N,"data-popup","popupFeatured"),a(d,"class","filters svelte-1szjsif"),a(ee,"class","btn variant-filled"),a(he,"class","flex space-x-2 items-center"),a(b,"class","export_bar svelte-1szjsif")},m(u,p){We(u,w,p),We(u,D,p),We(u,m,p),e(m,b),e(b,d),e(d,C),e(C,A),e(C,y),e(d,S),e(d,g),e(g,z),e(g,P),e(d,R),e(d,E),e(d,de),e(d,N),e(N,le),e(le,n),e(n,T),e(T,I),I.checked=s[0],e(T,pe),e(T,j),e(n,fe),e(n,U),e(U,B),B.checked=s[1],e(U,_e),e(U,x),e(n,ve),e(n,f),e(f,V),V.checked=s[2],e(f,Ue),e(f,ae),e(n,Be),e(n,F),e(F,q),q.checked=s[3],e(F,De),e(F,ne),e(n,Ne),e(n,M),e(M,H),H.checked=s[4],e(M,Ae),e(M,se),e(n,Se),e(n,O),e(O,J),J.checked=s[5],e(O,ze),e(O,ce),e(n,Re),e(n,G),e(G,K),K.checked=s[6],e(G,je),e(G,oe),e(n,Ve),e(n,Q),e(Q,W),W.checked=s[7],e(Q,Fe),e(Q,re),e(n,qe),e(n,X),e(X,Y),Y.checked=s[8],e(X,Me),e(X,ue),e(n,He),e(n,Z),e(Z,$),$.checked=s[9],e(Z,Oe),e(Z,ie),e(b,Je),e(b,he),e(he,ee),Ge||(st=[k(y,"change",s[11]),k(P,"change",s[12]),ft(kt.call(null,E,s[13])),k(I,"change",s[14]),k(B,"change",s[15]),k(V,"change",s[16]),k(q,"change",s[17]),k(H,"change",s[18]),k(J,"change",s[19]),k(K,"change",s[20]),k(W,"change",s[21]),k(Y,"change",s[22]),k($,"change",s[23]),k(ee,"click",s[24])],Ge=!0)},p(u,[p]){p&1&&(I.checked=u[0]),p&2&&(B.checked=u[1]),p&4&&(V.checked=u[2]),p&8&&(q.checked=u[3]),p&16&&(H.checked=u[4]),p&32&&(J.checked=u[5]),p&64&&(K.checked=u[6]),p&128&&(W.checked=u[7]),p&256&&(Y.checked=u[8]),p&512&&($.checked=u[9])},i:ht,o:ht,d(u){u&&(r(w),r(D),r(m)),Ge=!1,vt(st)}}}function Ct(s,w,v){let D,m,b=!0,d=!0,C=!0,A=!0,y=!0,S=!0,g=!0,z=!0,P=!0,R=!0;async function E(x){if(x==="json")await dt.exportToJson(D,m);else if(x==="excel"){const L=await dt.exportToExcel(D,m,[b?"llmPrompt":"",d?"llmResponse":"",C?"searchResults":"",A?"selectedSearchResults":"",y?"uiSettings":"",S?"consultations":"",g?"userRequest":"",z?"userComment":"",P?"dateCreated":"",R?"dateUpdated":""]);if(L!=null){const ve=window.URL.createObjectURL(L),f=document.createElement("a");f.href=ve,f.download=`Журнал ответов с ${D?.toLocaleDateString()??"-"} по ${m?.toLocaleDateString()??"-"}.xlsx`,document.body.appendChild(f),f.click(),f.remove()}}}function be(x){const L=x.target;D=L.value?new Date(L.value):void 0}function de(x){const L=x.target;m=L.value?new Date(L.value):void 0}bt(async()=>{});const N={event:"click",target:"popupFeatured",placement:"bottom"};function le(){b=this.checked,v(0,b)}function n(){d=this.checked,v(1,d)}function T(){C=this.checked,v(2,C)}function I(){A=this.checked,v(3,A)}function pe(){y=this.checked,v(4,y)}function j(){S=this.checked,v(5,S)}function xe(){g=this.checked,v(6,g)}function fe(){z=this.checked,v(7,z)}function U(){P=this.checked,v(8,P)}function B(){R=this.checked,v(9,R)}return[b,d,C,A,y,S,g,z,P,R,E,be,de,N,le,n,T,I,pe,j,xe,fe,U,B,()=>E("excel")]}class yt extends xt{constructor(w){super(),_t(this,w,Ct,mt,pt,{})}}export{yt as component};
build/client/_app/version.json CHANGED
@@ -1 +1 @@
1
- {"version":"1725545879583"}
 
1
+ {"version":"1726650043044"}
build/server/chunks/0-VxnFtOWB.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ const index = 0;
2
+ let component_cache;
3
+ const component = async () => component_cache ??= (await import('./_layout.svelte-AZZ6IipI.js')).default;
4
+ const imports = ["_app/immutable/nodes/0.UBYIs98P.js","_app/immutable/chunks/scheduler.OwA2AG0M.js","_app/immutable/chunks/index.JlSaLmPP.js","_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js","_app/immutable/chunks/index.UTqYide5.js"];
5
+ const stylesheets = ["_app/immutable/assets/0.Cn2YjZcW.css","_app/immutable/assets/ProgressBar.oq5aOWfL.css"];
6
+ const fonts = ["_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.dOGCK5uJ.woff2","_app/immutable/assets/fira-mono-all-400-normal.dpry7Ug7.woff","_app/immutable/assets/fira-mono-cyrillic-400-normal.N-vuOVMo.woff2","_app/immutable/assets/fira-mono-greek-ext-400-normal.rKiNtwjr.woff2","_app/immutable/assets/fira-mono-greek-400-normal.At854Oju.woff2","_app/immutable/assets/fira-mono-latin-ext-400-normal.-l34kfv6.woff2","_app/immutable/assets/fira-mono-latin-400-normal.yoy1YEIp.woff2"];
7
+
8
+ export { component, fonts, imports, index, stylesheets };
9
+ //# sourceMappingURL=0-VxnFtOWB.js.map
build/server/chunks/0-VxnFtOWB.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"0-VxnFtOWB.js","sources":["../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/0.UBYIs98P.js\",\"_app/immutable/chunks/scheduler.OwA2AG0M.js\",\"_app/immutable/chunks/index.JlSaLmPP.js\",\"_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js\",\"_app/immutable/chunks/index.UTqYide5.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.Cn2YjZcW.css\",\"_app/immutable/assets/ProgressBar.oq5aOWfL.css\"];\nexport const fonts = [\"_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.dOGCK5uJ.woff2\",\"_app/immutable/assets/fira-mono-all-400-normal.dpry7Ug7.woff\",\"_app/immutable/assets/fira-mono-cyrillic-400-normal.N-vuOVMo.woff2\",\"_app/immutable/assets/fira-mono-greek-ext-400-normal.rKiNtwjr.woff2\",\"_app/immutable/assets/fira-mono-greek-400-normal.At854Oju.woff2\",\"_app/immutable/assets/fira-mono-latin-ext-400-normal.-l34kfv6.woff2\",\"_app/immutable/assets/fira-mono-latin-400-normal.yoy1YEIp.woff2\"];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE,QAAQ;AAC1G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,6EAA6E,CAAC,yCAAyC,EAAE;AAClQ,MAAC,WAAW,GAAG,CAAC,sCAAsC,CAAC,gDAAgD,EAAE;AACzG,MAAC,KAAK,GAAG,CAAC,wEAAwE,CAAC,8DAA8D,CAAC,oEAAoE,CAAC,qEAAqE,CAAC,iEAAiE,CAAC,qEAAqE,CAAC,iEAAiE;;;;"}
build/server/chunks/1-zFqe38Kb.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ const index = 1;
2
+ let component_cache;
3
+ const component = async () => component_cache ??= (await import('./error.svelte-qFoQaYDm.js')).default;
4
+ const imports = ["_app/immutable/nodes/1.aTX1quDl.js","_app/immutable/chunks/scheduler.OwA2AG0M.js","_app/immutable/chunks/index.JlSaLmPP.js","_app/immutable/chunks/entry.vZ4dQZZ-.js","_app/immutable/chunks/index.UTqYide5.js"];
5
+ const stylesheets = [];
6
+ const fonts = [];
7
+
8
+ export { component, fonts, imports, index, stylesheets };
9
+ //# sourceMappingURL=1-zFqe38Kb.js.map
build/server/chunks/1-zFqe38Kb.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"1-zFqe38Kb.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.aTX1quDl.js\",\"_app/immutable/chunks/scheduler.OwA2AG0M.js\",\"_app/immutable/chunks/index.JlSaLmPP.js\",\"_app/immutable/chunks/entry.vZ4dQZZ-.js\",\"_app/immutable/chunks/index.UTqYide5.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE,QAAQ;AAC5G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AAC9N,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
build/server/chunks/2-Hcaa79bn.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { d as private_env } from './shared-server-49TKSBDM.js';
2
+
3
+ const prerender = false;
4
+
5
+ var _page_ts = /*#__PURE__*/Object.freeze({
6
+ __proto__: null,
7
+ prerender: prerender
8
+ });
9
+
10
+ async function load() {
11
+ return {
12
+ ENV_ENABLE_DOCUMENT_DB: private_env.ENABLE_DOCUMENT_DB,
13
+ ENV_DOCUMENT_DB_URL: private_env.DOCUMENT_DB_URL,
14
+ ENV_ENABLE_DB_SUPPORT: private_env.ENABLE_DB_SUPPORT
15
+ };
16
+ }
17
+
18
+ var _page_server = /*#__PURE__*/Object.freeze({
19
+ __proto__: null,
20
+ load: load
21
+ });
22
+
23
+ const index = 2;
24
+ let component_cache;
25
+ const component = async () => component_cache ??= (await import('./_page.svelte-lDFDd0lS.js')).default;
26
+ const universal_id = "src/routes/+page.ts";
27
+ const server_id = "src/routes/+page.server.js";
28
+ const imports = ["_app/immutable/nodes/2.lbs4H3Jw.js","_app/immutable/chunks/scheduler.OwA2AG0M.js","_app/immutable/chunks/index.JlSaLmPP.js","_app/immutable/chunks/entry.vZ4dQZZ-.js","_app/immutable/chunks/index.UTqYide5.js","_app/immutable/chunks/each.N0yHvFdK.js","_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js","_app/immutable/chunks/LogService.hUlSDADx.js"];
29
+ const stylesheets = ["_app/immutable/assets/2.VP-gOi1X.css","_app/immutable/assets/ProgressBar.oq5aOWfL.css"];
30
+ const fonts = [];
31
+
32
+ export { component, fonts, imports, index, _page_server as server, server_id, stylesheets, _page_ts as universal, universal_id };
33
+ //# sourceMappingURL=2-Hcaa79bn.js.map
build/server/chunks/2-Hcaa79bn.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"2-Hcaa79bn.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_page.ts.js","../../../.svelte-kit/adapter-node/entries/pages/_page.server.js","../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["const prerender = false;\nexport {\n prerender\n};\n","import { d as private_env } from \"../../chunks/shared-server.js\";\nasync function load() {\n return {\n ENV_ENABLE_DOCUMENT_DB: private_env.ENABLE_DOCUMENT_DB,\n ENV_DOCUMENT_DB_URL: private_env.DOCUMENT_DB_URL,\n ENV_ENABLE_DB_SUPPORT: private_env.ENABLE_DB_SUPPORT\n };\n}\nexport {\n load\n};\n","import * as universal from '../entries/pages/_page.ts.js';\nimport * as server from '../entries/pages/_page.server.js';\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport { universal };\nexport const universal_id = \"src/routes/+page.ts\";\nexport { server };\nexport const server_id = \"src/routes/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/2.lbs4H3Jw.js\",\"_app/immutable/chunks/scheduler.OwA2AG0M.js\",\"_app/immutable/chunks/index.JlSaLmPP.js\",\"_app/immutable/chunks/entry.vZ4dQZZ-.js\",\"_app/immutable/chunks/index.UTqYide5.js\",\"_app/immutable/chunks/each.N0yHvFdK.js\",\"_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js\",\"_app/immutable/chunks/LogService.hUlSDADx.js\"];\nexport const stylesheets = [\"_app/immutable/assets/2.VP-gOi1X.css\",\"_app/immutable/assets/ProgressBar.oq5aOWfL.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;AAAA,MAAM,SAAS,GAAG,KAAK;;;;;;;ACCvB,eAAe,IAAI,GAAG;AACtB,EAAE,OAAO;AACT,IAAI,sBAAsB,EAAE,WAAW,CAAC,kBAAkB;AAC1D,IAAI,mBAAmB,EAAE,WAAW,CAAC,eAAe;AACpD,IAAI,qBAAqB,EAAE,WAAW,CAAC,iBAAiB;AACxD,GAAG,CAAC;AACJ;;;;;;;ACJY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAkC,CAAC,EAAE,QAAQ;AAExG,MAAC,YAAY,GAAG,sBAAsB;AAEtC,MAAC,SAAS,GAAG,6BAA6B;AAC1C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,6EAA6E,CAAC,8CAA8C,EAAE;AACpY,MAAC,WAAW,GAAG,CAAC,sCAAsC,CAAC,gDAAgD,EAAE;AACzG,MAAC,KAAK,GAAG;;;;"}
build/server/chunks/3-CK6H8qlV.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ const index = 3;
2
+ let component_cache;
3
+ const component = async () => component_cache ??= (await import('./_page.svelte-sUWsV2Jl.js')).default;
4
+ const imports = ["_app/immutable/nodes/3.0Qr5_Ol8.js","_app/immutable/chunks/scheduler.OwA2AG0M.js","_app/immutable/chunks/each.N0yHvFdK.js","_app/immutable/chunks/index.JlSaLmPP.js"];
5
+ const stylesheets = ["_app/immutable/assets/3.zBATg92h.css"];
6
+ const fonts = [];
7
+
8
+ export { component, fonts, imports, index, stylesheets };
9
+ //# sourceMappingURL=3-CK6H8qlV.js.map
build/server/chunks/3-CK6H8qlV.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"3-CK6H8qlV.js","sources":["../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/chat/_page.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/3.0Qr5_Ol8.js\",\"_app/immutable/chunks/scheduler.OwA2AG0M.js\",\"_app/immutable/chunks/each.N0yHvFdK.js\",\"_app/immutable/chunks/index.JlSaLmPP.js\"];\nexport const stylesheets = [\"_app/immutable/assets/3.zBATg92h.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAuC,CAAC,EAAE,QAAQ;AAC7G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,wCAAwC,CAAC,yCAAyC,EAAE;AACnL,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"}
build/server/chunks/4-x-_yQ3I4.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ const index = 4;
2
+ let component_cache;
3
+ const component = async () => component_cache ??= (await import('./_page.svelte-E0YaQIXg.js')).default;
4
+ const imports = ["_app/immutable/nodes/4.WM9VxzNR.js","_app/immutable/chunks/scheduler.OwA2AG0M.js","_app/immutable/chunks/index.JlSaLmPP.js","_app/immutable/chunks/LogService.hUlSDADx.js","_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js","_app/immutable/chunks/index.UTqYide5.js"];
5
+ const stylesheets = ["_app/immutable/assets/4.wLw7i_OC.css","_app/immutable/assets/ProgressBar.oq5aOWfL.css"];
6
+ const fonts = [];
7
+
8
+ export { component, fonts, imports, index, stylesheets };
9
+ //# sourceMappingURL=4-x-_yQ3I4.js.map
build/server/chunks/4-x-_yQ3I4.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"4-x-_yQ3I4.js","sources":["../../../.svelte-kit/adapter-node/nodes/4.js"],"sourcesContent":["\n\nexport const index = 4;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/logs/_page.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/4.WM9VxzNR.js\",\"_app/immutable/chunks/scheduler.OwA2AG0M.js\",\"_app/immutable/chunks/index.JlSaLmPP.js\",\"_app/immutable/chunks/LogService.hUlSDADx.js\",\"_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.9muE4jOP.js\",\"_app/immutable/chunks/index.UTqYide5.js\"];\nexport const stylesheets = [\"_app/immutable/assets/4.wLw7i_OC.css\",\"_app/immutable/assets/ProgressBar.oq5aOWfL.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAuC,CAAC,EAAE,QAAQ;AAC7G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,8CAA8C,CAAC,6EAA6E,CAAC,yCAAyC,EAAE;AACjT,MAAC,WAAW,GAAG,CAAC,sCAAsC,CAAC,gDAAgD,EAAE;AACzG,MAAC,KAAK,GAAG;;;;"}
build/server/chunks/LlamaCppService-XtF0SQo9.js ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { existsSync, mkdirSync, writeFileSync } from 'fs';
2
+ import { resolve } from 'path';
3
+ import { d as private_env } from './shared-server-49TKSBDM.js';
4
+ import dns from 'node:dns';
5
+
6
+ dns.setDefaultResultOrder("ipv4first");
7
+ class LlamaCppService {
8
+ url = "";
9
+ constructor(url) {
10
+ this.url = url;
11
+ }
12
+ async health() {
13
+ try {
14
+ const r = await fetch(`${this.url}/health`, {
15
+ method: "GET",
16
+ headers: {
17
+ "Content-Type": "application/json"
18
+ }
19
+ });
20
+ const data = await r.json();
21
+ if (data.status === "ok" || data.status === "error" || data.status === "loading model") {
22
+ return data.status;
23
+ }
24
+ } catch (error) {
25
+ console.log(JSON.parse(JSON.stringify(error)));
26
+ }
27
+ return "unavailable";
28
+ }
29
+ async tokenize(prompt, abortController) {
30
+ const response = await fetch(`${this.url}/tokenize`, {
31
+ method: "POST",
32
+ headers: {
33
+ "Content-Type": "application/json"
34
+ },
35
+ body: JSON.stringify({
36
+ "content": prompt
37
+ }),
38
+ signal: abortController.signal
39
+ });
40
+ if (response.ok) {
41
+ const data = await response.json();
42
+ if (data.tokens) {
43
+ return data.tokens;
44
+ }
45
+ } else if (response.status === 404) {
46
+ console.log("Tokenization endpoint not found (404).");
47
+ } else {
48
+ console.log(`Failed to tokenize: ${await response.text()}`);
49
+ }
50
+ return null;
51
+ }
52
+ async detokenize(tokens, abortController) {
53
+ const response = await fetch(`${this.url}/detokenize`, {
54
+ method: "POST",
55
+ headers: {
56
+ "Content-Type": "application/json"
57
+ },
58
+ body: JSON.stringify({
59
+ "tokens": tokens
60
+ }),
61
+ signal: abortController.signal
62
+ });
63
+ if (response.ok) {
64
+ const data = await response.json();
65
+ if (data.content) {
66
+ return data.content.trim();
67
+ }
68
+ } else if (response.status === 404) {
69
+ console.log("Detokenization endpoint not found (404).");
70
+ } else {
71
+ console.log(`Failed to detokenize: ${await response.text()}`);
72
+ }
73
+ return null;
74
+ }
75
+ createRequest(prompt) {
76
+ const request = {
77
+ "stream": true,
78
+ "stop": ["</s>", "bot:", "user:"],
79
+ "prompt": prompt
80
+ };
81
+ request["n_predict"] = private_env.LLM_API_N_PREDICT ? Number(private_env.LLM_API_N_PREDICT) : -1;
82
+ request["temperature"] = private_env.LLM_API_TEMPERATURE ? Number(private_env.LLM_API_TEMPERATURE) : 0;
83
+ if (private_env.LLM_API_TOP_K) {
84
+ request["top_k"] = Number(private_env.LLM_API_TOP_K);
85
+ }
86
+ if (private_env.LLM_API_TOP_P) {
87
+ request["top_p"] = Number(private_env.LLM_API_TOP_P);
88
+ }
89
+ if (private_env.LLM_API_MIN_P) {
90
+ request["min_p"] = Number(private_env.LLM_API_MIN_P);
91
+ }
92
+ if (private_env.LLM_API_SEED) {
93
+ request["seed"] = Number(private_env.LLM_API_SEED);
94
+ }
95
+ if (private_env.LLM_API_N_KEEP) {
96
+ request["n_keep"] = Number(private_env.LLM_API_N_KEEP);
97
+ }
98
+ if (private_env.LLM_CACHE_PROMPT) {
99
+ request["cache_prompt"] = Boolean(private_env.LLM_CACHE_PROMPT);
100
+ }
101
+ request["repeat_penalty"] = private_env.LLM_API_REPEAT_PENALTY ? Number(private_env.LLM_API_REPEAT_PENALTY) : 1.2;
102
+ request["repeat_last_n"] = private_env.LLM_API_REPEAT_LAST_N ? Number(private_env.LLM_API_REPEAT_LAST_N) : 256;
103
+ return request;
104
+ }
105
+ predict(prompt, { abortController }) {
106
+ return async ({ prompt: prompt2 }) => {
107
+ prompt2 = `[INST] ${prompt2} [/INST] `;
108
+ let tokens = await this.tokenize(prompt2, abortController);
109
+ if (tokens !== null) {
110
+ tokens = tokens.slice(0, 30700);
111
+ const detokenizedPrompt = await this.detokenize(tokens, abortController);
112
+ if (detokenizedPrompt !== null) {
113
+ prompt2 = detokenizedPrompt;
114
+ } else {
115
+ prompt2 = prompt2.substring(0, 32768);
116
+ }
117
+ } else {
118
+ prompt2 = prompt2.substring(0, 32768);
119
+ }
120
+ const request = this.createRequest(prompt2);
121
+ let r;
122
+ while (true) {
123
+ r = await fetch(`${this.url}/completion`, {
124
+ method: "POST",
125
+ headers: {
126
+ "Content-Type": "application/json",
127
+ "Accept": "text/event-stream"
128
+ },
129
+ body: JSON.stringify(request),
130
+ signal: abortController.signal
131
+ });
132
+ if (r.status === 404) {
133
+ if (!private_env.LLM_API_404_RETRY_INTERVAL) {
134
+ break;
135
+ }
136
+ console.log(`Received 404, retrying after ${private_env.LLM_API_404_RETRY_INTERVAL} seconds...`);
137
+ await new Promise((resolve2) => setTimeout(resolve2, Number(private_env.LLM_API_404_RETRY_INTERVAL) * 1e3));
138
+ } else {
139
+ break;
140
+ }
141
+ }
142
+ if (!r.ok) {
143
+ throw new Error(`Failed to generate text: ${await r.text()}`);
144
+ }
145
+ const encoder = new TextDecoderStream();
146
+ const reader = await r.body?.pipeThrough(encoder).getReader();
147
+ let t = this;
148
+ return async function* () {
149
+ let stop = false;
150
+ let generatedText = "";
151
+ let tokenId = 0;
152
+ while (!stop) {
153
+ const out = await reader?.read() ?? { done: false, value: void 0 };
154
+ if (out.done) {
155
+ stop = true;
156
+ reader?.cancel();
157
+ t.createLogFile(JSON.stringify({
158
+ "request": prompt2,
159
+ "response": generatedText
160
+ }), "llm-service");
161
+ return;
162
+ }
163
+ if (!out.value) {
164
+ stop = true;
165
+ reader?.cancel();
166
+ return;
167
+ }
168
+ let tokenValue = "";
169
+ if (out.value.startsWith("data: ")) {
170
+ try {
171
+ const data = JSON.parse(out.value.slice(6));
172
+ tokenValue = data.content;
173
+ } catch (e) {
174
+ }
175
+ } else if (private_env.LLM_API_VERSION == "v1") {
176
+ tokenValue = out.value;
177
+ }
178
+ generatedText += tokenValue.replace("</s>", "") ?? "";
179
+ yield {
180
+ token: {
181
+ id: tokenId++,
182
+ text: tokenValue.replace("</s>", "") ?? "",
183
+ logprob: 0,
184
+ special: false
185
+ },
186
+ generated_text: null,
187
+ details: null
188
+ };
189
+ }
190
+ }();
191
+ };
192
+ }
193
+ conversation(history, { abortController }) {
194
+ return async ({ history: history2 }) => {
195
+ let prompt = this.formatPrompt(history2);
196
+ const request = this.createRequest(prompt);
197
+ let tokens = await this.tokenize(prompt, abortController);
198
+ if (tokens !== null) {
199
+ tokens = tokens.slice(-30700);
200
+ const detokenizedPrompt = await this.detokenize(tokens, abortController);
201
+ if (detokenizedPrompt !== null) {
202
+ prompt = detokenizedPrompt;
203
+ } else {
204
+ prompt = prompt.substring(Math.max(0, prompt.length - 30700));
205
+ }
206
+ } else {
207
+ prompt = prompt.substring(Math.max(0, prompt.length - 30700));
208
+ }
209
+ const r = await fetch(`${this.url}/completion`, {
210
+ method: "POST",
211
+ headers: {
212
+ "Content-Type": "application/json",
213
+ "Accept": "text/event-stream"
214
+ },
215
+ body: JSON.stringify(request),
216
+ signal: abortController.signal
217
+ });
218
+ if (!r.ok) {
219
+ throw new Error(`Failed to generate text: ${await r.text()}`);
220
+ }
221
+ const encoder = new TextDecoderStream();
222
+ const reader = r.body?.pipeThrough(encoder).getReader();
223
+ return async function* () {
224
+ let stop = false;
225
+ let generatedText = "";
226
+ let tokenId = 0;
227
+ while (!stop) {
228
+ const out = await reader?.read() ?? { done: false, value: void 0 };
229
+ if (out.done) {
230
+ reader?.cancel();
231
+ return;
232
+ }
233
+ if (!out.value) {
234
+ reader?.cancel();
235
+ return;
236
+ }
237
+ let tokenValue = "";
238
+ if (out.value.startsWith("data: ")) {
239
+ try {
240
+ let data2 = JSON.parse(out.value.slice(6));
241
+ tokenValue = data2.content;
242
+ } catch (e) {
243
+ }
244
+ } else if (private_env.LLM_API_VERSION == "v1") {
245
+ tokenValue = out.value;
246
+ }
247
+ generatedText += tokenValue.replace("</s>", "") ?? "";
248
+ yield {
249
+ token: {
250
+ id: tokenId++,
251
+ text: tokenValue.replace("</s>", "") ?? "",
252
+ logprob: 0,
253
+ special: false
254
+ },
255
+ generated_text: null,
256
+ details: null
257
+ };
258
+ }
259
+ }();
260
+ };
261
+ }
262
+ formatPrompt(history) {
263
+ let prompt = "";
264
+ for (const [userPrompt, botResponse] of history) {
265
+ prompt += `[INST] ${userPrompt} [/INST]`;
266
+ if (botResponse) {
267
+ prompt += `${botResponse}`;
268
+ }
269
+ }
270
+ return prompt;
271
+ }
272
+ createLogFile(text, namePrefix = "") {
273
+ try {
274
+ const logsDirectory = resolve(private_env.LOGS_ROOT_FOLDER + "/llama");
275
+ if (!existsSync(logsDirectory)) {
276
+ mkdirSync(logsDirectory, {
277
+ recursive: true
278
+ });
279
+ }
280
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "");
281
+ const logFilePath = resolve(logsDirectory, `${namePrefix}${timestamp}.json`);
282
+ writeFileSync(logFilePath, text);
283
+ console.log(`Log file created: ${logFilePath}`);
284
+ } catch (e) {
285
+ console.log(`Failed to create log file in llama service`);
286
+ console.log(e);
287
+ }
288
+ }
289
+ }
290
+
291
+ export { LlamaCppService as L };
292
+ //# sourceMappingURL=LlamaCppService-XtF0SQo9.js.map
build/server/chunks/LlamaCppService-XtF0SQo9.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"LlamaCppService-XtF0SQo9.js","sources":["../../../.svelte-kit/adapter-node/chunks/LlamaCppService.js"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport { d as private_env } from \"./shared-server.js\";\nimport dns from \"node:dns\";\ndns.setDefaultResultOrder(\"ipv4first\");\nclass LlamaCppService {\n url = \"\";\n constructor(url) {\n this.url = url;\n }\n async health() {\n try {\n const r = await fetch(`${this.url}/health`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n const data = await r.json();\n if (data.status === \"ok\" || data.status === \"error\" || data.status === \"loading model\") {\n return data.status;\n }\n } catch (error) {\n console.log(JSON.parse(JSON.stringify(error)));\n }\n return \"unavailable\";\n }\n async tokenize(prompt, abortController) {\n const response = await fetch(`${this.url}/tokenize`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n \"content\": prompt\n }),\n signal: abortController.signal\n });\n if (response.ok) {\n const data = await response.json();\n if (data.tokens) {\n return data.tokens;\n }\n } else if (response.status === 404) {\n console.log(\"Tokenization endpoint not found (404).\");\n } else {\n console.log(`Failed to tokenize: ${await response.text()}`);\n }\n return null;\n }\n async detokenize(tokens, abortController) {\n const response = await fetch(`${this.url}/detokenize`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n \"tokens\": tokens\n }),\n signal: abortController.signal\n });\n if (response.ok) {\n const data = await response.json();\n if (data.content) {\n return data.content.trim();\n }\n } else if (response.status === 404) {\n console.log(\"Detokenization endpoint not found (404).\");\n } else {\n console.log(`Failed to detokenize: ${await response.text()}`);\n }\n return null;\n }\n createRequest(prompt) {\n const request = {\n \"stream\": true,\n \"stop\": [\"</s>\", \"bot:\", \"user:\"],\n \"prompt\": prompt\n };\n request[\"n_predict\"] = private_env.LLM_API_N_PREDICT ? Number(private_env.LLM_API_N_PREDICT) : -1;\n request[\"temperature\"] = private_env.LLM_API_TEMPERATURE ? Number(private_env.LLM_API_TEMPERATURE) : 0;\n if (private_env.LLM_API_TOP_K) {\n request[\"top_k\"] = Number(private_env.LLM_API_TOP_K);\n }\n if (private_env.LLM_API_TOP_P) {\n request[\"top_p\"] = Number(private_env.LLM_API_TOP_P);\n }\n if (private_env.LLM_API_MIN_P) {\n request[\"min_p\"] = Number(private_env.LLM_API_MIN_P);\n }\n if (private_env.LLM_API_SEED) {\n request[\"seed\"] = Number(private_env.LLM_API_SEED);\n }\n if (private_env.LLM_API_N_KEEP) {\n request[\"n_keep\"] = Number(private_env.LLM_API_N_KEEP);\n }\n if (private_env.LLM_CACHE_PROMPT) {\n request[\"cache_prompt\"] = Boolean(private_env.LLM_CACHE_PROMPT);\n }\n request[\"repeat_penalty\"] = private_env.LLM_API_REPEAT_PENALTY ? Number(private_env.LLM_API_REPEAT_PENALTY) : 1.2;\n request[\"repeat_last_n\"] = private_env.LLM_API_REPEAT_LAST_N ? Number(private_env.LLM_API_REPEAT_LAST_N) : 256;\n return request;\n }\n predict(prompt, { abortController }) {\n return async ({ prompt: prompt2 }) => {\n prompt2 = `[INST] ${prompt2} [/INST] `;\n let tokens = await this.tokenize(prompt2, abortController);\n if (tokens !== null) {\n tokens = tokens.slice(0, 30700);\n const detokenizedPrompt = await this.detokenize(tokens, abortController);\n if (detokenizedPrompt !== null) {\n prompt2 = detokenizedPrompt;\n } else {\n prompt2 = prompt2.substring(0, 32768);\n }\n } else {\n prompt2 = prompt2.substring(0, 32768);\n }\n const request = this.createRequest(prompt2);\n let r;\n while (true) {\n r = await fetch(`${this.url}/completion`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"text/event-stream\"\n },\n body: JSON.stringify(request),\n signal: abortController.signal\n });\n if (r.status === 404) {\n if (!private_env.LLM_API_404_RETRY_INTERVAL) {\n break;\n }\n console.log(`Received 404, retrying after ${private_env.LLM_API_404_RETRY_INTERVAL} seconds...`);\n await new Promise((resolve2) => setTimeout(resolve2, Number(private_env.LLM_API_404_RETRY_INTERVAL) * 1e3));\n } else {\n break;\n }\n }\n if (!r.ok) {\n throw new Error(`Failed to generate text: ${await r.text()}`);\n }\n const encoder = new TextDecoderStream();\n const reader = await r.body?.pipeThrough(encoder).getReader();\n let t = this;\n return async function* () {\n let stop = false;\n let generatedText = \"\";\n let tokenId = 0;\n while (!stop) {\n const out = await reader?.read() ?? { done: false, value: void 0 };\n if (out.done) {\n stop = true;\n reader?.cancel();\n t.createLogFile(JSON.stringify({\n \"request\": prompt2,\n \"response\": generatedText\n }), \"llm-service\");\n return;\n }\n if (!out.value) {\n stop = true;\n reader?.cancel();\n return;\n }\n let tokenValue = \"\";\n if (out.value.startsWith(\"data: \")) {\n try {\n const data = JSON.parse(out.value.slice(6));\n tokenValue = data.content;\n } catch (e) {\n }\n } else if (private_env.LLM_API_VERSION == \"v1\") {\n tokenValue = out.value;\n }\n generatedText += tokenValue.replace(\"</s>\", \"\") ?? \"\";\n yield {\n token: {\n id: tokenId++,\n text: tokenValue.replace(\"</s>\", \"\") ?? \"\",\n logprob: 0,\n special: false\n },\n generated_text: null,\n details: null\n };\n }\n }();\n };\n }\n conversation(history, { abortController }) {\n return async ({ history: history2 }) => {\n let prompt = this.formatPrompt(history2);\n const request = this.createRequest(prompt);\n let tokens = await this.tokenize(prompt, abortController);\n if (tokens !== null) {\n tokens = tokens.slice(-30700);\n const detokenizedPrompt = await this.detokenize(tokens, abortController);\n if (detokenizedPrompt !== null) {\n prompt = detokenizedPrompt;\n } else {\n prompt = prompt.substring(Math.max(0, prompt.length - 30700));\n }\n } else {\n prompt = prompt.substring(Math.max(0, prompt.length - 30700));\n }\n const r = await fetch(`${this.url}/completion`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"text/event-stream\"\n },\n body: JSON.stringify(request),\n signal: abortController.signal\n });\n if (!r.ok) {\n throw new Error(`Failed to generate text: ${await r.text()}`);\n }\n const encoder = new TextDecoderStream();\n const reader = r.body?.pipeThrough(encoder).getReader();\n return async function* () {\n let stop = false;\n let generatedText = \"\";\n let tokenId = 0;\n while (!stop) {\n const out = await reader?.read() ?? { done: false, value: void 0 };\n if (out.done) {\n reader?.cancel();\n return;\n }\n if (!out.value) {\n reader?.cancel();\n return;\n }\n let tokenValue = \"\";\n if (out.value.startsWith(\"data: \")) {\n try {\n let data2 = JSON.parse(out.value.slice(6));\n tokenValue = data2.content;\n } catch (e) {\n }\n } else if (private_env.LLM_API_VERSION == \"v1\") {\n tokenValue = out.value;\n }\n generatedText += tokenValue.replace(\"</s>\", \"\") ?? \"\";\n yield {\n token: {\n id: tokenId++,\n text: tokenValue.replace(\"</s>\", \"\") ?? \"\",\n logprob: 0,\n special: false\n },\n generated_text: null,\n details: null\n };\n }\n }();\n };\n }\n formatPrompt(history) {\n let prompt = \"\";\n for (const [userPrompt, botResponse] of history) {\n prompt += `[INST] ${userPrompt} [/INST]`;\n if (botResponse) {\n prompt += `${botResponse}`;\n }\n }\n return prompt;\n }\n createLogFile(text, namePrefix = \"\") {\n try {\n const logsDirectory = resolve(private_env.LOGS_ROOT_FOLDER + \"/llama\");\n if (!existsSync(logsDirectory)) {\n mkdirSync(logsDirectory, {\n recursive: true\n });\n }\n const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, \"\");\n const logFilePath = resolve(logsDirectory, `${namePrefix}${timestamp}.json`);\n writeFileSync(logFilePath, text);\n console.log(`Log file created: ${logFilePath}`);\n } catch (e) {\n console.log(`Failed to create log file in llama service`);\n console.log(e);\n }\n }\n}\nexport {\n LlamaCppService as L\n};\n"],"names":[],"mappings":";;;;;AAIA,GAAG,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;AACvC,MAAM,eAAe,CAAC;AACtB,EAAE,GAAG,GAAG,EAAE,CAAC;AACX,EAAE,WAAW,CAAC,GAAG,EAAE;AACnB,IAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AACnB,GAAG;AACH,EAAE,MAAM,MAAM,GAAG;AACjB,IAAI,IAAI;AACR,MAAM,MAAM,CAAC,GAAG,MAAM,KAAK,CAA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MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrB,KAAK;AACL,GAAG;AACH;;;;"}
build/server/chunks/LogService-b0lb4PC5.js ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { promisify } from 'util';
4
+ import { format } from 'date-fns';
5
+ import mongoose from 'mongoose';
6
+ import ExcelJS from 'exceljs';
7
+ import { d as private_env } from './shared-server-49TKSBDM.js';
8
+ import { E as ExcelColumnsName } from './constants-jjpZ8eI6.js';
9
+
10
+ const LogSchema = new mongoose.Schema({
11
+ llmPrompt: { type: String },
12
+ llmTemplate: { type: String },
13
+ llmResponse: { type: String },
14
+ searchResults: { type: [String] },
15
+ selectedSearchResults: { type: [String] },
16
+ uiSettings: { type: Object },
17
+ consultations: { type: [String] },
18
+ userRequest: { type: String },
19
+ userScore: { type: String },
20
+ userComment: { type: String },
21
+ dateCreated: { type: Date, default: Date.now },
22
+ dateUpdated: { type: Date, default: Date.now }
23
+ });
24
+ LogSchema.index({ dateCreated: 1 }, { unique: false });
25
+ const LogModel = mongoose.models.Log || mongoose.model("Log", LogSchema);
26
+ class MongooseService {
27
+ uri;
28
+ options;
29
+ connection;
30
+ constructor(uri, options = {}) {
31
+ try {
32
+ this.uri = uri || process.env.MONGODB_URI || "";
33
+ this.options = options;
34
+ this.connection = null;
35
+ if (!this.uri) {
36
+ console.warn("MongoDB URI is not defined");
37
+ }
38
+ } catch {
39
+ console.warn("MongoDB URI is not defined. Logs wont be saved.");
40
+ }
41
+ }
42
+ /**
43
+ * Connect to the MongoDB database
44
+ * @returns {Promise<Connection>}
45
+ */
46
+ async connect() {
47
+ if (this.connection) {
48
+ return this.connection;
49
+ }
50
+ try {
51
+ await mongoose.connect(this.uri, this.options);
52
+ this.connection = mongoose.connection;
53
+ console.log("Connected to MongoDB");
54
+ return this.connection;
55
+ } catch (error) {
56
+ console.warn("MongoDB URI is not defined. Logs wont be saved.");
57
+ }
58
+ }
59
+ /**
60
+ * Disconnect from the MongoDB database
61
+ * @returns {Promise<void>}
62
+ */
63
+ async disconnect() {
64
+ if (!this.connection) {
65
+ console.log("No active MongoDB connection to disconnect");
66
+ return;
67
+ }
68
+ try {
69
+ await mongoose.disconnect();
70
+ this.connection = null;
71
+ console.log("Disconnected from MongoDB");
72
+ } catch (error) {
73
+ console.error("Error disconnecting from MongoDB:", error);
74
+ throw new Error("Could not disconnect from MongoDB");
75
+ }
76
+ }
77
+ /**
78
+ * Get the current MongoDB connection
79
+ * @returns {Connection | null}
80
+ */
81
+ async getConnection() {
82
+ if (!this.isConnected()) {
83
+ await this.connect();
84
+ }
85
+ return this.connection;
86
+ }
87
+ isConnected() {
88
+ return this.connection !== null && mongoose.connection.readyState === 1;
89
+ }
90
+ }
91
+ const writeFile = promisify(fs.writeFile);
92
+ const readDir = promisify(fs.readdir);
93
+ const readFile = promisify(fs.readFile);
94
+ class LogService {
95
+ mongooseService;
96
+ logModel;
97
+ constructor() {
98
+ if (private_env.ENABLE_DB_SUPPORT) {
99
+ this.mongooseService = new MongooseService(private_env.MONGODB_URI || "");
100
+ this.logModel = LogModel;
101
+ }
102
+ }
103
+ /**
104
+ * Сохраняет лог в базу данных MongoDB, если она доступна.
105
+ * @param document - Лог-документ, который нужно сохранить.
106
+ * @returns {Promise<string>} ID созданной записи.
107
+ */
108
+ async log(document) {
109
+ if (!private_env.ENABLE_DB_SUPPORT) {
110
+ return "";
111
+ }
112
+ try {
113
+ await this.mongooseService.getConnection();
114
+ const logEntry = new this.logModel(document);
115
+ await logEntry.save();
116
+ console.log("Log entry saved to MongoDB");
117
+ return logEntry._id;
118
+ } catch (err) {
119
+ console.error("MongoDB connection failed", err);
120
+ }
121
+ return "";
122
+ }
123
+ /**
124
+ * Обновляет поле userScore в записи с указанным ID.
125
+ * @param id - ID записи, которую нужно обновить.
126
+ * @param score - Новое значение для userScore.
127
+ * @param comment - Новое значение для userComment.
128
+ * @returns Количество обновленных записей.
129
+ */
130
+ async logUserScore(id, score, comment) {
131
+ if (!private_env.ENABLE_DB_SUPPORT) {
132
+ return "";
133
+ }
134
+ try {
135
+ await this.mongooseService.getConnection();
136
+ const LogModel2 = mongoose.model("Log");
137
+ const result = await LogModel2.updateOne(
138
+ { _id: id },
139
+ { $set: { userScore: score, userComment: comment } }
140
+ );
141
+ return result.modifiedCount;
142
+ } catch (error) {
143
+ console.error("Error while updating userScore:", error);
144
+ throw error;
145
+ }
146
+ }
147
+ /**
148
+ * Сохраняет лог-документ в файл JSON.
149
+ * Имя файла основано на текущем времени.
150
+ * @param document - Лог-документ, который нужно сохранить.
151
+ * @returns {Promise<void>}
152
+ */
153
+ async saveLogToJsonFile(document) {
154
+ const timestamp = format(/* @__PURE__ */ new Date(), "dd-MM-yyyy:HH:mm:ss:SSS");
155
+ const logDir = path.join(private_env.LOGS_ROOT_FOLDER, "log");
156
+ const logFile = path.join(logDir, `${timestamp}.json`);
157
+ if (!fs.existsSync(logDir)) {
158
+ fs.mkdirSync(logDir, { recursive: true });
159
+ }
160
+ const data = JSON.stringify(document, null, 2);
161
+ await writeFile(logFile, data);
162
+ console.log(`Log entry saved to file: ${logFile}`);
163
+ }
164
+ /**
165
+ * Экспортирует логи из базы данных и/или файлов в формате JSON или Excel.
166
+ * Записи сортируются по дате создания. Если указаны dateFrom и dateTo, применяется фильтрация по дате.
167
+ * @param type - Тип экспорта: 'json' или 'excel'.
168
+ * @param dateFrom - Дата начала фильтрации (необязательно).
169
+ * @param dateTo - Дата окончания фильтрации (необязательно).
170
+ * @param fields - Поля для экспорта
171
+ * @returns {Promise<any>}
172
+ */
173
+ async export(type, dateFrom, dateTo, fields) {
174
+ if (!private_env.ENABLE_DB_SUPPORT) {
175
+ return "";
176
+ }
177
+ const mongoLogs = await this.fetchLogsFromMongo(dateFrom, dateTo, fields);
178
+ const allLogs = [...mongoLogs];
179
+ if (type === "json") {
180
+ return await this.exportToJson(allLogs);
181
+ } else if (type === "excel") {
182
+ return await this.exportToExcel(allLogs);
183
+ }
184
+ }
185
+ /**
186
+ * Извлекает логи из базы данных MongoDB с учетом фильтрации по дате.
187
+ * @param dateFrom - Дата начала фильтрации (необязательно).
188
+ * @param dateTo - Дата окончания фильтрации (необязательно).
189
+ * @returns {Promise<any[]>} - Возвращает массив логов.
190
+ */
191
+ async fetchLogsFromMongo(dateFrom, dateTo, fields) {
192
+ if (!private_env.ENABLE_DB_SUPPORT) {
193
+ return [];
194
+ }
195
+ const query = {};
196
+ if (dateFrom || dateTo) {
197
+ query.dateCreated = {};
198
+ if (dateFrom)
199
+ query.dateCreated.$gte = dateFrom;
200
+ if (dateTo)
201
+ query.dateCreated.$lte = dateTo;
202
+ }
203
+ await this.mongooseService.getConnection();
204
+ return await this.logModel.find(query).select(fields ? fields.join(" ") : "").sort({ dateCreated: 1 }).lean().exec();
205
+ }
206
+ /**
207
+ * Извлекает логи из файлов JSON в папке /data/log с учетом фильтрации по дате.
208
+ * @param dateFrom - Дата начала фильтрации (необязательно).
209
+ * @param dateTo - Дата окончания фильтрации (необязательно).
210
+ * @returns {Promise<any[]>} - Возвращает массив логов.
211
+ */
212
+ async fetchLogsFromFiles(dateFrom, dateTo) {
213
+ const logDir = path.join(__dirname, "../data/log");
214
+ const files = await readDir(logDir);
215
+ const logs = [];
216
+ for (const file of files) {
217
+ const filePath = path.join(logDir, file);
218
+ const content = await readFile(filePath, "utf-8");
219
+ const logEntry = JSON.parse(content);
220
+ const fileDate = format(
221
+ new Date(file.split(".")[0].replace(/-/g, ":")),
222
+ "yyyy-MM-dd HH:mm:ss:SSS"
223
+ );
224
+ if ((!dateFrom || new Date(fileDate) >= dateFrom) && (!dateTo || new Date(fileDate) <= dateTo)) {
225
+ logs.push(logEntry);
226
+ }
227
+ }
228
+ logs.sort((a, b) => new Date(a.dateCreated).getTime() - new Date(b.dateCreated).getTime());
229
+ return logs;
230
+ }
231
+ // /**
232
+ // * Экспортирует массив логов в файл JSON.
233
+ // * @param logs - Массив логов, который нужно экспортировать.
234
+ // * @returns {Promise<void>}
235
+ // */
236
+ // private async exportToJson(logs: any[]): Promise<void> {
237
+ // const exportFile = path.join(__dirname, '../data/export/logs.json');
238
+ // await writeFile(exportFile, JSON.stringify(logs, null, 2));
239
+ // console.log(`Logs exported to JSON file: ${exportFile}`);
240
+ // }
241
+ /**
242
+ * Экспортирует массив логов в файл Excel.
243
+ * @param logs - Массив логов, который нужно экспортировать.
244
+ * @returns {Promise<void>}
245
+ */
246
+ async exportToExcel(logs) {
247
+ const workbook = new ExcelJS.Workbook();
248
+ const worksheet = workbook.addWorksheet("Logs");
249
+ if (private_env.ENABLE_DB_SUPPORT) {
250
+ worksheet.columns = Object.keys(logs[0] ?? {}).map((key) => {
251
+ return {
252
+ header: ExcelColumnsName[key] ?? key,
253
+ key,
254
+ width: 30
255
+ };
256
+ });
257
+ logs.forEach((log) => {
258
+ const consultations = (log.consultations ?? []).map((v) => JSON.stringify(v));
259
+ const searchResults = (log.searchResults ?? []).map((v) => JSON.stringify(v));
260
+ const selectedSearchResults = (log.selectedSearchResults ?? []).map(
261
+ (v) => JSON.stringify(v)
262
+ );
263
+ const serializedLog = Object.fromEntries(
264
+ Object.entries(log).map(([key, value]) => [
265
+ key,
266
+ typeof value === "object" && value !== null ? JSON.stringify(value) : value
267
+ ])
268
+ );
269
+ worksheet.addRow({
270
+ ...serializedLog,
271
+ consultations: consultations[0] ?? "",
272
+ searchResults: searchResults[0] ?? "",
273
+ selectedSearchResults: selectedSearchResults[0] ?? ""
274
+ });
275
+ const maxLength = Math.max(
276
+ consultations.length,
277
+ searchResults.length,
278
+ selectedSearchResults.length
279
+ );
280
+ for (let index = 1; index < maxLength; index++) {
281
+ worksheet.addRow({
282
+ consultations: consultations[index] ?? "",
283
+ searchResults: searchResults[index] ?? "",
284
+ selectedSearchResults: selectedSearchResults[index] ?? ""
285
+ });
286
+ }
287
+ });
288
+ }
289
+ const buffer = await workbook.xlsx.writeBuffer();
290
+ return buffer;
291
+ }
292
+ }
293
+
294
+ export { LogService as L };
295
+ //# sourceMappingURL=LogService-b0lb4PC5.js.map
build/server/chunks/LogService-b0lb4PC5.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"LogService-b0lb4PC5.js","sources":["../../../.svelte-kit/adapter-node/chunks/LogService.js"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport { promisify } from \"util\";\nimport { format } from \"date-fns\";\nimport mongoose from \"mongoose\";\nimport ExcelJS from \"exceljs\";\nimport { d as private_env } from \"./shared-server.js\";\nimport { E as ExcelColumnsName } from \"./constants.js\";\nconst LogSchema = new mongoose.Schema({\n llmPrompt: { type: String },\n llmTemplate: { type: String },\n llmResponse: { type: String },\n searchResults: { type: [String] },\n selectedSearchResults: { type: [String] },\n uiSettings: { type: Object },\n consultations: { type: [String] },\n userRequest: { type: String },\n userScore: { type: String },\n userComment: { type: String },\n dateCreated: { type: Date, default: Date.now },\n dateUpdated: { type: Date, default: Date.now }\n});\nLogSchema.index({ dateCreated: 1 }, { unique: false });\nconst LogModel = mongoose.models.Log || mongoose.model(\"Log\", LogSchema);\nclass MongooseService {\n uri;\n options;\n connection;\n constructor(uri, options = {}) {\n try {\n this.uri = uri || process.env.MONGODB_URI || \"\";\n this.options = options;\n this.connection = null;\n if (!this.uri) {\n console.warn(\"MongoDB URI is not defined\");\n }\n } catch {\n console.warn(\"MongoDB URI is not defined. Logs wont be saved.\");\n }\n }\n /**\n * Connect to the MongoDB database\n * @returns {Promise<Connection>}\n */\n async connect() {\n if (this.connection) {\n return this.connection;\n }\n try {\n await mongoose.connect(this.uri, this.options);\n this.connection = mongoose.connection;\n console.log(\"Connected to MongoDB\");\n return this.connection;\n } catch (error) {\n console.warn(\"MongoDB URI is not defined. Logs wont be saved.\");\n }\n }\n /**\n * Disconnect from the MongoDB database\n * @returns {Promise<void>}\n */\n async disconnect() {\n if (!this.connection) {\n console.log(\"No active MongoDB connection to disconnect\");\n return;\n }\n try {\n await mongoose.disconnect();\n this.connection = null;\n console.log(\"Disconnected from MongoDB\");\n } catch (error) {\n console.error(\"Error disconnecting from MongoDB:\", error);\n throw new Error(\"Could not disconnect from MongoDB\");\n }\n }\n /**\n * Get the current MongoDB connection\n * @returns {Connection | null}\n */\n async getConnection() {\n if (!this.isConnected()) {\n await this.connect();\n }\n return this.connection;\n }\n isConnected() {\n return this.connection !== null && mongoose.connection.readyState === 1;\n }\n}\nconst writeFile = promisify(fs.writeFile);\nconst readDir = promisify(fs.readdir);\nconst readFile = promisify(fs.readFile);\nclass LogService {\n mongooseService;\n logModel;\n constructor() {\n if (private_env.ENABLE_DB_SUPPORT) {\n this.mongooseService = new MongooseService(private_env.MONGODB_URI || \"\");\n this.logModel = LogModel;\n }\n }\n /**\n * Сохраняет лог в базу данных MongoDB, если она доступна.\n * @param document - Лог-документ, который нужно сохранить.\n * @returns {Promise<string>} ID созданной записи.\n */\n async log(document) {\n if (!private_env.ENABLE_DB_SUPPORT) {\n return \"\";\n }\n try {\n await this.mongooseService.getConnection();\n const logEntry = new this.logModel(document);\n await logEntry.save();\n console.log(\"Log entry saved to MongoDB\");\n return logEntry._id;\n } catch (err) {\n console.error(\"MongoDB connection failed\", err);\n }\n return \"\";\n }\n /**\n * Обновляет поле userScore в записи с указанным ID.\n * @param id - ID записи, которую нужно обновить.\n * @param score - Новое значение для userScore.\n * @param comment - Новое значение для userComment.\n * @returns Количество обновленных записей.\n */\n async logUserScore(id, score, comment) {\n if (!private_env.ENABLE_DB_SUPPORT) {\n return \"\";\n }\n try {\n await this.mongooseService.getConnection();\n const LogModel2 = mongoose.model(\"Log\");\n const result = await LogModel2.updateOne(\n { _id: id },\n { $set: { userScore: score, userComment: comment } }\n );\n return result.modifiedCount;\n } catch (error) {\n console.error(\"Error while updating userScore:\", error);\n throw error;\n }\n }\n /**\n * Сохраняет лог-документ в файл JSON.\n * Имя файла основано на текущем времени.\n * @param document - Лог-документ, который нужно сохранить.\n * @returns {Promise<void>}\n */\n async saveLogToJsonFile(document) {\n const timestamp = format(/* @__PURE__ */ new Date(), \"dd-MM-yyyy:HH:mm:ss:SSS\");\n const logDir = path.join(private_env.LOGS_ROOT_FOLDER, \"log\");\n const logFile = path.join(logDir, `${timestamp}.json`);\n if (!fs.existsSync(logDir)) {\n fs.mkdirSync(logDir, { recursive: true });\n }\n const data = JSON.stringify(document, null, 2);\n await writeFile(logFile, data);\n console.log(`Log entry saved to file: ${logFile}`);\n }\n /**\n * Экспортирует логи из базы данных и/или файлов в формате JSON или Excel.\n * Записи сортируются по дате создания. Если указаны dateFrom и dateTo, применяется фильтрация по дате.\n * @param type - Тип экспорта: 'json' или 'excel'.\n * @param dateFrom - Дата начала фильтрации (необязательно).\n * @param dateTo - Дата окончания фильтрации (необязательно).\n * @param fields - Поля для экспорта\n * @returns {Promise<any>}\n */\n async export(type, dateFrom, dateTo, fields) {\n if (!private_env.ENABLE_DB_SUPPORT) {\n return \"\";\n }\n const mongoLogs = await this.fetchLogsFromMongo(dateFrom, dateTo, fields);\n const allLogs = [...mongoLogs];\n if (type === \"json\") {\n return await this.exportToJson(allLogs);\n } else if (type === \"excel\") {\n return await this.exportToExcel(allLogs);\n }\n }\n /**\n * Извлекает логи из базы данных MongoDB с учетом фильтрации по дате.\n * @param dateFrom - Дата начала фильтрации (необязательно).\n * @param dateTo - Дата окончания фильтрации (необязательно).\n * @returns {Promise<any[]>} - Возвращает массив логов.\n */\n async fetchLogsFromMongo(dateFrom, dateTo, fields) {\n if (!private_env.ENABLE_DB_SUPPORT) {\n return [];\n }\n const query = {};\n if (dateFrom || dateTo) {\n query.dateCreated = {};\n if (dateFrom)\n query.dateCreated.$gte = dateFrom;\n if (dateTo)\n query.dateCreated.$lte = dateTo;\n }\n await this.mongooseService.getConnection();\n return await this.logModel.find(query).select(fields ? fields.join(\" \") : \"\").sort({ dateCreated: 1 }).lean().exec();\n }\n /**\n * Извлекает логи из файлов JSON в папке /data/log с учетом фильтрации по дате.\n * @param dateFrom - Дата начала фильтрации (необязательно).\n * @param dateTo - Дата окончания фильтрации (необязательно).\n * @returns {Promise<any[]>} - Возвращает массив логов.\n */\n async fetchLogsFromFiles(dateFrom, dateTo) {\n const logDir = path.join(__dirname, \"../data/log\");\n const files = await readDir(logDir);\n const logs = [];\n for (const file of files) {\n const filePath = path.join(logDir, file);\n const content = await readFile(filePath, \"utf-8\");\n const logEntry = JSON.parse(content);\n const fileDate = format(\n new Date(file.split(\".\")[0].replace(/-/g, \":\")),\n \"yyyy-MM-dd HH:mm:ss:SSS\"\n );\n if ((!dateFrom || new Date(fileDate) >= dateFrom) && (!dateTo || new Date(fileDate) <= dateTo)) {\n logs.push(logEntry);\n }\n }\n logs.sort((a, b) => new Date(a.dateCreated).getTime() - new Date(b.dateCreated).getTime());\n return logs;\n }\n // /**\n // * Экспортирует массив логов в файл JSON.\n // * @param logs - Массив логов, который нужно экспортировать.\n // * @returns {Promise<void>}\n // */\n // private async exportToJson(logs: any[]): Promise<void> {\n // const exportFile = path.join(__dirname, '../data/export/logs.json');\n // await writeFile(exportFile, JSON.stringify(logs, null, 2));\n // console.log(`Logs exported to JSON file: ${exportFile}`);\n // }\n /**\n * Экспортирует массив логов в файл Excel.\n * @param logs - Массив логов, который нужно экспортировать.\n * @returns {Promise<void>}\n */\n async exportToExcel(logs) {\n const workbook = new ExcelJS.Workbook();\n const worksheet = workbook.addWorksheet(\"Logs\");\n if (private_env.ENABLE_DB_SUPPORT) {\n worksheet.columns = Object.keys(logs[0] ?? {}).map((key) => {\n return {\n header: ExcelColumnsName[key] ?? key,\n key,\n width: 30\n };\n });\n logs.forEach((log) => {\n const consultations = (log.consultations ?? []).map((v) => JSON.stringify(v));\n const searchResults = (log.searchResults ?? []).map((v) => JSON.stringify(v));\n const selectedSearchResults = (log.selectedSearchResults ?? []).map(\n (v) => JSON.stringify(v)\n );\n const serializedLog = Object.fromEntries(\n Object.entries(log).map(([key, value]) => [\n key,\n typeof value === \"object\" && value !== null ? JSON.stringify(value) : value\n ])\n );\n worksheet.addRow({\n ...serializedLog,\n consultations: consultations[0] ?? \"\",\n searchResults: searchResults[0] ?? \"\",\n selectedSearchResults: selectedSearchResults[0] ?? \"\"\n });\n const maxLength = Math.max(\n consultations.length,\n searchResults.length,\n selectedSearchResults.length\n );\n for (let index = 1; index < maxLength; index++) {\n worksheet.addRow({\n consultations: consultations[index] ?? \"\",\n searchResults: searchResults[index] ?? \"\",\n selectedSearchResults: selectedSearchResults[index] ?? \"\"\n });\n }\n });\n }\n const buffer = await workbook.xlsx.writeBuffer();\n return buffer;\n }\n}\nexport {\n LogService as L\n};\n"],"names":[],"mappings":";;;;;;;;;AAQA,MAAM,SAAS,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC;AACtC,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;AAC7B,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;AAC/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M,CAAC;AACzB,UAAU,GAAG,aAAa;AAC1B,UAAU,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE;AAC/C,UAAU,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE;AAC/C,UAAU,qBAAqB,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,EAAE;AAC/D,SAAS,CAAC,CAAC;AACX,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG;AAClC,UAAU,aAAa,CAAC,MAAM;AAC9B,UAAU,aAAa,CAAC,MAAM;AAC9B,UAAU,qBAAqB,CAAC,MAAM;AACtC,SAAS,CAAC;AACV,QAAQ,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,EAAE,KAAK,EAAE,EAAE;AACxD,UAAU,SAAS,CAAC,MAAM,CAAC;AAC3B,YAAY,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE;AACrD,YAAY,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE;AACrD,YAAY,qBAAqB,EAAE,qBAAqB,CAAC,KAAK,CAAC,IAAI,EAAE;AACrE,WAAW,CAAC,CAAC;AACb,SAAS;AACT,OAAO,CAAC,CAAC;AACT,KAAK;AACL,IAAI,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AACrD,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH;;;;"}
build/server/chunks/_page.svelte-E0YaQIXg.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { c as create_ssr_component, b as add_attribute } from './ssr-IdY0EU5r.js';
2
+ import './ProgressBar.svelte_svelte_type_style_lang-5Gb3pa2y.js';
3
+ import './index2-KUnGpG6g.js';
4
+
5
+ const css = {
6
+ code: ".export_bar.svelte-1szjsif,.filters.svelte-1szjsif{display:flex;align-items:center;gap:10px;margin:20px}.export_bar.svelte-1szjsif{justify-content:space-between}#fields_container.svelte-1szjsif{display:flex;flex-direction:column}",
7
+ map: null
8
+ };
9
+ const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
10
+ let addPrompt = true;
11
+ let addLlmAnswer = true;
12
+ let addSearchResults = true;
13
+ let addSelectedSearchResults = true;
14
+ let addUiSettings = true;
15
+ let addConsultations = true;
16
+ let addRequest = true;
17
+ let addComment = true;
18
+ let addDateCreated = true;
19
+ let addDateUpdated = true;
20
+ $$result.css.add(css);
21
+ return `<h1 data-svelte-h="svelte-pofs8j">Пользовательские логи</h1> <div><div class="export_bar svelte-1szjsif"><div class="filters svelte-1szjsif"><label>Дата начала:
22
+ <input type="date"></label> <label>Дата конца:
23
+ <input type="date"></label> <button class="btn variant-outline-tertiary w-48 justify-between" data-svelte-h="svelte-szcpq9">Поля для экспорта
24
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 20" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M12 14.5a.75.75 0 01-.53-.22l-4.25-4.25a.75.75 0 011.06-1.06L12 12.69l3.72-3.72a.75.75 0 011.06 1.06l-4.25 4.25a.75.75 0 01-.53.22z" clip-rule="evenodd"></path></svg></button> <div class="card p-4 w-150 shadow-xl z-10" data-popup="popupFeatured"><div><label class="flex items-left space-x-2 svelte-1szjsif" id="fields_container"><div class="flex items-center space-x-2 mx-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addPrompt, 1)}> <p data-svelte-h="svelte-1r1lhxs">Промпт</p></div> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addLlmAnswer, 1)}> <p data-svelte-h="svelte-1t98vry">Ответ LLM</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addSearchResults, 1)}> <p data-svelte-h="svelte-15yeo0d">Результаты поиска</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addSelectedSearchResults, 1)}> <p data-svelte-h="svelte-2trpqh">Выбранные результаты поиска</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addUiSettings, 1)}> <p data-svelte-h="svelte-1fv4577">Параметры</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addConsultations, 1)}> <p data-svelte-h="svelte-1ajbauh">Релевантные консультации</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addRequest, 1)}> <p data-svelte-h="svelte-1s3b98z">Запрос</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addComment, 1)}> <p data-svelte-h="svelte-16cwydz">Комментарий</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addDateCreated, 1)}> <p data-svelte-h="svelte-tv34i0">Дата создания</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", addDateUpdated, 1)}> <p data-svelte-h="svelte-1g2zmpw">Дата обновления</p></label></label></div></div></div> <div class="flex space-x-2 items-center"><button class="btn variant-filled" data-svelte-h="svelte-77urvm">Экспорт Excel</button></div></div> </div>`;
25
+ });
26
+
27
+ export { Page as default };
28
+ //# sourceMappingURL=_page.svelte-E0YaQIXg.js.map
build/server/chunks/_page.svelte-E0YaQIXg.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"_page.svelte-E0YaQIXg.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/logs/_page.svelte.js"],"sourcesContent":["import { c as create_ssr_component, i as add_attribute } from \"../../../chunks/ssr.js\";\nimport \"../../../chunks/ProgressBar.svelte_svelte_type_style_lang.js\";\nconst css = {\n code: \".export_bar.svelte-1szjsif,.filters.svelte-1szjsif{display:flex;align-items:center;gap:10px;margin:20px}.export_bar.svelte-1szjsif{justify-content:space-between}#fields_container.svelte-1szjsif{display:flex;flex-direction:column}\",\n map: null\n};\nconst Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let addPrompt = true;\n let addLlmAnswer = true;\n let addSearchResults = true;\n let addSelectedSearchResults = true;\n let addUiSettings = true;\n let addConsultations = true;\n let addRequest = true;\n let addComment = true;\n let addDateCreated = true;\n let addDateUpdated = true;\n $$result.css.add(css);\n return `<h1 data-svelte-h=\"svelte-pofs8j\">Пользовательские логи</h1> <div><div class=\"export_bar svelte-1szjsif\"><div class=\"filters svelte-1szjsif\"><label>Дата начала:\n\t\t\t\t<input type=\"date\"></label> <label>Дата конца:\n\t\t\t\t<input type=\"date\"></label> <button class=\"btn variant-outline-tertiary w-48 justify-between\" data-svelte-h=\"svelte-szcpq9\">Поля для экспорта\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 20\" fill=\"currentColor\" class=\"w-6 h-6\"><path fill-rule=\"evenodd\" d=\"M12 14.5a.75.75 0 01-.53-.22l-4.25-4.25a.75.75 0 011.06-1.06L12 12.69l3.72-3.72a.75.75 0 011.06 1.06l-4.25 4.25a.75.75 0 01-.53.22z\" clip-rule=\"evenodd\"></path></svg></button> <div class=\"card p-4 w-150 shadow-xl z-10\" data-popup=\"popupFeatured\"><div><label class=\"flex items-left space-x-2 svelte-1szjsif\" id=\"fields_container\"><div class=\"flex items-center space-x-2 mx-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addPrompt, 1)}> <p data-svelte-h=\"svelte-1r1lhxs\">Промпт</p></div> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addLlmAnswer, 1)}> <p data-svelte-h=\"svelte-1t98vry\">Ответ LLM</p></label> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addSearchResults, 1)}> <p data-svelte-h=\"svelte-15yeo0d\">Результаты поиска</p></label> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addSelectedSearchResults, 1)}> <p data-svelte-h=\"svelte-2trpqh\">Выбранные результаты поиска</p></label> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addUiSettings, 1)}> <p data-svelte-h=\"svelte-1fv4577\">Параметры</p></label> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addConsultations, 1)}> <p data-svelte-h=\"svelte-1ajbauh\">Релевантные консультации</p></label> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addRequest, 1)}> <p data-svelte-h=\"svelte-1s3b98z\">Запрос</p></label> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addComment, 1)}> <p data-svelte-h=\"svelte-16cwydz\">Комментарий</p></label> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addDateCreated, 1)}> <p data-svelte-h=\"svelte-tv34i0\">Дата создания</p></label> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", addDateUpdated, 1)}> <p data-svelte-h=\"svelte-1g2zmpw\">Дата обновления</p></label></label></div></div></div> <div class=\"flex space-x-2 items-center\"><button class=\"btn variant-filled\" data-svelte-h=\"svelte-77urvm\">Экспорт Excel</button></div></div> </div>`;\n});\nexport {\n Page as default\n};\n"],"names":[],"mappings":";;;;AAEA,MAAM,GAAG,GAAG;AACZ,EAAE,IAAI,EAAE,uOAAuO;AAC/O,EAAE,GAAG,EAAE,IAAI;AACX,CAAC,CAAC;AACG,MAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC5E,EAAE,IAAI,SA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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { c as create_ssr_component, o as onDestroy, v as validate_component, e as escape, b as add_attribute, g as getContext, s as setContext, d as compute_rest_props, f as createEventDispatcher, h as spread, i as escape_attribute_value, j as escape_object, a as subscribe, k as each, l as set_store_value, n as hasContext, p as compute_slots, q as split_css_unit } from './ssr-IdY0EU5r.js';
2
+ import './client-_MkdHwD5.js';
3
+ import { w as writable } from './index2-KUnGpG6g.js';
4
+ import { p as prefersReducedMotionStore } from './ProgressBar.svelte_svelte_type_style_lang-5Gb3pa2y.js';
5
+ import 'docx';
6
+ import 'file-saver';
7
+ import { H as HelpDocumentId } from './constants-jjpZ8eI6.js';
8
+ import './exports-mq_1S73-.js';
9
+
10
+ const DRAWER_STORE_KEY = "drawerStore";
11
+ function initializeDrawerStore() {
12
+ const drawerStore = drawerService();
13
+ return setContext(DRAWER_STORE_KEY, drawerStore);
14
+ }
15
+ function drawerService() {
16
+ const { subscribe: subscribe2, set, update: update2 } = writable({});
17
+ return {
18
+ subscribe: subscribe2,
19
+ set,
20
+ update: update2,
21
+ /** Open the drawer. */
22
+ open: (newSettings) => update2(() => {
23
+ return { open: true, ...newSettings };
24
+ }),
25
+ /** Close the drawer. */
26
+ close: () => update2((d) => {
27
+ d.open = false;
28
+ return d;
29
+ })
30
+ };
31
+ }
32
+ const MODAL_STORE_KEY = "modalStore";
33
+ function initializeModalStore() {
34
+ const modalStore = modalService();
35
+ return setContext(MODAL_STORE_KEY, modalStore);
36
+ }
37
+ function modalService() {
38
+ const { subscribe: subscribe2, set, update: update2 } = writable([]);
39
+ return {
40
+ subscribe: subscribe2,
41
+ set,
42
+ update: update2,
43
+ /** Append to end of queue. */
44
+ trigger: (modal) => update2((mStore) => {
45
+ mStore.push(modal);
46
+ return mStore;
47
+ }),
48
+ /** Remove first item in queue. */
49
+ close: () => update2((mStore) => {
50
+ if (mStore.length > 0)
51
+ mStore.shift();
52
+ return mStore;
53
+ }),
54
+ /** Remove all items from queue. */
55
+ clear: () => set([])
56
+ };
57
+ }
58
+ const toastDefaults = { message: "Missing Toast Message", autohide: true, timeout: 5e3 };
59
+ const TOAST_STORE_KEY = "toastStore";
60
+ function getToastStore() {
61
+ const toastStore = getContext(TOAST_STORE_KEY);
62
+ if (!toastStore)
63
+ throw new Error("toastStore is not initialized. Please ensure that `initializeStores()` is invoked in the root layout file of this app!");
64
+ return toastStore;
65
+ }
66
+ function initializeToastStore() {
67
+ const toastStore = toastService();
68
+ return setContext(TOAST_STORE_KEY, toastStore);
69
+ }
70
+ function randomUUID() {
71
+ const random = Math.random();
72
+ return Number(random).toString(32);
73
+ }
74
+ function toastService() {
75
+ const { subscribe: subscribe2, set, update: update2 } = writable([]);
76
+ const close = (id) => update2((tStore) => {
77
+ if (tStore.length > 0) {
78
+ const index = tStore.findIndex((t) => t.id === id);
79
+ const selectedToast = tStore[index];
80
+ if (selectedToast) {
81
+ if (selectedToast.callback)
82
+ selectedToast.callback({ id, status: "closed" });
83
+ if (selectedToast.timeoutId)
84
+ clearTimeout(selectedToast.timeoutId);
85
+ tStore.splice(index, 1);
86
+ }
87
+ }
88
+ return tStore;
89
+ });
90
+ function handleAutoHide(toast) {
91
+ if (toast.autohide === true) {
92
+ return setTimeout(() => {
93
+ close(toast.id);
94
+ }, toast.timeout);
95
+ }
96
+ }
97
+ return {
98
+ subscribe: subscribe2,
99
+ close,
100
+ /** Add a new toast to the queue. */
101
+ trigger: (toast) => {
102
+ const id = randomUUID();
103
+ update2((tStore) => {
104
+ if (toast && toast.callback)
105
+ toast.callback({ id, status: "queued" });
106
+ if (toast.hideDismiss)
107
+ toast.autohide = true;
108
+ const tMerged = { ...toastDefaults, ...toast, id };
109
+ tMerged.timeoutId = handleAutoHide(tMerged);
110
+ tStore.push(tMerged);
111
+ return tStore;
112
+ });
113
+ return id;
114
+ },
115
+ /** Remain visible on hover */
116
+ freeze: (index) => update2((tStore) => {
117
+ if (tStore.length > 0)
118
+ clearTimeout(tStore[index].timeoutId);
119
+ return tStore;
120
+ }),
121
+ /** Cancel remain visible on leave */
122
+ unfreeze: (index) => update2((tStore) => {
123
+ if (tStore.length > 0)
124
+ tStore[index].timeoutId = handleAutoHide(tStore[index]);
125
+ return tStore;
126
+ }),
127
+ /** Remove all toasts from queue */
128
+ clear: () => set([])
129
+ };
130
+ }
131
+ function initializeStores() {
132
+ initializeModalStore();
133
+ initializeToastStore();
134
+ initializeDrawerStore();
135
+ }
136
+ function cubicOut(t) {
137
+ const f = t - 1;
138
+ return f * f * f + 1;
139
+ }
140
+ function fly(node, { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}) {
141
+ const style = getComputedStyle(node);
142
+ const target_opacity = +style.opacity;
143
+ const transform = style.transform === "none" ? "" : style.transform;
144
+ const od = target_opacity * (1 - opacity);
145
+ const [xValue, xUnit] = split_css_unit(x);
146
+ const [yValue, yUnit] = split_css_unit(y);
147
+ return {
148
+ delay,
149
+ duration,
150
+ easing,
151
+ css: (t, u) => `
152
+ transform: ${transform} translate(${(1 - t) * xValue}${xUnit}, ${(1 - t) * yValue}${yUnit});
153
+ opacity: ${target_opacity - od * u}`
154
+ };
155
+ }
156
+ function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = "y" } = {}) {
157
+ const style = getComputedStyle(node);
158
+ const opacity = +style.opacity;
159
+ const primary_property = axis === "y" ? "height" : "width";
160
+ const primary_property_value = parseFloat(style[primary_property]);
161
+ const secondary_properties = axis === "y" ? ["top", "bottom"] : ["left", "right"];
162
+ const capitalized_secondary_properties = secondary_properties.map(
163
+ (e) => `${e[0].toUpperCase()}${e.slice(1)}`
164
+ );
165
+ const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);
166
+ const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);
167
+ const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);
168
+ const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);
169
+ const border_width_start_value = parseFloat(
170
+ style[`border${capitalized_secondary_properties[0]}Width`]
171
+ );
172
+ const border_width_end_value = parseFloat(
173
+ style[`border${capitalized_secondary_properties[1]}Width`]
174
+ );
175
+ return {
176
+ delay,
177
+ duration,
178
+ easing,
179
+ css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};${primary_property}: ${t * primary_property_value}px;padding-${secondary_properties[0]}: ${t * padding_start_value}px;padding-${secondary_properties[1]}: ${t * padding_end_value}px;margin-${secondary_properties[0]}: ${t * margin_start_value}px;margin-${secondary_properties[1]}: ${t * margin_end_value}px;border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`
180
+ };
181
+ }
182
+ const Accordion = create_ssr_component(($$result, $$props, $$bindings, slots) => {
183
+ let classesBase;
184
+ let $prefersReducedMotionStore, $$unsubscribe_prefersReducedMotionStore;
185
+ $$unsubscribe_prefersReducedMotionStore = subscribe(prefersReducedMotionStore, (value) => $prefersReducedMotionStore = value);
186
+ let { autocollapse = false } = $$props;
187
+ let { width = "w-full" } = $$props;
188
+ let { spacing = "space-y-1" } = $$props;
189
+ let { disabled = false } = $$props;
190
+ let { padding = "py-2 px-4" } = $$props;
191
+ let { hover = "hover:bg-primary-hover-token" } = $$props;
192
+ let { rounded = "rounded-container-token" } = $$props;
193
+ let { caretOpen = "rotate-180" } = $$props;
194
+ let { caretClosed = "" } = $$props;
195
+ let { regionControl = "" } = $$props;
196
+ let { regionPanel = "space-y-4" } = $$props;
197
+ let { regionCaret = "" } = $$props;
198
+ let { transitions = !$prefersReducedMotionStore } = $$props;
199
+ let { transitionIn = slide } = $$props;
200
+ let { transitionInParams = { duration: 200 } } = $$props;
201
+ let { transitionOut = slide } = $$props;
202
+ let { transitionOutParams = { duration: 200 } } = $$props;
203
+ const active = writable(null);
204
+ setContext("active", active);
205
+ setContext("autocollapse", autocollapse);
206
+ setContext("disabled", disabled);
207
+ setContext("padding", padding);
208
+ setContext("hover", hover);
209
+ setContext("rounded", rounded);
210
+ setContext("caretOpen", caretOpen);
211
+ setContext("caretClosed", caretClosed);
212
+ setContext("regionControl", regionControl);
213
+ setContext("regionPanel", regionPanel);
214
+ setContext("regionCaret", regionCaret);
215
+ setContext("transitions", transitions);
216
+ setContext("transitionIn", transitionIn);
217
+ setContext("transitionInParams", transitionInParams);
218
+ setContext("transitionOut", transitionOut);
219
+ setContext("transitionOutParams", transitionOutParams);
220
+ if ($$props.autocollapse === void 0 && $$bindings.autocollapse && autocollapse !== void 0)
221
+ $$bindings.autocollapse(autocollapse);
222
+ if ($$props.width === void 0 && $$bindings.width && width !== void 0)
223
+ $$bindings.width(width);
224
+ if ($$props.spacing === void 0 && $$bindings.spacing && spacing !== void 0)
225
+ $$bindings.spacing(spacing);
226
+ if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
227
+ $$bindings.disabled(disabled);
228
+ if ($$props.padding === void 0 && $$bindings.padding && padding !== void 0)
229
+ $$bindings.padding(padding);
230
+ if ($$props.hover === void 0 && $$bindings.hover && hover !== void 0)
231
+ $$bindings.hover(hover);
232
+ if ($$props.rounded === void 0 && $$bindings.rounded && rounded !== void 0)
233
+ $$bindings.rounded(rounded);
234
+ if ($$props.caretOpen === void 0 && $$bindings.caretOpen && caretOpen !== void 0)
235
+ $$bindings.caretOpen(caretOpen);
236
+ if ($$props.caretClosed === void 0 && $$bindings.caretClosed && caretClosed !== void 0)
237
+ $$bindings.caretClosed(caretClosed);
238
+ if ($$props.regionControl === void 0 && $$bindings.regionControl && regionControl !== void 0)
239
+ $$bindings.regionControl(regionControl);
240
+ if ($$props.regionPanel === void 0 && $$bindings.regionPanel && regionPanel !== void 0)
241
+ $$bindings.regionPanel(regionPanel);
242
+ if ($$props.regionCaret === void 0 && $$bindings.regionCaret && regionCaret !== void 0)
243
+ $$bindings.regionCaret(regionCaret);
244
+ if ($$props.transitions === void 0 && $$bindings.transitions && transitions !== void 0)
245
+ $$bindings.transitions(transitions);
246
+ if ($$props.transitionIn === void 0 && $$bindings.transitionIn && transitionIn !== void 0)
247
+ $$bindings.transitionIn(transitionIn);
248
+ if ($$props.transitionInParams === void 0 && $$bindings.transitionInParams && transitionInParams !== void 0)
249
+ $$bindings.transitionInParams(transitionInParams);
250
+ if ($$props.transitionOut === void 0 && $$bindings.transitionOut && transitionOut !== void 0)
251
+ $$bindings.transitionOut(transitionOut);
252
+ if ($$props.transitionOutParams === void 0 && $$bindings.transitionOutParams && transitionOutParams !== void 0)
253
+ $$bindings.transitionOutParams(transitionOutParams);
254
+ classesBase = `${width} ${spacing} ${$$props.class ?? ""}`;
255
+ $$unsubscribe_prefersReducedMotionStore();
256
+ return ` <div class="${"accordion " + escape(classesBase, true)}" data-testid="accordion">${slots.default ? slots.default({}) : ``}</div>`;
257
+ });
258
+ const cBase$3 = "";
259
+ const cControl = "text-start w-full flex items-center space-x-4";
260
+ const cControlIcons = "fill-current w-3 transition-transform duration-[200ms]";
261
+ const cPanel = "";
262
+ const AccordionItem = create_ssr_component(($$result, $$props, $$bindings, slots) => {
263
+ let openState;
264
+ let classesBase;
265
+ let classesControl;
266
+ let classesCaretState;
267
+ let classesControlCaret;
268
+ let classesControlIcons;
269
+ let classesPanel;
270
+ let $$slots = compute_slots(slots);
271
+ let $active, $$unsubscribe_active;
272
+ const dispatch = createEventDispatcher();
273
+ let { open = false } = $$props;
274
+ let { id = String(Math.random()) } = $$props;
275
+ let { autocollapse = getContext("autocollapse") } = $$props;
276
+ let { active = getContext("active") } = $$props;
277
+ $$unsubscribe_active = subscribe(active, (value) => $active = value);
278
+ let { disabled = getContext("disabled") } = $$props;
279
+ let { padding = getContext("padding") } = $$props;
280
+ let { hover = getContext("hover") } = $$props;
281
+ let { rounded = getContext("rounded") } = $$props;
282
+ let { caretOpen = getContext("caretOpen") } = $$props;
283
+ let { caretClosed = getContext("caretClosed") } = $$props;
284
+ let { regionControl = getContext("regionControl") } = $$props;
285
+ let { regionPanel = getContext("regionPanel") } = $$props;
286
+ let { regionCaret = getContext("regionCaret") } = $$props;
287
+ let { transitions = getContext("transitions") } = $$props;
288
+ let { transitionIn = getContext("transitionIn") } = $$props;
289
+ let { transitionInParams = getContext("transitionInParams") } = $$props;
290
+ let { transitionOut = getContext("transitionOut") } = $$props;
291
+ let { transitionOutParams = getContext("transitionOutParams") } = $$props;
292
+ const svgCaretIcon = `
293
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class={classesControlCaret}>
294
+ <path d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z" />
295
+ </svg>`;
296
+ function setActive(event) {
297
+ if (autocollapse === true) {
298
+ active.set(id);
299
+ } else {
300
+ open = !open;
301
+ }
302
+ onToggle(event);
303
+ }
304
+ function onToggle(event) {
305
+ const currentOpenState = autocollapse ? $active === id : open;
306
+ dispatch("toggle", {
307
+ event,
308
+ id,
309
+ panelId: `accordion-panel-${id}`,
310
+ open: currentOpenState,
311
+ autocollapse
312
+ });
313
+ }
314
+ if (autocollapse && open)
315
+ setActive();
316
+ if ($$props.open === void 0 && $$bindings.open && open !== void 0)
317
+ $$bindings.open(open);
318
+ if ($$props.id === void 0 && $$bindings.id && id !== void 0)
319
+ $$bindings.id(id);
320
+ if ($$props.autocollapse === void 0 && $$bindings.autocollapse && autocollapse !== void 0)
321
+ $$bindings.autocollapse(autocollapse);
322
+ if ($$props.active === void 0 && $$bindings.active && active !== void 0)
323
+ $$bindings.active(active);
324
+ if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
325
+ $$bindings.disabled(disabled);
326
+ if ($$props.padding === void 0 && $$bindings.padding && padding !== void 0)
327
+ $$bindings.padding(padding);
328
+ if ($$props.hover === void 0 && $$bindings.hover && hover !== void 0)
329
+ $$bindings.hover(hover);
330
+ if ($$props.rounded === void 0 && $$bindings.rounded && rounded !== void 0)
331
+ $$bindings.rounded(rounded);
332
+ if ($$props.caretOpen === void 0 && $$bindings.caretOpen && caretOpen !== void 0)
333
+ $$bindings.caretOpen(caretOpen);
334
+ if ($$props.caretClosed === void 0 && $$bindings.caretClosed && caretClosed !== void 0)
335
+ $$bindings.caretClosed(caretClosed);
336
+ if ($$props.regionControl === void 0 && $$bindings.regionControl && regionControl !== void 0)
337
+ $$bindings.regionControl(regionControl);
338
+ if ($$props.regionPanel === void 0 && $$bindings.regionPanel && regionPanel !== void 0)
339
+ $$bindings.regionPanel(regionPanel);
340
+ if ($$props.regionCaret === void 0 && $$bindings.regionCaret && regionCaret !== void 0)
341
+ $$bindings.regionCaret(regionCaret);
342
+ if ($$props.transitions === void 0 && $$bindings.transitions && transitions !== void 0)
343
+ $$bindings.transitions(transitions);
344
+ if ($$props.transitionIn === void 0 && $$bindings.transitionIn && transitionIn !== void 0)
345
+ $$bindings.transitionIn(transitionIn);
346
+ if ($$props.transitionInParams === void 0 && $$bindings.transitionInParams && transitionInParams !== void 0)
347
+ $$bindings.transitionInParams(transitionInParams);
348
+ if ($$props.transitionOut === void 0 && $$bindings.transitionOut && transitionOut !== void 0)
349
+ $$bindings.transitionOut(transitionOut);
350
+ if ($$props.transitionOutParams === void 0 && $$bindings.transitionOutParams && transitionOutParams !== void 0)
351
+ $$bindings.transitionOutParams(transitionOutParams);
352
+ {
353
+ if (open && autocollapse)
354
+ setActive();
355
+ }
356
+ openState = autocollapse ? $active === id : open;
357
+ classesBase = `${cBase$3} ${$$props.class ?? ""}`;
358
+ classesControl = `${cControl} ${padding} ${hover} ${rounded} ${regionControl}`;
359
+ classesCaretState = openState ? caretOpen : caretClosed;
360
+ classesControlCaret = `${cControlIcons} ${regionCaret} ${classesCaretState}`;
361
+ classesControlIcons = `${cControlIcons} ${regionCaret}`;
362
+ classesPanel = `${cPanel} ${padding} ${rounded} ${regionPanel}`;
363
+ $$unsubscribe_active();
364
+ return ` <div class="${"accordion-item " + escape(classesBase, true)}" data-testid="accordion-item"> <button type="button" class="${"accordion-control " + escape(classesControl, true)}"${add_attribute("id", id, 0)}${add_attribute("aria-expanded", openState, 0)} aria-controls="${"accordion-panel-" + escape(id, true)}" ${disabled ? "disabled" : ""}> ${$$slots.lead ? `<div class="accordion-lead">${slots.lead ? slots.lead({}) : ``}</div>` : ``} <div class="accordion-summary flex-1">${slots.summary ? slots.summary({}) : `(summary)`}</div> ${$$slots.iconClosed || $$slots.iconOpen ? ` <div class="${"accordion-summary-icons " + escape(classesControlIcons, true)}">${openState ? `${slots.iconClosed ? slots.iconClosed({}) : `<!-- HTML_TAG_START -->${svgCaretIcon}<!-- HTML_TAG_END -->`}` : `${slots.iconOpen ? slots.iconOpen({}) : `<!-- HTML_TAG_START -->${svgCaretIcon}<!-- HTML_TAG_END -->`}`}</div>` : ` <div class="${"accordion-summary-caret " + escape(classesControlCaret, true)}"><!-- HTML_TAG_START -->${svgCaretIcon}<!-- HTML_TAG_END --></div>`}</button> ${openState ? `<div class="${"accordion-panel " + escape(classesPanel, true)}" id="${"accordion-panel-" + escape(id, true)}" role="region"${add_attribute("aria-hidden", !openState, 0)}${add_attribute("aria-labelledby", id, 0)}>${slots.content ? slots.content({}) : `(content)`}</div>` : ``}</div>`;
365
+ });
366
+ const cBase$2 = "p-1";
367
+ const RadioGroup = create_ssr_component(($$result, $$props, $$bindings, slots) => {
368
+ let classesBase;
369
+ let { display = "inline-flex" } = $$props;
370
+ let { flexDirection = "flex-row" } = $$props;
371
+ let { gap = "gap-1" } = $$props;
372
+ let { background = "bg-surface-200-700-token" } = $$props;
373
+ let { border = "border-token border-surface-400-500-token" } = $$props;
374
+ let { rounded = "rounded-token" } = $$props;
375
+ let { padding = "px-4 py-1" } = $$props;
376
+ let { active = "variant-filled" } = $$props;
377
+ let { hover = "hover:variant-soft" } = $$props;
378
+ let { color = "" } = $$props;
379
+ let { fill = "" } = $$props;
380
+ let { regionLabel = "" } = $$props;
381
+ let { labelledby = "" } = $$props;
382
+ setContext("rounded", rounded);
383
+ setContext("padding", padding);
384
+ setContext("active", active);
385
+ setContext("hover", hover);
386
+ setContext("color", color);
387
+ setContext("fill", fill);
388
+ setContext("regionLabel", regionLabel);
389
+ if ($$props.display === void 0 && $$bindings.display && display !== void 0)
390
+ $$bindings.display(display);
391
+ if ($$props.flexDirection === void 0 && $$bindings.flexDirection && flexDirection !== void 0)
392
+ $$bindings.flexDirection(flexDirection);
393
+ if ($$props.gap === void 0 && $$bindings.gap && gap !== void 0)
394
+ $$bindings.gap(gap);
395
+ if ($$props.background === void 0 && $$bindings.background && background !== void 0)
396
+ $$bindings.background(background);
397
+ if ($$props.border === void 0 && $$bindings.border && border !== void 0)
398
+ $$bindings.border(border);
399
+ if ($$props.rounded === void 0 && $$bindings.rounded && rounded !== void 0)
400
+ $$bindings.rounded(rounded);
401
+ if ($$props.padding === void 0 && $$bindings.padding && padding !== void 0)
402
+ $$bindings.padding(padding);
403
+ if ($$props.active === void 0 && $$bindings.active && active !== void 0)
404
+ $$bindings.active(active);
405
+ if ($$props.hover === void 0 && $$bindings.hover && hover !== void 0)
406
+ $$bindings.hover(hover);
407
+ if ($$props.color === void 0 && $$bindings.color && color !== void 0)
408
+ $$bindings.color(color);
409
+ if ($$props.fill === void 0 && $$bindings.fill && fill !== void 0)
410
+ $$bindings.fill(fill);
411
+ if ($$props.regionLabel === void 0 && $$bindings.regionLabel && regionLabel !== void 0)
412
+ $$bindings.regionLabel(regionLabel);
413
+ if ($$props.labelledby === void 0 && $$bindings.labelledby && labelledby !== void 0)
414
+ $$bindings.labelledby(labelledby);
415
+ classesBase = `${cBase$2} ${display} ${flexDirection} ${gap} ${background} ${border} ${rounded} ${$$props.class ?? ""}`;
416
+ return `<div class="${"radio-group " + escape(classesBase, true)}" data-testid="radio-group" role="radiogroup"${add_attribute("aria-labelledby", labelledby, 0)}>${slots.default ? slots.default({}) : ``}</div>`;
417
+ });
418
+ const cBase$1 = "flex-auto";
419
+ const cWrapper$1 = "text-base text-center cursor-pointer";
420
+ const cDisabled = "opacity-50 cursor-not-allowed";
421
+ const RadioItem = create_ssr_component(($$result, $$props, $$bindings, slots) => {
422
+ let checked;
423
+ let classesActive;
424
+ let classesDisabled;
425
+ let classsBase;
426
+ let classesWrapper;
427
+ let $$restProps = compute_rest_props($$props, [
428
+ "group",
429
+ "name",
430
+ "value",
431
+ "title",
432
+ "label",
433
+ "rounded",
434
+ "padding",
435
+ "active",
436
+ "hover",
437
+ "color",
438
+ "fill",
439
+ "regionLabel"
440
+ ]);
441
+ let { group } = $$props;
442
+ let { name } = $$props;
443
+ let { value } = $$props;
444
+ let { title = "" } = $$props;
445
+ let { label = "" } = $$props;
446
+ let { rounded = getContext("rounded") } = $$props;
447
+ let { padding = getContext("padding") } = $$props;
448
+ let { active = getContext("active") } = $$props;
449
+ let { hover = getContext("hover") } = $$props;
450
+ let { color = getContext("color") } = $$props;
451
+ let { fill = getContext("fill") } = $$props;
452
+ let { regionLabel = getContext("regionLabel") } = $$props;
453
+ let elemInput;
454
+ function prunedRestProps() {
455
+ delete $$restProps.class;
456
+ return $$restProps;
457
+ }
458
+ if ($$props.group === void 0 && $$bindings.group && group !== void 0)
459
+ $$bindings.group(group);
460
+ if ($$props.name === void 0 && $$bindings.name && name !== void 0)
461
+ $$bindings.name(name);
462
+ if ($$props.value === void 0 && $$bindings.value && value !== void 0)
463
+ $$bindings.value(value);
464
+ if ($$props.title === void 0 && $$bindings.title && title !== void 0)
465
+ $$bindings.title(title);
466
+ if ($$props.label === void 0 && $$bindings.label && label !== void 0)
467
+ $$bindings.label(label);
468
+ if ($$props.rounded === void 0 && $$bindings.rounded && rounded !== void 0)
469
+ $$bindings.rounded(rounded);
470
+ if ($$props.padding === void 0 && $$bindings.padding && padding !== void 0)
471
+ $$bindings.padding(padding);
472
+ if ($$props.active === void 0 && $$bindings.active && active !== void 0)
473
+ $$bindings.active(active);
474
+ if ($$props.hover === void 0 && $$bindings.hover && hover !== void 0)
475
+ $$bindings.hover(hover);
476
+ if ($$props.color === void 0 && $$bindings.color && color !== void 0)
477
+ $$bindings.color(color);
478
+ if ($$props.fill === void 0 && $$bindings.fill && fill !== void 0)
479
+ $$bindings.fill(fill);
480
+ if ($$props.regionLabel === void 0 && $$bindings.regionLabel && regionLabel !== void 0)
481
+ $$bindings.regionLabel(regionLabel);
482
+ checked = value === group;
483
+ classesActive = checked ? `${active} ${color} ${fill}` : hover;
484
+ classesDisabled = $$props.disabled ? cDisabled : "";
485
+ classsBase = `${cBase$1}`;
486
+ classesWrapper = `${cWrapper$1} ${padding} ${rounded} ${classesActive} ${classesDisabled} ${$$props.class ?? ""}`;
487
+ return `<label class="${"radio-label " + escape(classsBase, true) + " " + escape(regionLabel, true)}"> <div class="${"radio-item " + escape(classesWrapper, true)}" data-testid="radio-item" role="radio"${add_attribute("aria-checked", checked, 0)}${add_attribute("aria-label", label, 0)} tabindex="0"${add_attribute("title", title, 0)}> <div class="h-0 w-0 overflow-hidden"><input${spread(
488
+ [
489
+ { type: "radio" },
490
+ { name: escape_attribute_value(name) },
491
+ { value: escape_attribute_value(value) },
492
+ escape_object(prunedRestProps()),
493
+ { tabindex: "-1" }
494
+ ],
495
+ {}
496
+ )}${add_attribute("this", elemInput, 0)}${value === group ? add_attribute("checked", true, 1) : ""}></div> ${slots.default ? slots.default({}) : ``}</div></label>`;
497
+ });
498
+ const cBase = "inline-block";
499
+ const cLabel = "unstyled flex items-center";
500
+ const cTrack = "flex transition-all duration-[200ms] cursor-pointer";
501
+ const cThumb = "w-[50%] h-full scale-[0.8] transition-all duration-[200ms] shadow";
502
+ const SlideToggle = create_ssr_component(($$result, $$props, $$bindings, slots) => {
503
+ let cTrackActive;
504
+ let cThumbBackground;
505
+ let cThumbPos;
506
+ let classesDisabled;
507
+ let classesBase;
508
+ let classesLabel;
509
+ let classesTrack;
510
+ let classesThumb;
511
+ let $$restProps = compute_rest_props($$props, ["name", "checked", "size", "background", "active", "border", "rounded", "label"]);
512
+ let $$slots = compute_slots(slots);
513
+ createEventDispatcher();
514
+ let { name } = $$props;
515
+ let { checked = false } = $$props;
516
+ let { size = "md" } = $$props;
517
+ let { background = "bg-surface-400 dark:bg-surface-700" } = $$props;
518
+ let { active = "bg-surface-900 dark:bg-surface-300" } = $$props;
519
+ let { border = "" } = $$props;
520
+ let { rounded = "rounded-full" } = $$props;
521
+ let { label = "" } = $$props;
522
+ let trackSize;
523
+ switch (size) {
524
+ case "sm":
525
+ trackSize = "w-12 h-6";
526
+ break;
527
+ case "lg":
528
+ trackSize = "w-20 h-10";
529
+ break;
530
+ default:
531
+ trackSize = "w-16 h-8";
532
+ }
533
+ function prunedRestProps() {
534
+ delete $$restProps.class;
535
+ return $$restProps;
536
+ }
537
+ if ($$props.name === void 0 && $$bindings.name && name !== void 0)
538
+ $$bindings.name(name);
539
+ if ($$props.checked === void 0 && $$bindings.checked && checked !== void 0)
540
+ $$bindings.checked(checked);
541
+ if ($$props.size === void 0 && $$bindings.size && size !== void 0)
542
+ $$bindings.size(size);
543
+ if ($$props.background === void 0 && $$bindings.background && background !== void 0)
544
+ $$bindings.background(background);
545
+ if ($$props.active === void 0 && $$bindings.active && active !== void 0)
546
+ $$bindings.active(active);
547
+ if ($$props.border === void 0 && $$bindings.border && border !== void 0)
548
+ $$bindings.border(border);
549
+ if ($$props.rounded === void 0 && $$bindings.rounded && rounded !== void 0)
550
+ $$bindings.rounded(rounded);
551
+ if ($$props.label === void 0 && $$bindings.label && label !== void 0)
552
+ $$bindings.label(label);
553
+ cTrackActive = checked ? active : `${background} cursor-pointer`;
554
+ cThumbBackground = checked ? "bg-white/75" : "bg-white";
555
+ cThumbPos = checked ? "translate-x-full" : "";
556
+ classesDisabled = $$props.disabled === true ? "opacity-50" : "hover:brightness-[105%] dark:hover:brightness-110 cursor-pointer";
557
+ classesBase = `${cBase} ${rounded} ${classesDisabled} ${$$props.class ?? ""}`;
558
+ classesLabel = `${cLabel}`;
559
+ classesTrack = `${cTrack} ${border} ${rounded} ${trackSize} ${cTrackActive}`;
560
+ classesThumb = `${cThumb} ${rounded} ${cThumbBackground} ${cThumbPos}`;
561
+ return `<div${add_attribute("id", label, 0)} class="${"slide-toggle " + escape(classesBase, true)}" data-testid="slide-toggle" role="switch"${add_attribute("aria-label", label, 0)}${add_attribute("aria-checked", checked, 0)} tabindex="0"><label class="${"slide-toggle-label " + escape(classesLabel, true)}"> <input${spread(
562
+ [
563
+ { type: "checkbox" },
564
+ { class: "slide-toggle-input hidden" },
565
+ { name: escape_attribute_value(name) },
566
+ escape_object(prunedRestProps()),
567
+ { disabled: $$props.disabled || null }
568
+ ],
569
+ {}
570
+ )}${add_attribute("checked", checked, 1)}> <div class="${[
571
+ "slide-toggle-track " + escape(classesTrack, true),
572
+ $$props.disabled ? "cursor-not-allowed" : ""
573
+ ].join(" ").trim()}"><div class="${[
574
+ "slide-toggle-thumb " + escape(classesThumb, true),
575
+ $$props.disabled ? "cursor-not-allowed" : ""
576
+ ].join(" ").trim()}"></div></div> ${$$slots.default ? `<div class="slide-toggle-text ml-3">${slots.default ? slots.default({}) : ``}</div>` : ``}</label></div>`;
577
+ });
578
+ const cWrapper = "flex fixed top-0 left-0 right-0 bottom-0 pointer-events-none";
579
+ const cSnackbar = "flex flex-col gap-y-2";
580
+ const cToast = "flex justify-between items-center pointer-events-auto";
581
+ const cToastActions = "flex items-center space-x-2";
582
+ const Toast = create_ssr_component(($$result, $$props, $$bindings, slots) => {
583
+ let classesWrapper;
584
+ let classesSnackbar;
585
+ let classesToast;
586
+ let filteredToasts;
587
+ let $toastStore, $$unsubscribe_toastStore;
588
+ let $prefersReducedMotionStore, $$unsubscribe_prefersReducedMotionStore;
589
+ $$unsubscribe_prefersReducedMotionStore = subscribe(prefersReducedMotionStore, (value) => $prefersReducedMotionStore = value);
590
+ const toastStore = getToastStore();
591
+ $$unsubscribe_toastStore = subscribe(toastStore, (value) => $toastStore = value);
592
+ let { position = "b" } = $$props;
593
+ let { max = 3 } = $$props;
594
+ let { background = "variant-filled-secondary" } = $$props;
595
+ let { width = "max-w-[640px]" } = $$props;
596
+ let { color = "" } = $$props;
597
+ let { padding = "p-4" } = $$props;
598
+ let { spacing = "space-x-4" } = $$props;
599
+ let { rounded = "rounded-container-token" } = $$props;
600
+ let { shadow = "shadow-lg" } = $$props;
601
+ let { zIndex = "z-[888]" } = $$props;
602
+ let { buttonAction = "btn variant-filled" } = $$props;
603
+ let { buttonDismiss = "btn-icon btn-icon-sm variant-filled" } = $$props;
604
+ let { buttonDismissLabel = "✕" } = $$props;
605
+ let { transitions = !$prefersReducedMotionStore } = $$props;
606
+ let { transitionIn = fly } = $$props;
607
+ let { transitionInParams = { duration: 250 } } = $$props;
608
+ let { transitionOut = fly } = $$props;
609
+ let { transitionOutParams = { duration: 250 } } = $$props;
610
+ let cPosition;
611
+ let cAlign;
612
+ switch (position) {
613
+ case "t":
614
+ cPosition = "justify-center items-start";
615
+ cAlign = "items-center";
616
+ break;
617
+ case "b":
618
+ cPosition = "justify-center items-end";
619
+ cAlign = "items-center";
620
+ break;
621
+ case "l":
622
+ cPosition = "justify-start items-center";
623
+ cAlign = "items-start";
624
+ break;
625
+ case "r":
626
+ cPosition = "justify-end items-center";
627
+ cAlign = "items-end";
628
+ break;
629
+ case "tl":
630
+ cPosition = "justify-start items-start";
631
+ cAlign = "items-start";
632
+ break;
633
+ case "tr":
634
+ cPosition = "justify-end items-start";
635
+ cAlign = "items-end";
636
+ break;
637
+ case "bl":
638
+ cPosition = "justify-start items-end";
639
+ cAlign = "items-start";
640
+ break;
641
+ case "br":
642
+ cPosition = "justify-end items-end";
643
+ cAlign = "items-end";
644
+ break;
645
+ }
646
+ if ($$props.position === void 0 && $$bindings.position && position !== void 0)
647
+ $$bindings.position(position);
648
+ if ($$props.max === void 0 && $$bindings.max && max !== void 0)
649
+ $$bindings.max(max);
650
+ if ($$props.background === void 0 && $$bindings.background && background !== void 0)
651
+ $$bindings.background(background);
652
+ if ($$props.width === void 0 && $$bindings.width && width !== void 0)
653
+ $$bindings.width(width);
654
+ if ($$props.color === void 0 && $$bindings.color && color !== void 0)
655
+ $$bindings.color(color);
656
+ if ($$props.padding === void 0 && $$bindings.padding && padding !== void 0)
657
+ $$bindings.padding(padding);
658
+ if ($$props.spacing === void 0 && $$bindings.spacing && spacing !== void 0)
659
+ $$bindings.spacing(spacing);
660
+ if ($$props.rounded === void 0 && $$bindings.rounded && rounded !== void 0)
661
+ $$bindings.rounded(rounded);
662
+ if ($$props.shadow === void 0 && $$bindings.shadow && shadow !== void 0)
663
+ $$bindings.shadow(shadow);
664
+ if ($$props.zIndex === void 0 && $$bindings.zIndex && zIndex !== void 0)
665
+ $$bindings.zIndex(zIndex);
666
+ if ($$props.buttonAction === void 0 && $$bindings.buttonAction && buttonAction !== void 0)
667
+ $$bindings.buttonAction(buttonAction);
668
+ if ($$props.buttonDismiss === void 0 && $$bindings.buttonDismiss && buttonDismiss !== void 0)
669
+ $$bindings.buttonDismiss(buttonDismiss);
670
+ if ($$props.buttonDismissLabel === void 0 && $$bindings.buttonDismissLabel && buttonDismissLabel !== void 0)
671
+ $$bindings.buttonDismissLabel(buttonDismissLabel);
672
+ if ($$props.transitions === void 0 && $$bindings.transitions && transitions !== void 0)
673
+ $$bindings.transitions(transitions);
674
+ if ($$props.transitionIn === void 0 && $$bindings.transitionIn && transitionIn !== void 0)
675
+ $$bindings.transitionIn(transitionIn);
676
+ if ($$props.transitionInParams === void 0 && $$bindings.transitionInParams && transitionInParams !== void 0)
677
+ $$bindings.transitionInParams(transitionInParams);
678
+ if ($$props.transitionOut === void 0 && $$bindings.transitionOut && transitionOut !== void 0)
679
+ $$bindings.transitionOut(transitionOut);
680
+ if ($$props.transitionOutParams === void 0 && $$bindings.transitionOutParams && transitionOutParams !== void 0)
681
+ $$bindings.transitionOutParams(transitionOutParams);
682
+ classesWrapper = `${cWrapper} ${cPosition} ${zIndex} ${$$props.class || ""}`;
683
+ classesSnackbar = `${cSnackbar} ${cAlign} ${padding}`;
684
+ classesToast = `${cToast} ${width} ${color} ${padding} ${spacing} ${rounded} ${shadow}`;
685
+ filteredToasts = Array.from($toastStore).slice(0, max);
686
+ $$unsubscribe_toastStore();
687
+ $$unsubscribe_prefersReducedMotionStore();
688
+ return `${$toastStore.length ? ` <div class="${"snackbar-wrapper " + escape(classesWrapper, true)}" data-testid="snackbar-wrapper"> <div class="${"snackbar " + escape(classesSnackbar, true)}">${each(filteredToasts, (t, i) => {
689
+ return `<div${add_attribute("role", t.hideDismiss ? "alert" : "alertdialog", 0)} aria-live="polite"> <div class="${"toast " + escape(classesToast, true) + " " + escape(t.background ?? background, true) + " " + escape(t.classes ?? "", true)}" data-testid="toast"><div class="text-base"><!-- HTML_TAG_START -->${t.message}<!-- HTML_TAG_END --></div> ${t.action || !t.hideDismiss ? `<div class="${"toast-actions " + escape(cToastActions, true)}">${t.action ? `<button${add_attribute("class", buttonAction, 0)}><!-- HTML_TAG_START -->${t.action.label}<!-- HTML_TAG_END --></button>` : ``} ${!t.hideDismiss ? `<button${add_attribute("class", buttonDismiss, 0)} aria-label="Dismiss toast">${escape(buttonDismissLabel)}</button>` : ``} </div>` : ``}</div> </div>`;
690
+ })}</div></div>` : ``}`;
691
+ });
692
+ const gatheringKey = {};
693
+ const GatheringRound = create_ssr_component(($$result, $$props, $$bindings, slots) => {
694
+ setContext(gatheringKey, true);
695
+ return `${slots.default ? slots.default({}) : ``}`;
696
+ });
697
+ const getDimensionName = (horizontal) => horizontal ? "height" : "width";
698
+ const css$8 = {
699
+ code: 'div.splitpanes--horizontal.splitpanes--dragging{cursor:row-resize}div.splitpanes--vertical.splitpanes--dragging{cursor:col-resize}.splitpanes{display:flex;width:100%;height:100%}.splitpanes--vertical{flex-direction:row}.splitpanes--horizontal{flex-direction:column}.splitpanes--dragging *{-webkit-user-select:none;-moz-user-select:none;user-select:none}.splitpanes__pane{width:100%;height:100%;overflow:hidden}.splitpanes--vertical .splitpanes__pane{transition:width 0.2s ease-out}.splitpanes--horizontal .splitpanes__pane{transition:height 0.2s ease-out}.splitpanes--vertical>.splitpanes__pane{transition:width 0.2s ease-out}.splitpanes--horizontal>.splitpanes__pane{transition:height 0.2s ease-out}.splitpanes--dragging .splitpanes__pane{transition:none;pointer-events:none}.splitpanes--freeze .splitpanes__pane{transition:none}.splitpanes__splitter{touch-action:none}.splitpanes--vertical>.splitpanes__splitter{min-width:1px}.splitpanes--horizontal>.splitpanes__splitter{min-height:1px}.splitpanes.default-theme .splitpanes__pane{background-color:#f2f2f2}.splitpanes.default-theme .splitpanes__splitter{background-color:#fff;box-sizing:border-box;position:relative;flex-shrink:0}.splitpanes.default-theme .splitpanes__splitter:before,.splitpanes.default-theme .splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:rgba(0, 0, 0, 0.15);transition:background-color 0.3s}.splitpanes.default-theme .splitpanes__splitter:hover:before,.splitpanes.default-theme .splitpanes__splitter:hover:after{background-color:rgba(0, 0, 0, 0.25)}.splitpanes.default-theme .splitpanes__splitter:first-child{cursor:auto}.default-theme.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;cursor:col-resize}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{transform:translateY(-50%);width:1px;height:30px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;cursor:row-resize}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{transform:translateX(-50%);width:30px;height:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px}',
700
+ map: null
701
+ };
702
+ const KEY = {};
703
+ const Splitpanes = create_ssr_component(($$result, $$props, $$bindings, slots) => {
704
+ let $veryFirstPaneKey, $$unsubscribe_veryFirstPaneKey;
705
+ let $showFirstSplitter, $$unsubscribe_showFirstSplitter;
706
+ let $isHorizontal, $$unsubscribe_isHorizontal;
707
+ let { id = void 0 } = $$props;
708
+ let { horizontal = false } = $$props;
709
+ let { pushOtherPanes = true } = $$props;
710
+ let { dblClickSplitter = true } = $$props;
711
+ let { rtl = "auto" } = $$props;
712
+ let { firstSplitter = false } = $$props;
713
+ let { style = null } = $$props;
714
+ let { theme = "default-theme" } = $$props;
715
+ let { class: clazz = "" } = $$props;
716
+ createEventDispatcher();
717
+ let container;
718
+ new Array();
719
+ let isHorizontal = writable(horizontal);
720
+ $$unsubscribe_isHorizontal = subscribe(isHorizontal, (value) => $isHorizontal = value);
721
+ const showFirstSplitter = writable(firstSplitter);
722
+ $$unsubscribe_showFirstSplitter = subscribe(showFirstSplitter, (value) => $showFirstSplitter = value);
723
+ const veryFirstPaneKey = writable(void 0);
724
+ $$unsubscribe_veryFirstPaneKey = subscribe(veryFirstPaneKey, (value) => $veryFirstPaneKey = value);
725
+ let ssrPaneDefinedSizeSum = 0;
726
+ let ssrPaneUndefinedSizeCount = 0;
727
+ function ssrRegisterPaneSize(size) {
728
+ if (size == null) {
729
+ ++ssrPaneUndefinedSizeCount;
730
+ } else {
731
+ ssrPaneDefinedSizeSum += size;
732
+ }
733
+ }
734
+ const onPaneInit = (key) => {
735
+ if ($veryFirstPaneKey === void 0) {
736
+ set_store_value(veryFirstPaneKey, $veryFirstPaneKey = key, $veryFirstPaneKey);
737
+ }
738
+ return {
739
+ undefinedPaneInitSize: (100 - ssrPaneDefinedSizeSum) / ssrPaneUndefinedSizeCount
740
+ };
741
+ };
742
+ setContext(KEY, {
743
+ showFirstSplitter,
744
+ veryFirstPaneKey,
745
+ isHorizontal,
746
+ ssrRegisterPaneSize: ssrRegisterPaneSize,
747
+ onPaneInit,
748
+ clientOnly: void 0
749
+ });
750
+ if ($$props.id === void 0 && $$bindings.id && id !== void 0)
751
+ $$bindings.id(id);
752
+ if ($$props.horizontal === void 0 && $$bindings.horizontal && horizontal !== void 0)
753
+ $$bindings.horizontal(horizontal);
754
+ if ($$props.pushOtherPanes === void 0 && $$bindings.pushOtherPanes && pushOtherPanes !== void 0)
755
+ $$bindings.pushOtherPanes(pushOtherPanes);
756
+ if ($$props.dblClickSplitter === void 0 && $$bindings.dblClickSplitter && dblClickSplitter !== void 0)
757
+ $$bindings.dblClickSplitter(dblClickSplitter);
758
+ if ($$props.rtl === void 0 && $$bindings.rtl && rtl !== void 0)
759
+ $$bindings.rtl(rtl);
760
+ if ($$props.firstSplitter === void 0 && $$bindings.firstSplitter && firstSplitter !== void 0)
761
+ $$bindings.firstSplitter(firstSplitter);
762
+ if ($$props.style === void 0 && $$bindings.style && style !== void 0)
763
+ $$bindings.style(style);
764
+ if ($$props.theme === void 0 && $$bindings.theme && theme !== void 0)
765
+ $$bindings.theme(theme);
766
+ if ($$props.class === void 0 && $$bindings.class && clazz !== void 0)
767
+ $$bindings.class(clazz);
768
+ $$result.css.add(css$8);
769
+ set_store_value(isHorizontal, $isHorizontal = horizontal, $isHorizontal);
770
+ set_store_value(showFirstSplitter, $showFirstSplitter = firstSplitter, $showFirstSplitter);
771
+ $$unsubscribe_veryFirstPaneKey();
772
+ $$unsubscribe_showFirstSplitter();
773
+ $$unsubscribe_isHorizontal();
774
+ return `<div${add_attribute("id", id, 0)} class="${[
775
+ escape(`splitpanes ${theme || ""} ${clazz || ""}`, true),
776
+ (horizontal ? "splitpanes--horizontal" : "") + " " + (!horizontal ? "splitpanes--vertical" : "") + " " + ("") + " splitpanes--freeze"
777
+ ].join(" ").trim()}"${add_attribute("style", style, 0)}${add_attribute("this", container, 0)}>${`${validate_component(GatheringRound, "GatheringRound").$$render($$result, {}, {}, {
778
+ default: () => {
779
+ return `${slots.default ? slots.default({}) : ``}`;
780
+ }
781
+ })}` } ${slots.default ? slots.default({}) : ``} </div>`;
782
+ });
783
+ const Pane = create_ssr_component(($$result, $$props, $$bindings, slots) => {
784
+ let dimension;
785
+ let style;
786
+ let $isHorizontal, $$unsubscribe_isHorizontal;
787
+ let $veryFirstPaneKey, $$unsubscribe_veryFirstPaneKey;
788
+ let $showFirstSplitter, $$unsubscribe_showFirstSplitter;
789
+ const { ssrRegisterPaneSize, onPaneInit, clientOnly: clientOnlyContext, isHorizontal, showFirstSplitter, veryFirstPaneKey } = getContext(KEY);
790
+ $$unsubscribe_isHorizontal = subscribe(isHorizontal, (value) => $isHorizontal = value);
791
+ $$unsubscribe_showFirstSplitter = subscribe(showFirstSplitter, (value) => $showFirstSplitter = value);
792
+ $$unsubscribe_veryFirstPaneKey = subscribe(veryFirstPaneKey, (value) => $veryFirstPaneKey = value);
793
+ let { size = null } = $$props;
794
+ let { minSize = 0 } = $$props;
795
+ let { maxSize = 100 } = $$props;
796
+ let { snapSize = 0 } = $$props;
797
+ let { class: clazz = "" } = $$props;
798
+ const key = {};
799
+ const gathering = hasContext(gatheringKey);
800
+ const { undefinedPaneInitSize } = !gathering ? onPaneInit(key) : {};
801
+ let element;
802
+ let sz = size ?? undefinedPaneInitSize;
803
+ if (gathering) {
804
+ ssrRegisterPaneSize(size);
805
+ }
806
+ if ($$props.size === void 0 && $$bindings.size && size !== void 0)
807
+ $$bindings.size(size);
808
+ if ($$props.minSize === void 0 && $$bindings.minSize && minSize !== void 0)
809
+ $$bindings.minSize(minSize);
810
+ if ($$props.maxSize === void 0 && $$bindings.maxSize && maxSize !== void 0)
811
+ $$bindings.maxSize(maxSize);
812
+ if ($$props.snapSize === void 0 && $$bindings.snapSize && snapSize !== void 0)
813
+ $$bindings.snapSize(snapSize);
814
+ if ($$props.class === void 0 && $$bindings.class && clazz !== void 0)
815
+ $$bindings.class(clazz);
816
+ dimension = getDimensionName($isHorizontal);
817
+ style = `${dimension}: ${sz}%;`;
818
+ $$unsubscribe_isHorizontal();
819
+ $$unsubscribe_veryFirstPaneKey();
820
+ $$unsubscribe_showFirstSplitter();
821
+ return `${!gathering ? ` ${$veryFirstPaneKey !== key || $showFirstSplitter ? ` <div class="${"splitpanes__splitter " + escape("", true)}"></div>` : ``} <div${add_attribute("class", `splitpanes__pane ${clazz || ""}`, 0)}${add_attribute("style", style, 0)}${add_attribute("this", element, 0)}>${slots.default ? slots.default({}) : ``}</div>` : ``}`;
822
+ });
823
+ const LoadingSpinner = create_ssr_component(($$result, $$props, $$bindings, slots) => {
824
+ let { size = 20 } = $$props;
825
+ if ($$props.size === void 0 && $$bindings.size && size !== void 0)
826
+ $$bindings.size(size);
827
+ return `<svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"><circle fill="#1976d2" stroke="none" cx="6" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1"></animate></circle><circle fill="#1976d2" stroke="none" cx="26" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.2"></animate></circle><circle fill="#1976d2" stroke="none" cx="46" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3"></animate></circle></svg>`;
828
+ });
829
+ const css$7 = {
830
+ code: ".llm-health-status.svelte-a20mi8{color:slategray;font-size:12px;display:inline-flex;align-items:center;min-width:200px\r\n }.dot.svelte-a20mi8{width:20px;height:20px}",
831
+ map: null
832
+ };
833
+ const LlmHealthStatus = create_ssr_component(($$result, $$props, $$bindings, slots) => {
834
+ let { status = "unknown" } = $$props;
835
+ let color = "";
836
+ let shadowColor = "";
837
+ let text = "";
838
+ switch (status) {
839
+ case "ok":
840
+ color = "#4CAF50";
841
+ shadowColor = "rgba(0, 128, 0, 0.7)";
842
+ text = "Сервис LLM работает";
843
+ break;
844
+ case "error":
845
+ text = "Сервис LLM не работает";
846
+ break;
847
+ case "loading model":
848
+ color = "yellow";
849
+ shadowColor = "rgba(255, 255, 0, 0.7)";
850
+ text = "Сервис LLM запускается...";
851
+ break;
852
+ case "unavailable":
853
+ color = "#af4f4c";
854
+ shadowColor = "#af4f4c";
855
+ text = "Серв��с LLM не запущен";
856
+ break;
857
+ case "unknown":
858
+ color = "#af4f4c";
859
+ shadowColor = "#af4f4c";
860
+ text = "Сервис LLM недоступен";
861
+ break;
862
+ }
863
+ if ($$props.status === void 0 && $$bindings.status && status !== void 0)
864
+ $$bindings.status(status);
865
+ $$result.css.add(css$7);
866
+ return `<div class="llm-health-status svelte-a20mi8"><svg class="dot svelte-a20mi8" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="5"${add_attribute("fill", color, 0)} style="${"filter: drop-shadow(0 0 1px " + escape(shadowColor, true) + ")"}"></circle></svg> ${escape(text)} </div>`;
867
+ });
868
+ const css$6 = {
869
+ code: ".llm-health-status.svelte-1wcf73j{color:slategray;font-size:12px;display:inline-flex;align-items:center}.dot.svelte-1wcf73j{width:20px;height:20px}",
870
+ map: null
871
+ };
872
+ const SearchApiHealthStatus = create_ssr_component(($$result, $$props, $$bindings, slots) => {
873
+ let { status = "unavailable" } = $$props;
874
+ let color = "";
875
+ let shadowColor = "";
876
+ let text = "";
877
+ switch (status) {
878
+ case "ok":
879
+ color = "#4CAF50";
880
+ shadowColor = "rgba(0, 128, 0, 0.7)";
881
+ text = "Поиск работает";
882
+ break;
883
+ case "unavailable":
884
+ color = "#af4f4c";
885
+ shadowColor = "#af4f4c";
886
+ text = "Поиск не запущен";
887
+ break;
888
+ case "unknown":
889
+ color = "#af4f4c";
890
+ shadowColor = "#af4f4c";
891
+ text = "Поиск недоступен";
892
+ break;
893
+ }
894
+ if ($$props.status === void 0 && $$bindings.status && status !== void 0)
895
+ $$bindings.status(status);
896
+ $$result.css.add(css$6);
897
+ return `<div class="llm-health-status svelte-1wcf73j"><svg class="dot svelte-1wcf73j" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="5"${add_attribute("fill", color, 0)} style="${"filter: drop-shadow(0 0 1px " + escape(shadowColor, true) + ")"}"></circle></svg> ${escape(text)} </div>`;
898
+ });
899
+ class SearchResultsSorter {
900
+ static findDateInText(text) {
901
+ const dateStringRegex = /\b\d{1,2}\.\d{1,2}\.\d{4}\b/g;
902
+ const matches = text.match(dateStringRegex);
903
+ if (matches && matches.length > 0) {
904
+ const dateString = matches[0];
905
+ const [day, month, year] = dateString.split(".").map(Number);
906
+ return new Date(year, month - 1, day);
907
+ }
908
+ return null;
909
+ }
910
+ static sortByRelevanceAndDate(data) {
911
+ return data.sort((a, b) => {
912
+ const relevanceComparison = b.relevance - a.relevance;
913
+ if (relevanceComparison !== 0) {
914
+ return relevanceComparison;
915
+ }
916
+ const dateA = SearchResultsSorter.findDateInText(a.title);
917
+ const dateB = SearchResultsSorter.findDateInText(b.title);
918
+ if (dateA && dateB) {
919
+ return dateB.getTime() - dateA.getTime();
920
+ } else if (dateA) {
921
+ return -1;
922
+ } else if (dateB) {
923
+ return 1;
924
+ } else {
925
+ return 0;
926
+ }
927
+ });
928
+ }
929
+ static sortByDate(dataArray) {
930
+ const entriesWithDates = dataArray.filter((item) => SearchResultsSorter.findDateInText(item.title));
931
+ const entriesWithoutDates = dataArray.filter((item) => !SearchResultsSorter.findDateInText(item.title));
932
+ const sortedEntriesWithDates = entriesWithDates.sort((a, b) => {
933
+ const dateA = SearchResultsSorter.findDateInText(a.title);
934
+ const dateB = SearchResultsSorter.findDateInText(b.title);
935
+ if (dateA && dateB) {
936
+ return dateB.getTime() - dateA.getTime();
937
+ } else if (dateA) {
938
+ return -1;
939
+ } else if (dateB) {
940
+ return 1;
941
+ } else {
942
+ return 0;
943
+ }
944
+ });
945
+ const resultArray = [];
946
+ let indexWithoutDates = 0;
947
+ for (const entry of dataArray) {
948
+ if (SearchResultsSorter.findDateInText(entry.title)) {
949
+ let val = sortedEntriesWithDates.shift();
950
+ if (val)
951
+ resultArray.push(val);
952
+ } else {
953
+ resultArray.push(entriesWithoutDates[indexWithoutDates]);
954
+ indexWithoutDates++;
955
+ }
956
+ }
957
+ return resultArray;
958
+ }
959
+ static sortByRelevance(data) {
960
+ return data.sort((a, b) => {
961
+ if (a.relevance && b.relevance) {
962
+ return b.relevance - a.relevance;
963
+ } else if (a.relevance) {
964
+ return -1;
965
+ } else if (b.relevance) {
966
+ return 1;
967
+ } else {
968
+ return 0;
969
+ }
970
+ });
971
+ }
972
+ static identifyDocumentType(data) {
973
+ const regexps = [
974
+ { regexp: /(ФАС |АС |КС |ВС |[Сс]удебн|[Сс]уд)|(\(Судебный документ\))/, docType: "Решение суда" },
975
+ { regexp: /[Пп]исьмо [Мм]инфина/, docType: "Письмо Минфина" },
976
+ { regexp: /[Пп]исьмо (ФНС|фнс)/, docType: "Письмо ФНС" },
977
+ { regexp: /(НКРФ)|(НК РФ)/, docType: "Налоговый кодекс" },
978
+ { regexp: /(ГКРФ)|(ГК РФ)/, docType: "Гражданский кодекс" },
979
+ { regexp: /(ТКРФ)|(ТК РФ)/, docType: "Трудовой кодекс" },
980
+ { regexp: /Приказ ФНС РФ/, docType: "Приказ ФНС РФ" },
981
+ { regexp: /Постановление Правительства РФ/, docType: "Постановление Правительства РФ" },
982
+ { regexp: /Решение Коллегии Евразийской экономической комиссии/, docType: "Решение Коллегии ЕЭК" },
983
+ { regexp: /Федеральный закон/, docType: "Федеральные законы" },
984
+ { regexp: /\(Внутренний документ\)/, docType: "Внутренние документы" }
985
+ ];
986
+ return data.map((result) => {
987
+ for (const { regexp, docType } of regexps) {
988
+ if (regexp.test(result.title)) {
989
+ result.docType = docType;
990
+ return result;
991
+ }
992
+ }
993
+ result.docType = "Другие документы";
994
+ return result;
995
+ });
996
+ }
997
+ static mergeResultsByTitle(data) {
998
+ const regex = /(ст\.\d+)\s(НКРФ|НК РФ|ГКРФ|ГК РФ|ТКРФ|ТК РФ)$/;
999
+ const grouped = {};
1000
+ const mergedResults = [];
1001
+ const extractArticleAndCode = (title) => {
1002
+ const match = title.match(regex);
1003
+ return match ? match[0] : null;
1004
+ };
1005
+ data.forEach((item) => {
1006
+ const key = extractArticleAndCode(item.title);
1007
+ if (key) {
1008
+ if (grouped[key]) {
1009
+ grouped[key].relevance = Math.max(
1010
+ grouped[key].relevance,
1011
+ item.relevance
1012
+ );
1013
+ const existingTitle = grouped[key].title.match(/п[\w\.]+/g) || [];
1014
+ const newTitle = item.title.match(/п[\w\.]+/g) || [];
1015
+ const combinedTitle = [.../* @__PURE__ */ new Set([...existingTitle, ...newTitle])].join(", ");
1016
+ grouped[key].title = `${combinedTitle} ст.${key.split(" ")[0].split(".")[1]} ${key.split(" ")[1]}`;
1017
+ grouped[key].text += `
1018
+ ${item.title}
1019
+ ${item.text}`;
1020
+ } else {
1021
+ grouped[key] = { ...item };
1022
+ }
1023
+ } else {
1024
+ mergedResults.push(item);
1025
+ }
1026
+ });
1027
+ Object.keys(grouped).forEach((key) => {
1028
+ mergedResults.push(grouped[key]);
1029
+ });
1030
+ return mergedResults;
1031
+ }
1032
+ }
1033
+ const css$5 = {
1034
+ code: ".search-result.svelte-1srbk6k{margin-bottom:20px}.title.svelte-1srbk6k{font-weight:bold}.annotation.svelte-1srbk6k{overflow:hidden;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;text-overflow:ellipsis;white-space:normal}a.svelte-1srbk6k{cursor:pointer}.full-text.svelte-1srbk6k{display:block;white-space:normal}.title.svelte-1srbk6k{color:#1a0dab}",
1035
+ map: null
1036
+ };
1037
+ const SearchResultsItem = create_ssr_component(($$result, $$props, $$bindings, slots) => {
1038
+ let { showFullText = Array(10).fill(false) } = $$props;
1039
+ let { useSearchResult } = $$props;
1040
+ let { index } = $$props;
1041
+ let { title } = $$props;
1042
+ let { teaser } = $$props;
1043
+ let { text } = $$props;
1044
+ let { enableDocumentDb = false } = $$props;
1045
+ let { documentDbUrl = "" } = $$props;
1046
+ let { enableSearchResultSelection = false } = $$props;
1047
+ if ($$props.showFullText === void 0 && $$bindings.showFullText && showFullText !== void 0)
1048
+ $$bindings.showFullText(showFullText);
1049
+ if ($$props.useSearchResult === void 0 && $$bindings.useSearchResult && useSearchResult !== void 0)
1050
+ $$bindings.useSearchResult(useSearchResult);
1051
+ if ($$props.index === void 0 && $$bindings.index && index !== void 0)
1052
+ $$bindings.index(index);
1053
+ if ($$props.title === void 0 && $$bindings.title && title !== void 0)
1054
+ $$bindings.title(title);
1055
+ if ($$props.teaser === void 0 && $$bindings.teaser && teaser !== void 0)
1056
+ $$bindings.teaser(teaser);
1057
+ if ($$props.text === void 0 && $$bindings.text && text !== void 0)
1058
+ $$bindings.text(text);
1059
+ if ($$props.enableDocumentDb === void 0 && $$bindings.enableDocumentDb && enableDocumentDb !== void 0)
1060
+ $$bindings.enableDocumentDb(enableDocumentDb);
1061
+ if ($$props.documentDbUrl === void 0 && $$bindings.documentDbUrl && documentDbUrl !== void 0)
1062
+ $$bindings.documentDbUrl(documentDbUrl);
1063
+ if ($$props.enableSearchResultSelection === void 0 && $$bindings.enableSearchResultSelection && enableSearchResultSelection !== void 0)
1064
+ $$bindings.enableSearchResultSelection(enableSearchResultSelection);
1065
+ $$result.css.add(css$5);
1066
+ return `<div class="search-result svelte-1srbk6k"><div class="title svelte-1srbk6k"><label style="cursor:pointer">${enableSearchResultSelection ? `<input type="checkbox"${add_attribute("checked", useSearchResult[title], 1)}>` : ``} ${escape(title)}</label></div> ${showFullText[index] ? `<div class="annotation full-text svelte-1srbk6k">${each(text.split("\n"), (line) => {
1067
+ return `<p>${escape(line)}</p>`;
1068
+ })}</div>` : `<div class="annotation svelte-1srbk6k">${escape(teaser)}</div>`} ${enableDocumentDb && documentDbUrl ? `<a href="${escape(documentDbUrl, true) + "s/" + escape(encodeURIComponent(title), true)}" target="_blank" style="font-weight: 500" class="svelte-1srbk6k">Открыть документ</a>` : ``} ${text.length > 100 ? `${showFullText[index] ? `<a class="svelte-1srbk6k" data-svelte-h="svelte-18vtpy5">свернуть</a>` : `<a class="svelte-1srbk6k" data-svelte-h="svelte-lqw9hz">развернуть</a>`}` : ``} </div>`;
1069
+ });
1070
+ const css$4 = {
1071
+ code: ".search-results.svelte-1ptibtq.svelte-1ptibtq{flex:1;overflow-y:auto;padding:1rem}.settings-bar.svelte-1ptibtq.svelte-1ptibtq{margin-bottom:10px}.settings-bar.svelte-1ptibtq label.svelte-1ptibtq{margin-right:10px}",
1072
+ map: null
1073
+ };
1074
+ const SearchResults = create_ssr_component(($$result, $$props, $$bindings, slots) => {
1075
+ let { enableDocumentDb = false } = $$props;
1076
+ let { documentDbUrl = "" } = $$props;
1077
+ let { showFullText = Array(10).fill(false) } = $$props;
1078
+ let { useSearchResult } = $$props;
1079
+ let groupByChecked = false;
1080
+ let sortSearchResultsBy = "rel";
1081
+ let { searchResults = [] } = $$props;
1082
+ let groupedSearchResults;
1083
+ let { enableSearchResultSelection = false } = $$props;
1084
+ const groupByType = (searchResults2) => {
1085
+ return searchResults2.reduce(
1086
+ (result, item) => {
1087
+ const docType = item.docType || "Другие документы";
1088
+ if (!result[docType]) {
1089
+ result[docType] = [];
1090
+ }
1091
+ result[docType].push(item);
1092
+ return result;
1093
+ },
1094
+ {}
1095
+ );
1096
+ };
1097
+ if ($$props.enableDocumentDb === void 0 && $$bindings.enableDocumentDb && enableDocumentDb !== void 0)
1098
+ $$bindings.enableDocumentDb(enableDocumentDb);
1099
+ if ($$props.documentDbUrl === void 0 && $$bindings.documentDbUrl && documentDbUrl !== void 0)
1100
+ $$bindings.documentDbUrl(documentDbUrl);
1101
+ if ($$props.showFullText === void 0 && $$bindings.showFullText && showFullText !== void 0)
1102
+ $$bindings.showFullText(showFullText);
1103
+ if ($$props.useSearchResult === void 0 && $$bindings.useSearchResult && useSearchResult !== void 0)
1104
+ $$bindings.useSearchResult(useSearchResult);
1105
+ if ($$props.searchResults === void 0 && $$bindings.searchResults && searchResults !== void 0)
1106
+ $$bindings.searchResults(searchResults);
1107
+ if ($$props.enableSearchResultSelection === void 0 && $$bindings.enableSearchResultSelection && enableSearchResultSelection !== void 0)
1108
+ $$bindings.enableSearchResultSelection(enableSearchResultSelection);
1109
+ $$result.css.add(css$4);
1110
+ let $$settled;
1111
+ let $$rendered;
1112
+ let previous_head = $$result.head;
1113
+ do {
1114
+ $$settled = true;
1115
+ $$result.head = previous_head;
1116
+ {
1117
+ {
1118
+ if (groupByChecked) {
1119
+ groupedSearchResults = groupByType(searchResults);
1120
+ }
1121
+ if (sortSearchResultsBy == "date") {
1122
+ searchResults = SearchResultsSorter.sortByDate(searchResults);
1123
+ } else if (sortSearchResultsBy == "rel") {
1124
+ searchResults = SearchResultsSorter.sortByRelevance(searchResults);
1125
+ }
1126
+ }
1127
+ }
1128
+ {
1129
+ if (useSearchResult === void 0) {
1130
+ useSearchResult = {};
1131
+ }
1132
+ }
1133
+ $$rendered = `<div class="search-results svelte-1ptibtq">${searchResults && searchResults.length > 0 ? `<div class="settings-bar svelte-1ptibtq"><div class="card w-full flex p-2 space-y-2" style="align-items: center; flex-wrap: wrap;"><label style="display: inline-block;flex-wrap: wrap;" class="svelte-1ptibtq" data-svelte-h="svelte-12wnwfn">Сортировать по:</label> ${validate_component(RadioGroup, "RadioGroup").$$render($$result, { background: "", border: "" }, {}, {
1134
+ default: () => {
1135
+ return `${validate_component(RadioItem, "RadioItem").$$render(
1136
+ $$result,
1137
+ {
1138
+ name: "sortBy",
1139
+ value: "rel",
1140
+ group: sortSearchResultsBy
1141
+ },
1142
+ {
1143
+ group: ($$value) => {
1144
+ sortSearchResultsBy = $$value;
1145
+ $$settled = false;
1146
+ }
1147
+ },
1148
+ {
1149
+ default: () => {
1150
+ return `релевантности`;
1151
+ }
1152
+ }
1153
+ )} ${validate_component(RadioItem, "RadioItem").$$render(
1154
+ $$result,
1155
+ {
1156
+ name: "sortBy",
1157
+ value: "date",
1158
+ group: sortSearchResultsBy
1159
+ },
1160
+ {
1161
+ group: ($$value) => {
1162
+ sortSearchResultsBy = $$value;
1163
+ $$settled = false;
1164
+ }
1165
+ },
1166
+ {
1167
+ default: () => {
1168
+ return `дате`;
1169
+ }
1170
+ }
1171
+ )}`;
1172
+ }
1173
+ })} ${validate_component(SlideToggle, "SlideToggle").$$render(
1174
+ $$result,
1175
+ {
1176
+ name: "groupByChecked",
1177
+ size: "sm",
1178
+ label: "Группировать по типу",
1179
+ checked: groupByChecked
1180
+ },
1181
+ {
1182
+ checked: ($$value) => {
1183
+ groupByChecked = $$value;
1184
+ $$settled = false;
1185
+ }
1186
+ },
1187
+ {
1188
+ default: () => {
1189
+ return `Группировать по типу`;
1190
+ }
1191
+ }
1192
+ )}</div></div>` : ``} ${groupByChecked && groupedSearchResults ? `${validate_component(Accordion, "Accordion").$$render($$result, {}, {}, {
1193
+ default: () => {
1194
+ return `${each(Object.entries(groupedSearchResults), ([docType, results]) => {
1195
+ return `${validate_component(AccordionItem, "AccordionItem").$$render($$result, {}, {}, {
1196
+ content: () => {
1197
+ return `${each(results, ({ title, text, teaser }, index) => {
1198
+ return `${validate_component(SearchResultsItem, "SearchResultsItem").$$render(
1199
+ $$result,
1200
+ {
1201
+ title,
1202
+ text,
1203
+ teaser,
1204
+ index,
1205
+ enableSearchResultSelection,
1206
+ useSearchResult,
1207
+ showFullText
1208
+ },
1209
+ {},
1210
+ {}
1211
+ )}`;
1212
+ })} `;
1213
+ },
1214
+ summary: () => {
1215
+ return `${escape(docType)}`;
1216
+ },
1217
+ lead: () => {
1218
+ return `${enableSearchResultSelection ? `<input type="checkbox"${add_attribute("data-doctype", docType, 0)}>` : ``} `;
1219
+ }
1220
+ })}`;
1221
+ })}`;
1222
+ }
1223
+ })}` : `${each(searchResults, ({ title, text, teaser }, index) => {
1224
+ return `${validate_component(SearchResultsItem, "SearchResultsItem").$$render(
1225
+ $$result,
1226
+ {
1227
+ title,
1228
+ text,
1229
+ teaser,
1230
+ index,
1231
+ enableSearchResultSelection,
1232
+ useSearchResult,
1233
+ showFullText,
1234
+ enableDocumentDb,
1235
+ documentDbUrl
1236
+ },
1237
+ {},
1238
+ {}
1239
+ )}`;
1240
+ })}`}</div> ${``}`;
1241
+ } while (!$$settled);
1242
+ return $$rendered;
1243
+ });
1244
+ const css$3 = {
1245
+ code: ".consultation-item.svelte-13z9n8v{margin-bottom:20px}.title.svelte-13z9n8v{font-weight:bold}.annotation.svelte-13z9n8v{overflow:hidden;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;text-overflow:ellipsis;white-space:normal}a.svelte-13z9n8v{cursor:pointer;color:#1a0dab}.full-text.svelte-13z9n8v{display:block;white-space:normal}p.svelte-13z9n8v{margin-top:10px;margin-bottom:10px}",
1246
+ map: null
1247
+ };
1248
+ const ConsultationItem = create_ssr_component(($$result, $$props, $$bindings, slots) => {
1249
+ let { showFullText = Array(10).fill(false) } = $$props;
1250
+ let { index } = $$props;
1251
+ let { title } = $$props;
1252
+ let { text } = $$props;
1253
+ if ($$props.showFullText === void 0 && $$bindings.showFullText && showFullText !== void 0)
1254
+ $$bindings.showFullText(showFullText);
1255
+ if ($$props.index === void 0 && $$bindings.index && index !== void 0)
1256
+ $$bindings.index(index);
1257
+ if ($$props.title === void 0 && $$bindings.title && title !== void 0)
1258
+ $$bindings.title(title);
1259
+ if ($$props.text === void 0 && $$bindings.text && text !== void 0)
1260
+ $$bindings.text(text);
1261
+ $$result.css.add(css$3);
1262
+ return `<div class="consultation-item svelte-13z9n8v"><div class="title svelte-13z9n8v"><a class="svelte-13z9n8v">${escape(title)}</a></div> ${showFullText[index] ? `<div class="annotation full-text svelte-13z9n8v">${each(text.split("\n"), (line) => {
1263
+ return `<p class="svelte-13z9n8v">${escape(line)}</p>`;
1264
+ })}</div>` : ``} </div>`;
1265
+ });
1266
+ const css$2 = {
1267
+ code: "h2.svelte-s2jiei{margin-bottom:10px;font-size:large}.relevant-consultations.svelte-s2jiei{flex:1;overflow-y:auto;padding:1rem}",
1268
+ map: null
1269
+ };
1270
+ const RelevantConsultations = create_ssr_component(($$result, $$props, $$bindings, slots) => {
1271
+ let { showFullText = Array(10).fill(false) } = $$props;
1272
+ let { consultations = [] } = $$props;
1273
+ if ($$props.showFullText === void 0 && $$bindings.showFullText && showFullText !== void 0)
1274
+ $$bindings.showFullText(showFullText);
1275
+ if ($$props.consultations === void 0 && $$bindings.consultations && consultations !== void 0)
1276
+ $$bindings.consultations(consultations);
1277
+ $$result.css.add(css$2);
1278
+ return `<div class="relevant-consultations svelte-s2jiei"><h2 class="w-full p-5 space-y-2 svelte-s2jiei" style="border-bottom:2px solid #ccc;border-top:2px solid #ccc" data-svelte-h="svelte-1ttwfrn">Релевантные консультации</h2> ${each(consultations, ({ title, text }, index) => {
1279
+ return `${validate_component(ConsultationItem, "ConsultationItem").$$render($$result, { title, text, index, showFullText }, {}, {})}`;
1280
+ })}</div> ${``}`;
1281
+ });
1282
+ const HISTORY_KEY_PREFIX = "clarificationHistory_";
1283
+ const HISTORY_INDEX_KEY = "clarificationHistoryIndex";
1284
+ const HISTORY_ITEMS_LIMIT = 2;
1285
+ class ClarificationHistoryService {
1286
+ // Загружает историю как массив, собирая данные из ключей с префиксом
1287
+ static loadHistory() {
1288
+ const history = [];
1289
+ const index = this.getHistoryIndex();
1290
+ for (let i = 0; i < index; i++) {
1291
+ const item = localStorage.getItem(`${HISTORY_KEY_PREFIX}${i}`);
1292
+ if (item) {
1293
+ history.push(JSON.parse(item));
1294
+ }
1295
+ }
1296
+ return history;
1297
+ }
1298
+ // Сохраняет элемент истории с новым индексом и управляет лимитом элементов
1299
+ static addHistoryItem(item) {
1300
+ const index = this.getHistoryIndex();
1301
+ localStorage.setItem(`${HISTORY_KEY_PREFIX}${index}`, JSON.stringify(item));
1302
+ this.setHistoryIndex(index + 1);
1303
+ this.manageHistoryLimit();
1304
+ }
1305
+ // Обновляет элемент истории с заданным индексом
1306
+ static updateHistoryItem(index, item) {
1307
+ localStorage.setItem(`${HISTORY_KEY_PREFIX}${index}`, JSON.stringify(item));
1308
+ }
1309
+ // Возвращает элемент истории по индексу
1310
+ static getHistoryItem(index) {
1311
+ const item = localStorage.getItem(`${HISTORY_KEY_PREFIX}${index}`);
1312
+ return item ? JSON.parse(item) : null;
1313
+ }
1314
+ // Возвращает количество элементов в истории
1315
+ static getHistoryLength() {
1316
+ return this.getHistoryIndex();
1317
+ }
1318
+ // Удаляет все элементы истории
1319
+ static clearHistory() {
1320
+ const index = this.getHistoryIndex();
1321
+ for (let i = 0; i < index; i++) {
1322
+ localStorage.removeItem(`${HISTORY_KEY_PREFIX}${i}`);
1323
+ }
1324
+ localStorage.removeItem(HISTORY_INDEX_KEY);
1325
+ }
1326
+ // Вспомогательная функция для управления лимитом истории
1327
+ static manageHistoryLimit() {
1328
+ const index = this.getHistoryIndex();
1329
+ if (index > HISTORY_ITEMS_LIMIT) {
1330
+ const excessCount = index - HISTORY_ITEMS_LIMIT;
1331
+ for (let i = 0; i < excessCount; i++) {
1332
+ localStorage.removeItem(`${HISTORY_KEY_PREFIX}${i}`);
1333
+ }
1334
+ this.shiftHistoryKeys(excessCount);
1335
+ this.setHistoryIndex(HISTORY_ITEMS_LIMIT);
1336
+ }
1337
+ }
1338
+ // Смещает ключи истории при удалении старых элементов
1339
+ static shiftHistoryKeys(shiftAmount) {
1340
+ const index = this.getHistoryIndex();
1341
+ for (let i = shiftAmount; i < index; i++) {
1342
+ const item = localStorage.getItem(`${HISTORY_KEY_PREFIX}${i}`);
1343
+ if (item) {
1344
+ localStorage.setItem(`${HISTORY_KEY_PREFIX}${i - shiftAmount}`, item);
1345
+ }
1346
+ localStorage.removeItem(`${HISTORY_KEY_PREFIX}${i}`);
1347
+ }
1348
+ }
1349
+ // Вспомогательная функция для получения текущего индекса истории
1350
+ static getHistoryIndex() {
1351
+ const index = localStorage.getItem(HISTORY_INDEX_KEY);
1352
+ return index ? parseInt(index, 10) : 0;
1353
+ }
1354
+ // Вспомогательная функция для установки индекса истории
1355
+ static setHistoryIndex(index) {
1356
+ localStorage.setItem(HISTORY_INDEX_KEY, index.toString());
1357
+ }
1358
+ }
1359
+ const css$1 = {
1360
+ code: "textarea.svelte-wjelcf{border:1px solid #ccc;border-radius:4px;width:100%;font-size:14px;margin-bottom:10px;box-sizing:border-box;padding:1rem}button.svelte-wjelcf{margin:5px}",
1361
+ map: null
1362
+ };
1363
+ const UserClarification = create_ssr_component(($$result, $$props, $$bindings, slots) => {
1364
+ let { userRequest = "" } = $$props;
1365
+ let { searchClarification = "" } = $$props;
1366
+ let { llmClarification = "" } = $$props;
1367
+ let { searchResults } = $$props;
1368
+ let { relevantConsultations } = $$props;
1369
+ let { llmResponse = "" } = $$props;
1370
+ let { historyIsNotEmpty = false } = $$props;
1371
+ let currentHistoryIndex = 0;
1372
+ let history = [];
1373
+ let historyLength = 0;
1374
+ function loadCurrentHistoryItem() {
1375
+ const item = ClarificationHistoryService.getHistoryItem(currentHistoryIndex);
1376
+ if (item) {
1377
+ searchClarification = item.searchClarification;
1378
+ llmClarification = item.llmClarification;
1379
+ searchResults = item.searchResults;
1380
+ relevantConsultations = item.relevantConsultations;
1381
+ llmResponse = item.llmResponse;
1382
+ userRequest = item.userRequest;
1383
+ }
1384
+ return item;
1385
+ }
1386
+ function getCurrentState() {
1387
+ return ClarificationHistoryService.getHistoryItem(currentHistoryIndex);
1388
+ }
1389
+ function addState(request) {
1390
+ console.log("addState called");
1391
+ const newItem = {
1392
+ userRequest: request,
1393
+ searchClarification,
1394
+ llmClarification,
1395
+ searchResults: [],
1396
+ llmResponse: "",
1397
+ relevantConsultations: [],
1398
+ transactionMaps: []
1399
+ };
1400
+ historyLength = ClarificationHistoryService.getHistoryLength();
1401
+ ClarificationHistoryService.addHistoryItem(newItem);
1402
+ currentHistoryIndex = historyLength - 1;
1403
+ }
1404
+ function updateCurrentState(request, searchResults2, llmResponse2, relevantConsultations2, transactionMaps) {
1405
+ console.log("updateCurrentState called");
1406
+ const item = ClarificationHistoryService.getHistoryItem(currentHistoryIndex);
1407
+ if (item) {
1408
+ item.userRequest = request ?? item.userRequest;
1409
+ item.searchClarification = searchClarification ?? item.searchClarification;
1410
+ item.llmClarification = llmClarification ?? item.llmClarification;
1411
+ item.searchResults = searchResults2 ?? item.searchResults;
1412
+ item.llmResponse = llmResponse2 ?? item.llmResponse;
1413
+ item.relevantConsultations = relevantConsultations2 ?? item.relevantConsultations;
1414
+ item.transactionMaps = transactionMaps ?? item.transactionMaps;
1415
+ console.log(item);
1416
+ ClarificationHistoryService.updateHistoryItem(currentHistoryIndex, item);
1417
+ }
1418
+ }
1419
+ function prevHistory() {
1420
+ if (currentHistoryIndex > 0) {
1421
+ currentHistoryIndex -= 1;
1422
+ loadCurrentHistoryItem();
1423
+ }
1424
+ }
1425
+ function nextHistory() {
1426
+ if (currentHistoryIndex < history.length - 1) {
1427
+ currentHistoryIndex += 1;
1428
+ loadCurrentHistoryItem();
1429
+ }
1430
+ }
1431
+ function clear() {
1432
+ llmClarification = "";
1433
+ searchClarification = "";
1434
+ }
1435
+ if ($$props.userRequest === void 0 && $$bindings.userRequest && userRequest !== void 0)
1436
+ $$bindings.userRequest(userRequest);
1437
+ if ($$props.searchClarification === void 0 && $$bindings.searchClarification && searchClarification !== void 0)
1438
+ $$bindings.searchClarification(searchClarification);
1439
+ if ($$props.llmClarification === void 0 && $$bindings.llmClarification && llmClarification !== void 0)
1440
+ $$bindings.llmClarification(llmClarification);
1441
+ if ($$props.searchResults === void 0 && $$bindings.searchResults && searchResults !== void 0)
1442
+ $$bindings.searchResults(searchResults);
1443
+ if ($$props.relevantConsultations === void 0 && $$bindings.relevantConsultations && relevantConsultations !== void 0)
1444
+ $$bindings.relevantConsultations(relevantConsultations);
1445
+ if ($$props.llmResponse === void 0 && $$bindings.llmResponse && llmResponse !== void 0)
1446
+ $$bindings.llmResponse(llmResponse);
1447
+ if ($$props.historyIsNotEmpty === void 0 && $$bindings.historyIsNotEmpty && historyIsNotEmpty !== void 0)
1448
+ $$bindings.historyIsNotEmpty(historyIsNotEmpty);
1449
+ if ($$props.loadCurrentHistoryItem === void 0 && $$bindings.loadCurrentHistoryItem && loadCurrentHistoryItem !== void 0)
1450
+ $$bindings.loadCurrentHistoryItem(loadCurrentHistoryItem);
1451
+ if ($$props.getCurrentState === void 0 && $$bindings.getCurrentState && getCurrentState !== void 0)
1452
+ $$bindings.getCurrentState(getCurrentState);
1453
+ if ($$props.addState === void 0 && $$bindings.addState && addState !== void 0)
1454
+ $$bindings.addState(addState);
1455
+ if ($$props.updateCurrentState === void 0 && $$bindings.updateCurrentState && updateCurrentState !== void 0)
1456
+ $$bindings.updateCurrentState(updateCurrentState);
1457
+ if ($$props.prevHistory === void 0 && $$bindings.prevHistory && prevHistory !== void 0)
1458
+ $$bindings.prevHistory(prevHistory);
1459
+ if ($$props.nextHistory === void 0 && $$bindings.nextHistory && nextHistory !== void 0)
1460
+ $$bindings.nextHistory(nextHistory);
1461
+ if ($$props.clear === void 0 && $$bindings.clear && clear !== void 0)
1462
+ $$bindings.clear(clear);
1463
+ $$result.css.add(css$1);
1464
+ return `<div class="w-full flex p-2 space-x-2"><textarea rows="3" placeholder="Уточнение для поиска" class="svelte-wjelcf">${escape(searchClarification || "")}</textarea> <textarea rows="3" placeholder="Уточнение для LLM" class="svelte-wjelcf">${escape(llmClarification || "")}</textarea></div> ${``}`;
1465
+ });
1466
+ const css = {
1467
+ code: '.loading-container.svelte-rgnwju.svelte-rgnwju{display:flex;justify-content:center;align-items:center;align-self:center;width:3rem;height:90%;margin-left:5px}.loading-status.svelte-rgnwju.svelte-rgnwju{display:flex;justify-content:center;align-items:center;align-self:center}.grow-wrap.svelte-rgnwju.svelte-rgnwju{display:grid}.grow-wrap.svelte-rgnwju.svelte-rgnwju::after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden;max-width:100%;max-height:250px;display:block;overflow-x:hidden}.grow-wrap.svelte-rgnwju>textarea.svelte-rgnwju{resize:none}.grow-wrap.svelte-rgnwju>textarea.svelte-rgnwju,.grow-wrap.svelte-rgnwju.svelte-rgnwju::after{padding:1rem;border:1px solid #ccc;border-radius:4px;width:100%;font-size:14px;margin-bottom:10px;box-sizing:border-box;grid-area:1/1/2/2}.grow-wrap.svelte-rgnwju>textarea .svelte-rgnwju:focus,.grow-wrap.svelte-rgnwju::after .svelte-rgnwju:focus{outline:none;border-color:#1976d2}.grow-wrap.svelte-rgnwju>textarea .svelte-rgnwju:placeholder,.grow-wrap.svelte-rgnwju::after .svelte-rgnwju:placeholder{color:#aaa}.auto-expand-textarea.svelte-rgnwju.svelte-rgnwju{box-sizing:border-box;width:100%;font-size:16px;border:1px solid #ccc;resize:vertical;overflow-y:auto;min-height:1rem}.search-column.svelte-rgnwju.svelte-rgnwju{flex:1;display:flex;flex-direction:column;border-right:1px solid #ccc}.search-bar.svelte-rgnwju.svelte-rgnwju{padding:1rem}.search-bar.svelte-rgnwju textarea.svelte-rgnwju{width:100%;max-width:100%;padding:1rem;box-sizing:border-box}.textarea-column.svelte-rgnwju.svelte-rgnwju{flex:1;display:flex;flex-direction:column}.textarea.svelte-rgnwju.svelte-rgnwju{width:100%;height:100%;margin:10px;border:none;outline:none;resize:none;background:transparent}@media(max-width: 767px){.search-column.svelte-rgnwju.svelte-rgnwju,.textarea-column.svelte-rgnwju.svelte-rgnwju{border-right:none}}.search-second-bar.svelte-rgnwju.svelte-rgnwju{display:flex;justify-content:space-between;flex-wrap:wrap}.search-second-bar.svelte-rgnwju .status-components.svelte-rgnwju{flex:1;margin-right:10px;margin-top:10px}@media(max-width: 600px){.search-second-bar.svelte-rgnwju.svelte-rgnwju{flex-direction:column}.search-second-bar.svelte-rgnwju .status-components.svelte-rgnwju{width:100%;margin-right:0;margin-bottom:10px}}textarea.svelte-rgnwju.svelte-rgnwju{border:1px solid #ccc;border-radius:4px;width:100%;font-size:14px;margin-bottom:10px;box-sizing:border-box;padding:1rem}a.svelte-rgnwju.svelte-rgnwju{cursor:pointer}.reference-btn.svelte-rgnwju.svelte-rgnwju{text-decoration:none;color:black}.reference-btn.svelte-rgnwju svg.svelte-rgnwju{margin-right:10px}.reference-btn.svelte-rgnwju.svelte-rgnwju:hover{text-decoration:none;color:black}',
1468
+ map: null
1469
+ };
1470
+ const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
1471
+ let { data } = $$props;
1472
+ const { ENV_DOCUMENT_DB_URL, ENV_ENABLE_DOCUMENT_DB, ENV_ENABLE_DB_SUPPORT } = data;
1473
+ let userClarificationComponent;
1474
+ initializeStores();
1475
+ getToastStore();
1476
+ let userSearchClarification = "";
1477
+ let userLlmClarification = "";
1478
+ let historyIsNotEmpty = true;
1479
+ let llmHealthStatus = "unknown";
1480
+ let searchHealthStatus = "unknown";
1481
+ let healthInterval;
1482
+ onDestroy(() => {
1483
+ clearInterval(healthInterval);
1484
+ cancelLlmRequest();
1485
+ });
1486
+ let searchResults = [];
1487
+ let relevantConsultations = [];
1488
+ let isLlmLoading = false;
1489
+ let currentLlmResponse = "";
1490
+ let baseLlmResponse = "";
1491
+ let currentUserRequest = "";
1492
+ let savedUserRequest = "";
1493
+ let loadingStatusText = "";
1494
+ let showFullText = Array(searchResults.length).fill(false);
1495
+ let showConsultationFullText = Array(relevantConsultations.length).fill(false);
1496
+ let useSearchResult;
1497
+ let enableSearchResultSelection = false;
1498
+ let enableLLMForTeasers = false;
1499
+ let doMultistepSearch = false;
1500
+ let useAccountingDocs = false;
1501
+ let useReranking = false;
1502
+ let useLLMForFiltering = false;
1503
+ let useKeywords = false;
1504
+ let disableThresholds = false;
1505
+ let searchInTransactionLedger = false;
1506
+ let searchInTransactionLedgerByQuestion = false;
1507
+ let searchInTransactionLedgerByOperation = false;
1508
+ let useShortestPrompt = false;
1509
+ let shortestPromptGenerationFinished = false;
1510
+ let enableRealtimeLlmReponse = false;
1511
+ let sendConsultationToLlm = false;
1512
+ let showClarifyLlmResponseButton = false;
1513
+ let abortController = new AbortController();
1514
+ const cancelLlmRequest = () => {
1515
+ abortController.abort("user canceled");
1516
+ abortController = new AbortController();
1517
+ isLlmLoading = false;
1518
+ loadingStatusText = "";
1519
+ };
1520
+ if ($$props.data === void 0 && $$bindings.data && data !== void 0)
1521
+ $$bindings.data(data);
1522
+ $$result.css.add(css);
1523
+ let $$settled;
1524
+ let $$rendered;
1525
+ let previous_head = $$result.head;
1526
+ do {
1527
+ $$settled = true;
1528
+ $$result.head = previous_head;
1529
+ {
1530
+ {
1531
+ {
1532
+ searchInTransactionLedger = false;
1533
+ }
1534
+ if (
1535
+ // clarificationEntry &&
1536
+ // isClarificationPaneVisible &&
1537
+ userLlmClarification && // clarificationEntry.userRequest == currentUserRequest &&
1538
+ searchResults.length > 0 && baseLlmResponse && savedUserRequest == currentUserRequest && !isLlmLoading
1539
+ ) {
1540
+ showClarifyLlmResponseButton = true;
1541
+ } else {
1542
+ showClarifyLlmResponseButton = false;
1543
+ }
1544
+ }
1545
+ }
1546
+ $$rendered = `${$$result.head += `<!-- HEAD_svelte-1wpbm1r_START -->${$$result.title = `<title>LLM demo app</title>`, ""}<meta name="description" content="LLM demo app"><!-- HEAD_svelte-1wpbm1r_END -->`, ""} ${validate_component(Toast, "Toast").$$render($$result, {}, {}, {})} <section><div class="search-bar flex flex-wrap svelte-rgnwju"><div class="grow-wrap w-full svelte-rgnwju"> <textarea class="auto-expand-textarea svelte-rgnwju" rows="1" placeholder="Введите ваш запрос...">${escape(currentUserRequest || "")}</textarea></div> <div class="search-second-bar w-full svelte-rgnwju"><div class="status-components svelte-rgnwju">${validate_component(LlmHealthStatus, "LlmHealthStatus").$$render($$result, { status: llmHealthStatus }, {}, {})} ${validate_component(SearchApiHealthStatus, "SearchApiHealthStatus").$$render($$result, { status: searchHealthStatus }, {}, {})}</div> <div class="flex space-x-2 items-center"> <a${add_attribute("href", `${ENV_DOCUMENT_DB_URL}file/view/id/${HelpDocumentId}`, 0)} target="_blank" rel="noopener noreferrer" class="btn variant-outline-tertiary reference-btn svelte-rgnwju"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-circle svelte-rgnwju" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"></path><path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94"></path></svg>
1547
+ Справка</a> <button class="btn variant-outline-tertiary">${escape("Уточнить")}</button> <button class="btn variant-outline-tertiary w-48 justify-between" data-svelte-h="svelte-7w234r">Инструменты
1548
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 20" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M12 14.5a.75.75 0 01-.53-.22l-4.25-4.25a.75.75 0 011.06-1.06L12 12.69l3.72-3.72a.75.75 0 011.06 1.06l-4.25 4.25a.75.75 0 01-.53.22z" clip-rule="evenodd"></path></svg></button> <div class="card p-4 w-150 shadow-xl z-10" data-popup="popupFeatured"><div><label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox" ${searchInTransactionLedger ? "disabled" : ""}${add_attribute("checked", doMultistepSearch, 1)}> <p data-svelte-h="svelte-o1whuo">Использовать многоступенчатый поиск</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox" ${searchInTransactionLedger ? "disabled" : ""}${add_attribute("checked", enableLLMForTeasers, 1)}> <p data-svelte-h="svelte-9zxjq1">Использовать LLM для тизеров</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox" ${searchInTransactionLedger ? "disabled" : ""}${add_attribute("checked", useLLMForFiltering, 1)}> <p data-svelte-h="svelte-1uul1f7">Использовать LLM для фильтрации источников</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox" ${searchInTransactionLedger ? "disabled" : ""}${add_attribute("checked", disableThresholds, 1)}> <p data-svelte-h="svelte-jhmp61">Выключить фильтрацию по порогам</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox" ${searchInTransactionLedger ? "disabled" : ""}${add_attribute("checked", useShortestPrompt, 1)}> <p data-svelte-h="svelte-1548adw">Получить более короткий ответ</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox" ${searchInTransactionLedger ? "disabled" : ""}${add_attribute("checked", enableRealtimeLlmReponse, 1)}> <p data-svelte-h="svelte-tnawxy">Выводить ответ в реальном времени</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox" ${searchInTransactionLedger ? "disabled" : ""}${add_attribute("checked", sendConsultationToLlm, 1)}> <p data-svelte-h="svelte-vv6jwf">Учитывать консультации в ответе</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox" ${searchInTransactionLedger ? "disabled" : ""}${add_attribute("checked", useReranking, 1)}> <p data-svelte-h="svelte-qkyc7c">Использовать переранжирование</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", searchInTransactionLedgerByQuestion, 1)}> <p data-svelte-h="svelte-17zslqw">Карты проводок по вопросу</p></label> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", searchInTransactionLedgerByOperation, 1)}> <p data-svelte-h="svelte-1esqmyo">Карты проводок по хоз. операциям</p></label></div></div> ${currentUserRequest ? `<button class="btn variant-filled" data-svelte-h="svelte-1rjqwcg">Очистить</button>` : ``} ${isLlmLoading ? `<button class="btn variant-filled" data-svelte-h="svelte-a5kyut">Остановить</button>` : ``} <button title="Ctrl+Enter" class="btn variant-filled" data-svelte-h="svelte-w5ppob">Отправить</button></div> <div class="flex space-x-2 items-center justify-center w-full">${isLlmLoading ? `<div class="loading-status svelte-rgnwju">${escape(loadingStatusText)}</div> <div class="loading-container svelte-rgnwju">${validate_component(LoadingSpinner, "LoadingSpinner").$$render($$result, {}, {}, {})}</div>` : ``}</div> <div class="${["w-full", "hidden"].join(" ").trim()}">${validate_component(UserClarification, "UserClarification").$$render(
1549
+ $$result,
1550
+ {
1551
+ this: userClarificationComponent,
1552
+ llmClarification: userLlmClarification,
1553
+ searchClarification: userSearchClarification,
1554
+ searchResults,
1555
+ relevantConsultations,
1556
+ llmResponse: currentLlmResponse,
1557
+ historyIsNotEmpty,
1558
+ userRequest: currentUserRequest
1559
+ },
1560
+ {
1561
+ this: ($$value) => {
1562
+ userClarificationComponent = $$value;
1563
+ $$settled = false;
1564
+ },
1565
+ llmClarification: ($$value) => {
1566
+ userLlmClarification = $$value;
1567
+ $$settled = false;
1568
+ },
1569
+ searchClarification: ($$value) => {
1570
+ userSearchClarification = $$value;
1571
+ $$settled = false;
1572
+ },
1573
+ searchResults: ($$value) => {
1574
+ searchResults = $$value;
1575
+ $$settled = false;
1576
+ },
1577
+ relevantConsultations: ($$value) => {
1578
+ relevantConsultations = $$value;
1579
+ $$settled = false;
1580
+ },
1581
+ llmResponse: ($$value) => {
1582
+ currentLlmResponse = $$value;
1583
+ $$settled = false;
1584
+ },
1585
+ historyIsNotEmpty: ($$value) => {
1586
+ historyIsNotEmpty = $$value;
1587
+ $$settled = false;
1588
+ },
1589
+ userRequest: ($$value) => {
1590
+ currentUserRequest = $$value;
1591
+ $$settled = false;
1592
+ }
1593
+ },
1594
+ {}
1595
+ )}</div> <div class="w-full my-2"></div> <div class="card w-[calc(50%-0.5rem)] p-2 mr-2"><div>${validate_component(SlideToggle, "SlideToggle").$$render(
1596
+ $$result,
1597
+ {
1598
+ name: "slider-label",
1599
+ size: "sm",
1600
+ checked: enableSearchResultSelection,
1601
+ disabled: searchInTransactionLedger
1602
+ },
1603
+ {
1604
+ checked: ($$value) => {
1605
+ enableSearchResultSelection = $$value;
1606
+ $$settled = false;
1607
+ },
1608
+ disabled: ($$value) => {
1609
+ searchInTransactionLedger = $$value;
1610
+ $$settled = false;
1611
+ }
1612
+ },
1613
+ {
1614
+ default: () => {
1615
+ return `Выбрать источники для LLM`;
1616
+ }
1617
+ }
1618
+ )}</div> <div>${validate_component(SlideToggle, "SlideToggle").$$render(
1619
+ $$result,
1620
+ {
1621
+ name: "slider-label",
1622
+ size: "sm",
1623
+ checked: useKeywords,
1624
+ disabled: searchInTransactionLedger
1625
+ },
1626
+ {
1627
+ checked: ($$value) => {
1628
+ useKeywords = $$value;
1629
+ $$settled = false;
1630
+ },
1631
+ disabled: ($$value) => {
1632
+ searchInTransactionLedger = $$value;
1633
+ $$settled = false;
1634
+ }
1635
+ },
1636
+ {
1637
+ default: () => {
1638
+ return `Использовать ключевые слова`;
1639
+ }
1640
+ }
1641
+ )}</div> <div>${validate_component(SlideToggle, "SlideToggle").$$render(
1642
+ $$result,
1643
+ {
1644
+ name: "slider-label",
1645
+ size: "sm",
1646
+ checked: useAccountingDocs,
1647
+ disabled: searchInTransactionLedger
1648
+ },
1649
+ {
1650
+ checked: ($$value) => {
1651
+ useAccountingDocs = $$value;
1652
+ $$settled = false;
1653
+ },
1654
+ disabled: ($$value) => {
1655
+ searchInTransactionLedger = $$value;
1656
+ $$settled = false;
1657
+ }
1658
+ },
1659
+ {
1660
+ default: () => {
1661
+ return `Выполнить поиск по БУ`;
1662
+ }
1663
+ }
1664
+ )}</div> <div></div> ${``}</div> <div class="w-full my-2">${``}</div> ${``} ${(historyIsNotEmpty && searchResults.length > 0 || relevantConsultations && relevantConsultations.length > 0) && !searchInTransactionLedger ? `${`${validate_component(Splitpanes, "Splitpanes").$$render($$result, { theme: "modern-theme" }, {}, {
1665
+ default: () => {
1666
+ return `${validate_component(Pane, "Pane").$$render(
1667
+ $$result,
1668
+ {
1669
+ minSize: 20,
1670
+ class: "search-column",
1671
+ size: 49
1672
+ },
1673
+ {},
1674
+ {
1675
+ default: () => {
1676
+ return `<div class="search-column svelte-rgnwju">${validate_component(SearchResults, "SearchResults").$$render(
1677
+ $$result,
1678
+ {
1679
+ enableDocumentDb: ENV_ENABLE_DOCUMENT_DB,
1680
+ documentDbUrl: ENV_DOCUMENT_DB_URL,
1681
+ searchResults,
1682
+ showFullText,
1683
+ useSearchResult,
1684
+ enableSearchResultSelection
1685
+ },
1686
+ {
1687
+ searchResults: ($$value) => {
1688
+ searchResults = $$value;
1689
+ $$settled = false;
1690
+ },
1691
+ showFullText: ($$value) => {
1692
+ showFullText = $$value;
1693
+ $$settled = false;
1694
+ },
1695
+ useSearchResult: ($$value) => {
1696
+ useSearchResult = $$value;
1697
+ $$settled = false;
1698
+ },
1699
+ enableSearchResultSelection: ($$value) => {
1700
+ enableSearchResultSelection = $$value;
1701
+ $$settled = false;
1702
+ }
1703
+ },
1704
+ {}
1705
+ )} ${relevantConsultations && relevantConsultations.length > 0 ? `${validate_component(RelevantConsultations, "RelevantConsultations").$$render(
1706
+ $$result,
1707
+ {
1708
+ consultations: relevantConsultations,
1709
+ showFullText: showConsultationFullText
1710
+ },
1711
+ {
1712
+ consultations: ($$value) => {
1713
+ relevantConsultations = $$value;
1714
+ $$settled = false;
1715
+ },
1716
+ showFullText: ($$value) => {
1717
+ showConsultationFullText = $$value;
1718
+ $$settled = false;
1719
+ }
1720
+ },
1721
+ {}
1722
+ )}` : ``}</div>`;
1723
+ }
1724
+ }
1725
+ )} ${validate_component(Pane, "Pane").$$render($$result, { size: 49 }, {}, {
1726
+ default: () => {
1727
+ return `<div class="textarea-column svelte-rgnwju"><div class="textarea svelte-rgnwju"><button class="${[
1728
+ "btn variant-filled",
1729
+ !(enableSearchResultSelection && searchResults.length > 0 && !showClarifyLlmResponseButton) ? "hidden" : ""
1730
+ ].join(" ").trim()}" data-svelte-h="svelte-qvwp3t">Получить ответ</button> <button class="${[
1731
+ "btn variant-filled",
1732
+ !showClarifyLlmResponseButton ? "hidden" : ""
1733
+ ].join(" ").trim()}" data-svelte-h="svelte-zcineo">Уточнить ответ</button> <button class="btn variant-filled" data-svelte-h="svelte-1ddim4b">Скачать ответ в Word</button> <div class="textarea svelte-rgnwju">${!isLlmLoading || enableRealtimeLlmReponse || currentLlmResponse && useShortestPrompt && shortestPromptGenerationFinished ? `<!-- HTML_TAG_START -->${currentLlmResponse}<!-- HTML_TAG_END -->` : ``}</div> ${``}</div></div>`;
1734
+ }
1735
+ })}`;
1736
+ }
1737
+ })}`}` : ``}</div></div> </section>`;
1738
+ } while (!$$settled);
1739
+ return $$rendered;
1740
+ });
1741
+
1742
+ export { Page as default };
1743
+ //# sourceMappingURL=_page.svelte-lDFDd0lS.js.map
build/server/chunks/_page.svelte-lDFDd0lS.js.map ADDED
The diff for this file is too large to render. See raw diff
 
build/server/chunks/_page.svelte-sUWsV2Jl.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { c as create_ssr_component, k as each, e as escape, b as add_attribute } from './ssr-IdY0EU5r.js';
2
+
3
+ const css = {
4
+ code: "pre.svelte-1m09ey3{font-size:0.875rem;line-height:1.25rem;overflow:auto;border:none;box-shadow:none;background:none;padding:0;font-family:system-ui;color:black;white-space:pre-wrap}",
5
+ map: null
6
+ };
7
+ const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
8
+ const prompt = [
9
+ "Ты - бот, ассистент. Ты помогаешь пользователю с его запросами. Отвечай на русском языке, если пользователь не указал иное. Обращайся на Вы. Следуй инструкциям и указаниям пользователя.",
10
+ "Я отвечаю на русском языке!"
11
+ ];
12
+ let messages = [];
13
+ new AbortController();
14
+ let usePrompt = true;
15
+ function handlePromptChange(usePrompt2) {
16
+ if (usePrompt2) {
17
+ messages.unshift(prompt);
18
+ } else {
19
+ messages = messages.filter((e) => e !== prompt);
20
+ }
21
+ }
22
+ $$result.css.add(css);
23
+ {
24
+ handlePromptChange(usePrompt);
25
+ }
26
+ return ` <div class="h-screen flex flex-col py-8"><div class="flex-1 overflow-y-auto p-4 bg-gray-200">${each(messages.slice(1), (message) => {
27
+ return `<div class="mb-2 flex flex-col"><div class="mb-2 flex flex-col"><p class="font-bold text-sm" data-svelte-h="svelte-rp9yxd">Вы:</p> <div class="self-start bg-blue-500 text-white p-2 rounded-lg"><p class="text-sm">${escape(message[0])}</p></div> <p class="font-bold text-sm" data-svelte-h="svelte-1l7fbwv">Бот:</p> <div class="self-start bg-slate-100 text-black p-2 rounded-lg"><pre class="text-sm svelte-1m09ey3">${escape(message[1])}</pre> </div></div> </div>`;
28
+ })}</div> <div class="p-4 bg-gray-300"><div class="flex"><div class="w-full"><textarea class="flex-1 py-2 px-3 rounded-md border-gray-300 w-full" placeholder="Введите ваше сообщение...">${escape("")}</textarea> <label class="flex items-center space-x-2"><input class="checkbox accent-white" type="checkbox"${add_attribute("checked", usePrompt, 1)}> <p data-svelte-h="svelte-15ltrgi">Использовать системный промпт</p></label></div> ${``} ${`<button class="ml-2 px-4 py-2 mb-8 bg-blue-500 text-white rounded-md" data-svelte-h="svelte-n2s9cz">Отправить</button>`}</div></div> </div>`;
29
+ });
30
+
31
+ export { Page as default };
32
+ //# sourceMappingURL=_page.svelte-sUWsV2Jl.js.map
build/server/chunks/_page.svelte-sUWsV2Jl.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"_page.svelte-sUWsV2Jl.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/chat/_page.svelte.js"],"sourcesContent":["import { c as create_ssr_component, p as each, e as escape, i as add_attribute } from \"../../../chunks/ssr.js\";\nconst css = {\n code: \"pre.svelte-1m09ey3{font-size:0.875rem;line-height:1.25rem;overflow:auto;border:none;box-shadow:none;background:none;padding:0;font-family:system-ui;color:black;white-space:pre-wrap}\",\n map: null\n};\nconst Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n const prompt = [\n \"Ты - бот, ассистент. Ты помогаешь пользователю с его запросами. Отвечай на русском языке, если пользователь не указал иное. Обращайся на Вы. Следуй инструкциям и указаниям пользователя.\",\n \"Я отвечаю на русском языке!\"\n ];\n let messages = [];\n new AbortController();\n let usePrompt = true;\n function handlePromptChange(usePrompt2) {\n if (usePrompt2) {\n messages.unshift(prompt);\n } else {\n messages = messages.filter((e) => e !== prompt);\n }\n }\n $$result.css.add(css);\n {\n handlePromptChange(usePrompt);\n }\n return ` <div class=\"h-screen flex flex-col py-8\"><div class=\"flex-1 overflow-y-auto p-4 bg-gray-200\">${each(messages.slice(1), (message) => {\n return `<div class=\"mb-2 flex flex-col\"><div class=\"mb-2 flex flex-col\"><p class=\"font-bold text-sm\" data-svelte-h=\"svelte-rp9yxd\">Вы:</p> <div class=\"self-start bg-blue-500 text-white p-2 rounded-lg\"><p class=\"text-sm\">${escape(message[0])}</p></div> <p class=\"font-bold text-sm\" data-svelte-h=\"svelte-1l7fbwv\">Бот:</p> <div class=\"self-start bg-slate-100 text-black p-2 rounded-lg\"><pre class=\"text-sm svelte-1m09ey3\">${escape(message[1])}</pre> </div></div> </div>`;\n })}</div> <div class=\"p-4 bg-gray-300\"><div class=\"flex\"><div class=\"w-full\"><textarea class=\"flex-1 py-2 px-3 rounded-md border-gray-300 w-full\" placeholder=\"Введите ваше сообщение...\">${escape(\"\")}</textarea> <label class=\"flex items-center space-x-2\"><input class=\"checkbox accent-white\" type=\"checkbox\"${add_attribute(\"checked\", usePrompt, 1)}> <p data-svelte-h=\"svelte-15ltrgi\">Использовать системный промпт</p></label></div> ${``} ${`<button class=\"ml-2 px-4 py-2 mb-8 bg-blue-500 text-white rounded-md\" data-svelte-h=\"svelte-n2s9cz\">Отправить</button>`}</div></div> </div>`;\n});\nexport {\n Page as default\n};\n"],"names":[],"mappings":";;AACA,MAAM,GAAG,GAAG;AACZ,EAAE,IAAI,EAAE,uLAAuL;AAC/L,EAAE,GAAG,EAAE,IAAI;AACX,CAAC,CAAC;AACG,MAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC5E,EAAE,MAAM,MAAM,GAAG;AACjB,IAAI,2LAA2L;AAC/L,IAAI,6BAA6B;AACjC,GAAG,CAAC;AACJ,EAAE,IAAI,QAAQ,GAAG,EAAE,CAAC;AACpB,EAAE,IAAI,eAAe,EAAE,CAAC;AACxB,EAAE,IAAI,SAAS,GAAG,IAAI,CAAC;AACvB,EAAE,SAAS,kBAAkB,CAAC,UAAU,EAAE;AAC1C,IAAI,IAAI,UAAU,EAAE;AACpB,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,KAAK,MAAM;AACX,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,CAAC;AACtD,KAAK;AACL,GAAG;AACH,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,EAAE;AACF,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAClC,GAAG;AACH,EAAE,OAAO,CAAC,gGAAgG,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,KAAK;AACjJ,IAAI,OAAO,CAAC,oNAAoN,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,mLAAmL,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC;AACzd,GAAG,CAAC,CAAC,uLAAuL,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,2GAA2G,EAAE,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,oFAAoF,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,sHAAsH,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACvkB,CAAC;;;;"}
build/server/chunks/_server.ts-8mYiDGIH.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { L as LogService } from './LogService-b0lb4PC5.js';
2
+ import 'fs';
3
+ import 'path';
4
+ import 'util';
5
+ import 'date-fns';
6
+ import 'mongoose';
7
+ import 'exceljs';
8
+ import './shared-server-49TKSBDM.js';
9
+ import './constants-jjpZ8eI6.js';
10
+
11
+ const logService = new LogService();
12
+ const POST = async ({ request }) => {
13
+ try {
14
+ const { id, score, comment } = await request.json();
15
+ await logService.logUserScore(id, score, comment);
16
+ return new Response(JSON.stringify({ message: "User score updated successfully" }), {
17
+ status: 200,
18
+ headers: { "Content-Type": "application/json" }
19
+ });
20
+ } catch (error) {
21
+ console.error("Error while recording log:", error);
22
+ return new Response(JSON.stringify({ message: "Failed to record log entry" }), {
23
+ status: 500,
24
+ headers: { "Content-Type": "application/json" }
25
+ });
26
+ }
27
+ };
28
+
29
+ export { POST };
30
+ //# sourceMappingURL=_server.ts-8mYiDGIH.js.map
build/server/chunks/_server.ts-8mYiDGIH.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"_server.ts-8mYiDGIH.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/log/write/userScore/_server.ts.js"],"sourcesContent":["import { L as LogService } from \"../../../../../../chunks/LogService.js\";\nconst logService = new LogService();\nconst POST = async ({ request }) => {\n try {\n const { id, score, comment } = await request.json();\n await logService.logUserScore(id, score, comment);\n return new Response(JSON.stringify({ message: \"User score updated successfully\" }), {\n status: 200,\n headers: { \"Content-Type\": \"application/json\" }\n });\n } catch (error) {\n console.error(\"Error while recording log:\", error);\n return new Response(JSON.stringify({ message: \"Failed to record log entry\" }), {\n status: 500,\n headers: { \"Content-Type\": \"application/json\" }\n });\n }\n};\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;AACA,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;AAC/B,MAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK;AACpC,EAAE,IAAI;AACN,IAAI,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACxD,IAAI,MAAM,UAAU,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACtD,IAAI,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC,EAAE;AACxF,MAAM,MAAM,EAAE,GAAG;AACjB,MAAM,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;AACrD,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,OAAO,KAAK,EAAE;AAClB,IAAI,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;AACvD,IAAI,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC,EAAE;AACnF,MAAM,MAAM,EAAE,GAAG;AACjB,MAAM,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;AACrD,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
build/server/chunks/_server.ts-FEch4V3G.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { d as private_env } from './shared-server-49TKSBDM.js';
2
+ import { c as redirect, b as base } from './index-JNnR1J8_.js';
3
+ import { L as LlamaCppService } from './LlamaCppService-XtF0SQo9.js';
4
+ import { F as FullTextSearchService } from './FullTextSearchService-0xoNRjpt.js';
5
+ import 'fs';
6
+ import 'path';
7
+ import 'node:dns';
8
+ import 'node-fetch';
9
+
10
+ const POST = async ({ locals, request }) => {
11
+ const body = await request.json();
12
+ let prompt = body.user_query;
13
+ let template = body.prompt_template;
14
+ const defaultTemplate = 'Ты бухгалтер. Ты отвечаешь на русском языке. Ты всегда следуешь моим инструкциям.\n Ты отвечаешь на вопросы клиентов. Чтобы ответить, ты обязательно используешь только "источники", которые я тебе предоставляю. Ты используешь только официально-деловой стиль и необходимую терминологию. Соблюдай этические нормы. \nПри ответе на вопрос ты используешь только такой формат ответа:\n 1) Четкий и краткий ответ на поставленный вопрос. Ты можешь начать свой ответ так: "По Вашему вопросу сообщаем...". Используй по возможности слова: да, можно, нет, нельзя.\n 2) Обоснование (ты используешь для обоснования "источники". Ты используешь только "источники" для поиска необходимых "законов", "статей", "пунктов" и "подпунктов" для ответа на вопрос пользователя).\n 3) Аргументация (Ты используешь только "источники" для поиска необходимых "писем" и "судебных решений", чтобы аргументировать свой ответ)."\n 4) Заключение (ты подводишь итоги всего, что сказал выше. Избегай повторения и сложных конструкций). Если в источниках нельзя найти подходящую информацию для ответа, ты отвечаешь так: "Мы не можем ответить на данный вопрос. Обратитесь к специалисту."\n Вопрос: {{ВОПРОС}} \nИсточники: {{ИСТОЧНИКИ}}';
15
+ if (!template) {
16
+ template = defaultTemplate;
17
+ }
18
+ const abortController = new AbortController();
19
+ let service = new FullTextSearchService(private_env.SEARCH_API_URL);
20
+ let results = await service.search(prompt, { abortController });
21
+ function searchResultsToLlmSources(input) {
22
+ return input.map(({ title, text }) => `${title}
23
+ ${text}`).join("\n\n");
24
+ }
25
+ const userPrompt = template.replace("{{ВОПРОС}}", prompt).replace("{{ИСТОЧНИКИ}}", searchResultsToLlmSources(results));
26
+ let llmService = new LlamaCppService(private_env.LLM_API_URL);
27
+ let llmGenerator = await llmService.predict(userPrompt, { abortController });
28
+ let response = "";
29
+ for await (const output of await llmGenerator({ prompt: userPrompt })) {
30
+ response += output.token.text;
31
+ }
32
+ return new Response(
33
+ JSON.stringify({ response, search_results: results }),
34
+ {
35
+ headers: { "Content-Type": "application/json" }
36
+ }
37
+ );
38
+ };
39
+ const GET = async () => {
40
+ throw redirect(302, `${base}/`);
41
+ };
42
+
43
+ export { GET, POST };
44
+ //# sourceMappingURL=_server.ts-FEch4V3G.js.map
build/server/chunks/_server.ts-FEch4V3G.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"_server.ts-FEch4V3G.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/_server.ts.js"],"sourcesContent":["import { d as private_env } from \"../../../chunks/shared-server.js\";\nimport { r as redirect } from \"../../../chunks/index.js\";\nimport { b as base } from \"../../../chunks/paths.js\";\nimport { L as LlamaCppService } from \"../../../chunks/LlamaCppService.js\";\nimport { F as FullTextSearchService } from \"../../../chunks/FullTextSearchService.js\";\nconst POST = async ({ locals, request }) => {\n const body = await request.json();\n let prompt = body.user_query;\n let template = body.prompt_template;\n const defaultTemplate = 'Ты бухгалтер. Ты отвечаешь на русском языке. Ты всегда следуешь моим инструкциям.\\n Ты отвечаешь на вопросы клиентов. Чтобы ответить, ты обязательно используешь только \"источники\", которые я тебе предоставляю. Ты используешь только официально-деловой стиль и необходимую терминологию. Соблюдай этические нормы. \\nПри ответе на вопрос ты используешь только такой формат ответа:\\n 1) Четкий и краткий ответ на поставленный вопрос. Ты можешь начать свой ответ так: \"По Вашему вопросу сообщаем...\". Используй по возможности слова: да, можно, нет, нельзя.\\n 2) Обоснование (ты используешь для обоснования \"источники\". Ты используешь только \"источники\" для поиска необходимых \"законов\", \"статей\", \"пунктов\" и \"подпунктов\" для ответа на вопрос пользователя).\\n 3) Аргументация (Ты используешь только \"источники\" для поиска необходимых \"писем\" и \"судебных решений\", чтобы аргументировать свой ответ).\"\\n 4) Заключение (ты подводишь итоги всего, что сказал выше. Избегай повторения и сложных конструкций). Если в источниках нельзя найти подходящую информацию для ответа, ты отвечаешь так: \"Мы не можем ответить на данный вопрос. Обратитесь к специалисту.\"\\n Вопрос: {{ВОПРОС}} \\nИсточники: {{ИСТОЧНИКИ}}';\n if (!template) {\n template = defaultTemplate;\n }\n const abortController = new AbortController();\n let service = new FullTextSearchService(private_env.SEARCH_API_URL);\n let results = await service.search(prompt, { abortController });\n function searchResultsToLlmSources(input) {\n return input.map(({ title, text }) => `${title}\n${text}`).join(\"\\n\\n\");\n }\n const userPrompt = template.replace(\"{{ВОПРОС}}\", prompt).replace(\"{{ИСТОЧНИКИ}}\", searchResultsToLlmSources(results));\n let llmService = new LlamaCppService(private_env.LLM_API_URL);\n let llmGenerator = await llmService.predict(userPrompt, { abortController });\n let response = \"\";\n for await (const output of await llmGenerator({ prompt: userPrompt })) {\n response += output.token.text;\n }\n return new Response(\n JSON.stringify({ response, search_results: results }),\n {\n headers: { \"Content-Type\": \"application/json\" }\n }\n );\n};\nconst GET = async () => {\n throw redirect(302, `${base}/`);\n};\nexport {\n GET,\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;AAKK,MAAC,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK;AAC5C,EAAE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACpC,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;AAC/B,EAAE,IAAI,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC;AACtC,EAAE,MAAM,eAAe,GAAG,6qCAA6qC,CAAC;AACxsC,EAAE,IAAI,CAAC,QAAQ,EAAE;AACjB,IAAI,QAAQ,GAAG,eAAe,CAAC;AAC/B,GAAG;AACH,EAAE,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAChD,EAAE,IAAI,OAAO,GAAG,IAAI,qBAAqB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;AACtE,EAAE,IAAI,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;AAClE,EAAE,SAAS,yBAAyB,CAAC,KAAK,EAAE;AAC5C,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC;AACnD,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvB,GAAG;AACH,EAAE,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC,CAAC;AACzH,EAAE,IAAI,UAAU,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAChE,EAAE,IAAI,YAAY,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;AAC/E,EAAE,IAAI,QAAQ,GAAG,EAAE,CAAC;AACpB,EAAE,WAAW,MAAM,MAAM,IAAI,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE;AACzE,IAAI,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;AAClC,GAAG;AACH,EAAE,OAAO,IAAI,QAAQ;AACrB,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC;AACzD,IAAI;AACJ,MAAM,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;AACrD,KAAK;AACL,GAAG,CAAC;AACJ,EAAE;AACG,MAAC,GAAG,GAAG,YAAY;AACxB,EAAE,MAAM,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC;;;;"}
build/server/chunks/_server.ts-YFmGk0Au.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { d as private_env } from './shared-server-49TKSBDM.js';
2
+ import { L as LlamaCppService } from './LlamaCppService-XtF0SQo9.js';
3
+ import 'fs';
4
+ import 'path';
5
+ import 'node:dns';
6
+
7
+ const GET = async () => {
8
+ let llmService = new LlamaCppService(private_env.LLM_API_URL);
9
+ let response = await llmService.health();
10
+ return new Response(
11
+ JSON.stringify({ status: response }),
12
+ {
13
+ headers: { "Content-Type": "application/json" }
14
+ }
15
+ );
16
+ };
17
+
18
+ export { GET };
19
+ //# sourceMappingURL=_server.ts-YFmGk0Au.js.map
build/server/chunks/_server.ts-YFmGk0Au.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"_server.ts-YFmGk0Au.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/llm/health/_server.ts.js"],"sourcesContent":["import { d as private_env } from \"../../../../chunks/shared-server.js\";\nimport { L as LlamaCppService } from \"../../../../chunks/LlamaCppService.js\";\nconst GET = async () => {\n let llmService = new LlamaCppService(private_env.LLM_API_URL);\n let response = await llmService.health();\n return new Response(\n JSON.stringify({ status: response }),\n {\n headers: { \"Content-Type\": \"application/json\" }\n }\n );\n};\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;;;AAEK,MAAC,GAAG,GAAG,YAAY;AACxB,EAAE,IAAI,UAAU,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAChE,EAAE,IAAI,QAAQ,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;AAC3C,EAAE,OAAO,IAAI,QAAQ;AACrB,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACxC,IAAI;AACJ,MAAM,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;AACrD,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
build/server/chunks/_server.ts-dKSZf0JA.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { d as private_env } from './shared-server-49TKSBDM.js';
2
+ import { c as redirect, b as base } from './index-JNnR1J8_.js';
3
+ import { L as LlamaCppService } from './LlamaCppService-XtF0SQo9.js';
4
+ import 'fs';
5
+ import 'path';
6
+ import 'node:dns';
7
+
8
+ const POST = async ({ locals, request }) => {
9
+ const body = await request.json();
10
+ const abortController = new AbortController();
11
+ let llmService = new LlamaCppService(private_env.LLM_API_URL);
12
+ let llmGenerator = await llmService.conversation(body.history, { abortController });
13
+ const stream = new ReadableStream({
14
+ async start(controller) {
15
+ try {
16
+ for await (const output of await llmGenerator({ history: body.history })) {
17
+ controller.enqueue(output.token.text);
18
+ }
19
+ } catch (error2) {
20
+ if (error2.name === "AbortError") {
21
+ console.log("Request was aborted during LLMServer prediction.");
22
+ } else {
23
+ console.error("Error during LLMServer prediction:", error2);
24
+ }
25
+ }
26
+ controller.close();
27
+ },
28
+ cancel() {
29
+ console.log("ReadableStream canceled and aborted");
30
+ abortController.abort();
31
+ }
32
+ });
33
+ return new Response(stream, {
34
+ headers: {
35
+ "content-type": "text/event-stream"
36
+ }
37
+ });
38
+ };
39
+ const GET = async () => {
40
+ throw redirect(302, `${base}/`);
41
+ };
42
+
43
+ export { GET, POST };
44
+ //# sourceMappingURL=_server.ts-dKSZf0JA.js.map
build/server/chunks/_server.ts-dKSZf0JA.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"_server.ts-dKSZf0JA.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/llm/chat/_server.ts.js"],"sourcesContent":["import { d as private_env } from \"../../../../chunks/shared-server.js\";\nimport { r as redirect } from \"../../../../chunks/index.js\";\nimport { b as base } from \"../../../../chunks/paths.js\";\nimport { L as LlamaCppService } from \"../../../../chunks/LlamaCppService.js\";\nconst POST = async ({ locals, request }) => {\n const body = await request.json();\n const abortController = new AbortController();\n let llmService = new LlamaCppService(private_env.LLM_API_URL);\n let llmGenerator = await llmService.conversation(body.history, { abortController });\n const stream = new ReadableStream({\n async start(controller) {\n try {\n for await (const output of await llmGenerator({ history: body.history })) {\n controller.enqueue(output.token.text);\n }\n } catch (error2) {\n if (error2.name === \"AbortError\") {\n console.log(\"Request was aborted during LLMServer prediction.\");\n } else {\n console.error(\"Error during LLMServer prediction:\", error2);\n }\n }\n controller.close();\n },\n cancel() {\n console.log(\"ReadableStream canceled and aborted\");\n abortController.abort();\n }\n });\n return new Response(stream, {\n headers: {\n \"content-type\": \"text/event-stream\"\n }\n });\n};\nconst GET = async () => {\n throw redirect(302, `${base}/`);\n};\nexport {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AAM,EAAE;AAC9B,IAAI,OAAO,EAAE;AACb,MAAM,cAAc,EAAE,mBAAmB;AACzC,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE;AACG,MAAC,GAAG,GAAG,YAAY;AACxB,EAAE,MAAM,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC;;;;"}
build/server/chunks/_server.ts-qLni9m0O.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { L as LogService } from './LogService-b0lb4PC5.js';
2
+ import 'fs';
3
+ import 'path';
4
+ import 'util';
5
+ import 'date-fns';
6
+ import 'mongoose';
7
+ import 'exceljs';
8
+ import './shared-server-49TKSBDM.js';
9
+ import './constants-jjpZ8eI6.js';
10
+
11
+ const logService = new LogService();
12
+ const GET = async ({ url }) => {
13
+ try {
14
+ const dateFrom = url.searchParams.get("dateFrom");
15
+ const dateTo = url.searchParams.get("dateTo");
16
+ const dateFromObj = dateFrom ? new Date(dateFrom) : void 0;
17
+ const dateToObj = dateTo ? new Date(dateTo) : void 0;
18
+ await logService.export("json", dateFromObj, dateToObj);
19
+ return new Response(JSON.stringify({ message: "Logs exported to JSON successfully" }), {
20
+ status: 200,
21
+ headers: { "Content-Type": "application/json" }
22
+ });
23
+ } catch (error) {
24
+ console.error("Error while exporting logs to JSON:", error);
25
+ return new Response(JSON.stringify({ message: "Failed to export logs to JSON" }), {
26
+ status: 500,
27
+ headers: { "Content-Type": "application/json" }
28
+ });
29
+ }
30
+ };
31
+
32
+ export { GET };
33
+ //# sourceMappingURL=_server.ts-qLni9m0O.js.map