@shgysk8zer0/polyfills 0.2.8 → 0.2.9

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,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [v0.2.9] - 2023-12-10
10
+
11
+ ### Fixed
12
+ - Fix misc issues with `Record` and `Tuple`
13
+
9
14
  ## [v0.2.8] - 2023-12-10
10
15
 
11
16
  ### Added
package/Record.js CHANGED
@@ -1,6 +1,10 @@
1
1
  if (! (globalThis.Record instanceof Function)) {
2
2
  /* eslint-disable no-inner-declarations */
3
3
  function Record(obj) {
4
+ if (new.target === Record) {
5
+ throw new TypeError('Record is not a constructor');
6
+ }
7
+
4
8
  const record = Object.create(Record.prototype);
5
9
  Object.defineProperties(record, Object.fromEntries(Object.entries(obj).map(([key, value]) => [
6
10
  key, {
@@ -15,10 +19,16 @@ if (! (globalThis.Record instanceof Function)) {
15
19
  return record;
16
20
  }
17
21
 
18
- Record.prototype = { constructor: Record };
22
+ Record.prototype.constructor = Record;
23
+ Object.defineProperty(Record.prototype, Symbol.toStringTag, {
24
+ value: 'Record',
25
+ enumerable: true,
26
+ configurable: false,
27
+ writable: false,
28
+ });
19
29
 
20
30
  Record.fromEntries = function fromEntries(entries) {
21
- return new Record(Object.fromEntries(entries));
31
+ return Record(Object.fromEntries(entries));
22
32
  };
23
33
 
24
34
  globalThis.Record = Record;
package/Tuple.js CHANGED
@@ -1,104 +1,130 @@
1
1
  if (! (globalThis.Tuple instanceof Function)) {
2
2
  /* eslint-disable no-inner-declarations */
3
+
4
+ /**
5
+ * Creates an unfrozen Tuple, such as for `Tuple.of()`
6
+ */
7
+ const createTuple = items => {
8
+ const tuple = Array.apply(Object.create(Tuple.prototype), items);
9
+ Object.setPrototypeOf(tuple, Tuple.prototype);
10
+ return tuple;
11
+ };
12
+
3
13
  function Tuple(...items) {
4
- const result = Array.apply(Object.create(Tuple.prototype), items);
5
- Object.setPrototypeOf(result, Tuple.prototype);
6
- Object.freeze(result);
7
- return result;
14
+ if (new.target === Tuple) {
15
+ throw new TypeError('Tuple is not a constructor');
16
+ }
17
+
18
+ const tuple = createTuple(items);
19
+ Object.freeze(tuple);
20
+ return tuple;
8
21
  }
9
22
 
10
- // const notAllowed = ['push', 'pop', 'sort', 'reverse', 'splice', 'shift', 'unshift', 'constructor'];
11
- // Tuple.prototype.constructor = Tuple;
23
+ Tuple.prototype.forEach = function forEach(callbackFn, thisArg) {
24
+ Array.prototype.forEach.call(this, callbackFn, thisArg);
25
+ };
26
+
27
+ Tuple.prototype.join = function join(separator = ',') {
28
+ return Array.prototype.join.call(this, separator);
29
+ };
12
30
 
13
- Tuple.prototype.forEach = function forEach() {
14
- Array.prototype.forEach.apply(this, arguments);
31
+ Tuple.prototype.concat = function concat(...values) {
32
+ return Tuple(...this, ...values);
15
33
  };
16
34
 
17
- Tuple.prototype.join = function join() {
18
- return Array.prototype.join.apply(this, arguments);
35
+ Tuple.prototype.slice = function slice(start, end) {
36
+ return Tuple.from(Array.prototype.slice.call(this, start, end));
19
37
  };
20
38
 
21
- Tuple.prototype.indexOf = function indexOf() {
22
- return Array.prototype.indexOf.apply(this, arguments);
39
+ Tuple.prototype.indexOf = function indexOf(searchElement, fromIndex) {
40
+ return Array.prototype.indexOf.call(this, searchElement, fromIndex);
23
41
  };
24
42
 
25
- Tuple.prototype.lastIndexOf = function lastIndexOf() {
26
- return Array.prototype.lastIndexOf.apply(this, arguments);
43
+ Tuple.prototype.lastIndexOf = function lastIndexOf(searchElement, fromIndex) {
44
+ return Array.prototype.lastIndexOf.call(this, searchElement, fromIndex);
27
45
  };
28
46
 
29
- Tuple.prototype.findIndex = function findIndex() {
30
- return Array.prototype.findIndex.apply(this, arguments);
47
+ Tuple.prototype.findIndex = function findIndex(callbackFn, thisArg) {
48
+ return Array.prototype.findIndex.call(this, callbackFn, thisArg);
31
49
  };
32
50
 
33
- Tuple.prototype.find = function find() {
34
- return Array.prototype.find.apply(this, arguments);
51
+ Tuple.prototype.find = function find(callbackFn, thisArg) {
52
+ return Array.prototype.find.call(this, callbackFn, thisArg);
35
53
  };
36
54
 
37
- Tuple.prototype.findLast = function findLast() {
38
- return Array.prototype.findLast.apply(this, arguments);
55
+ Tuple.prototype.findLast = function findLast(callbackFn, thisArg) {
56
+ return Array.prototype.findLast.call(this, callbackFn, thisArg);
39
57
  };
40
58
 
41
- Tuple.prototype.findLastIndex = function findLastIndex() {
42
- return Array.prototype.findLastIndex.apply(this, arguments);
59
+ Tuple.prototype.findLastIndex = function findLastIndex(callbackFn, thisArg) {
60
+ return Array.prototype.findLastIndex.call(this, callbackFn, thisArg);
43
61
  };
44
62
 
45
- Tuple.prototype.every = function every() {
46
- return Array.prototype.every.apply(this, arguments);
63
+ Tuple.prototype.every = function every(callbackFn, thisArg) {
64
+ return Array.prototype.every.call(this, callbackFn, thisArg);
47
65
  };
48
66
 
49
- Tuple.prototype.some = function some() {
50
- return Array.prototype.some.apply(this, arguments);
67
+ Tuple.prototype.some = function some(callbackFn, thisArg) {
68
+ return Array.prototype.some.call(this, callbackFn, thisArg);
51
69
  };
52
70
 
53
- Tuple.prototype.includes = function includes() {
54
- return Array.prototype.includes.apply(this, arguments);
71
+ Tuple.prototype.includes = function includes(searchElement, fromIndex) {
72
+ return Array.prototype.includes.call(this, searchElement, fromIndex);
55
73
  };
56
74
 
57
- Tuple.prototype.map = function map() {
58
- return Tuple.from(Array.prototype.map.apply(this, arguments));
75
+ Tuple.prototype.map = function map(callbackFn, thisArg) {
76
+ return Tuple.from(Array.prototype.map.call(this, callbackFn, thisArg));
59
77
  };
60
78
 
61
- Tuple.prototype.filter = function filter() {
62
- return Tuple.from(Array.prototype.filter.apply(this, arguments));
79
+ Tuple.prototype.filter = function filter(callbackFn, thisArg) {
80
+ return Tuple.from(Array.prototype.filter.call(this, callbackFn, thisArg));
63
81
  };
64
82
 
65
- Tuple.prototype.flat = function flat() {
66
- return Tuple.from(Array.prototype.flat.apply(this, arguments));
83
+ Tuple.prototype.flat = function flat(depth) {
84
+ return Tuple.from(Array.prototype.flat.call(this, depth));
67
85
  };
68
86
 
69
- Tuple.prototype.flatMap = function flatMap() {
70
- return Tuple.from(Array.prototype.flatMap.apply(this, arguments));
87
+ Tuple.prototype.flatMap = function flatMap(callbackFn, thisArg) {
88
+ return Tuple.from(Array.prototype.flatMap.call(this, callbackFn, thisArg));
71
89
  };
72
90
 
73
- Tuple.prototype.at = function at() {
74
- return Array.prototype.at.apply(this, arguments);
91
+ Tuple.prototype.at = function at(index) {
92
+ return Array.prototype.at.call(this, index);
75
93
  };
76
94
 
77
- Tuple.prototype.reduce = function reduce() {
78
- return Tuple.from(Array.prototype.reduce.apply(this, arguments));
95
+ Tuple.prototype.reduce = function reduce(callbackFn, initialValue) {
96
+ return Tuple.from(Array.prototype.reduce.call(this, callbackFn, initialValue));
79
97
  };
80
98
 
81
- Tuple.prototype.reduceRight = function reduceRight() {
82
- return Tuple.from(Array.prototype.reduceRight.apply(this, arguments));
99
+ Tuple.prototype.reduceRight = function reduceRight(callbackFn, initialValue) {
100
+ return Tuple.from(Array.prototype.reduceRight.call(this, callbackFn, initialValue));
83
101
  };
84
102
 
85
- Tuple.prototype.toSorted = function toSorted() {
86
- return Tuple.from(Array.prototype.toSorted.apply(this, arguments));
103
+ Tuple.prototype.toSorted = function toSorted(toStringTag) {
104
+ return Tuple.from(Array.prototype.toSorted.call(this, toStringTag));
87
105
  };
88
106
 
89
- Tuple.prototype.toSpliced = function toSpliced() {
90
- return Tuple.from(Array.prototype.toSpliced.apply(this, arguments));
107
+ Tuple.prototype.toSpliced = function toSpliced(start, deleteCount, ...items) {
108
+ return Tuple.from(Array.prototype.toSpliced.call(this, start, deleteCount, ...items));
91
109
  };
92
110
 
93
111
  Tuple.prototype.toReversed = function toReversed() {
94
- return Tuple.from(Array.prototype.toReversed.apply(this, arguments));
112
+ return Tuple.from(Array.prototype.toReversed.apply(this));
113
+ };
114
+
115
+ Tuple.prototype.with = function(index, value) {
116
+ return Tuple.from(Array.prototype.with.call(this, index, value));
117
+ };
118
+
119
+ Tuple.prototype.toLocaleString = function toLocaleString(locales, options) {
120
+ return Array.prototype.toLocaleString.call(this, locales, options);
95
121
  };
96
122
 
97
123
  Tuple.prototype.toJSON = function toJSON() {
98
124
  return [...this];
99
125
  };
100
126
 
101
- Tuple.prototype.keys = function keys(){
127
+ Tuple.prototype.keys = function keys() {
102
128
  return Array.prototype.keys.apply(this);
103
129
  };
104
130
 
@@ -114,8 +140,15 @@ if (! (globalThis.Tuple instanceof Function)) {
114
140
  return Array.prototype[Symbol.iterator].apply(this);
115
141
  };
116
142
 
117
- Tuple.from = function from(items) {
118
- return Tuple(...items);
143
+ Tuple.from = function from(items, mapFn, thisArg) {
144
+ const tuple = createTuple([]);
145
+ Array.prototype.push.apply(tuple, Array.from(items, mapFn, thisArg));
146
+ Object.freeze(tuple);
147
+ return tuple;
148
+ };
149
+
150
+ Tuple.of = function(...items) {
151
+ return Tuple.from(items);
119
152
  };
120
153
 
121
154
  Object.defineProperties(Tuple.prototype, {
@@ -139,7 +172,13 @@ if (! (globalThis.Tuple instanceof Function)) {
139
172
  },
140
173
  enumerable: true,
141
174
  configurable: false,
142
- }
175
+ },
176
+ [Symbol.toStringTag]: {
177
+ value: 'Tuple',
178
+ enumerable: true,
179
+ configurable: false,
180
+ writable: false,
181
+ },
143
182
  });
144
183
 
145
184
  globalThis.Tuple = Tuple;
package/all.min.js CHANGED
@@ -20,11 +20,11 @@
20
20
  * cookie properties, such as expires, etc.
21
21
  *
22
22
  * @TODO verify spec compliance as best as is possible
23
- */;const P="cookieStore"in globalThis,x={constructor:Symbol("constructor")};function N(){return 0===document.cookie.length?[]:document.cookie.split(";").map((e=>{const[t,n=null]=e.split("=");return{name:decodeURIComponent(t.trim()),value:"string"==typeof n?decodeURIComponent(n.trim()):null,path:void 0,expires:void 0,domain:void 0,sameSite:void 0,secure:void 0,partitioned:!1}}))}function C({name:e=null,value:t=null}={}){return"string"==typeof e&&(e=decodeURIComponent(e)),"string"==typeof t&&(t=decodeURIComponent(t)),"string"==typeof e&&"string"==typeof t?N().filter((n=>n.name===e&&n.value===t)):"string"==typeof e?N().filter((t=>t.name===e)):"string"==typeof t?N().filter((e=>e.value===t)):N()}function I({name:e,value:t,expires:n=null,maxAge:r=null,path:o="/",sameSite:i="lax",domain:a=null,secure:s=!1,partitioned:l=!1}){if(Number.isInteger(r))I({name:e,value:t,expires:Date.now()+r,path:o,sameSite:i,domain:a,secure:s,partitioned:l});else{let r=`${encodeURIComponent(e)}=`;t&&(r+=encodeURIComponent(t)),Number.isInteger(n)?r+=`;expires=${new Date(n).toUTCString()}`:n instanceof Date&&(r+=`;expires=${n.toUTCString()}`),"string"==typeof o&&(r+=`;path=${o}`),"string"==typeof a&&(r+=`;domain=${a}`),"string"==typeof i&&(r+=`;sameSite=${i}`),!0===s&&(r+=";secure"),!0===l&&(r+=";partitioned"),document.cookie=r}}class D extends EventTarget{constructor(e){if(e!==x.constructor)throw new DOMException("Invalid constructor");super(),Object.defineProperty(this,x.onchange,{enumerable:!1,configurable:!1,writable:!0,value:null})}get onchange(){return this[x.onchange]}set onchange(e){this[x.onchange]instanceof Function&&this.removeEventListener("change",this[x.onchange]),e instanceof Function&&this.addEventListener("change",e)}async get(e){const t=await this.getAll(e);return Array.isArray(t)&&0!==t.length?t[0]:null}async getAll(e){return C("string"==typeof e?{name:e}:e)}async set(...e){if(1===e.length&&"object"==typeof e[0]&&"string"==typeof e[0].name){const t=function({name:e,value:t=null,domain:n=null,path:r="/",expires:o=null,maxAge:i=null,sameSite:a="lax",secure:s=!1,partitioned:l=!1}){return{name:e,value:t,domain:n,path:r,expires:o,maxAge:i,sameSite:a,secure:s,partitioned:l}}(e[0]);I(t);const n=new Event("change");n.changed=[t],n.deleted=[],this.dispatchEvent(n)}else{if(2!==e.length)throw new Error("Invalid arguments");this.set({name:e[0],value:e[1]})}}async delete(e={}){if("string"==typeof e)this.delete({name:e});else{if("object"!=typeof e||"string"!=typeof e.name)throw new TypeError("Failed to execute 'delete' on 'CookieStore': required member name is undefined.");{const t=await this.getAll(e);if(0!==t.length){const n=new Event("change");n.changed=[],n.deleted=new Array(t.length),t.forEach(((t,r)=>{t.path=e.path||"/",t.domain=e.domain||null,t.secure=e.secure||null,delete t.value,t.sameSite=e.sameSite||"lax",n.deleted[r]=t,I({...t,value:null,expires:1})})),this.dispatchEvent(n)}}}}}const j=new D(x.constructor);
23
+ */;const P="cookieStore"in globalThis,x={constructor:Symbol("constructor")};function N(){return 0===document.cookie.length?[]:document.cookie.split(";").map((e=>{const[t,n=null]=e.split("=");return{name:decodeURIComponent(t.trim()),value:"string"==typeof n?decodeURIComponent(n.trim()):null,path:void 0,expires:void 0,domain:void 0,sameSite:void 0,secure:void 0,partitioned:!1}}))}function C({name:e=null,value:t=null}={}){return"string"==typeof e&&(e=decodeURIComponent(e)),"string"==typeof t&&(t=decodeURIComponent(t)),"string"==typeof e&&"string"==typeof t?N().filter((n=>n.name===e&&n.value===t)):"string"==typeof e?N().filter((t=>t.name===e)):"string"==typeof t?N().filter((e=>e.value===t)):N()}function I({name:e,value:t,expires:n=null,maxAge:r=null,path:o="/",sameSite:i="lax",domain:a=null,secure:s=!1,partitioned:l=!1}){if(Number.isInteger(r))I({name:e,value:t,expires:Date.now()+r,path:o,sameSite:i,domain:a,secure:s,partitioned:l});else{let r=`${encodeURIComponent(e)}=`;t&&(r+=encodeURIComponent(t)),Number.isInteger(n)?r+=`;expires=${new Date(n).toUTCString()}`:n instanceof Date&&(r+=`;expires=${n.toUTCString()}`),"string"==typeof o&&(r+=`;path=${o}`),"string"==typeof a&&(r+=`;domain=${a}`),"string"==typeof i&&(r+=`;sameSite=${i}`),!0===s&&(r+=";secure"),!0===l&&(r+=";partitioned"),document.cookie=r}}class j extends EventTarget{constructor(e){if(e!==x.constructor)throw new DOMException("Invalid constructor");super(),Object.defineProperty(this,x.onchange,{enumerable:!1,configurable:!1,writable:!0,value:null})}get onchange(){return this[x.onchange]}set onchange(e){this[x.onchange]instanceof Function&&this.removeEventListener("change",this[x.onchange]),e instanceof Function&&this.addEventListener("change",e)}async get(e){const t=await this.getAll(e);return Array.isArray(t)&&0!==t.length?t[0]:null}async getAll(e){return C("string"==typeof e?{name:e}:e)}async set(...e){if(1===e.length&&"object"==typeof e[0]&&"string"==typeof e[0].name){const t=function({name:e,value:t=null,domain:n=null,path:r="/",expires:o=null,maxAge:i=null,sameSite:a="lax",secure:s=!1,partitioned:l=!1}){return{name:e,value:t,domain:n,path:r,expires:o,maxAge:i,sameSite:a,secure:s,partitioned:l}}(e[0]);I(t);const n=new Event("change");n.changed=[t],n.deleted=[],this.dispatchEvent(n)}else{if(2!==e.length)throw new Error("Invalid arguments");this.set({name:e[0],value:e[1]})}}async delete(e={}){if("string"==typeof e)this.delete({name:e});else{if("object"!=typeof e||"string"!=typeof e.name)throw new TypeError("Failed to execute 'delete' on 'CookieStore': required member name is undefined.");{const t=await this.getAll(e);if(0!==t.length){const n=new Event("change");n.changed=[],n.deleted=new Array(t.length),t.forEach(((t,r)=>{t.path=e.path||"/",t.domain=e.domain||null,t.secure=e.secure||null,delete t.value,t.sameSite=e.sameSite||"lax",n.deleted[r]=t,I({...t,value:null,expires:1})})),this.dispatchEvent(n)}}}}}const D=new j(x.constructor);
24
24
  /**
25
25
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
26
26
  */
27
- function R(){return"trustedTypes"in globalThis&&trustedTypes instanceof EventTarget&&trustedTypes.createPolicy instanceof Function}!P&&(globalThis.cookieStore=j),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("finished")&&Object.defineProperty(Animation.prototype,"finished",{get:function(){return new Promise(((e,t)=>{"finished"===this.playState?e(this):(this.addEventListener("finish",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0}))}))}}),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("ready")&&Object.defineProperty(Animation.prototype,"ready",{get:function(){return new Promise(((e,t)=>{this.pending?(this.addEventListener("ready",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0})):e(this)}))}});
27
+ function R(){return"trustedTypes"in globalThis&&trustedTypes instanceof EventTarget&&trustedTypes.createPolicy instanceof Function}!P&&(globalThis.cookieStore=D),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("finished")&&Object.defineProperty(Animation.prototype,"finished",{get:function(){return new Promise(((e,t)=>{"finished"===this.playState?e(this):(this.addEventListener("finish",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0}))}))}}),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("ready")&&Object.defineProperty(Animation.prototype,"ready",{get:function(){return new Promise(((e,t)=>{this.pending?(this.addEventListener("ready",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0})):e(this)}))}});
28
28
  /**
29
29
  * @copyright 2023 Chris Zuber <admin@kernvalley.us>
30
30
  */
@@ -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 Ae={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 Ce={valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1,customError:!1,valid:!0},Ie=e=>e.hasOwnProperty(Ae.fieldset)&&e[Ae.fieldset]instanceof HTMLFieldSetElement&&e[Ae.fieldset].disabled,De=e=>e instanceof HTMLElement&&e.tagName.includes("-")&&customElements.get(e.tagName.toLowerCase()).formAssociated,je=(e,t)=>function(n){if(n.target.reportValidity()){if(t.willValidate&&n.formData instanceof FormData){const r=t[Ae.value];r instanceof FormData?r.entries().forEach((([e,t])=>n.formData.set(e,t))):e.hasAttribute("name")&&n.formData.set(e.getAttribute("name"),t[Ae.value])}}else n.preventDefault(),n.stopImmediatePropagation(),n.stopPropagation()},Re=(e,t)=>{Object.entries(t).forEach((([t,n])=>e.style.setProperty(t,n)))},He=e=>e.hasAttribute("form")&&document.forms[e.getAttribute("form")]||e.closest("form"),Ue=(e,t,n)=>{if(e instanceof HTMLFormElement){if(!(n instanceof HTMLElement&&n.tagName.includes("-")))throw new TypeError("Not a custom element");if(!(t instanceof Be||t instanceof globalThis.ElementInternals))throw new TypeError("Invalid ElementInternals");if(!De(n))throw new TypeError(`${n.tagName} is not form associated.`);if(!(n.formAssociatedCallback instanceof Function))throw new TypeError(`${n.tagName} is missing a formAssociatedCallback method.`);{const r=new AbortController,o=n.closest("fieldset");o instanceof Element&&(n[Ae.fieldset]=o,o.hasOwnProperty(Ae.customInputs)||(o[Ae.customInputs]=new Set),o[Ae.customInputs].add(n),qe.observe(o,ze)),t[Ae.form]=e,t[Ae.formController]=r;const{checkValidity:i,reportValidity:a}=e;e.reportValidity=function(){return!!a.call(this)&&t.reportValidity()},e.checkValidity=function(){return!!i.call(this)&&t.checkValidity()},r.signal.addEventListener("abort",(()=>{e.reportValidity=a,e.checkValidity=i}),{once:!0}),e.addEventListener("formdata",je(n,t),{signal:r.signal}),e.addEventListener("submit",(e=>{e.target.reportValidity()||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation())}),{signal:r.signal}),n.formResetCallback instanceof Function&&e.addEventListener("reset",(()=>n.formResetCallback()),{signal:r.signal})}}else if(t[Ae.formController]instanceof AbortController&&t[Ae.formController].abort(),t[Ae.form]=null,t[Ae.formController]=null,n.hasOwnProperty(Ae.fieldset)){const e=n[Ae.fieldset];e.hasOwnProperty(Ae.customInputs)&&(e[Ae.customInputs].delete(n),0===e[Ae.customInputs.size]&&delete e[Ae.customInputs]),n[Ae.fieldset]=null}},qe=new MutationObserver((e=>{e.forEach((({target:t,type:n,attributeName:r})=>{if("attributes"===n&&"disabled"===r){const n=t.hasAttribute("disabled");if(De(t)&&t.hasOwnProperty(Ae.internals)&&t[Ae.internals].states.has("--disabled")!==n&&(1===e.length?!Ie(t):t.hasAttribute("disabled")===Ie(t)&&e.some((e=>e.target.isSameNode(t[Ae.fieldset]))))){const e=t[Ae.internals];n?e.states.add("--disabled"):e.states.delete("--disabled"),t.formDisabledCallback instanceof Function&&t.formDisabledCallback(n)}else"FIELDSET"!==t.tagName||!t.hasOwnProperty(Ae.customInputs)||1!==e.length&&e.some((e=>t[Ae.customInputs].has(e.target)))||t[Ae.customInputs].forEach((e=>{e.isConnected&&e.hasOwnProperty(Ae.internals)?e.hasAttribute("disabled")||(n?e[Ae.internals].states.add("--disabled"):e[Ae.internals].states.delete("--disabled"),e.formDisabledCallback instanceof Function&&e.formDisabledCallback(n)):t[Ae.customInputs].delete(e)}))}}))})),ze={attributes:!0,attributeFilter:["disabled"]};class Be{constructor(e,t){if(t!==Ae.key)throw new TypeError("Illegal constructor");if(!(e instanceof HTMLElement))throw new TypeError("Must be called on an HTMLElement");if(!e.tagName.includes("-"))throw new DOMException("Cannot attach internals to a built-in element.");{const t=!0,n=!1,r=!0;Object.defineProperties(this,{[Ae.element]:{value:e,configurable:t,enumerable:n,writable:r},[Ae.form]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.fieldset]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.anchor]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.validity]:{value:Ce,configurable:t,enumerable:n,writable:r},[Ae.validationMessage]:{value:"",configurable:t,enumerable:n,writable:r},[Ae.value]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.state]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.formController]:{value:null,configurable:t,enumerable:n,writable:r}}),De(e)&&qe.observe(e,ze),Object.defineProperty(e,Ae.internals,{value:this,enumerable:!1,configurable:!1,writable:!1}),setTimeout((()=>this.states.add("--element-internals-polyfilled")),10)}}get form(){return this[Ae.form]}get labels(){const e=this.form;return e instanceof HTMLFormElement&&0!==this[Ae.element].id.length?e.querySelectorAll(`label[for="${this[Ae.element].id}"]`):document.createDocumentFragment().childNodes}get _polyfilled(){return!0}get shadowRoot(){return this[Ae.element].shadowRoot}get validity(){return De(this[Ae.element])?this[Ae.validity]:void 0}get validationMessage(){return De(this[Ae.element])?this[Ae.validationMessage]||"":void 0}get willValidate(){const e=this[Ae.element];return De(e)&&!Ie(e)&&!["disabled","readonly"].some((t=>e.hasAttribute(t)))}checkValidity(){if(this.willValidate){if(this.validity.valid){const e=this[Ae.element].nextElementSibling;return e instanceof HTMLElement&&e.classList.contains("_element-internals-popup")&&e.remove(),!0}return this[Ae.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[Ae.element].getBoundingClientRect(),r=document.createElement("div");r.textContent=e,Re(r,{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"}),r.classList.add("_element-internals-popup"),this[Ae.element].focus();const o=this[Ae.element].nextElementSibling;o instanceof Element&&o.classList.contains("_element-internals-popup")&&o.remove(),this[Ae.element].insertAdjacentElement("afterend",r),this[Ae.anchor]instanceof Element&&this[Ae.anchor].focus(),setTimeout((()=>{r.isConnected&&r.remove()}),3e3)}return!1}}setFormValue(e,t){if(!De(this[Ae.element]))throw new DOMException("Not form associated");this[Ae.value]=e,this[Ae.state]=t}setValidity({valueMissing:e=!1,typeMismatch:t=!1,patternMismatch:n=!1,tooLong:r=!1,tooShort:o=!1,rangeUnderflow:i=!1,rangeOverflow:a=!1,stepMismatch:s=!1,badInput:l=!1,customError:c=!1},u="",p){if(!De(this[Ae.element]))throw new DOMException("Not form associated");if(("string"!=typeof u||0===u.length)&&(e||t||n||r||o||i||a||s||l||c))throw new DOMException("Message required if any flags are true.");{const d=[e,t,n,r,o,i,a,s,l,c].every((e=>!1===e));this[Ae.validity]={valueMissing:e,typeMismatch:t,patternMismatch:n,tooLong:r,tooShort:o,rangeUnderflow:i,rangeOverflow:a,stepMismatch:s,badInput:l,customError:c,valid:d},this[Ae.validationMessage]=u,this[Ae.anchor]=p,d?(this.states.delete("--invalid"),this.states.add("--valid")):(this.states.add("--invalid"),this.states.delete("--valid"),this[Ae.element].dispatchEvent(new Event("invalid")))}}_associateForm(e,t){Ue(e,this,t)}_findAssociatedForm(e){return He(e)}}HTMLElement.prototype.attachInternals=function(){if(this.hasOwnProperty(Ae.internals))throw new DOMException("Invalid operation");if(this.tagName.includes("-"))return new Be(this,Ae.key);throw new DOMException("Cannot call attachInternals on built-in elements.")},globalThis.ElementInternals=Be}if("ElementInternals"in globalThis&&!("CustomStateSet"in globalThis)){const $e="_state",_e=new WeakMap,Ve=e=>{if(e.toString().startsWith("--"))return`${$e}${e}`;throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value '${e}' must start with '--'.`)},{value:We,writable:Ge,configurable:Ke,enumerable:Qe}=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"attachInternals");class Je{constructor(e,t){if(t!==Ae.key)throw new TypeError("Illegal Constructor");if(!(e instanceof HTMLElement))throw new TypeError("el must be an HTMLElement");_e.set(this,e),this.add("--custom-states-polyfilled")}get _polyfilled(){return!0}get size(){return[...this.values()].length}add(e){_e.get(this).classList.add(Ve(e))}has(e){return _e.get(this).classList.contains(Ve(e))}delete(e){const t=Ve(e);return!!_e.get(this).classList.contains(t)&&(_e.get(this).classList.remove(t),!0)}clear(){this.values().forEach((e=>this.delete(e)))}keys(){return this.values()}values(){return _e.get(this).classList.values().filter((e=>e.startsWith(`${$e}--`))).map((e=>e.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=We.call(this);return Object.defineProperty(e,Ae.element,{value:this,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(e,"states",{value:new Je(this,Ae.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:Ge,configurable:Ke,enumerable:Qe}),globalThis.CustomStateSet=Je,function(e){const t=Object.fromEntries(Object.keys(ge).map((e=>[e,{get:function(){return this[Ae.element][e]},set:function(t){this[Ae.element][e]=t},enumerable:!0,configurable:!0}])));Object.defineProperties(e,t)}(ElementInternals.prototype)}if(e(Response,"json",((e,{status:t=200,statusText:n="",headers:r=new Headers}={})=>r instanceof Headers?(r.set("Content-Type","application/json"),new Response(JSON.stringify(e),{status:t,statusText:n,headers:r})):Response.json(e,{status:t,statusText:n,headers:new Headers(r)}))),e(Response,"redirect",((e,t=302)=>new Response("",{status:t,headers:new Headers({Location:e})}))),!(globalThis.Record instanceof Function)){function Xe(e){const t=Object.create(Xe.prototype);return Object.defineProperties(t,Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{enumerable:!0,configurable:!1,writable:!1,value:t}])))),Object.freeze(t),t}Xe.prototype={constructor:Xe},Xe.fromEntries=function(e){return new Xe(Object.fromEntries(e))},globalThis.Record=Xe}if(!(globalThis.Tuple instanceof Function)){function Ze(...e){const t=Array.apply(Object.create(Ze.prototype),e);return Object.setPrototypeOf(t,Ze.prototype),Object.freeze(t),t}Ze.prototype.forEach=function(){Array.prototype.forEach.apply(this,arguments)},Ze.prototype.join=function(){return Array.prototype.join.apply(this,arguments)},Ze.prototype.indexOf=function(){return Array.prototype.indexOf.apply(this,arguments)},Ze.prototype.lastIndexOf=function(){return Array.prototype.lastIndexOf.apply(this,arguments)},Ze.prototype.findIndex=function(){return Array.prototype.findIndex.apply(this,arguments)},Ze.prototype.find=function(){return Array.prototype.find.apply(this,arguments)},Ze.prototype.findLast=function(){return Array.prototype.findLast.apply(this,arguments)},Ze.prototype.findLastIndex=function(){return Array.prototype.findLastIndex.apply(this,arguments)},Ze.prototype.every=function(){return Array.prototype.every.apply(this,arguments)},Ze.prototype.some=function(){return Array.prototype.some.apply(this,arguments)},Ze.prototype.includes=function(){return Array.prototype.includes.apply(this,arguments)},Ze.prototype.map=function(){return Ze.from(Array.prototype.map.apply(this,arguments))},Ze.prototype.filter=function(){return Ze.from(Array.prototype.filter.apply(this,arguments))},Ze.prototype.flat=function(){return Ze.from(Array.prototype.flat.apply(this,arguments))},Ze.prototype.flatMap=function(){return Ze.from(Array.prototype.flatMap.apply(this,arguments))},Ze.prototype.at=function(){return Array.prototype.at.apply(this,arguments)},Ze.prototype.reduce=function(){return Ze.from(Array.prototype.reduce.apply(this,arguments))},Ze.prototype.reduceRight=function(){return Ze.from(Array.prototype.reduceRight.apply(this,arguments))},Ze.prototype.toSorted=function(){return Ze.from(Array.prototype.toSorted.apply(this,arguments))},Ze.prototype.toSpliced=function(){return Ze.from(Array.prototype.toSpliced.apply(this,arguments))},Ze.prototype.toReversed=function(){return Ze.from(Array.prototype.toReversed.apply(this,arguments))},Ze.prototype.toJSON=function(){return[...this]},Ze.prototype.keys=function(){return Array.prototype.keys.apply(this)},Ze.prototype.values=function(){return Array.prototype.values.apply(this)},Ze.prototype.entries=function(){return Array.prototype.entries.apply(this)},Ze.prototype[Symbol.iterator]=function(){return Array.prototype[Symbol.iterator].apply(this)},Ze.from=function(e){return Ze(...e)},Object.defineProperties(Ze.prototype,{length:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"length").get.apply(this)},enumerable:!0,configurable:!1},lastItem:{get:function(){return this[this.lastIndex]},enumerable:!0,configurable:!1},lastIndex:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"lastIndex").get.apply(this)},enumerable:!0,configurable:!1}}),globalThis.Tuple=Ze}if(!(JSON.parseImmutable instanceof Function)){function Ye(e){return"object"==typeof e?null===e?null:Array.isArray(e)?Tuple.from(e.map((e=>Ye(e)))):Record.fromEntries(Object.entries(e).map((([e,t])=>[e,Ye(t)]))):e}JSON.parseImmutable=function(e){return JSON.parse(e,((e,t)=>Ye(t)))}}}();
65
+ */;const Ae={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 Ce={valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1,customError:!1,valid:!0},Ie=e=>e.hasOwnProperty(Ae.fieldset)&&e[Ae.fieldset]instanceof HTMLFieldSetElement&&e[Ae.fieldset].disabled,je=e=>e instanceof HTMLElement&&e.tagName.includes("-")&&customElements.get(e.tagName.toLowerCase()).formAssociated,De=(e,t)=>function(n){if(n.target.reportValidity()){if(t.willValidate&&n.formData instanceof FormData){const r=t[Ae.value];r instanceof FormData?r.entries().forEach((([e,t])=>n.formData.set(e,t))):e.hasAttribute("name")&&n.formData.set(e.getAttribute("name"),t[Ae.value])}}else n.preventDefault(),n.stopImmediatePropagation(),n.stopPropagation()},Re=(e,t)=>{Object.entries(t).forEach((([t,n])=>e.style.setProperty(t,n)))},He=e=>e.hasAttribute("form")&&document.forms[e.getAttribute("form")]||e.closest("form"),Ue=(e,t,n)=>{if(e instanceof HTMLFormElement){if(!(n instanceof HTMLElement&&n.tagName.includes("-")))throw new TypeError("Not a custom element");if(!(t instanceof Be||t instanceof globalThis.ElementInternals))throw new TypeError("Invalid ElementInternals");if(!je(n))throw new TypeError(`${n.tagName} is not form associated.`);if(!(n.formAssociatedCallback instanceof Function))throw new TypeError(`${n.tagName} is missing a formAssociatedCallback method.`);{const r=new AbortController,o=n.closest("fieldset");o instanceof Element&&(n[Ae.fieldset]=o,o.hasOwnProperty(Ae.customInputs)||(o[Ae.customInputs]=new Set),o[Ae.customInputs].add(n),qe.observe(o,ze)),t[Ae.form]=e,t[Ae.formController]=r;const{checkValidity:i,reportValidity:a}=e;e.reportValidity=function(){return!!a.call(this)&&t.reportValidity()},e.checkValidity=function(){return!!i.call(this)&&t.checkValidity()},r.signal.addEventListener("abort",(()=>{e.reportValidity=a,e.checkValidity=i}),{once:!0}),e.addEventListener("formdata",De(n,t),{signal:r.signal}),e.addEventListener("submit",(e=>{e.target.reportValidity()||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation())}),{signal:r.signal}),n.formResetCallback instanceof Function&&e.addEventListener("reset",(()=>n.formResetCallback()),{signal:r.signal})}}else if(t[Ae.formController]instanceof AbortController&&t[Ae.formController].abort(),t[Ae.form]=null,t[Ae.formController]=null,n.hasOwnProperty(Ae.fieldset)){const e=n[Ae.fieldset];e.hasOwnProperty(Ae.customInputs)&&(e[Ae.customInputs].delete(n),0===e[Ae.customInputs.size]&&delete e[Ae.customInputs]),n[Ae.fieldset]=null}},qe=new MutationObserver((e=>{e.forEach((({target:t,type:n,attributeName:r})=>{if("attributes"===n&&"disabled"===r){const n=t.hasAttribute("disabled");if(je(t)&&t.hasOwnProperty(Ae.internals)&&t[Ae.internals].states.has("--disabled")!==n&&(1===e.length?!Ie(t):t.hasAttribute("disabled")===Ie(t)&&e.some((e=>e.target.isSameNode(t[Ae.fieldset]))))){const e=t[Ae.internals];n?e.states.add("--disabled"):e.states.delete("--disabled"),t.formDisabledCallback instanceof Function&&t.formDisabledCallback(n)}else"FIELDSET"!==t.tagName||!t.hasOwnProperty(Ae.customInputs)||1!==e.length&&e.some((e=>t[Ae.customInputs].has(e.target)))||t[Ae.customInputs].forEach((e=>{e.isConnected&&e.hasOwnProperty(Ae.internals)?e.hasAttribute("disabled")||(n?e[Ae.internals].states.add("--disabled"):e[Ae.internals].states.delete("--disabled"),e.formDisabledCallback instanceof Function&&e.formDisabledCallback(n)):t[Ae.customInputs].delete(e)}))}}))})),ze={attributes:!0,attributeFilter:["disabled"]};class Be{constructor(e,t){if(t!==Ae.key)throw new TypeError("Illegal constructor");if(!(e instanceof HTMLElement))throw new TypeError("Must be called on an HTMLElement");if(!e.tagName.includes("-"))throw new DOMException("Cannot attach internals to a built-in element.");{const t=!0,n=!1,r=!0;Object.defineProperties(this,{[Ae.element]:{value:e,configurable:t,enumerable:n,writable:r},[Ae.form]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.fieldset]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.anchor]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.validity]:{value:Ce,configurable:t,enumerable:n,writable:r},[Ae.validationMessage]:{value:"",configurable:t,enumerable:n,writable:r},[Ae.value]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.state]:{value:null,configurable:t,enumerable:n,writable:r},[Ae.formController]:{value:null,configurable:t,enumerable:n,writable:r}}),je(e)&&qe.observe(e,ze),Object.defineProperty(e,Ae.internals,{value:this,enumerable:!1,configurable:!1,writable:!1}),setTimeout((()=>this.states.add("--element-internals-polyfilled")),10)}}get form(){return this[Ae.form]}get labels(){const e=this.form;return e instanceof HTMLFormElement&&0!==this[Ae.element].id.length?e.querySelectorAll(`label[for="${this[Ae.element].id}"]`):document.createDocumentFragment().childNodes}get _polyfilled(){return!0}get shadowRoot(){return this[Ae.element].shadowRoot}get validity(){return je(this[Ae.element])?this[Ae.validity]:void 0}get validationMessage(){return je(this[Ae.element])?this[Ae.validationMessage]||"":void 0}get willValidate(){const e=this[Ae.element];return je(e)&&!Ie(e)&&!["disabled","readonly"].some((t=>e.hasAttribute(t)))}checkValidity(){if(this.willValidate){if(this.validity.valid){const e=this[Ae.element].nextElementSibling;return e instanceof HTMLElement&&e.classList.contains("_element-internals-popup")&&e.remove(),!0}return this[Ae.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[Ae.element].getBoundingClientRect(),r=document.createElement("div");r.textContent=e,Re(r,{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"}),r.classList.add("_element-internals-popup"),this[Ae.element].focus();const o=this[Ae.element].nextElementSibling;o instanceof Element&&o.classList.contains("_element-internals-popup")&&o.remove(),this[Ae.element].insertAdjacentElement("afterend",r),this[Ae.anchor]instanceof Element&&this[Ae.anchor].focus(),setTimeout((()=>{r.isConnected&&r.remove()}),3e3)}return!1}}setFormValue(e,t){if(!je(this[Ae.element]))throw new DOMException("Not form associated");this[Ae.value]=e,this[Ae.state]=t}setValidity({valueMissing:e=!1,typeMismatch:t=!1,patternMismatch:n=!1,tooLong:r=!1,tooShort:o=!1,rangeUnderflow:i=!1,rangeOverflow:a=!1,stepMismatch:s=!1,badInput:l=!1,customError:c=!1},u="",p){if(!je(this[Ae.element]))throw new DOMException("Not form associated");if(("string"!=typeof u||0===u.length)&&(e||t||n||r||o||i||a||s||l||c))throw new DOMException("Message required if any flags are true.");{const d=[e,t,n,r,o,i,a,s,l,c].every((e=>!1===e));this[Ae.validity]={valueMissing:e,typeMismatch:t,patternMismatch:n,tooLong:r,tooShort:o,rangeUnderflow:i,rangeOverflow:a,stepMismatch:s,badInput:l,customError:c,valid:d},this[Ae.validationMessage]=u,this[Ae.anchor]=p,d?(this.states.delete("--invalid"),this.states.add("--valid")):(this.states.add("--invalid"),this.states.delete("--valid"),this[Ae.element].dispatchEvent(new Event("invalid")))}}_associateForm(e,t){Ue(e,this,t)}_findAssociatedForm(e){return He(e)}}HTMLElement.prototype.attachInternals=function(){if(this.hasOwnProperty(Ae.internals))throw new DOMException("Invalid operation");if(this.tagName.includes("-"))return new Be(this,Ae.key);throw new DOMException("Cannot call attachInternals on built-in elements.")},globalThis.ElementInternals=Be}if("ElementInternals"in globalThis&&!("CustomStateSet"in globalThis)){const $e="_state",_e=new WeakMap,Ve=e=>{if(e.toString().startsWith("--"))return`${$e}${e}`;throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value '${e}' must start with '--'.`)},{value:We,writable:Ge,configurable:Ke,enumerable:Qe}=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"attachInternals");class Je{constructor(e,t){if(t!==Ae.key)throw new TypeError("Illegal Constructor");if(!(e instanceof HTMLElement))throw new TypeError("el must be an HTMLElement");_e.set(this,e),this.add("--custom-states-polyfilled")}get _polyfilled(){return!0}get size(){return[...this.values()].length}add(e){_e.get(this).classList.add(Ve(e))}has(e){return _e.get(this).classList.contains(Ve(e))}delete(e){const t=Ve(e);return!!_e.get(this).classList.contains(t)&&(_e.get(this).classList.remove(t),!0)}clear(){this.values().forEach((e=>this.delete(e)))}keys(){return this.values()}values(){return _e.get(this).classList.values().filter((e=>e.startsWith(`${$e}--`))).map((e=>e.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=We.call(this);return Object.defineProperty(e,Ae.element,{value:this,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(e,"states",{value:new Je(this,Ae.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:Ge,configurable:Ke,enumerable:Qe}),globalThis.CustomStateSet=Je,function(e){const t=Object.fromEntries(Object.keys(ge).map((e=>[e,{get:function(){return this[Ae.element][e]},set:function(t){this[Ae.element][e]=t},enumerable:!0,configurable:!0}])));Object.defineProperties(e,t)}(ElementInternals.prototype)}if(e(Response,"json",((e,{status:t=200,statusText:n="",headers:r=new Headers}={})=>r instanceof Headers?(r.set("Content-Type","application/json"),new Response(JSON.stringify(e),{status:t,statusText:n,headers:r})):Response.json(e,{status:t,statusText:n,headers:new Headers(r)}))),e(Response,"redirect",((e,t=302)=>new Response("",{status:t,headers:new Headers({Location:e})}))),!(globalThis.Record instanceof Function)){function Xe(e){if(new.target===Xe)throw new TypeError("Record is not a constructor");const t=Object.create(Xe.prototype);return Object.defineProperties(t,Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{enumerable:!0,configurable:!1,writable:!1,value:t}])))),Object.freeze(t),t}Xe.prototype.constructor=Xe,Object.defineProperty(Xe.prototype,Symbol.toStringTag,{value:"Record",enumerable:!0,configurable:!1,writable:!1}),Xe.fromEntries=function(e){return Xe(Object.fromEntries(e))},globalThis.Record=Xe}if(!(globalThis.Tuple instanceof Function)){const Ze=e=>{const t=Array.apply(Object.create(Ye.prototype),e);return Object.setPrototypeOf(t,Ye.prototype),t};function Ye(...e){if(new.target===Ye)throw new TypeError("Tuple is not a constructor");const t=Ze(e);return Object.freeze(t),t}Ye.prototype.forEach=function(e,t){Array.prototype.forEach.call(this,e,t)},Ye.prototype.join=function(e=","){return Array.prototype.join.call(this,e)},Ye.prototype.concat=function(...e){return Ye(...this,...e)},Ye.prototype.slice=function(e,t){return Ye.from(Array.prototype.slice.call(this,e,t))},Ye.prototype.indexOf=function(e,t){return Array.prototype.indexOf.call(this,e,t)},Ye.prototype.lastIndexOf=function(e,t){return Array.prototype.lastIndexOf.call(this,e,t)},Ye.prototype.findIndex=function(e,t){return Array.prototype.findIndex.call(this,e,t)},Ye.prototype.find=function(e,t){return Array.prototype.find.call(this,e,t)},Ye.prototype.findLast=function(e,t){return Array.prototype.findLast.call(this,e,t)},Ye.prototype.findLastIndex=function(e,t){return Array.prototype.findLastIndex.call(this,e,t)},Ye.prototype.every=function(e,t){return Array.prototype.every.call(this,e,t)},Ye.prototype.some=function(e,t){return Array.prototype.some.call(this,e,t)},Ye.prototype.includes=function(e,t){return Array.prototype.includes.call(this,e,t)},Ye.prototype.map=function(e,t){return Ye.from(Array.prototype.map.call(this,e,t))},Ye.prototype.filter=function(e,t){return Ye.from(Array.prototype.filter.call(this,e,t))},Ye.prototype.flat=function(e){return Ye.from(Array.prototype.flat.call(this,e))},Ye.prototype.flatMap=function(e,t){return Ye.from(Array.prototype.flatMap.call(this,e,t))},Ye.prototype.at=function(e){return Array.prototype.at.call(this,e)},Ye.prototype.reduce=function(e,t){return Ye.from(Array.prototype.reduce.call(this,e,t))},Ye.prototype.reduceRight=function(e,t){return Ye.from(Array.prototype.reduceRight.call(this,e,t))},Ye.prototype.toSorted=function(e){return Ye.from(Array.prototype.toSorted.call(this,e))},Ye.prototype.toSpliced=function(e,t,...n){return Ye.from(Array.prototype.toSpliced.call(this,e,t,...n))},Ye.prototype.toReversed=function(){return Ye.from(Array.prototype.toReversed.apply(this))},Ye.prototype.with=function(e,t){return Ye.from(Array.prototype.with.call(this,e,t))},Ye.prototype.toLocaleString=function(e,t){return Array.prototype.toLocaleString.call(this,e,t)},Ye.prototype.toJSON=function(){return[...this]},Ye.prototype.keys=function(){return Array.prototype.keys.apply(this)},Ye.prototype.values=function(){return Array.prototype.values.apply(this)},Ye.prototype.entries=function(){return Array.prototype.entries.apply(this)},Ye.prototype[Symbol.iterator]=function(){return Array.prototype[Symbol.iterator].apply(this)},Ye.from=function(e,t,n){const r=Ze([]);return Array.prototype.push.apply(r,Array.from(e,t,n)),Object.freeze(r),r},Ye.of=function(...e){return Ye.from(e)},Object.defineProperties(Ye.prototype,{length:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"length").get.apply(this)},enumerable:!0,configurable:!1},lastItem:{get:function(){return this[this.lastIndex]},enumerable:!0,configurable:!1},lastIndex:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"lastIndex").get.apply(this)},enumerable:!0,configurable:!1},[Symbol.toStringTag]:{value:"Tuple",enumerable:!0,configurable:!1,writable:!1}}),globalThis.Tuple=Ye}if(!(JSON.parseImmutable instanceof Function)){function et(e){return"object"==typeof e?null===e?null:Array.isArray(e)?Tuple.from(e.map((e=>et(e)))):Record.fromEntries(Object.entries(e).map((([e,t])=>[e,et(t)]))):e}JSON.parseImmutable=function(e){return JSON.parse(e,((e,t)=>et(t)))}}}();
66
66
  //# sourceMappingURL=all.min.js.map