import{A as et,a as K,c as q,g as J,l as tt}from"./chunk-7VHQBARM.js";import{a as M}from"./chunk-ZJ7WKAH3.js";import{$ as D,Ab as j,Bb as O,Cb as H,Da as s,Db as $,Ea as b,Hb as U,Ib as X,Jb as z,Kb as T,Lb as I,Na as R,Nb as Q,Oa as v,Ob as Y,Va as k,Wa as p,Wf as nt,X as N,Y as A,ba as C,db as m,eb as c,ec as P,fb as f,jb as E,la as u,lc as Z,ma as d,nb as F,rb as g,sb as h,sc as w,tb as V,ub as G,uc as W,yb as L,zb as B}from"./chunk-QXV2GR6R.js";import{i as r}from"./chunk-JJ4RDTEF.js";var S=class{constructor(t,a){this._document=a;let e=this._textarea=this._document.createElement("textarea"),o=e.style;o.position="fixed",o.top=o.opacity="0",o.left="-999em",e.setAttribute("aria-hidden","true"),e.value=t,e.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(e);}copy(){let t=this._textarea,a=!1;try{if(t){let e=this._document.activeElement;t.select(),t.setSelectionRange(0,t.value.length),a=this._document.execCommand("copy"),e&&e.focus();}}catch{}return a;}destroy(){let t=this._textarea;t&&(t.remove(),this._textarea=void 0);}},x=(()=>{let t=class t{constructor(e){this._document=e;}copy(e){let o=this.beginCopy(e),n=o.copy();return o.destroy(),n;}beginCopy(e){return new S(e,this._document);}};t.ɵfac=function(o){return new(o||t)(D(Z));},t.ɵprov=A({token:t,factory:t.ɵfac,providedIn:"root"});let i=t;return i;})();var at=["*"],pt=(i,t)=>({"is-input-group":i,"with-border":t}),ot=(()=>{let t=class t{constructor(e,o){r(this,"notifier");r(this,"clipboard");r(this,"value");r(this,"elementContent");r(this,"title");r(this,"notification");r(this,"withBorder",!1);r(this,"isInputGroup",!1);this.notifier=e,this.clipboard=o;}copy(){var e;this.clipboard.copy(this.value||((e=this.elementContent)==null?void 0:e.innerText)),this.notification&&this.notifier.success(this.notification);}};r(t,"\u0275fac",function(o){return new(o||t)(b(nt),b(x));}),r(t,"\u0275cmp",C({type:t,selectors:[["my-copy-button"]],inputs:{value:"value",elementContent:"elementContent",title:"title",notification:"notification",withBorder:[2,"withBorder","withBorder",P],isInputGroup:[2,"isInputGroup","isInputGroup",P]},standalone:!0,features:[T([x]),R,I],ngContentSelectors:at,decls:3,vars:5,consts:[["type","button",1,"btn","copy-button",3,"click","title","ngClass"],["iconName","copy"]],template:function(o,n){o&1&&(V(),m(0,"button",0),g("click",function(){return n.copy();}),f(1,"my-global-icon",1),G(2),c()),o&2&&p("title",n.title)("ngClass",Y(2,pt,n.isInputGroup,n.withBorder));},dependencies:[w,M],styles:[`button[_ngcontent-%COMP%]:not(.with-border, .is-input-group)[_ngcontent-%COMP%]{border:0}.is-input-group[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}my-global-icon[_ngcontent-%COMP%]{display:inline-block;width:15px;height:15px;line-height:15px;margin-inline-end:.3125rem}
/*# sourceMappingURL=copy-button.component-O5AJQ3QA.css.map */`]}));let i=t;return i;})();var lt=["input"],st=i=>({"input-error":i});function ct(i,t){i&1&&f(0,"my-global-icon",10);}function ut(i,t){i&1&&f(0,"my-global-icon",11);}function dt(i,t){if(i&1){let a=E();m(0,"button",7),g("click",function(){u(a);let o=h();return d(o.toggle());}),v(1,ct,1,0,"my-global-icon",8)(2,ut,1,0,"my-global-icon",9),c();}if(i&2){let a=h();p("title",a.toggleTitle),s(),p("ngIf",a.show),s(),p("ngIf",!a.show);}}function mt(i,t){if(i&1&&(m(0,"my-copy-button",12),F(1,1),c()),i&2){h();let a=O(2);p("value",a.value)("isInputGroup",!0);}}function gt(i,t){if(i&1&&(m(0,"div",13),H(1),c()),i&2){let a=h();s(),$(a.formError);}}var Gt=(()=>{let t=class t{constructor(){r(this,"inputElement");r(this,"inputId");r(this,"value","");r(this,"autocomplete","off");r(this,"placeholder","");r(this,"tabindex",0);r(this,"withToggle",!0);r(this,"withCopy",!1);r(this,"readonly",!1);r(this,"show",!1);r(this,"formError");r(this,"autofocus",!1);r(this,"ariaLabel");r(this,"propagateChange",e=>{});}get inputType(){return this.show?"text":"password";}get toggleTitle(){return this.show?"Ocultar":"Mostrar";}ngAfterViewInit(){this.autofocus===!0&&this.inputElement.nativeElement.focus({preventScroll:!0});}toggle(){this.show=!this.show;}writeValue(e){this.value=e;}registerOnChange(e){this.propagateChange=e;}registerOnTouched(){}update(){this.propagateChange(this.value);}focus(){this.inputElement.nativeElement.focus({preventScroll:!0});}};r(t,"\u0275fac",function(o){return new(o||t)();}),r(t,"\u0275cmp",C({type:t,selectors:[["my-input-text"]],viewQuery:function(o,n){if(o&1&&L(lt,5),o&2){let l;B(l=j())&&(n.inputElement=l.first);}},inputs:{inputId:"inputId",value:"value",autocomplete:"autocomplete",placeholder:"placeholder",tabindex:"tabindex",withToggle:"withToggle",withCopy:"withCopy",readonly:"readonly",show:"show",formError:"formError",autofocus:"autofocus",ariaLabel:"ariaLabel"},standalone:!0,features:[T([{provide:K,useExisting:N(()=>t),multi:!0}]),I],decls:6,vars:16,consts:()=>{let e;e="Copiado";let o;return o="COPIAR",[["input",""],o,[1,"input-group"],[1,"form-control",3,"ngModelChange","click","input","change","id","name","autocomplete","value","placeholder","tabindex","ngModel","readonly","type","ngClass"],["type","button","class","btn",3,"title","click",4,"ngIf"],["notification",e,3,"value","isInputGroup",4,"ngIf"],["class","form-error","role","alert",4,"ngIf"],["type","button",1,"btn",3,"click","title"],["iconName","eye-open",4,"ngIf"],["iconName","eye-close",4,"ngIf"],["iconName","eye-open"],["iconName","eye-close"],["notification",e,3,"value","isInputGroup"],["role","alert",1,"form-error"]];},template:function(o,n){if(o&1){let l=E();m(0,"div",2)(1,"input",3,0),z("ngModelChange",function(_){return u(l),X(n.value,_)||(n.value=_),d(_);}),g("ngModelChange",function(){return u(l),d(n.update());})("click",function(){u(l);let _=O(2);return d(_.select());})("input",function(){return u(l),d(n.update());})("change",function(){return u(l),d(n.update());}),c(),v(3,dt,3,3,"button",4)(4,mt,2,2,"my-copy-button",5),c(),v(5,gt,2,1,"div",6);}o&2&&(s(),p("id",n.inputId)("name",n.inputId)("autocomplete",n.autocomplete)("value",n.value)("placeholder",n.placeholder)("tabindex",n.tabindex),U("ngModel",n.value),p("readonly",n.readonly)("type",n.inputType)("ngClass",Q(14,st,n.formError)),k("aria-label",n.ariaLabel),s(2),p("ngIf",n.withToggle),s(),p("ngIf",n.withCopy),s(),p("ngIf",n.formError));},dependencies:[et,q,J,tt,w,W,M,ot],styles:[`input[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:auto;max-width:auto;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px;padding-inline-start:.9375rem!important;padding-inline-end:.9375rem!important}input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[_ngcontent-%COMP%]:focus, input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: calc(auto + 40px)){input[_ngcontent-%COMP%]{width:100%}}.btn[_ngcontent-%COMP%], my-copy-button[_ngcontent-%COMP%]     .btn{background-color:var(--bg-secondary-400);border-left:1px solid var(--bg)}.btn[_ngcontent-%COMP%]:hover, my-copy-button[_ngcontent-%COMP%]     .btn:hover{background-color:var(--bg-secondary-450)}.btn[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:0;right:0;display:inline-block;width:18px;height:18px;line-height:18px}.btn[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{margin-inline-end:.1875rem}.copy-text[_ngcontent-%COMP%]{font-size:14px;margin-left:5px;vertical-align:top}
/*# sourceMappingURL=input-text.component-3ZBLLAB7.css.map */`]}));let i=t;return i;})();export{ot as a,Gt as b};/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*///# sourceMappingURL=chunk-EN3GHNYR.js.map