corequery 0.1.4 → 0.1.5

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 (44) hide show
  1. package/README.md +2 -2
  2. package/package.json +9 -3
  3. package/scripts/generate-pwa-assets/bin +4 -0
  4. package/scripts/generate-pwa-assets/dist/create-icon.d.ts +8 -0
  5. package/scripts/generate-pwa-assets/dist/create-icon.js +20 -0
  6. package/scripts/generate-pwa-assets/dist/create-icon.js.map +1 -0
  7. package/scripts/generate-pwa-assets/dist/main.d.ts +1 -0
  8. package/scripts/generate-pwa-assets/dist/main.js +63 -0
  9. package/scripts/generate-pwa-assets/dist/main.js.map +1 -0
  10. package/scripts/generate-pwa-assets/dist/svgs.d.ts +2 -0
  11. package/scripts/generate-pwa-assets/dist/svgs.js +11 -0
  12. package/scripts/generate-pwa-assets/dist/svgs.js.map +1 -0
  13. package/server/dist/server/corequery.d.ts +3 -1
  14. package/server/dist/server/corequery.js +2 -1
  15. package/server/dist/server/corequery.js.map +1 -1
  16. package/server/dist/server/web-server-asset-preparer.d.ts +20 -0
  17. package/server/dist/server/web-server-asset-preparer.js +63 -0
  18. package/server/dist/server/web-server-asset-preparer.js.map +1 -0
  19. package/server/dist/server/web-server.d.ts +5 -1
  20. package/server/dist/server/web-server.js +16 -1
  21. package/server/dist/server/web-server.js.map +1 -1
  22. package/web/dist/apple-touch-icon.png +0 -0
  23. package/web/dist/assets/About-_McQvWnX.js +1 -0
  24. package/web/dist/assets/Home-DexSIaMn.js +1 -0
  25. package/web/dist/assets/{Nav-BxBap7GO.js → Nav-HZTtzJid.js} +1 -1
  26. package/web/dist/assets/NotFound-GQx5k3Tp.js +1 -0
  27. package/web/dist/assets/index-CfFerU5x.js +2 -0
  28. package/web/dist/favicon.svg +6 -6
  29. package/web/dist/index.html +5 -6
  30. package/web/dist/manifest.webmanifest +1 -1
  31. package/web/dist/pwa-192x192.png +0 -0
  32. package/web/dist/pwa-512x512.png +0 -0
  33. package/web/dist/pwa-maskable-192x192.png +0 -0
  34. package/web/dist/pwa-maskable-512x512.png +0 -0
  35. package/web/dist/sw.js +1 -1
  36. package/web/dist/assets/About-B1OC_zE4.js +0 -1
  37. package/web/dist/assets/Home-C_Vu2Pm9.js +0 -1
  38. package/web/dist/assets/NotFound-BvWaaeTy.js +0 -1
  39. package/web/dist/assets/index-LHb5BUSB.js +0 -2
  40. package/web/dist/favicon-circle-192.png +0 -0
  41. package/web/dist/favicon-circle-512.png +0 -0
  42. package/web/dist/favicon-maskable-192.png +0 -0
  43. package/web/dist/favicon-maskable-512.png +0 -0
  44. package/web/dist/favicon.ico +0 -0
package/README.md CHANGED
@@ -8,10 +8,10 @@ To prove it works:
8
8
 
9
9
  For the real deal:
10
10
 
11
+ - Setup TailwindCSS
11
12
  - Setup linting with ESLint and TSC
12
- - Setup Prisma, and check it can easily swap between PostgreSQL and SQLite.
13
+ - Setup TypeORM, and check it can easily swap between PostgreSQL and SQLite.
13
14
  - Setup Prettier
14
15
  - Setup unit tests
15
16
  - Setup renovate
16
17
  - Setup CI
17
- - Setup PWA properly
package/package.json CHANGED
@@ -1,21 +1,27 @@
1
1
  {
2
2
  "name": "corequery",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "server/dist",
7
- "web/dist"
7
+ "web/dist",
8
+ "scripts/generate-pwa-assets/dist"
8
9
  ],
9
10
  "exports": "./server/dist/server/index.js",
10
11
  "types": "./server/dist/server/index.d.ts",
12
+ "bin": {
13
+ "corequery-generate-pwa-assets": "./scripts/generate-pwa-assets/bin"
14
+ },
11
15
  "scripts": {
12
- "build": "tsc -p server/tsconfig.json && vite build web",
16
+ "build": "scripts/build",
13
17
  "setup": "scripts/setup",
14
18
  "dev": "scripts/dev",
15
19
  "start": "scripts/start"
16
20
  },
17
21
  "dependencies": {
18
22
  "express": "5.2.1",
23
+ "node-html-parser": "7.0.1",
24
+ "sharp": "0.34.5",
19
25
  "zod": "4.1.13"
20
26
  },
