jquery.inputmask.bundle.js 207 KB

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