@gataca/qr 2.0.9 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/gataca-qr_2.cjs.entry.js +1 -2
- package/dist/cjs/gataca-qrws.cjs.entry.js +61 -11
- package/dist/cjs/gatacaqr.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gataca-qr/gataca-qr.css +28 -110
- package/dist/collection/components/gataca-qr/gataca-qr.js +0 -1
- package/dist/collection/components/gataca-qrws/components/qr/QR.js +5 -0
- package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +13 -0
- package/dist/collection/components/gataca-qrws/components/success/Success.js +8 -0
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +98 -73
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +387 -13
- package/dist/components/gataca-qr2.js +1 -2
- package/dist/components/gataca-qrws2.js +83 -13
- package/dist/esm/gataca-qr_2.entry.js +1 -2
- package/dist/esm/gataca-qrws.entry.js +62 -12
- package/dist/esm/gatacaqr.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/p-4b2b3ddc.entry.js +1 -0
- package/dist/gatacaqr/{p-c134f057.entry.js → p-4e11e0d2.entry.js} +1 -1
- package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +9 -0
- package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +13 -0
- package/dist/types/components/gataca-qrws/components/success/Success.d.ts +7 -0
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +102 -1
- package/dist/types/components.d.ts +160 -0
- package/package.json +1 -1
- package/dist/gatacaqr/p-23197d75.entry.js +0 -1
|
@@ -72,16 +72,116 @@ export declare class GatacaQRWS {
|
|
|
72
72
|
* Modifies the qr headline title
|
|
73
73
|
*/
|
|
74
74
|
qrModalTitle?: string;
|
|
75
|
+
/**
|
|
76
|
+
* _[Optional]_
|
|
77
|
+
* String to set Modal title color
|
|
78
|
+
*/
|
|
79
|
+
modalTitleColor?: string;
|
|
75
80
|
/**
|
|
76
81
|
* _[Optional]_
|
|
77
82
|
* Modifies the Modal description
|
|
78
83
|
*/
|
|
79
84
|
qrModalDescription?: string;
|
|
85
|
+
/**
|
|
86
|
+
* _[Optional]_
|
|
87
|
+
* Boolean to show or not show the modal title, brandTitle and description
|
|
88
|
+
*/
|
|
89
|
+
hideModalTexts?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* _[Optional]_
|
|
92
|
+
* Boolean to show or not show the modal title, brandTitle and description
|
|
93
|
+
*/
|
|
94
|
+
hideModalBoxShadow?: boolean;
|
|
80
95
|
/**
|
|
81
96
|
* _[Optional]_
|
|
82
97
|
* Boolean to show or not show the gataca brand title
|
|
83
98
|
*/
|
|
84
99
|
hideBrandTitle?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* _[Optional]_
|
|
102
|
+
* Size of the logo to display in percentage to the total size [0-1]. 0 means no logo will be displayed. Default is the GATACA logo. Recommended size is around 0.33
|
|
103
|
+
*/
|
|
104
|
+
logoSize?: number;
|
|
105
|
+
/**
|
|
106
|
+
* _[Optional]_
|
|
107
|
+
* Logo to display, just if the logo size is greater than 0. No logo is the GATACA logo.
|
|
108
|
+
*/
|
|
109
|
+
logoSrc?: string;
|
|
110
|
+
/**
|
|
111
|
+
* _[Optional]_
|
|
112
|
+
* Size of QR Displayed
|
|
113
|
+
*/
|
|
114
|
+
qrSize?: number;
|
|
115
|
+
/**
|
|
116
|
+
* _[Optional]_
|
|
117
|
+
* Width of the modal
|
|
118
|
+
*/
|
|
119
|
+
modalWidth?: number;
|
|
120
|
+
/**
|
|
121
|
+
* _[Optional]_
|
|
122
|
+
* Height of the modal
|
|
123
|
+
*/
|
|
124
|
+
modalHeight?: number;
|
|
125
|
+
/**
|
|
126
|
+
* _[Optional]_
|
|
127
|
+
* String to show when qr code expired
|
|
128
|
+
*/
|
|
129
|
+
qrCodeExpiredLabel?: string;
|
|
130
|
+
/**
|
|
131
|
+
* _[Optional]_
|
|
132
|
+
* String to show when credentials not validatedd
|
|
133
|
+
*/
|
|
134
|
+
credentialsNotValidatedLabel?: string;
|
|
135
|
+
/**
|
|
136
|
+
* _[Optional]_
|
|
137
|
+
* String to show "click inside" label
|
|
138
|
+
*/
|
|
139
|
+
clickInsideBoxLabel?: string;
|
|
140
|
+
/**
|
|
141
|
+
* _[Optional]_
|
|
142
|
+
* String to show "refresh QR" label
|
|
143
|
+
*/
|
|
144
|
+
refreshQrLabel?: string;
|
|
145
|
+
/**
|
|
146
|
+
* _[Optional]_
|
|
147
|
+
* String to show "scan QR" label
|
|
148
|
+
*/
|
|
149
|
+
scanQrLabel?: string;
|
|
150
|
+
/**
|
|
151
|
+
* _[Optional]_
|
|
152
|
+
* String to show "user not scan in time" error
|
|
153
|
+
*/
|
|
154
|
+
userNotScanInTimeErrorLabel?: string;
|
|
155
|
+
/**
|
|
156
|
+
* _[Optional]_
|
|
157
|
+
* String to show "provided credentials not validates" error
|
|
158
|
+
*/
|
|
159
|
+
credsNotValidatedErrorLabel?: string;
|
|
160
|
+
/**
|
|
161
|
+
* _[Optional]_
|
|
162
|
+
* String to show "failed login" error
|
|
163
|
+
*/
|
|
164
|
+
failedLoginErrorLabel?: string;
|
|
165
|
+
/**
|
|
166
|
+
* _[Optional]_
|
|
167
|
+
* String to show "successful login" label
|
|
168
|
+
*/
|
|
169
|
+
successLoginLabel?: string;
|
|
170
|
+
/**
|
|
171
|
+
* _[Optional]_
|
|
172
|
+
* String to show "by brand" label
|
|
173
|
+
*/
|
|
174
|
+
byBrandLabel?: string;
|
|
175
|
+
/**
|
|
176
|
+
* _[Optional]_
|
|
177
|
+
* String to show "waiting start session" label
|
|
178
|
+
*/
|
|
179
|
+
waitingStartSessionLabel?: string;
|
|
180
|
+
/**
|
|
181
|
+
* _[Optional]_
|
|
182
|
+
* Boolean to show or not show the QR Modal description
|
|
183
|
+
*/
|
|
184
|
+
hideQrModalDescription?: boolean;
|
|
85
185
|
/**
|
|
86
186
|
* _[Optional]_
|
|
87
187
|
* Display a link containing a dynamic link to invoke the wallet if closed
|
|
@@ -119,6 +219,7 @@ export declare class GatacaQRWS {
|
|
|
119
219
|
renderQRSection(): any;
|
|
120
220
|
renderSuccess(): any;
|
|
121
221
|
renderRetryButton(errorMessage?: string): any;
|
|
122
|
-
renderQR(value: string,
|
|
222
|
+
renderQR(value: string, useLogo?: boolean): any;
|
|
223
|
+
renderRetryQR(value: string, useLogo?: boolean): any;
|
|
123
224
|
render(): any;
|
|
124
225
|
}
|
|
@@ -245,10 +245,26 @@ export namespace Components {
|
|
|
245
245
|
* _[Optional]_ Set to enable autoload when the QR is displayed. By default it is true
|
|
246
246
|
*/
|
|
247
247
|
"autostart": boolean;
|
|
248
|
+
/**
|
|
249
|
+
* _[Optional]_ String to show "by brand" label
|
|
250
|
+
*/
|
|
251
|
+
"byBrandLabel"?: string;
|
|
248
252
|
/**
|
|
249
253
|
* ***Mandatory just for V1*** Connect/Certify Server where the wallet will send the data
|
|
250
254
|
*/
|
|
251
255
|
"callbackServer": string;
|
|
256
|
+
/**
|
|
257
|
+
* _[Optional]_ String to show "click inside" label
|
|
258
|
+
*/
|
|
259
|
+
"clickInsideBoxLabel"?: string;
|
|
260
|
+
/**
|
|
261
|
+
* _[Optional]_ String to show when credentials not validatedd
|
|
262
|
+
*/
|
|
263
|
+
"credentialsNotValidatedLabel"?: string;
|
|
264
|
+
/**
|
|
265
|
+
* _[Optional]_ String to show "provided credentials not validates" error
|
|
266
|
+
*/
|
|
267
|
+
"credsNotValidatedErrorLabel"?: string;
|
|
252
268
|
/**
|
|
253
269
|
* Force manually the display of a QR
|
|
254
270
|
*/
|
|
@@ -261,6 +277,10 @@ export namespace Components {
|
|
|
261
277
|
* ***Mandatory*** Callback fired upon session expired or invalid If not set, session error would not be handled An error containing information will be passed as parameter
|
|
262
278
|
*/
|
|
263
279
|
"errorCallback": (error?: Error) => void;
|
|
280
|
+
/**
|
|
281
|
+
* _[Optional]_ String to show "failed login" error
|
|
282
|
+
*/
|
|
283
|
+
"failedLoginErrorLabel"?: string;
|
|
264
284
|
/**
|
|
265
285
|
* Retrieve manually the session data on a successful login
|
|
266
286
|
*/
|
|
@@ -269,6 +289,42 @@ export namespace Components {
|
|
|
269
289
|
* _[Optional]_ Boolean to show or not show the gataca brand title
|
|
270
290
|
*/
|
|
271
291
|
"hideBrandTitle"?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* _[Optional]_ Boolean to show or not show the modal title, brandTitle and description
|
|
294
|
+
*/
|
|
295
|
+
"hideModalBoxShadow"?: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* _[Optional]_ Boolean to show or not show the modal title, brandTitle and description
|
|
298
|
+
*/
|
|
299
|
+
"hideModalTexts"?: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* _[Optional]_ Boolean to show or not show the QR Modal description
|
|
302
|
+
*/
|
|
303
|
+
"hideQrModalDescription"?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* _[Optional]_ Size of the logo to display in percentage to the total size [0-1]. 0 means no logo will be displayed. Default is the GATACA logo. Recommended size is around 0.33
|
|
306
|
+
*/
|
|
307
|
+
"logoSize"?: number;
|
|
308
|
+
/**
|
|
309
|
+
* _[Optional]_ Logo to display, just if the logo size is greater than 0. No logo is the GATACA logo.
|
|
310
|
+
*/
|
|
311
|
+
"logoSrc"?: string;
|
|
312
|
+
/**
|
|
313
|
+
* _[Optional]_ Height of the modal
|
|
314
|
+
*/
|
|
315
|
+
"modalHeight"?: number;
|
|
316
|
+
/**
|
|
317
|
+
* _[Optional]_ String to set Modal title color
|
|
318
|
+
*/
|
|
319
|
+
"modalTitleColor"?: string;
|
|
320
|
+
/**
|
|
321
|
+
* _[Optional]_ Width of the modal
|
|
322
|
+
*/
|
|
323
|
+
"modalWidth"?: number;
|
|
324
|
+
/**
|
|
325
|
+
* _[Optional]_ String to show when qr code expired
|
|
326
|
+
*/
|
|
327
|
+
"qrCodeExpiredLabel"?: string;
|
|
272
328
|
/**
|
|
273
329
|
* _[Optional]_ Modifies the Modal description
|
|
274
330
|
*/
|
|
@@ -281,6 +337,18 @@ export namespace Components {
|
|
|
281
337
|
* ***Mandatory*** Decide if scanning the credential as a verifier to request credentials or as an issuer too issue credentials. Options: connect | certify
|
|
282
338
|
*/
|
|
283
339
|
"qrRole": string;
|
|
340
|
+
/**
|
|
341
|
+
* _[Optional]_ Size of QR Displayed
|
|
342
|
+
*/
|
|
343
|
+
"qrSize"?: number;
|
|
344
|
+
/**
|
|
345
|
+
* _[Optional]_ String to show "refresh QR" label
|
|
346
|
+
*/
|
|
347
|
+
"refreshQrLabel"?: string;
|
|
348
|
+
/**
|
|
349
|
+
* _[Optional]_ String to show "scan QR" label
|
|
350
|
+
*/
|
|
351
|
+
"scanQrLabel"?: string;
|
|
284
352
|
/**
|
|
285
353
|
* ***Mandatory*** Maximum time window to display the session and keep the websocket connection. It's needed to ensure the socket is closed.
|
|
286
354
|
*/
|
|
@@ -297,10 +365,22 @@ export namespace Components {
|
|
|
297
365
|
* ***Mandatory*** Callback fired upon session correctly verified If not set, session validation wouldn't trigger any action The session data and a possible token will be sent as parameters to the callback
|
|
298
366
|
*/
|
|
299
367
|
"successCallback": (data?: any) => void;
|
|
368
|
+
/**
|
|
369
|
+
* _[Optional]_ String to show "successful login" label
|
|
370
|
+
*/
|
|
371
|
+
"successLoginLabel"?: string;
|
|
372
|
+
/**
|
|
373
|
+
* _[Optional]_ String to show "user not scan in time" error
|
|
374
|
+
*/
|
|
375
|
+
"userNotScanInTimeErrorLabel"?: string;
|
|
300
376
|
/**
|
|
301
377
|
* **RECOMMENDED** Set to use v2 links. The create session must be providing both an authentication request and a session Id
|
|
302
378
|
*/
|
|
303
379
|
"v2"?: boolean;
|
|
380
|
+
/**
|
|
381
|
+
* _[Optional]_ String to show "waiting start session" label
|
|
382
|
+
*/
|
|
383
|
+
"waitingStartSessionLabel"?: string;
|
|
304
384
|
/**
|
|
305
385
|
* **RECOMMENDED** Callback to invoke an a message has been received on the socket. It provides the socket itself and the message as parameters. If not used, the messages provided by the server on the Socket connection must conform to the WSReponse interface If used, an Event named **sessionMsg** must be triggered with a WSReponse as data
|
|
306
386
|
*/
|
|
@@ -816,10 +896,26 @@ declare namespace LocalJSX {
|
|
|
816
896
|
* _[Optional]_ Set to enable autoload when the QR is displayed. By default it is true
|
|
817
897
|
*/
|
|
818
898
|
"autostart"?: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* _[Optional]_ String to show "by brand" label
|
|
901
|
+
*/
|
|
902
|
+
"byBrandLabel"?: string;
|
|
819
903
|
/**
|
|
820
904
|
* ***Mandatory just for V1*** Connect/Certify Server where the wallet will send the data
|
|
821
905
|
*/
|
|
822
906
|
"callbackServer"?: string;
|
|
907
|
+
/**
|
|
908
|
+
* _[Optional]_ String to show "click inside" label
|
|
909
|
+
*/
|
|
910
|
+
"clickInsideBoxLabel"?: string;
|
|
911
|
+
/**
|
|
912
|
+
* _[Optional]_ String to show when credentials not validatedd
|
|
913
|
+
*/
|
|
914
|
+
"credentialsNotValidatedLabel"?: string;
|
|
915
|
+
/**
|
|
916
|
+
* _[Optional]_ String to show "provided credentials not validates" error
|
|
917
|
+
*/
|
|
918
|
+
"credsNotValidatedErrorLabel"?: string;
|
|
823
919
|
/**
|
|
824
920
|
* _[Optional]_ Display a link containing a dynamic link to invoke the wallet if closed
|
|
825
921
|
*/
|
|
@@ -828,10 +924,46 @@ declare namespace LocalJSX {
|
|
|
828
924
|
* ***Mandatory*** Callback fired upon session expired or invalid If not set, session error would not be handled An error containing information will be passed as parameter
|
|
829
925
|
*/
|
|
830
926
|
"errorCallback"?: (error?: Error) => void;
|
|
927
|
+
/**
|
|
928
|
+
* _[Optional]_ String to show "failed login" error
|
|
929
|
+
*/
|
|
930
|
+
"failedLoginErrorLabel"?: string;
|
|
831
931
|
/**
|
|
832
932
|
* _[Optional]_ Boolean to show or not show the gataca brand title
|
|
833
933
|
*/
|
|
834
934
|
"hideBrandTitle"?: boolean;
|
|
935
|
+
/**
|
|
936
|
+
* _[Optional]_ Boolean to show or not show the modal title, brandTitle and description
|
|
937
|
+
*/
|
|
938
|
+
"hideModalBoxShadow"?: boolean;
|
|
939
|
+
/**
|
|
940
|
+
* _[Optional]_ Boolean to show or not show the modal title, brandTitle and description
|
|
941
|
+
*/
|
|
942
|
+
"hideModalTexts"?: boolean;
|
|
943
|
+
/**
|
|
944
|
+
* _[Optional]_ Boolean to show or not show the QR Modal description
|
|
945
|
+
*/
|
|
946
|
+
"hideQrModalDescription"?: boolean;
|
|
947
|
+
/**
|
|
948
|
+
* _[Optional]_ Size of the logo to display in percentage to the total size [0-1]. 0 means no logo will be displayed. Default is the GATACA logo. Recommended size is around 0.33
|
|
949
|
+
*/
|
|
950
|
+
"logoSize"?: number;
|
|
951
|
+
/**
|
|
952
|
+
* _[Optional]_ Logo to display, just if the logo size is greater than 0. No logo is the GATACA logo.
|
|
953
|
+
*/
|
|
954
|
+
"logoSrc"?: string;
|
|
955
|
+
/**
|
|
956
|
+
* _[Optional]_ Height of the modal
|
|
957
|
+
*/
|
|
958
|
+
"modalHeight"?: number;
|
|
959
|
+
/**
|
|
960
|
+
* _[Optional]_ String to set Modal title color
|
|
961
|
+
*/
|
|
962
|
+
"modalTitleColor"?: string;
|
|
963
|
+
/**
|
|
964
|
+
* _[Optional]_ Width of the modal
|
|
965
|
+
*/
|
|
966
|
+
"modalWidth"?: number;
|
|
835
967
|
/**
|
|
836
968
|
* GatacaLoginCompleted event, triggered with session data upon login success
|
|
837
969
|
*/
|
|
@@ -840,6 +972,10 @@ declare namespace LocalJSX {
|
|
|
840
972
|
* GatacaLoginFailed event, triggered with error upon login failure
|
|
841
973
|
*/
|
|
842
974
|
"onGatacaLoginFailed"?: (event: GatacaQrwsCustomEvent<any>) => void;
|
|
975
|
+
/**
|
|
976
|
+
* _[Optional]_ String to show when qr code expired
|
|
977
|
+
*/
|
|
978
|
+
"qrCodeExpiredLabel"?: string;
|
|
843
979
|
/**
|
|
844
980
|
* _[Optional]_ Modifies the Modal description
|
|
845
981
|
*/
|
|
@@ -852,6 +988,18 @@ declare namespace LocalJSX {
|
|
|
852
988
|
* ***Mandatory*** Decide if scanning the credential as a verifier to request credentials or as an issuer too issue credentials. Options: connect | certify
|
|
853
989
|
*/
|
|
854
990
|
"qrRole"?: string;
|
|
991
|
+
/**
|
|
992
|
+
* _[Optional]_ Size of QR Displayed
|
|
993
|
+
*/
|
|
994
|
+
"qrSize"?: number;
|
|
995
|
+
/**
|
|
996
|
+
* _[Optional]_ String to show "refresh QR" label
|
|
997
|
+
*/
|
|
998
|
+
"refreshQrLabel"?: string;
|
|
999
|
+
/**
|
|
1000
|
+
* _[Optional]_ String to show "scan QR" label
|
|
1001
|
+
*/
|
|
1002
|
+
"scanQrLabel"?: string;
|
|
855
1003
|
/**
|
|
856
1004
|
* ***Mandatory*** Maximum time window to display the session and keep the websocket connection. It's needed to ensure the socket is closed.
|
|
857
1005
|
*/
|
|
@@ -864,10 +1012,22 @@ declare namespace LocalJSX {
|
|
|
864
1012
|
* ***Mandatory*** Callback fired upon session correctly verified If not set, session validation wouldn't trigger any action The session data and a possible token will be sent as parameters to the callback
|
|
865
1013
|
*/
|
|
866
1014
|
"successCallback"?: (data?: any) => void;
|
|
1015
|
+
/**
|
|
1016
|
+
* _[Optional]_ String to show "successful login" label
|
|
1017
|
+
*/
|
|
1018
|
+
"successLoginLabel"?: string;
|
|
1019
|
+
/**
|
|
1020
|
+
* _[Optional]_ String to show "user not scan in time" error
|
|
1021
|
+
*/
|
|
1022
|
+
"userNotScanInTimeErrorLabel"?: string;
|
|
867
1023
|
/**
|
|
868
1024
|
* **RECOMMENDED** Set to use v2 links. The create session must be providing both an authentication request and a session Id
|
|
869
1025
|
*/
|
|
870
1026
|
"v2"?: boolean;
|
|
1027
|
+
/**
|
|
1028
|
+
* _[Optional]_ String to show "waiting start session" label
|
|
1029
|
+
*/
|
|
1030
|
+
"waitingStartSessionLabel"?: string;
|
|
871
1031
|
/**
|
|
872
1032
|
* **RECOMMENDED** Callback to invoke an a message has been received on the socket. It provides the socket itself and the message as parameters. If not used, the messages provided by the server on the Socket connection must conform to the WSReponse interface If used, an Event named **sessionMsg** must be triggered with a WSReponse as data
|
|
873
1033
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as e}from"./p-ec0f00a6.js";import{g as s,a as n,b as o,l as a}from"./p-ea783014.js";import"./p-0be4566d.js";import{R as r,c as p,b as l}from"./p-b8ba109f.js";const d="connect",c={connect:"scan",certify:"credential"},h=class{constructor(e){i(this,e),this.gatacaLoginCompleted=t(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=t(this,"gatacaLoginFailed",7),this.successCallback=void 0,this.errorCallback=void 0,this.qrRole=void 0,this.callbackServer=void 0,this.socketEndpoint=void 0,this.sessionTimeout=300,this.wsOnOpen=void 0,this.wsOnMessage=void 0,this.autostart=!0,this.autorefresh=!1,this.v2=!1,this.qrModalTitle="Quick Access",this.qrModalDescription="Sign up or sign in by scanning the QR Code with the Gataca Wallet",this.hideBrandTitle=!1,this.dynamicLink=!0,this.sessionId=void 0,this.authenticationRequest=void 0,this.sessionData=void 0,this.result=r.NOT_STARTED}disconnectedCallback(){this.stop()}async componentDidLoad(){this.autostart&&await this.display()}async display(){let i=new WebSocket(this.socketEndpoint);setTimeout((()=>{this.socket.close(1e3,"")}),1e3*this.sessionTimeout),this.socket=i,i.onopen=()=>{this.wsOnOpen&&this.wsOnOpen(this.socket)},i.onmessage=i=>{if(this.wsOnMessage)this.wsOnMessage(this.socket,i);else{let t=JSON.parse(i.data);t.sessionId&&this.handleWSResponse(t)}},i.onerror=()=>{let t=new Error("Error connecting with server");this.result=r.FAILED,this.gatacaLoginFailed.emit(t),this.errorCallback(t),i.close(1e3,"")},i.onclose=()=>{if(this.result===r.ONGOING&&(this.result=r.EXPIRED),this.result===r.EXPIRED)if(this.autorefresh)this.display();else{let i=new Error("User did not scan the QR in the alloted time");this.gatacaLoginFailed.emit(i),this.errorCallback(i)}},p()&&this.dynamicLink&&(window.location.href=this.getLink())}sessionMsgReceived(i){this.handleWSResponse(i.detail)}handleWSResponse(i){switch(this.result=i.result,i.result){case r.ONGOING:this.sessionId=i.sessionId,this.authenticationRequest=i.authenticationRequest;break;case r.SUCCESS:this.sessionData=i.authenticatedUserData,this.gatacaLoginCompleted.emit(i.authenticatedUserData),this.successCallback(i.authenticatedUserData),this.socket.close(1e3,"");break;case r.FAILED:this.socket.close();let t=new Error("Provided user credentials couldn't be validated");this.gatacaLoginFailed.emit(t),this.errorCallback(t);break;case r.EXPIRED:if(this.socket.close(),this.autorefresh)this.display();else{let i=new Error("User did not scan the QR in the alloted time");this.gatacaLoginFailed.emit(i),this.errorCallback(i)}}}async stop(){this.sessionData=void 0,this.sessionId=void 0,this.socket.close(1e3,"Client stopped the connection")}async getSessionData(){return this.sessionData?Promise.resolve(this.sessionData):Promise.reject(new Error("No successful login"))}getLink(){if(this.v2&&this.qrRole==d)return this.authenticationRequest;let i="https://gataca.page.link/"+c[this.qrRole]+"?";return i+=this.qrRole===d?"session="+this.sessionId:"process="+this.sessionId,i+="&callback="+l(encodeURIComponent(this.callbackServer)),i=encodeURIComponent(i),this.dynamicLink?"https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link="+i:i}renderQRSection(){switch(this.result){case r.NOT_STARTED:return this.renderRetryButton();case r.ONGOING:return this.renderQR(this.getLink(),300,!0);case r.EXPIRED:return this.renderRetryButton("QR Code expired");case r.FAILED:return this.renderRetryButton("User credentials not validated");case r.SUCCESS:return this.renderSuccess()}}renderSuccess(){return e("div",{class:"success"},e("img",{src:s,height:52,width:52}),e("p",{class:"successMsg"},"Successful Connection!"))}renderRetryButton(i){return e("div",{class:"reload"},e("div",{id:"notify",onClick:()=>this.display()},e("img",{src:n,height:24,width:24}),e("p",{class:"qrDescription"},"Click inside the box to "),e("p",{class:"qrDescription bold"},i?"Refresh QR Code":"Scan QR Code"),i&&e("div",{class:"alert"},e("img",{src:o,height:24,width:24}),e("p",null,i))),e("div",{id:"qrwait"},this.renderQR("waiting to start a session",250)))}renderQR(i,t,s){return e("gataca-qrdisplay",{qrData:i,rounded:!0,size:t,"logo-size":s?.33:0})}render(){return e("div",{class:"popUpContainer"},e("div",{class:"modal-window is-visible",onClick:i=>{i.stopPropagation()}},e("div",{class:"modal-window__content"},e("div",{class:"qrTitleContainer"},e("p",{class:"qrTitle"},this.qrModalTitle),!this.hideBrandTitle&&e("p",{class:"qrBrand"},"by Gataca"," ",e("span",null,e("img",{src:a}))),this.result!==r.SUCCESS&&e("p",{class:"qrDescription"},this.qrModalDescription)),e("div",{class:"qrSection"},this.renderQRSection()))))}};h.style='@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;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 p{font-family:"Work Sans", "Helvetica Neue", sans-serif;font-weight:normal;font-size:12px;letter-spacing:1px;color:#1e1e20}.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-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}';export{h as gataca_qrws}
|