@gataca/qr 2.0.0 → 2.0.2
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/gatacaqr/app-globals-0f993ce5.js +3 -0
- package/dist/gatacaqr/css-shim-8eec97b3.js +4 -0
- package/dist/gatacaqr/dom-1b0cf05d.js +73 -0
- package/dist/{components/gat-icon-refresh.js → gatacaqr/gat-icon-refresh-8d3dc25f.js} +1 -23
- package/dist/{esm → gatacaqr}/gataca-autoqr.entry.js +19 -2
- package/dist/{esm → gatacaqr}/gataca-qr.entry.js +4 -4
- package/dist/gatacaqr/gataca-qrdisplay-0320bb25.js +97 -0
- package/dist/gatacaqr/gataca-qrdisplay.entry.js +2 -0
- package/dist/{esm/gataca-qrdisplay_2.entry.js → gatacaqr/gataca-qrws.entry.js} +5 -47
- package/dist/{components/gataca-ssibutton2.js → gatacaqr/gataca-ssibutton.entry.js} +8 -52
- package/dist/{components/gataca-ssibuttonws2.js → gatacaqr/gataca-ssibuttonws.entry.js} +7 -53
- package/dist/gatacaqr/gatacaqr.esm.js +129 -1
- package/dist/gatacaqr/index-d0db23e4.js +3262 -0
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/shadow-css-146f2f6f.js +387 -0
- package/package.json +1 -1
- package/dist/cjs/gat-icon-refresh-751505ff.js +0 -14
- package/dist/cjs/gataca-autoqr.cjs.entry.js +0 -88
- package/dist/cjs/gataca-qr.cjs.entry.js +0 -175
- package/dist/cjs/gataca-qrdisplay_2.cjs.entry.js +0 -219
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +0 -114
- package/dist/cjs/gatacaqr.cjs.js +0 -19
- package/dist/cjs/index-0b7a1532.js +0 -1410
- package/dist/cjs/index.cjs.js +0 -16
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/qr-code-styling-412bbc7a.js +0 -28
- package/dist/cjs/utils-383ee834.js +0 -26
- package/dist/collection/assets/icons/gat-icon-alert.svg +0 -5
- package/dist/collection/assets/icons/gat-icon-check.svg +0 -5
- package/dist/collection/assets/icons/gat-icon-refresh.svg +0 -4
- package/dist/collection/assets/images/logo_gataca.svg +0 -26
- package/dist/collection/collection-manifest.json +0 -17
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +0 -116
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +0 -306
- package/dist/collection/components/gataca-qr/gataca-qr.css +0 -249
- package/dist/collection/components/gataca-qr/gataca-qr.js +0 -557
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +0 -154
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +0 -249
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +0 -566
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +0 -116
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +0 -395
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +0 -116
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +0 -410
- package/dist/collection/index.js +0 -2
- package/dist/collection/utils/index.js +0 -1
- package/dist/collection/utils/utils.js +0 -21
- package/dist/components/gataca-autoqr.js +0 -144
- package/dist/components/gataca-qr.js +0 -6
- package/dist/components/gataca-qr2.js +0 -211
- package/dist/components/gataca-qrdisplay.js +0 -6
- package/dist/components/gataca-qrdisplay2.js +0 -93
- package/dist/components/gataca-qrws.js +0 -6
- package/dist/components/gataca-qrws2.js +0 -212
- package/dist/components/gataca-ssibutton.js +0 -6
- package/dist/components/gataca-ssibuttonws.js +0 -6
- package/dist/components/index.js +0 -8
- package/dist/esm/gat-icon-refresh-179ea123.js +0 -9
- package/dist/esm/gataca-ssibutton_2.entry.js +0 -109
- package/dist/esm/gatacaqr.js +0 -17
- package/dist/esm/index-19eef502.js +0 -1384
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/qr-code-styling-0eeb38d5.js +0 -26
- package/dist/gatacaqr/p-0905677f.entry.js +0 -1
- package/dist/gatacaqr/p-0be4566d.js +0 -1
- package/dist/gatacaqr/p-1d35273f.entry.js +0 -1
- package/dist/gatacaqr/p-2f22c7fc.js +0 -1
- package/dist/gatacaqr/p-4139a068.entry.js +0 -1
- package/dist/gatacaqr/p-a6f85341.js +0 -2
- package/dist/gatacaqr/p-b8ba109f.js +0 -1
- package/dist/gatacaqr/p-f85d7e76.entry.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- /package/dist/{esm → gatacaqr}/utils-05ba6c9f.js +0 -0
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-0b7a1532.js');
|
|
6
|
-
const gatIconRefresh = require('./gat-icon-refresh-751505ff.js');
|
|
7
|
-
require('./qr-code-styling-412bbc7a.js');
|
|
8
|
-
const utils = require('./utils-383ee834.js');
|
|
9
|
-
|
|
10
|
-
const gatacaQrCss = "@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 .modal-window{position:relative;border-radius:6px;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;width:300px;min-height:408px;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 p{font-family:\"Work Sans\", \"Helvetica Neue\", sans-serif;font-weight:normal;font-size:12px;letter-spacing:1px;color:#181B5E}.popUpContainer .modal-window .qrTitleContainer{padding:24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-weight:400;font-size:14px;line-height:16.5px;padding-top:12px;padding-bottom:5px;color:#A1A1A1}.popUpContainer .modal-window .bold{font-weight:600}.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 .reload{height:252px;width:252px;border:1px dashed #A1A1A1;border-radius:12px;position:relative;margin:24px;display:flex;justify-content:center;align-items:center}.popUpContainer #qrwait{display:flex;justify-content:center}.popUpContainer #qrwait,.popUpContainer #notify{width:100%;height:100%;top:0;left:0;border-radius:20px}.popUpContainer #notify{z-index:10;background-color:gray;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;align-self:center;display:flex;flex-direction:column;padding:24px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px;background:rgba(255, 255, 255, 0.9);}.popUpContainer .notify-text{font-family:\"Work Sans\";font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;font-feature-settings:\"salt\" on;color:#8B8B8B;flex:none;order:1;align-self:stretch;flex-grow:0}.popUpContainer .alert{display:flex;flex-direction:row;align-items:center;justify-content:start;width:252px;position:absolute;bottom:0;background:#FFE5E5;border-radius:12px}.popUpContainer .alert img{margin:12px}.popUpContainer .alert p{font-weight:400;font-size:14px;line-height:16px;color:black}.popUpContainer .success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.popUpContainer .success .successMsg{margin-top:20px;font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}";
|
|
11
|
-
|
|
12
|
-
const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
|
|
13
|
-
//Default values
|
|
14
|
-
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
15
|
-
const DEFAULT_POLLING_FREQ = 3;
|
|
16
|
-
const QR_ROLE_CONNECT = "connect";
|
|
17
|
-
const FUNCTION_ROLES = {
|
|
18
|
-
connect: "scan",
|
|
19
|
-
certify: "credential",
|
|
20
|
-
};
|
|
21
|
-
const GatacaQR = class {
|
|
22
|
-
constructor(hostRef) { index.registerInstance(this, hostRef); this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = index.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.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideBrandTitle = 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 = utils.RESULT_STATUS.NOT_STARTED; }
|
|
23
|
-
disconnectedCallback() {
|
|
24
|
-
this.stop();
|
|
25
|
-
}
|
|
26
|
-
async componentDidLoad() {
|
|
27
|
-
if (this.autostart) {
|
|
28
|
-
await this.display();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Force manually the display of a QR
|
|
33
|
-
*/
|
|
34
|
-
async display() {
|
|
35
|
-
await this.getSessionId();
|
|
36
|
-
this.result = utils.RESULT_STATUS.ONGOING;
|
|
37
|
-
this.poll()
|
|
38
|
-
.then((data) => {
|
|
39
|
-
this.result = utils.RESULT_STATUS.SUCCESS;
|
|
40
|
-
this.sessionData = data;
|
|
41
|
-
this.gatacaLoginCompleted.emit(data);
|
|
42
|
-
this.successCallback(data);
|
|
43
|
-
})
|
|
44
|
-
.catch((err) => {
|
|
45
|
-
this.clean();
|
|
46
|
-
let expired = err === utils.RESULT_STATUS.EXPIRED;
|
|
47
|
-
if (expired && this.autorefresh) {
|
|
48
|
-
this.display();
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
if (err !== utils.RESULT_STATUS.NOT_STARTED) {
|
|
52
|
-
let error = expired
|
|
53
|
-
? new Error("User did not scan the QR in the alloted time")
|
|
54
|
-
: new Error("Provided user credentials couldn't be validated");
|
|
55
|
-
this.result = err;
|
|
56
|
-
this.gatacaLoginFailed.emit(error);
|
|
57
|
-
this.errorCallback(error);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
if (utils.checkMobile() && this.dynamicLink) {
|
|
62
|
-
window.location.href = this.getLink();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Stop manually an ongoing session
|
|
67
|
-
*/
|
|
68
|
-
async stop() {
|
|
69
|
-
this.clean();
|
|
70
|
-
if (this.result === utils.RESULT_STATUS.ONGOING) {
|
|
71
|
-
this.result = utils.RESULT_STATUS.NOT_STARTED;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
clean() {
|
|
75
|
-
this.sessionData = undefined;
|
|
76
|
-
this.sessionId = undefined;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Retrieve manually the session data on a successful login
|
|
80
|
-
*/
|
|
81
|
-
async getSessionData() {
|
|
82
|
-
return this.sessionData
|
|
83
|
-
? Promise.resolve(this.sessionData)
|
|
84
|
-
: Promise.reject(new Error("No successful login"));
|
|
85
|
-
}
|
|
86
|
-
async getSessionId() {
|
|
87
|
-
if (this.sessionId) {
|
|
88
|
-
return this.sessionId;
|
|
89
|
-
}
|
|
90
|
-
let { sessionId, authenticationRequest } = await this.createSession();
|
|
91
|
-
this.sessionId = sessionId;
|
|
92
|
-
this.authenticationRequest = authenticationRequest;
|
|
93
|
-
return this.sessionId;
|
|
94
|
-
}
|
|
95
|
-
getLink() {
|
|
96
|
-
if (this.v2 && this.qrRole == QR_ROLE_CONNECT) {
|
|
97
|
-
return this.authenticationRequest;
|
|
98
|
-
}
|
|
99
|
-
let op = FUNCTION_ROLES[this.qrRole];
|
|
100
|
-
let link = "https://gataca.page.link/" + op + "?";
|
|
101
|
-
link +=
|
|
102
|
-
this.qrRole === QR_ROLE_CONNECT
|
|
103
|
-
? "session=" + this.sessionId
|
|
104
|
-
: "process=" + this.sessionId;
|
|
105
|
-
link +=
|
|
106
|
-
"&callback=" + utils.base64UrlEncode(encodeURIComponent(this.callbackServer));
|
|
107
|
-
link = encodeURIComponent(link);
|
|
108
|
-
return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
|
|
109
|
-
}
|
|
110
|
-
async poll() {
|
|
111
|
-
let endTime = new Date().getTime() +
|
|
112
|
-
(this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
113
|
-
let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
|
|
114
|
-
let checkFunc = async (component) => {
|
|
115
|
-
if (component.result === utils.RESULT_STATUS.NOT_STARTED) {
|
|
116
|
-
return { result: utils.RESULT_STATUS.NOT_STARTED };
|
|
117
|
-
}
|
|
118
|
-
let id = await component.getSessionId();
|
|
119
|
-
return component.checkStatus(id);
|
|
120
|
-
};
|
|
121
|
-
let component = this;
|
|
122
|
-
let checkCondition = async function (resolve, reject) {
|
|
123
|
-
// If the condition is met, we're done!
|
|
124
|
-
let { result, data } = await checkFunc(component);
|
|
125
|
-
switch (result) {
|
|
126
|
-
case utils.RESULT_STATUS.SUCCESS:
|
|
127
|
-
resolve(data);
|
|
128
|
-
break;
|
|
129
|
-
case utils.RESULT_STATUS.ONGOING:
|
|
130
|
-
if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
|
|
131
|
-
setTimeout(checkCondition, interval, resolve, reject);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
reject(utils.RESULT_STATUS.EXPIRED);
|
|
135
|
-
}
|
|
136
|
-
break;
|
|
137
|
-
default:
|
|
138
|
-
reject(result);
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
return new Promise(checkCondition);
|
|
143
|
-
}
|
|
144
|
-
renderQRSection() {
|
|
145
|
-
switch (this.result) {
|
|
146
|
-
case utils.RESULT_STATUS.NOT_STARTED:
|
|
147
|
-
return this.renderRetryButton();
|
|
148
|
-
case utils.RESULT_STATUS.ONGOING:
|
|
149
|
-
return this.renderQR(this.getLink(), 300, true);
|
|
150
|
-
case utils.RESULT_STATUS.EXPIRED:
|
|
151
|
-
return this.renderRetryButton("QR Code expired");
|
|
152
|
-
case utils.RESULT_STATUS.FAILED:
|
|
153
|
-
return this.renderRetryButton("User credentials not validated");
|
|
154
|
-
case utils.RESULT_STATUS.SUCCESS:
|
|
155
|
-
return this.renderSuccess();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
renderSuccess() {
|
|
159
|
-
return (index.h("div", { class: "success" }, index.h("img", { src: gatIconRefresh.gatIconCheckSvg, height: 52, width: 52 }), index.h("p", { class: "successMsg" }, "Successful Connection!")));
|
|
160
|
-
}
|
|
161
|
-
renderRetryButton(errorMessage) {
|
|
162
|
-
return (index.h("div", { class: "reload" }, index.h("div", { id: "notify", onClick: () => this.display() }, index.h("img", { src: gatIconRefresh.gatIconRefreshSvg, height: 24, width: 24 }), index.h("p", { class: "qrDescription" }, "Click inside the box to "), errorMessage ? (index.h("p", { class: "qrDescription bold" }, "Refresh QR Code")) : (index.h("p", { class: "qrDescription bold" }, "Scan QR Code")), errorMessage && (index.h("div", { class: "alert" }, index.h("img", { src: gatIconRefresh.gatIconAlertSvg, height: 24, width: 24 }), index.h("p", null, errorMessage)))), index.h("div", { id: "qrwait" }, this.renderQR("waiting to start a session", 250))));
|
|
163
|
-
}
|
|
164
|
-
renderQR(value, size, useLogo) {
|
|
165
|
-
return (index.h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0 }));
|
|
166
|
-
}
|
|
167
|
-
render() {
|
|
168
|
-
return (index.h("div", { class: "popUpContainer" }, index.h("div", { class: "modal-window is-visible", onClick: (event) => {
|
|
169
|
-
event.stopPropagation();
|
|
170
|
-
} }, index.h("div", { class: "modal-window__content" }, index.h("div", { class: "qrTitleContainer" }, index.h("p", { class: "qrTitle" }, this.qrModalTitle), !this.hideBrandTitle && (index.h("p", { class: "qrBrand" }, "by Gataca", " ", index.h("span", null, index.h("img", { src: gatIconRefresh.logoGatacaSvg })))), this.result !== utils.RESULT_STATUS.SUCCESS && (index.h("p", { class: "qrDescription" }, this.qrModalDescription))), index.h("div", { class: "qrSection" }, this.renderQRSection())))));
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
GatacaQR.style = gatacaQrCss;
|
|
174
|
-
|
|
175
|
-
exports.gataca_qr = GatacaQR;
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-0b7a1532.js');
|
|
6
|
-
const qrCodeStyling = require('./qr-code-styling-412bbc7a.js');
|
|
7
|
-
const gatIconRefresh = require('./gat-icon-refresh-751505ff.js');
|
|
8
|
-
const utils = require('./utils-383ee834.js');
|
|
9
|
-
|
|
10
|
-
const GatacaQRDisplay = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.qrData = undefined;
|
|
14
|
-
this.size = 256;
|
|
15
|
-
this.logoSize = 0;
|
|
16
|
-
this.logoSrc = undefined;
|
|
17
|
-
this.qrColor = "#181B5E";
|
|
18
|
-
this.rounded = true;
|
|
19
|
-
}
|
|
20
|
-
componentDidLoad() {
|
|
21
|
-
const qrCode = new qrCodeStyling.QRCodeStyling({
|
|
22
|
-
data: this.qrData,
|
|
23
|
-
width: this.size,
|
|
24
|
-
height: this.size,
|
|
25
|
-
image: this.logoSize > 0 ? this.logoSrc || gatIconRefresh.logoGatacaSvg : undefined,
|
|
26
|
-
margin: 10,
|
|
27
|
-
type: "svg",
|
|
28
|
-
dotsOptions: {
|
|
29
|
-
color: this.qrColor,
|
|
30
|
-
type: this.rounded ? "dots" : "square",
|
|
31
|
-
},
|
|
32
|
-
cornersSquareOptions: {
|
|
33
|
-
type: this.rounded ? "extra-rounded" : "square",
|
|
34
|
-
},
|
|
35
|
-
cornersDotOptions: {
|
|
36
|
-
type: this.rounded ? "dot" : "square",
|
|
37
|
-
},
|
|
38
|
-
imageOptions: {
|
|
39
|
-
margin: 2,
|
|
40
|
-
imageSize: this.logoSize,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
qrCode.append(this.qr);
|
|
44
|
-
}
|
|
45
|
-
render() {
|
|
46
|
-
return (index.h("div", { ref: (el) => {
|
|
47
|
-
this.qr = el;
|
|
48
|
-
} }));
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const gatacaQrwsCss = "@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 .modal-window{position:relative;border-radius:6px;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;width:300px;min-height:408px;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 p{font-family:\"Work Sans\", \"Helvetica Neue\", sans-serif;font-weight:normal;font-size:12px;letter-spacing:1px;color:#181B5E}.popUpContainer .modal-window .qrTitleContainer{padding:24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-weight:400;font-size:14px;line-height:16.5px;padding-top:12px;padding-bottom:5px;color:#A1A1A1}.popUpContainer .modal-window .bold{font-weight:600}.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 .reload{height:252px;width:252px;border:1px dashed #A1A1A1;border-radius:12px;position:relative;margin:24px;display:flex;justify-content:center;align-items:center}.popUpContainer #qrwait{display:flex;justify-content:center}.popUpContainer #qrwait,.popUpContainer #notify{width:100%;height:100%;top:0;left:0;border-radius:20px}.popUpContainer #notify{z-index:10;background-color:gray;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;align-self:center;display:flex;flex-direction:column;padding:24px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px;background:rgba(255, 255, 255, 0.9);}.popUpContainer .notify-text{font-family:\"Work Sans\";font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;font-feature-settings:\"salt\" on;color:#8B8B8B;flex:none;order:1;align-self:stretch;flex-grow:0}.popUpContainer .alert{display:flex;flex-direction:row;align-items:center;justify-content:start;width:252px;position:absolute;bottom:0;background:#FFE5E5;border-radius:12px}.popUpContainer .alert img{margin:12px}.popUpContainer .alert p{font-weight:400;font-size:14px;line-height:16px;color:black}.popUpContainer .success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.popUpContainer .success .successMsg{margin-top:20px;font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}";
|
|
53
|
-
|
|
54
|
-
const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
|
|
55
|
-
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
56
|
-
const QR_ROLE_CONNECT = "connect";
|
|
57
|
-
const FUNCTION_ROLES = {
|
|
58
|
-
connect: "scan",
|
|
59
|
-
certify: "credential",
|
|
60
|
-
};
|
|
61
|
-
const GatacaQRWS = class {
|
|
62
|
-
constructor(hostRef) { index.registerInstance(this, hostRef); this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7); 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.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideBrandTitle = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = utils.RESULT_STATUS.NOT_STARTED; }
|
|
63
|
-
disconnectedCallback() {
|
|
64
|
-
this.stop();
|
|
65
|
-
}
|
|
66
|
-
async componentDidLoad() {
|
|
67
|
-
if (this.autostart) {
|
|
68
|
-
await this.display();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Force manually the display of a QR
|
|
73
|
-
*/
|
|
74
|
-
async display() {
|
|
75
|
-
let socket = new WebSocket(this.socketEndpoint);
|
|
76
|
-
setTimeout(() => {
|
|
77
|
-
this.socket.close(1000, "");
|
|
78
|
-
}, 1000 * this.sessionTimeout);
|
|
79
|
-
this.socket = socket;
|
|
80
|
-
socket.onopen = () => {
|
|
81
|
-
if (this.wsOnOpen)
|
|
82
|
-
this.wsOnOpen(this.socket);
|
|
83
|
-
};
|
|
84
|
-
socket.onmessage = (msg) => {
|
|
85
|
-
if (this.wsOnMessage) {
|
|
86
|
-
this.wsOnMessage(this.socket, msg);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
let wsresp = JSON.parse(msg.data);
|
|
90
|
-
if (!!wsresp.sessionId) {
|
|
91
|
-
this.handleWSResponse(wsresp);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
socket.onerror = () => {
|
|
96
|
-
let error = new Error("Error connecting with server");
|
|
97
|
-
this.result = utils.RESULT_STATUS.FAILED;
|
|
98
|
-
this.gatacaLoginFailed.emit(error);
|
|
99
|
-
this.errorCallback(error);
|
|
100
|
-
socket.close(1000, "");
|
|
101
|
-
};
|
|
102
|
-
socket.onclose = () => {
|
|
103
|
-
if (this.result === utils.RESULT_STATUS.ONGOING) {
|
|
104
|
-
this.result = utils.RESULT_STATUS.EXPIRED;
|
|
105
|
-
}
|
|
106
|
-
if (this.result === utils.RESULT_STATUS.EXPIRED) {
|
|
107
|
-
if (this.autorefresh) {
|
|
108
|
-
this.display();
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
let error = new Error("User did not scan the QR in the alloted time");
|
|
112
|
-
this.gatacaLoginFailed.emit(error);
|
|
113
|
-
this.errorCallback(error);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
if (utils.checkMobile() && this.dynamicLink) {
|
|
118
|
-
window.location.href = this.getLink();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
sessionMsgReceived(event) {
|
|
122
|
-
let wsresp = event.detail;
|
|
123
|
-
this.handleWSResponse(wsresp);
|
|
124
|
-
}
|
|
125
|
-
handleWSResponse(wsresp) {
|
|
126
|
-
this.result = wsresp.result;
|
|
127
|
-
switch (wsresp.result) {
|
|
128
|
-
case utils.RESULT_STATUS.ONGOING:
|
|
129
|
-
this.sessionId = wsresp.sessionId;
|
|
130
|
-
this.authenticationRequest = wsresp.authenticationRequest;
|
|
131
|
-
break;
|
|
132
|
-
case utils.RESULT_STATUS.SUCCESS:
|
|
133
|
-
this.sessionData = wsresp.authenticatedUserData;
|
|
134
|
-
this.gatacaLoginCompleted.emit(wsresp.authenticatedUserData);
|
|
135
|
-
this.successCallback(wsresp.authenticatedUserData);
|
|
136
|
-
this.socket.close(1000, "");
|
|
137
|
-
break;
|
|
138
|
-
case utils.RESULT_STATUS.FAILED:
|
|
139
|
-
this.socket.close();
|
|
140
|
-
let error = new Error("Provided user credentials couldn't be validated");
|
|
141
|
-
this.gatacaLoginFailed.emit(error);
|
|
142
|
-
this.errorCallback(error);
|
|
143
|
-
break;
|
|
144
|
-
case utils.RESULT_STATUS.EXPIRED:
|
|
145
|
-
this.socket.close();
|
|
146
|
-
if (this.autorefresh) {
|
|
147
|
-
this.display();
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
let error = new Error("User did not scan the QR in the alloted time");
|
|
151
|
-
this.gatacaLoginFailed.emit(error);
|
|
152
|
-
this.errorCallback(error);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Stop manually an ongoing session
|
|
158
|
-
*/
|
|
159
|
-
async stop() {
|
|
160
|
-
this.sessionData = undefined;
|
|
161
|
-
this.sessionId = undefined;
|
|
162
|
-
this.socket.close(1000, "Client stopped the connection");
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Retrieve manually the session data on a successful login
|
|
166
|
-
*/
|
|
167
|
-
async getSessionData() {
|
|
168
|
-
return this.sessionData
|
|
169
|
-
? Promise.resolve(this.sessionData)
|
|
170
|
-
: Promise.reject(new Error("No successful login"));
|
|
171
|
-
}
|
|
172
|
-
getLink() {
|
|
173
|
-
if (this.v2 && this.qrRole == QR_ROLE_CONNECT) {
|
|
174
|
-
return this.authenticationRequest;
|
|
175
|
-
}
|
|
176
|
-
let op = FUNCTION_ROLES[this.qrRole];
|
|
177
|
-
let link = "https://gataca.page.link/" + op + "?";
|
|
178
|
-
link +=
|
|
179
|
-
this.qrRole === QR_ROLE_CONNECT
|
|
180
|
-
? "session=" + this.sessionId
|
|
181
|
-
: "process=" + this.sessionId;
|
|
182
|
-
link +=
|
|
183
|
-
"&callback=" + utils.base64UrlEncode(encodeURIComponent(this.callbackServer));
|
|
184
|
-
link = encodeURIComponent(link);
|
|
185
|
-
return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
|
|
186
|
-
}
|
|
187
|
-
renderQRSection() {
|
|
188
|
-
switch (this.result) {
|
|
189
|
-
case utils.RESULT_STATUS.NOT_STARTED:
|
|
190
|
-
return this.renderRetryButton();
|
|
191
|
-
case utils.RESULT_STATUS.ONGOING:
|
|
192
|
-
return this.renderQR(this.getLink(), 300, true);
|
|
193
|
-
case utils.RESULT_STATUS.EXPIRED:
|
|
194
|
-
return this.renderRetryButton("QR Code expired");
|
|
195
|
-
case utils.RESULT_STATUS.FAILED:
|
|
196
|
-
return this.renderRetryButton("User credentials not validated");
|
|
197
|
-
case utils.RESULT_STATUS.SUCCESS:
|
|
198
|
-
return this.renderSuccess();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
renderSuccess() {
|
|
202
|
-
return (index.h("div", { class: "success" }, index.h("img", { src: gatIconRefresh.gatIconCheckSvg, height: 52, width: 52 }), index.h("p", { class: "successMsg" }, "Successful Connection!")));
|
|
203
|
-
}
|
|
204
|
-
renderRetryButton(errorMessage) {
|
|
205
|
-
return (index.h("div", { class: "reload" }, index.h("div", { id: "notify", onClick: () => this.display() }, index.h("img", { src: gatIconRefresh.gatIconRefreshSvg, height: 24, width: 24 }), index.h("p", { class: "qrDescription" }, "Click inside the box to "), errorMessage ? (index.h("p", { class: "qrDescription bold" }, "Refresh QR Code")) : (index.h("p", { class: "qrDescription bold" }, "Scan QR Code")), errorMessage && (index.h("div", { class: "alert" }, index.h("img", { src: gatIconRefresh.gatIconAlertSvg, height: 24, width: 24 }), index.h("p", null, errorMessage)))), index.h("div", { id: "qrwait" }, this.renderQR("waiting to start a session", 250))));
|
|
206
|
-
}
|
|
207
|
-
renderQR(value, size, useLogo) {
|
|
208
|
-
return (index.h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0 }));
|
|
209
|
-
}
|
|
210
|
-
render() {
|
|
211
|
-
return (index.h("div", { class: "popUpContainer" }, index.h("div", { class: "modal-window is-visible", onClick: (event) => {
|
|
212
|
-
event.stopPropagation();
|
|
213
|
-
} }, index.h("div", { class: "modal-window__content" }, index.h("div", { class: "qrTitleContainer" }, index.h("p", { class: "qrTitle" }, this.qrModalTitle), !this.hideBrandTitle && (index.h("p", { class: "qrBrand" }, "by Gataca", " ", index.h("span", null, index.h("img", { src: gatIconRefresh.logoGatacaSvg })))), this.result !== utils.RESULT_STATUS.SUCCESS && (index.h("p", { class: "qrDescription" }, this.qrModalDescription))), index.h("div", { class: "qrSection" }, this.renderQRSection())))));
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
GatacaQRWS.style = gatacaQrwsCss;
|
|
217
|
-
|
|
218
|
-
exports.gataca_qrdisplay = GatacaQRDisplay;
|
|
219
|
-
exports.gataca_qrws = GatacaQRWS;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-0b7a1532.js');
|
|
6
|
-
require('./qr-code-styling-412bbc7a.js');
|
|
7
|
-
|
|
8
|
-
const gatacaSsibuttonCss = "@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}";
|
|
9
|
-
|
|
10
|
-
const PHONE_ICON$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHvSURBVHgB3ZZPTttAFMbfe3YjL7qYLopcpZXSG7Q3CDfIsqrSJpyg5QQtJ2h7glgUdVs4AeEE5AYEQSDAgtnw357Hm0hAQDaeIRFCfFKyeKPxzzPzvc+DUKCZN80GEv1ABgWOQgSdGbOwv7u0nDueV4zjTzUIKhuAZna4vdQFR828azbI0K/TI/qodaLvjlP+tLDGDCs+IKv9Lbsi7kcv0w9541Q0EREPYcoieEQ9KiyECRXHzbpBUOcnYTfPFOOaaGVx9WsLiDrSIp0iU0wFNgIx/AQyc9I/OmOjy+Y8aBvHQcDUYebewc6/Xtk8J5htcg5efEPGhk0JtqkyBjo7DuZcnuO2sqCyKv8rUDmfTS9IBURqBAL+I6CkzBjOMOs22TLY21n8fl17KzXR3uDvb/CQk0GEdfvN07QvpnAOaGfYaRT25JzU6+rnG2tTpcWAy+Cp0m3U/URLms8HWfg/rn6RFaGSs9KQkZMpvGBWNs2Vandt46ac6YNBuc0fDLMaOU5DFybQ8039p/KJ4bq4rwPewtqoM/1gsCm/NfBXvWjgHhhuDAeLyd3qVSifHQULeZkou9EqemLhmUmav8qrZ4GEMGA7ivzjKvfeqGptFV2YdWPMPHHq0cCh3DdpVdLl/XCY9J1gVvbCiWa6N+JLocPFjCsx9cAAAAAASUVORK5CYII=";
|
|
11
|
-
const GatacaSSIButton = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
|
|
15
|
-
this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
|
|
16
|
-
this.buttonText = "Easy login";
|
|
17
|
-
this.checkStatus = undefined;
|
|
18
|
-
this.createSession = undefined;
|
|
19
|
-
this.successCallback = undefined;
|
|
20
|
-
this.errorCallback = undefined;
|
|
21
|
-
this.qrRole = undefined;
|
|
22
|
-
this.callbackServer = undefined;
|
|
23
|
-
this.sessionTimeout = undefined;
|
|
24
|
-
this.pollingFrequency = undefined;
|
|
25
|
-
this.autorefresh = false;
|
|
26
|
-
this.v2 = false;
|
|
27
|
-
this.qrModalTitle = "Quick Access";
|
|
28
|
-
this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
|
|
29
|
-
this.hideBrandTitle = false;
|
|
30
|
-
this.dynamicLink = true;
|
|
31
|
-
this.open = false;
|
|
32
|
-
this.qr = (index.h("gataca-qr", { checkStatus: this.checkStatus, createSession: this.createSession, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, pollingFrequency: this.pollingFrequency, autostart: true, autorefresh: this.autorefresh, v2: this.v2, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Retrieve manually the session data on a successful login
|
|
36
|
-
*/
|
|
37
|
-
async getSessionData() {
|
|
38
|
-
return this.qr.getSessionData();
|
|
39
|
-
}
|
|
40
|
-
renderModal() {
|
|
41
|
-
return this.qr;
|
|
42
|
-
}
|
|
43
|
-
renderButton() {
|
|
44
|
-
return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
|
|
45
|
-
this.open = !this.open;
|
|
46
|
-
if (this.open) {
|
|
47
|
-
this.qr.display();
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.qr.stop();
|
|
51
|
-
}
|
|
52
|
-
} }, index.h("img", { src: PHONE_ICON$1, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
|
|
53
|
-
}
|
|
54
|
-
render() {
|
|
55
|
-
return (index.h("div", { class: "buttonContainer" }, this.renderButton(), this.open && this.renderModal()));
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
GatacaSSIButton.style = gatacaSsibuttonCss;
|
|
59
|
-
|
|
60
|
-
const gatacaSsibuttonwsCss = "@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}";
|
|
61
|
-
|
|
62
|
-
const PHONE_ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHvSURBVHgB3ZZPTttAFMbfe3YjL7qYLopcpZXSG7Q3CDfIsqrSJpyg5QQtJ2h7glgUdVs4AeEE5AYEQSDAgtnw357Hm0hAQDaeIRFCfFKyeKPxzzPzvc+DUKCZN80GEv1ABgWOQgSdGbOwv7u0nDueV4zjTzUIKhuAZna4vdQFR828azbI0K/TI/qodaLvjlP+tLDGDCs+IKv9Lbsi7kcv0w9541Q0EREPYcoieEQ9KiyECRXHzbpBUOcnYTfPFOOaaGVx9WsLiDrSIp0iU0wFNgIx/AQyc9I/OmOjy+Y8aBvHQcDUYebewc6/Xtk8J5htcg5efEPGhk0JtqkyBjo7DuZcnuO2sqCyKv8rUDmfTS9IBURqBAL+I6CkzBjOMOs22TLY21n8fl17KzXR3uDvb/CQk0GEdfvN07QvpnAOaGfYaRT25JzU6+rnG2tTpcWAy+Cp0m3U/URLms8HWfg/rn6RFaGSs9KQkZMpvGBWNs2Vandt46ac6YNBuc0fDLMaOU5DFybQ8039p/KJ4bq4rwPewtqoM/1gsCm/NfBXvWjgHhhuDAeLyd3qVSifHQULeZkou9EqemLhmUmav8qrZ4GEMGA7ivzjKvfeqGptFV2YdWPMPHHq0cCh3DdpVdLl/XCY9J1gVvbCiWa6N+JLocPFjCsx9cAAAAAASUVORK5CYII=";
|
|
63
|
-
const GatacaSSIButtonWS = class {
|
|
64
|
-
constructor(hostRef) {
|
|
65
|
-
index.registerInstance(this, hostRef);
|
|
66
|
-
this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
|
|
67
|
-
this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
|
|
68
|
-
this.buttonText = "Easy login";
|
|
69
|
-
this.successCallback = undefined;
|
|
70
|
-
this.errorCallback = undefined;
|
|
71
|
-
this.qrRole = undefined;
|
|
72
|
-
this.callbackServer = undefined;
|
|
73
|
-
this.socketEndpoint = undefined;
|
|
74
|
-
this.sessionTimeout = undefined;
|
|
75
|
-
this.wsOnOpen = undefined;
|
|
76
|
-
this.wsOnMessage = undefined;
|
|
77
|
-
this.autostart = true;
|
|
78
|
-
this.autorefresh = false;
|
|
79
|
-
this.v2 = false;
|
|
80
|
-
this.qrModalTitle = "Quick Access";
|
|
81
|
-
this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
|
|
82
|
-
this.hideBrandTitle = false;
|
|
83
|
-
this.dynamicLink = true;
|
|
84
|
-
this.open = false;
|
|
85
|
-
this.qr = (index.h("gataca-qrws", { wsOnMessage: this.wsOnMessage, wsOnOpen: this.wsOnOpen, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, socketEndpoint: this.socketEndpoint, autostart: true, autorefresh: this.autorefresh, v2: this.v2, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Retrieve manually the session data on a successful login
|
|
89
|
-
*/
|
|
90
|
-
async getSessionData() {
|
|
91
|
-
return this.qr.getSessionData();
|
|
92
|
-
}
|
|
93
|
-
renderModal() {
|
|
94
|
-
return this.qr;
|
|
95
|
-
}
|
|
96
|
-
renderButton() {
|
|
97
|
-
return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
|
|
98
|
-
this.open = !this.open;
|
|
99
|
-
if (this.open) {
|
|
100
|
-
this.qr.display();
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
this.qr.stop();
|
|
104
|
-
}
|
|
105
|
-
} }, index.h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
|
|
106
|
-
}
|
|
107
|
-
render() {
|
|
108
|
-
return (index.h("div", { class: "buttonContainer" }, this.renderButton(), this.open && this.renderModal()));
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
GatacaSSIButtonWS.style = gatacaSsibuttonwsCss;
|
|
112
|
-
|
|
113
|
-
exports.gataca_ssibutton = GatacaSSIButton;
|
|
114
|
-
exports.gataca_ssibuttonws = GatacaSSIButtonWS;
|
package/dist/cjs/gatacaqr.cjs.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-0b7a1532.js');
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
Stencil Client Patch Browser v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
7
|
-
*/
|
|
8
|
-
const patchBrowser = () => {
|
|
9
|
-
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('gatacaqr.cjs.js', document.baseURI).href));
|
|
10
|
-
const opts = {};
|
|
11
|
-
if (importMeta !== '') {
|
|
12
|
-
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
-
}
|
|
14
|
-
return index.promiseResolve(opts);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["gataca-qrdisplay_2.cjs",[[1,"gataca-qrws",{"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"rounded":[4]}]]],["gataca-qr.cjs",[[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]}]]],["gataca-ssibutton_2.cjs",[[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}],[1,"gataca-ssibuttonws",{"buttonText":[1,"button-text"],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}]]],["gataca-autoqr.cjs",[[1,"gataca-autoqr",{"configId":[1,"config-id"],"configRepository":[1,"config-repository"],"successCallback":[16],"errorCallback":[16],"checkStatus":[16],"createSession":[16],"wsOnOpen":[16],"wsOnMessage":[16],"config":[32],"loading":[32],"getSessionData":[64]}]]]], options);
|
|
19
|
-
});
|