@learncard/core 1.0.0 → 1.1.1
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/README.md +6 -8
- package/dist/core.cjs.development.js +1747 -226
- package/dist/core.cjs.development.js.map +3 -3
- package/dist/core.cjs.production.min.js +175 -175
- package/dist/core.cjs.production.min.js.map +3 -3
- package/dist/core.d.ts +17 -37
- package/dist/core.esm.js +1747 -226
- package/dist/core.esm.js.map +3 -3
- package/package.json +3 -3
@@ -26464,17 +26464,17 @@ var require_decode_uri_component = __commonJS({
|
|
26464
26464
|
"%FE%FF": "\uFFFD\uFFFD",
|
26465
26465
|
"%FF%FE": "\uFFFD\uFFFD"
|
26466
26466
|
};
|
26467
|
-
var
|
26468
|
-
while (
|
26467
|
+
var match2 = multiMatcher.exec(input);
|
26468
|
+
while (match2) {
|
26469
26469
|
try {
|
26470
|
-
replaceMap[
|
26470
|
+
replaceMap[match2[0]] = decodeURIComponent(match2[0]);
|
26471
26471
|
} catch (err) {
|
26472
|
-
var result = decode9(
|
26473
|
-
if (result !==
|
26474
|
-
replaceMap[
|
26472
|
+
var result = decode9(match2[0]);
|
26473
|
+
if (result !== match2[0]) {
|
26474
|
+
replaceMap[match2[0]] = result;
|
26475
26475
|
}
|
26476
26476
|
}
|
26477
|
-
|
26477
|
+
match2 = multiMatcher.exec(input);
|
26478
26478
|
}
|
26479
26479
|
replaceMap["%C2"] = "\uFFFD";
|
26480
26480
|
var entries = Object.keys(replaceMap);
|
@@ -26905,24 +26905,10 @@ var require_query_string = __commonJS({
|
|
26905
26905
|
// src/index.ts
|
26906
26906
|
var src_exports2 = {};
|
26907
26907
|
__export(src_exports2, {
|
26908
|
-
createWallet: () => createWallet,
|
26909
26908
|
walletFromKey: () => walletFromKey
|
26910
26909
|
});
|
26911
26910
|
module.exports = __toCommonJS(src_exports2);
|
26912
26911
|
|
26913
|
-
// ../../node_modules/.pnpm/hex-lite@1.5.0/node_modules/hex-lite/dist/hex-lite.mjs
|
26914
|
-
function toUint8Array(str) {
|
26915
|
-
var s = 0, sl = str.length, bytes = [];
|
26916
|
-
if (sl % 2) {
|
26917
|
-
throw new Error("invalid hex:" + str);
|
26918
|
-
}
|
26919
|
-
for (; s < sl; s += 2) {
|
26920
|
-
bytes.push(parseInt(str.substr(s, 2), 16));
|
26921
|
-
}
|
26922
|
-
return new Uint8Array(bytes);
|
26923
|
-
}
|
26924
|
-
__name(toUint8Array, "toUint8Array");
|
26925
|
-
|
26926
26912
|
// src/didkit/pkg/didkit_wasm.js
|
26927
26913
|
var wasm;
|
26928
26914
|
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
@@ -32111,14 +32097,14 @@ var ProviderCrypto = class {
|
|
32111
32097
|
return this.onExportKey.apply(this, args);
|
32112
32098
|
});
|
32113
32099
|
}
|
32114
|
-
checkExportKey(
|
32115
|
-
this.checkKeyFormat(
|
32100
|
+
checkExportKey(format2, key2, ...args) {
|
32101
|
+
this.checkKeyFormat(format2);
|
32116
32102
|
this.checkCryptoKey(key2);
|
32117
32103
|
if (!key2.extractable) {
|
32118
32104
|
throw new CryptoError("key: Is not extractable");
|
32119
32105
|
}
|
32120
32106
|
}
|
32121
|
-
onExportKey(
|
32107
|
+
onExportKey(format2, key2, ...args) {
|
32122
32108
|
return __async(this, null, function* () {
|
32123
32109
|
throw new UnsupportedOperationError("exportKey");
|
32124
32110
|
});
|
@@ -32129,16 +32115,16 @@ var ProviderCrypto = class {
|
|
32129
32115
|
return this.onImportKey.apply(this, args);
|
32130
32116
|
});
|
32131
32117
|
}
|
32132
|
-
checkImportKey(
|
32133
|
-
this.checkKeyFormat(
|
32134
|
-
this.checkKeyData(
|
32118
|
+
checkImportKey(format2, keyData, algorithm, extractable, keyUsages, ...args) {
|
32119
|
+
this.checkKeyFormat(format2);
|
32120
|
+
this.checkKeyData(format2, keyData);
|
32135
32121
|
this.checkAlgorithmName(algorithm);
|
32136
32122
|
this.checkImportParams(algorithm);
|
32137
32123
|
if (Array.isArray(this.usages)) {
|
32138
32124
|
this.checkKeyUsages(keyUsages, this.usages);
|
32139
32125
|
}
|
32140
32126
|
}
|
32141
|
-
onImportKey(
|
32127
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages, ...args) {
|
32142
32128
|
return __async(this, null, function* () {
|
32143
32129
|
throw new UnsupportedOperationError("importKey");
|
32144
32130
|
});
|
@@ -32180,8 +32166,8 @@ var ProviderCrypto = class {
|
|
32180
32166
|
}
|
32181
32167
|
checkImportParams(algorithm) {
|
32182
32168
|
}
|
32183
|
-
checkKeyFormat(
|
32184
|
-
switch (
|
32169
|
+
checkKeyFormat(format2) {
|
32170
|
+
switch (format2) {
|
32185
32171
|
case "raw":
|
32186
32172
|
case "pkcs8":
|
32187
32173
|
case "spki":
|
@@ -32191,11 +32177,11 @@ var ProviderCrypto = class {
|
|
32191
32177
|
throw new TypeError("format: Is invalid value. Must be 'jwk', 'raw', 'spki', or 'pkcs8'");
|
32192
32178
|
}
|
32193
32179
|
}
|
32194
|
-
checkKeyData(
|
32180
|
+
checkKeyData(format2, keyData) {
|
32195
32181
|
if (!keyData) {
|
32196
32182
|
throw new TypeError("keyData: Cannot be empty on empty on key importing");
|
32197
32183
|
}
|
32198
|
-
if (
|
32184
|
+
if (format2 === "jwk") {
|
32199
32185
|
if (!isJWK(keyData)) {
|
32200
32186
|
throw new TypeError("keyData: Is not JsonWebToken");
|
32201
32187
|
}
|
@@ -33122,8 +33108,8 @@ var Pbkdf2Provider = class extends ProviderCrypto {
|
|
33122
33108
|
throw new TypeError("iterations: Is less than 1");
|
33123
33109
|
}
|
33124
33110
|
}
|
33125
|
-
checkImportKey(
|
33126
|
-
super.checkImportKey(
|
33111
|
+
checkImportKey(format2, keyData, algorithm, extractable, keyUsages, ...args) {
|
33112
|
+
super.checkImportKey(format2, keyData, algorithm, extractable, keyUsages);
|
33127
33113
|
if (extractable) {
|
33128
33114
|
throw new SyntaxError("extractable: Must be 'false'");
|
33129
33115
|
}
|
@@ -33149,8 +33135,8 @@ var HkdfProvider = class extends ProviderCrypto {
|
|
33149
33135
|
throw new TypeError("salt: Is not of type '(ArrayBuffer or ArrayBufferView)'");
|
33150
33136
|
}
|
33151
33137
|
}
|
33152
|
-
checkImportKey(
|
33153
|
-
super.checkImportKey(
|
33138
|
+
checkImportKey(format2, keyData, algorithm, extractable, keyUsages, ...args) {
|
33139
|
+
super.checkImportKey(format2, keyData, algorithm, extractable, keyUsages);
|
33154
33140
|
if (extractable) {
|
33155
33141
|
throw new SyntaxError("extractable: Must be 'false'");
|
33156
33142
|
}
|
@@ -33349,34 +33335,34 @@ var SubtleCrypto = class {
|
|
33349
33335
|
exportKey(...args) {
|
33350
33336
|
return __async(this, null, function* () {
|
33351
33337
|
this.checkRequiredArguments(args, 2, "exportKey");
|
33352
|
-
const [
|
33338
|
+
const [format2, key2, ...params] = args;
|
33353
33339
|
this.checkCryptoKey(key2);
|
33354
33340
|
const provider = this.getProvider(key2.algorithm.name);
|
33355
|
-
const result = yield provider.exportKey(
|
33341
|
+
const result = yield provider.exportKey(format2, key2, ...params);
|
33356
33342
|
return result;
|
33357
33343
|
});
|
33358
33344
|
}
|
33359
33345
|
importKey(...args) {
|
33360
33346
|
return __async(this, null, function* () {
|
33361
33347
|
this.checkRequiredArguments(args, 5, "importKey");
|
33362
|
-
const [
|
33348
|
+
const [format2, keyData, algorithm, extractable, keyUsages, ...params] = args;
|
33363
33349
|
const preparedAlgorithm = this.prepareAlgorithm(algorithm);
|
33364
33350
|
const provider = this.getProvider(preparedAlgorithm.name);
|
33365
|
-
if (["pkcs8", "spki", "raw"].indexOf(
|
33351
|
+
if (["pkcs8", "spki", "raw"].indexOf(format2) !== -1) {
|
33366
33352
|
const preparedData = import_pvtsutils4.BufferSourceConverter.toArrayBuffer(keyData);
|
33367
|
-
return provider.importKey(
|
33353
|
+
return provider.importKey(format2, preparedData, __spreadProps(__spreadValues({}, preparedAlgorithm), { name: provider.name }), extractable, keyUsages, ...params);
|
33368
33354
|
} else {
|
33369
33355
|
if (!keyData.kty) {
|
33370
33356
|
throw new TypeError("keyData: Is not JSON");
|
33371
33357
|
}
|
33372
33358
|
}
|
33373
|
-
return provider.importKey(
|
33359
|
+
return provider.importKey(format2, keyData, __spreadProps(__spreadValues({}, preparedAlgorithm), { name: provider.name }), extractable, keyUsages, ...params);
|
33374
33360
|
});
|
33375
33361
|
}
|
33376
|
-
wrapKey(
|
33362
|
+
wrapKey(format2, key2, wrappingKey, wrapAlgorithm, ...args) {
|
33377
33363
|
return __async(this, null, function* () {
|
33378
|
-
let keyData = yield this.exportKey(
|
33379
|
-
if (
|
33364
|
+
let keyData = yield this.exportKey(format2, key2, ...args);
|
33365
|
+
if (format2 === "jwk") {
|
33380
33366
|
const json = JSON.stringify(keyData);
|
33381
33367
|
keyData = import_pvtsutils4.Convert.FromUtf8String(json);
|
33382
33368
|
}
|
@@ -33386,13 +33372,13 @@ var SubtleCrypto = class {
|
|
33386
33372
|
return provider.encrypt(__spreadProps(__spreadValues({}, preparedAlgorithm), { name: provider.name }), wrappingKey, preparedData, { keyUsage: false }, ...args);
|
33387
33373
|
});
|
33388
33374
|
}
|
33389
|
-
unwrapKey(
|
33375
|
+
unwrapKey(format2, wrappedKey, unwrappingKey, unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages, ...args) {
|
33390
33376
|
return __async(this, null, function* () {
|
33391
33377
|
const preparedAlgorithm = this.prepareAlgorithm(unwrapAlgorithm);
|
33392
33378
|
const preparedData = import_pvtsutils4.BufferSourceConverter.toArrayBuffer(wrappedKey);
|
33393
33379
|
const provider = this.getProvider(preparedAlgorithm.name);
|
33394
33380
|
let keyData = yield provider.decrypt(__spreadProps(__spreadValues({}, preparedAlgorithm), { name: provider.name }), unwrappingKey, preparedData, { keyUsage: false }, ...args);
|
33395
|
-
if (
|
33381
|
+
if (format2 === "jwk") {
|
33396
33382
|
try {
|
33397
33383
|
keyData = JSON.parse(import_pvtsutils4.Convert.ToUtf8String(keyData));
|
33398
33384
|
} catch (e) {
|
@@ -33401,7 +33387,7 @@ var SubtleCrypto = class {
|
|
33401
33387
|
throw error;
|
33402
33388
|
}
|
33403
33389
|
}
|
33404
|
-
return this.importKey(
|
33390
|
+
return this.importKey(format2, keyData, unwrappedKeyAlgorithm, extractable, keyUsages, ...args);
|
33405
33391
|
});
|
33406
33392
|
}
|
33407
33393
|
checkRequiredArguments(args, size, methodName) {
|
@@ -33535,12 +33521,12 @@ var AesCrypto = class {
|
|
33535
33521
|
return key2;
|
33536
33522
|
});
|
33537
33523
|
}
|
33538
|
-
static exportKey(
|
33524
|
+
static exportKey(format2, key2) {
|
33539
33525
|
return __async(this, null, function* () {
|
33540
33526
|
if (!(key2 instanceof AesCryptoKey)) {
|
33541
33527
|
throw new Error("key: Is not AesCryptoKey");
|
33542
33528
|
}
|
33543
|
-
switch (
|
33529
|
+
switch (format2.toLowerCase()) {
|
33544
33530
|
case "jwk":
|
33545
33531
|
return JsonSerializer.toJSON(key2);
|
33546
33532
|
case "raw":
|
@@ -33550,10 +33536,10 @@ var AesCrypto = class {
|
|
33550
33536
|
}
|
33551
33537
|
});
|
33552
33538
|
}
|
33553
|
-
static importKey(
|
33539
|
+
static importKey(format2, keyData, algorithm, extractable, keyUsages) {
|
33554
33540
|
return __async(this, null, function* () {
|
33555
33541
|
let key2;
|
33556
|
-
switch (
|
33542
|
+
switch (format2.toLowerCase()) {
|
33557
33543
|
case "jwk":
|
33558
33544
|
key2 = JsonParser.fromJSON(keyData, { targetSchema: AesCryptoKey });
|
33559
33545
|
break;
|
@@ -33737,14 +33723,14 @@ var AesCbcProvider2 = class extends AesCbcProvider {
|
|
33737
33723
|
return AesCrypto.decrypt(algorithm, getCryptoKey(key2), new Uint8Array(data));
|
33738
33724
|
});
|
33739
33725
|
}
|
33740
|
-
onExportKey(
|
33726
|
+
onExportKey(format2, key2) {
|
33741
33727
|
return __async(this, null, function* () {
|
33742
|
-
return AesCrypto.exportKey(
|
33728
|
+
return AesCrypto.exportKey(format2, getCryptoKey(key2));
|
33743
33729
|
});
|
33744
33730
|
}
|
33745
|
-
onImportKey(
|
33731
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
33746
33732
|
return __async(this, null, function* () {
|
33747
|
-
const key2 = yield AesCrypto.importKey(
|
33733
|
+
const key2 = yield AesCrypto.importKey(format2, keyData, { name: algorithm.name }, extractable, keyUsages);
|
33748
33734
|
return setCryptoKey(key2);
|
33749
33735
|
});
|
33750
33736
|
}
|
@@ -33868,14 +33854,14 @@ var AesCmacProvider2 = class extends AesCmacProvider {
|
|
33868
33854
|
return Buffer.from(signature2).compare(Buffer.from(signature22)) === 0;
|
33869
33855
|
});
|
33870
33856
|
}
|
33871
|
-
onExportKey(
|
33857
|
+
onExportKey(format2, key2) {
|
33872
33858
|
return __async(this, null, function* () {
|
33873
|
-
return AesCrypto.exportKey(
|
33859
|
+
return AesCrypto.exportKey(format2, getCryptoKey(key2));
|
33874
33860
|
});
|
33875
33861
|
}
|
33876
|
-
onImportKey(
|
33862
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
33877
33863
|
return __async(this, null, function* () {
|
33878
|
-
const res = yield AesCrypto.importKey(
|
33864
|
+
const res = yield AesCrypto.importKey(format2, keyData, { name: algorithm.name }, extractable, keyUsages);
|
33879
33865
|
return setCryptoKey(res);
|
33880
33866
|
});
|
33881
33867
|
}
|
@@ -33907,14 +33893,14 @@ var AesCtrProvider2 = class extends AesCtrProvider {
|
|
33907
33893
|
return AesCrypto.decrypt(algorithm, getCryptoKey(key2), new Uint8Array(data));
|
33908
33894
|
});
|
33909
33895
|
}
|
33910
|
-
onExportKey(
|
33896
|
+
onExportKey(format2, key2) {
|
33911
33897
|
return __async(this, null, function* () {
|
33912
|
-
return AesCrypto.exportKey(
|
33898
|
+
return AesCrypto.exportKey(format2, getCryptoKey(key2));
|
33913
33899
|
});
|
33914
33900
|
}
|
33915
|
-
onImportKey(
|
33901
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
33916
33902
|
return __async(this, null, function* () {
|
33917
|
-
const res = yield AesCrypto.importKey(
|
33903
|
+
const res = yield AesCrypto.importKey(format2, keyData, { name: algorithm.name }, extractable, keyUsages);
|
33918
33904
|
return setCryptoKey(res);
|
33919
33905
|
});
|
33920
33906
|
}
|
@@ -33946,14 +33932,14 @@ var AesGcmProvider2 = class extends AesGcmProvider {
|
|
33946
33932
|
return AesCrypto.decrypt(algorithm, getCryptoKey(key2), new Uint8Array(data));
|
33947
33933
|
});
|
33948
33934
|
}
|
33949
|
-
onExportKey(
|
33935
|
+
onExportKey(format2, key2) {
|
33950
33936
|
return __async(this, null, function* () {
|
33951
|
-
return AesCrypto.exportKey(
|
33937
|
+
return AesCrypto.exportKey(format2, getCryptoKey(key2));
|
33952
33938
|
});
|
33953
33939
|
}
|
33954
|
-
onImportKey(
|
33940
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
33955
33941
|
return __async(this, null, function* () {
|
33956
|
-
const res = yield AesCrypto.importKey(
|
33942
|
+
const res = yield AesCrypto.importKey(format2, keyData, { name: algorithm.name }, extractable, keyUsages);
|
33957
33943
|
return setCryptoKey(res);
|
33958
33944
|
});
|
33959
33945
|
}
|
@@ -33975,14 +33961,14 @@ var AesKwProvider2 = class extends AesKwProvider {
|
|
33975
33961
|
return setCryptoKey(res);
|
33976
33962
|
});
|
33977
33963
|
}
|
33978
|
-
onExportKey(
|
33964
|
+
onExportKey(format2, key2) {
|
33979
33965
|
return __async(this, null, function* () {
|
33980
|
-
return AesCrypto.exportKey(
|
33966
|
+
return AesCrypto.exportKey(format2, getCryptoKey(key2));
|
33981
33967
|
});
|
33982
33968
|
}
|
33983
|
-
onImportKey(
|
33969
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
33984
33970
|
return __async(this, null, function* () {
|
33985
|
-
const res = yield AesCrypto.importKey(
|
33971
|
+
const res = yield AesCrypto.importKey(format2, keyData, { name: algorithm.name }, extractable, keyUsages);
|
33986
33972
|
return setCryptoKey(res);
|
33987
33973
|
});
|
33988
33974
|
}
|
@@ -34024,14 +34010,14 @@ var AesEcbProvider2 = class extends AesEcbProvider {
|
|
34024
34010
|
return AesCrypto.decrypt(algorithm, getCryptoKey(key2), new Uint8Array(data));
|
34025
34011
|
});
|
34026
34012
|
}
|
34027
|
-
onExportKey(
|
34013
|
+
onExportKey(format2, key2) {
|
34028
34014
|
return __async(this, null, function* () {
|
34029
|
-
return AesCrypto.exportKey(
|
34015
|
+
return AesCrypto.exportKey(format2, getCryptoKey(key2));
|
34030
34016
|
});
|
34031
34017
|
}
|
34032
|
-
onImportKey(
|
34018
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34033
34019
|
return __async(this, null, function* () {
|
34034
|
-
const res = yield AesCrypto.importKey(
|
34020
|
+
const res = yield AesCrypto.importKey(format2, keyData, { name: algorithm.name }, extractable, keyUsages);
|
34035
34021
|
return setCryptoKey(res);
|
34036
34022
|
});
|
34037
34023
|
}
|
@@ -34072,9 +34058,9 @@ var DesCrypto = class {
|
|
34072
34058
|
return key2;
|
34073
34059
|
});
|
34074
34060
|
}
|
34075
|
-
static exportKey(
|
34061
|
+
static exportKey(format2, key2) {
|
34076
34062
|
return __async(this, null, function* () {
|
34077
|
-
switch (
|
34063
|
+
switch (format2.toLowerCase()) {
|
34078
34064
|
case "jwk":
|
34079
34065
|
return JsonSerializer.toJSON(key2);
|
34080
34066
|
case "raw":
|
@@ -34084,10 +34070,10 @@ var DesCrypto = class {
|
|
34084
34070
|
}
|
34085
34071
|
});
|
34086
34072
|
}
|
34087
|
-
static importKey(
|
34073
|
+
static importKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34088
34074
|
return __async(this, null, function* () {
|
34089
34075
|
let key2;
|
34090
|
-
switch (
|
34076
|
+
switch (format2.toLowerCase()) {
|
34091
34077
|
case "jwk":
|
34092
34078
|
key2 = JsonParser.fromJSON(keyData, { targetSchema: DesCryptoKey });
|
34093
34079
|
break;
|
@@ -34193,14 +34179,14 @@ var DesCbcProvider = class extends DesProvider {
|
|
34193
34179
|
return DesCrypto.decrypt(algorithm, getCryptoKey(key2), new Uint8Array(data));
|
34194
34180
|
});
|
34195
34181
|
}
|
34196
|
-
onExportKey(
|
34182
|
+
onExportKey(format2, key2) {
|
34197
34183
|
return __async(this, null, function* () {
|
34198
|
-
return DesCrypto.exportKey(
|
34184
|
+
return DesCrypto.exportKey(format2, getCryptoKey(key2));
|
34199
34185
|
});
|
34200
34186
|
}
|
34201
|
-
onImportKey(
|
34187
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34202
34188
|
return __async(this, null, function* () {
|
34203
|
-
const key2 = yield DesCrypto.importKey(
|
34189
|
+
const key2 = yield DesCrypto.importKey(format2, keyData, { name: this.name, length: this.keySizeBits }, extractable, keyUsages);
|
34204
34190
|
if (key2.data.length !== this.keySizeBits >> 3) {
|
34205
34191
|
throw new OperationError("keyData: Wrong key size");
|
34206
34192
|
}
|
@@ -34241,14 +34227,14 @@ var DesEde3CbcProvider = class extends DesProvider {
|
|
34241
34227
|
return DesCrypto.decrypt(algorithm, getCryptoKey(key2), new Uint8Array(data));
|
34242
34228
|
});
|
34243
34229
|
}
|
34244
|
-
onExportKey(
|
34230
|
+
onExportKey(format2, key2) {
|
34245
34231
|
return __async(this, null, function* () {
|
34246
|
-
return DesCrypto.exportKey(
|
34232
|
+
return DesCrypto.exportKey(format2, getCryptoKey(key2));
|
34247
34233
|
});
|
34248
34234
|
}
|
34249
|
-
onImportKey(
|
34235
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34250
34236
|
return __async(this, null, function* () {
|
34251
|
-
const key2 = yield DesCrypto.importKey(
|
34237
|
+
const key2 = yield DesCrypto.importKey(format2, keyData, { name: this.name, length: this.keySizeBits }, extractable, keyUsages);
|
34252
34238
|
if (key2.data.length !== this.keySizeBits >> 3) {
|
34253
34239
|
throw new OperationError("keyData: Wrong key size");
|
34254
34240
|
}
|
@@ -34374,9 +34360,9 @@ var RsaCrypto = class {
|
|
34374
34360
|
return res;
|
34375
34361
|
});
|
34376
34362
|
}
|
34377
|
-
static exportKey(
|
34363
|
+
static exportKey(format2, key2) {
|
34378
34364
|
return __async(this, null, function* () {
|
34379
|
-
switch (
|
34365
|
+
switch (format2.toLowerCase()) {
|
34380
34366
|
case "jwk":
|
34381
34367
|
return JsonSerializer.toJSON(key2);
|
34382
34368
|
case "pkcs8":
|
@@ -34387,9 +34373,9 @@ var RsaCrypto = class {
|
|
34387
34373
|
}
|
34388
34374
|
});
|
34389
34375
|
}
|
34390
|
-
static importKey(
|
34376
|
+
static importKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34391
34377
|
return __async(this, null, function* () {
|
34392
|
-
switch (
|
34378
|
+
switch (format2.toLowerCase()) {
|
34393
34379
|
case "jwk": {
|
34394
34380
|
const jwk = keyData;
|
34395
34381
|
if (jwk.d) {
|
@@ -34605,14 +34591,14 @@ var RsaSsaProvider2 = class extends RsaSsaProvider {
|
|
34605
34591
|
return RsaCrypto.verify(algorithm, getCryptoKey(key2), new Uint8Array(signature2), new Uint8Array(data));
|
34606
34592
|
});
|
34607
34593
|
}
|
34608
|
-
onExportKey(
|
34594
|
+
onExportKey(format2, key2) {
|
34609
34595
|
return __async(this, null, function* () {
|
34610
|
-
return RsaCrypto.exportKey(
|
34596
|
+
return RsaCrypto.exportKey(format2, getCryptoKey(key2));
|
34611
34597
|
});
|
34612
34598
|
}
|
34613
|
-
onImportKey(
|
34599
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34614
34600
|
return __async(this, null, function* () {
|
34615
|
-
const key2 = yield RsaCrypto.importKey(
|
34601
|
+
const key2 = yield RsaCrypto.importKey(format2, keyData, __spreadProps(__spreadValues({}, algorithm), { name: this.name }), extractable, keyUsages);
|
34616
34602
|
return setCryptoKey(key2);
|
34617
34603
|
});
|
34618
34604
|
}
|
@@ -34661,14 +34647,14 @@ var RsaPssProvider2 = class extends RsaPssProvider {
|
|
34661
34647
|
return RsaCrypto.verify(algorithm, getCryptoKey(key2), new Uint8Array(signature2), new Uint8Array(data));
|
34662
34648
|
});
|
34663
34649
|
}
|
34664
|
-
onExportKey(
|
34650
|
+
onExportKey(format2, key2) {
|
34665
34651
|
return __async(this, null, function* () {
|
34666
|
-
return RsaCrypto.exportKey(
|
34652
|
+
return RsaCrypto.exportKey(format2, getCryptoKey(key2));
|
34667
34653
|
});
|
34668
34654
|
}
|
34669
|
-
onImportKey(
|
34655
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34670
34656
|
return __async(this, null, function* () {
|
34671
|
-
const key2 = yield RsaCrypto.importKey(
|
34657
|
+
const key2 = yield RsaCrypto.importKey(format2, keyData, __spreadProps(__spreadValues({}, algorithm), { name: this.name }), extractable, keyUsages);
|
34672
34658
|
return setCryptoKey(key2);
|
34673
34659
|
});
|
34674
34660
|
}
|
@@ -34832,14 +34818,14 @@ ${internalKey.data.toString("base64")}
|
|
34832
34818
|
return new Uint8Array(pkcs0).buffer;
|
34833
34819
|
});
|
34834
34820
|
}
|
34835
|
-
onExportKey(
|
34821
|
+
onExportKey(format2, key2) {
|
34836
34822
|
return __async(this, null, function* () {
|
34837
|
-
return RsaCrypto.exportKey(
|
34823
|
+
return RsaCrypto.exportKey(format2, getCryptoKey(key2));
|
34838
34824
|
});
|
34839
34825
|
}
|
34840
|
-
onImportKey(
|
34826
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34841
34827
|
return __async(this, null, function* () {
|
34842
|
-
const key2 = yield RsaCrypto.importKey(
|
34828
|
+
const key2 = yield RsaCrypto.importKey(format2, keyData, __spreadProps(__spreadValues({}, algorithm), { name: this.name }), extractable, keyUsages);
|
34843
34829
|
return setCryptoKey(key2);
|
34844
34830
|
});
|
34845
34831
|
}
|
@@ -34924,14 +34910,14 @@ var RsaEsProvider = class extends ProviderCrypto {
|
|
34924
34910
|
return new Uint8Array(dec).buffer;
|
34925
34911
|
});
|
34926
34912
|
}
|
34927
|
-
onExportKey(
|
34913
|
+
onExportKey(format2, key2) {
|
34928
34914
|
return __async(this, null, function* () {
|
34929
|
-
return RsaCrypto.exportKey(
|
34915
|
+
return RsaCrypto.exportKey(format2, getCryptoKey(key2));
|
34930
34916
|
});
|
34931
34917
|
}
|
34932
|
-
onImportKey(
|
34918
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
34933
34919
|
return __async(this, null, function* () {
|
34934
|
-
const key2 = yield RsaCrypto.importKey(
|
34920
|
+
const key2 = yield RsaCrypto.importKey(format2, keyData, __spreadProps(__spreadValues({}, algorithm), { name: this.name }), extractable, keyUsages);
|
34935
34921
|
return setCryptoKey(key2);
|
34936
34922
|
});
|
34937
34923
|
}
|
@@ -35241,9 +35227,9 @@ ${key2.data.toString("base64")}
|
|
35241
35227
|
return new Uint8Array(bits).buffer.slice(0, length2 >> 3);
|
35242
35228
|
});
|
35243
35229
|
}
|
35244
|
-
static exportKey(
|
35230
|
+
static exportKey(format2, key2) {
|
35245
35231
|
return __async(this, null, function* () {
|
35246
|
-
switch (
|
35232
|
+
switch (format2.toLowerCase()) {
|
35247
35233
|
case "jwk":
|
35248
35234
|
return JsonSerializer.toJSON(key2);
|
35249
35235
|
case "pkcs8":
|
@@ -35258,9 +35244,9 @@ ${key2.data.toString("base64")}
|
|
35258
35244
|
}
|
35259
35245
|
});
|
35260
35246
|
}
|
35261
|
-
static importKey(
|
35247
|
+
static importKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35262
35248
|
return __async(this, null, function* () {
|
35263
|
-
switch (
|
35249
|
+
switch (format2.toLowerCase()) {
|
35264
35250
|
case "jwk": {
|
35265
35251
|
const jwk = keyData;
|
35266
35252
|
if (jwk.d) {
|
@@ -35390,14 +35376,14 @@ var EcdsaProvider2 = class extends EcdsaProvider {
|
|
35390
35376
|
return EcCrypto.verify(algorithm, getCryptoKey(key2), new Uint8Array(signature2), new Uint8Array(data));
|
35391
35377
|
});
|
35392
35378
|
}
|
35393
|
-
onExportKey(
|
35379
|
+
onExportKey(format2, key2) {
|
35394
35380
|
return __async(this, null, function* () {
|
35395
|
-
return EcCrypto.exportKey(
|
35381
|
+
return EcCrypto.exportKey(format2, getCryptoKey(key2));
|
35396
35382
|
});
|
35397
35383
|
}
|
35398
|
-
onImportKey(
|
35384
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35399
35385
|
return __async(this, null, function* () {
|
35400
|
-
const key2 = yield EcCrypto.importKey(
|
35386
|
+
const key2 = yield EcCrypto.importKey(format2, keyData, __spreadProps(__spreadValues({}, algorithm), { name: this.name }), extractable, keyUsages);
|
35401
35387
|
return setCryptoKey(key2);
|
35402
35388
|
});
|
35403
35389
|
}
|
@@ -35426,14 +35412,14 @@ var EcdhProvider2 = class extends EcdhProvider {
|
|
35426
35412
|
};
|
35427
35413
|
});
|
35428
35414
|
}
|
35429
|
-
onExportKey(
|
35415
|
+
onExportKey(format2, key2) {
|
35430
35416
|
return __async(this, null, function* () {
|
35431
|
-
return EcCrypto.exportKey(
|
35417
|
+
return EcCrypto.exportKey(format2, getCryptoKey(key2));
|
35432
35418
|
});
|
35433
35419
|
}
|
35434
|
-
onImportKey(
|
35420
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35435
35421
|
return __async(this, null, function* () {
|
35436
|
-
const key2 = yield EcCrypto.importKey(
|
35422
|
+
const key2 = yield EcCrypto.importKey(format2, keyData, __spreadProps(__spreadValues({}, algorithm), { name: this.name }), extractable, keyUsages);
|
35437
35423
|
return setCryptoKey(key2);
|
35438
35424
|
});
|
35439
35425
|
}
|
@@ -35616,9 +35602,9 @@ ${key2.data.toString("base64")}
|
|
35616
35602
|
return new Uint8Array(bits).buffer.slice(0, length2 >> 3);
|
35617
35603
|
});
|
35618
35604
|
}
|
35619
|
-
static exportKey(
|
35605
|
+
static exportKey(format2, key2) {
|
35620
35606
|
return __async(this, null, function* () {
|
35621
|
-
switch (
|
35607
|
+
switch (format2.toLowerCase()) {
|
35622
35608
|
case "jwk":
|
35623
35609
|
return JsonSerializer.toJSON(key2);
|
35624
35610
|
case "pkcs8":
|
@@ -35633,9 +35619,9 @@ ${key2.data.toString("base64")}
|
|
35633
35619
|
}
|
35634
35620
|
});
|
35635
35621
|
}
|
35636
|
-
static importKey(
|
35622
|
+
static importKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35637
35623
|
return __async(this, null, function* () {
|
35638
|
-
switch (
|
35624
|
+
switch (format2.toLowerCase()) {
|
35639
35625
|
case "jwk": {
|
35640
35626
|
const jwk = keyData;
|
35641
35627
|
if (jwk.d) {
|
@@ -35716,14 +35702,14 @@ var EdDsaProvider2 = class extends EdDsaProvider {
|
|
35716
35702
|
return EdCrypto.verify(algorithm, getCryptoKey(key2), new Uint8Array(signature2), new Uint8Array(data));
|
35717
35703
|
});
|
35718
35704
|
}
|
35719
|
-
onExportKey(
|
35705
|
+
onExportKey(format2, key2) {
|
35720
35706
|
return __async(this, null, function* () {
|
35721
|
-
return EdCrypto.exportKey(
|
35707
|
+
return EdCrypto.exportKey(format2, getCryptoKey(key2));
|
35722
35708
|
});
|
35723
35709
|
}
|
35724
|
-
onImportKey(
|
35710
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35725
35711
|
return __async(this, null, function* () {
|
35726
|
-
const key2 = yield EdCrypto.importKey(
|
35712
|
+
const key2 = yield EdCrypto.importKey(format2, keyData, __spreadProps(__spreadValues({}, algorithm), { name: this.name }), extractable, keyUsages);
|
35727
35713
|
return setCryptoKey(key2);
|
35728
35714
|
});
|
35729
35715
|
}
|
@@ -35748,14 +35734,14 @@ var EcdhEsProvider2 = class extends EcdhEsProvider {
|
|
35748
35734
|
return bits;
|
35749
35735
|
});
|
35750
35736
|
}
|
35751
|
-
onExportKey(
|
35737
|
+
onExportKey(format2, key2) {
|
35752
35738
|
return __async(this, null, function* () {
|
35753
|
-
return EdCrypto.exportKey(
|
35739
|
+
return EdCrypto.exportKey(format2, getCryptoKey(key2));
|
35754
35740
|
});
|
35755
35741
|
}
|
35756
|
-
onImportKey(
|
35742
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35757
35743
|
return __async(this, null, function* () {
|
35758
|
-
const key2 = yield EdCrypto.importKey(
|
35744
|
+
const key2 = yield EdCrypto.importKey(format2, keyData, __spreadProps(__spreadValues({}, algorithm), { name: this.name }), extractable, keyUsages);
|
35759
35745
|
return setCryptoKey(key2);
|
35760
35746
|
});
|
35761
35747
|
}
|
@@ -35780,9 +35766,9 @@ var Pbkdf2Provider2 = class extends Pbkdf2Provider {
|
|
35780
35766
|
});
|
35781
35767
|
});
|
35782
35768
|
}
|
35783
|
-
onImportKey(
|
35769
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35784
35770
|
return __async(this, null, function* () {
|
35785
|
-
if (
|
35771
|
+
if (format2 === "raw") {
|
35786
35772
|
const key2 = new PbkdfCryptoKey();
|
35787
35773
|
key2.data = Buffer.from(keyData);
|
35788
35774
|
key2.algorithm = { name: this.name };
|
@@ -35842,10 +35828,10 @@ var HmacProvider2 = class extends HmacProvider {
|
|
35842
35828
|
return hmac2.compare(Buffer.from(signature2)) === 0;
|
35843
35829
|
});
|
35844
35830
|
}
|
35845
|
-
onImportKey(
|
35831
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35846
35832
|
return __async(this, null, function* () {
|
35847
35833
|
let key2;
|
35848
|
-
switch (
|
35834
|
+
switch (format2.toLowerCase()) {
|
35849
35835
|
case "jwk":
|
35850
35836
|
key2 = JsonParser.fromJSON(keyData, { targetSchema: HmacCryptoKey });
|
35851
35837
|
break;
|
@@ -35866,9 +35852,9 @@ var HmacProvider2 = class extends HmacProvider {
|
|
35866
35852
|
return setCryptoKey(key2);
|
35867
35853
|
});
|
35868
35854
|
}
|
35869
|
-
onExportKey(
|
35855
|
+
onExportKey(format2, key2) {
|
35870
35856
|
return __async(this, null, function* () {
|
35871
|
-
switch (
|
35857
|
+
switch (format2.toLowerCase()) {
|
35872
35858
|
case "jwk":
|
35873
35859
|
return JsonSerializer.toJSON(getCryptoKey(key2));
|
35874
35860
|
case "raw":
|
@@ -35890,9 +35876,9 @@ var HkdfCryptoKey = class extends CryptoKey2 {
|
|
35890
35876
|
};
|
35891
35877
|
__name(HkdfCryptoKey, "HkdfCryptoKey");
|
35892
35878
|
var HkdfProvider2 = class extends HkdfProvider {
|
35893
|
-
onImportKey(
|
35879
|
+
onImportKey(format2, keyData, algorithm, extractable, keyUsages) {
|
35894
35880
|
return __async(this, null, function* () {
|
35895
|
-
if (
|
35881
|
+
if (format2.toLowerCase() !== "raw") {
|
35896
35882
|
throw new OperationError("Operation not supported");
|
35897
35883
|
}
|
35898
35884
|
const key2 = new HkdfCryptoKey();
|
@@ -36023,7 +36009,6 @@ if (isNodejs()) {
|
|
36023
36009
|
} else {
|
36024
36010
|
crypto3 = window.crypto;
|
36025
36011
|
}
|
36026
|
-
var crypto_default = crypto3;
|
36027
36012
|
|
36028
36013
|
// src/wallet/base/wallet.ts
|
36029
36014
|
var addPluginToWallet = /* @__PURE__ */ __name((wallet, plugin) => __async(void 0, null, function* () {
|
@@ -36042,11 +36027,10 @@ var removeFromWallet = /* @__PURE__ */ __name((wallet, contentId) => __async(voi
|
|
36042
36027
|
var bindMethods = /* @__PURE__ */ __name((wallet, pluginMethods) => Object.fromEntries(Object.entries(pluginMethods).map(([key2, method]) => [key2, method.bind(wallet, wallet)])), "bindMethods");
|
36043
36028
|
var generateWallet = /* @__PURE__ */ __name((..._0) => __async(void 0, [..._0], function* (contents = [], _wallet = {}) {
|
36044
36029
|
const { plugins = [] } = _wallet;
|
36045
|
-
const
|
36046
|
-
const newPluginMethods = __spreadValues(__spreadValues({},
|
36047
|
-
|
36048
|
-
|
36049
|
-
}, { pluginMethods: {}, pluginConstants: {} });
|
36030
|
+
const pluginMethods = plugins.reduce((cumulativePluginMethods, plugin) => {
|
36031
|
+
const newPluginMethods = __spreadValues(__spreadValues({}, cumulativePluginMethods), plugin.pluginMethods);
|
36032
|
+
return newPluginMethods;
|
36033
|
+
}, {});
|
36050
36034
|
const wallet = {
|
36051
36035
|
contents: [...contents],
|
36052
36036
|
add: function(content) {
|
@@ -36058,7 +36042,6 @@ var generateWallet = /* @__PURE__ */ __name((..._0) => __async(void 0, [..._0],
|
|
36058
36042
|
status: "UNLOCKED" /* Unlocked */,
|
36059
36043
|
plugins,
|
36060
36044
|
pluginMethods,
|
36061
|
-
pluginConstants,
|
36062
36045
|
addPlugin: function(plugin) {
|
36063
36046
|
return addPluginToWallet(this, plugin);
|
36064
36047
|
}
|
@@ -39551,7 +39534,7 @@ var ChainId = /* @__PURE__ */ function() {
|
|
39551
39534
|
}
|
39552
39535
|
return new ChainId2(getParams(id, this.spec)).toJSON();
|
39553
39536
|
}, "parse");
|
39554
|
-
ChainId2.format = /* @__PURE__ */ __name(function
|
39537
|
+
ChainId2.format = /* @__PURE__ */ __name(function format2(params) {
|
39555
39538
|
return joinParams(params, this.spec);
|
39556
39539
|
}, "format");
|
39557
39540
|
var _proto = ChainId2.prototype;
|
@@ -39590,7 +39573,7 @@ var AccountId = /* @__PURE__ */ function() {
|
|
39590
39573
|
address
|
39591
39574
|
}).toJSON();
|
39592
39575
|
}, "parse");
|
39593
|
-
AccountId2.format = /* @__PURE__ */ __name(function
|
39576
|
+
AccountId2.format = /* @__PURE__ */ __name(function format2(params) {
|
39594
39577
|
var chainId = new ChainId(params.chainId);
|
39595
39578
|
var splitParams2 = _extends({}, chainId.toJSON(), {
|
39596
39579
|
address: params.address
|
@@ -39625,7 +39608,7 @@ var AssetName = /* @__PURE__ */ function() {
|
|
39625
39608
|
}
|
39626
39609
|
return new AssetName2(getParams(id, this.spec)).toJSON();
|
39627
39610
|
}, "parse");
|
39628
|
-
AssetName2.format = /* @__PURE__ */ __name(function
|
39611
|
+
AssetName2.format = /* @__PURE__ */ __name(function format2(params) {
|
39629
39612
|
return joinParams(params, this.spec);
|
39630
39613
|
}, "format");
|
39631
39614
|
var _proto = AssetName2.prototype;
|
@@ -39656,7 +39639,7 @@ var AssetType = /* @__PURE__ */ function() {
|
|
39656
39639
|
}
|
39657
39640
|
return new AssetType2(getParams(id, this.spec)).toJSON();
|
39658
39641
|
}, "parse");
|
39659
|
-
AssetType2.format = /* @__PURE__ */ __name(function
|
39642
|
+
AssetType2.format = /* @__PURE__ */ __name(function format2(params) {
|
39660
39643
|
return joinParams(params, this.spec);
|
39661
39644
|
}, "format");
|
39662
39645
|
var _proto = AssetType2.prototype;
|
@@ -39688,7 +39671,7 @@ var AssetId = /* @__PURE__ */ function() {
|
|
39688
39671
|
}
|
39689
39672
|
return new AssetId2(getParams(id, this.spec)).toJSON();
|
39690
39673
|
}, "parse");
|
39691
|
-
AssetId2.format = /* @__PURE__ */ __name(function
|
39674
|
+
AssetId2.format = /* @__PURE__ */ __name(function format2(params) {
|
39692
39675
|
return joinParams(params, this.spec);
|
39693
39676
|
}, "format");
|
39694
39677
|
var _proto = AssetId2.prototype;
|
@@ -43333,6 +43316,19 @@ var DID = class {
|
|
43333
43316
|
};
|
43334
43317
|
__name(DID, "DID");
|
43335
43318
|
|
43319
|
+
// ../../node_modules/.pnpm/hex-lite@1.5.0/node_modules/hex-lite/dist/hex-lite.mjs
|
43320
|
+
function toUint8Array(str) {
|
43321
|
+
var s = 0, sl = str.length, bytes = [];
|
43322
|
+
if (sl % 2) {
|
43323
|
+
throw new Error("invalid hex:" + str);
|
43324
|
+
}
|
43325
|
+
for (; s < sl; s += 2) {
|
43326
|
+
bytes.push(parseInt(str.substr(s, 2), 16));
|
43327
|
+
}
|
43328
|
+
return new Uint8Array(bytes);
|
43329
|
+
}
|
43330
|
+
__name(toUint8Array, "toUint8Array");
|
43331
|
+
|
43336
43332
|
// src/wallet/plugins/idx/idx.ts
|
43337
43333
|
var import_key_did_resolver = __toESM(require_lib());
|
43338
43334
|
|
@@ -48357,13 +48353,11 @@ __name(CeramicClient, "CeramicClient");
|
|
48357
48353
|
|
48358
48354
|
// src/wallet/plugins/idx/idx.ts
|
48359
48355
|
var getCeramicClientFromWalletSuite = /* @__PURE__ */ __name((wallet, ceramicEndpoint) => __async(void 0, null, function* () {
|
48360
|
-
var _a2, _b;
|
48361
48356
|
const client = new CeramicClient(ceramicEndpoint);
|
48362
48357
|
const resolver = __spreadValues({}, import_key_did_resolver.default.getResolver());
|
48363
48358
|
const did = new DID({ resolver });
|
48364
48359
|
client.did = did;
|
48365
|
-
const
|
48366
|
-
const key2 = (_b = (_a2 = contents == null ? void 0 : contents.find((c) => (c == null ? void 0 : c.name) === "DID Key Secret")) == null ? void 0 : _a2.value) != null ? _b : "";
|
48360
|
+
const key2 = wallet.pluginMethods.getKey();
|
48367
48361
|
const ceramicProvider = new Ed25519Provider(toUint8Array(key2));
|
48368
48362
|
client.did.setProvider(ceramicProvider);
|
48369
48363
|
yield client.did.authenticate();
|
@@ -48433,81 +48427,36 @@ var getIDXPlugin = /* @__PURE__ */ __name((_0, _1) => __async(void 0, [_0, _1],
|
|
48433
48427
|
addVerifiableCredentialInIdx: (_02, _12) => __async(void 0, [_02, _12], function* (_wallet, { title, id }) {
|
48434
48428
|
return addCredentialStreamIdToIndex({ title, id });
|
48435
48429
|
})
|
48436
|
-
}
|
48437
|
-
pluginConstants: {}
|
48430
|
+
}
|
48438
48431
|
};
|
48439
48432
|
}), "getIDXPlugin");
|
48440
48433
|
|
48441
|
-
// src/wallet/plugins/didkey/generateContentFromSeed.ts
|
48442
|
-
var seedToId = /* @__PURE__ */ __name((seed) => __async(void 0, null, function* () {
|
48443
|
-
const buffer2 = yield crypto_default.subtle.digest("SHA-256", seed);
|
48444
|
-
return `urn:digest:${Buffer.from(new Uint8Array(buffer2)).toString("hex")}`;
|
48445
|
-
}), "seedToId");
|
48446
|
-
var generateContentFromSeed = /* @__PURE__ */ __name((seed) => __async(void 0, null, function* () {
|
48447
|
-
const privateKeyJwk = JSON.parse(generateEd25519KeyFromBytes(seed));
|
48448
|
-
const controller = keyToDID("key", JSON.stringify(privateKeyJwk));
|
48449
|
-
const _a2 = privateKeyJwk, { d } = _a2, publicKeyJwk = __objRest(_a2, ["d"]);
|
48450
|
-
const signingKey = {
|
48451
|
-
controller,
|
48452
|
-
id: `${controller}#${controller.split(":").at(-1)}`,
|
48453
|
-
privateKeyJwk,
|
48454
|
-
publicKeyJwk,
|
48455
|
-
type: "JsonWebKey2020"
|
48456
|
-
};
|
48457
|
-
const seedId = yield seedToId(seed);
|
48458
|
-
const secret = {
|
48459
|
-
"@context": ["http://w3id.org/wallet/v1"],
|
48460
|
-
id: seedId,
|
48461
|
-
name: "DID Key Secret",
|
48462
|
-
image: "https://via.placeholder.com/150",
|
48463
|
-
description: "Used to generate a DID with a signing and encryption key.",
|
48464
|
-
tags: ["inception"],
|
48465
|
-
type: "Entropy",
|
48466
|
-
value: Buffer.from(seed).toString("hex")
|
48467
|
-
};
|
48468
|
-
const key0 = __spreadProps(__spreadValues({}, signingKey), {
|
48469
|
-
"@context": ["http://w3id.org/wallet/v1"],
|
48470
|
-
name: "Signing Key",
|
48471
|
-
image: "https://via.placeholder.com/150",
|
48472
|
-
description: "Used to produce digital signatures.",
|
48473
|
-
tags: ["inception"],
|
48474
|
-
generatedFrom: [secret.id]
|
48475
|
-
});
|
48476
|
-
return [secret, key0];
|
48477
|
-
}), "generateContentFromSeed");
|
48478
|
-
|
48479
48434
|
// src/wallet/plugins/didkey/index.ts
|
48480
|
-
var
|
48481
|
-
|
48482
|
-
|
48483
|
-
|
48484
|
-
|
48485
|
-
|
48486
|
-
|
48487
|
-
|
48488
|
-
return (_a2 = wallet.contents.find((content) => content.name === "Signing Key")) == null ? void 0 : _a2.privateKeyJwk;
|
48435
|
+
var getDidKeyPlugin = /* @__PURE__ */ __name((key2) => __async(void 0, null, function* () {
|
48436
|
+
const keypair = JSON.parse(generateEd25519KeyFromBytes(toUint8Array(key2.padStart(64, "0"))));
|
48437
|
+
const did = keyToDID("key", JSON.stringify(keypair));
|
48438
|
+
return {
|
48439
|
+
pluginMethods: {
|
48440
|
+
getSubjectDid: () => did,
|
48441
|
+
getSubjectKeypair: () => keypair,
|
48442
|
+
getKey: () => key2.padStart(64, "0")
|
48489
48443
|
}
|
48490
|
-
}
|
48491
|
-
|
48492
|
-
generateContentFromSeed
|
48493
|
-
}
|
48494
|
-
};
|
48444
|
+
};
|
48445
|
+
}), "getDidKeyPlugin");
|
48495
48446
|
|
48496
48447
|
// src/wallet/plugins/expiration/index.ts
|
48497
48448
|
var ExpirationPlugin = /* @__PURE__ */ __name((wallet) => ({
|
48498
48449
|
pluginMethods: {
|
48499
48450
|
verifyCredential: (_wallet, credential) => __async(void 0, null, function* () {
|
48500
48451
|
const verificationCheck = yield wallet.pluginMethods.verifyCredential(credential);
|
48501
|
-
if (credential.expirationDate) {
|
48452
|
+
if (credential.expirationDate && new Date() > new Date(credential.expirationDate)) {
|
48453
|
+
verificationCheck.errors.push("expiration error: Credential is expired");
|
48454
|
+
} else {
|
48502
48455
|
verificationCheck.checks.push("expiration");
|
48503
|
-
if (new Date() > new Date(credential.expirationDate)) {
|
48504
|
-
verificationCheck.errors.push("expiration error: Credential is expired");
|
48505
|
-
}
|
48506
48456
|
}
|
48507
48457
|
return verificationCheck;
|
48508
48458
|
})
|
48509
|
-
}
|
48510
|
-
pluginConstants: {}
|
48459
|
+
}
|
48511
48460
|
}), "ExpirationPlugin");
|
48512
48461
|
|
48513
48462
|
// src/wallet/plugins/vc/issueCredential.ts
|
@@ -48579,8 +48528,7 @@ var getVCPlugin = /* @__PURE__ */ __name((wallet) => __async(void 0, null, funct
|
|
48579
48528
|
credentialSubject: { id: subject }
|
48580
48529
|
};
|
48581
48530
|
}
|
48582
|
-
})
|
48583
|
-
pluginConstants: {}
|
48531
|
+
})
|
48584
48532
|
};
|
48585
48533
|
}), "getVCPlugin");
|
48586
48534
|
|
@@ -48592,7 +48540,1581 @@ var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
|
|
48592
48540
|
return VerificationStatus2;
|
48593
48541
|
})(VerificationStatus || {});
|
48594
48542
|
|
48543
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/toInteger/index.js
|
48544
|
+
function toInteger(dirtyNumber) {
|
48545
|
+
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
48546
|
+
return NaN;
|
48547
|
+
}
|
48548
|
+
var number = Number(dirtyNumber);
|
48549
|
+
if (isNaN(number)) {
|
48550
|
+
return number;
|
48551
|
+
}
|
48552
|
+
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
48553
|
+
}
|
48554
|
+
__name(toInteger, "toInteger");
|
48555
|
+
|
48556
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/requiredArgs/index.js
|
48557
|
+
function requiredArgs(required, args) {
|
48558
|
+
if (args.length < required) {
|
48559
|
+
throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
|
48560
|
+
}
|
48561
|
+
}
|
48562
|
+
__name(requiredArgs, "requiredArgs");
|
48563
|
+
|
48564
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/toDate/index.js
|
48565
|
+
function toDate(argument) {
|
48566
|
+
requiredArgs(1, arguments);
|
48567
|
+
var argStr = Object.prototype.toString.call(argument);
|
48568
|
+
if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
|
48569
|
+
return new Date(argument.getTime());
|
48570
|
+
} else if (typeof argument === "number" || argStr === "[object Number]") {
|
48571
|
+
return new Date(argument);
|
48572
|
+
} else {
|
48573
|
+
if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
|
48574
|
+
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule");
|
48575
|
+
console.warn(new Error().stack);
|
48576
|
+
}
|
48577
|
+
return new Date(NaN);
|
48578
|
+
}
|
48579
|
+
}
|
48580
|
+
__name(toDate, "toDate");
|
48581
|
+
|
48582
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/addMilliseconds/index.js
|
48583
|
+
function addMilliseconds(dirtyDate, dirtyAmount) {
|
48584
|
+
requiredArgs(2, arguments);
|
48585
|
+
var timestamp = toDate(dirtyDate).getTime();
|
48586
|
+
var amount = toInteger(dirtyAmount);
|
48587
|
+
return new Date(timestamp + amount);
|
48588
|
+
}
|
48589
|
+
__name(addMilliseconds, "addMilliseconds");
|
48590
|
+
|
48591
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js
|
48592
|
+
function getTimezoneOffsetInMilliseconds(date) {
|
48593
|
+
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
48594
|
+
utcDate.setUTCFullYear(date.getFullYear());
|
48595
|
+
return date.getTime() - utcDate.getTime();
|
48596
|
+
}
|
48597
|
+
__name(getTimezoneOffsetInMilliseconds, "getTimezoneOffsetInMilliseconds");
|
48598
|
+
|
48599
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/isDate/index.js
|
48600
|
+
function isDate(value) {
|
48601
|
+
requiredArgs(1, arguments);
|
48602
|
+
return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
|
48603
|
+
}
|
48604
|
+
__name(isDate, "isDate");
|
48605
|
+
|
48606
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/isValid/index.js
|
48607
|
+
function isValid(dirtyDate) {
|
48608
|
+
requiredArgs(1, arguments);
|
48609
|
+
if (!isDate(dirtyDate) && typeof dirtyDate !== "number") {
|
48610
|
+
return false;
|
48611
|
+
}
|
48612
|
+
var date = toDate(dirtyDate);
|
48613
|
+
return !isNaN(Number(date));
|
48614
|
+
}
|
48615
|
+
__name(isValid, "isValid");
|
48616
|
+
|
48617
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js
|
48618
|
+
var formatDistanceLocale = {
|
48619
|
+
lessThanXSeconds: {
|
48620
|
+
one: "less than a second",
|
48621
|
+
other: "less than {{count}} seconds"
|
48622
|
+
},
|
48623
|
+
xSeconds: {
|
48624
|
+
one: "1 second",
|
48625
|
+
other: "{{count}} seconds"
|
48626
|
+
},
|
48627
|
+
halfAMinute: "half a minute",
|
48628
|
+
lessThanXMinutes: {
|
48629
|
+
one: "less than a minute",
|
48630
|
+
other: "less than {{count}} minutes"
|
48631
|
+
},
|
48632
|
+
xMinutes: {
|
48633
|
+
one: "1 minute",
|
48634
|
+
other: "{{count}} minutes"
|
48635
|
+
},
|
48636
|
+
aboutXHours: {
|
48637
|
+
one: "about 1 hour",
|
48638
|
+
other: "about {{count}} hours"
|
48639
|
+
},
|
48640
|
+
xHours: {
|
48641
|
+
one: "1 hour",
|
48642
|
+
other: "{{count}} hours"
|
48643
|
+
},
|
48644
|
+
xDays: {
|
48645
|
+
one: "1 day",
|
48646
|
+
other: "{{count}} days"
|
48647
|
+
},
|
48648
|
+
aboutXWeeks: {
|
48649
|
+
one: "about 1 week",
|
48650
|
+
other: "about {{count}} weeks"
|
48651
|
+
},
|
48652
|
+
xWeeks: {
|
48653
|
+
one: "1 week",
|
48654
|
+
other: "{{count}} weeks"
|
48655
|
+
},
|
48656
|
+
aboutXMonths: {
|
48657
|
+
one: "about 1 month",
|
48658
|
+
other: "about {{count}} months"
|
48659
|
+
},
|
48660
|
+
xMonths: {
|
48661
|
+
one: "1 month",
|
48662
|
+
other: "{{count}} months"
|
48663
|
+
},
|
48664
|
+
aboutXYears: {
|
48665
|
+
one: "about 1 year",
|
48666
|
+
other: "about {{count}} years"
|
48667
|
+
},
|
48668
|
+
xYears: {
|
48669
|
+
one: "1 year",
|
48670
|
+
other: "{{count}} years"
|
48671
|
+
},
|
48672
|
+
overXYears: {
|
48673
|
+
one: "over 1 year",
|
48674
|
+
other: "over {{count}} years"
|
48675
|
+
},
|
48676
|
+
almostXYears: {
|
48677
|
+
one: "almost 1 year",
|
48678
|
+
other: "almost {{count}} years"
|
48679
|
+
}
|
48680
|
+
};
|
48681
|
+
var formatDistance = /* @__PURE__ */ __name(function(token, count, options) {
|
48682
|
+
var result;
|
48683
|
+
var tokenValue = formatDistanceLocale[token];
|
48684
|
+
if (typeof tokenValue === "string") {
|
48685
|
+
result = tokenValue;
|
48686
|
+
} else if (count === 1) {
|
48687
|
+
result = tokenValue.one;
|
48688
|
+
} else {
|
48689
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
48690
|
+
}
|
48691
|
+
if (options !== null && options !== void 0 && options.addSuffix) {
|
48692
|
+
if (options.comparison && options.comparison > 0) {
|
48693
|
+
return "in " + result;
|
48694
|
+
} else {
|
48695
|
+
return result + " ago";
|
48696
|
+
}
|
48697
|
+
}
|
48698
|
+
return result;
|
48699
|
+
}, "formatDistance");
|
48700
|
+
var formatDistance_default = formatDistance;
|
48701
|
+
|
48702
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js
|
48703
|
+
function buildFormatLongFn(args) {
|
48704
|
+
return function() {
|
48705
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
48706
|
+
var width = options.width ? String(options.width) : args.defaultWidth;
|
48707
|
+
var format2 = args.formats[width] || args.formats[args.defaultWidth];
|
48708
|
+
return format2;
|
48709
|
+
};
|
48710
|
+
}
|
48711
|
+
__name(buildFormatLongFn, "buildFormatLongFn");
|
48712
|
+
|
48713
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js
|
48714
|
+
var dateFormats = {
|
48715
|
+
full: "EEEE, MMMM do, y",
|
48716
|
+
long: "MMMM do, y",
|
48717
|
+
medium: "MMM d, y",
|
48718
|
+
short: "MM/dd/yyyy"
|
48719
|
+
};
|
48720
|
+
var timeFormats = {
|
48721
|
+
full: "h:mm:ss a zzzz",
|
48722
|
+
long: "h:mm:ss a z",
|
48723
|
+
medium: "h:mm:ss a",
|
48724
|
+
short: "h:mm a"
|
48725
|
+
};
|
48726
|
+
var dateTimeFormats = {
|
48727
|
+
full: "{{date}} 'at' {{time}}",
|
48728
|
+
long: "{{date}} 'at' {{time}}",
|
48729
|
+
medium: "{{date}}, {{time}}",
|
48730
|
+
short: "{{date}}, {{time}}"
|
48731
|
+
};
|
48732
|
+
var formatLong = {
|
48733
|
+
date: buildFormatLongFn({
|
48734
|
+
formats: dateFormats,
|
48735
|
+
defaultWidth: "full"
|
48736
|
+
}),
|
48737
|
+
time: buildFormatLongFn({
|
48738
|
+
formats: timeFormats,
|
48739
|
+
defaultWidth: "full"
|
48740
|
+
}),
|
48741
|
+
dateTime: buildFormatLongFn({
|
48742
|
+
formats: dateTimeFormats,
|
48743
|
+
defaultWidth: "full"
|
48744
|
+
})
|
48745
|
+
};
|
48746
|
+
var formatLong_default = formatLong;
|
48747
|
+
|
48748
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js
|
48749
|
+
var formatRelativeLocale = {
|
48750
|
+
lastWeek: "'last' eeee 'at' p",
|
48751
|
+
yesterday: "'yesterday at' p",
|
48752
|
+
today: "'today at' p",
|
48753
|
+
tomorrow: "'tomorrow at' p",
|
48754
|
+
nextWeek: "eeee 'at' p",
|
48755
|
+
other: "P"
|
48756
|
+
};
|
48757
|
+
var formatRelative = /* @__PURE__ */ __name(function(token, _date, _baseDate, _options) {
|
48758
|
+
return formatRelativeLocale[token];
|
48759
|
+
}, "formatRelative");
|
48760
|
+
var formatRelative_default = formatRelative;
|
48761
|
+
|
48762
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js
|
48763
|
+
function buildLocalizeFn(args) {
|
48764
|
+
return function(dirtyIndex, dirtyOptions) {
|
48765
|
+
var options = dirtyOptions || {};
|
48766
|
+
var context2 = options.context ? String(options.context) : "standalone";
|
48767
|
+
var valuesArray;
|
48768
|
+
if (context2 === "formatting" && args.formattingValues) {
|
48769
|
+
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
48770
|
+
var width = options.width ? String(options.width) : defaultWidth;
|
48771
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
48772
|
+
} else {
|
48773
|
+
var _defaultWidth = args.defaultWidth;
|
48774
|
+
var _width = options.width ? String(options.width) : args.defaultWidth;
|
48775
|
+
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
48776
|
+
}
|
48777
|
+
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
|
48778
|
+
return valuesArray[index];
|
48779
|
+
};
|
48780
|
+
}
|
48781
|
+
__name(buildLocalizeFn, "buildLocalizeFn");
|
48782
|
+
|
48783
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js
|
48784
|
+
var eraValues = {
|
48785
|
+
narrow: ["B", "A"],
|
48786
|
+
abbreviated: ["BC", "AD"],
|
48787
|
+
wide: ["Before Christ", "Anno Domini"]
|
48788
|
+
};
|
48789
|
+
var quarterValues = {
|
48790
|
+
narrow: ["1", "2", "3", "4"],
|
48791
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
48792
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
48793
|
+
};
|
48794
|
+
var monthValues = {
|
48795
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
48796
|
+
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
48797
|
+
wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
|
48798
|
+
};
|
48799
|
+
var dayValues = {
|
48800
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
48801
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
48802
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
48803
|
+
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
48804
|
+
};
|
48805
|
+
var dayPeriodValues = {
|
48806
|
+
narrow: {
|
48807
|
+
am: "a",
|
48808
|
+
pm: "p",
|
48809
|
+
midnight: "mi",
|
48810
|
+
noon: "n",
|
48811
|
+
morning: "morning",
|
48812
|
+
afternoon: "afternoon",
|
48813
|
+
evening: "evening",
|
48814
|
+
night: "night"
|
48815
|
+
},
|
48816
|
+
abbreviated: {
|
48817
|
+
am: "AM",
|
48818
|
+
pm: "PM",
|
48819
|
+
midnight: "midnight",
|
48820
|
+
noon: "noon",
|
48821
|
+
morning: "morning",
|
48822
|
+
afternoon: "afternoon",
|
48823
|
+
evening: "evening",
|
48824
|
+
night: "night"
|
48825
|
+
},
|
48826
|
+
wide: {
|
48827
|
+
am: "a.m.",
|
48828
|
+
pm: "p.m.",
|
48829
|
+
midnight: "midnight",
|
48830
|
+
noon: "noon",
|
48831
|
+
morning: "morning",
|
48832
|
+
afternoon: "afternoon",
|
48833
|
+
evening: "evening",
|
48834
|
+
night: "night"
|
48835
|
+
}
|
48836
|
+
};
|
48837
|
+
var formattingDayPeriodValues = {
|
48838
|
+
narrow: {
|
48839
|
+
am: "a",
|
48840
|
+
pm: "p",
|
48841
|
+
midnight: "mi",
|
48842
|
+
noon: "n",
|
48843
|
+
morning: "in the morning",
|
48844
|
+
afternoon: "in the afternoon",
|
48845
|
+
evening: "in the evening",
|
48846
|
+
night: "at night"
|
48847
|
+
},
|
48848
|
+
abbreviated: {
|
48849
|
+
am: "AM",
|
48850
|
+
pm: "PM",
|
48851
|
+
midnight: "midnight",
|
48852
|
+
noon: "noon",
|
48853
|
+
morning: "in the morning",
|
48854
|
+
afternoon: "in the afternoon",
|
48855
|
+
evening: "in the evening",
|
48856
|
+
night: "at night"
|
48857
|
+
},
|
48858
|
+
wide: {
|
48859
|
+
am: "a.m.",
|
48860
|
+
pm: "p.m.",
|
48861
|
+
midnight: "midnight",
|
48862
|
+
noon: "noon",
|
48863
|
+
morning: "in the morning",
|
48864
|
+
afternoon: "in the afternoon",
|
48865
|
+
evening: "in the evening",
|
48866
|
+
night: "at night"
|
48867
|
+
}
|
48868
|
+
};
|
48869
|
+
var ordinalNumber = /* @__PURE__ */ __name(function(dirtyNumber, _options) {
|
48870
|
+
var number = Number(dirtyNumber);
|
48871
|
+
var rem100 = number % 100;
|
48872
|
+
if (rem100 > 20 || rem100 < 10) {
|
48873
|
+
switch (rem100 % 10) {
|
48874
|
+
case 1:
|
48875
|
+
return number + "st";
|
48876
|
+
case 2:
|
48877
|
+
return number + "nd";
|
48878
|
+
case 3:
|
48879
|
+
return number + "rd";
|
48880
|
+
}
|
48881
|
+
}
|
48882
|
+
return number + "th";
|
48883
|
+
}, "ordinalNumber");
|
48884
|
+
var localize = {
|
48885
|
+
ordinalNumber,
|
48886
|
+
era: buildLocalizeFn({
|
48887
|
+
values: eraValues,
|
48888
|
+
defaultWidth: "wide"
|
48889
|
+
}),
|
48890
|
+
quarter: buildLocalizeFn({
|
48891
|
+
values: quarterValues,
|
48892
|
+
defaultWidth: "wide",
|
48893
|
+
argumentCallback: function(quarter) {
|
48894
|
+
return quarter - 1;
|
48895
|
+
}
|
48896
|
+
}),
|
48897
|
+
month: buildLocalizeFn({
|
48898
|
+
values: monthValues,
|
48899
|
+
defaultWidth: "wide"
|
48900
|
+
}),
|
48901
|
+
day: buildLocalizeFn({
|
48902
|
+
values: dayValues,
|
48903
|
+
defaultWidth: "wide"
|
48904
|
+
}),
|
48905
|
+
dayPeriod: buildLocalizeFn({
|
48906
|
+
values: dayPeriodValues,
|
48907
|
+
defaultWidth: "wide",
|
48908
|
+
formattingValues: formattingDayPeriodValues,
|
48909
|
+
defaultFormattingWidth: "wide"
|
48910
|
+
})
|
48911
|
+
};
|
48912
|
+
var localize_default = localize;
|
48913
|
+
|
48914
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js
|
48915
|
+
function buildMatchFn(args) {
|
48916
|
+
return function(string2) {
|
48917
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
48918
|
+
var width = options.width;
|
48919
|
+
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
48920
|
+
var matchResult = string2.match(matchPattern);
|
48921
|
+
if (!matchResult) {
|
48922
|
+
return null;
|
48923
|
+
}
|
48924
|
+
var matchedString = matchResult[0];
|
48925
|
+
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
48926
|
+
var key2 = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) {
|
48927
|
+
return pattern.test(matchedString);
|
48928
|
+
}) : findKey(parsePatterns, function(pattern) {
|
48929
|
+
return pattern.test(matchedString);
|
48930
|
+
});
|
48931
|
+
var value;
|
48932
|
+
value = args.valueCallback ? args.valueCallback(key2) : key2;
|
48933
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
48934
|
+
var rest = string2.slice(matchedString.length);
|
48935
|
+
return {
|
48936
|
+
value,
|
48937
|
+
rest
|
48938
|
+
};
|
48939
|
+
};
|
48940
|
+
}
|
48941
|
+
__name(buildMatchFn, "buildMatchFn");
|
48942
|
+
function findKey(object, predicate) {
|
48943
|
+
for (var key2 in object) {
|
48944
|
+
if (object.hasOwnProperty(key2) && predicate(object[key2])) {
|
48945
|
+
return key2;
|
48946
|
+
}
|
48947
|
+
}
|
48948
|
+
return void 0;
|
48949
|
+
}
|
48950
|
+
__name(findKey, "findKey");
|
48951
|
+
function findIndex(array, predicate) {
|
48952
|
+
for (var key2 = 0; key2 < array.length; key2++) {
|
48953
|
+
if (predicate(array[key2])) {
|
48954
|
+
return key2;
|
48955
|
+
}
|
48956
|
+
}
|
48957
|
+
return void 0;
|
48958
|
+
}
|
48959
|
+
__name(findIndex, "findIndex");
|
48960
|
+
|
48961
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js
|
48962
|
+
function buildMatchPatternFn(args) {
|
48963
|
+
return function(string2) {
|
48964
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
48965
|
+
var matchResult = string2.match(args.matchPattern);
|
48966
|
+
if (!matchResult)
|
48967
|
+
return null;
|
48968
|
+
var matchedString = matchResult[0];
|
48969
|
+
var parseResult = string2.match(args.parsePattern);
|
48970
|
+
if (!parseResult)
|
48971
|
+
return null;
|
48972
|
+
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
48973
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
48974
|
+
var rest = string2.slice(matchedString.length);
|
48975
|
+
return {
|
48976
|
+
value,
|
48977
|
+
rest
|
48978
|
+
};
|
48979
|
+
};
|
48980
|
+
}
|
48981
|
+
__name(buildMatchPatternFn, "buildMatchPatternFn");
|
48982
|
+
|
48983
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js
|
48984
|
+
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
48985
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
48986
|
+
var matchEraPatterns = {
|
48987
|
+
narrow: /^(b|a)/i,
|
48988
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
48989
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
48990
|
+
};
|
48991
|
+
var parseEraPatterns = {
|
48992
|
+
any: [/^b/i, /^(a|c)/i]
|
48993
|
+
};
|
48994
|
+
var matchQuarterPatterns = {
|
48995
|
+
narrow: /^[1234]/i,
|
48996
|
+
abbreviated: /^q[1234]/i,
|
48997
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
48998
|
+
};
|
48999
|
+
var parseQuarterPatterns = {
|
49000
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
49001
|
+
};
|
49002
|
+
var matchMonthPatterns = {
|
49003
|
+
narrow: /^[jfmasond]/i,
|
49004
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
49005
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
49006
|
+
};
|
49007
|
+
var parseMonthPatterns = {
|
49008
|
+
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
|
49009
|
+
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
|
49010
|
+
};
|
49011
|
+
var matchDayPatterns = {
|
49012
|
+
narrow: /^[smtwf]/i,
|
49013
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
49014
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
49015
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
49016
|
+
};
|
49017
|
+
var parseDayPatterns = {
|
49018
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
49019
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
49020
|
+
};
|
49021
|
+
var matchDayPeriodPatterns = {
|
49022
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
49023
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
49024
|
+
};
|
49025
|
+
var parseDayPeriodPatterns = {
|
49026
|
+
any: {
|
49027
|
+
am: /^a/i,
|
49028
|
+
pm: /^p/i,
|
49029
|
+
midnight: /^mi/i,
|
49030
|
+
noon: /^no/i,
|
49031
|
+
morning: /morning/i,
|
49032
|
+
afternoon: /afternoon/i,
|
49033
|
+
evening: /evening/i,
|
49034
|
+
night: /night/i
|
49035
|
+
}
|
49036
|
+
};
|
49037
|
+
var match = {
|
49038
|
+
ordinalNumber: buildMatchPatternFn({
|
49039
|
+
matchPattern: matchOrdinalNumberPattern,
|
49040
|
+
parsePattern: parseOrdinalNumberPattern,
|
49041
|
+
valueCallback: function(value) {
|
49042
|
+
return parseInt(value, 10);
|
49043
|
+
}
|
49044
|
+
}),
|
49045
|
+
era: buildMatchFn({
|
49046
|
+
matchPatterns: matchEraPatterns,
|
49047
|
+
defaultMatchWidth: "wide",
|
49048
|
+
parsePatterns: parseEraPatterns,
|
49049
|
+
defaultParseWidth: "any"
|
49050
|
+
}),
|
49051
|
+
quarter: buildMatchFn({
|
49052
|
+
matchPatterns: matchQuarterPatterns,
|
49053
|
+
defaultMatchWidth: "wide",
|
49054
|
+
parsePatterns: parseQuarterPatterns,
|
49055
|
+
defaultParseWidth: "any",
|
49056
|
+
valueCallback: function(index) {
|
49057
|
+
return index + 1;
|
49058
|
+
}
|
49059
|
+
}),
|
49060
|
+
month: buildMatchFn({
|
49061
|
+
matchPatterns: matchMonthPatterns,
|
49062
|
+
defaultMatchWidth: "wide",
|
49063
|
+
parsePatterns: parseMonthPatterns,
|
49064
|
+
defaultParseWidth: "any"
|
49065
|
+
}),
|
49066
|
+
day: buildMatchFn({
|
49067
|
+
matchPatterns: matchDayPatterns,
|
49068
|
+
defaultMatchWidth: "wide",
|
49069
|
+
parsePatterns: parseDayPatterns,
|
49070
|
+
defaultParseWidth: "any"
|
49071
|
+
}),
|
49072
|
+
dayPeriod: buildMatchFn({
|
49073
|
+
matchPatterns: matchDayPeriodPatterns,
|
49074
|
+
defaultMatchWidth: "any",
|
49075
|
+
parsePatterns: parseDayPeriodPatterns,
|
49076
|
+
defaultParseWidth: "any"
|
49077
|
+
})
|
49078
|
+
};
|
49079
|
+
var match_default = match;
|
49080
|
+
|
49081
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/locale/en-US/index.js
|
49082
|
+
var locale = {
|
49083
|
+
code: "en-US",
|
49084
|
+
formatDistance: formatDistance_default,
|
49085
|
+
formatLong: formatLong_default,
|
49086
|
+
formatRelative: formatRelative_default,
|
49087
|
+
localize: localize_default,
|
49088
|
+
match: match_default,
|
49089
|
+
options: {
|
49090
|
+
weekStartsOn: 0,
|
49091
|
+
firstWeekContainsDate: 1
|
49092
|
+
}
|
49093
|
+
};
|
49094
|
+
var en_US_default = locale;
|
49095
|
+
|
49096
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/subMilliseconds/index.js
|
49097
|
+
function subMilliseconds(dirtyDate, dirtyAmount) {
|
49098
|
+
requiredArgs(2, arguments);
|
49099
|
+
var amount = toInteger(dirtyAmount);
|
49100
|
+
return addMilliseconds(dirtyDate, -amount);
|
49101
|
+
}
|
49102
|
+
__name(subMilliseconds, "subMilliseconds");
|
49103
|
+
|
49104
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js
|
49105
|
+
var MILLISECONDS_IN_DAY = 864e5;
|
49106
|
+
function getUTCDayOfYear(dirtyDate) {
|
49107
|
+
requiredArgs(1, arguments);
|
49108
|
+
var date = toDate(dirtyDate);
|
49109
|
+
var timestamp = date.getTime();
|
49110
|
+
date.setUTCMonth(0, 1);
|
49111
|
+
date.setUTCHours(0, 0, 0, 0);
|
49112
|
+
var startOfYearTimestamp = date.getTime();
|
49113
|
+
var difference = timestamp - startOfYearTimestamp;
|
49114
|
+
return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
|
49115
|
+
}
|
49116
|
+
__name(getUTCDayOfYear, "getUTCDayOfYear");
|
49117
|
+
|
49118
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js
|
49119
|
+
function startOfUTCISOWeek(dirtyDate) {
|
49120
|
+
requiredArgs(1, arguments);
|
49121
|
+
var weekStartsOn = 1;
|
49122
|
+
var date = toDate(dirtyDate);
|
49123
|
+
var day = date.getUTCDay();
|
49124
|
+
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
49125
|
+
date.setUTCDate(date.getUTCDate() - diff);
|
49126
|
+
date.setUTCHours(0, 0, 0, 0);
|
49127
|
+
return date;
|
49128
|
+
}
|
49129
|
+
__name(startOfUTCISOWeek, "startOfUTCISOWeek");
|
49130
|
+
|
49131
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js
|
49132
|
+
function getUTCISOWeekYear(dirtyDate) {
|
49133
|
+
requiredArgs(1, arguments);
|
49134
|
+
var date = toDate(dirtyDate);
|
49135
|
+
var year = date.getUTCFullYear();
|
49136
|
+
var fourthOfJanuaryOfNextYear = new Date(0);
|
49137
|
+
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
|
49138
|
+
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
|
49139
|
+
var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
|
49140
|
+
var fourthOfJanuaryOfThisYear = new Date(0);
|
49141
|
+
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
49142
|
+
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
49143
|
+
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
|
49144
|
+
if (date.getTime() >= startOfNextYear.getTime()) {
|
49145
|
+
return year + 1;
|
49146
|
+
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
49147
|
+
return year;
|
49148
|
+
} else {
|
49149
|
+
return year - 1;
|
49150
|
+
}
|
49151
|
+
}
|
49152
|
+
__name(getUTCISOWeekYear, "getUTCISOWeekYear");
|
49153
|
+
|
49154
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js
|
49155
|
+
function startOfUTCISOWeekYear(dirtyDate) {
|
49156
|
+
requiredArgs(1, arguments);
|
49157
|
+
var year = getUTCISOWeekYear(dirtyDate);
|
49158
|
+
var fourthOfJanuary = new Date(0);
|
49159
|
+
fourthOfJanuary.setUTCFullYear(year, 0, 4);
|
49160
|
+
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
|
49161
|
+
var date = startOfUTCISOWeek(fourthOfJanuary);
|
49162
|
+
return date;
|
49163
|
+
}
|
49164
|
+
__name(startOfUTCISOWeekYear, "startOfUTCISOWeekYear");
|
49165
|
+
|
49166
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js
|
49167
|
+
var MILLISECONDS_IN_WEEK = 6048e5;
|
49168
|
+
function getUTCISOWeek(dirtyDate) {
|
49169
|
+
requiredArgs(1, arguments);
|
49170
|
+
var date = toDate(dirtyDate);
|
49171
|
+
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
|
49172
|
+
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
49173
|
+
}
|
49174
|
+
__name(getUTCISOWeek, "getUTCISOWeek");
|
49175
|
+
|
49176
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js
|
49177
|
+
function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
49178
|
+
requiredArgs(1, arguments);
|
49179
|
+
var options = dirtyOptions || {};
|
49180
|
+
var locale2 = options.locale;
|
49181
|
+
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
|
49182
|
+
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
49183
|
+
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
|
49184
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
49185
|
+
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
49186
|
+
}
|
49187
|
+
var date = toDate(dirtyDate);
|
49188
|
+
var day = date.getUTCDay();
|
49189
|
+
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
49190
|
+
date.setUTCDate(date.getUTCDate() - diff);
|
49191
|
+
date.setUTCHours(0, 0, 0, 0);
|
49192
|
+
return date;
|
49193
|
+
}
|
49194
|
+
__name(startOfUTCWeek, "startOfUTCWeek");
|
49195
|
+
|
49196
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js
|
49197
|
+
function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
49198
|
+
requiredArgs(1, arguments);
|
49199
|
+
var date = toDate(dirtyDate);
|
49200
|
+
var year = date.getUTCFullYear();
|
49201
|
+
var options = dirtyOptions || {};
|
49202
|
+
var locale2 = options.locale;
|
49203
|
+
var localeFirstWeekContainsDate = locale2 && locale2.options && locale2.options.firstWeekContainsDate;
|
49204
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
49205
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
49206
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
49207
|
+
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
49208
|
+
}
|
49209
|
+
var firstWeekOfNextYear = new Date(0);
|
49210
|
+
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
49211
|
+
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
49212
|
+
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
|
49213
|
+
var firstWeekOfThisYear = new Date(0);
|
49214
|
+
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
49215
|
+
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
49216
|
+
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
|
49217
|
+
if (date.getTime() >= startOfNextYear.getTime()) {
|
49218
|
+
return year + 1;
|
49219
|
+
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
49220
|
+
return year;
|
49221
|
+
} else {
|
49222
|
+
return year - 1;
|
49223
|
+
}
|
49224
|
+
}
|
49225
|
+
__name(getUTCWeekYear, "getUTCWeekYear");
|
49226
|
+
|
49227
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js
|
49228
|
+
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
|
49229
|
+
requiredArgs(1, arguments);
|
49230
|
+
var options = dirtyOptions || {};
|
49231
|
+
var locale2 = options.locale;
|
49232
|
+
var localeFirstWeekContainsDate = locale2 && locale2.options && locale2.options.firstWeekContainsDate;
|
49233
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
49234
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
49235
|
+
var year = getUTCWeekYear(dirtyDate, dirtyOptions);
|
49236
|
+
var firstWeek = new Date(0);
|
49237
|
+
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
|
49238
|
+
firstWeek.setUTCHours(0, 0, 0, 0);
|
49239
|
+
var date = startOfUTCWeek(firstWeek, dirtyOptions);
|
49240
|
+
return date;
|
49241
|
+
}
|
49242
|
+
__name(startOfUTCWeekYear, "startOfUTCWeekYear");
|
49243
|
+
|
49244
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/getUTCWeek/index.js
|
49245
|
+
var MILLISECONDS_IN_WEEK2 = 6048e5;
|
49246
|
+
function getUTCWeek(dirtyDate, options) {
|
49247
|
+
requiredArgs(1, arguments);
|
49248
|
+
var date = toDate(dirtyDate);
|
49249
|
+
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
|
49250
|
+
return Math.round(diff / MILLISECONDS_IN_WEEK2) + 1;
|
49251
|
+
}
|
49252
|
+
__name(getUTCWeek, "getUTCWeek");
|
49253
|
+
|
49254
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/addLeadingZeros/index.js
|
49255
|
+
function addLeadingZeros(number, targetLength) {
|
49256
|
+
var sign5 = number < 0 ? "-" : "";
|
49257
|
+
var output = Math.abs(number).toString();
|
49258
|
+
while (output.length < targetLength) {
|
49259
|
+
output = "0" + output;
|
49260
|
+
}
|
49261
|
+
return sign5 + output;
|
49262
|
+
}
|
49263
|
+
__name(addLeadingZeros, "addLeadingZeros");
|
49264
|
+
|
49265
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js
|
49266
|
+
var formatters = {
|
49267
|
+
y: function(date, token) {
|
49268
|
+
var signedYear = date.getUTCFullYear();
|
49269
|
+
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
49270
|
+
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
|
49271
|
+
},
|
49272
|
+
M: function(date, token) {
|
49273
|
+
var month = date.getUTCMonth();
|
49274
|
+
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
49275
|
+
},
|
49276
|
+
d: function(date, token) {
|
49277
|
+
return addLeadingZeros(date.getUTCDate(), token.length);
|
49278
|
+
},
|
49279
|
+
a: function(date, token) {
|
49280
|
+
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am";
|
49281
|
+
switch (token) {
|
49282
|
+
case "a":
|
49283
|
+
case "aa":
|
49284
|
+
return dayPeriodEnumValue.toUpperCase();
|
49285
|
+
case "aaa":
|
49286
|
+
return dayPeriodEnumValue;
|
49287
|
+
case "aaaaa":
|
49288
|
+
return dayPeriodEnumValue[0];
|
49289
|
+
case "aaaa":
|
49290
|
+
default:
|
49291
|
+
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
49292
|
+
}
|
49293
|
+
},
|
49294
|
+
h: function(date, token) {
|
49295
|
+
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
|
49296
|
+
},
|
49297
|
+
H: function(date, token) {
|
49298
|
+
return addLeadingZeros(date.getUTCHours(), token.length);
|
49299
|
+
},
|
49300
|
+
m: function(date, token) {
|
49301
|
+
return addLeadingZeros(date.getUTCMinutes(), token.length);
|
49302
|
+
},
|
49303
|
+
s: function(date, token) {
|
49304
|
+
return addLeadingZeros(date.getUTCSeconds(), token.length);
|
49305
|
+
},
|
49306
|
+
S: function(date, token) {
|
49307
|
+
var numberOfDigits = token.length;
|
49308
|
+
var milliseconds = date.getUTCMilliseconds();
|
49309
|
+
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
49310
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
49311
|
+
}
|
49312
|
+
};
|
49313
|
+
var lightFormatters_default = formatters;
|
49314
|
+
|
49315
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/format/formatters/index.js
|
49316
|
+
var dayPeriodEnum = {
|
49317
|
+
am: "am",
|
49318
|
+
pm: "pm",
|
49319
|
+
midnight: "midnight",
|
49320
|
+
noon: "noon",
|
49321
|
+
morning: "morning",
|
49322
|
+
afternoon: "afternoon",
|
49323
|
+
evening: "evening",
|
49324
|
+
night: "night"
|
49325
|
+
};
|
49326
|
+
var formatters2 = {
|
49327
|
+
G: function(date, token, localize2) {
|
49328
|
+
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
49329
|
+
switch (token) {
|
49330
|
+
case "G":
|
49331
|
+
case "GG":
|
49332
|
+
case "GGG":
|
49333
|
+
return localize2.era(era, {
|
49334
|
+
width: "abbreviated"
|
49335
|
+
});
|
49336
|
+
case "GGGGG":
|
49337
|
+
return localize2.era(era, {
|
49338
|
+
width: "narrow"
|
49339
|
+
});
|
49340
|
+
case "GGGG":
|
49341
|
+
default:
|
49342
|
+
return localize2.era(era, {
|
49343
|
+
width: "wide"
|
49344
|
+
});
|
49345
|
+
}
|
49346
|
+
},
|
49347
|
+
y: function(date, token, localize2) {
|
49348
|
+
if (token === "yo") {
|
49349
|
+
var signedYear = date.getUTCFullYear();
|
49350
|
+
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
49351
|
+
return localize2.ordinalNumber(year, {
|
49352
|
+
unit: "year"
|
49353
|
+
});
|
49354
|
+
}
|
49355
|
+
return lightFormatters_default.y(date, token);
|
49356
|
+
},
|
49357
|
+
Y: function(date, token, localize2, options) {
|
49358
|
+
var signedWeekYear = getUTCWeekYear(date, options);
|
49359
|
+
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
49360
|
+
if (token === "YY") {
|
49361
|
+
var twoDigitYear = weekYear % 100;
|
49362
|
+
return addLeadingZeros(twoDigitYear, 2);
|
49363
|
+
}
|
49364
|
+
if (token === "Yo") {
|
49365
|
+
return localize2.ordinalNumber(weekYear, {
|
49366
|
+
unit: "year"
|
49367
|
+
});
|
49368
|
+
}
|
49369
|
+
return addLeadingZeros(weekYear, token.length);
|
49370
|
+
},
|
49371
|
+
R: function(date, token) {
|
49372
|
+
var isoWeekYear = getUTCISOWeekYear(date);
|
49373
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
49374
|
+
},
|
49375
|
+
u: function(date, token) {
|
49376
|
+
var year = date.getUTCFullYear();
|
49377
|
+
return addLeadingZeros(year, token.length);
|
49378
|
+
},
|
49379
|
+
Q: function(date, token, localize2) {
|
49380
|
+
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
49381
|
+
switch (token) {
|
49382
|
+
case "Q":
|
49383
|
+
return String(quarter);
|
49384
|
+
case "QQ":
|
49385
|
+
return addLeadingZeros(quarter, 2);
|
49386
|
+
case "Qo":
|
49387
|
+
return localize2.ordinalNumber(quarter, {
|
49388
|
+
unit: "quarter"
|
49389
|
+
});
|
49390
|
+
case "QQQ":
|
49391
|
+
return localize2.quarter(quarter, {
|
49392
|
+
width: "abbreviated",
|
49393
|
+
context: "formatting"
|
49394
|
+
});
|
49395
|
+
case "QQQQQ":
|
49396
|
+
return localize2.quarter(quarter, {
|
49397
|
+
width: "narrow",
|
49398
|
+
context: "formatting"
|
49399
|
+
});
|
49400
|
+
case "QQQQ":
|
49401
|
+
default:
|
49402
|
+
return localize2.quarter(quarter, {
|
49403
|
+
width: "wide",
|
49404
|
+
context: "formatting"
|
49405
|
+
});
|
49406
|
+
}
|
49407
|
+
},
|
49408
|
+
q: function(date, token, localize2) {
|
49409
|
+
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
49410
|
+
switch (token) {
|
49411
|
+
case "q":
|
49412
|
+
return String(quarter);
|
49413
|
+
case "qq":
|
49414
|
+
return addLeadingZeros(quarter, 2);
|
49415
|
+
case "qo":
|
49416
|
+
return localize2.ordinalNumber(quarter, {
|
49417
|
+
unit: "quarter"
|
49418
|
+
});
|
49419
|
+
case "qqq":
|
49420
|
+
return localize2.quarter(quarter, {
|
49421
|
+
width: "abbreviated",
|
49422
|
+
context: "standalone"
|
49423
|
+
});
|
49424
|
+
case "qqqqq":
|
49425
|
+
return localize2.quarter(quarter, {
|
49426
|
+
width: "narrow",
|
49427
|
+
context: "standalone"
|
49428
|
+
});
|
49429
|
+
case "qqqq":
|
49430
|
+
default:
|
49431
|
+
return localize2.quarter(quarter, {
|
49432
|
+
width: "wide",
|
49433
|
+
context: "standalone"
|
49434
|
+
});
|
49435
|
+
}
|
49436
|
+
},
|
49437
|
+
M: function(date, token, localize2) {
|
49438
|
+
var month = date.getUTCMonth();
|
49439
|
+
switch (token) {
|
49440
|
+
case "M":
|
49441
|
+
case "MM":
|
49442
|
+
return lightFormatters_default.M(date, token);
|
49443
|
+
case "Mo":
|
49444
|
+
return localize2.ordinalNumber(month + 1, {
|
49445
|
+
unit: "month"
|
49446
|
+
});
|
49447
|
+
case "MMM":
|
49448
|
+
return localize2.month(month, {
|
49449
|
+
width: "abbreviated",
|
49450
|
+
context: "formatting"
|
49451
|
+
});
|
49452
|
+
case "MMMMM":
|
49453
|
+
return localize2.month(month, {
|
49454
|
+
width: "narrow",
|
49455
|
+
context: "formatting"
|
49456
|
+
});
|
49457
|
+
case "MMMM":
|
49458
|
+
default:
|
49459
|
+
return localize2.month(month, {
|
49460
|
+
width: "wide",
|
49461
|
+
context: "formatting"
|
49462
|
+
});
|
49463
|
+
}
|
49464
|
+
},
|
49465
|
+
L: function(date, token, localize2) {
|
49466
|
+
var month = date.getUTCMonth();
|
49467
|
+
switch (token) {
|
49468
|
+
case "L":
|
49469
|
+
return String(month + 1);
|
49470
|
+
case "LL":
|
49471
|
+
return addLeadingZeros(month + 1, 2);
|
49472
|
+
case "Lo":
|
49473
|
+
return localize2.ordinalNumber(month + 1, {
|
49474
|
+
unit: "month"
|
49475
|
+
});
|
49476
|
+
case "LLL":
|
49477
|
+
return localize2.month(month, {
|
49478
|
+
width: "abbreviated",
|
49479
|
+
context: "standalone"
|
49480
|
+
});
|
49481
|
+
case "LLLLL":
|
49482
|
+
return localize2.month(month, {
|
49483
|
+
width: "narrow",
|
49484
|
+
context: "standalone"
|
49485
|
+
});
|
49486
|
+
case "LLLL":
|
49487
|
+
default:
|
49488
|
+
return localize2.month(month, {
|
49489
|
+
width: "wide",
|
49490
|
+
context: "standalone"
|
49491
|
+
});
|
49492
|
+
}
|
49493
|
+
},
|
49494
|
+
w: function(date, token, localize2, options) {
|
49495
|
+
var week = getUTCWeek(date, options);
|
49496
|
+
if (token === "wo") {
|
49497
|
+
return localize2.ordinalNumber(week, {
|
49498
|
+
unit: "week"
|
49499
|
+
});
|
49500
|
+
}
|
49501
|
+
return addLeadingZeros(week, token.length);
|
49502
|
+
},
|
49503
|
+
I: function(date, token, localize2) {
|
49504
|
+
var isoWeek = getUTCISOWeek(date);
|
49505
|
+
if (token === "Io") {
|
49506
|
+
return localize2.ordinalNumber(isoWeek, {
|
49507
|
+
unit: "week"
|
49508
|
+
});
|
49509
|
+
}
|
49510
|
+
return addLeadingZeros(isoWeek, token.length);
|
49511
|
+
},
|
49512
|
+
d: function(date, token, localize2) {
|
49513
|
+
if (token === "do") {
|
49514
|
+
return localize2.ordinalNumber(date.getUTCDate(), {
|
49515
|
+
unit: "date"
|
49516
|
+
});
|
49517
|
+
}
|
49518
|
+
return lightFormatters_default.d(date, token);
|
49519
|
+
},
|
49520
|
+
D: function(date, token, localize2) {
|
49521
|
+
var dayOfYear = getUTCDayOfYear(date);
|
49522
|
+
if (token === "Do") {
|
49523
|
+
return localize2.ordinalNumber(dayOfYear, {
|
49524
|
+
unit: "dayOfYear"
|
49525
|
+
});
|
49526
|
+
}
|
49527
|
+
return addLeadingZeros(dayOfYear, token.length);
|
49528
|
+
},
|
49529
|
+
E: function(date, token, localize2) {
|
49530
|
+
var dayOfWeek = date.getUTCDay();
|
49531
|
+
switch (token) {
|
49532
|
+
case "E":
|
49533
|
+
case "EE":
|
49534
|
+
case "EEE":
|
49535
|
+
return localize2.day(dayOfWeek, {
|
49536
|
+
width: "abbreviated",
|
49537
|
+
context: "formatting"
|
49538
|
+
});
|
49539
|
+
case "EEEEE":
|
49540
|
+
return localize2.day(dayOfWeek, {
|
49541
|
+
width: "narrow",
|
49542
|
+
context: "formatting"
|
49543
|
+
});
|
49544
|
+
case "EEEEEE":
|
49545
|
+
return localize2.day(dayOfWeek, {
|
49546
|
+
width: "short",
|
49547
|
+
context: "formatting"
|
49548
|
+
});
|
49549
|
+
case "EEEE":
|
49550
|
+
default:
|
49551
|
+
return localize2.day(dayOfWeek, {
|
49552
|
+
width: "wide",
|
49553
|
+
context: "formatting"
|
49554
|
+
});
|
49555
|
+
}
|
49556
|
+
},
|
49557
|
+
e: function(date, token, localize2, options) {
|
49558
|
+
var dayOfWeek = date.getUTCDay();
|
49559
|
+
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
49560
|
+
switch (token) {
|
49561
|
+
case "e":
|
49562
|
+
return String(localDayOfWeek);
|
49563
|
+
case "ee":
|
49564
|
+
return addLeadingZeros(localDayOfWeek, 2);
|
49565
|
+
case "eo":
|
49566
|
+
return localize2.ordinalNumber(localDayOfWeek, {
|
49567
|
+
unit: "day"
|
49568
|
+
});
|
49569
|
+
case "eee":
|
49570
|
+
return localize2.day(dayOfWeek, {
|
49571
|
+
width: "abbreviated",
|
49572
|
+
context: "formatting"
|
49573
|
+
});
|
49574
|
+
case "eeeee":
|
49575
|
+
return localize2.day(dayOfWeek, {
|
49576
|
+
width: "narrow",
|
49577
|
+
context: "formatting"
|
49578
|
+
});
|
49579
|
+
case "eeeeee":
|
49580
|
+
return localize2.day(dayOfWeek, {
|
49581
|
+
width: "short",
|
49582
|
+
context: "formatting"
|
49583
|
+
});
|
49584
|
+
case "eeee":
|
49585
|
+
default:
|
49586
|
+
return localize2.day(dayOfWeek, {
|
49587
|
+
width: "wide",
|
49588
|
+
context: "formatting"
|
49589
|
+
});
|
49590
|
+
}
|
49591
|
+
},
|
49592
|
+
c: function(date, token, localize2, options) {
|
49593
|
+
var dayOfWeek = date.getUTCDay();
|
49594
|
+
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
49595
|
+
switch (token) {
|
49596
|
+
case "c":
|
49597
|
+
return String(localDayOfWeek);
|
49598
|
+
case "cc":
|
49599
|
+
return addLeadingZeros(localDayOfWeek, token.length);
|
49600
|
+
case "co":
|
49601
|
+
return localize2.ordinalNumber(localDayOfWeek, {
|
49602
|
+
unit: "day"
|
49603
|
+
});
|
49604
|
+
case "ccc":
|
49605
|
+
return localize2.day(dayOfWeek, {
|
49606
|
+
width: "abbreviated",
|
49607
|
+
context: "standalone"
|
49608
|
+
});
|
49609
|
+
case "ccccc":
|
49610
|
+
return localize2.day(dayOfWeek, {
|
49611
|
+
width: "narrow",
|
49612
|
+
context: "standalone"
|
49613
|
+
});
|
49614
|
+
case "cccccc":
|
49615
|
+
return localize2.day(dayOfWeek, {
|
49616
|
+
width: "short",
|
49617
|
+
context: "standalone"
|
49618
|
+
});
|
49619
|
+
case "cccc":
|
49620
|
+
default:
|
49621
|
+
return localize2.day(dayOfWeek, {
|
49622
|
+
width: "wide",
|
49623
|
+
context: "standalone"
|
49624
|
+
});
|
49625
|
+
}
|
49626
|
+
},
|
49627
|
+
i: function(date, token, localize2) {
|
49628
|
+
var dayOfWeek = date.getUTCDay();
|
49629
|
+
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
49630
|
+
switch (token) {
|
49631
|
+
case "i":
|
49632
|
+
return String(isoDayOfWeek);
|
49633
|
+
case "ii":
|
49634
|
+
return addLeadingZeros(isoDayOfWeek, token.length);
|
49635
|
+
case "io":
|
49636
|
+
return localize2.ordinalNumber(isoDayOfWeek, {
|
49637
|
+
unit: "day"
|
49638
|
+
});
|
49639
|
+
case "iii":
|
49640
|
+
return localize2.day(dayOfWeek, {
|
49641
|
+
width: "abbreviated",
|
49642
|
+
context: "formatting"
|
49643
|
+
});
|
49644
|
+
case "iiiii":
|
49645
|
+
return localize2.day(dayOfWeek, {
|
49646
|
+
width: "narrow",
|
49647
|
+
context: "formatting"
|
49648
|
+
});
|
49649
|
+
case "iiiiii":
|
49650
|
+
return localize2.day(dayOfWeek, {
|
49651
|
+
width: "short",
|
49652
|
+
context: "formatting"
|
49653
|
+
});
|
49654
|
+
case "iiii":
|
49655
|
+
default:
|
49656
|
+
return localize2.day(dayOfWeek, {
|
49657
|
+
width: "wide",
|
49658
|
+
context: "formatting"
|
49659
|
+
});
|
49660
|
+
}
|
49661
|
+
},
|
49662
|
+
a: function(date, token, localize2) {
|
49663
|
+
var hours = date.getUTCHours();
|
49664
|
+
var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
49665
|
+
switch (token) {
|
49666
|
+
case "a":
|
49667
|
+
case "aa":
|
49668
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49669
|
+
width: "abbreviated",
|
49670
|
+
context: "formatting"
|
49671
|
+
});
|
49672
|
+
case "aaa":
|
49673
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49674
|
+
width: "abbreviated",
|
49675
|
+
context: "formatting"
|
49676
|
+
}).toLowerCase();
|
49677
|
+
case "aaaaa":
|
49678
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49679
|
+
width: "narrow",
|
49680
|
+
context: "formatting"
|
49681
|
+
});
|
49682
|
+
case "aaaa":
|
49683
|
+
default:
|
49684
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49685
|
+
width: "wide",
|
49686
|
+
context: "formatting"
|
49687
|
+
});
|
49688
|
+
}
|
49689
|
+
},
|
49690
|
+
b: function(date, token, localize2) {
|
49691
|
+
var hours = date.getUTCHours();
|
49692
|
+
var dayPeriodEnumValue;
|
49693
|
+
if (hours === 12) {
|
49694
|
+
dayPeriodEnumValue = dayPeriodEnum.noon;
|
49695
|
+
} else if (hours === 0) {
|
49696
|
+
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
49697
|
+
} else {
|
49698
|
+
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
49699
|
+
}
|
49700
|
+
switch (token) {
|
49701
|
+
case "b":
|
49702
|
+
case "bb":
|
49703
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49704
|
+
width: "abbreviated",
|
49705
|
+
context: "formatting"
|
49706
|
+
});
|
49707
|
+
case "bbb":
|
49708
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49709
|
+
width: "abbreviated",
|
49710
|
+
context: "formatting"
|
49711
|
+
}).toLowerCase();
|
49712
|
+
case "bbbbb":
|
49713
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49714
|
+
width: "narrow",
|
49715
|
+
context: "formatting"
|
49716
|
+
});
|
49717
|
+
case "bbbb":
|
49718
|
+
default:
|
49719
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49720
|
+
width: "wide",
|
49721
|
+
context: "formatting"
|
49722
|
+
});
|
49723
|
+
}
|
49724
|
+
},
|
49725
|
+
B: function(date, token, localize2) {
|
49726
|
+
var hours = date.getUTCHours();
|
49727
|
+
var dayPeriodEnumValue;
|
49728
|
+
if (hours >= 17) {
|
49729
|
+
dayPeriodEnumValue = dayPeriodEnum.evening;
|
49730
|
+
} else if (hours >= 12) {
|
49731
|
+
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
49732
|
+
} else if (hours >= 4) {
|
49733
|
+
dayPeriodEnumValue = dayPeriodEnum.morning;
|
49734
|
+
} else {
|
49735
|
+
dayPeriodEnumValue = dayPeriodEnum.night;
|
49736
|
+
}
|
49737
|
+
switch (token) {
|
49738
|
+
case "B":
|
49739
|
+
case "BB":
|
49740
|
+
case "BBB":
|
49741
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49742
|
+
width: "abbreviated",
|
49743
|
+
context: "formatting"
|
49744
|
+
});
|
49745
|
+
case "BBBBB":
|
49746
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49747
|
+
width: "narrow",
|
49748
|
+
context: "formatting"
|
49749
|
+
});
|
49750
|
+
case "BBBB":
|
49751
|
+
default:
|
49752
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
49753
|
+
width: "wide",
|
49754
|
+
context: "formatting"
|
49755
|
+
});
|
49756
|
+
}
|
49757
|
+
},
|
49758
|
+
h: function(date, token, localize2) {
|
49759
|
+
if (token === "ho") {
|
49760
|
+
var hours = date.getUTCHours() % 12;
|
49761
|
+
if (hours === 0)
|
49762
|
+
hours = 12;
|
49763
|
+
return localize2.ordinalNumber(hours, {
|
49764
|
+
unit: "hour"
|
49765
|
+
});
|
49766
|
+
}
|
49767
|
+
return lightFormatters_default.h(date, token);
|
49768
|
+
},
|
49769
|
+
H: function(date, token, localize2) {
|
49770
|
+
if (token === "Ho") {
|
49771
|
+
return localize2.ordinalNumber(date.getUTCHours(), {
|
49772
|
+
unit: "hour"
|
49773
|
+
});
|
49774
|
+
}
|
49775
|
+
return lightFormatters_default.H(date, token);
|
49776
|
+
},
|
49777
|
+
K: function(date, token, localize2) {
|
49778
|
+
var hours = date.getUTCHours() % 12;
|
49779
|
+
if (token === "Ko") {
|
49780
|
+
return localize2.ordinalNumber(hours, {
|
49781
|
+
unit: "hour"
|
49782
|
+
});
|
49783
|
+
}
|
49784
|
+
return addLeadingZeros(hours, token.length);
|
49785
|
+
},
|
49786
|
+
k: function(date, token, localize2) {
|
49787
|
+
var hours = date.getUTCHours();
|
49788
|
+
if (hours === 0)
|
49789
|
+
hours = 24;
|
49790
|
+
if (token === "ko") {
|
49791
|
+
return localize2.ordinalNumber(hours, {
|
49792
|
+
unit: "hour"
|
49793
|
+
});
|
49794
|
+
}
|
49795
|
+
return addLeadingZeros(hours, token.length);
|
49796
|
+
},
|
49797
|
+
m: function(date, token, localize2) {
|
49798
|
+
if (token === "mo") {
|
49799
|
+
return localize2.ordinalNumber(date.getUTCMinutes(), {
|
49800
|
+
unit: "minute"
|
49801
|
+
});
|
49802
|
+
}
|
49803
|
+
return lightFormatters_default.m(date, token);
|
49804
|
+
},
|
49805
|
+
s: function(date, token, localize2) {
|
49806
|
+
if (token === "so") {
|
49807
|
+
return localize2.ordinalNumber(date.getUTCSeconds(), {
|
49808
|
+
unit: "second"
|
49809
|
+
});
|
49810
|
+
}
|
49811
|
+
return lightFormatters_default.s(date, token);
|
49812
|
+
},
|
49813
|
+
S: function(date, token) {
|
49814
|
+
return lightFormatters_default.S(date, token);
|
49815
|
+
},
|
49816
|
+
X: function(date, token, _localize, options) {
|
49817
|
+
var originalDate = options._originalDate || date;
|
49818
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
49819
|
+
if (timezoneOffset === 0) {
|
49820
|
+
return "Z";
|
49821
|
+
}
|
49822
|
+
switch (token) {
|
49823
|
+
case "X":
|
49824
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
49825
|
+
case "XXXX":
|
49826
|
+
case "XX":
|
49827
|
+
return formatTimezone(timezoneOffset);
|
49828
|
+
case "XXXXX":
|
49829
|
+
case "XXX":
|
49830
|
+
default:
|
49831
|
+
return formatTimezone(timezoneOffset, ":");
|
49832
|
+
}
|
49833
|
+
},
|
49834
|
+
x: function(date, token, _localize, options) {
|
49835
|
+
var originalDate = options._originalDate || date;
|
49836
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
49837
|
+
switch (token) {
|
49838
|
+
case "x":
|
49839
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
49840
|
+
case "xxxx":
|
49841
|
+
case "xx":
|
49842
|
+
return formatTimezone(timezoneOffset);
|
49843
|
+
case "xxxxx":
|
49844
|
+
case "xxx":
|
49845
|
+
default:
|
49846
|
+
return formatTimezone(timezoneOffset, ":");
|
49847
|
+
}
|
49848
|
+
},
|
49849
|
+
O: function(date, token, _localize, options) {
|
49850
|
+
var originalDate = options._originalDate || date;
|
49851
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
49852
|
+
switch (token) {
|
49853
|
+
case "O":
|
49854
|
+
case "OO":
|
49855
|
+
case "OOO":
|
49856
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
49857
|
+
case "OOOO":
|
49858
|
+
default:
|
49859
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
49860
|
+
}
|
49861
|
+
},
|
49862
|
+
z: function(date, token, _localize, options) {
|
49863
|
+
var originalDate = options._originalDate || date;
|
49864
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
49865
|
+
switch (token) {
|
49866
|
+
case "z":
|
49867
|
+
case "zz":
|
49868
|
+
case "zzz":
|
49869
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
49870
|
+
case "zzzz":
|
49871
|
+
default:
|
49872
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
49873
|
+
}
|
49874
|
+
},
|
49875
|
+
t: function(date, token, _localize, options) {
|
49876
|
+
var originalDate = options._originalDate || date;
|
49877
|
+
var timestamp = Math.floor(originalDate.getTime() / 1e3);
|
49878
|
+
return addLeadingZeros(timestamp, token.length);
|
49879
|
+
},
|
49880
|
+
T: function(date, token, _localize, options) {
|
49881
|
+
var originalDate = options._originalDate || date;
|
49882
|
+
var timestamp = originalDate.getTime();
|
49883
|
+
return addLeadingZeros(timestamp, token.length);
|
49884
|
+
}
|
49885
|
+
};
|
49886
|
+
function formatTimezoneShort(offset, dirtyDelimiter) {
|
49887
|
+
var sign5 = offset > 0 ? "-" : "+";
|
49888
|
+
var absOffset = Math.abs(offset);
|
49889
|
+
var hours = Math.floor(absOffset / 60);
|
49890
|
+
var minutes = absOffset % 60;
|
49891
|
+
if (minutes === 0) {
|
49892
|
+
return sign5 + String(hours);
|
49893
|
+
}
|
49894
|
+
var delimiter = dirtyDelimiter || "";
|
49895
|
+
return sign5 + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
49896
|
+
}
|
49897
|
+
__name(formatTimezoneShort, "formatTimezoneShort");
|
49898
|
+
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
49899
|
+
if (offset % 60 === 0) {
|
49900
|
+
var sign5 = offset > 0 ? "-" : "+";
|
49901
|
+
return sign5 + addLeadingZeros(Math.abs(offset) / 60, 2);
|
49902
|
+
}
|
49903
|
+
return formatTimezone(offset, dirtyDelimiter);
|
49904
|
+
}
|
49905
|
+
__name(formatTimezoneWithOptionalMinutes, "formatTimezoneWithOptionalMinutes");
|
49906
|
+
function formatTimezone(offset, dirtyDelimiter) {
|
49907
|
+
var delimiter = dirtyDelimiter || "";
|
49908
|
+
var sign5 = offset > 0 ? "-" : "+";
|
49909
|
+
var absOffset = Math.abs(offset);
|
49910
|
+
var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
|
49911
|
+
var minutes = addLeadingZeros(absOffset % 60, 2);
|
49912
|
+
return sign5 + hours + delimiter + minutes;
|
49913
|
+
}
|
49914
|
+
__name(formatTimezone, "formatTimezone");
|
49915
|
+
var formatters_default = formatters2;
|
49916
|
+
|
49917
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/format/longFormatters/index.js
|
49918
|
+
function dateLongFormatter(pattern, formatLong2) {
|
49919
|
+
switch (pattern) {
|
49920
|
+
case "P":
|
49921
|
+
return formatLong2.date({
|
49922
|
+
width: "short"
|
49923
|
+
});
|
49924
|
+
case "PP":
|
49925
|
+
return formatLong2.date({
|
49926
|
+
width: "medium"
|
49927
|
+
});
|
49928
|
+
case "PPP":
|
49929
|
+
return formatLong2.date({
|
49930
|
+
width: "long"
|
49931
|
+
});
|
49932
|
+
case "PPPP":
|
49933
|
+
default:
|
49934
|
+
return formatLong2.date({
|
49935
|
+
width: "full"
|
49936
|
+
});
|
49937
|
+
}
|
49938
|
+
}
|
49939
|
+
__name(dateLongFormatter, "dateLongFormatter");
|
49940
|
+
function timeLongFormatter(pattern, formatLong2) {
|
49941
|
+
switch (pattern) {
|
49942
|
+
case "p":
|
49943
|
+
return formatLong2.time({
|
49944
|
+
width: "short"
|
49945
|
+
});
|
49946
|
+
case "pp":
|
49947
|
+
return formatLong2.time({
|
49948
|
+
width: "medium"
|
49949
|
+
});
|
49950
|
+
case "ppp":
|
49951
|
+
return formatLong2.time({
|
49952
|
+
width: "long"
|
49953
|
+
});
|
49954
|
+
case "pppp":
|
49955
|
+
default:
|
49956
|
+
return formatLong2.time({
|
49957
|
+
width: "full"
|
49958
|
+
});
|
49959
|
+
}
|
49960
|
+
}
|
49961
|
+
__name(timeLongFormatter, "timeLongFormatter");
|
49962
|
+
function dateTimeLongFormatter(pattern, formatLong2) {
|
49963
|
+
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
49964
|
+
var datePattern = matchResult[1];
|
49965
|
+
var timePattern = matchResult[2];
|
49966
|
+
if (!timePattern) {
|
49967
|
+
return dateLongFormatter(pattern, formatLong2);
|
49968
|
+
}
|
49969
|
+
var dateTimeFormat;
|
49970
|
+
switch (datePattern) {
|
49971
|
+
case "P":
|
49972
|
+
dateTimeFormat = formatLong2.dateTime({
|
49973
|
+
width: "short"
|
49974
|
+
});
|
49975
|
+
break;
|
49976
|
+
case "PP":
|
49977
|
+
dateTimeFormat = formatLong2.dateTime({
|
49978
|
+
width: "medium"
|
49979
|
+
});
|
49980
|
+
break;
|
49981
|
+
case "PPP":
|
49982
|
+
dateTimeFormat = formatLong2.dateTime({
|
49983
|
+
width: "long"
|
49984
|
+
});
|
49985
|
+
break;
|
49986
|
+
case "PPPP":
|
49987
|
+
default:
|
49988
|
+
dateTimeFormat = formatLong2.dateTime({
|
49989
|
+
width: "full"
|
49990
|
+
});
|
49991
|
+
break;
|
49992
|
+
}
|
49993
|
+
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
|
49994
|
+
}
|
49995
|
+
__name(dateTimeLongFormatter, "dateTimeLongFormatter");
|
49996
|
+
var longFormatters = {
|
49997
|
+
p: timeLongFormatter,
|
49998
|
+
P: dateTimeLongFormatter
|
49999
|
+
};
|
50000
|
+
var longFormatters_default = longFormatters;
|
50001
|
+
|
50002
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/_lib/protectedTokens/index.js
|
50003
|
+
var protectedDayOfYearTokens = ["D", "DD"];
|
50004
|
+
var protectedWeekYearTokens = ["YY", "YYYY"];
|
50005
|
+
function isProtectedDayOfYearToken(token) {
|
50006
|
+
return protectedDayOfYearTokens.indexOf(token) !== -1;
|
50007
|
+
}
|
50008
|
+
__name(isProtectedDayOfYearToken, "isProtectedDayOfYearToken");
|
50009
|
+
function isProtectedWeekYearToken(token) {
|
50010
|
+
return protectedWeekYearTokens.indexOf(token) !== -1;
|
50011
|
+
}
|
50012
|
+
__name(isProtectedWeekYearToken, "isProtectedWeekYearToken");
|
50013
|
+
function throwProtectedError(token, format2, input) {
|
50014
|
+
if (token === "YYYY") {
|
50015
|
+
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
50016
|
+
} else if (token === "YY") {
|
50017
|
+
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
50018
|
+
} else if (token === "D") {
|
50019
|
+
throw new RangeError("Use `d` instead of `D` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
50020
|
+
} else if (token === "DD") {
|
50021
|
+
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
50022
|
+
}
|
50023
|
+
}
|
50024
|
+
__name(throwProtectedError, "throwProtectedError");
|
50025
|
+
|
50026
|
+
// ../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/format/index.js
|
50027
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
50028
|
+
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
50029
|
+
var escapedStringRegExp = /^'([^]*?)'?$/;
|
50030
|
+
var doubleQuoteRegExp = /''/g;
|
50031
|
+
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
50032
|
+
function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
50033
|
+
requiredArgs(2, arguments);
|
50034
|
+
var formatStr = String(dirtyFormatStr);
|
50035
|
+
var options = dirtyOptions || {};
|
50036
|
+
var locale2 = options.locale || en_US_default;
|
50037
|
+
var localeFirstWeekContainsDate = locale2.options && locale2.options.firstWeekContainsDate;
|
50038
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
50039
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
50040
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
50041
|
+
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
50042
|
+
}
|
50043
|
+
var localeWeekStartsOn = locale2.options && locale2.options.weekStartsOn;
|
50044
|
+
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
50045
|
+
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
|
50046
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
50047
|
+
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
50048
|
+
}
|
50049
|
+
if (!locale2.localize) {
|
50050
|
+
throw new RangeError("locale must contain localize property");
|
50051
|
+
}
|
50052
|
+
if (!locale2.formatLong) {
|
50053
|
+
throw new RangeError("locale must contain formatLong property");
|
50054
|
+
}
|
50055
|
+
var originalDate = toDate(dirtyDate);
|
50056
|
+
if (!isValid(originalDate)) {
|
50057
|
+
throw new RangeError("Invalid time value");
|
50058
|
+
}
|
50059
|
+
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
|
50060
|
+
var utcDate = subMilliseconds(originalDate, timezoneOffset);
|
50061
|
+
var formatterOptions = {
|
50062
|
+
firstWeekContainsDate,
|
50063
|
+
weekStartsOn,
|
50064
|
+
locale: locale2,
|
50065
|
+
_originalDate: originalDate
|
50066
|
+
};
|
50067
|
+
var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
|
50068
|
+
var firstCharacter = substring[0];
|
50069
|
+
if (firstCharacter === "p" || firstCharacter === "P") {
|
50070
|
+
var longFormatter = longFormatters_default[firstCharacter];
|
50071
|
+
return longFormatter(substring, locale2.formatLong, formatterOptions);
|
50072
|
+
}
|
50073
|
+
return substring;
|
50074
|
+
}).join("").match(formattingTokensRegExp).map(function(substring) {
|
50075
|
+
if (substring === "''") {
|
50076
|
+
return "'";
|
50077
|
+
}
|
50078
|
+
var firstCharacter = substring[0];
|
50079
|
+
if (firstCharacter === "'") {
|
50080
|
+
return cleanEscapedString(substring);
|
50081
|
+
}
|
50082
|
+
var formatter = formatters_default[firstCharacter];
|
50083
|
+
if (formatter) {
|
50084
|
+
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
|
50085
|
+
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
50086
|
+
}
|
50087
|
+
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
|
50088
|
+
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
50089
|
+
}
|
50090
|
+
return formatter(utcDate, substring, locale2.localize, formatterOptions);
|
50091
|
+
}
|
50092
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
50093
|
+
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
|
50094
|
+
}
|
50095
|
+
return substring;
|
50096
|
+
}).join("");
|
50097
|
+
return result;
|
50098
|
+
}
|
50099
|
+
__name(format, "format");
|
50100
|
+
function cleanEscapedString(input) {
|
50101
|
+
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
50102
|
+
}
|
50103
|
+
__name(cleanEscapedString, "cleanEscapedString");
|
50104
|
+
|
48595
50105
|
// src/wallet/verify.ts
|
50106
|
+
var transformErrorMessage = /* @__PURE__ */ __name((error, credential) => {
|
50107
|
+
if (error.startsWith("expiration")) {
|
50108
|
+
return credential.expirationDate ? `Invalid \u2022 Expired ${format(new Date(credential.expirationDate), "dd MMM yyyy").toUpperCase()}` : "Invalid \u2022 Expired";
|
50109
|
+
}
|
50110
|
+
return error;
|
50111
|
+
}, "transformErrorMessage");
|
50112
|
+
var transformCheckMessage = /* @__PURE__ */ __name((check, credential) => {
|
50113
|
+
return {
|
50114
|
+
proof: "Valid",
|
50115
|
+
expiration: credential.expirationDate ? `Valid \u2022 Expires ${format(new Date(credential.expirationDate), "dd MMM yyyy").toUpperCase()}` : "Valid \u2022 Does Not Expire"
|
50116
|
+
}[check] || check;
|
50117
|
+
}, "transformCheckMessage");
|
48596
50118
|
var verifyCredential3 = /* @__PURE__ */ __name((wallet) => {
|
48597
50119
|
return (credential) => __async(void 0, null, function* () {
|
48598
50120
|
const rawVerificationCheck = yield wallet.pluginMethods.verifyCredential(credential);
|
@@ -48601,7 +50123,7 @@ var verifyCredential3 = /* @__PURE__ */ __name((wallet) => {
|
|
48601
50123
|
verificationItems.push({
|
48602
50124
|
status: VerificationStatus.Failed,
|
48603
50125
|
check: "hmm",
|
48604
|
-
details: error
|
50126
|
+
details: transformErrorMessage(error, credential)
|
48605
50127
|
});
|
48606
50128
|
});
|
48607
50129
|
rawVerificationCheck.warnings.forEach((warning) => {
|
@@ -48615,7 +50137,7 @@ var verifyCredential3 = /* @__PURE__ */ __name((wallet) => {
|
|
48615
50137
|
verificationItems.push({
|
48616
50138
|
status: VerificationStatus.Success,
|
48617
50139
|
check,
|
48618
|
-
message: check
|
50140
|
+
message: transformCheckMessage(check, credential)
|
48619
50141
|
});
|
48620
50142
|
});
|
48621
50143
|
return verificationItems;
|
@@ -48640,9 +50162,13 @@ var defaultCeramicIDXArgs = {
|
|
48640
50162
|
};
|
48641
50163
|
|
48642
50164
|
// src/wallet/init.ts
|
48643
|
-
var
|
50165
|
+
var walletFromKey = /* @__PURE__ */ __name((_0, ..._1) => __async(void 0, [_0, ..._1], function* (key2, {
|
50166
|
+
ceramicIdx = defaultCeramicIDXArgs,
|
50167
|
+
didkit,
|
50168
|
+
defaultContents = []
|
50169
|
+
} = {}) {
|
48644
50170
|
yield didkit_default(didkit);
|
48645
|
-
const didkeyWallet = yield (yield generateWallet(defaultContents)).addPlugin(
|
50171
|
+
const didkeyWallet = yield (yield generateWallet(defaultContents)).addPlugin(yield getDidKeyPlugin(key2));
|
48646
50172
|
const didkeyAndVCWallet = yield didkeyWallet.addPlugin(yield getVCPlugin(didkeyWallet));
|
48647
50173
|
const idxWallet = yield didkeyAndVCWallet.addPlugin(yield getIDXPlugin(didkeyAndVCWallet, ceramicIdx));
|
48648
50174
|
const wallet = yield idxWallet.addPlugin(ExpirationPlugin(idxWallet));
|
@@ -48667,11 +50193,6 @@ var createWallet = /* @__PURE__ */ __name((_0, ..._1) => __async(void 0, [_0, ..
|
|
48667
50193
|
readFromCeramic: wallet.pluginMethods.readContentFromCeramic,
|
48668
50194
|
getTestVc: wallet.pluginMethods.getTestVc
|
48669
50195
|
};
|
48670
|
-
}), "createWallet");
|
48671
|
-
var walletFromKey = /* @__PURE__ */ __name((_0, ..._1) => __async(void 0, [_0, ..._1], function* (key2, { ceramicIdx = defaultCeramicIDXArgs, didkit } = {}) {
|
48672
|
-
yield didkit_default(didkit);
|
48673
|
-
const didDocuments = yield DidKeyPlugin.pluginConstants.generateContentFromSeed(toUint8Array(key2.padStart(64, "0")));
|
48674
|
-
return createWallet(didDocuments, { ceramicIdx, didkit });
|
48675
50196
|
}), "walletFromKey");
|
48676
50197
|
/*!
|
48677
50198
|
* Copyright (c) 2014, GMO GlobalSign
|