(()=>{"use strict";var e={904:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BankAccountFunctions=void 0;var o=t(746),r=function(){function e(){}return e.prototype.tokenize=function(e,n,t,r,i){t=o.trimWS(t||"");var c={country:"US",currency:"usd",routing_number:r=o.trimWS(r||""),account_number:t,account_holder_name:e,account_holder_type:n};o.tokenize({bank_account:c},i)},e}();n.BankAccountFunctions=r},24:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CardFunctions=void 0;var o=t(746),r=function(){function e(){}return e.prototype.tokenize=function(e,n,t,r,i,c,u){t=o.trimWS(t||""),r=o.trimWS(r||"");var s={number:e=(e||"").replace(/\D/g,""),cvc:n,exp_month:t,exp_year:r,name:i};c&&(s.address={address1:c.address1,address2:c.address2,city:c.city,state:c.state,postal_code:c.postal_code,country:c.country});var a=setInterval((function(){null!=document.body&&(clearInterval(a),o.tokenize({card:s},u))}),1)},e}();n.CardFunctions=r},746:(e,n)=>{function t(e,n){var o=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];null==i||(i&&"object"==typeof i?n?o.push(t(i,n+"["+r+"]")):o.push(t(i,r)):n?o.push(n+"["+encodeURIComponent(r)+"]="+encodeURIComponent(i)):o.push(encodeURIComponent(r)+"="+encodeURIComponent(i)))}return o.join("&")}Object.defineProperty(n,"__esModule",{value:!0}),n.trimWS=n.tokenize=void 0,n.tokenize=function(e,n){var o,r,i,c,u;e.key=window.Invoiced.getPublishableKey(),o=window.Invoiced.getTokenizeEndpoint(),r=e,i=function(e,t){n(t,e)},c=function(e,t){e||(e={type:"api_error",message:"An unknown error occurred while processing your payment information."}),n(t.status,e)},(u=function(e,n){var t=new XMLHttpRequest;return"withCredentials"in t?t.open(e,n,!0):void 0!==window.XDomainRequest?(t=new XDomainRequest).open(e,n):console.error("Could not reach "+n+" because CORS is not supported"),t}("POST",o)).setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.setRequestHeader("Accept","application/json"),u.onload=function(){var e=JSON.parse(u.responseText);u.status>=200&&u.status<400?i(e,u.status,u):c(e,u)},u.onerror=function(){console.error("Could not reach "+o+" due to a connection error")},u.send(t(r))},n.trimWS=function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var i=n[o]={exports:{}};return e[o](i,i.exports,t),i.exports}var o,r,i,c,u,s;o=t(904),r=t(24),c="",u=i="https://payments.invoiced.com/tokens",s=function(){function e(){this.environment="prod",this.bankAccount=new o.BankAccountFunctions,this.card=new r.CardFunctions}return e.prototype.getPublishableKey=function(){return c},e.prototype.getTokenizeEndpoint=function(){return u},e.prototype.setPublishableKey=function(e,n){void 0===n&&(n="prod"),this.environment=n,c=e,u="staging"===n?"https://payments.staging.invoiced.com/tokens":i},e}(),window.Invoiced=window.Invoiced||new s})();