From 906464ede657e4ac3a59bca1af4ee044c86015de Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Fri, 6 Oct 2023 14:18:11 -0700 Subject: [PATCH] fix: ensure default index.html is served for app, only serve wabac.js index page when in embed mode, fixes #251 bump to 1.8.13 --- CHANGES.md | 3 + _data/package.json | 2 +- package.json | 2 +- src/appmain.js | 4 +- ui.js | 552 ++++++++++++++++++++++----------------------- 5 files changed, 284 insertions(+), 279 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5de882da..c580b3e1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ ## CHANGES +v1.8.13 +- Loading: Ensure default index.html is served when not in embed mode, don't add '?serveIndex=1' for app itself + v1.8.12 - Loading: Fixes embed 'Purge Cache + Reload', ensure '?serveIndex=1' is always set on all service worker loading diff --git a/_data/package.json b/_data/package.json index c8612354..682d4d56 100644 --- a/_data/package.json +++ b/_data/package.json @@ -1,7 +1,7 @@ { "name": "replaywebpage", "productName": "ReplayWeb.page", - "version": "1.8.12", + "version": "1.8.13", "description": "Serverless Web Archive Replay", "repository": "https://github.com/webrecorder/replayweb.page", "homepage": "https://replayweb.page/", diff --git a/package.json b/package.json index c8612354..682d4d56 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "replaywebpage", "productName": "ReplayWeb.page", - "version": "1.8.12", + "version": "1.8.13", "description": "Serverless Web Archive Replay", "repository": "https://github.com/webrecorder/replayweb.page", "homepage": "https://replayweb.page/", diff --git a/src/appmain.js b/src/appmain.js index ec267d8d..530fdc3b 100644 --- a/src/appmain.js +++ b/src/appmain.js @@ -426,7 +426,9 @@ class ReplayWebApp extends LitElement { if (this.useRuffle) { qp.set("injectScripts", "ruffle/ruffle.js"); } - qp.set("serveIndex", "1"); + if (this.embed) { + qp.set("serveIndex", "1"); + } query = qp.toString(); if (query.length) { name += "?" + query; diff --git a/ui.js b/ui.js index 2d59c68c..43f93e05 100644 --- a/ui.js +++ b/ui.js @@ -6,49 +6,49 @@ * Licence: Apache-2.0 * https://github.com/nextapps-de/flexsearch */ -function _f(self){"use strict";try{module&&(self=module)}catch(e){}var t;function u(e){return void 0===e||e}function aa(e){const t=Array(e);for(let i=0;i=a))));f++);if(i)return o?ta(l,a,0):void(t[t.length]=l)}return!i&&l}function ta(e,t,i){return e=1===e.length?e[0]:[].concat.apply([],e),i||e.length>t?e.slice(i,i+t):e}function ua(e,t,i,a){return i?e=(e=e[(a=a&&t>i)?t:i])&&e[a?i:t]:e=e[t],e}function N(e,t,i,a,r){let o=0;if(e.constructor===Array)if(r)-1!==(t=e.indexOf(t))?1=this.B&&(h||!d[u])){var o=L(f,a,b),n="";switch(this.G){case"full":if(2o;s--)if(s-o>=this.B){var l=L(f,a,b,r,o);M(this,d,n=u.substring(o,s),l,e,i)}break}case"reverse":if(1=this.B&&M(this,d,n,L(f,a,b,r,s),e,i);n=""}case"forward":if(1=this.B&&M(this,d,n,o,e,i);break}default:if(this.C&&(o=Math.min(o/this.C(t,u,b)|0,f-1)),M(this,d,u,o,e,i),h&&1=this.B&&!r[u]){r[u]=1;const t=this.l&&u>o;M(this,c,t?o:u,L(n+(a/2>n?0:1),a,b,s-1,l-1),e,i,t?u:o)}}}}this.m||(this.register[e]=1)}}return this},t.search=function(e,t,i){i||(!t&&C(e)?e=(i=e).query:C(t)&&(i=t));let a,r,o,n,s,l=[],c=0;if(i){e=i.query||e,t=i.limit,c=i.offset||0;var d=i.context;r=i.suggest}if(e&&(a=(e=this.encode(""+e)).length,1=this.B&&!i[t]){if(!(this.s||r||this.map[t]))return l;h[n++]=t,i[t]=1}a=(e=h).length}if(!a)return l;for(t||(t=100),i=0,(d=this.depth&&1t||i)&&(r=r.slice(i,i+t)),a&&(r=za.call(this,r)),{tag:e,result:r}}function za(e){const t=Array(e.length);for(let i,a=0;a{"use strict";const t=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],i=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],r=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],o=(e,t,i)=>{let a=e;return"string"==typeof t||Array.isArray(t)?a=e.toLocaleString(t,i):!0!==t&&void 0===i||(a=e.toLocaleString(void 0,i)),a};e.exports=(e,n)=>{if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);const s=(n=Object.assign({bits:!1,binary:!1},n)).bits?n.binary?r:a:n.binary?i:t;if(n.signed&&0===e)return` 0 ${s[0]}`;const l=e<0,c=l?"-":n.signed?"+":"";let d;if(l&&(e=-e),void 0!==n.minimumFractionDigits&&(d={minimumFractionDigits:n.minimumFractionDigits}),void 0!==n.maximumFractionDigits&&(d=Object.assign({maximumFractionDigits:n.maximumFractionDigits},d)),e<1){return c+o(e,n.locale,d)+" "+s[0]}const h=Math.min(Math.floor(n.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),s.length-1);e/=Math.pow(n.binary?1024:1e3,h),d||(e=e.toPrecision(3));return c+o(Number(e),n.locale,d)+" "+s[h]}},529:e=>{e.exports=''},873:e=>{e.exports=''},795:e=>{e.exports=''},29:e=>{e.exports=''},575:e=>{e.exports=''},199:e=>{e.exports=''},734:e=>{e.exports=''},636:e=>{e.exports=''},561:e=>{e.exports=''},536:e=>{e.exports=''},921:e=>{e.exports=''},442:e=>{e.exports=''},426:e=>{e.exports=''},430:e=>{e.exports=''},878:e=>{e.exports=''},124:e=>{e.exports=''},56:e=>{e.exports=''},998:e=>{e.exports=''},125:e=>{e.exports=''},732:e=>{e.exports=''},638:e=>{e.exports=''},164:e=>{e.exports=''},615:e=>{e.exports=''},885:e=>{e.exports=''},200:e=>{e.exports=''},368:e=>{e.exports=''},804:e=>{e.exports=''},690:e=>{e.exports=''},761:e=>{e.exports=''},302:e=>{e.exports=''},135:e=>{e.exports=''}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Chooser:()=>Ne,Coll:()=>ti,CollIndex:()=>Ye,CollInfo:()=>Xe,Embed:()=>fa,GDrive:()=>Fi,Loader:()=>Hi,PageEntry:()=>ia,Pages:()=>Yi,Replay:()=>aa,ReplayWebApp:()=>Me,Sorter:()=>la,Story:()=>Oi,URLResources:()=>ca}); +function _f(self){"use strict";try{module&&(self=module)}catch(e){}var t;function u(e){return void 0===e||e}function aa(e){const t=Array(e);for(let i=0;i=a))));f++);if(i)return o?ta(l,a,0):void(t[t.length]=l)}return!i&&l}function ta(e,t,i){return e=1===e.length?e[0]:[].concat.apply([],e),i||e.length>t?e.slice(i,i+t):e}function ua(e,t,i,a){return i?e=(e=e[(a=a&&t>i)?t:i])&&e[a?i:t]:e=e[t],e}function N(e,t,i,a,r){let o=0;if(e.constructor===Array)if(r)-1!==(t=e.indexOf(t))?1=this.B&&(h||!d[u])){var o=L(f,a,b),n="";switch(this.G){case"full":if(2o;s--)if(s-o>=this.B){var l=L(f,a,b,r,o);M(this,d,n=u.substring(o,s),l,e,i)}break}case"reverse":if(1=this.B&&M(this,d,n,L(f,a,b,r,s),e,i);n=""}case"forward":if(1=this.B&&M(this,d,n,o,e,i);break}default:if(this.C&&(o=Math.min(o/this.C(t,u,b)|0,f-1)),M(this,d,u,o,e,i),h&&1=this.B&&!r[u]){r[u]=1;const t=this.l&&u>o;M(this,c,t?o:u,L(n+(a/2>n?0:1),a,b,s-1,l-1),e,i,t?u:o)}}}}this.m||(this.register[e]=1)}}return this},t.search=function(e,t,i){i||(!t&&C(e)?e=(i=e).query:C(t)&&(i=t));let a,r,o,n,s,l=[],c=0;if(i){e=i.query||e,t=i.limit,c=i.offset||0;var d=i.context;r=i.suggest}if(e&&(a=(e=this.encode(""+e)).length,1=this.B&&!i[t]){if(!(this.s||r||this.map[t]))return l;h[n++]=t,i[t]=1}a=(e=h).length}if(!a)return l;for(t||(t=100),i=0,(d=this.depth&&1t||i)&&(r=r.slice(i,i+t)),a&&(r=za.call(this,r)),{tag:e,result:r}}function za(e){const t=Array(e.length);for(let i,a=0;a{"use strict";const t=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],i=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],r=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],o=(e,t,i)=>{let a=e;return"string"==typeof t||Array.isArray(t)?a=e.toLocaleString(t,i):!0!==t&&void 0===i||(a=e.toLocaleString(void 0,i)),a};e.exports=(e,n)=>{if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);const s=(n=Object.assign({bits:!1,binary:!1},n)).bits?n.binary?r:a:n.binary?i:t;if(n.signed&&0===e)return` 0 ${s[0]}`;const l=e<0,c=l?"-":n.signed?"+":"";let d;if(l&&(e=-e),void 0!==n.minimumFractionDigits&&(d={minimumFractionDigits:n.minimumFractionDigits}),void 0!==n.maximumFractionDigits&&(d=Object.assign({maximumFractionDigits:n.maximumFractionDigits},d)),e<1){return c+o(e,n.locale,d)+" "+s[0]}const h=Math.min(Math.floor(n.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),s.length-1);e/=Math.pow(n.binary?1024:1e3,h),d||(e=e.toPrecision(3));return c+o(Number(e),n.locale,d)+" "+s[h]}},529:e=>{e.exports=''},873:e=>{e.exports=''},795:e=>{e.exports=''},29:e=>{e.exports=''},575:e=>{e.exports=''},199:e=>{e.exports=''},734:e=>{e.exports=''},636:e=>{e.exports=''},561:e=>{e.exports=''},536:e=>{e.exports=''},921:e=>{e.exports=''},442:e=>{e.exports=''},426:e=>{e.exports=''},430:e=>{e.exports=''},878:e=>{e.exports=''},124:e=>{e.exports=''},56:e=>{e.exports=''},998:e=>{e.exports=''},125:e=>{e.exports=''},732:e=>{e.exports=''},638:e=>{e.exports=''},164:e=>{e.exports=''},615:e=>{e.exports=''},885:e=>{e.exports=''},200:e=>{e.exports=''},368:e=>{e.exports=''},804:e=>{e.exports=''},690:e=>{e.exports=''},761:e=>{e.exports=''},302:e=>{e.exports=''},135:e=>{e.exports=''}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Chooser:()=>Te,Coll:()=>Vt,CollIndex:()=>We,CollInfo:()=>Ge,Embed:()=>oa,GDrive:()=>Ri,Loader:()=>qi,PageEntry:()=>Zi,Pages:()=>Wi,Replay:()=>Qi,ReplayWebApp:()=>Ie,Sorter:()=>ta,Story:()=>Li,URLResources:()=>ia}); /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const e=window,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),a=new WeakMap;class r{constructor(e,t,a){if(this._$cssResult$=!0,a!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const i=this.t;if(t&&void 0===e){const t=void 0!==i&&1===i.length;t&&(e=a.get(i)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&a.set(i,e))}return e}toString(){return this.cssText}}const o=e=>new r("string"==typeof e?e:e+"",void 0,i),n=(e,...t)=>{const a=1===e.length?e[0]:t.reduce(((t,i,a)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[a+1]),e[0]);return new r(a,e,i)},s=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return o(t)})(e):e; +const e=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,t=Symbol(),i=new Map;class a{constructor(e,i){if(this._$cssResult$=!0,i!==t)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){let t=i.get(this.cssText);return e&&void 0===t&&(i.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const r=e=>new a("string"==typeof e?e:e+"",t),o=(e,...i)=>{const r=1===e.length?e[0]:i.reduce(((t,i,a)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[a+1]),e[0]);return new a(r,t)},n=e?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return r(t)})(e):e; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var l;const c=window,d=c.trustedTypes,h=d?d.emptyScript:"",f=c.reactiveElementPolyfillSupport,b={toAttribute(e,t){switch(t){case Boolean:e=e?h:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},u=(e,t)=>t!==e&&(t==t||e==e),p={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:u},m="finalized";class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const a=this._$Ep(i,t);void 0!==a&&(this._$Ev.set(a,i),e.push(a))})),e}static createProperty(e,t=p){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,a=this.getPropertyDescriptor(e,i,t);void 0!==a&&Object.defineProperty(this.prototype,e,a)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(a){const r=this[e];this[t]=a,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||p}static finalize(){if(this.hasOwnProperty(m))return!1;this[m]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(s(e))}else void 0!==e&&t.push(s(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var i;const a=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,a)=>{t?i.adoptedStyleSheets=a.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):a.forEach((t=>{const a=document.createElement("style"),r=e.litNonce;void 0!==r&&a.setAttribute("nonce",r),a.textContent=t.cssText,i.appendChild(a)}))})(a,this.constructor.elementStyles),a}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=p){var a;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null===(a=i.converter)||void 0===a?void 0:a.toAttribute)?i.converter:b).toAttribute(t,i.type);this._$El=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(e,t){var i;const a=this.constructor,r=a._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=a.getPropertyOptions(r),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:b;this._$El=r,this[r]=o.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let a=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||u)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):a=!1),!this.isUpdatePending&&a&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}} +var s;const l=window.trustedTypes,c=l?l.emptyScript:"",d=window.reactiveElementPolyfillSupport,h={toAttribute(e,t){switch(t){case Boolean:e=e?c:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},f=(e,t)=>t!==e&&(t==t||e==e),b={attribute:!0,type:String,converter:h,reflect:!1,hasChanged:f};class u extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(e){var t;null!==(t=this.l)&&void 0!==t||(this.l=[]),this.l.push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const a=this._$Eh(i,t);void 0!==a&&(this._$Eu.set(a,i),e.push(a))})),e}static createProperty(e,t=b){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,a=this.getPropertyDescriptor(e,i,t);void 0!==a&&Object.defineProperty(this.prototype,e,a)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(a){const r=this[e];this[t]=a,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||b}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(n(e))}else void 0!==e&&t.push(n(e));return t}static _$Eh(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}o(){var e;this._$Ep=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$Eg)&&void 0!==t?t:this._$Eg=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$Eg)||void 0===t||t.splice(this._$Eg.indexOf(e)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Et.set(t,this[t]),delete this[t])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{e?t.adoptedStyleSheets=i.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),a=window.litNonce;void 0!==a&&i.setAttribute("nonce",a),i.textContent=e.cssText,t.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$Eg)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$Eg)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ES(e,t,i=b){var a,r;const o=this.constructor._$Eh(e,i);if(void 0!==o&&!0===i.reflect){const n=(null!==(r=null===(a=i.converter)||void 0===a?void 0:a.toAttribute)&&void 0!==r?r:h.toAttribute)(t,i.type);this._$Ei=e,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Ei=null}}_$AK(e,t){var i,a,r;const o=this.constructor,n=o._$Eu.get(e);if(void 0!==n&&this._$Ei!==n){const e=o.getPropertyOptions(n),s=e.converter,l=null!==(r=null!==(a=null===(i=s)||void 0===i?void 0:i.fromAttribute)&&void 0!==a?a:"function"==typeof s?s:null)&&void 0!==r?r:h.fromAttribute;this._$Ei=n,this[n]=l(t,e.type),this._$Ei=null}}requestUpdate(e,t,i){let a=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||f)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$Ei!==e&&(void 0===this._$E_&&(this._$E_=new Map),this._$E_.set(e,i))):a=!1),!this.isUpdatePending&&a&&(this._$Ep=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((e,t)=>this[t]=e)),this._$Et=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$Eg)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$Eg)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(e){return!0}update(e){void 0!==this._$E_&&(this._$E_.forEach(((e,t)=>this._$ES(t,this[t],e))),this._$E_=void 0),this._$EU()}updated(e){}firstUpdated(e){}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var v;g[m]=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==f||f({ReactiveElement:g}),(null!==(l=c.reactiveElementVersions)&&void 0!==l?l:c.reactiveElementVersions=[]).push("1.6.3");const w=window,x=w.trustedTypes,k=x?x.createPolicy("lit-html",{createHTML:e=>e}):void 0,y="$lit$",_=`lit$${(Math.random()+"").slice(9)}$`,$="?"+_,S=`<${$}>`,z=document,C=()=>z.createComment(""),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,E=e=>D(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,L=/>/g,T=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),U=/'/g,R=/"/g,q=/^(?:script|style|textarea|title)$/i,M=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),j=M(1),O=(M(2),Symbol.for("lit-noChange")),N=Symbol.for("lit-nothing"),B=new WeakMap,F=z.createTreeWalker(z,129,null,!1);function H(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(t):t}const W=(e,t)=>{const i=e.length-1,a=[];let r,o=2===t?"":"",n=I;for(let t=0;t"===l[0]?(n=null!=r?r:I,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,s=l[1],n=void 0===l[3]?T:'"'===l[3]?R:U):n===R||n===U?n=T:n===P||n===L?n=I:(n=T,r=void 0);const h=n===T&&e[t+1].startsWith("/>")?" ":"";o+=n===I?i+S:c>=0?(a.push(s),i.slice(0,c)+y+i.slice(c)+_+h):i+_+(-2===c?(a.push(void 0),t):h)}return[H(e,o+(e[i]||"")+(2===t?"":"")),a]};class G{constructor({strings:e,_$litType$:t},i){let a;this.parts=[];let r=0,o=0;const n=e.length-1,s=this.parts,[l,c]=W(e,t);if(this.el=G.createElement(l,i),F.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(a=F.nextNode())&&s.length0){a.textContent=x?x.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=N}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,a){const r=this.strings;let o=!1;if(void 0===r)e=K(this,e,t,0),o=!A(e)||e!==this._$AH&&e!==O,o&&(this._$AH=e);else{const a=e;let n,s;for(e=r[0],n=0;ne}):void 0,v=`lit$${(Math.random()+"").slice(9)}$`,w="?"+v,x=`<${w}>`,k=document,y=(e="")=>k.createComment(e),$=e=>null===e||"object"!=typeof e&&"function"!=typeof e,_=Array.isArray,S=e=>{var t;return _(e)||"function"==typeof(null===(t=e)||void 0===t?void 0:t[Symbol.iterator])},z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,A=/>/g,D=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,E=/'/g,I=/"/g,P=/^(?:script|style|textarea)$/i,L=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),T=L(1),U=(L(2),Symbol.for("lit-noChange")),R=Symbol.for("lit-nothing"),q=new WeakMap,M=k.createTreeWalker(k,129,null,!1),j=(e,t)=>{const i=e.length-1,a=[];let r,o=2===t?"":"",n=z;for(let t=0;t"===l[0]?(n=null!=r?r:z,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,s=l[1],n=void 0===l[3]?D:'"'===l[3]?I:E):n===I||n===E?n=D:n===C||n===A?n=z:(n=D,r=void 0);const h=n===D&&e[t+1].startsWith("/>")?" ":"";o+=n===z?i+x:c>=0?(a.push(s),i.slice(0,c)+"$lit$"+i.slice(c)+v+h):i+v+(-2===c?(a.push(void 0),t):h)}const s=o+(e[i]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==g?g.createHTML(s):s,a]};class O{constructor({strings:e,_$litType$:t},i){let a;this.parts=[];let r=0,o=0;const n=e.length-1,s=this.parts,[l,c]=j(e,t);if(this.el=O.createElement(l,i),M.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(a=M.nextNode())&&s.length0){a.textContent=m?m.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,a){const r=this.strings;let o=!1;if(void 0===r)e=N(this,e,t,0),o=!$(e)||e!==this._$AH&&e!==U,o&&(this._$AH=e);else{const a=e;let n,s;for(e=r[0],n=0;n{var a,r;const o=null!==(a=null==i?void 0:i.renderBefore)&&void 0!==a?a:t;let n=o._$litPart$;if(void 0===n){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new Z(t.insertBefore(C(),e),e,void 0,null!=i?i:{})}return n._$AI(e),n})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return O}}oe.finalized=!0,oe._$litElement$=!0,null===(ae=globalThis.litElementHydrateSupport)||void 0===ae||ae.call(globalThis,{LitElement:oe});const ne=globalThis.litElementPolyfillSupport;null==ne||ne({LitElement:oe});(null!==(re=globalThis.litElementVersions)&&void 0!==re?re:globalThis.litElementVersions=[]).push("3.3.3"); +var J,Y;null==Q||Q(O,F),(null!==(p=globalThis.litHtmlVersions)&&void 0!==p?p:globalThis.litHtmlVersions=[]).push("2.1.1");class X extends u{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Dt=((e,t,i)=>{var a,r;const o=null!==(a=null==i?void 0:i.renderBefore)&&void 0!==a?a:t;let n=o._$litPart$;if(void 0===n){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new F(t.insertBefore(y(),e),e,void 0,null!=i?i:{})}return n._$AI(e),n})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Dt)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Dt)||void 0===e||e.setConnected(!1)}render(){return U}}X.finalized=!0,X._$litElement$=!0,null===(J=globalThis.litElementHydrateSupport)||void 0===J||J.call(globalThis,{LitElement:X});const ee=globalThis.litElementPolyfillSupport;null==ee||ee({LitElement:X});(null!==(Y=globalThis.litElementVersions)&&void 0!==Y?Y:globalThis.litElementVersions=[]).push("3.1.1"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const se=1,le=2,ce=e=>(...t)=>({_$litDirective$:e,values:t});class de{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}} +const te=1,ie=2,ae=e=>(...t)=>({_$litDirective$:e,values:t});class re{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -class he extends de{constructor(e){if(super(e),this.et=N,e.type!==le)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===N||null==e)return this.ft=void 0,this.et=e;if(e===O)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}he.directiveName="unsafeHTML",he.resultType=1;const fe=ce(he); +class oe extends re{constructor(e){if(super(e),this.it=R,e.type!==ie)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===R||null==e)return this.vt=void 0,this.it=e;if(e===U)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.vt;this.it=e;const t=[e];return t.raw=t,this.vt={_$litType$:this.constructor.resultType,strings:t,values:[]}}}oe.directiveName="unsafeHTML",oe.resultType=1;const ne=ae(oe); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -class be extends he{}be.directiveName="unsafeSVG",be.resultType=2;const ue=ce(be),pe="important",me=ce(class extends de{constructor(e){var t;if(super(e),e.type!==se||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const a=e[i];return null==a?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${a};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ht){this.ht=new Set;for(const e in t)this.ht.add(e);return this.render(t)}this.ht.forEach((e=>{null==t[e]&&(this.ht.delete(e),e.includes("-")?i.removeProperty(e):i[e]="")}));for(const e in t){const a=t[e];if(null!=a){this.ht.add(e);const t="string"==typeof a&&a.endsWith(" !important");e.includes("-")||t?i.setProperty(e,t?a.slice(0,-11):a,t?pe:""):i[e]=a}}return O}});var ge=__webpack_require__(274),ve=__webpack_require__(29),we=__webpack_require__.n(ve);const xe=o(ge.Z);function ke(e){return[xe,e]}const ye=window.IS_APP||window.electron&&window.electron.IS_APP||window.matchMedia("(display-mode: standalone)").matches,_e="1.8.12";function $e(e){" "==e.key&&(e.preventDefault(),e.target.click())}class Se extends oe{constructor(){super(),this.size="1.1em",this.width=null,this.height=null}static get properties(){return{svg:{type:String},size:{type:String},width:{type:String},height:{type:String}}}static get styles(){return n` +class se extends oe{}se.directiveName="unsafeSVG",se.resultType=2;const le=ae(se),ce=ae(class extends re{constructor(e){var t;if(super(e),e.type!==te||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const a=e[i];return null==a?t:t+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${a};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ct){this.ct=new Set;for(const e in t)this.ct.add(e);return this.render(t)}this.ct.forEach((e=>{null==t[e]&&(this.ct.delete(e),e.includes("-")?i.removeProperty(e):i[e]="")}));for(const e in t){const a=t[e];null!=a&&(this.ct.add(e),e.includes("-")?i.setProperty(e,a):i[e]=a)}return U}});var de=__webpack_require__(274),he=__webpack_require__(29),fe=__webpack_require__.n(he);const be=r(de.Z);function ue(e){return[be,e]}const pe=window.IS_APP||window.electron&&window.electron.IS_APP||window.matchMedia("(display-mode: standalone)").matches,me="1.8.13";function ge(e){" "==e.key&&(e.preventDefault(),e.target.click())}class ve extends X{constructor(){super(),this.size="1.1em",this.width=null,this.height=null}static get properties(){return{svg:{type:String},size:{type:String},width:{type:String},height:{type:String}}}static get styles(){return o` :host { display: inline-block; padding: 0; @@ -60,9 +60,9 @@ class be extends he{}be.directiveName="unsafeSVG",be.resultType=2;const ue=ce(be width: var(--fa-icon-width, 19px); height: var(--fa-icon-height, 19px); } - `}render(){if(!this.svg)return j``;const e={};return this.size?(e.width=this.size,e.height=this.size):(this.width&&(e.width=this.width),this.height&&(e.height=this.height)),j` - ${ue(this.svg)} - `}}customElements.define("fa-icon",Se),customElements.define("wr-anim-logo",class extends Se{constructor(){super(),this.svg=we()}static get styles(){return n` + `}render(){if(!this.svg)return T``;const e={};return this.size?(e.width=this.size,e.height=this.size):(this.width&&(e.width=this.width),this.height&&(e.height=this.height)),T` + ${le(this.svg)} + `}}customElements.define("fa-icon",ve),customElements.define("wr-anim-logo",class extends ve{constructor(){super(),this.svg=fe()}static get styles(){return o` #wrlogo #stop5687 { animation: animLeft 7s linear infinite; } @@ -106,7 +106,7 @@ class be extends he{}be.directiveName="unsafeSVG",be.resultType=2;const ue=ce(be stop-color: #04cdff; } } - `}}),customElements.define("wr-modal",class extends oe{constructor(){super(),this.title="",this.bgClass="",this.noBgClose=!1}static get properties(){return{title:{type:String},bgClass:{type:String},noBgClose:{type:Boolean}}}static get styles(){return ke(n` + `}}),customElements.define("wr-modal",class extends X{constructor(){super(),this.title="",this.bgClass="",this.noBgClose=!1}static get properties(){return{title:{type:String},bgClass:{type:String},noBgClose:{type:Boolean}}}static get styles(){return ue(o` .modal-background { background-color: rgba(10, 10, 10, 0.5); } @@ -119,7 +119,7 @@ class be extends he{}be.directiveName="unsafeSVG",be.resultType=2;const ue=ce(be width: 100%; max-width: var(--modal-width, 640px); } - `)}render(){return j` `}onClose(){this.dispatchEvent(new CustomEvent("modal-closed"))}});var we,xe=__webpack_require__(200),ke=__webpack_require__.n(xe),ye=__webpack_require__(878),$e=__webpack_require__.n(ye),_e=__webpack_require__(124),Se=__webpack_require__.n(_e);function ze(e,t){void 0===t&&(t={});var i=t.registrationOptions;void 0===i&&(i={}),delete t.registrationOptions;var a=function(e){for(var i=[],a=arguments.length-1;a-- >0;)i[a]=arguments[a+1];t&&t[e]&&t[e].apply(t,i)};"serviceWorker"in navigator&&we.then((function(){Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))?(!function(e,t,i){fetch(e).then((function(a){404===a.status?(t("error",new Error("Service worker not found at "+e)),De()):-1===a.headers.get("content-type").indexOf("javascript")?(t("error",new Error("Expected "+e+" to have javascript content-type, but received "+a.headers.get("content-type"))),De()):Ae(e,t,i)})).catch((function(e){return Ce(t,e)}))}(e,a,i),navigator.serviceWorker.ready.then((function(e){a("ready",e)})).catch((function(e){return Ce(a,e)}))):(Ae(e,a,i),navigator.serviceWorker.ready.then((function(e){a("ready",e)})).catch((function(e){return Ce(a,e)})))}))}function Ce(e,t){navigator.onLine||e("offline"),e("error",t)}function Ae(e,t,i){navigator.serviceWorker.register(e,i).then((function(e){t("registered",e),e.waiting?t("updated",e):e.onupdatefound=function(){t("updatefound",e);var i=e.installing;i.onstatechange=function(){"installed"===i.state&&(navigator.serviceWorker.controller?t("updated",e):t("cached",e))}}})).catch((function(e){return Ce(t,e)}))}function De(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){return Ce(emit,e)}))}"undefined"!=typeof window&&(we="undefined"!=typeof Promise?new Promise((function(e){return window.addEventListener("load",e)})):{then:function(e){return window.addEventListener("load",e)}});class Ee{constructor({name:e="sw.js",scope:t="./",appName:i="ReplayWeb.page",requireSubdomainIframe:a=!1}={}){this.name=e,this.scope=t,this.appName=i,this.requireSubdomainIframe=a,this.errorMsg=null}setAppName(e){this.appName=e}register(){let e,t;const i=new Promise(((i,a)=>{e=i,t=a}));this.errorMsg=this.getSWErrorMsg(),this.errorMsg&&(console.error(this.errorMsg),t(this.errorMsg));const a=e=>{console.error("Error during service worker registration:",e),this.errorMsg=this.getCrossOriginIframeMsg(),this.errorMsg||(this.errorMsg=`${this.appName} could not be loaded due to the following error:\n${e.toString()}`),t(this.errorMsg)};return ze(this.scope+this.name,{registrationOptions:{scope:this.scope},registered(){console.log("Service worker is registered"),e()},error(e){a(e)}}),i}getCrossOriginIframeMsg(){return this.isCrossOriginIframe()?` Sorry, Service Workers can not be used in cross-origin iframes.\n This web archive embed is loaded from ${window.location.origin} but the top page is on a different origin.\n The embed must be loaded from the same origin or a subdomain.`:null}isCrossOriginIframe(){if(window.parent===window)return!1;try{return""===window.top.location.href}catch(e){return!0}}getSWErrorMsg(){if(navigator.serviceWorker)return this.requireSubdomainIframe&&!this.isCrossOriginIframe()?`Sorry, due to security settings, this ${this.appName} embed only be viewed within a subdomain iframe.`:null;const e=this.getCrossOriginIframeMsg();return e||(window.isSecureContext?"MozAppearance"in document.documentElement.style?"Sorry, Service Workers are disabled in Firefox in Private Mode. Please try loading this page in regular mode instead.":`Sorry, ${this.appName} won't work in this browser as Service Workers are not supported in this window.\n Please try a different browser.`:`\n Sorry, the ${this.appName} system must be loaded from an HTTPS URL (or localhost), but was loaded from: ${window.location.host}.\n Please try loading this page from an HTTPS URL`)}renderErrorReport(e,t){const i=this.errorMsg||t;return i?T`
${i}
- `:""}}class Me extends oe{constructor(e="sw.js"){super(),this.sourceUrl=null,this.collTitle=null,this.showAbout=!1,this.showFileDropOverlay=!1,this.pageParams=new URLSearchParams,this.inited=!1,this.navMenuShown=!1,this.collPageUrl="",this.pageTitle="",this.pageReplay=!1,this.loadInfo=null,this.swName=e,this.swmanager=null,this.skipRuffle=!1,this.useRuffle=!1,this.safariKeyframes(),this.addEventListener("dragenter",(e=>{this.maybeStartFileDrop(e)})),this.addEventListener("dragover",(e=>{this.maybeStartFileDrop(e)})),this.addEventListener("dragleave",(()=>{this.showFileDropOverlay=!1})),this.addEventListener("dragend",(()=>{this.showFileDropOverlay=!1})),this.addEventListener("drop",(e=>{this.droppedFile=e.dataTransfer.files[0],this.showFileDropOverlay=!1,e.preventDefault()})),this.maybeStartFileDrop=e=>{this.sourceUrl||(this.showFileDropOverlay=!0,e.preventDefault())}}get appName(){return"ReplayWeb.page"}get homeUrl(){return window.location.pathname}static get properties(){return{inited:{type:Boolean},pageParams:{type:Object},sourceUrl:{type:String},navMenuShown:{type:Boolean},showAbout:{type:Boolean},showFileDropOverlay:{type:Boolean},collTitle:{type:String},loadInfo:{type:Object},embed:{type:String},collPageUrl:{type:String},pageTitle:{type:String},pageReplay:{type:Boolean},source:{type:String},skipRuffle:{type:Boolean},swErrorMsg:{type:Object}}}static get styles(){return ke(Me.appStyles)}static get appStyles(){return n` + `:""}}class Ie extends X{constructor(e="sw.js"){super(),this.sourceUrl=null,this.collTitle=null,this.showAbout=!1,this.showFileDropOverlay=!1,this.pageParams=new URLSearchParams,this.inited=!1,this.navMenuShown=!1,this.collPageUrl="",this.pageTitle="",this.pageReplay=!1,this.loadInfo=null,this.swName=e,this.swmanager=null,this.skipRuffle=!1,this.useRuffle=!1,this.safariKeyframes(),this.addEventListener("dragenter",(e=>{this.maybeStartFileDrop(e)})),this.addEventListener("dragover",(e=>{this.maybeStartFileDrop(e)})),this.addEventListener("dragleave",(()=>{this.showFileDropOverlay=!1})),this.addEventListener("dragend",(()=>{this.showFileDropOverlay=!1})),this.addEventListener("drop",(e=>{this.droppedFile=e.dataTransfer.files[0],this.showFileDropOverlay=!1,e.preventDefault()})),this.maybeStartFileDrop=e=>{this.sourceUrl||(this.showFileDropOverlay=!0,e.preventDefault())}}get appName(){return"ReplayWeb.page"}get homeUrl(){return window.location.pathname}static get properties(){return{inited:{type:Boolean},pageParams:{type:Object},sourceUrl:{type:String},navMenuShown:{type:Boolean},showAbout:{type:Boolean},showFileDropOverlay:{type:Boolean},collTitle:{type:String},loadInfo:{type:Object},embed:{type:String},collPageUrl:{type:String},pageTitle:{type:String},pageReplay:{type:Boolean},source:{type:String},skipRuffle:{type:Boolean},swErrorMsg:{type:Object}}}static get styles(){return ue(Ie.appStyles)}static get appStyles(){return o` #wrlogo { max-height: 1rem; } @@ -249,14 +249,14 @@ class be extends he{}be.directiveName="unsafeSVG",be.resultType=2;const ue=ce(be display: none !important; } } - `}get mainLogo(){return we()}renderNavBrand(){return j` replay web.page Home - `}renderNavBar(){return j` `}renderNavBar(){return T` -

