@gataca/qr 0.0.15 → 0.0.17

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.
Files changed (38) hide show
  1. package/dist/cjs/gat-icon-alert-0ad19b26.js +14 -0
  2. package/dist/cjs/gataca-autoqr.cjs.entry.js +1 -1
  3. package/dist/cjs/{gataca-qr_3.cjs.entry.js → gataca-qr_2.cjs.entry.js} +37 -275
  4. package/dist/cjs/gataca-qrws.cjs.entry.js +3 -2
  5. package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +320 -0
  6. package/dist/cjs/gatacaqr.cjs.js +2 -2
  7. package/dist/cjs/{index-93d47a75.js → index-8638645b.js} +13 -0
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/{esm/gat-icon-alert-c9761842.js → cjs/qr-code-styling-412bbc7a.js} +2 -8
  10. package/dist/collection/components/gataca-qr/gataca-qr.js +30 -10
  11. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +2 -2
  12. package/dist/components/gataca-qr2.js +31 -12
  13. package/dist/components/gataca-ssibutton2.js +2 -2
  14. package/dist/esm/gat-icon-alert-7b06ef3a.js +9 -0
  15. package/dist/esm/gataca-autoqr.entry.js +1 -1
  16. package/dist/esm/{gataca-qr_3.entry.js → gataca-qr_2.entry.js} +37 -274
  17. package/dist/esm/gataca-qrws.entry.js +3 -2
  18. package/dist/esm/gataca-ssibutton_2.entry.js +315 -0
  19. package/dist/esm/gatacaqr.js +2 -2
  20. package/dist/esm/{index-2be54f32.js → index-af2994f7.js} +13 -1
  21. package/dist/esm/loader.js +2 -2
  22. package/dist/{cjs/gat-icon-alert-6127161a.js → esm/qr-code-styling-0eeb38d5.js} +1 -15
  23. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  24. package/dist/gatacaqr/p-0be4566d.js +1 -0
  25. package/dist/gatacaqr/{p-0381ab9a.entry.js → p-3ca3bb1a.entry.js} +1 -1
  26. package/dist/gatacaqr/p-88af482f.entry.js +1 -0
  27. package/dist/gatacaqr/p-ba0417e2.js +2 -0
  28. package/dist/gatacaqr/p-d59ae0ab.entry.js +1 -0
  29. package/dist/gatacaqr/p-e02a049d.entry.js +1 -0
  30. package/dist/gatacaqr/p-ea783014.js +1 -0
  31. package/package.json +1 -1
  32. package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +0 -60
  33. package/dist/esm/gataca-ssibuttonws.entry.js +0 -56
  34. package/dist/gatacaqr/p-5ae5f952.js +0 -2
  35. package/dist/gatacaqr/p-8464955a.entry.js +0 -1
  36. package/dist/gatacaqr/p-a1ef6c80.entry.js +0 -1
  37. package/dist/gatacaqr/p-bdd385ad.entry.js +0 -1
  38. package/dist/gatacaqr/p-d79c8f74.js +0 -1
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ const logoGatacaSvg = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDc2IDcxIiB3aWR0aD0iNzEiIGhlaWdodD0iNjYiPgoJPHRpdGxlPlZlY3RvciAoMyktc3ZnPC90aXRsZT4KCTxzdHlsZT4KCQkuczAgeyBmaWxsOiAjNDc0NWI3IH0gCgk8L3N0eWxlPgoJPHBhdGggaWQ9IkxheWVyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsYXNzPSJzMCIgZD0ibTcyLjIgMzguNGMyLjIgMy4zIDMuNSA3LjIgMy41IDExLjQgMCAxMS4yLTguOCAyMC4yLTE5LjkgMjAuN3EtMC40IDAtMC44IDBjLTMgMC01LjgtMC42LTguNC0xLjdxLTIuMS0xLTMuOC0yLjMtMS4xLTAuOC0yLjEtMS43LTEuMy0xLjItMi4zLTIuNi0wLjUgMC42LTEgMS4yYy0zLjggNC40LTkuNCA3LjEtMTUuNyA3LjEtNi43IDAtMTIuNi0zLjItMTYuNC04LjEtMi43LTMuNS00LjMtNy44LTQuM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IconCheckSvg = gatIconCheckSvg;
13
+ exports.gatIconRefreshSvg = gatIconRefreshSvg;
14
+ exports.logoGatacaSvg = logoGatacaSvg;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-93d47a75.js');
5
+ const index = require('./index-8638645b.js');
6
6
 
