@gataca/qr 4.0.3 → 4.1.0

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 (53) hide show
  1. package/dist/cjs/gataca-autoqr.cjs.entry.js +1 -1
  2. package/dist/cjs/gataca-qr_3.cjs.entry.js +128 -24
  3. package/dist/cjs/gataca-qrws.cjs.entry.js +141 -21
  4. package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +1 -1
  5. package/dist/cjs/gatacaqr.cjs.js +2 -2
  6. package/dist/cjs/{index-1332a8ce.js → index-d8d3dfde.js} +32 -0
  7. package/dist/cjs/index.cjs.js +2 -1
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/{utils-c6edb275.js → utils-17b0a5ba.js} +44 -0
  10. package/dist/collection/components/gataca-qr/components/qr/QR.js +9 -1
  11. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +5 -2
  12. package/dist/collection/components/gataca-qr/gataca-qr.css +6 -0
  13. package/dist/collection/components/gataca-qr/gataca-qr.js +86 -16
  14. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +28 -4
  15. package/dist/collection/components/gataca-qrws/components/qr/QR.js +9 -1
  16. package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +5 -2
  17. package/dist/collection/components/gataca-qrws/gataca-qrws.css +7 -0
  18. package/dist/collection/components/gataca-qrws/gataca-qrws.js +125 -17
  19. package/dist/collection/utils/utils.js +43 -0
  20. package/dist/components/gat-icon-check.js +44 -1
  21. package/dist/components/gataca-qr2.js +105 -19
  22. package/dist/components/gataca-qrdisplay2.js +25 -4
  23. package/dist/components/gataca-qrws2.js +144 -20
  24. package/dist/components/index.js +1 -1
  25. package/dist/esm/gataca-autoqr.entry.js +1 -1
  26. package/dist/esm/gataca-qr_3.entry.js +129 -25
  27. package/dist/esm/gataca-qrws.entry.js +141 -21
  28. package/dist/esm/gataca-ssibuttonws.entry.js +1 -1
  29. package/dist/esm/gatacaqr.js +2 -2
  30. package/dist/esm/{index-055790a7.js → index-dca2ab22.js} +32 -0
  31. package/dist/esm/index.js +1 -1
  32. package/dist/esm/loader.js +2 -2
  33. package/dist/esm/{utils-22df0ce4.js → utils-e4a08623.js} +44 -1
  34. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  35. package/dist/gatacaqr/index.esm.js +1 -1
  36. package/dist/gatacaqr/{p-0501e224.js → p-143c0080.js} +1 -1
  37. package/dist/gatacaqr/p-2dc7190a.entry.js +1 -0
  38. package/dist/gatacaqr/{p-49cf321c.entry.js → p-2e8accf9.entry.js} +1 -1
  39. package/dist/gatacaqr/p-85af64b1.js +2 -0
  40. package/dist/gatacaqr/{p-c65f810b.entry.js → p-d27dabe4.entry.js} +1 -1
  41. package/dist/gatacaqr/p-e172581d.entry.js +1 -0
  42. package/dist/types/components/gataca-qr/components/qr/QR.d.ts +1 -0
  43. package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +0 -2
  44. package/dist/types/components/gataca-qr/gataca-qr.d.ts +5 -2
  45. package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +4 -0
  46. package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +1 -0
  47. package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +0 -2
  48. package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +8 -2
  49. package/dist/types/utils/utils.d.ts +5 -0
  50. package/package.json +1 -1
  51. package/dist/gatacaqr/p-2083dd06.entry.js +0 -1
  52. package/dist/gatacaqr/p-f5a4f65c.entry.js +0 -1
  53. package/dist/gatacaqr/p-fccf9d4d.js +0 -2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1332a8ce.js');
5
+ const index = require('./index-d8d3dfde.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,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1332a8ce.js');
5
+ const index = require('./index-d8d3dfde.js');
6
6
  const gatIconCheck = require('./gat-icon-check-6b6780eb.js');
7
- const utils = require('./utils-c6edb275.js');
7
+ const utils = require('./utils-17b0a5ba.js');
8
8
 
