@shgysk8zer0/polyfills 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser.min.js CHANGED
@@ -1,17 +1,17 @@
1
- !function(){"use strict";!function(){"undefined"==typeof globalThis&&("undefined"!=typeof window?Object.defineProperty(Window.prototype,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:window}):"undefined"!=typeof global?Object.defineProperty(global,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:global}):"undefined"!=typeof self?Object.defineProperty(self,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:self}):Object.defineProperty(this,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:this}))}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={exports:{}};t.exports=function(){const e=new WeakMap,t=/(\n|\r\n?|\u2028|\u2029)/g,r=/^\s*/,n=/\S/,o=Array.prototype.slice;function i(e){if("string"==typeof e)return l([e])[0];if("function"==typeof e)return function(){const t=o.call(arguments);return t[0]=s(t[0]),e.apply(this,t)};const t=s(e);let r=a(t,0);for(let e=1;e<t.length;e++)r+=arguments[e]+a(t,e);return r}function a(e,t){const r=e[t];if(void 0===r)throw new TypeError(`invalid cooked string at index ${t}`);return r}function s(t){const r=e.get(t);if(r)return r;const n=l(t);return e.set(t,n),Object.defineProperty(n,"raw",{value:Object.freeze(l(t.raw))}),Object.freeze(n),n}function l(e){const o=e.map((e=>null==e?void 0:e.split(t)));let i;for(let e=0;e<o.length;e++){const t=o[e];if(void 0===t)continue;const a=0===e,s=e+1===o.length;if(a){if(1===t.length||t[0].length>0)throw new Error("invalid content on opening line");t[1]=""}if(s){if(1===t.length||n.test(t[t.length-1]))throw new Error("invalid content on closing line");t[t.length-2]="",t[t.length-1]=""}for(let e=2;e<t.length;e+=2){const n=t[e],o=e+1===t.length&&!s,a=r.exec(n)[0];o||a.length!==n.length?i=c(a,i):t[e]=""}}const a=i?i.length:0;return o.map((e=>{if(void 0===e)return e;let t=e[0];for(let r=1;r<e.length;r+=2)t+=e[r]+e[r+1].slice(a);return t}))}function c(e,t){if(void 0===t||e===t)return e;let r=0;for(const n=Math.min(e.length,t.length);r<n&&e[r]===t[r];r++);return e.slice(0,r)}return i}();var r=e(t.exports);String.dedent instanceof Function||(String.dedent=r),!("crypto"in window)&&"msCrypto"in window&&(globalThis.crypto=globalThis.msCrypto),"Notification"in window||(globalThis.Notification=globalThis.notifications||globalThis.webkitNotifications||globalThis.oNotifications||globalThis.msNotifications||!1),"doNotTrack"in navigator||(navigator.doNotTrack=globalThis.doNotTrack||navigator.msDoNotTrack||"unspecified"),"indexedDB"in window||(globalThis.indexedDB=globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB||!1),"hidden"in document||(document.hidden=document.webkitHidden||document.msHidden||document.mozHidden||!1),"visibilityState"in document||(document.visibilityState=document.webkitVisibilityState||document.msVisibilityState||document.mozVisibilityState||"visible"),"fullscreenElement"in document||(document.fullscreenElement=document.mozFullScreenElement||document.webkitFullscreenElement||!1),"requestAnimationFrame"in window||(globalThis.requestAnimationFrame=globalThis.mozRequestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.msRequestAnimationFrame||!1),"exitFullscreen"in Document.prototype||(Document.prototype.exitFullscreen=document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msCancelFullScreen||!1),"requestFullscreen"in HTMLElement.prototype||(HTMLElement.prototype.requestFullscreen=HTMLElement.prototype.requestFullScreen||HTMLElement.prototype.mozRequestFullScreen||HTMLElement.prototype.webkitRequestFullScreen||!1),"fullscreen"in Document.prototype||Object.defineProperty(Document.prototype,"fullscreen",{get:()=>document.fullscreenElement instanceof Element}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){return Array.from(e).reduce(((e,r,n)=>{const o=t.call(e,r,n);return e.hasOwnProperty(o)?e[o].push(r):e[o]=[r],e}),{})}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(e,{insert:t,update:r}={}){const n=this.has(e);if(n&&r instanceof Function){const t=this.get(e),n=r.call(this,t,e,this);return n!==t&&this.set(e,n),n}if(n)return this.get(e);if(t instanceof Function){const r=t.call(this,e,this);return this.set(e,r),r}throw new Error("Key is not found and no `insert()` given")}),Map.groupBy instanceof Function||(Map.groupBy=function(e,t){return Array.from(e).reduce(((e,r,n)=>(e.emplace(t.call(e,r,n),{insert:()=>[r],update:e=>(e.push(r),e)}),e)),new Map)});const n=[Array,String,globalThis.Int8Array,globalThis.Uint8Array,globalThis.Uint8ClampedArray,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.Float32Array,globalThis.Float64Array,globalThis.BigInt64Array,globalThis.BigUint64Array];if(Array.prototype.flat instanceof Function||(Array.prototype.flat=function(e=1){const t=[];e=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,e));const r=(e,n)=>{Array.isArray(e)&&n>=0?e.forEach((e=>r(e,n-1))):t.push(e)};return r(this,Number.isNaN(e)?0:e),t}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(e,t){return this.map(e,t).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(e,t){let r;return this.forEach(((n,o,i)=>{e.call(t,n,o,i)&&(r=n)}),t),r}),"lastIndex"in Array.prototype||Object.defineProperty(Array.prototype,"lastIndex",{enumerable:!1,configurable:!1,get:function(){return Math.max(0,this.length-1)}}),"lastItem"in Array.prototype||Object.defineProperty(Array.prototype,"lastItem",{enumerable:!1,configurable:!1,get:function(){return this[this.lastIndex]},set:function(e){this[this.lastIndex]=e}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(e,t){let r=-1;return this.forEach(((n,o,i)=>{e.call(t,n,o,i)&&(r=o)}),t),r}),!(Array.prototype.at instanceof Function)){const Tt=function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]};for(const Et of n)void 0!==Et&&Object.defineProperty(Et.prototype,"at",{value:Tt,writable:!0,enumerable:!1,configurable:!0})}function o(e,t,r,{writable:n=!0,enumerable:o=!0,configurable:i=!0}={}){e[t]instanceof Function||Object.defineProperty(e,t,{value:r,writable:n,enumerable:o,configurable:i})}function i(e,t,{get:r,set:n,enumerable:o=!0,configurable:i=!0}={}){e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:r,set:n,enumerable:o,configurable:i})}if(!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(e){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(e){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(e){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(e){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(e,t,r=globalThis){let n=[];for await(const t of e)n.push(await t);return Array.from(n,t,r)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(e){return this===e||!!Array.isArray(e)&&(this.length===e.length&&this.every(((t,r)=>{const n=e[r];return Array.isArray(t)?Array.isArray(n)&&t.equals(n):Object.is(t,n)})))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(e){if(void 0===e)return[...new Set(this)];if("string"==typeof e){const t=[];return this.filter((r=>{const n=r[e];return!t.includes(n)&&(t.push(n),!0)}))}if(e instanceof Function){const t=[];return this.filter(((...r)=>{try{const n=e.apply(this,r);return"string"==typeof n&&(!t.includes(n)&&(t.push(n),!0))}catch(e){return!1}}))}throw new TypeError("Not a valid argument for uniqueBy")}),Array.prototype.toReversed instanceof Function||(Array.prototype.toReversed=function(){return[...this].reverse()}),Array.prototype.toSorted instanceof Function||(Array.prototype.toSorted=function(e){return[...this].sort(e)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(e,t,...r){const n=[...this];return n.splice(e,t,...r),n}),Array.prototype.with instanceof Function||(Array.prototype.with=function(e,t){const r=[...this];return r[e]=t,r}),Array.isTemplateObject instanceof Function||(Array.isTemplateObject=function(e){return!!(Array.isArray(e)&&Array.isArray(e.raw)&&Object.isFrozen(e)&&Object.isFrozen(e.raw))&&(0!==e.length&&e.length===e.raw.length)}),Uint8Array.prototype.toHex instanceof Function||(Uint8Array.prototype.toHex=function(){return Array.from(this,(e=>e.toString(16).padStart(2,"0"))).join("")}),Uint8Array.prototype.toBase64 instanceof Function||(Uint8Array.prototype.toBase64=function({alphabet:e="base64"}={}){if("base64"===e){const e=32768;let t="";for(let r=0;r<this.length;r+=e){const n=this.subarray(r,r+e);t+=String.fromCharCode.apply(null,n)}return btoa(t)}if("base64url"===e)return this.toBase64({alphabet:"base64"}).replaceAll("+","-").replaceAll("/","_");throw new TypeError('expected alphabet to be either "base64" or "base64url')}),Uint8Array.fromHex instanceof Function||(Uint8Array.fromHex=function(e){if("string"!=typeof e)throw new TypeError("expected input to be a string");if(0===!(1&e.length))throw new SyntaxError("string should be an even number of characters");return Uint8Array.from(globalThis.Iterator.range(0,e.length,{step:2}),(t=>parseInt(e.substring(t,t+2),16)))}),Uint8Array.fromBase64 instanceof Function||(Uint8Array.fromBase64=function(e,{alphabet:t="base64",lastChunkHandling:r="loose"}={}){if("string"!=typeof e)throw new TypeError("expected input to be a string");if(!["base64","base64url"].includes(t))throw new TypeError('expected alphabet to be either "base64" or "base64url');if(!["loose","strict","stop-before-partial"].includes(r))throw new TypeError(`Invalid \`lastChunkHandling\`: "${r}".`);if("base64"!==t)return Uint8Array.fromBase64(e.replaceAll("-","+").replaceAll("_","/"),{alphabet:"base64"});{const t=e.length%4;if(1===t)throw new TypeError("Invalid string length.");if(0===t)return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)));switch(r){case"strict":throw new SyntaxError("Missing padding.");case"loose":return Uint8Array.fromBase64(e.padEnd(e.length+(4-t),"="),{alphabet:"base64",lastChunkHandling:"strict"});case"stop-before-partial":return Uint8Array.fromBase64(e.slice(0,e.length-t),{alphabet:"base64",lastChunkHandling:"strict"})}}}),"Symbol"in globalThis){const St=new Set(Reflect.ownKeys(Symbol).filter((e=>"symbol"==typeof Symbol[e])).map((e=>Symbol[e])));void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator")),o(Symbol,"isRegistered",(function(e){return"symbol"==typeof e&&"string"==typeof Symbol.keyFor(e)})),o(Symbol,"isWellKnown",(function(e){return St.has(e)}))}function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(){if(!(Function.prototype.once instanceof Function)){const e=new WeakMap;Function.prototype.once=function(t){const r=this;return function(...n){if(e.has(r))return e.get(r);if("AsyncFunction"===r.constructor.name){const o=r.apply(t||r,n).catch((t=>{throw e.delete(r),t}));return e.set(r,o),o}if(r instanceof Function){const o=r.apply(t||r,n);return e.set(r,o),o}}}}}();var s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,p={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(p,{URLPattern:()=>Q});var h,f=(h=p,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of c(t))!u.call(e,o)&&o!==r&&s(e,o,{get:()=>t[o],enumerable:!(n=l(t,o))||n.enumerable});return e})(s({},"__esModule",{value:!0}),h)),d=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(e,t,r,n,o,i){this.type=e,this.name=t,this.prefix=r,this.value=n,this.suffix=o,this.modifier=i}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}},m=/[$_\p{ID_Start}]/u,y=/[$_\u200C\u200D\p{ID_Continue}]/u,g=".*";function b(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function w(e,t=!1){let r=[],n=0;for(;n<e.length;){let o=e[n],i=function(o){if(!t)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:e[n++]})};if("*"!==o)if("+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o)if(":"!==o)if("("!==o)r.push({type:"CHAR",index:n,value:e[n++]});else{let t=1,o="",a=n+1,s=!1;if("?"===e[a]){i(`Pattern cannot start with "?" at ${a}`);continue}for(;a<e.length;){if(!b(e[a],!1)){i(`Invalid character '${e[a]}' at ${a}.`),s=!0;break}if("\\"!==e[a]){if(")"===e[a]){if(t--,0===t){a++;break}}else if("("===e[a]&&(t++,"?"!==e[a+1])){i(`Capturing groups are not allowed at ${a}`),s=!0;break}o+=e[a++]}else o+=e[a++]+e[a++]}if(s)continue;if(t){i(`Unbalanced pattern at ${n}`);continue}if(!o){i(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=a}else{let t="",o=n+1;for(;o<e.length;){let r=e.substr(o,1);if(!(o===n+1&&m.test(r)||o!==n+1&&y.test(r)))break;t+=e[o++]}if(!t){i(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:t}),n=o}else r.push({type:"CLOSE",index:n,value:e[n++]});else r.push({type:"OPEN",index:n,value:e[n++]});else r.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else r.push({type:"OTHER_MODIFIER",index:n,value:e[n++]});else r.push({type:"ASTERISK",index:n,value:e[n++]})}return r.push({type:"END",index:n,value:""}),r}function v(e,t={}){let r=w(e);t.delimiter??="/#?",t.prefixes??="./";let n=`[^${T(t.delimiter)}]+?`,o=[],i=0,a=0,s=new Set,l=e=>{if(a<r.length&&r[a].type===e)return r[a++].value},c=()=>l("OTHER_MODIFIER")??l("ASTERISK"),u=e=>{let t=l(e);if(void 0!==t)return t;let{type:n,index:o}=r[a];throw new TypeError(`Unexpected ${n} at ${o}, expected ${e}`)},p=()=>{let e,t="";for(;e=l("CHAR")??l("ESCAPED_CHAR");)t+=e;return t},h=t.encodePart||(e=>e),f="",m=e=>{f+=e},y=()=>{f.length&&(o.push(new d(3,"","",h(f),"",3)),f="")},b=(e,t,r,a,l)=>{let c,u=3;switch(l){case"?":u=1;break;case"*":u=0;break;case"+":u=2}if(!t&&!r&&3===u)return void m(e);if(y(),!t&&!r){if(!e)return;return void o.push(new d(3,"","",h(e),"",u))}c=r?"*"===r?g:r:n;let p,f=2;if(c===n?(f=1,c=""):c===g&&(f=0,c=""),t?p=t:r&&(p=i++),s.has(p))throw new TypeError(`Duplicate name '${p}'.`);s.add(p),o.push(new d(f,p,h(e),c,h(a),u))};for(;a<r.length;){let e=l("CHAR"),r=l("NAME"),n=l("REGEX");if(!r&&!n&&(n=l("ASTERISK")),r||n){let o=e??"";-1===t.prefixes.indexOf(o)&&(m(o),o=""),y(),b(o,r,n,"",c());continue}let o=e??l("ESCAPED_CHAR");if(o)m(o);else if(l("OPEN")){let e=p(),t=l("NAME"),r=l("REGEX");!t&&!r&&(r=l("ASTERISK"));let n=p();u("CLOSE"),b(e,t,r,n,c())}else y(),u("END")}return o}function T(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function E(e){return e&&e.ignoreCase?"ui":"u"}function S(e){switch(e){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function A(e,t,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let o of e){if(3===o.type){3===o.modifier?n+=T(o.value):n+=`(?:${T(o.value)})${S(o.modifier)}`;continue}t&&t.push(o.name);let e=`[^${T(r.delimiter)}]+?`,i=o.value;(1===o.type?i=e:0===o.type&&(i=g),o.prefix.length||o.suffix.length)?3!==o.modifier&&1!==o.modifier?(n+=`(?:${T(o.prefix)}`,n+=`((?:${i})(?:`,n+=T(o.suffix),n+=T(o.prefix),n+=`(?:${i}))*)${T(o.suffix)})`,0===o.modifier&&(n+="?")):(n+=`(?:${T(o.prefix)}(${i})${T(o.suffix)})`,n+=S(o.modifier)):3===o.modifier||1===o.modifier?n+=`(${i})${S(o.modifier)}`:n+=`((?:${i})${S(o.modifier)})`}let o=`[${T(r.endsWith)}]|$`,i=`[${T(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${o})`:n+="$",new RegExp(n,E(r));r.strict||(n+=`(?:${i}(?=${o}))?`);let a=!1;if(e.length){let t=e[e.length-1];3===t.type&&3===t.modifier&&(a=r.delimiter.indexOf(t)>-1)}return a||(n+=`(?=${i}|${o})`),new RegExp(n,E(r))}var x={delimiter:"",prefixes:"",sensitive:!0,strict:!0},M={delimiter:".",prefixes:"",sensitive:!0,strict:!0},L={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function O(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function P(e){return!(!e||e.length<2)&&("["===e[0]||("\\"===e[0]||"{"===e[0])&&"["===e[1])}var k=["ftp","file","http","https","ws","wss"];function F(e){if(!e)return!0;for(let t of k)if(e.test(t))return!0;return!1}function R(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function j(e){if(""===e)return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function I(e){if(""===e)return e;let t=new URL("https://example.com");return t.username=e,t.username}function N(e){if(""===e)return e;let t=new URL("https://example.com");return t.password=e,t.password}function C(e){if(""===e)return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function H(e){if(""===e)return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function U(e){if(""===e||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function D(e){if(""===e)return e;let t=new URL("https://example.com");return t.pathname="/"!==e[0]?"/-"+e:e,"/"!==e[0]?t.pathname.substring(2,t.pathname.length):t.pathname}function $(e){return""===e?e:new URL(`data:${e}`).pathname}function q(e){if(""===e)return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function B(e){if(""===e)return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}var z=["protocol","username","password","hostname","port","pathname","search","hash"],_="*";function V(e,t){if("string"!=typeof e)throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:""!==r.search?r.search.substring(1,r.search.length):void 0,hash:""!==r.hash?r.hash.substring(1,r.hash.length):void 0}}function W(e,t){return t?K(e):e}function G(e,t,r){let n;if("string"==typeof t.baseURL)try{n=new URL(t.baseURL),void 0===t.protocol&&(e.protocol=W(n.protocol.substring(0,n.protocol.length-1),r)),!r&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&(e.username=W(n.username,r)),!r&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&void 0===t.password&&(e.password=W(n.password,r)),void 0===t.protocol&&void 0===t.hostname&&(e.hostname=W(n.hostname,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&(e.port=W(n.port,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&(e.pathname=W(n.pathname,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&(e.search=W(n.search.substring(1,n.search.length),r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&void 0===t.hash&&(e.hash=W(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if("string"==typeof t.protocol&&(e.protocol=function(e,t){return e=function(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}(e,":"),t||""===e?e:j(e)}(t.protocol,r)),"string"==typeof t.username&&(e.username=function(e,t){if(t||""===e)return e;let r=new URL("https://example.com");return r.username=e,r.username}(t.username,r)),"string"==typeof t.password&&(e.password=function(e,t){if(t||""===e)return e;let r=new URL("https://example.com");return r.password=e,r.password}(t.password,r)),"string"==typeof t.hostname&&(e.hostname=function(e,t){return t||""===e?e:P(e)?H(e):C(e)}(t.hostname,r)),"string"==typeof t.port&&(e.port=function(e,t,r){return R(t)===e&&(e=""),r||""===e?e:U(e)}(t.port,e.protocol,r)),"string"==typeof t.pathname){if(e.pathname=t.pathname,n&&!function(e,t){return!(!e.length||"/"!==e[0]&&(!t||e.length<2||"\\"!=e[0]&&"{"!=e[0]||"/"!=e[1]))}(e.pathname,r)){let t=n.pathname.lastIndexOf("/");t>=0&&(e.pathname=W(n.pathname.substring(0,t+1),r)+e.pathname)}e.pathname=function(e,t,r){if(r||""===e)return e;if(t&&!k.includes(t))return new URL(`${t}:${e}`).pathname;let n="/"==e[0];return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}(e.pathname,e.protocol,r)}return"string"==typeof t.search&&(e.search=function(e,t){if(e=O(e,"?"),t||""===e)return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}(t.search,r)),"string"==typeof t.hash&&(e.hash=function(e,t){if(e=O(e,"#"),t||""===e)return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}(t.hash,r)),e}function K(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function X(e,t){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let r=`[^${function(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}(t.delimiter)}]+?`,n=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let i=0;i<e.length;++i){let a=e[i];if(3===a.type){if(3===a.modifier){o+=K(a.value);continue}o+=`{${K(a.value)}}${S(a.modifier)}`;continue}let s=a.hasCustomName(),l=!!a.suffix.length||!!a.prefix.length&&(1!==a.prefix.length||!t.prefixes.includes(a.prefix)),c=i>0?e[i-1]:null,u=i<e.length-1?e[i+1]:null;if(!l&&s&&1===a.type&&3===a.modifier&&u&&!u.prefix.length&&!u.suffix.length)if(3===u.type){let e=u.value.length>0?u.value[0]:"";l=n.test(e)}else l=!u.hasCustomName();if(!l&&!a.prefix.length&&c&&3===c.type){let e=c.value[c.value.length-1];l=t.prefixes.includes(e)}l&&(o+="{"),o+=K(a.prefix),s&&(o+=`:${a.name}`),2===a.type?o+=`(${a.value})`:1===a.type?s||(o+=`(${r})`):0===a.type&&(s||c&&3!==c.type&&3===c.modifier&&!l&&""===a.prefix?o+="(.*)":o+="*"),1===a.type&&s&&a.suffix.length&&n.test(a.suffix[0])&&(o+="\\"),o+=K(a.suffix),l&&(o+="}"),3!==a.modifier&&(o+=S(a.modifier))}return o}var Q=class{#e;#t={};#r={};#n={};#o={};#i=!1;constructor(e={},t,r){try{let n;if("string"==typeof t?n=t:r=t,"string"==typeof e){let t=new class{#e;#t=[];#r={};#n=0;#o=1;#i=0;#a=0;#s=0;#l=0;#c=!1;constructor(e){this.#e=e}get result(){return this.#r}parse(){for(this.#t=w(this.#e,!0);this.#n<this.#t.length;this.#n+=this.#o){if(this.#o=1,"END"===this.#t[this.#n].type){if(0===this.#a){this.#u(),this.#p()?this.#h(9,1):this.#f()?this.#h(8,1):this.#h(7,0);continue}if(2===this.#a){this.#d(5);continue}this.#h(10,0);break}if(this.#s>0){if(!this.#m())continue;this.#s-=1}if(this.#y())this.#s+=1;else switch(this.#a){case 0:this.#g()&&this.#d(1);break;case 1:if(this.#g()){this.#b();let e=7,t=1;this.#w()?(e=2,t=3):this.#c&&(e=2),this.#h(e,t)}break;case 2:this.#v()?this.#d(3):(this.#T()||this.#f()||this.#p())&&this.#d(5);break;case 3:this.#E()?this.#h(4,1):this.#v()&&this.#h(5,1);break;case 4:this.#v()&&this.#h(5,1);break;case 5:this.#S()?this.#l+=1:this.#A()&&(this.#l-=1),this.#x()&&!this.#l?this.#h(6,1):this.#T()?this.#h(7,0):this.#f()?this.#h(8,1):this.#p()&&this.#h(9,1);break;case 6:this.#T()?this.#h(7,0):this.#f()?this.#h(8,1):this.#p()&&this.#h(9,1);break;case 7:this.#f()?this.#h(8,1):this.#p()&&this.#h(9,1);break;case 8:this.#p()&&this.#h(9,1)}}void 0!==this.#r.hostname&&void 0===this.#r.port&&(this.#r.port="")}#h(e,t){switch(this.#a){case 0:case 2:break;case 1:this.#r.protocol=this.#M();break;case 3:this.#r.username=this.#M();break;case 4:this.#r.password=this.#M();break;case 5:this.#r.hostname=this.#M();break;case 6:this.#r.port=this.#M();break;case 7:this.#r.pathname=this.#M();break;case 8:this.#r.search=this.#M();break;case 9:this.#r.hash=this.#M()}0!==this.#a&&10!==e&&([1,2,3,4].includes(this.#a)&&[6,7,8,9].includes(e)&&(this.#r.hostname??=""),[1,2,3,4,5,6].includes(this.#a)&&[8,9].includes(e)&&(this.#r.pathname??=this.#c?"/":""),[1,2,3,4,5,6,7].includes(this.#a)&&9===e&&(this.#r.search??="")),this.#L(e,t)}#L(e,t){this.#a=e,this.#i=this.#n+t,this.#n+=t,this.#o=0}#u(){this.#n=this.#i,this.#o=0}#d(e){this.#u(),this.#a=e}#O(e){return e<0&&(e=this.#t.length-e),e<this.#t.length?this.#t[e]:this.#t[this.#t.length-1]}#P(e,t){let r=this.#O(e);return r.value===t&&("CHAR"===r.type||"ESCAPED_CHAR"===r.type||"INVALID_CHAR"===r.type)}#g(){return this.#P(this.#n,":")}#w(){return this.#P(this.#n+1,"/")&&this.#P(this.#n+2,"/")}#v(){return this.#P(this.#n,"@")}#E(){return this.#P(this.#n,":")}#x(){return this.#P(this.#n,":")}#T(){return this.#P(this.#n,"/")}#f(){if(this.#P(this.#n,"?"))return!0;if("?"!==this.#t[this.#n].value)return!1;let e=this.#O(this.#n-1);return"NAME"!==e.type&&"REGEX"!==e.type&&"CLOSE"!==e.type&&"ASTERISK"!==e.type}#p(){return this.#P(this.#n,"#")}#y(){return"OPEN"==this.#t[this.#n].type}#m(){return"CLOSE"==this.#t[this.#n].type}#S(){return this.#P(this.#n,"[")}#A(){return this.#P(this.#n,"]")}#M(){let e=this.#t[this.#n],t=this.#O(this.#i).index;return this.#e.substring(t,e.index)}#b(){let e={};Object.assign(e,x),e.encodePart=j;let t=function(e,t,r){return A(v(e,r),t,r)}(this.#M(),void 0,e);this.#c=F(t)}}(e);if(t.parse(),e=t.result,void 0===n&&"string"!=typeof e.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");e.baseURL=n}else{if(!e||"object"!=typeof e)throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let o,i={ignoreCase:!0===r.ignoreCase},a={pathname:_,protocol:_,username:_,password:_,hostname:_,port:_,search:_,hash:_};for(o of(this.#e=G(a,e,!0),R(this.#e.protocol)===this.#e.port&&(this.#e.port=""),z)){if(!(o in this.#e))continue;let e={},t=this.#e[o];switch(this.#r[o]=[],o){case"protocol":Object.assign(e,x),e.encodePart=j;break;case"username":Object.assign(e,x),e.encodePart=I;break;case"password":Object.assign(e,x),e.encodePart=N;break;case"hostname":Object.assign(e,M),P(t)?e.encodePart=H:e.encodePart=C;break;case"port":Object.assign(e,x),e.encodePart=U;break;case"pathname":F(this.#t.protocol)?(Object.assign(e,L,i),e.encodePart=D):(Object.assign(e,x,i),e.encodePart=$);break;case"search":Object.assign(e,x,i),e.encodePart=q;break;case"hash":Object.assign(e,x,i),e.encodePart=B}try{this.#o[o]=v(t,e),this.#t[o]=A(this.#o[o],this.#r[o],e),this.#n[o]=X(this.#o[o],e),this.#i=this.#i||this.#o[o].some((e=>2===e.type))}catch{throw new TypeError(`invalid ${o} pattern '${this.#e[o]}'.`)}}}catch(e){throw new TypeError(`Failed to construct 'URLPattern': ${e.message}`)}}test(e={},t){let r,n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{n=G(n,"object"==typeof e?e:V(e,t),!1)}catch{return!1}for(r of z)if(!this.#t[r].exec(n[r]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{r=G(r,"object"==typeof e?e:V(e,t),!1)}catch{return null}let n,o={};for(n of(o.inputs=t?[e,t]:[e],z)){let e=this.#t[n].exec(r[n]);if(!e)return null;let t={};for(let[r,o]of this.#r[n].entries())if("string"==typeof o||"number"==typeof o){let n=e[r+1];t[o]=n}o[n]={input:r[n]??"",groups:t}}return o}static compareComponent(e,t,r){let n=(e,t)=>{for(let r of["type","modifier","prefix","value","suffix"]){if(e[r]<t[r])return-1;if(e[r]!==t[r])return 1}return 0},o=new d(3,"","","","",3),i=new d(0,"","","","",3),a=(e,t)=>{let r=0;for(;r<Math.min(e.length,t.length);++r){let o=n(e[r],t[r]);if(o)return o}return e.length===t.length?0:n(e[r]??o,t[r]??o)};return t.#n[e]||r.#n[e]?t.#n[e]&&!r.#n[e]?a(t.#o[e],[i]):!t.#n[e]&&r.#n[e]?a([i],r.#o[e]):a(t.#o[e],r.#o[e]):0}get protocol(){return this.#n.protocol}get username(){return this.#n.username}get password(){return this.#n.password}get hostname(){return this.#n.hostname}get port(){return this.#n.port}get pathname(){return this.#n.pathname}get search(){return this.#n.search}get hash(){return this.#n.hash}get hasRegExpGroups(){return this.#i}};const{URLPattern:J}=f;var Z={URLPattern:J};globalThis.URLPattern||(globalThis.URLPattern=J);var Y=a(Z);"URLPattern"in globalThis||(globalThis.URLPattern=Y),o(URL,"parse",((e,t)=>{try{return new URL(e,t)}catch{return null}})),o(URL,"canParse",((e,t)=>{try{return new URL(e,t)instanceof URL}catch{return!1}})),Number.range instanceof Function||(Number.range=function(e,t,r=1){return console.warn("`Number.range()` is deprecated. Use `Iterator.range()` instead."),globalThis.Iterator.range(e,t,{step:r})});const ee="Iterator"in globalThis,te=ee?Object.getPrototypeOf(globalThis.Iterator):Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),re=ee?globalThis.Iterator:(e=>{class t{[Symbol.iterator](){return this}}return Object.setPrototypeOf(t,e),t})(te);var ne;re.range instanceof Function||(re.range=function(e,t,r){if("number"==typeof r||"bigint"==typeof r)return re.range(e,t,{step:r});if("object"!=typeof r||Object.is(r,null))return re.range(e,t,{});{const{step:n=("number"==typeof e?e<t?1:-1:e<t?1n:-1n),inclusive:o=!1}=r;if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Start must be a number");if(Number.isNaN(e))throw new RangeError("Invalid start");if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("End must be a number");if(Number.isNaN(t))throw new RangeError("Invalid end");if("number"!=typeof n&&"bigint"!=typeof n)throw new TypeError("Step must be a number");if(Number.isNaN(n))throw new RangeError("Invalid step");if(0===n)throw new RangeError("Step must not be 0");if(n<0&&e<t||n>0&&e>t)return;if(o){let r=e;return n>0?re.from({next(){const e=r<=t?{value:r,done:!1}:{done:!0};return r+=n,e}}):re.from({next(){const e=r>=t?{value:r,done:!1}:{done:!0};return r+=n,e}})}{let r=e;if(n>0)return re.from({next(){const e=r<t?{value:r,done:!1}:{done:!0};return r+=n,e}});{let r=e;return re.from({next(){const e=r>t?{value:r,done:!1}:{done:!0};return r+=n,e}})}}}}),te[Symbol.toStringTag]||(te[Symbol.toStringTag]="Iterator"),te.take instanceof Function||(te.take=function(e){let t=0;const r=this;return re.from({next:()=>t++>=e?{done:!0}:r.next()})}),te.drop instanceof Function||(te.drop=function(e){for(let t=0;t<e;t++){const{done:e}=this.next();if(e)break}return this}),te.toArray instanceof Function||(te.toArray=function(){return Array.from(this)}),te.forEach instanceof Function||(te.forEach=function(e){for(const t of this)e.call(this,t)}),te.flatMap instanceof Function||(te.flatMap=function(e){const t=this;let r=this.next();const n=({value:r,done:n=!0}={})=>n?re.from({next:()=>({done:!0})}):re.from(e.call(t,r));let o=n(r);return re.from({next(){const{value:e,done:i=!0}=o.next();return r.done&&i?{done:!0}:i?r.done?{done:!0}:(r=t.next(),o=n(r),o.next()):{value:e,done:i}}})}),te.map instanceof Function||(te.map=function(e){const t=this;return re.from({next(){const{done:r,value:n}=t.next();return r?{done:r}:{value:e.call(t,n),done:!1}}})}),te.reduce instanceof Function||(te.reduce=function(e,t){let r=void 0===t?this.next().value:t;for(const t of this)r=e.call(this,r,t);return r}),te.filter instanceof Function||(te.filter=function(e){const t=this;let r,n=!1;return re.from({next(){for(;!n;){const o=t.next();if(n=o.done,n)break;if(e.call(t,o.value)){r=o.value;break}}return{done:n,value:r}}})}),te.some instanceof Function||(te.some=function(e){let t=!1;for(const r of this)if(e.call(this,r)){t=!0;break}return t}),te.every instanceof Function||(te.every=function(e){let t=!0;for(const r of this)if(!e.call(this,r)){t=!1;break}return t}),te.find instanceof Function||(te.find=function(e){for(const t of this)if(e.call(this,t))return t}),te.indexed instanceof Function||(te.indexed=function(){let e=0;return this.map((t=>[e++,t]))}),te.chunks instanceof Function||(te.chunks=function(e){if(!Number.isSafeInteger(e)||e<1)throw new TypeError("Size must be a positive integer.");{const t=this;let r=!1;return re.from({next(){if(r)return{done:r};{const n=[];let o=0;for(;o++<e&&!r;){const e=t.next();if(e.done){r=!0,void 0!==e.value&&n.push(e.value);break}n.push(e.value)}return{value:n,done:!1}}}})}}),re.from instanceof Function||(re.from=function(e){if("object"!=typeof e||null===e)throw new TypeError("Not an object.");if(e.next instanceof Function){return Object.create(te,{next:{enumerable:!0,configurable:!1,writable:!1,value:(...t)=>e.next(...t)}})}if(e[Symbol.iterator]instanceof Function)return re.from(e[Symbol.iterator]())}),ee||(globalThis.Iterator=re),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=e=>e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=e=>(e>0)-(e<0)||+e),Math.hasOwnProperty("trunc")||(Math.trunc=e=>{const t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}),Math.hasOwnProperty("expm1")||(Math.expm1=e=>Math.exp(e)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...e)=>Math.sqrt(e.reduce(((e,t)=>e+t**2),0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=e=>e**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=e=>Math.log(e)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=e=>Math.log(e)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=e=>Math.log(1+e)),Math.hasOwnProperty("fround")||(Math.fround=(ne=new Float32Array(1),function(e){return ne[0]=e,ne[0]})),Math.clamp instanceof Function||(Math.clamp=function(e,t,r){return Math.min(Math.max(e,t),r)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),Math.sumPrecise instanceof Function||(Math.sumPrecise=function(e){let t=-0;for(const r of e){if(!Number.isFinite(r)){t=-0;break}t+=r}return t}),Math.sum instanceof Function||(Math.sum=function(...e){return console.warn("Math.sum is deprecated. Please use Math.sumPrecise instead."),Math.sumPrecise(e)}),function(){if(!("isSecureContext"in globalThis)){const e=["localhost","127.0.0.1"],t="https:",r=[t,"file:","wss:"],n=(e=globalThis.document)=>[...e.scripts].every((({src:r})=>{if(0===r.length)return!0;{const{protocol:n,hostname:o}=new URL(r,e.baseURI);return n===t||o===location.hostname}}));Object.defineProperty(globalThis,"isSecureContext",{enumerable:!0,configurable:!0,get:function(){return window.parent===window&&(!(!r.includes(location.protocol)&&!e.includes(location.hostname))&&n())}})}}();function oe(e){return function(e){return e instanceof Function&&"AsyncFunction"===e.constructor.name}(e)||e instanceof Promise}
1
+ !function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(){"undefined"==typeof globalThis&&("undefined"!=typeof window?Object.defineProperty(Window.prototype,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:window}):"undefined"!=typeof global?Object.defineProperty(global,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:global}):"undefined"!=typeof self?Object.defineProperty(self,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:self}):Object.defineProperty(this,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:this}))}();var t,r,n,o={exports:{}};o.exports;function i(){return t||(t=1,o.exports=function(){const e=new WeakMap,t=/(\n|\r\n?|\u2028|\u2029)/g,r=/^\s*/,n=/\S/,o=Array.prototype.slice;function i(e){if("string"==typeof e)return l([e])[0];if("function"==typeof e)return function(){const t=o.call(arguments);return t[0]=s(t[0]),e.apply(this,t)};const t=s(e);let r=a(t,0);for(let e=1;e<t.length;e++)r+=arguments[e]+a(t,e);return r}function a(e,t){const r=e[t];if(void 0===r)throw new TypeError(`invalid cooked string at index ${t}`);return r}function s(t){const r=e.get(t);if(r)return r;const n=l(t);return e.set(t,n),Object.defineProperty(n,"raw",{value:Object.freeze(l(t.raw))}),Object.freeze(n),n}function l(e){const o=e.map((e=>null==e?void 0:e.split(t)));let i;for(let e=0;e<o.length;e++){const t=o[e];if(void 0===t)continue;const a=0===e,s=e+1===o.length;if(a){if(1===t.length||t[0].length>0)throw new Error("invalid content on opening line");t[1]=""}if(s){if(1===t.length||n.test(t[t.length-1]))throw new Error("invalid content on closing line");t[t.length-2]="",t[t.length-1]=""}for(let e=2;e<t.length;e+=2){const n=t[e],o=e+1===t.length&&!s,a=r.exec(n)[0];o||a.length!==n.length?i=c(a,i):t[e]=""}}const a=i?i.length:0;return o.map((e=>{if(void 0===e)return e;let t=e[0];for(let r=1;r<e.length;r+=2)t+=e[r]+e[r+1].slice(a);return t}))}function c(e,t){if(void 0===t||e===t)return e;let r=0;for(const n=Math.min(e.length,t.length);r<n&&e[r]===t[r];r++);return e.slice(0,r)}return i}()),o.exports}var a=e(n?r:(n=1,r=i()));String.dedent instanceof Function||(String.dedent=a),!("crypto"in window)&&"msCrypto"in window&&(globalThis.crypto=globalThis.msCrypto),"Notification"in window||(globalThis.Notification=globalThis.notifications||globalThis.webkitNotifications||globalThis.oNotifications||globalThis.msNotifications||!1),"doNotTrack"in navigator||(navigator.doNotTrack=globalThis.doNotTrack||navigator.msDoNotTrack||"unspecified"),"indexedDB"in window||(globalThis.indexedDB=globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB||!1),"hidden"in document||(document.hidden=document.webkitHidden||document.msHidden||document.mozHidden||!1),"visibilityState"in document||(document.visibilityState=document.webkitVisibilityState||document.msVisibilityState||document.mozVisibilityState||"visible"),"fullscreenElement"in document||(document.fullscreenElement=document.mozFullScreenElement||document.webkitFullscreenElement||!1),"requestAnimationFrame"in window||(globalThis.requestAnimationFrame=globalThis.mozRequestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.msRequestAnimationFrame||!1),"exitFullscreen"in Document.prototype||(Document.prototype.exitFullscreen=document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msCancelFullScreen||!1),"requestFullscreen"in HTMLElement.prototype||(HTMLElement.prototype.requestFullscreen=HTMLElement.prototype.requestFullScreen||HTMLElement.prototype.mozRequestFullScreen||HTMLElement.prototype.webkitRequestFullScreen||!1),"fullscreen"in Document.prototype||Object.defineProperty(Document.prototype,"fullscreen",{get:()=>document.fullscreenElement instanceof Element}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){return Array.from(e).reduce(((e,r,n)=>{const o=t.call(e,r,n);return e.hasOwnProperty(o)?e[o].push(r):e[o]=[r],e}),{})}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(e,{insert:t,update:r}={}){const n=this.has(e);if(n&&r instanceof Function){const t=this.get(e),n=r.call(this,t,e,this);return n!==t&&this.set(e,n),n}if(n)return this.get(e);if(t instanceof Function){const r=t.call(this,e,this);return this.set(e,r),r}throw new Error("Key is not found and no `insert()` given")}),Map.groupBy instanceof Function||(Map.groupBy=function(e,t){return Array.from(e).reduce(((e,r,n)=>(e.emplace(t.call(e,r,n),{insert:()=>[r],update:e=>(e.push(r),e)}),e)),new Map)});const s=[Array,String,globalThis.Int8Array,globalThis.Uint8Array,globalThis.Uint8ClampedArray,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.Float32Array,globalThis.Float64Array,globalThis.BigInt64Array,globalThis.BigUint64Array];if(Array.prototype.flat instanceof Function||(Array.prototype.flat=function(e=1){const t=[];e=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,e));const r=(e,n)=>{Array.isArray(e)&&n>=0?e.forEach((e=>r(e,n-1))):t.push(e)};return r(this,Number.isNaN(e)?0:e),t}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(e,t){return this.map(e,t).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(e,t){let r;return this.forEach(((n,o,i)=>{e.call(t,n,o,i)&&(r=n)}),t),r}),"lastIndex"in Array.prototype||Object.defineProperty(Array.prototype,"lastIndex",{enumerable:!1,configurable:!1,get:function(){return Math.max(0,this.length-1)}}),"lastItem"in Array.prototype||Object.defineProperty(Array.prototype,"lastItem",{enumerable:!1,configurable:!1,get:function(){return this[this.lastIndex]},set:function(e){this[this.lastIndex]=e}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(e,t){let r=-1;return this.forEach(((n,o,i)=>{e.call(t,n,o,i)&&(r=o)}),t),r}),!(Array.prototype.at instanceof Function)){const We=function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]};for(const Ge of s)void 0!==Ge&&Object.defineProperty(Ge.prototype,"at",{value:We,writable:!0,enumerable:!1,configurable:!0})}function l(e,t,r,{writable:n=!0,enumerable:o=!0,configurable:i=!0}={}){e[t]instanceof Function||Object.defineProperty(e,t,{value:r,writable:n,enumerable:o,configurable:i})}function c(e,t,{get:r,set:n,enumerable:o=!0,configurable:i=!0}={}){e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:r,set:n,enumerable:o,configurable:i})}if(!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(e){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(e){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(e){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(e){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(e,t,r=globalThis){let n=[];for await(const t of e)n.push(await t);return Array.from(n,t,r)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(e){return this===e||!!Array.isArray(e)&&(this.length===e.length&&this.every(((t,r)=>{const n=e[r];return Array.isArray(t)?Array.isArray(n)&&t.equals(n):Object.is(t,n)})))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(e){switch(typeof e){case"undefined":return[...new Set(this)];case"string":case"number":case"symbol":return this.uniqueBy((t=>t[e]));case"function":{const t=new Set;return this.filter(((...r)=>{const n=e.apply(this,r);return!t.has(n)&&(t.add(n),!0)}))}default:throw new TypeError("Not a valid argument for uniqueBy")}}),Array.prototype.toReversed instanceof Function||(Array.prototype.toReversed=function(){return[...this].reverse()}),Array.prototype.toSorted instanceof Function||(Array.prototype.toSorted=function(e){return[...this].sort(e)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(e,t,...r){const n=[...this];return n.splice(e,t,...r),n}),Array.prototype.with instanceof Function||(Array.prototype.with=function(e,t){const r=[...this];return r[e]=t,r}),Array.isTemplateObject instanceof Function||(Array.isTemplateObject=function(e){return!!(Array.isArray(e)&&Array.isArray(e.raw)&&Object.isFrozen(e)&&Object.isFrozen(e.raw))&&(0!==e.length&&e.length===e.raw.length)}),Uint8Array.prototype.toHex instanceof Function||(Uint8Array.prototype.toHex=function(){return Array.from(this,(e=>e.toString(16).padStart(2,"0"))).join("")}),Uint8Array.prototype.toBase64 instanceof Function||(Uint8Array.prototype.toBase64=function({alphabet:e="base64"}={}){if("base64"===e){const e=32768;let t="";for(let r=0;r<this.length;r+=e){const n=this.subarray(r,r+e);t+=String.fromCharCode.apply(null,n)}return btoa(t)}if("base64url"===e)return this.toBase64({alphabet:"base64"}).replaceAll("+","-").replaceAll("/","_");throw new TypeError('expected alphabet to be either "base64" or "base64url')}),Uint8Array.fromHex instanceof Function||(Uint8Array.fromHex=function(e){if("string"!=typeof e)throw new TypeError("expected input to be a string");if(0===!(1&e.length))throw new SyntaxError("string should be an even number of characters");return Uint8Array.from(globalThis.Iterator.range(0,e.length,{step:2}),(t=>parseInt(e.substring(t,t+2),16)))}),Uint8Array.fromBase64 instanceof Function||(Uint8Array.fromBase64=function(e,{alphabet:t="base64",lastChunkHandling:r="loose"}={}){if("string"!=typeof e)throw new TypeError("expected input to be a string");if(!["base64","base64url"].includes(t))throw new TypeError('expected alphabet to be either "base64" or "base64url');if(!["loose","strict","stop-before-partial"].includes(r))throw new TypeError(`Invalid \`lastChunkHandling\`: "${r}".`);if("base64"!==t)return Uint8Array.fromBase64(e.replaceAll("-","+").replaceAll("_","/"),{alphabet:"base64"});{const t=e.length%4;if(1===t)throw new TypeError("Invalid string length.");if(0===t)return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)));switch(r){case"strict":throw new SyntaxError("Missing padding.");case"loose":return Uint8Array.fromBase64(e.padEnd(e.length+(4-t),"="),{alphabet:"base64",lastChunkHandling:"strict"});case"stop-before-partial":return Uint8Array.fromBase64(e.slice(0,e.length-t),{alphabet:"base64",lastChunkHandling:"strict"})}}}),"Symbol"in globalThis){const Xe=new Set(Reflect.ownKeys(Symbol).filter((e=>"symbol"==typeof Symbol[e])).map((e=>Symbol[e])));void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator")),l(Symbol,"isRegistered",(function(e){return"symbol"==typeof e&&"string"==typeof Symbol.keyFor(e)})),l(Symbol,"isWellKnown",(function(e){return Xe.has(e)}))}function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p,h,f,d,m,g;function y(){if(h)return p;h=1;var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i={};((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(i,{URLPattern:()=>_}),e=i,p=((e,i,a,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of n(i))!o.call(e,l)&&l!==a&&t(e,l,{get:()=>i[l],enumerable:!(s=r(i,l))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e);var a=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(e,t,r,n,o,i){this.type=e,this.name=t,this.prefix=r,this.value=n,this.suffix=o,this.modifier=i}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}},s=/[$_\p{ID_Start}]/u,l=/[$_\u200C\u200D\p{ID_Continue}]/u,c=".*";function u(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function f(e,t=!1){let r=[],n=0;for(;n<e.length;){let o=e[n],i=function(o){if(!t)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:e[n++]})};if("*"!==o)if("+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o)if(":"!==o)if("("!==o)r.push({type:"CHAR",index:n,value:e[n++]});else{let t=1,o="",a=n+1,s=!1;if("?"===e[a]){i(`Pattern cannot start with "?" at ${a}`);continue}for(;a<e.length;){if(!u(e[a],!1)){i(`Invalid character '${e[a]}' at ${a}.`),s=!0;break}if("\\"!==e[a]){if(")"===e[a]){if(t--,0===t){a++;break}}else if("("===e[a]&&(t++,"?"!==e[a+1])){i(`Capturing groups are not allowed at ${a}`),s=!0;break}o+=e[a++]}else o+=e[a++]+e[a++]}if(s)continue;if(t){i(`Unbalanced pattern at ${n}`);continue}if(!o){i(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=a}else{let t="",o=n+1;for(;o<e.length;){let r=e.substr(o,1);if(!(o===n+1&&s.test(r)||o!==n+1&&l.test(r)))break;t+=e[o++]}if(!t){i(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:t}),n=o}else r.push({type:"CLOSE",index:n,value:e[n++]});else r.push({type:"OPEN",index:n,value:e[n++]});else r.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else r.push({type:"OTHER_MODIFIER",index:n,value:e[n++]});else r.push({type:"ASTERISK",index:n,value:e[n++]})}return r.push({type:"END",index:n,value:""}),r}function d(e,t={}){let r=f(e);t.delimiter??="/#?",t.prefixes??="./";let n=`[^${m(t.delimiter)}]+?`,o=[],i=0,s=0,l=new Set,u=e=>{if(s<r.length&&r[s].type===e)return r[s++].value},p=()=>u("OTHER_MODIFIER")??u("ASTERISK"),h=e=>{let t=u(e);if(void 0!==t)return t;let{type:n,index:o}=r[s];throw new TypeError(`Unexpected ${n} at ${o}, expected ${e}`)},d=()=>{let e,t="";for(;e=u("CHAR")??u("ESCAPED_CHAR");)t+=e;return t},g=t.encodePart||(e=>e),y="",b=e=>{y+=e},w=()=>{y.length&&(o.push(new a(3,"","",g(y),"",3)),y="")},v=(e,t,r,s,u)=>{let p,h=3;switch(u){case"?":h=1;break;case"*":h=0;break;case"+":h=2}if(!t&&!r&&3===h)return void b(e);if(w(),!t&&!r){if(!e)return;return void o.push(new a(3,"","",g(e),"",h))}p=r?"*"===r?c:r:n;let f,d=2;if(p===n?(d=1,p=""):p===c&&(d=0,p=""),t?f=t:r&&(f=i++),l.has(f))throw new TypeError(`Duplicate name '${f}'.`);l.add(f),o.push(new a(d,f,g(e),p,g(s),h))};for(;s<r.length;){let e=u("CHAR"),r=u("NAME"),n=u("REGEX");if(!r&&!n&&(n=u("ASTERISK")),r||n){let o=e??"";-1===t.prefixes.indexOf(o)&&(b(o),o=""),w(),v(o,r,n,"",p());continue}let o=e??u("ESCAPED_CHAR");if(o)b(o);else if(u("OPEN")){let e=d(),t=u("NAME"),r=u("REGEX");!t&&!r&&(r=u("ASTERISK"));let n=d();h("CLOSE"),v(e,t,r,n,p())}else w(),h("END")}return o}function m(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function g(e){return e&&e.ignoreCase?"ui":"u"}function y(e){switch(e){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function b(e,t,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let o of e){if(3===o.type){3===o.modifier?n+=m(o.value):n+=`(?:${m(o.value)})${y(o.modifier)}`;continue}t&&t.push(o.name);let e=`[^${m(r.delimiter)}]+?`,i=o.value;(1===o.type?i=e:0===o.type&&(i=c),o.prefix.length||o.suffix.length)?3!==o.modifier&&1!==o.modifier?(n+=`(?:${m(o.prefix)}`,n+=`((?:${i})(?:`,n+=m(o.suffix),n+=m(o.prefix),n+=`(?:${i}))*)${m(o.suffix)})`,0===o.modifier&&(n+="?")):(n+=`(?:${m(o.prefix)}(${i})${m(o.suffix)})`,n+=y(o.modifier)):3===o.modifier||1===o.modifier?n+=`(${i})${y(o.modifier)}`:n+=`((?:${i})${y(o.modifier)})`}let o=`[${m(r.endsWith)}]|$`,i=`[${m(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${o})`:n+="$",new RegExp(n,g(r));r.strict||(n+=`(?:${i}(?=${o}))?`);let a=!1;if(e.length){let t=e[e.length-1];3===t.type&&3===t.modifier&&(a=r.delimiter.indexOf(t)>-1)}return a||(n+=`(?=${i}|${o})`),new RegExp(n,g(r))}var w={delimiter:"",prefixes:"",sensitive:!0,strict:!0},v={delimiter:".",prefixes:"",sensitive:!0,strict:!0},T={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function E(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function S(e){return!(!e||e.length<2)&&("["===e[0]||("\\"===e[0]||"{"===e[0])&&"["===e[1])}var A=["ftp","file","http","https","ws","wss"];function x(e){if(!e)return!0;for(let t of A)if(e.test(t))return!0;return!1}function M(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function L(e){if(""===e)return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function O(e){if(""===e)return e;let t=new URL("https://example.com");return t.username=e,t.username}function k(e){if(""===e)return e;let t=new URL("https://example.com");return t.password=e,t.password}function P(e){if(""===e)return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function F(e){if(""===e)return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function R(e){if(""===e||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function j(e){if(""===e)return e;let t=new URL("https://example.com");return t.pathname="/"!==e[0]?"/-"+e:e,"/"!==e[0]?t.pathname.substring(2,t.pathname.length):t.pathname}function I(e){return""===e?e:new URL(`data:${e}`).pathname}function N(e){if(""===e)return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function C(e){if(""===e)return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}var U=["protocol","username","password","hostname","port","pathname","search","hash"],H="*";function D(e,t){if("string"!=typeof e)throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:""!==r.search?r.search.substring(1,r.search.length):void 0,hash:""!==r.hash?r.hash.substring(1,r.hash.length):void 0}}function $(e,t){return t?z(e):e}function q(e,t,r){let n;if("string"==typeof t.baseURL)try{n=new URL(t.baseURL),void 0===t.protocol&&(e.protocol=$(n.protocol.substring(0,n.protocol.length-1),r)),!r&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&(e.username=$(n.username,r)),!r&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&void 0===t.password&&(e.password=$(n.password,r)),void 0===t.protocol&&void 0===t.hostname&&(e.hostname=$(n.hostname,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&(e.port=$(n.port,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&(e.pathname=$(n.pathname,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&(e.search=$(n.search.substring(1,n.search.length),r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&void 0===t.hash&&(e.hash=$(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if("string"==typeof t.protocol&&(e.protocol=function(e,t){return e=function(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}(e,":"),t||""===e?e:L(e)}(t.protocol,r)),"string"==typeof t.username&&(e.username=function(e,t){if(t||""===e)return e;let r=new URL("https://example.com");return r.username=e,r.username}(t.username,r)),"string"==typeof t.password&&(e.password=function(e,t){if(t||""===e)return e;let r=new URL("https://example.com");return r.password=e,r.password}(t.password,r)),"string"==typeof t.hostname&&(e.hostname=function(e,t){return t||""===e?e:S(e)?F(e):P(e)}(t.hostname,r)),"string"==typeof t.port&&(e.port=function(e,t,r){return M(t)===e&&(e=""),r||""===e?e:R(e)}(t.port,e.protocol,r)),"string"==typeof t.pathname){if(e.pathname=t.pathname,n&&!function(e,t){return!(!e.length||"/"!==e[0]&&(!t||e.length<2||"\\"!=e[0]&&"{"!=e[0]||"/"!=e[1]))}(e.pathname,r)){let t=n.pathname.lastIndexOf("/");t>=0&&(e.pathname=$(n.pathname.substring(0,t+1),r)+e.pathname)}e.pathname=function(e,t,r){if(r||""===e)return e;if(t&&!A.includes(t))return new URL(`${t}:${e}`).pathname;let n="/"==e[0];return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}(e.pathname,e.protocol,r)}return"string"==typeof t.search&&(e.search=function(e,t){if(e=E(e,"?"),t||""===e)return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}(t.search,r)),"string"==typeof t.hash&&(e.hash=function(e,t){if(e=E(e,"#"),t||""===e)return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}(t.hash,r)),e}function z(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function B(e,t){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let r=`[^${function(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}(t.delimiter)}]+?`,n=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let i=0;i<e.length;++i){let a=e[i];if(3===a.type){if(3===a.modifier){o+=z(a.value);continue}o+=`{${z(a.value)}}${y(a.modifier)}`;continue}let s=a.hasCustomName(),l=!!a.suffix.length||!!a.prefix.length&&(1!==a.prefix.length||!t.prefixes.includes(a.prefix)),c=i>0?e[i-1]:null,u=i<e.length-1?e[i+1]:null;if(!l&&s&&1===a.type&&3===a.modifier&&u&&!u.prefix.length&&!u.suffix.length)if(3===u.type){let e=u.value.length>0?u.value[0]:"";l=n.test(e)}else l=!u.hasCustomName();if(!l&&!a.prefix.length&&c&&3===c.type){let e=c.value[c.value.length-1];l=t.prefixes.includes(e)}l&&(o+="{"),o+=z(a.prefix),s&&(o+=`:${a.name}`),2===a.type?o+=`(${a.value})`:1===a.type?s||(o+=`(${r})`):0===a.type&&(s||c&&3!==c.type&&3===c.modifier&&!l&&""===a.prefix?o+="(.*)":o+="*"),1===a.type&&s&&a.suffix.length&&n.test(a.suffix[0])&&(o+="\\"),o+=z(a.suffix),l&&(o+="}"),3!==a.modifier&&(o+=y(a.modifier))}return o}var _=class{#e;#t={};#r={};#n={};#o={};#i=!1;constructor(e={},t,r){try{let n;if("string"==typeof t?n=t:r=t,"string"==typeof e){let t=new class{#e;#t=[];#r={};#n=0;#o=1;#i=0;#a=0;#s=0;#l=0;#c=!1;constructor(e){this.#e=e}get result(){return this.#r}parse(){for(this.#t=f(this.#e,!0);this.#n<this.#t.length;this.#n+=this.#o){if(this.#o=1,"END"===this.#t[this.#n].type){if(0===this.#a){this.#u(),this.#p()?this.#h(9,1):this.#f()?this.#h(8,1):this.#h(7,0);continue}if(2===this.#a){this.#d(5);continue}this.#h(10,0);break}if(this.#s>0){if(!this.#m())continue;this.#s-=1}if(this.#g())this.#s+=1;else switch(this.#a){case 0:this.#y()&&this.#d(1);break;case 1:if(this.#y()){this.#b();let e=7,t=1;this.#w()?(e=2,t=3):this.#c&&(e=2),this.#h(e,t)}break;case 2:this.#v()?this.#d(3):(this.#T()||this.#f()||this.#p())&&this.#d(5);break;case 3:this.#E()?this.#h(4,1):this.#v()&&this.#h(5,1);break;case 4:this.#v()&&this.#h(5,1);break;case 5:this.#S()?this.#l+=1:this.#A()&&(this.#l-=1),this.#x()&&!this.#l?this.#h(6,1):this.#T()?this.#h(7,0):this.#f()?this.#h(8,1):this.#p()&&this.#h(9,1);break;case 6:this.#T()?this.#h(7,0):this.#f()?this.#h(8,1):this.#p()&&this.#h(9,1);break;case 7:this.#f()?this.#h(8,1):this.#p()&&this.#h(9,1);break;case 8:this.#p()&&this.#h(9,1)}}void 0!==this.#r.hostname&&void 0===this.#r.port&&(this.#r.port="")}#h(e,t){switch(this.#a){case 0:case 2:break;case 1:this.#r.protocol=this.#M();break;case 3:this.#r.username=this.#M();break;case 4:this.#r.password=this.#M();break;case 5:this.#r.hostname=this.#M();break;case 6:this.#r.port=this.#M();break;case 7:this.#r.pathname=this.#M();break;case 8:this.#r.search=this.#M();break;case 9:this.#r.hash=this.#M()}0!==this.#a&&10!==e&&([1,2,3,4].includes(this.#a)&&[6,7,8,9].includes(e)&&(this.#r.hostname??=""),[1,2,3,4,5,6].includes(this.#a)&&[8,9].includes(e)&&(this.#r.pathname??=this.#c?"/":""),[1,2,3,4,5,6,7].includes(this.#a)&&9===e&&(this.#r.search??="")),this.#L(e,t)}#L(e,t){this.#a=e,this.#i=this.#n+t,this.#n+=t,this.#o=0}#u(){this.#n=this.#i,this.#o=0}#d(e){this.#u(),this.#a=e}#O(e){return e<0&&(e=this.#t.length-e),e<this.#t.length?this.#t[e]:this.#t[this.#t.length-1]}#k(e,t){let r=this.#O(e);return r.value===t&&("CHAR"===r.type||"ESCAPED_CHAR"===r.type||"INVALID_CHAR"===r.type)}#y(){return this.#k(this.#n,":")}#w(){return this.#k(this.#n+1,"/")&&this.#k(this.#n+2,"/")}#v(){return this.#k(this.#n,"@")}#E(){return this.#k(this.#n,":")}#x(){return this.#k(this.#n,":")}#T(){return this.#k(this.#n,"/")}#f(){if(this.#k(this.#n,"?"))return!0;if("?"!==this.#t[this.#n].value)return!1;let e=this.#O(this.#n-1);return"NAME"!==e.type&&"REGEX"!==e.type&&"CLOSE"!==e.type&&"ASTERISK"!==e.type}#p(){return this.#k(this.#n,"#")}#g(){return"OPEN"==this.#t[this.#n].type}#m(){return"CLOSE"==this.#t[this.#n].type}#S(){return this.#k(this.#n,"[")}#A(){return this.#k(this.#n,"]")}#M(){let e=this.#t[this.#n],t=this.#O(this.#i).index;return this.#e.substring(t,e.index)}#b(){let e={};Object.assign(e,w),e.encodePart=L;let t=function(e,t,r){return b(d(e,r),t,r)}(this.#M(),void 0,e);this.#c=x(t)}}(e);if(t.parse(),e=t.result,void 0===n&&"string"!=typeof e.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");e.baseURL=n}else{if(!e||"object"!=typeof e)throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let o,i={ignoreCase:!0===r.ignoreCase},a={pathname:H,protocol:H,username:H,password:H,hostname:H,port:H,search:H,hash:H};for(o of(this.#e=q(a,e,!0),M(this.#e.protocol)===this.#e.port&&(this.#e.port=""),U)){if(!(o in this.#e))continue;let e={},t=this.#e[o];switch(this.#r[o]=[],o){case"protocol":Object.assign(e,w),e.encodePart=L;break;case"username":Object.assign(e,w),e.encodePart=O;break;case"password":Object.assign(e,w),e.encodePart=k;break;case"hostname":Object.assign(e,v),S(t)?e.encodePart=F:e.encodePart=P;break;case"port":Object.assign(e,w),e.encodePart=R;break;case"pathname":x(this.#t.protocol)?(Object.assign(e,T,i),e.encodePart=j):(Object.assign(e,w,i),e.encodePart=I);break;case"search":Object.assign(e,w,i),e.encodePart=N;break;case"hash":Object.assign(e,w,i),e.encodePart=C}try{this.#o[o]=d(t,e),this.#t[o]=b(this.#o[o],this.#r[o],e),this.#n[o]=B(this.#o[o],e),this.#i=this.#i||this.#o[o].some((e=>2===e.type))}catch{throw new TypeError(`invalid ${o} pattern '${this.#e[o]}'.`)}}}catch(e){throw new TypeError(`Failed to construct 'URLPattern': ${e.message}`)}}test(e={},t){let r,n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{n=q(n,"object"==typeof e?e:D(e,t),!1)}catch{return!1}for(r of U)if(!this.#t[r].exec(n[r]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{r=q(r,"object"==typeof e?e:D(e,t),!1)}catch{return null}let n,o={};for(n of(o.inputs=t?[e,t]:[e],U)){let e=this.#t[n].exec(r[n]);if(!e)return null;let t={};for(let[r,o]of this.#r[n].entries())if("string"==typeof o||"number"==typeof o){let n=e[r+1];t[o]=n}o[n]={input:r[n]??"",groups:t}}return o}static compareComponent(e,t,r){let n=(e,t)=>{for(let r of["type","modifier","prefix","value","suffix"]){if(e[r]<t[r])return-1;if(e[r]!==t[r])return 1}return 0},o=new a(3,"","","","",3),i=new a(0,"","","","",3),s=(e,t)=>{let r=0;for(;r<Math.min(e.length,t.length);++r){let o=n(e[r],t[r]);if(o)return o}return e.length===t.length?0:n(e[r]??o,t[r]??o)};return t.#n[e]||r.#n[e]?t.#n[e]&&!r.#n[e]?s(t.#o[e],[i]):!t.#n[e]&&r.#n[e]?s([i],r.#o[e]):s(t.#o[e],r.#o[e]):0}get protocol(){return this.#n.protocol}get username(){return this.#n.username}get password(){return this.#n.password}get hostname(){return this.#n.hostname}get port(){return this.#n.port}get pathname(){return this.#n.pathname}get search(){return this.#n.search}get hash(){return this.#n.hash}get hasRegExpGroups(){return this.#i}};return p}!function(){if(!(Function.prototype.once instanceof Function)){const e=new WeakMap;Function.prototype.once=function(t){const r=this;return function(...n){if(e.has(r))return e.get(r);if("AsyncFunction"===r.constructor.name){const o=r.apply(t||r,n).catch((t=>{throw e.delete(r),t}));return e.set(r,o),o}if(r instanceof Function){const o=r.apply(t||r,n);return e.set(r,o),o}}}}}();var b=u(g?m:(g=1,m=function(){if(d)return f;d=1;const{URLPattern:e}=y();return f={URLPattern:e},globalThis.URLPattern||(globalThis.URLPattern=e),f}()));"URLPattern"in globalThis||(globalThis.URLPattern=b),l(URL,"parse",((e,t)=>{try{return new URL(e,t)}catch{return null}})),l(URL,"canParse",((e,t)=>{try{return new URL(e,t)instanceof URL}catch{return!1}})),Number.range instanceof Function||(Number.range=function(e,t,r=1){return console.warn("`Number.range()` is deprecated. Use `Iterator.range()` instead."),globalThis.Iterator.range(e,t,{step:r})});const w="Iterator"in globalThis,v=w?Object.getPrototypeOf(globalThis.Iterator):Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),T=w?globalThis.Iterator:(e=>{class t{[Symbol.iterator](){return this}}return Object.setPrototypeOf(t,e),t})(v);var E;T.range instanceof Function||(T.range=function(e,t,r){if("number"==typeof r||"bigint"==typeof r)return T.range(e,t,{step:r});if("object"!=typeof r||Object.is(r,null))return T.range(e,t,{});{const{step:n=("number"==typeof e?e<t?1:-1:e<t?1n:-1n),inclusive:o=!1}=r;if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Start must be a number");if(Number.isNaN(e))throw new RangeError("Invalid start");if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("End must be a number");if(Number.isNaN(t))throw new RangeError("Invalid end");if("number"!=typeof n&&"bigint"!=typeof n)throw new TypeError("Step must be a number");if(Number.isNaN(n))throw new RangeError("Invalid step");if(0===n)throw new RangeError("Step must not be 0");if(n<0&&e<t||n>0&&e>t)return;if(o){let r=e;return n>0?T.from({next(){const e=r<=t?{value:r,done:!1}:{done:!0};return r+=n,e}}):T.from({next(){const e=r>=t?{value:r,done:!1}:{done:!0};return r+=n,e}})}{let r=e;if(n>0)return T.from({next(){const e=r<t?{value:r,done:!1}:{done:!0};return r+=n,e}});{let r=e;return T.from({next(){const e=r>t?{value:r,done:!1}:{done:!0};return r+=n,e}})}}}}),v[Symbol.toStringTag]||(v[Symbol.toStringTag]="Iterator"),v.take instanceof Function||(v.take=function(e){let t=0;const r=this;return T.from({next:()=>t++>=e?{done:!0}:r.next()})}),v.drop instanceof Function||(v.drop=function(e){for(let t=0;t<e;t++){const{done:e}=this.next();if(e)break}return this}),v.toArray instanceof Function||(v.toArray=function(){return Array.from(this)}),v.forEach instanceof Function||(v.forEach=function(e){for(const t of this)e.call(this,t)}),v.flatMap instanceof Function||(v.flatMap=function(e){const t=this;let r=this.next();const n=({value:r,done:n=!0}={})=>n?T.from({next:()=>({done:!0})}):T.from(e.call(t,r));let o=n(r);return T.from({next(){const{value:e,done:i=!0}=o.next();return r.done&&i?{done:!0}:i?r.done?{done:!0}:(r=t.next(),o=n(r),o.next()):{value:e,done:i}}})}),v.map instanceof Function||(v.map=function(e){const t=this;return T.from({next(){const{done:r,value:n}=t.next();return r?{done:r}:{value:e.call(t,n),done:!1}}})}),v.reduce instanceof Function||(v.reduce=function(e,t){let r=void 0===t?this.next().value:t;for(const t of this)r=e.call(this,r,t);return r}),v.filter instanceof Function||(v.filter=function(e){const t=this;let r,n=!1;return T.from({next(){for(;!n;){const o=t.next();if(n=o.done,n)break;if(e.call(t,o.value)){r=o.value;break}}return{done:n,value:r}}})}),v.some instanceof Function||(v.some=function(e){let t=!1;for(const r of this)if(e.call(this,r)){t=!0;break}return t}),v.every instanceof Function||(v.every=function(e){let t=!0;for(const r of this)if(!e.call(this,r)){t=!1;break}return t}),v.find instanceof Function||(v.find=function(e){for(const t of this)if(e.call(this,t))return t}),v.indexed instanceof Function||(v.indexed=function(){let e=0;return this.map((t=>[e++,t]))}),v.chunks instanceof Function||(v.chunks=function(e){if(!Number.isSafeInteger(e)||e<1)throw new TypeError("Size must be a positive integer.");{const t=this;let r=!1;return T.from({next(){if(r)return{done:r};{const n=[];let o=0;for(;o++<e&&!r;){const e=t.next();if(e.done){r=!0,void 0!==e.value&&n.push(e.value);break}n.push(e.value)}return{value:n,done:!1}}}})}}),T.from instanceof Function||(T.from=function(e){if("object"!=typeof e||null===e)throw new TypeError("Not an object.");if(e.next instanceof Function){return Object.create(v,{next:{enumerable:!0,configurable:!1,writable:!1,value:(...t)=>e.next(...t)}})}if(e[Symbol.iterator]instanceof Function)return T.from(e[Symbol.iterator]())}),w||(globalThis.Iterator=T),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=e=>e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=e=>(e>0)-(e<0)||+e),Math.hasOwnProperty("trunc")||(Math.trunc=e=>{const t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}),Math.hasOwnProperty("expm1")||(Math.expm1=e=>Math.exp(e)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...e)=>Math.sqrt(e.reduce(((e,t)=>e+t**2),0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=e=>e**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=e=>Math.log(e)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=e=>Math.log(e)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=e=>Math.log(1+e)),Math.hasOwnProperty("fround")||(Math.fround=(E=new Float32Array(1),function(e){return E[0]=e,E[0]})),Math.clamp instanceof Function||(Math.clamp=function(e,t,r){return Math.min(Math.max(e,t),r)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),Math.sumPrecise instanceof Function||(Math.sumPrecise=function(e){let t=-0;for(const r of e){if(!Number.isFinite(r)){t=-0;break}t+=r}return t}),Math.sum instanceof Function||(Math.sum=function(...e){return console.warn("Math.sum is deprecated. Please use Math.sumPrecise instead."),Math.sumPrecise(e)}),function(){if(!("isSecureContext"in globalThis)){const e=["localhost","127.0.0.1"],t="https:",r=[t,"file:","wss:"],n=(e=globalThis.document)=>[...e.scripts].every((({src:r})=>{if(0===r.length)return!0;{const{protocol:n,hostname:o}=new URL(r,e.baseURI);return n===t||o===location.hostname}}));Object.defineProperty(globalThis,"isSecureContext",{enumerable:!0,configurable:!0,get:function(){return window.parent===window&&(!(!r.includes(location.protocol)&&!e.includes(location.hostname))&&n())}})}}();function S(e){return function(e){return e instanceof Function&&"AsyncFunction"===e.constructor.name}(e)||e instanceof Promise}
2
2
  /**
3
3
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
4
4
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Lock
5
- */const ie=new WeakMap;class ae{constructor(e,t="exclusive"){if(!["exclusive","shared"].includes(t))throw new TypeError(`'${t}' (value of 'mode' member of LockOptions) is not a valid value for enumeration LockMode.`);if("string"!=typeof e&&(e=e.toString()),e.startsWith("-"))throw new DOMException("Names starting with `-` are reserved");ie.set(this,{name:e,mode:t})}get name(){return ie.get(this).name}get mode(){return ie.get(this).mode}}
5
+ */const A=new WeakMap;class x{constructor(e,t="exclusive"){if(!["exclusive","shared"].includes(t))throw new TypeError(`'${t}' (value of 'mode' member of LockOptions) is not a valid value for enumeration LockMode.`);if("string"!=typeof e&&(e=e.toString()),e.startsWith("-"))throw new DOMException("Names starting with `-` are reserved");A.set(this,{name:e,mode:t})}get name(){return A.get(this).name}get mode(){return A.get(this).mode}}
6
6
  /**
7
7
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
8
- */const se=new Map,le=Symbol("lock-key"),ce="locks"in navigator&&navigator.locks.request instanceof Function;const ue=async function(){return await new Promise((e=>{"locks"in navigator&&navigator.locks.request instanceof Function?navigator.locks.query().then((()=>e(!0))).catch((()=>e(!1))):e(!1)}))}();async function pe(e,t=null){return new Promise(((r,n)=>{oe(e)?e.call(globalThis,t).then(r,n):queueMicrotask((()=>{try{const n=e.call(globalThis,t);r(n)}catch(e){n(e)}}))}))}async function he(e){se.has(e)&&await se.get(e).promise.catch(console.error)}function fe(e,t,r){const{resolve:n,reject:o,promise:i}=function(){if(Promise.withResolvers instanceof Function)return Promise.withResolvers();{const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}}(),a=new AbortController,s=new ae(e,t),l=function({name:e,mode:t}){switch(t){case"exclusive":return me().some((t=>t.name===e));case"shared":return me().some((t=>t.name===e&&"exclusive"===t.mode))}}(s);return se.set(s,{resolve:n,reject:o,promise:i,callback:r,pending:l,controller:a}),s}function de(e){return e instanceof ae&&se.has(e)&&se.get(e).pending}function me(e){return"string"==typeof e?[...se.keys()].filter((t=>t.name===e)):[...se.keys()]}function ye(e){return me(e).filter((e=>!de(e)))}function ge(e){return me(e).filter((e=>de(e)))}async function be(e){switch(e.mode){case"exclusive":await Promise.allSettled(me().filter((t=>t.name===e.name&&t!==e)).map(he));break;case"shared":await Promise.allSettled(me().filter((t=>t.name===e.name&&"exclusive"===t.mode&&t!==e)).map(he))}}function we(e){if(se.has(e))return se.get(e).controller.signal}async function ve(e){if(se.has(e)){const{resolve:t,reject:r,promise:n,callback:o,pending:i,controller:a}=se.get(e);return i&&function(e,t=!0){se.has(e)&&se.set(e,{...se.get(e),pending:t})}(e,!1),pe(o,e).then(t,r).finally((()=>{se.delete(e),requestIdleCallback((()=>a.abort()))})),n}}class Te{constructor(e){if(e!==le)throw new TypeError("Invalid constructor")}static async request(e,...t){let r,n={};t[0]instanceof Function?r=t[0]:t[1]instanceof Function&&([n,r]=t),"string"!=typeof e&&(e=e.toString());const{mode:o="exclusive",ifAvailable:i=!1,steal:a=!1,signal:s}=n;if(a&&i)throw new DOMException("LockManager.request: `steal` and `ifAvailable` cannot be used together");if(e.startsWith("-"))throw new DOMException("LockManager.request: Names starting with `-` are reserved");if(!["exclusive","shared"].includes(o))throw new TypeError(`LockManager.request: '${o}' (value of 'mode' member of LockOptions) is not a valid value for enumeration LockMode.`);if(s instanceof AbortSignal&&s.aborted)throw s.reason;if("shared"===o&&a)throw new DOMException("LockManager.request: `steal` is only supported for exclusive lock requests");const l=ye(e),c=ge(e),u=[...l,...c].some((t=>t.name===e));a&&u&&function(e){[...se.entries()].filter((([t])=>t.name===e)).forEach((([e,{reject:t,controller:r}])=>{requestIdleCallback((()=>{r.abort(),se.delete(e)})),t(new DOMException("The lock request is aborted"))}))}(e);const p=fe(e,o,r);switch(s instanceof AbortSignal&&s.addEventListener("abort",(()=>{if(se.has(p)){const{reject:e,controller:t}=se.get(p);se.delete(p),e(new DOMException("The lock request is aborted")),t.abort()}}),{once:!0,signal:we(p)}),o){case"exclusive":if(!i||0===l.length&&0===c.length)return await be(p),await ve(p);{const e=se.get(p).controller;return se.delete(p),await pe(r,null).then((t=>(requestIdleCallback((()=>e.abort())),t)))}case"shared":if(i){if([...l,...c].some((e=>"exclusive"===e.mode))){const e=se.get(p).controller;return se.delete(p),await pe(r,null).then((t=>(requestIdleCallback((()=>e.abort())),t)))}return await be(p),await ve(p)}return await be(p),await ve(p);default:throw new TypeError(`LockManager.request: '${o}' (value of 'mode' member of LockOptions) is not a valid value for enumeration LockMode.`)}}static async query(){return{held:ye().map((({name:e,mode:t})=>({name:e,mode:t,clientId:null}))),pending:ge().map((({name:e,mode:t})=>({name:e,mode:t,clientId:null})))}}}function Ee(e,t="error"){if(e instanceof Error){const{message:r,name:n,fileName:o,lineNumber:i,columnNumber:a}=e;return new ErrorEvent(t,{error:e,message:`${n}: ${r}`,filename:o,lineno:i,colno:a})}throw new TypeError("`errorToEvent()` only accepts Errors")}let Se=!1;if(new Promise((async e=>{if(ce)if(await ue)e(!1);else try{navigator.locks.request=Te.request,navigator.locks.query=Te.query,Se=!0,e(!0)}catch(t){globalThis.dispatchEvent(Ee(t)),e(!1)}else try{navigator.locks=Te,Se=!0,e(!0)}catch(t){globalThis.dispatchEvent(Ee(t)),e(!1)}})),navigator.canShare instanceof Function||(navigator.canShare=function({title:e,text:t,url:r,files:n}={}){return navigator.share instanceof Function&&(!Array.isArray(n)||0===n.length)&&(!![e,t,r].every((e=>void 0===e))||[e,t,r].some((e=>"string"==typeof e&&0!==e.length)))}),navigator.setAppBadge instanceof Function||(navigator.setAppBadge=async e=>{if(!Number.isInteger(e))throw new TypeError("Failed to execute 'setAppBadge' on 'Navigator': Value is not of type 'unsigned long long'");if(e<0)throw new TypeError("Failed to execute 'setAppBadge' on 'Navigator': Value is outside the 'unsigned long long' value range.");0===e?document.title.startsWith("(")&&(document.title=document.title.replace(/^\((\d{1,2}\+?)\)\s/,"")):e<100?(await navigator.clearAppBadge(),document.title=`(${e}) ${document.title}`):(await navigator.clearAppBadge(),document.title=`(99+) ${document.title}`)}),navigator.clearAppBadge instanceof Function||(navigator.clearAppBadge=()=>navigator.setAppBadge(0)),Navigator.prototype.hasOwnProperty("pdfViewerEnabled")||Object.defineProperty(navigator,"pdfViewerEnabled",{enumerable:!0,configurable:!1,writable:!1,value:!1}),Navigator.prototype.getInstalledRelatedApps instanceof Function||(Navigator.prototype.getInstalledRelatedApps=async()=>[]),Navigator.prototype.getGamepads instanceof Function||(Navigator.prototype.getGamepads=()=>[]),"hardwareConcurrency"in Navigator.prototype||Object.defineProperty(Navigator.prototype,"hardwareConcurrency",{get:()=>1}),"connection"in Navigator.prototype?"type"in navigator.connection||(navigator.connection.type="unknown"):Object.defineProperty(Navigator.prototype,"connection",{get:()=>Object.create(EventTarget.prototype,{type:{value:"unknown"},effectiveType:{value:"4g"},rtt:{value:NaN},downlink:{value:NaN},downlinkMax:{value:1/0},saveData:{value:!1},onchange:{value:null,writable:!0},ontypechange:{value:null,writable:!0}})}),"doNotTrack"in Navigator.prototype||Object.defineProperty(Navigator.prototype,"doNotTrack",{get:()=>"unspecified"}),"globalPrivacyControl"in Navigator.prototype||Object.defineProperty(Navigator.prototype,"globalPrivacyControl",{get:()=>!1}),function(){if(!(globalThis.requestIdleCallback instanceof Function)){const e=e=>Number.isSafeInteger(e)&&e>0;globalThis.requestIdleCallback=function(t,{timeout:r}={}){const n=performance.now(),o=()=>e(r)?Math.max(0,r-(performance.now()-n)):Math.max(0,600-(performance.now()-n));return setTimeout((()=>t({didTimeout:!!e(r)&&0===o(),timeRemaining:o})),1)}}globalThis.cancelIdleCallback instanceof Function||(globalThis.cancelIdleCallback=e=>clearTimeout(e)),globalThis.requestAnimationFrame instanceof Function||(globalThis.requestAnimationFrame=e=>setTimeout((()=>e(performance.now())),1e3/60)),globalThis.cancelAnimationFrame instanceof Function||(globalThis.cancelAnimationFrame=e=>clearTimeout(e)),globalThis.queueMicrotask instanceof Function||(globalThis.queueMicrotask=e=>Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e})))))}(),!("AbortSignal"in globalThis)){const At={signal:Symbol("signal"),aborted:Symbol("aborted"),reason:Symbol("reason"),onabort:Symbol("onabort")};globalThis.AbortError=class extends Error{},globalThis.AbortSignal=class e extends EventTarget{constructor(){super(),Object.defineProperties(this,{[At.aborted]:{enumerable:!1,writable:!0,configurable:!1,value:!1},[At.reason]:{enumerable:!1,writable:!0,configurable:!1,value:void 0},[At.onabort]:{enumerable:!1,writable:!0,configurable:!1,value:null}}),this.addEventListener("abort",(e=>{this.onabort instanceof Function&&this.onabort.call(this,e)}))}get aborted(){return this[At.aborted]}get onabort(){return this[At.onabort]}set onabort(e){this[At.onabort]=e instanceof Function?e:null}get reason(){return this[At.reason]}throwIfAborted(){if(this.aborted)throw this.reason}static abort(t=new DOMException("Operation aborted")){const r=new e;return r[At.aborted]=!0,r[At.reason]=t,r}},globalThis.AbortController=class{constructor(){this[At.signal]=new AbortSignal}get signal(){return this[At.signal]}abort(e=new DOMException("Operation aborted")){const t=this.signal;t.aborted||(t[At.aborted]=!0,t[At.reason]=e,t.dispatchEvent(new Event("abort")))}}}if(!("reason"in AbortSignal.prototype)){const xt=new WeakMap,Mt=AbortController.prototype.abort;if(AbortSignal.abort instanceof Function){const Lt=AbortSignal.abort;AbortSignal.abort=function(e=new DOMException("Operation aborted")){const t=Lt();return xt.set(t,e),t}}else AbortSignal.abort=function(e=new DOMException("Operation aborted")){const t=new AbortController;return t.abort(e),t.reason};Object.defineProperty(AbortSignal.prototype,"reason",{enumerable:!0,configurable:!0,get:function(){return xt.has(this)?xt.get(this):void 0}}),AbortController.prototype.abort=function(e=new DOMException("Operation aborted")){xt.set(this.signal,e),Mt.call(this)}}AbortSignal.prototype.throwIfAborted instanceof Function||(AbortSignal.prototype.throwIfAborted=function(){if(this.aborted)throw this.reason}),AbortSignal.timeout instanceof Function||(AbortSignal.timeout=function(e){if(void 0===e)throw new TypeError("At least one 1 argument required but only 0 passed");if(Number.isFinite(e)){if(e<0)throw new TypeError("Argument 1 is out of range for unsigned long long.");{const t=new AbortController;return setTimeout((()=>t.abort(new DOMException("The operation timed out."))),e),t.signal}}throw new TypeError("Argument 1 is not a finite value, so it is out of range for unsigned long long.")}),AbortSignal.any instanceof Function||(AbortSignal.any=function(e){if(!Array.isArray(e))throw new TypeError("Expected an array of signals");const t=new AbortController;for(const r of e){if(!(r instanceof AbortSignal)){const e=new TypeError("`signal` is not an `AbortSignal`");throw t.abort(e),e}if(r.aborted){t.abort(r.reason||new DOMException("Operation aborted."));break}r.addEventListener("abort",(({target:e})=>{t.abort(e.reason||new DOMException("Operation aborted."))}),{signal:t.signal})}return t.signal}),globalThis.hasOwnProperty("AggregateError")||(globalThis.AggregateError=class extends Error{constructor(e,t){void 0===t?(super(e),this.errors=[]):(super(t),this.errors=e)}}),globalThis.reportError instanceof Function||(globalThis.reportError=function(e){globalThis.dispatchEvent(Ee(e))}),function(){if("MediaQueryListEvent"in globalThis||(globalThis.MediaQueryListEvent=class extends Event{constructor(e,{media:t,matches:r}={}){super(e),Object.defineProperties(this,{media:{enumerable:!0,configurable:!1,writable:!1,value:t},matches:{enumerable:!0,configurable:!1,writable:!1,value:r}})}}),"MediaQueryList"in globalThis&&!(globalThis.MediaQueryList.prototype.addEventListener instanceof Function)){const e=new WeakMap,t=function(){const{media:e,matches:t}=this;this.dispatchEvent(new MediaQueryListEvent("change",{media:e,matches:t}))},r=function(r){return e.has(r)||(e.set(r,new EventTarget),r.addListener(t.bind(r))),e.get(r)};globalThis.MediaQueryList.prototype.addEventListener=function(e,t,n){r(this).addEventListener(e,t,n)},globalThis.MediaQueryList.prototype.removeEventListener=function(e,t,n){r(this).removeEventListener(e,t,n)},globalThis.MediaQueryList.prototype.dispatchEvent=function(e){r(this).dispatchEvent(e)}}}(),"Promise"in globalThis&&(Promise.prototype.finally instanceof Function||(Promise.prototype.finally=function(e){return this.then((async t=>(await e(),t)),(async t=>(await e(),t)))}),Promise.allSettled instanceof Function||(Promise.allSettled=function(e){return Promise.all(Array.from(e).map((function(e){return new Promise((function(t){e instanceof Promise||(e=Promise.resolve(e)),e.then((function(e){t({status:"fulfilled",value:e})})).catch((function(e){t({status:"rejected",reason:e})}))}))})))}),Promise.any instanceof Function||(Promise.any=e=>new Promise(((t,r)=>{let n=[];e.forEach((o=>{o.then(t).catch((t=>{n.push(t),n.length===e.length&&r(new globalThis.AggregateError(n,"No Promise in Promise.any was resolved"))}))}))}))),Promise.race instanceof Function||(Promise.race=e=>new Promise(((t,r)=>{e.forEach((e=>e.then(t,r)))}))),Promise.try instanceof Function||(Promise.try=e=>new Promise((t=>t(e())))),Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}),Promise.fromEntries instanceof Function||(Promise.fromEntries=async function(e){const t=[],r=[];for(const[n,o]of e)t.push(n),r.push(o);return await Promise.all(r).then((e=>Object.fromEntries(e.map(((e,r)=>[t[r],e])))))}),Promise.ownProperties instanceof Function||(Promise.ownProperties=async function(e){return await Promise.fromEntries(Object.entries(e))}))
8
+ */const M=new Map,L=Symbol("lock-key"),O="locks"in navigator&&navigator.locks.request instanceof Function;const k=async function(){return await new Promise((e=>{"locks"in navigator&&navigator.locks.request instanceof Function?navigator.locks.query().then((()=>e(!0))).catch((()=>e(!1))):e(!1)}))}();async function P(e,t=null){return new Promise(((r,n)=>{S(e)?e.call(globalThis,t).then(r,n):queueMicrotask((()=>{try{const n=e.call(globalThis,t);r(n)}catch(e){n(e)}}))}))}async function F(e){M.has(e)&&await M.get(e).promise.catch(console.error)}function R(e,t,r){const{resolve:n,reject:o,promise:i}=function(){if(Promise.withResolvers instanceof Function)return Promise.withResolvers();{const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}}(),a=new AbortController,s=new x(e,t),l=function({name:e,mode:t}){switch(t){case"exclusive":return I().some((t=>t.name===e));case"shared":return I().some((t=>t.name===e&&"exclusive"===t.mode))}}(s);return M.set(s,{resolve:n,reject:o,promise:i,callback:r,pending:l,controller:a}),s}function j(e){return e instanceof x&&M.has(e)&&M.get(e).pending}function I(e){return"string"==typeof e?[...M.keys()].filter((t=>t.name===e)):[...M.keys()]}function N(e){return I(e).filter((e=>!j(e)))}function C(e){return I(e).filter((e=>j(e)))}async function U(e){switch(e.mode){case"exclusive":await Promise.allSettled(I().filter((t=>t.name===e.name&&t!==e)).map(F));break;case"shared":await Promise.allSettled(I().filter((t=>t.name===e.name&&"exclusive"===t.mode&&t!==e)).map(F))}}function H(e){if(M.has(e))return M.get(e).controller.signal}async function D(e){if(M.has(e)){const{resolve:t,reject:r,promise:n,callback:o,pending:i,controller:a}=M.get(e);return i&&function(e,t=!0){M.has(e)&&M.set(e,{...M.get(e),pending:t})}(e,!1),P(o,e).then(t,r).finally((()=>{M.delete(e),requestIdleCallback((()=>a.abort()))})),n}}class ${constructor(e){if(e!==L)throw new TypeError("Invalid constructor")}static async request(e,...t){let r,n={};t[0]instanceof Function?r=t[0]:t[1]instanceof Function&&([n,r]=t),"string"!=typeof e&&(e=e.toString());const{mode:o="exclusive",ifAvailable:i=!1,steal:a=!1,signal:s}=n;if(a&&i)throw new DOMException("LockManager.request: `steal` and `ifAvailable` cannot be used together");if(e.startsWith("-"))throw new DOMException("LockManager.request: Names starting with `-` are reserved");if(!["exclusive","shared"].includes(o))throw new TypeError(`LockManager.request: '${o}' (value of 'mode' member of LockOptions) is not a valid value for enumeration LockMode.`);if(s instanceof AbortSignal&&s.aborted)throw s.reason;if("shared"===o&&a)throw new DOMException("LockManager.request: `steal` is only supported for exclusive lock requests");const l=N(e),c=C(e),u=[...l,...c].some((t=>t.name===e));a&&u&&function(e){[...M.entries()].filter((([t])=>t.name===e)).forEach((([e,{reject:t,controller:r}])=>{requestIdleCallback((()=>{r.abort(),M.delete(e)})),t(new DOMException("The lock request is aborted"))}))}(e);const p=R(e,o,r);switch(s instanceof AbortSignal&&s.addEventListener("abort",(()=>{if(M.has(p)){const{reject:e,controller:t}=M.get(p);M.delete(p),e(new DOMException("The lock request is aborted")),t.abort()}}),{once:!0,signal:H(p)}),o){case"exclusive":if(!i||0===l.length&&0===c.length)return await U(p),await D(p);{const e=M.get(p).controller;return M.delete(p),await P(r,null).then((t=>(requestIdleCallback((()=>e.abort())),t)))}case"shared":if(i){if([...l,...c].some((e=>"exclusive"===e.mode))){const e=M.get(p).controller;return M.delete(p),await P(r,null).then((t=>(requestIdleCallback((()=>e.abort())),t)))}return await U(p),await D(p)}return await U(p),await D(p);default:throw new TypeError(`LockManager.request: '${o}' (value of 'mode' member of LockOptions) is not a valid value for enumeration LockMode.`)}}static async query(){return{held:N().map((({name:e,mode:t})=>({name:e,mode:t,clientId:null}))),pending:C().map((({name:e,mode:t})=>({name:e,mode:t,clientId:null})))}}}function q(e,t="error"){if(e instanceof Error){const{message:r,name:n,fileName:o,lineNumber:i,columnNumber:a}=e;return new ErrorEvent(t,{error:e,message:`${n}: ${r}`,filename:o,lineno:i,colno:a})}throw new TypeError("`errorToEvent()` only accepts Errors")}let z=!1;if(new Promise((async e=>{if(O)if(await k)e(!1);else try{navigator.locks.request=$.request,navigator.locks.query=$.query,z=!0,e(!0)}catch(t){globalThis.dispatchEvent(q(t)),e(!1)}else try{navigator.locks=$,z=!0,e(!0)}catch(t){globalThis.dispatchEvent(q(t)),e(!1)}})),navigator.canShare instanceof Function||(navigator.canShare=function({title:e,text:t,url:r,files:n}={}){return navigator.share instanceof Function&&(!Array.isArray(n)||0===n.length)&&(!![e,t,r].every((e=>void 0===e))||[e,t,r].some((e=>"string"==typeof e&&0!==e.length)))}),navigator.setAppBadge instanceof Function||(navigator.setAppBadge=async e=>{if(!Number.isInteger(e))throw new TypeError("Failed to execute 'setAppBadge' on 'Navigator': Value is not of type 'unsigned long long'");if(e<0)throw new TypeError("Failed to execute 'setAppBadge' on 'Navigator': Value is outside the 'unsigned long long' value range.");0===e?document.title.startsWith("(")&&(document.title=document.title.replace(/^\((\d{1,2}\+?)\)\s/,"")):e<100?(await navigator.clearAppBadge(),document.title=`(${e}) ${document.title}`):(await navigator.clearAppBadge(),document.title=`(99+) ${document.title}`)}),navigator.clearAppBadge instanceof Function||(navigator.clearAppBadge=()=>navigator.setAppBadge(0)),Navigator.prototype.hasOwnProperty("pdfViewerEnabled")||Object.defineProperty(navigator,"pdfViewerEnabled",{enumerable:!0,configurable:!1,writable:!1,value:!1}),Navigator.prototype.getInstalledRelatedApps instanceof Function||(Navigator.prototype.getInstalledRelatedApps=async()=>[]),Navigator.prototype.getGamepads instanceof Function||(Navigator.prototype.getGamepads=()=>[]),"hardwareConcurrency"in Navigator.prototype||Object.defineProperty(Navigator.prototype,"hardwareConcurrency",{get:()=>1}),"connection"in Navigator.prototype?"type"in navigator.connection||(navigator.connection.type="unknown"):Object.defineProperty(Navigator.prototype,"connection",{get:()=>Object.create(EventTarget.prototype,{type:{value:"unknown"},effectiveType:{value:"4g"},rtt:{value:NaN},downlink:{value:NaN},downlinkMax:{value:1/0},saveData:{value:!1},onchange:{value:null,writable:!0},ontypechange:{value:null,writable:!0}})}),"doNotTrack"in Navigator.prototype||Object.defineProperty(Navigator.prototype,"doNotTrack",{get:()=>"unspecified"}),"globalPrivacyControl"in Navigator.prototype||Object.defineProperty(Navigator.prototype,"globalPrivacyControl",{get:()=>!1}),function(){if(!(globalThis.requestIdleCallback instanceof Function)){const e=e=>Number.isSafeInteger(e)&&e>0;globalThis.requestIdleCallback=function(t,{timeout:r}={}){const n=performance.now(),o=()=>e(r)?Math.max(0,r-(performance.now()-n)):Math.max(0,600-(performance.now()-n));return setTimeout((()=>t({didTimeout:!!e(r)&&0===o(),timeRemaining:o})),1)}}globalThis.cancelIdleCallback instanceof Function||(globalThis.cancelIdleCallback=e=>clearTimeout(e)),globalThis.requestAnimationFrame instanceof Function||(globalThis.requestAnimationFrame=e=>setTimeout((()=>e(performance.now())),1e3/60)),globalThis.cancelAnimationFrame instanceof Function||(globalThis.cancelAnimationFrame=e=>clearTimeout(e)),globalThis.queueMicrotask instanceof Function||(globalThis.queueMicrotask=e=>Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e})))))}(),!("AbortSignal"in globalThis)){const Ke={signal:Symbol("signal"),aborted:Symbol("aborted"),reason:Symbol("reason"),onabort:Symbol("onabort")};globalThis.AbortError=class extends Error{},globalThis.AbortSignal=class e extends EventTarget{constructor(){super(),Object.defineProperties(this,{[Ke.aborted]:{enumerable:!1,writable:!0,configurable:!1,value:!1},[Ke.reason]:{enumerable:!1,writable:!0,configurable:!1,value:void 0},[Ke.onabort]:{enumerable:!1,writable:!0,configurable:!1,value:null}}),this.addEventListener("abort",(e=>{this.onabort instanceof Function&&this.onabort.call(this,e)}))}get aborted(){return this[Ke.aborted]}get onabort(){return this[Ke.onabort]}set onabort(e){this[Ke.onabort]=e instanceof Function?e:null}get reason(){return this[Ke.reason]}throwIfAborted(){if(this.aborted)throw this.reason}static abort(t=new DOMException("Operation aborted")){const r=new e;return r[Ke.aborted]=!0,r[Ke.reason]=t,r}},globalThis.AbortController=class{constructor(){this[Ke.signal]=new AbortSignal}get signal(){return this[Ke.signal]}abort(e=new DOMException("Operation aborted")){const t=this.signal;t.aborted||(t[Ke.aborted]=!0,t[Ke.reason]=e,t.dispatchEvent(new Event("abort")))}}}if(!("reason"in AbortSignal.prototype)){const Qe=new WeakMap,Je=AbortController.prototype.abort;if(AbortSignal.abort instanceof Function){const Ye=AbortSignal.abort;AbortSignal.abort=function(e=new DOMException("Operation aborted")){const t=Ye();return Qe.set(t,e),t}}else AbortSignal.abort=function(e=new DOMException("Operation aborted")){const t=new AbortController;return t.abort(e),t.reason};Object.defineProperty(AbortSignal.prototype,"reason",{enumerable:!0,configurable:!0,get:function(){return Qe.has(this)?Qe.get(this):void 0}}),AbortController.prototype.abort=function(e=new DOMException("Operation aborted")){Qe.set(this.signal,e),Je.call(this)}}if(AbortSignal.prototype.throwIfAborted instanceof Function||(AbortSignal.prototype.throwIfAborted=function(){if(this.aborted)throw this.reason}),AbortSignal.timeout instanceof Function||(AbortSignal.timeout=function(e){if(void 0===e)throw new TypeError("At least one 1 argument required but only 0 passed");if(Number.isFinite(e)){if(e<0)throw new TypeError("Argument 1 is out of range for unsigned long long.");{const t=new AbortController;return setTimeout((()=>t.abort(new DOMException("The operation timed out."))),e),t.signal}}throw new TypeError("Argument 1 is not a finite value, so it is out of range for unsigned long long.")}),AbortSignal.any instanceof Function||(AbortSignal.any=function(e){if(!Array.isArray(e))throw new TypeError("Expected an array of signals");const t=new AbortController;for(const r of e){if(!(r instanceof AbortSignal)){const e=new TypeError("`signal` is not an `AbortSignal`");throw t.abort(e),e}if(r.aborted){t.abort(r.reason||new DOMException("Operation aborted."));break}r.addEventListener("abort",(({target:e})=>{t.abort(e.reason||new DOMException("Operation aborted."))}),{signal:t.signal})}return t.signal}),globalThis.hasOwnProperty("AggregateError")||(globalThis.AggregateError=class extends Error{constructor(e,t){void 0===t?(super(e),this.errors=[]):(super(t),this.errors=e)}}),globalThis.reportError instanceof Function||(globalThis.reportError=function(e){globalThis.dispatchEvent(q(e))}),!(Error.isError instanceof Function)){const Ze=Function.bind.call(Function.call,Object.prototype.toString);Error.isError=function(e){return e instanceof Error||"object"==typeof e&&"[object Error]"===Ze(e)&&void 0===e[Symbol.toStringTag]}}!function(){if("MediaQueryListEvent"in globalThis||(globalThis.MediaQueryListEvent=class extends Event{constructor(e,{media:t,matches:r}={}){super(e),Object.defineProperties(this,{media:{enumerable:!0,configurable:!1,writable:!1,value:t},matches:{enumerable:!0,configurable:!1,writable:!1,value:r}})}}),"MediaQueryList"in globalThis&&!(globalThis.MediaQueryList.prototype.addEventListener instanceof Function)){const e=new WeakMap,t=function(){const{media:e,matches:t}=this;this.dispatchEvent(new MediaQueryListEvent("change",{media:e,matches:t}))},r=function(r){return e.has(r)||(e.set(r,new EventTarget),r.addListener(t.bind(r))),e.get(r)};globalThis.MediaQueryList.prototype.addEventListener=function(e,t,n){r(this).addEventListener(e,t,n)},globalThis.MediaQueryList.prototype.removeEventListener=function(e,t,n){r(this).removeEventListener(e,t,n)},globalThis.MediaQueryList.prototype.dispatchEvent=function(e){r(this).dispatchEvent(e)}}}(),"Promise"in globalThis&&(Promise.prototype.finally instanceof Function||(Promise.prototype.finally=function(e){return this.then((async t=>(await e(),t)),(async t=>(await e(),t)))}),Promise.allSettled instanceof Function||(Promise.allSettled=function(e){return Promise.all(Array.from(e).map((function(e){return new Promise((function(t){e instanceof Promise||(e=Promise.resolve(e)),e.then((function(e){t({status:"fulfilled",value:e})})).catch((function(e){t({status:"rejected",reason:e})}))}))})))}),Promise.any instanceof Function||(Promise.any=e=>new Promise(((t,r)=>{let n=[];e.forEach((o=>{o.then(t).catch((t=>{n.push(t),n.length===e.length&&r(new globalThis.AggregateError(n,"No Promise in Promise.any was resolved"))}))}))}))),Promise.race instanceof Function||(Promise.race=e=>new Promise(((t,r)=>{e.forEach((e=>e.then(t,r)))}))),Promise.try instanceof Function||(Promise.try=e=>new Promise((t=>t(e())))),Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}),Promise.fromEntries instanceof Function||(Promise.fromEntries=async function(e){const t=[],r=[];for(const[n,o]of e)t.push(n),r.push(o);return await Promise.all(r).then((e=>Object.fromEntries(e.map(((e,r)=>[t[r],e])))))}),Promise.ownProperties instanceof Function||(Promise.ownProperties=async function(e){return await Promise.fromEntries(Object.entries(e))}))
9
9
  /**
10
10
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
11
- */;class Ae{get encoding(){return"utf-8"}encode(e){return new Uint8Array(e.split("").flatMap((e=>{const t=e.charCodeAt(0);if(t<128)return[t];return[194+Math.floor((t-128)/64),t%64+128]})))}encodeInto(e,t){if(t instanceof Uint8Array){const r=this.encode(e),n=Math.min(t.length,r.length);return r.length>t.length?t.set(r.slice(0,n)):t.set(r),{read:n,written:n}}throw new TypeError("TextEncoder.encodeInto: Argument 2 does not implement interface Uint8Array.")}}
11
+ */;class B{get encoding(){return"utf-8"}encode(e){return new Uint8Array(e.split("").flatMap((e=>{const t=e.charCodeAt(0);if(t<128)return[t];return[194+Math.floor((t-128)/64),t%64+128]})))}encodeInto(e,t){if(t instanceof Uint8Array){const r=this.encode(e),n=Math.min(t.length,r.length);return r.length>t.length?t.set(r.slice(0,n)):t.set(r),{read:n,written:n}}throw new TypeError("TextEncoder.encodeInto: Argument 2 does not implement interface Uint8Array.")}}
12
12
  /**
13
13
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
14
- */const xe=["utf-8","utf8"];class Me{constructor(e="utf-8",{fatal:t=!1,ignoreBOM:r=!1}={}){if(e="string"!=typeof e?e.toString().toLowerCase():e.toLowerCase(),!xe.includes(e))throw new RangeError(`TextDecoder constructor: The given encoding '${e}' is not supported.`);Object.defineProperties(this,{encoding:{configurable:!1,enumerable:!0,writable:!1,value:e},fatal:{configurable:!1,enumerable:!0,writable:!1,value:t},ignoreBOM:{configurable:!1,enumerable:!0,writable:!1,value:r}})}decode(e){switch(this.encoding){case"utf-8":case"utf8":{let t=NaN;return e.reduce(((e,r,n)=>{if(Number.isNaN(t)&&r<128)return e+String.fromCharCode(r);if(Number.isNaN(t)&&r>193)return t=r,e;if(t>193&&(o=128,a=194,"number"==typeof(i=r)&&i>=o&&i<=a)){const n=64*(t-194);return t=NaN,e+String.fromCharCode(n+r)}if(this.fatal)throw new RangeError(`Unhandled character at postion ${n}`);return t=NaN,e;var o,i,a}),"")}default:throw new TypeError(`Unsupported encoding '${this.encoding}'`)}}}"TextEncoder"in globalThis||(globalThis.TextEncoder=Ae),"TextDecoder"in globalThis||(globalThis.TextDecoder=Me),globalThis.TextEncoder.prototype.encodeInto instanceof Function||(globalThis.TextEncoder.prototype.encodeInto=function(...e){return Ae.prototype.encodeInto.apply(this,e)}),!(crypto in globalThis)||crypto.randomUUID instanceof Function||(crypto.randomUUID=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))})
14
+ */const _=["utf-8","utf8"];class V{constructor(e="utf-8",{fatal:t=!1,ignoreBOM:r=!1}={}){if(e="string"!=typeof e?e.toString().toLowerCase():e.toLowerCase(),!_.includes(e))throw new RangeError(`TextDecoder constructor: The given encoding '${e}' is not supported.`);Object.defineProperties(this,{encoding:{configurable:!1,enumerable:!0,writable:!1,value:e},fatal:{configurable:!1,enumerable:!0,writable:!1,value:t},ignoreBOM:{configurable:!1,enumerable:!0,writable:!1,value:r}})}decode(e){switch(this.encoding){case"utf-8":case"utf8":{let t=NaN;return e.reduce(((e,r,n)=>{if(Number.isNaN(t)&&r<128)return e+String.fromCharCode(r);if(Number.isNaN(t)&&r>193)return t=r,e;if(t>193&&(o=128,a=194,"number"==typeof(i=r)&&i>=o&&i<=a)){const n=64*(t-194);return t=NaN,e+String.fromCharCode(n+r)}if(this.fatal)throw new RangeError(`Unhandled character at postion ${n}`);return t=NaN,e;var o,i,a}),"")}default:throw new TypeError(`Unsupported encoding '${this.encoding}'`)}}}"TextEncoder"in globalThis||(globalThis.TextEncoder=B),"TextDecoder"in globalThis||(globalThis.TextDecoder=V),globalThis.TextEncoder.prototype.encodeInto instanceof Function||(globalThis.TextEncoder.prototype.encodeInto=function(...e){return B.prototype.encodeInto.apply(this,e)}),!(crypto in globalThis)||crypto.randomUUID instanceof Function||(crypto.randomUUID=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))})
15
15
  /**
16
16
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
17
17
  * @SEE https://wicg.github.io/cookie-store/
@@ -20,21 +20,21 @@
20
20
  * cookie properties, such as expires, etc.
21
21
  *
22
22
  * @TODO verify spec compliance as best as is possible
23
- */;const Le="cookieStore"in globalThis,Oe={constructor:Symbol("constructor")};function Pe(){return 0===document.cookie.length?[]:document.cookie.split(";").map((e=>{const[t,r=null]=e.split("=");return{name:decodeURIComponent(t.trim()),value:"string"==typeof r?decodeURIComponent(r.trim()):null,path:void 0,expires:void 0,domain:void 0,sameSite:void 0,secure:void 0,partitioned:!1}}))}function ke({name:e=null,value:t=null}={}){return"string"==typeof e&&(e=decodeURIComponent(e)),"string"==typeof t&&(t=decodeURIComponent(t)),"string"==typeof e&&"string"==typeof t?Pe().filter((r=>r.name===e&&r.value===t)):"string"==typeof e?Pe().filter((t=>t.name===e)):"string"==typeof t?Pe().filter((e=>e.value===t)):Pe()}function Fe({name:e,value:t,expires:r=null,maxAge:n=null,path:o="/",sameSite:i="lax",domain:a=null,secure:s=!1,partitioned:l=!1}){if(Number.isInteger(n))Fe({name:e,value:t,expires:Date.now()+n,path:o,sameSite:i,domain:a,secure:s,partitioned:l});else{let n=`${encodeURIComponent(e)}=`;t&&(n+=encodeURIComponent(t)),Number.isInteger(r)?n+=`;expires=${new Date(r).toUTCString()}`:r instanceof Date&&(n+=`;expires=${r.toUTCString()}`),"string"==typeof o&&(n+=`;path=${o}`),"string"==typeof a&&(n+=`;domain=${a}`),"string"==typeof i&&(n+=`;sameSite=${i}`),!0===s&&(n+=";secure"),!0===l&&(n+=";partitioned"),document.cookie=n}}class Re extends EventTarget{constructor(e){if(e!==Oe.constructor)throw new DOMException("Invalid constructor");super(),Object.defineProperty(this,Oe.onchange,{enumerable:!1,configurable:!1,writable:!0,value:null})}get onchange(){return this[Oe.onchange]}set onchange(e){this[Oe.onchange]instanceof Function&&this.removeEventListener("change",this[Oe.onchange]),e instanceof Function&&this.addEventListener("change",e)}async get(e){const t=await this.getAll(e);return Array.isArray(t)&&0!==t.length?t[0]:null}async getAll(e){return ke("string"==typeof e?{name:e}:e)}async set(...e){if(1===e.length&&"object"==typeof e[0]&&"string"==typeof e[0].name){const t=function({name:e,value:t=null,domain:r=null,path:n="/",expires:o=null,maxAge:i=null,sameSite:a="lax",secure:s=!1,partitioned:l=!1}){return{name:e,value:t,domain:r,path:n,expires:o,maxAge:i,sameSite:a,secure:s,partitioned:l}}(e[0]);Fe(t);const r=new Event("change");r.changed=[t],r.deleted=[],this.dispatchEvent(r)}else{if(2!==e.length)throw new Error("Invalid arguments");this.set({name:e[0],value:e[1]})}}async delete(e={}){if("string"==typeof e)this.delete({name:e});else{if("object"!=typeof e||"string"!=typeof e.name)throw new TypeError("Failed to execute 'delete' on 'CookieStore': required member name is undefined.");{const t=await this.getAll(e);if(0!==t.length){const r=new Event("change");r.changed=[],r.deleted=new Array(t.length),t.forEach(((t,n)=>{t.path=e.path||"/",t.domain=e.domain||null,t.secure=e.secure||null,delete t.value,t.sameSite=e.sameSite||"lax",r.deleted[n]=t,Fe({...t,value:null,expires:1})})),this.dispatchEvent(r)}}}}}const je=new Re(Oe.constructor);if(!Le&&(globalThis.cookieStore=je),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("finished")&&Object.defineProperty(Animation.prototype,"finished",{get:function(){return new Promise(((e,t)=>{"finished"===this.playState?e(this):(this.addEventListener("finish",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0}))}))}}),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("ready")&&Object.defineProperty(Animation.prototype,"ready",{get:function(){return new Promise(((e,t)=>{this.pending?(this.addEventListener("ready",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0})):e(this)}))}}),"HTMLElement"in globalThis&&!("trustedTypes"in globalThis)){const Ot={key:Symbol("trust:key")},Pt=new Set(Object.keys(HTMLElement.prototype).filter((e=>e.startsWith("on")))),kt=()=>{const e=document.head.querySelector('meta[http-equiv="Content-Security-Policy"][content]');if(e instanceof HTMLMetaElement){const t=e.content.trim().split(";").filter((e=>0!==e.length)).map((e=>e.trim())),r=Object.fromEntries(t.map((e=>{const[t,...r]=e.trim().split(" ").filter((e=>0!==e.length));return[t,r]}))),n=Array.isArray(r["require-trusted-types-for"])&&r["require-trusted-types-for"].includes("'script'"),o=n&&Array.isArray(r["trusted-types"])?new Set(r["trusted-types"]):new Set,i=o.has("'allow-duplicates'");return o.has("'none'")?o.clear():i&&o.delete("'allow-duplicates'"),{enforced:n,allowedPolicies:o,allowDuplicates:i}}if(document.documentElement.dataset.hasOwnProperty("trustedPolicies")){const e=new Set(document.documentElement.dataset.trustedPolicies.split(" ")),t=e.has("'allow-duplicates'"),r=e.has("'none'");return t&&e.delete("'allow-duplicates'"),r&&e.clear(),{enforced:!0,allowedPolicies:e,allowDuplicates:t}}return{enforced:!1,allowedPolicies:new Set,allowDuplicates:!0}};class Ft{#k;#F;#R;#j;constructor({enforced:e,allowedPolicies:t,allowDuplicates:r}={},n){if(n!==Ot.key)throw new TypeError("Invalid constructor of TrustedTypePolicyFactory.");if(!(t instanceof Set))throw new TypeError("`allowedPolicies` must be a Set.");this.#F=t,this.#R=e,this.#j=r,this.#k=new Map}get defaultPolicy(){return this.#k.has("default")?this.#k.get("default"):null}createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}){if(/^[-#a-zA-Z0-9=_/@.%]+$/.test(e.toString())){if(this.#R&&!this.#F.has(e))throw new TypeError(`${e} is not an allowed policy.`);if(!this.#j&&this.#k.has(e))throw new TypeError(`${e} has already been created and duplicates are not allowed.`);{const o=new Rt(e.toString(),{createHTML:t,createScript:r,createScriptURL:n},Ot.key);return this.#k.set(o.name,o),o}}throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" contains invalid characters.`)}getAttributeType(e,t,r){if(e=e.toLowerCase(),t=t.toLowerCase(),"string"==typeof elementNS&&0!==r.length)return Pt.has(t)?"TrustedScript":null;if(Pt.has(t))return"TrustedScript";switch(e){case"script":return"src"===t?"TrustedScriptURL":null;case"iframe":return"srcdoc"===t?"TrustedHTML":"src"===t?"TrustedScriptURL":null;default:return null}}getPropertyType(e,t){if(e=e.toLowerCase(),Pt.has(t.toLowerCase()))return"TrustedScript";switch(e){case"embed":case"iframe":return"src"===t?"TrustedScriptURL":null;case"script":return"src"===t?"TrustedScriptURL":["text","innerText","textContent","innerHTML"].includes(t)?"TrustedScript":["outerHTML"].includes(t)?"TrustedHTML":null;default:return["innerHTML","outerHTML"].includes(t)?"TrustedHTML":null}}isHTML(e){return e instanceof globalThis.TrustedHTML}isScript(e){return e instanceof globalThis.TrustedScript}isScriptURL(e){return e instanceof globalThis.TrustedScriptURL}get emptyHTML(){return new It("",Ot.key)}get emptyScript(){return new Nt("",Ot.key)}get[Symbol.for("polyfilled")](){return!0}get[Symbol.for("enforced")](){return this.#R}}class Rt{#I;#N;#C;#H;#k;constructor(e,{createHTML:t,createScript:r,createScriptURL:n},o){if(o!==Ot.key)throw new Error(`Invalid construction of ${e} policy.`);this.#I=e,this.#N=t,this.#C=r,this.#H=n}get name(){return this.#I}createHTML(e,...t){if(this.#N instanceof Function)return new It(this.#N(e.toString(),...t).toString(),Ot.key);throw new TypeError("This policy does not provide `createHTML()`")}createScript(e,...t){if(this.#C instanceof Function)return new Nt(this.#C(e.toString(),...t).toString(),Ot.key);throw new TypeError("This policy does not provide `createScript()`")}createScriptURL(e,...t){if(this.#H instanceof Function)return new Ct(this.#H(e.toString(),...t).toString(),Ot.key);throw new TypeError("This policy does not provide `createScriptURL()`")}}class jt{#U;constructor(e,t){if(t!==Ot.key)throw new Error("Invalid constructor of TrustedType.");this.#U=e}toString(){return this.#U}toJSON(){return this.#U}}class It extends jt{}class Nt extends jt{}class Ct extends jt{}globalThis.TrustedTypePolicyFactory=Ft,globalThis.trustedTypes=new Ft(kt(),Ot.key),globalThis.TrustedHTML=It,globalThis.TrustedScript=Nt,globalThis.TrustedScriptURL=Ct}
23
+ */;const W="cookieStore"in globalThis,G={constructor:Symbol("constructor")};function X(){return 0===document.cookie.length?[]:document.cookie.split(";").map((e=>{const[t,r=null]=e.split("=");return{name:decodeURIComponent(t.trim()),value:"string"==typeof r?decodeURIComponent(r.trim()):null,path:void 0,expires:void 0,domain:void 0,sameSite:void 0,secure:void 0,partitioned:!1}}))}function K({name:e=null,value:t=null}={}){return"string"==typeof e&&(e=decodeURIComponent(e)),"string"==typeof t&&(t=decodeURIComponent(t)),"string"==typeof e&&"string"==typeof t?X().filter((r=>r.name===e&&r.value===t)):"string"==typeof e?X().filter((t=>t.name===e)):"string"==typeof t?X().filter((e=>e.value===t)):X()}function Q({name:e,value:t,expires:r=null,maxAge:n=null,path:o="/",sameSite:i="lax",domain:a=null,secure:s=!1,partitioned:l=!1}){if(Number.isInteger(n))Q({name:e,value:t,expires:Date.now()+n,path:o,sameSite:i,domain:a,secure:s,partitioned:l});else{let n=`${encodeURIComponent(e)}=`;t&&(n+=encodeURIComponent(t)),Number.isInteger(r)?n+=`;expires=${new Date(r).toUTCString()}`:r instanceof Date&&(n+=`;expires=${r.toUTCString()}`),"string"==typeof o&&(n+=`;path=${o}`),"string"==typeof a&&(n+=`;domain=${a}`),"string"==typeof i&&(n+=`;sameSite=${i}`),!0===s&&(n+=";secure"),!0===l&&(n+=";partitioned"),document.cookie=n}}class J extends EventTarget{constructor(e){if(e!==G.constructor)throw new DOMException("Invalid constructor");super(),Object.defineProperty(this,G.onchange,{enumerable:!1,configurable:!1,writable:!0,value:null})}get onchange(){return this[G.onchange]}set onchange(e){this[G.onchange]instanceof Function&&this.removeEventListener("change",this[G.onchange]),e instanceof Function&&this.addEventListener("change",e)}async get(e){const t=await this.getAll(e);return Array.isArray(t)&&0!==t.length?t[0]:null}async getAll(e){return K("string"==typeof e?{name:e}:e)}async set(...e){if(1===e.length&&"object"==typeof e[0]&&"string"==typeof e[0].name){const t=function({name:e,value:t=null,domain:r=null,path:n="/",expires:o=null,maxAge:i=null,sameSite:a="lax",secure:s=!1,partitioned:l=!1}){return{name:e,value:t,domain:r,path:n,expires:o,maxAge:i,sameSite:a,secure:s,partitioned:l}}(e[0]);Q(t);const r=new Event("change");r.changed=[t],r.deleted=[],this.dispatchEvent(r)}else{if(2!==e.length)throw new Error("Invalid arguments");this.set({name:e[0],value:e[1]})}}async delete(e={}){if("string"==typeof e)this.delete({name:e});else{if("object"!=typeof e||"string"!=typeof e.name)throw new TypeError("Failed to execute 'delete' on 'CookieStore': required member name is undefined.");{const t=await this.getAll(e);if(0!==t.length){const r=new Event("change");r.changed=[],r.deleted=new Array(t.length),t.forEach(((t,n)=>{t.path=e.path||"/",t.domain=e.domain||null,t.secure=e.secure||null,delete t.value,t.sameSite=e.sameSite||"lax",r.deleted[n]=t,Q({...t,value:null,expires:1})})),this.dispatchEvent(r)}}}}}const Y=new J(G.constructor);if(!W&&(globalThis.cookieStore=Y),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("finished")&&Object.defineProperty(Animation.prototype,"finished",{get:function(){return new Promise(((e,t)=>{"finished"===this.playState?e(this):(this.addEventListener("finish",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0}))}))}}),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("ready")&&Object.defineProperty(Animation.prototype,"ready",{get:function(){return new Promise(((e,t)=>{this.pending?(this.addEventListener("ready",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0})):e(this)}))}}),"HTMLElement"in globalThis&&!("trustedTypes"in globalThis)){const et={key:Symbol("trust:key")},tt=new Set(Object.keys(HTMLElement.prototype).filter((e=>e.startsWith("on")))),rt=()=>{const e=document.head.querySelector('meta[http-equiv="Content-Security-Policy"][content]');if(e instanceof HTMLMetaElement){const t=e.content.trim().split(";").filter((e=>0!==e.length)).map((e=>e.trim())),r=Object.fromEntries(t.map((e=>{const[t,...r]=e.trim().split(" ").filter((e=>0!==e.length));return[t,r]}))),n=Array.isArray(r["require-trusted-types-for"])&&r["require-trusted-types-for"].includes("'script'"),o=n&&Array.isArray(r["trusted-types"])?new Set(r["trusted-types"]):new Set,i=o.has("'allow-duplicates'");return o.has("'none'")?o.clear():i&&o.delete("'allow-duplicates'"),{enforced:n,allowedPolicies:o,allowDuplicates:i}}if(document.documentElement.dataset.hasOwnProperty("trustedPolicies")){const e=new Set(document.documentElement.dataset.trustedPolicies.split(" ")),t=e.has("'allow-duplicates'"),r=e.has("'none'");return t&&e.delete("'allow-duplicates'"),r&&e.clear(),{enforced:!0,allowedPolicies:e,allowDuplicates:t}}return{enforced:!1,allowedPolicies:new Set,allowDuplicates:!0}};class nt{#P;#F;#R;#j;constructor({enforced:e,allowedPolicies:t,allowDuplicates:r}={},n){if(n!==et.key)throw new TypeError("Invalid constructor of TrustedTypePolicyFactory.");if(!(t instanceof Set))throw new TypeError("`allowedPolicies` must be a Set.");this.#F=t,this.#R=e,this.#j=r,this.#P=new Map}get defaultPolicy(){return this.#P.has("default")?this.#P.get("default"):null}createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}){if(/^[-#a-zA-Z0-9=_/@.%]+$/.test(e.toString())){if(this.#R&&!this.#F.has(e))throw new TypeError(`${e} is not an allowed policy.`);if(!this.#j&&this.#P.has(e))throw new TypeError(`${e} has already been created and duplicates are not allowed.`);{const o=new ot(e.toString(),{createHTML:t,createScript:r,createScriptURL:n},et.key);return this.#P.set(o.name,o),o}}throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" contains invalid characters.`)}getAttributeType(e,t,r){if(e=e.toLowerCase(),t=t.toLowerCase(),"string"==typeof elementNS&&0!==r.length)return tt.has(t)?"TrustedScript":null;if(tt.has(t))return"TrustedScript";switch(e){case"script":return"src"===t?"TrustedScriptURL":null;case"iframe":return"srcdoc"===t?"TrustedHTML":"src"===t?"TrustedScriptURL":null;default:return null}}getPropertyType(e,t){if(e=e.toLowerCase(),tt.has(t.toLowerCase()))return"TrustedScript";switch(e){case"embed":case"iframe":return"src"===t?"TrustedScriptURL":null;case"script":return"src"===t?"TrustedScriptURL":["text","innerText","textContent","innerHTML"].includes(t)?"TrustedScript":["outerHTML"].includes(t)?"TrustedHTML":null;default:return["innerHTML","outerHTML"].includes(t)?"TrustedHTML":null}}isHTML(e){return e instanceof globalThis.TrustedHTML}isScript(e){return e instanceof globalThis.TrustedScript}isScriptURL(e){return e instanceof globalThis.TrustedScriptURL}get emptyHTML(){return new at("",et.key)}get emptyScript(){return new st("",et.key)}get[Symbol.for("polyfilled")](){return!0}get[Symbol.for("enforced")](){return this.#R}}class ot{#I;#N;#C;#U;constructor(e,{createHTML:t,createScript:r,createScriptURL:n},o){if(o!==et.key)throw new Error(`Invalid construction of ${e} policy.`);this.#I=e,this.#N=t,this.#C=r,this.#U=n}get name(){return this.#I}createHTML(e,...t){if(this.#N instanceof Function)return new at(this.#N(e.toString(),...t).toString(),et.key);throw new TypeError("This policy does not provide `createHTML()`")}createScript(e,...t){if(this.#C instanceof Function)return new st(this.#C(e.toString(),...t).toString(),et.key);throw new TypeError("This policy does not provide `createScript()`")}createScriptURL(e,...t){if(this.#U instanceof Function)return new lt(this.#U(e.toString(),...t).toString(),et.key);throw new TypeError("This policy does not provide `createScriptURL()`")}}class it{#H;constructor(e,t){if(t!==et.key)throw new Error("Invalid constructor of TrustedType.");this.#H=e}toString(){return this.#H}toJSON(){return this.#H}}class at extends it{}class st extends it{}class lt extends it{}globalThis.TrustedTypePolicyFactory=nt,globalThis.trustedTypes=new nt(rt(),et.key),globalThis.TrustedHTML=at,globalThis.TrustedScript=st,globalThis.TrustedScriptURL=lt}
24
24
  /**
25
25
  * @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
26
- */("HTMLElement"in globalThis&&!("trustedTypes"in globalThis)||"HTMLElement"in globalThis&&globalThis.trustedTypes[Symbol.for("polyfilled")]&&globalThis.trustedTypes[Symbol.for("enforced")])&&function(){function e(){return"trustedTypes"in globalThis}function t(){return e()&&!Object.is(trustedTypes.defaultPolicy,null)}function r(r){if(function(t){return e()&&trustedTypes.isHTML(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createHTML(r);throw new TypeError("Attempting to set HTML and no default policy is available.")}function n(r){if(function(t){return e()&&trustedTypes.isScript(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScript(r);throw new TypeError("Attempting to create script and no default policy is available.")}function o(r){if(function(t){return e()&&trustedTypes.isScriptURL(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScriptURL(r);throw new TypeError("Attempting to create script URL and no default policy is available.")}function i(t,r,n){return e()?trustedTypes.getAttributeType(t,r,n):null}try{const{write:e,writeln:t,execCommand:n}=Object.getOwnPropertyDescriptors(Document.prototype);Object.defineProperties(Document.prototype,{write:{value:function(t){e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable},writeln:{value:function(e){t.value.call(this,r(e))},enumerable:t.enumerable,configurable:t.configurable,writable:t.writable},execCommand:{value:function(e,t,o){return["insertHTML"].includes(e)?n.value.call(this,e,t,r(o)):n.value.call(this,e,t,o)},enumerable:n.enumerable,configurable:n.configurable}})}catch(e){console.error(e)}if("ServiceWorkerContainer"in globalThis)try{const e=Object.getOwnPropertyDescriptor(ServiceWorkerContainer.prototype,"register");Object.defineProperty(ServiceWorkerContainer.prototype,"register",{value:function(t,r){return e.value.call(this,o(t),r)},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const e=Object.getOwnPropertyDescriptor(Range.prototype,"createContextualFragment");Object.defineProperty(Range.prototype,"createContextualFragment",{value:function(t){return e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const{parseFromString:e}=Object.getOwnPropertyDescriptors(DOMParser.prototype);Object.defineProperties(DOMParser.prototype,{parseFromString:{value:function(t,n){return"text/html"===n?e.value.call(this,r(t),n):e.value.call(this,t,n)},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable}})}catch(e){console.error(e)}try{const{src:e,text:t}=Object.getOwnPropertyDescriptors(HTMLScriptElement.prototype);Object.defineProperties(HTMLScriptElement.prototype,{text:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,n(e))},enumerable:t.enumerable,configurable:t.configurable},src:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable}})}catch(e){console.error(e)}try{const{setAttribute:e,setAttributeNS:t,innerHTML:a,outerHTML:s,insertAdjacentHTML:l}=Object.getOwnPropertyDescriptors(Element.prototype);Object.defineProperties(Element.prototype,{setAttribute:{value:function(t,a){switch(i(this.tagName,t)){case"TrustedHTML":e.value.call(this,t,r(a));break;case"TrustedScript":e.value.call(this,t,n(a));break;case"TrustedScriptURL":e.value.call(this,t,o(a));break;default:e.value.call(this,t,a)}},enumerable:e.enumerable,configurable:e.configurable},setAttributeNS:{value:function(e,a,s){switch(i(this.tagName,a,e)){case"TrustedHTML":t.value.call(this,e,a,r(s));break;case"TrustedScript":t.value.call(this,e,a,n(s));break;case"TrustedScriptURL":t.value.call(this,e,a,o(s));break;default:t.value.call(this,e,a,s)}},enumerable:t.enumerable,configurable:t.configurable},innerHTML:{get:function(){return a.get.call(this)},set:function(e){a.set.call(this,r(e))},enumerable:a.enumerable,configurable:a.configurable},outerHTML:{get:function(){return s.get.call(this)},set:function(e){s.set.call(this,r(e))},enumerable:s.enumerable,configurable:s.configurable},insertAdjacentHTML:{value:function(e,t){l.value.call(this,e,r(t))},enumerable:l.enumerable,configurable:l.configurable}})}catch(e){console.error(e)}try{const{srcdoc:e,src:t}=Object.getOwnPropertyDescriptors(HTMLIFrameElement.prototype);Object.defineProperties(HTMLIFrameElement.prototype,{srcdoc:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable},src:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{data:e,codeBase:t}=Object.getOwnPropertyDescriptors(HTMLObjectElement.prototype);Object.defineProperties(HTMLObjectElement.prototype,{data:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable},codeBase:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{eval:e,setTimeout:t,setInterval:r}=globalThis;globalThis.eval=function(t){return e(n(t).toString())},globalThis.setTimeout=function(e,r,...o){return"string"==typeof e?t(n(e),r,...o):t(e,r,...o)},globalThis.setInterval=function(e,t,...o){return"string"==typeof e?r(n(e),t,...o):r(e,t,...o)};try{const e=globalThis.Function;globalThis.Function=function(...t){if(0===t.length)return e();{const r=n(t.pop());return e(...t,r.toString())}},globalThis.Function.prototype=e.prototype,e.prototype.constructor=globalThis.Function}catch(e){console.error(e)}}catch(e){console.error(e)}}();const Ie={get(){return Array.from(this.styleSheets).filter((e=>e.ownerNode.classList.contains("_adopted")))},set(e){if(!Array.isArray(e))throw new TypeError("Must be an array");{const t=new Set(this.adoptedStyleSheets);t.difference(e).forEach((e=>e.ownerNode.remove()));const r=[...new Set(e).difference(t)].map((e=>{const t=document.createElement("link"),r=new AbortController,n=r.signal,o=URL.createObjectURL(new File([],"adopted.css",{type:"text/css"}));return t.rel="stylesheet",t.href=o,t.classList.add("_adopted"),t.disabled=e.disabled,t.addEventListener("load",(({target:n})=>{r.abort(),t.media=e.media.mediaText,[...e.cssRules].forEach(((e,t)=>{n.sheet.insertRule(e.cssText,t)})),setTimeout((()=>URL.revokeObjectURL(n.href)),100)}),{once:!0,signal:n}),t.addEventListener("error",(({target:e})=>{r.abort(),URL.revokeObjectURL(e.href)}),{once:!0,signal:n}),t}));this instanceof Document?this.head.append(...r):this.append(...r)}}};function Ne(e){if(e instanceof HTMLTemplateElement&&e.parentElement instanceof HTMLElement){e.parentElement.attachShadow({mode:e.getAttribute("shadowrootmode"),clonable:e.hasAttribute("shadowrootclonable"),delegatesFocus:e.hasAttribute("shadowrootdelegatesfocus"),serializable:e.hasAttribute("shadowrootserializable")}).append(e.content),e.remove()}}function Ce(e){const t=(new DOMParser).parseFromString(e,"text/html"),r=document.createDocumentFragment();r.append(...t.body.childNodes),Ne(r.querySelector("template[shadowroootmode]")),this.replaceChildren(r)}function He(e){for(;e.cssRules.length>0;)e.deleteRule(0)}i(Document.prototype,"adoptedStyleSheets",Ie),o(Document,"parseHTMLUnsafe",(function(e){const t=new DOMParser,r=document.implementation.createHTMLDocument(),n=t.parseFromString(e,"text/html");return r.head.append(...n.head.childNodes),r.body.append(...n.body.childNodes),r.querySelectorAll("template[shadowrootmode]").forEach(Ne),r})),"ShadowRoot"in globalThis&&(i(ShadowRoot.prototype,"adoptedStyleSheets",Ie),o(ShadowRoot.prototype,"setHTMLUnsafe",Ce),o(ShadowRoot.prototype,"getHTML",(function({shadowRoots:e,serializableShadowRoots:t=!1}={}){return this.cloneNode(!0).innerHTML})));try{new CSSStyleSheet}catch{const Ht=globalThis.CSSStyleSheet;globalThis.CSSStyleSheet=function({disabled:e=!1,media:t}={}){const r=function(e="",{disabled:t=!1,media:r}={}){const n=Document.parseHTML(`<style>${e}</style>`,{sanitizer:{allowElements:["style","html","head","body"]}}).styleSheets.item(0);return"string"==typeof r&&n.media.appendMedium(r),n.disabled=t,n}("#dfgbkjdfg{color:red;}",{disabled:e,media:t});return r.deleteRule(0),r},globalThis.CSSStyleSheet.prototype=Ht.prototype,Ht.prototype.constructor=globalThis.CSSStyleSheet}CSSStyleSheet.prototype.replace instanceof Function||(CSSStyleSheet.prototype.replace=function(e){const t=document.createElement("link"),r=new AbortController,{resolve:n,reject:o,promise:i}=Promise.withResolvers();return t.addEventListener("load",(({target:e})=>{He(this),[...e.sheet.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t))),n(this),r.abort(),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:r.signal}),t.addEventListener("error",(({target:e})=>{const t=new DOMException("Error loading stylesheet.");o(t),r.abort(t),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:r.signal}),t.rel="stylesheet",t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.media="no-op",t.href=URL.createObjectURL(new File([e],"tmp.css",{type:"text/css"})),document.head.append(t),i}),CSSStyleSheet.prototype.replaceSync instanceof Function||(CSSStyleSheet.prototype.replaceSync=function(e){const t=Document.parseHTML(`<style>${e}</style>`,{sanitizer:{allowElements:["style","html","head","body"]}}).styleSheets.item(0);He(this),[...t.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t)))});const Ue={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},De="http://www.w3.org/1999/xhtml",$e=new Set(("HTMLElement"in globalThis?Object.keys(HTMLElement.prototype):[]).filter((e=>e.startsWith("on"))));
26
+ */("HTMLElement"in globalThis&&!("trustedTypes"in globalThis)||"HTMLElement"in globalThis&&globalThis.trustedTypes[Symbol.for("polyfilled")]&&globalThis.trustedTypes[Symbol.for("enforced")])&&function(){function e(){return"trustedTypes"in globalThis}function t(){return e()&&!Object.is(trustedTypes.defaultPolicy,null)}function r(r){if(function(t){return e()&&trustedTypes.isHTML(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createHTML(r);throw new TypeError("Attempting to set HTML and no default policy is available.")}function n(r){if(function(t){return e()&&trustedTypes.isScript(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScript(r);throw new TypeError("Attempting to create script and no default policy is available.")}function o(r){if(function(t){return e()&&trustedTypes.isScriptURL(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScriptURL(r);throw new TypeError("Attempting to create script URL and no default policy is available.")}function i(t,r,n){return e()?trustedTypes.getAttributeType(t,r,n):null}try{const{write:e,writeln:t,execCommand:n}=Object.getOwnPropertyDescriptors(Document.prototype);Object.defineProperties(Document.prototype,{write:{value:function(t){e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable},writeln:{value:function(e){t.value.call(this,r(e))},enumerable:t.enumerable,configurable:t.configurable,writable:t.writable},execCommand:{value:function(e,t,o){return["insertHTML"].includes(e)?n.value.call(this,e,t,r(o)):n.value.call(this,e,t,o)},enumerable:n.enumerable,configurable:n.configurable}})}catch(e){console.error(e)}if("ServiceWorkerContainer"in globalThis)try{const e=Object.getOwnPropertyDescriptor(ServiceWorkerContainer.prototype,"register");Object.defineProperty(ServiceWorkerContainer.prototype,"register",{value:function(t,r){return e.value.call(this,o(t),r)},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const e=Object.getOwnPropertyDescriptor(Range.prototype,"createContextualFragment");Object.defineProperty(Range.prototype,"createContextualFragment",{value:function(t){return e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const{parseFromString:e}=Object.getOwnPropertyDescriptors(DOMParser.prototype);Object.defineProperties(DOMParser.prototype,{parseFromString:{value:function(t,n){return"text/html"===n?e.value.call(this,r(t),n):e.value.call(this,t,n)},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable}})}catch(e){console.error(e)}try{const{src:e,text:t}=Object.getOwnPropertyDescriptors(HTMLScriptElement.prototype);Object.defineProperties(HTMLScriptElement.prototype,{text:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,n(e))},enumerable:t.enumerable,configurable:t.configurable},src:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable}})}catch(e){console.error(e)}try{const{setAttribute:e,setAttributeNS:t,innerHTML:a,outerHTML:s,insertAdjacentHTML:l}=Object.getOwnPropertyDescriptors(Element.prototype);Object.defineProperties(Element.prototype,{setAttribute:{value:function(t,a){switch(i(this.tagName,t)){case"TrustedHTML":e.value.call(this,t,r(a));break;case"TrustedScript":e.value.call(this,t,n(a));break;case"TrustedScriptURL":e.value.call(this,t,o(a));break;default:e.value.call(this,t,a)}},enumerable:e.enumerable,configurable:e.configurable},setAttributeNS:{value:function(e,a,s){switch(i(this.tagName,a,e)){case"TrustedHTML":t.value.call(this,e,a,r(s));break;case"TrustedScript":t.value.call(this,e,a,n(s));break;case"TrustedScriptURL":t.value.call(this,e,a,o(s));break;default:t.value.call(this,e,a,s)}},enumerable:t.enumerable,configurable:t.configurable},innerHTML:{get:function(){return a.get.call(this)},set:function(e){a.set.call(this,r(e))},enumerable:a.enumerable,configurable:a.configurable},outerHTML:{get:function(){return s.get.call(this)},set:function(e){s.set.call(this,r(e))},enumerable:s.enumerable,configurable:s.configurable},insertAdjacentHTML:{value:function(e,t){l.value.call(this,e,r(t))},enumerable:l.enumerable,configurable:l.configurable}})}catch(e){console.error(e)}try{const{srcdoc:e,src:t}=Object.getOwnPropertyDescriptors(HTMLIFrameElement.prototype);Object.defineProperties(HTMLIFrameElement.prototype,{srcdoc:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable},src:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{data:e,codeBase:t}=Object.getOwnPropertyDescriptors(HTMLObjectElement.prototype);Object.defineProperties(HTMLObjectElement.prototype,{data:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable},codeBase:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{eval:e,setTimeout:t,setInterval:r}=globalThis;globalThis.eval=function(t){return e(n(t).toString())},globalThis.setTimeout=function(e,r,...o){return"string"==typeof e?t(n(e),r,...o):t(e,r,...o)},globalThis.setInterval=function(e,t,...o){return"string"==typeof e?r(n(e),t,...o):r(e,t,...o)};try{const e=globalThis.Function;globalThis.Function=function(...t){if(0===t.length)return e();{const r=n(t.pop());return e(...t,r.toString())}},globalThis.Function.prototype=e.prototype,e.prototype.constructor=globalThis.Function}catch(e){console.error(e)}}catch(e){console.error(e)}}();const Z={get(){return Array.from(this.styleSheets).filter((e=>e.ownerNode.classList.contains("_adopted")))},set(e){if(!Array.isArray(e))throw new TypeError("Must be an array");{const t=new Set(this.adoptedStyleSheets);t.difference(e).forEach((e=>e.ownerNode.remove()));const r=[...new Set(e).difference(t)].map((e=>{const t=document.createElement("link"),r=new AbortController,n=r.signal,o=URL.createObjectURL(new File([],"adopted.css",{type:"text/css"}));return t.rel="stylesheet",t.href=o,t.classList.add("_adopted"),t.disabled=e.disabled,t.addEventListener("load",(({target:n})=>{r.abort(),t.media=e.media.mediaText,[...e.cssRules].forEach(((e,t)=>{n.sheet.insertRule(e.cssText,t)})),setTimeout((()=>URL.revokeObjectURL(n.href)),100)}),{once:!0,signal:n}),t.addEventListener("error",(({target:e})=>{r.abort(),URL.revokeObjectURL(e.href)}),{once:!0,signal:n}),t}));this instanceof Document?this.head.append(...r):this.append(...r)}}};function ee(e){if(e instanceof HTMLTemplateElement&&e.parentElement instanceof HTMLElement){e.parentElement.attachShadow({mode:e.getAttribute("shadowrootmode"),clonable:e.hasAttribute("shadowrootclonable"),delegatesFocus:e.hasAttribute("shadowrootdelegatesfocus"),serializable:e.hasAttribute("shadowrootserializable")}).append(e.content),e.remove()}}function te(e){const t=(new DOMParser).parseFromString(e,"text/html"),r=document.createDocumentFragment();r.append(...t.body.childNodes),ee(r.querySelector("template[shadowroootmode]")),this.replaceChildren(r)}function re(e){for(;e.cssRules.length>0;)e.deleteRule(0)}c(Document.prototype,"adoptedStyleSheets",Z),l(Document,"parseHTMLUnsafe",(function(e){const t=new DOMParser,r=document.implementation.createHTMLDocument(),n=t.parseFromString(e,"text/html");return r.head.append(...n.head.childNodes),r.body.append(...n.body.childNodes),r.querySelectorAll("template[shadowrootmode]").forEach(ee),r})),"ShadowRoot"in globalThis&&(c(ShadowRoot.prototype,"adoptedStyleSheets",Z),l(ShadowRoot.prototype,"setHTMLUnsafe",te),l(ShadowRoot.prototype,"getHTML",(function({shadowRoots:e,serializableShadowRoots:t=!1}={}){return this.cloneNode(!0).innerHTML})));try{new CSSStyleSheet}catch{const ct=globalThis.CSSStyleSheet;globalThis.CSSStyleSheet=function({disabled:e=!1,media:t}={}){const r=function(e="",{disabled:t=!1,media:r}={}){const n=Document.parseHTML(`<style>${e}</style>`,{sanitizer:{allowElements:["style","html","head","body"]}}).styleSheets.item(0);return"string"==typeof r&&n.media.appendMedium(r),n.disabled=t,n}("#dfgbkjdfg{color:red;}",{disabled:e,media:t});return r.deleteRule(0),r},globalThis.CSSStyleSheet.prototype=ct.prototype,ct.prototype.constructor=globalThis.CSSStyleSheet}CSSStyleSheet.prototype.replace instanceof Function||(CSSStyleSheet.prototype.replace=function(e){const t=document.createElement("link"),r=new AbortController,{resolve:n,reject:o,promise:i}=Promise.withResolvers();return t.addEventListener("load",(({target:e})=>{re(this),[...e.sheet.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t))),n(this),r.abort(),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:r.signal}),t.addEventListener("error",(({target:e})=>{const t=new DOMException("Error loading stylesheet.");o(t),r.abort(t),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:r.signal}),t.rel="stylesheet",t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.media="no-op",t.href=URL.createObjectURL(new File([e],"tmp.css",{type:"text/css"})),document.head.append(t),i}),CSSStyleSheet.prototype.replaceSync instanceof Function||(CSSStyleSheet.prototype.replaceSync=function(e){const t=Document.parseHTML(`<style>${e}</style>`,{sanitizer:{allowElements:["style","html","head","body"]}}).styleSheets.item(0);re(this),[...t.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t)))});const ne={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},oe="http://www.w3.org/1999/xhtml",ie="http://www.w3.org/1999/xlink",ae=new Set(("HTMLElement"in globalThis?Object.keys(HTMLElement.prototype):[]).filter((e=>e.startsWith("on"))));
27
27
  /**
28
28
  * @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
29
- */function qe(e,t=De){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,attributes:o}=e;return Object.freeze({name:r,namespace:"string"==typeof n&&0!==n.length?n:t,attributes:o})}throw new TypeError("Invalid config entry for `elements`.")}function Be({elements:e,allowElements:t},r=De){if(Array.isArray(t))return console.warn("Use of `allowElements` is deprecated. Please use `elements` instead."),Be({elements:t},r);if(Array.isArray(e))return e.map((e=>qe(e,r)));throw new TypeError("`elements` expected to be an array.")}function ze(e,t){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,elements:o,...i}=e;return Object.freeze({name:r,namespace:"string"==typeof n?n:t,elements:o,...i})}throw new TypeError("Invalid entry in `attributes` config.")}function _e({attributes:e,allowAttributes:t},r){if(void 0!==t)return console.warn("Use of `allowAttributes` is deprecated. Please use `attributes` instead."),_e({attributes:t},r);if(Array.isArray(e))return e.map((e=>ze(e,r)));if("object"==typeof e&&null!==e)return console.warn("`attributes` should be an array, not an oobject."),_e({attributes:Object.entries(e).map((([e,t])=>({name:e,elements:t})))},r);throw new TypeError("`attributes` expected to be an array.")}function Ve({comments:e,allowComments:t}){return"boolean"==typeof t?(console.warn("Use of `allowComments` is deprecated. Please use `comments` instead."),t):"boolean"!=typeof e||e}function We({attributes:e,allowAttributes:t},r){return Object.freeze(Object.groupBy(_e({attributes:e,allowAttributes:t},r),(({namespace:e})=>e??"")))}function Ge({elements:e,allowElements:t},r=De){return Object.freeze(Object.groupBy(Be({elements:e,allowElements:t},r),(({namespace:e})=>e)))}const Ke=Object.freeze(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","itemid","itemprop","itemref","itemscope","itemtype","lang","part","popover","slot","spellcheck","tabindex","title","translate","virtualkeyboardpolicy","aria-keyshortcuts","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"].map((e=>ze(e)))),Xe=Object.freeze(["html","head","link","meta","body","address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","search","blockquote","cite","div","dd","dt","dl","figcaption","figure","hr","li","ol","ul","menu","p","pre","a","abbr","b","bdi","bdo","br","code","data","dfn","em","i","kbd","mark","q","rp","ruby","rt","s","del","ins","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","picture","source","canvas","caption","col","colgroup","table","tbody","tr","td","tfoot","th","thead","button","datalist","option","fieldset","label","form","input","legend","meter","optgroup","select","output","progress","textarea","details","summary","dialog","slot","template","dir","strike","selectmenu","center"].map((e=>qe(e,De)))),Qe=Object.freeze(["abbr","accept","accept-charset","align","alink","allow","allowfullscreen","alt","anchor","archive","as","async","autocomplete","autocorrect","autopictureinpicture","autoplay","axis","background","behavior","border","bordercolor","capture","cellpadding","cellspacing","challenge","char","charoff","charset","checked","cite","classid","clear","code","codetype","color","cols","colspan","compact","content","controls","controlslist","conversiondestination","coords","crossorigin","csp","data","datetime","declare","decoding","default","defer","direction","dirname","disabled","disablepictureinpicture","disableremoteplayback","disallowdocumentaccess","download","elementtiming","enctype","end","for","form","formenctype","formmethod","formnovalidate","formtarget","frameborder","headers","height","high","href","hreflang","hreftranslate","hspace","imagesizes","imagesrcset","importance","impressiondata","impressionexpiry","incremental","integrity","invisible","invoketarget","invokeaction","is","ismap","keytype","kind","label","language","latencyhint","leftmargin","link","list","loading","longdesc","loop","low","lowsrc","manifest","marginheight","marginwidth","max","maxlength","mayscript","media","method","min","minlength","multiple","muted","name","nohref","nomodule","noresize","noshade","novalidate","nowrap","object","open","optimum","pattern","ping","placeholder","playsinline","policy","popovertarget","popovertargetaction","poster","preload","pseudo","readonly","referrerpolicy","rel","reportingorigin","required","resources","rev","reversed","role","rows","rowspan","rules","sandbox","scheme","scope","scopes","scrollamount","scrolldelay","scrolling","select","selected","shadowrootmode","shadowrootdelegatesfocus","shape","size","sizes","span","src","srcdoc","srclang","srcset","standby","start","step","summary","target","text","topmargin","truespeed","trusttoken","type","usemap","valign","value","valuetype","version","vlink","vspace","webkitdirectory","width","wrap"].map((e=>ze(e))).concat(Ke)),Je=Object.freeze({comments:!0,elements:Xe,attributes:Qe,dataAttributes:!0});
29
+ */function se(e,t=oe){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,attributes:o}=e;return Object.freeze({name:r,namespace:"string"==typeof n&&0!==n.length?n:t,attributes:o})}throw new TypeError("Invalid config entry for `elements`.")}function le({elements:e,allowElements:t},r=oe){if(Array.isArray(t))return console.warn("Use of `allowElements` is deprecated. Please use `elements` instead."),le({elements:t},r);if(Array.isArray(e))return e.map((e=>se(e,r)));throw new TypeError("`elements` expected to be an array.")}function ce(e,t){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,elements:o,...i}=e;return Object.freeze({name:r,namespace:"string"==typeof n?n:t,elements:o,...i})}throw new TypeError("Invalid entry in `attributes` config.")}function ue({attributes:e,allowAttributes:t},r){if(void 0!==t)return console.warn("Use of `allowAttributes` is deprecated. Please use `attributes` instead."),ue({attributes:t},r);if(Array.isArray(e))return e.map((e=>ce(e,r)));if("object"==typeof e&&null!==e)return console.warn("`attributes` should be an array, not an oobject."),ue({attributes:Object.entries(e).map((([e,t])=>({name:e,elements:t})))},r);throw new TypeError("`attributes` expected to be an array.")}function pe({comments:e,allowComments:t}){return"boolean"==typeof t?(console.warn("Use of `allowComments` is deprecated. Please use `comments` instead."),t):"boolean"!=typeof e||e}function he({attributes:e,allowAttributes:t},r){return Object.freeze(Object.groupBy(ue({attributes:e,allowAttributes:t},r),(({namespace:e})=>e??"")))}function fe({elements:e,allowElements:t},r=oe){return Object.freeze(Object.groupBy(le({elements:e,allowElements:t},r),(({namespace:e})=>e)))}function de(e,{elementNS:t=oe,attributeNS:r}={}){if("object"!=typeof e||null===e)throw new TypeError("Sanitizer config must be an object.");return e.get instanceof Function?de(e.get()):Object.freeze({elements:fe(e,t),attributes:he(e,r),comments:pe(e),dataAttributes:void 0===e.dataAttributes||e.dataAttributes})}const me=Object.freeze(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","itemid","itemprop","itemref","itemscope","itemtype","lang","part","popover","slot","spellcheck","tabindex","title","translate","virtualkeyboardpolicy","aria-keyshortcuts","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"].map((e=>ce(e)))),ge=Object.freeze(["html","head","link","meta","body","address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","search","blockquote","cite","div","dd","dt","dl","figcaption","figure","hr","li","ol","ul","menu","p","pre","a","abbr","b","bdi","bdo","br","code","data","dfn","em","i","kbd","mark","q","rp","ruby","rt","s","del","ins","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","picture","source","canvas","caption","col","colgroup","table","tbody","tr","td","tfoot","th","thead","button","datalist","option","fieldset","label","form","input","legend","meter","optgroup","select","output","progress","textarea","details","summary","dialog","slot","template","dir","strike","selectmenu","center"].map((e=>se(e,oe)))),ye=Object.freeze(["abbr","accept","accept-charset","align","alink","allow","allowfullscreen","alt","anchor","archive","as","async","autocomplete","autocorrect","autopictureinpicture","autoplay","axis","background","behavior","border","bordercolor","capture","cellpadding","cellspacing","challenge","char","charoff","charset","checked","cite","classid","clear","code","codetype","color","cols","colspan","compact","content","controls","controlslist","conversiondestination","coords","crossorigin","csp","data","datetime","declare","decoding","default","defer","direction","dirname","disabled","disablepictureinpicture","disableremoteplayback","disallowdocumentaccess","download","elementtiming","enctype","end","for","form","formenctype","formmethod","formnovalidate","formtarget","frameborder","headers","height","high","href","hreflang","hreftranslate","hspace","imagesizes","imagesrcset","importance","impressiondata","impressionexpiry","incremental","integrity","invisible","invoketarget","invokeaction","is","ismap","keytype","kind","label","language","latencyhint","leftmargin","link","list","loading","longdesc","loop","low","lowsrc","manifest","marginheight","marginwidth","max","maxlength","mayscript","media","method","min","minlength","multiple","muted","name","nohref","nomodule","noresize","noshade","novalidate","nowrap","object","open","optimum","pattern","ping","placeholder","playsinline","policy","popovertarget","popovertargetaction","poster","preload","pseudo","readonly","referrerpolicy","rel","reportingorigin","required","resources","rev","reversed","role","rows","rowspan","rules","sandbox","scheme","scope","scopes","scrollamount","scrolldelay","scrolling","select","selected","shadowrootmode","shadowrootdelegatesfocus","shape","size","sizes","span","src","srcdoc","srclang","srcset","standby","start","step","summary","target","text","topmargin","truespeed","trusttoken","type","usemap","valign","value","valuetype","version","vlink","vspace","webkitdirectory","width","wrap"].map((e=>ce(e))).concat(me)),be=Object.freeze({comments:!0,elements:ge,attributes:ye,dataAttributes:!0}),we=Object.freeze(["a","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tspan","view","missing-glyph","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","hkern","vkern","glyph","glyphRef","tref","cursor","use"].map((e=>se(e,"http://www.w3.org/2000/svg")))),ve=Object.freeze(["accent-height","accumulate","additive","alignment-baseline","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","class","clip","clipPathUnits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","crossorigin","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","end","exponent","fill","fill-opacity","fill-rule","filter","filterUnits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","format","from","fr","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","height","href","hreflang","horiz-adv-x","horiz-origin-x","id","ideographic","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lang","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","marker-mid","marker-start","markerHeight","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","max","media","method","min","mode","name","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","panose-1","paint-order","path","pathLength","patternContentUnits","patternTransform","patternUnits","ping","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","referrerPolicy","refX","refY","rel","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","surfaceScale","systemLanguage","tabindex","tableValues","target","targetX","targetY","text-anchor","text-decoration","text-rendering","textLength","to","transform","transform-origin","type","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","values","vector-effect","version","vert-adv-y","vert-origin-x","vert-origin-y","viewBox","visibility","width","widths","word-spacing","writing-mode","x","x-height","x1","x2","xChannelSelector","y","y1","y2","yChannelSelector","z","zoomAndPan","autoReverse","accelerate","xmlns",{name:"actuate",namespace:ie},{name:"arcrole",namespaec:ie},{name:"href",namespace:ie},{name:"role",namespace:ie},{name:"show",namespace:ie},{name:"title",namespace:ie},{name:"type",namespace:ie},{name:"space",namespace:"http://www.w3.org/XML/1998/namespace"}].map((e=>ce(e))).concat(me)),Te=Object.freeze(["math","maction","annotation","annotation-xml","menclose","merror","mfenced","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","semantics","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"].map((e=>se(e,"http://www.w3.org/1998/Math/MathML")))),Ee=Object.freeze(["accent","accentunder","actiontype","align","background","close","color","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","fence","fontfamily","fontsize","fontstyle","fontweight","frame","framespacing","height","href","id","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","superscriptshift","symmetric","voffset","width","xmlns"].map((e=>ce(e))).concat(me));
30
30
  /**
31
31
  * @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
32
32
  * @see https://wicg.github.io/sanitizer-api/#default-configuration-dictionary
33
- */const Ze=new Set(["href","src","action","xlink:href"]),Ye=new Set(["javascript:","data:","file:","ftp:"]),et=function(e,{createHTML:t,createScript:r,createScriptURL:n}){return"trustedTypes"in globalThis?trustedTypes.createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}):Object.freeze({[Symbol.for("policy-name")]:e.toString(),createHTML(r,...n){if(t instanceof Function){const e=t(r.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createHTML method.`)},createScript(t,...n){if(r instanceof Function){const e=r(t.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScript method.`)},createScriptURL(t,...r){if(n instanceof Function){const e=n(t.toString(),...r).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScriptURL method.`)}})}("aegis-sanitizer#html",{createHTML:e=>e});function tt(e,t,{elements:r=Je.elements,attributes:n=Je.attributes,comments:o=Je.comments,dataAttributes:i=Je.dataAttributes,...a}=Je,{allowInsecure:s=!1}={}){const l=document.createElement("template");l.innerHTML=et.createHTML(t),nt(l.content,{elements:r,attributes:n,comments:o,dataAttributes:i,...a},s),e.replaceChildren(l.content)}function rt(e,{elements:t=Je.elements,attributes:r=Je.attributes,comments:n=Je.comments,dataAttributes:o=Je.dataAttributes,...i}=Je,{allowInsecure:a=!1}={}){const s=(new DOMParser).parseFromString(et.createHTML(e),"text/html");return nt(s,{elements:t,attributes:r,comments:n,dataAttributes:o,...i},a),s}function nt(e,t=Je,r=!1){if(e instanceof Node){const n=function(e,{elementNS:t=De,attributeNS:r}={}){if("object"!=typeof e||null===e)throw new TypeError("Sanitizer config must be an object.");return Object.freeze({elements:Ge(e,t),attributes:We(e,r),comments:Ve(e),dataAttributes:void 0===e.dataAttributes||e.dataAttributes})}(t);return at(e,n,r)}throw new TypeError("Not a node.")}const ot="trustedTypes"in globalThis?e=>null!==trustedTypes.getAttributeType(e.ownerElement.tagName,e.localName,e.ownerElement.namespaceURI,e.namespaceURI):e=>$e.has(e.localName);function it(e,t,r=!1){const n=e.namespaceURI||"";return(!("dataAttributes"in t)||t.dataAttributes)&&e.name.startsWith("data-")||n in t.attributes&&t.attributes[n].some((t=>t.name===e.localName))&&!(r||ot(e))&&!(r||function(e){if(Ze.has(e.name)){if(URL.canParse(e.value)){const{protocol:t}=new URL(e.value);return Ye.has(t)}return!1}return!1}(e))}function at(e,t,r=!1){switch(e.nodeType){case Node.ELEMENT_NODE:!function(e,t,r){if(function(e,t){return e.namespaceURI in t.elements&&t.elements[e.namespaceURI].some((t=>t.name===e.localName))}(e,t)){if(e.hasAttributes()){const n=e.attributes;for(let e=n.length-1;-1!==e;e--)st(n[e],t,r)}if("TEMPLATE"===e.tagName)lt(e.content,t,r);else if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)at(n[e],t,r)}}else e.remove()}(e,t,r);break;case Node.DOCUMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:lt(e,t,r);break;case Node.COMMENT_NODE:!function(e,t){t.comments||e.remove()}(e,t);break;case Node.ATTRIBUTE_NODE:st(e,t,r);break;case Node.TEXT_NODE:case Node.DOCUMENT_TYPE_NODE:break;default:e.ownerElement instanceof Element&&e.ownerElement.removeChild(e)}}function st(e,t,r=!1){!it(e,t,r)&&e.ownerElement instanceof Element&&e.ownerElement.removeAttributeNode(e)}function lt(e,t,r=!1){if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)at(n[e],t,r)}}function ct({currentTarget:e}){switch(e.popoverTargetAction){case"show":e.popoverTargetElement.showPopover();break;case"hide":e.popoverTargetElement.hidePopover();break;default:e.popoverTargetElement.togglePopover()}}if(Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}),URL.canParse instanceof Function||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch{return!1}}),URL.parse instanceof Function||(URL.parse=function(e,t){return URL.canParse(e,t)?new URL(e,t):null}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){const r={};for(const n of e){const e=t(n);e in r?r[e].push(n):r[e]=[n]}return r}),Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a}={}){"object"==typeof i&&null!==i?(console.warn("Use of `sanitizer` in config is deprecated. Please set config directly."),tt(this,e,i.getConfiguration instanceof Function?i.getConfiguration():i)):tt(this,e,{elements:t,attributes:r,comments:n,dataAttributes:o,...a})},DocumentFragment.prototype.setHTML=function(...e){Element.prototype.setHTML.apply(this,e)},HTMLTemplateElement.prototype.setHTML=function(e,t){this.content.setHTML(e,t)}),Document.parseHTML instanceof Function||(Document.parseHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a}={}){return"object"==typeof i&&null!==i?Document.parseHTML(e,i.getConfiguration instanceof Function?i.getConfiguration():i):rt(e,{elements:t,attributes:r,comments:n,dataAttributes:o,...a})}),o(Element.prototype,"setHTMLUnsafe",Ce),globalThis.ToggleEvent instanceof Function){class Ut extends Event{#D;#$;constructor(e,{newState:t,oldState:r}){super(e,{bubbles:!0}),this.#D=t,this.#$=r}get newState(){return this.#D}get oldState(){return this.#$}}globalThis.ToggleEvent=Ut}if(!(HTMLElement.prototype.showPopover instanceof Function)){const Dt=e=>e.classList.contains("_popover-open");Object.defineProperties(HTMLElement.prototype,{showPopover:{value:function(){if(!Dt(this)){if(this.dispatchEvent(new ToggleEvent("beforetoggle",{oldState:"closed",newState:"open"})),"auto"===this.getAttribute("popover")){const e=new AbortController;document.body.addEventListener("click",(({target:t})=>{this.contains(t)||this.isSameNode(t.popoverTargetElement)||(e.abort(),this.hidePopover())}),{signal:e.signal,capture:!0}),document.body.addEventListener("keydown",(({key:t})=>{"Escape"===t&&(e.abort(),this.hidePopover())}),{signal:e.signal,capture:!0}),document.addEventListener("beforetoggle",(({target:t})=>{t.isSameNode(this)||"auto"!==t.getAttribute("popover")||(e.abort(),this.hidePopover())}),{signal:e.signal})}this.classList.add("_popover-open"),this.dispatchEvent(new ToggleEvent("toggle",{oldState:"closed",newState:"open"}))}}},hidePopover:{value:function(){Dt(this)&&(this.dispatchEvent(new ToggleEvent("beforetoggle",{oldState:"open",newState:"closed"})),queueMicrotask((()=>this.classList.remove("_popover-open"))),this.dispatchEvent(new ToggleEvent("toggle",{oldState:"open",newState:"closed"})))}},togglePopover:{value:function(){Dt(this)?this.hidePopover():this.showPopover()}}}),Object.defineProperties(HTMLButtonElement.prototype,{popoverTargetElement:{get(){return document.getElementById(this.getAttribute("popovertarget"))}},popoverTargetAction:{get(){return this.getAttribute("popovertargetaction")||"toggle"},set(e){this.setAttribute("popovertargetaction",e)}}}),function(e=document.body){e.querySelectorAll('button[popovertarget], input[type="button"][popovertarget]').forEach((e=>e.addEventListener("click",ct)))}()}if(HTMLScriptElement.supports instanceof Function||(HTMLScriptElement.supports=function(e){switch(e.toLowerCase()){case"classic":return!0;case"module":return"noModule"in HTMLScriptElement.prototype;default:return!1}}),!Element.prototype.hasOwnProperty(Ue.role)){const $t=!0,qt=!0,Bt=Object.fromEntries(Object.entries(Ue).map((([e,t])=>[e,{get:function(){return this.getAttribute(t)},set:function(e){"string"==typeof e?this.setAttribute(t,e):this.removeAttribute(t)},enumerable:$t,configurable:qt}])));Object.defineProperties(Element.prototype,Bt)}if(!HTMLElement.prototype.hasOwnProperty("inert")){const zt=new WeakMap,_t=e=>{zt.has(e)&&(e.tabIndex=zt.get(e)),e.hasChildNodes()&&[...e.children].forEach(_t)},Vt=e=>{-1!==e.tabIndex&&(zt.set(e,e.tabIndex),e.tabIndex=-1),e.hasChildNodes()&&[...e.children].forEach(Vt)};Object.defineProperty(HTMLElement.prototype,"inert",{get:function(){return this.hasAttribute("inert")},set:function(e){e?(this.setAttribute("aria-hidden","true"),this.setAttribute("inert",""),Vt(this)):(this.removeAttribute("aria-hidden"),this.removeAttribute("inert"),_t(this))},enumerable:!0,configurable:!0})}if(HTMLImageElement.prototype.hasOwnProperty("complete")||Object.defineProperty(HTMLImageElement.prototype,"complete",{get:function(){return""===this.src||this.naturalHeight>0}}),HTMLImageElement.prototype.decode instanceof Function||(HTMLImageElement.prototype.decode=function(){return this.complete?Promise.resolve():new Promise(((e,t)=>{const r=()=>{this.removeEventListener("error",n),this.removeEventListener("load",r),e()},n=e=>{this.removeEventListener("error",n),this.removeEventListener("load",r),t(e)};this.addEventListener("load",r),this.addEventListener("error",n)}))}),!HTMLTemplateElement.prototype.hasOwnProperty("shadowRootMode")){Object.defineProperty(HTMLTemplateElement.prototype,"shadowRootMode",{get:function(){return this.getAttribute("shadowrootmode")},set:function(e){this.setAttribute("shadowrootmode",e)},enumerable:!0,configurable:!0});const Wt=(e=document)=>{e.querySelectorAll("template[shadowrootmode]").forEach((e=>{const t=e.parentElement.attachShadow({mode:e.shadowRootMode});t.append(e.content),e.remove(),Wt(t)}))};"loading"===document.readyState?document.addEventListener("readystatechange",(()=>Wt(document)),{once:!0}):Wt(document)}HTMLFormElement.prototype.requestSubmit instanceof Function||(HTMLFormElement.prototype.requestSubmit=function(e){if(void 0===e){const e=document.createElement("button");e.type="submit",e.hidden=!0,this.append(e),this.requestSubmit(e),setTimeout((()=>e.remove()),100)}else{if(!(e instanceof HTMLButtonElement||e instanceof HTMLInputElement))throw new TypeError("HTMLFormElement.requestSubmit: The submitter is not a submit button.");if(!("submit"===e.type||e instanceof HTMLInputElement&&"image"===e.type))throw new TypeError("HTMLFormElement.requestSubmit: The submitter is not a submit button.");if(!this.isSameNode(e.form))throw new DOMException("HTMLFormElement.requestSubmit: The submitter is not owned by this form.","NotFoundError");e.click()}}),"loading"in HTMLIFrameElement.prototype||i(HTMLIFrameElement.prototype,"loading",{get:function(){return this.getAttribute("loading")||"auto"},set:function(e){this.setAttribute("loading",e)}}),"credentialless"in HTMLIFrameElement.prototype||i(HTMLIFrameElement.prototype,"credentialless",{get:function(){return this.hasAttribute("credentialless")},set:function(e){this.toggleAttribute("credentialless",e)}});const ut="Expected a set-like object.",pt=["has","keys"],ht=["size"],ft=e=>e instanceof Set,dt=e=>ft(e)||"object"==typeof e&&null!==e&&pt.every((t=>e[t]instanceof Function))&&ht.every((t=>t in e));Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(e){if(!dt(e))throw new TypeError(ut);return new Set([...this].filter((t=>e.has(t))))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(e){if(!dt(e))throw new TypeError(ut);return new Set([...this].filter((t=>!e.has(t))))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(e){return new Set([...this,...e])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(e){if(!dt(e))throw new TypeError(ut);return[...this].every((t=>e.has(t)))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(e){if(!dt(e))throw new TypeError(ut);return ft(e)?e.isSubsetOf(this):new Set(e.keys()).isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(e){if(!dt(e))throw new TypeError(ut);return ft(e)?new Set([...this.difference(e),...e.difference(this)]):new Set([...this.difference(e),...new Set(e.keys()).difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(e){if(!dt(e))throw new TypeError(ut);return new Set([...this,...e]).size===this.size+e.size}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(e,{insert:t,update:r}={}){const n=this.has(e);if(n&&r instanceof Function){const t=this.get(e),n=r.call(this,t,e,this);return n!==t&&this.set(e,t),n}if(n)return this.get(e);if(t instanceof Function){const r=t.call(this,e,this);return this.set(e,r),r}throw new Error("Key is not found and no `insert()` given")}),function(){if("screen"in globalThis&&!(globalThis.getScreenDetails instanceof Function)){class e extends EventTarget{get availHeight(){return screen.availHeight}get availLeft(){return screen.availLeft}get availTop(){return screen.availTop}get availWidth(){return screen.availWidth}get colorDepth(){return screen.colorDepth}get devicePixelRatio(){return globalThis.devicePixelRatio||1}get height(){return screen.height}get isExtended(){return screen.isExtended}get isInternal(){return!0}get isPrimary(){return!0}get label(){return"Unknown"}get orientation(){return screen.orientation}get pixelDepth(){return screen.pixelDepth}get top(){return screen.top}get width(){return screen.width}}class t extends EventTarget{get currentScreen(){return new e}get screens(){return[this.currentScreen]}}Object.defineProperty(Screen.prototype,"isExtended",{enumerable:!0,configurable:!0,get:()=>!1}),globalThis.getScreenDetails=async()=>new t}}();
33
+ */Object.freeze([...ge,...we]),Object.freeze(Array.from(new Set([...ye,...ve]))),Object.freeze([...ge,...we,...Te]),Object.freeze(Array.from(new Set([...ye,...ve,...Ee])));const Se=new Set(["href","src","action","xlink:href"]),Ae=new Set(["javascript:","data:","file:","ftp:"]),xe=function(e,{createHTML:t,createScript:r,createScriptURL:n}){return"trustedTypes"in globalThis?trustedTypes.createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}):Object.freeze({[Symbol.for("policy-name")]:e.toString(),createHTML(r,...n){if(t instanceof Function){const e=t(r.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createHTML method.`)},createScript(t,...n){if(r instanceof Function){const e=r(t.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScript method.`)},createScriptURL(t,...r){if(n instanceof Function){const e=n(t.toString(),...r).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScriptURL method.`)}})}("aegis-sanitizer#html",{createHTML:e=>e});function Me(e,t,{elements:r=be.elements,attributes:n=be.attributes,comments:o=be.comments,dataAttributes:i=be.dataAttributes,sanitizer:a,...s}=be,{allowInsecure:l=!1}={}){const c=document.createElement("template");c.innerHTML=xe.createHTML(t),Oe(c.content,{elements:r,attributes:n,comments:o,dataAttributes:i,sanitizer:a,...s},l),e.replaceChildren(c.content)}function Le(e,{elements:t=be.elements,attributes:r=be.attributes,comments:n=be.comments,dataAttributes:o=be.dataAttributes,sanitizer:i,...a}=be,{allowInsecure:s=!1}={}){const l=(new DOMParser).parseFromString(xe.createHTML(e),"text/html");return Oe(l,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a},s),l}function Oe(e,t=be,r=!1){if(e instanceof Node){return Fe(e,de(t),r)}throw new TypeError("Not a node.")}const ke="trustedTypes"in globalThis?e=>null!==trustedTypes.getAttributeType(e.ownerElement.tagName,e.localName,e.ownerElement.namespaceURI,e.namespaceURI):e=>ae.has(e.localName);function Pe(e,t,r=!1){const n=e.namespaceURI||"";return(!("dataAttributes"in t)||t.dataAttributes)&&e.name.startsWith("data-")||n in t.attributes&&t.attributes[n].some((t=>t.name===e.localName))&&!(r||ke(e))&&!(r||function(e){if(Se.has(e.name)){if(URL.canParse(e.value)){const{protocol:t}=new URL(e.value);return Ae.has(t)}return!1}return!1}(e))}function Fe(e,t,r=!1){switch(e.nodeType){case Node.ELEMENT_NODE:!function(e,t,r){if(function(e,t){return e.namespaceURI in t.elements&&t.elements[e.namespaceURI].some((t=>t.name===e.localName))}(e,t)){if(e.hasAttributes()){const n=e.attributes;for(let e=n.length-1;-1!==e;e--)Re(n[e],t,r)}if("TEMPLATE"===e.tagName)je(e.content,t,r);else if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)Fe(n[e],t,r)}}else e.remove()}(e,t,r);break;case Node.DOCUMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:je(e,t,r);break;case Node.COMMENT_NODE:!function(e,t){t.comments||e.remove()}(e,t);break;case Node.ATTRIBUTE_NODE:Re(e,t,r);break;case Node.TEXT_NODE:case Node.DOCUMENT_TYPE_NODE:break;default:e.ownerElement instanceof Element&&e.ownerElement.removeChild(e)}}function Re(e,t,r=!1){!Pe(e,t,r)&&e.ownerElement instanceof Element&&e.ownerElement.removeAttributeNode(e)}function je(e,t,r=!1){if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)Fe(n[e],t,r)}}function Ie({currentTarget:e}){switch(e.popoverTargetAction){case"show":e.popoverTargetElement.showPopover();break;case"hide":e.popoverTargetElement.hidePopover();break;default:e.popoverTargetElement.togglePopover()}}if(Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}),URL.canParse instanceof Function||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch{return!1}}),URL.parse instanceof Function||(URL.parse=function(e,t){try{return new URL(e,t)}catch{return null}}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){const r={};for(const n of e){const e=t(n);e in r?r[e].push(n):r[e]=[n]}return r}),Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a}={}){Me(this,e,"object"==typeof i&&null!==i?i.getConfiguration instanceof Function?i.getConfiguration():i:{elements:t,attributes:r,comments:n,dataAttributes:o,...a})},DocumentFragment.prototype.setHTML=function(...e){Element.prototype.setHTML.apply(this,e)},HTMLTemplateElement.prototype.setHTML=function(e,t){this.content.setHTML(e,t)}),Document.parseHTML instanceof Function||(Document.parseHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a}={}){return"object"==typeof i&&null!==i?Document.parseHTML(e,i.getConfiguration instanceof Function?i.getConfiguration():i):Le(e,{elements:t,attributes:r,comments:n,dataAttributes:o,...a})}),l(Element.prototype,"setHTMLUnsafe",te),globalThis.ToggleEvent instanceof Function){class ut extends Event{#D;#$;constructor(e,{newState:t,oldState:r}){super(e,{bubbles:!0}),this.#D=t,this.#$=r}get newState(){return this.#D}get oldState(){return this.#$}}globalThis.ToggleEvent=ut}if(!(HTMLElement.prototype.showPopover instanceof Function)){const pt=e=>e.classList.contains("_popover-open");Object.defineProperties(HTMLElement.prototype,{showPopover:{value:function(){if(!pt(this)){if(this.dispatchEvent(new ToggleEvent("beforetoggle",{oldState:"closed",newState:"open"})),"auto"===this.getAttribute("popover")){const e=new AbortController;document.body.addEventListener("click",(({target:t})=>{this.contains(t)||this.isSameNode(t.popoverTargetElement)||(e.abort(),this.hidePopover())}),{signal:e.signal,capture:!0}),document.body.addEventListener("keydown",(({key:t})=>{"Escape"===t&&(e.abort(),this.hidePopover())}),{signal:e.signal,capture:!0}),document.addEventListener("beforetoggle",(({target:t})=>{t.isSameNode(this)||"auto"!==t.getAttribute("popover")||(e.abort(),this.hidePopover())}),{signal:e.signal})}this.classList.add("_popover-open"),this.dispatchEvent(new ToggleEvent("toggle",{oldState:"closed",newState:"open"}))}}},hidePopover:{value:function(){pt(this)&&(this.dispatchEvent(new ToggleEvent("beforetoggle",{oldState:"open",newState:"closed"})),queueMicrotask((()=>this.classList.remove("_popover-open"))),this.dispatchEvent(new ToggleEvent("toggle",{oldState:"open",newState:"closed"})))}},togglePopover:{value:function(){pt(this)?this.hidePopover():this.showPopover()}}}),Object.defineProperties(HTMLButtonElement.prototype,{popoverTargetElement:{get(){return document.getElementById(this.getAttribute("popovertarget"))}},popoverTargetAction:{get(){return this.getAttribute("popovertargetaction")||"toggle"},set(e){this.setAttribute("popovertargetaction",e)}}}),function(e=document.body){e.querySelectorAll('button[popovertarget], input[type="button"][popovertarget]').forEach((e=>e.addEventListener("click",Ie)))}()}if(HTMLScriptElement.supports instanceof Function||(HTMLScriptElement.supports=function(e){switch(e.toLowerCase()){case"classic":return!0;case"module":return"noModule"in HTMLScriptElement.prototype;default:return!1}}),!Element.prototype.hasOwnProperty(ne.role)){const ht=!0,ft=!0,dt=Object.fromEntries(Object.entries(ne).map((([e,t])=>[e,{get:function(){return this.getAttribute(t)},set:function(e){"string"==typeof e?this.setAttribute(t,e):this.removeAttribute(t)},enumerable:ht,configurable:ft}])));Object.defineProperties(Element.prototype,dt)}if(!HTMLElement.prototype.hasOwnProperty("inert")){const mt=new WeakMap,gt=e=>{mt.has(e)&&(e.tabIndex=mt.get(e)),e.hasChildNodes()&&[...e.children].forEach(gt)},yt=e=>{-1!==e.tabIndex&&(mt.set(e,e.tabIndex),e.tabIndex=-1),e.hasChildNodes()&&[...e.children].forEach(yt)};Object.defineProperty(HTMLElement.prototype,"inert",{get:function(){return this.hasAttribute("inert")},set:function(e){e?(this.setAttribute("aria-hidden","true"),this.setAttribute("inert",""),yt(this)):(this.removeAttribute("aria-hidden"),this.removeAttribute("inert"),gt(this))},enumerable:!0,configurable:!0})}if(HTMLImageElement.prototype.hasOwnProperty("complete")||Object.defineProperty(HTMLImageElement.prototype,"complete",{get:function(){return""===this.src||this.naturalHeight>0}}),HTMLImageElement.prototype.decode instanceof Function||(HTMLImageElement.prototype.decode=function(){return this.complete?Promise.resolve():new Promise(((e,t)=>{const r=()=>{this.removeEventListener("error",n),this.removeEventListener("load",r),e()},n=e=>{this.removeEventListener("error",n),this.removeEventListener("load",r),t(e)};this.addEventListener("load",r),this.addEventListener("error",n)}))}),!HTMLTemplateElement.prototype.hasOwnProperty("shadowRootMode")){Object.defineProperty(HTMLTemplateElement.prototype,"shadowRootMode",{get:function(){return this.getAttribute("shadowrootmode")},set:function(e){this.setAttribute("shadowrootmode",e)},enumerable:!0,configurable:!0});const bt=(e=document)=>{e.querySelectorAll("template[shadowrootmode]").forEach((e=>{const t=e.parentElement.attachShadow({mode:e.shadowRootMode});t.append(e.content),e.remove(),bt(t)}))};"loading"===document.readyState?document.addEventListener("readystatechange",(()=>bt(document)),{once:!0}):bt(document)}HTMLFormElement.prototype.requestSubmit instanceof Function||(HTMLFormElement.prototype.requestSubmit=function(e){if(void 0===e){const e=document.createElement("button");e.type="submit",e.hidden=!0,this.append(e),this.requestSubmit(e),setTimeout((()=>e.remove()),100)}else{if(!(e instanceof HTMLButtonElement||e instanceof HTMLInputElement))throw new TypeError("HTMLFormElement.requestSubmit: The submitter is not a submit button.");if(!("submit"===e.type||e instanceof HTMLInputElement&&"image"===e.type))throw new TypeError("HTMLFormElement.requestSubmit: The submitter is not a submit button.");if(!this.isSameNode(e.form))throw new DOMException("HTMLFormElement.requestSubmit: The submitter is not owned by this form.","NotFoundError");e.click()}}),"loading"in HTMLIFrameElement.prototype||c(HTMLIFrameElement.prototype,"loading",{get:function(){return this.getAttribute("loading")||"auto"},set:function(e){this.setAttribute("loading",e)}}),"credentialless"in HTMLIFrameElement.prototype||c(HTMLIFrameElement.prototype,"credentialless",{get:function(){return this.hasAttribute("credentialless")},set:function(e){this.toggleAttribute("credentialless",e)}});const Ne="Expected a set-like object.",Ce=["has","keys"],Ue=["size"],He=e=>e instanceof Set,De=e=>He(e)||"object"==typeof e&&null!==e&&Ce.every((t=>e[t]instanceof Function))&&Ue.every((t=>t in e));Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(e){if(!De(e))throw new TypeError(Ne);return new Set([...this].filter((t=>e.has(t))))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(e){if(!De(e))throw new TypeError(Ne);return new Set([...this].filter((t=>!e.has(t))))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(e){return new Set([...this,...e])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(e){if(!De(e))throw new TypeError(Ne);return[...this].every((t=>e.has(t)))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(e){if(!De(e))throw new TypeError(Ne);return He(e)?e.isSubsetOf(this):new Set(e.keys()).isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(e){if(!De(e))throw new TypeError(Ne);return He(e)?new Set([...this.difference(e),...e.difference(this)]):new Set([...this.difference(e),...new Set(e.keys()).difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(e){if(!De(e))throw new TypeError(Ne);return new Set([...this,...e]).size===this.size+e.size}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(e,{insert:t,update:r}={}){const n=this.has(e);if(n&&r instanceof Function){const t=this.get(e),n=r.call(this,t,e,this);return n!==t&&this.set(e,t),n}if(n)return this.get(e);if(t instanceof Function){const r=t.call(this,e,this);return this.set(e,r),r}throw new Error("Key is not found and no `insert()` given")}),function(){if("screen"in globalThis&&!(globalThis.getScreenDetails instanceof Function)){class e extends EventTarget{get availHeight(){return screen.availHeight}get availLeft(){return screen.availLeft}get availTop(){return screen.availTop}get availWidth(){return screen.availWidth}get colorDepth(){return screen.colorDepth}get devicePixelRatio(){return globalThis.devicePixelRatio||1}get height(){return screen.height}get isExtended(){return screen.isExtended}get isInternal(){return!0}get isPrimary(){return!0}get label(){return"Unknown"}get orientation(){return screen.orientation}get pixelDepth(){return screen.pixelDepth}get top(){return screen.top}get width(){return screen.width}}class t extends EventTarget{get currentScreen(){return new e}get screens(){return[this.currentScreen]}}Object.defineProperty(Screen.prototype,"isExtended",{enumerable:!0,configurable:!0,get:()=>!1}),globalThis.getScreenDetails=async()=>new t}}();
34
34
  /**
35
35
  * @copyright 2024 Chris Zuber <admin@kernvalley.us>
36
36
  */
37
- const mt="user-blocking",yt="user-visible",gt="background";async function bt(e,{delay:t=0,signal:r}={}){const{promise:n,resolve:o,reject:i}=Promise.withResolvers();if(r instanceof AbortSignal&&r.aborted)i(r.reason);else{const n=new AbortController,a=setTimeout((async()=>{await Promise.try(e).then(o,i),n.abort()}),t);r instanceof AbortSignal&&r.addEventListener("abort",(({target:e})=>{i(e.reason),clearTimeout(a),n.abort(e.reason)}),{once:!0,signal:n.signal})}return await n}class wt{async postTask(e,{priority:t=yt,delay:r,signal:n}={}){const{promise:o,resolve:i,reject:a}=Promise.withResolvers(),s=new AbortController,l=Number.isSafeInteger(r)&&r>=0,c=function(e,t,r,n){return async()=>{n instanceof AbortSignal&&n.aborted?r(n.reason):e instanceof Function?await Promise.try(e).then(t,r):r(new TypeError("Scheduled task is not a function."))}}(e,i,a,n);if(n instanceof AbortSignal&&n.aborted)a(n.reason);else switch(t){case mt:l?await bt(c,{delay:r,signal:n}):(await Promise.resolve(),queueMicrotask(c));break;case yt:if(l)await bt((()=>requestAnimationFrame(c)),{delay:r,signal:n});else{const e=requestAnimationFrame(c);n instanceof AbortSignal&&n.addEventListener("abort",(({target:t})=>{cancelAnimationFrame(e),a(t.reason),s.abort(t.reason)}),{once:!0,signal:s.signal})}break;case gt:if(l)await bt((()=>requestIdleCallback(c)),{delay:r,signal:n});else{const e=requestIdleCallback(c);n instanceof AbortSignal&&n.addEventListener("abort",(({target:t})=>{cancelIdleCallback(e),a(t.reason),s.abort(t.reason)}),{once:!0,signal:s.signal})}break;default:throw new TypeError(`Scheduler.postTask: '${t}' (value of 'priority' member of SchedulerPostTaskOptions) is not a valid value for enumeration TaskPriority.`)}return await o.then((e=>(s.abort(),e))).catch((e=>{throw s.abort(e),e}))}async yield({signal:e,priority:t=mt}={}){switch(t){case yt:await this.postTask((()=>{}),{signal:e,priority:yt});break;case mt:await this.postTask((()=>{}),{signal:e,priority:mt,delay:0});break;case gt:await this.postTask((()=>{}),{signal:e,priority:gt});break;default:throw new TypeError(`Scheduler.yield: '${t}' (value of 'priority' member of SchedulerPostTaskOptions) is not a valid value for enumeration TaskPriority.`)}}}"scheduler"in globalThis?globalThis.scheduler.yield instanceof Function||(globalThis.scheduler.yield=async function(e){await wt.prototype.yield.call(this,e)})
37
+ const $e="user-blocking",qe="user-visible",ze="background";async function Be(e,{delay:t=0,signal:r}={}){const{promise:n,resolve:o,reject:i}=Promise.withResolvers();if(r instanceof AbortSignal&&r.aborted)i(r.reason);else{const n=new AbortController,a=setTimeout((async()=>{await Promise.try(e).then(o,i),n.abort()}),t);r instanceof AbortSignal&&r.addEventListener("abort",(({target:e})=>{i(e.reason),clearTimeout(a),n.abort(e.reason)}),{once:!0,signal:n.signal})}return await n}class _e{async postTask(e,{priority:t=qe,delay:r,signal:n}={}){const{promise:o,resolve:i,reject:a}=Promise.withResolvers(),s=new AbortController,l=Number.isSafeInteger(r)&&r>=0,c=function(e,t,r,n){return async()=>{n instanceof AbortSignal&&n.aborted?r(n.reason):e instanceof Function?await Promise.try(e).then(t,r):r(new TypeError("Scheduled task is not a function."))}}(e,i,a,n);if(n instanceof AbortSignal&&n.aborted)a(n.reason);else switch(t){case $e:l?await Be(c,{delay:r,signal:n}):(await Promise.resolve(),queueMicrotask(c));break;case qe:if(l)await Be((()=>requestAnimationFrame(c)),{delay:r,signal:n});else{const e=requestAnimationFrame(c);n instanceof AbortSignal&&n.addEventListener("abort",(({target:t})=>{cancelAnimationFrame(e),a(t.reason),s.abort(t.reason)}),{once:!0,signal:s.signal})}break;case ze:if(l)await Be((()=>requestIdleCallback(c)),{delay:r,signal:n});else{const e=requestIdleCallback(c);n instanceof AbortSignal&&n.addEventListener("abort",(({target:t})=>{cancelIdleCallback(e),a(t.reason),s.abort(t.reason)}),{once:!0,signal:s.signal})}break;default:throw new TypeError(`Scheduler.postTask: '${t}' (value of 'priority' member of SchedulerPostTaskOptions) is not a valid value for enumeration TaskPriority.`)}return await o.then((e=>(s.abort(),e))).catch((e=>{throw s.abort(e),e}))}async yield({signal:e,priority:t=$e}={}){switch(t){case qe:await this.postTask((()=>{}),{signal:e,priority:qe});break;case $e:await this.postTask((()=>{}),{signal:e,priority:$e,delay:0});break;case ze:await this.postTask((()=>{}),{signal:e,priority:ze});break;default:throw new TypeError(`Scheduler.yield: '${t}' (value of 'priority' member of SchedulerPostTaskOptions) is not a valid value for enumeration TaskPriority.`)}}}"scheduler"in globalThis?globalThis.scheduler.yield instanceof Function||(globalThis.scheduler.yield=async function(e){await _e.prototype.yield.call(this,e)})
38
38
  /**
39
39
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
40
40
  * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals
@@ -52,5 +52,5 @@ const mt="user-blocking",yt="user-visible",gt="background";async function bt(e,{
52
52
  * Additionally, if `internals.states._polyfilled`
53
53
  * - Use `._state--*` in addition to `:--*` to query element internals states
54
54
  * - This includes `:disabled` -> `._state--disabled` & `:invalid` -> `._state--invalid`
55
- */:globalThis.scheduler=new wt;const vt={key:Symbol("key"),internals:Symbol("element-internals"),form:Symbol("form"),fieldset:Symbol("fieldset"),element:Symbol("element"),validity:Symbol("validity"),validationMessage:Symbol("validation-message"),value:Symbol("value"),state:Symbol("state"),formController:Symbol("form-controller"),anchor:Symbol("anchor"),customInputs:Symbol("custom-inputs")};if(!(HTMLElement.prototype.attachInternals instanceof Function)&&"FormDataEvent"in globalThis){const Gt={valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1,customError:!1,valid:!0},Kt=e=>e.hasOwnProperty(vt.fieldset)&&e[vt.fieldset]instanceof HTMLFieldSetElement&&e[vt.fieldset].disabled,Xt=e=>e instanceof HTMLElement&&e.tagName.includes("-")&&customElements.get(e.tagName.toLowerCase()).formAssociated,Qt=(e,t)=>function(r){if(r.target.reportValidity()){if(t.willValidate&&r.formData instanceof FormData){const n=t[vt.value];n instanceof FormData?n.entries().forEach((([e,t])=>r.formData.set(e,t))):e.hasAttribute("name")&&r.formData.set(e.getAttribute("name"),t[vt.value])}}else r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation()},Jt=(e,t)=>{Object.entries(t).forEach((([t,r])=>e.style.setProperty(t,r)))},Zt=e=>e.hasAttribute("form")&&document.forms[e.getAttribute("form")]||e.closest("form"),Yt=(e,t,r)=>{if(e instanceof HTMLFormElement){if(!(r instanceof HTMLElement&&r.tagName.includes("-")))throw new TypeError("Not a custom element");if(!(t instanceof rr||t instanceof globalThis.ElementInternals))throw new TypeError("Invalid ElementInternals");if(!Xt(r))throw new TypeError(`${r.tagName} is not form associated.`);if(!(r.formAssociatedCallback instanceof Function))throw new TypeError(`${r.tagName} is missing a formAssociatedCallback method.`);{const n=new AbortController,o=r.closest("fieldset");o instanceof Element&&(r[vt.fieldset]=o,o.hasOwnProperty(vt.customInputs)||(o[vt.customInputs]=new Set),o[vt.customInputs].add(r),er.observe(o,tr)),t[vt.form]=e,t[vt.formController]=n;const{checkValidity:i,reportValidity:a}=e;e.reportValidity=function(){return!!a.call(this)&&t.reportValidity()},e.checkValidity=function(){return!!i.call(this)&&t.checkValidity()},n.signal.addEventListener("abort",(()=>{e.reportValidity=a,e.checkValidity=i}),{once:!0}),e.addEventListener("formdata",Qt(r,t),{signal:n.signal}),e.addEventListener("submit",(e=>{e.target.reportValidity()||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation())}),{signal:n.signal}),r.formResetCallback instanceof Function&&e.addEventListener("reset",(()=>r.formResetCallback()),{signal:n.signal})}}else if(t[vt.formController]instanceof AbortController&&t[vt.formController].abort(),t[vt.form]=null,t[vt.formController]=null,r.hasOwnProperty(vt.fieldset)){const e=r[vt.fieldset];e.hasOwnProperty(vt.customInputs)&&(e[vt.customInputs].delete(r),0===e[vt.customInputs.size]&&delete e[vt.customInputs]),r[vt.fieldset]=null}},er=new MutationObserver((e=>{e.forEach((({target:t,type:r,attributeName:n})=>{if("attributes"===r&&"disabled"===n){const r=t.hasAttribute("disabled");if(Xt(t)&&t.hasOwnProperty(vt.internals)&&t[vt.internals].states.has("--disabled")!==r&&(1===e.length?!Kt(t):t.hasAttribute("disabled")===Kt(t)&&e.some((e=>e.target.isSameNode(t[vt.fieldset]))))){const e=t[vt.internals];r?e.states.add("--disabled"):e.states.delete("--disabled"),t.formDisabledCallback instanceof Function&&t.formDisabledCallback(r)}else"FIELDSET"!==t.tagName||!t.hasOwnProperty(vt.customInputs)||1!==e.length&&e.some((e=>t[vt.customInputs].has(e.target)))||t[vt.customInputs].forEach((e=>{e.isConnected&&e.hasOwnProperty(vt.internals)?e.hasAttribute("disabled")||(r?e[vt.internals].states.add("--disabled"):e[vt.internals].states.delete("--disabled"),e.formDisabledCallback instanceof Function&&e.formDisabledCallback(r)):t[vt.customInputs].delete(e)}))}}))})),tr={attributes:!0,attributeFilter:["disabled"]};class rr{constructor(e,t){if(t!==vt.key)throw new TypeError("Illegal constructor");if(!(e instanceof HTMLElement))throw new TypeError("Must be called on an HTMLElement");if(!e.tagName.includes("-"))throw new DOMException("Cannot attach internals to a built-in element.");{const t=!0,r=!1,n=!0;Object.defineProperties(this,{[vt.element]:{value:e,configurable:t,enumerable:r,writable:n},[vt.form]:{value:null,configurable:t,enumerable:r,writable:n},[vt.fieldset]:{value:null,configurable:t,enumerable:r,writable:n},[vt.anchor]:{value:null,configurable:t,enumerable:r,writable:n},[vt.validity]:{value:Gt,configurable:t,enumerable:r,writable:n},[vt.validationMessage]:{value:"",configurable:t,enumerable:r,writable:n},[vt.value]:{value:null,configurable:t,enumerable:r,writable:n},[vt.state]:{value:null,configurable:t,enumerable:r,writable:n},[vt.formController]:{value:null,configurable:t,enumerable:r,writable:n}}),Xt(e)&&er.observe(e,tr),Object.defineProperty(e,vt.internals,{value:this,enumerable:!1,configurable:!1,writable:!1}),setTimeout((()=>this.states.add("--element-internals-polyfilled")),10)}}get form(){return this[vt.form]}get labels(){const e=this.form;return e instanceof HTMLFormElement&&0!==this[vt.element].id.length?e.querySelectorAll(`label[for="${this[vt.element].id}"]`):document.createDocumentFragment().childNodes}get _polyfilled(){return!0}get shadowRoot(){return this[vt.element].shadowRoot}get validity(){return Xt(this[vt.element])?this[vt.validity]:void 0}get validationMessage(){return Xt(this[vt.element])?this[vt.validationMessage]||"":void 0}get willValidate(){const e=this[vt.element];return Xt(e)&&!Kt(e)&&!["disabled","readonly"].some((t=>e.hasAttribute(t)))}checkValidity(){if(this.willValidate){if(this.validity.valid){const e=this[vt.element].nextElementSibling;return e instanceof HTMLElement&&e.classList.contains("_element-internals-popup")&&e.remove(),!0}return this[vt.element].dispatchEvent(new Event("invalid")),!1}return!0}reportValidity(){if(this.checkValidity())return!0;{const e=this.validationMessage;if("string"==typeof e&&0!==e.length){const{bottom:t,left:r}=this[vt.element].getBoundingClientRect(),n=document.createElement("div");n.textContent=e,Jt(n,{position:"fixed","background-color":"#2b2a33",color:"#fafafa",top:`${t+2}px`,left:`${r}px`,"z-index":2147483647,"color-scheme":"light-dark","font-family":"system-ui, serif","font-size":"18px",display:"inline-block",padding:"0.6em 0.8em",border:"1px solid #1a1a1a","border-radius":"6px"}),n.classList.add("_element-internals-popup"),this[vt.element].focus();const o=this[vt.element].nextElementSibling;o instanceof Element&&o.classList.contains("_element-internals-popup")&&o.remove(),this[vt.element].insertAdjacentElement("afterend",n),this[vt.anchor]instanceof Element&&this[vt.anchor].focus(),setTimeout((()=>{n.isConnected&&n.remove()}),3e3)}return!1}}setFormValue(e,t){if(!Xt(this[vt.element]))throw new DOMException("Not form associated");this[vt.value]=e,this[vt.state]=t}setValidity({valueMissing:e=!1,typeMismatch:t=!1,patternMismatch:r=!1,tooLong:n=!1,tooShort:o=!1,rangeUnderflow:i=!1,rangeOverflow:a=!1,stepMismatch:s=!1,badInput:l=!1,customError:c=!1},u="",p){if(!Xt(this[vt.element]))throw new DOMException("Not form associated");if(("string"!=typeof u||0===u.length)&&(e||t||r||n||o||i||a||s||l||c))throw new DOMException("Message required if any flags are true.");{const h=[e,t,r,n,o,i,a,s,l,c].every((e=>!1===e));this[vt.validity]={valueMissing:e,typeMismatch:t,patternMismatch:r,tooLong:n,tooShort:o,rangeUnderflow:i,rangeOverflow:a,stepMismatch:s,badInput:l,customError:c,valid:h},this[vt.validationMessage]=u,this[vt.anchor]=p,h?(this.states.delete("--invalid"),this.states.add("--valid")):(this.states.add("--invalid"),this.states.delete("--valid"),this[vt.element].dispatchEvent(new Event("invalid")))}}_associateForm(e,t){Yt(e,this,t)}_findAssociatedForm(e){return Zt(e)}}HTMLElement.prototype.attachInternals=function(){if(this.hasOwnProperty(vt.internals))throw new DOMException("Invalid operation");if(this.tagName.includes("-"))return new rr(this,vt.key);throw new DOMException("Cannot call attachInternals on built-in elements.")},globalThis.ElementInternals=rr}if("ElementInternals"in globalThis&&!("CustomStateSet"in globalThis)){const nr="_state",or=new WeakMap,ir=e=>{if(e.toString().startsWith("--"))return`${nr}${e}`;throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value '${e}' must start with '--'.`)},{value:ar,writable:sr,configurable:lr,enumerable:cr}=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"attachInternals");class ur{constructor(e,t){if(t!==vt.key)throw new TypeError("Illegal Constructor");if(!(e instanceof HTMLElement))throw new TypeError("el must be an HTMLElement");or.set(this,e),this.add("--custom-states-polyfilled")}get _polyfilled(){return!0}get size(){return[...this.values()].length}add(e){or.get(this).classList.add(ir(e))}has(e){return or.get(this).classList.contains(ir(e))}delete(e){const t=ir(e);return!!or.get(this).classList.contains(t)&&(or.get(this).classList.remove(t),!0)}clear(){this.values().forEach((e=>this.delete(e)))}keys(){return this.values()}values(){return or.get(this).classList.values().filter((e=>e.startsWith(`${nr}--`))).map((e=>e.substr(nr.length)))}entries(){return this.values().map((e=>[e,e]))}forEach(e,t){this.values().forEach((r=>e.call(t||this,r,r,this)))}[Symbol.toStringTag](){return"CustomStateSet"}[Symbol.iterator](){return this.values()}}Object.defineProperty(HTMLElement.prototype,"attachInternals",{value:function(){const e=ar.call(this);return Object.defineProperty(e,vt.element,{value:this,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(e,"states",{value:new ur(this,vt.key),configurable:!0,enumberable:!0}),Object.is(e.shadowRoot,null)&&!Object.is(this.shadowRoot,null)&&Object.defineProperty(e,"shadowRoot",{value:this.shadowRoot,configurable:!0,enumerable:!0}),e},writable:sr,configurable:lr,enumerable:cr}),globalThis.CustomStateSet=ur,function(e){const t=Object.fromEntries(Object.keys(Ue).map((e=>[e,{get:function(){return this[vt.element][e]},set:function(t){this[vt.element][e]=t},enumerable:!0,configurable:!0}])));Object.defineProperties(e,t)}(ElementInternals.prototype)}if(o(Blob.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),o(Request.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),o(Response,"json",((e,{status:t=200,statusText:r="",headers:n=new Headers}={})=>n instanceof Headers?(n.set("Content-Type","application/json"),new Response(JSON.stringify(e),{status:t,statusText:r,headers:n})):Response.json(e,{status:t,statusText:r,headers:new Headers(n)}))),o(Response,"redirect",((e,t=302)=>new Response(null,{status:t,headers:new Headers({Location:e})}))),o(Response.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),!(globalThis.Record instanceof Function)){function pr(e){if(new.target===pr)throw new TypeError("Record is not a constructor");const t=Object.create(pr.prototype);return Object.defineProperties(t,Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{enumerable:!0,configurable:!1,writable:!1,value:t}])))),Object.freeze(t),t}pr.prototype.constructor=pr,Object.defineProperty(pr.prototype,Symbol.toStringTag,{value:"Record",enumerable:!0,configurable:!1,writable:!1}),pr.fromEntries=function(e){return pr(Object.fromEntries(e))},globalThis.Record=pr}if(!(globalThis.Tuple instanceof Function)){const hr=e=>{const t=Array.apply(Object.create(fr.prototype),e);return Object.setPrototypeOf(t,fr.prototype),t};function fr(...e){if(new.target===fr)throw new TypeError("Tuple is not a constructor");const t=hr(e);return Object.freeze(t),t}fr.prototype.forEach=function(e,t){Array.prototype.forEach.call(this,e,t)},fr.prototype.join=function(e=","){return Array.prototype.join.call(this,e)},fr.prototype.concat=function(...e){return fr(...this,...e)},fr.prototype.slice=function(e,t){return fr.from(Array.prototype.slice.call(this,e,t))},fr.prototype.indexOf=function(e,t){return Array.prototype.indexOf.call(this,e,t)},fr.prototype.lastIndexOf=function(e,t){return Array.prototype.lastIndexOf.call(this,e,t)},fr.prototype.findIndex=function(e,t){return Array.prototype.findIndex.call(this,e,t)},fr.prototype.find=function(e,t){return Array.prototype.find.call(this,e,t)},fr.prototype.findLast=function(e,t){return Array.prototype.findLast.call(this,e,t)},fr.prototype.findLastIndex=function(e,t){return Array.prototype.findLastIndex.call(this,e,t)},fr.prototype.every=function(e,t){return Array.prototype.every.call(this,e,t)},fr.prototype.some=function(e,t){return Array.prototype.some.call(this,e,t)},fr.prototype.includes=function(e,t){return Array.prototype.includes.call(this,e,t)},fr.prototype.map=function(e,t){return fr.from(Array.prototype.map.call(this,e,t))},fr.prototype.filter=function(e,t){return fr.from(Array.prototype.filter.call(this,e,t))},fr.prototype.flat=function(e){return fr.from(Array.prototype.flat.call(this,e))},fr.prototype.flatMap=function(e,t){return fr.from(Array.prototype.flatMap.call(this,e,t))},fr.prototype.at=function(e){return Array.prototype.at.call(this,e)},fr.prototype.reduce=function(e,t){return fr.from(Array.prototype.reduce.call(this,e,t))},fr.prototype.reduceRight=function(e,t){return fr.from(Array.prototype.reduceRight.call(this,e,t))},fr.prototype.toSorted=function(e){return fr.from(Array.prototype.toSorted.call(this,e))},fr.prototype.toSpliced=function(e,t,...r){return fr.from(Array.prototype.toSpliced.call(this,e,t,...r))},fr.prototype.toReversed=function(){return fr.from(Array.prototype.toReversed.apply(this))},fr.prototype.with=function(e,t){return fr.from(Array.prototype.with.call(this,e,t))},fr.prototype.toLocaleString=function(e,t){return Array.prototype.toLocaleString.call(this,e,t)},fr.prototype.toJSON=function(){return[...this]},fr.prototype.keys=function(){return Array.prototype.keys.apply(this)},fr.prototype.values=function(){return Array.prototype.values.apply(this)},fr.prototype.entries=function(){return Array.prototype.entries.apply(this)},fr.prototype[Symbol.iterator]=function(){return Array.prototype[Symbol.iterator].apply(this)},fr.from=function(e,t,r){const n=hr([]);return Array.prototype.push.apply(n,Array.from(e,t,r)),Object.freeze(n),n},fr.of=function(...e){return fr.from(e)},Object.defineProperties(fr.prototype,{length:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"length").get.apply(this)},enumerable:!0,configurable:!1},lastItem:{get:function(){return this[this.lastIndex]},enumerable:!0,configurable:!1},lastIndex:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"lastIndex").get.apply(this)},enumerable:!0,configurable:!1},[Symbol.toStringTag]:{value:"Tuple",enumerable:!0,configurable:!1,writable:!1}}),globalThis.Tuple=fr}if(!(JSON.parseImmutable instanceof Function)){function dr(e){return"object"==typeof e?null===e?null:Array.isArray(e)?Tuple.from(e.map((e=>dr(e)))):Record.fromEntries(Object.entries(e).map((([e,t])=>[e,dr(t)]))):e}JSON.parseImmutable=function(e){return JSON.parse(e,((e,t)=>dr(t)))}}if(!(RegExp.escape instanceof Function)){const mr=/[-[\]/{}()<>=#&!@%*+?.\\^$|;:"'`\s]/g;RegExp.escape=function(e){return e.toString().replace(mr,"\\$&")}}}();
55
+ */:globalThis.scheduler=new _e;const Ve={key:Symbol("key"),internals:Symbol("element-internals"),form:Symbol("form"),fieldset:Symbol("fieldset"),element:Symbol("element"),validity:Symbol("validity"),validationMessage:Symbol("validation-message"),value:Symbol("value"),state:Symbol("state"),formController:Symbol("form-controller"),anchor:Symbol("anchor"),customInputs:Symbol("custom-inputs")};if(!(HTMLElement.prototype.attachInternals instanceof Function)&&"FormDataEvent"in globalThis){const wt={valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1,customError:!1,valid:!0},vt=e=>e.hasOwnProperty(Ve.fieldset)&&e[Ve.fieldset]instanceof HTMLFieldSetElement&&e[Ve.fieldset].disabled,Tt=e=>e instanceof HTMLElement&&e.tagName.includes("-")&&customElements.get(e.tagName.toLowerCase()).formAssociated,Et=(e,t)=>function(r){if(r.target.reportValidity()){if(t.willValidate&&r.formData instanceof FormData){const n=t[Ve.value];n instanceof FormData?n.entries().forEach((([e,t])=>r.formData.set(e,t))):e.hasAttribute("name")&&r.formData.set(e.getAttribute("name"),t[Ve.value])}}else r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation()},St=(e,t)=>{Object.entries(t).forEach((([t,r])=>e.style.setProperty(t,r)))},At=e=>e.hasAttribute("form")&&document.forms[e.getAttribute("form")]||e.closest("form"),xt=(e,t,r)=>{if(e instanceof HTMLFormElement){if(!(r instanceof HTMLElement&&r.tagName.includes("-")))throw new TypeError("Not a custom element");if(!(t instanceof Ot||t instanceof globalThis.ElementInternals))throw new TypeError("Invalid ElementInternals");if(!Tt(r))throw new TypeError(`${r.tagName} is not form associated.`);if(!(r.formAssociatedCallback instanceof Function))throw new TypeError(`${r.tagName} is missing a formAssociatedCallback method.`);{const n=new AbortController,o=r.closest("fieldset");o instanceof Element&&(r[Ve.fieldset]=o,o.hasOwnProperty(Ve.customInputs)||(o[Ve.customInputs]=new Set),o[Ve.customInputs].add(r),Mt.observe(o,Lt)),t[Ve.form]=e,t[Ve.formController]=n;const{checkValidity:i,reportValidity:a}=e;e.reportValidity=function(){return!!a.call(this)&&t.reportValidity()},e.checkValidity=function(){return!!i.call(this)&&t.checkValidity()},n.signal.addEventListener("abort",(()=>{e.reportValidity=a,e.checkValidity=i}),{once:!0}),e.addEventListener("formdata",Et(r,t),{signal:n.signal}),e.addEventListener("submit",(e=>{e.target.reportValidity()||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation())}),{signal:n.signal}),r.formResetCallback instanceof Function&&e.addEventListener("reset",(()=>r.formResetCallback()),{signal:n.signal})}}else if(t[Ve.formController]instanceof AbortController&&t[Ve.formController].abort(),t[Ve.form]=null,t[Ve.formController]=null,r.hasOwnProperty(Ve.fieldset)){const e=r[Ve.fieldset];e.hasOwnProperty(Ve.customInputs)&&(e[Ve.customInputs].delete(r),0===e[Ve.customInputs.size]&&delete e[Ve.customInputs]),r[Ve.fieldset]=null}},Mt=new MutationObserver((e=>{e.forEach((({target:t,type:r,attributeName:n})=>{if("attributes"===r&&"disabled"===n){const r=t.hasAttribute("disabled");if(Tt(t)&&t.hasOwnProperty(Ve.internals)&&t[Ve.internals].states.has("--disabled")!==r&&(1===e.length?!vt(t):t.hasAttribute("disabled")===vt(t)&&e.some((e=>e.target.isSameNode(t[Ve.fieldset]))))){const e=t[Ve.internals];r?e.states.add("--disabled"):e.states.delete("--disabled"),t.formDisabledCallback instanceof Function&&t.formDisabledCallback(r)}else"FIELDSET"!==t.tagName||!t.hasOwnProperty(Ve.customInputs)||1!==e.length&&e.some((e=>t[Ve.customInputs].has(e.target)))||t[Ve.customInputs].forEach((e=>{e.isConnected&&e.hasOwnProperty(Ve.internals)?e.hasAttribute("disabled")||(r?e[Ve.internals].states.add("--disabled"):e[Ve.internals].states.delete("--disabled"),e.formDisabledCallback instanceof Function&&e.formDisabledCallback(r)):t[Ve.customInputs].delete(e)}))}}))})),Lt={attributes:!0,attributeFilter:["disabled"]};class Ot{constructor(e,t){if(t!==Ve.key)throw new TypeError("Illegal constructor");if(!(e instanceof HTMLElement))throw new TypeError("Must be called on an HTMLElement");if(!e.tagName.includes("-"))throw new DOMException("Cannot attach internals to a built-in element.");{const t=!0,r=!1,n=!0;Object.defineProperties(this,{[Ve.element]:{value:e,configurable:t,enumerable:r,writable:n},[Ve.form]:{value:null,configurable:t,enumerable:r,writable:n},[Ve.fieldset]:{value:null,configurable:t,enumerable:r,writable:n},[Ve.anchor]:{value:null,configurable:t,enumerable:r,writable:n},[Ve.validity]:{value:wt,configurable:t,enumerable:r,writable:n},[Ve.validationMessage]:{value:"",configurable:t,enumerable:r,writable:n},[Ve.value]:{value:null,configurable:t,enumerable:r,writable:n},[Ve.state]:{value:null,configurable:t,enumerable:r,writable:n},[Ve.formController]:{value:null,configurable:t,enumerable:r,writable:n}}),Tt(e)&&Mt.observe(e,Lt),Object.defineProperty(e,Ve.internals,{value:this,enumerable:!1,configurable:!1,writable:!1}),setTimeout((()=>this.states.add("--element-internals-polyfilled")),10)}}get form(){return this[Ve.form]}get labels(){const e=this.form;return e instanceof HTMLFormElement&&0!==this[Ve.element].id.length?e.querySelectorAll(`label[for="${this[Ve.element].id}"]`):document.createDocumentFragment().childNodes}get _polyfilled(){return!0}get shadowRoot(){return this[Ve.element].shadowRoot}get validity(){return Tt(this[Ve.element])?this[Ve.validity]:void 0}get validationMessage(){return Tt(this[Ve.element])?this[Ve.validationMessage]||"":void 0}get willValidate(){const e=this[Ve.element];return Tt(e)&&!vt(e)&&!["disabled","readonly"].some((t=>e.hasAttribute(t)))}checkValidity(){if(this.willValidate){if(this.validity.valid){const e=this[Ve.element].nextElementSibling;return e instanceof HTMLElement&&e.classList.contains("_element-internals-popup")&&e.remove(),!0}return this[Ve.element].dispatchEvent(new Event("invalid")),!1}return!0}reportValidity(){if(this.checkValidity())return!0;{const e=this.validationMessage;if("string"==typeof e&&0!==e.length){const{bottom:t,left:r}=this[Ve.element].getBoundingClientRect(),n=document.createElement("div");n.textContent=e,St(n,{position:"fixed","background-color":"#2b2a33",color:"#fafafa",top:`${t+2}px`,left:`${r}px`,"z-index":2147483647,"color-scheme":"light-dark","font-family":"system-ui, serif","font-size":"18px",display:"inline-block",padding:"0.6em 0.8em",border:"1px solid #1a1a1a","border-radius":"6px"}),n.classList.add("_element-internals-popup"),this[Ve.element].focus();const o=this[Ve.element].nextElementSibling;o instanceof Element&&o.classList.contains("_element-internals-popup")&&o.remove(),this[Ve.element].insertAdjacentElement("afterend",n),this[Ve.anchor]instanceof Element&&this[Ve.anchor].focus(),setTimeout((()=>{n.isConnected&&n.remove()}),3e3)}return!1}}setFormValue(e,t){if(!Tt(this[Ve.element]))throw new DOMException("Not form associated");this[Ve.value]=e,this[Ve.state]=t}setValidity({valueMissing:e=!1,typeMismatch:t=!1,patternMismatch:r=!1,tooLong:n=!1,tooShort:o=!1,rangeUnderflow:i=!1,rangeOverflow:a=!1,stepMismatch:s=!1,badInput:l=!1,customError:c=!1},u="",p){if(!Tt(this[Ve.element]))throw new DOMException("Not form associated");if(("string"!=typeof u||0===u.length)&&(e||t||r||n||o||i||a||s||l||c))throw new DOMException("Message required if any flags are true.");{const h=[e,t,r,n,o,i,a,s,l,c].every((e=>!1===e));this[Ve.validity]={valueMissing:e,typeMismatch:t,patternMismatch:r,tooLong:n,tooShort:o,rangeUnderflow:i,rangeOverflow:a,stepMismatch:s,badInput:l,customError:c,valid:h},this[Ve.validationMessage]=u,this[Ve.anchor]=p,h?(this.states.delete("--invalid"),this.states.add("--valid")):(this.states.add("--invalid"),this.states.delete("--valid"),this[Ve.element].dispatchEvent(new Event("invalid")))}}_associateForm(e,t){xt(e,this,t)}_findAssociatedForm(e){return At(e)}}HTMLElement.prototype.attachInternals=function(){if(this.hasOwnProperty(Ve.internals))throw new DOMException("Invalid operation");if(this.tagName.includes("-"))return new Ot(this,Ve.key);throw new DOMException("Cannot call attachInternals on built-in elements.")},globalThis.ElementInternals=Ot}if("ElementInternals"in globalThis&&!("CustomStateSet"in globalThis)){const kt="_state",Pt=new WeakMap,Ft=e=>{if(e.toString().startsWith("--"))return`${kt}${e}`;throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value '${e}' must start with '--'.`)},{value:Rt,writable:jt,configurable:It,enumerable:Nt}=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"attachInternals");class Ct{constructor(e,t){if(t!==Ve.key)throw new TypeError("Illegal Constructor");if(!(e instanceof HTMLElement))throw new TypeError("el must be an HTMLElement");Pt.set(this,e),this.add("--custom-states-polyfilled")}get _polyfilled(){return!0}get size(){return[...this.values()].length}add(e){Pt.get(this).classList.add(Ft(e))}has(e){return Pt.get(this).classList.contains(Ft(e))}delete(e){const t=Ft(e);return!!Pt.get(this).classList.contains(t)&&(Pt.get(this).classList.remove(t),!0)}clear(){this.values().forEach((e=>this.delete(e)))}keys(){return this.values()}values(){return Pt.get(this).classList.values().filter((e=>e.startsWith(`${kt}--`))).map((e=>e.substr(kt.length)))}entries(){return this.values().map((e=>[e,e]))}forEach(e,t){this.values().forEach((r=>e.call(t||this,r,r,this)))}[Symbol.toStringTag](){return"CustomStateSet"}[Symbol.iterator](){return this.values()}}Object.defineProperty(HTMLElement.prototype,"attachInternals",{value:function(){const e=Rt.call(this);return Object.defineProperty(e,Ve.element,{value:this,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(e,"states",{value:new Ct(this,Ve.key),configurable:!0,enumberable:!0}),Object.is(e.shadowRoot,null)&&!Object.is(this.shadowRoot,null)&&Object.defineProperty(e,"shadowRoot",{value:this.shadowRoot,configurable:!0,enumerable:!0}),e},writable:jt,configurable:It,enumerable:Nt}),globalThis.CustomStateSet=Ct,function(e){const t=Object.fromEntries(Object.keys(ne).map((e=>[e,{get:function(){return this[Ve.element][e]},set:function(t){this[Ve.element][e]=t},enumerable:!0,configurable:!0}])));Object.defineProperties(e,t)}(ElementInternals.prototype)}if(l(Blob.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),l(Request.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),l(Response,"json",((e,{status:t=200,statusText:r="",headers:n=new Headers}={})=>n instanceof Headers?(n.set("Content-Type","application/json"),new Response(JSON.stringify(e),{status:t,statusText:r,headers:n})):Response.json(e,{status:t,statusText:r,headers:new Headers(n)}))),l(Response,"redirect",((e,t=302)=>new Response(null,{status:t,headers:new Headers({Location:e})}))),l(Response.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),!(globalThis.Record instanceof Function)){function Ut(e){if(new.target===Ut)throw new TypeError("Record is not a constructor");const t=Object.create(Ut.prototype);return Object.defineProperties(t,Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{enumerable:!0,configurable:!1,writable:!1,value:t}])))),Object.freeze(t),t}Ut.prototype.constructor=Ut,Object.defineProperty(Ut.prototype,Symbol.toStringTag,{value:"Record",enumerable:!0,configurable:!1,writable:!1}),Ut.fromEntries=function(e){return Ut(Object.fromEntries(e))},globalThis.Record=Ut}if(!(globalThis.Tuple instanceof Function)){const Ht=e=>{const t=Array.apply(Object.create(Dt.prototype),e);return Object.setPrototypeOf(t,Dt.prototype),t};function Dt(...e){if(new.target===Dt)throw new TypeError("Tuple is not a constructor");const t=Ht(e);return Object.freeze(t),t}Dt.prototype.forEach=function(e,t){Array.prototype.forEach.call(this,e,t)},Dt.prototype.join=function(e=","){return Array.prototype.join.call(this,e)},Dt.prototype.concat=function(...e){return Dt(...this,...e)},Dt.prototype.slice=function(e,t){return Dt.from(Array.prototype.slice.call(this,e,t))},Dt.prototype.indexOf=function(e,t){return Array.prototype.indexOf.call(this,e,t)},Dt.prototype.lastIndexOf=function(e,t){return Array.prototype.lastIndexOf.call(this,e,t)},Dt.prototype.findIndex=function(e,t){return Array.prototype.findIndex.call(this,e,t)},Dt.prototype.find=function(e,t){return Array.prototype.find.call(this,e,t)},Dt.prototype.findLast=function(e,t){return Array.prototype.findLast.call(this,e,t)},Dt.prototype.findLastIndex=function(e,t){return Array.prototype.findLastIndex.call(this,e,t)},Dt.prototype.every=function(e,t){return Array.prototype.every.call(this,e,t)},Dt.prototype.some=function(e,t){return Array.prototype.some.call(this,e,t)},Dt.prototype.includes=function(e,t){return Array.prototype.includes.call(this,e,t)},Dt.prototype.map=function(e,t){return Dt.from(Array.prototype.map.call(this,e,t))},Dt.prototype.filter=function(e,t){return Dt.from(Array.prototype.filter.call(this,e,t))},Dt.prototype.flat=function(e){return Dt.from(Array.prototype.flat.call(this,e))},Dt.prototype.flatMap=function(e,t){return Dt.from(Array.prototype.flatMap.call(this,e,t))},Dt.prototype.at=function(e){return Array.prototype.at.call(this,e)},Dt.prototype.reduce=function(e,t){return Dt.from(Array.prototype.reduce.call(this,e,t))},Dt.prototype.reduceRight=function(e,t){return Dt.from(Array.prototype.reduceRight.call(this,e,t))},Dt.prototype.toSorted=function(e){return Dt.from(Array.prototype.toSorted.call(this,e))},Dt.prototype.toSpliced=function(e,t,...r){return Dt.from(Array.prototype.toSpliced.call(this,e,t,...r))},Dt.prototype.toReversed=function(){return Dt.from(Array.prototype.toReversed.apply(this))},Dt.prototype.with=function(e,t){return Dt.from(Array.prototype.with.call(this,e,t))},Dt.prototype.toLocaleString=function(e,t){return Array.prototype.toLocaleString.call(this,e,t)},Dt.prototype.toJSON=function(){return[...this]},Dt.prototype.keys=function(){return Array.prototype.keys.apply(this)},Dt.prototype.values=function(){return Array.prototype.values.apply(this)},Dt.prototype.entries=function(){return Array.prototype.entries.apply(this)},Dt.prototype[Symbol.iterator]=function(){return Array.prototype[Symbol.iterator].apply(this)},Dt.from=function(e,t,r){const n=Ht([]);return Array.prototype.push.apply(n,Array.from(e,t,r)),Object.freeze(n),n},Dt.of=function(...e){return Dt.from(e)},Object.defineProperties(Dt.prototype,{length:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"length").get.apply(this)},enumerable:!0,configurable:!1},lastItem:{get:function(){return this[this.lastIndex]},enumerable:!0,configurable:!1},lastIndex:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"lastIndex").get.apply(this)},enumerable:!0,configurable:!1},[Symbol.toStringTag]:{value:"Tuple",enumerable:!0,configurable:!1,writable:!1}}),globalThis.Tuple=Dt}if(!(JSON.parseImmutable instanceof Function)){function $t(e){return"object"==typeof e?null===e?null:Array.isArray(e)?Tuple.from(e.map((e=>$t(e)))):Record.fromEntries(Object.entries(e).map((([e,t])=>[e,$t(t)]))):e}JSON.parseImmutable=function(e){return JSON.parse(e,((e,t)=>$t(t)))}}if(!(RegExp.escape instanceof Function)){const qt=/[-[\]/{}()<>=#&!@%*+?.\\^$|;:"'`\s]/g;RegExp.escape=function(e){return e.toString().replace(qt,"\\$&")}}}();
56
56
  //# sourceMappingURL=browser.min.js.map