1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95340],{95340:function(t,e,r){var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},n=function(){function t(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(e,r,a){return r&&t(e.prototype,r),a&&t(e,a),e}}(),o=s(r(45697)),i=s(r(67294)),u=r(89571);function s(t){return t&&t.__esModule?t:{default:t}}var l={thousandSeparator:o.default.oneOfType([o.default.string,o.default.oneOf([!0])]),thousandSpacing:o.default.oneOf(["2","2s","3","4"]),decimalSeparator:o.default.string,decimalScale:o.default.number,fixedDecimalScale:o.default.bool,displayType:o.default.oneOf(["input","text"]),prefix:o.default.string,suffix:o.default.string,format:o.default.oneOfType([o.default.string,o.default.func]),removeFormatting:o.default.func,mask:o.default.oneOfType([o.default.string,o.default.arrayOf(o.default.string)]),value:o.default.oneOfType([o.default.number,o.default.string]),isNumericString:o.default.bool,customInput:o.default.func,allowNegative:o.default.bool,onValueChange:o.default.func,onKeyDown:o.default.func,onMouseUp:o.default.func,onChange:o.default.func,onFocus:o.default.func,onBlur:o.default.func,type:o.default.oneOf(["text","tel"]),isAllowed:o.default.func,renderText:o.default.func},f={displayType:"input",decimalSeparator:".",thousandSpacing:"3",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,isNumericString:!1,type:"text",onValueChange:u.noop,onChange:u.noop,onKeyDown:u.noop,onMouseUp:u.noop,onFocus:u.n
1oop,onBlur:u.noop,isAllowed:u.returnTrue},c=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&("object"==typeof e||"function"==typeof e)?e:t}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.validateProps();var a=r.formatValueProp();return r.state={value:a,numAsString:r.removeFormatting(a)},r.onChange=r.onChange.bind(r),r.onKeyDown=r.onKeyDown.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r.onFocus=r.onFocus.bind(r),r.onBlur=r.onBlur.bind(r),r}return!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),n(e,[{key:"componentDidUpdate",value:function(t){this.updateValueIfRequired(t)}},{key:"updateValueIfRequired",value:function(t){var e=this.props,r=this.state;if(t!==e){this.validateProps();var a=r.value,n=r.numAsString||"",o=void 0===e.value?this.formatNumString(n):this.formatValueProp();o!==a&&this.setState({value:o,numAsString:this.removeFormatting(o)})}}},{key:"getFloatString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=this.getSeparators().decimalSeparator,r=this.getNumberRegex(!0),a="-"===t[0];a&&(t=t.replace("-",""));var n=(t=(t.match(r)||[]).join("").replace(e,".")).indexOf(".");return -1!==n&&(t=t.substring(0,n)+"."+t.substring(n+1,t.length).replace(RegExp((0,u.escapeRegExp)(e),"g"),"")),a&&(t="-"+t),t}},{key:"getNumberRegex",value:function(t,e){var r=this.props,a=r.format,n=r.decimalScale,o=this.getSeparators().decimalSeparator;return RegExp("\\d"+(!o||0===n||e||a?"":"|"+(0,u.escapeRegExp)(o)),t?"g":void 0)}},{key:"getSeparators",value:function(){var t=this.props,e=t.decimalSeparator,r=t.thousandSpacing,a=this.props.thousandSeparator;return!0===a&&(a=","),{decimalSeparator:e,thousandSeparator:a,thousandSpacing:r}}},{key:"getMaskAtIndex",value:function(t){var e=this.props.mask,r=void 0===e?" ":e;return"string"==typeof r?r:r[t]||" "}},{key:"validateProps",value:function(){var t=this.props.mask,e=this.getSeparators(),r=e.decimalSeparator,a=e.thousandSeparator;if(r===a)throw Error("\n Decimal separator can't be same as thousand separator.\n\n thousandSeparator: "+a+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+r+" (default value for decimalSeparator is .)\n ");if(t&&("string"===t?t:t.toString()).match(/\d/g))throw Error("\n Mask "+t+" should not contain numeric character;\n ")}},{key:"splitDecimal",value:function(t){var e=this.props.allowNegative,r="-"===t[0],a=(t=t.replace("-","")).split(".");return{beforeDecimal:a[0],afterDecimal:a[1]||"",hasNagation:r,addNegation:r&&e}}},{key:"setPatchedCaretPosition",value:function(t,e,r){(0,u.setCaretPosition)(t,e),setTimeout(function(){t.value===r&&(0,u.setCaretPosition)(t,e)},0)}},{key:"correctCaretPosition",value:function(t,e,r){var a=this.props,n=a.prefix,o=a.suffix,i=a.format;if(!i){var s="-"===t[0];return Math.min(Math.max(e,n.length+(s?1:0)),t.length-o.length)}if("function"==typeof i||"#"===i[e]&&(0,u.charIsNumber)(t[e])||"#"===i[e-1]&&(0,u.charIsNumber)(t[e-1]))return e;var l=i.indexOf("#");e=Math.min(Math.max(e,l),i.lastIndexOf("#")+1);for(var f=i.substring(e,i.length).indexOf("#"),c=e,p=e+(-1===f?0:f);c>l&&("#"!==i[c]||!(0,u.charIsNumber)(t[c]));)c-=1;return!(0,u.charIsNumber)(t[p])||"left"===r&&e!==l||e-c<p-e?c+1:p}},{key:"getCaretPosition",value:function(t,e,r){var a=this.props.format,n=this.state.value,o=this.getNumberRegex(!0),i=(t.match(o)||[]).join(""),u=(e.match(o)||[]).join(""),s=void 0,l=void 0;for(l=0,s=0;l<r;l++){var f=t[l]||"",c=e[s]||"";
1if((f.match(o)||f===c)&&(!("0"===f&&c.match(o))||"0"===c||i.length===u.length)){for(;f!==e[s]&&s<e.length;)s++;s++}}return"string"!=typeof a||n||(s=e.length),s=this.correctCaretPosition(e,s)}},{key:"removePrefixAndSuffix",value:function(t){var e=this.props,r=e.format,a=e.prefix,n=e.suffix;if(!r&&t){var o="-"===t[0];o&&(t=t.substring(1,t.length));var i=(t=a&&0===t.indexOf(a)?t.substring(a.length,t.length):t).lastIndexOf(n);t=n&&-1!==i&&i===t.length-n.length?t.substring(0,i):t,o&&(t="-"+t)}return t}},{key:"removePatternFormatting",value:function(t){for(var e=this.props.format.split("#").filter(function(t){return""!==t}),r=0,a="",n=0,o=e.length;n<=o;n++){var i=e[n]||"",u=n===o?t.length:t.indexOf(i,r);if(-1===u){a=t;break}a+=t.substring(r,u),r=u+i.length}return(a.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(t){var e=this.props,r=e.format,a=e.removeFormatting;return t&&(r?t="string"==typeof r?this.removePatternFormatting(t):"function"==typeof a?a(t):(t.match(/\d/g)||[]).join(""):(t=this.removePrefixAndSuffix(t),t=this.getFloatString(t))),t}},{key:"formatWithPattern",value:function(t){for(var e=this.props.format,r=0,a=e.split(""),n=0,o=e.length;n<o;n++)"#"===e[n]&&(a[n]=t[r]||this.getMaskAtIndex(r),r+=1);return a.join("")}},{key:"formatThousand",value:function(t,e,r){var a=void 0;switch(r){case u.thousandGroupSpacing.two:a=/(\d)(?=(\d{2})+(?!\d))/g;break;case u.thousandGroupSpacing.twoScaled:a=/(\d)(?=(((\d{2})+)(\d{1})(?!\d)))/g;break;case u.thousandGroupSpacing.four:a=/(\d)(?=(\d{4})+(?!\d))/g;break;default:a=/(\d)(?=(\d{3})+(?!\d))/g}return t.replace(a,"$1"+e)}},{key:"formatAsNumber",value:function(t){var e=this.props,r=e.decimalScale,a=e.fixedDecimalScale,n=e.prefix,o=e.suffix,i=this.getSeparators(),s=i.thousandSeparator,l=i.decimalSeparator,f=i.thousandSpacing,c=-1!==t.indexOf(".")||r&&a,p=this.splitDecimal(t),h=p.beforeDecimal,d=p.afterDecimal,g=p.addNegation;return void 0!==r&&(d=(0,u.limitToScale)(d,r,a)),s&&(h=this.formatThousand(h,s,f)),n&&(h=n+h),o&&(d+=o),g&&(h="-"+h),t=h+(c&&l||"")+d}},{key:"formatNumString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=this.props.format,r=t;return""===t?r="":"-"!==t||e?r="string"==typeof e?this.formatWithPattern(r):"function"==typeof e?e(r):this.formatAsNumber(r):(r="-",t=""),r}},{key:"formatValueProp",value:function(){var t=this.props,e=t.format,r=t.decimalScale,a=t.fixedDecimalScale,n=this.props,o=n.value,i=n.isNumericString;return void 0===o?"":("number"==typeof o&&(o=o.toString(),i=!0),i&&!e&&"number"==typeof r&&(o=(0,u.roundToPrecision)(o,r,a)),i?this.formatNumString(o):this.formatInput(o))}},{key:"formatNegation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=this.props.allowNegative,r=RegExp("(-)(.)*(-)"),a=/(-)/.test(t),n=r.test(t);return t=t.replace(/-/g,""),a&&!n&&e&&(t="-"+t),t}},{key:"formatInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.props.format||(t=this.formatNegation(t)),t=this.removeFormatting(t),this.formatNumString(t)}},{key:"isCharacterAFormat",value:function(t,e){var r=this.props,a=r.format,n=r.prefix,o=r.suffix,i=r.decimalScale,u=r.fixedDecimalScale,s=this.getSeparators().decimalSeparator;return"string"==typeof a&&"#"!==a[t]||!a&&(t<n.length||t>=e.length-o.length||!!i&&!!u&&e[t]===s)}},{key:"checkIfFormatGotDeleted",value:function(t,e,r){for(var a=t;a<e;a++)if(this.isCharacterAFormat(a,r))return!0;return!1}},{key:"correctInputValue",value:function(t,e,r){var a=this.props.format,n=this.state.numAsString||"";if(r.length>=e.length||!r.length)return r;var o=(0,u.splitString)(e,t),i=(0,u.splitString)(r,t),s=o[1].lastIndexOf(i[1]),l=t+(-1!==s?o[1].substring(0,s):"").length;if(this.checkIfFormatGotDeleted(t,l,e)&&(r=e),!a){var f=this.removeFormatting(r),c=this.splitDecimal(f),p=c.beforeDecimal,h=c.afterDecimal,d=c.addNegation;if(f.length<n.length&&""===p&&!parseFloat(h))return d?"-":""}return r}},{key:"onChange",value:function(t){t.persist();var e=t.target,r=e.value,a=this.state,n=this.props,o=n.isAllowed,i=a.value||"",u=Math.max(e.selectionStart,e.selectionEnd);r=this.correctInputValue(u,i,r);var s=this.formatInput(r)||"",l=this.removeFormatting(s),f={formattedValue:s,value:l,floatValue:parseFloat(l)};o(f)||(s=i),e.value=s;var c=this.getCaretPosition(r,s,u);this.setPatchedCaretPosition(e,c,s),s!==i?this.setState({value:s,numAsString:l},function(){n.onValueChange(f),n.onChange(t)}
1):n.onChange(t)}},{key:"onBlur",value:function(t){var e=this.props,r=this.state,a=e.format,n=e.onBlur,o=r.numAsString,i=r.value;if(!a){o=(0,u.fixLeadingZero)(o);var s=this.formatNumString(o),l={formattedValue:s,value:o,floatValue:parseFloat(o)};if(s!==i){t.persist(),this.setState({value:s,numAsString:o},function(){e.onValueChange(l),n(t)});return}}n(t)}},{key:"onKeyDown",value:function(t){var e=t.target,r=t.key,a=e.selectionEnd,n=e.value,o=e.selectionStart,i=void 0,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,f=u.prefix,c=u.suffix,p=u.format,h=u.onKeyDown,d=this.getNumberRegex(!1,void 0!==s&&l),g=/-/,m="string"==typeof p;if("ArrowLeft"===r||"Backspace"===r?i=o-1:"ArrowRight"===r?i=o+1:"Delete"===r&&(i=o),void 0===i||o!==a){h(t);return}var v=i,S=m?p.indexOf("#"):f.length,y=m?p.lastIndexOf("#")+1:n.length-c.length;if("ArrowLeft"===r||"ArrowRight"===r)v=this.correctCaretPosition(n,i,"ArrowLeft"===r?"left":"right");else if("Delete"!==r||d.test(n[i])||g.test(n[i])){if("Backspace"===r&&!d.test(n[i])&&!g.test(n[i])){for(;!d.test(n[v-1])&&v>S;)v--;v=this.correctCaretPosition(n,v,"left")}}else for(;!d.test(n[v])&&v<y;)v++;(v!==i||i<S||i>y)&&(t.preventDefault(),this.setPatchedCaretPosition(e,v,n)),t.isUnitTestRun&&this.setPatchedCaretPosition(e,v,n),this.props.onKeyDown(t)}},{key:"onMouseUp",value:function(t){var e=t.target,r=e.selectionStart,a=e.selectionEnd,n=e.value;if(r===a){var o=this.correctCaretPosition(n,r);o!==r&&this.setPatchedCaretPosition(e,o,n)}this.props.onMouseUp(t)}},{key:"onFocus",value:function(t){var e=this;t.persist(),setTimeout(function(){var r=t.target,a=r.selectionStart,n=r.value,o=e.correctCaretPosition(n,a);o!==a&&e.setPatchedCaretPosition(r,o,n),e.props.onFocus(t)})}},{key:"render",value:function(){var t=this.props,e=t.type,r=t.displayType,n=t.customInput,o=t.renderText,s=this.state.value,f=(0,u.omit)(this.props,l),c=a({},f,{type:e,value:s,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});return"text"===r?o?o(s)||null:i.default.createElement("span",f,s):n?i.default.createElement(n,c):i.default.createElement("input",c)}}]),e}(i.default.Component);c.propTypes=l,c.defaultProps=f,t.exports=c},89571:function(t,e){function r(t,e,r){for(var a="",n=r?"0":"",o=0;o<=e-1;o++)a+=t[o]||n;return a}Object.defineProperty(e,"__esModule",{value:!0}),e.noop=function(){},e.returnTrue=function(){return!0},e.charIsNumber=function(t){return!!(t||"").match(/\d/)},e.escapeRegExp=function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},e.fixLeadingZero=function(t){if(!t)return t;var e="-"===t[0];e&&(t=t.substring(1,t.length));var r=t.split("."),a=r[0].replace(/^0+/,"")||"0",n=r[1]||"";return(e?"-":"")+a+(n?"."+n:"")},e.splitString=function(t,e){return[t.substring(0,e),t.substring(e)]},e.limitToScale=r,e.roundToPrecision=function(t,e,a){var n=t.split("."),o=parseFloat("0."+(n[1]||"0")).toFixed(e).split("."),i=n[0].split("").reverse().reduce(function(t,e,r){return t.length>r?(Number(t[0])+Number(e)).toString()+t.substring(1,t.length):e+t},o[0]),u=r(o[1]||"",(n[1]||"").length,a);return i+(u?"."+u:"")},e.omit=function(t,e){var r={};return Object.keys(t).forEach(function(a){e[a]||(r[a]=t[a])}),r},e.setCaretPosition=function(t,e){if(t.value=t.value,null!==t){if(t.createTextRange){var r=t.createTextRange();return r.move("character",e),r.select(),!0}return t.selectionStart||0===t.selectionStart?(t.focus(),t.setSelectionRange(e,e),!0):(t.focus(),!1)}},e.thousandGroupSpacing={two:"2",twoScaled:"2s",three:"3",four:"4"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.