@gataca/qr 4.0.1 → 4.0.3

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 (48) hide show
  1. package/dist/cjs/{gat-icon-check-c88a30ed.js → gat-icon-check-6b6780eb.js} +0 -3
  2. package/dist/cjs/gataca-autoqr.cjs.entry.js +1 -1
  3. package/dist/cjs/gataca-qr_3.cjs.entry.js +42 -33
  4. package/dist/cjs/gataca-qrws.cjs.entry.js +6 -4
  5. package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +1 -1
  6. package/dist/cjs/gatacaqr.cjs.js +1 -1
  7. package/dist/cjs/{index-93d47a75.js → index-1332a8ce.js} +32 -1
  8. package/dist/cjs/index.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{utils-b4e62bc0.js → utils-c6edb275.js} +1 -0
  11. package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +4 -8
  12. package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +4 -2
  13. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +6 -4
  14. package/dist/collection/components/gataca-qr/components/success/Success.js +3 -2
  15. package/dist/collection/components/gataca-qr/gataca-qr.css +14 -4
  16. package/dist/collection/components/gataca-qr/gataca-qr.js +7 -7
  17. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +1 -1
  18. package/dist/collection/components/icons/RefreshIcon.js +6 -0
  19. package/dist/collection/utils/utils.js +1 -0
  20. package/dist/components/gat-icon-check.js +2 -3
  21. package/dist/components/gataca-qr2.js +40 -31
  22. package/dist/components/gataca-qrws2.js +3 -1
  23. package/dist/esm/{gat-icon-check-c188cd29.js → gat-icon-check-7320c81b.js} +1 -3
  24. package/dist/esm/gataca-autoqr.entry.js +1 -1
  25. package/dist/esm/gataca-qr_3.entry.js +42 -33
  26. package/dist/esm/gataca-qrws.entry.js +5 -3
  27. package/dist/esm/gataca-ssibuttonws.entry.js +1 -1
  28. package/dist/esm/gatacaqr.js +1 -1
  29. package/dist/esm/{index-2be54f32.js → index-055790a7.js} +32 -1
  30. package/dist/esm/index.js +1 -1
  31. package/dist/esm/loader.js +1 -1
  32. package/dist/esm/{utils-21ffcc1e.js → utils-22df0ce4.js} +1 -0
  33. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  34. package/dist/gatacaqr/index.esm.js +1 -1
  35. package/dist/gatacaqr/p-2083dd06.entry.js +1 -0
  36. package/dist/gatacaqr/{p-5be73956.js → p-29119208.js} +1 -1
  37. package/dist/gatacaqr/{p-e94e9be8.entry.js → p-49cf321c.entry.js} +1 -1
  38. package/dist/gatacaqr/{p-5e81ab9e.entry.js → p-c65f810b.entry.js} +1 -1
  39. package/dist/gatacaqr/{p-948e7d94.entry.js → p-f5a4f65c.entry.js} +1 -1
  40. package/dist/gatacaqr/p-fccf9d4d.js +2 -0
  41. package/dist/types/components/gataca-qr/components/readQR/components/AnimatedLoader.d.ts +5 -1
  42. package/dist/types/components/gataca-qr/components/success/Success.d.ts +2 -0
  43. package/dist/types/components/gataca-qr/gataca-qr.d.ts +3 -1
  44. package/dist/types/components/icons/RefreshIcon.d.ts +8 -0
  45. package/package.json +1 -1
  46. package/dist/gatacaqr/p-5ae5f952.js +0 -2
  47. package/dist/gatacaqr/p-831794a4.entry.js +0 -1
  48. /package/dist/gatacaqr/{p-bce7e590.js → p-0501e224.js} +0 -0
