winga-chart-plotter-signalk 0.1.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.
@@ -0,0 +1 @@
1
+ (function(){Object.freeze({Connecting:0,0:`Connecting`,Connected:1,1:`Connected`,Disconnected:2,2:`Disconnected`,Error:3,3:`Error`});var e=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,l.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,l.unregister(this),e}free(){let e=this.__destroy_into_raw();P.__wbg_position_free(e,0)}get altitude(){let e=P.__wbg_get_position_altitude(this.__wbg_ptr);return e[0]===0?void 0:e[1]}get latitude(){return P.__wbg_get_position_latitude(this.__wbg_ptr)}get longitude(){return P.__wbg_get_position_longitude(this.__wbg_ptr)}constructor(e,t){let n=P.position_new(e,t);return this.__wbg_ptr=n,l.register(this,this.__wbg_ptr,this),this}set altitude(e){P.__wbg_set_position_altitude(this.__wbg_ptr,!T(e),T(e)?0:e)}set latitude(e){P.__wbg_set_position_latitude(this.__wbg_ptr,e)}set longitude(e){P.__wbg_set_position_longitude(this.__wbg_ptr,e)}};Symbol.dispose&&(e.prototype[Symbol.dispose]=e.prototype.free);var t=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,u.unregister(this),e}free(){let e=this.__destroy_into_raw();P.__wbg_signalkclient_free(e,0)}close(){P.signalkclient_close(this.__wbg_ptr)}constructor(e,t,n,r){let i=D(e,P.__wbindgen_malloc,P.__wbindgen_realloc),a=N,o=P.signalkclient_new(i,a,t,n,r);if(o[2])throw O(o[1]);return this.__wbg_ptr=o[0],u.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);var n=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,d.unregister(this),e}free(){let e=this.__destroy_into_raw();P.__wbg_vesselstate_free(e,0)}get cog(){let e=P.__wbg_get_vesselstate_cog(this.__wbg_ptr);return e[0]===0?void 0:e[1]}get heading(){let e=P.__wbg_get_vesselstate_heading(this.__wbg_ptr);return e[0]===0?void 0:e[1]}get position(){let t=P.__wbg_get_vesselstate_position(this.__wbg_ptr);return t===0?void 0:e.__wrap(t)}get sog(){let e=P.__wbg_get_vesselstate_sog(this.__wbg_ptr);return e[0]===0?void 0:e[1]}set cog(e){P.__wbg_set_vesselstate_cog(this.__wbg_ptr,!T(e),T(e)?0:e)}set heading(e){P.__wbg_set_vesselstate_heading(this.__wbg_ptr,!T(e),T(e)?0:e)}set position(t){let n=0;T(t)||(p(t,e),n=t.__destroy_into_raw()),P.__wbg_set_vesselstate_position(this.__wbg_ptr,n)}set sog(e){P.__wbg_set_vesselstate_sog(this.__wbg_ptr,!T(e),T(e)?0:e)}constructor(){let e=P.vesselstate_new();return this.__wbg_ptr=e,d.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);function r(){return{__proto__:null,"./signalk_chart_core_bg.js":{__proto__:null,__wbg___wbindgen_debug_string_edece8177ad01481:function(e,t){let n=D(h(t),P.__wbindgen_malloc,P.__wbindgen_realloc),r=N;v().setInt32(e+4,r,!0),v().setInt32(e+0,n,!0)},__wbg___wbindgen_is_undefined_35bb9f4c7fd651d5:function(e){return e===void 0},__wbg___wbindgen_string_get_d109740c0d18f4d7:function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=T(r)?0:D(r,P.__wbindgen_malloc,P.__wbindgen_realloc),a=N;v().setInt32(e+4,a,!0),v().setInt32(e+0,i,!0)},__wbg___wbindgen_throw_9c31b086c2b26051:function(e,t){throw Error(x(e,t))},__wbg__wbg_cb_unref_3fa391f3fcdb55f8:function(e){e._wbg_cb_unref()},__wbg_buffer_765a8f5ca0b6d2ab:function(e){return e.buffer},__wbg_call_dfde26266607c996:function(){return w(function(e,t,n){return e.call(t,n)},arguments)},__wbg_clearTimeout_b339cb81aa470a3e:function(e,t){e.clearTimeout(t)},__wbg_close_e323e9eee669c291:function(){return w(function(e){e.close()},arguments)},__wbg_data_5fc79a19e47d1531:function(e){return e.data},__wbg_instanceof_WorkerGlobalScope_a93ee1765e6a23bf:function(e){let t;try{t=e instanceof WorkerGlobalScope}catch{t=!1}return t},__wbg_new_02d162bc6cf02f60:function(){return{}},__wbg_new_310879b66b6e95e1:function(){return[]},__wbg_new_b1280f836646084c:function(){return w(function(e,t){return new WebSocket(x(e,t))},arguments)},__wbg_new_from_slice_02962bf7778cf945:function(e,t){return new Float64Array(g(e,t))},__wbg_new_with_length_1278c16a5c5b497f:function(e){return new Float64Array(e>>>0)},__wbg_new_with_length_c2a8f9ac6aaaac03:function(e){return Array(e>>>0)},__wbg_now_81363d44c96dd239:function(){return Date.now()},__wbg_send_e1d2f71ce4473d1e:function(){return w(function(e,t,n){e.send(x(t,n))},arguments)},__wbg_setTimeout_a2b48e67340623fd:function(){return w(function(e,t,n){return e.setTimeout(t,n)},arguments)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_78ea6a19f4818587:function(e,t,n){e[t>>>0]=n},__wbg_set_a0e911be3da02782:function(){return w(function(e,t,n){return Reflect.set(e,t,n)},arguments)},__wbg_set_onclose_3121e15055418a37:function(e,t){e.onclose=t},__wbg_set_onerror_1dd52df6279c8dd2:function(e,t){e.onerror=t},__wbg_set_onmessage_9eb2cf76e70783ad:function(e,t){e.onmessage=t},__wbg_set_onopen_6f3fc5e2ad3144f1:function(e,t){e.onopen=t},__wbg_static_accessor_GLOBAL_THIS_02344c9b09eb08a9:function(){let e=typeof globalThis>`u`?null:globalThis;return T(e)?0:f(e)},__wbg_static_accessor_GLOBAL_ac6d4ac874d5cd54:function(){let e=typeof global>`u`?null:global;return T(e)?0:f(e)},__wbg_static_accessor_SELF_9b2406c23aeb2023:function(){let e=typeof self>`u`?null:self;return T(e)?0:f(e)},__wbg_static_accessor_WINDOW_b34d2126934e16ba:function(){let e=typeof window>`u`?null:window;return T(e)?0:f(e)},__wbindgen_cast_0000000000000001:function(e,t){return E(e,t,a)},__wbindgen_cast_0000000000000002:function(e,t){return E(e,t,o)},__wbindgen_cast_0000000000000003:function(e,t){return E(e,t,s)},__wbindgen_cast_0000000000000004:function(e,t){return E(e,t,c)},__wbindgen_cast_0000000000000005:function(e,t){return E(e,t,i)},__wbindgen_cast_0000000000000006:function(e){return e},__wbindgen_cast_0000000000000007:function(e,t){return x(e,t)},__wbindgen_init_externref_table:function(){let e=P.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function i(e,t){P.wasm_bindgen__convert__closures_____invoke__hf9cd37beb7bb93c2(e,t)}function a(e,t,n){P.wasm_bindgen__convert__closures_____invoke__h064a3f5788f1fd2a(e,t,n)}function o(e,t,n){P.wasm_bindgen__convert__closures_____invoke__h064a3f5788f1fd2a_1(e,t,n)}function s(e,t,n){P.wasm_bindgen__convert__closures_____invoke__h064a3f5788f1fd2a_2(e,t,n)}function c(e,t,n){P.wasm_bindgen__convert__closures_____invoke__h064a3f5788f1fd2a_3(e,t,n)}let l=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_position_free(e,1)),u=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_signalkclient_free(e,1)),d=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_vesselstate_free(e,1));function f(e){let t=P.__externref_table_alloc();return P.__wbindgen_externrefs.set(t,e),t}function p(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`)}let m=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbindgen_destroy_closure(e.a,e.b));function h(e){let t=typeof e;if(t==`number`||t==`boolean`||e==null)return`${e}`;if(t==`string`)return`"${e}"`;if(t==`symbol`){let t=e.description;return t==null?`Symbol`:`Symbol(${t})`}if(t==`function`){let t=e.name;return typeof t==`string`&&t.length>0?`Function(${t})`:`Function`}if(Array.isArray(e)){let t=e.length,n=`[`;t>0&&(n+=h(e[0]));for(let r=1;r<t;r++)n+=`, `+h(e[r]);return n+=`]`,n}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r==`Object`)try{return`Object(`+JSON.stringify(e)+`)`}catch{return`Object`}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}function g(e,t){return e>>>=0,b().subarray(e/8,e/8+t)}let _=null;function v(){return(_===null||_.buffer.detached===!0||_.buffer.detached===void 0&&_.buffer!==P.memory.buffer)&&(_=new DataView(P.memory.buffer)),_}let y=null;function b(){return(y===null||y.byteLength===0)&&(y=new Float64Array(P.memory.buffer)),y}function x(e,t){return j(e>>>0,t)}let S=null;function C(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(P.memory.buffer)),S}function w(e,t){try{return e.apply(this,t)}catch(e){let t=f(e);P.__wbindgen_exn_store(t)}}function T(e){return e==null}function E(e,t,n){let r={a:e,b:t,cnt:1},i=(...e)=>{r.cnt++;let t=r.a;r.a=0;try{return n(t,r.b,...e)}finally{r.a=t,i._wbg_cb_unref()}};return i._wbg_cb_unref=()=>{--r.cnt===0&&(P.__wbindgen_destroy_closure(r.a,r.b),r.a=0,m.unregister(r))},m.register(i,r,r),i}function D(e,t,n){if(n===void 0){let n=M.encode(e),r=t(n.length,1)>>>0;return C().subarray(r,r+n.length).set(n),N=n.length,r}let r=e.length,i=t(r,1)>>>0,a=C(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=C().subarray(i+o,i+r),a=M.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return N=o,i}function O(e){let t=P.__wbindgen_externrefs.get(e);return P.__externref_table_dealloc(e),t}let k=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});k.decode();let A=0;function j(e,t){return A+=t,A>=2146435072&&(k=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),k.decode(),A=t),k.decode(C().subarray(e,e+t))}let M=new TextEncoder;`encodeInto`in M||(M.encodeInto=function(e,t){let n=M.encode(e);return t.set(n),{read:e.length,written:n.length}});let N=0,P;function F(e,t){return P=e.exports,_=null,y=null,S=null,P.__wbindgen_start(),P}async function I(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function L(e){if(P!==void 0)return P;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0&&(e=new URL(`/assets/signalk_chart_core_bg-leOhlBKH.wasm`,``+self.location.href));let t=r();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:i}=await I(await e,t);return F(n,i)}let R=null,z=!1;async function B(){z||=(await L(),!0)}self.onmessage=async e=>{let n=e.data;if(n.type===`connect`){await B(),R?.close();try{R=new t(n.url,e=>{self.postMessage({type:`state`,state:e})},e=>{self.postMessage({type:`status`,status:e})},e=>{self.postMessage({type:`ais`,hot:e.hot,ids:e.ids,cold:e.cold},[e.hot])})}catch(e){self.postMessage({type:`error`,message:String(e)})}}else R?.close(),R=null}})();
Binary file
Binary file
Binary file
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="manifest" href="/manifest.json" />
7
+ <link rel="icon" type="image/png" href="/favicon.png" />
8
+ <title>signalk-chart-rs</title>
9
+ <style>
10
+ * { margin: 0; padding: 0; box-sizing: border-box; }
11
+ html, body, #app { width: 100%; height: 100%; overflow: hidden; }
12
+ </style>
13
+ <script type="module" crossorigin src="/assets/index-DaaP7hkr.js"></script>
14
+ <link rel="stylesheet" crossorigin href="/assets/index-DBxFB3St.css">
15
+ <script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
16
+ <body>
17
+ <div id="app"></div>
18
+ </body>
19
+ </html>
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "SignalK Chart",
3
+ "short_name": "Chart",
4
+ "description": "Professional sea chart plotting for sailing",
5
+ "start_url": "/",
6
+ "display": "standalone",
7
+ "background_color": "#1a1a2e",
8
+ "theme_color": "#1a1a2e",
9
+ "orientation": "any",
10
+ "icons": [
11
+ {
12
+ "src": "/icon-192.png",
13
+ "sizes": "192x192",
14
+ "type": "image/png",
15
+ "purpose": "any"
16
+ },
17
+ {
18
+ "src": "/icon-192.png",
19
+ "sizes": "192x192",
20
+ "type": "image/png",
21
+ "purpose": "maskable"
22
+ },
23
+ {
24
+ "src": "/icon-512.png",
25
+ "sizes": "512x512",
26
+ "type": "image/png",
27
+ "purpose": "any"
28
+ },
29
+ {
30
+ "src": "/icon-512.png",
31
+ "sizes": "512x512",
32
+ "type": "image/png",
33
+ "purpose": "maskable"
34
+ }
35
+ ]
36
+ }
@@ -0,0 +1 @@
1
+ if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/sw.js', { scope: '/' })})}
package/public/sw.js ADDED
@@ -0,0 +1 @@
1
+ if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const l=e||("document"in self?document.currentScript.src:"")||location.href;if(s[l])return;let o={};const t=e=>i(e,l),d={module:{uri:l},exports:o,require:t};s[l]=Promise.all(n.map(e=>d[e]||t(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"d565d6b43a54951ae20799116012ea6a"},{url:"icon-512.png",revision:"60a5aa58a72f657b4e5878caa235fd08"},{url:"icon-192.png",revision:"bc1b6b889108f5c4ba7deddc4284fef3"},{url:"favicon.png",revision:"8ddfd21e67edfdd8296484a6ecf207a0"},{url:"assets/signalk_chart_core_bg-leOhlBKH.wasm",revision:null},{url:"assets/signalk.worker-CTqxEwG1.js",revision:null},{url:"assets/index-DaaP7hkr.js",revision:null},{url:"assets/index-DBxFB3St.css",revision:null}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"),{denylist:[/^\/tiles\//,/^\/signalk\//,/^\/v1\//]}))});
@@ -0,0 +1 @@
1
+ define(["exports"],function(t){"use strict";try{self["workbox:core:7.4.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.4.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super(({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)},e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})}));t.waitUntil(s),t.ports&&t.ports[0]&&s.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:i})}catch(t){a=Promise.reject(t)}const h=r&&r.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch(async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n})),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a=()=>(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c);function h(t,e,n){let o;if("string"==typeof t){const s=new URL(t,location.href);o=new i(({url:t})=>t.href===s.href,e,n)}else if(t instanceof RegExp)o=new r(t,e,n);else if("function"==typeof t)o=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}return a().registerRoute(o),o}const u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},l=t=>[u.prefix,t,u.suffix].filter(t=>t&&t.length>0).join("-"),f=t=>t||l(u.precache),w=t=>t||l(u.runtime);function d(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.4.0"]&&_()}catch(t){}function p(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class y{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class g{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let R;async function m(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=function(){if(void 0===R){const t=new Response("");if("body"in t)try{new Response(t.body),R=!0}catch(t){R=!1}R=!1}return R}()?i.body:await i.blob();return new Response(o,r)}function v(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class q{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}const U=new Set;try{self["workbox:strategies:7.4.0"]&&_()}catch(t){}function L(t){return"string"==typeof t?new Request(t):t}class b{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new q,this.R=[],this.m=[...t.plugins],this.v=new Map;for(const t of this.m)this.v.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=L(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=L(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=L(t);var i;await(i=0,new Promise(t=>setTimeout(t,i)));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const c=await this.q(e);if(!c)return!1;const{cacheName:a,matchOptions:h}=this.l,u=await self.caches.open(a),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=v(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===v(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?c.clone():c)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of U)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:a,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=L(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.v.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.R.push(t),t}async doneWaiting(){for(;this.R.length;){const t=this.R.splice(0),e=(await Promise.allSettled(t)).find(t=>"rejected"===t.status);if(e)throw e.reason}}destroy(){this.p.resolve(null)}async q(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class C{constructor(t={}){this.cacheName=w(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new b(this,{event:e,request:s,params:n}),r=this.U(i,s,e);return[r,this.L(r,i,s,e)]}async U(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this._(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async L(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}class E extends C{constructor(t={}){t.cacheName=f(t.cacheName),super(t),this.C=!1!==t.fallbackToNetwork,this.plugins.push(E.copyRedirectedCacheableResponsesPlugin)}async _(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.O(t,e):await this.N(t,e))}async N(t,e){let n;const i=e.params||{};if(!this.C)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.P(),await e.cachePut(t,n.clone()))}return n}async O(t,e){this.P();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}P(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==E.copyRedirectedCacheableResponsesPlugin&&(n===E.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(E.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}E.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},E.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await m(t):t};class O{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.j=new Map,this.k=new Map,this.K=new Map,this.l=new E({cacheName:f(t),plugins:[...e,new g({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.T||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.T=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=p(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.j.has(i)&&this.j.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.j.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.K.has(t)&&this.K.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.K.set(t,n.integrity)}if(this.j.set(i,t),this.k.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return d(t,async()=>{const e=new y;this.strategy.plugins.push(e);for(const[e,s]of this.j){const n=this.K.get(s),i=this.k.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}})}activate(t){return d(t,async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.j.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}})}getURLsToCacheKeys(){return this.j}getCachedURLs(){return[...this.j.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.j.get(e.href)}getIntegrityForCacheKey(t){return this.K.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let x;const N=()=>(x||(x=new O),x);class P extends i{constructor(t,e){super(({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some(t=>t.test(s))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}},t.strategy)}}t.NavigationRoute=class extends i{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super(t=>this.W(t),t),this.M=e,this.S=s}W({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.S)if(t.test(s))return!1;return!!this.M.some(t=>t.test(s))}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",t=>{const e=f();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter(s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t);return await Promise.all(s.map(t=>self.caches.delete(t))),s})(e).then(t=>{}))})},t.clientsClaim=function(){self.addEventListener("activate",()=>self.clients.claim())},t.createHandlerBoundToURL=function(t){return N().createHandlerBoundToURL(t)},t.precacheAndRoute=function(t,e){!function(t){N().precache(t)}(t),function(t){const e=N();h(new P(e,t))}(e)},t.registerRoute=h});