-
Notifications
You must be signed in to change notification settings - Fork 1
/
service-worker.js
1 lines (1 loc) · 3.86 KB
/
service-worker.js
1
"use strict";var precacheConfig=[["/apple-touch-icon.png","a897c7a801a566c436adc9a0a0d20770"],["/assets/svg/avoscloud.svg","51a84816822edc5b54bed1e62fad6fcc"],["/assets/svg/corner-bracket-lover.svg","e1051c518e9c1a3d6adc89094b8669ba"],["/assets/svg/disable-wysiwyg.svg","62281c94612dc6c441991daecf7d4de3"],["/assets/svg/instagram-badges.svg","60f410dea42da2aab058a5f5232d97ee"],["/assets/svg/itercast.svg","371e29d95b763d3b038130d8d429c33b"],["/assets/svg/kai.svg","c700b5f7b638737d26dd10c8f4a33e21"],["/assets/svg/quotmarks-replacer.svg","c1a99a632c92a17e8653b072dfff2fea"],["/assets/svg/readability-buttons.svg","3eff40cf062c0f5792b47990326fe121"],["/assets/svg/relative-url.svg","a2e57715668d07b1e064126cade837e4"],["/assets/svg/slimpack-bg-alt.svg","126c243ce2be8addf097c1f6179839e5"],["/assets/svg/slimpack-bg.svg","38f2a09727a56ba63ac78b4bc2a94b41"],["/assets/svg/space-lover.svg","63324f5a368916c22f88e057fc922eeb"],["/assets/svg/tianjin-project-wef.svg","ea6f19483dbb927776f8d390683402ef"],["/assets/svg/tianjin-project.svg","88816de9ad7f4b8833d790a883a54e58"],["/assets/themes/curtana/js/lightense.min.825a1899.js","825a1899ca931ba00489a383144e9022"],["/googlec3d1ace322adb65e.html","e07f9e9797d6b19dd9b0fbfff644573c"],["/mask-icon.svg","ca89025ac8b3d4aaf0776103effbfa2c"]],cacheName="sw-precache-v3-sparanoid.com-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var a=new URL(e);return"/"===a.pathname.slice(-1)&&(a.pathname+=t),a.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,a,s){var n=new URL(e);return s&&n.pathname.match(s)||(n.search+=(n.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(a)),n.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var a=new URL(t).pathname;return e.some(function(e){return a.match(e)})},stripIgnoredUrlParameters=function(e,t){var a=new URL(e);return a.hash="",a.search=a.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),a.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],a=e[1],s=new URL(t,self.location),n=createCacheKey(s,hashParamName,a,!1);return[s.toString(),n]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(a){if(!t.has(a)){var s=new Request(a,{credentials:"same-origin"});return fetch(s).then(function(t){if(!t.ok)throw new Error("Request for "+a+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(a,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(a){return Promise.all(a.map(function(a){if(!t.has(a.url))return e.delete(a)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,a=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);(t=urlsToCacheKeys.has(a))||(a=addDirectoryIndex(a,"index.html"),t=urlsToCacheKeys.has(a));0,t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(a)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return fetch(e.request)}))}});