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