jquery.inputmask.bundle.js 207 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973
  1. /*!
  2. * jquery.inputmask.bundle.js
  3. * https://github.com/RobinHerbots/Inputmask
  4. * Copyright (c) 2010 - 2017 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 4.0.1-1
  7. */
  8. !function(modules) {
  9. function __webpack_require__(moduleId) {
  10. if (installedModules[moduleId]) return installedModules[moduleId].exports;
  11. var module = installedModules[moduleId] = {
  12. i: moduleId,
  13. l: !1,
  14. exports: {}
  15. };
  16. return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__),
  17. module.l = !0, module.exports;
  18. }
  19. var installedModules = {};
  20. __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.i = function(value) {
  21. return value;
  22. }, __webpack_require__.d = function(exports, name, getter) {
  23. __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {
  24. configurable: !1,
  25. enumerable: !0,
  26. get: getter
  27. });
  28. }, __webpack_require__.n = function(module) {
  29. var getter = module && module.__esModule ? function() {
  30. return module.default;
  31. } : function() {
  32. return module;
  33. };
  34. return __webpack_require__.d(getter, "a", getter), getter;
  35. }, __webpack_require__.o = function(object, property) {
  36. return Object.prototype.hasOwnProperty.call(object, property);
  37. }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 9);
  38. }([ function(module, exports, __webpack_require__) {
  39. "use strict";
  40. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  41. "function" == typeof Symbol && Symbol.iterator;
  42. !function(factory) {
  43. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2) ], __WEBPACK_AMD_DEFINE_FACTORY__ = factory,
  44. void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  45. }(function($) {
  46. return $;
  47. });
  48. }, function(module, exports, __webpack_require__) {
  49. "use strict";
  50. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__, _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  51. return typeof obj;
  52. } : function(obj) {
  53. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  54. };
  55. !function(factory) {
  56. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(11), __webpack_require__(10) ],
  57. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  58. }(function($, window, document, undefined) {
  59. function Inputmask(alias, options, internal) {
  60. if (!(this instanceof Inputmask)) return new Inputmask(alias, options, internal);
  61. this.el = undefined, this.events = {}, this.maskset = undefined, this.refreshValue = !1,
  62. !0 !== internal && ($.isPlainObject(alias) ? options = alias : (options = options || {},
  63. options.alias = alias), this.opts = $.extend(!0, {}, this.defaults, options), this.noMasksCache = options && options.definitions !== undefined,
  64. this.userOptions = options || {}, this.isRTL = this.opts.numericInput, resolveAlias(this.opts.alias, options, this.opts));
  65. }
  66. function resolveAlias(aliasStr, options, opts) {
  67. var aliasDefinition = Inputmask.prototype.aliases[aliasStr];
  68. return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, undefined, opts),
  69. $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : (null === opts.mask && (opts.mask = aliasStr),
  70. !1);
  71. }
  72. function generateMaskSet(opts, nocache) {
  73. function generateMask(mask, metadata, opts) {
  74. var regexMask = !1;
  75. if (null !== mask && "" !== mask || (regexMask = null !== opts.regex, regexMask ? (mask = opts.regex,
  76. mask = mask.replace(/^(\^)(.*)(\$)$/, "$2")) : (regexMask = !0, mask = ".*")), 1 === mask.length && !1 === opts.greedy && 0 !== opts.repeat && (opts.placeholder = ""),
  77. opts.repeat > 0 || "*" === opts.repeat || "+" === opts.repeat) {
  78. var repeatStart = "*" === opts.repeat ? 0 : "+" === opts.repeat ? 1 : opts.repeat;
  79. mask = opts.groupmarker.start + mask + opts.groupmarker.end + opts.quantifiermarker.start + repeatStart + "," + opts.repeat + opts.quantifiermarker.end;
  80. }
  81. var masksetDefinition, maskdefKey = regexMask ? "regex_" + opts.regex : opts.numericInput ? mask.split("").reverse().join("") : mask;
  82. return Inputmask.prototype.masksCache[maskdefKey] === undefined || !0 === nocache ? (masksetDefinition = {
  83. mask: mask,
  84. maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),
  85. validPositions: {},
  86. _buffer: undefined,
  87. buffer: undefined,
  88. tests: {},
  89. metadata: metadata,
  90. maskLength: undefined
  91. }, !0 !== nocache && (Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition,
  92. masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]))) : masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]),
  93. masksetDefinition;
  94. }
  95. if ($.isFunction(opts.mask) && (opts.mask = opts.mask(opts)), $.isArray(opts.mask)) {
  96. if (opts.mask.length > 1) {
  97. opts.keepStatic = null === opts.keepStatic || opts.keepStatic;
  98. var altMask = opts.groupmarker.start;
  99. return $.each(opts.numericInput ? opts.mask.reverse() : opts.mask, function(ndx, msk) {
  100. altMask.length > 1 && (altMask += opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start),
  101. msk.mask === undefined || $.isFunction(msk.mask) ? altMask += msk : altMask += msk.mask;
  102. }), altMask += opts.groupmarker.end, generateMask(altMask, opts.mask, opts);
  103. }
  104. opts.mask = opts.mask.pop();
  105. }
  106. return opts.mask && opts.mask.mask !== undefined && !$.isFunction(opts.mask.mask) ? generateMask(opts.mask.mask, opts.mask, opts) : generateMask(opts.mask, opts.mask, opts);
  107. }
  108. function maskScope(actionObj, maskset, opts) {
  109. function getMaskTemplate(baseOnInput, minimalPos, includeMode) {
  110. minimalPos = minimalPos || 0;
  111. var ndxIntlzr, test, testPos, maskTemplate = [], pos = 0, lvp = getLastValidPosition();
  112. -1 === (maxLength = el !== undefined ? el.maxLength : undefined) && (maxLength = undefined);
  113. do {
  114. !0 === baseOnInput && getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos],
  115. test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(!0 === includeMode ? testPos.input : !1 === includeMode ? test.nativeDef : getPlaceholder(pos, test))) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
  116. test = testPos.match, ndxIntlzr = testPos.locator.slice(), (!1 === opts.jitMasking || pos < lvp || "number" == typeof opts.jitMasking && isFinite(opts.jitMasking) && opts.jitMasking > pos) && maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder(pos, test))),
  117. pos++;
  118. } while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || "" !== test.def) || minimalPos > pos);
  119. return "" === maskTemplate[maskTemplate.length - 1] && maskTemplate.pop(), getMaskSet().maskLength = pos + 1,
  120. maskTemplate;
  121. }
  122. function getMaskSet() {
  123. return maskset;
  124. }
  125. function resetMaskSet(soft) {
  126. var maskset = getMaskSet();
  127. maskset.buffer = undefined, !0 !== soft && (maskset.validPositions = {}, maskset.p = 0);
  128. }
  129. function getLastValidPosition(closestTo, strict, validPositions) {
  130. var before = -1, after = -1, valids = validPositions || getMaskSet().validPositions;
  131. closestTo === undefined && (closestTo = -1);
  132. for (var posNdx in valids) {
  133. var psNdx = parseInt(posNdx);
  134. valids[psNdx] && (strict || !0 !== valids[psNdx].generatedInput) && (psNdx <= closestTo && (before = psNdx),
  135. psNdx >= closestTo && (after = psNdx));
  136. }
  137. return -1 !== before && closestTo - before > 1 || after < closestTo ? before : after;
  138. }
  139. function stripValidPositions(start, end, nocheck, strict) {
  140. var i, startPos = start, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), needsValidation = !1;
  141. for (getMaskSet().p = start, i = end - 1; i >= startPos; i--) getMaskSet().validPositions[i] !== undefined && (!0 !== nocheck && (!getMaskSet().validPositions[i].match.optionality && function(pos) {
  142. var posMatch = getMaskSet().validPositions[pos];
  143. if (posMatch !== undefined && null === posMatch.match.fn) {
  144. var prevMatch = getMaskSet().validPositions[pos - 1], nextMatch = getMaskSet().validPositions[pos + 1];
  145. return prevMatch !== undefined && nextMatch !== undefined;
  146. }
  147. return !1;
  148. }(i) || !1 === opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts)) || delete getMaskSet().validPositions[i]);
  149. for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) {
  150. for (;getMaskSet().validPositions[startPos] !== undefined; ) startPos++;
  151. if (i < startPos && (i = startPos + 1), getMaskSet().validPositions[i] === undefined && isMask(i)) i++; else {
  152. var t = getTestTemplate(i);
  153. !1 === needsValidation && positionsClone[startPos] && positionsClone[startPos].match.def === t.match.def ? (getMaskSet().validPositions[startPos] = $.extend(!0, {}, positionsClone[startPos]),
  154. getMaskSet().validPositions[startPos].input = t.input, delete getMaskSet().validPositions[i],
  155. i++) : positionCanMatchDefinition(startPos, t.match.def) ? !1 !== isValid(startPos, t.input || getPlaceholder(i), !0) && (delete getMaskSet().validPositions[i],
  156. i++, needsValidation = !0) : isMask(i) || (i++, startPos--), startPos++;
  157. }
  158. }
  159. resetMaskSet(!0);
  160. }
  161. function determineTestTemplate(tests, guessNextBest) {
  162. for (var testPos, testPositions = tests, lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0)[0], lvTestAltArr = lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation].toString().split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx],
  163. !(testPos.match && (opts.greedy && !0 !== testPos.match.optionalQuantifier || (!1 === testPos.match.optionality || !1 === testPos.match.newBlockMarker) && !0 !== testPos.match.optionalQuantifier) && (lvTest.alternation === undefined || lvTest.alternation !== testPos.alternation || testPos.locator[lvTest.alternation] !== undefined && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr))) || !0 === guessNextBest && (null !== testPos.match.fn || /[0-9a-bA-Z]/.test(testPos.match.def))); ndx++) ;
  164. return testPos;
  165. }
  166. function getTestTemplate(pos, ndxIntlzr, tstPs) {
  167. return getMaskSet().validPositions[pos] || determineTestTemplate(getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));
  168. }
  169. function getTest(pos) {
  170. return getMaskSet().validPositions[pos] ? getMaskSet().validPositions[pos] : getTests(pos)[0];
  171. }
  172. function positionCanMatchDefinition(pos, def) {
  173. for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) if (tests[tndx].match && tests[tndx].match.def === def) {
  174. valid = !0;
  175. break;
  176. }
  177. return valid;
  178. }
  179. function getTests(pos, ndxIntlzr, tstPs) {
  180. function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {
  181. function handleMatch(match, loopNdx, quantifierRecurse) {
  182. function isFirstMatch(latestMatch, tokenGroup) {
  183. var firstMatch = 0 === $.inArray(latestMatch, tokenGroup.matches);
  184. return firstMatch || $.each(tokenGroup.matches, function(ndx, match) {
  185. if (!0 === match.isQuantifier && (firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]))) return !1;
  186. }), firstMatch;
  187. }
  188. function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {
  189. var bestMatch, indexPos;
  190. if (getMaskSet().validPositions[pos - 1] && targetAlternation && getMaskSet().tests[pos]) for (var vpAlternation = getMaskSet().validPositions[pos - 1].locator, tpAlternation = getMaskSet().tests[pos][0].locator, i = 0; i < targetAlternation; i++) if (vpAlternation[i] !== tpAlternation[i]) return vpAlternation.slice(targetAlternation + 1);
  191. return (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) && $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {
  192. var alternation = targetAlternation !== undefined ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] !== undefined ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;
  193. (indexPos === undefined || ndxPos < indexPos) && -1 !== ndxPos && (bestMatch = lmnt,
  194. indexPos = ndxPos);
  195. }), bestMatch ? bestMatch.locator.slice((targetAlternation !== undefined ? targetAlternation : bestMatch.alternation) + 1) : targetAlternation !== undefined ? resolveNdxInitializer(pos, alternateNdx) : undefined;
  196. }
  197. if (testPos > 1e4) 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. " + getMaskSet().mask;
  198. if (testPos === pos && match.matches === undefined) return matches.push({
  199. match: match,
  200. locator: loopNdx.reverse(),
  201. cd: cacheDependency
  202. }), !0;
  203. if (match.matches !== undefined) {
  204. if (match.isGroup && quantifierRecurse !== match) {
  205. if (match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx)) return !0;
  206. } else if (match.isOptional) {
  207. var optionalToken = match;
  208. if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) {
  209. if (latestMatch = matches[matches.length - 1].match, !isFirstMatch(latestMatch, optionalToken)) return !0;
  210. insertStop = !0, testPos = pos;
  211. }
  212. } else if (match.isAlternator) {
  213. var maltMatches, alternateToken = match, malternateMatches = [], currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;
  214. if (-1 === altIndex || "string" == typeof altIndex) {
  215. var amndx, currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [];
  216. if ("string" == typeof altIndex) altIndexArr = altIndex.split(","); else for (amndx = 0; amndx < alternateToken.matches.length; amndx++) altIndexArr.push(amndx);
  217. for (var ndx = 0; ndx < altIndexArr.length; ndx++) {
  218. if (amndx = parseInt(altIndexArr[ndx]), matches = [], ndxInitializer = resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice(),
  219. !0 !== (match = handleMatch(alternateToken.matches[amndx] || maskToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match) && match !== undefined && altIndexArr[altIndexArr.length - 1] < alternateToken.matches.length) {
  220. var ntndx = $.inArray(match, maskToken.matches) + 1;
  221. maskToken.matches.length > ntndx && (match = handleMatch(maskToken.matches[ntndx], [ ntndx ].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse)) && (altIndexArr.push(ntndx.toString()),
  222. $.each(matches, function(ndx, lmnt) {
  223. lmnt.alternation = loopNdx.length - 1;
  224. }));
  225. }
  226. maltMatches = matches.slice(), testPos = currentPos, matches = [];
  227. for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {
  228. var altMatch = maltMatches[ndx1], dropMatch = !1;
  229. altMatch.alternation = altMatch.alternation || loopNdxCnt;
  230. for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
  231. var altMatch2 = malternateMatches[ndx2];
  232. if ("string" != typeof altIndex || -1 !== $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr)) {
  233. if (function(source, target) {
  234. return source.match.nativeDef === target.match.nativeDef || source.match.def === target.match.nativeDef || source.match.nativeDef === target.match.def;
  235. }(altMatch, altMatch2)) {
  236. dropMatch = !0, altMatch.alternation === altMatch2.alternation && -1 === altMatch2.locator[altMatch2.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) && (altMatch2.locator[altMatch2.alternation] = altMatch2.locator[altMatch2.alternation] + "," + altMatch.locator[altMatch.alternation],
  237. altMatch2.alternation = altMatch.alternation), altMatch.match.nativeDef === altMatch2.match.def && (altMatch.locator[altMatch.alternation] = altMatch2.locator[altMatch2.alternation],
  238. malternateMatches.splice(malternateMatches.indexOf(altMatch2), 1, altMatch));
  239. break;
  240. }
  241. if (altMatch.match.def === altMatch2.match.def) {
  242. dropMatch = !1;
  243. break;
  244. }
  245. if (function(source, target) {
  246. return null === source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def, getMaskSet(), pos, !1, opts, !1);
  247. }(altMatch, altMatch2) || function(source, target) {
  248. return null !== source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def.replace(/[\[\]]/g, ""), getMaskSet(), pos, !1, opts, !1);
  249. }(altMatch, altMatch2)) {
  250. altMatch.alternation == altMatch2.alternation && -1 === altMatch.locator[altMatch.alternation].toString().indexOf(altMatch2.locator[altMatch2.alternation].toString().split("")[0]) && (altMatch.na = altMatch.na || altMatch.locator[altMatch.alternation].toString(),
  251. -1 === altMatch.na.indexOf(altMatch.locator[altMatch.alternation].toString().split("")[0]) && (altMatch.na = altMatch.na + "," + altMatch.locator[altMatch2.alternation].toString().split("")[0]),
  252. dropMatch = !0, altMatch.locator[altMatch.alternation] = altMatch2.locator[altMatch2.alternation].toString().split("")[0] + "," + altMatch.locator[altMatch.alternation],
  253. malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch));
  254. break;
  255. }
  256. }
  257. }
  258. dropMatch || malternateMatches.push(altMatch);
  259. }
  260. }
  261. "string" == typeof altIndex && (malternateMatches = $.map(malternateMatches, function(lmnt, ndx) {
  262. if (isFinite(ndx)) {
  263. var alternation = lmnt.alternation, altLocArr = lmnt.locator[alternation].toString().split(",");
  264. lmnt.locator[alternation] = undefined, lmnt.alternation = undefined;
  265. for (var alndx = 0; alndx < altLocArr.length; alndx++) -1 !== $.inArray(altLocArr[alndx], altIndexArr) && (lmnt.locator[alternation] !== undefined ? (lmnt.locator[alternation] += ",",
  266. lmnt.locator[alternation] += altLocArr[alndx]) : lmnt.locator[alternation] = parseInt(altLocArr[alndx]),
  267. lmnt.alternation = alternation);
  268. if (lmnt.locator[alternation] !== undefined) return lmnt;
  269. }
  270. })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = matches.length > 0,
  271. match = malternateMatches.length > 0, ndxInitializer = ndxInitializerClone.slice();
  272. } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);
  273. if (match) return !0;
  274. } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) for (var qt = match, qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {
  275. var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];
  276. if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup)) {
  277. if (latestMatch = matches[matches.length - 1].match, latestMatch.optionalQuantifier = qndx > qt.quantifier.min - 1,
  278. isFirstMatch(latestMatch, tokenGroup)) {
  279. if (qndx > qt.quantifier.min - 1) {
  280. insertStop = !0, testPos = pos;
  281. break;
  282. }
  283. return !0;
  284. }
  285. return !0;
  286. }
  287. } else if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) return !0;
  288. } else testPos++;
  289. }
  290. for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (!0 !== maskToken.matches[tndx].isQuantifier) {
  291. var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);
  292. if (match && testPos === pos) return match;
  293. if (testPos > pos) break;
  294. }
  295. }
  296. function filterTests(tests) {
  297. if (opts.keepStatic && pos > 0 && tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0) && !0 !== tests[0].match.optionality && !0 !== tests[0].match.optionalQuantifier && null === tests[0].match.fn && !/[0-9a-bA-Z]/.test(tests[0].match.def)) {
  298. if (getMaskSet().validPositions[pos - 1] === undefined) return [ determineTestTemplate(tests) ];
  299. if (getMaskSet().validPositions[pos - 1].alternation === tests[0].alternation) return [ determineTestTemplate(tests) ];
  300. if (getMaskSet().validPositions[pos - 1]) return [ determineTestTemplate(tests) ];
  301. }
  302. return tests;
  303. }
  304. var latestMatch, maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = !1, cacheDependency = ndxIntlzr ? ndxIntlzr.join("") : "";
  305. if (pos > -1) {
  306. if (ndxIntlzr === undefined) {
  307. for (var test, previousPos = pos - 1; (test = getMaskSet().validPositions[previousPos] || getMaskSet().tests[previousPos]) === undefined && previousPos > -1; ) previousPos--;
  308. test !== undefined && previousPos > -1 && (ndxInitializer = function(tests) {
  309. var locator = [];
  310. return $.isArray(tests) || (tests = [ tests ]), tests.length > 0 && (tests[0].alternation === undefined ? (locator = determineTestTemplate(tests.slice()).locator.slice(),
  311. 0 === locator.length && (locator = tests[0].locator.slice())) : $.each(tests, function(ndx, tst) {
  312. if ("" !== tst.def) if (0 === locator.length) locator = tst.locator.slice(); else for (var i = 0; i < locator.length; i++) tst.locator[i] && -1 === locator[i].toString().indexOf(tst.locator[i]) && (locator[i] += "," + tst.locator[i]);
  313. })), locator;
  314. }(test), cacheDependency = ndxInitializer.join(""), testPos = previousPos);
  315. }
  316. if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) return filterTests(getMaskSet().tests[pos]);
  317. for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {
  318. if (resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]) && testPos === pos || testPos > pos) break;
  319. }
  320. }
  321. return (0 === matches.length || insertStop) && matches.push({
  322. match: {
  323. fn: null,
  324. cardinality: 0,
  325. optionality: !0,
  326. casing: null,
  327. def: "",
  328. placeholder: ""
  329. },
  330. locator: [],
  331. cd: cacheDependency
  332. }), ndxIntlzr !== undefined && getMaskSet().tests[pos] ? filterTests($.extend(!0, [], matches)) : (getMaskSet().tests[pos] = $.extend(!0, [], matches),
  333. filterTests(getMaskSet().tests[pos]));
  334. }
  335. function getBufferTemplate() {
  336. return getMaskSet()._buffer === undefined && (getMaskSet()._buffer = getMaskTemplate(!1, 1),
  337. getMaskSet().buffer === undefined && (getMaskSet().buffer = getMaskSet()._buffer.slice())),
  338. getMaskSet()._buffer;
  339. }
  340. function getBuffer(noCache) {
  341. return getMaskSet().buffer !== undefined && !0 !== noCache || (getMaskSet().buffer = getMaskTemplate(!0, getLastValidPosition(), !0)),
  342. getMaskSet().buffer;
  343. }
  344. function refreshFromBuffer(start, end, buffer) {
  345. var i, p;
  346. if (!0 === start) resetMaskSet(), start = 0, end = buffer.length; else for (i = start; i < end; i++) delete getMaskSet().validPositions[i];
  347. for (p = start, i = start; i < end; i++) if (resetMaskSet(!0), buffer[i] !== opts.skipOptionalPartCharacter) {
  348. var valResult = isValid(p, buffer[i], !0, !0);
  349. !1 !== valResult && (resetMaskSet(!0), p = valResult.caret !== undefined ? valResult.caret : valResult.pos + 1);
  350. }
  351. }
  352. function casing(elem, test, pos) {
  353. switch (opts.casing || test.casing) {
  354. case "upper":
  355. elem = elem.toUpperCase();
  356. break;
  357. case "lower":
  358. elem = elem.toLowerCase();
  359. break;
  360. case "title":
  361. var posBefore = getMaskSet().validPositions[pos - 1];
  362. elem = 0 === pos || posBefore && posBefore.input === String.fromCharCode(Inputmask.keyCode.SPACE) ? elem.toUpperCase() : elem.toLowerCase();
  363. break;
  364. default:
  365. if ($.isFunction(opts.casing)) {
  366. var args = Array.prototype.slice.call(arguments);
  367. args.push(getMaskSet().validPositions), elem = opts.casing.apply(this, args);
  368. }
  369. }
  370. return elem;
  371. }
  372. function checkAlternationMatch(altArr1, altArr2, na) {
  373. for (var naNdx, altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, naArr = na !== undefined ? na.split(",") : [], i = 0; i < naArr.length; i++) -1 !== (naNdx = altArr1.indexOf(naArr[i])) && altArr1.splice(naNdx, 1);
  374. for (var alndx = 0; alndx < altArr1.length; alndx++) if (-1 !== $.inArray(altArr1[alndx], altArrC)) {
  375. isMatch = !0;
  376. break;
  377. }
  378. return isMatch;
  379. }
  380. function isValid(pos, c, strict, fromSetValid, fromAlternate) {
  381. function isSelection(posObj) {
  382. var selection = isRTL ? posObj.begin - posObj.end > 1 || posObj.begin - posObj.end == 1 : posObj.end - posObj.begin > 1 || posObj.end - posObj.begin == 1;
  383. return selection && 0 === posObj.begin && posObj.end === getMaskSet().maskLength ? "full" : selection;
  384. }
  385. function _isValid(position, c, strict) {
  386. var rslt = !1;
  387. return $.each(getTests(position), function(ndx, tst) {
  388. for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = test.cardinality; i > loopend; i--) chrs += getBufferElement(position - (i - 1));
  389. if (c && (chrs += c), getBuffer(!0), !1 !== (rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && "" !== test.def && {
  390. c: getPlaceholder(position, test, !0) || test.def,
  391. pos: position
  392. })) {
  393. var elem = rslt.c !== undefined ? rslt.c : c;
  394. elem = elem === opts.skipOptionalPartCharacter && null === test.fn ? getPlaceholder(position, test, !0) || test.def : elem;
  395. var validatedPos = position, possibleModifiedBuffer = getBuffer();
  396. if (rslt.remove !== undefined && ($.isArray(rslt.remove) || (rslt.remove = [ rslt.remove ]),
  397. $.each(rslt.remove.sort(function(a, b) {
  398. return b - a;
  399. }), function(ndx, lmnt) {
  400. stripValidPositions(lmnt, lmnt + 1, !0);
  401. })), rslt.insert !== undefined && ($.isArray(rslt.insert) || (rslt.insert = [ rslt.insert ]),
  402. $.each(rslt.insert.sort(function(a, b) {
  403. return a - b;
  404. }), function(ndx, lmnt) {
  405. isValid(lmnt.pos, lmnt.c, !0, fromSetValid);
  406. })), rslt.refreshFromBuffer) {
  407. var refresh = rslt.refreshFromBuffer;
  408. if (refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, possibleModifiedBuffer),
  409. rslt.pos === undefined && rslt.c === undefined) return rslt.pos = getLastValidPosition(),
  410. !1;
  411. if ((validatedPos = rslt.pos !== undefined ? rslt.pos : position) !== position) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0, fromSetValid)),
  412. !1;
  413. } else if (!0 !== rslt && rslt.pos !== undefined && rslt.pos !== position && (validatedPos = rslt.pos,
  414. refreshFromBuffer(position, validatedPos, getBuffer().slice()), validatedPos !== position)) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)),
  415. !1;
  416. return (!0 === rslt || rslt.pos !== undefined || rslt.c !== undefined) && (ndx > 0 && resetMaskSet(!0),
  417. setValidPosition(validatedPos, $.extend({}, tst, {
  418. input: casing(elem, test, validatedPos)
  419. }), fromSetValid, isSelection(pos)) || (rslt = !1), !1);
  420. }
  421. }), rslt;
  422. }
  423. function setValidPosition(pos, validTest, fromSetValid, isSelection) {
  424. if (isSelection || opts.insertMode && getMaskSet().validPositions[pos] !== undefined && fromSetValid === undefined) {
  425. var i, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), lvp = getLastValidPosition(undefined, !0);
  426. for (i = pos; i <= lvp; i++) delete getMaskSet().validPositions[i];
  427. getMaskSet().validPositions[pos] = $.extend(!0, {}, validTest);
  428. var j, valid = !0, vps = getMaskSet().validPositions, needsValidation = !1, initialLength = getMaskSet().maskLength;
  429. for (i = j = pos; i <= lvp; i++) {
  430. var t = positionsClone[i];
  431. if (t !== undefined) for (var posMatch = j; posMatch < getMaskSet().maskLength && (null === t.match.fn && vps[i] && (!0 === vps[i].match.optionalQuantifier || !0 === vps[i].match.optionality) || null != t.match.fn); ) {
  432. if (posMatch++, !1 === needsValidation && positionsClone[posMatch] && positionsClone[posMatch].match.def === t.match.def) getMaskSet().validPositions[posMatch] = $.extend(!0, {}, positionsClone[posMatch]),
  433. getMaskSet().validPositions[posMatch].input = t.input, fillMissingNonMask(posMatch),
  434. j = posMatch, valid = !0; else if (positionCanMatchDefinition(posMatch, t.match.def)) {
  435. var result = isValid(posMatch, t.input, !0, !0);
  436. valid = !1 !== result, j = result.caret || result.insert ? getLastValidPosition() : posMatch,
  437. needsValidation = !0;
  438. } else if (!(valid = !0 === t.generatedInput) && posMatch >= getMaskSet().maskLength - 1) break;
  439. if (getMaskSet().maskLength < initialLength && (getMaskSet().maskLength = initialLength),
  440. valid) break;
  441. }
  442. if (!valid) break;
  443. }
  444. if (!valid) return getMaskSet().validPositions = $.extend(!0, {}, positionsClone),
  445. resetMaskSet(!0), !1;
  446. } else getMaskSet().validPositions[pos] = $.extend(!0, {}, validTest);
  447. return resetMaskSet(!0), !0;
  448. }
  449. function fillMissingNonMask(maskPos) {
  450. for (var pndx = maskPos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;
  451. var testTemplate, testsFromPos;
  452. for (pndx++; pndx < maskPos; pndx++) getMaskSet().validPositions[pndx] === undefined && (!1 === opts.jitMasking || opts.jitMasking > pndx) && (testsFromPos = getTests(pndx, getTestTemplate(pndx - 1).locator, pndx - 1).slice(),
  453. "" === testsFromPos[testsFromPos.length - 1].match.def && testsFromPos.pop(), (testTemplate = determineTestTemplate(testsFromPos)) && (testTemplate.match.def === opts.radixPointDefinitionSymbol || !isMask(pndx, !0) || $.inArray(opts.radixPoint, getBuffer()) < pndx && testTemplate.match.fn && testTemplate.match.fn.test(getPlaceholder(pndx), getMaskSet(), pndx, !1, opts)) && !1 !== (result = _isValid(pndx, getPlaceholder(pndx, testTemplate.match, !0) || (null == testTemplate.match.fn ? testTemplate.match.def : "" !== getPlaceholder(pndx) ? getPlaceholder(pndx) : getBuffer()[pndx]), !0)) && (getMaskSet().validPositions[result.pos || pndx].generatedInput = !0));
  454. }
  455. strict = !0 === strict;
  456. var maskPos = pos;
  457. pos.begin !== undefined && (maskPos = isRTL && !isSelection(pos) ? pos.end : pos.begin);
  458. var result = !0, positionsClone = $.extend(!0, {}, getMaskSet().validPositions);
  459. if ($.isFunction(opts.preValidation) && !strict && !0 !== fromSetValid && (result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts)),
  460. !0 === result) {
  461. if (fillMissingNonMask(maskPos), isSelection(pos) && (handleRemove(undefined, Inputmask.keyCode.DELETE, pos, !0, !0),
  462. maskPos = getMaskSet().p), maskPos < getMaskSet().maskLength && (maxLength === undefined || maskPos < maxLength) && (result = _isValid(maskPos, c, strict),
  463. (!strict || !0 === fromSetValid) && !1 === result)) {
  464. var currentPosValid = getMaskSet().validPositions[maskPos];
  465. if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
  466. if ((opts.insertMode || getMaskSet().validPositions[seekNext(maskPos)] === undefined) && !isMask(maskPos, !0)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) if (!1 !== (result = _isValid(nPos, c, strict))) {
  467. !function(originalPos, newPos) {
  468. var vp = getMaskSet().validPositions[newPos];
  469. if (vp) for (var targetLocator = vp.locator, tll = targetLocator.length, ps = originalPos; ps < newPos; ps++) if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, !0)) {
  470. var tests = getTests(ps).slice(), bestMatch = determineTestTemplate(tests, !0), equality = -1;
  471. "" === tests[tests.length - 1].match.def && tests.pop(), $.each(tests, function(ndx, tst) {
  472. for (var i = 0; i < tll; i++) {
  473. if (tst.locator[i] === undefined || !checkAlternationMatch(tst.locator[i].toString().split(","), targetLocator[i].toString().split(","), tst.na)) {
  474. var targetAI = targetLocator[i], bestMatchAI = bestMatch.locator[i], tstAI = tst.locator[i];
  475. targetAI - bestMatchAI > Math.abs(targetAI - tstAI) && (bestMatch = tst);
  476. break;
  477. }
  478. equality < i && (equality = i, bestMatch = tst);
  479. }
  480. }), bestMatch = $.extend({}, bestMatch, {
  481. input: getPlaceholder(ps, bestMatch.match, !0) || bestMatch.match.def
  482. }), bestMatch.generatedInput = !0, setValidPosition(ps, bestMatch, !0), getMaskSet().validPositions[newPos] = undefined,
  483. _isValid(newPos, vp.input, !0);
  484. }
  485. }(maskPos, result.pos !== undefined ? result.pos : nPos), maskPos = nPos;
  486. break;
  487. }
  488. } else result = {
  489. caret: seekNext(maskPos)
  490. };
  491. }
  492. !1 === result && opts.keepStatic && !strict && !0 !== fromAlternate && (result = function(pos, c, strict) {
  493. var lastAlt, alternation, altPos, prevAltPos, i, validPos, altNdxs, decisionPos, validPsClone = $.extend(!0, {}, getMaskSet().validPositions), isValidRslt = !1, lAltPos = getLastValidPosition();
  494. for (prevAltPos = getMaskSet().validPositions[lAltPos]; lAltPos >= 0; lAltPos--) if ((altPos = getMaskSet().validPositions[lAltPos]) && altPos.alternation !== undefined) {
  495. if (lastAlt = lAltPos, alternation = getMaskSet().validPositions[lastAlt].alternation,
  496. prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) break;
  497. prevAltPos = altPos;
  498. }
  499. if (alternation !== undefined) {
  500. decisionPos = parseInt(lastAlt);
  501. var decisionTaker = prevAltPos.locator[prevAltPos.alternation || alternation] !== undefined ? prevAltPos.locator[prevAltPos.alternation || alternation] : altNdxs[0];
  502. decisionTaker.length > 0 && (decisionTaker = decisionTaker.split(",")[0]);
  503. var possibilityPos = getMaskSet().validPositions[decisionPos], prevPos = getMaskSet().validPositions[decisionPos - 1];
  504. $.each(getTests(decisionPos, prevPos ? prevPos.locator : undefined, decisionPos - 1), function(ndx, test) {
  505. altNdxs = test.locator[alternation] ? test.locator[alternation].toString().split(",") : [];
  506. for (var mndx = 0; mndx < altNdxs.length; mndx++) {
  507. var validInputs = [], staticInputsBeforePos = 0, staticInputsBeforePosAlternate = 0, verifyValidInput = !1;
  508. if (decisionTaker < altNdxs[mndx] && (test.na === undefined || -1 === $.inArray(altNdxs[mndx], test.na.split(",")) || -1 === $.inArray(decisionTaker.toString(), altNdxs))) {
  509. getMaskSet().validPositions[decisionPos] = $.extend(!0, {}, test);
  510. var possibilities = getMaskSet().validPositions[decisionPos].locator;
  511. for (getMaskSet().validPositions[decisionPos].locator[alternation] = parseInt(altNdxs[mndx]),
  512. null == test.match.fn ? (possibilityPos.input !== test.match.def && (verifyValidInput = !0,
  513. !0 !== possibilityPos.generatedInput && validInputs.push(possibilityPos.input)),
  514. staticInputsBeforePosAlternate++, getMaskSet().validPositions[decisionPos].generatedInput = !/[0-9a-bA-Z]/.test(test.match.def),
  515. getMaskSet().validPositions[decisionPos].input = test.match.def) : getMaskSet().validPositions[decisionPos].input = possibilityPos.input,
  516. i = decisionPos + 1; i < getLastValidPosition(undefined, !0) + 1; i++) validPos = getMaskSet().validPositions[i],
  517. validPos && !0 !== validPos.generatedInput && /[0-9a-bA-Z]/.test(validPos.input) ? validInputs.push(validPos.input) : i < pos && staticInputsBeforePos++,
  518. delete getMaskSet().validPositions[i];
  519. for (verifyValidInput && validInputs[0] === test.match.def && validInputs.shift(),
  520. resetMaskSet(!0), isValidRslt = !0; validInputs.length > 0; ) {
  521. var input = validInputs.shift();
  522. if (input !== opts.skipOptionalPartCharacter && !(isValidRslt = isValid(getLastValidPosition(undefined, !0) + 1, input, !1, fromSetValid, !0))) break;
  523. }
  524. if (isValidRslt) {
  525. getMaskSet().validPositions[decisionPos].locator = possibilities;
  526. var targetLvp = getLastValidPosition(pos) + 1;
  527. for (i = decisionPos + 1; i < getLastValidPosition() + 1; i++) ((validPos = getMaskSet().validPositions[i]) === undefined || null == validPos.match.fn) && i < pos + (staticInputsBeforePosAlternate - staticInputsBeforePos) && staticInputsBeforePosAlternate++;
  528. pos += staticInputsBeforePosAlternate - staticInputsBeforePos, isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid, !0);
  529. }
  530. if (isValidRslt) return !1;
  531. resetMaskSet(), getMaskSet().validPositions = $.extend(!0, {}, validPsClone);
  532. }
  533. }
  534. });
  535. }
  536. return isValidRslt;
  537. }(maskPos, c, strict)), !0 === result && (result = {
  538. pos: maskPos
  539. });
  540. }
  541. if ($.isFunction(opts.postValidation) && !1 !== result && !strict && !0 !== fromSetValid) {
  542. var postResult = opts.postValidation(getBuffer(!0), result, opts);
  543. if (postResult.refreshFromBuffer && postResult.buffer) {
  544. var refresh = postResult.refreshFromBuffer;
  545. refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, postResult.buffer);
  546. }
  547. result = !0 === postResult ? result : postResult;
  548. }
  549. return result && result.pos === undefined && (result.pos = maskPos), !1 === result && (resetMaskSet(!0),
  550. getMaskSet().validPositions = $.extend(!0, {}, positionsClone)), result;
  551. }
  552. function isMask(pos, strict) {
  553. var test = getTestTemplate(pos).match;
  554. if ("" === test.def && (test = getTest(pos).match), null != test.fn) return test.fn;
  555. if (!0 !== strict && pos > -1) {
  556. var tests = getTests(pos);
  557. return tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0);
  558. }
  559. return !1;
  560. }
  561. function seekNext(pos, newBlock) {
  562. var maskL = getMaskSet().maskLength;
  563. if (pos >= maskL) return maskL;
  564. var position = pos;
  565. for (getTests(maskL + 1).length > 1 && (getMaskTemplate(!0, maskL + 1, !0), maskL = getMaskSet().maskLength); ++position < maskL && (!0 === newBlock && (!0 !== getTest(position).match.newBlockMarker || !isMask(position)) || !0 !== newBlock && !isMask(position)); ) ;
  566. return position;
  567. }
  568. function seekPrevious(pos, newBlock) {
  569. var tests, position = pos;
  570. if (position <= 0) return 0;
  571. for (;--position > 0 && (!0 === newBlock && !0 !== getTest(position).match.newBlockMarker || !0 !== newBlock && !isMask(position) && (tests = getTests(position),
  572. tests.length < 2 || 2 === tests.length && "" === tests[1].match.def)); ) ;
  573. return position;
  574. }
  575. function getBufferElement(position) {
  576. return getMaskSet().validPositions[position] === undefined ? getPlaceholder(position) : getMaskSet().validPositions[position].input;
  577. }
  578. function writeBuffer(input, buffer, caretPos, event, triggerInputEvent) {
  579. if (event && $.isFunction(opts.onBeforeWrite)) {
  580. var result = opts.onBeforeWrite(event, buffer, caretPos, opts);
  581. if (result) {
  582. if (result.refreshFromBuffer) {
  583. var refresh = result.refreshFromBuffer;
  584. refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer || buffer),
  585. buffer = getBuffer(!0);
  586. }
  587. caretPos !== undefined && (caretPos = result.caret !== undefined ? result.caret : caretPos);
  588. }
  589. }
  590. input !== undefined && (input.inputmask._valueSet(buffer.join("")), caretPos === undefined || event !== undefined && "blur" === event.type ? renderColorMask(input, buffer, caretPos) : android && "input" === event.type ? setTimeout(function() {
  591. caret(input, caretPos);
  592. }, 0) : caret(input, caretPos), !0 === triggerInputEvent && (skipInputEvent = !0,
  593. $(input).trigger("input")));
  594. }
  595. function getPlaceholder(pos, test, returnPL) {
  596. if (test = test || getTest(pos).match, test.placeholder !== undefined || !0 === returnPL) return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;
  597. if (null === test.fn) {
  598. if (pos > -1 && getMaskSet().validPositions[pos] === undefined) {
  599. var prevTest, tests = getTests(pos), staticAlternations = [];
  600. if (tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0)) for (var i = 0; i < tests.length; i++) if (!0 !== tests[i].match.optionality && !0 !== tests[i].match.optionalQuantifier && (null === tests[i].match.fn || prevTest === undefined || !1 !== tests[i].match.fn.test(prevTest.match.def, getMaskSet(), pos, !0, opts)) && (staticAlternations.push(tests[i]),
  601. null === tests[i].match.fn && (prevTest = tests[i]), staticAlternations.length > 1 && /[0-9a-bA-Z]/.test(staticAlternations[0].match.def))) return opts.placeholder.charAt(pos % opts.placeholder.length);
  602. }
  603. return test.def;
  604. }
  605. return opts.placeholder.charAt(pos % opts.placeholder.length);
  606. }
  607. function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
  608. function isTemplateMatch(ndx, charCodes) {
  609. return -1 !== getBufferTemplate().slice(ndx, seekNext(ndx)).join("").indexOf(charCodes) && !isMask(ndx) && getTest(ndx).match.nativeDef === charCodes.charAt(charCodes.length - 1);
  610. }
  611. var inputValue = nptvl.slice(), charCodes = "", initialNdx = 0, result = undefined;
  612. if (resetMaskSet(), getMaskSet().p = seekNext(-1), !strict) if (!0 !== opts.autoUnmask) {
  613. var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(""), matches = inputValue.join("").match(new RegExp("^" + Inputmask.escapeRegex(staticInput), "g"));
  614. matches && matches.length > 0 && (inputValue.splice(0, matches.length * staticInput.length),
  615. initialNdx = seekNext(initialNdx));
  616. } else initialNdx = seekNext(initialNdx);
  617. if ($.each(inputValue, function(ndx, charCode) {
  618. if (charCode !== undefined) {
  619. var keypress = new $.Event("_checkval");
  620. keypress.which = charCode.charCodeAt(0), charCodes += charCode;
  621. var lvp = getLastValidPosition(undefined, !0), lvTest = getMaskSet().validPositions[lvp], nextTest = getTestTemplate(lvp + 1, lvTest ? lvTest.locator.slice() : undefined, lvp);
  622. if (!isTemplateMatch(initialNdx, charCodes) || strict || opts.autoUnmask) {
  623. var pos = strict ? ndx : null == nextTest.match.fn && nextTest.match.optionality && lvp + 1 < getMaskSet().p ? lvp + 1 : getMaskSet().p;
  624. result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, pos),
  625. initialNdx = pos + 1, charCodes = "";
  626. } else result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, !0, lvp + 1);
  627. if (!1 !== result && !strict && $.isFunction(opts.onBeforeWrite)) {
  628. var fp = result.forwardPosition;
  629. if (result = opts.onBeforeWrite(keypress, getBuffer(), result.forwardPosition, opts),
  630. result.forwardPosition = fp, result && result.refreshFromBuffer) {
  631. var refresh = result.refreshFromBuffer;
  632. refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer),
  633. resetMaskSet(!0), result.caret && (getMaskSet().p = result.caret, result.forwardPosition = result.caret);
  634. }
  635. }
  636. }
  637. }), writeOut) {
  638. var caretPos = undefined;
  639. document.activeElement === input && result && (caretPos = opts.numericInput ? seekPrevious(result.forwardPosition) : result.forwardPosition),
  640. writeBuffer(input, getBuffer(), caretPos, initiatingEvent || new $.Event("checkval"), initiatingEvent && "input" === initiatingEvent.type);
  641. }
  642. }
  643. function unmaskedvalue(input) {
  644. if (input) {
  645. if (input.inputmask === undefined) return input.value;
  646. input.inputmask && input.inputmask.refreshValue && EventHandlers.setValueEvent.call(input);
  647. }
  648. var umValue = [], vps = getMaskSet().validPositions;
  649. for (var pndx in vps) vps[pndx].match && null != vps[pndx].match.fn && umValue.push(vps[pndx].input);
  650. var unmaskedValue = 0 === umValue.length ? "" : (isRTL ? umValue.reverse() : umValue).join("");
  651. if ($.isFunction(opts.onUnMask)) {
  652. var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join("");
  653. unmaskedValue = opts.onUnMask(bufferValue, unmaskedValue, opts);
  654. }
  655. return unmaskedValue;
  656. }
  657. function caret(input, begin, end, notranslate) {
  658. function translatePosition(pos) {
  659. if (!0 !== notranslate && isRTL && "number" == typeof pos && (!opts.greedy || "" !== opts.placeholder)) {
  660. pos = getBuffer().join("").length - pos;
  661. }
  662. return pos;
  663. }
  664. var range;
  665. if (begin === undefined) return input.setSelectionRange ? (begin = input.selectionStart,
  666. end = input.selectionEnd) : window.getSelection ? (range = window.getSelection().getRangeAt(0),
  667. range.commonAncestorContainer.parentNode !== input && range.commonAncestorContainer !== input || (begin = range.startOffset,
  668. end = range.endOffset)) : document.selection && document.selection.createRange && (range = document.selection.createRange(),
  669. begin = 0 - range.duplicate().moveStart("character", -input.inputmask._valueGet().length),
  670. end = begin + range.text.length), {
  671. begin: translatePosition(begin),
  672. end: translatePosition(end)
  673. };
  674. if (begin.begin !== undefined && (end = begin.end, begin = begin.begin), "number" == typeof begin) {
  675. begin = translatePosition(begin), end = translatePosition(end), end = "number" == typeof end ? end : begin;
  676. var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;
  677. if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, mobile || !1 !== opts.insertMode || begin !== end || end++,
  678. input.setSelectionRange) input.selectionStart = begin, input.selectionEnd = end; else if (window.getSelection) {
  679. if (range = document.createRange(), input.firstChild === undefined || null === input.firstChild) {
  680. var textNode = document.createTextNode("");
  681. input.appendChild(textNode);
  682. }
  683. range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length),
  684. range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length),
  685. range.collapse(!0);
  686. var sel = window.getSelection();
  687. sel.removeAllRanges(), sel.addRange(range);
  688. } else input.createTextRange && (range = input.createTextRange(), range.collapse(!0),
  689. range.moveEnd("character", end), range.moveStart("character", begin), range.select());
  690. renderColorMask(input, undefined, {
  691. begin: begin,
  692. end: end
  693. });
  694. }
  695. }
  696. function determineLastRequiredPosition(returnDefinition) {
  697. var pos, testPos, buffer = getBuffer(), bl = buffer.length, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = lvTest !== undefined ? lvTest.locator.slice() : undefined;
  698. for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
  699. ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos);
  700. var lvTestAlt = lvTest && lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation] : undefined;
  701. for (pos = bl - 1; pos > lvp && (testPos = positions[pos], (testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && null != testPos.match.fn || null === testPos.match.fn && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAlt.toString().split(",")) && "" !== getTests(pos)[0].def)) && buffer[pos] === getPlaceholder(pos, testPos.match)); pos--) bl--;
  702. return returnDefinition ? {
  703. l: bl,
  704. def: positions[bl] ? positions[bl].match : undefined
  705. } : bl;
  706. }
  707. function clearOptionalTail(buffer) {
  708. for (var validPos, rl = determineLastRequiredPosition(), bl = buffer.length, lv = getMaskSet().validPositions[getLastValidPosition()]; rl < bl && !isMask(rl, !0) && (validPos = lv !== undefined ? getTestTemplate(rl, lv.locator.slice(""), lv) : getTest(rl)) && !0 !== validPos.match.optionality && (!0 !== validPos.match.optionalQuantifier && !0 !== validPos.match.newBlockMarker || rl + 1 === bl && "" === (lv !== undefined ? getTestTemplate(rl + 1, lv.locator.slice(""), lv) : getTest(rl + 1)).match.def); ) rl++;
  709. for (;(validPos = getMaskSet().validPositions[rl - 1]) && validPos && validPos.match.optionality && validPos.input === opts.skipOptionalPartCharacter; ) rl--;
  710. return buffer.splice(rl), buffer;
  711. }
  712. function isComplete(buffer) {
  713. if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);
  714. if ("*" === opts.repeat) return undefined;
  715. var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l);
  716. if (lrp.def === undefined || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {
  717. complete = !0;
  718. for (var i = 0; i <= aml; i++) {
  719. var test = getTestTemplate(i).match;
  720. if (null !== test.fn && getMaskSet().validPositions[i] === undefined && !0 !== test.optionality && !0 !== test.optionalQuantifier || null === test.fn && buffer[i] !== getPlaceholder(i, test)) {
  721. complete = !1;
  722. break;
  723. }
  724. }
  725. }
  726. return complete;
  727. }
  728. function handleRemove(input, k, pos, strict, fromIsValid) {
  729. if ((opts.numericInput || isRTL) && (k === Inputmask.keyCode.BACKSPACE ? k = Inputmask.keyCode.DELETE : k === Inputmask.keyCode.DELETE && (k = Inputmask.keyCode.BACKSPACE),
  730. isRTL)) {
  731. var pend = pos.end;
  732. pos.end = pos.begin, pos.begin = pend;
  733. }
  734. k === Inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || !1 === opts.insertMode) ? (pos.begin = seekPrevious(pos.begin),
  735. getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator && pos.begin--) : k === Inputmask.keyCode.DELETE && pos.begin === pos.end && (pos.end = isMask(pos.end, !0) && getMaskSet().validPositions[pos.end] && getMaskSet().validPositions[pos.end].input !== opts.radixPoint ? pos.end + 1 : seekNext(pos.end) + 1,
  736. getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator && pos.end++),
  737. stripValidPositions(pos.begin, pos.end, !1, strict), !0 !== strict && function() {
  738. if (opts.keepStatic) {
  739. for (var validInputs = [], lastAlt = getLastValidPosition(-1, !0), positionsClone = $.extend(!0, {}, getMaskSet().validPositions), prevAltPos = getMaskSet().validPositions[lastAlt]; lastAlt >= 0; lastAlt--) {
  740. var altPos = getMaskSet().validPositions[lastAlt];
  741. if (altPos) {
  742. if (!0 !== altPos.generatedInput && /[0-9a-bA-Z]/.test(altPos.input) && validInputs.push(altPos.input),
  743. delete getMaskSet().validPositions[lastAlt], altPos.alternation !== undefined && altPos.locator[altPos.alternation] !== prevAltPos.locator[altPos.alternation]) break;
  744. prevAltPos = altPos;
  745. }
  746. }
  747. if (lastAlt > -1) for (getMaskSet().p = seekNext(getLastValidPosition(-1, !0)); validInputs.length > 0; ) {
  748. var keypress = new $.Event("keypress");
  749. keypress.which = validInputs.pop().charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p);
  750. } else getMaskSet().validPositions = $.extend(!0, {}, positionsClone);
  751. }
  752. }();
  753. var lvp = getLastValidPosition(pos.begin, !0);
  754. if (lvp < pos.begin) getMaskSet().p = seekNext(lvp); else if (!0 !== strict && (getMaskSet().p = pos.begin,
  755. !0 !== fromIsValid)) for (;getMaskSet().p < lvp && getMaskSet().validPositions[getMaskSet().p] === undefined; ) getMaskSet().p++;
  756. }
  757. function initializeColorMask(input) {
  758. function findCaretPos(clientx) {
  759. var caretPos, e = document.createElement("span");
  760. for (var style in computedStyle) isNaN(style) && -1 !== style.indexOf("font") && (e.style[style] = computedStyle[style]);
  761. e.style.textTransform = computedStyle.textTransform, e.style.letterSpacing = computedStyle.letterSpacing,
  762. e.style.position = "absolute", e.style.height = "auto", e.style.width = "auto",
  763. e.style.visibility = "hidden", e.style.whiteSpace = "nowrap", document.body.appendChild(e);
  764. var itl, inputText = input.inputmask._valueGet(), previousWidth = 0;
  765. for (caretPos = 0, itl = inputText.length; caretPos <= itl; caretPos++) {
  766. if (e.innerHTML += inputText.charAt(caretPos) || "_", e.offsetWidth >= clientx) {
  767. var offset1 = clientx - previousWidth, offset2 = e.offsetWidth - clientx;
  768. e.innerHTML = inputText.charAt(caretPos), offset1 -= e.offsetWidth / 3, caretPos = offset1 < offset2 ? caretPos - 1 : caretPos;
  769. break;
  770. }
  771. previousWidth = e.offsetWidth;
  772. }
  773. return document.body.removeChild(e), caretPos;
  774. }
  775. function position() {
  776. colorMask.style.position = "absolute", colorMask.style.top = offset.top + "px",
  777. colorMask.style.left = offset.left + "px", colorMask.style.width = parseInt(input.offsetWidth) - parseInt(computedStyle.paddingLeft) - parseInt(computedStyle.paddingRight) - parseInt(computedStyle.borderLeftWidth) - parseInt(computedStyle.borderRightWidth) + "px",
  778. colorMask.style.height = parseInt(input.offsetHeight) - parseInt(computedStyle.paddingTop) - parseInt(computedStyle.paddingBottom) - parseInt(computedStyle.borderTopWidth) - parseInt(computedStyle.borderBottomWidth) + "px",
  779. colorMask.style.lineHeight = colorMask.style.height, colorMask.style.zIndex = isNaN(computedStyle.zIndex) ? -1 : computedStyle.zIndex - 1,
  780. colorMask.style.webkitAppearance = "textfield", colorMask.style.mozAppearance = "textfield",
  781. colorMask.style.Appearance = "textfield";
  782. }
  783. var offset = $(input).position(), computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null);
  784. colorMask = document.createElement("div"), document.body.appendChild(colorMask);
  785. for (var style in computedStyle) computedStyle.hasOwnProperty(style) && isNaN(style) && "cssText" !== style && -1 == style.indexOf("webkit") && (colorMask.style[style] = computedStyle[style]);
  786. input.style.backgroundColor = "transparent", input.style.color = "transparent",
  787. input.style.webkitAppearance = "caret", input.style.mozAppearance = "caret", input.style.Appearance = "caret",
  788. position(), $(window).on("resize", function(e) {
  789. offset = $(input).position(), computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null),
  790. position();
  791. }), $(input).on("click", function(e) {
  792. return caret(input, findCaretPos(e.clientX)), EventHandlers.clickEvent.call(this, [ e ]);
  793. }), $(input).on("keydown", function(e) {
  794. e.shiftKey || !1 === opts.insertMode || setTimeout(function() {
  795. renderColorMask(input);
  796. }, 0);
  797. });
  798. }
  799. function renderColorMask(input, buffer, caretPos) {
  800. function handleStatic() {
  801. isStatic || null !== test.fn && testPos.input !== undefined ? isStatic && null !== test.fn && testPos.input !== undefined && (isStatic = !1,
  802. maskTemplate += "</span>") : (isStatic = !0, maskTemplate += "<span class='im-static''>");
  803. }
  804. if (colorMask !== undefined) {
  805. buffer = buffer || getBuffer(), caretPos === undefined ? caretPos = caret(input) : caretPos.begin === undefined && (caretPos = {
  806. begin: caretPos,
  807. end: caretPos
  808. });
  809. var maskTemplate = "", isStatic = !1;
  810. if ("" != buffer) {
  811. var ndxIntlzr, test, testPos, pos = 0, lvp = getLastValidPosition();
  812. do {
  813. pos === caretPos.begin && document.activeElement === input && (maskTemplate += "<span class='im-caret' style='border-right-width: 1px;border-right-style: solid;'></span>"),
  814. getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos],
  815. test = testPos.match, ndxIntlzr = testPos.locator.slice(), handleStatic(), maskTemplate += testPos.input) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
  816. test = testPos.match, ndxIntlzr = testPos.locator.slice(), (!1 === opts.jitMasking || pos < lvp || "number" == typeof opts.jitMasking && isFinite(opts.jitMasking) && opts.jitMasking > pos) && (handleStatic(),
  817. maskTemplate += getPlaceholder(pos, test))), pos++;
  818. } while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || "" !== test.def) || lvp > pos);
  819. }
  820. colorMask.innerHTML = maskTemplate;
  821. }
  822. }
  823. maskset = maskset || this.maskset, opts = opts || this.opts;
  824. var undoValue, $el, maxLength, colorMask, valueBuffer, el = this.el, isRTL = this.isRTL, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, mouseEnter = !1, EventRuler = {
  825. on: function(input, eventName, eventHandler) {
  826. var ev = function(e) {
  827. if (this.inputmask === undefined && "FORM" !== this.nodeName) {
  828. var imOpts = $.data(this, "_inputmask_opts");
  829. imOpts ? new Inputmask(imOpts).mask(this) : EventRuler.off(this);
  830. } else {
  831. if ("setvalue" === e.type || "FORM" === this.nodeName || !(this.disabled || this.readOnly && !("keydown" === e.type && e.ctrlKey && 67 === e.keyCode || !1 === opts.tabThrough && e.keyCode === Inputmask.keyCode.TAB))) {
  832. switch (e.type) {
  833. case "input":
  834. if (!0 === skipInputEvent) return skipInputEvent = !1, e.preventDefault();
  835. break;
  836. case "keydown":
  837. skipKeyPressEvent = !1, skipInputEvent = !1;
  838. break;
  839. case "keypress":
  840. if (!0 === skipKeyPressEvent) return e.preventDefault();
  841. skipKeyPressEvent = !0;
  842. break;
  843. case "click":
  844. if (iemobile || iphone) {
  845. var that = this, args = arguments;
  846. return setTimeout(function() {
  847. eventHandler.apply(that, args);
  848. }, 0), !1;
  849. }
  850. }
  851. var returnVal = eventHandler.apply(this, arguments);
  852. return !1 === returnVal && (e.preventDefault(), e.stopPropagation()), returnVal;
  853. }
  854. e.preventDefault();
  855. }
  856. };
  857. input.inputmask.events[eventName] = input.inputmask.events[eventName] || [], input.inputmask.events[eventName].push(ev),
  858. -1 !== $.inArray(eventName, [ "submit", "reset" ]) ? null != input.form && $(input.form).on(eventName, ev) : $(input).on(eventName, ev);
  859. },
  860. off: function(input, event) {
  861. if (input.inputmask && input.inputmask.events) {
  862. var events;
  863. event ? (events = [], events[event] = input.inputmask.events[event]) : events = input.inputmask.events,
  864. $.each(events, function(eventName, evArr) {
  865. for (;evArr.length > 0; ) {
  866. var ev = evArr.pop();
  867. -1 !== $.inArray(eventName, [ "submit", "reset" ]) ? null != input.form && $(input.form).off(eventName, ev) : $(input).off(eventName, ev);
  868. }
  869. delete input.inputmask.events[eventName];
  870. });
  871. }
  872. }
  873. }, EventHandlers = {
  874. keydownEvent: function(e) {
  875. var input = this, $input = $(input), k = e.keyCode, pos = caret(input);
  876. if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && k === Inputmask.keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === Inputmask.keyCode.X && !function(eventName) {
  877. var el = document.createElement("input"), evName = "on" + eventName, isSupported = evName in el;
  878. return isSupported || (el.setAttribute(evName, "return;"), isSupported = "function" == typeof el[evName]),
  879. el = null, isSupported;
  880. }("cut")) e.preventDefault(), handleRemove(input, k, pos), writeBuffer(input, getBuffer(!0), getMaskSet().p, e, input.inputmask._valueGet() !== getBuffer().join("")),
  881. input.inputmask._valueGet() === getBufferTemplate().join("") ? $input.trigger("cleared") : !0 === isComplete(getBuffer()) && $input.trigger("complete"); else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) {
  882. e.preventDefault();
  883. var caretPos = seekNext(getLastValidPosition());
  884. opts.insertMode || caretPos !== getMaskSet().maskLength || e.shiftKey || caretPos--,
  885. caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, !0);
  886. } else k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP ? (e.preventDefault(),
  887. caret(input, 0, e.shiftKey ? pos.begin : 0, !0)) : (opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || 90 === k && e.ctrlKey) && !0 !== e.altKey ? (checkVal(input, !0, !1, undoValue.split("")),
  888. $input.trigger("click")) : k !== Inputmask.keyCode.INSERT || e.shiftKey || e.ctrlKey ? !0 === opts.tabThrough && k === Inputmask.keyCode.TAB ? (!0 === e.shiftKey ? (null === getTest(pos.begin).match.fn && (pos.begin = seekNext(pos.begin)),
  889. pos.end = seekPrevious(pos.begin, !0), pos.begin = seekPrevious(pos.end, !0)) : (pos.begin = seekNext(pos.begin, !0),
  890. pos.end = seekNext(pos.begin, !0), pos.end < getMaskSet().maskLength && pos.end--),
  891. pos.begin < getMaskSet().maskLength && (e.preventDefault(), caret(input, pos.begin, pos.end))) : e.shiftKey || !1 === opts.insertMode && (k === Inputmask.keyCode.RIGHT ? setTimeout(function() {
  892. var caretPos = caret(input);
  893. caret(input, caretPos.begin);
  894. }, 0) : k === Inputmask.keyCode.LEFT && setTimeout(function() {
  895. var caretPos = caret(input);
  896. caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1);
  897. }, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin !== getMaskSet().maskLength ? pos.begin : pos.begin - 1));
  898. opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 !== $.inArray(k, opts.ignorables);
  899. },
  900. keypressEvent: function(e, checkval, writeOut, strict, ndx) {
  901. var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;
  902. if (!(!0 === checkval || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) return k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join("") && (undoValue = getBuffer().join(""),
  903. setTimeout(function() {
  904. $input.trigger("change");
  905. }, 0)), !0;
  906. if (k) {
  907. 46 === k && !1 === e.shiftKey && "" !== opts.radixPoint && (k = opts.radixPoint.charCodeAt(0));
  908. var forwardPosition, pos = checkval ? {
  909. begin: ndx,
  910. end: ndx
  911. } : caret(input), c = String.fromCharCode(k);
  912. getMaskSet().writeOutBuffer = !0;
  913. var valResult = isValid(pos, c, strict);
  914. if (!1 !== valResult && (resetMaskSet(!0), forwardPosition = valResult.caret !== undefined ? valResult.caret : checkval ? valResult.pos + 1 : seekNext(valResult.pos),
  915. getMaskSet().p = forwardPosition), !1 !== writeOut && (setTimeout(function() {
  916. opts.onKeyValidation.call(input, k, valResult, opts);
  917. }, 0), getMaskSet().writeOutBuffer && !1 !== valResult)) {
  918. var buffer = getBuffer();
  919. writeBuffer(input, buffer, opts.numericInput && valResult.caret === undefined ? seekPrevious(forwardPosition) : forwardPosition, e, !0 !== checkval),
  920. !0 !== checkval && setTimeout(function() {
  921. !0 === isComplete(buffer) && $input.trigger("complete");
  922. }, 0);
  923. }
  924. if (e.preventDefault(), checkval) return !1 !== valResult && (valResult.forwardPosition = forwardPosition),
  925. valResult;
  926. }
  927. },
  928. pasteEvent: function(e) {
  929. var tempValue, input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);
  930. isRTL && (tempValue = caretPos.end, caretPos.end = caretPos.begin, caretPos.begin = tempValue);
  931. var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
  932. if (valueBeforeCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""),
  933. valueAfterCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(caretPos.end).join("") && (valueAfterCaret = ""),
  934. isRTL && (tempValue = valueBeforeCaret, valueBeforeCaret = valueAfterCaret, valueAfterCaret = tempValue),
  935. window.clipboardData && window.clipboardData.getData) inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret; else {
  936. if (!ev.clipboardData || !ev.clipboardData.getData) return !0;
  937. inputValue = valueBeforeCaret + ev.clipboardData.getData("text/plain") + valueAfterCaret;
  938. }
  939. var pasteValue = inputValue;
  940. if ($.isFunction(opts.onBeforePaste)) {
  941. if (!1 === (pasteValue = opts.onBeforePaste(inputValue, opts))) return e.preventDefault();
  942. pasteValue || (pasteValue = inputValue);
  943. }
  944. return checkVal(input, !1, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.toString().split("")),
  945. writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join("")),
  946. !0 === isComplete(getBuffer()) && $input.trigger("complete"), e.preventDefault();
  947. },
  948. inputFallBackEvent: function(e) {
  949. var input = this, inputValue = input.inputmask._valueGet();
  950. if (getBuffer().join("") !== inputValue) {
  951. var caretPos = caret(input);
  952. if (!1 === function(input, inputValue, caretPos) {
  953. if ("." === inputValue.charAt(caretPos.begin - 1) && "" !== opts.radixPoint && (inputValue = inputValue.split(""),
  954. inputValue[caretPos.begin - 1] = opts.radixPoint.charAt(0), inputValue = inputValue.join("")),
  955. inputValue.charAt(caretPos.begin - 1) === opts.radixPoint && inputValue.length > getBuffer().length) {
  956. var keypress = new $.Event("keypress");
  957. return keypress.which = opts.radixPoint.charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !0, !1, caretPos.begin),
  958. !1;
  959. }
  960. }(input, inputValue, caretPos)) return !1;
  961. if (inputValue = inputValue.replace(new RegExp("(" + Inputmask.escapeRegex(getBufferTemplate().join("")) + ")*"), ""),
  962. !1 === function(input, inputValue, caretPos) {
  963. if (iemobile) {
  964. var inputChar = inputValue.replace(getBuffer().join(""), "");
  965. if (1 === inputChar.length) {
  966. var keypress = new $.Event("keypress");
  967. return keypress.which = inputChar.charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !0, !1, getMaskSet().validPositions[caretPos.begin - 1] ? caretPos.begin : caretPos.begin - 1),
  968. !1;
  969. }
  970. }
  971. }(input, inputValue, caretPos)) return !1;
  972. caretPos.begin > inputValue.length && (caret(input, inputValue.length), caretPos = caret(input));
  973. var buffer = getBuffer().join(""), frontPart = inputValue.substr(0, caretPos.begin), backPart = inputValue.substr(caretPos.begin), frontBufferPart = buffer.substr(0, caretPos.begin), backBufferPart = buffer.substr(caretPos.begin), selection = {
  974. begin: frontPart.length
  975. }, endOffset = 0;
  976. if (frontPart[frontPart.length - 1] !== frontBufferPart[frontBufferPart.length - 1] && (selection.begin--,
  977. endOffset++), backPart.length > backBufferPart.length) selection.end = selection.begin; else {
  978. var selectedPart = backBufferPart.replace(new RegExp(Inputmask.escapeRegex(backPart) + "$"), "");
  979. selection.end = selection.begin + selectedPart.length + endOffset;
  980. }
  981. if (selection.begin != selection.end || isMask(selection.begin) || (selection.end = caretPos.end),
  982. "" !== backPart && selection.begin < selection.end) writeBuffer(input, getBuffer(), selection),
  983. frontPart.charCodeAt(frontPart.length - 1) !== frontBufferPart.charCodeAt(frontBufferPart.length - 1) ? (e.which = frontPart.charCodeAt(frontPart.length - 1),
  984. EventHandlers.keypressEvent.call(input, e)) : (selection.begin == selection.end - 1 && caret(input, seekPrevious(selection.begin + 1), selection.end),
  985. e.keyCode = Inputmask.keyCode.DELETE, EventHandlers.keydownEvent.call(input, e)); else {
  986. for (var bufferTemplate = getBufferTemplate().join(""); null === inputValue.match(Inputmask.escapeRegex(bufferTemplate) + "$"); ) bufferTemplate = bufferTemplate.slice(1);
  987. inputValue = inputValue.replace(bufferTemplate, ""), $.isFunction(opts.onBeforeMask) && (inputValue = opts.onBeforeMask(inputValue, opts) || inputValue),
  988. checkVal(input, !0, !1, inputValue.split(""), e), function(input, frontPart, backPart) {
  989. var targetPos = caret(input).begin, currentValue = input.inputmask._valueGet(), pos = currentValue.indexOf(frontPart), currentPos = targetPos;
  990. if (0 === pos && targetPos !== frontPart.length) targetPos = frontPart.length; else {
  991. for (;null === currentValue.match(Inputmask.escapeRegex(backPart) + "$"); ) backPart = backPart.substr(1);
  992. var pos2 = currentValue.indexOf(backPart);
  993. -1 !== pos2 && "" !== backPart && targetPos > pos2 && pos2 > pos && (targetPos = pos2);
  994. }
  995. isMask(targetPos) || (targetPos = seekNext(targetPos)), currentPos !== targetPos && (caret(input, targetPos),
  996. android && setTimeout(function() {
  997. caret(input, targetPos);
  998. }, 0));
  999. }(input, frontPart, backPart), !0 === isComplete(getBuffer()) && $(input).trigger("complete");
  1000. }
  1001. e.preventDefault();
  1002. }
  1003. },
  1004. setValueEvent: function(e) {
  1005. this.inputmask.refreshValue = !1;
  1006. var input = this, value = input.inputmask._valueGet(!0);
  1007. $.isFunction(opts.onBeforeMask) && (value = opts.onBeforeMask(value, opts) || value),
  1008. value = value.split(""), checkVal(input, !0, !1, isRTL ? value.reverse() : value),
  1009. undoValue = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join("") && input.inputmask._valueSet("");
  1010. },
  1011. focusEvent: function(e) {
  1012. var input = this, nptValue = input.inputmask._valueGet();
  1013. opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" === nptValue) && (input.inputmask._valueGet() !== getBuffer().join("") ? writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : !1 === mouseEnter && caret(input, seekNext(getLastValidPosition()))),
  1014. !0 === opts.positionCaretOnTab && !1 === mouseEnter && (writeBuffer(input, getBuffer(), caret(input)),
  1015. EventHandlers.clickEvent.apply(input, [ e, !0 ])), undoValue = getBuffer().join("");
  1016. },
  1017. mouseleaveEvent: function(e) {
  1018. var input = this;
  1019. if (mouseEnter = !1, opts.clearMaskOnLostFocus && document.activeElement !== input) {
  1020. var buffer = getBuffer().slice(), nptValue = input.inputmask._valueGet();
  1021. nptValue !== input.getAttribute("placeholder") && "" !== nptValue && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer),
  1022. writeBuffer(input, buffer));
  1023. }
  1024. },
  1025. clickEvent: function(e, tabbed) {
  1026. function doRadixFocus(clickPos) {
  1027. if ("" !== opts.radixPoint) {
  1028. var vps = getMaskSet().validPositions;
  1029. if (vps[clickPos] === undefined || vps[clickPos].input === getPlaceholder(clickPos)) {
  1030. if (clickPos < seekNext(-1)) return !0;
  1031. var radixPos = $.inArray(opts.radixPoint, getBuffer());
  1032. if (-1 !== radixPos) {
  1033. for (var vp in vps) if (radixPos < vp && vps[vp].input !== getPlaceholder(vp)) return !1;
  1034. return !0;
  1035. }
  1036. }
  1037. }
  1038. return !1;
  1039. }
  1040. var input = this;
  1041. setTimeout(function() {
  1042. if (document.activeElement === input) {
  1043. var selectedCaret = caret(input);
  1044. if (tabbed && (isRTL ? selectedCaret.end = selectedCaret.begin : selectedCaret.begin = selectedCaret.end),
  1045. selectedCaret.begin === selectedCaret.end) switch (opts.positionCaretOnClick) {
  1046. case "none":
  1047. break;
  1048. case "radixFocus":
  1049. if (doRadixFocus(selectedCaret.begin)) {
  1050. var radixPos = getBuffer().join("").indexOf(opts.radixPoint);
  1051. caret(input, opts.numericInput ? seekNext(radixPos) : radixPos);
  1052. break;
  1053. }
  1054. default:
  1055. var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, !0), lastPosition = seekNext(lvclickPosition);
  1056. if (clickPosition < lastPosition) caret(input, isMask(clickPosition) || isMask(clickPosition - 1) ? clickPosition : seekNext(clickPosition)); else {
  1057. var placeholder = getPlaceholder(lastPosition), lvp = getMaskSet().validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : undefined, lvp);
  1058. if ("" !== placeholder && getBuffer()[lastPosition] !== placeholder && !0 !== tt.match.optionalQuantifier || !isMask(lastPosition) && tt.match.def === placeholder) {
  1059. var newPos = seekNext(lastPosition);
  1060. clickPosition >= newPos && (lastPosition = newPos);
  1061. }
  1062. caret(input, lastPosition);
  1063. }
  1064. }
  1065. }
  1066. }, 0);
  1067. },
  1068. dblclickEvent: function(e) {
  1069. var input = this;
  1070. setTimeout(function() {
  1071. caret(input, 0, seekNext(getLastValidPosition()));
  1072. }, 0);
  1073. },
  1074. cutEvent: function(e) {
  1075. var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e, clipboardData = window.clipboardData || ev.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);
  1076. clipboardData.setData("text", isRTL ? clipData.reverse().join("") : clipData.join("")),
  1077. document.execCommand && document.execCommand("copy"), handleRemove(input, Inputmask.keyCode.DELETE, pos),
  1078. writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join("")),
  1079. input.inputmask._valueGet() === getBufferTemplate().join("") && $input.trigger("cleared");
  1080. },
  1081. blurEvent: function(e) {
  1082. var $input = $(this), input = this;
  1083. if (input.inputmask) {
  1084. var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();
  1085. "" !== nptValue && (opts.clearMaskOnLostFocus && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)),
  1086. !1 === isComplete(buffer) && (setTimeout(function() {
  1087. $input.trigger("incomplete");
  1088. }, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())),
  1089. writeBuffer(input, buffer, undefined, e)), undoValue !== getBuffer().join("") && (undoValue = buffer.join(""),
  1090. $input.trigger("change"));
  1091. }
  1092. },
  1093. mouseenterEvent: function(e) {
  1094. var input = this;
  1095. mouseEnter = !0, document.activeElement !== input && opts.showMaskOnHover && input.inputmask._valueGet() !== getBuffer().join("") && writeBuffer(input, getBuffer());
  1096. },
  1097. submitEvent: function(e) {
  1098. undoValue !== getBuffer().join("") && $el.trigger("change"), opts.clearMaskOnLostFocus && -1 === getLastValidPosition() && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join("") && el.inputmask._valueSet(""),
  1099. opts.removeMaskOnSubmit && (el.inputmask._valueSet(el.inputmask.unmaskedvalue(), !0),
  1100. setTimeout(function() {
  1101. writeBuffer(el, getBuffer());
  1102. }, 0));
  1103. },
  1104. resetEvent: function(e) {
  1105. el.inputmask.refreshValue = !0, setTimeout(function() {
  1106. $el.trigger("setvalue");
  1107. }, 0);
  1108. }
  1109. };
  1110. if (actionObj !== undefined) switch (actionObj.action) {
  1111. case "isComplete":
  1112. return el = actionObj.el, isComplete(getBuffer());
  1113. case "unmaskedvalue":
  1114. return el !== undefined && actionObj.value === undefined || (valueBuffer = actionObj.value,
  1115. valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(valueBuffer, opts) || valueBuffer : valueBuffer).split(""),
  1116. checkVal(undefined, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite(undefined, getBuffer(), 0, opts)),
  1117. unmaskedvalue(el);
  1118. case "mask":
  1119. !function(elem) {
  1120. EventRuler.off(elem);
  1121. var isSupported = function(input, opts) {
  1122. var elementType = input.getAttribute("type"), isSupported = "INPUT" === input.tagName && -1 !== $.inArray(elementType, opts.supportsInputType) || input.isContentEditable || "TEXTAREA" === input.tagName;
  1123. if (!isSupported) if ("INPUT" === input.tagName) {
  1124. var el = document.createElement("input");
  1125. el.setAttribute("type", elementType), isSupported = "text" === el.type, el = null;
  1126. } else isSupported = "partial";
  1127. return !1 !== isSupported && function(npt) {
  1128. function getter() {
  1129. return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== getLastValidPosition() || !0 !== opts.nullable ? document.activeElement === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join("") : valueGet.call(this) : "" : valueGet.call(this);
  1130. }
  1131. function setter(value) {
  1132. valueSet.call(this, value), this.inputmask && $(this).trigger("setvalue");
  1133. }
  1134. var valueGet, valueSet;
  1135. if (!npt.inputmask.__valueGet) {
  1136. if (!0 !== opts.noValuePatching) {
  1137. if (Object.getOwnPropertyDescriptor) {
  1138. "function" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = "object" === _typeof("test".__proto__) ? function(object) {
  1139. return object.__proto__;
  1140. } : function(object) {
  1141. return object.constructor.prototype;
  1142. });
  1143. var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), "value") : undefined;
  1144. valueProperty && valueProperty.get && valueProperty.set ? (valueGet = valueProperty.get,
  1145. valueSet = valueProperty.set, Object.defineProperty(npt, "value", {
  1146. get: getter,
  1147. set: setter,
  1148. configurable: !0
  1149. })) : "INPUT" !== npt.tagName && (valueGet = function() {
  1150. return this.textContent;
  1151. }, valueSet = function(value) {
  1152. this.textContent = value;
  1153. }, Object.defineProperty(npt, "value", {
  1154. get: getter,
  1155. set: setter,
  1156. configurable: !0
  1157. }));
  1158. } else document.__lookupGetter__ && npt.__lookupGetter__("value") && (valueGet = npt.__lookupGetter__("value"),
  1159. valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter),
  1160. npt.__defineSetter__("value", setter));
  1161. npt.inputmask.__valueGet = valueGet, npt.inputmask.__valueSet = valueSet;
  1162. }
  1163. npt.inputmask._valueGet = function(overruleRTL) {
  1164. return isRTL && !0 !== overruleRTL ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
  1165. }, npt.inputmask._valueSet = function(value, overruleRTL) {
  1166. valueSet.call(this.el, null === value || value === undefined ? "" : !0 !== overruleRTL && isRTL ? value.split("").reverse().join("") : value);
  1167. }, valueGet === undefined && (valueGet = function() {
  1168. return this.value;
  1169. }, valueSet = function(value) {
  1170. this.value = value;
  1171. }, function(type) {
  1172. if ($.valHooks && ($.valHooks[type] === undefined || !0 !== $.valHooks[type].inputmaskpatch)) {
  1173. var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {
  1174. return elem.value;
  1175. }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {
  1176. return elem.value = value, elem;
  1177. };
  1178. $.valHooks[type] = {
  1179. get: function(elem) {
  1180. if (elem.inputmask) {
  1181. if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue();
  1182. var result = valhookGet(elem);
  1183. return -1 !== getLastValidPosition(undefined, undefined, elem.inputmask.maskset.validPositions) || !0 !== opts.nullable ? result : "";
  1184. }
  1185. return valhookGet(elem);
  1186. },
  1187. set: function(elem, value) {
  1188. var result, $elem = $(elem);
  1189. return result = valhookSet(elem, value), elem.inputmask && $elem.trigger("setvalue"),
  1190. result;
  1191. },
  1192. inputmaskpatch: !0
  1193. };
  1194. }
  1195. }(npt.type), function(npt) {
  1196. EventRuler.on(npt, "mouseenter", function(event) {
  1197. var $input = $(this);
  1198. this.inputmask._valueGet() !== getBuffer().join("") && $input.trigger("setvalue");
  1199. });
  1200. }(npt));
  1201. }
  1202. }(input), isSupported;
  1203. }(elem, opts);
  1204. if (!1 !== isSupported && (el = elem, $el = $(el), !0 === opts.colorMask && initializeColorMask(el),
  1205. android && (el.hasOwnProperty("inputmode") && (el.inputmode = opts.inputmode, el.setAttribute("inputmode", opts.inputmode)),
  1206. "rtfm" === opts.androidHack && (!0 !== opts.colorMask && initializeColorMask(el),
  1207. el.type = "password")), !0 === isSupported && (EventRuler.on(el, "submit", EventHandlers.submitEvent),
  1208. EventRuler.on(el, "reset", EventHandlers.resetEvent), EventRuler.on(el, "mouseenter", EventHandlers.mouseenterEvent),
  1209. EventRuler.on(el, "blur", EventHandlers.blurEvent), EventRuler.on(el, "focus", EventHandlers.focusEvent),
  1210. EventRuler.on(el, "mouseleave", EventHandlers.mouseleaveEvent), !0 !== opts.colorMask && EventRuler.on(el, "click", EventHandlers.clickEvent),
  1211. EventRuler.on(el, "dblclick", EventHandlers.dblclickEvent), EventRuler.on(el, "paste", EventHandlers.pasteEvent),
  1212. EventRuler.on(el, "dragdrop", EventHandlers.pasteEvent), EventRuler.on(el, "drop", EventHandlers.pasteEvent),
  1213. EventRuler.on(el, "cut", EventHandlers.cutEvent), EventRuler.on(el, "complete", opts.oncomplete),
  1214. EventRuler.on(el, "incomplete", opts.onincomplete), EventRuler.on(el, "cleared", opts.oncleared),
  1215. android || !0 === opts.inputEventOnly || (EventRuler.on(el, "keydown", EventHandlers.keydownEvent),
  1216. EventRuler.on(el, "keypress", EventHandlers.keypressEvent)), EventRuler.on(el, "compositionstart", $.noop),
  1217. EventRuler.on(el, "compositionupdate", $.noop), EventRuler.on(el, "compositionend", $.noop),
  1218. EventRuler.on(el, "keyup", $.noop), EventRuler.on(el, "input", EventHandlers.inputFallBackEvent),
  1219. EventRuler.on(el, "beforeinput", $.noop)), EventRuler.on(el, "setvalue", EventHandlers.setValueEvent),
  1220. undoValue = getBufferTemplate().join(""), "" !== el.inputmask._valueGet(!0) || !1 === opts.clearMaskOnLostFocus || document.activeElement === el)) {
  1221. var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(el.inputmask._valueGet(!0), opts) || el.inputmask._valueGet(!0) : el.inputmask._valueGet(!0);
  1222. "" !== initialValue && checkVal(el, !0, !1, isRTL ? initialValue.split("").reverse() : initialValue.split(""));
  1223. var buffer = getBuffer().slice();
  1224. undoValue = buffer.join(""), !1 === isComplete(buffer) && opts.clearIncomplete && resetMaskSet(),
  1225. opts.clearMaskOnLostFocus && document.activeElement !== el && (-1 === getLastValidPosition() ? buffer = [] : clearOptionalTail(buffer)),
  1226. writeBuffer(el, buffer), document.activeElement === el && caret(el, seekNext(getLastValidPosition()));
  1227. }
  1228. }(el);
  1229. break;
  1230. case "format":
  1231. return valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(actionObj.value, opts) || actionObj.value : actionObj.value).split(""),
  1232. checkVal(undefined, !0, !1, isRTL ? valueBuffer.reverse() : valueBuffer), actionObj.metadata ? {
  1233. value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
  1234. metadata: maskScope.call(this, {
  1235. action: "getmetadata"
  1236. }, maskset, opts)
  1237. } : isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join("");
  1238. case "isValid":
  1239. actionObj.value ? (valueBuffer = actionObj.value.split(""), checkVal(undefined, !0, !0, isRTL ? valueBuffer.reverse() : valueBuffer)) : actionObj.value = getBuffer().join("");
  1240. for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ;
  1241. return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value === getBuffer().join("");
  1242. case "getemptymask":
  1243. return getBufferTemplate().join("");
  1244. case "remove":
  1245. if (el && el.inputmask) {
  1246. $el = $(el), el.inputmask._valueSet(opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(!0)),
  1247. EventRuler.off(el);
  1248. Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), "value") && el.inputmask.__valueGet && Object.defineProperty(el, "value", {
  1249. get: el.inputmask.__valueGet,
  1250. set: el.inputmask.__valueSet,
  1251. configurable: !0
  1252. }) : document.__lookupGetter__ && el.__lookupGetter__("value") && el.inputmask.__valueGet && (el.__defineGetter__("value", el.inputmask.__valueGet),
  1253. el.__defineSetter__("value", el.inputmask.__valueSet)), el.inputmask = undefined;
  1254. }
  1255. return el;
  1256. case "getmetadata":
  1257. if ($.isArray(maskset.metadata)) {
  1258. var maskTarget = getMaskTemplate(!0, 0, !1).join("");
  1259. return $.each(maskset.metadata, function(ndx, mtdt) {
  1260. if (mtdt.mask === maskTarget) return maskTarget = mtdt, !1;
  1261. }), maskTarget;
  1262. }
  1263. return maskset.metadata;
  1264. }
  1265. }
  1266. var ua = navigator.userAgent, mobile = /mobile/i.test(ua), iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile, android = /android/i.test(ua) && !iemobile;
  1267. return Inputmask.prototype = {
  1268. dataAttribute: "data-inputmask",
  1269. defaults: {
  1270. placeholder: "_",
  1271. optionalmarker: {
  1272. start: "[",
  1273. end: "]"
  1274. },
  1275. quantifiermarker: {
  1276. start: "{",
  1277. end: "}"
  1278. },
  1279. groupmarker: {
  1280. start: "(",
  1281. end: ")"
  1282. },
  1283. alternatormarker: "|",
  1284. escapeChar: "\\",
  1285. mask: null,
  1286. regex: null,
  1287. oncomplete: $.noop,
  1288. onincomplete: $.noop,
  1289. oncleared: $.noop,
  1290. repeat: 0,
  1291. greedy: !0,
  1292. autoUnmask: !1,
  1293. removeMaskOnSubmit: !1,
  1294. clearMaskOnLostFocus: !0,
  1295. insertMode: !0,
  1296. clearIncomplete: !1,
  1297. alias: null,
  1298. onKeyDown: $.noop,
  1299. onBeforeMask: null,
  1300. onBeforePaste: function(pastedValue, opts) {
  1301. return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(pastedValue, opts) : pastedValue;
  1302. },
  1303. onBeforeWrite: null,
  1304. onUnMask: null,
  1305. showMaskOnFocus: !0,
  1306. showMaskOnHover: !0,
  1307. onKeyValidation: $.noop,
  1308. skipOptionalPartCharacter: " ",
  1309. numericInput: !1,
  1310. rightAlign: !1,
  1311. undoOnEscape: !0,
  1312. radixPoint: "",
  1313. radixPointDefinitionSymbol: undefined,
  1314. groupSeparator: "",
  1315. keepStatic: null,
  1316. positionCaretOnTab: !0,
  1317. tabThrough: !1,
  1318. supportsInputType: [ "text", "tel", "password" ],
  1319. 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 ],
  1320. isComplete: null,
  1321. canClearPosition: $.noop,
  1322. preValidation: null,
  1323. postValidation: null,
  1324. staticDefinitionSymbol: undefined,
  1325. jitMasking: !1,
  1326. nullable: !0,
  1327. inputEventOnly: !1,
  1328. noValuePatching: !1,
  1329. positionCaretOnClick: "lvp",
  1330. casing: null,
  1331. inputmode: "verbatim",
  1332. colorMask: !1,
  1333. androidHack: !1
  1334. },
  1335. definitions: {
  1336. "9": {
  1337. validator: "[0-9]",
  1338. cardinality: 1,
  1339. definitionSymbol: "*"
  1340. },
  1341. a: {
  1342. validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  1343. cardinality: 1,
  1344. definitionSymbol: "*"
  1345. },
  1346. "*": {
  1347. validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  1348. cardinality: 1
  1349. }
  1350. },
  1351. aliases: {},
  1352. masksCache: {},
  1353. mask: function(elems) {
  1354. function importAttributeOptions(npt, opts, userOptions, dataAttribute) {
  1355. function importOption(option, optionData) {
  1356. null !== (optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + "-" + option)) && ("string" == typeof optionData && (0 === option.indexOf("on") ? optionData = window[optionData] : "false" === optionData ? optionData = !1 : "true" === optionData && (optionData = !0)),
  1357. userOptions[option] = optionData);
  1358. }
  1359. ("rtl" === npt.dir || opts.rightAlign) && (npt.style.textAlign = "right"), ("rtl" === npt.dir || opts.numericInput) && (npt.dir = "ltr",
  1360. npt.removeAttribute("dir"), opts.isRTL = !0);
  1361. var option, dataoptions, optionData, p, attrOptions = npt.getAttribute(dataAttribute);
  1362. if (attrOptions && "" !== attrOptions && (attrOptions = attrOptions.replace(new RegExp("'", "g"), '"'),
  1363. dataoptions = JSON.parse("{" + attrOptions + "}")), dataoptions) {
  1364. optionData = undefined;
  1365. for (p in dataoptions) if ("alias" === p.toLowerCase()) {
  1366. optionData = dataoptions[p];
  1367. break;
  1368. }
  1369. }
  1370. importOption("alias", optionData), userOptions.alias && resolveAlias(userOptions.alias, userOptions, opts);
  1371. for (option in opts) {
  1372. if (dataoptions) {
  1373. optionData = undefined;
  1374. for (p in dataoptions) if (p.toLowerCase() === option.toLowerCase()) {
  1375. optionData = dataoptions[p];
  1376. break;
  1377. }
  1378. }
  1379. importOption(option, optionData);
  1380. }
  1381. return $.extend(!0, opts, userOptions), opts;
  1382. }
  1383. var that = this;
  1384. return "string" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)),
  1385. elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) {
  1386. var scopedOpts = $.extend(!0, {}, that.opts);
  1387. importAttributeOptions(el, scopedOpts, $.extend(!0, {}, that.userOptions), that.dataAttribute);
  1388. var maskset = generateMaskSet(scopedOpts, that.noMasksCache);
  1389. maskset !== undefined && (el.inputmask !== undefined && el.inputmask.remove(), el.inputmask = new Inputmask(undefined, undefined, !0),
  1390. el.inputmask.opts = scopedOpts, el.inputmask.noMasksCache = that.noMasksCache, el.inputmask.userOptions = $.extend(!0, {}, that.userOptions),
  1391. el.inputmask.isRTL = scopedOpts.isRTL, el.inputmask.el = el, el.inputmask.maskset = maskset,
  1392. $.data(el, "_inputmask_opts", scopedOpts), maskScope.call(el.inputmask, {
  1393. action: "mask"
  1394. }));
  1395. }), elems && elems[0] ? elems[0].inputmask || this : this;
  1396. },
  1397. option: function(options, noremask) {
  1398. return "string" == typeof options ? this.opts[options] : "object" === (void 0 === options ? "undefined" : _typeof(options)) ? ($.extend(this.userOptions, options),
  1399. this.el && !0 !== noremask && this.mask(this.el), this) : void 0;
  1400. },
  1401. unmaskedvalue: function(value) {
  1402. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1403. maskScope.call(this, {
  1404. action: "unmaskedvalue",
  1405. value: value
  1406. });
  1407. },
  1408. remove: function() {
  1409. return maskScope.call(this, {
  1410. action: "remove"
  1411. });
  1412. },
  1413. getemptymask: function() {
  1414. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1415. maskScope.call(this, {
  1416. action: "getemptymask"
  1417. });
  1418. },
  1419. hasMaskedValue: function() {
  1420. return !this.opts.autoUnmask;
  1421. },
  1422. isComplete: function() {
  1423. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1424. maskScope.call(this, {
  1425. action: "isComplete"
  1426. });
  1427. },
  1428. getmetadata: function() {
  1429. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1430. maskScope.call(this, {
  1431. action: "getmetadata"
  1432. });
  1433. },
  1434. isValid: function(value) {
  1435. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1436. maskScope.call(this, {
  1437. action: "isValid",
  1438. value: value
  1439. });
  1440. },
  1441. format: function(value, metadata) {
  1442. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1443. maskScope.call(this, {
  1444. action: "format",
  1445. value: value,
  1446. metadata: metadata
  1447. });
  1448. },
  1449. analyseMask: function(mask, regexMask, opts) {
  1450. function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {
  1451. this.matches = [], this.openGroup = isGroup || !1, this.alternatorGroup = !1, this.isGroup = isGroup || !1,
  1452. this.isOptional = isOptional || !1, this.isQuantifier = isQuantifier || !1, this.isAlternator = isAlternator || !1,
  1453. this.quantifier = {
  1454. min: 1,
  1455. max: 1
  1456. };
  1457. }
  1458. function insertTestDefinition(mtoken, element, position) {
  1459. position = position !== undefined ? position : mtoken.matches.length;
  1460. var prevMatch = mtoken.matches[position - 1];
  1461. if (regexMask) 0 === element.indexOf("[") || escaped ? mtoken.matches.splice(position++, 0, {
  1462. fn: new RegExp(element, opts.casing ? "i" : ""),
  1463. cardinality: 1,
  1464. optionality: mtoken.isOptional,
  1465. newBlockMarker: prevMatch === undefined || prevMatch.def !== element,
  1466. casing: null,
  1467. def: element,
  1468. placeholder: undefined,
  1469. nativeDef: element
  1470. }) : $.each(element.split(""), function(ndx, lmnt) {
  1471. prevMatch = mtoken.matches[position - 1], mtoken.matches.splice(position++, 0, {
  1472. fn: null,
  1473. cardinality: 0,
  1474. optionality: mtoken.isOptional,
  1475. newBlockMarker: prevMatch === undefined || prevMatch.def !== lmnt && null !== prevMatch.fn,
  1476. casing: null,
  1477. def: opts.staticDefinitionSymbol || lmnt,
  1478. placeholder: opts.staticDefinitionSymbol !== undefined ? lmnt : undefined,
  1479. nativeDef: lmnt
  1480. });
  1481. }), escaped = !1; else {
  1482. var maskdef = (opts.definitions ? opts.definitions[element] : undefined) || Inputmask.prototype.definitions[element];
  1483. if (maskdef && !escaped) {
  1484. for (var prevalidators = maskdef.prevalidator, prevalidatorsL = prevalidators ? prevalidators.length : 0, i = 1; i < maskdef.cardinality; i++) {
  1485. var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator.validator, cardinality = prevalidator.cardinality;
  1486. mtoken.matches.splice(position++, 0, {
  1487. fn: validator ? "string" == typeof validator ? new RegExp(validator, opts.casing ? "i" : "") : new function() {
  1488. this.test = validator;
  1489. }() : new RegExp("."),
  1490. cardinality: cardinality || 1,
  1491. optionality: mtoken.isOptional,
  1492. newBlockMarker: prevMatch === undefined || prevMatch.def !== (maskdef.definitionSymbol || element),
  1493. casing: maskdef.casing,
  1494. def: maskdef.definitionSymbol || element,
  1495. placeholder: maskdef.placeholder,
  1496. nativeDef: element
  1497. }), prevMatch = mtoken.matches[position - 1];
  1498. }
  1499. mtoken.matches.splice(position++, 0, {
  1500. fn: maskdef.validator ? "string" == typeof maskdef.validator ? new RegExp(maskdef.validator, opts.casing ? "i" : "") : new function() {
  1501. this.test = maskdef.validator;
  1502. }() : new RegExp("."),
  1503. cardinality: maskdef.cardinality,
  1504. optionality: mtoken.isOptional,
  1505. newBlockMarker: prevMatch === undefined || prevMatch.def !== (maskdef.definitionSymbol || element),
  1506. casing: maskdef.casing,
  1507. def: maskdef.definitionSymbol || element,
  1508. placeholder: maskdef.placeholder,
  1509. nativeDef: element
  1510. });
  1511. } else mtoken.matches.splice(position++, 0, {
  1512. fn: null,
  1513. cardinality: 0,
  1514. optionality: mtoken.isOptional,
  1515. newBlockMarker: prevMatch === undefined || prevMatch.def !== element && null !== prevMatch.fn,
  1516. casing: null,
  1517. def: opts.staticDefinitionSymbol || element,
  1518. placeholder: opts.staticDefinitionSymbol !== undefined ? element : undefined,
  1519. nativeDef: element
  1520. }), escaped = !1;
  1521. }
  1522. }
  1523. function verifyGroupMarker(maskToken) {
  1524. maskToken && maskToken.matches && $.each(maskToken.matches, function(ndx, token) {
  1525. var nextToken = maskToken.matches[ndx + 1];
  1526. (nextToken === undefined || nextToken.matches === undefined || !1 === nextToken.isQuantifier) && token && token.isGroup && (token.isGroup = !1,
  1527. regexMask || (insertTestDefinition(token, opts.groupmarker.start, 0), !0 !== token.openGroup && insertTestDefinition(token, opts.groupmarker.end))),
  1528. verifyGroupMarker(token);
  1529. });
  1530. }
  1531. function defaultCase() {
  1532. if (openenings.length > 0) {
  1533. if (currentOpeningToken = openenings[openenings.length - 1], insertTestDefinition(currentOpeningToken, m),
  1534. currentOpeningToken.isAlternator) {
  1535. alternator = openenings.pop();
  1536. for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1;
  1537. openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1],
  1538. currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);
  1539. }
  1540. } else insertTestDefinition(currentToken, m);
  1541. }
  1542. function reverseTokens(maskToken) {
  1543. maskToken.matches = maskToken.matches.reverse();
  1544. for (var match in maskToken.matches) if (maskToken.matches.hasOwnProperty(match)) {
  1545. var intMatch = parseInt(match);
  1546. if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {
  1547. var qt = maskToken.matches[match];
  1548. maskToken.matches.splice(match, 1), maskToken.matches.splice(intMatch + 1, 0, qt);
  1549. }
  1550. maskToken.matches[match].matches !== undefined ? maskToken.matches[match] = reverseTokens(maskToken.matches[match]) : maskToken.matches[match] = function(st) {
  1551. return st === opts.optionalmarker.start ? st = opts.optionalmarker.end : st === opts.optionalmarker.end ? st = opts.optionalmarker.start : st === opts.groupmarker.start ? st = opts.groupmarker.end : st === opts.groupmarker.end && (st = opts.groupmarker.start),
  1552. st;
  1553. }(maskToken.matches[match]);
  1554. }
  1555. return maskToken;
  1556. }
  1557. var match, m, openingToken, currentOpeningToken, alternator, lastMatch, groupToken, tokenizer = /(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g, regexTokenizer = /\[\^?]?(?:[^\\\]]+|\\[\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, escaped = !1, currentToken = new MaskToken(), openenings = [], maskTokens = [];
  1558. for (regexMask && (opts.optionalmarker.start = undefined, opts.optionalmarker.end = undefined); match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask); ) {
  1559. if (m = match[0], regexMask && !0 !== escaped) switch (m.charAt(0)) {
  1560. case "?":
  1561. m = "{0,1}";
  1562. break;
  1563. case "+":
  1564. case "*":
  1565. m = "{" + m + "}";
  1566. }
  1567. if (escaped) defaultCase(); else switch (m.charAt(0)) {
  1568. case opts.escapeChar:
  1569. escaped = !0, regexMask && defaultCase();
  1570. break;
  1571. case opts.optionalmarker.end:
  1572. case opts.groupmarker.end:
  1573. if (openingToken = openenings.pop(), openingToken.openGroup = !1, openingToken !== undefined) if (openenings.length > 0) {
  1574. if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken),
  1575. currentOpeningToken.isAlternator) {
  1576. alternator = openenings.pop();
  1577. for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1,
  1578. alternator.matches[mndx].alternatorGroup = !1;
  1579. openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1],
  1580. currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);
  1581. }
  1582. } else currentToken.matches.push(openingToken); else defaultCase();
  1583. break;
  1584. case opts.optionalmarker.start:
  1585. openenings.push(new MaskToken(!1, !0));
  1586. break;
  1587. case opts.groupmarker.start:
  1588. openenings.push(new MaskToken(!0));
  1589. break;
  1590. case opts.quantifiermarker.start:
  1591. var quantifier = new MaskToken(!1, !1, !0);
  1592. m = m.replace(/[{}]/g, "");
  1593. var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);
  1594. if ("*" !== mq1 && "+" !== mq1 || (mq0 = "*" === mq1 ? 0 : 1), quantifier.quantifier = {
  1595. min: mq0,
  1596. max: mq1
  1597. }, openenings.length > 0) {
  1598. var matches = openenings[openenings.length - 1].matches;
  1599. match = matches.pop(), match.isGroup || (groupToken = new MaskToken(!0), groupToken.matches.push(match),
  1600. match = groupToken), matches.push(match), matches.push(quantifier);
  1601. } else match = currentToken.matches.pop(), match.isGroup || (regexMask && null === match.fn && "." === match.def && (match.fn = new RegExp(match.def, opts.casing ? "i" : "")),
  1602. groupToken = new MaskToken(!0), groupToken.matches.push(match), match = groupToken),
  1603. currentToken.matches.push(match), currentToken.matches.push(quantifier);
  1604. break;
  1605. case opts.alternatormarker:
  1606. if (openenings.length > 0) {
  1607. currentOpeningToken = openenings[openenings.length - 1];
  1608. var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];
  1609. lastMatch = currentOpeningToken.openGroup && (subToken.matches === undefined || !1 === subToken.isGroup && !1 === subToken.isAlternator) ? openenings.pop() : currentOpeningToken.matches.pop();
  1610. } else lastMatch = currentToken.matches.pop();
  1611. if (lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(),
  1612. lastMatch.alternatorGroup = !1) : alternator = new MaskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch),
  1613. openenings.push(alternator), lastMatch.openGroup) {
  1614. lastMatch.openGroup = !1;
  1615. var alternatorGroup = new MaskToken(!0);
  1616. alternatorGroup.alternatorGroup = !0, openenings.push(alternatorGroup);
  1617. }
  1618. break;
  1619. default:
  1620. defaultCase();
  1621. }
  1622. }
  1623. for (;openenings.length > 0; ) openingToken = openenings.pop(), currentToken.matches.push(openingToken);
  1624. return currentToken.matches.length > 0 && (verifyGroupMarker(currentToken), maskTokens.push(currentToken)),
  1625. (opts.numericInput || opts.isRTL) && reverseTokens(maskTokens[0]), maskTokens;
  1626. }
  1627. }, Inputmask.extendDefaults = function(options) {
  1628. $.extend(!0, Inputmask.prototype.defaults, options);
  1629. }, Inputmask.extendDefinitions = function(definition) {
  1630. $.extend(!0, Inputmask.prototype.definitions, definition);
  1631. }, Inputmask.extendAliases = function(alias) {
  1632. $.extend(!0, Inputmask.prototype.aliases, alias);
  1633. }, Inputmask.format = function(value, options, metadata) {
  1634. return Inputmask(options).format(value, metadata);
  1635. }, Inputmask.unmask = function(value, options) {
  1636. return Inputmask(options).unmaskedvalue(value);
  1637. }, Inputmask.isValid = function(value, options) {
  1638. return Inputmask(options).isValid(value);
  1639. }, Inputmask.remove = function(elems) {
  1640. $.each(elems, function(ndx, el) {
  1641. el.inputmask && el.inputmask.remove();
  1642. });
  1643. }, Inputmask.escapeRegex = function(str) {
  1644. var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ];
  1645. return str.replace(new RegExp("(\\" + specials.join("|\\") + ")", "gim"), "\\$1");
  1646. }, Inputmask.keyCode = {
  1647. ALT: 18,
  1648. BACKSPACE: 8,
  1649. BACKSPACE_SAFARI: 127,
  1650. CAPS_LOCK: 20,
  1651. COMMA: 188,
  1652. COMMAND: 91,
  1653. COMMAND_LEFT: 91,
  1654. COMMAND_RIGHT: 93,
  1655. CONTROL: 17,
  1656. DELETE: 46,
  1657. DOWN: 40,
  1658. END: 35,
  1659. ENTER: 13,
  1660. ESCAPE: 27,
  1661. HOME: 36,
  1662. INSERT: 45,
  1663. LEFT: 37,
  1664. MENU: 93,
  1665. NUMPAD_ADD: 107,
  1666. NUMPAD_DECIMAL: 110,
  1667. NUMPAD_DIVIDE: 111,
  1668. NUMPAD_ENTER: 108,
  1669. NUMPAD_MULTIPLY: 106,
  1670. NUMPAD_SUBTRACT: 109,
  1671. PAGE_DOWN: 34,
  1672. PAGE_UP: 33,
  1673. PERIOD: 190,
  1674. RIGHT: 39,
  1675. SHIFT: 16,
  1676. SPACE: 32,
  1677. TAB: 9,
  1678. UP: 38,
  1679. WINDOWS: 91,
  1680. X: 88
  1681. }, Inputmask;
  1682. });
  1683. }, function(module, exports) {
  1684. module.exports = jQuery;
  1685. }, function(module, exports, __webpack_require__) {
  1686. "use strict";
  1687. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  1688. "function" == typeof Symbol && Symbol.iterator;
  1689. !function(factory) {
  1690. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  1691. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  1692. }(function($, Inputmask) {
  1693. function isLeapYear(year) {
  1694. return isNaN(year) || 29 === new Date(year, 2, 0).getDate();
  1695. }
  1696. return Inputmask.extendAliases({
  1697. "dd/mm/yyyy": {
  1698. mask: "1/2/y",
  1699. placeholder: "dd/mm/yyyy",
  1700. regex: {
  1701. val1pre: new RegExp("[0-3]"),
  1702. val1: new RegExp("0[1-9]|[12][0-9]|3[01]"),
  1703. val2pre: function(separator) {
  1704. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  1705. return new RegExp("((0[1-9]|[12][0-9]|3[01])" + escapedSeparator + "[01])");
  1706. },
  1707. val2: function(separator) {
  1708. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  1709. return new RegExp("((0[1-9]|[12][0-9])" + escapedSeparator + "(0[1-9]|1[012]))|(30" + escapedSeparator + "(0[13-9]|1[012]))|(31" + escapedSeparator + "(0[13578]|1[02]))");
  1710. }
  1711. },
  1712. leapday: "29/02/",
  1713. separator: "/",
  1714. yearrange: {
  1715. minyear: 1900,
  1716. maxyear: 2099
  1717. },
  1718. isInYearRange: function(chrs, minyear, maxyear) {
  1719. if (isNaN(chrs)) return !1;
  1720. var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length))), enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length)));
  1721. return !isNaN(enteredyear) && (minyear <= enteredyear && enteredyear <= maxyear) || !isNaN(enteredyear2) && (minyear <= enteredyear2 && enteredyear2 <= maxyear);
  1722. },
  1723. determinebaseyear: function(minyear, maxyear, hint) {
  1724. var currentyear = new Date().getFullYear();
  1725. if (minyear > currentyear) return minyear;
  1726. if (maxyear < currentyear) {
  1727. for (var maxYearPrefix = maxyear.toString().slice(0, 2), maxYearPostfix = maxyear.toString().slice(2, 4); maxyear < maxYearPrefix + hint; ) maxYearPrefix--;
  1728. var maxxYear = maxYearPrefix + maxYearPostfix;
  1729. return minyear > maxxYear ? minyear : maxxYear;
  1730. }
  1731. if (minyear <= currentyear && currentyear <= maxyear) {
  1732. for (var currentYearPrefix = currentyear.toString().slice(0, 2); maxyear < currentYearPrefix + hint; ) currentYearPrefix--;
  1733. var currentYearAndHint = currentYearPrefix + hint;
  1734. return currentYearAndHint < minyear ? minyear : currentYearAndHint;
  1735. }
  1736. return currentyear;
  1737. },
  1738. onKeyDown: function(e, buffer, caretPos, opts) {
  1739. var $input = $(this);
  1740. if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
  1741. var today = new Date();
  1742. $input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString()),
  1743. $input.trigger("setvalue");
  1744. }
  1745. },
  1746. getFrontValue: function(mask, buffer, opts) {
  1747. for (var start = 0, length = 0, i = 0; i < mask.length && "2" !== mask.charAt(i); i++) {
  1748. var definition = opts.definitions[mask.charAt(i)];
  1749. definition ? (start += length, length = definition.cardinality) : length++;
  1750. }
  1751. return buffer.join("").substr(start, length);
  1752. },
  1753. postValidation: function(buffer, currentResult, opts) {
  1754. var dayMonthValue, year, bufferStr = buffer.join("");
  1755. return 0 === opts.mask.indexOf("y") ? (year = bufferStr.substr(0, 4), dayMonthValue = bufferStr.substring(4, 10)) : (year = bufferStr.substring(6, 10),
  1756. dayMonthValue = bufferStr.substr(0, 6)), currentResult && (dayMonthValue !== opts.leapday || isLeapYear(year));
  1757. },
  1758. definitions: {
  1759. "1": {
  1760. validator: function(chrs, maskset, pos, strict, opts) {
  1761. var isValid = opts.regex.val1.test(chrs);
  1762. return strict || isValid || chrs.charAt(1) !== opts.separator && -1 === "-./".indexOf(chrs.charAt(1)) || !(isValid = opts.regex.val1.test("0" + chrs.charAt(0))) ? isValid : (maskset.buffer[pos - 1] = "0",
  1763. {
  1764. refreshFromBuffer: {
  1765. start: pos - 1,
  1766. end: pos
  1767. },
  1768. pos: pos,
  1769. c: chrs.charAt(0)
  1770. });
  1771. },
  1772. cardinality: 2,
  1773. prevalidator: [ {
  1774. validator: function(chrs, maskset, pos, strict, opts) {
  1775. var pchrs = chrs;
  1776. isNaN(maskset.buffer[pos + 1]) || (pchrs += maskset.buffer[pos + 1]);
  1777. var isValid = 1 === pchrs.length ? opts.regex.val1pre.test(pchrs) : opts.regex.val1.test(pchrs);
  1778. if (!strict && !isValid) {
  1779. if (isValid = opts.regex.val1.test(chrs + "0")) return maskset.buffer[pos] = chrs,
  1780. maskset.buffer[++pos] = "0", {
  1781. pos: pos,
  1782. c: "0"
  1783. };
  1784. if (isValid = opts.regex.val1.test("0" + chrs)) return maskset.buffer[pos] = "0",
  1785. pos++, {
  1786. pos: pos
  1787. };
  1788. }
  1789. return isValid;
  1790. },
  1791. cardinality: 1
  1792. } ]
  1793. },
  1794. "2": {
  1795. validator: function(chrs, maskset, pos, strict, opts) {
  1796. var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts);
  1797. -1 !== frontValue.indexOf(opts.placeholder[0]) && (frontValue = "01" + opts.separator);
  1798. var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
  1799. return strict || isValid || chrs.charAt(1) !== opts.separator && -1 === "-./".indexOf(chrs.charAt(1)) || !(isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0))) ? isValid : (maskset.buffer[pos - 1] = "0",
  1800. {
  1801. refreshFromBuffer: {
  1802. start: pos - 1,
  1803. end: pos
  1804. },
  1805. pos: pos,
  1806. c: chrs.charAt(0)
  1807. });
  1808. },
  1809. cardinality: 2,
  1810. prevalidator: [ {
  1811. validator: function(chrs, maskset, pos, strict, opts) {
  1812. isNaN(maskset.buffer[pos + 1]) || (chrs += maskset.buffer[pos + 1]);
  1813. var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts);
  1814. -1 !== frontValue.indexOf(opts.placeholder[0]) && (frontValue = "01" + opts.separator);
  1815. var isValid = 1 === chrs.length ? opts.regex.val2pre(opts.separator).test(frontValue + chrs) : opts.regex.val2(opts.separator).test(frontValue + chrs);
  1816. return strict || isValid || !(isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
  1817. pos++, {
  1818. pos: pos
  1819. });
  1820. },
  1821. cardinality: 1
  1822. } ]
  1823. },
  1824. y: {
  1825. validator: function(chrs, maskset, pos, strict, opts) {
  1826. return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
  1827. },
  1828. cardinality: 4,
  1829. prevalidator: [ {
  1830. validator: function(chrs, maskset, pos, strict, opts) {
  1831. var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
  1832. if (!strict && !isValid) {
  1833. var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 1);
  1834. if (isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0),
  1835. {
  1836. pos: pos
  1837. };
  1838. if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 2),
  1839. isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0),
  1840. maskset.buffer[pos++] = yearPrefix.charAt(1), {
  1841. pos: pos
  1842. };
  1843. }
  1844. return isValid;
  1845. },
  1846. cardinality: 1
  1847. }, {
  1848. validator: function(chrs, maskset, pos, strict, opts) {
  1849. var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
  1850. if (!strict && !isValid) {
  1851. var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2);
  1852. if (isValid = opts.isInYearRange(chrs[0] + yearPrefix[1] + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(1),
  1853. {
  1854. pos: pos
  1855. };
  1856. if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2),
  1857. isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos - 1] = yearPrefix.charAt(0),
  1858. maskset.buffer[pos++] = yearPrefix.charAt(1), maskset.buffer[pos++] = chrs.charAt(0),
  1859. {
  1860. refreshFromBuffer: {
  1861. start: pos - 3,
  1862. end: pos
  1863. },
  1864. pos: pos
  1865. };
  1866. }
  1867. return isValid;
  1868. },
  1869. cardinality: 2
  1870. }, {
  1871. validator: function(chrs, maskset, pos, strict, opts) {
  1872. return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
  1873. },
  1874. cardinality: 3
  1875. } ]
  1876. }
  1877. },
  1878. insertMode: !1,
  1879. autoUnmask: !1
  1880. },
  1881. "mm/dd/yyyy": {
  1882. placeholder: "mm/dd/yyyy",
  1883. alias: "dd/mm/yyyy",
  1884. regex: {
  1885. val2pre: function(separator) {
  1886. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  1887. return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])");
  1888. },
  1889. val2: function(separator) {
  1890. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  1891. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)");
  1892. },
  1893. val1pre: new RegExp("[01]"),
  1894. val1: new RegExp("0[1-9]|1[012]")
  1895. },
  1896. leapday: "02/29/",
  1897. onKeyDown: function(e, buffer, caretPos, opts) {
  1898. var $input = $(this);
  1899. if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
  1900. var today = new Date();
  1901. $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()),
  1902. $input.trigger("setvalue");
  1903. }
  1904. }
  1905. },
  1906. "yyyy/mm/dd": {
  1907. mask: "y/1/2",
  1908. placeholder: "yyyy/mm/dd",
  1909. alias: "mm/dd/yyyy",
  1910. leapday: "/02/29",
  1911. onKeyDown: function(e, buffer, caretPos, opts) {
  1912. var $input = $(this);
  1913. if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
  1914. var today = new Date();
  1915. $input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString()),
  1916. $input.trigger("setvalue");
  1917. }
  1918. }
  1919. },
  1920. "dd.mm.yyyy": {
  1921. mask: "1.2.y",
  1922. placeholder: "dd.mm.yyyy",
  1923. leapday: "29.02.",
  1924. separator: ".",
  1925. alias: "dd/mm/yyyy"
  1926. },
  1927. "dd-mm-yyyy": {
  1928. mask: "1-2-y",
  1929. placeholder: "dd-mm-yyyy",
  1930. leapday: "29-02-",
  1931. separator: "-",
  1932. alias: "dd/mm/yyyy"
  1933. },
  1934. "mm.dd.yyyy": {
  1935. mask: "1.2.y",
  1936. placeholder: "mm.dd.yyyy",
  1937. leapday: "02.29.",
  1938. separator: ".",
  1939. alias: "mm/dd/yyyy"
  1940. },
  1941. "mm-dd-yyyy": {
  1942. mask: "1-2-y",
  1943. placeholder: "mm-dd-yyyy",
  1944. leapday: "02-29-",
  1945. separator: "-",
  1946. alias: "mm/dd/yyyy"
  1947. },
  1948. "yyyy.mm.dd": {
  1949. mask: "y.1.2",
  1950. placeholder: "yyyy.mm.dd",
  1951. leapday: ".02.29",
  1952. separator: ".",
  1953. alias: "yyyy/mm/dd"
  1954. },
  1955. "yyyy-mm-dd": {
  1956. mask: "y-1-2",
  1957. placeholder: "yyyy-mm-dd",
  1958. leapday: "-02-29",
  1959. separator: "-",
  1960. alias: "yyyy/mm/dd"
  1961. },
  1962. datetime: {
  1963. mask: "1/2/y h:s",
  1964. placeholder: "dd/mm/yyyy hh:mm",
  1965. alias: "dd/mm/yyyy",
  1966. regex: {
  1967. hrspre: new RegExp("[012]"),
  1968. hrs24: new RegExp("2[0-4]|1[3-9]"),
  1969. hrs: new RegExp("[01][0-9]|2[0-4]"),
  1970. ampm: new RegExp("^[a|p|A|P][m|M]"),
  1971. mspre: new RegExp("[0-5]"),
  1972. ms: new RegExp("[0-5][0-9]")
  1973. },
  1974. timeseparator: ":",
  1975. hourFormat: "24",
  1976. definitions: {
  1977. h: {
  1978. validator: function(chrs, maskset, pos, strict, opts) {
  1979. if ("24" === opts.hourFormat && 24 === parseInt(chrs, 10)) return maskset.buffer[pos - 1] = "0",
  1980. maskset.buffer[pos] = "0", {
  1981. refreshFromBuffer: {
  1982. start: pos - 1,
  1983. end: pos
  1984. },
  1985. c: "0"
  1986. };
  1987. var isValid = opts.regex.hrs.test(chrs);
  1988. if (!strict && !isValid && (chrs.charAt(1) === opts.timeseparator || -1 !== "-.:".indexOf(chrs.charAt(1))) && (isValid = opts.regex.hrs.test("0" + chrs.charAt(0)))) return maskset.buffer[pos - 1] = "0",
  1989. maskset.buffer[pos] = chrs.charAt(0), pos++, {
  1990. refreshFromBuffer: {
  1991. start: pos - 2,
  1992. end: pos
  1993. },
  1994. pos: pos,
  1995. c: opts.timeseparator
  1996. };
  1997. if (isValid && "24" !== opts.hourFormat && opts.regex.hrs24.test(chrs)) {
  1998. var tmp = parseInt(chrs, 10);
  1999. return 24 === tmp ? (maskset.buffer[pos + 5] = "a", maskset.buffer[pos + 6] = "m") : (maskset.buffer[pos + 5] = "p",
  2000. maskset.buffer[pos + 6] = "m"), tmp -= 12, tmp < 10 ? (maskset.buffer[pos] = tmp.toString(),
  2001. maskset.buffer[pos - 1] = "0") : (maskset.buffer[pos] = tmp.toString().charAt(1),
  2002. maskset.buffer[pos - 1] = tmp.toString().charAt(0)), {
  2003. refreshFromBuffer: {
  2004. start: pos - 1,
  2005. end: pos + 6
  2006. },
  2007. c: maskset.buffer[pos]
  2008. };
  2009. }
  2010. return isValid;
  2011. },
  2012. cardinality: 2,
  2013. prevalidator: [ {
  2014. validator: function(chrs, maskset, pos, strict, opts) {
  2015. var isValid = opts.regex.hrspre.test(chrs);
  2016. return strict || isValid || !(isValid = opts.regex.hrs.test("0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
  2017. pos++, {
  2018. pos: pos
  2019. });
  2020. },
  2021. cardinality: 1
  2022. } ]
  2023. },
  2024. s: {
  2025. validator: "[0-5][0-9]",
  2026. cardinality: 2,
  2027. prevalidator: [ {
  2028. validator: function(chrs, maskset, pos, strict, opts) {
  2029. var isValid = opts.regex.mspre.test(chrs);
  2030. return strict || isValid || !(isValid = opts.regex.ms.test("0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
  2031. pos++, {
  2032. pos: pos
  2033. });
  2034. },
  2035. cardinality: 1
  2036. } ]
  2037. },
  2038. t: {
  2039. validator: function(chrs, maskset, pos, strict, opts) {
  2040. return opts.regex.ampm.test(chrs + "m");
  2041. },
  2042. casing: "lower",
  2043. cardinality: 1
  2044. }
  2045. },
  2046. insertMode: !1,
  2047. autoUnmask: !1
  2048. },
  2049. datetime12: {
  2050. mask: "1/2/y h:s t\\m",
  2051. placeholder: "dd/mm/yyyy hh:mm xm",
  2052. alias: "datetime",
  2053. hourFormat: "12"
  2054. },
  2055. "mm/dd/yyyy hh:mm xm": {
  2056. mask: "1/2/y h:s t\\m",
  2057. placeholder: "mm/dd/yyyy hh:mm xm",
  2058. alias: "datetime12",
  2059. regex: {
  2060. val2pre: function(separator) {
  2061. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2062. return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])");
  2063. },
  2064. val2: function(separator) {
  2065. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2066. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)");
  2067. },
  2068. val1pre: new RegExp("[01]"),
  2069. val1: new RegExp("0[1-9]|1[012]")
  2070. },
  2071. leapday: "02/29/",
  2072. onKeyDown: function(e, buffer, caretPos, opts) {
  2073. var $input = $(this);
  2074. if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
  2075. var today = new Date();
  2076. $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()),
  2077. $input.trigger("setvalue");
  2078. }
  2079. }
  2080. },
  2081. "hh:mm t": {
  2082. mask: "h:s t\\m",
  2083. placeholder: "hh:mm xm",
  2084. alias: "datetime",
  2085. hourFormat: "12"
  2086. },
  2087. "h:s t": {
  2088. mask: "h:s t\\m",
  2089. placeholder: "hh:mm xm",
  2090. alias: "datetime",
  2091. hourFormat: "12"
  2092. },
  2093. "hh:mm:ss": {
  2094. mask: "h:s:s",
  2095. placeholder: "hh:mm:ss",
  2096. alias: "datetime",
  2097. autoUnmask: !1
  2098. },
  2099. "hh:mm": {
  2100. mask: "h:s",
  2101. placeholder: "hh:mm",
  2102. alias: "datetime",
  2103. autoUnmask: !1
  2104. },
  2105. date: {
  2106. alias: "dd/mm/yyyy"
  2107. },
  2108. "mm/yyyy": {
  2109. mask: "1/y",
  2110. placeholder: "mm/yyyy",
  2111. leapday: "donotuse",
  2112. separator: "/",
  2113. alias: "mm/dd/yyyy"
  2114. },
  2115. shamsi: {
  2116. regex: {
  2117. val2pre: function(separator) {
  2118. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2119. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "[0-3])");
  2120. },
  2121. val2: function(separator) {
  2122. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2123. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[1-9]|1[012])" + escapedSeparator + "30)|((0[1-6])" + escapedSeparator + "31)");
  2124. },
  2125. val1pre: new RegExp("[01]"),
  2126. val1: new RegExp("0[1-9]|1[012]")
  2127. },
  2128. yearrange: {
  2129. minyear: 1300,
  2130. maxyear: 1499
  2131. },
  2132. mask: "y/1/2",
  2133. leapday: "/12/30",
  2134. placeholder: "yyyy/mm/dd",
  2135. alias: "mm/dd/yyyy",
  2136. clearIncomplete: !0
  2137. },
  2138. "yyyy-mm-dd hh:mm:ss": {
  2139. mask: "y-1-2 h:s:s",
  2140. placeholder: "yyyy-mm-dd hh:mm:ss",
  2141. alias: "datetime",
  2142. separator: "-",
  2143. leapday: "-02-29",
  2144. regex: {
  2145. val2pre: function(separator) {
  2146. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2147. return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])");
  2148. },
  2149. val2: function(separator) {
  2150. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2151. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)");
  2152. },
  2153. val1pre: new RegExp("[01]"),
  2154. val1: new RegExp("0[1-9]|1[012]")
  2155. },
  2156. onKeyDown: function(e, buffer, caretPos, opts) {}
  2157. }
  2158. }), Inputmask;
  2159. });
  2160. }, function(module, exports, __webpack_require__) {
  2161. "use strict";
  2162. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  2163. "function" == typeof Symbol && Symbol.iterator;
  2164. !function(factory) {
  2165. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  2166. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2167. }(function($, Inputmask) {
  2168. return Inputmask.extendDefinitions({
  2169. A: {
  2170. validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  2171. cardinality: 1,
  2172. casing: "upper"
  2173. },
  2174. "&": {
  2175. validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  2176. cardinality: 1,
  2177. casing: "upper"
  2178. },
  2179. "#": {
  2180. validator: "[0-9A-Fa-f]",
  2181. cardinality: 1,
  2182. casing: "upper"
  2183. }
  2184. }), Inputmask.extendAliases({
  2185. url: {
  2186. definitions: {
  2187. i: {
  2188. validator: ".",
  2189. cardinality: 1
  2190. }
  2191. },
  2192. mask: "(\\http://)|(\\http\\s://)|(ftp://)|(ftp\\s://)i{+}",
  2193. insertMode: !1,
  2194. autoUnmask: !1,
  2195. inputmode: "url"
  2196. },
  2197. ip: {
  2198. mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]",
  2199. definitions: {
  2200. i: {
  2201. validator: function(chrs, maskset, pos, strict, opts) {
  2202. return pos - 1 > -1 && "." !== maskset.buffer[pos - 1] ? (chrs = maskset.buffer[pos - 1] + chrs,
  2203. chrs = pos - 2 > -1 && "." !== maskset.buffer[pos - 2] ? maskset.buffer[pos - 2] + chrs : "0" + chrs) : chrs = "00" + chrs,
  2204. new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
  2205. },
  2206. cardinality: 1
  2207. }
  2208. },
  2209. onUnMask: function(maskedValue, unmaskedValue, opts) {
  2210. return maskedValue;
  2211. },
  2212. inputmode: "numeric"
  2213. },
  2214. email: {
  2215. mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",
  2216. greedy: !1,
  2217. onBeforePaste: function(pastedValue, opts) {
  2218. return pastedValue = pastedValue.toLowerCase(), pastedValue.replace("mailto:", "");
  2219. },
  2220. definitions: {
  2221. "*": {
  2222. validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]",
  2223. cardinality: 1,
  2224. casing: "lower"
  2225. },
  2226. "-": {
  2227. validator: "[0-9A-Za-z-]",
  2228. cardinality: 1,
  2229. casing: "lower"
  2230. }
  2231. },
  2232. onUnMask: function(maskedValue, unmaskedValue, opts) {
  2233. return maskedValue;
  2234. },
  2235. inputmode: "email"
  2236. },
  2237. mac: {
  2238. mask: "##:##:##:##:##:##"
  2239. },
  2240. vin: {
  2241. mask: "V{13}9{4}",
  2242. definitions: {
  2243. V: {
  2244. validator: "[A-HJ-NPR-Za-hj-npr-z\\d]",
  2245. cardinality: 1,
  2246. casing: "upper"
  2247. }
  2248. },
  2249. clearIncomplete: !0,
  2250. autoUnmask: !0
  2251. }
  2252. }), Inputmask;
  2253. });
  2254. }, function(module, exports, __webpack_require__) {
  2255. "use strict";
  2256. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  2257. "function" == typeof Symbol && Symbol.iterator;
  2258. !function(factory) {
  2259. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  2260. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2261. }(function($, Inputmask, undefined) {
  2262. function autoEscape(txt, opts) {
  2263. for (var escapedTxt = "", i = 0; i < txt.length; i++) Inputmask.prototype.definitions[txt.charAt(i)] || opts.definitions[txt.charAt(i)] || opts.optionalmarker.start === txt.charAt(i) || opts.optionalmarker.end === txt.charAt(i) || opts.quantifiermarker.start === txt.charAt(i) || opts.quantifiermarker.end === txt.charAt(i) || opts.groupmarker.start === txt.charAt(i) || opts.groupmarker.end === txt.charAt(i) || opts.alternatormarker === txt.charAt(i) ? escapedTxt += "\\" + txt.charAt(i) : escapedTxt += txt.charAt(i);
  2264. return escapedTxt;
  2265. }
  2266. return Inputmask.extendAliases({
  2267. numeric: {
  2268. mask: function(opts) {
  2269. if (0 !== opts.repeat && isNaN(opts.integerDigits) && (opts.integerDigits = opts.repeat),
  2270. opts.repeat = 0, opts.groupSeparator === opts.radixPoint && ("." === opts.radixPoint ? opts.groupSeparator = "," : "," === opts.radixPoint ? opts.groupSeparator = "." : opts.groupSeparator = ""),
  2271. " " === opts.groupSeparator && (opts.skipOptionalPartCharacter = undefined), opts.autoGroup = opts.autoGroup && "" !== opts.groupSeparator,
  2272. opts.autoGroup && ("string" == typeof opts.groupSize && isFinite(opts.groupSize) && (opts.groupSize = parseInt(opts.groupSize)),
  2273. isFinite(opts.integerDigits))) {
  2274. var seps = Math.floor(opts.integerDigits / opts.groupSize), mod = opts.integerDigits % opts.groupSize;
  2275. opts.integerDigits = parseInt(opts.integerDigits) + (0 === mod ? seps - 1 : seps),
  2276. opts.integerDigits < 1 && (opts.integerDigits = "*");
  2277. }
  2278. opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)),
  2279. "radixFocus" === opts.positionCaretOnClick && "" === opts.placeholder && !1 === opts.integerOptional && (opts.positionCaretOnClick = "lvp"),
  2280. opts.definitions[";"] = opts.definitions["~"], opts.definitions[";"].definitionSymbol = "~",
  2281. !0 === opts.numericInput && (opts.positionCaretOnClick = "radixFocus" === opts.positionCaretOnClick ? "lvp" : opts.positionCaretOnClick,
  2282. opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts.decimalProtect = !1);
  2283. var mask = "[+]";
  2284. if (mask += autoEscape(opts.prefix, opts), !0 === opts.integerOptional ? mask += "~{1," + opts.integerDigits + "}" : mask += "~{" + opts.integerDigits + "}",
  2285. opts.digits !== undefined) {
  2286. opts.radixPointDefinitionSymbol = opts.decimalProtect ? ":" : opts.radixPoint;
  2287. var dq = opts.digits.toString().split(",");
  2288. isFinite(dq[0] && dq[1] && isFinite(dq[1])) ? mask += opts.radixPointDefinitionSymbol + ";{" + opts.digits + "}" : (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (opts.digitsOptional ? mask += "[" + opts.radixPointDefinitionSymbol + ";{1," + opts.digits + "}]" : mask += opts.radixPointDefinitionSymbol + ";{" + opts.digits + "}");
  2289. }
  2290. return mask += autoEscape(opts.suffix, opts), mask += "[-]", opts.greedy = !1, mask;
  2291. },
  2292. placeholder: "",
  2293. greedy: !1,
  2294. digits: "*",
  2295. digitsOptional: !0,
  2296. enforceDigitsOnBlur: !1,
  2297. radixPoint: ".",
  2298. positionCaretOnClick: "radixFocus",
  2299. groupSize: 3,
  2300. groupSeparator: "",
  2301. autoGroup: !1,
  2302. allowMinus: !0,
  2303. negationSymbol: {
  2304. front: "-",
  2305. back: ""
  2306. },
  2307. integerDigits: "+",
  2308. integerOptional: !0,
  2309. prefix: "",
  2310. suffix: "",
  2311. rightAlign: !0,
  2312. decimalProtect: !0,
  2313. min: null,
  2314. max: null,
  2315. step: 1,
  2316. insertMode: !0,
  2317. autoUnmask: !1,
  2318. unmaskAsNumber: !1,
  2319. inputmode: "numeric",
  2320. preValidation: function(buffer, pos, c, isSelection, opts) {
  2321. if ("-" === c || c == opts.negationSymbol.front) return !0 === opts.allowMinus && (opts.isNegative = opts.isNegative === undefined || !opts.isNegative,
  2322. "" === buffer.join("") || {
  2323. caret: pos,
  2324. dopost: !0
  2325. });
  2326. if (!1 === isSelection && c === opts.radixPoint && opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
  2327. var radixPos = $.inArray(opts.radixPoint, buffer);
  2328. if (-1 !== radixPos) return !0 === opts.numericInput ? pos === radixPos : {
  2329. caret: radixPos + 1
  2330. };
  2331. }
  2332. return !0;
  2333. },
  2334. postValidation: function(buffer, currentResult, opts) {
  2335. var suffix = opts.suffix.split(""), prefix = opts.prefix.split("");
  2336. if (currentResult.pos == undefined && currentResult.caret !== undefined && !0 !== currentResult.dopost) return currentResult;
  2337. var caretPos = currentResult.caret != undefined ? currentResult.caret : currentResult.pos, maskedValue = buffer.slice();
  2338. opts.numericInput && (caretPos = maskedValue.length - caretPos - 1, maskedValue = maskedValue.reverse());
  2339. var charAtPos = maskedValue[caretPos];
  2340. if (charAtPos === opts.groupSeparator && (caretPos += 1, charAtPos = maskedValue[caretPos]),
  2341. caretPos == maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;
  2342. charAtPos !== undefined && charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back && (maskedValue[caretPos] = "?",
  2343. opts.prefix.length > 0 && caretPos >= (!1 === opts.isNegative ? 1 : 0) && caretPos < opts.prefix.length - 1 + (!1 === opts.isNegative ? 1 : 0) ? prefix[caretPos - (!1 === opts.isNegative ? 1 : 0)] = "?" : opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0) && (suffix[caretPos - (maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0))] = "?")),
  2344. prefix = prefix.join(""), suffix = suffix.join("");
  2345. var processValue = maskedValue.join("").replace(prefix, "");
  2346. if (processValue = processValue.replace(suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2347. processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""),
  2348. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
  2349. isNaN(opts.placeholder) && (processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "")),
  2350. processValue.length > 1 && 1 !== processValue.indexOf(opts.radixPoint) && ("0" == charAtPos && (processValue = processValue.replace(/^\?/g, "")),
  2351. processValue = processValue.replace(/^0/g, "")), processValue.charAt(0) === opts.radixPoint && "" !== opts.radixPoint && !0 !== opts.numericInput && (processValue = "0" + processValue),
  2352. "" !== processValue) {
  2353. if (processValue = processValue.split(""), (!opts.digitsOptional || opts.enforceDigitsOnBlur && "blur" === currentResult.event) && isFinite(opts.digits)) {
  2354. var radixPosition = $.inArray(opts.radixPoint, processValue), rpb = $.inArray(opts.radixPoint, maskedValue);
  2355. -1 === radixPosition && (processValue.push(opts.radixPoint), radixPosition = processValue.length - 1);
  2356. for (var i = 1; i <= opts.digits; i++) opts.digitsOptional && (!opts.enforceDigitsOnBlur || "blur" !== currentResult.event) || processValue[radixPosition + i] !== undefined && processValue[radixPosition + i] !== opts.placeholder.charAt(0) ? -1 !== rpb && maskedValue[rpb + i] !== undefined && (processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i]) : processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);
  2357. }
  2358. !0 !== opts.autoGroup || "" === opts.groupSeparator || charAtPos === opts.radixPoint && currentResult.pos === undefined && !currentResult.dopost ? processValue = processValue.join("") : (processValue = Inputmask(function(buffer, opts) {
  2359. var postMask = "";
  2360. if (postMask += "(" + opts.groupSeparator + "*{" + opts.groupSize + "}){*}", "" !== opts.radixPoint) {
  2361. var radixSplit = buffer.join("").split(opts.radixPoint);
  2362. radixSplit[1] && (postMask += opts.radixPoint + "*{" + radixSplit[1].match(/^\d*\??\d*/)[0].length + "}");
  2363. }
  2364. return postMask;
  2365. }(processValue, opts), {
  2366. numericInput: !0,
  2367. jitMasking: !0,
  2368. definitions: {
  2369. "*": {
  2370. validator: "[0-9?]",
  2371. cardinality: 1
  2372. }
  2373. }
  2374. }).format(processValue.join("")), processValue.charAt(0) === opts.groupSeparator && processValue.substr(1));
  2375. }
  2376. if (opts.isNegative && "blur" === currentResult.event && (opts.isNegative = "0" !== processValue),
  2377. processValue = prefix + processValue, processValue += suffix, opts.isNegative && (processValue = opts.negationSymbol.front + processValue,
  2378. processValue += opts.negationSymbol.back), processValue = processValue.split(""),
  2379. charAtPos !== undefined) if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) caretPos = $.inArray("?", processValue),
  2380. caretPos > -1 ? processValue[caretPos] = charAtPos : caretPos = currentResult.caret || 0; else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {
  2381. var newCaretPos = $.inArray(charAtPos, processValue);
  2382. -1 !== newCaretPos && (caretPos = newCaretPos);
  2383. }
  2384. opts.numericInput && (caretPos = processValue.length - caretPos - 1, processValue = processValue.reverse());
  2385. var rslt = {
  2386. caret: charAtPos === undefined || currentResult.pos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,
  2387. buffer: processValue,
  2388. refreshFromBuffer: currentResult.dopost || buffer.join("") !== processValue.join("")
  2389. };
  2390. return rslt.refreshFromBuffer ? rslt : currentResult;
  2391. },
  2392. onBeforeWrite: function(e, buffer, caretPos, opts) {
  2393. if (e) switch (e.type) {
  2394. case "keydown":
  2395. return opts.postValidation(buffer, {
  2396. caret: caretPos,
  2397. dopost: !0
  2398. }, opts);
  2399. case "blur":
  2400. case "checkval":
  2401. var unmasked;
  2402. if (function(opts) {
  2403. opts.parseMinMaxOptions === undefined && (null !== opts.min && (opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2404. "," === opts.radixPoint && (opts.min = opts.min.replace(opts.radixPoint, ".")),
  2405. opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN, isNaN(opts.min) && (opts.min = Number.MIN_VALUE)),
  2406. null !== opts.max && (opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2407. "," === opts.radixPoint && (opts.max = opts.max.replace(opts.radixPoint, ".")),
  2408. opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN, isNaN(opts.max) && (opts.max = Number.MAX_VALUE)),
  2409. opts.parseMinMaxOptions = "done");
  2410. }(opts), null !== opts.min || null !== opts.max) {
  2411. if (unmasked = opts.onUnMask(buffer.join(""), undefined, $.extend({}, opts, {
  2412. unmaskAsNumber: !0
  2413. })), null !== opts.min && unmasked < opts.min) return opts.isNegative = opts.min < 0,
  2414. opts.postValidation(opts.min.toString().replace(".", opts.radixPoint).split(""), {
  2415. caret: caretPos,
  2416. dopost: !0,
  2417. placeholder: "0"
  2418. }, opts);
  2419. if (null !== opts.max && unmasked > opts.max) return opts.isNegative = opts.max < 0,
  2420. opts.postValidation(opts.max.toString().replace(".", opts.radixPoint).split(""), {
  2421. caret: caretPos,
  2422. dopost: !0,
  2423. placeholder: "0"
  2424. }, opts);
  2425. }
  2426. return opts.postValidation(buffer, {
  2427. caret: caretPos,
  2428. dopost: !0,
  2429. placeholder: "0",
  2430. event: "blur"
  2431. }, opts);
  2432. case "_checkval":
  2433. return {
  2434. caret: caretPos
  2435. };
  2436. }
  2437. },
  2438. regex: {
  2439. integerPart: function(opts, emptyCheck) {
  2440. return emptyCheck ? new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?") : new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?\\d+");
  2441. },
  2442. integerNPart: function(opts) {
  2443. return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
  2444. }
  2445. },
  2446. definitions: {
  2447. "~": {
  2448. validator: function(chrs, maskset, pos, strict, opts, isSelection) {
  2449. var isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
  2450. if (!0 === isValid) {
  2451. if (!0 !== opts.numericInput && maskset.validPositions[pos] !== undefined && "~" === maskset.validPositions[pos].match.def && !isSelection) {
  2452. var processValue = maskset.buffer.join("");
  2453. processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""),
  2454. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
  2455. var pvRadixSplit = processValue.split(opts.radixPoint);
  2456. pvRadixSplit.length > 1 && (pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0))),
  2457. "0" === pvRadixSplit[0] && (pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0))),
  2458. processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || "";
  2459. var bufferTemplate = maskset._buffer.join("");
  2460. for (processValue === opts.radixPoint && (processValue = bufferTemplate); null === processValue.match(Inputmask.escapeRegex(bufferTemplate) + "$"); ) bufferTemplate = bufferTemplate.slice(1);
  2461. processValue = processValue.replace(bufferTemplate, ""), processValue = processValue.split(""),
  2462. isValid = processValue[pos] === undefined ? {
  2463. pos: pos,
  2464. remove: pos
  2465. } : {
  2466. pos: pos
  2467. };
  2468. }
  2469. } else strict || chrs !== opts.radixPoint || maskset.validPositions[pos - 1] !== undefined || (maskset.buffer[pos] = "0",
  2470. isValid = {
  2471. pos: pos + 1
  2472. });
  2473. return isValid;
  2474. },
  2475. cardinality: 1
  2476. },
  2477. "+": {
  2478. validator: function(chrs, maskset, pos, strict, opts) {
  2479. return opts.allowMinus && ("-" === chrs || chrs === opts.negationSymbol.front);
  2480. },
  2481. cardinality: 1,
  2482. placeholder: ""
  2483. },
  2484. "-": {
  2485. validator: function(chrs, maskset, pos, strict, opts) {
  2486. return opts.allowMinus && chrs === opts.negationSymbol.back;
  2487. },
  2488. cardinality: 1,
  2489. placeholder: ""
  2490. },
  2491. ":": {
  2492. validator: function(chrs, maskset, pos, strict, opts) {
  2493. var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]", isValid = new RegExp(radix).test(chrs);
  2494. return isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint && (isValid = {
  2495. caret: pos + 1
  2496. }), isValid;
  2497. },
  2498. cardinality: 1,
  2499. placeholder: function(opts) {
  2500. return opts.radixPoint;
  2501. }
  2502. }
  2503. },
  2504. onUnMask: function(maskedValue, unmaskedValue, opts) {
  2505. if ("" === unmaskedValue && !0 === opts.nullable) return unmaskedValue;
  2506. var processValue = maskedValue.replace(opts.prefix, "");
  2507. return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2508. "" !== opts.placeholder.charAt(0) && (processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0")),
  2509. opts.unmaskAsNumber ? ("" !== opts.radixPoint && -1 !== processValue.indexOf(opts.radixPoint) && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".")),
  2510. processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-"),
  2511. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
  2512. Number(processValue)) : processValue;
  2513. },
  2514. isComplete: function(buffer, opts) {
  2515. var maskedValue = buffer.join("");
  2516. if (buffer.slice().join("") !== maskedValue) return !1;
  2517. var processValue = maskedValue.replace(opts.prefix, "");
  2518. return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2519. "," === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")),
  2520. isFinite(processValue);
  2521. },
  2522. onBeforeMask: function(initialValue, opts) {
  2523. if (opts.isNegative = undefined, initialValue = initialValue.toString().charAt(initialValue.length - 1) === opts.radixPoint ? initialValue.toString().substr(0, initialValue.length - 1) : initialValue.toString(),
  2524. "" !== opts.radixPoint && isFinite(initialValue)) {
  2525. var vs = initialValue.split("."), groupSize = "" !== opts.groupSeparator ? parseInt(opts.groupSize) : 0;
  2526. 2 === vs.length && (vs[0].length > groupSize || vs[1].length > groupSize || vs[0].length <= groupSize && vs[1].length < groupSize) && (initialValue = initialValue.replace(".", opts.radixPoint));
  2527. }
  2528. var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
  2529. if (dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
  2530. initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, ""),
  2531. initialValue = initialValue.replace(".", opts.radixPoint)) : initialValue = initialValue.indexOf(".") < initialValue.indexOf(",") ? initialValue.replace(/\./g, "") : initialValue = initialValue.replace(/,/g, "") : initialValue = initialValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2532. 0 === opts.digits && (-1 !== initialValue.indexOf(".") ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : -1 !== initialValue.indexOf(",") && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
  2533. "" !== opts.radixPoint && isFinite(opts.digits) && -1 !== initialValue.indexOf(opts.radixPoint)) {
  2534. var valueParts = initialValue.split(opts.radixPoint), decPart = valueParts[1].match(new RegExp("\\d*"))[0];
  2535. if (parseInt(opts.digits) < decPart.toString().length) {
  2536. var digitsFactor = Math.pow(10, parseInt(opts.digits));
  2537. initialValue = initialValue.replace(Inputmask.escapeRegex(opts.radixPoint), "."),
  2538. initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor,
  2539. initialValue = initialValue.toString().replace(".", opts.radixPoint);
  2540. }
  2541. }
  2542. return initialValue;
  2543. },
  2544. canClearPosition: function(maskset, position, lvp, strict, opts) {
  2545. var vp = maskset.validPositions[position], canClear = vp.input !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && !1 === opts.decimalProtect || vp.input === opts.radixPoint && maskset.validPositions[position + 1] && null === maskset.validPositions[position + 1].match.fn || isFinite(vp.input) || position === lvp || vp.input === opts.groupSeparator || vp.input === opts.negationSymbol.front || vp.input === opts.negationSymbol.back;
  2546. return !canClear || "+" != vp.match.nativeDef && "-" != vp.match.nativeDef || (opts.isNegative = !1),
  2547. canClear;
  2548. },
  2549. onKeyDown: function(e, buffer, caretPos, opts) {
  2550. var $input = $(this);
  2551. if (e.ctrlKey) switch (e.keyCode) {
  2552. case Inputmask.keyCode.UP:
  2553. $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.trigger("setvalue");
  2554. break;
  2555. case Inputmask.keyCode.DOWN:
  2556. $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.trigger("setvalue");
  2557. }
  2558. }
  2559. },
  2560. currency: {
  2561. prefix: "$ ",
  2562. groupSeparator: ",",
  2563. alias: "numeric",
  2564. placeholder: "0",
  2565. autoGroup: !0,
  2566. digits: 2,
  2567. digitsOptional: !1,
  2568. clearMaskOnLostFocus: !1
  2569. },
  2570. decimal: {
  2571. alias: "numeric"
  2572. },
  2573. integer: {
  2574. alias: "numeric",
  2575. digits: 0,
  2576. radixPoint: ""
  2577. },
  2578. percentage: {
  2579. alias: "numeric",
  2580. digits: 2,
  2581. digitsOptional: !0,
  2582. radixPoint: ".",
  2583. placeholder: "0",
  2584. autoGroup: !1,
  2585. min: 0,
  2586. max: 100,
  2587. suffix: " %",
  2588. allowMinus: !1
  2589. }
  2590. }), Inputmask;
  2591. });
  2592. }, function(module, exports, __webpack_require__) {
  2593. "use strict";
  2594. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  2595. "function" == typeof Symbol && Symbol.iterator;
  2596. !function(factory) {
  2597. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  2598. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2599. }(function($, Inputmask) {
  2600. function maskSort(a, b) {
  2601. var maska = (a.mask || a).replace(/#/g, "9").replace(/\)/, "9").replace(/[+()#-]/g, ""), maskb = (b.mask || b).replace(/#/g, "9").replace(/\)/, "9").replace(/[+()#-]/g, ""), maskas = (a.mask || a).split("#")[0], maskbs = (b.mask || b).split("#")[0];
  2602. return 0 === maskbs.indexOf(maskas) ? -1 : 0 === maskas.indexOf(maskbs) ? 1 : maska.localeCompare(maskb);
  2603. }
  2604. var analyseMaskBase = Inputmask.prototype.analyseMask;
  2605. return Inputmask.prototype.analyseMask = function(mask, regexMask, opts) {
  2606. function reduceVariations(masks, previousVariation, previousmaskGroup) {
  2607. previousVariation = previousVariation || "", previousmaskGroup = previousmaskGroup || maskGroups,
  2608. "" !== previousVariation && (previousmaskGroup[previousVariation] = {});
  2609. for (var variation = "", maskGroup = previousmaskGroup[previousVariation] || previousmaskGroup, i = masks.length - 1; i >= 0; i--) mask = masks[i].mask || masks[i],
  2610. variation = mask.substr(0, 1), maskGroup[variation] = maskGroup[variation] || [],
  2611. maskGroup[variation].unshift(mask.substr(1)), masks.splice(i, 1);
  2612. for (var ndx in maskGroup) maskGroup[ndx].length > 500 && reduceVariations(maskGroup[ndx].slice(), ndx, maskGroup);
  2613. }
  2614. function rebuild(maskGroup) {
  2615. var mask = "", submasks = [];
  2616. for (var ndx in maskGroup) $.isArray(maskGroup[ndx]) ? 1 === maskGroup[ndx].length ? submasks.push(ndx + maskGroup[ndx]) : submasks.push(ndx + opts.groupmarker.start + maskGroup[ndx].join(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start) + opts.groupmarker.end) : submasks.push(ndx + rebuild(maskGroup[ndx]));
  2617. return 1 === submasks.length ? mask += submasks[0] : mask += opts.groupmarker.start + submasks.join(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start) + opts.groupmarker.end,
  2618. mask;
  2619. }
  2620. var maskGroups = {};
  2621. return opts.phoneCodes && (opts.phoneCodes && opts.phoneCodes.length > 1e3 && (mask = mask.substr(1, mask.length - 2),
  2622. reduceVariations(mask.split(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start)),
  2623. mask = rebuild(maskGroups)), mask = mask.replace(/9/g, "\\9")), analyseMaskBase.call(this, mask, regexMask, opts);
  2624. }, Inputmask.extendAliases({
  2625. abstractphone: {
  2626. groupmarker: {
  2627. start: "<",
  2628. end: ">"
  2629. },
  2630. countrycode: "",
  2631. phoneCodes: [],
  2632. mask: function(opts) {
  2633. return opts.definitions = {
  2634. "#": Inputmask.prototype.definitions[9]
  2635. }, opts.phoneCodes.sort(maskSort);
  2636. },
  2637. keepStatic: !0,
  2638. onBeforeMask: function(value, opts) {
  2639. var processedValue = value.replace(/^0{1,2}/, "").replace(/[\s]/g, "");
  2640. return (processedValue.indexOf(opts.countrycode) > 1 || -1 === processedValue.indexOf(opts.countrycode)) && (processedValue = "+" + opts.countrycode + processedValue),
  2641. processedValue;
  2642. },
  2643. onUnMask: function(maskedValue, unmaskedValue, opts) {
  2644. return maskedValue.replace(/[()#-]/g, "");
  2645. },
  2646. inputmode: "tel"
  2647. }
  2648. }), Inputmask;
  2649. });
  2650. }, function(module, exports, __webpack_require__) {
  2651. "use strict";
  2652. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__, _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  2653. return typeof obj;
  2654. } : function(obj) {
  2655. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2656. };
  2657. !function(factory) {
  2658. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2), __webpack_require__(1) ],
  2659. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2660. }(function($, Inputmask) {
  2661. return void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) {
  2662. var nptmask, input = this[0];
  2663. if (void 0 === options && (options = {}), "string" == typeof fn) switch (fn) {
  2664. case "unmaskedvalue":
  2665. return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
  2666. case "remove":
  2667. return this.each(function() {
  2668. this.inputmask && this.inputmask.remove();
  2669. });
  2670. case "getemptymask":
  2671. return input && input.inputmask ? input.inputmask.getemptymask() : "";
  2672. case "hasMaskedValue":
  2673. return !(!input || !input.inputmask) && input.inputmask.hasMaskedValue();
  2674. case "isComplete":
  2675. return !input || !input.inputmask || input.inputmask.isComplete();
  2676. case "getmetadata":
  2677. return input && input.inputmask ? input.inputmask.getmetadata() : void 0;
  2678. case "setvalue":
  2679. $(input).val(options), input && void 0 === input.inputmask && $(input).triggerHandler("setvalue");
  2680. break;
  2681. case "option":
  2682. if ("string" != typeof options) return this.each(function() {
  2683. if (void 0 !== this.inputmask) return this.inputmask.option(options);
  2684. });
  2685. if (input && void 0 !== input.inputmask) return input.inputmask.option(options);
  2686. break;
  2687. default:
  2688. return options.alias = fn, nptmask = new Inputmask(options), this.each(function() {
  2689. nptmask.mask(this);
  2690. });
  2691. } else {
  2692. if ("object" == (void 0 === fn ? "undefined" : _typeof(fn))) return nptmask = new Inputmask(fn),
  2693. void 0 === fn.mask && void 0 === fn.alias ? this.each(function() {
  2694. if (void 0 !== this.inputmask) return this.inputmask.option(fn);
  2695. nptmask.mask(this);
  2696. }) : this.each(function() {
  2697. nptmask.mask(this);
  2698. });
  2699. if (void 0 === fn) return this.each(function() {
  2700. nptmask = new Inputmask(options), nptmask.mask(this);
  2701. });
  2702. }
  2703. }), $.fn.inputmask;
  2704. });
  2705. }, function(module, exports, __webpack_require__) {
  2706. var content = __webpack_require__(12);
  2707. "string" == typeof content && (content = [ [ module.i, content, "" ] ]);
  2708. __webpack_require__(14)(content, {});
  2709. content.locals && (module.exports = content.locals);
  2710. }, function(module, exports, __webpack_require__) {
  2711. "use strict";
  2712. function _interopRequireDefault(obj) {
  2713. return obj && obj.__esModule ? obj : {
  2714. default: obj
  2715. };
  2716. }
  2717. __webpack_require__(8), __webpack_require__(3), __webpack_require__(4), __webpack_require__(5),
  2718. __webpack_require__(6);
  2719. var _inputmask = __webpack_require__(1), _inputmask2 = _interopRequireDefault(_inputmask), _inputmask3 = __webpack_require__(0), _inputmask4 = _interopRequireDefault(_inputmask3), _jquery = __webpack_require__(2), _jquery2 = _interopRequireDefault(_jquery);
  2720. _inputmask4.default === _jquery2.default && __webpack_require__(7), window.Inputmask = _inputmask2.default;
  2721. }, function(module, exports, __webpack_require__) {
  2722. "use strict";
  2723. var __WEBPACK_AMD_DEFINE_RESULT__;
  2724. "function" == typeof Symbol && Symbol.iterator;
  2725. void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  2726. return document;
  2727. }.call(exports, __webpack_require__, exports, module)) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2728. }, function(module, exports, __webpack_require__) {
  2729. "use strict";
  2730. var __WEBPACK_AMD_DEFINE_RESULT__;
  2731. "function" == typeof Symbol && Symbol.iterator;
  2732. void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  2733. return window;
  2734. }.call(exports, __webpack_require__, exports, module)) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2735. }, function(module, exports, __webpack_require__) {
  2736. exports = module.exports = __webpack_require__(13)(void 0), exports.push([ module.i, ".im-caret {\r\n\t-webkit-animation: 1s blink step-end infinite;\r\n\tanimation: 1s blink step-end infinite;\r\n}\r\n\r\n@keyframes blink {\r\n\tfrom, to {\r\n\t\tborder-right-color: black;\r\n\t}\r\n\t50% {\r\n\t\tborder-right-color: transparent;\r\n\t}\r\n}\r\n\r\n@-webkit-keyframes blink {\r\n\tfrom, to {\r\n\t\tborder-right-color: black;\r\n\t}\r\n\t50% {\r\n\t\tborder-right-color: transparent;\r\n\t}\r\n}\r\n\r\n.im-static {\r\n\tcolor: grey;\r\n}\r\n", "" ]);
  2737. }, function(module, exports) {
  2738. function cssWithMappingToString(item, useSourceMap) {
  2739. var content = item[1] || "", cssMapping = item[3];
  2740. if (!cssMapping) return content;
  2741. if (useSourceMap && "function" == typeof btoa) {
  2742. var sourceMapping = toComment(cssMapping), sourceURLs = cssMapping.sources.map(function(source) {
  2743. return "/*# sourceURL=" + cssMapping.sourceRoot + source + " */";
  2744. });
  2745. return [ content ].concat(sourceURLs).concat([ sourceMapping ]).join("\n");
  2746. }
  2747. return [ content ].join("\n");
  2748. }
  2749. function toComment(sourceMap) {
  2750. return "/*# sourceMappingURL=data:application/json;charset=utf-8;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  2751. }
  2752. module.exports = function(useSourceMap) {
  2753. var list = [];
  2754. return list.toString = function() {
  2755. return this.map(function(item) {
  2756. var content = cssWithMappingToString(item, useSourceMap);
  2757. return item[2] ? "@media " + item[2] + "{" + content + "}" : content;
  2758. }).join("");
  2759. }, list.i = function(modules, mediaQuery) {
  2760. "string" == typeof modules && (modules = [ [ null, modules, "" ] ]);
  2761. for (var alreadyImportedModules = {}, i = 0; i < this.length; i++) {
  2762. var id = this[i][0];
  2763. "number" == typeof id && (alreadyImportedModules[id] = !0);
  2764. }
  2765. for (i = 0; i < modules.length; i++) {
  2766. var item = modules[i];
  2767. "number" == typeof item[0] && alreadyImportedModules[item[0]] || (mediaQuery && !item[2] ? item[2] = mediaQuery : mediaQuery && (item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"),
  2768. list.push(item));
  2769. }
  2770. }, list;
  2771. };
  2772. }, function(module, exports, __webpack_require__) {
  2773. function addStylesToDom(styles, options) {
  2774. for (var i = 0; i < styles.length; i++) {
  2775. var item = styles[i], domStyle = stylesInDom[item.id];
  2776. if (domStyle) {
  2777. domStyle.refs++;
  2778. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](item.parts[j]);
  2779. for (;j < item.parts.length; j++) domStyle.parts.push(addStyle(item.parts[j], options));
  2780. } else {
  2781. for (var parts = [], j = 0; j < item.parts.length; j++) parts.push(addStyle(item.parts[j], options));
  2782. stylesInDom[item.id] = {
  2783. id: item.id,
  2784. refs: 1,
  2785. parts: parts
  2786. };
  2787. }
  2788. }
  2789. }
  2790. function listToStyles(list) {
  2791. for (var styles = [], newStyles = {}, i = 0; i < list.length; i++) {
  2792. var item = list[i], id = item[0], css = item[1], media = item[2], sourceMap = item[3], part = {
  2793. css: css,
  2794. media: media,
  2795. sourceMap: sourceMap
  2796. };
  2797. newStyles[id] ? newStyles[id].parts.push(part) : styles.push(newStyles[id] = {
  2798. id: id,
  2799. parts: [ part ]
  2800. });
  2801. }
  2802. return styles;
  2803. }
  2804. function insertStyleElement(options, styleElement) {
  2805. var styleTarget = getElement(options.insertInto);
  2806. if (!styleTarget) throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  2807. var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
  2808. if ("top" === options.insertAt) lastStyleElementInsertedAtTop ? lastStyleElementInsertedAtTop.nextSibling ? styleTarget.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling) : styleTarget.appendChild(styleElement) : styleTarget.insertBefore(styleElement, styleTarget.firstChild),
  2809. styleElementsInsertedAtTop.push(styleElement); else {
  2810. if ("bottom" !== options.insertAt) throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
  2811. styleTarget.appendChild(styleElement);
  2812. }
  2813. }
  2814. function removeStyleElement(styleElement) {
  2815. styleElement.parentNode.removeChild(styleElement);
  2816. var idx = styleElementsInsertedAtTop.indexOf(styleElement);
  2817. idx >= 0 && styleElementsInsertedAtTop.splice(idx, 1);
  2818. }
  2819. function createStyleElement(options) {
  2820. var styleElement = document.createElement("style");
  2821. return options.attrs.type = "text/css", attachTagAttrs(styleElement, options.attrs),
  2822. insertStyleElement(options, styleElement), styleElement;
  2823. }
  2824. function createLinkElement(options) {
  2825. var linkElement = document.createElement("link");
  2826. return options.attrs.type = "text/css", options.attrs.rel = "stylesheet", attachTagAttrs(linkElement, options.attrs),
  2827. insertStyleElement(options, linkElement), linkElement;
  2828. }
  2829. function attachTagAttrs(element, attrs) {
  2830. Object.keys(attrs).forEach(function(key) {
  2831. element.setAttribute(key, attrs[key]);
  2832. });
  2833. }
  2834. function addStyle(obj, options) {
  2835. var styleElement, update, remove;
  2836. if (options.singleton) {
  2837. var styleIndex = singletonCounter++;
  2838. styleElement = singletonElement || (singletonElement = createStyleElement(options)),
  2839. update = applyToSingletonTag.bind(null, styleElement, styleIndex, !1), remove = applyToSingletonTag.bind(null, styleElement, styleIndex, !0);
  2840. } else obj.sourceMap && "function" == typeof URL && "function" == typeof URL.createObjectURL && "function" == typeof URL.revokeObjectURL && "function" == typeof Blob && "function" == typeof btoa ? (styleElement = createLinkElement(options),
  2841. update = updateLink.bind(null, styleElement, options), remove = function() {
  2842. removeStyleElement(styleElement), styleElement.href && URL.revokeObjectURL(styleElement.href);
  2843. }) : (styleElement = createStyleElement(options), update = applyToTag.bind(null, styleElement),
  2844. remove = function() {
  2845. removeStyleElement(styleElement);
  2846. });
  2847. return update(obj), function(newObj) {
  2848. if (newObj) {
  2849. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) return;
  2850. update(obj = newObj);
  2851. } else remove();
  2852. };
  2853. }
  2854. function applyToSingletonTag(styleElement, index, remove, obj) {
  2855. var css = remove ? "" : obj.css;
  2856. if (styleElement.styleSheet) styleElement.styleSheet.cssText = replaceText(index, css); else {
  2857. var cssNode = document.createTextNode(css), childNodes = styleElement.childNodes;
  2858. childNodes[index] && styleElement.removeChild(childNodes[index]), childNodes.length ? styleElement.insertBefore(cssNode, childNodes[index]) : styleElement.appendChild(cssNode);
  2859. }
  2860. }
  2861. function applyToTag(styleElement, obj) {
  2862. var css = obj.css, media = obj.media;
  2863. if (media && styleElement.setAttribute("media", media), styleElement.styleSheet) styleElement.styleSheet.cssText = css; else {
  2864. for (;styleElement.firstChild; ) styleElement.removeChild(styleElement.firstChild);
  2865. styleElement.appendChild(document.createTextNode(css));
  2866. }
  2867. }
  2868. function updateLink(linkElement, options, obj) {
  2869. var css = obj.css, sourceMap = obj.sourceMap, autoFixUrls = void 0 === options.convertToAbsoluteUrls && sourceMap;
  2870. (options.convertToAbsoluteUrls || autoFixUrls) && (css = fixUrls(css)), sourceMap && (css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */");
  2871. var blob = new Blob([ css ], {
  2872. type: "text/css"
  2873. }), oldSrc = linkElement.href;
  2874. linkElement.href = URL.createObjectURL(blob), oldSrc && URL.revokeObjectURL(oldSrc);
  2875. }
  2876. var stylesInDom = {}, isOldIE = function(fn) {
  2877. var memo;
  2878. return function() {
  2879. return void 0 === memo && (memo = fn.apply(this, arguments)), memo;
  2880. };
  2881. }(function() {
  2882. return window && document && document.all && !window.atob;
  2883. }), getElement = function(fn) {
  2884. var memo = {};
  2885. return function(selector) {
  2886. return void 0 === memo[selector] && (memo[selector] = fn.call(this, selector)),
  2887. memo[selector];
  2888. };
  2889. }(function(styleTarget) {
  2890. return document.querySelector(styleTarget);
  2891. }), singletonElement = null, singletonCounter = 0, styleElementsInsertedAtTop = [], fixUrls = __webpack_require__(15);
  2892. module.exports = function(list, options) {
  2893. if ("undefined" != typeof DEBUG && DEBUG && "object" != typeof document) throw new Error("The style-loader cannot be used in a non-browser environment");
  2894. options = options || {}, options.attrs = "object" == typeof options.attrs ? options.attrs : {},
  2895. void 0 === options.singleton && (options.singleton = isOldIE()), void 0 === options.insertInto && (options.insertInto = "head"),
  2896. void 0 === options.insertAt && (options.insertAt = "bottom");
  2897. var styles = listToStyles(list);
  2898. return addStylesToDom(styles, options), function(newList) {
  2899. for (var mayRemove = [], i = 0; i < styles.length; i++) {
  2900. var item = styles[i], domStyle = stylesInDom[item.id];
  2901. domStyle.refs--, mayRemove.push(domStyle);
  2902. }
  2903. if (newList) {
  2904. addStylesToDom(listToStyles(newList), options);
  2905. }
  2906. for (var i = 0; i < mayRemove.length; i++) {
  2907. var domStyle = mayRemove[i];
  2908. if (0 === domStyle.refs) {
  2909. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  2910. delete stylesInDom[domStyle.id];
  2911. }
  2912. }
  2913. };
  2914. };
  2915. var replaceText = function() {
  2916. var textStore = [];
  2917. return function(index, replacement) {
  2918. return textStore[index] = replacement, textStore.filter(Boolean).join("\n");
  2919. };
  2920. }();
  2921. }, function(module, exports) {
  2922. module.exports = function(css) {
  2923. var location = "undefined" != typeof window && window.location;
  2924. if (!location) throw new Error("fixUrls requires window.location");
  2925. if (!css || "string" != typeof css) return css;
  2926. var baseUrl = location.protocol + "//" + location.host, currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  2927. return css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  2928. var unquotedOrigUrl = origUrl.trim().replace(/^"(.*)"$/, function(o, $1) {
  2929. return $1;
  2930. }).replace(/^'(.*)'$/, function(o, $1) {
  2931. return $1;
  2932. });
  2933. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) return fullMatch;
  2934. var newUrl;
  2935. return newUrl = 0 === unquotedOrigUrl.indexOf("//") ? unquotedOrigUrl : 0 === unquotedOrigUrl.indexOf("/") ? baseUrl + unquotedOrigUrl : currentDir + unquotedOrigUrl.replace(/^\.\//, ""),
  2936. "url(" + JSON.stringify(newUrl) + ")";
  2937. });
  2938. };
  2939. } ]);