/*! * (C) Ionic http://ionicframework.com - MIT License */ import{r as registerInstance,h,f as Host,i as getElement}from"./index-6e4709ff.js";import{p as printIonWarning}from"./index-9b0d46f4.js";import{c as createColorClasses}from"./theme-01f3f29c.js";import{x as eye,y as eyeOff}from"./index-e2cf2ceb.js";import{b as getIonMode}from"./ionic-global-c4e0c089.js";var iosInputPasswordToggleCss="";var IonInputPasswordToggleIosStyle0=iosInputPasswordToggleCss;var mdInputPasswordToggleCss="";var IonInputPasswordToggleMdStyle0=mdInputPasswordToggleCss;var InputPasswordToggle=function(){function e(e){var t=this;registerInstance(this,e);this.togglePasswordVisibility=function(){var e=t.inputElRef;if(!e){return}e.type=e.type==="text"?"password":"text"};this.color=undefined;this.showIcon=undefined;this.hideIcon=undefined;this.type="password"}e.prototype.onTypeChange=function(e){if(e!=="text"&&e!=="password"){printIonWarning('ion-input-password-toggle only supports inputs of type "text" or "password". Input of type "'.concat(e,'" is not compatible.'),this.el);return}};e.prototype.connectedCallback=function(){var e=this.el;var t=this.inputElRef=e.closest("ion-input");if(!t){printIonWarning("No ancestor ion-input found for ion-input-password-toggle. This component must be slotted inside of an ion-input.",e);return}this.type=t.type};e.prototype.disconnectedCallback=function(){this.inputElRef=null};e.prototype.render=function(){var e;var t,o;var n=this,s=n.color,r=n.type;var i=getIonMode(this);var a=(t=this.showIcon)!==null&&t!==void 0?t:eye;var u=(o=this.hideIcon)!==null&&o!==void 0?o:eyeOff;var f=r==="text";return h(Host,{key:"1cb075999e41c2fde3a3d6cafe6f37c9b5429299",class:createColorClasses(s,(e={},e[i]=true,e))},h("ion-button",{key:"cfaaec221f530ecc475690b6508c2333e32ff609",mode:i,color:s,fill:"clear",shape:"round","aria-checked":f?"true":"false","aria-label":"show password",role:"switch",type:"button",onPointerDown:function(e){e.preventDefault()},onClick:this.togglePasswordVisibility},h("ion-icon",{key:"dc0fc5fe8df4df4c145e29b30e589f159aab9cd9",slot:"icon-only","aria-hidden":"true",icon:f?u:a})))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{type:["onTypeChange"]}},enumerable:false,configurable:true});return e}();InputPasswordToggle.style={ios:IonInputPasswordToggleIosStyle0,md:IonInputPasswordToggleMdStyle0};export{InputPasswordToggle as ion_input_password_toggle};