wherever-dev 0.2.0 → 0.3.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 (68) hide show
  1. package/dist/index.js +119 -15
  2. package/dist/index.js.map +1 -1
  3. package/dist/protocol.d.ts +13 -0
  4. package/dist/protocol.d.ts.map +1 -1
  5. package/dist/protocol.js +5 -1
  6. package/dist/protocol.js.map +1 -1
  7. package/dist/session-pool.d.ts +24 -0
  8. package/dist/session-pool.d.ts.map +1 -1
  9. package/dist/session-pool.js +106 -2
  10. package/dist/session-pool.js.map +1 -1
  11. package/package.json +1 -1
  12. package/public/_app/immutable/assets/0.q9wI9TO7.css +1 -0
  13. package/public/_app/immutable/chunks/6X7J6WvW.js +2 -0
  14. package/public/_app/immutable/chunks/{_lppinj8.js.map → 6X7J6WvW.js.map} +1 -1
  15. package/public/_app/immutable/chunks/Bd0XWRPL.js +2 -0
  16. package/public/_app/immutable/chunks/{BqMutrfe.js.map → Bd0XWRPL.js.map} +1 -1
  17. package/public/_app/immutable/chunks/BmiXjuDY.js +2 -0
  18. package/public/_app/immutable/chunks/{DiYtJzYU.js.map → BmiXjuDY.js.map} +1 -1
  19. package/public/_app/immutable/chunks/Bx-JhvcJ.js +2 -0
  20. package/public/_app/immutable/chunks/{BEWoN05F.js.map → Bx-JhvcJ.js.map} +1 -1
  21. package/public/_app/immutable/chunks/DRkv8Frb.js +2 -0
  22. package/public/_app/immutable/chunks/{B5WJGjcR.js.map → DRkv8Frb.js.map} +1 -1
  23. package/public/_app/immutable/chunks/D_-ITvkp.js +2 -0
  24. package/public/_app/immutable/chunks/D_-ITvkp.js.map +1 -0
  25. package/public/_app/immutable/chunks/Db42-KyD.js +3 -0
  26. package/public/_app/immutable/chunks/{DFxBx2vA.js.map → Db42-KyD.js.map} +1 -1
  27. package/public/_app/immutable/entry/app.BCW_w5jE.js +3 -0
  28. package/public/_app/immutable/entry/app.BCW_w5jE.js.map +1 -0
  29. package/public/_app/immutable/entry/start.B21iffdh.js +2 -0
  30. package/public/_app/immutable/entry/start.B21iffdh.js.map +1 -0
  31. package/public/_app/immutable/nodes/0.DzrPFEHh.js +4 -0
  32. package/public/_app/immutable/nodes/{0.BzvDOlXz.js.map → 0.DzrPFEHh.js.map} +1 -1
  33. package/public/_app/immutable/nodes/1.BiDjgup0.js +2 -0
  34. package/public/_app/immutable/nodes/{1.DMtW3tA5.js.map → 1.BiDjgup0.js.map} +1 -1
  35. package/public/_app/immutable/nodes/2.0Tnfs-pB.js +25 -0
  36. package/public/_app/immutable/nodes/2.0Tnfs-pB.js.map +1 -0
  37. package/public/_app/version.json +1 -1
  38. package/public/index.html +16 -16
  39. package/public/pwa/apple-touch-icon.png +0 -0
  40. package/public/pwa/favicon-192.png +0 -0
  41. package/public/pwa/favicon-512.png +0 -0
  42. package/public/pwa/favicon.ico +0 -0
  43. package/public/pwa/favicon.svg +1 -0
  44. package/public/pwa/manifest.webmanifest +31 -7
  45. package/public/pwa/maskable-192.png +0 -0
  46. package/public/pwa/maskable-512.png +0 -0
  47. package/public/pwa/screenshot-desktop.png +0 -0
  48. package/public/pwa/screenshot-mobile.png +0 -0
  49. package/public/robots.txt +5 -0
  50. package/public/service-worker.js +1 -305
  51. package/public/_app/immutable/assets/0.DvZxoQjW.css +0 -2754
  52. package/public/_app/immutable/chunks/B5WJGjcR.js +0 -23
  53. package/public/_app/immutable/chunks/BEWoN05F.js +0 -110
  54. package/public/_app/immutable/chunks/BqMutrfe.js +0 -2129
  55. package/public/_app/immutable/chunks/DFxBx2vA.js +0 -897
  56. package/public/_app/immutable/chunks/DiYtJzYU.js +0 -396
  57. package/public/_app/immutable/chunks/_lppinj8.js +0 -879
  58. package/public/_app/immutable/chunks/rMw82gDs.js +0 -3048
  59. package/public/_app/immutable/chunks/rMw82gDs.js.map +0 -1
  60. package/public/_app/immutable/entry/app.BFki2czn.js +0 -309
  61. package/public/_app/immutable/entry/app.BFki2czn.js.map +0 -1
  62. package/public/_app/immutable/entry/start.BceUuq27.js +0 -6
  63. package/public/_app/immutable/entry/start.BceUuq27.js.map +0 -1
  64. package/public/_app/immutable/nodes/0.BzvDOlXz.js +0 -546
  65. package/public/_app/immutable/nodes/1.DMtW3tA5.js +0 -24
  66. package/public/_app/immutable/nodes/2.CnZp8abw.js +0 -5152
  67. package/public/_app/immutable/nodes/2.CnZp8abw.js.map +0 -1
  68. package/public/icon.png +0 -0
