text: /*!
   * cleave.js - 0.9.2
   * https://github.com/nosir/cleave.js
   * Apache License Version 2.0
   *
   * Copyright (C) 2012-2017 Max Huang https://github.com/nosir/
   */
  !function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.Cleave=factory():root.Cleave=factory()}(this,function(){return function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){(function(global){"use strict";var Cleave=function(element,opts){var owner=this;if("string"==typeof element?owner.element=document.querySelector(element):owner.element="undefined"!=typeof element.length&&element.length>0?element[0]:element,!owner.element)throw new Error("[cleave.js] Please check the element");opts.initValue=owner.element.value,owner.properties=Cleave.DefaultProperties.assign({},opts),owner.init()};Cleave.prototype={init:function(){var owner=this,pps=owner.properties;return pps.numeral||pps.phone||pps.creditCard||pps.date||0!==pps.blocksLength||pps.prefix?(pps.maxLength=Cleave.Util.getMaxLength(pps.blocks),owner.isAndroid=Cleave.Util.isAndroid(),owner.lastInputValue="",owner.onChangeListener=owner.onChange.bind(owner),owner.onKeyDownListener=owner.onKeyDown.bind(owner),owner.onCutListener=owner.onCut.bind(owner),owner.onCopyListener=owner.onCopy.bind(owner),owner.element.addEventListener("input",owner.onChangeListener),owner.element.addEventListener("keydown",owner.onKeyDownListener),owner.element.addEventListener("cut",owner.onCutListener),owner.element.addEventListener("copy",owner.onCopyListener),owner.initPhoneFormatter(),owner.initDateFormatter(),owner.initNumeralFormatter(),void owner.onInput(pps.initValue)):void owner.onInput(pps.initValue)},initNumeralFormatter:function(){var owner=this,pps=owner.properties;pps.numeral&&(pps.numeralFormatter=new Cleave.NumeralFormatter(pps.numeralDecimalMark,pps.numeralIntegerScale,pps.numeralDecimalScale,pps.numeralThousandsGroupStyle,pps.numeralPositiveOnly,pps.delimiter))},initDateFormatter:function(){var owner=this,pps=owner.properties;pps.date&&(pps.dateFormatter=new Cleave.DateFormatter(pps.datePattern),pps.blocks=pps.dateFormatter.getBlocks(),pps.blocksLength=pps.blocks.length,pps.maxLength=Cleave.Util.getMaxLength(pps.blocks))},initPhoneFormatter:function(){var owner=this,pps=owner.properties;if(pps.phone)try{pps.phoneFormatter=new Cleave.PhoneFormatter(new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),pps.delimiter)}catch(ex){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(event){var owner=this,pps=owner.properties,charCode=event.which||event.keyCode,Util=Cleave.Util,currentValue=owner.element.value;return Util.isAndroidBackspaceKeydown(owner.lastInputValue,currentValue)&&(charCode=8),owner.lastInputValue=currentValue,8===charCode&&Util.isDelimiter(currentValue.slice(-pps.delimiterLength),pps.delimiter,pps.delimiters)?void(pps.backspace=!0):void(pps.backspace=!1)},onChange:function(){this.onInput(this.element.value)},onCut:function(e){this.copyClipboardData(e),this.onInput("")},onCopy:function(e){this.copyClipboardData(e)},copyClipboardData:function(e){var owner=this,pps=owner.properties,Util=Cleave.Util,inputValue=owner.element.value,textToCopy="";textToCopy=pps.copyDelimiter?inputValue:Util.stripDelimiters(inputValue,pps.delimiter,pps.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",textToCopy):window.clipboardData.setData("Text",textToCopy),e.preventDefault()}catch(ex){}},onInput:function(value){var owner=this,pps=owner.properties,prev=value,Util=Cleave.Util;return pps.numeral||!pps.backspace||Util.isDelimiter(value.slice(-pps.delimiterLength),pps.delimiter,pps.delimiters)||(value=Util.headStr(value,value.length-pps.delimiterLength)),pps.phone?(pps.result=pps.phoneFormatter.format(value),void owner.updateValueState()):pps.numeral?(pps.result=pps.prefix+pps.numeralFormatter.format(value),void owner.updateValueState()):(pps.date&&(value=pps.dateFormatter.getValidatedDate(value)),value=Util.stripDelimiters(value,pps.delimiter,pps.delimiters),value=Util.getPrefixStrippedValue(value,pps.prefix,pps.prefixLength),value=pps.numericOnly?Util.strip(value,/[^\d]/g):value,value=pps.uppercase?value.toUpperCase():value,value=pps.lowercase?value.toLowerCase():value,pps.prefix&&(value=pps.prefix+value,0===pps.blocksLength)?(pps.result=value,void owner.updateValueState()):(pps.creditCard&&owner.updateCreditCardPropsByValue(value),value=Util.headStr(value,pps.maxLength),pps.result=Util.getFormattedValue(value,pps.blocks,pps.blocksLength,pps.delimiter,pps.delimiters),void(prev===pps.result&&prev!==pps.prefix||owner.updateValueState())))},updateCreditCardPropsByValue:function(value){var creditCardInfo,owner=this,pps=owner.properties,Util=Cleave.Util;Util.headStr(pps.result,4)!==Util.headStr(value,4)&&(creditCardInfo=Cleave.CreditCardDetector.getInfo(value,pps.creditCardStrictMode),pps.blocks=creditCardInfo.blocks,pps.blocksLength=pps.blocks.length,pps.maxLength=Util.getMaxLength(pps.blocks),pps.creditCardType!==creditCardInfo.type&&(pps.creditCardType=creditCardInfo.type,pps.onCreditCardTypeChanged.call(owner,pps.creditCardType)))},updateValueState:function(){var owner=this;return owner.isAndroid?void window.setTimeout(function(){owner.element.value=owner.properties.result},1):void(owner.element.value=owner.properties.result)},setPhoneRegionCode:function(phoneRegionCode){var owner=this,pps=owner.properties;pps.phoneRegionCode=phoneRegionCode,owner.initPhoneFormatter(),owner.onChange()},setRawValue:function(value){var owner=this,pps=owner.properties;value=void 0!==value&&null!==value?value.toString():"",pps.numeral&&(value=value.replace(".",pps.numeralDecimalMark)),owner.element.value=value,owner.onInput(value)},getRawValue:function(){var owner=this,pps=owner.properties,Util=Cleave.Util,rawValue=owner.element.value;return pps.rawValueTrimPrefix&&(rawValue=Util.getPrefixStrippedValue(rawValue,pps.prefix,pps.prefixLength)),rawValue=pps.numeral?pps.numeralFormatter.getRawValue(rawValue):Util.stripDelimiters(rawValue,pps.delimiter,pps.delimiters)},getFormattedValue:function(){return this.element.value},destroy:function(){var owner=this;owner.element.removeEventListener("input",owner.onChangeListener),owner.element.removeEventListener("keydown",owner.onKeyDownListener),owner.element.removeEventListener("cut",owner.onCutListener),owner.element.removeEventListener("copy",owner.onCopyListener)},toString:function(){return"[Cleave Object]"}},Cleave.NumeralFormatter=__webpack_require__(1),Cleave.DateFormatter=__webpack_require__(2),Cleave.PhoneFormatter=__webpack_require__(3),Cleave.CreditCardDetector=__webpack_require__(4),Cleave.Util=__webpack_require__(5),Cleave.DefaultProperties=__webpack_require__(6),("object"==typeof global&&global?global:window).Cleave=Cleave,module.exports=Cleave}).call(exports,function(){return this}())},function(module,exports){"use strict";var NumeralFormatter=function(numeralDecimalMark,numeralIntegerScale,numeralDecimalScale,numeralThousandsGroupStyle,numeralPositiveOnly,delimiter){var owner=this;owner.numeralDecimalMark=numeralDecimalMark||".",owner.numeralIntegerScale=numeralIntegerScale>0?numeralIntegerScale:0,owner.numeralDecimalScale=numeralDecimalScale>=0?numeralDecimalScale:2,owner.numeralThousandsGroupStyle=numeralThousandsGroupStyle||NumeralFormatter.groupStyle.thousand,owner.numeralPositiveOnly=!!numeralPositiveOnly,owner.delimiter=delimiter||""===delimiter?delimiter:",",owner.delimiterRE=delimiter?new RegExp("\\"+delimiter,"g"):""};NumeralFormatter.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan"},NumeralFormatter.prototype={getRawValue:function(value){return value.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(value){var parts,partInteger,owner=this,partDecimal="";switch(value=value.replace(/[A-Za-z]/g,"").replace(owner.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",owner.numeralPositiveOnly?"":"-").replace("M",owner.numeralDecimalMark).replace(/^(-)?0+(?=\d)/,"$1"),partInteger=value,value.indexOf(owner.numeralDecimalMark)>=0&&(parts=value.split(owner.numeralDecimalMark),partInteger=parts[0],partDecimal=owner.numeralDecimalMark+parts[1].slice(0,owner.numeralDecimalScale)),owner.numeralIntegerScale>0&&(partInteger=partInteger.slice(0,owner.numeralIntegerScale+("-"===value.slice(0,1)?1:0))),owner.numeralThousandsGroupStyle){case NumeralFormatter.groupStyle.lakh:partInteger=partInteger.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+owner.delimiter);break;case NumeralFormatter.groupStyle.wan:partInteger=partInteger.replace(/(\d)(?=(\d{4})+$)/g,"$1"+owner.delimiter);break;default:partInteger=partInteger.replace(/(\d)(?=(\d{3})+$)/g,"$1"+owner.delimiter)}return partInteger.toString()+(owner.numeralDecimalScale>0?partDecimal.toString():"")}},module.exports=NumeralFormatter},function(module,exports){"use strict";var DateFormatter=function(datePattern){var owner=this;owner.blocks=[],owner.datePattern=datePattern,owner.initBlocks()};DateFormatter.prototype={initBlocks:function(){var owner=this;owner.datePattern.forEach(function(value){"Y"===value?owner.blocks.push(4):owner.blocks.push(2)})},getBlocks:function(){return this.blocks},getValidatedDate:function(value){var owner=this,result="";return value=value.replace(/[^\d]/g,""),owner.blocks.forEach(function(length,index){if(value.length>0){var sub=value.slice(0,length),sub0=sub.slice(0,1),rest=value.slice(length);switch(owner.datePattern[index]){case"d":"00"===sub?sub="01":parseInt(sub0,10)>3?sub="0"+sub0:parseInt(sub,10)>31&&(sub="31");break;case"m":"00"===sub?sub="01":parseInt(sub0,10)>1?sub="0"+sub0:parseInt(sub,10)>12&&(sub="12")}result+=sub,value=rest}}),this.getFixedDateString(result)},getFixedDateString:function(value){var day,month,year,owner=this,datePattern=owner.datePattern,date=[],dayIndex=0,monthIndex=0,yearIndex=0,dayStartIndex=0,monthStartIndex=0,yearStartIndex=0;return 4===value.length&&"y"!==datePattern[0].toLowerCase()&&"y"!==datePattern[1].toLowerCase()&&(dayStartIndex="d"===datePattern[0]?0:2,monthStartIndex=2-dayStartIndex,day=parseInt(value.slice(dayStartIndex,dayStartIndex+2),10),month=parseInt(value.slice(monthStartIndex,monthStartIndex+2),10),date=this.getFixedDate(day,month,0)),8===value.length&&(datePattern.forEach(function(type,index){switch(type){case"d":dayIndex=index;break;case"m":monthIndex=index;break;default:yearIndex=index}}),yearStartIndex=2*yearIndex,dayStartIndex=yearIndex>=dayIndex?2*dayIndex:2*dayIndex+2,monthStartIndex=yearIndex>=monthIndex?2*monthIndex:2*monthIndex+2,day=parseInt(value.slice(dayStartIndex,dayStartIndex+2),10),month=parseInt(value.slice(monthStartIndex,monthStartIndex+2),10),year=parseInt(value.slice(yearStartIndex,yearStartIndex+4),10),date=this.getFixedDate(day,month,year)),0===date.length?value:datePattern.reduce(function(previous,current){switch(current){case"d":return previous+owner.addLeadingZero(date[0]);case"m":return previous+owner.addLeadingZero(date[1]);default:return previous+""+(date[2]||"")}},"")},getFixedDate:function(day,month,year){return day=Math.min(day,31),month=Math.min(month,12),year=parseInt(year||0,10),(7>month&&month%2===0||month>8&&month%2===1)&&(day=Math.min(day,2===month?this.isLeapYear(year)?29:28:30)),[day,month,year]},isLeapYear:function(year){return year%4===0&&year%100!==0||year%400===0},addLeadingZero:function(number){return(10>number?"0":"")+number}},module.exports=DateFormatter},function(module,exports){"use strict";var PhoneFormatter=function(formatter,delimiter){var owner=this;owner.delimiter=delimiter||""===delimiter?delimiter:" ",owner.delimiterRE=delimiter?new RegExp("\\"+delimiter,"g"):"",owner.formatter=formatter};PhoneFormatter.prototype={setFormatter:function(formatter){this.formatter=formatter},format:function(phoneNumber){var owner=this;owner.formatter.clear(),phoneNumber=phoneNumber.replace(/[^\d+]/g,""),phoneNumber=phoneNumber.replace(owner.delimiterRE,"");for(var current,result="",validated=!1,i=0,iMax=phoneNumber.length;iMax>i;i++)current=owner.formatter.inputDigit(phoneNumber.charAt(i)),/[\s()-]/g.test(current)?(result=current,validated=!0):validated||(result=current);return result=result.replace(/[()]/g,""),result=result.replace(/[\s-]/g,owner.delimiter)}},module.exports=PhoneFormatter},function(module,exports){"use strict";var CreditCardDetector={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],general:[4,4,4,4],generalStrict:[4,4,4,7]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]|2[2-7])\d{0,14}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb:/^(?:2131|1800|35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,visa:/^4\d{0,15}/},getInfo:function(value,strictMode){var blocks=CreditCardDetector.blocks,re=CreditCardDetector.re;return strictMode=!!strictMode,re.amex.test(value)?{type:"amex",blocks:blocks.amex}:re.uatp.test(value)?{type:"uatp",blocks:blocks.uatp}:re.diners.test(value)?{type:"diners",blocks:blocks.diners}:re.discover.test(value)?{type:"discover",blocks:strictMode?blocks.generalStrict:blocks.discover}:re.mastercard.test(value)?{type:"mastercard",blocks:blocks.mastercard}:re.dankort.test(value)?{type:"dankort",blocks:blocks.dankort}:re.instapayment.test(value)?{type:"instapayment",blocks:blocks.instapayment}:re.jcb.test(value)?{type:"jcb",blocks:blocks.jcb}:re.maestro.test(value)?{type:"maestro",blocks:strictMode?blocks.generalStrict:blocks.maestro}:re.visa.test(value)?{type:"visa",blocks:strictMode?blocks.generalStrict:blocks.visa}:{type:"unknown",blocks:strictMode?blocks.generalStrict:blocks.general}}};module.exports=CreditCardDetector},function(module,exports){"use strict";var Util={noop:function(){},strip:function(value,re){return value.replace(re,"")},isDelimiter:function(letter,delimiter,delimiters){return 0===delimiters.length?letter===delimiter:delimiters.some(function(current){return letter===current?!0:void 0})},getDelimiterREByDelimiter:function(delimiter){return new RegExp(delimiter.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},stripDelimiters:function(value,delimiter,delimiters){var owner=this;if(0===delimiters.length){var delimiterRE=delimiter?owner.getDelimiterREByDelimiter(delimiter):"";return value.replace(delimiterRE,"")}return delimiters.forEach(function(current){value=value.replace(owner.getDelimiterREByDelimiter(current),"")}),value},headStr:function(str,length){return str.slice(0,length)},getMaxLength:function(blocks){return blocks.reduce(function(previous,current){return previous+current},0)},getPrefixStrippedValue:function(value,prefix,prefixLength){if(value.slice(0,prefixLength)!==prefix){var diffIndex=this.getFirstDiffIndex(prefix,value.slice(0,prefixLength));value=prefix+value.slice(diffIndex,diffIndex+1)+value.slice(prefixLength+1)}return value.slice(prefixLength)},getFirstDiffIndex:function(prev,current){for(var index=0;prev.charAt(index)===current.charAt(index);)if(""===prev.charAt(index++))return-1;return index},getFormattedValue:function(value,blocks,blocksLength,delimiter,delimiters){var currentDelimiter,result="",multipleDelimiters=delimiters.length>0;return 0===blocksLength?value:(blocks.forEach(function(length,index){if(value.length>0){var sub=value.slice(0,length),rest=value.slice(length);result+=sub,currentDelimiter=multipleDelimiters?delimiters[index]||currentDelimiter:delimiter,sub.length===length&&blocksLength-1>index&&(result+=currentDelimiter),value=rest}}),result)},isAndroid:function(){return!(!navigator||!/android/i.test(navigator.userAgent))},isAndroidBackspaceKeydown:function(lastInputValue,currentInputValue){return this.isAndroid()?currentInputValue===lastInputValue.slice(0,-1):!1}};module.exports=Util},function(module,exports){(function(global){"use strict";var DefaultProperties={assign:function(target,opts){return target=target||{},opts=opts||{},target.creditCard=!!opts.creditCard,target.creditCardStrictMode=!!opts.creditCardStrictMode,target.creditCardType="",target.onCreditCardTypeChanged=opts.onCreditCardTypeChanged||function(){},target.phone=!!opts.phone,target.phoneRegionCode=opts.phoneRegionCode||"AU",target.phoneFormatter={},target.date=!!opts.date,target.datePattern=opts.datePattern||["d","m","Y"],target.dateFormatter={},target.numeral=!!opts.numeral,target.numeralIntegerScale=opts.numeralIntegerScale>0?opts.numeralIntegerScale:0,target.numeralDecimalScale=opts.numeralDecimalScale>=0?opts.numeralDecimalScale:2,target.numeralDecimalMark=opts.numeralDecimalMark||".",target.numeralThousandsGroupStyle=opts.numeralThousandsGroupStyle||"thousand",target.numeralPositiveOnly=!!opts.numeralPositiveOnly,target.numericOnly=target.creditCard||target.date||!!opts.numericOnly,target.uppercase=!!opts.uppercase,target.lowercase=!!opts.lowercase,target.prefix=target.creditCard||target.phone||target.date?"":opts.prefix||"",target.prefixLength=target.prefix.length,target.rawValueTrimPrefix=!!opts.rawValueTrimPrefix,target.copyDelimiter=!!opts.copyDelimiter,target.initValue=void 0!==opts.initValue&&null!==opts.initValue?opts.initValue.toString():"",target.delimiter=opts.delimiter||""===opts.delimiter?opts.delimiter:opts.date?"/":opts.numeral?",":(opts.phone," "),target.delimiterLength=target.delimiter.length,target.delimiters=opts.delimiters||[],target.blocks=opts.blocks||[],target.blocksLength=target.blocks.length,target.root="object"==typeof global&&global?global:window,target.maxLength=0,target.backspace=!1,target.result="",target}};module.exports=DefaultProperties}).call(exports,function(){return this}())}])}),angular.module("cleave.js",[]).directive("cleave",function(){return{restrict:"A",require:"ngModel",scope:{cleave:"&",onValueChange:"&?"},compile:function(){return{pre:function($scope,$element,attrs,ngModelCtrl){$scope.cleave=new window.Cleave($element[0],$scope.cleave()),ngModelCtrl.$formatters.push(function(val){return $scope.cleave.setRawValue(val),$scope.cleave.getFormattedValue()}),ngModelCtrl.$parsers.push(function(newFormattedValue){return $scope.onValueChange&&$scope.onValueChange()(newFormattedValue),$scope.cleave.getRawValue()})}}}}});