@gataca/qr 2.0.11 → 2.0.13
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/gataca-qr_2.cjs.entry.js +42 -4
- package/dist/cjs/gataca-qrws.cjs.entry.js +42 -4
- package/dist/cjs/gatacaqr.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-383ee834.js → utils-ef28b844.js} +1 -0
- package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +11 -0
- package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +4 -0
- package/dist/collection/components/gataca-qr/gataca-qr.css +125 -2
- package/dist/collection/components/gataca-qr/gataca-qr.js +48 -2
- package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +11 -0
- package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +4 -0
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +126 -2
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +48 -2
- package/dist/collection/utils/utils.js +1 -0
- package/dist/components/gat-icon-alert.js +1 -0
- package/dist/components/gataca-qr2.js +43 -3
- package/dist/components/gataca-qrws2.js +43 -3
- package/dist/esm/gataca-qr_2.entry.js +42 -4
- package/dist/esm/gataca-qrws.entry.js +42 -4
- package/dist/esm/gatacaqr.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-05ba6c9f.js → utils-63e7a33b.js} +1 -0
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/{p-b8ba109f.js → p-2cd7b062.js} +1 -1
- package/dist/gatacaqr/p-64740141.entry.js +1 -0
- package/dist/gatacaqr/p-91a49030.entry.js +1 -0
- package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +13 -0
- package/dist/types/components/gataca-qr/components/readQR/components/AnimatedLoader.d.ts +2 -0
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +14 -0
- package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +13 -0
- package/dist/types/components/gataca-qrws/components/readQR/components/AnimatedLoader.d.ts +2 -0
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +14 -0
- package/dist/types/components.d.ts +32 -0
- package/dist/types/utils/utils.d.ts +2 -1
- package/package.json +1 -1
- package/dist/gatacaqr/p-272337d9.entry.js +0 -1
- package/dist/gatacaqr/p-d7877349.entry.js +0 -1
|
@@ -4,6 +4,7 @@ import "../gataca-qrdisplay/gataca-qrdisplay";
|
|
|
4
4
|
import { base64UrlEncode, checkMobile, RESULT_STATUS } from "../../utils/utils";
|
|
5
5
|
import { Success } from "./components/success/Success";
|
|
6
6
|
import { RetryButton } from "./components/retryButton/RetryButton";
|
|
7
|
+
import { ReadQR } from "./components/readQR/ReadQR";
|
|
7
8
|
import { QR } from "./components/qr/QR";
|
|
8
9
|
const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
|
|
9
10
|
//Default values
|
|
@@ -15,7 +16,7 @@ const FUNCTION_ROLES = {
|
|
|
15
16
|
certify: "credential",
|
|
16
17
|
};
|
|
17
18
|
export class GatacaQR {
|
|
18
|
-
constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
19
|
+
constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
19
20
|
disconnectedCallback() {
|
|
20
21
|
this.stop();
|
|
21
22
|
}
|
|
@@ -63,7 +64,7 @@ export class GatacaQR {
|
|
|
63
64
|
*/
|
|
64
65
|
async stop() {
|
|
65
66
|
this.clean();
|
|
66
|
-
if (this.result === RESULT_STATUS.ONGOING) {
|
|
67
|
+
if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
|
|
67
68
|
this.result = RESULT_STATUS.NOT_STARTED;
|
|
68
69
|
}
|
|
69
70
|
}
|
|
@@ -123,6 +124,7 @@ export class GatacaQR {
|
|
|
123
124
|
resolve(data);
|
|
124
125
|
break;
|
|
125
126
|
case RESULT_STATUS.ONGOING:
|
|
127
|
+
case RESULT_STATUS.READ:
|
|
126
128
|
if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
|
|
127
129
|
setTimeout(checkCondition, interval, resolve, reject);
|
|
128
130
|
}
|
|
@@ -149,6 +151,11 @@ export class GatacaQR {
|
|
|
149
151
|
return this.renderRetryButton(this.credentialsNotValidatedLabel);
|
|
150
152
|
case RESULT_STATUS.SUCCESS:
|
|
151
153
|
return this.renderSuccess();
|
|
154
|
+
case RESULT_STATUS.READ:
|
|
155
|
+
return this.renderReadQR({
|
|
156
|
+
title: this === null || this === void 0 ? void 0 : this.readQrTitle,
|
|
157
|
+
description: this === null || this === void 0 ? void 0 : this.readQrDescription,
|
|
158
|
+
});
|
|
152
159
|
}
|
|
153
160
|
}
|
|
154
161
|
renderSuccess() {
|
|
@@ -157,6 +164,9 @@ export class GatacaQR {
|
|
|
157
164
|
renderRetryButton(errorMessage) {
|
|
158
165
|
return (h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this) }));
|
|
159
166
|
}
|
|
167
|
+
renderReadQR(readQrMessages) {
|
|
168
|
+
return (h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR.bind(this) }));
|
|
169
|
+
}
|
|
160
170
|
renderQR(value, useLogo) {
|
|
161
171
|
return (h(QR, { value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
|
|
162
172
|
}
|
|
@@ -757,6 +767,42 @@ export class GatacaQR {
|
|
|
757
767
|
"reflect": false,
|
|
758
768
|
"defaultValue": "\"waiting to start a session\""
|
|
759
769
|
},
|
|
770
|
+
"readQrTitle": {
|
|
771
|
+
"type": "string",
|
|
772
|
+
"mutable": false,
|
|
773
|
+
"complexType": {
|
|
774
|
+
"original": "string",
|
|
775
|
+
"resolved": "string",
|
|
776
|
+
"references": {}
|
|
777
|
+
},
|
|
778
|
+
"required": false,
|
|
779
|
+
"optional": true,
|
|
780
|
+
"docs": {
|
|
781
|
+
"tags": [],
|
|
782
|
+
"text": "_[Optional]_\nString title to show when QR already read"
|
|
783
|
+
},
|
|
784
|
+
"attribute": "read-qr-title",
|
|
785
|
+
"reflect": false,
|
|
786
|
+
"defaultValue": "\"Processing...\""
|
|
787
|
+
},
|
|
788
|
+
"readQrDescription": {
|
|
789
|
+
"type": "string",
|
|
790
|
+
"mutable": false,
|
|
791
|
+
"complexType": {
|
|
792
|
+
"original": "string",
|
|
793
|
+
"resolved": "string",
|
|
794
|
+
"references": {}
|
|
795
|
+
},
|
|
796
|
+
"required": false,
|
|
797
|
+
"optional": true,
|
|
798
|
+
"docs": {
|
|
799
|
+
"tags": [],
|
|
800
|
+
"text": "_[Optional]_\nString description to show when QR already read"
|
|
801
|
+
},
|
|
802
|
+
"attribute": "read-qr-description",
|
|
803
|
+
"reflect": false,
|
|
804
|
+
"defaultValue": "\"Please wait a moment\""
|
|
805
|
+
},
|
|
760
806
|
"hideQrModalDescription": {
|
|
761
807
|
"type": "boolean",
|
|
762
808
|
"mutable": false,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { AnimatedLoader } from "./components/AnimatedLoader";
|
|
3
|
+
export const ReadQR = (props) => {
|
|
4
|
+
var _a;
|
|
5
|
+
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
6
|
+
return (h("div", { class: "blured", style: {
|
|
7
|
+
width: (modalWidth - 48).toString() + "px",
|
|
8
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + "px" : "",
|
|
9
|
+
} }, h("div", { id: "notify" }, h(AnimatedLoader, null), h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
|
|
10
|
+
readQrMessages.title, " "), h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)), h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
11
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export const AnimatedLoader = () => {
|
|
3
|
+
return (h("div", { class: "containerLoader" }, h("div", { class: "loader" }, h("div", { class: "loader__item loader__item__1" }), h("div", { class: "loader__item loader__item__2" }), h("div", { class: "loader__item loader__item__3" }), h("div", { class: "loader__item loader__item__4" }), h("div", { class: "loader__item loader__item__5" }), h("div", { class: "loader__item loader__item__6" }), h("div", { class: "loader__item loader__item__7" }), h("div", { class: "loader__item loader__item__8" }))));
|
|
4
|
+
};
|
|
@@ -55,6 +55,8 @@ table {
|
|
|
55
55
|
border-spacing: 0;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/* Sizes */
|
|
59
|
+
/* Trigonometry helpers */
|
|
58
60
|
/*
|
|
59
61
|
QR COMPONENT
|
|
60
62
|
*/
|
|
@@ -139,7 +141,7 @@ img {
|
|
|
139
141
|
color: #707074;
|
|
140
142
|
}
|
|
141
143
|
.popUpContainer .modal-window .bold {
|
|
142
|
-
font-weight:
|
|
144
|
+
font-weight: 700;
|
|
143
145
|
}
|
|
144
146
|
.popUpContainer .modal-window .qrBrand {
|
|
145
147
|
margin-top: 4px;
|
|
@@ -191,7 +193,8 @@ img {
|
|
|
191
193
|
line-height: 24px;
|
|
192
194
|
}
|
|
193
195
|
|
|
194
|
-
.reload
|
|
196
|
+
.reload,
|
|
197
|
+
.blured {
|
|
195
198
|
height: 252px;
|
|
196
199
|
width: 252px;
|
|
197
200
|
border: 1px dashed #a1a1a1;
|
|
@@ -273,4 +276,125 @@ img {
|
|
|
273
276
|
line-height: 16px;
|
|
274
277
|
color: #707074;
|
|
275
278
|
text-align: center;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.containerLoader {
|
|
282
|
+
display: flex;
|
|
283
|
+
justify-content: center;
|
|
284
|
+
align-items: center;
|
|
285
|
+
width: 30px;
|
|
286
|
+
height: 30px;
|
|
287
|
+
margin-bottom: 12px;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.loader {
|
|
291
|
+
position: relative;
|
|
292
|
+
margin-left: 0 !important;
|
|
293
|
+
}
|
|
294
|
+
.loader__item {
|
|
295
|
+
position: absolute;
|
|
296
|
+
width: 9.68px;
|
|
297
|
+
height: 4px;
|
|
298
|
+
background: transparent;
|
|
299
|
+
border-radius: 2px;
|
|
300
|
+
}
|
|
301
|
+
.loader__item__1 {
|
|
302
|
+
transform: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
|
|
303
|
+
-webkit-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
|
|
304
|
+
-moz-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
|
|
305
|
+
-o-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
|
|
306
|
+
animation: blink 0.8333333333s linear 0.1041666667s infinite;
|
|
307
|
+
-webkit-animation: blink 0.8333333333s linear 0.1041666667s infinite;
|
|
308
|
+
-moz-animation: blink 0.8333333333s linear 0.1041666667s infinite;
|
|
309
|
+
-o-animation: blink 0.8333333333s linear 0.1041666667s infinite;
|
|
310
|
+
}
|
|
311
|
+
.loader__item__2 {
|
|
312
|
+
transform: translate(-4.84px, 8.5px) rotate(90deg);
|
|
313
|
+
-webkit-animation: translate(-4.84px, 8.5px) rotate(90deg);
|
|
314
|
+
-moz-animation: translate(-4.84px, 8.5px) rotate(90deg);
|
|
315
|
+
-o-animation: translate(-4.84px, 8.5px) rotate(90deg);
|
|
316
|
+
animation: blink 0.8333333333s linear 0.2083333333s infinite;
|
|
317
|
+
-webkit-animation: blink 0.8333333333s linear 0.2083333333s infinite;
|
|
318
|
+
-moz-animation: blink 0.8333333333s linear 0.2083333333s infinite;
|
|
319
|
+
-o-animation: blink 0.8333333333s linear 0.2083333333s infinite;
|
|
320
|
+
}
|
|
321
|
+
.loader__item__3 {
|
|
322
|
+
transform: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
|
|
323
|
+
-webkit-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
|
|
324
|
+
-moz-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
|
|
325
|
+
-o-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
|
|
326
|
+
animation: blink 0.8333333333s linear 0.3125s infinite;
|
|
327
|
+
-webkit-animation: blink 0.8333333333s linear 0.3125s infinite;
|
|
328
|
+
-moz-animation: blink 0.8333333333s linear 0.3125s infinite;
|
|
329
|
+
-o-animation: blink 0.8333333333s linear 0.3125s infinite;
|
|
330
|
+
}
|
|
331
|
+
.loader__item__4 {
|
|
332
|
+
transform: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
|
|
333
|
+
-webkit-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
|
|
334
|
+
-moz-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
|
|
335
|
+
-o-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
|
|
336
|
+
animation: blink 0.8333333333s linear 0.4166666667s infinite;
|
|
337
|
+
-webkit-animation: blink 0.8333333333s linear 0.4166666667s infinite;
|
|
338
|
+
-moz-animation: blink 0.8333333333s linear 0.4166666667s infinite;
|
|
339
|
+
-o-animation: blink 0.8333333333s linear 0.4166666667s infinite;
|
|
340
|
+
}
|
|
341
|
+
.loader__item__5 {
|
|
342
|
+
transform: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
|
|
343
|
+
-webkit-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
|
|
344
|
+
-moz-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
|
|
345
|
+
-o-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
|
|
346
|
+
animation: blink 0.8333333333s linear 0.5208333333s infinite;
|
|
347
|
+
-webkit-animation: blink 0.8333333333s linear 0.5208333333s infinite;
|
|
348
|
+
-moz-animation: blink 0.8333333333s linear 0.5208333333s infinite;
|
|
349
|
+
-o-animation: blink 0.8333333333s linear 0.5208333333s infinite;
|
|
350
|
+
}
|
|
351
|
+
.loader__item__6 {
|
|
352
|
+
transform: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
|
|
353
|
+
-webkit-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
|
|
354
|
+
-moz-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
|
|
355
|
+
-o-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
|
|
356
|
+
animation: blink 0.8333333333s linear 0.625s infinite;
|
|
357
|
+
-webkit-animation: blink 0.8333333333s linear 0.625s infinite;
|
|
358
|
+
-moz-animation: blink 0.8333333333s linear 0.625s infinite;
|
|
359
|
+
-o-animation: blink 0.8333333333s linear 0.625s infinite;
|
|
360
|
+
}
|
|
361
|
+
.loader__item__7 {
|
|
362
|
+
transform: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
|
|
363
|
+
-webkit-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
|
|
364
|
+
-moz-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
|
|
365
|
+
-o-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
|
|
366
|
+
animation: blink 0.8333333333s linear 0.7291666667s infinite;
|
|
367
|
+
-webkit-animation: blink 0.8333333333s linear 0.7291666667s infinite;
|
|
368
|
+
-moz-animation: blink 0.8333333333s linear 0.7291666667s infinite;
|
|
369
|
+
-o-animation: blink 0.8333333333s linear 0.7291666667s infinite;
|
|
370
|
+
}
|
|
371
|
+
.loader__item__8 {
|
|
372
|
+
transform: translate(5.6631628524px, -1.99913122px) rotate(360deg);
|
|
373
|
+
-webkit-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
|
|
374
|
+
-moz-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
|
|
375
|
+
-o-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
|
|
376
|
+
animation: blink 0.8333333333s linear 0.8333333333s infinite;
|
|
377
|
+
-webkit-animation: blink 0.8333333333s linear 0.8333333333s infinite;
|
|
378
|
+
-moz-animation: blink 0.8333333333s linear 0.8333333333s infinite;
|
|
379
|
+
-o-animation: blink 0.8333333333s linear 0.8333333333s infinite;
|
|
380
|
+
}
|
|
381
|
+
.loader__item__8 {
|
|
382
|
+
max-width: 8.5px;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
@keyframes blink {
|
|
386
|
+
0% {
|
|
387
|
+
background: #4745B7;
|
|
388
|
+
}
|
|
389
|
+
100% {
|
|
390
|
+
background: #CCCBF8;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
@keyframes rotate {
|
|
394
|
+
0% {
|
|
395
|
+
transform: rotate(0deg);
|
|
396
|
+
}
|
|
397
|
+
100% {
|
|
398
|
+
background: rotate(360deg);
|
|
399
|
+
}
|
|
276
400
|
}
|
|
@@ -5,6 +5,7 @@ import { base64UrlEncode, checkMobile, RESULT_STATUS, } from "../../utils/utils"
|
|
|
5
5
|
import { Success } from "./components/success/Success";
|
|
6
6
|
import { RetryButton } from "./components/retryButton/RetryButton";
|
|
7
7
|
import { QR } from "./components/qr/QR";
|
|
8
|
+
import { ReadQR } from "./components/readQR/ReadQR";
|
|
8
9
|
const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
|
|
9
10
|
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
10
11
|
const QR_ROLE_CONNECT = "connect";
|
|
@@ -13,7 +14,7 @@ const FUNCTION_ROLES = {
|
|
|
13
14
|
certify: "credential",
|
|
14
15
|
};
|
|
15
16
|
export class GatacaQRWS {
|
|
16
|
-
constructor() { this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.hideQrModalDescription = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
17
|
+
constructor() { this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
17
18
|
disconnectedCallback() {
|
|
18
19
|
this.stop();
|
|
19
20
|
}
|
|
@@ -54,7 +55,7 @@ export class GatacaQRWS {
|
|
|
54
55
|
socket.close(1000, "");
|
|
55
56
|
};
|
|
56
57
|
socket.onclose = () => {
|
|
57
|
-
if (this.result === RESULT_STATUS.ONGOING) {
|
|
58
|
+
if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
|
|
58
59
|
this.result = RESULT_STATUS.EXPIRED;
|
|
59
60
|
}
|
|
60
61
|
if (this.result === RESULT_STATUS.EXPIRED) {
|
|
@@ -80,6 +81,7 @@ export class GatacaQRWS {
|
|
|
80
81
|
this.result = wsresp.result;
|
|
81
82
|
switch (wsresp.result) {
|
|
82
83
|
case RESULT_STATUS.ONGOING:
|
|
84
|
+
case RESULT_STATUS.READ:
|
|
83
85
|
this.sessionId = wsresp.sessionId;
|
|
84
86
|
this.authenticationRequest = wsresp.authenticationRequest;
|
|
85
87
|
break;
|
|
@@ -150,6 +152,11 @@ export class GatacaQRWS {
|
|
|
150
152
|
return this.renderRetryButton(this.credentialsNotValidatedLabel);
|
|
151
153
|
case RESULT_STATUS.SUCCESS:
|
|
152
154
|
return this.renderSuccess();
|
|
155
|
+
case RESULT_STATUS.READ:
|
|
156
|
+
return this.renderReadQR({
|
|
157
|
+
title: this === null || this === void 0 ? void 0 : this.readQrTitle,
|
|
158
|
+
description: this === null || this === void 0 ? void 0 : this.readQrDescription,
|
|
159
|
+
});
|
|
153
160
|
}
|
|
154
161
|
}
|
|
155
162
|
renderSuccess() {
|
|
@@ -158,6 +165,9 @@ export class GatacaQRWS {
|
|
|
158
165
|
renderRetryButton(errorMessage) {
|
|
159
166
|
return (h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this) }));
|
|
160
167
|
}
|
|
168
|
+
renderReadQR(readQrMessages) {
|
|
169
|
+
return (h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR.bind(this) }));
|
|
170
|
+
}
|
|
161
171
|
renderQR(value, useLogo) {
|
|
162
172
|
return (h(QR, { value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
|
|
163
173
|
}
|
|
@@ -790,6 +800,42 @@ export class GatacaQRWS {
|
|
|
790
800
|
"reflect": false,
|
|
791
801
|
"defaultValue": "\"waiting to start a session\""
|
|
792
802
|
},
|
|
803
|
+
"readQrTitle": {
|
|
804
|
+
"type": "string",
|
|
805
|
+
"mutable": false,
|
|
806
|
+
"complexType": {
|
|
807
|
+
"original": "string",
|
|
808
|
+
"resolved": "string",
|
|
809
|
+
"references": {}
|
|
810
|
+
},
|
|
811
|
+
"required": false,
|
|
812
|
+
"optional": true,
|
|
813
|
+
"docs": {
|
|
814
|
+
"tags": [],
|
|
815
|
+
"text": "_[Optional]_\nString title to show when QR already read"
|
|
816
|
+
},
|
|
817
|
+
"attribute": "read-qr-title",
|
|
818
|
+
"reflect": false,
|
|
819
|
+
"defaultValue": "\"Processing...\""
|
|
820
|
+
},
|
|
821
|
+
"readQrDescription": {
|
|
822
|
+
"type": "string",
|
|
823
|
+
"mutable": false,
|
|
824
|
+
"complexType": {
|
|
825
|
+
"original": "string",
|
|
826
|
+
"resolved": "string",
|
|
827
|
+
"references": {}
|
|
828
|
+
},
|
|
829
|
+
"required": false,
|
|
830
|
+
"optional": true,
|
|
831
|
+
"docs": {
|
|
832
|
+
"tags": [],
|
|
833
|
+
"text": "_[Optional]_\nString description to show when QR already read"
|
|
834
|
+
},
|
|
835
|
+
"attribute": "read-qr-description",
|
|
836
|
+
"reflect": false,
|
|
837
|
+
"defaultValue": "\"Please wait a moment\""
|
|
838
|
+
},
|
|
793
839
|
"hideQrModalDescription": {
|
|
794
840
|
"type": "boolean",
|
|
795
841
|
"mutable": false,
|
|
@@ -18,4 +18,5 @@ export var RESULT_STATUS;
|
|
|
18
18
|
RESULT_STATUS[RESULT_STATUS["SUCCESS"] = 1] = "SUCCESS";
|
|
19
19
|
RESULT_STATUS[RESULT_STATUS["FAILED"] = 2] = "FAILED";
|
|
20
20
|
RESULT_STATUS[RESULT_STATUS["EXPIRED"] = 3] = "EXPIRED";
|
|
21
|
+
RESULT_STATUS[RESULT_STATUS["READ"] = 5] = "READ";
|
|
21
22
|
})(RESULT_STATUS || (RESULT_STATUS = {}));
|
|
@@ -18,6 +18,7 @@ var RESULT_STATUS;
|
|
|
18
18
|
RESULT_STATUS[RESULT_STATUS["SUCCESS"] = 1] = "SUCCESS";
|
|
19
19
|
RESULT_STATUS[RESULT_STATUS["FAILED"] = 2] = "FAILED";
|
|
20
20
|
RESULT_STATUS[RESULT_STATUS["EXPIRED"] = 3] = "EXPIRED";
|
|
21
|
+
RESULT_STATUS[RESULT_STATUS["READ"] = 5] = "READ";
|
|
21
22
|
})(RESULT_STATUS || (RESULT_STATUS = {}));
|
|
22
23
|
|
|
23
24
|
const gatIconCheckSvg = 'data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjUyIiBoZWlnaHQ9IjUzIiB2aWV3Qm94PSIwIDAgNTIgNTMiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjI2IiBjeT0iMjYuNjcxOSIgcj0iMjYiIGZpbGw9IiMzRDlBNTAiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zOC41MiAxNy43NDk1QzM5LjU4MDUgMTguODA5OSAzOS41ODA1IDIwLjUyOTMgMzguNTIgMjEuNTg5OEwyMy41ODQ2IDM2LjUyNTFDMjIuNTI0MiAzNy41ODU2IDIwLjgwNDggMzcuNTg1NiAxOS43NDQzIDM2LjUyNTFMMTIuOTU1NSAyOS43MzYzQzExLjg5NSAyOC42NzU5IDExLjg5NSAyNi45NTY1IDEyLjk1NTUgMjUuODk2QzE0LjAxNiAyNC44MzU1IDE1LjczNTQgMjQuODM1NSAxNi43OTU4IDI1Ljg5NkwyMS42NjQ1IDMwLjc2NDdMMzQuNjc5NyAxNy43NDk1QzM1Ljc0MDIgMTYuNjg5IDM3LjQ1OTUgMTYuNjg5IDM4LjUyIDE3Ljc0OTVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K';
|
|
@@ -32,12 +32,41 @@ const RetryButton = (props) => {
|
|
|
32
32
|
h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
const AnimatedLoader = () => {
|
|
36
|
+
return (h("div", { class: "containerLoader" },
|
|
37
|
+
h("div", { class: "loader" },
|
|
38
|
+
h("div", { class: "loader__item loader__item__1" }),
|
|
39
|
+
h("div", { class: "loader__item loader__item__2" }),
|
|
40
|
+
h("div", { class: "loader__item loader__item__3" }),
|
|
41
|
+
h("div", { class: "loader__item loader__item__4" }),
|
|
42
|
+
h("div", { class: "loader__item loader__item__5" }),
|
|
43
|
+
h("div", { class: "loader__item loader__item__6" }),
|
|
44
|
+
h("div", { class: "loader__item loader__item__7" }),
|
|
45
|
+
h("div", { class: "loader__item loader__item__8" }))));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const ReadQR = (props) => {
|
|
49
|
+
var _a;
|
|
50
|
+
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
51
|
+
return (h("div", { class: "blured", style: {
|
|
52
|
+
width: (modalWidth - 48).toString() + "px",
|
|
53
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + "px" : "",
|
|
54
|
+
} },
|
|
55
|
+
h("div", { id: "notify" },
|
|
56
|
+
h(AnimatedLoader, null),
|
|
57
|
+
h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
|
|
58
|
+
readQrMessages.title,
|
|
59
|
+
" "),
|
|
60
|
+
h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)),
|
|
61
|
+
h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
62
|
+
};
|
|
63
|
+
|
|
35
64
|
const QR = (props) => {
|
|
36
65
|
const { value, useLogo, logoSrc, size } = props;
|
|
37
66
|
return (h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc }));
|
|
38
67
|
};
|
|
39
68
|
|
|
40
|
-
const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:
|
|
69
|
+
const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:12px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
|
|
41
70
|
|
|
42
71
|
const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
|
|
43
72
|
//Default values
|
|
@@ -49,7 +78,7 @@ const FUNCTION_ROLES = {
|
|
|
49
78
|
certify: "credential",
|
|
50
79
|
};
|
|
51
80
|
const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
52
|
-
constructor() { super(); this.__registerHost(); this.__attachShadow(); this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7); this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
81
|
+
constructor() { super(); this.__registerHost(); this.__attachShadow(); this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7); this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
53
82
|
disconnectedCallback() {
|
|
54
83
|
this.stop();
|
|
55
84
|
}
|
|
@@ -97,7 +126,7 @@ const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
97
126
|
*/
|
|
98
127
|
async stop() {
|
|
99
128
|
this.clean();
|
|
100
|
-
if (this.result === RESULT_STATUS.ONGOING) {
|
|
129
|
+
if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
|
|
101
130
|
this.result = RESULT_STATUS.NOT_STARTED;
|
|
102
131
|
}
|
|
103
132
|
}
|
|
@@ -157,6 +186,7 @@ const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
157
186
|
resolve(data);
|
|
158
187
|
break;
|
|
159
188
|
case RESULT_STATUS.ONGOING:
|
|
189
|
+
case RESULT_STATUS.READ:
|
|
160
190
|
if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
|
|
161
191
|
setTimeout(checkCondition, interval, resolve, reject);
|
|
162
192
|
}
|
|
@@ -183,6 +213,11 @@ const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
183
213
|
return this.renderRetryButton(this.credentialsNotValidatedLabel);
|
|
184
214
|
case RESULT_STATUS.SUCCESS:
|
|
185
215
|
return this.renderSuccess();
|
|
216
|
+
case RESULT_STATUS.READ:
|
|
217
|
+
return this.renderReadQR({
|
|
218
|
+
title: this === null || this === void 0 ? void 0 : this.readQrTitle,
|
|
219
|
+
description: this === null || this === void 0 ? void 0 : this.readQrDescription,
|
|
220
|
+
});
|
|
186
221
|
}
|
|
187
222
|
}
|
|
188
223
|
renderSuccess() {
|
|
@@ -191,6 +226,9 @@ const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
191
226
|
renderRetryButton(errorMessage) {
|
|
192
227
|
return (h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this) }));
|
|
193
228
|
}
|
|
229
|
+
renderReadQR(readQrMessages) {
|
|
230
|
+
return (h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR.bind(this) }));
|
|
231
|
+
}
|
|
194
232
|
renderQR(value, useLogo) {
|
|
195
233
|
return (h(QR, { value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
|
|
196
234
|
}
|
|
@@ -247,6 +285,8 @@ const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
247
285
|
"successLoginLabel": [1, "success-login-label"],
|
|
248
286
|
"byBrandLabel": [1, "by-brand-label"],
|
|
249
287
|
"waitingStartSessionLabel": [1, "waiting-start-session-label"],
|
|
288
|
+
"readQrTitle": [1, "read-qr-title"],
|
|
289
|
+
"readQrDescription": [1, "read-qr-description"],
|
|
250
290
|
"hideQrModalDescription": [4, "hide-qr-modal-description"],
|
|
251
291
|
"sessionTimeout": [2, "session-timeout"],
|
|
252
292
|
"pollingFrequency": [2, "polling-frequency"],
|