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.3 to 1.0.4

46

es6/index.js

@@ -157,3 +157,3 @@ /*

mask.backspace();
console.log("Fix maskValue", maskValue, "diff:", sizeDiff, "target value: ", e.target.value);
//console.log("Fix maskValue", maskValue, "diff:", sizeDiff, "target value: ", e.target.value);
}

@@ -168,4 +168,6 @@ var value = this._getDisplayValue();

if (this.props.onChange) {
this.props.onChange(e);
var opt = { target: { value: this.getValue() } };
this.props.onChange(opt);
}
// console.log("on change", e)
},

@@ -188,2 +190,3 @@

if (action()) {
var oldVal = e.target.value;
var value = _this._getDisplayValue();

@@ -195,2 +198,8 @@ e.target.value = value;

}
if (_this.props.onChange && oldVal != value) {
var opt = { target: { value: mask._getValue() } };
_this.props.onChange(opt);
//console.log("on change", e)
}
// console.log("on change1", e)
}

@@ -225,3 +234,3 @@ _this.setState({ selection: mask.selection });

console.log("Arrow Action support:", supportArrowNavigation(mask), " value:", this._getDisplayValue(), " selection: ", asStr(getSelection(this.input)), asStr(mask.selection));
//console.log("Arrow Action support:", supportArrowNavigation(mask), " value:",this._getDisplayValue(), " selection: ", asStr(getSelection(this.input)), asStr(mask.selection));
}

@@ -232,3 +241,3 @@ },

var mask = this.state.mask;
console.log('onKeyPress', asStr(getSelection(this.input)), asStr(mask.selection), e.key, e.target.value);
//console.log('onKeyPress', asStr(getSelection(this.input)),asStr(mask.selection), e.key, e.target.value)

@@ -246,6 +255,13 @@ // Ignore modified key presses

if (insert(e.key)) {
e.target.value = mask.getValue();
var oldVal = e.target.value;
var value = mask.getValue();
e.target.value = value;
//console.log("keyPress:getDisplayValue", this._getDisplayValue(), " selection: ", asStr(selX)+"/"+asStr(mask.selection)+"<"+asStr(oldMaskX));
this._updateInputSelection();
this.setState({ selection: mask.selection });
if (this.props.onChange && oldVal != value) {
var opt = { target: { value: mask._getValue() } };
this.props.onChange(opt);
}
//console.log("on change", e)
}

@@ -262,3 +278,3 @@

var mask = this.state.mask;
console.log('onPaste', asStr(getSelection(this.input)), e.clipboardData.getData('Text'), e.target.value);
//console.log('onPaste', asStr(getSelection(this.input)), e.clipboardData.getData('Text'), e.target.value)

@@ -268,6 +284,6 @@ e.preventDefault();

// getData value needed for IE also works in FF & Chrome
console.log("paste: ", e.clipboardData.getData('Text'));
//console.log("paste: ", e.clipboardData.getData('Text'));
if (mask.paste(e.clipboardData.getData('Text'))) {
e.target.value = mask.getValue();
console.log("undo:getDisplayValue", this._getDisplayValue());
//console.log("undo:getDisplayValue", this._getDisplayValue());
// Timeout needed for IE

@@ -280,4 +296,4 @@ setTimeout(this._updateInputSelection, 0);

_getMaskList: function _getMaskList() {
var list = this.state.mask.minCharsList(true);
_getMaskList: function _getMaskList(flag) {
var list = this.state.mask.minCharsList(!!flag);
if (list && list.length < 20) return list;

@@ -293,3 +309,3 @@ return this.state.mask.minCharsList();

selected: function selected(str, e) {
console.log("Selected: " + str);
//console.log("Selected: "+str);
if (!str.split('').find(function (c) {

@@ -301,3 +317,3 @@ return RX.isMeta(c) ? c : undefined;

this.setState({ mask: mask });
console.log("Selected(done): " + str);
//console.log("Selected(done): "+str);
}

@@ -393,9 +409,9 @@ },

var inpProps = except(this.props, ['popover', 'mask', 'selection']);
console.log("PROPS:", inpProps);
//console.log("PROPS:", inpProps);
var OK = undefined;
var pat = this.state.mask.pattern;
var patternLength = pat.length;
console.log('about to render name:\'' + this.props.name + '\' - ' + this.state.mask.isDone());
//console.log(`about to render name:'${this.props.name}' - ${this.state.mask.isDone()}`);
var myPopover = this.props.popover ? this._createPopover(this._getMaskList(), ['Possible Values']) : React.createElement('span', null);
console.log("about to render - " + this.state.mask.isDone());
//console.log("about to render - " + this.state.mask.isDone());
var ok = this.state.mask.isDone();

@@ -402,0 +418,0 @@ if (ok) OK = mapImg[this.state.mask.isDone()]; //<span className="input-group-addon">.00</span>; //

@@ -166,3 +166,3 @@ /*

mask.backspace();
console.log("Fix maskValue", maskValue, "diff:", sizeDiff, "target value: ", e.target.value);
//console.log("Fix maskValue", maskValue, "diff:", sizeDiff, "target value: ", e.target.value);
}

@@ -177,4 +177,6 @@ var value = this._getDisplayValue();

if (this.props.onChange) {
this.props.onChange(e);
var opt = { target: { value: this.getValue() } };
this.props.onChange(opt);
}
// console.log("on change", e)
},

@@ -197,2 +199,3 @@

if (action()) {
var oldVal = e.target.value;
var value = _this._getDisplayValue();

@@ -204,2 +207,8 @@ e.target.value = value;

}
if (_this.props.onChange && oldVal != value) {
var opt = { target: { value: mask._getValue() } };
_this.props.onChange(opt);
//console.log("on change", e)
}
// console.log("on change1", e)
}

@@ -234,3 +243,3 @@ _this.setState({ selection: mask.selection });

console.log("Arrow Action support:", supportArrowNavigation(mask), " value:", this._getDisplayValue(), " selection: ", asStr((0, _reactLibReactInputSelection.getSelection)(this.input)), asStr(mask.selection));
//console.log("Arrow Action support:", supportArrowNavigation(mask), " value:",this._getDisplayValue(), " selection: ", asStr(getSelection(this.input)), asStr(mask.selection));
}

@@ -241,3 +250,3 @@ },

var mask = this.state.mask;
console.log('onKeyPress', asStr((0, _reactLibReactInputSelection.getSelection)(this.input)), asStr(mask.selection), e.key, e.target.value);
//console.log('onKeyPress', asStr(getSelection(this.input)),asStr(mask.selection), e.key, e.target.value)

@@ -255,6 +264,13 @@ // Ignore modified key presses

if (insert(e.key)) {
e.target.value = mask.getValue();
var oldVal = e.target.value;
var value = mask.getValue();
e.target.value = value;
//console.log("keyPress:getDisplayValue", this._getDisplayValue(), " selection: ", asStr(selX)+"/"+asStr(mask.selection)+"<"+asStr(oldMaskX));
this._updateInputSelection();
this.setState({ selection: mask.selection });
if (this.props.onChange && oldVal != value) {
var opt = { target: { value: mask._getValue() } };
this.props.onChange(opt);
}
//console.log("on change", e)
}

@@ -271,3 +287,3 @@

var mask = this.state.mask;
console.log('onPaste', asStr((0, _reactLibReactInputSelection.getSelection)(this.input)), e.clipboardData.getData('Text'), e.target.value);
//console.log('onPaste', asStr(getSelection(this.input)), e.clipboardData.getData('Text'), e.target.value)

@@ -277,6 +293,6 @@ e.preventDefault();

// getData value needed for IE also works in FF & Chrome
console.log("paste: ", e.clipboardData.getData('Text'));
//console.log("paste: ", e.clipboardData.getData('Text'));
if (mask.paste(e.clipboardData.getData('Text'))) {
e.target.value = mask.getValue();
console.log("undo:getDisplayValue", this._getDisplayValue());
//console.log("undo:getDisplayValue", this._getDisplayValue());
// Timeout needed for IE

@@ -289,4 +305,4 @@ setTimeout(this._updateInputSelection, 0);

_getMaskList: function _getMaskList() {
var list = this.state.mask.minCharsList(true);
_getMaskList: function _getMaskList(flag) {
var list = this.state.mask.minCharsList(!!flag);
if (list && list.length < 20) return list;

@@ -302,3 +318,3 @@ return this.state.mask.minCharsList();

selected: function selected(str, e) {
console.log("Selected: " + str);
//console.log("Selected: "+str);
if (!str.split('').find(function (c) {

@@ -310,3 +326,3 @@ return RX.isMeta(c) ? c : undefined;

this.setState({ mask: mask });
console.log("Selected(done): " + str);
//console.log("Selected(done): "+str);
}

@@ -402,9 +418,9 @@ },

var inpProps = (0, _except2['default'])(this.props, ['popover', 'mask', 'selection']);
console.log("PROPS:", inpProps);
//console.log("PROPS:", inpProps);
var OK = undefined;
var pat = this.state.mask.pattern;
var patternLength = pat.length;
console.log('about to render name:\'' + this.props.name + '\' - ' + this.state.mask.isDone());
//console.log(`about to render name:'${this.props.name}' - ${this.state.mask.isDone()}`);
var myPopover = this.props.popover ? this._createPopover(this._getMaskList(), ['Possible Values']) : _react2['default'].createElement('span', null);
console.log("about to render - " + this.state.mask.isDone());
//console.log("about to render - " + this.state.mask.isDone());
var ok = this.state.mask.isDone();

@@ -411,0 +427,0 @@ if (ok) OK = mapImg[this.state.mask.isDone()]; //<span className="input-group-addon">.00</span>; //

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

@@ -22,3 +22,3 @@ "main": "lib/index.js",

"except": "^0.1.3",
"incr-regex-package": "^0.9.4",
"incr-regex-package": "^0.9.6",
"react-bootstrap": "^0.30.2"

@@ -25,0 +25,0 @@ },

@@ -36,2 +36,8 @@ # react-rxinput

### Dependencies
- [incr-regex-package](https://github.com/nurulc/incr-regex-package)
- [react-bootstrap](https://react-bootstrap.github.io/) (Planning to remove this dependency)
- [React](https://facebook.github.io/react/)
### Demo notes:

@@ -45,9 +51,5 @@

[incr-regex-package](https://github.com/nurulc/incr-regex-package)
[react-bootstrap](https://react-bootstrap.github.io/)
[React](https://facebook.github.io/react/)
## Screenshot
![rxinput demo](https://raw.githubusercontent.com/nurulc/react-rxinput/master/demo-screensho.png)
[![rxinput demo](https://raw.githubusercontent.com/nurulc/react-rxinput/master/demo-screensho.png)](https://nurulc.github.io/)

@@ -54,0 +56,0 @@ ## Introduction

/*!
* react-rxinput 1.0.2
* react-rxinput 1.0.4
* ISC Licensed
*/
!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 o(t){return(t.ctrlKey||t.metaKey)&&t.keyCode===(t.shiftKey?_:k)}function a(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){this.props.mask.toString()!==t.mask.toString()?(this.state.mask.setPattern(t.mask,{value:t.value,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 o=e._getDisplayValue();t.target.value=o,o&&e._updateInputSelection()}return e.setState({selection:n.selection}),!0};if(!(i(o,function(){return n.undo()})||i(a,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){function e(t){return!!n.input(t)||(t!==t.toUpperCase()?n.input(t.toUpperCase()):t!=t.toLowerCase()&&n.input(t.toLowerCase()))}var n=this.state.mask;if(console.log("onKeyPress",u((0,m.getSelection)(this.input)),u(n.selection),t.key,t.target.value),!(t.metaKey||t.altKey||t.ctrlKey||"Enter"===t.key)){(0,m.getSelection)(this.input),n.getSelection();t.preventDefault(),this._updateMaskSelection(),e(t.key)&&(t.target.value=n.getValue(),this._updateInputSelection(),this.setState({selection:n.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},selected:function(t,e){if(console.log("Selected: "+t),!t.split("").find(function(t){return g.isMeta(t)?t:void 0})){var n=this.state.mask;n.setValue(t),this.setState({mask:n}),console.log("Selected(done): "+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,o=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,o(t).length)}))),b(n,"MAX WIDTH:");var a=n||200,s={width:a-50,maxWidth:a-50},u=void 0,c=void 0;if(!t||t.length<=1)return p.default.createElement("div",null);t.length>20&&(u={height:"400px",display:"block",overflow:"auto"},c=p.default.createElement("div",null,"             "));var h=this;return p.default.createElement(y.Popover,{id:this.props.name+"myPopover",className:"col-xs-10 col-md-10",style:{width:a,maxWidth:a,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 h.selected(t,e)},key:i.props.name+"L"+r(t)},p.default.createElement("td",{onClick:function(e){return h.selected(t,e)}},t))}))),c)},render:function(){var t=this,e=this.props,n=(e.mask,e.size),r=e.placeholder,o=(i(e,["mask","size","placeholder"]),(0,v.default)(this.props,["popover","mask","selection"]));console.log("PROPS:",o);var a=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&&(a=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"+a[1]},p.default.createElement(y.OverlayTrigger,{trigger:"focus",style:{marginBotton:"0px"},ref:"mypop",placement:"bottom",overlay:c},p.default.createElement("input",h({},o,{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"}}))),a[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,o=-1,a=Object.keys(r),s=a?a.length:0;++o<s;)i=a[o],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 o=n,a=0;a<i;o++,a++)if(e[a]instanceof Array&&t[o]instanceof Array){if(!p(t[o],e[a],0))return!1}else if(t[o]!==e[a])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="[^.+?{}\\]\\[|()]",o=[t,r,n,e,i].join("|");return new RegExp("("+o+")","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 N(t){return I(t.reduce(function(t,e){return S(e,t)},null))}function R(t){return N(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=N,e.stringToList=R,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}},o=r("Array"),a=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:a,isArr:o,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 o(){}function a(){}function s(){}function u(t){return t&&"U"==t.type&&"MULTIRANGE"==t.op}function c(t){return function(e){return[!(e===G||void 0!==e&&!e.match(t)),void 0]}}function l(t){return[t!==G,void 0]}function h(t){return function(e){return[!(e===G||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:o,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)?W[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:o,op:"NON-PRINTING",match:c("\\"+t.substring(1))}:/^\\[.?+*{}()$^\\:]$/.test(t)?{type:"N",val:t.substring(1,2),multi:o,op:"SINGLE",match:h(t.substring(1))}:{type:"N",val:t,multi:o,op:"SINGLE",match:h(t)}}function w(t){if(void 0!==t){if(t===G)return G;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?N(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 N(t,e){return e?{oper:B,left:t,right:e}:t}function R(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===G?"<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===G?"<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=o,e.PERHAPS_MORE=a,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:o,op:"SKIP",match:l}),F=(y({type:"N",val:"\b",multi:o,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:"."}),Z=function(){return!1},G=e.DONE=y({type:"N",val:"DONE",multi:s,op:"DONE",match:Z}),W=(e.MORE=y({type:"N",val:"MORE",multi:s,op:"MORE",match:Z}),e.MAYBE=y({type:"N",val:"MAYBE",multi:s,op:"MAYBE",match:Z}),e.FAILED=y({type:"N",val:"FAILED",multi:s,op:"FAILED",match:Z}),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:Z},{"*":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(G),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 o=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}:o(void 0,{oper:U,left:e},i):void 0===i?o(o(void 0,e,r),{oper:X,left:e},1):o(o(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,R(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(G),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 o(t){return t.split("").map(function(t){return"*"===t?O:"?"===t?w:"_"===t?S:t}).join("")}function a(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,o=2,a=function(t){var e=0;return function(n){switch(n){case i:return e<t.length?t.charAt(e):void 0;case o: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=a(t),f=a(e);h()&&f();){var p=h(i),d=f(i),v=s(p)||s(d);u(p,d)?(r+=c(p,d),h(o),f(o)):v?s(p)?(r+=p,h(o)):(r+=d,f(o)):(r+=S,h(o),f(o))}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 o(s,u,c){if(!s)return t(u);if(c&&s===(0,b.n_head)(c))return o(s.nextNode,a(s,u),(0,b.n_tail)(c));if(s===x.DONE)return t(u);if((0,x.dot)(s))return o(s.left,u,c);if((0,x.or)(s)){var l=o(s.left,u,c),h=o(s.right,u,c);return n(l,h)}if((0,x.zero_or_one)(s))return r?r(s,u,o,c):o(s.nextNode,e(u,w),c);if((0,x.zero_or_more)(s))return r?r(s,u,o,c):o(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 o(s.nextNode,e(u,p),c)}return(0,x.boundary)(s)?o(s.nextNode,u,c):t(u)}var a=function(t,n){return(0,x.zero_or_more)(t)?e(n,O):n};return o}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=o,e.isMeta=a,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])},o=function(t,e){return(0,b.flatten)((0,b.arr_push)(t,e))},a=function(t,e,n,r){if(t.left){var o=n(t.nextNode,e,r),a=n(t.left,e,(0,b.n_cons)(t,r));return i(o,a)}},s=e?a:void 0;return v(d(n,r,i,s,t),o,n)},I=A(y,!0),N=A(y,!1),R=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=R(this.current),this._mask}},{key:"minCharsList",value:function(t){var e=t?I:N;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 o=t[i];if(!this.match(o)){n=!1;break}this.lastCh=o,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),o=this.action(t.right,e,n,r);return this._result(i,o)}if((0,x.zero_or_one)(t)||(0,x.zero_or_more)(t)){var a=(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(a,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}}(),o=(n(1),n(3)),a=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,o.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()===a.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,o.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,o.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=o.apply(i,a.call(arguments,1));for(var r in t)s(n,r)===-1&&(e[r]=t[r]);return e}var i=Array.prototype,o=i.concat,a=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),o=n(3),a=n(13),s=n(5);if(void 0===o.incrRegEx)throw new Error("incrRegEx not defined");if(void 0===a.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=o.incrRegEx,e.printExpr=i.printExpr,e.RxParser=i.RxParser,e.RXInputMask=a.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=o.IREGEX,e.convertMask=o.convertMask,e.isMeta=o.isMeta,e.isOptional=o.isOptional,e.isHolder=o.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 o(t,e,n){return a(i(t.start+e,t.end+(void 0===n?e:n)))}function a(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 o=e?r:r.filter(function(t){return void 0===t[1]});return o.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,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}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:o(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],o=n[2];if(!r)return!1;var a=this._getValue(),s=this.selection,u=this.pattern;return this._lastOp="input",this.selection=i,this.pattern=o,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:a,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=o(e,1));var r=n.clone();e=this._updateSelection(e,r.getFirstEditableAtOrAfter(e.start));var a=r.getFirstEditableAtOrAfter(e.end),s=y(r,!1,a),u=e.start;if(r.setPos(u),void 0!==t&&!d(r,t))return[!1,e,r];e=this._updateSelection(e,r.getInputLength()),a=Math.max(a,e.end);var l=r.getFirstEditableAtOrAfter(r.getInputLength()),h=this._insertRest(s,r,u,a+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,o){if(t>=e.length)return n;if(r>o||n.isDone())return n;var a=n.clone();if(d(a,e.charAt(t))){var s=i(t+1,e,a,a.getInputLength()-1,o);if(void 0!==s)return s}for(;p(n,!1););return n.match(void 0),i(t,e,n,r+1,o)}var o=i(0,t,e,n,r+t.length);return o}},{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,o=r.start,a=r.end;if(o===a){if(o=this.pattern.getFirstEditableAtOrBefore(o-1),a=o+1,o<t)return}else if(o=this.pattern.getFirstEditableAtOrBefore(a<o?a:o),a===o&&a++,a<=t)return;var s=this._input(void 0,i(o,a),this.pattern),u=this.pattern;return!!s[0]&&(this.pattern=s[2],this.selection.start=this.selection.end=o,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,o=function(t){return e.pattern.getFirstEditableAtOrAfter(t)},s=function(t){return e.pattern.getFirstEditableAtOrBefore(t)};this.selection=r;var u=o(0),h=this.pattern.lastEditableIndex(),f=i(u,h);return c(n)?this.selection=a(n,f,l(this.selection,n)?s:o):this.selection=a(n,f,o,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,o=0;o<e.length&&r;i++,o++){var a=e.charAt(o);r&=d(n,a)}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 o=i.text.length,a=o+r;return{start:o,end:a}}function o(t){var e=window.getSelection&&window.getSelection();if(!e||0===e.rangeCount)return null;var n=e.anchorNode,i=e.anchorOffset,o=e.focusNode,a=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(o,a);var y=v.collapsed;return{start:y?d:p,end:y?p:d}}function a(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),o=void 0===e.end?i:Math.min(e.end,r);if(!n.extend&&i>o){var a=o;o=i,i=a}var s=c(t,i),u=c(t,o);if(s&&u){var h=document.createRange();h.setStart(s.node,s.offset),n.removeAllRanges(),i>o?(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:o,setOffsets:h?a:s};t.exports=f},function(t,e,n){"use strict";function r(t){return o(document.documentElement,t)}var i=n(15),o=n(7),a=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),a(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 o=t.createTextRange();o.collapse(!0),o.moveStart("character",n),o.moveEnd("character",r-n),o.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),o=0,a=0;i;){if(3===i.nodeType){if(a=o+i.textContent.length,o<=e&&a>=e)return{node:i,offset:e-o};o=a}i=n(r(i))}}t.exports=i},function(t,e,n){"use strict";function r(){return!o&&i.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var i=n(4),o=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?g:m)}function o(t){return(t.ctrlKey||t.metaKey)&&t.keyCode===(t.shiftKey?m:g)}function s(t,e){return t===e||void 0!==t&&void 0!==e&&(t.start===e.start&&t.end===e.end)}function u(t,e){var n=t.toUpperCase(),r=e.toUpperCase();return n<r?-1:n>r?1:0}var c=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},l=n(19),h=r(l),f=n(6),p=r(f),d=n(20),v=n(16),y=n(12),m=90,g=89,_={DONE:[h.default.createElement("span",{className:"glyphicon glyphicon-ok form-control-feedback"}),""],MORE:[h.default.createElement("span",{className:"glyphicon glyphicon-arrow-right form-control-feedback"})," has-warning"],OK:[h.default.createElement("span",{className:"glyphicon glyphicon-option-horizontal form-control-feedback"}),""]},k=function(t){return t},E=h.default.createClass({displayName:"RxInput",propTypes:{mask:h.default.PropTypes.object.isRequired,name:h.default.PropTypes.string.isRequired,popover:h.default.PropTypes.string,selection:h.default.PropTypes.object,value:h.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 y.RXInputMask(t)}},componentWillReceiveProps:function(t){this.props.mask.toString()!==t.mask.toString()?(this.state.mask.setPattern(t.mask,{value:t.value,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,v.getSelection)(this.input)},_updateInputSelection:function(){s((0,v.getSelection)(this.input),this.state.mask.selection)||(0,v.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()}var i=this._getDisplayValue();t.target.value=i,i&&this._updateInputSelection()}if(this.setState({selection:this.mask.selection}),this.props.onChange){var a={target:{value:this.getValue()}};this.props.onChange(a)}},_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=t.target.value,o=e._getDisplayValue();if(t.target.value=o,o&&e._updateInputSelection(),e.props.onChange&&a!=o){var s={target:{value:n._getValue()}};e.props.onChange(s)}}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 s=(0,v.getSelection)(this.input);s.start===s.end&&void 0!==n.left&&(t.preventDefault(),"ArrowLeft"===t.key?n.left(s):n.right(s),this._updateInputSelection())}},_onKeyPress:function(t){function e(t){return!!n.input(t)||(t!==t.toUpperCase()?n.input(t.toUpperCase()):t!=t.toLowerCase()&&n.input(t.toLowerCase()))}var n=this.state.mask;if(!(t.metaKey||t.altKey||t.ctrlKey||"Enter"===t.key)){(0,v.getSelection)(this.input),n.getSelection();if(t.preventDefault(),this._updateMaskSelection(),e(t.key)){var r=t.target.value,i=n.getValue();if(t.target.value=i,this._updateInputSelection(),this.setState({selection:n.selection}),this.props.onChange&&r!=i){var a={target:{value:n._getValue()}};this.props.onChange(a)}}}},_onPaste:function(t){var e=this.state.mask;t.preventDefault(),this._updateMaskSelection(),e.paste(t.clipboardData.getData("Text"))&&(t.target.value=e.getValue(),setTimeout(this._updateInputSelection,0),this.setState({selection:e.selection}))},_getMaskList:function(t){var e=this.state.mask.minCharsList(!!t);return e&&e.length<20?e:this.state.mask.minCharsList()},_getDisplayValue:function(){var t=this.state.mask.getValue();return t===this.state.mask.emptyValue?"":t},selected:function(t,e){if(!t.split("").find(function(t){return y.isMeta(t)?t:void 0})){var n=this.state.mask;n.setValue(t),this.setState({mask:n})}},_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 k(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)}))),k(n,"MAX WIDTH:");var o=n||200,s={width:o-50,maxWidth:o-50},c=void 0,l=void 0;if(!t||t.length<=1)return h.default.createElement("div",null);t.length>20&&(c={height:"400px",display:"block",overflow:"auto"},l=h.default.createElement("div",null,"             "));var f=this;return h.default.createElement(d.Popover,{id:this.props.name+"myPopover",className:"col-xs-10 col-md-10",style:{width:o,maxWidth:o,fontSize:"10px",marginTop:"10px",marginBottom:"10px"}},h.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},h.default.createElement("thead",null,h.default.createElement("tr",null,e.map(function(t){return h.default.createElement("th",{key:i.props.name+t},t)}))),h.default.createElement("tbody",{style:c},t.sort(u).map(function(t){return h.default.createElement("tr",{onClick:function(e){return f.selected(t,e)},key:i.props.name+"L"+r(t)},h.default.createElement("td",{onClick:function(e){return f.selected(t,e)}},t))}))),l)},render:function(){var t=this,e=this.props,n=(e.mask,e.size),r=e.placeholder,a=(i(e,["mask","size","placeholder"]),(0,p.default)(this.props,["popover","mask","selection"])),o=void 0,s=this.state.mask.pattern,u=s.length,l=this.props.popover?this._createPopover(this._getMaskList(),["Possible Values"]):h.default.createElement("span",null),f=this.state.mask.isDone();f&&(o=_[this.state.mask.isDone()]);var v={marginBotton:"0px",fontSize:"70%",color:"red",fontStyle:"italic"},y=h.default.createElement("div",{style:{marginBotton:"0px",paddingLeft:"100px"}},h.default.createElement("div",{style:v},f,"  "),h.default.createElement("div",{className:"form-group has-feedback"+o[1]},h.default.createElement(d.OverlayTrigger,{trigger:"focus",style:{marginBotton:"0px"},ref:"mypop",placement:"bottom",overlay:l},h.default.createElement("input",c({},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 y}});t.exports=E},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":z(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 _(t,e){return t.length<e?t:t.substr(t.length-e,e)}function k(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(){function t(t){return t.split("").map(function(t){return"\\"+t}).join("|")}function e(t){return t.split("").join("|")}var n="\\[(?:\\\\u|\\\\\\]|\\\\\\\\|(\\\\)?\\[|[^\\]\\[\\\\])*?\\]",r=t(".|+*?()^$"),i="\\(\\?:|\\?\\?|\\*\\?|\\+\\?",a=e("dDsSbBwW"),o=t("[]{}\\"),s=[r,a,o].join("|"),u="\\\\(?:"+s+")",c="\\{(?:\\d+,\\d+|\\d+|\\d+,|,\\d+)\\}",l="[^.+?{}\\]\\[|()\\\\]";return[n,c,u,i,r,l].map(function(t){return"(?:"+t+")"}).join("|")}function O(){return new RegExp(E(),"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 S(t,e){return void 0===t?e:(t.push(e),t)}function w(t,e,n){return new B(t,e)}function R(t){if(!t)throw Error("n_head of empty list");return t.head}function I(t){if(!t)throw Error("n_tail of empty list");return t.tail}function A(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return t?A(I(t),w(R(t),e)):e}function N(t){return A(t.reduce(function(t,e){return w(e,t)},null))}function M(t){return N(t.split(""))}function C(t){return V(function(t,e){return t.push(e),t},t,[])}function D(t){return C(t).join("")}function P(t,e){return t&&t?w(R(t),P(I(t),e)):e}function L(t,e,n){return n=n||0,e?w(t(R(e),n,e),L(t,I(e),n+1)):e}function T(t,e,n){return e?(n=n||0,t(R(e),n,e)?w(R(e),T(t,I(e),n+1)):T(t,I(e),n+1)):e}function j(t,e,n){return n=n||0,e?t(R(e),n,e)?e:j(t,I(e),n+1):null}function V(t,e,n){return e?V(t,I(e),t(n,R(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!j(function(n){return t(n,e)},n)},e)}Object.defineProperty(e,"__esModule",{value:!0});var F=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}}(),z="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=_,e.sRightMerge=k,e.parseMulti=b,e.odd=x,e.arr_push=S,e.n_cons=w,e.n_head=R,e.n_tail=I,e.n_reverse=A,e.arrayToList=N,e.stringToList=M,e.listToArray=C,e.listToString=D,e.n_concat=P,e.n_map=L,e.n_filter=T,e.n_find=j,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":z(e))==t}},u=function(t){return function(e){if(("undefined"==typeof e?"undefined":z(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 B=(e.TOKINIZATION_RX=O(),e.StackDedup=function(){function t(e){n(this,t),this.length=0,this.data=[],e&&this.push(e),this.maxLen=0}return F(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(S,[])}},{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 F(t,[{key:"equals",value:function(t){return null!==t&&(this.head===t.head&&this.tail===t.tail)}},{key:"addAll",value:function(t){return t?A(a).reduce(function(t,e){return w(e,t)},this):this}},{key:"map",value:function(t){return L(t,this)}},{key:"reduce",value:function(t,e){return V(t,this,e)}},{key:"reverse",value:function(t){return A(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===W||void 0!==e&&!e.match(t)),void 0]}}function l(t){return[t!==W,void 0]}function h(t){return function(e){return[!(e===W||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(_(t)){var n=e?v(t.right,e):t.right;return v(t.left,n),t}if(k(t)&&e)return t.left===F?t.left=e:v(t.left,e),t.right===F?t.right=e:v(t.right,e),t;if(E(t)&&e)return v(t.left,e),t.nextNode=e,t;if(O(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 _(t){return t&&t.oper===Y}function k(t){return t&&t.oper===U}function E(t){return t&&t.oper===H}function O(t){return t&&t.oper===X}function b(t){return t&&"N"===t.type&&"ANY"===t.op}function x(t){return t&&"N"===t.type&&("CHARSET"===t.op||"SPECIAL-CHARSET"===t.op)}function S(t){return"<SKIP>"==t?F:"("==t||"(?:"==t?z:")"==t?B:"."==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?U:/^[?+*]\??$/.test(t)?q[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($[t])}:/^\\[trn]$/.test(t)?{type:"N",val:J[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===W)return W;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&&(_(t)||E(t)||O(t)||k(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 R(t,e,n){return t===Y?I(e,n):t===U?A(e,n):n?{oper:t,left:e,right:n}:e}function I(t,e){return t===F?e:e===F?t:e?{oper:Y,left:t,right:e}:t}function A(t,e){return e?{oper:U,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 C(t,e){for(var n=0;n<Q.length;n++)if((0,K.array_match)(t,Q[n].match,e))return Q[n]}function D(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=C(t,n);i?((0,K.array_append)(e,i.put),n+=i.match.length-1):e.push(t[n])}return e}function P(t){t&&("|"==t[t.length-1]&&(t=t.concat("<SKIP>")),"|"==t[0]&&(t=["<SKIP>"].concat(t)));for(var e=D(t);!(0,K.array_eq)(t,e);)t=e,e=D(t);return t}function L(t,e){return e&&t&&t.oper?"("+L(t)+")":t&&t.oper?"B"==t.oper.type?"."==t.oper.op?"("+L(t.left)+"."+L(t.right)+")":"("+L(t.left)+"|"+L(t.right)+")":"U"==t.oper.type?"("+L(t.left,!1)+t.oper.val+")":void 0:t===W?"<DONE>":t.val}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===W?"<DONE>":"'"+t.val+"'"}function j(t,e){return e&&t&&t.oper?"("+L(t)+")":t&&t.oper?"B"==t.oper.type?"."==t.oper.op?t.nextNode?"("+j(t.left)+"."+j(t.nextNode)+")":j(t.left):"("+j(t.left)+"|"+j(t.right)+")":"U"==t.oper.type?t.nextNode?"(("+L(t.left,!1)+t.oper.val+")."+j(t.nextNode)+")":"("+L(t.left,!1)+t.oper.val+")":void 0:t===W?"<DONE>":t&&t.nextNode?"("+t.val+"."+j(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=_,e.or=k,e.zero_or_one=E,e.zero_or_more=O,e.anychar=b,e.charset=x,e.copyNode=w,e.printExpr=L,e.printExprQ=T,e.printExprN=j;var K=n(1);if(!K.array_append)throw new Error("array_append is undefined");var F=y({type:"N",val:"<SKIP>",multi:a,op:"SKIP",match:l}),z=(y({type:"N",val:"\b",multi:a,op:"SINGLE",match:c(/[\b]/)}),y({type:"L",val:")"})),B=y({type:"R",val:")"}),U=y({type:"B",val:"|",op:"OR"}),H=y({type:"U",val:"?",op:"MULTI"}),X=y({type:"U",val:"*",op:"MULTI"}),Z=y({type:"U",val:"+",op:"MULTI"}),Y=y({type:"B",val:".",op:"."}),G=function(){return!1},W=e.DONE=y({type:"N",val:"DONE",multi:s,op:"DONE",match:G}),q=(e.MORE=y({type:"N",val:"MORE",multi:s,op:"MORE",match:G}),e.MAYBE=y({type:"N",val:"MAYBE",multi:s,op:"MAYBE",match:G}),e.FAILED=y({type:"N",val:"FAILED",multi:s,op:"FAILED",match:G}),e.RXTREE={matchable:m,boundary:g,dot:_,or:k,zero_or_one:E,zero_or_more:O,OR:U,ZERO_OR_ONE:H,ZERO_OR_MORE:X,ONE_OR_MORE:Z,DOT:Y,FALSE:G},{"*":X,"+":Z,"?":H}),$={"\\d":/\d/,"\\D":/\D/,"\\s":/\s/,"\\S":/\S/,"\\w":/\w/,"\\W":/\W/},J={t:"\t",n:"\n",r:"\r"},Q=[{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(L)+" 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,z),this.basePrec+=10;break;case"R":if(this.opState(!1,!1,B),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===Z?this.oneOrMore(i):this.unaryOp(n.op,i):(r=this.popOper(),this.operand.push(R(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(W),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:H,left:e},i):void 0===i?a(a(void 0,e,r),{oper:X,left:e},1):a(a(e,e,r-1),{oper:H,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=P(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(W),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?x:"?"===t?w:"_"===t?S:t}).join("")}function o(t){return t==S||s(t)}function s(t){return t==w||t==x}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,O.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===x?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,O.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===b.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,O.n_head)(c))return a(s.nextNode,o(s,u),(0,O.n_tail)(c));if(s===b.DONE)return t(u);if((0,b.dot)(s))return a(s.left,u,c);if((0,b.or)(s)){var l=a(s.left,u,c),h=a(s.right,u,c);return n(l,h)}if((0,b.zero_or_one)(s))return r?r(s,u,a,c):a(s.nextNode,e(u,w),c);if((0,b.zero_or_more)(s))return r?r(s,u,a,c):a(s.nextNode,e(u,x),c);if((0,b.matchable)(s)){var f=(0,b.matchable)(s)(void 0),p=f[1]||(i?i(s,S):S);return a(s.nextNode,e(u,p),c)}return(0,b.boundary)(s)?a(s.nextNode,u,c):t(u)}var o=function(t,n){return(0,b.zero_or_more)(t)?e(n,x):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!==b.DONE){if((0,b.dot)(t))return m(t.left);if((0,b.matchable)(t)){var e=(0,b.matchable)(t)(void 0);return e[1]}if((0,b.or)(t)){var n=m(t.left),r=m(t.right);return n===r?n:void 0}(0,b.zero_or_one)(t)||(0,b.zero_or_more)(t)||(0,b.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 _(t,e){return t===-1||e===-1?-1:t+e}function k(t){if(!t)return 0;if(t===b.DONE)return 0;if((0,b.dot)(t))return _(k(t.left),k(t.right));if((0,b.or)(t)){var e=k(t.left);return e>=0&&e===k(t.right)?e:-1}if((0,b.zero_or_one)(t)||(0,b.zero_or_more)(t))return-1;if((0,b.matchable)(t)){var n=(0,b.matchable)(t)(void 0);return n[1]}return(0,b.boundary)(t)?k(t.left):0}Object.defineProperty(e,"__esModule",{value:!0}),e.IREGEX=e.HOLDER_ZERO_OR_ONE=e.HOLDER_ANY=e.HOLDER_ZERO_OR_MORE=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,e.makeRxInfo=d;var O=n(1),b=n(2),x=e.HOLDER_ZERO_OR_MORE="⋯",S=e.HOLDER_ANY="_",w=e.HOLDER_ZERO_OR_ONE="◑",R=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,O.flatten)([t,e])},a=function(t,e){return(0,O.flatten)((0,O.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,O.n_cons)(t,r));return i(a,o)}},s=e?o:void 0;return v(d(n,r,i,s,t),a,n)},I=R(y,!0),A=R(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=b.RxParser.parse(e)),this.str=e,this.base=n,this.tracker=[],this.current=new O.StackDedup(n),this.one=this.current,this.two=new O.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=k(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()===b.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:A;return(0,O.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===b.MORE?"MORE":t===b.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:"getCurrentStates",value:function(){return this.current.map(O.ID)}},{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(O.ID),t.two=this.two.map(O.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(O.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===b.DONE)return e===b.DONE?(n.push(b.DONE),b.DONE):b.FAILED;if((0,b.dot)(t))return this.action(t.left,e,n,r);if((0,b.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,b.zero_or_one)(t)||(0,b.zero_or_more)(t)){var o=(0,b.boundary)(t.left)?b.DONE:this.action(t.left,e,n,!0),s=this.action(t.nextNode,e,n,r);return this._result(o,s)}if((0,b.matchable)(t)){var u=t.match(e);return u[0]&&n.push(t.nextNode),u[0]?t.nextNode===b.DONE?b.DONE:b.MORE:b.FAILED}if((0,b.boundary)(t)){if(r)return b.FAILED;var c=t.match(this.lastCh,e);return c[0]?(t=t.nextNode,c=this.action(t,e,n)):b.FAILED}return b.FAILED}},{key:"_result",value:function(t,e){return t===e?t:t===b.MORE||e===b.MORE?b.MORE:void 0}},{key:"test",value:function(t,e){var n=this;e=e||this.current;var r=b.FAILED,i=this._getArr();if(e.forEach(function(e){r=n._result(n.action(e,t,i),r)}),r!==b.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 b.DONE;var e=this.test(b.DONE);return p(e)?b.MAYBE:b.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,k.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,k.isOptional)(n.charAt(0))&&!(0,k.isMeta)(n.charAt(1))){if(t.match(n.charAt(1)))return!0}else if(n.length>0&&!(0,k.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,k.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 _=n(1),k=n(3),E=n(5),O=(n(2),e.RXInputMask=function(){function t(e){if(r(this,t),e=(0,_.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,_.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,_.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,_.copy)(this.selection),_lastOp:this._lastOp,_history:this._history.slice(),_historyIndex:this._historyIndex,_lastSelection:(0,_.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,_.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,_.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,_.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,_.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,_.assign)({value:""},e),this.pattern=new E.RxMatcher((0,k.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,_.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 O("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,k.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,_.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,_.copy)(this.selection),this}},{key:"_updateSelection",value:function(t,e){var n=(0,_.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,_.arr_find)(function(t){return(0,k.isHolder)(t)},n))return"MORE";t.reset();for(var r=0;r<n.length;r++)if(!(0,k.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