import {t as tt,i as it}from'./chunk-DJMkHa-W.js';import {I as Ie,H as He,s as se}from'./chunk-BnYaMaxG.js';import {J,c as tS,aV as ut,i as S,aZ as Dt,a7 as si,cI as p,H as ul,U as RN,cN as g,L as w,ac as Dr,b6 as Yi,N as Sr,by as it$1,c5 as bD,f as QT,bg as lt,bh as at,bi as et,X as _z,u as R,a0 as ks,bp as QC,z as vM,bl as dv,bn as Z_,a3 as Py,a2 as Uu,bB as oT,A as Iw,br as ZC,bq as uv,a4 as Sy,F as EM,bC as sT,bu as dy,v as W_,bz as f_,C as Qu}from'./main-WUGO6e7n.js';function X(t,$){if(t&1&&(ks(0,"div",1),W_(1),vM(2,"translate"),Uu()),t&2){let i=f_();Iw(),Qu(" ",EM(2,1,i.titleKey)," ");}}var fe,Y=J(()=>{tS();ut();S();Ie();Dt();tt();si();p();ul();RN();tS();ut();Ie();fe=(()=>{class t extends g{constructor(){super(...arguments),this.licenseEditService=w(it),this.currentUserService=w(Dr),this.messageService=w(Yi),this.translatorService=w(Sr),this.licenseAdded=new it$1,this.titleKey="HaveALicenseKeyAlready",this.licenseKey="";}onQuickAddLicense(){this.isLicenseKeyValid()&&this.licenseEditService.create({key:this.licenseKey,isNew:!0,accept:()=>{this.currentUserService.refreshUserAccount(),this.licenseKey="",this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("LicenseAddedSuccessfully")}),this.licenseAdded.emit();}});}get isAddButtonDisabled(){return !this.isLicenseKeyValid()}isLicenseKeyValid(){if(!this.licenseKey)return !1;let i=this.licenseKey.replace(/-/g,"");return i.length===25&&/^[a-zA-Z0-9]{25}$/.test(i)}static{this.\u0275fac=(()=>{let i;return function(e){return (i||(i=bD(t)))(e||t)}})();}static{this.\u0275cmp=QT({type:t,selectors:[["dvls-quick-add-license"]],inputs:{titleKey:"titleKey"},outputs:{licenseAdded:"licenseAdded"},features:[dy],decls:7,vars:11,consts:[[1,"quick-add-license"],[1,"mb-1.5","text-center","text-sm","text-300"],[1,"quick-add-license-input-group"],["name","licenseKey",3,"ngModelChange","keyup.enter","ngModel","mask","characterPattern","placeholder"],["variant","tertiary",3,"onClick","label","disabled"]],template:function(d,e){d&1&&(ks(0,"div",0),QC(1,X,3,3,"div",1),ks(2,"div",2)(3,"p-inputMask",3),vM(4,"translate"),dv("ngModelChange",function(l){return Z_(e.licenseKey,l)||(e.licenseKey=l),l}),Py("keyup.enter",function(){return e.onQuickAddLicense()}),Uu(),oT(),ks(5,"dvl-button",4),vM(6,"translate"),Py("onClick",function(){return e.onQuickAddLicense()}),Uu()()()),d&2&&(Iw(),ZC(e.titleKey?1:-1),Iw(2),uv("ngModel",e.licenseKey),Sy("mask","*****-*****-*****-*****-*****")("characterPattern","[a-zA-Z0-9]")("placeholder",EM(4,7,"lblEnterLicenseKey")),sT(),Iw(2),Sy("label",EM(6,9,"lblAdd"))("disabled",e.isAddButtonDisabled));},dependencies:[lt,at,et,He,se,_z,R],styles:[".quick-add-license[_ngcontent-%COMP%]{width:100%;margin-left:auto;margin-right:auto}.quick-add-license[_ngcontent-%COMP%]   .quick-add-license-input-group[_ngcontent-%COMP%]{display:flex;align-items:stretch;gap:0}.quick-add-license[_ngcontent-%COMP%]   .quick-add-license-input-group[_ngcontent-%COMP%]     p-inputmask{flex:1;display:flex;min-width:0}.quick-add-license[_ngcontent-%COMP%]   .quick-add-license-input-group[_ngcontent-%COMP%]     p-inputmask .p-inputtext{width:100%;border-radius:4px 0 0 4px;border-right:0}[_nghost-%COMP%]  .quick-add-license-btn{height:100%;padding:0 12px;border:1px solid var(--button-secondary-border);background:var(--button-secondary-fill);color:var(--blue-800);border-radius:0 4px 4px 0;font-size:13px;box-shadow:none}[_nghost-%COMP%]  .quick-add-license-btn .p-button:hover{background:#298dff0f}"],changeDetection:1});}}return t})();});export{Y,fe as f};