@gataca/qr 4.0.3 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/gataca-autoqr.cjs.entry.js +1 -1
- package/dist/cjs/gataca-qr_3.cjs.entry.js +130 -26
- package/dist/cjs/gataca-qrws.cjs.entry.js +142 -22
- package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +1 -1
- package/dist/cjs/gatacaqr.cjs.js +2 -2
- package/dist/cjs/{index-1332a8ce.js → index-d8d3dfde.js} +32 -0
- package/dist/cjs/index.cjs.js +6 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/utils-04522aa4.js +117 -0
- package/dist/collection/components/gataca-qr/components/qr/QR.js +9 -1
- package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +5 -2
- package/dist/collection/components/gataca-qr/gataca-qr.css +6 -0
- package/dist/collection/components/gataca-qr/gataca-qr.js +87 -17
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +28 -4
- package/dist/collection/components/gataca-qrws/components/qr/QR.js +9 -1
- package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +5 -2
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +7 -0
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +126 -18
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +2 -2
- package/dist/collection/utils/utils.js +84 -0
- package/dist/components/gat-icon-check.js +85 -1
- package/dist/components/gataca-qr2.js +106 -20
- package/dist/components/gataca-qrdisplay2.js +25 -4
- package/dist/components/gataca-qrws2.js +145 -21
- package/dist/components/gataca-ssibutton2.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/esm/gataca-autoqr.entry.js +1 -1
- package/dist/esm/gataca-qr_3.entry.js +131 -27
- package/dist/esm/gataca-qrws.entry.js +142 -22
- package/dist/esm/gataca-ssibuttonws.entry.js +1 -1
- package/dist/esm/gatacaqr.js +2 -2
- package/dist/esm/{index-055790a7.js → index-dca2ab22.js} +32 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/utils-cf9db2bd.js +109 -0
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/{p-49cf321c.entry.js → p-2e8accf9.entry.js} +1 -1
- package/dist/gatacaqr/p-3db0f74d.entry.js +1 -0
- package/dist/gatacaqr/p-775c90cf.entry.js +1 -0
- package/dist/gatacaqr/{p-0501e224.js → p-7b6fa63b.js} +1 -1
- package/dist/gatacaqr/p-85af64b1.js +2 -0
- package/dist/gatacaqr/{p-c65f810b.entry.js → p-d27dabe4.entry.js} +1 -1
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +1 -0
- package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +0 -2
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +5 -2
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +4 -0
- package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +1 -0
- package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +0 -2
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +8 -2
- package/dist/types/utils/utils.d.ts +10 -0
- package/package.json +1 -1
- package/dist/cjs/utils-c6edb275.js +0 -28
- package/dist/esm/utils-22df0ce4.js +0 -25
- package/dist/gatacaqr/p-2083dd06.entry.js +0 -1
- package/dist/gatacaqr/p-f5a4f65c.entry.js +0 -1
- package/dist/gatacaqr/p-fccf9d4d.js +0 -2
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
-
export { R as RESULT_STATUS, b as base64UrlEncode, c as checkMobile } from './gat-icon-check.js';
|
|
2
|
+
export { A as ALLOWED_APP_REDIRECT_PROTOCOLS, R as RESULT_STATUS, d as assignWindowLocationIfAllowed, b as base64UrlEncode, c as checkMobile, i as isAllowedAppRedirect, a as isAllowedNavigationRedirect, s as shortenUrlIfPossible } from './gat-icon-check.js';
|
|
3
3
|
export { GatacaAutoqr, defineCustomElement as defineCustomElementGatacaAutoqr } from './gataca-autoqr.js';
|
|
4
4
|
export { GatacaQr, defineCustomElement as defineCustomElementGatacaQr } from './gataca-qr.js';
|
|
5
5
|
export { GatacaQrdisplay, defineCustomElement as defineCustomElementGatacaQrdisplay } from './gataca-qrdisplay.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-dca2ab22.js';
|
|
2
2
|
|
|
3
3
|
const gatacaAutoqrCss = "@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}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:\"Work Sans\", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:\"Helvetica Neue\", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}";
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h, c as createEvent } from './index-
|
|
2
|
-
import {
|
|
3
|
-
import { R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode } from './utils-
|
|
1
|
+
import { r as registerInstance, h, c as createEvent } from './index-dca2ab22.js';
|
|
2
|
+
import { l as logoGatacaSvg, Q as QRCodeStyling, g as gatIconAlertSvg, a as gatIconCheckSvg } from './gat-icon-check-7320c81b.js';
|
|
3
|
+
import { R as RESULT_STATUS, c as checkMobile, d as assignWindowLocationIfAllowed, b as base64UrlEncode, s as shortenUrlIfPossible } from './utils-cf9db2bd.js';
|
|
4
4
|
|
|
5
5
|
const GatacaQRDisplay = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -14,8 +14,8 @@ const GatacaQRDisplay = class {
|
|
|
14
14
|
this.bgColor = '#FFFFFF';
|
|
15
15
|
this.rounded = true;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
getQrOptions() {
|
|
18
|
+
return {
|
|
19
19
|
data: this.qrData,
|
|
20
20
|
width: this.size,
|
|
21
21
|
height: this.size,
|
|
@@ -39,18 +39,47 @@ const GatacaQRDisplay = class {
|
|
|
39
39
|
backgroundOptions: {
|
|
40
40
|
color: this.bgColor
|
|
41
41
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
componentDidLoad() {
|
|
45
|
+
this.mountOrUpdateQr();
|
|
46
|
+
}
|
|
47
|
+
onQrDataChange() {
|
|
48
|
+
this.mountOrUpdateQr();
|
|
49
|
+
}
|
|
50
|
+
mountOrUpdateQr() {
|
|
51
|
+
var _a;
|
|
52
|
+
if (!((_a = this.qrData) === null || _a === void 0 ? void 0 : _a.trim()) || !this.qr) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!this.qrCode) {
|
|
56
|
+
this.qrCode = new QRCodeStyling(this.getQrOptions());
|
|
57
|
+
this.qrCode.append(this.qr);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this.qrCode.update({ data: this.qrData });
|
|
61
|
+
}
|
|
44
62
|
}
|
|
45
63
|
render() {
|
|
46
64
|
return (h("div", { ref: (el) => {
|
|
47
65
|
this.qr = el;
|
|
48
66
|
} }));
|
|
49
67
|
}
|
|
68
|
+
static get watchers() { return {
|
|
69
|
+
"qrData": ["onQrDataChange"]
|
|
70
|
+
}; }
|
|
50
71
|
};
|
|
51
72
|
|
|
52
73
|
const QR = (props) => {
|
|
53
|
-
const { value, useLogo, logoSrc, size, qrType, style } = props;
|
|
74
|
+
const { value, useLogo, logoSrc, size, qrType, style, linkReady = true } = props;
|
|
75
|
+
const s = size !== null && size !== void 0 ? size : 256;
|
|
76
|
+
if (!linkReady) {
|
|
77
|
+
return (h("div", { class: "qr-loading-slot", style: {
|
|
78
|
+
width: s + 'px',
|
|
79
|
+
height: s + 'px',
|
|
80
|
+
margin: '0 auto'
|
|
81
|
+
} }));
|
|
82
|
+
}
|
|
54
83
|
return h("gataca-qrdisplay", { qrData: value, rounded: true, qrType: qrType, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc, qrColor: style === null || style === void 0 ? void 0 : style.color, bgColor: style === null || style === void 0 ? void 0 : style.bgColor });
|
|
55
84
|
};
|
|
56
85
|
|
|
@@ -100,7 +129,7 @@ const RefreshIcon = (props) => {
|
|
|
100
129
|
|
|
101
130
|
const RetryButton = (props) => {
|
|
102
131
|
var _a;
|
|
103
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel,
|
|
132
|
+
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, style, display } = props;
|
|
104
133
|
const bgStyle = { backgroundColor: (style === null || style === void 0 ? void 0 : style.bgColor) ? style === null || style === void 0 ? void 0 : style.bgColor : 'white' };
|
|
105
134
|
const alertBgStyle = { backgroundColor: (style === null || style === void 0 ? void 0 : style.alertBgColor) ? style === null || style === void 0 ? void 0 : style.alertBgColor : '#ffdedf' };
|
|
106
135
|
const alertBorderColor = { borderColor: (style === null || style === void 0 ? void 0 : style.alertBorderColor) ? style === null || style === void 0 ? void 0 : style.alertBorderColor : '#ee888c' };
|
|
@@ -119,7 +148,10 @@ const RetryButton = (props) => {
|
|
|
119
148
|
errorMessage && (h("div", { class: "alert", style: Object.assign(Object.assign({ width: (modalWidth - 48).toString() + 'px' }, alertBgStyle), { border: `1px solid ${alertBorderColor}` }) },
|
|
120
149
|
h("img", { src: gatIconAlertSvg, height: 24, width: 24 }),
|
|
121
150
|
h("p", { style: { color: (style === null || style === void 0 ? void 0 : style.color) ? style === null || style === void 0 ? void 0 : style.color : '#1e1e20' } }, errorMessage)))),
|
|
122
|
-
h("div", { id: "qrwait"
|
|
151
|
+
h("div", { id: "qrwait", class: "qr-placeholder-slot", style: {
|
|
152
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
153
|
+
height: modalWidth ? (modalWidth - 48).toString() + 'px' : ''
|
|
154
|
+
} })));
|
|
123
155
|
};
|
|
124
156
|
|
|
125
157
|
const Success = (props) => {
|
|
@@ -132,14 +164,63 @@ const Success = (props) => {
|
|
|
132
164
|
h("p", { class: "successMsg", style: colorStyle }, successLoginLabel)));
|
|
133
165
|
};
|
|
134
166
|
|
|
135
|
-
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:20px;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>svg{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-color:var(--loader-color, #4745B7);border-radius:2px;--to-opacity:1;opacity:var(--to-opacity)}.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);--to-opacity:calc(1 - (0 / 8));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);--to-opacity:calc(1 - (1 / 8));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);--to-opacity:calc(1 - (2 / 8));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);--to-opacity:calc(1 - (3 / 8));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);--to-opacity:calc(1 - (4 / 8));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);--to-opacity:calc(1 - (5 / 8));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);--to-opacity:calc(1 - (6 / 8));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);--to-opacity:calc(1 - (7 / 8));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%{opacity:1}100%{opacity:var(--to-opacity)}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
|
|
167
|
+
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:20px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}.qr-placeholder-slot{box-sizing:border-box;border-radius:12px;background:rgba(0, 0, 0, 0.04)}#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>svg{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-color:var(--loader-color, #4745B7);border-radius:2px;--to-opacity:1;opacity:var(--to-opacity)}.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);--to-opacity:calc(1 - (0 / 8));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);--to-opacity:calc(1 - (1 / 8));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);--to-opacity:calc(1 - (2 / 8));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);--to-opacity:calc(1 - (3 / 8));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);--to-opacity:calc(1 - (4 / 8));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);--to-opacity:calc(1 - (5 / 8));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);--to-opacity:calc(1 - (6 / 8));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);--to-opacity:calc(1 - (7 / 8));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%{opacity:1}100%{opacity:var(--to-opacity)}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
|
|
136
168
|
|
|
137
169
|
const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
|
|
138
170
|
//Default values
|
|
139
171
|
const DEFAULT_SESSION_TIMEOUT$1 = 300; //5mins as in connect
|
|
140
172
|
const DEFAULT_POLLING_FREQ$1 = 3;
|
|
141
173
|
const GatacaQR = class {
|
|
142
|
-
constructor(hostRef) {
|
|
174
|
+
constructor(hostRef) {
|
|
175
|
+
registerInstance(this, hostRef);
|
|
176
|
+
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
177
|
+
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
178
|
+
this.lastShortenRaw = null;
|
|
179
|
+
this.checkStatus = undefined;
|
|
180
|
+
this.createSession = undefined;
|
|
181
|
+
this.successCallback = undefined;
|
|
182
|
+
this.errorCallback = undefined;
|
|
183
|
+
this.qrRole = undefined;
|
|
184
|
+
this.qrType = 'svg';
|
|
185
|
+
this.callbackServer = undefined;
|
|
186
|
+
this.autostart = true;
|
|
187
|
+
this.autorefresh = false;
|
|
188
|
+
this.v = '3';
|
|
189
|
+
this.qrModalTitle = 'Quick Access';
|
|
190
|
+
this.modalTitleColor = '#4745B7';
|
|
191
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
192
|
+
this.hideModalTexts = false;
|
|
193
|
+
this.hideModalBoxShadow = false;
|
|
194
|
+
this.hideBrandTitle = false;
|
|
195
|
+
this.logoSize = 0;
|
|
196
|
+
this.logoSrc = logoGatacaSvg;
|
|
197
|
+
this.qrSize = 300;
|
|
198
|
+
this.modalWidth = 300;
|
|
199
|
+
this.modalHeight = undefined;
|
|
200
|
+
this.qrCodeExpiredLabel = 'QR Code expired';
|
|
201
|
+
this.credentialsNotValidatedLabel = 'User credentials not validated';
|
|
202
|
+
this.clickInsideBoxLabel = 'Click inside the box to';
|
|
203
|
+
this.refreshQrLabel = 'Refresh QR Code';
|
|
204
|
+
this.scanQrLabel = 'Scan QR Code';
|
|
205
|
+
this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
|
|
206
|
+
this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
|
|
207
|
+
this.failedLoginErrorLabel = 'No successful login';
|
|
208
|
+
this.successLoginLabel = 'Successful Connection!';
|
|
209
|
+
this.byBrandLabel = 'by Gataca';
|
|
210
|
+
this.waitingStartSessionLabel = 'waiting to start a session';
|
|
211
|
+
this.readQrTitle = 'Processing...';
|
|
212
|
+
this.readQrDescription = 'Please wait a moment';
|
|
213
|
+
this.hideQrModalDescription = false;
|
|
214
|
+
this.sessionTimeout = DEFAULT_SESSION_TIMEOUT$1;
|
|
215
|
+
this.pollingFrequency = DEFAULT_POLLING_FREQ$1;
|
|
216
|
+
this.dynamicLink = true;
|
|
217
|
+
this.qrStyle = undefined;
|
|
218
|
+
this.sessionId = undefined;
|
|
219
|
+
this.authenticationRequest = undefined;
|
|
220
|
+
this.sessionData = undefined;
|
|
221
|
+
this.result = RESULT_STATUS.NOT_STARTED;
|
|
222
|
+
this.qrHref = '';
|
|
223
|
+
}
|
|
143
224
|
disconnectedCallback() {
|
|
144
225
|
this.stop();
|
|
145
226
|
}
|
|
@@ -153,6 +234,7 @@ const GatacaQR = class {
|
|
|
153
234
|
*/
|
|
154
235
|
async display() {
|
|
155
236
|
await this.getSessionId();
|
|
237
|
+
await this.refreshQrHref();
|
|
156
238
|
this.result = RESULT_STATUS.ONGOING;
|
|
157
239
|
this.poll()
|
|
158
240
|
.then((data) => {
|
|
@@ -177,7 +259,31 @@ const GatacaQR = class {
|
|
|
177
259
|
}
|
|
178
260
|
});
|
|
179
261
|
if (checkMobile() && this.dynamicLink) {
|
|
180
|
-
|
|
262
|
+
assignWindowLocationIfAllowed(this.getLink(), true);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
buildRawLink() {
|
|
266
|
+
var _a;
|
|
267
|
+
if (this.v === '2') {
|
|
268
|
+
return (_a = this.authenticationRequest) !== null && _a !== void 0 ? _a : '';
|
|
269
|
+
}
|
|
270
|
+
const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
|
|
271
|
+
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
272
|
+
}
|
|
273
|
+
async refreshQrHref() {
|
|
274
|
+
var _a;
|
|
275
|
+
const raw = this.buildRawLink();
|
|
276
|
+
if (raw === this.lastShortenRaw) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
this.lastShortenRaw = raw;
|
|
280
|
+
const shortened = await shortenUrlIfPossible(raw !== null && raw !== void 0 ? raw : '');
|
|
281
|
+
const now = this.buildRawLink();
|
|
282
|
+
if (now === raw) {
|
|
283
|
+
this.qrHref = shortened;
|
|
284
|
+
}
|
|
285
|
+
else if (!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
286
|
+
this.qrHref = now;
|
|
181
287
|
}
|
|
182
288
|
}
|
|
183
289
|
/**
|
|
@@ -192,6 +298,8 @@ const GatacaQR = class {
|
|
|
192
298
|
clean() {
|
|
193
299
|
this.sessionData = undefined;
|
|
194
300
|
this.sessionId = undefined;
|
|
301
|
+
this.qrHref = '';
|
|
302
|
+
this.lastShortenRaw = null;
|
|
195
303
|
}
|
|
196
304
|
/**
|
|
197
305
|
* Retrieve manually the session data on a successful login
|
|
@@ -209,11 +317,7 @@ const GatacaQR = class {
|
|
|
209
317
|
return this.sessionId;
|
|
210
318
|
}
|
|
211
319
|
getLink() {
|
|
212
|
-
|
|
213
|
-
return this.authenticationRequest;
|
|
214
|
-
}
|
|
215
|
-
const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
|
|
216
|
-
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
320
|
+
return this.qrHref || this.buildRawLink();
|
|
217
321
|
}
|
|
218
322
|
async poll() {
|
|
219
323
|
let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT$1) * 1000;
|
|
@@ -251,11 +355,12 @@ const GatacaQR = class {
|
|
|
251
355
|
return new Promise(checkCondition);
|
|
252
356
|
}
|
|
253
357
|
renderQRSection() {
|
|
358
|
+
var _a;
|
|
254
359
|
switch (this.result) {
|
|
255
360
|
case RESULT_STATUS.NOT_STARTED:
|
|
256
361
|
return this.renderRetryButton();
|
|
257
362
|
case RESULT_STATUS.ONGOING:
|
|
258
|
-
return this.renderQR(this.getLink(), true);
|
|
363
|
+
return this.renderQR(this.getLink(), true, undefined, !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim()));
|
|
259
364
|
case RESULT_STATUS.EXPIRED:
|
|
260
365
|
return this.renderRetryButton(this.qrCodeExpiredLabel);
|
|
261
366
|
case RESULT_STATUS.FAILED:
|
|
@@ -273,16 +378,15 @@ const GatacaQR = class {
|
|
|
273
378
|
return h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel, style: this === null || this === void 0 ? void 0 : this.qrStyle });
|
|
274
379
|
}
|
|
275
380
|
renderRetryButton(errorMessage) {
|
|
276
|
-
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,
|
|
381
|
+
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, display: this.display.bind(this), style: this === null || this === void 0 ? void 0 : this.qrStyle }));
|
|
277
382
|
}
|
|
278
383
|
renderReadQR(readQrMessages) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc, style: this === null || this === void 0 ? void 0 : this.qrStyle });
|
|
384
|
+
var _a;
|
|
385
|
+
const linkReady = !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim());
|
|
386
|
+
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: (url, useLogo, size) => this.renderQR(url, useLogo, size, linkReady), style: this.qrStyle }));
|
|
283
387
|
}
|
|
284
|
-
|
|
285
|
-
return h(QR, { value: value, useLogo: useLogo && this.logoSize !== 0,
|
|
388
|
+
renderQR(value, useLogo, sizeQR, linkReady = true) {
|
|
389
|
+
return (h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc, style: this === null || this === void 0 ? void 0 : this.qrStyle, linkReady: linkReady }));
|
|
286
390
|
}
|
|
287
391
|
render() {
|
|
288
392
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -491,7 +595,7 @@ const GatacaSSIButton = class {
|
|
|
491
595
|
let timeout;
|
|
492
596
|
let detected = false;
|
|
493
597
|
if (appScheme === null || appScheme === void 0 ? void 0 : appScheme.length) {
|
|
494
|
-
|
|
598
|
+
assignWindowLocationIfAllowed(appScheme, true);
|
|
495
599
|
}
|
|
496
600
|
const waitTimeToCheckApp = this.checkAppTimeout * 1000;
|
|
497
601
|
timeout = setTimeout(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as createEvent } from './index-
|
|
1
|
+
import { h, r as registerInstance, c as createEvent } from './index-dca2ab22.js';
|
|
2
2
|
import { a as gatIconCheckSvg, g as gatIconAlertSvg, l as logoGatacaSvg } from './gat-icon-check-7320c81b.js';
|
|
3
|
-
import { R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode } from './utils-
|
|
3
|
+
import { R as RESULT_STATUS, c as checkMobile, d as assignWindowLocationIfAllowed, b as base64UrlEncode, s as shortenUrlIfPossible } from './utils-cf9db2bd.js';
|
|
4
4
|
|
|
5
5
|
const Success = (props) => {
|
|
6
6
|
const { modalHeight, successLoginLabel } = props;
|
|
@@ -15,7 +15,7 @@ const gatIconRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWd
|
|
|
15
15
|
|
|
16
16
|
const RetryButton = (props) => {
|
|
17
17
|
var _a;
|
|
18
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel,
|
|
18
|
+
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, display } = props;
|
|
19
19
|
return (h("div", { class: "reload", style: {
|
|
20
20
|
width: (modalWidth - 48).toString() + 'px',
|
|
21
21
|
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
@@ -31,11 +31,22 @@ const RetryButton = (props) => {
|
|
|
31
31
|
} },
|
|
32
32
|
h("img", { src: gatIconAlertSvg, height: 24, width: 24 }),
|
|
33
33
|
h("p", null, errorMessage)))),
|
|
34
|
-
h("div", { id: "qrwait"
|
|
34
|
+
h("div", { id: "qrwait", class: "qr-placeholder-slot", style: {
|
|
35
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
36
|
+
height: modalWidth ? (modalWidth - 48).toString() + 'px' : ''
|
|
37
|
+
} })));
|
|
35
38
|
};
|
|
36
39
|
|
|
37
40
|
const QR = (props) => {
|
|
38
|
-
const { value, useLogo, logoSrc, size, qrType } = props;
|
|
41
|
+
const { value, useLogo, logoSrc, size, qrType, linkReady = true } = props;
|
|
42
|
+
const s = size !== null && size !== void 0 ? size : 256;
|
|
43
|
+
if (!linkReady) {
|
|
44
|
+
return (h("div", { class: "qr-loading-slot", style: {
|
|
45
|
+
width: s + 'px',
|
|
46
|
+
height: s + 'px',
|
|
47
|
+
margin: '0 auto'
|
|
48
|
+
} }));
|
|
49
|
+
}
|
|
39
50
|
return h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, qrType: qrType, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
|
|
40
51
|
};
|
|
41
52
|
|
|
@@ -68,13 +79,63 @@ const ReadQR = (props) => {
|
|
|
68
79
|
h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
69
80
|
};
|
|
70
81
|
|
|
71
|
-
const gatacaQrwsCss = "@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)}}";
|
|
82
|
+
const gatacaQrwsCss = "@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}.qr-placeholder-slot,.qr-loading-slot{box-sizing:border-box;border-radius:12px;background:rgba(0, 0, 0, 0.04)}#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)}}";
|
|
72
83
|
|
|
73
84
|
const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
|
|
74
85
|
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
75
86
|
const QR_ROLE_CONNECT = 'connect';
|
|
76
87
|
const GatacaQRWS = class {
|
|
77
|
-
constructor(hostRef) {
|
|
88
|
+
constructor(hostRef) {
|
|
89
|
+
registerInstance(this, hostRef);
|
|
90
|
+
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
91
|
+
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
92
|
+
this.qrRefreshGeneration = 0;
|
|
93
|
+
this.lastShortenRaw = null;
|
|
94
|
+
this.successCallback = undefined;
|
|
95
|
+
this.errorCallback = undefined;
|
|
96
|
+
this.qrRole = undefined;
|
|
97
|
+
this.qrType = 'svg';
|
|
98
|
+
this.callbackServer = undefined;
|
|
99
|
+
this.socketEndpoint = undefined;
|
|
100
|
+
this.sessionTimeout = DEFAULT_SESSION_TIMEOUT;
|
|
101
|
+
this.wsOnOpen = undefined;
|
|
102
|
+
this.wsOnMessage = undefined;
|
|
103
|
+
this.autostart = true;
|
|
104
|
+
this.autorefresh = false;
|
|
105
|
+
this.v = '3';
|
|
106
|
+
this.qrModalTitle = 'Quick Access';
|
|
107
|
+
this.modalTitleColor = '#4745B7';
|
|
108
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
109
|
+
this.hideModalTexts = false;
|
|
110
|
+
this.hideModalBoxShadow = false;
|
|
111
|
+
this.hideBrandTitle = false;
|
|
112
|
+
this.logoSize = 0;
|
|
113
|
+
this.logoSrc = logoGatacaSvg;
|
|
114
|
+
this.qrSize = 300;
|
|
115
|
+
this.modalWidth = 300;
|
|
116
|
+
this.modalHeight = undefined;
|
|
117
|
+
this.qrCodeExpiredLabel = 'QR Code expired';
|
|
118
|
+
this.credentialsNotValidatedLabel = 'User credentials not validated';
|
|
119
|
+
this.clickInsideBoxLabel = 'Click inside the box to';
|
|
120
|
+
this.refreshQrLabel = 'Refresh QR Code';
|
|
121
|
+
this.scanQrLabel = 'Scan QR Code';
|
|
122
|
+
this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
|
|
123
|
+
this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
|
|
124
|
+
this.failedLoginErrorLabel = 'No successful login';
|
|
125
|
+
this.successLoginLabel = 'Successful Connection!';
|
|
126
|
+
this.byBrandLabel = 'by Gataca';
|
|
127
|
+
this.waitingStartSessionLabel = 'waiting to start a session';
|
|
128
|
+
this.readQrTitle = 'Processing...';
|
|
129
|
+
this.readQrDescription = 'Please wait a moment';
|
|
130
|
+
this.hideQrModalDescription = false;
|
|
131
|
+
this.dynamicLink = true;
|
|
132
|
+
this.sessionId = undefined;
|
|
133
|
+
this.authenticationRequest = undefined;
|
|
134
|
+
this.sessionData = undefined;
|
|
135
|
+
this.result = RESULT_STATUS.NOT_STARTED;
|
|
136
|
+
this.qrHref = '';
|
|
137
|
+
this.qrShortenPending = false;
|
|
138
|
+
}
|
|
78
139
|
disconnectedCallback() {
|
|
79
140
|
this.stop();
|
|
80
141
|
}
|
|
@@ -87,6 +148,10 @@ const GatacaQRWS = class {
|
|
|
87
148
|
* Force manually the display of a QR
|
|
88
149
|
*/
|
|
89
150
|
async display() {
|
|
151
|
+
this.qrHref = '';
|
|
152
|
+
this.qrShortenPending = false;
|
|
153
|
+
this.lastShortenRaw = null;
|
|
154
|
+
this.qrRefreshGeneration++;
|
|
90
155
|
let socket = new WebSocket(this.socketEndpoint);
|
|
91
156
|
setTimeout(() => {
|
|
92
157
|
this.socket.close(1000, '');
|
|
@@ -130,7 +195,7 @@ const GatacaQRWS = class {
|
|
|
130
195
|
}
|
|
131
196
|
};
|
|
132
197
|
if (checkMobile() && this.dynamicLink) {
|
|
133
|
-
|
|
198
|
+
assignWindowLocationIfAllowed(this.getLink(), true);
|
|
134
199
|
}
|
|
135
200
|
}
|
|
136
201
|
sessionMsgReceived(event) {
|
|
@@ -141,10 +206,16 @@ const GatacaQRWS = class {
|
|
|
141
206
|
this.result = wsresp.result;
|
|
142
207
|
switch (wsresp.result) {
|
|
143
208
|
case RESULT_STATUS.ONGOING:
|
|
144
|
-
case RESULT_STATUS.READ:
|
|
209
|
+
case RESULT_STATUS.READ: {
|
|
145
210
|
this.sessionId = wsresp.sessionId;
|
|
146
211
|
this.authenticationRequest = wsresp.authenticationRequest;
|
|
212
|
+
const raw = this.buildRawLink();
|
|
213
|
+
if (raw === null || raw === void 0 ? void 0 : raw.trim()) {
|
|
214
|
+
this.qrShortenPending = true;
|
|
215
|
+
void this.refreshQrHref();
|
|
216
|
+
}
|
|
147
217
|
break;
|
|
218
|
+
}
|
|
148
219
|
case RESULT_STATUS.SUCCESS:
|
|
149
220
|
this.sessionData = wsresp.authenticatedUserData;
|
|
150
221
|
this.gatacaLoginCompleted.emit(wsresp.authenticatedUserData);
|
|
@@ -175,6 +246,9 @@ const GatacaQRWS = class {
|
|
|
175
246
|
async stop() {
|
|
176
247
|
this.sessionData = undefined;
|
|
177
248
|
this.sessionId = undefined;
|
|
249
|
+
this.qrHref = '';
|
|
250
|
+
this.qrShortenPending = false;
|
|
251
|
+
this.lastShortenRaw = null;
|
|
178
252
|
this.socket.close(1000, 'Client stopped the connection');
|
|
179
253
|
}
|
|
180
254
|
/**
|
|
@@ -183,19 +257,56 @@ const GatacaQRWS = class {
|
|
|
183
257
|
async getSessionData() {
|
|
184
258
|
return this.sessionData ? Promise.resolve(this.sessionData) : Promise.reject(new Error('No successful login'));
|
|
185
259
|
}
|
|
186
|
-
|
|
260
|
+
buildRawLink() {
|
|
261
|
+
var _a;
|
|
187
262
|
if (this.v === '2' && this.qrRole == QR_ROLE_CONNECT) {
|
|
188
|
-
return this.authenticationRequest;
|
|
263
|
+
return (_a = this.authenticationRequest) !== null && _a !== void 0 ? _a : '';
|
|
189
264
|
}
|
|
190
265
|
const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
|
|
191
266
|
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
192
267
|
}
|
|
268
|
+
async refreshQrHref() {
|
|
269
|
+
var _a, _b, _c;
|
|
270
|
+
const raw = this.buildRawLink();
|
|
271
|
+
if (!(raw === null || raw === void 0 ? void 0 : raw.trim())) {
|
|
272
|
+
this.qrShortenPending = false;
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (raw === this.lastShortenRaw && ((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
276
|
+
this.qrShortenPending = false;
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (this.qrShortenPending && raw === this.lastShortenRaw && !((_b = this.qrHref) === null || _b === void 0 ? void 0 : _b.trim())) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const gen = ++this.qrRefreshGeneration;
|
|
283
|
+
this.lastShortenRaw = raw;
|
|
284
|
+
try {
|
|
285
|
+
const shortened = await shortenUrlIfPossible(raw);
|
|
286
|
+
const now = this.buildRawLink();
|
|
287
|
+
if (now === raw) {
|
|
288
|
+
this.qrHref = shortened;
|
|
289
|
+
}
|
|
290
|
+
else if (!((_c = this.qrHref) === null || _c === void 0 ? void 0 : _c.trim())) {
|
|
291
|
+
this.qrHref = now;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
finally {
|
|
295
|
+
if (gen === this.qrRefreshGeneration) {
|
|
296
|
+
this.qrShortenPending = false;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
getLink() {
|
|
301
|
+
return this.qrHref || this.buildRawLink();
|
|
302
|
+
}
|
|
193
303
|
renderQRSection() {
|
|
304
|
+
var _a, _b, _c;
|
|
194
305
|
switch (this.result) {
|
|
195
306
|
case RESULT_STATUS.NOT_STARTED:
|
|
196
307
|
return this.renderRetryButton();
|
|
197
308
|
case RESULT_STATUS.ONGOING:
|
|
198
|
-
return this.renderQR(this.getLink(), true);
|
|
309
|
+
return this.qrShortenPending || !((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim()) ? this.renderQrLoadingSlot() : this.renderQR(this.getLink(), true, undefined, !!((_b = this.qrHref) === null || _b === void 0 ? void 0 : _b.trim()));
|
|
199
310
|
case RESULT_STATUS.EXPIRED:
|
|
200
311
|
return this.renderRetryButton(this.qrCodeExpiredLabel);
|
|
201
312
|
case RESULT_STATUS.FAILED:
|
|
@@ -203,26 +314,35 @@ const GatacaQRWS = class {
|
|
|
203
314
|
case RESULT_STATUS.SUCCESS:
|
|
204
315
|
return this.renderSuccess();
|
|
205
316
|
case RESULT_STATUS.READ:
|
|
206
|
-
return this.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
317
|
+
return this.qrShortenPending || !((_c = this.qrHref) === null || _c === void 0 ? void 0 : _c.trim())
|
|
318
|
+
? this.renderQrLoadingSlot()
|
|
319
|
+
: this.renderReadQR({
|
|
320
|
+
title: this === null || this === void 0 ? void 0 : this.readQrTitle,
|
|
321
|
+
description: this === null || this === void 0 ? void 0 : this.readQrDescription
|
|
322
|
+
});
|
|
210
323
|
}
|
|
211
324
|
}
|
|
212
325
|
renderSuccess() {
|
|
213
326
|
return h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel });
|
|
214
327
|
}
|
|
215
328
|
renderRetryButton(errorMessage) {
|
|
216
|
-
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,
|
|
329
|
+
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, display: this.display.bind(this) }));
|
|
217
330
|
}
|
|
218
331
|
renderReadQR(readQrMessages) {
|
|
219
|
-
|
|
332
|
+
var _a;
|
|
333
|
+
const linkReady = !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim());
|
|
334
|
+
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: (url, useLogo, size) => this.renderQR(url, useLogo, size, linkReady) }));
|
|
220
335
|
}
|
|
221
|
-
renderQR(value, useLogo, sizeQR) {
|
|
222
|
-
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc });
|
|
336
|
+
renderQR(value, useLogo, sizeQR, linkReady = true) {
|
|
337
|
+
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc, linkReady: linkReady });
|
|
223
338
|
}
|
|
224
|
-
|
|
225
|
-
|
|
339
|
+
renderQrLoadingSlot() {
|
|
340
|
+
const s = this.qrSize || 300;
|
|
341
|
+
return (h("div", { class: "qr-loading-slot", style: {
|
|
342
|
+
width: s + 'px',
|
|
343
|
+
height: s + 'px',
|
|
344
|
+
margin: '0 auto'
|
|
345
|
+
} }));
|
|
226
346
|
}
|
|
227
347
|
render() {
|
|
228
348
|
var _a, _b;
|