isorite 0.2.0-trial.1 → 0.2.0

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.
Files changed (31) hide show
  1. package/dist/embed-worker.js +9 -2
  2. package/dist/main.js +101 -32
  3. package/package.json +1 -1
  4. package/web/_app/immutable/chunks/{DP2vIlnJ.js → B7ZjnqOt.js} +1 -1
  5. package/web/_app/immutable/chunks/{BRnMDye8.js → BEVz4Dgg.js} +1 -1
  6. package/web/_app/immutable/chunks/{DhKewaLD.js → BEk5idXo.js} +1 -1
  7. package/web/_app/immutable/chunks/{CEQ-cFxt.js → B_nIecMW.js} +1 -1
  8. package/web/_app/immutable/chunks/{CWITxcMm.js → CcQ3P3p1.js} +1 -1
  9. package/web/_app/immutable/chunks/{C38XJeNJ.js → CcRs965g.js} +1 -1
  10. package/web/_app/immutable/chunks/Cw2GjAJR.js +1 -0
  11. package/web/_app/immutable/chunks/{DTwIGCa8.js → DjBHskLm.js} +1 -1
  12. package/web/_app/immutable/chunks/{D56iKolu.js → UM_L7-f7.js} +1 -1
  13. package/web/_app/immutable/chunks/{Ch0511Wu.js → b-AOhhy1.js} +1 -1
  14. package/web/_app/immutable/chunks/{GgEyipRh.js → k55859zq.js} +1 -1
  15. package/web/_app/immutable/entry/{app.C_YVtBm3.js → app.B3QXxjjH.js} +2 -2
  16. package/web/_app/immutable/entry/start.BauJm-6k.js +1 -0
  17. package/web/_app/immutable/nodes/{0.CgaPlR93.js → 0.DP4c84Wn.js} +3 -3
  18. package/web/_app/immutable/nodes/{1.CeByL9Re.js → 1.BcwcVDJZ.js} +1 -1
  19. package/web/_app/immutable/nodes/2.DgGnQZ7P.js +1 -0
  20. package/web/_app/immutable/nodes/3.BudzO7We.js +1 -0
  21. package/web/_app/immutable/nodes/{4.BBhoqQg0.js → 4.DmswyrSt.js} +1 -1
  22. package/web/_app/immutable/nodes/{5.CkVNYg2h.js → 5.DjXsfjL5.js} +1 -1
  23. package/web/_app/immutable/nodes/6.uBh-sdQx.js +1 -0
  24. package/web/_app/immutable/nodes/{8.BdGwzJFT.js → 8.Tbz9Rh77.js} +1 -1
  25. package/web/_app/version.json +1 -1
  26. package/web/index.html +15 -15
  27. package/web/_app/immutable/chunks/DAVQx5al.js +0 -1
  28. package/web/_app/immutable/entry/start.36VrMTu2.js +0 -1
  29. package/web/_app/immutable/nodes/2.DUNH537j.js +0 -1
  30. package/web/_app/immutable/nodes/3.CaAED8T_.js +0 -1
  31. package/web/_app/immutable/nodes/6.CYRn28m8.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module";
