signetai 0.1.39 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/_app/immutable/chunks/C9FD_pC3.js +1 -0
- package/dashboard/_app/immutable/entry/{app.bCGJbnk-.js → app.u5D2o8BP.js} +2 -2
- package/dashboard/_app/immutable/entry/start.BstSDH3K.js +1 -0
- package/dashboard/_app/immutable/nodes/{1.Tw5oc7Pd.js → 1.DXtushKE.js} +1 -1
- package/dashboard/_app/version.json +1 -1
- package/dashboard/index.html +6 -6
- package/dist/daemon.js +438 -78
- package/package.json +1 -1
- package/dashboard/_app/immutable/chunks/IcmhVATd.js +0 -1
- package/dashboard/_app/immutable/entry/start.DpPxlRmT.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b8 as he,b9 as mt,aK as A,L as U,ay as T,aJ as te,ba as _t}from"./C6xDG81H.js";import{o as qe}from"./DehrdN04.js";const V=[];function Se(e,t=he){let n=null;const r=new Set;function a(o){if(mt(e,o)&&(e=o,n)){const c=!V.length;for(const l of r)l[1](),V.push(l,e);if(c){for(let l=0;l<V.length;l+=2)V[l][0](V[l+1]);V.length=0}}}function i(o){a(o(e))}function s(o,c=he){const l=[o,c];return r.add(l),r.size===1&&(n=t(a,i)||he),o(e),()=>{r.delete(l),r.size===0&&n&&(n(),n=null)}}return{set:a,update:i,subscribe:s}}class Ee{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 Re{constructor(t,n){this.status=t,this.location=n}}class xe extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function wt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function yt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function pe({href:e}){return e.split("#")[0]}function bt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(l,...d)=>(n(l),s[o](l,...d));t();const c=Reflect.get(s,o);return typeof c=="function"?c.bind(s):c}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function kt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function St(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Et=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Le(e)),Et(e,t));const G=new Map;function Rt(e,t){const n=Le(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&G.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=St(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function xt(e,t,n){if(G.size>0){const r=Le(e,n),a=G.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);G.delete(r)}}return window.fetch(t,n)}function Le(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${kt(...a)}"]`}return r}const Lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function At(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Tt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return ge(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return ge(String.fromCharCode(...c.slice(2).split("-").map(w=>parseInt(w,16))));const d=Lt.exec(c),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?l===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ge(c)}).join("")}).join("")}/?$`),params:t}}function Ut(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Tt(e){return e.slice(1).split("/").filter(Ut)}function Pt(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const c=t[o];let l=a[o-s];if(c.chained&&c.rest&&s&&(l=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),l===void 0)if(c.rest)l="";else continue;if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&c.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(c.optional&&c.chained){s++;continue}return}if(!s)return r}function ge(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function It({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,l,d]])=>{const{pattern:p,params:f}=At(o),u={id:o,exec:h=>{const w=p.exec(h);if(w)return Pt(w,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...l||[]].map(s),leaf:i(c)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function He(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function De(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1cjpcza?.base??"",Ot=globalThis.__sveltekit_1cjpcza?.assets??x??"",$t="1771411631298",Je="sveltekit:snapshot",We="sveltekit:scroll",Ye="sveltekit:states",Ct="sveltekit:pageurl",K="sveltekit:history",H="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Ae=location.origin;function Xe(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 q(){return{x:pageXOffset,y:pageYOffset}}function z(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ze(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function we(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ue(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===Ae&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function ne(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=z(o,"preload-code")),a===null&&(a=z(o,"preload-data")),t===null&&(t=z(o,"keepfocus")),n===null&&(n=z(o,"noscroll")),i===null&&(i=z(o,"reload")),s===null&&(s=z(o,"replacestate")),o=Qe(o);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(i),replace_state:c(s)}}function ze(e){const t=Se(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&s(o=c)})}return{notify:r,set:a,subscribe:i}}const et={v:()=>{}};function jt(){const{set:e,subscribe:t}=Se(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ot}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==$t;return s&&(e(!0),et.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ue(e,t,n){return e.origin!==Ae||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function fn(e){}const tt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...tt];const Nt=new Set([...tt]);[...Nt];function qt(e){return e.filter(t=>t!=null)}function Ue(e){return e instanceof Ee||e instanceof xe?e.status:500}function Dt(e){return e instanceof xe?e.text:"Internal Error"}let k,J,me;const Vt=qe.toString().includes("$$")||/function \w+\(\) \{\}/.test(qe.toString());Vt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},me={current:!1}):(k=new class{#e=A({});get data(){return U(this.#e)}set data(t){T(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){T(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){T(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){T(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){T(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){T(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){T(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){T(this.#i,t)}},J=new class{#e=A(null);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},me=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},et.v=()=>me.current=!0);function zt(e){Object.assign(k,e)}const Ke={spanContext(){return Kt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Kt={traceId:"",spanId:"",traceFlags:0},Bt=new Set(["icon","shortcut icon","apple-touch-icon"]),C=He(We)??{},W=He(Je)??{},$={url:ze({}),page:ze({}),navigating:Se(null),updated:jt()};function Te(e){C[e]=q()}function Ft(e,t){let n=e+1;for(;C[n];)delete C[n],n+=1;for(n=t+1;W[n];)delete W[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function nt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Be(){}let Pe,ve,re,P,ye,v;const ae=[],oe=[];let L=null;function be(){L?.fork?.then(e=>e?.discard()),L=null}const ee=new Map,rt=new Set,Gt=new Set,M=new Set;let _={branch:[],error:null,url:null},at=!1,se=!1,Fe=!0,X=!1,F=!1,ot=!1,Ie=!1,st,y,R,N;const ie=new Set,Ge=new Map;async function gn(e,t,n){globalThis.__sveltekit_1cjpcza?.data&&globalThis.__sveltekit_1cjpcza.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Pe=It(e),P=document.documentElement,ye=t,ve=e.nodes[0],re=e.nodes[1],ve(),re(),y=history.state?.[K],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[K]:y,[H]:R},""));const r=C[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await an(ye,n)):(await B({type:"enter",url:Xe(v.hash?cn(new URL(location.href)):location.href),replace_state:!0}),a()),rn()}function Mt(){ae.length=0,Ie=!1}function it(e){oe.some(t=>t?.snapshot)&&(W[e]=oe.map(t=>t?.snapshot?.capture()))}function ct(e){W[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function Me(){Te(y),De(We,C),it(R),De(Je,W)}async function Ht(e,t,n,r){let a;t.invalidateAll&&be(),await B({type:"goto",url:Xe(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ie=!0,a=[...Ge.keys()]),t.invalidate&&t.invalidate.forEach(nn)}}),t.invalidateAll&&te().then(te).then(()=>{Ge.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Jt(e){if(e.id!==L?.id){be();const t={};ie.add(t),L={id:e.id,token:t,promise:ft({...e,preload:t}).then(n=>(ie.delete(t),n.type==="loaded"&&n.state.error&&be(),n)),fork:null}}return L.promise}async function _e(e){const t=(await fe(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}async function lt(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(k,e.props.page),st=new v.root({target:t,props:{...e.props,stores:$,components:oe},hydrate:n,sync:!1}),await Promise.resolve(),ct(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:C[y]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}se=!0}function ce({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=wt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:qt(n).map(u=>u.node.component),page:Ne(k)}};s!==void 0&&(c.props.form=s);let l={},d=!k,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],w=_.branch[u];h?.data!==w?.data&&(d=!0),h&&(l={...l,...h.data},d&&(c.props[`data_${p}`]=l),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==k.form||d)&&(c.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?l:k.data}),c}async function Oe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!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(...f){for(const u of f){const{href:h}=new URL(u,n);c.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ke,current:Ke},route:new Proxy(a,{get:(f,u)=>(o&&(c.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&c.params.add(u),f[u])}),data:i?.data??null,url:bt(n,()=>{o&&(c.url=!0)},f=>{o&&c.search_params.add(f)},v.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:w}=ut(f,u,n);return o&&d(h.href),w},setHeaders:()=>{},depends:d,parent(){return o&&(c.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await l.universal.load.call(null,p)??null}return{node:l,loader:e,server:i,universal:l.universal?.load?{type:"data",data:s,uses:c}:null,data:s??i?.data??null,slash:l.universal?.trailingSlash??i?.slash}}function ut(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=se?xt(r,a.href,t):Rt(r,t);return{resolved:a,promise:i}}function Wt(e,t,n,r,a,i){if(Ie)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(ae.some(o=>o(new URL(s))))return!0;return!1}function $e(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Yt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Xt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Ne(k),constructors:[]}}}async function ft({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ie.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:c}=a,l=[...o,c];s.forEach(m=>m?.().catch(()=>{})),l.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==le(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Yt(_.url,n);let u=!1;const h=l.map(async(m,g)=>{if(!m)return;const S=_.branch[g];return m[1]===S?.loader&&!Wt(u,p,d,f,S.universal?.uses,r)?S:(u=!0,Oe({loader:m[1],url:n,params:r,route:a,parent:async()=>{const I={};for(let O=0;O<g;O+=1)Object.assign(I,(await h[O])?.data);return I},server_data_node:$e(m[0]?{type:"skip"}:null,m[0]?S?.server:void 0)}))});for(const m of h)m.catch(()=>{});const w=[];for(let m=0;m<l.length;m+=1)if(l[m])try{w.push(await h[m])}catch(g){if(g instanceof Re)return{type:"redirect",location:g.location};if(ie.has(i))return Xt({error:await Q(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let S=Ue(g),E;if(g instanceof Ee)E=g.body;else{if(await $.updated.check())return await nt(),await Y(n);E=await Q(g,{params:r,url:n,route:{id:a.id}})}const I=await Qt(m,w,s);return I?ce({url:n,params:r,branch:w.slice(0,I.idx).concat(I.node),status:S,error:E,route:a}):await ht(n,{id:a.id},E,S)}else w.push(void 0);return ce({url:n,params:r,branch:w,status:200,error:null,route:a,form:t?void 0:null})}async function Qt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Ce({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Oe({loader:ve,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:$e(i)}),o={node:await re(),loader:re,universal:null,server:null,data:null};return ce({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Re)return Ht(new URL(s.location,location.href),{},0);throw s}}async function Zt(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(i,s)=>ut(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);v.hash?i.hash=a:i.pathname=a,a=i}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function fe(e,t){if(e&&!ue(e,x,v.hash)){const n=await Zt(e);if(!n)return;const r=en(n);for(const a of Pe){const i=a.exec(r);if(i)return{id:le(e),invalidating:t,route:a,params:yt(i),url:e}}}}function en(e){return vt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function le(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function dt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=je(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const c={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return X||rt.forEach(l=>l(c)),s?null:o}async function B({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:c={},accept:l=Be,block:d=Be,event:p}){const f=N;N=c;const u=await fe(t,!1),h=e==="enter"?je(_,u,t,e):dt({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),N===c&&(N=f);return}const w=y,m=R;l(),X=!0,se&&h.navigation.type!=="enter"&&$.navigating.set(J.current=h.navigation);let g=u&&await ft(u);if(!g){if(ue(t,x,v.hash))return await Y(t,i);g=await ht(t,{id:null},await Q(new xe(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,N!==c)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await B({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:c}),h.fulfil(void 0);return}g=await Ce({status:500,error:await Q(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await $.updated.check()&&(await nt(),await Y(t,i));if(Mt(),Te(w),it(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const b=i?0:1,Z={[K]:y+=b,[H]:R+=b,[Ye]:s};(i?history.replaceState:history.pushState).call(history,Z,"",t),i||Ft(y,R)}const S=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let E;if(se){const b=(await Promise.all(Array.from(Gt,D=>D(h.navigation)))).filter(D=>typeof D=="function");if(b.length>0){let D=function(){b.forEach(de=>{M.delete(de)})};b.push(D),b.forEach(de=>{M.add(de)})}_=g.state,g.props.page&&(g.props.page.url=t);const Z=S&&await S;Z?E=Z.commit():(st.$set(g.props),zt(g.props.page),E=_t?.()),ot=!0}else await lt(g,ye,!1);const{activeElement:I}=document;await E,await te(),await te();let O=null;if(Fe){const b=n?n.scroll:a?q():null;b?scrollTo(b.x,b.y):(O=t.hash&&document.getElementById(pt(t)))?O.scrollIntoView():scrollTo(0,0)}const gt=document.activeElement!==I&&document.activeElement!==document.body;!r&&!gt&&sn(t,!O),Fe=!0,g.props.page&&Object.assign(k,g.props.page),X=!1,e==="popstate"&&ct(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),M.forEach(b=>b(h.navigation)),$.navigating.set(J.current=null)}async function ht(e,t,n,r,a){return e.origin===Ae&&e.pathname===location.pathname&&!at?await Ce({status:r,error:n,url:e,route:t}):await Y(e,a)}function tn(){let e,t={element:void 0,href:void 0},n;P.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{i(c,j.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],j.tap)}P.addEventListener("mousedown",r),P.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(_e(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function i(o,c){const l=Ze(o,P),d=l===t.element&&l?.href===t.href&&c>=n;if(!l||d)return;const{url:p,external:f,download:u}=we(l,x,v.hash);if(f||u)return;const h=ne(l),w=p&&le(_.url)===le(p);if(!(h.reload||w))if(c<=h.preload_data){t={element:l,href:l.href},n=j.tap;const m=await fe(p,!1);if(!m)return;Jt(m)}else c<=h.preload_code&&(t={element:l,href:l.href},n=c,_e(p))}function s(){a.disconnect();for(const o of P.querySelectorAll("a")){const{url:c,external:l,download:d}=we(o,x,v.hash);if(l||d)continue;const p=ne(o);p.reload||(p.preload_code===j.viewport&&a.observe(o),p.preload_code===j.eager&&_e(c))}}M.add(s),s()}function Q(e,t){if(e instanceof Ee)return e.body;const n=Ue(e),r=Dt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function nn(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function rn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Me(),!X){const r=je(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};rt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Me()}),navigator.connection?.saveData||tn(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Ze(t.composedPath()[0],P);if(!n)return;const{url:r,external:a,target:i,download:s}=we(n,x,v.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=ne(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[l,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=l===pe(location);if(a||o.reload&&(!p||!d)){dt({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(F=!0,Te(y),e(r),!o.replace_state)return;F=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await B({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ue(s,x,!1))return;const o=t.target,c=ne(o);if(c.reload)return;t.preventDefault(),t.stopPropagation();const l=new FormData(o,r);s.search=new URLSearchParams(l).toString(),B({type:"form",url:s,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ke){if(t.state?.[K]){const n=t.state[K];if(N={},n===y)return;const r=C[n],a=t.state[Ye]??{},i=new URL(t.state[Ct]??location.href),s=t.state[H],o=_.url?pe(location)===pe(_.url):!1;if(s===R&&(ot||o)){a!==k.state&&(k.state=a),e(i),C[y]=q(),r&&scrollTo(r.x,r.y),y=n;return}const l=n-y;await B({type:"popstate",url:i,popped:{state:a,scroll:r,delta:l},accept:()=>{y=n,R=s},block:()=>{history.go(-l)},nav_token:N,event:t})}else if(!F){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{F&&(F=!1,history.replaceState({...history.state,[K]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Bt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(J.current=null)});function e(t){_.url=k.url=t,$.page.set(Ne(k)),$.page.notify()}}async function an(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:c}){at=!0;const l=new URL(location.href);let d;({params:a={},route:i={id:null}}=await fe(l,!1)||{}),d=Pe.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(w,m)=>{const g=o[m];return g?.uses&&(g.uses=on(g.uses)),Oe({loader:v.nodes[w],url:l,params:a,route:i,parent:async()=>{const S={};for(let E=0;E<m;E+=1)Object.assign(S,(await u[E]).data);return S},server_data_node:$e(g)})}),h=await Promise.all(u);if(d){const w=d.layouts;for(let m=0;m<w.length;m++)w[m]||h.splice(m,0,void 0)}p=ce({url:l,params:a,branch:h,status:t,error:n,form:c,route:d??null})}catch(u){if(u instanceof Re){await Y(new URL(u.location,location.href));return}p=await Ce({status:Ue(u),error:await Q(u,{url:l,params:a,route:i}),url:l,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await lt(p,e,f)}function on(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??[])}}let ke=!1;function sn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=pt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=q();setTimeout(()=>{const o=history.state;ke=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),ke=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],c=a.getRangeAt(s);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}a.removeAllRanges()}})}}}function je(e,t,n,r,a=null){let i,s;const o=new Promise((l,d)=>{i=l,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function Ne(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function cn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function pt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{gn as a,fn as l,k as p,$ as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.cmrAzbxl.js","../chunks/DFlBg5At.js","../chunks/C6xDG81H.js","../chunks/CQg1Qfc_.js","../assets/0.DYoZYgqy.css","../nodes/1.
|
|
2
|
-
import{i as x,b as T,_ as L}from"../chunks/-omRHn5Q.js";import{h as G,k as q,i as H,E as J,au as K,av as Q,aw as W,L as d,ax as X,ay as S,az as Z,A as p,aA as $,aB as ee,g as te,l as re,aC as ae,aD as se,N as ne,aE as ie,aF as oe,S as ue,aG as N,aH as ce,ak as fe,aI as de,P as _e,I as le,u as me,aJ as ve,j as O,X as he,U as ge,aK as w,V as be,W as Pe,Q as ye,aL as D}from"../chunks/C6xDG81H.js";import{h as Ee,m as Se,u as Re,s as Oe}from"../chunks/B-s6LgGA.js";import{a as P,c as j,f as U,t as Ie}from"../chunks/DFlBg5At.js";import{o as Ae}from"../chunks/DehrdN04.js";import{B as xe}from"../chunks/CQg1Qfc_.js";function B(r,e,s){G&&q();var o=new xe(r);H(()=>{var i=e()??null;o.ensure(i,i&&(t=>s(t,i)))},J)}let I=!1;function Te(r){var e=I;try{return I=!1,[r(),I]}finally{I=e}}function C(r,e,s,o){var i=!re||(s&ae)!==0,t=(s&ee)!==0,n=(s&oe)!==0,u=o,y=!0,E=()=>(y&&(y=!1,u=n?te(o):o),u),m;if(t){var A=ue in r||N in r;m=K(r,e)?.set??(A&&e in r?a=>r[e]=a:void 0)}var g,R=!1;t?[g,R]=Te(()=>r[e]):g=r[e],g===void 0&&o!==void 0&&(g=E(),m&&(i&&Q(),m(g)));var v;if(i?v=()=>{var a=r[e];return a===void 0?E():(y=!0,a)}:v=()=>{var a=r[e];return a!==void 0&&(u=void 0),a===void 0?u:a},i&&(s&W)===0)return v;if(m){var c=r.$$legacy;return(function(a,l){return arguments.length>0?((!i||!l||c||R)&&m(l?v():a),a):v()})}var _=!1,f=((s&se)!==0?ne:ie)(()=>(_=!1,v()));t&&d(f);var b=p;return(function(a,l){if(arguments.length>0){const h=l?d(f):i&&t?X(a):a;return S(f,h),_=!0,u!==void 0&&(u=h),a}return Z&&_||(b.f&$)!==0?f.v:d(f)})}function Le(r){return class extends we{constructor(e){super({component:r,...e})}}}class we{#t;#e;constructor(e){var s=new Map,o=(t,n)=>{var u=de(n,!1,!1);return s.set(t,u),u};const i=new Proxy({...e.props||{},$$events:{}},{get(t,n){return d(s.get(n)??o(n,Reflect.get(t,n)))},has(t,n){return n===N?!0:(d(s.get(n)??o(n,Reflect.get(t,n))),Reflect.has(t,n))},set(t,n,u){return S(s.get(n)??o(n,u),u),Reflect.set(t,n,u)}});this.#e=(e.hydrate?Ee:Se)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&ce(),this.#t=i.$$events;for(const t of Object.keys(this.#e))t==="$set"||t==="$destroy"||t==="$on"||fe(this,t,{get(){return this.#e[t]},set(n){this.#e[t]=n},enumerable:!0});this.#e.$set=t=>{Object.assign(i,t)},this.#e.$destroy=()=>{Re(this.#e)}}$set(e){this.#e.$set(e)}$on(e,s){this.#t[e]=this.#t[e]||[];const o=(...i)=>s.call(this,...i);return this.#t[e].push(o),()=>{this.#t[e]=this.#t[e].filter(i=>i!==o)}}$destroy(){this.#e.$destroy()}}const ze={};var De=U('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),je=U("<!> <!>",1);function Be(r,e){_e(e,!0);let s=C(e,"components",23,()=>[]),o=C(e,"data_0",3,null),i=C(e,"data_1",3,null);le(()=>e.stores.page.set(e.page)),me(()=>{e.stores,e.page,e.constructors,s(),e.form,o(),i(),e.stores.page.notify()});let t=w(!1),n=w(!1),u=w(null);Ae(()=>{const c=e.stores.page.subscribe(()=>{d(t)&&(S(n,!0),ve().then(()=>{S(u,document.title||"untitled page",!0)}))});return S(t,!0),c});const y=D(()=>e.constructors[1]);var E=je(),m=O(E);{var A=c=>{const _=D(()=>e.constructors[0]);var f=j(),b=O(f);B(b,()=>d(_),(a,l)=>{T(l(a,{get data(){return o()},get form(){return e.form},get params(){return e.page.params},children:(h,Me)=>{var M=j(),Y=O(M);B(Y,()=>d(y),(k,F)=>{T(F(k,{get data(){return i()},get form(){return e.form},get params(){return e.page.params}}),z=>s()[1]=z,()=>s()?.[1])}),P(h,M)},$$slots:{default:!0}}),h=>s()[0]=h,()=>s()?.[0])}),P(c,f)},g=c=>{const _=D(()=>e.constructors[0]);var f=j(),b=O(f);B(b,()=>d(_),(a,l)=>{T(l(a,{get data(){return o()},get form(){return e.form},get params(){return e.page.params}}),h=>s()[0]=h,()=>s()?.[0])}),P(c,f)};x(m,c=>{e.constructors[1]?c(A):c(g,!1)})}var R=he(m,2);{var v=c=>{var _=De(),f=be(_);{var b=a=>{var l=Ie();ye(()=>Oe(l,d(u))),P(a,l)};x(f,a=>{d(n)&&a(b)})}Pe(_),P(c,_)};x(R,c=>{d(t)&&c(v)})}P(r,E),ge()}const Ge=Le(Be),qe=[()=>L(()=>import("../nodes/0.cmrAzbxl.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),()=>L(()=>import("../nodes/1.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.cmrAzbxl.js","../chunks/DFlBg5At.js","../chunks/C6xDG81H.js","../chunks/CQg1Qfc_.js","../assets/0.DYoZYgqy.css","../nodes/1.DXtushKE.js","../chunks/B-s6LgGA.js","../chunks/C9FD_pC3.js","../chunks/DehrdN04.js","../nodes/2.CelwqUpj.js","../chunks/Dxi7weHa.js","../chunks/-omRHn5Q.js","../assets/2.Dlk-TDtV.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as x,b as T,_ as L}from"../chunks/-omRHn5Q.js";import{h as G,k as q,i as H,E as J,au as K,av as Q,aw as W,L as d,ax as X,ay as S,az as Z,A as p,aA as $,aB as ee,g as te,l as re,aC as ae,aD as se,N as ne,aE as ie,aF as oe,S as ue,aG as N,aH as ce,ak as fe,aI as de,P as _e,I as le,u as me,aJ as ve,j as O,X as he,U as ge,aK as w,V as be,W as Pe,Q as ye,aL as D}from"../chunks/C6xDG81H.js";import{h as Ee,m as Se,u as Re,s as Oe}from"../chunks/B-s6LgGA.js";import{a as P,c as j,f as U,t as Ie}from"../chunks/DFlBg5At.js";import{o as Ae}from"../chunks/DehrdN04.js";import{B as xe}from"../chunks/CQg1Qfc_.js";function B(r,e,s){G&&q();var o=new xe(r);H(()=>{var i=e()??null;o.ensure(i,i&&(t=>s(t,i)))},J)}let I=!1;function Te(r){var e=I;try{return I=!1,[r(),I]}finally{I=e}}function C(r,e,s,o){var i=!re||(s&ae)!==0,t=(s&ee)!==0,n=(s&oe)!==0,u=o,y=!0,E=()=>(y&&(y=!1,u=n?te(o):o),u),m;if(t){var A=ue in r||N in r;m=K(r,e)?.set??(A&&e in r?a=>r[e]=a:void 0)}var g,R=!1;t?[g,R]=Te(()=>r[e]):g=r[e],g===void 0&&o!==void 0&&(g=E(),m&&(i&&Q(),m(g)));var v;if(i?v=()=>{var a=r[e];return a===void 0?E():(y=!0,a)}:v=()=>{var a=r[e];return a!==void 0&&(u=void 0),a===void 0?u:a},i&&(s&W)===0)return v;if(m){var c=r.$$legacy;return(function(a,l){return arguments.length>0?((!i||!l||c||R)&&m(l?v():a),a):v()})}var _=!1,f=((s&se)!==0?ne:ie)(()=>(_=!1,v()));t&&d(f);var b=p;return(function(a,l){if(arguments.length>0){const h=l?d(f):i&&t?X(a):a;return S(f,h),_=!0,u!==void 0&&(u=h),a}return Z&&_||(b.f&$)!==0?f.v:d(f)})}function Le(r){return class extends we{constructor(e){super({component:r,...e})}}}class we{#t;#e;constructor(e){var s=new Map,o=(t,n)=>{var u=de(n,!1,!1);return s.set(t,u),u};const i=new Proxy({...e.props||{},$$events:{}},{get(t,n){return d(s.get(n)??o(n,Reflect.get(t,n)))},has(t,n){return n===N?!0:(d(s.get(n)??o(n,Reflect.get(t,n))),Reflect.has(t,n))},set(t,n,u){return S(s.get(n)??o(n,u),u),Reflect.set(t,n,u)}});this.#e=(e.hydrate?Ee:Se)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&ce(),this.#t=i.$$events;for(const t of Object.keys(this.#e))t==="$set"||t==="$destroy"||t==="$on"||fe(this,t,{get(){return this.#e[t]},set(n){this.#e[t]=n},enumerable:!0});this.#e.$set=t=>{Object.assign(i,t)},this.#e.$destroy=()=>{Re(this.#e)}}$set(e){this.#e.$set(e)}$on(e,s){this.#t[e]=this.#t[e]||[];const o=(...i)=>s.call(this,...i);return this.#t[e].push(o),()=>{this.#t[e]=this.#t[e].filter(i=>i!==o)}}$destroy(){this.#e.$destroy()}}const ze={};var De=U('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),je=U("<!> <!>",1);function Be(r,e){_e(e,!0);let s=C(e,"components",23,()=>[]),o=C(e,"data_0",3,null),i=C(e,"data_1",3,null);le(()=>e.stores.page.set(e.page)),me(()=>{e.stores,e.page,e.constructors,s(),e.form,o(),i(),e.stores.page.notify()});let t=w(!1),n=w(!1),u=w(null);Ae(()=>{const c=e.stores.page.subscribe(()=>{d(t)&&(S(n,!0),ve().then(()=>{S(u,document.title||"untitled page",!0)}))});return S(t,!0),c});const y=D(()=>e.constructors[1]);var E=je(),m=O(E);{var A=c=>{const _=D(()=>e.constructors[0]);var f=j(),b=O(f);B(b,()=>d(_),(a,l)=>{T(l(a,{get data(){return o()},get form(){return e.form},get params(){return e.page.params},children:(h,Me)=>{var M=j(),Y=O(M);B(Y,()=>d(y),(k,F)=>{T(F(k,{get data(){return i()},get form(){return e.form},get params(){return e.page.params}}),z=>s()[1]=z,()=>s()?.[1])}),P(h,M)},$$slots:{default:!0}}),h=>s()[0]=h,()=>s()?.[0])}),P(c,f)},g=c=>{const _=D(()=>e.constructors[0]);var f=j(),b=O(f);B(b,()=>d(_),(a,l)=>{T(l(a,{get data(){return o()},get form(){return e.form},get params(){return e.page.params}}),h=>s()[0]=h,()=>s()?.[0])}),P(c,f)};x(m,c=>{e.constructors[1]?c(A):c(g,!1)})}var R=he(m,2);{var v=c=>{var _=De(),f=be(_);{var b=a=>{var l=Ie();ye(()=>Oe(l,d(u))),P(a,l)};x(f,a=>{d(n)&&a(b)})}Pe(_),P(c,_)};x(R,c=>{d(t)&&c(v)})}P(r,E),ge()}const Ge=Le(Be),qe=[()=>L(()=>import("../nodes/0.cmrAzbxl.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),()=>L(()=>import("../nodes/1.DXtushKE.js"),__vite__mapDeps([5,1,2,6,7,8]),import.meta.url),()=>L(()=>import("../nodes/2.CelwqUpj.js"),__vite__mapDeps([9,10,11,2,3,1,6,12]),import.meta.url)],He=[],Je={"/":[2]},V={handleError:(({error:r})=>{console.error(r)}),reroute:(()=>{}),transport:{}},Ce=Object.fromEntries(Object.entries(V.transport).map(([r,e])=>[r,e.decode])),Ke=Object.fromEntries(Object.entries(V.transport).map(([r,e])=>[r,e.encode])),Qe=!1,We=(r,e)=>Ce[r](e);export{We as decode,Ce as decoders,Je as dictionary,Ke as encoders,Qe as hash,V as hooks,ze as matchers,qe as nodes,Ge as root,He as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/C9FD_pC3.js";export{o as load_css,r as start};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,f as k}from"../chunks/DFlBg5At.js";import{f as x,I as y,u as i,g as $,J as l,K as j,L as v,M as E,N as I,O as J,P as K,j as L,Q as M,U as N,V as u,W as m,X as O}from"../chunks/C6xDG81H.js";import{s as g}from"../chunks/B-s6LgGA.js";import{s as P,p as _}from"../chunks/
|
|
1
|
+
import{a as b,f as k}from"../chunks/DFlBg5At.js";import{f as x,I as y,u as i,g as $,J as l,K as j,L as v,M as E,N as I,O as J,P as K,j as L,Q as M,U as N,V as u,W as m,X as O}from"../chunks/C6xDG81H.js";import{s as g}from"../chunks/B-s6LgGA.js";import{s as P,p as _}from"../chunks/C9FD_pC3.js";function Q(a=!1){const t=x,e=t.l.u;if(!e)return;let r=()=>E(t.s);if(a){let o=0,s={};const f=I(()=>{let p=!1;const c=t.s;for(const n in c)c[n]!==s[n]&&(s[n]=c[n],p=!0);return p&&o++,o});r=()=>v(f)}e.b.length&&y(()=>{d(t,r),l(e.b)}),i(()=>{const o=$(()=>e.m.map(j));return()=>{for(const s of o)typeof s=="function"&&s()}}),e.a.length&&i(()=>{d(t,r),l(e.a)})}function d(a,t){if(a.l.s)for(const e of a.l.s)v(e);t()}J();const U={get error(){return _.error},get status(){return _.status}};P.updated.check;const h=U;var V=k("<h1> </h1> <p> </p>",1);function z(a,t){K(t,!1),Q();var e=V(),r=L(e),o=u(r,!0);m(r);var s=O(r,2),f=u(s,!0);m(s),M(()=>{g(o,h.status),g(f,h.error?.message)}),b(a,e),N()}export{z as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1771411631298"}
|
package/dashboard/index.html
CHANGED
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
document.documentElement.dataset.theme = t;
|
|
18
18
|
})();
|
|
19
19
|
</script>
|
|
20
|
-
<link href="/_app/immutable/entry/start.
|
|
21
|
-
<link href="/_app/immutable/chunks/
|
|
20
|
+
<link href="/_app/immutable/entry/start.BstSDH3K.js" rel="modulepreload">
|
|
21
|
+
<link href="/_app/immutable/chunks/C9FD_pC3.js" rel="modulepreload">
|
|
22
22
|
<link href="/_app/immutable/chunks/C6xDG81H.js" rel="modulepreload">
|
|
23
23
|
<link href="/_app/immutable/chunks/DehrdN04.js" rel="modulepreload">
|
|
24
|
-
<link href="/_app/immutable/entry/app.
|
|
24
|
+
<link href="/_app/immutable/entry/app.u5D2o8BP.js" rel="modulepreload">
|
|
25
25
|
<link href="/_app/immutable/chunks/-omRHn5Q.js" rel="modulepreload">
|
|
26
26
|
<link href="/_app/immutable/chunks/CQg1Qfc_.js" rel="modulepreload">
|
|
27
27
|
<link href="/_app/immutable/chunks/B-s6LgGA.js" rel="modulepreload">
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
<div style="display: contents">
|
|
33
33
|
<script>
|
|
34
34
|
{
|
|
35
|
-
|
|
35
|
+
__sveltekit_1cjpcza = {
|
|
36
36
|
base: ""
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const element = document.currentScript.parentElement;
|
|
40
40
|
|
|
41
41
|
Promise.all([
|
|
42
|
-
import("/_app/immutable/entry/start.
|
|
43
|
-
import("/_app/immutable/entry/app.
|
|
42
|
+
import("/_app/immutable/entry/start.BstSDH3K.js"),
|
|
43
|
+
import("/_app/immutable/entry/app.u5D2o8BP.js")
|
|
44
44
|
]).then(([kit, app]) => {
|
|
45
45
|
kit.start(app, element);
|
|
46
46
|
});
|
package/dist/daemon.js
CHANGED
|
@@ -4169,7 +4169,7 @@ class Logger extends EventEmitter2 {
|
|
|
4169
4169
|
var logger = new Logger;
|
|
4170
4170
|
|
|
4171
4171
|
// ../daemon/src/daemon.ts
|
|
4172
|
-
import { join as join7, dirname as dirname3 } from "path";
|
|
4172
|
+
import { join as join7, dirname as dirname3, basename as basename3 } from "path";
|
|
4173
4173
|
import { homedir as homedir4 } from "os";
|
|
4174
4174
|
import {
|
|
4175
4175
|
writeFileSync as writeFileSync2,
|
|
@@ -12811,7 +12811,7 @@ function loadGitConfig() {
|
|
|
12811
12811
|
const defaults = {
|
|
12812
12812
|
enabled: true,
|
|
12813
12813
|
autoCommit: true,
|
|
12814
|
-
autoSync:
|
|
12814
|
+
autoSync: true,
|
|
12815
12815
|
syncInterval: 300,
|
|
12816
12816
|
remote: "origin",
|
|
12817
12817
|
branch: "main"
|
|
@@ -12852,41 +12852,131 @@ var gitSyncInProgress = false;
|
|
|
12852
12852
|
function isGitRepo(dir) {
|
|
12853
12853
|
return existsSync5(join7(dir, ".git"));
|
|
12854
12854
|
}
|
|
12855
|
-
async function
|
|
12856
|
-
const token = await getSecret("GITHUB_TOKEN");
|
|
12857
|
-
if (!token) {
|
|
12858
|
-
logger.warn("git", "GITHUB_TOKEN not found in secrets - remote sync disabled");
|
|
12859
|
-
return null;
|
|
12860
|
-
}
|
|
12855
|
+
async function runCommand(cmd, args, options) {
|
|
12861
12856
|
return new Promise((resolve3) => {
|
|
12862
|
-
const proc = spawn2(
|
|
12863
|
-
let
|
|
12857
|
+
const proc = spawn2(cmd, args, { stdio: "pipe" });
|
|
12858
|
+
let stdout = "";
|
|
12859
|
+
let stderr = "";
|
|
12860
|
+
if (options?.input) {
|
|
12861
|
+
proc.stdin?.write(options.input);
|
|
12862
|
+
proc.stdin?.end();
|
|
12863
|
+
}
|
|
12864
12864
|
proc.stdout?.on("data", (d2) => {
|
|
12865
|
-
|
|
12865
|
+
stdout += d2.toString();
|
|
12866
|
+
});
|
|
12867
|
+
proc.stderr?.on("data", (d2) => {
|
|
12868
|
+
stderr += d2.toString();
|
|
12866
12869
|
});
|
|
12867
12870
|
proc.on("close", (code) => {
|
|
12868
|
-
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
}
|
|
12872
|
-
url = url.trim();
|
|
12873
|
-
if (url.startsWith("git@github.com:")) {
|
|
12874
|
-
url = url.replace("git@github.com:", "https://github.com/");
|
|
12875
|
-
}
|
|
12876
|
-
if (url.startsWith("https://github.com/")) {
|
|
12877
|
-
url = url.replace("https://github.com/", `https://${token}@github.com/`);
|
|
12878
|
-
resolve3(url);
|
|
12879
|
-
} else if (url.startsWith("https://") && url.includes("github.com")) {
|
|
12880
|
-
url = url.replace(/https:\/\/([^@]+@)?github\.com/, `https://${token}@github.com`);
|
|
12881
|
-
resolve3(url);
|
|
12882
|
-
} else {
|
|
12883
|
-
logger.warn("git", `Unsupported remote URL format: ${url}`);
|
|
12884
|
-
resolve3(null);
|
|
12885
|
-
}
|
|
12871
|
+
resolve3({ stdout, stderr, code: code ?? 1 });
|
|
12872
|
+
});
|
|
12873
|
+
proc.on("error", () => {
|
|
12874
|
+
resolve3({ stdout: "", stderr: "", code: 1 });
|
|
12886
12875
|
});
|
|
12887
|
-
proc.on("error", () => resolve3(null));
|
|
12888
12876
|
});
|
|
12889
12877
|
}
|
|
12878
|
+
async function getRemoteUrl(dir, remote) {
|
|
12879
|
+
const result = await runCommand("git", ["remote", "get-url", remote]);
|
|
12880
|
+
return result.code === 0 ? result.stdout.trim() : null;
|
|
12881
|
+
}
|
|
12882
|
+
function buildAuthUrlFromToken(baseUrl, token) {
|
|
12883
|
+
let url = baseUrl;
|
|
12884
|
+
if (url.startsWith("git@github.com:")) {
|
|
12885
|
+
url = url.replace("git@github.com:", "https://github.com/");
|
|
12886
|
+
}
|
|
12887
|
+
if (url.startsWith("https://github.com/")) {
|
|
12888
|
+
return url.replace("https://github.com/", `https://${token}@github.com/`);
|
|
12889
|
+
} else if (url.startsWith("https://") && url.includes("github.com")) {
|
|
12890
|
+
return url.replace(/https:\/\/([^@]+@)?github\.com/, `https://${token}@github.com`);
|
|
12891
|
+
}
|
|
12892
|
+
return url;
|
|
12893
|
+
}
|
|
12894
|
+
function buildAuthUrlFromCreds(baseUrl, creds) {
|
|
12895
|
+
let url = baseUrl;
|
|
12896
|
+
if (url.startsWith("git@github.com:")) {
|
|
12897
|
+
url = url.replace("git@github.com:", "https://github.com/");
|
|
12898
|
+
}
|
|
12899
|
+
url = url.replace(/https:\/\/[^@]+@/, "https://");
|
|
12900
|
+
return url.replace("https://", `https://${encodeURIComponent(creds.username)}:${encodeURIComponent(creds.password)}@`);
|
|
12901
|
+
}
|
|
12902
|
+
async function getCredentialHelperToken(url) {
|
|
12903
|
+
try {
|
|
12904
|
+
const urlObj = new URL(url);
|
|
12905
|
+
const input = `protocol=${urlObj.protocol.replace(":", "")}
|
|
12906
|
+
host=${urlObj.host}
|
|
12907
|
+
|
|
12908
|
+
`;
|
|
12909
|
+
const result = await runCommand("git", ["credential", "fill"], { input });
|
|
12910
|
+
if (result.code !== 0)
|
|
12911
|
+
return null;
|
|
12912
|
+
const lines = result.stdout.split(`
|
|
12913
|
+
`);
|
|
12914
|
+
const username = lines.find((l2) => l2.startsWith("username="))?.slice(9);
|
|
12915
|
+
const password = lines.find((l2) => l2.startsWith("password="))?.slice(9);
|
|
12916
|
+
return username && password ? { username, password } : null;
|
|
12917
|
+
} catch {
|
|
12918
|
+
return null;
|
|
12919
|
+
}
|
|
12920
|
+
}
|
|
12921
|
+
async function getGhCliToken() {
|
|
12922
|
+
try {
|
|
12923
|
+
const result = await runCommand("gh", ["auth", "token"]);
|
|
12924
|
+
return result.code === 0 ? result.stdout.trim() : null;
|
|
12925
|
+
} catch {
|
|
12926
|
+
return null;
|
|
12927
|
+
}
|
|
12928
|
+
}
|
|
12929
|
+
async function hasAnyGitCredentials() {
|
|
12930
|
+
if (await hasSecret("GITHUB_TOKEN"))
|
|
12931
|
+
return true;
|
|
12932
|
+
if (await getGhCliToken())
|
|
12933
|
+
return true;
|
|
12934
|
+
if (isGitRepo(AGENTS_DIR3)) {
|
|
12935
|
+
const remoteUrl = await getRemoteUrl(AGENTS_DIR3, gitConfig.remote);
|
|
12936
|
+
if (remoteUrl?.startsWith("git@"))
|
|
12937
|
+
return true;
|
|
12938
|
+
if (remoteUrl?.startsWith("https://")) {
|
|
12939
|
+
const creds = await getCredentialHelperToken(remoteUrl);
|
|
12940
|
+
if (creds)
|
|
12941
|
+
return true;
|
|
12942
|
+
}
|
|
12943
|
+
}
|
|
12944
|
+
return false;
|
|
12945
|
+
}
|
|
12946
|
+
async function resolveGitCredentials(dir, remote) {
|
|
12947
|
+
const remoteUrl = await getRemoteUrl(dir, remote);
|
|
12948
|
+
if (!remoteUrl) {
|
|
12949
|
+
return { method: "none" };
|
|
12950
|
+
}
|
|
12951
|
+
try {
|
|
12952
|
+
const token = await getSecret("GITHUB_TOKEN");
|
|
12953
|
+
if (token) {
|
|
12954
|
+
logger.debug("git", "Using stored GITHUB_TOKEN for authentication");
|
|
12955
|
+
return { method: "token", authUrl: buildAuthUrlFromToken(remoteUrl, token) };
|
|
12956
|
+
}
|
|
12957
|
+
} catch {}
|
|
12958
|
+
try {
|
|
12959
|
+
const ghToken = await getGhCliToken();
|
|
12960
|
+
if (ghToken) {
|
|
12961
|
+
logger.debug("git", "Using gh CLI token for authentication");
|
|
12962
|
+
return { method: "gh", authUrl: buildAuthUrlFromToken(remoteUrl, ghToken) };
|
|
12963
|
+
}
|
|
12964
|
+
} catch {}
|
|
12965
|
+
if (remoteUrl.startsWith("git@")) {
|
|
12966
|
+
logger.debug("git", "Using SSH for authentication");
|
|
12967
|
+
return { method: "ssh", usePlainGit: true };
|
|
12968
|
+
}
|
|
12969
|
+
if (remoteUrl.startsWith("https://")) {
|
|
12970
|
+
try {
|
|
12971
|
+
const creds = await getCredentialHelperToken(remoteUrl);
|
|
12972
|
+
if (creds) {
|
|
12973
|
+
logger.debug("git", "Using git credential helper for authentication");
|
|
12974
|
+
return { method: "credential-helper", authUrl: buildAuthUrlFromCreds(remoteUrl, creds) };
|
|
12975
|
+
}
|
|
12976
|
+
} catch {}
|
|
12977
|
+
}
|
|
12978
|
+
return { method: "none" };
|
|
12979
|
+
}
|
|
12890
12980
|
function runGitCommand(args, cwd) {
|
|
12891
12981
|
return new Promise((resolve3) => {
|
|
12892
12982
|
const proc = spawn2("git", args, { cwd, stdio: "pipe" });
|
|
@@ -12910,11 +13000,18 @@ async function gitPull() {
|
|
|
12910
13000
|
if (!isGitRepo(AGENTS_DIR3)) {
|
|
12911
13001
|
return { success: false, message: "Not a git repository" };
|
|
12912
13002
|
}
|
|
12913
|
-
const
|
|
12914
|
-
|
|
12915
|
-
|
|
13003
|
+
const creds = await resolveGitCredentials(AGENTS_DIR3, gitConfig.remote);
|
|
13004
|
+
let fetchResult;
|
|
13005
|
+
if (creds.usePlainGit) {
|
|
13006
|
+
fetchResult = await runGitCommand(["fetch", gitConfig.remote, gitConfig.branch], AGENTS_DIR3);
|
|
13007
|
+
} else if (creds.authUrl) {
|
|
13008
|
+
fetchResult = await runGitCommand(["fetch", creds.authUrl, gitConfig.branch], AGENTS_DIR3);
|
|
13009
|
+
} else {
|
|
13010
|
+
return {
|
|
13011
|
+
success: false,
|
|
13012
|
+
message: "No git credentials found. Run `gh auth login` or set GITHUB_TOKEN secret."
|
|
13013
|
+
};
|
|
12916
13014
|
}
|
|
12917
|
-
const fetchResult = await runGitCommand(["fetch", authUrl, gitConfig.branch], AGENTS_DIR3);
|
|
12918
13015
|
if (fetchResult.code !== 0) {
|
|
12919
13016
|
logger.warn("git", `Fetch failed: ${fetchResult.stderr}`);
|
|
12920
13017
|
return { success: false, message: `Fetch failed: ${fetchResult.stderr}` };
|
|
@@ -12944,16 +13041,23 @@ async function gitPush() {
|
|
|
12944
13041
|
if (!isGitRepo(AGENTS_DIR3)) {
|
|
12945
13042
|
return { success: false, message: "Not a git repository" };
|
|
12946
13043
|
}
|
|
12947
|
-
const
|
|
12948
|
-
if (!authUrl) {
|
|
12949
|
-
return { success: false, message: "No GITHUB_TOKEN configured" };
|
|
12950
|
-
}
|
|
13044
|
+
const creds = await resolveGitCredentials(AGENTS_DIR3, gitConfig.remote);
|
|
12951
13045
|
const diffResult = await runGitCommand(["rev-list", "--count", `${gitConfig.remote}/${gitConfig.branch}..HEAD`], AGENTS_DIR3);
|
|
12952
13046
|
const outgoingChanges = parseInt(diffResult.stdout.trim(), 10) || 0;
|
|
12953
13047
|
if (outgoingChanges === 0) {
|
|
12954
13048
|
return { success: true, message: "Nothing to push", changes: 0 };
|
|
12955
13049
|
}
|
|
12956
|
-
|
|
13050
|
+
let pushResult;
|
|
13051
|
+
if (creds.usePlainGit) {
|
|
13052
|
+
pushResult = await runGitCommand(["push", gitConfig.remote, `HEAD:${gitConfig.branch}`], AGENTS_DIR3);
|
|
13053
|
+
} else if (creds.authUrl) {
|
|
13054
|
+
pushResult = await runGitCommand(["push", creds.authUrl, `HEAD:${gitConfig.branch}`], AGENTS_DIR3);
|
|
13055
|
+
} else {
|
|
13056
|
+
return {
|
|
13057
|
+
success: false,
|
|
13058
|
+
message: "No git credentials found. Run `gh auth login` or set GITHUB_TOKEN secret."
|
|
13059
|
+
};
|
|
13060
|
+
}
|
|
12957
13061
|
if (pushResult.code !== 0) {
|
|
12958
13062
|
logger.warn("git", `Push failed: ${pushResult.stderr}`);
|
|
12959
13063
|
return { success: false, message: `Push failed: ${pushResult.stderr}` };
|
|
@@ -12997,8 +13101,8 @@ function startGitSyncTimer() {
|
|
|
12997
13101
|
const intervalMs = gitConfig.syncInterval * 1000;
|
|
12998
13102
|
logger.info("git", `Auto-sync enabled: every ${gitConfig.syncInterval}s`);
|
|
12999
13103
|
gitSyncTimer = setInterval(async () => {
|
|
13000
|
-
const
|
|
13001
|
-
if (!
|
|
13104
|
+
const hasCreds = await hasAnyGitCredentials();
|
|
13105
|
+
if (!hasCreds) {
|
|
13002
13106
|
return;
|
|
13003
13107
|
}
|
|
13004
13108
|
logger.debug("git", "Running periodic sync...");
|
|
@@ -13017,11 +13121,14 @@ function stopGitSyncTimer() {
|
|
|
13017
13121
|
async function getGitStatus() {
|
|
13018
13122
|
const status = {
|
|
13019
13123
|
isRepo: isGitRepo(AGENTS_DIR3),
|
|
13020
|
-
|
|
13124
|
+
hasCredentials: false,
|
|
13021
13125
|
autoSync: gitConfig.autoSync
|
|
13022
13126
|
};
|
|
13023
13127
|
if (!status.isRepo)
|
|
13024
13128
|
return status;
|
|
13129
|
+
const creds = await resolveGitCredentials(AGENTS_DIR3, gitConfig.remote);
|
|
13130
|
+
status.hasCredentials = creds.method !== "none";
|
|
13131
|
+
status.authMethod = creds.method;
|
|
13025
13132
|
const branchResult = await runGitCommand(["rev-parse", "--abbrev-ref", "HEAD"], AGENTS_DIR3);
|
|
13026
13133
|
if (branchResult.code === 0) {
|
|
13027
13134
|
status.branch = branchResult.stdout.trim();
|
|
@@ -13035,7 +13142,7 @@ async function getGitStatus() {
|
|
|
13035
13142
|
status.uncommittedChanges = statusResult.stdout.trim().split(`
|
|
13036
13143
|
`).filter((l2) => l2.trim()).length;
|
|
13037
13144
|
}
|
|
13038
|
-
if (status.
|
|
13145
|
+
if (status.hasCredentials) {
|
|
13039
13146
|
const unpushedResult = await runGitCommand(["rev-list", "--count", `${gitConfig.remote}/${gitConfig.branch}..HEAD`], AGENTS_DIR3);
|
|
13040
13147
|
if (unpushedResult.code === 0) {
|
|
13041
13148
|
status.unpushedCommits = parseInt(unpushedResult.stdout.trim(), 10) || 0;
|
|
@@ -13074,7 +13181,7 @@ async function gitAutoCommit(dir, changedFiles) {
|
|
|
13074
13181
|
const commit = spawn2("git", ["commit", "-m", message], { cwd: dir, stdio: "pipe" });
|
|
13075
13182
|
commit.on("close", (commitCode) => {
|
|
13076
13183
|
if (commitCode === 0) {
|
|
13077
|
-
logger.git.commit(message,
|
|
13184
|
+
logger.git.commit(message, changedFiles.length);
|
|
13078
13185
|
}
|
|
13079
13186
|
resolve3();
|
|
13080
13187
|
});
|
|
@@ -13095,9 +13202,9 @@ function scheduleAutoCommit(changedPath) {
|
|
|
13095
13202
|
if (commitPending)
|
|
13096
13203
|
return;
|
|
13097
13204
|
commitPending = true;
|
|
13098
|
-
const
|
|
13205
|
+
const changes = [...pendingChanges];
|
|
13099
13206
|
pendingChanges = [];
|
|
13100
|
-
await gitAutoCommit(AGENTS_DIR3,
|
|
13207
|
+
await gitAutoCommit(AGENTS_DIR3, changes);
|
|
13101
13208
|
commitPending = false;
|
|
13102
13209
|
}, COMMIT_DEBOUNCE_MS);
|
|
13103
13210
|
}
|
|
@@ -13229,7 +13336,7 @@ function startFileWatcher() {
|
|
|
13229
13336
|
join7(AGENTS_DIR3, "MEMORY.md"),
|
|
13230
13337
|
join7(AGENTS_DIR3, "IDENTITY.md"),
|
|
13231
13338
|
join7(AGENTS_DIR3, "USER.md"),
|
|
13232
|
-
join7(AGENTS_DIR3, "memory"
|
|
13339
|
+
join7(AGENTS_DIR3, "memory")
|
|
13233
13340
|
], {
|
|
13234
13341
|
persistent: true,
|
|
13235
13342
|
ignoreInitial: true
|
|
@@ -13240,10 +13347,16 @@ function startFileWatcher() {
|
|
|
13240
13347
|
if (path.endsWith("AGENTS.md")) {
|
|
13241
13348
|
scheduleSyncHarnessConfigs();
|
|
13242
13349
|
}
|
|
13350
|
+
if (path.includes("/memory/") && path.endsWith(".md") && !path.endsWith("MEMORY.md")) {
|
|
13351
|
+
ingestMemoryMarkdown(path).catch((e) => logger.error("watcher", "Ingestion failed", { path, error: String(e) }));
|
|
13352
|
+
}
|
|
13243
13353
|
});
|
|
13244
13354
|
watcher.on("add", (path) => {
|
|
13245
13355
|
logger.info("watcher", "File added", { path });
|
|
13246
13356
|
scheduleAutoCommit(path);
|
|
13357
|
+
if (path.includes("/memory/") && path.endsWith(".md") && !path.endsWith("MEMORY.md")) {
|
|
13358
|
+
ingestMemoryMarkdown(path).catch((e) => logger.error("watcher", "Ingestion failed", { path, error: String(e) }));
|
|
13359
|
+
}
|
|
13247
13360
|
});
|
|
13248
13361
|
startClaudeMemoryWatcher();
|
|
13249
13362
|
}
|
|
@@ -13284,52 +13397,295 @@ async function syncExistingClaudeMemories(claudeProjectsDir) {
|
|
|
13284
13397
|
async function syncClaudeMemoryFile(filePath) {
|
|
13285
13398
|
try {
|
|
13286
13399
|
const content = readFileSync4(filePath, "utf-8");
|
|
13287
|
-
|
|
13288
|
-
|
|
13400
|
+
if (!content.trim())
|
|
13401
|
+
return 0;
|
|
13289
13402
|
const match2 = filePath.match(/projects\/([^/]+)\/memory/);
|
|
13290
13403
|
const projectId = match2 ? match2[1] : "unknown";
|
|
13291
|
-
|
|
13292
|
-
const
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13296
|
-
|
|
13297
|
-
|
|
13298
|
-
|
|
13299
|
-
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
|
|
13306
|
-
|
|
13307
|
-
|
|
13308
|
-
}
|
|
13309
|
-
}
|
|
13310
|
-
}
|
|
13311
|
-
for (const mem of memories) {
|
|
13404
|
+
const contentHash = createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
13405
|
+
const existingHash = ingestedMemoryFiles.get(filePath);
|
|
13406
|
+
if (existingHash === contentHash) {
|
|
13407
|
+
logger.debug("watcher", "Claude memory file unchanged, skipping", { path: filePath });
|
|
13408
|
+
return 0;
|
|
13409
|
+
}
|
|
13410
|
+
ingestedMemoryFiles.set(filePath, contentHash);
|
|
13411
|
+
const chunks = chunkMarkdownHierarchically(content, 512);
|
|
13412
|
+
let inserted = 0;
|
|
13413
|
+
for (let i3 = 0;i3 < chunks.length; i3++) {
|
|
13414
|
+
const chunk = chunks[i3];
|
|
13415
|
+
const sectionMatch = chunk.header.match(/^#+\s+(.+)$/);
|
|
13416
|
+
const sectionName = sectionMatch ? sectionMatch[1].toLowerCase() : "";
|
|
13417
|
+
const chunkKey = `claude:${projectId}:${createHash("sha256").update(chunk.text).digest("hex").slice(0, 16)}`;
|
|
13418
|
+
if (syncedClaudeMemories.has(chunkKey))
|
|
13419
|
+
continue;
|
|
13420
|
+
syncedClaudeMemories.add(chunkKey);
|
|
13312
13421
|
try {
|
|
13313
|
-
await fetch(`http://${HOST}:${PORT}/api/memory/remember`, {
|
|
13422
|
+
const response = await fetch(`http://${HOST}:${PORT}/api/memory/remember`, {
|
|
13314
13423
|
method: "POST",
|
|
13315
13424
|
headers: { "Content-Type": "application/json" },
|
|
13316
13425
|
body: JSON.stringify({
|
|
13317
|
-
content:
|
|
13426
|
+
content: chunk.text,
|
|
13318
13427
|
who: "claude-code",
|
|
13319
|
-
importance: 0.
|
|
13320
|
-
tags:
|
|
13428
|
+
importance: chunk.level === "section" ? 0.65 : 0.55,
|
|
13429
|
+
tags: [
|
|
13430
|
+
"claude-code",
|
|
13431
|
+
"claude-project-memory",
|
|
13432
|
+
sectionName,
|
|
13433
|
+
`project:${projectId}`,
|
|
13434
|
+
chunk.level === "section" ? "hierarchical-section" : "hierarchical-paragraph"
|
|
13435
|
+
].filter(Boolean).join(",")
|
|
13321
13436
|
})
|
|
13322
13437
|
});
|
|
13323
|
-
|
|
13438
|
+
if (response.ok) {
|
|
13439
|
+
inserted++;
|
|
13440
|
+
logger.info("watcher", "Synced Claude memory chunk", {
|
|
13441
|
+
content: chunk.text.slice(0, 50),
|
|
13442
|
+
section: sectionName || "(no section)",
|
|
13443
|
+
level: chunk.level
|
|
13444
|
+
});
|
|
13445
|
+
}
|
|
13324
13446
|
} catch (e) {
|
|
13325
|
-
|
|
13447
|
+
const errDetails = e instanceof Error ? { message: e.message } : { error: String(e) };
|
|
13448
|
+
logger.error("watcher", "Failed to sync Claude memory chunk", {
|
|
13449
|
+
path: filePath,
|
|
13450
|
+
chunkIndex: i3,
|
|
13451
|
+
...errDetails
|
|
13452
|
+
});
|
|
13326
13453
|
}
|
|
13327
13454
|
}
|
|
13328
|
-
|
|
13455
|
+
if (inserted > 0) {
|
|
13456
|
+
logger.info("watcher", "Synced Claude memory file", {
|
|
13457
|
+
path: filePath,
|
|
13458
|
+
projectId,
|
|
13459
|
+
chunks: inserted,
|
|
13460
|
+
sections: chunks.filter((c2) => c2.level === "section").length
|
|
13461
|
+
});
|
|
13462
|
+
}
|
|
13463
|
+
return inserted;
|
|
13464
|
+
} catch (e) {
|
|
13465
|
+
const errDetails = e instanceof Error ? { message: e.message } : { error: String(e) };
|
|
13466
|
+
logger.error("watcher", "Failed to read Claude memory file", { path: filePath, ...errDetails });
|
|
13467
|
+
return 0;
|
|
13468
|
+
}
|
|
13469
|
+
}
|
|
13470
|
+
var ingestedMemoryFiles = new Map;
|
|
13471
|
+
function estimateTokens(text) {
|
|
13472
|
+
return Math.ceil(text.length / 4);
|
|
13473
|
+
}
|
|
13474
|
+
function chunkMarkdownHierarchically(content, maxTokens = 512) {
|
|
13475
|
+
const results = [];
|
|
13476
|
+
const lines = content.split(`
|
|
13477
|
+
`);
|
|
13478
|
+
let currentHeader = "";
|
|
13479
|
+
let currentContent = [];
|
|
13480
|
+
const headerPattern = /^(#{1,3})\s+(.+)$/;
|
|
13481
|
+
const flushSection = () => {
|
|
13482
|
+
if (currentContent.length === 0)
|
|
13483
|
+
return;
|
|
13484
|
+
const sectionText = currentContent.join(`
|
|
13485
|
+
`).trim();
|
|
13486
|
+
if (!sectionText)
|
|
13487
|
+
return;
|
|
13488
|
+
const sectionTokens = estimateTokens(sectionText);
|
|
13489
|
+
if (sectionTokens <= maxTokens) {
|
|
13490
|
+
const textWithHeader = currentHeader ? `${currentHeader}
|
|
13491
|
+
|
|
13492
|
+
${sectionText}` : sectionText;
|
|
13493
|
+
results.push({
|
|
13494
|
+
text: textWithHeader,
|
|
13495
|
+
tokenCount: estimateTokens(textWithHeader),
|
|
13496
|
+
header: currentHeader,
|
|
13497
|
+
level: "section"
|
|
13498
|
+
});
|
|
13499
|
+
} else {
|
|
13500
|
+
const paragraphs = sectionText.split(/\n\n+/);
|
|
13501
|
+
let chunkParas = [];
|
|
13502
|
+
let chunkTokens = currentHeader ? estimateTokens(currentHeader) : 0;
|
|
13503
|
+
for (const para of paragraphs) {
|
|
13504
|
+
const paraTokens = estimateTokens(para);
|
|
13505
|
+
if (paraTokens > maxTokens) {
|
|
13506
|
+
if (chunkParas.length > 0) {
|
|
13507
|
+
const text2 = currentHeader ? `${currentHeader}
|
|
13508
|
+
|
|
13509
|
+
${chunkParas.join(`
|
|
13510
|
+
|
|
13511
|
+
`)}` : chunkParas.join(`
|
|
13512
|
+
|
|
13513
|
+
`);
|
|
13514
|
+
results.push({
|
|
13515
|
+
text: text2,
|
|
13516
|
+
tokenCount: chunkTokens,
|
|
13517
|
+
header: currentHeader,
|
|
13518
|
+
level: "paragraph"
|
|
13519
|
+
});
|
|
13520
|
+
chunkParas = [];
|
|
13521
|
+
chunkTokens = currentHeader ? estimateTokens(currentHeader) : 0;
|
|
13522
|
+
}
|
|
13523
|
+
const text = currentHeader ? `${currentHeader}
|
|
13524
|
+
|
|
13525
|
+
${para}` : para;
|
|
13526
|
+
results.push({
|
|
13527
|
+
text,
|
|
13528
|
+
tokenCount: estimateTokens(text),
|
|
13529
|
+
header: currentHeader,
|
|
13530
|
+
level: "paragraph"
|
|
13531
|
+
});
|
|
13532
|
+
continue;
|
|
13533
|
+
}
|
|
13534
|
+
if (chunkTokens + paraTokens + 2 > maxTokens && chunkParas.length > 0) {
|
|
13535
|
+
const text = currentHeader ? `${currentHeader}
|
|
13536
|
+
|
|
13537
|
+
${chunkParas.join(`
|
|
13538
|
+
|
|
13539
|
+
`)}` : chunkParas.join(`
|
|
13540
|
+
|
|
13541
|
+
`);
|
|
13542
|
+
results.push({
|
|
13543
|
+
text,
|
|
13544
|
+
tokenCount: chunkTokens,
|
|
13545
|
+
header: currentHeader,
|
|
13546
|
+
level: "paragraph"
|
|
13547
|
+
});
|
|
13548
|
+
chunkParas = [];
|
|
13549
|
+
chunkTokens = currentHeader ? estimateTokens(currentHeader) : 0;
|
|
13550
|
+
}
|
|
13551
|
+
chunkParas.push(para);
|
|
13552
|
+
chunkTokens += paraTokens + 2;
|
|
13553
|
+
}
|
|
13554
|
+
if (chunkParas.length > 0) {
|
|
13555
|
+
const text = currentHeader ? `${currentHeader}
|
|
13556
|
+
|
|
13557
|
+
${chunkParas.join(`
|
|
13558
|
+
|
|
13559
|
+
`)}` : chunkParas.join(`
|
|
13560
|
+
|
|
13561
|
+
`);
|
|
13562
|
+
results.push({
|
|
13563
|
+
text,
|
|
13564
|
+
tokenCount: chunkTokens,
|
|
13565
|
+
header: currentHeader,
|
|
13566
|
+
level: "paragraph"
|
|
13567
|
+
});
|
|
13568
|
+
}
|
|
13569
|
+
}
|
|
13570
|
+
currentContent = [];
|
|
13571
|
+
};
|
|
13572
|
+
for (const line of lines) {
|
|
13573
|
+
const match2 = line.match(headerPattern);
|
|
13574
|
+
if (match2) {
|
|
13575
|
+
flushSection();
|
|
13576
|
+
currentHeader = line;
|
|
13577
|
+
} else {
|
|
13578
|
+
currentContent.push(line);
|
|
13579
|
+
}
|
|
13580
|
+
}
|
|
13581
|
+
flushSection();
|
|
13582
|
+
if (results.length === 0 && content.trim()) {
|
|
13583
|
+
const text = content.trim();
|
|
13584
|
+
results.push({
|
|
13585
|
+
text,
|
|
13586
|
+
tokenCount: estimateTokens(text),
|
|
13587
|
+
header: "",
|
|
13588
|
+
level: "section"
|
|
13589
|
+
});
|
|
13590
|
+
}
|
|
13591
|
+
return results;
|
|
13592
|
+
}
|
|
13593
|
+
async function ingestMemoryMarkdown(filePath) {
|
|
13594
|
+
if (filePath.endsWith("MEMORY.md"))
|
|
13595
|
+
return 0;
|
|
13596
|
+
let content;
|
|
13597
|
+
try {
|
|
13598
|
+
content = readFileSync4(filePath, "utf-8");
|
|
13329
13599
|
} catch (e) {
|
|
13330
|
-
logger.error("watcher", "Failed to read
|
|
13600
|
+
logger.error("watcher", "Failed to read memory file", { path: filePath, error: String(e) });
|
|
13331
13601
|
return 0;
|
|
13332
13602
|
}
|
|
13603
|
+
if (!content.trim())
|
|
13604
|
+
return 0;
|
|
13605
|
+
const hash = createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
13606
|
+
if (ingestedMemoryFiles.get(filePath) === hash) {
|
|
13607
|
+
logger.debug("watcher", "Memory file unchanged, skipping", { path: filePath });
|
|
13608
|
+
return 0;
|
|
13609
|
+
}
|
|
13610
|
+
ingestedMemoryFiles.set(filePath, hash);
|
|
13611
|
+
const filename = basename3(filePath, ".md");
|
|
13612
|
+
const dateMatch = filename.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
13613
|
+
const date = dateMatch ? dateMatch[1] : null;
|
|
13614
|
+
const chunks = chunkMarkdownHierarchically(content, 512);
|
|
13615
|
+
let inserted = 0;
|
|
13616
|
+
for (let i3 = 0;i3 < chunks.length; i3++) {
|
|
13617
|
+
const chunk = chunks[i3];
|
|
13618
|
+
try {
|
|
13619
|
+
const response = await fetch(`http://${HOST}:${PORT}/api/memory/remember`, {
|
|
13620
|
+
method: "POST",
|
|
13621
|
+
headers: { "Content-Type": "application/json" },
|
|
13622
|
+
body: JSON.stringify({
|
|
13623
|
+
content: chunk.text,
|
|
13624
|
+
who: "openclaw-memory",
|
|
13625
|
+
importance: chunk.level === "section" ? 0.65 : 0.55,
|
|
13626
|
+
tags: [
|
|
13627
|
+
"openclaw",
|
|
13628
|
+
"memory-log",
|
|
13629
|
+
date || "named",
|
|
13630
|
+
filename,
|
|
13631
|
+
chunk.level === "section" ? "hierarchical-section" : "hierarchical-paragraph"
|
|
13632
|
+
].filter(Boolean).join(",")
|
|
13633
|
+
})
|
|
13634
|
+
});
|
|
13635
|
+
if (response.ok) {
|
|
13636
|
+
inserted++;
|
|
13637
|
+
} else {
|
|
13638
|
+
logger.warn("watcher", "Failed to ingest memory chunk", {
|
|
13639
|
+
path: filePath,
|
|
13640
|
+
chunkIndex: i3,
|
|
13641
|
+
status: response.status
|
|
13642
|
+
});
|
|
13643
|
+
}
|
|
13644
|
+
} catch (e) {
|
|
13645
|
+
const errDetails = e instanceof Error ? { message: e.message } : { error: String(e) };
|
|
13646
|
+
logger.error("watcher", "Failed to ingest memory chunk", {
|
|
13647
|
+
path: filePath,
|
|
13648
|
+
chunkIndex: i3,
|
|
13649
|
+
...errDetails
|
|
13650
|
+
});
|
|
13651
|
+
}
|
|
13652
|
+
}
|
|
13653
|
+
if (inserted > 0) {
|
|
13654
|
+
logger.info("watcher", "Ingested memory file", {
|
|
13655
|
+
path: filePath,
|
|
13656
|
+
chunks: inserted,
|
|
13657
|
+
sections: chunks.filter((c2) => c2.level === "section").length,
|
|
13658
|
+
filename
|
|
13659
|
+
});
|
|
13660
|
+
}
|
|
13661
|
+
return inserted;
|
|
13662
|
+
}
|
|
13663
|
+
async function importExistingMemoryFiles() {
|
|
13664
|
+
const memoryDir = join7(AGENTS_DIR3, "memory");
|
|
13665
|
+
if (!existsSync5(memoryDir)) {
|
|
13666
|
+
logger.debug("daemon", "Memory directory does not exist, skipping initial import");
|
|
13667
|
+
return 0;
|
|
13668
|
+
}
|
|
13669
|
+
let files;
|
|
13670
|
+
try {
|
|
13671
|
+
files = readdirSync2(memoryDir).filter((f2) => f2.endsWith(".md") && f2 !== "MEMORY.md");
|
|
13672
|
+
} catch (e) {
|
|
13673
|
+
const errDetails = e instanceof Error ? { message: e.message } : { error: String(e) };
|
|
13674
|
+
logger.error("daemon", "Failed to read memory directory", errDetails);
|
|
13675
|
+
return 0;
|
|
13676
|
+
}
|
|
13677
|
+
let totalChunks = 0;
|
|
13678
|
+
for (const file of files) {
|
|
13679
|
+
const count = await ingestMemoryMarkdown(join7(memoryDir, file));
|
|
13680
|
+
totalChunks += count;
|
|
13681
|
+
}
|
|
13682
|
+
if (totalChunks > 0) {
|
|
13683
|
+
logger.info("daemon", "Imported existing memory files", {
|
|
13684
|
+
files: files.length,
|
|
13685
|
+
chunks: totalChunks
|
|
13686
|
+
});
|
|
13687
|
+
}
|
|
13688
|
+
return totalChunks;
|
|
13333
13689
|
}
|
|
13334
13690
|
function cleanup() {
|
|
13335
13691
|
logger.info("daemon", "Shutting down");
|
|
@@ -13468,6 +13824,10 @@ async function main() {
|
|
|
13468
13824
|
}, (info) => {
|
|
13469
13825
|
logger.info("daemon", "Server listening", { address: info.address, port: info.port });
|
|
13470
13826
|
logger.info("daemon", "Daemon ready");
|
|
13827
|
+
importExistingMemoryFiles().catch((e) => {
|
|
13828
|
+
const errDetails = e instanceof Error ? { message: e.message, stack: e.stack } : { error: String(e) };
|
|
13829
|
+
logger.error("daemon", "Failed to import existing memory files", errDetails);
|
|
13830
|
+
});
|
|
13471
13831
|
});
|
|
13472
13832
|
}
|
|
13473
13833
|
main().catch((err) => {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b8 as he,b9 as mt,aK as A,L as U,ay as T,aJ as te,ba as _t}from"./C6xDG81H.js";import{o as qe}from"./DehrdN04.js";const V=[];function Se(e,t=he){let n=null;const r=new Set;function a(o){if(mt(e,o)&&(e=o,n)){const l=!V.length;for(const c of r)c[1](),V.push(c,e);if(l){for(let c=0;c<V.length;c+=2)V[c][0](V[c+1]);V.length=0}}}function i(o){a(o(e))}function s(o,l=he){const c=[o,l];return r.add(c),r.size===1&&(n=t(a,i)||he),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:a,update:i,subscribe:s}}class Ee{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 Re{constructor(t,n){this.status=t,this.location=n}}class xe extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function wt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function yt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function pe({href:e}){return e.split("#")[0]}function bt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function kt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function St(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Et=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&M.delete(Le(e)),Et(e,t));const M=new Map;function Rt(e,t){const n=Le(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&M.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=St(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function xt(e,t,n){if(M.size>0){const r=Le(e,n),a=M.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);M.delete(r)}}return window.fetch(t,n)}function Le(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${kt(...a)}"]`}return r}const Lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function At(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Tt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ge(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ge(String.fromCharCode(...l.slice(2).split("-").map(w=>parseInt(w,16))));const d=Lt.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ge(l)}).join("")}).join("")}/?$`),params:t}}function Ut(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Tt(e){return e.slice(1).split("/").filter(Ut)}function Pt(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function ge(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function It({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=At(o),u={id:o,exec:h=>{const w=p.exec(h);if(w)return Pt(w,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function He(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function De(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_oo01dp?.base??"",Ot=globalThis.__sveltekit_oo01dp?.assets??x??"",$t="1771411145840",Je="sveltekit:snapshot",We="sveltekit:scroll",Ye="sveltekit:states",Ct="sveltekit:pageurl",B="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Ae=location.origin;function Xe(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 q(){return{x:pageXOffset,y:pageYOffset}}function K(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...N,"":N.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ze(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function we(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ue(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===Ae&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function ne(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=K(o,"preload-code")),a===null&&(a=K(o,"preload-data")),t===null&&(t=K(o,"keepfocus")),n===null&&(n=K(o,"noscroll")),i===null&&(i=K(o,"reload")),s===null&&(s=K(o,"replacestate")),o=Qe(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function Ke(e){const t=Se(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const et={v:()=>{}};function Nt(){const{set:e,subscribe:t}=Se(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ot}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==$t;return s&&(e(!0),et.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ue(e,t,n){return e.origin!==Ae||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function fn(e){}const tt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...tt];const jt=new Set([...tt]);[...jt];function qt(e){return e.filter(t=>t!=null)}function Ue(e){return e instanceof Ee||e instanceof xe?e.status:500}function Dt(e){return e instanceof xe?e.text:"Internal Error"}let k,J,me;const Vt=qe.toString().includes("$$")||/function \w+\(\) \{\}/.test(qe.toString());Vt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},me={current:!1}):(k=new class{#e=A({});get data(){return U(this.#e)}set data(t){T(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){T(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){T(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){T(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){T(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){T(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){T(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){T(this.#i,t)}},J=new class{#e=A(null);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},me=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},et.v=()=>me.current=!0);function Kt(e){Object.assign(k,e)}const Be={spanContext(){return Bt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Bt={traceId:"",spanId:"",traceFlags:0},Ft=new Set(["icon","shortcut icon","apple-touch-icon"]),C=He(We)??{},W=He(Je)??{},$={url:Ke({}),page:Ke({}),navigating:Se(null),updated:Nt()};function Te(e){C[e]=q()}function Gt(e,t){let n=e+1;for(;C[n];)delete C[n],n+=1;for(n=t+1;W[n];)delete W[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function nt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Fe(){}let Pe,ve,re,P,ye,v;const ae=[],oe=[];let L=null;function be(){L?.fork?.then(e=>e?.discard()),L=null}const ee=new Map,rt=new Set,Mt=new Set,z=new Set;let _={branch:[],error:null,url:null},at=!1,se=!1,Ge=!0,X=!1,G=!1,ot=!1,Ie=!1,st,y,R,j;const ie=new Set,Me=new Map;async function gn(e,t,n){globalThis.__sveltekit_oo01dp?.data&&globalThis.__sveltekit_oo01dp.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Pe=It(e),P=document.documentElement,ye=t,ve=e.nodes[0],re=e.nodes[1],ve(),re(),y=history.state?.[B],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[B]:y,[H]:R},""));const r=C[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await an(ye,n)):(await F({type:"enter",url:Xe(v.hash?ln(new URL(location.href)):location.href),replace_state:!0}),a()),rn()}function zt(){ae.length=0,Ie=!1}function it(e){oe.some(t=>t?.snapshot)&&(W[e]=oe.map(t=>t?.snapshot?.capture()))}function lt(e){W[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function ze(){Te(y),De(We,C),it(R),De(Je,W)}async function Ht(e,t,n,r){let a;t.invalidateAll&&be(),await F({type:"goto",url:Xe(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ie=!0,a=[...Me.keys()]),t.invalidate&&t.invalidate.forEach(nn)}}),t.invalidateAll&&te().then(te).then(()=>{Me.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Jt(e){if(e.id!==L?.id){be();const t={};ie.add(t),L={id:e.id,token:t,promise:ft({...e,preload:t}).then(n=>(ie.delete(t),n.type==="loaded"&&n.state.error&&be(),n)),fork:null}}return L.promise}async function _e(e){const t=(await fe(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}async function ct(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(k,e.props.page),st=new v.root({target:t,props:{...e.props,stores:$,components:oe},hydrate:n,sync:!1}),await Promise.resolve(),lt(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:C[y]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(i=>i(a))}se=!0}function le({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=wt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:qt(n).map(u=>u.node.component),page:je(k)}};s!==void 0&&(l.props.form=s);let c={},d=!k,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],w=_.branch[u];h?.data!==w?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==k.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:k.data}),l}async function Oe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Be,current:Be},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:bt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},v.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:w}=ut(f,u,n);return o&&d(h.href),w},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function ut(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=se?xt(r,a.href,t):Rt(r,t);return{resolved:a,promise:i}}function Wt(e,t,n,r,a,i){if(Ie)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(ae.some(o=>o(new URL(s))))return!0;return!1}function $e(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Yt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Xt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:je(k),constructors:[]}}}async function ft({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ie.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==ce(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Yt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const S=_.branch[g];return m[1]===S?.loader&&!Wt(u,p,d,f,S.universal?.uses,r)?S:(u=!0,Oe({loader:m[1],url:n,params:r,route:a,parent:async()=>{const I={};for(let O=0;O<g;O+=1)Object.assign(I,(await h[O])?.data);return I},server_data_node:$e(m[0]?{type:"skip"}:null,m[0]?S?.server:void 0)}))});for(const m of h)m.catch(()=>{});const w=[];for(let m=0;m<c.length;m+=1)if(c[m])try{w.push(await h[m])}catch(g){if(g instanceof Re)return{type:"redirect",location:g.location};if(ie.has(i))return Xt({error:await Q(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let S=Ue(g),E;if(g instanceof Ee)E=g.body;else{if(await $.updated.check())return await nt(),await Y(n);E=await Q(g,{params:r,url:n,route:{id:a.id}})}const I=await Qt(m,w,s);return I?le({url:n,params:r,branch:w.slice(0,I.idx).concat(I.node),status:S,error:E,route:a}):await ht(n,{id:a.id},E,S)}else w.push(void 0);return le({url:n,params:r,branch:w,status:200,error:null,route:a,form:t?void 0:null})}async function Qt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Ce({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Oe({loader:ve,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:$e(i)}),o={node:await re(),loader:re,universal:null,server:null,data:null};return le({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Re)return Ht(new URL(s.location,location.href),{},0);throw s}}async function Zt(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(i,s)=>ut(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);v.hash?i.hash=a:i.pathname=a,a=i}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function fe(e,t){if(e&&!ue(e,x,v.hash)){const n=await Zt(e);if(!n)return;const r=en(n);for(const a of Pe){const i=a.exec(r);if(i)return{id:ce(e),invalidating:t,route:a,params:yt(i),url:e}}}}function en(e){return vt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function ce(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function dt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ne(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return X||rt.forEach(c=>c(l)),s?null:o}async function F({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Fe,block:d=Fe,event:p}){const f=j;j=l;const u=await fe(t,!1),h=e==="enter"?Ne(_,u,t,e):dt({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),j===l&&(j=f);return}const w=y,m=R;c(),X=!0,se&&h.navigation.type!=="enter"&&$.navigating.set(J.current=h.navigation);let g=u&&await ft(u);if(!g){if(ue(t,x,v.hash))return await Y(t,i);g=await ht(t,{id:null},await Q(new xe(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,j!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await F({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Ce({status:500,error:await Q(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await $.updated.check()&&(await nt(),await Y(t,i));if(zt(),Te(w),it(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const b=i?0:1,Z={[B]:y+=b,[H]:R+=b,[Ye]:s};(i?history.replaceState:history.pushState).call(history,Z,"",t),i||Gt(y,R)}const S=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let E;if(se){const b=(await Promise.all(Array.from(Mt,D=>D(h.navigation)))).filter(D=>typeof D=="function");if(b.length>0){let D=function(){b.forEach(de=>{z.delete(de)})};b.push(D),b.forEach(de=>{z.add(de)})}_=g.state,g.props.page&&(g.props.page.url=t);const Z=S&&await S;Z?E=Z.commit():(st.$set(g.props),Kt(g.props.page),E=_t?.()),ot=!0}else await ct(g,ye,!1);const{activeElement:I}=document;await E,await te(),await te();let O=null;if(Ge){const b=n?n.scroll:a?q():null;b?scrollTo(b.x,b.y):(O=t.hash&&document.getElementById(pt(t)))?O.scrollIntoView():scrollTo(0,0)}const gt=document.activeElement!==I&&document.activeElement!==document.body;!r&&!gt&&sn(t,!O),Ge=!0,g.props.page&&Object.assign(k,g.props.page),X=!1,e==="popstate"&<(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),z.forEach(b=>b(h.navigation)),$.navigating.set(J.current=null)}async function ht(e,t,n,r,a){return e.origin===Ae&&e.pathname===location.pathname&&!at?await Ce({status:r,error:n,url:e,route:t}):await Y(e,a)}function tn(){let e,t={element:void 0,href:void 0},n;P.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}P.addEventListener("mousedown",r),P.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(_e(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=Ze(o,P),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=we(c,x,v.hash);if(f||u)return;const h=ne(c),w=p&&ce(_.url)===ce(p);if(!(h.reload||w))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await fe(p,!1);if(!m)return;Jt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,_e(p))}function s(){a.disconnect();for(const o of P.querySelectorAll("a")){const{url:l,external:c,download:d}=we(o,x,v.hash);if(c||d)continue;const p=ne(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&_e(l))}}z.add(s),s()}function Q(e,t){if(e instanceof Ee)return e.body;const n=Ue(e),r=Dt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function nn(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function rn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!X){const r=Ne(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};rt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||tn(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Ze(t.composedPath()[0],P);if(!n)return;const{url:r,external:a,target:i,download:s}=we(n,x,v.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=ne(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===pe(location);if(a||o.reload&&(!p||!d)){dt({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(G=!0,Te(y),e(r),!o.replace_state)return;G=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await F({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ue(s,x,!1))return;const o=t.target,l=ne(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),F({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ke){if(t.state?.[B]){const n=t.state[B];if(j={},n===y)return;const r=C[n],a=t.state[Ye]??{},i=new URL(t.state[Ct]??location.href),s=t.state[H],o=_.url?pe(location)===pe(_.url):!1;if(s===R&&(ot||o)){a!==k.state&&(k.state=a),e(i),C[y]=q(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await F({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:j,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Ft.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(J.current=null)});function e(t){_.url=k.url=t,$.page.set(je(k)),$.page.notify()}}async function an(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){at=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await fe(c,!1)||{}),d=Pe.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(w,m)=>{const g=o[m];return g?.uses&&(g.uses=on(g.uses)),Oe({loader:v.nodes[w],url:c,params:a,route:i,parent:async()=>{const S={};for(let E=0;E<m;E+=1)Object.assign(S,(await u[E]).data);return S},server_data_node:$e(g)})}),h=await Promise.all(u);if(d){const w=d.layouts;for(let m=0;m<w.length;m++)w[m]||h.splice(m,0,void 0)}p=le({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Re){await Y(new URL(u.location,location.href));return}p=await Ce({status:Ue(u),error:await Q(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await ct(p,e,f)}function on(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??[])}}let ke=!1;function sn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=pt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=q();setTimeout(()=>{const o=history.state;ke=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),ke=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ne(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function je(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function ln(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function pt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{gn as a,fn as l,k as p,$ as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,a as r}from"../chunks/IcmhVATd.js";export{o as load_css,r as start};
|