!function(q,u){function P(a,c,h){return caches.open(r).then(function(b){var e={};return c.headers.forEach(function(a,b){e[b]=a}),e["x-abtf-sw"]=n(),h&&h.max_age&&(e["x-abtf-sw-expire"]=h.max_age),c.blob().then(function(f){f=new Response(f,{status:c.status,statusText:c.statusText,headers:e});return b.put(a,f)})})}function G(a){if(a)return"string"==typeof a&&(a=new Request(a,{mode:"no-cors"})),x(a).then(function(c){return c?c:(console.info("Abtf.sw() \u27a4 preload",a.url),v(a,{conditions:null},!1, !0))})}function x(a){var c=m.start(1E3);return caches.open(r).then(function(h){return h.match(a).then(function(b){if(b){var e=b.headers.get("x-abtf-sw-expire");if(e)var f=b.headers.get("x-abtf-sw");var d=b.headers.get("expire");d&&(d=B(d));e&&fn()-5)return console.info("Abtf.sw() \u27a4 hook into preload initiated request",k),l[k][1];f=u(g).then(function(a){d(k);var b=!1;if(a.ok&&400>a.status){var f=a.headers.get("link");f&&(f instanceof Array||(f=[f]),m.f(function(){caches.open(r+":push").then(function(a){f.forEach(function(b){b.split(",").forEach(function(b){if(/rel=preload/.test(b)){var g= b.match(/<([^>]+)>/);g&&g[1]&&a.match(g[1]).then(function(b){b||a.put(g[1],new Response(null,{status:204}))})}})})})},1E3));c&&(b=!0,c.conditions&&(c.conditions.forEach(function(c){if(b)switch(c.type){case "url":c.regex?(e=C(c.pattern))?(f=e.test(g.url),c.not?f&&(b=!1):f||(b=!1)):b=!1:(f=-1!==g.url.indexOf(c.pattern),c.not?f&&(b=!1):f||(b=!1));break;case "header":var d=a.headers.get(c.name);if(d)if(c.regex){var e=C(c.pattern);e?(f=e.test(d),c.not?f&&(b=!1):f||(b=!1)):b=!1}else if("object"==typeof c.pattern)if(c.pattern.operator)if(d= parseFloat(d),e=parseFloat(c.pattern.value),isNaN(d)||isNaN(e))b=!1;else{switch(c.pattern.operator){case "<":f=d":f=d>e;break;case "=":var f=d===e;break;default:b=!1}b&&(c.not?f&&(b=!1):f||(b=!1))}else b=!1;else-1===d.indexOf(c.pattern)&&(b=!1);else b=!1}}),b?console.info("Abtf.sw() \u27a4 cache condition \u27a4 cache",g.url,c.conditions):console.info("Abtf.sw() \u27a4 cache condition \u27a4 no cache",g.url,c.conditions)),b&&P(g,a.clone(),c).then(function(){m.complete(e)}))}return b|| m.complete(e),a})["catch"](function(a){return d(k),m.complete(e),h?h(g,null,a):null});return b&&(l[k]=[n(),f],l[k][2]=setTimeout(function(){l[k]=!1;delete l[k]},5E3)),f})}function M(){I||(!J||Jz&&(e.sort(function(a,b){return a.t>b.t?-1:a.ta.status)return a.json().then(function(a){if(console.info("Abtf.sw() \u27a4 config "+(p?"updated":"loaded"), a),a){a instanceof Array&&(a={policy:a});r="abtf";a.cache_version&&(r=r+":"+a.cache_version);a.policy&&(p=a.policy,A=n());var c=[],b=[];return a.start_url&&b.push(G(a.start_url)),a.policy&&a.policy.forEach(function(a){a.offline&&-1===c.indexOf(a.offline)&&c.push(a.offline)}),a.preload&&a.preload.forEach(function(a){-1===c.indexOf(a)&&c.push(a)}),preloadPromises=[],c.forEach(function(a){preloadPromises.push(G(a))}),a.i&&(b=b.concat(preloadPromises)),Promise.all(b)}});throw p=!1,Error("service worker config not found: "+ E);})["catch"](function(a){p=w=!1;setTimeout(function(){throw a;})}))}function O(a){(new Promise(function(c){if(!p||!A||a&&a>A){var h=!p;D().then(function(){h&&c(p?p:!1)})["catch"](function(){h&&c(!1)})}else if(!w&&A>32-b&(1<=Math.pow(2,32))throw Error('Invalid probability: "${p}" must be smaller than 2**32');if(!(0>b;0!=f;--f)this.b(0);this.b(1);this.c(c, b);c=a[d]}return this};var f=new TextEncoder("utf-8");return function(a,b){return e(a,b)}}(),m=function(){function a(e,f,d){var g=!1,k=Object.keys(c);if(0n()- e&&(d=!1)}return d&&function(a,c){setTimeout(function(){var d;if(b.cache.h&&(d=function(){clients.matchAll().then(function(b){b.forEach(function(b){b.postMessage([2,a.url])})})}),b.cache.head_update)console.info("Abtf.sw() \u27a4 HEAD \u27a4 verify",a.url),Q(a,b.cache,c,d);else{console.info("Abtf.sw() \u27a4 update cache",a.url);var e=v(a,b.cache);d&&e.then(d)}},10)}(a.request.clone(),c.clone()),console.info("Abtf.sw() \u27a4 from cache",a.request.url),c}return v(a.request,b.cache,function(c,d,e){return b.offline? (console.warn("Abtf.sw() \u27a4 no cache \u27a4 network failed \u27a4 offline page",c.url),H(b.offline,c.clone())):(console.warn("Abtf.sw() \u27a4 no cache \u27a4 network failed \u27a4 empty 404 response",c.url,d,e),d||u(a.request.clone())["catch"](function(a){setTimeout(function(){throw a;})}))})});case "event":return x(a.request).then(function(c){return c?(console.info("Abtf.sw() \u27a4 from cache",a.request.url),c):v(a.request,null,function(c,d){return b.offline?(console.warn("Abtf.sw() \u27a4 no cache \u27a4 network failed \u27a4 offline page", c.url),H(b.offline,c.clone())):(console.warn("Abtf.sw() \u27a4 no cache \u27a4 network failed \u27a4 empty 404 response",c.url,d),d||u(a.request)["catch"](function(a){setTimeout(function(){throw a;})}))})});default:return v(a.request,b.cache,function(c,e,f){return console.warn("Abtf.sw() \u27a4 network failed",c.url,e||f),x(c).then(function(d){return d?(console.info("Abtf.sw() \u27a4 fallback from cache",c.url),d):b.offline?(console.warn("Abtf.sw() \u27a4 no cache \u27a4 offline page",c.url),H(b.offline, c.clone())):(console.warn("Abtf.sw() \u27a4 no cache \u27a4 empty 404 response",c.url),e||u(a.request)["catch"](function(a){setTimeout(function(){throw a;})}))})})}}(a,p);if(!1!==h)return a.respondWith(h)}}});q.addEventListener("message",function(a){if(a&&a.data&&a.data instanceof Array){if(1===a.data[0]&&(a.data[1]&&!isNaN(parseInt(a.data[1]))&&O(parseInt(a.data[1])),a.data[3]&&!isNaN(parseInt(a.data[3]))&&(z=parseInt(a.data[3])),m.f(M,1E4,"clean-cache")),2===a.data[0]||3===a.data[0])var c=a.ports[0]? function(b,c){a.ports[0].postMessage({error:b,status:c})}:!1;if(2===a.data[0])if(a.data[1]){var h;if("string"==typeof a.data[1]||a.data[1]instanceof Request?h=[a.data[1]]:a.data[1]instanceof Array&&(h=a.data[1]),h){var b=[];h.forEach(function(a){b.push(G(a))});c&&Promise.all(b).then(function(a){var b=[];a.forEach(function(a){var c={url:a.url,status:a.status,statusText:a.statusText};a=a.headers.get("content-length");c.size=isNaN(parseInt(a))?-1:parseInt(a);b.push(c)});c(null,b)})["catch"](function(a){console.error("Abtf.sw() \u27a4 preload", a)})}else c&&c("invalid-data")}else c&&c("no-urls");3===a.data[0]&&(q.registration.showNotification(a.data[1],a.data[2]),c&&c(null,"sent"))}})}(self,self.fetch,Cache);