Socket
Socket
Sign inDemoInstall

react-rxinput

Package Overview
Dependencies
41
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

43

es6/index.js

@@ -125,21 +125,16 @@ /*

console.log("HERE I AAM - componentWillReceiveProps", nextProps);
if (this.props.value !== nextProps.value) {
if (nextProps.value === '' && selAt(nextProps.selection, 0)) this.state.mask.reset();else this.state.mask.setValue(nextProps.value);
//this.refs.debug.forceUpdate();
}
if (this.props.mask !== nextProps.mask) {
if (this.props.mask.toString() !== nextProps.mask.toString()) {
//this.state.mask.setPattern(nextProps.mask, {value: this.state.mask.getRawValue()});
this.state.mask.setPattern(nextProps.mask, { value: this.state.mask.getValue(), selection: this.state.mask.selection });
this.setState({ selection: this.state.selection, value: nextProps.value });
} else if (this.props.value !== nextProps.value) {
/* if( nextProps.value === '' && selAt(nextProps.selection,0))
this.state.mask.reset();
else
*/
this.state.mask.setValue(nextProps.value);
//this.refs.debug.forceUpdate();
}
},
componentDidUpdate: function componentDidUpdate() {
var _this = this;
setTimeout(function () {
_this._updateInputSelection();
}, 0);
},
_updateMaskSelection: function _updateMaskSelection() {

@@ -187,3 +182,3 @@ //console.log("HERE I AAM - _updateMaskSelection", getSelection(this.input));

_onKeyDown: function _onKeyDown(e) {
var _this2 = this;
var _this = this;

@@ -200,12 +195,12 @@ var mask = this.state.mask;

e.preventDefault();
_this2._updateMaskSelection();
_this._updateMaskSelection();
if (action()) {
var value = _this2._getDisplayValue();
var value = _this._getDisplayValue();
e.target.value = value;
//console.log(action+":getDisplayValue", value);
if (value) {
_this2._updateInputSelection();
_this._updateInputSelection();
}
}
_this2.setState({ selection: mask.selection });
_this.setState({ selection: mask.selection });
return true;

@@ -293,3 +288,3 @@ };

_createPopover: function _createPopover(valueList, headers, maxWidth) {
var _this3 = this;
var _this2 = this;

@@ -338,3 +333,3 @@ var strip = function strip(s) {

'th',
{ key: _this3.props.name + e },
{ key: _this2.props.name + e },
e

@@ -352,4 +347,4 @@ );

{ onClick: function (e) {
return _this3.selected(l, e);
}, key: _this3.props.name + "L" + hash(l) },
return _this2.selected(l, e);
}, key: _this2.props.name + "L" + hash(l) },
React.createElement(

@@ -369,3 +364,3 @@ 'td',

render: function render() {
var _this4 = this;
var _this3 = this;

@@ -410,3 +405,3 @@ var _props = this.props;

ref: function (r) {
return _this4.input = r;
return _this3.input = r;
},

@@ -413,0 +408,0 @@ maxLength: patternLength,

@@ -135,21 +135,16 @@ /*

console.log("HERE I AAM - componentWillReceiveProps", nextProps);
if (this.props.value !== nextProps.value) {
if (nextProps.value === '' && selAt(nextProps.selection, 0)) this.state.mask.reset();else this.state.mask.setValue(nextProps.value);
//this.refs.debug.forceUpdate();
}
if (this.props.mask !== nextProps.mask) {
if (this.props.mask.toString() !== nextProps.mask.toString()) {
//this.state.mask.setPattern(nextProps.mask, {value: this.state.mask.getRawValue()});
this.state.mask.setPattern(nextProps.mask, { value: this.state.mask.getValue(), selection: this.state.mask.selection });
this.setState({ selection: this.state.selection, value: nextProps.value });
} else if (this.props.value !== nextProps.value) {
/* if( nextProps.value === '' && selAt(nextProps.selection,0))
this.state.mask.reset();
else
*/
this.state.mask.setValue(nextProps.value);
//this.refs.debug.forceUpdate();
}
},
componentDidUpdate: function componentDidUpdate() {
var _this = this;
setTimeout(function () {
_this._updateInputSelection();
}, 0);
},
_updateMaskSelection: function _updateMaskSelection() {

@@ -197,3 +192,3 @@ //console.log("HERE I AAM - _updateMaskSelection", getSelection(this.input));

_onKeyDown: function _onKeyDown(e) {
var _this2 = this;
var _this = this;

@@ -210,12 +205,12 @@ var mask = this.state.mask;

e.preventDefault();
_this2._updateMaskSelection();
_this._updateMaskSelection();
if (action()) {
var value = _this2._getDisplayValue();
var value = _this._getDisplayValue();
e.target.value = value;
//console.log(action+":getDisplayValue", value);
if (value) {
_this2._updateInputSelection();
_this._updateInputSelection();
}
}
_this2.setState({ selection: mask.selection });
_this.setState({ selection: mask.selection });
return true;

@@ -303,3 +298,3 @@ };

_createPopover: function _createPopover(valueList, headers, maxWidth) {
var _this3 = this;
var _this2 = this;

@@ -348,3 +343,3 @@ var strip = function strip(s) {

'th',
{ key: _this3.props.name + e },
{ key: _this2.props.name + e },
e

@@ -362,4 +357,4 @@ );

{ onClick: function (e) {
return _this3.selected(l, e);
}, key: _this3.props.name + "L" + hash(l) },
return _this2.selected(l, e);
}, key: _this2.props.name + "L" + hash(l) },
_react2['default'].createElement(

@@ -379,3 +374,3 @@ 'td',

render: function render() {
var _this4 = this;
var _this3 = this;

@@ -420,3 +415,3 @@ var _props = this.props;

ref: function (r) {
return _this4.input = r;
return _this3.input = r;
},

@@ -423,0 +418,0 @@ maxLength: patternLength,

{
"name": "react-rxinput",
"version": "1.0.1",
"version": "1.0.2",
"description": "react-rxinput React component, extends <input> element to validate against a regular expression as you type input (incremental regex matcher)",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -7,3 +7,2 @@ # react-rxinput

Describe react-rxinput here.

@@ -20,5 +19,44 @@ [build-badge]: https://img.shields.io/travis/user/repo/master.svg?style=flat-square

[Demo](https://nurulc.github.io/)
## Highlights:
- Use regular expression to define 'masked input' (project inspired by https://github.com/insin/react-maskinput)
- RegExp matching/validation as you type
- Auto complete
- Matching suggestions
- Replacement for mask input
- Handles very large regular expressions
- Pretty extensive test scripts
[Please typ out the demo](https://nurulc.github.io/)
[incr-regex-package](https://github.com/nurulc/incr-regex-package)
[react-bootstrap](https://react-bootstrap.github.io/)
[React](https://facebook.github.io/react/)
JavaScript regular expression is great and really fast, and it would be pointless to try to create a RegExp alternative that does the same thing. But having said that, this project is a specific use case - validating input as you type using RegExp.
I needed a regular expression matcher that would work incrementally; By that I mean that it should let you know if a string matches the beginning part of a regular expression (good so far, but needs more input scenario). I tried to figure out if that was possible using JavaScript's regular expression matcher. I could not figure out any easy to do that. I decided that I would write an incremental regular expression matcher. I was much more difficult that I expected. But I have build an npm package that does perform incremental regular expression matching.
- npm incr-regex-package, (https://github.com/nurulc/incr-regex-package)
- input validation widget react-rxinput (https://github.com/nurulc/react-rxinput)
The widget was inspired by another github project (https://github.com/insin/react-maskinput) that provides mask input for things like phone number, credit card number, date and so on. Although the capability is very nice, but it was limited. THe input mask you could enter has very little flexibility, wile a regular expression has all the flexibility you could need (even regexp has its limitations, cannot match recursive patterns, but that is for another day).
Building the widget it became obvious that it could be a swiss army knife and provide:
- Auto completion
- Dropdown list alternative
- Radio button alternative
- Mask input replacement
- As you type validation
- Force upper case
- Limit the character you can enter
- Only allow valid input as you type
### Installation

@@ -25,0 +63,0 @@

@@ -5,4 +5,4 @@ /*!

*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-bootstrap")):"function"==typeof define&&define.amd?define(["react","react-bootstrap"],e):"object"==typeof exports?exports.RxInput=e(require("react"),require("react-bootstrap")):t.RxInput=e(t.React,t.ReactBootstrap)}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function a(t){return(t.ctrlKey||t.metaKey)&&t.keyCode===(t.shiftKey?E:_)}function o(t){return(t.ctrlKey||t.metaKey)&&t.keyCode===(t.shiftKey?_:E)}function s(t){return k.contract.isFunc(t.arrowAction)}function u(t){return JSON.stringify(t)}function c(t,e){return t===e||void 0!==t&&void 0!==e&&(t.start===e.start&&t.end===e.end)}function l(t,e){return!t&&0===e||t.start===e&&(void 0===t.end||t.end===e)}function h(t,e){var n=t.toUpperCase(),r=e.toUpperCase();return n<r?-1:n>r?1:0}var f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},p=n(19),d=r(p),v=n(6),y=r(v),m=n(20),g=n(16),k=n(12),_=90,E=89,b={DONE:[d.default.createElement("span",{className:"glyphicon glyphicon-ok form-control-feedback"}),""],MORE:[d.default.createElement("span",{className:"glyphicon glyphicon-arrow-right form-control-feedback"})," has-warning"],OK:[d.default.createElement("span",{className:"glyphicon glyphicon-option-horizontal form-control-feedback"}),""]},x=function(t){return t},O=d.default.createClass({displayName:"RxInput",propTypes:{mask:d.default.PropTypes.object.isRequired,name:d.default.PropTypes.string.isRequired,popover:d.default.PropTypes.string,selection:d.default.PropTypes.object,value:d.default.PropTypes.string},getDefaultProps:function(){return{value:""}},getInitialState:function(){var t={pattern:this.props.mask,value:this.props.value};return{focus:!1,value:this.props.value,selection:this.props.selection,mask:new k.RXInputMask(t)}},componentWillReceiveProps:function(t){console.log("HERE I AAM - componentWillReceiveProps",t),this.props.value!==t.value&&(""===t.value&&l(t.selection,0)?this.state.mask.reset():this.state.mask.setValue(t.value)),this.props.mask!==t.mask&&(this.state.mask.setPattern(t.mask,{value:this.state.mask.getValue(),selection:this.state.mask.selection}),this.setState({selection:this.state.selection,value:t.value}))},componentDidUpdate:function(){var t=this;setTimeout(function(){t._updateInputSelection()},0)},_updateMaskSelection:function(){this.state.mask.selection=(0,g.getSelection)(this.input)},_updateInputSelection:function(){c((0,g.getSelection)(this.input),this.state.mask.selection)||(0,g.setSelection)(this.input,this.state.mask.selection)},_onFocus:function(t){},_onBlurr:function(){},_onChange:function(t){var e=this.state.mask,n=e.getValue();if(t.target.value!==n){if(t.target.value.length<n.length){var r=n.length-t.target.value.length;this._updateMaskSelection(),e.selection.end=e.selection.start+r,e.backspace(),console.log("Fix maskValue",n,"diff:",r,"target value: ",t.target.value)}var i=this._getDisplayValue();t.target.value=i,i&&this._updateInputSelection()}this.setState({selection:this.mask.selection}),this.props.onChange&&this.props.onChange(t)},_onKeyDown:function(t){var e=this,n=this.state.mask,r=function(t){return function(e){return e.key===t}},i=function(r,i){if(!r(t))return!1;if(t.preventDefault(),e._updateMaskSelection(),i()){var a=e._getDisplayValue();t.target.value=a,a&&e._updateInputSelection()}return e.setState({selection:n.selection}),!0};if(!(i(a,function(){return n.undo()})||i(o,function(){return n.redo()})||i(r("Backspace"),function(){return n.backspace()})||i(r("Delete"),function(){return n.del()})||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||"Enter"===t.key||"ArrowLeft"!==t.key&&"ArrowRight"!=t.key)){var c=(0,g.getSelection)(this.input);c.start===c.end&&void 0!==n.left&&(t.preventDefault(),"ArrowLeft"===t.key?n.left(c):n.right(c),this._updateInputSelection()),console.log("Arrow Action support:",s(n)," value:",this._getDisplayValue()," selection: ",u((0,g.getSelection)(this.input)),u(n.selection))}},_onKeyPress:function(t){var e=this.state.mask;if(console.log("onKeyPress",u((0,g.getSelection)(this.input)),u(e.selection),t.key,t.target.value),!(t.metaKey||t.altKey||t.ctrlKey||"Enter"===t.key)){var n=(0,g.getSelection)(this.input),r=e.getSelection();t.preventDefault(),this._updateMaskSelection(),e.input(t.key)&&(t.target.value=e.getValue(),console.log("keyPress:getDisplayValue",this._getDisplayValue()," selection: ",u(n)+"/"+u(e.selection)+"<"+u(r)),this._updateInputSelection(),this.setState({selection:e.selection}))}},_onPaste:function(t){var e=this.state.mask;console.log("onPaste",u((0,g.getSelection)(this.input)),t.clipboardData.getData("Text"),t.target.value),t.preventDefault(),this._updateMaskSelection(),console.log("paste: ",t.clipboardData.getData("Text")),e.paste(t.clipboardData.getData("Text"))&&(t.target.value=e.getValue(),console.log("undo:getDisplayValue",this._getDisplayValue()),setTimeout(this._updateInputSelection,0),this.setState({selection:e.selection}))},_getMaskList:function(){var t=this.state.mask.minCharsList(!0);return t&&t.length<20?t:this.state.mask.minCharsList()},_getDisplayValue:function(){var t=this.state.mask.getValue();return t===this.state.mask.emptyValue?"":t},_createPopover:function(t,e,n){function r(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return(e>>>0)+12}var i=this,a=function(t){return x(t.replace(/\u0332/g,""),"strip:")};n=Math.max(150,n||12*Math.max.apply(null,t.map(function(t){return Math.min(25,a(t).length)}))),x(n,"MAX WIDTH:");var o=n||200,s={width:o-50,maxWidth:o-50},u=void 0,c=void 0;return!t||t.length<=1?d.default.createElement("div",null):(t.length>20&&(u={height:"400px",display:"block",overflow:"auto"},c=d.default.createElement("div",null,"             ")),d.default.createElement(m.Popover,{id:this.props.name+"myPopover",className:"col-xs-10 col-md-10",style:{width:o,maxWidth:o,fontSize:"10px",marginTop:"10px",marginBottom:"10px"}},d.default.createElement("table",{key:this.props.name+"myPopover1",className:"table-responsive table-striped table-hover table-condensed col-xs-10 col-md-10",style:s},d.default.createElement("thead",null,d.default.createElement("tr",null,e.map(function(t){return d.default.createElement("th",{key:i.props.name+t},t)}))),d.default.createElement("tbody",{style:u},t.sort(h).map(function(t){return d.default.createElement("tr",{onClick:function(e){return i.selected(t,e)},key:i.props.name+"L"+r(t)},d.default.createElement("td",null,t))}))),c))},render:function(){var t=this,e=this.props,n=(e.mask,e.size),r=e.placeholder,a=(i(e,["mask","size","placeholder"]),(0,y.default)(this.props,["popover","mask","selection"]));console.log("PROPS:",a);var o=void 0,s=this.state.mask.pattern,u=s.length;console.log("about to render name:'"+this.props.name+"' - "+this.state.mask.isDone());var c=this.props.popover?this._createPopover(this._getMaskList(),["Possible Values"]):d.default.createElement("span",null);console.log("about to render - "+this.state.mask.isDone());var l=this.state.mask.isDone();l&&(o=b[this.state.mask.isDone()]);var h={marginBotton:"0px",fontSize:"70%",color:"red",fontStyle:"italic"},p=d.default.createElement("div",{style:{marginBotton:"0px",paddingLeft:"100px"}},d.default.createElement("div",{style:h},l,"  "),d.default.createElement("div",{className:"form-group has-feedback"+o[1]},d.default.createElement(m.OverlayTrigger,{trigger:"focus",style:{marginBotton:"0px"},ref:"mypop",placement:"bottom",overlay:c},d.default.createElement("input",f({},a,{className:"form-control",ref:function(e){return t.input=e},maxLength:u,onChange:this._onChange,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onPaste:this._onPaste,placeholder:r||this.state.mask.emptyValue,size:n||u,value:this._getDisplayValue(),style:{padding:"3px 0px 3px 0px"}}))),o[0]));return p}});t.exports=O},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t){if(!t)return t;for(var e=1,n=arguments.length;e<n;e++){var r=arguments[e];if("function"==typeof r||"object"===("undefined"==typeof r?"undefined":F(r))&&null!==r)for(var i,a=-1,o=Object.keys(r),s=o?o.length:0;++a<s;)i=o[a],t[i]=r[i]}return t}function i(t){return r({},t)}function o(t,e){return!!t[e]}function s(t,e){var n,i=this;if("function"!=typeof i)throw new Error("Parent must be a constructor function");return n=o(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},r(n,i,e),n.prototype=Object.create(i.prototype),t&&r(n.prototype,t),n.prototype.constructor=n,n}function u(t){return t}function c(t){var e=[];return e.concat.apply(e,t)}function l(t,e){if(t===e)return!0;if(!t||!e)return!1;if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]instanceof Array&&t[n]instanceof Array){if(!l(t[n],e[n]))return!1}else if(e[n]!==t[n])return!1;return!0}function h(t){for(var e={},n=[],r=0;r<t.length;r++)t[r]in e||(n.push(t[r]),e[t[r]]=!0);return n}function f(t,e){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function p(t,e,n){if(!t||!e)return!1;var r=t.length,i=e.length;if(n+i>r)return!1;for(var a=n,o=0;o<i;a++,o++)if(e[o]instanceof Array&&t[a]instanceof Array){if(!p(t[a],e[o],0))return!1}else if(t[a]!==e[o])return!1;return!0}function d(t,e){for(var n=0;n<e.length;n++)t.push(e[n]);return t}function v(t){for(var e=[],n=0,r=t.length;n<=r;n++)e.push(t.charAt(r-n));return e.join("")}function y(t,e){for(var n=0;n<t.length&&n<e.length;n++)if(t.charAt(n)!==e.charAt(n))return t.substring(0,n);return t.length<e.length?t:e}function m(t,e){return v(y(v(t),v(e)))}function g(t,e){return t.length<e?t:t.substr(0,e)}function k(t,e){return t.length<e?t:t.substr(t.length-e,e)}function _(t,e){function n(t,e,n){for(var r=t.length-n,i=0;i<n;r++,i++)if(t.charAt(r)!==e.charAt(i))return!1;return!0}for(var r=Math.min(t.length,e.length),i=r;i>0;i--)if(n(t,e,i))return t.substr(0,t.length-i)+e;return t+e}function E(){var t="\\[(?:\\\\]|[^\\]])*\\]",e="[.\\]|)]|\\(\\?:|\\(|\\?\\?|\\?|\\*\\?|\\*|\\+\\?|\\+",n="\\\\(?:"+e+"|[dDsSbBwW\\[{}\\]])",r="\\{[0-9]+(?:,[0-9]*)?\\}",i="[^.+?{}\\]\\[|()]",a=[t,r,n,e,i].join("|");return new RegExp("("+a+")","g")}function b(t){var e=t.match(/\{(\d+)(,(\d*))?\}/),n=Number(e[1]);return{min:Number(e[1]),max:e[3]?Number(e[3]):e[2]?void 0:n}}function x(t){return(1&+t)>0}function O(t,e){return void 0===t?e:(t.push(e),t)}function S(t,e,n){return new z(t,e)}function w(t){if(!t)throw Error("n_head of empty list");return t.head}function A(t){if(!t)throw Error("n_tail of empty list");return t.tail}function I(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return t?I(A(t),S(w(t),e)):e}function R(t){return I(t.reduce(function(t,e){return S(e,t)},null))}function N(t){return R(t.split(""))}function M(t){return V(function(t,e){return t.push(e),t},t,[])}function D(t){return M(t).join("")}function P(t,e){return t&&t?S(w(t),P(A(t),e)):e}function C(t,e,n){return n=n||0,e?S(t(w(e),n,e),C(t,A(e),n+1)):e}function T(t,e,n){return e?(n=n||0,t(w(e),n,e)?S(w(e),T(t,A(e),n+1)):T(t,A(e),n+1)):e}function L(t,e,n){return n=n||0,e?t(w(e),n,e)?e:L(t,A(e),n+1):null}function V(t,e,n){return e?V(t,A(e),t(n,w(e))):n}function K(t,e,n){return 2===arguments.length&&(n=e,e=t,t=function(t,e){return t===e}),T(function(e){return!L(function(n){return t(n,e)},n)},e)}Object.defineProperty(e,"__esModule",{value:!0});var j=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.assign=r,e.copy=i,e.extend=s,e.ID=u,e.flatten=c,e.array_eq=l,e.arr_uniq=h,e.arr_find=f,e.array_match=p,e.array_append=d,e.sreverse=v,e.sprefix=y,e.rprefix=m,e.shead=g,e.stail=k,e.sRightMerge=_,e.parseMulti=b,e.odd=x,e.arr_push=O,e.n_cons=S,e.n_head=w,e.n_tail=A,e.n_reverse=I,e.arrayToList=R,e.stringToList=N,e.listToArray=M,e.listToString=D,e.n_concat=P,e.n_map=C,e.n_filter=T,e.n_find=L,e.n_reduce=V,e.n_removeAll=K;e.contract=function(){var t=Function.prototype.call,e=(t.bind([].slice),t.bind({}.toString)),n=function(t){return"undefined"==typeof t},r=function(t){var n="[object "+t+"]";return function(t){return e(t)==n}},i=function(t){var n="[object "+t+"]";return function(r){if(e(r)!==n)throw new TypeError("Expected "+t);return r}},a=r("Array"),o=i("Array"),s=function(t){return function(e){return("undefined"==typeof e?"undefined":F(e))==t}},u=function(t){return function(e){if(("undefined"==typeof e?"undefined":F(e))!==t)throw new TypeError("Expected a"+("object"===t?"n":"")+t+".");return e}},c=u("function"),l=s("function"),h=function(t){return function(e){if(!(e instanceof t))throw new TypeError("Expected an instance of "+t);return e}},f=function(t){if((0|t)!==t)throw new TypeError("Expected a 32-bit natural.");return t},p=function(t){if((0|t)!==t||t<0)throw new TypeError("Expected a 32-bit natural.");return t};return{int32:f,nat32:p,func:c,isFunc:l,typeOf:u,isTypeOf:s,arr:o,isArr:a,classOf:i,isClassOf:r,instanceOf:h,isUndef:n}}();"function"!=typeof Object.assign&&!function(){Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}}();var z=(e.TOKINIZATION_RX=E(),e.StackDedup=function(){function t(e){n(this,t),this.length=0,this.data=[],e&&this.push(e),this.maxLen=0}return j(t,[{key:"forEach",value:function(t){for(var e=this.data,n=0;n<this.length;n++)t(e[n],n,this);return this}},{key:"reduce",value:function(t,e){for(var n=this.data,r=0;r<this.length;r++)e=t(e,n[r],r,this);return e}},{key:"filter",value:function(e){var n=new t,r=this.data;n.maxLen=this.maxLen;for(var i=0;i<this.length;i++)e(r[i],i,this)&&n.push(r[i]);return n}},{key:"map",value:function(e){var n=new t,r=this.data;n.maxLen=this.maxLen;for(var i=0;i<this.length;i++)n.push(e(r[i],i,this));return n}},{key:"toArray",value:function(){return this.reduce(O,[])}},{key:"reset",value:function(){return this.length=0,this.maxLen=0,this}},{key:"push",value:function(t){if(void 0===t)return this;for(var e=this.data,n=this.length,r=0;r<n;r++)if(e[r]===t)return this;return e[this.length++]=t,this.length>this.maxLen&&(this.maxLen=this.length),this}},{key:"pop",value:function(){return this.length<=0?this:(length--,this)}},{key:"top",value:function(){if(!(this.length<=0))return data[this.length-1]}},{key:"addAll",value:function(t){var e=this;return t?(t.forEach(function(t){return e.push(t)}),this):this}}]),t}(),function(){function t(e,r){n(this,t),this.head=e,this.tail=r}return j(t,[{key:"equals",value:function(t){return null!==t&&(this.head===t.head&&this.tail===t.tail)}},{key:"addAll",value:function(t){return t?I(a).reduce(function(t,e){return S(e,t)},this):this}},{key:"map",value:function(t){return C(t,this)}},{key:"reduce",value:function(t,e){return V(t,this,e)}},{key:"reverse",value:function(t){return I(this,t)}}]),t}())},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){}function a(){}function o(){}function s(){}function u(t){return t&&"U"==t.type&&"MULTIRANGE"==t.op}function c(t){return function(e){return[!(e===Z||void 0!==e&&!e.match(t)),void 0]}}function l(t){return[t!==Z,void 0]}function h(t){return function(e){return[!(e===Z||void 0!==e&&e!==t),t]}}function f(t){return/[^a-zA-Z0-9]/.test(t||".")}function p(t,e){var n=f(t),r=f(e);return[n&&!r||!n&&r,void 0]}function d(){return!1}function v(t,e){if((m(t)||g(t))&&e)return t.nextNode=e,t;if(k(t)){var n=e?v(t.right,e):t.right;return v(t.left,n),t}if(_(t)&&e)return t.left===j?t.left=e:v(t.left,e),t.right===j?t.right=e:v(t.right,e),t;if(E(t)&&e)return v(t.left,e),t.nextNode=e,t;if(b(t)&&e){var r=t;return v(t.left,r),t.nextNode=e,t}return t}function y(t,e){var n=function(){return e||t.val};return t.toString=n,t}function m(t){return t&&!t.oper&&t.multi!==s&&t.match}function g(t){return t&&!t.oper&&t.multi===s&&t.match}function k(t){return t&&t.oper===Y}function _(t){return t&&t.oper===B}function E(t){return t&&t.oper===U}function b(t){return t&&t.oper===X}function x(t){return t&&"N"===t.type&&"ANY"===t.op}function O(t){return t&&"N"===t.type&&("CHARSET"===t.op||"SPECIAL-CHARSET"===t.op)}function S(t){return"<SKIP>"==t?j:"("==t||"(?:"==t?F:")"==t?z:"."==t?{type:"N",val:"(.)",multi:i,op:"ANY",match:l}:"[\\b]"==t?{type:"N",val:"\b",multi:a,op:"SINGLE",match:c(/[\b]/)}:"^"==t||"$"==t?{type:"N",val:t,multi:s,op:"BOUNDARY",match:d}:"\\b"==t||"\\B"==t?{type:"N",val:t,multi:s,op:"BOUNDARY",match:p}:/^\[.*\]$/.test(t)?{type:"N",val:t,multi:i,op:"CHARSET",match:c(new RegExp(t))}:"|"==t?B:/^[?+*]\??$/.test(t)?G[t.substring(0,1)]:/^\{[^}]*\}$/.test(t)?{type:"U",val:t,op:"MULTIRANGE",fn:(0,K.parseMulti)(t)}:/^\\[dDsSwW]$/.test(t)?{type:"N",val:t,multi:i,op:"SPECIAL-CHARSET",match:c(q[t])}:/^\\[trn]$/.test(t)?{type:"N",val:$[t.substring(1,2)],multi:a,op:"NON-PRINTING",match:c("\\"+t.substring(1))}:/^\\[.?+*{}()$^\\:]$/.test(t)?{type:"N",val:t.substring(1,2),multi:a,op:"SINGLE",match:h(t.substring(1))}:{type:"N",val:t,multi:a,op:"SINGLE",match:h(t)}}function w(t){if(void 0!==t){if(t===Z)return Z;if("N"===t.type&&void 0===t.oper)return{type:"N",val:t.val,multi:t.multi,op:t.op,match:t.match};if(t.left&&(k(t)||E(t)||b(t)||_(t)))return t.right?{oper:t.oper,left:w(t.left),right:w(t.right)}:{oper:t.oper,left:w(t.left)};throw new Error("Copy of an invalid node "+t)}}function A(t,e,n){return t===Y?I(e,n):t===B?R(e,n):n?{oper:t,left:e,right:n}:e}function I(t,e){return t===j?e:e===j?t:e?{oper:Y,left:t,right:e}:t}function R(t,e){return e?{oper:B,left:t,right:e}:t}function N(t){return{oper:X,left:t}}function M(t,e){return!(t<e)&&(t>e||(0,K.odd)(t))}function D(t,e){for(var n=0;n<J.length;n++)if((0,K.array_match)(t,J[n].match,e))return J[n]}function P(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=D(t,n);i?((0,K.array_append)(e,i.put),n+=i.match.length-1):e.push(t[n])}return e}function C(t){t&&("|"==t[t.length-1]&&(t=t.concat("<SKIP>")),"|"==t[0]&&(t=["<SKIP>"].concat(t)));for(var e=P(t);!(0,K.array_eq)(t,e);)t=e,e=P(t);return t}function T(t,e){return e&&t&&t.oper?"("+T(t)+")":t&&t.oper?"B"==t.oper.type?"."==t.oper.op?"("+T(t.left)+"."+T(t.right)+")":"("+T(t.left)+"|"+T(t.right)+")":"U"==t.oper.type?"("+T(t.left,!1)+t.oper.val+")":void 0:t===Z?"<DONE>":t.val}function L(t,e){return e&&t&&t.oper?"("+T(t)+")":t&&t.oper?"B"==t.oper.type?"."==t.oper.op?t.nextNode?"("+L(t.left)+"."+L(t.nextNode)+")":L(t.left):"("+L(t.left)+"|"+L(t.right)+")":"U"==t.oper.type?t.nextNode?"(("+T(t.left,!1)+t.oper.val+")."+L(t.nextNode)+")":"("+T(t.left,!1)+t.oper.val+")":void 0:t===Z?"<DONE>":t&&t.nextNode?"("+t.val+"."+L(t.nextNode)+")":t?t.val:""}Object.defineProperty(e,"__esModule",{value:!0}),e.RxParser=e.RXTREE=e.FAILED=e.MAYBE=e.MORE=e.DONE=void 0;var V=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.MANY=i,e.TERM=a,e.PERHAPS_MORE=o,e.BOUNDARY=s,e.makeFSM=v,e.matchable=m,e.boundary=g,e.dot=k,e.or=_,e.zero_or_one=E,e.zero_or_more=b,e.anychar=x,e.charset=O,e.copyNode=w,e.printExpr=T,e.printExprN=L;var K=n(1);if(!K.array_append)throw new Error("array_append is undefined");var j=y({type:"N",val:"<SKIP>",multi:a,op:"SKIP",match:l}),F=(y({type:"N",val:"\b",multi:a,op:"SINGLE",match:c(/[\b]/)}),y({type:"L",val:")"})),z=y({type:"R",val:")"}),B=y({type:"B",val:"|",op:"OR"}),U=y({type:"U",val:"?",op:"MULTI"}),X=y({type:"U",val:"*",op:"MULTI"}),H=y({type:"U",val:"+",op:"MULTI"}),Y=y({type:"B",val:".",op:"."}),W=function(){return!1},Z=e.DONE=y({type:"N",val:"DONE",multi:s,op:"DONE",match:W}),G=(e.MORE=y({type:"N",val:"MORE",multi:s,op:"MORE",match:W}),e.MAYBE=y({type:"N",val:"MAYBE",multi:s,op:"MAYBE",match:W}),e.FAILED=y({type:"N",val:"FAILED",multi:s,op:"FAILED",match:W}),e.RXTREE={matchable:m,boundary:g,dot:k,or:_,zero_or_one:E,zero_or_more:b,OR:B,ZERO_OR_ONE:U,ZERO_OR_MORE:X,ONE_OR_MORE:H,DOT:Y,FALSE:W},{"*":X,"+":H,"?":U}),q={"\\d":/\d/,"\\D":/\D/,"\\s":/\s/,"\\S":/\S/,"\\w":/\w/,"\\W":/\W/},$={t:"\t",n:"\n",r:"\r"},J=[{match:["(","|",")"],put:["(",")"]},{match:["<SKIP>","|","<SKIP>"],put:["<SKIP>"]},{match:["<SKIP>","<SKIP>"],put:["<SKIP>"]},{match:["(","<SKIP>",")"],put:["<SKIP>"]},{match:["<SKIP>","*"],put:["<SKIP>"]},{match:["<SKIP>","+"],put:["<SKIP>"]},{match:["(","|"],put:["(","<SKIP>","|"]},{match:["|",")"],put:["|","<SKIP>",")"]},{match:["|","|"],put:["|","<SKIP>","|"]},{match:["(",")"],put:["<SKIP>"]}];e.RxParser=function(){function t(){r(this,t),this.operand=[],this.operator=[],this.basePrec=0,this.wasOp=!0,this.lastop=void 0}return V(t,[{key:"toString",value:function(){return"{ operand: "+this.operand.map(T)+" operator: "+this.operator.map(function(t){return t.toString()})+" prec: "+this.BasePrec+" wasOp: "+this.wasOp+"}"}},{key:"opState",value:function(t,e,n){var r=function(t){return t?"OPERATOR":"OPERAND"};if(this.lastop=n,this.wasOp!=t)throw new Error("RegExp parsing expected: "+r(t)+" but was: "+r(this.wasOp));this.wasOp=e}},{key:"addToken",value:function(t){if(!t)return this.finishUp();var e=S(t);switch("N"!=e.type&&"L"!=e.type||this.wasOp||(this.pushOp(Y,this.basePrec+4),this.opState(!1,!0)),e.type){case"L":this.opState(!0,!0,F),this.basePrec+=10;break;case"R":if(this.opState(!1,!1,z),this.basePrec-=10,this.basePrec<0)throw Error("Syntax error "+this.basePrec);break;case"":case"B":this.pushOp(e,this.basePrec+2),this.opState(!1,!0,e);break;case"U":this.pushOp(e,this.basePrec+7),this.opState(!1,!1,e);break;case"N":this.operand.push(e),this.opState(!0,!1,e);break;default:throw Error("Syntax error")}return this}},{key:"pushOp",value:function(t,e){for(var n=this.topV()||{prec:-100};n&&M(n.prec,e);){var r,i;i=this.popOper(),n.op.type&&"B"!=n.op.type?u(n.op)?this.operand.push(this.applyMulti(n.op,i)):n.op===H?this.oneOrMore(i):this.unaryOp(n.op,i):(r=this.popOper(),this.operand.push(A(n.op,r,i))),this.operator.pop(),n=this.topV()}e>=0&&this.operator.push({op:t,prec:e})}},{key:"finishUp",value:function(){return void 0===this.wasOp?this:(this.wasOp?this.pushOp(void 0,-1):(this.pushOp(Y,0),this.operand.push(Z),this.pushOp(void 0,-1)),this.wasOp=void 0,this)}},{key:"val",value:function(){return 0===this.operand.length?void 0:this.operand[this.operand.length-1]}},{key:"topV",value:function(){return 0===this.operator.length?void 0:this.operator[this.operator.length-1]}},{key:"popOper",value:function(){return this.operand.pop()}},{key:"applyMulti",value:function(t,e){var n,r=t.fn.min,i=t.fn.max;if(g(e))throw new SyntaxError("repetition of boundary element: '"+e.val+"'' has no meaning");var a=function(t,e,r){if(0===r)return t;for(n=0;n<r;n++)e=w(e),t=t?I(t,e):e;return t||e};return 0===r?void 0===i?{oper:X,left:e}:a(void 0,{oper:U,left:e},i):void 0===i?a(a(void 0,e,r),{oper:X,left:e},1):a(a(e,e,r-1),{oper:U,left:w(e)},i-r)}},{key:"oneOrMore",value:function(t){if(g(t))throw new SyntaxError("repetition of boundary element: "+t.val+" has no meaning");this.operand.push(I(t,N(w(t))))}},{key:"unaryOp",value:function(t,e){if(g(e))throw new SyntaxError("modifier ("+t.val+") of boundary element: "+e.val+" has no meaning");this.operand.push({oper:t,left:e})}}],[{key:"parse",value:function(e){"string"!=typeof e&&(e=e.toString().replace(/\\\//g,"/").replace(/^\/|\/$/g,""));var n=C(e.match(K.TOKINIZATION_RX));n=n||[];var r=n.reduce(function(t,e){return t.addToken(e)},new t);return r.val()&&r.pushOp(Y,0),r.operand.push(Z),r.pushOp(void 0,-1),v(r.val())}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){return new M(t,e)}function a(t){return t.split("").map(function(t){return"*"===t?O:"?"===t?w:"_"===t?S:t}).join("")}function o(t){return t==S||s(t)}function s(t){return t==w||t==O}function u(t){return t===S}function c(t){for(var e=void 0,n=[],r=0;r<t.length;r++){var i=t.charAt(r);s(i)&&e===i||(e=i,n.push(i))}return n.join("")}function l(t,e){for(var n=0;n<t.length;n++)if(!e(t.charAt(n)))return t.substring(n+1,t.length);return t}function h(t,e){for(var n=(t.length<e.length?t.length:e.length,l((0,b.rprefix)(t,e),s)),r="",i=1,a=2,o=function(t){var e=0;return function(n){switch(n){case i:return e<t.length?t.charAt(e):void 0;case a:e++;break;default:return e<t.length}}},u=function(t,e){return t==e||s(t)&&s(e)},c=function(t,e){return t===O?t:e},h=o(t),f=o(e);h()&&f();){var p=h(i),d=f(i),v=s(p)||s(d);u(p,d)?(r+=c(p,d),h(a),f(a)):v?s(p)?(r+=p,h(a)):(r+=d,f(a)):(r+=S,h(a),f(a))}return(0,b.sRightMerge)(r,n)}function f(t){var e=t.charCodeAt(0);return e>=97&&e<=122}function p(t){return void 0!==t&&t.filter(function(t){return t===x.DONE}).length===t.length}function d(t,e,n,r,i){function a(s,u,c){if(!s)return t(u);if(c&&s===(0,b.n_head)(c))return a(s.nextNode,o(s,u),(0,b.n_tail)(c));if(s===x.DONE)return t(u);if((0,x.dot)(s))return a(s.left,u,c);if((0,x.or)(s)){var l=a(s.left,u,c),h=a(s.right,u,c);return n(l,h)}if((0,x.zero_or_one)(s))return r?r(s,u,a,c):a(s.nextNode,e(u,w),c);if((0,x.zero_or_more)(s))return r?r(s,u,a,c):a(s.nextNode,e(u,O),c);if((0,x.matchable)(s)){var f=(0,x.matchable)(s)(void 0),p=f[1]||(i?i(s,S):S);return a(s.nextNode,e(u,p),c)}return(0,x.boundary)(s)?a(s.nextNode,u,c):t(u)}var o=function(t,n){return(0,x.zero_or_more)(t)?e(n,O):n};return a}function v(t,e,n){function r(r,i){return r.reduce(function(n,r){return e(n,t(r,i))},n())}return r}function y(t,e){if(!t)return e;switch(t.val){case"[0-9]":case"\\d":return"9̲";case"[A-Za-z]":case"[a-zA-Z]":case"[a-z]":return"a̲";case"[A-Z]":return"A̲";case"[0-9A-Za-z]":case"[A-Z0-9a-z]":case"[A-Za-z0-9]":case"[0-9a-zA-Z]":case"[a-z0-9A-Z]":case"[a-zA-Z0-9]":return"z̲";default:return e}}function m(t){if(t&&t!==x.DONE){if((0,x.dot)(t))return m(t.left);if((0,x.matchable)(t)){var e=(0,x.matchable)(t)(void 0);return e[1]}if((0,x.or)(t)){var n=m(t.left),r=m(t.right);return n===r?n:void 0}(0,x.zero_or_one)(t)||(0,x.zero_or_more)(t)||(0,x.boundary)(t)}}function g(t){var e=t&&t.length>0?m(t.data[0]):void 0;if(void 0!==e)return t.reduce(function(t,e){return t===m(e)?t:void 0},e)}function k(t,e){return t===-1||e===-1?-1:t+e}function _(t){if(!t)return 0;if(t===x.DONE)return 0;if((0,x.dot)(t))return k(_(t.left),_(t.right));if((0,x.or)(t)){var e=_(t.left);return e>=0&&e===_(t.right)?e:-1}if((0,x.zero_or_one)(t)||(0,x.zero_or_more)(t))return-1;if((0,x.matchable)(t)){var n=(0,x.matchable)(t)(void 0);return n[1]}return(0,x.boundary)(t)?_(t.left):0}Object.defineProperty(e,"__esModule",{value:!0}),e.IREGEX=void 0;var E=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.incrRegEx=i,e.convertMask=a,e.isMeta=o,e.isOptional=s,e.isHolder=u,e.__isDoneN=p;var b=n(1),x=n(2),O="⋯",S="_",w="◑",A=function(t,e){var n=function(t){return void 0===t?[]:[t]},r=function(t,e){return t+e},i=function(t,e){return(0,b.flatten)([t,e])},a=function(t,e){return(0,b.flatten)((0,b.arr_push)(t,e))},o=function(t,e,n,r){if(t.left){var a=n(t.nextNode,e,r),o=n(t.left,e,(0,b.n_cons)(t,r));return i(a,o)}},s=e?o:void 0;return v(d(n,r,i,s,t),a,n)},I=A(y,!0),R=A(y,!1),N=function(){var t=function(t){return t},e=function(t,e){return t+e},n=function(t,e){return h(t,e)},r=function(t,e){return h(t||e,e)},i=v(d(t,e,n),r,t);return function(t){return c(i(t,""))}}(),M=e.IREGEX=function(){function t(e,n){r(this,t);var i=30;e||n?(!n&&e&&(n=x.RxParser.parse(e)),this.str=e,this.base=n,this.tracker=[],this.current=new b.StackDedup(n),this.one=this.current,this.two=new b.StackDedup,this.lastCh=void 0,this.maxLen=0,this.mask=void 0,this._len=30):(this.str="",this.base=void 0,this.tracker=void 0,this.current=void 0,this.one=this.current,this.two=void 0,this.lastCh=void 0,this.maxLen=0,this._mask=void 0,i=_(this.base),i<=0&&(i=30),this._len=i)}return E(t,[{key:"toString",value:function(){return this.str}},{key:"getInputLength",value:function(){return this.tracker.length}},{key:"isDone",value:function(t){return(t>=this.tracker.length||void 0===t)&&this.state()===x.DONE}},{key:"getTree",value:function(){return this.base}},{key:"minChars",value:function(){return this._mask=N(this.current),this._mask}},{key:"minCharsList",value:function(t){var e=t?I:R;return(0,b.arr_uniq)(e(this.current,this.inputStr()))}},{key:"match",value:function(t){var e=g(this.current),n=this.test(t===S?void 0:t);return void 0===n&&t&&f(t)&&(n=this.test(t.toUpperCase()),t=t.toUpperCase()),this._update(n,t,e)}},{key:"matchStr",value:function(t){var e=t.length,n=!0,r=0,i=0;for(i=0;i<e;i++){var a=t[i];if(!this.match(a)){n=!1;break}this.lastCh=a,r++}return[n,r,t.substring(0,i)]}},{key:"state",value:function(){return this._state=this._state||this._stateCompute(),this._state}},{key:"stateStr",value:function(){var t=this.state();return t===x.MORE?"MORE":t===x.MAYBE?"OK":"DONE"}},{key:"inputStr",value:function(){return this.tracker.map(function(t){return t[0]}).join("")}},{key:"fixed",value:function(){return g(this.current)}},{key:"reset",value:function(){return this.tracker=[],this.current.reset(),this.current.push(this.base),this.lastCh=void 0,this._state=void 0,this._mask=void 0,this}},{key:"clone",value:function(){var t=i();return t.str=this.str,t.base=this.base,t.tracker=this.tracker.slice(0),t.one=this.one.map(b.ID),t.two=this.two.map(b.ID),t.current=this.current==this.one?t.one:t.two,t.lastCh=this.lastCh,t._state=this._state,t._mask=void 0,t._len=this.length,t}},{key:"getInputTracker",value:function(){return this.tracker.map(b.ID)}},{key:"_after",value:function(t,e){if(e){var n=this.tracker.filter(function(n,r){return r>=e&&(t||void 0===n[1])});return n.map(function(t){return t[0]}).join("")}var r=t?this.tracker:this.tracker.filter(function(t){return void 0===t[1]});return r.map(function(t){return t[0]}).join("")}},{key:"_getArr",value:function(){return this.current===this.one?this.two.reset():this.one.reset()}},{key:"action",value:function(t,e,n,r){if(t===x.DONE)return e===x.DONE?(n.push(x.DONE),x.DONE):x.FAILED;if((0,x.dot)(t))return this.action(t.left,e,n,r);if((0,x.or)(t)){var i=this.action(t.left,e,n,r),a=this.action(t.right,e,n,r);return this._result(i,a)}if((0,x.zero_or_one)(t)||(0,x.zero_or_more)(t)){var o=(0,x.boundary)(t.left)?x.DONE:this.action(t.left,e,n,!0),s=this.action(t.nextNode,e,n,r);return this._result(o,s)}if((0,x.matchable)(t)){var u=t.match(e);return u[0]&&n.push(t.nextNode),u[0]?t.nextNode===x.DONE?x.DONE:x.MORE:x.FAILED}if((0,x.boundary)(t)){if(r)return x.FAILED;var c=t.match(this.lastCh,e);return c[0]?(t=t.nextNode,c=this.action(t,e,n)):x.FAILED}return x.FAILED}},{key:"_result",value:function(t,e){return t===e?t:t===x.MORE||e===x.MORE?x.MORE:void 0}},{key:"test",value:function(t,e){var n=this;e=e||this.current;var r=x.FAILED,i=this._getArr();if(e.forEach(function(e){r=n._result(n.action(e,t,i),r)}),r!==x.FAILED&&0!==i.length)return i}},{key:"_update",value:function(t,e,n){return void 0!==t&&(this.tracker.push([void 0===e?S:e,n]),t.maxLen>this.maxLen&&(this.maxLen=t.maxLen),this.current=t,this.lastCh=e,this._state=void 0,this._mask=void 0),
void 0!==t}},{key:"_stateCompute",value:function(){var t=this.test(void 0);if(void 0===t)return x.DONE;var e=this.test(x.DONE);return p(e)?x.MAYBE:x.MORE}},{key:"length",get:function(){return this._len}}]),t}()},function(t,e){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};t.exports=r},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.RxMatcher=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=(n(1),n(3)),o=n(2);e.RxMatcher=function(){function t(e){r(this,t),this.matcher=e,this._lastEditableIndex=void 0}return i(t,[{key:"getFirstEditableAtOrAfter",value:function(t){for(var e=t,n=this.getInputTracker();e<n.length;e++)if(void 0===n[e][1])return e;var r=this.minChars();e=n.length;for(var i=0;i<r.length&&!(0,a.isMeta)(r.charAt(i));i++,e++);return e}},{key:"getFirstEditableAtOrBefore",value:function(t){var e=this.getInputTracker();for(t>=e.length&&(t=e.length-1);t>0;t--)if(void 0===e[t][1])return t;return 0}},{key:"getInputLength",value:function(){return this.matcher.getInputLength()}},{key:"setPos",value:function(t){if(void 0!==t){var e=this.getInputTracker(),n=e.map(function(t){return t[0]}).join("").substr(0,t);for(this.reset(),this.matchStr(n),e=this.getInputTracker();e.length<t&&void 0!==this.fixed();)if(!this.match(this.fixed())){t=this.getInputLength();break}this._resetCache()}return t}},{key:"toString",value:function(){return this.matcher.toString()}},{key:"after",value:function(t){return this.matcher._after(!0,t)}},{key:"valueWithMask",value:function(){return this.matcher.valueWithMask()}},{key:"rawValue",value:function(t){return this.matcher.rawValue(t)}},{key:"_after",value:function(t,e){return this.matcher._after(t,e)}},{key:"isDone",value:function(t){return this.matcher.isDone(t)}},{key:"setToFirstEditableAfter",value:function(t){return void 0===t&&(t=this.getInputLength()),this.setPos(this.getFirstEditableAtOrAfter(t))}},{key:"lastEditableIndex",value:function(){if(void 0===this._lastEditableIndex){var t=this.getInputTracker(),e=this.clone(),n=this.getFirstEditableAtOrAfter(t.length);e.setPos(n),e.state()===o.DONE&&(n=t.length),this._lastEditableIndex=n}return this._lastEditableIndex}},{key:"getTree",value:function(){return this.matcher.getTree()}},{key:"minChars",value:function(t){if(void 0===t)return this.matcher.minChars();var e=this.matcher.clone(),n=this.matcher._after(!0,0).substring(0,t);e.reset();var r=e.matchStr(n);if(!r[0])throw new Error("Unexpected error (matchStr failed) from "+e.constructor.name||"IREGEX");return e.minChars()}},{key:"minCharsList",value:function(t){return this.matcher.minCharsList(t)}},{key:"emptyAt",value:function(t){var e=this.getInputTracker();return t<e.length&&(0,a.isHolder)(e[t][0])}},{key:"match",value:function(t){return this._resetCache(),this.matcher.match(t)}},{key:"matchStr",value:function(t){return this._resetCache(),this.matcher.matchStr(t)}},{key:"state",value:function(){return this.matcher.state()}},{key:"fixed",value:function(){return this.matcher.fixed()}},{key:"reset",value:function(){return this.matcher.reset(),this._resetCache(),this}},{key:"clone",value:function(){return new t(this.matcher.clone())}},{key:"getInputTracker",value:function(){return this.matcher.tracker}},{key:"getFullTracker",value:function(){var t=this.getInputTracker(),e=this.matcher.minChars().map(function(t){return(0,a.isMeta)(t)?[t,void 0]:[t,t]});return[].concat(t,e)}},{key:"_resetCache",value:function(){this._lastEditableIndex=void 0}},{key:"stateStr",value:function(){return this.matcher.stateStr()}},{key:"length",get:function(){return this.matcher.length}}]),t}()},function(t,e,n){"use strict";function r(t){var e={},n=a.apply(i,o.call(arguments,1));for(var r in t)s(n,r)===-1&&(e[r]=t[r]);return e}var i=Array.prototype,a=i.concat,o=i.slice,s=n(14);t.exports=r},function(t,e,n){"use strict";function r(t,e){return!(!t||!e)&&(t===e||!i(t)&&(i(e)?r(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}var i=n(11);t.exports=r},function(t,e){"use strict";function n(t){try{t.focus()}catch(e){}}t.exports=n},function(t,e){"use strict";function n(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(t){return document.body}}t.exports=n},function(t,e){"use strict";function n(t){return!(!t||!("function"==typeof Node?t instanceof Node:"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName))}t.exports=n},function(t,e,n){"use strict";function r(t){return i(t)&&3==t.nodeType}var i=n(10);t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isHolder=e.isOptional=e.isMeta=e.convertMask=e.IREGEX=e.zero_or_more=e.zero_or_one=e.or=e.dot=e.matchable=e.RxMatcher=e.contract=e.RXInputMask=e.RxParser=e.printExpr=e.incrRegEx=e.FAILED=e.MAYBE=e.MORE=e.DONE=void 0;var r=n(1),i=n(2),a=n(3),o=n(13),s=n(5);if(void 0===a.incrRegEx)throw new Error("incrRegEx not defined");if(void 0===o.RXInputMask)throw new Error("RXInputMask not defined");if(void 0===s.RxMatcher)throw new Error("RxMatcher not defined");e.DONE=i.DONE,e.MORE=i.MORE,e.MAYBE=i.MAYBE,e.FAILED=i.FAILED,e.incrRegEx=a.incrRegEx,e.printExpr=i.printExpr,e.RxParser=i.RxParser,e.RXInputMask=o.RXInputMask,e.contract=r.contract,e.RxMatcher=s.RxMatcher,e.matchable=i.matchable,e.dot=i.dot,e.or=i.or,e.zero_or_one=i.zero_or_one,e.zero_or_more=i.zero_or_more,e.IREGEX=a.IREGEX,e.convertMask=a.convertMask,e.isMeta=a.isMeta,e.isOptional=a.isOptional,e.isHolder=a.isHolder},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){return e=e||t,{start:Math.min(t,e),end:Math.max(t,e)}}function a(t,e,n){return o(i(t.start+e,t.end+(void 0===n?e:n)))}function o(t,e,n,r){n=n||function(t){return t},r=r||n;var i=function(t,e,n){return n(Math.max(Math.min(t,e.end),e.start))};return e?{start:i(t.start,e,r),end:i(t.end,e,n)}:t}function s(t){return!t}function u(t){return t?t.end-t.start:0}function c(t){return s(u(t))}function l(t,e){return t.start>e.start}function h(t,e){return t===e}function f(t){for(var e=t.minChars(),n=0;e.length>n&&!(0,_.isMeta)(e.charAt(0));n++){if(!t.match(e.charAt(0)))return n>0;e=t.minChars()}return n>0}function p(t,e){var n=t.minChars();if(e=!!e,e!==!0&&n.length>1&&(0,_.isOptional)(n.charAt(0))&&!(0,_.isMeta)(n.charAt(1))){if(t.match(n.charAt(1)))return!0}else if(n.length>0&&!(0,_.isMeta)(n.charAt(0)))return t.match(n.charAt(0));return!1}function d(t,e){if(t.match(e))return!0;for(var n=t.clone();p(t,!1);)if(t.match(e))return!0;return t.reset(),t.matchStr(y(n,!0,0)),!1}function v(t){for(var e=t.length-1;e>=0&&(0,_.isHolder)(t.charAt(e));e--);return t.substring(0,e+1)}function y(t,e,n){var r=t.getInputTracker();if(n){var i=r.filter(function(t,r){return r>=n&&(e||void 0===t[1])});return i.map(function(t){return t[0]}).join("")}var a=e?r:r.filter(function(t){return void 0===t[1]});return a.map(function(t){return t[0]}).join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.RXInputMask=void 0;var m=function(){function t(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(u){i=!0,a=u}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.trimHolder=v,e._after=y;var k=n(1),_=n(3),E=n(5),b=(n(2),e.RXInputMask=function(){function t(e){if(r(this,t),e=(0,k.assign)({pattern:null,selection:{start:0,end:0},value:"",history:{data:[],index:null,lastOp:null}},e),null===e.pattern)throw new Error("RXInputMask: you must provide a pattern.");this.setPattern(e.pattern,{value:e.value,selection:e.selection,history:e.history})}return g(t,[{key:"getState",value:function(){({pattern:this.pattern.clone(),selection:a(this.selection,0),value:this._getValue(),history:{data:[],index:null,lastOp:null}})}},{key:"input",value:function(t){if(c(this.selection)&&this.pattern.isDone(this.selection.start))return!1;var e=this._input(t,this.selection,this.pattern),n=m(e,3),r=n[0],i=n[1],a=n[2];if(!r)return!1;var o=this._getValue(),s=this.selection,u=this.pattern;return this._lastOp="input",this.selection=i,this.pattern=a,this.value=this.getValue(),null!==this._historyIndex&&(this._history.splice(this._historyIndex,this._history.length-this._historyIndex),this._historyIndex=null),("input"!==this._lastOp||!c(s)||null!==this._lastSelection&&s.start!==this._lastSelection.start)&&this._history.push({value:o,selection:s,lastOp:this._lastOp,pattern:u}),this._lastSelection=s,!0}},{key:"_input",value:function(t,e,n){c(e)&&n.emptyAt(e.start)&&(e=a(e,1));var r=n.clone();e=this._updateSelection(e,r.getFirstEditableAtOrAfter(e.start));var o=r.getFirstEditableAtOrAfter(e.end),s=y(r,!1,o),u=e.start;if(r.setPos(u),void 0!==t&&!d(r,t))return[!1,e,r];e=this._updateSelection(e,r.getInputLength()),o=Math.max(o,e.end);var l=r.getFirstEditableAtOrAfter(r.getInputLength()),h=this._insertRest(s,r,u,o+1);return f(h||r),[!0,i(l,l),h||r]}},{key:"_insertRest",value:function(t,e,n,r){function i(t,e,n,r,a){if(t>=e.length)return n;if(r>a||n.isDone())return n;var o=n.clone();if(d(o,e.charAt(t))){var s=i(t+1,e,o,o.getInputLength()-1,a);if(void 0!==s)return s}for(;p(n,!1););return n.match(void 0),i(t,e,n,r+1,a)}var a=i(0,t,e,n,r+t.length);return a}},{key:"backspace",value:function(){var t=this.pattern.getFirstEditableAtOrAfter(0);if(this.selection.start<t||this.selection.end<t)return!1;var e=(0,k.copy)(this.selection),n=this._getValue(),r=this.selection,a=r.start,o=r.end;if(a===o){if(a=this.pattern.getFirstEditableAtOrBefore(a-1),o=a+1,a<t)return}else if(a=this.pattern.getFirstEditableAtOrBefore(o<a?o:a),o===a&&o++,o<=t)return;var s=this._input(void 0,i(a,o),this.pattern),u=this.pattern;return!!s[0]&&(this.pattern=s[2],this.selection.start=this.selection.end=a,null!==this._historyIndex&&this._history.splice(this._historyIndex,this._history.length-this._historyIndex),("backspace"!==this._lastOp||e.start!==e.end||null!==this._lastSelection&&e.start!==this._lastSelection.start)&&this._history.push({value:n,selection:e,lastOp:this._lastOp,pattern:u}),this._lastOp="backspace",this._lastSelection=(0,k.copy)(e),!0)}},{key:"del",value:function(){return c(this.selection)?(this.right(this.selection),this.backspace()):this.backspace()}},{key:"paste",value:function(t){var e={value:this.value.slice(),selection:(0,k.copy)(this.selection),_lastOp:this._lastOp,_history:this._history.slice(),_historyIndex:this._historyIndex,_lastSelection:(0,k.copy)(this._lastSelection),pattern:this.pattern.clone()},n=this.getRawValueAt(this.selection.end);this.pattern.setPos(this.selection.start);var r=this._setValueFrom(this.selection.start,t);return this.selection.end=this.pattern.getInputLength(),!(!r||!this._setValueFrom(this.selection.end,n))||((0,k.assign)(this,e),!1)}},{key:"undo",value:function(){if(0===this._history.length||0===this._historyIndex)return!1;var t;if(null===this._historyIndex){this._historyIndex=this._history.length-1,t=this._history[this._historyIndex];var e=this._getValue();t.value===e&&t.selection.start===this.selection.start&&t.selection.end===this.selection.end||this._history.push({value:e,selection:(0,k.copy)(this.selection),lastOp:this._lastOp,startUndo:!0,pattern:this.pattern.clone()})}else t=this._history[--this._historyIndex];return this.pattern=t.pattern,this.setValue(t.value),this.selection=t.selection,this._lastOp=t.lastOp,!0}},{key:"redo",value:function(){if(0===this._history.length||null===this._historyIndex)return!1;var t=this._history[++this._historyIndex];return this._historyIndex===this._history.length-1&&(this._historyIndex=null,t.startUndo&&this._history.pop()),this.pattern=t.pattern.clone(),this.setValue(t.value),this.selection=t.selection,this._lastOp=t.lastOp,!0}},{key:"left",value:function(t){var e=(0,k.copy)(t);return e&&c(e)&&(e.start=e.end=t.start-1,this.setSelection(e)),this}},{key:"right",value:function(t){var e=(0,k.copy)(t);return e&&e.start===e.end&&(e.start=e.end=t.start+1,this.setSelection(e)),this}},{key:"setPattern",value:function(t,e){for(e=(0,k.assign)({value:""},e),this.pattern=new E.RxMatcher((0,_.incrRegEx)(t)),this.setValue(e.value),this.emptyValue=this.pattern.minChars(),this.setSelection(e.selection);this.skipFixed(!0););if(c(this.selection)&&0!==this.pattern.getInputTracker().length){var n=this._getValue();this.setValue(n),this.selection.start=this.selection.end=n.length}return this._resetHistory(),this}},{key:"select",value:function(t,e){return this.selection=e<t?i(e,t):i(t,e),this}},{key:"setSelection",value:function(t){var e=this,n=t===this.selection?this.selection:(0,k.copy)(t),r=this.selection||n,a=function(t){return e.pattern.getFirstEditableAtOrAfter(t)},s=function(t){return e.pattern.getFirstEditableAtOrBefore(t)};this.selection=r;var u=a(0),h=this.pattern.lastEditableIndex(),f=i(u,h);return c(n)?this.selection=o(n,f,l(this.selection,n)?s:a):this.selection=o(n,f,a,s),this}},{key:"_adjustSelection",value:function(t,e){return c(t)?i(e?this.pattern.getFirstEditableAtOrAfter(t.start):this.pattern.getFirstEditableAtOrBefore(t.start)):i(this.pattern.getFirstEditableAtOrBefore(t.start),this.pattern.getFirstEditableAtOrAfter(t.end))}},{key:"_setValueFrom",value:function(t,e){var n=this.pattern.clone(),r=!0;void 0!==t&&n.setPos(t);for(var i=t,a=0;a<e.length&&r;i++,a++){var o=e.charAt(a);r&=d(n,o)}return r&&(f(n),this.pattern=n),r}},{key:"setValue",value:function(t){var e=new b("RXInputMask:");if(this.getValue()===t)return!0;var n=this.pattern.clone();null===t&&(t=""),n.reset(),e.println("iterate over",t,"length:",t.length);for(var r=0;r<t.length;r++){var i=t.charAt(r);if(e.print("index: ",r,"char:",i,"minChars:",n.minChars(),"sameAsRest",h(t.substring(r),n.minChars()),"---"),h(t.substring(r),n.minChars()))break;if((0,_.isHolder)(i)&&(i=void 0),!d(n,i))return!1}return this.pattern=n,this.value=this.getValue(),!0}},{key:"minCharsList",value:function(t){return this.pattern.minCharsList(t)}},{key:"getSelection",value:function(){return(0,k.copy)(this.selection)}},{key:"_getValue",value:function(){return y(this.pattern,!0,0)}},{key:"getValue",value:function(){return y(this.pattern,!0,0)+this.pattern.minChars()}},{key:"getRawValue",value:function(){return y(this.pattern,!1,0)}},{key:"getRawValueAt",value:function(t){return y(this.pattern,!1,t)}},{key:"reset",value:function(){return this.pattern.reset(),this._resetHistory(),this.value=this.getValue(),this.selection.start=this.selection.end=0,this.setSelection(this.selection),this}},{key:"_resetHistory",value:function(){return this._history=[],this._historyIndex=null,this._lastOp=null,this._lastSelection=(0,k.copy)(this.selection),this}},{key:"_updateSelection",value:function(t,e){var n=(0,k.copy)(t);return n.start=e,e>n.end&&(n.end=e),n}},{key:"skipFixed",value:function(t){return p(this.pattern,t)}},{key:"isDone",value:function(){var t=this.pattern.clone(),e=this.getValue(),n=e.split("");if((0,k.arr_find)(function(t){return(0,_.isHolder)(t)},n))return"MORE";t.reset();for(var r=0;r<n.length;r++)if(!(0,_.isMeta)(n[r])&&!t.match(n[r]))return"MORE";return t.stateStr()}}]),t}(),function(){function t(e){r(this,t),this.content=e||""}return g(t,[{key:"print",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.content+=","+(e||[]).map(function(t){return JSON.stringify(t)}).join(" "),this}},{key:"println",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.print.apply(this,e),this.content+="\n",this}},{key:"flush",value:function(){console.log(this.content),this.content=""}}]),t}())},function(t,e){var n=[].indexOf;t.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}},function(t,e,n){"use strict";function r(t,e,n,r){return t===n&&e===r}function i(t){var e=document.selection,n=e.createRange(),r=n.text.length,i=n.duplicate();i.moveToElementText(t),i.setEndPoint("EndToStart",n);var a=i.text.length,o=a+r;return{start:a,end:o}}function a(t){var e=window.getSelection&&window.getSelection();if(!e||0===e.rangeCount)return null;var n=e.anchorNode,i=e.anchorOffset,a=e.focusNode,o=e.focusOffset,s=e.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(u){return null}var c=r(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),l=c?0:s.toString().length,h=s.cloneRange();h.selectNodeContents(t),h.setEnd(s.startContainer,s.startOffset);var f=r(h.startContainer,h.startOffset,h.endContainer,h.endOffset),p=f?0:h.toString().length,d=p+l,v=document.createRange();v.setStart(n,i),v.setEnd(a,o);var y=v.collapsed;return{start:y?d:p,end:y?p:d}}function o(t,e){var n,r,i=document.selection.createRange().duplicate();void 0===e.end?(n=e.start,r=n):e.start>e.end?(n=e.end,r=e.start):(n=e.start,r=e.end),i.moveToElementText(t),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function s(t,e){if(window.getSelection){var n=window.getSelection(),r=t[l()].length,i=Math.min(e.start,r),a=void 0===e.end?i:Math.min(e.end,r);if(!n.extend&&i>a){var o=a;a=i,i=o}var s=c(t,i),u=c(t,a);if(s&&u){var h=document.createRange();h.setStart(s.node,s.offset),n.removeAllRanges(),i>a?(n.addRange(h),n.extend(u.node,u.offset)):(h.setEnd(u.node,u.offset),n.addRange(h))}}}var u=n(4),c=n(17),l=n(18),h=u.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:h?i:a,setOffsets:h?o:s};t.exports=f},function(t,e,n){"use strict";function r(t){return a(document.documentElement,t)}var i=n(15),a=n(7),o=n(8),s=n(9),u={hasSelectionCapabilities:function(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&"text"===t.type||"textarea"===e||"true"===t.contentEditable)},getSelectionInformation:function(){var t=s();return{focusedElem:t,selectionRange:u.hasSelectionCapabilities(t)?u.getSelection(t):null}},restoreSelection:function(t){var e=s(),n=t.focusedElem,i=t.selectionRange;e!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,i),o(n))},getSelection:function(t){var e;if("selectionStart"in t)e={start:t.selectionStart,end:t.selectionEnd};else if(document.selection&&t.nodeName&&"input"===t.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===t&&(e={start:-n.moveStart("character",-t.value.length),end:-n.moveEnd("character",-t.value.length)})}else e=i.getOffsets(t);return e||{start:0,end:0}},setSelection:function(t,e){var n=e.start,r=e.end;if(void 0===r&&(r=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(r,t.value.length);else if(document.selection&&t.nodeName&&"input"===t.nodeName.toLowerCase()){var a=t.createTextRange();a.collapse(!0),a.moveStart("character",n),a.moveEnd("character",r-n),a.select()}else i.setOffsets(t,e)}};t.exports=u},function(t,e){"use strict";function n(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function r(t){for(;t;){if(t.nextSibling)return t.nextSibling;t=t.parentNode}}function i(t,e){for(var i=n(t),a=0,o=0;i;){if(3===i.nodeType){if(o=a+i.textContent.length,a<=e&&o>=e)return{node:i,offset:e-a};a=o}i=n(r(i))}}t.exports=i},function(t,e,n){"use strict";function r(){return!a&&i.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var i=n(4),a=null;t.exports=r},function(e,n){e.exports=t},function(t,n){t.exports=e}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-bootstrap")):"function"==typeof define&&define.amd?define(["react","react-bootstrap"],e):"object"==typeof exports?exports.RxInput=e(require("react"),require("react-bootstrap")):t.RxInput=e(t.React,t.ReactBootstrap)}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function a(t){return(t.ctrlKey||t.metaKey)&&t.keyCode===(t.shiftKey?_:k)}function o(t){return(t.ctrlKey||t.metaKey)&&t.keyCode===(t.shiftKey?k:_)}function s(t){return g.contract.isFunc(t.arrowAction)}function u(t){return JSON.stringify(t)}function c(t,e){return t===e||void 0!==t&&void 0!==e&&(t.start===e.start&&t.end===e.end)}function l(t,e){var n=t.toUpperCase(),r=e.toUpperCase();return n<r?-1:n>r?1:0}var h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f=n(19),p=r(f),d=n(6),v=r(d),y=n(20),m=n(16),g=n(12),k=90,_=89,E={DONE:[p.default.createElement("span",{className:"glyphicon glyphicon-ok form-control-feedback"}),""],MORE:[p.default.createElement("span",{className:"glyphicon glyphicon-arrow-right form-control-feedback"})," has-warning"],OK:[p.default.createElement("span",{className:"glyphicon glyphicon-option-horizontal form-control-feedback"}),""]},b=function(t){return t},x=p.default.createClass({displayName:"RxInput",propTypes:{mask:p.default.PropTypes.object.isRequired,name:p.default.PropTypes.string.isRequired,popover:p.default.PropTypes.string,selection:p.default.PropTypes.object,value:p.default.PropTypes.string},getDefaultProps:function(){return{value:""}},getInitialState:function(){var t={pattern:this.props.mask,value:this.props.value};return{focus:!1,value:this.props.value,selection:this.props.selection,mask:new g.RXInputMask(t)}},componentWillReceiveProps:function(t){console.log("HERE I AAM - componentWillReceiveProps",t),this.props.mask.toString()!==t.mask.toString()?(this.state.mask.setPattern(t.mask,{value:this.state.mask.getValue(),selection:this.state.mask.selection}),this.setState({selection:this.state.selection,value:t.value})):this.props.value!==t.value&&this.state.mask.setValue(t.value)},_updateMaskSelection:function(){this.state.mask.selection=(0,m.getSelection)(this.input)},_updateInputSelection:function(){c((0,m.getSelection)(this.input),this.state.mask.selection)||(0,m.setSelection)(this.input,this.state.mask.selection)},_onFocus:function(t){},_onBlurr:function(){},_onChange:function(t){var e=this.state.mask,n=e.getValue();if(t.target.value!==n){if(t.target.value.length<n.length){var r=n.length-t.target.value.length;this._updateMaskSelection(),e.selection.end=e.selection.start+r,e.backspace(),console.log("Fix maskValue",n,"diff:",r,"target value: ",t.target.value)}var i=this._getDisplayValue();t.target.value=i,i&&this._updateInputSelection()}this.setState({selection:this.mask.selection}),this.props.onChange&&this.props.onChange(t)},_onKeyDown:function(t){var e=this,n=this.state.mask,r=function(t){return function(e){return e.key===t}},i=function(r,i){if(!r(t))return!1;if(t.preventDefault(),e._updateMaskSelection(),i()){var a=e._getDisplayValue();t.target.value=a,a&&e._updateInputSelection()}return e.setState({selection:n.selection}),!0};if(!(i(a,function(){return n.undo()})||i(o,function(){return n.redo()})||i(r("Backspace"),function(){return n.backspace()})||i(r("Delete"),function(){return n.del()})||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||"Enter"===t.key||"ArrowLeft"!==t.key&&"ArrowRight"!=t.key)){var c=(0,m.getSelection)(this.input);c.start===c.end&&void 0!==n.left&&(t.preventDefault(),"ArrowLeft"===t.key?n.left(c):n.right(c),this._updateInputSelection()),console.log("Arrow Action support:",s(n)," value:",this._getDisplayValue()," selection: ",u((0,m.getSelection)(this.input)),u(n.selection))}},_onKeyPress:function(t){var e=this.state.mask;if(console.log("onKeyPress",u((0,m.getSelection)(this.input)),u(e.selection),t.key,t.target.value),!(t.metaKey||t.altKey||t.ctrlKey||"Enter"===t.key)){var n=(0,m.getSelection)(this.input),r=e.getSelection();t.preventDefault(),this._updateMaskSelection(),e.input(t.key)&&(t.target.value=e.getValue(),console.log("keyPress:getDisplayValue",this._getDisplayValue()," selection: ",u(n)+"/"+u(e.selection)+"<"+u(r)),this._updateInputSelection(),this.setState({selection:e.selection}))}},_onPaste:function(t){var e=this.state.mask;console.log("onPaste",u((0,m.getSelection)(this.input)),t.clipboardData.getData("Text"),t.target.value),t.preventDefault(),this._updateMaskSelection(),console.log("paste: ",t.clipboardData.getData("Text")),e.paste(t.clipboardData.getData("Text"))&&(t.target.value=e.getValue(),console.log("undo:getDisplayValue",this._getDisplayValue()),setTimeout(this._updateInputSelection,0),this.setState({selection:e.selection}))},_getMaskList:function(){var t=this.state.mask.minCharsList(!0);return t&&t.length<20?t:this.state.mask.minCharsList()},_getDisplayValue:function(){var t=this.state.mask.getValue();return t===this.state.mask.emptyValue?"":t},_createPopover:function(t,e,n){function r(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return(e>>>0)+12}var i=this,a=function(t){return b(t.replace(/\u0332/g,""),"strip:")};n=Math.max(150,n||12*Math.max.apply(null,t.map(function(t){return Math.min(25,a(t).length)}))),b(n,"MAX WIDTH:");var o=n||200,s={width:o-50,maxWidth:o-50},u=void 0,c=void 0;return!t||t.length<=1?p.default.createElement("div",null):(t.length>20&&(u={height:"400px",display:"block",overflow:"auto"},c=p.default.createElement("div",null,"             ")),p.default.createElement(y.Popover,{id:this.props.name+"myPopover",className:"col-xs-10 col-md-10",style:{width:o,maxWidth:o,fontSize:"10px",marginTop:"10px",marginBottom:"10px"}},p.default.createElement("table",{key:this.props.name+"myPopover1",className:"table-responsive table-striped table-hover table-condensed col-xs-10 col-md-10",style:s},p.default.createElement("thead",null,p.default.createElement("tr",null,e.map(function(t){return p.default.createElement("th",{key:i.props.name+t},t)}))),p.default.createElement("tbody",{style:u},t.sort(l).map(function(t){return p.default.createElement("tr",{onClick:function(e){return i.selected(t,e)},key:i.props.name+"L"+r(t)},p.default.createElement("td",null,t))}))),c))},render:function(){var t=this,e=this.props,n=(e.mask,e.size),r=e.placeholder,a=(i(e,["mask","size","placeholder"]),(0,v.default)(this.props,["popover","mask","selection"]));console.log("PROPS:",a);var o=void 0,s=this.state.mask.pattern,u=s.length;console.log("about to render name:'"+this.props.name+"' - "+this.state.mask.isDone());var c=this.props.popover?this._createPopover(this._getMaskList(),["Possible Values"]):p.default.createElement("span",null);console.log("about to render - "+this.state.mask.isDone());var l=this.state.mask.isDone();l&&(o=E[this.state.mask.isDone()]);var f={marginBotton:"0px",fontSize:"70%",color:"red",fontStyle:"italic"},d=p.default.createElement("div",{style:{marginBotton:"0px",paddingLeft:"100px"}},p.default.createElement("div",{style:f},l,"  "),p.default.createElement("div",{className:"form-group has-feedback"+o[1]},p.default.createElement(y.OverlayTrigger,{trigger:"focus",style:{marginBotton:"0px"},ref:"mypop",placement:"bottom",overlay:c},p.default.createElement("input",h({},a,{className:"form-control",ref:function(e){return t.input=e},maxLength:u,onChange:this._onChange,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onPaste:this._onPaste,placeholder:r||this.state.mask.emptyValue,size:n||u,value:this._getDisplayValue(),style:{padding:"3px 0px 3px 0px"}}))),o[0]));return d}});t.exports=x},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t){if(!t)return t;for(var e=1,n=arguments.length;e<n;e++){var r=arguments[e];if("function"==typeof r||"object"===("undefined"==typeof r?"undefined":F(r))&&null!==r)for(var i,a=-1,o=Object.keys(r),s=o?o.length:0;++a<s;)i=o[a],t[i]=r[i]}return t}function i(t){return r({},t)}function o(t,e){return!!t[e]}function s(t,e){var n,i=this;if("function"!=typeof i)throw new Error("Parent must be a constructor function");return n=o(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},r(n,i,e),n.prototype=Object.create(i.prototype),t&&r(n.prototype,t),n.prototype.constructor=n,n}function u(t){return t}function c(t){var e=[];return e.concat.apply(e,t)}function l(t,e){if(t===e)return!0;if(!t||!e)return!1;if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]instanceof Array&&t[n]instanceof Array){if(!l(t[n],e[n]))return!1}else if(e[n]!==t[n])return!1;return!0}function h(t){for(var e={},n=[],r=0;r<t.length;r++)t[r]in e||(n.push(t[r]),e[t[r]]=!0);return n}function f(t,e){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function p(t,e,n){if(!t||!e)return!1;var r=t.length,i=e.length;if(n+i>r)return!1;for(var a=n,o=0;o<i;a++,o++)if(e[o]instanceof Array&&t[a]instanceof Array){if(!p(t[a],e[o],0))return!1}else if(t[a]!==e[o])return!1;return!0}function d(t,e){for(var n=0;n<e.length;n++)t.push(e[n]);return t}function v(t){for(var e=[],n=0,r=t.length;n<=r;n++)e.push(t.charAt(r-n));return e.join("")}function y(t,e){for(var n=0;n<t.length&&n<e.length;n++)if(t.charAt(n)!==e.charAt(n))return t.substring(0,n);return t.length<e.length?t:e}function m(t,e){return v(y(v(t),v(e)))}function g(t,e){return t.length<e?t:t.substr(0,e)}function k(t,e){return t.length<e?t:t.substr(t.length-e,e)}function _(t,e){function n(t,e,n){for(var r=t.length-n,i=0;i<n;r++,i++)if(t.charAt(r)!==e.charAt(i))return!1;return!0}for(var r=Math.min(t.length,e.length),i=r;i>0;i--)if(n(t,e,i))return t.substr(0,t.length-i)+e;return t+e}function E(){var t="\\[(?:\\\\]|[^\\]])*\\]",e="[.\\]|)]|\\(\\?:|\\(|\\?\\?|\\?|\\*\\?|\\*|\\+\\?|\\+",n="\\\\(?:"+e+"|[dDsSbBwW\\[{}\\]])",r="\\{[0-9]+(?:,[0-9]*)?\\}",i="[^.+?{}\\]\\[|()]",a=[t,r,n,e,i].join("|");return new RegExp("("+a+")","g")}function b(t){var e=t.match(/\{(\d+)(,(\d*))?\}/),n=Number(e[1]);return{min:Number(e[1]),max:e[3]?Number(e[3]):e[2]?void 0:n}}function x(t){return(1&+t)>0}function O(t,e){return void 0===t?e:(t.push(e),t)}function S(t,e,n){return new z(t,e)}function w(t){if(!t)throw Error("n_head of empty list");return t.head}function A(t){if(!t)throw Error("n_tail of empty list");return t.tail}function I(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return t?I(A(t),S(w(t),e)):e}function R(t){return I(t.reduce(function(t,e){return S(e,t)},null))}function N(t){return R(t.split(""))}function M(t){return V(function(t,e){return t.push(e),t},t,[])}function D(t){return M(t).join("")}function P(t,e){return t&&t?S(w(t),P(A(t),e)):e}function C(t,e,n){return n=n||0,e?S(t(w(e),n,e),C(t,A(e),n+1)):e}function T(t,e,n){return e?(n=n||0,t(w(e),n,e)?S(w(e),T(t,A(e),n+1)):T(t,A(e),n+1)):e}function L(t,e,n){return n=n||0,e?t(w(e),n,e)?e:L(t,A(e),n+1):null}function V(t,e,n){return e?V(t,A(e),t(n,w(e))):n}function K(t,e,n){return 2===arguments.length&&(n=e,e=t,t=function(t,e){return t===e}),T(function(e){return!L(function(n){return t(n,e)},n)},e)}Object.defineProperty(e,"__esModule",{value:!0});var j=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.assign=r,e.copy=i,e.extend=s,e.ID=u,e.flatten=c,e.array_eq=l,e.arr_uniq=h,e.arr_find=f,e.array_match=p,e.array_append=d,e.sreverse=v,e.sprefix=y,e.rprefix=m,e.shead=g,e.stail=k,e.sRightMerge=_,e.parseMulti=b,e.odd=x,e.arr_push=O,e.n_cons=S,e.n_head=w,e.n_tail=A,e.n_reverse=I,e.arrayToList=R,e.stringToList=N,e.listToArray=M,e.listToString=D,e.n_concat=P,e.n_map=C,e.n_filter=T,e.n_find=L,e.n_reduce=V,e.n_removeAll=K;e.contract=function(){var t=Function.prototype.call,e=(t.bind([].slice),t.bind({}.toString)),n=function(t){return"undefined"==typeof t},r=function(t){var n="[object "+t+"]";return function(t){return e(t)==n}},i=function(t){var n="[object "+t+"]";return function(r){if(e(r)!==n)throw new TypeError("Expected "+t);return r}},a=r("Array"),o=i("Array"),s=function(t){return function(e){return("undefined"==typeof e?"undefined":F(e))==t}},u=function(t){return function(e){if(("undefined"==typeof e?"undefined":F(e))!==t)throw new TypeError("Expected a"+("object"===t?"n":"")+t+".");return e}},c=u("function"),l=s("function"),h=function(t){return function(e){if(!(e instanceof t))throw new TypeError("Expected an instance of "+t);return e}},f=function(t){if((0|t)!==t)throw new TypeError("Expected a 32-bit natural.");return t},p=function(t){if((0|t)!==t||t<0)throw new TypeError("Expected a 32-bit natural.");return t};return{int32:f,nat32:p,func:c,isFunc:l,typeOf:u,isTypeOf:s,arr:o,isArr:a,classOf:i,isClassOf:r,instanceOf:h,isUndef:n}}();"function"!=typeof Object.assign&&!function(){Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}}();var z=(e.TOKINIZATION_RX=E(),e.StackDedup=function(){function t(e){n(this,t),this.length=0,this.data=[],e&&this.push(e),this.maxLen=0}return j(t,[{key:"forEach",value:function(t){for(var e=this.data,n=0;n<this.length;n++)t(e[n],n,this);return this}},{key:"reduce",value:function(t,e){for(var n=this.data,r=0;r<this.length;r++)e=t(e,n[r],r,this);return e}},{key:"filter",value:function(e){var n=new t,r=this.data;n.maxLen=this.maxLen;for(var i=0;i<this.length;i++)e(r[i],i,this)&&n.push(r[i]);return n}},{key:"map",value:function(e){var n=new t,r=this.data;n.maxLen=this.maxLen;for(var i=0;i<this.length;i++)n.push(e(r[i],i,this));return n}},{key:"toArray",value:function(){return this.reduce(O,[])}},{key:"reset",value:function(){return this.length=0,this.maxLen=0,this}},{key:"push",value:function(t){if(void 0===t)return this;for(var e=this.data,n=this.length,r=0;r<n;r++)if(e[r]===t)return this;return e[this.length++]=t,this.length>this.maxLen&&(this.maxLen=this.length),this}},{key:"pop",value:function(){return this.length<=0?this:(length--,this)}},{key:"top",value:function(){if(!(this.length<=0))return data[this.length-1]}},{key:"addAll",value:function(t){var e=this;return t?(t.forEach(function(t){return e.push(t)}),this):this}}]),t}(),function(){function t(e,r){n(this,t),this.head=e,this.tail=r}return j(t,[{key:"equals",value:function(t){return null!==t&&(this.head===t.head&&this.tail===t.tail)}},{key:"addAll",value:function(t){return t?I(a).reduce(function(t,e){return S(e,t)},this):this}},{key:"map",value:function(t){return C(t,this)}},{key:"reduce",value:function(t,e){return V(t,this,e)}},{key:"reverse",value:function(t){return I(this,t)}}]),t}())},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){}function a(){}function o(){}function s(){}function u(t){return t&&"U"==t.type&&"MULTIRANGE"==t.op}function c(t){return function(e){return[!(e===Z||void 0!==e&&!e.match(t)),void 0]}}function l(t){return[t!==Z,void 0]}function h(t){return function(e){return[!(e===Z||void 0!==e&&e!==t),t]}}function f(t){return/[^a-zA-Z0-9]/.test(t||".")}function p(t,e){var n=f(t),r=f(e);return[n&&!r||!n&&r,void 0]}function d(){return!1}function v(t,e){if((m(t)||g(t))&&e)return t.nextNode=e,t;if(k(t)){var n=e?v(t.right,e):t.right;return v(t.left,n),t}if(_(t)&&e)return t.left===j?t.left=e:v(t.left,e),t.right===j?t.right=e:v(t.right,e),t;if(E(t)&&e)return v(t.left,e),t.nextNode=e,t;if(b(t)&&e){var r=t;return v(t.left,r),t.nextNode=e,t}return t}function y(t,e){var n=function(){return e||t.val};return t.toString=n,t}function m(t){return t&&!t.oper&&t.multi!==s&&t.match}function g(t){return t&&!t.oper&&t.multi===s&&t.match}function k(t){return t&&t.oper===Y}function _(t){return t&&t.oper===B}function E(t){return t&&t.oper===U}function b(t){return t&&t.oper===X}function x(t){return t&&"N"===t.type&&"ANY"===t.op}function O(t){return t&&"N"===t.type&&("CHARSET"===t.op||"SPECIAL-CHARSET"===t.op)}function S(t){return"<SKIP>"==t?j:"("==t||"(?:"==t?F:")"==t?z:"."==t?{type:"N",val:"(.)",multi:i,op:"ANY",match:l}:"[\\b]"==t?{type:"N",val:"\b",multi:a,op:"SINGLE",match:c(/[\b]/)}:"^"==t||"$"==t?{type:"N",val:t,multi:s,op:"BOUNDARY",match:d}:"\\b"==t||"\\B"==t?{type:"N",val:t,multi:s,op:"BOUNDARY",match:p}:/^\[.*\]$/.test(t)?{type:"N",val:t,multi:i,op:"CHARSET",match:c(new RegExp(t))}:"|"==t?B:/^[?+*]\??$/.test(t)?G[t.substring(0,1)]:/^\{[^}]*\}$/.test(t)?{type:"U",val:t,op:"MULTIRANGE",fn:(0,K.parseMulti)(t)}:/^\\[dDsSwW]$/.test(t)?{type:"N",val:t,multi:i,op:"SPECIAL-CHARSET",match:c(q[t])}:/^\\[trn]$/.test(t)?{type:"N",val:$[t.substring(1,2)],multi:a,op:"NON-PRINTING",match:c("\\"+t.substring(1))}:/^\\[.?+*{}()$^\\:]$/.test(t)?{type:"N",val:t.substring(1,2),multi:a,op:"SINGLE",match:h(t.substring(1))}:{type:"N",val:t,multi:a,op:"SINGLE",match:h(t)}}function w(t){if(void 0!==t){if(t===Z)return Z;if("N"===t.type&&void 0===t.oper)return{type:"N",val:t.val,multi:t.multi,op:t.op,match:t.match};if(t.left&&(k(t)||E(t)||b(t)||_(t)))return t.right?{oper:t.oper,left:w(t.left),right:w(t.right)}:{oper:t.oper,left:w(t.left)};throw new Error("Copy of an invalid node "+t)}}function A(t,e,n){return t===Y?I(e,n):t===B?R(e,n):n?{oper:t,left:e,right:n}:e}function I(t,e){return t===j?e:e===j?t:e?{oper:Y,left:t,right:e}:t}function R(t,e){return e?{oper:B,left:t,right:e}:t}function N(t){return{oper:X,left:t}}function M(t,e){return!(t<e)&&(t>e||(0,K.odd)(t))}function D(t,e){for(var n=0;n<J.length;n++)if((0,K.array_match)(t,J[n].match,e))return J[n]}function P(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=D(t,n);i?((0,K.array_append)(e,i.put),n+=i.match.length-1):e.push(t[n])}return e}function C(t){t&&("|"==t[t.length-1]&&(t=t.concat("<SKIP>")),"|"==t[0]&&(t=["<SKIP>"].concat(t)));for(var e=P(t);!(0,K.array_eq)(t,e);)t=e,e=P(t);return t}function T(t,e){return e&&t&&t.oper?"("+T(t)+")":t&&t.oper?"B"==t.oper.type?"."==t.oper.op?"("+T(t.left)+"."+T(t.right)+")":"("+T(t.left)+"|"+T(t.right)+")":"U"==t.oper.type?"("+T(t.left,!1)+t.oper.val+")":void 0:t===Z?"<DONE>":t.val}function L(t,e){return e&&t&&t.oper?"("+T(t)+")":t&&t.oper?"B"==t.oper.type?"."==t.oper.op?t.nextNode?"("+L(t.left)+"."+L(t.nextNode)+")":L(t.left):"("+L(t.left)+"|"+L(t.right)+")":"U"==t.oper.type?t.nextNode?"(("+T(t.left,!1)+t.oper.val+")."+L(t.nextNode)+")":"("+T(t.left,!1)+t.oper.val+")":void 0:t===Z?"<DONE>":t&&t.nextNode?"("+t.val+"."+L(t.nextNode)+")":t?t.val:""}Object.defineProperty(e,"__esModule",{value:!0}),e.RxParser=e.RXTREE=e.FAILED=e.MAYBE=e.MORE=e.DONE=void 0;var V=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.MANY=i,e.TERM=a,e.PERHAPS_MORE=o,e.BOUNDARY=s,e.makeFSM=v,e.matchable=m,e.boundary=g,e.dot=k,e.or=_,e.zero_or_one=E,e.zero_or_more=b,e.anychar=x,e.charset=O,e.copyNode=w,e.printExpr=T,e.printExprN=L;var K=n(1);if(!K.array_append)throw new Error("array_append is undefined");var j=y({type:"N",val:"<SKIP>",multi:a,op:"SKIP",match:l}),F=(y({type:"N",val:"\b",multi:a,op:"SINGLE",match:c(/[\b]/)}),y({type:"L",val:")"})),z=y({type:"R",val:")"}),B=y({type:"B",val:"|",op:"OR"}),U=y({type:"U",val:"?",op:"MULTI"}),X=y({type:"U",val:"*",op:"MULTI"}),H=y({type:"U",val:"+",op:"MULTI"}),Y=y({type:"B",val:".",op:"."}),W=function(){return!1},Z=e.DONE=y({type:"N",val:"DONE",multi:s,op:"DONE",match:W}),G=(e.MORE=y({type:"N",val:"MORE",multi:s,op:"MORE",match:W}),e.MAYBE=y({type:"N",val:"MAYBE",multi:s,op:"MAYBE",match:W}),e.FAILED=y({type:"N",val:"FAILED",multi:s,op:"FAILED",match:W}),e.RXTREE={matchable:m,boundary:g,dot:k,or:_,zero_or_one:E,zero_or_more:b,OR:B,ZERO_OR_ONE:U,ZERO_OR_MORE:X,ONE_OR_MORE:H,DOT:Y,FALSE:W},{"*":X,"+":H,"?":U}),q={"\\d":/\d/,"\\D":/\D/,"\\s":/\s/,"\\S":/\S/,"\\w":/\w/,"\\W":/\W/},$={t:"\t",n:"\n",r:"\r"},J=[{match:["(","|",")"],put:["(",")"]},{match:["<SKIP>","|","<SKIP>"],put:["<SKIP>"]},{match:["<SKIP>","<SKIP>"],put:["<SKIP>"]},{match:["(","<SKIP>",")"],put:["<SKIP>"]},{match:["<SKIP>","*"],put:["<SKIP>"]},{match:["<SKIP>","+"],put:["<SKIP>"]},{match:["(","|"],put:["(","<SKIP>","|"]},{match:["|",")"],put:["|","<SKIP>",")"]},{match:["|","|"],put:["|","<SKIP>","|"]},{match:["(",")"],put:["<SKIP>"]}];e.RxParser=function(){function t(){r(this,t),this.operand=[],this.operator=[],this.basePrec=0,this.wasOp=!0,this.lastop=void 0}return V(t,[{key:"toString",value:function(){return"{ operand: "+this.operand.map(T)+" operator: "+this.operator.map(function(t){return t.toString()})+" prec: "+this.BasePrec+" wasOp: "+this.wasOp+"}"}},{key:"opState",value:function(t,e,n){var r=function(t){return t?"OPERATOR":"OPERAND"};if(this.lastop=n,this.wasOp!=t)throw new Error("RegExp parsing expected: "+r(t)+" but was: "+r(this.wasOp));this.wasOp=e}},{key:"addToken",value:function(t){if(!t)return this.finishUp();var e=S(t);switch("N"!=e.type&&"L"!=e.type||this.wasOp||(this.pushOp(Y,this.basePrec+4),this.opState(!1,!0)),e.type){case"L":this.opState(!0,!0,F),this.basePrec+=10;break;case"R":if(this.opState(!1,!1,z),this.basePrec-=10,this.basePrec<0)throw Error("Syntax error "+this.basePrec);break;case"":case"B":this.pushOp(e,this.basePrec+2),this.opState(!1,!0,e);break;case"U":this.pushOp(e,this.basePrec+7),this.opState(!1,!1,e);break;case"N":this.operand.push(e),this.opState(!0,!1,e);break;default:throw Error("Syntax error")}return this}},{key:"pushOp",value:function(t,e){for(var n=this.topV()||{prec:-100};n&&M(n.prec,e);){var r,i;i=this.popOper(),n.op.type&&"B"!=n.op.type?u(n.op)?this.operand.push(this.applyMulti(n.op,i)):n.op===H?this.oneOrMore(i):this.unaryOp(n.op,i):(r=this.popOper(),this.operand.push(A(n.op,r,i))),this.operator.pop(),n=this.topV()}e>=0&&this.operator.push({op:t,prec:e})}},{key:"finishUp",value:function(){return void 0===this.wasOp?this:(this.wasOp?this.pushOp(void 0,-1):(this.pushOp(Y,0),this.operand.push(Z),this.pushOp(void 0,-1)),this.wasOp=void 0,this)}},{key:"val",value:function(){return 0===this.operand.length?void 0:this.operand[this.operand.length-1]}},{key:"topV",value:function(){return 0===this.operator.length?void 0:this.operator[this.operator.length-1]}},{key:"popOper",value:function(){return this.operand.pop()}},{key:"applyMulti",value:function(t,e){var n,r=t.fn.min,i=t.fn.max;if(g(e))throw new SyntaxError("repetition of boundary element: '"+e.val+"'' has no meaning");var a=function(t,e,r){if(0===r)return t;for(n=0;n<r;n++)e=w(e),t=t?I(t,e):e;return t||e};return 0===r?void 0===i?{oper:X,left:e}:a(void 0,{oper:U,left:e},i):void 0===i?a(a(void 0,e,r),{oper:X,left:e},1):a(a(e,e,r-1),{oper:U,left:w(e)},i-r)}},{key:"oneOrMore",value:function(t){if(g(t))throw new SyntaxError("repetition of boundary element: "+t.val+" has no meaning");this.operand.push(I(t,N(w(t))))}},{key:"unaryOp",value:function(t,e){if(g(e))throw new SyntaxError("modifier ("+t.val+") of boundary element: "+e.val+" has no meaning");this.operand.push({oper:t,left:e})}}],[{key:"parse",value:function(e){"string"!=typeof e&&(e=e.toString().replace(/\\\//g,"/").replace(/^\/|\/$/g,""));var n=C(e.match(K.TOKINIZATION_RX));n=n||[];var r=n.reduce(function(t,e){return t.addToken(e)},new t);return r.val()&&r.pushOp(Y,0),r.operand.push(Z),r.pushOp(void 0,-1),v(r.val())}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){return new M(t,e)}function a(t){return t.split("").map(function(t){return"*"===t?O:"?"===t?w:"_"===t?S:t}).join("")}function o(t){return t==S||s(t)}function s(t){return t==w||t==O}function u(t){return t===S}function c(t){for(var e=void 0,n=[],r=0;r<t.length;r++){var i=t.charAt(r);s(i)&&e===i||(e=i,n.push(i))}return n.join("")}function l(t,e){for(var n=0;n<t.length;n++)if(!e(t.charAt(n)))return t.substring(n+1,t.length);return t}function h(t,e){for(var n=(t.length<e.length?t.length:e.length,l((0,b.rprefix)(t,e),s)),r="",i=1,a=2,o=function(t){var e=0;return function(n){switch(n){case i:return e<t.length?t.charAt(e):void 0;case a:e++;break;default:return e<t.length}}},u=function(t,e){return t==e||s(t)&&s(e)},c=function(t,e){return t===O?t:e},h=o(t),f=o(e);h()&&f();){var p=h(i),d=f(i),v=s(p)||s(d);u(p,d)?(r+=c(p,d),h(a),f(a)):v?s(p)?(r+=p,h(a)):(r+=d,f(a)):(r+=S,h(a),f(a))}return(0,b.sRightMerge)(r,n)}function f(t){var e=t.charCodeAt(0);return e>=97&&e<=122}function p(t){return void 0!==t&&t.filter(function(t){return t===x.DONE}).length===t.length}function d(t,e,n,r,i){function a(s,u,c){if(!s)return t(u);if(c&&s===(0,b.n_head)(c))return a(s.nextNode,o(s,u),(0,b.n_tail)(c));if(s===x.DONE)return t(u);if((0,x.dot)(s))return a(s.left,u,c);if((0,x.or)(s)){var l=a(s.left,u,c),h=a(s.right,u,c);return n(l,h)}if((0,x.zero_or_one)(s))return r?r(s,u,a,c):a(s.nextNode,e(u,w),c);if((0,x.zero_or_more)(s))return r?r(s,u,a,c):a(s.nextNode,e(u,O),c);if((0,x.matchable)(s)){var f=(0,x.matchable)(s)(void 0),p=f[1]||(i?i(s,S):S);return a(s.nextNode,e(u,p),c)}return(0,x.boundary)(s)?a(s.nextNode,u,c):t(u)}var o=function(t,n){return(0,x.zero_or_more)(t)?e(n,O):n};return a}function v(t,e,n){function r(r,i){return r.reduce(function(n,r){return e(n,t(r,i))},n())}return r}function y(t,e){if(!t)return e;switch(t.val){case"[0-9]":case"\\d":return"9̲";case"[A-Za-z]":case"[a-zA-Z]":case"[a-z]":return"a̲";case"[A-Z]":return"A̲";case"[0-9A-Za-z]":case"[A-Z0-9a-z]":case"[A-Za-z0-9]":case"[0-9a-zA-Z]":case"[a-z0-9A-Z]":case"[a-zA-Z0-9]":return"z̲";default:return e}}function m(t){if(t&&t!==x.DONE){if((0,x.dot)(t))return m(t.left);if((0,x.matchable)(t)){var e=(0,x.matchable)(t)(void 0);return e[1]}if((0,x.or)(t)){var n=m(t.left),r=m(t.right);return n===r?n:void 0}(0,x.zero_or_one)(t)||(0,x.zero_or_more)(t)||(0,x.boundary)(t)}}function g(t){var e=t&&t.length>0?m(t.data[0]):void 0;if(void 0!==e)return t.reduce(function(t,e){return t===m(e)?t:void 0},e)}function k(t,e){return t===-1||e===-1?-1:t+e}function _(t){if(!t)return 0;if(t===x.DONE)return 0;if((0,x.dot)(t))return k(_(t.left),_(t.right));if((0,x.or)(t)){var e=_(t.left);return e>=0&&e===_(t.right)?e:-1}if((0,x.zero_or_one)(t)||(0,x.zero_or_more)(t))return-1;if((0,x.matchable)(t)){var n=(0,x.matchable)(t)(void 0);return n[1]}return(0,x.boundary)(t)?_(t.left):0}Object.defineProperty(e,"__esModule",{value:!0}),e.IREGEX=void 0;var E=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.incrRegEx=i,e.convertMask=a,e.isMeta=o,e.isOptional=s,e.isHolder=u,e.__isDoneN=p;var b=n(1),x=n(2),O="⋯",S="_",w="◑",A=function(t,e){var n=function(t){return void 0===t?[]:[t]},r=function(t,e){return t+e},i=function(t,e){return(0,b.flatten)([t,e])},a=function(t,e){return(0,b.flatten)((0,b.arr_push)(t,e))},o=function(t,e,n,r){if(t.left){var a=n(t.nextNode,e,r),o=n(t.left,e,(0,b.n_cons)(t,r));return i(a,o)}},s=e?o:void 0;return v(d(n,r,i,s,t),a,n)},I=A(y,!0),R=A(y,!1),N=function(){var t=function(t){return t},e=function(t,e){return t+e},n=function(t,e){return h(t,e)},r=function(t,e){return h(t||e,e)},i=v(d(t,e,n),r,t);return function(t){return c(i(t,""))}}(),M=e.IREGEX=function(){function t(e,n){r(this,t);var i=30;e||n?(!n&&e&&(n=x.RxParser.parse(e)),this.str=e,this.base=n,this.tracker=[],this.current=new b.StackDedup(n),this.one=this.current,this.two=new b.StackDedup,this.lastCh=void 0,this.maxLen=0,this.mask=void 0,this._len=30):(this.str="",this.base=void 0,this.tracker=void 0,this.current=void 0,this.one=this.current,this.two=void 0,this.lastCh=void 0,this.maxLen=0,this._mask=void 0,i=_(this.base),i<=0&&(i=30),this._len=i)}return E(t,[{key:"toString",value:function(){return this.str}},{key:"getInputLength",value:function(){return this.tracker.length}},{key:"isDone",value:function(t){return(t>=this.tracker.length||void 0===t)&&this.state()===x.DONE}},{key:"getTree",value:function(){return this.base}},{key:"minChars",value:function(){return this._mask=N(this.current),this._mask}},{key:"minCharsList",value:function(t){var e=t?I:R;return(0,b.arr_uniq)(e(this.current,this.inputStr()))}},{key:"match",value:function(t){var e=g(this.current),n=this.test(t===S?void 0:t);return void 0===n&&t&&f(t)&&(n=this.test(t.toUpperCase()),t=t.toUpperCase()),this._update(n,t,e)}},{key:"matchStr",value:function(t){var e=t.length,n=!0,r=0,i=0;for(i=0;i<e;i++){var a=t[i];if(!this.match(a)){n=!1;break}this.lastCh=a,r++}return[n,r,t.substring(0,i)]}},{key:"state",value:function(){return this._state=this._state||this._stateCompute(),this._state}},{key:"stateStr",value:function(){var t=this.state();return t===x.MORE?"MORE":t===x.MAYBE?"OK":"DONE"}},{key:"inputStr",value:function(){return this.tracker.map(function(t){return t[0]}).join("")}},{key:"fixed",value:function(){return g(this.current)}},{key:"reset",value:function(){return this.tracker=[],this.current.reset(),this.current.push(this.base),this.lastCh=void 0,this._state=void 0,this._mask=void 0,this}},{key:"clone",value:function(){var t=i();return t.str=this.str,t.base=this.base,t.tracker=this.tracker.slice(0),t.one=this.one.map(b.ID),t.two=this.two.map(b.ID),t.current=this.current==this.one?t.one:t.two,t.lastCh=this.lastCh,t._state=this._state,t._mask=void 0,t._len=this.length,t}},{key:"getInputTracker",value:function(){return this.tracker.map(b.ID)}},{key:"_after",value:function(t,e){if(e){var n=this.tracker.filter(function(n,r){return r>=e&&(t||void 0===n[1])});return n.map(function(t){return t[0]}).join("")}var r=t?this.tracker:this.tracker.filter(function(t){return void 0===t[1]});return r.map(function(t){return t[0]}).join("")}},{key:"_getArr",value:function(){return this.current===this.one?this.two.reset():this.one.reset()}},{key:"action",value:function(t,e,n,r){if(t===x.DONE)return e===x.DONE?(n.push(x.DONE),x.DONE):x.FAILED;if((0,x.dot)(t))return this.action(t.left,e,n,r);if((0,x.or)(t)){var i=this.action(t.left,e,n,r),a=this.action(t.right,e,n,r);return this._result(i,a)}if((0,x.zero_or_one)(t)||(0,x.zero_or_more)(t)){var o=(0,x.boundary)(t.left)?x.DONE:this.action(t.left,e,n,!0),s=this.action(t.nextNode,e,n,r);return this._result(o,s)}if((0,x.matchable)(t)){var u=t.match(e);return u[0]&&n.push(t.nextNode),u[0]?t.nextNode===x.DONE?x.DONE:x.MORE:x.FAILED}if((0,x.boundary)(t)){if(r)return x.FAILED;var c=t.match(this.lastCh,e);return c[0]?(t=t.nextNode,c=this.action(t,e,n)):x.FAILED}return x.FAILED}},{key:"_result",value:function(t,e){return t===e?t:t===x.MORE||e===x.MORE?x.MORE:void 0}},{key:"test",value:function(t,e){var n=this;e=e||this.current;var r=x.FAILED,i=this._getArr();if(e.forEach(function(e){r=n._result(n.action(e,t,i),r)}),r!==x.FAILED&&0!==i.length)return i}},{key:"_update",value:function(t,e,n){return void 0!==t&&(this.tracker.push([void 0===e?S:e,n]),t.maxLen>this.maxLen&&(this.maxLen=t.maxLen),this.current=t,this.lastCh=e,this._state=void 0,this._mask=void 0),void 0!==t}},{key:"_stateCompute",value:function(){var t=this.test(void 0);if(void 0===t)return x.DONE;var e=this.test(x.DONE);return p(e)?x.MAYBE:x.MORE}},{key:"length",get:function(){return this._len;
}}]),t}()},function(t,e){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};t.exports=r},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.RxMatcher=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=(n(1),n(3)),o=n(2);e.RxMatcher=function(){function t(e){r(this,t),this.matcher=e,this._lastEditableIndex=void 0}return i(t,[{key:"getFirstEditableAtOrAfter",value:function(t){for(var e=t,n=this.getInputTracker();e<n.length;e++)if(void 0===n[e][1])return e;var r=this.minChars();e=n.length;for(var i=0;i<r.length&&!(0,a.isMeta)(r.charAt(i));i++,e++);return e}},{key:"getFirstEditableAtOrBefore",value:function(t){var e=this.getInputTracker();for(t>=e.length&&(t=e.length-1);t>0;t--)if(void 0===e[t][1])return t;return 0}},{key:"getInputLength",value:function(){return this.matcher.getInputLength()}},{key:"setPos",value:function(t){if(void 0!==t){var e=this.getInputTracker(),n=e.map(function(t){return t[0]}).join("").substr(0,t);for(this.reset(),this.matchStr(n),e=this.getInputTracker();e.length<t&&void 0!==this.fixed();)if(!this.match(this.fixed())){t=this.getInputLength();break}this._resetCache()}return t}},{key:"toString",value:function(){return this.matcher.toString()}},{key:"after",value:function(t){return this.matcher._after(!0,t)}},{key:"valueWithMask",value:function(){return this.matcher.valueWithMask()}},{key:"rawValue",value:function(t){return this.matcher.rawValue(t)}},{key:"_after",value:function(t,e){return this.matcher._after(t,e)}},{key:"isDone",value:function(t){return this.matcher.isDone(t)}},{key:"setToFirstEditableAfter",value:function(t){return void 0===t&&(t=this.getInputLength()),this.setPos(this.getFirstEditableAtOrAfter(t))}},{key:"lastEditableIndex",value:function(){if(void 0===this._lastEditableIndex){var t=this.getInputTracker(),e=this.clone(),n=this.getFirstEditableAtOrAfter(t.length);e.setPos(n),e.state()===o.DONE&&(n=t.length),this._lastEditableIndex=n}return this._lastEditableIndex}},{key:"getTree",value:function(){return this.matcher.getTree()}},{key:"minChars",value:function(t){if(void 0===t)return this.matcher.minChars();var e=this.matcher.clone(),n=this.matcher._after(!0,0).substring(0,t);e.reset();var r=e.matchStr(n);if(!r[0])throw new Error("Unexpected error (matchStr failed) from "+e.constructor.name||"IREGEX");return e.minChars()}},{key:"minCharsList",value:function(t){return this.matcher.minCharsList(t)}},{key:"emptyAt",value:function(t){var e=this.getInputTracker();return t<e.length&&(0,a.isHolder)(e[t][0])}},{key:"match",value:function(t){return this._resetCache(),this.matcher.match(t)}},{key:"matchStr",value:function(t){return this._resetCache(),this.matcher.matchStr(t)}},{key:"state",value:function(){return this.matcher.state()}},{key:"fixed",value:function(){return this.matcher.fixed()}},{key:"reset",value:function(){return this.matcher.reset(),this._resetCache(),this}},{key:"clone",value:function(){return new t(this.matcher.clone())}},{key:"getInputTracker",value:function(){return this.matcher.tracker}},{key:"getFullTracker",value:function(){var t=this.getInputTracker(),e=this.matcher.minChars().map(function(t){return(0,a.isMeta)(t)?[t,void 0]:[t,t]});return[].concat(t,e)}},{key:"_resetCache",value:function(){this._lastEditableIndex=void 0}},{key:"stateStr",value:function(){return this.matcher.stateStr()}},{key:"length",get:function(){return this.matcher.length}}]),t}()},function(t,e,n){"use strict";function r(t){var e={},n=a.apply(i,o.call(arguments,1));for(var r in t)s(n,r)===-1&&(e[r]=t[r]);return e}var i=Array.prototype,a=i.concat,o=i.slice,s=n(14);t.exports=r},function(t,e,n){"use strict";function r(t,e){return!(!t||!e)&&(t===e||!i(t)&&(i(e)?r(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}var i=n(11);t.exports=r},function(t,e){"use strict";function n(t){try{t.focus()}catch(e){}}t.exports=n},function(t,e){"use strict";function n(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(t){return document.body}}t.exports=n},function(t,e){"use strict";function n(t){return!(!t||!("function"==typeof Node?t instanceof Node:"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName))}t.exports=n},function(t,e,n){"use strict";function r(t){return i(t)&&3==t.nodeType}var i=n(10);t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isHolder=e.isOptional=e.isMeta=e.convertMask=e.IREGEX=e.zero_or_more=e.zero_or_one=e.or=e.dot=e.matchable=e.RxMatcher=e.contract=e.RXInputMask=e.RxParser=e.printExpr=e.incrRegEx=e.FAILED=e.MAYBE=e.MORE=e.DONE=void 0;var r=n(1),i=n(2),a=n(3),o=n(13),s=n(5);if(void 0===a.incrRegEx)throw new Error("incrRegEx not defined");if(void 0===o.RXInputMask)throw new Error("RXInputMask not defined");if(void 0===s.RxMatcher)throw new Error("RxMatcher not defined");e.DONE=i.DONE,e.MORE=i.MORE,e.MAYBE=i.MAYBE,e.FAILED=i.FAILED,e.incrRegEx=a.incrRegEx,e.printExpr=i.printExpr,e.RxParser=i.RxParser,e.RXInputMask=o.RXInputMask,e.contract=r.contract,e.RxMatcher=s.RxMatcher,e.matchable=i.matchable,e.dot=i.dot,e.or=i.or,e.zero_or_one=i.zero_or_one,e.zero_or_more=i.zero_or_more,e.IREGEX=a.IREGEX,e.convertMask=a.convertMask,e.isMeta=a.isMeta,e.isOptional=a.isOptional,e.isHolder=a.isHolder},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){return e=e||t,{start:Math.min(t,e),end:Math.max(t,e)}}function a(t,e,n){return o(i(t.start+e,t.end+(void 0===n?e:n)))}function o(t,e,n,r){n=n||function(t){return t},r=r||n;var i=function(t,e,n){return n(Math.max(Math.min(t,e.end),e.start))};return e?{start:i(t.start,e,r),end:i(t.end,e,n)}:t}function s(t){return!t}function u(t){return t?t.end-t.start:0}function c(t){return s(u(t))}function l(t,e){return t.start>e.start}function h(t,e){return t===e}function f(t){for(var e=t.minChars(),n=0;e.length>n&&!(0,_.isMeta)(e.charAt(0));n++){if(!t.match(e.charAt(0)))return n>0;e=t.minChars()}return n>0}function p(t,e){var n=t.minChars();if(e=!!e,e!==!0&&n.length>1&&(0,_.isOptional)(n.charAt(0))&&!(0,_.isMeta)(n.charAt(1))){if(t.match(n.charAt(1)))return!0}else if(n.length>0&&!(0,_.isMeta)(n.charAt(0)))return t.match(n.charAt(0));return!1}function d(t,e){if(t.match(e))return!0;for(var n=t.clone();p(t,!1);)if(t.match(e))return!0;return t.reset(),t.matchStr(y(n,!0,0)),!1}function v(t){for(var e=t.length-1;e>=0&&(0,_.isHolder)(t.charAt(e));e--);return t.substring(0,e+1)}function y(t,e,n){var r=t.getInputTracker();if(n){var i=r.filter(function(t,r){return r>=n&&(e||void 0===t[1])});return i.map(function(t){return t[0]}).join("")}var a=e?r:r.filter(function(t){return void 0===t[1]});return a.map(function(t){return t[0]}).join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.RXInputMask=void 0;var m=function(){function t(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(u){i=!0,a=u}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.trimHolder=v,e._after=y;var k=n(1),_=n(3),E=n(5),b=(n(2),e.RXInputMask=function(){function t(e){if(r(this,t),e=(0,k.assign)({pattern:null,selection:{start:0,end:0},value:"",history:{data:[],index:null,lastOp:null}},e),null===e.pattern)throw new Error("RXInputMask: you must provide a pattern.");this.setPattern(e.pattern,{value:e.value,selection:e.selection,history:e.history})}return g(t,[{key:"getState",value:function(){({pattern:this.pattern.clone(),selection:a(this.selection,0),value:this._getValue(),history:{data:[],index:null,lastOp:null}})}},{key:"input",value:function(t){if(c(this.selection)&&this.pattern.isDone(this.selection.start))return!1;var e=this._input(t,this.selection,this.pattern),n=m(e,3),r=n[0],i=n[1],a=n[2];if(!r)return!1;var o=this._getValue(),s=this.selection,u=this.pattern;return this._lastOp="input",this.selection=i,this.pattern=a,this.value=this.getValue(),null!==this._historyIndex&&(this._history.splice(this._historyIndex,this._history.length-this._historyIndex),this._historyIndex=null),("input"!==this._lastOp||!c(s)||null!==this._lastSelection&&s.start!==this._lastSelection.start)&&this._history.push({value:o,selection:s,lastOp:this._lastOp,pattern:u}),this._lastSelection=s,!0}},{key:"_input",value:function(t,e,n){c(e)&&n.emptyAt(e.start)&&(e=a(e,1));var r=n.clone();e=this._updateSelection(e,r.getFirstEditableAtOrAfter(e.start));var o=r.getFirstEditableAtOrAfter(e.end),s=y(r,!1,o),u=e.start;if(r.setPos(u),void 0!==t&&!d(r,t))return[!1,e,r];e=this._updateSelection(e,r.getInputLength()),o=Math.max(o,e.end);var l=r.getFirstEditableAtOrAfter(r.getInputLength()),h=this._insertRest(s,r,u,o+1);return f(h||r),[!0,i(l,l),h||r]}},{key:"_insertRest",value:function(t,e,n,r){function i(t,e,n,r,a){if(t>=e.length)return n;if(r>a||n.isDone())return n;var o=n.clone();if(d(o,e.charAt(t))){var s=i(t+1,e,o,o.getInputLength()-1,a);if(void 0!==s)return s}for(;p(n,!1););return n.match(void 0),i(t,e,n,r+1,a)}var a=i(0,t,e,n,r+t.length);return a}},{key:"backspace",value:function(){var t=this.pattern.getFirstEditableAtOrAfter(0);if(this.selection.start<t||this.selection.end<t)return!1;var e=(0,k.copy)(this.selection),n=this._getValue(),r=this.selection,a=r.start,o=r.end;if(a===o){if(a=this.pattern.getFirstEditableAtOrBefore(a-1),o=a+1,a<t)return}else if(a=this.pattern.getFirstEditableAtOrBefore(o<a?o:a),o===a&&o++,o<=t)return;var s=this._input(void 0,i(a,o),this.pattern),u=this.pattern;return!!s[0]&&(this.pattern=s[2],this.selection.start=this.selection.end=a,null!==this._historyIndex&&this._history.splice(this._historyIndex,this._history.length-this._historyIndex),("backspace"!==this._lastOp||e.start!==e.end||null!==this._lastSelection&&e.start!==this._lastSelection.start)&&this._history.push({value:n,selection:e,lastOp:this._lastOp,pattern:u}),this._lastOp="backspace",this._lastSelection=(0,k.copy)(e),!0)}},{key:"del",value:function(){return c(this.selection)?(this.right(this.selection),this.backspace()):this.backspace()}},{key:"paste",value:function(t){var e={value:this.value.slice(),selection:(0,k.copy)(this.selection),_lastOp:this._lastOp,_history:this._history.slice(),_historyIndex:this._historyIndex,_lastSelection:(0,k.copy)(this._lastSelection),pattern:this.pattern.clone()},n=this.getRawValueAt(this.selection.end);this.pattern.setPos(this.selection.start);var r=this._setValueFrom(this.selection.start,t);return this.selection.end=this.pattern.getInputLength(),!(!r||!this._setValueFrom(this.selection.end,n))||((0,k.assign)(this,e),!1)}},{key:"undo",value:function(){if(0===this._history.length||0===this._historyIndex)return!1;var t;if(null===this._historyIndex){this._historyIndex=this._history.length-1,t=this._history[this._historyIndex];var e=this._getValue();t.value===e&&t.selection.start===this.selection.start&&t.selection.end===this.selection.end||this._history.push({value:e,selection:(0,k.copy)(this.selection),lastOp:this._lastOp,startUndo:!0,pattern:this.pattern.clone()})}else t=this._history[--this._historyIndex];return this.pattern=t.pattern,this.setValue(t.value),this.selection=t.selection,this._lastOp=t.lastOp,!0}},{key:"redo",value:function(){if(0===this._history.length||null===this._historyIndex)return!1;var t=this._history[++this._historyIndex];return this._historyIndex===this._history.length-1&&(this._historyIndex=null,t.startUndo&&this._history.pop()),this.pattern=t.pattern.clone(),this.setValue(t.value),this.selection=t.selection,this._lastOp=t.lastOp,!0}},{key:"left",value:function(t){var e=(0,k.copy)(t);return e&&c(e)&&(e.start=e.end=t.start-1,this.setSelection(e)),this}},{key:"right",value:function(t){var e=(0,k.copy)(t);return e&&e.start===e.end&&(e.start=e.end=t.start+1,this.setSelection(e)),this}},{key:"setPattern",value:function(t,e){for(e=(0,k.assign)({value:""},e),this.pattern=new E.RxMatcher((0,_.incrRegEx)(t)),this.setValue(e.value),this.emptyValue=this.pattern.minChars(),this.setSelection(e.selection);this.skipFixed(!0););if(c(this.selection)&&0!==this.pattern.getInputTracker().length){var n=this._getValue();this.setValue(n),this.selection.start=this.selection.end=n.length}return this._resetHistory(),this}},{key:"select",value:function(t,e){return this.selection=e<t?i(e,t):i(t,e),this}},{key:"setSelection",value:function(t){var e=this,n=t===this.selection?this.selection:(0,k.copy)(t),r=this.selection||n,a=function(t){return e.pattern.getFirstEditableAtOrAfter(t)},s=function(t){return e.pattern.getFirstEditableAtOrBefore(t)};this.selection=r;var u=a(0),h=this.pattern.lastEditableIndex(),f=i(u,h);return c(n)?this.selection=o(n,f,l(this.selection,n)?s:a):this.selection=o(n,f,a,s),this}},{key:"_adjustSelection",value:function(t,e){return c(t)?i(e?this.pattern.getFirstEditableAtOrAfter(t.start):this.pattern.getFirstEditableAtOrBefore(t.start)):i(this.pattern.getFirstEditableAtOrBefore(t.start),this.pattern.getFirstEditableAtOrAfter(t.end))}},{key:"_setValueFrom",value:function(t,e){var n=this.pattern.clone(),r=!0;void 0!==t&&n.setPos(t);for(var i=t,a=0;a<e.length&&r;i++,a++){var o=e.charAt(a);r&=d(n,o)}return r&&(f(n),this.pattern=n),r}},{key:"setValue",value:function(t){var e=new b("RXInputMask:");if(this.getValue()===t)return!0;var n=this.pattern.clone();null===t&&(t=""),n.reset(),e.println("iterate over",t,"length:",t.length);for(var r=0;r<t.length;r++){var i=t.charAt(r);if(e.print("index: ",r,"char:",i,"minChars:",n.minChars(),"sameAsRest",h(t.substring(r),n.minChars()),"---"),h(t.substring(r),n.minChars()))break;if((0,_.isHolder)(i)&&(i=void 0),!d(n,i))return!1}return this.pattern=n,this.value=this.getValue(),!0}},{key:"minCharsList",value:function(t){return this.pattern.minCharsList(t)}},{key:"getSelection",value:function(){return(0,k.copy)(this.selection)}},{key:"_getValue",value:function(){return y(this.pattern,!0,0)}},{key:"getValue",value:function(){return y(this.pattern,!0,0)+this.pattern.minChars()}},{key:"getRawValue",value:function(){return y(this.pattern,!1,0)}},{key:"getRawValueAt",value:function(t){return y(this.pattern,!1,t)}},{key:"reset",value:function(){return this.pattern.reset(),this._resetHistory(),this.value=this.getValue(),this.selection.start=this.selection.end=0,this.setSelection(this.selection),this}},{key:"_resetHistory",value:function(){return this._history=[],this._historyIndex=null,this._lastOp=null,this._lastSelection=(0,k.copy)(this.selection),this}},{key:"_updateSelection",value:function(t,e){var n=(0,k.copy)(t);return n.start=e,e>n.end&&(n.end=e),n}},{key:"skipFixed",value:function(t){return p(this.pattern,t)}},{key:"isDone",value:function(){var t=this.pattern.clone(),e=this.getValue(),n=e.split("");if((0,k.arr_find)(function(t){return(0,_.isHolder)(t)},n))return"MORE";t.reset();for(var r=0;r<n.length;r++)if(!(0,_.isMeta)(n[r])&&!t.match(n[r]))return"MORE";return t.stateStr()}}]),t}(),function(){function t(e){r(this,t),this.content=e||""}return g(t,[{key:"print",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.content+=","+(e||[]).map(function(t){return JSON.stringify(t)}).join(" "),this}},{key:"println",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.print.apply(this,e),this.content+="\n",this}},{key:"flush",value:function(){console.log(this.content),this.content=""}}]),t}())},function(t,e){var n=[].indexOf;t.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}},function(t,e,n){"use strict";function r(t,e,n,r){return t===n&&e===r}function i(t){var e=document.selection,n=e.createRange(),r=n.text.length,i=n.duplicate();i.moveToElementText(t),i.setEndPoint("EndToStart",n);var a=i.text.length,o=a+r;return{start:a,end:o}}function a(t){var e=window.getSelection&&window.getSelection();if(!e||0===e.rangeCount)return null;var n=e.anchorNode,i=e.anchorOffset,a=e.focusNode,o=e.focusOffset,s=e.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(u){return null}var c=r(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),l=c?0:s.toString().length,h=s.cloneRange();h.selectNodeContents(t),h.setEnd(s.startContainer,s.startOffset);var f=r(h.startContainer,h.startOffset,h.endContainer,h.endOffset),p=f?0:h.toString().length,d=p+l,v=document.createRange();v.setStart(n,i),v.setEnd(a,o);var y=v.collapsed;return{start:y?d:p,end:y?p:d}}function o(t,e){var n,r,i=document.selection.createRange().duplicate();void 0===e.end?(n=e.start,r=n):e.start>e.end?(n=e.end,r=e.start):(n=e.start,r=e.end),i.moveToElementText(t),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function s(t,e){if(window.getSelection){var n=window.getSelection(),r=t[l()].length,i=Math.min(e.start,r),a=void 0===e.end?i:Math.min(e.end,r);if(!n.extend&&i>a){var o=a;a=i,i=o}var s=c(t,i),u=c(t,a);if(s&&u){var h=document.createRange();h.setStart(s.node,s.offset),n.removeAllRanges(),i>a?(n.addRange(h),n.extend(u.node,u.offset)):(h.setEnd(u.node,u.offset),n.addRange(h))}}}var u=n(4),c=n(17),l=n(18),h=u.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:h?i:a,setOffsets:h?o:s};t.exports=f},function(t,e,n){"use strict";function r(t){return a(document.documentElement,t)}var i=n(15),a=n(7),o=n(8),s=n(9),u={hasSelectionCapabilities:function(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&"text"===t.type||"textarea"===e||"true"===t.contentEditable)},getSelectionInformation:function(){var t=s();return{focusedElem:t,selectionRange:u.hasSelectionCapabilities(t)?u.getSelection(t):null}},restoreSelection:function(t){var e=s(),n=t.focusedElem,i=t.selectionRange;e!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,i),o(n))},getSelection:function(t){var e;if("selectionStart"in t)e={start:t.selectionStart,end:t.selectionEnd};else if(document.selection&&t.nodeName&&"input"===t.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===t&&(e={start:-n.moveStart("character",-t.value.length),end:-n.moveEnd("character",-t.value.length)})}else e=i.getOffsets(t);return e||{start:0,end:0}},setSelection:function(t,e){var n=e.start,r=e.end;if(void 0===r&&(r=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(r,t.value.length);else if(document.selection&&t.nodeName&&"input"===t.nodeName.toLowerCase()){var a=t.createTextRange();a.collapse(!0),a.moveStart("character",n),a.moveEnd("character",r-n),a.select()}else i.setOffsets(t,e)}};t.exports=u},function(t,e){"use strict";function n(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function r(t){for(;t;){if(t.nextSibling)return t.nextSibling;t=t.parentNode}}function i(t,e){for(var i=n(t),a=0,o=0;i;){if(3===i.nodeType){if(o=a+i.textContent.length,a<=e&&o>=e)return{node:i,offset:e-a};a=o}i=n(r(i))}}t.exports=i},function(t,e,n){"use strict";function r(){return!a&&i.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var i=n(4),a=null;t.exports=r},function(e,n){e.exports=t},function(t,n){t.exports=e}])});
//# sourceMappingURL=react-rxinput.min.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc