????

Your IP : 3.144.6.159


Current Path : C:/inetpub/vhost/sdoc.nextform.vn/www/assets/
Upload File :
Current File : C:/inetpub/vhost/sdoc.nextform.vn/www/assets/SelectCustom-701e5fac.js

import{P as a,R as g,W as le,j as T,U as ce,r as ue}from"./index-727ccf4d.js";import{e as fe,a as pe,T as H,k as de,f as he,g as me,h as ge,j as ye,_ as x,m as b,s as be,o as Oe,t as $}from"./Button-9330b92c.js";import{F as j}from"./Fade-7cf1057f.js";import{I as ve}from"./Input-ae2484bb.js";import{S as xe}from"./DataSelect-00074039.js";function V(r){"@babel/helpers - typeof";return V=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V(r)}function we(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Z(r,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}function Ce(r,e,n){return e&&Z(r.prototype,e),n&&Z(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function _e(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&L(r,e)}function L(r,e){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,t){return o.__proto__=t,o},L(r,e)}function Se(r){var e=ke();return function(){var o=B(r),t;if(e){var i=B(this).constructor;t=Reflect.construct(o,arguments,i)}else t=o.apply(this,arguments);return Ne(this,t)}}function Ne(r,e){if(e&&(V(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pe(r)}function Pe(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ke(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(r){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},B(r)}var Te={children:a.node.isRequired,node:a.any},ne=function(r){_e(n,r);var e=Se(n);function n(){return we(this,n),e.apply(this,arguments)}return Ce(n,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return fe?(!this.props.node&&!this.defaultNode&&(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),le.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),n}(g.Component);ne.propTypes=Te;const Fe=ne;function U(r){"@babel/helpers - typeof";return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(r)}function J(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),n.push.apply(n,o)}return n}function P(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?J(Object(n),!0).forEach(function(o){k(r,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(n,o))})}return r}function D(){return D=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},D.apply(this,arguments)}function k(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function Ee(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(r,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}function je(r,e,n){return e&&Q(r.prototype,e),n&&Q(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function De(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&K(r,e)}function K(r,e){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,t){return o.__proto__=t,o},K(r,e)}function Ae(r){var e=Re();return function(){var o=R(r),t;if(e){var i=R(this).constructor;t=Reflect.construct(o,arguments,i)}else t=o.apply(this,arguments);return Be(this,t)}}function Be(r,e){if(e&&(U(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(r)}function y(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Re(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function R(r){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},R(r)}function I(){}var X=a.shape(j.propTypes),oe={autoFocus:a.bool,backdrop:a.oneOfType([a.bool,a.oneOf(["static"])]),backdropClassName:a.string,backdropTransition:X,centered:a.bool,children:a.node,contentClassName:a.string,className:a.string,container:pe,cssModule:a.object,external:a.node,fade:a.bool,fullscreen:a.oneOfType([a.bool,a.oneOf(["sm","md","lg","xl"])]),innerRef:a.oneOfType([a.object,a.string,a.func]),isOpen:a.bool,keyboard:a.bool,labelledBy:a.string,modalClassName:a.string,modalTransition:X,onClosed:a.func,onEnter:a.func,onExit:a.func,onOpened:a.func,returnFocusAfterClose:a.bool,role:a.string,scrollable:a.bool,size:a.string,toggle:a.func,trapFocus:a.bool,unmountOnClose:a.bool,wrapClassName:a.string,zIndex:a.oneOfType([a.number,a.string])},Ie=Object.keys(oe),Me={isOpen:!1,autoFocus:!0,centered:!1,scrollable:!1,role:"dialog",backdrop:!0,keyboard:!0,zIndex:1050,fade:!0,onOpened:I,onClosed:I,modalTransition:{timeout:H.Modal},backdropTransition:{mountOnEnter:!0,timeout:H.Fade},unmountOnClose:!0,returnFocusAfterClose:!0,container:"body",trapFocus:!1},A=function(r){De(n,r);var e=Ae(n);function n(o){var t;return Ee(this,n),t=e.call(this,o),t._element=null,t._originalBodyPadding=null,t.getFocusableChildren=t.getFocusableChildren.bind(y(t)),t.handleBackdropClick=t.handleBackdropClick.bind(y(t)),t.handleBackdropMouseDown=t.handleBackdropMouseDown.bind(y(t)),t.handleEscape=t.handleEscape.bind(y(t)),t.handleStaticBackdropAnimation=t.handleStaticBackdropAnimation.bind(y(t)),t.handleTab=t.handleTab.bind(y(t)),t.onOpened=t.onOpened.bind(y(t)),t.onClosed=t.onClosed.bind(y(t)),t.manageFocusAfterClose=t.manageFocusAfterClose.bind(y(t)),t.clearBackdropAnimationTimeout=t.clearBackdropAnimationTimeout.bind(y(t)),t.trapFocus=t.trapFocus.bind(y(t)),t.state={isOpen:!1,showStaticBackdropAnimation:!1},t}return je(n,[{key:"componentDidMount",value:function(){var t=this.props,i=t.isOpen,s=t.autoFocus,l=t.onEnter;i&&(this.init(),this.setState({isOpen:!0}),s&&this.setFocus()),l&&l(),document.addEventListener("focus",this.trapFocus,!0),this._isMounted=!0}},{key:"componentDidUpdate",value:function(t,i){if(this.props.isOpen&&!t.isOpen){this.init(),this.setState({isOpen:!0});return}this.props.autoFocus&&this.state.isOpen&&!i.isOpen&&this.setFocus(),this._element&&t.zIndex!==this.props.zIndex&&(this._element.style.zIndex=this.props.zIndex)}},{key:"componentWillUnmount",value:function(){this.clearBackdropAnimationTimeout(),this.props.onExit&&this.props.onExit(),this._element&&(this.destroy(),(this.props.isOpen||this.state.isOpen)&&this.close()),document.removeEventListener("focus",this.trapFocus,!0),this._isMounted=!1}},{key:"handleBackdropClick",value:function(t){if(t.target===this._mouseDownElement){t.stopPropagation();var i=this._dialog?this._dialog.parentNode:null;if(i&&t.target===i&&this.props.backdrop==="static"&&this.handleStaticBackdropAnimation(),!this.props.isOpen||this.props.backdrop!==!0)return;i&&t.target===i&&this.props.toggle&&this.props.toggle(t)}}},{key:"handleTab",value:function(t){if(t.which===9&&!(this.modalIndex<n.openCount-1)){var i=this.getFocusableChildren(),s=i.length;if(s!==0){for(var l=this.getFocusedChild(),u=0,c=0;c<s;c+=1)if(i[c]===l){u=c;break}t.shiftKey&&u===0?(t.preventDefault(),i[s-1].focus()):!t.shiftKey&&u===s-1&&(t.preventDefault(),i[0].focus())}}}},{key:"handleBackdropMouseDown",value:function(t){this._mouseDownElement=t.target}},{key:"handleEscape",value:function(t){this.props.isOpen&&t.keyCode===de.esc&&this.props.toggle&&(this.props.keyboard?(t.preventDefault(),t.stopPropagation(),this.props.toggle(t)):this.props.backdrop==="static"&&(t.preventDefault(),t.stopPropagation(),this.handleStaticBackdropAnimation()))}},{key:"handleStaticBackdropAnimation",value:function(){var t=this;this.clearBackdropAnimationTimeout(),this.setState({showStaticBackdropAnimation:!0}),this._backdropAnimationTimeout=setTimeout(function(){t.setState({showStaticBackdropAnimation:!1})},100)}},{key:"onOpened",value:function(t,i){this.props.onOpened(),(this.props.modalTransition.onEntered||I)(t,i)}},{key:"onClosed",value:function(t){var i=this.props.unmountOnClose;this.props.onClosed(),(this.props.modalTransition.onExited||I)(t),i&&this.destroy(),this.close(),this._isMounted&&this.setState({isOpen:!1})}},{key:"setFocus",value:function(){this._dialog&&this._dialog.parentNode&&typeof this._dialog.parentNode.focus=="function"&&this._dialog.parentNode.focus()}},{key:"getFocusableChildren",value:function(){return this._element.querySelectorAll(he.join(", "))}},{key:"getFocusedChild",value:function(){var t,i=this.getFocusableChildren();try{t=document.activeElement}catch{t=i[0]}return t}},{key:"trapFocus",value:function(t){if(this.props.trapFocus&&this._element&&!(this._dialog&&this._dialog.parentNode===t.target)&&!(this.modalIndex<n.openCount-1)){for(var i=this.getFocusableChildren(),s=0;s<i.length;s+=1)if(i[s]===t.target)return;i.length>0&&(t.preventDefault(),t.stopPropagation(),i[0].focus())}}},{key:"init",value:function(){try{this._triggeringElement=document.activeElement}catch{this._triggeringElement=null}this._element||(this._element=document.createElement("div"),this._element.setAttribute("tabindex","-1"),this._element.style.position="relative",this._element.style.zIndex=this.props.zIndex,this._mountContainer=me(this.props.container),this._mountContainer.appendChild(this._element)),this._originalBodyPadding=ge(),n.openCount<1&&(n.originalBodyOverflow=window.getComputedStyle(document.body).overflow),ye(),n.openCount===0&&(document.body.className=x(document.body.className,b("modal-open",this.props.cssModule)),document.body.style.overflow="hidden"),this.modalIndex=n.openCount,n.openCount+=1}},{key:"destroy",value:function(){this._element&&(this._mountContainer.removeChild(this._element),this._element=null),this.manageFocusAfterClose()}},{key:"manageFocusAfterClose",value:function(){if(this._triggeringElement){var t=this.props.returnFocusAfterClose;this._triggeringElement.focus&&t&&this._triggeringElement.focus(),this._triggeringElement=null}}},{key:"close",value:function(){if(n.openCount<=1){var t=b("modal-open",this.props.cssModule),i=new RegExp("(^| )".concat(t,"( |$)"));document.body.className=document.body.className.replace(i," ").trim(),document.body.style.overflow=n.originalBodyOverflow}this.manageFocusAfterClose(),n.openCount=Math.max(0,n.openCount-1),be(this._originalBodyPadding)}},{key:"clearBackdropAnimationTimeout",value:function(){this._backdropAnimationTimeout&&(clearTimeout(this._backdropAnimationTimeout),this._backdropAnimationTimeout=void 0)}},{key:"renderModalDialog",value:function(){var t,i=this,s=Oe(this.props,Ie),l="modal-dialog";return g.createElement("div",D({},s,{className:b(x(l,this.props.className,(t={},k(t,"modal-".concat(this.props.size),this.props.size),k(t,"".concat(l,"-centered"),this.props.centered),k(t,"".concat(l,"-scrollable"),this.props.scrollable),k(t,"modal-fullscreen",this.props.fullscreen===!0),k(t,"modal-fullscreen-".concat(this.props.fullscreen,"-down"),typeof this.props.fullscreen=="string"),t)),this.props.cssModule),role:"document",ref:function(c){i._dialog=c}}),g.createElement("div",{className:b(x("modal-content",this.props.contentClassName),this.props.cssModule)},this.props.children))}},{key:"render",value:function(){var t=this.props.unmountOnClose;if(this._element&&(this.state.isOpen||!t)){var i=!!this._element&&!this.state.isOpen&&!t;this._element.style.display=i?"none":"block";var s=this.props,l=s.wrapClassName,u=s.modalClassName,c=s.backdropClassName,f=s.cssModule,p=s.isOpen,d=s.backdrop,m=s.role,O=s.labelledBy,v=s.external,w=s.innerRef,S={onClick:this.handleBackdropClick,onMouseDown:this.handleBackdropMouseDown,onKeyUp:this.handleEscape,onKeyDown:this.handleTab,style:{display:"block"},"aria-labelledby":O,"aria-modal":!0,role:m,tabIndex:"-1"},h=this.props.fade,C=P(P(P({},j.defaultProps),this.props.modalTransition),{},{baseClass:h?this.props.modalTransition.baseClass:"",timeout:h?this.props.modalTransition.timeout:0}),N=P(P(P({},j.defaultProps),this.props.backdropTransition),{},{baseClass:h?this.props.backdropTransition.baseClass:"",timeout:h?this.props.backdropTransition.timeout:0}),F=d&&(h?g.createElement(j,D({},N,{in:p&&!!d,cssModule:f,className:b(x("modal-backdrop",c),f)})):g.createElement("div",{className:b(x("modal-backdrop","show",c),f)}));return g.createElement(Fe,{node:this._element},g.createElement("div",{className:b(l)},g.createElement(j,D({},S,C,{in:p,onEntered:this.onOpened,onExited:this.onClosed,cssModule:f,className:b(x("modal",u,this.state.showStaticBackdropAnimation&&"modal-static"),f),innerRef:w}),v,this.renderModalDialog()),F))}return null}}]),n}(g.Component);A.propTypes=oe;A.defaultProps=Me;A.openCount=0;A.originalBodyOverflow=null;const lt=A;var $e=["className","cssModule","children","toggle","tag","wrapTag","closeAriaLabel","close"];function z(){return z=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},z.apply(this,arguments)}function Ve(r,e){if(r==null)return{};var n=Le(r,e),o,t;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(t=0;t<i.length;t++)o=i[t],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(r,o)&&(n[o]=r[o])}return n}function Le(r,e){if(r==null)return{};var n={},o=Object.keys(r),t,i;for(i=0;i<o.length;i++)t=o[i],!(e.indexOf(t)>=0)&&(n[t]=r[t]);return n}var Ue={children:a.node,className:a.string,close:a.object,closeAriaLabel:a.string,cssModule:a.object,tag:$,toggle:a.func,wrapTag:$};function Ke(r){var e,n=r.className,o=r.cssModule,t=r.children,i=r.toggle,s=r.tag,l=s===void 0?"h5":s,u=r.wrapTag,c=u===void 0?"div":u,f=r.closeAriaLabel,p=f===void 0?"Close":f,d=r.close,m=Ve(r,$e),O=b(x(n,"modal-header"),o);return!d&&i&&(e=g.createElement("button",{type:"button",onClick:i,className:b("btn-close",o),"aria-label":p})),g.createElement(c,z({},m,{className:O}),g.createElement(l,{className:b("modal-title",o)},t),d||e)}Ke.propTypes=Ue;var ze=["className","cssModule","tag"];function W(){return W=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},W.apply(this,arguments)}function We(r,e){if(r==null)return{};var n=Ge(r,e),o,t;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(t=0;t<i.length;t++)o=i[t],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(r,o)&&(n[o]=r[o])}return n}function Ge(r,e){if(r==null)return{};var n={},o=Object.keys(r),t,i;for(i=0;i<o.length;i++)t=o[i],!(e.indexOf(t)>=0)&&(n[t]=r[t]);return n}var qe={className:a.string,cssModule:a.object,tag:$};function He(r){var e=r.className,n=r.cssModule,o=r.tag,t=o===void 0?"div":o,i=We(r,ze),s=b(x(e,"modal-body"),n);return g.createElement(t,W({},i,{className:s}))}He.propTypes=qe;function _(){}function Ze(){return!0}function E(r){return!!(r||"").match(/\d/)}function Y(r){return r.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Je(r){switch(r){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Qe(r,e,n){const o=Je(n);let t=r.search(/[1-9]/);return t=t===-1?r.length:t,r.substring(0,t)+r.substring(t,r.length).replace(o,"$1"+e)}function G(r,e=!0){const n=r[0]==="-",o=n&&e;r=r.replace("-","");const t=r.split("."),i=t[0],s=t[1]||"";return{beforeDecimal:i,afterDecimal:s,hasNagation:n,addNegation:o}}function Xe(r){if(!r)return r;const e=r[0]==="-";e&&(r=r.substring(1,r.length));const n=r.split("."),o=n[0].replace(/^0+/,"")||"0",t=n[1]||"";return`${e?"-":""}${o}${t?`.${t}`:""}`}function re(r,e,n){let o="";const t=n?"0":"";for(let i=0;i<=e-1;i++)o+=r[i]||t;return o}function Ye(r,e,n){if(["","-"].indexOf(r)!==-1)return r;const o=r.indexOf(".")!==-1&&e,{beforeDecimal:t,afterDecimal:i,hasNagation:s}=G(r),l=parseFloat(`0.${i||"0"}`).toFixed(e).split("."),u=t.split("").reverse().reduce((d,m,O)=>d.length>O?(Number(d[0])+Number(m)).toString()+d.substring(1,d.length):m+d,l[0]),c=re(l[1]||"",Math.min(e,i.length),n);return`${s?"-":""}${u}${o?".":""}${c}`}function et(r,e){const n={};return Object.keys(r).forEach(o=>{e[o]||(n[o]=r[o])}),n}function ee(r,e){if(r!==null){if(r.createTextRange){const n=r.createTextRange();return n.move("character",e),n.select(),!0}return r.selectionStart||r.selectionStart===0?(r.focus(),r.setSelectionRange(e,e),!0):(r.focus(),!1)}}function tt(r,e){let n=0,o=0;const t=r.length,i=e.length;for(;r[n]===e[n]&&n<t;)n++;for(;r[t-1-o]===e[i-1-o]&&i-o>n&&t-o>n;)o++;return{start:n,end:t-o}}function M(r,e,n){return Math.min(Math.max(r,e),n)}function te(r){return Math.max(r.selectionStart,r.selectionEnd)}const ie={thousandSeparator:a.oneOfType([a.string,a.oneOf([!0])]),decimalSeparator:a.string,thousandsGroupStyle:a.oneOf(["thousand","lakh","wan"]),decimalScale:a.number,fixedDecimalScale:a.bool,displayType:a.oneOf(["input","text"]),prefix:a.string,suffix:a.string,format:a.oneOfType([a.string,a.func]),removeFormatting:a.func,mask:a.oneOfType([a.string,a.arrayOf(a.string)]),value:a.oneOfType([a.number,a.string]),defaultValue:a.oneOfType([a.number,a.string]),isNumericString:a.bool,customInput:a.elementType,allowNegative:a.bool,allowEmptyFormatting:a.bool,allowLeadingZeros:a.bool,onValueChange:a.func,onKeyDown:a.func,onMouseUp:a.func,onChange:a.func,onFocus:a.func,onBlur:a.func,type:a.oneOf(["text","tel","password"]),isAllowed:a.func,renderText:a.func,getInputRef:a.func},nt={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:_,onChange:_,onKeyDown:_,onMouseUp:_,onFocus:_,onBlur:_,isAllowed:Ze,getInputRef:_};let q=class extends g.Component{constructor(e){super(e);const{defaultValue:n}=e;this.validateProps();const o=this.formatValueProp(n);this.state={value:o,numAsString:this.removeFormatting(o)},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}componentDidUpdate(e){this.updateValueIfRequired(e)}updateValueIfRequired(e){const{props:n,state:o,focusedElm:t}=this,{value:i,numAsString:s=""}=o;if(e!==n){this.validateProps();const l=this.formatNumString(s),u=n.value===void 0?l:this.formatValueProp(),c=this.removeFormatting(u),f=parseFloat(c),p=parseFloat(s);((!isNaN(f)||!isNaN(p))&&f!==p||l!==i||t===null&&u!==i)&&this.updateValue({formattedValue:u,numAsString:c,input:t})}}getFloatString(e=""){const{decimalScale:n}=this.props,{decimalSeparator:o}=this.getSeparators(),t=this.getNumberRegex(!0),i=e[0]==="-";i&&(e=e.replace("-","")),o&&n===0&&(e=e.split(o)[0]),e=(e.match(t)||[]).join("").replace(o,".");const s=e.indexOf(".");return s!==-1&&(e=`${e.substring(0,s)}.${e.substring(s+1,e.length).replace(new RegExp(Y(o),"g"),"")}`),i&&(e="-"+e),e}getNumberRegex(e,n){const{format:o,decimalScale:t}=this.props,{decimalSeparator:i}=this.getSeparators();return new RegExp("\\d"+(i&&t!==0&&!n&&!o?"|"+Y(i):""),e?"g":void 0)}getSeparators(){const{decimalSeparator:e}=this.props;let{thousandSeparator:n}=this.props;return n===!0&&(n=","),{decimalSeparator:e,thousandSeparator:n}}getMaskAtIndex(e){const{mask:n=" "}=this.props;return typeof n=="string"?n:n[e]||" "}getValueObject(e,n){const o=parseFloat(n);return{formattedValue:e,value:n,floatValue:isNaN(o)?void 0:o}}validateProps(){const{mask:e}=this.props,{decimalSeparator:n,thousandSeparator:o}=this.getSeparators();if(n===o)throw new Error(`
          Decimal separator can't be same as thousand separator.
          thousandSeparator: ${o} (thousandSeparator = {true} is same as thousandSeparator = ",")
          decimalSeparator: ${n} (default value for decimalSeparator is .)
       `);if(e&&(e==="string"?e:e.toString()).match(/\d/g))throw new Error(`
          Mask ${e} should not contain numeric character;
        `)}setPatchedCaretPosition(e,n,o){ee(e,n),setTimeout(()=>{e.value===o&&ee(e,n)},0)}correctCaretPosition(e,n,o){const{prefix:t,suffix:i,format:s}=this.props;if(e==="")return 0;if(n=M(n,0,e.length),!s){const m=e[0]==="-";return M(n,t.length+(m?1:0),e.length-i.length)}if(typeof s=="function"||s[n]==="#"&&E(e[n])||s[n-1]==="#"&&E(e[n-1]))return n;const l=s.indexOf("#"),u=s.lastIndexOf("#");n=M(n,l,u+1);const c=s.substring(n,s.length).indexOf("#");let f=n;const p=n+(c===-1?0:c);for(;f>l&&(s[f]!=="#"||!E(e[f]));)f-=1;return!E(e[p])||o==="left"&&n!==l||n-f<p-n?E(e[f])?f+1:f:p}getCaretPosition(e,n,o){const{format:t}=this.props,i=this.state.value,s=this.getNumberRegex(!0),l=(e.match(s)||[]).join(""),u=(n.match(s)||[]).join("");let c,f;for(c=0,f=0;f<o;f++){const p=e[f]||"",d=n[c]||"";if(!(!p.match(s)&&p!==d)&&!(p==="0"&&d.match(s)&&d!=="0"&&l.length!==u.length)){for(;p!==n[c]&&c<n.length;)c++;c++}}return typeof t=="string"&&!i&&(c=n.length),c=this.correctCaretPosition(n,c),c}removePrefixAndSuffix(e){const{format:n,prefix:o,suffix:t}=this.props;if(!n&&e){const i=e[0]==="-";i&&(e=e.substring(1,e.length)),e=o&&e.indexOf(o)===0?e.substring(o.length,e.length):e;const s=e.lastIndexOf(t);e=t&&s!==-1&&s===e.length-t.length?e.substring(0,s):e,i&&(e="-"+e)}return e}removePatternFormatting(e){const{format:n}=this.props,o=n.split("#").filter(s=>s!=="");let t=0,i="";for(let s=0,l=o.length;s<=l;s++){const u=o[s]||"",c=s===l?e.length:e.indexOf(u,t);if(c===-1){i=e;break}else i+=e.substring(t,c),t=c+u.length}return(i.match(/\d/g)||[]).join("")}removeFormatting(e){const{format:n,removeFormatting:o}=this.props;return e&&(n?typeof n=="string"?e=this.removePatternFormatting(e):typeof o=="function"?e=o(e):e=(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e)}formatWithPattern(e){const{format:n}=this.props;let o=0;const t=n.split("");for(let i=0,s=n.length;i<s;i++)n[i]==="#"&&(t[i]=e[o]||this.getMaskAtIndex(o),o+=1);return t.join("")}formatAsNumber(e){const{decimalScale:n,fixedDecimalScale:o,prefix:t,suffix:i,allowNegative:s,thousandsGroupStyle:l}=this.props,{thousandSeparator:u,decimalSeparator:c}=this.getSeparators(),f=e.indexOf(".")!==-1||n&&o;let{beforeDecimal:p,afterDecimal:d,addNegation:m}=G(e,s);return n!==void 0&&(d=re(d,n,o)),u&&(p=Qe(p,u,l)),t&&(p=t+p),i&&(d=d+i),m&&(p="-"+p),e=p+(f&&c||"")+d,e}formatNumString(e=""){const{format:n,allowEmptyFormatting:o}=this.props;let t=e;return e===""&&!o?t="":e==="-"&&!n?t="-":typeof n=="string"?t=this.formatWithPattern(t):typeof n=="function"?t=n(t):t=this.formatAsNumber(t),t}formatValueProp(e){const{format:n,decimalScale:o,fixedDecimalScale:t,allowEmptyFormatting:i}=this.props;let{value:s=e,isNumericString:l}=this.props;const u=!s&&s!==0;return u&&i&&(s=""),u&&!i?"":(typeof s=="number"&&(s=s.toString(),l=!0),s==="Infinity"&&l&&(s=""),l&&!n&&typeof o=="number"&&(s=Ye(s,o,t)),l?this.formatNumString(s):this.formatInput(s))}formatNegation(e=""){const{allowNegative:n}=this.props,o=new RegExp("(-)"),t=new RegExp("(-)(.)*(-)"),i=o.test(e),s=t.test(e);return e=e.replace(/-/g,""),i&&!s&&n&&(e="-"+e),e}formatInput(e=""){const{format:n}=this.props;return n||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}isCharacterAFormat(e,n){const{format:o,prefix:t,suffix:i,decimalScale:s,fixedDecimalScale:l}=this.props,{decimalSeparator:u}=this.getSeparators();return!!(typeof o=="string"&&o[e]!=="#"||!o&&(e<t.length||e>=n.length-i.length||s&&l&&n[e]===u))}checkIfFormatGotDeleted(e,n,o){for(let t=e;t<n;t++)if(this.isCharacterAFormat(t,o))return!0;return!1}correctInputValue(e,n,o){const{format:t,allowNegative:i,prefix:s,suffix:l}=this.props,{decimalSeparator:u}=this.getSeparators(),c=this.state.numAsString||"",{selectionStart:f,selectionEnd:p}=this.selectionBeforeInput,{start:d,end:m}=tt(n,o);if(!t&&u!=="."&&d===m&&o[f]===".")return o.substr(0,f)+u+o.substr(f+1,o.length);const O=t?0:s.length,v=n.length-(t?0:l.length);if(o.length>n.length||!o.length||d===m||f===0&&p===n.length||f===O&&p===v)return o;if(this.checkIfFormatGotDeleted(d,m,n)&&(o=n),!t){const w=this.removeFormatting(o);let{beforeDecimal:S,afterDecimal:h,addNegation:C}=G(w,i);const N=e<o.indexOf(u)+1;if(w.length<c.length&&N&&S===""&&!parseFloat(h))return C?"-":""}return o}updateValue(e,n){const{formattedValue:o,input:t}=e;let{numAsString:i,caretPos:s}=e;const{onValueChange:l}=this.props,{value:u}=this.state;if(t){if(!s){const c=e.inputValue||t.value,f=te(t);s=this.getCaretPosition(c,o,f)}t.value=o,this.setPatchedCaretPosition(t,s,o)}i===void 0&&(i=this.removeFormatting(o)),o!==u&&this.setState({value:o,numAsString:i},()=>{l(this.getValueObject(o,i))})}onChange(e){e.persist();const n=e.target;let o=n.value;const{state:t,props:i}=this,{isAllowed:s}=i,l=t.value||"",u=te(n);o=this.correctInputValue(u,l,o);let c=this.formatInput(o)||"";const f=this.removeFormatting(c),p=this.getValueObject(c,f);s(p)||(c=l),this.updateValue({formattedValue:c,numAsString:f,inputValue:o,input:n},()=>{i.onChange(e)})}onBlur(e){const{props:n,state:o}=this,{format:t,onBlur:i,allowLeadingZeros:s}=n;let{numAsString:l}=o;const u=o.value;if(this.focusedElm=null,!t){s||(l=Xe(l));const c=this.formatNumString(l);if(c!==u){e.persist(),this.updateValue({formattedValue:c,numAsString:l},()=>{i(l)});return}}i(l)}onKeyDown(e){const n=e.target,{key:o}=e,{selectionStart:t,selectionEnd:i,value:s=""}=n;let l;const{decimalScale:u,fixedDecimalScale:c,prefix:f,suffix:p,format:d,onKeyDown:m}=this.props,O=u!==void 0&&c,v=this.getNumberRegex(!1,O),w=new RegExp("-"),S=typeof d=="string";if(this.selectionBeforeInput={selectionStart:t,selectionEnd:i},o==="ArrowLeft"||o==="Backspace"?l=t-1:o==="ArrowRight"?l=t+1:o==="Delete"&&(l=t),l===void 0||t!==i){m(e);return}let h=l;const C=S?d.indexOf("#"):f.length,N=S?d.lastIndexOf("#")+1:s.length-p.length;if(o==="ArrowLeft"||o==="ArrowRight"){const F=o==="ArrowLeft"?"left":"right";h=this.correctCaretPosition(s,l,F)}else if(o==="Delete"&&!v.test(s[l])&&!w.test(s[l]))for(;!v.test(s[h])&&h<N;)h++;else if(o==="Backspace"&&!v.test(s[l])){if(t<=C+1&&s[0]==="-"&&typeof d>"u"){const F=s.substring(1);e.persist(),this.updateValue({formattedValue:F,caretPos:h,input:n})}else if(!w.test(s[l])){for(;!v.test(s[h-1])&&h>C;)h--;h=this.correctCaretPosition(s,h,"left")}}(h!==l||l<C||l>N)&&(e.preventDefault(),this.setPatchedCaretPosition(n,h,s)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,h,s),this.props.onKeyDown(e)}onMouseUp(e){const n=e.target,{selectionStart:o,selectionEnd:t,value:i=""}=n;if(o===t){const s=this.correctCaretPosition(i,o);s!==o&&this.setPatchedCaretPosition(n,s,i)}this.props.onMouseUp(e)}onFocus(e){e.persist(),this.focusedElm=e.target,setTimeout(()=>{const n=e.target,{selectionStart:o,selectionEnd:t,value:i=""}=n,s=this.correctCaretPosition(i,o);s!==o&&!(o===0&&t===i.length)&&this.setPatchedCaretPosition(n,s,i),this.props.onFocus(e)},0)}render(){const{type:e,displayType:n,customInput:o,renderText:t,getInputRef:i}=this.props,{value:s}=this.state,l=et(this.props,ie),u=Object.assign({},l,{type:e,value:s,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(n==="text")return t?t(s)||null:T.jsx("span",{...l,ref:i,children:s});if(o){const c=o;return T.jsx(c,{...u,ref:i})}return T.jsx("input",{...u,ref:i})}};q.propTypes=ie;q.defaultProps=nt;function se(r){const{isDetail:e,value:n,invalid:o,onValueChange:t,onKeyDown:i,bsSize:s="sm",style:l,onBlur:u,onFocus:c,decimalScale:f,thousandSeparator:p,decimalSeparator:d,customInput:m,...O}=r||{};return e?T.jsx("div",{style:{textAlign:"right"},children:n===0||n===null?"":ce(n)}):T.jsx(q,{...O,style:{textAlign:"right",...l},value:n,thousandSeparator:".",decimalSeparator:",",onValueChange:t,onBlur:v=>u&&u(v),onKeyDown:i,onFocus:c,customInput:m||ve,bsSize:s,decimalScale:f||f===0?f:5,invalid:o})}se.defaultProps={placeholder:"Nhâp..."};se.propTypes={placeholder:a.string};class ae extends ue.Component{render(){const{value:e,onChange:n,options:o,dataSelect:t}=this.props,i=e||"";var s=t!=null&&t.value_field?t==null?void 0:t.value_field:"value",l=t!=null&&t.text_field?t==null?void 0:t.text_field:"label";return T.jsx(xe,{value:i,onChange:n,options:o,valueRef:s,labelRef:l,placeholder:t!=null&&t.placeholder?`${t==null?void 0:t.placeholder}...`:"Chọn..."})}}ae.propTypes={};ae.defaultProps={placeholder:"Chọn..."};export{lt as M,q as N,ae as S,Ke as a,He as b,se as c};