@shgysk8zer0/polyfills 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [v0.2.2] - 2023-07-09
10
+
11
+ ### Added
12
+ - Add `Response.json()` static method
13
+
14
+ ### Fixed
15
+ - Fix order of loading polyfills to support `arr.groupToMap()`
16
+
9
17
  ## [v0.2.1] - 2023-07-05
10
18
 
11
19
  ### Fixed
package/all.js CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import './globalThis.js';
5
5
  import './deprefixer.js';
6
+ import './map.js';
6
7
  import './array.js';
7
8
  import './symbols.js';
8
9
  import './function.js';
@@ -28,8 +29,8 @@ import './ShadowRoot.js';
28
29
  import './CSSStyleSheet.js';
29
30
  import './element.js';
30
31
  import './set.js';
31
- import './map.js';
32
32
  import './weakMap.js';
33
33
  import './window.js';
34
34
  import './scheduler.js';
35
35
  import './elementInternals.js';
36
+ import './response.js';
package/all.min.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(){"use strict";function e(e,t,n,{writable:o=!0,enumerable:r=!0,configurable:i=!0}={}){e[t]instanceof Function||Object.defineProperty(e,t,{value:n,writable:o,enumerable:r,configurable:i})}function t(e,t,{get:n,set:o,enumerable:r=!0,configurable:i=!0}={}){e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:n,set:o,enumerable:r,configurable:i})}var n;!function(){"undefined"==typeof globalThis&&("undefined"!=typeof window?Object.defineProperty(Window.prototype,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:window}):"undefined"!=typeof global?Object.defineProperty(global,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:global}):"undefined"!=typeof self?Object.defineProperty(self,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:self}):Object.defineProperty(this,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:this}))}(),!("crypto"in window)&&"msCrypto"in window&&(globalThis.crypto=globalThis.msCrypto),"Notification"in window||(globalThis.Notification=globalThis.notifications||globalThis.webkitNotifications||globalThis.oNotifications||globalThis.msNotifications||!1),"doNotTrack"in navigator||(navigator.doNotTrack=globalThis.doNotTrack||navigator.msDoNotTrack||"unspecified"),"indexedDB"in window||(globalThis.indexedDB=globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB||!1),"hidden"in document||(document.hidden=document.webkitHidden||document.msHidden||document.mozHidden||!1),"visibilityState"in document||(document.visibilityState=document.webkitVisibilityState||document.msVisibilityState||document.mozVisibilityState||"visible"),"fullscreenElement"in document||(document.fullscreenElement=document.mozFullScreenElement||document.webkitFullscreenElement||!1),"requestAnimationFrame"in window||(globalThis.requestAnimationFrame=globalThis.mozRequestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.msRequestAnimationFrame||!1),"exitFullscreen"in Document.prototype||(Document.prototype.exitFullscreen=document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msCancelFullScreen||!1),"requestFullscreen"in HTMLElement.prototype||(HTMLElement.prototype.requestFullscreen=HTMLElement.prototype.requestFullScreen||HTMLElement.prototype.mozRequestFullScreen||HTMLElement.prototype.webkitRequestFullScreen||!1),"fullscreen"in Document.prototype||Object.defineProperty(Document.prototype,"fullscreen",{get:()=>document.fullscreenElement instanceof Element}),function(){const e=[Array,String,globalThis.Int8Array,globalThis.Uint8Array,globalThis.Uint8ClampedArray,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.Float32Array,globalThis.Float64Array,globalThis.BigInt64Array,globalThis.BigUint64Array];if(Array.prototype.flat instanceof Function||(Array.prototype.flat=function(e=1){const t=[];e=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,e));const n=(e,o)=>{Array.isArray(e)&&o>=0?e.forEach((e=>n(e,o-1))):t.push(e)};return n(this,Number.isNaN(e)?0:e),t}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(e,t){return this.map(e,t).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(e,t){let n;return this.forEach(((o,r,i)=>{e.call(t,o,r,i)&&(n=o)}),t),n}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(e,t){let n=-1;return this.forEach(((o,r,i)=>{e.call(t,o,r,i)&&(n=r)}),t),n}),!(Array.prototype.at instanceof Function)){const t=function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]};for(const n of e)void 0!==n&&Object.defineProperty(n.prototype,"at",{value:t,writable:!0,enumerable:!1,configurable:!0})}Array.prototype.group instanceof Function||(Array.prototype.group=function(e,t=globalThis){return this.reduce(((n,o,r,i)=>{const a=e.call(t,o,r,i);return n.hasOwnProperty(a)?n[a].push(o):n[a]=[o],n}),{})}),Array.prototype.groupBy=function(...e){return console.warn("`goupBy` is deprecated. Please use `group` instead."),this.group(...e)},!(Array.prototype.groupToMap instanceof Function)&&Map.prototype.emplace instanceof Function&&(Array.prototype.groupToMap=function(e,t=globalThis){return this.reduce(((n,o,r,i)=>(n.emplace(e.call(t,o,r,i),{insert:()=>[o],update:e=>(e.push(o),e)}),n)),new Map)}),Map.prototype.emplace instanceof Function&&(Array.prototype.groupByToMap=function(...e){return console.warn("`goupByToMap` is deprecated. Please use `groupToMap` instead."),this.groupToMap(...e)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(e,t,n=globalThis){let o=[];for await(const t of e)o.push(await t);return Array.from(o,t,n)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(e){return this===e||!!Array.isArray(e)&&(this.length===e.length&&this.every(((t,n)=>{const o=e[n];return Array.isArray(t)?Array.isArray(o)&&t.equals(o):Object.is(t,o)})))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(e){if(void 0===e)return[...new Set(this)];if("string"==typeof e){const t=[];return this.filter((n=>{const o=n[e];return!t.includes(o)&&(t.push(o),!0)}))}if(e instanceof Function){const t=[];return this.filter(((...n)=>{try{const o=e.apply(this,n);return"string"==typeof o&&(!t.includes(o)&&(t.push(o),!0))}catch(e){return!1}}))}throw new TypeError("Not a valid argument for uniqueBy")}),Array.prototype.toReversed instanceof Function||(Array.prototype.toReversed=function(){return[...this].reverse()}),Array.prototype.toSorted instanceof Function||(Array.prototype.toSorted=function(e){return[...this].sort(e)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(e,t,...n){const o=[...this];return o.splice(e,t,...n),o}),Array.prototype.with instanceof Function||(Array.prototype.with=function(e,t){const n=[...this];return n[e]=t,n})}(),"Symbol"in globalThis&&(void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator"))),function(){if(!(Function.prototype.once instanceof Function)){const e=new WeakMap;Function.prototype.once=function(t){const n=this;return function(...o){if(e.has(n))return e.get(n);if("AsyncFunction"===n.constructor.name){const r=n.apply(t||n,o).catch((t=>{throw e.delete(n),t}));return e.set(n,r),r}if(n instanceof Function){const r=n.apply(t||n,o);return e.set(n,r),r}}}}}(),e(URL,"canParse",((e,t)=>{try{return new URL(e,t),!0}catch{return!1}})),Number.range instanceof Function||(Number.range=function(e,t,n=1){return console.warn("`Number.range()` is deprecated. Use `Iterator.range()` instead."),globalThis.Iterator.range(e,t,{step:n})}),function(){"Iterator"in globalThis||(globalThis.Iterator={prototype:Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))});const e=globalThis.Iterator;e.range instanceof Function||(e.range=function*(t,n,o){if("number"==typeof o||"bigint"==typeof o)for(const r of e.range(t,n,{step:o}))yield r;else if("object"!=typeof o||Object.is(o,null))for(const o of e.range(t,n,{}))yield o;else{const{step:e=("number"==typeof t?t<n?1:-1:t<n?1n:-1n),inclusive:r=!1}=o;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 n&&"bigint"!=typeof n)throw new TypeError("End must be a number");if(Number.isNaN(n))throw new RangeError("Invalid end");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Step must be a number");if(Number.isNaN(e))throw new RangeError("Invalid step");if(0===e)throw new RangeError("Step must not be 0");if(e<0&&t<n||e>0&&t>n)return;if(r)if(e>0)for(let o=t;o<=n;o+=e)yield o;else for(let o=t;o>=n;o+=e)yield o;else if(e>0)for(let o=t;o<n;o+=e)yield o;else for(let o=t;o>n;o+=e)yield o}}),e.prototype[Symbol.toStringTag]||(e.prototype[Symbol.toStringTag]="Iterator"),e.prototype.take instanceof Function||(e.prototype.take=function*(e){let t=0;for(const n of this){if(++t>e)break;yield n}}),e.prototype.drop instanceof Function||(e.prototype.drop=function*(e){let t=0;for(const n of this)t++>=e&&(yield n)}),e.prototype.toArray instanceof Function||(e.prototype.toArray=function(){return Array.from(this)}),e.prototype.forEach instanceof Function||(e.prototype.forEach=function(e){for(const t of this)e(t)}),e.prototype.map instanceof Function||(e.prototype.map=function*(e){for(const t of this)yield e(t)}),e.prototype.reduce instanceof Function||(e.prototype.reduce=function(e,t){let n=void 0===t?this.next().value:t;for(const t of this)n=e(n,t);return n}),e.prototype.filter instanceof Function||(e.prototype.filter=function*(e){for(const t of this)e(t)&&(yield t)}),e.prototype.some instanceof Function||(e.prototype.some=function(e){let t=!1;for(const n of this)if(e(n)){t=!0;break}return t}),e.prototype.every instanceof Function||(e.prototype.every=function(e){let t=!0;for(const n of this)if(!e(n)){t=!1;break}return t}),e.prototype.find instanceof Function||(e.prototype.find=function(e){for(const t of this)if(e(t))return t}),e.prototype.indexed instanceof Function||(e.prototype.indexed=function*(){let e=0;for(const t of this)yield[e++,t]})}(),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=e=>e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=e=>(e>0)-(e<0)||+e),Math.hasOwnProperty("trunc")||(Math.trunc=e=>{const t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}),Math.hasOwnProperty("expm1")||(Math.expm1=e=>Math.exp(e)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...e)=>Math.sqrt(e.reduce(((e,t)=>e+t**2),0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=e=>e**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=e=>Math.log(e)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=e=>Math.log(e)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=e=>Math.log(1+e)),Math.hasOwnProperty("fround")||(Math.fround=(n=new Float32Array(1),function(e){return n[0]=e,n[0]})),Math.clamp instanceof Function||(Math.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),function(){if(!("isSecureContext"in globalThis)){const e=["localhost","127.0.0.1"],t="https:",n=[t,"file:","wss:"],o=(e=globalThis.document)=>[...e.scripts].every((({src:n})=>{if(0===n.length)return!0;{const{protocol:o,hostname:r}=new URL(n,e.baseURI);return o===t||r===location.hostname}}));Object.defineProperty(globalThis,"isSecureContext",{enumerable:!0,configurable:!0,get:function(){return!(!n.includes(location.protocol)&&!e.includes(location.hostname))&&o()}})}}();const o=new WeakMap;function r(e){return e instanceof Function&&"AsyncFunction"===e.constructor.name}function i(e){return"object"==typeof e&&!Object.is(e,null)&&!Array.isArray(e)}function a(e){switch(typeof e){case"undefined":return"Undefined";case"function":return"prototype"in e?a(e.prototype):"constructor"in e?e.constructor.name:"Function";case"object":return Object.is(e,null)?"Null":"constructor"in e?e.constructor.name:Symbol.toStringTag in e?e[Symbol.toStringTag]:"prototype"in e?a(e.prototype):(console.log(e),"Unknown Object");case"string":return"String";case"number":return Number.isNaN(e)?"NaN":"Number";case"bigint":return"BigInt";case"boolean":return"Boolean";case"symbol":return"Symbol";default:return"Unknown"}}function s(e,t){return e.once instanceof Function?e.once(t):function(...n){if(o.has(e))return o.get(e);if(r(e)){const r=e.apply(t||this,n).catch((t=>{throw o.delete(e),t}));return o.set(e,r),r}if(e instanceof Function){const r=e.apply(t||this,n);return o.set(e,r),r}}}
1
+ !function(){"use strict";function e(e,t,n,{writable:o=!0,enumerable:r=!0,configurable:i=!0}={}){e[t]instanceof Function||Object.defineProperty(e,t,{value:n,writable:o,enumerable:r,configurable:i})}function t(e,t,{get:n,set:o,enumerable:r=!0,configurable:i=!0}={}){e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:n,set:o,enumerable:r,configurable:i})}var n;!function(){"undefined"==typeof globalThis&&("undefined"!=typeof window?Object.defineProperty(Window.prototype,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:window}):"undefined"!=typeof global?Object.defineProperty(global,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:global}):"undefined"!=typeof self?Object.defineProperty(self,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:self}):Object.defineProperty(this,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:this}))}(),!("crypto"in window)&&"msCrypto"in window&&(globalThis.crypto=globalThis.msCrypto),"Notification"in window||(globalThis.Notification=globalThis.notifications||globalThis.webkitNotifications||globalThis.oNotifications||globalThis.msNotifications||!1),"doNotTrack"in navigator||(navigator.doNotTrack=globalThis.doNotTrack||navigator.msDoNotTrack||"unspecified"),"indexedDB"in window||(globalThis.indexedDB=globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB||!1),"hidden"in document||(document.hidden=document.webkitHidden||document.msHidden||document.mozHidden||!1),"visibilityState"in document||(document.visibilityState=document.webkitVisibilityState||document.msVisibilityState||document.mozVisibilityState||"visible"),"fullscreenElement"in document||(document.fullscreenElement=document.mozFullScreenElement||document.webkitFullscreenElement||!1),"requestAnimationFrame"in window||(globalThis.requestAnimationFrame=globalThis.mozRequestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.msRequestAnimationFrame||!1),"exitFullscreen"in Document.prototype||(Document.prototype.exitFullscreen=document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msCancelFullScreen||!1),"requestFullscreen"in HTMLElement.prototype||(HTMLElement.prototype.requestFullscreen=HTMLElement.prototype.requestFullScreen||HTMLElement.prototype.mozRequestFullScreen||HTMLElement.prototype.webkitRequestFullScreen||!1),"fullscreen"in Document.prototype||Object.defineProperty(Document.prototype,"fullscreen",{get:()=>document.fullscreenElement instanceof Element}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(e,{insert:t,update:n}={}){const o=this.has(e);if(o&&n instanceof Function){const t=this.get(e),o=n.call(this,t,e,this);return o!==t&&this.set(e,o),o}if(o)return this.get(e);if(t instanceof Function){const n=t.call(this,e,this);return this.set(e,n),n}throw new Error("Key is not found and no `insert()` given")}),function(){const e=[Array,String,globalThis.Int8Array,globalThis.Uint8Array,globalThis.Uint8ClampedArray,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.Float32Array,globalThis.Float64Array,globalThis.BigInt64Array,globalThis.BigUint64Array];if(Array.prototype.flat instanceof Function||(Array.prototype.flat=function(e=1){const t=[];e=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,e));const n=(e,o)=>{Array.isArray(e)&&o>=0?e.forEach((e=>n(e,o-1))):t.push(e)};return n(this,Number.isNaN(e)?0:e),t}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(e,t){return this.map(e,t).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(e,t){let n;return this.forEach(((o,r,i)=>{e.call(t,o,r,i)&&(n=o)}),t),n}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(e,t){let n=-1;return this.forEach(((o,r,i)=>{e.call(t,o,r,i)&&(n=r)}),t),n}),!(Array.prototype.at instanceof Function)){const t=function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]};for(const n of e)void 0!==n&&Object.defineProperty(n.prototype,"at",{value:t,writable:!0,enumerable:!1,configurable:!0})}Array.prototype.group instanceof Function||(Array.prototype.group=function(e,t=globalThis){return this.reduce(((n,o,r,i)=>{const a=e.call(t,o,r,i);return n.hasOwnProperty(a)?n[a].push(o):n[a]=[o],n}),{})}),Array.prototype.groupBy=function(...e){return console.warn("`goupBy` is deprecated. Please use `group` instead."),this.group(...e)},!(Array.prototype.groupToMap instanceof Function)&&Map.prototype.emplace instanceof Function&&(Array.prototype.groupToMap=function(e,t=globalThis){return this.reduce(((n,o,r,i)=>(n.emplace(e.call(t,o,r,i),{insert:()=>[o],update:e=>(e.push(o),e)}),n)),new Map)}),Map.prototype.emplace instanceof Function&&(Array.prototype.groupByToMap=function(...e){return console.warn("`goupByToMap` is deprecated. Please use `groupToMap` instead."),this.groupToMap(...e)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(e,t,n=globalThis){let o=[];for await(const t of e)o.push(await t);return Array.from(o,t,n)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(e){return this===e||!!Array.isArray(e)&&(this.length===e.length&&this.every(((t,n)=>{const o=e[n];return Array.isArray(t)?Array.isArray(o)&&t.equals(o):Object.is(t,o)})))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(e){if(void 0===e)return[...new Set(this)];if("string"==typeof e){const t=[];return this.filter((n=>{const o=n[e];return!t.includes(o)&&(t.push(o),!0)}))}if(e instanceof Function){const t=[];return this.filter(((...n)=>{try{const o=e.apply(this,n);return"string"==typeof o&&(!t.includes(o)&&(t.push(o),!0))}catch(e){return!1}}))}throw new TypeError("Not a valid argument for uniqueBy")}),Array.prototype.toReversed instanceof Function||(Array.prototype.toReversed=function(){return[...this].reverse()}),Array.prototype.toSorted instanceof Function||(Array.prototype.toSorted=function(e){return[...this].sort(e)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(e,t,...n){const o=[...this];return o.splice(e,t,...n),o}),Array.prototype.with instanceof Function||(Array.prototype.with=function(e,t){const n=[...this];return n[e]=t,n})}(),"Symbol"in globalThis&&(void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator"))),function(){if(!(Function.prototype.once instanceof Function)){const e=new WeakMap;Function.prototype.once=function(t){const n=this;return function(...o){if(e.has(n))return e.get(n);if("AsyncFunction"===n.constructor.name){const r=n.apply(t||n,o).catch((t=>{throw e.delete(n),t}));return e.set(n,r),r}if(n instanceof Function){const r=n.apply(t||n,o);return e.set(n,r),r}}}}}(),e(URL,"canParse",((e,t)=>{try{return new URL(e,t),!0}catch{return!1}})),Number.range instanceof Function||(Number.range=function(e,t,n=1){return console.warn("`Number.range()` is deprecated. Use `Iterator.range()` instead."),globalThis.Iterator.range(e,t,{step:n})}),function(){"Iterator"in globalThis||(globalThis.Iterator={prototype:Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))});const e=globalThis.Iterator;e.range instanceof Function||(e.range=function*(t,n,o){if("number"==typeof o||"bigint"==typeof o)for(const r of e.range(t,n,{step:o}))yield r;else if("object"!=typeof o||Object.is(o,null))for(const o of e.range(t,n,{}))yield o;else{const{step:e=("number"==typeof t?t<n?1:-1:t<n?1n:-1n),inclusive:r=!1}=o;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 n&&"bigint"!=typeof n)throw new TypeError("End must be a number");if(Number.isNaN(n))throw new RangeError("Invalid end");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Step must be a number");if(Number.isNaN(e))throw new RangeError("Invalid step");if(0===e)throw new RangeError("Step must not be 0");if(e<0&&t<n||e>0&&t>n)return;if(r)if(e>0)for(let o=t;o<=n;o+=e)yield o;else for(let o=t;o>=n;o+=e)yield o;else if(e>0)for(let o=t;o<n;o+=e)yield o;else for(let o=t;o>n;o+=e)yield o}}),e.prototype[Symbol.toStringTag]||(e.prototype[Symbol.toStringTag]="Iterator"),e.prototype.take instanceof Function||(e.prototype.take=function*(e){let t=0;for(const n of this){if(++t>e)break;yield n}}),e.prototype.drop instanceof Function||(e.prototype.drop=function*(e){let t=0;for(const n of this)t++>=e&&(yield n)}),e.prototype.toArray instanceof Function||(e.prototype.toArray=function(){return Array.from(this)}),e.prototype.forEach instanceof Function||(e.prototype.forEach=function(e){for(const t of this)e(t)}),e.prototype.map instanceof Function||(e.prototype.map=function*(e){for(const t of this)yield e(t)}),e.prototype.reduce instanceof Function||(e.prototype.reduce=function(e,t){let n=void 0===t?this.next().value:t;for(const t of this)n=e(n,t);return n}),e.prototype.filter instanceof Function||(e.prototype.filter=function*(e){for(const t of this)e(t)&&(yield t)}),e.prototype.some instanceof Function||(e.prototype.some=function(e){let t=!1;for(const n of this)if(e(n)){t=!0;break}return t}),e.prototype.every instanceof Function||(e.prototype.every=function(e){let t=!0;for(const n of this)if(!e(n)){t=!1;break}return t}),e.prototype.find instanceof Function||(e.prototype.find=function(e){for(const t of this)if(e(t))return t}),e.prototype.indexed instanceof Function||(e.prototype.indexed=function*(){let e=0;for(const t of this)yield[e++,t]})}(),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=e=>e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=e=>(e>0)-(e<0)||+e),Math.hasOwnProperty("trunc")||(Math.trunc=e=>{const t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}),Math.hasOwnProperty("expm1")||(Math.expm1=e=>Math.exp(e)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...e)=>Math.sqrt(e.reduce(((e,t)=>e+t**2),0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=e=>e**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=e=>Math.log(e)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=e=>Math.log(e)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=e=>Math.log(1+e)),Math.hasOwnProperty("fround")||(Math.fround=(n=new Float32Array(1),function(e){return n[0]=e,n[0]})),Math.clamp instanceof Function||(Math.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),function(){if(!("isSecureContext"in globalThis)){const e=["localhost","127.0.0.1"],t="https:",n=[t,"file:","wss:"],o=(e=globalThis.document)=>[...e.scripts].every((({src:n})=>{if(0===n.length)return!0;{const{protocol:o,hostname:r}=new URL(n,e.baseURI);return o===t||r===location.hostname}}));Object.defineProperty(globalThis,"isSecureContext",{enumerable:!0,configurable:!0,get:function(){return window.parent===window&&(!(!n.includes(location.protocol)&&!e.includes(location.hostname))&&o())}})}}();const o=new WeakMap;function r(e){return e instanceof Function&&"AsyncFunction"===e.constructor.name}function i(e){return"object"==typeof e&&!Object.is(e,null)&&!Array.isArray(e)}function a(e){switch(typeof e){case"undefined":return"Undefined";case"function":return"prototype"in e?a(e.prototype):"constructor"in e?e.constructor.name:"Function";case"object":return Object.is(e,null)?"Null":"constructor"in e?e.constructor.name:Symbol.toStringTag in e?e[Symbol.toStringTag]:"prototype"in e?a(e.prototype):(console.log(e),"Unknown Object");case"string":return"String";case"number":return Number.isNaN(e)?"NaN":"Number";case"bigint":return"BigInt";case"boolean":return"Boolean";case"symbol":return"Symbol";default:return"Unknown"}}function s(e,t){return e.once instanceof Function?e.once(t):function(...n){if(o.has(e))return o.get(e);if(r(e)){const r=e.apply(t||this,n).catch((t=>{throw o.delete(e),t}));return o.set(e,r),r}if(e instanceof Function){const r=e.apply(t||this,n);return o.set(e,r),r}}}
2
2
  /**
3
3
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
4
4
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Lock
@@ -40,7 +40,7 @@ const oe=JSON.parse('{\n "allowCustomElements": false,\n "allowUnknownMarkup":
40
40
  /**
41
41
  * @copyright 2022-2023 Chris Zuber <admin@kernvalley.us>
42
42
  */
43
- const me=new WeakMap;const{setHTML:fe,polyfill:he}=function(e,t){return{setHTML:re,polyfill:function(){let n=!1;if("Sanitizer"in globalThis){if(globalThis.Sanitizer.getDefaultConfiguration instanceof Function||(globalThis.Sanitizer.getDefaultConfiguration=function(){return t},n=!0),!(globalThis.Sanitizer.prototype.getConfiguration instanceof Function)){const e=new WeakMap,t=globalThis.Sanitizer;globalThis.Sanitizer=class extends t{constructor({allowAttributes:n,allowComments:o,allowElements:r,allowCustomElements:i,blockElements:a,dropAttributes:s,dropElements:l,allowUnknownMarkup:c}=t.getDefaultConfiguration()){super({allowAttributes:n,allowComments:o,allowElements:r,allowCustomElements:i,blockElements:a,dropAttributes:s,dropElements:l,allowUnknownMarkup:c}),e.set(this,{allowAttributes:n,allowComments:o,allowElements:r,allowCustomElements:i,blockElements:a,dropAttributes:s,dropElements:l,allowUnknownMarkup:c})}getConfiguration(){return e.get(this)}},n=!0}globalThis.Sanitizer.prototype.sanitize instanceof Function||(globalThis.Sanitizer.prototype.sanitize=function(e){if(e instanceof Node){if([Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE].includes(e.nodeType))return pe(e,this.getConfiguration());throw new TypeError("Expected a Document or DocumentFragment in `Sanitizer.sanitize()`.")}throw new TypeError("`Sanitizer.sanitize()` expects a `Node`")},n=!0),globalThis.Sanitizer.prototype.sanitizeFor instanceof Function||(globalThis.Sanitizer.prototype.sanitizeFor=function(e,t){const n=document.createElement(e);return re(n,t,this.getConfiguration()),n},n=!0),Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(e,n=t){re(this,e,n)},n=!0)}else globalThis.Sanitizer=e,n=!0;return n}}}(class e{constructor({allowElements:t,allowAttributes:n,blockElements:o,dropAttributes:r,dropElements:i,allowComments:a=oe.allowComments,allowCustomElements:s=oe.allowCustomElements,allowUnknownMarkup:l=oe.allowUnknownMarkup}=e.getDefaultConfiguration()){me.set(this,{allowElements:t,allowComments:a,allowAttributes:n,allowCustomElements:s,blockElements:o,dropAttributes:r,dropElements:i,allowUnknownMarkup:l})}getConfiguration(){return me.get(this)}sanitize(e){return pe(e,this.getConfiguration())}sanitizeFor(e,t){const n=document.createElement(e);return n.setHTML(t,this.getConfiguration()),n}static getDefaultConfiguration(){return oe}},oe);he();const ye={get(){return Array.from(this.styleSheets).filter((e=>e.ownerNode.classList.contains("_adopted")))},set(e){if(!Array.isArray(e))throw new TypeError("Must be an array");{const t=new Set(this.adoptedStyleSheets);t.difference(e).forEach((e=>e.ownerNode.remove()));const n=[...new Set(e).difference(t)].map((e=>{const t=document.createElement("link"),n=new AbortController,o=n.signal,r=URL.createObjectURL(new File([],"adopted.css",{type:"text/css"}));return t.rel="stylesheet",t.href=r,t.classList.add("_adopted"),t.disabled=e.disabled,t.addEventListener("load",(({target:o})=>{n.abort(),t.media=e.media.mediaText,[...e.cssRules].forEach(((e,t)=>{o.sheet.insertRule(e.cssText,t)})),setTimeout((()=>URL.revokeObjectURL(o.href)),100)}),{once:!0,signal:o}),t.addEventListener("error",(({target:e})=>{n.abort(),URL.revokeObjectURL(e.href)}),{once:!0,signal:o}),t}));this instanceof Document?this.head.append(...n):this.append(...n)}}};function ge(e){for(;e.cssRules.length>0;)e.deleteRule(0)}e(Document,"parseHTML",((...e)=>ue(...e))),t(Document.prototype,"adoptedStyleSheets",ye),"ShadowRoot"in globalThis&&t(ShadowRoot.prototype,"adoptedStyleSheets",ye);try{new CSSStyleSheet}catch{const e=globalThis.CSSStyleSheet;globalThis.CSSStyleSheet=function({disabled:e=!1,media:t}={}){const n=function(e="",{disabled:t=!1,media:n}={}){const o=Document.parseHTML(`<style>${e}</style>`,{sanitizer:new Sanitizer({allowElements:["style","html","head","body"]})}).styleSheets.item(0);return"string"==typeof n&&o.media.appendMedium(n),o.disabled=t,o}("#dfgbkjdfg{color:red;}",{disabled:e,media:t});return n.deleteRule(0),n},globalThis.CSSStyleSheet.prototype=e.prototype,e.prototype.constructor=globalThis.CSSStyleSheet}CSSStyleSheet.prototype.replace instanceof Function||(CSSStyleSheet.prototype.replace=function(e){const t=document.createElement("link"),n=new AbortController,{resolve:o,reject:r,promise:i}=Promise.withResolvers();return t.addEventListener("load",(({target:e})=>{ge(this),[...e.sheet.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t))),o(this),n.abort(),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:n.signal}),t.addEventListener("error",(({target:e})=>{const t=new DOMException("Error loading stylesheet.");r(t),n.abort(t),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:n.signal}),t.rel="stylesheet",t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.media="no-op",t.href=URL.createObjectURL(new File([e],"tmp.css",{type:"text/css"})),document.head.append(t),i}),CSSStyleSheet.prototype.replaceSync instanceof Function||(CSSStyleSheet.prototype.replaceSync=function(e){const t=Document.parseHTML(`<style>${e}</style>`,{sanitizer:new Sanitizer({allowElements:["style","html","head","body"]})}).styleSheets.item(0);ge(this),[...t.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t)))});const be={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"};if(HTMLScriptElement.supports instanceof Function||(HTMLScriptElement.supports=function(e){switch(e.toLowerCase()){case"classic":return!0;case"module":return"noModule"in HTMLScriptElement.prototype;default:return!1}}),!Element.prototype.hasOwnProperty(be.role)){const e=!0,t=!0,n=Object.fromEntries(Object.entries(be).map((([n,o])=>[n,{get:function(){return this.getAttribute(o)},set:function(e){"string"==typeof e?this.setAttribute(o,e):this.removeAttribute(o)},enumerable:e,configurable:t}])));Object.defineProperties(Element.prototype,n)}if(!HTMLElement.prototype.hasOwnProperty("inert")){const e=new WeakMap,t=n=>{e.has(n)&&(n.tabIndex=e.get(n)),n.hasChildNodes()&&[...n.children].forEach(t)},n=t=>{-1!==t.tabIndex&&(e.set(t,t.tabIndex),t.tabIndex=-1),t.hasChildNodes()&&[...t.children].forEach(n)};Object.defineProperty(HTMLElement.prototype,"inert",{get:function(){return this.hasAttribute("inert")},set:function(e){e?(this.setAttribute("aria-hidden","true"),this.setAttribute("inert",""),n(this)):(this.removeAttribute("aria-hidden"),this.removeAttribute("inert"),t(this))},enumerable:!0,configurable:!0})}if(HTMLImageElement.prototype.hasOwnProperty("complete")||Object.defineProperty(HTMLImageElement.prototype,"complete",{get:function(){return""===this.src||this.naturalHeight>0}}),HTMLImageElement.prototype.decode instanceof Function||(HTMLImageElement.prototype.decode=function(){return this.complete?Promise.resolve():new Promise(((e,t)=>{const n=()=>{this.removeEventListener("error",o),this.removeEventListener("load",n),e()},o=e=>{this.removeEventListener("error",o),this.removeEventListener("load",n),t(e)};this.addEventListener("load",n),this.addEventListener("error",o)}))}),Element.prototype.setHTML instanceof Function?function(e,t,n){const{value:o,enumerable:r,configurable:i,writable:a}=Object.getOwnPropertyDescriptor(e,t),s=n(o);if(!(s instanceof Function))throw new TypeError(`Error overwriting ${t}. The func MUST be a function that accepts the original as an argument and return a function.`);Object.defineProperty(e,t,{value:s,enumerable:r,configurable:i,writable:a})}(Element.prototype,"setHTML",(function(e){return function(t,n={}){if(n.sanitizer instanceof Sanitizer)e.call(this,t,n);else{const o=new Sanitizer(function({allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s}={}){return void 0===e&&void 0===i&&(e=oe.allowAttributes),void 0===n&&void 0===a&&(n=oe.allowElements),{allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s}}(n));e.call(this,t,{sanitizer:o})}}})):Element.prototype.setHTML=function(e,t=oe){re(this,e,t)},!HTMLTemplateElement.prototype.hasOwnProperty("shadowRootMode")){Object.defineProperty(HTMLTemplateElement.prototype,"shadowRootMode",{get:function(){return this.getAttribute("shadowrootmode")},set:function(e){this.setAttribute("shadowrootmode",e)},enumerable:!0,configurable:!0});const e=(t=document)=>{t.querySelectorAll("template[shadowrootmode]").forEach((t=>{const n=t.parentElement.attachShadow({mode:t.shadowRootMode});n.append(t.content),t.remove(),e(n)}))};"loading"===document.readyState?document.addEventListener("readystatechange",(()=>e(document)),{once:!0}):e(document)}Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(e){return e instanceof Set||(e=new Set(e)),new Set([...this].filter((t=>e.has(t))))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(e){return e instanceof Set||(e=new Set(e)),new Set([...this].filter((t=>!e.has(t))))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(e){return new Set([...this,...e])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(e){return e instanceof Set||(e=new Set(e)),[...this].every((t=>e.has(t)))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(e){return e instanceof Set||(e=new Set(e)),e.isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(e){return e instanceof Set||(e=new Set(e)),new Set([...this.difference(e),...e.difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(e){return e instanceof Set||(e=new Set(e)),new Set([...this,...e]).size===this.size+e.size}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(e,{insert:t,update:n}={}){const o=this.has(e);if(o&&n instanceof Function){const t=this.get(e),o=n.call(this,t,e,this);return o!==t&&this.set(e,o),o}if(o)return this.get(e);if(t instanceof Function){const n=t.call(this,e,this);return this.set(e,n),n}throw new Error("Key is not found and no `insert()` given")}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(e,{insert:t,update:n}={}){const o=this.has(e);if(o&&n instanceof Function){const t=this.get(e),o=n.call(this,t,e,this);return o!==t&&this.set(e,t),o}if(o)return this.get(e);if(t instanceof Function){const n=t.call(this,e,this);return this.set(e,n),n}throw new Error("Key is not found and no `insert()` given")}),function(){if("screen"in globalThis&&!(globalThis.getScreenDetails instanceof Function)){class e extends EventTarget{get availHeight(){return screen.availHeight}get availLeft(){return screen.availLeft}get availTop(){return screen.availTop}get availWidth(){return screen.availWidth}get colorDepth(){return screen.colorDepth}get devicePixelRatio(){return globalThis.devicePixelRatio||1}get height(){return screen.height}get isExtended(){return screen.isExtended}get isInternal(){return!0}get isPrimary(){return!0}get label(){return"Unknown"}get orientation(){return screen.orientation}get pixelDepth(){return screen.pixelDepth}get top(){return screen.top}get width(){return screen.width}}class t extends EventTarget{get currentScreen(){return new e}get screens(){return[this.currentScreen]}}Object.defineProperty(Screen.prototype,"isExtended",{enumerable:!0,configurable:!0,get:()=>!1}),globalThis.getScreenDetails=async()=>new t}}();
43
+ const me=new WeakMap;const{setHTML:fe,polyfill:he}=function(e,t){return{setHTML:re,polyfill:function(){let n=!1;if("Sanitizer"in globalThis){if(globalThis.Sanitizer.getDefaultConfiguration instanceof Function||(globalThis.Sanitizer.getDefaultConfiguration=function(){return t},n=!0),!(globalThis.Sanitizer.prototype.getConfiguration instanceof Function)){const e=new WeakMap,t=globalThis.Sanitizer;globalThis.Sanitizer=class extends t{constructor({allowAttributes:n,allowComments:o,allowElements:r,allowCustomElements:i,blockElements:a,dropAttributes:s,dropElements:l,allowUnknownMarkup:c}=t.getDefaultConfiguration()){super({allowAttributes:n,allowComments:o,allowElements:r,allowCustomElements:i,blockElements:a,dropAttributes:s,dropElements:l,allowUnknownMarkup:c}),e.set(this,{allowAttributes:n,allowComments:o,allowElements:r,allowCustomElements:i,blockElements:a,dropAttributes:s,dropElements:l,allowUnknownMarkup:c})}getConfiguration(){return e.get(this)}},n=!0}globalThis.Sanitizer.prototype.sanitize instanceof Function||(globalThis.Sanitizer.prototype.sanitize=function(e){if(e instanceof Node){if([Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE].includes(e.nodeType))return pe(e,this.getConfiguration());throw new TypeError("Expected a Document or DocumentFragment in `Sanitizer.sanitize()`.")}throw new TypeError("`Sanitizer.sanitize()` expects a `Node`")},n=!0),globalThis.Sanitizer.prototype.sanitizeFor instanceof Function||(globalThis.Sanitizer.prototype.sanitizeFor=function(e,t){const n=document.createElement(e);return re(n,t,this.getConfiguration()),n},n=!0),Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(e,n=t){re(this,e,n)},n=!0)}else globalThis.Sanitizer=e,n=!0;return n}}}(class e{constructor({allowElements:t,allowAttributes:n,blockElements:o,dropAttributes:r,dropElements:i,allowComments:a=oe.allowComments,allowCustomElements:s=oe.allowCustomElements,allowUnknownMarkup:l=oe.allowUnknownMarkup}=e.getDefaultConfiguration()){me.set(this,{allowElements:t,allowComments:a,allowAttributes:n,allowCustomElements:s,blockElements:o,dropAttributes:r,dropElements:i,allowUnknownMarkup:l})}getConfiguration(){return me.get(this)}sanitize(e){return pe(e,this.getConfiguration())}sanitizeFor(e,t){const n=document.createElement(e);return n.setHTML(t,this.getConfiguration()),n}static getDefaultConfiguration(){return oe}},oe);he();const ye={get(){return Array.from(this.styleSheets).filter((e=>e.ownerNode.classList.contains("_adopted")))},set(e){if(!Array.isArray(e))throw new TypeError("Must be an array");{const t=new Set(this.adoptedStyleSheets);t.difference(e).forEach((e=>e.ownerNode.remove()));const n=[...new Set(e).difference(t)].map((e=>{const t=document.createElement("link"),n=new AbortController,o=n.signal,r=URL.createObjectURL(new File([],"adopted.css",{type:"text/css"}));return t.rel="stylesheet",t.href=r,t.classList.add("_adopted"),t.disabled=e.disabled,t.addEventListener("load",(({target:o})=>{n.abort(),t.media=e.media.mediaText,[...e.cssRules].forEach(((e,t)=>{o.sheet.insertRule(e.cssText,t)})),setTimeout((()=>URL.revokeObjectURL(o.href)),100)}),{once:!0,signal:o}),t.addEventListener("error",(({target:e})=>{n.abort(),URL.revokeObjectURL(e.href)}),{once:!0,signal:o}),t}));this instanceof Document?this.head.append(...n):this.append(...n)}}};function ge(e){for(;e.cssRules.length>0;)e.deleteRule(0)}e(Document,"parseHTML",((...e)=>ue(...e))),t(Document.prototype,"adoptedStyleSheets",ye),"ShadowRoot"in globalThis&&t(ShadowRoot.prototype,"adoptedStyleSheets",ye);try{new CSSStyleSheet}catch{const e=globalThis.CSSStyleSheet;globalThis.CSSStyleSheet=function({disabled:e=!1,media:t}={}){const n=function(e="",{disabled:t=!1,media:n}={}){const o=Document.parseHTML(`<style>${e}</style>`,{sanitizer:new Sanitizer({allowElements:["style","html","head","body"]})}).styleSheets.item(0);return"string"==typeof n&&o.media.appendMedium(n),o.disabled=t,o}("#dfgbkjdfg{color:red;}",{disabled:e,media:t});return n.deleteRule(0),n},globalThis.CSSStyleSheet.prototype=e.prototype,e.prototype.constructor=globalThis.CSSStyleSheet}CSSStyleSheet.prototype.replace instanceof Function||(CSSStyleSheet.prototype.replace=function(e){const t=document.createElement("link"),n=new AbortController,{resolve:o,reject:r,promise:i}=Promise.withResolvers();return t.addEventListener("load",(({target:e})=>{ge(this),[...e.sheet.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t))),o(this),n.abort(),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:n.signal}),t.addEventListener("error",(({target:e})=>{const t=new DOMException("Error loading stylesheet.");r(t),n.abort(t),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:n.signal}),t.rel="stylesheet",t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.media="no-op",t.href=URL.createObjectURL(new File([e],"tmp.css",{type:"text/css"})),document.head.append(t),i}),CSSStyleSheet.prototype.replaceSync instanceof Function||(CSSStyleSheet.prototype.replaceSync=function(e){const t=Document.parseHTML(`<style>${e}</style>`,{sanitizer:new Sanitizer({allowElements:["style","html","head","body"]})}).styleSheets.item(0);ge(this),[...t.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t)))});const be={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"};if(HTMLScriptElement.supports instanceof Function||(HTMLScriptElement.supports=function(e){switch(e.toLowerCase()){case"classic":return!0;case"module":return"noModule"in HTMLScriptElement.prototype;default:return!1}}),!Element.prototype.hasOwnProperty(be.role)){const e=!0,t=!0,n=Object.fromEntries(Object.entries(be).map((([n,o])=>[n,{get:function(){return this.getAttribute(o)},set:function(e){"string"==typeof e?this.setAttribute(o,e):this.removeAttribute(o)},enumerable:e,configurable:t}])));Object.defineProperties(Element.prototype,n)}if(!HTMLElement.prototype.hasOwnProperty("inert")){const e=new WeakMap,t=n=>{e.has(n)&&(n.tabIndex=e.get(n)),n.hasChildNodes()&&[...n.children].forEach(t)},n=t=>{-1!==t.tabIndex&&(e.set(t,t.tabIndex),t.tabIndex=-1),t.hasChildNodes()&&[...t.children].forEach(n)};Object.defineProperty(HTMLElement.prototype,"inert",{get:function(){return this.hasAttribute("inert")},set:function(e){e?(this.setAttribute("aria-hidden","true"),this.setAttribute("inert",""),n(this)):(this.removeAttribute("aria-hidden"),this.removeAttribute("inert"),t(this))},enumerable:!0,configurable:!0})}if(HTMLImageElement.prototype.hasOwnProperty("complete")||Object.defineProperty(HTMLImageElement.prototype,"complete",{get:function(){return""===this.src||this.naturalHeight>0}}),HTMLImageElement.prototype.decode instanceof Function||(HTMLImageElement.prototype.decode=function(){return this.complete?Promise.resolve():new Promise(((e,t)=>{const n=()=>{this.removeEventListener("error",o),this.removeEventListener("load",n),e()},o=e=>{this.removeEventListener("error",o),this.removeEventListener("load",n),t(e)};this.addEventListener("load",n),this.addEventListener("error",o)}))}),Element.prototype.setHTML instanceof Function?function(e,t,n){const{value:o,enumerable:r,configurable:i,writable:a}=Object.getOwnPropertyDescriptor(e,t),s=n(o);if(!(s instanceof Function))throw new TypeError(`Error overwriting ${t}. The func MUST be a function that accepts the original as an argument and return a function.`);Object.defineProperty(e,t,{value:s,enumerable:r,configurable:i,writable:a})}(Element.prototype,"setHTML",(function(e){return function(t,n={}){if(n.sanitizer instanceof Sanitizer)e.call(this,t,n);else{const o=new Sanitizer(function({allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s}={}){return void 0===e&&void 0===i&&(e=oe.allowAttributes),void 0===n&&void 0===a&&(n=oe.allowElements),{allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s}}(n));e.call(this,t,{sanitizer:o})}}})):Element.prototype.setHTML=function(e,t=oe){re(this,e,t)},!HTMLTemplateElement.prototype.hasOwnProperty("shadowRootMode")){Object.defineProperty(HTMLTemplateElement.prototype,"shadowRootMode",{get:function(){return this.getAttribute("shadowrootmode")},set:function(e){this.setAttribute("shadowrootmode",e)},enumerable:!0,configurable:!0});const e=(t=document)=>{t.querySelectorAll("template[shadowrootmode]").forEach((t=>{const n=t.parentElement.attachShadow({mode:t.shadowRootMode});n.append(t.content),t.remove(),e(n)}))};"loading"===document.readyState?document.addEventListener("readystatechange",(()=>e(document)),{once:!0}):e(document)}Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(e){return e instanceof Set||(e=new Set(e)),new Set([...this].filter((t=>e.has(t))))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(e){return e instanceof Set||(e=new Set(e)),new Set([...this].filter((t=>!e.has(t))))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(e){return new Set([...this,...e])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(e){return e instanceof Set||(e=new Set(e)),[...this].every((t=>e.has(t)))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(e){return e instanceof Set||(e=new Set(e)),e.isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(e){return e instanceof Set||(e=new Set(e)),new Set([...this.difference(e),...e.difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(e){return e instanceof Set||(e=new Set(e)),new Set([...this,...e]).size===this.size+e.size}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(e,{insert:t,update:n}={}){const o=this.has(e);if(o&&n instanceof Function){const t=this.get(e),o=n.call(this,t,e,this);return o!==t&&this.set(e,t),o}if(o)return this.get(e);if(t instanceof Function){const n=t.call(this,e,this);return this.set(e,n),n}throw new Error("Key is not found and no `insert()` given")}),function(){if("screen"in globalThis&&!(globalThis.getScreenDetails instanceof Function)){class e extends EventTarget{get availHeight(){return screen.availHeight}get availLeft(){return screen.availLeft}get availTop(){return screen.availTop}get availWidth(){return screen.availWidth}get colorDepth(){return screen.colorDepth}get devicePixelRatio(){return globalThis.devicePixelRatio||1}get height(){return screen.height}get isExtended(){return screen.isExtended}get isInternal(){return!0}get isPrimary(){return!0}get label(){return"Unknown"}get orientation(){return screen.orientation}get pixelDepth(){return screen.pixelDepth}get top(){return screen.top}get width(){return screen.width}}class t extends EventTarget{get currentScreen(){return new e}get screens(){return[this.currentScreen]}}Object.defineProperty(Screen.prototype,"isExtended",{enumerable:!0,configurable:!0,get:()=>!1}),globalThis.getScreenDetails=async()=>new t}}();
44
44
  /**
45
45
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
46
46
  */
@@ -62,5 +62,5 @@ const we="user-blocking",Te="user-visible",ve="background";async function Ee(e,{
62
62
  * Additionally, if `internals.states._polyfilled`
63
63
  * - Use `._state--*` in addition to `:--*` to query element internals states
64
64
  * - This includes `:disabled` -> `._state--disabled` & `:invalid` -> `._state--invalid`
65
- */;const Me={key:Symbol("key"),internals:Symbol("element-internals"),form:Symbol("form"),fieldset:Symbol("fieldset"),element:Symbol("element"),validity:Symbol("validity"),validationMessage:Symbol("validation-message"),value:Symbol("value"),state:Symbol("state"),formController:Symbol("form-controller"),anchor:Symbol("anchor"),customInputs:Symbol("custom-inputs")};if(!(HTMLElement.prototype.attachInternals instanceof Function)&&"FormDataEvent"in globalThis){const e={valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1,customError:!1,valid:!0},t=e=>e.hasOwnProperty(Me.fieldset)&&e[Me.fieldset]instanceof HTMLFieldSetElement&&e[Me.fieldset].disabled,n=e=>e instanceof HTMLElement&&e.tagName.includes("-")&&customElements.get(e.tagName.toLowerCase()).formAssociated,o=(e,t)=>function(n){if(n.target.reportValidity()){if(t.willValidate&&n.formData instanceof FormData){const o=t[Me.value];o instanceof FormData?o.entries().forEach((([e,t])=>n.formData.set(e,t))):e.hasAttribute("name")&&n.formData.set(e.getAttribute("name"),t[Me.value])}}else n.preventDefault(),n.stopImmediatePropagation(),n.stopPropagation()},r=(e,t)=>{Object.entries(t).forEach((([t,n])=>e.style.setProperty(t,n)))},i=e=>e.hasAttribute("form")&&document.forms[e.getAttribute("form")]||e.closest("form"),a=(e,t,r)=>{if(e instanceof HTMLFormElement){if(!(r instanceof HTMLElement&&r.tagName.includes("-")))throw new TypeError("Not a custom element");if(!(t instanceof c||t instanceof globalThis.ElementInternals))throw new TypeError("Invalid ElementInternals");if(!n(r))throw new TypeError(`${r.tagName} is not form associated.`);if(!(r.formAssociatedCallback instanceof Function))throw new TypeError(`${r.tagName} is missing a formAssociatedCallback method.`);{const n=new AbortController,i=r.closest("fieldset");i instanceof Element&&(r[Me.fieldset]=i,i.hasOwnProperty(Me.customInputs)||(i[Me.customInputs]=new Set),i[Me.customInputs].add(r),s.observe(i,l)),t[Me.form]=e,t[Me.formController]=n;const{checkValidity:a,reportValidity:c}=e;e.reportValidity=function(){return!!c.call(this)&&t.reportValidity()},e.checkValidity=function(){return!!a.call(this)&&t.checkValidity()},n.signal.addEventListener("abort",(()=>{e.reportValidity=c,e.checkValidity=a}),{once:!0}),e.addEventListener("formdata",o(r,t),{signal:n.signal}),e.addEventListener("submit",(e=>{e.target.reportValidity()||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation())}),{signal:n.signal}),r.formResetCallback instanceof Function&&e.addEventListener("reset",(()=>r.formResetCallback()),{signal:n.signal})}}else if(t[Me.formController]instanceof AbortController&&t[Me.formController].abort(),t[Me.form]=null,t[Me.formController]=null,r.hasOwnProperty(Me.fieldset)){const e=r[Me.fieldset];e.hasOwnProperty(Me.customInputs)&&(e[Me.customInputs].delete(r),0===e[Me.customInputs.size]&&delete e[Me.customInputs]),r[Me.fieldset]=null}},s=new MutationObserver((e=>{e.forEach((({target:o,type:r,attributeName:i})=>{if("attributes"===r&&"disabled"===i){const r=o.hasAttribute("disabled");if(n(o)&&o.hasOwnProperty(Me.internals)&&o[Me.internals].states.has("--disabled")!==r&&(1===e.length?!t(o):o.hasAttribute("disabled")===t(o)&&e.some((e=>e.target.isSameNode(o[Me.fieldset]))))){const e=o[Me.internals];r?e.states.add("--disabled"):e.states.delete("--disabled"),o.formDisabledCallback instanceof Function&&o.formDisabledCallback(r)}else"FIELDSET"!==o.tagName||!o.hasOwnProperty(Me.customInputs)||1!==e.length&&e.some((e=>o[Me.customInputs].has(e.target)))||o[Me.customInputs].forEach((e=>{e.isConnected&&e.hasOwnProperty(Me.internals)?e.hasAttribute("disabled")||(r?e[Me.internals].states.add("--disabled"):e[Me.internals].states.delete("--disabled"),e.formDisabledCallback instanceof Function&&e.formDisabledCallback(r)):o[Me.customInputs].delete(e)}))}}))})),l={attributes:!0,attributeFilter:["disabled"]};class c{constructor(t,o){if(o!==Me.key)throw new TypeError("Illegal constructor");if(!(t instanceof HTMLElement))throw new TypeError("Must be called on an HTMLElement");if(!t.tagName.includes("-"))throw new DOMException("Cannot attach internals to a built-in element.");{const o=!0,r=!1,i=!0;Object.defineProperties(this,{[Me.element]:{value:t,configurable:o,enumerable:r,writable:i},[Me.form]:{value:null,configurable:o,enumerable:r,writable:i},[Me.fieldset]:{value:null,configurable:o,enumerable:r,writable:i},[Me.anchor]:{value:null,configurable:o,enumerable:r,writable:i},[Me.validity]:{value:e,configurable:o,enumerable:r,writable:i},[Me.validationMessage]:{value:"",configurable:o,enumerable:r,writable:i},[Me.value]:{value:null,configurable:o,enumerable:r,writable:i},[Me.state]:{value:null,configurable:o,enumerable:r,writable:i},[Me.formController]:{value:null,configurable:o,enumerable:r,writable:i}}),n(t)&&s.observe(t,l),Object.defineProperty(t,Me.internals,{value:this,enumerable:!1,configurable:!1,writable:!1}),setTimeout((()=>this.states.add("--element-internals-polyfilled")),10)}}get form(){return this[Me.form]}get labels(){const e=this.form;return e instanceof HTMLFormElement&&0!==this[Me.element].id.length?e.querySelectorAll(`label[for="${this[Me.element].id}"]`):document.createDocumentFragment().childNodes}get _polyfilled(){return!0}get shadowRoot(){return this[Me.element].shadowRoot}get validity(){return n(this[Me.element])?this[Me.validity]:void 0}get validationMessage(){return n(this[Me.element])?this[Me.validationMessage]||"":void 0}get willValidate(){const e=this[Me.element];return n(e)&&!t(e)&&!["disabled","readonly"].some((t=>e.hasAttribute(t)))}checkValidity(){if(this.willValidate){if(this.validity.valid){const e=this[Me.element].nextElementSibling;return e instanceof HTMLElement&&e.classList.contains("_element-internals-popup")&&e.remove(),!0}return this[Me.element].dispatchEvent(new Event("invalid")),!1}return!0}reportValidity(){if(this.checkValidity())return!0;{const e=this.validationMessage;if("string"==typeof e&&0!==e.length){const{bottom:t,left:n}=this[Me.element].getBoundingClientRect(),o=document.createElement("div");o.textContent=e,r(o,{position:"fixed","background-color":"#2b2a33",color:"#fafafa",top:`${t+2}px`,left:`${n}px`,"z-index":2147483647,"color-scheme":"light-dark","font-family":"system-ui, serif","font-size":"18px",display:"inline-block",padding:"0.6em 0.8em",border:"1px solid #1a1a1a","border-radius":"6px"}),o.classList.add("_element-internals-popup"),this[Me.element].focus();const i=this[Me.element].nextElementSibling;i instanceof Element&&i.classList.contains("_element-internals-popup")&&i.remove(),this[Me.element].insertAdjacentElement("afterend",o),this[Me.anchor]instanceof Element&&this[Me.anchor].focus(),setTimeout((()=>{o.isConnected&&o.remove()}),3e3)}return!1}}setFormValue(e,t){if(!n(this[Me.element]))throw new DOMException("Not form associated");this[Me.value]=e,this[Me.state]=t}setValidity({valueMissing:e=!1,typeMismatch:t=!1,patternMismatch:o=!1,tooLong:r=!1,tooShort:i=!1,rangeUnderflow:a=!1,rangeOverflow:s=!1,stepMismatch:l=!1,badInput:c=!1,customError:u=!1},p="",d){if(!n(this[Me.element]))throw new DOMException("Not form associated");if(("string"!=typeof p||0===p.length)&&(e||t||o||r||i||a||s||l||c||u))throw new DOMException("Message required if any flags are true.");{const n=[e,t,o,r,i,a,s,l,c,u].every((e=>!1===e));this[Me.validity]={valueMissing:e,typeMismatch:t,patternMismatch:o,tooLong:r,tooShort:i,rangeUnderflow:a,rangeOverflow:s,stepMismatch:l,badInput:c,customError:u,valid:n},this[Me.validationMessage]=p,this[Me.anchor]=d,n?(this.states.delete("--invalid"),this.states.add("--valid")):(this.states.add("--invalid"),this.states.delete("--valid"),this[Me.element].dispatchEvent(new Event("invalid")))}}_associateForm(e,t){a(e,this,t)}_findAssociatedForm(e){return i(e)}}HTMLElement.prototype.attachInternals=function(){if(this.hasOwnProperty(Me.internals))throw new DOMException("Invalid operation");if(this.tagName.includes("-"))return new c(this,Me.key);throw new DOMException("Cannot call attachInternals on built-in elements.")},globalThis.ElementInternals=c}if("ElementInternals"in globalThis&&!("CustomStateSet"in globalThis)){const e="_state",t=new WeakMap,n=t=>{if(t.toString().startsWith("--"))return`${e}${t}`;throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value '${t}' must start with '--'.`)},{value:o,writable:r,configurable:i,enumerable:a}=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"attachInternals");class s{constructor(e,n){if(n!==Me.key)throw new TypeError("Illegal Constructor");if(!(e instanceof HTMLElement))throw new TypeError("el must be an HTMLElement");t.set(this,e),this.add("--custom-states-polyfilled")}get _polyfilled(){return!0}get size(){return[...this.values()].length}add(e){t.get(this).classList.add(n(e))}has(e){return t.get(this).classList.contains(n(e))}delete(e){const o=n(e);return!!t.get(this).classList.contains(o)&&(t.get(this).classList.remove(o),!0)}clear(){this.values().forEach((e=>this.delete(e)))}keys(){return this.values()}values(){return t.get(this).classList.values().filter((t=>t.startsWith(`${e}--`))).map((t=>t.substr(e.length)))}entries(){return this.values().map((e=>[e,e]))}forEach(e,t){this.values().forEach((n=>e.call(t||this,n,n,this)))}[Symbol.toStringTag](){return"CustomStateSet"}[Symbol.iterator](){return this.values()}}Object.defineProperty(HTMLElement.prototype,"attachInternals",{value:function(){const e=o.call(this);return Object.defineProperty(e,Me.element,{value:this,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(e,"states",{value:new s(this,Me.key),configurable:!0,enumberable:!0}),Object.is(e.shadowRoot,null)&&!Object.is(this.shadowRoot,null)&&Object.defineProperty(e,"shadowRoot",{value:this.shadowRoot,configurable:!0,enumerable:!0}),e},writable:r,configurable:i,enumerable:a}),globalThis.CustomStateSet=s,function(e){const t=Object.fromEntries(Object.keys(be).map((e=>[e,{get:function(){return this[Me.element][e]},set:function(t){this[Me.element][e]=t},enumerable:!0,configurable:!0}])));Object.defineProperties(e,t)}(ElementInternals.prototype)}}();
65
+ */;const Me={key:Symbol("key"),internals:Symbol("element-internals"),form:Symbol("form"),fieldset:Symbol("fieldset"),element:Symbol("element"),validity:Symbol("validity"),validationMessage:Symbol("validation-message"),value:Symbol("value"),state:Symbol("state"),formController:Symbol("form-controller"),anchor:Symbol("anchor"),customInputs:Symbol("custom-inputs")};if(!(HTMLElement.prototype.attachInternals instanceof Function)&&"FormDataEvent"in globalThis){const e={valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1,customError:!1,valid:!0},t=e=>e.hasOwnProperty(Me.fieldset)&&e[Me.fieldset]instanceof HTMLFieldSetElement&&e[Me.fieldset].disabled,n=e=>e instanceof HTMLElement&&e.tagName.includes("-")&&customElements.get(e.tagName.toLowerCase()).formAssociated,o=(e,t)=>function(n){if(n.target.reportValidity()){if(t.willValidate&&n.formData instanceof FormData){const o=t[Me.value];o instanceof FormData?o.entries().forEach((([e,t])=>n.formData.set(e,t))):e.hasAttribute("name")&&n.formData.set(e.getAttribute("name"),t[Me.value])}}else n.preventDefault(),n.stopImmediatePropagation(),n.stopPropagation()},r=(e,t)=>{Object.entries(t).forEach((([t,n])=>e.style.setProperty(t,n)))},i=e=>e.hasAttribute("form")&&document.forms[e.getAttribute("form")]||e.closest("form"),a=(e,t,r)=>{if(e instanceof HTMLFormElement){if(!(r instanceof HTMLElement&&r.tagName.includes("-")))throw new TypeError("Not a custom element");if(!(t instanceof c||t instanceof globalThis.ElementInternals))throw new TypeError("Invalid ElementInternals");if(!n(r))throw new TypeError(`${r.tagName} is not form associated.`);if(!(r.formAssociatedCallback instanceof Function))throw new TypeError(`${r.tagName} is missing a formAssociatedCallback method.`);{const n=new AbortController,i=r.closest("fieldset");i instanceof Element&&(r[Me.fieldset]=i,i.hasOwnProperty(Me.customInputs)||(i[Me.customInputs]=new Set),i[Me.customInputs].add(r),s.observe(i,l)),t[Me.form]=e,t[Me.formController]=n;const{checkValidity:a,reportValidity:c}=e;e.reportValidity=function(){return!!c.call(this)&&t.reportValidity()},e.checkValidity=function(){return!!a.call(this)&&t.checkValidity()},n.signal.addEventListener("abort",(()=>{e.reportValidity=c,e.checkValidity=a}),{once:!0}),e.addEventListener("formdata",o(r,t),{signal:n.signal}),e.addEventListener("submit",(e=>{e.target.reportValidity()||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation())}),{signal:n.signal}),r.formResetCallback instanceof Function&&e.addEventListener("reset",(()=>r.formResetCallback()),{signal:n.signal})}}else if(t[Me.formController]instanceof AbortController&&t[Me.formController].abort(),t[Me.form]=null,t[Me.formController]=null,r.hasOwnProperty(Me.fieldset)){const e=r[Me.fieldset];e.hasOwnProperty(Me.customInputs)&&(e[Me.customInputs].delete(r),0===e[Me.customInputs.size]&&delete e[Me.customInputs]),r[Me.fieldset]=null}},s=new MutationObserver((e=>{e.forEach((({target:o,type:r,attributeName:i})=>{if("attributes"===r&&"disabled"===i){const r=o.hasAttribute("disabled");if(n(o)&&o.hasOwnProperty(Me.internals)&&o[Me.internals].states.has("--disabled")!==r&&(1===e.length?!t(o):o.hasAttribute("disabled")===t(o)&&e.some((e=>e.target.isSameNode(o[Me.fieldset]))))){const e=o[Me.internals];r?e.states.add("--disabled"):e.states.delete("--disabled"),o.formDisabledCallback instanceof Function&&o.formDisabledCallback(r)}else"FIELDSET"!==o.tagName||!o.hasOwnProperty(Me.customInputs)||1!==e.length&&e.some((e=>o[Me.customInputs].has(e.target)))||o[Me.customInputs].forEach((e=>{e.isConnected&&e.hasOwnProperty(Me.internals)?e.hasAttribute("disabled")||(r?e[Me.internals].states.add("--disabled"):e[Me.internals].states.delete("--disabled"),e.formDisabledCallback instanceof Function&&e.formDisabledCallback(r)):o[Me.customInputs].delete(e)}))}}))})),l={attributes:!0,attributeFilter:["disabled"]};class c{constructor(t,o){if(o!==Me.key)throw new TypeError("Illegal constructor");if(!(t instanceof HTMLElement))throw new TypeError("Must be called on an HTMLElement");if(!t.tagName.includes("-"))throw new DOMException("Cannot attach internals to a built-in element.");{const o=!0,r=!1,i=!0;Object.defineProperties(this,{[Me.element]:{value:t,configurable:o,enumerable:r,writable:i},[Me.form]:{value:null,configurable:o,enumerable:r,writable:i},[Me.fieldset]:{value:null,configurable:o,enumerable:r,writable:i},[Me.anchor]:{value:null,configurable:o,enumerable:r,writable:i},[Me.validity]:{value:e,configurable:o,enumerable:r,writable:i},[Me.validationMessage]:{value:"",configurable:o,enumerable:r,writable:i},[Me.value]:{value:null,configurable:o,enumerable:r,writable:i},[Me.state]:{value:null,configurable:o,enumerable:r,writable:i},[Me.formController]:{value:null,configurable:o,enumerable:r,writable:i}}),n(t)&&s.observe(t,l),Object.defineProperty(t,Me.internals,{value:this,enumerable:!1,configurable:!1,writable:!1}),setTimeout((()=>this.states.add("--element-internals-polyfilled")),10)}}get form(){return this[Me.form]}get labels(){const e=this.form;return e instanceof HTMLFormElement&&0!==this[Me.element].id.length?e.querySelectorAll(`label[for="${this[Me.element].id}"]`):document.createDocumentFragment().childNodes}get _polyfilled(){return!0}get shadowRoot(){return this[Me.element].shadowRoot}get validity(){return n(this[Me.element])?this[Me.validity]:void 0}get validationMessage(){return n(this[Me.element])?this[Me.validationMessage]||"":void 0}get willValidate(){const e=this[Me.element];return n(e)&&!t(e)&&!["disabled","readonly"].some((t=>e.hasAttribute(t)))}checkValidity(){if(this.willValidate){if(this.validity.valid){const e=this[Me.element].nextElementSibling;return e instanceof HTMLElement&&e.classList.contains("_element-internals-popup")&&e.remove(),!0}return this[Me.element].dispatchEvent(new Event("invalid")),!1}return!0}reportValidity(){if(this.checkValidity())return!0;{const e=this.validationMessage;if("string"==typeof e&&0!==e.length){const{bottom:t,left:n}=this[Me.element].getBoundingClientRect(),o=document.createElement("div");o.textContent=e,r(o,{position:"fixed","background-color":"#2b2a33",color:"#fafafa",top:`${t+2}px`,left:`${n}px`,"z-index":2147483647,"color-scheme":"light-dark","font-family":"system-ui, serif","font-size":"18px",display:"inline-block",padding:"0.6em 0.8em",border:"1px solid #1a1a1a","border-radius":"6px"}),o.classList.add("_element-internals-popup"),this[Me.element].focus();const i=this[Me.element].nextElementSibling;i instanceof Element&&i.classList.contains("_element-internals-popup")&&i.remove(),this[Me.element].insertAdjacentElement("afterend",o),this[Me.anchor]instanceof Element&&this[Me.anchor].focus(),setTimeout((()=>{o.isConnected&&o.remove()}),3e3)}return!1}}setFormValue(e,t){if(!n(this[Me.element]))throw new DOMException("Not form associated");this[Me.value]=e,this[Me.state]=t}setValidity({valueMissing:e=!1,typeMismatch:t=!1,patternMismatch:o=!1,tooLong:r=!1,tooShort:i=!1,rangeUnderflow:a=!1,rangeOverflow:s=!1,stepMismatch:l=!1,badInput:c=!1,customError:u=!1},p="",d){if(!n(this[Me.element]))throw new DOMException("Not form associated");if(("string"!=typeof p||0===p.length)&&(e||t||o||r||i||a||s||l||c||u))throw new DOMException("Message required if any flags are true.");{const n=[e,t,o,r,i,a,s,l,c,u].every((e=>!1===e));this[Me.validity]={valueMissing:e,typeMismatch:t,patternMismatch:o,tooLong:r,tooShort:i,rangeUnderflow:a,rangeOverflow:s,stepMismatch:l,badInput:c,customError:u,valid:n},this[Me.validationMessage]=p,this[Me.anchor]=d,n?(this.states.delete("--invalid"),this.states.add("--valid")):(this.states.add("--invalid"),this.states.delete("--valid"),this[Me.element].dispatchEvent(new Event("invalid")))}}_associateForm(e,t){a(e,this,t)}_findAssociatedForm(e){return i(e)}}HTMLElement.prototype.attachInternals=function(){if(this.hasOwnProperty(Me.internals))throw new DOMException("Invalid operation");if(this.tagName.includes("-"))return new c(this,Me.key);throw new DOMException("Cannot call attachInternals on built-in elements.")},globalThis.ElementInternals=c}if("ElementInternals"in globalThis&&!("CustomStateSet"in globalThis)){const e="_state",t=new WeakMap,n=t=>{if(t.toString().startsWith("--"))return`${e}${t}`;throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value '${t}' must start with '--'.`)},{value:o,writable:r,configurable:i,enumerable:a}=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"attachInternals");class s{constructor(e,n){if(n!==Me.key)throw new TypeError("Illegal Constructor");if(!(e instanceof HTMLElement))throw new TypeError("el must be an HTMLElement");t.set(this,e),this.add("--custom-states-polyfilled")}get _polyfilled(){return!0}get size(){return[...this.values()].length}add(e){t.get(this).classList.add(n(e))}has(e){return t.get(this).classList.contains(n(e))}delete(e){const o=n(e);return!!t.get(this).classList.contains(o)&&(t.get(this).classList.remove(o),!0)}clear(){this.values().forEach((e=>this.delete(e)))}keys(){return this.values()}values(){return t.get(this).classList.values().filter((t=>t.startsWith(`${e}--`))).map((t=>t.substr(e.length)))}entries(){return this.values().map((e=>[e,e]))}forEach(e,t){this.values().forEach((n=>e.call(t||this,n,n,this)))}[Symbol.toStringTag](){return"CustomStateSet"}[Symbol.iterator](){return this.values()}}Object.defineProperty(HTMLElement.prototype,"attachInternals",{value:function(){const e=o.call(this);return Object.defineProperty(e,Me.element,{value:this,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(e,"states",{value:new s(this,Me.key),configurable:!0,enumberable:!0}),Object.is(e.shadowRoot,null)&&!Object.is(this.shadowRoot,null)&&Object.defineProperty(e,"shadowRoot",{value:this.shadowRoot,configurable:!0,enumerable:!0}),e},writable:r,configurable:i,enumerable:a}),globalThis.CustomStateSet=s,function(e){const t=Object.fromEntries(Object.keys(be).map((e=>[e,{get:function(){return this[Me.element][e]},set:function(t){this[Me.element][e]=t},enumerable:!0,configurable:!0}])));Object.defineProperties(e,t)}(ElementInternals.prototype)}e(Response,"json",((e,{status:t=200,statusText:n="",headers:o=new Headers}={})=>o instanceof Headers?(o.set("Content-Type","application/json"),new Response(JSON.stringify(e),{status:t,statusText:n,headers:o})):Response.json(e,{status:t,statusText:n,headers:new Headers(o)}))),e(Response,"redirect",((e,t=302)=>new Response("",{status:t,headers:new Headers({Location:e})})))}();
66
66
  //# sourceMappingURL=all.min.js.map