New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wadehrarshpreet/nbform

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wadehrarshpreet/nbform - npm Package Compare versions

Comparing version 0.0.1-alpha.29 to 0.0.1-alpha.30

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [0.0.1-alpha.30](https://github.com/wadehrarshpreet/nbform/compare/v0.0.1-alpha.29...v0.0.1-alpha.30) (2020-04-14)
### Bug Fixes
* multiple submit issue in case of no error ([ac4b12a](https://github.com/wadehrarshpreet/nbform/commit/ac4b12a21aba2541cef1132430b993211fa94409))
### [0.0.1-alpha.29](https://github.com/wadehrarshpreet/nbform/compare/v0.0.1-alpha.27...v0.0.1-alpha.29) (2020-04-12)

@@ -7,0 +14,0 @@

13

dist/cjs/NbForm/validation.js

@@ -401,3 +401,3 @@ "use strict";

_regenerator["default"].mark(function _callee3(userInputs, formData, updateFormData, onSubmit, extraProps) {
var _ref7, updateFormDataArguments, isError;
var _ref7, updateFormDataArguments, isError, isSubmit;

@@ -424,4 +424,6 @@ return _regenerator["default"].wrap(function (_context3) {

isSubmit = false;
if (!(updateFormDataArguments && updateFormDataArguments[0] && updateFormDataArguments[0].length === 0)) {
_context3.next = 9;
_context3.next = 10;
break;

@@ -432,4 +434,5 @@ }

updateFormData(true, true, function (updatedFormData) {
if (typeof onSubmit === 'function') {
if (typeof onSubmit === 'function' && !isSubmit) {
onSubmit(isError, (0, _NbFormState.getKeyValue)(updatedFormData), updatedFormData);
isSubmit = true;
}

@@ -439,3 +442,3 @@ });

case 9:
case 10:
updateFormData.apply(void 0, updateFormDataArguments.concat([function (updatedFormData) {

@@ -447,3 +450,3 @@ if (typeof onSubmit === 'function') {

case 10:
case 11:
case "end":

@@ -450,0 +453,0 @@ return _context3.stop();

@@ -403,3 +403,3 @@ "use strict";

_regenerator["default"].mark(function _callee3(userInputs, formData, updateFormData, onSubmit, extraProps) {
var _ref7, updateFormDataArguments, isError;
var _ref7, updateFormDataArguments, isError, isSubmit;

@@ -426,4 +426,6 @@ return _regenerator["default"].wrap(function (_context3) {

isSubmit = false;
if (!(updateFormDataArguments && updateFormDataArguments[0] && updateFormDataArguments[0].length === 0)) {
_context3.next = 9;
_context3.next = 10;
break;

@@ -434,4 +436,5 @@ }

updateFormData(true, true, function (updatedFormData) {
if (typeof onSubmit === 'function') {
if (typeof onSubmit === 'function' && !isSubmit) {
onSubmit(isError, (0, _NbFormState.getKeyValue)(updatedFormData), updatedFormData);
isSubmit = true;
}

@@ -441,3 +444,3 @@ });

case 9:
case 10:
updateFormData.apply(void 0, updateFormDataArguments.concat([function (updatedFormData) {

@@ -449,3 +452,3 @@ if (typeof onSubmit === 'function') {

case 10:
case 11:
case "end":

@@ -452,0 +455,0 @@ return _context3.stop();

@@ -462,3 +462,3 @@ "use strict";

_regenerator["default"].mark(function _callee3(userInputs, formData, updateFormData, onSubmit, extraProps) {
var _ref8, _ref9, updateFormDataArguments, isError;
var _ref8, _ref9, updateFormDataArguments, isError, isSubmit;

@@ -486,4 +486,6 @@ return _regenerator["default"].wrap(function (_context3) {

isSubmit = false;
if (!(updateFormDataArguments && updateFormDataArguments[0] && updateFormDataArguments[0].length === 0)) {
_context3.next = 10;
_context3.next = 11;
break;

@@ -494,4 +496,5 @@ }

updateFormData(true, true, function (updatedFormData) {
if (typeof onSubmit === 'function') {
if (typeof onSubmit === 'function' && !isSubmit) {
onSubmit(isError, (0, _NbFormState.getKeyValue)(updatedFormData), updatedFormData);
isSubmit = true;
}

@@ -501,3 +504,3 @@ });

case 10:
case 11:
updateFormData.apply(void 0, (0, _toConsumableArray2["default"])(updateFormDataArguments).concat([function (updatedFormData) {

@@ -509,3 +512,3 @@ if (typeof onSubmit === 'function') {

case 11:
case 12:
case "end":

@@ -512,0 +515,0 @@ return _context3.stop();

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-rater"),require("react-bootstrap"),require("react-intl-tel-input"),require("react-select"),require("react-autocomplete-places")):"function"==typeof define&&define.amd?define(["react","react-rater","react-bootstrap","react-intl-tel-input","react-select","react-autocomplete-places"],t):(e=e||self)["@wadehrarshpreet/nbform"]=t(e.React,e["React-rater"],e["React-bootstrap"],e["React-intl-tel-input"],e["React-select"],e["React-autocomplete-places"])}(this,(function(e,t,r,n,o,a){"use strict";var i="default"in e?e.default:e;t=t&&t.hasOwnProperty("default")?t.default:t,n=n&&n.hasOwnProperty("default")?n.default:n,o=o&&o.hasOwnProperty("default")?o.default:o;var l="default"in a?a.default:a,u=function(e,t,r,n,o,a,i,l){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,a,i,l],c=0;(u=new Error(t.replace(/%s/g,(function(){return s[c++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}},s=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var i=a[o];if(("_owner"!==i||!t.$$typeof)&&!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r},c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var f=p((function(e){function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}e.exports=t})),d=p((function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}e.exports=t})),h="Expected a function",v="__lodash_hash_undefined__",y=1/0,m="[object Function]",g="[object GeneratorFunction]",b="[object Symbol]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_=/^\w*$/,x=/^\./,C=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w=/\\(\\)?/g,S=/^\[object .+?Constructor\]$/,N="object"==typeof c&&c&&c.Object===Object&&c,I="object"==typeof self&&self&&self.Object===Object&&self,k=N||I||Function("return this")();var j,O=Array.prototype,P=Function.prototype,A=Object.prototype,F=k["__core-js_shared__"],T=(j=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"",L=P.toString,B=A.hasOwnProperty,R=A.toString,z=RegExp("^"+L.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=k.Symbol,$=O.splice,D=Q(k,"Map"),G=Q(Object,"create"),V=M?M.prototype:void 0,q=V?V.toString:void 0;function W(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function K(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function H(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Y(e,t){for(var r,n,o=e.length;o--;)if((r=e[o][0])===(n=t)||r!=r&&n!=n)return o;return-1}function U(e,t){for(var r,n=0,o=(t=function(e,t){if(re(e))return!1;var r=typeof e;if("number"==r||"symbol"==r||"boolean"==r||null==e||oe(e))return!0;return _.test(e)||!E.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:re(r=t)?r:X(r)).length;null!=e&&n<o;)e=e[ee(t[n++])];return n&&n==o?e:void 0}function Z(e){return!(!ne(e)||(t=e,T&&T in t))&&(function(e){var t=ne(e)?R.call(e):"";return t==m||t==g}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?z:S).test(function(e){if(null!=e){try{return L.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function J(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Q(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return Z(r)?r:void 0}W.prototype.clear=function(){this.__data__=G?G(null):{}},W.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},W.prototype.get=function(e){var t=this.__data__;if(G){var r=t[e];return r===v?void 0:r}return B.call(t,e)?t[e]:void 0},W.prototype.has=function(e){var t=this.__data__;return G?void 0!==t[e]:B.call(t,e)},W.prototype.set=function(e,t){return this.__data__[e]=G&&void 0===t?v:t,this},K.prototype.clear=function(){this.__data__=[]},K.prototype.delete=function(e){var t=this.__data__,r=Y(t,e);return!(r<0)&&(r==t.length-1?t.pop():$.call(t,r,1),!0)},K.prototype.get=function(e){var t=this.__data__,r=Y(t,e);return r<0?void 0:t[r][1]},K.prototype.has=function(e){return Y(this.__data__,e)>-1},K.prototype.set=function(e,t){var r=this.__data__,n=Y(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},H.prototype.clear=function(){this.__data__={hash:new W,map:new(D||K),string:new W}},H.prototype.delete=function(e){return J(this,e).delete(e)},H.prototype.get=function(e){return J(this,e).get(e)},H.prototype.has=function(e){return J(this,e).has(e)},H.prototype.set=function(e,t){return J(this,e).set(e,t),this};var X=te((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(oe(e))return q?q.call(e):"";var t=e+"";return"0"==t&&1/e==-y?"-0":t}(t);var r=[];return x.test(e)&&r.push(""),e.replace(C,(function(e,t,n,o){r.push(n?o.replace(w,"$1"):t||e)})),r}));function ee(e){if("string"==typeof e||oe(e))return e;var t=e+"";return"0"==t&&1/e==-y?"-0":t}function te(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(h);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i),i};return r.cache=new(te.Cache||H),r}te.Cache=H;var re=Array.isArray;function ne(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function oe(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&R.call(e)==b}var ae=function(e,t,r){var n=null==e?void 0:U(e,t);return void 0===n?r:n},ie=function(e){return i.createElement(t,e)},le=function(e){switch(e){case"place":case"places":return"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z";case"times":case"close":return"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z";default:return null}},ue=function(e){var t=e.color,r=e.height,n=e.width,o=e.type,a=void 0!==r?r:24,l=void 0!==n?n:24;return i.createElement("svg",d({style:{width:l+"px",height:a+"px"},viewBox:"0 0 "+a+" "+l},e),i.createElement("path",{fill:t||"#000000",d:le(o)}))};var se=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t},ce=function(e){function t(){return e.apply(this,arguments)||this}se(t,e);var n=t.prototype;return n.getButtonClassName=function(){var e="nb-toggle-button";return this.props.size&&("lg"===this.props.size?e+=" btn-lg":"sm"===this.props.size?e+=" btn-sm":"xs"===this.props.size&&(e+=" btn-xs")),e.trim()},n.render=function(){var e=this,t=this.props,n=t.hasError,o=t.errorMsg,a=t.type,l=t.defaultValue,u=t.toggleButtonData,s=t.errorStyle,c=t.errorClass,p=void 0===c?"":c,f=t.onChange,d=t.className,h=t.containerClass,v=t.name;return i.createElement("div",{className:"nb-toggle-button-container "+(n?"has-error":"")+" "+h},i.createElement(r.ToggleButtonGroup,{type:a,value:l,onChange:f,name:v,className:d},void 0!==u&&u.length>0&&u.map((function(t,n){return i.createElement(r.ToggleButton,{id:t.value,className:e.getButtonClassName(),value:t.value,name:t.name,key:n},t.label)}))),n?i.createElement("div",{className:"nbform-err-msg "+p,style:s},o):null)},t}(e.PureComponent);ce.defaultProps={className:"",type:"radio",toggleButtonData:"",defaultValue:null,onChange:function(){},size:null};var pe=function(e){function t(t){var r=e.call(this,t)||this;return r.state={},r}return se(t,e),t.prototype.render=function(){var e=this.props,t=e.errorMsg,r=e.children,n=e.hasError,o=e.className,a=e.errorClass,l=e.wrap,u=e.containerClass,s=void 0===u?"":u,c=e.id,p=void 0===c?"":c,f=e.errorStyle;return i.createElement("div",{className:"nb_inpgrp "+s,id:p},i.createElement("div",{className:"nb__inpgrp_elements "+o,style:{flexWrap:l?"wrap":"nowrap"}},r),n?i.createElement("div",{className:"nbform-err-msg "+a,style:f},t):null)},t}(e.PureComponent);pe.defaultProps={children:null,errorMsg:"",className:"",wrap:!1};var fe=function(e){function t(t){var r=e.call(this,t)||this;return r.state={},r}return se(t,e),t.prototype.render=function(){var e,t=this.props,r=t.onChange,n=t.checked,o=t.label,a=t.errorStyle,l=t.errorClass,u=t.size,s=t.containerClass,c=void 0===s?"":s,p=t.className,f=void 0===p?"":p,d=t.textClass,h=void 0===d?"":d,v=t.id,y=t.hasError,m=t.errorMsg,g=t.labelPosition,b=void 0===g?"right":g;return i.createElement(i.Fragment,null,i.createElement("label",{className:"nb-switch "+c+" "+f,id:v},i.createElement("input",{className:"nb-switch-checkbox",type:"checkbox",onChange:r,checked:n}),i.createElement("div",{className:u?"nb-switch-toggle "+u:"nb-switch-toggle"}),o?i.createElement("span",{style:(e={cssFloat:b},e["margin-"+("left"===b?"right":"left")]="5px",e),className:"nb-switch-label "+h+" "+(y?"error-msg":"")},o):null),y?i.createElement("div",{className:"nbform-err-msg "+l,style:a},m):null)},t}(i.PureComponent);fe.defaultProps={onChange:function(){},isChecked:null,label:null};var de=function(e){function t(t){var r=e.call(this,t)||this;return r.clearInput=function(){r.props.onChange({target:{value:""}}),r.inputEl.focus()},r.state={},r.inputEl=i.createRef(),r}se(t,e);var n=t.prototype;return n.swicthInputEl=function(e){var t=this,n=e.props;switch(n.type){case"text":case"email":case"tel":case"number":case"password":return i.createElement(r.FormControl,{style:n.inputStyle,type:n.type,value:n.value,className:"form-control "+n.inputClass,placeholder:n.placeholder,onChange:n.onChange,onBlur:n.onBlur,maxLength:n.maxLength,min:n.min,disabled:n.disabled,autoFocus:n.autoFocus,name:n.name,inputRef:function(e){t.inputEl=e,n.getRef&&"function"==typeof n.getRef&&n.getRef(e)},onKeyPress:function(e){n.onKeyPress?n.onKeyPress(e):"Enter"===e.key&&t.inputEl.blur()},onFocus:function(e){n.onFocus&&n.onFocus(e);try{var r=window.innerWidth<768;setTimeout((function(){if(r){var e=t.inputEl.getBoundingClientRect(),n=document.documentElement,o=document.documentElement.scrollTop;o||(o=window.scrollY,n=window),o+=e.top-10-60,n.scrollTo(0,o)}}),500)}catch(e){}},autoComplete:n.autoCompleteType||"off"});case"textarea":return i.createElement(r.FormControl,{inputRef:function(e){t.inputEl=e,n.getRef&&"function"==typeof n.getRef&&n.getRef(e)},className:"form-control "+n.inputClass,componentClass:n.type,value:n.value,placeholder:n.placeholder,onBlur:n.onBlur,onChange:n.onChange,name:n.name,maxLength:n.maxLength,disabled:n.disabled,rows:n.rows,autoComplete:n.autoCompleteType||"off",onFocus:function(e){n.onFocus&&n.onFocus(e);try{var r=window.innerWidth<768;setTimeout((function(){if(r){var e=t.inputEl.getBoundingClientRect(),n=document.documentElement,o=document.documentElement.scrollTop;o||(o=window.scrollY,n=window),o+=e.top-10-60,n.scrollTo(0,o)}}),500)}catch(e){}}});default:return""}},n.getWrapperClassName=function(){var e="form-group",t=this.props,r=t.containerClass,n=t.label,o=t.rightText,a=t.leftText,i=t.rightIcon,l=t.rightImage,u=t.autoClear,s=t.leftIcon,c=t.leftImage;return(s||c)&&(e+=" left-icon-form-group"),(i||l||u)&&(e+=" right-icon-form-group"),a&&(e+=" left-text-form-group"),o&&(e+=" right-text-form-group"),n||(e+=" no-label"),r?(r+" "+e).trim():e.trim()},n.render=function(){var e=this.props,t=e.errorMsg,n=e.hasError,o=e.leftIcon,a=e.leftImage,l=e.rightImage,u=e.autoClear,s=e.value,c=e.rightIcon,p=e.leftText,f=e.rightText,d=e.label,h=e.validationState,v=e.id,y=e.errorClass,m=e.errorStyle,g=e.size,b=e.required;return i.createElement(r.FormGroup,{controlId:v,bsSize:g,className:this.getWrapperClassName(),validationState:h},d?i.createElement(r.ControlLabel,null,d,b?i.createElement("sup",null,"*"):""):null,o?i.createElement("span",{className:"left-input-icon"},o):a?i.createElement("img",{alt:"left-input-img",className:"left-input-image",src:a}):p?i.createElement("span",{className:"left-input-text"},p):null,u||c?i.createElement("span",{className:"right-input-icon"},u?s?i.createElement(ue,{type:"close",onClick:this.clearInput,className:"input-clear"}):null:c):l?i.createElement("img",{alt:"right-input-img",className:"right-input-image",src:c}):f?i.createElement("span",{className:"right-input-text"},f):null,this.swicthInputEl(this),n?i.createElement("div",{className:"nbform-err-msg "+y,style:m},t):null)},t}(e.PureComponent);de.defaultProps={type:"text",placeholder:"",errorMsg:"",hasError:!1,leftIcon:null,rightIcon:null,leftText:null,rightText:null,value:"",label:"",disabled:!1,ref:"",validationState:null,id:"",size:"",autoComplete:"off",containerClass:"",inputClass:"",rows:2,onChange:function(){},onBlur:function(){},onFocus:function(){},autoClear:!1,required:!1,autoFocus:!1,name:""};var he=function(e){function t(t){var r=e.call(this,t)||this;return r.state={},r}return se(t,e),t.prototype.render=function(){var e=this.props,t=e.containerClass,r=void 0===t?"":t,o=e.inputClass,a=void 0===o?"":o,l=e.onSelectFlag,u=e.onPhoneNumberChange,s=e.defaultCountry,c=e.errorStyle,p=e.errorClass,f=e.value,h=e.placeholder,v=e.errorMsg,y=e.hasError,m=e.maxLength,g=e.size,b=e.disabled,E=e.id,_=e.telInputProps,x=e.rightIcon,C=void 0===x?null:x;return i.createElement("div",{className:"intl-custom "+r+" "+(y?"nb-error":"")},i.createElement(n,{css:["intl-tel-input","form-control "+("lg"===g?"input-lg":"")+" "+(y?"has-error":""),a],separateDialCode:!0,defaultCountry:s||"in",preferredCountries:["in","us","gb"],fieldId:E,telInputProps:d({type:"number",maxLength:m},_),autoComplete:"tel",onSelectFlag:l,onPhoneNumberChange:u,value:f,placeholder:h,disabled:b}),C?i.createElement("span",{className:"right-telinput-icon"},C):null,y?i.createElement("div",{className:"nbform-err-msg "+p,style:c},v):null)},t}(e.PureComponent);he.defaultProps={separateDialCode:!0,defaultCountry:"in",telInputProps:{},placeholder:"Enter Mobile Number",size:""};var ve=function(e){function t(){return e.apply(this,arguments)||this}return se(t,e),t.prototype.render=function(){var e=this.props,t=e.errorMsg,n=e.className,o=e.hasError,a=e.textClass,l=void 0===a?"":a,u=e.validationState,s=e.id,c=e.readOnly,p=e.disabled,f=e.text,d=void 0===f?"":f,h=e.errorStyle,v=e.errorClass,y=e.onChange,m=e.value,g=e.checked,b=e.inline,E=e.containerClass,_=void 0===E?"":E;return i.createElement(r.Checkbox,{id:s,inline:b,value:m,checked:g,disabled:p,readOnly:c,validationState:u,onChange:y,className:"nb-checkbox "+n+" "+_+" "+(o?"error":"")},i.createElement("span",{className:l,dangerouslySetInnerHTML:{__html:d}}),o?i.createElement("div",{className:"nbform-err-msg "+v,style:h},t):null)},t}(e.PureComponent);ve.defaultProps={inline:!1,checked:!1,readOnly:!1,hasError:!1,disabled:!1,errorMsg:"",onChange:function(){},validationState:null,id:"",value:null,containerClass:"",className:""};var ye=Array.isArray,me="object"==typeof c&&c&&c.Object===Object&&c,ge="object"==typeof self&&self&&self.Object===Object&&self,be=me||ge||Function("return this")(),Ee=be.Symbol,_e=Object.prototype,xe=_e.hasOwnProperty,Ce=_e.toString,we=Ee?Ee.toStringTag:void 0;var Se=function(e){var t=xe.call(e,we),r=e[we];try{e[we]=void 0;var n=!0}catch(e){}var o=Ce.call(e);return n&&(t?e[we]=r:delete e[we]),o},Ne=Object.prototype.toString;var Ie=function(e){return Ne.call(e)},ke="[object Null]",je="[object Undefined]",Oe=Ee?Ee.toStringTag:void 0;var Pe=function(e){return null==e?void 0===e?je:ke:Oe&&Oe in Object(e)?Se(e):Ie(e)};var Ae=function(e){return null!=e&&"object"==typeof e},Fe="[object Symbol]";var Te=function(e){return"symbol"==typeof e||Ae(e)&&Pe(e)==Fe},Le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;var Re=function(e,t){if(ye(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Te(e))||(Be.test(e)||!Le.test(e)||null!=t&&e in Object(t))};var ze=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Me="[object AsyncFunction]",$e="[object Function]",De="[object GeneratorFunction]",Ge="[object Proxy]";var Ve=function(e){if(!ze(e))return!1;var t=Pe(e);return t==$e||t==De||t==Me||t==Ge},qe=be["__core-js_shared__"],We=function(){var e=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var Ke=function(e){return!!We&&We in e},He=Function.prototype.toString;var Ye=function(e){if(null!=e){try{return He.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ue=/^\[object .+?Constructor\]$/,Ze=Function.prototype,Je=Object.prototype,Qe=Ze.toString,Xe=Je.hasOwnProperty,et=RegExp("^"+Qe.call(Xe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var tt=function(e){return!(!ze(e)||Ke(e))&&(Ve(e)?et:Ue).test(Ye(e))};var rt=function(e,t){return null==e?void 0:e[t]};var nt=function(e,t){var r=rt(e,t);return tt(r)?r:void 0},ot=nt(Object,"create");var at=function(){this.__data__=ot?ot(null):{},this.size=0};var it=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},lt="__lodash_hash_undefined__",ut=Object.prototype.hasOwnProperty;var st=function(e){var t=this.__data__;if(ot){var r=t[e];return r===lt?void 0:r}return ut.call(t,e)?t[e]:void 0},ct=Object.prototype.hasOwnProperty;var pt=function(e){var t=this.__data__;return ot?void 0!==t[e]:ct.call(t,e)},ft="__lodash_hash_undefined__";var dt=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ot&&void 0===t?ft:t,this};function ht(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ht.prototype.clear=at,ht.prototype.delete=it,ht.prototype.get=st,ht.prototype.has=pt,ht.prototype.set=dt;var vt=ht;var yt=function(){this.__data__=[],this.size=0};var mt=function(e,t){return e===t||e!=e&&t!=t};var gt=function(e,t){for(var r=e.length;r--;)if(mt(e[r][0],t))return r;return-1},bt=Array.prototype.splice;var Et=function(e){var t=this.__data__,r=gt(t,e);return!(r<0)&&(r==t.length-1?t.pop():bt.call(t,r,1),--this.size,!0)};var _t=function(e){var t=this.__data__,r=gt(t,e);return r<0?void 0:t[r][1]};var xt=function(e){return gt(this.__data__,e)>-1};var Ct=function(e,t){var r=this.__data__,n=gt(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function wt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}wt.prototype.clear=yt,wt.prototype.delete=Et,wt.prototype.get=_t,wt.prototype.has=xt,wt.prototype.set=Ct;var St=wt,Nt=nt(be,"Map");var It=function(){this.size=0,this.__data__={hash:new vt,map:new(Nt||St),string:new vt}};var kt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var jt=function(e,t){var r=e.__data__;return kt(t)?r["string"==typeof t?"string":"hash"]:r.map};var Ot=function(e){var t=jt(this,e).delete(e);return this.size-=t?1:0,t};var Pt=function(e){return jt(this,e).get(e)};var At=function(e){return jt(this,e).has(e)};var Ft=function(e,t){var r=jt(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Tt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Tt.prototype.clear=It,Tt.prototype.delete=Ot,Tt.prototype.get=Pt,Tt.prototype.has=At,Tt.prototype.set=Ft;var Lt=Tt,Bt="Expected a function";function Rt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Bt);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Rt.Cache||Lt),r}Rt.Cache=Lt;var zt=Rt,Mt=500;var $t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dt=/\\(\\)?/g,Gt=function(e){var t=zt(e,(function(e){return r.size===Mt&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace($t,(function(e,r,n,o){t.push(n?o.replace(Dt,"$1"):r||e)})),t}));var Vt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},qt=1/0,Wt=Ee?Ee.prototype:void 0,Kt=Wt?Wt.toString:void 0;var Ht=function e(t){if("string"==typeof t)return t;if(ye(t))return Vt(t,e)+"";if(Te(t))return Kt?Kt.call(t):"";var r=t+"";return"0"==r&&1/t==-qt?"-0":r};var Yt=function(e){return null==e?"":Ht(e)};var Ut=function(e,t){return ye(e)?e:Re(e,t)?[e]:Gt(Yt(e))},Zt=1/0;var Jt=function(e){if("string"==typeof e||Te(e))return e;var t=e+"";return"0"==t&&1/e==-Zt?"-0":t};var Qt=function(e,t){for(var r=0,n=(t=Ut(t,e)).length;null!=e&&r<n;)e=e[Jt(t[r++])];return r&&r==n?e:void 0};var Xt=function(e,t,r){var n=null==e?void 0:Qt(e,t);return void 0===n?r:n},er={control:function(e){return d({},e,{boxShadow:"none"})}},tr=function(e){function t(t){var r=e.call(this,t)||this;return r.state={loaded:!1},r}se(t,e);var n=t.prototype;return n.componentDidMount=function(){this.setState({loaded:!0})},n.getWrapperClassName=function(){var e=this.props,t=e.size,r=e.containerClass,n="nb-select";return"lg"===t&&(n+=" nb-select__lg"),"sm"===t&&(n+=" nb-select__sm"),"xs"===t&&(n+=" nb-select__xs"),r?(r+" "+n).trim():n.trim()},n.render=function(){var e=this.props,t=e.errorMsg,n=e.hasError,a=e.onChange,l=e.size,u=e.label,s=e.validationState,c=e.errorStyle,p=e.errorClass,f=e.id,d=e.options,h=e.selectedValue,v=e.isSearchableboolean,y=e.validationId,m=e.containerId,g=this.state.loaded,b=Xt(h,"value");return i.createElement(r.FormGroup,{controlId:y,className:this.getWrapperClassName(),validationState:s},u?i.createElement(r.ControlLabel,null,u):null,g?i.createElement(o,{onChange:a,id:m||f,options:d,blurInputOnSelect:!0,className:"nb-select-container",classNamePrefix:"nb-select",isFocused:!0,styles:er,placeholder:this.props.placeholder,isSearchable:v,isDisabled:this.props.disabled,value:h}):b&&i.createElement("div",{className:"nb-select-loader "+(l||"")},i.createElement("span",{className:"nb-select-loader__value"},b&&b.toLowerCase?b.toLowerCase():"")),n?i.createElement("div",{className:"nbform-err-msg "+p,style:c},t):null)},t}(e.PureComponent);tr.defaultProps={placeholder:"Select ...",errorMsg:"",hasError:!1,label:"",disabled:!1,validationState:null,id:"",size:void 0,containerClass:"",isSearchableboolean:!1,selectedValue:null,onChange:function(){}};var rr=function(e){function t(){return e.apply(this,arguments)||this}return se(t,e),t.prototype.render=function(){var e=this.props,t=e.id,n=e.readOnly,o=e.disabled,a=e.text,l=e.onChange,u=e.value,s=e.checked,c=e.name,p=e.inline,f=e.hasError,d=e.containerClass;return i.createElement(r.Radio,{id:t,inline:p,value:u,name:c,defaultChecked:s,disabled:o,readOnly:n,validationState:!p&&f?"error":null,onChange:l,className:"nb-radio "+d},a)},t}(e.PureComponent);function nr(e,t){if(void 0===t&&(t=!1),!e)return"0";if(t)return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");var r=!1;"-"===(e=e.toString()).charAt(0)&&(e=e.substr(1),r=!0);var n="";e.indexOf(".")>0&&(n=e.substring(e.indexOf("."),e.length));var o=(e=(e=Math.round(e)).toString()).substring(e.length-3),a=e.substring(0,e.length-3);""!==a&&(o=","+o);var i=a.replace(/\B(?=(\d{2})+(?!\d))/g,",")+o+n;return r?"-"+i:""+i}rr.defaultProps={checked:!1,readOnly:!1,disabled:!1,inline:!1,onChange:function(){},validationState:null,id:"",name:"",value:null,containerClass:""};var or=function(e){return Boolean("object"===f(e)&&null!==e)};var ar=function(e){function t(t){var r=e.call(this,t)||this;r.handleChange=function(e){r.setState({address:e},(function(){r.props.onSelect(r.state.address)})),r.props.onInputChange&&r.props.onInputChange(e)},r.handleSelect=function(e,t){try{r.inputRef.blur()}catch(e){console.log("unable to remove focus",e)}a.geocodeByPlaceId(t,"/api/v1/localities/place_detail/"+t+"/_search").then((function(t){r.setState({placeObj:t[0]},(function(){null!=r.props.currentBound?!function(e,t){void 0===t&&(t={});var r=t;return!(null==r||void 0===r.geometry||null===r.geometry||!e.contains(r.geometry.location))}(r.props.currentBound,t[0])?(r.setState({address:""}),r.props.showAlertMsg(!0,"Please select another locality in "+r.props.city.toLowerCase())):(r.setState({address:e}),a.getLatLng(t[0]).then((function(n){r.props.showAlertMsg(!1,""),r.props.onSelect(t,n,e)}))):(r.setState({address:e}),a.getLatLng(t[0]).then((function(n){r.props.onSelect(t,n,e)})))}))})).catch((function(e){return console.error("Error",e)}))},r.componentDidMount=function(){r.setState({address:r.props.prfillValue?r.props.prfillValue:""})},r.getClassName=function(){var e="",t=r.props,n=t.size,o=t.className,a=void 0===o?"":o,i=t.containerClass;return n&&(e+="nb-google-autocomplete-"+n)," "+a+" "+e+" "+(void 0===i?"":i)},r.render=function(){var e=r.props,t=e.city,n=e.page,o=e.debounce,a=r.state,u=a.address,s=a.top,c="/api/v1/localities/autocomplete/_search?hint="+u+"&city="+t.toLowerCase()+"&page="+n;return i.createElement(l,{value:r.state.address,onChange:r.handleChange,onSelect:r.handleSelect,onBlur:r.handleBlur,debounce:o,city:t,getSuggestionUrl:c,page:n,searchOptions:r.props.searchOptions,shouldFetchSuggestions:r.state.address.length>1},(function(e){var t=e.getInputProps,n=e.suggestions,o=e.getSuggestionItemProps,a=s,l=n.length,u=40*l+20;if(l&&r.inputRef&&r.inputRef.getBoundingClientRect&&"object"===("undefined"==typeof window?"undefined":f(window))){var c=r.inputRef.getBoundingClientRect().top;window.innerHeight-c-50<u&&(a=-1*u)}var p=[].concat(n).reverse();return i.createElement("div",{className:"nb-google-autocomplete"+r.getClassName()},i.createElement(de,d({},t(d({},r.props,{getRef:function(e){r.inputRef=e}})),{getRef:function(e){r.inputRef=e}})),n.length>0&&i.createElement("div",{className:"autocomplete-dropdown-container",style:{top:a+"px"}},(a<0?p:n).map((function(e,t){return i.createElement("div",d({key:e.id||t},o(e,{className:"suggestion-item"})),i.createElement("span",null,i.createElement(ue,{type:"place",className:"place-icon"})," ",e.description))}))))}))};var n=t.size,o=75;return"md"!==n&&n||(o=65),"sm"===n&&(o=55),t.label||(o-=25),r.state={address:"",placeObj:[],top:o},r.inputRef=i.createRef(),r}return se(t,e),t.prototype.UNSAFE__componentWillReceiveProps=function(e){""!==this.state.address&&e.clearAutocompleteValue&&this.setState({address:""})},t}(e.Component);ar.defaultProps={size:void 0,id:"",containerClass:"",hasError:!1,leftIcon:null,rightIcon:null,leftText:null,rightText:null,label:"",disabled:!1,searchOptions:null,currentBound:null,page:"default",city:"",debounce:500,rightImage:null,leftImage:null,autoClear:!1};var ir=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=!1),u("object"===f(e),"INIT_STATE must be object");var n=Object.keys(e),o={},a={};return r&&(a.parent=r),t.forEach((function(t,r){var i=t.id,l=t.type,u=t.defaultDialCode,s=void 0===u?"91":u,c=t.defaultCountry,p=void 0===c?"in":c,f="";if(-1!==n.indexOf(i)&&(f=e[i]),"tel"===l)o[i]=d({value:f},a),o[i+"_dialCode"]=d({value:s},a),o[i+"_iso2"]=d({value:p},a);else{if("inputGroup"===l)return void(o=d({},o,{},ir(e,t.input,i||"group-"+r)));o[i]=d({value:f},a)}Object.keys(t).forEach((function(e){var r=t[e];if("string"==typeof r&&r.match(/^\$(.*)\$$/)&&r.match(/^\$(.*)\$$/).length>1){var n,l=r.match(/^\$(.*)\$$/)[1];o[i]||(o[i]=d({value:""},a)),o[l]||(o[l]=d({value:""},a)),o[l]._dependencies||(o[l]._dependencies={}),o[l]._dependencies[i]||(o[l]._dependencies[i]=[]),o[i].dependency=((n={})[e]=o[l].value||"",n),o[l]._dependencies[i].push(e)}}))})),o},lr=function(e){u("object"===f(e),"Invalid Data: make sure pass valid formData generated by NbForm");var t=Object.keys(e),r={};return t.forEach((function(t){u(Object.prototype.hasOwnProperty.call(e[t],"value"),"Invalid Data: make sure pass valid formData generated by NbForm"),r[t]=e[t].value||null})),r},ur={display:"flex",justifyContent:"flex-start"},sr=function(e){var t=e.inputId,r=e.idPrefix,n=e.userInput;try{var o=document.getElementById(t+"-container");if(n.nextFocusId)document.getElementById((r?r+"-":"")+n.nextFocusId+"-nbInput").focus();else if(o.nextElementSibling&&o.nextElementSibling.id){var a=o.nextElementSibling.id;if(a.match(new RegExp(r+"-(.*)-nbInput-container"))){var i=a.replace("-container","");document.getElementById(i).focus()}}}catch(e){}},cr=function(e,t){var r=t.inputId,n=t.userInput;if("Enter"===e.key)try{var o=document.getElementById(r);""!==o.value&&(o.blur(),sr(t))}catch(e){console.log("seems not found")}n.onKeyPress&&"function"==typeof n.onKeyPress&&n.onKeyPress(e)};function pr(e,t,r,n){void 0===n&&(n={});var o=n,a=o.idPrefix,l=o.formData,s=o.nbGAEventCategory,c=o.nbGaEvent,p=o.index,h=o.customProps,v=o.extraProps,y=o.defaultStyle,m=void 0===y?{}:y,g=o.lastFormData,b=e.id,E=e.uiLabel,_=e.customLabel,x=e.size,C=void 0===x?"":x,w=e.labelClass,S=e.inlineLabel,N=void 0!==S&&S,I=e.autoCompleteType,k=e.style,j=void 0===k?{}:k,O=e.errorClassName,P=void 0===O?"":O,A=e.onError,F=void 0===A?{}:A,T=t.value,L=t.isError,B=void 0!==L&&L,R=t.errorMsg,z=void 0===R?ae(e.errorMsg,"default"):R,M=t.dependency,$=void 0===M?{}:M,D=t.__errorType,G=void 0===D?"default":D,V=T||"",q=[],W=(a?a+"-":"")+b+"-nbInput",K=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={});var n=r.isError,o=void 0!==n&&n,a={},i={};return or(e.label)&&(i=e.label),or(e.error)&&(a=e.error),or(t.label)&&(i=t.label),or(t.error)&&(a=t.error),o&&or(e.onError)&&(or(e.onError.label)&&(i=e.onError.label),or(e.onError.error)&&(a=e.onError.error)),o&&or(t.onError)&&(or(t.onError.label)&&(i=t.onError.label),or(t.onError.error)&&(a=t.onError.error)),{labelStyle:i,errorStyle:a}}(m,j,{isError:B}),H=K.errorStyle,Y=K.labelStyle,U={};B&&or(F)&&(or(F.any)&&(U=F.any),or(F[G])&&(U=d({},U,{},F[G])));var Z=E;(Z||"function"==typeof _)&&("function"==typeof _&&(Z=_(lr(l),v,lr(g))),q.push(i.createElement("label",{key:b+"InputLabel",htmlFor:W,className:w,style:d({marginRight:"5px",lineHeight:"25px",fontWeight:"600"},Y)},Z)));var J=!1;if("undefined"!=typeof window&&window.isHybridView&&(J=!0),"function"==typeof e.customDisabled&&(e.disabled=Boolean(e.customDisabled(V,lr(l),v,lr(g)))),"function"==typeof e.customVisible&&!1===Boolean(e.customVisible(lr(l),v,lr(g))))return null;if("function"==typeof e.customOptions){var Q=e.customOptions(lr(l),lr(g));"object"===f(Q)&&Array.isArray(Q)&&(e.options=Q)}if("customInput"===e.type&&"function"==typeof e.render&&q.push(i.createElement(i.Fragment,null,i.createElement("div",{id:W},e.render(V,(function(e){r(b,e)}),d({},h,{},U,{},$,{hasError:B,errorStyle:H,errorClass:P,errorMsg:z}))),B&&!e.disableDefaultError&&i.createElement("div",{className:"nbform-err-msg "+P,style:H},z))),"inputGroup"===e.type&&q.push(i.createElement(pe,d({},e,h,U,$,{hasError:B,errorStyle:H,errorClass:P,errorMsg:z,id:W,key:b+"Input"}),(e.input||[]).map((function(e,t){"inputGroup"===e.type&&!e.id&&(e.id="sub-group-"+t);var n=e.id;return u(Boolean(n),"Invalid input id for data at input group "+p+" at sub index "+t),pr(e,l[n]||"",r,{idPrefix:n,formData:l,nbGaEvent:c,groupInputIndex:t})})))),"switch"===e.type&&q.push(i.createElement(fe,d({},h,U,$,{key:b+"Input",id:W,errorStyle:H,errorClass:P,checked:Boolean(V),label:e.text,labelPosition:e.textPosition||"right",className:e.containerClass||e.className,textClass:e.textClass||"",hasError:B,errorMsg:z,onChange:function(e){var t=!0===ae(e,"target.checked");r(b,t)}}))),"toggleButton"===e.type&&q.push(i.createElement(ce,d({id:W,key:b+"Input",size:C,hasError:B,errorStyle:H,errorClass:P,errorMsg:z,type:e.subType||"radio",onChange:function(t){e.options.forEach((function(e){e.value===t&&e.nbGAEvent&&"function"==typeof c&&c(s,e.nbGAEvent)})),r(b,t)},defaultValue:V,toggleButtonData:e.options,name:b+"ToggleButton"},h,U,$))),"input"===e.type){var X=e.subType;J&&-1!==["int","float"].indexOf(ae(e,"validation.dataType"))&&(X="number");var ee="number"===X&&e.currencyFormatter;q.push(i.createElement(de,d({key:b+"Input"},e,h,U,$,{size:C,label:"",value:ee&&"number"==typeof V?nr(V,e.currencyFormatterInternational||!1):V,type:"number"===X?"text":X,hasError:B,errorStyle:H,errorClass:P,name:I||b,errorMsg:z,validationState:B?"error":null,id:W,onKeyPress:function(t){cr(t,{inputId:W,userInput:e,idPrefix:a})},onChange:function(e){var t=ae(e,"target.value");"number"===X&&void 0!==t&&(ee&&(t=parseFloat(t.toString().replace(/,/g,""))),t&&"."===t[t.length-1]?t.match(/(\.)/g).length>1&&(t=t.toString().slice(0,t.length-1)):t=isNaN(parseFloat(t))?t.toString().slice(0,t.length-1):parseFloat(t)),r(b,t)}})))}return"select"===e.type&&q.push(i.createElement(tr,d({key:b+"SelectInput"},e,h,U,$,{selectedValue:V,hasError:B,errorStyle:H,errorClass:P,validationState:B?"error":null,errorMsg:z,id:W,size:C,onChange:function(e){r(b,e)},isSearchableboolean:!!e.isSearchable&&ae(window,"innerWidth")>768}))),"tel"===e.type&&q.push(i.createElement("div",{key:b+"Input",className:"form-group"},i.createElement(he,d({},e,h,U,$,{errorStyle:H,errorClass:P,onSelectFlag:function(e,t){var n=t.dialCode,o=t.iso2;r([b+"_dialCode",b+"_iso2"],[n,o])},value:V,size:C,onPhoneNumberChange:function(t,n){if("boolean"==typeof e.onlyIntInput&&e.onlyIntInput&&"string"==typeof n&&n.length>0){var o=parseInt(n);if(isNaN(o)||o.toString().length<n.length)return}r(b,n)},hasError:B,errorMsg:z,validationState:B?"error":null,id:W,telInputProps:{onKeyPress:function(t){cr(t,{inputId:W,userInput:e,idPrefix:a})}},defaultCountry:ae(l,[b+"_iso2","value"])||"in",maxLength:"91"===ae(l,[b+"_dialCode","value"])?10:15})))),"checkbox"===e.type&&q.push(i.createElement(ve,d({key:b+"Input",id:W},h,e,U,$,{errorStyle:H,errorClass:P,value:Boolean(V),checked:Boolean(V),text:e.checkboxText,className:e.containerClass||e.className,textClass:e.textClass||"",hasError:B,errorMsg:z,onChange:function(e){var t=ae(e,"target.checked");r(b,t)}}))),"radio"===e.type&&e.options&&e.options.length>0&&q.push(i.createElement("div",{key:b+"Input",id:W,style:{marginBottom:"15px"}},e.options.map((function(t){var n=t.label,o=t.value;return i.createElement(rr,d({name:W,onChange:function(e){var t=e.target.value;r(b,t)}},h,U,$,{text:n,disabled:Boolean(e.disabled),value:o,checked:V===o,hasError:B,key:W+"-"+t.value,id:W+"-"+t.value,inline:void 0===e.inline||e.inline}))})),B&&i.createElement("div",{className:"nbform-err-msg "+P,style:H},z))),"rating"===e.type&&q.push(i.createElement("div",{key:b+"Input",className:e.containerClass||""},i.createElement(ie,d({id:W},h,U,$,{className:"react-rater "+(e.className||""),total:e.max||5,rating:parseInt(V)||0,onRate:function(t){var n=t.rating;e.nbGAEvent&&c(s,e.nbGAEvent),r(b,n)}})),B&&i.createElement("div",{className:"nbform-err-msg "+P,style:H},z))),"location-autocomplete"===e.type&&q.push(i.createElement("div",{key:b+"Input",className:"form-group"},i.createElement(ar,d({},e,h,U,$,{onSelect:function(t,n,o){"object"===f(t)&&Array.isArray(t)&&t.length>0?(r(b,{result:t,latLng:n,selectedAddress:o}),sr({inputId:W,idPrefix:a,userInput:e})):""===t&&r(b,{result:[],latLng:{},selectedAddress:""})},key:W+"Input",id:W,type:"text",hasError:B,errorMsg:z,validationState:B?"error":null,leftIcon:i.createElement(ue,{type:"place"}),onKeyPress:function(t){cr(t,{inputId:W,userInput:e,idPrefix:a})}})))),0===q.length?(console.info("Invalid Input. NbForm-"+b),null):i.createElement("div",{key:W+"-container",className:e.wrapperClass||"",id:W+"-container",style:N?ur:{}},q)}var fr=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(t=e.call.apply(e,[this].concat(o))||this).getButton=function(){var e=t.props,n=e.className,o=e.containerClass,a=e.btnStyle,l=e.size,u=e.disabled,s=e.type,c=e.block,p=e.text,f=e.onClick,d=e.children,h=e.id;return i.createElement(r.Button,{id:h,className:n+" "+o,onClick:f,bsStyle:a,bsSize:l,disabled:u,type:s,block:c},d||p||"")},t}return se(t,e),t.prototype.render=function(){var e=this.props.tooltip;return e?i.createElement(r.OverlayTrigger,{placement:"bottom",overlay:i.createElement(r.Tooltip,{id:"button-tooltip-"+(new Date).getTime()},e)},this.getButton()):this.getButton()},t}(e.PureComponent);fr.defaultProps={className:"",btnStyle:"default",size:"",disabled:!1,onClick:function(){},type:"button",block:!1,tooltip:!1,id:""};var dr=p((function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),i=new I(n||[]);return a._invoke=function(e,t,r){var n=c;return function(o,a){if(n===f)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw a;return j()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var l=w(i,r);if(l){if(l===h)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=s(e,t,r);if("normal"===u.type){if(n=r.done?d:p,u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(e,r,i),a}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c="suspendedStart",p="suspendedYield",f="executing",d="completed",h={};function v(){}function y(){}function m(){}var g={};g[a]=function(){return this};var b=Object.getPrototypeOf,E=b&&b(b(k([])));E&&E!==r&&n.call(E,a)&&(g=E);var _=m.prototype=v.prototype=Object.create(g);function x(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function C(e){var t;this._invoke=function(r,o){function a(){return new Promise((function(t,a){!function t(r,o,a,i){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then((function(e){t("next",e,a,i)}),(function(e){t("throw",e,a,i)})):Promise.resolve(c).then((function(e){u.value=e,a(u)}),(function(e){return t("throw",e,a,i)}))}i(l.arg)}(r,o,t,a)}))}return t=t?t.then(a,a):a()}}function w(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=s(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}return{next:j}}function j(){return{value:t,done:!0}}return y.prototype=_.constructor=m,m.constructor=y,m[l]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,l in e||(e[l]="GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},x(C.prototype),C.prototype[i]=function(){return this},e.AsyncIterator=C,e.async=function(t,r,n,o){var a=new C(u(t,r,n,o));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(_),_[l]="Generator",_[a]=function(){return this},_.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=k,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return l.type="throw",l.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),N(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));function hr(e,t,r,n,o,a,i){try{var l=e[a](i),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}var vr=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){hr(a,n,o,i,l,"next",e)}function l(e){hr(a,n,o,i,l,"throw",e)}i(void 0)}))}};var yr=function(){var e=vr(dr.mark((function e(t,r,n,o){var a,i,l,u,s,c,p,d,h,v,y,m,g,b,E,_,x,C,w,S,N,I,k,j,O,P,A;return dr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.type,i=t.id,l=t.subType,u=void 0===l?"":l,void 0===n&&(n={}),s=!1,c=[],p=ae(o,"formData")||{},d=ae(o,"extraProps")||{},!n){e.next=22;break}if(v=(h=n).minlength,y=h.required,m=h.min,g=h.max,b=h.dataType,E=void 0===b?"":b,_=h.value,"function"!=typeof(x=h.customValidation)){e.next=15;break}if(C=x(r,lr(p),d),"object"!==f(C)||"function"!=typeof C.then){e.next=14;break}return e.next=13,C;case 13:C=e.sent;case 14:"boolean"==typeof C?C&&(s=C,c.push("default")):"object"===f(C)&&Array.isArray(C)?(S=(w=C)[0],N=w[1],I=void 0===N?"default":N,S&&(s=S,c.push(I))):null!==C&&"object"===f(C)?"boolean"==typeof(k=C).isError&&(j=k.isError,O=k.type,j&&(s=j,c.push(O))):console.warn("Skipping NbForm-CustomValidation Invalid Return Data check Docs.");case 15:void 0!==_&&_!==r&&(s=!0,c.push("value")),(null==r||"string"==typeof r&&0===r.length)&&y&&(s=!0,c.push("required")),void 0!==v&&r.toString().trim().length<v&&(s=!0,c.push("minlength")),P=r,"location-autocomplete"===a&&y&&(r.selectedAddress||(s=!0)),"input"!==a||"email"!==u&&"email"!==E||/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)||(s=!0,c.push("type","dataType")),"number"==typeof r&&("input"===a&&"number"===u||-1!==["int","float"].indexOf(E))&&(A=!1,isNaN(parseFloat(r))&&(s=!0,c.push("type","dataType"),A=!0),A||"int"!==E||parseInt(r)==r||(s=!0,c.push("dataType"),A=!0),A||"float"!==E||parseFloat(r)==r||(s=!0,c.push("dataType"),A=!0),A||(P=E&&"float"!==E?parseInt(r):parseFloat(r),void 0!==v&&P.toString().length<v&&(s=!0,c.push("minlength")),"tel"===a&&"91"===ae(p,[i+"_dialCode","value"])&&P.toString().length<10&&(s=!0,c.push("minlength")),isNaN(m)||r<m&&(s=!0,c.push("min")),isNaN(g)||r>g&&(s=!0,c.push("max"))));case 22:return e.abrupt("return",{error:c,status:s});case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),mr=function(){var e=vr(dr.mark((function e(t,r,n,o){var a,i,l,u,s,c,p,d,h,v,y,m,g,b,E,_,x,C,w,S,N,I,k,j,O,P;return dr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:void 0===n&&(n=[[],[],[],[],[]]),void 0===o&&(o={}),a=[].concat(n),i=!1,u=(l=o).isGroupInput,s=void 0!==u&&u,c=l.groupValidation,p=void 0===c?{}:c,d=l.extraProps,h=void 0===d?{}:d,v=0,y=0;case 7:if(!(y<t.length)){e.next=37;break}if(m=t[y],g=m.id,b=void 0===g?"":g,E=m.validation,_=m.errorMsg,x=void 0===_?{}:_,"inputGroup"!==m.type){e.next=23;break}if(C=b||"group-"+y,"object"!==f(m.input)||!Array.isArray(m.input)){e.next=22;break}return w={},e.next=16,mr(m.input,r,a,{isGroupInput:!0,groupValidation:E,extraProps:h});case 16:S=e.sent,a=S[0],i=S[1],(w=S[2].groupErrorLog)&&-1===w.type.indexOf("required")&&(v+=1),w.isError&&(a[0].push(C),a[1].push(""),a[2].push(w.isError),a[3].push(w.isError?x[ae(w,"type.0")]||x.default:""),a[4].push(ae(w,"type.0")||"default"));case 22:return e.abrupt("continue",34);case 23:return N=ae(r,[b,"value"])||"",e.next=26,yr(m,N,E,{formData:r,extraProps:h});case 26:I=e.sent,k=I.status,j=I.error,!0===k&&(i=!0),O=j||[],-1===j.indexOf("required")&&(v+=1),Array.isArray(j)&&j.length>0&&(O=j[0]),k&&(a[0].push(b),a[1].push(N),a[2].push(k),a[3].push(k?x[O]||x.default:""),a[4].push(O||"default"));case 34:y++,e.next=7;break;case 37:return P={isError:!1,type:[]},s&&(p&&!0===p.required&&(P={isError:v<=0,type:v<=0?["required"]:[]}),!0===p.requiredAll&&(P={isError:v===t.length,type:v!==t.length?["requiredAll"]:[]})),e.abrupt("return",[a,i,{groupErrorLog:P}]);case 40:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gr=function(){var e=vr(dr.mark((function e(t,r,n,o,a){var i,l,u;return dr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mr(t,r,[[],[],[],[],[]],{extraProps:a});case 2:if(i=e.sent,l=i[0],u=!1,"object"===f(l[2])&&Array.isArray(l[2])&&l[2].forEach((function(e){!0===e&&(u=!0)})),!l||!l[0]||0!==l[0].length){e.next=9;break}return n(!0,!0,(function(e){"function"==typeof o&&o(u,lr(e),e)})),e.abrupt("return");case 9:n.apply(void 0,l.concat([function(e){"function"==typeof o&&o(u,lr(e),e)}]));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),br=function(e){var t={};return e.forEach((function(e){var r=e.id,n=e.customProps;"function"==typeof n&&(t[r]=n)})),t};return function(t){var r=t.id,n=t.data,o=t.ref,a=t.formClass,l=void 0===a?"":a,c=t.onSubmit,p=t.onChange,h=t.submitButtonText,v=void 0===h?"Submit":h,y=t.buttonClassName,m=void 0===y?"":y,g=t.defaultValue,b=void 0===g?{}:g,E=t.nbGaEvent,_=t.customFooter,x=t.getSubmitAction,C=t.style,w=void 0===C?{}:C,S=t.getResetFormAction,N=t.extraProps,I=void 0===N?{}:N;u(null!=r&&r.length>1,"Please Provide valid unique ID"),u(Array.isArray(n)&&n.length>0,"data should be array of object");var k=function(t,r,n){void 0===t&&(t={}),void 0===n&&(n=[]);var o=e.useState(ir(t,n)),a=o[0],i=o[1],l=e.useCallback((function(){i(ir(t,n))}),[t,n]),u=e.useCallback((function(e){try{if(Array.isArray(e)&&e.length>0)e=e[0];var t=document.getElementById(r+"-"+e+"-nbInput");t&&setTimeout((function(){t.focus()}),400)}catch(e){}}),[r]),s=e.useCallback((function(e,t,r){var n=d({},e),o=n[t]._dependencies;"object"===f(o)&&Object.keys(o).length>0&&(Object.keys(o)||[]).forEach((function(e){Array.isArray(o[e])&&o[e].length>0&&o[e].forEach((function(t){var o;n[e]||(n[e]={value:""}),n[e].dependency||(n[e].dependency={}),n[e].dependency=d({},n[e].dependency,((o={})[t]=r,o))}))}));return n}),[]);return[a,e.useCallback((function(e,t,r,n,o,a){void 0===r&&(r=!1),void 0===n&&(n=""),i(!0!==e||!0!==t?function(i){var l=!1,c=d({},i),p=!1,h="default",v=!1;if("function"==typeof r?a=r:p=r,"function"==typeof o?a=o:h=o,"object"===f(o)&&Array.isArray(o)&&(v=!0),Array.isArray(e)&&(l=!0),Array.isArray(e)){var y=!1;l&&e.length===t.length?e.forEach((function(r,o){c[r]||(c[r]={value:""}),void 0!==(c=s(c,r,t[o]))[r].parent&&void 0!==c[c[r].parent]&&(c[c[r].parent].isError=!1);var a=p&&p[o];c[r]=d({},c[r],{value:t[o],isError:!!a&&p[o],__errorType:a?v?h[o]:h:"",errorMsg:a&&n&&n[o]?n[o]:""}),!y&&c[r].isError&&(u(e),y=!0)})):e.forEach((function(r,o){c[r]||(c[r]={value:""}),void 0!==(c=s(c,r,t))[r].parent&&void 0!==c[c[r].parent]&&(c[c[r].parent].isError=!1);var a=p&&p[o];c[r]=d({},c[r],{value:t,isError:a?p[o]:p,errorMsg:a&&n&&n[o]?n[o]:n,__errorType:a?v?h[o]:h:""}),c[r].isError&&u(e)}))}else c[e]||(c[e]={value:""}),void 0!==(c=s(c,e,t))[e].parent&&void 0!==c[c[e].parent]&&(c[c[e].parent].isError=!1),c[e]=d({},c[e],{value:t,isError:p,errorMsg:n,__errorType:v?h[0]:h}),p&&u(e);return a&&"function"==typeof a&&a(c),c}:function(e){var t=Object.keys(e).reduce((function(t,r){return t[r]=d({},e[r],{isError:!1,errorMsg:""}),t}),{});return"function"==typeof r&&r(t),t})}),[]),l]}(b,r,n),j=k[0],O=void 0===j?{}:j,P=k[1],A=k[2],F=i.useState(I),T=F[0],L=F[1],B=i.useRef(O),R=function(e,t,r,n){var o=i.useState((function(){var t={};return e.forEach((function(e){var r=e.id;t[r]={}})),t})),a=o[0],l=o[1],u=i.useState(br(e)),c=u[0],p=u[1],h=i.useCallback(function(){var e=vr(dr.mark((function e(t,r){var n;return dr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("object"!==f(t)||null===t){e.next=14;break}if(n=t,"function"!=typeof t.then){e.next=6;break}return e.next=5,t;case 5:n=e.sent;case 6:if("boolean"!=typeof n||n){e.next=8;break}return e.abrupt("return");case 8:if("object"===f(n)&&null!==n){e.next=11;break}return l((function(e){var t;return d({},e,((t={})[r]={},t))})),e.abrupt("return");case 11:l((function(e){var t;return d({},e,((t={})[r]=n,t))})),e.next=19;break;case 14:if("boolean"!=typeof t||t){e.next=16;break}return e.abrupt("return");case 16:if(!("object"===f(a[r])&&Object.keys(a[r]).length<=0)){e.next=18;break}return e.abrupt("return");case 18:l((function(e){var t;return d({},e,((t={})[r]={},t))}));case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),[a]);return i.useEffect((function(){s(lr(n.current||{}),lr(t))||Object.keys(c).forEach((function(e){if(c[e]){var o=c[e];h(o(t[e].value,lr(t),{extraProps:r,lastFormData:lr(n.current||{})}),e)}}))}),[t,r]),i.useEffect((function(){p(br(e))}),[e]),a}(n,O,T,B);e.useEffect((function(){if("function"==typeof p){var e=function e(t,r){void 0===t&&(t={}),void 0===r&&(r={});var n={};return null===t?n:(Object.keys(t).forEach((function(o){if("object"===f(r)&&null!==r&&(!Object.prototype.hasOwnProperty.call(r,o)||t[o]!==r[o])){if("object"===f(r[o])&&null!==r[o]&&Object.keys(r[o]).length>0){var a=e(t[o],r[o]),i=e(r[o],t[o]);if(0===Object.keys(a).length&&0===Object.keys(i).length)return}n[o]=t[o]}})),n)}(O,B.current);p(lr(O),P,e),B.current=O}}),[O]),e.useEffect((function(){s(T,I)||L(I)}),[I]);var z=i.useCallback((function(){gr(n,O,P,c,I)}),[n,O,P,c,I]);return e.useEffect((function(){n.forEach((function(e){var t=e.type,r=e.id,n=e.dialCode,o=void 0===n?"91":n,a=e.iso2;"tel"===t&&P([r+"_dialCode",r+"_iso2"],[o,void 0===a?"in":a])})),"function"==typeof S&&S(A)}),[]),e.useEffect((function(){"function"==typeof x&&x(z)}),[z]),i.createElement("form",{id:r,className:"nbform-2ptp128 "+l,action:"#",method:"post",onSubmit:function(e){e.preventDefault(),e.stopPropagation(),z()},ref:function(e){"function"==typeof o&&o(e)},style:{textAlign:"left"}},n.map((function(e,t){"inputGroup"===e.type&&!e.id&&(e.id="group-"+t);var n=e.id;return u(Boolean(n),"Invalid input id for data input at index "+t),pr(e,O[n]||{},P,{idPrefix:r,formData:O,nbGaEvent:E,index:t,extraProps:I,defaultStyle:w,customProps:R[n]||{},lastFormData:B.current})})),void 0!==_?_:i.createElement(fr,{btnStyle:"primary",type:"submit",className:"form-control "+m},v))}}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-rater"),require("react-bootstrap"),require("react-intl-tel-input"),require("react-select"),require("react-autocomplete-places")):"function"==typeof define&&define.amd?define(["react","react-rater","react-bootstrap","react-intl-tel-input","react-select","react-autocomplete-places"],t):(e=e||self)["@wadehrarshpreet/nbform"]=t(e.React,e["React-rater"],e["React-bootstrap"],e["React-intl-tel-input"],e["React-select"],e["React-autocomplete-places"])}(this,(function(e,t,r,n,o,a){"use strict";var i="default"in e?e.default:e;t=t&&t.hasOwnProperty("default")?t.default:t,n=n&&n.hasOwnProperty("default")?n.default:n,o=o&&o.hasOwnProperty("default")?o.default:o;var l="default"in a?a.default:a,u=function(e,t,r,n,o,a,i,l){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,a,i,l],c=0;(u=new Error(t.replace(/%s/g,(function(){return s[c++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}},s=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var i=a[o];if(("_owner"!==i||!t.$$typeof)&&!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r},c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var f=p((function(e){function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}e.exports=t})),d=p((function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}e.exports=t})),h="Expected a function",v="__lodash_hash_undefined__",y=1/0,m="[object Function]",g="[object GeneratorFunction]",b="[object Symbol]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_=/^\w*$/,x=/^\./,C=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w=/\\(\\)?/g,S=/^\[object .+?Constructor\]$/,N="object"==typeof c&&c&&c.Object===Object&&c,I="object"==typeof self&&self&&self.Object===Object&&self,k=N||I||Function("return this")();var j,O=Array.prototype,P=Function.prototype,A=Object.prototype,F=k["__core-js_shared__"],T=(j=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"",L=P.toString,B=A.hasOwnProperty,R=A.toString,z=RegExp("^"+L.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=k.Symbol,$=O.splice,D=Q(k,"Map"),G=Q(Object,"create"),V=M?M.prototype:void 0,q=V?V.toString:void 0;function W(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function K(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function H(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Y(e,t){for(var r,n,o=e.length;o--;)if((r=e[o][0])===(n=t)||r!=r&&n!=n)return o;return-1}function U(e,t){for(var r,n=0,o=(t=function(e,t){if(re(e))return!1;var r=typeof e;if("number"==r||"symbol"==r||"boolean"==r||null==e||oe(e))return!0;return _.test(e)||!E.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:re(r=t)?r:X(r)).length;null!=e&&n<o;)e=e[ee(t[n++])];return n&&n==o?e:void 0}function Z(e){return!(!ne(e)||(t=e,T&&T in t))&&(function(e){var t=ne(e)?R.call(e):"";return t==m||t==g}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?z:S).test(function(e){if(null!=e){try{return L.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function J(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Q(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return Z(r)?r:void 0}W.prototype.clear=function(){this.__data__=G?G(null):{}},W.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},W.prototype.get=function(e){var t=this.__data__;if(G){var r=t[e];return r===v?void 0:r}return B.call(t,e)?t[e]:void 0},W.prototype.has=function(e){var t=this.__data__;return G?void 0!==t[e]:B.call(t,e)},W.prototype.set=function(e,t){return this.__data__[e]=G&&void 0===t?v:t,this},K.prototype.clear=function(){this.__data__=[]},K.prototype.delete=function(e){var t=this.__data__,r=Y(t,e);return!(r<0)&&(r==t.length-1?t.pop():$.call(t,r,1),!0)},K.prototype.get=function(e){var t=this.__data__,r=Y(t,e);return r<0?void 0:t[r][1]},K.prototype.has=function(e){return Y(this.__data__,e)>-1},K.prototype.set=function(e,t){var r=this.__data__,n=Y(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},H.prototype.clear=function(){this.__data__={hash:new W,map:new(D||K),string:new W}},H.prototype.delete=function(e){return J(this,e).delete(e)},H.prototype.get=function(e){return J(this,e).get(e)},H.prototype.has=function(e){return J(this,e).has(e)},H.prototype.set=function(e,t){return J(this,e).set(e,t),this};var X=te((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(oe(e))return q?q.call(e):"";var t=e+"";return"0"==t&&1/e==-y?"-0":t}(t);var r=[];return x.test(e)&&r.push(""),e.replace(C,(function(e,t,n,o){r.push(n?o.replace(w,"$1"):t||e)})),r}));function ee(e){if("string"==typeof e||oe(e))return e;var t=e+"";return"0"==t&&1/e==-y?"-0":t}function te(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(h);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i),i};return r.cache=new(te.Cache||H),r}te.Cache=H;var re=Array.isArray;function ne(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function oe(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&R.call(e)==b}var ae=function(e,t,r){var n=null==e?void 0:U(e,t);return void 0===n?r:n},ie=function(e){return i.createElement(t,e)},le=function(e){switch(e){case"place":case"places":return"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z";case"times":case"close":return"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z";default:return null}},ue=function(e){var t=e.color,r=e.height,n=e.width,o=e.type,a=void 0!==r?r:24,l=void 0!==n?n:24;return i.createElement("svg",d({style:{width:l+"px",height:a+"px"},viewBox:"0 0 "+a+" "+l},e),i.createElement("path",{fill:t||"#000000",d:le(o)}))};var se=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t},ce=function(e){function t(){return e.apply(this,arguments)||this}se(t,e);var n=t.prototype;return n.getButtonClassName=function(){var e="nb-toggle-button";return this.props.size&&("lg"===this.props.size?e+=" btn-lg":"sm"===this.props.size?e+=" btn-sm":"xs"===this.props.size&&(e+=" btn-xs")),e.trim()},n.render=function(){var e=this,t=this.props,n=t.hasError,o=t.errorMsg,a=t.type,l=t.defaultValue,u=t.toggleButtonData,s=t.errorStyle,c=t.errorClass,p=void 0===c?"":c,f=t.onChange,d=t.className,h=t.containerClass,v=t.name;return i.createElement("div",{className:"nb-toggle-button-container "+(n?"has-error":"")+" "+h},i.createElement(r.ToggleButtonGroup,{type:a,value:l,onChange:f,name:v,className:d},void 0!==u&&u.length>0&&u.map((function(t,n){return i.createElement(r.ToggleButton,{id:t.value,className:e.getButtonClassName(),value:t.value,name:t.name,key:n},t.label)}))),n?i.createElement("div",{className:"nbform-err-msg "+p,style:s},o):null)},t}(e.PureComponent);ce.defaultProps={className:"",type:"radio",toggleButtonData:"",defaultValue:null,onChange:function(){},size:null};var pe=function(e){function t(t){var r=e.call(this,t)||this;return r.state={},r}return se(t,e),t.prototype.render=function(){var e=this.props,t=e.errorMsg,r=e.children,n=e.hasError,o=e.className,a=e.errorClass,l=e.wrap,u=e.containerClass,s=void 0===u?"":u,c=e.id,p=void 0===c?"":c,f=e.errorStyle;return i.createElement("div",{className:"nb_inpgrp "+s,id:p},i.createElement("div",{className:"nb__inpgrp_elements "+o,style:{flexWrap:l?"wrap":"nowrap"}},r),n?i.createElement("div",{className:"nbform-err-msg "+a,style:f},t):null)},t}(e.PureComponent);pe.defaultProps={children:null,errorMsg:"",className:"",wrap:!1};var fe=function(e){function t(t){var r=e.call(this,t)||this;return r.state={},r}return se(t,e),t.prototype.render=function(){var e,t=this.props,r=t.onChange,n=t.checked,o=t.label,a=t.errorStyle,l=t.errorClass,u=t.size,s=t.containerClass,c=void 0===s?"":s,p=t.className,f=void 0===p?"":p,d=t.textClass,h=void 0===d?"":d,v=t.id,y=t.hasError,m=t.errorMsg,g=t.labelPosition,b=void 0===g?"right":g;return i.createElement(i.Fragment,null,i.createElement("label",{className:"nb-switch "+c+" "+f,id:v},i.createElement("input",{className:"nb-switch-checkbox",type:"checkbox",onChange:r,checked:n}),i.createElement("div",{className:u?"nb-switch-toggle "+u:"nb-switch-toggle"}),o?i.createElement("span",{style:(e={cssFloat:b},e["margin-"+("left"===b?"right":"left")]="5px",e),className:"nb-switch-label "+h+" "+(y?"error-msg":"")},o):null),y?i.createElement("div",{className:"nbform-err-msg "+l,style:a},m):null)},t}(i.PureComponent);fe.defaultProps={onChange:function(){},isChecked:null,label:null};var de=function(e){function t(t){var r=e.call(this,t)||this;return r.clearInput=function(){r.props.onChange({target:{value:""}}),r.inputEl.focus()},r.state={},r.inputEl=i.createRef(),r}se(t,e);var n=t.prototype;return n.swicthInputEl=function(e){var t=this,n=e.props;switch(n.type){case"text":case"email":case"tel":case"number":case"password":return i.createElement(r.FormControl,{style:n.inputStyle,type:n.type,value:n.value,className:"form-control "+n.inputClass,placeholder:n.placeholder,onChange:n.onChange,onBlur:n.onBlur,maxLength:n.maxLength,min:n.min,disabled:n.disabled,autoFocus:n.autoFocus,name:n.name,inputRef:function(e){t.inputEl=e,n.getRef&&"function"==typeof n.getRef&&n.getRef(e)},onKeyPress:function(e){n.onKeyPress?n.onKeyPress(e):"Enter"===e.key&&t.inputEl.blur()},onFocus:function(e){n.onFocus&&n.onFocus(e);try{var r=window.innerWidth<768;setTimeout((function(){if(r){var e=t.inputEl.getBoundingClientRect(),n=document.documentElement,o=document.documentElement.scrollTop;o||(o=window.scrollY,n=window),o+=e.top-10-60,n.scrollTo(0,o)}}),500)}catch(e){}},autoComplete:n.autoCompleteType||"off"});case"textarea":return i.createElement(r.FormControl,{inputRef:function(e){t.inputEl=e,n.getRef&&"function"==typeof n.getRef&&n.getRef(e)},className:"form-control "+n.inputClass,componentClass:n.type,value:n.value,placeholder:n.placeholder,onBlur:n.onBlur,onChange:n.onChange,name:n.name,maxLength:n.maxLength,disabled:n.disabled,rows:n.rows,autoComplete:n.autoCompleteType||"off",onFocus:function(e){n.onFocus&&n.onFocus(e);try{var r=window.innerWidth<768;setTimeout((function(){if(r){var e=t.inputEl.getBoundingClientRect(),n=document.documentElement,o=document.documentElement.scrollTop;o||(o=window.scrollY,n=window),o+=e.top-10-60,n.scrollTo(0,o)}}),500)}catch(e){}}});default:return""}},n.getWrapperClassName=function(){var e="form-group",t=this.props,r=t.containerClass,n=t.label,o=t.rightText,a=t.leftText,i=t.rightIcon,l=t.rightImage,u=t.autoClear,s=t.leftIcon,c=t.leftImage;return(s||c)&&(e+=" left-icon-form-group"),(i||l||u)&&(e+=" right-icon-form-group"),a&&(e+=" left-text-form-group"),o&&(e+=" right-text-form-group"),n||(e+=" no-label"),r?(r+" "+e).trim():e.trim()},n.render=function(){var e=this.props,t=e.errorMsg,n=e.hasError,o=e.leftIcon,a=e.leftImage,l=e.rightImage,u=e.autoClear,s=e.value,c=e.rightIcon,p=e.leftText,f=e.rightText,d=e.label,h=e.validationState,v=e.id,y=e.errorClass,m=e.errorStyle,g=e.size,b=e.required;return i.createElement(r.FormGroup,{controlId:v,bsSize:g,className:this.getWrapperClassName(),validationState:h},d?i.createElement(r.ControlLabel,null,d,b?i.createElement("sup",null,"*"):""):null,o?i.createElement("span",{className:"left-input-icon"},o):a?i.createElement("img",{alt:"left-input-img",className:"left-input-image",src:a}):p?i.createElement("span",{className:"left-input-text"},p):null,u||c?i.createElement("span",{className:"right-input-icon"},u?s?i.createElement(ue,{type:"close",onClick:this.clearInput,className:"input-clear"}):null:c):l?i.createElement("img",{alt:"right-input-img",className:"right-input-image",src:c}):f?i.createElement("span",{className:"right-input-text"},f):null,this.swicthInputEl(this),n?i.createElement("div",{className:"nbform-err-msg "+y,style:m},t):null)},t}(e.PureComponent);de.defaultProps={type:"text",placeholder:"",errorMsg:"",hasError:!1,leftIcon:null,rightIcon:null,leftText:null,rightText:null,value:"",label:"",disabled:!1,ref:"",validationState:null,id:"",size:"",autoComplete:"off",containerClass:"",inputClass:"",rows:2,onChange:function(){},onBlur:function(){},onFocus:function(){},autoClear:!1,required:!1,autoFocus:!1,name:""};var he=function(e){function t(t){var r=e.call(this,t)||this;return r.state={},r}return se(t,e),t.prototype.render=function(){var e=this.props,t=e.containerClass,r=void 0===t?"":t,o=e.inputClass,a=void 0===o?"":o,l=e.onSelectFlag,u=e.onPhoneNumberChange,s=e.defaultCountry,c=e.errorStyle,p=e.errorClass,f=e.value,h=e.placeholder,v=e.errorMsg,y=e.hasError,m=e.maxLength,g=e.size,b=e.disabled,E=e.id,_=e.telInputProps,x=e.rightIcon,C=void 0===x?null:x;return i.createElement("div",{className:"intl-custom "+r+" "+(y?"nb-error":"")},i.createElement(n,{css:["intl-tel-input","form-control "+("lg"===g?"input-lg":"")+" "+(y?"has-error":""),a],separateDialCode:!0,defaultCountry:s||"in",preferredCountries:["in","us","gb"],fieldId:E,telInputProps:d({type:"number",maxLength:m},_),autoComplete:"tel",onSelectFlag:l,onPhoneNumberChange:u,value:f,placeholder:h,disabled:b}),C?i.createElement("span",{className:"right-telinput-icon"},C):null,y?i.createElement("div",{className:"nbform-err-msg "+p,style:c},v):null)},t}(e.PureComponent);he.defaultProps={separateDialCode:!0,defaultCountry:"in",telInputProps:{},placeholder:"Enter Mobile Number",size:""};var ve=function(e){function t(){return e.apply(this,arguments)||this}return se(t,e),t.prototype.render=function(){var e=this.props,t=e.errorMsg,n=e.className,o=e.hasError,a=e.textClass,l=void 0===a?"":a,u=e.validationState,s=e.id,c=e.readOnly,p=e.disabled,f=e.text,d=void 0===f?"":f,h=e.errorStyle,v=e.errorClass,y=e.onChange,m=e.value,g=e.checked,b=e.inline,E=e.containerClass,_=void 0===E?"":E;return i.createElement(r.Checkbox,{id:s,inline:b,value:m,checked:g,disabled:p,readOnly:c,validationState:u,onChange:y,className:"nb-checkbox "+n+" "+_+" "+(o?"error":"")},i.createElement("span",{className:l,dangerouslySetInnerHTML:{__html:d}}),o?i.createElement("div",{className:"nbform-err-msg "+v,style:h},t):null)},t}(e.PureComponent);ve.defaultProps={inline:!1,checked:!1,readOnly:!1,hasError:!1,disabled:!1,errorMsg:"",onChange:function(){},validationState:null,id:"",value:null,containerClass:"",className:""};var ye=Array.isArray,me="object"==typeof c&&c&&c.Object===Object&&c,ge="object"==typeof self&&self&&self.Object===Object&&self,be=me||ge||Function("return this")(),Ee=be.Symbol,_e=Object.prototype,xe=_e.hasOwnProperty,Ce=_e.toString,we=Ee?Ee.toStringTag:void 0;var Se=function(e){var t=xe.call(e,we),r=e[we];try{e[we]=void 0;var n=!0}catch(e){}var o=Ce.call(e);return n&&(t?e[we]=r:delete e[we]),o},Ne=Object.prototype.toString;var Ie=function(e){return Ne.call(e)},ke="[object Null]",je="[object Undefined]",Oe=Ee?Ee.toStringTag:void 0;var Pe=function(e){return null==e?void 0===e?je:ke:Oe&&Oe in Object(e)?Se(e):Ie(e)};var Ae=function(e){return null!=e&&"object"==typeof e},Fe="[object Symbol]";var Te=function(e){return"symbol"==typeof e||Ae(e)&&Pe(e)==Fe},Le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;var Re=function(e,t){if(ye(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Te(e))||(Be.test(e)||!Le.test(e)||null!=t&&e in Object(t))};var ze=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Me="[object AsyncFunction]",$e="[object Function]",De="[object GeneratorFunction]",Ge="[object Proxy]";var Ve=function(e){if(!ze(e))return!1;var t=Pe(e);return t==$e||t==De||t==Me||t==Ge},qe=be["__core-js_shared__"],We=function(){var e=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var Ke=function(e){return!!We&&We in e},He=Function.prototype.toString;var Ye=function(e){if(null!=e){try{return He.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ue=/^\[object .+?Constructor\]$/,Ze=Function.prototype,Je=Object.prototype,Qe=Ze.toString,Xe=Je.hasOwnProperty,et=RegExp("^"+Qe.call(Xe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var tt=function(e){return!(!ze(e)||Ke(e))&&(Ve(e)?et:Ue).test(Ye(e))};var rt=function(e,t){return null==e?void 0:e[t]};var nt=function(e,t){var r=rt(e,t);return tt(r)?r:void 0},ot=nt(Object,"create");var at=function(){this.__data__=ot?ot(null):{},this.size=0};var it=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},lt="__lodash_hash_undefined__",ut=Object.prototype.hasOwnProperty;var st=function(e){var t=this.__data__;if(ot){var r=t[e];return r===lt?void 0:r}return ut.call(t,e)?t[e]:void 0},ct=Object.prototype.hasOwnProperty;var pt=function(e){var t=this.__data__;return ot?void 0!==t[e]:ct.call(t,e)},ft="__lodash_hash_undefined__";var dt=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ot&&void 0===t?ft:t,this};function ht(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ht.prototype.clear=at,ht.prototype.delete=it,ht.prototype.get=st,ht.prototype.has=pt,ht.prototype.set=dt;var vt=ht;var yt=function(){this.__data__=[],this.size=0};var mt=function(e,t){return e===t||e!=e&&t!=t};var gt=function(e,t){for(var r=e.length;r--;)if(mt(e[r][0],t))return r;return-1},bt=Array.prototype.splice;var Et=function(e){var t=this.__data__,r=gt(t,e);return!(r<0)&&(r==t.length-1?t.pop():bt.call(t,r,1),--this.size,!0)};var _t=function(e){var t=this.__data__,r=gt(t,e);return r<0?void 0:t[r][1]};var xt=function(e){return gt(this.__data__,e)>-1};var Ct=function(e,t){var r=this.__data__,n=gt(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function wt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}wt.prototype.clear=yt,wt.prototype.delete=Et,wt.prototype.get=_t,wt.prototype.has=xt,wt.prototype.set=Ct;var St=wt,Nt=nt(be,"Map");var It=function(){this.size=0,this.__data__={hash:new vt,map:new(Nt||St),string:new vt}};var kt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var jt=function(e,t){var r=e.__data__;return kt(t)?r["string"==typeof t?"string":"hash"]:r.map};var Ot=function(e){var t=jt(this,e).delete(e);return this.size-=t?1:0,t};var Pt=function(e){return jt(this,e).get(e)};var At=function(e){return jt(this,e).has(e)};var Ft=function(e,t){var r=jt(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Tt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Tt.prototype.clear=It,Tt.prototype.delete=Ot,Tt.prototype.get=Pt,Tt.prototype.has=At,Tt.prototype.set=Ft;var Lt=Tt,Bt="Expected a function";function Rt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Bt);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Rt.Cache||Lt),r}Rt.Cache=Lt;var zt=Rt,Mt=500;var $t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dt=/\\(\\)?/g,Gt=function(e){var t=zt(e,(function(e){return r.size===Mt&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace($t,(function(e,r,n,o){t.push(n?o.replace(Dt,"$1"):r||e)})),t}));var Vt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},qt=1/0,Wt=Ee?Ee.prototype:void 0,Kt=Wt?Wt.toString:void 0;var Ht=function e(t){if("string"==typeof t)return t;if(ye(t))return Vt(t,e)+"";if(Te(t))return Kt?Kt.call(t):"";var r=t+"";return"0"==r&&1/t==-qt?"-0":r};var Yt=function(e){return null==e?"":Ht(e)};var Ut=function(e,t){return ye(e)?e:Re(e,t)?[e]:Gt(Yt(e))},Zt=1/0;var Jt=function(e){if("string"==typeof e||Te(e))return e;var t=e+"";return"0"==t&&1/e==-Zt?"-0":t};var Qt=function(e,t){for(var r=0,n=(t=Ut(t,e)).length;null!=e&&r<n;)e=e[Jt(t[r++])];return r&&r==n?e:void 0};var Xt=function(e,t,r){var n=null==e?void 0:Qt(e,t);return void 0===n?r:n},er={control:function(e){return d({},e,{boxShadow:"none"})}},tr=function(e){function t(t){var r=e.call(this,t)||this;return r.state={loaded:!1},r}se(t,e);var n=t.prototype;return n.componentDidMount=function(){this.setState({loaded:!0})},n.getWrapperClassName=function(){var e=this.props,t=e.size,r=e.containerClass,n="nb-select";return"lg"===t&&(n+=" nb-select__lg"),"sm"===t&&(n+=" nb-select__sm"),"xs"===t&&(n+=" nb-select__xs"),r?(r+" "+n).trim():n.trim()},n.render=function(){var e=this.props,t=e.errorMsg,n=e.hasError,a=e.onChange,l=e.size,u=e.label,s=e.validationState,c=e.errorStyle,p=e.errorClass,f=e.id,d=e.options,h=e.selectedValue,v=e.isSearchableboolean,y=e.validationId,m=e.containerId,g=this.state.loaded,b=Xt(h,"value");return i.createElement(r.FormGroup,{controlId:y,className:this.getWrapperClassName(),validationState:s},u?i.createElement(r.ControlLabel,null,u):null,g?i.createElement(o,{onChange:a,id:m||f,options:d,blurInputOnSelect:!0,className:"nb-select-container",classNamePrefix:"nb-select",isFocused:!0,styles:er,placeholder:this.props.placeholder,isSearchable:v,isDisabled:this.props.disabled,value:h}):b&&i.createElement("div",{className:"nb-select-loader "+(l||"")},i.createElement("span",{className:"nb-select-loader__value"},b&&b.toLowerCase?b.toLowerCase():"")),n?i.createElement("div",{className:"nbform-err-msg "+p,style:c},t):null)},t}(e.PureComponent);tr.defaultProps={placeholder:"Select ...",errorMsg:"",hasError:!1,label:"",disabled:!1,validationState:null,id:"",size:void 0,containerClass:"",isSearchableboolean:!1,selectedValue:null,onChange:function(){}};var rr=function(e){function t(){return e.apply(this,arguments)||this}return se(t,e),t.prototype.render=function(){var e=this.props,t=e.id,n=e.readOnly,o=e.disabled,a=e.text,l=e.onChange,u=e.value,s=e.checked,c=e.name,p=e.inline,f=e.hasError,d=e.containerClass;return i.createElement(r.Radio,{id:t,inline:p,value:u,name:c,defaultChecked:s,disabled:o,readOnly:n,validationState:!p&&f?"error":null,onChange:l,className:"nb-radio "+d},a)},t}(e.PureComponent);function nr(e,t){if(void 0===t&&(t=!1),!e)return"0";if(t)return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");var r=!1;"-"===(e=e.toString()).charAt(0)&&(e=e.substr(1),r=!0);var n="";e.indexOf(".")>0&&(n=e.substring(e.indexOf("."),e.length));var o=(e=(e=Math.round(e)).toString()).substring(e.length-3),a=e.substring(0,e.length-3);""!==a&&(o=","+o);var i=a.replace(/\B(?=(\d{2})+(?!\d))/g,",")+o+n;return r?"-"+i:""+i}rr.defaultProps={checked:!1,readOnly:!1,disabled:!1,inline:!1,onChange:function(){},validationState:null,id:"",name:"",value:null,containerClass:""};var or=function(e){return Boolean("object"===f(e)&&null!==e)};var ar=function(e){function t(t){var r=e.call(this,t)||this;r.handleChange=function(e){r.setState({address:e},(function(){r.props.onSelect(r.state.address)})),r.props.onInputChange&&r.props.onInputChange(e)},r.handleSelect=function(e,t){try{r.inputRef.blur()}catch(e){console.log("unable to remove focus",e)}a.geocodeByPlaceId(t,"/api/v1/localities/place_detail/"+t+"/_search").then((function(t){r.setState({placeObj:t[0]},(function(){null!=r.props.currentBound?!function(e,t){void 0===t&&(t={});var r=t;return!(null==r||void 0===r.geometry||null===r.geometry||!e.contains(r.geometry.location))}(r.props.currentBound,t[0])?(r.setState({address:""}),r.props.showAlertMsg(!0,"Please select another locality in "+r.props.city.toLowerCase())):(r.setState({address:e}),a.getLatLng(t[0]).then((function(n){r.props.showAlertMsg(!1,""),r.props.onSelect(t,n,e)}))):(r.setState({address:e}),a.getLatLng(t[0]).then((function(n){r.props.onSelect(t,n,e)})))}))})).catch((function(e){return console.error("Error",e)}))},r.componentDidMount=function(){r.setState({address:r.props.prfillValue?r.props.prfillValue:""})},r.getClassName=function(){var e="",t=r.props,n=t.size,o=t.className,a=void 0===o?"":o,i=t.containerClass;return n&&(e+="nb-google-autocomplete-"+n)," "+a+" "+e+" "+(void 0===i?"":i)},r.render=function(){var e=r.props,t=e.city,n=e.page,o=e.debounce,a=r.state,u=a.address,s=a.top,c="/api/v1/localities/autocomplete/_search?hint="+u+"&city="+t.toLowerCase()+"&page="+n;return i.createElement(l,{value:r.state.address,onChange:r.handleChange,onSelect:r.handleSelect,onBlur:r.handleBlur,debounce:o,city:t,getSuggestionUrl:c,page:n,searchOptions:r.props.searchOptions,shouldFetchSuggestions:r.state.address.length>1},(function(e){var t=e.getInputProps,n=e.suggestions,o=e.getSuggestionItemProps,a=s,l=n.length,u=40*l+20;if(l&&r.inputRef&&r.inputRef.getBoundingClientRect&&"object"===("undefined"==typeof window?"undefined":f(window))){var c=r.inputRef.getBoundingClientRect().top;window.innerHeight-c-50<u&&(a=-1*u)}var p=[].concat(n).reverse();return i.createElement("div",{className:"nb-google-autocomplete"+r.getClassName()},i.createElement(de,d({},t(d({},r.props,{getRef:function(e){r.inputRef=e}})),{getRef:function(e){r.inputRef=e}})),n.length>0&&i.createElement("div",{className:"autocomplete-dropdown-container",style:{top:a+"px"}},(a<0?p:n).map((function(e,t){return i.createElement("div",d({key:e.id||t},o(e,{className:"suggestion-item"})),i.createElement("span",null,i.createElement(ue,{type:"place",className:"place-icon"})," ",e.description))}))))}))};var n=t.size,o=75;return"md"!==n&&n||(o=65),"sm"===n&&(o=55),t.label||(o-=25),r.state={address:"",placeObj:[],top:o},r.inputRef=i.createRef(),r}return se(t,e),t.prototype.UNSAFE__componentWillReceiveProps=function(e){""!==this.state.address&&e.clearAutocompleteValue&&this.setState({address:""})},t}(e.Component);ar.defaultProps={size:void 0,id:"",containerClass:"",hasError:!1,leftIcon:null,rightIcon:null,leftText:null,rightText:null,label:"",disabled:!1,searchOptions:null,currentBound:null,page:"default",city:"",debounce:500,rightImage:null,leftImage:null,autoClear:!1};var ir=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=!1),u("object"===f(e),"INIT_STATE must be object");var n=Object.keys(e),o={},a={};return r&&(a.parent=r),t.forEach((function(t,r){var i=t.id,l=t.type,u=t.defaultDialCode,s=void 0===u?"91":u,c=t.defaultCountry,p=void 0===c?"in":c,f="";if(-1!==n.indexOf(i)&&(f=e[i]),"tel"===l)o[i]=d({value:f},a),o[i+"_dialCode"]=d({value:s},a),o[i+"_iso2"]=d({value:p},a);else{if("inputGroup"===l)return void(o=d({},o,{},ir(e,t.input,i||"group-"+r)));o[i]=d({value:f},a)}Object.keys(t).forEach((function(e){var r=t[e];if("string"==typeof r&&r.match(/^\$(.*)\$$/)&&r.match(/^\$(.*)\$$/).length>1){var n,l=r.match(/^\$(.*)\$$/)[1];o[i]||(o[i]=d({value:""},a)),o[l]||(o[l]=d({value:""},a)),o[l]._dependencies||(o[l]._dependencies={}),o[l]._dependencies[i]||(o[l]._dependencies[i]=[]),o[i].dependency=((n={})[e]=o[l].value||"",n),o[l]._dependencies[i].push(e)}}))})),o},lr=function(e){u("object"===f(e),"Invalid Data: make sure pass valid formData generated by NbForm");var t=Object.keys(e),r={};return t.forEach((function(t){u(Object.prototype.hasOwnProperty.call(e[t],"value"),"Invalid Data: make sure pass valid formData generated by NbForm"),r[t]=e[t].value||null})),r},ur={display:"flex",justifyContent:"flex-start"},sr=function(e){var t=e.inputId,r=e.idPrefix,n=e.userInput;try{var o=document.getElementById(t+"-container");if(n.nextFocusId)document.getElementById((r?r+"-":"")+n.nextFocusId+"-nbInput").focus();else if(o.nextElementSibling&&o.nextElementSibling.id){var a=o.nextElementSibling.id;if(a.match(new RegExp(r+"-(.*)-nbInput-container"))){var i=a.replace("-container","");document.getElementById(i).focus()}}}catch(e){}},cr=function(e,t){var r=t.inputId,n=t.userInput;if("Enter"===e.key)try{var o=document.getElementById(r);""!==o.value&&(o.blur(),sr(t))}catch(e){console.log("seems not found")}n.onKeyPress&&"function"==typeof n.onKeyPress&&n.onKeyPress(e)};function pr(e,t,r,n){void 0===n&&(n={});var o=n,a=o.idPrefix,l=o.formData,s=o.nbGAEventCategory,c=o.nbGaEvent,p=o.index,h=o.customProps,v=o.extraProps,y=o.defaultStyle,m=void 0===y?{}:y,g=o.lastFormData,b=e.id,E=e.uiLabel,_=e.customLabel,x=e.size,C=void 0===x?"":x,w=e.labelClass,S=e.inlineLabel,N=void 0!==S&&S,I=e.autoCompleteType,k=e.style,j=void 0===k?{}:k,O=e.errorClassName,P=void 0===O?"":O,A=e.onError,F=void 0===A?{}:A,T=t.value,L=t.isError,B=void 0!==L&&L,R=t.errorMsg,z=void 0===R?ae(e.errorMsg,"default"):R,M=t.dependency,$=void 0===M?{}:M,D=t.__errorType,G=void 0===D?"default":D,V=T||"",q=[],W=(a?a+"-":"")+b+"-nbInput",K=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={});var n=r.isError,o=void 0!==n&&n,a={},i={};return or(e.label)&&(i=e.label),or(e.error)&&(a=e.error),or(t.label)&&(i=t.label),or(t.error)&&(a=t.error),o&&or(e.onError)&&(or(e.onError.label)&&(i=e.onError.label),or(e.onError.error)&&(a=e.onError.error)),o&&or(t.onError)&&(or(t.onError.label)&&(i=t.onError.label),or(t.onError.error)&&(a=t.onError.error)),{labelStyle:i,errorStyle:a}}(m,j,{isError:B}),H=K.errorStyle,Y=K.labelStyle,U={};B&&or(F)&&(or(F.any)&&(U=F.any),or(F[G])&&(U=d({},U,{},F[G])));var Z=E;(Z||"function"==typeof _)&&("function"==typeof _&&(Z=_(lr(l),v,lr(g))),q.push(i.createElement("label",{key:b+"InputLabel",htmlFor:W,className:w,style:d({marginRight:"5px",lineHeight:"25px",fontWeight:"600"},Y)},Z)));var J=!1;if("undefined"!=typeof window&&window.isHybridView&&(J=!0),"function"==typeof e.customDisabled&&(e.disabled=Boolean(e.customDisabled(V,lr(l),v,lr(g)))),"function"==typeof e.customVisible&&!1===Boolean(e.customVisible(lr(l),v,lr(g))))return null;if("function"==typeof e.customOptions){var Q=e.customOptions(lr(l),lr(g));"object"===f(Q)&&Array.isArray(Q)&&(e.options=Q)}if("customInput"===e.type&&"function"==typeof e.render&&q.push(i.createElement(i.Fragment,null,i.createElement("div",{id:W},e.render(V,(function(e){r(b,e)}),d({},h,{},U,{},$,{hasError:B,errorStyle:H,errorClass:P,errorMsg:z}))),B&&!e.disableDefaultError&&i.createElement("div",{className:"nbform-err-msg "+P,style:H},z))),"inputGroup"===e.type&&q.push(i.createElement(pe,d({},e,h,U,$,{hasError:B,errorStyle:H,errorClass:P,errorMsg:z,id:W,key:b+"Input"}),(e.input||[]).map((function(e,t){"inputGroup"===e.type&&!e.id&&(e.id="sub-group-"+t);var n=e.id;return u(Boolean(n),"Invalid input id for data at input group "+p+" at sub index "+t),pr(e,l[n]||"",r,{idPrefix:n,formData:l,nbGaEvent:c,groupInputIndex:t})})))),"switch"===e.type&&q.push(i.createElement(fe,d({},h,U,$,{key:b+"Input",id:W,errorStyle:H,errorClass:P,checked:Boolean(V),label:e.text,labelPosition:e.textPosition||"right",className:e.containerClass||e.className,textClass:e.textClass||"",hasError:B,errorMsg:z,onChange:function(e){var t=!0===ae(e,"target.checked");r(b,t)}}))),"toggleButton"===e.type&&q.push(i.createElement(ce,d({id:W,key:b+"Input",size:C,hasError:B,errorStyle:H,errorClass:P,errorMsg:z,type:e.subType||"radio",onChange:function(t){e.options.forEach((function(e){e.value===t&&e.nbGAEvent&&"function"==typeof c&&c(s,e.nbGAEvent)})),r(b,t)},defaultValue:V,toggleButtonData:e.options,name:b+"ToggleButton"},h,U,$))),"input"===e.type){var X=e.subType;J&&-1!==["int","float"].indexOf(ae(e,"validation.dataType"))&&(X="number");var ee="number"===X&&e.currencyFormatter;q.push(i.createElement(de,d({key:b+"Input"},e,h,U,$,{size:C,label:"",value:ee&&"number"==typeof V?nr(V,e.currencyFormatterInternational||!1):V,type:"number"===X?"text":X,hasError:B,errorStyle:H,errorClass:P,name:I||b,errorMsg:z,validationState:B?"error":null,id:W,onKeyPress:function(t){cr(t,{inputId:W,userInput:e,idPrefix:a})},onChange:function(e){var t=ae(e,"target.value");"number"===X&&void 0!==t&&(ee&&(t=parseFloat(t.toString().replace(/,/g,""))),t&&"."===t[t.length-1]?t.match(/(\.)/g).length>1&&(t=t.toString().slice(0,t.length-1)):t=isNaN(parseFloat(t))?t.toString().slice(0,t.length-1):parseFloat(t)),r(b,t)}})))}return"select"===e.type&&q.push(i.createElement(tr,d({key:b+"SelectInput"},e,h,U,$,{selectedValue:V,hasError:B,errorStyle:H,errorClass:P,validationState:B?"error":null,errorMsg:z,id:W,size:C,onChange:function(e){r(b,e)},isSearchableboolean:!!e.isSearchable&&ae(window,"innerWidth")>768}))),"tel"===e.type&&q.push(i.createElement("div",{key:b+"Input",className:"form-group"},i.createElement(he,d({},e,h,U,$,{errorStyle:H,errorClass:P,onSelectFlag:function(e,t){var n=t.dialCode,o=t.iso2;r([b+"_dialCode",b+"_iso2"],[n,o])},value:V,size:C,onPhoneNumberChange:function(t,n){if("boolean"==typeof e.onlyIntInput&&e.onlyIntInput&&"string"==typeof n&&n.length>0){var o=parseInt(n);if(isNaN(o)||o.toString().length<n.length)return}r(b,n)},hasError:B,errorMsg:z,validationState:B?"error":null,id:W,telInputProps:{onKeyPress:function(t){cr(t,{inputId:W,userInput:e,idPrefix:a})}},defaultCountry:ae(l,[b+"_iso2","value"])||"in",maxLength:"91"===ae(l,[b+"_dialCode","value"])?10:15})))),"checkbox"===e.type&&q.push(i.createElement(ve,d({key:b+"Input",id:W},h,e,U,$,{errorStyle:H,errorClass:P,value:Boolean(V),checked:Boolean(V),text:e.checkboxText,className:e.containerClass||e.className,textClass:e.textClass||"",hasError:B,errorMsg:z,onChange:function(e){var t=ae(e,"target.checked");r(b,t)}}))),"radio"===e.type&&e.options&&e.options.length>0&&q.push(i.createElement("div",{key:b+"Input",id:W,style:{marginBottom:"15px"}},e.options.map((function(t){var n=t.label,o=t.value;return i.createElement(rr,d({name:W,onChange:function(e){var t=e.target.value;r(b,t)}},h,U,$,{text:n,disabled:Boolean(e.disabled),value:o,checked:V===o,hasError:B,key:W+"-"+t.value,id:W+"-"+t.value,inline:void 0===e.inline||e.inline}))})),B&&i.createElement("div",{className:"nbform-err-msg "+P,style:H},z))),"rating"===e.type&&q.push(i.createElement("div",{key:b+"Input",className:e.containerClass||""},i.createElement(ie,d({id:W},h,U,$,{className:"react-rater "+(e.className||""),total:e.max||5,rating:parseInt(V)||0,onRate:function(t){var n=t.rating;e.nbGAEvent&&c(s,e.nbGAEvent),r(b,n)}})),B&&i.createElement("div",{className:"nbform-err-msg "+P,style:H},z))),"location-autocomplete"===e.type&&q.push(i.createElement("div",{key:b+"Input",className:"form-group"},i.createElement(ar,d({},e,h,U,$,{onSelect:function(t,n,o){"object"===f(t)&&Array.isArray(t)&&t.length>0?(r(b,{result:t,latLng:n,selectedAddress:o}),sr({inputId:W,idPrefix:a,userInput:e})):""===t&&r(b,{result:[],latLng:{},selectedAddress:""})},key:W+"Input",id:W,type:"text",hasError:B,errorMsg:z,validationState:B?"error":null,leftIcon:i.createElement(ue,{type:"place"}),onKeyPress:function(t){cr(t,{inputId:W,userInput:e,idPrefix:a})}})))),0===q.length?(console.info("Invalid Input. NbForm-"+b),null):i.createElement("div",{key:W+"-container",className:e.wrapperClass||"",id:W+"-container",style:N?ur:{}},q)}var fr=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(t=e.call.apply(e,[this].concat(o))||this).getButton=function(){var e=t.props,n=e.className,o=e.containerClass,a=e.btnStyle,l=e.size,u=e.disabled,s=e.type,c=e.block,p=e.text,f=e.onClick,d=e.children,h=e.id;return i.createElement(r.Button,{id:h,className:n+" "+o,onClick:f,bsStyle:a,bsSize:l,disabled:u,type:s,block:c},d||p||"")},t}return se(t,e),t.prototype.render=function(){var e=this.props.tooltip;return e?i.createElement(r.OverlayTrigger,{placement:"bottom",overlay:i.createElement(r.Tooltip,{id:"button-tooltip-"+(new Date).getTime()},e)},this.getButton()):this.getButton()},t}(e.PureComponent);fr.defaultProps={className:"",btnStyle:"default",size:"",disabled:!1,onClick:function(){},type:"button",block:!1,tooltip:!1,id:""};var dr=p((function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),i=new I(n||[]);return a._invoke=function(e,t,r){var n=c;return function(o,a){if(n===f)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw a;return j()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var l=w(i,r);if(l){if(l===h)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=s(e,t,r);if("normal"===u.type){if(n=r.done?d:p,u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(e,r,i),a}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c="suspendedStart",p="suspendedYield",f="executing",d="completed",h={};function v(){}function y(){}function m(){}var g={};g[a]=function(){return this};var b=Object.getPrototypeOf,E=b&&b(b(k([])));E&&E!==r&&n.call(E,a)&&(g=E);var _=m.prototype=v.prototype=Object.create(g);function x(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function C(e){var t;this._invoke=function(r,o){function a(){return new Promise((function(t,a){!function t(r,o,a,i){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then((function(e){t("next",e,a,i)}),(function(e){t("throw",e,a,i)})):Promise.resolve(c).then((function(e){u.value=e,a(u)}),(function(e){return t("throw",e,a,i)}))}i(l.arg)}(r,o,t,a)}))}return t=t?t.then(a,a):a()}}function w(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=s(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}return{next:j}}function j(){return{value:t,done:!0}}return y.prototype=_.constructor=m,m.constructor=y,m[l]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,l in e||(e[l]="GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},x(C.prototype),C.prototype[i]=function(){return this},e.AsyncIterator=C,e.async=function(t,r,n,o){var a=new C(u(t,r,n,o));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(_),_[l]="Generator",_[a]=function(){return this},_.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=k,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return l.type="throw",l.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),N(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));function hr(e,t,r,n,o,a,i){try{var l=e[a](i),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}var vr=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){hr(a,n,o,i,l,"next",e)}function l(e){hr(a,n,o,i,l,"throw",e)}i(void 0)}))}};var yr=function(){var e=vr(dr.mark((function e(t,r,n,o){var a,i,l,u,s,c,p,d,h,v,y,m,g,b,E,_,x,C,w,S,N,I,k,j,O,P,A;return dr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.type,i=t.id,l=t.subType,u=void 0===l?"":l,void 0===n&&(n={}),s=!1,c=[],p=ae(o,"formData")||{},d=ae(o,"extraProps")||{},!n){e.next=22;break}if(v=(h=n).minlength,y=h.required,m=h.min,g=h.max,b=h.dataType,E=void 0===b?"":b,_=h.value,"function"!=typeof(x=h.customValidation)){e.next=15;break}if(C=x(r,lr(p),d),"object"!==f(C)||"function"!=typeof C.then){e.next=14;break}return e.next=13,C;case 13:C=e.sent;case 14:"boolean"==typeof C?C&&(s=C,c.push("default")):"object"===f(C)&&Array.isArray(C)?(S=(w=C)[0],N=w[1],I=void 0===N?"default":N,S&&(s=S,c.push(I))):null!==C&&"object"===f(C)?"boolean"==typeof(k=C).isError&&(j=k.isError,O=k.type,j&&(s=j,c.push(O))):console.warn("Skipping NbForm-CustomValidation Invalid Return Data check Docs.");case 15:void 0!==_&&_!==r&&(s=!0,c.push("value")),(null==r||"string"==typeof r&&0===r.length)&&y&&(s=!0,c.push("required")),void 0!==v&&r.toString().trim().length<v&&(s=!0,c.push("minlength")),P=r,"location-autocomplete"===a&&y&&(r.selectedAddress||(s=!0)),"input"!==a||"email"!==u&&"email"!==E||/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)||(s=!0,c.push("type","dataType")),"number"==typeof r&&("input"===a&&"number"===u||-1!==["int","float"].indexOf(E))&&(A=!1,isNaN(parseFloat(r))&&(s=!0,c.push("type","dataType"),A=!0),A||"int"!==E||parseInt(r)==r||(s=!0,c.push("dataType"),A=!0),A||"float"!==E||parseFloat(r)==r||(s=!0,c.push("dataType"),A=!0),A||(P=E&&"float"!==E?parseInt(r):parseFloat(r),void 0!==v&&P.toString().length<v&&(s=!0,c.push("minlength")),"tel"===a&&"91"===ae(p,[i+"_dialCode","value"])&&P.toString().length<10&&(s=!0,c.push("minlength")),isNaN(m)||r<m&&(s=!0,c.push("min")),isNaN(g)||r>g&&(s=!0,c.push("max"))));case 22:return e.abrupt("return",{error:c,status:s});case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),mr=function(){var e=vr(dr.mark((function e(t,r,n,o){var a,i,l,u,s,c,p,d,h,v,y,m,g,b,E,_,x,C,w,S,N,I,k,j,O,P;return dr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:void 0===n&&(n=[[],[],[],[],[]]),void 0===o&&(o={}),a=[].concat(n),i=!1,u=(l=o).isGroupInput,s=void 0!==u&&u,c=l.groupValidation,p=void 0===c?{}:c,d=l.extraProps,h=void 0===d?{}:d,v=0,y=0;case 7:if(!(y<t.length)){e.next=37;break}if(m=t[y],g=m.id,b=void 0===g?"":g,E=m.validation,_=m.errorMsg,x=void 0===_?{}:_,"inputGroup"!==m.type){e.next=23;break}if(C=b||"group-"+y,"object"!==f(m.input)||!Array.isArray(m.input)){e.next=22;break}return w={},e.next=16,mr(m.input,r,a,{isGroupInput:!0,groupValidation:E,extraProps:h});case 16:S=e.sent,a=S[0],i=S[1],(w=S[2].groupErrorLog)&&-1===w.type.indexOf("required")&&(v+=1),w.isError&&(a[0].push(C),a[1].push(""),a[2].push(w.isError),a[3].push(w.isError?x[ae(w,"type.0")]||x.default:""),a[4].push(ae(w,"type.0")||"default"));case 22:return e.abrupt("continue",34);case 23:return N=ae(r,[b,"value"])||"",e.next=26,yr(m,N,E,{formData:r,extraProps:h});case 26:I=e.sent,k=I.status,j=I.error,!0===k&&(i=!0),O=j||[],-1===j.indexOf("required")&&(v+=1),Array.isArray(j)&&j.length>0&&(O=j[0]),k&&(a[0].push(b),a[1].push(N),a[2].push(k),a[3].push(k?x[O]||x.default:""),a[4].push(O||"default"));case 34:y++,e.next=7;break;case 37:return P={isError:!1,type:[]},s&&(p&&!0===p.required&&(P={isError:v<=0,type:v<=0?["required"]:[]}),!0===p.requiredAll&&(P={isError:v===t.length,type:v!==t.length?["requiredAll"]:[]})),e.abrupt("return",[a,i,{groupErrorLog:P}]);case 40:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gr=function(){var e=vr(dr.mark((function e(t,r,n,o,a){var i,l,u,s;return dr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mr(t,r,[[],[],[],[],[]],{extraProps:a});case 2:if(i=e.sent,l=i[0],u=!1,"object"===f(l[2])&&Array.isArray(l[2])&&l[2].forEach((function(e){!0===e&&(u=!0)})),s=!1,!l||!l[0]||0!==l[0].length){e.next=10;break}return n(!0,!0,(function(e){"function"!=typeof o||s||(o(u,lr(e),e),s=!0)})),e.abrupt("return");case 10:n.apply(void 0,l.concat([function(e){"function"==typeof o&&o(u,lr(e),e)}]));case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),br=function(e){var t={};return e.forEach((function(e){var r=e.id,n=e.customProps;"function"==typeof n&&(t[r]=n)})),t};return function(t){var r=t.id,n=t.data,o=t.ref,a=t.formClass,l=void 0===a?"":a,c=t.onSubmit,p=t.onChange,h=t.submitButtonText,v=void 0===h?"Submit":h,y=t.buttonClassName,m=void 0===y?"":y,g=t.defaultValue,b=void 0===g?{}:g,E=t.nbGaEvent,_=t.customFooter,x=t.getSubmitAction,C=t.style,w=void 0===C?{}:C,S=t.getResetFormAction,N=t.extraProps,I=void 0===N?{}:N;u(null!=r&&r.length>1,"Please Provide valid unique ID"),u(Array.isArray(n)&&n.length>0,"data should be array of object");var k=function(t,r,n){void 0===t&&(t={}),void 0===n&&(n=[]);var o=e.useState(ir(t,n)),a=o[0],i=o[1],l=e.useCallback((function(){i(ir(t,n))}),[t,n]),u=e.useCallback((function(e){try{if(Array.isArray(e)&&e.length>0)e=e[0];var t=document.getElementById(r+"-"+e+"-nbInput");t&&setTimeout((function(){t.focus()}),400)}catch(e){}}),[r]),s=e.useCallback((function(e,t,r){var n=d({},e),o=n[t]._dependencies;"object"===f(o)&&Object.keys(o).length>0&&(Object.keys(o)||[]).forEach((function(e){Array.isArray(o[e])&&o[e].length>0&&o[e].forEach((function(t){var o;n[e]||(n[e]={value:""}),n[e].dependency||(n[e].dependency={}),n[e].dependency=d({},n[e].dependency,((o={})[t]=r,o))}))}));return n}),[]);return[a,e.useCallback((function(e,t,r,n,o,a){void 0===r&&(r=!1),void 0===n&&(n=""),i(!0!==e||!0!==t?function(i){var l=!1,c=d({},i),p=!1,h="default",v=!1;if("function"==typeof r?a=r:p=r,"function"==typeof o?a=o:h=o,"object"===f(o)&&Array.isArray(o)&&(v=!0),Array.isArray(e)&&(l=!0),Array.isArray(e)){var y=!1;l&&e.length===t.length?e.forEach((function(r,o){c[r]||(c[r]={value:""}),void 0!==(c=s(c,r,t[o]))[r].parent&&void 0!==c[c[r].parent]&&(c[c[r].parent].isError=!1);var a=p&&p[o];c[r]=d({},c[r],{value:t[o],isError:!!a&&p[o],__errorType:a?v?h[o]:h:"",errorMsg:a&&n&&n[o]?n[o]:""}),!y&&c[r].isError&&(u(e),y=!0)})):e.forEach((function(r,o){c[r]||(c[r]={value:""}),void 0!==(c=s(c,r,t))[r].parent&&void 0!==c[c[r].parent]&&(c[c[r].parent].isError=!1);var a=p&&p[o];c[r]=d({},c[r],{value:t,isError:a?p[o]:p,errorMsg:a&&n&&n[o]?n[o]:n,__errorType:a?v?h[o]:h:""}),c[r].isError&&u(e)}))}else c[e]||(c[e]={value:""}),void 0!==(c=s(c,e,t))[e].parent&&void 0!==c[c[e].parent]&&(c[c[e].parent].isError=!1),c[e]=d({},c[e],{value:t,isError:p,errorMsg:n,__errorType:v?h[0]:h}),p&&u(e);return a&&"function"==typeof a&&a(c),c}:function(e){var t=Object.keys(e).reduce((function(t,r){return t[r]=d({},e[r],{isError:!1,errorMsg:""}),t}),{});return"function"==typeof r&&r(t),t})}),[]),l]}(b,r,n),j=k[0],O=void 0===j?{}:j,P=k[1],A=k[2],F=i.useState(I),T=F[0],L=F[1],B=i.useRef(O),R=function(e,t,r,n){var o=i.useState((function(){var t={};return e.forEach((function(e){var r=e.id;t[r]={}})),t})),a=o[0],l=o[1],u=i.useState(br(e)),c=u[0],p=u[1],h=i.useCallback(function(){var e=vr(dr.mark((function e(t,r){var n;return dr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("object"!==f(t)||null===t){e.next=14;break}if(n=t,"function"!=typeof t.then){e.next=6;break}return e.next=5,t;case 5:n=e.sent;case 6:if("boolean"!=typeof n||n){e.next=8;break}return e.abrupt("return");case 8:if("object"===f(n)&&null!==n){e.next=11;break}return l((function(e){var t;return d({},e,((t={})[r]={},t))})),e.abrupt("return");case 11:l((function(e){var t;return d({},e,((t={})[r]=n,t))})),e.next=19;break;case 14:if("boolean"!=typeof t||t){e.next=16;break}return e.abrupt("return");case 16:if(!("object"===f(a[r])&&Object.keys(a[r]).length<=0)){e.next=18;break}return e.abrupt("return");case 18:l((function(e){var t;return d({},e,((t={})[r]={},t))}));case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),[a]);return i.useEffect((function(){s(lr(n.current||{}),lr(t))||Object.keys(c).forEach((function(e){if(c[e]){var o=c[e];h(o(t[e].value,lr(t),{extraProps:r,lastFormData:lr(n.current||{})}),e)}}))}),[t,r]),i.useEffect((function(){p(br(e))}),[e]),a}(n,O,T,B);e.useEffect((function(){if("function"==typeof p){var e=function e(t,r){void 0===t&&(t={}),void 0===r&&(r={});var n={};return null===t?n:(Object.keys(t).forEach((function(o){if("object"===f(r)&&null!==r&&(!Object.prototype.hasOwnProperty.call(r,o)||t[o]!==r[o])){if("object"===f(r[o])&&null!==r[o]&&Object.keys(r[o]).length>0){var a=e(t[o],r[o]),i=e(r[o],t[o]);if(0===Object.keys(a).length&&0===Object.keys(i).length)return}n[o]=t[o]}})),n)}(O,B.current);p(lr(O),P,e),B.current=O}}),[O]),e.useEffect((function(){s(T,I)||L(I)}),[I]);var z=i.useCallback((function(){gr(n,O,P,c,I)}),[n,O,P,c,I]);return e.useEffect((function(){n.forEach((function(e){var t=e.type,r=e.id,n=e.dialCode,o=void 0===n?"91":n,a=e.iso2;"tel"===t&&P([r+"_dialCode",r+"_iso2"],[o,void 0===a?"in":a])})),"function"==typeof S&&S(A)}),[]),e.useEffect((function(){"function"==typeof x&&x(z)}),[z]),i.createElement("form",{id:r,className:"nbform-2ptp128 "+l,action:"#",method:"post",onSubmit:function(e){e.preventDefault(),e.stopPropagation(),z()},ref:function(e){"function"==typeof o&&o(e)},style:{textAlign:"left"}},n.map((function(e,t){"inputGroup"===e.type&&!e.id&&(e.id="group-"+t);var n=e.id;return u(Boolean(n),"Invalid input id for data input at index "+t),pr(e,O[n]||{},P,{idPrefix:r,formData:O,nbGaEvent:E,index:t,extraProps:I,defaultStyle:w,customProps:R[n]||{},lastFormData:B.current})})),void 0!==_?_:i.createElement(fr,{btnStyle:"primary",type:"submit",className:"form-control "+m},v))}}));
//# sourceMappingURL=nbform.umd.min.js.map
{
"name": "@wadehrarshpreet/nbform",
"homepage": "http://wadehrarshpreet.github.io/nbform",
"version": "0.0.1-alpha.29",
"version": "0.0.1-alpha.30",
"description": "React Form Generator Library",

@@ -6,0 +6,0 @@ "repository": {

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc