@gataca/qr 2.0.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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/gat-icon-refresh-751505ff.js +14 -0
  3. package/dist/cjs/gataca-autoqr.cjs.entry.js +88 -0
  4. package/dist/cjs/gataca-qr.cjs.entry.js +175 -0
  5. package/dist/cjs/gataca-qrdisplay_2.cjs.entry.js +219 -0
  6. package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +114 -0
  7. package/dist/cjs/gatacaqr.cjs.js +19 -0
  8. package/dist/cjs/index-0b7a1532.js +1410 -0
  9. package/dist/cjs/index.cjs.js +16 -0
  10. package/dist/cjs/loader.cjs.js +21 -0
  11. package/dist/cjs/qr-code-styling-412bbc7a.js +28 -0
  12. package/dist/cjs/utils-383ee834.js +26 -0
  13. package/dist/collection/assets/icons/gat-icon-alert.svg +5 -0
  14. package/dist/collection/assets/icons/gat-icon-check.svg +5 -0
  15. package/dist/collection/assets/icons/gat-icon-refresh.svg +4 -0
  16. package/dist/collection/assets/images/logo_gataca.svg +26 -0
  17. package/dist/collection/collection-manifest.json +17 -0
  18. package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +116 -0
  19. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +306 -0
  20. package/dist/collection/components/gataca-qr/gataca-qr.css +249 -0
  21. package/dist/collection/components/gataca-qr/gataca-qr.js +557 -0
  22. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +154 -0
  23. package/dist/collection/components/gataca-qrws/gataca-qrws.css +249 -0
  24. package/dist/collection/components/gataca-qrws/gataca-qrws.js +566 -0
  25. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +116 -0
  26. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +395 -0
  27. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +116 -0
  28. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +410 -0
  29. package/dist/collection/index.js +2 -0
  30. package/dist/collection/utils/index.js +1 -0
  31. package/dist/collection/utils/utils.js +21 -0
  32. package/dist/components/gat-icon-refresh.js +29 -0
  33. package/dist/components/gataca-autoqr.d.ts +11 -0
  34. package/dist/components/gataca-autoqr.js +144 -0
  35. package/dist/components/gataca-qr.d.ts +11 -0
  36. package/dist/components/gataca-qr.js +6 -0
  37. package/dist/components/gataca-qr2.js +211 -0
  38. package/dist/components/gataca-qrdisplay.d.ts +11 -0
  39. package/dist/components/gataca-qrdisplay.js +6 -0
  40. package/dist/components/gataca-qrdisplay2.js +93 -0
  41. package/dist/components/gataca-qrws.d.ts +11 -0
  42. package/dist/components/gataca-qrws.js +6 -0
  43. package/dist/components/gataca-qrws2.js +212 -0
  44. package/dist/components/gataca-ssibutton.d.ts +11 -0
  45. package/dist/components/gataca-ssibutton.js +6 -0
  46. package/dist/components/gataca-ssibutton2.js +100 -0
  47. package/dist/components/gataca-ssibuttonws.d.ts +11 -0
  48. package/dist/components/gataca-ssibuttonws.js +6 -0
  49. package/dist/components/gataca-ssibuttonws2.js +102 -0
  50. package/dist/components/index.d.ts +27 -0
  51. package/dist/components/index.js +8 -0
  52. package/dist/esm/gat-icon-refresh-179ea123.js +9 -0
  53. package/dist/esm/gataca-autoqr.entry.js +84 -0
  54. package/dist/esm/gataca-qr.entry.js +171 -0
  55. package/dist/esm/gataca-qrdisplay_2.entry.js +214 -0
  56. package/dist/esm/gataca-ssibutton_2.entry.js +109 -0
  57. package/dist/esm/gatacaqr.js +17 -0
  58. package/dist/esm/index-19eef502.js +1384 -0
  59. package/dist/esm/index.js +1 -0
  60. package/dist/esm/loader.js +17 -0
  61. package/dist/esm/polyfills/core-js.js +11 -0
  62. package/dist/esm/polyfills/css-shim.js +1 -0
  63. package/dist/esm/polyfills/dom.js +79 -0
  64. package/dist/esm/polyfills/es5-html-element.js +1 -0
  65. package/dist/esm/polyfills/index.js +34 -0
  66. package/dist/esm/polyfills/system.js +6 -0
  67. package/dist/esm/qr-code-styling-0eeb38d5.js +26 -0
  68. package/dist/esm/utils-05ba6c9f.js +23 -0
  69. package/dist/gatacaqr/gatacaqr.esm.js +1 -0
  70. package/dist/gatacaqr/index.esm.js +1 -0
  71. package/dist/gatacaqr/p-0905677f.entry.js +1 -0
  72. package/dist/gatacaqr/p-0be4566d.js +1 -0
  73. package/dist/gatacaqr/p-1d35273f.entry.js +1 -0
  74. package/dist/gatacaqr/p-2f22c7fc.js +1 -0
  75. package/dist/gatacaqr/p-4139a068.entry.js +1 -0
  76. package/dist/gatacaqr/p-a6f85341.js +2 -0
  77. package/dist/gatacaqr/p-b8ba109f.js +1 -0
  78. package/dist/gatacaqr/p-f85d7e76.entry.js +1 -0
  79. package/dist/index.cjs.js +1 -0
  80. package/dist/index.js +1 -0
  81. package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +85 -0
  82. package/dist/types/components/gataca-qr/gataca-qr.d.ts +131 -0
  83. package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +35 -0
  84. package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +124 -0
  85. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +114 -0
  86. package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +110 -0
  87. package/dist/types/components.d.ts +830 -0
  88. package/dist/types/index.d.ts +2 -0
  89. package/dist/types/stencil-public-runtime.d.ts +1581 -0
  90. package/dist/types/utils/index.d.ts +1 -0
  91. package/dist/types/utils/utils.d.ts +56 -0
  92. package/loader/cdn.js +3 -0
  93. package/loader/index.cjs.js +3 -0
  94. package/loader/index.d.ts +12 -0
  95. package/loader/index.es2017.js +3 -0
  96. package/loader/index.js +4 -0
  97. package/loader/package.json +11 -0
  98. package/package.json +40 -0
  99. package/readme.md +67 -0
@@ -0,0 +1,212 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode, g as gatIconCheckSvg, a as gatIconRefreshSvg, d as gatIconAlertSvg } from './gat-icon-refresh.js';
3
+ import { l as logoGatacaSvg, d as defineCustomElement$1 } from './gataca-qrdisplay2.js';
4
+
5
+ const gatacaQrwsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .modal-window{position:relative;border-radius:6px;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;width:300px;min-height:408px;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window p{font-family:\"Work Sans\", \"Helvetica Neue\", sans-serif;font-weight:normal;font-size:12px;letter-spacing:1px;color:#181B5E}.popUpContainer .modal-window .qrTitleContainer{padding:24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-weight:400;font-size:14px;line-height:16.5px;padding-top:12px;padding-bottom:5px;color:#A1A1A1}.popUpContainer .modal-window .bold{font-weight:600}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .reload{height:252px;width:252px;border:1px dashed #A1A1A1;border-radius:12px;position:relative;margin:24px;display:flex;justify-content:center;align-items:center}.popUpContainer #qrwait{display:flex;justify-content:center}.popUpContainer #qrwait,.popUpContainer #notify{width:100%;height:100%;top:0;left:0;border-radius:20px}.popUpContainer #notify{z-index:10;background-color:gray;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;align-self:center;display:flex;flex-direction:column;padding:24px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px;background:rgba(255, 255, 255, 0.9);}.popUpContainer .notify-text{font-family:\"Work Sans\";font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;font-feature-settings:\"salt\" on;color:#8B8B8B;flex:none;order:1;align-self:stretch;flex-grow:0}.popUpContainer .alert{display:flex;flex-direction:row;align-items:center;justify-content:start;width:252px;position:absolute;bottom:0;background:#FFE5E5;border-radius:12px}.popUpContainer .alert img{margin:12px}.popUpContainer .alert p{font-weight:400;font-size:14px;line-height:16px;color:black}.popUpContainer .success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.popUpContainer .success .successMsg{margin-top:20px;font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}";
6
+
7
+ const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
8
+ const DEFAULT_SESSION_TIMEOUT = 300;
9
+ const QR_ROLE_CONNECT = "connect";
10
+ const FUNCTION_ROLES = {
11
+ connect: "scan",
12
+ certify: "credential",
13
+ };
14
+ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
15
+ constructor() { super(); this.__registerHost(); this.__attachShadow(); this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7); this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideBrandTitle = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
16
+ disconnectedCallback() {
17
+ this.stop();
18
+ }
19
+ async componentDidLoad() {
20
+ if (this.autostart) {
21
+ await this.display();
22
+ }
23
+ }
24
+ /**
25
+ * Force manually the display of a QR
26
+ */
27
+ async display() {
28
+ let socket = new WebSocket(this.socketEndpoint);
29
+ setTimeout(() => {
30
+ this.socket.close(1000, "");
31
+ }, 1000 * this.sessionTimeout);
32
+ this.socket = socket;
33
+ socket.onopen = () => {
34
+ if (this.wsOnOpen)
35
+ this.wsOnOpen(this.socket);
36
+ };
37
+ socket.onmessage = (msg) => {
38
+ if (this.wsOnMessage) {
39
+ this.wsOnMessage(this.socket, msg);
40
+ }
41
+ else {
42
+ let wsresp = JSON.parse(msg.data);
43
+ if (!!wsresp.sessionId) {
44
+ this.handleWSResponse(wsresp);
45
+ }
46
+ }
47
+ };
48
+ socket.onerror = () => {
49
+ let error = new Error("Error connecting with server");
50
+ this.result = RESULT_STATUS.FAILED;
51
+ this.gatacaLoginFailed.emit(error);
52
+ this.errorCallback(error);
53
+ socket.close(1000, "");
54
+ };
55
+ socket.onclose = () => {
56
+ if (this.result === RESULT_STATUS.ONGOING) {
57
+ this.result = RESULT_STATUS.EXPIRED;
58
+ }
59
+ if (this.result === RESULT_STATUS.EXPIRED) {
60
+ if (this.autorefresh) {
61
+ this.display();
62
+ }
63
+ else {
64
+ let error = new Error("User did not scan the QR in the alloted time");
65
+ this.gatacaLoginFailed.emit(error);
66
+ this.errorCallback(error);
67
+ }
68
+ }
69
+ };
70
+ if (checkMobile() && this.dynamicLink) {
71
+ window.location.href = this.getLink();
72
+ }
73
+ }
74
+ sessionMsgReceived(event) {
75
+ let wsresp = event.detail;
76
+ this.handleWSResponse(wsresp);
77
+ }
78
+ handleWSResponse(wsresp) {
79
+ this.result = wsresp.result;
80
+ switch (wsresp.result) {
81
+ case RESULT_STATUS.ONGOING:
82
+ this.sessionId = wsresp.sessionId;
83
+ this.authenticationRequest = wsresp.authenticationRequest;
84
+ break;
85
+ case RESULT_STATUS.SUCCESS:
86
+ this.sessionData = wsresp.authenticatedUserData;
87
+ this.gatacaLoginCompleted.emit(wsresp.authenticatedUserData);
88
+ this.successCallback(wsresp.authenticatedUserData);
89
+ this.socket.close(1000, "");
90
+ break;
91
+ case RESULT_STATUS.FAILED:
92
+ this.socket.close();
93
+ let error = new Error("Provided user credentials couldn't be validated");
94
+ this.gatacaLoginFailed.emit(error);
95
+ this.errorCallback(error);
96
+ break;
97
+ case RESULT_STATUS.EXPIRED:
98
+ this.socket.close();
99
+ if (this.autorefresh) {
100
+ this.display();
101
+ }
102
+ else {
103
+ let error = new Error("User did not scan the QR in the alloted time");
104
+ this.gatacaLoginFailed.emit(error);
105
+ this.errorCallback(error);
106
+ }
107
+ }
108
+ }
109
+ /**
110
+ * Stop manually an ongoing session
111
+ */
112
+ async stop() {
113
+ this.sessionData = undefined;
114
+ this.sessionId = undefined;
115
+ this.socket.close(1000, "Client stopped the connection");
116
+ }
117
+ /**
118
+ * Retrieve manually the session data on a successful login
119
+ */
120
+ async getSessionData() {
121
+ return this.sessionData
122
+ ? Promise.resolve(this.sessionData)
123
+ : Promise.reject(new Error("No successful login"));
124
+ }
125
+ getLink() {
126
+ if (this.v2 && this.qrRole == QR_ROLE_CONNECT) {
127
+ return this.authenticationRequest;
128
+ }
129
+ let op = FUNCTION_ROLES[this.qrRole];
130
+ let link = "https://gataca.page.link/" + op + "?";
131
+ link +=
132
+ this.qrRole === QR_ROLE_CONNECT
133
+ ? "session=" + this.sessionId
134
+ : "process=" + this.sessionId;
135
+ link +=
136
+ "&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
137
+ link = encodeURIComponent(link);
138
+ return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
139
+ }
140
+ renderQRSection() {
141
+ switch (this.result) {
142
+ case RESULT_STATUS.NOT_STARTED:
143
+ return this.renderRetryButton();
144
+ case RESULT_STATUS.ONGOING:
145
+ return this.renderQR(this.getLink(), 300, true);
146
+ case RESULT_STATUS.EXPIRED:
147
+ return this.renderRetryButton("QR Code expired");
148
+ case RESULT_STATUS.FAILED:
149
+ return this.renderRetryButton("User credentials not validated");
150
+ case RESULT_STATUS.SUCCESS:
151
+ return this.renderSuccess();
152
+ }
153
+ }
154
+ renderSuccess() {
155
+ return (h("div", { class: "success" }, h("img", { src: gatIconCheckSvg, height: 52, width: 52 }), h("p", { class: "successMsg" }, "Successful Connection!")));
156
+ }
157
+ renderRetryButton(errorMessage) {
158
+ return (h("div", { class: "reload" }, h("div", { id: "notify", onClick: () => this.display() }, h("img", { src: gatIconRefreshSvg, height: 24, width: 24 }), h("p", { class: "qrDescription" }, "Click inside the box to "), errorMessage ? (h("p", { class: "qrDescription bold" }, "Refresh QR Code")) : (h("p", { class: "qrDescription bold" }, "Scan QR Code")), errorMessage && (h("div", { class: "alert" }, h("img", { src: gatIconAlertSvg, height: 24, width: 24 }), h("p", null, errorMessage)))), h("div", { id: "qrwait" }, this.renderQR("waiting to start a session", 250))));
159
+ }
160
+ renderQR(value, size, useLogo) {
161
+ return (h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0 }));
162
+ }
163
+ render() {
164
+ return (h("div", { class: "popUpContainer" }, h("div", { class: "modal-window is-visible", onClick: (event) => {
165
+ event.stopPropagation();
166
+ } }, h("div", { class: "modal-window__content" }, h("div", { class: "qrTitleContainer" }, h("p", { class: "qrTitle" }, this.qrModalTitle), !this.hideBrandTitle && (h("p", { class: "qrBrand" }, "by Gataca", " ", h("span", null, h("img", { src: logoGatacaSvg })))), this.result !== RESULT_STATUS.SUCCESS && (h("p", { class: "qrDescription" }, this.qrModalDescription))), h("div", { class: "qrSection" }, this.renderQRSection())))));
167
+ }
168
+ static get style() { return gatacaQrwsCss; }
169
+ }, [1, "gataca-qrws", {
170
+ "successCallback": [16],
171
+ "errorCallback": [16],
172
+ "qrRole": [1, "qr-role"],
173
+ "callbackServer": [1, "callback-server"],
174
+ "socketEndpoint": [1, "socket-endpoint"],
175
+ "sessionTimeout": [2, "session-timeout"],
176
+ "wsOnOpen": [16],
177
+ "wsOnMessage": [16],
178
+ "autostart": [4],
179
+ "autorefresh": [4],
180
+ "v2": [4, "v-2"],
181
+ "qrModalTitle": [1, "qr-modal-title"],
182
+ "qrModalDescription": [1, "qr-modal-description"],
183
+ "hideBrandTitle": [4, "hide-brand-title"],
184
+ "dynamicLink": [4, "dynamic-link"],
185
+ "sessionId": [32],
186
+ "authenticationRequest": [32],
187
+ "sessionData": [32],
188
+ "result": [32],
189
+ "display": [64],
190
+ "stop": [64],
191
+ "getSessionData": [64]
192
+ }, [[2, "sessionMsg", "sessionMsgReceived"]]]);
193
+ function defineCustomElement() {
194
+ if (typeof customElements === "undefined") {
195
+ return;
196
+ }
197
+ const components = ["gataca-qrws", "gataca-qrdisplay"];
198
+ components.forEach(tagName => { switch (tagName) {
199
+ case "gataca-qrws":
200
+ if (!customElements.get(tagName)) {
201
+ customElements.define(tagName, GatacaQRWS);
202
+ }
203
+ break;
204
+ case "gataca-qrdisplay":
205
+ if (!customElements.get(tagName)) {
206
+ defineCustomElement$1();
207
+ }
208
+ break;
209
+ } });
210
+ }
211
+
212
+ export { GatacaQRWS as G, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface GatacaSsibutton extends Components.GatacaSsibutton, HTMLElement {}
4
+ export const GatacaSsibutton: {
5
+ prototype: GatacaSsibutton;
6
+ new (): GatacaSsibutton;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { G as GatacaSSIButton, d as defineCustomElement$1 } from './gataca-ssibutton2.js';
2
+
3
+ const GatacaSsibutton = GatacaSSIButton;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { GatacaSsibutton, defineCustomElement };
@@ -0,0 +1,100 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$1 } from './gataca-qrdisplay2.js';
3
+ import { d as defineCustomElement$2 } from './gataca-qr2.js';
4
+
5
+ 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}";
6
+
7
+ 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=";
8
+ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
14
+ this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
15
+ this.buttonText = "Easy login";
16
+ this.checkStatus = undefined;
17
+ this.createSession = undefined;
18
+ this.successCallback = undefined;
19
+ this.errorCallback = undefined;
20
+ this.qrRole = undefined;
21
+ this.callbackServer = undefined;
22
+ this.sessionTimeout = undefined;
23
+ this.pollingFrequency = undefined;
24
+ this.autorefresh = false;
25
+ this.v2 = false;
26
+ this.qrModalTitle = "Quick Access";
27
+ this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
28
+ this.hideBrandTitle = false;
29
+ this.dynamicLink = true;
30
+ this.open = false;
31
+ this.qr = (h("gataca-qr", { checkStatus: this.checkStatus, createSession: this.createSession, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, pollingFrequency: this.pollingFrequency, autostart: true, autorefresh: this.autorefresh, v2: this.v2, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
32
+ }
33
+ /**
34
+ * Retrieve manually the session data on a successful login
35
+ */
36
+ async getSessionData() {
37
+ return this.qr.getSessionData();
38
+ }
39
+ renderModal() {
40
+ return this.qr;
41
+ }
42
+ renderButton() {
43
+ return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
44
+ this.open = !this.open;
45
+ if (this.open) {
46
+ this.qr.display();
47
+ }
48
+ else {
49
+ this.qr.stop();
50
+ }
51
+ } }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
52
+ }
53
+ render() {
54
+ return (h("div", { class: "buttonContainer" }, this.renderButton(), this.open && this.renderModal()));
55
+ }
56
+ static get style() { return gatacaSsibuttonCss; }
57
+ }, [1, "gataca-ssibutton", {
58
+ "buttonText": [1, "button-text"],
59
+ "checkStatus": [16],
60
+ "createSession": [16],
61
+ "successCallback": [16],
62
+ "errorCallback": [16],
63
+ "qrRole": [1, "qr-role"],
64
+ "callbackServer": [1, "callback-server"],
65
+ "sessionTimeout": [2, "session-timeout"],
66
+ "pollingFrequency": [2, "polling-frequency"],
67
+ "autorefresh": [4],
68
+ "v2": [4, "v-2"],
69
+ "qrModalTitle": [1, "qr-modal-title"],
70
+ "qrModalDescription": [1, "qr-modal-description"],
71
+ "hideBrandTitle": [4, "hide-brand-title"],
72
+ "dynamicLink": [4, "dynamic-link"],
73
+ "open": [32],
74
+ "getSessionData": [64]
75
+ }]);
76
+ function defineCustomElement() {
77
+ if (typeof customElements === "undefined") {
78
+ return;
79
+ }
80
+ const components = ["gataca-ssibutton", "gataca-qr", "gataca-qrdisplay"];
81
+ components.forEach(tagName => { switch (tagName) {
82
+ case "gataca-ssibutton":
83
+ if (!customElements.get(tagName)) {
84
+ customElements.define(tagName, GatacaSSIButton);
85
+ }
86
+ break;
87
+ case "gataca-qr":
88
+ if (!customElements.get(tagName)) {
89
+ defineCustomElement$2();
90
+ }
91
+ break;
92
+ case "gataca-qrdisplay":
93
+ if (!customElements.get(tagName)) {
94
+ defineCustomElement$1();
95
+ }
96
+ break;
97
+ } });
98
+ }
99
+
100
+ export { GatacaSSIButton as G, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface GatacaSsibuttonws extends Components.GatacaSsibuttonws, HTMLElement {}
4
+ export const GatacaSsibuttonws: {
5
+ prototype: GatacaSsibuttonws;
6
+ new (): GatacaSsibuttonws;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { G as GatacaSSIButtonWS, d as defineCustomElement$1 } from './gataca-ssibuttonws2.js';
2
+
3
+ const GatacaSsibuttonws = GatacaSSIButtonWS;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { GatacaSsibuttonws, defineCustomElement };
@@ -0,0 +1,102 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$2 } from './gataca-qrdisplay2.js';
3
+ import { d as defineCustomElement$1 } from './gataca-qrws2.js';
4
+
5
+ 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}";
6
+
7
+ 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=";
8
+ const GatacaSSIButtonWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
14
+ this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
15
+ this.buttonText = "Easy login";
16
+ this.successCallback = undefined;
17
+ this.errorCallback = undefined;
18
+ this.qrRole = undefined;
19
+ this.callbackServer = undefined;
20
+ this.socketEndpoint = undefined;
21
+ this.sessionTimeout = undefined;
22
+ this.wsOnOpen = undefined;
23
+ this.wsOnMessage = undefined;
24
+ this.autostart = true;
25
+ this.autorefresh = false;
26
+ this.v2 = false;
27
+ this.qrModalTitle = "Quick Access";
28
+ this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
29
+ this.hideBrandTitle = false;
30
+ this.dynamicLink = true;
31
+ this.open = false;
32
+ this.qr = (h("gataca-qrws", { wsOnMessage: this.wsOnMessage, wsOnOpen: this.wsOnOpen, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, socketEndpoint: this.socketEndpoint, autostart: true, autorefresh: this.autorefresh, v2: this.v2, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
33
+ }
34
+ /**
35
+ * Retrieve manually the session data on a successful login
36
+ */
37
+ async getSessionData() {
38
+ return this.qr.getSessionData();
39
+ }
40
+ renderModal() {
41
+ return this.qr;
42
+ }
43
+ renderButton() {
44
+ return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
45
+ this.open = !this.open;
46
+ if (this.open) {
47
+ this.qr.display();
48
+ }
49
+ else {
50
+ this.qr.stop();
51
+ }
52
+ } }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
53
+ }
54
+ render() {
55
+ return (h("div", { class: "buttonContainer" }, this.renderButton(), this.open && this.renderModal()));
56
+ }
57
+ static get style() { return gatacaSsibuttonwsCss; }
58
+ }, [1, "gataca-ssibuttonws", {
59
+ "buttonText": [1, "button-text"],
60
+ "successCallback": [16],
61
+ "errorCallback": [16],
62
+ "qrRole": [1, "qr-role"],
63
+ "callbackServer": [1, "callback-server"],
64
+ "socketEndpoint": [1, "socket-endpoint"],
65
+ "sessionTimeout": [2, "session-timeout"],
66
+ "wsOnOpen": [16],
67
+ "wsOnMessage": [16],
68
+ "autostart": [4],
69
+ "autorefresh": [4],
70
+ "v2": [4, "v-2"],
71
+ "qrModalTitle": [1, "qr-modal-title"],
72
+ "qrModalDescription": [1, "qr-modal-description"],
73
+ "hideBrandTitle": [4, "hide-brand-title"],
74
+ "dynamicLink": [4, "dynamic-link"],
75
+ "open": [32],
76
+ "getSessionData": [64]
77
+ }]);
78
+ function defineCustomElement() {
79
+ if (typeof customElements === "undefined") {
80
+ return;
81
+ }
82
+ const components = ["gataca-ssibuttonws", "gataca-qrdisplay", "gataca-qrws"];
83
+ components.forEach(tagName => { switch (tagName) {
84
+ case "gataca-ssibuttonws":
85
+ if (!customElements.get(tagName)) {
86
+ customElements.define(tagName, GatacaSSIButtonWS);
87
+ }
88
+ break;
89
+ case "gataca-qrdisplay":
90
+ if (!customElements.get(tagName)) {
91
+ defineCustomElement$2();
92
+ }
93
+ break;
94
+ case "gataca-qrws":
95
+ if (!customElements.get(tagName)) {
96
+ defineCustomElement$1();
97
+ }
98
+ break;
99
+ } });
100
+ }
101
+
102
+ export { GatacaSSIButtonWS as G, defineCustomElement as d };
@@ -0,0 +1,27 @@
1
+ /* gatacaqr custom elements */
2
+ export { GatacaAutoQR as GatacaAutoqr } from '../types/components/gataca-autoqr/gataca-autoqr';
3
+ export { GatacaQR as GatacaQr } from '../types/components/gataca-qr/gataca-qr';
4
+ export { GatacaQRDisplay as GatacaQrdisplay } from '../types/components/gataca-qrdisplay/gataca-qrdisplay';
5
+ export { GatacaQRWS as GatacaQrws } from '../types/components/gataca-qrws/gataca-qrws';
6
+ export { GatacaSSIButton as GatacaSsibutton } from '../types/components/gataca-ssibutton/gataca-ssibutton';
7
+ export { GatacaSSIButtonWS as GatacaSsibuttonws } from '../types/components/gataca-ssibuttonws/gataca-ssibuttonws';
8
+
9
+ /**
10
+ * Used to manually set the base path where assets can be found.
11
+ * If the script is used as "module", it's recommended to use "import.meta.url",
12
+ * such as "setAssetPath(import.meta.url)". Other options include
13
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
14
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
15
+ * But do note that this configuration depends on how your script is bundled, or lack of
16
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
17
+ * will have to ensure the static assets are copied to its build directory.
18
+ */
19
+ export declare const setAssetPath: (path: string) => void;
20
+
21
+ export interface SetPlatformOptions {
22
+ raf?: (c: FrameRequestCallback) => number;
23
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
24
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
25
+ }
26
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
27
+ export * from '../types';
@@ -0,0 +1,8 @@
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
2
+ export { R as RESULT_STATUS, b as base64UrlEncode, c as checkMobile } from './gat-icon-refresh.js';
3
+ export { GatacaAutoqr, defineCustomElement as defineCustomElementGatacaAutoqr } from './gataca-autoqr.js';
4
+ export { GatacaQr, defineCustomElement as defineCustomElementGatacaQr } from './gataca-qr.js';
5
+ export { GatacaQrdisplay, defineCustomElement as defineCustomElementGatacaQrdisplay } from './gataca-qrdisplay.js';
6
+ export { GatacaQrws, defineCustomElement as defineCustomElementGatacaQrws } from './gataca-qrws.js';
7
+ export { GatacaSsibutton, defineCustomElement as defineCustomElementGatacaSsibutton } from './gataca-ssibutton.js';
8
+ export { GatacaSsibuttonws, defineCustomElement as defineCustomElementGatacaSsibuttonws } from './gataca-ssibuttonws.js';
@@ -0,0 +1,9 @@
1
+ const logoGatacaSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjUuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA2MzUuMyA1OTcuNDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDYzNS4zIDU5Ny40NzsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMxODFCNUU7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik02MDUuNzksMzIzLjQxYy0yNy45Ny00MS45Ny03My40NC03MS4yOC0xMjUuOTktNzcuNDljOS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b3VuZCIvPgo8L3N2Zz4K';
8
+
9
+ export { gatIconRefreshSvg as a, gatIconAlertSvg as b, gatIconCheckSvg as g, logoGatacaSvg as l };
@@ -0,0 +1,84 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index-19eef502.js';
2
+
3
+ const gatacaAutoqrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:\"Work Sans\", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:\"Helvetica Neue\", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}";
4
+
5
+ const DEFAULT_REPOSITORY = "https://studio.gataca.io/api/v1/qrs";
6
+ const GatacaAutoQR = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
10
+ this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
11
+ this.configId = undefined;
12
+ this.configRepository = DEFAULT_REPOSITORY;
13
+ this.successCallback = undefined;
14
+ this.errorCallback = undefined;
15
+ this.checkStatus = undefined;
16
+ this.createSession = undefined;
17
+ this.wsOnOpen = undefined;
18
+ this.wsOnMessage = undefined;
19
+ this.config = undefined;
20
+ this.loading = undefined;
21
+ this.loading = true;
22
+ fetch(this.configRepository + "/" + this.configId, {
23
+ method: "GET",
24
+ headers: {
25
+ "Content-Type": "application/json",
26
+ },
27
+ })
28
+ .then((response) => {
29
+ response
30
+ .json()
31
+ .then((data) => {
32
+ this.config = data;
33
+ this.loading = false;
34
+ })
35
+ .catch((err) => {
36
+ console.log("Cannot retrieve selected config", err);
37
+ this.loading = false;
38
+ });
39
+ })
40
+ .catch((err) => {
41
+ console.log("Cannot retrieve selected config", err);
42
+ this.loading = false;
43
+ });
44
+ }
45
+ /**
46
+ * Retrieve manually the session data on a successful login
47
+ */
48
+ async getSessionData() {
49
+ return this.qr.getSessionData();
50
+ }
51
+ selectQR() {
52
+ if (this.config.useButton) {
53
+ if (this.config.useWs) {
54
+ this.qr = (h("gataca-ssibuttonws", { buttonText: this.config.buttonText, wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: true, autorefresh: this.config.autorefresh, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
55
+ }
56
+ else {
57
+ this.qr = (h("gataca-ssibutton", { buttonText: this.config.buttonText, checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autorefresh: this.config.autorefresh, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
58
+ }
59
+ }
60
+ else {
61
+ if (this.config.useWs) {
62
+ this.qr = (h("gataca-qrws", { wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
63
+ }
64
+ else {
65
+ this.qr = (h("gataca-qr", { checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
66
+ }
67
+ }
68
+ }
69
+ render() {
70
+ if (this.loading) {
71
+ //TODO: Improve loading message
72
+ return h("div", null, "Loading...");
73
+ }
74
+ if (this.config) {
75
+ this.selectQR();
76
+ return this.qr;
77
+ }
78
+ //TODO: Improve error message
79
+ return h("div", null, "Error loading your config...");
80
+ }
81
+ };
82
+ GatacaAutoQR.style = gatacaAutoqrCss;
83
+
84
+ export { GatacaAutoQR as gataca_autoqr };