window.kentico=window.kentico||{};window.kentico._forms=window.kentico._forms||{};window.kentico._forms.formFileUploaderComponent=function(n){function i(n){var i,t,r;for(n.fileUploaderDisabledElements=[],i=n.elements,t=0;t<i.length;t++)r=i[t],r.disabled||(n.fileUploaderDisabledElements.push(t),r.disabled=!0)}function t(n){n.fileUploaderDisabledElements.forEach(function(t){n.elements[t].disabled=!1})}function r(n,t,i,r,u,f,e){n.value=null;n.removeAttribute("hidden");t.setAttribute("hidden","hidden");i.innerText=i.originalText;r.value="";u.value="";f.setAttribute("hidden","hidden");e.setAttribute("data-icon","select");e.removeAttribute("title")}function u(u){var f=n.getElementById(u.fileInputId),s=n.getElementById(u.fileInputId+"-placeholder"),c=n.getElementById(u.fileInputId+"-replacement"),e=n.getElementById(u.fileInputId+"-button"),o=n.getElementById(u.fileInputId+"-icon"),h=n.getElementById(u.tempFileIdentifierInputId),l=n.getElementById(u.tempFileOriginalNameInputId),v=n.getElementById(u.systemFileNameInputId),y=n.getElementById(u.originalFileNameInputId),a=n.getElementById(u.deletePersistentFileInputId),p=u.deleteFileIconButtonTitle;s.originalText=s.innerText;e.originalText=e.innerText;(l.value||y.value&&a.value.toUpperCase()==="FALSE")&&(s.innerText=l.value||u.originalFileNamePlain,e.removeAttribute("hidden"),o.setAttribute("data-icon","remove"),o.setAttribute("title",p),c.removeAttribute("hidden"),f.setAttribute("hidden","hidden"));var w=function(){if(h.value){var n=new XMLHttpRequest;n.open("POST",u.deleteEndpoint+"&tempFileIdentifier="+h.value);n.send()}},b=function(){v.value&&(a.value=!0);w();r(f,c,s,h,l,e,o)},k=function(n){o.getAttribute("data-icon")==="remove"&&(n.preventDefault(),b())};e.addEventListener("click",b);o.addEventListener("click",k);f.addEventListener("change",function(){var r,b,n;if(f.value){if(e.removeAttribute("hidden"),o.setAttribute("data-icon","loading"),i(f.form),r=f.files[0],r!==undefined&&r.size>u.maxFileSize*1024){f.value=null;h.value="";y="";window.alert(u.maxFileSizeExceededErrorMessage);t(f.form);o.setAttribute("data-icon","select");return}b=new FormData;n=new XMLHttpRequest;n.contentType="multipart/form-data";b.append("file",r);n.addEventListener("load",function(){var i,r;n.readyState===4&&(n.status===200?(i=n.response,typeof i=="string"&&(i=JSON.parse(i)),i.errorMessage?(f.value=null,alert(i.errorMessage),o.setAttribute("data-icon","select"),e.setAttribute("hidden","hidden")):(v.value&&(a.value=!0),w(),r=f.files[0].name,h.value=i.fileIdentifier,l.value=r,s.innerText=r,e.removeAttribute("hidden"),o.setAttribute("data-icon","remove"),o.setAttribute("title",p),c.innerText=r,c.removeAttribute("hidden"),f.setAttribute("hidden","hidden"))):(alert("Error sending file: "+n.statusText),o.setAttribute("data-icon","select"),e.setAttribute("hidden","hidden")),e.innerHTML=e.originalText,t(f.form))});n.upload.addEventListener("progress",function(n){e.innerText=parseInt(n.loaded/n.total*100)+"%"});n.open("POST",u.submitEndpoint);n.responseType="json";n.send(b)}})}return{attachScript:u}}(document);window.kentico=window.kentico||{},function(n){if(n.pageBuilder){var i=function(n,t){var i=document.getElementById(n);i.getString=window.kentico.localization.getString;i.selectedData=t};const t=n._modalDialog=n._modalDialog||{},r=t.mediaFilesSelector=t.mediaFilesSelector||{};r.init=i}}(window.kentico);window.kentico=window.kentico||{},function(n){if(n.pageBuilder){var i=function(n,t){var i=document.getElementById(n);i.getString=window.kentico.localization.getString;i.selectedPageData=t};const t=n._modalDialog=n._modalDialog||{},r=t.pageSelector=t.pageSelector||{};r.init=i}}(window.kentico);window.kentico=window.kentico||{},function(n){if(n.pageBuilder){var i=function(n,t){var i=document.getElementById(n);i.getString=window.kentico.localization.getString;i.selectedPageData=t};const t=n._modalDialog=n._modalDialog||{},r=t.pathSelector=t.pathSelector||{};r.init=i}}(window.kentico);window.kentico=window.kentico||{};window.kentico.updatableFormHelper=function(){function u(t){var e,u,f,s,h;if(!t||!t.formId||!t.targetAttributeName||!t.unobservedAttributeName)throw new Error("Invalid configuration passed.");if(e=["email","number","password","search","tel","text","time"],u=document.getElementById(t.formId),u&&u.getAttribute(t.targetAttributeName))for(i=0;i<u.length;i++)f=u.elements[i],s=!f.hasAttribute(t.unobservedAttributeName)&&f.type!=="submit",s&&(h=f.tagName==="INPUT"&&e.indexOf(f.type)!==-1||f.tagName==="TEXTAREA",h&&(f.previousValue=f.value,f.addEventListener("keyup",o(function(t){setTimeout(function(){u.updating||t.target.previousValue===t.target.value||(u.keyupUpdate=!0,n(u,t.target))},0)},r)),f.addEventListener("blur",function(t){setTimeout(function(){u.updating||t.target.previousValue===t.target.value||n(u,t.relatedTarget)},0)})),f.addEventListener("change",function(){setTimeout(function(){u.updating||n(u)},0)}))}function n(n,i){var u,f,r,o;n&&(u=n.getAttribute("data-ktc-ajax-update"),u)&&($(n).find("input[type='submit']").attr("onclick","return false;"),n.updating=!0,f=new FormData(n),f.append("kentico_update_form","true"),r=i||document.activeElement,o=function(n){var i,f,t;n.target.response.data||(i=selectionEnd=null,r&&(r.type==="text"||r.type==="search"||r.type==="password"||r.type==="tel"||r.type==="url")&&(i=r.selectionStart,selectionEnd=r.selectionEnd),f=$(window).scrollTop(),$(u).replaceWith(n.target.responseText),$(window).scrollTop(f),r.id&&(t=document.getElementById(r.id),t&&(t.focus(),e(t,i,selectionEnd))))},t(n,f,o))}function f(n){n.preventDefault();var i=n.target,r=new FormData(i),u=function(n){var f=n.target.getResponseHeader("Content-Type"),t,r,u;f.indexOf("application/json")===-1?(t=$(window).scrollTop(),r=i.getAttribute("data-ktc-ajax-update"),$(r).replaceWith(n.target.response),$(window).scrollTop(t)):(u=JSON.parse(n.target.response),location.href=u.redirectTo)};t(i,r,u)}function t(n,t,i){var r=new XMLHttpRequest;r.addEventListener("load",i);r.open("POST",n.action);r.send(t)}function e(n,t,i){(t!==null||i!==null)&&n.setSelectionRange&&n.setSelectionRange(t,i)}function o(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null;i||n.apply(u,f)},o=i&&!r;clearTimeout(r);r=setTimeout(e,t||200);o&&n.apply(u,f)}}var r=800;return{registerEventListeners:u,updateForm:n,submitForm:f}}();!function(n){"function"==typeof define&&define.amd?define(["../global/window","../global/document"],n):"object"==typeof exports?module.exports=n(require("../global/window"),require("../global/document")):window.dependencyLib=n(window,document)}(function(n,t){function u(n){return null!=n&&n===n.window}function r(n){return n instanceof Element}function i(r){return r instanceof i?r:this instanceof i?void(void 0!==r&&null!==r&&r!==n&&(this[0]=r.nodeName?r:void 0!==r[0]&&r[0].nodeName?r[0]:t.querySelector(r),void 0!==this[0]&&null!==this[0]&&(this[0].eventRegistry=this[0].eventRegistry||{}))):new i(r)}return i.prototype={on:function(n,t){var u,f,s,e,i,o;if(r(this[0]))for(u=this[0].eventRegistry,f=this[0],s=n.split(" "),e=0;e<s.length;e++){var h=s[e].split("."),c=h[0],l=h[1]||"global";i=c;o=l;f.addEventListener?f.addEventListener(i,t,!1):f.attachEvent&&f.attachEvent("on"+i,t);u[i]=u[i]||{};u[i][o]=u[i][o]||[];u[i][o].push(t)}return this},off:function(n,t){var i,u,s,e;if(r(this[0])){i=this[0].eventRegistry;u=this[0];function r(n,t,r){if(n in i==!0)if(u.removeEventListener?u.removeEventListener(n,r,!1):u.detachEvent&&u.detachEvent("on"+n,r),"global"===t)for(var f in i[n])i[n][f].splice(i[n][f].indexOf(r),1);else i[n][t].splice(i[n][t].indexOf(r),1)}function l(n,r){var u,s,o=[],f,e;if(n.length>0)if(void 0===t)for(u=0,s=i[n][r].length;u<s;u++)o.push({ev:n,namespace:r&&r.length>0?r:"global",handler:i[n][r][u]});else o.push({ev:n,namespace:r&&r.length>0?r:"global",handler:t});else if(r.length>0)for(f in i)for(e in i[f])if(e===r)if(void 0===t)for(u=0,s=i[f][e].length;u<s;u++)o.push({ev:f,namespace:e,handler:i[f][e][u]});else o.push({ev:f,namespace:e,handler:t});return o}for(s=n.split(" "),e=0;e<s.length;e++)for(var h=s[e].split("."),o=l(h[0],h[1]),f=0,c=o.length;f<c;f++)r(o[f].ev,o[f].namespace,o[f].handler)}return this},trigger:function(n){var f,e,s,a;if(r(this[0]))for(var o=this[0].eventRegistry,h=this[0],v="string"==typeof n?n.split(" "):[n.type],l=0;l<v.length;l++){var y=v[l].split("."),u=y[0],c=y[1]||"global";if(void 0!==t&&"global"===c)if(s={bubbles:!0,cancelable:!0,detail:arguments[1]},t.createEvent){try{f=new CustomEvent(u,s)}catch(n){(f=t.createEvent("CustomEvent")).initCustomEvent(u,s.bubbles,s.cancelable,s.detail)}n.type&&i.extend(f,n);h.dispatchEvent(f)}else(f=t.createEventObject()).eventType=u,f.detail=arguments[1],n.type&&i.extend(f,n),h.fireEvent("on"+f.eventType,f);else if(void 0!==o[u])if(arguments[0]=arguments[0].type?arguments[0]:i.Event(arguments[0]),"global"===c)for(a in o[u])for(e=0;e<o[u][a].length;e++)o[u][a][e].apply(h,arguments);else for(e=0;e<o[u][c].length;e++)o[u][c][e].apply(h,arguments)}return this}},i.isFunction=function(n){return"function"==typeof n},i.noop=function(){},i.isArray=Array.isArray,i.inArray=function(n,t){return null==t?-1:function(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1}(t,n)},i.valHooks=void 0,i.isPlainObject=function(n){return"object"==typeof n&&!n.nodeType&&!u(n)&&!(n.constructor&&!Object.hasOwnProperty.call(n.constructor.prototype,"isPrototypeOf"))},i.extend=function(){var e,f,t,r,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for("boolean"==typeof n&&(h=n,n=arguments[u]||{},u++),"object"==typeof n||i.isFunction(n)||(n={}),u===c&&(n=this,u--);u<c;u++)if(null!=(e=arguments[u]))for(f in e)t=n[f],n!==(r=e[f])&&(h&&r&&(i.isPlainObject(r)||(o=i.isArray(r)))?(o?(o=!1,s=t&&i.isArray(t)?t:[]):s=t&&i.isPlainObject(t)?t:{},n[f]=i.extend(h,s,r)):void 0!==r&&(n[f]=r));return n},i.each=function(n,t){var r,f,e,i=0,o;if(f="length"in(r=n)&&r.length,"function"!=(e=typeof r)&&!u(r)&&(1===r.nodeType&&f||"array"===e||0===f||"number"==typeof f&&f>0&&f-1 in r))for(o=n.length;i<o&&!1!==t.call(n[i],i,n[i]);i++);else for(i in n)if(!1===t.call(n[i],i,n[i]))break;return n},i.data=function(n,t,i){if(void 0===i)return n.__data?n.__data[t]:null;n.__data=n.__data||{};n.__data[t]=i},"function"==typeof n.CustomEvent?i.Event=n.CustomEvent:(i.Event=function(n,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var r=t.createEvent("CustomEvent");return r.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),r},i.Event.prototype=n.Event.prototype),i});!function(n){"function"==typeof define&&define.amd?define(["./dependencyLibs/inputmask.dependencyLib","./global/window","./global/document"],n):"object"==typeof exports?module.exports=n(require("./dependencyLibs/inputmask.dependencyLib"),require("./global/window"),require("./global/document")):window.Inputmask=n(window.dependencyLib||jQuery,window,document)}(function(n,t,i,r){function u(t,i,f){if(!(this instanceof u))return new u(t,i,f);this.el=r;this.events={};this.maskset=r;this.refreshValue=!1;!0!==f&&(n.isPlainObject(t)?i=t:(i=i||{},t&&(i.alias=t)),this.opts=n.extend(!0,{},this.defaults,i),this.noMasksCache=i&&i.definitions!==r,this.userOptions=i||{},this.isRTL=this.opts.numericInput,c(this.opts.alias,i,this.opts))}function c(t,i,f){var e=u.prototype.aliases[t];return e?(e.alias&&c(e.alias,r,f),n.extend(!0,f,e),n.extend(!0,f,i),!0):(null===f.mask&&(f.mask=t),!1)}function e(t,i){function o(t,f,e){var h=!1,c,o,s;return(null!==t&&""!==t||((h=null!==e.regex)?t=(t=e.regex).replace(/^(\^)(.*)(\$)$/,"$2"):(h=!0,t=".*")),1===t.length&&!1===e.greedy&&0!==e.repeat&&(e.placeholder=""),e.repeat>0||"*"===e.repeat||"+"===e.repeat)&&(c="*"===e.repeat?0:"+"===e.repeat?1:e.repeat,t=e.groupmarker[0]+t+e.groupmarker[1]+e.quantifiermarker[0]+c+","+e.repeat+e.quantifiermarker[1]),s=h?"regex_"+e.regex:e.numericInput?t.split("").reverse().join(""):t,u.prototype.masksCache[s]===r||!0===i?(o={mask:t,maskToken:u.prototype.analyseMask(t,h,e),validPositions:{},_buffer:r,buffer:r,tests:{},excludes:{},metadata:f,maskLength:r},!0!==i&&(u.prototype.masksCache[s]=o,o=n.extend(!0,{},u.prototype.masksCache[s]))):o=n.extend(!0,{},u.prototype.masksCache[s]),o}var e,f;if(n.isFunction(t.mask)&&(t.mask=t.mask(t)),n.isArray(t.mask)){if(t.mask.length>1){if(null===t.keepStatic)for(t.keepStatic="auto",e=0;e<t.mask.length;e++)if(t.mask[e].charAt(0)!==t.mask[0].charAt(0)){t.keepStatic=!0;break}return f=t.groupmarker[0],n.each(t.isRTL?t.mask.reverse():t.mask,function(i,u){f.length>1&&(f+=t.groupmarker[1]+t.alternatormarker+t.groupmarker[0]);f+=u.mask===r||n.isFunction(u.mask)?u:u.mask}),o(f+=t.groupmarker[1],t.mask,t)}t.mask=t.mask.pop()}return t.mask&&t.mask.mask!==r&&!n.isFunction(t.mask.mask)?o(t.mask.mask,t.mask,t):o(t.mask,t.mask,t)}function a(n){var t=i.createElement("input"),r="on"+n,u=r in t;return u||(t.setAttribute(r,"return;"),u="function"==typeof t[r]),t=null,u}function f(e,c,l){function wt(n,t,i,u,f){var y,h;!0!==u&&(r,0);y=l.greedy;f&&(l.greedy=!1);t=t||0;var a,o,c,s=[],e=0,p=b();do!0===n&&v().validPositions[e]?(o=(c=f&&!0===v().validPositions[e].match.optionality&&v().validPositions[e+1]===r&&(!0===v().validPositions[e].generatedInput||v().validPositions[e].input==l.skipOptionalPartCharacter&&e>0)?ri(e,ht(e,a,e-1)):v().validPositions[e]).match,a=c.locator.slice(),s.push(!0===i?c.input:!1===i?o.nativeDef:st(e,o))):(o=(c=bt(e,a,e-1)).match,a=c.locator.slice(),h=!0!==u&&(!1!==l.jitMasking?l.jitMasking:o.jit),!1===h||h===r||e<p||"number"==typeof h&&isFinite(h)&&h>e?s.push(!1===i?o.nativeDef:st(e,o)):o.jit&&o.optionalQuantifier!==r&&(e,0)),"auto"===l.keepStatic&&o.newBlockMarker&&null!==o.fn&&(l.keepStatic=e-1),e++;while((lt===r||e<lt)&&(null!==o.fn||""!==o.def)||t>e);return""===s[s.length-1]&&s.pop(),!1===i&&v().maskLength!==r||(v().maskLength=e-1),l.greedy=y,s}function v(){return c}function et(n){var t=v();t.buffer=r;!0!==n&&(t.validPositions={},t.p=0)}function b(n,t,i){var f=-1,e=-1,o=i||v().validPositions,s,u;for(s in n===r&&(n=-1),o)u=parseInt(s),o[u]&&(t||!0!==o[u].generatedInput)&&(u<=n&&(f=u),u>=n&&(e=u));return-1===f||f==n?e:-1==e?f:n-f<e-n?f:e}function ci(n){var t=n.locator[n.alternation];return"string"==typeof t&&t.length>0&&(t=t.split(",")[0]),t!==r?t.toString():""}function pi(n,t){var i=(n.alternation!=r?n.mloc[ci(n)]:n.locator).join("");if(""!==i)for(;i.length<t;)i+="0";return i}function ri(n,t){for(var e,o,i,u,h,s=pi(tt(n=n>0?n-1:0)),f=0;f<t.length;f++)u=t[f],e=pi(u,s.length),h=Math.abs(e-s),(o===r||""!==e&&h<o||i&&i.match.optionality&&"master"===i.match.newBlockMarker&&(!u.match.optionality||!u.match.newBlockMarker)||i&&i.match.optionalQuantifier&&!u.match.optionalQuantifier)&&(o=h,i=u);return i}function bt(n,t,i){return v().validPositions[n]||ri(n,ht(n,t?t.slice():t,i))}function tt(n,t){return v().validPositions[n]?v().validPositions[n]:(t||ht(n))[0]}function nr(n,t){for(var u=!1,r=ht(n),i=0;i<r.length;i++)if(r[i].match&&r[i].match.def===t){u=!0;break}return u}function ht(t,i,u){function b(i,u,o,s){function p(o,s,h){function ut(t,i){var r=0===n.inArray(t,i.matches);return r||n.each(i.matches,function(n,u){if(!0===u.isQuantifier?r=ut(t,i.matches[n-1]):!0===u.isOptional?r=ut(t,u):!0===u.isAlternate&&(r=ut(t,u)),r)return!1}),r}function wt(t,i,u){var f,e,o;return((v().tests[t]||v().validPositions[t])&&n.each(v().tests[t]||[v().validPositions[t]],function(n,t){if(t.mloc[i])return f=t,!1;var s=u!==r?u:t.alternation,o=t.locator[s]!==r?t.locator[s].toString().indexOf(i):-1;(e===r||o<e)&&-1!==o&&(f=t,e=o)}),f)?(o=f.locator[f.alternation],(f.mloc[i]||f.mloc[o]||f.locator).slice((u!==r?u:f.alternation)+1)):u!==r?wt(t,i):r}function bt(n,t){function i(n){for(var i,u,r=[],t=0,f=n.length;t<f;t++)if("-"===n.charAt(t))for(u=n.charCodeAt(t+1);++i<u;)r.push(String.fromCharCode(i));else i=n.charCodeAt(t),r.push(n.charAt(t));return r.join("")}return l.regex&&null!==n.match.fn&&null!==t.match.fn?-1!==i(t.match.def.replace(/[\[\]]/g,"")).indexOf(i(n.match.def.replace(/[\[\]]/g,""))):n.match.def===t.match.nativeDef}function ft(n,t){var i,u;if(t===r||n.alternation===t.alternation&&-1===n.locator[n.alternation].toString().indexOf(t.locator[t.alternation])){if(n.mloc=n.mloc||{},i=n.locator[n.alternation],i!==r){if("string"==typeof i&&(i=i.split(",")[0]),n.mloc[i]===r&&(n.mloc[i]=n.locator.slice()),t!==r){for(u in t.mloc)"string"==typeof u&&(u=u.split(",")[0]),n.mloc[u]===r&&(n.mloc[u]=t.mloc[u]);n.locator[n.alternation]=Object.keys(n.mloc).join(",")}return!0}n.alternation=r}return!1}var kt,yt,et,ct,w,ot,lt,d,it,rt,st,ti,pt;if(e>5e3)throw"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. "+v().mask;if(e===t&&o.matches===r)return f.push({match:o,locator:s.reverse(),cd:y,mloc:{}}),!0;if(o.matches!==r){if(o.isGroup&&h!==o){if(o=p(i.matches[n.inArray(o,i.matches)+1],s,h))return!0}else if(o.isOptional){if(kt=o,o=b(o,u,s,h)){if(n.each(f,function(n,t){t.match.optionality=!0}),c=f[f.length-1].match,h!==r||!ut(c,kt))return!0;a=!0;e=t}}else if(o.isAlternator){var at,ht=o,g=[],ii=f.slice(),dt=s.length,nt=u.length>0?u.shift():-1;if(-1===nt||"string"==typeof nt){var tt,gt=e,ni=u.slice(),k=[];if("string"==typeof nt)k=nt.split(",");else for(tt=0;tt<ht.matches.length;tt++)k.push(tt.toString());if(v().excludes[t]){for(var ri=k.slice(),vt=0,ui=v().excludes[t].length;vt<ui;vt++)k.splice(k.indexOf(v().excludes[t][vt].toString()),1);0===k.length&&(v().excludes[t]=r,k=ri)}for((!0===l.keepStatic||isFinite(parseInt(l.keepStatic))&&gt>=l.keepStatic)&&(k=k.slice(0,1)),yt=!1,et=0;et<k.length;et++)for(tt=parseInt(k[et]),f=[],u="string"==typeof nt&&wt(e,tt,dt)||ni.slice(),ht.matches[tt]&&p(ht.matches[tt],[tt].concat(s),h)?o=!0:0===et&&(yt=!0),at=f.slice(),e=gt,f=[],ct=0;ct<at.length;ct++){for(w=at[ct],ot=!1,w.match.jit=w.match.jit||yt,w.alternation=w.alternation||dt,ft(w),lt=0;lt<g.length;lt++)if(d=g[lt],"string"!=typeof nt||w.alternation!==r&&-1!==n.inArray(w.locator[w.alternation].toString(),k)){if(w.match.nativeDef===d.match.nativeDef){ot=!0;ft(d,w);break}if(bt(w,d)){ft(w,d)&&(ot=!0,g.splice(g.indexOf(d),0,w));break}if(bt(d,w)){ft(d,w);break}if(pt=d,null===(ti=w).match.fn&&null!==pt.match.fn&&pt.match.fn.test(ti.match.def,v(),t,!1,l,!1)){ft(w,d)&&(ot=!0,g.splice(g.indexOf(d),0,w));break}}ot||g.push(w)}f=ii.concat(g);e=t;a=f.length>0;o=g.length>0;u=ni.slice()}else o=p(ht.matches[nt]||i.matches[nt],[nt].concat(s),h);if(o)return!0}else if(o.isQuantifier&&h!==i.matches[n.inArray(o,i.matches)-1]){for(it=o,rt=u.length>0?u.shift():0;rt<(isNaN(it.quantifier.max)?rt+1:it.quantifier.max)&&e<=t;rt++)if(st=i.matches[n.inArray(it,i.matches)-1],o=p(st,[rt].concat(s),st)){if((c=f[f.length-1].match).optionalQuantifier=rt>it.quantifier.min-1,c.jit=rt+st.matches.indexOf(c)>=it.quantifier.jit,ut(c,st)&&rt>it.quantifier.min-1){a=!0;e=t;break}if(it.quantifier.jit!==r&&isNaN(it.quantifier.max)&&c.optionalQuantifier&&v().validPositions[t-1]===r){f.pop();a=!0;e=t;y=r;break}return!0}}else if(o=b(o,u,s,h))return!0}else e++}for(var w,h=u.length>0?u.shift():0;h<i.matches.length;h++)if(!0!==i.matches[h].isQuantifier){if(w=p(i.matches[h],[h].concat(o),s),w&&e===t)return w;if(e>t)break}}var c,d,o,s,g=v().maskToken,e=i?u:0,w=i?i.slice():[0],f=[],a=!1,y=i?i.join(""):"",k,h,p;if(t>-1){if(i===r){for(h=t-1;(k=v().validPositions[h]||v().tests[h])===r&&h>-1;)h--;k!==r&&h>-1&&(d=h,o=k,s=[],n.isArray(o)||(o=[o]),o.length>0&&(o[0].alternation===r?0===(s=ri(d,o.slice()).locator.slice()).length&&(s=o[0].locator.slice()):n.each(o,function(n,t){if(""!==t.def)if(0===s.length)s=t.locator.slice();else for(var i=0;i<s.length;i++)t.locator[i]&&-1===s[i].toString().indexOf(t.locator[i])&&(s[i]+=","+t.locator[i])})),y=(w=s).join(""),e=h)}if(v().tests[t]&&v().tests[t][0].cd===y)return v().tests[t];for(p=w.shift();p<g.length;p++)if(b(g[p],w,[p])&&e===t||e>t)break}return(0===f.length||a)&&f.push({match:{fn:null,optionality:!1,casing:null,def:"",placeholder:""},locator:[],mloc:{},cd:y}),i!==r&&v().tests[t]?n.extend(!0,[],f):(v().tests[t]=n.extend(!0,[],f),v().tests[t])}function rt(){return v()._buffer===r&&(v()._buffer=wt(!1,1),v().buffer===r&&(v().buffer=v()._buffer.slice())),v()._buffer}function p(n){return v().buffer!==r&&!0!==n||(v().buffer=wt(!0,b(),!0)),v().buffer}function wi(n,t,i){var u,e,f;if(!0===n)et(),n=0,t=i.length;else for(u=n;u<t;u++)delete v().validPositions[u];for(e=n,u=n;u<t;u++)(et(!0),i[u]!==l.skipOptionalPartCharacter)&&(f=vt(e,i[u],!0,!0),!1!==f&&(et(!0),e=f.caret!==r?f.caret:f.pos+1))}function tr(t,i,u){for(var f,o,c=l.greedy?i:i.slice(0,1),s=!1,h=u!==r?u.split(","):[],e=0;e<h.length;e++)-1!==(o=t.indexOf(h[e]))&&t.splice(o,1);for(f=0;f<t.length;f++)if(-1!==n.inArray(t[f],c)){s=!0;break}return s}function ui(t,i,u,f,e){var p,k,l,c,s,a,o,ft=n.extend(!0,{},v().validPositions),h=!1,y=e!==r?e:b(),d,g,w,nt,ut,it,rt;if(-1===y&&e===r)k=(c=tt(p=0)).alternation;else for(;y>=0;y--)if((l=v().validPositions[y])&&l.alternation!==r){if(c&&c.locator[l.alternation]!==l.locator[l.alternation])break;p=y;k=v().validPositions[p].alternation;c=l}if(k!==r){for(o=parseInt(p),v().excludes[o]=v().excludes[o]||[],!0!==t&&v().excludes[o].push(ci(c)),d=[],g=0,s=o;s<b(r,!0)+1;s++)(a=v().validPositions[s])&&!0!==a.generatedInput?d.push(a.input):s<t&&g++,delete v().validPositions[s];for(;v().excludes[o]&&v().excludes[o].length<10;){for(w=-1*g,nt=d.slice(),v().tests[o]=r,et(!0),h=!0;nt.length>0;)if(ut=nt.shift(),!(h=vt(b(r,!0)+1,ut,!1,f,!0)))break;if(h&&i!==r){for(it=b(t)+1,s=o;s<b()+1;s++)((a=v().validPositions[s])===r||null==a.match.fn)&&s<t+w&&w++;h=vt((t+=w)>it?it:t,i,u,f,!0)}if(h)break;if(et(),c=tt(o),v().validPositions=n.extend(!0,{},ft),!v().excludes[o]){h=ui(t,i,u,f,o-1);break}if(rt=ci(c),-1!==v().excludes[o].indexOf(rt)){h=ui(t,i,u,f,o-1);break}for(v().excludes[o].push(rt),s=o;s<b(r,!0)+1;s++)delete v().validPositions[s]}}return v().excludes[o]=r,h}function vt(t,i,f,e,o,s){function k(n){return g?n.begin-n.end>1||n.begin-n.end==1:n.end-n.begin>1||n.end-n.begin==1}function nt(i,f,o){var s=!1;return n.each(ht(i),function(h,c){var a=c.match,y,w;if(p(!0),!1!==(s=null!=a.fn?a.fn.test(f,v(),i,o,l,k(t)):(f===a.def||f===l.skipOptionalPartCharacter)&&""!==a.def&&{c:st(i,a,!0)||a.def,pos:i}))return y=s.c!==r?s.c:f,w=i,y=y===l.skipOptionalPartCharacter&&null===a.fn?st(i,a,!0)||a.def:y,s.remove!==r&&(n.isArray(s.remove)||(s.remove=[s.remove]),n.each(s.remove.sort(function(n,t){return t-n}),function(n,t){fi({begin:t,end:t+1})})),s.insert!==r&&(n.isArray(s.insert)||(s.insert=[s.insert]),n.each(s.insert.sort(function(n,t){return n-t}),function(n,t){vt(t.pos,t.c,!0,e)})),!0!==s&&s.pos!==r&&s.pos!==i&&(w=s.pos),!0!==s&&s.pos===r&&s.c===r?!1:(fi(t,n.extend({},c,{input:function(t,i,r){var f,e;switch(l.casing||i.casing){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break;case"title":f=v().validPositions[r-1];t=0===r||f&&f.input===String.fromCharCode(u.keyCode.SPACE)?t.toUpperCase():t.toLowerCase();break;default:n.isFunction(l.casing)&&(e=Array.prototype.slice.call(arguments),e.push(v().validPositions),t=l.casing.apply(this,e))}return t}(y,a,w)}),e,w)||(s=!1),!1)}),s}var c,h,tt,b,y,it,a,w;if(f=!0===f,c=t,t.begin!==r&&(c=g?t.end:t.begin),h=!0,tt=n.extend(!0,{},v().validPositions),n.isFunction(l.preValidation)&&!f&&!0!==e&&!0!==s&&(h=l.preValidation(p(),c,i,k(t),l,v())),!0===h){if(li(r,c,!0),(lt===r||c<lt)&&(h=nt(c,i,f),(!f||!0===e)&&!1===h&&!0!==s))if(b=v().validPositions[c],b&&null===b.match.fn&&(b.match.def===i||i===l.skipOptionalPartCharacter))h={caret:d(c)};else if((l.insertMode||v().validPositions[d(c)]===r)&&!ot(c,!0))for(y=c+1,it=d(c);y<=it;y++)if(!1!==(h=nt(y,i,f))){h=li(c,h.pos!==r?h.pos:y)||h;c=y;break}!1!==h||!1===l.keepStatic||null!=l.regex&&!pt(p())||f||!0===o||(h=ui(c,i,f,e));!0===h&&(h={pos:c})}return n.isFunction(l.postValidation)&&!1!==h&&!f&&!0!==e&&!0!==s&&(a=l.postValidation(p(!0),h,l),a!==r&&(a.refreshFromBuffer&&a.buffer&&(w=a.refreshFromBuffer,wi(!0===w?w:w.start,w.end,a.buffer)),h=!0===a?h:a)),h&&h.pos===r&&(h.pos=c),!1!==h&&!0!==s||(et(!0),v().validPositions=n.extend(!0,{},tt)),h}function li(t,i,u){var s,f,o,e,h;if(t===r)for(t=i-1;t>0&&!v().validPositions[t];t--);for(f=t;f<i;f++)v().validPositions[f]!==r||ot(f,!0)||(0==f?tt(f):v().validPositions[f-1])&&(o=ht(f).slice(),""===o[o.length-1].match.def&&o.pop(),e=ri(f,o),((e=n.extend({},e,{input:st(f,e.match,!0)||e.match.def})).generatedInput=!0,fi(f,e,!0),!0!==u)&&(h=v().validPositions[i].input,v().validPositions[i]=r,s=vt(i,h,!0,!0)));return s}function fi(t,i,u,f){function g(n,t,i){var u=t[n],f,e;return u!==r&&(null===u.match.fn&&!0!==u.match.optionality||u.input===l.radixPoint)?(f=i.begin<=n-1?t[n-1]&&null===t[n-1].match.fn&&t[n-1]:t[n-1],e=i.end>n+1?t[n+1]&&null===t[n+1].match.fn&&t[n+1]:t[n+1],f&&e):!1}var h=t.begin!==r?t.begin:t,p=t.end!==r?t.end:t,c,k,s,w;if(t.begin>t.end&&(h=t.end,p=t.begin),f=f!==r?f:h,h!==p||l.insertMode&&v().validPositions[f]!==r&&u===r){for(c=n.extend(!0,{},v().validPositions),k=b(r,!0),v().p=h,o=k;o>=h;o--)v().validPositions[o]&&"+"===v().validPositions[o].match.nativeDef&&(l.isNegative=!1),delete v().validPositions[o];var a=!0,y=f,d=(v().validPositions,!1),e=y,o=y;for(i&&(v().validPositions[f]=n.extend(!0,{},i),e++,y++,h<p&&o++);o<=k;o++){if(s=c[o],s!==r&&(o>=p||o>=h&&!0!==s.generatedInput&&g(o,c,{begin:h,end:p}))){for(;""!==tt(e).match.def;){if(!1===d&&c[e]&&c[e].match.nativeDef===s.match.nativeDef)v().validPositions[e]=n.extend(!0,{},c[e]),v().validPositions[e].input=s.input,li(r,e,!0),y=e+1,a=!0;else if(nr(e,s.match.def))w=vt(e,s.input,!0,!0),a=!1!==w,y=w.caret||w.insert?b():e+1,d=!0;else if(!(a=!0===s.generatedInput||s.input===l.radixPoint&&!0===l.numericInput)&&""===tt(e).match.def)break;if(a)break;e++}""==tt(e).match.def&&(a=!1);e=y}if(!a)break}if(!a)return v().validPositions=n.extend(!0,{},c),et(!0),!1}else i&&(v().validPositions[f]=n.extend(!0,{},i));return et(!0),!0}function ot(n,t){var i=bt(n).match,r;return(""===i.def&&(i=tt(n).match),null!=i.fn)?i.fn:!0!==t&&n>-1?(r=ht(n),r.length>1+(""===r[r.length-1].match.def?1:0)):!1}function d(n,t){for(var i=n+1;""!==tt(i).match.def&&(!0===t&&(!0!==tt(i).match.newBlockMarker||!ot(i))||!0!==t&&!ot(i));)i++;return i}function kt(n,t){var r,i=n;if(i<=0)return 0;for(;--i>0&&(!0===t&&!0!==tt(i).match.newBlockMarker||!0!==t&&!ot(i)&&((r=ht(i)).length<2||2===r.length&&""===r[1].match.def)););return i}function ut(t,i,u,f,e){var o,s,h,c;f&&n.isFunction(l.onBeforeWrite)&&(o=l.onBeforeWrite.call(at,f,i,u,l),o&&(o.refreshFromBuffer&&(s=o.refreshFromBuffer,wi(!0===s?s:s.start,s.end,o.buffer||i),i=p(!0)),u!==r&&(u=o.caret!==r?o.caret:u)));t!==r&&(t.inputmask._valueSet(i.join("")),u===r||f!==r&&"blur"===f.type?ai(t,u,0===i.length):w(t,u),!0===e)&&(h=n(t),c=t.inputmask._valueGet(),ni=!0,h.trigger("input"),setTimeout(function(){c===rt().join("")?h.trigger("cleared"):!0===pt(i)&&h.trigger("complete")},0))}function st(t,i,u){var s,f,o,e;if((i=i||tt(t).match).placeholder!==r||!0===u)return n.isFunction(i.placeholder)?i.placeholder(l):i.placeholder;if(null===i.fn){if(t>-1&&v().validPositions[t]===r&&(f=ht(t),o=[],f.length>1+(""===f[f.length-1].match.def?1:0)))for(e=0;e<f.length;e++)if(!0!==f[e].match.optionality&&!0!==f[e].match.optionalQuantifier&&(null===f[e].match.fn||s===r||!1!==f[e].match.fn.test(s.match.def,v(),t,!0,l))&&(o.push(f[e]),null===f[e].match.fn&&(s=f[e]),o.length>1&&/[0-9a-bA-Z]/.test(o[0].match.def)))return l.placeholder.charAt(t%l.placeholder.length);return i.def}return l.placeholder.charAt(t%l.placeholder.length)}function yt(t,i,f,e,o){var a=this||t.inputmask,c=e.slice(),w="",s=-1,h=r,g,y;(et(),f||!0===l.autoUnmask)?s=d(s):(g=rt().slice(0,d(-1)).join(""),y=c.join("").match(new RegExp("^"+u.escapeRegex(g),"g")),y&&y.length>0&&(c.splice(0,y.length*g.length),s=d(s)));-1===s?(v().p=d(s),s=0):v().p=s;a.caretPos={begin:s};n.each(c,function(i,u){var l,y,e,o;u!==r&&(v().validPositions[i]===r&&c[i]===st(i)&&ot(i,!0)&&!1===vt(i,c[i],!0,r,r,!0)?v().p++:(l=new n.Event("_checkval"),l.which=u.charCodeAt(0),w+=u,y=b(r,!0),e=s,o=w,-1===wt(!0,0,!1).slice(e,d(e)).join("").replace(/'/g,"").indexOf(o)||ot(e)||!(tt(e).match.nativeDef===o.charAt(0)||null===tt(e).match.fn&&tt(e).match.nativeDef==="'"+o.charAt(0)||" "===tt(e).match.nativeDef&&(tt(e+1).match.nativeDef===o.charAt(0)||null===tt(e+1).match.fn&&tt(e+1).match.nativeDef==="'"+o.charAt(0)))?(h=k.keypressEvent.call(t,l,!0,!1,f,a.caretPos.begin))&&(s=a.caretPos.begin+1,w=""):h=k.keypressEvent.call(t,l,!0,!1,f,y+1),h&&(ut(r,p(),h.forwardPosition,l,!1),a.caretPos={begin:h.forwardPosition,end:h.forwardPosition})))});i&&ut(t,p(),h?h.forwardPosition:r,o||new n.Event("checkval"),o&&"input"===o.type)}function bi(t){var i,u,f,e,o;if(t){if(t.inputmask===r)return t.value;t.inputmask&&t.inputmask.refreshValue&&k.setValueEvent.call(t)}i=[];u=v().validPositions;for(f in u)u[f].match&&null!=u[f].match.fn&&i.push(u[f].input);return e=0===i.length?"":(g?i.reverse():i).join(""),n.isFunction(l.onUnMask)&&(o=(g?p().slice().reverse():p()).join(""),e=l.onUnMask.call(at,o,e,l)),e}function ei(n){return!g||"number"!=typeof n||l.greedy&&""===l.placeholder||!y||(n=y.inputmask._valueGet().length-n),n}function w(u,f,e,s){var h,c,v,a;if(f===r)return u.setSelectionRange?(f=u.selectionStart,e=u.selectionEnd):t.getSelection?(h=t.getSelection().getRangeAt(0)).commonAncestorContainer.parentNode!==u&&h.commonAncestorContainer!==u||(f=h.startOffset,e=h.endOffset):i.selection&&i.selection.createRange&&(e=(f=0-(h=i.selection.createRange()).duplicate().moveStart("character",-u.inputmask._valueGet().length))+h.text.length),{begin:s?f:ei(f),end:s?e:ei(e)};(n.isArray(f)&&(e=g?f[0]:f[1],f=g?f[1]:f[0]),f.begin!==r&&(e=g?f.begin:f.end,f=g?f.end:f.begin),"number"==typeof f)&&(f=s?f:ei(f),e="number"==typeof(e=s?e:ei(e))?e:f,c=parseInt(((u.ownerDocument.defaultView||t).getComputedStyle?(u.ownerDocument.defaultView||t).getComputedStyle(u,null):u.currentStyle).fontSize)*e,(u.scrollLeft=c>u.scrollWidth?c:0,o||!1!==l.insertMode||f!==e||e++,u.inputmask.caretPos={begin:f,end:e},u.setSelectionRange)?(u.selectionStart=f,u.selectionEnd=e):t.getSelection?((h=i.createRange(),u.firstChild===r||null===u.firstChild)&&(v=i.createTextNode(""),u.appendChild(v)),h.setStart(u.firstChild,f<u.inputmask._valueGet().length?f:u.inputmask._valueGet().length),h.setEnd(u.firstChild,e<u.inputmask._valueGet().length?e:u.inputmask._valueGet().length),h.collapse(!0),a=t.getSelection(),a.removeAllRanges(),a.addRange(h)):u.createTextRange&&((h=u.createTextRange()).collapse(!0),h.moveEnd("character",e),h.moveStart("character",f),h.select()),ai(u,{begin:f,end:e}))}function ki(t){for(var u,h=wt(!0,b(),!0,!0),e=h.length,c=b(),o={},f=v().validPositions[c],l=f!==r?f.locator.slice():r,s,i=c+1;i<h.length;i++)l=(u=bt(i,l,i-1)).locator.slice(),o[i]=n.extend(!0,{},u);for(s=f&&f.alternation!==r?f.locator[f.alternation]:r,i=e-1;i>c&&((u=o[i]).match.optionality||u.match.optionalQuantifier&&u.match.newBlockMarker||s&&(s!==o[i].locator[f.alternation]&&null!=u.match.fn||null===u.match.fn&&u.locator[f.alternation]&&tr(u.locator[f.alternation].toString().split(","),s.toString().split(","))&&""!==ht(i)[0].def))&&h[i]===st(i,u.match);i--)e--;return t?{l:e,def:o[e]?o[e].match:r}:e}function dt(n){n.length=0;for(var t,i=wt(!0,0,!0,r,!0);(t=i.shift())!==r;)n.push(t);return n}function pt(t){var i,u;if(n.isFunction(l.isComplete))return l.isComplete(t,l);if("*"===l.repeat)return r;var e=!1,f=ki(!0),o=kt(f.l);if(f.def===r||f.def.newBlockMarker||f.def.optionality||f.def.optionalQuantifier)for(e=!0,i=0;i<=o;i++)if(u=bt(i).match,null!==u.fn&&v().validPositions[i]===r&&!0!==u.optionality&&!0!==u.optionalQuantifier||null===u.fn&&t[i]!==st(i,u)){e=!1;break}return e}function di(n,t,i,f,e){var h,o,c,s;if((l.numericInput||g)&&(t===u.keyCode.BACKSPACE?t=u.keyCode.DELETE:t===u.keyCode.DELETE&&(t=u.keyCode.BACKSPACE),g)&&(h=i.end,i.end=i.begin,i.begin=h),(t===u.keyCode.BACKSPACE&&(i.end-i.begin<1||!1===l.insertMode)?(i.begin=kt(i.begin),v().validPositions[i.begin]!==r&&v().validPositions[i.begin].input===l.groupSeparator&&i.begin--,!1===l.insertMode&&i.end!==v().maskLength&&i.end--):t===u.keyCode.DELETE&&i.begin===i.end&&(i.end=ot(i.end,!0)&&v().validPositions[i.end]&&v().validPositions[i.end].input!==l.radixPoint?i.end+1:d(i.end)+1,v().validPositions[i.begin]!==r&&v().validPositions[i.begin].input===l.groupSeparator&&i.end++),fi(i),!0!==f&&!1!==l.keepStatic||null!==l.regex)&&(o=ui(!0),o&&(c=o.caret!==r?o.caret:o.pos?d(o.pos.begin?o.pos.begin:o.pos):b(-1,!0),(t!==u.keyCode.DELETE||i.begin>c)&&i.begin)),s=b(i.begin,!0),s<i.begin||-1===i.begin)v().p=d(s);else if(!0!==f&&(v().p=i.begin,!0!==e))for(;v().p<s&&v().validPositions[v().p]===r;)v().p++}function gi(r){var u=(r.ownerDocument.defaultView||t).getComputedStyle(r,null),f=i.createElement("div");f.style.width=u.width;f.style.textAlign=u.textAlign;it=i.createElement("div");r.inputmask.colorMask=it;it.className="im-colormask";r.parentNode.insertBefore(it,r);r.parentNode.removeChild(r);it.appendChild(r);it.appendChild(f);r.style.left=f.offsetLeft+"px";n(it).on("mouseleave",function(n){return k.mouseleaveEvent.call(r,[n])});n(it).on("mouseenter",function(n){return k.mouseenterEvent.call(r,[n])});n(it).on("click",function(n){return w(r,function(n){var f,t=i.createElement("span"),e,h,o,s,c,l;for(e in u)isNaN(e)&&-1!==e.indexOf("font")&&(t.style[e]=u[e]);for(t.style.textTransform=u.textTransform,t.style.letterSpacing=u.letterSpacing,t.style.position="absolute",t.style.height="auto",t.style.width="auto",t.style.visibility="hidden",t.style.whiteSpace="nowrap",i.body.appendChild(t),o=r.inputmask._valueGet(),s=0,f=0,h=o.length;f<=h;f++){if(t.innerHTML+=o.charAt(f)||"_",t.offsetWidth>=n){c=n-s;l=t.offsetWidth-n;t.innerHTML=o.charAt(f);f=(c-=t.offsetWidth/3)<l?f-1:f;break}s=t.offsetWidth}return i.body.removeChild(t),f}(n.clientX)),k.clickEvent.call(r,[n])});n(r).on("keydown",function(n){n.shiftKey||!1===l.insertMode||setTimeout(function(){ai(r)},0)})}function ai(n,t,u){function a(n){if(n===r&&(n=""),h||null!==o.fn&&s.input!==r)if(h&&(null!==o.fn&&s.input!==r||""===o.def)){h=!1;var t=e.length;e[t-1]=e[t-1]+"<\/span>";e.push(n)}else e.push(n);else h=!0,e.push("<span class='im-static'>"+n)}var o,s,c,e=[],h=!1,f=0,d,y,k;if(it!==r){if(d=p(),t===r?t=w(n):t.begin===r&&(t={begin:t,end:t}),!0!==u){y=b();do v().validPositions[f]?(s=v().validPositions[f],o=s.match,c=s.locator.slice(),a(d[f])):(s=bt(f,c,f-1),o=s.match,c=s.locator.slice(),!1===l.jitMasking||f<y||"number"==typeof l.jitMasking&&isFinite(l.jitMasking)&&l.jitMasking>f?a(st(f,o)):h=!1),f++;while((lt===r||f<lt)&&(null!==o.fn||""!==o.def)||y>f||h);h&&a();i.activeElement===n&&(e.splice(t.begin,0,t.begin===t.end||t.end>v().maskLength?'<mark class="im-caret" style="border-right-width: 1px;border-right-style: solid;">':'<mark class="im-caret-select">'),e.splice(t.end+1,0,"<\/mark>"))}k=it.getElementsByTagName("div")[0];k.innerHTML=e.join("");n.inputmask.positionColorMask(n,k)}}var ct,nt,k,si;c=c||this.maskset;l=l||this.opts;var ft,gt,lt,it,at=this,y=this.el,g=this.isRTL,hi=!1,ni=!1,ti=!1,ii=!1;if(nt={on:function(t,i,f){var e=function(t){var i=this,c,e,a;if(i.inputmask===r&&"FORM"!==this.nodeName)c=n.data(i,"_inputmask_opts"),c?new u(c).mask(i):nt.off(i);else{if("setvalue"===t.type||"FORM"===this.nodeName||!(i.disabled||i.readOnly&&!("keydown"===t.type&&t.ctrlKey&&67===t.keyCode||!1===l.tabThrough&&t.keyCode===u.keyCode.TAB))){switch(t.type){case"input":if(!0===ni)return ni=!1,t.preventDefault();if(s)return e=arguments,setTimeout(function(){f.apply(i,e);w(i,i.inputmask.caretPos,r,!0)},0),!1;break;case"keydown":hi=!1;ni=!1;break;case"keypress":if(!0===hi)return t.preventDefault();hi=!0;break;case"click":if(h||o)return e=arguments,setTimeout(function(){f.apply(i,e)},0),!1}return a=f.apply(i,arguments),!1===a&&(t.preventDefault(),t.stopPropagation()),a}t.preventDefault()}};t.inputmask.events[i]=t.inputmask.events[i]||[];t.inputmask.events[i].push(e);-1!==n.inArray(i,["submit","reset"])?null!==t.form&&n(t.form).on(i,e):n(t).on(i,e)},off:function(t,i){var r;t.inputmask&&t.inputmask.events&&(i?(r=[])[i]=t.inputmask.events[i]:r=t.inputmask.events,n.each(r,function(i,r){for(;r.length>0;){var u=r.pop();-1!==n.inArray(i,["submit","reset"])?null!==t.form&&n(t.form).off(i,u):n(t).off(i,u)}delete t.inputmask.events[i]}))}},k={keydownEvent:function(t){var f=this,s=n(f),r=t.keyCode,i=w(f),e;r===u.keyCode.BACKSPACE||r===u.keyCode.DELETE||o&&r===u.keyCode.BACKSPACE_SAFARI||t.ctrlKey&&r===u.keyCode.X&&!a("cut")?(t.preventDefault(),di(f,r,i),ut(f,p(!0),v().p,t,f.inputmask._valueGet()!==p().join(""))):r===u.keyCode.END||r===u.keyCode.PAGE_DOWN?(t.preventDefault(),e=d(b()),l.insertMode||e!==v().maskLength||t.shiftKey||e--,w(f,t.shiftKey?i.begin:e,e,!0)):r===u.keyCode.HOME&&!t.shiftKey||r===u.keyCode.PAGE_UP?(t.preventDefault(),w(f,0,t.shiftKey?i.begin:0,!0)):(l.undoOnEscape&&r===u.keyCode.ESCAPE||90===r&&t.ctrlKey)&&!0!==t.altKey?(yt(f,!0,!1,ft.split("")),s.trigger("click")):r!==u.keyCode.INSERT||t.shiftKey||t.ctrlKey?!0===l.tabThrough&&r===u.keyCode.TAB?(!0===t.shiftKey?(null===tt(i.begin).match.fn&&(i.begin=d(i.begin)),i.end=kt(i.begin,!0),i.begin=kt(i.end,!0)):(i.begin=d(i.begin,!0),i.end=d(i.begin,!0),i.end<v().maskLength&&i.end--),i.begin<v().maskLength&&(t.preventDefault(),w(f,i.begin,i.end))):t.shiftKey||!1===l.insertMode&&(r===u.keyCode.RIGHT?setTimeout(function(){var n=w(f);w(f,n.begin)},0):r===u.keyCode.LEFT&&setTimeout(function(){var n=w(f);w(f,g?n.begin+1:n.begin-1)},0)):(l.insertMode=!l.insertMode,w(f,l.insertMode||i.begin!==v().maskLength?i.begin:i.begin-1));l.onKeyDown.call(this,t,p(),w(f).begin,l);ti=-1!==n.inArray(r,l.ignorables)},keypressEvent:function(t,i,f,e,o){var a=this,nt=n(a),h=t.which||t.charCode||t.keyCode,k,s,g;if(!(!0===i||t.ctrlKey&&t.altKey)&&(t.ctrlKey||t.metaKey||ti))return h===u.keyCode.ENTER&&ft!==p().join("")&&(ft=p().join(""),setTimeout(function(){nt.trigger("change")},0)),!0;if(h){46===h&&!1===t.shiftKey&&""!==l.radixPoint&&(h=l.radixPoint.charCodeAt(0));var c,y=i?{begin:o,end:o}:w(a),tt=String.fromCharCode(h),b=0;if(l._radixDance&&l.numericInput&&(k=p().indexOf(l.radixPoint.charAt(0))+1,y.begin<=k&&(h===l.radixPoint.charCodeAt(0)&&(b=1),y.begin-=1,y.end-=1)),v().writeOutBuffer=!0,s=vt(y,tt,e),(!1!==s&&(et(!0),c=s.caret!==r?s.caret:d(s.pos.begin?s.pos.begin:s.pos),v().p=c),c=(l.numericInput&&s.caret===r?kt(c):c)+b,!1!==f&&(setTimeout(function(){l.onKeyValidation.call(a,h,s,l)},0),v().writeOutBuffer&&!1!==s))&&(g=p(),ut(a,g,c,t,!0!==i)),t.preventDefault(),i)return!1!==s&&(s.forwardPosition=c),s}},pasteEvent:function(i){var c,f=this,h=i.originalEvent||i,r=(n(f),f.inputmask._valueGet(!0)),u=w(f),e,o,s;if(g&&(c=u.end,u.end=u.begin,u.begin=c),e=r.substr(0,u.begin),o=r.substr(u.end,r.length),e===(g?rt().reverse():rt()).slice(0,u.begin).join("")&&(e=""),o===(g?rt().reverse():rt()).slice(u.end).join("")&&(o=""),t.clipboardData&&t.clipboardData.getData)r=e+t.clipboardData.getData("Text")+o;else{if(!h.clipboardData||!h.clipboardData.getData)return!0;r=e+h.clipboardData.getData("text/plain")+o}if(s=r,n.isFunction(l.onBeforePaste)){if(!1===(s=l.onBeforePaste.call(at,r,l)))return i.preventDefault();s||(s=r)}return yt(f,!1,!1,s.toString().split("")),ut(f,p(),d(b()),i,ft!==p().join("")),i.preventDefault()},inputFallBackEvent:function(t){var c,nt,r=this,f=r.inputmask._valueGet(),e,ft,s,rt;if(p().join("")!==f&&(e=w(r),nt=e,"."===(c=f).charAt(nt.begin-1)&&""!==l.radixPoint&&((c=c.split(""))[nt.begin-1]=l.radixPoint.charAt(0),c=c.join("")),f=function(n,t,i){var r,u;return h&&(r=t.replace(p().join(""),""),1===r.length&&(u=t.split(""),u.splice(i.begin,0,r),t=u.join(""))),t}(0,f=c,e),p().join("")!==f)){var tt=p().join(""),a=!l.numericInput&&f.length>tt.length?-1:0,v=f.substr(0,e.begin),y=f.substr(e.begin),d=tt.substr(0,e.begin+a),g=tt.substr(e.begin+a),i=e,b="",it=!1;if(v!==d){for(ft=(it=v.length>=d.length)?v.length:d.length,s=0;v.charAt(s)===d.charAt(s)&&s<ft;s++);it&&(0===a&&(i.begin=s),b+=v.slice(s,i.end))}(y!==g&&(y.length>g.length?b+=y.slice(0,1):y.length<g.length&&(i.end+=g.length-y.length,it||""===l.radixPoint||""!==y||v.charAt(i.begin+a-1)!==l.radixPoint||(i.begin--,b=l.radixPoint))),ut(r,p(),{begin:i.begin+a,end:i.end+a}),b.length>0)?n.each(b.split(""),function(t,i){var u=new n.Event("keypress");u.which=i.charCodeAt(0);ti=!1;k.keypressEvent.call(r,u)}):(i.begin===i.end-1&&(i.begin=kt(i.begin+1),i.begin===i.end-1?w(r,i.begin):w(r,i.begin,i.end)),rt=new n.Event("keydown"),rt.keyCode=l.numericInput?u.keyCode.BACKSPACE:u.keyCode.DELETE,k.keydownEvent.call(r,rt),o||!1!==l.insertMode||w(r,w(r).begin-1));t.preventDefault()}},beforeInputEvent:function(t){var i,r;if(t.cancelable){i=this;switch(t.inputType){case"insertText":return n.each(t.data.split(""),function(t,r){var u=new n.Event("keypress");u.which=r.charCodeAt(0);ti=!1;k.keypressEvent.call(i,u)}),t.preventDefault();case"deleteContentBackward":return(r=new n.Event("keydown")).keyCode=u.keyCode.BACKSPACE,k.keydownEvent.call(i,r),t.preventDefault();case"deleteContentForward":return(r=new n.Event("keydown")).keyCode=u.keyCode.DELETE,k.keydownEvent.call(i,r),t.preventDefault()}}},setValueEvent:function(t){this.inputmask.refreshValue=!1;var i=(i=t&&t.detail?t.detail[0]:arguments[1])||this.inputmask._valueGet(!0);n.isFunction(l.onBeforeMask)&&(i=l.onBeforeMask.call(at,i,l)||i);yt(this,!0,!1,i=i.split(""));ft=p().join("");(l.clearMaskOnLostFocus||l.clearIncomplete)&&this.inputmask._valueGet()===rt().join("")&&this.inputmask._valueSet("")},focusEvent:function(n){var t=this,i=t.inputmask._valueGet();l.showMaskOnFocus&&(!l.showMaskOnHover||l.showMaskOnHover&&""===i)&&(t.inputmask._valueGet()!==p().join("")?ut(t,p(),d(b())):!1===ii&&w(t,d(b())));!0===l.positionCaretOnTab&&!1===ii&&k.clickEvent.apply(t,[n,!0]);ft=p().join("")},mouseleaveEvent:function(){if(ii=!1,l.clearMaskOnLostFocus&&i.activeElement!==this){var n=p().slice(),t=this.inputmask._valueGet();t!==this.getAttribute("placeholder")&&""!==t&&(-1===b()&&t===rt().join("")?n=[]:dt(n),ut(this,n))}},clickEvent:function(t,u){var f=this;setTimeout(function(){var t,h,y;if(i.activeElement===f&&(t=w(f),u&&(g?t.end=t.begin:t.begin=t.end),t.begin===t.end))switch(l.positionCaretOnClick){case"none":break;case"select":w(f,0,p().length);break;case"ignore":w(f,d(b()));break;case"radixFocus":if(function(t){var i,f,u;if(""!==l.radixPoint&&(i=v().validPositions,i[t]===r||i[t].input===st(t))){if(t<d(-1))return!0;if(f=n.inArray(l.radixPoint,p()),-1!==f){for(u in i)if(f<u&&i[u].input!==st(u))return!1;return!0}}return!1}(t.begin)){h=p().join("").indexOf(l.radixPoint);w(f,l.numericInput?d(h):h);break}default:var o=t.begin,k=b(o,!0),e=d(k);if(o<e)w(f,ot(o,!0)||ot(o-1,!0)?o:d(o));else{var c=v().validPositions[k],s=bt(e,c?c.match.locator:r,c),a=st(e,s.match);(""===a||p()[e]===a||!0===s.match.optionalQuantifier||!0===s.match.newBlockMarker)&&(ot(e,l.keepStatic)||s.match.def!==a)||(y=d(e),(o>=y||o===e)&&(e=y));w(f,e)}}},0)},cutEvent:function(r){n(this);var f=w(this),o=r.originalEvent||r,s=t.clipboardData||o.clipboardData,e=g?p().slice(f.end,f.begin):p().slice(f.begin,f.end);s.setData("text",g?e.reverse().join(""):e.join(""));i.execCommand&&i.execCommand("copy");di(this,u.keyCode.DELETE,f);ut(this,p(),v().p,r,ft!==p().join(""))},blurEvent:function(t){var f=n(this),u,i;this.inputmask&&(u=this.inputmask._valueGet(),i=p().slice(),""===u&&it===r||(l.clearMaskOnLostFocus&&(-1===b()&&u===rt().join("")?i=[]:dt(i)),!1===pt(i)&&(setTimeout(function(){f.trigger("incomplete")},0),l.clearIncomplete&&(et(),i=l.clearMaskOnLostFocus?[]:rt().slice())),ut(this,i,r,t)),ft!==p().join("")&&(ft=i.join(""),f.trigger("change")))},mouseenterEvent:function(){ii=!0;i.activeElement!==this&&l.showMaskOnHover&&this.inputmask._valueGet()!==p().join("")&&ut(this,p())},submitEvent:function(){ft!==p().join("")&&gt.trigger("change");l.clearMaskOnLostFocus&&-1===b()&&y.inputmask._valueGet&&y.inputmask._valueGet()===rt().join("")&&y.inputmask._valueSet("");l.clearIncomplete&&!1===pt(p())&&y.inputmask._valueSet("");l.removeMaskOnSubmit&&(y.inputmask._valueSet(y.inputmask.unmaskedvalue(),!0),setTimeout(function(){ut(y,p())},0))},resetEvent:function(){y.inputmask.refreshValue=!0;setTimeout(function(){gt.trigger("setvalue")},0)}},u.prototype.positionColorMask=function(n,t){n.style.left=t.offsetLeft+"px"},e!==r)switch(e.action){case"isComplete":return y=e.el,pt(p());case"unmaskedvalue":return y!==r&&e.value===r||(ct=e.value,ct=(n.isFunction(l.onBeforeMask)&&l.onBeforeMask.call(at,ct,l)||ct).split(""),yt.call(this,r,!1,!1,ct),n.isFunction(l.onBeforeWrite)&&l.onBeforeWrite.call(at,r,p(),0,l)),bi(y);case"mask":!function(t){var f,e,u;nt.off(t);f=function(t,u){var o=t.getAttribute("type"),f="INPUT"===t.tagName&&-1!==n.inArray(o,u.supportsInputType)||t.isContentEditable||"TEXTAREA"===t.tagName,e;return f||("INPUT"===t.tagName?(e=i.createElement("input"),e.setAttribute("type",o),f="text"===e.type,e=null):f="partial"),!1!==f?function(t){function s(){return this.inputmask?this.inputmask.opts.autoUnmask?this.inputmask.unmaskedvalue():-1!==b()||!0!==u.nullable?i.activeElement===this&&u.clearMaskOnLostFocus?(g?dt(p().slice()).reverse():dt(p().slice())).join(""):f.call(this):"":f.call(this)}function h(t){e.call(this,t);this.inputmask&&n(this).trigger("setvalue",[t])}var f,e,c,o;t.inputmask.__valueGet||(!0!==u.noValuePatching&&(Object.getOwnPropertyDescriptor?("function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="object"==typeof"test".__proto__?function(n){return n.__proto__}:function(n){return n.constructor.prototype}),o=Object.getPrototypeOf?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),"value"):r,o&&o.get&&o.set?(f=o.get,e=o.set,Object.defineProperty(t,"value",{get:s,set:h,configurable:!0})):"INPUT"!==t.tagName&&(f=function(){return this.textContent},e=function(n){this.textContent=n},Object.defineProperty(t,"value",{get:s,set:h,configurable:!0}))):i.__lookupGetter__&&t.__lookupGetter__("value")&&(f=t.__lookupGetter__("value"),e=t.__lookupSetter__("value"),t.__defineGetter__("value",s),t.__defineSetter__("value",h)),t.inputmask.__valueGet=f,t.inputmask.__valueSet=e),t.inputmask._valueGet=function(n){return g&&!0!==n?f.call(this.el).split("").reverse().join(""):f.call(this.el)},t.inputmask._valueSet=function(n,t){e.call(this.el,null===n||n===r?"":!0!==t&&g?n.split("").reverse().join(""):n)},f===r&&(f=function(){return this.value},e=function(n){this.value=n},function(t){if(n.valHooks&&(n.valHooks[t]===r||!0!==n.valHooks[t].inputmaskpatch)){var i=n.valHooks[t]&&n.valHooks[t].get?n.valHooks[t].get:function(n){return n.value},f=n.valHooks[t]&&n.valHooks[t].set?n.valHooks[t].set:function(n,t){return n.value=t,n};n.valHooks[t]={get:function(n){if(n.inputmask){if(n.inputmask.opts.autoUnmask)return n.inputmask.unmaskedvalue();var t=i(n);return-1!==b(r,r,n.inputmask.maskset.validPositions)||!0!==u.nullable?t:""}return i(n)},set:function(t,i){var r,u=n(t);return r=f(t,i),t.inputmask&&u.trigger("setvalue",[i]),r},inputmaskpatch:!0}}}(t.type),c=t,nt.on(c,"mouseenter",function(){var t=n(this);this.inputmask._valueGet()!==p().join("")&&t.trigger("setvalue")})))}(t):t.inputmask=r,f}(t,l);!1!==f&&(gt=n(y=t),-1===(lt=y!==r?y.maxLength:r)&&(lt=r),!0===l.colorMask&&gi(y),s&&("inputmode"in y&&(y.inputmode=l.inputmode,y.setAttribute("inputmode",l.inputmode)),!0===l.disablePredictiveText&&("autocorrect"in y?y.autocorrect=!1:(!0!==l.colorMask&&gi(y),y.type="password"))),!0===f&&(nt.on(y,"submit",k.submitEvent),nt.on(y,"reset",k.resetEvent),nt.on(y,"blur",k.blurEvent),nt.on(y,"focus",k.focusEvent),!0!==l.colorMask&&(nt.on(y,"click",k.clickEvent),nt.on(y,"mouseleave",k.mouseleaveEvent),nt.on(y,"mouseenter",k.mouseenterEvent)),nt.on(y,"paste",k.pasteEvent),nt.on(y,"cut",k.cutEvent),nt.on(y,"complete",l.oncomplete),nt.on(y,"incomplete",l.onincomplete),nt.on(y,"cleared",l.oncleared),s||!0===l.inputEventOnly?y.removeAttribute("maxLength"):(nt.on(y,"keydown",k.keydownEvent),nt.on(y,"keypress",k.keypressEvent)),nt.on(y,"input",k.inputFallBackEvent),nt.on(y,"beforeinput",k.beforeInputEvent)),nt.on(y,"setvalue",k.setValueEvent),ft=rt().join(""),""!==y.inputmask._valueGet(!0)||!1===l.clearMaskOnLostFocus||i.activeElement===y)&&(e=n.isFunction(l.onBeforeMask)&&l.onBeforeMask.call(at,y.inputmask._valueGet(!0),l)||y.inputmask._valueGet(!0),""!==e&&yt(y,!0,!1,e.split("")),u=p().slice(),ft=u.join(""),!1===pt(u)&&l.clearIncomplete&&et(),l.clearMaskOnLostFocus&&i.activeElement!==y&&(-1===b()?u=[]:dt(u)),(!1===l.clearMaskOnLostFocus||l.showMaskOnFocus&&i.activeElement===y||""!==y.inputmask._valueGet(!0))&&ut(y,u),i.activeElement===y&&w(y,d(b())))}(y);break;case"format":return ct=(n.isFunction(l.onBeforeMask)&&l.onBeforeMask.call(at,e.value,l)||e.value).split(""),yt.call(this,r,!0,!1,ct),e.metadata?{value:g?p().slice().reverse().join(""):p().join(""),metadata:f.call(this,{action:"getmetadata"},c,l)}:g?p().slice().reverse().join(""):p().join("");case"isValid":e.value?(ct=e.value.split(""),yt.call(this,r,!0,!0,ct)):e.value=p().join("");for(var vi=p(),yi=ki(),oi=vi.length-1;oi>yi&&!ot(oi);oi--);return vi.splice(yi,oi+1-yi),pt(vi)&&e.value===p().join("");case"getemptymask":return rt().join("");case"remove":return y&&y.inputmask&&(n.data(y,"_inputmask_opts",null),gt=n(y),y.inputmask._valueSet(l.autoUnmask?bi(y):y.inputmask._valueGet(!0)),nt.off(y),y.inputmask.colorMask&&((it=y.inputmask.colorMask).removeChild(y),it.parentNode.insertBefore(y,it),it.parentNode.removeChild(it)),Object.getOwnPropertyDescriptor&&Object.getPrototypeOf?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(y),"value")&&y.inputmask.__valueGet&&Object.defineProperty(y,"value",{get:y.inputmask.__valueGet,set:y.inputmask.__valueSet,configurable:!0}):i.__lookupGetter__&&y.__lookupGetter__("value")&&y.inputmask.__valueGet&&(y.__defineGetter__("value",y.inputmask.__valueGet),y.__defineSetter__("value",y.inputmask.__valueSet)),y.inputmask=r),y;case"getmetadata":return n.isArray(c.metadata)?(si=wt(!0,0,!1).join(""),n.each(c.metadata,function(n,t){if(t.mask===si)return si=t,!1}),si):c.metadata}}var l=navigator.userAgent,s=a("touchstart"),h=/iemobile/i.test(l),o=/iphone/i.test(l)&&!h;return u.prototype={dataAttribute:"data-inputmask",defaults:{placeholder:"_",optionalmarker:["[","]"],quantifiermarker:["{","}"],groupmarker:["(",")"],alternatormarker:"|",escapeChar:"\\",mask:null,regex:null,oncomplete:n.noop,onincomplete:n.noop,oncleared:n.noop,repeat:0,greedy:!1,autoUnmask:!1,removeMaskOnSubmit:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,alias:null,onKeyDown:n.noop,onBeforeMask:null,onBeforePaste:function(t,i){return n.isFunction(i.onBeforeMask)?i.onBeforeMask.call(this,t,i):t},onBeforeWrite:null,onUnMask:null,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:n.noop,skipOptionalPartCharacter:" ",numericInput:!1,rightAlign:!1,undoOnEscape:!0,radixPoint:"",_radixDance:!1,groupSeparator:"",keepStatic:null,positionCaretOnTab:!0,tabThrough:!1,supportsInputType:["text","tel","password","search"],ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123,0,229],isComplete:null,preValidation:null,postValidation:null,staticDefinitionSymbol:r,jitMasking:!1,nullable:!0,inputEventOnly:!1,noValuePatching:!1,positionCaretOnClick:"lvp",casing:null,inputmode:"verbatim",colorMask:!1,disablePredictiveText:!1,importDataAttributes:!0},definitions:{9:{validator:"[0-9１-９]",definitionSymbol:"*"},a:{validator:"[A-Za-zА-яЁёÀ-ÿµ]",definitionSymbol:"*"},"*":{validator:"[0-9１-９A-Za-zА-яЁёÀ-ÿµ]"}},aliases:{},masksCache:{},mask:function(o){var s=this;return"string"==typeof o&&(o=i.getElementById(o)||i.querySelectorAll(o)),o=o.nodeName?[o]:o,n.each(o,function(i,o){var h=n.extend(!0,{},s.opts),l;(function(i,u,f,e){if(!0===u.importDataAttributes){var a,o,s,h,l=i.getAttribute(e);function n(n,u){null!==(u=u!==r?u:i.getAttribute(e+"-"+n))&&("string"==typeof u&&(0===n.indexOf("on")?u=t[u]:"false"===u?u=!1:"true"===u&&(u=!0)),f[n]=u)}if(l&&""!==l&&(l=l.replace(/'/g,'"'),o=JSON.parse("{"+l+"}")),o)for(h in s=r,o)if("alias"===h.toLowerCase()){s=o[h];break}for(a in n("alias",s),f.alias&&c(f.alias,f,u),u){if(o)for(h in s=r,o)if(h.toLowerCase()===a.toLowerCase()){s=o[h];break}n(a,s)}}return n.extend(!0,u,f),("rtl"===i.dir||u.rightAlign)&&(i.style.textAlign="right"),("rtl"===i.dir||u.numericInput)&&(i.dir="ltr",i.removeAttribute("dir"),u.isRTL=!0),Object.keys(f).length})(o,h,n.extend(!0,{},s.userOptions),s.dataAttribute)&&(l=e(h,s.noMasksCache),l!==r&&(o.inputmask!==r&&(o.inputmask.opts.autoUnmask=!0,o.inputmask.remove()),o.inputmask=new u(r,r,!0),o.inputmask.opts=h,o.inputmask.noMasksCache=s.noMasksCache,o.inputmask.userOptions=n.extend(!0,{},s.userOptions),o.inputmask.isRTL=h.isRTL||h.numericInput,o.inputmask.el=o,o.inputmask.maskset=l,n.data(o,"_inputmask_opts",h),f.call(o.inputmask,{action:"mask"})))}),o&&o[0]&&o[0].inputmask||this},option:function(t,i){return"string"==typeof t?this.opts[t]:"object"==typeof t?(n.extend(this.userOptions,t),this.el&&!0!==i&&this.mask(this.el),this):void 0},unmaskedvalue:function(n){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"unmaskedvalue",value:n})},remove:function(){return f.call(this,{action:"remove"})},getemptymask:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"getemptymask"})},hasMaskedValue:function(){return!this.opts.autoUnmask},isComplete:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"isComplete"})},getmetadata:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"getmetadata"})},isValid:function(n){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"isValid",value:n})},format:function(n,t){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"format",value:n,metadata:t})},setValue:function(t){this.el&&n(this.el).trigger("setvalue",[t])},analyseMask:function(t,i,f){function p(n,t,i,r){this.matches=[];this.openGroup=n||!1;this.alternatorGroup=!1;this.isGroup=n||!1;this.isOptional=t||!1;this.isQuantifier=i||!1;this.isAlternator=r||!1;this.quantifier={min:1,max:1}}function g(t,e,o){var s,h;o=o!==r?o:t.matches.length;s=t.matches[o-1];i?(0===e.indexOf("[")||v&&/\\d|\\s|\\w]/i.test(e)||"."===e?t.matches.splice(o++,0,{fn:new RegExp(e,f.casing?"i":""),optionality:!1,newBlockMarker:s===r?"master":s.def!==e,casing:null,def:e,placeholder:r,nativeDef:e}):(v&&(e=e[e.length-1]),n.each(e.split(""),function(n,i){s=t.matches[o-1];t.matches.splice(o++,0,{fn:null,optionality:!1,newBlockMarker:s===r?"master":s.def!==i&&null!==s.fn,casing:null,def:f.staticDefinitionSymbol||i,placeholder:f.staticDefinitionSymbol!==r?i:r,nativeDef:(v?"'":"")+i})})),v=!1):(h=(f.definitions?f.definitions[e]:r)||u.prototype.definitions[e],h&&!v?t.matches.splice(o++,0,{fn:h.validator?"string"==typeof h.validator?new RegExp(h.validator,f.casing?"i":""):new function(){this.test=h.validator}:new RegExp("."),optionality:!1,newBlockMarker:s===r?"master":s.def!==(h.definitionSymbol||e),casing:h.casing,def:h.definitionSymbol||e,placeholder:h.placeholder,nativeDef:e}):(t.matches.splice(o++,0,{fn:null,optionality:!1,newBlockMarker:s===r?"master":s.def!==e&&null!==s.fn,casing:null,def:f.staticDefinitionSymbol||e,placeholder:f.staticDefinitionSymbol!==r?e:r,nativeDef:(v?"'":"")+e}),v=!1))}function nt(){if(e.length>0){if(g(c=e[e.length-1],h),c.isAlternator){o=e.pop();for(var n=0;n<o.matches.length;n++)o.matches[n].isGroup&&(o.matches[n].isGroup=!1);e.length>0?(c=e[e.length-1]).matches.push(o):l.matches.push(o)}}else g(l,h)}function ft(n){var t=new p(!0);return t.openGroup=!1,t.matches=n,t}var s,h,b,c,o,a,ct=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?(?:\|[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g,lt=/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,v=!1,l=new p,e=[],it=[],k,y,rt,ht,tt,ut;for(i&&(f.optionalmarker[0]=r,f.optionalmarker[1]=r);s=i?lt.exec(t):ct.exec(t);){if(h=s[0],i)switch(h.charAt(0)){case"?":h="{0,1}";break;case"+":case"*":h="{"+h+"}"}if(v)nt();else switch(h.charAt(0)){case"(?=":case"(?!":case"(?<=":case"(?<!":break;case f.escapeChar:v=!0;i&&nt();break;case f.optionalmarker[1]:case f.groupmarker[1]:if((b=e.pop()).openGroup=!1,b!==r)if(e.length>0){if((c=e[e.length-1]).matches.push(b),c.isAlternator){for(o=e.pop(),k=0;k<o.matches.length;k++)o.matches[k].isGroup=!1,o.matches[k].alternatorGroup=!1;e.length>0?(c=e[e.length-1]).matches.push(o):l.matches.push(o)}}else l.matches.push(b);else nt();break;case f.optionalmarker[0]:e.push(new p(!1,!0));break;case f.groupmarker[0]:e.push(new p(!0));break;case f.quantifiermarker[0]:var et=new p(!1,!1,!0),ot=(h=h.replace(/[{}]/g,"")).split("|"),w=ot[0].split(","),d=isNaN(w[0])?w[0]:parseInt(w[0]),st=1===w.length?d:isNaN(w[1])?w[1]:parseInt(w[1]);"*"!==d&&"+"!==d||(d="*"===st?0:1);et.quantifier={min:d,max:st,jit:ot[1]};y=e.length>0?e[e.length-1].matches:l.matches;(s=y.pop()).isAlternator&&(y.push(s),y=s.matches,rt=new p(!0),ht=y.pop(),y.push(rt),y=rt.matches,s=ht);s.isGroup||(s=ft([s]));y.push(s);y.push(et);break;case f.alternatormarker:function n(n){var t=n.pop();return t.isQuantifier&&(t=ft([n.pop(),t])),t}e.length>0?(tt=(c=e[e.length-1]).matches[c.matches.length-1],a=c.openGroup&&(tt.matches===r||!1===tt.isGroup&&!1===tt.isAlternator)?e.pop():n(c.matches)):a=n(l.matches);a.isAlternator?e.push(a):(a.alternatorGroup?(o=e.pop(),a.alternatorGroup=!1):o=new p(!1,!1,!1,!0),o.matches.push(a),e.push(o),a.openGroup)&&(a.openGroup=!1,ut=new p(!0),ut.alternatorGroup=!0,e.push(ut));break;default:nt()}}for(;e.length>0;)b=e.pop(),l.matches.push(b);return l.matches.length>0&&(!function t(u){u&&u.matches&&n.each(u.matches,function(n,e){var o=u.matches[n+1];(o===r||o.matches===r||!1===o.isQuantifier)&&e&&e.isGroup&&(e.isGroup=!1,i||(g(e,f.groupmarker[0],0),!0!==e.openGroup&&g(e,f.groupmarker[1])));t(e)})}(l),it.push(l)),(f.numericInput||f.isRTL)&&function n(t){var i,e,o,u;for(i in t.matches=t.matches.reverse(),t.matches)t.matches.hasOwnProperty(i)&&(e=parseInt(i),t.matches[i].isQuantifier&&t.matches[e+1]&&t.matches[e+1].isGroup&&(o=t.matches[i],t.matches.splice(i,1),t.matches.splice(e+1,0,o)),t.matches[i]=t.matches[i].matches!==r?n(t.matches[i]):((u=t.matches[i])===f.optionalmarker[0]?u=f.optionalmarker[1]:u===f.optionalmarker[1]?u=f.optionalmarker[0]:u===f.groupmarker[0]?u=f.groupmarker[1]:u===f.groupmarker[1]&&(u=f.groupmarker[0]),u));return t}(it[0]),it}},u.extendDefaults=function(t){n.extend(!0,u.prototype.defaults,t)},u.extendDefinitions=function(t){n.extend(!0,u.prototype.definitions,t)},u.extendAliases=function(t){n.extend(!0,u.prototype.aliases,t)},u.format=function(n,t,i){return u(t).format(n,i)},u.unmask=function(n,t){return u(t).unmaskedvalue(n)},u.isValid=function(n,t){return u(t).isValid(n)},u.remove=function(t){"string"==typeof t&&(t=i.getElementById(t)||i.querySelectorAll(t));t=t.nodeName?[t]:t;n.each(t,function(n,t){t.inputmask&&t.inputmask.remove()})},u.setValue=function(t,r){"string"==typeof t&&(t=i.getElementById(t)||i.querySelectorAll(t));t=t.nodeName?[t]:t;n.each(t,function(t,i){i.inputmask?i.inputmask.setValue(r):n(i).trigger("setvalue",[r])})},u.escapeRegex=function(n){return n.replace(new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)","gim"),"\\$1")},u.keyCode={BACKSPACE:8,BACKSPACE_SAFARI:127,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,SPACE:32,TAB:9,UP:38,X:88,CONTROL:17},u})