/* PWA v0.8.0-alpha-731fa89-20230324T203751Z-front */ /* Note: This file is dynamically generated. To manipulate the contents of this file, use the `wp_front_service_worker` action in WordPress. /* /* Source wp-base-config: */ !function(){"use strict";try{self["workbox:sw:6.5.4"]&&_()}catch(t){}const t={backgroundSync:"background-sync",broadcastUpdate:"broadcast-update",cacheableResponse:"cacheable-response",core:"core",expiration:"expiration",googleAnalytics:"offline-ga",navigationPreload:"navigation-preload",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams",recipes:"recipes"};self.workbox=new class{constructor(){return this.v={},this.Pt={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.$t=this.Pt.debug?"dev":"prod",this.Ct=!1,new Proxy(this,{get(e,s){if(e[s])return e[s];const o=t[s];return o&&e.loadModule("workbox-"+o),e[s]}})}setConfig(t={}){if(this.Ct)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.Pt,t),this.$t=this.Pt.debug?"dev":"prod"}loadModule(t){const e=this.jt(t);try{importScripts(e),this.Ct=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}jt(t){if(this.Pt.modulePathCb)return this.Pt.modulePathCb(t,this.Pt.debug);let e=["https://storage.googleapis.com/workbox-cdn/releases/6.5.4"];const s=`${t}.${this.$t}.js`,o=this.Pt.modulePathPrefix;return o&&(e=o.split("/"),""===e[e.length-1]&&e.splice(e.length-1,1)),e.push(s),e.join("/")}}}(); workbox.setConfig( {"debug":false,"modulePathPrefix":"https:\/\/weston.ruter.net\/wp-content\/plugins\/pwa\/wp-includes\/js\/workbox-v6.5.4\/"} ); workbox.core.setCacheNameDetails( {"prefix":"wp-\/","precache":"precache-front","suffix":"v1"} ); self.skipWaiting(); workbox.core.clientsClaim(); /* global workbox */ /** * Handle registering caching strategies. */ if (!self.wp) { self.wp = {}; } wp.serviceWorker = workbox; /* * Skip the waiting phase for the Service Worker when a message with a 'skipWaiting' action is sent from a client. * Note that this message is not currently being sent in the codebase, but the logic remains here to provide a * mechanism for clients to skip waiting if they want to. */ self.addEventListener('message', function (event) { if (!event.data) { return; } if ( // De facto standard used by Workbox. event.data.type === 'SKIP_WAITING' || // Obsolete message sent in older versions of the plugin. 'skipWaiting' === event.data.action ) { self.skipWaiting(); } }); /* Source wp-precaching-routes: */ // IIFE is used for lexical scoping instead of just a braces block due to bug in Safari. (() => { wp.serviceWorker.precaching.precache([{"url":"https:\/\/weston.ruter.net\/?wp_error_template=offline","revision":"0.8.0-alpha-731fa89-20230324T203751Z;twentytwenty=2.3;options=75b610c07c2e17e6b2d2517fc81ff745;nav=4765d26e3b1d56aa1da540f6c6e2edab;deps=35915e58a68c5c95b5a4924dae1af7dd;eb8549125c4e13f533c6184529a5c701"},{"url":"https:\/\/weston.ruter.net\/?wp_error_template=500","revision":"0.8.0-alpha-731fa89-20230324T203751Z;twentytwenty=2.3;options=75b610c07c2e17e6b2d2517fc81ff745;nav=4765d26e3b1d56aa1da540f6c6e2edab;deps=35915e58a68c5c95b5a4924dae1af7dd;eb8549125c4e13f533c6184529a5c701"}]); // @todo Should not these parameters be specific to each entry as opposed to all entries? // @todo Should not the strategy be tied to each entry as well? // @todo Use networkFirst instead of cacheFirst when WP_DEBUG. wp.serviceWorker.precaching.addRoute({ ignoreUrlParametersMatching: [/^utm_/, /^wp-mce-/, /^ver$/], // @todo Add urlManipulation which allows for the list of ignoreUrlParametersMatching to be supplied with each entry. }); })(); /* Source amp-cdn-runtime-caching: */ // See AMP_Service_Workers::add_amp_runtime_caching() and . { self.addEventListener('install', (event) => { event.waitUntil( caches .open(wp.serviceWorker.core.cacheNames.runtime) .then((cache) => cache.addAll(["https:\/\/cdn.ampproject.org\/v0.js","https:\/\/cdn.ampproject.org\/v0\/amp-bind-0.1.js","https:\/\/cdn.ampproject.org\/v0\/amp-form-0.1.js","https:\/\/cdn.ampproject.org\/v0\/amp-install-serviceworker-0.1.js"])) ); }); } /* Source wp-offline-post-request-handling: */ // IIFE is used for lexical scoping instead of just a braces block due to bug with const in Safari. (() => { const errorMessages = {"clientOffline":"It seems you are offline. Please check your internet connection and try again.","serverOffline":"The server appears to be down, or your connection isn't working as expected. Please try again later.","error":"Something prevented the page from being rendered. Please try again.","submissionFailure":"Your submission failed. Please go back and try again."}; /** * Inject navigation request properties. * * @param {string} body * @param {Request} request * @param {Response} response * @return {string} Modified body. */ const injectNavigationRequestProperties = (body, request, response) => { return body.replace( '{{{WP_NAVIGATION_REQUEST_PROPERTIES}}}', JSON.stringify({ method: request.method, status: response.status, }) ); }; const offlinePostRequestHandler = ({ event }) => { return fetch(event.request) .then((response) => { if (response.status < 500) { return response; } // @todo This is duplicated with code in service-worker-navigation-routing.js. return response.text().then(function (errorText) { return caches .match( wp.serviceWorker.precaching.getCacheKeyForURL( "https:\/\/weston.ruter.net\/?wp_error_template=500" ) ) .then(function (errorResponse) { if (!errorResponse) { return response; } return errorResponse.text().then(function (text) { const init = { status: errorResponse.status, statusText: errorResponse.statusText, headers: errorResponse.headers, }; let body = text.replace( '{{{WP_SERVICE_WORKER_ERROR_MESSAGE}}}', `${errorMessages.error} ${errorMessages.submissionFailure}` ); body = injectNavigationRequestProperties( body, event.request, response ); body = body.replace( /({{{WP_SERVICE_WORKER_ERROR_TEMPLATE_BEGIN}}})((?:.|\n)+?)({{{WP_SERVICE_WORKER_ERROR_TEMPLATE_END}}})/, (details) => { if (!errorText) { return ''; // Remove the details from the document entirely. } const src = 'data:text/html;base64,' + btoa(errorText); // The errorText encoded as a text/html data URL. const srcdoc = errorText .replace(/&/g, '&') .replace(/'/g, ''') .replace(/"/g, '"') .replace(//g, '>'); const iframe = ``; details = details.replace( '{{{error_details_iframe}}}', iframe ); // The following are in case the user wants to include the `; details = details.replace( '{{{error_details_iframe}}}', iframe ); // The following are in case the user wants to include the