1import{_ as we}from"./AppLayout-O2AsCwpr.js";import{Q as Ae,Z as xe,B as $,d as k,b as z,w as ke,F as le,o as E,c as ne,e as W,a as f,n as Ce,t as D,f as ce,g as Oe}from"./app-BYIh5UPV.js";import{_ as Pe}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{a as Te,r as Ie}from"./XCircleIcon-Dc_WvUKs.js";import{r as Le}from"./CheckIcon-CODc4j5B.js";import{Y as je,_ as Re,V as Be,h as $e,S as De}from"./transition-CtwOiHEw.js";import"./ExclamationTriangleIcon-DhEhqBt3.js";import"./hidden-C88IvNmj.js";import"./keyboard-CqIrqyxx.js";import"./open-closed-CSlRTajc.js";var F={};const Fe="@vue-stripe/vue-stripe",Ne="4.5.0",Me="Stripe Checkout & Elements for Vue.js",Ue="[email protected]",Ve={build:"rollup -c",lint:"vue-cli-service lint --fix",prebuild:"rimraf dist",test:"jest"},qe="dist/index.js",Ge="dist",He={"@stripe/stripe-js":"^1.13.2","vue-coerce-props":"^1.0.0"},Ye={"@babel/cli":"^7.7.5","@babel/core":"^7.7.5","@babel/plugin-proposal-export-default-from":"^7.7.4","@babel/plugin-proposal-optional-chaining":"^7.10.4","@babel/plugin-transform-runtime":"^7.7.5","@babel/preset-env":"^7.7.5","@babel/preset-es2015":"^7.0.0-beta.53","@babel/runtime":"^7.7.5","@rollup/plugin-node-resolve":"^6.0.0","@vue/cli-plugin-eslint":"~4.5.0","@vue/cli-service":"^4.5.10","@vue/eslint-config-standard":"^5.1.2","babel-eslint":"^10.1.0","babel-minify":"^0.5.1","cross-env":"^6.0.3",eslint:"^6.8.0","eslint-plugin-import":"^2.20.2","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.0","eslint-plugin-vue":"^6.2.2",jest:"^24.9.0","lint-staged":"^9.5.0",rimraf:"^3.0.0",rollup:"^1.27.9","rollup-plugin-babel":"^4.3.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-postcss":"^2.0.3","rollup-plugin-terser":"^5.1.3","rollup-plugin-uglify":"^6.0.3","rollup-plugin-vue":"^5.1.4","vue-template-compiler":"^2.6.11"},ze={url:"https://github.com/vue-stripe/vue-stripe/issues"},We={"pre-commit":"lint-staged"},Qe="https://github.com/vue-stripe/vue-stripe#readme",Xe=["vue","vuejs","stripe","checkout","payment"],Ke="MIT",Je={type:"git",url:"[email protected]:vue-stripe/vue-stripe.git"},Ze="typings/index.d.ts",en={name:Fe,version:Ne,description:Me,author:Ue,scripts:Ve,main:qe,module:Ge,dependencies:He,devDependencies:Ye,bugs:ze,gitHooks:We,homepage:Qe,keywords:Xe,license:Ke,"lint-staged":{"*.{js,jsx,vue}":["vue-cli-service lint","git add"]},repository:Je,typings:Ze};var me;Object.defineProperty(F,"__esModule",{value:!0});var te="auto",nn=["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"],tn=["auto","book","donate","pay"],rn=["required","auto"],on={base:{color:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},sn=en.version,U={name:"vue-stripe",version:sn,url:"https://vuestripe.com",partner_id:"pp_partner_IqtOXpBSuz0IE2"},an={install:function(e,n){var t=n.pk,r=n.stripeAccount,a=n.apiVersion,p=n.locale,h=window.Stripe(t,{stripeAccount:r,apiVersion:a,locale:p});h.registerAppInfo(U),e.prototype.$stripe=h}};function ln(e,n){return e(n={exports:{}},n.exports),n.exports}var cn=ln(function(e){var n=function(t){var r,a=Object.prototype,p=a.hasOwnProperty,h=typeof Symbol=="function"?Symbol:{},c=h.iterator||"@@iterator",S=h.asyncIterator||"@@asyncIterator",d=h.toStringTag||"@@toStringTag";function g(o,i,l,u){var s=i&&i.prototype instanceof Q?i:Q,v=Object.create(s.prototype),j=new Z(u||[]);return v._invoke=function(O,M,m){var _=y;return function(P,R){if(_===N)throw new Error("Generator is already running");if(_===q){if(P==="throw")throw R;return ae()}for(m.method=P,m.arg=R;;){var B=m.delegate;if(B){var C=se(B,m);if(C){if(C===A)continue;return C}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(_===y)throw _=q,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);_=N;var b=w(O,M,m);if(b.type==="normal"){if(_=m.done?q:V,b.arg===A)continue;return{value:b.arg,done:m.done}}b.type==="throw"&&(_=q,m.method="throw",m.arg=b.arg)}}}(o,l,j),v}function w(o,i,l){try{return{type:"normal",arg:o.call(i,l)}}catch(u){return{type:"throw",arg:u}}}t.wrap=g;var y="suspendedStart",V="suspendedYield",N="executing",q="completed",A={};function Q(){}function G(){}function I(){}var X={};X[c]=function(){return this};var K=Object.getPrototypeOf,H=K&&K(K(ee([])));H&&H!==a&&p.call(H,c)&&(X=H);var L=I.prototype=Q.prototype=Object.create(X);function oe(o){["next","throw","return"].forEach(function(i){o[i]=function(l){return this._invoke(i,l)}})}function Y(o){var i;this._invoke=function(l,u){function s(){return new Promise(function(v,j){(function O(M,m,_,P){var R=w(o[M],o,m);if(R.type!=="throw"){var B=R.arg,C=B.value;return C&&typeof C=="object"&&p.call(C,"__await")?Promise.resolve(C.__await).then(function(b){O("next",b,_,P)},function(b){O("throw",b,_,P)}):Promise.resolve(C).then(function(b){B.value=b,_(B)},function(b){return O("throw",b,_,P)})}P(R.arg)})(l,u,v,j)})}return i=i?i.then(s,s):s()}}function se(o,i){var l=o.iterator[i.method];if(l===r){if(i.delegate=null,i.method==="throw"){if(o.iterator.return&&
1(i.method="return",i.arg=r,se(o,i),i.method==="throw"))return A;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var u=w(l,o.iterator,i.arg);if(u.type==="throw")return i.method="throw",i.arg=u.arg,i.delegate=null,A;var s=u.arg;return s?s.done?(i[o.resultName]=s.value,i.next=o.nextLoc,i.method!=="return"&&(i.method="next",i.arg=r),i.delegate=null,A):s:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,A)}function _e(o){var i={tryLoc:o[0]};1 in o&&(i.catchLoc=o[1]),2 in o&&(i.finallyLoc=o[2],i.afterLoc=o[3]),this.tryEntries.push(i)}function J(o){var i=o.completion||{};i.type="normal",delete i.arg,o.completion=i}function Z(o){this.tryEntries=[{tryLoc:"root"}],o.forEach(_e,this),this.reset(!0)}function ee(o){if(o){var i=o[c];if(i)return i.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length)){var l=-1,u=function s(){for(;++l<o.length;)if(p.call(o,l))return s.value=o[l],s.done=!1,s;return s.value=r,s.done=!0,s};return u.next=u}}return{next:ae}}function ae(){return{value:r,done:!0}}return G.prototype=L.constructor=I,I.constructor=G,I[d]=G.displayName="GeneratorFunction",t.isGeneratorFunction=function(o){var i=typeof o=="function"&&o.constructor;return!!i&&(i===G||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(o){return Object.setPrototypeOf?Object.setPrototypeOf(o,I):(o.__proto__=I,d in o||(o[d]="GeneratorFunction")),o.prototype=Object.create(L),o},t.awrap=function(o){return{__await:o}},oe(Y.prototype),Y.prototype[S]=function(){return this},t.AsyncIterator=Y,t.async=function(o,i,l,u){var s=new Y(g(o,i,l,u));return t.isGeneratorFunction(i)?s:s.next().then(function(v){return v.done?v.value:s.next()})},oe(L),L[d]="Generator",L[c]=function(){return this},L.toString=function(){return"[object Generator]"},t.keys=function(o){var i=[];for(var l in o)i.push(l);return i.reverse(),function u(){for(;i.length;){var s=i.pop();if(s in o)return u.value=s,u.done=!1,u}return u.done=!0,u}},t.values=ee,Z.prototype={constructor:Z,reset:function(o){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(J),!o)for(var i in this)i.charAt(0)==="t"&&p.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=r)},stop:function(){this.done=!0;var o=this.tryEntries[0].completion;if(o.type==="throw")throw o.arg;return this.rval},dispatchException:function(o){if(this.done)throw o;var i=this;function l(M,m){return v.type="throw",v.arg=o,i.next=M,m&&(i.method="next",i.arg=r),!!m}for(var u=this.tryEntries.length-1;u>=0;--u){var s=this.tryEntries[u],v=s.completion;if(s.tryLoc==="root")return l("end");if(s.tryLoc<=this.prev){var j=p.call(s,"catchLoc"),O=p.call(s,"finallyLoc");if(j&&O){if(this.prev<s.catchLoc)return l(s.catchLoc,!0);if(this.prev<s.finallyLoc)return l(s.finallyLoc)}else if(j){if(this.prev<s.catchLoc)return l(s.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return l(s.finallyLoc)}}}},abrupt:function(o,i){for(var l=this.tryEntries.length-1;l>=0;--l){var u=this.tryEntries[l];if(u.tryLoc<=this.prev&&p.call(u,"finallyLoc")&&this.prev<u.finallyLoc){var s=u;break}}s&&(o==="break"||o==="continue")&&s.tryLoc<=i&&i<=s.finallyLoc&&(s=null);var v=s?s.completion:{};return v.type=o,v.arg=i,s?(this.method="next",this.next=s.finallyLoc,A):this.complete(v)},complete:function(o,i){if(o.type==="throw")throw o.arg;return o.type==="break"||o.type==="continue"?this.next=o.arg:o.type==="return"?(this.rval=this.arg=o.arg,this.method="return",this.next="end"):o.type==="normal"&&i&&(this.next=i),A},finish:function(o){for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i];if(l.finallyLoc===o)return this.complete(l.completion,l.afterLoc),J(l),A}},catch:function(o){for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i];if(l.tryLoc===o){var u=l.completion;if(u.type==="throw"){var s=u.arg;J(l)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(o,i,l){return this.delegate={iterator:ee(o),resultName:i,nextLoc:l},this.method==="next"&&(this.arg=r),A}},t}(e.exports);try{regeneratorRuntime=n}catch{Function("r","regeneratorRuntime = r")(n)}}),x=cn;
1function he(e){return(he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}var fe,ye="https://js.stripe.com/v3",un=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,ue="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",pn=function(){for(var e=document.querySelectorAll('script[src^="'.concat(ye,'"]')),n=0;n<e.length;n++){var t=e[n];if(un.test(t.src))return t}return null},dn=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(ye).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},mn=function(e,n){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.13.2",startTime:n})},re=null,hn=function(e){return re!==null?re:re=new Promise(function(n,t){if(typeof window<"u")if(window.Stripe&&e&&console.warn(ue),window.Stripe)n(window.Stripe);else try{var r=pn();r&&e?console.warn(ue):r||(r=dn(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(a){return void t(a)}else n(null)})},fn=function(e,n,t){if(e===null)return null;var r=e.apply(void 0,n);return mn(r,t),r},yn=function(e){var n=`invalid load parameters; expected object of shape 2 3 {advancedFraudSignals: boolean} 4 5but received 6 7 `.concat(JSON.stringify(e),` 8`);if(e===null||he(e)!=="object")throw new Error(n);if(Object.keys(e).length===1&&typeof e.advancedFraudSignals=="boolean")return e;throw new Error(n)},ge=!1,T=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];ge=!0;var r=Date.now();return hn(fe).then(function(a){return fn(a,n,r)})};T.setLoadParameters=function(e){if(ge)throw new Error("You cannot change load parameters after calling loadStripe");fe=yn(e)};/** 9 * vue-coerce-props v1.0.0 10 * (c) 2018 Eduardo San Martin Morote <[email protected]> 11 * @license MIT 12 */var gn={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],a=t[1];return n[r]=a.call(e,e.$props[r]),n},{})}}},vn={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 tn.includes(e)}},billingAddressCollection:{type:String,default:"auto",validator:function(e){return rn.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:te,coerce:function(e){return nn.includes(e)?e:(console.warn("VueStripe Warning: '".concat(e,"' is not supported by Stripe yet. Falling back to default '").concat(te,"'.")),te)}},shippingAddressCollection:{type:Object,validator:function(e){return Object.prototype.hasOwnProperty.call(e,"allowedCountries")}},disableAdvancedFraudDetection:{type:Boolean},stripeOptions:{type:Object,default:null}},bn={props:vn,mixins:[gn],render:function(e){return e},methods:{redirectToCheckout:function(){var e,n,t;return x.async(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,this.$emit("loading",!0),this.disableAdvancedFraudDetection&&T.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},r.next=6,x.awrap(T(this.pk,e));case 6:if((n=r.sent).registerAppInfo(U),!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()}}
12,null,this,[[0,18]])}}};function En(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var Sn=En;function pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,r)}return t}function _n(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?pe(Object(t),!0).forEach(function(r){Sn(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pe(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var wn="card",An={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 on}},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 x.async(function(r){for(;;)switch(r.prev=r.next){case 0:return this.disableAdvancedFraudDetection&&T.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,x.awrap(T(this.pk,e));case 5:this.stripe=r.sent,this.stripe.registerAppInfo(U),this.elements=this.stripe.elements(this.elementsOptions),this.element=this.elements.create(wn,n),this.element.mount("#stripe-element-mount-point"),this.element.on("change",function(a){var p=document.getElementById("stripe-element-errors");a.error?p.textContent=a.error.message:p.textContent="",t.onChange(a)}),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(a){var p,h,c,S;return x.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,t.$emit("loading",!0),a.preventDefault(),p=_n({},t.element),t.amount&&(p.amount=t.amount),d.next=7,x.awrap(t.stripe.createToken(p,t.tokenData));case 7:if(h=d.sent,c=h.token,!(S=h.error)){d.next=15;break}return document.getElementById("stripe-element-errors").textContent=S.message,t.$emit("error",S),d.abrupt("return");case 15:t.$emit("token",c),d.next=22;break;case 18:d.prev=18,d.t0=d.catch(0),console.error(d.t0),t.$emit("error",d.t0);case 22:return d.prev=22,t.$emit("loading",!1),d.finish(22);case 25:case"end":return d.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 ve(e,n,t,r,a,p,h,c,S,d){const g=typeof t=="function"?t.options:t;let w;if(e&&e.render&&(g.render=e.render,g.staticRenderFns=e.staticRenderFns,g._compiled=!0),r&&(g._scopeId=r),n&&(w=function(y){n.call(this,c(y))}),w)if(g.functional){const y=g.render;g.render=function(V,N){return w.call(N),y(V,N)}}else{const y=g.beforeCreate;g.beforeCreate=y?[].concat(y,w):[w]}return t}const xn=typeof navigator<"u"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function be(e){return(n,t)=>kn(n,t)}let ie;const de={};function kn(e,n){const t=xn?n.media||"default":e,r=de[t]||(de[t]={ids:new Set,styles:[]});if(!r.ids.has(e)){r.ids.add(e);let a=n.source;if(n.map&&(a+=` 13/*# sourceURL=`+n.map.sources[0]+" */",a+=` 14/*# 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),ie===void 0&&(ie=document.head||document.getElementsByTagName("head")[0]),ie.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(a),r.element.styleSheet.cssText=r.styles.filter(
14Boolean).join(` 15`);else{const p=r.ids.size-1,h=document.createTextNode(a),c=r.element.childNodes;c[p]&&r.element.removeChild(c[p]),c.length?r.element.insertBefore(h,c[p]):r.element.appendChild(h)}}}const Cn=An;var Ee=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)])},On=[];Ee._withStripped=!0;const Pn=function(e){e&&e("data-v-4dd8360e_0",{source:` 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261/** 262 * The CSS shown here will not be introduced in the Quickstart guide, but shows 263 * how you can use CSS to style your Element's container. 264 */ 265.StripeElement[data-v-4dd8360e] { 266 box-sizing: border-box; 267 268 height: 40px; 269 270 padding: 10px 12px; 271 272 border: 1px solid transparent; 273 border-radius: 4px; 274 background-color: white; 275 276 box-shadow: 0 1px 3px 0 #e6ebf1; 277 -webkit-transition: box-shadow 150ms ease; 278 transition: box-shadow 150ms ease; 279} 280.StripeElement--focus[data-v-4dd8360e] { 281 box-shadow: 0 1px 3px 0 #cfd7df; 282} 283.StripeElement--invalid[data-v-4dd8360e] { 284 border-color: #fa755a; 285} 286.StripeElement--webkit-autofill[data-v-4dd8360e] { 287 background-color: #fefde5 !important; 288} 289.hide[data-v-4dd8360e] { 290 display: none; 291} 292`,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> 293 <div> 294 <form id="stripe-element-form"> 295 <div id="stripe-element-mount-point" /> 296 <slot name="stripe-element-errors"> 297 <div 298 id="stripe-element-errors" 299 role="alert" 300 /> 301 </slot> 302 <button 303 ref="submitButtonRef" 304 type="submit" 305 class="hide" 306 /> 307 </form> 308 </div> 309</template> 310 311<script> 312import { loadStripe } from '@stripe/stripe-js/dist/pure.esm.js'; 313// import { isSecureHost } from '../utils'; 314import { 315 DEFAULT_ELEMENT_STYLE, 316 STRIPE_PARTNER_DETAILS, 317 // INSECURE_HOST_ERROR_MESSAGE, 318} from '../constants'; 319const ELEMENT_TYPE = 'card'; 320export default { 321 props: { 322 pk: { 323 type: String, 324 required: true, 325 }, 326 testMode: { 327 type: Boolean, 328 default: false, 329 }, 330 stripeAccount: { 331 type: String, 332 default: undefined, 333 }, 334 apiVersion: { 335 type: String, 336 default: undefined, 337 }, 338 locale: { 339 type: String, 340 default: 'auto', 341 }, 342 elementsOptions: { 343 type: Object, 344 default: () => ({}), 345 }, 346 tokenData: { 347 type: Object, 348 default: () => ({}), 349 }, 350 disableAdvancedFraudDetection: { 351 type: Boolean, 352 }, 353 // element specific options 354 classes: { 355 type: Object, 356 default: () => ({}), 357 }, 358 elementStyle: { 359 type: Object, 360 default: () => (DEFAULT_ELEMENT_STYLE), 361 }, 362 value: { 363 type: String, 364 default: undefined, 365 }, 366 hidePostalCode: Boolean, 367 iconStyle: { 368 type: String, 369 default: 'default', 370 validator: value => ['solid', 'default'].includes(value), 371 }, 372 hideIcon: Boolean, 373 disabled: Boolean, 374 }, 375 data () { 376 return { 377 loading: false, 378 stripe: null, 379 elements: null, 380 element: null, 381 card: null, 382 }; 383 }, 384 computed: { 385 form () { 386 return document.getElementById('stripe-element-form'); 387 }, 388 }, 389 async mounted () { 390 // FIXME: temporarily remove to avoid problems with remote non-production deployments 391 // if (!isSecureHost(this.testMode)) { 392 // document.getElementById('stripe-element-mount-point').innerHTML = \`<p style="color: red">\${INSECURE_HOST_ERROR_MESSAGE}</p>\`; 393 // return; 394 // } 395 396 if (this.disableAdvancedFraudDetection) loadStripe.setLoadParameters({ advancedFraudSignals: false }); 397 398 const stripeOptions = {
399 stripeAccount: this.stripeAccount, 400 apiVersion: this.apiVersion, 401 locale: this.locale, 402 }; 403 const createOptions = { 404 classes: this.classes, 405 style: this.elementStyle, 406 value: this.value, 407 hidePostalCode: this.hidePostalCode, 408 iconStyle: this.iconStyle, 409 hideIcon: this.hideIcon, 410 disabled: this.disabled, 411 }; 412 413 this.stripe = await loadStripe(this.pk, stripeOptions); 414 this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS); 415 this.elements = this.stripe.elements(this.elementsOptions); 416 this.element = this.elements.create(ELEMENT_TYPE, createOptions); 417 this.element.mount('#stripe-element-mount-point'); 418 419 this.element.on('change', (event) => { 420 var displayError = document.getElementById('stripe-element-errors'); 421 if (event.error) { 422 displayError.textContent = event.error.message; 423 } else { 424 displayError.textContent = ''; 425 } 426 this.onChange(event); 427 }); 428 429 this.element.on('blur', this.onBlur); 430 this.element.on('click', this.onClick); 431 this.element.on('escape', this.onEscape); 432 this.element.on('focus', this.onFocus); 433 this.element.on('ready', this.onReady); 434 435 this.form.addEventListener('submit', async (event) => { 436 try { 437 this.$emit('loading', true); 438 event.preventDefault(); 439 const data = { 440 ...this.element, 441 }; 442 if (this.amount) data.amount = this.amount; 443 const { token, error } = await this.stripe.createToken(data, this.tokenData); 444 if (error) { 445 const errorElement = document.getElementById('stripe-element-errors'); 446 errorElement.textContent = error.message; 447 this.$emit('error', error); 448 return; 449 } 450 this.$emit('token', token); 451 } catch (error) { 452 console.error(error); 453 this.$emit('error', error); 454 } finally { 455 this.$emit('loading', false); 456 } 457 }); 458 }, 459 methods: { 460 /** 461 * Triggers the submission of the form 462 * @return {void} 463 */ 464 submit () { 465 this.$refs.submitButtonRef.click(); 466 }, 467 /** 468 * Clears the element 469 * @return {void} 470 */ 471 clear () { 472 this.element.clear(); 473 }, 474 /** 475 * Destroys the element 476 * @return {void} 477 */ 478 destroy () { 479 this.element.destroy(); 480 }, 481 /** 482 * Focuses on the element 483 * @return {void} 484 */ 485 focus () { 486 console.warn('This method will currently not work on iOS 13+ due to a system limitation.'); 487 this.element.focus(); 488 }, 489 /** 490 * Unmounts the element 491 * @return {void} 492 */ 493 unmount () { 494 this.element.unmount(); 495 }, 496 /** 497 * Updates the element 498 * @param {string} opts.classes.base The base class applied to the container. Defaults to StripeElement. 499 * @param {string} opts.classes.complete The class name to apply when the Element is complete. Defaults to StripeElement--complete. 500 * @param {string} opts.classes.empty The class name to apply when the Element is empty. Defaults to StripeElement--empty. 501 * @param {string} opts.classes.focus The class name to apply when the Element is focused. Defaults to StripeElement--focus. 502 * @param {string} opts.classes.invalid The class name to apply when the Element is invalid. Defaults to StripeElement--invalid. 503 * @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. 504 * @param {Object} opts.style Customize the appearance of this element using CSS properties passed in a Style object. 505 * @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 506 * @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. 507 * @param {string} opts.iconStyle Appearance of the icon in the Element. Either solid or default. 508 * @param {boolean} opts.hideIcon Hides the icon in the Element. Default is false. 509 * @param {boolean} opts.disabled Applies a disabled state to the Element such that user input is not accepted. Default is false. 510 */ 511 update (opts) { 512 this.element.update(opts); 513 }, 514 // events 515 onChange (e) { 516 this.$emit('element-change', e); 517 }, 518 onReady (e) { 519 this.$emit('element-ready', e); 520 }, 521 onFocus (e) { 522 this.$emit('element-focus', e); 523 }, 524 onBlur (e) { 525 this.$emit('element-blur', e); 526 }, 527 onEscape (e) { 528 this.$emit('element-escape', e); 529 }, 530 onClick (e) { 531 this.$emit('element-click', e); 532 }, 533 }, 534}; 535<\/script> 536 537<style scoped> 538/** 539 * The CSS shown here will not be introduced in the Quickstart guide, but shows 540 * how you can use CSS to style your Element's container. 541 */ 542.StripeElement { 543 box-sizing: border-box; 544 545 height: 40px; 546 547 padding: 10px 12px; 548 549 border: 1px solid transparent; 550 border-radius: 4px; 551 background-color: white; 552 553 box-shadow: 0 1px 3px 0 #e6ebf1; 554 -webkit-transition: box-shadow 150ms ease; 555 transition: box-shadow 150ms ease; 556} 557 558.StripeElement--focus { 559 box-shadow: 0 1px 3px 0 #cfd7df; 560} 561 562.StripeElement--invalid { 563 border-color: #fa755a; 564} 565 566.StripeElement--webkit-autofill { 567 background-color: #fefde5 !important; 568} 569 570.hide { 571 display: none; 572} 573</style> 574`]},media:void 0})},Tn="data-v-4dd8360e",In=ve({render:Ee,staticRenderFns:On},Pn,Cn,Tn,!1,void 0,!1,be);var Ln="payment",jn={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}}
574,computed:{form:function(){return document.getElementById("stripe-payment-element-form")}},mounted:function(){var e,n=this;return x.async(function(t){for(;;)switch(t.prev=t.next){case 0:return this.disableAdvancedFraudDetection&&T.setLoadParameters({advancedFraudSignals:!1}),e={stripeAccount:this.stripeAccount,apiVersion:this.apiVersion,locale:this.locale},t.next=4,x.awrap(T(this.pk,e));case 4:this.stripe=t.sent,this.stripe.registerAppInfo(U),this.elements=this.stripe.elements(this.elementsOptions),this.element=this.elements.create(Ln,this.createOptions),this.element.mount("#stripe-payment-element-mount-point"),this.element.on("change",function(r){var a=document.getElementById("stripe-payment-element-errors");r.error?a.textContent=r.error.message:a.textContent="",n.onChange(r)}),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(r){var a,p,h;return x.async(function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,n.$emit("loading",!0),r.preventDefault(),c.next=5,x.awrap(n.stripe.confirmPayment({elements:n.elements,confirmParams:n.confirmParams,redirect:n.redirect}));case 5:if(a=c.sent,p=a.error,h=a.paymentIntent,!p){c.next=15;break}return document.getElementById("stripe-payment-element-errors").textContent=p.message,n.$emit("error",p),c.abrupt("return");case 15:h&&n.$emit("confirmed",h);case 16:c.next=22;break;case 18:c.prev=18,c.t0=c.catch(0),console.error(c.t0),n.$emit("error",c.t0);case 22:return c.prev=22,n.$emit("loading",!1),c.finish(22);case 25:case"end":return c.stop()}},null,null,[[0,18,22,25]])});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 Rn=jn;var Se=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)])},Bn=[];Se._withStripped=!0;const $n=function(e){e&&e("data-v-171d7aec_0",{source:` 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843/** 844 * The CSS shown here will not be introduced in the Quickstart guide, but shows 845 * how you can use CSS to style your Element's container. 846 */ 847.hide[data-v-171d7aec] { 848 display: none; 849} 850`,map:{version:3,sources:["/home/runner/work/vue-stripe/vue-stripe/src/elements/Payment.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6QA;;;EAGA;AACA;EACA,aAAA;AACA",file:"Payment.vue",sourcesContent:[`<template> 851 <div> 852 <form id="stripe-payment-element-form"> 853 <div id="stripe-payment-element-mount-point" /> 854 <slot name="stripe-payment-element-errors"> 855 <div 856 id="stripe-payment-element-errors" 857 role="alert" 858 /> 859 </slot> 860 <button 861 ref="submitButtonRef" 862 type="submit" 863 class="hide" 864 /> 865 </form> 866 </div> 867</template> 868 869<script> 870import { loadStripe } from '@stripe/stripe-js/dist/pure.esm.js'; 871// import { isSecureHost } from '../utils'; 872import { 873 STRIPE_PARTNER_DETAILS, 874 // INSECURE_HOST_ERROR_MESSAGE, 875} from '../constants'; 876const ELEMENT_TYPE = 'payment'; 877export default { 878 props: { 879 pk: { 880 type: String, 881 required: true, 882 }, 883 testMode: { 884 type: Boolean, 885 default: false, 886 }, 887 elementsOptions: { 888 type: Object, 889 required: true, 890 default: () => ({}), 891 }, 892 confirmParams: { 893 type: Object, 894 required: true, 895 default: () => ({}), 896 }, 897 redirect: { 898 type: String, 899 default: 'always', 900 }, 901 createOptions: { 902 type: Object, 903 default: () => ({}), 904 }, 905 stripeAccount: { 906 type: String, 907 default: undefined, 908 }, 909 apiVersion: { 910 type: String, 911 default: undefined, 912 }, 913 locale: { 914 type: String, 915 default: 'auto', 916 }, 917 disableAdvancedFraudDetection: { 918 type: Boolean, 919 }, 920 }, 921 data () { 922 return { 923 loading: false,
924 stripe: null, 925 elements: null, 926 element: null, 927 }; 928 }, 929 computed: { 930 form () { 931 return document.getElementById('stripe-payment-element-form'); 932 }, 933 }, 934 async mounted () { 935 // FIXME: temporarily remove to avoid problems with remote non-production deployments 936 // if (!isSecureHost(this.testMode)) { 937 // document.getElementById( 938 // 'stripe-payment-element-mount-point', 939 // ).innerHTML = \`<p style="color: red">\${INSECURE_HOST_ERROR_MESSAGE}</p>\`; 940 // return; 941 // } 942 943 if (this.disableAdvancedFraudDetection) { 944 loadStripe.setLoadParameters({ advancedFraudSignals: false }); 945 } 946 947 const stripeOptions = { 948 stripeAccount: this.stripeAccount, 949 apiVersion: this.apiVersion, 950 locale: this.locale, 951 }; 952 953 this.stripe = await loadStripe(this.pk, stripeOptions); 954 this.stripe.registerAppInfo(STRIPE_PARTNER_DETAILS); 955 956 this.elements = this.stripe.elements(this.elementsOptions); 957 this.element = this.elements.create(ELEMENT_TYPE, this.createOptions); 958 this.element.mount('#stripe-payment-element-mount-point'); 959 960 this.element.on('change', event => { 961 var displayError = document.getElementById( 962 'stripe-payment-element-errors', 963 ); 964 if (event.error) { 965 displayError.textContent = event.error.message; 966 } else { 967 displayError.textContent = ''; 968 } 969 this.onChange(event); 970 }); 971 972 this.element.on('blur', this.onBlur); 973 this.element.on('click', this.onClick); 974 this.element.on('escape', this.onEscape); 975 this.element.on('focus', this.onFocus); 976 this.element.on('ready', this.onReady); 977 978 this.form.addEventListener('submit', async event => { 979 try { 980 this.$emit('loading', true); 981 event.preventDefault(); 982 const { error, paymentIntent } = await this.stripe.confirmPayment({ 983 elements: this.elements, 984 confirmParams: this.confirmParams, 985 redirect: this.redirect, 986 }); 987 988 // if the response is an error 989 if (error) { 990 const errorElement = document.getElementById( 991 'stripe-payment-element-errors', 992 ); 993 errorElement.textContent = error.message; 994 this.$emit('error', error); 995 return; 996 } else if (paymentIntent) { 997 // if the user has passed prop redirect="if_required" 998 // and the payment confirmation was successful 999 // and the payment method is not forced to redirect 1000 // then stripe.confirmPayment resolves with a paymentIntent 1001 // so we sould pass it back up to the caller for consumption 1002 // https://stripe.com/docs/js/payment_intents/confirm_payment?type=pii#confirm_payment_intent-options-redirect 1003 this.$emit('confirmed', paymentIntent); 1004 } 1005 } catch (error) { 1006 console.error(error); 1007 this.$emit('error', error); 1008 } finally { 1009 this.$emit('loading', false); 1010 } 1011 }); 1012 }, 1013 methods: { 1014 /** 1015 * Triggers the submission of the form 1016 * @return {void} 1017 */ 1018 submit () { 1019 this.$refs.submitButtonRef.click(); 1020 }, 1021 /** 1022 * Clears the element 1023 * @return {void} 1024 */ 1025 clear () { 1026 this.element.clear(); 1027 }, 1028 /** 1029 * Destroys the element 1030 * @return {void} 1031 */ 1032 destroy () { 1033 this.element.destroy(); 1034 }, 1035 /** 1036 * Focuses on the element 1037 * @return {void} 1038 */ 1039 focus () { 1040 console.warn( 1041 'This method will currently not work on iOS 13+ due to a system limitation.', 1042 ); 1043 this.element.focus(); 1044 }, 1045 /** 1046 * Collapses the Payment Element into a row of payment method tabs 1047 * @return {void} 1048 */ 1049 collapse () { 1050 this.element.collapse(); 1051 }, 1052 /** 1053 * Retrieves a previously created element 1054 */ 1055 getElement () { 1056 this.element.getElement(); 1057 }, 1058 /** 1059 * Unmounts the element 1060 * @return {void} 1061 */ 1062 unmount () { 1063 this.element.unmount(); 1064 }, 1065 /** 1066 * Updates the element. See official docs for more detail: https://site-admin.stripe.com/docs/js/elements_object/update_payment_element 1067 * @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. 1068 * @param {array} opts.paymentMethodOrder Sets order in which payment methods are displayed. Otherwise payment methods are ordered dynamically to optimize for conversion. 1069 * @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. 1070 * @param {string} opts.fields.billingDetails.name Specify 'never' to avoid collecting a name as part of the billing details in the Payment Element. 1071 * @param {string} opts.fields.billingDetails.email Specify 'never' to avoid collecting an email address as part of the billing details in the Payment Element. 1072 * @param {string} opts.fields.billingDetails.phone Specify 'never' to avoid collecting a phone number as part of the billing details in the Payment Element. 1073 * @param {string | Object} opts.fields.billingDetails.address Specify 'never' to avoid collecting an address as part of the billing details in the Payment Element. 1074 * @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. 1075 * @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. 1076 * @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. 1077 * @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. 1078 * @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. 1079 * @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. 1080 * @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. 1081 * @param {string} opts.fields.terms.auBecsDebit Specify 'never' to never show legal agreements for the BECS Debit payment method. 1082 * @param {string} opts.fields.terms.bancontact Specify 'never' to never show legal agreements for the Bancontact payment method. 1083 * @param {string} opts.fields.terms.card Specify 'never' to never show legal agreements for the credit card payment method. 1084 * @param {string} opts.fields.terms.ideal Specify 'never' to never show legal agreements for the iDEAL payment method. 1085 * @param {string} opts.fields.terms.sepaDebit Specify 'never' to never show legal agreements for the SEPA Debit payment method. 1086 * @param {string} opts.fields.terms.sofort Specify 'never' to never show legal agreements for the SOFORT payment method. 1087 * @param {string} opts.fields.terms.usBankAccount Specify 'never' to never show legal agreements for the US Bank accounts payment method. 1088 * @param {string} opts.wallets Specify 'never' to never show digital wallet payment methods like Apple Pay and Google Pay. 1089 * @param {string} opts.wallets.applePay Specify 'never' to never show the Apple Pay digital wallet payment method. 1090 * @param {string} opts.wallets.googlePay Specify 'never' to never show the Google Pay digital wallet payment method. 1091 */ 1092 update (opts) { 1093 this.element.update(opts); 1094 }, 1095 // events 1096 onChange (e) { 1097 this.$emit('element-change', e); 1098 }, 1099 onReady (e) { 1100 this.$emit('element-ready', e); 1101 }, 1102 onFocus (e) { 1103 this.$emit('element-focus', e); 1104 }, 1105 onBlur (e) { 1106 this.$emit('element-blur', e); 1107 }, 1108 onEscape (e) { 1109 this.$emit('element-escape', e); 1110 }, 1111 onClick (e) { 1112 this.$emit('element-click', e); 1113 }, 1114 }, 1115}; 1116<\/script> 1117 1118<style scoped> 1119/** 1120 * The CSS shown here will not be introduced in the Quickstart guide, but shows 1121 * how you can use CSS to style your Element's container. 1122 */ 1123.hide { 1124 display: none; 1125} 1126</style> 1127`]},media:void 0})},Dn=ve({render:Se,staticRenderFns:Bn},$n,Rn,"data-v-171d7aec",!1,void 0,!1,be);var Fn={install:function(e,n){var t,r,a,p,h,c,S;return x.async(function(d){for(;;)switch(d.prev=d.next){case 0:t=n.pk,r=n.stripeAccount,a=n.apiVersion,p=n.locale,h=n.elementsOptions,(c=window.Stripe(t,{stripeAccount:r,apiVersion:a,locale:p})).registerAppInfo(U),S=c.elements(h),e.prototype.$stripe=c,e.prototype.$stripeElements=S;case 6:case"end":return d.stop()}})}};
1127me=F.StripeCheckout=bn,F.StripeElementCard=In,F.StripeElementPayment=Dn,F.StripeElementsPlugin=Fn,F.StripePlugin=an;Ae();const Nn={props:["tokens","products","publishableKey","lineItems","successURL","cancelURL","status","customerEmail"],components:{AppLayout:we,Head:xe,CheckCircleIcon:Te,Dialog:je,DialogOverlay:Re,DialogTitle:Be,TransitionChild:$e,TransitionRoot:De,CheckIcon:Le,StripeCheckout:me,XCircleIcon:Ie},data(){return{lineItems:[],isMessageOpen:!0,loading:!1,stripeLoaded:!1}},methods:{__(e){let n=this.$i18n.locale;if(typeof e=="object")return e[n];if(typeof e!="string"||e.trim()==="")return"";let t;try{t=JSON.parse(e)}catch{return"Error parsing translation string"}return t[n]||t.en||"Translation not found"},submit(e){this.lineItems=[{price:e.stripe_price_id,quantity:1}],this.stripeLoaded=!0,this.$nextTick(()=>{this.$refs.checkoutRef.redirectToCheckout()})}}},Mn={class:"bg-white"},Un={class:"max-w-7xl mx-auto py-24 px-4 sm:px-6 lg:px-8"},Vn={key:0,class:"flex items-center justify-center"},qn={class:"flex flex-col items-center space-y-2"},Gn={key:2,class:"text-4xl font-bold"},Hn={key:3,class:"text-4xl font-bold"},Yn={class:"text-center"},zn={key:0},Wn={key:1},Qn={class:"sm:flex sm:flex-col sm:align-center"},Xn={class:"text-5xl font-extrabold text-primary sm:text-center"},Kn={class:"mt-12 space-y-4 sm:mt-16 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-6 lg:max-w-4xl lg:mx-auto xl:max-w-none xl:mx-0 xl:grid-cols-4"},Jn={class:"p-6"},Zn={class:"text-lg leading-6 font-medium text-primary"},et={class:"mt-8"},nt={class:"text-4xl font-extrabold text-primary"},tt=["onClick"],rt={class:"pt-6 pb-8 px-6"},it={role:"list",class:"mt-6 space-y-4"},ot={class:"text-sm text-gray-500"};function st(e,n,t,r,a,p){const h=$("Head"),c=$("stripe-checkout"),S=$("x-circle-icon"),d=$("check-circle-icon"),g=$("CheckIcon"),w=$("AppLayout");return E(),k(le,null,[z(h,{title:"Dashboard"}),z(w,null,{default:ke(()=>[a.stripeLoaded?(E(),ne(c,{key:0,ref:"checkoutRef",mode:"payment",pk:t.publishableKey,"line-items":a.lineItems,"success-url":t.successURL,"cancel-url":t.cancelURL,"customer-email":t.customerEmail,onLoading:n[0]||(n[0]=y=>a.loading=y)},null,8,["pk","line-items","success-url","cancel-url","customer-email"])):W("",!0),f("div",Mn,[f("div",Un,[t.status?(E(),k("div",Vn,[a.isMessageOpen?(E(),k("div",{key:0,class:Ce(["max-w-2xl mb-24 border p-4 rounded-lg",{"border-green-500":t.status==="success","border-red-500":t.status!=="success"}])}
1127,[f("div",qn,[f("button",{class:"self-end",onClick:n[1]||(n[1]=y=>a.isMessageOpen=!1)},[z(S,{class:"h-6 w-6 text-gray-600"})]),t.status==="success"?(E(),ne(d,{key:0,class:"h-28 w-28 text-green-600 animate-pulse"})):(E(),ne(S,{key:1,class:"h-28 w-28 text-red-600 animate-pulse"})),t.status==="success"?(E(),k("h1",Gn,"Thank You !")):(E(),k("h1",Hn,"We're sorry")),f("div",Yn,[t.status==="success"?(E(),k("p",zn,"Thank you for your purchase, Please note that some transactions may take a few minutes to update. Once the transaction is confirmed, the token amount will be updated.")):(E(),k("p",Wn,"We're sorry, the transaction was not completed. Please try again."))])])],2)):W("",!0)])):W("",!0),f("div",Qn,[n[2]||(n[2]=f("p",{class:"text-sm font-semibold text-gray-600 text-center"},"Current Balance",-1)),f("h1",Xn,D(e.$page.props.auth.user.tokens??0)+" credits",1),n[3]||(n[3]=f("p",{class:"mt-2 text-xl text-gray-500 sm:text-center"},[ce(" Select from our flexible plans to purchase credits that allow you to process documents. "),f("br"),f("small",{class:"text-xs"},"300 words = 1 credit")],-1))]),f("div",Kn,[(E(!0),k(le,null,Oe(t.products,y=>(E(),k("div",{key:y.name,class:"border border-complementary rounded-lg shadow-sm divide-y divide-gray-200"},[f("div",Jn,[f("h2",Zn,D(y.name),1),f("p",et,[f("span",nt,"$"+D(y.price),1),n[4]||(n[4]=ce(" "+D(" ")+" ")),n[5]||(n[5]=f("span",{class:"text-base font-medium text-gray-500"},null,-1))]),f("button",{class:"mt-8 block w-full bg-primary border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900",onClick:V=>p.submit(y)},"Buy "+D(y.name),9,tt)]),f("div",rt,[n[6]||(n[6]=f("h3",{class:"text-xs font-medium text-primary tracking-wide uppercase"},"What's included",-1)),f("ul",it,[y.description?(E(),k("li",{key:e.feature,class:"flex space-x-3"},[z(g,{class:"flex-shrink-0 h-5 w-5 text-cyan","aria-hidden":"true"}),f("span",ot,D(y.description),1)])):W("",!0)])])]))),128))])])])]),_:1})],64)}const gt=Pe(Nn,[["render",st]]);export{gt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.