var __awaiter=this&&this.__awaiter||function(i,t,n,o){function e(i){return i instanceof n?i:new n((function(t){t(i)}))}return new(n||(n=Promise))((function(n,r){function a(i){try{l(o.next(i))}catch(i){r(i)}}function s(i){try{l(o["throw"](i))}catch(i){r(i)}}function l(i){i.done?n(i.value):e(i.value).then(a,s)}l((o=o.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,e,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(i){return function(t){return l([i,t])}}function l(s){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(n=0)),n)try{if(o=1,e&&(r=s[0]&2?e["return"]:s[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,s[1])).done)return r;if(e=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;e=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]0};i.prototype.renderHintText=function(){var i=this,t=i.helperText,n=i.errorText;return[o("div",{class:"helper-text"},t),o("div",{class:"error-text"},n)]};i.prototype.renderCounter=function(){var i=this,t=i.counter,n=i.maxlength,e=i.counterFormatter,r=i.value;if(t!==true||n===undefined){return}return o("div",{class:"counter"},g(r,n,e))};i.prototype.renderBottomContent=function(){var i=this,t=i.counter,n=i.helperText,e=i.errorText,r=i.maxlength;var a=!!n||!!e;var s=t===true&&r!==undefined;if(!a&&!s){return}return o("div",{class:"input-bottom"},this.renderHintText(),this.renderCounter())};i.prototype.renderLabel=function(){var i=this.label;return o("div",{class:{"label-text-wrapper":true,"label-text-wrapper-hidden":!this.hasLabel}},i===undefined?o("slot",{name:"label"}):o("div",{class:"label-text"},i))};Object.defineProperty(i.prototype,"labelSlot",{get:function(){return this.el.querySelector('[slot="label"]')},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"hasLabel",{get:function(){return this.label!==undefined||this.labelSlot!==null},enumerable:false,configurable:true});i.prototype.renderLabelContainer=function(){var i=this;var t=y(this);var n=t==="md"&&this.fill==="outline";if(n){return[o("div",{class:"input-outline-container"},o("div",{class:"input-outline-start"}),o("div",{class:{"input-outline-notch":true,"input-outline-notch-hidden":!this.hasLabel}},o("div",{class:"notch-spacer","aria-hidden":"true",ref:function(t){return i.notchSpacerEl=t}},this.label)),o("div",{class:"input-outline-end"})),this.renderLabel()]}return this.renderLabel()};i.prototype.renderInput=function(){var i;var t=this;var n=this,r=n.disabled,a=n.fill,s=n.readonly,l=n.shape,p=n.inputId,d=n.labelPlacement,u=n.el,c=n.hasFocus;var h=y(this);var m=this.getValue();var b=f("ion-item",this.el);var g=h==="md"&&a!=="outline"&&!b;var k=this.hasValue();var z=u.querySelector('[slot="start"], [slot="end"]')!==null;var j=d==="stacked"||d==="floating"&&(k||c||z);return o(e,{class:v(this.color,(i={},i[h]=true,i["has-value"]=k,i["has-focus"]=c,i["label-floating"]=j,i["input-fill-".concat(a)]=a!==undefined,i["input-shape-".concat(l)]=l!==undefined,i["input-label-placement-".concat(d)]=true,i["in-item"]=b,i["in-item-color"]=f("ion-item.ion-color",this.el),i["input-disabled"]=r,i))},o("label",{class:"input-wrapper",htmlFor:p},this.renderLabelContainer(),o("div",{class:"native-wrapper"},o("slot",{name:"start"}),o("input",Object.assign({class:"native-input",ref:function(i){return t.nativeInput=i},id:p,disabled:r,accept:this.accept,autoCapitalize:this.autocapitalize,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,enterKeyHint:this.enterkeyhint,inputMode:this.inputmode,min:this.min,max:this.max,minLength:this.minlength,maxLength:this.maxlength,multiple:this.multiple,name:this.name,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:s,required:this.required,spellcheck:this.spellcheck,step:this.step,size:this.size,type:this.type,value:m,onInput:this.onInput,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeydown,onCompositionstart:this.onCompositionStart,onCompositionend:this.onCompositionEnd},this.inheritedAttributes)),this.clearInput&&!s&&!r&&o("button",{"aria-label":"reset",type:"button",class:"input-clear-icon",onPointerDown:function(i){i.preventDefault()},onClick:this.clearTextInput},o("ion-icon",{"aria-hidden":"true",icon:h==="ios"?x:w})),o("slot",{name:"end"})),g&&o("div",{class:"input-highlight"})),this.renderBottomContent())};i.prototype.renderLegacyInput=function(){var i;var t=this;if(!this.hasLoggedDeprecationWarning){m('ion-input now requires providing a label with either the "label" property or the "aria-label" attribute. To migrate, remove any usage of "ion-label" and pass the label text to either the "label" property or the "aria-label" attribute.\n\nExample: \nExample with aria-label: \n\nFor inputs that do not render the label immediately next to the input, developers may continue to use "ion-label" but must manually associate the label with the input by using "aria-labelledby".\n\nDevelopers can use the "legacy" property to continue using the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.',this.el);if(this.legacy){m('ion-input is being used with the "legacy" property enabled which will forcibly enable the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.\n\nDevelopers can dismiss this warning by removing their usage of the "legacy" property and using the new input syntax.',this.el)}this.hasLoggedDeprecationWarning=true}var n=y(this);var r=this.getValue();var a=this.inputId+"-lbl";var s=h(this.el);if(s){s.id=a}return o(e,{"aria-disabled":this.disabled?"true":null,class:v(this.color,(i={},i[n]=true,i["has-value"]=this.hasValue(),i["has-focus"]=this.hasFocus,i["legacy-input"]=true,i["in-item-color"]=f("ion-item.ion-color",this.el),i))},o("input",Object.assign({class:"native-input",ref:function(i){return t.nativeInput=i},"aria-labelledby":s?s.id:null,disabled:this.disabled,accept:this.accept,autoCapitalize:this.autocapitalize,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,enterKeyHint:this.enterkeyhint,inputMode:this.inputmode,min:this.min,max:this.max,minLength:this.minlength,maxLength:this.maxlength,multiple:this.multiple,name:this.name,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readonly,required:this.required,spellcheck:this.spellcheck,step:this.step,size:this.size,type:this.type,value:r,onInput:this.onInput,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeydown},this.inheritedAttributes)),this.clearInput&&!this.readonly&&!this.disabled&&o("button",{"aria-label":"reset",type:"button",class:"input-clear-icon",onPointerDown:function(i){i.preventDefault()},onClick:this.clearTextInput},o("ion-icon",{"aria-hidden":"true",icon:n==="ios"?x:w})))};i.prototype.render=function(){var i=this.legacyFormController;return i.hasLegacyControl()?this.renderLegacyInput():this.renderInput()};Object.defineProperty(i.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(i,"watchers",{get:function(){return{debounce:["debounceChanged"],disabled:["disabledChanged"],placeholder:["placeholderChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return i}());var O=0;_.style={ios:z,md:C}}}}));