Click
here to make this site available offline.',clickHandler=function(a){a.preventDefault(),a.stopPropagation(),e.prompt(),t.removeEventListener("click",clickHandler,!1),t=null,e.userChoice.then((function(e){}),(function(e){console.error("ðŸ˜",e)}))},createButton=function(){document.body.insertAdjacentHTML("beforeend",a),t=document.querySelector("a[data-action=install-pwa-app]"),t.addEventListener("click",clickHandler,!1)};window.addEventListener("beforeinstallprompt",(function(t){e=t,t.preventDefault(),createButton()}))}
\ No newline at end of file
+undefined
\ No newline at end of file
diff --git a/worker/dist/browser.uninstall.js b/worker/dist/browser.uninstall.js
index 72aaa7e..fb0873b 100644
--- a/worker/dist/browser.uninstall.js
+++ b/worker/dist/browser.uninstall.js
@@ -10,7 +10,11 @@
* @license MIT License
*/
// @ts-check
+<<<<<<< Updated upstream
// build a484bf1 2020-09-20 11:24:40-04:00
+=======
+// build 10d7737 2020-10-14 17:55:11-04:00
+>>>>>>> Stashed changes
if ("serviceWorker" in navigator && navigator.serviceWorker.controller) {
navigator.serviceWorker.getRegistration().then((function(registration) {
registration.unregister().then((function(result) {
diff --git a/worker/dist/browser.uninstall.min.js b/worker/dist/browser.uninstall.min.js
index 65591fc..66dc905 100644
--- a/worker/dist/browser.uninstall.min.js
+++ b/worker/dist/browser.uninstall.min.js
@@ -1 +1 @@
-"serviceWorker"in navigator&&navigator.serviceWorker.controller&&navigator.serviceWorker.getRegistration().then((function(r){r.unregister().then((function(r){}))}));
\ No newline at end of file
+undefined
\ No newline at end of file
diff --git a/worker/dist/serviceworker.js b/worker/dist/serviceworker.js
index 8f9d723..6d06f4d 100644
--- a/worker/dist/serviceworker.js
+++ b/worker/dist/serviceworker.js
@@ -881,14 +881,14 @@
* service worker build id
*/
buildid: {
- value: "a484bf1",
+ value: "871c11e",
enumerable: true
},
/**
* service worker buid date
*/
builddate: {
- value: "2020-09-20 11:24:40-04:00",
+ value: "2020-10-14 21:30:28-04:00",
enumerable: true
},
/**
@@ -1661,7 +1661,7 @@
if (!event.url || (event.request.cache === 'only-if-cached' && event.request.mode !== 'same-origin')) {
- return fetch(event.request);
+ return;
}
let response;
diff --git a/worker/dist/serviceworker.min.js b/worker/dist/serviceworker.min.js
index 6b51661..3b75f79 100644
--- a/worker/dist/serviceworker.min.js
+++ b/worker/dist/serviceworker.min.js
@@ -1 +1 @@
-!function(){"use strict";async function DB(e,t="id",r=[]){return new Promise((n,s)=>{const a=indexedDB.open(e,1),o=`${e}_store`;let i;const _query=(e,t,r=null,n=null)=>new Promise((s,a)=>{const c=t?"readonly":"readwrite";if(i.objectStoreNames.contains(o)){const t=i.transaction(o,c),l=t.objectStore(o);let u;"put"===e&&r&&void 0!==r.length?(u=t,r.forEach(e=>{l.put(e)})):(n&&l.index(n),u=l[e](r)),u.oncomplete=e=>{s(e.target.result)},u.onsuccess=e=>{s(e.target.result)},u.onerror=e=>{a(e)}}else a(new Error("Store not found"))}),c={count:async()=>{const e=i.transaction(o,"readonly").objectStore(o).count();return new Promise((function(t,r){e.onsuccess=function(e){t(e.target.result)},e.onerror=function(e){r(e)}}))},get:(e,t)=>_query("get",!0,e,t),getAll:(e,t)=>_query("getAll",!0,e,t),put:e=>_query("put",!1,e),delete:e=>_query("delete",!1,e),clear:()=>_query("clear",!1),deleteDatabase:()=>new Promise((function(e,t){const r=indexedDB.deleteDatabase;r.onerror=t,r.onsuccess=e}))};a.onupgradeneeded=(()=>{i=a.result;const e=i.createObjectStore(o,{keyPath:t});let n;for(n of r)e.createIndex(n.name,n.key,n.options)}).bind(this),a.onsuccess=(()=>{i=a.result,n(c)}).bind(this),a.onerror=(e=>{s(new Error(e.originalTarget&&e.originalTarget.error||e))}).bind(this)})}const e={implement(e){const t=e.prototype,r=[].slice.call(arguments,1);let n,s,a;function makefunc(e,t,r){return function(){const n=this,s="previous"in n,a="parent"in n,o=n.previous,i=n.parent;n.previous=t,n.parent=r;const c=e.apply(n,arguments);return s&&(n.previous=o),a&&(n.parent=i),c}}for(n=0;n
function(t){if("object"==typeof t){const r=[].slice.call(arguments,1);let n;for(n in t)e.apply(this,[n,t[n]].concat(r))}else e.apply(this,arguments);return this}};function merge(e){const t=[].slice.call(arguments,1);let r,n,s,a,o="boolean"==typeof e;for(!0===o&&(o=e,e=t.shift()),r=0;r1?[].slice.call(arguments,1):[];return Promise.all((t.$events[e]||[]).concat().map(e=>new Promise(n=>{n(e.cb.apply(t,r))})))},addPseudo(e,t){return this.$pseudo[e]=t,this}};function normalize(e="GET"){return Array.isArray(e)||(e=[e]),e.forEach(e=>e==i||"HEAD"==e?"GET":e.toUpperCase()),e}r.addPseudo("once",(function(e){return e.cb=function(){const t=this,r=e.fn.apply(t,arguments);return t.off(e.name,e.fn),r},this}));class n{constructor(){this.routers=Object.create(i),this.defaultRouter=Object.create(i)}getRouter(e){const t=e!=i&&e.request.method||"GET",r=this.routers[t]||[],n=r.length;let s,a=0;for(;a{t in this.routers||(this.routers[t]=[]),this.routers[t].push(e)}),this}unregisterRoute(e,t){return normalize(t).forEach(t=>{const r=this.routers[t]||[],n=r.indexOf(e);-1!=n&&r.splice(n,1)}),this}setDefaultRouter(e,t){normalize(t).forEach(t=>this.defaultRouter[t]=e)}getDefaultRouter(){for(let e in this.defaultRouter)return this.defaultRouter[e];return i}}e.merge(!0,n.prototype,r);class s{constructor(e,t,r=null){const n=this;n.plugins=[],n.options=Object.assign(Object.create(i),{mime:[]},r||{}),n.path=e,n.strategy=t.name,n.handler={handle:async e=>{let r,s;for(r of n.plugins)try{if(s=await r.precheck(e),s instanceof Response)return s}catch(e){console.error({error:e})}if(s=await t.handle(e),s instanceof Response)for(r of n.plugins)try{await r.postcheck(e,s)}catch(e){console.error(e.message)}return s}}}addPlugin(e){return this.plugins.includes(e)||this.plugins.push(e),this}match(e,t){return!0}}e.merge(!0,s.prototype,r);class a extends s{match(e,t){const r=e.request.url;return/^https?:/.test(r)&&this.path.test(r)||this.options.mime.includes(e.request.headers.get("Content-Type"))||t!=i&&this.options.mime.includes(t.headers.get("Content-Type"))}}class o extends s{constructor(e,t,r=null){super(e,t,r),this.url=new URL(e,self.origin)}match(e,t){const r=e.request.url,n=new URL(r);return/^https?:/.test(r)&&n.origin==this.url.origin&&0==n.pathname.indexOf(this.url.pathname)||this.options.mime.includes(e.request.headers.get("Content-Type"))||t!=i&&this.options.mime.includes(t.headers.get("Content-Type"))}}const i=null,c=Object.create(i);function hashCode(e){var t,r=0;if(0===e.length)return r;for(t=0;ta+=t+":"+getObjectHash(e)+","),","==a[a.length-1]&&(a=a.substr(0,a.length-2)),a+="}";else{for(n of(a+="[",r))a+=getObjectHash(n)+",";","==a[a.length-1]&&(a=a.substr(0,a.length-2)),a+="]"}else a+="{"+getObjectHash(r)+"}";else a+=""+r;else a+=JSON.stringify(r);a+=","}","==a[a.length-1]&&(a=a.substr(0,a.length-2)),Array.isArray(e)?a="["+a+"]":"object"==typeof e&&(a="{"+a+"}")}return a}function num2FileSize(e,t){if(0==e)return 0;const r=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,Math.floor(r))).toFixed(2)+" "+(t&&t[r]?t[r]:["b","Kb","Mb","Gb","Tb","Pb"][r])}function sprintf(e){let t,r=-1;const n=[].slice.apply(arguments).slice(1);return e.replace(/%([s%])/g,(function(e,s){if("%"==s)return s;switch(t=n[++r],s){case"s":return null==t?"":t}}))}function ellipsis(e,t=30,r=15,n="..."){return e.length>t?e.slice(0,t-r-n.length+1)+n+e.slice(e.length-r+1):e}let l;e.merge(!0,c,r),Object.defineProperties(c,{app:{value:Object.create(i)},routes:{value:new n}}),Object.defineProperties(c.app,{name:{value:"gzip",enumerable:!0},scope:{value:"{scope}",enumerable:!0},route:{value:"{ROUTE}",enumerable:!0},cacheName:{value:"{CACHE_NAME}",enumerable:!0},codeName:{value:"Joomla Website Optimizer Plugin",enumerable:!0},build:{value:"{VERSION}",enumerable:!0},buildid:{value:"a484bf1",enumerable:!0},builddate:{value:"2020-09-20 11:24:40-04:00",enumerable:!0},urls:{value:"{CDN_HOSTS}",enumerable:!0},backgroundSync:{value:"{BACKGROUND_SYNC}",enumerable:!0},offline:{value:"{pwa_offline_page}"},network:{value:"{pwa_cache_settings}"},customNetwork:{value:"{pwa_custom_cache_settings}"},precache:{value:"{preloaded_urls}".map(e=>new URL(e,self.origin).href),enumerable:!0},homepage:{value:"https://github.com/tbela99/gzip",enumerable:!0}}),caches.open(c.app.cacheName).then(e=>l=e);class u{constructor(e){this.setOptions(e)}getRouteTag(e){const t=c.app.route;let r;for(r of c.app.urls)if(new RegExp("^https?://"+r+c.app.scope+t+"/").test(e))return t;return i}async setOptions(e){const t=new Date,r=+t;this.maxAge=0,this.limit=+e.limit||0,this.maxFileSize=+e.maxFileSize||0;const n=e.maxAge.match(/([+-]?\d+)(.*)$/);if(null!=n)switch(n[2]){case"months":case"minutes":case"hours":let e=(s=n[2])[0].toUpperCase()+s.slice(1);"Months"==e&&(e="Month"),t["set"+e](+n[1]+t["get"+e]()),this.maxAge=t-r}var s;this.db=await DB(e.cacheName!=i?e.cacheName:"gzip_sw_worker_expiration_cache_private","url",[{name:"url",key:"url"},{name:"version",key:"version"},{name:"route",key:"route"}])}async precheck(e){try{if(this.db==i||0==this.maxAge)return!0;const t=hashCode(getObjectHash(e.request)),r=await this.db.get(e.request.url,"url");return r!=i&&(r.version!=t||r.timestamp0&&t.body!=i){const e=await t.clone().blob();if(e.size>this.maxFileSize)throw sprintf("cache limit exceeded. Deleting item [%s]",ellipsis(t.url)),await this.db.delete(t.url),await l.delete(t),new Error(sprintf("[%s][cache failed] cache size limit exceeded %s of %s",ellipsis(t.url,42),num2FileSize(e.size),num2FileSize(this.maxFileSize)))}try{const t=e.request.url,r=await this.db.get(t,"url"),n=hashCode(getObjectHash(e.request));return r==i||r.version!=n||r.timestampt instanceof Response&&("cors"==t.type||new URL(e.url,self.origin).origin==self.origin)&&"GET"==e.method&&t.ok&&["default","cors","basic","navigate"].includes(t.type)&&!t.bodyUsed,h=new Map,f={add:(e,t,r)=>h.set(e,{key:e,name:r==i?e:r,handle:async e=>await t(e)}),keys:()=>h.keys(),values:()=>h.values(),entries:()=>h.entries(),get:e=>h.get(e),has:e=>h.has(e),delete:e=>h.delete(e),isCacheableRequest:isCacheableRequest};f[Symbol.iterator]=()=>h[Symbol.iterator](),Object.defineProperty(f,"size",{get:()=>h.size});const p=c.app.cacheName,d=c.app.cacheName,m=c.app.cacheName,g=c.app.cacheName;f.add("cf",(async function(e){let t=await caches.match(e.request,{cacheName:p});if(null!=t)return t;if(t=await fetch(e.request),f.isCacheableRequest(e.request,t)){const r=t.clone();caches.open(p).then(t=>t.put(e.request,r))}return t}),"Cache fallback to Network"),f.add("cn",(async function(e){const t=await caches.match(e.request,{cacheName:d}),r=fetch(e.request).then(t=>{if(f.isCacheableRequest(e.request,t)){const r=t.clone();caches.open(d).then(t=>t.put(e.request,r))}return t}).catch(()=>{});return t||r}),"Cache and Network Update"),f.add("co",(async function(e){return await caches.match(e.request,{cacheName:m})}),"Cache Only"),f.add("nf",(async function(e){try{const t=await fetch(e.request);if(null==t)throw new Error("Network error");if(f.isCacheableRequest(e.request,t)){const r=t.clone();caches.open(g).then(t=>t.put(e.request,r))}return t}catch(e){}return caches.match(e.request,{cacheName:g})}),"Network fallback to Cache"),f.add("no",(async function(e){return fetch(e.request)}),"Network Only"),self.addEventListener("activate",e=>{e.waitUntil((async()=>{try{await c.resolve("activate",e)}catch(e){console.error("ðŸ˜",e)}return self.clients.claim()})())}),self.addEventListener("fetch",e=>{e.respondWith(async function(){if(!e.url||"only-if-cached"===e.request.cache&&"same-origin"!==e.request.mode)return fetch(e.request);let t;const r=c.routes.getRouter(e);if(r!=i)try{if(t=await r.handler.handle(e),t instanceof Response)return t;for(t of await c.routes.resolve("fail",e,t))if(t instanceof Response)return t}catch(e){console.error("ðŸ˜",e)}return fetch(e.request)}())}),self.addEventListener("install",e=>{e.waitUntil((async()=>{try{await c.resolve("install",e)}catch(e){console.error("ðŸ˜",e)}return self.skipWaiting()})())});const y=["method","referrer","referrerPolicy","mode","credentials","cache","redirect","integrity","keepalive"];class w{async push(e){const t=await this.cloneRequestData(e),r=await this.getDB();return await r.put({id:hashCode(e.url+y.map(async e=>{let r=t[e];return r==i?"":"headers"==e?r instanceof Headers?[...r.values()].filter(e=>e!=i).join(""):Object.values(r).map(r=>t[e][r]!=i?t[e][r]:"").join(""):"body"==e?await r.text():r}).join("")),lastRetry:Date.now()+864e5,url:e.url,request:t}),this}async cloneRequestData(e){const t={headers:{}};"GET"!==e.method&&(t.body=await e.clone().arrayBuffer());for(const[r,n]of e.headers.entries())t.headers[r]=n;for(const r of y)void 0!==e[r]&&(t[r]=e[r]);return"navigate"===t.mode&&(t.mode="same-origin"),t}async getDB(){return this.db==i&&(this.db=await DB("gzip_sw_worker_sync_requests","id")),this.db}async replay(e){if("{SYNC_API_TAG}"!=e)return;const t=await this.getDB(),r=await t.getAll();r.length;const n=await caches.open("{CACHE_NAME}");for(const e of r){let r=!1;try{e.request.method,e.url;const t=new Request(e.url,e.request);let s=await n.match(t);r=s!=i,r||(s=await fetch(t.clone()),r=s!=i&&s.ok,r&&isCacheableRequest(t,s)&&await n.put(t,s))}catch(e){}(r||e.lastRetry<=Date.now())&&await t.delete(e.id)}}}if(c.app.backgroundSync.enabled){const e=new w;c.on({async install(){for(const e of["gzip_sw_worker_sync_requests","gzip_sw_worker_sync_tasks"]){const t=await DB(e,"id");null!=t&&await t.clear()}}}),c.routes.on({fail(t,r){const n=c.app.backgroundSync;if(0==n.length||-1!=n.method.indexOf(t.method)){const r=t.url.replace(self.origin,"");if(0==n.pattern.length||n.pattern.some(e=>0==r.indexOf(e)))return e.push(t)}}}),self.addEventListener("sync",(function(t){t.tag,t.waitUntil(e.replay(t.tag).catch(e=>console.error({error:e})))}))}c.app.network.limit>0&&self.addEventListener("sync",async e=>{const t=await async function(){let e=await caches.open("{CACHE_NAME}");const t="{preloaded_urls}".map(e=>new URL(e,self.origin).href),r="{pwa_cache_max_file_count}",n=await DB("gzip_sw_worker_expiration_cache_private","url",[{name:"url",key:"url"},{name:"version",key:"version"},{name:"route",key:"route"}]);return async function(){let s=await n.count();if(s>r){sprintf("cleaning up [%s] items present. [%s] items allowed",s,r);for(let a of await n.getAll())if(t.includes(a.url))sprintf("skipped preloaded resource [%s]",a.url);else if(sprintf("removing [%s]",a.url),await e.delete(a.url),await n.delete(a.url),--s<=r)break;sprintf("cleaned up [%s] items present. [%s] items allowed",s,r)}}}();e.waitUntil(t())}),c.app.offline.enabled&&c.routes.on("fail",async e=>{if("navigate"==e.request.mode&&c.app.offline.methods.includes(e.request.method)){if("response"==c.app.offline.type)return new Response(c.app.offline.body,{headers:new Headers({"Content-Type":'text/html; charset="{offline_charset}"'})});if(""!=c.app.offline.url)return caches.match(c.app.offline.url)}});const b=c.routes,v=c.app.scope,k=c.app.network,O=k.caching;let _,R,x,q,j,A,E;({limit:j,maxAge:x,cacheName:A,strategy:E,maxFileSize:q}=k);const N={limit:j,maxAge:x,strategy:E,maxFileSize:q};for(_ of"{exclude_urls}")b.registerRoute(new a(new RegExp(_),f.get("no")));for(_ of k.settings)R=new a(new RegExp("("+_.ext.join(")|(")+")","i"),f.get(_.strategy),_),O&&(({limit:j,maxAge:x,maxFileSize:q}=_),R.addPlugin(new u({limit:j,maxAge:x,maxFileSize:q}))),b.registerRoute(R);for(_ of f)R=new o(v+"{ROUTE}/media/z/"+_[0]+"/",_[1]),O&&R.addPlugin(new u(N)),b.registerRoute(R),c.app.customNetwork.forEach(e=>{let t=v+"{ROUTE}/"+_[0]+"/"+e.prefix+"/";delete e.prefix;let r=new o(t,e);r.addPlugin(new u(e)),b.registerRoute(r)});R=new o(v,f.get(k.strategy)),O&&R.addPlugin(new u(N)),b.setDefaultRouter(R),A=c.app.cacheName,c.on({error(e,t){console.error({error:e,event:t})},async install(){await caches.open(A).then(async e=>await e.addAll(c.app.precache))},async activate(){const e=await DB("gzip_sw_worker_config_cache_private","name"),t=await e.get("gzip");if(t!=i&&"{ROUTE}"!=t.route){let e,t;for(e of"{STORES}")t=await DB(e,"url",[{name:"url",key:"url"},{name:"version",key:"version"},{name:"route",key:"route"}]),t!=i&&t.clear()}await e.put(c.app);const r=await caches.keys(),n=A.split(/_/,2),s=2==n.length&&n[0]+"_";0!=s&&await Promise.all(r.map(e=>0==e.indexOf(s)&&e!=A&&caches.delete(e)))}})}();
\ No newline at end of file
+!function(){"use strict";async function DB(e,t="id",r=[]){return new Promise((n,s)=>{const a=indexedDB.open(e,1),o=`${e}_store`;let i;const _query=(e,t,r=null,n=null)=>new Promise((s,a)=>{const c=t?"readonly":"readwrite";if(i.objectStoreNames.contains(o)){const t=i.transaction(o,c),l=t.objectStore(o);let u;"put"===e&&r&&void 0!==r.length?(u=t,r.forEach(e=>{l.put(e)})):(n&&l.index(n),u=l[e](r)),u.oncomplete=e=>{s(e.target.result)},u.onsuccess=e=>{s(e.target.result)},u.onerror=e=>{a(e)}}else a(new Error("Store not found"))}),c={count:async()=>{const e=i.transaction(o,"readonly").objectStore(o).count();return new Promise((function(t,r){e.onsuccess=function(e){t(e.target.result)},e.onerror=function(e){r(e)}}))},get:(e,t)=>_query("get",!0,e,t),getAll:(e,t)=>_query("getAll",!0,e,t),put:e=>_query("put",!1,e),delete:e=>_query("delete",!1,e),clear:()=>_query("clear",!1),deleteDatabase:()=>new Promise((function(e,t){const r=indexedDB.deleteDatabase;r.onerror=t,r.onsuccess=e}))};a.onupgradeneeded=(()=>{i=a.result;const e=i.createObjectStore(o,{keyPath:t});let n;for(n of r)e.createIndex(n.name,n.key,n.options)}).bind(this),a.onsuccess=(()=>{i=a.result,n(c)}).bind(this),a.onerror=(e=>{s(new Error(e.originalTarget&&e.originalTarget.error||e))}).bind(this)})}const e={implement(e){const t=e.prototype,r=[].slice.call(arguments,1);let n,s,a;function makefunc(e,t,r){return function(){const n=this,s="previous"in n,a="parent"in n,o=n.previous,i=n.parent;n.previous=t,n.parent=r;const c=e.apply(n,arguments);return s&&(n.previous=o),a&&(n.parent=i),c}}for(n=0;nfunction(t){if("object"==typeof t){const r=[].slice.call(arguments,1);let n;for(n in t)e.apply(this,[n,t[n]].concat(r))}else e.apply(this,arguments);return this}};function merge(e){const t=[].slice.call(arguments,1);let r,n,s,a,o="boolean"==typeof e;for(!0===o&&(o=e,e=t.shift()),r=0;r1?[].slice.call(arguments,1):[];return Promise.all((t.$events[e]||[]).concat().map(e=>new Promise(n=>{n(e.cb.apply(t,r))})))},addPseudo(e,t){return this.$pseudo[e]=t,this}};function normalize(e="GET"){return Array.isArray(e)||(e=[e]),e.forEach(e=>e==i||"HEAD"==e?"GET":e.toUpperCase()),e}r.addPseudo("once",(function(e){return e.cb=function(){const t=this,r=e.fn.apply(t,arguments);return t.off(e.name,e.fn),r},this}));class n{constructor(){this.routers=Object.create(i),this.defaultRouter=Object.create(i)}getRouter(e){const t=e!=i&&e.request.method||"GET",r=this.routers[t]||[],n=r.length;let s,a=0;for(;a{t in this.routers||(this.routers[t]=[]),this.routers[t].push(e)}),this}unregisterRoute(e,t){return normalize(t).forEach(t=>{const r=this.routers[t]||[],n=r.indexOf(e);-1!=n&&r.splice(n,1)}),this}setDefaultRouter(e,t){normalize(t).forEach(t=>this.defaultRouter[t]=e)}getDefaultRouter(){for(let e in this.defaultRouter)return this.defaultRouter[e];return i}}e.merge(!0,n.prototype,r);class s{constructor(e,t,r=null){const n=this;n.plugins=[],n.options=Object.assign(Object.create(i),{mime:[]},r||{}),n.path=e,n.strategy=t.name,n.handler={handle:async e=>{let r,s;for(r of n.plugins)try{if(s=await r.precheck(e),s instanceof Response)return s}catch(e){console.error({error:e})}if(s=await t.handle(e),s instanceof Response)for(r of n.plugins)try{await r.postcheck(e,s)}catch(e){console.error(e.message)}return s}}}addPlugin(e){return this.plugins.includes(e)||this.plugins.push(e),this}match(e,t){return!0}}e.merge(!0,s.prototype,r);class a extends s{match(e,t){const r=e.request.url;return/^https?:/.test(r)&&this.path.test(r)||this.options.mime.includes(e.request.headers.get("Content-Type"))||t!=i&&this.options.mime.includes(t.headers.get("Content-Type"))}}class o extends s{constructor(e,t,r=null){super(e,t,r),this.url=new URL(e,self.origin)}match(e,t){const r=e.request.url,n=new URL(r);return/^https?:/.test(r)&&n.origin==this.url.origin&&0==n.pathname.indexOf(this.url.pathname)||this.options.mime.includes(e.request.headers.get("Content-Type"))||t!=i&&this.options.mime.includes(t.headers.get("Content-Type"))}}const i=null,c=Object.create(i);function hashCode(e){var t,r=0;if(0===e.length)return r;for(t=0;ta+=t+":"+getObjectHash(e)+","),","==a[a.length-1]&&(a=a.substr(0,a.length-2)),a+="}";else{for(n of(a+="[",r))a+=getObjectHash(n)+",";","==a[a.length-1]&&(a=a.substr(0,a.length-2)),a+="]"}else a+="{"+getObjectHash(r)+"}";else a+=""+r;else a+=JSON.stringify(r);a+=","}","==a[a.length-1]&&(a=a.substr(0,a.length-2)),Array.isArray(e)?a="["+a+"]":"object"==typeof e&&(a="{"+a+"}")}return a}function num2FileSize(e,t){if(0==e)return 0;const r=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,Math.floor(r))).toFixed(2)+" "+(t&&t[r]?t[r]:["b","Kb","Mb","Gb","Tb","Pb"][r])}function sprintf(e){let t,r=-1;const n=[].slice.apply(arguments).slice(1);return e.replace(/%([s%])/g,(function(e,s){if("%"==s)return s;switch(t=n[++r],s){case"s":return null==t?"":t}}))}function ellipsis(e,t=30,r=15,n="..."){return e.length>t?e.slice(0,t-r-n.length+1)+n+e.slice(e.length-r+1):e}let l;e.merge(!0,c,r),Object.defineProperties(c,{app:{value:Object.create(i)},routes:{value:new n}}),Object.defineProperties(c.app,{name:{value:"gzip",enumerable:!0},scope:{value:"{scope}",enumerable:!0},route:{value:"{ROUTE}",enumerable:!0},cacheName:{value:"{CACHE_NAME}",enumerable:!0},codeName:{value:"Joomla Website Optimizer Plugin",enumerable:!0},build:{value:"{VERSION}",enumerable:!0},buildid:{value:"build-id",enumerable:!0},builddate:{value:"build-date",enumerable:!0},urls:{value:"{CDN_HOSTS}",enumerable:!0},backgroundSync:{value:"{BACKGROUND_SYNC}",enumerable:!0},offline:{value:"{pwa_offline_page}"},network:{value:"{pwa_cache_settings}"},customNetwork:{value:"{pwa_custom_cache_settings}"},precache:{value:"{preloaded_urls}".map(e=>new URL(e,self.origin).href),enumerable:!0},homepage:{value:"https://github.com/tbela99/gzip",enumerable:!0}}),caches.open(c.app.cacheName).then(e=>l=e);class u{constructor(e){this.setOptions(e)}getRouteTag(e){const t=c.app.route;let r;for(r of c.app.urls)if(new RegExp("^https?://"+r+c.app.scope+t+"/").test(e))return t;return i}async setOptions(e){const t=new Date,r=+t;this.maxAge=0,this.limit=+e.limit||0,this.maxFileSize=+e.maxFileSize||0;const n=e.maxAge.match(/([+-]?\d+)(.*)$/);if(null!=n)switch(n[2]){case"months":case"minutes":case"hours":let e=(s=n[2])[0].toUpperCase()+s.slice(1);"Months"==e&&(e="Month"),t["set"+e](+n[1]+t["get"+e]()),this.maxAge=t-r}var s;this.db=await DB(e.cacheName!=i?e.cacheName:"gzip_sw_worker_expiration_cache_private","url",[{name:"url",key:"url"},{name:"version",key:"version"},{name:"route",key:"route"}])}async precheck(e){try{if(this.db==i||0==this.maxAge)return!0;const t=hashCode(getObjectHash(e.request)),r=await this.db.get(e.request.url,"url");return r!=i&&(r.version!=t||r.timestamp0&&t.body!=i){const e=await t.clone().blob();if(e.size>this.maxFileSize)throw sprintf("cache limit exceeded. Deleting item [%s]",ellipsis(t.url)),await this.db.delete(t.url),await l.delete(t),new Error(sprintf("[%s][cache failed] cache size limit exceeded %s of %s",ellipsis(t.url,42),num2FileSize(e.size),num2FileSize(this.maxFileSize)))}try{const t=e.request.url,r=await this.db.get(t,"url"),n=hashCode(getObjectHash(e.request));return r==i||r.version!=n||r.timestampt instanceof Response&&("cors"==t.type||new URL(e.url,self.origin).origin==self.origin)&&"GET"==e.method&&t.ok&&["default","cors","basic","navigate"].includes(t.type)&&!t.bodyUsed,h=new Map,f={add:(e,t,r)=>h.set(e,{key:e,name:r==i?e:r,handle:async e=>await t(e)}),keys:()=>h.keys(),values:()=>h.values(),entries:()=>h.entries(),get:e=>h.get(e),has:e=>h.has(e),delete:e=>h.delete(e),isCacheableRequest:isCacheableRequest};f[Symbol.iterator]=()=>h[Symbol.iterator](),Object.defineProperty(f,"size",{get:()=>h.size});const p=c.app.cacheName,d=c.app.cacheName,m=c.app.cacheName,g=c.app.cacheName;f.add("cf",(async function(e){let t=await caches.match(e.request,{cacheName:p});if(null!=t)return t;if(t=await fetch(e.request),f.isCacheableRequest(e.request,t)){const r=t.clone();caches.open(p).then(t=>t.put(e.request,r))}return t}),"Cache fallback to Network"),f.add("cn",(async function(e){const t=await caches.match(e.request,{cacheName:d}),r=fetch(e.request).then(t=>{if(f.isCacheableRequest(e.request,t)){const r=t.clone();caches.open(d).then(t=>t.put(e.request,r))}return t}).catch(()=>{});return t||r}),"Cache and Network Update"),f.add("co",(async function(e){return await caches.match(e.request,{cacheName:m})}),"Cache Only"),f.add("nf",(async function(e){try{const t=await fetch(e.request);if(null==t)throw new Error("Network error");if(f.isCacheableRequest(e.request,t)){const r=t.clone();caches.open(g).then(t=>t.put(e.request,r))}return t}catch(e){}return caches.match(e.request,{cacheName:g})}),"Network fallback to Cache"),f.add("no",(async function(e){return fetch(e.request)}),"Network Only"),self.addEventListener("activate",e=>{e.waitUntil((async()=>{try{await c.resolve("activate",e)}catch(e){console.error("ðŸ˜",e)}return self.clients.claim()})())}),self.addEventListener("fetch",e=>{e.respondWith(async function(){if(!e.url||"only-if-cached"===e.request.cache&&"same-origin"!==e.request.mode)return;let t;const r=c.routes.getRouter(e);if(r!=i)try{if(t=await r.handler.handle(e),t instanceof Response)return t;for(t of await c.routes.resolve("fail",e,t))if(t instanceof Response)return t}catch(e){console.error("ðŸ˜",e)}return fetch(e.request)}())}),self.addEventListener("install",e=>{e.waitUntil((async()=>{try{await c.resolve("install",e)}catch(e){console.error("ðŸ˜",e)}return self.skipWaiting()})())});const y=["method","referrer","referrerPolicy","mode","credentials","cache","redirect","integrity","keepalive"];class w{async push(e){const t=await this.cloneRequestData(e),r=await this.getDB();return await r.put({id:hashCode(e.url+y.map(async e=>{let r=t[e];return r==i?"":"headers"==e?r instanceof Headers?[...r.values()].filter(e=>e!=i).join(""):Object.values(r).map(r=>t[e][r]!=i?t[e][r]:"").join(""):"body"==e?await r.text():r}).join("")),lastRetry:Date.now()+864e5,url:e.url,request:t}),this}async cloneRequestData(e){const t={headers:{}};"GET"!==e.method&&(t.body=await e.clone().arrayBuffer());for(const[r,n]of e.headers.entries())t.headers[r]=n;for(const r of y)void 0!==e[r]&&(t[r]=e[r]);return"navigate"===t.mode&&(t.mode="same-origin"),t}async getDB(){return this.db==i&&(this.db=await DB("gzip_sw_worker_sync_requests","id")),this.db}async replay(e){if("{SYNC_API_TAG}"!=e)return;const t=await this.getDB(),r=await t.getAll();r.length;const n=await caches.open("{CACHE_NAME}");for(const e of r){let r=!1;try{e.request.method,e.url;const t=new Request(e.url,e.request);let s=await n.match(t);r=s!=i,r||(s=await fetch(t.clone()),r=s!=i&&s.ok,r&&isCacheableRequest(t,s)&&await n.put(t,s))}catch(e){}(r||e.lastRetry<=Date.now())&&await t.delete(e.id)}}}if(c.app.backgroundSync.enabled){const e=new w;c.on({async install(){for(const e of["gzip_sw_worker_sync_requests","gzip_sw_worker_sync_tasks"]){const t=await DB(e,"id");null!=t&&await t.clear()}}}),c.routes.on({fail(t,r){const n=c.app.backgroundSync;if(0==n.length||-1!=n.method.indexOf(t.method)){const r=t.url.replace(self.origin,"");if(0==n.pattern.length||n.pattern.some(e=>0==r.indexOf(e)))return e.push(t)}}}),self.addEventListener("sync",(function(t){t.tag,t.waitUntil(e.replay(t.tag).catch(e=>console.error({error:e})))}))}c.app.network.limit>0&&self.addEventListener("sync",async e=>{const t=await async function(){let e=await caches.open("{CACHE_NAME}");const t="{preloaded_urls}".map(e=>new URL(e,self.origin).href),r="{pwa_cache_max_file_count}",n=await DB("gzip_sw_worker_expiration_cache_private","url",[{name:"url",key:"url"},{name:"version",key:"version"},{name:"route",key:"route"}]);return async function(){let s=await n.count();if(s>r){sprintf("cleaning up [%s] items present. [%s] items allowed",s,r);for(let a of await n.getAll())if(t.includes(a.url))sprintf("skipped preloaded resource [%s]",a.url);else if(sprintf("removing [%s]",a.url),await e.delete(a.url),await n.delete(a.url),--s<=r)break;sprintf("cleaned up [%s] items present. [%s] items allowed",s,r)}}}();e.waitUntil(t())}),c.app.offline.enabled&&c.routes.on("fail",async e=>{if("navigate"==e.request.mode&&c.app.offline.methods.includes(e.request.method)){if("response"==c.app.offline.type)return new Response(c.app.offline.body,{headers:new Headers({"Content-Type":'text/html; charset="{offline_charset}"'})});if(""!=c.app.offline.url)return caches.match(c.app.offline.url)}});const b=c.routes,v=c.app.scope,k=c.app.network,O=k.caching;let _,R,x,q,j,A,E;({limit:j,maxAge:x,cacheName:A,strategy:E,maxFileSize:q}=k);const N={limit:j,maxAge:x,strategy:E,maxFileSize:q};for(_ of"{exclude_urls}")b.registerRoute(new a(new RegExp(_),f.get("no")));for(_ of k.settings)R=new a(new RegExp("("+_.ext.join(")|(")+")","i"),f.get(_.strategy),_),O&&(({limit:j,maxAge:x,maxFileSize:q}=_),R.addPlugin(new u({limit:j,maxAge:x,maxFileSize:q}))),b.registerRoute(R);for(_ of f)R=new o(v+"{ROUTE}/media/z/"+_[0]+"/",_[1]),O&&R.addPlugin(new u(N)),b.registerRoute(R),c.app.customNetwork.forEach(e=>{let t=v+"{ROUTE}/"+_[0]+"/"+e.prefix+"/";delete e.prefix;let r=new o(t,e);r.addPlugin(new u(e)),b.registerRoute(r)});R=new o(v,f.get(k.strategy)),O&&R.addPlugin(new u(N)),b.setDefaultRouter(R),A=c.app.cacheName,c.on({error(e,t){console.error({error:e,event:t})},async install(){await caches.open(A).then(async e=>await e.addAll(c.app.precache))},async activate(){const e=await DB("gzip_sw_worker_config_cache_private","name"),t=await e.get("gzip");if(t!=i&&"{ROUTE}"!=t.route){let e,t;for(e of"{STORES}")t=await DB(e,"url",[{name:"url",key:"url"},{name:"version",key:"version"},{name:"route",key:"route"}]),t!=i&&t.clear()}await e.put(c.app);const r=await caches.keys(),n=A.split(/_/,2),s=2==n.length&&n[0]+"_";0!=s&&await Promise.all(r.map(e=>0==e.indexOf(s)&&e!=A&&caches.delete(e)))}})}();
\ No newline at end of file
diff --git a/worker/src/browser.administrator.js b/worker/src/browser.administrator.js
index fbfaed6..0b1ac0e 100644
--- a/worker/src/browser.administrator.js
+++ b/worker/src/browser.administrator.js
@@ -11,7 +11,7 @@
// @ts-check
-// build build-id build-date
+// build build-id 2020-10-14 21:09:16-04:00
if ("serviceWorker" in navigator) {
navigator.serviceWorker.
diff --git a/worker/src/browser.js b/worker/src/browser.js
index 1f25def..3205dcd 100644
--- a/worker/src/browser.js
+++ b/worker/src/browser.js
@@ -11,7 +11,7 @@
// @ts-check
-// build build-id build-date
+// build build-id 2020-10-14 21:09:16-04:00
if ("serviceWorker" in navigator) {
navigator.serviceWorker.
diff --git a/worker/src/browser.uninstall.js b/worker/src/browser.uninstall.js
index 4783de7..c4a7f74 100644
--- a/worker/src/browser.uninstall.js
+++ b/worker/src/browser.uninstall.js
@@ -10,7 +10,7 @@
*/
// @ts-check
-// build build-id build-date
+// build build-id 2020-10-14 21:09:16-04:00
if ("serviceWorker" in navigator && navigator.serviceWorker.controller) {
navigator.serviceWorker.getRegistration().then(function (registration) {
diff --git a/worker/src/service/sw.service.fetch.js b/worker/src/service/sw.service.fetch.js
index 3d807e3..1148b9f 100644
--- a/worker/src/service/sw.service.fetch.js
+++ b/worker/src/service/sw.service.fetch.js
@@ -25,7 +25,7 @@ self.addEventListener("fetch", (event) => {
if (!event.url || (event.request.cache === 'only-if-cached' && event.request.mode !== 'same-origin')) {
- return fetch(event.request);
+ return;
}
let response;
diff --git a/worker_version b/worker_version
index 2d387b6..8822c63 100644
--- a/worker_version
+++ b/worker_version
@@ -1 +1 @@
-cde1d7edd1e8fb2e1cf5f1855bebd34b58b142e0
+acc113672222df687cf6060cf858c6e590e638a8