@@ -1 +1 @@
1
- import{h as i,r as t,c as e}from"./p-5ae5f952.js";import{b as n,g as a,a as s,l as o}from"./p-5be73956.js";import{R as r,c as l,b as d}from"./p-bce7e590.js";const h=t=>{const{modalHeight:e,successLoginLabel:a}=t;return i("div",{class:"success",style:{height:e?(null==e?void 0:e.toString())+"px":"300px"}},i("img",{src:n,height:52,width:52}),i("p",{class:"successMsg"},a))},p=t=>{var e;const{errorMessage:n,modalWidth:o,clickInsideBoxLabel:r,refreshQrLabel:l,scanQrLabel:d,waitingStartSessionLabel:h,display:p,renderRetryQR:c}=t;return i("div",{class:"reload",style:{width:(o-48).toString()+"px",height:o?(null===(e=o-48)||void 0===e?void 0:e.toString())+"px":""}},i("div",{id:"notify",onClick:()=>p()},i("img",{src:a,height:24,width:24}),i("p",{class:"notify-text"},r," "),i("p",{class:"notify-text bold"},n?l:d),n&&i("div",{class:"alert",style:{width:(o-48).toString()+"px"}},i("img",{src:s,height:24,width:24}),i("p",null,n))),i("div",{id:"qrwait"},c(h)))},c=t=>{const{value:e,useLogo:n,logoSrc:a,size:s,qrType:o}=t;return i("gataca-qrdisplay",{qrData:e,rounded:!0,size:s,qrType:o,"logo-size":n?.33:0,"logo-src":a})},m=()=>i("div",{class:"containerLoader"},i("div",{class:"loader"},i("div",{class:"loader__item loader__item__1"}),i("div",{class:"loader__item loader__item__2"}),i("div",{class:"loader__item loader__item__3"}),i("div",{class:"loader__item loader__item__4"}),i("div",{class:"loader__item loader__item__5"}),i("div",{class:"loader__item loader__item__6"}),i("div",{class:"loader__item loader__item__7"}),i("div",{class:"loader__item loader__item__8"}))),g=t=>{var e;const{modalWidth:n,readQrMessages:a,renderQR:s,url:o,sizeQR:r}=t;return i("div",{class:"blured",style:{width:(n-48).toString()+"px",height:n?(null===(e=n-48)||void 0===e?void 0:e.toString())+"px":""}},i("div",{id:"notify"},i(m,null),i("p",{class:"notify-text"},null==a?void 0:a.title," "),i("p",{class:"notify-text bold"},null==a?void 0:a.description)),i("div",{id:"qrwait"},s(o,!1,r)))},x=class{constructor(i){t(this,i),this.gatacaLoginCompleted=e(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=e(this,"gatacaLoginFailed",7),this.successCallback=void 0,this.errorCallback=void 0,this.qrRole=void 0,this.qrType="svg",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.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=!1,this.hideModalBoxShadow=!1,this.hideBrandTitle=!1,this.logoSize=0,this.logoSrc=o,this.qrSize=300,this.modalWidth=300,this.modalHeight=void 0,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=!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||r.READ)&&(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)}},l()&&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:case r.READ: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(){return"2"===this.v&&"connect"==this.qrRole?this.authenticationRequest:"https://api.gataca.io/qr/redirect.html?dl="+d(this.authenticationRequest)}renderQRSection(){switch(this.result){case r.NOT_STARTED:return this.renderRetryButton();case r.ONGOING:return this.renderQR(this.getLink(),!0);case r.EXPIRED:return this.renderRetryButton(this.qrCodeExpiredLabel);case r.FAILED:return this.renderRetryButton(this.credentialsNotValidatedLabel);case r.SUCCESS:return this.renderSuccess();case r.READ:return this.renderReadQR({title:null==this?void 0:this.readQrTitle,description:null==this?void 0:this.readQrDescription})}}renderSuccess(){return i(h,{modalHeight:null==this?void 0:this.modalHeight,successLoginLabel:null==this?void 0:this.successLoginLabel})}renderRetryButton(t){return i(p,{errorMessage:t,modalWidth:null==this?void 0:this.modalWidth,clickInsideBoxLabel:null==this?void 0:this.clickInsideBoxLabel,refreshQrLabel:null==this?void 0:this.refreshQrLabel,scanQrLabel:null==this?void 0:this.scanQrLabel,waitingStartSessionLabel:null==this?void 0:this.waitingStartSessionLabel,display:this.display.bind(this),renderRetryQR:this.renderRetryQR.bind(this)})}renderReadQR(t){return i(g,{modalWidth:null==this?void 0:this.modalWidth,readQrMessages:t,url:this.getLink(),sizeQR:(null==this?void 0:this.qrSize)?(null==this?void 0:this.qrSize)-50:void 0,renderQR:this.renderQR.bind(this)})}renderQR(t,e,n){return i(c,{value:t,qrType:this.qrType,useLogo:e&&0!==this.logoSize,size:n||(null==this?void 0:this.qrSize)||void 0,logoSrc:null==this?void 0:this.logoSrc})}renderRetryQR(t,e){return i(c,{value:t,qrType:this.qrType,useLogo:e&&0!==this.logoSize,size:(null==this?void 0:this.qrSize)?(null==this?void 0:this.qrSize)-50:void 0,logoSrc:null==this?void 0:this.logoSrc})}render(){var t,e;return i("div",{class:"popUpContainer"},i("div",{class:`is-visible modal-window ${this.hideModalTexts?"":"large-modal"} ${this.hideModalBoxShadow?"noBoxShadow":""}`,style:{width:(this.modalWidth-2).toString()+"px",height:this.modalHeight?(null===(t=this.modalHeight-2)||void 0===t?void 0:t.toString())+"px":""},onClick:i=>{i.stopPropagation()}},i("div",{class:"modal-window__content"},i("div",{class:"qrTitleContainer "+(this.hideModalTexts?"hidenText":"")},i("p",{class:"qrTitle modalText",style:{color:this.modalTitleColor||"#1e1e20"}},this.qrModalTitle),!this.hideBrandTitle&&i("p",{class:"qrBrand modalText"},this.byBrandLabel," ",i("span",null,i("img",{src:o}))),this.result!==r.SUCCESS&&!this.hideQrModalDescription&&i("p",{class:"qrDescription modalText"},this.qrModalDescription)),i("div",{class:"qrSection",style:{width:this.modalWidth.toString()+"px",height:this.modalWidth?(null===(e=this.modalWidth)||void 0===e?void 0:e.toString())+"px":""}},this.renderQRSection()))))}};x.style='@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)}}';export{x as gataca_qrws}
1
+ import{h as i,r as t,c as e}from"./p-fccf9d4d.js";import{a as n,g as a,l as s}from"./p-29119208.js";import{R as o,c as r,b as l}from"./p-0501e224.js";const d=t=>{const{modalHeight:e,successLoginLabel:a}=t;return i("div",{class:"success",style:{height:e?(null==e?void 0:e.toString())+"px":"300px"}},i("img",{src:n,height:52,width:52}),i("p",{class:"successMsg"},a))},h=t=>{var e;const{errorMessage:n,modalWidth:s,clickInsideBoxLabel:o,refreshQrLabel:r,scanQrLabel:l,waitingStartSessionLabel:d,display:h,renderRetryQR:p}=t;return i("div",{class:"reload",style:{width:(s-48).toString()+"px",height:s?(null===(e=s-48)||void 0===e?void 0:e.toString())+"px":""}},i("div",{id:"notify",onClick:()=>h()},i("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIzIDRWMTBIMTciIHN0cm9rZT0iIzhCOEI4QiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTIwLjQ4OTkgMTVDMTkuODM5OSAxNi44Mzk5IDE4LjYwOTQgMTguNDE4NyAxNi45ODQgMTkuNDk4NUMxNS4zNTg2IDIwLjU3ODMgMTMuNDI2MyAyMS4xMDA2IDExLjQ3ODMgMjAuOTg2NkM5LjUzMDI2IDIwLjg3MjYgNy42NzIwMyAyMC4xMjg2IDYuMTgzNjMgMTguODY2N0M0LjY5NTI0IDE3LjYwNDcgMy42NTczIDE1Ljg5MzIgMy4yMjYyNSAxMy45OTAxQzIuNzk1MTkgMTIuMDg2OSAyLjk5NDM2IDEwLjA5NTIgMy43OTM3NCA4LjMxNTA4QzQuNTkzMTMgNi41MzQ5NiA1Ljk0OTQyIDUuMDYyODggNy42NTgyMyA0LjEyMDY1QzkuMzY3MDUgMy4xNzg0MyAxMS4zMzU4IDIuODE3MTEgMTMuMjY3OCAzLjA5MTE2QzE1LjE5OTkgMy4zNjUyIDE2Ljk5MDUgNC4yNTk3NSAxOC4zNjk5IDUuNjQwMDFMMjIuOTk5OSAxMCIgc3Ryb2tlPSIjOEI4QjhCIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K",height:24,width:24}),i("p",{class:"notify-text"},o," "),i("p",{class:"notify-text bold"},n?r:l),n&&i("div",{class:"alert",style:{width:(s-48).toString()+"px"}},i("img",{src:a,height:24,width:24}),i("p",null,n))),i("div",{id:"qrwait"},p(d)))},p=t=>{const{value:e,useLogo:n,logoSrc:a,size:s,qrType:o}=t;return i("gataca-qrdisplay",{qrData:e,rounded:!0,size:s,qrType:o,"logo-size":n?.33:0,"logo-src":a})},c=()=>i("div",{class:"containerLoader"},i("div",{class:"loader"},i("div",{class:"loader__item loader__item__1"}),i("div",{class:"loader__item loader__item__2"}),i("div",{class:"loader__item loader__item__3"}),i("div",{class:"loader__item loader__item__4"}),i("div",{class:"loader__item loader__item__5"}),i("div",{class:"loader__item loader__item__6"}),i("div",{class:"loader__item loader__item__7"}),i("div",{class:"loader__item loader__item__8"}))),m=t=>{var e;const{modalWidth:n,readQrMessages:a,renderQR:s,url:o,sizeQR:r}=t;return i("div",{class:"blured",style:{width:(n-48).toString()+"px",height:n?(null===(e=n-48)||void 0===e?void 0:e.toString())+"px":""}},i("div",{id:"notify"},i(c,null),i("p",{class:"notify-text"},null==a?void 0:a.title," "),i("p",{class:"notify-text bold"},null==a?void 0:a.description)),i("div",{id:"qrwait"},s(o,!1,r)))},g=class{constructor(i){t(this,i),this.gatacaLoginCompleted=e(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=e(this,"gatacaLoginFailed",7),this.successCallback=void 0,this.errorCallback=void 0,this.qrRole=void 0,this.qrType="svg",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.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=!1,this.hideModalBoxShadow=!1,this.hideBrandTitle=!1,this.logoSize=0,this.logoSrc=s,this.qrSize=300,this.modalWidth=300,this.modalHeight=void 0,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=!1,this.dynamicLink=!0,this.sessionId=void 0,this.authenticationRequest=void 0,this.sessionData=void 0,this.result=o.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=o.FAILED,this.gatacaLoginFailed.emit(t),this.errorCallback(t),i.close(1e3,"")},i.onclose=()=>{if((this.result===o.ONGOING||o.READ)&&(this.result=o.EXPIRED),this.result===o.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)}},r()&&this.dynamicLink&&(window.location.href=this.getLink())}sessionMsgReceived(i){this.handleWSResponse(i.detail)}handleWSResponse(i){switch(this.result=i.result,i.result){case o.ONGOING:case o.READ:this.sessionId=i.sessionId,this.authenticationRequest=i.authenticationRequest;break;case o.SUCCESS:this.sessionData=i.authenticatedUserData,this.gatacaLoginCompleted.emit(i.authenticatedUserData),this.successCallback(i.authenticatedUserData),this.socket.close(1e3,"");break;case o.FAILED:this.socket.close();let t=new Error("Provided user credentials couldn't be validated");this.gatacaLoginFailed.emit(t),this.errorCallback(t);break;case o.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(){return"2"===this.v&&"connect"==this.qrRole?this.authenticationRequest:"https://api.gataca.io/qr/redirect.html?dl="+l(this.authenticationRequest)}renderQRSection(){switch(this.result){case o.NOT_STARTED:return this.renderRetryButton();case o.ONGOING:return this.renderQR(this.getLink(),!0);case o.EXPIRED:return this.renderRetryButton(this.qrCodeExpiredLabel);case o.FAILED:return this.renderRetryButton(this.credentialsNotValidatedLabel);case o.SUCCESS:return this.renderSuccess();case o.READ:return this.renderReadQR({title:null==this?void 0:this.readQrTitle,description:null==this?void 0:this.readQrDescription})}}renderSuccess(){return i(d,{modalHeight:null==this?void 0:this.modalHeight,successLoginLabel:null==this?void 0:this.successLoginLabel})}renderRetryButton(t){return i(h,{errorMessage:t,modalWidth:null==this?void 0:this.modalWidth,clickInsideBoxLabel:null==this?void 0:this.clickInsideBoxLabel,refreshQrLabel:null==this?void 0:this.refreshQrLabel,scanQrLabel:null==this?void 0:this.scanQrLabel,waitingStartSessionLabel:null==this?void 0:this.waitingStartSessionLabel,display:this.display.bind(this),renderRetryQR:this.renderRetryQR.bind(this)})}renderReadQR(t){return i(m,{modalWidth:null==this?void 0:this.modalWidth,readQrMessages:t,url:this.getLink(),sizeQR:(null==this?void 0:this.qrSize)?(null==this?void 0:this.qrSize)-50:void 0,renderQR:this.renderQR.bind(this)})}renderQR(t,e,n){return i(p,{value:t,qrType:this.qrType,useLogo:e&&0!==this.logoSize,size:n||(null==this?void 0:this.qrSize)||void 0,logoSrc:null==this?void 0:this.logoSrc})}renderRetryQR(t,e){return i(p,{value:t,qrType:this.qrType,useLogo:e&&0!==this.logoSize,size:(null==this?void 0:this.qrSize)?(null==this?void 0:this.qrSize)-50:void 0,logoSrc:null==this?void 0:this.logoSrc})}render(){var t,e;return i("div",{class:"popUpContainer"},i("div",{class:`is-visible modal-window ${this.hideModalTexts?"":"large-modal"} ${this.hideModalBoxShadow?"noBoxShadow":""}`,style:{width:(this.modalWidth-2).toString()+"px",height:this.modalHeight?(null===(t=this.modalHeight-2)||void 0===t?void 0:t.toString())+"px":""},onClick:i=>{i.stopPropagation()}},i("div",{class:"modal-window__content"},i("div",{class:"qrTitleContainer "+(this.hideModalTexts?"hidenText":"")},i("p",{class:"qrTitle modalText",style:{color:this.modalTitleColor||"#1e1e20"}},this.qrModalTitle),!this.hideBrandTitle&&i("p",{class:"qrBrand modalText"},this.byBrandLabel," ",i("span",null,i("img",{src:s}))),this.result!==o.SUCCESS&&!this.hideQrModalDescription&&i("p",{class:"qrDescription modalText"},this.qrModalDescription)),i("div",{class:"qrSection",style:{width:this.modalWidth.toString()+"px",height:this.modalWidth?(null===(e=this.modalWidth)||void 0===e?void 0:e.toString())+"px":""}},this.renderQRSection()))))}};g.style='@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)}}';export{g as gataca_qrws}
@@ -0,0 +1,2 @@
1
+ let t,e,n=!1,l=!1;const s={},o=t=>"object"==(t=typeof t)||"function"===t,r=(t,e,...n)=>{let l=null,s=!1,r=!1;const i=[],a=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?a(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof t&&!o(l))&&(l+=""),s&&r?i[i.length-1].t+=l:i.push(s?c(null,l):l),r=s)};if(a(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}if("function"==typeof t)return t(null===e?{}:e,i,u);const f=c(t,null);return f.l=e,i.length>0&&(f.o=i),f},c=(t,e)=>({i:0,u:t,t:e,h:null,o:null,l:null}),i={},u={forEach:(t,e)=>t.map(a).forEach(e),map:(t,e)=>t.map(a).map(e).map(f)},a=t=>({vattrs:t.l,vchildren:t.o,vkey:t.p,vname:t.m,vtag:t.u,vtext:t.t}),f=t=>{if("function"==typeof t.vtag){const e=Object.assign({},t.vattrs);return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),r(t.vtag,e,...t.vchildren||[])}const e=c(t.vtag,t.vtext);return e.l=t.vattrs,e.o=t.vchildren,e.p=t.vkey,e.m=t.vname,e},h=(t,e,n)=>{const l=(t=>V(t).$)(t);return{emit:t=>d(l,e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t})}},d=(t,e,n)=>{const l=Y.ce(e,n);return t.dispatchEvent(l),l},p=new WeakMap,y=t=>"sc-"+t.g,m=(t,e,n,l,s,r)=>{if(n!==l){let c=B(t,e),i=e.toLowerCase();if("class"===e){const e=t.classList,s=b(n),o=b(l);e.remove(...s.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!s.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("ref"===e)l&&l(t);else if(c||"o"!==e[0]||"n"!==e[1]){const i=o(l);if((c||i&&null!==l)&&!s)try{if(t.tagName.includes("-"))t[e]=l;else{const s=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]==s||(t[e]=s)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!c||4&r||s)&&!i&&t.setAttribute(e,l=!0===l?"":l)}else e="-"===e[2]?e.slice(3):B(Q,i)?i.slice(2):i[2]+e.slice(3),n&&Y.rel(t,e,n,!1),l&&Y.ael(t,e,l,!1)}},$=/\s/,b=t=>t?t.split($):[],w=(t,e,n,l)=>{const o=11===e.h.nodeType&&e.h.host?e.h.host:e.h,r=t&&t.l||s,c=e.l||s;for(l in r)l in c||m(o,l,r[l],void 0,n,e.i);for(l in c)m(o,l,r[l],c[l],n,e.i)},g=(e,l,s)=>{const o=l.o[s];let r,c,i=0;if(null!==o.t)r=o.h=X.createTextNode(o.t);else{if(n||(n="svg"===o.u),r=o.h=X.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.u),n&&"foreignObject"===o.u&&(n=!1),w(null,o,n),null!=t&&r["s-si"]!==t&&r.classList.add(r["s-si"]=t),o.o)for(i=0;i<o.o.length;++i)c=g(e,o,i),c&&r.appendChild(c);"svg"===o.u?n=!1:"foreignObject"===r.tagName&&(n=!0)}return r},v=(t,n,l,s,o,r)=>{let c,i=t;for(i.shadowRoot&&i.tagName===e&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=g(null,l,o),c&&(s[o].h=c,i.insertBefore(c,n)))},j=(t,e,n,l,s)=>{for(;e<=n;++e)(l=t[e])&&(s=l.h,k(l),s.remove())},S=(t,e)=>t.u===e.u,O=(t,e)=>{const l=e.h=t.h,s=t.o,o=e.o,r=e.u,c=e.t;null===c?(n="svg"===r||"foreignObject"!==r&&n,w(t,e,n),null!==s&&null!==o?((t,e,n,l)=>{let s,o=0,r=0,c=e.length-1,i=e[0],u=e[c],a=l.length-1,f=l[0],h=l[a];for(;o<=c&&r<=a;)null==i?i=e[++o]:null==u?u=e[--c]:null==f?f=l[++r]:null==h?h=l[--a]:S(i,f)?(O(i,f),i=e[++o],f=l[++r]):S(u,h)?(O(u,h),u=e[--c],h=l[--a]):S(i,h)?(O(i,h),t.insertBefore(i.h,u.h.nextSibling),i=e[++o],h=l[--a]):S(u,f)?(O(u,f),t.insertBefore(u.h,i.h),u=e[--c],f=l[++r]):(s=g(e&&e[r],n,r),f=l[++r],s&&i.h.parentNode.insertBefore(s,i.h));o>c?v(t,null==l[a+1]?null:l[a+1].h,n,l,r,a):r>a&&j(e,o,c)})(l,s,e,o):null!==o?(null!==t.t&&(l.textContent=""),v(l,null,e,o,0,o.length-1)):null!==s&&j(s,0,s.length-1),n&&"svg"===r&&(n=!1)):t.t!==c&&(l.data=c)},k=t=>{t.l&&t.l.ref&&t.l.ref(null),t.o&&t.o.map(k)},M=(t,e)=>{e&&!t.v&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.v=e)))},C=(t,e)=>{if(t.i|=16,!(4&t.i))return M(t,t.j),ct((()=>x(t,e)));t.i|=512},x=(t,e)=>{const n=t.S;return e&&(t.i|=256,t.O&&(t.O.map((([t,e])=>T(n,t,e))),t.O=null)),q(void 0,(()=>P(t,n,e)))},P=async(t,e,n)=>{const l=t.$,s=l["s-rc"];n&&(t=>{const e=t.k,n=t.$,l=e.i,s=((t,e)=>{let n=y(e);const l=K.get(n);if(t=11===t.nodeType?t:X,l)if("string"==typeof l){let e,s=p.get(t=t.head||t);s||p.set(t,s=new Set),s.has(n)||(e=X.createElement("style"),e.innerHTML=l,t.insertBefore(e,t.querySelector("link")),s&&s.add(n))}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(t);E(t,e),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=l["s-p"],n=()=>L(t);0===e.length?n():(Promise.all(e).then(n),t.i|=4,e.length=0)}},E=(n,l)=>{try{l=l.render(),n.i&=-17,n.i|=2,((n,l)=>{const s=n.$,o=n.M||c(null,null),u=(t=>t&&t.u===i)(l)?l:r(null,null,l);e=s.tagName,u.u=null,u.i|=4,n.M=u,u.h=o.h=s.shadowRoot||s,t=s["s-sc"],O(o,u)})(n,l)}catch(t){G(t,n.$)}return null},L=t=>{const e=t.$,n=t.S,l=t.j;64&t.i||(t.i|=64,A(e),T(n,"componentDidLoad"),t.C(e),l||N()),t.P(e),t.v&&(t.v(),t.v=void 0),512&t.i&&rt((()=>C(t,!1))),t.i&=-517},N=()=>{A(X.documentElement),rt((()=>d(Q,"appload",{detail:{namespace:"gatacaqr"}})))},T=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){G(t)}},q=(t,e)=>t&&t.then?t.then(e):e(),A=t=>t.classList.add("hydrated"),F=(t,e,n)=>{if(e.L){const l=Object.entries(e.L),s=t.prototype;if(l.map((([t,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(s,t,{get(){return((t,e)=>V(this).N.get(e))(0,t)},set(n){((t,e,n,l)=>{const s=V(t),r=s.N.get(e),c=s.i,i=s.S;n=((t,e)=>null==t||o(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t)(n,l.L[e][0]),8&c&&void 0!==r||n===r||Number.isNaN(r)&&Number.isNaN(n)||(s.N.set(e,n),i&&2==(18&c)&&C(s,!1))})(this,t,n,e)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(s,t,{value(...e){const n=V(this);return n.T.then((()=>n.S[t](...e)))}})})),1&n){const e=new Map;s.attributeChangedCallback=function(t,n,l){Y.jmp((()=>{const n=e.get(t);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},t.observedAttributes=l.filter((([t,e])=>15&e[0])).map((([t,n])=>{const l=n[1]||t;return e.set(l,t),l}))}}return t},R=(t,e={})=>{const n=[],l=e.exclude||[],s=Q.customElements,o=X.head,r=o.querySelector("meta[charset]"),c=X.createElement("style"),i=[];let u,a=!0;Object.assign(Y,e),Y.q=new URL(e.resourcesUrl||"./",X.baseURI).href,t.map((t=>{t[1].map((e=>{const o={i:e[0],g:e[1],L:e[2],A:e[3]};o.L=e[2],o.A=e[3];const r=o.g,c=class extends HTMLElement{constructor(t){super(t),z(t=this,o),1&o.i&&t.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),a?i.push(this):Y.jmp((()=>(t=>{if(0==(1&Y.i)){const e=V(t),n=e.k,l=()=>{};if(1&e.i)U(t,e,n.A);else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){M(e,e.j=n);break}}n.L&&Object.entries(n.L).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n,l,s)=>{if(0==(32&e.i)){{if(e.i|=32,(s=J(n)).then){const t=()=>{};s=await s,t()}s.isProxied||(F(s,n,2),s.isProxied=!0);const t=()=>{};e.i|=8;try{new s(e)}catch(t){G(t)}e.i&=-9,t()}if(s.style){let t=s.style;const e=y(n);if(!K.has(e)){const l=()=>{};((t,e,n)=>{let l=K.get(t);tt&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,K.set(t,l)})(e,t,!!(1&n.i)),l()}}}const o=e.j,r=()=>C(e,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,e,n)}l()}})(this)))}disconnectedCallback(){Y.jmp((()=>(()=>{if(0==(1&Y.i)){const t=V(this),e=t.S;t.F&&(t.F.map((t=>t())),t.F=void 0),T(e,"disconnectedCallback")}})()))}componentOnReady(){return V(this).R}};o.U=t[0],l.includes(r)||s.get(r)||(n.push(r),s.define(r,F(c,o,1)))}))})),c.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",c.setAttribute("data-styles",""),o.insertBefore(c,r?r.nextSibling:o.firstChild),a=!1,i.length?i.map((t=>t.connectedCallback())):Y.jmp((()=>u=setTimeout(N,30)))},U=(t,e,n)=>{n&&n.map((([n,l,s])=>{const o=t,r=W(e,s),c=D(n);Y.ael(o,l,r,c),(e.F=e.F||[]).push((()=>Y.rel(o,l,r,c)))}))},W=(t,e)=>n=>{try{256&t.i?t.S[e](n):(t.O=t.O||[]).push([e,n])}catch(t){G(t)}},D=t=>0!=(2&t),H=new WeakMap,V=t=>H.get(t),_=(t,e)=>H.set(e.S=t,e),z=(t,e)=>{const n={i:0,$:t,k:e,N:new Map};return n.T=new Promise((t=>n.P=t)),n.R=new Promise((t=>n.C=t)),t["s-p"]=[],t["s-rc"]=[],U(t,n,e.A),H.set(t,n)},B=(t,e)=>e in t,G=(t,e)=>(0,console.error)(t,e),I=new Map,J=t=>{const e=t.g.replace(/-/g,"_"),n=t.U,l=I.get(n);return l?l[e]:import(`./${n}.entry.js`).then((t=>(I.set(n,t),t[e])),G)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},K=new Map,Q="undefined"!=typeof window?window:{},X=Q.document||{head:{}},Y={i:0,q:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},Z=t=>Promise.resolve(t),tt=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),et=[],nt=[],lt=(t,e)=>n=>{t.push(n),l||(l=!0,e&&4&Y.i?rt(ot):Y.raf(ot))},st=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){G(t)}t.length=0},ot=()=>{st(et),st(nt),(l=et.length>0)&&Y.raf(ot)},rt=t=>Z().then(t),ct=lt(nt,!0);export{R as b,h as c,r as h,Z as p,_ as r}
@@ -1,2 +1,6 @@
1
1
  import React from 'react';
2
- export declare const AnimatedLoader: React.FC;
2
+ declare type AnimatedLoaderProps = {
3
+ color?: string;
4
+ };
5
+ export declare const AnimatedLoader: React.FC<AnimatedLoaderProps>;
6
+ export {};
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
+ import { qrStyle } from '../../gataca-qr';
2
3
  declare type ISuccessProps = {
3
4
  modalHeight?: number;
4
5
  successLoginLabel?: string;
6
+ style?: qrStyle;
5
7
  };
6
8
  export declare const Success: React.FC<ISuccessProps>;
7
9
  export {};
@@ -5,7 +5,9 @@ import '../gataca-qrdisplay/gataca-qrdisplay';
5
5
  export declare type qrStyle = {
6
6
  color: string;
7
7
  bgColor: string;
8
- boxShadow?: boolean;
8
+ alertBgColor?: string;
9
+ alertBorderColor?: string;
10
+ boxShadow?: string;
9
11
  };
10
12
  export declare class GatacaQR {
11
13
  constructor();
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare type IRefreshIconProps = {
3
+ height?: number;
4
+ width?: number;
5
+ color?: string;
6
+ };
7
+ export declare const RefreshIcon: React.FC<IRefreshIconProps>;
8
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gataca/qr",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "Gataca component to display presentation requests in QR",
5
5
  "author": "Gataca <it@gataca.io>",
6
6
  "licenses": [
@@ -1,2 +0,0 @@
1
- let e,t,n=!1;const l={},s=e=>"object"==(e=typeof e)||"function"===e,o=(e,t,...n)=>{let l=null,o=!1,r=!1;const u=[],a=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?a(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!s(l))&&(l+=""),o&&r?u[u.length-1].t+=l:u.push(o?c(null,l):l),r=o)};if(a(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}if("function"==typeof e)return e(null===t?{}:t,u,i);const f=c(e,null);return f.l=t,u.length>0&&(f.o=u),f},c=(e,t)=>({i:0,u:e,t,h:null,o:null,l:null}),r={},i={forEach:(e,t)=>e.map(u).forEach(t),map:(e,t)=>e.map(u).map(t).map(a)},u=e=>({vattrs:e.l,vchildren:e.o,vkey:e.p,vname:e.m,vtag:e.u,vtext:e.t}),a=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),o(e.vtag,t,...e.vchildren||[])}const t=c(e.vtag,e.vtext);return t.l=e.vattrs,t.o=e.vchildren,t.p=e.vkey,t.m=e.vname,t},f=(e,t,n)=>{const l=(e=>H(e).$)(e);return{emit:e=>d(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},d=(e,t,n)=>{const l=X.ce(t,n);return e.dispatchEvent(l),l},h=new WeakMap,y=e=>"sc-"+e.v,p=(e,t,n,l,o,c)=>{if(n!==l){let r=z(e,t),i=t.toLowerCase();if("class"===t){const t=e.classList,s=$(n),o=$(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("ref"===t)l&&l(e);else if(r||"o"!==t[0]||"n"!==t[1]){const i=s(l);if((r||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const s=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&c||o)&&!i&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):z(K,i)?i.slice(2):i[2]+t.slice(3),n&&X.rel(e,t,n,!1),l&&X.ael(e,t,l,!1)}},m=/\s/,$=e=>e?e.split(m):[],b=(e,t,n,s)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,c=e&&e.l||l,r=t.l||l;for(s in c)s in r||p(o,s,c[s],void 0,n,t.i);for(s in r)p(o,s,c[s],r[s],n,t.i)},w=(t,n,l)=>{const s=n.o[l];let o,c,r=0;if(null!==s.t)o=s.h=Q.createTextNode(s.t);else if(o=s.h=Q.createElement(s.u),b(null,s,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),s.o)for(r=0;r<s.o.length;++r)c=w(t,s,r),c&&o.appendChild(c);return o},v=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=w(null,l,o),r&&(s[o].h=r,i.insertBefore(r,n)))},g=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,k(l),s.remove())},S=(e,t)=>e.u===t.u,j=(e,t)=>{const n=t.h=e.h,l=e.o,s=t.o,o=t.t;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],d=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==d?d=l[--a]:S(i,f)?(j(i,f),i=t[++o],f=l[++c]):S(u,d)?(j(u,d),u=t[--r],d=l[--a]):S(i,d)?(j(i,d),e.insertBefore(i.h,u.h.nextSibling),i=t[++o],d=l[--a]):S(u,f)?(j(u,f),e.insertBefore(u.h,i.h),u=t[--r],f=l[++c]):(s=w(t&&t[c],n,c),f=l[++c],s&&i.h.parentNode.insertBefore(s,i.h));o>r?v(e,null==l[a+1]?null:l[a+1].h,n,l,c,a):c>a&&g(t,o,r)})(n,l,t,s):null!==s?(null!==e.t&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.t!==o&&(n.data=o)},k=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(k)},M=(e,t)=>{t&&!e.g&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.g=t)))},O=(e,t)=>{if(e.i|=16,!(4&e.i))return M(e,e.S),ce((()=>C(e,t)));e.i|=512},C=(e,t)=>{const n=e.j;return t&&(e.i|=256,e.k&&(e.k.map((([e,t])=>N(n,e,t))),e.k=null)),T(void 0,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.$,s=l["s-rc"];n&&(e=>{const t=e.M,n=e.$,l=t.i,s=((e,t)=>{let n=y(t);const l=J.get(n);if(e=11===e.nodeType?e:Q,l)if("string"==typeof l){let t,s=h.get(e=e.head||e);s||h.set(e,s=new Set),s.has(n)||(t=Q.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);x(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>E(e);0===t.length?n():(Promise.all(t).then(n),e.i|=4,t.length=0)}},x=(n,l)=>{try{l=l.render(),n.i&=-17,n.i|=2,((n,l)=>{const s=n.$,i=n.O||c(null,null),u=(e=>e&&e.u===r)(l)?l:o(null,null,l);t=s.tagName,u.u=null,u.i|=4,n.O=u,u.h=i.h=s.shadowRoot||s,e=s["s-sc"],j(i,u)})(n,l)}catch(e){B(e,n.$)}return null},E=e=>{const t=e.$,n=e.j,l=e.S;64&e.i||(e.i|=64,q(t),N(n,"componentDidLoad"),e.C(t),l||L()),e.P(t),e.g&&(e.g(),e.g=void 0),512&e.i&&oe((()=>O(e,!1))),e.i&=-517},L=()=>{q(Q.documentElement),oe((()=>d(K,"appload",{detail:{namespace:"gatacaqr"}})))},N=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){B(e)}},T=(e,t)=>e&&e.then?e.then(t):t(),q=e=>e.classList.add("hydrated"),A=(e,t,n)=>{if(t.L){const l=Object.entries(t.L),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>H(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=H(e),c=o.N.get(t),r=o.i,i=o.j;n=((e,t)=>null==e||s(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.L[t][0]),8&r&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n)||(o.N.set(t,n),i&&2==(18&r)&&O(o,!1))})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=H(this);return n.T.then((()=>n.j[e](...t)))}})})),1&n){const t=new Map;o.attributeChangedCallback=function(e,n,l){X.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(o.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},F=(e,t={})=>{const n=[],l=t.exclude||[],s=K.customElements,o=Q.head,c=o.querySelector("meta[charset]"),r=Q.createElement("style"),i=[];let u,a=!0;Object.assign(X,t),X.q=new URL(t.resourcesUrl||"./",Q.baseURI).href,e.map((e=>{e[1].map((t=>{const o={i:t[0],v:t[1],L:t[2],A:t[3]};o.L=t[2],o.A=t[3];const c=o.v,r=class extends HTMLElement{constructor(e){super(e),_(e=this,o),1&o.i&&e.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),a?i.push(this):X.jmp((()=>(e=>{if(0==(1&X.i)){const t=H(e),n=t.M,l=()=>{};if(1&t.i)R(e,t,n.A);else{t.i|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){M(t,t.S=n);break}}n.L&&Object.entries(n.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.i)){{if(t.i|=32,(s=I(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(A(s,n,2),s.isProxied=!0);const e=()=>{};t.i|=8;try{new s(t)}catch(e){B(e)}t.i&=-9,e()}if(s.style){let e=s.style;const t=y(n);if(!J.has(t)){const l=()=>{};((e,t,n)=>{let l=J.get(e);Z&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,J.set(e,l)})(t,e,!!(1&n.i)),l()}}}const o=t.S,c=()=>O(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){X.jmp((()=>(()=>{if(0==(1&X.i)){const e=H(this),t=e.j;e.F&&(e.F.map((e=>e())),e.F=void 0),N(t,"disconnectedCallback")}})()))}componentOnReady(){return H(this).R}};o.U=e[0],l.includes(c)||s.get(c)||(n.push(c),s.define(c,A(r,o,1)))}))})),r.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles",""),o.insertBefore(r,c?c.nextSibling:o.firstChild),a=!1,i.length?i.map((e=>e.connectedCallback())):X.jmp((()=>u=setTimeout(L,30)))},R=(e,t,n)=>{n&&n.map((([n,l,s])=>{const o=e,c=U(t,s),r=W(n);X.ael(o,l,c,r),(t.F=t.F||[]).push((()=>X.rel(o,l,c,r)))}))},U=(e,t)=>n=>{try{256&e.i?e.j[t](n):(e.k=e.k||[]).push([t,n])}catch(e){B(e)}},W=e=>0!=(2&e),D=new WeakMap,H=e=>D.get(e),V=(e,t)=>D.set(t.j=e,t),_=(e,t)=>{const n={i:0,$:e,M:t,N:new Map};return n.T=new Promise((e=>n.P=e)),n.R=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],R(e,n,t.A),D.set(e,n)},z=(e,t)=>t in e,B=(e,t)=>(0,console.error)(e,t),G=new Map,I=e=>{const t=e.v.replace(/-/g,"_"),n=e.U,l=G.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(G.set(n,e),e[t])),B)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},J=new Map,K="undefined"!=typeof window?window:{},Q=K.document||{head:{}},X={i:0,q:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},Y=e=>Promise.resolve(e),Z=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ee=[],te=[],ne=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&X.i?oe(se):X.raf(se))},le=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){B(e)}e.length=0},se=()=>{le(ee),le(te),(n=ee.length>0)&&X.raf(se)},oe=e=>Y().then(e),ce=ne(te,!0);export{F as b,f as c,o as h,Y as p,V as r}
@@ -1 +0,0 @@
1
- import{r as i,h as t,c as e}from"./p-5ae5f952.js";import{Q as s,l as a,g as n,a as o,b as r}from"./p-5be73956.js";import{R as l,c as d,b as h}from"./p-bce7e590.js";const p=class{constructor(t){i(this,t),this.qrData=void 0,this.qrType="svg",this.size=256,this.logoSize=0,this.logoSrc=void 0,this.qrColor="#1E1E20",this.bgColor="#FFFFFF",this.rounded=!0}componentDidLoad(){new s({data:this.qrData,width:this.size,height:this.size,image:this.logoSize>0?this.logoSrc||a:void 0,margin:10,type:this.qrType,dotsOptions:{color:this.qrColor,type:this.rounded?"dots":"square"},cornersSquareOptions:{type:this.rounded?"extra-rounded":"square"},cornersDotOptions:{type:this.rounded?"dot":"square"},imageOptions:{margin:2,imageSize:this.logoSize},backgroundOptions:{color:this.bgColor}}).append(this.qr)}render(){return t("div",{ref:i=>{this.qr=i}})}},c=i=>{const{value:e,useLogo:s,logoSrc:a,size:n,qrType:o,style:r}=i;return t("gataca-qrdisplay",{qrData:e,rounded:!0,qrType:o,size:n,"logo-size":s?.33:0,"logo-src":a,qrColor:null==r?void 0:r.color,bgColor:null==r?void 0:r.bgColor})},g=()=>t("div",{class:"containerLoader"},t("div",{class:"loader"},t("div",{class:"loader__item loader__item__1"}),t("div",{class:"loader__item loader__item__2"}),t("div",{class:"loader__item loader__item__3"}),t("div",{class:"loader__item loader__item__4"}),t("div",{class:"loader__item loader__item__5"}),t("div",{class:"loader__item loader__item__6"}),t("div",{class:"loader__item loader__item__7"}),t("div",{class:"loader__item loader__item__8"}))),u=i=>{var e;const{modalWidth:s,readQrMessages:a,renderQR:n,url:o,sizeQR:r,style:l}=i;return t("div",{class:"blured",style:{width:(s-48).toString()+"px",height:s?(null===(e=s-48)||void 0===e?void 0:e.toString())+"px":"",backgroundColor:null==l?void 0:l.bgColor,color:null==l?void 0:l.color,border:(null==l?void 0:l.color)?`1px dashed ${null==l?void 0:l.color}`:"1px dashed #a1a1a1"}},t("div",{id:"notify",style:{backgroundColor:(null==l?void 0:l.bgColor)?null==l?void 0:l.bgColor:"white"}},t(g,null),t("p",{class:"notify-text",style:{color:(null==l?void 0:l.color)?null==l?void 0:l.color:"#707074"}},null==a?void 0:a.title," "),t("p",{class:"notify-text bold",style:{color:(null==l?void 0:l.color)?null==l?void 0:l.color:"#707074"}},null==a?void 0:a.description)),t("div",{id:"qrwait"},n(o,!1,r)))},m=i=>{var e;const{errorMessage:s,modalWidth:a,clickInsideBoxLabel:r,refreshQrLabel:l,scanQrLabel:d,waitingStartSessionLabel:h,style:p,display:c,renderRetryQR:g}=i;return t("div",{class:"reload",style:{width:(a-48).toString()+"px",height:a?(null===(e=a-48)||void 0===e?void 0:e.toString())+"px":"",border:(null==p?void 0:p.color)?`1px dashed ${null==p?void 0:p.color}`:"1px dashed #a1a1a1"}},t("div",{id:"notify",onClick:()=>c()},t("img",{src:n,height:24,width:24}),t("p",{class:"notify-text"},r," "),t("p",{class:"notify-text bold"},s?l:d),s&&t("div",{class:"alert",style:{width:(a-48).toString()+"px"}},t("img",{src:o,height:24,width:24}),t("p",null,s))),t("div",{id:"qrwait"},g(h)))},b=i=>{const{modalHeight:e,successLoginLabel:s}=i;return t("div",{class:"success",style:{height:e?(null==e?void 0:e.toString())+"px":"300px"}},t("img",{src:r,height:52,width:52}),t("p",{class:"successMsg"},s))},x=class{constructor(t){i(this,t),this.gatacaLoginCompleted=e(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=e(this,"gatacaLoginFailed",7),this.checkStatus=void 0,this.createSession=void 0,this.successCallback=void 0,this.errorCallback=void 0,this.qrRole=void 0,this.qrType="svg",this.callbackServer=void 0,this.autostart=!0,this.autorefresh=!1,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=!1,this.hideModalBoxShadow=!1,this.hideBrandTitle=!1,this.logoSize=0,this.logoSrc=a,this.qrSize=300,this.modalWidth=300,this.modalHeight=void 0,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=!1,this.sessionTimeout=300,this.pollingFrequency=3,this.dynamicLink=!0,this.qrStyle=void 0,this.sessionId=void 0,this.authenticationRequest=void 0,this.sessionData=void 0,this.result=l.NOT_STARTED}disconnectedCallback(){this.stop()}async componentDidLoad(){this.autostart&&await this.display()}async display(){await this.getSessionId(),this.result=l.ONGOING,this.poll().then((i=>{this.result=l.SUCCESS,this.sessionData=i,this.gatacaLoginCompleted.emit(i),this.successCallback(i)})).catch((i=>{this.clean();let t=i===l.EXPIRED;if(t&&this.autorefresh)this.display();else if(i!==l.NOT_STARTED){let e=t?new Error(this.userNotScanInTimeErrorLabel):new Error(this.credsNotValidatedErrorLabel);this.result=i,this.gatacaLoginFailed.emit(e),this.errorCallback(e)}})),d()&&this.dynamicLink&&(window.location.href=this.getLink())}async stop(){this.clean(),(this.result===l.ONGOING||l.READ)&&(this.result=l.NOT_STARTED)}clean(){this.sessionData=void 0,this.sessionId=void 0}async getSessionData(){return this.sessionData?Promise.resolve(this.sessionData):Promise.reject(new Error(this.failedLoginErrorLabel))}async getSessionId(){if(this.sessionId)return this.sessionId;let{sessionId:i,authenticationRequest:t}=await this.createSession();return this.sessionId=i,this.authenticationRequest=t,this.sessionId}getLink(){return"2"===this.v?this.authenticationRequest:"https://api.gataca.io/qr/redirect.html?dl="+h(this.authenticationRequest)}async poll(){let i=(new Date).getTime()+1e3*(this.sessionTimeout||300),t=1e3*(this.pollingFrequency||3),e=this,s=async function(a,n){let{result:o,data:r}=await(async i=>{if(i.result===l.NOT_STARTED)return{result:l.NOT_STARTED};let t=await i.getSessionId();return i.checkStatus(t)})(e);switch(o){case l.SUCCESS:a(r);break;case l.READ:e.result=l.READ;case l.ONGOING:e.sessionTimeout>0&&(new Date).getTime()<i?setTimeout(s,t,a,n):n(l.EXPIRED);break;default:n(o)}};return new Promise(s)}renderQRSection(){switch(this.result){case l.NOT_STARTED:return this.renderRetryButton();case l.ONGOING:return this.renderQR(this.getLink(),!0);case l.EXPIRED:return this.renderRetryButton(this.qrCodeExpiredLabel);case l.FAILED:return this.renderRetryButton(this.credentialsNotValidatedLabel);case l.SUCCESS:return this.renderSuccess();case l.READ:return this.renderReadQR({title:null==this?void 0:this.readQrTitle,description:null==this?void 0:this.readQrDescription})}}renderSuccess(){return t(b,{modalHeight:null==this?void 0:this.modalHeight,successLoginLabel:null==this?void 0:this.successLoginLabel})}renderRetryButton(i){return t(m,{errorMessage:i,modalWidth:null==this?void 0:this.modalWidth,clickInsideBoxLabel:null==this?void 0:this.clickInsideBoxLabel,refreshQrLabel:null==this?void 0:this.refreshQrLabel,scanQrLabel:null==this?void 0:this.scanQrLabel,waitingStartSessionLabel:null==this?void 0:this.waitingStartSessionLabel,display:this.display.bind(this),renderRetryQR:this.renderRetryQR.bind(this)})}renderReadQR(i){return t(u,{modalWidth:null==this?void 0:this.modalWidth,readQrMessages:i,url:this.getLink(),sizeQR:(null==this?void 0:this.qrSize)?(null==this?void 0:this.qrSize)-50:void 0,renderQR:this.renderQR.bind(this)})}renderQR(i,e,s){return t(c,{value:i,qrType:this.qrType,useLogo:e&&0!==this.logoSize,size:s||(null==this?void 0:this.qrSize)||void 0,logoSrc:null==this?void 0:this.logoSrc,style:null==this?void 0:this.qrStyle})}renderRetryQR(i,e){return t(c,{value:i,useLogo:e&&0!==this.logoSize,qrType:this.qrType,size:(null==this?void 0:this.qrSize)?(null==this?void 0:this.qrSize)-50:void 0,logoSrc:null==this?void 0:this.logoSrc,style:null==this?void 0:this.qrStyle})}render(){var i,e,s,n,o;return t("div",{class:"popUpContainer"},t("div",{class:`is-visible modal-window ${this.hideModalTexts?"":"large-modal"} ${this.hideModalBoxShadow?"noBoxShadow":""}`,style:{width:(this.modalWidth-2).toString()+"px",height:this.modalHeight?(null===(i=this.modalHeight-2)||void 0===i?void 0:i.toString())+"px":"",backgroundColor:(null===(e=null==this?void 0:this.qrStyle)||void 0===e?void 0:e.bgColor)?null===(s=null==this?void 0:this.qrStyle)||void 0===s?void 0:s.bgColor:"white",boxShadow:(null===(n=null==this?void 0:this.qrStyle)||void 0===n?void 0:n.boxShadow)?"0px 3px 10px rgba(48, 48, 48, 0.1);":"none"},onClick:i=>{i.stopPropagation()}},t("div",{class:"modal-window__content"},t("div",{class:"qrTitleContainer "+(this.hideModalTexts?"hidenText":"")},t("p",{class:"qrTitle modalText",style:{color:this.modalTitleColor||"#1e1e20"}},this.qrModalTitle),!this.hideBrandTitle&&t("p",{class:"qrBrand modalText"},this.byBrandLabel," ",t("span",null,t("img",{src:a}))),this.result!==l.SUCCESS&&!this.hideQrModalDescription&&t("p",{class:"qrDescription modalText"},this.qrModalDescription)),t("div",{class:"qrSection",style:{width:this.modalWidth.toString()+"px",height:this.modalWidth?(null===(o=this.modalWidth)||void 0===o?void 0:o.toString())+"px":""}},this.renderQRSection()))))}};x.style='@import url("https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:"Ubuntu", "Work Sans", "Helvetica Neue", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:"Poppins", "Ubuntu", "Work Sans", "Helvetica Neue", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:"Ubuntu", "Work Sans", "Helvetica Neue", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:20px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:"Poppins", "Ubuntu", "Work Sans", "Helvetica Neue", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:"Poppins", "Ubuntu", "Work Sans", "Helvetica Neue", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}';const f="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=",v=class{constructor(s){i(this,s),this.gatacaLoginCompleted=e(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=e(this,"gatacaLoginFailed",7),this.gatacaButtonPushed=e(this,"gatacaButtonPushed",7),this.getRequestFromUri=async i=>{const t=new URL(i).searchParams.get("request_uri");if(t){const i=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}}),e=(await i.json()).split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(e);let a=JSON.parse(s);return a.response_mode="dc_api",a}},this.buttonText="Easy login",this.buttonDCAPIText="Login with Device Credentials",this.qrType="svg",this.autostart=!0,this.checkStatus=void 0,this.createSession=void 0,this.fillSession=void 0,this.successCallback=void 0,this.errorCallback=void 0,this.handleCheckAppLoading=void 0,this.checkAppTimeout=6,this.qrRole=void 0,this.callbackServer=void 0,this.sessionTimeout=void 0,this.pollingFrequency=void 0,this.autorefresh=!1,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.hideBrandTitle=!1,this.dynamicLink=!0,this.logoSize=0,this.logoSrc=void 0,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.enableDcApi=!1,this.hideQrModalDescription=!1,this.qrStyle=void 0,this.open=!1,this.sessionId=void 0,this.authenticationRequest=void 0,this.sessionData=void 0,this.result=l.NOT_STARTED,this.qr=t("gataca-qr",{ref:i=>this.qrElement=i,checkStatus:this.checkStatus,createSession:this.createSession,successCallback:this.successCallback,errorCallback:this.errorCallback,qrRole:this.qrRole,qrType:this.qrType,callbackServer:this.callbackServer,sessionTimeout:this.sessionTimeout,pollingFrequency:this.pollingFrequency,autostart:this.autostart,autorefresh:this.autorefresh,v:this.v,qrModalTitle:this.qrModalTitle,qrModalDescription:this.qrModalDescription,hideBrandTitle:this.hideBrandTitle,dynamicLink:this.dynamicLink,logoSize:this.logoSize,logoSrc:this.logoSrc,modalTitleColor:this.modalTitleColor,qrCodeExpiredLabel:this.qrCodeExpiredLabel,credentialsNotValidatedLabel:this.credentialsNotValidatedLabel,clickInsideBoxLabel:this.clickInsideBoxLabel,refreshQrLabel:this.refreshQrLabel,scanQrLabel:this.scanQrLabel,userNotScanInTimeErrorLabel:this.userNotScanInTimeErrorLabel,credsNotValidatedErrorLabel:this.credsNotValidatedErrorLabel,failedLoginErrorLabel:this.failedLoginErrorLabel,successLoginLabel:this.successLoginLabel,byBrandLabel:this.byBrandLabel,waitingStartSessionLabel:this.waitingStartSessionLabel,hideQrModalDescription:this.hideQrModalDescription,qrStyle:this.qrStyle})}supportsDCAPI(){if(!this.enableDcApi)return!1;if(void 0===window.DigitalCredential)return!1;const i=["org-iso-mdoc","openid4vp","openid4vci"],t=i.filter(window.DigitalCredential.userAgentAllowsProtocol);return console.log(t,i),!0}async getSessionData(){return this.qr.getSessionData()}async getSessionId(){if(this.sessionId)return this.sessionId;let{sessionId:i,authenticationRequest:t}=await this.createSession();return this.sessionId=i,this.authenticationRequest=t,this.sessionId}async startMobilePolling(){await this.getSessionId(),this.result=l.ONGOING,this.poll().then((i=>{this.result=l.SUCCESS,this.sessionData=i,this.gatacaLoginCompleted.emit(i),this.successCallback(i)})).catch((i=>{this.clean();let t=i===l.EXPIRED;if(t&&this.autorefresh)this.startMobilePolling();else if(i!==l.NOT_STARTED){let e=t?new Error(this.userNotScanInTimeErrorLabel):new Error(this.credsNotValidatedErrorLabel);this.result=i,this.gatacaLoginFailed.emit(e),this.errorCallback(e)}}))}async stop(){this.clean(),(this.result===l.ONGOING||l.READ)&&(this.result=l.NOT_STARTED)}clean(){this.sessionData=void 0,this.sessionId=void 0}renderModal(){return this.qr}async poll(){let i=(new Date).getTime()+1e3*(this.sessionTimeout||300),t=1e3*(this.pollingFrequency||3),e=this,s=async function(a,n){let{result:o,data:r}=await(async i=>{if(i.result===l.NOT_STARTED)return{result:l.NOT_STARTED};let t=await i.getSessionId();return i.checkStatus(t)})(e);switch(o){case l.SUCCESS:a(r);break;case l.READ:e.result=l.READ;case l.ONGOING:e.sessionTimeout>0&&(new Date).getTime()<i?setTimeout(s,t,a,n):n(l.EXPIRED);break;default:n(o)}};return new Promise(s)}isAppInstalled(i,t){let e,s=!1;(null==i?void 0:i.length)&&(window.location.href=i),e=setTimeout((()=>{s||t(!1),n()}),1e3*this.checkAppTimeout);const a=()=>{document.hidden&&(s=!0,t(!0),this.autostart||this.startMobilePolling(),n())};function n(){clearTimeout(e),document.removeEventListener("visibilitychange",a)}document.addEventListener("visibilitychange",a)}renderDesktopButton(){return t("div",{class:"gatacaButtonWrapper"},t("button",{class:"gatacaButton",onClick:()=>{this.open=!this.open,setTimeout((()=>{var i,t;this.open?null===(i=this.qrElement)||void 0===i||i.display():null===(t=this.qrElement)||void 0===t||t.stop()}),0)}},t("img",{src:f,class:"buttonImg",alt:this.buttonText}),t("span",null,this.buttonText)))}async getAuthRequest(){let{authenticationRequest:i}=await this.createSession();return i}renderMobileButton(i,e){this.autostart&&!this.supportsDCAPI()&&this.startMobilePolling();let s=!1;const a=i=>{s=i,this.handleCheckAppLoading&&this.handleCheckAppLoading(i)},n=async()=>{a(!0);try{const t=await this.getAuthRequest();this.isAppInstalled(t,(t=>{t||(this.stop(),i?window.location.href="https://play.google.com/store/apps/details?id=com.gataca.identity":e&&(window.location.href="https://apps.apple.com/us/app/gataca/id1498607616")),a(!1)}))}catch(i){this.stop(),a(!1)}};return t("div",{class:"gatacaButtonWrapper"},t("button",{class:"gatacaButton",onClick:()=>{this.gatacaButtonPushed.emit(),n()},disabled:s},t("img",{src:f,class:"buttonImg",alt:this.buttonText}),t("span",null,this.buttonText)))}renderDCAPIButton(i,e){let s=!1;console.log("Maybe act different",i,e);const a=i=>{s=i,this.handleCheckAppLoading&&this.handleCheckAppLoading(i)},n=async()=>{a(!0);try{const i=await this.getAuthRequest();let t=await this.getRequestFromUri(i),e=await navigator.credentials.get({digital:{requests:[{protocol:"openid4vp-v1-unsigned",data:t}]}});"DigitalCredential"==e.constructor.name&&console.log("Digital Credential - Response Data: "+e),await this.fillSession(t,null==e?void 0:e.data)}catch(i){this.stop(),a(!1)}};return t("div",{class:"gatacaButtonWrapper"},t("button",{class:"gatacaButton",onClick:()=>{this.gatacaButtonPushed.emit(),n()},disabled:s},t("img",{src:f,class:"buttonImg",alt:this.buttonDCAPIText}),t("span",null,this.buttonDCAPIText)))}render(){const i=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||(null===navigator||void 0===navigator?void 0:navigator.vendor)||(null===window||void 0===window?void 0:window.opera),e=/android/i.test(i),s=/iPad|iPhone|iPod/.test(i)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,a=e||s,n=this.supportsDCAPI();return t("div",null,t("div",{class:"buttonContainer"},a&&"3"===this.v?this.renderMobileButton(e,s):this.renderDesktopButton(),this.open&&(!a||"3"===this.v)&&this.renderModal()),n&&t("div",{class:"buttonContainer"},this.renderDCAPIButton(e,s)))}};v.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}.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}';export{x as gataca_qr,p as gataca_qrdisplay,v as gataca_ssibutton}
File without changes