@gataca/qr 3.0.11 → 4.0.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.
Files changed (47) hide show
  1. package/dist/{esm/qr-code-styling-0eeb38d5.js → cjs/gat-icon-check-c88a30ed.js} +15 -1
  2. package/dist/cjs/{gataca-qr_2.cjs.entry.js → gataca-qr_3.cjs.entry.js} +398 -53
  3. package/dist/cjs/gataca-qrws.cjs.entry.js +6 -7
  4. package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +61 -0
  5. package/dist/cjs/gatacaqr.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/gataca-qr/components/qr/QR.js +2 -2
  8. package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +13 -4
  9. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +3 -2
  10. package/dist/collection/components/gataca-qr/gataca-qr.css +1 -1
  11. package/dist/collection/components/gataca-qr/gataca-qr.js +31 -10
  12. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +22 -0
  13. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +163 -3
  14. package/dist/components/{gat-icon-alert.js → gat-icon-check.js} +3 -3
  15. package/dist/components/gataca-qr2.js +58 -45
  16. package/dist/components/gataca-qrdisplay2.js +5 -0
  17. package/dist/components/gataca-qrws2.js +1 -1
  18. package/dist/components/gataca-ssibutton2.js +88 -4
  19. package/dist/components/index.js +1 -1
  20. package/dist/{cjs/qr-code-styling-412bbc7a.js → esm/gat-icon-check-c188cd29.js} +8 -2
  21. package/dist/esm/{gataca-qr_2.entry.js → gataca-qr_3.entry.js} +395 -51
  22. package/dist/esm/gataca-qrws.entry.js +1 -2
  23. package/dist/esm/gataca-ssibuttonws.entry.js +57 -0
  24. package/dist/esm/gatacaqr.js +1 -1
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  27. package/dist/gatacaqr/p-5be73956.js +1 -0
  28. package/dist/gatacaqr/p-831794a4.entry.js +1 -0
  29. package/dist/gatacaqr/p-948e7d94.entry.js +1 -0
  30. package/dist/gatacaqr/p-e94e9be8.entry.js +1 -0
  31. package/dist/types/components/gataca-qr/components/qr/QR.d.ts +3 -1
  32. package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +2 -0
  33. package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +2 -0
  34. package/dist/types/components/gataca-qr/gataca-qr.d.ts +12 -2
  35. package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +5 -0
  36. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +30 -1
  37. package/dist/types/components.d.ts +50 -0
  38. package/package.json +1 -1
  39. package/dist/cjs/gat-icon-alert-0ad19b26.js +0 -14
  40. package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +0 -313
  41. package/dist/esm/gat-icon-alert-7b06ef3a.js +0 -9
  42. package/dist/esm/gataca-ssibutton_2.entry.js +0 -308
  43. package/dist/gatacaqr/p-0be4566d.js +0 -1
  44. package/dist/gatacaqr/p-2adc0bcc.entry.js +0 -1
  45. package/dist/gatacaqr/p-2ddbc2fc.entry.js +0 -1
  46. package/dist/gatacaqr/p-d2dd7c85.entry.js +0 -1
  47. package/dist/gatacaqr/p-ea783014.js +0 -1
