smoothly 0.3.59 → 0.3.61
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/dist/cjs/{Listenable-fcea5136.js → Listenable-e157f34c.js} +6 -5
- package/dist/cjs/{index-8352a4e0.js → index-48630c3c.js} +3 -0
- package/dist/cjs/{index-679a68de.js → index-5c256daf.js} +1 -1
- package/dist/cjs/index.cjs.js +11 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/smoothly-accordion_53.cjs.entry.js +16 -13
- package/dist/cjs/smoothly-country.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-reorder.cjs.entry.js +4 -4
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +2 -2
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/components/menu-options/index.js +12 -4
- package/dist/collection/components/picker/index.js +1 -6
- package/dist/collection/index.js +1 -1
- package/dist/collection/model/Listenable.js +6 -5
- package/dist/collection/model/StateBase.js +7 -0
- package/dist/collection/model/index.js +1 -0
- package/dist/custom-elements/index.js +27 -16
- package/dist/esm/{Listenable-10f48463.js → Listenable-afd6cd7e.js} +6 -5
- package/dist/esm/{index-990cc22d.js → index-62de77e7.js} +1 -1
- package/dist/esm/{index-7b57a52c.js → index-e9e4cadb.js} +3 -1
- package/dist/esm/index.js +12 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/smoothly-accordion_53.entry.js +16 -13
- package/dist/esm/smoothly-country.entry.js +1 -1
- package/dist/esm/smoothly-google-font.entry.js +1 -1
- package/dist/esm/smoothly-radio-group.entry.js +1 -1
- package/dist/esm/smoothly-reorder.entry.js +2 -2
- package/dist/esm/smoothly-trigger-sink.entry.js +2 -2
- package/dist/esm/smoothly-trigger-source.entry.js +2 -2
- package/dist/esm/smoothly.js +2 -2
- package/dist/smoothly/index.esm.js +1 -1
- package/dist/smoothly/{p-bb57ff51.js → p-05154935.js} +1 -1
- package/dist/smoothly/{p-f0aa4247.entry.js → p-46dcb025.entry.js} +1 -1
- package/dist/smoothly/p-4f3b0e6d.entry.js +1 -0
- package/dist/smoothly/{p-43eb7034.entry.js → p-6e017bc2.entry.js} +1 -1
- package/dist/smoothly/{p-675a8d09.js → p-73bcae40.js} +1 -1
- package/dist/smoothly/{p-0ed63b7b.entry.js → p-b3d699d2.entry.js} +1 -1
- package/dist/smoothly/{p-a19a824a.entry.js → p-cab954af.entry.js} +1 -1
- package/dist/smoothly/{p-ab11639c.entry.js → p-ccd08c26.entry.js} +1 -1
- package/dist/smoothly/{p-c88ae468.js → p-e5d867e5.js} +2 -2
- package/dist/smoothly/{p-5fb08944.entry.js → p-fe4520be.entry.js} +1 -1
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/menu-options/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model/Listenable.d.ts +10 -3
- package/dist/types/model/StateBase.d.ts +6 -0
- package/dist/types/model/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/smoothly/p-607abd83.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h, a as getElement, c as createEvent, H as Host } from './index-
|
|
2
|
-
import { r as redirect, A as App, N as Notice } from './index-
|
|
3
|
-
import { T as Trigger, M as Message, a as Icon } from './Listenable-
|
|
1
|
+
import { r as registerInstance, h, a as getElement, c as createEvent, H as Host } from './index-e9e4cadb.js';
|
|
2
|
+
import { r as redirect, A as App, N as Notice } from './index-62de77e7.js';
|
|
3
|
+
import { T as Trigger, M as Message, a as Icon } from './Listenable-afd6cd7e.js';
|
|
4
4
|
import './GoogleFont-8474516b.js';
|
|
5
5
|
import { D as Date$1, L as Language, g as getLanguage, a as DateTime, C as Currency, b as Locale, c as DateRange } from './getLanguage-225b37b0.js';
|
|
6
6
|
|
|
@@ -3078,14 +3078,22 @@ const SmoothlyMenuOptions = class {
|
|
|
3078
3078
|
this.keyword = keyword;
|
|
3079
3079
|
const keywordLowercase = keyword.toLowerCase();
|
|
3080
3080
|
this.filteredOptions = [];
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3081
|
+
if (keywordLowercase == "") {
|
|
3082
|
+
this.showAllOptions();
|
|
3083
|
+
}
|
|
3084
|
+
else {
|
|
3085
|
+
for (const option of this.options) {
|
|
3086
|
+
const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
|
|
3087
|
+
const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
|
|
3088
|
+
isVisible && this.filteredOptions.push(option);
|
|
3089
|
+
}
|
|
3085
3090
|
}
|
|
3086
3091
|
this.menuEmpty.emit(!this.filteredOptions.length);
|
|
3087
3092
|
this.order && this.sortOptions(keyword);
|
|
3088
3093
|
}
|
|
3094
|
+
showAllOptions() {
|
|
3095
|
+
this.filteredOptions = [...this.options];
|
|
3096
|
+
}
|
|
3089
3097
|
sortOptions(keyword) {
|
|
3090
3098
|
const keywordLowercase = keyword.toLowerCase();
|
|
3091
3099
|
this.filteredOptions.sort((a, b) => {
|
|
@@ -3347,8 +3355,6 @@ const SmoothlyPicker = class {
|
|
|
3347
3355
|
const isNewSelection = this.selections.reduce((acc, current) => acc && current.value != selection.value, true);
|
|
3348
3356
|
if (isNewSelection)
|
|
3349
3357
|
this.selections = this.multiple ? [...this.selections, selection] : [selection];
|
|
3350
|
-
this.inputElement.value = "";
|
|
3351
|
-
this.filterOptions();
|
|
3352
3358
|
this.keepFocusOnReRender = true;
|
|
3353
3359
|
this.isOpen = this.multiple;
|
|
3354
3360
|
}
|
|
@@ -3392,7 +3398,6 @@ const SmoothlyPicker = class {
|
|
|
3392
3398
|
else if (event.key == "Escape") {
|
|
3393
3399
|
this.inputElement.value = "";
|
|
3394
3400
|
this.isOpen = false;
|
|
3395
|
-
this.filterOptions();
|
|
3396
3401
|
}
|
|
3397
3402
|
else if (event.key == " " && this.inputElement.value == "") {
|
|
3398
3403
|
event.preventDefault();
|
|
@@ -3405,13 +3410,11 @@ const SmoothlyPicker = class {
|
|
|
3405
3410
|
this.isOpen = !this.isOpen;
|
|
3406
3411
|
this.inputElement.focus();
|
|
3407
3412
|
this.highlightDefault();
|
|
3408
|
-
this.filterOptions();
|
|
3409
3413
|
}
|
|
3410
3414
|
}
|
|
3411
3415
|
onBlur() {
|
|
3412
3416
|
this.inputElement.value = "";
|
|
3413
3417
|
this.isOpen = false;
|
|
3414
|
-
this.filterOptions();
|
|
3415
3418
|
}
|
|
3416
3419
|
render() {
|
|
3417
3420
|
var _a, _b, _c;
|
|
@@ -3438,7 +3441,7 @@ const SmoothlyPicker = class {
|
|
|
3438
3441
|
: []),
|
|
3439
3442
|
...((_c = this.options) !== null && _c !== void 0 ? _c : []),
|
|
3440
3443
|
];
|
|
3441
|
-
return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), h("label", { part: "label-element" }, this.label), h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement),
|
|
3444
|
+
return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), h("label", { part: "label-element" }, this.label), h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
|
|
3442
3445
|
? this.selections.length.toString() + " " + this.selectionName
|
|
3443
3446
|
: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }), h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })), h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, toggle: true, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
|
|
3444
3447
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, a as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, a as getElement } from './index-e9e4cadb.js';
|
|
2
2
|
import { A as Alpha2, g as getLanguage } from './getLanguage-225b37b0.js';
|
|
3
3
|
|
|
4
4
|
function from$K(country) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-e9e4cadb.js';
|
|
2
2
|
|
|
3
3
|
const styleCss = "smoothly-radio-group{display:flex;position:relative;color:none !important;background:none !important;margin:0.5em 0}smoothly-radio-group[hidden]{display:none}smoothly-radio-group[orientation=vertical] *:not(:first-of-type)>input[type=radio]~label{border-top:none}smoothly-radio-group:not([orientation=vertical]) *:not(:first-of-type)>input[type=radio]~label{border-left:none}smoothly-radio-group[orientation=vertical]{flex-direction:column}smoothly-radio-group[orientation=vertical] :first-of-type>input[type=radio]~label{border-radius:4px 4px 0 0}smoothly-radio-group[orientation=vertical] :last-of-type>input[type=radio]~label{border-radius:0 0 4px 4px}smoothly-radio-group:not([orientation=vertical]){flex-direction:row}smoothly-radio-group:not([orientation=vertical]) :first-of-type>input[type=radio]~label{border-radius:4px 0 0 4px}smoothly-radio-group:not([orientation=vertical]) :last-of-type>input[type=radio]~label{border-radius:0 4px 4px 0}";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, a as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, d as H, a as getElement } from './index-e9e4cadb.js';
|
|
2
2
|
|
|
3
3
|
const styleCss = "smoothly-reorder>*{cursor:move;transition:transform 0.3s}smoothly-reorder>*.dragging{transition:none;box-shadow:0 0 10px rgba(var(--smoothly-dark-color));z-index:1;user-select:none}";
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ const SmoothlyReorder = class {
|
|
|
14
14
|
else {
|
|
15
15
|
for (let index = 0; index < this.element.children.length; index++) {
|
|
16
16
|
const element = this.element.children[index];
|
|
17
|
-
if (element instanceof
|
|
17
|
+
if (element instanceof H) {
|
|
18
18
|
const bounds = element.getBoundingClientRect();
|
|
19
19
|
result.push({
|
|
20
20
|
top: bounds.top,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import { T as Trigger, M as Message } from './Listenable-
|
|
1
|
+
import { r as registerInstance, h } from './index-e9e4cadb.js';
|
|
2
|
+
import { T as Trigger, M as Message } from './Listenable-afd6cd7e.js';
|
|
3
3
|
import './GoogleFont-8474516b.js';
|
|
4
4
|
|
|
5
5
|
const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-
|
|
2
|
-
import { M as Message, T as Trigger } from './Listenable-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-e9e4cadb.js';
|
|
2
|
+
import { M as Message, T as Trigger } from './Listenable-afd6cd7e.js';
|
|
3
3
|
import './GoogleFont-8474516b.js';
|
|
4
4
|
|
|
5
5
|
const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
|
package/dist/esm/smoothly.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-e9e4cadb.js';
|
|
2
|
+
export { s as setNonce } from './index-e9e4cadb.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as App,C as Cosmetic,N as Notice,r as redirect}from"./p-
|
|
1
|
+
export{A as App,C as Cosmetic,N as Notice,r as redirect}from"./p-73bcae40.js";import{I as e,L as s}from"./p-05154935.js";export{a as Icon,L as Listenable,M as Message,T as Trigger}from"./p-05154935.js";export{G as GoogleFont}from"./p-bd478a53.js";import"./p-e5d867e5.js";class t{constructor(){}static get value(){return t.valueCache=localStorage.getItem("clientIdentifier")||void 0,t.valueCache||(t.valueCache=e.generate(12),localStorage.setItem("clientIdentifier",t.valueCache)),t.valueCache}}class o{constructor(...e){this.listenable=new s,this.client=1==e.length?e[0]:void 0}}export{t as ClientIdentifier,o as StateBase}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class t{constructor(){this.encoding="utf-8"}encode(t){return Uint8Array.from(unescape(encodeURIComponent(t)).split(""),(t=>t.charCodeAt(0)))}}const n={standard:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",url:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",ordered:"-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",reversed:"zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-"};function e(e,r="standard",i=""){let s;const a=t=>"ordered"==r||"reversed"==r?t.reverse():t;switch(typeof e){case"string":s=(new t).encode(e);break;case"number":s=a(new Uint8Array(new BigUint64Array([BigInt(e)]).buffer));break;case"bigint":s=a(new Uint8Array(new BigUint64Array([e]).buffer));break;default:s=e instanceof Uint8Array?e:new Uint8Array(e)}const o=n[r],c=[];for(let t=0;t<s.length;t+=3){const n=s[t],e=t+1<s.length?s[t+1]:0,r=t+2<s.length?s[t+2]:0;c.push(o[n>>>2]),c.push(o[(3&n)<<4|e>>>4]),c.push(o[(15&e)<<2|r>>>6]),c.push(o[63&r])}const u=Math.ceil(s.length/3*4);return c.join("").substring(0,u)+i.repeat(c.length-u)}function r(t,e="standard"){for(;t.endsWith("=")&&t.length>0;)t=t.substring(0,t.length-1);const r=n[e],i=[...t].map((t=>r.indexOf(t))),s=new Uint8Array(Math.floor(i.length/4*3));for(let t=0;t<s.length;t+=3){const n=i.shift()||0,e=i.shift()||0,r=i.shift()||0,a=i.shift()||0;s[t]=n<<2|e>>>4,s[t+1]=(15&e)<<4|r>>>2,s[t+2]=(3&r)<<6|a}return"ordered"==e||"reversed"==e?s.reverse():s}function i(t,e=1,r="standard"){const a=n[r],o=t.length>1?t.substring(0,t.length-1):e>0?"":a[63],c=(0==t.length?0:a.indexOf(t[t.length-1]))+e;return(c>63||c<0?i(o,Math.floor(c/63),r):o)+a[s(c,64)]}function s(t,n){return t>=0?t%n:s(t+n,n)}const a="undefined"!=typeof window?window.crypto||window.msCrypto:self.crypto||self.msCrypto;var o,c,u,f,S,y,l,w,p,A,h,d,b,g,v,H;!function(t){t.create=function(t,n,...e){const[r,...i]=(s=e,Array.isArray(s)&&s.length>0&&"string"==typeof s[0]?e.map((t=>Object.fromEntries(t.split(",").map((t=>t.split(":",2).map((t=>t.trim()))))))):e);var s;const a=Object.assign({},...Object.entries(r).map((([t,n])=>[t,[n,...i.map((n=>n[t])).filter((t=>t))]])).map((([n,e])=>({get[n](){return Object.assign(t(e),{name:n})}}))));return{current:a[n],...a}}}(o||(o={})),function(t){t.is=function(t){return"object"==typeof t&&(null==t.key||"string"==typeof t.key)&&"string"==typeof t.value&&"string"==typeof t.salt},t.stringify=function(t){return t.key=t.key&&4!=t.key.length?t.key.slice(-2):t.key,[t.key,t.salt,t.value].join(".")},t.parse=function(n){const e=n.split("."),r={key:e[0],salt:e[1],value:e[2]};return t.is(r)?r:void 0}}(c||(c={})),function(t){function n(t,n="url"){return e(t,n)}function s(t){t.length%2==1&&(t+="0");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++)e[n]=16*Number.parseInt(t[2*n],16)+Number.parseInt(t[2*n+1],16);return n(e)}function o(t,n){const e=r(t,"url");let i=[];for(const t of e)i.push(Math.floor(t/16).toString(16),(t%16).toString(16));return n&&(i=i.slice(0,n)),i.join("")}function c(t,n=1){const e=i(t,n,"ordered");return e.length==t.length?e:e.substring(e.length-t.length)}t.is=function(t,n){return"string"==typeof t&&(null==n||t.length==n)&&Array.from(t).every((t=>t>="0"&&t<="9"||t>="A"&&t<="Z"||t>="a"&&t<="z"||"-"==t||"_"==t))},t.fromUint24=function(t){return s(t.toString(16).padStart(6,"0"))},t.toUint24=function(t){return Number.parseInt(o(t,6),16)},t.fromUint48=function(t){return s(t.toString(16).padStart(12,"0"))},t.toUint48=function(t){return Number.parseInt(o(t,12),16)},t.fromBinary=n,t.toBinary=function(t){return r(t,"url")},t.generate=function(t,r,i){let s;return(i||0==i||""==i)&&(s=e(i,r).substring(0,t)),(null!=s?s:"")+n(a.getRandomValues(new Uint8Array(t/4*3)),r).substring(0,t-(s?s.length:0))},t.fromHexadecimal=s,t.toHexadecimal=o,t.min=function(t){return"".padStart(t,"-")},t.max=function(t){return"".padStart(t,"z")},t.next=c,t.previous=function(t,n=1){return c(t,-n)},t.length=[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128],(t.Length||(t.Length={})).is=function(t){return"number"==typeof t&&t>=4&&t<=128&&(252&t)==t}}(u||(u={})),function(t){t.is=function(t){return"string"==typeof t||"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt},t.hash=async function(t,n,r){return r||(r=e(a.getRandomValues(new Uint8Array(64)))),{hash:await t.sign(r+n),salt:r}},t.verify=async function(n,e,r){return(await t.hash(n,r,e.salt)).hash==e.hash},(t.Hashed||(t.Hashed={})).is=function(t){return"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt}}(f||(f={})),function(t){t.generate=function(t){return a.getRandomValues(t)}}(S||(S={})),(y||(y={})).is=function(t){return"HMAC"==t||"RSA"==t||"ECDSA"==t||"RSA-PSS"==t};class m{async sign(n){return"string"==typeof n?e(await this.signBinary((new t).encode(n)),"url"):this.signBinary(n)}verify(n,e){return"string"==typeof e&&(e=r(e,"url")),this.verifyBinary("string"==typeof n?(new t).encode(n):n,e)}}class P extends m{constructor(t,n,e){super(),this.hash=t,n&&("string"==typeof n&&(n=r(n)),this.publicKey=a.subtle.importKey("spki",n,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!1,["verify"])),e&&("string"==typeof e&&(e=r(e)),this.privateKey=a.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!0,["sign","verify"]))}async signBinary(t){return new Uint8Array(await a.subtle.sign({name:"ECDSA",hash:{name:this.hash}},await this.privateKey,t))}async verifyBinary(t,n){return a.subtle.verify({name:"ECDSA",hash:{name:this.hash}},await this.publicKey,n,t)}}!function(t){t.is=function(t){return"SHA-1"==t||"SHA-256"==t||"SHA-384"==t||"SHA-512"==t}}(l||(l={}));class k extends m{async verifyBinary(t,n){return e(await this.signBinary(t),"url")==e(n,"url")}}class E extends k{constructor(t,n){super(),this.hash=t,"string"==typeof n&&(n=r(n,"url")),this.key=a.subtle.importKey("raw",n,{name:"HMAC",hash:{name:t}},!1,["sign","verify"])}async signBinary(t){return new Uint8Array(await a.subtle.sign("HMAC",await this.key,t))}}class j extends k{signBinary(t){return Promise.resolve(new Uint8Array(0))}}class R extends m{get parameters(){return C(this.variant)}constructor(t,n,e){super(),this.variant=t,this.publicKey=n,this.privateKey=e}async signBinary(t){return this.privateKey?new Uint8Array(await a.subtle.sign(this.parameters,await this.privateKey,t)):new Uint8Array(0)}async verifyBinary(t,n){return!!this.publicKey&&a.subtle.verify(this.parameters,await this.publicKey,n,t)}async export(t,n="base64"){const r=await("private"==t?this.privateKey:this.publicKey);let i;if(r)switch(n){case"jwk":i=await a.subtle.exportKey("jwk",r);break;case"buffer":i=await a.subtle.exportKey("private"==t?"pkcs8":"spki",r);break;case"base64":{const n=await this.export(t,"buffer");i=n&&e(new Uint8Array(n),"standard","=")}break;case"pem":{const n=await this.export(t,"base64");i=n&&[`-----BEGIN ${t.toUpperCase()} KEY-----`,...U(n,64),`-----END ${t.toUpperCase()} KEY-----`].join("\n")}}return i}static import(t,n,e,r){return new R(t,R.importHelper(t,n,"public",e),R.importHelper(t,n,"private",r))}static importHelper(t,n,e,i){return"string"==typeof i&&(i=r(i)),i&&a.subtle.importKey("private"==e?"pkcs8":"spki",i,{name:C(t).name,hash:{name:n}},!0,["private"==e?"sign":"verify"])}static generate(t,n,e){const r=a.subtle.generateKey({name:C(t).name,modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:n},!0,["sign","verify"]);return new R(t,r.then((t=>t.publicKey)),r.then((t=>t.privateKey)))}}function*U(t,n){let e=0;for(;e<t.length;)yield t.slice(e,e+=n)}function C(t){return"PSS"==t?{name:"RSA-PSS",saltLength:128}:{name:"RSASSA-PKCS1-v1_5"}}!function(t){!function(t){t.is=y.is}(t.Algorithm||(t.Algorithm={})),(t.Hash||(t.Hash={})).is=l.is,t.generate=function(t,n,e){let r;switch(t){case"RSA":r=R.generate("SSA",n,e);break;case"RSA-PSS":r=R.generate("PSS",n,e)}return r},t.create=function(t,n,...e){let r;if(null!=n)switch(t){case"HMAC":r=new E(n,e[0]);break;case"RSA":r=R.import("SSA",n,e[0],e[1]);break;case"RSA-PSS":r=R.import("PSS",n,e[0],e[1]);break;case"ECDSA":r=new P(n,e[0],e[1])}else"None"==t&&(r=new j);return r}}(w||(w={})),Uint8Array.__proto__.from||(Uint8Array.__proto__.from=function(t,n,e){const r=Uint8Array.__proto__;if("function"!=typeof this)throw new TypeError("# is not a constructor");if(this.__proto__!==r)throw new TypeError("this is not a typed array.");if("function"!=typeof(n=n||(t=>t)))throw new TypeError("specified argument is not a function");if(!(t=Object(t)).length)return new this(0);let i=[];for(const t of i)i.push(t);i=i.map(n,e);const s=new this(i.length);for(let t=0;t<s.length;t++)s[t]=i[t];return s}),function(t){t.is=function(t){return"object"==typeof t&&Object.values(t).every((t=>t&&"object"==typeof t&&"forward"in t&&"function"==typeof t.forward&&"backward"in t&&"function"==typeof t.backward))}}(p||(p={})),function(t){t.is=function(t){return Array.isArray(t)&&t.every((t=>"string"==typeof t))}}(A||(A={})),function(t){t.is=function(t){return"object"==typeof t&&Object.entries(t).every((t=>"string"==typeof t[1]))}}(h||(h={})),function(t){t.is=function(t){return A.is(t)||p.is(t)||h.is(t)},(t.Converter||(t.Converter={})).is=p.is,(t.Crypto||(t.Crypto={})).is=A.is,(t.Renamer||(t.Renamer={})).is=h.is}(d||(d={})),function(t){t.is=function(t){return"object"==typeof t&&"function"==typeof t.apply&&"function"==typeof t.reverse},t.create=function(t){return{apply:t.apply?t.apply:t=>t,reverse:t.reverse?t.reverse:t=>t}}}(b||(b={})),function(t){t.is=function(t){return"RS256"==t||"RS384"==t||"RS512"==t||"ES256"==t||"ES384"==t||"ES512"==t||"PS256"==t||"PS384"==t||"PS512"==t}}(g||(g={})),function(t){t.is=function(t){return"HS256"==t||"HS384"==t||"HS512"==t}}(v||(v={})),function(t){t.is=function(t){return"none"==t||v.is(t)||g.is(t)},function(t){t.is=v.is}(t.Symmetric||(t.Symmetric={})),(t.Asymmetric||(t.Asymmetric={})).is=g.is}(H||(H={}));var O,M;class B{constructor(t,n){this.name=t,this.signer=n}sign(t){return n=this,e=void 0,i=function*(){return this.signer.sign(t)},new((r=void 0)||(r=Promise))((function(t,s){function a(t){try{c(i.next(t))}catch(t){s(t)}}function o(t){try{c(i.throw(t))}catch(t){s(t)}}function c(n){var e;n.done?t(n.value):(e=n.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,o)}c((i=i.apply(n,e||[])).next())}));var n,e,r,i}verify(t,n){return this.signer.verify(t,n)}static create(t,...n){let e;switch(t){case"ES256":e=w.create("ECDSA","SHA-256",n[0],n[1]);break;case"ES384":e=w.create("ECDSA","SHA-384",n[0],n[1]);break;case"ES512":e=w.create("ECDSA","SHA-512",n[0],n[1]);break;case"PS256":e=w.create("RSA-PSS","SHA-256",n[0],n[1]);break;case"PS384":e=w.create("RSA-PSS","SHA-384",n[0],n[1]);break;case"PS512":e=w.create("RSA-PSS","SHA-512",n[0],n[1]);break;case"HS256":e=w.create("HMAC","SHA-256",n[0]);break;case"HS384":e=w.create("HMAC","SHA-384",n[0]);break;case"HS512":e=w.create("HMAC","SHA-512",n[0]);break;case"RS256":e=w.create("RSA","SHA-256",n[0],n[1]);break;case"RS384":e=w.create("RSA","SHA-384",n[0],n[1]);break;case"RS512":e=w.create("RSA","SHA-512",n[0],n[1]);break;case"none":e=w.create("None")}return e&&new B(t,e)}static none(){return B.create("none")}static HS256(t){return B.create("HS256",t)}static HS384(t){return B.create("HS384",t)}static HS512(t){return B.create("HS512",t)}static RS256(t,n){return B.create("RS256",t,n)}static RS384(t,n){return B.create("RS384",t,n)}static RS512(t,n){return B.create("RS512",t,n)}static ES256(t,n){return B.create("ES256",t,n)}static ES384(t,n){return B.create("ES384",t,n)}static ES512(t,n){return B.create("ES512",t,n)}static PS256(t,n){return B.create("PS256",t,n)}static PS384(t,n){return B.create("PS384",t,n)}static PS512(t,n){return B.create("PS512",t,n)}}!function(t){var n;(n=t.Name||(t.Name={})).is=H.is,function(t){t.is=H.Symmetric.is}(n.Symmetric||(n.Symmetric={})),function(t){t.is=H.Asymmetric.is}(n.Asymmetric||(n.Asymmetric={}))}(B||(B={})),function(t){t.is=function(t){return"string"==typeof t&&/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(t)}}(O||(O={})),function(t){const n={"*":"https://site-icons.pages.dev/ionicons@5.0.0/dist/svg/${name}.svg"},e={};t.load=async function(t){var r,i;const s=(null!==(r=n[t])&&void 0!==r?r:n["*"]).replace("${name}",t);return null!==(i=e[s])&&void 0!==i?i:e[s]=async function(t){const n=await globalThis.fetch(t);return n.ok?n.text():void 0}(s)},t.add=function(t,...e){for(const r of e)n[r]=t}}(M||(M={}));class D{static is(t){return"object"==typeof t&&"string"==typeof t.destination&&null!=t.content}static send(t,n,e){if(D.is(t)&&null==e){(e=n)||(e=window);const r=t.destination.split("#",2);e.postMessage(t={destination:r[1],content:t.content},r[0])}else"string"!=typeof e&&(e||(e=window),"string"==typeof t&&D.send({destination:t,content:n},e))}static listen(t,n,e){const r=t.split("#",2);let i="";2==r.length&&(t=r[0],i=r[1]),(e||window).addEventListener("message",(e=>{const r=e.data;!D.is(r)||"*"!=t&&e.origin!=t||""!=i&&r.destination!=i||n(r.destination,r.content)}))}}class x{static is(t){return"object"==typeof t&&"string"==typeof t.name}}var N,T=function(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)};class z{constructor(){N.set(this,{})}listen(t,n){var e,r;null!==(r=null===(e=T(this,N,"f")[t])||void 0===e?void 0:e.push(n))&&void 0!==r||(T(this,N,"f")[t]=[n]),n(this[t])}unlisten(t,n){var e,r;const i=null===(e=T(this,N,"f")[t])||void 0===e?void 0:e.indexOf(n);null!=i&&i>=0&&(null===(r=T(this,N,"f")[t])||void 0===r||r.splice(i,1))}static load(t,n){const e=null!=n?n:new z;return Object.defineProperties(e,function(t){return Object.fromEntries(Object.entries(Object.assign(Object.assign({},Object.getOwnPropertyDescriptors(t)),Object.getOwnPropertyDescriptors(Object.getPrototypeOf(t)))).map((([n,r])=>[n,"function"==typeof r.value?{get:()=>t[n].bind(t)}:r.writable||r.set?{get:()=>t[n],set(r){var i;t[n]=r,null===(i=T(e,N,"f")[n])||void 0===i||i.forEach((e=>e(t[n])))}}:{get:()=>t[n].bind(t)}])))}(t))}}N=new WeakMap;export{u as I,z as L,D as M,x as T,M as a}
|
|
1
|
+
class t{constructor(){this.encoding="utf-8"}encode(t){return Uint8Array.from(unescape(encodeURIComponent(t)).split(""),(t=>t.charCodeAt(0)))}}const n={standard:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",url:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",ordered:"-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",reversed:"zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-"};function e(e,r="standard",i=""){let s;const a=t=>"ordered"==r||"reversed"==r?t.reverse():t;switch(typeof e){case"string":s=(new t).encode(e);break;case"number":s=a(new Uint8Array(new BigUint64Array([BigInt(e)]).buffer));break;case"bigint":s=a(new Uint8Array(new BigUint64Array([e]).buffer));break;default:s=e instanceof Uint8Array?e:new Uint8Array(e)}const o=n[r],c=[];for(let t=0;t<s.length;t+=3){const n=s[t],e=t+1<s.length?s[t+1]:0,r=t+2<s.length?s[t+2]:0;c.push(o[n>>>2]),c.push(o[(3&n)<<4|e>>>4]),c.push(o[(15&e)<<2|r>>>6]),c.push(o[63&r])}const u=Math.ceil(s.length/3*4);return c.join("").substring(0,u)+i.repeat(c.length-u)}function r(t,e="standard"){for(;t.endsWith("=")&&t.length>0;)t=t.substring(0,t.length-1);const r=n[e],i=[...t].map((t=>r.indexOf(t))),s=new Uint8Array(Math.floor(i.length/4*3));for(let t=0;t<s.length;t+=3){const n=i.shift()||0,e=i.shift()||0,r=i.shift()||0,a=i.shift()||0;s[t]=n<<2|e>>>4,s[t+1]=(15&e)<<4|r>>>2,s[t+2]=(3&r)<<6|a}return"ordered"==e||"reversed"==e?s.reverse():s}function i(t,e=1,r="standard"){const a=n[r],o=t.length>1?t.substring(0,t.length-1):e>0?"":a[63],c=(0==t.length?0:a.indexOf(t[t.length-1]))+e;return(c>63||c<0?i(o,Math.floor(c/63),r):o)+a[s(c,64)]}function s(t,n){return t>=0?t%n:s(t+n,n)}const a="undefined"!=typeof window?window.crypto||window.msCrypto:self.crypto||self.msCrypto;var o,c,u,f,S,y,l,p,w,A,h,d,b,g,v,H;!function(t){t.create=function(t,n,...e){const[r,...i]=(s=e,Array.isArray(s)&&s.length>0&&"string"==typeof s[0]?e.map((t=>Object.fromEntries(t.split(",").map((t=>t.split(":",2).map((t=>t.trim()))))))):e);var s;const a=Object.assign({},...Object.entries(r).map((([t,n])=>[t,[n,...i.map((n=>n[t])).filter((t=>t))]])).map((([n,e])=>({get[n](){return Object.assign(t(e),{name:n})}}))));return{current:a[n],...a}}}(o||(o={})),function(t){t.is=function(t){return"object"==typeof t&&(null==t.key||"string"==typeof t.key)&&"string"==typeof t.value&&"string"==typeof t.salt},t.stringify=function(t){return t.key=t.key&&4!=t.key.length?t.key.slice(-2):t.key,[t.key,t.salt,t.value].join(".")},t.parse=function(n){const e=n.split("."),r={key:e[0],salt:e[1],value:e[2]};return t.is(r)?r:void 0}}(c||(c={})),function(t){function n(t,n="url"){return e(t,n)}function s(t){t.length%2==1&&(t+="0");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++)e[n]=16*Number.parseInt(t[2*n],16)+Number.parseInt(t[2*n+1],16);return n(e)}function o(t,n){const e=r(t,"url");let i=[];for(const t of e)i.push(Math.floor(t/16).toString(16),(t%16).toString(16));return n&&(i=i.slice(0,n)),i.join("")}function c(t,n=1){const e=i(t,n,"ordered");return e.length==t.length?e:e.substring(e.length-t.length)}t.is=function(t,n){return"string"==typeof t&&(null==n||t.length==n)&&Array.from(t).every((t=>t>="0"&&t<="9"||t>="A"&&t<="Z"||t>="a"&&t<="z"||"-"==t||"_"==t))},t.fromUint24=function(t){return s(t.toString(16).padStart(6,"0"))},t.toUint24=function(t){return Number.parseInt(o(t,6),16)},t.fromUint48=function(t){return s(t.toString(16).padStart(12,"0"))},t.toUint48=function(t){return Number.parseInt(o(t,12),16)},t.fromBinary=n,t.toBinary=function(t){return r(t,"url")},t.generate=function(t,r,i){let s;return(i||0==i||""==i)&&(s=e(i,r).substring(0,t)),(null!=s?s:"")+n(a.getRandomValues(new Uint8Array(t/4*3)),r).substring(0,t-(s?s.length:0))},t.fromHexadecimal=s,t.toHexadecimal=o,t.min=function(t){return"".padStart(t,"-")},t.max=function(t){return"".padStart(t,"z")},t.next=c,t.previous=function(t,n=1){return c(t,-n)},t.length=[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128],(t.Length||(t.Length={})).is=function(t){return"number"==typeof t&&t>=4&&t<=128&&(252&t)==t}}(u||(u={})),function(t){t.is=function(t){return"string"==typeof t||"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt},t.hash=async function(t,n,r){return r||(r=e(a.getRandomValues(new Uint8Array(64)))),{hash:await t.sign(r+n),salt:r}},t.verify=async function(n,e,r){return(await t.hash(n,r,e.salt)).hash==e.hash},(t.Hashed||(t.Hashed={})).is=function(t){return"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt}}(f||(f={})),function(t){t.generate=function(t){return a.getRandomValues(t)}}(S||(S={})),(y||(y={})).is=function(t){return"HMAC"==t||"RSA"==t||"ECDSA"==t||"RSA-PSS"==t};class m{async sign(n){return"string"==typeof n?e(await this.signBinary((new t).encode(n)),"url"):this.signBinary(n)}verify(n,e){return"string"==typeof e&&(e=r(e,"url")),this.verifyBinary("string"==typeof n?(new t).encode(n):n,e)}}class P extends m{constructor(t,n,e){super(),this.hash=t,n&&("string"==typeof n&&(n=r(n)),this.publicKey=a.subtle.importKey("spki",n,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!1,["verify"])),e&&("string"==typeof e&&(e=r(e)),this.privateKey=a.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!0,["sign","verify"]))}async signBinary(t){return new Uint8Array(await a.subtle.sign({name:"ECDSA",hash:{name:this.hash}},await this.privateKey,t))}async verifyBinary(t,n){return a.subtle.verify({name:"ECDSA",hash:{name:this.hash}},await this.publicKey,n,t)}}!function(t){t.is=function(t){return"SHA-1"==t||"SHA-256"==t||"SHA-384"==t||"SHA-512"==t}}(l||(l={}));class k extends m{async verifyBinary(t,n){return e(await this.signBinary(t),"url")==e(n,"url")}}class E extends k{constructor(t,n){super(),this.hash=t,"string"==typeof n&&(n=r(n,"url")),this.key=a.subtle.importKey("raw",n,{name:"HMAC",hash:{name:t}},!1,["sign","verify"])}async signBinary(t){return new Uint8Array(await a.subtle.sign("HMAC",await this.key,t))}}class j extends k{signBinary(t){return Promise.resolve(new Uint8Array(0))}}class R extends m{get parameters(){return C(this.variant)}constructor(t,n,e){super(),this.variant=t,this.publicKey=n,this.privateKey=e}async signBinary(t){return this.privateKey?new Uint8Array(await a.subtle.sign(this.parameters,await this.privateKey,t)):new Uint8Array(0)}async verifyBinary(t,n){return!!this.publicKey&&a.subtle.verify(this.parameters,await this.publicKey,n,t)}async export(t,n="base64"){const r=await("private"==t?this.privateKey:this.publicKey);let i;if(r)switch(n){case"jwk":i=await a.subtle.exportKey("jwk",r);break;case"buffer":i=await a.subtle.exportKey("private"==t?"pkcs8":"spki",r);break;case"base64":{const n=await this.export(t,"buffer");i=n&&e(new Uint8Array(n),"standard","=")}break;case"pem":{const n=await this.export(t,"base64");i=n&&[`-----BEGIN ${t.toUpperCase()} KEY-----`,...U(n,64),`-----END ${t.toUpperCase()} KEY-----`].join("\n")}}return i}static import(t,n,e,r){return new R(t,R.importHelper(t,n,"public",e),R.importHelper(t,n,"private",r))}static importHelper(t,n,e,i){return"string"==typeof i&&(i=r(i)),i&&a.subtle.importKey("private"==e?"pkcs8":"spki",i,{name:C(t).name,hash:{name:n}},!0,["private"==e?"sign":"verify"])}static generate(t,n,e){const r=a.subtle.generateKey({name:C(t).name,modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:n},!0,["sign","verify"]);return new R(t,r.then((t=>t.publicKey)),r.then((t=>t.privateKey)))}}function*U(t,n){let e=0;for(;e<t.length;)yield t.slice(e,e+=n)}function C(t){return"PSS"==t?{name:"RSA-PSS",saltLength:128}:{name:"RSASSA-PKCS1-v1_5"}}!function(t){!function(t){t.is=y.is}(t.Algorithm||(t.Algorithm={})),(t.Hash||(t.Hash={})).is=l.is,t.generate=function(t,n,e){let r;switch(t){case"RSA":r=R.generate("SSA",n,e);break;case"RSA-PSS":r=R.generate("PSS",n,e)}return r},t.create=function(t,n,...e){let r;if(null!=n)switch(t){case"HMAC":r=new E(n,e[0]);break;case"RSA":r=R.import("SSA",n,e[0],e[1]);break;case"RSA-PSS":r=R.import("PSS",n,e[0],e[1]);break;case"ECDSA":r=new P(n,e[0],e[1])}else"None"==t&&(r=new j);return r}}(p||(p={})),Uint8Array.__proto__.from||(Uint8Array.__proto__.from=function(t,n,e){const r=Uint8Array.__proto__;if("function"!=typeof this)throw new TypeError("# is not a constructor");if(this.__proto__!==r)throw new TypeError("this is not a typed array.");if("function"!=typeof(n=n||(t=>t)))throw new TypeError("specified argument is not a function");if(!(t=Object(t)).length)return new this(0);let i=[];for(const t of i)i.push(t);i=i.map(n,e);const s=new this(i.length);for(let t=0;t<s.length;t++)s[t]=i[t];return s}),function(t){t.is=function(t){return"object"==typeof t&&Object.values(t).every((t=>t&&"object"==typeof t&&"forward"in t&&"function"==typeof t.forward&&"backward"in t&&"function"==typeof t.backward))}}(w||(w={})),function(t){t.is=function(t){return Array.isArray(t)&&t.every((t=>"string"==typeof t))}}(A||(A={})),function(t){t.is=function(t){return"object"==typeof t&&Object.entries(t).every((t=>"string"==typeof t[1]))}}(h||(h={})),function(t){t.is=function(t){return A.is(t)||w.is(t)||h.is(t)},(t.Converter||(t.Converter={})).is=w.is,(t.Crypto||(t.Crypto={})).is=A.is,(t.Renamer||(t.Renamer={})).is=h.is}(d||(d={})),function(t){t.is=function(t){return"object"==typeof t&&"function"==typeof t.apply&&"function"==typeof t.reverse},t.create=function(t){return{apply:t.apply?t.apply:t=>t,reverse:t.reverse?t.reverse:t=>t}}}(b||(b={})),function(t){t.is=function(t){return"RS256"==t||"RS384"==t||"RS512"==t||"ES256"==t||"ES384"==t||"ES512"==t||"PS256"==t||"PS384"==t||"PS512"==t}}(g||(g={})),function(t){t.is=function(t){return"HS256"==t||"HS384"==t||"HS512"==t}}(v||(v={})),function(t){t.is=function(t){return"none"==t||v.is(t)||g.is(t)},function(t){t.is=v.is}(t.Symmetric||(t.Symmetric={})),(t.Asymmetric||(t.Asymmetric={})).is=g.is}(H||(H={}));var O,M;class B{constructor(t,n){this.name=t,this.signer=n}sign(t){return n=this,e=void 0,i=function*(){return this.signer.sign(t)},new((r=void 0)||(r=Promise))((function(t,s){function a(t){try{c(i.next(t))}catch(t){s(t)}}function o(t){try{c(i.throw(t))}catch(t){s(t)}}function c(n){var e;n.done?t(n.value):(e=n.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,o)}c((i=i.apply(n,e||[])).next())}));var n,e,r,i}verify(t,n){return this.signer.verify(t,n)}static create(t,...n){let e;switch(t){case"ES256":e=p.create("ECDSA","SHA-256",n[0],n[1]);break;case"ES384":e=p.create("ECDSA","SHA-384",n[0],n[1]);break;case"ES512":e=p.create("ECDSA","SHA-512",n[0],n[1]);break;case"PS256":e=p.create("RSA-PSS","SHA-256",n[0],n[1]);break;case"PS384":e=p.create("RSA-PSS","SHA-384",n[0],n[1]);break;case"PS512":e=p.create("RSA-PSS","SHA-512",n[0],n[1]);break;case"HS256":e=p.create("HMAC","SHA-256",n[0]);break;case"HS384":e=p.create("HMAC","SHA-384",n[0]);break;case"HS512":e=p.create("HMAC","SHA-512",n[0]);break;case"RS256":e=p.create("RSA","SHA-256",n[0],n[1]);break;case"RS384":e=p.create("RSA","SHA-384",n[0],n[1]);break;case"RS512":e=p.create("RSA","SHA-512",n[0],n[1]);break;case"none":e=p.create("None")}return e&&new B(t,e)}static none(){return B.create("none")}static HS256(t){return B.create("HS256",t)}static HS384(t){return B.create("HS384",t)}static HS512(t){return B.create("HS512",t)}static RS256(t,n){return B.create("RS256",t,n)}static RS384(t,n){return B.create("RS384",t,n)}static RS512(t,n){return B.create("RS512",t,n)}static ES256(t,n){return B.create("ES256",t,n)}static ES384(t,n){return B.create("ES384",t,n)}static ES512(t,n){return B.create("ES512",t,n)}static PS256(t,n){return B.create("PS256",t,n)}static PS384(t,n){return B.create("PS384",t,n)}static PS512(t,n){return B.create("PS512",t,n)}}!function(t){var n;(n=t.Name||(t.Name={})).is=H.is,function(t){t.is=H.Symmetric.is}(n.Symmetric||(n.Symmetric={})),function(t){t.is=H.Asymmetric.is}(n.Asymmetric||(n.Asymmetric={}))}(B||(B={})),function(t){t.is=function(t){return"string"==typeof t&&/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(t)}}(O||(O={})),function(t){const n={"*":"https://site-icons.pages.dev/ionicons@5.0.0/dist/svg/${name}.svg"},e={};t.load=async function(t){var r,i;const s=(null!==(r=n[t])&&void 0!==r?r:n["*"]).replace("${name}",t);return null!==(i=e[s])&&void 0!==i?i:e[s]=async function(t){const n=await globalThis.fetch(t);return n.ok?n.text():void 0}(s)},t.add=function(t,...e){for(const r of e)n[r]=t}}(M||(M={}));class D{static is(t){return"object"==typeof t&&"string"==typeof t.destination&&null!=t.content}static send(t,n,e){if(D.is(t)&&null==e){(e=n)||(e=window);const r=t.destination.split("#",2);e.postMessage(t={destination:r[1],content:t.content},r[0])}else"string"!=typeof e&&(e||(e=window),"string"==typeof t&&D.send({destination:t,content:n},e))}static listen(t,n,e){const r=t.split("#",2);let i="";2==r.length&&(t=r[0],i=r[1]),(e||window).addEventListener("message",(e=>{const r=e.data;!D.is(r)||"*"!=t&&e.origin!=t||""!=i&&r.destination!=i||n(r.destination,r.content)}))}}class x{static is(t){return"object"==typeof t&&"string"==typeof t.name}}var N,T=function(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)};class z{constructor(){N.set(this,{})}listen(t,n,e){var r,i;null!==(i=null===(r=T(this,N,"f")[t])||void 0===r?void 0:r.push(n))&&void 0!==i||(T(this,N,"f")[t]=[n]),(null==e?void 0:e.lazy)||n(this[t])}unlisten(t,n){var e,r;const i=null===(e=T(this,N,"f")[t])||void 0===e?void 0:e.indexOf(n);null!=i&&i>=0&&(null===(r=T(this,N,"f")[t])||void 0===r||r.splice(i,1))}static load(t){const n=t.listenable;return Object.defineProperties(n,function(t){return Object.fromEntries(Object.entries(Object.assign(Object.assign({},Object.getOwnPropertyDescriptors(t)),Object.getOwnPropertyDescriptors(Object.getPrototypeOf(t)))).map((([e,r])=>[e,"function"==typeof r.value?{get:()=>t[e].bind(t)}:r.writable||r.set?{get:()=>t[e],set(r){var i;t[e]=r,null===(i=T(n,N,"f")[e])||void 0===i||i.forEach((n=>n(t[e])))}}:{get:()=>t[e]}])))}(t))}}N=new WeakMap;export{u as I,z as L,D as M,x as T,M as a}
|