import{r as e,c as n,h as t,d as l}from"./p-b3a13b6a.js";import{P as i}from"./p-cf8a1fb9.js";import"./p-3478f368.js";import"./p-8d78b631.js";const o="pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-level-up-modal .pn-modal-header{z-index:0}pn-level-up-modal .pn-modal{max-width:63.1rem}@media screen and (max-width: 768px){pn-level-up-modal .pn-modal{height:100%;max-height:100%}}pn-level-up-modal .level-up-computer-modal .pn-modal-content .modal-content{justify-self:center;display:flex;flex-wrap:wrap;flex-direction:column;gap:2em;margin:2em;width:max-content;align-content:space-around}pn-level-up-modal .pn-modal-label{margin:2.2rem 0}@media screen and (max-width: 768px){pn-level-up-modal .pn-modal-label{justify-self:center}}@media screen and (max-width: 768px){pn-level-up-modal .level-up-phone-modal .pn-modal-content{height:100%;align-content:center;align-items:center}}pn-level-up-modal .level-up-phone-modal .pn-modal-content pn-spinner{justify-self:center}pn-level-up-modal .level-up-phone-modal .pn-modal-content .modal-content-container{display:flex;flex-direction:row;align-items:center;gap:1em}@media screen and (max-width: 768px){pn-level-up-modal .level-up-phone-modal .pn-modal-content .modal-content-container{flex-direction:column}}pn-level-up-modal .level-up-phone-modal .pn-modal-content .modal-content-list ol{font-size:1.8rem;line-height:1.6;margin-left:2rem;padding-left:2rem}pn-level-up-modal .level-up-phone-modal .pn-modal-content .modal-content-list li{margin-bottom:1rem}@media screen and (max-width: 768px){pn-level-up-modal .level-up-phone-modal .pn-modal-content .modal-content-list ol{font-size:1.6rem}}";const a=o;const d=class{constructor(t){e(this,t);this.modalToggle=n(this,"modalToggle",7);this.open=undefined;this.endpoint=undefined;this.instructionPhoneLineOne=undefined;this.instructionPhoneLineTwo=undefined;this.instructionPhoneLineThree=undefined;this.headingText=undefined;this.outdatedQRMessage=undefined;this.expiresInMessage=undefined;this.system=undefined;this.qrAriaLabel=undefined;this.openModalToggle=false;this.isLoading=true}modalToggle;_bankIDUrl;_levelupService;_levelUpModal;componentWillLoad(){this._levelupService=new i(this.endpoint);this.updateOpen()}updateBankIDUrl=async()=>{this.isLoading=true;let e=await this._levelupService.levelupAuthorize(this.system,null);this.isLoading=false;this._bankIDUrl=e.url;await this._levelupService.levelupTokenGrant(e.id,"30",null).then((e=>{if(e.code===200){this._levelupService.newLevelupUser()}}))};updateOpen(){if(this.open===true){this.handleOpen();this.openModalToggle=true;if(this._levelUpModal){if(this._levelUpModal.open===true){this._levelUpModal.open=false}this._levelUpModal.open=true}}else{this.openModalToggle=false}}handleOpen=async()=>{await this.updateBankIDUrl()};render(){return t(l,{key:"76e1a218f3727ecb7c4ed3031431c9f2396e16f4"},t("pn-modal",{key:"1070592e01333d07085da839772bd89e9bff6f55",ref:e=>this._levelUpModal=e,open:this.open,class:"level-up-phone-modal","allow-overflow":"true",label:this.headingText,onModalToggle:e=>{const n=e.detail;const t=typeof n==="boolean"?n:!!n?.open;this.openModalToggle=t}},this.isLoading?t("pn-spinner",{light:"false",size:"1.5"}):t("div",{class:"modal-content-container"},t("div",{class:"modal-content-qr"},this.openModalToggle&&t("pn-qr-code-generator",{url:this._bankIDUrl,"countdown-seconds":"30","outdated-message":this.outdatedQRMessage,"expires-in-message":this.expiresInMessage,"update-code-every-second":true,"aria-label":this.qrAriaLabel})),t("div",{class:"modal-content-list"},t("ol",null,this.instructionPhoneLineOne&&t("li",null,this.instructionPhoneLineOne),this.instructionPhoneLineTwo&&t("li",null,this.instructionPhoneLineTwo),this.instructionPhoneLineThree&&t("li",null,this.instructionPhoneLineThree))))))}static get watchers(){return{open:["updateOpen"]}}};d.style=a;export{d as pn_level_up_modal};
//# sourceMappingURL=p-7ccca19f.entry.js.map