import{Aa as P,Ba as O,C as g,Ca as k,D as b,Da as M,Fa as f,Ga as p,Hb as R,Na as I,S as l,X as v,ba as u,da as h,ea as _,na as a,oa as s,ra as x,sa as C,ua as w,v as m,va as c,wa as T,xa as y,ya as E,za as z}from"./chunk-ZVAMPSQU.js";var V=["control"],G=["*"];function L(t,o){if(t&1&&(a(0,"label",1),f(1),s()),t&2){let n=c();u("for",n.inputId),l(),p(n.label)}}function D(t,o){if(t&1&&(a(0,"p",3),f(1),s()),t&2){let n=c();l(),p(n.errorText)}}function Q(t,o){if(t&1&&(a(0,"p",4),f(1),s()),t&2){let n=c();l(),p(n.helperText)}}var F=0,J=(()=>{let o=class o{constructor(){this.invalid=!1,this.disabled=!1,this.rows=4,this.autoGrow=!1,this.autocapitalize="off",this.autocorrect="off",this.spellcheck=!0,this.inputId="rs-text-area-".concat(F++),this.value="",this.onChange=()=>{},this.onTouched=()=>{}}ngAfterViewInit(){this.scheduleResize()}getControlElement(){var e;return(e=this.controlRef)==null?void 0:e.nativeElement}writeValue(e){this.value=e!=null?e:"",this.scheduleResize()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}onInput(e){this.value=e,this.onChange(e),this.resize()}onBlur(){this.onTouched()}scheduleResize(){requestAnimationFrame(()=>this.resize())}resize(){if(!this.autoGrow||!this.controlRef)return;let e=this.controlRef.nativeElement;e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px")}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=v({type:o,selectors:[["text-area"]],viewQuery:function(i,r){if(i&1&&E(V,5),i&2){let d;z(d=P())&&(r.controlRef=d.first)}},inputs:{label:"label",ariaLabel:"ariaLabel",placeholder:"placeholder",helperText:"helperText",errorText:"errorText",invalid:"invalid",disabled:"disabled",name:"name",rows:"rows",autoGrow:"autoGrow",maxlength:"maxlength",autocapitalize:"autocapitalize",autocorrect:"autocorrect",spellcheck:"spellcheck"},features:[I([{provide:R,useExisting:m(()=>o),multi:!0}])],ngContentSelectors:G,decls:6,vars:18,consts:[["control",""],[1,"rs-field__label"],[1,"rs-field__control",3,"input","blur","id","disabled","value"],[1,"rs-field__message","rs-field__message--error"],[1,"rs-field__message"]],template:function(i,r){if(i&1){let d=x();T(),h(0,L,2,2,"label",1),y(1),a(2,"textarea",2,0),w("input",function(){g(d);let S=O(3);return b(r.onInput(S.value))})("blur",function(){return r.onBlur()}),s(),h(4,D,2,1,"p",3)(5,Q,2,1,"p",4)}i&2&&(_(r.label?0:-1),l(2),k("--rs-field-rows",r.rows),M("rs-field__control--invalid",r.invalid)("rs-field__control--autogrow",r.autoGrow),C("id",r.inputId)("disabled",r.disabled)("value",r.value),u("aria-label",r.ariaLabel)("name",r.name)("placeholder",r.placeholder)("maxlength",r.maxlength)("autocapitalize",r.autocapitalize)("autocorrect",r.autocorrect)("spellcheck",r.spellcheck),l(2),_(r.invalid&&r.errorText?4:r.helperText?5:-1))},styles:["[_nghost-%COMP%]{display:block;--rs-field-bg: var(--ion-color-step-50);--rs-field-bg-focus: var(--ion-background-color);--rs-field-border-focus: var(--ion-color-primary);--rs-field-ring: rgba(var(--ion-color-primary-rgb), .2);--rs-field-text: var(--ion-text-color);--rs-field-placeholder: var(--ion-color-step-500);--rs-field-label: var(--ion-color-step-650);--rs-field-helper: var(--ion-color-step-500);--rs-field-error: var(--ion-color-danger);--rs-field-error-ring: rgba(var(--ion-color-danger-rgb, 235, 68, 90), .2);--rs-field-radius: 8px}.rs-field__label[_ngcontent-%COMP%]{display:block;margin-block-end:6px;font-size:.8125rem;font-weight:500;line-height:1.4;color:var(--rs-field-label)}.rs-field__control[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box;margin:0;padding:8px 10px;font-family:inherit;font-size:1rem;line-height:1.5;color:var(--rs-field-text);background:var(--rs-field-bg);border:1px solid transparent;border-radius:var(--rs-field-radius);outline:none;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease}.rs-field__control[_ngcontent-%COMP%]::placeholder{color:var(--rs-field-placeholder);opacity:1}.rs-field__control[_ngcontent-%COMP%]:focus{background:var(--rs-field-bg-focus);border-color:var(--rs-field-border-focus);box-shadow:0 0 0 3px var(--rs-field-ring)}.rs-field__control[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:not-allowed}.rs-field__control--invalid[_ngcontent-%COMP%]{border-color:var(--rs-field-error)}.rs-field__control--invalid[_ngcontent-%COMP%]:focus{border-color:var(--rs-field-error);box-shadow:0 0 0 3px var(--rs-field-error-ring)}.rs-field__message[_ngcontent-%COMP%]{margin:0;margin-block-start:6px;font-size:.75rem;line-height:1.4;color:var(--rs-field-helper)}.rs-field__message--error[_ngcontent-%COMP%]{color:var(--rs-field-error)}.rs-field__control[_ngcontent-%COMP%]{resize:vertical;min-height:calc(1.5em * var(--rs-field-rows, 4) + 20px)}.rs-field__control--autogrow[_ngcontent-%COMP%]{resize:none;overflow:hidden}"]});let t=o;return t})();export{J as a};