@@ -1 +1 @@
1
- {"version":"5214502"}
1
+ {"version":"c6b6cf4"}
package/public/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <link rel="icon" href="./logo.svg" />
7
- <meta name="description" content="Control your pi coding agent from anywhere with a beautiful remote dashboard." />
7
+ <meta name="description" content="Create & maintain apps from wherever with a beautiful remote workspace." />
8
8
 
9
9
  <!-- inject named-logs-console -->
10
10
  <!-- prettier-ignore -->
@@ -47,33 +47,33 @@
47
47
  })();
48
48
  </script>
49
49
 
50
- <link href="./_app/immutable/entry/start.BceUuq27.js" rel="modulepreload">
51
- <link href="./_app/immutable/chunks/BqMutrfe.js" rel="modulepreload">
52
- <link href="./_app/immutable/chunks/rMw82gDs.js" rel="modulepreload">
53
- <link href="./_app/immutable/entry/app.BFki2czn.js" rel="modulepreload">
54
- <link href="./_app/immutable/chunks/BEWoN05F.js" rel="modulepreload">
55
- <link href="./_app/immutable/chunks/DFxBx2vA.js" rel="modulepreload">
56
- <link href="./_app/immutable/chunks/DiYtJzYU.js" rel="modulepreload">
57
- <link href="./_app/immutable/nodes/0.BzvDOlXz.js" rel="modulepreload">
58
- <link href="./_app/immutable/chunks/_lppinj8.js" rel="modulepreload">
59
- <link href="./_app/immutable/chunks/B5WJGjcR.js" rel="modulepreload">
60
- <link href="./_app/immutable/nodes/2.CnZp8abw.js" rel="modulepreload">
50
+ <link href="./_app/immutable/entry/start.B21iffdh.js" rel="modulepreload">
51
+ <link href="./_app/immutable/chunks/Bd0XWRPL.js" rel="modulepreload">
52
+ <link href="./_app/immutable/chunks/D_-ITvkp.js" rel="modulepreload">
53
+ <link href="./_app/immutable/entry/app.BCW_w5jE.js" rel="modulepreload">
54
+ <link href="./_app/immutable/chunks/Bx-JhvcJ.js" rel="modulepreload">
55
+ <link href="./_app/immutable/chunks/Db42-KyD.js" rel="modulepreload">
56
+ <link href="./_app/immutable/chunks/BmiXjuDY.js" rel="modulepreload">
57
+ <link href="./_app/immutable/nodes/0.DzrPFEHh.js" rel="modulepreload">
58
+ <link href="./_app/immutable/chunks/6X7J6WvW.js" rel="modulepreload">
59
+ <link href="./_app/immutable/chunks/DRkv8Frb.js" rel="modulepreload">
60
+ <link href="./_app/immutable/nodes/2.0Tnfs-pB.js" rel="modulepreload">
61
61
 
