import{a as H}from"./chunk-AORLUBLF.js";import{C as q,E as G,a as K}from"./chunk-RYV2RH4B.js";import"./chunk-CV2ZWZQE.js";import{ia as Q,ja as U,la as $,oa as L}from"./chunk-R2UR7BVM.js";import{b as V,c as z,d as R,g as j,j as T}from"./chunk-HKLJ6VPZ.js";import"./chunk-72CHOCZD.js";import{Eb as o,Fb as u,Gb as x,Hb as y,Ib as C,Jb as D,Jc as B,Kb as S,Pb as M,Qb as a,R as O,S as A,Ua as c,Ub as w,Wb as b,Xb as I,Y as F,ac as p,ea as d,fa as f,gb as h,ha as v,kb as E,kc as N,mb as _,na as g,oc as P,tb as s}from"./chunk-56X5LYJH.js";import"./chunk-TSRGIXR5.js";var Y=["input"],Z=(n,l,t)=>({$implicit:n,events:l,index:t});function tt(n,l){if(n&1){let t=S();y(0),o(1,"input",2),M("input",function(i){d(t);let r=a().$implicit,m=a();return f(m.onInput(i,r-1))})("focus",function(i){d(t);let r=a(2);return f(r.onInputFocus(i))})("blur",function(i){d(t);let r=a(2);return f(r.onInputBlur(i))})("paste",function(i){d(t);let r=a(2);return f(r.onPaste(i))})("keydown",function(i){d(t);let r=a(2);return f(r.onKeyDown(i))}),u(),C()}if(n&2){let t=a().$implicit,e=a();c(),s("value",e.getModelValue(t))("maxLength",t===1?e.length:1)("type",e.inputType)("pSize",e.size)("variant",e.variant)("readonly",e.readonly)("disabled",e.disabled)("tabindex",e.tabindex)("pAutoFocus",e.getAutofocus(t))("ngClass",e.styleClass)}}function et(n,l){n&1&&D(0)}function nt(n,l){if(n&1&&(y(0),_(1,et,1,0,"ng-container",3),C()),n&2){let t=a().$implicit,e=a();c(),s("ngTemplateOutlet",e.inputTemplate||e._inputTemplate)("ngTemplateOutletContext",P(2,Z,e.getToken(t-1),e.getTemplateEvents(t-1),t))}}function it(n,l){if(n&1&&(y(0),_(1,tt,2,10,"ng-container",1)(2,nt,2,6,"ng-container",1),C()),n&2){let t=a();c(),s("ngIf",!t.inputTemplate&&!t._inputTemplate),c(),s("ngIf",t.inputTemplate||t._inputTemplate)}}var ot=({dt:n})=>`
.p-inputotp {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.p-inputotp-input {
    text-align: center;
    width: 2.5rem;
}

.p-inputotp-input.p-inputtext-sm {
    text-align: center;
    width: ${n("inputotp.input.sm.width")};
}

.p-inputotp-input.p-inputtext-lg {
    text-align: center;
    width: ${n("inputotp.input.lg.width")};
}
`,rt={root:"p-inputotp p-component",pcInput:"p-inputotp-input"},J=(()=>{class n extends ${name="inputotp";theme=ot;classes=rt;static \u0275fac=(()=>{let t;return function(i){return(t||(t=v(n)))(i||n)}})();static \u0275prov=A({token:n,factory:n.\u0275fac})}return n})();var ut={provide:K,useExisting:O(()=>k),multi:!0},k=(()=>{class n extends L{invalid=!1;disabled=!1;readonly=!1;variant;tabindex=null;length=4;styleClass;mask=!1;integerOnly=!1;autofocus;size;onChange=new g;onFocus=new g;onBlur=new g;inputTemplate;templates;_inputTemplate;tokens=[];onModelChange=()=>{};onModelTouched=()=>{};value;get inputMode(){return this.integerOnly?"numeric":"text"}get inputType(){return this.mask?"password":"text"}_componentStyle=F(J);ngAfterContentInit(){this.templates.forEach(t=>{switch(t.getType()){case"input":this._inputTemplate=t.template;break;default:this._inputTemplate=t.template;break}})}getToken(t){return this.tokens[t]}getTemplateEvents(t){return{input:e=>this.onInput(e,t),keydown:e=>this.onKeyDown(e),focus:e=>this.onFocus.emit(e),blur:e=>this.onBlur.emit(e),paste:e=>this.onPaste(e)}}onInput(t,e){let i=t.target.value;if(e===0&&i.length>1){this.handleOnPaste(i,t),t.stopPropagation();return}this.tokens[e]=i,this.updateModel(t),t.inputType==="deleteContentBackward"?this.moveToPrev(t):(t.inputType==="insertText"||t.inputType==="deleteContentForward")&&this.moveToNext(t)}updateModel(t){let e=this.tokens.join("");this.onModelChange(e),this.onChange.emit({originalEvent:t,value:e})}writeValue(t){t?Array.isArray(t)&&t.length>0?this.value=t.slice(0,this.length):this.value=t.toString().split("").slice(0,this.length):this.value=t,this.updateTokens(),this.cd.markForCheck()}updateTokens(){this.value!==null&&this.value!==void 0?Array.isArray(this.value)?this.tokens=[...this.value]:this.tokens=this.value.toString().split(""):this.tokens=[]}getModelValue(t){return this.tokens[t-1]||""}getAutofocus(t){return t===1?this.autofocus:!1}registerOnChange(t){this.onModelChange=t}registerOnTouched(t){this.onModelTouched=t}moveToPrev(t){let e=this.findPrevInput(t.target);e&&(e.focus(),e.select())}moveToNext(t){let e=this.findNextInput(t.target);e&&(e.focus(),e.select())}findNextInput(t){let e=t.nextElementSibling;if(e)return e.nodeName==="INPUT"?e:this.findNextInput(e)}findPrevInput(t){let e=t.previousElementSibling;if(e)return e.nodeName==="INPUT"?e:this.findPrevInput(e)}onInputFocus(t){t.target.select(),this.onFocus.emit(t)}onInputBlur(t){this.onBlur.emit(t)}onKeyDown(t){if(!(t.altKey||t.ctrlKey||t.metaKey))switch(t.code){case"ArrowLeft":this.moveToPrev(t),t.preventDefault();break;case"ArrowUp":case"ArrowDown":t.preventDefault();break;case"Backspace":t.target.value.length===0&&(this.moveToPrev(t),t.preventDefault());break;case"ArrowRight":this.moveToNext(t),t.preventDefault();break;default:(this.integerOnly&&!(Number(t.key)>=0&&Number(t.key)<=9)||this.tokens.join("").length>=this.length&&t.code!=="Delete")&&t.preventDefault();break}}onPaste(t){if(!this.disabled&&!this.readonly){let e=t.clipboardData.getData("text");e.length&&this.handleOnPaste(e,t),t.preventDefault()}}handleOnPaste(t,e){let i=t.substring(0,this.length+1);(!this.integerOnly||!isNaN(i))&&(this.tokens=i.split(""),this.updateModel(e))}getRange(t){return Array.from({length:t},(e,i)=>i+1)}trackByFn(t){return t}static \u0275fac=(()=>{let t;return function(i){return(t||(t=v(n)))(i||n)}})();static \u0275cmp=h({type:n,selectors:[["p-inputOtp"],["p-inputotp"],["p-input-otp"]],contentQueries:function(e,i,r){if(e&1&&(w(r,Y,4),w(r,Q,4)),e&2){let m;b(m=I())&&(i.inputTemplate=m.first),b(m=I())&&(i.templates=m)}},hostAttrs:[1,"p-inputotp","p-component"],inputs:{invalid:"invalid",disabled:"disabled",readonly:"readonly",variant:"variant",tabindex:"tabindex",length:"length",styleClass:"styleClass",mask:"mask",integerOnly:"integerOnly",autofocus:[2,"autofocus","autofocus",B],size:"size"},outputs:{onChange:"onChange",onFocus:"onFocus",onBlur:"onBlur"},features:[N([ut,J]),E],decls:1,vars:2,consts:[[4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],["type","text","pInputText","",1,"p-inputotp-input",3,"input","focus","blur","paste","keydown","value","maxLength","type","pSize","variant","readonly","disabled","tabindex","pAutoFocus","ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,i){e&1&&_(0,it,3,2,"ng-container",0),e&2&&s("ngForOf",i.getRange(i.length))("ngForTrackBy",i.trackByFn)},dependencies:[T,V,z,R,j,G,q,U],encapsulation:2,changeDetection:0})}return n})();var W=class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=h({type:n,selectors:[["app-account-recovery"]],decls:26,vars:3,consts:[[1,"p-4","rounded-3","d-flex","align-items-center","justify-content-center"],[1,"w-100","text-center"],[1,"w-100","text-center","mb-4"],[1,"font-size-32","d-block","text-center"],[1,"text-main","font-size-24","d-block","text-centerr"],[1,"font-size-32","bg-main-light","p-2","rounded-3","d-inline"],["dir","ltr",1,"my-4","d-flex","justify-content-center","text-center"],[3,"integerOnly","mask","length"],[1,"text-decoration-none","text-black","font-size-24"],[1,"d-flex","justify-content-between","align-items-center","my-4"],[1,"text-decoration-none","text-black"],[1,"text-main","text-decoration-none"],[1,"w-100","mt-4"],["name"," \u062A\u0623\u0643\u064A\u062F","color","bg-main text-white w-100"],[1,"mt-4","d-none"],["src","assets/images/success-icon.png","loading","lazy","alt","success icon"],[1,"success-color","font-size-24","text-center"]],template:function(t,e){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"p",3),p(4,"\u0631\u0645\u0632 \u0627\u0644\u062A\u062D\u0642\u0642"),u(),o(5,"p",4),p(6," \u062A\u0645 \u0627\u0631\u0633\u0627\u0644 \u0643\u0648\u062F \u0644\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641 \u0627\u0644\u0645\u0633\u062C\u0644 \u0644\u062F\u064A\u0646\u0627"),u()(),o(7,"p",5),p(8,"201029061193 +"),u(),o(9,"div")(10,"div",6),x(11,"p-inputotp",7),u(),o(12,"p",8),p(13," 01:56 "),u(),o(14,"div")(15,"div",9)(16,"a",10),p(17," \u0644\u0645 \u0623\u062A\u0644\u0642\u0649 \u0631\u0645\u0632 \u0627\u0644\u062A\u0641\u0639\u064A\u0644\u061F "),u(),o(18,"a",11),p(19," \u0627\u0639\u0627\u062F\u0629 \u0627\u0631\u0633\u0627\u0644 \u0631\u0645\u0632 \u0627\u0644\u062A\u0641\u0639\u064A\u0644 "),u()()(),o(20,"div",12),x(21,"app-button",13),u()(),o(22,"div",14),x(23,"img",15),o(24,"p",16),p(25,"\u062A\u0645 \u0627\u0644\u062A\u062D\u0642\u0642 \u0628\u0646\u062C\u0627\u062D"),u()()()()),t&2&&(c(11),s("integerOnly",!0)("mask",!0)("length",5))},dependencies:[T,k,H],styles:["[_nghost-%COMP%]     .p-inputtext{color:#9b3bea!important;font-size:20px}"]})};export{W as AccountRecoveryComponent};