7
7
  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}";
8
8
 
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-93d47a75.js');
6
- const gatIconAlert = require('./gat-icon-alert-6127161a.js');
5
+ const index = require('./index-8638645b.js');
6
+ const gatIconAlert = require('./gat-icon-alert-0ad19b26.js');
7
+ const qrCodeStyling = require('./qr-code-styling-412bbc7a.js');
7
8
  const utils = require('./utils-ef28b844.js');
8
9
 
9
10
  const GatacaQRDisplay = class {
@@ -18,7 +19,7 @@ const GatacaQRDisplay = class {
18
19
  this.rounded = true;
19
20
  }
20
21
  componentDidLoad() {
21
- const qrCode = new gatIconAlert.QRCodeStyling({
22
+ const qrCode = new qrCodeStyling.QRCodeStyling({
22
23
  data: this.qrData,
23
24
  width: this.size,
24
25
  height: this.size,
@@ -121,10 +122,10 @@ const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubun
121
122
 
122
123
  const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
123
124
  //Default values
124
- const DEFAULT_SESSION_TIMEOUT$1 = 300; //5mins as in connect
125
- const DEFAULT_POLLING_FREQ$1 = 3;
125
+ const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
126
+ const DEFAULT_POLLING_FREQ = 3;
126
127
  const GatacaQR = class {
127
- 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.qrId = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v = "3"; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = gatIconAlert.logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT$1; this.pollingFrequency = DEFAULT_POLLING_FREQ$1; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = utils.RESULT_STATUS.NOT_STARTED; }
128
+ 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.qrId = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v = "3"; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = gatIconAlert.logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = utils.RESULT_STATUS.NOT_STARTED; }
128
129
  disconnectedCallback() {
129
130
  this.stop();
130
131
  }
@@ -139,9 +140,15 @@ const GatacaQR = class {
139
140
  async display() {
140
141
  await this.getSessionId();
141
142
  this.result = utils.RESULT_STATUS.ONGOING;
143
+ console.log("display0", "this.result", this.result);
144
+ index.forceUpdate(this);
145
+ console.log("display1", "this.result", this.result);
142
146
  this.poll()
143
147
  .then((data) => {
144
148
  this.result = utils.RESULT_STATUS.SUCCESS;
149
+ console.log("display2", "this.result", this.result);
150
+ index.forceUpdate(this);
151
+ console.log("display3", "this.result", this.result);
145
152
  this.sessionData = data;
146
153
  this.gatacaLoginCompleted.emit(data);
147
154
  this.successCallback(data);
@@ -158,6 +165,9 @@ const GatacaQR = class {
158
165
  ? new Error(this.userNotScanInTimeErrorLabel)
159
166
  : new Error(this.credsNotValidatedErrorLabel);
160
167
  this.result = err;
168
+ console.log("display4", "this.result", this.result);
169
+ index.forceUpdate(this);
170
+ console.log("display5", "this.result", this.result);
161
171
  this.gatacaLoginFailed.emit(error);
162
172
  this.errorCallback(error);
163
173
  }
@@ -189,17 +199,17 @@ const GatacaQR = class {
189
199
  : Promise.reject(new Error(this.failedLoginErrorLabel));
190
200
  }
191
201
  async getSessionId() {
192
- // if (this.sessionId) {
193
- // return this.sessionId;
194
- // }
195
- console.log("111 getSessionId", "this.sessionId", this.sessionId);
202
+ if (this.sessionId) {
203
+ return this.sessionId;
204
+ }
205
+ // console.log("111 getSessionId", "this.sessionId", this.sessionId);
196
206
  if (this.createSession) {
197
207
  let { sessionId, authenticationRequest } = await this.createSession();
198
- console.log("222 getSessionId", "sessionId", sessionId);
208
+ // console.log("222 getSessionId", "sessionId", sessionId);
199
209
  this.sessionId = sessionId;
200
210
  this.authenticationRequest = authenticationRequest;
201
211
  }
202
- console.log("333 getSessionId", "this.sessionId", this.sessionId);
212
+ // console.log("333 getSessionId", "this.sessionId", this.sessionId);
203
213
  return this.sessionId;
204
214
  }
205
215
  getLink() {
@@ -211,8 +221,8 @@ const GatacaQR = class {
211
221
  }
212
222
  async poll() {
213
223
  let endTime = new Date().getTime() +
214
- (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT$1) * 1000;
215
- let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ$1) * 1000;
224
+ (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
225
+ let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
216
226
  let checkFunc = async (component) => {
217
227
  if (component.result === utils.RESULT_STATUS.NOT_STARTED) {
218
228
  return { result: utils.RESULT_STATUS.NOT_STARTED };
@@ -246,6 +256,7 @@ const GatacaQR = class {
246
256
  return new Promise(checkCondition);
247
257
  }
248
258
  renderQRSection() {
259
+ console.log("renderQRSection", "this.result", this.result);
249
260
  switch (this.result) {
250
261
  case utils.RESULT_STATUS.NOT_STARTED:
251
262
  return this.renderRetryButton();
@@ -265,6 +276,7 @@ const GatacaQR = class {
265
276
  }
266
277
  }
267
278
  renderSuccess() {
279
+ console.log("renderSuccess", "this.result", this.result);
268
280
  return (index.h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel }));
269
281
  }
270
282
  renderRetryButton(errorMessage) {
@@ -274,11 +286,19 @@ const GatacaQR = class {
274
286
  return (index.h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR }));
275
287
  }
276
288
  renderQR(value, useLogo) {
277
- console.log("this.qrId", this.qrId);
278
- return (index.h(QR, { qrId: this.qrId, value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
289
+ console.log("renderQR", value, useLogo);
290
+ return (index.h("p", null, "LOADING")
291
+ // <QR
292
+ // qrId={this.qrId}
293
+ // value={value}
294
+ // useLogo={useLogo}
295
+ // size={this?.qrSize || undefined}
296
+ // logoSrc={this?.logoSrc}
297
+ // />
298
+ );
279
299
  }
280
300
  renderRetryQR(value, useLogo) {
281
- console.log("this.qrId", this.qrId);
301
+ // console.log("this.qrId", this.qrId);
282
302
  return (index.h(QR, { qrId: this.qrId, value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
283
303
  }
284
304
  render() {
@@ -301,263 +321,5 @@ const GatacaQR = class {
301
321
  };
302
322
  GatacaQR.style = gatacaQrCss;
303
323
 
304
- 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}";
305
-
306
- 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=";
307
- //Default values
308
- const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
309
- const DEFAULT_POLLING_FREQ = 3;
310
- const GatacaSSIButton = class {
311
- constructor(hostRef) {
312
- index.registerInstance(this, hostRef);
313
- this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
314
- this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
315
- this.qrId = undefined;
316
- this.buttonText = "Easy login";
317
- this.autostart = true;
318
- this.checkStatus = undefined;
319
- this.createSession = undefined;
320
- this.successCallback = undefined;
321
- this.errorCallback = undefined;
322
- this.handleCheckAppLoading = undefined;
323
- this.checkAppTimeout = 6;
324
- this.qrRole = undefined;
325
- this.callbackServer = undefined;
326
- this.sessionTimeout = undefined;
327
- this.pollingFrequency = undefined;
328
- this.autorefresh = false;
329
- this.v = "3";
330
- this.qrModalTitle = "Quick Access";
331
- this.modalTitleColor = "#4745B7";
332
- this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
333
- this.hideBrandTitle = false;
334
- this.dynamicLink = true;
335
- this.logoSize = 0;
336
- this.logoSrc = undefined;
337
- this.qrCodeExpiredLabel = "QR Code expired";
338
- this.credentialsNotValidatedLabel = "User credentials not validated";
339
- this.clickInsideBoxLabel = "Click inside the box to";
340
- this.refreshQrLabel = "Refresh QR Code";
341
- this.scanQrLabel = "Scan QR Code";
342
- this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time";
343
- this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
344
- this.failedLoginErrorLabel = "No successful login";
345
- this.successLoginLabel = "Successful Connection!";
346
- this.byBrandLabel = "by Gataca";
347
- this.waitingStartSessionLabel = "waiting to start a session";
348
- this.hideQrModalDescription = false;
349
- this.open = false;
350
- this.sessionId = undefined;
351
- this.authenticationRequest = undefined;
352
- this.sessionData = undefined;
353
- this.result = utils.RESULT_STATUS.NOT_STARTED;
354
- console.log("qrId2", this.qrId);
355
- this.qr = (index.h("gataca-qr", { ref: (el) => (this.qrElement = el), qrId: this.qrId, 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: this.autostart, autorefresh: this.autorefresh, v: this.v, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink, logoSize: this.logoSize, logoSrc: this.logoSrc, modalTitleColor: this.modalTitleColor, qrCodeExpiredLabel: this.qrCodeExpiredLabel, credentialsNotValidatedLabel: this.credentialsNotValidatedLabel, clickInsideBoxLabel: this.clickInsideBoxLabel, refreshQrLabel: this.refreshQrLabel, scanQrLabel: this.scanQrLabel, userNotScanInTimeErrorLabel: this.userNotScanInTimeErrorLabel, credsNotValidatedErrorLabel: this.credsNotValidatedErrorLabel, failedLoginErrorLabel: this.failedLoginErrorLabel, successLoginLabel: this.successLoginLabel, byBrandLabel: this.byBrandLabel, waitingStartSessionLabel: this.waitingStartSessionLabel, hideQrModalDescription: this.hideQrModalDescription }));
356
- this.qr.qrId = this.qrId;
357
- }
358
- /**
359
- * Retrieve manually the session data on a successful login
360
- */
361
- async getSessionData() {
362
- return this.qr.getSessionData();
363
- }
364
- async getSessionId() {
365
- if (this.sessionId) {
366
- return this.sessionId;
367
- }
368
- let { sessionId, authenticationRequest } = await this.createSession();
369
- this.sessionId = sessionId;
370
- this.authenticationRequest = authenticationRequest;
371
- return this.sessionId;
372
- }
373
- /**
374
- * Force manually the start polling
375
- */
376
- async startMobilePolling() {
377
- await this.getSessionId();
378
- this.result = utils.RESULT_STATUS.ONGOING;
379
- this.poll()
380
- .then((data) => {
381
- this.result = utils.RESULT_STATUS.SUCCESS;
382
- this.sessionData = data;
383
- this.gatacaLoginCompleted.emit(data);
384
- this.successCallback(data);
385
- })
386
- .catch((err) => {
387
- this.clean();
388
- let expired = err === utils.RESULT_STATUS.EXPIRED;
389
- if (expired && this.autorefresh) {
390
- this.startMobilePolling();
391
- }
392
- else {
393
- if (err !== utils.RESULT_STATUS.NOT_STARTED) {
394
- let error = expired
395
- ? new Error(this.userNotScanInTimeErrorLabel)
396
- : new Error(this.credsNotValidatedErrorLabel);
397
- this.result = err;
398
- this.gatacaLoginFailed.emit(error);
399
- this.errorCallback(error);
400
- }
401
- }
402
- });
403
- }
404
- /**
405
- * Stop manually an ongoing session
406
- */
407
- async stop() {
408
- this.clean();
409
- if (this.result === utils.RESULT_STATUS.ONGOING || utils.RESULT_STATUS.READ) {
410
- this.result = utils.RESULT_STATUS.NOT_STARTED;
411
- }
412
- }
413
- clean() {
414
- this.sessionData = undefined;
415
- this.sessionId = undefined;
416
- }
417
- renderModal() {
418
- return this.qr;
419
- }
420
- async poll() {
421
- let endTime = new Date().getTime() +
422
- (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
423
- let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
424
- let checkFunc = async (component) => {
425
- if (component.result === utils.RESULT_STATUS.NOT_STARTED) {
426
- return { result: utils.RESULT_STATUS.NOT_STARTED };
427
- }
428
- let id = await component.getSessionId();
429
- return component.checkStatus(id);
430
- };
431
- let component = this;
432
- let checkCondition = async function (resolve, reject) {
433
- // If the condition is met, we're done!
434
- let { result, data } = await checkFunc(component);
435
- switch (result) {
436
- case utils.RESULT_STATUS.SUCCESS:
437
- resolve(data);
438
- break;
439
- case utils.RESULT_STATUS.READ:
440
- component.result = utils.RESULT_STATUS.READ;
441
- case utils.RESULT_STATUS.ONGOING:
442
- if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
443
- setTimeout(checkCondition, interval, resolve, reject);
444
- }
445
- else {
446
- reject(utils.RESULT_STATUS.EXPIRED);
447
- }
448
- break;
449
- default:
450
- reject(result);
451
- break;
452
- }
453
- };
454
- return new Promise(checkCondition);
455
- }
456
- isAppInstalled(appScheme, callback) {
457
- let timeout;
458
- let detected = false;
459
- if (appScheme === null || appScheme === void 0 ? void 0 : appScheme.length) {
460
- window.location.href = appScheme;
461
- }
462
- const waitTimeToCheckApp = this.checkAppTimeout * 1000;
463
- timeout = setTimeout(() => {
464
- if (!detected) {
465
- callback(false);
466
- }
467
- cleanup();
468
- }, waitTimeToCheckApp);
469
- const handleVisibilityChange = () => {
470
- if (document.hidden) {
471
- detected = true;
472
- callback(true);
473
- if (!this.autostart) {
474
- this.startMobilePolling();
475
- }
476
- cleanup();
477
- }
478
- };
479
- document.addEventListener("visibilitychange", handleVisibilityChange);
480
- function cleanup() {
481
- clearTimeout(timeout);
482
- document.removeEventListener("visibilitychange", handleVisibilityChange);
483
- }
484
- }
485
- renderDesktopButton() {
486
- console.log("this.qrId333", this.qrId);
487
- return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
488
- this.open = !this.open;
489
- setTimeout(() => {
490
- var _a, _b;
491
- this.qrElement.id = this.qrId;
492
- if (this.open) {
493
- (_a = this.qrElement) === null || _a === void 0 ? void 0 : _a.display();
494
- }
495
- else {
496
- (_b = this.qrElement) === null || _b === void 0 ? void 0 : _b.stop();
497
- }
498
- }, 0);
499
- } }, index.h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
500
- }
501
- async getAuthRequest() {
502
- let { authenticationRequest } = await this.createSession();
503
- return authenticationRequest;
504
- }
505
- renderMobileButton(isAndroid, isIos) {
506
- if (this.autostart) {
507
- this.startMobilePolling();
508
- }
509
- let loading = false;
510
- const handleLoading = (isLoading) => {
511
- loading = isLoading;
512
- if (this.handleCheckAppLoading) {
513
- this.handleCheckAppLoading(isLoading);
514
- }
515
- };
516
- const executeRedirection = async () => {
517
- handleLoading(true);
518
- const androidStoreLink = "https://play.google.com/store/apps/details?id=com.gataca.identity";
519
- const iosStoreLink = "https://apps.apple.com/us/app/gataca/id1498607616";
520
- try {
521
- const appScheme = await this.getAuthRequest();
522
- this.isAppInstalled(appScheme, (installed) => {
523
- if (!installed) {
524
- this.stop();
525
- if (isAndroid) {
526
- window.location.href = androidStoreLink;
527
- }
528
- else if (isIos) {
529
- window.location.href = iosStoreLink;
530
- }
531
- }
532
- handleLoading(false);
533
- });
534
- }
535
- catch (error) {
536
- this.stop();
537
- handleLoading(false);
538
- }
539
- };
540
- return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
541
- executeRedirection();
542
- }, disabled: loading }, index.h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
543
- }
544
- render() {
545
- const userAgent =
546
- // @ts-ignore
547
- (navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) || (navigator === null || navigator === void 0 ? void 0 : navigator.vendor) || (window === null || window === void 0 ? void 0 : window.opera);
548
- const isAndroid = /android/i.test(userAgent);
549
- const isIos =
550
- // @ts-ignore
551
- (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) ||
552
- (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
553
- const isMobile = isAndroid || isIos;
554
- return (index.h("div", { class: "buttonContainer" }, isMobile && this.v === "3"
555
- ? this.renderMobileButton(isAndroid, isIos)
556
- : this.renderDesktopButton(), this.open && (!isMobile || this.v === "3") && this.renderModal()));
557
- }
558
- };
559
- GatacaSSIButton.style = gatacaSsibuttonCss;
560
-
561
324
  exports.gataca_qr = GatacaQR;
562
325
  exports.gataca_qrdisplay = GatacaQRDisplay;
563
- exports.gataca_ssibutton = GatacaSSIButton;
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-93d47a75.js');
6
- const gatIconAlert = require('./gat-icon-alert-6127161a.js');
5
+ const index = require('./index-8638645b.js');
6
+ const gatIconAlert = require('./gat-icon-alert-0ad19b26.js');
7
+ require('./qr-code-styling-412bbc7a.js');
7
8
  const utils = require('./utils-ef28b844.js');
8
9
 
9
10
  const Success = (props) => {