jquery.inputmask.bundle.js 208 KB

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