@vue-stripe/vue-stripe 4.4.0 → 4.4.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.
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:"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(e){return!!e||("localhost"===window.location.hostname||"https:"===window.location.protocol)},index={install:function(e,n){isSecureHost(n.testMode)||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===p)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=p;var l=c(e,n,t);if("normal"===l.type){if(r=t.done?m:d,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",d="suspendedYield",p="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)};
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"},index={install:function(e,n){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 T(r||[]);return o._invoke=function(e,n,t){var r=d;return function(i,o){if(r===u)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===d)throw r=m,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);r=u;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 d="suspendedStart",p="suspendedYield",u="executing",m="completed",h={};function f(){}function y(){}function v(){}var g={};g[o]=function(){return this};var E=Object.getPrototypeOf,_=E&&E(E(x([])));_&&_!==t&&r.call(_,o)&&(g=_);var S=v.prototype=f.prototype=Object.create(g);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,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?Promise.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):Promise.resolve(d).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 P(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(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=x,T.prototype={constructor:T,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(P),!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),P(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;P(t)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(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(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},testMode:{type:Boolean,default:!1},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(this.testMode)){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 d;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(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(o)},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}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-44ec472e_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 * 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-44ec472e] {\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-44ec472e] {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n.StripeElement--invalid[data-v-44ec472e] {\n border-color: #fa755a;\n}\n.StripeElement--webkit-autofill[data-v-44ec472e] {\n background-color: #fefde5 !important;\n}\n.hide[data-v-44ec472e] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Card.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqPA;;;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 testMode: {\n type: Boolean,\n default: false,\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(this.testMode)) {\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-44ec472e",__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},testMode:{type:Boolean,default:!1},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(this.testMode)){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-a00a8e42_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\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-a00a8e42] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Payment.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6PA;;;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 testMode: {\n type: Boolean,\n default: false,\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(this.testMode)) {\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-a00a8e42",__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-a00a8e42",!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;
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},stripeAccount:{type:String,default:void 0},apiVersion:{type:String,default:void 0},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},stripeOptions:{type:Object,default:null}},index$2={props:props,mixins:[index$1],render:function(e){return e},methods:{redirectToCheckout:function(){var e,n,t;return regenerator.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,this.$emit("loading",!0),this.disableAdvancedFraudDetection&&loadStripe.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},r.next=6,regenerator.awrap(loadStripe(this.pk,e));case 6:if((n=r.sent).registerAppInfo(STRIPE_PARTNER_DETAILS),!this.sessionId){r.next=11;break}return n.redirectToCheckout({sessionId:this.sessionId}),r.abrupt("return");case 11:if(!this.lineItems||!this.lineItems.length||this.mode){r.next=14;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"),r.abrupt("return");case 14:return 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},r.abrupt("return",n.redirectToCheckout(t));case 18:r.prev=18,r.t0=r.catch(0),console.error(r.t0),this.$emit("error",r.t0);case 22:case"end":return r.stop()}}),null,this,[[0,18]])}}};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},testMode:{type:Boolean,default:!1},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: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=5,regenerator.awrap(loadStripe(this.pk,e));case 5: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 17: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 d="function"==typeof t?t.options:t;let p;if(e&&e.render&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),r&&(d._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)},d._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(d.functional){const e=d.render;d.render=function(n,t){return p.call(t),e(n,t)}}else{const e=d.beforeCreate;d.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-4dd8360e_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 * 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-4dd8360e] {\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-4dd8360e] {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n.StripeElement--invalid[data-v-4dd8360e] {\n border-color: #fa755a;\n}\n.StripeElement--webkit-autofill[data-v-4dd8360e] {\n background-color: #fefde5 !important;\n}\n.hide[data-v-4dd8360e] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Card.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsPA;;;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';\n// import { 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 testMode: {\n type: Boolean,\n default: false,\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 // FIXME: temporarily remove to avoid problems with remote non-production deployments\n // if (!isSecureHost(this.testMode)) {\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-4dd8360e",__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},testMode:{type:Boolean,default:!1},elementsOptions:{type:Object,required:!0,default:function(){return{}}},confirmParams:{type:Object,required:!0,default:function(){return{}}},redirect:{type:String,default:"always"},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:return this.disableAdvancedFraudDetection&&loadStripe.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},t.next=4,regenerator.awrap(loadStripe(this.pk,e));case 4: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,redirect:n.redirect}));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 16: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-3329b3f8_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\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-3329b3f8] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Payment.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmQA;;;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';\n// import { 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 testMode: {\n type: Boolean,\n default: false,\n },\n elementsOptions: {\n type: Object,\n required: true,\n default: () => ({}),\n },\n confirmParams: {\n type: Object,\n required: true,\n default: () => ({}),\n },\n redirect: {\n type: String,\n default: 'always',\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 // FIXME: temporarily remove to avoid problems with remote non-production deployments\n // if (!isSecureHost(this.testMode)) {\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 redirect: this.redirect,\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-3329b3f8",__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-3329b3f8",!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"],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(e){return!!e||("localhost"===window.location.hostname||"https:"===window.location.protocol)},l={install:function(e,n){a(n.testMode)||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)};
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={install:function(e,n){var t=n.pk,r=n.stripeAccount,i=n.apiVersion,s=n.locale,a=window.Stripe(t,{stripeAccount:r,apiVersion:i,locale:s});a.registerAppInfo(o),e.prototype.$stripe=a}};var a=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===p)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=p;var l=c(e,n,t);if("normal"===l.type){if(r=t.done?m:d,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",d="suspendedYield",p="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 A(e){["next","throw","return"].forEach((function(n){e[n]=function(e){return this._invoke(n,e)}}))}function w(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}},A(w.prototype),w.prototype[s]=function(){return this},e.AsyncIterator=w,e.async=function(n,t,r,i){var o=new w(l(n,t,r,i));return e.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},A(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 l(e){return(l="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 c,u="https://js.stripe.com/v3",d=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,p="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",m=null,h=function(e){return null!==m?m:m=new Promise((function(n,t){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(p),window.Stripe)n(window.Stripe);else try{var r=function(){for(var e=document.querySelectorAll('script[src^="'.concat(u,'"]')),n=0;n<e.length;n++){var t=e[n];if(d.test(t.src))return t}return null}();r&&e?console.warn(p):r||(r=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(u).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)}))},f=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},y=!1,v=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];y=!0;var r=Date.now();return h(c).then((function(e){return f(e,n,r)}))};v.setLoadParameters=function(e){if(y)throw new Error("You cannot change load parameters after calling loadStripe");c=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"!==l(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],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},testMode:{type:Boolean,default:!1},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(this.testMode)){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 B=k({render:j,staticRenderFns:[]},(function(e){e&&e("data-v-44ec472e_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 * 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-44ec472e] {\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-44ec472e] {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n.StripeElement--invalid[data-v-44ec472e] {\n border-color: #fa755a;\n}\n.StripeElement--webkit-autofill[data-v-44ec472e] {\n background-color: #fefde5 !important;\n}\n.hide[data-v-44ec472e] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Card.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqPA;;;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 testMode: {\n type: Boolean,\n default: false,\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(this.testMode)) {\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-44ec472e",!1,void 0,!1,_,void 0,void 0);const I={props:{pk:{type:String,required:!0},testMode:{type:Boolean,default:!1},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(this.testMode)){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 L=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)])};L._withStripped=!0;const R=k({render:L,staticRenderFns:[]},(function(e){e&&e("data-v-a00a8e42_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\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-a00a8e42] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Payment.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6PA;;;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 testMode: {\n type: Boolean,\n default: false,\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(this.testMode)) {\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})}),I,"data-v-a00a8e42",!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=B,e.StripeElementPayment=R,e.StripeElementsPlugin=D,e.StripePlugin=l,Object.defineProperty(e,"__esModule",{value:!0})}));
7
+ var g={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}),{})}}},b={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},stripeAccount:{type:String,default:void 0},apiVersion:{type:String,default:void 0},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},stripeOptions:{type:Object,default:null}},mixins:[g],render:function(e){return e},methods:{redirectToCheckout:function(){var e,n,t;return a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,this.$emit("loading",!0),this.disableAdvancedFraudDetection&&v.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},r.next=6,a.awrap(v(this.pk,e));case 6:if((n=r.sent).registerAppInfo(o),!this.sessionId){r.next=11;break}return n.redirectToCheckout({sessionId:this.sessionId}),r.abrupt("return");case 11:if(!this.lineItems||!this.lineItems.length||this.mode){r.next=14;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"),r.abrupt("return");case 14:return 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},r.abrupt("return",n.redirectToCheckout(t));case 18:r.prev=18,r.t0=r.catch(0),console.error(r.t0),this.$emit("error",r.t0);case 22:case"end":return r.stop()}}),null,this,[[0,18]])}}};var E=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 A(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){E(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 w={props:{pk:{type:String,required:!0},testMode:{type:Boolean,default:!1},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 a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return this.disableAdvancedFraudDetection&&v.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=5,a.awrap(v(this.pk,e));case 5: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 a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,t.$emit("loading",!0),e.preventDefault(),n=A({},t.element),t.amount&&(n.amount=t.amount),s.next=7,a.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 17: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 C(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 d;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(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(o)},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}const x="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function k(e){return(e,n)=>(function(e,n){const t=x?n.media||"default":e,r=_[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===O&&(O=document.head||document.getElementsByTagName("head")[0]),O.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 O;const _={};const P=w;var T=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)])};T._withStripped=!0;const $=C({render:T,staticRenderFns:[]},(function(e){e&&e("data-v-4dd8360e_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 * 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-4dd8360e] {\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-4dd8360e] {\n box-shadow: 0 1px 3px 0 #cfd7df;\n}\n.StripeElement--invalid[data-v-4dd8360e] {\n border-color: #fa755a;\n}\n.StripeElement--webkit-autofill[data-v-4dd8360e] {\n background-color: #fefde5 !important;\n}\n.hide[data-v-4dd8360e] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Card.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsPA;;;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';\n// import { 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 testMode: {\n type: Boolean,\n default: false,\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 // FIXME: temporarily remove to avoid problems with remote non-production deployments\n // if (!isSecureHost(this.testMode)) {\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})}),P,"data-v-4dd8360e",!1,void 0,!1,k,void 0,void 0);const j={props:{pk:{type:String,required:!0},testMode:{type:Boolean,default:!1},elementsOptions:{type:Object,required:!0,default:function(){return{}}},confirmParams:{type:Object,required:!0,default:function(){return{}}},redirect:{type:String,default:"always"},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 a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return this.disableAdvancedFraudDetection&&v.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},t.next=4,a.awrap(v(this.pk,e));case 4: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 a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,n.$emit("loading",!0),e.preventDefault(),i.next=5,a.awrap(n.stripe.confirmPayment({elements:n.elements,confirmParams:n.confirmParams,redirect:n.redirect}));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 16: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 B=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)])};B._withStripped=!0;const I=C({render:B,staticRenderFns:[]},(function(e){e&&e("data-v-3329b3f8_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\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-3329b3f8] {\n display: none;\n}\n",map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Payment.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmQA;;;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';\n// import { 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 testMode: {\n type: Boolean,\n default: false,\n },\n elementsOptions: {\n type: Object,\n required: true,\n default: () => ({}),\n },\n confirmParams: {\n type: Object,\n required: true,\n default: () => ({}),\n },\n redirect: {\n type: String,\n default: 'always',\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 // FIXME: temporarily remove to avoid problems with remote non-production deployments\n // if (!isSecureHost(this.testMode)) {\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 redirect: this.redirect,\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})}),j,"data-v-3329b3f8",!1,void 0,!1,k,void 0,void 0);var R={install:function(e,n){var t,r,i,s,l,c,u;return a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t=n.pk,r=n.stripeAccount,i=n.apiVersion,s=n.locale,l=n.elementsOptions,(c=window.Stripe(t,{stripeAccount:r,apiVersion:i,locale:s})).registerAppInfo(o),u=c.elements(l),e.prototype.$stripe=c,e.prototype.$stripeElements=u;case 6:case"end":return a.stop()}}))}};e.StripeCheckout=b,e.StripeElementCard=$,e.StripeElementPayment=I,e.StripeElementsPlugin=R,e.StripePlugin=s,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.4.0",
3
+ "version": "4.4.3",
4
4
  "description": "Stripe Checkout & Elements for Vue.js",
5
5
  "author": "jofftiquez@gmail.com",
6
6
  "scripts": {