@pod-os/elements 0.1.2-22a1ef1.0 → 0.1.2-991c3d7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/elements.cjs.js +1 -1
- package/dist/cjs/{ion-app_34.cjs.entry.js → ion-app_36.cjs.entry.js} +347 -106
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/apps/pos-app-generic/pos-app-generic.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/pos-image/BrokenImage.js +4 -0
- package/dist/collection/components/pos-image/pos-image.css +23 -0
- package/dist/collection/components/pos-image/pos-image.js +103 -0
- package/dist/collection/test/mockPodOS.js +1 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +326 -107
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/p-a1ea5e25.entry.js +61 -0
- package/dist/esm/elements.js +1 -1
- package/dist/esm/{ion-app_34.entry.js → ion-app_36.entry.js} +346 -107
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/pos-image/BrokenImage.d.ts +6 -0
- package/dist/types/components/pos-image/pos-image.d.ts +15 -0
- package/dist/types/components.d.ts +20 -0
- package/dist/types/test/mockPodOS.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +35 -0
- package/dist/cjs/ion-skeleton-text.cjs.entry.js +0 -33
- package/dist/elements/p-7986b311.entry.js +0 -61
- package/dist/elements/p-a9dafdf2.entry.js +0 -1
- package/dist/esm/ion-skeleton-text.entry.js +0 -29
|
@@ -1844,6 +1844,30 @@ const Row = class {
|
|
|
1844
1844
|
};
|
|
1845
1845
|
Row.style = rowCss;
|
|
1846
1846
|
|
|
1847
|
+
const skeletonTextCss = ":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}";
|
|
1848
|
+
|
|
1849
|
+
const SkeletonText = class {
|
|
1850
|
+
constructor(hostRef) {
|
|
1851
|
+
index$1.registerInstance(this, hostRef);
|
|
1852
|
+
/**
|
|
1853
|
+
* If `true`, the skeleton text will animate.
|
|
1854
|
+
*/
|
|
1855
|
+
this.animated = false;
|
|
1856
|
+
}
|
|
1857
|
+
render() {
|
|
1858
|
+
const animated = this.animated && ionicGlobal.config.getBoolean('animated', true);
|
|
1859
|
+
const inMedia = theme.hostContext('ion-avatar', this.el) || theme.hostContext('ion-thumbnail', this.el);
|
|
1860
|
+
const mode = ionicGlobal.getIonMode(this);
|
|
1861
|
+
return (index$1.h(index$1.Host, { class: {
|
|
1862
|
+
[mode]: true,
|
|
1863
|
+
'skeleton-text-animated': animated,
|
|
1864
|
+
'in-media': inMedia
|
|
1865
|
+
} }, index$1.h("span", null, "\u00A0")));
|
|
1866
|
+
}
|
|
1867
|
+
get el() { return index$1.getElement(this); }
|
|
1868
|
+
};
|
|
1869
|
+
SkeletonText.style = skeletonTextCss;
|
|
1870
|
+
|
|
1847
1871
|
const titleIosCss = ":host{--color:initial;display:flex;flex:1;align-items:center;transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{left:0;top:0;padding-left:90px;padding-right:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;transform:translateZ(0);font-size:17px;font-weight:600;text-align:center;box-sizing:border-box;pointer-events:none}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px}}:host(.title-small){padding-left:9px;padding-right:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:13px;font-weight:normal}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.title-small){padding-left:unset;padding-right:unset;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px}}:host(.title-large){padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;transform-origin:left center;bottom:0;align-items:flex-end;min-width:100%;padding-bottom:6px;font-size:34px;font-weight:700;text-align:start}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.title-large){padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host(.title-large.title-rtl){transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000)}:host(.title-large) .toolbar-title{transform-origin:inherit}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{transform-origin:calc(100% - inherit)}";
|
|
1848
1872
|
|
|
1849
1873
|
const titleMdCss = ":host{--color:initial;display:flex;flex:1;align-items:center;transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{padding-left:20px;padding-right:20px;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;letter-spacing:0.0125em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}:host(.title-small){width:100%;height:100%;font-size:15px;font-weight:normal}";
|
|
@@ -2645,26 +2669,26 @@ var require_InruptError = __commonJS({
|
|
|
2645
2669
|
}
|
|
2646
2670
|
static lookupErrorIri(iri, messageParams) {
|
|
2647
2671
|
if (InruptError.determineIfVocabTerm(iri)) {
|
|
2648
|
-
const
|
|
2649
|
-
return
|
|
2672
|
+
const message2 = messageParams === void 0 ? iri.message : iri.messageParams(...messageParams);
|
|
2673
|
+
return message2 === void 0 ? `Looked up error message IRI [${iri.value}], but found no message value.` : message2;
|
|
2650
2674
|
}
|
|
2651
2675
|
return `Error message looked up at: [${iri.value}]${messageParams === void 0 ? "" : `, with params [${messageParams.toString()}]`}`;
|
|
2652
2676
|
}
|
|
2653
|
-
static appendHttpResponseDetails(
|
|
2677
|
+
static appendHttpResponseDetails(message2, response, append) {
|
|
2654
2678
|
if (append && typeof response !== "undefined") {
|
|
2655
|
-
return `${
|
|
2679
|
+
return `${message2} HTTP details: status code [${response.status}], status text [${response.statusText}].`;
|
|
2656
2680
|
}
|
|
2657
|
-
return
|
|
2681
|
+
return message2;
|
|
2658
2682
|
}
|
|
2659
|
-
static appendErrorIri(
|
|
2660
|
-
return append ? `${
|
|
2683
|
+
static appendErrorIri(message2, iri, append) {
|
|
2684
|
+
return append ? `${message2} Error IRI: [${iri.value}].` : message2;
|
|
2661
2685
|
}
|
|
2662
|
-
static substituteParams(
|
|
2663
|
-
let fullMessage =
|
|
2686
|
+
static substituteParams(message2, params) {
|
|
2687
|
+
let fullMessage = message2;
|
|
2664
2688
|
if (params !== void 0) {
|
|
2665
|
-
const paramsRequired =
|
|
2689
|
+
const paramsRequired = message2.split("{{").length - 1;
|
|
2666
2690
|
if (paramsRequired !== params.length) {
|
|
2667
|
-
throw new Error(`Setting parameters on message [${
|
|
2691
|
+
throw new Error(`Setting parameters on message [${message2}], but it requires [${paramsRequired}] params and we received [${params.length}].`);
|
|
2668
2692
|
}
|
|
2669
2693
|
for (let i = 0; i < params.length; i += 1) {
|
|
2670
2694
|
const marker = `{{${i}}}`;
|
|
@@ -3094,10 +3118,10 @@ var require_browser_ponyfill = __commonJS({
|
|
|
3094
3118
|
try {
|
|
3095
3119
|
new exports2.DOMException();
|
|
3096
3120
|
} catch (err) {
|
|
3097
|
-
exports2.DOMException = function(
|
|
3098
|
-
this.message =
|
|
3121
|
+
exports2.DOMException = function(message2, name) {
|
|
3122
|
+
this.message = message2;
|
|
3099
3123
|
this.name = name;
|
|
3100
|
-
var error2 = Error(
|
|
3124
|
+
var error2 = Error(message2);
|
|
3101
3125
|
this.stack = error2.stack;
|
|
3102
3126
|
};
|
|
3103
3127
|
exports2.DOMException.prototype = Object.create(Error.prototype);
|
|
@@ -3329,9 +3353,9 @@ var JOSEError, JWTClaimValidationFailed, JWTExpired, JOSEAlgNotAllowed, JOSENotS
|
|
|
3329
3353
|
var init_errors = __esm({
|
|
3330
3354
|
"../node_modules/jose/dist/browser/util/errors.js"() {
|
|
3331
3355
|
JOSEError = class extends Error {
|
|
3332
|
-
constructor(
|
|
3356
|
+
constructor(message2) {
|
|
3333
3357
|
var _a;
|
|
3334
|
-
super(
|
|
3358
|
+
super(message2);
|
|
3335
3359
|
this.code = "ERR_JOSE_GENERIC";
|
|
3336
3360
|
this.name = this.constructor.name;
|
|
3337
3361
|
(_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, this, this.constructor);
|
|
@@ -3341,8 +3365,8 @@ var init_errors = __esm({
|
|
|
3341
3365
|
}
|
|
3342
3366
|
};
|
|
3343
3367
|
JWTClaimValidationFailed = class extends JOSEError {
|
|
3344
|
-
constructor(
|
|
3345
|
-
super(
|
|
3368
|
+
constructor(message2, claim = "unspecified", reason = "unspecified") {
|
|
3369
|
+
super(message2);
|
|
3346
3370
|
this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
3347
3371
|
this.claim = claim;
|
|
3348
3372
|
this.reason = reason;
|
|
@@ -3352,8 +3376,8 @@ var init_errors = __esm({
|
|
|
3352
3376
|
}
|
|
3353
3377
|
};
|
|
3354
3378
|
JWTExpired = class extends JOSEError {
|
|
3355
|
-
constructor(
|
|
3356
|
-
super(
|
|
3379
|
+
constructor(message2, claim = "unspecified", reason = "unspecified") {
|
|
3380
|
+
super(message2);
|
|
3357
3381
|
this.code = "ERR_JWT_EXPIRED";
|
|
3358
3382
|
this.claim = claim;
|
|
3359
3383
|
this.reason = reason;
|
|
@@ -3535,8 +3559,9 @@ var init_check_cek_length = __esm({
|
|
|
3535
3559
|
"../node_modules/jose/dist/browser/runtime/check_cek_length.js"() {
|
|
3536
3560
|
init_errors();
|
|
3537
3561
|
checkCekLength = (cek, expected) => {
|
|
3538
|
-
|
|
3539
|
-
|
|
3562
|
+
const actual = cek.byteLength << 3;
|
|
3563
|
+
if (actual !== expected) {
|
|
3564
|
+
throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`);
|
|
3540
3565
|
}
|
|
3541
3566
|
};
|
|
3542
3567
|
check_cek_length_default = checkCekLength;
|
|
@@ -3571,7 +3596,7 @@ var init_timing_safe_equal = __esm({
|
|
|
3571
3596
|
|
|
3572
3597
|
// ../node_modules/jose/dist/browser/runtime/env.js
|
|
3573
3598
|
function isCloudflareWorkers() {
|
|
3574
|
-
return typeof WebSocketPair === "
|
|
3599
|
+
return typeof WebSocketPair !== "undefined" || typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime !== "undefined" && EdgeRuntime === "vercel";
|
|
3575
3600
|
}
|
|
3576
3601
|
var init_env = __esm({
|
|
3577
3602
|
"../node_modules/jose/dist/browser/runtime/env.js"() {
|
|
@@ -3654,6 +3679,12 @@ function checkSigCryptoKey(key, alg, ...usages) {
|
|
|
3654
3679
|
throw unusable("NODE-ED25519");
|
|
3655
3680
|
break;
|
|
3656
3681
|
}
|
|
3682
|
+
case "EdDSA": {
|
|
3683
|
+
if (key.algorithm.name !== "Ed25519" && key.algorithm.name !== "Ed448") {
|
|
3684
|
+
throw unusable("Ed25519 or Ed448");
|
|
3685
|
+
}
|
|
3686
|
+
break;
|
|
3687
|
+
}
|
|
3657
3688
|
case "ES256":
|
|
3658
3689
|
case "ES384":
|
|
3659
3690
|
case "ES512": {
|
|
@@ -3694,10 +3725,17 @@ function checkEncCryptoKey(key, alg, ...usages) {
|
|
|
3694
3725
|
throw unusable(expected, "algorithm.length");
|
|
3695
3726
|
break;
|
|
3696
3727
|
}
|
|
3697
|
-
case "ECDH":
|
|
3698
|
-
|
|
3699
|
-
|
|
3728
|
+
case "ECDH": {
|
|
3729
|
+
switch (key.algorithm.name) {
|
|
3730
|
+
case "ECDH":
|
|
3731
|
+
case "X25519":
|
|
3732
|
+
case "X448":
|
|
3733
|
+
break;
|
|
3734
|
+
default:
|
|
3735
|
+
throw unusable("ECDH, X25519, or X448");
|
|
3736
|
+
}
|
|
3700
3737
|
break;
|
|
3738
|
+
}
|
|
3701
3739
|
case "PBES2-HS256+A128KW":
|
|
3702
3740
|
case "PBES2-HS384+A192KW":
|
|
3703
3741
|
case "PBES2-HS512+A256KW":
|
|
@@ -3728,29 +3766,34 @@ var init_crypto_key = __esm({
|
|
|
3728
3766
|
});
|
|
3729
3767
|
|
|
3730
3768
|
// ../node_modules/jose/dist/browser/lib/invalid_key_input.js
|
|
3769
|
+
function message(msg2, actual, ...types2) {
|
|
3770
|
+
if (types2.length > 2) {
|
|
3771
|
+
const last = types2.pop();
|
|
3772
|
+
msg2 += `one of type ${types2.join(", ")}, or ${last}.`;
|
|
3773
|
+
} else if (types2.length === 2) {
|
|
3774
|
+
msg2 += `one of type ${types2[0]} or ${types2[1]}.`;
|
|
3775
|
+
} else {
|
|
3776
|
+
msg2 += `of type ${types2[0]}.`;
|
|
3777
|
+
}
|
|
3778
|
+
if (actual == null) {
|
|
3779
|
+
msg2 += ` Received ${actual}`;
|
|
3780
|
+
} else if (typeof actual === "function" && actual.name) {
|
|
3781
|
+
msg2 += ` Received function ${actual.name}`;
|
|
3782
|
+
} else if (typeof actual === "object" && actual != null) {
|
|
3783
|
+
if (actual.constructor && actual.constructor.name) {
|
|
3784
|
+
msg2 += ` Received an instance of ${actual.constructor.name}`;
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
return msg2;
|
|
3788
|
+
}
|
|
3789
|
+
function withAlg(alg, actual, ...types2) {
|
|
3790
|
+
return message(`Key for the ${alg} algorithm must be `, actual, ...types2);
|
|
3791
|
+
}
|
|
3731
3792
|
var invalid_key_input_default;
|
|
3732
3793
|
var init_invalid_key_input = __esm({
|
|
3733
3794
|
"../node_modules/jose/dist/browser/lib/invalid_key_input.js"() {
|
|
3734
3795
|
invalid_key_input_default = (actual, ...types2) => {
|
|
3735
|
-
|
|
3736
|
-
if (types2.length > 2) {
|
|
3737
|
-
const last = types2.pop();
|
|
3738
|
-
msg2 += `one of type ${types2.join(", ")}, or ${last}.`;
|
|
3739
|
-
} else if (types2.length === 2) {
|
|
3740
|
-
msg2 += `one of type ${types2[0]} or ${types2[1]}.`;
|
|
3741
|
-
} else {
|
|
3742
|
-
msg2 += `of type ${types2[0]}.`;
|
|
3743
|
-
}
|
|
3744
|
-
if (actual == null) {
|
|
3745
|
-
msg2 += ` Received ${actual}`;
|
|
3746
|
-
} else if (typeof actual === "function" && actual.name) {
|
|
3747
|
-
msg2 += ` Received function ${actual.name}`;
|
|
3748
|
-
} else if (typeof actual === "object" && actual != null) {
|
|
3749
|
-
if (actual.constructor && actual.constructor.name) {
|
|
3750
|
-
msg2 += ` Received an instance of ${actual.constructor.name}`;
|
|
3751
|
-
}
|
|
3752
|
-
}
|
|
3753
|
-
return msg2;
|
|
3796
|
+
return message("Key must be ", actual, ...types2);
|
|
3754
3797
|
};
|
|
3755
3798
|
}
|
|
3756
3799
|
});
|
|
@@ -3983,10 +4026,18 @@ async function deriveKey(publicKey, privateKey, algorithm, keyLength, apu = new
|
|
|
3983
4026
|
}
|
|
3984
4027
|
checkEncCryptoKey(privateKey, "ECDH", "deriveBits");
|
|
3985
4028
|
const value = concat(lengthAndInput(encoder.encode(algorithm)), lengthAndInput(apu), lengthAndInput(apv), uint32be(keyLength));
|
|
4029
|
+
let length;
|
|
4030
|
+
if (publicKey.algorithm.name === "X25519") {
|
|
4031
|
+
length = 256;
|
|
4032
|
+
} else if (publicKey.algorithm.name === "X448") {
|
|
4033
|
+
length = 448;
|
|
4034
|
+
} else {
|
|
4035
|
+
length = Math.ceil(parseInt(publicKey.algorithm.namedCurve.substr(-3), 10) / 8) << 3;
|
|
4036
|
+
}
|
|
3986
4037
|
const sharedSecret = new Uint8Array(await webcrypto_default.subtle.deriveBits({
|
|
3987
|
-
name:
|
|
4038
|
+
name: publicKey.algorithm.name,
|
|
3988
4039
|
public: publicKey
|
|
3989
|
-
}, privateKey,
|
|
4040
|
+
}, privateKey, length));
|
|
3990
4041
|
return concatKdf(sharedSecret, keyLength, value);
|
|
3991
4042
|
}
|
|
3992
4043
|
async function generateEpk(key) {
|
|
@@ -3999,7 +4050,7 @@ function ecdhAllowed(key) {
|
|
|
3999
4050
|
if (!isCryptoKey(key)) {
|
|
4000
4051
|
throw new TypeError(invalid_key_input_default(key, ...types));
|
|
4001
4052
|
}
|
|
4002
|
-
return ["P-256", "P-384", "P-521"].includes(key.algorithm.namedCurve);
|
|
4053
|
+
return ["P-256", "P-384", "P-521"].includes(key.algorithm.namedCurve) || key.algorithm.name === "X25519" || key.algorithm.name === "X448";
|
|
4003
4054
|
}
|
|
4004
4055
|
var init_ecdhes = __esm({
|
|
4005
4056
|
"../node_modules/jose/dist/browser/runtime/ecdhes.js"() {
|
|
@@ -4248,8 +4299,14 @@ var init_asn1 = __esm({
|
|
|
4248
4299
|
return "P-384";
|
|
4249
4300
|
case findOid(keyData, [43, 129, 4, 0, 35]):
|
|
4250
4301
|
return "P-521";
|
|
4251
|
-
case
|
|
4302
|
+
case findOid(keyData, [43, 101, 110]):
|
|
4303
|
+
return "X25519";
|
|
4304
|
+
case findOid(keyData, [43, 101, 111]):
|
|
4305
|
+
return "X448";
|
|
4306
|
+
case findOid(keyData, [43, 101, 112]):
|
|
4252
4307
|
return "Ed25519";
|
|
4308
|
+
case findOid(keyData, [43, 101, 113]):
|
|
4309
|
+
return "Ed448";
|
|
4253
4310
|
default:
|
|
4254
4311
|
throw new JOSENotSupported("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
4255
4312
|
}
|
|
@@ -4298,15 +4355,22 @@ var init_asn1 = __esm({
|
|
|
4298
4355
|
case "ECDH-ES":
|
|
4299
4356
|
case "ECDH-ES+A128KW":
|
|
4300
4357
|
case "ECDH-ES+A192KW":
|
|
4301
|
-
case "ECDH-ES+A256KW":
|
|
4302
|
-
|
|
4358
|
+
case "ECDH-ES+A256KW": {
|
|
4359
|
+
const namedCurve = getNamedCurve2(keyData);
|
|
4360
|
+
algorithm = namedCurve.startsWith("P-") ? { name: "ECDH", namedCurve } : { name: namedCurve };
|
|
4303
4361
|
keyUsages = isPublic ? [] : ["deriveBits"];
|
|
4304
4362
|
break;
|
|
4305
|
-
|
|
4363
|
+
}
|
|
4364
|
+
case (isCloudflareWorkers() && "EdDSA"): {
|
|
4306
4365
|
const namedCurve = getNamedCurve2(keyData).toUpperCase();
|
|
4307
4366
|
algorithm = { name: `NODE-${namedCurve}`, namedCurve: `NODE-${namedCurve}` };
|
|
4308
4367
|
keyUsages = isPublic ? ["verify"] : ["sign"];
|
|
4309
4368
|
break;
|
|
4369
|
+
}
|
|
4370
|
+
case "EdDSA":
|
|
4371
|
+
algorithm = { name: getNamedCurve2(keyData) };
|
|
4372
|
+
keyUsages = isPublic ? ["verify"] : ["sign"];
|
|
4373
|
+
break;
|
|
4310
4374
|
default:
|
|
4311
4375
|
throw new JOSENotSupported('Invalid or unsupported "alg" (Algorithm) value');
|
|
4312
4376
|
}
|
|
@@ -4429,9 +4493,27 @@ function subtleMapping(jwk) {
|
|
|
4429
4493
|
keyUsages = jwk.d ? ["sign"] : ["verify"];
|
|
4430
4494
|
break;
|
|
4431
4495
|
default:
|
|
4432
|
-
throw new JOSENotSupported('Invalid or unsupported JWK "
|
|
4496
|
+
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
4433
4497
|
}
|
|
4434
4498
|
break;
|
|
4499
|
+
case "OKP": {
|
|
4500
|
+
switch (jwk.alg) {
|
|
4501
|
+
case "EdDSA":
|
|
4502
|
+
algorithm = { name: jwk.crv };
|
|
4503
|
+
keyUsages = jwk.d ? ["sign"] : ["verify"];
|
|
4504
|
+
break;
|
|
4505
|
+
case "ECDH-ES":
|
|
4506
|
+
case "ECDH-ES+A128KW":
|
|
4507
|
+
case "ECDH-ES+A192KW":
|
|
4508
|
+
case "ECDH-ES+A256KW":
|
|
4509
|
+
algorithm = { name: jwk.crv };
|
|
4510
|
+
keyUsages = jwk.d ? ["deriveBits"] : [];
|
|
4511
|
+
break;
|
|
4512
|
+
default:
|
|
4513
|
+
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
4514
|
+
}
|
|
4515
|
+
break;
|
|
4516
|
+
}
|
|
4435
4517
|
default:
|
|
4436
4518
|
throw new JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
4437
4519
|
}
|
|
@@ -4491,18 +4573,12 @@ function parseElement(bytes) {
|
|
|
4491
4573
|
if (bytes[position] < 128) {
|
|
4492
4574
|
length = bytes[position];
|
|
4493
4575
|
position++;
|
|
4494
|
-
} else {
|
|
4495
|
-
let numberOfDigits = bytes[position] & 127;
|
|
4496
|
-
position++;
|
|
4497
|
-
length = 0;
|
|
4498
|
-
for (let i = 0; i < numberOfDigits; i++) {
|
|
4499
|
-
length = length * 256 + bytes[position];
|
|
4500
|
-
position++;
|
|
4501
|
-
}
|
|
4502
|
-
}
|
|
4503
|
-
if (length === 128) {
|
|
4576
|
+
} else if (length === 128) {
|
|
4504
4577
|
length = 0;
|
|
4505
4578
|
while (bytes[position + length] !== 0 || bytes[position + length + 1] !== 0) {
|
|
4579
|
+
if (length > bytes.byteLength) {
|
|
4580
|
+
throw new TypeError("invalid indefinite form length");
|
|
4581
|
+
}
|
|
4506
4582
|
length++;
|
|
4507
4583
|
}
|
|
4508
4584
|
const byteLength2 = position + length + 2;
|
|
@@ -4511,6 +4587,14 @@ function parseElement(bytes) {
|
|
|
4511
4587
|
contents: bytes.subarray(position, position + length),
|
|
4512
4588
|
raw: bytes.subarray(0, byteLength2)
|
|
4513
4589
|
};
|
|
4590
|
+
} else {
|
|
4591
|
+
let numberOfDigits = bytes[position] & 127;
|
|
4592
|
+
position++;
|
|
4593
|
+
length = 0;
|
|
4594
|
+
for (let i = 0; i < numberOfDigits; i++) {
|
|
4595
|
+
length = length * 256 + bytes[position];
|
|
4596
|
+
position++;
|
|
4597
|
+
}
|
|
4514
4598
|
}
|
|
4515
4599
|
const byteLength = position + length;
|
|
4516
4600
|
return {
|
|
@@ -4538,7 +4622,12 @@ async function importX509(x509, alg, options) {
|
|
|
4538
4622
|
if (typeof x509 !== "string" || x509.indexOf("-----BEGIN CERTIFICATE-----") !== 0) {
|
|
4539
4623
|
throw new TypeError('"x509" must be X.509 formatted string');
|
|
4540
4624
|
}
|
|
4541
|
-
|
|
4625
|
+
let spki;
|
|
4626
|
+
try {
|
|
4627
|
+
spki = getSPKI(x509);
|
|
4628
|
+
} catch (cause) {
|
|
4629
|
+
throw new TypeError("failed to parse the X.509 certificate", { cause });
|
|
4630
|
+
}
|
|
4542
4631
|
return fromSPKI(spki, alg, options);
|
|
4543
4632
|
}
|
|
4544
4633
|
async function importPKCS8(pkcs8, alg, options) {
|
|
@@ -4594,19 +4683,19 @@ var init_check_key_type = __esm({
|
|
|
4594
4683
|
"../node_modules/jose/dist/browser/lib/check_key_type.js"() {
|
|
4595
4684
|
init_invalid_key_input();
|
|
4596
4685
|
init_is_key_like();
|
|
4597
|
-
symmetricTypeCheck = (key) => {
|
|
4686
|
+
symmetricTypeCheck = (alg, key) => {
|
|
4598
4687
|
if (key instanceof Uint8Array)
|
|
4599
4688
|
return;
|
|
4600
4689
|
if (!is_key_like_default(key)) {
|
|
4601
|
-
throw new TypeError(
|
|
4690
|
+
throw new TypeError(withAlg(alg, key, ...types, "Uint8Array"));
|
|
4602
4691
|
}
|
|
4603
4692
|
if (key.type !== "secret") {
|
|
4604
4693
|
throw new TypeError(`${types.join(" or ")} instances for symmetric algorithms must be of type "secret"`);
|
|
4605
4694
|
}
|
|
4606
4695
|
};
|
|
4607
|
-
asymmetricTypeCheck = (key, usage) => {
|
|
4696
|
+
asymmetricTypeCheck = (alg, key, usage) => {
|
|
4608
4697
|
if (!is_key_like_default(key)) {
|
|
4609
|
-
throw new TypeError(
|
|
4698
|
+
throw new TypeError(withAlg(alg, key, ...types));
|
|
4610
4699
|
}
|
|
4611
4700
|
if (key.type === "secret") {
|
|
4612
4701
|
throw new TypeError(`${types.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);
|
|
@@ -4627,9 +4716,9 @@ var init_check_key_type = __esm({
|
|
|
4627
4716
|
checkKeyType = (alg, key, usage) => {
|
|
4628
4717
|
const symmetric = alg.startsWith("HS") || alg === "dir" || alg.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(alg);
|
|
4629
4718
|
if (symmetric) {
|
|
4630
|
-
symmetricTypeCheck(key);
|
|
4719
|
+
symmetricTypeCheck(alg, key);
|
|
4631
4720
|
} else {
|
|
4632
|
-
asymmetricTypeCheck(key, usage);
|
|
4721
|
+
asymmetricTypeCheck(alg, key, usage);
|
|
4633
4722
|
}
|
|
4634
4723
|
};
|
|
4635
4724
|
check_key_type_default = checkKeyType;
|
|
@@ -4731,7 +4820,7 @@ var init_aesgcmkw = __esm({
|
|
|
4731
4820
|
});
|
|
4732
4821
|
|
|
4733
4822
|
// ../node_modules/jose/dist/browser/lib/decrypt_key_management.js
|
|
4734
|
-
async function decryptKeyManagement(alg, key, encryptedKey, joseHeader) {
|
|
4823
|
+
async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) {
|
|
4735
4824
|
check_key_type_default(alg, key, "decrypt");
|
|
4736
4825
|
switch (alg) {
|
|
4737
4826
|
case "dir": {
|
|
@@ -4785,6 +4874,9 @@ async function decryptKeyManagement(alg, key, encryptedKey, joseHeader) {
|
|
|
4785
4874
|
throw new JWEInvalid("JWE Encrypted Key missing");
|
|
4786
4875
|
if (typeof joseHeader.p2c !== "number")
|
|
4787
4876
|
throw new JWEInvalid(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);
|
|
4877
|
+
const p2cLimit = (options === null || options === void 0 ? void 0 : options.maxPBES2Count) || 1e4;
|
|
4878
|
+
if (joseHeader.p2c > p2cLimit)
|
|
4879
|
+
throw new JWEInvalid(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);
|
|
4788
4880
|
if (typeof joseHeader.p2s !== "string")
|
|
4789
4881
|
throw new JWEInvalid(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`);
|
|
4790
4882
|
return decrypt2(alg, key, encryptedKey, joseHeader.p2c, decode(joseHeader.p2s));
|
|
@@ -4971,9 +5063,9 @@ async function flattenedDecrypt(jwe, key, options) {
|
|
|
4971
5063
|
}
|
|
4972
5064
|
let cek;
|
|
4973
5065
|
try {
|
|
4974
|
-
cek = await decrypt_key_management_default(alg, key, encryptedKey, joseHeader);
|
|
5066
|
+
cek = await decrypt_key_management_default(alg, key, encryptedKey, joseHeader, options);
|
|
4975
5067
|
} catch (err) {
|
|
4976
|
-
if (err instanceof TypeError) {
|
|
5068
|
+
if (err instanceof TypeError || err instanceof JWEInvalid || err instanceof JOSENotSupported) {
|
|
4977
5069
|
throw err;
|
|
4978
5070
|
}
|
|
4979
5071
|
cek = cek_default(enc);
|
|
@@ -5601,6 +5693,8 @@ function subtleDsa(alg, algorithm) {
|
|
|
5601
5693
|
case (isCloudflareWorkers() && "EdDSA"):
|
|
5602
5694
|
const { namedCurve } = algorithm;
|
|
5603
5695
|
return { name: namedCurve, namedCurve };
|
|
5696
|
+
case "EdDSA":
|
|
5697
|
+
return { name: algorithm.name };
|
|
5604
5698
|
default:
|
|
5605
5699
|
throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
|
|
5606
5700
|
}
|
|
@@ -6891,7 +6985,7 @@ function getModulusLengthOption(options) {
|
|
|
6891
6985
|
return modulusLength;
|
|
6892
6986
|
}
|
|
6893
6987
|
async function generateKeyPair(alg, options) {
|
|
6894
|
-
var _a, _b;
|
|
6988
|
+
var _a, _b, _c;
|
|
6895
6989
|
let algorithm;
|
|
6896
6990
|
let keyUsages;
|
|
6897
6991
|
switch (alg) {
|
|
@@ -6952,17 +7046,44 @@ async function generateKeyPair(alg, options) {
|
|
|
6952
7046
|
throw new JOSENotSupported("Invalid or unsupported crv option provided");
|
|
6953
7047
|
}
|
|
6954
7048
|
break;
|
|
7049
|
+
case "EdDSA":
|
|
7050
|
+
keyUsages = ["sign", "verify"];
|
|
7051
|
+
const crv = (_a = options === null || options === void 0 ? void 0 : options.crv) !== null && _a !== void 0 ? _a : "Ed25519";
|
|
7052
|
+
switch (crv) {
|
|
7053
|
+
case "Ed25519":
|
|
7054
|
+
case "Ed448":
|
|
7055
|
+
algorithm = { name: crv };
|
|
7056
|
+
break;
|
|
7057
|
+
default:
|
|
7058
|
+
throw new JOSENotSupported("Invalid or unsupported crv option provided");
|
|
7059
|
+
}
|
|
7060
|
+
break;
|
|
6955
7061
|
case "ECDH-ES":
|
|
6956
7062
|
case "ECDH-ES+A128KW":
|
|
6957
7063
|
case "ECDH-ES+A192KW":
|
|
6958
|
-
case "ECDH-ES+A256KW":
|
|
6959
|
-
algorithm = { name: "ECDH", namedCurve: (_a = options === null || options === void 0 ? void 0 : options.crv) !== null && _a !== void 0 ? _a : "P-256" };
|
|
7064
|
+
case "ECDH-ES+A256KW": {
|
|
6960
7065
|
keyUsages = ["deriveKey", "deriveBits"];
|
|
7066
|
+
const crv2 = (_b = options === null || options === void 0 ? void 0 : options.crv) !== null && _b !== void 0 ? _b : "P-256";
|
|
7067
|
+
switch (crv2) {
|
|
7068
|
+
case "P-256":
|
|
7069
|
+
case "P-384":
|
|
7070
|
+
case "P-521": {
|
|
7071
|
+
algorithm = { name: "ECDH", namedCurve: crv2 };
|
|
7072
|
+
break;
|
|
7073
|
+
}
|
|
7074
|
+
case "X25519":
|
|
7075
|
+
case "X448":
|
|
7076
|
+
algorithm = { name: crv2 };
|
|
7077
|
+
break;
|
|
7078
|
+
default:
|
|
7079
|
+
throw new JOSENotSupported("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448");
|
|
7080
|
+
}
|
|
6961
7081
|
break;
|
|
7082
|
+
}
|
|
6962
7083
|
default:
|
|
6963
7084
|
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
6964
7085
|
}
|
|
6965
|
-
return webcrypto_default.subtle.generateKey(algorithm, (
|
|
7086
|
+
return webcrypto_default.subtle.generateKey(algorithm, (_c = options === null || options === void 0 ? void 0 : options.extractable) !== null && _c !== void 0 ? _c : false, keyUsages);
|
|
6966
7087
|
}
|
|
6967
7088
|
var init_generate = __esm({
|
|
6968
7089
|
"../node_modules/jose/dist/browser/runtime/generate.js"() {
|
|
@@ -7350,8 +7471,8 @@ var require_ConfigurationError = __commonJS({
|
|
|
7350
7471
|
"../node_modules/@inrupt/solid-client-authn-core/dist/errors/ConfigurationError.js"(exports) {
|
|
7351
7472
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7352
7473
|
var ConfigurationError = class extends Error {
|
|
7353
|
-
constructor(
|
|
7354
|
-
super(
|
|
7474
|
+
constructor(message2) {
|
|
7475
|
+
super(message2);
|
|
7355
7476
|
}
|
|
7356
7477
|
};
|
|
7357
7478
|
exports.default = ConfigurationError;
|
|
@@ -7392,8 +7513,8 @@ var require_OidcProviderError = __commonJS({
|
|
|
7392
7513
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7393
7514
|
exports.OidcProviderError = void 0;
|
|
7394
7515
|
var OidcProviderError = class extends Error {
|
|
7395
|
-
constructor(
|
|
7396
|
-
super(
|
|
7516
|
+
constructor(message2, error2, errorDescription) {
|
|
7517
|
+
super(message2);
|
|
7397
7518
|
this.error = error2;
|
|
7398
7519
|
this.errorDescription = errorDescription;
|
|
7399
7520
|
}
|
|
@@ -18122,10 +18243,10 @@ var require_graphTypes = __commonJS({
|
|
|
18122
18243
|
var require_JsonLdError = __commonJS({
|
|
18123
18244
|
"../node_modules/jsonld/lib/JsonLdError.js"(exports, module2) {
|
|
18124
18245
|
module2.exports = class JsonLdError extends Error {
|
|
18125
|
-
constructor(
|
|
18126
|
-
super(
|
|
18246
|
+
constructor(message2 = "An unspecified JSON-LD error occurred.", name = "jsonld.Error", details = {}) {
|
|
18247
|
+
super(message2);
|
|
18127
18248
|
this.name = name;
|
|
18128
|
-
this.message =
|
|
18249
|
+
this.message = message2;
|
|
18129
18250
|
this.details = details;
|
|
18130
18251
|
}
|
|
18131
18252
|
};
|
|
@@ -24892,9 +25013,9 @@ var require_dom = __commonJS({
|
|
|
24892
25013
|
ExceptionCode.INVALID_MODIFICATION_ERR = (ExceptionMessage[13] = "Invalid modification", 13);
|
|
24893
25014
|
ExceptionCode.NAMESPACE_ERR = (ExceptionMessage[14] = "Invalid namespace", 14);
|
|
24894
25015
|
ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15);
|
|
24895
|
-
function DOMException(code,
|
|
24896
|
-
if (
|
|
24897
|
-
var error2 =
|
|
25016
|
+
function DOMException(code, message2) {
|
|
25017
|
+
if (message2 instanceof Error) {
|
|
25018
|
+
var error2 = message2;
|
|
24898
25019
|
} else {
|
|
24899
25020
|
error2 = this;
|
|
24900
25021
|
Error.call(this, ExceptionMessage[code]);
|
|
@@ -24903,8 +25024,8 @@ var require_dom = __commonJS({
|
|
|
24903
25024
|
Error.captureStackTrace(this, DOMException);
|
|
24904
25025
|
}
|
|
24905
25026
|
error2.code = code;
|
|
24906
|
-
if (
|
|
24907
|
-
this.message = this.message + ": " +
|
|
25027
|
+
if (message2)
|
|
25028
|
+
this.message = this.message + ": " + message2;
|
|
24908
25029
|
return error2;
|
|
24909
25030
|
}
|
|
24910
25031
|
DOMException.prototype = Error.prototype;
|
|
@@ -26195,8 +26316,8 @@ var require_sax = __commonJS({
|
|
|
26195
26316
|
var S_ATTR_END = 5;
|
|
26196
26317
|
var S_TAG_SPACE = 6;
|
|
26197
26318
|
var S_TAG_CLOSE = 7;
|
|
26198
|
-
function ParseError(
|
|
26199
|
-
this.message =
|
|
26319
|
+
function ParseError(message2, locator) {
|
|
26320
|
+
this.message = message2;
|
|
26200
26321
|
this.locator = locator;
|
|
26201
26322
|
if (Error.captureStackTrace)
|
|
26202
26323
|
Error.captureStackTrace(this, ParseError);
|
|
@@ -27060,6 +27181,63 @@ var BrowserSession = class {
|
|
|
27060
27181
|
}
|
|
27061
27182
|
};
|
|
27062
27183
|
|
|
27184
|
+
// src/files/BinaryFile.ts
|
|
27185
|
+
var BinaryFile = class {
|
|
27186
|
+
constructor(url, data) {
|
|
27187
|
+
this.url = url;
|
|
27188
|
+
this.data = data;
|
|
27189
|
+
}
|
|
27190
|
+
blob() {
|
|
27191
|
+
return this.data;
|
|
27192
|
+
}
|
|
27193
|
+
};
|
|
27194
|
+
|
|
27195
|
+
// src/files/BrokenFile.ts
|
|
27196
|
+
var BrokenFile = class {
|
|
27197
|
+
constructor(url, status) {
|
|
27198
|
+
this.url = url;
|
|
27199
|
+
this.status = status;
|
|
27200
|
+
}
|
|
27201
|
+
toString() {
|
|
27202
|
+
return `${this.status.toString()} - ${this.url}`;
|
|
27203
|
+
}
|
|
27204
|
+
blob() {
|
|
27205
|
+
return null;
|
|
27206
|
+
}
|
|
27207
|
+
};
|
|
27208
|
+
|
|
27209
|
+
// src/files/HttpStatus.ts
|
|
27210
|
+
var HttpStatus = class {
|
|
27211
|
+
constructor(code, text) {
|
|
27212
|
+
this.code = code;
|
|
27213
|
+
this.text = text;
|
|
27214
|
+
}
|
|
27215
|
+
toString() {
|
|
27216
|
+
return this.text ? `${this.code} - ${this.text}` : this.code.toString();
|
|
27217
|
+
}
|
|
27218
|
+
};
|
|
27219
|
+
|
|
27220
|
+
// src/files/FileFetcher.ts
|
|
27221
|
+
var FileFetcher = class {
|
|
27222
|
+
constructor(session) {
|
|
27223
|
+
this.session = session;
|
|
27224
|
+
}
|
|
27225
|
+
fetchFile(url) {
|
|
27226
|
+
return __async(this, null, function* () {
|
|
27227
|
+
const response = yield this.session.authenticatedFetch(url);
|
|
27228
|
+
if (response.ok) {
|
|
27229
|
+
const blob = yield response.blob();
|
|
27230
|
+
return new BinaryFile(url, blob);
|
|
27231
|
+
} else {
|
|
27232
|
+
return new BrokenFile(
|
|
27233
|
+
url,
|
|
27234
|
+
new HttpStatus(response.status, response.statusText)
|
|
27235
|
+
);
|
|
27236
|
+
}
|
|
27237
|
+
});
|
|
27238
|
+
}
|
|
27239
|
+
};
|
|
27240
|
+
|
|
27063
27241
|
// ../node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
27064
27242
|
function _defineProperties(target, props) {
|
|
27065
27243
|
for (var i = 0; i < props.length; i++) {
|
|
@@ -27475,8 +27653,8 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
|
|
|
27475
27653
|
throw new Error('NamedNode IRI "' + iri + '" must be absolute.');
|
|
27476
27654
|
}
|
|
27477
27655
|
if (_this.value.includes(" ")) {
|
|
27478
|
-
var
|
|
27479
|
-
throw new Error(
|
|
27656
|
+
var message2 = 'Error: NamedNode IRI "' + iri + '" must not contain unencoded spaces.';
|
|
27657
|
+
throw new Error(message2);
|
|
27480
27658
|
}
|
|
27481
27659
|
return _this;
|
|
27482
27660
|
}
|
|
@@ -30960,8 +31138,8 @@ var N3Parser = class {
|
|
|
30960
31138
|
_emit(subject, predicate, object, graph3) {
|
|
30961
31139
|
this._callback(null, this._quad(subject, predicate, object, graph3 || this.DEFAULTGRAPH));
|
|
30962
31140
|
}
|
|
30963
|
-
_error(
|
|
30964
|
-
const err = new Error(`${
|
|
31141
|
+
_error(message2, token) {
|
|
31142
|
+
const err = new Error(`${message2} on line ${token.line}.`);
|
|
30965
31143
|
err.context = {
|
|
30966
31144
|
token,
|
|
30967
31145
|
line: token.line,
|
|
@@ -38664,13 +38842,13 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
38664
38842
|
}
|
|
38665
38843
|
}
|
|
38666
38844
|
}, function(err) {
|
|
38667
|
-
var
|
|
38668
|
-
|
|
38669
|
-
console.log(
|
|
38845
|
+
var message2 = err.message || err.statusText;
|
|
38846
|
+
message2 = "Failed to load <" + uri + "> " + message2;
|
|
38847
|
+
console.log(message2);
|
|
38670
38848
|
if (err.response && err.response.status) {
|
|
38671
|
-
|
|
38849
|
+
message2 += " status: " + err.response.status;
|
|
38672
38850
|
}
|
|
38673
|
-
userCallback(false,
|
|
38851
|
+
userCallback(false, message2, err.response);
|
|
38674
38852
|
});
|
|
38675
38853
|
}
|
|
38676
38854
|
}, {
|
|
@@ -39162,16 +39340,16 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
39162
39340
|
return this.redirectToProxy(proxyUri, options);
|
|
39163
39341
|
}
|
|
39164
39342
|
}
|
|
39165
|
-
var
|
|
39343
|
+
var message2;
|
|
39166
39344
|
if (response instanceof Error) {
|
|
39167
|
-
|
|
39345
|
+
message2 = "Fetch error: " + response.message;
|
|
39168
39346
|
} else {
|
|
39169
|
-
|
|
39347
|
+
message2 = response.statusText;
|
|
39170
39348
|
if (response.responseText) {
|
|
39171
|
-
|
|
39349
|
+
message2 += " ".concat(response.responseText);
|
|
39172
39350
|
}
|
|
39173
39351
|
}
|
|
39174
|
-
return this.failFetch(options,
|
|
39352
|
+
return this.failFetch(options, message2, response.status || 998, response);
|
|
39175
39353
|
}
|
|
39176
39354
|
}, {
|
|
39177
39355
|
key: "addType",
|
|
@@ -39618,6 +39796,7 @@ var PodOS = class {
|
|
|
39618
39796
|
constructor() {
|
|
39619
39797
|
this.session = new BrowserSession();
|
|
39620
39798
|
this.store = new Store(this.session);
|
|
39799
|
+
this.fileFetcher = new FileFetcher(this.session);
|
|
39621
39800
|
}
|
|
39622
39801
|
handleIncomingRedirect() {
|
|
39623
39802
|
this.session.handleIncomingRedirect();
|
|
@@ -39625,6 +39804,9 @@ var PodOS = class {
|
|
|
39625
39804
|
fetch(uri) {
|
|
39626
39805
|
return this.store.fetch(uri);
|
|
39627
39806
|
}
|
|
39807
|
+
fetchFile(url) {
|
|
39808
|
+
return this.fileFetcher.fetchFile(url);
|
|
39809
|
+
}
|
|
39628
39810
|
trackSession(callback) {
|
|
39629
39811
|
return this.session.trackSession(callback);
|
|
39630
39812
|
}
|
|
@@ -39725,7 +39907,7 @@ const PosAppGeneric = class {
|
|
|
39725
39907
|
index$1.registerInstance(this, hostRef);
|
|
39726
39908
|
}
|
|
39727
39909
|
render() {
|
|
39728
|
-
return (index$1.h("ion-grid", null, index$1.h("ion-row", null, index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("ion-card", null, index$1.h("ion-card-header", null, index$1.h("
|
|
39910
|
+
return (index$1.h("ion-grid", null, index$1.h("ion-row", null, index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("ion-card", null, index$1.h("ion-card-header", null, index$1.h("pos-image", { src: "https://dummyimage.com/250/eee/000" }), index$1.h("ion-card-title", null, index$1.h("pos-label", null))), index$1.h("ion-card-content", null, index$1.h("pos-description", null)))), index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("pos-literals", null)), index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("pos-relations", null), index$1.h("pos-reverse-relations", null)))));
|
|
39729
39911
|
}
|
|
39730
39912
|
};
|
|
39731
39913
|
|
|
@@ -39754,6 +39936,63 @@ const PosDescription = class {
|
|
|
39754
39936
|
}
|
|
39755
39937
|
};
|
|
39756
39938
|
|
|
39939
|
+
const BrokenImage = ({ file }) => {
|
|
39940
|
+
return index$1.h("div", { class: "error" }, file.toString());
|
|
39941
|
+
};
|
|
39942
|
+
|
|
39943
|
+
const posImageCss = ":host{--width:300px;--height:300px;--border-radius:0}img,ion-skeleton-text,div.error{border-radius:var(--border-radius);width:var(--width);height:var(--height)}div.error{display:flex;background-color:#eee;border:1px solid red;color:red;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}";
|
|
39944
|
+
|
|
39945
|
+
const PosImage = class {
|
|
39946
|
+
constructor(hostRef) {
|
|
39947
|
+
index$1.registerInstance(this, hostRef);
|
|
39948
|
+
this.initializeOsEmitter = index$1.createEvent(this, "pod-os:init", 7);
|
|
39949
|
+
this.loading = true;
|
|
39950
|
+
this.setOs = async (os) => {
|
|
39951
|
+
this.os = os;
|
|
39952
|
+
};
|
|
39953
|
+
}
|
|
39954
|
+
componentWillLoad() {
|
|
39955
|
+
store.onChange('isLoggedIn', () => this.fetchBlob());
|
|
39956
|
+
this.initializeOsEmitter.emit(this.setOs);
|
|
39957
|
+
}
|
|
39958
|
+
async fetchBlob() {
|
|
39959
|
+
try {
|
|
39960
|
+
this.loading = true;
|
|
39961
|
+
const file = await this.os.fetchFile(this.src);
|
|
39962
|
+
if (file.blob()) {
|
|
39963
|
+
this.dataUri = URL.createObjectURL(file.blob());
|
|
39964
|
+
this.error = null;
|
|
39965
|
+
}
|
|
39966
|
+
else {
|
|
39967
|
+
this.brokenFile = file;
|
|
39968
|
+
}
|
|
39969
|
+
}
|
|
39970
|
+
catch (err) {
|
|
39971
|
+
this.error = err;
|
|
39972
|
+
}
|
|
39973
|
+
finally {
|
|
39974
|
+
this.loading = false;
|
|
39975
|
+
}
|
|
39976
|
+
}
|
|
39977
|
+
render() {
|
|
39978
|
+
if (this.loading) {
|
|
39979
|
+
return index$1.h("ion-skeleton-text", { animated: true });
|
|
39980
|
+
}
|
|
39981
|
+
if (this.error) {
|
|
39982
|
+
return index$1.h("div", { class: "error" }, this.error.message);
|
|
39983
|
+
}
|
|
39984
|
+
if (this.brokenFile) {
|
|
39985
|
+
return index$1.h(BrokenImage, { file: this.brokenFile });
|
|
39986
|
+
}
|
|
39987
|
+
return index$1.h("img", { src: this.dataUri });
|
|
39988
|
+
}
|
|
39989
|
+
static get watchers() { return {
|
|
39990
|
+
"os": ["fetchBlob"],
|
|
39991
|
+
"src": ["fetchBlob"]
|
|
39992
|
+
}; }
|
|
39993
|
+
};
|
|
39994
|
+
PosImage.style = posImageCss;
|
|
39995
|
+
|
|
39757
39996
|
const PosLabel = class {
|
|
39758
39997
|
constructor(hostRef) {
|
|
39759
39998
|
index$1.registerInstance(this, hostRef);
|
|
@@ -40338,12 +40577,14 @@ exports.ion_list = List;
|
|
|
40338
40577
|
exports.ion_progress_bar = ProgressBar;
|
|
40339
40578
|
exports.ion_ripple_effect = RippleEffect;
|
|
40340
40579
|
exports.ion_row = Row;
|
|
40580
|
+
exports.ion_skeleton_text = SkeletonText;
|
|
40341
40581
|
exports.ion_title = ToolbarTitle;
|
|
40342
40582
|
exports.ion_toolbar = Toolbar;
|
|
40343
40583
|
exports.pos_app = PosApp;
|
|
40344
40584
|
exports.pos_app_generic = PosAppGeneric;
|
|
40345
40585
|
exports.pos_demo_app = PosDemoApp;
|
|
40346
40586
|
exports.pos_description = PosDescription;
|
|
40587
|
+
exports.pos_image = PosImage;
|
|
40347
40588
|
exports.pos_label = PosLabel;
|
|
40348
40589
|
exports.pos_literals = PosLiterals;
|
|
40349
40590
|
exports.pos_login = PosLogin;
|