zip-peek 0.2.3-alpha.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.
package/dist/index.js CHANGED
@@ -2,27 +2,103 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isZipPackage = void 0;
4
4
  exports.initZipPeek = initZipPeek;
5
- const registerZipServiceWorker_1 = require("./registerZipServiceWorker");
5
+ const types_1 = require("./types");
6
6
  const zip_utils_1 = require("./zip-utils");
7
7
  Object.defineProperty(exports, "isZipPackage", { enumerable: true, get: function () { return zip_utils_1.isZipPackage; } });
8
8
  let currentOnError;
9
9
  let clientErrorListenerInstalled = false;
10
- function toError(error) {
11
- return error instanceof Error ? error : new Error(String(error));
10
+ function normalizeScopePath(href) {
11
+ let p = new URL(href).pathname;
12
+ if (p.length > 1 && p.endsWith("/")) {
13
+ p = p.slice(0, -1);
14
+ }
15
+ return p;
16
+ }
17
+ function zipServiceWorkerScriptMatches(scriptURL, expectedWorkerUrl) {
18
+ if (!scriptURL) {
19
+ return false;
20
+ }
21
+ try {
22
+ const expected = new URL(expectedWorkerUrl, window.location.href).href;
23
+ const resolved = new URL(scriptURL, window.location.href).href;
24
+ return resolved === expected;
25
+ }
26
+ catch {
27
+ try {
28
+ return /\/zipServiceWorker(\.[0-9a-f]{8})?\.js(\?|$)/.test(new URL(scriptURL).pathname);
29
+ }
30
+ catch {
31
+ return false;
32
+ }
33
+ }
34
+ }
35
+ async function unregisterMismatchedScopeZipServiceWorkerIfNeeded(expectedWorkerUrl, expectedScopeUrl) {
36
+ const expectedWorkerHref = new URL(expectedWorkerUrl, window.location.href)
37
+ .href;
38
+ const wantScopePath = normalizeScopePath(expectedScopeUrl);
39
+ const registrations = await navigator.serviceWorker.getRegistrations();
40
+ for (const reg of registrations) {
41
+ const scriptURL = reg.installing?.scriptURL ??
42
+ reg.waiting?.scriptURL ??
43
+ reg.active?.scriptURL;
44
+ if (!scriptURL) {
45
+ continue;
46
+ }
47
+ let scriptHref;
48
+ try {
49
+ scriptHref = new URL(scriptURL, window.location.href).href;
50
+ }
51
+ catch {
52
+ continue;
53
+ }
54
+ if (scriptHref !== expectedWorkerHref) {
55
+ continue;
56
+ }
57
+ const regScopePath = normalizeScopePath(reg.scope);
58
+ if (regScopePath !== wantScopePath) {
59
+ await reg.unregister();
60
+ console.log(`Unregistered zip service worker (scope ${reg.scope}); re-registering with ${expectedScopeUrl}`);
61
+ }
62
+ }
63
+ }
64
+ async function ensureZipServiceWorkerRegistered({ workerUrl, scopeUrl, reloadOnFirstInstall = true, }) {
65
+ if (!("serviceWorker" in navigator)) {
66
+ return false;
67
+ }
68
+ await unregisterMismatchedScopeZipServiceWorkerIfNeeded(workerUrl, scopeUrl);
69
+ const existing = await navigator.serviceWorker.getRegistration(scopeUrl);
70
+ const alreadyRegistered = existing &&
71
+ (zipServiceWorkerScriptMatches(existing.active?.scriptURL, workerUrl) ||
72
+ zipServiceWorkerScriptMatches(existing.waiting?.scriptURL, workerUrl) ||
73
+ zipServiceWorkerScriptMatches(existing.installing?.scriptURL, workerUrl));
74
+ if (!alreadyRegistered) {
75
+ await navigator.serviceWorker.register(workerUrl, { scope: scopeUrl });
76
+ console.log("Zip service worker registered successfully");
77
+ }
78
+ else {
79
+ console.log("Zip service worker already registered; skipping register().");
80
+ }
81
+ await navigator.serviceWorker.ready;
82
+ if (reloadOnFirstInstall && !navigator.serviceWorker.controller) {
83
+ window.location.reload();
84
+ return true;
85
+ }
86
+ return false;
12
87
  }
13
- function toZipPeekError(error, info) {
14
- const err = toError(error);
88
+ function attachZipPeekInfo(error, info) {
89
+ const err = (0, types_1.toZipPeekError)(error);
15
90
  if (info) {
16
- err.zipPeekInfo = info;
91
+ err.zipPeekInfo = (0, types_1.formatZipPeekError)(info);
17
92
  }
18
93
  return err;
19
94
  }
20
95
  function reportZipPeekError(onError, error, info) {
21
- const err = toError(error);
96
+ const err = (0, types_1.toZipPeekError)(error);
22
97
  onError?.(err, info ?? err.zipPeekInfo);
23
98
  }
24
99
  function errorFromWorkerResponse(response) {
25
- const error = new Error(response.error ?? "zip-peek: service worker message failed.");
100
+ const error = new Error(response.error ??
101
+ (0, types_1.formatZipPeekError)("Service worker did not acknowledge the message."));
26
102
  if (response.errorStack) {
27
103
  error.stack = response.errorStack;
28
104
  }
@@ -38,11 +114,12 @@ function ensureClientErrorListener() {
38
114
  if (!data || data.type !== "ZIP_SW_ERROR" || !currentOnError) {
39
115
  return;
40
116
  }
41
- const error = new Error(data.error?.message ?? "zip-peek: service worker error");
117
+ const error = new Error(data.error?.message ??
118
+ (0, types_1.formatZipPeekError)("Service worker reported an error."));
42
119
  if (data.error?.stack) {
43
120
  error.stack = data.error.stack;
44
121
  }
45
- currentOnError(error, data.info);
122
+ currentOnError(error, data.info ? (0, types_1.formatZipPeekError)(data.info) : undefined);
46
123
  });
47
124
  }
48
125
  function normalizeAllowedZipUrls(allowedZipUrls) {
@@ -50,13 +127,13 @@ function normalizeAllowedZipUrls(allowedZipUrls) {
50
127
  return undefined;
51
128
  }
52
129
  if (allowedZipUrls.length === 0) {
53
- throw new Error("zip-peek: allowedZipUrls must contain at least one ZIP URL when provided.");
130
+ throw (0, types_1.createZipPeekError)("allowedZipUrls must contain at least one ZIP URL when provided.");
54
131
  }
55
132
  const normalized = new Set();
56
133
  for (const zipUrl of allowedZipUrls) {
57
134
  const resolvedZipUrl = new URL(zipUrl, window.location.href).href;
58
135
  if (!(0, zip_utils_1.isZipPackage)(resolvedZipUrl)) {
59
- throw new Error(`zip-peek: allowedZipUrls contains a non-ZIP URL: ${zipUrl}`);
136
+ throw (0, types_1.createZipPeekError)(`allowedZipUrls contains a non-ZIP URL: ${zipUrl}`);
60
137
  }
61
138
  normalized.add((0, zip_utils_1.normalizeZipUrl)(resolvedZipUrl));
62
139
  }
@@ -65,7 +142,7 @@ function normalizeAllowedZipUrls(allowedZipUrls) {
65
142
  function postWorkerMessage(message) {
66
143
  const controller = navigator.serviceWorker.controller;
67
144
  if (!controller) {
68
- return Promise.resolve();
145
+ return Promise.reject((0, types_1.createZipPeekError)("No active service worker controller. Reload the page after first install, or pass reloadOnFirstInstall: true."));
69
146
  }
70
147
  return new Promise((resolve, reject) => {
71
148
  const channel = new MessageChannel();
@@ -81,7 +158,7 @@ function postWorkerMessage(message) {
81
158
  };
82
159
  channel.port1.onmessageerror = () => {
83
160
  channel.port1.close();
84
- reject(new Error("zip-peek: failed to receive service worker response."));
161
+ reject((0, types_1.createZipPeekError)("Failed to deserialize the service worker response on MessageChannel."));
85
162
  };
86
163
  controller.postMessage(message, [channel.port2]);
87
164
  });
@@ -91,7 +168,7 @@ async function postWorkerMessageOrThrow(message, info) {
91
168
  await postWorkerMessage(message);
92
169
  }
93
170
  catch (error) {
94
- throw toZipPeekError(error, info);
171
+ throw attachZipPeekInfo(error, info);
95
172
  }
96
173
  }
97
174
  /**
@@ -113,22 +190,22 @@ async function initZipPeek({ workerUrl, scopeUrl, reloadOnFirstInstall = true, c
113
190
  const normalizedAllowedZipUrls = normalizeAllowedZipUrls(allowedZipUrls);
114
191
  if (cacheClearingStrategy === "keep-allowed-urls" &&
115
192
  !normalizedAllowedZipUrls) {
116
- throw new Error('zip-peek: cacheClearingStrategy "keep-allowed-urls" requires a non-empty allowedZipUrls allow-list.');
193
+ throw (0, types_1.createZipPeekError)('cacheClearingStrategy "keep-allowed-urls" requires a non-empty allowedZipUrls allow-list.');
117
194
  }
118
195
  if (!("serviceWorker" in navigator)) {
119
- console.warn("zip-peek: Service Worker API not supported.");
196
+ console.warn("zip-peek: Service Worker API not supported in this browser.");
120
197
  return { reloaded: false, initialized: false };
121
198
  }
122
199
  let reloaded;
123
200
  try {
124
- reloaded = await (0, registerZipServiceWorker_1.ensureZipServiceWorkerRegistered)({
201
+ reloaded = await ensureZipServiceWorkerRegistered({
125
202
  workerUrl,
126
203
  scopeUrl,
127
204
  reloadOnFirstInstall,
128
205
  });
129
206
  }
130
207
  catch (error) {
131
- throw toZipPeekError(error, "zip-peek: service worker registration failed");
208
+ throw attachZipPeekInfo(error, "Service worker registration failed");
132
209
  }
133
210
  if (reloaded) {
134
211
  return { reloaded: true, initialized: false };
@@ -141,11 +218,11 @@ async function initZipPeek({ workerUrl, scopeUrl, reloadOnFirstInstall = true, c
141
218
  logPrefix,
142
219
  allowedZipUrls: normalizedAllowedZipUrls ?? null,
143
220
  },
144
- }, "zip-peek: failed to configure service worker");
221
+ }, "Failed to configure service worker");
145
222
  if (cacheClearingStrategy === "clear-all") {
146
223
  await postWorkerMessageOrThrow({
147
224
  type: "CLEAR_ALL_ZIP_ASSETS",
148
- }, "zip-peek: failed to clear zip assets");
225
+ }, "Failed to clear all zip assets");
149
226
  await postWorkerMessageOrThrow({
150
227
  type: "ZIP_SW_CONFIG",
151
228
  config: {
@@ -154,20 +231,20 @@ async function initZipPeek({ workerUrl, scopeUrl, reloadOnFirstInstall = true, c
154
231
  logPrefix,
155
232
  allowedZipUrls: normalizedAllowedZipUrls ?? null,
156
233
  },
157
- }, "zip-peek: failed to reconfigure service worker after cache clear");
234
+ }, "Failed to reconfigure service worker after cache clear");
158
235
  }
159
236
  else if (cacheClearingStrategy === "keep-allowed-urls" &&
160
237
  normalizedAllowedZipUrls) {
161
238
  await postWorkerMessageOrThrow({
162
239
  type: "CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED",
163
240
  allowedZipUrls: normalizedAllowedZipUrls,
164
- }, "zip-peek: failed to clear disallowed zip assets");
241
+ }, "Failed to clear disallowed zip assets");
165
242
  }
166
243
  if (normalizedAllowedZipUrls) {
167
244
  await postWorkerMessageOrThrow({
168
245
  type: "PRELOAD_ZIP_MANIFESTS",
169
246
  allowedZipUrls: normalizedAllowedZipUrls,
170
- }, "zip-peek: failed to preload zip manifests");
247
+ }, "Failed to preload ZIP manifests");
171
248
  }
172
249
  return { reloaded: false, initialized: true };
173
250
  }
package/dist/types.d.ts CHANGED
@@ -25,3 +25,8 @@ export type WorkerMessageResponse = {
25
25
  error?: string;
26
26
  errorStack?: string;
27
27
  };
28
+ export declare const ZIP_PEEK_ERROR_PREFIX = "[zip-peek-error]";
29
+ export declare function formatZipPeekError(message: string): string;
30
+ export declare function createZipPeekError(message: string): Error;
31
+ export declare function toZipPeekError(error: unknown): Error;
32
+ export declare function errorMessage(error: unknown): string;
package/dist/types.js CHANGED
@@ -1,2 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZIP_PEEK_ERROR_PREFIX = void 0;
4
+ exports.formatZipPeekError = formatZipPeekError;
5
+ exports.createZipPeekError = createZipPeekError;
6
+ exports.toZipPeekError = toZipPeekError;
7
+ exports.errorMessage = errorMessage;
8
+ exports.ZIP_PEEK_ERROR_PREFIX = "[zip-peek-error]";
9
+ function formatZipPeekError(message) {
10
+ const trimmed = message.trim();
11
+ if (trimmed.startsWith(exports.ZIP_PEEK_ERROR_PREFIX)) {
12
+ return trimmed;
13
+ }
14
+ return `${exports.ZIP_PEEK_ERROR_PREFIX} ${trimmed}`;
15
+ }
16
+ function createZipPeekError(message) {
17
+ return new Error(formatZipPeekError(message));
18
+ }
19
+ function toZipPeekError(error) {
20
+ const err = error instanceof Error ? error : new Error(String(error));
21
+ if (!err.message.startsWith(exports.ZIP_PEEK_ERROR_PREFIX)) {
22
+ err.message = formatZipPeekError(err.message);
23
+ }
24
+ return err;
25
+ }
26
+ function errorMessage(error) {
27
+ return error instanceof Error ? error.message : String(error);
28
+ }
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var t={978(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.persistAllowedZipUrlsConfig=o,e.ensureAllowedZipUrlsLoaded=async function(){if(s.allowedZipUrlsLoaded)return s.allowedZipUrlsLoaded;const t=(async()=>{try{const t=await caches.open(r.CONFIG_CACHE_NAME),e=await t.match(s.CONFIG_CACHE_KEY);if(!e)return;const n=await e.json();Array.isArray(n.allowedZipUrls)?(0,s.setAllowedZipUrls)(new Set(n.allowedZipUrls.filter(t=>"string"==typeof t).map(t=>(0,i.normalizeZipUrl)(t)))):(0,s.setAllowedZipUrls)(null)}catch(t){(0,a.warn)("failed to load runtime config",t)}})();return(0,s.setAllowedZipUrlsLoaded)(t),t},e.applyRuntimeConfig=async function(t){if(!t)return;let e={...s.runtimeConfig},n=!1;if("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(e.zipAssetCacheName=t.zipAssetCacheName,n=!0),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(e.assetCacheTtlMs=t.assetCacheTtlMs,n=!0),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(e.logPrefix=t.logPrefix,n=!0),n&&(0,s.setRuntimeConfig)(e),"allowedZipUrls"in t){const e=Array.isArray(t.allowedZipUrls)?t.allowedZipUrls.map(t=>(0,i.normalizeZipUrl)(t)):null;(0,s.setAllowedZipUrls)(e?new Set(e):null),(0,s.setAllowedZipUrlsLoaded)(Promise.resolve()),await o(e)}},e.isZipUrlAllowed=function(t){return null===s.allowedZipUrls||s.allowedZipUrls.has(t)};const i=n(183),r=n(778),s=n(6),a=n(271);async function o(t){try{const e=await caches.open(r.CONFIG_CACHE_NAME);await e.put(new Request(s.CONFIG_CACHE_KEY),new Response(JSON.stringify({allowedZipUrls:t}),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,a.warn)("failed to persist runtime config",t)}}},752(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.canonicalAssetRequest=function(t,e){return new Request((0,i.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})},e.assetCacheEntryExpired=l,e.clearAllZipAssets=async function(){const t=await caches.open(o.runtimeConfig.zipAssetCacheName),e=await t.keys();await Promise.all(e.map(e=>t.delete(e))),await caches.delete(r.CONFIG_CACHE_NAME),o.zipManifests.clear(),o.pendingManifestLoads.clear(),(0,o.setAllowedZipUrlsLoaded)(Promise.resolve())},e.clearZipAssetsExceptAllowed=async function(t){try{const e=new Set(t),n=await caches.open(o.runtimeConfig.zipAssetCacheName),s=await n.keys();for(const t of s){const s=t.url;if(s.includes(r.MANIFEST_CACHE_KEY)){const i=(0,a.zipUrlFromManifestCacheKey)(s);i&&!e.has(i)&&await n.delete(t);continue}const o=(0,i.parseZipAssetRequest)(s);o&&!e.has(o.zipUrl)&&await n.delete(t)}for(const t of o.zipManifests.keys())e.has(t)||o.zipManifests.delete(t)}catch(t){(0,s.warn)("clearZipAssetsExceptAllowed failed",t)}},e.putCachedFullAssetIfAbsent=async function(t,e){try{const n=await caches.open(o.runtimeConfig.zipAssetCacheName),i=await n.match(t);if(i&&!l(i))return;const s=e.type||"application/octet-stream";await n.put(t,new Response(e,{status:200,headers:{"Content-Type":s,"Content-Length":String(e.size),"Access-Control-Allow-Origin":"*",[r.ASSET_CACHED_AT_HEADER]:String(Date.now())}}))}catch(t){(0,s.warn)("asset cache put failed",t)}},e.readCachedZipAssetIfFresh=async function(t){let e=null,n="network";try{const i=await caches.open(o.runtimeConfig.zipAssetCacheName),r=await i.match(t);if(r)if(l(r))try{await i.delete(t)}catch(t){(0,s.warn)("asset cache delete expired failed",t)}else e=await r.blob(),n="cache-api"}catch(t){(0,s.warn)("asset cache read failed",t)}return{blob:e,assetSource:n}};const i=n(183),r=n(778),s=n(271),a=n(234),o=n(6);function l(t){const e=t.headers.get(r.ASSET_CACHED_AT_HEADER);if(!e)return!0;const n=parseInt(e,10);return!Number.isFinite(n)||Date.now()-n>o.runtimeConfig.assetCacheTtlMs}},546(t,e){function n(t,e){const n=t instanceof Error?t:new Error(String(t));self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(t=>{const i={type:"ZIP_SW_ERROR",error:{message:n.message,stack:n.stack},info:e};for(const e of t)e.postMessage(i)})}Object.defineProperty(e,"__esModule",{value:!0}),e.reportClientError=n,e.installClientErrorReporting=function(){self.addEventListener("error",t=>{n(t.error??t.message,"zip-peek: service worker error")}),self.addEventListener("unhandledrejection",t=>{n(t.reason,"zip-peek: service worker unhandled rejection")})}},778(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MANIFEST_CACHE_KEY=e.LOCAL_FILE_HEADER_SIG=e.MIME_TYPES=e.ASSET_SOURCE_HEADER=e.ASSET_CACHED_AT_HEADER=e.ALLOWED_CACHE_NAMES=e.CONFIG_CACHE_NAME=e.DEFAULT_ASSET_CACHE_TTL_MS=e.DEFAULT_ZIP_ASSET_CACHE_NAME=void 0,e.DEFAULT_ZIP_ASSET_CACHE_NAME="zip-cache-v1",e.DEFAULT_ASSET_CACHE_TTL_MS=72e5,e.CONFIG_CACHE_NAME="zip-peek-config-v1",e.ALLOWED_CACHE_NAMES=[e.DEFAULT_ZIP_ASSET_CACHE_NAME,e.CONFIG_CACHE_NAME],e.ASSET_CACHED_AT_HEADER="X-ZipSW-Cached-At",e.ASSET_SOURCE_HEADER="X-ZipSW-Asset-Source",e.MIME_TYPES={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",json:"application/json",js:"application/javascript",css:"text/css; charset=utf-8",html:"text/html; charset=utf-8",txt:"text/plain; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",xml:"application/xml",wasm:"application/wasm"},e.LOCAL_FILE_HEADER_SIG=67324752,e.MANIFEST_CACHE_KEY="__zipsw_manifest__=1"},886(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.installFetchHandler=function(){self.addEventListener("fetch",t=>{if("GET"!==t.request.method)return;const e=(0,i.parseZipAssetRequest)(t.request.url);if(!e)return;const n=(0,i.normalizeZipUrl)(e.zipUrl),f=e.internalPath,h=(0,i.normalizeZipEntryPath)(f);t.respondWith((async()=>{if(await(0,r.ensureAllowedZipUrlsLoaded)(),!(0,r.isZipUrlAllowed)(n))return(0,o.warn)("zip URL not allowed",{requestedZipUrl:n}),(0,c.corsErrorResponse)("Zip URL not allowed",403);let e=u.zipManifests.get(n);if(e||(e=await(0,l.ensureManifestAvailable)(n)??void 0),!e){const t=Array.from(u.zipManifests.keys());return(0,o.warn)("manifest missing for zipUrl",{requestedZipUrl:n,knownZipUrls:t}),(0,c.corsErrorResponse)("Zip manifest not loaded",404)}const i=(0,l.resolveManifestEntry)(e,h);if(!i){const t=Array.from(e.keys()).slice(0,50);return(0,o.warn)("file not in manifest or ambiguous suffix match",{zipUrl:n,internalPathRaw:f,internalPathNormalized:h,manifestSize:e.size,sampleKeys:t}),(0,c.corsErrorResponse)("File not found in zip manifest",404)}const{key:p,info:d}=i;p!==h&&(0,o.log)("resolved via suffix match",{requested:h,manifestKey:p});const g=(0,s.canonicalAssetRequest)(n,p);let{blob:v,assetSource:m}=await(0,s.readCachedZipAssetIfFresh)(g);if(!v){const t=await(0,c.fetchUncompressedZipEntryFromNetwork)(n,p,d,g);if(!t.ok)return t.response;v=t.blob,m="network"}if(t.request.headers.has("range")){const e=t.request.headers.get("range").replace(/^bytes=/,"");if(e.includes(","))return new Response(null,{status:416,headers:{"Content-Range":`bytes */${v.size}`,"Access-Control-Allow-Origin":"*"}});const[n,i]=e.split("-"),r=""!==n?parseInt(n,10):NaN,s=""!==i?parseInt(i,10):v.size-1;if(isNaN(r)||isNaN(s)||r<0||s<r||r>=v.size)return new Response(null,{status:416,headers:{"Content-Range":`bytes */${v.size}`,"Access-Control-Allow-Origin":"*"}});const o=Math.min(s,v.size-1),l=v.slice(r,o+1);return new Response(l,{status:206,headers:{"Content-Type":v.type,"Content-Range":`bytes ${r}-${o}/${v.size}`,"Content-Length":l.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:m}})}return new Response(v,{status:200,headers:{"Content-Type":v.type,"Content-Length":v.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:m}})})())})};const i=n(183),r=n(978),s=n(752),a=n(778),o=n(271),l=n(234),u=n(6),c=n(878)},271(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(...t){console.log(i.runtimeConfig.logPrefix,...t)},e.warn=function(...t){console.warn(i.runtimeConfig.logPrefix,...t)};const i=n(6)},234(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.manifestCacheKey=o,e.persistManifest=l,e.loadPersistedManifest=u,e.parseCentralDirectoryToManifest=c,e.fetchZipManifest=f,e.ensureManifestAvailable=function(t){const e=a.zipManifests.get(t);if(e)return Promise.resolve(e);let n=a.pendingManifestLoads.get(t);return n||(n=(async()=>{const e=await u(t);if(e)return a.zipManifests.set(t,e),(0,s.log)("rehydrated manifest from cache",{zipUrl:t,entryCount:e.size}),e;const n=await f(t);return n&&(a.zipManifests.set(t,n),await l(t,n),(0,s.log)("manifest fetched and cached",{zipUrl:t,entryCount:n.size})),n})().finally(()=>{a.pendingManifestLoads.delete(t)}),a.pendingManifestLoads.set(t,n),n)},e.resolveManifestEntry=function(t,e){if(t.has(e))return{key:e,info:t.get(e)};const n=[];for(const i of t.keys())i.endsWith("/"+e)&&n.push(i);if(1===n.length){const e=n[0];return{key:e,info:t.get(e)}}return n.length>1?((0,s.warn)("ambiguous suffix match",{requested:e,picked:n[0],candidates:n.slice(0,8)}),null):null},e.zipUrlFromManifestCacheKey=function(t){const e=r.MANIFEST_CACHE_KEY;if(!t.endsWith(e))return null;let n=t.slice(0,-e.length);return(n.endsWith("?")||n.endsWith("&"))&&(n=n.slice(0,-1)),n};const i=n(183),r=n(778),s=n(271),a=n(6);function o(t){return t+(t.includes("?")?"&":"?")+r.MANIFEST_CACHE_KEY}async function l(t,e){try{const n=await caches.open(a.runtimeConfig.zipAssetCacheName),i=Array.from(e.values());await n.put(new Request(o(t)),new Response(JSON.stringify(i),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,s.warn)("failed to persist manifest",t)}}async function u(t){try{const e=await caches.open(a.runtimeConfig.zipAssetCacheName),n=await e.match(o(t));if(!n)return null;const r=await n.json();if(!Array.isArray(r)||0===r.length)return null;const s=new Map;for(const t of r){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e&&s.set(e,t)}return s.size>0?s:null}catch(t){return(0,s.warn)("failed to load persisted manifest",t),null}}function c(t,e,n,r){const a=new DataView(t);let o=e;const l=[];for(;o+46<=t.byteLength&&33639248===a.getUint32(o,!0);){const e=a.getUint16(o+10,!0),n=a.getUint32(o+20,!0),r=a.getUint16(o+28,!0),s=a.getUint16(o+30,!0),u=a.getUint16(o+32,!0),c=a.getUint32(o+42,!0),f=new TextDecoder;if(o+46+r>t.byteLength)break;const h=new Uint8Array(t,o+46,r),p=f.decode(h),d=(0,i.normalizeZipEntryPath)(p);""!==d&&l.push({filename:d,offset:c,compressedSize:n,compression:e}),o+=46+r+s+u}if(0===l.length)return(0,s.warn)("no files parsed from central directory",r),null;l.sort((t,e)=>t.offset-e.offset);const u=new Map;for(let t=0;t<l.length;t++){const e=l[t],r=(0,i.normalizeZipEntryPath)(e.filename);""!==r&&(u.has(r)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",r),u.set(r,{filename:e.filename,offset:e.offset,compressedSize:e.compressedSize,compression:e.compression,nextOffset:t<l.length-1?l[t+1].offset:n}))}return u.size>0?u:null}async function f(t){const e=await fetch(t,{headers:{Range:"bytes=-65536"}});if(206!==e.status)return(0,s.warn)("range requests not supported",{zipUrl:t,status:e.status}),null;const n=await e.arrayBuffer(),i=new DataView(n);let r=-1;for(let t=n.byteLength-22;t>=0;t--)if(101010256===i.getUint32(t,!0)){r=t;break}if(-1===r)return(0,s.warn)("EOCD not found in last 64KB",t),null;const a=i.getUint32(r+16,!0),o=i.getUint32(r+12,!0);let l=n,u=-1;const f=e.headers.get("Content-Range");let h=0;if(f){const t=f.match(/\/(\d+)$/);t&&(h=parseInt(t[1],10))}if(h<=0)return null;const p=h-n.byteLength;if(a>=p)u=a-p;else{const e=await fetch(t,{headers:{Range:`bytes=${a}-${a+o-1}`}});if(206!==e.status)return(0,s.warn)("failed to fetch central directory",{zipUrl:t,status:e.status}),null;l=await e.arrayBuffer(),u=0}return c(l,u,a,t)}},49(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.replyToMessage=c,e.installMessageHandler=function(){self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:n,files:f,config:h,allowedZipUrls:p}=t.data;if("ZIP_SW_CONFIG"===e){const e=(0,r.applyRuntimeConfig)(h).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));return void t.waitUntil(e)}if("ZIP_MANIFEST"===e){if(n&&f){const e=(0,i.normalizeZipUrl)(n),r=new Map;let s=!1;for(const t of f){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e?(r.has(e)&&(0,a.warn)("duplicate manifest key after normalize; overwriting",e),r.set(e,t)):s=!0}const u=l.zipManifests.get(e);if(0===r.size)return void(0,a.warn)("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:u?u.size:0,hadEmptyKey:s});if(u&&u.size>r.size)return void(0,a.warn)("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:r.size,existingSize:u.size});l.zipManifests.set(e,r),t.waitUntil((0,o.persistManifest)(e,r));const c=Array.from(r.keys()).slice(0,40);(0,a.log)("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:r.size,sampleKeys:c,replacedExistingSize:u?u.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===e&&p){const e=(0,s.clearZipAssetsExceptAllowed)(p).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}else if("CLEAR_ALL_ZIP_ASSETS"===e){const e=(0,s.clearAllZipAssets)().then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}else if("PRELOAD_ZIP_MANIFESTS"===e&&p){const e=Promise.all(p.map(t=>(0,o.ensureManifestAvailable)(t))).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}})};const i=n(183),r=n(978),s=n(752),a=n(271),o=n(234),l=n(6);function u(t){const e=t instanceof Error?t:new Error(String(t));return{ok:!1,error:e.message,errorStack:e.stack}}function c(t,e){t.ports[0]?.postMessage(e)}},6(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG_CACHE_KEY=e.allowedZipUrlsLoaded=e.allowedZipUrls=e.runtimeConfig=e.pendingManifestLoads=e.zipManifests=void 0,e.setRuntimeConfig=function(t){e.runtimeConfig=t},e.setAllowedZipUrls=function(t){e.allowedZipUrls=t},e.setAllowedZipUrlsLoaded=function(t){e.allowedZipUrlsLoaded=t};const i=n(778);e.zipManifests=new Map,e.pendingManifestLoads=new Map,e.runtimeConfig={zipAssetCacheName:i.DEFAULT_ZIP_ASSET_CACHE_NAME,assetCacheTtlMs:i.DEFAULT_ASSET_CACHE_TTL_MS,logPrefix:"[zipSW]"},e.allowedZipUrls=null,e.allowedZipUrlsLoaded=null,e.CONFIG_CACHE_KEY=new URL("__zip_peek_runtime_config__",self.registration.scope).href},878(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.corsErrorResponse=o,e.getMimeType=l,e.fetchUncompressedZipEntryFromNetwork=async function(t,e,n,u){const c=n.offset,f=n.nextOffset-1;(0,s.log)("fetching zip chunk from",{zipUrl:t,rangeStart:c,rangeEnd:f});const h=await fetch(t,{headers:{Range:`bytes=${c}-${f}`}});if(206!==h.status)return{ok:!1,response:o("The server did not return a 206 Partial Content response",h.status)};const p=await h.arrayBuffer(),d=new DataView(p);if(d.getUint32(0,!0)!==r.LOCAL_FILE_HEADER_SIG)return{ok:!1,response:o("Invalid Local File Header",500)};const g=30+d.getUint16(26,!0)+d.getUint16(28,!0);if(g>p.byteLength||g+n.compressedSize>p.byteLength)return{ok:!1,response:o(`Invalid data start or compressed size for file ${e}: dataStart=${g}, compressedSize=${n.compressedSize}, bufferLength=${p.byteLength}`,500)};const v=new Uint8Array(p,g,n.compressedSize);let m;if(8===n.compression)try{m=(0,i.inflateSync)(v)}catch(t){return(0,s.warn)("inflateSync failed",t),{ok:!1,response:o("Failed to inflate the compressed data",500)}}else{if(0!==n.compression)return{ok:!1,response:o(`Unsupported compression method: ${n.compression}`,500)};m=v}const y=l(e),w=new Blob([m],{type:y});return await(0,a.putCachedFullAssetIfAbsent)(u,w),{ok:!0,blob:w}};const i=n(845),r=n(778),s=n(271),a=n(752);function o(t,e){return new Response(t,{status:e,headers:{"Access-Control-Allow-Origin":"*"}})}function l(t){const e=t.split(".").pop()?.toLowerCase();return e?r.MIME_TYPES[e]??"application/octet-stream":"application/octet-stream"}},183(t,e){function n(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(e,"__esModule",{value:!0}),e.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},e.normalizeZipUrl=function(t,e={}){const{stripCacheBuster:n=!0,stripHash:i=!0}=e,r=t=>i?t.split("#")[0]:t;if(!n)return r(t);const s=t.indexOf("?");if(-1===s)return r(t);const a=t.indexOf("#",s),o=t.substring(0,s),l=-1===a?t.substring(s+1):t.substring(s+1,a),u=i||-1===a?"":t.substring(a),c=l.split("&").filter(t=>{const e=t.indexOf("=");return"t"!==(-1===e?t:t.substring(0,e))});return 0===c.length?o+u:o+"?"+c.join("&")+u},e.normalizeZipEntryPath=function(t){let e=t.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);return e},e.parseZipAssetRequest=function(t){const e=/\.zip([/?])/.exec(t);if(!e)return null;const i=e.index+4,r=e[1],s=t.substring(0,i);if("/"===r){const e=t.substring(i+1),r=e.indexOf("?"),a=-1===r?e:e.substring(0,r);return""===a?null:{zipUrl:s,internalPath:n(a)}}const a=t.substring(i),o=a.indexOf("/");if(-1===o)return null;const l=a.substring(0,o),u=a.substring(o+1),c=u.indexOf("?"),f=-1===c?u:u.substring(0,c);return""===f?null:{zipUrl:s+l,internalPath:n(f)}},e.canonicalZipAssetRequestUrl=function(t,e){return t+"/"+encodeURIComponent(e)}},845(t,e){var n={},i=function(t,e,i,r,s){var a=new Worker(n[e]||(n[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var i=new Error(n[0]);i.code=n[1],i.stack=n[2],s(i,null)}else s(null,e)},a.postMessage(i,r),a},r=Uint8Array,s=Uint16Array,a=Int32Array,o=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,e){for(var n=new s(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new a(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return{b:n,r}},f=c(o,2),h=f.b,p=f.r;h[28]=258,p[258]=28;for(var d=c(l,0),g=d.b,v=d.r,m=new s(32768),y=0;y<32768;++y){var w=(43690&y)>>1|(21845&y)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,m[y]=((65280&w)>>8|(255&w)<<8)>>1}var A=function(t,e,n){for(var i=t.length,r=0,a=new s(e);r<i;++r)t[r]&&++a[t[r]-1];var o,l=new s(e);for(r=1;r<e;++r)l[r]=l[r-1]+a[r-1]<<1;if(n){o=new s(1<<e);var u=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],f=e-t[r],h=l[t[r]-1]++<<f,p=h|(1<<f)-1;h<=p;++h)o[m[h]>>u]=c}else for(o=new s(i),r=0;r<i;++r)t[r]&&(o[r]=m[l[t[r]-1]++]>>15-t[r]);return o},E=new r(288);for(y=0;y<144;++y)E[y]=8;for(y=144;y<256;++y)E[y]=9;for(y=256;y<280;++y)E[y]=7;for(y=280;y<288;++y)E[y]=8;var C=new r(32);for(y=0;y<32;++y)C[y]=5;var b=A(E,9,0),z=A(E,9,1),_=A(C,5,0),S=A(C,5,1),M=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},U=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(7&e)&n},T=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},Z=function(t){return(t+7)/8|0},k=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new r(t.subarray(e,n))};e.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var L=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],x=function(t,e,n){var i=new Error(e||L[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,x),!n)throw i;return i},R=function(t,e,n,i){var s=t.length,a=i?i.length:0;if(!s||e.f&&!e.l)return n||new r(0);var c=!n,f=c||2!=e.i,p=e.i;c&&(n=new r(3*s));var d=function(t){var e=n.length;if(t>e){var i=new r(Math.max(2*e,t));i.set(n),n=i}},v=e.f||0,m=e.p||0,y=e.b||0,w=e.l,E=e.d,C=e.m,b=e.n,_=8*s;do{if(!w){v=U(t,m,1);var L=U(t,m+1,3);if(m+=3,!L){var R=t[($=Z(m)+4)-4]|t[$-3]<<8,I=$+R;if(I>s){p&&x(0);break}f&&d(y+R),n.set(t.subarray($,I),y),e.b=y+=R,e.p=m=8*I,e.f=v;continue}if(1==L)w=z,E=S,C=9,b=5;else if(2==L){var O=U(t,m,31)+257,F=U(t,m+10,15)+4,N=O+U(t,m+5,31)+1;m+=14;for(var P=new r(N),D=new r(19),H=0;H<F;++H)D[u[H]]=U(t,m+3*H,7);m+=3*F;var j=M(D),q=(1<<j)-1,G=A(D,j,1);for(H=0;H<N;){var $,W=G[U(t,m,q)];if(m+=15&W,($=W>>4)<16)P[H++]=$;else{var K=0,Y=0;for(16==$?(Y=3+U(t,m,3),m+=2,K=P[H-1]):17==$?(Y=3+U(t,m,7),m+=3):18==$&&(Y=11+U(t,m,127),m+=7);Y--;)P[H++]=K}}var B=P.subarray(0,O),V=P.subarray(O);C=M(B),b=M(V),w=A(B,C,1),E=A(V,b,1)}else x(1);if(m>_){p&&x(0);break}}f&&d(y+131072);for(var X=(1<<C)-1,J=(1<<b)-1,Q=m;;Q=m){var tt=(K=w[T(t,m)&X])>>4;if((m+=15&K)>_){p&&x(0);break}if(K||x(2),tt<256)n[y++]=tt;else{if(256==tt){Q=m,w=null;break}var et=tt-254;if(tt>264){var nt=o[H=tt-257];et=U(t,m,(1<<nt)-1)+h[H],m+=nt}var it=E[T(t,m)&J],rt=it>>4;if(it||x(3),m+=15&it,V=g[rt],rt>3&&(nt=l[rt],V+=T(t,m)&(1<<nt)-1,m+=nt),m>_){p&&x(0);break}f&&d(y+131072);var st=y+et;if(y<V){var at=a-V,ot=Math.min(V,st);for(at+y<0&&x(3);y<ot;++y)n[y]=i[at+y]}for(;y<st;++y)n[y]=n[y-V]}}e.l=w,e.p=Q,e.b=y,e.f=v,w&&(v=1,e.m=C,e.d=E,e.n=b)}while(!v);return y!=n.length&&c?k(n,0,y):n.subarray(0,y)},I=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>8},O=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>8,t[i+2]|=n>>16},F=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var a=n.length,o=n.slice();if(!a)return{t:G,l:0};if(1==a){var l=new r(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=a-1;)u=n[n[f].f<n[p].f?f++:p++],c=n[f!=h&&n[f].f<n[p].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var d=o[0].s;for(i=1;i<a;++i)o[i].s>d&&(d=o[i].s);var g=new s(d+1),v=N(n[h-1],g,0);if(v>e){i=0;var m=0,y=v-e,w=1<<y;for(o.sort(function(t,e){return g[e.s]-g[t.s]||t.f-e.f});i<a;++i){var A=o[i].s;if(!(g[A]>e))break;m+=w-(1<<v-g[A]),g[A]=e}for(m>>=y;m>0;){var E=o[i].s;g[E]<e?m-=1<<e-g[E]++-1:++i}for(;i>=0&&m;--i){var C=o[i].s;g[C]==e&&(--g[C],++m)}v=e}return{t:new r(g),l:v}},N=function(t,e,n){return-1==t.s?Math.max(N(t.l,e,n+1),N(t.r,e,n+1)):e[t.s]=n},P=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new s(++e),i=0,r=t[0],a=1,o=function(t){n[i++]=t},l=1;l<=e;++l)if(t[l]==r&&l!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=t[l]}return{c:n.subarray(0,i),n:e}},D=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},H=function(t,e,n){var i=n.length,r=Z(e+2);t[r]=255&i,t[r+1]=i>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<i;++s)t[r+s+4]=n[s];return 8*(r+4+i)},j=function(t,e,n,i,r,a,c,f,h,p,d){I(e,d++,n),++r[256];for(var g=F(r,15),v=g.t,m=g.l,y=F(a,15),w=y.t,z=y.l,S=P(v),M=S.c,U=S.n,T=P(w),Z=T.c,k=T.n,L=new s(19),x=0;x<M.length;++x)++L[31&M[x]];for(x=0;x<Z.length;++x)++L[31&Z[x]];for(var R=F(L,7),N=R.t,j=R.l,q=19;q>4&&!N[u[q-1]];--q);var G,$,W,K,Y=p+5<<3,B=D(r,E)+D(a,C)+c,V=D(r,v)+D(a,w)+c+14+3*q+D(L,N)+2*L[16]+3*L[17]+7*L[18];if(h>=0&&Y<=B&&Y<=V)return H(e,d,t.subarray(h,h+p));if(I(e,d,1+(V<B)),d+=2,V<B){G=A(v,m,0),$=v,W=A(w,z,0),K=w;var X=A(N,j,0);for(I(e,d,U-257),I(e,d+5,k-1),I(e,d+10,q-4),d+=14,x=0;x<q;++x)I(e,d+3*x,N[u[x]]);d+=3*q;for(var J=[M,Z],Q=0;Q<2;++Q){var tt=J[Q];for(x=0;x<tt.length;++x){var et=31&tt[x];I(e,d,X[et]),d+=N[et],et>15&&(I(e,d,tt[x]>>5&127),d+=tt[x]>>12)}}}else G=b,$=E,W=_,K=C;for(x=0;x<f;++x){var nt=i[x];if(nt>255){O(e,d,G[257+(et=nt>>18&31)]),d+=$[et+257],et>7&&(I(e,d,nt>>23&31),d+=o[et]);var it=31&nt;O(e,d,W[it]),d+=K[it],it>3&&(O(e,d,nt>>5&8191),d+=l[it])}else O(e,d,G[nt]),d+=$[nt]}return O(e,d,G[256]),d+$[256]},q=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),G=new r(0),$=function(t,e,n,i,u,c){var f=c.z||t.length,h=new r(i+f+5*(1+Math.ceil(f/7e3))+u),d=h.subarray(i,h.length-u),g=c.l,m=7&(c.r||0);if(e){m&&(d[0]=c.r>>3);for(var y=q[e-1],w=y>>13,A=8191&y,E=(1<<n)-1,C=c.p||new s(32768),b=c.h||new s(E+1),z=Math.ceil(n/3),_=2*z,S=function(e){return(t[e]^t[e+1]<<z^t[e+2]<<_)&E},M=new a(25e3),U=new s(288),T=new s(32),L=0,x=0,R=c.i||0,I=0,O=c.w||0,F=0;R+2<f;++R){var N=S(R),P=32767&R,D=b[N];if(C[P]=D,b[N]=P,O<=R){var G=f-R;if((L>7e3||I>24576)&&(G>423||!g)){m=j(t,d,0,M,U,T,x,I,F,R-F,m),I=L=x=0,F=R;for(var $=0;$<286;++$)U[$]=0;for($=0;$<30;++$)T[$]=0}var W=2,K=0,Y=A,B=P-D&32767;if(G>2&&N==S(R-B))for(var V=Math.min(w,G)-1,X=Math.min(32767,R),J=Math.min(258,G);B<=X&&--Y&&P!=D;){if(t[R+W]==t[R+W-B]){for(var Q=0;Q<J&&t[R+Q]==t[R+Q-B];++Q);if(Q>W){if(W=Q,K=B,Q>V)break;var tt=Math.min(B,Q-2),et=0;for($=0;$<tt;++$){var nt=R-B+$&32767,it=nt-C[nt]&32767;it>et&&(et=it,D=nt)}}}B+=(P=D)-(D=C[P])&32767}if(K){M[I++]=268435456|p[W]<<18|v[K];var rt=31&p[W],st=31&v[K];x+=o[rt]+l[st],++U[257+rt],++T[st],O=R+W,++L}else M[I++]=t[R],++U[t[R]]}}for(R=Math.max(R,O);R<f;++R)M[I++]=t[R],++U[t[R]];m=j(t,d,g,M,U,T,x,I,F,R-F,m),g||(c.r=7&m|d[m/8|0]<<3,m-=7,c.h=b,c.p=C,c.i=R,c.w=O)}else{for(R=c.w||0;R<f+g;R+=65535){var at=R+65535;at>=f&&(d[m/8|0]=g,at=f),m=H(d,m+1,t.subarray(R,at))}c.i=f}return k(h,0,i+Z(m)+u)},W=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),K=function(){var t=-1;return{p:function(e){for(var n=t,i=0;i<e.length;++i)n=W[255&n^e[i]]^n>>>8;t=n},d:function(){return~t}}},Y=function(){var t=1,e=0;return{p:function(n){for(var i=t,r=e,s=0|n.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)r+=i+=n[a];i=(65535&i)+15*(i>>16),r=(65535&r)+15*(r>>16)}t=i,e=r},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},B=function(t,e,n,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new r(a.length+t.length);o.set(a),o.set(t,a.length),t=o,s.w=a.length}return $(t,null==e.level?6:e.level,null==e.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,i,s)},V=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},X=function(t,e,n){for(var i=t(),r=t.toString(),s=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<i.length;++a){var o=i[a],l=s[a];if("function"==typeof o){e+=";"+l+"=";var u=o.toString();if(o.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var f in e+=u,o.prototype)e+=";"+l+".prototype."+f+"="+o.prototype[f].toString();else e+=u}else n[l]=o}return e},J=[],Q=function(t,e,n,r){if(!J[n]){for(var s="",a={},o=t.length-1,l=0;l<o;++l)s=X(t[l],s,a);J[n]={c:X(t[o],s,a),e:a}}var u=V({},J[n].e);return i(J[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}(u),r)},tt=function(){return[r,s,a,o,l,u,h,g,z,S,m,L,A,M,U,T,Z,k,x,R,Tt,at,ot]},et=function(){return[r,s,a,o,l,u,p,v,b,E,_,C,m,q,G,A,I,O,F,N,P,D,H,j,Z,k,$,B,_t,at]},nt=function(){return[gt,yt,dt,K,W]},it=function(){return[vt,mt]},rt=function(){return[wt,dt,Y]},st=function(){return[At]},at=function(t){return postMessage(t,[t.buffer])},ot=function(t){return t&&{out:t.size&&new r(t.size),dictionary:t.dictionary}},lt=function(t,e,n,i,r,s){var a=Q(n,i,r,function(t,e){a.terminate(),s(t,e)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},ut=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){e.data.length?(t.push(e.data[0],e.data[1]),postMessage([e.data[0].length])):t.flush()}},ct=function(t,e,n,i,r,s,a){var o,l=Q(t,i,r,function(t,n){t?(l.terminate(),e.ondata.call(e,t)):Array.isArray(n)?1==n.length?(e.queuedSize-=n[0],e.ondrain&&e.ondrain(n[0])):(n[1]&&l.terminate(),e.ondata.call(e,t,n[0],n[1])):a(n)});l.postMessage(n),e.queuedSize=0,e.push=function(t,n){e.ondata||x(5),o&&e.ondata(x(4,0,1),null,!!n),e.queuedSize+=t.length,l.postMessage([t,o=n],[t.buffer])},e.terminate=function(){l.terminate()},s&&(e.flush=function(){l.postMessage([])})},ft=function(t,e){return t[e]|t[e+1]<<8},ht=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},pt=function(t,e){return ht(t,e)+4294967296*ht(t,e+4)},dt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},gt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&dt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;i<=n.length;++i)t[i+10]=n.charCodeAt(i)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||x(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[n++]);return n+(2&e)},mt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,e){var n=e.level,i=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=i<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var r=Y();r.p(e.dictionary),dt(t,2,r.d())}},At=function(t,e){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&x(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&x(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function Et(t,e){return"function"==typeof t&&(e=t,t={}),this.ondata=e,t}var Ct=function(){function t(t,e){if("function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return t.prototype.p=function(t,e){this.ondata(B(t,this.o,0,0,this.s),e)},t.prototype.push=function(t,e){this.ondata||x(5),this.s.l&&x(4);var n=t.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var i=new r(-32768&n);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(t.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(s),32768),this.s.z=t.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=1&e,(this.s.z>this.s.w+8191||e)&&(this.p(this.b,e||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||x(5),this.s.l&&x(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();e.Deflate=Ct;var bt=function(){return function(t,e){ct([et,function(){return[ut,Ct]}],this,Et.call(this,t,e),function(t){var e=new Ct(t.data);onmessage=ut(e)},6,1)}}();function zt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et],function(t){return at(_t(t.data[0],t.data[1]))},0,n)}function _t(t,e){return B(t,e||{},0,0)}e.AsyncDeflate=bt,e.deflate=zt,e.deflateSync=_t;var St=function(){function t(t,e){"function"==typeof t&&(e=t,t={}),this.ondata=e;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new r(32768),this.p=new r(0),n&&this.o.set(n)}return t.prototype.e=function(t){if(this.ondata||x(5),this.d&&x(4),this.p.length){if(t.length){var e=new r(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length),this.p=e}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var e=this.s.b,n=R(this.p,this.s,this.o);this.ondata(k(n,e,this.s.b),this.d),this.o=k(n,this.s.b-32768),this.s.b=this.o.length,this.p=k(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}();e.Inflate=St;var Mt=function(){return function(t,e){ct([tt,function(){return[ut,St]}],this,Et.call(this,t,e),function(t){var e=new St(t.data);onmessage=ut(e)},7,0)}}();function Ut(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt],function(t){return at(Tt(t.data[0],ot(t.data[1])))},1,n)}function Tt(t,e){return R(t,{i:2},e&&e.out,e&&e.dictionary)}e.AsyncInflate=Mt,e.inflate=Ut,e.inflateSync=Tt;var Zt=function(){function t(t,e){this.c=K(),this.l=0,this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),this.l+=t.length,Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=B(t,this.o,this.v&&yt(this.o),e&&8,this.s);this.v&&(gt(n,this.o),this.v=0),e&&(dt(n,n.length-8,this.c.d()),dt(n,n.length-4,this.l)),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Gzip=Zt,e.Compress=Zt;var kt=function(){return function(t,e){ct([et,nt,function(){return[ut,Ct,Zt]}],this,Et.call(this,t,e),function(t){var e=new Zt(t.data);onmessage=ut(e)},8,1)}}();function Lt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et,nt,function(){return[xt]}],function(t){return at(xt(t.data[0],t.data[1]))},2,n)}function xt(t,e){e||(e={});var n=K(),i=t.length;n.p(t);var r=B(t,e,yt(e),8),s=r.length;return gt(r,e),dt(r,s-8,n.d()),dt(r,s-4,i),r}e.AsyncGzip=kt,e.AsyncCompress=kt,e.gzip=Lt,e.compress=Lt,e.gzipSync=xt,e.compressSync=xt;var Rt=function(){function t(t,e){this.v=1,this.r=0,St.call(this,t,e)}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),i=n.length>3?vt(n):4;if(i>n.length){if(!e)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(i),this.v=0}St.prototype.c.call(this,e),!this.s.f||this.s.l||e||(this.v=Z(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),e))},t}();e.Gunzip=Rt;var It=function(){return function(t,e){var n=this;ct([tt,it,function(){return[ut,St,Rt]}],this,Et.call(this,t,e),function(t){var e=new Rt(t.data);e.onmember=function(t){return postMessage(t)},onmessage=ut(e)},9,0,function(t){return n.onmember&&n.onmember(t)})}}();function Ot(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt,it,function(){return[Ft]}],function(t){return at(Ft(t.data[0],t.data[1]))},3,n)}function Ft(t,e){var n=vt(t);return n+8>t.length&&x(6,"invalid gzip data"),R(t.subarray(n,-8),{i:2},e&&e.out||new r(mt(t)),e&&e.dictionary)}e.AsyncGunzip=It,e.gunzip=Ot,e.gunzipSync=Ft;var Nt=function(){function t(t,e){this.c=Y(),this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=B(t,this.o,this.v&&(this.o.dictionary?6:2),e&&4,this.s);this.v&&(wt(n,this.o),this.v=0),e&&dt(n,n.length-4,this.c.d()),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Zlib=Nt;var Pt=function(){return function(t,e){ct([et,rt,function(){return[ut,Ct,Nt]}],this,Et.call(this,t,e),function(t){var e=new Nt(t.data);onmessage=ut(e)},10,1)}}();function Dt(t,e){e||(e={});var n=Y();n.p(t);var i=B(t,e,e.dictionary?6:2,4);return wt(i,e),dt(i,i.length-4,n.d()),i}e.AsyncZlib=Pt,e.zlib=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et,rt,function(){return[Dt]}],function(t){return at(Dt(t.data[0],t.data[1]))},4,n)},e.zlibSync=Dt;var Ht=function(){function t(t,e){St.call(this,t,e),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.v){if(this.p.length<6&&!e)return;this.p=this.p.subarray(At(this.p,this.v-1)),this.v=0}e&&(this.p.length<4&&x(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),St.prototype.c.call(this,e)},t}();e.Unzlib=Ht;var jt=function(){return function(t,e){ct([tt,st,function(){return[ut,St,Ht]}],this,Et.call(this,t,e),function(t){var e=new Ht(t.data);onmessage=ut(e)},11,0)}}();function qt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt,st,function(){return[Gt]}],function(t){return at(Gt(t.data[0],ot(t.data[1])))},5,n)}function Gt(t,e){return R(t.subarray(At(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}e.AsyncUnzlib=jt,e.unzlib=qt,e.unzlibSync=Gt;var $t=function(){function t(t,e){this.o=Et.call(this,t,e)||{},this.G=Rt,this.I=St,this.Z=Ht}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n){t.ondata(e,n)}},t.prototype.push=function(t,e){if(this.ondata||x(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,e),this.p=null)}},t}();e.Decompress=$t;var Wt=function(){function t(t,e){$t.call(this,t,e),this.queuedSize=0,this.G=It,this.I=Mt,this.Z=jt}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n,i){t.ondata(e,n,i)},this.s.ondrain=function(e){t.queuedSize-=e,t.ondrain&&t.ondrain(e)}},t.prototype.push=function(t,e){this.queuedSize+=t.length,$t.prototype.push.call(this,t,e)},t}();e.AsyncDecompress=Wt,e.decompress=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),31==t[0]&&139==t[1]&&8==t[2]?Ot(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ut(t,e,n):qt(t,e,n)},e.decompressSync=function(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Ft(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Tt(t,e):Gt(t,e)};var Kt=function(t,e,n,i){for(var s in t){var a=t[s],o=e+s,l=i;Array.isArray(a)&&(l=V(i,a[1]),a=a[0]),a instanceof r?n[o]=[a,l]:(n[o+="/"]=[new r(0),l],Kt(a,o,n,i))}},Yt="undefined"!=typeof TextEncoder&&new TextEncoder,Bt="undefined"!=typeof TextDecoder&&new TextDecoder,Vt=0;try{Bt.decode(G,{stream:!0}),Vt=1}catch(t){}var Xt=function(t){for(var e="",n=0;;){var i=t[n++],r=(i>127)+(i>223)+(i>239);if(n+r>t.length)return{s:e,r:k(t,n-1)};r?3==r?(i=((15&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=1&r?String.fromCharCode((31&i)<<6|63&t[n++]):String.fromCharCode((15&i)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(i)}},Jt=function(){function t(t){this.ondata=t,Vt?this.t=new TextDecoder:this.p=G}return t.prototype.push=function(t,e){if(this.ondata||x(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&x(8),this.t=null));this.p||x(4);var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var i=Xt(n),s=i.s,a=i.r;e?(a.length&&x(8),this.p=null):this.p=a,this.ondata(s,e)},t}();e.DecodeUTF8=Jt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||x(5),this.d&&x(4),this.ondata(te(t),this.d=e||!1)},t}();function te(t,e){if(e){for(var n=new r(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}if(Yt)return Yt.encode(t);var s=t.length,a=new r(t.length+(t.length>>1)),o=0,l=function(t){a[o++]=t};for(i=0;i<s;++i){if(o+5>a.length){var u=new r(o+8+(s-i<<1));u.set(a),a=u}var c=t.charCodeAt(i);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|63&c)):c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++i))>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|63&c)):(l(224|c>>12),l(128|c>>6&63),l(128|63&c))}return k(a,0,o)}function ee(t,e){if(e){for(var n="",i=0;i<t.length;i+=16384)n+=String.fromCharCode.apply(null,t.subarray(i,i+16384));return n}if(Bt)return Bt.decode(t);var r=Xt(t),s=r.s;return(n=r.r).length&&x(8),s}e.EncodeUTF8=Qt,e.strToU8=te,e.strFromU8=ee;var ne=function(t){return 1==t?3:t<6?2:9==t?1:0},ie=function(t,e){return e+30+ft(t,e+26)+ft(t,e+28)},re=function(t,e,n){var i=ft(t,e+28),r=ee(t.subarray(e+46,e+46+i),!(2048&ft(t,e+8))),s=e+46+i,a=ht(t,e+20),o=n&&4294967295==a?se(t,s):[a,ht(t,e+24),ht(t,e+42)],l=o[0],u=o[1],c=o[2];return[ft(t,e+10),l,u,r,s+ft(t,e+30)+ft(t,e+32),c]},se=function(t,e){for(;1!=ft(t,e);e+=4+ft(t,e+2));return[pt(t,e+12),pt(t,e+4),pt(t,e+20)]},ae=function(t){var e=0;if(t)for(var n in t){var i=t[n].length;i>65535&&x(9),e+=i+4}return e},oe=function(t,e,n,i,r,s,a,o){var l=i.length,u=n.extra,c=o&&o.length,f=ae(u);dt(t,e,null!=a?33639248:67324752),e+=4,null!=a&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(s<0&&8),t[e++]=r&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var h=new Date(null==n.mtime?Date.now():n.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&x(10),dt(t,e,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),e+=4,-1!=s&&(dt(t,e,n.crc),dt(t,e+4,s<0?-s-2:s),dt(t,e+8,n.size)),dt(t,e+12,l),dt(t,e+14,f),e+=16,null!=a&&(dt(t,e,c),dt(t,e+6,n.attrs),dt(t,e+10,a),e+=14),t.set(i,e),e+=l,f)for(var d in u){var g=u[d],v=g.length;dt(t,e,+d),dt(t,e+2,v),t.set(g,e+4),e+=4+v}return c&&(t.set(o,e),e+=c),e},le=function(t,e,n,i,r){dt(t,e,101010256),dt(t,e+8,n),dt(t,e+10,n),dt(t,e+12,i),dt(t,e+16,r)},ue=function(){function t(t){this.filename=t,this.c=K(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||x(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();e.ZipPassThrough=ue;var ce=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new Ct(e,function(t,e){n.ondata(null,t,e)}),this.compression=8,this.flag=ne(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.ZipDeflate=ce;var fe=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new bt(e,function(t,e,i){n.ondata(t,e,i)}),this.compression=8,this.flag=ne(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.AsyncZipDeflate=fe;var he=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||x(5),2&this.d)this.ondata(x(4+8*(1&this.d),0,1),null,!1);else{var n=te(t.filename),i=n.length,s=t.comment,a=s&&te(s),o=i!=t.filename.length||a&&s.length!=a.length,l=i+ae(t.extra)+30;i>65535&&this.ondata(x(11,0,1),null,!1);var u=new r(l);oe(u,0,t,n,o,-1);var c=[u],f=function(){for(var t=0,n=c;t<n.length;t++){var i=n[t];e.ondata(null,i,!1)}c=[]},h=this.d;this.d=0;var p=this.u.length,d=V(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(f(),h){var t=e.u[p+1];t?t.r():e.d=1}h=1}}),g=0;t.ondata=function(n,i,s){if(n)e.ondata(n,i,s),e.terminate();else if(g+=i.length,c.push(i),s){var a=new r(16);dt(a,0,134695760),dt(a,4,t.crc),dt(a,8,g),dt(a,12,t.size),c.push(a),d.c=g,d.b=l+g+16,d.crc=t.crc,d.size=t.size,h&&d.r(),h=1}else h&&f()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(x(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,i=0,s=this.u;i<s.length;i++)n+=46+(u=s[i]).f.length+ae(u.extra)+(u.o?u.o.length:0);for(var a=new r(n+22),o=0,l=this.u;o<l.length;o++){var u=l[o];oe(a,t,u,u.f,u.u,-u.c-2,e,u.o),t+=46+u.f.length+ae(u.extra)+(u.o?u.o.length:0),e+=u.b}le(a,t,this.u.length,n,e),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();e.Zip=he,e.zip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&x(7);var i={};Kt(t,"",i,e);var s=Object.keys(i),a=s.length,o=0,l=0,u=a,c=new Array(a),f=[],h=function(){for(var t=0;t<f.length;++t)f[t]()},p=function(t,e){me(function(){n(t,e)})};me(function(){p=n});var d=function(){var t=new r(l+22),e=o,n=l-o;l=0;for(var i=0;i<u;++i){var s=c[i];try{var a=s.c.length;oe(t,l,s,s.f,s.u,a);var f=30+s.f.length+ae(s.extra),h=l+f;t.set(s.c,h),oe(t,o,s,s.f,s.u,a,l,s.m),o+=16+f+(s.m?s.m.length:0),l=h+a}catch(t){return p(t,null)}}le(t,o,c.length,n,e),p(null,t)};a||d();for(var g=function(t){var e=s[t],n=i[e],r=n[0],u=n[1],g=K(),v=r.length;g.p(r);var m=te(e),y=m.length,w=u.comment,A=w&&te(w),E=A&&A.length,C=ae(u.extra),b=0==u.level?0:8,z=function(n,i){if(n)h(),p(n,null);else{var r=i.length;c[t]=V(u,{size:v,crc:g.d(),c:i,f:m,m:A,u:y!=e.length||A&&w.length!=E,compression:b}),o+=30+y+C+r,l+=76+2*(y+C)+(E||0)+r,--a||d()}};if(y>65535&&z(x(11,0,1),null),b)if(v<16e4)try{z(null,_t(r,u))}catch(t){z(t,null)}else f.push(zt(r,u,z));else z(null,r)},v=0;v<u;++v)g(v);return h},e.zipSync=function(t,e){e||(e={});var n={},i=[];Kt(t,"",n,e);var s=0,a=0;for(var o in n){var l=n[o],u=l[0],c=l[1],f=0==c.level?0:8,h=(z=te(o)).length,p=c.comment,d=p&&te(p),g=d&&d.length,v=ae(c.extra);h>65535&&x(11);var m=f?_t(u,c):u,y=m.length,w=K();w.p(u),i.push(V(c,{size:u.length,crc:w.d(),c:m,f:z,m:d,u:h!=o.length||d&&p.length!=g,o:s,compression:f})),s+=30+h+v+y,a+=76+2*(h+v)+(g||0)+y}for(var A=new r(a+22),E=s,C=a-s,b=0;b<i.length;++b){var z=i[b];oe(A,z.o,z,z.f,z.u,z.c.length);var _=30+z.f.length+ae(z.extra);A.set(z.c,z.o+_),oe(A,s,z,z.f,z.u,z.c.length,z.o,z.m),s+=16+_+(z.m?z.m.length:0)}return le(A,s,i.length,C,E),A};var pe=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();e.UnzipPassThrough=pe;var de=function(){function t(){var t=this;this.i=new St(function(e,n){t.ondata(null,e,n)})}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}();e.UnzipInflate=de;var ge=function(){function t(t,e){var n=this;e<32e4?this.i=new St(function(t,e){n.ondata(null,t,e)}):(this.i=new Mt(function(t,e,i){n.ondata(t,e,i)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=k(t,0)),this.i.push(t,e)},t.compression=8,t}();e.AsyncUnzipInflate=ge;var ve=function(){function t(t){this.onfile=t,this.k=[],this.o={0:pe},this.p=G}return t.prototype.push=function(t,e){var n=this;if(this.onfile||x(5),this.p||x(4),this.c>0){var i=Math.min(this.c,t.length),s=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(s,!this.c):this.k[0].push(s),(t=t.subarray(i)).length)return this.push(t,e)}else{var a=0,o=0,l=void 0,u=void 0;this.p.length?t.length?((u=new r(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,f=this.c,h=f&&this.d,p=function(){var t,e=ht(u,o);if(67324752==e){a=1,l=o,d.d=null,d.c=0;var i=ft(u,o+6),r=ft(u,o+8),s=2048&i,h=8&i,p=ft(u,o+26),g=ft(u,o+28);if(c>o+30+p+g){var v=[];d.k.unshift(v),a=2;var m,y=ht(u,o+18),w=ht(u,o+22),A=ee(u.subarray(o+30,o+=30+p),!s);4294967295==y?(t=h?[-2]:se(u,o),y=t[0],w=t[1]):h&&(y=-1),o+=g,d.c=y;var E={name:A,compression:r,start:function(){if(E.ondata||x(5),y){var t=n.o[r];t||E.ondata(x(14,"unknown compression type "+r,1),null,!1),(m=y<0?new t(A):new t(A,y,w)).ondata=function(t,e,n){E.ondata(t,e,n)};for(var e=0,i=v;e<i.length;e++){var s=i[e];m.push(s,!1)}n.k[0]==v&&n.c?n.d=m:m.push(G,!0)}else E.ondata(null,G,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(E.size=y,E.originalSize=w),d.onfile(E)}return"break"}if(f){if(134695760==e)return l=o+=12+(-2==f&&8),a=3,d.c=0,"break";if(33639248==e)return l=o-=4,a=3,d.c=0,"break"}},d=this;o<c-4&&"break"!==p();++o);if(this.p=G,f<0){var g=a?u.subarray(0,l-12-(-2==f&&8)-(134695760==ht(u,l-16)&&4)):u.subarray(0,o);h?h.push(g,!!a):this.k[+(2==a)].push(g)}if(2&a)return this.push(u.subarray(o),e);this.p=u.subarray(o)}e&&(this.c&&x(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();e.Unzip=ve;var me="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};e.unzip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&x(7);var i=[],s=function(){for(var t=0;t<i.length;++t)i[t]()},a={},o=function(t,e){me(function(){n(t,e)})};me(function(){o=n});for(var l=t.length-22;101010256!=ht(t,l);--l)if(!l||t.length-l>65558)return o(x(13,0,1),null),s;var u=ft(t,l+8);if(u){var c=u,f=ht(t,l+16),h=4294967295==f||65535==c;if(h){var p=ht(t,l-12);(h=101075792==ht(t,p))&&(c=u=ht(t,p+32),f=ht(t,p+48))}for(var d=e&&e.filter,g=function(e){var n=re(t,f,h),l=n[0],c=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=ie(t,m);f=v;var w=function(t,e){t?(s(),o(t,null)):(e&&(a[g]=e),--u||o(null,a))};if(!d||d({name:g,size:c,originalSize:p,compression:l}))if(l)if(8==l){var A=t.subarray(y,y+c);if(p<524288||c>.8*p)try{w(null,Tt(A,{out:new r(p)}))}catch(t){w(t,null)}else i.push(Ut(A,{size:p},w))}else w(x(14,"unknown compression type "+l,1),null);else w(null,k(t,y,y+c));else w(null,null)},v=0;v<c;++v)g()}else o(null,{});return s},e.unzipSync=function(t,e){for(var n={},i=t.length-22;101010256!=ht(t,i);--i)(!i||t.length-i>65558)&&x(13);var s=ft(t,i+8);if(!s)return{};var a=ht(t,i+16),o=4294967295==a||65535==s;if(o){var l=ht(t,i-12);(o=101075792==ht(t,l))&&(s=ht(t,l+32),a=ht(t,l+48))}for(var u=e&&e.filter,c=0;c<s;++c){var f=re(t,a,o),h=f[0],p=f[1],d=f[2],g=f[3],v=f[4],m=f[5],y=ie(t,m);a=v,u&&!u({name:g,size:p,originalSize:d,compression:h})||(h?8==h?n[g]=Tt(t.subarray(y,y+p),{out:new r(d)}):x(14,"unknown compression type "+h):n[g]=k(t,y,y+p))}return n}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}(()=>{const t=n(546),e=n(886),i=n(49);self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())}),(0,t.installClientErrorReporting)(),(0,i.installMessageHandler)(),(0,e.installFetchHandler)()})()})();
1
+ (()=>{"use strict";var t={257(t,e){function n(t){const n=t.trim();return n.startsWith(e.ZIP_PEEK_ERROR_PREFIX)?n:`${e.ZIP_PEEK_ERROR_PREFIX} ${n}`}Object.defineProperty(e,"__esModule",{value:!0}),e.ZIP_PEEK_ERROR_PREFIX=void 0,e.formatZipPeekError=n,e.createZipPeekError=function(t){return new Error(n(t))},e.toZipPeekError=function(t){const r=t instanceof Error?t:new Error(String(t));return r.message.startsWith(e.ZIP_PEEK_ERROR_PREFIX)||(r.message=n(r.message)),r},e.errorMessage=function(t){return t instanceof Error?t.message:String(t)},e.ZIP_PEEK_ERROR_PREFIX="[zip-peek-error]"},978(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.persistAllowedZipUrlsConfig=a,e.ensureAllowedZipUrlsLoaded=async function(){if(i.allowedZipUrlsLoaded)return i.allowedZipUrlsLoaded;const t=(async()=>{try{const t=await caches.open(i.CONFIG_CACHE_NAME),e=await t.match(i.CONFIG_CACHE_KEY);if(!e)return;const n=await e.json();Array.isArray(n.allowedZipUrls)?(0,i.setAllowedZipUrls)(new Set(n.allowedZipUrls.filter(t=>"string"==typeof t).map(t=>(0,r.normalizeZipUrl)(t)))):(0,i.setAllowedZipUrls)(null)}catch(t){(0,s.warn)("failed to load runtime config",t)}})();return(0,i.setAllowedZipUrlsLoaded)(t),t},e.applyRuntimeConfig=async function(t){if(!t)return;let e={...i.runtimeConfig},n=!1;if("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(e.zipAssetCacheName=t.zipAssetCacheName,n=!0),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(e.assetCacheTtlMs=t.assetCacheTtlMs,n=!0),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(e.logPrefix=t.logPrefix,n=!0),n&&(0,i.setRuntimeConfig)(e),"allowedZipUrls"in t){const e=Array.isArray(t.allowedZipUrls)?t.allowedZipUrls.map(t=>(0,r.normalizeZipUrl)(t)):null;(0,i.setAllowedZipUrls)(e?new Set(e):null),(0,i.setAllowedZipUrlsLoaded)(Promise.resolve()),await a(e)}},e.isZipUrlAllowed=function(t){return null===i.allowedZipUrls||i.allowedZipUrls.has(t)};const r=n(183),i=n(950),s=n(842);async function a(t){try{const e=await caches.open(i.CONFIG_CACHE_NAME);await e.put(new Request(i.CONFIG_CACHE_KEY),new Response(JSON.stringify({allowedZipUrls:t}),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,s.warn)("failed to persist runtime config",t)}}},752(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.canonicalAssetRequest=function(t,e){return new Request((0,i.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})},e.assetCacheEntryExpired=l,e.clearAllZipAssets=async function(){const t=await caches.open(s.runtimeConfig.zipAssetCacheName),e=await t.keys();await Promise.all(e.map(e=>t.delete(e))),await caches.delete(s.CONFIG_CACHE_NAME),s.zipManifests.clear(),s.pendingManifestLoads.clear(),(0,s.setAllowedZipUrlsLoaded)(Promise.resolve())},e.clearZipAssetsExceptAllowed=async function(t){try{const e=new Set(t),n=await caches.open(s.runtimeConfig.zipAssetCacheName),r=await n.keys();for(const t of r){const r=t.url;if(r.includes(s.MANIFEST_CACHE_KEY)){const i=(0,o.zipUrlFromManifestCacheKey)(r);i&&!e.has(i)&&await n.delete(t);continue}const a=(0,i.parseZipAssetRequest)(r);a&&!e.has(a.zipUrl)&&await n.delete(t)}for(const t of s.zipManifests.keys())e.has(t)||s.zipManifests.delete(t)}catch(t){throw(0,r.createZipPeekError)(`Failed to clear zip assets except allowed URLs: ${(0,r.errorMessage)(t)}`)}},e.putCachedFullAssetIfAbsent=async function(t,e){try{const n=await caches.open(s.runtimeConfig.zipAssetCacheName),r=await n.match(t);if(r&&!l(r))return;const i=e.type||"application/octet-stream";await n.put(t,new Response(e,{status:200,headers:{"Content-Type":i,"Content-Length":String(e.size),"Access-Control-Allow-Origin":"*",[s.ASSET_CACHED_AT_HEADER]:String(Date.now())}}))}catch(t){(0,a.warn)("asset cache put failed",t)}},e.readCachedZipAssetIfFresh=async function(t){let e=null,n="network";try{const r=await caches.open(s.runtimeConfig.zipAssetCacheName),i=await r.match(t);if(i)if(l(i))try{await r.delete(t)}catch(t){(0,a.warn)("asset cache delete expired failed",t)}else e=await i.blob(),n="cache-api"}catch(t){(0,a.warn)("asset cache read failed",t)}return{blob:e,assetSource:n}};const r=n(257),i=n(183),s=n(950),a=n(842),o=n(234);function l(t){const e=t.headers.get(s.ASSET_CACHED_AT_HEADER);if(!e)return!0;const n=parseInt(e,10);return!Number.isFinite(n)||Date.now()-n>s.runtimeConfig.assetCacheTtlMs}},886(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.installFetchHandler=function(){self.addEventListener("fetch",t=>{if("GET"!==t.request.method)return;const e=(0,i.parseZipAssetRequest)(t.request.url);if(!e)return;const n=(0,i.normalizeZipUrl)(e.zipUrl),f=e.internalPath,h=(0,i.normalizeZipEntryPath)(f);t.respondWith((async()=>{try{if(await(0,s.ensureAllowedZipUrlsLoaded)(),!(0,s.isZipUrlAllowed)(n))return(0,l.warn)("zip URL not allowed",{requestedZipUrl:n}),(0,c.corsErrorResponse)(`ZIP URL not allowed (not in allowedZipUrls): ${n}`,403);let e=o.zipManifests.get(n);if(e||(e=await(0,u.ensureManifestAvailable)(n)??void 0),!e){const t=Array.from(o.zipManifests.keys());return(0,l.warn)("manifest missing for zipUrl",{requestedZipUrl:n,knownZipUrls:t}),(0,c.corsErrorResponse)(`ZIP manifest not loaded for ${n}. Ensure the ZIP is reachable and supports byte-range requests.`,404)}const r=(0,u.resolveManifestEntry)(e,h);if(!r){const t=Array.from(e.keys()).slice(0,50);return(0,l.warn)("file not in manifest or ambiguous suffix match",{zipUrl:n,internalPathRaw:f,internalPathNormalized:h,manifestSize:e.size,sampleKeys:t}),(0,c.corsErrorResponse)(`File "${f}" not found in ZIP manifest for ${n}`,404)}const{key:i,info:p}=r;i!==h&&(0,l.log)("resolved via suffix match",{requested:h,manifestKey:i});const d=(0,a.canonicalAssetRequest)(n,i);let{blob:g,assetSource:v}=await(0,a.readCachedZipAssetIfFresh)(d);if(!g){const t=await(0,c.fetchUncompressedZipEntryFromNetwork)(n,i,p,d);if(!t.ok)return t.response;g=t.blob,v="network"}if(t.request.headers.has("range")){const e=t.request.headers.get("range").replace(/^bytes=/,"");if(e.includes(","))return new Response(null,{status:416,headers:{"Content-Range":`bytes */${g.size}`,"Access-Control-Allow-Origin":"*"}});const[n,r]=e.split("-"),i=""!==n?parseInt(n,10):NaN,s=""!==r?parseInt(r,10):g.size-1;if(isNaN(i)||isNaN(s)||i<0||s<i||i>=g.size)return new Response(null,{status:416,headers:{"Content-Range":`bytes */${g.size}`,"Access-Control-Allow-Origin":"*"}});const a=Math.min(s,g.size-1),l=g.slice(i,a+1);return new Response(l,{status:206,headers:{"Content-Type":g.type,"Content-Range":`bytes ${i}-${a}/${g.size}`,"Content-Length":l.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":o.ASSET_SOURCE_HEADER,[o.ASSET_SOURCE_HEADER]:v}})}return new Response(g,{status:200,headers:{"Content-Type":g.type,"Content-Length":g.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":o.ASSET_SOURCE_HEADER,[o.ASSET_SOURCE_HEADER]:v}})}catch(t){return(0,l.error)("fetch handler failed",{zipUrl:n,internalPath:f,message:(0,r.errorMessage)(t)}),(0,c.corsErrorResponse)(`Failed to serve "${f}" from ${n}: ${(0,r.errorMessage)(t)}`,500)}})())})};const r=n(257),i=n(183),s=n(978),a=n(752),o=n(950),l=n(842),u=n(234),c=n(878)},950(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG_CACHE_KEY=e.allowedZipUrlsLoaded=e.allowedZipUrls=e.runtimeConfig=e.pendingManifestLoads=e.zipManifests=e.MANIFEST_CACHE_KEY=e.LOCAL_FILE_HEADER_SIG=e.MIME_TYPES=e.ASSET_SOURCE_HEADER=e.ASSET_CACHED_AT_HEADER=e.ALLOWED_CACHE_NAMES=e.CONFIG_CACHE_NAME=e.DEFAULT_ASSET_CACHE_TTL_MS=e.DEFAULT_ZIP_ASSET_CACHE_NAME=void 0,e.setRuntimeConfig=function(t){e.runtimeConfig=t},e.setAllowedZipUrls=function(t){e.allowedZipUrls=t},e.setAllowedZipUrlsLoaded=function(t){e.allowedZipUrlsLoaded=t},e.DEFAULT_ZIP_ASSET_CACHE_NAME="zip-cache-v1",e.DEFAULT_ASSET_CACHE_TTL_MS=72e5,e.CONFIG_CACHE_NAME="zip-peek-config-v1",e.ALLOWED_CACHE_NAMES=[e.DEFAULT_ZIP_ASSET_CACHE_NAME,e.CONFIG_CACHE_NAME],e.ASSET_CACHED_AT_HEADER="X-ZipSW-Cached-At",e.ASSET_SOURCE_HEADER="X-ZipSW-Asset-Source",e.MIME_TYPES={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",json:"application/json",js:"application/javascript",css:"text/css; charset=utf-8",html:"text/html; charset=utf-8",txt:"text/plain; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",xml:"application/xml",wasm:"application/wasm"},e.LOCAL_FILE_HEADER_SIG=67324752,e.MANIFEST_CACHE_KEY="__zipsw_manifest__=1",e.zipManifests=new Map,e.pendingManifestLoads=new Map,e.runtimeConfig={zipAssetCacheName:e.DEFAULT_ZIP_ASSET_CACHE_NAME,assetCacheTtlMs:e.DEFAULT_ASSET_CACHE_TTL_MS,logPrefix:"[zipSW]"},e.allowedZipUrls=null,e.allowedZipUrlsLoaded=null,e.CONFIG_CACHE_KEY=new URL("__zip_peek_runtime_config__",self.registration.scope).href},842(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(...t){console.log(i.runtimeConfig.logPrefix,...t)},e.warn=function(...t){console.warn(i.runtimeConfig.logPrefix,...t)},e.error=function(...t){console.error(i.runtimeConfig.logPrefix,r.ZIP_PEEK_ERROR_PREFIX,...t)},e.reportClientError=s,e.installClientErrorReporting=function(){self.addEventListener("error",t=>{s(t.error??t.message,"Service worker uncaught error")}),self.addEventListener("unhandledrejection",t=>{s(t.reason,"Service worker unhandled promise rejection")})};const r=n(257),i=n(950);function s(t,e){const n=(0,r.toZipPeekError)(t);self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(t=>{const i={type:"ZIP_SW_ERROR",error:{message:n.message,stack:n.stack},info:e?(0,r.formatZipPeekError)(e):void 0};for(const e of t)e.postMessage(i)})}},234(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.manifestCacheKey=a,e.persistManifest=o,e.loadPersistedManifest=l,e.parseCentralDirectoryToManifest=u,e.fetchZipManifest=c,e.ensureManifestAvailable=function(t){const e=i.zipManifests.get(t);if(e)return Promise.resolve(e);let n=i.pendingManifestLoads.get(t);return n||(n=(async()=>{const e=await l(t);if(e)return i.zipManifests.set(t,e),(0,s.log)("rehydrated manifest from cache",{zipUrl:t,entryCount:e.size}),e;const n=await c(t);return n&&(i.zipManifests.set(t,n),await o(t,n),(0,s.log)("manifest fetched and cached",{zipUrl:t,entryCount:n.size})),n})().finally(()=>{i.pendingManifestLoads.delete(t)}),i.pendingManifestLoads.set(t,n),n)},e.resolveManifestEntry=function(t,e){if(t.has(e))return{key:e,info:t.get(e)};const n=[];for(const r of t.keys())r.endsWith("/"+e)&&n.push(r);if(1===n.length){const e=n[0];return{key:e,info:t.get(e)}}return n.length>1?((0,s.error)("ambiguous suffix match for ZIP entry",{requested:e,candidates:n.slice(0,8)}),null):null},e.zipUrlFromManifestCacheKey=function(t){const e=i.MANIFEST_CACHE_KEY;if(!t.endsWith(e))return null;let n=t.slice(0,-e.length);return(n.endsWith("?")||n.endsWith("&"))&&(n=n.slice(0,-1)),n};const r=n(183),i=n(950),s=n(842);function a(t){return t+(t.includes("?")?"&":"?")+i.MANIFEST_CACHE_KEY}async function o(t,e){try{const n=await caches.open(i.runtimeConfig.zipAssetCacheName),r=Array.from(e.values());await n.put(new Request(a(t)),new Response(JSON.stringify(r),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,s.warn)("failed to persist manifest",t)}}async function l(t){try{const e=await caches.open(i.runtimeConfig.zipAssetCacheName),n=await e.match(a(t));if(!n)return null;const s=await n.json();if(!Array.isArray(s)||0===s.length)return null;const o=new Map;for(const t of s){const e=(0,r.normalizeZipEntryPath)(t.filename);""!==e&&o.set(e,t)}return o.size>0?o:null}catch(t){return(0,s.warn)("failed to load persisted manifest",t),null}}function u(t,e,n,i){const a=new DataView(t);let o=e;const l=[];for(;o+46<=t.byteLength&&33639248===a.getUint32(o,!0);){const e=a.getUint16(o+10,!0),n=a.getUint32(o+20,!0),i=a.getUint16(o+28,!0),s=a.getUint16(o+30,!0),u=a.getUint16(o+32,!0),c=a.getUint32(o+42,!0),f=new TextDecoder;if(o+46+i>t.byteLength)break;const h=new Uint8Array(t,o+46,i),p=f.decode(h),d=(0,r.normalizeZipEntryPath)(p);""!==d&&l.push({filename:d,offset:c,compressedSize:n,compression:e}),o+=46+i+s+u}if(0===l.length)return(0,s.error)("no files parsed from central directory",i),null;l.sort((t,e)=>t.offset-e.offset);const u=new Map;for(let t=0;t<l.length;t++){const e=l[t],i=(0,r.normalizeZipEntryPath)(e.filename);""!==i&&(u.has(i)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",i),u.set(i,{filename:e.filename,offset:e.offset,compressedSize:e.compressedSize,compression:e.compression,nextOffset:t<l.length-1?l[t+1].offset:n}))}return u.size>0?u:null}async function c(t){const e=await fetch(t,{headers:{Range:"bytes=-65536"}});if(206!==e.status)return(0,s.error)("range requests not supported for ZIP manifest",{zipUrl:t,status:e.status}),null;const n=await e.arrayBuffer(),r=new DataView(n);let i=-1;for(let t=n.byteLength-22;t>=0;t--)if(101010256===r.getUint32(t,!0)){i=t;break}if(-1===i)return(0,s.error)("EOCD not found in last 64KB of ZIP file",t),null;const a=r.getUint32(i+16,!0),o=r.getUint32(i+12,!0);let l=n,c=-1;const f=e.headers.get("Content-Range");let h=0;if(f){const t=f.match(/\/(\d+)$/);t&&(h=parseInt(t[1],10))}if(h<=0)return(0,s.error)("could not determine ZIP file size from Content-Range header",{zipUrl:t,contentRange:f}),null;const p=h-n.byteLength;if(a>=p)c=a-p;else{const e=await fetch(t,{headers:{Range:`bytes=${a}-${a+o-1}`}});if(206!==e.status)return(0,s.error)("failed to fetch ZIP central directory",{zipUrl:t,status:e.status,cdOffset:a,cdSize:o}),null;l=await e.arrayBuffer(),c=0}return u(l,c,a,t)}},49(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.replyToMessage=f,e.installMessageHandler=function(){self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:n,files:h,config:p,allowedZipUrls:d}=t.data;if("ZIP_SW_CONFIG"===e){const e=(0,s.applyRuntimeConfig)(p).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));return void t.waitUntil(e)}if("ZIP_MANIFEST"===e){if(n&&h){const e=(0,i.normalizeZipUrl)(n),r=new Map;let s=!1;for(const t of h){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e?(r.has(e)&&(0,l.warn)("duplicate manifest key after normalize; overwriting",e),r.set(e,t)):s=!0}const a=o.zipManifests.get(e);if(0===r.size)return void(0,l.warn)("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:a?a.size:0,hadEmptyKey:s});if(a&&a.size>r.size)return void(0,l.warn)("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:r.size,existingSize:a.size});o.zipManifests.set(e,r),t.waitUntil((0,u.persistManifest)(e,r));const c=Array.from(r.keys()).slice(0,40);(0,l.log)("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:r.size,sampleKeys:c,replacedExistingSize:a?a.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===e&&d){const e=(0,a.clearZipAssetsExceptAllowed)(d).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}else if("CLEAR_ALL_ZIP_ASSETS"===e){const e=(0,a.clearAllZipAssets)().then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}else if("PRELOAD_ZIP_MANIFESTS"===e&&d){const e=async function(t){const e=await Promise.all(t.map(async t=>({zipUrl:t,manifest:await(0,u.ensureManifestAvailable)(t)}))),n=e.filter(t=>!t.manifest).map(t=>t.zipUrl);if(n.length>0)throw(0,r.createZipPeekError)(`Failed to preload ZIP manifest(s): ${n.join(", ")}`)}(d).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}})};const r=n(257),i=n(183),s=n(978),a=n(752),o=n(950),l=n(842),u=n(234);function c(t){const e=(0,r.toZipPeekError)(t);return{ok:!1,error:e.message,errorStack:e.stack}}function f(t,e){t.ports[0]?.postMessage(e)}},878(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.corsErrorResponse=l,e.getMimeType=u,e.fetchUncompressedZipEntryFromNetwork=async function(t,e,n,i){const c=n.offset,f=n.nextOffset-1;(0,a.log)("fetching zip chunk from",{zipUrl:t,rangeStart:c,rangeEnd:f});const h=await fetch(t,{headers:{Range:`bytes=${c}-${f}`}});if(206!==h.status)return{ok:!1,response:l(`ZIP entry fetch for "${e}" expected HTTP 206 Partial Content from ${t}, got ${h.status}`,h.status>=400?h.status:502)};const p=await h.arrayBuffer(),d=new DataView(p);if(d.getUint32(0,!0)!==s.LOCAL_FILE_HEADER_SIG)return{ok:!1,response:l(`Invalid local file header for "${e}" in ${t} (expected ZIP signature 0x04034b50)`,500)};const g=30+d.getUint16(26,!0)+d.getUint16(28,!0);if(g>p.byteLength||g+n.compressedSize>p.byteLength)return{ok:!1,response:l(`Corrupt ZIP entry "${e}" in ${t}: dataStart=${g}, compressedSize=${n.compressedSize}, bufferLength=${p.byteLength}`,500)};const v=new Uint8Array(p,g,n.compressedSize);let m;if(8===n.compression)try{m=(0,r.inflateSync)(v)}catch(n){return(0,a.warn)("inflateSync failed",{zipUrl:t,manifestKey:e,error:n}),{ok:!1,response:l(`Failed to inflate DEFLATE-compressed entry "${e}" in ${t}`,500)}}else{if(0!==n.compression)return{ok:!1,response:l(`Unsupported compression method ${n.compression} for "${e}" in ${t} (only stored/0 and DEFLATE/8 are supported)`,500)};m=v}const y=u(e),w=new Blob([m],{type:y});return await(0,o.putCachedFullAssetIfAbsent)(i,w),{ok:!0,blob:w}};const r=n(845),i=n(257),s=n(950),a=n(842),o=n(752);function l(t,e){return new Response((0,i.formatZipPeekError)(t),{status:e,headers:{"Access-Control-Allow-Origin":"*"}})}function u(t){const e=t.split(".").pop()?.toLowerCase();return e?s.MIME_TYPES[e]??"application/octet-stream":"application/octet-stream"}},183(t,e){function n(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(e,"__esModule",{value:!0}),e.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},e.normalizeZipUrl=function(t,e={}){const{stripCacheBuster:n=!0,stripHash:r=!0}=e,i=t=>r?t.split("#")[0]:t;if(!n)return i(t);const s=t.indexOf("?");if(-1===s)return i(t);const a=t.indexOf("#",s),o=t.substring(0,s),l=-1===a?t.substring(s+1):t.substring(s+1,a),u=r||-1===a?"":t.substring(a),c=l.split("&").filter(t=>{const e=t.indexOf("=");return"t"!==(-1===e?t:t.substring(0,e))});return 0===c.length?o+u:o+"?"+c.join("&")+u},e.normalizeZipEntryPath=function(t){let e=t.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);return e},e.parseZipAssetRequest=function(t){const e=/\.zip([/?])/.exec(t);if(!e)return null;const r=e.index+4,i=e[1],s=t.substring(0,r);if("/"===i){const e=t.substring(r+1),i=e.indexOf("?"),a=-1===i?e:e.substring(0,i);return""===a?null:{zipUrl:s,internalPath:n(a)}}const a=t.substring(r),o=a.indexOf("/");if(-1===o)return null;const l=a.substring(0,o),u=a.substring(o+1),c=u.indexOf("?"),f=-1===c?u:u.substring(0,c);return""===f?null:{zipUrl:s+l,internalPath:n(f)}},e.canonicalZipAssetRequestUrl=function(t,e){return t+"/"+encodeURIComponent(e)}},845(t,e){var n={},r=function(t,e,r,i,s){var a=new Worker(n[e]||(n[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],s(r,null)}else s(null,e)},a.postMessage(r,i),a},i=Uint8Array,s=Uint16Array,a=Int32Array,o=new i([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new i([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new i([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,e){for(var n=new s(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new a(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},f=c(o,2),h=f.b,p=f.r;h[28]=258,p[258]=28;for(var d=c(l,0),g=d.b,v=d.r,m=new s(32768),y=0;y<32768;++y){var w=(43690&y)>>1|(21845&y)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,m[y]=((65280&w)>>8|(255&w)<<8)>>1}var E=function(t,e,n){for(var r=t.length,i=0,a=new s(e);i<r;++i)t[i]&&++a[t[i]-1];var o,l=new s(e);for(i=1;i<e;++i)l[i]=l[i-1]+a[i-1]<<1;if(n){o=new s(1<<e);var u=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],f=e-t[i],h=l[t[i]-1]++<<f,p=h|(1<<f)-1;h<=p;++h)o[m[h]>>u]=c}else for(o=new s(r),i=0;i<r;++i)t[i]&&(o[i]=m[l[t[i]-1]++]>>15-t[i]);return o},A=new i(288);for(y=0;y<144;++y)A[y]=8;for(y=144;y<256;++y)A[y]=9;for(y=256;y<280;++y)A[y]=7;for(y=280;y<288;++y)A[y]=8;var C=new i(32);for(y=0;y<32;++y)C[y]=5;var b=E(A,9,0),z=E(A,9,1),_=E(C,5,0),S=E(C,5,1),U=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},M=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},Z=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},R=function(t){return(t+7)/8|0},P=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new i(t.subarray(e,n))};e.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var I=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],k=function(t,e,n){var r=new Error(e||I[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,k),!n)throw r;return r},T=function(t,e,n,r){var s=t.length,a=r?r.length:0;if(!s||e.f&&!e.l)return n||new i(0);var c=!n,f=c||2!=e.i,p=e.i;c&&(n=new i(3*s));var d=function(t){var e=n.length;if(t>e){var r=new i(Math.max(2*e,t));r.set(n),n=r}},v=e.f||0,m=e.p||0,y=e.b||0,w=e.l,A=e.d,C=e.m,b=e.n,_=8*s;do{if(!w){v=M(t,m,1);var I=M(t,m+1,3);if(m+=3,!I){var T=t[(K=R(m)+4)-4]|t[K-3]<<8,L=K+T;if(L>s){p&&k(0);break}f&&d(y+T),n.set(t.subarray(K,L),y),e.b=y+=T,e.p=m=8*L,e.f=v;continue}if(1==I)w=z,A=S,C=9,b=5;else if(2==I){var x=M(t,m,31)+257,O=M(t,m+10,15)+4,F=x+M(t,m+5,31)+1;m+=14;for(var N=new i(F),D=new i(19),H=0;H<O;++H)D[u[H]]=M(t,m+3*H,7);m+=3*O;var $=U(D),j=(1<<$)-1,q=E(D,$,1);for(H=0;H<F;){var K,G=q[M(t,m,j)];if(m+=15&G,(K=G>>4)<16)N[H++]=K;else{var W=0,Y=0;for(16==K?(Y=3+M(t,m,3),m+=2,W=N[H-1]):17==K?(Y=3+M(t,m,7),m+=3):18==K&&(Y=11+M(t,m,127),m+=7);Y--;)N[H++]=W}}var X=N.subarray(0,x),B=N.subarray(x);C=U(X),b=U(B),w=E(X,C,1),A=E(B,b,1)}else k(1);if(m>_){p&&k(0);break}}f&&d(y+131072);for(var V=(1<<C)-1,J=(1<<b)-1,Q=m;;Q=m){var tt=(W=w[Z(t,m)&V])>>4;if((m+=15&W)>_){p&&k(0);break}if(W||k(2),tt<256)n[y++]=tt;else{if(256==tt){Q=m,w=null;break}var et=tt-254;if(tt>264){var nt=o[H=tt-257];et=M(t,m,(1<<nt)-1)+h[H],m+=nt}var rt=A[Z(t,m)&J],it=rt>>4;if(rt||k(3),m+=15&rt,B=g[it],it>3&&(nt=l[it],B+=Z(t,m)&(1<<nt)-1,m+=nt),m>_){p&&k(0);break}f&&d(y+131072);var st=y+et;if(y<B){var at=a-B,ot=Math.min(B,st);for(at+y<0&&k(3);y<ot;++y)n[y]=r[at+y]}for(;y<st;++y)n[y]=n[y-B]}}e.l=w,e.p=Q,e.b=y,e.f=v,w&&(v=1,e.m=C,e.d=A,e.n=b)}while(!v);return y!=n.length&&c?P(n,0,y):n.subarray(0,y)},L=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},x=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},O=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var a=n.length,o=n.slice();if(!a)return{t:q,l:0};if(1==a){var l=new i(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=a-1;)u=n[n[f].f<n[p].f?f++:p++],c=n[f!=h&&n[f].f<n[p].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var d=o[0].s;for(r=1;r<a;++r)o[r].s>d&&(d=o[r].s);var g=new s(d+1),v=F(n[h-1],g,0);if(v>e){r=0;var m=0,y=v-e,w=1<<y;for(o.sort(function(t,e){return g[e.s]-g[t.s]||t.f-e.f});r<a;++r){var E=o[r].s;if(!(g[E]>e))break;m+=w-(1<<v-g[E]),g[E]=e}for(m>>=y;m>0;){var A=o[r].s;g[A]<e?m-=1<<e-g[A]++-1:++r}for(;r>=0&&m;--r){var C=o[r].s;g[C]==e&&(--g[C],++m)}v=e}return{t:new i(g),l:v}},F=function(t,e,n){return-1==t.s?Math.max(F(t.l,e,n+1),F(t.r,e,n+1)):e[t.s]=n},N=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new s(++e),r=0,i=t[0],a=1,o=function(t){n[r++]=t},l=1;l<=e;++l)if(t[l]==i&&l!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[l]}return{c:n.subarray(0,r),n:e}},D=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},H=function(t,e,n){var r=n.length,i=R(e+2);t[i]=255&r,t[i+1]=r>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<r;++s)t[i+s+4]=n[s];return 8*(i+4+r)},$=function(t,e,n,r,i,a,c,f,h,p,d){L(e,d++,n),++i[256];for(var g=O(i,15),v=g.t,m=g.l,y=O(a,15),w=y.t,z=y.l,S=N(v),U=S.c,M=S.n,Z=N(w),R=Z.c,P=Z.n,I=new s(19),k=0;k<U.length;++k)++I[31&U[k]];for(k=0;k<R.length;++k)++I[31&R[k]];for(var T=O(I,7),F=T.t,$=T.l,j=19;j>4&&!F[u[j-1]];--j);var q,K,G,W,Y=p+5<<3,X=D(i,A)+D(a,C)+c,B=D(i,v)+D(a,w)+c+14+3*j+D(I,F)+2*I[16]+3*I[17]+7*I[18];if(h>=0&&Y<=X&&Y<=B)return H(e,d,t.subarray(h,h+p));if(L(e,d,1+(B<X)),d+=2,B<X){q=E(v,m,0),K=v,G=E(w,z,0),W=w;var V=E(F,$,0);for(L(e,d,M-257),L(e,d+5,P-1),L(e,d+10,j-4),d+=14,k=0;k<j;++k)L(e,d+3*k,F[u[k]]);d+=3*j;for(var J=[U,R],Q=0;Q<2;++Q){var tt=J[Q];for(k=0;k<tt.length;++k){var et=31&tt[k];L(e,d,V[et]),d+=F[et],et>15&&(L(e,d,tt[k]>>5&127),d+=tt[k]>>12)}}}else q=b,K=A,G=_,W=C;for(k=0;k<f;++k){var nt=r[k];if(nt>255){x(e,d,q[257+(et=nt>>18&31)]),d+=K[et+257],et>7&&(L(e,d,nt>>23&31),d+=o[et]);var rt=31&nt;x(e,d,G[rt]),d+=W[rt],rt>3&&(x(e,d,nt>>5&8191),d+=l[rt])}else x(e,d,q[nt]),d+=K[nt]}return x(e,d,q[256]),d+K[256]},j=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),q=new i(0),K=function(t,e,n,r,u,c){var f=c.z||t.length,h=new i(r+f+5*(1+Math.ceil(f/7e3))+u),d=h.subarray(r,h.length-u),g=c.l,m=7&(c.r||0);if(e){m&&(d[0]=c.r>>3);for(var y=j[e-1],w=y>>13,E=8191&y,A=(1<<n)-1,C=c.p||new s(32768),b=c.h||new s(A+1),z=Math.ceil(n/3),_=2*z,S=function(e){return(t[e]^t[e+1]<<z^t[e+2]<<_)&A},U=new a(25e3),M=new s(288),Z=new s(32),I=0,k=0,T=c.i||0,L=0,x=c.w||0,O=0;T+2<f;++T){var F=S(T),N=32767&T,D=b[F];if(C[N]=D,b[F]=N,x<=T){var q=f-T;if((I>7e3||L>24576)&&(q>423||!g)){m=$(t,d,0,U,M,Z,k,L,O,T-O,m),L=I=k=0,O=T;for(var K=0;K<286;++K)M[K]=0;for(K=0;K<30;++K)Z[K]=0}var G=2,W=0,Y=E,X=N-D&32767;if(q>2&&F==S(T-X))for(var B=Math.min(w,q)-1,V=Math.min(32767,T),J=Math.min(258,q);X<=V&&--Y&&N!=D;){if(t[T+G]==t[T+G-X]){for(var Q=0;Q<J&&t[T+Q]==t[T+Q-X];++Q);if(Q>G){if(G=Q,W=X,Q>B)break;var tt=Math.min(X,Q-2),et=0;for(K=0;K<tt;++K){var nt=T-X+K&32767,rt=nt-C[nt]&32767;rt>et&&(et=rt,D=nt)}}}X+=(N=D)-(D=C[N])&32767}if(W){U[L++]=268435456|p[G]<<18|v[W];var it=31&p[G],st=31&v[W];k+=o[it]+l[st],++M[257+it],++Z[st],x=T+G,++I}else U[L++]=t[T],++M[t[T]]}}for(T=Math.max(T,x);T<f;++T)U[L++]=t[T],++M[t[T]];m=$(t,d,g,U,M,Z,k,L,O,T-O,m),g||(c.r=7&m|d[m/8|0]<<3,m-=7,c.h=b,c.p=C,c.i=T,c.w=x)}else{for(T=c.w||0;T<f+g;T+=65535){var at=T+65535;at>=f&&(d[m/8|0]=g,at=f),m=H(d,m+1,t.subarray(T,at))}c.i=f}return P(h,0,r+R(m)+u)},G=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),W=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=G[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},Y=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,s=0|n.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=r+=n[a];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},X=function(t,e,n,r,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new i(a.length+t.length);o.set(a),o.set(t,a.length),t=o,s.w=a.length}return K(t,null==e.level?6:e.level,null==e.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,r,s)},B=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},V=function(t,e,n){for(var r=t(),i=t.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<r.length;++a){var o=r[a],l=s[a];if("function"==typeof o){e+=";"+l+"=";var u=o.toString();if(o.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var f in e+=u,o.prototype)e+=";"+l+".prototype."+f+"="+o.prototype[f].toString();else e+=u}else n[l]=o}return e},J=[],Q=function(t,e,n,i){if(!J[n]){for(var s="",a={},o=t.length-1,l=0;l<o;++l)s=V(t[l],s,a);J[n]={c:V(t[o],s,a),e:a}}var u=B({},J[n].e);return r(J[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}(u),i)},tt=function(){return[i,s,a,o,l,u,h,g,z,S,m,I,E,U,M,Z,R,P,k,T,Zt,at,ot]},et=function(){return[i,s,a,o,l,u,p,v,b,A,_,C,m,j,q,E,L,x,O,F,N,D,H,$,R,P,K,X,_t,at]},nt=function(){return[gt,yt,dt,W,G]},rt=function(){return[vt,mt]},it=function(){return[wt,dt,Y]},st=function(){return[Et]},at=function(t){return postMessage(t,[t.buffer])},ot=function(t){return t&&{out:t.size&&new i(t.size),dictionary:t.dictionary}},lt=function(t,e,n,r,i,s){var a=Q(n,r,i,function(t,e){a.terminate(),s(t,e)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},ut=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){e.data.length?(t.push(e.data[0],e.data[1]),postMessage([e.data[0].length])):t.flush()}},ct=function(t,e,n,r,i,s,a){var o,l=Q(t,r,i,function(t,n){t?(l.terminate(),e.ondata.call(e,t)):Array.isArray(n)?1==n.length?(e.queuedSize-=n[0],e.ondrain&&e.ondrain(n[0])):(n[1]&&l.terminate(),e.ondata.call(e,t,n[0],n[1])):a(n)});l.postMessage(n),e.queuedSize=0,e.push=function(t,n){e.ondata||k(5),o&&e.ondata(k(4,0,1),null,!!n),e.queuedSize+=t.length,l.postMessage([t,o=n],[t.buffer])},e.terminate=function(){l.terminate()},s&&(e.flush=function(){l.postMessage([])})},ft=function(t,e){return t[e]|t[e+1]<<8},ht=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},pt=function(t,e){return ht(t,e)+4294967296*ht(t,e+4)},dt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},gt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&dt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||k(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},mt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=Y();i.p(e.dictionary),dt(t,2,i.d())}},Et=function(t,e){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&k(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&k(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function At(t,e){return"function"==typeof t&&(e=t,t={}),this.ondata=e,t}var Ct=function(){function t(t,e){if("function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new i(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return t.prototype.p=function(t,e){this.ondata(X(t,this.o,0,0,this.s),e)},t.prototype.push=function(t,e){this.ondata||k(5),this.s.l&&k(4);var n=t.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var r=new i(-32768&n);r.set(this.b.subarray(0,this.s.z)),this.b=r}var s=this.b.length-this.s.z;this.b.set(t.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(s),32768),this.s.z=t.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=1&e,(this.s.z>this.s.w+8191||e)&&(this.p(this.b,e||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||k(5),this.s.l&&k(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();e.Deflate=Ct;var bt=function(){return function(t,e){ct([et,function(){return[ut,Ct]}],this,At.call(this,t,e),function(t){var e=new Ct(t.data);onmessage=ut(e)},6,1)}}();function zt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&k(7),lt(t,e,[et],function(t){return at(_t(t.data[0],t.data[1]))},0,n)}function _t(t,e){return X(t,e||{},0,0)}e.AsyncDeflate=bt,e.deflate=zt,e.deflateSync=_t;var St=function(){function t(t,e){"function"==typeof t&&(e=t,t={}),this.ondata=e;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new i(32768),this.p=new i(0),n&&this.o.set(n)}return t.prototype.e=function(t){if(this.ondata||k(5),this.d&&k(4),this.p.length){if(t.length){var e=new i(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length),this.p=e}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var e=this.s.b,n=T(this.p,this.s,this.o);this.ondata(P(n,e,this.s.b),this.d),this.o=P(n,this.s.b-32768),this.s.b=this.o.length,this.p=P(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}();e.Inflate=St;var Ut=function(){return function(t,e){ct([tt,function(){return[ut,St]}],this,At.call(this,t,e),function(t){var e=new St(t.data);onmessage=ut(e)},7,0)}}();function Mt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&k(7),lt(t,e,[tt],function(t){return at(Zt(t.data[0],ot(t.data[1])))},1,n)}function Zt(t,e){return T(t,{i:2},e&&e.out,e&&e.dictionary)}e.AsyncInflate=Ut,e.inflate=Mt,e.inflateSync=Zt;var Rt=function(){function t(t,e){this.c=W(),this.l=0,this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),this.l+=t.length,Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=X(t,this.o,this.v&&yt(this.o),e&&8,this.s);this.v&&(gt(n,this.o),this.v=0),e&&(dt(n,n.length-8,this.c.d()),dt(n,n.length-4,this.l)),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Gzip=Rt,e.Compress=Rt;var Pt=function(){return function(t,e){ct([et,nt,function(){return[ut,Ct,Rt]}],this,At.call(this,t,e),function(t){var e=new Rt(t.data);onmessage=ut(e)},8,1)}}();function It(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&k(7),lt(t,e,[et,nt,function(){return[kt]}],function(t){return at(kt(t.data[0],t.data[1]))},2,n)}function kt(t,e){e||(e={});var n=W(),r=t.length;n.p(t);var i=X(t,e,yt(e),8),s=i.length;return gt(i,e),dt(i,s-8,n.d()),dt(i,s-4,r),i}e.AsyncGzip=Pt,e.AsyncCompress=Pt,e.gzip=It,e.compress=It,e.gzipSync=kt,e.compressSync=kt;var Tt=function(){function t(t,e){this.v=1,this.r=0,St.call(this,t,e)}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),r=n.length>3?vt(n):4;if(r>n.length){if(!e)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(r),this.v=0}St.prototype.c.call(this,e),!this.s.f||this.s.l||e||(this.v=R(this.s.p)+9,this.s={i:0},this.o=new i(0),this.push(new i(0),e))},t}();e.Gunzip=Tt;var Lt=function(){return function(t,e){var n=this;ct([tt,rt,function(){return[ut,St,Tt]}],this,At.call(this,t,e),function(t){var e=new Tt(t.data);e.onmember=function(t){return postMessage(t)},onmessage=ut(e)},9,0,function(t){return n.onmember&&n.onmember(t)})}}();function xt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&k(7),lt(t,e,[tt,rt,function(){return[Ot]}],function(t){return at(Ot(t.data[0],t.data[1]))},3,n)}function Ot(t,e){var n=vt(t);return n+8>t.length&&k(6,"invalid gzip data"),T(t.subarray(n,-8),{i:2},e&&e.out||new i(mt(t)),e&&e.dictionary)}e.AsyncGunzip=Lt,e.gunzip=xt,e.gunzipSync=Ot;var Ft=function(){function t(t,e){this.c=Y(),this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=X(t,this.o,this.v&&(this.o.dictionary?6:2),e&&4,this.s);this.v&&(wt(n,this.o),this.v=0),e&&dt(n,n.length-4,this.c.d()),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Zlib=Ft;var Nt=function(){return function(t,e){ct([et,it,function(){return[ut,Ct,Ft]}],this,At.call(this,t,e),function(t){var e=new Ft(t.data);onmessage=ut(e)},10,1)}}();function Dt(t,e){e||(e={});var n=Y();n.p(t);var r=X(t,e,e.dictionary?6:2,4);return wt(r,e),dt(r,r.length-4,n.d()),r}e.AsyncZlib=Nt,e.zlib=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&k(7),lt(t,e,[et,it,function(){return[Dt]}],function(t){return at(Dt(t.data[0],t.data[1]))},4,n)},e.zlibSync=Dt;var Ht=function(){function t(t,e){St.call(this,t,e),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.v){if(this.p.length<6&&!e)return;this.p=this.p.subarray(Et(this.p,this.v-1)),this.v=0}e&&(this.p.length<4&&k(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),St.prototype.c.call(this,e)},t}();e.Unzlib=Ht;var $t=function(){return function(t,e){ct([tt,st,function(){return[ut,St,Ht]}],this,At.call(this,t,e),function(t){var e=new Ht(t.data);onmessage=ut(e)},11,0)}}();function jt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&k(7),lt(t,e,[tt,st,function(){return[qt]}],function(t){return at(qt(t.data[0],ot(t.data[1])))},5,n)}function qt(t,e){return T(t.subarray(Et(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}e.AsyncUnzlib=$t,e.unzlib=jt,e.unzlibSync=qt;var Kt=function(){function t(t,e){this.o=At.call(this,t,e)||{},this.G=Tt,this.I=St,this.Z=Ht}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n){t.ondata(e,n)}},t.prototype.push=function(t,e){if(this.ondata||k(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new i(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,e),this.p=null)}},t}();e.Decompress=Kt;var Gt=function(){function t(t,e){Kt.call(this,t,e),this.queuedSize=0,this.G=Lt,this.I=Ut,this.Z=$t}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n,r){t.ondata(e,n,r)},this.s.ondrain=function(e){t.queuedSize-=e,t.ondrain&&t.ondrain(e)}},t.prototype.push=function(t,e){this.queuedSize+=t.length,Kt.prototype.push.call(this,t,e)},t}();e.AsyncDecompress=Gt,e.decompress=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&k(7),31==t[0]&&139==t[1]&&8==t[2]?xt(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Mt(t,e,n):jt(t,e,n)},e.decompressSync=function(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Ot(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Zt(t,e):qt(t,e)};var Wt=function(t,e,n,r){for(var s in t){var a=t[s],o=e+s,l=r;Array.isArray(a)&&(l=B(r,a[1]),a=a[0]),a instanceof i?n[o]=[a,l]:(n[o+="/"]=[new i(0),l],Wt(a,o,n,r))}},Yt="undefined"!=typeof TextEncoder&&new TextEncoder,Xt="undefined"!=typeof TextDecoder&&new TextDecoder,Bt=0;try{Xt.decode(q,{stream:!0}),Bt=1}catch(t){}var Vt=function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return{s:e,r:P(t,n-1)};i?3==i?(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&i?String.fromCharCode((31&r)<<6|63&t[n++]):String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}},Jt=function(){function t(t){this.ondata=t,Bt?this.t=new TextDecoder:this.p=q}return t.prototype.push=function(t,e){if(this.ondata||k(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&k(8),this.t=null));this.p||k(4);var n=new i(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=Vt(n),s=r.s,a=r.r;e?(a.length&&k(8),this.p=null):this.p=a,this.ondata(s,e)},t}();e.DecodeUTF8=Jt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||k(5),this.d&&k(4),this.ondata(te(t),this.d=e||!1)},t}();function te(t,e){if(e){for(var n=new i(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Yt)return Yt.encode(t);var s=t.length,a=new i(t.length+(t.length>>1)),o=0,l=function(t){a[o++]=t};for(r=0;r<s;++r){if(o+5>a.length){var u=new i(o+8+(s-r<<1));u.set(a),a=u}var c=t.charCodeAt(r);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|63&c)):c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++r))>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|63&c)):(l(224|c>>12),l(128|c>>6&63),l(128|63&c))}return P(a,0,o)}function ee(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(Xt)return Xt.decode(t);var i=Vt(t),s=i.s;return(n=i.r).length&&k(8),s}e.EncodeUTF8=Qt,e.strToU8=te,e.strFromU8=ee;var ne=function(t){return 1==t?3:t<6?2:9==t?1:0},re=function(t,e){return e+30+ft(t,e+26)+ft(t,e+28)},ie=function(t,e,n){var r=ft(t,e+28),i=ee(t.subarray(e+46,e+46+r),!(2048&ft(t,e+8))),s=e+46+r,a=ht(t,e+20),o=n&&4294967295==a?se(t,s):[a,ht(t,e+24),ht(t,e+42)],l=o[0],u=o[1],c=o[2];return[ft(t,e+10),l,u,i,s+ft(t,e+30)+ft(t,e+32),c]},se=function(t,e){for(;1!=ft(t,e);e+=4+ft(t,e+2));return[pt(t,e+12),pt(t,e+4),pt(t,e+20)]},ae=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&k(9),e+=r+4}return e},oe=function(t,e,n,r,i,s,a,o){var l=r.length,u=n.extra,c=o&&o.length,f=ae(u);dt(t,e,null!=a?33639248:67324752),e+=4,null!=a&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(s<0&&8),t[e++]=i&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var h=new Date(null==n.mtime?Date.now():n.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&k(10),dt(t,e,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),e+=4,-1!=s&&(dt(t,e,n.crc),dt(t,e+4,s<0?-s-2:s),dt(t,e+8,n.size)),dt(t,e+12,l),dt(t,e+14,f),e+=16,null!=a&&(dt(t,e,c),dt(t,e+6,n.attrs),dt(t,e+10,a),e+=14),t.set(r,e),e+=l,f)for(var d in u){var g=u[d],v=g.length;dt(t,e,+d),dt(t,e+2,v),t.set(g,e+4),e+=4+v}return c&&(t.set(o,e),e+=c),e},le=function(t,e,n,r,i){dt(t,e,101010256),dt(t,e+8,n),dt(t,e+10,n),dt(t,e+12,r),dt(t,e+16,i)},ue=function(){function t(t){this.filename=t,this.c=W(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||k(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();e.ZipPassThrough=ue;var ce=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new Ct(e,function(t,e){n.ondata(null,t,e)}),this.compression=8,this.flag=ne(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.ZipDeflate=ce;var fe=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new bt(e,function(t,e,r){n.ondata(t,e,r)}),this.compression=8,this.flag=ne(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.AsyncZipDeflate=fe;var he=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||k(5),2&this.d)this.ondata(k(4+8*(1&this.d),0,1),null,!1);else{var n=te(t.filename),r=n.length,s=t.comment,a=s&&te(s),o=r!=t.filename.length||a&&s.length!=a.length,l=r+ae(t.extra)+30;r>65535&&this.ondata(k(11,0,1),null,!1);var u=new i(l);oe(u,0,t,n,o,-1);var c=[u],f=function(){for(var t=0,n=c;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}c=[]},h=this.d;this.d=0;var p=this.u.length,d=B(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(f(),h){var t=e.u[p+1];t?t.r():e.d=1}h=1}}),g=0;t.ondata=function(n,r,s){if(n)e.ondata(n,r,s),e.terminate();else if(g+=r.length,c.push(r),s){var a=new i(16);dt(a,0,134695760),dt(a,4,t.crc),dt(a,8,g),dt(a,12,t.size),c.push(a),d.c=g,d.b=l+g+16,d.crc=t.crc,d.size=t.size,h&&d.r(),h=1}else h&&f()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(k(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,r=0,s=this.u;r<s.length;r++)n+=46+(u=s[r]).f.length+ae(u.extra)+(u.o?u.o.length:0);for(var a=new i(n+22),o=0,l=this.u;o<l.length;o++){var u=l[o];oe(a,t,u,u.f,u.u,-u.c-2,e,u.o),t+=46+u.f.length+ae(u.extra)+(u.o?u.o.length:0),e+=u.b}le(a,t,this.u.length,n,e),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();e.Zip=he,e.zip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&k(7);var r={};Wt(t,"",r,e);var s=Object.keys(r),a=s.length,o=0,l=0,u=a,c=new Array(a),f=[],h=function(){for(var t=0;t<f.length;++t)f[t]()},p=function(t,e){me(function(){n(t,e)})};me(function(){p=n});var d=function(){var t=new i(l+22),e=o,n=l-o;l=0;for(var r=0;r<u;++r){var s=c[r];try{var a=s.c.length;oe(t,l,s,s.f,s.u,a);var f=30+s.f.length+ae(s.extra),h=l+f;t.set(s.c,h),oe(t,o,s,s.f,s.u,a,l,s.m),o+=16+f+(s.m?s.m.length:0),l=h+a}catch(t){return p(t,null)}}le(t,o,c.length,n,e),p(null,t)};a||d();for(var g=function(t){var e=s[t],n=r[e],i=n[0],u=n[1],g=W(),v=i.length;g.p(i);var m=te(e),y=m.length,w=u.comment,E=w&&te(w),A=E&&E.length,C=ae(u.extra),b=0==u.level?0:8,z=function(n,r){if(n)h(),p(n,null);else{var i=r.length;c[t]=B(u,{size:v,crc:g.d(),c:r,f:m,m:E,u:y!=e.length||E&&w.length!=A,compression:b}),o+=30+y+C+i,l+=76+2*(y+C)+(A||0)+i,--a||d()}};if(y>65535&&z(k(11,0,1),null),b)if(v<16e4)try{z(null,_t(i,u))}catch(t){z(t,null)}else f.push(zt(i,u,z));else z(null,i)},v=0;v<u;++v)g(v);return h},e.zipSync=function(t,e){e||(e={});var n={},r=[];Wt(t,"",n,e);var s=0,a=0;for(var o in n){var l=n[o],u=l[0],c=l[1],f=0==c.level?0:8,h=(z=te(o)).length,p=c.comment,d=p&&te(p),g=d&&d.length,v=ae(c.extra);h>65535&&k(11);var m=f?_t(u,c):u,y=m.length,w=W();w.p(u),r.push(B(c,{size:u.length,crc:w.d(),c:m,f:z,m:d,u:h!=o.length||d&&p.length!=g,o:s,compression:f})),s+=30+h+v+y,a+=76+2*(h+v)+(g||0)+y}for(var E=new i(a+22),A=s,C=a-s,b=0;b<r.length;++b){var z=r[b];oe(E,z.o,z,z.f,z.u,z.c.length);var _=30+z.f.length+ae(z.extra);E.set(z.c,z.o+_),oe(E,s,z,z.f,z.u,z.c.length,z.o,z.m),s+=16+_+(z.m?z.m.length:0)}return le(E,s,r.length,C,A),E};var pe=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();e.UnzipPassThrough=pe;var de=function(){function t(){var t=this;this.i=new St(function(e,n){t.ondata(null,e,n)})}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}();e.UnzipInflate=de;var ge=function(){function t(t,e){var n=this;e<32e4?this.i=new St(function(t,e){n.ondata(null,t,e)}):(this.i=new Ut(function(t,e,r){n.ondata(t,e,r)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=P(t,0)),this.i.push(t,e)},t.compression=8,t}();e.AsyncUnzipInflate=ge;var ve=function(){function t(t){this.onfile=t,this.k=[],this.o={0:pe},this.p=q}return t.prototype.push=function(t,e){var n=this;if(this.onfile||k(5),this.p||k(4),this.c>0){var r=Math.min(this.c,t.length),s=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(s,!this.c):this.k[0].push(s),(t=t.subarray(r)).length)return this.push(t,e)}else{var a=0,o=0,l=void 0,u=void 0;this.p.length?t.length?((u=new i(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,f=this.c,h=f&&this.d,p=function(){var t,e=ht(u,o);if(67324752==e){a=1,l=o,d.d=null,d.c=0;var r=ft(u,o+6),i=ft(u,o+8),s=2048&r,h=8&r,p=ft(u,o+26),g=ft(u,o+28);if(c>o+30+p+g){var v=[];d.k.unshift(v),a=2;var m,y=ht(u,o+18),w=ht(u,o+22),E=ee(u.subarray(o+30,o+=30+p),!s);4294967295==y?(t=h?[-2]:se(u,o),y=t[0],w=t[1]):h&&(y=-1),o+=g,d.c=y;var A={name:E,compression:i,start:function(){if(A.ondata||k(5),y){var t=n.o[i];t||A.ondata(k(14,"unknown compression type "+i,1),null,!1),(m=y<0?new t(E):new t(E,y,w)).ondata=function(t,e,n){A.ondata(t,e,n)};for(var e=0,r=v;e<r.length;e++){var s=r[e];m.push(s,!1)}n.k[0]==v&&n.c?n.d=m:m.push(q,!0)}else A.ondata(null,q,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(A.size=y,A.originalSize=w),d.onfile(A)}return"break"}if(f){if(134695760==e)return l=o+=12+(-2==f&&8),a=3,d.c=0,"break";if(33639248==e)return l=o-=4,a=3,d.c=0,"break"}},d=this;o<c-4&&"break"!==p();++o);if(this.p=q,f<0){var g=a?u.subarray(0,l-12-(-2==f&&8)-(134695760==ht(u,l-16)&&4)):u.subarray(0,o);h?h.push(g,!!a):this.k[+(2==a)].push(g)}if(2&a)return this.push(u.subarray(o),e);this.p=u.subarray(o)}e&&(this.c&&k(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();e.Unzip=ve;var me="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};e.unzip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&k(7);var r=[],s=function(){for(var t=0;t<r.length;++t)r[t]()},a={},o=function(t,e){me(function(){n(t,e)})};me(function(){o=n});for(var l=t.length-22;101010256!=ht(t,l);--l)if(!l||t.length-l>65558)return o(k(13,0,1),null),s;var u=ft(t,l+8);if(u){var c=u,f=ht(t,l+16),h=4294967295==f||65535==c;if(h){var p=ht(t,l-12);(h=101075792==ht(t,p))&&(c=u=ht(t,p+32),f=ht(t,p+48))}for(var d=e&&e.filter,g=function(e){var n=ie(t,f,h),l=n[0],c=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=re(t,m);f=v;var w=function(t,e){t?(s(),o(t,null)):(e&&(a[g]=e),--u||o(null,a))};if(!d||d({name:g,size:c,originalSize:p,compression:l}))if(l)if(8==l){var E=t.subarray(y,y+c);if(p<524288||c>.8*p)try{w(null,Zt(E,{out:new i(p)}))}catch(t){w(t,null)}else r.push(Mt(E,{size:p},w))}else w(k(14,"unknown compression type "+l,1),null);else w(null,P(t,y,y+c));else w(null,null)},v=0;v<c;++v)g()}else o(null,{});return s},e.unzipSync=function(t,e){for(var n={},r=t.length-22;101010256!=ht(t,r);--r)(!r||t.length-r>65558)&&k(13);var s=ft(t,r+8);if(!s)return{};var a=ht(t,r+16),o=4294967295==a||65535==s;if(o){var l=ht(t,r-12);(o=101075792==ht(t,l))&&(s=ht(t,l+32),a=ht(t,l+48))}for(var u=e&&e.filter,c=0;c<s;++c){var f=ie(t,a,o),h=f[0],p=f[1],d=f[2],g=f[3],v=f[4],m=f[5],y=re(t,m);a=v,u&&!u({name:g,size:p,originalSize:d,compression:h})||(h?8==h?n[g]=Zt(t.subarray(y,y+p),{out:new i(d)}):k(14,"unknown compression type "+h):n[g]=P(t,y,y+p))}return n}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}(()=>{const t=n(842),e=n(886),r=n(49);self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())}),(0,t.installClientErrorReporting)(),(0,r.installMessageHandler)(),(0,e.installFetchHandler)()})()})();
2
2
  //# sourceMappingURL=zipServiceWorker.js.map