/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/spreedly-api@0.0.7/lib/spreedly.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Spreedly.DEFAULT_HOST="core.spreedly.com",Spreedly.DEFAULT_PORT="443",Spreedly.DEFAULT_BASE_PATH="/v1",Spreedly.DEFAULT_RESPONSE_FORMAT=".json",Spreedly.DEFAULT_API_VERSION=null,Spreedly.DEFAULT_TIMEOUT=require("http").createServer().timeout,Spreedly.PACKAGE_VERSION=require("../package.json").version,Spreedly.USER_AGENT={bindings_version:Spreedly.PACKAGE_VERSION,lang:"node",lang_version:process.version,platform:process.platform,publisher:"spreedly",uname:null},Spreedly.USER_AGENT_SERIALIZED=null;var exec=require("child_process").exec,resources={Authorize:require("./resources/Authorize"),Capture:require("./resources/Capture"),Gateways:require("./resources/Gateways"),Certificates:require("./resources/Certificates"),Payment:require("./resources/Payment"),Purchase:require("./resources/Purchase"),Receivers:require("./resources/Receivers"),Transactions:require("./resources/Transactions")};function Spreedly(e,r,t){if(!(this instanceof Spreedly))return new Spreedly(e,r,t);this._api={auth:null,host:Spreedly.DEFAULT_HOST,port:Spreedly.DEFAULT_PORT,basePath:Spreedly.DEFAULT_BASE_PATH,version:Spreedly.DEFAULT_API_VERSION,timeout:Spreedly.DEFAULT_TIMEOUT,agent:null,dev:!1},this._prepResources(),this.setApiKey(e,r),this.setApiVersion(t),this.setResponseFormat(Spreedly.DEFAULT_RESPONSE_FORMAT)}Spreedly.SpreedlyResource=require("./SpreedlyResource"),Spreedly.resources=resources,Spreedly.prototype={setHost:function(e,r,t){this._setApiField("host",e),r&&this.setPort(r),t&&this.setProtocol(t)},setProtocol:function(e){this._setApiField("protocol",e.toLowerCase())},setPort:function(e){this._setApiField("port",e)},setResponseFormat:function(e){this._setApiField("format",e)},setApiVersion:function(e){e&&this._setApiField("version",e)},setApiKey:function(e,r){e&&r&&this._setApiField("key",e+":"+r)},setTimeout:function(e){this._setApiField("timeout",null===e?Spreedly.DEFAULT_TIMEOUT:e)},setHttpAgent:function(e){this._setApiField("agent",e)},_setApiField:function(e,r){this._api[e]=r},getApiField:function(e){return this._api[e]},getResponseFormat:function(e){return this._api[e]},getConstant:function(e){return Spreedly[e]},getClientUserAgent:function(e){if(Spreedly.USER_AGENT_SERIALIZED)return e(Spreedly.USER_AGENT_SERIALIZED);this.getClientUserAgentSeeded(Spreedly.USER_AGENT,(function(r){Spreedly.USER_AGENT_SERIALIZED=r,e(Spreedly.USER_AGENT_SERIALIZED)}))},getClientUserAgentSeeded:function(e,r){exec("uname -a",(function(t,s){var i={};for(var o in e)i[o]=encodeURIComponent(e[o]);i.uname=encodeURIComponent(s)||"UNKNOWN",r(JSON.stringify(i))}))},_prepResources:function(){for(var e in resources)this[e[0].toLowerCase()+e.substring(1)]=new resources[e](this)}},module.exports=Spreedly,module.exports.Spreedly=Spreedly;
//# sourceMappingURL=/sm/26487d02322b36b5e7ffd3812a383d020ca8a4308527acf1766f2e8ed72651a6.map