-
Notifications
You must be signed in to change notification settings - Fork 13
/
service-worker.js
1 lines (1 loc) · 5.3 KB
/
service-worker.js
1
"use strict";function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}var precacheConfig=[["/index.html","14ec29cbe78cb6925820f4e25c1aa23d"],["/static/css/main.b978f400.css","804d4ff33a9e8c1ee667c3df09ecc03b"],["/static/media/Simple-Line-Icons.0cb0b9c5.woff2","0cb0b9c589c0624c9c78dd3d83e946f6"],["/static/media/Simple-Line-Icons.2fe2efe6.svg","2fe2efe63441d830b1acd106c1fe8734"],["/static/media/Simple-Line-Icons.78f07e2c.woff","78f07e2c2a535c26ef21d95e41bd7175"],["/static/media/Simple-Line-Icons.d2285965.ttf","d2285965fe34b05465047401b8595dd0"],["/static/media/Simple-Line-Icons.f33df365.eot","f33df365d6d0255b586f2920355e94d7"],["/static/media/avatar.fbf5788e.svg","fbf5788e3e7883e885cc896016015447"],["/static/media/close.b3966fbb.svg","b3966fbb5281d62bfa11a6b73c472caf"],["/static/media/fontawesome-webfont.674f50d2.eot","674f50d287a8c48dc19ba404d20fe713"],["/static/media/fontawesome-webfont.912ec66d.svg","912ec66d7572ff821749319396470bde"],["/static/media/fontawesome-webfont.af7ae505.woff2","af7ae505a9eed503f8b8e6982036873e"],["/static/media/fontawesome-webfont.b06871f2.ttf","b06871f281fee6b241d60582ae9369b9"],["/static/media/fontawesome-webfont.fee66e71.woff","fee66e712a8a08eef5805a46892932ad"],["/static/media/group-11.1412edea.svg","1412edea285e5c899cae4aa04d126609"],["/static/media/group-12.ed3508b6.svg","ed3508b63db31af8f69977544a06947b"],["/static/media/group-13.02a05cc6.svg","02a05cc6866544cf95a3264bc9eda8d0"],["/static/media/group-15.10f809b0.svg","10f809b003b6e79605b3fb80a981a78f"],["/static/media/group-16.a3183ae3.svg","a3183ae31e5b33c18b9ad7cc35ff5c57"],["/static/media/group-18.3b265466.svg","3b265466780d67441c9ae08ccf881a07"],["/static/media/group-26.496a727f.svg","496a727f0528f89cccf5df87c8d62de5"],["/static/media/group-27.f75e2d71.svg","f75e2d71bd4c135913a691059c129b6c"],["/static/media/group-28.fc4117eb.svg","fc4117eb4cfffb78129f6bd4d265ce20"],["/static/media/group-29.a25eadc6.svg","a25eadc623619c694bad78814ae9af3b"],["/static/media/group-34.6857bead.svg","6857beadf779bf63643ae9e259e3c875"],["/static/media/group-35.40d57f93.svg","40d57f93b68a3f4c096e541df4ea1a3c"],["/static/media/group-36.4542d15c.svg","4542d15cfa3dd277e7ecb70170c44383"],["/static/media/icon.10a98f89.svg","10a98f894e5694fd3c61d0d925671d49"],["/static/media/icon.251eb409.svg","251eb409c6e2d5c1ee4fb4704c5fc5f8"],["/static/media/tt-lower.0039ed7b.svg","0039ed7b89d6a961fceb4934520f6f67"],["/static/media/tt-upper.570b5eaf.svg","570b5eafa0b3868c86c42e446df77372"],["/static/media/wndControls.58618cc8.svg","58618cc88f007b8850bdefb2fa4b26cc"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(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,c){var n=new URL(e);return c&&n.pathname.match(c)||(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],c=new URL(t,self.location),n=createCacheKey(c,hashParamName,a,/\.\w{8}\./);return[c.toString(),n]}));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 c=new Request(a,{credentials:"same-origin"});return fetch(c).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));!t&&"navigate"===e.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],e.request.url)&&(a=new URL("/index.html",self.location).toString(),t=urlsToCacheKeys.has(a)),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 console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}});