@@ -1,3 +1,7 @@
1
+ 'use strict';
2
+
3
+ const logoGatacaSvg = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDc2IDcxIiB3aWR0aD0iNzEiIGhlaWdodD0iNjYiPgoJPHRpdGxlPlZlY3RvciAoMyktc3ZnPC90aXRsZT4KCTxzdHlsZT4KCQkuczAgeyBmaWxsOiAjNDc0NWI3IH0gCgk8L3N0eWxlPgoJPHBhdGggaWQ9IkxheWVyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsYXNzPSJzMCIgZD0ibTcyLjIgMzguNGMyLjIgMy4zIDMuNSA3LjIgMy41IDExLjQgMCAxMS4yLTguOCAyMC4yLTE5LjkgMjAuN3EtMC40IDAtMC44IDBjLTMgMC01LjgtMC42LTguNC0xLjdxLTIuMS0xLTMuOC0yLjMtMS4xLTAuOC0yLjEtMS43LTEuMy0xLjItMi4zLTIuNi0wLjUgMC42LTEgMS4yYy0zLjggNC40LTkuNCA3LjEtMTUuNyA3LjEtNi43IDAtMTIuNi0zLjItMTYuNC04LjEtMi43LTMuNS00LjMtNy44LTQuMy0xMi42IDAtMTAuNiA4LTE5LjMgMTguMy0yMC41LTEuMS0yLjUtMS43LTUuMi0xLjctOC4xIDAtMTEuNSA5LjMtMjAuNyAyMC44LTIwLjcgMTAuMiAwIDE4LjcgNy40IDIwLjQgMTcuMnEwLjMgMS43IDAuMyAzLjVjMCAyLjktMC42IDUuNi0xLjcgOC4xIDYuMiAwLjcgMTEuNiA0LjIgMTQuOCA5LjF6bS00NC43LTIzLjVjLTMuNCA2LTEuNCAxMy41IDQuNSAxN3EwLjEgMCAwLjIgMC4xYzIuNCAxLjMgNS4xIDEuOCA3LjcgMS41IDEuNS0wLjIgMy4xLTAuNyA0LjUtMS40cTAuMi0wLjIgMC40LTAuM2MxLjgtMSAzLjMtMi41IDQuNC00LjRxMC43LTEuMyAxLjEtMi42YzEuNy01LjQtMC42LTExLjUtNS43LTE0LjQtNi0zLjQtMTMuNi0xLjQtMTcuMSA0LjV6bTM4LjUgNDAuOGMyLTMuOSAxLjktOC40LTAuMi0xMi0xLTEuOC0yLjYtMy41LTQuNi00LjYtMy45LTIuMy04LjUtMi4yLTEyLjMtMC4ycS0wLjIgMC4yLTAuNCAwLjMtMC45IDAuNS0xLjcgMS4ybDEzLjYgNy44djAuMWwtNi43IDUuNi0xMS02LjQtMC40LTAuMi03LTQtNC4yLTIuNS0yLjYtMS40cS0wLjItMC4yLTAuNC0wLjMtMC4xIDAtMC4yLTAuMWMtNS45LTMuNC0xMy41LTEuMy0xNyA0LjYtMi41IDQuNC0yLjEgOS43IDAuNyAxMy41IDEgMS40IDIuMyAyLjYgMy45IDMuNSA0LjggMi43IDEwLjYgMiAxNC41LTEuNGwtMTIuNC03LjEgNi44LTUuNiA5LjYgNS41IDAuNCAwLjIgNyA0LjEgNS42IDMuMiAxLjggMWMzLjMgMS45IDcuMyAyLjMgMTAuOSAwLjkgMi42LTEuMSA0LjgtMyA2LjMtNS43eiIvPgo8L3N2Zz4=';
4
+
1
5
  function getDefaultExportFromCjs (x) {
2
6
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3
7
  }
