@vue-stripe/vue-stripe 4.2.8 → 4.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ # Request for contributions
2
+
3
+ Please contribute to this repository if any of the following is true:
4
+ - You have expertise in community development, communication, or education
5
+ - You want open source communities to be more collaborative and inclusive
6
+ - You want to help lower the burden to first time contributors
7
+
8
+ # How to contribute
9
+
10
+ Prerequisites:
11
+
12
+ - Familiarity with [pull requests](https://help.github.com/articles/using-pull-requests) and [issues](https://guides.github.com/features/issues/).
13
+ - Knowledge of [Markdown](https://help.github.com/articles/markdown-basics/) for editing `.md` documents.
14
+
15
+ In particular, this community seeks the following types of contributions:
16
+
17
+ - **Ideas**: participate in an issue thread or start your own to have your voice
18
+ heard.
19
+ - **Resources**: submit a pull request to add to RESOURCES.md with links to related content.
20
+ - **Outline sections**: help us ensure that this repository is comprehensive. if
21
+ there is a topic that is overlooked, please add it, even if it is just a stub
22
+ in the form of a header and single sentence. Initially, most things fall into
23
+ this category.
24
+ - **Writing**: contribute your expertise in an area by helping us expand the included
25
+ content.
26
+ - **Copy editing**: fix typos, clarify language, and generally improve the quality
27
+ of the content.
28
+ - **Formatting**: help keep content easy to read with consistent formatting.
29
+
30
+ # Conduct
31
+
32
+ We are committed to providing a friendly, safe and welcoming environment for
33
+ all, regardless of gender, sexual orientation, disability, ethnicity, religion,
34
+ or similar personal characteristic.
35
+
36
+ On IRC, please avoid using overtly sexual nicknames or other nicknames that
37
+ might detract from a friendly, safe and welcoming environment for all.
38
+
39
+ Please be kind and courteous. There's no need to be mean or rude.
40
+ Respect that people have differences of opinion and that every design or
41
+ implementation choice carries a trade-off and numerous costs. There is seldom
42
+ a right answer, merely an optimal answer given a set of values and
43
+ circumstances.
44
+
45
+ Please keep unstructured critique to a minimum. If you have solid ideas you
46
+ want to experiment with, make a fork and see how it works.
47
+
48
+ We will exclude you from interaction if you insult, demean or harass anyone.
49
+ That is not welcome behaviour. We interpret the term "harassment" as
50
+ including the definition in the
51
+ [Citizen Code of Conduct](http://citizencodeofconduct.org/);
52
+ if you have any lack of clarity about what might be included in that concept,
53
+ please read their definition. In particular, we don't tolerate behavior that
54
+ excludes people in socially marginalized groups.
55
+
56
+ Private harassment is also unacceptable. No matter who you are, if you feel
57
+ you have been or are being harassed or made uncomfortable by a community
58
+ member, please contact one of the channel ops or any of the
59
+ [CONTRIBUTING.md](https://github.com/jden/CONTRIBUTING.md) core team
60
+ immediately. Whether you're a regular contributor or a newcomer, we care about
61
+ making this community a safe place for you and we've got your back.
62
+
63
+ Likewise any spamming, trolling, flaming, baiting or other attention-stealing
64
+ behaviour is not welcome.
65
+
66
+ # Communication
67
+
68
+ There is an IRC channel on irc.freenode.net, channel `#CONTRIBUTING.md`. You're
69
+ welcome to drop in and ask questions, discuss bugs and such. The channel is
70
+ not currently logged.
71
+
72
+ GitHub issues are the primary way for communicating about specific proposed
73
+ changes to this project.
74
+
75
+ In both contexts, please follow the conduct guidelines above. Language issues
76
+ are often contentious and we'd like to keep discussion brief, civil and focused
77
+ on what we're actually doing, not wandering off into too much imaginary stuff.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ # [Important Notice!](https://github.com/vue-stripe/vue-stripe/discussions/261)
2
+
1
3
  <p align="center">
2
4
  <img src="./vue-stripe-logo-variant-1.png" alt="drawing" width="250"/>
3
5
  <h1 align="center">Vue Stripe 💳</h1>
@@ -14,9 +16,10 @@ You can support this project by giving it a star, or following the author. You c
14
16
  ## Documentation
15
17
 
16
18
  - [Website (https://vuestripe.com)](https://vuestripe.com)
17
- - [Stripe Checkout](https://vuestripe.com/stripe-checkout/getting-started)
18
- - [Stripe Elements](https://vuestripe.com/stripe-elements/getting-started)
19
- - [Stripe Plugin](https://vuestripe.com/stripe-plugin/getting-started)
19
+ - [Documentation](https://docs.vuestripe.com/vue-stripe/)
20
+ - [Stripe Checkout](https://docs.vuestripe.com/vue-stripe/stripe-checkout)
21
+ - [Stripe Elements](https://docs.vuestripe.com/vue-stripe/stripe-elements)
22
+ - [Stripe Plugin](https://docs.vuestripe.com/vue-stripe/vue-stripe-plugin)
20
23
 
21
24
  ## Contributors
22
25
 
@@ -55,4 +58,8 @@ Support this project with your organization. Your logo will show up here with a
55
58
  [<img src="https://i.imgur.com/x0SERyj.png" width="200px">](https://mycure.md)
56
59
  [<img src="https://i.imgur.com/4jF5M4A.png">](http://myteamops.com)
57
60
 
61
+ **Vue Stripe is now powered by GitBook**
62
+
63
+ [<img src="https://guanqr.com/images/gitbook-logo.png" width="300px"/>](https://gitbook.com)
64
+
58
65
  Made with :heart: by [Joff Tiquez](https://twitter.com/jrtiquez)
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var DEFAULT_LOCALE="auto",SUPPORTED_LOCALES=["auto","bg","cs","da","de","el","en","en-GB","es","es-419","et","fi","fr","fr-CA","hu","id","it","ja","lt","lv","ms","mt","nb","nl","pl","pt","pt-BR","ro","ru","sk","sl","sv","tr","zh","zh-HK","zh-TW"],SUPPORTED_SUBMIT_TYPES=["auto","book","donate","pay"],BILLING_ADDRESS_COLLECTION_TYPES=["required","auto"],DEFAULT_ELEMENT_STYLE={base:{color:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},VUE_STRIPE_VERSION=require("../package.json").version,STRIPE_PARTNER_DETAILS={name:"vue-stripe",version:VUE_STRIPE_VERSION,url:process.env.VUE_STRIPE_WEBSITE,partner_id:process.env.VUE_STRIPE_PARTNER_ID},INSECURE_HOST_ERROR_MESSAGE="Vue Stripe will not work on an insecure host. Make sure that your site is using TCP/SSL.",isSecureHost=function(){return"localhost"===window.location.hostname||"https:"===window.location.protocol},index={install:function(e,t){isSecureHost()||console.warn(INSECURE_HOST_ERROR_MESSAGE);var n=t.pk,r=t.stripeAccount,o=t.apiVersion,i=t.locale,s=window.Stripe(n,{stripeAccount:r,apiVersion:o,locale:i});s.registerAppInfo(STRIPE_PARTNER_DETAILS),e.prototype.$stripe=s}};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var runtime_1=createCommonjsModule((function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function l(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),s=new x(r||[]);return i._invoke=function(e,t,n){var r=u;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var a=w(s,n);if(a){if(a===m)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===u)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var l=c(e,t,n);if("normal"===l.type){if(r=n.done?h:d,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=h,n.method="throw",n.arg=l.arg)}}}(e,n,s),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u="suspendedStart",d="suspendedYield",p="executing",h="completed",m={};function f(){}function y(){}function E(){}var v={};v[i]=function(){return this};var S=Object.getPrototypeOf,_=S&&S(S(R([])));_&&_!==n&&r.call(_,i)&&(v=_);var g=E.prototype=f.prototype=Object.create(v);function A(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function b(e){var t;this._invoke=function(n,o){function i(){return new Promise((function(t,i){!function t(n,o,i,s){var a=c(e[n],e,o);if("throw"!==a.type){var l=a.arg,u=l.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,i,s)}),(function(e){t("throw",e,i,s)})):Promise.resolve(u).then((function(e){l.value=e,i(l)}),(function(e){return t("throw",e,i,s)}))}s(a.arg)}(n,o,t,i)}))}return t=t?t.then(i,i):i()}}function w(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,w(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=c(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,s=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}return{next:L}}function L(){return{value:t,done:!0}}return y.prototype=g.constructor=E,E.constructor=y,E[a]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},A(b.prototype),b.prototype[s]=function(){return this},e.AsyncIterator=b,e.async=function(t,n,r,o){var i=new b(l(t,n,r,o));return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(g),g[a]="Generator",g[i]=function(){return this},g.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=R,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}})),regenerator=runtime_1;function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var loadParams,V3_URL="https://js.stripe.com/v3",V3_URL_REGEX=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,EXISTING_SCRIPT_MESSAGE="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",findScript=function(){for(var e=document.querySelectorAll('script[src^="'.concat(V3_URL,'"]')),t=0;t<e.length;t++){var n=e[t];if(V3_URL_REGEX.test(n.src))return n}return null},injectScript=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(V3_URL).concat(t);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(n),n},registerWrapper=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.13.2",startTime:t})},stripePromise=null,loadScript=function(e){return null!==stripePromise?stripePromise:stripePromise=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(EXISTING_SCRIPT_MESSAGE),window.Stripe)t(window.Stripe);else try{var r=findScript();r&&e?console.warn(EXISTING_SCRIPT_MESSAGE):r||(r=injectScript(e)),r.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),r.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}))},initStripe=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return registerWrapper(r,n),r},validateLoadParams=function(e){var t="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==_typeof(e))throw new Error(t);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw new Error(t)},loadStripeCalled=!1,loadStripe=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];loadStripeCalled=!0;var r=Date.now();return loadScript(loadParams).then((function(e){return initStripe(e,t,r)}))};loadStripe.setLoadParameters=function(e){if(loadStripeCalled)throw new Error("You cannot change load parameters after calling loadStripe");loadParams=validateLoadParams(e)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var DEFAULT_LOCALE="auto",SUPPORTED_LOCALES=["auto","bg","cs","da","de","el","en","en-GB","es","es-419","et","fi","fr","fr-CA","hu","id","it","ja","lt","lv","ms","mt","nb","nl","pl","pt","pt-BR","ro","ru","sk","sl","sv","tr","zh","zh-HK","zh-TW"],SUPPORTED_SUBMIT_TYPES=["auto","book","donate","pay"],BILLING_ADDRESS_COLLECTION_TYPES=["required","auto"],DEFAULT_ELEMENT_STYLE={base:{color:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},VUE_STRIPE_VERSION=require("../package.json").version,STRIPE_PARTNER_DETAILS={name:"vue-stripe",version:VUE_STRIPE_VERSION,url:"https://vuestripe.com",partner_id:"pp_partner_IqtOXpBSuz0IE2"},INSECURE_HOST_ERROR_MESSAGE="Vue Stripe will not work on an insecure host. Make sure that your site is using TCP/SSL.",isSecureHost=function(){return"localhost"===window.location.hostname||"https:"===window.location.protocol},index={install:function(e,n){isSecureHost()||console.warn(INSECURE_HOST_ERROR_MESSAGE);var t=n.pk,r=n.stripeAccount,i=n.apiVersion,o=n.locale,s=window.Stripe(t,{stripeAccount:r,apiVersion:i,locale:o});s.registerAppInfo(STRIPE_PARTNER_DETAILS),e.prototype.$stripe=s}};function createCommonjsModule(e,n){return e(n={exports:{}},n.exports),n.exports}var runtime_1=createCommonjsModule((function(e){var n=function(e){var n,t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function l(e,n,t,r){var i=n&&n.prototype instanceof f?n:f,o=Object.create(i.prototype),s=new P(r||[]);return o._invoke=function(e,n,t){var r=u;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===m){if("throw"===i)throw o;return O()}for(t.method=i,t.arg=o;;){var s=t.delegate;if(s){var a=w(s,t);if(a){if(a===h)continue;return a}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(r===u)throw r=m,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);r=d;var l=c(e,n,t);if("normal"===l.type){if(r=t.done?m:p,l.arg===h)continue;return{value:l.arg,done:t.done}}"throw"===l.type&&(r=m,t.method="throw",t.arg=l.arg)}}}(e,t,s),o}function c(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u="suspendedStart",p="suspendedYield",d="executing",m="completed",h={};function f(){}function y(){}function v(){}var E={};E[o]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(R([])));_&&_!==t&&r.call(_,o)&&(E=_);var S=v.prototype=f.prototype=Object.create(E);function b(e){["next","throw","return"].forEach((function(n){e[n]=function(e){return this._invoke(n,e)}}))}function A(e){var n;this._invoke=function(t,i){function o(){return new Promise((function(n,o){!function n(t,i,o,s){var a=c(e[t],e,i);if("throw"!==a.type){var l=a.arg,u=l.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):Promise.resolve(u).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(a.arg)}(t,i,n,o)}))}return n=n?n.then(o,o):o()}}function w(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,w(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function C(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function T(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function R(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=n,t.done=!0,t};return s.next=s}}return{next:O}}function O(){return{value:n,done:!0}}return y.prototype=S.constructor=v,v.constructor=y,v[a]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===y||"GeneratorFunction"===(n.displayName||n.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(S),e},e.awrap=function(e){return{__await:e}},b(A.prototype),A.prototype[s]=function(){return this},e.AsyncIterator=A,e.async=function(n,t,r,i){var o=new A(l(n,t,r,i));return e.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(S),S[a]="Generator",S[o]=function(){return this},S.toString=function(){return"[object Generator]"},e.keys=function(e){var n=[];for(var t in e)n.push(t);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=R,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=n,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),h},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),T(t),h}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var i=r.arg;T(t)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:R(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),h}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}})),regenerator=runtime_1;function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var loadParams,V3_URL="https://js.stripe.com/v3",V3_URL_REGEX=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,EXISTING_SCRIPT_MESSAGE="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",findScript=function(){for(var e=document.querySelectorAll('script[src^="'.concat(V3_URL,'"]')),n=0;n<e.length;n++){var t=e[n];if(V3_URL_REGEX.test(t.src))return t}return null},injectScript=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(V3_URL).concat(n);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(t),t},registerWrapper=function(e,n){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.13.2",startTime:n})},stripePromise=null,loadScript=function(e){return null!==stripePromise?stripePromise:stripePromise=new Promise((function(n,t){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(EXISTING_SCRIPT_MESSAGE),window.Stripe)n(window.Stripe);else try{var r=findScript();r&&e?console.warn(EXISTING_SCRIPT_MESSAGE):r||(r=injectScript(e)),r.addEventListener("load",(function(){window.Stripe?n(window.Stripe):t(new Error("Stripe.js not available"))})),r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else n(null)}))},initStripe=function(e,n,t){if(null===e)return null;var r=e.apply(void 0,n);return registerWrapper(r,t),r},validateLoadParams=function(e){var n="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==_typeof(e))throw new Error(n);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw new Error(n)},loadStripeCalled=!1,loadStripe=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];loadStripeCalled=!0;var r=Date.now();return loadScript(loadParams).then((function(e){return initStripe(e,n,r)}))};loadStripe.setLoadParameters=function(e){if(loadStripeCalled)throw new Error("You cannot change load parameters after calling loadStripe");loadParams=validateLoadParams(e)};
2
2
  /**
3
3
  * vue-coerce-props v1.0.0
4
4
  * (c) 2018 Eduardo San Martin Morote <posva13@gmail.com>
5
5
  * @license MIT
6
6
  */
7
- var index$1={beforeCreate:function(){var e=this.$options.props;e&&(this._$coertions=Object.keys(e).filter((function(t){return e[t].coerce})).map((function(t){return[t,e[t].coerce]})))},computed:{$coerced:function(){var e=this;return this._$coertions.reduce((function(t,n){var r=n[0],o=n[1];return t[r]=o.call(e,e.$props[r]),t}),{})}}},props={pk:{type:String,required:!0},mode:{type:String,validator:function(e){return["payment","subscription"].includes(e)}},lineItems:{type:Array,default:void 0},items:{type:Array},successUrl:{type:String,default:window.location.href},cancelUrl:{type:String,default:window.location.href},submitType:{type:String,validator:function(e){return SUPPORTED_SUBMIT_TYPES.includes(e)}},billingAddressCollection:{type:String,default:"auto",validator:function(e){return BILLING_ADDRESS_COLLECTION_TYPES.includes(e)}},clientReferenceId:{type:String},customerEmail:{type:String},sessionId:{type:String},locale:{type:String,default:DEFAULT_LOCALE,coerce:function(e){return SUPPORTED_LOCALES.includes(e)?e:(console.warn("VueStripe Warning: '".concat(e,"' is not supported by Stripe yet. Falling back to default '").concat(DEFAULT_LOCALE,"'.")),DEFAULT_LOCALE)}},shippingAddressCollection:{type:Object,validator:function(e){return Object.prototype.hasOwnProperty.call(e,"allowedCountries")}},disableAdvancedFraudDetection:{type:Boolean}},index$2={props:props,mixins:[index$1],render:function(e){return e},mounted:function(){isSecureHost()||console.warn(INSECURE_HOST_ERROR_MESSAGE)},methods:{redirectToCheckout:function(){var e,t;return regenerator.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,isSecureHost()){n.next=3;break}throw Error(INSECURE_HOST_ERROR_MESSAGE);case 3:return this.$emit("loading",!0),this.disableAdvancedFraudDetection&&loadStripe.setLoadParameters({advancedFraudSignals:!1}),n.next=7,regenerator.awrap(loadStripe(this.pk));case 7:if((e=n.sent).registerAppInfo(STRIPE_PARTNER_DETAILS),!this.sessionId){n.next=12;break}return e.redirectToCheckout({sessionId:this.sessionId}),n.abrupt("return");case 12:if(!this.lineItems||!this.lineItems.length||this.mode){n.next=15;break}return console.error("Error: Property 'mode' is required when using 'lineItems'. See https://stripe.com/docs/js/checkout/redirect_to_checkout#stripe_checkout_redirect_to_checkout-options-mode"),n.abrupt("return");case 15:t={billingAddressCollection:this.billingAddressCollection,cancelUrl:this.cancelUrl,clientReferenceId:this.clientReferenceId,customerEmail:this.customerEmail,items:this.items,lineItems:this.lineItems,locale:this.$coerced.locale,mode:this.mode,shippingAddressCollection:this.shippingAddressCollection,submitType:this.submitType,successUrl:this.successUrl},e.redirectToCheckout(t),n.next=23;break;case 19:n.prev=19,n.t0=n.catch(0),console.error(n.t0),this.$emit("error",n.t0);case 23:case"end":return n.stop()}}),null,this,[[0,19]])}}};function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var defineProperty=_defineProperty;function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ELEMENT_TYPE="card",script={props:{pk:{type:String,required:!0},stripeAccount:{type:String,default:void 0},apiVersion:{type:String,default:void 0},locale:{type:String,default:"auto"},elementsOptions:{type:Object,default:function(){return{}}},tokenData:{type:Object,default:function(){return{}}},disableAdvancedFraudDetection:{type:Boolean},classes:{type:Object,default:function(){return{}}},elementStyle:{type:Object,default:function(){return DEFAULT_ELEMENT_STYLE}},value:{type:String,default:void 0},hidePostalCode:Boolean,iconStyle:{type:String,default:"default",validator:function(e){return["solid","default"].includes(e)}},hideIcon:Boolean,disabled:Boolean},data:function(){return{loading:!1,stripe:null,elements:null,element:null,card:null}},computed:{form:function(){return document.getElementById("stripe-element-form")}},mounted:function(){var e,t,n=this;return regenerator.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(isSecureHost()){r.next=3;break}return document.getElementById("stripe-element-mount-point").innerHTML='<p style="color: red">'.concat(INSECURE_HOST_ERROR_MESSAGE,"</p>"),r.abrupt("return");case 3:return this.disableAdvancedFraudDetection&&loadStripe.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},t={classes:this.classes,style:this.elementStyle,value:this.value,hidePostalCode:this.hidePostalCode,iconStyle:this.iconStyle,hideIcon:this.hideIcon,disabled:this.disabled},r.next=8,regenerator.awrap(loadStripe(this.pk,e));case 8:this.stripe=r.sent,this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS),this.elements=this.stripe.elements(this.elementsOptions),this.element=this.elements.create(ELEMENT_TYPE,t),this.element.mount("#stripe-element-mount-point"),this.element.on("change",(function(e){var t=document.getElementById("stripe-element-errors");e.error?t.textContent=e.error.message:t.textContent="",n.onChange(e)})),this.element.on("blur",this.onBlur),this.element.on("click",this.onClick),this.element.on("escape",this.onEscape),this.element.on("focus",this.onFocus),this.element.on("ready",this.onReady),this.form.addEventListener("submit",(function(e){var t,r,o,i;return regenerator.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,n.$emit("loading",!0),e.preventDefault(),t=_objectSpread({},n.element),n.amount&&(t.amount=n.amount),s.next=7,regenerator.awrap(n.stripe.createToken(t,n.tokenData));case 7:if(r=s.sent,o=r.token,!(i=r.error)){s.next=15;break}return document.getElementById("stripe-element-errors").textContent=i.message,n.$emit("error",i),s.abrupt("return");case 15:n.$emit("token",o),s.next=22;break;case 18:s.prev=18,s.t0=s.catch(0),console.error(s.t0),n.$emit("error",s.t0);case 22:return s.prev=22,n.$emit("loading",!1),s.finish(22);case 25:case"end":return s.stop()}}),null,null,[[0,18,22,25]])}));case 20:case"end":return r.stop()}}),null,this)},methods:{submit:function(){this.$refs.submitButtonRef.click()},clear:function(){this.element.clear()},destroy:function(){this.element.destroy()},focus:function(){console.warn("This method will currently not work on iOS 13+ due to a system limitation."),this.element.focus()},unmount:function(){this.element.unmount()},update:function(e){this.element.update(e)},onChange:function(e){this.$emit("element-change",e)},onReady:function(e){this.$emit("element-ready",e)},onFocus:function(e){this.$emit("element-focus",e)},onBlur:function(e){this.$emit("element-blur",e)},onEscape:function(e){this.$emit("element-escape",e)},onClick:function(e){this.$emit("element-click",e)}}};function normalizeComponent(e,t,n,r,o,i,s,a,l,c){"boolean"!=typeof s&&(l=a,a=s,s=!1);const u="function"==typeof n?n.options:n;let d;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,o&&(u.functional=!0)),r&&(u._scopeId=r),i?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=d):t&&(d=s?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),d)if(u.functional){const e=u.render;u.render=function(t,n){return d.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,d):[d]}return n}const isOldIE="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function createInjector(e){return(e,t)=>addStyle(e,t)}let HEAD;const styles={};function addStyle(e,t){const n=isOldIE?t.media||"default":e,r=styles[n]||(styles[n]={ids:new Set,styles:[]});if(!r.ids.has(e)){r.ids.add(e);let n=t.source;if(t.map&&(n+="\n/*# sourceURL="+t.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",t.media&&r.element.setAttribute("media",t.media),void 0===HEAD&&(HEAD=document.head||document.getElementsByTagName("head")[0]),HEAD.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(n),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{const e=r.ids.size-1,t=document.createTextNode(n),o=r.element.childNodes;o[e]&&r.element.removeChild(o[e]),o.length?r.element.insertBefore(t,o[e]):r.element.appendChild(t)}}}const __vue_script__=script;var __vue_render__=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("form",{attrs:{id:"stripe-element-form"}},[t("div",{attrs:{id:"stripe-element-mount-point"}}),this._v(" "),this._t("stripe-element-errors",[t("div",{attrs:{id:"stripe-element-errors",role:"alert"}})]),this._v(" "),t("button",{ref:"submitButtonRef",staticClass:"hide",attrs:{type:"submit"}})],2)])},__vue_staticRenderFns__=[];__vue_render__._withStripped=!0;const __vue_inject_styles__=function(e){e&&e("data-v-e001dcc2_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.StripeElement[data-v-e001dcc2] {\n box-sizing: border-box;\n\n height: 40px;\n\n padding: 10px 12px;\n\n border: 1px solid transparent;\n border-radius: 4px;\n background-color: white;\n\n box-shadow: 0 1px 3px 0 #e6ebf1;\n -webkit-transition: box-shadow 150ms ease;\n transition: box-shadow 150ms ease;\n}\n.StripeElement--focus[data-v-e001dcc2] {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n.StripeElement--invalid[data-v-e001dcc2] {\n border-color: #fa755a;\n}\n.StripeElement--webkit-autofill[data-v-e001dcc2] {\n background-color: #fefde5 !important;\n}\n.hide[data-v-e001dcc2] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Card.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiPA;;;EAGA;AACA;EACA,sBAAA;;EAEA,YAAA;;EAEA,kBAAA;;EAEA,6BAAA;EACA,kBAAA;EACA,uBAAA;;EAEA,+BAAA;EACA,yCAAA;EACA,iCAAA;AACA;AAEA;EACA,+BAAA;AACA;AAEA;EACA,qBAAA;AACA;AAEA;EACA,oCAAA;AACA;AAEA;EACA,aAAA;AACA",file:"Card.vue",sourcesContent:["<template>\n <div>\n <form id=\"stripe-element-form\">\n <div id=\"stripe-element-mount-point\" />\n <slot name=\"stripe-element-errors\">\n <div\n id=\"stripe-element-errors\"\n role=\"alert\"\n />\n </slot>\n <button\n ref=\"submitButtonRef\"\n type=\"submit\"\n class=\"hide\"\n />\n </form>\n </div>\n</template>\n\n<script>\nimport { loadStripe } from '@stripe/stripe-js/dist/pure.esm.js';\nimport { isSecureHost } from '../utils';\nimport {\n DEFAULT_ELEMENT_STYLE,\n STRIPE_PARTNER_DETAILS,\n INSECURE_HOST_ERROR_MESSAGE,\n} from '../constants';\nconst ELEMENT_TYPE = 'card';\nexport default {\n props: {\n pk: {\n type: String,\n required: true,\n },\n stripeAccount: {\n type: String,\n default: undefined,\n },\n apiVersion: {\n type: String,\n default: undefined,\n },\n locale: {\n type: String,\n default: 'auto',\n },\n elementsOptions: {\n type: Object,\n default: () => ({}),\n },\n tokenData: {\n type: Object,\n default: () => ({}),\n },\n disableAdvancedFraudDetection: {\n type: Boolean,\n },\n // element specific options\n classes: {\n type: Object,\n default: () => ({}),\n },\n elementStyle: {\n type: Object,\n default: () => (DEFAULT_ELEMENT_STYLE),\n },\n value: {\n type: String,\n default: undefined,\n },\n hidePostalCode: Boolean,\n iconStyle: {\n type: String,\n default: 'default',\n validator: value => ['solid', 'default'].includes(value),\n },\n hideIcon: Boolean,\n disabled: Boolean,\n },\n data () {\n return {\n loading: false,\n stripe: null,\n elements: null,\n element: null,\n card: null,\n };\n },\n computed: {\n form () {\n return document.getElementById('stripe-element-form');\n },\n },\n async mounted () {\n if (!isSecureHost()) {\n document.getElementById('stripe-element-mount-point').innerHTML = `<p style=\"color: red\">${INSECURE_HOST_ERROR_MESSAGE}</p>`;\n return;\n }\n\n if (this.disableAdvancedFraudDetection) loadStripe.setLoadParameters({ advancedFraudSignals: false });\n\n const stripeOptions = {\n stripeAccount: this.stripeAccount,\n apiVersion: this.apiVersion,\n locale: this.locale,\n };\n const createOptions = {\n classes: this.classes,\n style: this.elementStyle,\n value: this.value,\n hidePostalCode: this.hidePostalCode,\n iconStyle: this.iconStyle,\n hideIcon: this.hideIcon,\n disabled: this.disabled,\n };\n\n this.stripe = await loadStripe(this.pk, stripeOptions);\n this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS);\n this.elements = this.stripe.elements(this.elementsOptions);\n this.element = this.elements.create(ELEMENT_TYPE, createOptions);\n this.element.mount('#stripe-element-mount-point');\n\n this.element.on('change', (event) => {\n var displayError = document.getElementById('stripe-element-errors');\n if (event.error) {\n displayError.textContent = event.error.message;\n } else {\n displayError.textContent = '';\n }\n this.onChange(event);\n });\n\n this.element.on('blur', this.onBlur);\n this.element.on('click', this.onClick);\n this.element.on('escape', this.onEscape);\n this.element.on('focus', this.onFocus);\n this.element.on('ready', this.onReady);\n\n this.form.addEventListener('submit', async (event) => {\n try {\n this.$emit('loading', true);\n event.preventDefault();\n const data = {\n ...this.element,\n };\n if (this.amount) data.amount = this.amount;\n const { token, error } = await this.stripe.createToken(data, this.tokenData);\n if (error) {\n const errorElement = document.getElementById('stripe-element-errors');\n errorElement.textContent = error.message;\n this.$emit('error', error);\n return;\n }\n this.$emit('token', token);\n } catch (error) {\n console.error(error);\n this.$emit('error', error);\n } finally {\n this.$emit('loading', false);\n }\n });\n },\n methods: {\n /**\n * Triggers the submission of the form\n * @return {void}\n */\n submit () {\n this.$refs.submitButtonRef.click();\n },\n /**\n * Clears the element\n * @return {void}\n */\n clear () {\n this.element.clear();\n },\n /**\n * Destroys the element\n * @return {void}\n */\n destroy () {\n this.element.destroy();\n },\n /**\n * Focuses on the element\n * @return {void}\n */\n focus () {\n console.warn('This method will currently not work on iOS 13+ due to a system limitation.');\n this.element.focus();\n },\n /**\n * Unmounts the element\n * @return {void}\n */\n unmount () {\n this.element.unmount();\n },\n /**\n * Updates the element\n * @param {string} opts.classes.base The base class applied to the container. Defaults to StripeElement.\n * @param {string} opts.classes.complete The class name to apply when the Element is complete. Defaults to StripeElement--complete.\n * @param {string} opts.classes.empty The class name to apply when the Element is empty. Defaults to StripeElement--empty.\n * @param {string} opts.classes.focus The class name to apply when the Element is focused. Defaults to StripeElement--focus.\n * @param {string} opts.classes.invalid The class name to apply when the Element is invalid. Defaults to StripeElement--invalid.\n * @param {string} opts.classes.webkitAutoFill The class name to apply when the Element has its value autofilled by the browser (only on Chrome and Safari). Defaults to StripeElement--webkit-autofill.\n * @param {Object} opts.style Customize the appearance of this element using CSS properties passed in a Style object.\n * @param {string} opts.value A pre-filled set of values to include in the input (e.g., {postalCode: '94110'}). Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled\n * @param {boolean} opts.hidePostalCode Hide the postal code field. Default is false. If you are already collecting a full billing address or postal code elsewhere, set this to true.\n * @param {string} opts.iconStyle Appearance of the icon in the Element. Either solid or default.\n * @param {boolean} opts.hideIcon Hides the icon in the Element. Default is false.\n * @param {boolean} opts.disabled Applies a disabled state to the Element such that user input is not accepted. Default is false.\n */\n update (opts) {\n this.element.update(opts);\n },\n // events\n onChange (e) {\n this.$emit('element-change', e);\n },\n onReady (e) {\n this.$emit('element-ready', e);\n },\n onFocus (e) {\n this.$emit('element-focus', e);\n },\n onBlur (e) {\n this.$emit('element-blur', e);\n },\n onEscape (e) {\n this.$emit('element-escape', e);\n },\n onClick (e) {\n this.$emit('element-click', e);\n },\n },\n};\n<\/script>\n\n<style scoped>\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.StripeElement {\n box-sizing: border-box;\n\n height: 40px;\n\n padding: 10px 12px;\n\n border: 1px solid transparent;\n border-radius: 4px;\n background-color: white;\n\n box-shadow: 0 1px 3px 0 #e6ebf1;\n -webkit-transition: box-shadow 150ms ease;\n transition: box-shadow 150ms ease;\n}\n\n.StripeElement--focus {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n\n.StripeElement--invalid {\n border-color: #fa755a;\n}\n\n.StripeElement--webkit-autofill {\n background-color: #fefde5 !important;\n}\n\n.hide {\n display: none;\n}\n</style>\n"]},media:void 0})},__vue_scope_id__="data-v-e001dcc2",__vue_module_identifier__=void 0,__vue_is_functional_template__=!1,__vue_component__=normalizeComponent({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,!1,void 0,!1,createInjector,void 0,void 0);var index$3={install:function(e,t){var n,r,o,i,s,a,l;return regenerator.async((function(c){for(;;)switch(c.prev=c.next){case 0:n=t.pk,r=t.stripeAccount,o=t.apiVersion,i=t.locale,s=t.elementsOptions,(a=window.Stripe(n,{stripeAccount:r,apiVersion:o,locale:i})).registerAppInfo(STRIPE_PARTNER_DETAILS),l=a.elements(s),e.prototype.$stripe=a,e.prototype.$stripeElements=l;case 6:case"end":return c.stop()}}))}};exports.StripeCheckout=index$2,exports.StripeElementCard=__vue_component__,exports.StripeElementsPlugin=index$3,exports.StripePlugin=index;
7
+ var index$1={beforeCreate:function(){var e=this.$options.props;e&&(this._$coertions=Object.keys(e).filter((function(n){return e[n].coerce})).map((function(n){return[n,e[n].coerce]})))},computed:{$coerced:function(){var e=this;return this._$coertions.reduce((function(n,t){var r=t[0],i=t[1];return n[r]=i.call(e,e.$props[r]),n}),{})}}},props={pk:{type:String,required:!0},mode:{type:String,validator:function(e){return["payment","subscription"].includes(e)}},lineItems:{type:Array,default:void 0},items:{type:Array},successUrl:{type:String,default:window.location.href},cancelUrl:{type:String,default:window.location.href},submitType:{type:String,validator:function(e){return SUPPORTED_SUBMIT_TYPES.includes(e)}},billingAddressCollection:{type:String,default:"auto",validator:function(e){return BILLING_ADDRESS_COLLECTION_TYPES.includes(e)}},clientReferenceId:{type:String},customerEmail:{type:String},sessionId:{type:String},locale:{type:String,default:DEFAULT_LOCALE,coerce:function(e){return SUPPORTED_LOCALES.includes(e)?e:(console.warn("VueStripe Warning: '".concat(e,"' is not supported by Stripe yet. Falling back to default '").concat(DEFAULT_LOCALE,"'.")),DEFAULT_LOCALE)}},shippingAddressCollection:{type:Object,validator:function(e){return Object.prototype.hasOwnProperty.call(e,"allowedCountries")}},disableAdvancedFraudDetection:{type:Boolean}},index$2={props:props,mixins:[index$1],render:function(e){return e},mounted:function(){isSecureHost()||console.warn(INSECURE_HOST_ERROR_MESSAGE)},methods:{redirectToCheckout:function(){var e,n;return regenerator.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,isSecureHost()){t.next=3;break}throw Error(INSECURE_HOST_ERROR_MESSAGE);case 3:return this.$emit("loading",!0),this.disableAdvancedFraudDetection&&loadStripe.setLoadParameters({advancedFraudSignals:!1}),t.next=7,regenerator.awrap(loadStripe(this.pk));case 7:if((e=t.sent).registerAppInfo(STRIPE_PARTNER_DETAILS),!this.sessionId){t.next=12;break}return e.redirectToCheckout({sessionId:this.sessionId}),t.abrupt("return");case 12:if(!this.lineItems||!this.lineItems.length||this.mode){t.next=15;break}return console.error("Error: Property 'mode' is required when using 'lineItems'. See https://stripe.com/docs/js/checkout/redirect_to_checkout#stripe_checkout_redirect_to_checkout-options-mode"),t.abrupt("return");case 15:return n={billingAddressCollection:this.billingAddressCollection,cancelUrl:this.cancelUrl,clientReferenceId:this.clientReferenceId,customerEmail:this.customerEmail,items:this.items,lineItems:this.lineItems,locale:this.$coerced.locale,mode:this.mode,shippingAddressCollection:this.shippingAddressCollection,submitType:this.submitType,successUrl:this.successUrl},t.abrupt("return",e.redirectToCheckout(n));case 19:t.prev=19,t.t0=t.catch(0),console.error(t.t0),this.$emit("error",t.t0);case 23:case"end":return t.stop()}}),null,this,[[0,19]])}}};function _defineProperty(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var defineProperty=_defineProperty;function ownKeys(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function _objectSpread(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ownKeys(Object(t),!0).forEach((function(n){defineProperty(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ELEMENT_TYPE="card",script={props:{pk:{type:String,required:!0},stripeAccount:{type:String,default:void 0},apiVersion:{type:String,default:void 0},locale:{type:String,default:"auto"},elementsOptions:{type:Object,default:function(){return{}}},tokenData:{type:Object,default:function(){return{}}},disableAdvancedFraudDetection:{type:Boolean},classes:{type:Object,default:function(){return{}}},elementStyle:{type:Object,default:function(){return DEFAULT_ELEMENT_STYLE}},value:{type:String,default:void 0},hidePostalCode:Boolean,iconStyle:{type:String,default:"default",validator:function(e){return["solid","default"].includes(e)}},hideIcon:Boolean,disabled:Boolean},data:function(){return{loading:!1,stripe:null,elements:null,element:null,card:null}},computed:{form:function(){return document.getElementById("stripe-element-form")}},mounted:function(){var e,n,t=this;return regenerator.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(isSecureHost()){r.next=3;break}return document.getElementById("stripe-element-mount-point").innerHTML='<p style="color: red">'.concat(INSECURE_HOST_ERROR_MESSAGE,"</p>"),r.abrupt("return");case 3:return this.disableAdvancedFraudDetection&&loadStripe.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},n={classes:this.classes,style:this.elementStyle,value:this.value,hidePostalCode:this.hidePostalCode,iconStyle:this.iconStyle,hideIcon:this.hideIcon,disabled:this.disabled},r.next=8,regenerator.awrap(loadStripe(this.pk,e));case 8:this.stripe=r.sent,this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS),this.elements=this.stripe.elements(this.elementsOptions),this.element=this.elements.create(ELEMENT_TYPE,n),this.element.mount("#stripe-element-mount-point"),this.element.on("change",(function(e){var n=document.getElementById("stripe-element-errors");e.error?n.textContent=e.error.message:n.textContent="",t.onChange(e)})),this.element.on("blur",this.onBlur),this.element.on("click",this.onClick),this.element.on("escape",this.onEscape),this.element.on("focus",this.onFocus),this.element.on("ready",this.onReady),this.form.addEventListener("submit",(function(e){var n,r,i,o;return regenerator.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,t.$emit("loading",!0),e.preventDefault(),n=_objectSpread({},t.element),t.amount&&(n.amount=t.amount),s.next=7,regenerator.awrap(t.stripe.createToken(n,t.tokenData));case 7:if(r=s.sent,i=r.token,!(o=r.error)){s.next=15;break}return document.getElementById("stripe-element-errors").textContent=o.message,t.$emit("error",o),s.abrupt("return");case 15:t.$emit("token",i),s.next=22;break;case 18:s.prev=18,s.t0=s.catch(0),console.error(s.t0),t.$emit("error",s.t0);case 22:return s.prev=22,t.$emit("loading",!1),s.finish(22);case 25:case"end":return s.stop()}}),null,null,[[0,18,22,25]])}));case 20:case"end":return r.stop()}}),null,this)},methods:{submit:function(){this.$refs.submitButtonRef.click()},clear:function(){this.element.clear()},destroy:function(){this.element.destroy()},focus:function(){console.warn("This method will currently not work on iOS 13+ due to a system limitation."),this.element.focus()},unmount:function(){this.element.unmount()},update:function(e){this.element.update(e)},onChange:function(e){this.$emit("element-change",e)},onReady:function(e){this.$emit("element-ready",e)},onFocus:function(e){this.$emit("element-focus",e)},onBlur:function(e){this.$emit("element-blur",e)},onEscape:function(e){this.$emit("element-escape",e)},onClick:function(e){this.$emit("element-click",e)}}};function normalizeComponent(e,n,t,r,i,o,s,a,l,c){"boolean"!=typeof s&&(l=a,a=s,s=!1);const u="function"==typeof t?t.options:t;let p;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(p=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=p):n&&(p=s?function(e){n.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){n.call(this,a(e))}),p)if(u.functional){const e=u.render;u.render=function(n,t){return p.call(t),e(n,t)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,p):[p]}return t}const isOldIE="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function createInjector(e){return(e,n)=>addStyle(e,n)}let HEAD;const styles={};function addStyle(e,n){const t=isOldIE?n.media||"default":e,r=styles[t]||(styles[t]={ids:new Set,styles:[]});if(!r.ids.has(e)){r.ids.add(e);let t=n.source;if(n.map&&(t+="\n/*# sourceURL="+n.map.sources[0]+" */",t+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",n.media&&r.element.setAttribute("media",n.media),void 0===HEAD&&(HEAD=document.head||document.getElementsByTagName("head")[0]),HEAD.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(t),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{const e=r.ids.size-1,n=document.createTextNode(t),i=r.element.childNodes;i[e]&&r.element.removeChild(i[e]),i.length?r.element.insertBefore(n,i[e]):r.element.appendChild(n)}}}const __vue_script__=script;var __vue_render__=function(){var e=this.$createElement,n=this._self._c||e;return n("div",[n("form",{attrs:{id:"stripe-element-form"}},[n("div",{attrs:{id:"stripe-element-mount-point"}}),this._v(" "),this._t("stripe-element-errors",[n("div",{attrs:{id:"stripe-element-errors",role:"alert"}})]),this._v(" "),n("button",{ref:"submitButtonRef",staticClass:"hide",attrs:{type:"submit"}})],2)])},__vue_staticRenderFns__=[];__vue_render__._withStripped=!0;const __vue_inject_styles__=function(e){e&&e("data-v-e001dcc2_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.StripeElement[data-v-e001dcc2] {\n box-sizing: border-box;\n\n height: 40px;\n\n padding: 10px 12px;\n\n border: 1px solid transparent;\n border-radius: 4px;\n background-color: white;\n\n box-shadow: 0 1px 3px 0 #e6ebf1;\n -webkit-transition: box-shadow 150ms ease;\n transition: box-shadow 150ms ease;\n}\n.StripeElement--focus[data-v-e001dcc2] {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n.StripeElement--invalid[data-v-e001dcc2] {\n border-color: #fa755a;\n}\n.StripeElement--webkit-autofill[data-v-e001dcc2] {\n background-color: #fefde5 !important;\n}\n.hide[data-v-e001dcc2] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Card.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiPA;;;EAGA;AACA;EACA,sBAAA;;EAEA,YAAA;;EAEA,kBAAA;;EAEA,6BAAA;EACA,kBAAA;EACA,uBAAA;;EAEA,+BAAA;EACA,yCAAA;EACA,iCAAA;AACA;AAEA;EACA,+BAAA;AACA;AAEA;EACA,qBAAA;AACA;AAEA;EACA,oCAAA;AACA;AAEA;EACA,aAAA;AACA",file:"Card.vue",sourcesContent:["<template>\n <div>\n <form id=\"stripe-element-form\">\n <div id=\"stripe-element-mount-point\" />\n <slot name=\"stripe-element-errors\">\n <div\n id=\"stripe-element-errors\"\n role=\"alert\"\n />\n </slot>\n <button\n ref=\"submitButtonRef\"\n type=\"submit\"\n class=\"hide\"\n />\n </form>\n </div>\n</template>\n\n<script>\nimport { loadStripe } from '@stripe/stripe-js/dist/pure.esm.js';\nimport { isSecureHost } from '../utils';\nimport {\n DEFAULT_ELEMENT_STYLE,\n STRIPE_PARTNER_DETAILS,\n INSECURE_HOST_ERROR_MESSAGE,\n} from '../constants';\nconst ELEMENT_TYPE = 'card';\nexport default {\n props: {\n pk: {\n type: String,\n required: true,\n },\n stripeAccount: {\n type: String,\n default: undefined,\n },\n apiVersion: {\n type: String,\n default: undefined,\n },\n locale: {\n type: String,\n default: 'auto',\n },\n elementsOptions: {\n type: Object,\n default: () => ({}),\n },\n tokenData: {\n type: Object,\n default: () => ({}),\n },\n disableAdvancedFraudDetection: {\n type: Boolean,\n },\n // element specific options\n classes: {\n type: Object,\n default: () => ({}),\n },\n elementStyle: {\n type: Object,\n default: () => (DEFAULT_ELEMENT_STYLE),\n },\n value: {\n type: String,\n default: undefined,\n },\n hidePostalCode: Boolean,\n iconStyle: {\n type: String,\n default: 'default',\n validator: value => ['solid', 'default'].includes(value),\n },\n hideIcon: Boolean,\n disabled: Boolean,\n },\n data () {\n return {\n loading: false,\n stripe: null,\n elements: null,\n element: null,\n card: null,\n };\n },\n computed: {\n form () {\n return document.getElementById('stripe-element-form');\n },\n },\n async mounted () {\n if (!isSecureHost()) {\n document.getElementById('stripe-element-mount-point').innerHTML = `<p style=\"color: red\">${INSECURE_HOST_ERROR_MESSAGE}</p>`;\n return;\n }\n\n if (this.disableAdvancedFraudDetection) loadStripe.setLoadParameters({ advancedFraudSignals: false });\n\n const stripeOptions = {\n stripeAccount: this.stripeAccount,\n apiVersion: this.apiVersion,\n locale: this.locale,\n };\n const createOptions = {\n classes: this.classes,\n style: this.elementStyle,\n value: this.value,\n hidePostalCode: this.hidePostalCode,\n iconStyle: this.iconStyle,\n hideIcon: this.hideIcon,\n disabled: this.disabled,\n };\n\n this.stripe = await loadStripe(this.pk, stripeOptions);\n this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS);\n this.elements = this.stripe.elements(this.elementsOptions);\n this.element = this.elements.create(ELEMENT_TYPE, createOptions);\n this.element.mount('#stripe-element-mount-point');\n\n this.element.on('change', (event) => {\n var displayError = document.getElementById('stripe-element-errors');\n if (event.error) {\n displayError.textContent = event.error.message;\n } else {\n displayError.textContent = '';\n }\n this.onChange(event);\n });\n\n this.element.on('blur', this.onBlur);\n this.element.on('click', this.onClick);\n this.element.on('escape', this.onEscape);\n this.element.on('focus', this.onFocus);\n this.element.on('ready', this.onReady);\n\n this.form.addEventListener('submit', async (event) => {\n try {\n this.$emit('loading', true);\n event.preventDefault();\n const data = {\n ...this.element,\n };\n if (this.amount) data.amount = this.amount;\n const { token, error } = await this.stripe.createToken(data, this.tokenData);\n if (error) {\n const errorElement = document.getElementById('stripe-element-errors');\n errorElement.textContent = error.message;\n this.$emit('error', error);\n return;\n }\n this.$emit('token', token);\n } catch (error) {\n console.error(error);\n this.$emit('error', error);\n } finally {\n this.$emit('loading', false);\n }\n });\n },\n methods: {\n /**\n * Triggers the submission of the form\n * @return {void}\n */\n submit () {\n this.$refs.submitButtonRef.click();\n },\n /**\n * Clears the element\n * @return {void}\n */\n clear () {\n this.element.clear();\n },\n /**\n * Destroys the element\n * @return {void}\n */\n destroy () {\n this.element.destroy();\n },\n /**\n * Focuses on the element\n * @return {void}\n */\n focus () {\n console.warn('This method will currently not work on iOS 13+ due to a system limitation.');\n this.element.focus();\n },\n /**\n * Unmounts the element\n * @return {void}\n */\n unmount () {\n this.element.unmount();\n },\n /**\n * Updates the element\n * @param {string} opts.classes.base The base class applied to the container. Defaults to StripeElement.\n * @param {string} opts.classes.complete The class name to apply when the Element is complete. Defaults to StripeElement--complete.\n * @param {string} opts.classes.empty The class name to apply when the Element is empty. Defaults to StripeElement--empty.\n * @param {string} opts.classes.focus The class name to apply when the Element is focused. Defaults to StripeElement--focus.\n * @param {string} opts.classes.invalid The class name to apply when the Element is invalid. Defaults to StripeElement--invalid.\n * @param {string} opts.classes.webkitAutoFill The class name to apply when the Element has its value autofilled by the browser (only on Chrome and Safari). Defaults to StripeElement--webkit-autofill.\n * @param {Object} opts.style Customize the appearance of this element using CSS properties passed in a Style object.\n * @param {string} opts.value A pre-filled set of values to include in the input (e.g., {postalCode: '94110'}). Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled\n * @param {boolean} opts.hidePostalCode Hide the postal code field. Default is false. If you are already collecting a full billing address or postal code elsewhere, set this to true.\n * @param {string} opts.iconStyle Appearance of the icon in the Element. Either solid or default.\n * @param {boolean} opts.hideIcon Hides the icon in the Element. Default is false.\n * @param {boolean} opts.disabled Applies a disabled state to the Element such that user input is not accepted. Default is false.\n */\n update (opts) {\n this.element.update(opts);\n },\n // events\n onChange (e) {\n this.$emit('element-change', e);\n },\n onReady (e) {\n this.$emit('element-ready', e);\n },\n onFocus (e) {\n this.$emit('element-focus', e);\n },\n onBlur (e) {\n this.$emit('element-blur', e);\n },\n onEscape (e) {\n this.$emit('element-escape', e);\n },\n onClick (e) {\n this.$emit('element-click', e);\n },\n },\n};\n<\/script>\n\n<style scoped>\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.StripeElement {\n box-sizing: border-box;\n\n height: 40px;\n\n padding: 10px 12px;\n\n border: 1px solid transparent;\n border-radius: 4px;\n background-color: white;\n\n box-shadow: 0 1px 3px 0 #e6ebf1;\n -webkit-transition: box-shadow 150ms ease;\n transition: box-shadow 150ms ease;\n}\n\n.StripeElement--focus {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n\n.StripeElement--invalid {\n border-color: #fa755a;\n}\n\n.StripeElement--webkit-autofill {\n background-color: #fefde5 !important;\n}\n\n.hide {\n display: none;\n}\n</style>\n"]},media:void 0})},__vue_scope_id__="data-v-e001dcc2",__vue_module_identifier__=void 0,__vue_is_functional_template__=!1,__vue_component__=normalizeComponent({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,!1,void 0,!1,createInjector,void 0,void 0);var ELEMENT_TYPE$1="payment",script$1={props:{pk:{type:String,required:!0},elementsOptions:{type:Object,required:!0,default:function(){return{}}},confirmParams:{type:Object,required:!0,default:function(){return{}}},createOptions:{type:Object,default:function(){return{}}},stripeAccount:{type:String,default:void 0},apiVersion:{type:String,default:void 0},locale:{type:String,default:"auto"},disableAdvancedFraudDetection:{type:Boolean}},data:function(){return{loading:!1,stripe:null,elements:null,element:null}},computed:{form:function(){return document.getElementById("stripe-payment-element-form")}},mounted:function(){var e,n=this;return regenerator.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(isSecureHost()){t.next=3;break}return document.getElementById("stripe-payment-element-mount-point").innerHTML='<p style="color: red">'.concat(INSECURE_HOST_ERROR_MESSAGE,"</p>"),t.abrupt("return");case 3:return this.disableAdvancedFraudDetection&&loadStripe.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},t.next=7,regenerator.awrap(loadStripe(this.pk,e));case 7:this.stripe=t.sent,this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS),this.elements=this.stripe.elements(this.elementsOptions),this.element=this.elements.create(ELEMENT_TYPE$1,this.createOptions),this.element.mount("#stripe-payment-element-mount-point"),this.element.on("change",(function(e){var t=document.getElementById("stripe-payment-element-errors");e.error?t.textContent=e.error.message:t.textContent="",n.onChange(e)})),this.element.on("blur",this.onBlur),this.element.on("click",this.onClick),this.element.on("escape",this.onEscape),this.element.on("focus",this.onFocus),this.element.on("ready",this.onReady),this.form.addEventListener("submit",(function(e){var t,r;return regenerator.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,n.$emit("loading",!0),e.preventDefault(),i.next=5,regenerator.awrap(n.stripe.confirmPayment({elements:n.elements,confirmParams:n.confirmParams}));case 5:if(t=i.sent,!(r=t.error)){i.next=12;break}return document.getElementById("stripe-payment-element-errors").textContent=r.message,n.$emit("error",r),i.abrupt("return");case 12:i.next=18;break;case 14:i.prev=14,i.t0=i.catch(0),console.error(i.t0),n.$emit("error",i.t0);case 18:return i.prev=18,n.$emit("loading",!1),i.finish(18);case 21:case"end":return i.stop()}}),null,null,[[0,14,18,21]])}));case 19:case"end":return t.stop()}}),null,this)},methods:{submit:function(){this.$refs.submitButtonRef.click()},clear:function(){this.element.clear()},destroy:function(){this.element.destroy()},focus:function(){console.warn("This method will currently not work on iOS 13+ due to a system limitation."),this.element.focus()},collapse:function(){this.element.collapse()},getElement:function(){this.element.getElement()},unmount:function(){this.element.unmount()},update:function(e){this.element.update(e)},onChange:function(e){this.$emit("element-change",e)},onReady:function(e){this.$emit("element-ready",e)},onFocus:function(e){this.$emit("element-focus",e)},onBlur:function(e){this.$emit("element-blur",e)},onEscape:function(e){this.$emit("element-escape",e)},onClick:function(e){this.$emit("element-click",e)}}};const __vue_script__$1=script$1;var __vue_render__$1=function(){var e=this.$createElement,n=this._self._c||e;return n("div",[n("form",{attrs:{id:"stripe-payment-element-form"}},[n("div",{attrs:{id:"stripe-payment-element-mount-point"}}),this._v(" "),this._t("stripe-payment-element-errors",[n("div",{attrs:{id:"stripe-payment-element-errors",role:"alert"}})]),this._v(" "),n("button",{ref:"submitButtonRef",staticClass:"hide",attrs:{type:"submit"}})],2)])},__vue_staticRenderFns__$1=[];__vue_render__$1._withStripped=!0;const __vue_inject_styles__$1=function(e){e&&e("data-v-865458b2_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.hide[data-v-865458b2] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Payment.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyPA;;;EAGA;AACA;EACA,aAAA;AACA",file:"Payment.vue",sourcesContent:["<template>\n <div>\n <form id=\"stripe-payment-element-form\">\n <div id=\"stripe-payment-element-mount-point\" />\n <slot name=\"stripe-payment-element-errors\">\n <div\n id=\"stripe-payment-element-errors\"\n role=\"alert\"\n />\n </slot>\n <button\n ref=\"submitButtonRef\"\n type=\"submit\"\n class=\"hide\"\n />\n </form>\n </div>\n</template>\n\n<script>\nimport { loadStripe } from '@stripe/stripe-js/dist/pure.esm.js';\nimport { isSecureHost } from '../utils';\nimport {\n STRIPE_PARTNER_DETAILS,\n INSECURE_HOST_ERROR_MESSAGE,\n} from '../constants';\nconst ELEMENT_TYPE = 'payment';\nexport default {\n props: {\n pk: {\n type: String,\n required: true,\n },\n elementsOptions: {\n type: Object,\n required: true,\n default: () => ({}),\n },\n confirmParams: {\n type: Object,\n required: true,\n default: () => ({}),\n },\n createOptions: {\n type: Object,\n default: () => ({}),\n },\n stripeAccount: {\n type: String,\n default: undefined,\n },\n apiVersion: {\n type: String,\n default: undefined,\n },\n locale: {\n type: String,\n default: 'auto',\n },\n disableAdvancedFraudDetection: {\n type: Boolean,\n },\n },\n data () {\n return {\n loading: false,\n stripe: null,\n elements: null,\n element: null,\n };\n },\n computed: {\n form () {\n return document.getElementById('stripe-payment-element-form');\n },\n },\n async mounted () {\n if (!isSecureHost()) {\n document.getElementById(\n 'stripe-payment-element-mount-point',\n ).innerHTML = `<p style=\"color: red\">${INSECURE_HOST_ERROR_MESSAGE}</p>`;\n return;\n }\n\n if (this.disableAdvancedFraudDetection) {\n loadStripe.setLoadParameters({ advancedFraudSignals: false });\n }\n\n const stripeOptions = {\n stripeAccount: this.stripeAccount,\n apiVersion: this.apiVersion,\n locale: this.locale,\n };\n\n this.stripe = await loadStripe(this.pk, stripeOptions);\n this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS);\n\n this.elements = this.stripe.elements(this.elementsOptions);\n this.element = this.elements.create(ELEMENT_TYPE, this.createOptions);\n this.element.mount('#stripe-payment-element-mount-point');\n\n this.element.on('change', event => {\n var displayError = document.getElementById(\n 'stripe-payment-element-errors',\n );\n if (event.error) {\n displayError.textContent = event.error.message;\n } else {\n displayError.textContent = '';\n }\n this.onChange(event);\n });\n\n this.element.on('blur', this.onBlur);\n this.element.on('click', this.onClick);\n this.element.on('escape', this.onEscape);\n this.element.on('focus', this.onFocus);\n this.element.on('ready', this.onReady);\n\n this.form.addEventListener('submit', async event => {\n try {\n this.$emit('loading', true);\n event.preventDefault();\n const { error } = await this.stripe.confirmPayment({\n elements: this.elements,\n confirmParams: this.confirmParams,\n });\n if (error) {\n const errorElement = document.getElementById(\n 'stripe-payment-element-errors',\n );\n errorElement.textContent = error.message;\n this.$emit('error', error);\n return;\n }\n } catch (error) {\n console.error(error);\n this.$emit('error', error);\n } finally {\n this.$emit('loading', false);\n }\n });\n },\n methods: {\n /**\n * Triggers the submission of the form\n * @return {void}\n */\n submit () {\n this.$refs.submitButtonRef.click();\n },\n /**\n * Clears the element\n * @return {void}\n */\n clear () {\n this.element.clear();\n },\n /**\n * Destroys the element\n * @return {void}\n */\n destroy () {\n this.element.destroy();\n },\n /**\n * Focuses on the element\n * @return {void}\n */\n focus () {\n console.warn(\n 'This method will currently not work on iOS 13+ due to a system limitation.',\n );\n this.element.focus();\n },\n /**\n * Collapses the Payment Element into a row of payment method tabs\n * @return {void}\n */\n collapse () {\n this.element.collapse();\n },\n /**\n * Retrieves a previously created element\n */\n getElement () {\n this.element.getElement();\n },\n /**\n * Unmounts the element\n * @return {void}\n */\n unmount () {\n this.element.unmount();\n },\n /**\n * Updates the element. See official docs for more detail: https://site-admin.stripe.com/docs/js/elements_object/update_payment_element\n * @param {string} opts.business.name Information about your business that will be displayed in the Payment Element. This information will be retrieved from the Stripe account if not provided.\n * @param {array} opts.paymentMethodOrder Sets order in which payment methods are displayed. Otherwise payment methods are ordered dynamically to optimize for conversion.\n * @param {string | Object} opts.fields.billingDetails The Payment Element automatically creates input fields to collect required billing information for some payment methods like SEPA debit. Specify 'never' to avoid collecting billing details in the Payment Element if you're collecting them outside of the Payment Element.\n * @param {string} opts.fields.billingDetails.name Specify 'never' to avoid collecting a name as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.email Specify 'never' to avoid collecting an email address as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.phone Specify 'never' to avoid collecting a phone number as part of the billing details in the Payment Element.\n * @param {string | Object} opts.fields.billingDetails.address Specify 'never' to avoid collecting an address as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.line1 Specify 'never' to avoid collecting an address line1 as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.line2 Specify 'never' to avoid collecting an address line2 as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.city Specify 'never' to avoid collecting an address city as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.state Specify 'never' to avoid collecting an address state as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.country Specify 'never' to avoid collecting an address country as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.postalCode Specify 'never' to avoid collecting an address postal code as part of the billing details in the Payment Element.\n * @param {string} opts.fields.terms The Payment Element automatically displays mandates or other legal agreements when required by the payment method, like SEPA debit. Specify 'never' to never show legal agreements.\n * @param {string} opts.fields.terms.auBecsDebit Specify 'never' to never show legal agreements for the BECS Debit payment method.\n * @param {string} opts.fields.terms.bancontact Specify 'never' to never show legal agreements for the Bancontact payment method.\n * @param {string} opts.fields.terms.card Specify 'never' to never show legal agreements for the credit card payment method.\n * @param {string} opts.fields.terms.ideal Specify 'never' to never show legal agreements for the iDEAL payment method.\n * @param {string} opts.fields.terms.sepaDebit Specify 'never' to never show legal agreements for the SEPA Debit payment method.\n * @param {string} opts.fields.terms.sofort Specify 'never' to never show legal agreements for the SOFORT payment method.\n * @param {string} opts.fields.terms.usBankAccount Specify 'never' to never show legal agreements for the US Bank accounts payment method.\n * @param {string} opts.wallets Specify 'never' to never show digital wallet payment methods like Apple Pay and Google Pay.\n * @param {string} opts.wallets.applePay Specify 'never' to never show the Apple Pay digital wallet payment method.\n * @param {string} opts.wallets.googlePay Specify 'never' to never show the Google Pay digital wallet payment method.\n */\n update (opts) {\n this.element.update(opts);\n },\n // events\n onChange (e) {\n this.$emit('element-change', e);\n },\n onReady (e) {\n this.$emit('element-ready', e);\n },\n onFocus (e) {\n this.$emit('element-focus', e);\n },\n onBlur (e) {\n this.$emit('element-blur', e);\n },\n onEscape (e) {\n this.$emit('element-escape', e);\n },\n onClick (e) {\n this.$emit('element-click', e);\n },\n },\n};\n<\/script>\n\n<style scoped>\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.hide {\n display: none;\n}\n</style>\n"]},media:void 0})},__vue_scope_id__$1="data-v-865458b2",__vue_module_identifier__$1=void 0,__vue_is_functional_template__$1=!1,__vue_component__$1=normalizeComponent({render:__vue_render__$1,staticRenderFns:__vue_staticRenderFns__$1},__vue_inject_styles__$1,__vue_script__$1,"data-v-865458b2",!1,void 0,!1,createInjector,void 0,void 0);var index$3={install:function(e,n){var t,r,i,o,s,a,l;return regenerator.async((function(c){for(;;)switch(c.prev=c.next){case 0:t=n.pk,r=n.stripeAccount,i=n.apiVersion,o=n.locale,s=n.elementsOptions,(a=window.Stripe(t,{stripeAccount:r,apiVersion:i,locale:o})).registerAppInfo(STRIPE_PARTNER_DETAILS),l=a.elements(s),e.prototype.$stripe=a,e.prototype.$stripeElements=l;case 6:case"end":return c.stop()}}))}};exports.StripeCheckout=index$2,exports.StripeElementCard=__vue_component__,exports.StripeElementPayment=__vue_component__$1,exports.StripeElementsPlugin=index$3,exports.StripePlugin=index;
@@ -1,7 +1,7 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).VueStripe={})}(this,(function(e){"use strict";var n=["auto","bg","cs","da","de","el","en","en-GB","es","es-419","et","fi","fr","fr-CA","hu","id","it","ja","lt","lv","ms","mt","nb","nl","pl","pt","pt-BR","ro","ru","sk","sl","sv","tr","zh","zh-HK","zh-TW"],t=["auto","book","donate","pay"],r=["required","auto"],o={base:{color:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},i={name:"vue-stripe",version:require("../package.json").version,url:process.env.VUE_STRIPE_WEBSITE,partner_id:process.env.VUE_STRIPE_PARTNER_ID},s="Vue Stripe will not work on an insecure host. Make sure that your site is using TCP/SSL.",a=function(){return"localhost"===window.location.hostname||"https:"===window.location.protocol},l={install:function(e,n){a()||console.warn(s);var t=n.pk,r=n.stripeAccount,o=n.apiVersion,l=n.locale,c=window.Stripe(t,{stripeAccount:r,apiVersion:o,locale:l});c.registerAppInfo(i),e.prototype.$stripe=c}};var c=function(e,n){return e(n={exports:{}},n.exports),n.exports}((function(e){var n=function(e){var n,t=Object.prototype,r=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function l(e,n,t,r){var o=n&&n.prototype instanceof m?n:m,i=Object.create(o.prototype),s=new _(r||[]);return i._invoke=function(e,n,t){var r=u;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return T()}for(t.method=o,t.arg=i;;){var s=t.delegate;if(s){var a=x(s,t);if(a){if(a===f)continue;return a}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(r===u)throw r=h,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);r=p;var l=c(e,n,t);if("normal"===l.type){if(r=t.done?h:d,l.arg===f)continue;return{value:l.arg,done:t.done}}"throw"===l.type&&(r=h,t.method="throw",t.arg=l.arg)}}}(e,t,s),i}function c(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u="suspendedStart",d="suspendedYield",p="executing",h="completed",f={};function m(){}function y(){}function v(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,E=b&&b(b(O([])));E&&E!==t&&r.call(E,i)&&(g=E);var w=v.prototype=m.prototype=Object.create(g);function A(e){["next","throw","return"].forEach((function(n){e[n]=function(e){return this._invoke(n,e)}}))}function S(e){var n;this._invoke=function(t,o){function i(){return new Promise((function(n,i){!function n(t,o,i,s){var a=c(e[t],e,o);if("throw"!==a.type){var l=a.arg,u=l.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):Promise.resolve(u).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,s)}))}s(a.arg)}(t,o,n,i)}))}return n=n?n.then(i,i):i()}}function x(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,x(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var o=c(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function C(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function k(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,s=function t(){for(;++o<e.length;)if(r.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=n,t.done=!0,t};return s.next=s}}return{next:T}}function T(){return{value:n,done:!0}}return y.prototype=w.constructor=v,v.constructor=y,v[a]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===y||"GeneratorFunction"===(n.displayName||n.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},A(S.prototype),S.prototype[s]=function(){return this},e.AsyncIterator=S,e.async=function(n,t,r,o){var i=new S(l(n,t,r,o));return e.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(w),w[a]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var n=[];for(var t in e)n.push(t);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(r,o){return a.type="throw",a.arg=e,t.next=r,o&&(t.method="next",t.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=n,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(s)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),f},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),k(t),f}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;k(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),f}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}}));function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var d,p="https://js.stripe.com/v3",h=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,f="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",m=null,y=function(e){return null!==m?m:m=new Promise((function(n,t){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(f),window.Stripe)n(window.Stripe);else try{var r=function(){for(var e=document.querySelectorAll('script[src^="'.concat(p,'"]')),n=0;n<e.length;n++){var t=e[n];if(h.test(t.src))return t}return null}();r&&e?console.warn(f):r||(r=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(p).concat(n);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(t),t}(e)),r.addEventListener("load",(function(){window.Stripe?n(window.Stripe):t(new Error("Stripe.js not available"))})),r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else n(null)}))},v=function(e,n,t){if(null===e)return null;var r=e.apply(void 0,n);return function(e,n){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.13.2",startTime:n})}(r,t),r},g=!1,b=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];g=!0;var r=Date.now();return y(d).then((function(e){return v(e,n,r)}))};b.setLoadParameters=function(e){if(g)throw new Error("You cannot change load parameters after calling loadStripe");d=function(e){var n="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==u(e))throw new Error(n);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw new Error(n)}(e)};
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).VueStripe={})}(this,(function(e){"use strict";var n=["auto","bg","cs","da","de","el","en","en-GB","es","es-419","et","fi","fr","fr-CA","hu","id","it","ja","lt","lv","ms","mt","nb","nl","pl","pt","pt-BR","ro","ru","sk","sl","sv","tr","zh","zh-HK","zh-TW"],t=["auto","book","donate","pay"],r=["required","auto"],i={base:{color:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},o={name:"vue-stripe",version:require("../package.json").version,url:"https://vuestripe.com",partner_id:"pp_partner_IqtOXpBSuz0IE2"},s="Vue Stripe will not work on an insecure host. Make sure that your site is using TCP/SSL.",a=function(){return"localhost"===window.location.hostname||"https:"===window.location.protocol},l={install:function(e,n){a()||console.warn(s);var t=n.pk,r=n.stripeAccount,i=n.apiVersion,l=n.locale,c=window.Stripe(t,{stripeAccount:r,apiVersion:i,locale:l});c.registerAppInfo(o),e.prototype.$stripe=c}};var c=function(e,n){return e(n={exports:{}},n.exports),n.exports}((function(e){var n=function(e){var n,t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function l(e,n,t,r){var i=n&&n.prototype instanceof f?n:f,o=Object.create(i.prototype),s=new O(r||[]);return o._invoke=function(e,n,t){var r=u;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===m){if("throw"===i)throw o;return P()}for(t.method=i,t.arg=o;;){var s=t.delegate;if(s){var a=C(s,t);if(a){if(a===h)continue;return a}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(r===u)throw r=m,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);r=d;var l=c(e,n,t);if("normal"===l.type){if(r=t.done?m:p,l.arg===h)continue;return{value:l.arg,done:t.done}}"throw"===l.type&&(r=m,t.method="throw",t.arg=l.arg)}}}(e,t,s),o}function c(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u="suspendedStart",p="suspendedYield",d="executing",m="completed",h={};function f(){}function y(){}function v(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,E=b&&b(b(_([])));E&&E!==t&&r.call(E,o)&&(g=E);var S=v.prototype=f.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(n){e[n]=function(e){return this._invoke(n,e)}}))}function A(e){var n;this._invoke=function(t,i){function o(){return new Promise((function(n,o){!function n(t,i,o,s){var a=c(e[t],e,i);if("throw"!==a.type){var l=a.arg,u=l.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):Promise.resolve(u).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(a.arg)}(t,i,n,o)}))}return n=n?n.then(o,o):o()}}function C(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,C(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function k(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=n,t.done=!0,t};return s.next=s}}return{next:P}}function P(){return{value:n,done:!0}}return y.prototype=S.constructor=v,v.constructor=y,v[a]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===y||"GeneratorFunction"===(n.displayName||n.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(S),e},e.awrap=function(e){return{__await:e}},w(A.prototype),A.prototype[s]=function(){return this},e.AsyncIterator=A,e.async=function(n,t,r,i){var o=new A(l(n,t,r,i));return e.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},w(S),S[a]="Generator",S[o]=function(){return this},S.toString=function(){return"[object Generator]"},e.keys=function(e){var n=[];for(var t in e)n.push(t);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=n,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),h},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),k(t),h}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var i=r.arg;k(t)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:_(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),h}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}}));function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var p,d="https://js.stripe.com/v3",m=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,h="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",f=null,y=function(e){return null!==f?f:f=new Promise((function(n,t){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(h),window.Stripe)n(window.Stripe);else try{var r=function(){for(var e=document.querySelectorAll('script[src^="'.concat(d,'"]')),n=0;n<e.length;n++){var t=e[n];if(m.test(t.src))return t}return null}();r&&e?console.warn(h):r||(r=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(d).concat(n);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(t),t}(e)),r.addEventListener("load",(function(){window.Stripe?n(window.Stripe):t(new Error("Stripe.js not available"))})),r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else n(null)}))},v=function(e,n,t){if(null===e)return null;var r=e.apply(void 0,n);return function(e,n){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.13.2",startTime:n})}(r,t),r},g=!1,b=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];g=!0;var r=Date.now();return y(p).then((function(e){return v(e,n,r)}))};b.setLoadParameters=function(e){if(g)throw new Error("You cannot change load parameters after calling loadStripe");p=function(e){var n="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==u(e))throw new Error(n);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw new Error(n)}(e)};
2
2
  /**
3
3
  * vue-coerce-props v1.0.0
4
4
  * (c) 2018 Eduardo San Martin Morote <posva13@gmail.com>
5
5
  * @license MIT
6
6
  */
