vue-currency-input
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -1,1 +0,1 @@ | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-currency-input"]=t():e["vue-currency-input"]=t()})("undefined"!==typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"014b":function(e,t,n){"use strict";var r=n("e53d"),o=n("07e3"),i=n("8e60"),u=n("63b6"),a=n("9138"),c=n("ebfd").KEY,f=n("294c"),l=n("dbdb"),s=n("45f2"),p=n("62a0"),d=n("5168"),v=n("ccb9"),h=n("6718"),m=n("47ee"),b=n("9003"),y=n("e4ae"),g=n("f772"),x=n("36c3"),w=n("1bc3"),O=n("aebd"),S=n("a159"),C=n("0395"),E=n("bf0b"),P=n("d9f6"),j=n("c3a1"),_=E.f,k=P.f,N=C.f,F=r.Symbol,T=r.JSON,V=T&&T.stringify,$="prototype",I=d("_hidden"),M=d("toPrimitive"),R={}.propertyIsEnumerable,A=l("symbol-registry"),D=l("symbols"),W=l("op-symbols"),L=Object[$],J="function"==typeof F,B=r.QObject,U=!B||!B[$]||!B[$].findChild,q=i&&f(function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=_(L,t);r&&delete L[t],k(e,t,n),r&&e!==L&&k(L,t,r)}:k,z=function(e){var t=D[e]=S(F[$]);return t._k=e,t},G=J&&"symbol"==typeof F.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof F},K=function(e,t,n){return e===L&&K(W,t,n),y(e),t=w(t,!0),y(n),o(D,t)?(n.enumerable?(o(e,I)&&e[I][t]&&(e[I][t]=!1),n=S(n,{enumerable:O(0,!1)})):(o(e,I)||k(e,I,O(1,{})),e[I][t]=!0),q(e,t,n)):k(e,t,n)},X=function(e,t){y(e);var n,r=m(t=x(t)),o=0,i=r.length;while(i>o)K(e,n=r[o++],t[n]);return e},Y=function(e,t){return void 0===t?S(e):X(S(e),t)},Q=function(e){var t=R.call(this,e=w(e,!0));return!(this===L&&o(D,e)&&!o(W,e))&&(!(t||!o(this,e)||!o(D,e)||o(this,I)&&this[I][e])||t)},H=function(e,t){if(e=x(e),t=w(t,!0),e!==L||!o(D,t)||o(W,t)){var n=_(e,t);return!n||!o(D,t)||o(e,I)&&e[I][t]||(n.enumerable=!0),n}},Z=function(e){var t,n=N(x(e)),r=[],i=0;while(n.length>i)o(D,t=n[i++])||t==I||t==c||r.push(t);return r},ee=function(e){var t,n=e===L,r=N(n?W:x(e)),i=[],u=0;while(r.length>u)!o(D,t=r[u++])||n&&!o(L,t)||i.push(D[t]);return i};J||(F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===L&&t.call(W,n),o(this,I)&&o(this[I],e)&&(this[I][e]=!1),q(this,e,O(1,n))};return i&&U&&q(L,e,{configurable:!0,set:t}),z(e)},a(F[$],"toString",function(){return this._k}),E.f=H,P.f=K,n("6abf").f=C.f=Z,n("355d").f=Q,n("9aa9").f=ee,i&&!n("b8e3")&&a(L,"propertyIsEnumerable",Q,!0),v.f=function(e){return z(d(e))}),u(u.G+u.W+u.F*!J,{Symbol:F});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)d(te[ne++]);for(var re=j(d.store),oe=0;re.length>oe;)h(re[oe++]);u(u.S+u.F*!J,"Symbol",{for:function(e){return o(A,e+="")?A[e]:A[e]=F(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in A)if(A[t]===e)return t},useSetter:function(){U=!0},useSimple:function(){U=!1}}),u(u.S+u.F*!J,"Object",{create:Y,defineProperty:K,defineProperties:X,getOwnPropertyDescriptor:H,getOwnPropertyNames:Z,getOwnPropertySymbols:ee}),T&&u(u.S+u.F*(!J||f(function(){var e=F();return"[null]"!=V([e])||"{}"!=V({a:e})||"{}"!=V(Object(e))})),"JSON",{stringify:function(e){var t,n,r=[e],o=1;while(arguments.length>o)r.push(arguments[o++]);if(n=t=r[1],(g(t)||void 0!==e)&&!G(e))return b(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,V.apply(T,r)}}),F[$][M]||n("35e8")(F[$],M,F[$].valueOf),s(F,"Symbol"),s(Math,"Math",!0),s(r.JSON,"JSON",!0)},"0395":function(e,t,n){var r=n("36c3"),o=n("6abf").f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(t){return u.slice()}};e.exports.f=function(e){return u&&"[object Window]"==i.call(e)?a(e):o(r(e))}},"07e3":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},"0fc9":function(e,t,n){var r=n("3a38"),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},"11a6":function(e,t,n){e.exports=n("454f")},1691:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"1bc3":function(e,t,n){var r=n("f772");e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},"1ec9":function(e,t,n){var r=n("f772"),o=n("e53d").document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},"241e":function(e,t,n){var r=n("25eb");e.exports=function(e){return Object(r(e))}},"25eb":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"294c":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"32a6":function(e,t,n){var r=n("241e"),o=n("c3a1");n("ce7e")("keys",function(){return function(e){return o(r(e))}})},"32fc":function(e,t,n){var r=n("e53d").document;e.exports=r&&r.documentElement},"335c":function(e,t,n){var r=n("6b4c");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},"355d":function(e,t){t.f={}.propertyIsEnumerable},"35e8":function(e,t,n){var r=n("d9f6"),o=n("aebd");e.exports=n("8e60")?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},"36c3":function(e,t,n){var r=n("335c"),o=n("25eb");e.exports=function(e){return r(o(e))}},"3a38":function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},4521:function(e,t,n){e.exports=n("ed33")},"454f":function(e,t,n){n("46a7");var r=n("584a").Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},"45f2":function(e,t,n){var r=n("d9f6").f,o=n("07e3"),i=n("5168")("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},"46a7":function(e,t,n){var r=n("63b6");r(r.S+r.F*!n("8e60"),"Object",{defineProperty:n("d9f6").f})},"47ee":function(e,t,n){var r=n("c3a1"),o=n("9aa9"),i=n("355d");e.exports=function(e){var t=r(e),n=o.f;if(n){var u,a=n(e),c=i.f,f=0;while(a.length>f)c.call(e,u=a[f++])&&t.push(u)}return t}},5168:function(e,t,n){var r=n("dbdb")("wks"),o=n("62a0"),i=n("e53d").Symbol,u="function"==typeof i,a=e.exports=function(e){return r[e]||(r[e]=u&&i[e]||(u?i:o)("Symbol."+e))};a.store=r},5559:function(e,t,n){var r=n("dbdb")("keys"),o=n("62a0");e.exports=function(e){return r[e]||(r[e]=o(e))}},"584a":function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},"5b4e":function(e,t,n){var r=n("36c3"),o=n("b447"),i=n("0fc9");e.exports=function(e){return function(t,n,u){var a,c=r(t),f=o(c.length),l=i(u,f);if(e&&n!=n){while(f>l)if(a=c[l++],a!=a)return!0}else for(;f>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},"5f2d":function(e,t,n){e.exports=n("8aae")},"62a0":function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},"63b6":function(e,t,n){var r=n("e53d"),o=n("584a"),i=n("d864"),u=n("35e8"),a=n("07e3"),c="prototype",f=function(e,t,n){var l,s,p,d=e&f.F,v=e&f.G,h=e&f.S,m=e&f.P,b=e&f.B,y=e&f.W,g=v?o:o[t]||(o[t]={}),x=g[c],w=v?r:h?r[t]:(r[t]||{})[c];for(l in v&&(n=t),n)s=!d&&w&&void 0!==w[l],s&&a(g,l)||(p=s?w[l]:n[l],g[l]=v&&"function"!=typeof w[l]?n[l]:b&&s?i(p,r):y&&w[l]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[c]=e[c],t}(p):m&&"function"==typeof p?i(Function.call,p):p,m&&((g.virtual||(g.virtual={}))[l]=p,e&f.R&&x&&!x[l]&&u(x,l,p)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,e.exports=f},6718:function(e,t,n){var r=n("e53d"),o=n("584a"),i=n("b8e3"),u=n("ccb9"),a=n("d9f6").f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:u.f(e)})}},"6abf":function(e,t,n){var r=n("e6f3"),o=n("1691").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},"6b4c":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"794b":function(e,t,n){e.exports=!n("8e60")&&!n("294c")(function(){return 7!=Object.defineProperty(n("1ec9")("div"),"a",{get:function(){return 7}}).a})},"79aa":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},"7e90":function(e,t,n){var r=n("d9f6"),o=n("e4ae"),i=n("c3a1");e.exports=n("8e60")?Object.defineProperties:function(e,t){o(e);var n,u=i(t),a=u.length,c=0;while(a>c)r.f(e,n=u[c++],t[n]);return e}},"8aae":function(e,t,n){n("32a6"),e.exports=n("584a").Object.keys},"8e60":function(e,t,n){e.exports=!n("294c")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},9003:function(e,t,n){var r=n("6b4c");e.exports=Array.isArray||function(e){return"Array"==r(e)}},9138:function(e,t,n){e.exports=n("35e8")},"9aa9":function(e,t){t.f=Object.getOwnPropertySymbols},a159:function(e,t,n){var r=n("e4ae"),o=n("7e90"),i=n("1691"),u=n("5559")("IE_PROTO"),a=function(){},c="prototype",f=function(){var e,t=n("1ec9")("iframe"),r=i.length,o="<",u=">";t.style.display="none",n("32fc").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+u+"document.F=Object"+o+"/script"+u),e.close(),f=e.F;while(r--)delete f[c][i[r]];return f()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[c]=r(e),n=new a,a[c]=null,n[u]=e):n=f(),void 0===t?n:o(n,t)}},aebd:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},b447:function(e,t,n){var r=n("3a38"),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},b8e3:function(e,t){e.exports=!0},bf0b:function(e,t,n){var r=n("355d"),o=n("aebd"),i=n("36c3"),u=n("1bc3"),a=n("07e3"),c=n("794b"),f=Object.getOwnPropertyDescriptor;t.f=n("8e60")?f:function(e,t){if(e=i(e),t=u(t,!0),c)try{return f(e,t)}catch(n){}if(a(e,t))return o(!r.f.call(e,t),e[t])}},bf90:function(e,t,n){var r=n("36c3"),o=n("bf0b").f;n("ce7e")("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},c3a1:function(e,t,n){var r=n("e6f3"),o=n("1691");e.exports=Object.keys||function(e){return r(e,o)}},ccb9:function(e,t,n){t.f=n("5168")},ccd8:function(e,t,n){e.exports=n("fde4")},ce7e:function(e,t,n){var r=n("63b6"),o=n("584a"),i=n("294c");e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],u={};u[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",u)}},d864:function(e,t,n){var r=n("79aa");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},d9f6:function(e,t,n){var r=n("e4ae"),o=n("794b"),i=n("1bc3"),u=Object.defineProperty;t.f=n("8e60")?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return u(e,t,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},dbdb:function(e,t,n){var r=n("584a"),o=n("e53d"),i="__core-js_shared__",u=o[i]||(o[i]={});(e.exports=function(e,t){return u[e]||(u[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("b8e3")?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},e4ae:function(e,t,n){var r=n("f772");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},e53d:function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},e6f3:function(e,t,n){var r=n("07e3"),o=n("36c3"),i=n("5b4e")(!1),u=n("5559")("IE_PROTO");e.exports=function(e,t){var n,a=o(e),c=0,f=[];for(n in a)n!=u&&r(a,n)&&f.push(n);while(t.length>c)r(a,n=t[c++])&&(~i(f,n)||f.push(n));return f}},ebfd:function(e,t,n){var r=n("62a0")("meta"),o=n("f772"),i=n("07e3"),u=n("d9f6").f,a=0,c=Object.isExtensible||function(){return!0},f=!n("294c")(function(){return c(Object.preventExtensions({}))}),l=function(e){u(e,r,{value:{i:"O"+ ++a,w:{}}})},s=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!c(e))return"F";if(!t)return"E";l(e)}return e[r].i},p=function(e,t){if(!i(e,r)){if(!c(e))return!0;if(!t)return!1;l(e)}return e[r].w},d=function(e){return f&&v.NEED&&c(e)&&!i(e,r)&&l(e),e},v=e.exports={KEY:r,NEED:!1,fastKey:s,getWeak:p,onFreeze:d}},ed33:function(e,t,n){n("014b"),e.exports=n("584a").Object.getOwnPropertySymbols},f772:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},fb15:function(e,t,n){"use strict";var r;(n.r(t),"undefined"!==typeof window)&&((r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("input",{directives:[{name:"currency",rawName:"v-currency",value:{locale:e.locale,currency:e.currency,distractionFree:e.distractionFree,min:e.min,max:e.max,validateOnInput:e.validateOnInput},expression:"{locale, currency, distractionFree, min, max, validateOnInput}"}],domProps:{value:e.formattedValue},on:{change:e.handleChange}})},i=[],u=n("ccd8"),a=n.n(u),c=n("4521"),f=n.n(c),l=n("5f2d"),s=n.n(l),p=n("11a6"),d=n.n(p);function v(e,t,n){return t in e?d()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=s()(n);"function"===typeof f.a&&(r=r.concat(f()(n).filter(function(e){return a()(n,e).enumerable}))),r.forEach(function(t){v(e,t,n[t])})}return e}var m=function(e){var t=e.locale,n=e.currency,r=new Intl.NumberFormat(t,{style:"currency",currency:n}),o=r.format(1234),i=(o.match(/0/g)||[]).length,u=i>0?o.substr(o.indexOf("4")+1,1):null,a=null!==u,c=o.substring(0,o.indexOf("1")),f=o.substring(o.lastIndexOf(i>0?"0":"4")+1),l=o.substr(o.indexOf("1")+1,1);return{prefix:c,suffix:f,thousandsSeparatorSymbol:l,decimalSymbol:u,decimalLimit:i,allowDecimal:a}},b=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},y=function(e){return e.replace(/\D+/g,"")},g=function(e,t){return t&&e.startsWith(t)?e.substr(t.length):e},x=function(e,t){return t&&e.endsWith(t)?e.slice(0,-1*t.length):e},w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.decimalSymbol,r=t.allowNegative,o=void 0===r||r;if("number"===typeof e)return e;if(e&&"string"===typeof e&&e.trim().length){var i=e.startsWith("-")&&o,u=e.split(n),a=y(u[0]);if(i&&(a="-"+a),2===u.length&&(a+="."+y(u[1])),a)return a=Number(a),Number.isNaN(a)?null:a}return null};const O=[],S="";function C({previousConformedValue:e=S,previousPlaceholder:t=S,currentCaretPosition:n=0,conformedValue:r,rawValue:o,placeholderChar:i,placeholder:u,indexesOfPipedChars:a=O,caretTrapIndexes:c=O}){if(0===n||!o.length)return 0;const f=o.length,l=e.length,s=u.length,p=r.length,d=f-l,v=d>0,h=0===l,m=d>1&&!v&&!h;if(m)return n;const b=v&&(e===r||r===u);let y,g,x=0;if(b)x=n-d;else{const e=r.toLowerCase(),c=o.toLowerCase(),f=c.substr(0,n).split(S),l=f.filter(t=>-1!==e.indexOf(t));g=l[l.length-1];const s=t.substr(0,l.length).split(S).filter(e=>e!==i).length,d=u.substr(0,l.length).split(S).filter(e=>e!==i).length,h=d!==s,m=void 0!==t[l.length-1]&&void 0!==u[l.length-2]&&t[l.length-1]!==i&&t[l.length-1]!==u[l.length-1]&&t[l.length-1]===u[l.length-2];!v&&(h||m)&&s>0&&u.indexOf(g)>-1&&void 0!==o[n]&&(y=!0,g=o[n]);const b=a.map(t=>e[t]),w=b.filter(e=>e===g).length,O=l.filter(e=>e===g).length,C=u.substr(0,u.indexOf(i)).split(S).filter((e,t)=>e===g&&o[t]!==e).length,E=C+O+w+(y?1:0);let P=0;for(let t=0;t<p;t++){const n=e[t];if(x=t+1,n===g&&P++,P>=E)break}}if(v){let e=x;for(let t=x;t<=s;t++)if(u[t]===i&&(e=t),u[t]===i||-1!==c.indexOf(t)||t===s)return e}else if(y){for(let w=x-1;w>=0;w--)if(r[w]===g||-1!==c.indexOf(w)||0===w)return w}else for(let w=x;w>=0;w--)if(u[w-1]===i||-1!==c.indexOf(w)||0===w)return w}const E="_",P="function",j=[];function _(e=j,t=E){if(!k(e))throw new Error("Text-mask:convertMaskToPlaceholder; The mask property must be an array.");if(-1!==e.indexOf(t))throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\n"+`The placeholder character that was received is: ${JSON.stringify(t)}\n\n`+`The mask that was received is: ${JSON.stringify(e)}`);return e.map(e=>{return e instanceof RegExp?t:e}).join("")}function k(e){return Array.isArray&&Array.isArray(e)||e instanceof Array}function N(e){return"string"===typeof e||e instanceof String}function F(e){return"number"===typeof e&&void 0===e.length&&!isNaN(e)}const T="[]";function V(e){const t=[];let n;while(n=e.indexOf(T),-1!==n)t.push(n),e.splice(n,1);return{maskWithoutCaretTraps:e,indexes:t}}const $=[],I="";function M(e=I,t=$,n={}){if(!k(t)){if(typeof t!==P)throw new Error("Text-mask:conformToMask; The mask property must be an array.");t=t(e,n),t=V(t).maskWithoutCaretTraps}const{guide:r=!0,previousConformedValue:o=I,placeholderChar:i=E,placeholder:u=_(t,i),currentCaretPosition:a,keepCharPositions:c}=n,f=!1===r&&void 0!==o,l=e.length,s=o.length,p=u.length,d=t.length,v=l-s,h=v>0,m=a+(h?-v:0),b=m+Math.abs(v);if(!0===c&&!h){let t=I;for(let e=m;e<b;e++)u[e]===i&&(t+=i);e=e.slice(0,m)+t+e.slice(m,l)}const y=e.split(I).map((e,t)=>({char:e,isNew:t>=m&&t<b}));for(let w=l-1;w>=0;w--){const{char:e}=y[w];if(e!==i){const t=w>=m&&s===d;e===u[t?w-v:w]&&y.splice(w,1)}}let g=I,x=!1;e:for(let w=0;w<p;w++){const e=u[w];if(e===i){if(y.length>0)while(y.length>0){const{char:e,isNew:n}=y.shift();if(e===i&&!0!==f){g+=i;continue e}if(t[w].test(e)){if(!0===c&&!1!==n&&o!==I&&!1!==r&&h){const t=y.length;let n=null;for(let e=0;e<t;e++){const t=y[e];if(t.char!==i&&!1===t.isNew)break;if(t.char===i){n=e;break}}null!==n?(g+=e,y.splice(n,1)):w--}else g+=e;continue e}x=!0}!1===f&&(g+=u.substr(w,p));break}g+=e}if(f&&!1===h){let e=null;for(let t=0;t<g.length;t++)u[t]===i&&(e=t);g=null!==e?g.substr(0,e+1):I}return{conformedValue:g,meta:{someCharsRejected:x}}}const R="",A="none",D="object",W="undefined"!==typeof navigator&&/Android/i.test(navigator.userAgent),L="undefined"!==typeof requestAnimationFrame?requestAnimationFrame:setTimeout;function J(e){const t={previousConformedValue:void 0,previousPlaceholder:void 0};return{state:t,update(n,{inputElement:r,mask:o,guide:i,pipe:u,placeholderChar:a=E,keepCharPositions:c=!1,showMask:f=!1}=e){if("undefined"===typeof n&&(n=r.value),n===t.previousConformedValue)return;let l,s;if(typeof o===D&&void 0!==o.pipe&&void 0!==o.mask&&(u=o.pipe,o=o.mask),o instanceof Array&&(l=_(o,a)),!1===o)return;const p=U(n),{selectionEnd:d}=r,{previousConformedValue:v,previousPlaceholder:h}=t;let m;if(typeof o===P){if(s=o(p,{currentCaretPosition:d,previousConformedValue:v,placeholderChar:a}),!1===s)return;const{maskWithoutCaretTraps:e,indexes:t}=V(s);s=e,m=t,l=_(s,a)}else s=o;const b={previousConformedValue:v,guide:i,placeholderChar:a,pipe:u,placeholder:l,currentCaretPosition:d,keepCharPositions:c},{conformedValue:y}=M(p,s,b),g=typeof u===P;let x={};g&&(x=u(y,{rawValue:p,...b}),!1===x?x={value:v,rejected:!0}:N(x)&&(x={value:x}));const w=g?x.value:y,O=C({previousConformedValue:v,previousPlaceholder:h,conformedValue:w,placeholder:l,rawValue:p,currentCaretPosition:d,placeholderChar:a,indexesOfPipedChars:x.indexesOfPipedChars,caretTrapIndexes:m}),S=w===l&&0===O,j=f?l:R,k=S?j:w;t.previousConformedValue=k,t.previousPlaceholder=l,r.value!==k&&(r.value=k,B(r,O))}}}function B(e,t){document.activeElement===e&&(W?L(()=>e.setSelectionRange(t,t,A),0):e.setSelectionRange(t,t,A))}function U(e){if(N(e))return e;if(F(e))return String(e);if(void 0===e||null===e)return R;throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value "+`received was:\n\n ${JSON.stringify(e)}`)}var q={locale:void 0,currency:"EUR",distractionFree:!0,min:null,max:null,validateOnInput:!1},z=/\d/,G="[]",K=function(e){return e.split("").map(function(e){return z.test(e)?z:e})},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.prefix,n=e.suffix,r=e.thousandsSeparatorSymbol,o=e.allowDecimal,i=e.allowNegative,u=e.decimalSymbol,a=e.decimalLimit,c=t?t.length:0,f=n?n.length:0;return function(){var e,l,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",p=s.indexOf(u),d=-1!==p,v=s.startsWith("-")&&i;if(s=g(s,"-"),s=g(s,t),s=x(s,n),d&&o){var h=s.split(u);e=h[0],l=K(y(h[1]))}else e=s;e=y(e),e=e.replace(/^0+(0$|[^0])/,"$1"),e=e.replace(/\B(?=(\d{3})+(?!\d))/g,r);var m=K(e);return d&&o&&(m.push(G,u,G),l&&("number"===typeof a&&(l=l.slice(0,a)),m=m.concat(l))),c>0&&(m=t.split("").concat(m)),v&&(m=[/-/].concat(m)),f>0&&(m=m.concat(n.split(""))),m}},Y={bind:function(e,t){var n=H(e,t.value);Z(n,b(n.value)?Number(n.value):null),n.addEventListener("input",function(t){var r=t.detail;ee(n,r?r.value:n.value),e.dispatchEvent(new CustomEvent("change",{detail:{numberValue:n.$ci.numberValue,formattedValue:n.value}}))},{capture:!0}),n.addEventListener("focus",function(){var e=n.$ci,t=e.options,r=e.currencyFormatConfig;n.$ci.focus=!0,t.distractionFree&&setTimeout(function(){var e=te(n);ee(n,w(n.value,r)),n.setSelectionRange(e,e)},0)}),n.addEventListener("blur",function(){n.$ci.focus=!1,Z(n)})},componentUpdated:function(e,t){if(Q(t.oldValue,t.value)){var n=H(e,t.value);Z(n,n.$ci.numberValue)}}},Q=function(e,t){return Object.keys(q).some(function(n){return e[n]!==t[n]})},H=function(e,t){var n=e.matches("input")?e:e.querySelector("input");if(!n)throw new Error("The directive must be applied on an element consists of an input element");var r=h({},q,t);if(null!=r.min&&null!=r.max&&r.min>r.max)throw new Error("Invalid number range");var o=m(r),i=J({inputElement:n,mask:[]});return n.$ci=h({},n.$ci||{},{options:r,currencyFormatConfig:o,textMaskInputElement:i}),n},Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w(e.value,e.$ci.currencyFormatConfig);null==t||e.$ci.currencyFormatConfig.allowDecimal||(t=Math.round(t)),ee(e,t),e.dispatchEvent(new Event("input")),e.dispatchEvent(new CustomEvent("change",{detail:{numberValue:e.$ci.numberValue,formattedValue:e.value}}))},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.value,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.$ci,r=n.options,o=n.currencyFormatConfig,i=n.textMaskInputElement,u=n.focus,a=u&&r.distractionFree;"number"===typeof t&&(null!=r.min&&t<r.min&&(t=r.min),null!=r.max&&t>r.max&&(t=r.max),t=new Intl.NumberFormat(r.locale,{minimumFractionDigits:a?0:o.decimalLimit}).format(t)),i.update(t,{inputElement:e,pipe:function(e,t){var n=t.previousConformedValue;if(r.validateOnInput){if(null!=r.min&&w(e,o)<r.min)return n;if(null!=r.max&&w(e,o)>r.max)return n}return e},mask:X(h({},o,{prefix:a?"":o.prefix,suffix:a?"":o.suffix,thousandsSeparatorSymbol:a?"":o.thousandsSeparatorSymbol,allowNegative:null===r.min&&null===r.max||r.min<0||r.max<0}))}),e.$ci.numberValue=w(e.value,o)},te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.$ci.currencyFormatConfig,n=t.prefix,r=t.thousandsSeparatorSymbol;return Math.max(0,e.selectionStart-n.length-(e.value.substring(0,e.selectionStart).match(new RegExp("."===r?"\\.":r,"g"))||[]).length)},ne={name:"CurrencyInput",directives:{currency:Y},props:{value:{type:Number,default:null},locale:{type:String,default:q.locale},currency:{type:String,required:!0},distractionFree:{type:Boolean,default:q.distractionFree},min:{type:Number,default:q.min},max:{type:Number,default:q.max},validateOnInput:{type:Boolean,default:q.validateOnInput}},data:function(){return{formattedValue:this.value}},watch:{value:function(e){this.$el.$ci.focus||this.$el.dispatchEvent(new CustomEvent("input",{detail:{value:e}}))}},methods:{handleChange:function(e){var t=e.detail;t&&(this.$emit("input",t.numberValue),this.formattedValue=t.formattedValue)}}},re=ne;function oe(e,t,n,r,o,i,u,a){var c,f="function"===typeof e?e.options:e;if(t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),u?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(u)},f._ssrRegister=c):o&&(c=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(f.functional){f._injectStyles=c;var l=f.render;f.render=function(e,t){return c.call(t),l(e,t)}}else{var s=f.beforeCreate;f.beforeCreate=s?[].concat(s,c):[c]}return{exports:e,options:f}}var ie=oe(re,o,i,!1,null,null,null),ue=ie.exports,ae={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.componentName,r=void 0===n?ue.name:n,o=t.directiveName,i=void 0===o?"currency":o;e.component(r,ue),e.directive(i,Y)}},ce=ae;"undefined"!==typeof window&&window.Vue&&window.Vue.use(ae),n.d(t,"CurrencyInput",function(){return ue}),n.d(t,"CurrencyDirective",function(){return Y});t["default"]=ce},fde4:function(e,t,n){n("bf90");var r=n("584a").Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}}})}); | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-currency-input"]=t():e["vue-currency-input"]=t()})("undefined"!==typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"014b":function(e,t,n){"use strict";var r=n("e53d"),o=n("07e3"),i=n("8e60"),u=n("63b6"),a=n("9138"),c=n("ebfd").KEY,f=n("294c"),l=n("dbdb"),s=n("45f2"),p=n("62a0"),d=n("5168"),v=n("ccb9"),h=n("6718"),m=n("47ee"),b=n("9003"),y=n("e4ae"),g=n("f772"),x=n("36c3"),w=n("1bc3"),O=n("aebd"),S=n("a159"),C=n("0395"),E=n("bf0b"),P=n("d9f6"),j=n("c3a1"),_=E.f,k=P.f,N=C.f,F=r.Symbol,T=r.JSON,V=T&&T.stringify,$="prototype",I=d("_hidden"),M=d("toPrimitive"),R={}.propertyIsEnumerable,A=l("symbol-registry"),D=l("symbols"),W=l("op-symbols"),L=Object[$],J="function"==typeof F,B=r.QObject,U=!B||!B[$]||!B[$].findChild,q=i&&f(function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=_(L,t);r&&delete L[t],k(e,t,n),r&&e!==L&&k(L,t,r)}:k,z=function(e){var t=D[e]=S(F[$]);return t._k=e,t},G=J&&"symbol"==typeof F.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof F},K=function(e,t,n){return e===L&&K(W,t,n),y(e),t=w(t,!0),y(n),o(D,t)?(n.enumerable?(o(e,I)&&e[I][t]&&(e[I][t]=!1),n=S(n,{enumerable:O(0,!1)})):(o(e,I)||k(e,I,O(1,{})),e[I][t]=!0),q(e,t,n)):k(e,t,n)},X=function(e,t){y(e);var n,r=m(t=x(t)),o=0,i=r.length;while(i>o)K(e,n=r[o++],t[n]);return e},Y=function(e,t){return void 0===t?S(e):X(S(e),t)},Q=function(e){var t=R.call(this,e=w(e,!0));return!(this===L&&o(D,e)&&!o(W,e))&&(!(t||!o(this,e)||!o(D,e)||o(this,I)&&this[I][e])||t)},H=function(e,t){if(e=x(e),t=w(t,!0),e!==L||!o(D,t)||o(W,t)){var n=_(e,t);return!n||!o(D,t)||o(e,I)&&e[I][t]||(n.enumerable=!0),n}},Z=function(e){var t,n=N(x(e)),r=[],i=0;while(n.length>i)o(D,t=n[i++])||t==I||t==c||r.push(t);return r},ee=function(e){var t,n=e===L,r=N(n?W:x(e)),i=[],u=0;while(r.length>u)!o(D,t=r[u++])||n&&!o(L,t)||i.push(D[t]);return i};J||(F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===L&&t.call(W,n),o(this,I)&&o(this[I],e)&&(this[I][e]=!1),q(this,e,O(1,n))};return i&&U&&q(L,e,{configurable:!0,set:t}),z(e)},a(F[$],"toString",function(){return this._k}),E.f=H,P.f=K,n("6abf").f=C.f=Z,n("355d").f=Q,n("9aa9").f=ee,i&&!n("b8e3")&&a(L,"propertyIsEnumerable",Q,!0),v.f=function(e){return z(d(e))}),u(u.G+u.W+u.F*!J,{Symbol:F});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)d(te[ne++]);for(var re=j(d.store),oe=0;re.length>oe;)h(re[oe++]);u(u.S+u.F*!J,"Symbol",{for:function(e){return o(A,e+="")?A[e]:A[e]=F(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in A)if(A[t]===e)return t},useSetter:function(){U=!0},useSimple:function(){U=!1}}),u(u.S+u.F*!J,"Object",{create:Y,defineProperty:K,defineProperties:X,getOwnPropertyDescriptor:H,getOwnPropertyNames:Z,getOwnPropertySymbols:ee}),T&&u(u.S+u.F*(!J||f(function(){var e=F();return"[null]"!=V([e])||"{}"!=V({a:e})||"{}"!=V(Object(e))})),"JSON",{stringify:function(e){var t,n,r=[e],o=1;while(arguments.length>o)r.push(arguments[o++]);if(n=t=r[1],(g(t)||void 0!==e)&&!G(e))return b(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,V.apply(T,r)}}),F[$][M]||n("35e8")(F[$],M,F[$].valueOf),s(F,"Symbol"),s(Math,"Math",!0),s(r.JSON,"JSON",!0)},"0395":function(e,t,n){var r=n("36c3"),o=n("6abf").f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(t){return u.slice()}};e.exports.f=function(e){return u&&"[object Window]"==i.call(e)?a(e):o(r(e))}},"07e3":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},"0fc9":function(e,t,n){var r=n("3a38"),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},"11a6":function(e,t,n){e.exports=n("454f")},1691:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"1bc3":function(e,t,n){var r=n("f772");e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},"1ec9":function(e,t,n){var r=n("f772"),o=n("e53d").document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},"241e":function(e,t,n){var r=n("25eb");e.exports=function(e){return Object(r(e))}},"25eb":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"294c":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"32a6":function(e,t,n){var r=n("241e"),o=n("c3a1");n("ce7e")("keys",function(){return function(e){return o(r(e))}})},"32fc":function(e,t,n){var r=n("e53d").document;e.exports=r&&r.documentElement},"335c":function(e,t,n){var r=n("6b4c");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},"355d":function(e,t){t.f={}.propertyIsEnumerable},"35e8":function(e,t,n){var r=n("d9f6"),o=n("aebd");e.exports=n("8e60")?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},"36c3":function(e,t,n){var r=n("335c"),o=n("25eb");e.exports=function(e){return r(o(e))}},"3a38":function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},4521:function(e,t,n){e.exports=n("ed33")},"454f":function(e,t,n){n("46a7");var r=n("584a").Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},"45f2":function(e,t,n){var r=n("d9f6").f,o=n("07e3"),i=n("5168")("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},"46a7":function(e,t,n){var r=n("63b6");r(r.S+r.F*!n("8e60"),"Object",{defineProperty:n("d9f6").f})},"47ee":function(e,t,n){var r=n("c3a1"),o=n("9aa9"),i=n("355d");e.exports=function(e){var t=r(e),n=o.f;if(n){var u,a=n(e),c=i.f,f=0;while(a.length>f)c.call(e,u=a[f++])&&t.push(u)}return t}},5168:function(e,t,n){var r=n("dbdb")("wks"),o=n("62a0"),i=n("e53d").Symbol,u="function"==typeof i,a=e.exports=function(e){return r[e]||(r[e]=u&&i[e]||(u?i:o)("Symbol."+e))};a.store=r},5559:function(e,t,n){var r=n("dbdb")("keys"),o=n("62a0");e.exports=function(e){return r[e]||(r[e]=o(e))}},"584a":function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},"5b4e":function(e,t,n){var r=n("36c3"),o=n("b447"),i=n("0fc9");e.exports=function(e){return function(t,n,u){var a,c=r(t),f=o(c.length),l=i(u,f);if(e&&n!=n){while(f>l)if(a=c[l++],a!=a)return!0}else for(;f>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},"5f2d":function(e,t,n){e.exports=n("8aae")},"62a0":function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},"63b6":function(e,t,n){var r=n("e53d"),o=n("584a"),i=n("d864"),u=n("35e8"),a=n("07e3"),c="prototype",f=function(e,t,n){var l,s,p,d=e&f.F,v=e&f.G,h=e&f.S,m=e&f.P,b=e&f.B,y=e&f.W,g=v?o:o[t]||(o[t]={}),x=g[c],w=v?r:h?r[t]:(r[t]||{})[c];for(l in v&&(n=t),n)s=!d&&w&&void 0!==w[l],s&&a(g,l)||(p=s?w[l]:n[l],g[l]=v&&"function"!=typeof w[l]?n[l]:b&&s?i(p,r):y&&w[l]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[c]=e[c],t}(p):m&&"function"==typeof p?i(Function.call,p):p,m&&((g.virtual||(g.virtual={}))[l]=p,e&f.R&&x&&!x[l]&&u(x,l,p)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,e.exports=f},6718:function(e,t,n){var r=n("e53d"),o=n("584a"),i=n("b8e3"),u=n("ccb9"),a=n("d9f6").f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:u.f(e)})}},"6abf":function(e,t,n){var r=n("e6f3"),o=n("1691").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},"6b4c":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"794b":function(e,t,n){e.exports=!n("8e60")&&!n("294c")(function(){return 7!=Object.defineProperty(n("1ec9")("div"),"a",{get:function(){return 7}}).a})},"79aa":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},"7e90":function(e,t,n){var r=n("d9f6"),o=n("e4ae"),i=n("c3a1");e.exports=n("8e60")?Object.defineProperties:function(e,t){o(e);var n,u=i(t),a=u.length,c=0;while(a>c)r.f(e,n=u[c++],t[n]);return e}},"8aae":function(e,t,n){n("32a6"),e.exports=n("584a").Object.keys},"8e60":function(e,t,n){e.exports=!n("294c")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},9003:function(e,t,n){var r=n("6b4c");e.exports=Array.isArray||function(e){return"Array"==r(e)}},9138:function(e,t,n){e.exports=n("35e8")},"9aa9":function(e,t){t.f=Object.getOwnPropertySymbols},a159:function(e,t,n){var r=n("e4ae"),o=n("7e90"),i=n("1691"),u=n("5559")("IE_PROTO"),a=function(){},c="prototype",f=function(){var e,t=n("1ec9")("iframe"),r=i.length,o="<",u=">";t.style.display="none",n("32fc").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+u+"document.F=Object"+o+"/script"+u),e.close(),f=e.F;while(r--)delete f[c][i[r]];return f()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[c]=r(e),n=new a,a[c]=null,n[u]=e):n=f(),void 0===t?n:o(n,t)}},aebd:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},b447:function(e,t,n){var r=n("3a38"),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},b8e3:function(e,t){e.exports=!0},bf0b:function(e,t,n){var r=n("355d"),o=n("aebd"),i=n("36c3"),u=n("1bc3"),a=n("07e3"),c=n("794b"),f=Object.getOwnPropertyDescriptor;t.f=n("8e60")?f:function(e,t){if(e=i(e),t=u(t,!0),c)try{return f(e,t)}catch(n){}if(a(e,t))return o(!r.f.call(e,t),e[t])}},bf90:function(e,t,n){var r=n("36c3"),o=n("bf0b").f;n("ce7e")("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},c3a1:function(e,t,n){var r=n("e6f3"),o=n("1691");e.exports=Object.keys||function(e){return r(e,o)}},ccb9:function(e,t,n){t.f=n("5168")},ccd8:function(e,t,n){e.exports=n("fde4")},ce7e:function(e,t,n){var r=n("63b6"),o=n("584a"),i=n("294c");e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],u={};u[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",u)}},d864:function(e,t,n){var r=n("79aa");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},d9f6:function(e,t,n){var r=n("e4ae"),o=n("794b"),i=n("1bc3"),u=Object.defineProperty;t.f=n("8e60")?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return u(e,t,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},dbdb:function(e,t,n){var r=n("584a"),o=n("e53d"),i="__core-js_shared__",u=o[i]||(o[i]={});(e.exports=function(e,t){return u[e]||(u[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("b8e3")?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},e4ae:function(e,t,n){var r=n("f772");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},e53d:function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},e6f3:function(e,t,n){var r=n("07e3"),o=n("36c3"),i=n("5b4e")(!1),u=n("5559")("IE_PROTO");e.exports=function(e,t){var n,a=o(e),c=0,f=[];for(n in a)n!=u&&r(a,n)&&f.push(n);while(t.length>c)r(a,n=t[c++])&&(~i(f,n)||f.push(n));return f}},ebfd:function(e,t,n){var r=n("62a0")("meta"),o=n("f772"),i=n("07e3"),u=n("d9f6").f,a=0,c=Object.isExtensible||function(){return!0},f=!n("294c")(function(){return c(Object.preventExtensions({}))}),l=function(e){u(e,r,{value:{i:"O"+ ++a,w:{}}})},s=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!c(e))return"F";if(!t)return"E";l(e)}return e[r].i},p=function(e,t){if(!i(e,r)){if(!c(e))return!0;if(!t)return!1;l(e)}return e[r].w},d=function(e){return f&&v.NEED&&c(e)&&!i(e,r)&&l(e),e},v=e.exports={KEY:r,NEED:!1,fastKey:s,getWeak:p,onFreeze:d}},ed33:function(e,t,n){n("014b"),e.exports=n("584a").Object.getOwnPropertySymbols},f772:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},fb15:function(e,t,n){"use strict";var r;(n.r(t),"undefined"!==typeof window)&&((r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("input",{directives:[{name:"currency",rawName:"v-currency",value:{locale:e.locale,currency:e.currency,distractionFree:e.distractionFree,min:e.min,max:e.max,validateOnInput:e.validateOnInput},expression:"{locale, currency, distractionFree, min, max, validateOnInput}"}],domProps:{value:e.formattedValue},on:{change:e.handleChange}})},i=[],u=n("ccd8"),a=n.n(u),c=n("4521"),f=n.n(c),l=n("5f2d"),s=n.n(l),p=n("11a6"),d=n.n(p);function v(e,t,n){return t in e?d()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=s()(n);"function"===typeof f.a&&(r=r.concat(f()(n).filter(function(e){return a()(n,e).enumerable}))),r.forEach(function(t){v(e,t,n[t])})}return e}var m=function(e){var t=e.locale,n=e.currency,r=new Intl.NumberFormat(t,{style:"currency",currency:n}),o=r.format(1234),i=(o.match(/0/g)||[]).length,u=i>0?o.substr(o.indexOf("4")+1,1):null,a=null!==u,c=o.substring(0,o.indexOf("1")),f=o.substring(o.lastIndexOf(i>0?"0":"4")+1),l=o.substr(o.indexOf("1")+1,1);return{prefix:c,suffix:f,thousandsSeparatorSymbol:l,decimalSymbol:u,decimalLimit:i,allowDecimal:a}},b=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},y=function(e){return e.replace(/\D+/g,"")},g=function(e,t){return t&&e.startsWith(t)?e.substr(t.length):e},x=function(e,t){return t&&e.endsWith(t)?e.slice(0,-1*t.length):e},w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.decimalSymbol,r=t.allowNegative,o=void 0===r||r;if("number"===typeof e)return e;if(e&&"string"===typeof e&&e.trim().length){var i=e.startsWith("-")&&o,u=e.split(n),a=y(u[0]);if(i&&(a="-"+a),2===u.length&&(a+="."+y(u[1])),a)return a=Number(a),Number.isNaN(a)?null:a}return null};const O=[],S="";function C({previousConformedValue:e=S,previousPlaceholder:t=S,currentCaretPosition:n=0,conformedValue:r,rawValue:o,placeholderChar:i,placeholder:u,indexesOfPipedChars:a=O,caretTrapIndexes:c=O}){if(0===n||!o.length)return 0;const f=o.length,l=e.length,s=u.length,p=r.length,d=f-l,v=d>0,h=0===l,m=d>1&&!v&&!h;if(m)return n;const b=v&&(e===r||r===u);let y,g,x=0;if(b)x=n-d;else{const e=r.toLowerCase(),c=o.toLowerCase(),f=c.substr(0,n).split(S),l=f.filter(t=>-1!==e.indexOf(t));g=l[l.length-1];const s=t.substr(0,l.length).split(S).filter(e=>e!==i).length,d=u.substr(0,l.length).split(S).filter(e=>e!==i).length,h=d!==s,m=void 0!==t[l.length-1]&&void 0!==u[l.length-2]&&t[l.length-1]!==i&&t[l.length-1]!==u[l.length-1]&&t[l.length-1]===u[l.length-2];!v&&(h||m)&&s>0&&u.indexOf(g)>-1&&void 0!==o[n]&&(y=!0,g=o[n]);const b=a.map(t=>e[t]),w=b.filter(e=>e===g).length,O=l.filter(e=>e===g).length,C=u.substr(0,u.indexOf(i)).split(S).filter((e,t)=>e===g&&o[t]!==e).length,E=C+O+w+(y?1:0);let P=0;for(let t=0;t<p;t++){const n=e[t];if(x=t+1,n===g&&P++,P>=E)break}}if(v){let e=x;for(let t=x;t<=s;t++)if(u[t]===i&&(e=t),u[t]===i||-1!==c.indexOf(t)||t===s)return e}else if(y){for(let w=x-1;w>=0;w--)if(r[w]===g||-1!==c.indexOf(w)||0===w)return w}else for(let w=x;w>=0;w--)if(u[w-1]===i||-1!==c.indexOf(w)||0===w)return w}const E="_",P="function",j=[];function _(e=j,t=E){if(!k(e))throw new Error("Text-mask:convertMaskToPlaceholder; The mask property must be an array.");if(-1!==e.indexOf(t))throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\n"+`The placeholder character that was received is: ${JSON.stringify(t)}\n\n`+`The mask that was received is: ${JSON.stringify(e)}`);return e.map(e=>{return e instanceof RegExp?t:e}).join("")}function k(e){return Array.isArray&&Array.isArray(e)||e instanceof Array}function N(e){return"string"===typeof e||e instanceof String}function F(e){return"number"===typeof e&&void 0===e.length&&!isNaN(e)}const T="[]";function V(e){const t=[];let n;while(n=e.indexOf(T),-1!==n)t.push(n),e.splice(n,1);return{maskWithoutCaretTraps:e,indexes:t}}const $=[],I="";function M(e=I,t=$,n={}){if(!k(t)){if(typeof t!==P)throw new Error("Text-mask:conformToMask; The mask property must be an array.");t=t(e,n),t=V(t).maskWithoutCaretTraps}const{guide:r=!0,previousConformedValue:o=I,placeholderChar:i=E,placeholder:u=_(t,i),currentCaretPosition:a,keepCharPositions:c}=n,f=!1===r&&void 0!==o,l=e.length,s=o.length,p=u.length,d=t.length,v=l-s,h=v>0,m=a+(h?-v:0),b=m+Math.abs(v);if(!0===c&&!h){let t=I;for(let e=m;e<b;e++)u[e]===i&&(t+=i);e=e.slice(0,m)+t+e.slice(m,l)}const y=e.split(I).map((e,t)=>({char:e,isNew:t>=m&&t<b}));for(let w=l-1;w>=0;w--){const{char:e}=y[w];if(e!==i){const t=w>=m&&s===d;e===u[t?w-v:w]&&y.splice(w,1)}}let g=I,x=!1;e:for(let w=0;w<p;w++){const e=u[w];if(e===i){if(y.length>0)while(y.length>0){const{char:e,isNew:n}=y.shift();if(e===i&&!0!==f){g+=i;continue e}if(t[w].test(e)){if(!0===c&&!1!==n&&o!==I&&!1!==r&&h){const t=y.length;let n=null;for(let e=0;e<t;e++){const t=y[e];if(t.char!==i&&!1===t.isNew)break;if(t.char===i){n=e;break}}null!==n?(g+=e,y.splice(n,1)):w--}else g+=e;continue e}x=!0}!1===f&&(g+=u.substr(w,p));break}g+=e}if(f&&!1===h){let e=null;for(let t=0;t<g.length;t++)u[t]===i&&(e=t);g=null!==e?g.substr(0,e+1):I}return{conformedValue:g,meta:{someCharsRejected:x}}}const R="",A="none",D="object",W="undefined"!==typeof navigator&&/Android/i.test(navigator.userAgent),L="undefined"!==typeof requestAnimationFrame?requestAnimationFrame:setTimeout;function J(e){const t={previousConformedValue:void 0,previousPlaceholder:void 0};return{state:t,update(n,{inputElement:r,mask:o,guide:i,pipe:u,placeholderChar:a=E,keepCharPositions:c=!1,showMask:f=!1}=e){if("undefined"===typeof n&&(n=r.value),n===t.previousConformedValue)return;let l,s;if(typeof o===D&&void 0!==o.pipe&&void 0!==o.mask&&(u=o.pipe,o=o.mask),o instanceof Array&&(l=_(o,a)),!1===o)return;const p=U(n),{selectionEnd:d}=r,{previousConformedValue:v,previousPlaceholder:h}=t;let m;if(typeof o===P){if(s=o(p,{currentCaretPosition:d,previousConformedValue:v,placeholderChar:a}),!1===s)return;const{maskWithoutCaretTraps:e,indexes:t}=V(s);s=e,m=t,l=_(s,a)}else s=o;const b={previousConformedValue:v,guide:i,placeholderChar:a,pipe:u,placeholder:l,currentCaretPosition:d,keepCharPositions:c},{conformedValue:y}=M(p,s,b),g=typeof u===P;let x={};g&&(x=u(y,{rawValue:p,...b}),!1===x?x={value:v,rejected:!0}:N(x)&&(x={value:x}));const w=g?x.value:y,O=C({previousConformedValue:v,previousPlaceholder:h,conformedValue:w,placeholder:l,rawValue:p,currentCaretPosition:d,placeholderChar:a,indexesOfPipedChars:x.indexesOfPipedChars,caretTrapIndexes:m}),S=w===l&&0===O,j=f?l:R,k=S?j:w;t.previousConformedValue=k,t.previousPlaceholder=l,r.value!==k&&(r.value=k,B(r,O))}}}function B(e,t){document.activeElement===e&&(W?L(()=>e.setSelectionRange(t,t,A),0):e.setSelectionRange(t,t,A))}function U(e){if(N(e))return e;if(F(e))return String(e);if(void 0===e||null===e)return R;throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value "+`received was:\n\n ${JSON.stringify(e)}`)}var q={locale:void 0,currency:"EUR",distractionFree:!0,min:null,max:null,validateOnInput:!1},z=/\d/,G="[]",K=function(e){return e.split("").map(function(e){return z.test(e)?z:e})},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.prefix,n=e.suffix,r=e.thousandsSeparatorSymbol,o=e.allowDecimal,i=e.allowNegative,u=e.decimalSymbol,a=e.decimalLimit,c=t?t.length:0,f=n?n.length:0;return function(){var e,l,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",p=s.indexOf(u),d=-1!==p,v=s.startsWith("-")&&i;if(s=g(s,"-"),s=g(s,t),s=x(s,n),d&&o){var h=s.split(u);e=h[0],l=K(y(h[1]))}else e=s;e=y(e),e=e.replace(/^0+(0$|[^0])/,"$1"),e=e.replace(/\B(?=(\d{3})+(?!\d))/g,r);var m=K(e);return d&&o&&(m.push(G,u,G),l&&("number"===typeof a&&(l=l.slice(0,a)),m=m.concat(l))),c>0&&(m=t.split("").concat(m)),v&&(m=[/-/].concat(m)),f>0&&(m=m.concat(n.split(""))),m}},Y={bind:function(e,t){var n=H(e,t.value);Z(n,b(n.value)?Number(n.value):null),n.addEventListener("input",function(t){var r=t.detail;ee(n,r?r.value:n.value),e.dispatchEvent(new CustomEvent("change",{detail:{numberValue:n.$ci.numberValue,formattedValue:n.value}}))},{capture:!0}),n.addEventListener("focus",function(){var e=n.$ci,t=e.options,r=e.currencyFormatConfig;n.$ci.focus=!0,t.distractionFree&&setTimeout(function(){var e=te(n);ee(n,w(n.value,r)),n.setSelectionRange(e,e)},0)}),n.addEventListener("blur",function(){n.$ci.focus=!1,Z(n)})},componentUpdated:function(e,t){if(Q(t.oldValue,t.value)){var n=H(e,t.value);Z(n,n.$ci.numberValue)}}},Q=function(e,t){return Object.keys(q).some(function(n){return e[n]!==t[n]})},H=function(e,t){var n=e.matches("input")?e:e.querySelector("input");if(!n)throw new Error("The directive must be applied on an element consists of an input element");var r=h({},q,t);if(null!=r.min&&null!=r.max&&r.min>r.max)throw new Error("Invalid number range");var o=m(r),i=J({inputElement:n,mask:[]});return n.$ci=h({},n.$ci||{},{options:r,currencyFormatConfig:o,textMaskInputElement:i}),n},Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w(e.value,e.$ci.currencyFormatConfig);null==t||e.$ci.currencyFormatConfig.allowDecimal||(t=Math.round(t)),ee(e,t),e.dispatchEvent(new Event("input")),e.dispatchEvent(new CustomEvent("change",{detail:{numberValue:e.$ci.numberValue,formattedValue:e.value}}))},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.value,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.$ci,r=n.options,o=n.currencyFormatConfig,i=n.textMaskInputElement,u=n.focus,a=u&&r.distractionFree;"number"===typeof t&&(null!=r.min&&t<r.min&&(t=r.min),null!=r.max&&t>r.max&&(t=r.max),t=new Intl.NumberFormat(r.locale,{minimumFractionDigits:a?0:o.decimalLimit}).format(t),r.distractionFree&&(t+=" ")),i.update(t,{inputElement:e,pipe:function(e,t){var n=t.previousConformedValue;if(r.validateOnInput){if(null!=r.min&&w(e,o)<r.min)return n;if(null!=r.max&&w(e,o)>r.max)return n}return e},mask:X(h({},o,{prefix:a?"":o.prefix,suffix:a?"":o.suffix,thousandsSeparatorSymbol:a?"":o.thousandsSeparatorSymbol,allowNegative:null===r.min&&null===r.max||r.min<0||r.max<0}))}),e.$ci.numberValue=w(e.value,o)},te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.$ci.currencyFormatConfig,n=t.prefix,r=t.thousandsSeparatorSymbol;return Math.max(0,e.selectionStart-n.length-(e.value.substring(0,e.selectionStart).match(new RegExp("."===r?"\\.":r,"g"))||[]).length)},ne={name:"CurrencyInput",directives:{currency:Y},props:{value:{type:Number,default:null},locale:{type:String,default:q.locale},currency:{type:String,required:!0},distractionFree:{type:Boolean,default:q.distractionFree},min:{type:Number,default:q.min},max:{type:Number,default:q.max},validateOnInput:{type:Boolean,default:q.validateOnInput}},data:function(){return{formattedValue:this.value}},watch:{value:function(e){this.$el.$ci.focus||this.$el.dispatchEvent(new CustomEvent("input",{detail:{value:e}}))}},methods:{handleChange:function(e){var t=e.detail;t&&(this.$emit("input",t.numberValue),this.formattedValue=t.formattedValue)}}},re=ne;function oe(e,t,n,r,o,i,u,a){var c,f="function"===typeof e?e.options:e;if(t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),u?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(u)},f._ssrRegister=c):o&&(c=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(f.functional){f._injectStyles=c;var l=f.render;f.render=function(e,t){return c.call(t),l(e,t)}}else{var s=f.beforeCreate;f.beforeCreate=s?[].concat(s,c):[c]}return{exports:e,options:f}}var ie=oe(re,o,i,!1,null,null,null),ue=ie.exports,ae={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.componentName,r=void 0===n?ue.name:n,o=t.directiveName,i=void 0===o?"currency":o;e.component(r,ue),e.directive(i,Y)}},ce=ae;"undefined"!==typeof window&&window.Vue&&window.Vue.use(ae),n.d(t,"CurrencyInput",function(){return ue}),n.d(t,"CurrencyDirective",function(){return Y});t["default"]=ce},fde4:function(e,t,n){n("bf90");var r=n("584a").Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}}})}); |
{ | ||
"name": "vue-currency-input", | ||
"description": "Easy input of currency formatted numbers for Vue.js.", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "unpkg": "dist/vue-currency-input.umd.min.js", |
@@ -95,2 +95,6 @@ import getCurrencyFormatConfig from './utils/currencyFormatConfig' | ||
value = new Intl.NumberFormat(options.locale, { minimumFractionDigits: hideFormatting ? 0 : currencyFormatConfig.decimalLimit }).format(value) | ||
if (options.distractionFree) { | ||
// force invalidation of text mask's previousConformedValue | ||
value += ' ' | ||
} | ||
} | ||
@@ -97,0 +101,0 @@ textMaskInputElement.update(value, { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
227893
4622
13