@@ -23,4 +27,14 @@ var qrCodeStyling = createCommonjsModule(function (module, exports) {
23
27
 
24
28
  const QRCodeStyling = /*@__PURE__*/getDefaultExportFromCjs(qrCodeStyling);
25
29
 
26
- export { QRCodeStyling as Q };
30
+ const gatIconRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIzIDRWMTBIMTciIHN0cm9rZT0iIzhCOEI4QiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTIwLjQ4OTkgMTVDMTkuODM5OSAxNi44Mzk5IDE4LjYwOTQgMTguNDE4NyAxNi45ODQgMTkuNDk4NUMxNS4zNTg2IDIwLjU3ODMgMTMuNDI2MyAyMS4xMDA2IDExLjQ3ODMgMjAuOTg2NkM5LjUzMDI2IDIwLjg3MjYgNy42NzIwMyAyMC4xMjg2IDYuMTgzNjMgMTguODY2N0M0LjY5NTI0IDE3LjYwNDcgMy42NTczIDE1Ljg5MzIgMy4yMjYyNSAxMy45OTAxQzIuNzk1MTkgMTIuMDg2OSAyLjk5NDM2IDEwLjA5NTIgMy43OTM3NCA4LjMxNTA4QzQuNTkzMTMgNi41MzQ5NiA1Ljk0OTQyIDUuMDYyODggNy42NTgyMyA0LjEyMDY1QzkuMzY3MDUgMy4xNzg0MyAxMS4zMzU4IDIuODE3MTEgMTMuMjY3OCAzLjA5MTE2QzE1LjE5OTkgMy4zNjUyIDE2Ljk5MDUgNC4yNTk3NSAxOC4zNjk5IDUuNjQwMDFMMjIuOTk5OSAxMCIgc3Ryb2tlPSIjOEI4QjhCIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K';
31
+
32
+ const gatIconAlertSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwLjI5MDggMy44NjAyTDEuODIwNzUgMTguMDAwMkMxLjY0NjEyIDE4LjMwMjYgMS41NTM3MiAxOC42NDU1IDEuNTUyNzQgMTguOTk0N0MxLjU1MTc2IDE5LjM0MzkgMS42NDIyNCAxOS42ODczIDEuODE1MTggMTkuOTkwN0MxLjk4ODEyIDIwLjI5NDEgMi4yMzc0OCAyMC41NDcgMi41Mzg0NiAyMC43MjQxQzIuODM5NDQgMjAuOTAxMiAzLjE4MTU1IDIwLjk5NjQgMy41MzA3NSAyMS4wMDAySDIwLjQ3MDhDMjAuODIgMjAuOTk2NCAyMS4xNjIxIDIwLjkwMTIgMjEuNDYzIDIwLjcyNDFDMjEuNzY0IDIwLjU0NyAyMi4wMTM0IDIwLjI5NDEgMjIuMTg2MyAxOS45OTA3QzIyLjM1OTMgMTkuNjg3MyAyMi40NDk3IDE5LjM0MzkgMjIuNDQ4OCAxOC45OTQ3QzIyLjQ0NzggMTguNjQ1NSAyMi4zNTU0IDE4LjMwMjYgMjIuMTgwOCAxOC4wMDAyTDEzLjcxMDggMy44NjAyQzEzLjUzMjUgMy41NjYzMSAxMy4yODE1IDMuMzIzMzIgMTIuOTgxOSAzLjE1NDY5QzEyLjY4MjQgMi45ODYwNSAxMi4zNDQ1IDIuODk3NDYgMTIuMDAwOCAyLjg5NzQ2QzExLjY1NyAyLjg5NzQ2IDExLjMxOTEgMi45ODYwNSAxMS4wMTk2IDMuMTU0NjlDMTAuNzIgMy4zMjMzMiAxMC40NjkgMy41NjYzMSAxMC4yOTA4IDMuODYwMlYzLjg2MDJaIiBzdHJva2U9IiNDRDJCMzEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0xMiA5VjEzIiBzdHJva2U9IiNDRDJCMzEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0xMiAxN0gxMi4wMSIgc3Ryb2tlPSIjQ0QyQjMxIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K';
33
+
34
+ const gatIconCheckSvg = 'data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjUyIiBoZWlnaHQ9IjUzIiB2aWV3Qm94PSIwIDAgNTIgNTMiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjI2IiBjeT0iMjYuNjcxOSIgcj0iMjYiIGZpbGw9IiMzRDlBNTAiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zOC41MiAxNy43NDk1QzM5LjU4MDUgMTguODA5OSAzOS41ODA1IDIwLjUyOTMgMzguNTIgMjEuNTg5OEwyMy41ODQ2IDM2LjUyNTFDMjIuNTI0MiAzNy41ODU2IDIwLjgwNDggMzcuNTg1NiAxOS43NDQzIDM2LjUyNTFMMTIuOTU1NSAyOS43MzYzQzExLjg5NSAyOC42NzU5IDExLjg5NSAyNi45NTY1IDEyLjk1NTUgMjUuODk2QzE0LjAxNiAyNC44MzU1IDE1LjczNTQgMjQuODM1NSAxNi43OTU4IDI1Ljg5NkwyMS42NjQ1IDMwLjc2NDdMMzQuNjc5NyAxNy43NDk1QzM1Ljc0MDIgMTYuNjg5IDM3LjQ1OTUgMTYuNjg5IDM4LjUyIDE3Ljc0OTVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K';
35
+
36
+ exports.QRCodeStyling = QRCodeStyling;
37
+ exports.gatIconAlertSvg = gatIconAlertSvg;
38
+ exports.gatIconCheckSvg = gatIconCheckSvg;
39
+ exports.gatIconRefreshSvg = gatIconRefreshSvg;
40
+ exports.logoGatacaSvg = logoGatacaSvg;
@@ -3,8 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-93d47a75.js');
6
- const gatIconAlert = require('./gat-icon-alert-0ad19b26.js');
7
- const qrCodeStyling = require('./qr-code-styling-412bbc7a.js');
6
+ const gatIconCheck = require('./gat-icon-check-c88a30ed.js');
8
7
  const utils = require('./utils-b4e62bc0.js');
9
8
 
10
9
  const GatacaQRDisplay = class {
@@ -16,14 +15,15 @@ const GatacaQRDisplay = class {
16
15
  this.logoSize = 0;
17
16
  this.logoSrc = undefined;
18
17
  this.qrColor = '#1E1E20';
18
+ this.bgColor = '#FFFFFF';
19
19
  this.rounded = true;
20
20
  }
21
21
  componentDidLoad() {
22
- const qrCode = new qrCodeStyling.QRCodeStyling({
22
+ const qrCode = new gatIconCheck.QRCodeStyling({
23
23
  data: this.qrData,
24
24
  width: this.size,
25
25
  height: this.size,
26
- image: this.logoSize > 0 ? this.logoSrc || gatIconAlert.logoGatacaSvg : undefined,
26
+ image: this.logoSize > 0 ? this.logoSrc || gatIconCheck.logoGatacaSvg : undefined,
27
27
  margin: 10,
28
28
  type: this.qrType,
29
29
  dotsOptions: {
@@ -39,6 +39,9 @@ const GatacaQRDisplay = class {
39
39
  imageOptions: {
40
40
  margin: 2,
41
41
  imageSize: this.logoSize
42
+ },
43
+ backgroundOptions: {
44
+ color: this.bgColor
42
45
  }
43
46
  });
44
47
  qrCode.append(this.qr);
@@ -50,34 +53,9 @@ const GatacaQRDisplay = class {
50
53
  }
51
54
  };
52
55
 
53
- const Success = (props) => {
54
- const { modalHeight, successLoginLabel } = props;
55
- return (index.h("div", { class: 'success', style: {
56
- height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) + 'px' : '300px'
57
- } },
58
- index.h("img", { src: gatIconAlert.gatIconCheckSvg, height: 52, width: 52 }),
59
- index.h("p", { class: "successMsg" }, successLoginLabel)));
60
- };
61
-
62
- const RetryButton = (props) => {
63
- var _a;
64
- const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR } = props;
65
- return (index.h("div", { class: "reload", style: {
66
- width: (modalWidth - 48).toString() + 'px',
67
- height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
68
- } },
69
- index.h("div", { id: "notify", onClick: () => display() },
70
- index.h("img", { src: gatIconAlert.gatIconRefreshSvg, height: 24, width: 24 }),
71
- index.h("p", { class: "notify-text" },
72
- clickInsideBoxLabel,
73
- " "),
74
- errorMessage ? index.h("p", { class: "notify-text bold" }, refreshQrLabel) : index.h("p", { class: "notify-text bold" }, scanQrLabel),
75
- errorMessage && (index.h("div", { class: "alert", style: {
76
- width: (modalWidth - 48).toString() + 'px'
77
- } },
78
- index.h("img", { src: gatIconAlert.gatIconAlertSvg, height: 24, width: 24 }),
79
- index.h("p", null, errorMessage)))),
80
- index.h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
56
+ const QR = (props) => {
57
+ const { value, useLogo, logoSrc, size, qrType, style } = props;
58
+ return index.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 });
81
59
  };
82
60
 
83
61
  const AnimatedLoader = () => {
@@ -95,33 +73,68 @@ const AnimatedLoader = () => {
95
73
 
96
74
  const ReadQR = (props) => {
97
75
  var _a;
98
- const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
76
+ const { modalWidth, readQrMessages, renderQR, url, sizeQR, style } = props;
99
77
  return (index.h("div", { class: "blured", style: {
100
78
  width: (modalWidth - 48).toString() + 'px',
101
- height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
79
+ height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : '',
80
+ backgroundColor: style === null || style === void 0 ? void 0 : style.bgColor,
81
+ color: style === null || style === void 0 ? void 0 : style.color,
82
+ border: (style === null || style === void 0 ? void 0 : style.color) ? `1px dashed ${style === null || style === void 0 ? void 0 : style.color}` : `1px dashed #a1a1a1`
102
83
  } },
103
- index.h("div", { id: "notify" },
84
+ index.h("div", { id: "notify", style: {
85
+ backgroundColor: (style === null || style === void 0 ? void 0 : style.bgColor) ? style === null || style === void 0 ? void 0 : style.bgColor : 'white'
86
+ } },
104
87
  index.h(AnimatedLoader, null),
105
- index.h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
88
+ index.h("p", { class: "notify-text", style: {
89
+ color: (style === null || style === void 0 ? void 0 : style.color) ? style === null || style === void 0 ? void 0 : style.color : '#707074'
90
+ } }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
106
91
  readQrMessages.title,
107
- " "),
108
- index.h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)),
92
+ ' '),
93
+ index.h("p", { class: "notify-text bold", style: {
94
+ color: (style === null || style === void 0 ? void 0 : style.color) ? style === null || style === void 0 ? void 0 : style.color : '#707074'
95
+ } }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)),
109
96
  index.h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
110
97
  };
111
98
 
112
- const QR = (props) => {
113
- const { value, useLogo, logoSrc, size, qrType } = props;
114
- return index.h("gataca-qrdisplay", { qrData: value, rounded: true, qrType: qrType, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
99
+ const RetryButton = (props) => {
100
+ var _a;
101
+ const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, style, display, renderRetryQR } = props;
102
+ return (index.h("div", { class: "reload", style: {
103
+ width: (modalWidth - 48).toString() + 'px',
104
+ height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : '',
105
+ border: (style === null || style === void 0 ? void 0 : style.color) ? `1px dashed ${style === null || style === void 0 ? void 0 : style.color}` : `1px dashed #a1a1a1`
106
+ } },
107
+ index.h("div", { id: "notify", onClick: () => display() },
108
+ index.h("img", { src: gatIconCheck.gatIconRefreshSvg, height: 24, width: 24 }),
109
+ index.h("p", { class: "notify-text" },
110
+ clickInsideBoxLabel,
111
+ " "),
112
+ errorMessage ? index.h("p", { class: "notify-text bold" }, refreshQrLabel) : index.h("p", { class: "notify-text bold" }, scanQrLabel),
113
+ errorMessage && (index.h("div", { class: "alert", style: {
114
+ width: (modalWidth - 48).toString() + 'px'
115
+ } },
116
+ index.h("img", { src: gatIconCheck.gatIconAlertSvg, height: 24, width: 24 }),
117
+ index.h("p", null, errorMessage)))),
118
+ index.h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
119
+ };
120
+
121
+ const Success = (props) => {
122
+ const { modalHeight, successLoginLabel } = props;
123
+ return (index.h("div", { class: 'success', style: {
124
+ height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) + 'px' : '300px'
125
+ } },
126
+ index.h("img", { src: gatIconCheck.gatIconCheckSvg, height: 52, width: 52 }),
127
+ index.h("p", { class: "successMsg" }, successLoginLabel)));
115
128
  };
116
129
 
117
- const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:12px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
130
+ 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>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)}}";
118
131
 
119
132
  const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
120
133
  //Default values
121
- const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
122
- const DEFAULT_POLLING_FREQ = 3;
134
+ const DEFAULT_SESSION_TIMEOUT$1 = 300; //5mins as in connect
135
+ const DEFAULT_POLLING_FREQ$1 = 3;
123
136
  const GatacaQR = class {
124
- 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.qrType = 'svg'; 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; }
137
+ 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.qrType = 'svg'; 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 = gatIconCheck.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.qrStyle = undefined; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = utils.RESULT_STATUS.NOT_STARTED; }
125
138
  disconnectedCallback() {
126
139
  this.stop();
127
140
  }
@@ -198,8 +211,8 @@ const GatacaQR = class {
198
211
  return DEEP_LINK_PREFIX + authRequestEncoded;
199
212
  }
200
213
  async poll() {
201
- let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
202
- let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
214
+ let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT$1) * 1000;
215
+ let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ$1) * 1000;
203
216
  let checkFunc = async (component) => {
204
217
  if (component.result === utils.RESULT_STATUS.NOT_STARTED) {
205
218
  return { result: utils.RESULT_STATUS.NOT_STARTED };
@@ -261,25 +274,357 @@ const GatacaQR = class {
261
274
  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.bind(this) });
262
275
  }
263
276
  renderQR(value, useLogo, sizeQR) {
264
- return index.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 });
277
+ return index.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 });
265
278
  }
266
279
  renderRetryQR(value, useLogo) {
267
- return index.h(QR, { value: value, useLogo: useLogo && this.logoSize !== 0, qrType: this.qrType, 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 });
280
+ return index.h(QR, { value: value, useLogo: useLogo && this.logoSize !== 0, qrType: this.qrType, 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, style: this === null || this === void 0 ? void 0 : this.qrStyle });
268
281
  }
269
282
  render() {
270
- var _a, _b;
283
+ var _a, _b, _c, _d, _e;
271
284
  return (index.h("div", { class: "popUpContainer" }, index.h("div", { class: `is-visible modal-window ${this.hideModalTexts ? '' : 'large-modal'} ${this.hideModalBoxShadow ? 'noBoxShadow' : ''}`, style: {
272
285
  width: (this.modalWidth - 2).toString() + 'px',
273
- height: this.modalHeight ? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
286
+ height: this.modalHeight ? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : '',
287
+ backgroundColor: ((_b = this === null || this === void 0 ? void 0 : this.qrStyle) === null || _b === void 0 ? void 0 : _b.bgColor) ? (_c = this === null || this === void 0 ? void 0 : this.qrStyle) === null || _c === void 0 ? void 0 : _c.bgColor : 'white',
288
+ boxShadow: ((_d = this === null || this === void 0 ? void 0 : this.qrStyle) === null || _d === void 0 ? void 0 : _d.boxShadow) ? '0px 3px 10px rgba(48, 48, 48, 0.1);' : 'none'
274
289
  }, onClick: (event) => {
275
290
  event.stopPropagation();
276
- } }, index.h("div", { class: "modal-window__content" }, index.h("div", { class: `qrTitleContainer ${this.hideModalTexts ? 'hidenText' : ''}` }, index.h("p", { class: "qrTitle modalText", style: { color: this.modalTitleColor || '#1e1e20' } }, this.qrModalTitle), !this.hideBrandTitle && (index.h("p", { class: "qrBrand modalText" }, this.byBrandLabel, ' ', index.h("span", null, index.h("img", { src: gatIconAlert.logoGatacaSvg })))), this.result !== utils.RESULT_STATUS.SUCCESS && !this.hideQrModalDescription && index.h("p", { class: "qrDescription modalText" }, this.qrModalDescription)), index.h("div", { class: "qrSection", style: {
291
+ } }, index.h("div", { class: "modal-window__content" }, index.h("div", { class: `qrTitleContainer ${this.hideModalTexts ? 'hidenText' : ''}` }, index.h("p", { class: "qrTitle modalText", style: { color: this.modalTitleColor || '#1e1e20' } }, this.qrModalTitle), !this.hideBrandTitle && (index.h("p", { class: "qrBrand modalText" }, this.byBrandLabel, ' ', index.h("span", null, index.h("img", { src: gatIconCheck.logoGatacaSvg })))), this.result !== utils.RESULT_STATUS.SUCCESS && !this.hideQrModalDescription && index.h("p", { class: "qrDescription modalText" }, this.qrModalDescription)), index.h("div", { class: "qrSection", style: {
277
292
  width: this.modalWidth.toString() + 'px',
278
- height: this.modalWidth ? ((_b = this.modalWidth) === null || _b === void 0 ? void 0 : _b.toString()) + 'px' : ''
293
+ height: this.modalWidth ? ((_e = this.modalWidth) === null || _e === void 0 ? void 0 : _e.toString()) + 'px' : ''
279
294
  } }, this.renderQRSection())))));
280
295
  }
281
296
  };
282
297
  GatacaQR.style = gatacaQrCss;
283
298
 
299
+ 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}";
300
+
301
+ 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=';
302
+ //Default values
303
+ const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
304
+ const DEFAULT_POLLING_FREQ = 3;
305
+ const GatacaSSIButton = class {
306
+ constructor(hostRef) {
307
+ index.registerInstance(this, hostRef);
308
+ this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
309
+ this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
310
+ this.gatacaButtonPushed = index.createEvent(this, "gatacaButtonPushed", 7);
311
+ this.getRequestFromUri = async (authRequest) => {
312
+ const requrl = new URL(authRequest);
313
+ const requri = requrl.searchParams.get('request_uri');
314
+ if (requri) {
315
+ const response = await fetch(requri, {
316
+ method: 'GET',
317
+ headers: {
318
+ 'Content-Type': 'application/json'
319
+ }
320
+ });
321
+ const jwt = await response.json();
322
+ const parts = jwt.split('.');
323
+ const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/');
324
+ const decoded = window.atob(base64);
325
+ let parsed = JSON.parse(decoded);
326
+ parsed.response_mode = 'dc_api';
327
+ return parsed;
328
+ }
329
+ };
330
+ this.buttonText = 'Easy login';
331
+ this.buttonDCAPIText = 'Login with Device Credentials';
332
+ this.qrType = 'svg';
333
+ this.autostart = true;
334
+ this.checkStatus = undefined;
335
+ this.createSession = undefined;
336
+ this.fillSession = undefined;
337
+ this.successCallback = undefined;
338
+ this.errorCallback = undefined;
339
+ this.handleCheckAppLoading = undefined;
340
+ this.checkAppTimeout = 6;
341
+ this.qrRole = undefined;
342
+ this.callbackServer = undefined;
343
+ this.sessionTimeout = undefined;
344
+ this.pollingFrequency = undefined;
345
+ this.autorefresh = false;
346
+ this.v = '3';
347
+ this.qrModalTitle = 'Quick Access';
348
+ this.modalTitleColor = '#4745B7';
349
+ this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
350
+ this.hideBrandTitle = false;
351
+ this.dynamicLink = true;
352
+ this.logoSize = 0;
353
+ this.logoSrc = undefined;
354
+ this.qrCodeExpiredLabel = 'QR Code expired';
355
+ this.credentialsNotValidatedLabel = 'User credentials not validated';
356
+ this.clickInsideBoxLabel = 'Click inside the box to';
357
+ this.refreshQrLabel = 'Refresh QR Code';
358
+ this.scanQrLabel = 'Scan QR Code';
359
+ this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
360
+ this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
361
+ this.failedLoginErrorLabel = 'No successful login';
362
+ this.successLoginLabel = 'Successful Connection!';
363
+ this.byBrandLabel = 'by Gataca';
364
+ this.waitingStartSessionLabel = 'waiting to start a session';
365
+ this.enableDcApi = false;
366
+ this.hideQrModalDescription = false;
367
+ this.qrStyle = undefined;
368
+ this.open = false;
369
+ this.sessionId = undefined;
370
+ this.authenticationRequest = undefined;
371
+ this.sessionData = undefined;
372
+ this.result = utils.RESULT_STATUS.NOT_STARTED;
373
+ this.qr = (index.h("gataca-qr", { ref: (el) => (this.qrElement = el), checkStatus: this.checkStatus, createSession: this.createSession, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, qrType: this.qrType, 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, qrStyle: this.qrStyle }));
374
+ }
375
+ supportsDCAPI() {
376
+ // let mobile = checkMobile();
377
+ // if (!mobile) return false;
378
+ if (!this.enableDcApi) {
379
+ return false;
380
+ }
381
+ //@ts-ignore
382
+ if (typeof window.DigitalCredential === 'undefined')
383
+ return false;
384
+ const protocols = ['org-iso-mdoc', 'openid4vp', 'openid4vci'];
385
+ //@ts-ignore
386
+ const supportedProtocols = protocols.filter(window.DigitalCredential.userAgentAllowsProtocol);
387
+ console.log(supportedProtocols, protocols);
388
+ return true;
389
+ }
390
+ /**
391
+ * Retrieve manually the session data on a successful login
392
+ */
393
+ async getSessionData() {
394
+ return this.qr.getSessionData();
395
+ }
396
+ async getSessionId() {
397
+ if (this.sessionId) {
398
+ return this.sessionId;
399
+ }
400
+ let { sessionId, authenticationRequest } = await this.createSession();
401
+ this.sessionId = sessionId;
402
+ this.authenticationRequest = authenticationRequest;
403
+ return this.sessionId;
404
+ }
405
+ /**
406
+ * Force manually the start polling
407
+ */
408
+ async startMobilePolling() {
409
+ await this.getSessionId();
410
+ this.result = utils.RESULT_STATUS.ONGOING;
411
+ this.poll()
412
+ .then((data) => {
413
+ this.result = utils.RESULT_STATUS.SUCCESS;
414
+ this.sessionData = data;
415
+ this.gatacaLoginCompleted.emit(data);
416
+ this.successCallback(data);
417
+ })
418
+ .catch((err) => {
419
+ this.clean();
420
+ let expired = err === utils.RESULT_STATUS.EXPIRED;
421
+ if (expired && this.autorefresh) {
422
+ this.startMobilePolling();
423
+ }
424
+ else {
425
+ if (err !== utils.RESULT_STATUS.NOT_STARTED) {
426
+ let error = expired ? new Error(this.userNotScanInTimeErrorLabel) : new Error(this.credsNotValidatedErrorLabel);
427
+ this.result = err;
428
+ this.gatacaLoginFailed.emit(error);
429
+ this.errorCallback(error);
430
+ }
431
+ }
432
+ });
433
+ }
434
+ /**
435
+ * Stop manually an ongoing session
436
+ */
437
+ async stop() {
438
+ this.clean();
439
+ if (this.result === utils.RESULT_STATUS.ONGOING || utils.RESULT_STATUS.READ) {
440
+ this.result = utils.RESULT_STATUS.NOT_STARTED;
441
+ }
442
+ }
443
+ clean() {
444
+ this.sessionData = undefined;
445
+ this.sessionId = undefined;
446
+ }
447
+ renderModal() {
448
+ return this.qr;
449
+ }
450
+ async poll() {
451
+ let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
452
+ let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
453
+ let checkFunc = async (component) => {
454
+ if (component.result === utils.RESULT_STATUS.NOT_STARTED) {
455
+ return { result: utils.RESULT_STATUS.NOT_STARTED };
456
+ }
457
+ let id = await component.getSessionId();
458
+ return component.checkStatus(id);
459
+ };
460
+ let component = this;
461
+ let checkCondition = async function (resolve, reject) {
462
+ // If the condition is met, we're done!
463
+ let { result, data } = await checkFunc(component);
464
+ switch (result) {
465
+ case utils.RESULT_STATUS.SUCCESS:
466
+ resolve(data);
467
+ break;
468
+ case utils.RESULT_STATUS.READ:
469
+ component.result = utils.RESULT_STATUS.READ;
470
+ case utils.RESULT_STATUS.ONGOING:
471
+ if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
472
+ setTimeout(checkCondition, interval, resolve, reject);
473
+ }
474
+ else {
475
+ reject(utils.RESULT_STATUS.EXPIRED);
476
+ }
477
+ break;
478
+ default:
479
+ reject(result);
480
+ break;
481
+ }
482
+ };
483
+ return new Promise(checkCondition);
484
+ }
485
+ isAppInstalled(appScheme, callback) {
486
+ let timeout;
487
+ let detected = false;
488
+ if (appScheme === null || appScheme === void 0 ? void 0 : appScheme.length) {
489
+ window.location.href = appScheme;
490
+ }
491
+ const waitTimeToCheckApp = this.checkAppTimeout * 1000;
492
+ timeout = setTimeout(() => {
493
+ if (!detected) {
494
+ callback(false);
495
+ }
496
+ cleanup();
497
+ }, waitTimeToCheckApp);
498
+ const handleVisibilityChange = () => {
499
+ if (document.hidden) {
500
+ detected = true;
501
+ callback(true);
502
+ if (!this.autostart) {
503
+ this.startMobilePolling();
504
+ }
505
+ cleanup();
506
+ }
507
+ };
508
+ document.addEventListener('visibilitychange', handleVisibilityChange);
509
+ function cleanup() {
510
+ clearTimeout(timeout);
511
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
512
+ }
513
+ }
514
+ renderDesktopButton() {
515
+ return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
516
+ this.open = !this.open;
517
+ setTimeout(() => {
518
+ var _a, _b;
519
+ if (this.open) {
520
+ (_a = this.qrElement) === null || _a === void 0 ? void 0 : _a.display();
521
+ }
522
+ else {
523
+ (_b = this.qrElement) === null || _b === void 0 ? void 0 : _b.stop();
524
+ }
525
+ }, 0);
526
+ } }, index.h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
527
+ }
528
+ async getAuthRequest() {
529
+ let { authenticationRequest } = await this.createSession();
530
+ return authenticationRequest;
531
+ }
532
+ renderMobileButton(isAndroid, isIos) {
533
+ if (this.autostart && !this.supportsDCAPI()) {
534
+ this.startMobilePolling();
535
+ }
536
+ let loading = false;
537
+ const handleLoading = (isLoading) => {
538
+ loading = isLoading;
539
+ if (this.handleCheckAppLoading) {
540
+ this.handleCheckAppLoading(isLoading);
541
+ }
542
+ };
543
+ const executeRedirection = async () => {
544
+ handleLoading(true);
545
+ const androidStoreLink = 'https://play.google.com/store/apps/details?id=com.gataca.identity';
546
+ const iosStoreLink = 'https://apps.apple.com/us/app/gataca/id1498607616';
547
+ try {
548
+ const appScheme = await this.getAuthRequest();
549
+ this.isAppInstalled(appScheme, (installed) => {
550
+ if (!installed) {
551
+ this.stop();
552
+ if (isAndroid) {
553
+ window.location.href = androidStoreLink;
554
+ }
555
+ else if (isIos) {
556
+ window.location.href = iosStoreLink;
557
+ }
558
+ }
559
+ handleLoading(false);
560
+ });
561
+ }
562
+ catch (error) {
563
+ this.stop();
564
+ handleLoading(false);
565
+ }
566
+ };
567
+ return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
568
+ this.gatacaButtonPushed.emit();
569
+ executeRedirection();
570
+ }, disabled: loading }, index.h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
571
+ }
572
+ renderDCAPIButton(isAndroid, isIos) {
573
+ let loading = false;
574
+ console.log('Maybe act different', isAndroid, isIos);
575
+ const handleLoading = (isLoading) => {
576
+ loading = isLoading;
577
+ if (this.handleCheckAppLoading) {
578
+ this.handleCheckAppLoading(isLoading);
579
+ }
580
+ };
581
+ const executeDCAPICall = async () => {
582
+ handleLoading(true);
583
+ try {
584
+ const authRequest = await this.getAuthRequest();
585
+ let request = await this.getRequestFromUri(authRequest);
586
+ let credentialResponse = await navigator.credentials.get({
587
+ //@ts-ignore
588
+ digital: {
589
+ requests: [
590
+ {
591
+ protocol: 'openid4vp-v1-unsigned',
592
+ data: request
593
+ }
594
+ ]
595
+ }
596
+ });
597
+ if (credentialResponse.constructor.name == 'DigitalCredential') {
598
+ console.log('Digital Credential - Response Data: ' + credentialResponse);
599
+ }
600
+ //@ts-ignore
601
+ await this.fillSession(request, credentialResponse === null || credentialResponse === void 0 ? void 0 : credentialResponse.data);
602
+ }
603
+ catch (error) {
604
+ this.stop();
605
+ handleLoading(false);
606
+ }
607
+ };
608
+ return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
609
+ this.gatacaButtonPushed.emit();
610
+ executeDCAPICall();
611
+ }, disabled: loading }, index.h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonDCAPIText }), index.h("span", null, this.buttonDCAPIText))));
612
+ }
613
+ render() {
614
+ const userAgent =
615
+ // @ts-ignore
616
+ (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);
617
+ const isAndroid = /android/i.test(userAgent);
618
+ const isIos =
619
+ // @ts-ignore
620
+ (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
621
+ const isMobile = isAndroid || isIos;
622
+ const displayDCApi = this.supportsDCAPI();
623
+ return (index.h("div", null, index.h("div", { class: "buttonContainer" }, isMobile && this.v === '3' ? this.renderMobileButton(isAndroid, isIos) : this.renderDesktopButton(), this.open && (!isMobile || this.v === '3') && this.renderModal()), displayDCApi /** && isMobile */ && index.h("div", { class: "buttonContainer" }, this.renderDCAPIButton(isAndroid, isIos))));
624
+ }
625
+ };
626
+ GatacaSSIButton.style = gatacaSsibuttonCss;
627
+
284
628
  exports.gataca_qr = GatacaQR;
285
629
  exports.gataca_qrdisplay = GatacaQRDisplay;
630
+ exports.gataca_ssibutton = GatacaSSIButton;