smoothly 0.3.55 → 0.3.57
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-0b92b362.js → Listenable-fcea5136.js} +41 -21
- package/dist/cjs/getLanguage-7991c46a.js +6041 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/smoothly-accordion_53.cjs.entry.js +309 -19078
- package/dist/cjs/smoothly-country.cjs.entry.js +8 -8
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +1 -1
- package/dist/custom-elements/index.js +919 -25750
- package/dist/esm/{Listenable-79ce5567.js → Listenable-10f48463.js} +41 -21
- package/dist/esm/getLanguage-225b37b0.js +6039 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/smoothly-accordion_53.entry.js +309 -19078
- package/dist/esm/smoothly-country.entry.js +8 -8
- package/dist/esm/smoothly-trigger-sink.entry.js +1 -1
- package/dist/esm/smoothly-trigger-source.entry.js +1 -1
- package/dist/smoothly/index.esm.js +1 -1
- package/dist/smoothly/p-44420b1e.entry.js +1 -0
- package/dist/smoothly/p-a14dfd75.js +1 -0
- package/dist/smoothly/p-bb57ff51.js +1 -0
- package/dist/smoothly/p-cab954af.entry.js +1 -0
- package/dist/smoothly/{p-5120e158.entry.js → p-d7f00399.entry.js} +1 -1
- package/dist/smoothly/{p-b1147a02.entry.js → p-df8af5a2.entry.js} +1 -1
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/package.json +7 -7
- package/dist/cjs/getLanguage-892e255f.js +0 -12123
- package/dist/esm/getLanguage-bff35c81.js +0 -12121
- package/dist/smoothly/p-878ee591.entry.js +0 -1
- package/dist/smoothly/p-8878611c.js +0 -1
- package/dist/smoothly/p-8f1d86ff.js +0 -1
- package/dist/smoothly/p-b30c457b.entry.js +0 -1
|
@@ -12,29 +12,45 @@ class TextEncoder {
|
|
|
12
12
|
const tables = {
|
|
13
13
|
standard: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
14
14
|
url: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
|
|
15
|
+
ordered: "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",
|
|
16
|
+
reversed: "zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",
|
|
15
17
|
};
|
|
16
18
|
function encode(value, standard = "standard", padding = "") {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
let data;
|
|
20
|
+
const reverse = (array) => (standard == "ordered" || standard == "reversed" ? array.reverse() : array);
|
|
21
|
+
switch (typeof value) {
|
|
22
|
+
case "string":
|
|
23
|
+
data = new TextEncoder().encode(value);
|
|
24
|
+
break;
|
|
25
|
+
case "number":
|
|
26
|
+
data = reverse(new Uint8Array(new BigUint64Array([BigInt(value)]).buffer));
|
|
27
|
+
break;
|
|
28
|
+
case "bigint":
|
|
29
|
+
data = reverse(new Uint8Array(new BigUint64Array([value]).buffer));
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
data = value instanceof Uint8Array ? value : new Uint8Array(value);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
19
35
|
const table = tables[standard];
|
|
20
36
|
const result = [];
|
|
21
|
-
for (let c = 0; c <
|
|
22
|
-
const c0 =
|
|
23
|
-
const c1 = c + 1 <
|
|
24
|
-
const c2 = c + 2 <
|
|
37
|
+
for (let c = 0; c < data.length; c += 3) {
|
|
38
|
+
const c0 = data[c];
|
|
39
|
+
const c1 = c + 1 < data.length ? data[c + 1] : 0;
|
|
40
|
+
const c2 = c + 2 < data.length ? data[c + 2] : 0;
|
|
25
41
|
result.push(table[c0 >>> 2]);
|
|
26
42
|
result.push(table[((c0 & 3) << 4) | (c1 >>> 4)]);
|
|
27
43
|
result.push(table[((c1 & 15) << 2) | (c2 >>> 6)]);
|
|
28
44
|
result.push(table[c2 & 63]);
|
|
29
45
|
}
|
|
30
|
-
const length = Math.ceil((
|
|
31
|
-
return result.join("").
|
|
46
|
+
const length = Math.ceil((data.length / 3) * 4);
|
|
47
|
+
return result.join("").substring(0, length) + padding.repeat(result.length - length);
|
|
32
48
|
}
|
|
33
49
|
function decode(value, standard = "standard") {
|
|
34
50
|
while (value.endsWith("=") && value.length > 0)
|
|
35
|
-
value = value.
|
|
51
|
+
value = value.substring(0, value.length - 1);
|
|
36
52
|
const table = tables[standard];
|
|
37
|
-
const data = value.
|
|
53
|
+
const data = [...value].map(c => table.indexOf(c));
|
|
38
54
|
const result = new Uint8Array(Math.floor((data.length / 4) * 3));
|
|
39
55
|
for (let c = 0; c < result.length; c += 3) {
|
|
40
56
|
const d0 = data.shift() || 0;
|
|
@@ -45,7 +61,7 @@ function decode(value, standard = "standard") {
|
|
|
45
61
|
result[c + 1] = ((d1 & 15) << 4) | (d2 >>> 2);
|
|
46
62
|
result[c + 2] = ((d2 & 3) << 6) | d3;
|
|
47
63
|
}
|
|
48
|
-
return result;
|
|
64
|
+
return standard == "ordered" || standard == "reversed" ? result.reverse() : result;
|
|
49
65
|
}
|
|
50
66
|
function next(value, increment = 1, standard = "standard") {
|
|
51
67
|
const table = tables[standard];
|
|
@@ -131,16 +147,20 @@ exports.Identifier = void 0;
|
|
|
131
147
|
return Number.parseInt(toHexadecimal(identifier, 12), 16);
|
|
132
148
|
}
|
|
133
149
|
Identifier.toUint48 = toUint48;
|
|
134
|
-
function fromBinary(identifier) {
|
|
135
|
-
return encode(identifier,
|
|
150
|
+
function fromBinary(identifier, standard = "url") {
|
|
151
|
+
return encode(identifier, standard);
|
|
136
152
|
}
|
|
137
153
|
Identifier.fromBinary = fromBinary;
|
|
138
154
|
function toBinary(identifier) {
|
|
139
155
|
return decode(identifier, "url");
|
|
140
156
|
}
|
|
141
157
|
Identifier.toBinary = toBinary;
|
|
142
|
-
function generate(length) {
|
|
143
|
-
|
|
158
|
+
function generate(length, ordering, value) {
|
|
159
|
+
let result = undefined;
|
|
160
|
+
if (value || value == 0 || value == "")
|
|
161
|
+
result = encode(value, ordering).substring(0, length);
|
|
162
|
+
return ((result !== null && result !== void 0 ? result : "") +
|
|
163
|
+
fromBinary(crypto.getRandomValues(new Uint8Array((length / 4) * 3)), ordering).substring(0, length - (result ? result.length : 0)));
|
|
144
164
|
}
|
|
145
165
|
Identifier.generate = generate;
|
|
146
166
|
function fromHexadecimal(identifier) {
|
|
@@ -163,15 +183,15 @@ exports.Identifier = void 0;
|
|
|
163
183
|
}
|
|
164
184
|
Identifier.toHexadecimal = toHexadecimal;
|
|
165
185
|
function min(length) {
|
|
166
|
-
return "".padStart(length, "
|
|
186
|
+
return "".padStart(length, "-");
|
|
167
187
|
}
|
|
168
188
|
Identifier.min = min;
|
|
169
189
|
function max(length) {
|
|
170
|
-
return "".padStart(length, "
|
|
190
|
+
return "".padStart(length, "z");
|
|
171
191
|
}
|
|
172
192
|
Identifier.max = max;
|
|
173
193
|
function next$1(identifier, increment = 1) {
|
|
174
|
-
const result = next(identifier, increment, "
|
|
194
|
+
const result = next(identifier, increment, "ordered");
|
|
175
195
|
return result.length == identifier.length ? result : result.substring(result.length - identifier.length);
|
|
176
196
|
}
|
|
177
197
|
Identifier.next = next$1;
|
|
@@ -307,15 +327,15 @@ class None extends Symmetric$1 {
|
|
|
307
327
|
}
|
|
308
328
|
|
|
309
329
|
class Rsa extends Base {
|
|
330
|
+
get parameters() {
|
|
331
|
+
return getParameters(this.variant);
|
|
332
|
+
}
|
|
310
333
|
constructor(variant, publicKey, privateKey) {
|
|
311
334
|
super();
|
|
312
335
|
this.variant = variant;
|
|
313
336
|
this.publicKey = publicKey;
|
|
314
337
|
this.privateKey = privateKey;
|
|
315
338
|
}
|
|
316
|
-
get parameters() {
|
|
317
|
-
return getParameters(this.variant);
|
|
318
|
-
}
|
|
319
339
|
async signBinary(data) {
|
|
320
340
|
return this.privateKey
|
|
321
341
|
? new Uint8Array(await crypto.subtle.sign(this.parameters, await this.privateKey, data))
|