@shgysk8zer0/polyfills 0.5.3 → 0.5.6

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/iterator.js CHANGED
@@ -5,7 +5,7 @@
5
5
  const supported = 'Iterator' in globalThis;
6
6
 
7
7
  const IteratorPrototype = supported
8
- ? Object.getPrototypeOf(globalThis.Iterator)
8
+ ? globalThis.Iterator.prototype
9
9
  : Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
10
10
 
11
11
  const Iterator = supported
@@ -15,6 +15,10 @@ const Iterator = supported
15
15
  [Symbol.iterator]() {
16
16
  return this;
17
17
  }
18
+
19
+ get [Symbol.toStringTag]() {
20
+ return 'Iterator';
21
+ }
18
22
  }
19
23
 
20
24
  Object.setPrototypeOf(Iterator, proto);
package/node.cjs CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";if(!("AbortSignal"in globalThis)){const t={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,{[t.aborted]:{enumerable:!1,writable:!0,configurable:!1,value:!1},[t.reason]:{enumerable:!1,writable:!0,configurable:!1,value:void 0},[t.onabort]:{enumerable:!1,writable:!0,configurable:!1,value:null}}),this.addEventListener("abort",t=>{this.onabort instanceof Function&&this.onabort.call(this,t)})}get aborted(){return this[t.aborted]}get onabort(){return this[t.onabort]}set onabort(e){this[t.onabort]=e instanceof Function?e:null}get reason(){return this[t.reason]}throwIfAborted(){if(this.aborted)throw this.reason}static abort(r=new DOMException("Operation aborted")){const n=new e;return n[t.aborted]=!0,n[t.reason]=r,n}},globalThis.AbortController=class{constructor(){this[t.signal]=new AbortSignal}get signal(){return this[t.signal]}abort(e=new DOMException("Operation aborted")){const r=this.signal;r.aborted||(r[t.aborted]=!0,r[t.reason]=e,r.dispatchEvent(new Event("abort")))}}}if(!("reason"in AbortSignal.prototype)){const t=new WeakMap,e=AbortController.prototype.abort;if(AbortSignal.abort instanceof Function){const e=AbortSignal.abort;AbortSignal.abort=function(r=new DOMException("Operation aborted")){const n=e();return t.set(n,r),n}}else AbortSignal.abort=function(t=new DOMException("Operation aborted")){const e=new AbortController;return e.abort(t),e.reason};Object.defineProperty(AbortSignal.prototype,"reason",{enumerable:!0,configurable:!0,get:function(){return t.has(this)?t.get(this):void 0}}),AbortController.prototype.abort=function(r=new DOMException("Operation aborted")){t.set(this.signal,r),e.call(this)}}AbortSignal.prototype.throwIfAborted instanceof Function||(AbortSignal.prototype.throwIfAborted=function(){if(this.aborted)throw this.reason}),AbortSignal.timeout instanceof Function||(AbortSignal.timeout=function(t){if(void 0===t)throw new TypeError("At least one 1 argument required but only 0 passed");if(Number.isFinite(t)){if(t<0)throw new TypeError("Argument 1 is out of range for unsigned long long.");{const e=new AbortController;return setTimeout(()=>e.abort(new DOMException("The operation timed out.")),t),e.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(t){if(!Array.isArray(t))throw new TypeError("Expected an array of signals");const e=new AbortController;for(const r of t){if(!(r instanceof AbortSignal)){const t=new TypeError("`signal` is not an `AbortSignal`");throw e.abort(t),t}if(r.aborted){e.abort(r.reason||new DOMException("Operation aborted."));break}r.addEventListener("abort",({target:t})=>{e.abort(t.reason||new DOMException("Operation aborted."))},{signal:e.signal})}return e.signal});const t=[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(t=1){const e=[];t=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,t));const r=(t,n)=>{Array.isArray(t)&&n>=0?t.forEach(t=>r(t,n-1)):e.push(t)};return r(this,Number.isNaN(t)?0:t),e}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(t,e){return this.map(t,e).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(t,e){let r;return this.forEach((n,o,i)=>{t.call(e,n,o,i)&&(r=n)},e),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(t){this[this.lastIndex]=t}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(t,e){let r=-1;return this.forEach((n,o,i)=>{t.call(e,n,o,i)&&(r=o)},e),r}),!(Array.prototype.at instanceof Function)){const e=function(t){if((t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]};for(const r of t)void 0!==r&&Object.defineProperty(r.prototype,"at",{value:e,writable:!0,enumerable:!1,configurable:!0})}function e(t,e,r,{writable:n=!0,enumerable:o=!0,configurable:i=!0}={}){t[e]instanceof Function||Object.defineProperty(t,e,{value:r,writable:n,enumerable:o,configurable:i})}if(!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(t){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,t)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(t){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,t)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(t){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,t)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(t){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,t)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(t,e,r=globalThis){let n=[];for await(const e of t)n.push(await e);return Array.from(n,e,r)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(t){return this===t||!!Array.isArray(t)&&(this.length===t.length&&this.every((e,r)=>{const n=t[r];return Array.isArray(e)?Array.isArray(n)&&e.equals(n):Object.is(e,n)}))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(t){switch(typeof t){case"undefined":return[...new Set(this)];case"string":case"number":case"symbol":return this.uniqueBy(e=>e[t]);case"function":{const e=new Set;return this.filter((...r)=>{const n=t.apply(this,r);return!e.has(n)&&(e.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(t){return[...this].sort(t)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(t,e,...r){const n=[...this];return n.splice(t,e,...r),n}),Array.prototype.with instanceof Function||(Array.prototype.with=function(t,e){const r=[...this];return r[t]=e,r}),Array.isTemplateObject instanceof Function||(Array.isTemplateObject=function(t){return!!(Array.isArray(t)&&Array.isArray(t.raw)&&Object.isFrozen(t)&&Object.isFrozen(t.raw))&&(0!==t.length&&t.length===t.raw.length)}),Uint8Array.prototype.toHex instanceof Function||(Uint8Array.prototype.toHex=function(){return Array.from(this,t=>t.toString(16).padStart(2,"0")).join("")}),Uint8Array.prototype.toBase64 instanceof Function||(Uint8Array.prototype.toBase64=function({alphabet:t="base64"}={}){if("base64"===t){const t=32768;let e="";for(let r=0;r<this.length;r+=t){const n=this.subarray(r,r+t);e+=String.fromCharCode.apply(null,n)}return btoa(e)}if("base64url"===t)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(t){if("string"!=typeof t)throw new TypeError("expected input to be a string");if(0===!(1&t.length))throw new SyntaxError("string should be an even number of characters");return Uint8Array.from(globalThis.Iterator.range(0,t.length,{step:2}),e=>parseInt(t.substring(e,e+2),16))}),Uint8Array.fromBase64 instanceof Function||(Uint8Array.fromBase64=function(t,{alphabet:e="base64",lastChunkHandling:r="loose"}={}){if("string"!=typeof t)throw new TypeError("expected input to be a string");if(!["base64","base64url"].includes(e))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"!==e)return Uint8Array.fromBase64(t.replaceAll("-","+").replaceAll("_","/"),{alphabet:"base64"});{const e=t.length%4;if(1===e)throw new TypeError("Invalid string length.");if(0===e)return Uint8Array.from(atob(t),t=>t.charCodeAt(0));switch(r){case"strict":throw new SyntaxError("Missing padding.");case"loose":return Uint8Array.fromBase64(t.padEnd(t.length+(4-e),"="),{alphabet:"base64",lastChunkHandling:"strict"});case"stop-before-partial":return Uint8Array.fromBase64(t.slice(0,t.length-e),{alphabet:"base64",lastChunkHandling:"strict"})}}}),e(Blob.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())}),globalThis.hasOwnProperty("AggregateError")||(globalThis.AggregateError=class extends Error{constructor(t,e){void 0===e?(super(t),this.errors=[]):(super(e),this.errors=t)}}),globalThis.reportError instanceof Function||(globalThis.reportError=function(t){globalThis.dispatchEvent(function(t,e="error"){if(t instanceof Error){const{message:r,name:n,fileName:o,lineNumber:i,columnNumber:a}=t;return new ErrorEvent(e,{error:t,message:`${n}: ${r}`,filename:o,lineno:i,colno:a})}throw new TypeError("`errorToEvent()` only accepts Errors")}(t))}),!(Error.isError instanceof Function)){const t=Function.bind.call(Function.call,Object.prototype.toString);Error.isError=function(e){return e instanceof Error||"object"==typeof e&&"[object Error]"===t(e)&&void 0===e[Symbol.toStringTag]}}!function(){if(!(Function.prototype.once instanceof Function)){const t=new WeakMap;Function.prototype.once=function(e){const r=this;return function(...n){if(t.has(r))return t.get(r);if("AsyncFunction"===r.constructor.name){const o=r.apply(e||r,n).catch(e=>{throw t.delete(r),e});return t.set(r,o),o}if(r instanceof Function){const o=r.apply(e||r,n);return t.set(r,o),o}}}}}();const r="Iterator"in globalThis,n=r?Object.getPrototypeOf(globalThis.Iterator):Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),o=r?globalThis.Iterator:(t=>{class e{[Symbol.iterator](){return this}}return Object.setPrototypeOf(e,t),e})(n);var i;if(o.range instanceof Function||(o.range=function(t,e,r){if("number"==typeof r||"bigint"==typeof r)return o.range(t,e,{step:r});if("object"!=typeof r||Object.is(r,null))return o.range(t,e,{});{const{step:n=("number"==typeof t?t<e?1:-1:t<e?1n:-1n),inclusive:i=!1}=r;if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("Start must be a number");if(Number.isNaN(t))throw new RangeError("Invalid start");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("End must be a number");if(Number.isNaN(e))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&&t<e||n>0&&t>e)return;if(i){let r=t;return n>0?o.from({next(){const t=r<=e?{value:r,done:!1}:{done:!0};return r+=n,t}}):o.from({next(){const t=r>=e?{value:r,done:!1}:{done:!0};return r+=n,t}})}{let r=t;if(n>0)return o.from({next(){const t=r<e?{value:r,done:!1}:{done:!0};return r+=n,t}});{let r=t;return o.from({next(){const t=r>e?{value:r,done:!1}:{done:!0};return r+=n,t}})}}}}),n[Symbol.toStringTag]||(n[Symbol.toStringTag]="Iterator"),n.take instanceof Function||(n.take=function(t){let e=0;const r=this;return o.from({next:()=>e++>=t?{done:!0}:r.next()})}),n.drop instanceof Function||(n.drop=function(t){for(let e=0;e<t;e++){const{done:t}=this.next();if(t)break}return this}),n.toArray instanceof Function||(n.toArray=function(){return Array.from(this)}),n.forEach instanceof Function||(n.forEach=function(t){for(const e of this)t.call(this,e)}),n.flatMap instanceof Function||(n.flatMap=function(t){const e=this;let r=this.next();const n=({value:r,done:n=!0}={})=>n?o.from({next:()=>({done:!0})}):o.from(t.call(e,r));let i=n(r);return o.from({next(){const{value:t,done:o=!0}=i.next();return r.done&&o?{done:!0}:o?r.done?{done:!0}:(r=e.next(),i=n(r),i.next()):{value:t,done:o}}})}),n.map instanceof Function||(n.map=function(t){const e=this;return o.from({next(){const{done:r,value:n}=e.next();return r?{done:r}:{value:t.call(e,n),done:!1}}})}),n.reduce instanceof Function||(n.reduce=function(t,e){let r=void 0===e?this.next().value:e;for(const e of this)r=t.call(this,r,e);return r}),n.filter instanceof Function||(n.filter=function(t){const e=this;let r,n=!1;return o.from({next(){for(;!n;){const o=e.next();if(n=o.done,n)break;if(t.call(e,o.value)){r=o.value;break}}return{done:n,value:r}}})}),n.some instanceof Function||(n.some=function(t){let e=!1;for(const r of this)if(t.call(this,r)){e=!0;break}return e}),n.every instanceof Function||(n.every=function(t){let e=!0;for(const r of this)if(!t.call(this,r)){e=!1;break}return e}),n.find instanceof Function||(n.find=function(t){for(const e of this)if(t.call(this,e))return e}),n.indexed instanceof Function||(n.indexed=function(){let t=0;return this.map(e=>[t++,e])}),n.chunks instanceof Function||(n.chunks=function(t){if(!Number.isSafeInteger(t)||t<1)throw new TypeError("Size must be a positive integer.");{const e=this;let r=!1;return o.from({next(){if(r)return{done:r};{const n=[];let o=0;for(;o++<t&&!r;){const t=e.next();if(t.done){r=!0,void 0!==t.value&&n.push(t.value);break}n.push(t.value)}return{value:n,done:!1}}}})}}),o.from instanceof Function||(o.from=function(t){if("object"!=typeof t||null===t)throw new TypeError("Not an object.");if(t.next instanceof Function){return Object.create(n,{next:{enumerable:!0,configurable:!1,writable:!1,value:(...e)=>t.next(...e)}})}if(t[Symbol.iterator]instanceof Function)return o.from(t[Symbol.iterator]())}),r||(globalThis.Iterator=o),e(ReadableStream,"from",function(t){if(t[Symbol.iterator]instanceof Function)return new ReadableStream({start(e){try{for(const r of t)e.enqueue(r)}catch(t){e.error(t)}finally{e.close()}}});if(t[Symbol.asyncIterator]instanceof Function)return new ReadableStream({async start(e){try{for await(const r of t)e.enqueue(r)}catch(t){e.error(t)}finally{e.close()}}});throw new TypeError("`ReadableStream.from()` requires an iterable source.")}),Map.prototype.getOrInsert instanceof Function||(Map.prototype.getOrInsert=function(t,e){return this.has(t)?this.get(t):(this.set(t,e),e)},Map.prototype.getOrInsertComputed=function(t,e){if(this.has(t))return this.get(t);{const r=e(t);return this.set(t,r),r}}),WeakMap.prototype.getOrInsert instanceof Function||(WeakMap.prototype.getOrInsert=function(t,e){return Map.prototype.getOrInsert.call(this,t,e)},WeakMap.prototype.getOrInsertComputed=function(t,e){return WeakMap.prototype.getOrInsertComputed.call(this,t,e)}),Map.groupBy instanceof Function||(Map.groupBy=function(t,e){return Array.from(t).reduce((t,r,n)=>(t.emplace(e.call(t,r,n),{insert:()=>[r],update:t=>(t.push(r),t)}),t),new Map)}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(t,{insert:e,update:r}={}){console.warn("`Map.prototype.emplace()` has been removed from the proposal and will be removed in the future.");const n=this.has(t);if(n&&r instanceof Function){const e=this.get(t),n=r.call(this,e,t,this);return n!==e&&this.set(t,n),n}if(n)return this.get(t);if(e instanceof Function){const r=e.call(this,t,this);return this.set(t,r),r}throw new Error("Key is not found and no `insert()` given")}),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=t=>t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=t=>(t>0)-(t<0)||+t),Math.hasOwnProperty("trunc")||(Math.trunc=t=>{const e=t-t%1;return 0===e&&(t<0||0===t&&1/t!=1/0)?-0:e}),Math.hasOwnProperty("expm1")||(Math.expm1=t=>Math.exp(t)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...t)=>Math.sqrt(t.reduce((t,e)=>t+e**2,0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=t=>t**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=t=>Math.log(t)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=t=>Math.log(t)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=t=>Math.log(1+t)),Math.hasOwnProperty("fround")||(Math.fround=(i=new Float32Array(1),function(t){return i[0]=t,i[0]})),Math.clamp instanceof Function||(Math.clamp=function(t,e,r){return Math.min(Math.max(t,e),r)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),Math.sumPrecise instanceof Function||(Math.sumPrecise=function(t){let e=-0;for(const r of t){if(!Number.isFinite(r)){e=-0;break}e+=r}return e}),Math.sum instanceof Function||(Math.sum=function(...t){return console.warn("Math.sum is deprecated. Please use Math.sumPrecise instead."),Math.sumPrecise(t)}),Object.groupBy instanceof Function||(Object.groupBy=function(t,e){return Array.from(t).reduce((t,r,n)=>{const o=e.call(t,r,n);return t.hasOwnProperty(o)?t[o].push(r):t[o]=[r],t},{})}),function(){if(!(globalThis.requestIdleCallback instanceof Function)){const t=t=>Number.isSafeInteger(t)&&t>0;globalThis.requestIdleCallback=function(e,{timeout:r}={}){const n=performance.now(),o=()=>t(r)?Math.max(0,r-(performance.now()-n)):Math.max(0,600-(performance.now()-n));return setTimeout(()=>e({didTimeout:!!t(r)&&0===o(),timeRemaining:o}),1)}}globalThis.cancelIdleCallback instanceof Function||(globalThis.cancelIdleCallback=t=>clearTimeout(t)),globalThis.requestAnimationFrame instanceof Function||(globalThis.requestAnimationFrame=t=>setTimeout(()=>t(performance.now()),1e3/60)),globalThis.cancelAnimationFrame instanceof Function||(globalThis.cancelAnimationFrame=t=>clearTimeout(t)),globalThis.queueMicrotask instanceof Function||(globalThis.queueMicrotask=t=>Promise.resolve().then(t).catch(t=>setTimeout(()=>{throw t})))}(),"Promise"in globalThis&&(Promise.prototype.finally instanceof Function||(Promise.prototype.finally=function(t){return this.then(async e=>(await t(),e),async e=>(await t(),e))}),Promise.allSettled instanceof Function||(Promise.allSettled=function(t){return Promise.all(Array.from(t).map(function(t){return new Promise(function(e){t instanceof Promise||(t=Promise.resolve(t)),t.then(function(t){e({status:"fulfilled",value:t})}).catch(function(t){e({status:"rejected",reason:t})})})}))}),Promise.any instanceof Function||(Promise.any=t=>new Promise((e,r)=>{let n=[];t.forEach(o=>{o.then(e).catch(e=>{n.push(e),n.length===t.length&&r(new globalThis.AggregateError(n,"No Promise in Promise.any was resolved"))})})})),Promise.race instanceof Function||(Promise.race=t=>new Promise((e,r)=>{t.forEach(t=>t.then(e,r))})),Promise.try instanceof Function||(Promise.try=(t,...e)=>new Promise(r=>r(t(...e)))),Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}),Promise.fromEntries instanceof Function||(Promise.fromEntries=async function(t){const e=[],r=[];for(const[n,o]of t)e.push(n),r.push(o);return await Promise.all(r).then(t=>Object.fromEntries(t.map((t,r)=>[e[r],t])))}),Promise.ownProperties instanceof Function||(Promise.ownProperties=async function(t){return await Promise.fromEntries(Object.entries(t))})),!(RegExp.escape instanceof Function)){const t=/[-[\]/{}()<>=#&!@%*+?.\\^$|;:"'`\s]/g;RegExp.escape=function(e){return e.toString().replace(t,"\\$&")}}e(Request.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())}),e(Response,"json",(t,{status:e=200,statusText:r="",headers:n=new Headers}={})=>n instanceof Headers?(n.set("Content-Type","application/json"),new Response(JSON.stringify(t),{status:e,statusText:r,headers:n})):Response.json(t,{status:e,statusText:r,headers:new Headers(n)})),e(Response,"redirect",(t,e=302)=>new Response(null,{status:e,headers:new Headers({Location:t})})),e(Response.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())});
1
+ "use strict";if(!("AbortSignal"in globalThis)){const t={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,{[t.aborted]:{enumerable:!1,writable:!0,configurable:!1,value:!1},[t.reason]:{enumerable:!1,writable:!0,configurable:!1,value:void 0},[t.onabort]:{enumerable:!1,writable:!0,configurable:!1,value:null}}),this.addEventListener("abort",t=>{this.onabort instanceof Function&&this.onabort.call(this,t)})}get aborted(){return this[t.aborted]}get onabort(){return this[t.onabort]}set onabort(e){this[t.onabort]=e instanceof Function?e:null}get reason(){return this[t.reason]}throwIfAborted(){if(this.aborted)throw this.reason}static abort(r=new DOMException("Operation aborted")){const n=new e;return n[t.aborted]=!0,n[t.reason]=r,n}},globalThis.AbortController=class{constructor(){this[t.signal]=new AbortSignal}get signal(){return this[t.signal]}abort(e=new DOMException("Operation aborted")){const r=this.signal;r.aborted||(r[t.aborted]=!0,r[t.reason]=e,r.dispatchEvent(new Event("abort")))}}}if(!("reason"in AbortSignal.prototype)){const t=new WeakMap,e=AbortController.prototype.abort;if(AbortSignal.abort instanceof Function){const e=AbortSignal.abort;AbortSignal.abort=function(r=new DOMException("Operation aborted")){const n=e();return t.set(n,r),n}}else AbortSignal.abort=function(t=new DOMException("Operation aborted")){const e=new AbortController;return e.abort(t),e.reason};Object.defineProperty(AbortSignal.prototype,"reason",{enumerable:!0,configurable:!0,get:function(){return t.has(this)?t.get(this):void 0}}),AbortController.prototype.abort=function(r=new DOMException("Operation aborted")){t.set(this.signal,r),e.call(this)}}AbortSignal.prototype.throwIfAborted instanceof Function||(AbortSignal.prototype.throwIfAborted=function(){if(this.aborted)throw this.reason}),AbortSignal.timeout instanceof Function||(AbortSignal.timeout=function(t){if(void 0===t)throw new TypeError("At least one 1 argument required but only 0 passed");if(Number.isFinite(t)){if(t<0)throw new TypeError("Argument 1 is out of range for unsigned long long.");{const e=new AbortController;return setTimeout(()=>e.abort(new DOMException("The operation timed out.")),t),e.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(t){if(!Array.isArray(t))throw new TypeError("Expected an array of signals");const e=new AbortController;for(const r of t){if(!(r instanceof AbortSignal)){const t=new TypeError("`signal` is not an `AbortSignal`");throw e.abort(t),t}if(r.aborted){e.abort(r.reason||new DOMException("Operation aborted."));break}r.addEventListener("abort",({target:t})=>{e.abort(t.reason||new DOMException("Operation aborted."))},{signal:e.signal})}return e.signal});const t=[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(t=1){const e=[];t=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,t));const r=(t,n)=>{Array.isArray(t)&&n>=0?t.forEach(t=>r(t,n-1)):e.push(t)};return r(this,Number.isNaN(t)?0:t),e}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(t,e){return this.map(t,e).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(t,e){let r;return this.forEach((n,o,i)=>{t.call(e,n,o,i)&&(r=n)},e),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(t){this[this.lastIndex]=t}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(t,e){let r=-1;return this.forEach((n,o,i)=>{t.call(e,n,o,i)&&(r=o)},e),r}),!(Array.prototype.at instanceof Function)){const e=function(t){if((t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]};for(const r of t)void 0!==r&&Object.defineProperty(r.prototype,"at",{value:e,writable:!0,enumerable:!1,configurable:!0})}function e(t,e,r,{writable:n=!0,enumerable:o=!0,configurable:i=!0}={}){t[e]instanceof Function||Object.defineProperty(t,e,{value:r,writable:n,enumerable:o,configurable:i})}if(!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(t){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,t)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(t){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,t)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(t){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,t)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(t){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,t)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(t,e,r=globalThis){let n=[];for await(const e of t)n.push(await e);return Array.from(n,e,r)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(t){return this===t||!!Array.isArray(t)&&(this.length===t.length&&this.every((e,r)=>{const n=t[r];return Array.isArray(e)?Array.isArray(n)&&e.equals(n):Object.is(e,n)}))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(t){switch(typeof t){case"undefined":return[...new Set(this)];case"string":case"number":case"symbol":return this.uniqueBy(e=>e[t]);case"function":{const e=new Set;return this.filter((...r)=>{const n=t.apply(this,r);return!e.has(n)&&(e.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(t){return[...this].sort(t)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(t,e,...r){const n=[...this];return n.splice(t,e,...r),n}),Array.prototype.with instanceof Function||(Array.prototype.with=function(t,e){const r=[...this];return r[t]=e,r}),Array.isTemplateObject instanceof Function||(Array.isTemplateObject=function(t){return!!(Array.isArray(t)&&Array.isArray(t.raw)&&Object.isFrozen(t)&&Object.isFrozen(t.raw))&&(0!==t.length&&t.length===t.raw.length)}),Uint8Array.prototype.toHex instanceof Function||(Uint8Array.prototype.toHex=function(){return Array.from(this,t=>t.toString(16).padStart(2,"0")).join("")}),Uint8Array.prototype.toBase64 instanceof Function||(Uint8Array.prototype.toBase64=function({alphabet:t="base64"}={}){if("base64"===t){const t=32768;let e="";for(let r=0;r<this.length;r+=t){const n=this.subarray(r,r+t);e+=String.fromCharCode.apply(null,n)}return btoa(e)}if("base64url"===t)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(t){if("string"!=typeof t)throw new TypeError("expected input to be a string");if(0===!(1&t.length))throw new SyntaxError("string should be an even number of characters");return Uint8Array.from(globalThis.Iterator.range(0,t.length,{step:2}),e=>parseInt(t.substring(e,e+2),16))}),Uint8Array.fromBase64 instanceof Function||(Uint8Array.fromBase64=function(t,{alphabet:e="base64",lastChunkHandling:r="loose"}={}){if("string"!=typeof t)throw new TypeError("expected input to be a string");if(!["base64","base64url"].includes(e))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"!==e)return Uint8Array.fromBase64(t.replaceAll("-","+").replaceAll("_","/"),{alphabet:"base64"});{const e=t.length%4;if(1===e)throw new TypeError("Invalid string length.");if(0===e)return Uint8Array.from(atob(t),t=>t.charCodeAt(0));switch(r){case"strict":throw new SyntaxError("Missing padding.");case"loose":return Uint8Array.fromBase64(t.padEnd(t.length+(4-e),"="),{alphabet:"base64",lastChunkHandling:"strict"});case"stop-before-partial":return Uint8Array.fromBase64(t.slice(0,t.length-e),{alphabet:"base64",lastChunkHandling:"strict"})}}}),e(Blob.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())}),globalThis.hasOwnProperty("AggregateError")||(globalThis.AggregateError=class extends Error{constructor(t,e){void 0===e?(super(t),this.errors=[]):(super(e),this.errors=t)}}),globalThis.reportError instanceof Function||(globalThis.reportError=function(t){globalThis.dispatchEvent(function(t,e="error"){if(t instanceof Error){const{message:r,name:n,fileName:o,lineNumber:i,columnNumber:a}=t;return new ErrorEvent(e,{error:t,message:`${n}: ${r}`,filename:o,lineno:i,colno:a})}throw new TypeError("`errorToEvent()` only accepts Errors")}(t))}),!(Error.isError instanceof Function)){const t=Function.bind.call(Function.call,Object.prototype.toString);Error.isError=function(e){return e instanceof Error||"object"==typeof e&&"[object Error]"===t(e)&&void 0===e[Symbol.toStringTag]}}!function(){if(!(Function.prototype.once instanceof Function)){const t=new WeakMap;Function.prototype.once=function(e){const r=this;return function(...n){if(t.has(r))return t.get(r);if("AsyncFunction"===r.constructor.name){const o=r.apply(e||r,n).catch(e=>{throw t.delete(r),e});return t.set(r,o),o}if(r instanceof Function){const o=r.apply(e||r,n);return t.set(r,o),o}}}}}();const r="Iterator"in globalThis,n=r?globalThis.Iterator.prototype:Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),o=r?globalThis.Iterator:(t=>{class e{[Symbol.iterator](){return this}get[Symbol.toStringTag](){return"Iterator"}}return Object.setPrototypeOf(e,t),e})(n);var i;if(o.range instanceof Function||(o.range=function(t,e,r){if("number"==typeof r||"bigint"==typeof r)return o.range(t,e,{step:r});if("object"!=typeof r||Object.is(r,null))return o.range(t,e,{});{const{step:n=("number"==typeof t?t<e?1:-1:t<e?1n:-1n),inclusive:i=!1}=r;if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("Start must be a number");if(Number.isNaN(t))throw new RangeError("Invalid start");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("End must be a number");if(Number.isNaN(e))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&&t<e||n>0&&t>e)return;if(i){let r=t;return n>0?o.from({next(){const t=r<=e?{value:r,done:!1}:{done:!0};return r+=n,t}}):o.from({next(){const t=r>=e?{value:r,done:!1}:{done:!0};return r+=n,t}})}{let r=t;if(n>0)return o.from({next(){const t=r<e?{value:r,done:!1}:{done:!0};return r+=n,t}});{let r=t;return o.from({next(){const t=r>e?{value:r,done:!1}:{done:!0};return r+=n,t}})}}}}),n[Symbol.toStringTag]||(n[Symbol.toStringTag]="Iterator"),n.take instanceof Function||(n.take=function(t){let e=0;const r=this;return o.from({next:()=>e++>=t?{done:!0}:r.next()})}),n.drop instanceof Function||(n.drop=function(t){for(let e=0;e<t;e++){const{done:t}=this.next();if(t)break}return this}),n.toArray instanceof Function||(n.toArray=function(){return Array.from(this)}),n.forEach instanceof Function||(n.forEach=function(t){for(const e of this)t.call(this,e)}),n.flatMap instanceof Function||(n.flatMap=function(t){const e=this;let r=this.next();const n=({value:r,done:n=!0}={})=>n?o.from({next:()=>({done:!0})}):o.from(t.call(e,r));let i=n(r);return o.from({next(){const{value:t,done:o=!0}=i.next();return r.done&&o?{done:!0}:o?r.done?{done:!0}:(r=e.next(),i=n(r),i.next()):{value:t,done:o}}})}),n.map instanceof Function||(n.map=function(t){const e=this;return o.from({next(){const{done:r,value:n}=e.next();return r?{done:r}:{value:t.call(e,n),done:!1}}})}),n.reduce instanceof Function||(n.reduce=function(t,e){let r=void 0===e?this.next().value:e;for(const e of this)r=t.call(this,r,e);return r}),n.filter instanceof Function||(n.filter=function(t){const e=this;let r,n=!1;return o.from({next(){for(;!n;){const o=e.next();if(n=o.done,n)break;if(t.call(e,o.value)){r=o.value;break}}return{done:n,value:r}}})}),n.some instanceof Function||(n.some=function(t){let e=!1;for(const r of this)if(t.call(this,r)){e=!0;break}return e}),n.every instanceof Function||(n.every=function(t){let e=!0;for(const r of this)if(!t.call(this,r)){e=!1;break}return e}),n.find instanceof Function||(n.find=function(t){for(const e of this)if(t.call(this,e))return e}),n.indexed instanceof Function||(n.indexed=function(){let t=0;return this.map(e=>[t++,e])}),n.chunks instanceof Function||(n.chunks=function(t){if(!Number.isSafeInteger(t)||t<1)throw new TypeError("Size must be a positive integer.");{const e=this;let r=!1;return o.from({next(){if(r)return{done:r};{const n=[];let o=0;for(;o++<t&&!r;){const t=e.next();if(t.done){r=!0,void 0!==t.value&&n.push(t.value);break}n.push(t.value)}return{value:n,done:!1}}}})}}),o.from instanceof Function||(o.from=function(t){if("object"!=typeof t||null===t)throw new TypeError("Not an object.");if(t.next instanceof Function){return Object.create(n,{next:{enumerable:!0,configurable:!1,writable:!1,value:(...e)=>t.next(...e)}})}if(t[Symbol.iterator]instanceof Function)return o.from(t[Symbol.iterator]())}),r||(globalThis.Iterator=o),e(ReadableStream,"from",function(t){if(t[Symbol.iterator]instanceof Function)return new ReadableStream({start(e){try{for(const r of t)e.enqueue(r)}catch(t){e.error(t)}finally{e.close()}}});if(t[Symbol.asyncIterator]instanceof Function)return new ReadableStream({async start(e){try{for await(const r of t)e.enqueue(r)}catch(t){e.error(t)}finally{e.close()}}});throw new TypeError("`ReadableStream.from()` requires an iterable source.")}),Map.prototype.getOrInsert instanceof Function||(Map.prototype.getOrInsert=function(t,e){return this.has(t)?this.get(t):(this.set(t,e),e)},Map.prototype.getOrInsertComputed=function(t,e){if(this.has(t))return this.get(t);{const r=e(t);return this.set(t,r),r}}),WeakMap.prototype.getOrInsert instanceof Function||(WeakMap.prototype.getOrInsert=function(t,e){return Map.prototype.getOrInsert.call(this,t,e)},WeakMap.prototype.getOrInsertComputed=function(t,e){return WeakMap.prototype.getOrInsertComputed.call(this,t,e)}),Map.groupBy instanceof Function||(Map.groupBy=function(t,e){return Array.from(t).reduce((t,r,n)=>(t.emplace(e.call(t,r,n),{insert:()=>[r],update:t=>(t.push(r),t)}),t),new Map)}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(t,{insert:e,update:r}={}){console.warn("`Map.prototype.emplace()` has been removed from the proposal and will be removed in the future.");const n=this.has(t);if(n&&r instanceof Function){const e=this.get(t),n=r.call(this,e,t,this);return n!==e&&this.set(t,n),n}if(n)return this.get(t);if(e instanceof Function){const r=e.call(this,t,this);return this.set(t,r),r}throw new Error("Key is not found and no `insert()` given")}),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=t=>t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=t=>(t>0)-(t<0)||+t),Math.hasOwnProperty("trunc")||(Math.trunc=t=>{const e=t-t%1;return 0===e&&(t<0||0===t&&1/t!=1/0)?-0:e}),Math.hasOwnProperty("expm1")||(Math.expm1=t=>Math.exp(t)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...t)=>Math.sqrt(t.reduce((t,e)=>t+e**2,0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=t=>t**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=t=>Math.log(t)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=t=>Math.log(t)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=t=>Math.log(1+t)),Math.hasOwnProperty("fround")||(Math.fround=(i=new Float32Array(1),function(t){return i[0]=t,i[0]})),Math.clamp instanceof Function||(Math.clamp=function(t,e,r){return Math.min(Math.max(t,e),r)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),Math.sumPrecise instanceof Function||(Math.sumPrecise=function(t){let e=-0;for(const r of t){if(!Number.isFinite(r)){e=-0;break}e+=r}return e}),Math.sum instanceof Function||(Math.sum=function(...t){return console.warn("Math.sum is deprecated. Please use Math.sumPrecise instead."),Math.sumPrecise(t)}),Object.groupBy instanceof Function||(Object.groupBy=function(t,e){return Array.from(t).reduce((t,r,n)=>{const o=e.call(t,r,n);return t.hasOwnProperty(o)?t[o].push(r):t[o]=[r],t},{})}),function(){if(!(globalThis.requestIdleCallback instanceof Function)){const t=t=>Number.isSafeInteger(t)&&t>0;globalThis.requestIdleCallback=function(e,{timeout:r}={}){const n=performance.now(),o=()=>t(r)?Math.max(0,r-(performance.now()-n)):Math.max(0,600-(performance.now()-n));return setTimeout(()=>e({didTimeout:!!t(r)&&0===o(),timeRemaining:o}),1)}}globalThis.cancelIdleCallback instanceof Function||(globalThis.cancelIdleCallback=t=>clearTimeout(t)),globalThis.requestAnimationFrame instanceof Function||(globalThis.requestAnimationFrame=t=>setTimeout(()=>t(performance.now()),1e3/60)),globalThis.cancelAnimationFrame instanceof Function||(globalThis.cancelAnimationFrame=t=>clearTimeout(t)),globalThis.queueMicrotask instanceof Function||(globalThis.queueMicrotask=t=>Promise.resolve().then(t).catch(t=>setTimeout(()=>{throw t})))}(),"Promise"in globalThis&&(Promise.prototype.finally instanceof Function||(Promise.prototype.finally=function(t){return this.then(async e=>(await t(),e),async e=>(await t(),e))}),Promise.allSettled instanceof Function||(Promise.allSettled=function(t){return Promise.all(Array.from(t).map(function(t){return new Promise(function(e){t instanceof Promise||(t=Promise.resolve(t)),t.then(function(t){e({status:"fulfilled",value:t})}).catch(function(t){e({status:"rejected",reason:t})})})}))}),Promise.any instanceof Function||(Promise.any=t=>new Promise((e,r)=>{let n=[];t.forEach(o=>{o.then(e).catch(e=>{n.push(e),n.length===t.length&&r(new globalThis.AggregateError(n,"No Promise in Promise.any was resolved"))})})})),Promise.race instanceof Function||(Promise.race=t=>new Promise((e,r)=>{t.forEach(t=>t.then(e,r))})),Promise.try instanceof Function||(Promise.try=(t,...e)=>new Promise(r=>r(t(...e)))),Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}),Promise.fromEntries instanceof Function||(Promise.fromEntries=async function(t){const e=[],r=[];for(const[n,o]of t)e.push(n),r.push(o);return await Promise.all(r).then(t=>Object.fromEntries(t.map((t,r)=>[e[r],t])))}),Promise.ownProperties instanceof Function||(Promise.ownProperties=async function(t){return await Promise.fromEntries(Object.entries(t))})),!(RegExp.escape instanceof Function)){const t=/[-[\]/{}()<>=#&!@%*+?.\\^$|;:"'`\s]/g;RegExp.escape=function(e){return e.toString().replace(t,"\\$&")}}e(Request.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())}),e(Response,"json",(t,{status:e=200,statusText:r="",headers:n=new Headers}={})=>n instanceof Headers?(n.set("Content-Type","application/json"),new Response(JSON.stringify(t),{status:e,statusText:r,headers:n})):Response.json(t,{status:e,statusText:r,headers:new Headers(n)})),e(Response,"redirect",(t,e=302)=>new Response(null,{status:e,headers:new Headers({Location:t})})),e(Response.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())});
2
2
  /**
3
3
  * @copyright 2024 Chris Zuber <admin@kernvalley.us>
4
4
  */
5
- const a="user-blocking",s="user-visible",c="background";async function u(t,{delay:e=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(t).then(o,i),n.abort()},e);r instanceof AbortSignal&&r.addEventListener("abort",({target:t})=>{i(t.reason),clearTimeout(a),n.abort(t.reason)},{once:!0,signal:n.signal})}return await n}class l{async postTask(t,{priority:e,delay:r,signal:n}={}){const{promise:o,resolve:i,reject:l}=Promise.withResolvers(),h=new AbortController,f=Number.isSafeInteger(r)&&r>-1,p=function(t,e,r,n){return async()=>{n instanceof AbortSignal&&n.aborted?r(n.reason):t instanceof Function?await Promise.try(t).then(e,r):r(new TypeError("Scheduled task is not a function."))}}(t,i,l,n);if(void 0===e&&(e=n instanceof globalThis.TaskSignal?n.priority:s),n instanceof AbortSignal&&n.aborted)l(n.reason);else switch(e){case a:f?await u(p,{delay:r,signal:n}):(await Promise.resolve(),queueMicrotask(p));break;case s:if(f)await u(()=>requestAnimationFrame(p),{delay:r,signal:n});else{const t=requestAnimationFrame(p);n instanceof AbortSignal&&n.addEventListener("abort",({target:e})=>{cancelAnimationFrame(t),l(e.reason),h.abort(e.reason)},{once:!0,signal:h.signal})}break;case c:if(f)await u(()=>requestIdleCallback(p),{delay:r,signal:n});else{const t=requestIdleCallback(p);n instanceof AbortSignal&&n.addEventListener("abort",({target:e})=>{cancelIdleCallback(t),l(e.reason),h.abort(e.reason)},{once:!0,signal:h.signal})}break;default:throw new TypeError(`Scheduler.postTask: '${e}' (value of 'priority' member of SchedulerPostTaskOptions) is not a valid value for enumeration TaskPriority.`)}return await o.then(t=>(h.abort(),t)).catch(t=>{throw h.abort(t),t})}async yield(){await this.postTask(()=>null,{priority:s})}}if("scheduler"in globalThis?globalThis.scheduler.yield instanceof Function||(globalThis.scheduler.yield=async function(t){await l.prototype.yield.call(this,t)}):globalThis.scheduler=new l,!("TaskController"in globalThis)){const t=["user-visible","user-blocking","background"],e=Symbol("task:priority");globalThis.TaskPriorityChangeEvent=class extends Event{#t;constructor(e,{previousPriority:r}){if(super(e),"string"!=typeof r)throw new TypeError("TaskPriorityChangeEvent constructor: Missing required 'previousPriority' member of TaskPriorityChangeEventInit.");if(!t.includes(r))throw new TypeError(`TaskPriorityChangeEvent constructor: '${r}' (value of 'previousPriority' member of TaskPriorityChangeEventInit) is not a valid value for enumeration TaskPriority.`);this.#t=r}get previousPriority(){return this.#t}},globalThis.TaskSignal=class extends AbortSignal{get priority(){return this[e]}static any(r,{priority:n="user-visible"}={}){if(t.includes(n)){const t=super.any(r);return Object.setPrototypeOf(t,globalThis.TaskSignal.prototype),Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!1,value:n}),t}throw new TypeError(`TaskSignal.any: '${n}' is not a valid value for enumeration TaskPriority.`)}},globalThis.TaskController=class extends AbortController{constructor({priority:r="user-visible"}={}){if(super(),!t.includes(r))throw new TypeError(`TaskController constructor: '${r}' (value of 'priority' member of TaskControllerInit) is not a valid value for enumeration TaskPriority.`);Object.setPrototypeOf(this.signal,globalThis.TaskSignal.prototype),Object.defineProperty(this.signal,e,{enumerable:!1,writable:!0,configurable:!1,value:r})}setPriority(r){if(!t.includes(r))throw new TypeError(`TaskController.setPriority: '${r}' (value of argument 1) is not a valid value for enumeration TaskPriority.`);if(r!==this.signal.priority){const t=new globalThis.TaskPriorityChangeEvent("prioritychange",{previousPriority:this.signal.priority});this.signal[e]=r,this.signal.dispatchEvent(t)}}}}function h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var f,p,y,g={exports:{}};function b(){return f||(f=1,g.exports=function(){const t=new WeakMap,e=/(\n|\r\n?|\u2028|\u2029)/g,r=/^\s*/,n=/\S/,o=Array.prototype.slice,i="0".charCodeAt(0),a="9".charCodeAt(0),s="a".charCodeAt(0),c="f".charCodeAt(0),u="A".charCodeAt(0),l="F".charCodeAt(0);function h(t){if("string"==typeof t)return y([t])[0];if("function"==typeof t)return function(){const e=o.call(arguments);return e[0]=p(e[0]),t.apply(this,e)};const e=p(t);let r=f(e,0);for(let t=1;t<e.length;t++)r+=arguments[t]+f(e,t);return r}function f(t,e){const r=t[e];if(void 0===r)throw new TypeError(`invalid cooked string at index ${e}`);return r}function p(e){const r=t.get(e);if(r)return r;const n=y(e.raw),o=n.map(b);return Object.defineProperty(o,"raw",{value:Object.freeze(n)}),Object.freeze(o),t.set(e,o),o}function y(t){const o=t.map(t=>t.split(e));let i;for(let t=0;t<o.length;t++){const e=o[t],a=0===t,s=t+1===o.length;if(a){if(1===e.length||e[0].length>0)throw new Error("invalid content on opening line");e[1]=""}if(s){if(1===e.length||n.test(e[e.length-1]))throw new Error("invalid content on closing line");e[e.length-2]="",e[e.length-1]=""}for(let t=2;t<e.length;t+=2){const n=e[t],o=t+1===e.length&&!s,a=r.exec(n)[0];o||a.length!==n.length?i=g(a,i):e[t]=""}}const a=i?i.length:0;return o.map(t=>{let e=t[0];for(let r=1;r<t.length;r+=2)e+=t[r]+t[r+1].slice(a);return e})}function g(t,e){if(void 0===e||t===e)return t;let r=0;for(const n=Math.min(t.length,e.length);r<n&&t[r]===e[r];r++);return t.slice(0,r)}function b(t){let e="",r=0,n=0;for(;(n=t.indexOf("\\",n))>-1;){if(e+=t.slice(r,n),++n===t.length)return;const o=t[n++];switch(o){case"b":e+="\b";break;case"t":e+="\t";break;case"n":e+="\n";break;case"v":e+="\v";break;case"f":e+="\f";break;case"r":e+="\r";break;case"\r":n<t.length&&"\n"===t[n]&&++n;case"\n":case"\u2028":case"\u2029":break;case"0":if(d(t,n))return;e+="\0";break;case"x":{const r=m(t,n,n+2);if(-1===r)return;n+=2,e+=String.fromCharCode(r);break}case"u":{let r;if(n<t.length&&"{"===t[n]){const e=t.indexOf("}",++n);if(-1===e)return;r=m(t,n,e),n=e+1}else r=m(t,n,n+4),n+=4;if(-1===r||r>1114111)return;e+=String.fromCodePoint(r);break}default:if(d(o,0))return;e+=o}r=n}return e+t.slice(r)}function d(t,e){const r=t.charCodeAt(e);return r>=i&&r<=a}function m(t,e,r){if(r>=t.length)return-1;let n=0;for(;e<r;e++){const r=w(t.charCodeAt(e));if(-1===r)return-1;n=16*n+r}return n}function w(t){return t>=i&&t<=a?t-i:t>=s&&t<=c?t-s+10:t>=u&&t<=l?t-u+10:-1}return h}()),g.exports}var d=h(y?p:(y=1,p=b()));if(String.dedent instanceof Function||(String.dedent=d),"Symbol"in globalThis){const t=new Set(Reflect.ownKeys(Symbol).filter(t=>"symbol"==typeof Symbol[t]).map(t=>Symbol[t]));void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator")),e(Symbol,"isRegistered",function(t){return"symbol"==typeof t&&"string"==typeof Symbol.keyFor(t)}),e(Symbol,"isWellKnown",function(e){return t.has(e)})}const m="Expected a set-like object.",w=["has","keys"],v=["size"],A=t=>t instanceof Set,E=t=>A(t)||"object"==typeof t&&null!==t&&w.every(e=>t[e]instanceof Function)&&v.every(e=>e in t);function T(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var S,x,P,F,O,k;function M(){if(x)return S;x=1;var t,e=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(t,r)=>e(t,"name",{value:r,configurable:!0}),a={};((t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})})(a,{URLPattern:()=>ot}),t=a,S=((t,i,a,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of n(i))!o.call(t,c)&&c!==a&&e(t,c,{get:()=>i[c],enumerable:!(s=r(i,c))||s.enumerable});return t})(e({},"__esModule",{value:!0}),t);var s=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,o,i){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=o,this.modifier=i}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}};i(s,"Part");var c=/[$_\p{ID_Start}]/u,u=/[$_\u200C\u200D\p{ID_Continue}]/u,l=".*";function h(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function f(t,e=!1){let r=[],n=0;for(;n<t.length;){let o=t[n],a=i(function(o){if(!e)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:t[n++]})},"ErrorOrInvalid");if("*"!==o)if("+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o){if(":"===o){let e="",o=n+1;for(;o<t.length;){let r=t.substr(o,1);if(!(o===n+1&&c.test(r)||o!==n+1&&u.test(r)))break;e+=t[o++]}if(!e){a(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:e}),n=o;continue}if("("===o){let e=1,o="",i=n+1,s=!1;if("?"===t[i]){a(`Pattern cannot start with "?" at ${i}`);continue}for(;i<t.length;){if(!h(t[i],!1)){a(`Invalid character '${t[i]}' at ${i}.`),s=!0;break}if("\\"!==t[i]){if(")"===t[i]){if(e--,0===e){i++;break}}else if("("===t[i]&&(e++,"?"!==t[i+1])){a(`Capturing groups are not allowed at ${i}`),s=!0;break}o+=t[i++]}else o+=t[i++]+t[i++]}if(s)continue;if(e){a(`Unbalanced pattern at ${n}`);continue}if(!o){a(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=i;continue}r.push({type:"CHAR",index:n,value:t[n++]})}else r.push({type:"CLOSE",index:n,value:t[n++]});else r.push({type:"OPEN",index:n,value:t[n++]});else r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});else r.push({type:"ASTERISK",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function p(t,e={}){let r=f(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${y(e.delimiter)}]+?`,o=[],a=0,c=0,u=new Set,h=i(t=>{if(c<r.length&&r[c].type===t)return r[c++].value},"tryConsume"),p=i(()=>h("OTHER_MODIFIER")??h("ASTERISK"),"tryConsumeModifier"),g=i(t=>{let e=h(t);if(void 0!==e)return e;let{type:n,index:o}=r[c];throw new TypeError(`Unexpected ${n} at ${o}, expected ${t}`)},"mustConsume"),b=i(()=>{let t,e="";for(;t=h("CHAR")??h("ESCAPED_CHAR");)e+=t;return e},"consumeText"),d=i(t=>t,"DefaultEncodePart"),m=e.encodePart||d,w="",v=i(t=>{w+=t},"appendToPendingFixedValue"),A=i(()=>{w.length&&(o.push(new s(3,"","",m(w),"",3)),w="")},"maybeAddPartFromPendingFixedValue"),E=i((t,e,r,i,c)=>{let h,f=3;switch(c){case"?":f=1;break;case"*":f=0;break;case"+":f=2}if(!e&&!r&&3===f)return void v(t);if(A(),!e&&!r){if(!t)return;return void o.push(new s(3,"","",m(t),"",f))}h=r?"*"===r?l:r:n;let p,y=2;if(h===n?(y=1,h=""):h===l&&(y=0,h=""),e?p=e:r&&(p=a++),u.has(p))throw new TypeError(`Duplicate name '${p}'.`);u.add(p),o.push(new s(y,p,m(t),h,m(i),f))},"addPart");for(;c<r.length;){let t=h("CHAR"),r=h("NAME"),n=h("REGEX");if(!r&&!n&&(n=h("ASTERISK")),r||n){let o=t??"";-1===e.prefixes.indexOf(o)&&(v(o),o=""),A(),E(o,r,n,"",p());continue}let o=t??h("ESCAPED_CHAR");if(o)v(o);else{if(h("OPEN")){let t=b(),e=h("NAME"),r=h("REGEX");!e&&!r&&(r=h("ASTERISK"));let n=b();g("CLOSE"),E(t,e,r,n,p());continue}A(),g("END")}}return o}function y(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function g(t){return t&&t.ignoreCase?"ui":"u"}function b(t,e,r){return m(p(t,r),e,r)}function d(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function m(t,e,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 t){if(3===o.type){3===o.modifier?n+=y(o.value):n+=`(?:${y(o.value)})${d(o.modifier)}`;continue}e&&e.push(o.name);let t=`[^${y(r.delimiter)}]+?`,i=o.value;(1===o.type?i=t:0===o.type&&(i=l),o.prefix.length||o.suffix.length)?3!==o.modifier&&1!==o.modifier?(n+=`(?:${y(o.prefix)}`,n+=`((?:${i})(?:`,n+=y(o.suffix),n+=y(o.prefix),n+=`(?:${i}))*)${y(o.suffix)})`,0===o.modifier&&(n+="?")):(n+=`(?:${y(o.prefix)}(${i})${y(o.suffix)})`,n+=d(o.modifier)):3===o.modifier||1===o.modifier?n+=`(${i})${d(o.modifier)}`:n+=`((?:${i})${d(o.modifier)})`}let o=`[${y(r.endsWith)}]|$`,i=`[${y(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(t.length){let e=t[t.length-1];3===e.type&&3===e.modifier&&(a=r.delimiter.indexOf(e)>-1)}return a||(n+=`(?=${i}|${o})`),new RegExp(n,g(r))}i(h,"isASCII"),i(f,"lexer"),i(p,"parse"),i(y,"escapeString"),i(g,"flags"),i(b,"stringToRegexp"),i(d,"modifierToString"),i(m,"partsToRegexp");var w={delimiter:"",prefixes:"",sensitive:!0,strict:!0},v={delimiter:".",prefixes:"",sensitive:!0,strict:!0},A={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function E(t,e){return!!t.length&&("/"===t[0]||!(!e||t.length<2)&&(("\\"==t[0]||"{"==t[0])&&"/"==t[1]))}function T(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function P(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function F(t){return!(!t||t.length<2)&&("["===t[0]||("\\"===t[0]||"{"===t[0])&&"["===t[1])}i(E,"isAbsolutePathname"),i(T,"maybeStripPrefix"),i(P,"maybeStripSuffix"),i(F,"treatAsIPv6Hostname");var O=["ftp","file","http","https","ws","wss"];function k(t){if(!t)return!0;for(let e of O)if(t.test(e))return!0;return!1}function M(t,e){if(t=T(t,"#"),e||""===t)return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function R(t,e){if(t=T(t,"?"),e||""===t)return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function C(t,e){return e||""===t?t:F(t)?q(t):H(t)}function I(t,e){if(e||""===t)return t;let r=new URL("https://example.com");return r.password=t,r.password}function $(t,e){if(e||""===t)return t;let r=new URL("https://example.com");return r.username=t,r.username}function j(t,e,r){if(r||""===t)return t;if(e&&!O.includes(e))return new URL(`${e}:${t}`).pathname;let n="/"==t[0];return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function U(t,e,r){return N(e)===t&&(t=""),r||""===t?t:z(t)}function L(t,e){return t=P(t,":"),e||""===t?t:B(t)}function N(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function B(t){if(""===t)return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function _(t){if(""===t)return t;let e=new URL("https://example.com");return e.username=t,e.username}function D(t){if(""===t)return t;let e=new URL("https://example.com");return e.password=t,e.password}function H(t){if(""===t)return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function q(t){if(""===t)return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function z(t){if(""===t||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function W(t){if(""===t)return t;let e=new URL("https://example.com");return e.pathname="/"!==t[0]?"/-"+t:t,"/"!==t[0]?e.pathname.substring(2,e.pathname.length):e.pathname}function G(t){return""===t?t:new URL(`data:${t}`).pathname}function K(t){if(""===t)return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function X(t){if(""===t)return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}i(k,"isSpecialScheme"),i(M,"canonicalizeHash"),i(R,"canonicalizeSearch"),i(C,"canonicalizeHostname"),i(I,"canonicalizePassword"),i($,"canonicalizeUsername"),i(j,"canonicalizePathname"),i(U,"canonicalizePort"),i(L,"canonicalizeProtocol"),i(N,"defaultPortForProtocol"),i(B,"protocolEncodeCallback"),i(_,"usernameEncodeCallback"),i(D,"passwordEncodeCallback"),i(H,"hostnameEncodeCallback"),i(q,"ipv6HostnameEncodeCallback"),i(z,"portEncodeCallback"),i(W,"standardURLPathnameEncodeCallback"),i(G,"pathURLPathnameEncodeCallback"),i(K,"searchEncodeCallback"),i(X,"hashEncodeCallback");var V=class{#e;#r=[];#n={};#o=0;#i=1;#a=0;#s=0;#c=0;#u=0;#l=!1;constructor(t){this.#e=t}get result(){return this.#n}parse(){for(this.#r=f(this.#e,!0);this.#o<this.#r.length;this.#o+=this.#i){if(this.#i=1,"END"===this.#r[this.#o].type){if(0===this.#s){this.#h(),this.#f()?this.#p(9,1):this.#y()?this.#p(8,1):this.#p(7,0);continue}if(2===this.#s){this.#g(5);continue}this.#p(10,0);break}if(this.#c>0){if(!this.#b())continue;this.#c-=1}if(this.#d())this.#c+=1;else switch(this.#s){case 0:this.#m()&&this.#g(1);break;case 1:if(this.#m()){this.#w();let t=7,e=1;this.#v()?(t=2,e=3):this.#l&&(t=2),this.#p(t,e)}break;case 2:this.#A()?this.#g(3):(this.#E()||this.#y()||this.#f())&&this.#g(5);break;case 3:this.#T()?this.#p(4,1):this.#A()&&this.#p(5,1);break;case 4:this.#A()&&this.#p(5,1);break;case 5:this.#S()?this.#u+=1:this.#x()&&(this.#u-=1),this.#P()&&!this.#u?this.#p(6,1):this.#E()?this.#p(7,0):this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 6:this.#E()?this.#p(7,0):this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 7:this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 8:this.#f()&&this.#p(9,1)}}void 0!==this.#n.hostname&&void 0===this.#n.port&&(this.#n.port="")}#p(t,e){switch(this.#s){case 0:case 2:break;case 1:this.#n.protocol=this.#F();break;case 3:this.#n.username=this.#F();break;case 4:this.#n.password=this.#F();break;case 5:this.#n.hostname=this.#F();break;case 6:this.#n.port=this.#F();break;case 7:this.#n.pathname=this.#F();break;case 8:this.#n.search=this.#F();break;case 9:this.#n.hash=this.#F()}0!==this.#s&&10!==t&&([1,2,3,4].includes(this.#s)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#s)&&[8,9].includes(t)&&(this.#n.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#s)&&9===t&&(this.#n.search??="")),this.#O(t,e)}#O(t,e){this.#s=t,this.#a=this.#o+e,this.#o+=e,this.#i=0}#h(){this.#o=this.#a,this.#i=0}#g(t){this.#h(),this.#s=t}#k(t){return t<0&&(t=this.#r.length-t),t<this.#r.length?this.#r[t]:this.#r[this.#r.length-1]}#M(t,e){let r=this.#k(t);return r.value===e&&("CHAR"===r.type||"ESCAPED_CHAR"===r.type||"INVALID_CHAR"===r.type)}#m(){return this.#M(this.#o,":")}#v(){return this.#M(this.#o+1,"/")&&this.#M(this.#o+2,"/")}#A(){return this.#M(this.#o,"@")}#T(){return this.#M(this.#o,":")}#P(){return this.#M(this.#o,":")}#E(){return this.#M(this.#o,"/")}#y(){if(this.#M(this.#o,"?"))return!0;if("?"!==this.#r[this.#o].value)return!1;let t=this.#k(this.#o-1);return"NAME"!==t.type&&"REGEX"!==t.type&&"CLOSE"!==t.type&&"ASTERISK"!==t.type}#f(){return this.#M(this.#o,"#")}#d(){return"OPEN"==this.#r[this.#o].type}#b(){return"CLOSE"==this.#r[this.#o].type}#S(){return this.#M(this.#o,"[")}#x(){return this.#M(this.#o,"]")}#F(){let t=this.#r[this.#o],e=this.#k(this.#a).index;return this.#e.substring(e,t.index)}#w(){let t={};Object.assign(t,w),t.encodePart=B;let e=b(this.#F(),void 0,t);this.#l=k(e)}};i(V,"Parser");var J=["protocol","username","password","hostname","port","pathname","search","hash"],Z="*";function Q(t,e){if("string"!=typeof t)throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);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 Y(t,e){return e?et(t):t}function tt(t,e,r){let n;if("string"==typeof e.baseURL)try{n=new URL(e.baseURL),void 0===e.protocol&&(t.protocol=Y(n.protocol.substring(0,n.protocol.length-1),r)),!r&&void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.username&&(t.username=Y(n.username,r)),!r&&void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.username&&void 0===e.password&&(t.password=Y(n.password,r)),void 0===e.protocol&&void 0===e.hostname&&(t.hostname=Y(n.hostname,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&(t.port=Y(n.port,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&(t.pathname=Y(n.pathname,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search&&(t.search=Y(n.search.substring(1,n.search.length),r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search&&void 0===e.hash&&(t.hash=Y(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if("string"==typeof e.protocol&&(t.protocol=L(e.protocol,r)),"string"==typeof e.username&&(t.username=$(e.username,r)),"string"==typeof e.password&&(t.password=I(e.password,r)),"string"==typeof e.hostname&&(t.hostname=C(e.hostname,r)),"string"==typeof e.port&&(t.port=U(e.port,t.protocol,r)),"string"==typeof e.pathname){if(t.pathname=e.pathname,n&&!E(t.pathname,r)){let e=n.pathname.lastIndexOf("/");e>=0&&(t.pathname=Y(n.pathname.substring(0,e+1),r)+t.pathname)}t.pathname=j(t.pathname,t.protocol,r)}return"string"==typeof e.search&&(t.search=R(e.search,r)),"string"==typeof e.hash&&(t.hash=M(e.hash,r)),t}function et(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function rt(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function nt(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=`[^${rt(e.delimiter)}]+?`,n=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let i=0;i<t.length;++i){let a=t[i];if(3===a.type){if(3===a.modifier){o+=et(a.value);continue}o+=`{${et(a.value)}}${d(a.modifier)}`;continue}let s=a.hasCustomName(),c=!!a.suffix.length||!!a.prefix.length&&(1!==a.prefix.length||!e.prefixes.includes(a.prefix)),u=i>0?t[i-1]:null,l=i<t.length-1?t[i+1]:null;if(!c&&s&&1===a.type&&3===a.modifier&&l&&!l.prefix.length&&!l.suffix.length)if(3===l.type){let t=l.value.length>0?l.value[0]:"";c=n.test(t)}else c=!l.hasCustomName();if(!c&&!a.prefix.length&&u&&3===u.type){let t=u.value[u.value.length-1];c=e.prefixes.includes(t)}c&&(o+="{"),o+=et(a.prefix),s&&(o+=`:${a.name}`),2===a.type?o+=`(${a.value})`:1===a.type?s||(o+=`(${r})`):0===a.type&&(s||u&&3!==u.type&&3===u.modifier&&!c&&""===a.prefix?o+="(.*)":o+="*"),1===a.type&&s&&a.suffix.length&&n.test(a.suffix[0])&&(o+="\\"),o+=et(a.suffix),c&&(o+="}"),3!==a.modifier&&(o+=d(a.modifier))}return o}i(Q,"extractValues"),i(Y,"processBaseURLString"),i(tt,"applyInit"),i(et,"escapePatternString"),i(rt,"escapeRegexpString"),i(nt,"partsToPattern");var ot=class{#e;#r={};#n={};#o={};#i={};#a=!1;constructor(t={},e,r){try{let n;if("string"==typeof e?n=e:r=e,"string"==typeof t){let e=new V(t);if(e.parse(),t=e.result,void 0===n&&"string"!=typeof t.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n}else{if(!t||"object"!=typeof t)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:Z,protocol:Z,username:Z,password:Z,hostname:Z,port:Z,search:Z,hash:Z};for(o of(this.#e=tt(a,t,!0),N(this.#e.protocol)===this.#e.port&&(this.#e.port=""),J)){if(!(o in this.#e))continue;let t={},e=this.#e[o];switch(this.#n[o]=[],o){case"protocol":Object.assign(t,w),t.encodePart=B;break;case"username":Object.assign(t,w),t.encodePart=_;break;case"password":Object.assign(t,w),t.encodePart=D;break;case"hostname":Object.assign(t,v),F(e)?t.encodePart=q:t.encodePart=H;break;case"port":Object.assign(t,w),t.encodePart=z;break;case"pathname":k(this.#r.protocol)?(Object.assign(t,A,i),t.encodePart=W):(Object.assign(t,w,i),t.encodePart=G);break;case"search":Object.assign(t,w,i),t.encodePart=K;break;case"hash":Object.assign(t,w,i),t.encodePart=X}try{this.#i[o]=p(e,t),this.#r[o]=m(this.#i[o],this.#n[o],t),this.#o[o]=nt(this.#i[o],t),this.#a=this.#a||this.#i[o].some(t=>2===t.type)}catch{throw new TypeError(`invalid ${o} pattern '${this.#e[o]}'.`)}}}catch(t){throw new TypeError(`Failed to construct 'URLPattern': ${t.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(t={},e){let r,n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return!1;try{n=tt(n,"object"==typeof t?t:Q(t,e),!1)}catch{return!1}for(r of J)if(!this.#r[r].exec(n[r]))return!1;return!0}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{r=tt(r,"object"==typeof t?t:Q(t,e),!1)}catch{return null}let n,o={};for(n of(o.inputs=e?[t,e]:[t],J)){let t=this.#r[n].exec(r[n]);if(!t)return null;let e={};for(let[r,o]of this.#n[n].entries())if("string"==typeof o||"number"==typeof o){let n=t[r+1];e[o]=n}o[n]={input:r[n]??"",groups:e}}return o}static compareComponent(t,e,r){let n=i((t,e)=>{for(let r of["type","modifier","prefix","value","suffix"]){if(t[r]<e[r])return-1;if(t[r]!==e[r])return 1}return 0},"comparePart"),o=new s(3,"","","","",3),a=new s(0,"","","","",3),c=i((t,e)=>{let r=0;for(;r<Math.min(t.length,e.length);++r){let o=n(t[r],e[r]);if(o)return o}return t.length===e.length?0:n(t[r]??o,e[r]??o)},"comparePartList");return e.#o[t]||r.#o[t]?e.#o[t]&&!r.#o[t]?c(e.#i[t],[a]):!e.#o[t]&&r.#o[t]?c([a],r.#i[t]):c(e.#i[t],r.#i[t]):0}get protocol(){return this.#o.protocol}get username(){return this.#o.username}get password(){return this.#o.password}get hostname(){return this.#o.hostname}get port(){return this.#o.port}get pathname(){return this.#o.pathname}get search(){return this.#o.search}get hash(){return this.#o.hash}get hasRegExpGroups(){return this.#a}};return i(ot,"URLPattern"),S}Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(t){if(!E(t))throw new TypeError(m);return new Set([...this].filter(e=>t.has(e)))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(t){if(!E(t))throw new TypeError(m);return new Set([...this].filter(e=>!t.has(e)))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(t){return new Set([...this,...t])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(t){if(!E(t))throw new TypeError(m);return[...this].every(e=>t.has(e))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(t){if(!E(t))throw new TypeError(m);return A(t)?t.isSubsetOf(this):new Set(t.keys()).isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(t){if(!E(t))throw new TypeError(m);return A(t)?new Set([...this.difference(t),...t.difference(this)]):new Set([...this.difference(t),...new Set(t.keys()).difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(t){if(!E(t))throw new TypeError(m);return new Set([...this,...t]).size===this.size+t.size});var R=T(k?O:(k=1,O=function(){if(F)return P;F=1;const{URLPattern:t}=M();return P={URLPattern:t},globalThis.URLPattern||(globalThis.URLPattern=t),P}()));"URLPattern"in globalThis||(globalThis.URLPattern=R),e(URL,"parse",(t,e)=>{try{return new URL(t,e)}catch{return null}}),e(URL,"canParse",(t,e)=>{try{return new URL(t,e)instanceof URL}catch{return!1}}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(t,{insert:e,update:r}={}){const n=this.has(t);if(n&&r instanceof Function){const e=this.get(t),n=r.call(this,e,t,this);return n!==e&&this.set(t,e),n}if(n)return this.get(t);if(e instanceof Function){const r=e.call(this,t,this);return this.set(t,r),r}throw new Error("Key is not found and no `insert()` given")});
5
+ const a="user-blocking",s="user-visible",c="background";async function u(t,{delay:e=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(t).then(o,i),n.abort()},e);r instanceof AbortSignal&&r.addEventListener("abort",({target:t})=>{i(t.reason),clearTimeout(a),n.abort(t.reason)},{once:!0,signal:n.signal})}return await n}class l{async postTask(t,{priority:e,delay:r,signal:n}={}){const{promise:o,resolve:i,reject:l}=Promise.withResolvers(),h=new AbortController,f=Number.isSafeInteger(r)&&r>-1,p=function(t,e,r,n){return async()=>{n instanceof AbortSignal&&n.aborted?r(n.reason):t instanceof Function?await Promise.try(t).then(e,r):r(new TypeError("Scheduled task is not a function."))}}(t,i,l,n);if(void 0===e&&(e=n instanceof globalThis.TaskSignal?n.priority:s),n instanceof AbortSignal&&n.aborted)l(n.reason);else switch(e){case a:f?await u(p,{delay:r,signal:n}):(await Promise.resolve(),queueMicrotask(p));break;case s:if(f)await u(()=>requestAnimationFrame(p),{delay:r,signal:n});else{const t=requestAnimationFrame(p);n instanceof AbortSignal&&n.addEventListener("abort",({target:e})=>{cancelAnimationFrame(t),l(e.reason),h.abort(e.reason)},{once:!0,signal:h.signal})}break;case c:if(f)await u(()=>requestIdleCallback(p),{delay:r,signal:n});else{const t=requestIdleCallback(p);n instanceof AbortSignal&&n.addEventListener("abort",({target:e})=>{cancelIdleCallback(t),l(e.reason),h.abort(e.reason)},{once:!0,signal:h.signal})}break;default:throw new TypeError(`Scheduler.postTask: '${e}' (value of 'priority' member of SchedulerPostTaskOptions) is not a valid value for enumeration TaskPriority.`)}return await o.then(t=>(h.abort(),t)).catch(t=>{throw h.abort(t),t})}async yield(){await this.postTask(()=>null,{priority:s})}}if("scheduler"in globalThis?globalThis.scheduler.yield instanceof Function||(globalThis.scheduler.yield=async function(t){await l.prototype.yield.call(this,t)}):globalThis.scheduler=new l,!("TaskController"in globalThis)){const t=["user-visible","user-blocking","background"],e=Symbol("task:priority");globalThis.TaskPriorityChangeEvent=class extends Event{#t;constructor(e,{previousPriority:r}){if(super(e),"string"!=typeof r)throw new TypeError("TaskPriorityChangeEvent constructor: Missing required 'previousPriority' member of TaskPriorityChangeEventInit.");if(!t.includes(r))throw new TypeError(`TaskPriorityChangeEvent constructor: '${r}' (value of 'previousPriority' member of TaskPriorityChangeEventInit) is not a valid value for enumeration TaskPriority.`);this.#t=r}get previousPriority(){return this.#t}},globalThis.TaskSignal=class extends AbortSignal{get priority(){return this[e]}static any(r,{priority:n="user-visible"}={}){if(t.includes(n)){const t=super.any(r);return Object.setPrototypeOf(t,globalThis.TaskSignal.prototype),Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!1,value:n}),t}throw new TypeError(`TaskSignal.any: '${n}' is not a valid value for enumeration TaskPriority.`)}},globalThis.TaskController=class extends AbortController{constructor({priority:r="user-visible"}={}){if(super(),!t.includes(r))throw new TypeError(`TaskController constructor: '${r}' (value of 'priority' member of TaskControllerInit) is not a valid value for enumeration TaskPriority.`);Object.setPrototypeOf(this.signal,globalThis.TaskSignal.prototype),Object.defineProperty(this.signal,e,{enumerable:!1,writable:!0,configurable:!1,value:r})}setPriority(r){if(!t.includes(r))throw new TypeError(`TaskController.setPriority: '${r}' (value of argument 1) is not a valid value for enumeration TaskPriority.`);if(r!==this.signal.priority){const t=new globalThis.TaskPriorityChangeEvent("prioritychange",{previousPriority:this.signal.priority});this.signal[e]=r,this.signal.dispatchEvent(t)}}}}function h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var f,p,y,g={exports:{}};function b(){return f||(f=1,g.exports=function(){const t=new WeakMap,e=/(\n|\r\n?|\u2028|\u2029)/g,r=/^\s*/,n=/\S/,o=Array.prototype.slice,i="0".charCodeAt(0),a="9".charCodeAt(0),s="a".charCodeAt(0),c="f".charCodeAt(0),u="A".charCodeAt(0),l="F".charCodeAt(0);function h(t){if("string"==typeof t)return y([t])[0];if("function"==typeof t)return function(){const e=o.call(arguments);return e[0]=p(e[0]),t.apply(this,e)};const e=p(t);let r=f(e,0);for(let t=1;t<e.length;t++)r+=arguments[t]+f(e,t);return r}function f(t,e){const r=t[e];if(void 0===r)throw new TypeError(`invalid cooked string at index ${e}`);return r}function p(e){const r=t.get(e);if(r)return r;const n=y(e.raw),o=n.map(b);return Object.defineProperty(o,"raw",{value:Object.freeze(n)}),Object.freeze(o),t.set(e,o),o}function y(t){const o=t.map(t=>t.split(e));let i;for(let t=0;t<o.length;t++){const e=o[t],a=0===t,s=t+1===o.length;if(a){if(1===e.length||e[0].length>0)throw new Error("invalid content on opening line");e[1]=""}if(s){if(1===e.length||n.test(e[e.length-1]))throw new Error("invalid content on closing line");e[e.length-2]="",e[e.length-1]=""}for(let t=2;t<e.length;t+=2){const n=e[t],o=t+1===e.length&&!s,a=r.exec(n)[0];o||a.length!==n.length?i=g(a,i):e[t]=""}}const a=i?i.length:0;return o.map(t=>{let e=t[0];for(let r=1;r<t.length;r+=2)e+=t[r]+t[r+1].slice(a);return e})}function g(t,e){if(void 0===e||t===e)return t;let r=0;for(const n=Math.min(t.length,e.length);r<n&&t[r]===e[r];r++);return t.slice(0,r)}function b(t){let e="",r=0,n=0;for(;(n=t.indexOf("\\",n))>-1;){if(e+=t.slice(r,n),++n===t.length)return;const o=t[n++];switch(o){case"b":e+="\b";break;case"t":e+="\t";break;case"n":e+="\n";break;case"v":e+="\v";break;case"f":e+="\f";break;case"r":e+="\r";break;case"\r":n<t.length&&"\n"===t[n]&&++n;case"\n":case"\u2028":case"\u2029":break;case"0":if(m(t,n))return;e+="\0";break;case"x":{const r=d(t,n,n+2);if(-1===r)return;n+=2,e+=String.fromCharCode(r);break}case"u":{let r;if(n<t.length&&"{"===t[n]){const e=t.indexOf("}",++n);if(-1===e)return;r=d(t,n,e),n=e+1}else r=d(t,n,n+4),n+=4;if(-1===r||r>1114111)return;e+=String.fromCodePoint(r);break}default:if(m(o,0))return;e+=o}r=n}return e+t.slice(r)}function m(t,e){const r=t.charCodeAt(e);return r>=i&&r<=a}function d(t,e,r){if(r>=t.length)return-1;let n=0;for(;e<r;e++){const r=w(t.charCodeAt(e));if(-1===r)return-1;n=16*n+r}return n}function w(t){return t>=i&&t<=a?t-i:t>=s&&t<=c?t-s+10:t>=u&&t<=l?t-u+10:-1}return h}()),g.exports}var m=h(y?p:(y=1,p=b()));if(String.dedent instanceof Function||(String.dedent=m),"Symbol"in globalThis){const t=new Set(Reflect.ownKeys(Symbol).filter(t=>"symbol"==typeof Symbol[t]).map(t=>Symbol[t]));void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator")),e(Symbol,"isRegistered",function(t){return"symbol"==typeof t&&"string"==typeof Symbol.keyFor(t)}),e(Symbol,"isWellKnown",function(e){return t.has(e)})}const d="Expected a set-like object.",w=["has","keys"],v=["size"],A=t=>t instanceof Set,E=t=>A(t)||"object"==typeof t&&null!==t&&w.every(e=>t[e]instanceof Function)&&v.every(e=>e in t);function T(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var S,x,P,F,k,O;function M(){if(x)return S;x=1;var t,e=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(t,r)=>e(t,"name",{value:r,configurable:!0}),a={};((t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})})(a,{URLPattern:()=>ot}),t=a,S=((t,i,a,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of n(i))!o.call(t,c)&&c!==a&&e(t,c,{get:()=>i[c],enumerable:!(s=r(i,c))||s.enumerable});return t})(e({},"__esModule",{value:!0}),t);var s=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,o,i){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=o,this.modifier=i}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}};i(s,"Part");var c=/[$_\p{ID_Start}]/u,u=/[$_\u200C\u200D\p{ID_Continue}]/u,l=".*";function h(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function f(t,e=!1){let r=[],n=0;for(;n<t.length;){let o=t[n],a=i(function(o){if(!e)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:t[n++]})},"ErrorOrInvalid");if("*"!==o)if("+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o){if(":"===o){let e="",o=n+1;for(;o<t.length;){let r=t.substr(o,1);if(!(o===n+1&&c.test(r)||o!==n+1&&u.test(r)))break;e+=t[o++]}if(!e){a(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:e}),n=o;continue}if("("===o){let e=1,o="",i=n+1,s=!1;if("?"===t[i]){a(`Pattern cannot start with "?" at ${i}`);continue}for(;i<t.length;){if(!h(t[i],!1)){a(`Invalid character '${t[i]}' at ${i}.`),s=!0;break}if("\\"!==t[i]){if(")"===t[i]){if(e--,0===e){i++;break}}else if("("===t[i]&&(e++,"?"!==t[i+1])){a(`Capturing groups are not allowed at ${i}`),s=!0;break}o+=t[i++]}else o+=t[i++]+t[i++]}if(s)continue;if(e){a(`Unbalanced pattern at ${n}`);continue}if(!o){a(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=i;continue}r.push({type:"CHAR",index:n,value:t[n++]})}else r.push({type:"CLOSE",index:n,value:t[n++]});else r.push({type:"OPEN",index:n,value:t[n++]});else r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});else r.push({type:"ASTERISK",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function p(t,e={}){let r=f(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${y(e.delimiter)}]+?`,o=[],a=0,c=0,u=new Set,h=i(t=>{if(c<r.length&&r[c].type===t)return r[c++].value},"tryConsume"),p=i(()=>h("OTHER_MODIFIER")??h("ASTERISK"),"tryConsumeModifier"),g=i(t=>{let e=h(t);if(void 0!==e)return e;let{type:n,index:o}=r[c];throw new TypeError(`Unexpected ${n} at ${o}, expected ${t}`)},"mustConsume"),b=i(()=>{let t,e="";for(;t=h("CHAR")??h("ESCAPED_CHAR");)e+=t;return e},"consumeText"),m=i(t=>t,"DefaultEncodePart"),d=e.encodePart||m,w="",v=i(t=>{w+=t},"appendToPendingFixedValue"),A=i(()=>{w.length&&(o.push(new s(3,"","",d(w),"",3)),w="")},"maybeAddPartFromPendingFixedValue"),E=i((t,e,r,i,c)=>{let h,f=3;switch(c){case"?":f=1;break;case"*":f=0;break;case"+":f=2}if(!e&&!r&&3===f)return void v(t);if(A(),!e&&!r){if(!t)return;return void o.push(new s(3,"","",d(t),"",f))}h=r?"*"===r?l:r:n;let p,y=2;if(h===n?(y=1,h=""):h===l&&(y=0,h=""),e?p=e:r&&(p=a++),u.has(p))throw new TypeError(`Duplicate name '${p}'.`);u.add(p),o.push(new s(y,p,d(t),h,d(i),f))},"addPart");for(;c<r.length;){let t=h("CHAR"),r=h("NAME"),n=h("REGEX");if(!r&&!n&&(n=h("ASTERISK")),r||n){let o=t??"";-1===e.prefixes.indexOf(o)&&(v(o),o=""),A(),E(o,r,n,"",p());continue}let o=t??h("ESCAPED_CHAR");if(o)v(o);else{if(h("OPEN")){let t=b(),e=h("NAME"),r=h("REGEX");!e&&!r&&(r=h("ASTERISK"));let n=b();g("CLOSE"),E(t,e,r,n,p());continue}A(),g("END")}}return o}function y(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function g(t){return t&&t.ignoreCase?"ui":"u"}function b(t,e,r){return d(p(t,r),e,r)}function m(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function d(t,e,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 t){if(3===o.type){3===o.modifier?n+=y(o.value):n+=`(?:${y(o.value)})${m(o.modifier)}`;continue}e&&e.push(o.name);let t=`[^${y(r.delimiter)}]+?`,i=o.value;(1===o.type?i=t:0===o.type&&(i=l),o.prefix.length||o.suffix.length)?3!==o.modifier&&1!==o.modifier?(n+=`(?:${y(o.prefix)}`,n+=`((?:${i})(?:`,n+=y(o.suffix),n+=y(o.prefix),n+=`(?:${i}))*)${y(o.suffix)})`,0===o.modifier&&(n+="?")):(n+=`(?:${y(o.prefix)}(${i})${y(o.suffix)})`,n+=m(o.modifier)):3===o.modifier||1===o.modifier?n+=`(${i})${m(o.modifier)}`:n+=`((?:${i})${m(o.modifier)})`}let o=`[${y(r.endsWith)}]|$`,i=`[${y(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(t.length){let e=t[t.length-1];3===e.type&&3===e.modifier&&(a=r.delimiter.indexOf(e)>-1)}return a||(n+=`(?=${i}|${o})`),new RegExp(n,g(r))}i(h,"isASCII"),i(f,"lexer"),i(p,"parse"),i(y,"escapeString"),i(g,"flags"),i(b,"stringToRegexp"),i(m,"modifierToString"),i(d,"partsToRegexp");var w={delimiter:"",prefixes:"",sensitive:!0,strict:!0},v={delimiter:".",prefixes:"",sensitive:!0,strict:!0},A={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function E(t,e){return!!t.length&&("/"===t[0]||!(!e||t.length<2)&&(("\\"==t[0]||"{"==t[0])&&"/"==t[1]))}function T(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function P(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function F(t){return!(!t||t.length<2)&&("["===t[0]||("\\"===t[0]||"{"===t[0])&&"["===t[1])}i(E,"isAbsolutePathname"),i(T,"maybeStripPrefix"),i(P,"maybeStripSuffix"),i(F,"treatAsIPv6Hostname");var k=["ftp","file","http","https","ws","wss"];function O(t){if(!t)return!0;for(let e of k)if(t.test(e))return!0;return!1}function M(t,e){if(t=T(t,"#"),e||""===t)return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function R(t,e){if(t=T(t,"?"),e||""===t)return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function C(t,e){return e||""===t?t:F(t)?q(t):H(t)}function I(t,e){if(e||""===t)return t;let r=new URL("https://example.com");return r.password=t,r.password}function $(t,e){if(e||""===t)return t;let r=new URL("https://example.com");return r.username=t,r.username}function j(t,e,r){if(r||""===t)return t;if(e&&!k.includes(e))return new URL(`${e}:${t}`).pathname;let n="/"==t[0];return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function U(t,e,r){return N(e)===t&&(t=""),r||""===t?t:z(t)}function L(t,e){return t=P(t,":"),e||""===t?t:B(t)}function N(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function B(t){if(""===t)return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function _(t){if(""===t)return t;let e=new URL("https://example.com");return e.username=t,e.username}function D(t){if(""===t)return t;let e=new URL("https://example.com");return e.password=t,e.password}function H(t){if(""===t)return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function q(t){if(""===t)return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function z(t){if(""===t||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function W(t){if(""===t)return t;let e=new URL("https://example.com");return e.pathname="/"!==t[0]?"/-"+t:t,"/"!==t[0]?e.pathname.substring(2,e.pathname.length):e.pathname}function G(t){return""===t?t:new URL(`data:${t}`).pathname}function K(t){if(""===t)return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function X(t){if(""===t)return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}i(O,"isSpecialScheme"),i(M,"canonicalizeHash"),i(R,"canonicalizeSearch"),i(C,"canonicalizeHostname"),i(I,"canonicalizePassword"),i($,"canonicalizeUsername"),i(j,"canonicalizePathname"),i(U,"canonicalizePort"),i(L,"canonicalizeProtocol"),i(N,"defaultPortForProtocol"),i(B,"protocolEncodeCallback"),i(_,"usernameEncodeCallback"),i(D,"passwordEncodeCallback"),i(H,"hostnameEncodeCallback"),i(q,"ipv6HostnameEncodeCallback"),i(z,"portEncodeCallback"),i(W,"standardURLPathnameEncodeCallback"),i(G,"pathURLPathnameEncodeCallback"),i(K,"searchEncodeCallback"),i(X,"hashEncodeCallback");var V=class{#e;#r=[];#n={};#o=0;#i=1;#a=0;#s=0;#c=0;#u=0;#l=!1;constructor(t){this.#e=t}get result(){return this.#n}parse(){for(this.#r=f(this.#e,!0);this.#o<this.#r.length;this.#o+=this.#i){if(this.#i=1,"END"===this.#r[this.#o].type){if(0===this.#s){this.#h(),this.#f()?this.#p(9,1):this.#y()?this.#p(8,1):this.#p(7,0);continue}if(2===this.#s){this.#g(5);continue}this.#p(10,0);break}if(this.#c>0){if(!this.#b())continue;this.#c-=1}if(this.#m())this.#c+=1;else switch(this.#s){case 0:this.#d()&&this.#g(1);break;case 1:if(this.#d()){this.#w();let t=7,e=1;this.#v()?(t=2,e=3):this.#l&&(t=2),this.#p(t,e)}break;case 2:this.#A()?this.#g(3):(this.#E()||this.#y()||this.#f())&&this.#g(5);break;case 3:this.#T()?this.#p(4,1):this.#A()&&this.#p(5,1);break;case 4:this.#A()&&this.#p(5,1);break;case 5:this.#S()?this.#u+=1:this.#x()&&(this.#u-=1),this.#P()&&!this.#u?this.#p(6,1):this.#E()?this.#p(7,0):this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 6:this.#E()?this.#p(7,0):this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 7:this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 8:this.#f()&&this.#p(9,1)}}void 0!==this.#n.hostname&&void 0===this.#n.port&&(this.#n.port="")}#p(t,e){switch(this.#s){case 0:case 2:break;case 1:this.#n.protocol=this.#F();break;case 3:this.#n.username=this.#F();break;case 4:this.#n.password=this.#F();break;case 5:this.#n.hostname=this.#F();break;case 6:this.#n.port=this.#F();break;case 7:this.#n.pathname=this.#F();break;case 8:this.#n.search=this.#F();break;case 9:this.#n.hash=this.#F()}0!==this.#s&&10!==t&&([1,2,3,4].includes(this.#s)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#s)&&[8,9].includes(t)&&(this.#n.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#s)&&9===t&&(this.#n.search??="")),this.#k(t,e)}#k(t,e){this.#s=t,this.#a=this.#o+e,this.#o+=e,this.#i=0}#h(){this.#o=this.#a,this.#i=0}#g(t){this.#h(),this.#s=t}#O(t){return t<0&&(t=this.#r.length-t),t<this.#r.length?this.#r[t]:this.#r[this.#r.length-1]}#M(t,e){let r=this.#O(t);return r.value===e&&("CHAR"===r.type||"ESCAPED_CHAR"===r.type||"INVALID_CHAR"===r.type)}#d(){return this.#M(this.#o,":")}#v(){return this.#M(this.#o+1,"/")&&this.#M(this.#o+2,"/")}#A(){return this.#M(this.#o,"@")}#T(){return this.#M(this.#o,":")}#P(){return this.#M(this.#o,":")}#E(){return this.#M(this.#o,"/")}#y(){if(this.#M(this.#o,"?"))return!0;if("?"!==this.#r[this.#o].value)return!1;let t=this.#O(this.#o-1);return"NAME"!==t.type&&"REGEX"!==t.type&&"CLOSE"!==t.type&&"ASTERISK"!==t.type}#f(){return this.#M(this.#o,"#")}#m(){return"OPEN"==this.#r[this.#o].type}#b(){return"CLOSE"==this.#r[this.#o].type}#S(){return this.#M(this.#o,"[")}#x(){return this.#M(this.#o,"]")}#F(){let t=this.#r[this.#o],e=this.#O(this.#a).index;return this.#e.substring(e,t.index)}#w(){let t={};Object.assign(t,w),t.encodePart=B;let e=b(this.#F(),void 0,t);this.#l=O(e)}};i(V,"Parser");var J=["protocol","username","password","hostname","port","pathname","search","hash"],Z="*";function Q(t,e){if("string"!=typeof t)throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);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 Y(t,e){return e?et(t):t}function tt(t,e,r){let n;if("string"==typeof e.baseURL)try{n=new URL(e.baseURL),void 0===e.protocol&&(t.protocol=Y(n.protocol.substring(0,n.protocol.length-1),r)),!r&&void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.username&&(t.username=Y(n.username,r)),!r&&void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.username&&void 0===e.password&&(t.password=Y(n.password,r)),void 0===e.protocol&&void 0===e.hostname&&(t.hostname=Y(n.hostname,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&(t.port=Y(n.port,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&(t.pathname=Y(n.pathname,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search&&(t.search=Y(n.search.substring(1,n.search.length),r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search&&void 0===e.hash&&(t.hash=Y(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if("string"==typeof e.protocol&&(t.protocol=L(e.protocol,r)),"string"==typeof e.username&&(t.username=$(e.username,r)),"string"==typeof e.password&&(t.password=I(e.password,r)),"string"==typeof e.hostname&&(t.hostname=C(e.hostname,r)),"string"==typeof e.port&&(t.port=U(e.port,t.protocol,r)),"string"==typeof e.pathname){if(t.pathname=e.pathname,n&&!E(t.pathname,r)){let e=n.pathname.lastIndexOf("/");e>=0&&(t.pathname=Y(n.pathname.substring(0,e+1),r)+t.pathname)}t.pathname=j(t.pathname,t.protocol,r)}return"string"==typeof e.search&&(t.search=R(e.search,r)),"string"==typeof e.hash&&(t.hash=M(e.hash,r)),t}function et(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function rt(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function nt(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=`[^${rt(e.delimiter)}]+?`,n=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let i=0;i<t.length;++i){let a=t[i];if(3===a.type){if(3===a.modifier){o+=et(a.value);continue}o+=`{${et(a.value)}}${m(a.modifier)}`;continue}let s=a.hasCustomName(),c=!!a.suffix.length||!!a.prefix.length&&(1!==a.prefix.length||!e.prefixes.includes(a.prefix)),u=i>0?t[i-1]:null,l=i<t.length-1?t[i+1]:null;if(!c&&s&&1===a.type&&3===a.modifier&&l&&!l.prefix.length&&!l.suffix.length)if(3===l.type){let t=l.value.length>0?l.value[0]:"";c=n.test(t)}else c=!l.hasCustomName();if(!c&&!a.prefix.length&&u&&3===u.type){let t=u.value[u.value.length-1];c=e.prefixes.includes(t)}c&&(o+="{"),o+=et(a.prefix),s&&(o+=`:${a.name}`),2===a.type?o+=`(${a.value})`:1===a.type?s||(o+=`(${r})`):0===a.type&&(s||u&&3!==u.type&&3===u.modifier&&!c&&""===a.prefix?o+="(.*)":o+="*"),1===a.type&&s&&a.suffix.length&&n.test(a.suffix[0])&&(o+="\\"),o+=et(a.suffix),c&&(o+="}"),3!==a.modifier&&(o+=m(a.modifier))}return o}i(Q,"extractValues"),i(Y,"processBaseURLString"),i(tt,"applyInit"),i(et,"escapePatternString"),i(rt,"escapeRegexpString"),i(nt,"partsToPattern");var ot=class{#e;#r={};#n={};#o={};#i={};#a=!1;constructor(t={},e,r){try{let n;if("string"==typeof e?n=e:r=e,"string"==typeof t){let e=new V(t);if(e.parse(),t=e.result,void 0===n&&"string"!=typeof t.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n}else{if(!t||"object"!=typeof t)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:Z,protocol:Z,username:Z,password:Z,hostname:Z,port:Z,search:Z,hash:Z};for(o of(this.#e=tt(a,t,!0),N(this.#e.protocol)===this.#e.port&&(this.#e.port=""),J)){if(!(o in this.#e))continue;let t={},e=this.#e[o];switch(this.#n[o]=[],o){case"protocol":Object.assign(t,w),t.encodePart=B;break;case"username":Object.assign(t,w),t.encodePart=_;break;case"password":Object.assign(t,w),t.encodePart=D;break;case"hostname":Object.assign(t,v),F(e)?t.encodePart=q:t.encodePart=H;break;case"port":Object.assign(t,w),t.encodePart=z;break;case"pathname":O(this.#r.protocol)?(Object.assign(t,A,i),t.encodePart=W):(Object.assign(t,w,i),t.encodePart=G);break;case"search":Object.assign(t,w,i),t.encodePart=K;break;case"hash":Object.assign(t,w,i),t.encodePart=X}try{this.#i[o]=p(e,t),this.#r[o]=d(this.#i[o],this.#n[o],t),this.#o[o]=nt(this.#i[o],t),this.#a=this.#a||this.#i[o].some(t=>2===t.type)}catch{throw new TypeError(`invalid ${o} pattern '${this.#e[o]}'.`)}}}catch(t){throw new TypeError(`Failed to construct 'URLPattern': ${t.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(t={},e){let r,n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return!1;try{n=tt(n,"object"==typeof t?t:Q(t,e),!1)}catch{return!1}for(r of J)if(!this.#r[r].exec(n[r]))return!1;return!0}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{r=tt(r,"object"==typeof t?t:Q(t,e),!1)}catch{return null}let n,o={};for(n of(o.inputs=e?[t,e]:[t],J)){let t=this.#r[n].exec(r[n]);if(!t)return null;let e={};for(let[r,o]of this.#n[n].entries())if("string"==typeof o||"number"==typeof o){let n=t[r+1];e[o]=n}o[n]={input:r[n]??"",groups:e}}return o}static compareComponent(t,e,r){let n=i((t,e)=>{for(let r of["type","modifier","prefix","value","suffix"]){if(t[r]<e[r])return-1;if(t[r]!==e[r])return 1}return 0},"comparePart"),o=new s(3,"","","","",3),a=new s(0,"","","","",3),c=i((t,e)=>{let r=0;for(;r<Math.min(t.length,e.length);++r){let o=n(t[r],e[r]);if(o)return o}return t.length===e.length?0:n(t[r]??o,e[r]??o)},"comparePartList");return e.#o[t]||r.#o[t]?e.#o[t]&&!r.#o[t]?c(e.#i[t],[a]):!e.#o[t]&&r.#o[t]?c([a],r.#i[t]):c(e.#i[t],r.#i[t]):0}get protocol(){return this.#o.protocol}get username(){return this.#o.username}get password(){return this.#o.password}get hostname(){return this.#o.hostname}get port(){return this.#o.port}get pathname(){return this.#o.pathname}get search(){return this.#o.search}get hash(){return this.#o.hash}get hasRegExpGroups(){return this.#a}};return i(ot,"URLPattern"),S}Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(t){if(!E(t))throw new TypeError(d);return new Set([...this].filter(e=>t.has(e)))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(t){if(!E(t))throw new TypeError(d);return new Set([...this].filter(e=>!t.has(e)))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(t){return new Set([...this,...t])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(t){if(!E(t))throw new TypeError(d);return[...this].every(e=>t.has(e))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(t){if(!E(t))throw new TypeError(d);return A(t)?t.isSubsetOf(this):new Set(t.keys()).isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(t){if(!E(t))throw new TypeError(d);return A(t)?new Set([...this.difference(t),...t.difference(this)]):new Set([...this.difference(t),...new Set(t.keys()).difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(t){if(!E(t))throw new TypeError(d);return new Set([...this,...t]).size===this.size+t.size});var R=T(O?k:(O=1,k=function(){if(F)return P;F=1;const{URLPattern:t}=M();return P={URLPattern:t},globalThis.URLPattern||(globalThis.URLPattern=t),P}()));"URLPattern"in globalThis||(globalThis.URLPattern=R),e(URL,"parse",(t,e)=>{try{return new URL(t,e)}catch{return null}}),e(URL,"canParse",(t,e)=>{try{return new URL(t,e)instanceof URL}catch{return!1}}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(t,{insert:e,update:r}={}){const n=this.has(t);if(n&&r instanceof Function){const e=this.get(t),n=r.call(this,e,t,this);return n!==e&&this.set(t,e),n}if(n)return this.get(t);if(e instanceof Function){const r=e.call(this,t,this);return this.set(t,r),r}throw new Error("Key is not found and no `insert()` given")});
package/node.min.js CHANGED
@@ -1,6 +1,6 @@
1
- !function(){"use strict";if(!("AbortSignal"in globalThis)){const t={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,{[t.aborted]:{enumerable:!1,writable:!0,configurable:!1,value:!1},[t.reason]:{enumerable:!1,writable:!0,configurable:!1,value:void 0},[t.onabort]:{enumerable:!1,writable:!0,configurable:!1,value:null}}),this.addEventListener("abort",t=>{this.onabort instanceof Function&&this.onabort.call(this,t)})}get aborted(){return this[t.aborted]}get onabort(){return this[t.onabort]}set onabort(e){this[t.onabort]=e instanceof Function?e:null}get reason(){return this[t.reason]}throwIfAborted(){if(this.aborted)throw this.reason}static abort(r=new DOMException("Operation aborted")){const n=new e;return n[t.aborted]=!0,n[t.reason]=r,n}},globalThis.AbortController=class{constructor(){this[t.signal]=new AbortSignal}get signal(){return this[t.signal]}abort(e=new DOMException("Operation aborted")){const r=this.signal;r.aborted||(r[t.aborted]=!0,r[t.reason]=e,r.dispatchEvent(new Event("abort")))}}}if(!("reason"in AbortSignal.prototype)){const t=new WeakMap,e=AbortController.prototype.abort;if(AbortSignal.abort instanceof Function){const e=AbortSignal.abort;AbortSignal.abort=function(r=new DOMException("Operation aborted")){const n=e();return t.set(n,r),n}}else AbortSignal.abort=function(t=new DOMException("Operation aborted")){const e=new AbortController;return e.abort(t),e.reason};Object.defineProperty(AbortSignal.prototype,"reason",{enumerable:!0,configurable:!0,get:function(){return t.has(this)?t.get(this):void 0}}),AbortController.prototype.abort=function(r=new DOMException("Operation aborted")){t.set(this.signal,r),e.call(this)}}AbortSignal.prototype.throwIfAborted instanceof Function||(AbortSignal.prototype.throwIfAborted=function(){if(this.aborted)throw this.reason}),AbortSignal.timeout instanceof Function||(AbortSignal.timeout=function(t){if(void 0===t)throw new TypeError("At least one 1 argument required but only 0 passed");if(Number.isFinite(t)){if(t<0)throw new TypeError("Argument 1 is out of range for unsigned long long.");{const e=new AbortController;return setTimeout(()=>e.abort(new DOMException("The operation timed out.")),t),e.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(t){if(!Array.isArray(t))throw new TypeError("Expected an array of signals");const e=new AbortController;for(const r of t){if(!(r instanceof AbortSignal)){const t=new TypeError("`signal` is not an `AbortSignal`");throw e.abort(t),t}if(r.aborted){e.abort(r.reason||new DOMException("Operation aborted."));break}r.addEventListener("abort",({target:t})=>{e.abort(t.reason||new DOMException("Operation aborted."))},{signal:e.signal})}return e.signal});const t=[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(t=1){const e=[];t=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,t));const r=(t,n)=>{Array.isArray(t)&&n>=0?t.forEach(t=>r(t,n-1)):e.push(t)};return r(this,Number.isNaN(t)?0:t),e}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(t,e){return this.map(t,e).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(t,e){let r;return this.forEach((n,o,i)=>{t.call(e,n,o,i)&&(r=n)},e),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(t){this[this.lastIndex]=t}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(t,e){let r=-1;return this.forEach((n,o,i)=>{t.call(e,n,o,i)&&(r=o)},e),r}),!(Array.prototype.at instanceof Function)){const e=function(t){if((t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]};for(const r of t)void 0!==r&&Object.defineProperty(r.prototype,"at",{value:e,writable:!0,enumerable:!1,configurable:!0})}function e(t,e,r,{writable:n=!0,enumerable:o=!0,configurable:i=!0}={}){t[e]instanceof Function||Object.defineProperty(t,e,{value:r,writable:n,enumerable:o,configurable:i})}if(!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(t){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,t)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(t){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,t)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(t){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,t)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(t){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,t)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(t,e,r=globalThis){let n=[];for await(const e of t)n.push(await e);return Array.from(n,e,r)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(t){return this===t||!!Array.isArray(t)&&(this.length===t.length&&this.every((e,r)=>{const n=t[r];return Array.isArray(e)?Array.isArray(n)&&e.equals(n):Object.is(e,n)}))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(t){switch(typeof t){case"undefined":return[...new Set(this)];case"string":case"number":case"symbol":return this.uniqueBy(e=>e[t]);case"function":{const e=new Set;return this.filter((...r)=>{const n=t.apply(this,r);return!e.has(n)&&(e.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(t){return[...this].sort(t)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(t,e,...r){const n=[...this];return n.splice(t,e,...r),n}),Array.prototype.with instanceof Function||(Array.prototype.with=function(t,e){const r=[...this];return r[t]=e,r}),Array.isTemplateObject instanceof Function||(Array.isTemplateObject=function(t){return!!(Array.isArray(t)&&Array.isArray(t.raw)&&Object.isFrozen(t)&&Object.isFrozen(t.raw))&&(0!==t.length&&t.length===t.raw.length)}),Uint8Array.prototype.toHex instanceof Function||(Uint8Array.prototype.toHex=function(){return Array.from(this,t=>t.toString(16).padStart(2,"0")).join("")}),Uint8Array.prototype.toBase64 instanceof Function||(Uint8Array.prototype.toBase64=function({alphabet:t="base64"}={}){if("base64"===t){const t=32768;let e="";for(let r=0;r<this.length;r+=t){const n=this.subarray(r,r+t);e+=String.fromCharCode.apply(null,n)}return btoa(e)}if("base64url"===t)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(t){if("string"!=typeof t)throw new TypeError("expected input to be a string");if(0===!(1&t.length))throw new SyntaxError("string should be an even number of characters");return Uint8Array.from(globalThis.Iterator.range(0,t.length,{step:2}),e=>parseInt(t.substring(e,e+2),16))}),Uint8Array.fromBase64 instanceof Function||(Uint8Array.fromBase64=function(t,{alphabet:e="base64",lastChunkHandling:r="loose"}={}){if("string"!=typeof t)throw new TypeError("expected input to be a string");if(!["base64","base64url"].includes(e))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"!==e)return Uint8Array.fromBase64(t.replaceAll("-","+").replaceAll("_","/"),{alphabet:"base64"});{const e=t.length%4;if(1===e)throw new TypeError("Invalid string length.");if(0===e)return Uint8Array.from(atob(t),t=>t.charCodeAt(0));switch(r){case"strict":throw new SyntaxError("Missing padding.");case"loose":return Uint8Array.fromBase64(t.padEnd(t.length+(4-e),"="),{alphabet:"base64",lastChunkHandling:"strict"});case"stop-before-partial":return Uint8Array.fromBase64(t.slice(0,t.length-e),{alphabet:"base64",lastChunkHandling:"strict"})}}}),e(Blob.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())}),globalThis.hasOwnProperty("AggregateError")||(globalThis.AggregateError=class extends Error{constructor(t,e){void 0===e?(super(t),this.errors=[]):(super(e),this.errors=t)}}),globalThis.reportError instanceof Function||(globalThis.reportError=function(t){globalThis.dispatchEvent(function(t,e="error"){if(t instanceof Error){const{message:r,name:n,fileName:o,lineNumber:i,columnNumber:a}=t;return new ErrorEvent(e,{error:t,message:`${n}: ${r}`,filename:o,lineno:i,colno:a})}throw new TypeError("`errorToEvent()` only accepts Errors")}(t))}),!(Error.isError instanceof Function)){const t=Function.bind.call(Function.call,Object.prototype.toString);Error.isError=function(e){return e instanceof Error||"object"==typeof e&&"[object Error]"===t(e)&&void 0===e[Symbol.toStringTag]}}!function(){if(!(Function.prototype.once instanceof Function)){const t=new WeakMap;Function.prototype.once=function(e){const r=this;return function(...n){if(t.has(r))return t.get(r);if("AsyncFunction"===r.constructor.name){const o=r.apply(e||r,n).catch(e=>{throw t.delete(r),e});return t.set(r,o),o}if(r instanceof Function){const o=r.apply(e||r,n);return t.set(r,o),o}}}}}();const r="Iterator"in globalThis,n=r?Object.getPrototypeOf(globalThis.Iterator):Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),o=r?globalThis.Iterator:(t=>{class e{[Symbol.iterator](){return this}}return Object.setPrototypeOf(e,t),e})(n);var i;if(o.range instanceof Function||(o.range=function(t,e,r){if("number"==typeof r||"bigint"==typeof r)return o.range(t,e,{step:r});if("object"!=typeof r||Object.is(r,null))return o.range(t,e,{});{const{step:n=("number"==typeof t?t<e?1:-1:t<e?1n:-1n),inclusive:i=!1}=r;if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("Start must be a number");if(Number.isNaN(t))throw new RangeError("Invalid start");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("End must be a number");if(Number.isNaN(e))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&&t<e||n>0&&t>e)return;if(i){let r=t;return n>0?o.from({next(){const t=r<=e?{value:r,done:!1}:{done:!0};return r+=n,t}}):o.from({next(){const t=r>=e?{value:r,done:!1}:{done:!0};return r+=n,t}})}{let r=t;if(n>0)return o.from({next(){const t=r<e?{value:r,done:!1}:{done:!0};return r+=n,t}});{let r=t;return o.from({next(){const t=r>e?{value:r,done:!1}:{done:!0};return r+=n,t}})}}}}),n[Symbol.toStringTag]||(n[Symbol.toStringTag]="Iterator"),n.take instanceof Function||(n.take=function(t){let e=0;const r=this;return o.from({next:()=>e++>=t?{done:!0}:r.next()})}),n.drop instanceof Function||(n.drop=function(t){for(let e=0;e<t;e++){const{done:t}=this.next();if(t)break}return this}),n.toArray instanceof Function||(n.toArray=function(){return Array.from(this)}),n.forEach instanceof Function||(n.forEach=function(t){for(const e of this)t.call(this,e)}),n.flatMap instanceof Function||(n.flatMap=function(t){const e=this;let r=this.next();const n=({value:r,done:n=!0}={})=>n?o.from({next:()=>({done:!0})}):o.from(t.call(e,r));let i=n(r);return o.from({next(){const{value:t,done:o=!0}=i.next();return r.done&&o?{done:!0}:o?r.done?{done:!0}:(r=e.next(),i=n(r),i.next()):{value:t,done:o}}})}),n.map instanceof Function||(n.map=function(t){const e=this;return o.from({next(){const{done:r,value:n}=e.next();return r?{done:r}:{value:t.call(e,n),done:!1}}})}),n.reduce instanceof Function||(n.reduce=function(t,e){let r=void 0===e?this.next().value:e;for(const e of this)r=t.call(this,r,e);return r}),n.filter instanceof Function||(n.filter=function(t){const e=this;let r,n=!1;return o.from({next(){for(;!n;){const o=e.next();if(n=o.done,n)break;if(t.call(e,o.value)){r=o.value;break}}return{done:n,value:r}}})}),n.some instanceof Function||(n.some=function(t){let e=!1;for(const r of this)if(t.call(this,r)){e=!0;break}return e}),n.every instanceof Function||(n.every=function(t){let e=!0;for(const r of this)if(!t.call(this,r)){e=!1;break}return e}),n.find instanceof Function||(n.find=function(t){for(const e of this)if(t.call(this,e))return e}),n.indexed instanceof Function||(n.indexed=function(){let t=0;return this.map(e=>[t++,e])}),n.chunks instanceof Function||(n.chunks=function(t){if(!Number.isSafeInteger(t)||t<1)throw new TypeError("Size must be a positive integer.");{const e=this;let r=!1;return o.from({next(){if(r)return{done:r};{const n=[];let o=0;for(;o++<t&&!r;){const t=e.next();if(t.done){r=!0,void 0!==t.value&&n.push(t.value);break}n.push(t.value)}return{value:n,done:!1}}}})}}),o.from instanceof Function||(o.from=function(t){if("object"!=typeof t||null===t)throw new TypeError("Not an object.");if(t.next instanceof Function){return Object.create(n,{next:{enumerable:!0,configurable:!1,writable:!1,value:(...e)=>t.next(...e)}})}if(t[Symbol.iterator]instanceof Function)return o.from(t[Symbol.iterator]())}),r||(globalThis.Iterator=o),e(ReadableStream,"from",function(t){if(t[Symbol.iterator]instanceof Function)return new ReadableStream({start(e){try{for(const r of t)e.enqueue(r)}catch(t){e.error(t)}finally{e.close()}}});if(t[Symbol.asyncIterator]instanceof Function)return new ReadableStream({async start(e){try{for await(const r of t)e.enqueue(r)}catch(t){e.error(t)}finally{e.close()}}});throw new TypeError("`ReadableStream.from()` requires an iterable source.")}),Map.prototype.getOrInsert instanceof Function||(Map.prototype.getOrInsert=function(t,e){return this.has(t)?this.get(t):(this.set(t,e),e)},Map.prototype.getOrInsertComputed=function(t,e){if(this.has(t))return this.get(t);{const r=e(t);return this.set(t,r),r}}),WeakMap.prototype.getOrInsert instanceof Function||(WeakMap.prototype.getOrInsert=function(t,e){return Map.prototype.getOrInsert.call(this,t,e)},WeakMap.prototype.getOrInsertComputed=function(t,e){return WeakMap.prototype.getOrInsertComputed.call(this,t,e)}),Map.groupBy instanceof Function||(Map.groupBy=function(t,e){return Array.from(t).reduce((t,r,n)=>(t.emplace(e.call(t,r,n),{insert:()=>[r],update:t=>(t.push(r),t)}),t),new Map)}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(t,{insert:e,update:r}={}){console.warn("`Map.prototype.emplace()` has been removed from the proposal and will be removed in the future.");const n=this.has(t);if(n&&r instanceof Function){const e=this.get(t),n=r.call(this,e,t,this);return n!==e&&this.set(t,n),n}if(n)return this.get(t);if(e instanceof Function){const r=e.call(this,t,this);return this.set(t,r),r}throw new Error("Key is not found and no `insert()` given")}),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=t=>t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=t=>(t>0)-(t<0)||+t),Math.hasOwnProperty("trunc")||(Math.trunc=t=>{const e=t-t%1;return 0===e&&(t<0||0===t&&1/t!=1/0)?-0:e}),Math.hasOwnProperty("expm1")||(Math.expm1=t=>Math.exp(t)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...t)=>Math.sqrt(t.reduce((t,e)=>t+e**2,0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=t=>t**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=t=>Math.log(t)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=t=>Math.log(t)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=t=>Math.log(1+t)),Math.hasOwnProperty("fround")||(Math.fround=(i=new Float32Array(1),function(t){return i[0]=t,i[0]})),Math.clamp instanceof Function||(Math.clamp=function(t,e,r){return Math.min(Math.max(t,e),r)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),Math.sumPrecise instanceof Function||(Math.sumPrecise=function(t){let e=-0;for(const r of t){if(!Number.isFinite(r)){e=-0;break}e+=r}return e}),Math.sum instanceof Function||(Math.sum=function(...t){return console.warn("Math.sum is deprecated. Please use Math.sumPrecise instead."),Math.sumPrecise(t)}),Object.groupBy instanceof Function||(Object.groupBy=function(t,e){return Array.from(t).reduce((t,r,n)=>{const o=e.call(t,r,n);return t.hasOwnProperty(o)?t[o].push(r):t[o]=[r],t},{})}),function(){if(!(globalThis.requestIdleCallback instanceof Function)){const t=t=>Number.isSafeInteger(t)&&t>0;globalThis.requestIdleCallback=function(e,{timeout:r}={}){const n=performance.now(),o=()=>t(r)?Math.max(0,r-(performance.now()-n)):Math.max(0,600-(performance.now()-n));return setTimeout(()=>e({didTimeout:!!t(r)&&0===o(),timeRemaining:o}),1)}}globalThis.cancelIdleCallback instanceof Function||(globalThis.cancelIdleCallback=t=>clearTimeout(t)),globalThis.requestAnimationFrame instanceof Function||(globalThis.requestAnimationFrame=t=>setTimeout(()=>t(performance.now()),1e3/60)),globalThis.cancelAnimationFrame instanceof Function||(globalThis.cancelAnimationFrame=t=>clearTimeout(t)),globalThis.queueMicrotask instanceof Function||(globalThis.queueMicrotask=t=>Promise.resolve().then(t).catch(t=>setTimeout(()=>{throw t})))}(),"Promise"in globalThis&&(Promise.prototype.finally instanceof Function||(Promise.prototype.finally=function(t){return this.then(async e=>(await t(),e),async e=>(await t(),e))}),Promise.allSettled instanceof Function||(Promise.allSettled=function(t){return Promise.all(Array.from(t).map(function(t){return new Promise(function(e){t instanceof Promise||(t=Promise.resolve(t)),t.then(function(t){e({status:"fulfilled",value:t})}).catch(function(t){e({status:"rejected",reason:t})})})}))}),Promise.any instanceof Function||(Promise.any=t=>new Promise((e,r)=>{let n=[];t.forEach(o=>{o.then(e).catch(e=>{n.push(e),n.length===t.length&&r(new globalThis.AggregateError(n,"No Promise in Promise.any was resolved"))})})})),Promise.race instanceof Function||(Promise.race=t=>new Promise((e,r)=>{t.forEach(t=>t.then(e,r))})),Promise.try instanceof Function||(Promise.try=(t,...e)=>new Promise(r=>r(t(...e)))),Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}),Promise.fromEntries instanceof Function||(Promise.fromEntries=async function(t){const e=[],r=[];for(const[n,o]of t)e.push(n),r.push(o);return await Promise.all(r).then(t=>Object.fromEntries(t.map((t,r)=>[e[r],t])))}),Promise.ownProperties instanceof Function||(Promise.ownProperties=async function(t){return await Promise.fromEntries(Object.entries(t))})),!(RegExp.escape instanceof Function)){const t=/[-[\]/{}()<>=#&!@%*+?.\\^$|;:"'`\s]/g;RegExp.escape=function(e){return e.toString().replace(t,"\\$&")}}e(Request.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())}),e(Response,"json",(t,{status:e=200,statusText:r="",headers:n=new Headers}={})=>n instanceof Headers?(n.set("Content-Type","application/json"),new Response(JSON.stringify(t),{status:e,statusText:r,headers:n})):Response.json(t,{status:e,statusText:r,headers:new Headers(n)})),e(Response,"redirect",(t,e=302)=>new Response(null,{status:e,headers:new Headers({Location:t})})),e(Response.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())});
1
+ !function(){"use strict";if(!("AbortSignal"in globalThis)){const t={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,{[t.aborted]:{enumerable:!1,writable:!0,configurable:!1,value:!1},[t.reason]:{enumerable:!1,writable:!0,configurable:!1,value:void 0},[t.onabort]:{enumerable:!1,writable:!0,configurable:!1,value:null}}),this.addEventListener("abort",t=>{this.onabort instanceof Function&&this.onabort.call(this,t)})}get aborted(){return this[t.aborted]}get onabort(){return this[t.onabort]}set onabort(e){this[t.onabort]=e instanceof Function?e:null}get reason(){return this[t.reason]}throwIfAborted(){if(this.aborted)throw this.reason}static abort(r=new DOMException("Operation aborted")){const n=new e;return n[t.aborted]=!0,n[t.reason]=r,n}},globalThis.AbortController=class{constructor(){this[t.signal]=new AbortSignal}get signal(){return this[t.signal]}abort(e=new DOMException("Operation aborted")){const r=this.signal;r.aborted||(r[t.aborted]=!0,r[t.reason]=e,r.dispatchEvent(new Event("abort")))}}}if(!("reason"in AbortSignal.prototype)){const t=new WeakMap,e=AbortController.prototype.abort;if(AbortSignal.abort instanceof Function){const e=AbortSignal.abort;AbortSignal.abort=function(r=new DOMException("Operation aborted")){const n=e();return t.set(n,r),n}}else AbortSignal.abort=function(t=new DOMException("Operation aborted")){const e=new AbortController;return e.abort(t),e.reason};Object.defineProperty(AbortSignal.prototype,"reason",{enumerable:!0,configurable:!0,get:function(){return t.has(this)?t.get(this):void 0}}),AbortController.prototype.abort=function(r=new DOMException("Operation aborted")){t.set(this.signal,r),e.call(this)}}AbortSignal.prototype.throwIfAborted instanceof Function||(AbortSignal.prototype.throwIfAborted=function(){if(this.aborted)throw this.reason}),AbortSignal.timeout instanceof Function||(AbortSignal.timeout=function(t){if(void 0===t)throw new TypeError("At least one 1 argument required but only 0 passed");if(Number.isFinite(t)){if(t<0)throw new TypeError("Argument 1 is out of range for unsigned long long.");{const e=new AbortController;return setTimeout(()=>e.abort(new DOMException("The operation timed out.")),t),e.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(t){if(!Array.isArray(t))throw new TypeError("Expected an array of signals");const e=new AbortController;for(const r of t){if(!(r instanceof AbortSignal)){const t=new TypeError("`signal` is not an `AbortSignal`");throw e.abort(t),t}if(r.aborted){e.abort(r.reason||new DOMException("Operation aborted."));break}r.addEventListener("abort",({target:t})=>{e.abort(t.reason||new DOMException("Operation aborted."))},{signal:e.signal})}return e.signal});const t=[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(t=1){const e=[];t=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,t));const r=(t,n)=>{Array.isArray(t)&&n>=0?t.forEach(t=>r(t,n-1)):e.push(t)};return r(this,Number.isNaN(t)?0:t),e}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(t,e){return this.map(t,e).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(t,e){let r;return this.forEach((n,o,i)=>{t.call(e,n,o,i)&&(r=n)},e),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(t){this[this.lastIndex]=t}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(t,e){let r=-1;return this.forEach((n,o,i)=>{t.call(e,n,o,i)&&(r=o)},e),r}),!(Array.prototype.at instanceof Function)){const e=function(t){if((t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]};for(const r of t)void 0!==r&&Object.defineProperty(r.prototype,"at",{value:e,writable:!0,enumerable:!1,configurable:!0})}function e(t,e,r,{writable:n=!0,enumerable:o=!0,configurable:i=!0}={}){t[e]instanceof Function||Object.defineProperty(t,e,{value:r,writable:n,enumerable:o,configurable:i})}if(!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(t){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,t)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(t){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,t)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(t){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,t)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(t){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,t)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(t,e,r=globalThis){let n=[];for await(const e of t)n.push(await e);return Array.from(n,e,r)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(t){return this===t||!!Array.isArray(t)&&(this.length===t.length&&this.every((e,r)=>{const n=t[r];return Array.isArray(e)?Array.isArray(n)&&e.equals(n):Object.is(e,n)}))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(t){switch(typeof t){case"undefined":return[...new Set(this)];case"string":case"number":case"symbol":return this.uniqueBy(e=>e[t]);case"function":{const e=new Set;return this.filter((...r)=>{const n=t.apply(this,r);return!e.has(n)&&(e.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(t){return[...this].sort(t)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(t,e,...r){const n=[...this];return n.splice(t,e,...r),n}),Array.prototype.with instanceof Function||(Array.prototype.with=function(t,e){const r=[...this];return r[t]=e,r}),Array.isTemplateObject instanceof Function||(Array.isTemplateObject=function(t){return!!(Array.isArray(t)&&Array.isArray(t.raw)&&Object.isFrozen(t)&&Object.isFrozen(t.raw))&&(0!==t.length&&t.length===t.raw.length)}),Uint8Array.prototype.toHex instanceof Function||(Uint8Array.prototype.toHex=function(){return Array.from(this,t=>t.toString(16).padStart(2,"0")).join("")}),Uint8Array.prototype.toBase64 instanceof Function||(Uint8Array.prototype.toBase64=function({alphabet:t="base64"}={}){if("base64"===t){const t=32768;let e="";for(let r=0;r<this.length;r+=t){const n=this.subarray(r,r+t);e+=String.fromCharCode.apply(null,n)}return btoa(e)}if("base64url"===t)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(t){if("string"!=typeof t)throw new TypeError("expected input to be a string");if(0===!(1&t.length))throw new SyntaxError("string should be an even number of characters");return Uint8Array.from(globalThis.Iterator.range(0,t.length,{step:2}),e=>parseInt(t.substring(e,e+2),16))}),Uint8Array.fromBase64 instanceof Function||(Uint8Array.fromBase64=function(t,{alphabet:e="base64",lastChunkHandling:r="loose"}={}){if("string"!=typeof t)throw new TypeError("expected input to be a string");if(!["base64","base64url"].includes(e))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"!==e)return Uint8Array.fromBase64(t.replaceAll("-","+").replaceAll("_","/"),{alphabet:"base64"});{const e=t.length%4;if(1===e)throw new TypeError("Invalid string length.");if(0===e)return Uint8Array.from(atob(t),t=>t.charCodeAt(0));switch(r){case"strict":throw new SyntaxError("Missing padding.");case"loose":return Uint8Array.fromBase64(t.padEnd(t.length+(4-e),"="),{alphabet:"base64",lastChunkHandling:"strict"});case"stop-before-partial":return Uint8Array.fromBase64(t.slice(0,t.length-e),{alphabet:"base64",lastChunkHandling:"strict"})}}}),e(Blob.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())}),globalThis.hasOwnProperty("AggregateError")||(globalThis.AggregateError=class extends Error{constructor(t,e){void 0===e?(super(t),this.errors=[]):(super(e),this.errors=t)}}),globalThis.reportError instanceof Function||(globalThis.reportError=function(t){globalThis.dispatchEvent(function(t,e="error"){if(t instanceof Error){const{message:r,name:n,fileName:o,lineNumber:i,columnNumber:a}=t;return new ErrorEvent(e,{error:t,message:`${n}: ${r}`,filename:o,lineno:i,colno:a})}throw new TypeError("`errorToEvent()` only accepts Errors")}(t))}),!(Error.isError instanceof Function)){const t=Function.bind.call(Function.call,Object.prototype.toString);Error.isError=function(e){return e instanceof Error||"object"==typeof e&&"[object Error]"===t(e)&&void 0===e[Symbol.toStringTag]}}!function(){if(!(Function.prototype.once instanceof Function)){const t=new WeakMap;Function.prototype.once=function(e){const r=this;return function(...n){if(t.has(r))return t.get(r);if("AsyncFunction"===r.constructor.name){const o=r.apply(e||r,n).catch(e=>{throw t.delete(r),e});return t.set(r,o),o}if(r instanceof Function){const o=r.apply(e||r,n);return t.set(r,o),o}}}}}();const r="Iterator"in globalThis,n=r?globalThis.Iterator.prototype:Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),o=r?globalThis.Iterator:(t=>{class e{[Symbol.iterator](){return this}get[Symbol.toStringTag](){return"Iterator"}}return Object.setPrototypeOf(e,t),e})(n);var i;if(o.range instanceof Function||(o.range=function(t,e,r){if("number"==typeof r||"bigint"==typeof r)return o.range(t,e,{step:r});if("object"!=typeof r||Object.is(r,null))return o.range(t,e,{});{const{step:n=("number"==typeof t?t<e?1:-1:t<e?1n:-1n),inclusive:i=!1}=r;if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("Start must be a number");if(Number.isNaN(t))throw new RangeError("Invalid start");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("End must be a number");if(Number.isNaN(e))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&&t<e||n>0&&t>e)return;if(i){let r=t;return n>0?o.from({next(){const t=r<=e?{value:r,done:!1}:{done:!0};return r+=n,t}}):o.from({next(){const t=r>=e?{value:r,done:!1}:{done:!0};return r+=n,t}})}{let r=t;if(n>0)return o.from({next(){const t=r<e?{value:r,done:!1}:{done:!0};return r+=n,t}});{let r=t;return o.from({next(){const t=r>e?{value:r,done:!1}:{done:!0};return r+=n,t}})}}}}),n[Symbol.toStringTag]||(n[Symbol.toStringTag]="Iterator"),n.take instanceof Function||(n.take=function(t){let e=0;const r=this;return o.from({next:()=>e++>=t?{done:!0}:r.next()})}),n.drop instanceof Function||(n.drop=function(t){for(let e=0;e<t;e++){const{done:t}=this.next();if(t)break}return this}),n.toArray instanceof Function||(n.toArray=function(){return Array.from(this)}),n.forEach instanceof Function||(n.forEach=function(t){for(const e of this)t.call(this,e)}),n.flatMap instanceof Function||(n.flatMap=function(t){const e=this;let r=this.next();const n=({value:r,done:n=!0}={})=>n?o.from({next:()=>({done:!0})}):o.from(t.call(e,r));let i=n(r);return o.from({next(){const{value:t,done:o=!0}=i.next();return r.done&&o?{done:!0}:o?r.done?{done:!0}:(r=e.next(),i=n(r),i.next()):{value:t,done:o}}})}),n.map instanceof Function||(n.map=function(t){const e=this;return o.from({next(){const{done:r,value:n}=e.next();return r?{done:r}:{value:t.call(e,n),done:!1}}})}),n.reduce instanceof Function||(n.reduce=function(t,e){let r=void 0===e?this.next().value:e;for(const e of this)r=t.call(this,r,e);return r}),n.filter instanceof Function||(n.filter=function(t){const e=this;let r,n=!1;return o.from({next(){for(;!n;){const o=e.next();if(n=o.done,n)break;if(t.call(e,o.value)){r=o.value;break}}return{done:n,value:r}}})}),n.some instanceof Function||(n.some=function(t){let e=!1;for(const r of this)if(t.call(this,r)){e=!0;break}return e}),n.every instanceof Function||(n.every=function(t){let e=!0;for(const r of this)if(!t.call(this,r)){e=!1;break}return e}),n.find instanceof Function||(n.find=function(t){for(const e of this)if(t.call(this,e))return e}),n.indexed instanceof Function||(n.indexed=function(){let t=0;return this.map(e=>[t++,e])}),n.chunks instanceof Function||(n.chunks=function(t){if(!Number.isSafeInteger(t)||t<1)throw new TypeError("Size must be a positive integer.");{const e=this;let r=!1;return o.from({next(){if(r)return{done:r};{const n=[];let o=0;for(;o++<t&&!r;){const t=e.next();if(t.done){r=!0,void 0!==t.value&&n.push(t.value);break}n.push(t.value)}return{value:n,done:!1}}}})}}),o.from instanceof Function||(o.from=function(t){if("object"!=typeof t||null===t)throw new TypeError("Not an object.");if(t.next instanceof Function){return Object.create(n,{next:{enumerable:!0,configurable:!1,writable:!1,value:(...e)=>t.next(...e)}})}if(t[Symbol.iterator]instanceof Function)return o.from(t[Symbol.iterator]())}),r||(globalThis.Iterator=o),e(ReadableStream,"from",function(t){if(t[Symbol.iterator]instanceof Function)return new ReadableStream({start(e){try{for(const r of t)e.enqueue(r)}catch(t){e.error(t)}finally{e.close()}}});if(t[Symbol.asyncIterator]instanceof Function)return new ReadableStream({async start(e){try{for await(const r of t)e.enqueue(r)}catch(t){e.error(t)}finally{e.close()}}});throw new TypeError("`ReadableStream.from()` requires an iterable source.")}),Map.prototype.getOrInsert instanceof Function||(Map.prototype.getOrInsert=function(t,e){return this.has(t)?this.get(t):(this.set(t,e),e)},Map.prototype.getOrInsertComputed=function(t,e){if(this.has(t))return this.get(t);{const r=e(t);return this.set(t,r),r}}),WeakMap.prototype.getOrInsert instanceof Function||(WeakMap.prototype.getOrInsert=function(t,e){return Map.prototype.getOrInsert.call(this,t,e)},WeakMap.prototype.getOrInsertComputed=function(t,e){return WeakMap.prototype.getOrInsertComputed.call(this,t,e)}),Map.groupBy instanceof Function||(Map.groupBy=function(t,e){return Array.from(t).reduce((t,r,n)=>(t.emplace(e.call(t,r,n),{insert:()=>[r],update:t=>(t.push(r),t)}),t),new Map)}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(t,{insert:e,update:r}={}){console.warn("`Map.prototype.emplace()` has been removed from the proposal and will be removed in the future.");const n=this.has(t);if(n&&r instanceof Function){const e=this.get(t),n=r.call(this,e,t,this);return n!==e&&this.set(t,n),n}if(n)return this.get(t);if(e instanceof Function){const r=e.call(this,t,this);return this.set(t,r),r}throw new Error("Key is not found and no `insert()` given")}),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=t=>t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=t=>(t>0)-(t<0)||+t),Math.hasOwnProperty("trunc")||(Math.trunc=t=>{const e=t-t%1;return 0===e&&(t<0||0===t&&1/t!=1/0)?-0:e}),Math.hasOwnProperty("expm1")||(Math.expm1=t=>Math.exp(t)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...t)=>Math.sqrt(t.reduce((t,e)=>t+e**2,0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=t=>t**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=t=>Math.log(t)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=t=>Math.log(t)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=t=>Math.log(1+t)),Math.hasOwnProperty("fround")||(Math.fround=(i=new Float32Array(1),function(t){return i[0]=t,i[0]})),Math.clamp instanceof Function||(Math.clamp=function(t,e,r){return Math.min(Math.max(t,e),r)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),Math.sumPrecise instanceof Function||(Math.sumPrecise=function(t){let e=-0;for(const r of t){if(!Number.isFinite(r)){e=-0;break}e+=r}return e}),Math.sum instanceof Function||(Math.sum=function(...t){return console.warn("Math.sum is deprecated. Please use Math.sumPrecise instead."),Math.sumPrecise(t)}),Object.groupBy instanceof Function||(Object.groupBy=function(t,e){return Array.from(t).reduce((t,r,n)=>{const o=e.call(t,r,n);return t.hasOwnProperty(o)?t[o].push(r):t[o]=[r],t},{})}),function(){if(!(globalThis.requestIdleCallback instanceof Function)){const t=t=>Number.isSafeInteger(t)&&t>0;globalThis.requestIdleCallback=function(e,{timeout:r}={}){const n=performance.now(),o=()=>t(r)?Math.max(0,r-(performance.now()-n)):Math.max(0,600-(performance.now()-n));return setTimeout(()=>e({didTimeout:!!t(r)&&0===o(),timeRemaining:o}),1)}}globalThis.cancelIdleCallback instanceof Function||(globalThis.cancelIdleCallback=t=>clearTimeout(t)),globalThis.requestAnimationFrame instanceof Function||(globalThis.requestAnimationFrame=t=>setTimeout(()=>t(performance.now()),1e3/60)),globalThis.cancelAnimationFrame instanceof Function||(globalThis.cancelAnimationFrame=t=>clearTimeout(t)),globalThis.queueMicrotask instanceof Function||(globalThis.queueMicrotask=t=>Promise.resolve().then(t).catch(t=>setTimeout(()=>{throw t})))}(),"Promise"in globalThis&&(Promise.prototype.finally instanceof Function||(Promise.prototype.finally=function(t){return this.then(async e=>(await t(),e),async e=>(await t(),e))}),Promise.allSettled instanceof Function||(Promise.allSettled=function(t){return Promise.all(Array.from(t).map(function(t){return new Promise(function(e){t instanceof Promise||(t=Promise.resolve(t)),t.then(function(t){e({status:"fulfilled",value:t})}).catch(function(t){e({status:"rejected",reason:t})})})}))}),Promise.any instanceof Function||(Promise.any=t=>new Promise((e,r)=>{let n=[];t.forEach(o=>{o.then(e).catch(e=>{n.push(e),n.length===t.length&&r(new globalThis.AggregateError(n,"No Promise in Promise.any was resolved"))})})})),Promise.race instanceof Function||(Promise.race=t=>new Promise((e,r)=>{t.forEach(t=>t.then(e,r))})),Promise.try instanceof Function||(Promise.try=(t,...e)=>new Promise(r=>r(t(...e)))),Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}),Promise.fromEntries instanceof Function||(Promise.fromEntries=async function(t){const e=[],r=[];for(const[n,o]of t)e.push(n),r.push(o);return await Promise.all(r).then(t=>Object.fromEntries(t.map((t,r)=>[e[r],t])))}),Promise.ownProperties instanceof Function||(Promise.ownProperties=async function(t){return await Promise.fromEntries(Object.entries(t))})),!(RegExp.escape instanceof Function)){const t=/[-[\]/{}()<>=#&!@%*+?.\\^$|;:"'`\s]/g;RegExp.escape=function(e){return e.toString().replace(t,"\\$&")}}e(Request.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())}),e(Response,"json",(t,{status:e=200,statusText:r="",headers:n=new Headers}={})=>n instanceof Headers?(n.set("Content-Type","application/json"),new Response(JSON.stringify(t),{status:e,statusText:r,headers:n})):Response.json(t,{status:e,statusText:r,headers:new Headers(n)})),e(Response,"redirect",(t,e=302)=>new Response(null,{status:e,headers:new Headers({Location:t})})),e(Response.prototype,"bytes",async function(){return new Uint8Array(await this.arrayBuffer())});
2
2
  /**
3
3
  * @copyright 2024 Chris Zuber <admin@kernvalley.us>
4
4
  */
5
- const a="user-blocking",s="user-visible",c="background";async function u(t,{delay:e=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(t).then(o,i),n.abort()},e);r instanceof AbortSignal&&r.addEventListener("abort",({target:t})=>{i(t.reason),clearTimeout(a),n.abort(t.reason)},{once:!0,signal:n.signal})}return await n}class l{async postTask(t,{priority:e,delay:r,signal:n}={}){const{promise:o,resolve:i,reject:l}=Promise.withResolvers(),h=new AbortController,f=Number.isSafeInteger(r)&&r>-1,p=function(t,e,r,n){return async()=>{n instanceof AbortSignal&&n.aborted?r(n.reason):t instanceof Function?await Promise.try(t).then(e,r):r(new TypeError("Scheduled task is not a function."))}}(t,i,l,n);if(void 0===e&&(e=n instanceof globalThis.TaskSignal?n.priority:s),n instanceof AbortSignal&&n.aborted)l(n.reason);else switch(e){case a:f?await u(p,{delay:r,signal:n}):(await Promise.resolve(),queueMicrotask(p));break;case s:if(f)await u(()=>requestAnimationFrame(p),{delay:r,signal:n});else{const t=requestAnimationFrame(p);n instanceof AbortSignal&&n.addEventListener("abort",({target:e})=>{cancelAnimationFrame(t),l(e.reason),h.abort(e.reason)},{once:!0,signal:h.signal})}break;case c:if(f)await u(()=>requestIdleCallback(p),{delay:r,signal:n});else{const t=requestIdleCallback(p);n instanceof AbortSignal&&n.addEventListener("abort",({target:e})=>{cancelIdleCallback(t),l(e.reason),h.abort(e.reason)},{once:!0,signal:h.signal})}break;default:throw new TypeError(`Scheduler.postTask: '${e}' (value of 'priority' member of SchedulerPostTaskOptions) is not a valid value for enumeration TaskPriority.`)}return await o.then(t=>(h.abort(),t)).catch(t=>{throw h.abort(t),t})}async yield(){await this.postTask(()=>null,{priority:s})}}if("scheduler"in globalThis?globalThis.scheduler.yield instanceof Function||(globalThis.scheduler.yield=async function(t){await l.prototype.yield.call(this,t)}):globalThis.scheduler=new l,!("TaskController"in globalThis)){const t=["user-visible","user-blocking","background"],e=Symbol("task:priority");globalThis.TaskPriorityChangeEvent=class extends Event{#t;constructor(e,{previousPriority:r}){if(super(e),"string"!=typeof r)throw new TypeError("TaskPriorityChangeEvent constructor: Missing required 'previousPriority' member of TaskPriorityChangeEventInit.");if(!t.includes(r))throw new TypeError(`TaskPriorityChangeEvent constructor: '${r}' (value of 'previousPriority' member of TaskPriorityChangeEventInit) is not a valid value for enumeration TaskPriority.`);this.#t=r}get previousPriority(){return this.#t}},globalThis.TaskSignal=class extends AbortSignal{get priority(){return this[e]}static any(r,{priority:n="user-visible"}={}){if(t.includes(n)){const t=super.any(r);return Object.setPrototypeOf(t,globalThis.TaskSignal.prototype),Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!1,value:n}),t}throw new TypeError(`TaskSignal.any: '${n}' is not a valid value for enumeration TaskPriority.`)}},globalThis.TaskController=class extends AbortController{constructor({priority:r="user-visible"}={}){if(super(),!t.includes(r))throw new TypeError(`TaskController constructor: '${r}' (value of 'priority' member of TaskControllerInit) is not a valid value for enumeration TaskPriority.`);Object.setPrototypeOf(this.signal,globalThis.TaskSignal.prototype),Object.defineProperty(this.signal,e,{enumerable:!1,writable:!0,configurable:!1,value:r})}setPriority(r){if(!t.includes(r))throw new TypeError(`TaskController.setPriority: '${r}' (value of argument 1) is not a valid value for enumeration TaskPriority.`);if(r!==this.signal.priority){const t=new globalThis.TaskPriorityChangeEvent("prioritychange",{previousPriority:this.signal.priority});this.signal[e]=r,this.signal.dispatchEvent(t)}}}}function h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var f,p,y,g={exports:{}};function b(){return f||(f=1,g.exports=function(){const t=new WeakMap,e=/(\n|\r\n?|\u2028|\u2029)/g,r=/^\s*/,n=/\S/,o=Array.prototype.slice,i="0".charCodeAt(0),a="9".charCodeAt(0),s="a".charCodeAt(0),c="f".charCodeAt(0),u="A".charCodeAt(0),l="F".charCodeAt(0);function h(t){if("string"==typeof t)return y([t])[0];if("function"==typeof t)return function(){const e=o.call(arguments);return e[0]=p(e[0]),t.apply(this,e)};const e=p(t);let r=f(e,0);for(let t=1;t<e.length;t++)r+=arguments[t]+f(e,t);return r}function f(t,e){const r=t[e];if(void 0===r)throw new TypeError(`invalid cooked string at index ${e}`);return r}function p(e){const r=t.get(e);if(r)return r;const n=y(e.raw),o=n.map(b);return Object.defineProperty(o,"raw",{value:Object.freeze(n)}),Object.freeze(o),t.set(e,o),o}function y(t){const o=t.map(t=>t.split(e));let i;for(let t=0;t<o.length;t++){const e=o[t],a=0===t,s=t+1===o.length;if(a){if(1===e.length||e[0].length>0)throw new Error("invalid content on opening line");e[1]=""}if(s){if(1===e.length||n.test(e[e.length-1]))throw new Error("invalid content on closing line");e[e.length-2]="",e[e.length-1]=""}for(let t=2;t<e.length;t+=2){const n=e[t],o=t+1===e.length&&!s,a=r.exec(n)[0];o||a.length!==n.length?i=g(a,i):e[t]=""}}const a=i?i.length:0;return o.map(t=>{let e=t[0];for(let r=1;r<t.length;r+=2)e+=t[r]+t[r+1].slice(a);return e})}function g(t,e){if(void 0===e||t===e)return t;let r=0;for(const n=Math.min(t.length,e.length);r<n&&t[r]===e[r];r++);return t.slice(0,r)}function b(t){let e="",r=0,n=0;for(;(n=t.indexOf("\\",n))>-1;){if(e+=t.slice(r,n),++n===t.length)return;const o=t[n++];switch(o){case"b":e+="\b";break;case"t":e+="\t";break;case"n":e+="\n";break;case"v":e+="\v";break;case"f":e+="\f";break;case"r":e+="\r";break;case"\r":n<t.length&&"\n"===t[n]&&++n;case"\n":case"\u2028":case"\u2029":break;case"0":if(d(t,n))return;e+="\0";break;case"x":{const r=m(t,n,n+2);if(-1===r)return;n+=2,e+=String.fromCharCode(r);break}case"u":{let r;if(n<t.length&&"{"===t[n]){const e=t.indexOf("}",++n);if(-1===e)return;r=m(t,n,e),n=e+1}else r=m(t,n,n+4),n+=4;if(-1===r||r>1114111)return;e+=String.fromCodePoint(r);break}default:if(d(o,0))return;e+=o}r=n}return e+t.slice(r)}function d(t,e){const r=t.charCodeAt(e);return r>=i&&r<=a}function m(t,e,r){if(r>=t.length)return-1;let n=0;for(;e<r;e++){const r=w(t.charCodeAt(e));if(-1===r)return-1;n=16*n+r}return n}function w(t){return t>=i&&t<=a?t-i:t>=s&&t<=c?t-s+10:t>=u&&t<=l?t-u+10:-1}return h}()),g.exports}var d=h(y?p:(y=1,p=b()));if(String.dedent instanceof Function||(String.dedent=d),"Symbol"in globalThis){const t=new Set(Reflect.ownKeys(Symbol).filter(t=>"symbol"==typeof Symbol[t]).map(t=>Symbol[t]));void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator")),e(Symbol,"isRegistered",function(t){return"symbol"==typeof t&&"string"==typeof Symbol.keyFor(t)}),e(Symbol,"isWellKnown",function(e){return t.has(e)})}const m="Expected a set-like object.",w=["has","keys"],v=["size"],A=t=>t instanceof Set,E=t=>A(t)||"object"==typeof t&&null!==t&&w.every(e=>t[e]instanceof Function)&&v.every(e=>e in t);function T(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var S,x,P,F,O,k;function M(){if(x)return S;x=1;var t,e=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(t,r)=>e(t,"name",{value:r,configurable:!0}),a={};((t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})})(a,{URLPattern:()=>ot}),t=a,S=((t,i,a,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of n(i))!o.call(t,c)&&c!==a&&e(t,c,{get:()=>i[c],enumerable:!(s=r(i,c))||s.enumerable});return t})(e({},"__esModule",{value:!0}),t);var s=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,o,i){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=o,this.modifier=i}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}};i(s,"Part");var c=/[$_\p{ID_Start}]/u,u=/[$_\u200C\u200D\p{ID_Continue}]/u,l=".*";function h(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function f(t,e=!1){let r=[],n=0;for(;n<t.length;){let o=t[n],a=i(function(o){if(!e)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:t[n++]})},"ErrorOrInvalid");if("*"!==o)if("+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o){if(":"===o){let e="",o=n+1;for(;o<t.length;){let r=t.substr(o,1);if(!(o===n+1&&c.test(r)||o!==n+1&&u.test(r)))break;e+=t[o++]}if(!e){a(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:e}),n=o;continue}if("("===o){let e=1,o="",i=n+1,s=!1;if("?"===t[i]){a(`Pattern cannot start with "?" at ${i}`);continue}for(;i<t.length;){if(!h(t[i],!1)){a(`Invalid character '${t[i]}' at ${i}.`),s=!0;break}if("\\"!==t[i]){if(")"===t[i]){if(e--,0===e){i++;break}}else if("("===t[i]&&(e++,"?"!==t[i+1])){a(`Capturing groups are not allowed at ${i}`),s=!0;break}o+=t[i++]}else o+=t[i++]+t[i++]}if(s)continue;if(e){a(`Unbalanced pattern at ${n}`);continue}if(!o){a(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=i;continue}r.push({type:"CHAR",index:n,value:t[n++]})}else r.push({type:"CLOSE",index:n,value:t[n++]});else r.push({type:"OPEN",index:n,value:t[n++]});else r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});else r.push({type:"ASTERISK",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function p(t,e={}){let r=f(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${y(e.delimiter)}]+?`,o=[],a=0,c=0,u=new Set,h=i(t=>{if(c<r.length&&r[c].type===t)return r[c++].value},"tryConsume"),p=i(()=>h("OTHER_MODIFIER")??h("ASTERISK"),"tryConsumeModifier"),g=i(t=>{let e=h(t);if(void 0!==e)return e;let{type:n,index:o}=r[c];throw new TypeError(`Unexpected ${n} at ${o}, expected ${t}`)},"mustConsume"),b=i(()=>{let t,e="";for(;t=h("CHAR")??h("ESCAPED_CHAR");)e+=t;return e},"consumeText"),d=i(t=>t,"DefaultEncodePart"),m=e.encodePart||d,w="",v=i(t=>{w+=t},"appendToPendingFixedValue"),A=i(()=>{w.length&&(o.push(new s(3,"","",m(w),"",3)),w="")},"maybeAddPartFromPendingFixedValue"),E=i((t,e,r,i,c)=>{let h,f=3;switch(c){case"?":f=1;break;case"*":f=0;break;case"+":f=2}if(!e&&!r&&3===f)return void v(t);if(A(),!e&&!r){if(!t)return;return void o.push(new s(3,"","",m(t),"",f))}h=r?"*"===r?l:r:n;let p,y=2;if(h===n?(y=1,h=""):h===l&&(y=0,h=""),e?p=e:r&&(p=a++),u.has(p))throw new TypeError(`Duplicate name '${p}'.`);u.add(p),o.push(new s(y,p,m(t),h,m(i),f))},"addPart");for(;c<r.length;){let t=h("CHAR"),r=h("NAME"),n=h("REGEX");if(!r&&!n&&(n=h("ASTERISK")),r||n){let o=t??"";-1===e.prefixes.indexOf(o)&&(v(o),o=""),A(),E(o,r,n,"",p());continue}let o=t??h("ESCAPED_CHAR");if(o)v(o);else{if(h("OPEN")){let t=b(),e=h("NAME"),r=h("REGEX");!e&&!r&&(r=h("ASTERISK"));let n=b();g("CLOSE"),E(t,e,r,n,p());continue}A(),g("END")}}return o}function y(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function g(t){return t&&t.ignoreCase?"ui":"u"}function b(t,e,r){return m(p(t,r),e,r)}function d(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function m(t,e,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 t){if(3===o.type){3===o.modifier?n+=y(o.value):n+=`(?:${y(o.value)})${d(o.modifier)}`;continue}e&&e.push(o.name);let t=`[^${y(r.delimiter)}]+?`,i=o.value;(1===o.type?i=t:0===o.type&&(i=l),o.prefix.length||o.suffix.length)?3!==o.modifier&&1!==o.modifier?(n+=`(?:${y(o.prefix)}`,n+=`((?:${i})(?:`,n+=y(o.suffix),n+=y(o.prefix),n+=`(?:${i}))*)${y(o.suffix)})`,0===o.modifier&&(n+="?")):(n+=`(?:${y(o.prefix)}(${i})${y(o.suffix)})`,n+=d(o.modifier)):3===o.modifier||1===o.modifier?n+=`(${i})${d(o.modifier)}`:n+=`((?:${i})${d(o.modifier)})`}let o=`[${y(r.endsWith)}]|$`,i=`[${y(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(t.length){let e=t[t.length-1];3===e.type&&3===e.modifier&&(a=r.delimiter.indexOf(e)>-1)}return a||(n+=`(?=${i}|${o})`),new RegExp(n,g(r))}i(h,"isASCII"),i(f,"lexer"),i(p,"parse"),i(y,"escapeString"),i(g,"flags"),i(b,"stringToRegexp"),i(d,"modifierToString"),i(m,"partsToRegexp");var w={delimiter:"",prefixes:"",sensitive:!0,strict:!0},v={delimiter:".",prefixes:"",sensitive:!0,strict:!0},A={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function E(t,e){return!!t.length&&("/"===t[0]||!(!e||t.length<2)&&(("\\"==t[0]||"{"==t[0])&&"/"==t[1]))}function T(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function P(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function F(t){return!(!t||t.length<2)&&("["===t[0]||("\\"===t[0]||"{"===t[0])&&"["===t[1])}i(E,"isAbsolutePathname"),i(T,"maybeStripPrefix"),i(P,"maybeStripSuffix"),i(F,"treatAsIPv6Hostname");var O=["ftp","file","http","https","ws","wss"];function k(t){if(!t)return!0;for(let e of O)if(t.test(e))return!0;return!1}function M(t,e){if(t=T(t,"#"),e||""===t)return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function R(t,e){if(t=T(t,"?"),e||""===t)return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function C(t,e){return e||""===t?t:F(t)?q(t):H(t)}function I(t,e){if(e||""===t)return t;let r=new URL("https://example.com");return r.password=t,r.password}function $(t,e){if(e||""===t)return t;let r=new URL("https://example.com");return r.username=t,r.username}function j(t,e,r){if(r||""===t)return t;if(e&&!O.includes(e))return new URL(`${e}:${t}`).pathname;let n="/"==t[0];return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function U(t,e,r){return N(e)===t&&(t=""),r||""===t?t:z(t)}function L(t,e){return t=P(t,":"),e||""===t?t:B(t)}function N(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function B(t){if(""===t)return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function _(t){if(""===t)return t;let e=new URL("https://example.com");return e.username=t,e.username}function D(t){if(""===t)return t;let e=new URL("https://example.com");return e.password=t,e.password}function H(t){if(""===t)return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function q(t){if(""===t)return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function z(t){if(""===t||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function W(t){if(""===t)return t;let e=new URL("https://example.com");return e.pathname="/"!==t[0]?"/-"+t:t,"/"!==t[0]?e.pathname.substring(2,e.pathname.length):e.pathname}function G(t){return""===t?t:new URL(`data:${t}`).pathname}function K(t){if(""===t)return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function X(t){if(""===t)return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}i(k,"isSpecialScheme"),i(M,"canonicalizeHash"),i(R,"canonicalizeSearch"),i(C,"canonicalizeHostname"),i(I,"canonicalizePassword"),i($,"canonicalizeUsername"),i(j,"canonicalizePathname"),i(U,"canonicalizePort"),i(L,"canonicalizeProtocol"),i(N,"defaultPortForProtocol"),i(B,"protocolEncodeCallback"),i(_,"usernameEncodeCallback"),i(D,"passwordEncodeCallback"),i(H,"hostnameEncodeCallback"),i(q,"ipv6HostnameEncodeCallback"),i(z,"portEncodeCallback"),i(W,"standardURLPathnameEncodeCallback"),i(G,"pathURLPathnameEncodeCallback"),i(K,"searchEncodeCallback"),i(X,"hashEncodeCallback");var V=class{#e;#r=[];#n={};#o=0;#i=1;#a=0;#s=0;#c=0;#u=0;#l=!1;constructor(t){this.#e=t}get result(){return this.#n}parse(){for(this.#r=f(this.#e,!0);this.#o<this.#r.length;this.#o+=this.#i){if(this.#i=1,"END"===this.#r[this.#o].type){if(0===this.#s){this.#h(),this.#f()?this.#p(9,1):this.#y()?this.#p(8,1):this.#p(7,0);continue}if(2===this.#s){this.#g(5);continue}this.#p(10,0);break}if(this.#c>0){if(!this.#b())continue;this.#c-=1}if(this.#d())this.#c+=1;else switch(this.#s){case 0:this.#m()&&this.#g(1);break;case 1:if(this.#m()){this.#w();let t=7,e=1;this.#v()?(t=2,e=3):this.#l&&(t=2),this.#p(t,e)}break;case 2:this.#A()?this.#g(3):(this.#E()||this.#y()||this.#f())&&this.#g(5);break;case 3:this.#T()?this.#p(4,1):this.#A()&&this.#p(5,1);break;case 4:this.#A()&&this.#p(5,1);break;case 5:this.#S()?this.#u+=1:this.#x()&&(this.#u-=1),this.#P()&&!this.#u?this.#p(6,1):this.#E()?this.#p(7,0):this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 6:this.#E()?this.#p(7,0):this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 7:this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 8:this.#f()&&this.#p(9,1)}}void 0!==this.#n.hostname&&void 0===this.#n.port&&(this.#n.port="")}#p(t,e){switch(this.#s){case 0:case 2:break;case 1:this.#n.protocol=this.#F();break;case 3:this.#n.username=this.#F();break;case 4:this.#n.password=this.#F();break;case 5:this.#n.hostname=this.#F();break;case 6:this.#n.port=this.#F();break;case 7:this.#n.pathname=this.#F();break;case 8:this.#n.search=this.#F();break;case 9:this.#n.hash=this.#F()}0!==this.#s&&10!==t&&([1,2,3,4].includes(this.#s)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#s)&&[8,9].includes(t)&&(this.#n.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#s)&&9===t&&(this.#n.search??="")),this.#O(t,e)}#O(t,e){this.#s=t,this.#a=this.#o+e,this.#o+=e,this.#i=0}#h(){this.#o=this.#a,this.#i=0}#g(t){this.#h(),this.#s=t}#k(t){return t<0&&(t=this.#r.length-t),t<this.#r.length?this.#r[t]:this.#r[this.#r.length-1]}#M(t,e){let r=this.#k(t);return r.value===e&&("CHAR"===r.type||"ESCAPED_CHAR"===r.type||"INVALID_CHAR"===r.type)}#m(){return this.#M(this.#o,":")}#v(){return this.#M(this.#o+1,"/")&&this.#M(this.#o+2,"/")}#A(){return this.#M(this.#o,"@")}#T(){return this.#M(this.#o,":")}#P(){return this.#M(this.#o,":")}#E(){return this.#M(this.#o,"/")}#y(){if(this.#M(this.#o,"?"))return!0;if("?"!==this.#r[this.#o].value)return!1;let t=this.#k(this.#o-1);return"NAME"!==t.type&&"REGEX"!==t.type&&"CLOSE"!==t.type&&"ASTERISK"!==t.type}#f(){return this.#M(this.#o,"#")}#d(){return"OPEN"==this.#r[this.#o].type}#b(){return"CLOSE"==this.#r[this.#o].type}#S(){return this.#M(this.#o,"[")}#x(){return this.#M(this.#o,"]")}#F(){let t=this.#r[this.#o],e=this.#k(this.#a).index;return this.#e.substring(e,t.index)}#w(){let t={};Object.assign(t,w),t.encodePart=B;let e=b(this.#F(),void 0,t);this.#l=k(e)}};i(V,"Parser");var J=["protocol","username","password","hostname","port","pathname","search","hash"],Z="*";function Q(t,e){if("string"!=typeof t)throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);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 Y(t,e){return e?et(t):t}function tt(t,e,r){let n;if("string"==typeof e.baseURL)try{n=new URL(e.baseURL),void 0===e.protocol&&(t.protocol=Y(n.protocol.substring(0,n.protocol.length-1),r)),!r&&void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.username&&(t.username=Y(n.username,r)),!r&&void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.username&&void 0===e.password&&(t.password=Y(n.password,r)),void 0===e.protocol&&void 0===e.hostname&&(t.hostname=Y(n.hostname,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&(t.port=Y(n.port,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&(t.pathname=Y(n.pathname,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search&&(t.search=Y(n.search.substring(1,n.search.length),r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search&&void 0===e.hash&&(t.hash=Y(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if("string"==typeof e.protocol&&(t.protocol=L(e.protocol,r)),"string"==typeof e.username&&(t.username=$(e.username,r)),"string"==typeof e.password&&(t.password=I(e.password,r)),"string"==typeof e.hostname&&(t.hostname=C(e.hostname,r)),"string"==typeof e.port&&(t.port=U(e.port,t.protocol,r)),"string"==typeof e.pathname){if(t.pathname=e.pathname,n&&!E(t.pathname,r)){let e=n.pathname.lastIndexOf("/");e>=0&&(t.pathname=Y(n.pathname.substring(0,e+1),r)+t.pathname)}t.pathname=j(t.pathname,t.protocol,r)}return"string"==typeof e.search&&(t.search=R(e.search,r)),"string"==typeof e.hash&&(t.hash=M(e.hash,r)),t}function et(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function rt(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function nt(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=`[^${rt(e.delimiter)}]+?`,n=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let i=0;i<t.length;++i){let a=t[i];if(3===a.type){if(3===a.modifier){o+=et(a.value);continue}o+=`{${et(a.value)}}${d(a.modifier)}`;continue}let s=a.hasCustomName(),c=!!a.suffix.length||!!a.prefix.length&&(1!==a.prefix.length||!e.prefixes.includes(a.prefix)),u=i>0?t[i-1]:null,l=i<t.length-1?t[i+1]:null;if(!c&&s&&1===a.type&&3===a.modifier&&l&&!l.prefix.length&&!l.suffix.length)if(3===l.type){let t=l.value.length>0?l.value[0]:"";c=n.test(t)}else c=!l.hasCustomName();if(!c&&!a.prefix.length&&u&&3===u.type){let t=u.value[u.value.length-1];c=e.prefixes.includes(t)}c&&(o+="{"),o+=et(a.prefix),s&&(o+=`:${a.name}`),2===a.type?o+=`(${a.value})`:1===a.type?s||(o+=`(${r})`):0===a.type&&(s||u&&3!==u.type&&3===u.modifier&&!c&&""===a.prefix?o+="(.*)":o+="*"),1===a.type&&s&&a.suffix.length&&n.test(a.suffix[0])&&(o+="\\"),o+=et(a.suffix),c&&(o+="}"),3!==a.modifier&&(o+=d(a.modifier))}return o}i(Q,"extractValues"),i(Y,"processBaseURLString"),i(tt,"applyInit"),i(et,"escapePatternString"),i(rt,"escapeRegexpString"),i(nt,"partsToPattern");var ot=class{#e;#r={};#n={};#o={};#i={};#a=!1;constructor(t={},e,r){try{let n;if("string"==typeof e?n=e:r=e,"string"==typeof t){let e=new V(t);if(e.parse(),t=e.result,void 0===n&&"string"!=typeof t.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n}else{if(!t||"object"!=typeof t)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:Z,protocol:Z,username:Z,password:Z,hostname:Z,port:Z,search:Z,hash:Z};for(o of(this.#e=tt(a,t,!0),N(this.#e.protocol)===this.#e.port&&(this.#e.port=""),J)){if(!(o in this.#e))continue;let t={},e=this.#e[o];switch(this.#n[o]=[],o){case"protocol":Object.assign(t,w),t.encodePart=B;break;case"username":Object.assign(t,w),t.encodePart=_;break;case"password":Object.assign(t,w),t.encodePart=D;break;case"hostname":Object.assign(t,v),F(e)?t.encodePart=q:t.encodePart=H;break;case"port":Object.assign(t,w),t.encodePart=z;break;case"pathname":k(this.#r.protocol)?(Object.assign(t,A,i),t.encodePart=W):(Object.assign(t,w,i),t.encodePart=G);break;case"search":Object.assign(t,w,i),t.encodePart=K;break;case"hash":Object.assign(t,w,i),t.encodePart=X}try{this.#i[o]=p(e,t),this.#r[o]=m(this.#i[o],this.#n[o],t),this.#o[o]=nt(this.#i[o],t),this.#a=this.#a||this.#i[o].some(t=>2===t.type)}catch{throw new TypeError(`invalid ${o} pattern '${this.#e[o]}'.`)}}}catch(t){throw new TypeError(`Failed to construct 'URLPattern': ${t.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(t={},e){let r,n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return!1;try{n=tt(n,"object"==typeof t?t:Q(t,e),!1)}catch{return!1}for(r of J)if(!this.#r[r].exec(n[r]))return!1;return!0}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{r=tt(r,"object"==typeof t?t:Q(t,e),!1)}catch{return null}let n,o={};for(n of(o.inputs=e?[t,e]:[t],J)){let t=this.#r[n].exec(r[n]);if(!t)return null;let e={};for(let[r,o]of this.#n[n].entries())if("string"==typeof o||"number"==typeof o){let n=t[r+1];e[o]=n}o[n]={input:r[n]??"",groups:e}}return o}static compareComponent(t,e,r){let n=i((t,e)=>{for(let r of["type","modifier","prefix","value","suffix"]){if(t[r]<e[r])return-1;if(t[r]!==e[r])return 1}return 0},"comparePart"),o=new s(3,"","","","",3),a=new s(0,"","","","",3),c=i((t,e)=>{let r=0;for(;r<Math.min(t.length,e.length);++r){let o=n(t[r],e[r]);if(o)return o}return t.length===e.length?0:n(t[r]??o,e[r]??o)},"comparePartList");return e.#o[t]||r.#o[t]?e.#o[t]&&!r.#o[t]?c(e.#i[t],[a]):!e.#o[t]&&r.#o[t]?c([a],r.#i[t]):c(e.#i[t],r.#i[t]):0}get protocol(){return this.#o.protocol}get username(){return this.#o.username}get password(){return this.#o.password}get hostname(){return this.#o.hostname}get port(){return this.#o.port}get pathname(){return this.#o.pathname}get search(){return this.#o.search}get hash(){return this.#o.hash}get hasRegExpGroups(){return this.#a}};return i(ot,"URLPattern"),S}Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(t){if(!E(t))throw new TypeError(m);return new Set([...this].filter(e=>t.has(e)))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(t){if(!E(t))throw new TypeError(m);return new Set([...this].filter(e=>!t.has(e)))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(t){return new Set([...this,...t])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(t){if(!E(t))throw new TypeError(m);return[...this].every(e=>t.has(e))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(t){if(!E(t))throw new TypeError(m);return A(t)?t.isSubsetOf(this):new Set(t.keys()).isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(t){if(!E(t))throw new TypeError(m);return A(t)?new Set([...this.difference(t),...t.difference(this)]):new Set([...this.difference(t),...new Set(t.keys()).difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(t){if(!E(t))throw new TypeError(m);return new Set([...this,...t]).size===this.size+t.size});var R=T(k?O:(k=1,O=function(){if(F)return P;F=1;const{URLPattern:t}=M();return P={URLPattern:t},globalThis.URLPattern||(globalThis.URLPattern=t),P}()));"URLPattern"in globalThis||(globalThis.URLPattern=R),e(URL,"parse",(t,e)=>{try{return new URL(t,e)}catch{return null}}),e(URL,"canParse",(t,e)=>{try{return new URL(t,e)instanceof URL}catch{return!1}}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(t,{insert:e,update:r}={}){const n=this.has(t);if(n&&r instanceof Function){const e=this.get(t),n=r.call(this,e,t,this);return n!==e&&this.set(t,e),n}if(n)return this.get(t);if(e instanceof Function){const r=e.call(this,t,this);return this.set(t,r),r}throw new Error("Key is not found and no `insert()` given")})}();
5
+ const a="user-blocking",s="user-visible",c="background";async function u(t,{delay:e=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(t).then(o,i),n.abort()},e);r instanceof AbortSignal&&r.addEventListener("abort",({target:t})=>{i(t.reason),clearTimeout(a),n.abort(t.reason)},{once:!0,signal:n.signal})}return await n}class l{async postTask(t,{priority:e,delay:r,signal:n}={}){const{promise:o,resolve:i,reject:l}=Promise.withResolvers(),h=new AbortController,f=Number.isSafeInteger(r)&&r>-1,p=function(t,e,r,n){return async()=>{n instanceof AbortSignal&&n.aborted?r(n.reason):t instanceof Function?await Promise.try(t).then(e,r):r(new TypeError("Scheduled task is not a function."))}}(t,i,l,n);if(void 0===e&&(e=n instanceof globalThis.TaskSignal?n.priority:s),n instanceof AbortSignal&&n.aborted)l(n.reason);else switch(e){case a:f?await u(p,{delay:r,signal:n}):(await Promise.resolve(),queueMicrotask(p));break;case s:if(f)await u(()=>requestAnimationFrame(p),{delay:r,signal:n});else{const t=requestAnimationFrame(p);n instanceof AbortSignal&&n.addEventListener("abort",({target:e})=>{cancelAnimationFrame(t),l(e.reason),h.abort(e.reason)},{once:!0,signal:h.signal})}break;case c:if(f)await u(()=>requestIdleCallback(p),{delay:r,signal:n});else{const t=requestIdleCallback(p);n instanceof AbortSignal&&n.addEventListener("abort",({target:e})=>{cancelIdleCallback(t),l(e.reason),h.abort(e.reason)},{once:!0,signal:h.signal})}break;default:throw new TypeError(`Scheduler.postTask: '${e}' (value of 'priority' member of SchedulerPostTaskOptions) is not a valid value for enumeration TaskPriority.`)}return await o.then(t=>(h.abort(),t)).catch(t=>{throw h.abort(t),t})}async yield(){await this.postTask(()=>null,{priority:s})}}if("scheduler"in globalThis?globalThis.scheduler.yield instanceof Function||(globalThis.scheduler.yield=async function(t){await l.prototype.yield.call(this,t)}):globalThis.scheduler=new l,!("TaskController"in globalThis)){const t=["user-visible","user-blocking","background"],e=Symbol("task:priority");globalThis.TaskPriorityChangeEvent=class extends Event{#t;constructor(e,{previousPriority:r}){if(super(e),"string"!=typeof r)throw new TypeError("TaskPriorityChangeEvent constructor: Missing required 'previousPriority' member of TaskPriorityChangeEventInit.");if(!t.includes(r))throw new TypeError(`TaskPriorityChangeEvent constructor: '${r}' (value of 'previousPriority' member of TaskPriorityChangeEventInit) is not a valid value for enumeration TaskPriority.`);this.#t=r}get previousPriority(){return this.#t}},globalThis.TaskSignal=class extends AbortSignal{get priority(){return this[e]}static any(r,{priority:n="user-visible"}={}){if(t.includes(n)){const t=super.any(r);return Object.setPrototypeOf(t,globalThis.TaskSignal.prototype),Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!1,value:n}),t}throw new TypeError(`TaskSignal.any: '${n}' is not a valid value for enumeration TaskPriority.`)}},globalThis.TaskController=class extends AbortController{constructor({priority:r="user-visible"}={}){if(super(),!t.includes(r))throw new TypeError(`TaskController constructor: '${r}' (value of 'priority' member of TaskControllerInit) is not a valid value for enumeration TaskPriority.`);Object.setPrototypeOf(this.signal,globalThis.TaskSignal.prototype),Object.defineProperty(this.signal,e,{enumerable:!1,writable:!0,configurable:!1,value:r})}setPriority(r){if(!t.includes(r))throw new TypeError(`TaskController.setPriority: '${r}' (value of argument 1) is not a valid value for enumeration TaskPriority.`);if(r!==this.signal.priority){const t=new globalThis.TaskPriorityChangeEvent("prioritychange",{previousPriority:this.signal.priority});this.signal[e]=r,this.signal.dispatchEvent(t)}}}}function h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var f,p,y,g={exports:{}};function b(){return f||(f=1,g.exports=function(){const t=new WeakMap,e=/(\n|\r\n?|\u2028|\u2029)/g,r=/^\s*/,n=/\S/,o=Array.prototype.slice,i="0".charCodeAt(0),a="9".charCodeAt(0),s="a".charCodeAt(0),c="f".charCodeAt(0),u="A".charCodeAt(0),l="F".charCodeAt(0);function h(t){if("string"==typeof t)return y([t])[0];if("function"==typeof t)return function(){const e=o.call(arguments);return e[0]=p(e[0]),t.apply(this,e)};const e=p(t);let r=f(e,0);for(let t=1;t<e.length;t++)r+=arguments[t]+f(e,t);return r}function f(t,e){const r=t[e];if(void 0===r)throw new TypeError(`invalid cooked string at index ${e}`);return r}function p(e){const r=t.get(e);if(r)return r;const n=y(e.raw),o=n.map(b);return Object.defineProperty(o,"raw",{value:Object.freeze(n)}),Object.freeze(o),t.set(e,o),o}function y(t){const o=t.map(t=>t.split(e));let i;for(let t=0;t<o.length;t++){const e=o[t],a=0===t,s=t+1===o.length;if(a){if(1===e.length||e[0].length>0)throw new Error("invalid content on opening line");e[1]=""}if(s){if(1===e.length||n.test(e[e.length-1]))throw new Error("invalid content on closing line");e[e.length-2]="",e[e.length-1]=""}for(let t=2;t<e.length;t+=2){const n=e[t],o=t+1===e.length&&!s,a=r.exec(n)[0];o||a.length!==n.length?i=g(a,i):e[t]=""}}const a=i?i.length:0;return o.map(t=>{let e=t[0];for(let r=1;r<t.length;r+=2)e+=t[r]+t[r+1].slice(a);return e})}function g(t,e){if(void 0===e||t===e)return t;let r=0;for(const n=Math.min(t.length,e.length);r<n&&t[r]===e[r];r++);return t.slice(0,r)}function b(t){let e="",r=0,n=0;for(;(n=t.indexOf("\\",n))>-1;){if(e+=t.slice(r,n),++n===t.length)return;const o=t[n++];switch(o){case"b":e+="\b";break;case"t":e+="\t";break;case"n":e+="\n";break;case"v":e+="\v";break;case"f":e+="\f";break;case"r":e+="\r";break;case"\r":n<t.length&&"\n"===t[n]&&++n;case"\n":case"\u2028":case"\u2029":break;case"0":if(m(t,n))return;e+="\0";break;case"x":{const r=d(t,n,n+2);if(-1===r)return;n+=2,e+=String.fromCharCode(r);break}case"u":{let r;if(n<t.length&&"{"===t[n]){const e=t.indexOf("}",++n);if(-1===e)return;r=d(t,n,e),n=e+1}else r=d(t,n,n+4),n+=4;if(-1===r||r>1114111)return;e+=String.fromCodePoint(r);break}default:if(m(o,0))return;e+=o}r=n}return e+t.slice(r)}function m(t,e){const r=t.charCodeAt(e);return r>=i&&r<=a}function d(t,e,r){if(r>=t.length)return-1;let n=0;for(;e<r;e++){const r=w(t.charCodeAt(e));if(-1===r)return-1;n=16*n+r}return n}function w(t){return t>=i&&t<=a?t-i:t>=s&&t<=c?t-s+10:t>=u&&t<=l?t-u+10:-1}return h}()),g.exports}var m=h(y?p:(y=1,p=b()));if(String.dedent instanceof Function||(String.dedent=m),"Symbol"in globalThis){const t=new Set(Reflect.ownKeys(Symbol).filter(t=>"symbol"==typeof Symbol[t]).map(t=>Symbol[t]));void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator")),e(Symbol,"isRegistered",function(t){return"symbol"==typeof t&&"string"==typeof Symbol.keyFor(t)}),e(Symbol,"isWellKnown",function(e){return t.has(e)})}const d="Expected a set-like object.",w=["has","keys"],v=["size"],A=t=>t instanceof Set,E=t=>A(t)||"object"==typeof t&&null!==t&&w.every(e=>t[e]instanceof Function)&&v.every(e=>e in t);function T(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var S,x,P,F,k,O;function M(){if(x)return S;x=1;var t,e=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(t,r)=>e(t,"name",{value:r,configurable:!0}),a={};((t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})})(a,{URLPattern:()=>ot}),t=a,S=((t,i,a,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of n(i))!o.call(t,c)&&c!==a&&e(t,c,{get:()=>i[c],enumerable:!(s=r(i,c))||s.enumerable});return t})(e({},"__esModule",{value:!0}),t);var s=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,o,i){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=o,this.modifier=i}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}};i(s,"Part");var c=/[$_\p{ID_Start}]/u,u=/[$_\u200C\u200D\p{ID_Continue}]/u,l=".*";function h(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function f(t,e=!1){let r=[],n=0;for(;n<t.length;){let o=t[n],a=i(function(o){if(!e)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:t[n++]})},"ErrorOrInvalid");if("*"!==o)if("+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o){if(":"===o){let e="",o=n+1;for(;o<t.length;){let r=t.substr(o,1);if(!(o===n+1&&c.test(r)||o!==n+1&&u.test(r)))break;e+=t[o++]}if(!e){a(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:e}),n=o;continue}if("("===o){let e=1,o="",i=n+1,s=!1;if("?"===t[i]){a(`Pattern cannot start with "?" at ${i}`);continue}for(;i<t.length;){if(!h(t[i],!1)){a(`Invalid character '${t[i]}' at ${i}.`),s=!0;break}if("\\"!==t[i]){if(")"===t[i]){if(e--,0===e){i++;break}}else if("("===t[i]&&(e++,"?"!==t[i+1])){a(`Capturing groups are not allowed at ${i}`),s=!0;break}o+=t[i++]}else o+=t[i++]+t[i++]}if(s)continue;if(e){a(`Unbalanced pattern at ${n}`);continue}if(!o){a(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=i;continue}r.push({type:"CHAR",index:n,value:t[n++]})}else r.push({type:"CLOSE",index:n,value:t[n++]});else r.push({type:"OPEN",index:n,value:t[n++]});else r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});else r.push({type:"ASTERISK",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function p(t,e={}){let r=f(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${y(e.delimiter)}]+?`,o=[],a=0,c=0,u=new Set,h=i(t=>{if(c<r.length&&r[c].type===t)return r[c++].value},"tryConsume"),p=i(()=>h("OTHER_MODIFIER")??h("ASTERISK"),"tryConsumeModifier"),g=i(t=>{let e=h(t);if(void 0!==e)return e;let{type:n,index:o}=r[c];throw new TypeError(`Unexpected ${n} at ${o}, expected ${t}`)},"mustConsume"),b=i(()=>{let t,e="";for(;t=h("CHAR")??h("ESCAPED_CHAR");)e+=t;return e},"consumeText"),m=i(t=>t,"DefaultEncodePart"),d=e.encodePart||m,w="",v=i(t=>{w+=t},"appendToPendingFixedValue"),A=i(()=>{w.length&&(o.push(new s(3,"","",d(w),"",3)),w="")},"maybeAddPartFromPendingFixedValue"),E=i((t,e,r,i,c)=>{let h,f=3;switch(c){case"?":f=1;break;case"*":f=0;break;case"+":f=2}if(!e&&!r&&3===f)return void v(t);if(A(),!e&&!r){if(!t)return;return void o.push(new s(3,"","",d(t),"",f))}h=r?"*"===r?l:r:n;let p,y=2;if(h===n?(y=1,h=""):h===l&&(y=0,h=""),e?p=e:r&&(p=a++),u.has(p))throw new TypeError(`Duplicate name '${p}'.`);u.add(p),o.push(new s(y,p,d(t),h,d(i),f))},"addPart");for(;c<r.length;){let t=h("CHAR"),r=h("NAME"),n=h("REGEX");if(!r&&!n&&(n=h("ASTERISK")),r||n){let o=t??"";-1===e.prefixes.indexOf(o)&&(v(o),o=""),A(),E(o,r,n,"",p());continue}let o=t??h("ESCAPED_CHAR");if(o)v(o);else{if(h("OPEN")){let t=b(),e=h("NAME"),r=h("REGEX");!e&&!r&&(r=h("ASTERISK"));let n=b();g("CLOSE"),E(t,e,r,n,p());continue}A(),g("END")}}return o}function y(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function g(t){return t&&t.ignoreCase?"ui":"u"}function b(t,e,r){return d(p(t,r),e,r)}function m(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function d(t,e,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 t){if(3===o.type){3===o.modifier?n+=y(o.value):n+=`(?:${y(o.value)})${m(o.modifier)}`;continue}e&&e.push(o.name);let t=`[^${y(r.delimiter)}]+?`,i=o.value;(1===o.type?i=t:0===o.type&&(i=l),o.prefix.length||o.suffix.length)?3!==o.modifier&&1!==o.modifier?(n+=`(?:${y(o.prefix)}`,n+=`((?:${i})(?:`,n+=y(o.suffix),n+=y(o.prefix),n+=`(?:${i}))*)${y(o.suffix)})`,0===o.modifier&&(n+="?")):(n+=`(?:${y(o.prefix)}(${i})${y(o.suffix)})`,n+=m(o.modifier)):3===o.modifier||1===o.modifier?n+=`(${i})${m(o.modifier)}`:n+=`((?:${i})${m(o.modifier)})`}let o=`[${y(r.endsWith)}]|$`,i=`[${y(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(t.length){let e=t[t.length-1];3===e.type&&3===e.modifier&&(a=r.delimiter.indexOf(e)>-1)}return a||(n+=`(?=${i}|${o})`),new RegExp(n,g(r))}i(h,"isASCII"),i(f,"lexer"),i(p,"parse"),i(y,"escapeString"),i(g,"flags"),i(b,"stringToRegexp"),i(m,"modifierToString"),i(d,"partsToRegexp");var w={delimiter:"",prefixes:"",sensitive:!0,strict:!0},v={delimiter:".",prefixes:"",sensitive:!0,strict:!0},A={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function E(t,e){return!!t.length&&("/"===t[0]||!(!e||t.length<2)&&(("\\"==t[0]||"{"==t[0])&&"/"==t[1]))}function T(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function P(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function F(t){return!(!t||t.length<2)&&("["===t[0]||("\\"===t[0]||"{"===t[0])&&"["===t[1])}i(E,"isAbsolutePathname"),i(T,"maybeStripPrefix"),i(P,"maybeStripSuffix"),i(F,"treatAsIPv6Hostname");var k=["ftp","file","http","https","ws","wss"];function O(t){if(!t)return!0;for(let e of k)if(t.test(e))return!0;return!1}function M(t,e){if(t=T(t,"#"),e||""===t)return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function R(t,e){if(t=T(t,"?"),e||""===t)return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function C(t,e){return e||""===t?t:F(t)?q(t):H(t)}function I(t,e){if(e||""===t)return t;let r=new URL("https://example.com");return r.password=t,r.password}function $(t,e){if(e||""===t)return t;let r=new URL("https://example.com");return r.username=t,r.username}function j(t,e,r){if(r||""===t)return t;if(e&&!k.includes(e))return new URL(`${e}:${t}`).pathname;let n="/"==t[0];return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function U(t,e,r){return N(e)===t&&(t=""),r||""===t?t:z(t)}function L(t,e){return t=P(t,":"),e||""===t?t:B(t)}function N(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function B(t){if(""===t)return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function _(t){if(""===t)return t;let e=new URL("https://example.com");return e.username=t,e.username}function D(t){if(""===t)return t;let e=new URL("https://example.com");return e.password=t,e.password}function H(t){if(""===t)return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function q(t){if(""===t)return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function z(t){if(""===t||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function W(t){if(""===t)return t;let e=new URL("https://example.com");return e.pathname="/"!==t[0]?"/-"+t:t,"/"!==t[0]?e.pathname.substring(2,e.pathname.length):e.pathname}function G(t){return""===t?t:new URL(`data:${t}`).pathname}function K(t){if(""===t)return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function X(t){if(""===t)return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}i(O,"isSpecialScheme"),i(M,"canonicalizeHash"),i(R,"canonicalizeSearch"),i(C,"canonicalizeHostname"),i(I,"canonicalizePassword"),i($,"canonicalizeUsername"),i(j,"canonicalizePathname"),i(U,"canonicalizePort"),i(L,"canonicalizeProtocol"),i(N,"defaultPortForProtocol"),i(B,"protocolEncodeCallback"),i(_,"usernameEncodeCallback"),i(D,"passwordEncodeCallback"),i(H,"hostnameEncodeCallback"),i(q,"ipv6HostnameEncodeCallback"),i(z,"portEncodeCallback"),i(W,"standardURLPathnameEncodeCallback"),i(G,"pathURLPathnameEncodeCallback"),i(K,"searchEncodeCallback"),i(X,"hashEncodeCallback");var V=class{#e;#r=[];#n={};#o=0;#i=1;#a=0;#s=0;#c=0;#u=0;#l=!1;constructor(t){this.#e=t}get result(){return this.#n}parse(){for(this.#r=f(this.#e,!0);this.#o<this.#r.length;this.#o+=this.#i){if(this.#i=1,"END"===this.#r[this.#o].type){if(0===this.#s){this.#h(),this.#f()?this.#p(9,1):this.#y()?this.#p(8,1):this.#p(7,0);continue}if(2===this.#s){this.#g(5);continue}this.#p(10,0);break}if(this.#c>0){if(!this.#b())continue;this.#c-=1}if(this.#m())this.#c+=1;else switch(this.#s){case 0:this.#d()&&this.#g(1);break;case 1:if(this.#d()){this.#w();let t=7,e=1;this.#v()?(t=2,e=3):this.#l&&(t=2),this.#p(t,e)}break;case 2:this.#A()?this.#g(3):(this.#E()||this.#y()||this.#f())&&this.#g(5);break;case 3:this.#T()?this.#p(4,1):this.#A()&&this.#p(5,1);break;case 4:this.#A()&&this.#p(5,1);break;case 5:this.#S()?this.#u+=1:this.#x()&&(this.#u-=1),this.#P()&&!this.#u?this.#p(6,1):this.#E()?this.#p(7,0):this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 6:this.#E()?this.#p(7,0):this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 7:this.#y()?this.#p(8,1):this.#f()&&this.#p(9,1);break;case 8:this.#f()&&this.#p(9,1)}}void 0!==this.#n.hostname&&void 0===this.#n.port&&(this.#n.port="")}#p(t,e){switch(this.#s){case 0:case 2:break;case 1:this.#n.protocol=this.#F();break;case 3:this.#n.username=this.#F();break;case 4:this.#n.password=this.#F();break;case 5:this.#n.hostname=this.#F();break;case 6:this.#n.port=this.#F();break;case 7:this.#n.pathname=this.#F();break;case 8:this.#n.search=this.#F();break;case 9:this.#n.hash=this.#F()}0!==this.#s&&10!==t&&([1,2,3,4].includes(this.#s)&&[6,7,8,9].includes(t)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#s)&&[8,9].includes(t)&&(this.#n.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#s)&&9===t&&(this.#n.search??="")),this.#k(t,e)}#k(t,e){this.#s=t,this.#a=this.#o+e,this.#o+=e,this.#i=0}#h(){this.#o=this.#a,this.#i=0}#g(t){this.#h(),this.#s=t}#O(t){return t<0&&(t=this.#r.length-t),t<this.#r.length?this.#r[t]:this.#r[this.#r.length-1]}#M(t,e){let r=this.#O(t);return r.value===e&&("CHAR"===r.type||"ESCAPED_CHAR"===r.type||"INVALID_CHAR"===r.type)}#d(){return this.#M(this.#o,":")}#v(){return this.#M(this.#o+1,"/")&&this.#M(this.#o+2,"/")}#A(){return this.#M(this.#o,"@")}#T(){return this.#M(this.#o,":")}#P(){return this.#M(this.#o,":")}#E(){return this.#M(this.#o,"/")}#y(){if(this.#M(this.#o,"?"))return!0;if("?"!==this.#r[this.#o].value)return!1;let t=this.#O(this.#o-1);return"NAME"!==t.type&&"REGEX"!==t.type&&"CLOSE"!==t.type&&"ASTERISK"!==t.type}#f(){return this.#M(this.#o,"#")}#m(){return"OPEN"==this.#r[this.#o].type}#b(){return"CLOSE"==this.#r[this.#o].type}#S(){return this.#M(this.#o,"[")}#x(){return this.#M(this.#o,"]")}#F(){let t=this.#r[this.#o],e=this.#O(this.#a).index;return this.#e.substring(e,t.index)}#w(){let t={};Object.assign(t,w),t.encodePart=B;let e=b(this.#F(),void 0,t);this.#l=O(e)}};i(V,"Parser");var J=["protocol","username","password","hostname","port","pathname","search","hash"],Z="*";function Q(t,e){if("string"!=typeof t)throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);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 Y(t,e){return e?et(t):t}function tt(t,e,r){let n;if("string"==typeof e.baseURL)try{n=new URL(e.baseURL),void 0===e.protocol&&(t.protocol=Y(n.protocol.substring(0,n.protocol.length-1),r)),!r&&void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.username&&(t.username=Y(n.username,r)),!r&&void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.username&&void 0===e.password&&(t.password=Y(n.password,r)),void 0===e.protocol&&void 0===e.hostname&&(t.hostname=Y(n.hostname,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&(t.port=Y(n.port,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&(t.pathname=Y(n.pathname,r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search&&(t.search=Y(n.search.substring(1,n.search.length),r)),void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search&&void 0===e.hash&&(t.hash=Y(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if("string"==typeof e.protocol&&(t.protocol=L(e.protocol,r)),"string"==typeof e.username&&(t.username=$(e.username,r)),"string"==typeof e.password&&(t.password=I(e.password,r)),"string"==typeof e.hostname&&(t.hostname=C(e.hostname,r)),"string"==typeof e.port&&(t.port=U(e.port,t.protocol,r)),"string"==typeof e.pathname){if(t.pathname=e.pathname,n&&!E(t.pathname,r)){let e=n.pathname.lastIndexOf("/");e>=0&&(t.pathname=Y(n.pathname.substring(0,e+1),r)+t.pathname)}t.pathname=j(t.pathname,t.protocol,r)}return"string"==typeof e.search&&(t.search=R(e.search,r)),"string"==typeof e.hash&&(t.hash=M(e.hash,r)),t}function et(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function rt(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function nt(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=`[^${rt(e.delimiter)}]+?`,n=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let i=0;i<t.length;++i){let a=t[i];if(3===a.type){if(3===a.modifier){o+=et(a.value);continue}o+=`{${et(a.value)}}${m(a.modifier)}`;continue}let s=a.hasCustomName(),c=!!a.suffix.length||!!a.prefix.length&&(1!==a.prefix.length||!e.prefixes.includes(a.prefix)),u=i>0?t[i-1]:null,l=i<t.length-1?t[i+1]:null;if(!c&&s&&1===a.type&&3===a.modifier&&l&&!l.prefix.length&&!l.suffix.length)if(3===l.type){let t=l.value.length>0?l.value[0]:"";c=n.test(t)}else c=!l.hasCustomName();if(!c&&!a.prefix.length&&u&&3===u.type){let t=u.value[u.value.length-1];c=e.prefixes.includes(t)}c&&(o+="{"),o+=et(a.prefix),s&&(o+=`:${a.name}`),2===a.type?o+=`(${a.value})`:1===a.type?s||(o+=`(${r})`):0===a.type&&(s||u&&3!==u.type&&3===u.modifier&&!c&&""===a.prefix?o+="(.*)":o+="*"),1===a.type&&s&&a.suffix.length&&n.test(a.suffix[0])&&(o+="\\"),o+=et(a.suffix),c&&(o+="}"),3!==a.modifier&&(o+=m(a.modifier))}return o}i(Q,"extractValues"),i(Y,"processBaseURLString"),i(tt,"applyInit"),i(et,"escapePatternString"),i(rt,"escapeRegexpString"),i(nt,"partsToPattern");var ot=class{#e;#r={};#n={};#o={};#i={};#a=!1;constructor(t={},e,r){try{let n;if("string"==typeof e?n=e:r=e,"string"==typeof t){let e=new V(t);if(e.parse(),t=e.result,void 0===n&&"string"!=typeof t.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n}else{if(!t||"object"!=typeof t)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:Z,protocol:Z,username:Z,password:Z,hostname:Z,port:Z,search:Z,hash:Z};for(o of(this.#e=tt(a,t,!0),N(this.#e.protocol)===this.#e.port&&(this.#e.port=""),J)){if(!(o in this.#e))continue;let t={},e=this.#e[o];switch(this.#n[o]=[],o){case"protocol":Object.assign(t,w),t.encodePart=B;break;case"username":Object.assign(t,w),t.encodePart=_;break;case"password":Object.assign(t,w),t.encodePart=D;break;case"hostname":Object.assign(t,v),F(e)?t.encodePart=q:t.encodePart=H;break;case"port":Object.assign(t,w),t.encodePart=z;break;case"pathname":O(this.#r.protocol)?(Object.assign(t,A,i),t.encodePart=W):(Object.assign(t,w,i),t.encodePart=G);break;case"search":Object.assign(t,w,i),t.encodePart=K;break;case"hash":Object.assign(t,w,i),t.encodePart=X}try{this.#i[o]=p(e,t),this.#r[o]=d(this.#i[o],this.#n[o],t),this.#o[o]=nt(this.#i[o],t),this.#a=this.#a||this.#i[o].some(t=>2===t.type)}catch{throw new TypeError(`invalid ${o} pattern '${this.#e[o]}'.`)}}}catch(t){throw new TypeError(`Failed to construct 'URLPattern': ${t.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(t={},e){let r,n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return!1;try{n=tt(n,"object"==typeof t?t:Q(t,e),!1)}catch{return!1}for(r of J)if(!this.#r[r].exec(n[r]))return!1;return!0}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{r=tt(r,"object"==typeof t?t:Q(t,e),!1)}catch{return null}let n,o={};for(n of(o.inputs=e?[t,e]:[t],J)){let t=this.#r[n].exec(r[n]);if(!t)return null;let e={};for(let[r,o]of this.#n[n].entries())if("string"==typeof o||"number"==typeof o){let n=t[r+1];e[o]=n}o[n]={input:r[n]??"",groups:e}}return o}static compareComponent(t,e,r){let n=i((t,e)=>{for(let r of["type","modifier","prefix","value","suffix"]){if(t[r]<e[r])return-1;if(t[r]!==e[r])return 1}return 0},"comparePart"),o=new s(3,"","","","",3),a=new s(0,"","","","",3),c=i((t,e)=>{let r=0;for(;r<Math.min(t.length,e.length);++r){let o=n(t[r],e[r]);if(o)return o}return t.length===e.length?0:n(t[r]??o,e[r]??o)},"comparePartList");return e.#o[t]||r.#o[t]?e.#o[t]&&!r.#o[t]?c(e.#i[t],[a]):!e.#o[t]&&r.#o[t]?c([a],r.#i[t]):c(e.#i[t],r.#i[t]):0}get protocol(){return this.#o.protocol}get username(){return this.#o.username}get password(){return this.#o.password}get hostname(){return this.#o.hostname}get port(){return this.#o.port}get pathname(){return this.#o.pathname}get search(){return this.#o.search}get hash(){return this.#o.hash}get hasRegExpGroups(){return this.#a}};return i(ot,"URLPattern"),S}Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(t){if(!E(t))throw new TypeError(d);return new Set([...this].filter(e=>t.has(e)))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(t){if(!E(t))throw new TypeError(d);return new Set([...this].filter(e=>!t.has(e)))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(t){return new Set([...this,...t])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(t){if(!E(t))throw new TypeError(d);return[...this].every(e=>t.has(e))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(t){if(!E(t))throw new TypeError(d);return A(t)?t.isSubsetOf(this):new Set(t.keys()).isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(t){if(!E(t))throw new TypeError(d);return A(t)?new Set([...this.difference(t),...t.difference(this)]):new Set([...this.difference(t),...new Set(t.keys()).difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(t){if(!E(t))throw new TypeError(d);return new Set([...this,...t]).size===this.size+t.size});var R=T(O?k:(O=1,k=function(){if(F)return P;F=1;const{URLPattern:t}=M();return P={URLPattern:t},globalThis.URLPattern||(globalThis.URLPattern=t),P}()));"URLPattern"in globalThis||(globalThis.URLPattern=R),e(URL,"parse",(t,e)=>{try{return new URL(t,e)}catch{return null}}),e(URL,"canParse",(t,e)=>{try{return new URL(t,e)instanceof URL}catch{return!1}}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(t,{insert:e,update:r}={}){const n=this.has(t);if(n&&r instanceof Function){const e=this.get(t),n=r.call(this,e,t,this);return n!==e&&this.set(t,e),n}if(n)return this.get(t);if(e instanceof Function){const r=e.call(this,t,this);return this.set(t,r),r}throw new Error("Key is not found and no `insert()` given")})}();
6
6
  //# sourceMappingURL=node.min.js.map