21
27
  "devDependencies": {
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { main } from "./dist/main.js";
4
+ main();
@@ -0,0 +1,8 @@
1
+ export declare function createIcon({ name, size, background, foreground, foregroundScale, outputDir, }: {
2
+ readonly name: string;
3
+ readonly size: number;
4
+ readonly background: string;
5
+ readonly foreground: string;
6
+ readonly foregroundScale: number;
7
+ readonly outputDir: string;
8
+ }): Promise<void>;
@@ -0,0 +1,20 @@
1
+ import path from "path";
2
+ import sharp from "sharp";
3
+ export async function createIcon({ name, size, background, foreground, foregroundScale, outputDir, }) {
4
+ const foregroundSize = Math.round(size * foregroundScale);
5
+ const foregroundImg = await sharp(Buffer.from(foreground))
6
+ .resize(foregroundSize, foregroundSize)
7
+ .png()
8
+ .toBuffer();
9
+ await sharp(Buffer.from(background))
10
+ .resize(size, size)
11
+ .composite([
12
+ {
13
+ input: foregroundImg,
14
+ gravity: "centre",
15
+ },
16
+ ])
17
+ .png()
18
+ .toFile(path.join(outputDir, name));
19
+ }
20
+ //# sourceMappingURL=create-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-icon.js","sourceRoot":"","sources":["../create-icon.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,eAAe,EACf,SAAS,GAQV;IACC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,eAAe,CAAC,CAAC;IAE1D,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACvD,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC;SACtC,GAAG,EAAE;SACL,QAAQ,EAAE,CAAC;IAEd,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACjC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;SAClB,SAAS,CAAC;QACT;YACE,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,QAAQ;SAClB;KACF,CAAC;SACD,GAAG,EAAE;SACL,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function main(): Promise<void>;
@@ -0,0 +1,63 @@
1
+ import fsp from "fs/promises";
2
+ import { createIcon } from "./create-icon.js";
3
+ import { whiteCircleSvg, whiteRectSvg } from "./svgs.js";
4
+ const scriptName = "corequery-generate-pwa-assets";
5
+ export async function main() {
6
+ const faviconSvgPath = process.argv[2];
7
+ const outputDir = process.argv[3];
8
+ if (faviconSvgPath == null || outputDir == null) {
9
+ console.log(`Usage: ${scriptName} <faviconSvgPath> <outputDir>`);
10
+ return;
11
+ }
12
+ const faviconSvg = await fsp.readFile(faviconSvgPath, "utf-8");
13
+ // ===========================================================================
14
+ // Apple touch icon
15
+ // ===========================================================================
16
+ await createIcon({
17
+ name: "apple-touch-icon.png",
18
+ size: 180,
19
+ background: whiteRectSvg,
20
+ foreground: faviconSvg,
21
+ foregroundScale: 0.66,
22
+ outputDir,
23
+ });
24
+ // ===========================================================================
25
+ // PWA regular (circle) icons
26
+ // ===========================================================================
27
+ const pwaRegular = {
28
+ background: whiteCircleSvg,
29
+ foreground: faviconSvg,
30
+ foregroundScale: 0.66,
31
+ outputDir,
32
+ };
33
+ await createIcon({
34
+ name: "pwa-192x192.png",
35
+ size: 192,
36
+ ...pwaRegular,
37
+ });
38
+ await createIcon({
39
+ name: "pwa-512x512.png",
40
+ size: 512,
41
+ ...pwaRegular,
42
+ });
43
+ // ===========================================================================
44
+ // PWA maskable icons
45
+ // ===========================================================================
46
+ const pwaMaskable = {
47
+ background: whiteRectSvg,
48
+ foreground: faviconSvg,
49
+ foregroundScale: 0.57,
50
+ outputDir,
51
+ };
52
+ await createIcon({
53
+ name: "pwa-maskable-192x192.png",
54
+ size: 192,
55
+ ...pwaMaskable,
56
+ });
57
+ await createIcon({
58
+ name: "pwa-maskable-512x512.png",
59
+ size: 512,
60
+ ...pwaMaskable,
61
+ });
62
+ }
63
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../main.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzD,MAAM,UAAU,GAAG,+BAA+B,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAElC,IAAI,cAAc,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,UAAU,UAAU,+BAA+B,CAAC,CAAC;QACjE,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAE/D,8EAA8E;IAC9E,mBAAmB;IACnB,8EAA8E;IAC9E,MAAM,UAAU,CAAC;QACf,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,GAAG;QACT,UAAU,EAAE,YAAY;QACxB,UAAU,EAAE,UAAU;QACtB,eAAe,EAAE,IAAI;QACrB,SAAS;KACV,CAAC,CAAC;IAEH,8EAA8E;IAC9E,6BAA6B;IAC7B,8EAA8E;IAC9E,MAAM,UAAU,GAAG;QACjB,UAAU,EAAE,cAAc;QAC1B,UAAU,EAAE,UAAU;QACtB,eAAe,EAAE,IAAI;QACrB,SAAS;KACV,CAAC;IACF,MAAM,UAAU,CAAC;QACf,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,GAAG;QACT,GAAG,UAAU;KACd,CAAC,CAAC;IACH,MAAM,UAAU,CAAC;QACf,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,GAAG;QACT,GAAG,UAAU;KACd,CAAC,CAAC;IAEH,8EAA8E;IAC9E,qBAAqB;IACrB,8EAA8E;IAC9E,MAAM,WAAW,GAAG;QAClB,UAAU,EAAE,YAAY;QACxB,UAAU,EAAE,UAAU;QACtB,eAAe,EAAE,IAAI;QACrB,SAAS;KACV,CAAC;IACF,MAAM,UAAU,CAAC;QACf,IAAI,EAAE,0BAA0B;QAChC,IAAI,EAAE,GAAG;QACT,GAAG,WAAW;KACf,CAAC,CAAC;IACH,MAAM,UAAU,CAAC;QACf,IAAI,EAAE,0BAA0B;QAChC,IAAI,EAAE,GAAG;QACT,GAAG,WAAW;KACf,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const whiteRectSvg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\" width=\"1\" height=\"1\">\n <rect x=\"0\" y=\"0\" width=\"1\" height=\"1\" fill=\"white\"/>\n </svg>\n";
2
+ export declare const whiteCircleSvg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2 2\" width=\"2\" height=\"2\">\n <circle cx=\"1\" cy=\"1\" r=\"1\" fill=\"white\"/>\n </svg>\n";
@@ -0,0 +1,11 @@
1
+ export const whiteRectSvg = `
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1" width="1" height="1">
3
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
4
+ </svg>
5
+ `;
6
+ export const whiteCircleSvg = `
7
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2" width="2" height="2">
8
+ <circle cx="1" cy="1" r="1" fill="white"/>
9
+ </svg>
10
+ `;
11
+ //# sourceMappingURL=svgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgs.js","sourceRoot":"","sources":["../svgs.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;;;;CAI3B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;CAI7B,CAAC"}
@@ -1,5 +1,7 @@
1
+ import type { AssetConfig } from "./web-server-asset-preparer.js";
1
2
  type CorequeryConfig = {
2
- port: number;
3
+ readonly port: number;
4
+ readonly assets: AssetConfig;
3
5
  };
4
6
  type CorequeryConfigBuilder = (corequery: Corequery) => CorequeryConfig;
5
7
  export declare class Corequery {
@@ -8,10 +8,11 @@ export class Corequery {
8
8
  constructor(configBuilder) {
9
9
  this._config = configBuilder(this);
10
10
  console.log("Corequery config:", this._config, env.COREQUERY_HOT_RELOAD ? "vite-middleware" : "dist-folder");
11
- this._webServer = new WebServer(this, this._config.port, env.COREQUERY_HOT_RELOAD ? "vite-middleware" : "dist-folder", serverFolderPath);
11
+ this._webServer = new WebServer(this, this._config.port, this._config.assets, env.COREQUERY_HOT_RELOAD ? "vite-middleware" : "dist-folder", serverFolderPath);
12
12
  }
13
13
  async start() {
14
14
  runSharedCode();
15
+ await this._webServer.prepareAssets();
15
16
  await this._webServer.start();
16
17
  }
17
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"corequery.js","sourceRoot":"","sources":["../../corequery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,OAAO,SAAS;IACH,OAAO,CAAkB;IACzB,UAAU,CAAY;IAEvC,YAAY,aAAqC;QAC/C,IAAI,CAAC,OAA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oB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,EAC5D,gBAAgB,CACjB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK;QACT,aAAa,EAAE,CAAC;QAEhB,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;QACtC,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+ export type AssetConfig = {
2
+ readonly appName: string;
3
+ readonly shortAppName: string;
4
+ readonly description: string;
5
+ readonly version: string;
6
+ readonly faviconSvgPath: string;
7
+ readonly appleTouchIconPngPath: string;
8
+ readonly pwa192PngPath: string;
9
+ readonly pwa512PngPath: string;
10
+ readonly pwaMaskable192PngPath: string;
11
+ readonly pwaMaskable512PngPath: string;
12
+ };
13
+ export declare class WebServerAssetPreparer {
14
+ private readonly _config;
15
+ constructor(_config: AssetConfig);
16
+ prepareDistFolder(distFolderPath: string): Promise<void>;
17
+ private _replaceWebManifest;
18
+ private _replaceIndexHtmlTags;
19
+ private _replaceIcons;
20
+ }
@@ -0,0 +1,63 @@
1
+ import path from "path";
2
+ import fsp from "fs/promises";
3
+ import { parse } from "node-html-parser";
4
+ export class WebServerAssetPreparer {
5
+ _config;
6
+ constructor(_config) {
7
+ this._config = _config;
8
+ }
9
+ async prepareDistFolder(distFolderPath) {
10
+ const indexHtmlPath = path.join(distFolderPath, "index.html");
11
+ const webManifestPath = path.join(distFolderPath, "manifest.webmanifest");
12
+ await this._replaceIndexHtmlTags(indexHtmlPath);
13
+ await this._replaceWebManifest(webManifestPath);
14
+ await this._replaceIcons(distFolderPath);
15
+ }
16
+ async _replaceWebManifest(filePath) {
17
+ const manifestStr = await fsp.readFile(filePath, "utf-8");
18
+ const manifestJson = JSON.parse(manifestStr);
19
+ const newManifestJson = {
20
+ ...manifestJson,
21
+ name: this._config.appName,
22
+ short_name: this._config.shortAppName,
23
+ description: this._config.description,
24
+ };
25
+ const newManifestStr = JSON.stringify(newManifestJson);
26
+ await fsp.writeFile(filePath, newManifestStr);
27
+ }
28
+ async _replaceIndexHtmlTags(filePath) {
29
+ const indexHtmlStr = await fsp.readFile(filePath, "utf-8");
30
+ const indexHtml = parse(indexHtmlStr);
31
+ function requireTag(selector) {
32
+ const tag = indexHtml.querySelector(selector);
33
+ if (tag == null)
34
+ throw new Error(`${selector}" tag not found.`);
35
+ return tag;
36
+ }
37
+ const titleTag = requireTag("title");
38
+ const descriptionTag = requireTag('meta[name="description"]');
39
+ const appNameTag = requireTag('meta[name="corequery-app-name"]');
40
+ const versionTag = requireTag('meta[name="corequery-frontend-version"]');
41
+ titleTag.textContent = this._config.appName;
42
+ descriptionTag.setAttribute("content", this._config.description);
43
+ appNameTag.setAttribute("content", this._config.appName);
44
+ versionTag.setAttribute("content", this._config.version);
45
+ const newIndexHtmlStr = indexHtml.toString();
46
+ await fsp.writeFile(filePath, newIndexHtmlStr);
47
+ }
48
+ async _replaceIcons(distFolderPath) {
49
+ const mapping = {
50
+ "favicon.svg": this._config.faviconSvgPath,
51
+ "apple-touch-icon.png": this._config.appleTouchIconPngPath,
52
+ "pwa-192x192.png": this._config.pwa192PngPath,
53
+ "pwa-512x512.png": this._config.pwa512PngPath,
54
+ "pwa-maskable-192x192.png": this._config.pwaMaskable192PngPath,
55
+ "pwa-maskable-512x512.png": this._config.pwaMaskable512PngPath,
56
+ };
57
+ for (const [fileName, sourcePath] of Object.entries(mapping)) {
58
+ const destPath = path.join(distFolderPath, fileName);
59
+ await fsp.copyFile(sourcePath, destPath);
60
+ }
61
+ }
62
+ }
63
+ //# sourceMappingURL=web-server-asset-preparer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-server-asset-preparer.js","sourceRoot":"","sources":["../../web-server-asset-preparer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,KAAK,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YAC9D,0BAA0B,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB;SAC/D,CAAC;QAEF,KAAK,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;YACrD,MAAM,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CACF"}
@@ -1,12 +1,16 @@
1
1
  import type { Corequery } from "./corequery.js";
2
+ import { type AssetConfig } from "./web-server-asset-preparer.js";
2
3
  export declare const clientModes: readonly ["dist-folder", "vite-middleware"];
3
4
  export type ClientMode = (typeof clientModes)[number];
4
5
  export declare class WebServer {
5
6
  private readonly _app;
6
7
  private readonly _port;
8
+ private readonly _assetConfig;
7
9
  private readonly _clientMode;
8
10
  private readonly _serverFolderPath;
9
- constructor(_app: Corequery, _port: number, _clientMode: ClientMode, _serverFolderPath: string);
11
+ private readonly _assetPreparer;
12
+ constructor(_app: Corequery, _port: number, _assetConfig: AssetConfig, _clientMode: ClientMode, _serverFolderPath: string);
13
+ prepareAssets(): Promise<void>;
10
14
  start(): Promise<void>;
11
15
  private _serveFrontendFromDistFolder;
12
16
  private _serveFrontendUsingViteMiddleware;
@@ -1,17 +1,32 @@
1
1
  import express from "express";
2
2
  import fsp from "fs/promises";
3
3
  import path from "path";
4
+ import { WebServerAssetPreparer, } from "./web-server-asset-preparer.js";
4
5
  export const clientModes = ["dist-folder", "vite-middleware"];
5
6
  export class WebServer {
6
7
  _app;
7
8
  _port;
9
+ _assetConfig;
8
10
  _clientMode;
9
11
  _serverFolderPath;
10
- constructor(_app, _port, _clientMode, _serverFolderPath) {
12
+ _assetPreparer;
13
+ constructor(_app, _port, _assetConfig, _clientMode, _serverFolderPath) {
11
14
  this._app = _app;
12
15
  this._port = _port;
16
+ this._assetConfig = _assetConfig;
13
17
  this._clientMode = _clientMode;
14
18
  this._serverFolderPath = _serverFolderPath;
19
+ this._assetPreparer = new WebServerAssetPreparer(_assetConfig);
20
+ }
21
+ async prepareAssets() {
22
+ if (this._clientMode === "dist-folder") {
23
+ const distFolderPath = this._getWebFolderPath("dist");
24
+ await this._assetPreparer.prepareDistFolder(distFolderPath);
25
+ }
26
+ // It's hard to think of a way to reasonably replace the assets in
27
+ // middleware mode, as you'd be replacing the source assets. It's only a
28
+ // "nice to have" anyway, using the CoreQuery assets during demo-app
29
+ // development is perfectly acceptable.
15
30
  }
16
31
  async start() {
17
32
  const server = express();
@@ -1 +1 @@
1
- {"version":3,"file":"web-server.js","sourceRoot":"","sources":["../../web-server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,iBAAiB,CAAU,CAAC;AAGvE,MAAM,OAAO,SAAS;IAED;IACA;IACA;IACA;IAJnB,YACmB,IAAe,EACf,KAAa,EACb,WAAuB,EACvB,iBAAyB;QAHzB,SAAI,GAAJ,IAAI,CAAW;QACf,UAAK,GAAL,KAAK,CAAQ;QACb,gBAAW,GAAX,WAAW,CAAY;QACvB,sBAAiB,GAAjB,iBAAiB,CAAQ;IACzC,CAAC;IAEJ,KAAK,CAAC,KAAK;QACT,MAAM,MAAM,GAAG,OAAO,EAAE,CAAC;QAEzB,uBAAuB;QACvB,kEAAkE;QAElE,IAAI,IAAI,CAAC,WAAW,KAAK,aAAa,EAAE,CAAC;YACvC,MAAM,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,KAAK,iBAAiB,EAAE,CAAC;YAC3C,MAAM,IAAI,CAAC,iCAAiC,CAAC,MAAM,CAAC,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,GAAG,MAAM,YAAY,CAAC;YAC9B,MAAM,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;YAChC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE;SAC/B,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAEO,iBAAiB,CAAC,YAAoB,EAAE;QAC9C,0EAA0E;QAC1E,qEAAqE;QACrE,iCAAiC;QACjC,OAAO,IAAI,CAAC,OAAO,CACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC,EACpD,SAAS,CACV,CAAC;IACJ,CAAC;CACF"}
Binary file
@@ -0,0 +1 @@
1
+ import{u as o,a}from"./index-CfFerU5x.js";import{N as r}from"./Nav-HZTtzJid.js";function i(){const{appName:t}=o();return a("div",{children:[a("h1",{children:[t," - About"]}),a(r,{})]})}export{i as default};
@@ -0,0 +1 @@
1
+ import{_ as m,u as h,a as r,d as g,T as R,k as y,y as S}from"./index-CfFerU5x.js";import{N as k}from"./Nav-HZTtzJid.js";function W(){console.log("This is shared code running!")}function E(n={}){const{immediate:d=!1,onNeedRefresh:l,onOfflineReady:a,onRegistered:c,onRegisteredSW:o,onRegisterError:s}=n;let t,f,u;const w=async(e=!0)=>{await f,u?.()};async function v(){if("serviceWorker"in navigator){if(t=await m(async()=>{const{Workbox:e}=await import("./workbox-window.prod.es5-BIl4cyR9.js");return{Workbox:e}},[]).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{s?.(e)}),!t)return;u=()=>{t?.messageSkipWaiting()};{let e=!1;const p=()=>{e=!0,t?.addEventListener("controlling",i=>{i.isUpdate&&window.location.reload()}),l?.()};t.addEventListener("installed",i=>{typeof i.isUpdate>"u"?typeof i.isExternal<"u"&&i.isExternal?p():!e&&a?.():i.isUpdate||a?.()}),t.addEventListener("waiting",p)}t.register({immediate:d}).then(e=>{o?o("/sw.js",e):c?.(e)}).catch(e=>{s?.(e)})}}return f=v(),w}function _(){const{frontendVersion:n}=h();return r("div",{children:[r("span",{children:["PWA version: ",n]}),r("br",{}),r(P,{})]})}function P(){const[n,d]=g(!1),[l,a]=g(!1),c=R(()=>E({onRegisteredSW:()=>console.log("Service worker registered."),onRegisterError:s=>console.error("Service worker error:",s),onNeedRefresh:()=>d(!0),onOfflineReady:()=>a(!0)}),[]);async function o(){await c()}return n?r(y,{children:[r("span",{children:"Update available"}),r("button",{onClick:o,children:"Update"})]}):l?r("span",{children:"App ready to work offline"}):r("span",{children:"Nothing to report!"})}function U(){const{appName:n}=h();return S(()=>{W()},[]),r("div",{children:[r("h1",{children:[n," - Home"]}),r(k,{}),r(_,{})]})}export{U as default};
@@ -1 +1 @@
1
- import{u as r}from"./index-LHb5BUSB.js";function n(){return r("nav",{children:r("ul",{children:[r("li",{children:r("a",{href:"/",children:"Home"})}),r("li",{children:r("a",{href:"/about",children:"About"})}),r("li",{children:r("a",{href:"/bacon",children:"Not Found"})})]})})}export{n as N};
1
+ import{a as r}from"./index-CfFerU5x.js";function n(){return r("nav",{children:r("ul",{children:[r("li",{children:r("a",{href:"/",children:"Home"})}),r("li",{children:r("a",{href:"/about",children:"About"})}),r("li",{children:r("a",{href:"/bacon",children:"Not Found"})})]})})}export{n as N};
@@ -0,0 +1 @@
1
+ import{u as o,a}from"./index-CfFerU5x.js";import{N as r}from"./Nav-HZTtzJid.js";function e(){const{appName:t}=o();return a("div",{children:[a("h1",{children:[t," - Not Found"]}),a(r,{})]})}export{e as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-DexSIaMn.js","assets/Nav-HZTtzJid.js","assets/About-_McQvWnX.js","assets/NotFound-GQx5k3Tp.js"])))=>i.map(i=>d[i]);
2
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const _ of o)if(_.type==="childList")for(const u of _.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const _={};return o.integrity&&(_.integrity=o.integrity),o.referrerPolicy&&(_.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?_.credentials="include":o.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function r(o){if(o.ep)return;o.ep=!0;const _=n(o);fetch(o.href,_)}})();const et="modulepreload",tt=function(t){return"/"+t},be={},se=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let a=function(l){return Promise.all(l.map(p=>Promise.resolve(p).then(i=>({status:"fulfilled",value:i}),i=>({status:"rejected",reason:i}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=u?.nonce||u?.getAttribute("nonce");o=a(n.map(l=>{if(l=tt(l),l in be)return;be[l]=!0;const p=l.endsWith(".css"),i=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${i}`))return;const s=document.createElement("link");if(s.rel=p?"stylesheet":et,p||(s.as="script"),s.crossOrigin="",s.href=l,c&&s.setAttribute("nonce",c),document.head.appendChild(s),p)return new Promise((f,v)=>{s.addEventListener("load",f),s.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${l}`)))})}))}function _(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return o.then(u=>{for(const c of u||[])c.status==="rejected"&&_(c.reason);return e().catch(_)})};var q,h,Ne,U,ke,Me,Oe,Fe,ae,oe,ie,Ie,W={},We=[],nt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,j=Array.isArray;function $(t,e){for(var n in e)t[n]=e[n];return t}function fe(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function H(t,e,n){var r,o,_,u={};for(_ in e)_=="key"?r=e[_]:_=="ref"?o=e[_]:u[_]=e[_];if(arguments.length>2&&(u.children=arguments.length>3?q.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(_ in t.defaultProps)u[_]===void 0&&(u[_]=t.defaultProps[_]);return I(t,u,r,o,null)}function I(t,e,n,r,o){var _={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Ne,__i:-1,__u:0};return o==null&&h.vnode!=null&&h.vnode(_),_}function ee(t){return t.children}function Y(t,e){this.props=t,this.context=e}function O(t,e){if(e==null)return t.__?O(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?O(t):null}function qe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return qe(t)}}function ue(t){(!t.__d&&(t.__d=!0)&&U.push(t)&&!Z.__r++||ke!=h.debounceRendering)&&((ke=h.debounceRendering)||Me)(Z)}function Z(){for(var t,e,n,r,o,_,u,c=1;U.length;)U.length>c&&U.sort(Oe),t=U.shift(),c=U.length,t.__d&&(n=void 0,r=void 0,o=(r=(e=t).__v).__e,_=[],u=[],e.__P&&((n=$({},r)).__v=r.__v+1,h.vnode&&h.vnode(n),pe(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[o]:null,_,o??O(r),!!(32&r.__u),u),n.__v=r.__v,n.__.__k[n.__i]=n,Ke(_,n,u),r.__e=r.__=null,n.__e!=o&&qe(n)));Z.__r=0}function je(t,e,n,r,o,_,u,c,a,l,p){var i,s,f,v,E,g,d,m=r&&r.__k||We,P=e.length;for(a=rt(n,e,m,a,P),i=0;i<P;i++)(f=n.__k[i])!=null&&(s=f.__i==-1?W:m[f.__i]||W,f.__i=i,g=pe(t,f,s,o,_,u,c,a,l,p),v=f.__e,f.ref&&s.ref!=f.ref&&(s.ref&&he(s.ref,null,f),p.push(f.ref,f.__c||v,f)),E==null&&v!=null&&(E=v),(d=!!(4&f.__u))||s.__k===f.__k?a=Be(f,a,t,d):typeof f.type=="function"&&g!==void 0?a=g:v&&(a=v.nextSibling),f.__u&=-7);return n.__e=E,a}function rt(t,e,n,r,o){var _,u,c,a,l,p=n.length,i=p,s=0;for(t.__k=new Array(o),_=0;_<o;_++)(u=e[_])!=null&&typeof u!="boolean"&&typeof u!="function"?(a=_+s,(u=t.__k[_]=typeof u=="string"||typeof u=="number"||typeof u=="bigint"||u.constructor==String?I(null,u,null,null,null):j(u)?I(ee,{children:u},null,null,null):u.constructor==null&&u.__b>0?I(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):u).__=t,u.__b=t.__b+1,c=null,(l=u.__i=_t(u,n,a,i))!=-1&&(i--,(c=n[l])&&(c.__u|=2)),c==null||c.__v==null?(l==-1&&(o>p?s--:o<p&&s++),typeof u.type!="function"&&(u.__u|=4)):l!=a&&(l==a-1?s--:l==a+1?s++:(l>a?s--:s++,u.__u|=4))):t.__k[_]=null;if(i)for(_=0;_<p;_++)(c=n[_])!=null&&(2&c.__u)==0&&(c.__e==r&&(r=O(c)),Je(c,c));return r}function Be(t,e,n,r){var o,_;if(typeof t.type=="function"){for(o=t.__k,_=0;o&&_<o.length;_++)o[_]&&(o[_].__=t,e=Be(o[_],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=O(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ze(t,e){return e=e||[],t==null||typeof t=="boolean"||(j(t)?t.some(function(n){ze(n,e)}):e.push(t)),e}function _t(t,e,n,r){var o,_,u,c=t.key,a=t.type,l=e[n],p=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||p&&c==l.key&&a==l.type)return n;if(r>(p?1:0)){for(o=n-1,_=n+1;o>=0||_<e.length;)if((l=e[u=o>=0?o--:_++])!=null&&(2&l.__u)==0&&c==l.key&&a==l.type)return u}return-1}function Ee(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||nt.test(e)?n:n+"px"}function G(t,e,n,r,o){var _,u;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Ee(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||Ee(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")_=e!=(e=e.replace(Fe,"$1")),u=e.toLowerCase(),e=u in t||e=="onFocusOut"||e=="onFocusIn"?u.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+_]=n,n?r?n.u=r.u:(n.u=ae,t.addEventListener(e,_?ie:oe,_)):t.removeEventListener(e,_?ie:oe,_);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Pe(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=ae++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function pe(t,e,n,r,o,_,u,c,a,l){var p,i,s,f,v,E,g,d,m,P,w,A,D,K,T,b,C,S=e.type;if(e.constructor!=null)return null;128&n.__u&&(a=!!(32&n.__u),_=[c=e.__e=n.__e]),(p=h.__b)&&p(e);e:if(typeof S=="function")try{if(d=e.props,m="prototype"in S&&S.prototype.render,P=(p=S.contextType)&&r[p.__c],w=p?P?P.props.value:p.__:r,n.__c?g=(i=e.__c=n.__c).__=i.__E:(m?e.__c=i=new S(d,w):(e.__c=i=new Y(d,w),i.constructor=S,i.render=it),P&&P.sub(i),i.props=d,i.state||(i.state={}),i.context=w,i.__n=r,s=i.__d=!0,i.__h=[],i._sb=[]),m&&i.__s==null&&(i.__s=i.state),m&&S.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,S.getDerivedStateFromProps(d,i.__s))),f=i.props,v=i.state,i.__v=e,s)m&&S.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),m&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(m&&S.getDerivedStateFromProps==null&&d!==f&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,w),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,w)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(i.props=d,i.state=i.__s,i.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(N){N&&(N.__=e)}),A=0;A<i._sb.length;A++)i.__h.push(i._sb[A]);i._sb=[],i.__h.length&&u.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,w),m&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(f,v,E)})}if(i.context=w,i.props=d,i.__P=t,i.__e=!1,D=h.__r,K=0,m){for(i.state=i.__s,i.__d=!1,D&&D(e),p=i.render(i.props,i.state,i.context),T=0;T<i._sb.length;T++)i.__h.push(i._sb[T]);i._sb=[]}else do i.__d=!1,D&&D(e),p=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++K<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),m&&!s&&i.getSnapshotBeforeUpdate!=null&&(E=i.getSnapshotBeforeUpdate(f,v)),b=p,p!=null&&p.type===ee&&p.key==null&&(b=Ge(p.props.children)),c=je(t,j(b)?b:[b],e,n,r,o,_,u,c,a,l),i.base=e.__e,e.__u&=-161,i.__h.length&&u.push(i),g&&(i.__E=i.__=null)}catch(N){if(e.__v=null,a||_!=null)if(N.then){for(e.__u|=a?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;_[_.indexOf(c)]=null,e.__e=c}else{for(C=_.length;C--;)fe(_[C]);ce(e)}else e.__e=n.__e,e.__k=n.__k,N.then||ce(e);h.__e(N,e,n)}else _==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):c=e.__e=ot(n.__e,e,n,r,o,_,u,a,l);return(p=h.diffed)&&p(e),128&e.__u?void 0:c}function ce(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(ce)}function Ke(t,e,n){for(var r=0;r<n.length;r++)he(n[r],n[++r],n[++r]);h.__c&&h.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(_){_.call(o)})}catch(_){h.__e(_,o.__v)}})}function Ge(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:j(t)?t.map(Ge):$({},t)}function ot(t,e,n,r,o,_,u,c,a){var l,p,i,s,f,v,E,g=n.props,d=e.props,m=e.type;if(m=="svg"?o="http://www.w3.org/2000/svg":m=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),_!=null){for(l=0;l<_.length;l++)if((f=_[l])&&"setAttribute"in f==!!m&&(m?f.localName==m:f.nodeType==3)){t=f,_[l]=null;break}}if(t==null){if(m==null)return document.createTextNode(d);t=document.createElementNS(o,m,d.is&&d),c&&(h.__m&&h.__m(e,_),c=!1),_=null}if(m==null)g===d||c&&t.data==d||(t.data=d);else{if(_=_&&q.call(t.childNodes),g=n.props||W,!c&&_!=null)for(g={},l=0;l<t.attributes.length;l++)g[(f=t.attributes[l]).name]=f.value;for(l in g)if(f=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")i=f;else if(!(l in d)){if(l=="value"&&"defaultValue"in d||l=="checked"&&"defaultChecked"in d)continue;G(t,l,null,f,o)}}for(l in d)f=d[l],l=="children"?s=f:l=="dangerouslySetInnerHTML"?p=f:l=="value"?v=f:l=="checked"?E=f:c&&typeof f!="function"||g[l]===f||G(t,l,f,g[l],o);if(p)c||i&&(p.__html==i.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(i&&(t.innerHTML=""),je(e.type=="template"?t.content:t,j(s)?s:[s],e,n,r,m=="foreignObject"?"http://www.w3.org/1999/xhtml":o,_,u,_?_[0]:n.__k&&O(n,0),c,a),_!=null)for(l=_.length;l--;)fe(_[l]);c||(l="value",m=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[l]||m=="progress"&&!v||m=="option"&&v!=g[l])&&G(t,l,v,g[l],o),l="checked",E!=null&&E!=t[l]&&G(t,l,E,g[l],o))}return t}function he(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(o){h.__e(o,n)}}function Je(t,e,n){var r,o;if(h.unmount&&h.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||he(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(_){h.__e(_,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&Je(r[o],e,n||typeof t.type!="function");n||fe(t.__e),t.__c=t.__=t.__e=void 0}function it(t,e,n){return this.constructor(t,n)}function ut(t,e,n){var r,o,_,u;e==document&&(e=document.documentElement),h.__&&h.__(t,e),o=(r=!1)?null:e.__k,_=[],u=[],pe(e,t=e.__k=H(ee,null,[t]),o||W,W,e.namespaceURI,o?null:e.firstChild?q.call(e.childNodes):null,_,o?o.__e:e.firstChild,r,u),Ke(_,t,u)}function we(t,e,n){var r,o,_,u,c=$({},t.props);for(_ in t.type&&t.type.defaultProps&&(u=t.type.defaultProps),e)_=="key"?r=e[_]:_=="ref"?o=e[_]:c[_]=e[_]===void 0&&u!=null?u[_]:e[_];return arguments.length>2&&(c.children=arguments.length>3?q.call(arguments,2):n),I(t.type,c,r||t.key,o||t.ref,null)}function de(t){function e(n){var r,o;return this.getChildContext||(r=new Set,(o={})[e.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(_){this.props.value!=_.value&&r.forEach(function(u){u.__e=!0,ue(u)})},this.sub=function(_){r.add(_);var u=_.componentWillUnmount;_.componentWillUnmount=function(){r&&r.delete(_),u&&u.call(_)}}),n.children}return e.__c="__cC"+Ie++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,r){return n.children(r)}).contextType=e,e}q=We.slice,h={__e:function(t,e,n,r){for(var o,_,u;e=e.__;)if((o=e.__c)&&!o.__)try{if((_=o.constructor)&&_.getDerivedStateFromError!=null&&(o.setState(_.getDerivedStateFromError(t)),u=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,r||{}),u=o.__d),u)return o.__E=o}catch(c){t=c}throw t}},Ne=0,Y.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$({},this.state),typeof t=="function"&&(t=t($({},n),this.props)),t&&$(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ue(this))},Y.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ue(this))},Y.prototype.render=ee,U=[],Me=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Oe=function(t,e){return t.__v.__b-e.__v.__b},Z.__r=0,Fe=/(PointerCapture)$|Capture$/i,ae=0,oe=Pe(!1),ie=Pe(!0),Ie=0;var ct=0;function L(t,e,n,r,o,_){e||(e={});var u,c,a=e;if("ref"in a)for(c in a={},e)c=="ref"?u=e[c]:a[c]=e[c];var l={type:t,props:a,key:n,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ct,__i:-1,__u:0,__source:o,__self:_};if(typeof t=="function"&&(u=t.defaultProps))for(c in u)a[c]===void 0&&(a[c]=u[c]);return h.vnode&&h.vnode(l),l}var R,y,ne,Se,V=0,Qe=[],k=h,$e=k.__b,Ce=k.__r,xe=k.diffed,Le=k.__c,He=k.unmount,De=k.__;function B(t,e){k.__h&&k.__h(y,t,V||e),V=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function lt(t){return V=1,me(Xe,t)}function me(t,e,n){var r=B(R++,2);if(r.t=t,!r.__c&&(r.__=[Xe(void 0,e),function(c){var a=r.__N?r.__N[0]:r.__[0],l=r.t(a,c);a!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var o=function(c,a,l){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(s){return!!s.__c});if(p.every(function(s){return!s.__N}))return!_||_.call(this,c,a,l);var i=r.__c.props!==c;return p.forEach(function(s){if(s.__N){var f=s.__[0];s.__=s.__N,s.__N=void 0,f!==s.__[0]&&(i=!0)}}),_&&_.call(this,c,a,l)||i};y.__f=!0;var _=y.shouldComponentUpdate,u=y.componentWillUpdate;y.componentWillUpdate=function(c,a,l){if(this.__e){var p=_;_=void 0,o(c,a,l),_=p}u&&u.call(this,c,a,l)},y.shouldComponentUpdate=o}return r.__N||r.__}function St(t,e){var n=B(R++,3);!k.__s&&ye(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ye(t,e){var n=B(R++,4);!k.__s&&ye(n.__H,e)&&(n.__=t,n.u=e,y.__h.push(n))}function x(t){return V=5,te(function(){return{current:t}},[])}function te(t,e){var n=B(R++,7);return ye(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function ve(t){var e=y.context[t.__c],n=B(R++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(y)),e.props.value):t.__}function st(){for(var t;t=Qe.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(X),t.__H.__h.forEach(le),t.__H.__h=[]}catch(e){t.__H.__h=[],k.__e(e,t.__v)}}k.__b=function(t){y=null,$e&&$e(t)},k.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),De&&De(t,e)},k.__r=function(t){Ce&&Ce(t),R=0;var e=(y=t.__c).__H;e&&(ne===y?(e.__h=[],y.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(X),e.__h.forEach(le),e.__h=[],R=0)),ne=y},k.diffed=function(t){xe&&xe(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Qe.push(e)!==1&&Se===k.requestAnimationFrame||((Se=k.requestAnimationFrame)||at)(st)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),ne=y=null},k.__c=function(t,e){e.some(function(n){try{n.__h.forEach(X),n.__h=n.__h.filter(function(r){return!r.__||le(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],k.__e(r,n.__v)}}),Le&&Le(t,e)},k.unmount=function(t){He&&He(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{X(r)}catch(o){e=o}}),n.__H=void 0,e&&k.__e(e,n.__v))};var Ue=typeof requestAnimationFrame=="function";function at(t){var e,n=function(){clearTimeout(r),Ue&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);Ue&&(e=requestAnimationFrame(n))}function X(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function le(t){var e=y;t.__c=t.__(),y=e}function ye(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Xe(t,e){return typeof e=="function"?e(t):e}let M,F;function ft(t){return!F||(typeof F=="string"?t.startsWith(F):F.test(t))}function pt(t,e){let n="";if(M=void 0,e&&e.type==="click"){if(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button!==0)return t;const r=e.composedPath().find(_=>_.nodeName=="A"&&_.href),o=r&&r.getAttribute("href");if(!r||r.origin!=location.origin||/^#/.test(o)||!/^(_?self)?$/i.test(r.target)||!ft(o))return t;M=!0,e.preventDefault(),n=r.href.replace(location.origin,"")}else e&&e.url?(M=!e.replace,n=e.url):n=location.pathname+location.search;return M===!0?history.pushState(null,"",n):M===!1&&history.replaceState(null,"",n),n}const ht=(t,e,n={})=>{t=t.split("/").filter(Boolean),e=(e||"").split("/").filter(Boolean),n.params||(n.params={});for(let r=0,o,_;r<Math.max(t.length,e.length);r++){let[,u,c,a]=(e[r]||"").match(/^(:?)(.*?)([+*?]?)$/);if(o=t[r],!(!u&&c==o)){if(!u&&o&&a=="*"){n.rest="/"+t.slice(r).map(decodeURIComponent).join("/");break}if(!u||!o&&a!="?"&&a!="*")return;if(_=a=="+"||a=="*",_?o=t.slice(r).map(decodeURIComponent).join("/")||void 0:o&&(o=decodeURIComponent(o)),n.params[c]=o,c in n||(n[c]=o),_)break}}return n};function z(t){const[e,n]=me(pt,t.url||location.pathname+location.search);t.scope&&(F=t.scope);const r=M===!0,o=te(()=>{const _=new URL(e,location.origin),u=_.pathname.replace(/\/+$/g,"")||"/";return{url:e,path:u,query:Object.fromEntries(_.searchParams),route:(c,a)=>n({url:c,replace:a}),wasPush:r}},[e]);return Ye(()=>(addEventListener("click",n),addEventListener("popstate",n),()=>{removeEventListener("click",n),removeEventListener("popstate",n)}),[]),H(z.ctx.Provider,{value:o},t.children)}const dt=Promise.resolve();function Ze(t){const[e,n]=me(b=>b+1,0),{url:r,query:o,wasPush:_,path:u}=mt();if(!r)throw new Error("preact-iso's <Router> must be used within a <LocationProvider>, see: https://github.com/preactjs/preact-iso#locationprovider");const{rest:c=u,params:a={}}=ve(Re),l=x(!1),p=x(u),i=x(0),s=x(),f=x(),v=x(),E=x(!1),g=x();g.current=!1;let d,m,P;ze(t.children).some(b=>{if(ht(c,b.props.path,P={...b.props,path:c,query:o,params:Object.assign({},a),rest:""}))return d=we(b,P);b.props.default&&(m=we(b,P))});let w=d||m;const A=s.current&&s.current.__u&J&&s.current.__u&Q,D=s.current&&s.current.__h,K=te(()=>{f.current=s.current,s.current=H(Re.Provider,{value:P},w);const b=f.current&&f.current.props.children;return!b||!w||w.type!==b.type||w.props.component!==b.props.component?(this.__v&&this.__v.__k&&this.__v.__k.reverse(),i.current++,!0):!1},[r,JSON.stringify(P)]);A?(s.current.__u|=J,s.current.__u|=Q):D&&(s.current.__h=!0);const T=f.current;return f.current=null,this.__c=(b,C)=>{g.current=!0,f.current=T,t.onLoadStart&&t.onLoadStart(r),l.current=!0;let S=i.current;b.then(()=>{S===i.current&&(f.current=null,s.current&&(C.__h&&(s.current.__h=C.__h),C.__u&Q&&(s.current.__u|=Q),C.__u&J&&(s.current.__u|=J)),dt.then(n))})},Ye(()=>{const b=this.__v&&this.__v.__e;if(g.current){!E.current&&!v.current&&(v.current=b);return}!E.current&&v.current&&(v.current!==b&&v.current.remove(),v.current=null),E.current=!0,p.current!==u&&(_&&scrollTo(0,0),t.onRouteChange&&t.onRouteChange(r),p.current=u),t.onLoadEnd&&l.current&&t.onLoadEnd(r),l.current=!1},[u,_,e]),K?[H(re,{r:s}),H(re,{r:f})]:H(re,{r:s})}const J=32,Q=128,re=({r:t})=>t.current;Ze.Provider=z;z.ctx=de({});const Re=de({}),_e=t=>H(t.component,t),mt=()=>ve(z.ctx),Ae=h.__b;h.__b=t=>{t.type&&t.type._forwarded&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ae&&Ae(t)};function ge(t){let e,n;const r=()=>t().then(_=>n=_&&_.default||_),o=_=>{const[,u]=lt(0),c=x(n);if(e||(e=r()),n!==void 0)return H(n,_);throw c.current||(c.current=e.then(()=>u(1))),e};return o.preload=()=>(e||(e=r()),e),o._forwarded=!0,o}const Te=h.__e;h.__e=(t,e,n)=>{if(t&&t.then){let r=e;for(;r=r.__;)if(r.__c&&r.__c.__c)return e.__e==null&&(e.__c.__z=[n.__e],e.__e=n.__e,e.__k=n.__k),e.__k||(e.__k=[]),r.__c.__c(t,e)}Te&&Te(t,e,n)};function vt(t){return this.__c=yt,this.componentDidCatch=t.onError,t.children}function yt(t){t.then(()=>this.forceUpdate())}const Ve=de({ready:!1,appName:"",frontendVersion:""});function $t(){const{ready:t,appName:e,frontendVersion:n}=ve(Ve);if(!t)throw new Error("Static data unavailable outside provider.");return{appName:e,frontendVersion:n}}function gt(t){function e(n){const r=t.querySelector(n);if(r==null)throw new Error(`${n} tag not found.`);const o=r.getAttribute("content");if(o==null)throw new Error(`${n} tag was empty.`);return o}return{appName:e('meta[name="corequery-app-name"]'),frontendVersion:e('meta[name="corequery-frontend-version"]')}}function bt(t){const{Provider:e}=Ve,n=te(()=>gt(document),[]);return L(e,{value:{ready:!0,...n},children:t.children})}const kt=ge(()=>se(()=>import("./Home-DexSIaMn.js"),__vite__mapDeps([0,1]))),Et=ge(()=>se(()=>import("./About-_McQvWnX.js"),__vite__mapDeps([2,1]))),Pt=ge(()=>se(()=>import("./NotFound-GQx5k3Tp.js"),__vite__mapDeps([3,1])));function wt(){return L(bt,{children:L(z,{children:L(vt,{children:L(Ze,{children:[L(_e,{path:"/",component:kt}),L(_e,{path:"/about",component:Et}),L(_e,{default:!0,component:Pt})]})})})})}ut(L(wt,{}),document.body);export{te as T,se as _,L as a,lt as d,ee as k,$t as u,St as y};
@@ -1,7 +1,7 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
2
2
  <style>
3
- .cyan { fill: rgba(145, 145, 145, 1); }
4
- .purple { fill: rgba(100, 100, 100, 1); }
3
+ .top { fill: rgba(145, 145, 145, 1); }
4
+ .bottom { fill: rgba(100, 100, 100, 1); }
5
5
  .inner { fill: white; }
6
6
  .outer { fill: black; }
7
7
  @media (prefers-color-scheme: dark) {
@@ -9,10 +9,10 @@
9
9
  .inner { fill: transparent; }
10
10
  }
11
11
  </style>
12
- <path class="cyan" d=" M 4 4 L 1 4 C 0.448 4 0 4.448 0 5 L 0 8 L 4 8 L 4 4 Z " />
13
- <path class="cyan" d=" M 12 4 L 15 4 C 15.552 4 16 4.448 16 5 L 16 8 L 12 8 L 12 4 Z " />
14
- <path class="purple" d=" M 4 12 L 1 12 C 0.448 12 0 11.552 0 11 L 0 8 L 4 8 L 4 12 Z " />
15
- <path class="purple" d=" M 12 12 L 15 12 C 15.552 12 16 11.552 16 11 L 16 8 L 12 8 L 12 12 Z " />
12
+ <path class="top" d=" M 4 4 L 1 4 C 0.448 4 0 4.448 0 5 L 0 8 L 4 8 L 4 4 Z " />
13
+ <path class="top" d=" M 12 4 L 15 4 C 15.552 4 16 4.448 16 5 L 16 8 L 12 8 L 12 4 Z " />
14
+ <path class="bottom" d=" M 4 12 L 1 12 C 0.448 12 0 11.552 0 11 L 0 8 L 4 8 L 4 12 Z " />
15
+ <path class="bottom" d=" M 12 12 L 15 12 C 15.552 12 16 11.552 16 11 L 16 8 L 12 8 L 12 12 Z " />
16
16
  <rect class="inner" x="6" y="1" width="4" height="14" transform="matrix(1,0,0,1,0,0)" />
17
17
  <path class="outer" d=" M 8 0 L 8 0 C 9.656 0 11 1.344 11 3 L 11 13 C 11 14.656 9.656 16 8 16 L 8 16 C 6.344 16 5 14.656 5 13 L 5 3 C 5 1.344 6.344 0 8 0 Z M 8 2 L 8 2 C 8.552 2 9 2.448 9 3 L 9 13 C 9 13.552 8.552 14 8 14 L 8 14 C 7.448 14 7 13.552 7 13 L 7 3 C 7 2.448 7.448 2 8 2 Z " fill-rule="evenodd" />
18
18
  </svg>
@@ -3,18 +3,17 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
 
6
- <title>CoreQuery</title>
7
- <meta
8
- name="description"
9
- content="A platform for building web apps serving transit information."
10
- />
6
+ <title>CoreQuery Demo App</title>
7
+ <meta name="description" content="This is a CoreQuery demo app." />
8
+ <meta name="corequery-app-name" content="CoreQuery Demo App" />
9
+ <meta name="corequery-frontend-version" content="demo-app" />
11
10
 
12
11
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
13
12
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
14
13
  <link rel="mask-icon" href="/favicon.svg" color="#FFFFFF" />
15
14
  <meta name="theme-color" content="#242933" />
16
15
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
17
- <script type="module" crossorigin src="/assets/index-LHb5BUSB.js"></script>
16
+ <script type="module" crossorigin src="/assets/index-CfFerU5x.js"></script>
18
17
  <link rel="manifest" href="/manifest.webmanifest"></head>
19
18
  <body>
20
19
  </body>
@@ -1 +1 @@
1
- {"name":"CoreQuery","short_name":"CoreQuery","description":"A platform for building web apps serving transit information.","start_url":"/","display":"standalone","background_color":"#242933","theme_color":"#242933","lang":"en","scope":"/","icons":[{"src":"/favicon-circle-192.png","sizes":"192x192","type":"image/png","purpose":"any"},{"src":"/favicon-circle-512.png","sizes":"512x512","type":"image/png","purpose":"any"},{"src":"/favicon-maskable-192.png","sizes":"192x192","type":"image/png","purpose":"maskable"},{"src":"/favicon-maskable-512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}]}
1
+ {"name":"CoreQuery Demo App","short_name":"CoreQuery","description":"This is a CoreQuery demo app.","start_url":"/","display":"standalone","background_color":"#242933","theme_color":"#242933","lang":"en","scope":"/","icons":[{"src":"/pwa-192x192.png","sizes":"192x192","type":"image/png","purpose":"any"},{"src":"/pwa-512x512.png","sizes":"512x512","type":"image/png","purpose":"any"},{"src":"/pwa-maskable-192x192.png","sizes":"192x192","type":"image/png","purpose":"maskable"},{"src":"/pwa-maskable-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}]}
Binary file
Binary file
package/web/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let l={};const t=e=>i(e,o),u={module:{uri:o},exports:l,require:t};s[o]=Promise.all(n.map(e=>u[e]||t(e))).then(e=>(r(...e),l))}}define(["./workbox-1ef09536"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"d6bdf87b060af37784a1273047e5c23e"},{url:"assets/workbox-window.prod.es5-BIl4cyR9.js",revision:null},{url:"assets/index-LHb5BUSB.js",revision:null},{url:"assets/NotFound-BvWaaeTy.js",revision:null},{url:"assets/Nav-BxBap7GO.js",revision:null},{url:"assets/Home-C_Vu2Pm9.js",revision:null},{url:"assets/About-B1OC_zE4.js",revision:null},{url:"favicon-circle-192.png",revision:"7a402c9d0a2294676fab97b3fb912e51"},{url:"favicon-circle-512.png",revision:"db3ee8e87586c10d1b8914b9b00ac670"},{url:"favicon-maskable-192.png",revision:"f3c7b9b24b8dfce90cb512fe5d55a275"},{url:"favicon-maskable-512.png",revision:"8928bafd5dbfeb2c0a72664e29ba5591"},{url:"manifest.webmanifest",revision:"3755ff955b3029cd3f7deea4ec0672e5"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
1
+ if(!self.define){let e,s={};const n=(n,i)=>(n=new URL(n+".js",i).href,s[n]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()}).then(()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(i,r)=>{const l=e||("document"in self?document.currentScript.src:"")||location.href;if(s[l])return;let o={};const t=e=>n(e,l),u={module:{uri:l},exports:o,require:t};s[l]=Promise.all(i.map(e=>u[e]||t(e))).then(e=>(r(...e),o))}}define(["./workbox-1ef09536"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"14a28fc1d86cd169c04805e9dba2b26e"},{url:"assets/workbox-window.prod.es5-BIl4cyR9.js",revision:null},{url:"assets/index-CfFerU5x.js",revision:null},{url:"assets/NotFound-GQx5k3Tp.js",revision:null},{url:"assets/Nav-HZTtzJid.js",revision:null},{url:"assets/Home-DexSIaMn.js",revision:null},{url:"assets/About-_McQvWnX.js",revision:null},{url:"pwa-192x192.png",revision:"8b590313fc6296f57d609982dc21f302"},{url:"pwa-512x512.png",revision:"e5560dba9f85e2959637abbb546643cd"},{url:"pwa-maskable-192x192.png",revision:"f1e5f837a116221b26c9cb9447db5e92"},{url:"pwa-maskable-512x512.png",revision:"9e859d049e78f70ddb5872a3bce2622b"},{url:"manifest.webmanifest",revision:"209d92f34008caf0c68fc089a11e31f0"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
@@ -1 +0,0 @@
1
- import{u as r}from"./index-LHb5BUSB.js";import{N as o}from"./Nav-BxBap7GO.js";function u(){return r("div",{children:[r("h1",{children:"CoreQuery - About"}),r(o,{})]})}export{u as default};
@@ -1 +0,0 @@
1
- import{_ as w,d as g,T as y,u as r,y as v}from"./index-LHb5BUSB.js";import{N as m}from"./Nav-BxBap7GO.js";function k(){console.log("This is shared code running!")}function W(i={}){const{immediate:d=!1,onNeedRefresh:l,onOfflineReady:o,onRegistered:c,onRegisteredSW:a,onRegisterError:s}=i;let n,f,u;const h=async(e=!0)=>{await f,u?.()};async function R(){if("serviceWorker"in navigator){if(n=await w(async()=>{const{Workbox:e}=await import("./workbox-window.prod.es5-BIl4cyR9.js");return{Workbox:e}},[]).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{s?.(e)}),!n)return;u=()=>{n?.messageSkipWaiting()};{let e=!1;const p=()=>{e=!0,n?.addEventListener("controlling",t=>{t.isUpdate&&window.location.reload()}),l?.()};n.addEventListener("installed",t=>{typeof t.isUpdate>"u"?typeof t.isExternal<"u"&&t.isExternal?p():!e&&o?.():t.isUpdate||o?.()}),n.addEventListener("waiting",p)}n.register({immediate:d}).then(e=>{a?a("/sw.js",e):c?.(e)}).catch(e=>{s?.(e)})}}return f=R(),h}function S(){const[i,d]=g(!1),[l,o]=g(!1),c=y(()=>W({onRegisteredSW:()=>console.log("Service worker registered."),onRegisterError:s=>console.error("Service worker error:",s),onNeedRefresh:()=>d(!0),onOfflineReady:()=>o(!0)}),[]);async function a(){await c()}return i?r(P,{onReloadClick:a}):l?r(E,{}):r(_,{})}function E(){return r("span",{children:"PWA: App ready to work offline"})}function P({onReloadClick:i}){return r("div",{children:[r("span",{children:"PWA: Update available"}),r("button",{onClick:i,children:"Update"})]})}function _(){return r("span",{children:"PWA: Nothing to report!"})}function U(){return v(()=>{k()},[]),r("div",{children:[r("h1",{children:"CoreQuery - Home"}),r(m,{}),r(S,{})]})}export{U as default};
@@ -1 +0,0 @@
1
- import{u as o}from"./index-LHb5BUSB.js";import{N as r}from"./Nav-BxBap7GO.js";function n(){return o("div",{children:[o("h1",{children:"CoreQuery - Not Found"}),o(r,{})]})}export{n as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-C_Vu2Pm9.js","assets/Nav-BxBap7GO.js","assets/About-B1OC_zE4.js","assets/NotFound-BvWaaeTy.js"])))=>i.map(i=>d[i]);
2
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const n of o)if(n.type==="childList")for(const u of n.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function _(o){const n={};return o.integrity&&(n.integrity=o.integrity),o.referrerPolicy&&(n.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?n.credentials="include":o.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function r(o){if(o.ep)return;o.ep=!0;const n=_(o);fetch(o.href,n)}})();const Ve="modulepreload",et=function(t){return"/"+t},ye={},le=function(e,_,r){let o=Promise.resolve();if(_&&_.length>0){let f=function(l){return Promise.all(l.map(p=>Promise.resolve(p).then(i=>({status:"fulfilled",value:i}),i=>({status:"rejected",reason:i}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=u?.nonce||u?.getAttribute("nonce");o=f(_.map(l=>{if(l=et(l),l in ye)return;ye[l]=!0;const p=l.endsWith(".css"),i=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${i}`))return;const s=document.createElement("link");if(s.rel=p?"stylesheet":Ve,p||(s.as="script"),s.crossOrigin="",s.href=l,c&&s.setAttribute("nonce",c),document.head.appendChild(s),p)return new Promise((a,v)=>{s.addEventListener("load",a),s.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${l}`)))})}))}function n(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return o.then(u=>{for(const c of u||[])c.status==="rejected"&&n(c.reason);return e().catch(n)})};var j,h,Ae,D,ge,Te,Me,Oe,se,re,oe,Ne,W={},Fe=[],tt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,B=Array.isArray;function $(t,e){for(var _ in e)t[_]=e[_];return t}function fe(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function x(t,e,_){var r,o,n,u={};for(n in e)n=="key"?r=e[n]:n=="ref"?o=e[n]:u[n]=e[n];if(arguments.length>2&&(u.children=arguments.length>3?j.call(arguments,2):_),typeof t=="function"&&t.defaultProps!=null)for(n in t.defaultProps)u[n]===void 0&&(u[n]=t.defaultProps[n]);return I(t,u,r,o,null)}function I(t,e,_,r,o){var n={type:t,props:e,key:_,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Ae,__i:-1,__u:0};return o==null&&h.vnode!=null&&h.vnode(n),n}function ee(t){return t.children}function Y(t,e){this.props=t,this.context=e}function N(t,e){if(e==null)return t.__?N(t.__,t.__i+1):null;for(var _;e<t.__k.length;e++)if((_=t.__k[e])!=null&&_.__e!=null)return _.__e;return typeof t.type=="function"?N(t):null}function Ie(t){var e,_;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((_=t.__k[e])!=null&&_.__e!=null){t.__e=t.__c.base=_.__e;break}return Ie(t)}}function ie(t){(!t.__d&&(t.__d=!0)&&D.push(t)&&!Z.__r++||ge!=h.debounceRendering)&&((ge=h.debounceRendering)||Te)(Z)}function Z(){for(var t,e,_,r,o,n,u,c=1;D.length;)D.length>c&&D.sort(Me),t=D.shift(),c=D.length,t.__d&&(_=void 0,r=void 0,o=(r=(e=t).__v).__e,n=[],u=[],e.__P&&((_=$({},r)).__v=r.__v+1,h.vnode&&h.vnode(_),ae(e.__P,_,r,e.__n,e.__P.namespaceURI,32&r.__u?[o]:null,n,o??N(r),!!(32&r.__u),u),_.__v=r.__v,_.__.__k[_.__i]=_,qe(n,_,u),r.__e=r.__=null,_.__e!=o&&Ie(_)));Z.__r=0}function We(t,e,_,r,o,n,u,c,f,l,p){var i,s,a,v,E,g,d,m=r&&r.__k||Fe,P=e.length;for(f=_t(_,e,m,f,P),i=0;i<P;i++)(a=_.__k[i])!=null&&(s=a.__i==-1?W:m[a.__i]||W,a.__i=i,g=ae(t,a,s,o,n,u,c,f,l,p),v=a.__e,a.ref&&s.ref!=a.ref&&(s.ref&&pe(s.ref,null,a),p.push(a.ref,a.__c||v,a)),E==null&&v!=null&&(E=v),(d=!!(4&a.__u))||s.__k===a.__k?f=je(a,f,t,d):typeof a.type=="function"&&g!==void 0?f=g:v&&(f=v.nextSibling),a.__u&=-7);return _.__e=E,f}function _t(t,e,_,r,o){var n,u,c,f,l,p=_.length,i=p,s=0;for(t.__k=new Array(o),n=0;n<o;n++)(u=e[n])!=null&&typeof u!="boolean"&&typeof u!="function"?(f=n+s,(u=t.__k[n]=typeof u=="string"||typeof u=="number"||typeof u=="bigint"||u.constructor==String?I(null,u,null,null,null):B(u)?I(ee,{children:u},null,null,null):u.constructor==null&&u.__b>0?I(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):u).__=t,u.__b=t.__b+1,c=null,(l=u.__i=nt(u,_,f,i))!=-1&&(i--,(c=_[l])&&(c.__u|=2)),c==null||c.__v==null?(l==-1&&(o>p?s--:o<p&&s++),typeof u.type!="function"&&(u.__u|=4)):l!=f&&(l==f-1?s--:l==f+1?s++:(l>f?s--:s++,u.__u|=4))):t.__k[n]=null;if(i)for(n=0;n<p;n++)(c=_[n])!=null&&(2&c.__u)==0&&(c.__e==r&&(r=N(c)),Ke(c,c));return r}function je(t,e,_,r){var o,n;if(typeof t.type=="function"){for(o=t.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=t,e=je(o[n],e,_,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=N(t)),_.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Be(t,e){return e=e||[],t==null||typeof t=="boolean"||(B(t)?t.some(function(_){Be(_,e)}):e.push(t)),e}function nt(t,e,_,r){var o,n,u,c=t.key,f=t.type,l=e[_],p=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||p&&c==l.key&&f==l.type)return _;if(r>(p?1:0)){for(o=_-1,n=_+1;o>=0||n<e.length;)if((l=e[u=o>=0?o--:n++])!=null&&(2&l.__u)==0&&c==l.key&&f==l.type)return u}return-1}function be(t,e,_){e[0]=="-"?t.setProperty(e,_??""):t[e]=_==null?"":typeof _!="number"||tt.test(e)?_:_+"px"}function G(t,e,_,r,o){var n,u;e:if(e=="style")if(typeof _=="string")t.style.cssText=_;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)_&&e in _||be(t.style,e,"");if(_)for(e in _)r&&_[e]==r[e]||be(t.style,e,_[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Oe,"$1")),u=e.toLowerCase(),e=u in t||e=="onFocusOut"||e=="onFocusIn"?u.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+n]=_,_?r?_.u=r.u:(_.u=se,t.addEventListener(e,n?oe:re,n)):t.removeEventListener(e,n?oe:re,n);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=_??"";break e}catch{}typeof _=="function"||(_==null||_===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&_==1?"":_))}}function ke(t){return function(e){if(this.l){var _=this.l[e.type+t];if(e.t==null)e.t=se++;else if(e.t<_.u)return;return _(h.event?h.event(e):e)}}}function ae(t,e,_,r,o,n,u,c,f,l){var p,i,s,a,v,E,g,d,m,P,w,A,H,K,T,b,C,S=e.type;if(e.constructor!=null)return null;128&_.__u&&(f=!!(32&_.__u),n=[c=e.__e=_.__e]),(p=h.__b)&&p(e);e:if(typeof S=="function")try{if(d=e.props,m="prototype"in S&&S.prototype.render,P=(p=S.contextType)&&r[p.__c],w=p?P?P.props.value:p.__:r,_.__c?g=(i=e.__c=_.__c).__=i.__E:(m?e.__c=i=new S(d,w):(e.__c=i=new Y(d,w),i.constructor=S,i.render=ot),P&&P.sub(i),i.props=d,i.state||(i.state={}),i.context=w,i.__n=r,s=i.__d=!0,i.__h=[],i._sb=[]),m&&i.__s==null&&(i.__s=i.state),m&&S.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,S.getDerivedStateFromProps(d,i.__s))),a=i.props,v=i.state,i.__v=e,s)m&&S.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),m&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(m&&S.getDerivedStateFromProps==null&&d!==a&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,w),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,w)===!1||e.__v==_.__v){for(e.__v!=_.__v&&(i.props=d,i.state=i.__s,i.__d=!1),e.__e=_.__e,e.__k=_.__k,e.__k.some(function(M){M&&(M.__=e)}),A=0;A<i._sb.length;A++)i.__h.push(i._sb[A]);i._sb=[],i.__h.length&&u.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,w),m&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(a,v,E)})}if(i.context=w,i.props=d,i.__P=t,i.__e=!1,H=h.__r,K=0,m){for(i.state=i.__s,i.__d=!1,H&&H(e),p=i.render(i.props,i.state,i.context),T=0;T<i._sb.length;T++)i.__h.push(i._sb[T]);i._sb=[]}else do i.__d=!1,H&&H(e),p=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++K<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),m&&!s&&i.getSnapshotBeforeUpdate!=null&&(E=i.getSnapshotBeforeUpdate(a,v)),b=p,p!=null&&p.type===ee&&p.key==null&&(b=ze(p.props.children)),c=We(t,B(b)?b:[b],e,_,r,o,n,u,c,f,l),i.base=e.__e,e.__u&=-161,i.__h.length&&u.push(i),g&&(i.__E=i.__=null)}catch(M){if(e.__v=null,f||n!=null)if(M.then){for(e.__u|=f?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;n[n.indexOf(c)]=null,e.__e=c}else{for(C=n.length;C--;)fe(n[C]);ue(e)}else e.__e=_.__e,e.__k=_.__k,M.then||ue(e);h.__e(M,e,_)}else n==null&&e.__v==_.__v?(e.__k=_.__k,e.__e=_.__e):c=e.__e=rt(_.__e,e,_,r,o,n,u,f,l);return(p=h.diffed)&&p(e),128&e.__u?void 0:c}function ue(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(ue)}function qe(t,e,_){for(var r=0;r<_.length;r++)pe(_[r],_[++r],_[++r]);h.__c&&h.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(n){n.call(o)})}catch(n){h.__e(n,o.__v)}})}function ze(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:B(t)?t.map(ze):$({},t)}function rt(t,e,_,r,o,n,u,c,f){var l,p,i,s,a,v,E,g=_.props,d=e.props,m=e.type;if(m=="svg"?o="http://www.w3.org/2000/svg":m=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),n!=null){for(l=0;l<n.length;l++)if((a=n[l])&&"setAttribute"in a==!!m&&(m?a.localName==m:a.nodeType==3)){t=a,n[l]=null;break}}if(t==null){if(m==null)return document.createTextNode(d);t=document.createElementNS(o,m,d.is&&d),c&&(h.__m&&h.__m(e,n),c=!1),n=null}if(m==null)g===d||c&&t.data==d||(t.data=d);else{if(n=n&&j.call(t.childNodes),g=_.props||W,!c&&n!=null)for(g={},l=0;l<t.attributes.length;l++)g[(a=t.attributes[l]).name]=a.value;for(l in g)if(a=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")i=a;else if(!(l in d)){if(l=="value"&&"defaultValue"in d||l=="checked"&&"defaultChecked"in d)continue;G(t,l,null,a,o)}}for(l in d)a=d[l],l=="children"?s=a:l=="dangerouslySetInnerHTML"?p=a:l=="value"?v=a:l=="checked"?E=a:c&&typeof a!="function"||g[l]===a||G(t,l,a,g[l],o);if(p)c||i&&(p.__html==i.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(i&&(t.innerHTML=""),We(e.type=="template"?t.content:t,B(s)?s:[s],e,_,r,m=="foreignObject"?"http://www.w3.org/1999/xhtml":o,n,u,n?n[0]:_.__k&&N(_,0),c,f),n!=null)for(l=n.length;l--;)fe(n[l]);c||(l="value",m=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[l]||m=="progress"&&!v||m=="option"&&v!=g[l])&&G(t,l,v,g[l],o),l="checked",E!=null&&E!=t[l]&&G(t,l,E,g[l],o))}return t}function pe(t,e,_){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(o){h.__e(o,_)}}function Ke(t,e,_){var r,o;if(h.unmount&&h.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||pe(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){h.__e(n,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&Ke(r[o],e,_||typeof t.type!="function");_||fe(t.__e),t.__c=t.__=t.__e=void 0}function ot(t,e,_){return this.constructor(t,_)}function it(t,e,_){var r,o,n,u;e==document&&(e=document.documentElement),h.__&&h.__(t,e),o=(r=!1)?null:e.__k,n=[],u=[],ae(e,t=e.__k=x(ee,null,[t]),o||W,W,e.namespaceURI,o?null:e.firstChild?j.call(e.childNodes):null,n,o?o.__e:e.firstChild,r,u),qe(n,t,u)}function Ee(t,e,_){var r,o,n,u,c=$({},t.props);for(n in t.type&&t.type.defaultProps&&(u=t.type.defaultProps),e)n=="key"?r=e[n]:n=="ref"?o=e[n]:c[n]=e[n]===void 0&&u!=null?u[n]:e[n];return arguments.length>2&&(c.children=arguments.length>3?j.call(arguments,2):_),I(t.type,c,r||t.key,o||t.ref,null)}function Ge(t){function e(_){var r,o;return this.getChildContext||(r=new Set,(o={})[e.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&r.forEach(function(u){u.__e=!0,ie(u)})},this.sub=function(n){r.add(n);var u=n.componentWillUnmount;n.componentWillUnmount=function(){r&&r.delete(n),u&&u.call(n)}}),_.children}return e.__c="__cC"+Ne++,e.__=t,e.Provider=e.__l=(e.Consumer=function(_,r){return _.children(r)}).contextType=e,e}j=Fe.slice,h={__e:function(t,e,_,r){for(var o,n,u;e=e.__;)if((o=e.__c)&&!o.__)try{if((n=o.constructor)&&n.getDerivedStateFromError!=null&&(o.setState(n.getDerivedStateFromError(t)),u=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,r||{}),u=o.__d),u)return o.__E=o}catch(c){t=c}throw t}},Ae=0,Y.prototype.setState=function(t,e){var _;_=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$({},this.state),typeof t=="function"&&(t=t($({},_),this.props)),t&&$(_,t),t!=null&&this.__v&&(e&&this._sb.push(e),ie(this))},Y.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ie(this))},Y.prototype.render=ee,D=[],Te=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Me=function(t,e){return t.__v.__b-e.__v.__b},Z.__r=0,Oe=/(PointerCapture)$|Capture$/i,se=0,re=ke(!1),oe=ke(!0),Ne=0;var ut=0;function U(t,e,_,r,o,n){e||(e={});var u,c,f=e;if("ref"in f)for(c in f={},e)c=="ref"?u=e[c]:f[c]=e[c];var l={type:t,props:f,key:_,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ut,__i:-1,__u:0,__source:o,__self:n};if(typeof t=="function"&&(u=t.defaultProps))for(c in u)f[c]===void 0&&(f[c]=u[c]);return h.vnode&&h.vnode(l),l}var R,y,te,Pe,V=0,Je=[],k=h,we=k.__b,Se=k.__r,$e=k.diffed,Ce=k.__c,Le=k.unmount,xe=k.__;function q(t,e){k.__h&&k.__h(y,t,V||e),V=0;var _=y.__H||(y.__H={__:[],__h:[]});return t>=_.__.length&&_.__.push({}),_.__[t]}function ct(t){return V=1,he(Xe,t)}function he(t,e,_){var r=q(R++,2);if(r.t=t,!r.__c&&(r.__=[Xe(void 0,e),function(c){var f=r.__N?r.__N[0]:r.__[0],l=r.t(f,c);f!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var o=function(c,f,l){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(s){return!!s.__c});if(p.every(function(s){return!s.__N}))return!n||n.call(this,c,f,l);var i=r.__c.props!==c;return p.forEach(function(s){if(s.__N){var a=s.__[0];s.__=s.__N,s.__N=void 0,a!==s.__[0]&&(i=!0)}}),n&&n.call(this,c,f,l)||i};y.__f=!0;var n=y.shouldComponentUpdate,u=y.componentWillUpdate;y.componentWillUpdate=function(c,f,l){if(this.__e){var p=n;n=void 0,o(c,f,l),n=p}u&&u.call(this,c,f,l)},y.shouldComponentUpdate=o}return r.__N||r.__}function Et(t,e){var _=q(R++,3);!k.__s&&me(_.__H,e)&&(_.__=t,_.u=e,y.__H.__h.push(_))}function Qe(t,e){var _=q(R++,4);!k.__s&&me(_.__H,e)&&(_.__=t,_.u=e,y.__h.push(_))}function L(t){return V=5,de(function(){return{current:t}},[])}function de(t,e){var _=q(R++,7);return me(_.__H,e)&&(_.__=t(),_.__H=e,_.__h=t),_.__}function Ye(t){var e=y.context[t.__c],_=q(R++,9);return _.c=t,e?(_.__==null&&(_.__=!0,e.sub(y)),e.props.value):t.__}function lt(){for(var t;t=Je.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(X),t.__H.__h.forEach(ce),t.__H.__h=[]}catch(e){t.__H.__h=[],k.__e(e,t.__v)}}k.__b=function(t){y=null,we&&we(t)},k.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),xe&&xe(t,e)},k.__r=function(t){Se&&Se(t),R=0;var e=(y=t.__c).__H;e&&(te===y?(e.__h=[],y.__h=[],e.__.forEach(function(_){_.__N&&(_.__=_.__N),_.u=_.__N=void 0})):(e.__h.forEach(X),e.__h.forEach(ce),e.__h=[],R=0)),te=y},k.diffed=function(t){$e&&$e(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Je.push(e)!==1&&Pe===k.requestAnimationFrame||((Pe=k.requestAnimationFrame)||st)(lt)),e.__H.__.forEach(function(_){_.u&&(_.__H=_.u),_.u=void 0})),te=y=null},k.__c=function(t,e){e.some(function(_){try{_.__h.forEach(X),_.__h=_.__h.filter(function(r){return!r.__||ce(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],k.__e(r,_.__v)}}),Ce&&Ce(t,e)},k.unmount=function(t){Le&&Le(t);var e,_=t.__c;_&&_.__H&&(_.__H.__.forEach(function(r){try{X(r)}catch(o){e=o}}),_.__H=void 0,e&&k.__e(e,_.__v))};var He=typeof requestAnimationFrame=="function";function st(t){var e,_=function(){clearTimeout(r),He&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(_,35);He&&(e=requestAnimationFrame(_))}function X(t){var e=y,_=t.__c;typeof _=="function"&&(t.__c=void 0,_()),y=e}function ce(t){var e=y;t.__c=t.__(),y=e}function me(t,e){return!t||t.length!==e.length||e.some(function(_,r){return _!==t[r]})}function Xe(t,e){return typeof e=="function"?e(t):e}let O,F;function ft(t){return!F||(typeof F=="string"?t.startsWith(F):F.test(t))}function at(t,e){let _="";if(O=void 0,e&&e.type==="click"){if(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button!==0)return t;const r=e.composedPath().find(n=>n.nodeName=="A"&&n.href),o=r&&r.getAttribute("href");if(!r||r.origin!=location.origin||/^#/.test(o)||!/^(_?self)?$/i.test(r.target)||!ft(o))return t;O=!0,e.preventDefault(),_=r.href.replace(location.origin,"")}else e&&e.url?(O=!e.replace,_=e.url):_=location.pathname+location.search;return O===!0?history.pushState(null,"",_):O===!1&&history.replaceState(null,"",_),_}const pt=(t,e,_={})=>{t=t.split("/").filter(Boolean),e=(e||"").split("/").filter(Boolean),_.params||(_.params={});for(let r=0,o,n;r<Math.max(t.length,e.length);r++){let[,u,c,f]=(e[r]||"").match(/^(:?)(.*?)([+*?]?)$/);if(o=t[r],!(!u&&c==o)){if(!u&&o&&f=="*"){_.rest="/"+t.slice(r).map(decodeURIComponent).join("/");break}if(!u||!o&&f!="?"&&f!="*")return;if(n=f=="+"||f=="*",n?o=t.slice(r).map(decodeURIComponent).join("/")||void 0:o&&(o=decodeURIComponent(o)),_.params[c]=o,c in _||(_[c]=o),n)break}}return _};function z(t){const[e,_]=he(at,t.url||location.pathname+location.search);t.scope&&(F=t.scope);const r=O===!0,o=de(()=>{const n=new URL(e,location.origin),u=n.pathname.replace(/\/+$/g,"")||"/";return{url:e,path:u,query:Object.fromEntries(n.searchParams),route:(c,f)=>_({url:c,replace:f}),wasPush:r}},[e]);return Qe(()=>(addEventListener("click",_),addEventListener("popstate",_),()=>{removeEventListener("click",_),removeEventListener("popstate",_)}),[]),x(z.ctx.Provider,{value:o},t.children)}const ht=Promise.resolve();function Ze(t){const[e,_]=he(b=>b+1,0),{url:r,query:o,wasPush:n,path:u}=dt();if(!r)throw new Error("preact-iso's <Router> must be used within a <LocationProvider>, see: https://github.com/preactjs/preact-iso#locationprovider");const{rest:c=u,params:f={}}=Ye(Ue),l=L(!1),p=L(u),i=L(0),s=L(),a=L(),v=L(),E=L(!1),g=L();g.current=!1;let d,m,P;Be(t.children).some(b=>{if(pt(c,b.props.path,P={...b.props,path:c,query:o,params:Object.assign({},f),rest:""}))return d=Ee(b,P);b.props.default&&(m=Ee(b,P))});let w=d||m;const A=s.current&&s.current.__u&J&&s.current.__u&Q,H=s.current&&s.current.__h,K=de(()=>{a.current=s.current,s.current=x(Ue.Provider,{value:P},w);const b=a.current&&a.current.props.children;return!b||!w||w.type!==b.type||w.props.component!==b.props.component?(this.__v&&this.__v.__k&&this.__v.__k.reverse(),i.current++,!0):!1},[r,JSON.stringify(P)]);A?(s.current.__u|=J,s.current.__u|=Q):H&&(s.current.__h=!0);const T=a.current;return a.current=null,this.__c=(b,C)=>{g.current=!0,a.current=T,t.onLoadStart&&t.onLoadStart(r),l.current=!0;let S=i.current;b.then(()=>{S===i.current&&(a.current=null,s.current&&(C.__h&&(s.current.__h=C.__h),C.__u&Q&&(s.current.__u|=Q),C.__u&J&&(s.current.__u|=J)),ht.then(_))})},Qe(()=>{const b=this.__v&&this.__v.__e;if(g.current){!E.current&&!v.current&&(v.current=b);return}!E.current&&v.current&&(v.current!==b&&v.current.remove(),v.current=null),E.current=!0,p.current!==u&&(n&&scrollTo(0,0),t.onRouteChange&&t.onRouteChange(r),p.current=u),t.onLoadEnd&&l.current&&t.onLoadEnd(r),l.current=!1},[u,n,e]),K?[x(_e,{r:s}),x(_e,{r:a})]:x(_e,{r:s})}const J=32,Q=128,_e=({r:t})=>t.current;Ze.Provider=z;z.ctx=Ge({});const Ue=Ge({}),ne=t=>x(t.component,t),dt=()=>Ye(z.ctx),De=h.__b;h.__b=t=>{t.type&&t.type._forwarded&&t.ref&&(t.props.ref=t.ref,t.ref=null),De&&De(t)};function ve(t){let e,_;const r=()=>t().then(n=>_=n&&n.default||n),o=n=>{const[,u]=ct(0),c=L(_);if(e||(e=r()),_!==void 0)return x(_,n);throw c.current||(c.current=e.then(()=>u(1))),e};return o.preload=()=>(e||(e=r()),e),o._forwarded=!0,o}const Re=h.__e;h.__e=(t,e,_)=>{if(t&&t.then){let r=e;for(;r=r.__;)if(r.__c&&r.__c.__c)return e.__e==null&&(e.__c.__z=[_.__e],e.__e=_.__e,e.__k=_.__k),e.__k||(e.__k=[]),r.__c.__c(t,e)}Re&&Re(t,e,_)};function mt(t){return this.__c=vt,this.componentDidCatch=t.onError,t.children}function vt(t){t.then(()=>this.forceUpdate())}const yt=ve(()=>le(()=>import("./Home-C_Vu2Pm9.js"),__vite__mapDeps([0,1]))),gt=ve(()=>le(()=>import("./About-B1OC_zE4.js"),__vite__mapDeps([2,1]))),bt=ve(()=>le(()=>import("./NotFound-BvWaaeTy.js"),__vite__mapDeps([3,1])));function kt(){return U(z,{children:U(mt,{children:U(Ze,{children:[U(ne,{path:"/",component:yt}),U(ne,{path:"/about",component:gt}),U(ne,{default:!0,component:bt})]})})})}it(U(kt,{}),document.body);export{de as T,le as _,ct as d,U as u,Et as y};
Binary file
Binary file
Binary file
Binary file
Binary file