Skipped

`}renderNavEnd(){return j`
- Skipped

`}renderNavEnd(){return T`
+  User Docs - ${e.resources?j`
+ ${e.resources?T`

Files

    ${ @@ -851,26 +851,26 @@ class be extends he{}be.directiveName="unsafeSVG",be.resultType=2;const ue=ce(be * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resources,(e=>j`
  1. +function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resources,(e=>T`
  2. ${e.name+"\n"}
  3. `))}
-
`:j`
+
`:T`

Filename

${e.filename}
`} ${this.renderSource(e)} - ${a?j` + ${a?T`

Observed By

${a}

- ${l?j`View Certificate`:""}
- `:s?j` + `:s?T`

Created With

${s||"Unknown"} @@ -879,10 +879,10 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour

Validation

- ${t>0||i>0?j`

+ ${t>0||i>0?T`

${t} hashes - verified${i?j`, ${i} invalid`:""} -

`:j` Not Available`} + verified${i?T`, ${i} invalid`:""} +

`:T` Not Available`}
@@ -903,7 +903,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour

Collection id

${e.coll}
-
`}render(){return this.detailed?this.renderDetailed():this.renderSummaryView()}onCopy(e,t){return e.preventDefault(),e.stopPropagation(),navigator.clipboard.writeText(t),!1}onPurge(e){const t={reload:e};this.dispatchEvent(new CustomEvent("coll-purge",{detail:t}))}}function et(e){if(!e)return"";e.length<14&&(e+="00000101000000".substr(e.length));const t=e.substring(0,4)+"-"+e.substring(4,6)+"-"+e.substring(6,8)+"T"+e.substring(8,10)+":"+e.substring(10,12)+":"+e.substring(12,14)+"-00:00";return new Date(t)}function tt(e){let t=null;try{t=new Date(e.ts||e.date)}catch(e){}const i=t&&!isNaN(t)?it(t.toISOString()):"";return{date:t,timestamp:i}}function it(e){return e.replace(/[-:T]/g,"").slice(0,14)}function at(e,t,i){const a=new URLSearchParams;return a.set("view",e),a.set("url",t),a.set("ts",i),"#"+a.toString()}async function rt(e){try{new URL(e)}catch(t){e=new URL(e,document.baseURI).href}const t=await async function(e,t){const i=(new TextEncoder).encode(e),a=await crypto.subtle.digest(t,i),r=Array.from(new Uint8Array(a)).map((e=>e.toString(16).padStart(2,"0"))).join("");return r}(e,"SHA-256");return{url:e,coll:"id-"+t.slice(0,12)}}customElements.define("wr-coll-info",Xe),customElements.define("wr-coll-index",Ye);var ot=__webpack_require__(56),nt=__webpack_require__.n(ot),st=__webpack_require__(732),lt=__webpack_require__.n(st),ct=__webpack_require__(561),dt=__webpack_require__.n(ct),ht=__webpack_require__(885),ft=__webpack_require__.n(ht),bt=__webpack_require__(636),ut=__webpack_require__.n(bt),pt=__webpack_require__(615),mt=__webpack_require__.n(pt),gt=__webpack_require__(302),vt=__webpack_require__.n(gt),wt=__webpack_require__(368),xt=__webpack_require__.n(wt),kt=__webpack_require__(125),yt=__webpack_require__.n(kt),_t=__webpack_require__(998),$t=__webpack_require__.n(_t),St=__webpack_require__(164),zt=__webpack_require__.n(St),Ct=__webpack_require__(426),At=__webpack_require__.n(Ct),Dt=__webpack_require__(430),Et=__webpack_require__.n(Dt),It=__webpack_require__(795),Pt=__webpack_require__.n(It),Lt=__webpack_require__(529),Tt=__webpack_require__.n(Lt),Ut=__webpack_require__(873),Rt=__webpack_require__.n(Ut),qt=__webpack_require__(575),Mt=__webpack_require__.n(qt);class jt extends oe{constructor(){super(),this.collInfo=null,this.appLogo=null,this.ts=null,this.url=null,this.active=!1}get renderRoot(){return this}static get properties(){return{collInfo:{type:Object},appLogo:{type:Object},url:{type:String},ts:{type:String},active:{type:Boolean}}}static get embedStyles(){return n` +
`}render(){return this.detailed?this.renderDetailed():this.renderSummaryView()}onCopy(e,t){return e.preventDefault(),e.stopPropagation(),navigator.clipboard.writeText(t),!1}onPurge(e){const t={reload:e};this.dispatchEvent(new CustomEvent("coll-purge",{detail:t}))}}function Ke(e){if(!e)return"";e.length<14&&(e+="00000101000000".substr(e.length));const t=e.substring(0,4)+"-"+e.substring(4,6)+"-"+e.substring(6,8)+"T"+e.substring(8,10)+":"+e.substring(10,12)+":"+e.substring(12,14)+"-00:00";return new Date(t)}function Ve(e){let t=null;try{t=new Date(e.ts||e.date)}catch(e){}const i=t&&!isNaN(t)?Ze(t.toISOString()):"";return{date:t,timestamp:i}}function Ze(e){return e.replace(/[-:T]/g,"").slice(0,14)}function Qe(e,t,i){const a=new URLSearchParams;return a.set("view",e),a.set("url",t),a.set("ts",i),"#"+a.toString()}async function Je(e){try{new URL(e)}catch(t){e=new URL(e,document.baseURI).href}const t=await async function(e,t){const i=(new TextEncoder).encode(e),a=await crypto.subtle.digest(t,i),r=Array.from(new Uint8Array(a)).map((e=>e.toString(16).padStart(2,"0"))).join("");return r}(e,"SHA-256");return{url:e,coll:"id-"+t.slice(0,12)}}customElements.define("wr-coll-info",Ge),customElements.define("wr-coll-index",We);var Ye=__webpack_require__(56),Xe=__webpack_require__.n(Ye),et=__webpack_require__(732),tt=__webpack_require__.n(et),it=__webpack_require__(561),at=__webpack_require__.n(it),rt=__webpack_require__(885),ot=__webpack_require__.n(rt),nt=__webpack_require__(636),st=__webpack_require__.n(nt),lt=__webpack_require__(615),ct=__webpack_require__.n(lt),dt=__webpack_require__(302),ht=__webpack_require__.n(dt),ft=__webpack_require__(368),bt=__webpack_require__.n(ft),ut=__webpack_require__(125),pt=__webpack_require__.n(ut),mt=__webpack_require__(998),gt=__webpack_require__.n(mt),vt=__webpack_require__(164),wt=__webpack_require__.n(vt),xt=__webpack_require__(426),kt=__webpack_require__.n(xt),yt=__webpack_require__(430),$t=__webpack_require__.n(yt),_t=__webpack_require__(795),St=__webpack_require__.n(_t),zt=__webpack_require__(529),Ct=__webpack_require__.n(zt),At=__webpack_require__(873),Dt=__webpack_require__.n(At),Et=__webpack_require__(575),It=__webpack_require__.n(Et);class Pt extends X{constructor(){super(),this.collInfo=null,this.appLogo=null,this.ts=null,this.url=null,this.active=!1}get renderRoot(){return this}static get properties(){return{collInfo:{type:Object},appLogo:{type:Object},url:{type:String},ts:{type:String},active:{type:Boolean}}}static get embedStyles(){return o` rwp-embed-receipt { display: flex; flex-direction: column; @@ -1044,7 +1044,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour border-style: solid; line-height: 0.5em; } - `}render(){let{numValid:e,numInvalid:t,domain:i,certFingerprint:a,datapackageHash:r,publicKey:o,software:n}=this.collInfo.verify||{};e=e||0,t=t||0;const s=this.collInfo.sourceUrl,l=a?`https://crt.sh/?q=${a}`:"",c=et(this.ts).toLocaleString();return j` + `}render(){let{numValid:e,numInvalid:t,domain:i,certFingerprint:a,datapackageHash:r,publicKey:o,software:n}=this.collInfo.verify||{};e=e||0,t=t||0;const s=this.collInfo.sourceUrl,l=a?`https://crt.sh/?q=${a}`:"",c=Ke(this.ts).toLocaleString();return T` - `}onEmbedDrop(e){e.stopPropagation(),this.active=!this.active}}customElements.define("rwp-embed-receipt",jt);var Ot="undefined"!=typeof window?window:null,Nt=null===Ot,Bt=Nt?void 0:Ot.document,Ft="horizontal",Ht=function(){return!1},Wt=Nt?"calc":["","-webkit-","-moz-","-o-"].filter((function(e){var t=Bt.createElement("div");return t.style.cssText="width:"+e+"calc(9px)",!!t.style.length})).shift()+"calc",Gt=function(e){return"string"==typeof e||e instanceof String},Kt=function(e){if(Gt(e)){var t=Bt.querySelector(e);if(!t)throw new Error("Selector "+e+" did not match a DOM element");return t}return e},Vt=function(e,t,i){var a=e[t];return void 0!==a?a:i},Zt=function(e,t,i,a){if(t){if("end"===a)return 0;if("center"===a)return e/2}else if(i){if("start"===a)return 0;if("center"===a)return e/2}return e},Qt=function(e,t){var i=Bt.createElement("div");return i.className="gutter gutter-"+t,i},Jt=function(e,t,i){var a={};return Gt(t)?a[e]=t:a[e]=Wt+"("+t+"% - "+i+"px)",a},Yt=function(e,t){var i;return(i={})[e]=t+"px",i};const Xt=function(e,t){if(void 0===t&&(t={}),Nt)return{};var i,a,r,o,n,s,l=e;Array.from&&(l=Array.from(l));var c=Kt(l[0]).parentNode,d=getComputedStyle?getComputedStyle(c):null,h=d?d.flexDirection:null,f=Vt(t,"sizes")||l.map((function(){return 100/l.length})),b=Vt(t,"minSize",100),u=Array.isArray(b)?b:l.map((function(){return b})),p=Vt(t,"maxSize",1/0),m=Array.isArray(p)?p:l.map((function(){return p})),g=Vt(t,"expandToMin",!1),v=Vt(t,"gutterSize",10),w=Vt(t,"gutterAlign","center"),x=Vt(t,"snapOffset",30),k=Vt(t,"dragInterval",1),y=Vt(t,"direction",Ft),_=Vt(t,"cursor",y===Ft?"col-resize":"row-resize"),$=Vt(t,"gutter",Qt),S=Vt(t,"elementStyle",Jt),z=Vt(t,"gutterStyle",Yt);function C(e,t,a,r){var o=S(i,t,a,r);Object.keys(o).forEach((function(t){e.style[t]=o[t]}))}function A(){return s.map((function(e){return e.size}))}function D(e){return"touches"in e?e.touches[0][a]:e[a]}function E(e){var t=s[this.a],i=s[this.b],a=t.size+i.size;t.size=e/this.size*a,i.size=a-e/this.size*a,C(t.element,t.size,this._b,t.i),C(i.element,i.size,this._c,i.i)}function I(e){var i,a=s[this.a],r=s[this.b];this.dragging&&(i=D(e)-this.start+(this._b-this.dragOffset),k>1&&(i=Math.round(i/k)*k),i<=a.minSize+x+this._b?i=a.minSize+this._b:i>=this.size-(r.minSize+x+this._c)&&(i=this.size-(r.minSize+this._c)),i>=a.maxSize-x+this._b?i=a.maxSize+this._b:i<=this.size-(r.maxSize-x+this._c)&&(i=this.size-(r.maxSize+this._c)),E.call(this,i),Vt(t,"onDrag",Ht)(A()))}function P(){var e=s[this.a].element,t=s[this.b].element,a=e.getBoundingClientRect(),n=t.getBoundingClientRect();this.size=a[i]+n[i]+this._b+this._c,this.start=a[r],this.end=a[o]}function L(e){var t=function(e){if(!getComputedStyle)return null;var t=getComputedStyle(e);if(!t)return null;var i=e[n];return 0===i?null:i-=y===Ft?parseFloat(t.paddingLeft)+parseFloat(t.paddingRight):parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)}(c);if(null===t)return e;if(u.reduce((function(e,t){return e+t}),0)>t)return e;var i=0,a=[],r=e.map((function(r,o){var n=t*r/100,s=Zt(v,0===o,o===e.length-1,w),l=u[o]+s;return n0&&a[r]-i>0){var n=Math.min(i,a[r]-i);i-=n,o=e-n}return o/t*100}))}function T(){var e=this,i=s[e.a].element,a=s[e.b].element;e.dragging&&Vt(t,"onDragEnd",Ht)(A()),e.dragging=!1,Ot.removeEventListener("mouseup",e.stop),Ot.removeEventListener("touchend",e.stop),Ot.removeEventListener("touchcancel",e.stop),Ot.removeEventListener("mousemove",e.move),Ot.removeEventListener("touchmove",e.move),e.stop=null,e.move=null,i.removeEventListener("selectstart",Ht),i.removeEventListener("dragstart",Ht),a.removeEventListener("selectstart",Ht),a.removeEventListener("dragstart",Ht),i.style.userSelect="",i.style.webkitUserSelect="",i.style.MozUserSelect="",i.style.pointerEvents="",a.style.userSelect="",a.style.webkitUserSelect="",a.style.MozUserSelect="",a.style.pointerEvents="",e.gutter.style.cursor="",e.parent.style.cursor="",Bt.body.style.cursor=""}function U(e){if(!("button"in e)||0===e.button){var i=this,a=s[i.a].element,r=s[i.b].element;i.dragging||Vt(t,"onDragStart",Ht)(A()),e.preventDefault(),i.dragging=!0,i.move=I.bind(i),i.stop=T.bind(i),Ot.addEventListener("mouseup",i.stop),Ot.addEventListener("touchend",i.stop),Ot.addEventListener("touchcancel",i.stop),Ot.addEventListener("mousemove",i.move),Ot.addEventListener("touchmove",i.move),a.addEventListener("selectstart",Ht),a.addEventListener("dragstart",Ht),r.addEventListener("selectstart",Ht),r.addEventListener("dragstart",Ht),a.style.userSelect="none",a.style.webkitUserSelect="none",a.style.MozUserSelect="none",a.style.pointerEvents="none",r.style.userSelect="none",r.style.webkitUserSelect="none",r.style.MozUserSelect="none",r.style.pointerEvents="none",i.gutter.style.cursor=_,i.parent.style.cursor=_,Bt.body.style.cursor=_,P.call(i),i.dragOffset=D(e)-i.end}}y===Ft?(i="width",a="clientX",r="left",o="right",n="clientWidth"):"vertical"===y&&(i="height",a="clientY",r="top",o="bottom",n="clientHeight"),f=L(f);var R=[];function q(e){var t=e.i===R.length,i=t?R[e.i-1]:R[e.i];P.call(i);var a=t?i.size-e.minSize-i._c:e.minSize+i._b;E.call(i,a)}return s=l.map((function(e,t){var a,r={element:Kt(e),size:f[t],minSize:u[t],maxSize:m[t],i:t};if(t>0&&((a={a:t-1,b:t,dragging:!1,direction:y,parent:c})._b=Zt(v,t-1==0,!1,w),a._c=Zt(v,!1,t===l.length-1,w),"row-reverse"===h||"column-reverse"===h)){var o=a.a;a.a=a.b,a.b=o}if(t>0){var n=$(t,y,r.element);!function(e,t,a){var r=z(i,t,a);Object.keys(r).forEach((function(t){e.style[t]=r[t]}))}(n,v,t),a._a=U.bind(a),n.addEventListener("mousedown",a._a),n.addEventListener("touchstart",a._a),c.insertBefore(n,r.element),a.gutter=n}return C(r.element,r.size,Zt(v,0===t,t===l.length-1,w),t),t>0&&R.push(a),r})),s.forEach((function(e){var t=e.element.getBoundingClientRect()[i];t0){var a=R[i-1],r=s[a.a],o=s[a.b];r.size=t[i-1],o.size=e,C(r.element,r.size,a._b,r.i),C(o.element,o.size,a._c,o.i)}}))},getSizes:A,collapse:function(e){q(s[e])},destroy:function(e,t){R.forEach((function(a){if(!0!==t?a.parent.removeChild(a.gutter):(a.gutter.removeEventListener("mousedown",a._a),a.gutter.removeEventListener("touchstart",a._a)),!0!==e){var r=S(i,a.a.size,a._b);Object.keys(r).forEach((function(e){s[a.a].element.style[e]="",s[a.b].element.style[e]=""}))}}))},parent:c,pairs:R}},ei="search://";class ti extends oe{constructor(){super(),this.sourceUrl=null,this.inited=!1,this.isLoading=!1,this.coll="",this.collInfo=null,this._replaceLoc=!1,this._locUpdateNeeded=!1,this._locationHash="",this.tabData={},this.url="",this.ts="",this.tabNames=["pages","story","resources","info"],this.tabLabels={pages:"Pages",story:"Story",resources:"URLs",info:"Archive Info"},this.menuActive=!1,this.embedDropdownActive=!1,this.hasStory=!1,this.editable=!1,this.browsable=!0,this.clearable=!0,this.showSidebar="1"===localStorage.getItem("pages:showSidebar"),this.splitter=null,this.isVisible=!0,this.favIconUrl="",this.autoUpdateInterval=10,this._autoUpdater=null,this.appName="ReplayWeb.page",this.appVersion=_e,this.appLogo=we()}static get properties(){return{inited:{type:Boolean},sourceUrl:{type:String},loadInfo:{type:Object,attribute:!1},showSidebar:{type:Boolean},collInfo:{type:Object,attribute:!1},coll:{type:String},hasStory:{type:Boolean},isLoading:{type:Boolean},tabData:{type:Object,attribute:!1},url:{type:String},ts:{type:String},isFullscreen:{type:Boolean},menuActive:{type:Boolean},embed:{type:String},embedDropdownActive:{type:Boolean},editable:{type:Boolean},browsable:{type:Boolean},clearable:{type:Boolean},isVisible:{type:Boolean},favIconUrl:{type:String},appName:{type:String},appVersion:{type:String},appLogo:{type:String},autoUpdateInterval:{type:Number},swName:{type:String}}}firstUpdated(){this.inited=!0,window.addEventListener("hashchange",(e=>this.onHashChange(e))),this.addEventListener("fullscreenchange",(()=>{this.isFullscreen=!!document.fullscreenElement})),this.embed&&this.loadInfo&&this.loadInfo.hideOffscreen&&(this.observer=new IntersectionObserver((e=>{this.isVisible=e[0].isIntersecting})),this.observer.observe(this))}async runUpdateLoop(){try{for(;this.editable&&this.autoUpdateInterval&&(!this.collInfo||!this.collInfo.pages||this.collInfo.pages.length<100);)await new Promise((e=>setTimeout(e,1e3*this.autoUpdateInterval))),await this.doUpdateInfo(!0)}finally{this._autoUpdater=null}}updated(e){if(e.has("sourceUrl")&&this.doUpdateInfo(),e.has("editable")&&this.editable&&this.autoUpdateInterval&&!this._autoUpdater&&(this._autoUpdater=this.runUpdateLoop()),e.has("tabData")){if(!this.collInfo||!this.collInfo.coll)return;Object.keys(this.tabData).forEach((e=>!this.tabData[e]&&delete this.tabData[e]));const t="#"+new URLSearchParams(this.tabData).toString();if(this.tabData.url||(this.url=ei+decodeURIComponent(this._paramsToString(this.tabData))),t!==this._locationHash){if(this._locationHash=t,this._replaceLoc||0===Object.keys(e.get("tabData")).length){const e=new URL(window.location.href);e.hash=this._locationHash,window.history.replaceState({},"",e.href),this._replaceLoc=!1}else if(window.location.hash=this._locationHash,!this.showSidebar){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.focus()}this.embed&&window.parent!==window&&window.parent.postMessage(this.tabData,"*")}this._locUpdateNeeded=!1}e.has("showSidebar")&&(this.embed||localStorage.setItem("pages:showSidebar",this.showSidebar?"1":"0")),(e.has("tabData")||e.has("showSidebar"))&&this.configureSplitter()}configureSplitter(){if(this.tabData.url&&this.showSidebar){const e=this.renderRoot.querySelector("#contents"),t=this.renderRoot.querySelector("wr-coll-replay");if(e&&t&&!this.splitter){const i={sizes:[30,70],minSize:[300,300],gutterSize:4,onDragStart(){t.setDisablePointer(!0)},onDragEnd(){t.setDisablePointer(!1)}};this.splitter=Xt([e,t],i)}}else if(this.splitter){try{this.splitter.destroy()}catch(e){}this.splitter=null}}async doUpdateInfo(e=!1){if(e&&this.tabData.url&&!this.showSidebar)return;let t=this.loadInfo&&this.loadInfo.customColl;if(!t){t=(await rt(this.sourceUrl)).coll}this.coll=t;const i="./w/api/c/"+t,a="./w/"+t,r=await fetch(i+"?all=1");if(200!=r.status)return void(this.collInfo={});const o=await r.json();if(this.collInfo={apiPrefix:i,replayPrefix:a,coll:t,...o},this.loadInfo&&this.loadInfo.extraConfig&&this.loadInfo.extraConfig.headers){const e=this.loadInfo.extraConfig.headers;await fetch(`${i}/updateAuth`,{method:"POST",body:JSON.stringify({headers:e})})}this.collInfo.title||(this.collInfo.title=this.collInfo.filename),"replayonly"!==this.embed&&"replay-with-info"!==this.embed||(this.showSidebar=!1),this.hasStory=this.collInfo.desc||this.collInfo.lists.length,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:{collInfo:this.collInfo,alreadyLoaded:!0}})),this.onHashChange()}onCollLoaded(e){this.doUpdateInfo(),this.loadInfo=null,e.detail.sourceUrl&&(this.sourceUrl=e.detail.sourceUrl),this.dispatchEvent(new CustomEvent("coll-loaded",{detail:{sourceUrl:this.sourceUrl,collInfo:this.collInfo}}))}onCollUpdate(e){this.editable&&(this.collInfo={...this.collInfo,...e.detail})}onHashChange(){const e=window.location.hash;if(e&&e!==this._locationHash&&(this.tabData=Object.fromEntries(new URLSearchParams(e.slice(1)).entries()),this._locationHash=e),this.collInfo.coll&&!this.tabNames.includes(this.tabData.view)){const e=this.hasStory?"story":this.editable||this.collInfo.pages.length?"pages":"resources";this.tabData={...this.tabData,view:e}}if(this.tabData.url&&this.tabData.url.startsWith("page:")){const e=Number(this.tabData.url.slice("page:".length));if(!isNaN(e)&&e1&&(i=Math.round(i/k)*k),i<=a.minSize+x+this._b?i=a.minSize+this._b:i>=this.size-(r.minSize+x+this._c)&&(i=this.size-(r.minSize+this._c)),i>=a.maxSize-x+this._b?i=a.maxSize+this._b:i<=this.size-(r.maxSize-x+this._c)&&(i=this.size-(r.maxSize+this._c)),E.call(this,i),Nt(t,"onDrag",qt)(A()))}function P(){var e=s[this.a].element,t=s[this.b].element,a=e.getBoundingClientRect(),n=t.getBoundingClientRect();this.size=a[i]+n[i]+this._b+this._c,this.start=a[r],this.end=a[o]}function L(e){var t=function(e){if(!getComputedStyle)return null;var t=getComputedStyle(e);if(!t)return null;var i=e[n];return 0===i?null:i-=y===Rt?parseFloat(t.paddingLeft)+parseFloat(t.paddingRight):parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)}(c);if(null===t)return e;if(u.reduce((function(e,t){return e+t}),0)>t)return e;var i=0,a=[],r=e.map((function(r,o){var n=t*r/100,s=Bt(v,0===o,o===e.length-1,w),l=u[o]+s;return n0&&a[r]-i>0){var n=Math.min(i,a[r]-i);i-=n,o=e-n}return o/t*100}))}function T(){var e=this,i=s[e.a].element,a=s[e.b].element;e.dragging&&Nt(t,"onDragEnd",qt)(A()),e.dragging=!1,Lt.removeEventListener("mouseup",e.stop),Lt.removeEventListener("touchend",e.stop),Lt.removeEventListener("touchcancel",e.stop),Lt.removeEventListener("mousemove",e.move),Lt.removeEventListener("touchmove",e.move),e.stop=null,e.move=null,i.removeEventListener("selectstart",qt),i.removeEventListener("dragstart",qt),a.removeEventListener("selectstart",qt),a.removeEventListener("dragstart",qt),i.style.userSelect="",i.style.webkitUserSelect="",i.style.MozUserSelect="",i.style.pointerEvents="",a.style.userSelect="",a.style.webkitUserSelect="",a.style.MozUserSelect="",a.style.pointerEvents="",e.gutter.style.cursor="",e.parent.style.cursor="",Ut.body.style.cursor=""}function U(e){if(!("button"in e)||0===e.button){var i=this,a=s[i.a].element,r=s[i.b].element;i.dragging||Nt(t,"onDragStart",qt)(A()),e.preventDefault(),i.dragging=!0,i.move=I.bind(i),i.stop=T.bind(i),Lt.addEventListener("mouseup",i.stop),Lt.addEventListener("touchend",i.stop),Lt.addEventListener("touchcancel",i.stop),Lt.addEventListener("mousemove",i.move),Lt.addEventListener("touchmove",i.move),a.addEventListener("selectstart",qt),a.addEventListener("dragstart",qt),r.addEventListener("selectstart",qt),r.addEventListener("dragstart",qt),a.style.userSelect="none",a.style.webkitUserSelect="none",a.style.MozUserSelect="none",a.style.pointerEvents="none",r.style.userSelect="none",r.style.webkitUserSelect="none",r.style.MozUserSelect="none",r.style.pointerEvents="none",i.gutter.style.cursor=$,i.parent.style.cursor=$,Ut.body.style.cursor=$,P.call(i),i.dragOffset=D(e)-i.end}}y===Rt?(i="width",a="clientX",r="left",o="right",n="clientWidth"):"vertical"===y&&(i="height",a="clientY",r="top",o="bottom",n="clientHeight"),f=L(f);var R=[];function q(e){var t=e.i===R.length,i=t?R[e.i-1]:R[e.i];P.call(i);var a=t?i.size-e.minSize-i._c:e.minSize+i._b;E.call(i,a)}return s=l.map((function(e,t){var a,r={element:Ot(e),size:f[t],minSize:u[t],maxSize:m[t],i:t};if(t>0&&((a={a:t-1,b:t,dragging:!1,direction:y,parent:c})._b=Bt(v,t-1==0,!1,w),a._c=Bt(v,!1,t===l.length-1,w),"row-reverse"===h||"column-reverse"===h)){var o=a.a;a.a=a.b,a.b=o}if(t>0){var n=_(t,y,r.element);!function(e,t,a){var r=z(i,t,a);Object.keys(r).forEach((function(t){e.style[t]=r[t]}))}(n,v,t),a._a=U.bind(a),n.addEventListener("mousedown",a._a),n.addEventListener("touchstart",a._a),c.insertBefore(n,r.element),a.gutter=n}return C(r.element,r.size,Bt(v,0===t,t===l.length-1,w),t),t>0&&R.push(a),r})),s.forEach((function(e){var t=e.element.getBoundingClientRect()[i];t0){var a=R[i-1],r=s[a.a],o=s[a.b];r.size=t[i-1],o.size=e,C(r.element,r.size,a._b,r.i),C(o.element,o.size,a._c,o.i)}}))},getSizes:A,collapse:function(e){q(s[e])},destroy:function(e,t){R.forEach((function(a){if(!0!==t?a.parent.removeChild(a.gutter):(a.gutter.removeEventListener("mousedown",a._a),a.gutter.removeEventListener("touchstart",a._a)),!0!==e){var r=S(i,a.a.size,a._b);Object.keys(r).forEach((function(e){s[a.a].element.style[e]="",s[a.b].element.style[e]=""}))}}))},parent:c,pairs:R}},Kt="search://";class Vt extends X{constructor(){super(),this.sourceUrl=null,this.inited=!1,this.isLoading=!1,this.coll="",this.collInfo=null,this._replaceLoc=!1,this._locUpdateNeeded=!1,this._locationHash="",this.tabData={},this.url="",this.ts="",this.tabNames=["pages","story","resources","info"],this.tabLabels={pages:"Pages",story:"Story",resources:"URLs",info:"Archive Info"},this.menuActive=!1,this.embedDropdownActive=!1,this.hasStory=!1,this.editable=!1,this.browsable=!0,this.clearable=!0,this.showSidebar="1"===localStorage.getItem("pages:showSidebar"),this.splitter=null,this.isVisible=!0,this.favIconUrl="",this.autoUpdateInterval=10,this._autoUpdater=null,this.appName="ReplayWeb.page",this.appVersion=me,this.appLogo=fe()}static get properties(){return{inited:{type:Boolean},sourceUrl:{type:String},loadInfo:{type:Object,attribute:!1},showSidebar:{type:Boolean},collInfo:{type:Object,attribute:!1},coll:{type:String},hasStory:{type:Boolean},isLoading:{type:Boolean},tabData:{type:Object,attribute:!1},url:{type:String},ts:{type:String},isFullscreen:{type:Boolean},menuActive:{type:Boolean},embed:{type:String},embedDropdownActive:{type:Boolean},editable:{type:Boolean},browsable:{type:Boolean},clearable:{type:Boolean},isVisible:{type:Boolean},favIconUrl:{type:String},appName:{type:String},appVersion:{type:String},appLogo:{type:String},autoUpdateInterval:{type:Number},swName:{type:String}}}firstUpdated(){this.inited=!0,window.addEventListener("hashchange",(e=>this.onHashChange(e))),this.addEventListener("fullscreenchange",(()=>{this.isFullscreen=!!document.fullscreenElement})),this.embed&&this.loadInfo&&this.loadInfo.hideOffscreen&&(this.observer=new IntersectionObserver((e=>{this.isVisible=e[0].isIntersecting})),this.observer.observe(this))}async runUpdateLoop(){try{for(;this.editable&&this.autoUpdateInterval&&(!this.collInfo||!this.collInfo.pages||this.collInfo.pages.length<100);)await new Promise((e=>setTimeout(e,1e3*this.autoUpdateInterval))),await this.doUpdateInfo(!0)}finally{this._autoUpdater=null}}updated(e){if(e.has("sourceUrl")&&this.doUpdateInfo(),e.has("editable")&&this.editable&&this.autoUpdateInterval&&!this._autoUpdater&&(this._autoUpdater=this.runUpdateLoop()),e.has("tabData")){if(!this.collInfo||!this.collInfo.coll)return;Object.keys(this.tabData).forEach((e=>!this.tabData[e]&&delete this.tabData[e]));const t="#"+new URLSearchParams(this.tabData).toString();if(this.tabData.url||(this.url=Kt+decodeURIComponent(this._paramsToString(this.tabData))),t!==this._locationHash){if(this._locationHash=t,this._replaceLoc||0===Object.keys(e.get("tabData")).length){const e=new URL(window.location.href);e.hash=this._locationHash,window.history.replaceState({},"",e.href),this._replaceLoc=!1}else if(window.location.hash=this._locationHash,!this.showSidebar){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.focus()}this.embed&&window.parent!==window&&window.parent.postMessage(this.tabData,"*")}this._locUpdateNeeded=!1}e.has("showSidebar")&&(this.embed||localStorage.setItem("pages:showSidebar",this.showSidebar?"1":"0")),(e.has("tabData")||e.has("showSidebar"))&&this.configureSplitter()}configureSplitter(){if(this.tabData.url&&this.showSidebar){const e=this.renderRoot.querySelector("#contents"),t=this.renderRoot.querySelector("wr-coll-replay");if(e&&t&&!this.splitter){const i={sizes:[30,70],minSize:[300,300],gutterSize:4,onDragStart(){t.setDisablePointer(!0)},onDragEnd(){t.setDisablePointer(!1)}};this.splitter=Gt([e,t],i)}}else if(this.splitter){try{this.splitter.destroy()}catch(e){}this.splitter=null}}async doUpdateInfo(e=!1){if(e&&this.tabData.url&&!this.showSidebar)return;let t=this.loadInfo&&this.loadInfo.customColl;if(!t){t=(await Je(this.sourceUrl)).coll}this.coll=t;const i="./w/api/c/"+t,a="./w/"+t,r=await fetch(i+"?all=1");if(200!=r.status)return void(this.collInfo={});const o=await r.json();if(this.collInfo={apiPrefix:i,replayPrefix:a,coll:t,...o},this.loadInfo&&this.loadInfo.extraConfig&&this.loadInfo.extraConfig.headers){const e=this.loadInfo.extraConfig.headers;await fetch(`${i}/updateAuth`,{method:"POST",body:JSON.stringify({headers:e})})}this.collInfo.title||(this.collInfo.title=this.collInfo.filename),"replayonly"!==this.embed&&"replay-with-info"!==this.embed||(this.showSidebar=!1),this.hasStory=this.collInfo.desc||this.collInfo.lists.length,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:{collInfo:this.collInfo,alreadyLoaded:!0}})),this.onHashChange()}onCollLoaded(e){this.doUpdateInfo(),this.loadInfo=null,e.detail.sourceUrl&&(this.sourceUrl=e.detail.sourceUrl),this.dispatchEvent(new CustomEvent("coll-loaded",{detail:{sourceUrl:this.sourceUrl,collInfo:this.collInfo}}))}onCollUpdate(e){this.editable&&(this.collInfo={...this.collInfo,...e.detail})}onHashChange(){const e=window.location.hash;if(e&&e!==this._locationHash&&(this.tabData=Object.fromEntries(new URLSearchParams(e.slice(1)).entries()),this._locationHash=e),this.collInfo.coll&&!this.tabNames.includes(this.tabData.view)){const e=this.hasStory?"story":this.editable||this.collInfo.pages.length?"pages":"resources";this.tabData={...this.tabData,view:e}}if(this.tabData.url&&this.tabData.url.startsWith("page:")){const e=Number(this.tabData.url.slice("page:".length));if(!isNaN(e)&&e`:this.collInfo?j` + >`:this.collInfo?T` ${this.renderLocationBar()} ${this.renderVerifyInfo()}
${this.renderTabHeader(t)} - ${t||!e?this.renderCollTabs(t):j``} + ${t||!e?this.renderCollTabs(t):T``}
- ${e&&this.isVisible?j` + ${e&&this.isVisible?T` `:""}
- `:j``}renderTabHeader(e){return j` `}renderLocationBar(){if("replayonly"===this.embed||"replay-with-info"==this.embed)return"";const e=et(this.ts).toLocaleString(),t=!!this.tabData.url,i=t&&this.favIconUrl;return j` `}renderLocationBar(){if("replayonly"===this.embed||"replay-with-info"==this.embed)return"";const e=Ke(this.ts).toLocaleString(),t=!!this.tabData.url,i=t&&this.favIconUrl;return T` @@ -1629,7 +1629,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour role="button" class="button narrow is-borderless is-hidden-mobile" @click="${this.onGoBack}" - @keyup="${$e}" + @keyup="${ge}" title="Back" aria-label="Back" > @@ -1638,7 +1638,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour size="1.0em" class="has-text-grey" aria-hidden="true" - .svg="${Ee()}" + .svg="${$e()}" > @@ -1647,7 +1647,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour role="button" class="button narrow is-borderless is-hidden-mobile" @click="${this.onGoForward}" - @keyup="${$e}" + @keyup="${ge}" title="Forward" aria-label="Forward" > @@ -1656,7 +1656,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour size="1.0em" class="has-text-grey" aria-hidden="true" - .svg="${Pe()}" + .svg="${Se()}" > @@ -1666,27 +1666,27 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour class="button narrow is-borderless ${this.isLoading?"is-loading":"is-hidden-mobile"}" id="refresh" @click="${this.onRefresh}" - @keyup="${$e}" + @keyup="${ge}" title="Reload" aria-label="Reload" > - ${this.isLoading?"":j` + ${this.isLoading?"":T` `} - ${this.browsable?j` `:""} @@ -1715,12 +1715,12 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour .value="${this.url}" placeholder="Enter text to search or a URL to replay" /> - ${t?j`

+ ${t?T`

${e} -

`:j``} - ${i?j` +

`:T``} + ${i?T` - `:j``} +
`:T``} @@ -1742,7 +1742,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour size="1.0em" class="has-text-grey" aria-hidden="true" - .svg="${zt()}" + .svg="${wt()}" > @@ -1754,14 +1754,14 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour role="button" class="dropdown-item is-hidden-desktop" @click="${this.onFullscreenToggle}" - @keyup="${$e}" + @keyup="${ge}" > Full Screen @@ -1771,14 +1771,14 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour role="button" class="dropdown-item is-hidden-tablet" @click="${this.onGoBack}" - @keyup="${$e}" + @keyup="${ge}" > Back @@ -1788,14 +1788,14 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour role="button" class="dropdown-item is-hidden-tablet" @click="${this.onGoForward}" - @keyup="${$e}" + @keyup="${ge}" > Forward @@ -1805,72 +1805,72 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour role="button" class="dropdown-item is-hidden-tablet" @click="${this.onRefresh}" - @keyup="${$e}" + @keyup="${ge}" > Reload - ${this.browsable?j` Browse Contents `:""} ${this.renderExtraToolbar(!0)} - ${this.clearable?j` + ${this.clearable?T` Purge Cache + Full Reload - `:j``} - ${!this.editable&&this.sourceUrl.startsWith("http://")||this.sourceUrl.startsWith("https://")?j` + `:T``} + ${!this.editable&&this.sourceUrl.startsWith("http://")||this.sourceUrl.startsWith("https://")?T` Download Archive - `:j``} - ${e?j` + `:T``} + ${e?T` `:""} @@ -1895,13 +1895,13 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour -

Skipped

`}renderVerifyInfo(){return"replay-with-info"!==this.embed?"":j`Skipped

`}renderVerifyInfo(){return"replay-with-info"!==this.embed?"":T` - `}dragStart(){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.setDisablePointer(!0)}dragEnd(){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.setDisablePointer(!1)}renderCollInfo(){return j`
+ `}dragStart(){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.setDisablePointer(!0)}dragEnd(){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.setDisablePointer(!1)}renderCollInfo(){return T`
-
`}renderExtraToolbar(){return""}renderCollTabs(e){const t=this.hasStory&&"story"===this.tabData.view,i="pages"===this.tabData.view,a="resources"===this.tabData.view,r="info"===this.tabData.view;return j` - ${r?this.renderCollInfo():j``} - ${t?j` `}renderExtraToolbar(){return""}renderCollTabs(e){const t=this.hasStory&&"story"===this.tabData.view,i="pages"===this.tabData.view,a="resources"===this.tabData.view,r="info"===this.tabData.view;return T` + ${r?this.renderCollInfo():T``} + ${t?T` `:""} - ${a?j` `:""} - ${i?j` `:""} - `}skipMenu(e){e.preventDefault(),this.renderRoot.querySelector("#skip-replay-target").focus()}onKeyDown(e){"Esc"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.currentTarget.value=this.url)}onMenu(e){e.stopPropagation(),this.menuActive=!this.menuActive,this.menuActive&&document.addEventListener("click",(()=>{this.menuActive=!1}),{once:!0})}onFullscreenToggle(e){e.preventDefault(),this.menuActive=!1,this.isFullscreen?document.exitFullscreen():this.requestFullscreen()}onGoBack(e){e.preventDefault(),this.menuActive=!1,window.history.back()}onGoForward(e){e.preventDefault(),this.menuActive=!1,window.history.forward()}onShowPages(e){e.preventDefault(),this.showSidebar||document.documentElement.clientWidth>=769?this.showSidebar=!this.showSidebar:(this.showSidebar=!1,this.updateTabData({url:"",ts:""}))}onFullPageView(e){e.preventDefault(),this.updateTabData({url:"",ts:""})}onHideSidebar(e){e.preventDefault(),this.showSidebar=!1}async onFavIcons(e){for(const t of e.detail.icons){const e=await fetch(t.href);if(200===e.status){const i=e.headers.get("Content-Type");if(i&&!i.startsWith("text/"))return void(this.favIconUrl=t.href)}}this.favIconUrl=""}onPurgeCache(e){e.preventDefault();const t=!e.detail||void 0===e.detail.reload||e.detail.reload;this.deleteFully(t)}async deleteFully(e=!1){const t=this.collInfo.apiPrefix+(e?"?reload=1":""),i=await fetch(t,{method:"DELETE"});200!==i.status&&console.warn("purge failed: "+i.status),e||this.embed?window.location.reload():window.location.search=""}onSubmit(e){e.preventDefault();const t=this.renderRoot.querySelector("input");return t.value?this.navigateTo(t.value):t.value=this.url,!1}onLostFocus(e){e.currentTarget.value||(e.currentTarget.value=this.url)}navigateTo(e){let t;if(e.startsWith("http://")||e.startsWith("https://")){if(t={url:e},e===this.tabData.url){const e=this.renderRoot.querySelector("wr-coll-replay");return void(e&&e.refresh())}}else t=e.startsWith(ei)?this._stringToParams(e):{query:e,view:"pages"};this.updateTabData(t)}_stringToParams(e){const t=new URLSearchParams(e.slice(ei.length)),i={url:"",ts:""};for(const e of["query","view","currList","currMime","urlSearchType"])t.has(e)&&(i[e]=t.get(e));return i}_paramsToString(e){const t=new URLSearchParams;for(const i of["query","view","currList","currMime","urlSearchType"])i in e&&t.set(i,e[i]);return t.toString()}onRefresh(e,t=!1){if(e&&e.preventDefault(),this.menuActive=!1,this.tabData.url){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.refresh()}else t||window.location.reload()}onAbout(){this.dispatchEvent(new CustomEvent("about-show"))}}function ii(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}customElements.define("wr-coll",ti);let ai={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const ri=/[&<>"']/,oi=/[&<>"']/g,ni=/[<>"']|&(?!#?\w+;)/,si=/[<>"']|&(?!#?\w+;)/g,li={"&":"&","<":"<",">":">",'"':""","'":"'"},ci=e=>li[e];function di(e,t){if(t){if(ri.test(e))return e.replace(oi,ci)}else if(ni.test(e))return e.replace(si,ci);return e}const hi=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function fi(e){return e.replace(hi,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const bi=/(^|[^\[])\^/g;function ui(e,t){e=e.source||e,t=t||"";const i={replace:(t,a)=>(a=(a=a.source||a).replace(bi,"$1"),e=e.replace(t,a),i),getRegex:()=>new RegExp(e,t)};return i}const pi=/[^\w:]/g,mi=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function gi(e,t,i){if(e){let e;try{e=decodeURIComponent(fi(i)).replace(pi,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!mi.test(i)&&(i=function(e,t){vi[" "+e]||(wi.test(e)?vi[" "+e]=e+"/":vi[" "+e]=Si(e,"/",!0));const i=-1===(e=vi[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(xi,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(ki,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}const vi={},wi=/^[^:]+:\/*[^/]*$/,xi=/^([^:]+:)[\s\S]*$/,ki=/^([^:]+:\/*[^/]*)[\s\S]*$/;const yi={exec:function(){}};function _i(e){let t,i,a=1;for(;a{let a=!1,r=t;for(;--r>=0&&"\\"===i[r];)a=!a;return a?"|":" |"})).split(/ \|/);let a=0;if(i[0].trim()||i.shift(),i[i.length-1].trim()||i.pop(),i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function Ai(e,t,i,a){const r=t.href,o=t.title?di(t.title):null,n=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){a.state.inLink=!0;const e={type:"link",raw:i,href:r,title:o,text:n,tokens:a.inlineTokens(n,[])};return a.state.inLink=!1,e}return{type:"image",raw:i,href:r,title:o,text:di(n)}}class Di{constructor(e){this.options=e||ai}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Si(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t){const i=e.match(/^(\s+)(?:```)/);if(null===i)return t;const a=i[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[i]=t;return i.length>=a.length?e.slice(a.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Si(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const i={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,a,r,o,n,s,l,c,d,h,f,b,u=t[1].trim();const p=u.length>1,m={type:"list",raw:"",ordered:p,start:p?+u.slice(0,-1):"",loose:!1,items:[]};u=p?`\\d{1,9}\\${u.slice(-1)}`:`\\${u}`,this.options.pedantic&&(u=p?u:"[*+-]");const g=new RegExp(`^( {0,3}${u})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(b=!1,t=g.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),c=t[2].split("\n",1)[0],d=e.split("\n",1)[0],this.options.pedantic?(o=2,f=c.trimLeft()):(o=t[2].search(/[^ ]/),o=o>4?1:o,f=c.slice(o),o+=t[1].length),s=!1,!c&&/^ *$/.test(d)&&(i+=d+"\n",e=e.substring(d.length+1),b=!0),!b){const t=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(h=e.split("\n",1)[0],c=h,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(c));){if(c.search(/[^ ]/)>=o||!c.trim())f+="\n"+c.slice(o);else{if(s)break;f+="\n"+c}s||c.trim()||(s=!0),i+=h+"\n",e=e.substring(h.length+1)}}m.loose||(l?m.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(a=/^\[[ xX]\] /.exec(f),a&&(r="[ ] "!==a[0],f=f.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:i,task:!!a,checked:r,loose:!1,text:f}),m.raw+=i}m.items[m.items.length-1].raw=i.trimRight(),m.items[m.items.length-1].text=f.trimRight(),m.raw=m.raw.trimRight();const v=m.items.length;for(n=0;n"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let i=0;for(const e of t)if("\n"===e&&(i+=1),i>1)return!0;return!1}));!m.loose&&e.length&&t&&(m.loose=!0,m.items[n].loose=!0)}return m}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):di(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:$i(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let i,a,r,o,n=e.align.length;for(i=0;i({text:e})));for(n=e.header.length,a=0;a/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):di(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Si(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const i=e.length;let a=0,r=0;for(;r-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],a="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(e)?i.slice(1):i.slice(1,-1)),Ai(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=(i[2]||i[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return Ai(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let a=this.rules.inline.emStrong.lDelim.exec(e);if(!a)return;if(a[3]&&i.match(/[\p{L}\p{N}]/u))return;const r=a[1]||a[2]||"";if(!r||r&&(""===i||this.rules.inline.punctuation.exec(i))){const i=a[0].length-1;let r,o,n=i,s=0;const l="*"===a[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(a=l.exec(t));){if(r=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!r)continue;if(o=r.length,a[3]||a[4]){n+=o;continue}if((a[5]||a[6])&&i%3&&!((i+o)%3)){s+=o;continue}if(n-=o,n>0)continue;if(o=Math.min(o,o+n+s),Math.min(i,o)%2){const t=e.slice(1,i+a.index+o);return{type:"em",raw:e.slice(0,i+a.index+o+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,i+a.index+o-1);return{type:"strong",raw:e.slice(0,i+a.index+o+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const i=/[^ ]/.test(e),a=/^ /.test(e)&&/ $/.test(e);return i&&a&&(e=e.substring(1,e.length-1)),e=di(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let e,a;return"@"===i[2]?(e=di(this.options.mangle?t(i[1]):i[1]),a="mailto:"+e):(e=di(i[1]),a=e),{type:"link",raw:i[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let e,a;if("@"===i[2])e=di(this.options.mangle?t(i[0]):i[0]),a="mailto:"+e;else{let t;do{t=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(t!==i[0]);e=di(i[0]),a="www."===i[1]?"http://"+e:e}return{type:"link",raw:i[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):di(i[0]):i[0]:di(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:e}}}}const Ei={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:yi,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Ei.def=ui(Ei.def).replace("label",Ei._label).replace("title",Ei._title).getRegex(),Ei.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ei.listItemStart=ui(/^( *)(bull) */).replace("bull",Ei.bullet).getRegex(),Ei.list=ui(Ei.list).replace(/bull/g,Ei.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ei.def.source+")").getRegex(),Ei._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ei._comment=/|$)/,Ei.html=ui(Ei.html,"i").replace("comment",Ei._comment).replace("tag",Ei._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ei.paragraph=ui(Ei._paragraph).replace("hr",Ei.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ei._tag).getRegex(),Ei.blockquote=ui(Ei.blockquote).replace("paragraph",Ei.paragraph).getRegex(),Ei.normal=_i({},Ei),Ei.gfm=_i({},Ei.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ei.gfm.table=ui(Ei.gfm.table).replace("hr",Ei.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ei._tag).getRegex(),Ei.gfm.paragraph=ui(Ei._paragraph).replace("hr",Ei.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ei.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ei._tag).getRegex(),Ei.pedantic=_i({},Ei.normal,{html:ui("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ei._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:yi,paragraph:ui(Ei.normal._paragraph).replace("hr",Ei.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ei.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Ii={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:yi,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:yi,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),a+="&#"+i+";";return a}Ii._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Ii.punctuation=ui(Ii.punctuation).replace(/punctuation/g,Ii._punctuation).getRegex(),Ii.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ii.escapedEmSt=/\\\*|\\_/g,Ii._comment=ui(Ei._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ii.emStrong.lDelim=ui(Ii.emStrong.lDelim).replace(/punct/g,Ii._punctuation).getRegex(),Ii.emStrong.rDelimAst=ui(Ii.emStrong.rDelimAst,"g").replace(/punct/g,Ii._punctuation).getRegex(),Ii.emStrong.rDelimUnd=ui(Ii.emStrong.rDelimUnd,"g").replace(/punct/g,Ii._punctuation).getRegex(),Ii._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ii._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ii._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ii.autolink=ui(Ii.autolink).replace("scheme",Ii._scheme).replace("email",Ii._email).getRegex(),Ii._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ii.tag=ui(Ii.tag).replace("comment",Ii._comment).replace("attribute",Ii._attribute).getRegex(),Ii._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ii._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ii._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ii.link=ui(Ii.link).replace("label",Ii._label).replace("href",Ii._href).replace("title",Ii._title).getRegex(),Ii.reflink=ui(Ii.reflink).replace("label",Ii._label).replace("ref",Ei._label).getRegex(),Ii.nolink=ui(Ii.nolink).replace("ref",Ei._label).getRegex(),Ii.reflinkSearch=ui(Ii.reflinkSearch,"g").replace("reflink",Ii.reflink).replace("nolink",Ii.nolink).getRegex(),Ii.normal=_i({},Ii),Ii.pedantic=_i({},Ii.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ui(/^!?\[(label)\]\((.*?)\)/).replace("label",Ii._label).getRegex(),reflink:ui(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ii._label).getRegex()}),Ii.gfm=_i({},Ii.normal,{escape:ui(Ii.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\!!(i=a.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),a=t[t.length-1],!a||"paragraph"!==a.type&&"text"!==a.type?t.push(i):(a.raw+="\n"+i.raw,a.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=a.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),a=t[t.length-1],!a||"paragraph"!==a.type&&"text"!==a.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(a.raw+="\n"+i.raw,a.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=a.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let a;this.options.extensions.startBlock.forEach((function(e){a=e.call({lexer:this},i),"number"==typeof a&&a>=0&&(t=Math.min(t,a))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(r)))a=t[t.length-1],o&&"paragraph"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(i),o=r.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),a=t[t.length-1],a&&"text"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,a,r,o,n,s,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+Ci("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+Ci("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(n||(s=""),n=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((a=>!!(i=a.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),a=t[t.length-1],a&&"text"===i.type&&"text"===a.type?(a.raw+=i.raw,a.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),a=t[t.length-1],a&&"text"===i.type&&"text"===a.type?(a.raw+=i.raw,a.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,l,s))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,Li))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,Li))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let a;this.options.extensions.startInline.forEach((function(e){a=e.call({lexer:this},i),"number"==typeof a&&a>=0&&(t=Math.min(t,a))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(i=this.tokenizer.inlineText(r,Pi))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(s=i.raw.slice(-1)),n=!0,a=t[t.length-1],a&&"text"===a.type?(a.raw+=i.raw,a.text+=i.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(i.raw.length),t.push(i);return t}}class Ui{constructor(e){this.options=e||ai}code(e,t,i){const a=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,a);null!=t&&t!==e&&(i=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",a?'
'+(i?e:di(e,!0))+"
\n":"
"+(i?e:di(e,!0))+"
\n"}blockquote(e){return"
\n"+e+"
\n"}html(e){return e}heading(e,t,i,a){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,i){const a=t?"ol":"ul";return"<"+a+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,i){if(null===(e=gi(this.options.sanitize,this.options.baseUrl,e)))return i;let a='",a}image(e,t,i){if(null===(e=gi(this.options.sanitize,this.options.baseUrl,e)))return i;let a=''+i+'":">",a}text(e){return e}}class Ri{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}class qi{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,a=0;if(this.seen.hasOwnProperty(i)){a=this.seen[e];do{a++,i=e+"-"+a}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=a,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}}class Mi{constructor(e){this.options=e||ai,this.options.renderer=this.options.renderer||new Ui,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ri,this.slugger=new qi}static parse(e,t){return new Mi(t).parse(e)}static parseInline(e,t){return new Mi(t).parseInline(e)}parse(e,t=!0){let i,a,r,o,n,s,l,c,d,h,f,b,u,p,m,g,v,w,x,k="";const y=e.length;for(i=0;i0&&"paragraph"===m.tokens[0].type?(m.tokens[0].text=w+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=w+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:w}):p+=w),p+=this.parse(m.tokens,u),d+=this.renderer.listitem(p,v,g);k+=this.renderer.list(d,f,b);continue;case"html":k+=this.renderer.html(h.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(d=h.tokens?this.parseInline(h.tokens):h.text;i+1{a(e.text,e.lang,(function(t,i){if(t)return o(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),n--,0===n&&o()}))}),0))})),void(0===n&&o())}try{const i=Ti.lex(e,t);return t.walkTokens&&ji.walkTokens(i,t.walkTokens),Mi.parse(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+di(e.message+"",!0)+"
    ";throw e}}ji.options=ji.setOptions=function(e){var t;return _i(ji.defaults,e),t=ji.defaults,ai=t,ji},ji.getDefaults=ii,ji.defaults=ai,ji.use=function(...e){const t=_i({},...e),i=ji.defaults.extensions||{renderers:{},childTokens:{}};let a;e.forEach((e=>{if(e.extensions&&(a=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=i.renderers?i.renderers[e.name]:null;i.renderers[e.name]=t?function(...i){let a=e.renderer.apply(this,i);return!1===a&&(a=t.apply(this,i)),a}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");i[e.level]?i[e.level].unshift(e.tokenizer):i[e.level]=[e.tokenizer],e.start&&("block"===e.level?i.startBlock?i.startBlock.push(e.start):i.startBlock=[e.start]:"inline"===e.level&&(i.startInline?i.startInline.push(e.start):i.startInline=[e.start]))}e.childTokens&&(i.childTokens[e.name]=e.childTokens)}))),e.renderer){const i=ji.defaults.renderer||new Ui;for(const t in e.renderer){const a=i[t];i[t]=(...r)=>{let o=e.renderer[t].apply(i,r);return!1===o&&(o=a.apply(i,r)),o}}t.renderer=i}if(e.tokenizer){const i=ji.defaults.tokenizer||new Di;for(const t in e.tokenizer){const a=i[t];i[t]=(...r)=>{let o=e.tokenizer[t].apply(i,r);return!1===o&&(o=a.apply(i,r)),o}}t.tokenizer=i}if(e.walkTokens){const i=ji.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),i&&i.call(this,t)}}a&&(t.extensions=i),ji.setOptions(t)}))},ji.walkTokens=function(e,t){for(const i of e)switch(t.call(ji,i),i.type){case"table":for(const e of i.header)ji.walkTokens(e.tokens,t);for(const e of i.rows)for(const i of e)ji.walkTokens(i.tokens,t);break;case"list":ji.walkTokens(i.items,t);break;default:ji.defaults.extensions&&ji.defaults.extensions.childTokens&&ji.defaults.extensions.childTokens[i.type]?ji.defaults.extensions.childTokens[i.type].forEach((function(e){ji.walkTokens(i[e],t)})):i.tokens&&ji.walkTokens(i.tokens,t)}},ji.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");zi(t=_i({},ji.defaults,t||{}));try{const i=Ti.lexInline(e,t);return t.walkTokens&&ji.walkTokens(i,t.walkTokens),Mi.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+di(e.message+"",!0)+"
    ";throw e}},ji.Parser=Mi,ji.parser=Mi.parse,ji.Renderer=Ui,ji.TextRenderer=Ri,ji.Lexer=Ti,ji.lexer=Ti.lex,ji.Tokenizer=Di,ji.Slugger=qi,ji.parse=ji;ji.options,ji.setOptions,ji.use,ji.walkTokens,ji.parseInline,Mi.parse,Ti.lex;class Oi extends oe{constructor(){super(),this.collInfo=null,this.curatedPageMap={},this.currList=0,this.active=!1,this.lastST=0,this.clickTime=0,this.isSidebar=!1,this.splitDirection=!1}static get properties(){return{collInfo:{type:Object},active:{type:Boolean},curatedPageMap:{type:Object},currList:{type:Number},isSidebar:{type:Boolean},splitDirection:{type:Boolean}}}recalcSplitter(e){this.splitDirection=this.isSidebar||e<769?"vertical":"horizontal"}firstUpdated(){this.recalcSplitter(document.documentElement.clientWidth),this.obs=new ResizeObserver((e=>{this.recalcSplitter(e[0].contentRect.width)})),this.obs.observe(this)}updated(e){e.has("collInfo")&&this.doLoadCurated(),(e.has("collInfo")||e.has("isSidebar"))&&this.recalcSplitter(document.documentElement.clientWidth),e.has("splitDirection")&&this.configureSplitter(),e.has("currList")&&this.active&&this.sendChangeEvent({currList:this.currList})}configureSplitter(){const e=this.renderRoot.querySelector(".sidebar"),t=this.renderRoot.querySelector(".main-content");if(this.splitter){try{this.splitter.destroy()}catch(e){}this.splitter=null}if(e&&t&&!this.splitter){const i={sizes:[20,80],gutterSize:4,direction:this.splitDirection};this.splitter=Xt([e,t],i)}}async doLoadCurated(){this.curatedPageMap={};const e={};for(const t of this.collInfo.pages)e[t.id]=t;for(const e of this.collInfo.curatedPages){this.curatedPageMap[e.list]||(this.curatedPageMap[e.list]=[]);const t=e,i=t.url,a=t.ts,r=t.title||t.url,o=e.desc;this.curatedPageMap[e.list].push({url:i,ts:a,title:r,desc:o})}this.scrollToList()}static get styles(){return ke(n` + `}skipMenu(e){e.preventDefault(),this.renderRoot.querySelector("#skip-replay-target").focus()}onKeyDown(e){"Esc"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.currentTarget.value=this.url)}onMenu(e){e.stopPropagation(),this.menuActive=!this.menuActive,this.menuActive&&document.addEventListener("click",(()=>{this.menuActive=!1}),{once:!0})}onFullscreenToggle(e){e.preventDefault(),this.menuActive=!1,this.isFullscreen?document.exitFullscreen():this.requestFullscreen()}onGoBack(e){e.preventDefault(),this.menuActive=!1,window.history.back()}onGoForward(e){e.preventDefault(),this.menuActive=!1,window.history.forward()}onShowPages(e){e.preventDefault(),this.showSidebar||document.documentElement.clientWidth>=769?this.showSidebar=!this.showSidebar:(this.showSidebar=!1,this.updateTabData({url:"",ts:""}))}onFullPageView(e){e.preventDefault(),this.updateTabData({url:"",ts:""})}onHideSidebar(e){e.preventDefault(),this.showSidebar=!1}async onFavIcons(e){for(const t of e.detail.icons){const e=await fetch(t.href);if(200===e.status){const i=e.headers.get("Content-Type");if(i&&!i.startsWith("text/"))return void(this.favIconUrl=t.href)}}this.favIconUrl=""}onPurgeCache(e){e.preventDefault();const t=!e.detail||void 0===e.detail.reload||e.detail.reload;this.deleteFully(t)}async deleteFully(e=!1){const t=this.collInfo.apiPrefix+(e?"?reload=1":""),i=await fetch(t,{method:"DELETE"});200!==i.status&&console.warn("purge failed: "+i.status),e||this.embed?window.location.reload():window.location.search=""}onSubmit(e){e.preventDefault();const t=this.renderRoot.querySelector("input");return t.value?this.navigateTo(t.value):t.value=this.url,!1}onLostFocus(e){e.currentTarget.value||(e.currentTarget.value=this.url)}navigateTo(e){let t;if(e.startsWith("http://")||e.startsWith("https://")){if(t={url:e},e===this.tabData.url){const e=this.renderRoot.querySelector("wr-coll-replay");return void(e&&e.refresh())}}else t=e.startsWith(Kt)?this._stringToParams(e):{query:e,view:"pages"};this.updateTabData(t)}_stringToParams(e){const t=new URLSearchParams(e.slice(Kt.length)),i={url:"",ts:""};for(const e of["query","view","currList","currMime","urlSearchType"])t.has(e)&&(i[e]=t.get(e));return i}_paramsToString(e){const t=new URLSearchParams;for(const i of["query","view","currList","currMime","urlSearchType"])i in e&&t.set(i,e[i]);return t.toString()}onRefresh(e,t=!1){if(e&&e.preventDefault(),this.menuActive=!1,this.tabData.url){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.refresh()}else t||window.location.reload()}onAbout(){this.dispatchEvent(new CustomEvent("about-show"))}}function Zt(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}customElements.define("wr-coll",Vt);let Qt={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Jt=/[&<>"']/,Yt=/[&<>"']/g,Xt=/[<>"']|&(?!#?\w+;)/,ei=/[<>"']|&(?!#?\w+;)/g,ti={"&":"&","<":"<",">":">",'"':""","'":"'"},ii=e=>ti[e];function ai(e,t){if(t){if(Jt.test(e))return e.replace(Yt,ii)}else if(Xt.test(e))return e.replace(ei,ii);return e}const ri=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function oi(e){return e.replace(ri,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ni=/(^|[^\[])\^/g;function si(e,t){e=e.source||e,t=t||"";const i={replace:(t,a)=>(a=(a=a.source||a).replace(ni,"$1"),e=e.replace(t,a),i),getRegex:()=>new RegExp(e,t)};return i}const li=/[^\w:]/g,ci=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function di(e,t,i){if(e){let e;try{e=decodeURIComponent(oi(i)).replace(li,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!ci.test(i)&&(i=function(e,t){hi[" "+e]||(fi.test(e)?hi[" "+e]=e+"/":hi[" "+e]=vi(e,"/",!0));const i=-1===(e=hi[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(bi,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(ui,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}const hi={},fi=/^[^:]+:\/*[^/]*$/,bi=/^([^:]+:)[\s\S]*$/,ui=/^([^:]+:\/*[^/]*)[\s\S]*$/;const pi={exec:function(){}};function mi(e){let t,i,a=1;for(;a{let a=!1,r=t;for(;--r>=0&&"\\"===i[r];)a=!a;return a?"|":" |"})).split(/ \|/);let a=0;if(i[0].trim()||i.shift(),i[i.length-1].trim()||i.pop(),i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function ki(e,t,i,a){const r=t.href,o=t.title?ai(t.title):null,n=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){a.state.inLink=!0;const e={type:"link",raw:i,href:r,title:o,text:n,tokens:a.inlineTokens(n,[])};return a.state.inLink=!1,e}return{type:"image",raw:i,href:r,title:o,text:ai(n)}}class yi{constructor(e){this.options=e||Qt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:vi(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t){const i=e.match(/^(\s+)(?:```)/);if(null===i)return t;const a=i[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[i]=t;return i.length>=a.length?e.slice(a.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=vi(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const i={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,a,r,o,n,s,l,c,d,h,f,b,u=t[1].trim();const p=u.length>1,m={type:"list",raw:"",ordered:p,start:p?+u.slice(0,-1):"",loose:!1,items:[]};u=p?`\\d{1,9}\\${u.slice(-1)}`:`\\${u}`,this.options.pedantic&&(u=p?u:"[*+-]");const g=new RegExp(`^( {0,3}${u})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(b=!1,t=g.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),c=t[2].split("\n",1)[0],d=e.split("\n",1)[0],this.options.pedantic?(o=2,f=c.trimLeft()):(o=t[2].search(/[^ ]/),o=o>4?1:o,f=c.slice(o),o+=t[1].length),s=!1,!c&&/^ *$/.test(d)&&(i+=d+"\n",e=e.substring(d.length+1),b=!0),!b){const t=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(h=e.split("\n",1)[0],c=h,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(c));){if(c.search(/[^ ]/)>=o||!c.trim())f+="\n"+c.slice(o);else{if(s)break;f+="\n"+c}s||c.trim()||(s=!0),i+=h+"\n",e=e.substring(h.length+1)}}m.loose||(l?m.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(a=/^\[[ xX]\] /.exec(f),a&&(r="[ ] "!==a[0],f=f.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:i,task:!!a,checked:r,loose:!1,text:f}),m.raw+=i}m.items[m.items.length-1].raw=i.trimRight(),m.items[m.items.length-1].text=f.trimRight(),m.raw=m.raw.trimRight();const v=m.items.length;for(n=0;n"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let i=0;for(const e of t)if("\n"===e&&(i+=1),i>1)return!0;return!1}));!m.loose&&e.length&&t&&(m.loose=!0,m.items[n].loose=!0)}return m}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):ai(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:gi(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let i,a,r,o,n=e.align.length;for(i=0;i({text:e})));for(n=e.header.length,a=0;a/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):ai(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=vi(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const i=e.length;let a=0,r=0;for(;r-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],a="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(e)?i.slice(1):i.slice(1,-1)),ki(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=(i[2]||i[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return ki(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let a=this.rules.inline.emStrong.lDelim.exec(e);if(!a)return;if(a[3]&&i.match(/[\p{L}\p{N}]/u))return;const r=a[1]||a[2]||"";if(!r||r&&(""===i||this.rules.inline.punctuation.exec(i))){const i=a[0].length-1;let r,o,n=i,s=0;const l="*"===a[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(a=l.exec(t));){if(r=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!r)continue;if(o=r.length,a[3]||a[4]){n+=o;continue}if((a[5]||a[6])&&i%3&&!((i+o)%3)){s+=o;continue}if(n-=o,n>0)continue;if(o=Math.min(o,o+n+s),Math.min(i,o)%2){const t=e.slice(1,i+a.index+o);return{type:"em",raw:e.slice(0,i+a.index+o+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,i+a.index+o-1);return{type:"strong",raw:e.slice(0,i+a.index+o+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const i=/[^ ]/.test(e),a=/^ /.test(e)&&/ $/.test(e);return i&&a&&(e=e.substring(1,e.length-1)),e=ai(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let e,a;return"@"===i[2]?(e=ai(this.options.mangle?t(i[1]):i[1]),a="mailto:"+e):(e=ai(i[1]),a=e),{type:"link",raw:i[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let e,a;if("@"===i[2])e=ai(this.options.mangle?t(i[0]):i[0]),a="mailto:"+e;else{let t;do{t=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(t!==i[0]);e=ai(i[0]),a="www."===i[1]?"http://"+e:e}return{type:"link",raw:i[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):ai(i[0]):i[0]:ai(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:e}}}}const $i={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:pi,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};$i.def=si($i.def).replace("label",$i._label).replace("title",$i._title).getRegex(),$i.bullet=/(?:[*+-]|\d{1,9}[.)])/,$i.listItemStart=si(/^( *)(bull) */).replace("bull",$i.bullet).getRegex(),$i.list=si($i.list).replace(/bull/g,$i.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$i.def.source+")").getRegex(),$i._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",$i._comment=/|$)/,$i.html=si($i.html,"i").replace("comment",$i._comment).replace("tag",$i._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$i.paragraph=si($i._paragraph).replace("hr",$i.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$i._tag).getRegex(),$i.blockquote=si($i.blockquote).replace("paragraph",$i.paragraph).getRegex(),$i.normal=mi({},$i),$i.gfm=mi({},$i.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),$i.gfm.table=si($i.gfm.table).replace("hr",$i.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$i._tag).getRegex(),$i.gfm.paragraph=si($i._paragraph).replace("hr",$i.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",$i.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$i._tag).getRegex(),$i.pedantic=mi({},$i.normal,{html:si("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",$i._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pi,paragraph:si($i.normal._paragraph).replace("hr",$i.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",$i.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const _i={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:pi,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:pi,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),a+="&#"+i+";";return a}_i._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",_i.punctuation=si(_i.punctuation).replace(/punctuation/g,_i._punctuation).getRegex(),_i.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,_i.escapedEmSt=/\\\*|\\_/g,_i._comment=si($i._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),_i.emStrong.lDelim=si(_i.emStrong.lDelim).replace(/punct/g,_i._punctuation).getRegex(),_i.emStrong.rDelimAst=si(_i.emStrong.rDelimAst,"g").replace(/punct/g,_i._punctuation).getRegex(),_i.emStrong.rDelimUnd=si(_i.emStrong.rDelimUnd,"g").replace(/punct/g,_i._punctuation).getRegex(),_i._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,_i._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,_i._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,_i.autolink=si(_i.autolink).replace("scheme",_i._scheme).replace("email",_i._email).getRegex(),_i._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,_i.tag=si(_i.tag).replace("comment",_i._comment).replace("attribute",_i._attribute).getRegex(),_i._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_i._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,_i._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,_i.link=si(_i.link).replace("label",_i._label).replace("href",_i._href).replace("title",_i._title).getRegex(),_i.reflink=si(_i.reflink).replace("label",_i._label).replace("ref",$i._label).getRegex(),_i.nolink=si(_i.nolink).replace("ref",$i._label).getRegex(),_i.reflinkSearch=si(_i.reflinkSearch,"g").replace("reflink",_i.reflink).replace("nolink",_i.nolink).getRegex(),_i.normal=mi({},_i),_i.pedantic=mi({},_i.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:si(/^!?\[(label)\]\((.*?)\)/).replace("label",_i._label).getRegex(),reflink:si(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_i._label).getRegex()}),_i.gfm=mi({},_i.normal,{escape:si(_i.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\!!(i=a.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),a=t[t.length-1],!a||"paragraph"!==a.type&&"text"!==a.type?t.push(i):(a.raw+="\n"+i.raw,a.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=a.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),a=t[t.length-1],!a||"paragraph"!==a.type&&"text"!==a.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(a.raw+="\n"+i.raw,a.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=a.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let a;this.options.extensions.startBlock.forEach((function(e){a=e.call({lexer:this},i),"number"==typeof a&&a>=0&&(t=Math.min(t,a))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(r)))a=t[t.length-1],o&&"paragraph"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(i),o=r.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),a=t[t.length-1],a&&"text"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,a,r,o,n,s,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+xi("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+xi("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(n||(s=""),n=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((a=>!!(i=a.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),a=t[t.length-1],a&&"text"===i.type&&"text"===a.type?(a.raw+=i.raw,a.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),a=t[t.length-1],a&&"text"===i.type&&"text"===a.type?(a.raw+=i.raw,a.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,l,s))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,zi))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,zi))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let a;this.options.extensions.startInline.forEach((function(e){a=e.call({lexer:this},i),"number"==typeof a&&a>=0&&(t=Math.min(t,a))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(i=this.tokenizer.inlineText(r,Si))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(s=i.raw.slice(-1)),n=!0,a=t[t.length-1],a&&"text"===a.type?(a.raw+=i.raw,a.text+=i.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(i.raw.length),t.push(i);return t}}class Ai{constructor(e){this.options=e||Qt}code(e,t,i){const a=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,a);null!=t&&t!==e&&(i=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",a?'
    '+(i?e:ai(e,!0))+"
    \n":"
    "+(i?e:ai(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,i,a){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,i){const a=t?"ol":"ul";return"<"+a+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,i){if(null===(e=di(this.options.sanitize,this.options.baseUrl,e)))return i;let a='
    ",a}image(e,t,i){if(null===(e=di(this.options.sanitize,this.options.baseUrl,e)))return i;let a=''+i+'":">",a}text(e){return e}}class Di{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}class Ei{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,a=0;if(this.seen.hasOwnProperty(i)){a=this.seen[e];do{a++,i=e+"-"+a}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=a,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}}class Ii{constructor(e){this.options=e||Qt,this.options.renderer=this.options.renderer||new Ai,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Di,this.slugger=new Ei}static parse(e,t){return new Ii(t).parse(e)}static parseInline(e,t){return new Ii(t).parseInline(e)}parse(e,t=!0){let i,a,r,o,n,s,l,c,d,h,f,b,u,p,m,g,v,w,x,k="";const y=e.length;for(i=0;i0&&"paragraph"===m.tokens[0].type?(m.tokens[0].text=w+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=w+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:w}):p+=w),p+=this.parse(m.tokens,u),d+=this.renderer.listitem(p,v,g);k+=this.renderer.list(d,f,b);continue;case"html":k+=this.renderer.html(h.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(d=h.tokens?this.parseInline(h.tokens):h.text;i+1{a(e.text,e.lang,(function(t,i){if(t)return o(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),n--,0===n&&o()}))}),0))})),void(0===n&&o())}try{const i=Ci.lex(e,t);return t.walkTokens&&Pi.walkTokens(i,t.walkTokens),Ii.parse(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+ai(e.message+"",!0)+"
    ";throw e}}Pi.options=Pi.setOptions=function(e){var t;return mi(Pi.defaults,e),t=Pi.defaults,Qt=t,Pi},Pi.getDefaults=Zt,Pi.defaults=Qt,Pi.use=function(...e){const t=mi({},...e),i=Pi.defaults.extensions||{renderers:{},childTokens:{}};let a;e.forEach((e=>{if(e.extensions&&(a=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=i.renderers?i.renderers[e.name]:null;i.renderers[e.name]=t?function(...i){let a=e.renderer.apply(this,i);return!1===a&&(a=t.apply(this,i)),a}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");i[e.level]?i[e.level].unshift(e.tokenizer):i[e.level]=[e.tokenizer],e.start&&("block"===e.level?i.startBlock?i.startBlock.push(e.start):i.startBlock=[e.start]:"inline"===e.level&&(i.startInline?i.startInline.push(e.start):i.startInline=[e.start]))}e.childTokens&&(i.childTokens[e.name]=e.childTokens)}))),e.renderer){const i=Pi.defaults.renderer||new Ai;for(const t in e.renderer){const a=i[t];i[t]=(...r)=>{let o=e.renderer[t].apply(i,r);return!1===o&&(o=a.apply(i,r)),o}}t.renderer=i}if(e.tokenizer){const i=Pi.defaults.tokenizer||new yi;for(const t in e.tokenizer){const a=i[t];i[t]=(...r)=>{let o=e.tokenizer[t].apply(i,r);return!1===o&&(o=a.apply(i,r)),o}}t.tokenizer=i}if(e.walkTokens){const i=Pi.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),i&&i.call(this,t)}}a&&(t.extensions=i),Pi.setOptions(t)}))},Pi.walkTokens=function(e,t){for(const i of e)switch(t.call(Pi,i),i.type){case"table":for(const e of i.header)Pi.walkTokens(e.tokens,t);for(const e of i.rows)for(const i of e)Pi.walkTokens(i.tokens,t);break;case"list":Pi.walkTokens(i.items,t);break;default:Pi.defaults.extensions&&Pi.defaults.extensions.childTokens&&Pi.defaults.extensions.childTokens[i.type]?Pi.defaults.extensions.childTokens[i.type].forEach((function(e){Pi.walkTokens(i[e],t)})):i.tokens&&Pi.walkTokens(i.tokens,t)}},Pi.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");wi(t=mi({},Pi.defaults,t||{}));try{const i=Ci.lexInline(e,t);return t.walkTokens&&Pi.walkTokens(i,t.walkTokens),Ii.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+ai(e.message+"",!0)+"
    ";throw e}},Pi.Parser=Ii,Pi.parser=Ii.parse,Pi.Renderer=Ai,Pi.TextRenderer=Di,Pi.Lexer=Ci,Pi.lexer=Ci.lex,Pi.Tokenizer=yi,Pi.Slugger=Ei,Pi.parse=Pi;Pi.options,Pi.setOptions,Pi.use,Pi.walkTokens,Pi.parseInline,Ii.parse,Ci.lex;class Li extends X{constructor(){super(),this.collInfo=null,this.curatedPageMap={},this.currList=0,this.active=!1,this.lastST=0,this.clickTime=0,this.isSidebar=!1,this.splitDirection=!1}static get properties(){return{collInfo:{type:Object},active:{type:Boolean},curatedPageMap:{type:Object},currList:{type:Number},isSidebar:{type:Boolean},splitDirection:{type:Boolean}}}recalcSplitter(e){this.splitDirection=this.isSidebar||e<769?"vertical":"horizontal"}firstUpdated(){this.recalcSplitter(document.documentElement.clientWidth),this.obs=new ResizeObserver((e=>{this.recalcSplitter(e[0].contentRect.width)})),this.obs.observe(this)}updated(e){e.has("collInfo")&&this.doLoadCurated(),(e.has("collInfo")||e.has("isSidebar"))&&this.recalcSplitter(document.documentElement.clientWidth),e.has("splitDirection")&&this.configureSplitter(),e.has("currList")&&this.active&&this.sendChangeEvent({currList:this.currList})}configureSplitter(){const e=this.renderRoot.querySelector(".sidebar"),t=this.renderRoot.querySelector(".main-content");if(this.splitter){try{this.splitter.destroy()}catch(e){}this.splitter=null}if(e&&t&&!this.splitter){const i={sizes:[20,80],gutterSize:4,direction:this.splitDirection};this.splitter=Gt([e,t],i)}}async doLoadCurated(){this.curatedPageMap={};const e={};for(const t of this.collInfo.pages)e[t.id]=t;for(const e of this.collInfo.curatedPages){this.curatedPageMap[e.list]||(this.curatedPageMap[e.list]=[]);const t=e,i=t.url,a=t.ts,r=t.title||t.url,o=e.desc;this.curatedPageMap[e.list].push({url:i,ts:a,title:r,desc:o})}this.scrollToList()}static get styles(){return ue(o` :host { width: 100%; height: 100%; @@ -1972,7 +1972,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour width: 100% !important; } - ${Oi.sidebarStyles(o(":host(.sidebar)"))} + ${Li.sidebarStyles(r(":host(.sidebar)"))} .desc p { margin-bottom: 1em; @@ -2018,7 +2018,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour } @media screen and (max-width: 768px) { - ${Oi.sidebarStyles()} + ${Li.sidebarStyles()} } .gutter.gutter-vertical:hover { @@ -2028,7 +2028,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour .gutter.gutter-horizontal:hover { cursor: col-resize; } - `)}static sidebarStyles(e=n``){return n` + `)}static sidebarStyles(e=o``){return o` ${e} .columns { position: relative; } @@ -2050,7 +2050,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour ${e} .menu { font-size: 0.8rem; } - `}render(){const e=this.currList;return j` + `}render(){const e=this.currList;return T`
    - `}renderLists(){return j` ${this.collInfo.lists.map((e=>j` + `}renderLists(){return T` ${this.collInfo.lists.map((e=>T`

    ${e.title}

    ${e.desc}

      - ${this.curatedPageMap[e.id]?this.curatedPageMap[e.id].map((e=>this.renderCPage(e))):j``} + ${this.curatedPageMap[e.id]?this.curatedPageMap[e.id].map((e=>this.renderCPage(e))):T``}
    - `))}`}renderCPage(e){const t=new Date(e.ts),i=it(t.toISOString());return j`
  • + `))}`}renderCPage(e){const t=new Date(e.ts),i=Ze(t.toISOString());return T`

  • -
  • `}onReplay(e){e.preventDefault();const t={url:e.currentTarget.getAttribute("data-url"),ts:e.currentTarget.getAttribute("data-ts")};return this.sendChangeEvent(t),!1}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}onClickScroll(e){return e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list")),this.scrollToList(),!1}scrollToList(){this.currList>this.collInfo.lists.length&&(this.currList=0);const e={behavior:"smooth",block:"nearest",inline:"nearest"};this.clickTime=(new Date).getTime();const t=this.renderRoot.getElementById("list-"+this.currList);t&&t.scrollIntoView(e)}onScroll(e){const t=e.currentTarget,i=this.renderRoot.getElementById("list-"+this.currList);if(!i)return;let a=i;const r=t.offsetTop,o=t.scrollTop;if(o>this.lastST)for(;a.nextElementSibling&&a.nextElementSibling.getBoundingClientRect().top=r;)a=a.previousElementSibling;if(this.lastST=o,a&&a!=i&&a.id.startsWith("list-")&&(this.currList=Number(a.id.slice(5))),(new Date).getTime()-this.clickTime<1e3)return;const n=this.renderRoot.querySelector(`a[data-list="${this.currList}"]`);if(n){const e={behavior:"smooth",block:"nearest",inline:"nearest"};n.scrollIntoView(e)}}}customElements.define("wr-coll-story",Oi);var Ni=__webpack_require__(199),Bi=__webpack_require__.n(Ni);class Fi extends oe{constructor(){super(),this.state="trypublic",this.sourceUrl="",this.scriptLoaded=!1,this.error=!1}static get properties(){return{state:{type:String},sourceUrl:{type:String},error:{type:Boolean},reauth:{type:Boolean}}}updated(e){e.has("sourceUrl")&&(this.error=!1,this.state="trypublic",this.tryPublicAccess().then((e=>{e||(this.state="tryauto",this.requestUpdate())})))}async tryPublicAccess(){try{const e=this.sourceUrl,t=`https://helper-proxy.webrecorder.workers.dev/g/${e.slice("googledrive://".length)}`;let i=null;try{i=await fetch(t)}catch(e){return!1}const a=await i.json();if(!a.url||!a.name||!a.size)return!1;if(a.size>15e6)return!1;const r=a.url;try{const e=new AbortController,t=e.signal;if(i=await fetch(r,{signal:t}),e.abort(),200!=i.status)return!1}catch(e){return!1}const o=a.name,n={publicUrl:r},s=Number(a.size);return this.dispatchEvent(new CustomEvent("load-ready",{detail:{name:o,extra:n,size:s,sourceUrl:e}})),!0}catch(e){return!1}}onLoad(){this.scriptLoaded=!0,this.gauth("none",(e=>{e.error?"implicitonly"!==this.state&&(this.state="trymanual"):this.authed(e)}))}onClickAuth(){this.gauth("select_account",(e=>{e.error||this.authed(e)}))}async authed(e){const t=this.sourceUrl,i=`https://www.googleapis.com/drive/v3/files/${t.slice("googledrive://".length)}`,a={Authorization:`Bearer ${e.access_token}`},r=await fetch(i+"?fields=name,size&supportsAllDrives=true",{headers:a});if(404===r.status||403==r.status)return"implicitonly"!==this.state&&(this.state="trymanual"),void(this.error=!0);this.error=!1;const o=await r.json(),n=o.name,s=Number(o.size);this.dispatchEvent(new CustomEvent("load-ready",{detail:{sourceUrl:t,headers:a,size:s,name:n}}))}static get styles(){return ke(n``)}render(){return j` ${this.script()} - ${"trymanual"!==this.state?j`

    Connecting to Google Drive...

    `:j` - ${this.error?j` + `}onReplay(e){e.preventDefault();const t={url:e.currentTarget.getAttribute("data-url"),ts:e.currentTarget.getAttribute("data-ts")};return this.sendChangeEvent(t),!1}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}onClickScroll(e){return e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list")),this.scrollToList(),!1}scrollToList(){this.currList>this.collInfo.lists.length&&(this.currList=0);const e={behavior:"smooth",block:"nearest",inline:"nearest"};this.clickTime=(new Date).getTime();const t=this.renderRoot.getElementById("list-"+this.currList);t&&t.scrollIntoView(e)}onScroll(e){const t=e.currentTarget,i=this.renderRoot.getElementById("list-"+this.currList);if(!i)return;let a=i;const r=t.offsetTop,o=t.scrollTop;if(o>this.lastST)for(;a.nextElementSibling&&a.nextElementSibling.getBoundingClientRect().top=r;)a=a.previousElementSibling;if(this.lastST=o,a&&a!=i&&a.id.startsWith("list-")&&(this.currList=Number(a.id.slice(5))),(new Date).getTime()-this.clickTime<1e3)return;const n=this.renderRoot.querySelector(`a[data-list="${this.currList}"]`);if(n){const e={behavior:"smooth",block:"nearest",inline:"nearest"};n.scrollIntoView(e)}}}customElements.define("wr-coll-story",Li);var Ti=__webpack_require__(199),Ui=__webpack_require__.n(Ti);class Ri extends X{constructor(){super(),this.state="trypublic",this.sourceUrl="",this.scriptLoaded=!1,this.error=!1}static get properties(){return{state:{type:String},sourceUrl:{type:String},error:{type:Boolean},reauth:{type:Boolean}}}updated(e){e.has("sourceUrl")&&(this.error=!1,this.state="trypublic",this.tryPublicAccess().then((e=>{e||(this.state="tryauto",this.requestUpdate())})))}async tryPublicAccess(){try{const e=this.sourceUrl,t=`https://helper-proxy.webrecorder.workers.dev/g/${e.slice("googledrive://".length)}`;let i=null;try{i=await fetch(t)}catch(e){return!1}const a=await i.json();if(!a.url||!a.name||!a.size)return!1;if(a.size>15e6)return!1;const r=a.url;try{const e=new AbortController,t=e.signal;if(i=await fetch(r,{signal:t}),e.abort(),200!=i.status)return!1}catch(e){return!1}const o=a.name,n={publicUrl:r},s=Number(a.size);return this.dispatchEvent(new CustomEvent("load-ready",{detail:{name:o,extra:n,size:s,sourceUrl:e}})),!0}catch(e){return!1}}onLoad(){this.scriptLoaded=!0,this.gauth("none",(e=>{e.error?"implicitonly"!==this.state&&(this.state="trymanual"):this.authed(e)}))}onClickAuth(){this.gauth("select_account",(e=>{e.error||this.authed(e)}))}async authed(e){const t=this.sourceUrl,i=`https://www.googleapis.com/drive/v3/files/${t.slice("googledrive://".length)}`,a={Authorization:`Bearer ${e.access_token}`},r=await fetch(i+"?fields=name,size&supportsAllDrives=true",{headers:a});if(404===r.status||403==r.status)return"implicitonly"!==this.state&&(this.state="trymanual"),void(this.error=!0);this.error=!1;const o=await r.json(),n=o.name,s=Number(o.size);this.dispatchEvent(new CustomEvent("load-ready",{detail:{sourceUrl:t,headers:a,size:s,name:n}}))}static get styles(){return ue(o``)}render(){return T` ${this.script()} + ${"trymanual"!==this.state?T`

    Connecting to Google Drive...

    `:T` + ${this.error?T`

    ${this.reauth?"Some resources are loaded on demand from Google Drive, which requires reauthorization.":"Could not access this file with the current Google Drive account."} @@ -2138,11 +2138,11 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour @click="${this.onClickAuth}" > Authorize Google Drive - `}`}script(){if("trypublic"===this.state||this.scriptLoaded)return j``;const e=document.createElement("script");return e.onload=()=>this.onLoad(),e.src="https://apis.google.com/js/platform.js",e}gauth(e,t){self.gapi.load("auth2",(()=>{self.gapi.auth2.authorize({client_id:"160798412227-tko4c82uopud11q105b2lvbogsj77hlg.apps.googleusercontent.com",scope:"https://www.googleapis.com/auth/drive.file",response_type:"token",prompt:e},t)}))}}customElements.define("wr-gdrive",Fi);class Hi extends oe{constructor(){super(),this.progress=0,this.total=0,this.percent=0,this.coll="",this.state="waiting",this.loadInfo=null,this.currentSize=0,this.totalSize=0,this.tryFileHandle=!!window.showOpenFilePicker,this.fileHandle=null,this.errorAllowRetry=!1,this.pingInterval=0,this.noWebWorker=!1}static get properties(){return{sourceUrl:{type:String},loadInfo:{type:Object},state:{type:String},progress:{type:Number},percent:{type:Number},currentSize:{type:Number},totalSize:{type:Number},error:{type:String},total:{type:Number},status:{type:String},coll:{type:String},embed:{type:String},tryFileHandle:{type:Boolean},errorAllowRetry:{type:Boolean},extraMsg:{type:String},swName:{type:String}}}firstUpdated(){this.initMessages()}initMessages(){if(this.noWebWorker=this.loadInfo&&this.loadInfo.noWebWorker,this.noWebWorker){if(!navigator.serviceWorker)return;this.worker=navigator.serviceWorker}else this.worker=new Worker(this.swName);this.worker.addEventListener("message",(e=>{switch(e.data.msg_type){case"collProgress":if(e.data.name===this.coll){if(this.percent=e.data.percent,e.data.error)if(this.error=e.data.error,this.state="errored",this.errorAllowRetry=!0,this.fileHandle=e.data.fileHandle,"missing_local_file"===this.error)this.tryFileHandle=!1;else if("permission_needed"===this.error&&e.data.fileHandle){this.state="permission_needed";break}e.data.currentSize&&e.data.totalSize&&(this.currentSize=e.data.currentSize,this.totalSize=e.data.totalSize),this.extraMsg=e.data.extraMsg}break;case"collAdded":e.data.name===this.coll&&(this.total||(this.total=100),this.progress=this.total,this.percent=100,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:e.data})),this.noWebWorker?this.pingInterval&&clearInterval(this.pingInterval):this.worker.terminate(),this.worker=null)}}))}async doLoad(){let e,t,i=this.sourceUrl,a=null;if(this.percent=this.currentSize=this.totalSize=0,this.loadInfo&&this.loadInfo.swError)return this.state="errored",this.error=this.loadInfo.swError,void(this.errorAllowRetry=!1);try{const{scheme:e,host:t,path:r}=function(e){let t=e.indexOf("://"),i=0,a="",r="",o="";return t>=0?(a=e.slice(0,t),t+=3):(t++,e.startsWith("//")&&(t+=2)),i=e.indexOf("/",t),i>0?(r=e.slice(t,i),o=e.slice(i)):(r=e.slice(t),o=""),{scheme:a,host:r,path:o}}(i);switch(e){case"googledrive":this.state="googledrive",a=await this.googledriveInit();break;case"s3":a={sourceUrl:i,loadUrl:`https://${t}.s3.amazonaws.com${r}`,name:this.sourceUrl};break;case"file":if(!this.loadInfo&&!this.tryFileHandle)return this.state="errored",this.error="File URLs can not be entered directly or shared.\nYou can select a file to upload from the main page by clicking the 'Choose File...' button.",void(this.errorAllowRetry=!1);a=this.loadInfo;break;case"proxy":i="proxy:"+i.slice("proxy://".length)}}catch(e){console.log(e)}a||(a={sourceUrl:i}),this.state="started",this.loadInfo&&(a.newFullImport=this.loadInfo.newFullImport,a.loadEager=this.loadInfo.loadEager,a.noCache=this.loadInfo.noCache,this.loadInfo.extraConfig&&(t=this.loadInfo.extraConfig),i.startsWith("proxy:")&&t&&t.recording&&(e="recordingproxy"));const r={msg_type:"addColl",name:this.coll,extraConfig:t,type:e,skipExisting:!0,file:a};navigator.serviceWorker.controller||await new Promise((e=>{navigator.serviceWorker.addEventListener("controllerchange",(()=>e()))})),this.worker&&(this.noWebWorker?(navigator.serviceWorker.controller.postMessage(r),this.pingInterval=setInterval((()=>{navigator.serviceWorker.controller.postMessage({msg_type:"ping"})}),15e3)):this.worker.postMessage(r))}googledriveInit(){return this._gdWait=new Promise((e=>this._gdResolve=e)),this._gdWait}async onLoadReady(e){this._gdResolve&&this._gdResolve(e.detail)}onCancel(){if(!this.worker)return;const e={msg_type:"cancelLoad",name:this.coll};this.noWebWorker?navigator.serviceWorker&&navigator.serviceWorker.controller&&(navigator.serviceWorker.controller.postMessage(e),this.pingInterval&&clearInterval(this.pingInterval)):this.worker.postMessage(e)}updated(e){(this.sourceUrl&&e.has("sourceUrl")||e.has("tryFileHandle"))&&this.doLoad()}static get styles(){return ke(n` + `}`}script(){if("trypublic"===this.state||this.scriptLoaded)return T``;const e=document.createElement("script");return e.onload=()=>this.onLoad(),e.src="https://apis.google.com/js/platform.js",e}gauth(e,t){self.gapi.load("auth2",(()=>{self.gapi.auth2.authorize({client_id:"160798412227-tko4c82uopud11q105b2lvbogsj77hlg.apps.googleusercontent.com",scope:"https://www.googleapis.com/auth/drive.file",response_type:"token",prompt:e},t)}))}}customElements.define("wr-gdrive",Ri);class qi extends X{constructor(){super(),this.progress=0,this.total=0,this.percent=0,this.coll="",this.state="waiting",this.loadInfo=null,this.currentSize=0,this.totalSize=0,this.tryFileHandle=!!window.showOpenFilePicker,this.fileHandle=null,this.errorAllowRetry=!1,this.pingInterval=0,this.noWebWorker=!1}static get properties(){return{sourceUrl:{type:String},loadInfo:{type:Object},state:{type:String},progress:{type:Number},percent:{type:Number},currentSize:{type:Number},totalSize:{type:Number},error:{type:String},total:{type:Number},status:{type:String},coll:{type:String},embed:{type:String},tryFileHandle:{type:Boolean},errorAllowRetry:{type:Boolean},extraMsg:{type:String},swName:{type:String}}}firstUpdated(){this.initMessages()}initMessages(){if(this.noWebWorker=this.loadInfo&&this.loadInfo.noWebWorker,this.noWebWorker){if(!navigator.serviceWorker)return;this.worker=navigator.serviceWorker}else this.worker=new Worker(this.swName);this.worker.addEventListener("message",(e=>{switch(e.data.msg_type){case"collProgress":if(e.data.name===this.coll){if(this.percent=e.data.percent,e.data.error)if(this.error=e.data.error,this.state="errored",this.errorAllowRetry=!0,this.fileHandle=e.data.fileHandle,"missing_local_file"===this.error)this.tryFileHandle=!1;else if("permission_needed"===this.error&&e.data.fileHandle){this.state="permission_needed";break}e.data.currentSize&&e.data.totalSize&&(this.currentSize=e.data.currentSize,this.totalSize=e.data.totalSize),this.extraMsg=e.data.extraMsg}break;case"collAdded":e.data.name===this.coll&&(this.total||(this.total=100),this.progress=this.total,this.percent=100,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:e.data})),this.noWebWorker?this.pingInterval&&clearInterval(this.pingInterval):this.worker.terminate(),this.worker=null)}}))}async doLoad(){let e,t,i=this.sourceUrl,a=null;if(this.percent=this.currentSize=this.totalSize=0,this.loadInfo&&this.loadInfo.swError)return this.state="errored",this.error=this.loadInfo.swError,void(this.errorAllowRetry=!1);try{const{scheme:e,host:t,path:r}=function(e){let t=e.indexOf("://"),i=0,a="",r="",o="";return t>=0?(a=e.slice(0,t),t+=3):(t++,e.startsWith("//")&&(t+=2)),i=e.indexOf("/",t),i>0?(r=e.slice(t,i),o=e.slice(i)):(r=e.slice(t),o=""),{scheme:a,host:r,path:o}}(i);switch(e){case"googledrive":this.state="googledrive",a=await this.googledriveInit();break;case"s3":a={sourceUrl:i,loadUrl:`https://${t}.s3.amazonaws.com${r}`,name:this.sourceUrl};break;case"file":if(!this.loadInfo&&!this.tryFileHandle)return this.state="errored",this.error="File URLs can not be entered directly or shared.\nYou can select a file to upload from the main page by clicking the 'Choose File...' button.",void(this.errorAllowRetry=!1);a=this.loadInfo;break;case"proxy":i="proxy:"+i.slice("proxy://".length)}}catch(e){console.log(e)}a||(a={sourceUrl:i}),this.state="started",this.loadInfo&&(a.newFullImport=this.loadInfo.newFullImport,a.loadEager=this.loadInfo.loadEager,a.noCache=this.loadInfo.noCache,this.loadInfo.extraConfig&&(t=this.loadInfo.extraConfig),i.startsWith("proxy:")&&t&&t.recording&&(e="recordingproxy"));const r={msg_type:"addColl",name:this.coll,extraConfig:t,type:e,skipExisting:!0,file:a};navigator.serviceWorker.controller||await new Promise((e=>{navigator.serviceWorker.addEventListener("controllerchange",(()=>e()))})),this.worker&&(this.noWebWorker?(navigator.serviceWorker.controller.postMessage(r),this.pingInterval=setInterval((()=>{navigator.serviceWorker.controller.postMessage({msg_type:"ping"})}),15e3)):this.worker.postMessage(r))}googledriveInit(){return this._gdWait=new Promise((e=>this._gdResolve=e)),this._gdWait}async onLoadReady(e){this._gdResolve&&this._gdResolve(e.detail)}onCancel(){if(!this.worker)return;const e={msg_type:"cancelLoad",name:this.coll};this.noWebWorker?navigator.serviceWorker&&navigator.serviceWorker.controller&&(navigator.serviceWorker.controller.postMessage(e),this.pingInterval&&clearInterval(this.pingInterval)):this.worker.postMessage(e)}updated(e){(this.sourceUrl&&e.has("sourceUrl")||e.has("tryFileHandle"))&&this.doLoad()}static get styles(){return ue(o` :host { height: 100%; display: flex; @@ -2185,12 +2185,12 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour .extra-msg { font-size: 0.8rem; } - `)}render(){return j` + `)}render(){return T`

    - ${this.embed?"":j`
    + ${this.embed?"":T`

    Loading ${this.sourceUrl}...

    `}
    @@ -2199,10 +2199,10 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour
    - `}renderContent(){switch(this.state){case"googledrive":return j``;case"started":return j`
    + >`;case"started":return T`
    - ${this.currentSize&&this.totalSize?j`
    - Loaded ${Fe()(this.currentSize)} of - ${Fe()(this.totalSize)} - ${this.extraMsg&&j`

    (${this.extraMsg})

    `} -
    `:j``} - ${this.embed?"":j` `} -
    `;case"errored":return j`
    +
    `;case"errored":return T`
    `;case"permission_needed":return j`
    +
    `;case"permission_needed":return T`
    Permission is needed to reload the archive file. (Click Cancel to cancel loading this archive.) @@ -2237,10 +2237,10 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour Show Permission Cancel -
    `;default:return j``;default:return T``}}async onAskPermission(){"granted"===await this.fileHandle.requestPermission({mode:"read"})&&this.doLoad()}}customElements.define("wr-loader",Hi);var Wi=__webpack_require__(746),Gi=__webpack_require__.n(Wi),Ki=__webpack_require__(304),Vi=__webpack_require__(442),Zi=__webpack_require__.n(Vi),Qi=__webpack_require__(638),Ji=__webpack_require__.n(Qi);class Yi extends oe{constructor(){super(),this.filteredPages=[],this.sortedPages=[],this.query="",this.flex=null,this.textPages=null,this.newQuery=null,this.loading=!1,this.updatingSearch=!1,this.showAllPages=!1,this.hasExtraPages=!1,this.currList=0,this.active=!1,this.editable=!1,this.changeNeeded=!1,this.selectedPages=new Set,this.menuActive=!1,this.sortKey="date",this.sortDesc=!0,this.isSidebar=!1,this.url="",this.ts="",this.editing=!1,this.toDeletePages=null,this.toDeletePage=null}static get sortKeys(){return[{key:"",name:"Best Match"},{key:"title",name:"Title"},{key:"date",name:"Date"}]}static get properties(){return{active:{type:Boolean},collInfo:{type:Object},currList:{type:Number},filteredPages:{type:Array},sortedPages:{type:Array},showAllPages:{type:Boolean},query:{type:String},defaultKey:{type:String},loading:{type:Boolean},updatingSearch:{type:Boolean},editable:{type:Boolean},selectedPages:{type:Set},allSelected:{type:Boolean},menuActive:{type:Boolean},sortKey:{type:String},sortDesc:{type:Boolean},isSidebar:{type:Boolean},url:{type:String},ts:{type:String},editing:{type:Boolean},toDeletePages:{type:Object},toDeletePage:{type:Object}}}_timedUpdate(){null!==this.newQuery&&(this.query=this.newQuery,this.newQuery=null,this.filter())}async updated(e){if(e.has("collInfo")?this.updateTextSearch():(e.has("query")||e.has("currList")||e.has("showAllPages"))&&this.filter(),e.has("active")&&this.active&&this.changeNeeded&&this.filter(),e.has("query")){this.query?(this.sortKey="",this.sortDesc=!1):(this.sortKey="date",this.sortDesc=!0);const e=this.renderRoot.querySelector("wr-sorter");e&&(e.sortKey=this.sortKey,e.sortDesc=this.sortDesc)}if(e.has("sortedPages")&&this.isSidebar){const e=this.renderRoot.querySelector(".current");if(e){const t={behavior:"smooth",block:"nearest",inline:"nearest"};setTimeout((()=>e.scrollIntoView(t)),100)}}}onChangeQuery(e){this.newQuery=e.currentTarget.value,this._ival&&window.clearTimeout(this._ival),this._ival=window.setTimeout((()=>this._timedUpdate()),250)}async filter(){if(this.loading)return;if(this.active||(this.changeNeeded=!0),this.loading=!0,this.flex&&this.query&&this.textPages){const e=await this.flex.searchAsync(this.query,25);this.filteredPages=e.map((e=>this.textPages[e]))}else this.showAllPages&&this.hasExtraPages?this.filteredPages=[...this.textPages]:this.filteredPages=[...this.collInfo.pages];0!==this.currList&&await this.filterCurated();for(const e of this.filteredPages){const{timestamp:t,date:i}=tt(e);e.timestamp=t,e.date=i}this.loading=!1,this.changeNeeded=!1;const e={query:this.query,currList:this.currList};this.sendChangeEvent(e)}async filterCurated(){const e=await fetch(`${this.collInfo.apiPrefix}/curated/${this.currList}`),t=(await e.json()).curated;this.filteredPages=t}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}addPages(e){const t=new Ki.Index;return this.flex=t,this.textPages=e,this.hasExtraPages=this.textPages&&this.collInfo&&this.collInfo.pages&&this.textPages.length>this.collInfo.pages.length,Promise.all(e.map(((e,i)=>{let a=e.url;return e.title&&(a+=" "+e.title),e.text&&(a+=" "+e.text),t.addAsync(i,a)})))}async updateTextSearch(){if(this.updatingSearch)return;this.updatingSearch=!0;let e=0;try{const t=await caches.open("cache:"+this.collInfo.coll),i=`${this.collInfo.apiPrefix}/textIndex`;let a=await t.match(i);a&&Number(a.headers.get("Content-Length"))||(a=await fetch(i),200===a.status&&Number(a.headers.get("Content-Length"))&&t.put(i,a.clone()));const r=[];for await(const t of Gi()(a.body.getReader()))t.url&&(t.id=++e,r.push(t));await this.addPages(r)}catch(e){console.warn(e)}finally{0===e&&await this.addPages(this.collInfo.pages),this.updatingSearch=!1}await this.filter()}static get styles(){return ke(n` + >`}}async onAskPermission(){"granted"===await this.fileHandle.requestPermission({mode:"read"})&&this.doLoad()}}customElements.define("wr-loader",qi);var Mi=__webpack_require__(746),ji=__webpack_require__.n(Mi),Oi=__webpack_require__(304),Ni=__webpack_require__(442),Bi=__webpack_require__.n(Ni),Fi=__webpack_require__(638),Hi=__webpack_require__.n(Fi);class Wi extends X{constructor(){super(),this.filteredPages=[],this.sortedPages=[],this.query="",this.flex=null,this.textPages=null,this.newQuery=null,this.loading=!1,this.updatingSearch=!1,this.showAllPages=!1,this.hasExtraPages=!1,this.currList=0,this.active=!1,this.editable=!1,this.changeNeeded=!1,this.selectedPages=new Set,this.menuActive=!1,this.sortKey="date",this.sortDesc=!0,this.isSidebar=!1,this.url="",this.ts="",this.editing=!1,this.toDeletePages=null,this.toDeletePage=null}static get sortKeys(){return[{key:"",name:"Best Match"},{key:"title",name:"Title"},{key:"date",name:"Date"}]}static get properties(){return{active:{type:Boolean},collInfo:{type:Object},currList:{type:Number},filteredPages:{type:Array},sortedPages:{type:Array},showAllPages:{type:Boolean},query:{type:String},defaultKey:{type:String},loading:{type:Boolean},updatingSearch:{type:Boolean},editable:{type:Boolean},selectedPages:{type:Set},allSelected:{type:Boolean},menuActive:{type:Boolean},sortKey:{type:String},sortDesc:{type:Boolean},isSidebar:{type:Boolean},url:{type:String},ts:{type:String},editing:{type:Boolean},toDeletePages:{type:Object},toDeletePage:{type:Object}}}_timedUpdate(){null!==this.newQuery&&(this.query=this.newQuery,this.newQuery=null,this.filter())}async updated(e){if(e.has("collInfo")?this.updateTextSearch():(e.has("query")||e.has("currList")||e.has("showAllPages"))&&this.filter(),e.has("active")&&this.active&&this.changeNeeded&&this.filter(),e.has("query")){this.query?(this.sortKey="",this.sortDesc=!1):(this.sortKey="date",this.sortDesc=!0);const e=this.renderRoot.querySelector("wr-sorter");e&&(e.sortKey=this.sortKey,e.sortDesc=this.sortDesc)}if(e.has("sortedPages")&&this.isSidebar){const e=this.renderRoot.querySelector(".current");if(e){const t={behavior:"smooth",block:"nearest",inline:"nearest"};setTimeout((()=>e.scrollIntoView(t)),100)}}}onChangeQuery(e){this.newQuery=e.currentTarget.value,this._ival&&window.clearTimeout(this._ival),this._ival=window.setTimeout((()=>this._timedUpdate()),250)}async filter(){if(this.loading)return;if(this.active||(this.changeNeeded=!0),this.loading=!0,this.flex&&this.query&&this.textPages){const e=await this.flex.searchAsync(this.query,25);this.filteredPages=e.map((e=>this.textPages[e]))}else this.showAllPages&&this.hasExtraPages?this.filteredPages=[...this.textPages]:this.filteredPages=[...this.collInfo.pages];0!==this.currList&&await this.filterCurated();for(const e of this.filteredPages){const{timestamp:t,date:i}=Ve(e);e.timestamp=t,e.date=i}this.loading=!1,this.changeNeeded=!1;const e={query:this.query,currList:this.currList};this.sendChangeEvent(e)}async filterCurated(){const e=await fetch(`${this.collInfo.apiPrefix}/curated/${this.currList}`),t=(await e.json()).curated;this.filteredPages=t}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}addPages(e){const t=new Oi.Index;return this.flex=t,this.textPages=e,this.hasExtraPages=this.textPages&&this.collInfo&&this.collInfo.pages&&this.textPages.length>this.collInfo.pages.length,Promise.all(e.map(((e,i)=>{let a=e.url;return e.title&&(a+=" "+e.title),e.text&&(a+=" "+e.text),t.addAsync(i,a)})))}async updateTextSearch(){if(this.updatingSearch)return;this.updatingSearch=!0;let e=0;try{const t=await caches.open("cache:"+this.collInfo.coll),i=`${this.collInfo.apiPrefix}/textIndex`;let a=await t.match(i);a&&Number(a.headers.get("Content-Length"))||(a=await fetch(i),200===a.status&&Number(a.headers.get("Content-Length"))&&t.put(i,a.clone()));const r=[];for await(const t of ji()(a.body.getReader()))t.url&&(t.id=++e,r.push(t));await this.addPages(r)}catch(e){console.warn(e)}finally{0===e&&await this.addPages(this.collInfo.pages),this.updatingSearch=!1}await this.filter()}static get styles(){return ue(o` :host { width: 100%; height: 100%; @@ -2352,10 +2352,10 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour } @media screen and (max-width: 768px) { - ${Yi.sidebarStyles()} + ${Wi.sidebarStyles()} } - ${Yi.sidebarStyles(o`:host(.sidebar)`)} + ${Wi.sidebarStyles(r`:host(.sidebar)`)} .mobile-lists { display: block !important; @@ -2427,7 +2427,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour margin-bottom: 20px; font-style: italic; } - `)}static sidebarStyles(e=n``){return n` + `)}static sidebarStyles(e=o``){return o` ${e} .main.columns { position: relative; max-height: 100%; @@ -2465,7 +2465,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour ${e} .menu { font-size: 0.8rem; } - `}onSelectList(e){e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list"))}onSelectListDrop(e){e.preventDefault(),this.currList=Number(e.currentTarget.value)}render(){const e=this.currList;return j` + `}onSelectList(e){e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list"))}onSelectListDrop(e){e.preventDefault(),this.currList=Number(e.currentTarget.value)}render(){const e=this.currList;return T`
    `:T``}
    - ${this.query?j` MatchDatePage Title
    - `}renderDeleteModal(){return this.toDeletePages?j` - ${this.toDeletePage?j`

    + ${this.toDeletePage?T`

    Are you sure you want to delete the page ${this.toDeletePage.title}? (Size: - ${Fe()(this.toDeletePage.size)}) -

    `:j` + ${Re()(this.toDeletePage.size)}) +

    `:T`

    Are you sure you want to delete the ${this.toDeletePages.size} selected pages? @@ -2709,12 +2709,12 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour > Cancel - `:j``}isCurrPage(e){if(this.isSidebar&&e.url===this.url){let t=e.timestamp;return!t&&e.date?t=it(e.date):"string"==typeof e.ts&&(t=it(e.ts)),t===this.ts}return!1}renderPages(){return j` + `:T``}isCurrPage(e){if(this.isSidebar&&e.url===this.url){let t=e.timestamp;return!t&&e.date?t=Ze(e.date):"string"==typeof e.ts&&(t=Ze(e.ts)),t===this.ts}return!1}renderPages(){return T`

      - ${this.sortedPages.length?j` ${this.sortedPages.map(((e,t)=>{const i=this.selectedPages.has(e.id);return j`
    • + ${this.sortedPages.length?T` ${this.sortedPages.map(((e,t)=>{const i=this.selectedPages.has(e.id);return T`
    • -
    • `}))}`:j`

      ${this.getNoResultsMessage()}

      `} + `}))}`:T`

      ${this.getNoResultsMessage()}

      `}
    - `}onUpdateTitle(e){if(e.preventDefault(),this.editing=!1,!this.editable)return;const t=this.renderRoot.querySelector("#titleEdit");if(!t||!t.value.trim())return;const i=t.value,a=JSON.stringify({title:i});fetch(`${this.collInfo.apiPrefix}/metadata`,{method:"POST",body:a}).then((e=>{200===e.status&&this.dispatchEvent(new CustomEvent("coll-update",{detail:{title:i}}))}))}onMenu(e){e.stopPropagation(),this.menuActive=!this.menuActive,this.menuActive&&document.addEventListener("click",(()=>{this.menuActive=!1}),{once:!0})}onSort(e){e.preventDefault();const t=e.currentTarget.getAttribute("data-key")||"";t===this.sortKey?this.sortDesc=!this.sortDesc:(this.sortDesc=!1,this.sortKey=t)}onSortChanged(e){this.sortedPages=e.detail.sortedData,this.sortKey=e.detail.sortKey,this.sortDesc=e.detail.sortDesc}onSelectToggle(e){const{page:t,selected:i}=e.detail;i?this.selectedPages.add(t):this.selectedPages.delete(t),this.allSelected=this.selectedPages.size===this.sortedPages.length,this.requestUpdate()}onSelectAll(e){this.allSelected=e.currentTarget.checked,this.allSelected?this.sortedPages.forEach((e=>{this.selectedPages.add(e.id)})):this.selectedPages.clear(),this.requestUpdate()}async onDownload(e,t){e.preventDefault();const i=this.selectedPages.size>0,a=new URLSearchParams;a.set("pages",i?Array.from(this.selectedPages.keys()).join(","):"all"),a.set("format",t),this.collInfo.filename&&a.set("filename",this.collInfo.filename),window.location.href=`${this.collInfo.apiPrefix}/dl?`+a.toString()}onDeleteConfirm(e){const t=e.currentTarget.page;this.selectedPages.has(t.id)?(this.toDeletePages=this.selectedPages,this.toDeletePage=null):(this.toDeletePages=[t.id],this.toDeletePage=t)}async onDeletePages(){const e={};for(const t of this.toDeletePages){const i=this.renderRoot.querySelector(`wr-page-entry[pid="${t}"]`);i&&(i.deleting=!0,e[t]=i)}for(const t of this.toDeletePages){const i=await fetch(`${this.collInfo.apiPrefix}/page/${t}`,{method:"DELETE"}),a=await i.json();if(a.error){console.warn(a.error);continue}const r=e[t];if(!r)continue;const o=this.collInfo.pages.indexOf(r);o<0||this.collInfo.pages.splice(o,1)}this.toDeletePages=null,this.toDeletePage=null,this.updateTextSearch(),this.requestUpdate()}formatResults(){if(!this.query){const e=this.filteredPages.length;return e===this.sortedPages.length?`${e} Page${1!==e?"s":""}`:`${this.sortedPages.length} of ${e} Pages Shown`}return 1===this.sortedPages.length?"1 Page":`${this.sortedPages.length} Pages`}getNoResultsMessage(){return this.collInfo&&this.collInfo.pages.length?this.updatingSearch?"Initializing Search...":this.loading?"Searching...":this.query?j`{200===e.status&&this.dispatchEvent(new CustomEvent("coll-update",{detail:{title:i}}))}))}onMenu(e){e.stopPropagation(),this.menuActive=!this.menuActive,this.menuActive&&document.addEventListener("click",(()=>{this.menuActive=!1}),{once:!0})}onSort(e){e.preventDefault();const t=e.currentTarget.getAttribute("data-key")||"";t===this.sortKey?this.sortDesc=!this.sortDesc:(this.sortDesc=!1,this.sortKey=t)}onSortChanged(e){this.sortedPages=e.detail.sortedData,this.sortKey=e.detail.sortKey,this.sortDesc=e.detail.sortDesc}onSelectToggle(e){const{page:t,selected:i}=e.detail;i?this.selectedPages.add(t):this.selectedPages.delete(t),this.allSelected=this.selectedPages.size===this.sortedPages.length,this.requestUpdate()}onSelectAll(e){this.allSelected=e.currentTarget.checked,this.allSelected?this.sortedPages.forEach((e=>{this.selectedPages.add(e.id)})):this.selectedPages.clear(),this.requestUpdate()}async onDownload(e,t){e.preventDefault();const i=this.selectedPages.size>0,a=new URLSearchParams;a.set("pages",i?Array.from(this.selectedPages.keys()).join(","):"all"),a.set("format",t),this.collInfo.filename&&a.set("filename",this.collInfo.filename),window.location.href=`${this.collInfo.apiPrefix}/dl?`+a.toString()}onDeleteConfirm(e){const t=e.currentTarget.page;this.selectedPages.has(t.id)?(this.toDeletePages=this.selectedPages,this.toDeletePage=null):(this.toDeletePages=[t.id],this.toDeletePage=t)}async onDeletePages(){const e={};for(const t of this.toDeletePages){const i=this.renderRoot.querySelector(`wr-page-entry[pid="${t}"]`);i&&(i.deleting=!0,e[t]=i)}for(const t of this.toDeletePages){const i=await fetch(`${this.collInfo.apiPrefix}/page/${t}`,{method:"DELETE"}),a=await i.json();if(a.error){console.warn(a.error);continue}const r=e[t];if(!r)continue;const o=this.collInfo.pages.indexOf(r);o<0||this.collInfo.pages.splice(o,1)}this.toDeletePages=null,this.toDeletePage=null,this.updateTextSearch(),this.requestUpdate()}formatResults(){if(!this.query){const e=this.filteredPages.length;return e===this.sortedPages.length?`${e} Page${1!==e?"s":""}`:`${this.sortedPages.length} of ${e} Pages Shown`}return 1===this.sortedPages.length?"1 Page":`${this.sortedPages.length} Pages`}getNoResultsMessage(){return this.collInfo&&this.collInfo.pages.length?this.updatingSearch?"Initializing Search...":this.loading?"Searching...":this.query?T`No matching pages found. Try changing the search query, or browse by URL.`:"No Pages Found":j``:"No Pages Found":T`No Pages are defined in this archive. The archive may be empty. Try browsing by URL.`}onScroll(e){const t=e.currentTarget;if(t.scrollHeight-t.scrollTop-t.clientHeight<40){const e=this.renderRoot.querySelector("wr-sorter");e&&e.getMore()}}}customElements.define("wr-page-view",Yi);const Xi=new RegExp(`[${["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")}]`,"g"),ea=e=>e.replace(Xi,"\\$&");class ta extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}static get observedAttributes(){return["keywords","delimiter"]}get keywords(){var e;return null!==(e=this.getAttribute("keywords"))&&void 0!==e?e:""}set keywords(e){this.setAttribute("keywords",e)}get delimiter(){var e;return null!==(e=this.getAttribute("delimiter"))&&void 0!==e?e:""}set delimiter(e){this.setAttribute("delimiter",e)}attributeChangedCallback(e,t,i){"keywords"!==e&&"delimiter"!==e||i!==t&&this._render()}connectedCallback(){this._render(),this.__observer=new MutationObserver((()=>{this._render()})),this.__observer.observe(this,{childList:!0,characterData:!0,subtree:!0})}disconnectedCallback(){this.__observer&&(this.__observer.disconnect(),this.__observer=void 0)}_render(){if(!this.shadowRoot)return;const e=this.textContent||"",t=this.getAttribute("keywords"),i=this.getAttribute("delimiter")||/\s+/;if(!t)return void(this.shadowRoot.textContent=e);const a=e.toLowerCase(),r=t.toLowerCase().split(i).sort(((e,t)=>t.length-e.length)),o=new RegExp(`${r.map(ea).join("|")}`,"gi"),n=e.split(o),s=document.createElement("div");let l=0;for(const t of n)if(s.appendChild(document.createTextNode(t)),l+=t.length,lt.startsWith(e)));if(i){const t=document.createElement("mark");t.textContent=e.substr(l,i.length),s.appendChild(t),l+=i.length}}this.shadowRoot.innerHTML=`\n \n ${s.innerHTML}\n `}}customElements.define("keyword-mark",ta);class ia extends oe{constructor(){super(),this.query="",this.textSnippet="",this.page=null,this.replayPrefix="",this.deleting=!1,this.editable=!1,this.iconValid=!1,this.index=0,this.isCurrent=!1,this.isSidebar=!1}static get properties(){return{query:{type:String},textSnippet:{type:String},page:{type:Object},replayPrefix:{type:String},deleting:{type:Boolean},selected:{type:Boolean},editable:{type:Boolean},iconValid:{type:Boolean},index:{type:Number},isCurrent:{type:Boolean},isSidebar:{type:Boolean}}}static get styles(){return ke(n` + >`}onScroll(e){const t=e.currentTarget;if(t.scrollHeight-t.scrollTop-t.clientHeight<40){const e=this.renderRoot.querySelector("wr-sorter");e&&e.getMore()}}}customElements.define("wr-page-view",Wi);const Gi=new RegExp(`[${["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")}]`,"g"),Ki=e=>e.replace(Gi,"\\$&");class Vi extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}static get observedAttributes(){return["keywords","delimiter"]}get keywords(){var e;return null!==(e=this.getAttribute("keywords"))&&void 0!==e?e:""}set keywords(e){this.setAttribute("keywords",e)}get delimiter(){var e;return null!==(e=this.getAttribute("delimiter"))&&void 0!==e?e:""}set delimiter(e){this.setAttribute("delimiter",e)}attributeChangedCallback(e,t,i){"keywords"!==e&&"delimiter"!==e||i!==t&&this._render()}connectedCallback(){this._render(),this.__observer=new MutationObserver((()=>{this._render()})),this.__observer.observe(this,{childList:!0,characterData:!0,subtree:!0})}disconnectedCallback(){this.__observer&&(this.__observer.disconnect(),this.__observer=void 0)}_render(){if(!this.shadowRoot)return;const e=this.textContent||"",t=this.getAttribute("keywords"),i=this.getAttribute("delimiter")||/\s+/;if(!t)return void(this.shadowRoot.textContent=e);const a=e.toLowerCase(),r=t.toLowerCase().split(i).sort(((e,t)=>t.length-e.length)),o=new RegExp(`${r.map(Ki).join("|")}`,"gi"),n=e.split(o),s=document.createElement("div");let l=0;for(const t of n)if(s.appendChild(document.createTextNode(t)),l+=t.length,lt.startsWith(e)));if(i){const t=document.createElement("mark");t.textContent=e.substr(l,i.length),s.appendChild(t),l+=i.length}}this.shadowRoot.innerHTML=`\n \n ${s.innerHTML}\n `}}customElements.define("keyword-mark",Vi);class Zi extends X{constructor(){super(),this.query="",this.textSnippet="",this.page=null,this.replayPrefix="",this.deleting=!1,this.editable=!1,this.iconValid=!1,this.index=0,this.isCurrent=!1,this.isSidebar=!1}static get properties(){return{query:{type:String},textSnippet:{type:String},page:{type:Object},replayPrefix:{type:String},deleting:{type:Boolean},selected:{type:Boolean},editable:{type:Boolean},iconValid:{type:Boolean},index:{type:Number},isCurrent:{type:Boolean},isSidebar:{type:Boolean}}}static get styles(){return ue(o` :host { min-height: min-content; width: 100%; @@ -2808,10 +2808,10 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour } @media screen and (max-width: 768px) { - ${ia.sidebarStyles()} + ${Zi.sidebarStyles()} } - ${ia.sidebarStyles(o`:host(.sidebar)`)} + ${Zi.sidebarStyles(r`:host(.sidebar)`)} .current a { background-color: rgb(207, 243, 255); @@ -2832,7 +2832,7 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour .media-content a { display: block; } - `)}static sidebarStyles(e=n``){return n` + `)}static sidebarStyles(e=o``){return o` ${e} .col-date { margin-left: calc(24px + 1rem); display: none; @@ -2854,8 +2854,8 @@ function*(e,t){if(void 0!==e){let i=0;for(const a of e)yield t(a,i++)}}(e.resour display: initial !important; font-style: italic; } - `}updated(e){(e.has("page")||e.has("query"))&&(this.updateSnippet(),this.iconValid=!!this.page.favIconUrl,this.deleting=!1)}render(){const e=this.page,t=this.page.date,i="number"==typeof e.size,a=this.editable&&!this.isSidebar;return j` - ${a?j`
    + `}updated(e){(e.has("page")||e.has("query"))&&(this.updateSnippet(),this.iconValid=!!this.page.favIconUrl,this.deleting=!1)}render(){const e=this.page,t=this.page.date,i="number"==typeof e.size,a=this.editable&&!this.isSidebar;return T` + ${a?T`