62
- <link href="./_app/immutable/assets/0.DvZxoQjW.css" rel="stylesheet">
62
+ <link href="./_app/immutable/assets/0.q9wI9TO7.css" rel="stylesheet">
63
63
  </head>
64
64
  <body data-sveltekit-preload-data="hover">
65
65
  <div style="display: contents">
66
66
  <script>
67
67
  {
68
- __sveltekit_pphq34 = {
68
+ __sveltekit_p86sb9 = {
69
69
  base: new URL(".", location).pathname.slice(0, -1)
70
70
  };
71
71
 
72
72
  const element = document.currentScript.parentElement;
73
73
 
74
74
  Promise.all([
75
- import("./_app/immutable/entry/start.BceUuq27.js"),
76
- import("./_app/immutable/entry/app.BFki2czn.js")
75
+ import("./_app/immutable/entry/start.B21iffdh.js"),
76
+ import("./_app/immutable/entry/app.BCW_w5jE.js")
77
77
  ]).then(([kit, app]) => {
78
78
  kit.start(app, element);
79
79
  });
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><defs><linearGradient id="d" x1="0%" x2="100%" y1="0%" y2="100%"><stop offset="0%" stop-color="#06b6d4"/><stop offset="50%" stop-color="#3b82f6"/><stop offset="100%" stop-color="#8b5cf6"/></linearGradient><linearGradient id="a" x1="0%" x2="100%" y1="0%" y2="100%"><stop offset="0%" stop-color="#06b6d4" stop-opacity=".5"/><stop offset="100%" stop-color="#8b5cf6" stop-opacity=".5"/></linearGradient><filter id="c"><feGaussianBlur result="coloredBlur" stdDeviation="3"/><feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g fill="none" stroke="url(#a)" filter="url(#c)" opacity=".3"><circle cx="60" cy="60" r="48" stroke-dasharray="4 8"/><circle cx="60" cy="60" r="36" stroke-dasharray="6 6" stroke-width="1.5"/></g><g filter="url(#c)"><path fill="none" stroke="url(#d)" stroke-linecap="round" stroke-linejoin="round" stroke-width="10" d="M28 38s7 44 18 44c9 0 8-38 14-38s5 38 14 38c11 0 18-44 18-44"/></g><circle cx="28" cy="38" r="4" fill="#06b6d4"/><circle cx="28" cy="38" r="1.5" fill="#fff"/><circle cx="92" cy="38" r="4" fill="#8b5cf6"/><circle cx="92" cy="38" r="1.5" fill="#fff"/><circle cx="60" cy="44" r="3" fill="#3b82f6"/></svg>
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "Template Website",
3
- "description": "A template to build website",
4
- "display": "fullscreen",
2
+ "name": "Wherever",
3
+ "description": "Create & maintain apps from wherever with a beautiful remote workspace.",
4
+ "display": "standalone",
5
5
  "scope": "../",
6
6
  "start_url": "../",
7
7
  "background_color": "#000000",
@@ -10,18 +10,42 @@
10
10
  {
11
11
  "src": "favicon-192.png",
12
12
  "type": "image/png",
13
- "sizes": "192x192"
13
+ "sizes": "192x192",
14
+ "purpose": "any"
14
15
  },
15
16
  {
16
17
  "src": "favicon-512.png",
17
18
  "type": "image/png",
18
- "sizes": "512x512"
19
+ "sizes": "512x512",
20
+ "purpose": "any"
21
+ },
22
+ {
23
+ "src": "maskable-192.png",
24
+ "type": "image/png",
25
+ "sizes": "192x192",
26
+ "purpose": "maskable"
19
27
  },
20
28
  {
21
- "src": "../maskable_icon_512x512.png",
29
+ "src": "maskable-512.png",
22
30
  "type": "image/png",
23
31
  "sizes": "512x512",
24
32
  "purpose": "maskable"
25
33
  }
34
+ ],
35
+ "screenshots": [
36
+ {
37
+ "src": "screenshot-desktop.png",
38
+ "sizes": "1867x1048",
39
+ "type": "image/png",
40
+ "form_factor": "wide",
41
+ "label": "Wherever dashboard on desktop"
42
+ },
43
+ {
44
+ "src": "screenshot-mobile.png",
45
+ "sizes": "366x790",
46
+ "type": "image/png",
47
+ "form_factor": "narrow",
48
+ "label": "Wherever dashboard on mobile"
49
+ }
26
50
  ]
27
- }
51
+ }
Binary file
Binary file
Binary file
@@ -0,0 +1,5 @@
1
+ # Wherever is a private, Tailscale-only remote workspace; it is not meant to be
2
+ # crawled or indexed. This file exists mainly so the SPA fallback does not serve
3
+ # the HTML app shell for /robots.txt (which Lighthouse flags as invalid).
4
+ User-agent: *
5
+ Disallow: /
@@ -1,305 +1 @@
1
- const base = /* @__PURE__ */ location.pathname.split("/").slice(0, -1).join("/");
2
- const build = [
3
- base + "/_app/immutable/entry/start.BceUuq27.js",
4
- base + "/_app/immutable/entry/app.BFki2czn.js",
5
- base + "/_app/immutable/nodes/0.BzvDOlXz.js",
6
- base + "/_app/immutable/assets/0.DvZxoQjW.css",
7
- base + "/_app/immutable/nodes/1.DMtW3tA5.js",
8
- base + "/_app/immutable/nodes/2.CnZp8abw.js",
9
- base + "/_app/immutable/chunks/B5WJGjcR.js",
10
- base + "/_app/immutable/chunks/BEWoN05F.js",
11
- base + "/_app/immutable/chunks/BqMutrfe.js",
12
- base + "/_app/immutable/chunks/DFxBx2vA.js",
13
- base + "/_app/immutable/chunks/DiYtJzYU.js",
14
- base + "/_app/immutable/chunks/_lppinj8.js",
15
- base + "/_app/immutable/chunks/rMw82gDs.js"
16
- ];
17
- const files = [
18
- base + "/icon.png",
19
- base + "/logo.svg",
20
- base + "/pwa/apple-touch-icon.png",
21
- base + "/pwa/favicon-192.png",
22
- base + "/pwa/favicon-512.png",
23
- base + "/pwa/favicon.ico",
24
- base + "/pwa/favicon.png",
25
- base + "/pwa/manifest.webmanifest"
26
- ];
27
- const prerendered = [
28
- base + "/"
29
- ];
30
- const version = "5214502";
31
- const ID = version;
32
- const sw = self;
33
- let ASSETS = [];
34
- {
35
- ASSETS = build.concat(prerendered).concat(files.filter((v) => v.indexOf("pwa/") === -1));
36
- }
37
- let _logEnabled = true;
38
- function log(...args) {
39
- if (_logEnabled) {
40
- console.debug(`[Service Worker #${ID}] ${args[0]}`, ...args.slice(1));
41
- }
42
- }
43
- const CACHE_NAME = `cache-${version}`;
44
- const regexesOnlineFirst = [];
45
- {
46
- regexesOnlineFirst.push("localhost");
47
- }
48
- const regexesOnlineOnly = [];
49
- const regexesCacheFirst = [
50
- sw.location.origin,
51
- // 'https://rsms.me/inter/', // TODO remove, used if using font from there
52
- "cdn",
53
- ".*\\.png$",
54
- ".*\\.svg$"
55
- ];
56
- const regexesCacheOnly = [];
57
- log(`Origin: ${sw.location.origin}`);
58
- sw.addEventListener("install", (event) => {
59
- log("Install");
60
- event.waitUntil(
61
- caches.open(CACHE_NAME).then((cache) => {
62
- log(`Creating cache: ${CACHE_NAME}`);
63
- return cache.addAll(ASSETS);
64
- }).then(() => {
65
- log(`cache fully fetched!`);
66
- })
67
- );
68
- });
69
- sw.addEventListener("activate", (event) => {
70
- log("Activate");
71
- event.waitUntil(
72
- caches.keys().then((cacheNames) => {
73
- return Promise.all(
74
- cacheNames.map((thisCacheName) => {
75
- if (thisCacheName !== CACHE_NAME) {
76
- log(`Deleting: ${thisCacheName}`);
77
- return caches.delete(thisCacheName);
78
- }
79
- })
80
- ).then(() => sw.clients.claim());
81
- })
82
- );
83
- });
84
- async function fetchAndUpdateCache(request, cache) {
85
- try {
86
- const response = await fetch(request);
87
- try {
88
- const cache_1 = await caches.open(CACHE_NAME);
89
- if (request.method === "GET" && request.url.startsWith("http")) {
90
- cache_1.put(request, response.clone());
91
- }
92
- return response;
93
- } catch (err) {
94
- log(`error: ${err}`);
95
- return response;
96
- }
97
- } catch (err_1) {
98
- if (cache) {
99
- return cache;
100
- } else {
101
- return new Response(`Could Not fetch ${request.url}`, {
102
- status: 503,
103
- headers: { "Content-Type": "text/plain" }
104
- });
105
- }
106
- }
107
- }
108
- const cacheFirst = {
109
- method: (request, cache) => {
110
- log(`Cache first: ${request.url}`);
111
- const fromNetwork = fetchAndUpdateCache(request, cache);
112
- return cache || fromNetwork;
113
- },
114
- regexes: regexesCacheFirst
115
- };
116
- const cacheOnly = {
117
- method: (request, cache) => {
118
- log(`Cache only: ${request.url}`);
119
- return cache || fetchAndUpdateCache(request, cache);
120
- },
121
- regexes: regexesCacheOnly
122
- };
123
- const onlineFirst = {
124
- method: (request, cache) => {
125
- log(`Online first: ${request.url}`);
126
- return fetchAndUpdateCache(request, cache);
127
- },
128
- regexes: regexesOnlineFirst
129
- };
130
- const onlineOnly = {
131
- method: (request) => {
132
- log(`Online only: ${request.url}`);
133
- return fetch(request);
134
- },
135
- regexes: regexesOnlineOnly
136
- };
137
- async function getResponse(event) {
138
- const request = event.request;
139
- const registration = sw.registration;
140
- if (event.request.mode === "navigate" && event.request.method === "GET" && registration.waiting && // eslint-disable-next-line @typescript-eslint/no-explicit-any
141
- (await sw.clients.matchAll()).length < 2) {
142
- log("only one client, skipWaiting as we navigate the page");
143
- registration.waiting.postMessage("skipWaiting");
144
- const response2 = new Response("", { headers: { Refresh: "0" } });
145
- return response2;
146
- }
147
- const response = await caches.match(request).then((cache) => {
148
- const patterns = [onlineFirst, onlineOnly, cacheFirst, cacheOnly];
149
- for (const pattern of patterns) {
150
- for (const regex of pattern.regexes) {
151
- if (RegExp(regex).test(request.url)) {
152
- return pattern.method(request, cache);
153
- }
154
- }
155
- }
156
- return onlineFirst.method(request, cache);
157
- });
158
- return response;
159
- }
160
- sw.addEventListener("fetch", (event) => {
161
- event.respondWith(getResponse(event));
162
- });
163
- sw.addEventListener("message", async function(event) {
164
- if (event.data && event.data.type === "debug") {
165
- _logEnabled = event.data.enabled && event.data.level >= 5;
166
- if (_logEnabled) {
167
- log(`log enabled ${event.data.level}`);
168
- }
169
- } else if (event.data && event.data.type === "ping") {
170
- log("pong");
171
- } else if (event.data === "skipWaiting") {
172
- log(`skipWaiting received`);
173
- event.waitUntil(sw.skipWaiting());
174
- }
175
- });
176
- async function getClientsStatus() {
177
- const windowClients = await sw.clients.matchAll({
178
- type: "window",
179
- includeUncontrolled: true
180
- });
181
- let atLeastOneVisible;
182
- let atLeastOneFocused;
183
- let atLeastOneVisibleAndFocused;
184
- for (var i = 0; i < windowClients.length; i++) {
185
- const windowClient = windowClients[i];
186
- const visible = windowClient.visibilityState === "visible";
187
- const hasFocus = windowClient.focused;
188
- if (visible && !atLeastOneVisible) {
189
- atLeastOneVisible = windowClient;
190
- }
191
- if (hasFocus && !atLeastOneFocused) {
192
- atLeastOneFocused = windowClient;
193
- }
194
- if (hasFocus && visible) {
195
- atLeastOneVisibleAndFocused = windowClient;
196
- break;
197
- }
198
- }
199
- return {
200
- atLeastOneFocused,
201
- atLeastOneVisible,
202
- atLeastOneVisibleAndFocused
203
- };
204
- }
205
- async function handlePush(data) {
206
- const appActive = await getClientsStatus();
207
- const notificationTuple = {
208
- title: "Notification",
209
- options: {
210
- body: "You have a new notification",
211
- icon: "/favicon.png",
212
- // TODO template it ?
213
- badge: "/favicon.png"
214
- // TODO template it ?
215
- }
216
- };
217
- if (data) {
218
- try {
219
- const json = JSON.parse(data);
220
- if (json.web_push === 8030) {
221
- const notif = json.notification;
222
- notificationTuple.options = {
223
- badge: notif.badge,
224
- body: notif.body,
225
- data: notif.data,
226
- dir: notif.dir,
227
- icon: notif.icon,
228
- lang: notif.lang,
229
- requireInteraction: notif.requireInteraction,
230
- silent: notif.silent,
231
- tag: notif.tag
232
- };
233
- notificationTuple.title = notif.title;
234
- if (!notificationTuple.options.icon) {
235
- notificationTuple.options.icon = notif.image;
236
- }
237
- if (notif.navigate) {
238
- if (!notificationTuple.options.data) {
239
- notificationTuple.options.data = { navigate: notif.navigate };
240
- } else {
241
- if (typeof notificationTuple.options.data === "object" && !notificationTuple.options.data.navigate) {
242
- notificationTuple.options.data = {
243
- ...notificationTuple.options.data,
244
- navigate: notif.navigate
245
- };
246
- }
247
- }
248
- }
249
- } else {
250
- notificationTuple.title = json.notification?.title || json.title || "Notification";
251
- notificationTuple.options = json.notification || json.options;
252
- }
253
- } catch {
254
- notificationTuple.options.body = data;
255
- }
256
- }
257
- log(`handlePush`, data, notificationTuple);
258
- if (appActive.atLeastOneVisibleAndFocused) {
259
- log(`posting notification to active app`, notificationTuple);
260
- appActive.atLeastOneVisibleAndFocused.postMessage({
261
- type: "notification",
262
- notification: {
263
- title: notificationTuple.title,
264
- options: notificationTuple.options
265
- }
266
- });
267
- } else {
268
- await sw.registration.showNotification(
269
- notificationTuple.title,
270
- notificationTuple.options
271
- );
272
- }
273
- }
274
- sw.addEventListener("push", function(event) {
275
- const data = event.data?.text();
276
- event.waitUntil(handlePush(data));
277
- });
278
- async function handleNotificationClick(notification) {
279
- const windowClients = await sw.clients.matchAll({
280
- type: "window",
281
- includeUncontrolled: true
282
- });
283
- const swPath = location.pathname;
284
- const swFolder = swPath.substring(0, swPath.lastIndexOf("/") + 1);
285
- let url = notification.data?.navigate;
286
- if (url) {
287
- if (!url.startsWith("/") && url.indexOf(":/") == -1) {
288
- url = swFolder + url;
289
- }
290
- }
291
- for (const client of windowClients) {
292
- log(`${"focus" in client ? "focus-available: " : ""}: ${client.url}`);
293
- if ("focus" in client) {
294
- if (url && "navigate" in client) {
295
- return client.focus().then(() => client.navigate(url));
296
- }
297
- return client.focus();
298
- }
299
- }
300
- if (sw.clients.openWindow) return sw.clients.openWindow(url || "/");
301
- }
302
- sw.addEventListener("notificationclick", function(event) {
303
- event.notification.close();
304
- event.waitUntil(handleNotificationClick(event.notification));
305
- });
1
+ const a=location.pathname.split("/").slice(0,-1).join("/"),b=[a+"/_app/immutable/entry/start.B21iffdh.js",a+"/_app/immutable/entry/app.BCW_w5jE.js",a+"/_app/immutable/nodes/0.DzrPFEHh.js",a+"/_app/immutable/assets/0.q9wI9TO7.css",a+"/_app/immutable/nodes/1.BiDjgup0.js",a+"/_app/immutable/nodes/2.0Tnfs-pB.js",a+"/_app/immutable/chunks/6X7J6WvW.js",a+"/_app/immutable/chunks/Bd0XWRPL.js",a+"/_app/immutable/chunks/BmiXjuDY.js",a+"/_app/immutable/chunks/Bx-JhvcJ.js",a+"/_app/immutable/chunks/DRkv8Frb.js",a+"/_app/immutable/chunks/D_-ITvkp.js",a+"/_app/immutable/chunks/Db42-KyD.js"],y=[a+"/logo.svg",a+"/pwa/apple-touch-icon.png",a+"/pwa/favicon-192.png",a+"/pwa/favicon-512.png",a+"/pwa/favicon.ico",a+"/pwa/favicon.png",a+"/pwa/favicon.svg",a+"/pwa/manifest.webmanifest",a+"/pwa/maskable-192.png",a+"/pwa/maskable-512.png",a+"/pwa/screenshot-desktop.png",a+"/pwa/screenshot-mobile.png",a+"/robots.txt"],v=[a+"/"],m="c6b6cf4",k=m,s=self;let w=[];w=b.concat(v).concat(y.filter(t=>t.indexOf("pwa/")===-1));let u=!0;function o(...t){u&&console.debug(`[Service Worker #${k}] ${t[0]}`,...t.slice(1))}const d=`cache-${m}`,h=[];h.push("localhost");const $=["/sessions(\\?|$|/)","/models(\\?|$|/)","/config(\\?|$|/)","/check-path(\\?|$|/)","/autocomplete-path(\\?|$|/)","/session/","/health(\\?|$)"];for(const t of $)h.push(t);const O=[],_=[s.location.origin,"cdn",".*\\.png$",".*\\.svg$"],x=[];o(`Origin: ${s.location.origin}`);s.addEventListener("install",t=>{o("Install"),t.waitUntil(caches.open(d).then(i=>(o(`Creating cache: ${d}`),i.addAll(w))).then(()=>{o("cache fully fetched!")}))});s.addEventListener("activate",t=>{o("Activate"),t.waitUntil(caches.keys().then(i=>Promise.all(i.map(e=>{if(e!==d)return o(`Deleting: ${e}`),caches.delete(e)})).then(()=>s.clients.claim())))});async function g(t,i){try{const e=await fetch(t);try{const c=await caches.open(d);return t.method==="GET"&&t.url.startsWith("http")&&c.put(t,e.clone()),e}catch(c){return o(`error: ${c}`),e}}catch{return i||new Response(`Could Not fetch ${t.url}`,{status:503,headers:{"Content-Type":"text/plain"}})}}const j={method:(t,i)=>{o(`Cache first: ${t.url}`);const e=g(t,i);return i||e},regexes:_},E={method:(t,i)=>(o(`Cache only: ${t.url}`),i||g(t,i)),regexes:x},f={method:(t,i)=>(o(`Online first: ${t.url}`),g(t,i)),regexes:h},W={method:t=>(o(`Online only: ${t.url}`),fetch(t)),regexes:O};async function A(t){const i=t.request,e=s.registration;if(t.request.mode==="navigate"&&t.request.method==="GET"&&e.waiting&&(await s.clients.matchAll()).length<2)return o("only one client, skipWaiting as we navigate the page"),e.waiting.postMessage("skipWaiting"),new Response("",{headers:{Refresh:"0"}});if(t.request.mode==="navigate"&&t.request.method==="GET"){const n=await caches.match(i);return f.method(i,n)}return await caches.match(i).then(n=>{const l=[f,W,j,E];for(const r of l)for(const p of r.regexes)if(RegExp(p).test(i.url))return r.method(i,n);return f.method(i,n)})}s.addEventListener("fetch",t=>{t.respondWith(A(t))});s.addEventListener("message",async function(t){t.data&&t.data.type==="debug"?(u=t.data.enabled&&t.data.level>=5,u&&o(`log enabled ${t.data.level}`)):t.data&&t.data.type==="ping"?o("pong"):t.data==="skipWaiting"&&(o("skipWaiting received"),t.waitUntil(s.skipWaiting()))});async function C(){const t=await s.clients.matchAll({type:"window",includeUncontrolled:!0});let i,e,c;for(var n=0;n<t.length;n++){const l=t[n],r=l.visibilityState==="visible",p=l.focused;if(r&&!i&&(i=l),p&&!e&&(e=l),p&&r){c=l;break}}return{atLeastOneFocused:e,atLeastOneVisible:i,atLeastOneVisibleAndFocused:c}}async function F(t){const i=await C(),e={title:"Notification",options:{body:"You have a new notification",icon:"/favicon.png",badge:"/favicon.png"}};if(t)try{const c=JSON.parse(t);if(c.web_push===8030){const n=c.notification;e.options={badge:n.badge,body:n.body,data:n.data,dir:n.dir,icon:n.icon,lang:n.lang,requireInteraction:n.requireInteraction,silent:n.silent,tag:n.tag},e.title=n.title,e.options.icon||(e.options.icon=n.image),n.navigate&&(e.options.data?typeof e.options.data=="object"&&!e.options.data.navigate&&(e.options.data={...e.options.data,navigate:n.navigate}):e.options.data={navigate:n.navigate})}else e.title=c.notification?.title||c.title||"Notification",e.options=c.notification||c.options}catch{e.options.body=t}o("handlePush",t,e),i.atLeastOneVisibleAndFocused?(o("posting notification to active app",e),i.atLeastOneVisibleAndFocused.postMessage({type:"notification",notification:{title:e.title,options:e.options}})):await s.registration.showNotification(e.title,e.options)}s.addEventListener("push",function(t){const i=t.data?.text();t.waitUntil(F(i))});async function L(t){const i=await s.clients.matchAll({type:"window",includeUncontrolled:!0}),e=location.pathname,c=e.substring(0,e.lastIndexOf("/")+1);let n=t.data?.navigate;n&&!n.startsWith("/")&&n.indexOf(":/")==-1&&(n=c+n);for(const l of i)if(o(`${"focus"in l?"focus-available: ":""}: ${l.url}`),"focus"in l)return n&&"navigate"in l?l.focus().then(()=>l.navigate(n)):l.focus();if(s.clients.openWindow)return s.clients.openWindow(n||"/")}s.addEventListener("notificationclick",function(t){t.notification.close(),t.waitUntil(L(t.notification))});