2
- import { existsSync, readFileSync } from "node:fs";
2
+ import { existsSync, readFileSync, readdirSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { parentPort, workerData } from "node:worker_threads";
@@ -3220,7 +3220,14 @@ const WASM = "ort-wasm-simd-threaded.wasm";
3220
3220
  const beside = join(dirname(fileURLToPath(import.meta.url)), WASM);
3221
3221
  ort.env.wasm.wasmBinary = readFileSync(existsSync(beside) ? beside : join(dirname(createRequire(import.meta.url).resolve("onnxruntime-web")), WASM));
3222
3222
  const tok = new Tokenizer(JSON.parse(readFileSync(join(dir, "tokenizer.json"), "utf8")), JSON.parse(readFileSync(join(dir, "tokenizer_config.json"), "utf8")));
3223
- const session = await ort.InferenceSession.create(readFileSync(join(dir, "model.onnx")), { executionProviders: ["wasm"] });
3223
+ const externalData = readdirSync(dir).filter((f) => f.endsWith(".onnx_data")).map((path) => ({
3224
+ path,
3225
+ data: readFileSync(join(dir, path))
3226
+ }));
3227
+ const session = await ort.InferenceSession.create(readFileSync(join(dir, "model.onnx")), {
3228
+ executionProviders: ["wasm"],
3229
+ externalData
3230
+ });
3224
3231
  const typed = session.inputNames.includes("token_type_ids");
3225
3232
  async function embed(text) {
3226
3233
  let ids = tok.encode(text).ids;
package/dist/main.js CHANGED
@@ -9,12 +9,12 @@ import { createHash, randomBytes } from "node:crypto";
9
9
  import { serve } from "@hono/node-server";
10
10
  import { homedir, tmpdir } from "node:os";
11
11
  import { Worker } from "node:worker_threads";
12
+ import { execFileSync, spawn, spawnSync } from "node:child_process";
12
13
  import { Hono } from "hono";
13
14
  import { streamSSE } from "hono/streaming";
14
15
  import { z } from "zod";
15
16
  import { OpenCode } from "@opencode/client";
16
17
  import { appendFile, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
17
- import { execFileSync, spawn } from "node:child_process";
18
18
  import { createInterface } from "node:readline";
19
19
  import { createServer } from "node:net";
20
20
  import { createServer as createServer$1 } from "node:http";
@@ -3203,7 +3203,6 @@ function turnMessages(a) {
3203
3203
  //#endregion
3204
3204
  //#region packages/engine/src/meaning.ts
3205
3205
  const MAX_PIECE = 1800;
3206
- const QUERY = "Represent this sentence for searching relevant passages: ";
3207
3206
  const fingerprint = (text) => sha256(text).slice(0, 20);
3208
3207
  /** Every note cut into pieces: at its first- and second-level headings (not inside a code fence), and a long section at its paragraphs. */
3209
3208
  function pieces(b) {
@@ -3359,7 +3358,7 @@ var Meaning = class {
3359
3358
  pending: missing.length,
3360
3359
  ready: false
3361
3360
  };
3362
- const q = pack(await this.embedder.embed(QUERY + text)), dim = this.embedder.dim;
3361
+ const q = pack(await this.embedder.embed((this.embedder.query ?? "") + text)), dim = this.embedder.dim;
3363
3362
  const under = opts.under?.replace(/^\/+|\/+$/g, "");
3364
3363
  const best = /* @__PURE__ */ new Map();
3365
3364
  for (const p of ps) {
@@ -5841,54 +5840,116 @@ function providerConfig(path = configPath()) {
5841
5840
  }
5842
5841
  //#endregion
5843
5842
  //#region packages/server/src/model.ts
5844
- const BASE = `https://huggingface.co/Xenova/bge-small-en-v1.5/resolve/ea104dacec62c0de699686887e3f920caeb4f3e3`;
5843
+ const NAME$1 = "granite-embedding-small-english-r2";
5844
+ /** The npm package that carries the files, and the version this isorite expects. */
5845
+ const PACKAGE = "isorite-model-granite@1.0.0";
5846
+ const HUB = `https://huggingface.co/onnx-community/granite-embedding-small-english-r2-ONNX/resolve/1dc7835ba0cb9c76a3618d0bf0c427c97671b3c8`;
5847
+ /** Each file: where it is on Hugging Face, its name here, and its SHA-256. The weights are kept apart from the
5848
+ * graph, under the name the graph gives them. */
5845
5849
  const FILES = [
5846
5850
  [
5847
5851
  "onnx/model_quantized.onnx",
5848
5852
  "model.onnx",
5849
- "6c9c6101a956d62dfb5e7190c538226c0c5bb9cb27b651234b6df063ee7dbfe4"
5853
+ "a3fad524afc3f060216a8ddbb1ac89c9b6498fba8995b5718bde879076a2e9ba"
5854
+ ],
5855
+ [
5856
+ "onnx/model_quantized.onnx_data",
5857
+ "model_quantized.onnx_data",
5858
+ "1f4cf47e4adec7f7ae09db03d071ba8667e07f9a4203142c7efa8d37fe453597"
5850
5859
  ],
5851
5860
  [
5852
5861
  "tokenizer.json",
5853
5862
  "tokenizer.json",
5854
- "d241a60d5e8f04cc1b2b3e9ef7a4921b27bf526d9f6050ab90f9267a1f9e5c66"
5863
+ "feeb83348dcb033bc6b9d2e1f7906ca9eb2d122845000c9416d894d7c2927149"
5855
5864
  ],
5856
5865
  [
5857
5866
  "tokenizer_config.json",
5858
5867
  "tokenizer_config.json",
5859
- "9261e7d79b44c8195c1cada2b453e55b00aeb81e907a6664974b4d7776172ab3"
5868
+ "ce06781b38bb393db68c9e0709bddd31ef5d88f2c6fbb3fd9f369778fb85e451"
5860
5869
  ]
5861
5870
  ];
5862
5871
  const sha = (buf) => createHash("sha256").update(buf).digest("hex");
5863
5872
  /** Where `isorite model` keeps the model: the user's data folder, outside any repository. */
5864
- const userModelDir = (env = process.env) => join(env.XDG_DATA_HOME || join(homedir(), ".local", "share"), "isorite", "models", "bge-small-en-v1.5");
5865
- /** Fetch the model's files into `out`, keeping only files whose SHA-256 is the one expected. */
5866
- async function fetchModel(out, say = console.log) {
5873
+ const userModelDir = (env = process.env) => join(env.XDG_DATA_HOME || join(homedir(), ".local", "share"), "isorite", "models", NAME$1);
5874
+ /** Keep `buf` as `out/to` if it is the file expected. */
5875
+ function keep(out, to, want, buf, say) {
5876
+ if (sha(buf) !== want) throw new Error(`${to}: not the file expected (its SHA-256 differs), so it was not kept`);
5877
+ writeFileSync(join(out, to) + ".tmp", buf);
5878
+ renameSync(join(out, to) + ".tmp", join(out, to));
5879
+ say(`${to}: ${(buf.length / 1e6).toFixed(1)} MB`);
5880
+ }
5881
+ /** The package's files, unpacked into a temporary folder by npm itself (so its registry, proxy and mirror settings
5882
+ * apply). The folder is the caller's to remove. */
5883
+ function unpack(pkg) {
5884
+ const tmp = mkdtempSync(join(tmpdir(), "isorite-model-"));
5885
+ const win = process.platform === "win32";
5886
+ const run = (cmd, args) => spawnSync(cmd, args, {
5887
+ cwd: tmp,
5888
+ encoding: "utf8",
5889
+ shell: win
5890
+ });
5891
+ const packed = run("npm", [
5892
+ "pack",
5893
+ pkg,
5894
+ "--loglevel=error"
5895
+ ]);
5896
+ const tgz = packed.stdout?.trim().split("\n").at(-1);
5897
+ if (packed.status !== 0 || !tgz) {
5898
+ rmSync(tmp, {
5899
+ recursive: true,
5900
+ force: true
5901
+ });
5902
+ throw new Error((packed.stderr?.split("\n").find((l) => /^npm error \d{3} /.test(l)) ?? packed.stderr?.split("\n").find((l) => /error/i.test(l)))?.replace(/^npm error\s*/, "").trim() || packed.error?.message || "npm pack failed");
5903
+ }
5904
+ if (run("tar", ["-xzf", tgz]).status !== 0) {
5905
+ rmSync(tmp, {
5906
+ recursive: true,
5907
+ force: true
5908
+ });
5909
+ throw new Error("could not unpack " + tgz);
5910
+ }
5911
+ return tmp;
5912
+ }
5913
+ /** Fetch the model's files into `out`, keeping only files whose SHA-256 is the one expected: from a folder if one is
5914
+ * named, else from npm, else from Hugging Face. */
5915
+ async function fetchModel(out, say = console.log, { from, pkg = PACKAGE, files = FILES } = {}) {
5867
5916
  mkdirSync(out, { recursive: true });
5868
- for (const [from, to, want] of FILES) {
5869
- const path = join(out, to);
5870
- if (existsSync(path) && sha(readFileSync(path)) === want) {
5871
- say(`${to}: already here`);
5872
- continue;
5917
+ const missing = files.filter(([, to, want]) => !(existsSync(join(out, to)) && sha(readFileSync(join(out, to))) === want));
5918
+ for (const [, to] of files) if (!missing.some((f) => f[1] === to)) say(`${to}: already here`);
5919
+ if (missing.length && from) for (const [, to, want] of missing) {
5920
+ if (!existsSync(join(from, to))) throw new Error(`${to} is not in ${from}`);
5921
+ keep(out, to, want, readFileSync(join(from, to)), say);
5922
+ }
5923
+ else if (missing.length && pkg) {
5924
+ let dir = null;
5925
+ try {
5926
+ dir = unpack(pkg);
5927
+ for (const [, to, want] of missing) keep(out, to, want, readFileSync(join(dir, "package", to)), say);
5928
+ missing.length = 0;
5929
+ } catch (e) {
5930
+ say(`From npm (${pkg}): ${e.message}. Trying Hugging Face.`);
5931
+ } finally {
5932
+ if (dir) rmSync(dir, {
5933
+ recursive: true,
5934
+ force: true
5935
+ });
5873
5936
  }
5874
- const res = await fetch(`${BASE}/${from}`);
5875
- if (!res.ok) throw new Error(`${from}: ${res.status} ${res.statusText}`);
5876
- const buf = new Uint8Array(await res.arrayBuffer());
5877
- if (sha(buf) !== want) throw new Error(`${from}: not the file expected (its SHA-256 differs), so it was not kept`);
5878
- writeFileSync(path + ".tmp", buf);
5879
- renameSync(path + ".tmp", path);
5880
- say(`${to}: ${(buf.length / 1e6).toFixed(1)} MB`);
5937
+ }
5938
+ if (missing.length && !from) for (const [hub, to, want] of missing.filter(([, to, want]) => !(existsSync(join(out, to)) && sha(readFileSync(join(out, to))) === want))) {
5939
+ const res = await fetch(`${HUB}/${hub}`);
5940
+ if (!res.ok) throw new Error(`${hub}: ${res.status} ${res.statusText}`);
5941
+ keep(out, to, want, new Uint8Array(await res.arrayBuffer()), say);
5881
5942
  }
5882
5943
  say(`The model is in ${out}`);
5883
5944
  }
5884
5945
  //#endregion
5885
5946
  //#region packages/server/src/embedder.ts
5886
- const MODEL = "bge-small-en-v1.5-q8";
5887
- /** Where the model's files are (npm run model in a checkout, isorite model when installed), or null when they are
5888
- * not there. */
5947
+ const MODEL = `${NAME$1}-q8`;
5948
+ /** Where the model's files are (npm run model in a checkout, into packages/model; isorite model when installed), or
5949
+ * null when they are not there. */
5889
5950
  function modelDir(env = process.env) {
5890
5951
  if (env.ISORITE_EMBED === "off") return null;
5891
- return (env.ISORITE_EMBED_DIR ? [env.ISORITE_EMBED_DIR] : [join(dirname(fileURLToPath(import.meta.url)), "..", "models", "bge-small-en-v1.5"), userModelDir(env)]).find((dir) => existsSync(join(dir, "model.onnx")) && existsSync(join(dir, "tokenizer.json"))) ?? null;
5952
+ return (env.ISORITE_EMBED_DIR ? [env.ISORITE_EMBED_DIR] : [join(dirname(fileURLToPath(import.meta.url)), "..", "..", "model"), userModelDir(env)]).find((dir) => existsSync(join(dir, "model.onnx")) && existsSync(join(dir, "tokenizer.json"))) ?? null;
5892
5953
  }
5893
5954
  /** The folder caches are kept in: outside both repositories, rebuilt from the notes whenever it is lost. */
5894
5955
  const cacheDir = (env = process.env) => join(env.XDG_CACHE_HOME || join(homedir(), ".cache"), "isorite");
@@ -9090,7 +9151,7 @@ async function mcp(path, { port = 4767, agent = "mcp", quiet = QUIET_MS, input =
9090
9151
  }
9091
9152
  //#endregion
9092
9153
  //#region packages/server/src/main.ts
9093
- const VERSION = "0.2.0-trial.1";
9154
+ const VERSION = "0.2.0";
9094
9155
  const USAGE = `isorite: an agentic harness for understanding
9095
9156
 
9096
9157
  isorite check <notes> check a folder of notes: frontmatter, links, cycles
@@ -9105,7 +9166,8 @@ const USAGE = `isorite: an agentic harness for understanding
9105
9166
  isorite mcp [<study base | notes>] [--port <n>] [--agent <name>]
9106
9167
  the knowledge base's tools over MCP, on stdio, for Claude Code or Pi:
9107
9168
  claude mcp add isorite -- isorite mcp <base> --agent claude-code
9108
- isorite model fetch the model for search by meaning (34 MB, once)
9169
+ isorite model [--from <folder>] fetch the model for search by meaning (53 MB, once): from npm, else
9170
+ Hugging Face; or from a folder its files were copied into
9109
9171
  isorite --tutorial [<folder>] [--port <n>]
9110
9172
  the tutorial, on the example base, with a scripted model (no key,
9111
9173
  nothing sent anywhere): the terminal's tour in OpenCode 2, and the
@@ -9182,10 +9244,17 @@ function main(argv) {
9182
9244
  return 2;
9183
9245
  });
9184
9246
  }
9185
- if (command === "model") return fetchModel(userModelDir()).then(() => 0, (e) => {
9186
- console.error(e.message);
9187
- return 1;
9188
- });
9247
+ if (command === "model") {
9248
+ const from = rest[rest.indexOf("--from") + 1];
9249
+ if (rest.includes("--from") && !from) {
9250
+ console.error("--from takes a folder");
9251
+ return 2;
9252
+ }
9253
+ return fetchModel(userModelDir(), console.log, from && rest.includes("--from") ? { from } : {}).then(() => 0, (e) => {
9254
+ console.error(e.message);
9255
+ return 1;
9256
+ });
9257
+ }
9189
9258
  if (command === "--version" || command === "-v") {
9190
9259
  console.log(VERSION);
9191
9260
  return 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isorite",
3
- "version": "0.2.0-trial.1",
3
+ "version": "0.2.0",
4
4
  "description": "An agentic harness for understanding: your notes as a knowledge base, an Atlas of them, an agent that reads them, and study.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,4 +1,4 @@
1
- import{$ as e,A as t,B as n,D as r,E as i,F as a,H as o,J as s,L as c,O as l,P as u,Q as d,U as f,X as p,Y as m,at as h,b as g,c as _,h as v,i as y,j as b,k as x,n as S,ot as ee,q as C,rt as te,s as ne,tt as w,u as re,ut as T,w as E,x as ie,z as ae}from"./C8UdwlAg.js";import{t as oe}from"./DAVQx5al.js";import"./xihTtKlq.js";import{i as se,n as ce,t as D}from"./DTwIGCa8.js";import{C as le,S as ue,T as de,_ as fe,a as pe,f as me,h as he,i as ge,m as _e,n as ve,p as ye,r as be,t as xe,v as Se,w as Ce}from"./CEQ-cFxt.js";import{i as we}from"./D56iKolu.js";var Te=class{note;#e=e([]);get entries(){return c(this.#e)}set entries(e){d(this.#e,e)}#t=e(null);get prompt(){return c(this.#t)}set prompt(e){d(this.#t,e)}#n=e(null);get asking(){return c(this.#n)}set asking(e){d(this.#n,e)}#r=e(null);get failed(){return c(this.#r)}set failed(e){d(this.#r,e)}get tier(){return be.tier}#i=e(null);get cursor(){return c(this.#i)}set cursor(e){d(this.#i,e)}#a=e(``);get busy(){return c(this.#a)}set busy(e){d(this.#a,e,!0)}#o=e(null);get editing(){return c(this.#o)}set editing(e){d(this.#o,e,!0)}stop=null;constructor(e){this.note=e}#s=w(()=>Se(this.entries));get waiting(){return c(this.#s)}set waiting(e){d(this.#s,e)}#c=w(()=>this.waiting.filter(e=>e.form===`insert`));get proposals(){return c(this.#c)}set proposals(e){d(this.#c,e)}#l=w(()=>{let e=[],t=ue(this.note.text);for(let n of this.waiting)if(n.form===`rewrite`)for(let r of n.open??[]){let i=n.regions[r],a=me(this.note.text,i.old),o=a?this.note.text.slice(0,a.from).split(`
1
+ import{$ as e,A as t,B as n,D as r,E as i,F as a,H as o,J as s,L as c,O as l,P as u,Q as d,U as f,X as p,Y as m,at as h,b as g,c as _,h as v,i as y,j as b,k as x,n as S,ot as ee,q as C,rt as te,s as ne,tt as w,u as re,ut as T,w as E,x as ie,z as ae}from"./C8UdwlAg.js";import{t as oe}from"./Cw2GjAJR.js";import"./xihTtKlq.js";import{i as se,n as ce,t as D}from"./DjBHskLm.js";import{C as le,S as ue,T as de,_ as fe,a as pe,f as me,h as he,i as ge,m as _e,n as ve,p as ye,r as be,t as xe,v as Se,w as Ce}from"./B_nIecMW.js";import{i as we}from"./UM_L7-f7.js";var Te=class{note;#e=e([]);get entries(){return c(this.#e)}set entries(e){d(this.#e,e)}#t=e(null);get prompt(){return c(this.#t)}set prompt(e){d(this.#t,e)}#n=e(null);get asking(){return c(this.#n)}set asking(e){d(this.#n,e)}#r=e(null);get failed(){return c(this.#r)}set failed(e){d(this.#r,e)}get tier(){return be.tier}#i=e(null);get cursor(){return c(this.#i)}set cursor(e){d(this.#i,e)}#a=e(``);get busy(){return c(this.#a)}set busy(e){d(this.#a,e,!0)}#o=e(null);get editing(){return c(this.#o)}set editing(e){d(this.#o,e,!0)}stop=null;constructor(e){this.note=e}#s=w(()=>Se(this.entries));get waiting(){return c(this.#s)}set waiting(e){d(this.#s,e)}#c=w(()=>this.waiting.filter(e=>e.form===`insert`));get proposals(){return c(this.#c)}set proposals(e){d(this.#c,e)}#l=w(()=>{let e=[],t=ue(this.note.text);for(let n of this.waiting)if(n.form===`rewrite`)for(let r of n.open??[]){let i=n.regions[r],a=me(this.note.text,i.old),o=a?this.note.text.slice(0,a.from).split(`
2
2
  `).length-1:-1,s=t.find(e=>e.from<=o&&o<e.to);e.push({key:`r:${n.id}:${r}`,proposal:n,k:r,at:a,block:/\n/.test(i.old.text.trim())||/\n/.test(i.new.trim()),code:!!(s&&/^\s*(```|~~~)/.test(s.text))})}return e.sort((e,t)=>(e.at?.from??1/0)-(t.at?.from??1/0))});get changes(){return c(this.#l)}set changes(e){d(this.#l,e)}#u=w(()=>{try{let e=Ce(this.note.text)[0];return{lines:e.split(`
3
3
  `).length-1,chars:e.length}}catch{return{lines:0,chars:0}}});get head(){return c(this.#u)}set head(e){d(this.#u,e)}get foot(){return this.note.text.split(`
4
4
  `).length}spans(e){return e.flatMap(e=>{let t=me(this.note.text,e);return t?[t]:[]})}placed(e){return he(this.note.text,e)!==null}#d=w(()=>{let e=[];for(let t of this.proposals){let n=he(this.note.text,t);e.push({key:`p:${t.id}`,line:n?.form===`insert`?n.line:this.foot})}this.changes.some(e=>!e.at)&&e.push({key:`lost`,line:this.foot}),this.asking&&e.push({key:`asking`,line:this.asking.line}),this.failed&&e.push({key:`failed`,line:this.failed.line}),this.prompt&&e.push({key:`prompt`,line:this.prompt.line});let t=this.changes.filter(e=>e.at);for(let n of t)n.block&&e.push({key:n.key,line:this.note.text.slice(0,n.at.to).split(`
@@ -1 +1 @@
1
- import"./C8UdwlAg.js";import{i as e}from"./DAVQx5al.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
1
+ import"./C8UdwlAg.js";import{i as e}from"./Cw2GjAJR.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
@@ -1 +1 @@
1
- import{$ as e,L as t,Q as n}from"./C8UdwlAg.js";import{t as r}from"./DTwIGCa8.js";import{i,r as a}from"./CEQ-cFxt.js";import{i as o}from"./D56iKolu.js";var s=new class{#e=e(``);get id(){return t(this.#e)}set id(e){n(this.#e,e,!0)}#t=e([]);get turns(){return t(this.#t)}set turns(e){n(this.#t,e)}#n=e(``);get streaming(){return t(this.#n)}set streaming(e){n(this.#n,e,!0)}#r=e(``);get problem(){return t(this.#r)}set problem(e){n(this.#r,e,!0)}#i=e(null);get report(){return t(this.#i)}set report(e){n(this.#i,e)}#a=e(`chat`);get view(){return t(this.#a)}set view(e){n(this.#a,e,!0)}#o=e([]);get off(){return t(this.#o)}set off(e){n(this.#o,e)}toggleTurn(e){this.off=this.off.includes(e)?this.off.filter(t=>t!==e):[...this.off,e],this.measure()}sizeOf(e){let t=this.report?.given?.find(t=>t.kind===e.kind&&t.id===e.id&&(e.kind!==`passage`||t.text===e.text));return t?t.tokens:null}started=!1;timer;get running(){let e=this.turns.at(-1);return e?.state===`running`?e:null}start(){!this.started&&r.api&&(this.started=!0,r.api.conversation().then(e=>{e&&!this.id&&this.show(e)},()=>void 0),r.on(e=>this.follow(e)),this.measure())}show(e){this.id=e.id,this.turns=e.turns}fresh(){this.running||(this.id=``,this.turns=[],this.streaming=``,this.off=[],this.measure())}async send(e){if(this.problem=``,!e.trim()||this.running)return!1;try{let t=i.sent.map(e=>e.kind===`passage`?{kind:e.kind,id:e.id,text:e.text}:{kind:e.kind,id:e.id}),{conversation:n}=await r.api.converse({...this.id?{conversation:this.id}:{},mode:o.mode,asked:e.trim(),given:t,tier:a.tier,...this.off.length?{off:this.off}:{}});return this.id=n,!0}catch(e){return this.problem=e.message,!1}}async stop(){let e=this.running;e&&await r.api.stop(e.id)}async undo(e){this.problem=``;try{await r.api.undoTurn(this.id,e)}catch(e){this.problem=e.message}}async answer(e,t){let n=this.running;n&&await r.api.answer(n.id,e,t)}follow(e){if(e.type===`agent-start`){o.want(`atlas`,`iso`,o.busy(`atlas`));return}if(e.type===`iso-start`&&e.place.form===`turn`){if(this.id&&e.place.conversation!==this.id)return;this.id=e.place.conversation,this.streaming=``,o.want(`atlas`,`iso`,o.busy(`atlas`)),this.turns=[...this.turns.filter(t=>t.id!==e.request),{id:e.request,conversation:e.place.conversation,at:new Date().toISOString(),mode:e.place.mode,asked:e.asked,given:e.place.given,tier:e.tier,items:[],state:`running`}];return}if(!(`request`in e)){(e.type===`note-changed`||e.type===`journal`)&&this.measure();return}let t=this.turns.findIndex(t=>t.id===e.request);if(t<0)return;let n=this.turns[t],i=e=>{this.turns=this.turns.map((n,r)=>r===t?e:n)};e.type===`iso-text`?this.streaming=e.again?e.delta:this.streaming+e.delta:e.type===`iso-item`?(e.item.kind===`text`&&(this.streaming=``),e.item.kind===`change`&&(e.item.note===r.open||e.item.to===r.open)&&o.want(`note`,`iso`,o.busy(`note`)),(e.item.kind===`change`&&e.item.note===`@understanding/${r.open}`||e.item.kind===`understood`&&e.item.note===r.open)&&o.want(`note`,`understand`,o.busy(`note`)),i({...n,items:[...n.items,e.item]})):e.type===`iso-answer`?i({...n,items:n.items.map(t=>t.kind===`permission`&&t.id===e.permission?{...t,answer:e.decision}:t)}):e.type===`iso-done`?(i({...n,state:`done`,cost:e.cost}),this.streaming=``,this.measure()):e.type===`iso-stopped`?(i({...n,state:`stopped`,...this.streaming?{items:[...n.items,{kind:`text`,text:this.streaming}]}:{}}),this.streaming=``):e.type===`iso-failed`&&(i({...n,state:`failed`,message:e.message}),this.streaming=``)}measure(){clearTimeout(this.timer),this.timer=setTimeout(()=>{if(!r.api)return;let e=i.sent.map(e=>e.kind===`passage`?{kind:e.kind,id:e.id,text:e.text}:{kind:e.kind,id:e.id});r.api.turnContext({...this.id?{conversation:this.id}:{},mode:o.mode,given:e,tier:a.tier,...this.off.length?{off:this.off}:{}}).then(e=>this.report=e,()=>void 0)},250)}};export{s as t};
1
+ import{$ as e,L as t,Q as n}from"./C8UdwlAg.js";import{t as r}from"./DjBHskLm.js";import{i,r as a}from"./B_nIecMW.js";import{i as o}from"./UM_L7-f7.js";var s=new class{#e=e(``);get id(){return t(this.#e)}set id(e){n(this.#e,e,!0)}#t=e([]);get turns(){return t(this.#t)}set turns(e){n(this.#t,e)}#n=e(``);get streaming(){return t(this.#n)}set streaming(e){n(this.#n,e,!0)}#r=e(``);get problem(){return t(this.#r)}set problem(e){n(this.#r,e,!0)}#i=e(null);get report(){return t(this.#i)}set report(e){n(this.#i,e)}#a=e(`chat`);get view(){return t(this.#a)}set view(e){n(this.#a,e,!0)}#o=e([]);get off(){return t(this.#o)}set off(e){n(this.#o,e)}toggleTurn(e){this.off=this.off.includes(e)?this.off.filter(t=>t!==e):[...this.off,e],this.measure()}sizeOf(e){let t=this.report?.given?.find(t=>t.kind===e.kind&&t.id===e.id&&(e.kind!==`passage`||t.text===e.text));return t?t.tokens:null}started=!1;timer;get running(){let e=this.turns.at(-1);return e?.state===`running`?e:null}start(){!this.started&&r.api&&(this.started=!0,r.api.conversation().then(e=>{e&&!this.id&&this.show(e)},()=>void 0),r.on(e=>this.follow(e)),this.measure())}show(e){this.id=e.id,this.turns=e.turns}fresh(){this.running||(this.id=``,this.turns=[],this.streaming=``,this.off=[],this.measure())}async send(e){if(this.problem=``,!e.trim()||this.running)return!1;try{let t=i.sent.map(e=>e.kind===`passage`?{kind:e.kind,id:e.id,text:e.text}:{kind:e.kind,id:e.id}),{conversation:n}=await r.api.converse({...this.id?{conversation:this.id}:{},mode:o.mode,asked:e.trim(),given:t,tier:a.tier,...this.off.length?{off:this.off}:{}});return this.id=n,!0}catch(e){return this.problem=e.message,!1}}async stop(){let e=this.running;e&&await r.api.stop(e.id)}async undo(e){this.problem=``;try{await r.api.undoTurn(this.id,e)}catch(e){this.problem=e.message}}async answer(e,t){let n=this.running;n&&await r.api.answer(n.id,e,t)}follow(e){if(e.type===`agent-start`){o.want(`atlas`,`iso`,o.busy(`atlas`));return}if(e.type===`iso-start`&&e.place.form===`turn`){if(this.id&&e.place.conversation!==this.id)return;this.id=e.place.conversation,this.streaming=``,o.want(`atlas`,`iso`,o.busy(`atlas`)),this.turns=[...this.turns.filter(t=>t.id!==e.request),{id:e.request,conversation:e.place.conversation,at:new Date().toISOString(),mode:e.place.mode,asked:e.asked,given:e.place.given,tier:e.tier,items:[],state:`running`}];return}if(!(`request`in e)){(e.type===`note-changed`||e.type===`journal`)&&this.measure();return}let t=this.turns.findIndex(t=>t.id===e.request);if(t<0)return;let n=this.turns[t],i=e=>{this.turns=this.turns.map((n,r)=>r===t?e:n)};e.type===`iso-text`?this.streaming=e.again?e.delta:this.streaming+e.delta:e.type===`iso-item`?(e.item.kind===`text`&&(this.streaming=``),e.item.kind===`change`&&(e.item.note===r.open||e.item.to===r.open)&&o.want(`note`,`iso`,o.busy(`note`)),(e.item.kind===`change`&&e.item.note===`@understanding/${r.open}`||e.item.kind===`understood`&&e.item.note===r.open)&&o.want(`note`,`understand`,o.busy(`note`)),i({...n,items:[...n.items,e.item]})):e.type===`iso-answer`?i({...n,items:n.items.map(t=>t.kind===`permission`&&t.id===e.permission?{...t,answer:e.decision}:t)}):e.type===`iso-done`?(i({...n,state:`done`,cost:e.cost}),this.streaming=``,this.measure()):e.type===`iso-stopped`?(i({...n,state:`stopped`,...this.streaming?{items:[...n.items,{kind:`text`,text:this.streaming}]}:{}}),this.streaming=``):e.type===`iso-failed`&&(i({...n,state:`failed`,message:e.message}),this.streaming=``)}measure(){clearTimeout(this.timer),this.timer=setTimeout(()=>{if(!r.api)return;let e=i.sent.map(e=>e.kind===`passage`?{kind:e.kind,id:e.id,text:e.text}:{kind:e.kind,id:e.id});r.api.turnContext({...this.id?{conversation:this.id}:{},mode:o.mode,given:e,tier:a.tier,...this.off.length?{off:this.off}:{}}).then(e=>this.report=e,()=>void 0)},250)}};export{s as t};
@@ -1,4 +1,4 @@
1
- import{$ as e,L as t,Q as n,Z as r,ht as i,mt as a,pt as o}from"./C8UdwlAg.js";import{t as s}from"./DTwIGCa8.js";import{i as c}from"./D56iKolu.js";var l=Symbol.for(`yaml.alias`),u=Symbol.for(`yaml.document`),d=Symbol.for(`yaml.map`),f=Symbol.for(`yaml.pair`),p=Symbol.for(`yaml.scalar`),m=Symbol.for(`yaml.seq`),h=Symbol.for(`yaml.node.type`),g=e=>!!e&&typeof e==`object`&&e[h]===l,_=e=>!!e&&typeof e==`object`&&e[h]===u,v=e=>!!e&&typeof e==`object`&&e[h]===d,y=e=>!!e&&typeof e==`object`&&e[h]===f,b=e=>!!e&&typeof e==`object`&&e[h]===p,ee=e=>!!e&&typeof e==`object`&&e[h]===m;function x(e){if(e&&typeof e==`object`)switch(e[h]){case d:case m:return!0}return!1}function S(e){if(e&&typeof e==`object`)switch(e[h]){case l:case d:case p:case m:return!0}return!1}var te=e=>(b(e)||x(e))&&!!e.anchor,C=Symbol(`break visit`),w=Symbol(`skip children`),ne=Symbol(`remove node`);function re(e,t){let n=ae(t);_(e)?ie(null,e.contents,n,Object.freeze([e]))===ne&&(e.contents=null):ie(null,e,n,Object.freeze([]))}re.BREAK=C,re.SKIP=w,re.REMOVE=ne;function ie(e,t,n,r){let i=oe(e,t,n,r);if(S(i)||y(i))return se(e,r,i),ie(e,i,n,r);if(typeof i!=`symbol`){if(x(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=ie(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===C)return C;else i===ne&&(t.items.splice(e,1),--e)}}else if(y(t)){r=Object.freeze(r.concat(t));let e=ie(`key`,t.key,n,r);if(e===C)return C;e===ne&&(t.key=null);let i=ie(`value`,t.value,n,r);if(i===C)return C;i===ne&&(t.value=null)}}return i}function ae(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function oe(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(v(t))return n.Map?.(e,t,r);if(ee(t))return n.Seq?.(e,t,r);if(y(t))return n.Pair?.(e,t,r);if(b(t))return n.Scalar?.(e,t,r);if(g(t))return n.Alias?.(e,t,r)}function se(e,t,n){let r=t[t.length-1];if(x(r))r.items[e]=n;else if(y(r))e===`key`?r.key=n:r.value=n;else if(_(r))r.contents=n;else{let e=g(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var ce={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},le=e=>e.replace(/[!,[\]{}]/g,e=>ce[e]),ue=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+le(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&S(e.contents)){let t={};re(e.contents,(e,n)=>{S(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
1
+ import{$ as e,L as t,Q as n,Z as r,ht as i,mt as a,pt as o}from"./C8UdwlAg.js";import{t as s}from"./DjBHskLm.js";import{i as c}from"./UM_L7-f7.js";var l=Symbol.for(`yaml.alias`),u=Symbol.for(`yaml.document`),d=Symbol.for(`yaml.map`),f=Symbol.for(`yaml.pair`),p=Symbol.for(`yaml.scalar`),m=Symbol.for(`yaml.seq`),h=Symbol.for(`yaml.node.type`),g=e=>!!e&&typeof e==`object`&&e[h]===l,_=e=>!!e&&typeof e==`object`&&e[h]===u,v=e=>!!e&&typeof e==`object`&&e[h]===d,y=e=>!!e&&typeof e==`object`&&e[h]===f,b=e=>!!e&&typeof e==`object`&&e[h]===p,ee=e=>!!e&&typeof e==`object`&&e[h]===m;function x(e){if(e&&typeof e==`object`)switch(e[h]){case d:case m:return!0}return!1}function S(e){if(e&&typeof e==`object`)switch(e[h]){case l:case d:case p:case m:return!0}return!1}var te=e=>(b(e)||x(e))&&!!e.anchor,C=Symbol(`break visit`),w=Symbol(`skip children`),ne=Symbol(`remove node`);function re(e,t){let n=ae(t);_(e)?ie(null,e.contents,n,Object.freeze([e]))===ne&&(e.contents=null):ie(null,e,n,Object.freeze([]))}re.BREAK=C,re.SKIP=w,re.REMOVE=ne;function ie(e,t,n,r){let i=oe(e,t,n,r);if(S(i)||y(i))return se(e,r,i),ie(e,i,n,r);if(typeof i!=`symbol`){if(x(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=ie(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===C)return C;else i===ne&&(t.items.splice(e,1),--e)}}else if(y(t)){r=Object.freeze(r.concat(t));let e=ie(`key`,t.key,n,r);if(e===C)return C;e===ne&&(t.key=null);let i=ie(`value`,t.value,n,r);if(i===C)return C;i===ne&&(t.value=null)}}return i}function ae(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function oe(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(v(t))return n.Map?.(e,t,r);if(ee(t))return n.Seq?.(e,t,r);if(y(t))return n.Pair?.(e,t,r);if(b(t))return n.Scalar?.(e,t,r);if(g(t))return n.Alias?.(e,t,r)}function se(e,t,n){let r=t[t.length-1];if(x(r))r.items[e]=n;else if(y(r))e===`key`?r.key=n:r.value=n;else if(_(r))r.contents=n;else{let e=g(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var ce={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},le=e=>e.replace(/[!,[\]{}]/g,e=>ce[e]),ue=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+le(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&S(e.contents)){let t={};re(e.contents,(e,n)=>{S(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
2
2
  `)}};ue.defaultYaml={explicit:!1,version:`1.2`},ue.defaultTags={"!!":`tag:yaml.org,2002:`};function de(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function fe(e){let t=new Set;return re(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function pe(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function me(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=fe(e);let a=pe(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(b(t.node)||x(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function he(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=he(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=he(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=he(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=he(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function ge(e,t,n){if(Array.isArray(e))return e.map((e,t)=>ge(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!te(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var _e=class{constructor(e){Object.defineProperty(this,h,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!_(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=ge(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?he(i,{"":o},``,o):o}},ve=class extends _e{constructor(e){super(l),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],re(e,{Node:(e,t)=>{(g(t)||te(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(ge(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ye(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(de(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ye(e,t,n){if(g(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(x(t)){let r=0;for(let i of t.items){let t=ye(e,i,n);t>r&&(r=t)}return r}if(y(t)){let r=ye(e,t.key,n),i=ye(e,t.value,n);return Math.max(r,i)}return 1}var be=e=>!e||typeof e!=`function`&&typeof e!=`object`,T=class extends _e{constructor(e){super(p),this.value=e}toJSON(e,t){return t?.keep?this.value:ge(this.value,e,t)}toString(){return String(this.value)}};T.BLOCK_FOLDED=`BLOCK_FOLDED`,T.BLOCK_LITERAL=`BLOCK_LITERAL`,T.PLAIN=`PLAIN`,T.QUOTE_DOUBLE=`QUOTE_DOUBLE`,T.QUOTE_SINGLE=`QUOTE_SINGLE`;var xe=`tag:yaml.org,2002:`;function Se(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function E(e,t,n){if(_(e)&&(e=e.contents),S(e))return e;if(y(e)){let t=n.schema[d].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new ve(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=xe+t.slice(2));let l=Se(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new T(e);return c&&(c.node=t),t}l=e instanceof Map?o[d]:Symbol.iterator in Object(e)?o[m]:o[d]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new T(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Ce(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return E(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var we=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Te=class extends _e{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>S(t)||y(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(we(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(x(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Ce(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(x(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&b(i)?i.value:i:x(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!y(t))return!1;let n=t.value;return n==null||e&&b(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return x(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(x(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Ce(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Ee=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function De(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Oe=(e,t,n)=>e.endsWith(`
3
3
  `)?De(n,t):n.includes(`
4
4
  `)?`
@@ -1,4 +1,4 @@
1
- import{$ as e,A as t,D as n,F as r,H as i,J as a,L as o,M as s,N as c,P as l,Q as u,S as d,X as f,Y as p,Z as m,at as h,h as g,j as _,k as v,lt as ee,m as te,n as ne,ot as y,q as b,s as re,tt as x,u as S,ut as C,w,x as ie}from"./C8UdwlAg.js";import{t as ae}from"./DAVQx5al.js";import"./xihTtKlq.js";import{n as T,t as E}from"./DTwIGCa8.js";import{i as D}from"./CEQ-cFxt.js";import{i as O}from"./D56iKolu.js";import{t as k}from"./DhKewaLD.js";async function oe(){let{notes:e}=await E.api.notes(),t=await Promise.all(e.map(async e=>[e.id,(await E.api.readNote(e.id)).text]));return new Map(t)}async function se(e){let t=await oe(),n=[...e.keys()].filter(e=>!t.has(e));for(let[r,i]of t){if(e.has(r))continue;let t=n.find(t=>e.get(t)===i),{version:a}=await E.api.readNote(r);t?(await E.api.moveNote(r,t,a),n.splice(n.indexOf(t),1)):await E.api.deleteNote(r,a)}for(let t of n)await E.api.createNote(t,e.get(t));for(let[t,r]of e){if(n.includes(t))continue;let e=await E.api.readNote(t);e.text!==r&&await E.api.saveNote(t,{base:e.version,text:r})}await E.refresh()}var A={type:`string`};({...A}),{...A},{...A},{...A},{...A};var j={type:`string`};({...j}),{...j},{...j},{...j},{...j},{...j},{...j},{...j},{...j},{...j},{...j};var ce=`The change is written at once, under your name: the person sees your words marked in the note, and can undo it from the browser. Use this, never edit or write, for any note of the knowledge base.`;`${ce}`,`${ce}`;var M={insert:`how is a body inserted, and what does each node keep?`,rewrite:`answer my TODO`,speed:`how much faster is Barnes–Hut at N = 5000?`,octree:`How does the quadtree become an octree for 3D, and what changes in Barnes–Hut?`,close:`What goes wrong when two bodies pass close?`,octreeWrite:`write a note in algorithms on the octree: how the quadtree becomes one for 3D, and what changes in Barnes–Hut`,understand:`help me see why leapfrog's energy error stays bounded`,answer:`run backwards with −Δt, it retraces its steps`},N=`physics`,P=`integrators`,F=`algorithms`,I=`simulation`,L=(e,t)=>`${e}/${t}`,R=L(N,`newtons-law-of-gravitation`);L(N,`the-n-body-problem`);var z=L(N,`units`),B=L(N,`energy-conservation`),V=L(N,`softening`);L(P,`eulers-method`);var H=L(P,`leapfrog`);L(P,`symplectic-integrators`);var le=L(P,`choosing-the-timestep`);L(F,`direct-summation`);var ue=L(F,`centre-of-mass`),U=L(F,`the-quadtree`),W=L(F,`barnes-hut`),de=L(F,`cost-and-accuracy`),G=L(I,`the-main-loop`);L(I,`initial-conditions`);var fe=L(I,`diagnostics`),K=L(I,`two-galaxies-colliding`),pe=`Exact, and unaided.`,me=`$F = G m_1 m_2 / d^2 = 1 \\cdot \\tfrac12 \\cdot \\tfrac12 / 1 = \\tfrac14$.
1
+ import{$ as e,A as t,D as n,F as r,H as i,J as a,L as o,M as s,N as c,P as l,Q as u,S as d,X as f,Y as p,Z as m,at as h,h as g,j as _,k as v,lt as ee,m as te,n as ne,ot as y,q as b,s as re,tt as x,u as S,ut as C,w,x as ie}from"./C8UdwlAg.js";import{t as ae}from"./Cw2GjAJR.js";import"./xihTtKlq.js";import{n as T,t as E}from"./DjBHskLm.js";import{i as D}from"./B_nIecMW.js";import{i as O}from"./UM_L7-f7.js";import{t as k}from"./BEk5idXo.js";async function oe(){let{notes:e}=await E.api.notes(),t=await Promise.all(e.map(async e=>[e.id,(await E.api.readNote(e.id)).text]));return new Map(t)}async function se(e){let t=await oe(),n=[...e.keys()].filter(e=>!t.has(e));for(let[r,i]of t){if(e.has(r))continue;let t=n.find(t=>e.get(t)===i),{version:a}=await E.api.readNote(r);t?(await E.api.moveNote(r,t,a),n.splice(n.indexOf(t),1)):await E.api.deleteNote(r,a)}for(let t of n)await E.api.createNote(t,e.get(t));for(let[t,r]of e){if(n.includes(t))continue;let e=await E.api.readNote(t);e.text!==r&&await E.api.saveNote(t,{base:e.version,text:r})}await E.refresh()}var A={type:`string`};({...A}),{...A},{...A},{...A},{...A};var j={type:`string`};({...j}),{...j},{...j},{...j},{...j},{...j},{...j},{...j},{...j},{...j},{...j};var ce=`The change is written at once, under your name: the person sees your words marked in the note, and can undo it from the browser. Use this, never edit or write, for any note of the knowledge base.`;`${ce}`,`${ce}`;var M={insert:`how is a body inserted, and what does each node keep?`,rewrite:`answer my TODO`,speed:`how much faster is Barnes–Hut at N = 5000?`,octree:`How does the quadtree become an octree for 3D, and what changes in Barnes–Hut?`,close:`What goes wrong when two bodies pass close?`,octreeWrite:`write a note in algorithms on the octree: how the quadtree becomes one for 3D, and what changes in Barnes–Hut`,understand:`help me see why leapfrog's energy error stays bounded`,answer:`run backwards with −Δt, it retraces its steps`},N=`physics`,P=`integrators`,F=`algorithms`,I=`simulation`,L=(e,t)=>`${e}/${t}`,R=L(N,`newtons-law-of-gravitation`);L(N,`the-n-body-problem`);var z=L(N,`units`),B=L(N,`energy-conservation`),V=L(N,`softening`);L(P,`eulers-method`);var H=L(P,`leapfrog`);L(P,`symplectic-integrators`);var le=L(P,`choosing-the-timestep`);L(F,`direct-summation`);var ue=L(F,`centre-of-mass`),U=L(F,`the-quadtree`),W=L(F,`barnes-hut`),de=L(F,`cost-and-accuracy`),G=L(I,`the-main-loop`);L(I,`initial-conditions`);var fe=L(I,`diagnostics`),K=L(I,`two-galaxies-colliding`),pe=`Exact, and unaided.`,me=`$F = G m_1 m_2 / d^2 = 1 \\cdot \\tfrac12 \\cdot \\tfrac12 / 1 = \\tfrac14$.
2
2
 
3
3
  Each accelerates at $a = F/m = \\tfrac14 / \\tfrac12$.
4
4
 
@@ -1 +1 @@
1
- import{$ as e,D as t,F as n,H as r,I as i,L as a,P as o,Q as s,U as c,X as l,Y as u,at as d,c as f,ft as p,j as m,k as h,l as g,nt as _,ot as v,q as y,tt as b,u as x,ut as S,w as C,x as w}from"./C8UdwlAg.js";import{t as T}from"./DAVQx5al.js";import"./xihTtKlq.js";import{n as E,r as D,t as O}from"./DTwIGCa8.js";import{t as k}from"./Ch0511Wu.js";var A=m(`<p class="problem svelte-btgyzc" role="alert"> </p>`),j=m(`<form class="frame new svelte-btgyzc"><span class="frame-title">a new note</span> <label class="svelte-btgyzc"><span class="label">title</span> <input class="field" placeholder="Entropy" autocomplete="off"/></label> <label for="new-folder" class="svelte-btgyzc"><span class="label">folder</span></label> <!> <p class="faint path svelte-btgyzc"> </p> <!> <div class="row svelte-btgyzc"><button class="btn primary" type="submit">make it</button><button class="btn quiet" type="button">cancel</button></div></form>`),M=m(`<p class="soft empty svelte-btgyzc">This base has no notes yet. Make the first one.</p>`),N=m(`<span class="soft desc svelte-btgyzc"> </span>`),P=m(`<li class="svelte-btgyzc"><a class="svelte-btgyzc"><span class="serif title svelte-btgyzc"> </span><!></a></li>`),ee=m(`<section><h2 class="svelte-btgyzc"><span class="label"> </span><button class="btn quiet add svelte-btgyzc" type="button">+</button></h2> <ul class="svelte-btgyzc"></ul></section>`),te=m(`<li class="svelte-btgyzc"><a class="svelte-btgyzc"><span class="serif title svelte-btgyzc"> </span><span class="soft desc svelte-btgyzc"> </span></a></li>`),ne=m(`<section><h2 class="svelte-btgyzc"><span class="label">in the text</span></h2> <ul class="svelte-btgyzc"></ul></section>`),re=m(`<p class="soft empty svelte-btgyzc">No note matches.</p>`),ie=m(`<div class="notes svelte-btgyzc"><div class="top svelte-btgyzc"><label class="hidden-label" for="filter">Find a note</label> <input id="filter" class="field grow" type="search" placeholder="find a note" autocomplete="off"/> <button class="btn primary" type="button" data-tour="new-note">new note</button></div> <!> <!> <!> <!> <!></div>`);function F(o,m){v(m,!0);let F=e(``),I=e([]),L=e(!1),R=e(``),z=e(``),B=e(``),V=b(()=>a(F).trim().toLowerCase().split(/\s+/).filter(Boolean)),H=e=>a(V).every(t=>`${e.title}\n${e.id}\n${e.description}`.toLowerCase().includes(t)),U=b(()=>a(V).length?O.listing.notes.filter(H):O.listing.notes),ae=b(()=>{let e=new Map;if(!a(V).length)for(let t of O.listing.dirs)e.set(t,[]);for(let t of a(U))e.set(t.dir,[...e.get(t.dir)??[],t]);return[...e].sort(([e],[t])=>e<t?-1:+(e>t))}),W=b(()=>a(V).length?a(I).filter(e=>!a(U).some(t=>t.id===e.id)):[]);c(()=>{let e=a(F).trim();if(e.length<2){s(I,[]);return}let t=setTimeout(()=>{O.api.search(e).then(t=>{a(F).trim()===e&&s(I,t)},()=>void 0)},200);return()=>clearTimeout(t)});let G=b(()=>[a(z).trim().replace(/^\/+|\/+$/g,``),D(a(R))].filter(Boolean).join(`/`));function K(e=``){s(L,!0),s(z,e,!0),s(R,``),s(B,``)}async function oe(e){if(e.preventDefault(),!D(a(R)))s(B,`Give the note a title.`);else try{await O.api.createNote(a(G),`---\ntype: Concept\ntitle: ${JSON.stringify(a(R).trim())}\n---\n\n`),await O.refresh(),await T(E(a(G)))}catch(e){s(B,e.message,!0)}}var q=ie(),J=y(q),Y=l(y(J),2);g(Y),_(Y,!0);var se=l(Y,2);S(J);var X=l(J,2),ce=e=>{var o=j(),c=l(y(o),2),d=l(y(c),2);g(d),_(d,!0),S(c);var p=l(c,4);k(p,{id:`new-folder`,label:`folder`,placeholder:`none: the top of the base`,get value(){return a(z)},set value(e){s(z,e,!0)}});var m=l(p,2),v=u(m,!0),b=l(m,2),x=e=>{var n=A(),i=u(n,!0);r(()=>t(i,a(B))),h(e,n)};C(b,e=>{a(B)&&e(x)});var w=l(b,2),T=l(y(w));S(w),S(o),r(()=>t(v,a(G)?`${a(G)}.md`:` `)),i(`submit`,o,oe),f(d,()=>a(R),e=>s(R,e)),n(`click`,T,()=>s(L,!1)),h(e,o)};C(X,e=>{a(L)&&e(ce)});var Z=l(X,2),le=e=>{var t=M();h(e,t)};C(Z,e=>{!O.listing.notes.length&&!a(L)&&e(le)});var Q=l(Z,2);w(Q,17,()=>a(ae),([e,t])=>e,(e,i)=>{var o=b(()=>p(a(i),2));let s=()=>a(o)[0],c=()=>a(o)[1];var d=ee(),f=y(d),m=y(f),g=u(m,!0),_=l(m);S(f);var v=l(f,2);w(v,21,c,e=>e.id,(e,n)=>{var i=P(),o=y(i),s=y(o),c=u(s,!0),d=l(s),f=e=>{var i=N(),o=u(i,!0);r(()=>t(o,a(n).description)),h(e,i)};C(d,e=>{a(n).description&&e(f)}),S(o),S(i),r(e=>{x(o,`href`,e),t(c,a(n).title)},[()=>E(a(n).id)]),h(e,i)}),S(v),S(d),r(()=>{t(g,s()||`the top of the base`),x(_,`aria-label`,`New note in ${s()||`the top of the base`}`)}),n(`click`,_,()=>K(s())),h(e,d)});var $=l(Q,2),ue=e=>{var n=ne(),i=l(y(n),2);w(i,21,()=>a(W),e=>e.id,(e,n)=>{var i=te(),o=y(i),s=y(o),c=u(s,!0),d=l(s),f=u(d,!0);S(o),S(i),r(e=>{x(o,`href`,e),t(c,a(n).title),t(f,a(n).snippet)},[()=>E(a(n).id)]),h(e,i)}),S(i),S(n),h(e,n)};C($,e=>{a(W).length&&e(ue)});var de=l($,2),fe=e=>{var t=re();h(e,t)};C(de,e=>{a(V).length&&!a(U).length&&!a(W).length&&e(fe)}),S(q),f(Y,()=>a(F),e=>s(F,e)),n(`click`,se,()=>K()),h(o,q),d()}o([`click`]);export{F as t};
1
+ import{$ as e,D as t,F as n,H as r,I as i,L as a,P as o,Q as s,U as c,X as l,Y as u,at as d,c as f,ft as p,j as m,k as h,l as g,nt as _,ot as v,q as y,tt as b,u as x,ut as S,w as C,x as w}from"./C8UdwlAg.js";import{t as T}from"./Cw2GjAJR.js";import"./xihTtKlq.js";import{n as E,r as D,t as O}from"./DjBHskLm.js";import{t as k}from"./b-AOhhy1.js";var A=m(`<p class="problem svelte-btgyzc" role="alert"> </p>`),j=m(`<form class="frame new svelte-btgyzc"><span class="frame-title">a new note</span> <label class="svelte-btgyzc"><span class="label">title</span> <input class="field" placeholder="Entropy" autocomplete="off"/></label> <label for="new-folder" class="svelte-btgyzc"><span class="label">folder</span></label> <!> <p class="faint path svelte-btgyzc"> </p> <!> <div class="row svelte-btgyzc"><button class="btn primary" type="submit">make it</button><button class="btn quiet" type="button">cancel</button></div></form>`),M=m(`<p class="soft empty svelte-btgyzc">This base has no notes yet. Make the first one.</p>`),N=m(`<span class="soft desc svelte-btgyzc"> </span>`),P=m(`<li class="svelte-btgyzc"><a class="svelte-btgyzc"><span class="serif title svelte-btgyzc"> </span><!></a></li>`),ee=m(`<section><h2 class="svelte-btgyzc"><span class="label"> </span><button class="btn quiet add svelte-btgyzc" type="button">+</button></h2> <ul class="svelte-btgyzc"></ul></section>`),te=m(`<li class="svelte-btgyzc"><a class="svelte-btgyzc"><span class="serif title svelte-btgyzc"> </span><span class="soft desc svelte-btgyzc"> </span></a></li>`),ne=m(`<section><h2 class="svelte-btgyzc"><span class="label">in the text</span></h2> <ul class="svelte-btgyzc"></ul></section>`),re=m(`<p class="soft empty svelte-btgyzc">No note matches.</p>`),ie=m(`<div class="notes svelte-btgyzc"><div class="top svelte-btgyzc"><label class="hidden-label" for="filter">Find a note</label> <input id="filter" class="field grow" type="search" placeholder="find a note" autocomplete="off"/> <button class="btn primary" type="button" data-tour="new-note">new note</button></div> <!> <!> <!> <!> <!></div>`);function F(o,m){v(m,!0);let F=e(``),I=e([]),L=e(!1),R=e(``),z=e(``),B=e(``),V=b(()=>a(F).trim().toLowerCase().split(/\s+/).filter(Boolean)),H=e=>a(V).every(t=>`${e.title}\n${e.id}\n${e.description}`.toLowerCase().includes(t)),U=b(()=>a(V).length?O.listing.notes.filter(H):O.listing.notes),ae=b(()=>{let e=new Map;if(!a(V).length)for(let t of O.listing.dirs)e.set(t,[]);for(let t of a(U))e.set(t.dir,[...e.get(t.dir)??[],t]);return[...e].sort(([e],[t])=>e<t?-1:+(e>t))}),W=b(()=>a(V).length?a(I).filter(e=>!a(U).some(t=>t.id===e.id)):[]);c(()=>{let e=a(F).trim();if(e.length<2){s(I,[]);return}let t=setTimeout(()=>{O.api.search(e).then(t=>{a(F).trim()===e&&s(I,t)},()=>void 0)},200);return()=>clearTimeout(t)});let G=b(()=>[a(z).trim().replace(/^\/+|\/+$/g,``),D(a(R))].filter(Boolean).join(`/`));function K(e=``){s(L,!0),s(z,e,!0),s(R,``),s(B,``)}async function oe(e){if(e.preventDefault(),!D(a(R)))s(B,`Give the note a title.`);else try{await O.api.createNote(a(G),`---\ntype: Concept\ntitle: ${JSON.stringify(a(R).trim())}\n---\n\n`),await O.refresh(),await T(E(a(G)))}catch(e){s(B,e.message,!0)}}var q=ie(),J=y(q),Y=l(y(J),2);g(Y),_(Y,!0);var se=l(Y,2);S(J);var X=l(J,2),ce=e=>{var o=j(),c=l(y(o),2),d=l(y(c),2);g(d),_(d,!0),S(c);var p=l(c,4);k(p,{id:`new-folder`,label:`folder`,placeholder:`none: the top of the base`,get value(){return a(z)},set value(e){s(z,e,!0)}});var m=l(p,2),v=u(m,!0),b=l(m,2),x=e=>{var n=A(),i=u(n,!0);r(()=>t(i,a(B))),h(e,n)};C(b,e=>{a(B)&&e(x)});var w=l(b,2),T=l(y(w));S(w),S(o),r(()=>t(v,a(G)?`${a(G)}.md`:` `)),i(`submit`,o,oe),f(d,()=>a(R),e=>s(R,e)),n(`click`,T,()=>s(L,!1)),h(e,o)};C(X,e=>{a(L)&&e(ce)});var Z=l(X,2),le=e=>{var t=M();h(e,t)};C(Z,e=>{!O.listing.notes.length&&!a(L)&&e(le)});var Q=l(Z,2);w(Q,17,()=>a(ae),([e,t])=>e,(e,i)=>{var o=b(()=>p(a(i),2));let s=()=>a(o)[0],c=()=>a(o)[1];var d=ee(),f=y(d),m=y(f),g=u(m,!0),_=l(m);S(f);var v=l(f,2);w(v,21,c,e=>e.id,(e,n)=>{var i=P(),o=y(i),s=y(o),c=u(s,!0),d=l(s),f=e=>{var i=N(),o=u(i,!0);r(()=>t(o,a(n).description)),h(e,i)};C(d,e=>{a(n).description&&e(f)}),S(o),S(i),r(e=>{x(o,`href`,e),t(c,a(n).title)},[()=>E(a(n).id)]),h(e,i)}),S(v),S(d),r(()=>{t(g,s()||`the top of the base`),x(_,`aria-label`,`New note in ${s()||`the top of the base`}`)}),n(`click`,_,()=>K(s())),h(e,d)});var $=l(Q,2),ue=e=>{var n=ne(),i=l(y(n),2);w(i,21,()=>a(W),e=>e.id,(e,n)=>{var i=te(),o=y(i),s=y(o),c=u(s,!0),d=l(s),f=u(d,!0);S(o),S(i),r(e=>{x(o,`href`,e),t(c,a(n).title),t(f,a(n).snippet)},[()=>E(a(n).id)]),h(e,i)}),S(i),S(n),h(e,n)};C($,e=>{a(W).length&&e(ue)});var de=l($,2),fe=e=>{var t=re();h(e,t)};C(de,e=>{a(V).length&&!a(U).length&&!a(W).length&&e(fe)}),S(q),f(Y,()=>a(F),e=>s(F,e)),n(`click`,se,()=>K()),h(o,q),d()}o([`click`]);export{F as t};
@@ -0,0 +1 @@
1
+ import{$ as e,L as t,Q as n,R as r,a as i,n as a,t as o,z as s}from"./C8UdwlAg.js";var c=class{constructor(e,t){this.status=e,this.body=typeof t==`string`?{message:t}:t||{message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},l=class{constructor(e,t){try{new Headers({location:t})}catch{throw Error(`Invalid redirect location ${JSON.stringify(t)}: this string contains characters that cannot be used in HTTP headers`)}this.status=e,this.location=t}},u=class extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}};new URL(`sveltekit-internal://`);function d(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function f(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function p(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function ee(e,t,n,r=!1){let i=new URL(e);Object.defineProperty(i,"searchParams",{value:new Proxy(i.searchParams,{get(e,r){if(r===`get`||r===`getAll`||r===`has`)return(t,...i)=>(n(t),e[r](t,...i));t();let i=Reflect.get(e,r);return typeof i==`function`?i.bind(e):i}}),enumerable:!0,configurable:!0});let a=[`href`,`pathname`,`search`,`toString`,`toJSON`];r&&a.push(`hash`);for(let n of a)Object.defineProperty(i,n,{get(){return t(),e[n]},enumerable:!0,configurable:!0});return i}function h(){}function g(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}new TextEncoder;function _(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var te=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&v.delete(b(e)),te(e,t));var v=new Map;function y(e,t){let n=b(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent);r.getAttribute(`data-b64`)!==null&&(e=_(e));let i=r.getAttribute(`data-ttl`);return i&&v.set(n,{body:e,init:t,ttl:1e3*Number(i)}),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function ne(e,t,n){if(v.size>0){let t=b(e,n),r=v.get(t);if(r){if(performance.now()<r.ttl&&[`default`,`force-cache`,`only-if-cached`,void 0].includes(n?.cache))return new Response(r.body,r.init);v.delete(t)}}return window.fetch(t,n)}function b(e,t){let n=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){let e=[];t.headers&&e.push([...new Headers(t.headers)].join(`,`)),t.body&&(typeof t.body==`string`||ArrayBuffer.isView(t.body))&&e.push(t.body),n+=`[data-hash="${g(...e)}"]`}return n}var re=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,ie=/^\/\((?:[^)]+)\)$/;function ae(e){let t=[];return{pattern:e===`/`||ie.test(e)?/^\/$/:RegExp(`^${se(e).map(e=>{let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return le(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return le(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=re.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return le(e)}).join(``)}).join(``)}/?$`),params:t}}function oe(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function se(e){return e.slice(1).split(`/`).filter(oe)}function ce(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;e<t.length;e+=1){let s=t[e],c=i[e-o];if(s.chained&&s.rest&&o&&(c=i.slice(e-o,e+1).filter(e=>e).join(`/`),o=0),c===void 0){if(s.rest)c=``;else continue}if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0)}else if(s.optional&&s.chained)o++;else return}if(!o)return r}function le(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}var ue=/\[(\[)?(\.\.\.)?(\w+?)(?:=(\w+))?\]\]?/g;function de(e,t){let n=se(e),r=e!=`/`&&e.endsWith(`/`);return`/`+n.map(n=>n.replace(ue,(n,r,i,a)=>{let o=t[a];if(!o){if(r||i&&o!==void 0)return``;throw Error(`Missing parameter '${a}' in route ${e}`)}if(o.startsWith(`/`)||o.endsWith(`/`))throw Error(`Parameter '${a}' in route ${e} cannot start or end with a slash -- this would cause an invalid route like foo//bar`);return o})).filter(Boolean).join(`/`)+(r?`/`:``)}function fe({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=ae(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return ce(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function pe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function me(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var x=globalThis.__sveltekit_1tkk252?.base??``,he=globalThis.__sveltekit_1tkk252?.assets??x??``,ge=`#`;function _e(...e){if(!e[0].startsWith(`/`))throw Error(`Cannot use \`resolve(...)\` with a non-absolute pathname or route ID (got "${e[0]}"). \`resolve\` is only for internal pathnames and route IDs; external URLs should be used directly.`);return x+ge+de(e[0],e[1])}var ve=`1792725761097`,ye=`sveltekit:snapshot`,be=`sveltekit:scroll`,xe=`sveltekit:states`,S=`sveltekit:history`,C=`sveltekit:navigation`,w={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Se=location.origin;function Ce(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function T(){return{x:pageXOffset,y:pageYOffset}}function E(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var we={...w,"":w.hover};function Te(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ee(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=Te(e)}}function De(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||D(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===Se&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function Oe(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=E(s,`preload-code`)),i===null&&(i=E(s,`preload-data`)),t===null&&(t=E(s,`keepfocus`)),n===null&&(n=E(s,`noscroll`)),a===null&&(a=E(s,`reload`)),o===null&&(o=E(s,`replacestate`)),s=Te(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:we[r??`off`],preload_data:we[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function ke(e){let t=i(e),n=!0;function r(){n=!0,t.update(e=>e)}function a(e){n=!1,t.set(e)}function o(e){let r;return t.subscribe(t=>{(r===void 0||n&&t!==r)&&e(r=t)})}return{notify:r,set:a,subscribe:o}}var Ae={v:h};function je(){let{set:e,subscribe:t}=i(!1),n;async function r(){clearTimeout(n);try{let t=await fetch(`${he}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let r=(await t.json()).version!==ve;return r&&(e(!0),Ae.v(),clearTimeout(n)),r}catch{return!1}}return{subscribe:t,check:r}}function D(e,t,n){return e.origin!==Se||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Me(e){}var Ne=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);[...Ne],[...new Set([...Ne])];function Pe(e){return e.filter(e=>e!=null)}function O(e,t){return e+`/`+t}function Fe(e){return e instanceof c||e instanceof u?e.status:500}function Ie(e){return e instanceof u?e.text:`Internal Error`}var k,A,Le,Re=a.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(a.toString()),ze=`a:`;Re?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(ze)},A={current:null},Le={current:!1}):(k=new class{#e=e({});get data(){return t(this.#e)}set data(e){n(this.#e,e)}#t=e(null);get form(){return t(this.#t)}set form(e){n(this.#t,e)}#n=e(null);get error(){return t(this.#n)}set error(e){n(this.#n,e)}#r=e({});get params(){return t(this.#r)}set params(e){n(this.#r,e)}#i=e({id:null});get route(){return t(this.#i)}set route(e){n(this.#i,e)}#a=e({});get state(){return t(this.#a)}set state(e){n(this.#a,e)}#o=e(-1);get status(){return t(this.#o)}set status(e){n(this.#o,e)}#s=e(new URL(ze));get url(){return t(this.#s)}set url(e){n(this.#s,e)}},A=new class{#e=e(null);get current(){return t(this.#e)}set current(e){n(this.#e,e)}},Le=new class{#e=e(!1);get current(){return t(this.#e)}set current(e){n(this.#e,e)}},Ae.v=()=>Le.current=!0);function Be(e){Object.assign(k,e)}var Ve={spanContext(){return He},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}},He={traceId:``,spanId:``,traceFlags:0},{onMount:Ue,tick:We}=o,Ge=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),j=null,M=pe(`sveltekit:scroll`)??{},N=pe(`sveltekit:snapshot`)??{},P={url:ke({}),page:ke({}),navigating:i(null),updated:je()};function Ke(e){M[e]=T()}function qe(e,t){let n=e+1;for(;M[n];)delete M[n],n+=1;for(n=t+1;N[n];)delete N[n],n+=1}function F(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(h)}async function Je(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(x||`/`);e&&await e.update()}}var Ye,Xe,I,L,Ze,R,Qe={},$e={},z=[],B=[],V=null;function H(){V?.fork?.then(e=>e?.discard()),V=null,Q={element:void 0,href:void 0}}var et=new Map,tt=new Set,nt=new Set,U=new Set,W={branch:[],error:null,url:null,nav:null},rt=!1,it=!1,at=!0,G=!1,K=!1,ot=!1,st=!1,ct,q,J,Y,lt=new Set,ut=new Map,dt=new Map;async function ft(e,t,n){if(globalThis.__sveltekit_1tkk252.data){let{q:e={},p:t={},l:n={},f:r={}}=globalThis.__sveltekit_1tkk252.data;for(let t in e)Qe[t]=e[t];for(let e in n)Qe[e]=n[e];for(let e in r)Qe[e]=r[e];for(let e in t)$e[e]=t[e]}document.URL!==location.href&&(location.href=location.href),R=e,await e.hooks.init?.(),Ye=fe(e),L=document.documentElement,Ze=t,Xe=e.nodes[0],I=e.nodes[1],Xe(),I(),q=history.state?.[S],J=history.state?.[C],q||(q=J=Date.now(),history.replaceState({...history.state,[S]:q,[C]:J},``));let r=M[q];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await Bt(Ze,n)):(await Z({type:`enter`,url:Ce(R.hash?Kt(new URL(location.href)):location.href),replace_state:!0}),i()),zt()}function pt(){z.length=0,st=!1}function mt(e){B.some(e=>e?.snapshot)&&(N[e]=B.map(e=>e?.snapshot?.capture()))}function ht(e){N[e]?.forEach((e,t)=>{B[t]?.snapshot?.restore(e)})}function gt(){Ke(q),me(be,M),mt(J),me(ye,N)}async function _t(e,t,n,r){let i,a;t.invalidateAll&&H(),await Z({type:`goto`,url:Ce(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{if(t.invalidateAll){st=!0,i=new Set;for(let[e,t]of ut)for(let[n,r]of t)r.resource?.reset(),i.add(O(e,n));a=new Set;for(let[e,t]of dt)for(let n of t.keys())a.add(O(e,n))}t.invalidate&&t.invalidate.forEach(Rt)}}),t.invalidateAll&&s().then(s).then(()=>{for(let[e,t]of ut)for(let[n,{resource:r}]of t)i?.has(O(e,n))&&r.start();for(let[e,t]of dt)for(let[n,{resource:r}]of t)a?.has(O(e,n))&&r.reconnect()})}async function vt(e){if(e.id!==V?.id){H();let t={};lt.add(t),V={id:e.id,token:t,promise:Ot({...e,preload:t}).then(e=>(lt.delete(t),e.type===`loaded`&&e.state.error&&H(),e)),fork:null}}return V.promise}async function yt(e){let t=(await X(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function bt(e,t,n){let r={params:W.params,route:{id:W.route?.id??null},url:new URL(location.href)};if(W={...e.state,nav:r},Be(e.props.page),ct=new R.root({target:t,props:{...e.props,stores:P,components:B},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){let e={from:null,to:{...r,scroll:M[q]??T()},willUnload:!1,type:`enter`,complete:Promise.resolve()};U.forEach(t=>t(e))}ht(J),it=!0}async function xt({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(x&&(e.pathname===x||e.pathname===x+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=d(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:Pe(n).map(e=>e.node.component),page:Gt(k)}};s!==void 0&&(l.props.form=s);let u={},f=!k,p=0;for(let e=0;e<Math.max(n.length,W.branch.length);e+=1){let t=n[e],r=W.branch[e];t?.data!==r?.data&&(f=!0),t&&(u={...u,...t.data},f&&(l.props[`data_${p}`]=u),p+=1)}return(!W.url||e.href!==W.url.href||W.error!==a||s!==void 0&&s!==k.form||f)&&(l.props.page={error:a,params:t,route:{id:o?.id??null},state:{},status:i,url:new URL(e),form:s??null,data:f?u:k.data}),l}async function St({loader:e,parent:t,url:n,params:r,route:i,server_data_node:a}){let o=null,s=!0,c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if(l.universal?.load){function e(...e){for(let t of e){let{href:e}=new URL(t,n);c.dependencies.add(e)}}let u={tracing:{enabled:!1,root:Ve,current:Ve},route:new Proxy(i,{get:(e,t)=>(s&&(c.route=!0),e[t])}),params:new Proxy(r,{get:(e,t)=>(s&&c.params.add(t),e[t])}),data:a?.data??null,url:ee(n,()=>{s&&(c.url=!0)},e=>{s&&c.search_params.add(e)},R.hash),async fetch(t,r){t instanceof Request&&(r={body:t.method===`GET`||t.method===`HEAD`?void 0:await t.blob(),cache:t.cache,credentials:t.credentials,headers:[...t.headers].length>0?t?.headers:void 0,integrity:t.integrity,keepalive:t.keepalive,method:t.method,mode:t.mode,redirect:t.redirect,referrer:t.referrer,referrerPolicy:t.referrerPolicy,signal:t.signal,...r});let{resolved:i,promise:a}=Ct(t,r,n);return s&&e(i.href),a},setHeaders:h,depends:e,parent(){return s&&(c.parent=!0),t()},untrack(e){s=!1;try{return e()}finally{s=!0}}};o=await l.universal.load.call(null,u)??null}return{node:l,loader:e,server:a,universal:l.universal?.load?{type:`data`,data:o,uses:c}:null,data:o??a?.data??null,slash:l.universal?.trailingSlash??a?.slash}}function Ct(e,t,n){let r=e instanceof Request?e.url:e,i=new URL(r,n);return i.origin===n.origin&&(r=i.href.slice(n.origin.length)),{resolved:i,promise:it?ne(r,i.href,t):y(r,t)}}function wt(e,t,n,r,i,a){if(st)return!0;if(!i)return!1;if(i.parent&&e||i.route&&t||i.url&&n)return!0;for(let e of i.search_params)if(r.has(e))return!0;for(let e of i.params)if(a[e]!==W.params[e])return!0;for(let e of i.dependencies)if(z.some(t=>t(new URL(e))))return!0;return!1}function Tt(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function Et(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function Dt({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Gt(k),constructors:[]}}}async function Ot({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(V?.id===e)return lt.delete(V.token),V.promise;let{errors:o,layouts:s,leaf:u}=i,d=[...s,u];o.forEach(e=>e?.().catch(h)),d.forEach(e=>e?.[1]().catch(h));let f=W.url?e!==Nt(W.url):!1,p=W.route?i.id!==W.route.id:!1,m=Et(W.url,n),ee=!1,g=d.map(async(e,t)=>{if(!e)return;let a=W.branch[t];return e[1]===a?.loader&&!wt(ee,p,f,m,a.universal?.uses,r)?a:(ee=!0,St({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;n<t;n+=1)Object.assign(e,(await g[n])?.data);return e},server_data_node:Tt(e[0]?{type:`skip`}:null,e[0]?a?.server:void 0)}))});for(let e of g)e.catch(h);let _=[];for(let e=0;e<d.length;e+=1)if(d[e])try{_.push(await g[e])}catch(t){if(t instanceof l)return{type:`redirect`,location:t.location};if(a&&lt.has(a))return Dt({error:await $(t,{params:r,url:n,route:{id:i.id}}),url:n,params:r,route:i});let s=Fe(t),u;if(t instanceof c)u=t.body;else{if(await P.updated.check())return await Je(),await F(n);u=await $(t,{params:r,url:n,route:{id:i.id}})}let d=await kt(e,_,o);return d?xt({url:n,params:r,branch:_.slice(0,d.idx).concat(d.node),errors:o,status:s,error:u,route:i}):await Ft(n,{id:i.id},u,s)}else _.push(void 0);return xt({url:n,params:r,branch:_,errors:o,status:200,error:null,route:i,form:t?void 0:null})}async function kt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)--r;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function At({status:e,error:t,url:n,route:r}){let i={};try{return xt({url:n,params:i,branch:[await St({loader:Xe,url:n,params:i,route:r,parent:()=>Promise.resolve({}),server_data_node:Tt(null)}),{node:await I(),loader:I,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(t){if(t instanceof l){await _t(new URL(t.location,location.href),{},0);return}let a=await R.get_error_template(),o=await $(t,{url:n,params:i,route:r}),s=a({status:e,message:String(o?.message??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}),c=new DOMParser().parseFromString(s,`text/html`);throw document.documentElement.replaceChild(document.adoptNode(c.head),document.head),document.documentElement.replaceChild(document.adoptNode(c.body),document.body),t}}async function jt(e){let t=e.href;if(et.has(t))return et.get(t);let n;try{let r=(async()=>{let t=await R.hooks.reroute({url:new URL(e),fetch:async(t,n)=>Ct(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);R.hash?n.hash=t:n.pathname=t,t=n}return t})();et.set(t,r),n=await r}catch{et.delete(t);return}return n}async function X(e,t){if(e&&!D(e,x,R.hash)){let n=await jt(e);if(!n)return;let r=Mt(n);for(let n of Ye){let i=n.exec(r);if(i)return{id:Nt(e),invalidating:t,route:n,params:p(i),url:e}}}}function Mt(e){return f(R.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(x.length))||`/`}function Nt(e){return(R.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function Pt({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Wt(W,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return G||tt.forEach(e=>e(c)),o?null:s}async function Z({type:e,url:t,popped:n,keepfocus:i,noscroll:a,replace_state:o,state:c={},redirect_count:l=0,nav_token:d={},accept:f=h,block:p=h,event:m}){let ee=Y;Y=d;let g=await X(t,!1),_=e===`enter`?Wt(W,g,t,e):Pt({url:t,type:e,delta:n?.delta,intent:g,scroll:n?.scroll,event:m});if(!_){p(),Y===d&&(Y=ee);return}let te=q,v=J;f(),G=!0,it&&_.navigation.type!==`enter`&&P.navigating.set(A.current=_.navigation);let y=g&&await Ot(g);if(!y){if(D(t,x,R.hash))return await F(t,o);y=await Ft(t,{id:null},await $(new u(404,`Not Found`,`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,o)}if(t=g?.url||t,Y!==d){_.reject(Error(`navigation aborted`));return}if(!y)return;if(y.type===`redirect`){if(l<20){await Z({type:e,url:new URL(y.location,t),popped:n,keepfocus:i,noscroll:a,replace_state:o,state:c,redirect_count:l+1,nav_token:d}),_.fulfil(void 0);return}if(y=await At({status:500,error:await $(Error(`Redirect loop`),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}}),!y)return}else if(y.props.page.status>=400&&await P.updated.check())return await Je(),await F(t,o);if(pt(),Ke(te),mt(v),y.props.page.url.pathname!==t.pathname&&(t.pathname=y.props.page.url.pathname),c=n?n.state:c,!n){let e=+!o,n={[S]:q+=e,[C]:J+=e,[xe]:c};(o?history.replaceState:history.pushState).call(history,n,``,t),o||qe(q,J)}let ne=g&&V?.id===g.id?V.fork:null;V?.fork&&!ne?H():(V=null,Q={element:void 0,href:void 0}),y.props.page.state=c;let b;if(it){let e=(await Promise.all(Array.from(nt,e=>e(_.navigation)))).filter(e=>typeof e==`function`);if(e.length>0){function t(){e.forEach(e=>{U.delete(e)})}e.push(t),e.forEach(e=>{U.add(e)})}let n=_.navigation.to;W={...y.state,nav:{params:n.params,route:n.route,url:n.url}},y.props.page&&(y.props.page.url=t),!i&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();let a=ne&&await ne;a?b=a.commit():(j=null,ct.$set(y.props),j&&Object.assign(y.props.page,j),Be(y.props.page),b=r?.()),ot=!0}else await bt(y,Ze,!1);let{activeElement:re}=document;if(await b,await s(),await s(),Y!==d){_.reject(Error(`navigation aborted`));return}y.props.page&&j&&Object.assign(y.props.page,j);let ie=null;if(at){let e=n?n.scroll:a?T():null;e?scrollTo(e.x,e.y):(ie=t.hash&&document.getElementById(qt(t)))?ie.scrollIntoView():scrollTo(0,0)}let ae=document.activeElement!==re&&document.activeElement!==document.body;!i&&!ae&&Ut(t,!ie),at=!0,G=!1,_.fulfil(void 0),_.navigation.to&&(_.navigation.to.scroll=T()),U.forEach(e=>e(_.navigation)),e===`popstate`&&ht(J),P.navigating.set(A.current=null)}async function Ft(e,t,n,r,i){return e.origin===Se&&e.pathname===location.pathname&&!rt?await At({status:r,error:n,url:e,route:t}):await F(e,i)}var Q={element:void 0,href:void 0};function It(){let e,t;L.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{i(n,w.hover)},20)});function n(e){e.defaultPrevented||i(e.composedPath()[0],w.tap)}L.addEventListener(`mousedown`,n),L.addEventListener(`touchstart`,n,{passive:!0});let r=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(yt(new URL(t.target.href)),r.unobserve(t.target))},{threshold:0});async function i(e,n){let r=Ee(e,L),i=r===Q.element&&r?.href===Q.href&&n>=t;if(!r||i)return;let{url:a,external:o,download:s}=De(r,x,R.hash);if(o||s)return;let c=Oe(r),l=a&&Nt(W.url)===Nt(a);if(!(c.reload||l)){if(n<=c.preload_data){Q={element:r,href:r.href},t=w.tap;let e=await X(a,!1);if(!e)return;vt(e)}else n<=c.preload_code&&(Q={element:r,href:r.href},t=n,yt(a))}}function a(){r.disconnect();for(let e of L.querySelectorAll(`a`)){let{url:t,external:n,download:i}=De(e,x,R.hash);if(n||i)continue;let a=Oe(e);a.reload||(a.preload_code===w.viewport&&r.observe(e),a.preload_code===w.eager&&yt(t))}}U.add(a),a()}function $(e,t){if(e instanceof c)return e.body;let n=Fe(e),r=Ie(e);return R.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Lt(e,t={}){return e=new URL(Ce(e)),e.origin===Se?_t(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function Rt(e){if(typeof e==`function`)z.push(e);else{let{href:t}=new URL(e,location.href);z.push(e=>e.href===t)}}function zt(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(gt(),!G){let e=Wt(W,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};tt.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&gt()}),navigator.connection?.saveData||It(),L.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=Ee(t.composedPath()[0],L);if(!n)return;let{url:r,external:i,target:a,download:o}=De(n,x,R.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=Oe(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&r.protocol!==`https:`&&r.protocol!==`http:`||o)return;let[c,l]=(R.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l))Pt({url:r,type:`link`,event:t})?G=!0:t.preventDefault();else{if(l!==void 0&&u){let[,i]=W.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(K=!0,Ke(q),e(r),!s.replace_state)return;K=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Z({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}}),L.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(D(r,x,!1))return;let i=e.target,a=Oe(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Z({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!Ht){if(t.state?.[`sveltekit:history`]){let n=t.state[S];if(Y={},n===q)return;let r=M[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[C],s=W.url?m(location)===m(W.url):!1;if(o===J&&(ot||s)){i!==k.state&&(k.state=i),e(a),M[q]=T(),r&&scrollTo(r.x,r.y),q=n;return}let c=n-q;await Z({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{q=n,J=o},block:()=>{history.go(-c)},nav_token:Y,event:t})}else K||(e(new URL(location.href)),R.hash&&location.reload())}}),addEventListener(`hashchange`,()=>{K&&(K=!1,history.replaceState({...history.state,[S]:++q,[C]:J},``,location.href))});for(let e of document.querySelectorAll(`link`))Ge.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&P.navigating.set(A.current=null)});function e(e){W.url=k.url=e,P.page.set(Gt(k)),P.page.notify()}}async function Bt(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){rt=!0;let u=new URL(location.href),d;({params:i={},route:a={id:null}}=await X(u,!1)||{}),d=Ye.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=Vt(r.uses)),St({loader:R.nodes[t],url:u,params:i,route:a,parent:async()=>{let t={};for(let r=0;r<n;r+=1)Object.assign(t,(await e[r]).data);return t},server_data_node:Tt(r)})}),o=await Promise.all(e);if(d){let e=d.layouts;for(let t=0;t<e.length;t++)e[t]||o.splice(t,0,void 0)}f=await xt({url:u,params:i,branch:o,status:t,error:n,errors:d?.errors,form:c,route:d??null})}catch(t){if(t instanceof l)return await F(new URL(t.location,location.href));f=await At({status:Fe(t),error:await $(t,{url:u,params:i,route:a}),url:u,route:a}),e.textContent=``,p=!1}f&&(f.props.page&&(f.props.page.state={}),await bt(f,e,p))}function Vt(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??[])}}var Ht=!1;function Ut(e,t=!0){let n=document.querySelector(`[autofocus]`);if(n)n.focus();else{let n=qt(e);if(n&&document.getElementById(n)){let{x:r,y:i}=T();setTimeout(()=>{let a=history.state;Ht=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),Ht=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t<r.rangeCount;t+=1)e.push(r.getRangeAt(t));setTimeout(()=>{if(r.rangeCount===e.length){for(let t=0;t<r.rangeCount;t+=1){let n=e[t],i=r.getRangeAt(t);if(n.commonAncestorContainer!==i.commonAncestorContainer||n.startContainer!==i.startContainer||n.endContainer!==i.endContainer||n.startOffset!==i.startOffset||n.endOffset!==i.endOffset)return}r.removeAllRanges()}})}}}function Wt(e,t,n,r,i=null){let a,o,s=new Promise((e,t)=>{a=e,o=t});return s.catch(h),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:T()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function Gt(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 Kt(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function qt(e){let t;if(R.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Me as a,k as i,ft as n,_e as o,A as r,Lt as t};
@@ -1 +1 @@
1
- import{$ as e,L as t,Q as n}from"./C8UdwlAg.js";import{o as r}from"./DAVQx5al.js";var i=class extends Error{status;current;constructor(e,t,n){super(e),this.status=t,this.current=n}};function a(e=new URL(`api/`,document.baseURI).href){let t=null,n=async(t,n)=>{let r;try{r=await fetch(e+t,n)}catch{throw new i(`isorite is not answering`,0)}let a=await r.json().catch(()=>({}));if(!r.ok)throw new i(a.error??r.statusText,r.status,a.current);return a},r=()=>n(`session`),a=async(e,i,a)=>{t??=r().then(e=>e.token);let o={"Content-Type":`application/json`,"x-isorite-token":await t};return n(i,{method:e,headers:o,body:JSON.stringify(a)})},o=e=>`?id=${encodeURIComponent(e)}`;return{session:async()=>{let{token:e,...n}=await r();return t=Promise.resolve(e),n},notes:()=>n(`notes`),readNote:e=>n(`note`+o(e)),saveNote:(e,t)=>a(`PUT`,`note`+o(e),t),createNote:(e,t)=>a(`POST`,`note`+o(e),{text:t}),journal:e=>n(`journal`+o(e)),version:async(e,t)=>(await n(`version`+o(e)+`&entry=`+encodeURIComponent(t))).text,moveNote:(e,t,n)=>a(`POST`,`note/move`+o(e),{to:t,base:n}),deleteNote:async(e,t)=>{await a(`POST`,`note/delete`+o(e),{base:t})},restore:(e,t,n)=>a(`POST`,`note/restore`+o(e),{entry:t,base:n}),map:()=>n(`map`),timeline:()=>n(`timeline`),search:e=>n(`search?q=${encodeURIComponent(e)}`),ask:e=>a(`POST`,`iso/ask`,e),converse:e=>a(`POST`,`iso/converse`,e),understanding:e=>n(`understanding`+o(e)),saveScratchpad:(e,t,n)=>a(`POST`,`understanding/scratchpad`+o(e),{scratchpad:t,base:n}),undoTurn:(e,t)=>a(`POST`,`iso/undo`,{conversation:e,turn:t}),answer:async(e,t,n)=>{await a(`POST`,`iso/answer`,{turn:e,permission:t,decision:n})},conversation:async e=>{let t=await n(`conversation`+(e?o(e):``));return t.id?t:null},turnContext:e=>n(`turn/context?turn=${encodeURIComponent(JSON.stringify(e))}`),stop:async e=>{await a(`POST`,`iso/stop`,{request:e})},keep:(e,t,n)=>a(`POST`,`proposal/keep`+o(e),{proposal:t,...n===void 0?{}:{region:n}}),revise:async(e,t,n)=>{await a(`POST`,`proposal/revise`+o(e),{proposal:t,text:n})},discard:async(e,t,n)=>{await a(`POST`,`proposal/discard`+o(e),{proposal:t,...n===void 0?{}:{region:n}})},drafts:()=>n(`drafts`),createDraft:()=>a(`POST`,`drafts`,{}),keepDraft:(e,t,n)=>a(`POST`,`draft/keep`+o(e),{proposal:t,folder:n}),discardDraft:async e=>{await a(`POST`,`draft/discard`+o(e),{})},createExerciseDraft:(e,t,n)=>a(`POST`,`exercise/draft`,{folder:e,tests:t,after:n??null}),keepExercise:(e,t)=>a(`POST`,`exercise/keep`+o(e),{proposal:t}),study:()=>n(`study`),windBack:async e=>{await a(`POST`,`exercise/wind-back`+o(e),{})},context:(e,t)=>n(`context`+(e?o(e):``)+(t?`${e?`&`:`?`}choice=${encodeURIComponent(JSON.stringify(t))}`:``)),clearConversation:async()=>{await a(`POST`,`context/clear`,{})},settings:()=>n(`settings`),setKey:e=>a(`PUT`,`settings/key`,{key:e}),connect:e=>a(`POST`,`settings/connect`,{callback:e}),connected:(e,t)=>a(`POST`,`settings/connected`,{code:e,state:t}),agentTools:()=>n(`agent/tools`),agentLook:e=>a(`POST`,`agent/look`,e),agentWrite:e=>a(`POST`,`agent/write`,e),agentSend:e=>a(`POST`,`agent/send`,e),agentReceived:async(e,t)=>{await a(`POST`,`agent/received`,{id:e,agent:t})},agentStatus:async(e,t,n)=>{await a(`POST`,`agent/status`,{agent:e,session:t,busy:n})},terminal:{view:()=>n(`terminal`),prompt:async(e,t)=>{await a(`POST`,`terminal/prompt`,{asked:e,given:t})},stop:async()=>{await a(`POST`,`terminal/stop`,{})},reply:async(e,t)=>{await a(`POST`,`terminal/permission`,{id:e,decision:t})}},events(t){let n=new EventSource(e+`events`),r=e=>{try{t(JSON.parse(e.data))}catch{}};for(let e of[`note-changed`,`journal`,`record`,`iso-start`,`iso-step`,`iso-text`,`iso-item`,`iso-answer`,`iso-done`,`iso-stopped`,`iso-failed`,`agent-start`,`agent-step`,`agent-done`,`agent-sent`,`agent-received`,`terminal`])n.addEventListener(e,r);return()=>n.close()}}}var o=class{api;#e=e(null);get session(){return t(this.#e)}set session(e){n(this.#e,e)}#t=e({notes:[],dirs:[]});get listing(){return t(this.#t)}set listing(e){n(this.#t,e)}#n=e(``);get error(){return t(this.#n)}set error(e){n(this.#n,e,!0)}#r=e(``);get open(){return t(this.#r)}set open(e){n(this.#r,e,!0)}#i=e(``);get here(){return t(this.#i)}set here(e){n(this.#i,e,!0)}#a=e(null);get saving(){return t(this.#a)}set saving(e){n(this.#a,e,!0)}#o=e(null);get atlas(){return t(this.#o)}set atlas(e){n(this.#o,e)}#s=e(null);get exercise(){return t(this.#s)}set exercise(e){n(this.#s,e)}#c=e(!1);get studying(){return t(this.#c)}set studying(e){n(this.#c,e,!0)}#l=e(null);get signIn(){return t(this.#l)}set signIn(e){n(this.#l,e)}#u=e(null);get iso(){return t(this.#u)}set iso(e){n(this.#u,e)}watching=``;listeners=new Set;relist=null;async load(e=a()){this.api=e;try{[this.session,this.listing]=await Promise.all([e.session(),e.notes()])}catch(e){this.error=e.message;return}await this.signedIn(),e.events(e=>{this.follow(e);for(let t of this.listeners)t(e);e.type===`note-changed`&&(this.relist&&clearTimeout(this.relist),this.relist=setTimeout(()=>{this.refresh()},300))})}async startSignIn(){let{url:e}=await this.api.connect(location.origin+location.pathname);try{sessionStorage.setItem(s,location.hash)}catch{}location.assign(e)}async signedIn(){let e=new URLSearchParams(location.search),t,n;try{if(e.has(`code`)||e.has(`state`)||e.has(`error`)){let t=sessionStorage.getItem(s)??location.hash;return sessionStorage.removeItem(s),sessionStorage.setItem(c,JSON.stringify({code:e.get(`code`),state:e.get(`state`)})),location.replace(location.pathname+t),new Promise(()=>void 0)}let r=sessionStorage.getItem(c);if(r===null)return;sessionStorage.removeItem(c),{code:t,state:n}=JSON.parse(r)}catch{if({code:t,state:n}={code:e.get(`code`),state:e.get(`state`)},!t&&!n)return}if(!t||!n)this.signIn={ok:!1,message:`No key was made: the sign-in was left or refused.`};else try{let e=await this.api.connected(t,n);this.signIn={ok:!0,message:`Signed in at ${e.provider}: a key was made for isorite, and is held on this device.`}}catch(e){this.signIn={ok:!1,message:e.message}}}async refresh(){try{this.listing=await this.api.notes()}catch{}}follow(e){if(e.type===`iso-start`){this.iso={request:e.request,note:e.note,agent:null,state:`reading`,steps:[],message:``,start:e,text:``};return}if((e.type===`agent-start`||e.type===`agent-step`)&&this.iso?.request!==e.request){if(this.iso&&!this.iso.agent&&(this.iso.state===`reading`||this.iso.state===`writing`))return;this.iso={request:e.request,note:``,agent:e.agent,state:`reading`,steps:[],message:``}}let t=this.iso;t&&`request`in e&&e.request===t.request&&(e.type===`iso-step`||e.type===`agent-step`?this.iso={...t,state:`reading`,steps:[...t.steps,e.step]}:e.type===`iso-text`?this.iso={...t,state:`writing`,text:e.again?e.delta:(t.text??``)+e.delta}:e.type===`iso-done`||e.type===`agent-done`?this.iso={...t,state:`done`}:e.type===`iso-stopped`?this.iso={...t,state:`stopped`}:e.type===`iso-failed`&&(this.iso={...t,state:`failed`,message:e.message}))}on(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},s=`isorite.sign-in.back`,c=`isorite.sign-in.code`,l=new o,u=e=>r(`/n/[...id]`,{id:e});function d(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-+|-+$/g,``)}export{i,u as n,d as r,l as t};
1
+ import{$ as e,L as t,Q as n}from"./C8UdwlAg.js";import{o as r}from"./Cw2GjAJR.js";var i=class extends Error{status;current;constructor(e,t,n){super(e),this.status=t,this.current=n}};function a(e=new URL(`api/`,document.baseURI).href){let t=null,n=async(t,n)=>{let r;try{r=await fetch(e+t,n)}catch{throw new i(`isorite is not answering`,0)}let a=await r.json().catch(()=>({}));if(!r.ok)throw new i(a.error??r.statusText,r.status,a.current);return a},r=()=>n(`session`),a=async(e,i,a)=>{t??=r().then(e=>e.token);let o={"Content-Type":`application/json`,"x-isorite-token":await t};return n(i,{method:e,headers:o,body:JSON.stringify(a)})},o=e=>`?id=${encodeURIComponent(e)}`;return{session:async()=>{let{token:e,...n}=await r();return t=Promise.resolve(e),n},notes:()=>n(`notes`),readNote:e=>n(`note`+o(e)),saveNote:(e,t)=>a(`PUT`,`note`+o(e),t),createNote:(e,t)=>a(`POST`,`note`+o(e),{text:t}),journal:e=>n(`journal`+o(e)),version:async(e,t)=>(await n(`version`+o(e)+`&entry=`+encodeURIComponent(t))).text,moveNote:(e,t,n)=>a(`POST`,`note/move`+o(e),{to:t,base:n}),deleteNote:async(e,t)=>{await a(`POST`,`note/delete`+o(e),{base:t})},restore:(e,t,n)=>a(`POST`,`note/restore`+o(e),{entry:t,base:n}),map:()=>n(`map`),timeline:()=>n(`timeline`),search:e=>n(`search?q=${encodeURIComponent(e)}`),ask:e=>a(`POST`,`iso/ask`,e),converse:e=>a(`POST`,`iso/converse`,e),understanding:e=>n(`understanding`+o(e)),saveScratchpad:(e,t,n)=>a(`POST`,`understanding/scratchpad`+o(e),{scratchpad:t,base:n}),undoTurn:(e,t)=>a(`POST`,`iso/undo`,{conversation:e,turn:t}),answer:async(e,t,n)=>{await a(`POST`,`iso/answer`,{turn:e,permission:t,decision:n})},conversation:async e=>{let t=await n(`conversation`+(e?o(e):``));return t.id?t:null},turnContext:e=>n(`turn/context?turn=${encodeURIComponent(JSON.stringify(e))}`),stop:async e=>{await a(`POST`,`iso/stop`,{request:e})},keep:(e,t,n)=>a(`POST`,`proposal/keep`+o(e),{proposal:t,...n===void 0?{}:{region:n}}),revise:async(e,t,n)=>{await a(`POST`,`proposal/revise`+o(e),{proposal:t,text:n})},discard:async(e,t,n)=>{await a(`POST`,`proposal/discard`+o(e),{proposal:t,...n===void 0?{}:{region:n}})},drafts:()=>n(`drafts`),createDraft:()=>a(`POST`,`drafts`,{}),keepDraft:(e,t,n)=>a(`POST`,`draft/keep`+o(e),{proposal:t,folder:n}),discardDraft:async e=>{await a(`POST`,`draft/discard`+o(e),{})},createExerciseDraft:(e,t,n)=>a(`POST`,`exercise/draft`,{folder:e,tests:t,after:n??null}),keepExercise:(e,t)=>a(`POST`,`exercise/keep`+o(e),{proposal:t}),study:()=>n(`study`),windBack:async e=>{await a(`POST`,`exercise/wind-back`+o(e),{})},context:(e,t)=>n(`context`+(e?o(e):``)+(t?`${e?`&`:`?`}choice=${encodeURIComponent(JSON.stringify(t))}`:``)),clearConversation:async()=>{await a(`POST`,`context/clear`,{})},settings:()=>n(`settings`),setKey:e=>a(`PUT`,`settings/key`,{key:e}),connect:e=>a(`POST`,`settings/connect`,{callback:e}),connected:(e,t)=>a(`POST`,`settings/connected`,{code:e,state:t}),agentTools:()=>n(`agent/tools`),agentLook:e=>a(`POST`,`agent/look`,e),agentWrite:e=>a(`POST`,`agent/write`,e),agentSend:e=>a(`POST`,`agent/send`,e),agentReceived:async(e,t)=>{await a(`POST`,`agent/received`,{id:e,agent:t})},agentStatus:async(e,t,n)=>{await a(`POST`,`agent/status`,{agent:e,session:t,busy:n})},terminal:{view:()=>n(`terminal`),prompt:async(e,t)=>{await a(`POST`,`terminal/prompt`,{asked:e,given:t})},stop:async()=>{await a(`POST`,`terminal/stop`,{})},reply:async(e,t)=>{await a(`POST`,`terminal/permission`,{id:e,decision:t})}},events(t){let n=new EventSource(e+`events`),r=e=>{try{t(JSON.parse(e.data))}catch{}};for(let e of[`note-changed`,`journal`,`record`,`iso-start`,`iso-step`,`iso-text`,`iso-item`,`iso-answer`,`iso-done`,`iso-stopped`,`iso-failed`,`agent-start`,`agent-step`,`agent-done`,`agent-sent`,`agent-received`,`terminal`])n.addEventListener(e,r);return()=>n.close()}}}var o=class{api;#e=e(null);get session(){return t(this.#e)}set session(e){n(this.#e,e)}#t=e({notes:[],dirs:[]});get listing(){return t(this.#t)}set listing(e){n(this.#t,e)}#n=e(``);get error(){return t(this.#n)}set error(e){n(this.#n,e,!0)}#r=e(``);get open(){return t(this.#r)}set open(e){n(this.#r,e,!0)}#i=e(``);get here(){return t(this.#i)}set here(e){n(this.#i,e,!0)}#a=e(null);get saving(){return t(this.#a)}set saving(e){n(this.#a,e,!0)}#o=e(null);get atlas(){return t(this.#o)}set atlas(e){n(this.#o,e)}#s=e(null);get exercise(){return t(this.#s)}set exercise(e){n(this.#s,e)}#c=e(!1);get studying(){return t(this.#c)}set studying(e){n(this.#c,e,!0)}#l=e(null);get signIn(){return t(this.#l)}set signIn(e){n(this.#l,e)}#u=e(null);get iso(){return t(this.#u)}set iso(e){n(this.#u,e)}watching=``;listeners=new Set;relist=null;async load(e=a()){this.api=e;try{[this.session,this.listing]=await Promise.all([e.session(),e.notes()])}catch(e){this.error=e.message;return}await this.signedIn(),e.events(e=>{this.follow(e);for(let t of this.listeners)t(e);e.type===`note-changed`&&(this.relist&&clearTimeout(this.relist),this.relist=setTimeout(()=>{this.refresh()},300))})}async startSignIn(){let{url:e}=await this.api.connect(location.origin+location.pathname);try{sessionStorage.setItem(s,location.hash)}catch{}location.assign(e)}async signedIn(){let e=new URLSearchParams(location.search),t,n;try{if(e.has(`code`)||e.has(`state`)||e.has(`error`)){let t=sessionStorage.getItem(s)??location.hash;return sessionStorage.removeItem(s),sessionStorage.setItem(c,JSON.stringify({code:e.get(`code`),state:e.get(`state`)})),location.replace(location.pathname+t),new Promise(()=>void 0)}let r=sessionStorage.getItem(c);if(r===null)return;sessionStorage.removeItem(c),{code:t,state:n}=JSON.parse(r)}catch{if({code:t,state:n}={code:e.get(`code`),state:e.get(`state`)},!t&&!n)return}if(!t||!n)this.signIn={ok:!1,message:`No key was made: the sign-in was left or refused.`};else try{let e=await this.api.connected(t,n);this.signIn={ok:!0,message:`Signed in at ${e.provider}: a key was made for isorite, and is held on this device.`}}catch(e){this.signIn={ok:!1,message:e.message}}}async refresh(){try{this.listing=await this.api.notes()}catch{}}follow(e){if(e.type===`iso-start`){this.iso={request:e.request,note:e.note,agent:null,state:`reading`,steps:[],message:``,start:e,text:``};return}if((e.type===`agent-start`||e.type===`agent-step`)&&this.iso?.request!==e.request){if(this.iso&&!this.iso.agent&&(this.iso.state===`reading`||this.iso.state===`writing`))return;this.iso={request:e.request,note:``,agent:e.agent,state:`reading`,steps:[],message:``}}let t=this.iso;t&&`request`in e&&e.request===t.request&&(e.type===`iso-step`||e.type===`agent-step`?this.iso={...t,state:`reading`,steps:[...t.steps,e.step]}:e.type===`iso-text`?this.iso={...t,state:`writing`,text:e.again?e.delta:(t.text??``)+e.delta}:e.type===`iso-done`||e.type===`agent-done`?this.iso={...t,state:`done`}:e.type===`iso-stopped`?this.iso={...t,state:`stopped`}:e.type===`iso-failed`&&(this.iso={...t,state:`failed`,message:e.message}))}on(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},s=`isorite.sign-in.back`,c=`isorite.sign-in.code`,l=new o,u=e=>r(`/n/[...id]`,{id:e});function d(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-+|-+$/g,``)}export{i,u as n,d as r,l as t};
@@ -1 +1 @@
1
- import{$ as e,L as t,Q as n,Z as r}from"./C8UdwlAg.js";import{o as i,t as a}from"./DAVQx5al.js";import{n as o}from"./DTwIGCa8.js";var s=(e,t)=>{try{return localStorage.getItem(e)??t}catch{return t}},c=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},l=(e,t)=>{try{return{...t,...JSON.parse(s(e,`{}`))}}catch{return t}},u=[`note`,`atlas`,`iso`],d=[`cols`,`stack`,`one`],f=[`normal`,`iso`,`understand`],p=[`ask`,`write`,`build`,`understand`],m={note:1.25,atlas:1,iso:1.05},h={min:.4,max:3},g=new class{#e=e(r(d.includes(s(`isorite.layout`,``))?s(`isorite.layout`,``):`cols`));get layout(){return t(this.#e)}set layout(e){n(this.#e,e,!0)}#t=e(r(l(`isorite.show`,{note:!0,atlas:!0,iso:!0})));get show(){return t(this.#t)}set show(e){n(this.#t,e,!0)}#n=e(r(l(`isorite.widths`,m)));get widths(){return t(this.#n)}set widths(e){n(this.#n,e,!0)}#r=e(r(l(`isorite.lens`,{note:`normal`,atlas:`normal`})));get lens(){return t(this.#r)}set lens(e){n(this.#r,e,!0)}#i=e(r(p.includes(s(`isorite.mode`,``))?s(`isorite.mode`,``):`ask`));get mode(){return t(this.#i)}set mode(e){n(this.#i,e,!0)}#a=e(`note`);get focus(){return t(this.#a)}set focus(e){n(this.#a,e,!0)}#o=e(!1);get narrow(){return t(this.#o)}set narrow(e){n(this.#o,e,!0)}#s=e(r({}));get waiting(){return t(this.#s)}set waiting(e){n(this.#s,e,!0)}#c=e(0);get unseen(){return t(this.#c)}set unseen(e){n(this.#c,e,!0)}#l=e(!1);get tree(){return t(this.#l)}set tree(e){n(this.#l,e,!0)}#u=e(``);get fresh(){return t(this.#u)}set fresh(e){n(this.#u,e,!0)}#d=e(null);get settings(){return t(this.#d)}set settings(e){n(this.#d,e,!0)}#f=e(r(s(`isorite.last`,``)));get last(){return t(this.#f)}set last(e){n(this.#f,e,!0)}get standing(){if(this.narrow)return[...u];let e=u.filter(e=>this.show[e]);return this.layout===`one`?[e.includes(this.focus)?this.focus:e[0]??`note`]:e}layoutChanges=0;setLayout(e){e!==this.layout&&this.layoutChanges++,this.layout=e,c(`isorite.layout`,e)}nextLayout(){this.setLayout(d[(d.indexOf(this.layout)+1)%d.length])}toggle(e){this.show[e]&&u.filter(e=>this.show[e]).length===1||(this.show[e]=!this.show[e],c(`isorite.show`,JSON.stringify(this.show)),!this.show[e]&&this.focus===e&&(this.focus=u.find(e=>this.show[e])))}setWidth(e,t){this.widths[e]=Math.min(h.max,Math.max(h.min,t)),c(`isorite.widths`,JSON.stringify(this.widths))}to(e){!this.narrow&&!this.show[e]&&this.toggle(e),this.focus=e,e===`iso`&&(this.unseen=0),this.scroll?.(e)}scroll=null;step(e){let t=this.narrow?[...u]:u.filter(e=>this.show[e]),n=t.indexOf(this.focus);this.to(t[(n+e+t.length)%t.length])}setLens(e,t){this.lens[e]=t,delete this.waiting[e],c(`isorite.lens`,JSON.stringify(this.lens))}stepLens(e,t){this.setLens(e,f[(f.indexOf(this.lens[e])+t+f.length)%f.length])}want(e,t,n){this.lens[e]!==t&&(n?this.waiting[e]=t:this.setLens(e,t))}busy(e){let t=typeof document>`u`?null:document.activeElement;return!!t&&!!t.closest(`[data-pane="${e}"]`)&&(t.matches(`input, textarea, [contenteditable=true]`)||!!t.closest(`.cm-editor`))}#p=e(r([`ask`,`write`,`understand`]));get modes(){return t(this.#p)}set modes(e){n(this.#p,e,!0)}setBuild(e){e!==this.modes.includes(`build`)&&(this.modes=e?[`ask`,`write`,`build`,`understand`]:[`ask`,`write`,`understand`]),!e&&this.mode===`build`&&this.setMode(`ask`)}setMode(e){this.mode=e,c(`isorite.mode`,e),this.onMode?.()}onMode=null;stepMode(e){let t=this.modes;this.setMode(t[(t.indexOf(this.mode)+e+t.length)%t.length])}setLast(e){e&&!e.startsWith(`@`)&&(this.last=e,c(`isorite.last`,e))}async open(e,t=this.narrow){await a(o(e)),t&&this.to(`note`)}async home(){await a(i(`/notes`))}};export{g as i,f as n,u as r,d as t};
1
+ import{$ as e,L as t,Q as n,Z as r}from"./C8UdwlAg.js";import{o as i,t as a}from"./Cw2GjAJR.js";import{n as o}from"./DjBHskLm.js";var s=(e,t)=>{try{return localStorage.getItem(e)??t}catch{return t}},c=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},l=(e,t)=>{try{return{...t,...JSON.parse(s(e,`{}`))}}catch{return t}},u=[`note`,`atlas`,`iso`],d=[`cols`,`stack`,`one`],f=[`normal`,`iso`,`understand`],p=[`ask`,`write`,`build`,`understand`],m={note:1.25,atlas:1,iso:1.05},h={min:.4,max:3},g=new class{#e=e(r(d.includes(s(`isorite.layout`,``))?s(`isorite.layout`,``):`cols`));get layout(){return t(this.#e)}set layout(e){n(this.#e,e,!0)}#t=e(r(l(`isorite.show`,{note:!0,atlas:!0,iso:!0})));get show(){return t(this.#t)}set show(e){n(this.#t,e,!0)}#n=e(r(l(`isorite.widths`,m)));get widths(){return t(this.#n)}set widths(e){n(this.#n,e,!0)}#r=e(r(l(`isorite.lens`,{note:`normal`,atlas:`normal`})));get lens(){return t(this.#r)}set lens(e){n(this.#r,e,!0)}#i=e(r(p.includes(s(`isorite.mode`,``))?s(`isorite.mode`,``):`ask`));get mode(){return t(this.#i)}set mode(e){n(this.#i,e,!0)}#a=e(`note`);get focus(){return t(this.#a)}set focus(e){n(this.#a,e,!0)}#o=e(!1);get narrow(){return t(this.#o)}set narrow(e){n(this.#o,e,!0)}#s=e(r({}));get waiting(){return t(this.#s)}set waiting(e){n(this.#s,e,!0)}#c=e(0);get unseen(){return t(this.#c)}set unseen(e){n(this.#c,e,!0)}#l=e(!1);get tree(){return t(this.#l)}set tree(e){n(this.#l,e,!0)}#u=e(``);get fresh(){return t(this.#u)}set fresh(e){n(this.#u,e,!0)}#d=e(null);get settings(){return t(this.#d)}set settings(e){n(this.#d,e,!0)}#f=e(r(s(`isorite.last`,``)));get last(){return t(this.#f)}set last(e){n(this.#f,e,!0)}get standing(){if(this.narrow)return[...u];let e=u.filter(e=>this.show[e]);return this.layout===`one`?[e.includes(this.focus)?this.focus:e[0]??`note`]:e}layoutChanges=0;setLayout(e){e!==this.layout&&this.layoutChanges++,this.layout=e,c(`isorite.layout`,e)}nextLayout(){this.setLayout(d[(d.indexOf(this.layout)+1)%d.length])}toggle(e){this.show[e]&&u.filter(e=>this.show[e]).length===1||(this.show[e]=!this.show[e],c(`isorite.show`,JSON.stringify(this.show)),!this.show[e]&&this.focus===e&&(this.focus=u.find(e=>this.show[e])))}setWidth(e,t){this.widths[e]=Math.min(h.max,Math.max(h.min,t)),c(`isorite.widths`,JSON.stringify(this.widths))}to(e){!this.narrow&&!this.show[e]&&this.toggle(e),this.focus=e,e===`iso`&&(this.unseen=0),this.scroll?.(e)}scroll=null;step(e){let t=this.narrow?[...u]:u.filter(e=>this.show[e]),n=t.indexOf(this.focus);this.to(t[(n+e+t.length)%t.length])}setLens(e,t){this.lens[e]=t,delete this.waiting[e],c(`isorite.lens`,JSON.stringify(this.lens))}stepLens(e,t){this.setLens(e,f[(f.indexOf(this.lens[e])+t+f.length)%f.length])}want(e,t,n){this.lens[e]!==t&&(n?this.waiting[e]=t:this.setLens(e,t))}busy(e){let t=typeof document>`u`?null:document.activeElement;return!!t&&!!t.closest(`[data-pane="${e}"]`)&&(t.matches(`input, textarea, [contenteditable=true]`)||!!t.closest(`.cm-editor`))}#p=e(r([`ask`,`write`,`understand`]));get modes(){return t(this.#p)}set modes(e){n(this.#p,e,!0)}setBuild(e){e!==this.modes.includes(`build`)&&(this.modes=e?[`ask`,`write`,`build`,`understand`]:[`ask`,`write`,`understand`]),!e&&this.mode===`build`&&this.setMode(`ask`)}setMode(e){this.mode=e,c(`isorite.mode`,e),this.onMode?.()}onMode=null;stepMode(e){let t=this.modes;this.setMode(t[(t.indexOf(this.mode)+e+t.length)%t.length])}setLast(e){e&&!e.startsWith(`@`)&&(this.last=e,c(`isorite.last`,e))}async open(e,t=this.narrow){await a(o(e)),t&&this.to(`note`)}async home(){await a(i(`/notes`))}};export{g as i,f as n,u as r,d as t};
@@ -1 +1 @@
1
- import{$ as e,D as t,F as n,H as r,I as i,L as a,P as o,Q as s,X as c,Y as l,at as u,c as d,h as f,i as p,j as m,k as h,l as g,ot as _,q as v,tt as y,u as b,ut as x,w as S,x as C}from"./C8UdwlAg.js";import"./xihTtKlq.js";import{t as w}from"./DTwIGCa8.js";var T=m(`<li role="option"><button type="button" tabindex="-1" class="svelte-35e6rs"><span class="dir svelte-35e6rs"> </span><span class="detail svelte-35e6rs"> </span></button></li>`),E=m(`<ul class="suggest svelte-35e6rs" role="listbox" aria-label="folders"></ul>`),D=m(`<span class="field-wrap svelte-35e6rs"><input autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list"/> <!></span>`);function O(o,m){_(m,!0);let O=p(m,`value`,15,``),k=p(m,`placeholder`,3,``),A=p(m,`id`,3,`folder`),j=p(m,`quiet`,3,!1),M=e(!1),N=e(0),P=y(()=>O().trim().replace(/^\/+|\/+$/g,``).toLowerCase()),F=e=>w.listing.notes.filter(t=>t.dir===e).length,I=y(()=>{let e=w.listing.dirs.filter(e=>e.toLowerCase().includes(a(P))),t=e=>e.split(`/`).at(-1).toLowerCase().startsWith(a(P))?0:e.toLowerCase().startsWith(a(P))?1:2,n=e.sort((e,n)=>t(e)-t(n)||e.localeCompare(n)).map(e=>({dir:e,made:!1}));return a(P)&&!w.listing.dirs.some(e=>e.toLowerCase()===a(P))&&n.push({dir:O().trim().replace(/^\/+|\/+$/g,``),made:!0}),n.slice(0,8)});function L(e){O(e),s(M,!1),m.onpick?.(e)}function R(e){if(a(M)&&a(I).length){if(e.key===`ArrowDown`){s(N,(a(N)+1)%a(I).length),e.preventDefault();return}if(e.key===`ArrowUp`){s(N,(a(N)-1+a(I).length)%a(I).length),e.preventDefault();return}if((e.key===`Enter`||e.key===`Tab`)&&a(I)[a(N)]&&(e.key===`Enter`||a(P))){e.key===`Enter`&&e.preventDefault(),L(a(I)[a(N)].dir);return}if(e.key===`Escape`){s(M,!1),e.stopPropagation();return}}m.onkeydown?.(e)}var z=D(),B=v(z);g(B);let V;var H=c(B,2),U=e=>{var o=E();C(o,23,()=>a(I),e=>e.dir+e.made,(e,o,u)=>{var d=T();let p;var m=v(d),g=v(m),_=l(g,!0),y=c(g),S=l(y,!0);x(m),x(d),r(e=>{b(d,`id`,`${A()??``}-opt-${a(u)??``}`),b(d,`aria-selected`,a(u)===a(N)),p=f(d,1,`svelte-35e6rs`,null,p,{at:a(u)===a(N)}),t(_,a(o).dir),t(S,e)},[()=>a(o).made?`new folder`:`${F(a(o).dir)} ${F(a(o).dir)===1?`note`:`notes`}`]),n(`mousedown`,m,e=>e.preventDefault()),n(`click`,m,()=>L(a(o).dir)),i(`mouseenter`,m,()=>s(N,a(u),!0)),h(e,d)}),x(o),r(()=>b(o,`id`,`${A()??``}-list`)),h(e,o)};S(H,e=>{a(M)&&a(I).length&&e(U)}),x(z),r(()=>{b(B,`id`,A()),V=f(B,1,`mono svelte-35e6rs`,null,V,{field:!j(),quiet:j()}),b(B,`placeholder`,k()),b(B,`aria-label`,m.label),b(B,`aria-expanded`,a(M)&&a(I).length>0),b(B,`aria-controls`,`${A()??``}-list`),b(B,`aria-activedescendant`,a(M)&&a(I)[a(N)]?`${A()}-opt-${a(N)}`:void 0)}),i(`focus`,B,()=>{s(M,!0),s(N,0)}),n(`input`,B,()=>{s(M,!0),s(N,0)}),i(`blur`,B,()=>setTimeout(()=>s(M,!1),120)),n(`keydown`,B,R),d(B,O),h(o,z),u()}o([`input`,`keydown`,`mousedown`,`click`]);export{O as t};
1
+ import{$ as e,D as t,F as n,H as r,I as i,L as a,P as o,Q as s,X as c,Y as l,at as u,c as d,h as f,i as p,j as m,k as h,l as g,ot as _,q as v,tt as y,u as b,ut as x,w as S,x as C}from"./C8UdwlAg.js";import"./xihTtKlq.js";import{t as w}from"./DjBHskLm.js";var T=m(`<li role="option"><button type="button" tabindex="-1" class="svelte-35e6rs"><span class="dir svelte-35e6rs"> </span><span class="detail svelte-35e6rs"> </span></button></li>`),E=m(`<ul class="suggest svelte-35e6rs" role="listbox" aria-label="folders"></ul>`),D=m(`<span class="field-wrap svelte-35e6rs"><input autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list"/> <!></span>`);function O(o,m){_(m,!0);let O=p(m,`value`,15,``),k=p(m,`placeholder`,3,``),A=p(m,`id`,3,`folder`),j=p(m,`quiet`,3,!1),M=e(!1),N=e(0),P=y(()=>O().trim().replace(/^\/+|\/+$/g,``).toLowerCase()),F=e=>w.listing.notes.filter(t=>t.dir===e).length,I=y(()=>{let e=w.listing.dirs.filter(e=>e.toLowerCase().includes(a(P))),t=e=>e.split(`/`).at(-1).toLowerCase().startsWith(a(P))?0:e.toLowerCase().startsWith(a(P))?1:2,n=e.sort((e,n)=>t(e)-t(n)||e.localeCompare(n)).map(e=>({dir:e,made:!1}));return a(P)&&!w.listing.dirs.some(e=>e.toLowerCase()===a(P))&&n.push({dir:O().trim().replace(/^\/+|\/+$/g,``),made:!0}),n.slice(0,8)});function L(e){O(e),s(M,!1),m.onpick?.(e)}function R(e){if(a(M)&&a(I).length){if(e.key===`ArrowDown`){s(N,(a(N)+1)%a(I).length),e.preventDefault();return}if(e.key===`ArrowUp`){s(N,(a(N)-1+a(I).length)%a(I).length),e.preventDefault();return}if((e.key===`Enter`||e.key===`Tab`)&&a(I)[a(N)]&&(e.key===`Enter`||a(P))){e.key===`Enter`&&e.preventDefault(),L(a(I)[a(N)].dir);return}if(e.key===`Escape`){s(M,!1),e.stopPropagation();return}}m.onkeydown?.(e)}var z=D(),B=v(z);g(B);let V;var H=c(B,2),U=e=>{var o=E();C(o,23,()=>a(I),e=>e.dir+e.made,(e,o,u)=>{var d=T();let p;var m=v(d),g=v(m),_=l(g,!0),y=c(g),S=l(y,!0);x(m),x(d),r(e=>{b(d,`id`,`${A()??``}-opt-${a(u)??``}`),b(d,`aria-selected`,a(u)===a(N)),p=f(d,1,`svelte-35e6rs`,null,p,{at:a(u)===a(N)}),t(_,a(o).dir),t(S,e)},[()=>a(o).made?`new folder`:`${F(a(o).dir)} ${F(a(o).dir)===1?`note`:`notes`}`]),n(`mousedown`,m,e=>e.preventDefault()),n(`click`,m,()=>L(a(o).dir)),i(`mouseenter`,m,()=>s(N,a(u),!0)),h(e,d)}),x(o),r(()=>b(o,`id`,`${A()??``}-list`)),h(e,o)};S(H,e=>{a(M)&&a(I).length&&e(U)}),x(z),r(()=>{b(B,`id`,A()),V=f(B,1,`mono svelte-35e6rs`,null,V,{field:!j(),quiet:j()}),b(B,`placeholder`,k()),b(B,`aria-label`,m.label),b(B,`aria-expanded`,a(M)&&a(I).length>0),b(B,`aria-controls`,`${A()??``}-list`),b(B,`aria-activedescendant`,a(M)&&a(I)[a(N)]?`${A()}-opt-${a(N)}`:void 0)}),i(`focus`,B,()=>{s(M,!0),s(N,0)}),n(`input`,B,()=>{s(M,!0),s(N,0)}),i(`blur`,B,()=>setTimeout(()=>s(M,!1),120)),n(`keydown`,B,R),d(B,O),h(o,z),u()}o([`input`,`keydown`,`mousedown`,`click`]);export{O as t};
@@ -1 +1 @@
1
- import{A as e,D as t,F as n,H as r,I as i,J as a,L as o,P as s,X as c,Y as l,at as u,h as d,i as f,j as p,k as m,ot as h,q as g,tt as _,u as v,ut as y,w as b,x}from"./C8UdwlAg.js";import"./xihTtKlq.js";import{a as S}from"./CEQ-cFxt.js";var C={wrote:`wrote the note`,found:`found`,edited:`edited`,kept:`kept`,offered:`offered`,discarded:`removed`,restored:`restored an earlier version`,moved:`moved the note`,"changed elsewhere":`changed elsewhere`,marked:`marked`};function w(e){let t=e.who===`you`?`you`:e.who===`external`?`outside isorite`:e.who.startsWith(`agent:`)?S(e.who):`Iso`;return e.what===`marked`?`Iso marked: ${e.result??`done`}`:e.asked===void 0?e.who===`external`?e.what===`found`?`found as it was, outside isorite`:`changed outside isorite`:`${t} ${C[e.what]}`:`${t} · “${e.asked.length>80?e.asked.slice(0,80)+`…`:e.asked}” · ${e.what===`offered`?`not kept yet`:C[e.what]}`}function T(e,t=Date.now()){let n=Math.max(0,(t-Date.parse(e))/1e3),[r,i]=n<90?[0,`now`]:n<5400?[Math.round(n/60),`minute`]:n<129600?[Math.round(n/3600),`hour`]:[Math.round(n/86400),`day`];return i===`now`?`just now`:`${r} ${i}${r===1?``:`s`} ago`}var E=e=>e.ids.at(-1),D=p(`<i aria-hidden="true"></i>`);function O(t,n){h(n,!0);let i=_(()=>n.moment.who.startsWith(`iso:`)),s=_(()=>n.moment.who.startsWith(`agent:`));var c=e(),l=a(c),f=e=>{var t=D();let i;r(()=>i=d(t,1,`pip`,null,i,{ok:n.moment.result===`right`,part:n.moment.result===`partly`,no:n.moment.result===`wrong`})),m(e,t)},p=e=>{var t=D();let i;r(()=>i=d(t,1,`dia svelte-1jroppb`,null,i,{open:n.moment.what===`offered`||n.moment.what===`discarded`,gone:n.moment.what===`discarded`,agent:o(s)})),m(e,t)},g=e=>{var t=D();let i;r(()=>i=d(t,1,`sq`,null,i,{empty:n.moment.who===`external`})),m(e,t)};b(l,e=>{n.moment.what===`marked`?e(f):o(i)||o(s)?e(p,1):e(g,-1)}),m(t,c),u()}var k=p(`<span class="asked svelte-112n2zp" aria-hidden="true"> </span>`),A=p(`<li class="svelte-112n2zp"><button type="button"><!></button> <!></li>`),j=p(`<ol></ol>`);function M(e,a){h(a,!0);let s=f(a,`label`,3,e=>e.asked===void 0?void 0:`“${e.asked}”`),p=f(a,`name`,3,`The note's timeline`),S=f(a,`leftward`,3,!1);var C=j();let D;x(C,21,()=>a.moments,e=>e.ids[0],(e,u)=>{var f=A(),p=g(f);let h;O(g(p),{get moment(){return o(u)}}),y(p);var x=c(p,2),S=e=>{var n=k(),i=l(n,!0);r(e=>t(i,e),[()=>s()(o(u))]),m(e,n)},C=_(()=>a.pointed===o(u)&&s()(o(u))!==void 0);b(x,e=>{o(C)&&e(S)}),y(f),r((e,t,n,r)=>{h=d(p,1,`moment svelte-112n2zp`,null,h,{at:e}),v(p,`aria-current`,t),v(p,`aria-label`,`${n??``}, ${r??``}`)},[()=>a.at===E(o(u)),()=>a.at===E(o(u))?`step`:void 0,()=>w(o(u)),()=>T(o(u).at)]),i(`pointerenter`,p,()=>a.point(o(u))),i(`pointerleave`,p,()=>a.point(null)),i(`focus`,p,()=>a.point(o(u))),i(`blur`,p,()=>a.point(null)),n(`click`,p,()=>a.pick(o(u))),m(e,f)}),y(C),r(()=>{D=d(C,1,`timeline svelte-112n2zp`,null,D,{leftward:S()}),v(C,`aria-label`,p())}),m(e,C),u()}s([`click`]);export{E as i,T as n,w as r,M as t};
1
+ import{A as e,D as t,F as n,H as r,I as i,J as a,L as o,P as s,X as c,Y as l,at as u,h as d,i as f,j as p,k as m,ot as h,q as g,tt as _,u as v,ut as y,w as b,x}from"./C8UdwlAg.js";import"./xihTtKlq.js";import{a as S}from"./B_nIecMW.js";var C={wrote:`wrote the note`,found:`found`,edited:`edited`,kept:`kept`,offered:`offered`,discarded:`removed`,restored:`restored an earlier version`,moved:`moved the note`,"changed elsewhere":`changed elsewhere`,marked:`marked`};function w(e){let t=e.who===`you`?`you`:e.who===`external`?`outside isorite`:e.who.startsWith(`agent:`)?S(e.who):`Iso`;return e.what===`marked`?`Iso marked: ${e.result??`done`}`:e.asked===void 0?e.who===`external`?e.what===`found`?`found as it was, outside isorite`:`changed outside isorite`:`${t} ${C[e.what]}`:`${t} · “${e.asked.length>80?e.asked.slice(0,80)+`…`:e.asked}” · ${e.what===`offered`?`not kept yet`:C[e.what]}`}function T(e,t=Date.now()){let n=Math.max(0,(t-Date.parse(e))/1e3),[r,i]=n<90?[0,`now`]:n<5400?[Math.round(n/60),`minute`]:n<129600?[Math.round(n/3600),`hour`]:[Math.round(n/86400),`day`];return i===`now`?`just now`:`${r} ${i}${r===1?``:`s`} ago`}var E=e=>e.ids.at(-1),D=p(`<i aria-hidden="true"></i>`);function O(t,n){h(n,!0);let i=_(()=>n.moment.who.startsWith(`iso:`)),s=_(()=>n.moment.who.startsWith(`agent:`));var c=e(),l=a(c),f=e=>{var t=D();let i;r(()=>i=d(t,1,`pip`,null,i,{ok:n.moment.result===`right`,part:n.moment.result===`partly`,no:n.moment.result===`wrong`})),m(e,t)},p=e=>{var t=D();let i;r(()=>i=d(t,1,`dia svelte-1jroppb`,null,i,{open:n.moment.what===`offered`||n.moment.what===`discarded`,gone:n.moment.what===`discarded`,agent:o(s)})),m(e,t)},g=e=>{var t=D();let i;r(()=>i=d(t,1,`sq`,null,i,{empty:n.moment.who===`external`})),m(e,t)};b(l,e=>{n.moment.what===`marked`?e(f):o(i)||o(s)?e(p,1):e(g,-1)}),m(t,c),u()}var k=p(`<span class="asked svelte-112n2zp" aria-hidden="true"> </span>`),A=p(`<li class="svelte-112n2zp"><button type="button"><!></button> <!></li>`),j=p(`<ol></ol>`);function M(e,a){h(a,!0);let s=f(a,`label`,3,e=>e.asked===void 0?void 0:`“${e.asked}”`),p=f(a,`name`,3,`The note's timeline`),S=f(a,`leftward`,3,!1);var C=j();let D;x(C,21,()=>a.moments,e=>e.ids[0],(e,u)=>{var f=A(),p=g(f);let h;O(g(p),{get moment(){return o(u)}}),y(p);var x=c(p,2),S=e=>{var n=k(),i=l(n,!0);r(e=>t(i,e),[()=>s()(o(u))]),m(e,n)},C=_(()=>a.pointed===o(u)&&s()(o(u))!==void 0);b(x,e=>{o(C)&&e(S)}),y(f),r((e,t,n,r)=>{h=d(p,1,`moment svelte-112n2zp`,null,h,{at:e}),v(p,`aria-current`,t),v(p,`aria-label`,`${n??``}, ${r??``}`)},[()=>a.at===E(o(u)),()=>a.at===E(o(u))?`step`:void 0,()=>w(o(u)),()=>T(o(u).at)]),i(`pointerenter`,p,()=>a.point(o(u))),i(`pointerleave`,p,()=>a.point(null)),i(`focus`,p,()=>a.point(o(u))),i(`blur`,p,()=>a.point(null)),n(`click`,p,()=>a.pick(o(u))),m(e,f)}),y(C),r(()=>{D=d(C,1,`timeline svelte-112n2zp`,null,D,{leftward:S()}),v(C,`aria-label`,p())}),m(e,C),u()}s([`click`]);export{E as i,T as n,w as r,M as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.CgaPlR93.js","../chunks/C8UdwlAg.js","../chunks/DAVQx5al.js","../chunks/CRzLMJPS.js","../chunks/xihTtKlq.js","../chunks/DTwIGCa8.js","../chunks/CEQ-cFxt.js","../chunks/D56iKolu.js","../chunks/GgEyipRh.js","../assets/Timeline.KTc3LKuK.css","../chunks/BRnMDye8.js","../chunks/DhKewaLD.js","../chunks/C38XJeNJ.js","../chunks/Ch0511Wu.js","../assets/FolderField._A4_sc1Z.css","../assets/NoteList.F579Zvj_.css","../chunks/B0NIb88Q.js","../assets/0.s5xqevrq.css","../nodes/1.CeByL9Re.js","../nodes/2.DUNH537j.js","../chunks/Dm229u8R.js","../nodes/3.CaAED8T_.js","../nodes/4.BBhoqQg0.js","../chunks/DP2vIlnJ.js","../assets/NoteEditor.ChlpmyHO.css","../assets/4.PVZR2_N5.css","../nodes/5.CkVNYg2h.js","../assets/5.DCxNIgyW.css","../nodes/6.CYRn28m8.js","../nodes/7.BYBNXM1A.js","../assets/7.ljiu9bn5.css","../nodes/8.BdGwzJFT.js","../assets/8.C0NYkyNY.css","../nodes/9.NF5w8YC2.js","../assets/9.CFA9_nYZ.css"])))=>i.map(i=>d[i]);
2
- import{$ as e,A as t,D as n,H as r,J as i,L as a,N as o,Q as s,U as c,W as l,X as u,at as d,i as f,j as p,k as m,n as h,ot as g,q as _,r as v,s as y,tt as b,ut as x,v as S,w as C,z as w}from"../chunks/C8UdwlAg.js";import{t as T}from"../chunks/CRzLMJPS.js";import"../chunks/xihTtKlq.js";var E={},D=p(`<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>`),O=p(`<!> <!>`,1);function k(p,v){g(v,!0);let T=f(v,`components`,23,()=>[]),E=f(v,`data_0`,3,null),k=f(v,`data_1`,3,null);l(()=>v.stores.page.set(v.page)),c(()=>{v.stores,v.page,v.constructors,T(),v.form,E(),k(),v.stores.page.notify()});let A=e(!1),j=e(!1),M=e(null);h(()=>{let e=v.stores.page.subscribe(()=>{a(A)&&(s(j,!0),w().then(()=>{s(M,document.title||`untitled page`,!0)}))});return s(A,!0),e});let N=b(()=>v.constructors[1]);var P=O(),F=i(P),I=e=>{let n=b(()=>v.constructors[0]);var r=t(),o=i(r);S(o,()=>a(n),(e,n)=>{y(n(e,{get data(){return E()},get form(){return v.form},get params(){return v.page.params},children:(e,n)=>{var r=t(),o=i(r);S(o,()=>a(N),(e,t)=>{y(t(e,{get data(){return k()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),m(e,r)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),m(e,r)},L=e=>{let n=b(()=>v.constructors[0]);var r=t(),o=i(r);S(o,()=>a(n),(e,t)=>{y(t(e,{get data(){return E()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),m(e,r)};C(F,e=>{v.constructors[1]?e(I):e(L,-1)});var R=u(F,2),z=e=>{var t=D(),i=_(t),s=e=>{var t=o();r(()=>n(t,a(M))),m(e,t)};C(i,e=>{a(j)&&e(s)}),x(t),m(e,t)};C(R,e=>{a(A)&&e(z)}),m(p,P),d()}var A=v(k),j=[()=>T(()=>import(`../nodes/0.CgaPlR93.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),()=>T(()=>import(`../nodes/1.CeByL9Re.js`),__vite__mapDeps([18,1,4,10,2]),import.meta.url),()=>T(()=>import(`../nodes/2.DUNH537j.js`),__vite__mapDeps([19,1,2,4,5,7,20]),import.meta.url),()=>T(()=>import(`../nodes/3.CaAED8T_.js`),__vite__mapDeps([21,1,2,4,5,10,7,20]),import.meta.url),()=>T(()=>import(`../nodes/4.BBhoqQg0.js`),__vite__mapDeps([22,1,2,4,5,6,7,10,20,23,24,25]),import.meta.url),()=>T(()=>import(`../nodes/5.CkVNYg2h.js`),__vite__mapDeps([26,1,2,4,5,6,7,8,9,10,13,14,23,24,27]),import.meta.url),()=>T(()=>import(`../nodes/6.CYRn28m8.js`),__vite__mapDeps([28,1,4,12,2,5,13,14,15,20]),import.meta.url),()=>T(()=>import(`../nodes/7.BYBNXM1A.js`),__vite__mapDeps([29,1,4,16,20,30]),import.meta.url),()=>T(()=>import(`../nodes/8.BdGwzJFT.js`),__vite__mapDeps([31,1,2,4,5,10,32]),import.meta.url),()=>T(()=>import(`../nodes/9.NF5w8YC2.js`),__vite__mapDeps([33,1,4,34]),import.meta.url)],M=[],N={"/":[2],"/atlas":[3],"/draft/[id]":[4],"/notes":[6],"/n/[...id]":[5],"/parts":[7],"/study":[8],"/terminal":[9]},P={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},F=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.decode])),I=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.encode])),L=!0,R=(e,t)=>F[e](t),z=()=>T(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{R as decode,F as decoders,N as dictionary,I as encoders,z as get_error_template,L as hash,P as hooks,E as matchers,j as nodes,A as root,M as server_loads};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DP4c84Wn.js","../chunks/C8UdwlAg.js","../chunks/Cw2GjAJR.js","../chunks/CRzLMJPS.js","../chunks/xihTtKlq.js","../chunks/DjBHskLm.js","../chunks/B_nIecMW.js","../chunks/UM_L7-f7.js","../chunks/k55859zq.js","../assets/Timeline.KTc3LKuK.css","../chunks/BEVz4Dgg.js","../chunks/BEk5idXo.js","../chunks/CcRs965g.js","../chunks/b-AOhhy1.js","../assets/FolderField._A4_sc1Z.css","../assets/NoteList.F579Zvj_.css","../chunks/B0NIb88Q.js","../assets/0.s5xqevrq.css","../nodes/1.BcwcVDJZ.js","../nodes/2.DgGnQZ7P.js","../chunks/Dm229u8R.js","../nodes/3.BudzO7We.js","../nodes/4.DmswyrSt.js","../chunks/B7ZjnqOt.js","../assets/NoteEditor.ChlpmyHO.css","../assets/4.PVZR2_N5.css","../nodes/5.DjXsfjL5.js","../assets/5.DCxNIgyW.css","../nodes/6.uBh-sdQx.js","../nodes/7.BYBNXM1A.js","../assets/7.ljiu9bn5.css","../nodes/8.Tbz9Rh77.js","../assets/8.C0NYkyNY.css","../nodes/9.NF5w8YC2.js","../assets/9.CFA9_nYZ.css"])))=>i.map(i=>d[i]);
2
+ import{$ as e,A as t,D as n,H as r,J as i,L as a,N as o,Q as s,U as c,W as l,X as u,at as d,i as f,j as p,k as m,n as h,ot as g,q as _,r as v,s as y,tt as b,ut as x,v as S,w as C,z as w}from"../chunks/C8UdwlAg.js";import{t as T}from"../chunks/CRzLMJPS.js";import"../chunks/xihTtKlq.js";var E={},D=p(`<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>`),O=p(`<!> <!>`,1);function k(p,v){g(v,!0);let T=f(v,`components`,23,()=>[]),E=f(v,`data_0`,3,null),k=f(v,`data_1`,3,null);l(()=>v.stores.page.set(v.page)),c(()=>{v.stores,v.page,v.constructors,T(),v.form,E(),k(),v.stores.page.notify()});let A=e(!1),j=e(!1),M=e(null);h(()=>{let e=v.stores.page.subscribe(()=>{a(A)&&(s(j,!0),w().then(()=>{s(M,document.title||`untitled page`,!0)}))});return s(A,!0),e});let N=b(()=>v.constructors[1]);var P=O(),F=i(P),I=e=>{let n=b(()=>v.constructors[0]);var r=t(),o=i(r);S(o,()=>a(n),(e,n)=>{y(n(e,{get data(){return E()},get form(){return v.form},get params(){return v.page.params},children:(e,n)=>{var r=t(),o=i(r);S(o,()=>a(N),(e,t)=>{y(t(e,{get data(){return k()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),m(e,r)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),m(e,r)},L=e=>{let n=b(()=>v.constructors[0]);var r=t(),o=i(r);S(o,()=>a(n),(e,t)=>{y(t(e,{get data(){return E()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),m(e,r)};C(F,e=>{v.constructors[1]?e(I):e(L,-1)});var R=u(F,2),z=e=>{var t=D(),i=_(t),s=e=>{var t=o();r(()=>n(t,a(M))),m(e,t)};C(i,e=>{a(j)&&e(s)}),x(t),m(e,t)};C(R,e=>{a(A)&&e(z)}),m(p,P),d()}var A=v(k),j=[()=>T(()=>import(`../nodes/0.DP4c84Wn.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),()=>T(()=>import(`../nodes/1.BcwcVDJZ.js`),__vite__mapDeps([18,1,4,10,2]),import.meta.url),()=>T(()=>import(`../nodes/2.DgGnQZ7P.js`),__vite__mapDeps([19,1,2,4,5,7,20]),import.meta.url),()=>T(()=>import(`../nodes/3.BudzO7We.js`),__vite__mapDeps([21,1,2,4,5,10,7,20]),import.meta.url),()=>T(()=>import(`../nodes/4.DmswyrSt.js`),__vite__mapDeps([22,1,2,4,5,6,7,10,20,23,24,25]),import.meta.url),()=>T(()=>import(`../nodes/5.DjXsfjL5.js`),__vite__mapDeps([26,1,2,4,5,6,7,8,9,10,13,14,23,24,27]),import.meta.url),()=>T(()=>import(`../nodes/6.uBh-sdQx.js`),__vite__mapDeps([28,1,4,12,2,5,13,14,15,20]),import.meta.url),()=>T(()=>import(`../nodes/7.BYBNXM1A.js`),__vite__mapDeps([29,1,4,16,20,30]),import.meta.url),()=>T(()=>import(`../nodes/8.Tbz9Rh77.js`),__vite__mapDeps([31,1,2,4,5,10,32]),import.meta.url),()=>T(()=>import(`../nodes/9.NF5w8YC2.js`),__vite__mapDeps([33,1,4,34]),import.meta.url)],M=[],N={"/":[2],"/atlas":[3],"/draft/[id]":[4],"/notes":[6],"/n/[...id]":[5],"/parts":[7],"/study":[8],"/terminal":[9]},P={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},F=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.decode])),I=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.encode])),L=!0,R=(e,t)=>F[e](t),z=()=>T(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{R as decode,F as decoders,N as dictionary,I as encoders,z as get_error_template,L as hash,P as hooks,E as matchers,j as nodes,A as root,M as server_loads};
@@ -0,0 +1 @@
1
+ export{a as load_css,n as start}from"../chunks/Cw2GjAJR.js";