7
- var E={beforeCreate:function(){var e=this.$options.props;e&&(this._$coertions=Object.keys(e).filter((function(n){return e[n].coerce})).map((function(n){return[n,e[n].coerce]})))},computed:{$coerced:function(){var e=this;return this._$coertions.reduce((function(n,t){var r=t[0],o=t[1];return n[r]=o.call(e,e.$props[r]),n}),{})}}},w={props:{pk:{type:String,required:!0},mode:{type:String,validator:function(e){return["payment","subscription"].includes(e)}},lineItems:{type:Array,default:void 0},items:{type:Array},successUrl:{type:String,default:window.location.href},cancelUrl:{type:String,default:window.location.href},submitType:{type:String,validator:function(e){return t.includes(e)}},billingAddressCollection:{type:String,default:"auto",validator:function(e){return r.includes(e)}},clientReferenceId:{type:String},customerEmail:{type:String},sessionId:{type:String},locale:{type:String,default:"auto",coerce:function(e){return n.includes(e)?e:(console.warn("VueStripe Warning: '".concat(e,"' is not supported by Stripe yet. Falling back to default '").concat("auto","'.")),"auto")}},shippingAddressCollection:{type:Object,validator:function(e){return Object.prototype.hasOwnProperty.call(e,"allowedCountries")}},disableAdvancedFraudDetection:{type:Boolean}},mixins:[E],render:function(e){return e},mounted:function(){a()||console.warn(s)},methods:{redirectToCheckout:function(){var e,n;return c.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,a()){t.next=3;break}throw Error(s);case 3:return this.$emit("loading",!0),this.disableAdvancedFraudDetection&&b.setLoadParameters({advancedFraudSignals:!1}),t.next=7,c.awrap(b(this.pk));case 7:if((e=t.sent).registerAppInfo(i),!this.sessionId){t.next=12;break}return e.redirectToCheckout({sessionId:this.sessionId}),t.abrupt("return");case 12:if(!this.lineItems||!this.lineItems.length||this.mode){t.next=15;break}return console.error("Error: Property 'mode' is required when using 'lineItems'. See https://stripe.com/docs/js/checkout/redirect_to_checkout#stripe_checkout_redirect_to_checkout-options-mode"),t.abrupt("return");case 15:n={billingAddressCollection:this.billingAddressCollection,cancelUrl:this.cancelUrl,clientReferenceId:this.clientReferenceId,customerEmail:this.customerEmail,items:this.items,lineItems:this.lineItems,locale:this.$coerced.locale,mode:this.mode,shippingAddressCollection:this.shippingAddressCollection,submitType:this.submitType,successUrl:this.successUrl},e.redirectToCheckout(n),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(0),console.error(t.t0),this.$emit("error",t.t0);case 23:case"end":return t.stop()}}),null,this,[[0,19]])}}};var A=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e};function S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function x(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?S(Object(t),!0).forEach((function(n){A(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):S(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var C={props:{pk:{type:String,required:!0},stripeAccount:{type:String,default:void 0},apiVersion:{type:String,default:void 0},locale:{type:String,default:"auto"},elementsOptions:{type:Object,default:function(){return{}}},tokenData:{type:Object,default:function(){return{}}},disableAdvancedFraudDetection:{type:Boolean},classes:{type:Object,default:function(){return{}}},elementStyle:{type:Object,default:function(){return o}},value:{type:String,default:void 0},hidePostalCode:Boolean,iconStyle:{type:String,default:"default",validator:function(e){return["solid","default"].includes(e)}},hideIcon:Boolean,disabled:Boolean},data:function(){return{loading:!1,stripe:null,elements:null,element:null,card:null}},computed:{form:function(){return document.getElementById("stripe-element-form")}},mounted:function(){var e,n,t=this;return c.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(a()){r.next=3;break}return document.getElementById("stripe-element-mount-point").innerHTML='<p style="color: red">'.concat(s,"</p>"),r.abrupt("return");case 3:return this.disableAdvancedFraudDetection&&b.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},n={classes:this.classes,style:this.elementStyle,value:this.value,hidePostalCode:this.hidePostalCode,iconStyle:this.iconStyle,hideIcon:this.hideIcon,disabled:this.disabled},r.next=8,c.awrap(b(this.pk,e));case 8:this.stripe=r.sent,this.stripe.registerAppInfo(i),this.elements=this.stripe.elements(this.elementsOptions),this.element=this.elements.create("card",n),this.element.mount("#stripe-element-mount-point"),this.element.on("change",(function(e){var n=document.getElementById("stripe-element-errors");e.error?n.textContent=e.error.message:n.textContent="",t.onChange(e)})),this.element.on("blur",this.onBlur),this.element.on("click",this.onClick),this.element.on("escape",this.onEscape),this.element.on("focus",this.onFocus),this.element.on("ready",this.onReady),this.form.addEventListener("submit",(function(e){var n,r,o,i;return c.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,t.$emit("loading",!0),e.preventDefault(),n=x({},t.element),t.amount&&(n.amount=t.amount),s.next=7,c.awrap(t.stripe.createToken(n,t.tokenData));case 7:if(r=s.sent,o=r.token,!(i=r.error)){s.next=15;break}return document.getElementById("stripe-element-errors").textContent=i.message,t.$emit("error",i),s.abrupt("return");case 15:t.$emit("token",o),s.next=22;break;case 18:s.prev=18,s.t0=s.catch(0),console.error(s.t0),t.$emit("error",s.t0);case 22:return s.prev=22,t.$emit("loading",!1),s.finish(22);case 25:case"end":return s.stop()}}),null,null,[[0,18,22,25]])}));case 20:case"end":return r.stop()}}),null,this)},methods:{submit:function(){this.$refs.submitButtonRef.click()},clear:function(){this.element.clear()},destroy:function(){this.element.destroy()},focus:function(){console.warn("This method will currently not work on iOS 13+ due to a system limitation."),this.element.focus()},unmount:function(){this.element.unmount()},update:function(e){this.element.update(e)},onChange:function(e){this.$emit("element-change",e)},onReady:function(e){this.$emit("element-ready",e)},onFocus:function(e){this.$emit("element-focus",e)},onBlur:function(e){this.$emit("element-blur",e)},onEscape:function(e){this.$emit("element-escape",e)},onClick:function(e){this.$emit("element-click",e)}}};const k="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());let _;const O={};const T=C;var j=function(){var e=this.$createElement,n=this._self._c||e;return n("div",[n("form",{attrs:{id:"stripe-element-form"}},[n("div",{attrs:{id:"stripe-element-mount-point"}}),this._v(" "),this._t("stripe-element-errors",[n("div",{attrs:{id:"stripe-element-errors",role:"alert"}})]),this._v(" "),n("button",{ref:"submitButtonRef",staticClass:"hide",attrs:{type:"submit"}})],2)])};j._withStripped=!0;const L=function(e,n,t,r,o,i,s,a,l,c){"boolean"!=typeof s&&(l=a,a=s,s=!1);const u="function"==typeof t?t.options:t;let d;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,o&&(u.functional=!0)),r&&(u._scopeId=r),i?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=d):n&&(d=s?function(e){n.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){n.call(this,a(e))}),d)if(u.functional){const e=u.render;u.render=function(n,t){return d.call(t),e(n,t)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,d):[d]}return t}({render:j,staticRenderFns:[]},(function(e){e&&e("data-v-e001dcc2_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.StripeElement[data-v-e001dcc2] {\n box-sizing: border-box;\n\n height: 40px;\n\n padding: 10px 12px;\n\n border: 1px solid transparent;\n border-radius: 4px;\n background-color: white;\n\n box-shadow: 0 1px 3px 0 #e6ebf1;\n -webkit-transition: box-shadow 150ms ease;\n transition: box-shadow 150ms ease;\n}\n.StripeElement--focus[data-v-e001dcc2] {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n.StripeElement--invalid[data-v-e001dcc2] {\n border-color: #fa755a;\n}\n.StripeElement--webkit-autofill[data-v-e001dcc2] {\n background-color: #fefde5 !important;\n}\n.hide[data-v-e001dcc2] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Card.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiPA;;;EAGA;AACA;EACA,sBAAA;;EAEA,YAAA;;EAEA,kBAAA;;EAEA,6BAAA;EACA,kBAAA;EACA,uBAAA;;EAEA,+BAAA;EACA,yCAAA;EACA,iCAAA;AACA;AAEA;EACA,+BAAA;AACA;AAEA;EACA,qBAAA;AACA;AAEA;EACA,oCAAA;AACA;AAEA;EACA,aAAA;AACA",file:"Card.vue",sourcesContent:["<template>\n <div>\n <form id=\"stripe-element-form\">\n <div id=\"stripe-element-mount-point\" />\n <slot name=\"stripe-element-errors\">\n <div\n id=\"stripe-element-errors\"\n role=\"alert\"\n />\n </slot>\n <button\n ref=\"submitButtonRef\"\n type=\"submit\"\n class=\"hide\"\n />\n </form>\n </div>\n</template>\n\n<script>\nimport { loadStripe } from '@stripe/stripe-js/dist/pure.esm.js';\nimport { isSecureHost } from '../utils';\nimport {\n DEFAULT_ELEMENT_STYLE,\n STRIPE_PARTNER_DETAILS,\n INSECURE_HOST_ERROR_MESSAGE,\n} from '../constants';\nconst ELEMENT_TYPE = 'card';\nexport default {\n props: {\n pk: {\n type: String,\n required: true,\n },\n stripeAccount: {\n type: String,\n default: undefined,\n },\n apiVersion: {\n type: String,\n default: undefined,\n },\n locale: {\n type: String,\n default: 'auto',\n },\n elementsOptions: {\n type: Object,\n default: () => ({}),\n },\n tokenData: {\n type: Object,\n default: () => ({}),\n },\n disableAdvancedFraudDetection: {\n type: Boolean,\n },\n // element specific options\n classes: {\n type: Object,\n default: () => ({}),\n },\n elementStyle: {\n type: Object,\n default: () => (DEFAULT_ELEMENT_STYLE),\n },\n value: {\n type: String,\n default: undefined,\n },\n hidePostalCode: Boolean,\n iconStyle: {\n type: String,\n default: 'default',\n validator: value => ['solid', 'default'].includes(value),\n },\n hideIcon: Boolean,\n disabled: Boolean,\n },\n data () {\n return {\n loading: false,\n stripe: null,\n elements: null,\n element: null,\n card: null,\n };\n },\n computed: {\n form () {\n return document.getElementById('stripe-element-form');\n },\n },\n async mounted () {\n if (!isSecureHost()) {\n document.getElementById('stripe-element-mount-point').innerHTML = `<p style=\"color: red\">${INSECURE_HOST_ERROR_MESSAGE}</p>`;\n return;\n }\n\n if (this.disableAdvancedFraudDetection) loadStripe.setLoadParameters({ advancedFraudSignals: false });\n\n const stripeOptions = {\n stripeAccount: this.stripeAccount,\n apiVersion: this.apiVersion,\n locale: this.locale,\n };\n const createOptions = {\n classes: this.classes,\n style: this.elementStyle,\n value: this.value,\n hidePostalCode: this.hidePostalCode,\n iconStyle: this.iconStyle,\n hideIcon: this.hideIcon,\n disabled: this.disabled,\n };\n\n this.stripe = await loadStripe(this.pk, stripeOptions);\n this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS);\n this.elements = this.stripe.elements(this.elementsOptions);\n this.element = this.elements.create(ELEMENT_TYPE, createOptions);\n this.element.mount('#stripe-element-mount-point');\n\n this.element.on('change', (event) => {\n var displayError = document.getElementById('stripe-element-errors');\n if (event.error) {\n displayError.textContent = event.error.message;\n } else {\n displayError.textContent = '';\n }\n this.onChange(event);\n });\n\n this.element.on('blur', this.onBlur);\n this.element.on('click', this.onClick);\n this.element.on('escape', this.onEscape);\n this.element.on('focus', this.onFocus);\n this.element.on('ready', this.onReady);\n\n this.form.addEventListener('submit', async (event) => {\n try {\n this.$emit('loading', true);\n event.preventDefault();\n const data = {\n ...this.element,\n };\n if (this.amount) data.amount = this.amount;\n const { token, error } = await this.stripe.createToken(data, this.tokenData);\n if (error) {\n const errorElement = document.getElementById('stripe-element-errors');\n errorElement.textContent = error.message;\n this.$emit('error', error);\n return;\n }\n this.$emit('token', token);\n } catch (error) {\n console.error(error);\n this.$emit('error', error);\n } finally {\n this.$emit('loading', false);\n }\n });\n },\n methods: {\n /**\n * Triggers the submission of the form\n * @return {void}\n */\n submit () {\n this.$refs.submitButtonRef.click();\n },\n /**\n * Clears the element\n * @return {void}\n */\n clear () {\n this.element.clear();\n },\n /**\n * Destroys the element\n * @return {void}\n */\n destroy () {\n this.element.destroy();\n },\n /**\n * Focuses on the element\n * @return {void}\n */\n focus () {\n console.warn('This method will currently not work on iOS 13+ due to a system limitation.');\n this.element.focus();\n },\n /**\n * Unmounts the element\n * @return {void}\n */\n unmount () {\n this.element.unmount();\n },\n /**\n * Updates the element\n * @param {string} opts.classes.base The base class applied to the container. Defaults to StripeElement.\n * @param {string} opts.classes.complete The class name to apply when the Element is complete. Defaults to StripeElement--complete.\n * @param {string} opts.classes.empty The class name to apply when the Element is empty. Defaults to StripeElement--empty.\n * @param {string} opts.classes.focus The class name to apply when the Element is focused. Defaults to StripeElement--focus.\n * @param {string} opts.classes.invalid The class name to apply when the Element is invalid. Defaults to StripeElement--invalid.\n * @param {string} opts.classes.webkitAutoFill The class name to apply when the Element has its value autofilled by the browser (only on Chrome and Safari). Defaults to StripeElement--webkit-autofill.\n * @param {Object} opts.style Customize the appearance of this element using CSS properties passed in a Style object.\n * @param {string} opts.value A pre-filled set of values to include in the input (e.g., {postalCode: '94110'}). Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled\n * @param {boolean} opts.hidePostalCode Hide the postal code field. Default is false. If you are already collecting a full billing address or postal code elsewhere, set this to true.\n * @param {string} opts.iconStyle Appearance of the icon in the Element. Either solid or default.\n * @param {boolean} opts.hideIcon Hides the icon in the Element. Default is false.\n * @param {boolean} opts.disabled Applies a disabled state to the Element such that user input is not accepted. Default is false.\n */\n update (opts) {\n this.element.update(opts);\n },\n // events\n onChange (e) {\n this.$emit('element-change', e);\n },\n onReady (e) {\n this.$emit('element-ready', e);\n },\n onFocus (e) {\n this.$emit('element-focus', e);\n },\n onBlur (e) {\n this.$emit('element-blur', e);\n },\n onEscape (e) {\n this.$emit('element-escape', e);\n },\n onClick (e) {\n this.$emit('element-click', e);\n },\n },\n};\n<\/script>\n\n<style scoped>\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.StripeElement {\n box-sizing: border-box;\n\n height: 40px;\n\n padding: 10px 12px;\n\n border: 1px solid transparent;\n border-radius: 4px;\n background-color: white;\n\n box-shadow: 0 1px 3px 0 #e6ebf1;\n -webkit-transition: box-shadow 150ms ease;\n transition: box-shadow 150ms ease;\n}\n\n.StripeElement--focus {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n\n.StripeElement--invalid {\n border-color: #fa755a;\n}\n\n.StripeElement--webkit-autofill {\n background-color: #fefde5 !important;\n}\n\n.hide {\n display: none;\n}\n</style>\n"]},media:void 0})}),T,"data-v-e001dcc2",!1,void 0,!1,(function(e){return(e,n)=>(function(e,n){const t=k?n.media||"default":e,r=O[t]||(O[t]={ids:new Set,styles:[]});if(!r.ids.has(e)){r.ids.add(e);let t=n.source;if(n.map&&(t+="\n/*# sourceURL="+n.map.sources[0]+" */",t+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",n.media&&r.element.setAttribute("media",n.media),void 0===_&&(_=document.head||document.getElementsByTagName("head")[0]),_.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(t),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{const e=r.ids.size-1,n=document.createTextNode(t),o=r.element.childNodes;o[e]&&r.element.removeChild(o[e]),o.length?r.element.insertBefore(n,o[e]):r.element.appendChild(n)}}})(e,n)}),void 0,void 0);var I={install:function(e,n){var t,r,o,s,a,l,u;return c.async((function(c){for(;;)switch(c.prev=c.next){case 0:t=n.pk,r=n.stripeAccount,o=n.apiVersion,s=n.locale,a=n.elementsOptions,(l=window.Stripe(t,{stripeAccount:r,apiVersion:o,locale:s})).registerAppInfo(i),u=l.elements(a),e.prototype.$stripe=l,e.prototype.$stripeElements=u;case 6:case"end":return c.stop()}}))}};e.StripeCheckout=w,e.StripeElementCard=L,e.StripeElementsPlugin=I,e.StripePlugin=l,Object.defineProperty(e,"__esModule",{value:!0})}));
7
+ var E={beforeCreate:function(){var e=this.$options.props;e&&(this._$coertions=Object.keys(e).filter((function(n){return e[n].coerce})).map((function(n){return[n,e[n].coerce]})))},computed:{$coerced:function(){var e=this;return this._$coertions.reduce((function(n,t){var r=t[0],i=t[1];return n[r]=i.call(e,e.$props[r]),n}),{})}}},S={props:{pk:{type:String,required:!0},mode:{type:String,validator:function(e){return["payment","subscription"].includes(e)}},lineItems:{type:Array,default:void 0},items:{type:Array},successUrl:{type:String,default:window.location.href},cancelUrl:{type:String,default:window.location.href},submitType:{type:String,validator:function(e){return t.includes(e)}},billingAddressCollection:{type:String,default:"auto",validator:function(e){return r.includes(e)}},clientReferenceId:{type:String},customerEmail:{type:String},sessionId:{type:String},locale:{type:String,default:"auto",coerce:function(e){return n.includes(e)?e:(console.warn("VueStripe Warning: '".concat(e,"' is not supported by Stripe yet. Falling back to default '").concat("auto","'.")),"auto")}},shippingAddressCollection:{type:Object,validator:function(e){return Object.prototype.hasOwnProperty.call(e,"allowedCountries")}},disableAdvancedFraudDetection:{type:Boolean}},mixins:[E],render:function(e){return e},mounted:function(){a()||console.warn(s)},methods:{redirectToCheckout:function(){var e,n;return c.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,a()){t.next=3;break}throw Error(s);case 3:return this.$emit("loading",!0),this.disableAdvancedFraudDetection&&b.setLoadParameters({advancedFraudSignals:!1}),t.next=7,c.awrap(b(this.pk));case 7:if((e=t.sent).registerAppInfo(o),!this.sessionId){t.next=12;break}return e.redirectToCheckout({sessionId:this.sessionId}),t.abrupt("return");case 12:if(!this.lineItems||!this.lineItems.length||this.mode){t.next=15;break}return console.error("Error: Property 'mode' is required when using 'lineItems'. See https://stripe.com/docs/js/checkout/redirect_to_checkout#stripe_checkout_redirect_to_checkout-options-mode"),t.abrupt("return");case 15:return n={billingAddressCollection:this.billingAddressCollection,cancelUrl:this.cancelUrl,clientReferenceId:this.clientReferenceId,customerEmail:this.customerEmail,items:this.items,lineItems:this.lineItems,locale:this.$coerced.locale,mode:this.mode,shippingAddressCollection:this.shippingAddressCollection,submitType:this.submitType,successUrl:this.successUrl},t.abrupt("return",e.redirectToCheckout(n));case 19:t.prev=19,t.t0=t.catch(0),console.error(t.t0),this.$emit("error",t.t0);case 23:case"end":return t.stop()}}),null,this,[[0,19]])}}};var w=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e};function A(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function C(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?A(Object(t),!0).forEach((function(n){w(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var x={props:{pk:{type:String,required:!0},stripeAccount:{type:String,default:void 0},apiVersion:{type:String,default:void 0},locale:{type:String,default:"auto"},elementsOptions:{type:Object,default:function(){return{}}},tokenData:{type:Object,default:function(){return{}}},disableAdvancedFraudDetection:{type:Boolean},classes:{type:Object,default:function(){return{}}},elementStyle:{type:Object,default:function(){return i}},value:{type:String,default:void 0},hidePostalCode:Boolean,iconStyle:{type:String,default:"default",validator:function(e){return["solid","default"].includes(e)}},hideIcon:Boolean,disabled:Boolean},data:function(){return{loading:!1,stripe:null,elements:null,element:null,card:null}},computed:{form:function(){return document.getElementById("stripe-element-form")}},mounted:function(){var e,n,t=this;return c.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(a()){r.next=3;break}return document.getElementById("stripe-element-mount-point").innerHTML='<p style="color: red">'.concat(s,"</p>"),r.abrupt("return");case 3:return this.disableAdvancedFraudDetection&&b.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},n={classes:this.classes,style:this.elementStyle,value:this.value,hidePostalCode:this.hidePostalCode,iconStyle:this.iconStyle,hideIcon:this.hideIcon,disabled:this.disabled},r.next=8,c.awrap(b(this.pk,e));case 8:this.stripe=r.sent,this.stripe.registerAppInfo(o),this.elements=this.stripe.elements(this.elementsOptions),this.element=this.elements.create("card",n),this.element.mount("#stripe-element-mount-point"),this.element.on("change",(function(e){var n=document.getElementById("stripe-element-errors");e.error?n.textContent=e.error.message:n.textContent="",t.onChange(e)})),this.element.on("blur",this.onBlur),this.element.on("click",this.onClick),this.element.on("escape",this.onEscape),this.element.on("focus",this.onFocus),this.element.on("ready",this.onReady),this.form.addEventListener("submit",(function(e){var n,r,i,o;return c.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,t.$emit("loading",!0),e.preventDefault(),n=C({},t.element),t.amount&&(n.amount=t.amount),s.next=7,c.awrap(t.stripe.createToken(n,t.tokenData));case 7:if(r=s.sent,i=r.token,!(o=r.error)){s.next=15;break}return document.getElementById("stripe-element-errors").textContent=o.message,t.$emit("error",o),s.abrupt("return");case 15:t.$emit("token",i),s.next=22;break;case 18:s.prev=18,s.t0=s.catch(0),console.error(s.t0),t.$emit("error",s.t0);case 22:return s.prev=22,t.$emit("loading",!1),s.finish(22);case 25:case"end":return s.stop()}}),null,null,[[0,18,22,25]])}));case 20:case"end":return r.stop()}}),null,this)},methods:{submit:function(){this.$refs.submitButtonRef.click()},clear:function(){this.element.clear()},destroy:function(){this.element.destroy()},focus:function(){console.warn("This method will currently not work on iOS 13+ due to a system limitation."),this.element.focus()},unmount:function(){this.element.unmount()},update:function(e){this.element.update(e)},onChange:function(e){this.$emit("element-change",e)},onReady:function(e){this.$emit("element-ready",e)},onFocus:function(e){this.$emit("element-focus",e)},onBlur:function(e){this.$emit("element-blur",e)},onEscape:function(e){this.$emit("element-escape",e)},onClick:function(e){this.$emit("element-click",e)}}};function k(e,n,t,r,i,o,s,a,l,c){"boolean"!=typeof s&&(l=a,a=s,s=!1);const u="function"==typeof t?t.options:t;let p;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(p=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=p):n&&(p=s?function(e){n.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){n.call(this,a(e))}),p)if(u.functional){const e=u.render;u.render=function(n,t){return p.call(t),e(n,t)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,p):[p]}return t}const O="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function _(e){return(e,n)=>(function(e,n){const t=O?n.media||"default":e,r=T[t]||(T[t]={ids:new Set,styles:[]});if(!r.ids.has(e)){r.ids.add(e);let t=n.source;if(n.map&&(t+="\n/*# sourceURL="+n.map.sources[0]+" */",t+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",n.media&&r.element.setAttribute("media",n.media),void 0===P&&(P=document.head||document.getElementsByTagName("head")[0]),P.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(t),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{const e=r.ids.size-1,n=document.createTextNode(t),i=r.element.childNodes;i[e]&&r.element.removeChild(i[e]),i.length?r.element.insertBefore(n,i[e]):r.element.appendChild(n)}}})(e,n)}let P;const T={};const $=x;var j=function(){var e=this.$createElement,n=this._self._c||e;return n("div",[n("form",{attrs:{id:"stripe-element-form"}},[n("div",{attrs:{id:"stripe-element-mount-point"}}),this._v(" "),this._t("stripe-element-errors",[n("div",{attrs:{id:"stripe-element-errors",role:"alert"}})]),this._v(" "),n("button",{ref:"submitButtonRef",staticClass:"hide",attrs:{type:"submit"}})],2)])};j._withStripped=!0;const I=k({render:j,staticRenderFns:[]},(function(e){e&&e("data-v-e001dcc2_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.StripeElement[data-v-e001dcc2] {\n box-sizing: border-box;\n\n height: 40px;\n\n padding: 10px 12px;\n\n border: 1px solid transparent;\n border-radius: 4px;\n background-color: white;\n\n box-shadow: 0 1px 3px 0 #e6ebf1;\n -webkit-transition: box-shadow 150ms ease;\n transition: box-shadow 150ms ease;\n}\n.StripeElement--focus[data-v-e001dcc2] {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n.StripeElement--invalid[data-v-e001dcc2] {\n border-color: #fa755a;\n}\n.StripeElement--webkit-autofill[data-v-e001dcc2] {\n background-color: #fefde5 !important;\n}\n.hide[data-v-e001dcc2] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Card.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiPA;;;EAGA;AACA;EACA,sBAAA;;EAEA,YAAA;;EAEA,kBAAA;;EAEA,6BAAA;EACA,kBAAA;EACA,uBAAA;;EAEA,+BAAA;EACA,yCAAA;EACA,iCAAA;AACA;AAEA;EACA,+BAAA;AACA;AAEA;EACA,qBAAA;AACA;AAEA;EACA,oCAAA;AACA;AAEA;EACA,aAAA;AACA",file:"Card.vue",sourcesContent:["<template>\n <div>\n <form id=\"stripe-element-form\">\n <div id=\"stripe-element-mount-point\" />\n <slot name=\"stripe-element-errors\">\n <div\n id=\"stripe-element-errors\"\n role=\"alert\"\n />\n </slot>\n <button\n ref=\"submitButtonRef\"\n type=\"submit\"\n class=\"hide\"\n />\n </form>\n </div>\n</template>\n\n<script>\nimport { loadStripe } from '@stripe/stripe-js/dist/pure.esm.js';\nimport { isSecureHost } from '../utils';\nimport {\n DEFAULT_ELEMENT_STYLE,\n STRIPE_PARTNER_DETAILS,\n INSECURE_HOST_ERROR_MESSAGE,\n} from '../constants';\nconst ELEMENT_TYPE = 'card';\nexport default {\n props: {\n pk: {\n type: String,\n required: true,\n },\n stripeAccount: {\n type: String,\n default: undefined,\n },\n apiVersion: {\n type: String,\n default: undefined,\n },\n locale: {\n type: String,\n default: 'auto',\n },\n elementsOptions: {\n type: Object,\n default: () => ({}),\n },\n tokenData: {\n type: Object,\n default: () => ({}),\n },\n disableAdvancedFraudDetection: {\n type: Boolean,\n },\n // element specific options\n classes: {\n type: Object,\n default: () => ({}),\n },\n elementStyle: {\n type: Object,\n default: () => (DEFAULT_ELEMENT_STYLE),\n },\n value: {\n type: String,\n default: undefined,\n },\n hidePostalCode: Boolean,\n iconStyle: {\n type: String,\n default: 'default',\n validator: value => ['solid', 'default'].includes(value),\n },\n hideIcon: Boolean,\n disabled: Boolean,\n },\n data () {\n return {\n loading: false,\n stripe: null,\n elements: null,\n element: null,\n card: null,\n };\n },\n computed: {\n form () {\n return document.getElementById('stripe-element-form');\n },\n },\n async mounted () {\n if (!isSecureHost()) {\n document.getElementById('stripe-element-mount-point').innerHTML = `<p style=\"color: red\">${INSECURE_HOST_ERROR_MESSAGE}</p>`;\n return;\n }\n\n if (this.disableAdvancedFraudDetection) loadStripe.setLoadParameters({ advancedFraudSignals: false });\n\n const stripeOptions = {\n stripeAccount: this.stripeAccount,\n apiVersion: this.apiVersion,\n locale: this.locale,\n };\n const createOptions = {\n classes: this.classes,\n style: this.elementStyle,\n value: this.value,\n hidePostalCode: this.hidePostalCode,\n iconStyle: this.iconStyle,\n hideIcon: this.hideIcon,\n disabled: this.disabled,\n };\n\n this.stripe = await loadStripe(this.pk, stripeOptions);\n this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS);\n this.elements = this.stripe.elements(this.elementsOptions);\n this.element = this.elements.create(ELEMENT_TYPE, createOptions);\n this.element.mount('#stripe-element-mount-point');\n\n this.element.on('change', (event) => {\n var displayError = document.getElementById('stripe-element-errors');\n if (event.error) {\n displayError.textContent = event.error.message;\n } else {\n displayError.textContent = '';\n }\n this.onChange(event);\n });\n\n this.element.on('blur', this.onBlur);\n this.element.on('click', this.onClick);\n this.element.on('escape', this.onEscape);\n this.element.on('focus', this.onFocus);\n this.element.on('ready', this.onReady);\n\n this.form.addEventListener('submit', async (event) => {\n try {\n this.$emit('loading', true);\n event.preventDefault();\n const data = {\n ...this.element,\n };\n if (this.amount) data.amount = this.amount;\n const { token, error } = await this.stripe.createToken(data, this.tokenData);\n if (error) {\n const errorElement = document.getElementById('stripe-element-errors');\n errorElement.textContent = error.message;\n this.$emit('error', error);\n return;\n }\n this.$emit('token', token);\n } catch (error) {\n console.error(error);\n this.$emit('error', error);\n } finally {\n this.$emit('loading', false);\n }\n });\n },\n methods: {\n /**\n * Triggers the submission of the form\n * @return {void}\n */\n submit () {\n this.$refs.submitButtonRef.click();\n },\n /**\n * Clears the element\n * @return {void}\n */\n clear () {\n this.element.clear();\n },\n /**\n * Destroys the element\n * @return {void}\n */\n destroy () {\n this.element.destroy();\n },\n /**\n * Focuses on the element\n * @return {void}\n */\n focus () {\n console.warn('This method will currently not work on iOS 13+ due to a system limitation.');\n this.element.focus();\n },\n /**\n * Unmounts the element\n * @return {void}\n */\n unmount () {\n this.element.unmount();\n },\n /**\n * Updates the element\n * @param {string} opts.classes.base The base class applied to the container. Defaults to StripeElement.\n * @param {string} opts.classes.complete The class name to apply when the Element is complete. Defaults to StripeElement--complete.\n * @param {string} opts.classes.empty The class name to apply when the Element is empty. Defaults to StripeElement--empty.\n * @param {string} opts.classes.focus The class name to apply when the Element is focused. Defaults to StripeElement--focus.\n * @param {string} opts.classes.invalid The class name to apply when the Element is invalid. Defaults to StripeElement--invalid.\n * @param {string} opts.classes.webkitAutoFill The class name to apply when the Element has its value autofilled by the browser (only on Chrome and Safari). Defaults to StripeElement--webkit-autofill.\n * @param {Object} opts.style Customize the appearance of this element using CSS properties passed in a Style object.\n * @param {string} opts.value A pre-filled set of values to include in the input (e.g., {postalCode: '94110'}). Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled\n * @param {boolean} opts.hidePostalCode Hide the postal code field. Default is false. If you are already collecting a full billing address or postal code elsewhere, set this to true.\n * @param {string} opts.iconStyle Appearance of the icon in the Element. Either solid or default.\n * @param {boolean} opts.hideIcon Hides the icon in the Element. Default is false.\n * @param {boolean} opts.disabled Applies a disabled state to the Element such that user input is not accepted. Default is false.\n */\n update (opts) {\n this.element.update(opts);\n },\n // events\n onChange (e) {\n this.$emit('element-change', e);\n },\n onReady (e) {\n this.$emit('element-ready', e);\n },\n onFocus (e) {\n this.$emit('element-focus', e);\n },\n onBlur (e) {\n this.$emit('element-blur', e);\n },\n onEscape (e) {\n this.$emit('element-escape', e);\n },\n onClick (e) {\n this.$emit('element-click', e);\n },\n },\n};\n<\/script>\n\n<style scoped>\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.StripeElement {\n box-sizing: border-box;\n\n height: 40px;\n\n padding: 10px 12px;\n\n border: 1px solid transparent;\n border-radius: 4px;\n background-color: white;\n\n box-shadow: 0 1px 3px 0 #e6ebf1;\n -webkit-transition: box-shadow 150ms ease;\n transition: box-shadow 150ms ease;\n}\n\n.StripeElement--focus {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n\n.StripeElement--invalid {\n border-color: #fa755a;\n}\n\n.StripeElement--webkit-autofill {\n background-color: #fefde5 !important;\n}\n\n.hide {\n display: none;\n}\n</style>\n"]},media:void 0})}),$,"data-v-e001dcc2",!1,void 0,!1,_,void 0,void 0);const L={props:{pk:{type:String,required:!0},elementsOptions:{type:Object,required:!0,default:function(){return{}}},confirmParams:{type:Object,required:!0,default:function(){return{}}},createOptions:{type:Object,default:function(){return{}}},stripeAccount:{type:String,default:void 0},apiVersion:{type:String,default:void 0},locale:{type:String,default:"auto"},disableAdvancedFraudDetection:{type:Boolean}},data:function(){return{loading:!1,stripe:null,elements:null,element:null}},computed:{form:function(){return document.getElementById("stripe-payment-element-form")}},mounted:function(){var e,n=this;return c.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(a()){t.next=3;break}return document.getElementById("stripe-payment-element-mount-point").innerHTML='<p style="color: red">'.concat(s,"</p>"),t.abrupt("return");case 3:return this.disableAdvancedFraudDetection&&b.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},t.next=7,c.awrap(b(this.pk,e));case 7:this.stripe=t.sent,this.stripe.registerAppInfo(o),this.elements=this.stripe.elements(this.elementsOptions),this.element=this.elements.create("payment",this.createOptions),this.element.mount("#stripe-payment-element-mount-point"),this.element.on("change",(function(e){var t=document.getElementById("stripe-payment-element-errors");e.error?t.textContent=e.error.message:t.textContent="",n.onChange(e)})),this.element.on("blur",this.onBlur),this.element.on("click",this.onClick),this.element.on("escape",this.onEscape),this.element.on("focus",this.onFocus),this.element.on("ready",this.onReady),this.form.addEventListener("submit",(function(e){var t,r;return c.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,n.$emit("loading",!0),e.preventDefault(),i.next=5,c.awrap(n.stripe.confirmPayment({elements:n.elements,confirmParams:n.confirmParams}));case 5:if(t=i.sent,!(r=t.error)){i.next=12;break}return document.getElementById("stripe-payment-element-errors").textContent=r.message,n.$emit("error",r),i.abrupt("return");case 12:i.next=18;break;case 14:i.prev=14,i.t0=i.catch(0),console.error(i.t0),n.$emit("error",i.t0);case 18:return i.prev=18,n.$emit("loading",!1),i.finish(18);case 21:case"end":return i.stop()}}),null,null,[[0,14,18,21]])}));case 19:case"end":return t.stop()}}),null,this)},methods:{submit:function(){this.$refs.submitButtonRef.click()},clear:function(){this.element.clear()},destroy:function(){this.element.destroy()},focus:function(){console.warn("This method will currently not work on iOS 13+ due to a system limitation."),this.element.focus()},collapse:function(){this.element.collapse()},getElement:function(){this.element.getElement()},unmount:function(){this.element.unmount()},update:function(e){this.element.update(e)},onChange:function(e){this.$emit("element-change",e)},onReady:function(e){this.$emit("element-ready",e)},onFocus:function(e){this.$emit("element-focus",e)},onBlur:function(e){this.$emit("element-blur",e)},onEscape:function(e){this.$emit("element-escape",e)},onClick:function(e){this.$emit("element-click",e)}}};var R=function(){var e=this.$createElement,n=this._self._c||e;return n("div",[n("form",{attrs:{id:"stripe-payment-element-form"}},[n("div",{attrs:{id:"stripe-payment-element-mount-point"}}),this._v(" "),this._t("stripe-payment-element-errors",[n("div",{attrs:{id:"stripe-payment-element-errors",role:"alert"}})]),this._v(" "),n("button",{ref:"submitButtonRef",staticClass:"hide",attrs:{type:"submit"}})],2)])};R._withStripped=!0;const B=k({render:R,staticRenderFns:[]},(function(e){e&&e("data-v-865458b2_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.hide[data-v-865458b2] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Payment.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyPA;;;EAGA;AACA;EACA,aAAA;AACA",file:"Payment.vue",sourcesContent:["<template>\n <div>\n <form id=\"stripe-payment-element-form\">\n <div id=\"stripe-payment-element-mount-point\" />\n <slot name=\"stripe-payment-element-errors\">\n <div\n id=\"stripe-payment-element-errors\"\n role=\"alert\"\n />\n </slot>\n <button\n ref=\"submitButtonRef\"\n type=\"submit\"\n class=\"hide\"\n />\n </form>\n </div>\n</template>\n\n<script>\nimport { loadStripe } from '@stripe/stripe-js/dist/pure.esm.js';\nimport { isSecureHost } from '../utils';\nimport {\n STRIPE_PARTNER_DETAILS,\n INSECURE_HOST_ERROR_MESSAGE,\n} from '../constants';\nconst ELEMENT_TYPE = 'payment';\nexport default {\n props: {\n pk: {\n type: String,\n required: true,\n },\n elementsOptions: {\n type: Object,\n required: true,\n default: () => ({}),\n },\n confirmParams: {\n type: Object,\n required: true,\n default: () => ({}),\n },\n createOptions: {\n type: Object,\n default: () => ({}),\n },\n stripeAccount: {\n type: String,\n default: undefined,\n },\n apiVersion: {\n type: String,\n default: undefined,\n },\n locale: {\n type: String,\n default: 'auto',\n },\n disableAdvancedFraudDetection: {\n type: Boolean,\n },\n },\n data () {\n return {\n loading: false,\n stripe: null,\n elements: null,\n element: null,\n };\n },\n computed: {\n form () {\n return document.getElementById('stripe-payment-element-form');\n },\n },\n async mounted () {\n if (!isSecureHost()) {\n document.getElementById(\n 'stripe-payment-element-mount-point',\n ).innerHTML = `<p style=\"color: red\">${INSECURE_HOST_ERROR_MESSAGE}</p>`;\n return;\n }\n\n if (this.disableAdvancedFraudDetection) {\n loadStripe.setLoadParameters({ advancedFraudSignals: false });\n }\n\n const stripeOptions = {\n stripeAccount: this.stripeAccount,\n apiVersion: this.apiVersion,\n locale: this.locale,\n };\n\n this.stripe = await loadStripe(this.pk, stripeOptions);\n this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS);\n\n this.elements = this.stripe.elements(this.elementsOptions);\n this.element = this.elements.create(ELEMENT_TYPE, this.createOptions);\n this.element.mount('#stripe-payment-element-mount-point');\n\n this.element.on('change', event => {\n var displayError = document.getElementById(\n 'stripe-payment-element-errors',\n );\n if (event.error) {\n displayError.textContent = event.error.message;\n } else {\n displayError.textContent = '';\n }\n this.onChange(event);\n });\n\n this.element.on('blur', this.onBlur);\n this.element.on('click', this.onClick);\n this.element.on('escape', this.onEscape);\n this.element.on('focus', this.onFocus);\n this.element.on('ready', this.onReady);\n\n this.form.addEventListener('submit', async event => {\n try {\n this.$emit('loading', true);\n event.preventDefault();\n const { error } = await this.stripe.confirmPayment({\n elements: this.elements,\n confirmParams: this.confirmParams,\n });\n if (error) {\n const errorElement = document.getElementById(\n 'stripe-payment-element-errors',\n );\n errorElement.textContent = error.message;\n this.$emit('error', error);\n return;\n }\n } catch (error) {\n console.error(error);\n this.$emit('error', error);\n } finally {\n this.$emit('loading', false);\n }\n });\n },\n methods: {\n /**\n * Triggers the submission of the form\n * @return {void}\n */\n submit () {\n this.$refs.submitButtonRef.click();\n },\n /**\n * Clears the element\n * @return {void}\n */\n clear () {\n this.element.clear();\n },\n /**\n * Destroys the element\n * @return {void}\n */\n destroy () {\n this.element.destroy();\n },\n /**\n * Focuses on the element\n * @return {void}\n */\n focus () {\n console.warn(\n 'This method will currently not work on iOS 13+ due to a system limitation.',\n );\n this.element.focus();\n },\n /**\n * Collapses the Payment Element into a row of payment method tabs\n * @return {void}\n */\n collapse () {\n this.element.collapse();\n },\n /**\n * Retrieves a previously created element\n */\n getElement () {\n this.element.getElement();\n },\n /**\n * Unmounts the element\n * @return {void}\n */\n unmount () {\n this.element.unmount();\n },\n /**\n * Updates the element. See official docs for more detail: https://site-admin.stripe.com/docs/js/elements_object/update_payment_element\n * @param {string} opts.business.name Information about your business that will be displayed in the Payment Element. This information will be retrieved from the Stripe account if not provided.\n * @param {array} opts.paymentMethodOrder Sets order in which payment methods are displayed. Otherwise payment methods are ordered dynamically to optimize for conversion.\n * @param {string | Object} opts.fields.billingDetails The Payment Element automatically creates input fields to collect required billing information for some payment methods like SEPA debit. Specify 'never' to avoid collecting billing details in the Payment Element if you're collecting them outside of the Payment Element.\n * @param {string} opts.fields.billingDetails.name Specify 'never' to avoid collecting a name as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.email Specify 'never' to avoid collecting an email address as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.phone Specify 'never' to avoid collecting a phone number as part of the billing details in the Payment Element.\n * @param {string | Object} opts.fields.billingDetails.address Specify 'never' to avoid collecting an address as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.line1 Specify 'never' to avoid collecting an address line1 as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.line2 Specify 'never' to avoid collecting an address line2 as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.city Specify 'never' to avoid collecting an address city as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.state Specify 'never' to avoid collecting an address state as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.country Specify 'never' to avoid collecting an address country as part of the billing details in the Payment Element.\n * @param {string} opts.fields.billingDetails.address.postalCode Specify 'never' to avoid collecting an address postal code as part of the billing details in the Payment Element.\n * @param {string} opts.fields.terms The Payment Element automatically displays mandates or other legal agreements when required by the payment method, like SEPA debit. Specify 'never' to never show legal agreements.\n * @param {string} opts.fields.terms.auBecsDebit Specify 'never' to never show legal agreements for the BECS Debit payment method.\n * @param {string} opts.fields.terms.bancontact Specify 'never' to never show legal agreements for the Bancontact payment method.\n * @param {string} opts.fields.terms.card Specify 'never' to never show legal agreements for the credit card payment method.\n * @param {string} opts.fields.terms.ideal Specify 'never' to never show legal agreements for the iDEAL payment method.\n * @param {string} opts.fields.terms.sepaDebit Specify 'never' to never show legal agreements for the SEPA Debit payment method.\n * @param {string} opts.fields.terms.sofort Specify 'never' to never show legal agreements for the SOFORT payment method.\n * @param {string} opts.fields.terms.usBankAccount Specify 'never' to never show legal agreements for the US Bank accounts payment method.\n * @param {string} opts.wallets Specify 'never' to never show digital wallet payment methods like Apple Pay and Google Pay.\n * @param {string} opts.wallets.applePay Specify 'never' to never show the Apple Pay digital wallet payment method.\n * @param {string} opts.wallets.googlePay Specify 'never' to never show the Google Pay digital wallet payment method.\n */\n update (opts) {\n this.element.update(opts);\n },\n // events\n onChange (e) {\n this.$emit('element-change', e);\n },\n onReady (e) {\n this.$emit('element-ready', e);\n },\n onFocus (e) {\n this.$emit('element-focus', e);\n },\n onBlur (e) {\n this.$emit('element-blur', e);\n },\n onEscape (e) {\n this.$emit('element-escape', e);\n },\n onClick (e) {\n this.$emit('element-click', e);\n },\n },\n};\n<\/script>\n\n<style scoped>\n/**\n * The CSS shown here will not be introduced in the Quickstart guide, but shows\n * how you can use CSS to style your Element's container.\n */\n.hide {\n display: none;\n}\n</style>\n"]},media:void 0})}),L,"data-v-865458b2",!1,void 0,!1,_,void 0,void 0);var D={install:function(e,n){var t,r,i,s,a,l,u;return c.async((function(c){for(;;)switch(c.prev=c.next){case 0:t=n.pk,r=n.stripeAccount,i=n.apiVersion,s=n.locale,a=n.elementsOptions,(l=window.Stripe(t,{stripeAccount:r,apiVersion:i,locale:s})).registerAppInfo(o),u=l.elements(a),e.prototype.$stripe=l,e.prototype.$stripeElements=u;case 6:case"end":return c.stop()}}))}};e.StripeCheckout=S,e.StripeElementCard=I,e.StripeElementPayment=B,e.StripeElementsPlugin=D,e.StripePlugin=l,Object.defineProperty(e,"__esModule",{value:!0})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-stripe/vue-stripe",
3
- "version": "4.2.8",
3
+ "version": "4.3.3",
4
4
  "description": "Stripe Checkout & Elements for Vue.js",
5
5
  "author": "jofftiquez@gmail.com",
6
6
  "scripts": {
@@ -27,7 +27,7 @@ export class StripeCheckout extends Vue {
27
27
  sessionId?: string;
28
28
  locale: string;
29
29
  shippingAddressCollection?: any;
30
- disableAdvancedFarudDetection: boolean;
30
+ disableAdvancedFraudDetection: boolean;
31
31
 
32
32
  redirectToCheckout(): void;
33
33
  }
@@ -59,3 +59,15 @@ export class StripeElementCard extends Vue {
59
59
  value?: string;
60
60
  hidePostalCode: boolean;
61
61
  }
62
+
63
+ export class StripeElementPayment extends Vue {
64
+ pk: string;
65
+ elementsOptions: any;
66
+ confirmParams: any;
67
+ createOptions: any;
68
+ redirect?: string;
69
+ stripeAccount?: string;
70
+ apiVersion?: string;
71
+ locale?: string;
72
+ disableAdvancedFraudDetection?: boolean;
73
+ }