9
9
  const GatacaQRDisplay = class {
10
10
  constructor(hostRef) {
@@ -18,8 +18,8 @@ const GatacaQRDisplay = class {
18
18
  this.bgColor = '#FFFFFF';
19
19
  this.rounded = true;
20
20
  }
21
- componentDidLoad() {
22
- const qrCode = new gatIconCheck.QRCodeStyling({
21
+ getQrOptions() {
22
+ return {
23
23
  data: this.qrData,
24
24
  width: this.size,
25
25
  height: this.size,
@@ -43,18 +43,47 @@ const GatacaQRDisplay = class {
43
43
  backgroundOptions: {
44
44
  color: this.bgColor
45
45
  }
46
- });
47
- qrCode.append(this.qr);
46
+ };
47
+ }
48
+ componentDidLoad() {
49
+ this.mountOrUpdateQr();
50
+ }
51
+ onQrDataChange() {
52
+ this.mountOrUpdateQr();
53
+ }
54
+ mountOrUpdateQr() {
55
+ var _a;
56
+ if (!((_a = this.qrData) === null || _a === void 0 ? void 0 : _a.trim()) || !this.qr) {
57
+ return;
58
+ }
59
+ if (!this.qrCode) {
60
+ this.qrCode = new gatIconCheck.QRCodeStyling(this.getQrOptions());
61
+ this.qrCode.append(this.qr);
62
+ }
63
+ else {
64
+ this.qrCode.update({ data: this.qrData });
65
+ }
48
66
  }
49
67
  render() {
50
68
  return (index.h("div", { ref: (el) => {
51
69
  this.qr = el;
52
70
  } }));
53
71
  }
72
+ static get watchers() { return {
73
+ "qrData": ["onQrDataChange"]
74
+ }; }
54
75
  };
55
76
 
56
77
  const QR = (props) => {
57
- const { value, useLogo, logoSrc, size, qrType, style } = props;
78
+ const { value, useLogo, logoSrc, size, qrType, style, linkReady = true } = props;
79
+ const s = size !== null && size !== void 0 ? size : 256;
80
+ if (!linkReady) {
81
+ return (index.h("div", { class: "qr-loading-slot", style: {
82
+ width: s + 'px',
83
+ height: s + 'px',
84
+ margin: '0 auto'
85
+ } }));
86
+ }
58
87
  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 });
59
88
  };
60
89
 
@@ -104,7 +133,7 @@ const RefreshIcon = (props) => {
104
133
 
105
134
  const RetryButton = (props) => {
106
135
  var _a;
107
- const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, style, display, renderRetryQR } = props;
136
+ const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, style, display } = props;
108
137
  const bgStyle = { backgroundColor: (style === null || style === void 0 ? void 0 : style.bgColor) ? style === null || style === void 0 ? void 0 : style.bgColor : 'white' };
109
138
  const alertBgStyle = { backgroundColor: (style === null || style === void 0 ? void 0 : style.alertBgColor) ? style === null || style === void 0 ? void 0 : style.alertBgColor : '#ffdedf' };
110
139
  const alertBorderColor = { borderColor: (style === null || style === void 0 ? void 0 : style.alertBorderColor) ? style === null || style === void 0 ? void 0 : style.alertBorderColor : '#ee888c' };
@@ -123,7 +152,10 @@ const RetryButton = (props) => {
123
152
  errorMessage && (index.h("div", { class: "alert", style: Object.assign(Object.assign({ width: (modalWidth - 48).toString() + 'px' }, alertBgStyle), { border: `1px solid ${alertBorderColor}` }) },
124
153
  index.h("img", { src: gatIconCheck.gatIconAlertSvg, height: 24, width: 24 }),
125
154
  index.h("p", { style: { color: (style === null || style === void 0 ? void 0 : style.color) ? style === null || style === void 0 ? void 0 : style.color : '#1e1e20' } }, errorMessage)))),
126
- index.h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
155
+ index.h("div", { id: "qrwait", class: "qr-placeholder-slot", style: {
156
+ width: (modalWidth - 48).toString() + 'px',
157
+ height: modalWidth ? (modalWidth - 48).toString() + 'px' : ''
158
+ } })));
127
159
  };
128
160
 
129
161
  const Success = (props) => {
@@ -136,14 +168,63 @@ const Success = (props) => {
136
168
  index.h("p", { class: "successMsg", style: colorStyle }, successLoginLabel)));
