studiograph 1.3.35 → 1.3.36
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/dist/core/user-config.js +19 -4
- package/dist/core/user-config.js.map +1 -1
- package/dist/services/sync/model-factory.d.ts +1 -1
- package/dist/services/sync/model-factory.js +1 -1
- package/dist/web/_app/immutable/chunks/{DW69She1.js → BH8-RNIK.js} +1 -1
- package/dist/web/_app/immutable/chunks/{O8pRVnRZ.js → C5z6K4UW.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DyHSsMl7.js → DaAR3Zxk.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DZMxyU15.js → Dlz22zCE.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D_qHylVG.js → DnBh5ZxT.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B40N7kaI.js → RcPAaZQm.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CB7bho_q.js → xCpIYyYZ.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.D_6TmVTd.js → app.B4ieeOL6.js} +2 -2
- package/dist/web/_app/immutable/entry/start.B7Uwq6ZW.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.D9uKYzcO.js → 0.BOO73D14.js} +1 -1
- package/dist/web/_app/immutable/nodes/{1.Ch9zsaS5.js → 1.CRmDkM4-.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.DIcAlU9u.js → 2.Bj9cB81F.js} +1 -1
- package/dist/web/_app/immutable/nodes/{3.BNkz33Ww.js → 3.CyVBaby8.js} +1 -1
- package/dist/web/_app/immutable/nodes/{4.Dwv014IO.js → 4.D3C3TvwN.js} +3 -3
- package/dist/web/_app/immutable/nodes/{5.vEq--CqD.js → 5.CTSir3UT.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.S7iSWEbm.js → 6.BxTTSYiw.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.B06iBcqu.js → 7.CKxytm4p.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.Bk2MApAG.js → 8.Cdbgm7T2.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.o-iaeO8V.js → 9.PoopSTsy.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +7 -7
- package/package.json +1 -1
- package/dist/web/_app/immutable/entry/start.B31mRfBY.js +0 -1
package/dist/core/user-config.js
CHANGED
|
@@ -55,15 +55,19 @@ export function setUserModelConfig(provider, modelId, apiKey) {
|
|
|
55
55
|
export function getAnthropicCredential(config) {
|
|
56
56
|
return config.api_key;
|
|
57
57
|
}
|
|
58
|
-
/**
|
|
58
|
+
/** Primary env var name for each supported provider (user-facing, simple) */
|
|
59
59
|
const PROVIDER_ENV_KEYS = {
|
|
60
60
|
anthropic: 'ANTHROPIC_API_KEY',
|
|
61
61
|
openai: 'OPENAI_API_KEY',
|
|
62
|
-
google: '
|
|
62
|
+
google: 'GOOGLE_API_KEY',
|
|
63
63
|
xai: 'XAI_API_KEY',
|
|
64
64
|
groq: 'GROQ_API_KEY',
|
|
65
65
|
openrouter: 'OPENROUTER_API_KEY',
|
|
66
66
|
};
|
|
67
|
+
/** Additional env var names that SDKs read internally (aliases to also propagate) */
|
|
68
|
+
const PROVIDER_ENV_ALIASES = {
|
|
69
|
+
google: ['GOOGLE_GENERATIVE_AI_API_KEY'],
|
|
70
|
+
};
|
|
67
71
|
/**
|
|
68
72
|
* Resolve the model provider.
|
|
69
73
|
* Workspace config takes priority (workspace-specific), then user config (personal defaults).
|
|
@@ -87,10 +91,16 @@ export function resolveApiKey(userConfig, workspaceConfig) {
|
|
|
87
91
|
return workspaceConfig.api_key;
|
|
88
92
|
if (userConfig.api_key)
|
|
89
93
|
return userConfig.api_key;
|
|
90
|
-
// Fall back to the provider-specific env var
|
|
94
|
+
// Fall back to the provider-specific env var (check primary + aliases)
|
|
91
95
|
const provider = resolveProvider(userConfig, workspaceConfig);
|
|
92
96
|
const envKey = PROVIDER_ENV_KEYS[provider] || `${provider.toUpperCase()}_API_KEY`;
|
|
93
|
-
|
|
97
|
+
if (process.env[envKey])
|
|
98
|
+
return process.env[envKey];
|
|
99
|
+
for (const alias of PROVIDER_ENV_ALIASES[provider] ?? []) {
|
|
100
|
+
if (process.env[alias])
|
|
101
|
+
return process.env[alias];
|
|
102
|
+
}
|
|
103
|
+
return '';
|
|
94
104
|
}
|
|
95
105
|
/**
|
|
96
106
|
* Ensure the resolved API key is available in the provider-specific env var.
|
|
@@ -104,5 +114,10 @@ export function propagateApiKeyToEnv(userConfig, workspaceConfig) {
|
|
|
104
114
|
const envVar = PROVIDER_ENV_KEYS[provider] || `${provider.toUpperCase()}_API_KEY`;
|
|
105
115
|
if (!process.env[envVar])
|
|
106
116
|
process.env[envVar] = apiKey;
|
|
117
|
+
// Also set SDK-specific aliases so third-party libraries find the key
|
|
118
|
+
for (const alias of PROVIDER_ENV_ALIASES[provider] ?? []) {
|
|
119
|
+
if (!process.env[alias])
|
|
120
|
+
process.env[alias] = apiKey;
|
|
121
|
+
}
|
|
107
122
|
}
|
|
108
123
|
//# sourceMappingURL=user-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-config.js","sourceRoot":"","sources":["../../src/core/user-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AA0B7B,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;AAEnE;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAO,EAAE,CAAC;IAC7C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAe,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAkB;IAC/C,SAAS,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC3F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,OAAe,EAAE,MAAe;IACnF,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,OAAO,CAAC,cAAc,GAAG,QAAQ,CAAC;IAClC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC3B,IAAI,MAAM;QAAE,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;IACrC,cAAc,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAkB;IACvD,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"user-config.js","sourceRoot":"","sources":["../../src/core/user-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AA0B7B,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;AAEnE;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAO,EAAE,CAAC;IAC7C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAe,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAkB;IAC/C,SAAS,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC3F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,OAAe,EAAE,MAAe;IACnF,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,OAAO,CAAC,cAAc,GAAG,QAAQ,CAAC;IAClC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC3B,IAAI,MAAM;QAAE,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;IACrC,cAAc,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAkB;IACvD,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC;AAED,6EAA6E;AAC7E,MAAM,iBAAiB,GAA2B;IAChD,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,cAAc;IACpB,UAAU,EAAE,oBAAoB;CACjC,CAAC;AAEF,qFAAqF;AACrF,MAAM,oBAAoB,GAA6B;IACrD,MAAM,EAAE,CAAC,8BAA8B,CAAC;CACzC,CAAC;AASF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,UAAsB,EACtB,eAAsC;IAEtC,OAAO,eAAe,EAAE,cAAc,IAAI,UAAU,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,WAAW,CAAC;AACnH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,UAAsB,EACtB,eAAsC;IAEtC,OAAO,eAAe,EAAE,QAAQ,IAAI,UAAU,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,4BAA4B,CAAC;AAClH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAsB,EACtB,eAAsC;IAEtC,IAAI,eAAe,EAAE,OAAO;QAAE,OAAO,eAAe,CAAC,OAAO,CAAC;IAC7D,IAAI,UAAU,CAAC,OAAO;QAAE,OAAO,UAAU,CAAC,OAAO,CAAC;IAElD,uEAAuE;IACvE,MAAM,QAAQ,GAAG,eAAe,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IAClF,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;IACrD,KAAK,MAAM,KAAK,IAAI,oBAAoB,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACzD,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;IACrD,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAAsB,EACtB,eAAsC;IAEtC,MAAM,MAAM,GAAG,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,QAAQ,GAAG,eAAe,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IAClF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAEvD,sEAAsE;IACtE,KAAK,MAAM,KAAK,IAAI,oBAAoB,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;IACvD,CAAC;AACH,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each provider falls back to its own env var when no apiKey is given:
|
|
5
5
|
* anthropic → ANTHROPIC_API_KEY
|
|
6
6
|
* openai → OPENAI_API_KEY
|
|
7
|
-
* google → GOOGLE_GENERATIVE_AI_API_KEY
|
|
7
|
+
* google → GOOGLE_API_KEY (also GOOGLE_GENERATIVE_AI_API_KEY)
|
|
8
8
|
*/
|
|
9
9
|
import type { LanguageModel } from 'ai';
|
|
10
10
|
export declare function createModel(provider: string, modelId: string, apiKey?: string): LanguageModel;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each provider falls back to its own env var when no apiKey is given:
|
|
5
5
|
* anthropic → ANTHROPIC_API_KEY
|
|
6
6
|
* openai → OPENAI_API_KEY
|
|
7
|
-
* google → GOOGLE_GENERATIVE_AI_API_KEY
|
|
7
|
+
* google → GOOGLE_API_KEY (also GOOGLE_GENERATIVE_AI_API_KEY)
|
|
8
8
|
*/
|
|
9
9
|
import { createAnthropic } from '@ai-sdk/anthropic';
|
|
10
10
|
import { createOpenAI } from '@ai-sdk/openai';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,s as R,f as P,d as S,c as H,b as T,g as Y}from"./BYgtSFKq.js";import{p as $,l as k,s as M,d as w,g as u,a as Z,c as d,n as j,r as v,b as D,m as A,t as G,ax as q,a5 as h,a4 as E}from"./BYbm6UVc.js";import{a as F,s as I}from"./CGZ5Stl2.js";import{i as x}from"./DUJDFyU7.js";import{s as C}from"./BrXfVLPD.js";import{l as B,p as V}from"./CT4WYSCT.js";import{g as J}from"./
|
|
1
|
+
import{a as b,s as R,f as P,d as S,c as H,b as T,g as Y}from"./BYgtSFKq.js";import{p as $,l as k,s as M,d as w,g as u,a as Z,c as d,n as j,r as v,b as D,m as A,t as G,ax as q,a5 as h,a4 as E}from"./BYbm6UVc.js";import{a as F,s as I}from"./CGZ5Stl2.js";import{i as x}from"./DUJDFyU7.js";import{s as C}from"./BrXfVLPD.js";import{l as B,p as V}from"./CT4WYSCT.js";import{g as J}from"./xCpIYyYZ.js";import{i as K}from"./qLcHE2VO.js";import{n as L}from"./BEqlCcV9.js";import{B as Q}from"./BYSOAjj8.js";var U=P("<title> </title>"),W=P('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function X(_,e){const t=B(e,["children","$$slots","$$events","$$legacy"]),g=B(t,["size","title"]);$(e,!1);const i=A(),l=A();let o=V(e,"size",8,16),s=V(e,"title",8,void 0);k(()=>(w(t),w(s())),()=>{M(i,t["aria-label"]||t["aria-labelledby"]||s())}),k(()=>(u(i),w(t)),()=>{M(l,{"aria-hidden":u(i)?void 0:!0,role:u(i)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),Z(),K();var r=W();F(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...u(l),...g}));var f=d(r);{var p=n=>{var c=U(),y=d(c,!0);v(c),G(()=>R(y,s())),b(n,c)};x(f,n=>{s()&&n(p)})}j(3),v(r),b(_,r),D()}var tt=T('<div class="view-toolbar svelte-r6dy5f"><div></div> <div class="view-toggles svelte-r6dy5f"><button><span class="toggle-label">Details</span></button> <button><span class="toggle-label">Graph</span></button></div> <div class="toolbar-right svelte-r6dy5f"><!> <!></div></div>');function vt(_,e){$(e,!0);let t=V(e,"activeView",3,"entity");const g=q("chat");function i(a){J(a,{noScroll:!0})}var l=tt(),o=h(d(l),2),s=d(o);let r;var f=h(s,2);let p;v(o);var n=h(o,2),c=d(n);{var y=a=>{var m=Y(),z=E(m);I(z,()=>e.right),b(a,m)};x(c,a=>{e.right&&a(y)})}var N=h(c,2);{var O=a=>{Q(a,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return g.toggle},children:(m,z)=>{X(m,{size:14})},$$slots:{default:!0}})};x(N,a=>{g.open||a(O)})}v(n),v(l),G(()=>{r=C(s,1,"toggle-btn svelte-r6dy5f",null,r,{active:t()==="entity"}),p=C(f,1,"toggle-btn svelte-r6dy5f",null,p,{active:t()==="graph"})}),H("click",s,()=>t()!=="entity"&&i(L.entityPath??"/")),H("click",f,()=>t()!=="graph"&&i("/graph")),b(_,l),D()}S(["click"]);export{vt as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./
|
|
1
|
+
import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./DaAR3Zxk.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as T,a6 as H,g as m,s as n,a1 as N,ag as Y}from"./BYbm6UVc.js";import{i as G}from"./
|
|
1
|
+
import{Y as T,a6 as H,g as m,s as n,a1 as N,ag as Y}from"./BYbm6UVc.js";import{i as G}from"./xCpIYyYZ.js";import{u as P,w as h}from"./C-ARUxRt.js";import{a as L}from"./C-CLyBoI.js";import{n as b}from"./BEqlCcV9.js";function mt(...t){return t.filter(Boolean).join(" ")}const V=typeof document<"u";let D=0;class q{#t=T(H([]));get toasts(){return m(this.#t)}set toasts(e){n(this.#t,e,!0)}#e=T(H([]));get heights(){return m(this.#e)}set heights(e){n(this.#e,e,!0)}#s=e=>{const s=this.toasts.findIndex(i=>i.id===e);return s===-1?null:s};addToast=e=>{V&&this.toasts.unshift(e)};updateToast=({id:e,data:s,type:i,message:r})=>{const o=this.toasts.findIndex(d=>d.id===e),u=this.toasts[o];this.toasts[o]={...u,...s,id:e,title:r,type:i,updated:!0}};create=e=>{const{message:s,...i}=e,r=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:D++,o=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,u=e.type===void 0?"default":e.type;return N(()=>{this.toasts.find($=>$.id===r)?this.updateToast({id:r,data:e,type:u,message:s,dismissible:o}):this.addToast({...i,id:r,title:s,dismissible:o,type:u})}),r};dismiss=e=>(N(()=>{if(e===void 0){this.toasts=this.toasts.map(i=>({...i,dismiss:!0}));return}const s=this.toasts.findIndex(i=>i.id===e);this.toasts[s]&&(this.toasts[s]={...this.toasts[s],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const s=this.#s(e);if(s!==null)return this.toasts.splice(s,1),e};message=(e,s)=>this.create({...s,type:"default",message:e});error=(e,s)=>this.create({...s,type:"error",message:e});success=(e,s)=>this.create({...s,type:"success",message:e});info=(e,s)=>this.create({...s,type:"info",message:e});warning=(e,s)=>this.create({...s,type:"warning",message:e});loading=(e,s)=>this.create({...s,type:"loading",message:e});promise=(e,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:e,type:"loading",message:typeof s.loading=="string"?s.loading:s.loading()}));const r=e instanceof Promise?e:e();let o=i!==void 0;return r.then(u=>{if(typeof u=="object"&&u&&"ok"in u&&typeof u.ok=="boolean"&&!u.ok){o=!1;const d=z(u);this.create({id:i,type:"error",message:d})}else if(s.success!==void 0){o=!1;const d=typeof s.success=="function"?s.success(u):s.success;this.create({id:i,type:"success",message:d})}}).catch(u=>{if(s.error!==void 0){o=!1;const d=typeof s.error=="function"?s.error(u):s.error;this.create({id:i,type:"error",message:d})}}).finally(()=>{o&&(this.dismiss(i),i=void 0),s.finally?.()}),i};custom=(e,s)=>{const i=s?.id||D++;return this.create({component:e,id:i,...s}),i};removeHeight=e=>{this.heights=this.heights.filter(s=>s.toastId!==e)};setHeight=e=>{const s=this.#s(e.toastId);if(s===null){this.heights.push(e);return}this.heights[s]=e};reset=()=>{this.toasts=[],this.heights=[]}}function z(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const f=new q;function K(t,e){return f.create({message:t,...e})}class St{#t=Y(()=>f.toasts.filter(e=>!e.dismiss));get toasts(){return m(this.#t)}}const Q=K,a=Object.assign(Q,{success:f.success,info:f.info,warning:f.warning,error:f.error,custom:f.custom,message:f.message,promise:f.promise,dismiss:f.dismiss,loading:f.loading,getActiveToasts:()=>f.toasts.filter(t=>!t.dismiss)}),X=800;function Z(){let t=T(!1),e=T(null),s=T(null),i=null,r=null,o=!1;function u(p,S,y,l){i&&i.repo===p&&i.type===S&&i.id===y?(l.data!==void 0&&(i.payload.data=l.data),l.content!==void 0&&(i.payload.content=l.content)):i={repo:p,type:S,id:y,payload:{...l}},d()}function d(){r&&clearTimeout(r),r=setTimeout($,X)}async function $(){if(r=null,!o&&i){const{repo:p,type:S,id:y,payload:l}=i;i=null,o=!0,n(t,!0),n(s,null);try{if(await P(p,S,y,l),n(e,new Date,!0),l.data?.name){const E=h.repos.find(O=>O.name===p)?.entities.find(O=>O.id===y);E&&(E.title=l.data.name)}}catch(g){n(s,g.message??"Save failed",!0);const E=g.status??g.statusCode;(!E||E>=500)&&(i={repo:p,type:S,id:y,payload:l})}finally{n(t,!1),o=!1,i&&$()}}}function F(){r&&(clearTimeout(r),r=null),i&&$()}async function J(p,S,y,l){n(t,!0),n(s,null);try{const g=await P(p,S,y,l);return n(e,new Date,!0),g}catch(g){return n(s,g.message??"Save failed",!0),null}finally{n(t,!1)}}function R(){n(s,null),n(e,null),i=null,r&&(clearTimeout(r),r=null)}return{get saving(){return m(t)},get lastSaved(){return m(e)},get error(){return m(s)},get hasPending(){return!!(i||o)},scheduleAutoSave:u,flush:F,saveEntity:J,reset:R}}const v=Z();let c=null,U=null,j=null,B=[],_=null,x=1e3,k=T(!1),M=T(null);const w=new Map,I={},A={};function C(t,e){w.delete(t);const s=e.entities.length,i=s===1?`${t} updated ${e.entities[0]}`:`${t} updated ${s} entities`;a(i)}function tt(t){for(const[e,s]of w)s.repo===t&&(clearTimeout(s.timer),w.delete(e))}function et(t){const e=L.user?.displayName;if(t.type==="sync_progress"){const s=I[t.repo];if(s){const i=t.message.trim(),r=i.match(/^Syncing from source:\s*(.+)$/i);r&&(A[t.repo]=`Syncing ${r[1].trim()}…`);const o=A[t.repo]??`Syncing ${t.repo}…`;a.loading(o,{id:s,description:i,duration:36e5})}return}if(t.type==="entity_change"){if(e&&t.actor===e&&t.source==="api"){h.refreshEntities(t.repo);return}if(h.refreshEntities(t.repo),b.selectedRepo===t.repo&&b.selectedType===t.entityType&&b.selectedId===t.entityId){v.hasPending?a(`${t.actor} also saved changes to this entity`):G();return}const i=w.get(t.actor);if(i)clearTimeout(i.timer),i.entities.includes(t.entityId)||i.entities.push(t.entityId),i.timer=setTimeout(()=>C(t.actor,i),1e4);else{const r={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>C(t.actor,r),1e4)};w.set(t.actor,r)}return}if(t.type==="session_commit"){if(e&&t.actor===e){n(M,t.timestamp,!0);return}const s=t.entities.length,i=s===1?`${t.actor} saved changes to ${t.entities[0]}`:`${t.actor} saved ${s} changes in ${t.repo}`;a(i),h.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(tt(t.repo),!I[t.repo]){const s=t.created+t.updated+t.deleted,i=s===0?`Sync complete · no changes in ${t.repo}`:`Sync complete · ${s} ${s===1?"entity":"entities"} from ${t.source}`;a.success(i)}h.refreshEntities(t.repo);return}if(t.type==="collection_created"){a(`${t.actor} created collection ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){a(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){a(`${t.actor} pushed to ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="presence"){U?.(t);return}if(t.type==="online"){j?.(t);return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&b.selectedRepo===t.repo&&b.deselect(),h.load();return}}function W(){if(typeof window>"u"||c&&(c.readyState===WebSocket.OPEN||c.readyState===WebSocket.CONNECTING))return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;c=new WebSocket(e),c.binaryType="arraybuffer",c.onopen=()=>{n(k,!0),x=1e3,h.refreshAll();for(const s of B)s()},c.onmessage=s=>{if(!(s.data instanceof ArrayBuffer))try{const i=JSON.parse(s.data);if(i?.type==="ping"){c?.send(JSON.stringify({type:"pong"}));return}const r=i;r.type&&r.type!=="toast"&&et(r)}catch{}},c.onclose=()=>{n(k,!1),c=null,_=setTimeout(()=>{x=Math.min(x*2,1e4),W()},x)},c.onerror=()=>{}}function st(){_&&(clearTimeout(_),_=null),c&&(c.close(),c=null),n(k,!1);for(const[,t]of w)clearTimeout(t.timer);w.clear()}function it(t,e=4e3){a(t,{duration:e})}function rt(t,e){const s=crypto.randomUUID();return e?.loading?a.loading(t,{id:s,duration:36e5}):a(t,{id:s}),s}function nt(t,e,s){if(s?.loading){a.loading(e,{id:t});return}/failed|error/i.test(e)?a.error(e,{id:t,duration:s?.duration??6e3}):a.success(e,{id:t,duration:s?.duration??4e3})}function ot(t){const e=crypto.randomUUID();I[t]=e,a.loading(`Syncing ${t}…`,{id:e,duration:36e5})}function ct(t,e,s){const i=I[t];i&&(delete I[t],delete A[t],s?a.error(e,{id:i,duration:6e3}):a.success(e,{id:i,duration:4e3}))}function at(t){U=t}function ut(t){j=t}function lt(t){B.push(t)}function ft(t){c?.readyState===WebSocket.OPEN&&c.send(JSON.stringify(t))}const Tt={get connected(){return m(k)},get lastAutoSaved(){return m(M)},get ws(){return c},connect:W,disconnect:st,showToast:it,showPersistentToast:rt,updateToast:nt,startSyncToast:ot,finishSyncToast:ct,send:ft,setPresenceHandler:at,setOnlineHandler:ut,addConnectHandler:lt};export{St as S,mt as c,v as e,Tt as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aS as b,bl as O,aC as y,Y as u,g as f,s as d}from"./BYbm6UVc.js";const h=[];function A(e,t=b){let n=null;const r=new Set;function s(o){if(O(e,o)&&(e=o,n)){const l=!h.length;for(const c of r)c[1](),h.push(c,e);if(l){for(let c=0;c<h.length;c+=2)h[c][0](h[c+1]);h.length=0}}}function i(o){s(o(e))}function a(o,l=b){const c=[o,l];return r.add(c),r.size===1&&(n=t(s,i)||b),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:s,update:i,subscribe:a}}new URL("sveltekit-internal://");function G(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function z(e){return e.split("%25").map(decodeURI).join("%25")}function D(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function H({href:e}){return e.split("#")[0]}function K(e,t,n,r=!1){const s=new URL(e);Object.defineProperty(s,"searchParams",{value:new Proxy(s.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return(c,...x)=>(n(c),a[o](c,...x));t();const l=Reflect.get(a,o);return typeof l=="function"?l.bind(a):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const a of i)Object.defineProperty(s,a,{get(){return t(),e[a]},enumerable:!0,configurable:!0});return s}function N(...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 s=r.length;for(;s;)t=t*33^r[--s]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function I(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 L=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&p.delete(m(e)),L(e,t));const p=new Map;function B(e,t){const n=m(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:s,...i}=JSON.parse(r.textContent);const a=r.getAttribute("data-ttl");return a&&p.set(n,{body:s,init:i,ttl:1e3*Number(a)}),r.getAttribute("data-b64")!==null&&(s=I(s)),Promise.resolve(new Response(s,i))}return window.fetch(e,t)}function J(e,t,n){if(p.size>0){const r=m(e,n),s=p.get(r);if(s){if(performance.now()<s.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(s.body,s.init);p.delete(r)}}return window.fetch(t,n)}function m(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const s=[];t.headers&&s.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&s.push(t.body),r+=`[data-hash="${N(...s)}"]`}return r}const P=globalThis.
|
|
1
|
+
import{aS as b,bl as O,aC as y,Y as u,g as f,s as d}from"./BYbm6UVc.js";const h=[];function A(e,t=b){let n=null;const r=new Set;function s(o){if(O(e,o)&&(e=o,n)){const l=!h.length;for(const c of r)c[1](),h.push(c,e);if(l){for(let c=0;c<h.length;c+=2)h[c][0](h[c+1]);h.length=0}}}function i(o){s(o(e))}function a(o,l=b){const c=[o,l];return r.add(c),r.size===1&&(n=t(s,i)||b),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:s,update:i,subscribe:a}}new URL("sveltekit-internal://");function G(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function z(e){return e.split("%25").map(decodeURI).join("%25")}function D(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function H({href:e}){return e.split("#")[0]}function K(e,t,n,r=!1){const s=new URL(e);Object.defineProperty(s,"searchParams",{value:new Proxy(s.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return(c,...x)=>(n(c),a[o](c,...x));t();const l=Reflect.get(a,o);return typeof l=="function"?l.bind(a):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const a of i)Object.defineProperty(s,a,{get(){return t(),e[a]},enumerable:!0,configurable:!0});return s}function N(...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 s=r.length;for(;s;)t=t*33^r[--s]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function I(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 L=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&p.delete(m(e)),L(e,t));const p=new Map;function B(e,t){const n=m(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:s,...i}=JSON.parse(r.textContent);const a=r.getAttribute("data-ttl");return a&&p.set(n,{body:s,init:i,ttl:1e3*Number(a)}),r.getAttribute("data-b64")!==null&&(s=I(s)),Promise.resolve(new Response(s,i))}return window.fetch(e,t)}function J(e,t,n){if(p.size>0){const r=m(e,n),s=p.get(r);if(s){if(performance.now()<s.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(s.body,s.init);p.delete(r)}}return window.fetch(t,n)}function m(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const s=[];t.headers&&s.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&s.push(t.body),r+=`[data-hash="${N(...s)}"]`}return r}const P=globalThis.__sveltekit_15nu7fg?.base??"",$=globalThis.__sveltekit_15nu7fg?.assets??P??"",q="1774651066925",W="sveltekit:snapshot",X="sveltekit:scroll",M="sveltekit:states",F="sveltekit:pageurl",Q="sveltekit:history",Z="sveltekit:navigation",v={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},k=location.origin;function ee(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 te(){return{x:pageXOffset,y:pageYOffset}}function g(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const S={...v,"":v.hover};function T(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function ne(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=T(e)}}function re(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 s=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!s||C(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),a=r?.origin===k&&e.hasAttribute("download");return{url:r,external:i,target:s,download:a}}function se(e){let t=null,n=null,r=null,s=null,i=null,a=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=g(o,"preload-code")),s===null&&(s=g(o,"preload-data")),t===null&&(t=g(o,"keepfocus")),n===null&&(n=g(o,"noscroll")),i===null&&(i=g(o,"reload")),a===null&&(a=g(o,"replacestate")),o=T(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:S[r??"off"],preload_data:S[s??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(a)}}function oe(e){const t=A(e);let n=!0;function r(){n=!0,t.update(a=>a)}function s(a){n=!1,t.set(a)}function i(a){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&a(o=l)})}return{notify:r,set:s,subscribe:i}}const E={v:()=>{}};function ae(){const{set:e,subscribe:t}=A(!1);let n;async function r(){clearTimeout(n);try{const s=await fetch(`${$}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!s.ok)return!1;const a=(await s.json()).version!==q;return a&&(e(!0),E.v(),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:r}}function C(e,t,n){return e.origin!==k||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function ie(e){}const U=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...U];const V=new Set([...U]);[...V];let w,R,_;const Y=y.toString().includes("$$")||/function \w+\(\) \{\}/.test(y.toString());Y?(w={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},R={current:null},_={current:!1}):(w=new class{#e=u({});get data(){return f(this.#e)}set data(t){d(this.#e,t)}#t=u(null);get form(){return f(this.#t)}set form(t){d(this.#t,t)}#n=u(null);get error(){return f(this.#n)}set error(t){d(this.#n,t)}#r=u({});get params(){return f(this.#r)}set params(t){d(this.#r,t)}#s=u({id:null});get route(){return f(this.#s)}set route(t){d(this.#s,t)}#o=u({});get state(){return f(this.#o)}set state(t){d(this.#o,t)}#a=u(-1);get status(){return f(this.#a)}set status(t){d(this.#a,t)}#i=u(new URL("https://example.com"));get url(){return f(this.#i)}set url(t){d(this.#i,t)}},R=new class{#e=u(null);get current(){return f(this.#e)}set current(t){d(this.#e,t)}},_=new class{#e=u(!1);get current(){return f(this.#e)}set current(t){d(this.#e,t)}},E.v=()=>_.current=!0);function fe(e){Object.assign(w,e)}export{Q as H,Z as N,F as P,M as S,z as a,P as b,ae as c,D as d,R as e,B as f,J as g,ne as h,C as i,re as j,se as k,H as l,K as m,G as n,k as o,w as p,v as q,ee as r,te as s,X as t,fe as u,W as v,A as w,oe as x,ie as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p,s as fe,f as Q,p as X,g as x,b as W}from"./BYgtSFKq.js";import{i as ve}from"./qLcHE2VO.js";import{p as H,l as q,s as N,d as U,g as i,a as pe,c as I,n as ge,r as R,b as T,m as G,t as he,a4 as O,aS as D,ag as E,Y as _e,a6 as me}from"./BYbm6UVc.js";import{i as k}from"./DUJDFyU7.js";import{a as z,s as A}from"./CGZ5Stl2.js";import{l as J,p as l,r as $,s as ce}from"./CT4WYSCT.js";import{c as ee,n as j,M as ye,b,m as B,a as be,d as Pe,e as we,F as Me,f as Se,P as Ce,g as xe,h as ue,D as Oe,i as Fe,j as Ie}from"./DZiqytsh.js";import{r as le}from"./
|
|
1
|
+
import{a as p,s as fe,f as Q,p as X,g as x,b as W}from"./BYgtSFKq.js";import{i as ve}from"./qLcHE2VO.js";import{p as H,l as q,s as N,d as U,g as i,a as pe,c as I,n as ge,r as R,b as T,m as G,t as he,a4 as O,aS as D,ag as E,Y as _e,a6 as me}from"./BYbm6UVc.js";import{i as k}from"./DUJDFyU7.js";import{a as z,s as A}from"./CGZ5Stl2.js";import{l as J,p as l,r as $,s as ce}from"./CT4WYSCT.js";import{c as ee,n as j,M as ye,b,m as B,a as be,d as Pe,e as we,F as Me,f as Se,P as Ce,g as xe,h as ue,D as Oe,i as Fe,j as Ie}from"./DZiqytsh.js";import{r as le}from"./DaAR3Zxk.js";var Re=Q("<title> </title>"),Ae=Q('<svg><!><path d="M17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16z"></path></svg>');function $e(c,e){const o=J(e,["children","$$slots","$$events","$$legacy"]),g=J(o,["size","title"]);H(e,!1);const u=G(),f=G();let P=l(e,"size",8,16),v=l(e,"title",8,void 0);q(()=>(U(o),U(v())),()=>{N(u,o["aria-label"]||o["aria-labelledby"]||v())}),q(()=>(i(u),U(o)),()=>{N(f,{"aria-hidden":i(u)?void 0:!0,role:i(u)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),pe(),ve();var d=Ae();z(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:P(),height:P(),...i(f),...g}));var w=I(d);{var h=_=>{var n=Re(),t=I(n,!0);R(n),he(()=>fe(t,v())),p(_,n)};k(w,_=>{v()&&_(h)})}ge(),R(d),p(c,d),T()}var Ee=W("<div><!></div>");function ze(c,e){const o=X();H(e,!0);let g=l(e,"ref",15,null),u=l(e,"id",19,()=>ee(o)),f=l(e,"disabled",3,!1),P=l(e,"onSelect",3,j),v=l(e,"closeOnSelect",3,!0),d=$(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const w=ye.create({id:b(()=>u()),disabled:b(()=>f()),onSelect:b(()=>P()),ref:b(()=>g(),r=>g(r)),closeOnSelect:b(()=>v())}),h=E(()=>B(d,w.props));var _=x(),n=O(_);{var t=r=>{var s=x(),m=O(s);A(m,()=>e.child,()=>({props:i(h)})),p(r,s)},a=r=>{var s=Ee();z(s,()=>({...i(h)}));var m=I(s);A(m,()=>e.children??D),R(s),p(r,s)};k(n,r=>{e.child?r(t):r(a,!1)})}p(c,_),T()}var ke=W("<div><!></div>");function Ke(c,e){const o=X();H(e,!0);let g=l(e,"ref",15,null),u=l(e,"id",19,()=>ee(o)),f=$(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const P=be.create({id:b(()=>u()),ref:b(()=>g(),n=>g(n))}),v=E(()=>B(f,P.props));var d=x(),w=O(d);{var h=n=>{var t=x(),a=O(t);A(a,()=>e.child,()=>({props:i(v)})),p(n,t)},_=n=>{var t=ke();z(t,()=>({...i(v)}));var a=I(t);A(a,()=>e.children??D),R(t),p(n,t)};k(w,n=>{e.child?n(h):n(_,!1)})}p(c,d),T()}function He(c,e){H(e,!0);let o=l(e,"open",15,!1),g=l(e,"dir",3,"ltr"),u=l(e,"onOpenChange",3,j),f=l(e,"onOpenChangeComplete",3,j),P=l(e,"_internal_variant",3,"dropdown-menu");const v=Pe.create({variant:b(()=>P()),dir:b(()=>g()),onClose:()=>{o(!1),u()(!1)}});we.create({open:b(()=>o(),d=>{o(d),u()(d)}),onOpenChangeComplete:b(()=>f())},v),Me(c,{children:(d,w)=>{var h=x(),_=O(h);A(_,()=>e.children??D),p(d,h)},$$slots:{default:!0}}),T()}var Te=W("<div><div><!></div></div>"),Ue=W("<div><div><!></div></div>");function je(c,e){const o=X();H(e,!0);let g=l(e,"id",19,()=>ee(o)),u=l(e,"ref",15,null),f=l(e,"loop",3,!0),P=l(e,"onInteractOutside",3,j),v=l(e,"onEscapeKeydown",3,j),d=l(e,"onCloseAutoFocus",3,j),w=l(e,"forceMount",3,!1),h=l(e,"trapFocus",3,!1),_=$(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const n=Se.create({id:b(()=>g()),loop:b(()=>f()),ref:b(()=>u(),y=>u(y)),onCloseAutoFocus:b(()=>d())}),t=E(()=>B(_,n.props));function a(y){if(n.handleInteractOutside(y),!y.defaultPrevented&&(P()(y),!y.defaultPrevented)){if(y.target&&y.target instanceof Element){const re=`[${n.parentMenu.root.getBitsAttr("sub-content")}]`;if(y.target.closest(re))return}n.parentMenu.onClose()}}function r(y){v()(y),!y.defaultPrevented&&n.parentMenu.onClose()}var s=x(),m=O(s);{var C=y=>{Ce(y,ce(()=>i(t),()=>n.popperProps,{get ref(){return n.opts.ref},get enabled(){return n.parentMenu.opts.open.current},onInteractOutside:a,onEscapeKeydown:r,get trapFocus(){return h()},get loop(){return f()},forceMount:!0,get id(){return g()},get shouldRender(){return n.shouldRender},popper:(ne,L)=>{let ae=()=>L?.().props,Z=()=>L?.().wrapperProps;const V=E(()=>B(ae(),{style:ue("dropdown-menu")},{style:e.style}));var Y=x(),oe=O(Y);{var se=S=>{var M=x(),F=O(M);{let K=E(()=>({props:i(V),wrapperProps:Z(),...n.snippetProps}));A(F,()=>e.child,()=>i(K))}p(S,M)},ie=S=>{var M=Te();z(M,()=>({...Z()}));var F=I(M);z(F,()=>({...i(V)}));var K=I(F);A(K,()=>e.children??D),R(F),R(M),p(S,M)};k(oe,S=>{e.child?S(se):S(ie,!1)})}p(ne,Y)},$$slots:{popper:!0}}))},te=y=>{xe(y,ce(()=>i(t),()=>n.popperProps,{get ref(){return n.opts.ref},get open(){return n.parentMenu.opts.open.current},onInteractOutside:a,onEscapeKeydown:r,get trapFocus(){return h()},get loop(){return f()},forceMount:!1,get id(){return g()},get shouldRender(){return n.shouldRender},popper:(ne,L)=>{let ae=()=>L?.().props,Z=()=>L?.().wrapperProps;const V=E(()=>B(ae(),{style:ue("dropdown-menu")},{style:e.style}));var Y=x(),oe=O(Y);{var se=S=>{var M=x(),F=O(M);{let K=E(()=>({props:i(V),wrapperProps:Z(),...n.snippetProps}));A(F,()=>e.child,()=>i(K))}p(S,M)},ie=S=>{var M=Ue();z(M,()=>({...Z()}));var F=I(M);z(F,()=>({...i(V)}));var K=I(F);A(K,()=>e.children??D),R(F),R(M),p(S,M)};k(oe,S=>{e.child?S(se):S(ie,!1)})}p(ne,Y)},$$slots:{popper:!0}}))};k(m,y=>{w()?y(C):w()||y(te,1)})}p(c,s),T()}var Be=W("<button><!></button>");function De(c,e){const o=X();H(e,!0);let g=l(e,"id",19,()=>ee(o)),u=l(e,"ref",15,null),f=l(e,"disabled",3,!1),P=l(e,"type",3,"button"),v=$(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const d=Oe.create({id:b(()=>g()),disabled:b(()=>f()??!1),ref:b(()=>u(),h=>u(h))}),w=E(()=>B(v,d.props,{type:P()}));Fe(c,{get id(){return g()},get ref(){return d.opts.ref},children:(h,_)=>{var n=x(),t=O(n);{var a=s=>{var m=x(),C=O(m);A(C,()=>e.child,()=>({props:i(w)})),p(s,m)},r=s=>{var m=Be();z(m,()=>({...i(w)}));var C=I(m);A(C,()=>e.children??D),R(m),p(s,m)};k(t,s=>{e.child?s(a):s(r,!1)})}p(h,n)},$$slots:{default:!0}}),T()}const et=He,tt=De,rt=Ie,nt=je,at=ze,ot=Ke;function Le(){let c=_e(me({})),e=null,o=null;function g(t,a,r){o&&(clearInterval(o),o=null),e=`${t}/${a}/${r}`,f("enter",t,a,r),o=setInterval(()=>{e&&f("heartbeat",t,a,r)},3e4)}function u(){if(o&&(clearInterval(o),o=null),e){const[t,a,r]=e.split("/");t&&a&&r&&f("leave",t,a,r),e=null}}function f(t,a,r,s){le.send({type:"presence",action:t,repo:a,entityType:r,entityId:s})}function P(t){const a=`${t.repo}/${t.entityType}/${t.entityId}`,r=i(c)[a]??[];if(t.action==="leave")i(c)[a]=r.filter(s=>s.id!==t.user.id);else{const s=r.findIndex(m=>m.id===t.user.id);s>=0?(r[s]=t.user,i(c)[a]=[...r]):i(c)[a]=[...r,t.user]}}function v(){if(N(c,{},!0),!e)return;const[t,a,r]=e.split("/");t&&a&&r&&f("enter",t,a,r)}function d(t,a,r,s){const m=`${t}/${a}/${r}`,C=i(c)[m]??[];return s?C.filter(te=>te.id!==s):C}function w(t,a){const r=new Map;for(const[s,m]of Object.entries(i(c)))if(s.startsWith(t))for(const C of m)(!a||C.id!==a)&&r.set(C.id,C);return[...r.values()]}function h(t,a){return w(`${t}/`,a)}function _(t){const a=new Map;for(const r of Object.values(i(c)))for(const s of r)(!t||s.id!==t)&&a.set(s.id,s);return[...a.values()]}const n=E(()=>{const t=new Map;for(const a of Object.values(i(c)))for(const r of a)t.set(r.id,r);return[...t.values()]});return{enter:g,leave:u,handlePresenceEvent:P,resetAndResend:v,getPresence:d,getPresenceByPrefix:w,getRepoPresence:h,getAllUsers:_,get allUsers(){return i(n)}}}const de=Le();le.setPresenceHandler(c=>de.handlePresenceEvent(c));le.addConnectHandler(()=>de.resetAndResend());typeof window<"u"&&window.addEventListener("beforeunload",()=>de.leave());var Ze=Q("<title> </title>"),Ve=Q('<svg><!><path d="M25,12H20v2h5a1.0008,1.0008,0,0,1,1,1v2H22a3.0033,3.0033,0,0,0-3,3v1a3.0033,3.0033,0,0,0,3,3h6V15A3.0033,3.0033,0,0,0,25,12ZM22,22a1.0008,1.0008,0,0,1-1-1V20a1.0008,1.0008,0,0,1,1-1h4v3Z"></path><path d="M16,24h2L12,7H10L4,24H6l1.6936-5h6.6135ZM8.3711,17l2.4966-7.3711.2668.0005L13.63,17Z"></path></svg>');function st(c,e){const o=J(e,["children","$$slots","$$events","$$legacy"]),g=J(o,["size","title"]);H(e,!1);const u=G(),f=G();let P=l(e,"size",8,16),v=l(e,"title",8,void 0);q(()=>(U(o),U(v())),()=>{N(u,o["aria-label"]||o["aria-labelledby"]||v())}),q(()=>(i(u),U(o)),()=>{N(f,{"aria-hidden":i(u)?void 0:!0,role:i(u)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),pe(),ve();var d=Ve();z(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:P(),height:P(),...i(f),...g}));var w=I(d);{var h=_=>{var n=Ze(),t=I(n,!0);R(n),he(()=>fe(t,v())),p(_,n)};k(w,_=>{v()&&_(h)})}ge(2),R(d),p(c,d),T()}export{nt as C,at as I,rt as P,et as R,ot as S,tt as T,st as a,$e as b,de as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Y as I,a6 as _,s as a,g as s,a7 as U}from"./BYbm6UVc.js";import{i as H,g as L}from"./
|
|
1
|
+
import{Y as I,a6 as _,s as a,g as s,a7 as U}from"./BYbm6UVc.js";import{i as H,g as L}from"./xCpIYyYZ.js";import{n as h}from"./BEqlCcV9.js";import{w as V}from"./C-ARUxRt.js";function W(g,c,n){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:n}).then(async o=>{if(!o.ok){c({type:"error",message:`HTTP ${o.status}`});return}const r=o.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const m=new TextDecoder;let f="";for(;;){const{done:b,value:O}=await r.read();if(b)break;f+=m.decode(O,{stream:!0});const C=f.split(`
|
|
2
2
|
`);f=C.pop()??"";for(const p of C)if(p.startsWith("data: "))try{const x=JSON.parse(p.slice(6));c(x)}catch{}}}).catch(o=>{o.name!=="AbortError"&&c({type:"error",message:o.message})})}const D="sg-chat-sessions",J="sg-chat-version",X=14;function w(){try{const g=localStorage.getItem(D);if(!g)return[];if(localStorage.getItem(J)==="2")return JSON.parse(g);const o=JSON.parse(g).map(r=>({id:crypto.randomUUID(),createdAt:r.date+"T00:00:00.000Z",updatedAt:r.date+"T00:00:00.000Z",title:r.messages.find(m=>m.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(D,JSON.stringify(o)),localStorage.setItem(J,"2"),o}catch{return[]}}function $(g){const n=[...g].sort((o,r)=>r.updatedAt.localeCompare(o.updatedAt)).slice(0,X);try{localStorage.setItem(D,JSON.stringify(n)),localStorage.setItem(J,"2")}catch{}}function k(g,c){const n=w(),o=c.map(({streaming:m,...f})=>f),r=n.findIndex(m=>m.id===g);r>=0&&(n[r].messages=o,n[r].updatedAt=new Date().toISOString()),$(n)}function z(){const c=w().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt))[0];let n=I(_(c?c.messages.map(e=>({...e,streaming:!1})):[])),o=I(_(c?.id??null)),r=I(!1),m=I(0),f=I(0),b=I(null),O=null,C=I(""),p=I(_(!!c));const x=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function R(){N();const e=crypto.randomUUID();a(o,e,!0),a(n,[],!0),a(p,!1)}function M(){if(s(o)&&s(p))return s(o);const e=s(o)||crypto.randomUUID();a(o,e,!0);const i=new Date().toISOString(),d=w();return d.push({id:e,createdAt:i,updatedAt:i,title:"New chat",messages:[]}),$(d),a(p,!0),e}function E(e){if(!e.trim()||s(r))return;a(b,null);const i=M();s(n).push({role:"user",content:e}),s(n).push({role:"agent",content:"",segments:[],streaming:!0}),a(r,!0);const d=w(),l=d.find(t=>t.id===i);l&&l.title==="New chat"&&(l.title=e.slice(0,50),$(d)),k(i,s(n));let A=!1,T=null;O=new AbortController;const q=h.selectedSubPath?`${h.selectedRepo}/${h.selectedType}/${h.selectedId}/${h.selectedSubPath}`:h.selectedId?`${h.selectedRepo}/${h.selectedType}/${h.selectedId}`:null,P=s(n).slice(0,-2).map(t=>({role:t.role==="agent"?"assistant":t.role,content:t.content})),G={message:e,context:q??void 0,sessionId:i,history:P.length>0?P:void 0};W(G,t=>{const u=s(n)[s(n).length-1];if(!u||u.role!=="agent")return;const y=u.segments;switch(t.type){case"token":{u.content+=t.text??"";const S=y[y.length-1];S&&S.type==="text"?S.content+=t.text??"":y.push({type:"text",content:t.text??""}),u.segments=y,U(f);break}case"tool_start":if(t.name){x.has(t.name)&&(A=!0);const S=y[y.length-1];S&&S.type==="tools"?S.names=[...S.names,t.name]:y.push({type:"tools",names:[t.name]}),u.segments=y,U(f)}break;case"mutation":A=!0,t.action==="created"&&t.repo&&t.entityType&&t.entityId&&(T={repo:t.repo,entityType:t.entityType,entityId:t.entityId}),window.StudioChrome?.emitMutation?.({action:t.action,repo:t.repo,entityType:t.entityType,entityId:t.entityId});break;case"highlight":a(b,t.entityIds&&t.entityIds.length>0?new Set(t.entityIds):null,!0);break;case"done":t.message&&!u.content&&(u.content=t.message,u.segments=[{type:"text",content:t.message}]),u.streaming=!1,a(r,!1),k(i,s(n)),A&&(H().then(()=>{U(m)}),V.refreshAll().then(()=>{T&&L(`/${T.repo}/${T.entityType}/${T.entityId}`)}));break;case"error":u.content+=`
|
|
3
3
|
|
|
4
4
|
Error: ${t.message}`,u.streaming=!1,a(r,!1),k(i,s(n));break}},O.signal)}function N(){O?.abort(),a(r,!1);const e=s(n)[s(n).length-1];e?.streaming&&(e.streaming=!1),fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{})}function Y(){N(),a(n,[],!0),s(o)&&s(p)&&k(s(o),s(n))}function K(e){const d=w().filter(l=>l.id!==e);if($(d),s(o)===e){const l=d.sort((A,T)=>T.updatedAt.localeCompare(A.updatedAt));l.length>0?(a(o,l[0].id,!0),a(n,l[0].messages.map(A=>({...A,streaming:!1})),!0),a(p,!0)):(a(o,null),a(n,[],!0),a(p,!1))}}function Z(e){const d=w().find(l=>l.id===e);d&&(N(),a(o,d.id,!0),a(n,d.messages.map(l=>({...l,streaming:!1})),!0),a(p,!0))}function j(){return w().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt)).map(e=>({id:e.id,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt,preview:e.messages.find(i=>i.role==="user")?.content.slice(0,80)||"",count:e.messages.length,active:e.id===s(o)}))}return{get messages(){return s(n)},get streaming(){return s(r)},get mutationCount(){return s(m)},get scrollTick(){return s(f)},get highlightedIds(){return s(b)},get activeSessionId(){return s(o)},get draftInput(){return s(C)},set draftInput(e){a(C,e,!0)},send:E,stop:N,clear:Y,newSession:R,deleteSession:K,getSessions:j,loadSession:Z}}const ee=z();export{ee as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as J,bA as ot}from"./BYbm6UVc.js";import{c as st,p as S,u as Ke,i as we,b as x,d as it,r as ye,a as lt,m as ct,n as ft,o as Fe,s as C,e as de,f as ut,S as He,N as F,H as $,g as dt,h as Be,j as he,k as X,l as le,P as ht,q as D,t as Me,v as Ve,w as pt,x as je}from"./DZMxyU15.js";class be{constructor(t,a){this.status=t,typeof a=="string"?this.body={message:a}:a?this.body=a:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class ke{constructor(t,a){this.status=t,this.location=a}}class Ee extends Error{constructor(t,a,n){super(n),this.status=t,this.text=a}}const _t=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function mt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${vt(e).map(n=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(n);if(r)return t.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(n);if(o)return t.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!n)return;const i=n.split(/\[(.+?)\](?!\])/);return"/"+i.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ce(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ce(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=_t.exec(l),[,p,u,f,h]=d;return t.push({name:f,matcher:h,optional:!!p,rest:!!u,chained:u?c===1&&i[0]==="":!1}),u?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ce(l)}).join("")}).join("")}/?$`),params:t}}function gt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function vt(e){return e.slice(1).split("/").filter(gt)}function wt(e,t,a){const n={},r=e.slice(1),o=r.filter(s=>s!==void 0);let i=0;for(let s=0;s<t.length;s+=1){const l=t[s];let c=r[s-i];if(l.chained&&l.rest&&i&&(c=r.slice(s-i,s+1).filter(d=>d).join("/"),i=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||a[l.matcher](c)){n[l.name]=c;const d=t[s+1],p=r[s+1];d&&!d.rest&&d.optional&&p&&l.chained&&(i=0),!d&&!p&&Object.keys(n).length===o.length&&(i=0);continue}if(l.optional&&l.chained){i++;continue}return}if(!i)return n}function ce(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function yt({nodes:e,server_loads:t,dictionary:a,matchers:n}){const r=new Set(t);return Object.entries(a).map(([s,[l,c,d]])=>{const{pattern:p,params:u}=mt(s),f={id:s,exec:h=>{const v=p.exec(h);if(v)return wt(v,u,n)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(i),leaf:o(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function o(s){const l=s<0;return l&&(s=~s),[l,e[s]]}function i(s){return s===void 0?s:[r.has(s),e[s]]}}function Ye(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function $e(e,t,a=JSON.stringify){const n=a(t);try{sessionStorage[e]=n}catch{}}function bt(e){return e.filter(t=>t!=null)}function Se(e){return e instanceof be||e instanceof Ee?e.status:500}function kt(e){return e instanceof Ee?e.text:"Internal Error"}const Ne={spanContext(){return Et},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}},Et={traceId:"",spanId:"",traceFlags:0},St=new Set(["icon","shortcut icon","apple-touch-icon"]),O=Ye(Me)??{},H=Ye(Ve)??{},T={url:je({}),page:je({}),navigating:pt(null),updated:st()};function Re(e){O[e]=C()}function Rt(e,t){let a=e+1;for(;O[a];)delete O[a],a+=1;for(a=t+1;H[a];)delete H[a],a+=1}function B(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ze(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function pe(){}let xe,_e,Q,P,me,w;const Z=[],ee=[];let L=null;function te(){L?.fork?.then(e=>e?.discard()),L=null}const W=new Map,Ge=new Set,xt=new Set,K=new Set;let g={branch:[],error:null,url:null},We=!1,ae=!1,De=!0,M=!1,q=!1,Je=!1,Y=!1,Le,y,R,A;const ne=new Set;let fe;const re=new Map;async function Mt(e,t,a){globalThis.__sveltekit_11hpe65?.data&&globalThis.__sveltekit_11hpe65.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),xe=yt(e),P=document.documentElement,me=t,_e=e.nodes[0],Q=e.nodes[1],_e(),Q(),y=history.state?.[$],R=history.state?.[F],y||(y=R=Date.now(),history.replaceState({...history.state,[$]:y,[F]:R},""));const n=O[y];function r(){n&&(history.scrollRestoration="manual",scrollTo(n.x,n.y))}a?(r(),await Dt(me,a)):(await N({type:"enter",url:ye(w.hash?Ft(new URL(location.href)):location.href),replace_state:!0}),r()),Nt()}async function Lt(e=!0,t=!0){if(await(fe||=Promise.resolve()),!fe)return;fe=null;const a=A={},n=await z(g.url,!0);if(te(),Y&&re.forEach(({resource:r})=>{r.refresh?.()}),e){const r=S.state,o=n&&await Ie(n);if(!o||a!==A)return;if(o.type==="redirect")return Pe(new URL(o.location,g.url).href,{replaceState:!0},1,a);t||(o.props.page.state=r),Ke(o.props.page),g=o.state,ge(),Le.$set(o.props)}else ge();await Promise.all([...re.values()].map(({resource:r})=>r)).catch(pe)}function ge(){Z.length=0,Y=!1}function Xe(e){ee.some(t=>t?.snapshot)&&(H[e]=ee.map(t=>t?.snapshot?.capture()))}function Qe(e){H[e]?.forEach((t,a)=>{ee[a]?.snapshot?.restore(t)})}function qe(){Re(y),$e(Me,O),Xe(R),$e(Ve,H)}async function Pe(e,t,a,n){let r;t.invalidateAll&&te(),await N({type:"goto",url:ye(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:a,nav_token:n,accept:()=>{t.invalidateAll&&(Y=!0,r=[...re.keys()]),t.invalidate&&t.invalidate.forEach($t)}}),t.invalidateAll&&J().then(J).then(()=>{re.forEach(({resource:o},i)=>{r?.includes(i)&&o.refresh?.()})})}async function Pt(e){if(e.id!==L?.id){te();const t={};ne.add(t),L={id:e.id,token:t,promise:Ie({...e,preload:t}).then(a=>(ne.delete(t),a.type==="loaded"&&a.state.error&&te(),a)),fork:null}}return L.promise}async function ue(e){const t=(await z(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(a=>a[1]()))}async function Ze(e,t,a){g=e.state;const n=document.querySelector("style[data-sveltekit]");if(n&&n.remove(),Object.assign(S,e.props.page),Le=new w.root({target:t,props:{...e.props,stores:T,components:ee},hydrate:a,sync:!1}),await Promise.resolve(),Qe(R),a){const r={from:null,to:{params:g.params,route:{id:g.route?.id??null},url:new URL(location.href),scroll:O[y]??C()},willUnload:!1,type:"enter",complete:Promise.resolve()};K.forEach(o=>o(r))}ae=!0}function oe({url:e,params:t,branch:a,status:n,error:r,route:o,form:i}){let s="never";if(x&&(e.pathname===x||e.pathname===x+"/"))s="always";else for(const f of a)f?.slash!==void 0&&(s=f.slash);e.pathname=ft(e.pathname,s),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:a,error:r,route:o},props:{constructors:bt(a).map(f=>f.node.component),page:Ce(S)}};i!==void 0&&(l.props.form=i);let c={},d=!S,p=0;for(let f=0;f<Math.max(a.length,g.branch.length);f+=1){const h=a[f],v=g.branch[f];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!g.url||e.href!==g.url.href||g.error!==r||i!==void 0&&i!==S.form||d)&&(l.props.page={error:r,params:t,route:{id:o?.id??null},state:{},status:n,url:new URL(e),form:i??null,data:d?c:S.data}),l}async function Ae({loader:e,parent:t,url:a,params:n,route:r,server_data_node:o}){let i=null,s=!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(...u){for(const f of u){const{href:h}=new URL(f,a);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ne,current:Ne},route:new Proxy(r,{get:(u,f)=>(s&&(l.route=!0),u[f])}),params:new Proxy(n,{get:(u,f)=>(s&&l.params.add(f),u[f])}),data:o?.data??null,url:ct(a,()=>{s&&(l.url=!0)},u=>{s&&l.search_params.add(u)},w.hash),async fetch(u,f){u instanceof Request&&(f={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...f});const{resolved:h,promise:v}=et(u,f,a);return s&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return s&&(l.parent=!0),t()},untrack(u){s=!1;try{return u()}finally{s=!0}}};i=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:o,universal:c.universal?.load?{type:"data",data:i,uses:l}:null,data:i??o?.data??null,slash:c.universal?.trailingSlash??o?.slash}}function et(e,t,a){let n=e instanceof Request?e.url:e;const r=new URL(n,a);r.origin===a.origin&&(n=r.href.slice(a.origin.length));const o=ae?dt(n,r.href,t):ut(n,t);return{resolved:r,promise:o}}function At(e,t,a,n,r,o){if(Y)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&a)return!0;for(const i of r.search_params)if(n.has(i))return!0;for(const i of r.params)if(o[i]!==g.params[i])return!0;for(const i of r.dependencies)if(Z.some(s=>s(new URL(i))))return!0;return!1}function Ue(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Ut(e,t){if(!e)return new Set(t.searchParams.keys());const a=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const n of a){const r=e.searchParams.getAll(n),o=t.searchParams.getAll(n);r.every(i=>o.includes(i))&&o.every(i=>r.includes(i))&&a.delete(n)}return a}function It({error:e,url:t,route:a,params:n}){return{type:"loaded",state:{error:e,url:t,route:a,params:n,branch:[]},props:{page:Ce(S),constructors:[]}}}async function Ie({id:e,invalidating:t,url:a,params:n,route:r,preload:o}){if(L?.id===e)return ne.delete(L.token),L.promise;const{errors:i,layouts:s,leaf:l}=r,c=[...s,l];i.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=g.url?e!==se(g.url):!1,p=g.route?r.id!==g.route.id:!1,u=Ut(g.url,a);let f=!1;const h=c.map(async(m,_)=>{if(!m)return;const k=g.branch[_];return m[1]===k?.loader&&!At(f,p,d,u,k.universal?.uses,n)?k:(f=!0,Ae({loader:m[1],url:a,params:n,route:r,parent:async()=>{const U={};for(let I=0;I<_;I+=1)Object.assign(U,(await h[I])?.data);return U},server_data_node:Ue(m[0]?{type:"skip"}:null,m[0]?k?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(_){if(_ instanceof ke)return{type:"redirect",location:_.location};if(ne.has(o))return It({error:await V(_,{params:n,url:a,route:{id:r.id}}),url:a,params:n,route:r});let k=Se(_),E;if(_ instanceof be)E=_.body;else{if(await T.updated.check())return await ze(),await B(a);E=await V(_,{params:n,url:a,route:{id:r.id}})}const U=await Tt(m,v,i);return U?oe({url:a,params:n,branch:v.slice(0,U.idx).concat(U.node),status:k,error:E,route:r}):await at(a,{id:r.id},E,k)}else v.push(void 0);return oe({url:a,params:n,branch:v,status:200,error:null,route:r,form:t?void 0:null})}async function Tt(e,t,a){for(;e--;)if(a[e]){let n=e;for(;!t[n];)n-=1;try{return{idx:n+1,node:{node:await a[e](),loader:a[e],data:{},server:null,universal:null}}}catch{continue}}}async function Te({status:e,error:t,url:a,route:n}){const r={};let o=null;try{const i=await Ae({loader:_e,url:a,params:r,route:n,parent:()=>Promise.resolve({}),server_data_node:Ue(o)}),s={node:await Q(),loader:Q,universal:null,server:null,data:null};return oe({url:a,params:r,branch:[i,s],status:e,error:t,route:null})}catch(i){if(i instanceof ke)return Pe(new URL(i.location,location.href),{},0);throw i}}async function Ot(e){const t=e.href;if(W.has(t))return W.get(t);let a;try{const n=(async()=>{let r=await w.hooks.reroute({url:new URL(e),fetch:async(o,i)=>et(o,i,e).promise})??e;if(typeof r=="string"){const o=new URL(e);w.hash?o.hash=r:o.pathname=r,r=o}return r})();W.set(t,n),a=await n}catch{W.delete(t);return}return a}async function z(e,t){if(e&&!we(e,x,w.hash)){const a=await Ot(e);if(!a)return;const n=Ct(a);for(const r of xe){const o=r.exec(n);if(o)return{id:se(e),invalidating:t,route:r,params:it(o),url:e}}}}function Ct(e){return lt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function se(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function tt({url:e,type:t,intent:a,delta:n,event:r,scroll:o}){let i=!1;const s=Oe(g,a,e,t,o??null);n!==void 0&&(s.navigation.delta=n),r!==void 0&&(s.navigation.event=r);const l={...s.navigation,cancel:()=>{i=!0,s.reject(new Error("navigation cancelled"))}};return M||Ge.forEach(c=>c(l)),i?null:s}async function N({type:e,url:t,popped:a,keepfocus:n,noscroll:r,replace_state:o,state:i={},redirect_count:s=0,nav_token:l={},accept:c=pe,block:d=pe,event:p}){const u=A;A=l;const f=await z(t,!1),h=e==="enter"?Oe(g,f,t,e):tt({url:t,type:e,delta:a?.delta,intent:f,scroll:a?.scroll,event:p});if(!h){d(),A===l&&(A=u);return}const v=y,m=R;c(),M=!0,ae&&h.navigation.type!=="enter"&&T.navigating.set(de.current=h.navigation);let _=f&&await Ie(f);if(!_){if(we(t,x,w.hash))return await B(t,o);_=await at(t,{id:null},await V(new Ee(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,o)}if(t=f?.url||t,A!==l)return h.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(s<20){await N({type:e,url:new URL(_.location,t),popped:a,keepfocus:n,noscroll:r,replace_state:o,state:i,redirect_count:s+1,nav_token:l}),h.fulfil(void 0);return}_=await Te({status:500,error:await V(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await T.updated.check()&&(await ze(),await B(t,o));if(ge(),Re(v),Xe(m),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=a?a.state:i,!a){const b=o?0:1,G={[$]:y+=b,[F]:R+=b,[He]:i};(o?history.replaceState:history.pushState).call(history,G,"",t),o||Rt(y,R)}const k=f&&L?.id===f.id?L.fork:null;L=null,_.props.page.state=i;let E;if(ae){const b=(await Promise.all(Array.from(xt,j=>j(h.navigation)))).filter(j=>typeof j=="function");if(b.length>0){let j=function(){b.forEach(ie=>{K.delete(ie)})};b.push(j),b.forEach(ie=>{K.add(ie)})}g=_.state,_.props.page&&(_.props.page.url=t);const G=k&&await k;G?E=G.commit():(Le.$set(_.props),Ke(_.props.page),E=ot?.()),Je=!0}else await Ze(_,me,!1);const{activeElement:U}=document;await E,await J(),await J();let I=null;if(De){const b=a?a.scroll:r?C():null;b?scrollTo(b.x,b.y):(I=t.hash&&document.getElementById(nt(t)))?I.scrollIntoView():scrollTo(0,0)}const rt=document.activeElement!==U&&document.activeElement!==document.body;!n&&!rt&&Kt(t,!I),De=!0,_.props.page&&Object.assign(S,_.props.page),M=!1,e==="popstate"&&Qe(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=C()),K.forEach(b=>b(h.navigation)),T.navigating.set(de.current=null)}async function at(e,t,a,n,r){return e.origin===Fe&&e.pathname===location.pathname&&!We?await Te({status:n,error:a,url:e,route:t}):await B(e,r)}function jt(){let e,t={element:void 0,href:void 0},a;P.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(e),e=setTimeout(()=>{o(l,D.hover)},20)});function n(s){s.defaultPrevented||o(s.composedPath()[0],D.tap)}P.addEventListener("mousedown",n),P.addEventListener("touchstart",n,{passive:!0});const r=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(ue(new URL(l.target.href)),r.unobserve(l.target))},{threshold:0});async function o(s,l){const c=Be(s,P),d=c===t.element&&c?.href===t.href&&l>=a;if(!c||d)return;const{url:p,external:u,download:f}=he(c,x,w.hash);if(u||f)return;const h=X(c),v=p&&se(g.url)===se(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},a=D.tap;const m=await z(p,!1);if(!m)return;Pt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},a=l,ue(p))}function i(){r.disconnect();for(const s of P.querySelectorAll("a")){const{url:l,external:c,download:d}=he(s,x,w.hash);if(c||d)continue;const p=X(s);p.reload||(p.preload_code===D.viewport&&r.observe(s),p.preload_code===D.eager&&ue(l))}}K.add(i),i()}function V(e,t){if(e instanceof be)return e.body;const a=Se(e),n=kt(e);return w.hooks.handleError({error:e,event:t,status:a,message:n})??{message:n}}function Vt(e,t={}){return e=new URL(ye(e)),e.origin!==Fe?Promise.reject(new Error("goto: invalid URL")):Pe(e,t,0)}function $t(e){if(typeof e=="function")Z.push(e);else{const{href:t}=new URL(e,location.href);Z.push(a=>a.href===t)}}function Yt(){return Y=!0,Lt()}function Nt(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let a=!1;if(qe(),!M){const n=Oe(g,void 0,null,"leave"),r={...n.navigation,cancel:()=>{a=!0,n.reject(new Error("navigation cancelled"))}};Ge.forEach(o=>o(r))}a?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&qe()}),navigator.connection?.saveData||jt(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const a=Be(t.composedPath()[0],P);if(!a)return;const{url:n,external:r,target:o,download:i}=he(a,x,w.hash);if(!n)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const s=X(a);if(!(a instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||i)return;const[c,d]=(w.hash?n.hash.replace(/^#/,""):n.href).split("#"),p=c===le(location);if(r||s.reload&&(!p||!d)){tt({url:n,type:"link",event:t})?M=!0:t.preventDefault();return}if(d!==void 0&&p){const[,u]=g.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&a.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const f=a.ownerDocument.getElementById(decodeURIComponent(d));f&&(f.scrollIntoView(),f.focus())}return}if(q=!0,Re(y),e(n),!s.replace_state)return;q=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await N({type:"link",url:n,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??n.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(t.target),n=t.submitter;if((n?.formTarget||a.target)==="_blank"||(n?.formMethod||a.method)!=="get")return;const i=new URL(n?.hasAttribute("formaction")&&n?.formAction||a.action);if(we(i,x,!1))return;const s=t.target,l=X(s);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(s,n);i.search=new URLSearchParams(c).toString(),N({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ve){if(t.state?.[$]){const a=t.state[$];if(A={},a===y)return;const n=O[a],r=t.state[He]??{},o=new URL(t.state[ht]??location.href),i=t.state[F],s=g.url?le(location)===le(g.url):!1;if(i===R&&(Je||s)){r!==S.state&&(S.state=r),e(o),O[y]=C(),n&&scrollTo(n.x,n.y),y=a;return}const c=a-y;await N({type:"popstate",url:o,popped:{state:r,scroll:n,delta:c},accept:()=>{y=a,R=i},block:()=>{history.go(-c)},nav_token:A,event:t})}else if(!q){const a=new URL(location.href);e(a),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{q&&(q=!1,history.replaceState({...history.state,[$]:++y,[F]:R},"",location.href))});for(const t of document.querySelectorAll("link"))St.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&T.navigating.set(de.current=null)});function e(t){g.url=S.url=t,T.page.set(Ce(S)),T.page.notify()}}async function Dt(e,{status:t=200,error:a,node_ids:n,params:r,route:o,server_route:i,data:s,form:l}){We=!0;const c=new URL(location.href);let d;({params:r={},route:o={id:null}}=await z(c,!1)||{}),d=xe.find(({id:f})=>f===o.id);let p,u=!0;try{const f=n.map(async(v,m)=>{const _=s[m];return _?.uses&&(_.uses=qt(_.uses)),Ae({loader:w.nodes[v],url:c,params:r,route:o,parent:async()=>{const k={};for(let E=0;E<m;E+=1)Object.assign(k,(await f[E]).data);return k},server_data_node:Ue(_)})}),h=await Promise.all(f);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=oe({url:c,params:r,branch:h,status:t,error:a,form:l,route:d??null})}catch(f){if(f instanceof ke){await B(new URL(f.location,location.href));return}p=await Te({status:Se(f),error:await V(f,{url:c,params:r,route:o}),url:c,route:o}),e.textContent="",u=!1}p.props.page&&(p.props.page.state={}),await Ze(p,e,u)}function qt(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 ve=!1;function Kt(e,t=!0){const a=document.querySelector("[autofocus]");if(a)a.focus();else{const n=nt(e);if(n&&document.getElementById(n)){const{x:o,y:i}=C();setTimeout(()=>{const s=history.state;ve=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(o,i),ve=!1})}else{const o=document.body,i=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),i!==null?o.setAttribute("tabindex",i):o.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const o=[];for(let i=0;i<r.rangeCount;i+=1)o.push(r.getRangeAt(i));setTimeout(()=>{if(r.rangeCount===o.length){for(let i=0;i<r.rangeCount;i+=1){const s=o[i],l=r.getRangeAt(i);if(s.commonAncestorContainer!==l.commonAncestorContainer||s.startContainer!==l.startContainer||s.endContainer!==l.endContainer||s.startOffset!==l.startOffset||s.endOffset!==l.endOffset)return}r.removeAllRanges()}})}}}function Oe(e,t,a,n,r=null){let o,i;const s=new Promise((c,d)=>{o=c,i=d});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:C()},to:a&&{params:t?.params??null,route:{id:t?.route?.id??null},url:a,scroll:r},willUnload:!t,type:n,complete:s},fulfil:o,reject:i}}function Ce(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 Ft(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function nt(e){let t;if(w.hash){const[,,a]=e.hash.split("#",3);t=a??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Mt as a,Vt as g,Yt as i,T as s};
|
|
1
|
+
import{a0 as J,bA as ot}from"./BYbm6UVc.js";import{c as st,p as S,u as Ke,i as we,b as x,d as it,r as ye,a as lt,m as ct,n as ft,o as Fe,s as C,e as de,f as ut,S as He,N as F,H as $,g as dt,h as Be,j as he,k as X,l as le,P as ht,q as D,t as Me,v as Ve,w as pt,x as je}from"./Dlz22zCE.js";class be{constructor(t,a){this.status=t,typeof a=="string"?this.body={message:a}:a?this.body=a:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class ke{constructor(t,a){this.status=t,this.location=a}}class Ee extends Error{constructor(t,a,n){super(n),this.status=t,this.text=a}}const _t=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function mt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${vt(e).map(n=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(n);if(r)return t.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(n);if(o)return t.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!n)return;const i=n.split(/\[(.+?)\](?!\])/);return"/"+i.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ce(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ce(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=_t.exec(l),[,p,u,f,h]=d;return t.push({name:f,matcher:h,optional:!!p,rest:!!u,chained:u?c===1&&i[0]==="":!1}),u?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ce(l)}).join("")}).join("")}/?$`),params:t}}function gt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function vt(e){return e.slice(1).split("/").filter(gt)}function wt(e,t,a){const n={},r=e.slice(1),o=r.filter(s=>s!==void 0);let i=0;for(let s=0;s<t.length;s+=1){const l=t[s];let c=r[s-i];if(l.chained&&l.rest&&i&&(c=r.slice(s-i,s+1).filter(d=>d).join("/"),i=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||a[l.matcher](c)){n[l.name]=c;const d=t[s+1],p=r[s+1];d&&!d.rest&&d.optional&&p&&l.chained&&(i=0),!d&&!p&&Object.keys(n).length===o.length&&(i=0);continue}if(l.optional&&l.chained){i++;continue}return}if(!i)return n}function ce(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function yt({nodes:e,server_loads:t,dictionary:a,matchers:n}){const r=new Set(t);return Object.entries(a).map(([s,[l,c,d]])=>{const{pattern:p,params:u}=mt(s),f={id:s,exec:h=>{const v=p.exec(h);if(v)return wt(v,u,n)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(i),leaf:o(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function o(s){const l=s<0;return l&&(s=~s),[l,e[s]]}function i(s){return s===void 0?s:[r.has(s),e[s]]}}function Ye(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function $e(e,t,a=JSON.stringify){const n=a(t);try{sessionStorage[e]=n}catch{}}function bt(e){return e.filter(t=>t!=null)}function Se(e){return e instanceof be||e instanceof Ee?e.status:500}function kt(e){return e instanceof Ee?e.text:"Internal Error"}const Ne={spanContext(){return Et},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}},Et={traceId:"",spanId:"",traceFlags:0},St=new Set(["icon","shortcut icon","apple-touch-icon"]),O=Ye(Me)??{},H=Ye(Ve)??{},T={url:je({}),page:je({}),navigating:pt(null),updated:st()};function Re(e){O[e]=C()}function Rt(e,t){let a=e+1;for(;O[a];)delete O[a],a+=1;for(a=t+1;H[a];)delete H[a],a+=1}function B(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ze(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function pe(){}let xe,_e,Q,P,me,w;const Z=[],ee=[];let L=null;function te(){L?.fork?.then(e=>e?.discard()),L=null}const W=new Map,Ge=new Set,xt=new Set,K=new Set;let g={branch:[],error:null,url:null},We=!1,ae=!1,De=!0,M=!1,q=!1,Je=!1,Y=!1,Le,y,R,A;const ne=new Set;let fe;const re=new Map;async function Mt(e,t,a){globalThis.__sveltekit_15nu7fg?.data&&globalThis.__sveltekit_15nu7fg.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),xe=yt(e),P=document.documentElement,me=t,_e=e.nodes[0],Q=e.nodes[1],_e(),Q(),y=history.state?.[$],R=history.state?.[F],y||(y=R=Date.now(),history.replaceState({...history.state,[$]:y,[F]:R},""));const n=O[y];function r(){n&&(history.scrollRestoration="manual",scrollTo(n.x,n.y))}a?(r(),await Dt(me,a)):(await N({type:"enter",url:ye(w.hash?Ft(new URL(location.href)):location.href),replace_state:!0}),r()),Nt()}async function Lt(e=!0,t=!0){if(await(fe||=Promise.resolve()),!fe)return;fe=null;const a=A={},n=await z(g.url,!0);if(te(),Y&&re.forEach(({resource:r})=>{r.refresh?.()}),e){const r=S.state,o=n&&await Ie(n);if(!o||a!==A)return;if(o.type==="redirect")return Pe(new URL(o.location,g.url).href,{replaceState:!0},1,a);t||(o.props.page.state=r),Ke(o.props.page),g=o.state,ge(),Le.$set(o.props)}else ge();await Promise.all([...re.values()].map(({resource:r})=>r)).catch(pe)}function ge(){Z.length=0,Y=!1}function Xe(e){ee.some(t=>t?.snapshot)&&(H[e]=ee.map(t=>t?.snapshot?.capture()))}function Qe(e){H[e]?.forEach((t,a)=>{ee[a]?.snapshot?.restore(t)})}function qe(){Re(y),$e(Me,O),Xe(R),$e(Ve,H)}async function Pe(e,t,a,n){let r;t.invalidateAll&&te(),await N({type:"goto",url:ye(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:a,nav_token:n,accept:()=>{t.invalidateAll&&(Y=!0,r=[...re.keys()]),t.invalidate&&t.invalidate.forEach($t)}}),t.invalidateAll&&J().then(J).then(()=>{re.forEach(({resource:o},i)=>{r?.includes(i)&&o.refresh?.()})})}async function Pt(e){if(e.id!==L?.id){te();const t={};ne.add(t),L={id:e.id,token:t,promise:Ie({...e,preload:t}).then(a=>(ne.delete(t),a.type==="loaded"&&a.state.error&&te(),a)),fork:null}}return L.promise}async function ue(e){const t=(await z(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(a=>a[1]()))}async function Ze(e,t,a){g=e.state;const n=document.querySelector("style[data-sveltekit]");if(n&&n.remove(),Object.assign(S,e.props.page),Le=new w.root({target:t,props:{...e.props,stores:T,components:ee},hydrate:a,sync:!1}),await Promise.resolve(),Qe(R),a){const r={from:null,to:{params:g.params,route:{id:g.route?.id??null},url:new URL(location.href),scroll:O[y]??C()},willUnload:!1,type:"enter",complete:Promise.resolve()};K.forEach(o=>o(r))}ae=!0}function oe({url:e,params:t,branch:a,status:n,error:r,route:o,form:i}){let s="never";if(x&&(e.pathname===x||e.pathname===x+"/"))s="always";else for(const f of a)f?.slash!==void 0&&(s=f.slash);e.pathname=ft(e.pathname,s),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:a,error:r,route:o},props:{constructors:bt(a).map(f=>f.node.component),page:Ce(S)}};i!==void 0&&(l.props.form=i);let c={},d=!S,p=0;for(let f=0;f<Math.max(a.length,g.branch.length);f+=1){const h=a[f],v=g.branch[f];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!g.url||e.href!==g.url.href||g.error!==r||i!==void 0&&i!==S.form||d)&&(l.props.page={error:r,params:t,route:{id:o?.id??null},state:{},status:n,url:new URL(e),form:i??null,data:d?c:S.data}),l}async function Ae({loader:e,parent:t,url:a,params:n,route:r,server_data_node:o}){let i=null,s=!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(...u){for(const f of u){const{href:h}=new URL(f,a);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ne,current:Ne},route:new Proxy(r,{get:(u,f)=>(s&&(l.route=!0),u[f])}),params:new Proxy(n,{get:(u,f)=>(s&&l.params.add(f),u[f])}),data:o?.data??null,url:ct(a,()=>{s&&(l.url=!0)},u=>{s&&l.search_params.add(u)},w.hash),async fetch(u,f){u instanceof Request&&(f={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...f});const{resolved:h,promise:v}=et(u,f,a);return s&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return s&&(l.parent=!0),t()},untrack(u){s=!1;try{return u()}finally{s=!0}}};i=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:o,universal:c.universal?.load?{type:"data",data:i,uses:l}:null,data:i??o?.data??null,slash:c.universal?.trailingSlash??o?.slash}}function et(e,t,a){let n=e instanceof Request?e.url:e;const r=new URL(n,a);r.origin===a.origin&&(n=r.href.slice(a.origin.length));const o=ae?dt(n,r.href,t):ut(n,t);return{resolved:r,promise:o}}function At(e,t,a,n,r,o){if(Y)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&a)return!0;for(const i of r.search_params)if(n.has(i))return!0;for(const i of r.params)if(o[i]!==g.params[i])return!0;for(const i of r.dependencies)if(Z.some(s=>s(new URL(i))))return!0;return!1}function Ue(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Ut(e,t){if(!e)return new Set(t.searchParams.keys());const a=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const n of a){const r=e.searchParams.getAll(n),o=t.searchParams.getAll(n);r.every(i=>o.includes(i))&&o.every(i=>r.includes(i))&&a.delete(n)}return a}function It({error:e,url:t,route:a,params:n}){return{type:"loaded",state:{error:e,url:t,route:a,params:n,branch:[]},props:{page:Ce(S),constructors:[]}}}async function Ie({id:e,invalidating:t,url:a,params:n,route:r,preload:o}){if(L?.id===e)return ne.delete(L.token),L.promise;const{errors:i,layouts:s,leaf:l}=r,c=[...s,l];i.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=g.url?e!==se(g.url):!1,p=g.route?r.id!==g.route.id:!1,u=Ut(g.url,a);let f=!1;const h=c.map(async(m,_)=>{if(!m)return;const k=g.branch[_];return m[1]===k?.loader&&!At(f,p,d,u,k.universal?.uses,n)?k:(f=!0,Ae({loader:m[1],url:a,params:n,route:r,parent:async()=>{const U={};for(let I=0;I<_;I+=1)Object.assign(U,(await h[I])?.data);return U},server_data_node:Ue(m[0]?{type:"skip"}:null,m[0]?k?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(_){if(_ instanceof ke)return{type:"redirect",location:_.location};if(ne.has(o))return It({error:await V(_,{params:n,url:a,route:{id:r.id}}),url:a,params:n,route:r});let k=Se(_),E;if(_ instanceof be)E=_.body;else{if(await T.updated.check())return await ze(),await B(a);E=await V(_,{params:n,url:a,route:{id:r.id}})}const U=await Tt(m,v,i);return U?oe({url:a,params:n,branch:v.slice(0,U.idx).concat(U.node),status:k,error:E,route:r}):await at(a,{id:r.id},E,k)}else v.push(void 0);return oe({url:a,params:n,branch:v,status:200,error:null,route:r,form:t?void 0:null})}async function Tt(e,t,a){for(;e--;)if(a[e]){let n=e;for(;!t[n];)n-=1;try{return{idx:n+1,node:{node:await a[e](),loader:a[e],data:{},server:null,universal:null}}}catch{continue}}}async function Te({status:e,error:t,url:a,route:n}){const r={};let o=null;try{const i=await Ae({loader:_e,url:a,params:r,route:n,parent:()=>Promise.resolve({}),server_data_node:Ue(o)}),s={node:await Q(),loader:Q,universal:null,server:null,data:null};return oe({url:a,params:r,branch:[i,s],status:e,error:t,route:null})}catch(i){if(i instanceof ke)return Pe(new URL(i.location,location.href),{},0);throw i}}async function Ot(e){const t=e.href;if(W.has(t))return W.get(t);let a;try{const n=(async()=>{let r=await w.hooks.reroute({url:new URL(e),fetch:async(o,i)=>et(o,i,e).promise})??e;if(typeof r=="string"){const o=new URL(e);w.hash?o.hash=r:o.pathname=r,r=o}return r})();W.set(t,n),a=await n}catch{W.delete(t);return}return a}async function z(e,t){if(e&&!we(e,x,w.hash)){const a=await Ot(e);if(!a)return;const n=Ct(a);for(const r of xe){const o=r.exec(n);if(o)return{id:se(e),invalidating:t,route:r,params:it(o),url:e}}}}function Ct(e){return lt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function se(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function tt({url:e,type:t,intent:a,delta:n,event:r,scroll:o}){let i=!1;const s=Oe(g,a,e,t,o??null);n!==void 0&&(s.navigation.delta=n),r!==void 0&&(s.navigation.event=r);const l={...s.navigation,cancel:()=>{i=!0,s.reject(new Error("navigation cancelled"))}};return M||Ge.forEach(c=>c(l)),i?null:s}async function N({type:e,url:t,popped:a,keepfocus:n,noscroll:r,replace_state:o,state:i={},redirect_count:s=0,nav_token:l={},accept:c=pe,block:d=pe,event:p}){const u=A;A=l;const f=await z(t,!1),h=e==="enter"?Oe(g,f,t,e):tt({url:t,type:e,delta:a?.delta,intent:f,scroll:a?.scroll,event:p});if(!h){d(),A===l&&(A=u);return}const v=y,m=R;c(),M=!0,ae&&h.navigation.type!=="enter"&&T.navigating.set(de.current=h.navigation);let _=f&&await Ie(f);if(!_){if(we(t,x,w.hash))return await B(t,o);_=await at(t,{id:null},await V(new Ee(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,o)}if(t=f?.url||t,A!==l)return h.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(s<20){await N({type:e,url:new URL(_.location,t),popped:a,keepfocus:n,noscroll:r,replace_state:o,state:i,redirect_count:s+1,nav_token:l}),h.fulfil(void 0);return}_=await Te({status:500,error:await V(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await T.updated.check()&&(await ze(),await B(t,o));if(ge(),Re(v),Xe(m),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=a?a.state:i,!a){const b=o?0:1,G={[$]:y+=b,[F]:R+=b,[He]:i};(o?history.replaceState:history.pushState).call(history,G,"",t),o||Rt(y,R)}const k=f&&L?.id===f.id?L.fork:null;L=null,_.props.page.state=i;let E;if(ae){const b=(await Promise.all(Array.from(xt,j=>j(h.navigation)))).filter(j=>typeof j=="function");if(b.length>0){let j=function(){b.forEach(ie=>{K.delete(ie)})};b.push(j),b.forEach(ie=>{K.add(ie)})}g=_.state,_.props.page&&(_.props.page.url=t);const G=k&&await k;G?E=G.commit():(Le.$set(_.props),Ke(_.props.page),E=ot?.()),Je=!0}else await Ze(_,me,!1);const{activeElement:U}=document;await E,await J(),await J();let I=null;if(De){const b=a?a.scroll:r?C():null;b?scrollTo(b.x,b.y):(I=t.hash&&document.getElementById(nt(t)))?I.scrollIntoView():scrollTo(0,0)}const rt=document.activeElement!==U&&document.activeElement!==document.body;!n&&!rt&&Kt(t,!I),De=!0,_.props.page&&Object.assign(S,_.props.page),M=!1,e==="popstate"&&Qe(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=C()),K.forEach(b=>b(h.navigation)),T.navigating.set(de.current=null)}async function at(e,t,a,n,r){return e.origin===Fe&&e.pathname===location.pathname&&!We?await Te({status:n,error:a,url:e,route:t}):await B(e,r)}function jt(){let e,t={element:void 0,href:void 0},a;P.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(e),e=setTimeout(()=>{o(l,D.hover)},20)});function n(s){s.defaultPrevented||o(s.composedPath()[0],D.tap)}P.addEventListener("mousedown",n),P.addEventListener("touchstart",n,{passive:!0});const r=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(ue(new URL(l.target.href)),r.unobserve(l.target))},{threshold:0});async function o(s,l){const c=Be(s,P),d=c===t.element&&c?.href===t.href&&l>=a;if(!c||d)return;const{url:p,external:u,download:f}=he(c,x,w.hash);if(u||f)return;const h=X(c),v=p&&se(g.url)===se(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},a=D.tap;const m=await z(p,!1);if(!m)return;Pt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},a=l,ue(p))}function i(){r.disconnect();for(const s of P.querySelectorAll("a")){const{url:l,external:c,download:d}=he(s,x,w.hash);if(c||d)continue;const p=X(s);p.reload||(p.preload_code===D.viewport&&r.observe(s),p.preload_code===D.eager&&ue(l))}}K.add(i),i()}function V(e,t){if(e instanceof be)return e.body;const a=Se(e),n=kt(e);return w.hooks.handleError({error:e,event:t,status:a,message:n})??{message:n}}function Vt(e,t={}){return e=new URL(ye(e)),e.origin!==Fe?Promise.reject(new Error("goto: invalid URL")):Pe(e,t,0)}function $t(e){if(typeof e=="function")Z.push(e);else{const{href:t}=new URL(e,location.href);Z.push(a=>a.href===t)}}function Yt(){return Y=!0,Lt()}function Nt(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let a=!1;if(qe(),!M){const n=Oe(g,void 0,null,"leave"),r={...n.navigation,cancel:()=>{a=!0,n.reject(new Error("navigation cancelled"))}};Ge.forEach(o=>o(r))}a?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&qe()}),navigator.connection?.saveData||jt(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const a=Be(t.composedPath()[0],P);if(!a)return;const{url:n,external:r,target:o,download:i}=he(a,x,w.hash);if(!n)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const s=X(a);if(!(a instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||i)return;const[c,d]=(w.hash?n.hash.replace(/^#/,""):n.href).split("#"),p=c===le(location);if(r||s.reload&&(!p||!d)){tt({url:n,type:"link",event:t})?M=!0:t.preventDefault();return}if(d!==void 0&&p){const[,u]=g.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&a.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const f=a.ownerDocument.getElementById(decodeURIComponent(d));f&&(f.scrollIntoView(),f.focus())}return}if(q=!0,Re(y),e(n),!s.replace_state)return;q=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await N({type:"link",url:n,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??n.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(t.target),n=t.submitter;if((n?.formTarget||a.target)==="_blank"||(n?.formMethod||a.method)!=="get")return;const i=new URL(n?.hasAttribute("formaction")&&n?.formAction||a.action);if(we(i,x,!1))return;const s=t.target,l=X(s);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(s,n);i.search=new URLSearchParams(c).toString(),N({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ve){if(t.state?.[$]){const a=t.state[$];if(A={},a===y)return;const n=O[a],r=t.state[He]??{},o=new URL(t.state[ht]??location.href),i=t.state[F],s=g.url?le(location)===le(g.url):!1;if(i===R&&(Je||s)){r!==S.state&&(S.state=r),e(o),O[y]=C(),n&&scrollTo(n.x,n.y),y=a;return}const c=a-y;await N({type:"popstate",url:o,popped:{state:r,scroll:n,delta:c},accept:()=>{y=a,R=i},block:()=>{history.go(-c)},nav_token:A,event:t})}else if(!q){const a=new URL(location.href);e(a),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{q&&(q=!1,history.replaceState({...history.state,[$]:++y,[F]:R},"",location.href))});for(const t of document.querySelectorAll("link"))St.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&T.navigating.set(de.current=null)});function e(t){g.url=S.url=t,T.page.set(Ce(S)),T.page.notify()}}async function Dt(e,{status:t=200,error:a,node_ids:n,params:r,route:o,server_route:i,data:s,form:l}){We=!0;const c=new URL(location.href);let d;({params:r={},route:o={id:null}}=await z(c,!1)||{}),d=xe.find(({id:f})=>f===o.id);let p,u=!0;try{const f=n.map(async(v,m)=>{const _=s[m];return _?.uses&&(_.uses=qt(_.uses)),Ae({loader:w.nodes[v],url:c,params:r,route:o,parent:async()=>{const k={};for(let E=0;E<m;E+=1)Object.assign(k,(await f[E]).data);return k},server_data_node:Ue(_)})}),h=await Promise.all(f);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=oe({url:c,params:r,branch:h,status:t,error:a,form:l,route:d??null})}catch(f){if(f instanceof ke){await B(new URL(f.location,location.href));return}p=await Te({status:Se(f),error:await V(f,{url:c,params:r,route:o}),url:c,route:o}),e.textContent="",u=!1}p.props.page&&(p.props.page.state={}),await Ze(p,e,u)}function qt(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 ve=!1;function Kt(e,t=!0){const a=document.querySelector("[autofocus]");if(a)a.focus();else{const n=nt(e);if(n&&document.getElementById(n)){const{x:o,y:i}=C();setTimeout(()=>{const s=history.state;ve=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(o,i),ve=!1})}else{const o=document.body,i=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),i!==null?o.setAttribute("tabindex",i):o.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const o=[];for(let i=0;i<r.rangeCount;i+=1)o.push(r.getRangeAt(i));setTimeout(()=>{if(r.rangeCount===o.length){for(let i=0;i<r.rangeCount;i+=1){const s=o[i],l=r.getRangeAt(i);if(s.commonAncestorContainer!==l.commonAncestorContainer||s.startContainer!==l.startContainer||s.endContainer!==l.endContainer||s.startOffset!==l.startOffset||s.endOffset!==l.endOffset)return}r.removeAllRanges()}})}}}function Oe(e,t,a,n,r=null){let o,i;const s=new Promise((c,d)=>{o=c,i=d});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:C()},to:a&&{params:t?.params??null,route:{id:t?.route?.id??null},url:a,scroll:r},willUnload:!t,type:n,complete:s},fulfil:o,reject:i}}function Ce(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 Ft(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function nt(e){let t;if(w.hash){const[,,a]=e.hash.split("#",3);t=a??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Mt as a,Vt as g,Yt as i,T as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
import{_ as c}from"../chunks/PPVm8Dsz.js";import{s as D,au as $,g as i,aA as tt,aB as et,m as rt,p as at,a9 as st,ab as ot,aC as nt,a0 as it,a4 as g,a5 as mt,b as ct,Y as w,ag as O,c as ut,r as _t,t as dt}from"../chunks/BYbm6UVc.js";import{h as lt,m as ft,u as gt,a as _,g as E,b as B,t as vt,s as ht}from"../chunks/BYgtSFKq.js";import{i as L,b as R}from"../chunks/DUJDFyU7.js";import{c as A}from"../chunks/CP-3tjjf.js";import{p as x}from"../chunks/CT4WYSCT.js";function Et(s){return class extends pt{constructor(t){super({component:s,...t})}}}class pt{#e;#t;constructor(t){var a=new Map,m=(r,e)=>{var u=rt(e,!1,!1);return a.set(r,u),u};const n=new Proxy({...t.props||{},$$events:{}},{get(r,e){return i(a.get(e)??m(e,Reflect.get(r,e)))},has(r,e){return e===$?!0:(i(a.get(e)??m(e,Reflect.get(r,e))),Reflect.has(r,e))},set(r,e,u){return D(a.get(e)??m(e,u),u),Reflect.set(r,e,u)}});this.#t=(t.hydrate?lt:ft)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&tt(),this.#e=n.$$events;for(const r of Object.keys(this.#t))r==="$set"||r==="$destroy"||r==="$on"||et(this,r,{get(){return this.#t[r]},set(e){this.#t[r]=e},enumerable:!0});this.#t.$set=r=>{Object.assign(n,r)},this.#t.$destroy=()=>{gt(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const m=(...n)=>a.call(this,...n);return this.#e[t].push(m),()=>{this.#e[t]=this.#e[t].filter(n=>n!==m)}}$destroy(){this.#t.$destroy()}}const jt={};var yt=B('<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>'),bt=B("<!> <!>",1);function Pt(s,t){at(t,!0);let a=x(t,"components",23,()=>[]),m=x(t,"data_0",3,null),n=x(t,"data_1",3,null),r=x(t,"data_2",3,null);st(()=>t.stores.page.set(t.page)),ot(()=>{t.stores,t.page,t.constructors,a(),t.form,m(),n(),r(),t.stores.page.notify()});let e=w(!1),u=w(!1),k=w(null);nt(()=>{const o=t.stores.page.subscribe(()=>{i(e)&&(D(u,!0),it().then(()=>{D(k,document.title||"untitled page",!0)}))});return D(e,!0),o});const q=O(()=>t.constructors[2]);var C=bt(),S=g(C);{var z=o=>{const d=O(()=>t.constructors[0]);var l=E(),p=g(l);A(p,()=>i(d),(f,v)=>{R(v(f,{get data(){return m()},get form(){return t.form},get params(){return t.page.params},children:(y,Rt)=>{var M=E(),K=g(M);{var N=h=>{const I=O(()=>t.constructors[1]);var b=E(),T=g(b);A(T,()=>i(I),(V,j)=>{R(j(V,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(P,At)=>{var Y=E(),U=g(Y);A(U,()=>i(q),(W,X)=>{R(X(W,{get data(){return r()},get form(){return t.form},get params(){return t.page.params}}),Z=>a()[2]=Z,()=>a()?.[2])}),_(P,Y)},$$slots:{default:!0}}),P=>a()[1]=P,()=>a()?.[1])}),_(h,b)},Q=h=>{const I=O(()=>t.constructors[1]);var b=E(),T=g(b);A(T,()=>i(I),(V,j)=>{R(j(V,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),P=>a()[1]=P,()=>a()?.[1])}),_(h,b)};L(K,h=>{t.constructors[2]?h(N):h(Q,!1)})}_(y,M)},$$slots:{default:!0}}),y=>a()[0]=y,()=>a()?.[0])}),_(o,l)},F=o=>{const d=O(()=>t.constructors[0]);var l=E(),p=g(l);A(p,()=>i(d),(f,v)=>{R(v(f,{get data(){return m()},get form(){return t.form},get params(){return t.page.params}}),y=>a()[0]=y,()=>a()?.[0])}),_(o,l)};L(S,o=>{t.constructors[1]?o(z):o(F,!1)})}var H=mt(S,2);{var J=o=>{var d=yt(),l=ut(d);{var p=f=>{var v=vt();dt(()=>ht(v,i(k))),_(f,v)};L(l,f=>{i(u)&&f(p)})}_t(d),_(o,d)};L(H,o=>{i(e)&&o(J)})}_(s,C),ct()}const wt=Et(Pt),kt=[()=>c(()=>import("../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BOO73D14.js","../chunks/PPVm8Dsz.js","../chunks/BYgtSFKq.js","../chunks/BYbm6UVc.js","../chunks/DUJDFyU7.js","../chunks/CGZ5Stl2.js","../chunks/BrXfVLPD.js","../chunks/C1RoOxRU.js","../chunks/xCpIYyYZ.js","../chunks/Dlz22zCE.js","../chunks/C-ARUxRt.js","../chunks/BEqlCcV9.js","../chunks/C-CLyBoI.js","../chunks/DaAR3Zxk.js","../chunks/CT4WYSCT.js","../chunks/BmKipDWm.js","../chunks/CP-3tjjf.js","../chunks/qLcHE2VO.js","../chunks/UjXrxZYE.js","../assets/0.D8EoqqcB.css","../nodes/1.CRmDkM4-.js","../nodes/2.Bj9cB81F.js","../chunks/DnBh5ZxT.js","../chunks/DZiqytsh.js","../chunks/BYSOAjj8.js","../chunks/1oOHgkus.js","../assets/dialog-close.FS8bdfxr.css","../chunks/CA7sXyoK.js","../chunks/B-KjI0ur.js","../chunks/1WeD8Dgt.js","../chunks/RcPAaZQm.js","../assets/2.BL8L3Xp5.css","../nodes/3.CyVBaby8.js","../chunks/BH8-RNIK.js","../assets/ViewToolbar.39HnhXNY.css","../assets/3.CHSDCrUY.css","../nodes/4.D3C3TvwN.js","../chunks/D6sUaay0.js","../chunks/CqkleIqs.js","../assets/4.C3fKtWtl.css","../nodes/5.CTSir3UT.js","../assets/5.DFeGxLYf.css","../nodes/6.BxTTSYiw.js","../assets/6.CquhUpOu.css","../nodes/7.CKxytm4p.js","../assets/7.X0WUW64S.css","../nodes/8.Cdbgm7T2.js","../assets/8.CT4xL4K3.css","../nodes/9.PoopSTsy.js","../assets/9.BUrHkYry.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as c}from"../chunks/PPVm8Dsz.js";import{s as D,au as $,g as i,aA as tt,aB as et,m as rt,p as at,a9 as st,ab as ot,aC as nt,a0 as it,a4 as g,a5 as mt,b as ct,Y as w,ag as O,c as ut,r as _t,t as dt}from"../chunks/BYbm6UVc.js";import{h as lt,m as ft,u as gt,a as _,g as E,b as B,t as vt,s as ht}from"../chunks/BYgtSFKq.js";import{i as L,b as R}from"../chunks/DUJDFyU7.js";import{c as A}from"../chunks/CP-3tjjf.js";import{p as x}from"../chunks/CT4WYSCT.js";function Et(s){return class extends pt{constructor(t){super({component:s,...t})}}}class pt{#e;#t;constructor(t){var a=new Map,m=(r,e)=>{var u=rt(e,!1,!1);return a.set(r,u),u};const n=new Proxy({...t.props||{},$$events:{}},{get(r,e){return i(a.get(e)??m(e,Reflect.get(r,e)))},has(r,e){return e===$?!0:(i(a.get(e)??m(e,Reflect.get(r,e))),Reflect.has(r,e))},set(r,e,u){return D(a.get(e)??m(e,u),u),Reflect.set(r,e,u)}});this.#t=(t.hydrate?lt:ft)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&tt(),this.#e=n.$$events;for(const r of Object.keys(this.#t))r==="$set"||r==="$destroy"||r==="$on"||et(this,r,{get(){return this.#t[r]},set(e){this.#t[r]=e},enumerable:!0});this.#t.$set=r=>{Object.assign(n,r)},this.#t.$destroy=()=>{gt(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const m=(...n)=>a.call(this,...n);return this.#e[t].push(m),()=>{this.#e[t]=this.#e[t].filter(n=>n!==m)}}$destroy(){this.#t.$destroy()}}const jt={};var yt=B('<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>'),bt=B("<!> <!>",1);function Pt(s,t){at(t,!0);let a=x(t,"components",23,()=>[]),m=x(t,"data_0",3,null),n=x(t,"data_1",3,null),r=x(t,"data_2",3,null);st(()=>t.stores.page.set(t.page)),ot(()=>{t.stores,t.page,t.constructors,a(),t.form,m(),n(),r(),t.stores.page.notify()});let e=w(!1),u=w(!1),k=w(null);nt(()=>{const o=t.stores.page.subscribe(()=>{i(e)&&(D(u,!0),it().then(()=>{D(k,document.title||"untitled page",!0)}))});return D(e,!0),o});const q=O(()=>t.constructors[2]);var C=bt(),S=g(C);{var z=o=>{const d=O(()=>t.constructors[0]);var l=E(),p=g(l);A(p,()=>i(d),(f,v)=>{R(v(f,{get data(){return m()},get form(){return t.form},get params(){return t.page.params},children:(y,Rt)=>{var M=E(),K=g(M);{var N=h=>{const I=O(()=>t.constructors[1]);var b=E(),T=g(b);A(T,()=>i(I),(V,j)=>{R(j(V,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(P,At)=>{var Y=E(),U=g(Y);A(U,()=>i(q),(W,X)=>{R(X(W,{get data(){return r()},get form(){return t.form},get params(){return t.page.params}}),Z=>a()[2]=Z,()=>a()?.[2])}),_(P,Y)},$$slots:{default:!0}}),P=>a()[1]=P,()=>a()?.[1])}),_(h,b)},Q=h=>{const I=O(()=>t.constructors[1]);var b=E(),T=g(b);A(T,()=>i(I),(V,j)=>{R(j(V,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),P=>a()[1]=P,()=>a()?.[1])}),_(h,b)};L(K,h=>{t.constructors[2]?h(N):h(Q,!1)})}_(y,M)},$$slots:{default:!0}}),y=>a()[0]=y,()=>a()?.[0])}),_(o,l)},F=o=>{const d=O(()=>t.constructors[0]);var l=E(),p=g(l);A(p,()=>i(d),(f,v)=>{R(v(f,{get data(){return m()},get form(){return t.form},get params(){return t.page.params}}),y=>a()[0]=y,()=>a()?.[0])}),_(o,l)};L(S,o=>{t.constructors[1]?o(z):o(F,!1)})}var H=mt(S,2);{var J=o=>{var d=yt(),l=ut(d);{var p=f=>{var v=vt();dt(()=>ht(v,i(k))),_(f,v)};L(l,f=>{i(u)&&f(p)})}_t(d),_(o,d)};L(H,o=>{i(e)&&o(J)})}_(s,C),ct()}const wt=Et(Pt),kt=[()=>c(()=>import("../nodes/0.BOO73D14.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),()=>c(()=>import("../nodes/1.CRmDkM4-.js"),__vite__mapDeps([20,2,3,17,9,8]),import.meta.url),()=>c(()=>import("../nodes/2.Bj9cB81F.js"),__vite__mapDeps([21,2,3,5,4,6,1,15,16,8,9,17,14,22,23,24,13,10,12,11,25,26,27,28,29,30,31]),import.meta.url),()=>c(()=>import("../nodes/3.CyVBaby8.js"),__vite__mapDeps([32,2,3,17,4,33,5,6,14,8,9,11,10,24,34,35]),import.meta.url),()=>c(()=>import("../nodes/4.D3C3TvwN.js"),__vite__mapDeps([36,10,3,6,1,2,4,15,16,8,9,33,5,14,17,11,24,34,29,22,23,13,12,37,38,30,18,39]),import.meta.url),()=>c(()=>import("../nodes/5.CTSir3UT.js"),__vite__mapDeps([40,10,3,6,2,4,8,9,11,41]),import.meta.url),()=>c(()=>import("../nodes/6.BxTTSYiw.js"),__vite__mapDeps([42,2,3,33,5,4,6,14,8,9,17,11,10,24,34,1,15,27,30,43]),import.meta.url),()=>c(()=>import("../nodes/7.CKxytm4p.js"),__vite__mapDeps([44,2,3,17,4,23,5,6,14,16,24,15,29,25,26,28,37,1,12,10,9,11,45]),import.meta.url),()=>c(()=>import("../nodes/8.Cdbgm7T2.js"),__vite__mapDeps([46,2,3,4,7,8,9,12,6,24,5,14,28,29,47]),import.meta.url),()=>c(()=>import("../nodes/9.PoopSTsy.js"),__vite__mapDeps([48,2,3,4,7,8,9,12,6,10,24,5,14,28,29,49]),import.meta.url)],Ct=[],St={"/(app)":[3,[2]],"/(app)/graph":[6,[2]],"/login":[8],"/(app)/settings":[7,[2]],"/setup":[9],"/(app)/[repo]/[type]/[id]":[4,[2]],"/(app)/[repo]/[type]/[id]/edit":[5,[2]]},G={handleError:(({error:s})=>{console.error(s)}),reroute:(()=>{}),transport:{}},Ot=Object.fromEntries(Object.entries(G.transport).map(([s,t])=>[s,t.decode])),Mt=Object.fromEntries(Object.entries(G.transport).map(([s,t])=>[s,t.encode])),Yt=!1,Bt=(s,t)=>Ot[s](t);export{Bt as decode,Ot as decoders,St as dictionary,Mt as encoders,Yt as hash,G as hooks,jt as matchers,kt as nodes,wt as root,Ct as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"../chunks/xCpIYyYZ.js";import{y as t}from"../chunks/Dlz22zCE.js";export{t as load_css,r as start};
|