var __awaiter=this&&this.__awaiter||function(t,e,a,i){function r(t){return t instanceof a?t:new a((function(e){e(t)}))}return new(a||(a=Promise))((function(a,o){function n(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i["throw"](t))}catch(t){o(t)}}function l(t){t.done?a(t.value):r(t.value).then(n,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(t){return function(e){return l([t,e])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(a=0)),a)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:a.label++;return{value:s[1],done:false};case 5:a.label++;r=s[1];s=[0];continue;case 7:s=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){a=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]\nExample with aria-label: \n\nFor textareas 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 textarea 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);this.hasLoggedDeprecationWarning=true}var a=w(this);var i=this.getValue();var n=this.inputId+"-lbl";var s=m(this.el);if(s){s.id=n}return r(o,{"aria-disabled":this.disabled?"true":null,class:u(this.color,(t={},t[a]=true,t["legacy-textarea"]=true,t))},r("div",{class:"textarea-legacy-wrapper",ref:function(t){return e.textareaWrapper=t}},r("textarea",Object.assign({class:"native-textarea","aria-labelledby":s?s.id:null,ref:function(t){return e.nativeInput=t},autoCapitalize:this.autocapitalize,autoFocus:this.autofocus,enterKeyHint:this.enterkeyhint,inputMode:this.inputmode,disabled:this.disabled,maxLength:this.maxlength,minLength:this.minlength,name:this.name,placeholder:this.placeholder||"",readOnly:this.readonly,required:this.required,spellcheck:this.spellcheck,cols:this.cols,rows:this.rows,wrap:this.wrap,onInput:this.onInput,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeyDown},this.inheritedAttributes),i)))};t.prototype.renderLabel=function(){var t=this.label;return r("div",{class:{"label-text-wrapper":true,"label-text-wrapper-hidden":!this.hasLabel}},t===undefined?r("slot",{name:"label"}):r("div",{class:"label-text"},t))};Object.defineProperty(t.prototype,"labelSlot",{get:function(){return this.el.querySelector('[slot="label"]')},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hasLabel",{get:function(){return this.label!==undefined||this.labelSlot!==null},enumerable:false,configurable:true});t.prototype.renderLabelContainer=function(){var t=this;var e=w(this);var a=e==="md"&&this.fill==="outline";if(a){return[r("div",{class:"textarea-outline-container"},r("div",{class:"textarea-outline-start"}),r("div",{class:{"textarea-outline-notch":true,"textarea-outline-notch-hidden":!this.hasLabel}},r("div",{class:"notch-spacer","aria-hidden":"true",ref:function(e){return t.notchSpacerEl=e}},this.label)),r("div",{class:"textarea-outline-end"})),this.renderLabel()]}return this.renderLabel()};t.prototype.renderHintText=function(){var t=this,e=t.helperText,a=t.errorText;return[r("div",{class:"helper-text"},e),r("div",{class:"error-text"},a)]};t.prototype.renderCounter=function(){var t=this,e=t.counter,a=t.maxlength,i=t.counterFormatter,o=t.value;if(e!==true||a===undefined){return}return r("div",{class:"counter"},f(o,a,i))};t.prototype.renderBottomContent=function(){var t=this,e=t.counter,a=t.helperText,i=t.errorText,o=t.maxlength;var n=!!a||!!i;var s=e===true&&o!==undefined;if(!n&&!s){return}return r("div",{class:"textarea-bottom"},this.renderHintText(),this.renderCounter())};t.prototype.renderTextarea=function(){var t;var e=this;var a=this,i=a.inputId,n=a.disabled,s=a.fill,l=a.shape,d=a.labelPlacement,c=a.el,x=a.hasFocus;var p=w(this);var h=this.getValue();var m=v("ion-item",this.el);var g=p==="md"&&s!=="outline"&&!m;var b=this.hasValue();var f=c.querySelector('[slot="start"], [slot="end"]')!==null;var y=d==="stacked"||d==="floating"&&(b||x||f);return r(o,{class:u(this.color,(t={},t[p]=true,t["has-value"]=b,t["has-focus"]=x,t["label-floating"]=y,t["textarea-fill-".concat(s)]=s!==undefined,t["textarea-shape-".concat(l)]=l!==undefined,t["textarea-label-placement-".concat(d)]=true,t["textarea-disabled"]=n,t))},r("label",{class:"textarea-wrapper",htmlFor:i},this.renderLabelContainer(),r("div",{class:"textarea-wrapper-inner"},r("div",{class:"start-slot-wrapper"},r("slot",{name:"start"})),r("div",{class:"native-wrapper",ref:function(t){return e.textareaWrapper=t}},r("textarea",Object.assign({class:"native-textarea",ref:function(t){return e.nativeInput=t},id:i,disabled:n,autoCapitalize:this.autocapitalize,autoFocus:this.autofocus,enterKeyHint:this.enterkeyhint,inputMode:this.inputmode,minLength:this.minlength,maxLength:this.maxlength,name:this.name,placeholder:this.placeholder||"",readOnly:this.readonly,required:this.required,spellcheck:this.spellcheck,cols:this.cols,rows:this.rows,wrap:this.wrap,onInput:this.onInput,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeyDown},this.inheritedAttributes),h)),r("div",{class:"end-slot-wrapper"},r("slot",{name:"end"}))),g&&r("div",{class:"textarea-highlight"})),this.renderBottomContent())};t.prototype.render=function(){var t=this.legacyFormController;return t.hasLegacyControl()?this.renderLegacyTextarea():this.renderTextarea()};Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{debounce:["debounceChanged"],disabled:["disabledChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return t}());var _=0;C.style={ios:k,md:j}}}}));