137
169
  };
138
170
 
139
- const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:20px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>svg{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background-color:var(--loader-color, #4745B7);border-radius:2px;--to-opacity:1;opacity:var(--to-opacity)}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);--to-opacity:calc(1 - (0 / 8));animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);--to-opacity:calc(1 - (1 / 8));animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);--to-opacity:calc(1 - (2 / 8));animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);--to-opacity:calc(1 - (3 / 8));animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);--to-opacity:calc(1 - (4 / 8));animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);--to-opacity:calc(1 - (5 / 8));animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);--to-opacity:calc(1 - (6 / 8));animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);--to-opacity:calc(1 - (7 / 8));animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{opacity:1}100%{opacity:var(--to-opacity)}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
171
+ const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:20px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}.qr-placeholder-slot{box-sizing:border-box;border-radius:12px;background:rgba(0, 0, 0, 0.04)}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>svg{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background-color:var(--loader-color, #4745B7);border-radius:2px;--to-opacity:1;opacity:var(--to-opacity)}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);--to-opacity:calc(1 - (0 / 8));animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);--to-opacity:calc(1 - (1 / 8));animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);--to-opacity:calc(1 - (2 / 8));animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);--to-opacity:calc(1 - (3 / 8));animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);--to-opacity:calc(1 - (4 / 8));animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);--to-opacity:calc(1 - (5 / 8));animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);--to-opacity:calc(1 - (6 / 8));animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);--to-opacity:calc(1 - (7 / 8));animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{opacity:1}100%{opacity:var(--to-opacity)}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
140
172
 
141
173
  const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
142
174
  //Default values
143
175
  const DEFAULT_SESSION_TIMEOUT$1 = 300; //5mins as in connect
144
176
  const DEFAULT_POLLING_FREQ$1 = 3;
145
177
  const GatacaQR = class {
146
- 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; }
178
+ constructor(hostRef) {
179
+ index.registerInstance(this, hostRef);
180
+ this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
181
+ this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
182
+ this.lastShortenRaw = null;
183
+ this.checkStatus = undefined;
184
+ this.createSession = undefined;
185
+ this.successCallback = undefined;
186
+ this.errorCallback = undefined;
187
+ this.qrRole = undefined;
188
+ this.qrType = 'svg';
189
+ this.callbackServer = undefined;
190
+ this.autostart = true;
191
+ this.autorefresh = false;
192
+ this.v = '3';
193
+ this.qrModalTitle = 'Quick Access';
194
+ this.modalTitleColor = '#4745B7';
195
+ this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
196
+ this.hideModalTexts = false;
197
+ this.hideModalBoxShadow = false;
198
+ this.hideBrandTitle = false;
199
+ this.logoSize = 0;
200
+ this.logoSrc = gatIconCheck.logoGatacaSvg;
201
+ this.qrSize = 300;
202
+ this.modalWidth = 300;
203
+ this.modalHeight = undefined;
204
+ this.qrCodeExpiredLabel = 'QR Code expired';
205
+ this.credentialsNotValidatedLabel = 'User credentials not validated';
206
+ this.clickInsideBoxLabel = 'Click inside the box to';
207
+ this.refreshQrLabel = 'Refresh QR Code';
208
+ this.scanQrLabel = 'Scan QR Code';
209
+ this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
210
+ this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
211
+ this.failedLoginErrorLabel = 'No successful login';
212
+ this.successLoginLabel = 'Successful Connection!';
213
+ this.byBrandLabel = 'by Gataca';
214
+ this.waitingStartSessionLabel = 'waiting to start a session';
215
+ this.readQrTitle = 'Processing...';
216
+ this.readQrDescription = 'Please wait a moment';
217
+ this.hideQrModalDescription = false;
218
+ this.sessionTimeout = DEFAULT_SESSION_TIMEOUT$1;
219
+ this.pollingFrequency = DEFAULT_POLLING_FREQ$1;
220
+ this.dynamicLink = true;
221
+ this.qrStyle = undefined;
222
+ this.sessionId = undefined;
223
+ this.authenticationRequest = undefined;
224
+ this.sessionData = undefined;
225
+ this.result = utils.RESULT_STATUS.NOT_STARTED;
226
+ this.qrHref = '';
227
+ }
147
228
  disconnectedCallback() {
148
229
  this.stop();
149
230
  }
@@ -157,6 +238,7 @@ const GatacaQR = class {
157
238
  */
158
239
  async display() {
159
240
  await this.getSessionId();
241
+ await this.refreshQrHref();
160
242
  this.result = utils.RESULT_STATUS.ONGOING;
161
243
  this.poll()
162
244
  .then((data) => {
@@ -184,6 +266,30 @@ const GatacaQR = class {
184
266
  window.location.href = this.getLink();
185
267
  }
186
268
  }
269
+ buildRawLink() {
270
+ var _a;
271
+ if (this.v === '2') {
272
+ return (_a = this.authenticationRequest) !== null && _a !== void 0 ? _a : '';
273
+ }
274
+ const authRequestEncoded = '?dl=' + utils.base64UrlEncode(this.authenticationRequest);
275
+ return DEEP_LINK_PREFIX + authRequestEncoded;
276
+ }
277
+ async refreshQrHref() {
278
+ var _a;
279
+ const raw = this.buildRawLink();
280
+ if (raw === this.lastShortenRaw) {
281
+ return;
282
+ }
283
+ this.lastShortenRaw = raw;
284
+ const shortened = await utils.shortenUrlIfPossible(raw !== null && raw !== void 0 ? raw : '');
285
+ const now = this.buildRawLink();
286
+ if (now === raw) {
287
+ this.qrHref = shortened;
288
+ }
289
+ else if (!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim())) {
290
+ this.qrHref = now;
291
+ }
292
+ }
187
293
  /**
188
294
  * Stop manually an ongoing session
189
295
  */
@@ -196,6 +302,8 @@ const GatacaQR = class {
196
302
  clean() {
197
303
  this.sessionData = undefined;
198
304
  this.sessionId = undefined;
305
+ this.qrHref = '';
306
+ this.lastShortenRaw = null;
199
307
  }
200
308
  /**
201
309
  * Retrieve manually the session data on a successful login
@@ -213,11 +321,7 @@ const GatacaQR = class {
213
321
  return this.sessionId;
214
322
  }
215
323
  getLink() {
216
- if (this.v === '2') {
217
- return this.authenticationRequest;
218
- }
219
- const authRequestEncoded = '?dl=' + utils.base64UrlEncode(this.authenticationRequest);
220
- return DEEP_LINK_PREFIX + authRequestEncoded;
324
+ return this.qrHref || this.buildRawLink();
221
325
  }
222
326
  async poll() {
223
327
  let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT$1) * 1000;
@@ -255,11 +359,12 @@ const GatacaQR = class {
255
359
  return new Promise(checkCondition);
256
360
  }
257
361
  renderQRSection() {
362
+ var _a;
258
363
  switch (this.result) {
259
364
  case utils.RESULT_STATUS.NOT_STARTED:
260
365
  return this.renderRetryButton();
261
366
  case utils.RESULT_STATUS.ONGOING:
262
- return this.renderQR(this.getLink(), true);
367
+ return this.renderQR(this.getLink(), true, undefined, !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim()));
263
368
  case utils.RESULT_STATUS.EXPIRED:
264
369
  return this.renderRetryButton(this.qrCodeExpiredLabel);
265
370
  case utils.RESULT_STATUS.FAILED:
@@ -277,16 +382,15 @@ const GatacaQR = class {
277
382
  return index.h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel, style: this === null || this === void 0 ? void 0 : this.qrStyle });
278
383
  }
279
384
  renderRetryButton(errorMessage) {
280
- return (index.h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this), style: this === null || this === void 0 ? void 0 : this.qrStyle }));
385
+ return (index.h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, display: this.display.bind(this), style: this === null || this === void 0 ? void 0 : this.qrStyle }));
281
386
  }
282
387
  renderReadQR(readQrMessages) {
283
- 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), style: this.qrStyle }));
284
- }
285
- renderQR(value, useLogo, sizeQR) {
286
- 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 });
388
+ var _a;
389
+ const linkReady = !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim());
390
+ 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: (url, useLogo, size) => this.renderQR(url, useLogo, size, linkReady), style: this.qrStyle }));
287
391
  }
288
- renderRetryQR(value, useLogo) {
289
- 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 });
392
+ renderQR(value, useLogo, sizeQR, linkReady = true) {
393
+ 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, linkReady: linkReady }));
290
394
  }
291
395
  render() {
292
396
  var _a, _b, _c, _d, _e, _f;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1332a8ce.js');
5
+ const index = require('./index-d8d3dfde.js');
6
6
  const gatIconCheck = require('./gat-icon-check-6b6780eb.js');
7
- const utils = require('./utils-c6edb275.js');
7
+ const utils = require('./utils-17b0a5ba.js');
8
8
 
9
9
  const Success = (props) => {
10
10
  const { modalHeight, successLoginLabel } = props;
@@ -19,7 +19,7 @@ const gatIconRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWd
19
19
 
20
20
  const RetryButton = (props) => {
21
21
  var _a;
22
- const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR } = props;
22
+ const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, display } = props;
23
23
  return (index.h("div", { class: "reload", style: {
24
24
  width: (modalWidth - 48).toString() + 'px',
25
25
  height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
@@ -35,11 +35,22 @@ const RetryButton = (props) => {
35
35
  } },
36
36
  index.h("img", { src: gatIconCheck.gatIconAlertSvg, height: 24, width: 24 }),
37
37
  index.h("p", null, errorMessage)))),
38
- index.h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
38
+ index.h("div", { id: "qrwait", class: "qr-placeholder-slot", style: {
39
+ width: (modalWidth - 48).toString() + 'px',
40
+ height: modalWidth ? (modalWidth - 48).toString() + 'px' : ''
41
+ } })));
39
42
  };
40
43
 
41
44
  const QR = (props) => {
42
- const { value, useLogo, logoSrc, size, qrType } = props;
45
+ const { value, useLogo, logoSrc, size, qrType, linkReady = true } = props;
46
+ const s = size !== null && size !== void 0 ? size : 256;
47
+ if (!linkReady) {
48
+ return (index.h("div", { class: "qr-loading-slot", style: {
49
+ width: s + 'px',
50
+ height: s + 'px',
51
+ margin: '0 auto'
52
+ } }));
53
+ }
43
54
  return index.h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, qrType: qrType, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
44
55
  };
45
56
 
@@ -72,13 +83,63 @@ const ReadQR = (props) => {
72
83
  index.h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
73
84
  };
74
85
 
75
- const gatacaQrwsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:12px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
86
+ const gatacaQrwsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:12px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}.qr-placeholder-slot,.qr-loading-slot{box-sizing:border-box;border-radius:12px;background:rgba(0, 0, 0, 0.04)}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
76
87
 
77
88
  const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
78
89
  const DEFAULT_SESSION_TIMEOUT = 300;
79
90
  const QR_ROLE_CONNECT = 'connect';
80
91
  const GatacaQRWS = class {
81
- 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.qrType = 'svg'; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = 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.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = utils.RESULT_STATUS.NOT_STARTED; }
92
+ constructor(hostRef) {
93
+ index.registerInstance(this, hostRef);
94
+ this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
95
+ this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
96
+ this.qrRefreshGeneration = 0;
97
+ this.lastShortenRaw = null;
98
+ this.successCallback = undefined;
99
+ this.errorCallback = undefined;
100
+ this.qrRole = undefined;
101
+ this.qrType = 'svg';
102
+ this.callbackServer = undefined;
103
+ this.socketEndpoint = undefined;
104
+ this.sessionTimeout = DEFAULT_SESSION_TIMEOUT;
105
+ this.wsOnOpen = undefined;
106
+ this.wsOnMessage = undefined;
107
+ this.autostart = true;
108
+ this.autorefresh = false;
109
+ this.v = '3';
110
+ this.qrModalTitle = 'Quick Access';
111
+ this.modalTitleColor = '#4745B7';
112
+ this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
113
+ this.hideModalTexts = false;
114
+ this.hideModalBoxShadow = false;
115
+ this.hideBrandTitle = false;
116
+ this.logoSize = 0;
117
+ this.logoSrc = gatIconCheck.logoGatacaSvg;
118
+ this.qrSize = 300;
119
+ this.modalWidth = 300;
120
+ this.modalHeight = undefined;
121
+ this.qrCodeExpiredLabel = 'QR Code expired';
122
+ this.credentialsNotValidatedLabel = 'User credentials not validated';
123
+ this.clickInsideBoxLabel = 'Click inside the box to';
124
+ this.refreshQrLabel = 'Refresh QR Code';
125
+ this.scanQrLabel = 'Scan QR Code';
126
+ this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
127
+ this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
128
+ this.failedLoginErrorLabel = 'No successful login';
129
+ this.successLoginLabel = 'Successful Connection!';
130
+ this.byBrandLabel = 'by Gataca';
131
+ this.waitingStartSessionLabel = 'waiting to start a session';
132
+ this.readQrTitle = 'Processing...';
133
+ this.readQrDescription = 'Please wait a moment';
134
+ this.hideQrModalDescription = false;
135
+ this.dynamicLink = true;
136
+ this.sessionId = undefined;
137
+ this.authenticationRequest = undefined;
138
+ this.sessionData = undefined;
139
+ this.result = utils.RESULT_STATUS.NOT_STARTED;
140
+ this.qrHref = '';
141
+ this.qrShortenPending = false;
142
+ }
82
143
  disconnectedCallback() {
83
144
  this.stop();
84
145
  }
@@ -91,6 +152,10 @@ const GatacaQRWS = class {
91
152
  * Force manually the display of a QR
92
153
  */
93
154
  async display() {
155
+ this.qrHref = '';
156
+ this.qrShortenPending = false;
157
+ this.lastShortenRaw = null;
158
+ this.qrRefreshGeneration++;
94
159
  let socket = new WebSocket(this.socketEndpoint);
95
160
  setTimeout(() => {
96
161
  this.socket.close(1000, '');
@@ -145,10 +210,16 @@ const GatacaQRWS = class {
145
210
  this.result = wsresp.result;
146
211
  switch (wsresp.result) {
147
212
  case utils.RESULT_STATUS.ONGOING:
148
- case utils.RESULT_STATUS.READ:
213
+ case utils.RESULT_STATUS.READ: {
149
214
  this.sessionId = wsresp.sessionId;
150
215
  this.authenticationRequest = wsresp.authenticationRequest;
216
+ const raw = this.buildRawLink();
217
+ if (raw === null || raw === void 0 ? void 0 : raw.trim()) {
218
+ this.qrShortenPending = true;
219
+ void this.refreshQrHref();
220
+ }
151
221
  break;
222
+ }
152
223
  case utils.RESULT_STATUS.SUCCESS:
153
224
  this.sessionData = wsresp.authenticatedUserData;
154
225
  this.gatacaLoginCompleted.emit(wsresp.authenticatedUserData);
@@ -179,6 +250,9 @@ const GatacaQRWS = class {
179
250
  async stop() {
180
251
  this.sessionData = undefined;
181
252
  this.sessionId = undefined;
253
+ this.qrHref = '';
254
+ this.qrShortenPending = false;
255
+ this.lastShortenRaw = null;
182
256
  this.socket.close(1000, 'Client stopped the connection');
183
257
  }
184
258
  /**
@@ -187,19 +261,56 @@ const GatacaQRWS = class {
187
261
  async getSessionData() {
188
262
  return this.sessionData ? Promise.resolve(this.sessionData) : Promise.reject(new Error('No successful login'));
189
263
  }
190
- getLink() {
264
+ buildRawLink() {
265
+ var _a;
191
266
  if (this.v === '2' && this.qrRole == QR_ROLE_CONNECT) {
192
- return this.authenticationRequest;
267
+ return (_a = this.authenticationRequest) !== null && _a !== void 0 ? _a : '';
193
268
  }
194
269
  const authRequestEncoded = '?dl=' + utils.base64UrlEncode(this.authenticationRequest);
195
270
  return DEEP_LINK_PREFIX + authRequestEncoded;
196
271
  }
272
+ async refreshQrHref() {
273
+ var _a, _b, _c;
274
+ const raw = this.buildRawLink();
275
+ if (!(raw === null || raw === void 0 ? void 0 : raw.trim())) {
276
+ this.qrShortenPending = false;
277
+ return;
278
+ }
279
+ if (raw === this.lastShortenRaw && ((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim())) {
280
+ this.qrShortenPending = false;
281
+ return;
282
+ }
283
+ if (this.qrShortenPending && raw === this.lastShortenRaw && !((_b = this.qrHref) === null || _b === void 0 ? void 0 : _b.trim())) {
284
+ return;
285
+ }
286
+ const gen = ++this.qrRefreshGeneration;
287
+ this.lastShortenRaw = raw;
288
+ try {
289
+ const shortened = await utils.shortenUrlIfPossible(raw);
290
+ const now = this.buildRawLink();
291
+ if (now === raw) {
292
+ this.qrHref = shortened;
293
+ }
294
+ else if (!((_c = this.qrHref) === null || _c === void 0 ? void 0 : _c.trim())) {
295
+ this.qrHref = now;
296
+ }
297
+ }
298
+ finally {
299
+ if (gen === this.qrRefreshGeneration) {
300
+ this.qrShortenPending = false;
301
+ }
302
+ }
303
+ }
304
+ getLink() {
305
+ return this.qrHref || this.buildRawLink();
306
+ }
197
307
  renderQRSection() {
308
+ var _a, _b, _c;
198
309
  switch (this.result) {
199
310
  case utils.RESULT_STATUS.NOT_STARTED:
200
311
  return this.renderRetryButton();
201
312
  case utils.RESULT_STATUS.ONGOING:
202
- return this.renderQR(this.getLink(), true);
313
+ return this.qrShortenPending || !((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim()) ? this.renderQrLoadingSlot() : this.renderQR(this.getLink(), true, undefined, !!((_b = this.qrHref) === null || _b === void 0 ? void 0 : _b.trim()));
203
314
  case utils.RESULT_STATUS.EXPIRED:
204
315
  return this.renderRetryButton(this.qrCodeExpiredLabel);
205
316
  case utils.RESULT_STATUS.FAILED:
@@ -207,26 +318,35 @@ const GatacaQRWS = class {
207
318
  case utils.RESULT_STATUS.SUCCESS:
208
319
  return this.renderSuccess();
209
320
  case utils.RESULT_STATUS.READ:
210
- return this.renderReadQR({
211
- title: this === null || this === void 0 ? void 0 : this.readQrTitle,
212
- description: this === null || this === void 0 ? void 0 : this.readQrDescription
213
- });
321
+ return this.qrShortenPending || !((_c = this.qrHref) === null || _c === void 0 ? void 0 : _c.trim())
322
+ ? this.renderQrLoadingSlot()
323
+ : this.renderReadQR({
324
+ title: this === null || this === void 0 ? void 0 : this.readQrTitle,
325
+ description: this === null || this === void 0 ? void 0 : this.readQrDescription
326
+ });
214
327
  }
215
328
  }
216
329
  renderSuccess() {
217
330
  return index.h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel });
218
331
  }
219
332
  renderRetryButton(errorMessage) {
220
- return (index.h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this) }));
333
+ return (index.h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, display: this.display.bind(this) }));
221
334
  }
222
335
  renderReadQR(readQrMessages) {
223
- 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) });
336
+ var _a;
337
+ const linkReady = !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim());
338
+ 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: (url, useLogo, size) => this.renderQR(url, useLogo, size, linkReady) }));
224
339
  }
225
- renderQR(value, useLogo, sizeQR) {
226
- 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 });
340
+ renderQR(value, useLogo, sizeQR, linkReady = true) {
341
+ 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, linkReady: linkReady });
227
342
  }
228
- renderRetryQR(value, useLogo) {
229
- return index.h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, 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 });
343
+ renderQrLoadingSlot() {
344
+ const s = this.qrSize || 300;
345
+ return (index.h("div", { class: "qr-loading-slot", style: {
346
+ width: s + 'px',
347
+ height: s + 'px',
348
+ margin: '0 auto'
349
+ } }));
230
350
  }
231
351
  render() {
232
352
  var _a, _b;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1332a8ce.js');
5
+ const index = require('./index-d8d3dfde.js');
6
6
 
7
7
  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}";
8
8