!function(){function e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(u){l=!0,a=u}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:e.rules;return new Promise((function(n){Y(),t?(l("startValidate"),X(t).then((function(){"failed"===s.status?(n({name:e.name,message:s.validateMessage}),Z()):(s.status="passed",n(),Z())}))):n()}))},G=function(t){if(v&&e.rules){var n=v.props.validateTrigger,r=T(n).includes(t),a=e.rules.filter((function(e){return e.trigger?T(e.trigger).includes(t):r}));a.length&&_(a)}},ee=function(n){var r=e.maxlength;if(E(r)&&U(n)>r){var a=q();return a&&U(a)===+r?a:function(e,n){return t(e).slice(0,n).join("")}(n,+r)}return n},te=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"onChange";if(t=ee(t),"number"===e.type||"digit"===e.type){var r="number"===e.type;t=j(t,r,r)}if(e.formatter&&n===e.formatTrigger&&(t=e.formatter(t)),f.value&&f.value.value!==t){var a=f.value,i=a.selectionStart,o=a.selectionEnd;f.value.value=t,f.value.setSelectionRange(i,o)}t!==e.modelValue&&l("update:modelValue",t)},ne=function(e){e.target.composing||te(e.target.value)},re=function(){var e;return null==(e=f.value)?void 0:e.blur()},ae=function(){var t=f.value;"textarea"===e.type&&e.autosize&&t&&function(e,t){var n=r();e.style.height="auto";var o=e.scrollHeight;if(i(t)){var l=t.maxHeight,u=t.minHeight;void 0!==l&&(o=Math.min(o,l)),void 0!==u&&(o=Math.max(o,u))}o&&(e.style.height="".concat(o,"px"),a(n))}(t,e.autosize)},ie=function(e){s.focused=!0,l("focus",e),C(ae),H("readonly")&&re()},oe=function(e){H("readonly")||(s.focused=!1,te(q(),"onBlur"),l("blur",e),G("onBlur"),C(ae),W())},le=function(e){return l("clickInput",e)},ue=function(e){return l("clickLeftIcon",e)},ce=function(e){return l("clickRightIcon",e)},se=S((function(){return"boolean"==typeof e.error?e.error:!(!v||!v.props.showError||"failed"!==s.status)||void 0})),fe=S((function(){var e=H("labelWidth");if(e)return{width:w(e)}})),de=function(t){13===t.keyCode&&(v&&v.props.submitOnEnter||"textarea"===e.type||P(t),"search"===e.type&&re());l("keypress",t)},ge=function(){return e.id||"".concat(c,"-input")},ve=function(){var t=Q("control",[H("inputAlign"),{error:se.value,custom:!!u.input,"min-height":"textarea"===e.type&&!e.autosize}]);if(u.input)return B("div",{class:t,onClick:le},[u.input()]);var n,r={id:ge(),ref:f,name:e.name,rows:void 0!==e.rows?+e.rows:void 0,class:t,disabled:H("disabled"),readonly:H("readonly"),autofocus:e.autofocus,placeholder:e.placeholder,autocomplete:e.autocomplete,enterkeyhint:e.enterkeyhint,"aria-labelledby":e.label?"".concat(c,"-label"):void 0,onBlur:oe,onFocus:ie,onInput:ne,onClick:le,onChange:K,onKeypress:de,onCompositionend:K,onCompositionstart:$};return"textarea"===e.type?B("textarea",r,null):B("input",L("number"===(n=e.type)?{type:"text",inputmode:"decimal"}:"digit"===n?{type:"tel",inputmode:"numeric"}:{type:n},r),null)},pe=function(){var t=u["right-icon"];if(e.rightIcon||t)return B("div",{class:Q("right-icon"),onClick:ce},[t?t():B(z,{name:e.rightIcon,classPrefix:e.iconPrefix},null)])},me=function(){if(e.showWordLimit&&e.maxlength){var t=U(q());return B("div",{class:Q("word-limit")},[B("span",{class:Q("word-num")},[t]),O("/"),e.maxlength])}},ye=function(){if(!v||!1!==v.props.showErrorMessage){var t=e.errorMessage||s.validateMessage;if(t){var n=u["error-message"],r=H("errorMessageAlign");return B("div",{class:Q("error-message",r)},[n?n({message:t}):t])}}},be=function(){return[B("div",{class:Q("body")},[ve(),J.value&&B(z,{ref:d,name:e.clearIcon,class:Q("clear")},null),pe(),u.button&&B("div",{class:Q("button")},[u.button()])]),me(),ye()]};return x({blur:re,focus:function(){var e;return null==(e=f.value)?void 0:e.focus()},validate:_,formValue:N,resetValidation:Y,getValidationStatus:function(){return s.status}}),I(k,{customValue:g,resetValidation:Y,validateWithTrigger:G}),A((function(){return e.modelValue}),(function(){te(q()),Y(),G("onChange"),C(ae)})),M((function(){te(q(),e.formatTrigger),C(ae)})),V("touchstart",(function(e){P(e),l("update:modelValue",""),l("clear",e)}),{target:S((function(){var e;return null==(e=d.value)?void 0:e.$el}))}),function(){var t,n,r,a,i=H("disabled"),o=H("labelAlign"),l=(t=H("colon")?":":"",u.label?[u.label(),t]:e.label?B("label",{id:"".concat(c,"-label"),for:ge()},[e.label+t]):void 0),s=function(){var t=u["left-icon"];if(e.leftIcon||t)return B("div",{class:Q("left-icon"),onClick:ue},[t?t():B(z,{name:e.leftIcon,classPrefix:e.iconPrefix},null)])}();return B(R,{size:e.size,class:Q((n={error:se.value,disabled:i},r="label-".concat(o),a=o,r in n?Object.defineProperty(n,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[r]=a,n)),center:e.center,border:e.border,isLink:e.isLink,clickable:e.clickable,titleStyle:fe.value,valueClass:Q("value"),titleClass:[Q("label",[o,{required:e.required}]),e.labelClass],arrowDirection:e.arrowDirection},{icon:s&&"top"!==o?function(){return s}:null,title:l||"top"===o?function(){return"top"===o?[s,l]:l}:null,value:be,extra:u.extra})}}});n("F",q(Z))}}}))}();