@stacksjs/payments 0.70.82 → 0.70.83

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.
@@ -1,4 +1,4 @@
1
- import Stripe from 'stripe';
1
+ import type Stripe from 'stripe';
2
2
  /**
3
3
  * Lazy-initialized Stripe instance.
4
4
  * Only throws when you actually try to use Stripe, not at module load time.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type * as Stripe from 'stripe';
1
2
  /**
2
3
  * Payments Package
3
4
  *
@@ -10,7 +11,6 @@ export { default as Payment } from './payment';
10
11
  export * from './billable/index';
11
12
  // Stripe driver and SDK
12
13
  export * from './drivers/stripe';
13
- export * as Stripe from 'stripe';
14
14
  // Idempotency-key helpers — passed to every Stripe create/update so
15
15
  // retries don't produce duplicate objects (stacksjs/stacks#1876 X-1).
16
16
  export { freshIdempotencyKey, stacksIdempotencyKey } from './idempotency';
package/dist/index.js CHANGED
@@ -1,12 +1,2 @@
1
1
  // @bun
2
- var MX=Object.create;var{getPrototypeOf:jX,defineProperty:jZ,getOwnPropertyNames:_X}=Object;var mX=Object.prototype.hasOwnProperty;function hX(J){return this[J]}var lX,uX,_Z=(J,Z,$)=>{var Q=J!=null&&typeof J==="object";if(Q){var G=Z?lX??=new WeakMap:uX??=new WeakMap,z=G.get(J);if(z)return z}$=J!=null?MX(jX(J)):{};let w=Z||!J||!J.__esModule?jZ($,"default",{value:J,enumerable:!0}):$;for(let X of _X(J))if(!mX.call(w,X))jZ(w,X,{get:hX.bind(J,X),enumerable:!0});if(Q)G.set(J,w);return w};var B=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var BJ=import.meta.require;var OJ=B((lZ)=>{Object.defineProperty(lZ,"__esModule",{value:!0});lZ.CryptoProviderOnlySupportsAsyncError=lZ.CryptoProvider=void 0;class mZ{computeHMACSignature(J,Z){throw Error("computeHMACSignature not implemented.")}computeHMACSignatureAsync(J,Z){throw Error("computeHMACSignatureAsync not implemented.")}computeSHA256Async(J){throw Error("computeSHA256 not implemented.")}}lZ.CryptoProvider=mZ;class hZ extends Error{}lZ.CryptoProviderOnlySupportsAsyncError=hZ});var iZ=B((nZ)=>{Object.defineProperty(nZ,"__esModule",{value:!0});nZ.NodeCryptoProvider=void 0;var cZ=BJ("crypto"),dX=OJ();class dZ extends dX.CryptoProvider{computeHMACSignature(J,Z){return cZ.createHmac("sha256",Z).update(J,"utf8").digest("hex")}async computeHMACSignatureAsync(J,Z){return await this.computeHMACSignature(J,Z)}async computeSHA256Async(J){return new Uint8Array(await cZ.createHash("sha256").update(J).digest())}}nZ.NodeCryptoProvider=dZ});var kJ=B((oZ)=>{Object.defineProperty(oZ,"__esModule",{value:!0});oZ.HttpClientResponse=oZ.HttpClient=void 0;class XJ{getClientName(){throw Error("getClientName not implemented.")}makeRequest(J,Z,$,Q,G,z,w,X){throw Error("makeRequest not implemented.")}static makeTimeoutError(){let J=TypeError(XJ.TIMEOUT_ERROR_CODE);return J.code=XJ.TIMEOUT_ERROR_CODE,J}}oZ.HttpClient=XJ;XJ.CONNECTION_CLOSED_ERROR_CODES=["ECONNRESET","EPIPE"];XJ.TIMEOUT_ERROR_CODE="ETIMEDOUT";class pZ{constructor(J,Z){this._statusCode=J,this._headers=Z}getStatusCode(){return this._statusCode}getHeaders(){return this._headers}getRawResponse(){throw Error("getRawResponse not implemented.")}toStream(J){throw Error("toStream not implemented.")}toJSON(){throw Error("toJSON not implemented.")}}oZ.HttpClientResponse=pZ});var G9=B(($9)=>{Object.defineProperty($9,"__esModule",{value:!0});$9.NodeHttpClientResponse=$9.NodeHttpClient=void 0;var rZ=BJ("http"),tZ=BJ("https"),M0=kJ(),eZ=rZ.default||rZ,J9=tZ.default||tZ,aX=new eZ.Agent({keepAlive:!0}),iX=new J9.Agent({keepAlive:!0});class Z9 extends M0.HttpClient{constructor(J){super();this._agent=J}getClientName(){return"node"}makeRequest(J,Z,$,Q,G,z,w,X){let K=w==="http",T=this._agent;if(!T)T=K?aX:iX;return new Promise((V,W)=>{let D=(K?eZ:J9).request({host:J,port:Z,path:$,method:Q,agent:T,headers:G,ciphers:"DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5"});D.setTimeout(X,()=>{D.destroy(M0.HttpClient.makeTimeoutError())}),D.on("response",(L)=>{V(new j0(L))}),D.on("error",(L)=>{W(L)}),D.once("socket",(L)=>{if(L.connecting)L.once(K?"connect":"secureConnect",()=>{D.write(z),D.end()});else D.write(z),D.end()})})}}$9.NodeHttpClient=Z9;class j0 extends M0.HttpClientResponse{constructor(J){super(J.statusCode,J.headers||{});this._res=J}getRawResponse(){return this._res}toStream(J){return this._res.once("end",()=>J()),this._res}toJSON(){return new Promise((J,Z)=>{let $="";this._res.setEncoding("utf8"),this._res.on("data",(Q)=>{$+=Q}),this._res.once("end",()=>{try{J(JSON.parse($))}catch(Q){Z(Q)}})})}}$9.NodeHttpClientResponse=j0});var _=B((w9)=>{Object.defineProperty(w9,"__esModule",{value:!0});w9.parseHeadersForFetch=w9.parseHttpHeaderAsNumber=w9.parseHttpHeaderAsString=w9.getAPIMode=w9.jsonStringifyRequestData=w9.concat=w9.createApiKeyAuthenticator=w9.detectAIAgent=w9.AI_AGENTS=w9.determineProcessUserAgentProperties=w9.validateInteger=w9.flattenAndStringify=w9.isObject=w9.emitWarning=w9.pascalToCamelCase=w9.callbackifyPromiseWithTimeout=w9.normalizeHeader=w9.normalizeHeaders=w9.removeNullish=w9.protoExtend=w9.getOptionsFromArgs=w9.getDataFromArgs=w9.extractUrlParams=w9.makeURLInterpolator=w9.queryStringifyRequestData=w9.isOptionsHash=void 0;var m0=["apiKey","idempotencyKey","stripeAccount","apiVersion","maxNetworkRetries","timeout","host","authenticator","stripeContext","headers","additionalHeaders","streaming"];function h0(J){return J&&typeof J==="object"&&m0.some((Z)=>Object.prototype.hasOwnProperty.call(J,Z))}w9.isOptionsHash=h0;function oX(J){return rX(J)}w9.queryStringifyRequestData=oX;function z9(J){return encodeURIComponent(J).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27").replace(/%5B/g,"[").replace(/%5D/g,"]")}function sX(J){if(J instanceof Date)return Math.floor(J.getTime()/1000).toString();if(J===null)return"";return String(J)}function rX(J){let Z=[];function $(Q,G){if(G===void 0)return;if(G===null||typeof G!=="object"||G instanceof Date){Z.push(z9(Q)+"="+z9(sX(G)));return}if(Array.isArray(G)){for(let z=0;z<G.length;z++)if(G[z]!==void 0)$(Q+"["+z+"]",G[z]);return}for(let z of Object.keys(G))$(Q+"["+z+"]",G[z])}if(typeof J==="object"&&J!==null)for(let Q of Object.keys(J))$(Q,J[Q]);return Z.join("&")}w9.makeURLInterpolator=(()=>{let J={"\n":"\\n",'"':"\\\"","\u2028":"\\u2028","\u2029":"\\u2029"};return(Z)=>{let $=Z.replace(/["\n\r\u2028\u2029]/g,(Q)=>J[Q]);return(Q)=>{return $.replace(/\{([\s\S]+?)\}/g,(G,z)=>{let w=Q[z];if(tX(w))return encodeURIComponent(w);return""})}}})();function tX(J){return["number","string","boolean"].includes(typeof J)}function eX(J){let Z=J.match(/\{\w+\}/g);if(!Z)return[];return Z.map(($)=>$.replace(/[{}]/g,""))}w9.extractUrlParams=eX;function JY(J){if(!Array.isArray(J)||!J[0]||typeof J[0]!=="object")return{};if(!h0(J[0]))return J.shift();let Z=Object.keys(J[0]),$=Z.filter((Q)=>m0.includes(Q));if($.length>0&&$.length!==Z.length)l0(`Options found in arguments (${$.join(", ")}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.`);return{}}w9.getDataFromArgs=JY;function ZY(J){let Z={host:null,headers:{},settings:{},streaming:!1};if(J.length>0){let $=J[J.length-1];if(typeof $==="string")Z.authenticator=_0(J.pop());else if(h0($)){let Q={...J.pop()},G=Object.keys(Q).filter((z)=>!m0.includes(z));if(G.length)l0(`Invalid options found (${G.join(", ")}); ignoring.`);if(Q.apiKey)Z.authenticator=_0(Q.apiKey);if(Q.idempotencyKey)Z.headers["Idempotency-Key"]=Q.idempotencyKey;if(Q.stripeAccount)Z.headers["Stripe-Account"]=Q.stripeAccount;if(Q.stripeContext){if(Z.headers["Stripe-Account"])throw Error("Can't specify both stripeAccount and stripeContext.");Z.headers["Stripe-Context"]=Q.stripeContext}if(Q.apiVersion)Z.headers["Stripe-Version"]=Q.apiVersion;if(Number.isInteger(Q.maxNetworkRetries))Z.settings.maxNetworkRetries=Q.maxNetworkRetries;if(Number.isInteger(Q.timeout))Z.settings.timeout=Q.timeout;if(Q.host)Z.host=Q.host;if(Q.authenticator){if(Q.apiKey)throw Error("Can't specify both apiKey and authenticator.");if(typeof Q.authenticator!=="function")throw Error("The authenticator must be a function receiving a request as the first parameter.");Z.authenticator=Q.authenticator}if(Q.headers)Object.assign(Z.headers,Q.headers);if(Q.additionalHeaders)Object.assign(Z.headers,Q.additionalHeaders);if(Q.streaming)Z.streaming=!0}}return Z}w9.getOptionsFromArgs=ZY;function $Y(J){let Z=this,$=Object.prototype.hasOwnProperty.call(J,"constructor")?J.constructor:function(...Q){Z.apply(this,Q)};return Object.assign($,Z),$.prototype=Object.create(Z.prototype),Object.assign($.prototype,J),$}w9.protoExtend=$Y;function QY(J){if(typeof J!=="object")throw Error("Argument must be an object");return Object.keys(J).reduce((Z,$)=>{if(J[$]!=null)Z[$]=J[$];return Z},{})}w9.removeNullish=QY;function GY(J){if(!(J&&typeof J==="object"))return J;return Object.keys(J).reduce((Z,$)=>{return Z[B9($)]=J[$],Z},{})}w9.normalizeHeaders=GY;function B9(J){return J.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.substr(1).toLowerCase()).join("-")}w9.normalizeHeader=B9;function zY(J,Z){if(Z)return J.then(($)=>{setTimeout(()=>{Z(null,$)},0)},($)=>{setTimeout(()=>{Z($,null)},0)});return J}w9.callbackifyPromiseWithTimeout=zY;function BY(J){if(J==="OAuth")return"oauth";else return J[0].toLowerCase()+J.substring(1)}w9.pascalToCamelCase=BY;function l0(J){if(typeof process.emitWarning!=="function")return console.warn(`Stripe: ${J}`);return process.emitWarning(J,"Stripe")}w9.emitWarning=l0;function X9(J){let Z=typeof J;return(Z==="function"||Z==="object")&&!!J}w9.isObject=X9;function XY(J){let Z={},$=(Q,G)=>{Object.entries(Q).forEach(([z,w])=>{let X=G?`${G}[${z}]`:z;if(X9(w))if(!(w instanceof Uint8Array)&&!Object.prototype.hasOwnProperty.call(w,"data"))return $(w,X);else Z[X]=w;else Z[X]=String(w)})};return $(J,null),Z}w9.flattenAndStringify=XY;function YY(J,Z,$){if(!Number.isInteger(Z))if($!==void 0)return $;else throw Error(`${J} must be an integer`);return Z}w9.validateInteger=YY;function wY(){return typeof process>"u"?{}:{lang_version:process.version}}w9.determineProcessUserAgentProperties=wY;w9.AI_AGENTS=[["ANTIGRAVITY_CLI_ALIAS","antigravity"],["CLAUDECODE","claude_code"],["CLINE_ACTIVE","cline"],["CODEX_SANDBOX","codex_cli"],["CODEX_THREAD_ID","codex_cli"],["CODEX_SANDBOX_NETWORK_DISABLED","codex_cli"],["CODEX_CI","codex_cli"],["CURSOR_AGENT","cursor"],["GEMINI_CLI","gemini_cli"],["OPENCLAW_SHELL","openclaw"],["OPENCODE","open_code"]];function UY(J){for(let[Z,$]of w9.AI_AGENTS)if(J[Z])return $;return""}w9.detectAIAgent=UY;function _0(J){let Z=($)=>{return $.headers.Authorization="Bearer "+J,Promise.resolve()};return Z._apiKey=J,Z}w9.createApiKeyAuthenticator=_0;function LY(J){let Z=J.reduce((G,z)=>G+z.length,0),$=new Uint8Array(Z),Q=0;return J.forEach((G)=>{$.set(G,Q),Q+=G.length}),$}w9.concat=LY;function VY(J,Z){if(this[J]instanceof Date)return Math.floor(this[J].getTime()/1000).toString();return Z}function WY(J){return JSON.stringify(J,VY)}w9.jsonStringifyRequestData=WY;function KY(J){if(!J)return"v1";return J.startsWith("/v2")?"v2":"v1"}w9.getAPIMode=KY;function Y9(J){if(Array.isArray(J))return J.join(", ");return String(J)}w9.parseHttpHeaderAsString=Y9;function TY(J){let Z=Array.isArray(J)?J[0]:J;return Number(Z)}w9.parseHttpHeaderAsNumber=TY;function NY(J){return Object.entries(J).map(([Z,$])=>{return[Z,Y9($)]})}w9.parseHeadersForFetch=NY});var K9=B((V9)=>{Object.defineProperty(V9,"__esModule",{value:!0});V9.FetchHttpClientResponse=V9.FetchHttpClient=void 0;var lY=_(),FJ=kJ();class J0 extends FJ.HttpClient{constructor(J){super();if(!J){if(!globalThis.fetch)throw Error("fetch() function not provided and is not defined in the global scope. You must provide a fetch implementation.");J=globalThis.fetch}if(globalThis.AbortController)this._fetchFn=J0.makeFetchWithAbortTimeout(J);else this._fetchFn=J0.makeFetchWithRaceTimeout(J)}static makeFetchWithRaceTimeout(J){return(Z,$,Q)=>{let G,z=new Promise((X,K)=>{G=setTimeout(()=>{G=null,K(FJ.HttpClient.makeTimeoutError())},Q)}),w=J(Z,$);return Promise.race([w,z]).finally(()=>{if(G)clearTimeout(G)})}}static makeFetchWithAbortTimeout(J){return async(Z,$,Q)=>{let G=new AbortController,z=setTimeout(()=>{z=null,G.abort(FJ.HttpClient.makeTimeoutError())},Q);try{return await J(Z,{...$,signal:G.signal})}catch(w){if(w.name==="AbortError")throw FJ.HttpClient.makeTimeoutError();else throw w}finally{if(z)clearTimeout(z)}}}getClientName(){return"fetch"}async makeRequest(J,Z,$,Q,G,z,w,X){let T=new URL($,`${w==="http"?"http":"https"}://${J}`);T.port=Z;let Y=Q=="POST"||Q=="PUT"||Q=="PATCH",V=z||(Y?"":void 0),W=await this._fetchFn(T.toString(),{method:Q,headers:(0,lY.parseHeadersForFetch)(G),body:V},X);return new Z0(W)}}V9.FetchHttpClient=J0;class Z0 extends FJ.HttpClientResponse{constructor(J){super(J.status,Z0._transformHeadersToObject(J.headers));this._res=J}getRawResponse(){return this._res}toStream(J){return J(),this._res.body}toJSON(){return this._res.json()}static _transformHeadersToObject(J){let Z={};for(let $ of J){if(!Array.isArray($)||$.length!=2)throw Error("Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.");Z[$[0]]=$[1]}return Z}}V9.FetchHttpClientResponse=Z0});var q9=B((H9)=>{Object.defineProperty(H9,"__esModule",{value:!0});H9.SubtleCryptoProvider=void 0;var T9=OJ();class N9 extends T9.CryptoProvider{constructor(J){super();this.subtleCrypto=J||crypto.subtle}computeHMACSignature(J,Z){throw new T9.CryptoProviderOnlySupportsAsyncError("SubtleCryptoProvider cannot be used in a synchronous context.")}async computeHMACSignatureAsync(J,Z){let $=new TextEncoder,Q=await this.subtleCrypto.importKey("raw",$.encode(Z),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),G=await this.subtleCrypto.sign("hmac",Q,$.encode(J)),z=new Uint8Array(G),w=Array(z.length);for(let X=0;X<z.length;X++)w[X]=u0[z[X]];return w.join("")}async computeSHA256Async(J){return new Uint8Array(await this.subtleCrypto.digest("SHA-256",J))}}H9.SubtleCryptoProvider=N9;var u0=Array(256);for(let J=0;J<u0.length;J++)u0[J]=J.toString(16).padStart(2,"0")});var F9=B((O9)=>{Object.defineProperty(O9,"__esModule",{value:!0});O9.PlatformFunctions=void 0;var cY=K9(),dY=q9();class E9{constructor(){this._fetchFn=null,this._agent=null}getPlatformInfo(){return null}uuid4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(J)=>{let Z=Math.random()*16|0;return(J==="x"?Z:Z&3|8).toString(16)})}secureCompare(J,Z){if(J.length!==Z.length)return!1;let $=J.length,Q=0;for(let G=0;G<$;++G)Q|=J.charCodeAt(G)^Z.charCodeAt(G);return Q===0}createEmitter(){throw Error("createEmitter not implemented.")}tryBufferData(J){throw Error("tryBufferData not implemented.")}createNodeHttpClient(J){throw Error("createNodeHttpClient not implemented.")}createFetchHttpClient(J){return new cY.FetchHttpClient(J)}createDefaultHttpClient(){throw Error("createDefaultHttpClient not implemented.")}createNodeCryptoProvider(){throw Error("createNodeCryptoProvider not implemented.")}createSubtleCryptoProvider(J){return new dY.SubtleCryptoProvider(J)}createDefaultCryptoProvider(){throw Error("createDefaultCryptoProvider not implemented.")}}O9.PlatformFunctions=E9});var CJ=B((b9)=>{Object.defineProperty(b9,"__esModule",{value:!0});b9.TemporarySessionExpiredError=b9.RateLimitError=b9.StripeUnsupportedResponseTypeError=b9.StripeUnsupportedGrantTypeError=b9.StripeInvalidScopeError=b9.StripeOAuthInvalidRequestError=b9.StripeInvalidClientError=b9.StripeInvalidGrantError=b9.StripeOAuthError=b9.StripeIdempotencyError=b9.StripeSignatureVerificationError=b9.StripeConnectionError=b9.StripeRateLimitError=b9.StripePermissionError=b9.StripeAuthenticationError=b9.StripeAPIError=b9.StripeInvalidRequestError=b9.StripeCardError=b9.StripeError=b9.generateV2Error=b9.generateOAuthError=b9.generateV1Error=void 0;var nY=(J)=>{let Z=J.statusCode;if(Z===429||Z===400&&J.code==="rate_limit")return new i0(J);if(Z===400||Z===404){if(J.type==="idempotency_error")return new Q0(J);return new $0(J)}if(Z===401)return new n0(J);if(Z===402)return new c0(J);if(Z===403)return new a0(J);return new d0(J)};b9.generateV1Error=nY;var aY=(J)=>{switch(J.type){case"invalid_grant":return new p0(J);case"invalid_client":return new o0(J);case"invalid_request":return new s0(J);case"invalid_scope":return new r0(J);case"unsupported_grant_type":return new t0(J);case"unsupported_response_type":return new e0(J);default:return new l(J)}};b9.generateOAuthError=aY;var iY=(J)=>{switch(J.type){case"idempotency_error":return new Q0(J);case"rate_limit":return new JZ(J);case"temporary_session_expired":return new ZZ(J)}switch(J.code){case"invalid_fields":return new $0(J)}return b9.generateV1Error(J)};b9.generateV2Error=iY;class g extends Error{constructor(J={},Z=null){super(J.message);this.type=Z||this.constructor.name,this.raw=J,this.rawType=J.type,this.code=J.code,this.doc_url=J.doc_url,this.param=J.param,this.detail=J.detail,this.headers=J.headers,this.requestId=J.requestId,this.statusCode=J.statusCode,this.message=J.message??"",this.userMessage=J.user_message,this.charge=J.charge,this.decline_code=J.decline_code,this.payment_intent=J.payment_intent,this.payment_method=J.payment_method,this.payment_method_type=J.payment_method_type,this.setup_intent=J.setup_intent,this.source=J.source}}b9.StripeError=g;g.generate=b9.generateV1Error;class c0 extends g{constructor(J={}){super(J,"StripeCardError")}}b9.StripeCardError=c0;class $0 extends g{constructor(J={}){super(J,"StripeInvalidRequestError")}}b9.StripeInvalidRequestError=$0;class d0 extends g{constructor(J={}){super(J,"StripeAPIError")}}b9.StripeAPIError=d0;class n0 extends g{constructor(J={}){super(J,"StripeAuthenticationError")}}b9.StripeAuthenticationError=n0;class a0 extends g{constructor(J={}){super(J,"StripePermissionError")}}b9.StripePermissionError=a0;class i0 extends g{constructor(J={}){super(J,"StripeRateLimitError")}}b9.StripeRateLimitError=i0;class C9 extends g{constructor(J={}){super(J,"StripeConnectionError")}}b9.StripeConnectionError=C9;class A9 extends g{constructor(J,Z,$={}){super($,"StripeSignatureVerificationError");this.header=J,this.payload=Z}}b9.StripeSignatureVerificationError=A9;class Q0 extends g{constructor(J={}){super(J,"StripeIdempotencyError")}}b9.StripeIdempotencyError=Q0;class l extends g{constructor(J={},Z="StripeOAuthError"){super(J,Z)}}b9.StripeOAuthError=l;class p0 extends l{constructor(J={}){super(J,"StripeInvalidGrantError")}}b9.StripeInvalidGrantError=p0;class o0 extends l{constructor(J={}){super(J,"StripeInvalidClientError")}}b9.StripeInvalidClientError=o0;class s0 extends l{constructor(J={}){super(J,"StripeOAuthInvalidRequestError")}}b9.StripeOAuthInvalidRequestError=s0;class r0 extends l{constructor(J={}){super(J,"StripeInvalidScopeError")}}b9.StripeInvalidScopeError=r0;class t0 extends l{constructor(J={}){super(J,"StripeUnsupportedGrantTypeError")}}b9.StripeUnsupportedGrantTypeError=t0;class e0 extends l{constructor(J={}){super(J,"StripeUnsupportedResponseTypeError")}}b9.StripeUnsupportedResponseTypeError=e0;class JZ extends g{constructor(J={}){super(J,"RateLimitError")}}b9.RateLimitError=JZ;class ZZ extends g{constructor(J={}){super(J,"TemporarySessionExpiredError")}}b9.TemporarySessionExpiredError=ZZ});var S9=B((g9)=>{Object.defineProperty(g9,"__esModule",{value:!0});g9.NodePlatformFunctions=void 0;var G0=BJ("crypto"),x9=BJ("events"),Kw=iZ(),P9=G9(),Tw=F9(),Nw=CJ(),Hw=_(),I9=BJ("os");class f9 extends Nw.StripeError{}class y9 extends Tw.PlatformFunctions{uuid4(){if(G0.randomUUID)return G0.randomUUID();return super.uuid4()}getPlatformInfo(){return`${process.platform} ${(0,I9.release)()} ${(0,I9.arch)()}`}secureCompare(J,Z){if(!J||!Z)throw Error("secureCompare must receive two arguments");if(J.length!==Z.length)return!1;if(G0.timingSafeEqual){let $=new TextEncoder,Q=$.encode(J),G=$.encode(Z);return G0.timingSafeEqual(Q,G)}return super.secureCompare(J,Z)}createEmitter(){return new x9.EventEmitter}tryBufferData(J){if(!(J.file.data instanceof x9.EventEmitter))return Promise.resolve(J);let Z=[];return new Promise(($,Q)=>{J.file.data.on("data",(G)=>{Z.push(G)}).once("end",()=>{let G=Object.assign({},J);G.file.data=(0,Hw.concat)(Z),$(G)}).on("error",(G)=>{Q(new f9({message:"An error occurred while attempting to process the file for upload.",detail:G}))})})}createNodeHttpClient(J){return new P9.NodeHttpClient(J)}createDefaultHttpClient(){return new P9.NodeHttpClient}createNodeCryptoProvider(){return new Kw.NodeCryptoProvider}createDefaultCryptoProvider(){return this.createNodeCryptoProvider()}}g9.NodePlatformFunctions=y9});var m9=B((j9)=>{Object.defineProperty(j9,"__esModule",{value:!0});j9.RequestSender=void 0;var YJ=CJ(),M9=kJ(),S=_(),Dw=60;class AJ{constructor(J,Z){this._stripe=J,this._maxBufferedRequestMetric=Z}_normalizeStripeContext(J,Z){if(J)return J.toString()||null;return Z?.toString()||null}_addHeadersDirectlyToObject(J,Z){J.requestId=Z["request-id"],J.stripeAccount=J.stripeAccount||Z["stripe-account"],J.apiVersion=J.apiVersion||Z["stripe-version"],J.idempotencyKey=J.idempotencyKey||Z["idempotency-key"]}_makeResponseEvent(J,Z,$){let Q=Date.now(),G=Q-J.request_start_time;return(0,S.removeNullish)({api_version:$["stripe-version"],account:$["stripe-account"],idempotency_key:$["idempotency-key"],method:J.method,path:J.path,status:Z,request_id:this._getRequestId($),elapsed:G,request_start_time:J.request_start_time,request_end_time:Q})}_getRequestId(J){return J["request-id"]}_streamingResponseHandler(J,Z,$){return(Q)=>{let G=Q.getHeaders(),z=()=>{let X=this._makeResponseEvent(J,Q.getStatusCode(),G);this._stripe._emitter.emit("response",X),this._recordRequestMetrics(this._getRequestId(G),X.elapsed,Z)},w=Q.toStream(z);return this._addHeadersDirectlyToObject(w,G),$(null,w)}}_jsonResponseHandler(J,Z,$,Q){return(G)=>{let z=G.getHeaders(),w=this._getRequestId(z),X=G.getStatusCode(),K=this._makeResponseEvent(J,X,z);this._stripe._emitter.emit("response",K),G.toJSON().then((T)=>{if(T.error){let Y=typeof T.error==="string";if(Y)T.error={type:T.error,message:T.error_description};T.error.headers=z,T.error.statusCode=X,T.error.requestId=w;let V;if(Y)V=(0,YJ.generateOAuthError)(T.error);else if(Z==="v2")V=(0,YJ.generateV2Error)(T.error);else V=(0,YJ.generateV1Error)(T.error);throw V}return T},(T)=>{throw new YJ.StripeAPIError({message:"Invalid JSON received from the Stripe API",exception:T,requestId:z["request-id"]})}).then((T)=>{this._recordRequestMetrics(w,K.elapsed,$);let Y=G.getRawResponse();this._addHeadersDirectlyToObject(Y,z),Object.defineProperty(T,"lastResponse",{enumerable:!1,writable:!1,value:Y}),Q(null,T)},(T)=>Q(T,null))}}static _generateConnectionErrorMessage(J){return`An error occurred with our connection to Stripe.${J>0?` Request was retried ${J} times.`:""}`}static _shouldRetry(J,Z,$,Q){if(Q&&Z===0&&M9.HttpClient.CONNECTION_CLOSED_ERROR_CODES.includes(Q.code))return!0;if(Z>=$)return!1;if(!J)return!0;if(J.getHeaders()["stripe-should-retry"]==="false")return!1;if(J.getHeaders()["stripe-should-retry"]==="true")return!0;if(J.getStatusCode()===409)return!0;if(J.getStatusCode()>=500)return!0;return!1}_getSleepTimeInMS(J,Z=null){let $=this._stripe.getInitialNetworkRetryDelay(),Q=this._stripe.getMaxNetworkRetryDelay(),G=Math.min($*Math.pow(2,J-1),Q);if(G*=0.5*(1+Math.random()),G=Math.max($,G),Number.isInteger(Z)&&Z<=Dw)G=Math.max(G,Z);return G*1000}_getMaxNetworkRetries(J={}){return J.maxNetworkRetries!==void 0&&Number.isInteger(J.maxNetworkRetries)?J.maxNetworkRetries:this._stripe.getMaxNetworkRetries()}_defaultIdempotencyKey(J,Z,$){let Q=this._getMaxNetworkRetries(Z),G=()=>`stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`;if($==="v2"){if(J==="POST"||J==="DELETE")return G()}else if($==="v1"){if(J==="POST"&&Q>0)return G()}return null}_makeHeaders({contentType:J,contentLength:Z,apiVersion:$,clientUserAgent:Q,method:G,userSuppliedHeaders:z,userSuppliedSettings:w,stripeAccount:X,stripeContext:K,apiMode:T}){let Y={Accept:"application/json","Content-Type":J,"User-Agent":this._getUserAgentString(T),"X-Stripe-Client-User-Agent":Q,"X-Stripe-Client-Telemetry":this._getTelemetryHeader(),"Stripe-Version":$,"Stripe-Account":X,"Stripe-Context":K,"Idempotency-Key":this._defaultIdempotencyKey(G,w,T)},V=G=="POST"||G=="PUT"||G=="PATCH";if(V||Z){if(!V)(0,S.emitWarning)(`${G} method had non-zero contentLength but no payload is expected for this verb`);Y["Content-Length"]=Z}return Object.assign((0,S.removeNullish)(Y),(0,S.normalizeHeaders)(z))}_getUserAgentString(J){let Z=this._stripe.getConstant("PACKAGE_VERSION"),$=this._stripe._appInfo?this._stripe.getAppInfoAsString():"",Q=this._stripe.getConstant("AI_AGENT"),G=`Stripe/${J} NodeBindings/${Z}`;if($)G+=` ${$}`;if(Q)G+=` AIAgent/${Q}`;return G}_getTelemetryHeader(){if(this._stripe.getTelemetryEnabled()&&this._stripe._prevRequestMetrics.length>0){let J=this._stripe._prevRequestMetrics.shift();return JSON.stringify({last_request_metrics:J})}}_recordRequestMetrics(J,Z,$){if(this._stripe.getTelemetryEnabled()&&J)if(this._stripe._prevRequestMetrics.length>this._maxBufferedRequestMetric)(0,S.emitWarning)("Request metrics buffer is full, dropping telemetry message.");else{let Q={request_id:J,request_duration_ms:Z};if($&&$.length>0)Q.usage=$;this._stripe._prevRequestMetrics.push(Q)}}_rawRequest(J,Z,$,Q,G){return new Promise((w,X)=>{let K;try{let D=J.toUpperCase();if(D!=="POST"&&$&&Object.keys($).length!==0)throw Error("rawRequest only supports params on POST requests. Please pass null and add your parameters to path.");let L=[].slice.call([$,Q]),N=(0,S.getDataFromArgs)(L),q=D==="POST"?Object.assign({},N):null,O=(0,S.getOptionsFromArgs)(L),k=O.headers,b=O.authenticator;K={requestMethod:D,requestPath:Z,bodyData:q,queryData:{},authenticator:b,headers:k,host:O.host,streaming:!!O.streaming,settings:{},usage:G||["raw_request"]}}catch(D){X(D);return}function T(D,L){if(D)X(D);else w(L)}let{headers:Y,settings:V}=K,W=K.authenticator;this._request(K.requestMethod,K.host,Z,K.bodyData,W,{headers:Y,settings:V,streaming:K.streaming},K.usage,T)})}_getContentLength(J){return typeof J==="string"?new TextEncoder().encode(J).length:J.length}_request(J,Z,$,Q,G,z,w=[],X,K=null){let T;G=G??this._stripe._authenticator??null;let Y=(0,S.getAPIMode)($),V=(L,N,q,O,k)=>{return setTimeout(L,this._getSleepTimeInMS(O,k),N,q,O+1)},W=(L,N,q)=>{let O=z.settings&&z.settings.timeout&&Number.isInteger(z.settings.timeout)&&z.settings.timeout>=0?z.settings.timeout:this._stripe.getApiField("timeout"),k={host:Z||this._stripe.getApiField("host"),port:this._stripe.getApiField("port"),path:$,method:J,headers:Object.assign({},N),body:T,protocol:this._stripe.getApiField("protocol")};G(k).then(()=>{let b=this._stripe.getApiField("httpClient").makeRequest(k.host,k.port,k.path,k.method,k.headers,k.body,k.protocol,O),I=Date.now(),f=(0,S.removeNullish)({api_version:L,account:(0,S.parseHttpHeaderAsString)(N["Stripe-Account"]),idempotency_key:(0,S.parseHttpHeaderAsString)(N["Idempotency-Key"]),method:J,path:$,request_start_time:I}),y=q||0,EJ=this._getMaxNetworkRetries(z.settings||{});this._stripe._emitter.emit("request",f),b.then((R)=>{if(AJ._shouldRetry(R,y,EJ))return V(W,L,N,y,(0,S.parseHttpHeaderAsNumber)(R.getHeaders()["retry-after"]));else if(z.streaming&&R.getStatusCode()<400)return this._streamingResponseHandler(f,w,X)(R);else return this._jsonResponseHandler(f,Y,w,X)(R)}).catch((R)=>{if(AJ._shouldRetry(null,y,EJ,R))return V(W,L,N,y,null);else{let SX=R.code&&R.code===M9.HttpClient.TIMEOUT_ERROR_CODE;return X(new YJ.StripeConnectionError({message:SX?`Request aborted due to timeout being reached (${O}ms)`:AJ._generateConnectionErrorMessage(y),detail:R}))}})}).catch((b)=>{throw new YJ.StripeError({message:"Unable to authenticate the request",exception:b})})},D=(L,N)=>{if(L)return X(L);T=N,this._stripe.getClientUserAgent((q)=>{let O=this._stripe.getApiField("version"),k=this._makeHeaders({contentType:Y=="v2"?"application/json":"application/x-www-form-urlencoded",contentLength:this._getContentLength(N),apiVersion:O,clientUserAgent:q,method:J,userSuppliedHeaders:z.headers??null,userSuppliedSettings:z.settings??{},stripeAccount:z.stripeAccount??this._stripe.getApiField("stripeAccount"),stripeContext:this._normalizeStripeContext(z.stripeContext,this._stripe.getApiField("stripeContext")),apiMode:Y});W(O,k,0)})};if(K)K(J,Q,z.headers,D);else{let L;if(Y=="v2")L=Q?(0,S.jsonStringifyRequestData)(Q):"";else L=(0,S.queryStringifyRequestData)(Q||{});D(null,L)}}}j9.RequestSender=AJ});var a9=B((d9)=>{Object.defineProperty(d9,"__esModule",{value:!0});d9.makeAutoPaginationMethods=void 0;var z0=_();class GZ{constructor(J,Z,$,Q){this.index=0,this.pagePromise=J,this.promiseCache={currentPromise:null},this.requestArgs=Z,this.spec=$,this.stripeResource=Q}async iterate(J){if(!(J&&J.data&&typeof J.data.length==="number"))throw Error("Unexpected: Stripe API response does not have a well-formed `data` array.");let Z=c9(this.requestArgs);if(this.index<J.data.length){let $=Z?J.data.length-1-this.index:this.index,Q=J.data[$];return this.index+=1,{value:Q,done:!1}}else if(J.has_more){this.index=0,this.pagePromise=this.getNextPage(J);let $=await this.pagePromise;return this.iterate($)}return{done:!0,value:void 0}}getNextPage(J){throw Error("Unimplemented")}async _next(){return this.iterate(await this.pagePromise)}next(){if(this.promiseCache.currentPromise)return this.promiseCache.currentPromise;let J=(async()=>{let Z=await this._next();return this.promiseCache.currentPromise=null,Z})();return this.promiseCache.currentPromise=J,J}}class h9 extends GZ{getNextPage(J){let Z=c9(this.requestArgs),$=Fw(J,Z);return this.stripeResource._makeRequest(this.requestArgs,this.spec,{[Z?"ending_before":"starting_after"]:$})}}class l9 extends GZ{getNextPage(J){if(!J.next_page)throw Error("Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.");return this.stripeResource._makeRequest(this.requestArgs,this.spec,{page:J.next_page})}}class u9{constructor(J,Z,$,Q){this.firstPagePromise=J,this.currentPageIterator=null,this.nextPageUrl=null,this.requestArgs=Z,this.spec=$,this.stripeResource=Q}async initFirstPage(){if(this.firstPagePromise){let J=await this.firstPagePromise;this.firstPagePromise=null,this.currentPageIterator=J.data[Symbol.iterator](),this.nextPageUrl=J.next_page_url||null}}async turnPage(){if(!this.nextPageUrl)return null;this.spec.fullPath=this.nextPageUrl;let J=await this.stripeResource._makeRequest([],this.spec,{});return this.nextPageUrl=J.next_page_url||null,this.currentPageIterator=J.data[Symbol.iterator](),this.currentPageIterator}async next(){if(await this.initFirstPage(),this.currentPageIterator){let $=this.currentPageIterator.next();if(!$.done)return{done:!1,value:$.value}}let J=await this.turnPage();if(!J)return{done:!0,value:void 0};let Z=J.next();if(!Z.done)return{done:!1,value:Z.value};return{done:!0,value:void 0}}}var qw=(J,Z,$,Q)=>{let G=(0,z0.getAPIMode)($.fullPath||$.path);if(G!=="v2"&&$.methodType==="search")return QZ(new l9(Q,Z,$,J));if(G!=="v2"&&$.methodType==="list")return QZ(new h9(Q,Z,$,J));if(G==="v2"&&$.methodType==="list")return QZ(new u9(Q,Z,$,J));return null};d9.makeAutoPaginationMethods=qw;var QZ=(J)=>{let Z=Cw((...G)=>J.next(...G)),$=Aw(Z),Q={autoPagingEach:Z,autoPagingToArray:$,next:()=>J.next(),return:()=>{return{}},[Ew()]:()=>{return Q}};return Q};function Ew(){if(typeof Symbol<"u"&&Symbol.asyncIterator)return Symbol.asyncIterator;return"@@asyncIterator"}function Ow(J){if(J.length<2)return null;let Z=J[1];if(typeof Z!=="function")throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof Z}`);return Z}function kw(J){if(J.length===0)return;let Z=J[0];if(typeof Z!=="function")throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof Z}`);if(Z.length===2)return Z;if(Z.length>2)throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${Z}`);return function(Q,G){let z=Z(Q);G(z)}}function Fw(J,Z){let $=Z?0:J.data.length-1,Q=J.data[$],G=Q&&Q.id;if(!G)throw Error("Unexpected: No `id` found on the last item while auto-paging a list.");return G}function Cw(J){return function(){let $=[].slice.call(arguments),Q=kw($),G=Ow($);if($.length>2)throw Error(`autoPagingEach takes up to two arguments; received ${$}`);let z=bw(J,Q);return(0,z0.callbackifyPromiseWithTimeout)(z,G)}}function Aw(J){return function($,Q){let G=$&&$.limit;if(!G)throw Error("You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.");if(G>1e4)throw Error("You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.");let z=new Promise((w,X)=>{let K=[];J((T)=>{if(K.push(T),K.length>=G)return!1}).then(()=>{w(K)}).catch(X)});return(0,z0.callbackifyPromiseWithTimeout)(z,Q)}}function bw(J,Z){return new Promise(($,Q)=>{function G(z){if(z.done){$();return}let w=z.value;return new Promise((X)=>{Z(w,X)}).then((X)=>{if(X===!1)return G({done:!0,value:void 0});else return J().then(G)})}J().then(G).catch(Q)})}function c9(J){let Z=[].slice.call(J);return!!(0,z0.getDataFromArgs)(Z).ending_before}});var s9=B((p9)=>{Object.defineProperty(p9,"__esModule",{value:!0});p9.stripeMethod=void 0;var i9=_(),vw=a9();function xw(J){if(J.path!==void 0&&J.fullPath!==void 0)throw Error(`Method spec specified both a 'path' (${J.path}) and a 'fullPath' (${J.fullPath}).`);return function(...Z){let $=typeof Z[Z.length-1]=="function"&&Z.pop();J.urlParams=(0,i9.extractUrlParams)(J.fullPath||this.createResourcePathWithSymbols(J.path||""));let Q=(0,i9.callbackifyPromiseWithTimeout)(this._makeRequest(Z,J,{}),$);return Object.assign(Q,(0,vw.makeAutoPaginationMethods)(this,Z,J,Q)),Q}}p9.stripeMethod=xw});var X0=B((t9)=>{Object.defineProperty(t9,"__esModule",{value:!0});t9.Decimal=t9.isDecimal=t9.DEFAULT_DIV_PRECISION=void 0;var Pw={"ubb-usage-count":{mode:"significant-figures",value:15},"v1-api":{mode:"decimal-places",value:12}};t9.DEFAULT_DIV_PRECISION=34;var r9=30,B0=1e6;class v{constructor(J,Z){let[$,Q]=v.normalize(J,Z);this._coefficient=$,this._exponent=Q,Object.freeze(this)}static normalize(J,Z){if(J===0n)return[0n,0];let $=J,Q=Z;while($!==0n&&$%10n===0n)$/=10n,Q+=1;return[$,Q]}static roundDivision(J,Z,$,Q){if(Z===0n)return J;if(Q==="round-down")return J;let G=Z>0n===$>0n?1n:-1n;if(Q==="round-up")return J+G;if(Q==="ceil")return G===1n?J+1n:J;if(Q==="floor")return G===-1n?J-1n:J;let z=Z<0n?-Z:Z,w=$<0n?-$:$,X=z*2n,K;if(X===w)K=0;else if(X<w)K=-1;else K=1;if(K<0)return J;if(K>0)return J+G;if(Q==="half-up")return J+G;if(Q==="half-down")return J;if(J%2n===0n)return J;else return J+G}add(J){let Z=J;if(this._exponent===Z._exponent)return new v(this._coefficient+Z._coefficient,this._exponent);if(this._exponent<Z._exponent){let $=10n**BigInt(Z._exponent-this._exponent);return new v(this._coefficient+Z._coefficient*$,this._exponent)}else{let $=10n**BigInt(this._exponent-Z._exponent);return new v(this._coefficient*$+Z._coefficient,Z._exponent)}}sub(J){let Z=J;if(this._exponent===Z._exponent)return new v(this._coefficient-Z._coefficient,this._exponent);if(this._exponent<Z._exponent){let $=10n**BigInt(Z._exponent-this._exponent);return new v(this._coefficient-Z._coefficient*$,this._exponent)}else{let $=10n**BigInt(this._exponent-Z._exponent);return new v(this._coefficient*$-Z._coefficient,Z._exponent)}}mul(J){let Z=J;return new v(this._coefficient*Z._coefficient,this._exponent+Z._exponent)}div(J,Z,$){if(Z<0||!Number.isInteger(Z))throw Error("precision must be a non-negative integer");let Q=J;if(Q._coefficient===0n)throw Error("Division by zero");let G=this._exponent-Q._exponent+Z,z,w,X;if(G>=0){let T=this._coefficient*10n**BigInt(G);z=T/Q._coefficient,w=T%Q._coefficient,X=Q._coefficient}else{let T=Q._coefficient*10n**BigInt(-G);z=this._coefficient/T,w=this._coefficient%T,X=T}let K=v.roundDivision(z,w,X,$);return new v(K,-Z)}cmp(J){let Z=J;if(this._exponent===Z._exponent){if(this._coefficient<Z._coefficient)return-1;if(this._coefficient>Z._coefficient)return 1;return 0}if(this._exponent<Z._exponent){let $=10n**BigInt(Z._exponent-this._exponent),Q=Z._coefficient*$;if(this._coefficient<Q)return-1;if(this._coefficient>Q)return 1;return 0}else{let $=10n**BigInt(this._exponent-Z._exponent),Q=this._coefficient*$;if(Q<Z._coefficient)return-1;if(Q>Z._coefficient)return 1;return 0}}eq(J){return this.cmp(J)===0}lt(J){return this.cmp(J)===-1}lte(J){return this.cmp(J)<=0}gt(J){return this.cmp(J)===1}gte(J){return this.cmp(J)>=0}isZero(){return this._coefficient===0n}isNegative(){return this._coefficient<0n}isPositive(){return this._coefficient>0n}neg(){return new v(-this._coefficient,this._exponent)}abs(){if(this._coefficient<0n)return new v(-this._coefficient,this._exponent);return this}round(J,Z){let $=typeof Z==="string"?Pw[Z]:Z;if($===void 0)throw Error(`Unknown rounding preset: "${Z}"`);if($.value<0||!Number.isInteger($.value))throw Error("DecimalRoundingOptions.value must be a non-negative integer");if($.mode==="decimal-places"){let Y=this.toFixed($.value,J);return t9.Decimal.from(Y)}if(this._coefficient===0n)return this;let G=(this._coefficient<0n?(-this._coefficient).toString():this._coefficient.toString()).length;if($.value===0)return t9.Decimal.zero;if(G<=$.value)return this;let z=G-$.value,w=10n**BigInt(z),X=this._coefficient/w,K=this._coefficient%w,T=v.roundDivision(X,K,w,J);return new v(T,this._exponent+z)}toString(){if(this._coefficient===0n)return"0";let J=this._coefficient.toString(),Z=J.startsWith("-"),$=Z?J.slice(1):J;if(this._exponent<0){let G=-this._exponent;if((G>=$.length?G-$.length:0)>r9){if($.length===1)return`${J}E${String(this._exponent)}`;let w=$[0]??"",X=$.slice(1),K=this._exponent+$.length-1;return`${Z?"-":""}${w}.${X}E${String(K)}`}if(G>=$.length){let w="0".repeat(G-$.length);return`${Z?"-":""}0.${w}${$}`}else{let w=$.slice(0,$.length-G),X=$.slice($.length-G);return`${Z?"-":""}${w}.${X}`}}if($.length+this._exponent<=r9){if(this._exponent===0)return J;let G="0".repeat(this._exponent);return`${Z?"-":""}${$}${G}`}else{if($.length===1)return`${J}E+${String(this._exponent)}`;let G=$[0]??"",z=$.slice(1),w=this._exponent+$.length-1;return`${Z?"-":""}${G}.${z}E+${String(w)}`}}toJSON(){return this.toString()}toNumber(){return Number(this.toString())}toFixed(J,Z){if(J<0||!Number.isInteger(J))throw Error("decimalPlaces must be a non-negative integer");let $=(G)=>{let z=G.toString(),w=z.startsWith("-"),X=w?z.slice(1):z;if(J===0)return z;if(J>=X.length){let K="0".repeat(J-X.length);return`${w?"-":""}0.${K}${X}`}else{let K=X.slice(0,X.length-J),T=X.slice(X.length-J);return`${w?"-":""}${K}.${T}`}},Q=-J;if(this._exponent===Q)return $(this._coefficient);if(this._exponent<Q){let G=Q-this._exponent,z=10n**BigInt(G),w=this._coefficient/z,X=this._coefficient%z,K=v.roundDivision(w,X,z,Z);return $(K)}else{let G=this._exponent-Q,z=this._coefficient*10n**BigInt(G);return $(z)}}valueOf(){return this.toString()}}function Iw(J){return J instanceof v}t9.isDecimal=Iw;t9.Decimal={from(J){if(typeof J==="bigint")return new v(J,0);if(typeof J==="number"){if(!Number.isFinite(J))throw Error("Number must be finite");return t9.Decimal.from(J.toString())}let Z=J.trim();if(Z==="")throw Error("Cannot parse empty string as Decimal");let $=/^([+-]?)(\d+)(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/.exec(Z);if(!$)throw Error(`Invalid decimal string: ${J}`);let Q=$[1]==="-"?-1n:1n,G=$[2]??"",z=$[3]??"",w=$[4]?Number($[4]):0;if(!Number.isSafeInteger(w)||w>B0||w<-B0)throw Error(`Exponent out of range: ${String($[4])} exceeds safe integer bounds`);let X=G+z,K=Q*BigInt(X),T=w-z.length;if(!Number.isSafeInteger(T)||T>B0||T<-B0)throw Error(`Computed exponent out of range: ${String(T)} exceeds safe integer bounds`);return new v(K,T)},zero:new v(0n,0)}});var J$=B((e9)=>{Object.defineProperty(e9,"__esModule",{value:!0});e9.coerceV2ResponseData=e9.coerceV2RequestData=void 0;var gw=X0(),Rw=(J,Z)=>{if(J==null)return J;switch(Z.kind){case"int64_string":return typeof J==="bigint"||typeof J==="number"?String(J):J;case"decimal_string":return typeof J.toFixed==="function"&&typeof J.isZero==="function"?J.toString():J;case"object":{if(typeof J!=="object"||Array.isArray(J))return J;let $=J,Q={};for(let G of Object.keys($)){let z=Z.fields[G];Q[G]=z?e9.coerceV2RequestData($[G],z):$[G]}return Q}case"array":{if(!Array.isArray(J))return J;return J.map(($)=>e9.coerceV2RequestData($,Z.element))}case"nullable":return e9.coerceV2RequestData(J,Z.inner)}};e9.coerceV2RequestData=Rw;var Sw=(J,Z)=>{if(J==null)return J;switch(Z.kind){case"int64_string":if(typeof J==="string")try{return BigInt(J)}catch{throw Error(`Failed to coerce int64_string value: expected an integer string, got '${J}'`)}return J;case"decimal_string":if(typeof J==="string")try{return gw.Decimal.from(J)}catch{throw Error(`Failed to coerce decimal_string value: expected a decimal string, got '${J}'`)}return J;case"object":{if(typeof J!=="object"||Array.isArray(J))return J;let $=J;for(let Q of Object.keys(Z.fields))if(Q in $)$[Q]=e9.coerceV2ResponseData($[Q],Z.fields[Q]);return $}case"array":{if(!Array.isArray(J))return J;for(let $=0;$<J.length;$++)J[$]=e9.coerceV2ResponseData(J[$],Z.element);return J}case"nullable":return e9.coerceV2ResponseData(J,Z.inner)}};e9.coerceV2ResponseData=Sw});var U=B(($$)=>{Object.defineProperty($$,"__esModule",{value:!0});$$.StripeResource=void 0;var r=_(),Mw=s9(),Z$=J$();xJ.extend=r.protoExtend;xJ.method=Mw.stripeMethod;xJ.MAX_BUFFERED_REQUEST_METRICS=100;function xJ(J,Z){if(this._stripe=J,Z)throw Error("Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.");this.basePath=(0,r.makeURLInterpolator)(this.basePath||J.getApiField("basePath")),this.resourcePath=this.path,this.path=(0,r.makeURLInterpolator)(this.path),this.initialize(...arguments)}$$.StripeResource=xJ;xJ.prototype={_stripe:null,path:"",resourcePath:"",basePath:null,initialize(){},requestDataProcessor:null,validateRequest:null,createFullPath(J,Z){let $=[this.basePath(Z),this.path(Z)];if(typeof J==="function"){let Q=J(Z);if(Q)$.push(Q)}else $.push(J);return this._joinUrlParts($)},createResourcePathWithSymbols(J){if(J)return`/${this._joinUrlParts([this.resourcePath,J])}`;else return`/${this.resourcePath}`},_joinUrlParts(J){return J.join("/").replace(/\/{2,}/g,"/")},_getRequestOpts(J,Z,$){let Q=(Z.method||"GET").toUpperCase(),G=Z.usage||[],z=Z.urlParams||[],w=Z.encode||((y)=>y),X=!!Z.fullPath,K=(0,r.makeURLInterpolator)(X?Z.fullPath:Z.path||""),T=X?Z.fullPath:this.createResourcePathWithSymbols(Z.path),Y=[].slice.call(J),V=z.reduce((y,EJ)=>{let R=Y.shift();if(typeof R!=="string")throw Error(`Stripe: Argument "${EJ}" must be a string, but got: ${R} (on API request to \`${Q} ${T}\`)`);return y[EJ]=R,y},{}),W=(0,r.getDataFromArgs)(Y),D=w(Object.assign({},W,$)),L=(0,r.getOptionsFromArgs)(Y),N=L.host||Z.host,q=!!Z.streaming||!!L.streaming;if(Y.filter((y)=>y!=null).length)throw Error(`Stripe: Unknown arguments (${Y}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${Q} \`${T}\`)`);let O=X?K(V):this.createFullPath(K,V),k=Object.assign(L.headers,Z.headers);if(Z.validator)Z.validator(D,{headers:k});let b=Z.method==="GET"||Z.method==="DELETE";return{requestMethod:Q,requestPath:O,bodyData:b?null:D,queryData:b?D:{},authenticator:L.authenticator??null,headers:k,host:N??null,streaming:q,settings:L.settings,usage:G}},_makeRequest(J,Z,$){return new Promise((Q,G)=>{let z;try{z=this._getRequestOpts(J,Z,$)}catch(V){G(V);return}if(Z.requestSchema&&z.bodyData)z.bodyData=(0,Z$.coerceV2RequestData)(z.bodyData,Z.requestSchema);function w(V,W){if(V)G(V);else try{if(Z.responseSchema)(0,Z$.coerceV2ResponseData)(W,Z.responseSchema);Q(Z.transformResponseData?Z.transformResponseData(W):W)}catch(D){G(D)}}let X=Object.keys(z.queryData).length===0,K=[z.requestPath,X?"":"?",(0,r.queryStringifyRequestData)(z.queryData)].join(""),{headers:T,settings:Y}=z;this._stripe._requestSender._request(z.requestMethod,z.host,K,z.bodyData,z.authenticator,{headers:T,settings:Y,streaming:z.streaming},z.usage,w,this.requestDataProcessor?.bind(this))})}}});var B$=B((G$)=>{Object.defineProperty(G$,"__esModule",{value:!0});G$.StripeContext=void 0;class wJ{constructor(J=[]){this._segments=[...J]}get segments(){return[...this._segments]}push(J){if(!J)throw Error("Segment cannot be null or undefined");return new wJ([...this._segments,J])}pop(){if(this._segments.length===0)throw Error("Cannot pop from an empty context");return new wJ(this._segments.slice(0,-1))}toString(){return this._segments.join("/")}static parse(J){if(!J)return new wJ([]);return new wJ(J.split("/"))}}G$.StripeContext=wJ});var w$=B((X$)=>{Object.defineProperty(X$,"__esModule",{value:!0});X$.createWebhooks=void 0;var n=CJ(),jw=OJ();function _w(J){let Z={DEFAULT_TOLERANCE:300,signature:null,constructEvent(Y,V,W,D,L,N){try{if(!this.signature)throw Error("ERR: missing signature helper, unable to verify");this.signature.verifyHeader(Y,V,W,D||Z.DEFAULT_TOLERANCE,L,N)}catch(O){if(O instanceof jw.CryptoProviderOnlySupportsAsyncError)O.message+="\nUse `await constructEventAsync(...)` instead of `constructEvent(...)`";throw O}let q=Y instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(Y)):JSON.parse(Y);if(q&&q.object==="v2.core.event")throw Error("You passed an event notification to stripe.webhooks.constructEvent, which expects a webhook payload. Use stripe.parseEventNotification instead.");return q},async constructEventAsync(Y,V,W,D,L,N){if(!this.signature)throw Error("ERR: missing signature helper, unable to verify");await this.signature.verifyHeaderAsync(Y,V,W,D||Z.DEFAULT_TOLERANCE,L,N);let q=Y instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(Y)):JSON.parse(Y);if(q&&q.object==="v2.core.event")throw Error("You passed an event notification to stripe.webhooks.constructEvent, which expects a webhook payload. Use stripe.parseEventNotification instead.");return q},generateTestHeaderString:function(Y){let V=T(Y),W=V.signature||V.cryptoProvider.computeHMACSignature(V.payloadString,V.secret);return V.generateHeaderString(W)},generateTestHeaderStringAsync:async function(Y){let V=T(Y),W=V.signature||await V.cryptoProvider.computeHMACSignatureAsync(V.payloadString,V.secret);return V.generateHeaderString(W)}},$={EXPECTED_SCHEME:"v1",verifyHeader(Y,V,W,D,L,N){let{decodedHeader:q,decodedPayload:O,details:k,suspectPayloadType:b}=G(Y,V,this.EXPECTED_SCHEME),I=/\s/.test(W);L=L||K();let f=L.computeHMACSignature(Q(O,k),W);return z(O,q,k,f,D,b,I,N),!0},async verifyHeaderAsync(Y,V,W,D,L,N){let{decodedHeader:q,decodedPayload:O,details:k,suspectPayloadType:b}=G(Y,V,this.EXPECTED_SCHEME),I=/\s/.test(W);L=L||K();let f=await L.computeHMACSignatureAsync(Q(O,k),W);return z(O,q,k,f,D,b,I,N)}};function Q(Y,V){return`${V.timestamp}.${Y}`}function G(Y,V,W){if(!Y)throw new n.StripeSignatureVerificationError(V,Y,{message:"No webhook payload was provided."});let D=typeof Y!="string"&&!(Y instanceof Uint8Array),L=new TextDecoder("utf8"),N=Y instanceof Uint8Array?L.decode(Y):Y;if(Array.isArray(V))throw Error("Unexpected: An array was passed as a header, which should not be possible for the stripe-signature header.");if(V==null||V=="")throw new n.StripeSignatureVerificationError(V,Y,{message:"No stripe-signature header value was provided."});let q=V instanceof Uint8Array?L.decode(V):V,O=w(q,W);if(!O||O.timestamp===-1)throw new n.StripeSignatureVerificationError(q,N,{message:"Unable to extract timestamp and signatures from header"});if(!O.signatures.length)throw new n.StripeSignatureVerificationError(q,N,{message:"No signatures found with expected scheme"});return{decodedPayload:N,decodedHeader:q,details:O,suspectPayloadType:D}}function z(Y,V,W,D,L,N,q,O){let k=!!W.signatures.filter(J.secureCompare.bind(J,D)).length,b=`
3
- Learn more about webhook signing and explore webhook integration examples for various frameworks at https://docs.stripe.com/webhooks/signature`,I=q?`
4
-
5
- Note: The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value`:"";if(!k){if(N)throw new n.StripeSignatureVerificationError(V,Y,{message:`Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead.
6
- Signature verification is impossible without access to the original signed material.
7
- `+b+`
8
- `+I});throw new n.StripeSignatureVerificationError(V,Y,{message:`No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?
9
- If a webhook request is being forwarded by a third-party tool, ensure that the exact request body, including JSON formatting and new line style, is preserved.
10
- `+b+`
11
- `+I})}let f=Math.floor((typeof O==="number"?O:Date.now())/1000)-W.timestamp;if(L>0&&f>L)throw new n.StripeSignatureVerificationError(V,Y,{message:"Timestamp outside the tolerance zone"});return!0}function w(Y,V){if(typeof Y!=="string")return null;return Y.split(",").reduce((W,D)=>{let L=D.split("=");if(L[0]==="t")W.timestamp=parseInt(L[1],10);if(L[0]===V)W.signatures.push(L[1]);return W},{timestamp:-1,signatures:[]})}let X=null;function K(){if(!X)X=J.createDefaultCryptoProvider();return X}function T(Y){if(!Y)throw new n.StripeError({message:"Options are required"});let V=Math.floor(Y.timestamp)||Math.floor(Date.now()/1000),W=Y.scheme||$.EXPECTED_SCHEME,D=Y.cryptoProvider||K(),L=`${V}.${Y.payload}`;return{...Y,timestamp:V,scheme:W,cryptoProvider:D,payloadString:L,generateHeaderString:(q)=>{return`t=${V},${W}=${q}`}}}return Z.signature=$,Z}X$.createWebhooks=_w});var V$=B((U$)=>{Object.defineProperty(U$,"__esModule",{value:!0});U$.ApiMajorVersion=U$.ApiVersion=void 0;U$.ApiVersion="2026-03-25.dahlia";U$.ApiMajorVersion="dahlia"});var T$=B((W$)=>{Object.defineProperty(W$,"__esModule",{value:!0});W$.resourceNamespace=void 0;function hw(J,Z){for(let $ in Z){if(!Object.prototype.hasOwnProperty.call(Z,$))continue;let Q=$[0].toLowerCase()+$.substring(1),G=new Z[$](J);this[Q]=G}}function lw(J,Z){return function($){return new hw($,Z)}}W$.resourceNamespace=lw});var q$=B((H$)=>{Object.defineProperty(H$,"__esModule",{value:!0});H$.AccountLinks=void 0;var N$=U(),uw=N$.StripeResource.method;H$.AccountLinks=N$.StripeResource.extend({create:uw({method:"POST",fullPath:"/v2/core/account_links"})})});var C$=B((k$)=>{Object.defineProperty(k$,"__esModule",{value:!0});k$.AccountTokens=void 0;var O$=U(),E$=O$.StripeResource.method;k$.AccountTokens=O$.StripeResource.extend({create:E$({method:"POST",fullPath:"/v2/core/account_tokens",requestSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}}),retrieve:E$({method:"GET",fullPath:"/v2/core/account_tokens/{id}"})})});var x$=B((b$)=>{Object.defineProperty(b$,"__esModule",{value:!0});b$.Accounts=void 0;var A$=U(),t=A$.StripeResource.method;b$.Accounts=A$.StripeResource.extend({retrieve:t({method:"GET",fullPath:"/v1/financial_connections/accounts/{account}"}),list:t({method:"GET",fullPath:"/v1/financial_connections/accounts",methodType:"list"}),disconnect:t({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/disconnect"}),listOwners:t({method:"GET",fullPath:"/v1/financial_connections/accounts/{account}/owners",methodType:"list"}),refresh:t({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/refresh"}),subscribe:t({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/subscribe"}),unsubscribe:t({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/unsubscribe"})})});var y$=B((I$)=>{Object.defineProperty(I$,"__esModule",{value:!0});I$.Persons=void 0;var P$=U(),PJ=P$.StripeResource.method;I$.Persons=P$.StripeResource.extend({create:PJ({method:"POST",fullPath:"/v2/core/accounts/{account_id}/persons",requestSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}},responseSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}),retrieve:PJ({method:"GET",fullPath:"/v2/core/accounts/{account_id}/persons/{id}",responseSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}),update:PJ({method:"POST",fullPath:"/v2/core/accounts/{account_id}/persons/{id}",requestSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}},responseSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}),list:PJ({method:"GET",fullPath:"/v2/core/accounts/{account_id}/persons",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}),del:PJ({method:"DELETE",fullPath:"/v2/core/accounts/{account_id}/persons/{id}"})})});var j$=B((S$)=>{Object.defineProperty(S$,"__esModule",{value:!0});S$.PersonTokens=void 0;var R$=U(),g$=R$.StripeResource.method;S$.PersonTokens=R$.StripeResource.extend({create:g$({method:"POST",fullPath:"/v2/core/accounts/{account_id}/person_tokens",requestSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}),retrieve:g$({method:"GET",fullPath:"/v2/core/accounts/{account_id}/person_tokens/{id}"})})});var h$=B((_$)=>{Object.defineProperty(_$,"__esModule",{value:!0});_$.Accounts=void 0;var zZ=U(),cw=y$(),dw=j$(),IJ=zZ.StripeResource.method;_$.Accounts=zZ.StripeResource.extend({constructor:function(...J){zZ.StripeResource.apply(this,J),this.persons=new cw.Persons(...J),this.personTokens=new dw.PersonTokens(...J)},create:IJ({method:"POST",fullPath:"/v2/core/accounts",requestSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}},responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}}),retrieve:IJ({method:"GET",fullPath:"/v2/core/accounts/{id}",responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}}),update:IJ({method:"POST",fullPath:"/v2/core/accounts/{id}",requestSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}},responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}}),list:IJ({method:"GET",fullPath:"/v2/core/accounts",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}}}}}),close:IJ({method:"POST",fullPath:"/v2/core/accounts/{id}/close",responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})})});var n$=B((c$)=>{Object.defineProperty(c$,"__esModule",{value:!0});c$.ActiveEntitlements=void 0;var u$=U(),l$=u$.StripeResource.method;c$.ActiveEntitlements=u$.StripeResource.extend({retrieve:l$({method:"GET",fullPath:"/v1/entitlements/active_entitlements/{id}"}),list:l$({method:"GET",fullPath:"/v1/entitlements/active_entitlements",methodType:"list"})})});var o$=B((i$)=>{Object.defineProperty(i$,"__esModule",{value:!0});i$.Alerts=void 0;var a$=U(),UJ=a$.StripeResource.method;i$.Alerts=a$.StripeResource.extend({create:UJ({method:"POST",fullPath:"/v1/billing/alerts"}),retrieve:UJ({method:"GET",fullPath:"/v1/billing/alerts/{id}"}),list:UJ({method:"GET",fullPath:"/v1/billing/alerts",methodType:"list"}),activate:UJ({method:"POST",fullPath:"/v1/billing/alerts/{id}/activate"}),archive:UJ({method:"POST",fullPath:"/v1/billing/alerts/{id}/archive"}),deactivate:UJ({method:"POST",fullPath:"/v1/billing/alerts/{id}/deactivate"})})});var e$=B((r$)=>{Object.defineProperty(r$,"__esModule",{value:!0});r$.Associations=void 0;var s$=U(),nw=s$.StripeResource.method;r$.Associations=s$.StripeResource.extend({find:nw({method:"GET",fullPath:"/v1/tax/associations/find"})})});var Q8=B((Z8)=>{Object.defineProperty(Z8,"__esModule",{value:!0});Z8.Authorizations=void 0;var J8=U(),fJ=J8.StripeResource.method;Z8.Authorizations=J8.StripeResource.extend({retrieve:fJ({method:"GET",fullPath:"/v1/issuing/authorizations/{authorization}",responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),update:fJ({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}",responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),list:fJ({method:"GET",fullPath:"/v1/issuing/authorizations",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}}}}),approve:fJ({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}/approve",responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),decline:fJ({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}/decline",responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})})});var X8=B((z8)=>{Object.defineProperty(z8,"__esModule",{value:!0});z8.Authorizations=void 0;var G8=U(),e=G8.StripeResource.method;z8.Authorizations=G8.StripeResource.extend({create:e({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations",requestSchema:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}}}},responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),capture:e({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/capture",requestSchema:{kind:"object",fields:{purchase_details:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}},receipt:{kind:"array",element:{kind:"object",fields:{quantity:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),expire:e({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/expire",responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),finalizeAmount:e({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount",requestSchema:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}}}},responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),increment:e({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/increment",responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),respond:e({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond",responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}),reverse:e({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/reverse",responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})})});var L8=B((w8)=>{Object.defineProperty(w8,"__esModule",{value:!0});w8.Calculations=void 0;var Y8=U(),BZ=Y8.StripeResource.method;w8.Calculations=Y8.StripeResource.extend({create:BZ({method:"POST",fullPath:"/v1/tax/calculations"}),retrieve:BZ({method:"GET",fullPath:"/v1/tax/calculations/{calculation}"}),listLineItems:BZ({method:"GET",fullPath:"/v1/tax/calculations/{calculation}/line_items",methodType:"list"})})});var T8=B((W8)=>{Object.defineProperty(W8,"__esModule",{value:!0});W8.Cardholders=void 0;var V8=U(),w0=V8.StripeResource.method;W8.Cardholders=V8.StripeResource.extend({create:w0({method:"POST",fullPath:"/v1/issuing/cardholders"}),retrieve:w0({method:"GET",fullPath:"/v1/issuing/cardholders/{cardholder}"}),update:w0({method:"POST",fullPath:"/v1/issuing/cardholders/{cardholder}"}),list:w0({method:"GET",fullPath:"/v1/issuing/cardholders",methodType:"list"})})});var q8=B((H8)=>{Object.defineProperty(H8,"__esModule",{value:!0});H8.Cards=void 0;var N8=U(),U0=N8.StripeResource.method;H8.Cards=N8.StripeResource.extend({create:U0({method:"POST",fullPath:"/v1/issuing/cards"}),retrieve:U0({method:"GET",fullPath:"/v1/issuing/cards/{card}"}),update:U0({method:"POST",fullPath:"/v1/issuing/cards/{card}"}),list:U0({method:"GET",fullPath:"/v1/issuing/cards",methodType:"list"})})});var F8=B((O8)=>{Object.defineProperty(O8,"__esModule",{value:!0});O8.Cards=void 0;var E8=U(),yJ=E8.StripeResource.method;O8.Cards=E8.StripeResource.extend({deliverCard:yJ({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/deliver"}),failCard:yJ({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/fail"}),returnCard:yJ({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/return"}),shipCard:yJ({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/ship"}),submitCard:yJ({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/submit"})})});var v8=B((A8)=>{Object.defineProperty(A8,"__esModule",{value:!0});A8.Configurations=void 0;var C8=U(),L0=C8.StripeResource.method;A8.Configurations=C8.StripeResource.extend({create:L0({method:"POST",fullPath:"/v1/billing_portal/configurations"}),retrieve:L0({method:"GET",fullPath:"/v1/billing_portal/configurations/{configuration}"}),update:L0({method:"POST",fullPath:"/v1/billing_portal/configurations/{configuration}"}),list:L0({method:"GET",fullPath:"/v1/billing_portal/configurations",methodType:"list"})})});var f8=B((P8)=>{Object.defineProperty(P8,"__esModule",{value:!0});P8.Configurations=void 0;var x8=U(),gJ=x8.StripeResource.method;P8.Configurations=x8.StripeResource.extend({create:gJ({method:"POST",fullPath:"/v1/terminal/configurations"}),retrieve:gJ({method:"GET",fullPath:"/v1/terminal/configurations/{configuration}"}),update:gJ({method:"POST",fullPath:"/v1/terminal/configurations/{configuration}"}),list:gJ({method:"GET",fullPath:"/v1/terminal/configurations",methodType:"list"}),del:gJ({method:"DELETE",fullPath:"/v1/terminal/configurations/{configuration}"})})});var S8=B((g8)=>{Object.defineProperty(g8,"__esModule",{value:!0});g8.ConfirmationTokens=void 0;var y8=U(),aw=y8.StripeResource.method;g8.ConfirmationTokens=y8.StripeResource.extend({create:aw({method:"POST",fullPath:"/v1/test_helpers/confirmation_tokens"})})});var m8=B((j8)=>{Object.defineProperty(j8,"__esModule",{value:!0});j8.ConnectionTokens=void 0;var M8=U(),iw=M8.StripeResource.method;j8.ConnectionTokens=M8.StripeResource.extend({create:iw({method:"POST",fullPath:"/v1/terminal/connection_tokens"})})});var c8=B((l8)=>{Object.defineProperty(l8,"__esModule",{value:!0});l8.CreditBalanceSummary=void 0;var h8=U(),pw=h8.StripeResource.method;l8.CreditBalanceSummary=h8.StripeResource.extend({retrieve:pw({method:"GET",fullPath:"/v1/billing/credit_balance_summary"})})});var p8=B((a8)=>{Object.defineProperty(a8,"__esModule",{value:!0});a8.CreditBalanceTransactions=void 0;var n8=U(),d8=n8.StripeResource.method;a8.CreditBalanceTransactions=n8.StripeResource.extend({retrieve:d8({method:"GET",fullPath:"/v1/billing/credit_balance_transactions/{id}"}),list:d8({method:"GET",fullPath:"/v1/billing/credit_balance_transactions",methodType:"list"})})});var t8=B((s8)=>{Object.defineProperty(s8,"__esModule",{value:!0});s8.CreditGrants=void 0;var o8=U(),LJ=o8.StripeResource.method;s8.CreditGrants=o8.StripeResource.extend({create:LJ({method:"POST",fullPath:"/v1/billing/credit_grants"}),retrieve:LJ({method:"GET",fullPath:"/v1/billing/credit_grants/{id}"}),update:LJ({method:"POST",fullPath:"/v1/billing/credit_grants/{id}"}),list:LJ({method:"GET",fullPath:"/v1/billing/credit_grants",methodType:"list"}),expire:LJ({method:"POST",fullPath:"/v1/billing/credit_grants/{id}/expire"}),voidGrant:LJ({method:"POST",fullPath:"/v1/billing/credit_grants/{id}/void"})})});var $Q=B((JQ)=>{Object.defineProperty(JQ,"__esModule",{value:!0});JQ.CreditReversals=void 0;var e8=U(),XZ=e8.StripeResource.method;JQ.CreditReversals=e8.StripeResource.extend({create:XZ({method:"POST",fullPath:"/v1/treasury/credit_reversals"}),retrieve:XZ({method:"GET",fullPath:"/v1/treasury/credit_reversals/{credit_reversal}"}),list:XZ({method:"GET",fullPath:"/v1/treasury/credit_reversals",methodType:"list"})})});var BQ=B((GQ)=>{Object.defineProperty(GQ,"__esModule",{value:!0});GQ.Customers=void 0;var QQ=U(),ow=QQ.StripeResource.method;GQ.Customers=QQ.StripeResource.extend({fundCashBalance:ow({method:"POST",fullPath:"/v1/test_helpers/customers/{customer}/fund_cash_balance"})})});var UQ=B((YQ)=>{Object.defineProperty(YQ,"__esModule",{value:!0});YQ.DebitReversals=void 0;var XQ=U(),YZ=XQ.StripeResource.method;YQ.DebitReversals=XQ.StripeResource.extend({create:YZ({method:"POST",fullPath:"/v1/treasury/debit_reversals"}),retrieve:YZ({method:"GET",fullPath:"/v1/treasury/debit_reversals/{debit_reversal}"}),list:YZ({method:"GET",fullPath:"/v1/treasury/debit_reversals",methodType:"list"})})});var KQ=B((VQ)=>{Object.defineProperty(VQ,"__esModule",{value:!0});VQ.Disputes=void 0;var LQ=U(),RJ=LQ.StripeResource.method;VQ.Disputes=LQ.StripeResource.extend({create:RJ({method:"POST",fullPath:"/v1/issuing/disputes"}),retrieve:RJ({method:"GET",fullPath:"/v1/issuing/disputes/{dispute}"}),update:RJ({method:"POST",fullPath:"/v1/issuing/disputes/{dispute}"}),list:RJ({method:"GET",fullPath:"/v1/issuing/disputes",methodType:"list"}),submit:RJ({method:"POST",fullPath:"/v1/issuing/disputes/{dispute}/submit"})})});var qQ=B((HQ)=>{Object.defineProperty(HQ,"__esModule",{value:!0});HQ.EarlyFraudWarnings=void 0;var NQ=U(),TQ=NQ.StripeResource.method;HQ.EarlyFraudWarnings=NQ.StripeResource.extend({retrieve:TQ({method:"GET",fullPath:"/v1/radar/early_fraud_warnings/{early_fraud_warning}"}),list:TQ({method:"GET",fullPath:"/v1/radar/early_fraud_warnings",methodType:"list"})})});var FQ=B((OQ)=>{Object.defineProperty(OQ,"__esModule",{value:!0});OQ.EventDestinations=void 0;var EQ=U(),a=EQ.StripeResource.method;OQ.EventDestinations=EQ.StripeResource.extend({create:a({method:"POST",fullPath:"/v2/core/event_destinations"}),retrieve:a({method:"GET",fullPath:"/v2/core/event_destinations/{id}"}),update:a({method:"POST",fullPath:"/v2/core/event_destinations/{id}"}),list:a({method:"GET",fullPath:"/v2/core/event_destinations",methodType:"list"}),del:a({method:"DELETE",fullPath:"/v2/core/event_destinations/{id}"}),disable:a({method:"POST",fullPath:"/v2/core/event_destinations/{id}/disable"}),enable:a({method:"POST",fullPath:"/v2/core/event_destinations/{id}/enable"}),ping:a({method:"POST",fullPath:"/v2/core/event_destinations/{id}/ping"})})});var vQ=B((AQ)=>{Object.defineProperty(AQ,"__esModule",{value:!0});AQ.Events=void 0;var CQ=U(),wZ=CQ.StripeResource.method;AQ.Events=CQ.StripeResource.extend({retrieve(...J){return wZ({method:"GET",fullPath:"/v2/core/events/{id}",transformResponseData:($)=>{return this.addFetchRelatedObjectIfNeeded($)}}).apply(this,J)},list(...J){return wZ({method:"GET",fullPath:"/v2/core/events",methodType:"list",transformResponseData:($)=>{return{...$,data:$.data.map(this.addFetchRelatedObjectIfNeeded.bind(this))}}}).apply(this,J)},addFetchRelatedObjectIfNeeded(J){if(!J.related_object||!J.related_object.url)return J;return{...J,fetchRelatedObject:()=>wZ({method:"GET",fullPath:J.related_object.url}).apply(this,[{stripeContext:J.context,headers:{"Stripe-Request-Trigger":`event=${J.id}`}}])}}})});var fQ=B((PQ)=>{Object.defineProperty(PQ,"__esModule",{value:!0});PQ.Features=void 0;var xQ=U(),V0=xQ.StripeResource.method;PQ.Features=xQ.StripeResource.extend({create:V0({method:"POST",fullPath:"/v1/entitlements/features"}),retrieve:V0({method:"GET",fullPath:"/v1/entitlements/features/{id}"}),update:V0({method:"POST",fullPath:"/v1/entitlements/features/{id}"}),list:V0({method:"GET",fullPath:"/v1/entitlements/features",methodType:"list"})})});var SQ=B((gQ)=>{Object.defineProperty(gQ,"__esModule",{value:!0});gQ.FinancialAccounts=void 0;var yQ=U(),JJ=yQ.StripeResource.method;gQ.FinancialAccounts=yQ.StripeResource.extend({create:JJ({method:"POST",fullPath:"/v1/treasury/financial_accounts"}),retrieve:JJ({method:"GET",fullPath:"/v1/treasury/financial_accounts/{financial_account}"}),update:JJ({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}"}),list:JJ({method:"GET",fullPath:"/v1/treasury/financial_accounts",methodType:"list"}),close:JJ({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}/close"}),retrieveFeatures:JJ({method:"GET",fullPath:"/v1/treasury/financial_accounts/{financial_account}/features"}),updateFeatures:JJ({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}/features"})})});var mQ=B((jQ)=>{Object.defineProperty(jQ,"__esModule",{value:!0});jQ.InboundTransfers=void 0;var MQ=U(),UZ=MQ.StripeResource.method;jQ.InboundTransfers=MQ.StripeResource.extend({fail:UZ({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/fail"}),returnInboundTransfer:UZ({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/return"}),succeed:UZ({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/succeed"})})});var cQ=B((lQ)=>{Object.defineProperty(lQ,"__esModule",{value:!0});lQ.InboundTransfers=void 0;var hQ=U(),W0=hQ.StripeResource.method;lQ.InboundTransfers=hQ.StripeResource.extend({create:W0({method:"POST",fullPath:"/v1/treasury/inbound_transfers"}),retrieve:W0({method:"GET",fullPath:"/v1/treasury/inbound_transfers/{id}"}),list:W0({method:"GET",fullPath:"/v1/treasury/inbound_transfers",methodType:"list"}),cancel:W0({method:"POST",fullPath:"/v1/treasury/inbound_transfers/{inbound_transfer}/cancel"})})});var iQ=B((nQ)=>{Object.defineProperty(nQ,"__esModule",{value:!0});nQ.Locations=void 0;var dQ=U(),SJ=dQ.StripeResource.method;nQ.Locations=dQ.StripeResource.extend({create:SJ({method:"POST",fullPath:"/v1/terminal/locations"}),retrieve:SJ({method:"GET",fullPath:"/v1/terminal/locations/{location}"}),update:SJ({method:"POST",fullPath:"/v1/terminal/locations/{location}"}),list:SJ({method:"GET",fullPath:"/v1/terminal/locations",methodType:"list"}),del:SJ({method:"DELETE",fullPath:"/v1/terminal/locations/{location}"})})});var rQ=B((oQ)=>{Object.defineProperty(oQ,"__esModule",{value:!0});oQ.MeterEventAdjustments=void 0;var pQ=U(),sw=pQ.StripeResource.method;oQ.MeterEventAdjustments=pQ.StripeResource.extend({create:sw({method:"POST",fullPath:"/v1/billing/meter_event_adjustments"})})});var Z7=B((eQ)=>{Object.defineProperty(eQ,"__esModule",{value:!0});eQ.MeterEventAdjustments=void 0;var tQ=U(),rw=tQ.StripeResource.method;eQ.MeterEventAdjustments=tQ.StripeResource.extend({create:rw({method:"POST",fullPath:"/v2/billing/meter_event_adjustments"})})});var z7=B((Q7)=>{Object.defineProperty(Q7,"__esModule",{value:!0});Q7.MeterEventSession=void 0;var $7=U(),tw=$7.StripeResource.method;Q7.MeterEventSession=$7.StripeResource.extend({create:tw({method:"POST",fullPath:"/v2/billing/meter_event_session"})})});var w7=B((X7)=>{Object.defineProperty(X7,"__esModule",{value:!0});X7.MeterEventStream=void 0;var B7=U(),ew=B7.StripeResource.method;X7.MeterEventStream=B7.StripeResource.extend({create:ew({method:"POST",fullPath:"/v2/billing/meter_event_stream",host:"meter-events.stripe.com"})})});var W7=B((L7)=>{Object.defineProperty(L7,"__esModule",{value:!0});L7.MeterEvents=void 0;var U7=U(),J3=U7.StripeResource.method;L7.MeterEvents=U7.StripeResource.extend({create:J3({method:"POST",fullPath:"/v1/billing/meter_events"})})});var H7=B((T7)=>{Object.defineProperty(T7,"__esModule",{value:!0});T7.MeterEvents=void 0;var K7=U(),Z3=K7.StripeResource.method;T7.MeterEvents=K7.StripeResource.extend({create:Z3({method:"POST",fullPath:"/v2/billing/meter_events"})})});var O7=B((q7)=>{Object.defineProperty(q7,"__esModule",{value:!0});q7.Meters=void 0;var D7=U(),ZJ=D7.StripeResource.method;q7.Meters=D7.StripeResource.extend({create:ZJ({method:"POST",fullPath:"/v1/billing/meters"}),retrieve:ZJ({method:"GET",fullPath:"/v1/billing/meters/{id}"}),update:ZJ({method:"POST",fullPath:"/v1/billing/meters/{id}"}),list:ZJ({method:"GET",fullPath:"/v1/billing/meters",methodType:"list"}),deactivate:ZJ({method:"POST",fullPath:"/v1/billing/meters/{id}/deactivate"}),listEventSummaries:ZJ({method:"GET",fullPath:"/v1/billing/meters/{id}/event_summaries",methodType:"list"}),reactivate:ZJ({method:"POST",fullPath:"/v1/billing/meters/{id}/reactivate"})})});var A7=B((F7)=>{Object.defineProperty(F7,"__esModule",{value:!0});F7.OnboardingLinks=void 0;var k7=U(),$3=k7.StripeResource.method;F7.OnboardingLinks=k7.StripeResource.extend({create:$3({method:"POST",fullPath:"/v1/terminal/onboarding_links"})})});var P7=B((v7)=>{Object.defineProperty(v7,"__esModule",{value:!0});v7.Orders=void 0;var b7=U(),MJ=b7.StripeResource.method;v7.Orders=b7.StripeResource.extend({create:MJ({method:"POST",fullPath:"/v1/climate/orders",requestSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}},responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}}),retrieve:MJ({method:"GET",fullPath:"/v1/climate/orders/{order}",responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}}),update:MJ({method:"POST",fullPath:"/v1/climate/orders/{order}",responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}}),list:MJ({method:"GET",fullPath:"/v1/climate/orders",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}}}}}),cancel:MJ({method:"POST",fullPath:"/v1/climate/orders/{order}/cancel",responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})})});var g7=B((f7)=>{Object.defineProperty(f7,"__esModule",{value:!0});f7.OutboundPayments=void 0;var I7=U(),K0=I7.StripeResource.method;f7.OutboundPayments=I7.StripeResource.extend({update:K0({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}"}),fail:K0({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/fail"}),post:K0({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/post"}),returnOutboundPayment:K0({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/return"})})});var j7=B((S7)=>{Object.defineProperty(S7,"__esModule",{value:!0});S7.OutboundPayments=void 0;var R7=U(),T0=R7.StripeResource.method;S7.OutboundPayments=R7.StripeResource.extend({create:T0({method:"POST",fullPath:"/v1/treasury/outbound_payments"}),retrieve:T0({method:"GET",fullPath:"/v1/treasury/outbound_payments/{id}"}),list:T0({method:"GET",fullPath:"/v1/treasury/outbound_payments",methodType:"list"}),cancel:T0({method:"POST",fullPath:"/v1/treasury/outbound_payments/{id}/cancel"})})});var l7=B((m7)=>{Object.defineProperty(m7,"__esModule",{value:!0});m7.OutboundTransfers=void 0;var _7=U(),N0=_7.StripeResource.method;m7.OutboundTransfers=_7.StripeResource.extend({update:N0({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}"}),fail:N0({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail"}),post:N0({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post"}),returnOutboundTransfer:N0({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return"})})});var n7=B((c7)=>{Object.defineProperty(c7,"__esModule",{value:!0});c7.OutboundTransfers=void 0;var u7=U(),H0=u7.StripeResource.method;c7.OutboundTransfers=u7.StripeResource.extend({create:H0({method:"POST",fullPath:"/v1/treasury/outbound_transfers"}),retrieve:H0({method:"GET",fullPath:"/v1/treasury/outbound_transfers/{outbound_transfer}"}),list:H0({method:"GET",fullPath:"/v1/treasury/outbound_transfers",methodType:"list"}),cancel:H0({method:"POST",fullPath:"/v1/treasury/outbound_transfers/{outbound_transfer}/cancel"})})});var o7=B((i7)=>{Object.defineProperty(i7,"__esModule",{value:!0});i7.PaymentEvaluations=void 0;var a7=U(),Q3=a7.StripeResource.method;i7.PaymentEvaluations=a7.StripeResource.extend({create:Q3({method:"POST",fullPath:"/v1/radar/payment_evaluations"})})});var e7=B((r7)=>{Object.defineProperty(r7,"__esModule",{value:!0});r7.PersonalizationDesigns=void 0;var s7=U(),D0=s7.StripeResource.method;r7.PersonalizationDesigns=s7.StripeResource.extend({create:D0({method:"POST",fullPath:"/v1/issuing/personalization_designs"}),retrieve:D0({method:"GET",fullPath:"/v1/issuing/personalization_designs/{personalization_design}"}),update:D0({method:"POST",fullPath:"/v1/issuing/personalization_designs/{personalization_design}"}),list:D0({method:"GET",fullPath:"/v1/issuing/personalization_designs",methodType:"list"})})});var Q4=B((Z4)=>{Object.defineProperty(Z4,"__esModule",{value:!0});Z4.PersonalizationDesigns=void 0;var J4=U(),LZ=J4.StripeResource.method;Z4.PersonalizationDesigns=J4.StripeResource.extend({activate:LZ({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate"}),deactivate:LZ({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate"}),reject:LZ({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject"})})});var Y4=B((B4)=>{Object.defineProperty(B4,"__esModule",{value:!0});B4.PhysicalBundles=void 0;var z4=U(),G4=z4.StripeResource.method;B4.PhysicalBundles=z4.StripeResource.extend({retrieve:G4({method:"GET",fullPath:"/v1/issuing/physical_bundles/{physical_bundle}"}),list:G4({method:"GET",fullPath:"/v1/issuing/physical_bundles",methodType:"list"})})});var W4=B((L4)=>{Object.defineProperty(L4,"__esModule",{value:!0});L4.Products=void 0;var U4=U(),w4=U4.StripeResource.method;L4.Products=U4.StripeResource.extend({retrieve:w4({method:"GET",fullPath:"/v1/climate/products/{product}",responseSchema:{kind:"object",fields:{metric_tons_available:{kind:"decimal_string"}}}}),list:w4({method:"GET",fullPath:"/v1/climate/products",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{metric_tons_available:{kind:"decimal_string"}}}}}}})})});var H4=B((T4)=>{Object.defineProperty(T4,"__esModule",{value:!0});T4.Readers=void 0;var K4=U(),M=K4.StripeResource.method;T4.Readers=K4.StripeResource.extend({create:M({method:"POST",fullPath:"/v1/terminal/readers"}),retrieve:M({method:"GET",fullPath:"/v1/terminal/readers/{reader}"}),update:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}"}),list:M({method:"GET",fullPath:"/v1/terminal/readers",methodType:"list"}),del:M({method:"DELETE",fullPath:"/v1/terminal/readers/{reader}"}),cancelAction:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}/cancel_action"}),collectInputs:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}/collect_inputs"}),collectPaymentMethod:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}/collect_payment_method"}),confirmPaymentIntent:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}/confirm_payment_intent"}),processPaymentIntent:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}/process_payment_intent"}),processSetupIntent:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}/process_setup_intent"}),refundPayment:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}/refund_payment"}),setReaderDisplay:M({method:"POST",fullPath:"/v1/terminal/readers/{reader}/set_reader_display"})})});var O4=B((q4)=>{Object.defineProperty(q4,"__esModule",{value:!0});q4.Readers=void 0;var D4=U(),VZ=D4.StripeResource.method;q4.Readers=D4.StripeResource.extend({presentPaymentMethod:VZ({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/present_payment_method"}),succeedInputCollection:VZ({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection"}),timeoutInputCollection:VZ({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection"})})});var A4=B((F4)=>{Object.defineProperty(F4,"__esModule",{value:!0});F4.ReceivedCredits=void 0;var k4=U(),G3=k4.StripeResource.method;F4.ReceivedCredits=k4.StripeResource.extend({create:G3({method:"POST",fullPath:"/v1/test_helpers/treasury/received_credits"})})});var I4=B((x4)=>{Object.defineProperty(x4,"__esModule",{value:!0});x4.ReceivedCredits=void 0;var v4=U(),b4=v4.StripeResource.method;x4.ReceivedCredits=v4.StripeResource.extend({retrieve:b4({method:"GET",fullPath:"/v1/treasury/received_credits/{id}"}),list:b4({method:"GET",fullPath:"/v1/treasury/received_credits",methodType:"list"})})});var R4=B((y4)=>{Object.defineProperty(y4,"__esModule",{value:!0});y4.ReceivedDebits=void 0;var f4=U(),z3=f4.StripeResource.method;y4.ReceivedDebits=f4.StripeResource.extend({create:z3({method:"POST",fullPath:"/v1/test_helpers/treasury/received_debits"})})});var m4=B((j4)=>{Object.defineProperty(j4,"__esModule",{value:!0});j4.ReceivedDebits=void 0;var M4=U(),S4=M4.StripeResource.method;j4.ReceivedDebits=M4.StripeResource.extend({retrieve:S4({method:"GET",fullPath:"/v1/treasury/received_debits/{id}"}),list:S4({method:"GET",fullPath:"/v1/treasury/received_debits",methodType:"list"})})});var c4=B((l4)=>{Object.defineProperty(l4,"__esModule",{value:!0});l4.Refunds=void 0;var h4=U(),B3=h4.StripeResource.method;l4.Refunds=h4.StripeResource.extend({expire:B3({method:"POST",fullPath:"/v1/test_helpers/refunds/{refund}/expire"})})});var i4=B((n4)=>{Object.defineProperty(n4,"__esModule",{value:!0});n4.Registrations=void 0;var d4=U(),q0=d4.StripeResource.method;n4.Registrations=d4.StripeResource.extend({create:q0({method:"POST",fullPath:"/v1/tax/registrations"}),retrieve:q0({method:"GET",fullPath:"/v1/tax/registrations/{id}"}),update:q0({method:"POST",fullPath:"/v1/tax/registrations/{id}"}),list:q0({method:"GET",fullPath:"/v1/tax/registrations",methodType:"list"})})});var r4=B((o4)=>{Object.defineProperty(o4,"__esModule",{value:!0});o4.ReportRuns=void 0;var p4=U(),WZ=p4.StripeResource.method;o4.ReportRuns=p4.StripeResource.extend({create:WZ({method:"POST",fullPath:"/v1/reporting/report_runs"}),retrieve:WZ({method:"GET",fullPath:"/v1/reporting/report_runs/{report_run}"}),list:WZ({method:"GET",fullPath:"/v1/reporting/report_runs",methodType:"list"})})});var $5=B((J5)=>{Object.defineProperty(J5,"__esModule",{value:!0});J5.ReportTypes=void 0;var e4=U(),t4=e4.StripeResource.method;J5.ReportTypes=e4.StripeResource.extend({retrieve:t4({method:"GET",fullPath:"/v1/reporting/report_types/{report_type}"}),list:t4({method:"GET",fullPath:"/v1/reporting/report_types",methodType:"list"})})});var B5=B((G5)=>{Object.defineProperty(G5,"__esModule",{value:!0});G5.Requests=void 0;var Q5=U(),KZ=Q5.StripeResource.method;G5.Requests=Q5.StripeResource.extend({create:KZ({method:"POST",fullPath:"/v1/forwarding/requests"}),retrieve:KZ({method:"GET",fullPath:"/v1/forwarding/requests/{id}"}),list:KZ({method:"GET",fullPath:"/v1/forwarding/requests",methodType:"list"})})});var L5=B((w5)=>{Object.defineProperty(w5,"__esModule",{value:!0});w5.ScheduledQueryRuns=void 0;var Y5=U(),X5=Y5.StripeResource.method;w5.ScheduledQueryRuns=Y5.StripeResource.extend({retrieve:X5({method:"GET",fullPath:"/v1/sigma/scheduled_query_runs/{scheduled_query_run}"}),list:X5({method:"GET",fullPath:"/v1/sigma/scheduled_query_runs",methodType:"list"})})});var T5=B((W5)=>{Object.defineProperty(W5,"__esModule",{value:!0});W5.Secrets=void 0;var V5=U(),E0=V5.StripeResource.method;W5.Secrets=V5.StripeResource.extend({create:E0({method:"POST",fullPath:"/v1/apps/secrets"}),list:E0({method:"GET",fullPath:"/v1/apps/secrets",methodType:"list"}),deleteWhere:E0({method:"POST",fullPath:"/v1/apps/secrets/delete"}),find:E0({method:"GET",fullPath:"/v1/apps/secrets/find"})})});var q5=B((H5)=>{Object.defineProperty(H5,"__esModule",{value:!0});H5.Sessions=void 0;var N5=U(),X3=N5.StripeResource.method;H5.Sessions=N5.StripeResource.extend({create:X3({method:"POST",fullPath:"/v1/billing_portal/sessions"})})});var F5=B((O5)=>{Object.defineProperty(O5,"__esModule",{value:!0});O5.Sessions=void 0;var E5=U(),VJ=E5.StripeResource.method;O5.Sessions=E5.StripeResource.extend({create:VJ({method:"POST",fullPath:"/v1/checkout/sessions",requestSchema:{kind:"object",fields:{line_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{currency_conversion:{kind:"nullable",inner:{kind:"object",fields:{fx_rate:{kind:"decimal_string"}}}},line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),retrieve:VJ({method:"GET",fullPath:"/v1/checkout/sessions/{session}",responseSchema:{kind:"object",fields:{currency_conversion:{kind:"nullable",inner:{kind:"object",fields:{fx_rate:{kind:"decimal_string"}}}},line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),update:VJ({method:"POST",fullPath:"/v1/checkout/sessions/{session}",requestSchema:{kind:"object",fields:{line_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{currency_conversion:{kind:"nullable",inner:{kind:"object",fields:{fx_rate:{kind:"decimal_string"}}}},line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),list:VJ({method:"GET",fullPath:"/v1/checkout/sessions",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{currency_conversion:{kind:"nullable",inner:{kind:"object",fields:{fx_rate:{kind:"decimal_string"}}}},line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}),expire:VJ({method:"POST",fullPath:"/v1/checkout/sessions/{session}/expire",responseSchema:{kind:"object",fields:{currency_conversion:{kind:"nullable",inner:{kind:"object",fields:{fx_rate:{kind:"decimal_string"}}}},line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),listLineItems:VJ({method:"GET",fullPath:"/v1/checkout/sessions/{session}/line_items",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}})})});var x5=B((b5)=>{Object.defineProperty(b5,"__esModule",{value:!0});b5.Sessions=void 0;var A5=U(),C5=A5.StripeResource.method;b5.Sessions=A5.StripeResource.extend({create:C5({method:"POST",fullPath:"/v1/financial_connections/sessions"}),retrieve:C5({method:"GET",fullPath:"/v1/financial_connections/sessions/{session}"})})});var g5=B((f5)=>{Object.defineProperty(f5,"__esModule",{value:!0});f5.Settings=void 0;var I5=U(),P5=I5.StripeResource.method;f5.Settings=I5.StripeResource.extend({retrieve:P5({method:"GET",fullPath:"/v1/tax/settings"}),update:P5({method:"POST",fullPath:"/v1/tax/settings"})})});var _5=B((M5)=>{Object.defineProperty(M5,"__esModule",{value:!0});M5.Suppliers=void 0;var S5=U(),R5=S5.StripeResource.method;M5.Suppliers=S5.StripeResource.extend({retrieve:R5({method:"GET",fullPath:"/v1/climate/suppliers/{supplier}"}),list:R5({method:"GET",fullPath:"/v1/climate/suppliers",methodType:"list"})})});var u5=B((h5)=>{Object.defineProperty(h5,"__esModule",{value:!0});h5.TestClocks=void 0;var m5=U(),jJ=m5.StripeResource.method;h5.TestClocks=m5.StripeResource.extend({create:jJ({method:"POST",fullPath:"/v1/test_helpers/test_clocks"}),retrieve:jJ({method:"GET",fullPath:"/v1/test_helpers/test_clocks/{test_clock}"}),list:jJ({method:"GET",fullPath:"/v1/test_helpers/test_clocks",methodType:"list"}),del:jJ({method:"DELETE",fullPath:"/v1/test_helpers/test_clocks/{test_clock}"}),advance:jJ({method:"POST",fullPath:"/v1/test_helpers/test_clocks/{test_clock}/advance"})})});var a5=B((d5)=>{Object.defineProperty(d5,"__esModule",{value:!0});d5.Tokens=void 0;var c5=U(),TZ=c5.StripeResource.method;d5.Tokens=c5.StripeResource.extend({retrieve:TZ({method:"GET",fullPath:"/v1/issuing/tokens/{token}"}),update:TZ({method:"POST",fullPath:"/v1/issuing/tokens/{token}"}),list:TZ({method:"GET",fullPath:"/v1/issuing/tokens",methodType:"list"})})});var r5=B((o5)=>{Object.defineProperty(o5,"__esModule",{value:!0});o5.TransactionEntries=void 0;var p5=U(),i5=p5.StripeResource.method;o5.TransactionEntries=p5.StripeResource.extend({retrieve:i5({method:"GET",fullPath:"/v1/treasury/transaction_entries/{id}",responseSchema:{kind:"object",fields:{flow_details:{kind:"nullable",inner:{kind:"object",fields:{issuing_authorization:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}}}}}}),list:i5({method:"GET",fullPath:"/v1/treasury/transaction_entries",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{flow_details:{kind:"nullable",inner:{kind:"object",fields:{issuing_authorization:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}}}}}}}}})})});var $G=B((JG)=>{Object.defineProperty(JG,"__esModule",{value:!0});JG.Transactions=void 0;var e5=U(),t5=e5.StripeResource.method;JG.Transactions=e5.StripeResource.extend({retrieve:t5({method:"GET",fullPath:"/v1/financial_connections/transactions/{transaction}"}),list:t5({method:"GET",fullPath:"/v1/financial_connections/transactions",methodType:"list"})})});var BG=B((GG)=>{Object.defineProperty(GG,"__esModule",{value:!0});GG.Transactions=void 0;var QG=U(),NZ=QG.StripeResource.method;GG.Transactions=QG.StripeResource.extend({retrieve:NZ({method:"GET",fullPath:"/v1/issuing/transactions/{transaction}",responseSchema:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}),update:NZ({method:"POST",fullPath:"/v1/issuing/transactions/{transaction}",responseSchema:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}),list:NZ({method:"GET",fullPath:"/v1/issuing/transactions",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})})});var UG=B((YG)=>{Object.defineProperty(YG,"__esModule",{value:!0});YG.Transactions=void 0;var XG=U(),O0=XG.StripeResource.method;YG.Transactions=XG.StripeResource.extend({retrieve:O0({method:"GET",fullPath:"/v1/tax/transactions/{transaction}"}),createFromCalculation:O0({method:"POST",fullPath:"/v1/tax/transactions/create_from_calculation"}),createReversal:O0({method:"POST",fullPath:"/v1/tax/transactions/create_reversal"}),listLineItems:O0({method:"GET",fullPath:"/v1/tax/transactions/{transaction}/line_items",methodType:"list"})})});var KG=B((VG)=>{Object.defineProperty(VG,"__esModule",{value:!0});VG.Transactions=void 0;var LG=U(),HZ=LG.StripeResource.method;VG.Transactions=LG.StripeResource.extend({createForceCapture:HZ({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/create_force_capture",requestSchema:{kind:"object",fields:{purchase_details:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}},receipt:{kind:"array",element:{kind:"object",fields:{quantity:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}),createUnlinkedRefund:HZ({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/create_unlinked_refund",requestSchema:{kind:"object",fields:{purchase_details:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}},receipt:{kind:"array",element:{kind:"object",fields:{quantity:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}),refund:HZ({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/{transaction}/refund",responseSchema:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}})})});var qG=B((HG)=>{Object.defineProperty(HG,"__esModule",{value:!0});HG.Transactions=void 0;var NG=U(),TG=NG.StripeResource.method;HG.Transactions=NG.StripeResource.extend({retrieve:TG({method:"GET",fullPath:"/v1/treasury/transactions/{id}",responseSchema:{kind:"object",fields:{entries:{kind:"nullable",inner:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{flow_details:{kind:"nullable",inner:{kind:"object",fields:{issuing_authorization:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}}}}}}}}}}}}),list:TG({method:"GET",fullPath:"/v1/treasury/transactions",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{entries:{kind:"nullable",inner:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{flow_details:{kind:"nullable",inner:{kind:"object",fields:{issuing_authorization:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}}}}}}}}}}}}}}}})})});var FG=B((OG)=>{Object.defineProperty(OG,"__esModule",{value:!0});OG.ValueListItems=void 0;var EG=U(),k0=EG.StripeResource.method;OG.ValueListItems=EG.StripeResource.extend({create:k0({method:"POST",fullPath:"/v1/radar/value_list_items"}),retrieve:k0({method:"GET",fullPath:"/v1/radar/value_list_items/{item}"}),list:k0({method:"GET",fullPath:"/v1/radar/value_list_items",methodType:"list"}),del:k0({method:"DELETE",fullPath:"/v1/radar/value_list_items/{item}"})})});var vG=B((AG)=>{Object.defineProperty(AG,"__esModule",{value:!0});AG.ValueLists=void 0;var CG=U(),_J=CG.StripeResource.method;AG.ValueLists=CG.StripeResource.extend({create:_J({method:"POST",fullPath:"/v1/radar/value_lists"}),retrieve:_J({method:"GET",fullPath:"/v1/radar/value_lists/{value_list}"}),update:_J({method:"POST",fullPath:"/v1/radar/value_lists/{value_list}"}),list:_J({method:"GET",fullPath:"/v1/radar/value_lists",methodType:"list"}),del:_J({method:"DELETE",fullPath:"/v1/radar/value_lists/{value_list}"})})});var yG=B((IG)=>{Object.defineProperty(IG,"__esModule",{value:!0});IG.VerificationReports=void 0;var PG=U(),xG=PG.StripeResource.method;IG.VerificationReports=PG.StripeResource.extend({retrieve:xG({method:"GET",fullPath:"/v1/identity/verification_reports/{report}"}),list:xG({method:"GET",fullPath:"/v1/identity/verification_reports",methodType:"list"})})});var MG=B((RG)=>{Object.defineProperty(RG,"__esModule",{value:!0});RG.VerificationSessions=void 0;var gG=U(),WJ=gG.StripeResource.method;RG.VerificationSessions=gG.StripeResource.extend({create:WJ({method:"POST",fullPath:"/v1/identity/verification_sessions"}),retrieve:WJ({method:"GET",fullPath:"/v1/identity/verification_sessions/{session}"}),update:WJ({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}"}),list:WJ({method:"GET",fullPath:"/v1/identity/verification_sessions",methodType:"list"}),cancel:WJ({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}/cancel"}),redact:WJ({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}/redact"})})});var DZ=B((_G)=>{Object.defineProperty(_G,"__esModule",{value:!0});_G.Accounts=void 0;var jG=U(),A=jG.StripeResource.method;_G.Accounts=jG.StripeResource.extend({create:A({method:"POST",fullPath:"/v1/accounts"}),retrieve(J,...Z){if(typeof J==="string")return A({method:"GET",fullPath:"/v1/accounts/{id}"}).apply(this,[J,...Z]);else{if(J===null||J===void 0)[].shift.apply([J,...Z]);return A({method:"GET",fullPath:"/v1/account"}).apply(this,[J,...Z])}},update:A({method:"POST",fullPath:"/v1/accounts/{account}"}),list:A({method:"GET",fullPath:"/v1/accounts",methodType:"list"}),del:A({method:"DELETE",fullPath:"/v1/accounts/{account}"}),createExternalAccount:A({method:"POST",fullPath:"/v1/accounts/{account}/external_accounts"}),createLoginLink:A({method:"POST",fullPath:"/v1/accounts/{account}/login_links"}),createPerson:A({method:"POST",fullPath:"/v1/accounts/{account}/persons"}),deleteExternalAccount:A({method:"DELETE",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),deletePerson:A({method:"DELETE",fullPath:"/v1/accounts/{account}/persons/{person}"}),listCapabilities:A({method:"GET",fullPath:"/v1/accounts/{account}/capabilities",methodType:"list"}),listExternalAccounts:A({method:"GET",fullPath:"/v1/accounts/{account}/external_accounts",methodType:"list"}),listPersons:A({method:"GET",fullPath:"/v1/accounts/{account}/persons",methodType:"list"}),reject:A({method:"POST",fullPath:"/v1/accounts/{account}/reject"}),retrieveCurrent:A({method:"GET",fullPath:"/v1/account"}),retrieveCapability:A({method:"GET",fullPath:"/v1/accounts/{account}/capabilities/{capability}"}),retrieveExternalAccount:A({method:"GET",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),retrievePerson:A({method:"GET",fullPath:"/v1/accounts/{account}/persons/{person}"}),updateCapability:A({method:"POST",fullPath:"/v1/accounts/{account}/capabilities/{capability}"}),updateExternalAccount:A({method:"POST",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),updatePerson:A({method:"POST",fullPath:"/v1/accounts/{account}/persons/{person}"})})});var cG=B((lG)=>{Object.defineProperty(lG,"__esModule",{value:!0});lG.AccountLinks=void 0;var hG=U(),Y3=hG.StripeResource.method;lG.AccountLinks=hG.StripeResource.extend({create:Y3({method:"POST",fullPath:"/v1/account_links"})})});var iG=B((nG)=>{Object.defineProperty(nG,"__esModule",{value:!0});nG.AccountSessions=void 0;var dG=U(),w3=dG.StripeResource.method;nG.AccountSessions=dG.StripeResource.extend({create:w3({method:"POST",fullPath:"/v1/account_sessions"})})});var rG=B((oG)=>{Object.defineProperty(oG,"__esModule",{value:!0});oG.ApplePayDomains=void 0;var pG=U(),F0=pG.StripeResource.method;oG.ApplePayDomains=pG.StripeResource.extend({create:F0({method:"POST",fullPath:"/v1/apple_pay/domains"}),retrieve:F0({method:"GET",fullPath:"/v1/apple_pay/domains/{domain}"}),list:F0({method:"GET",fullPath:"/v1/apple_pay/domains",methodType:"list"}),del:F0({method:"DELETE",fullPath:"/v1/apple_pay/domains/{domain}"})})});var Z6=B((eG)=>{Object.defineProperty(eG,"__esModule",{value:!0});eG.ApplicationFees=void 0;var tG=U(),KJ=tG.StripeResource.method;eG.ApplicationFees=tG.StripeResource.extend({retrieve:KJ({method:"GET",fullPath:"/v1/application_fees/{id}"}),list:KJ({method:"GET",fullPath:"/v1/application_fees",methodType:"list"}),createRefund:KJ({method:"POST",fullPath:"/v1/application_fees/{id}/refunds"}),listRefunds:KJ({method:"GET",fullPath:"/v1/application_fees/{id}/refunds",methodType:"list"}),retrieveRefund:KJ({method:"GET",fullPath:"/v1/application_fees/{fee}/refunds/{id}"}),updateRefund:KJ({method:"POST",fullPath:"/v1/application_fees/{fee}/refunds/{id}"})})});var z6=B((Q6)=>{Object.defineProperty(Q6,"__esModule",{value:!0});Q6.Balance=void 0;var $6=U(),U3=$6.StripeResource.method;Q6.Balance=$6.StripeResource.extend({retrieve:U3({method:"GET",fullPath:"/v1/balance"})})});var U6=B((Y6)=>{Object.defineProperty(Y6,"__esModule",{value:!0});Y6.BalanceSettings=void 0;var X6=U(),B6=X6.StripeResource.method;Y6.BalanceSettings=X6.StripeResource.extend({retrieve:B6({method:"GET",fullPath:"/v1/balance_settings"}),update:B6({method:"POST",fullPath:"/v1/balance_settings"})})});var T6=B((W6)=>{Object.defineProperty(W6,"__esModule",{value:!0});W6.BalanceTransactions=void 0;var V6=U(),L6=V6.StripeResource.method;W6.BalanceTransactions=V6.StripeResource.extend({retrieve:L6({method:"GET",fullPath:"/v1/balance_transactions/{id}"}),list:L6({method:"GET",fullPath:"/v1/balance_transactions",methodType:"list"})})});var q6=B((H6)=>{Object.defineProperty(H6,"__esModule",{value:!0});H6.Charges=void 0;var N6=U(),TJ=N6.StripeResource.method;H6.Charges=N6.StripeResource.extend({create:TJ({method:"POST",fullPath:"/v1/charges"}),retrieve:TJ({method:"GET",fullPath:"/v1/charges/{charge}"}),update:TJ({method:"POST",fullPath:"/v1/charges/{charge}"}),list:TJ({method:"GET",fullPath:"/v1/charges",methodType:"list"}),capture:TJ({method:"POST",fullPath:"/v1/charges/{charge}/capture"}),search:TJ({method:"GET",fullPath:"/v1/charges/search",methodType:"search"})})});var F6=B((O6)=>{Object.defineProperty(O6,"__esModule",{value:!0});O6.ConfirmationTokens=void 0;var E6=U(),L3=E6.StripeResource.method;O6.ConfirmationTokens=E6.StripeResource.extend({retrieve:L3({method:"GET",fullPath:"/v1/confirmation_tokens/{confirmation_token}"})})});var x6=B((b6)=>{Object.defineProperty(b6,"__esModule",{value:!0});b6.CountrySpecs=void 0;var A6=U(),C6=A6.StripeResource.method;b6.CountrySpecs=A6.StripeResource.extend({retrieve:C6({method:"GET",fullPath:"/v1/country_specs/{country}"}),list:C6({method:"GET",fullPath:"/v1/country_specs",methodType:"list"})})});var y6=B((I6)=>{Object.defineProperty(I6,"__esModule",{value:!0});I6.Coupons=void 0;var P6=U(),mJ=P6.StripeResource.method;I6.Coupons=P6.StripeResource.extend({create:mJ({method:"POST",fullPath:"/v1/coupons"}),retrieve:mJ({method:"GET",fullPath:"/v1/coupons/{coupon}"}),update:mJ({method:"POST",fullPath:"/v1/coupons/{coupon}"}),list:mJ({method:"GET",fullPath:"/v1/coupons",methodType:"list"}),del:mJ({method:"DELETE",fullPath:"/v1/coupons/{coupon}"})})});var M6=B((R6)=>{Object.defineProperty(R6,"__esModule",{value:!0});R6.CreditNotes=void 0;var g6=U(),i=g6.StripeResource.method;R6.CreditNotes=g6.StripeResource.extend({create:i({method:"POST",fullPath:"/v1/credit_notes",requestSchema:{kind:"object",fields:{lines:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}},responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),retrieve:i({method:"GET",fullPath:"/v1/credit_notes/{id}",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),update:i({method:"POST",fullPath:"/v1/credit_notes/{id}",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),list:i({method:"GET",fullPath:"/v1/credit_notes",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),listLineItems:i({method:"GET",fullPath:"/v1/credit_notes/{credit_note}/lines",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}),listPreviewLineItems:i({method:"GET",fullPath:"/v1/credit_notes/preview/lines",methodType:"list",requestSchema:{kind:"object",fields:{lines:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}},responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}),preview:i({method:"GET",fullPath:"/v1/credit_notes/preview",requestSchema:{kind:"object",fields:{lines:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}},responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),voidCreditNote:i({method:"POST",fullPath:"/v1/credit_notes/{id}/void",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}})})});var h6=B((_6)=>{Object.defineProperty(_6,"__esModule",{value:!0});_6.CustomerSessions=void 0;var j6=U(),V3=j6.StripeResource.method;_6.CustomerSessions=j6.StripeResource.extend({create:V3({method:"POST",fullPath:"/v1/customer_sessions"})})});var d6=B((u6)=>{Object.defineProperty(u6,"__esModule",{value:!0});u6.Customers=void 0;var l6=U(),F=l6.StripeResource.method;u6.Customers=l6.StripeResource.extend({create:F({method:"POST",fullPath:"/v1/customers",responseSchema:{kind:"object",fields:{subscriptions:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}),retrieve:F({method:"GET",fullPath:"/v1/customers/{customer}"}),update:F({method:"POST",fullPath:"/v1/customers/{customer}",responseSchema:{kind:"object",fields:{subscriptions:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}),list:F({method:"GET",fullPath:"/v1/customers",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{subscriptions:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}}}}),del:F({method:"DELETE",fullPath:"/v1/customers/{customer}"}),createBalanceTransaction:F({method:"POST",fullPath:"/v1/customers/{customer}/balance_transactions"}),createFundingInstructions:F({method:"POST",fullPath:"/v1/customers/{customer}/funding_instructions"}),createSource:F({method:"POST",fullPath:"/v1/customers/{customer}/sources"}),createTaxId:F({method:"POST",fullPath:"/v1/customers/{customer}/tax_ids"}),deleteDiscount:F({method:"DELETE",fullPath:"/v1/customers/{customer}/discount"}),deleteSource:F({method:"DELETE",fullPath:"/v1/customers/{customer}/sources/{id}"}),deleteTaxId:F({method:"DELETE",fullPath:"/v1/customers/{customer}/tax_ids/{id}"}),listBalanceTransactions:F({method:"GET",fullPath:"/v1/customers/{customer}/balance_transactions",methodType:"list"}),listCashBalanceTransactions:F({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance_transactions",methodType:"list"}),listPaymentMethods:F({method:"GET",fullPath:"/v1/customers/{customer}/payment_methods",methodType:"list"}),listSources:F({method:"GET",fullPath:"/v1/customers/{customer}/sources",methodType:"list"}),listTaxIds:F({method:"GET",fullPath:"/v1/customers/{customer}/tax_ids",methodType:"list"}),retrieveBalanceTransaction:F({method:"GET",fullPath:"/v1/customers/{customer}/balance_transactions/{transaction}"}),retrieveCashBalance:F({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance"}),retrieveCashBalanceTransaction:F({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance_transactions/{transaction}"}),retrievePaymentMethod:F({method:"GET",fullPath:"/v1/customers/{customer}/payment_methods/{payment_method}"}),retrieveSource:F({method:"GET",fullPath:"/v1/customers/{customer}/sources/{id}"}),retrieveTaxId:F({method:"GET",fullPath:"/v1/customers/{customer}/tax_ids/{id}"}),search:F({method:"GET",fullPath:"/v1/customers/search",methodType:"search",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{subscriptions:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}}}}),updateBalanceTransaction:F({method:"POST",fullPath:"/v1/customers/{customer}/balance_transactions/{transaction}"}),updateCashBalance:F({method:"POST",fullPath:"/v1/customers/{customer}/cash_balance"}),updateSource:F({method:"POST",fullPath:"/v1/customers/{customer}/sources/{id}"}),verifySource:F({method:"POST",fullPath:"/v1/customers/{customer}/sources/{id}/verify"})})});var p6=B((a6)=>{Object.defineProperty(a6,"__esModule",{value:!0});a6.Disputes=void 0;var n6=U(),C0=n6.StripeResource.method;a6.Disputes=n6.StripeResource.extend({retrieve:C0({method:"GET",fullPath:"/v1/disputes/{dispute}"}),update:C0({method:"POST",fullPath:"/v1/disputes/{dispute}"}),list:C0({method:"GET",fullPath:"/v1/disputes",methodType:"list"}),close:C0({method:"POST",fullPath:"/v1/disputes/{dispute}/close"})})});var e6=B((r6)=>{Object.defineProperty(r6,"__esModule",{value:!0});r6.EphemeralKeys=void 0;var s6=U(),o6=s6.StripeResource.method;r6.EphemeralKeys=s6.StripeResource.extend({create:o6({method:"POST",fullPath:"/v1/ephemeral_keys",validator:(J,Z)=>{if(!Z.headers||!Z.headers["Stripe-Version"])throw Error("Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node")}}),del:o6({method:"DELETE",fullPath:"/v1/ephemeral_keys/{key}"})})});var Gz=B(($z)=>{Object.defineProperty($z,"__esModule",{value:!0});$z.Events=void 0;var Zz=U(),Jz=Zz.StripeResource.method;$z.Events=Zz.StripeResource.extend({retrieve:Jz({method:"GET",fullPath:"/v1/events/{id}"}),list:Jz({method:"GET",fullPath:"/v1/events",methodType:"list"})})});var wz=B((Xz)=>{Object.defineProperty(Xz,"__esModule",{value:!0});Xz.ExchangeRates=void 0;var Bz=U(),zz=Bz.StripeResource.method;Xz.ExchangeRates=Bz.StripeResource.extend({retrieve:zz({method:"GET",fullPath:"/v1/exchange_rates/{rate_id}"}),list:zz({method:"GET",fullPath:"/v1/exchange_rates",methodType:"list"})})});var Wz=B((Lz)=>{Object.defineProperty(Lz,"__esModule",{value:!0});Lz.FileLinks=void 0;var Uz=U(),A0=Uz.StripeResource.method;Lz.FileLinks=Uz.StripeResource.extend({create:A0({method:"POST",fullPath:"/v1/file_links"}),retrieve:A0({method:"GET",fullPath:"/v1/file_links/{link}"}),update:A0({method:"POST",fullPath:"/v1/file_links/{link}"}),list:A0({method:"GET",fullPath:"/v1/file_links",methodType:"list"})})});var Hz=B((Tz)=>{Object.defineProperty(Tz,"__esModule",{value:!0});Tz.multipartRequestDataProcessor=void 0;var Kz=_(),W3=(J,Z,$)=>{let Q=(Math.round(Math.random()*10000000000000000)+Math.round(Math.random()*10000000000000000)).toString();$["Content-Type"]=`multipart/form-data; boundary=${Q}`;let G=new TextEncoder,z=new Uint8Array(0),w=G.encode(`\r
12
- `);function X(Y){let V=z,W=Y instanceof Uint8Array?Y:new Uint8Array(G.encode(Y));z=new Uint8Array(V.length+W.length+2),z.set(V),z.set(W,V.length),z.set(w,z.length-2)}function K(Y){return`"${Y.replace(/"|"/g,"%22").replace(/\r\n|\r|\n/g," ")}"`}let T=(0,Kz.flattenAndStringify)(Z);for(let Y in T){if(!Object.prototype.hasOwnProperty.call(T,Y))continue;let V=T[Y];if(X(`--${Q}`),Object.prototype.hasOwnProperty.call(V,"data")){let W=V;X(`Content-Disposition: form-data; name=${K(Y)}; filename=${K(W.name||"blob")}`),X(`Content-Type: ${W.type||"application/octet-stream"}`),X(""),X(W.data)}else X(`Content-Disposition: form-data; name=${K(Y)}`),X(""),X(V)}return X(`--${Q}--`),z};function K3(J,Z,$,Q){if(Z=Z||{},J!=="POST")return Q(null,(0,Kz.queryStringifyRequestData)(Z));this._stripe._platformFunctions.tryBufferData(Z).then((G)=>{let z=W3(J,G,$);return Q(null,z)}).catch((G)=>Q(G,null))}Tz.multipartRequestDataProcessor=K3});var Oz=B((qz)=>{Object.defineProperty(qz,"__esModule",{value:!0});qz.Files=void 0;var T3=Hz(),Dz=U(),qZ=Dz.StripeResource.method;qz.Files=Dz.StripeResource.extend({create:qZ({method:"POST",fullPath:"/v1/files",headers:{"Content-Type":"multipart/form-data"},host:"files.stripe.com"}),retrieve:qZ({method:"GET",fullPath:"/v1/files/{file}"}),list:qZ({method:"GET",fullPath:"/v1/files",methodType:"list"}),requestDataProcessor:T3.multipartRequestDataProcessor})});var Az=B((Fz)=>{Object.defineProperty(Fz,"__esModule",{value:!0});Fz.InvoiceItems=void 0;var kz=U(),hJ=kz.StripeResource.method;Fz.InvoiceItems=kz.StripeResource.extend({create:hJ({method:"POST",fullPath:"/v1/invoiceitems",requestSchema:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}},quantity_decimal:{kind:"decimal_string"},unit_amount_decimal:{kind:"decimal_string"}}},responseSchema:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"decimal_string"}}}}),retrieve:hJ({method:"GET",fullPath:"/v1/invoiceitems/{invoiceitem}",responseSchema:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"decimal_string"}}}}),update:hJ({method:"POST",fullPath:"/v1/invoiceitems/{invoiceitem}",requestSchema:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}},quantity_decimal:{kind:"decimal_string"},unit_amount_decimal:{kind:"decimal_string"}}},responseSchema:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"decimal_string"}}}}),list:hJ({method:"GET",fullPath:"/v1/invoiceitems",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"decimal_string"}}}}}}}),del:hJ({method:"DELETE",fullPath:"/v1/invoiceitems/{invoiceitem}"})})});var Iz=B((xz)=>{Object.defineProperty(xz,"__esModule",{value:!0});xz.InvoicePayments=void 0;var vz=U(),bz=vz.StripeResource.method;xz.InvoicePayments=vz.StripeResource.extend({retrieve:bz({method:"GET",fullPath:"/v1/invoice_payments/{invoice_payment}"}),list:bz({method:"GET",fullPath:"/v1/invoice_payments",methodType:"list"})})});var Rz=B((yz)=>{Object.defineProperty(yz,"__esModule",{value:!0});yz.InvoiceRenderingTemplates=void 0;var fz=U(),b0=fz.StripeResource.method;yz.InvoiceRenderingTemplates=fz.StripeResource.extend({retrieve:b0({method:"GET",fullPath:"/v1/invoice_rendering_templates/{template}"}),list:b0({method:"GET",fullPath:"/v1/invoice_rendering_templates",methodType:"list"}),archive:b0({method:"POST",fullPath:"/v1/invoice_rendering_templates/{template}/archive"}),unarchive:b0({method:"POST",fullPath:"/v1/invoice_rendering_templates/{template}/unarchive"})})});var _z=B((Mz)=>{Object.defineProperty(Mz,"__esModule",{value:!0});Mz.Invoices=void 0;var Sz=U(),P=Sz.StripeResource.method;Mz.Invoices=Sz.StripeResource.extend({create:P({method:"POST",fullPath:"/v1/invoices",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),retrieve:P({method:"GET",fullPath:"/v1/invoices/{invoice}",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),update:P({method:"POST",fullPath:"/v1/invoices/{invoice}",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),list:P({method:"GET",fullPath:"/v1/invoices",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),del:P({method:"DELETE",fullPath:"/v1/invoices/{invoice}"}),addLines:P({method:"POST",fullPath:"/v1/invoices/{invoice}/add_lines",requestSchema:{kind:"object",fields:{lines:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}},quantity_decimal:{kind:"decimal_string"}}}}}},responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),attachPayment:P({method:"POST",fullPath:"/v1/invoices/{invoice}/attach_payment",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),createPreview:P({method:"POST",fullPath:"/v1/invoices/create_preview",requestSchema:{kind:"object",fields:{invoice_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}},quantity_decimal:{kind:"decimal_string"},unit_amount_decimal:{kind:"decimal_string"}}}},schedule_details:{kind:"object",fields:{phases:{kind:"array",element:{kind:"object",fields:{add_invoice_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}},items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}}}}},subscription_details:{kind:"object",fields:{items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}}}},responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),finalizeInvoice:P({method:"POST",fullPath:"/v1/invoices/{invoice}/finalize",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),listLineItems:P({method:"GET",fullPath:"/v1/invoices/{invoice}/lines",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}),markUncollectible:P({method:"POST",fullPath:"/v1/invoices/{invoice}/mark_uncollectible",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),pay:P({method:"POST",fullPath:"/v1/invoices/{invoice}/pay",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),removeLines:P({method:"POST",fullPath:"/v1/invoices/{invoice}/remove_lines",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),search:P({method:"GET",fullPath:"/v1/invoices/search",methodType:"search",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),sendInvoice:P({method:"POST",fullPath:"/v1/invoices/{invoice}/send",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),updateLines:P({method:"POST",fullPath:"/v1/invoices/{invoice}/update_lines",requestSchema:{kind:"object",fields:{lines:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}},quantity_decimal:{kind:"decimal_string"}}}}}},responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),updateLineItem:P({method:"POST",fullPath:"/v1/invoices/{invoice}/lines/{line_item_id}",requestSchema:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}},quantity_decimal:{kind:"decimal_string"}}},responseSchema:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}),voidInvoice:P({method:"POST",fullPath:"/v1/invoices/{invoice}/void",responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{pricing:{kind:"nullable",inner:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}})})});var uz=B((hz)=>{Object.defineProperty(hz,"__esModule",{value:!0});hz.Mandates=void 0;var mz=U(),N3=mz.StripeResource.method;hz.Mandates=mz.StripeResource.extend({retrieve:N3({method:"GET",fullPath:"/v1/mandates/{mandate}"})})});var iz=B((nz)=>{Object.defineProperty(nz,"__esModule",{value:!0});nz.OAuth=void 0;var dz=U(),H3=_(),cz=dz.StripeResource.method,EZ="connect.stripe.com";nz.OAuth=dz.StripeResource.extend({basePath:"/",authorizeUrl(J,Z){J=J||{},Z=Z||{};let $="oauth/authorize";if(Z.express)$=`express/${$}`;if(!J.response_type)J.response_type="code";if(!J.client_id)J.client_id=this._stripe.getClientId();if(!J.scope)J.scope="read_write";return`https://${EZ}/${$}?${(0,H3.queryStringifyRequestData)(J)}`},token:cz({method:"POST",path:"oauth/token",host:EZ}),deauthorize(J,...Z){if(!J.client_id)J.client_id=this._stripe.getClientId();return cz({method:"POST",path:"oauth/deauthorize",host:EZ}).apply(this,[J,...Z])}})});var tz=B((sz)=>{Object.defineProperty(sz,"__esModule",{value:!0});sz.PaymentAttemptRecords=void 0;var oz=U(),pz=oz.StripeResource.method;sz.PaymentAttemptRecords=oz.StripeResource.extend({retrieve:pz({method:"GET",fullPath:"/v1/payment_attempt_records/{id}"}),list:pz({method:"GET",fullPath:"/v1/payment_attempt_records",methodType:"list"})})});var $1=B((J1)=>{Object.defineProperty(J1,"__esModule",{value:!0});J1.PaymentIntents=void 0;var ez=U(),j=ez.StripeResource.method;J1.PaymentIntents=ez.StripeResource.extend({create:j({method:"POST",fullPath:"/v1/payment_intents"}),retrieve:j({method:"GET",fullPath:"/v1/payment_intents/{intent}"}),update:j({method:"POST",fullPath:"/v1/payment_intents/{intent}"}),list:j({method:"GET",fullPath:"/v1/payment_intents",methodType:"list"}),applyCustomerBalance:j({method:"POST",fullPath:"/v1/payment_intents/{intent}/apply_customer_balance"}),cancel:j({method:"POST",fullPath:"/v1/payment_intents/{intent}/cancel"}),capture:j({method:"POST",fullPath:"/v1/payment_intents/{intent}/capture"}),confirm:j({method:"POST",fullPath:"/v1/payment_intents/{intent}/confirm"}),incrementAuthorization:j({method:"POST",fullPath:"/v1/payment_intents/{intent}/increment_authorization"}),listAmountDetailsLineItems:j({method:"GET",fullPath:"/v1/payment_intents/{intent}/amount_details_line_items",methodType:"list"}),search:j({method:"GET",fullPath:"/v1/payment_intents/search",methodType:"search"}),verifyMicrodeposits:j({method:"POST",fullPath:"/v1/payment_intents/{intent}/verify_microdeposits"})})});var B1=B((G1)=>{Object.defineProperty(G1,"__esModule",{value:!0});G1.PaymentLinks=void 0;var Q1=U(),lJ=Q1.StripeResource.method;G1.PaymentLinks=Q1.StripeResource.extend({create:lJ({method:"POST",fullPath:"/v1/payment_links",requestSchema:{kind:"object",fields:{line_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),retrieve:lJ({method:"GET",fullPath:"/v1/payment_links/{payment_link}",responseSchema:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),update:lJ({method:"POST",fullPath:"/v1/payment_links/{payment_link}",responseSchema:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}),list:lJ({method:"GET",fullPath:"/v1/payment_links",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}),listLineItems:lJ({method:"GET",fullPath:"/v1/payment_links/{payment_link}/line_items",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}})})});var U1=B((Y1)=>{Object.defineProperty(Y1,"__esModule",{value:!0});Y1.PaymentMethodConfigurations=void 0;var X1=U(),v0=X1.StripeResource.method;Y1.PaymentMethodConfigurations=X1.StripeResource.extend({create:v0({method:"POST",fullPath:"/v1/payment_method_configurations"}),retrieve:v0({method:"GET",fullPath:"/v1/payment_method_configurations/{configuration}"}),update:v0({method:"POST",fullPath:"/v1/payment_method_configurations/{configuration}"}),list:v0({method:"GET",fullPath:"/v1/payment_method_configurations",methodType:"list"})})});var K1=B((V1)=>{Object.defineProperty(V1,"__esModule",{value:!0});V1.PaymentMethodDomains=void 0;var L1=U(),uJ=L1.StripeResource.method;V1.PaymentMethodDomains=L1.StripeResource.extend({create:uJ({method:"POST",fullPath:"/v1/payment_method_domains"}),retrieve:uJ({method:"GET",fullPath:"/v1/payment_method_domains/{payment_method_domain}"}),update:uJ({method:"POST",fullPath:"/v1/payment_method_domains/{payment_method_domain}"}),list:uJ({method:"GET",fullPath:"/v1/payment_method_domains",methodType:"list"}),validate:uJ({method:"POST",fullPath:"/v1/payment_method_domains/{payment_method_domain}/validate"})})});var D1=B((N1)=>{Object.defineProperty(N1,"__esModule",{value:!0});N1.PaymentMethods=void 0;var T1=U(),NJ=T1.StripeResource.method;N1.PaymentMethods=T1.StripeResource.extend({create:NJ({method:"POST",fullPath:"/v1/payment_methods"}),retrieve:NJ({method:"GET",fullPath:"/v1/payment_methods/{payment_method}"}),update:NJ({method:"POST",fullPath:"/v1/payment_methods/{payment_method}"}),list:NJ({method:"GET",fullPath:"/v1/payment_methods",methodType:"list"}),attach:NJ({method:"POST",fullPath:"/v1/payment_methods/{payment_method}/attach"}),detach:NJ({method:"POST",fullPath:"/v1/payment_methods/{payment_method}/detach"})})});var k1=B((E1)=>{Object.defineProperty(E1,"__esModule",{value:!0});E1.PaymentRecords=void 0;var q1=U(),p=q1.StripeResource.method;E1.PaymentRecords=q1.StripeResource.extend({retrieve:p({method:"GET",fullPath:"/v1/payment_records/{id}"}),reportPayment:p({method:"POST",fullPath:"/v1/payment_records/report_payment"}),reportPaymentAttempt:p({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt"}),reportPaymentAttemptCanceled:p({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt_canceled"}),reportPaymentAttemptFailed:p({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt_failed"}),reportPaymentAttemptGuaranteed:p({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt_guaranteed"}),reportPaymentAttemptInformational:p({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt_informational"}),reportRefund:p({method:"POST",fullPath:"/v1/payment_records/{id}/report_refund"})})});var b1=B((C1)=>{Object.defineProperty(C1,"__esModule",{value:!0});C1.Payouts=void 0;var F1=U(),HJ=F1.StripeResource.method;C1.Payouts=F1.StripeResource.extend({create:HJ({method:"POST",fullPath:"/v1/payouts"}),retrieve:HJ({method:"GET",fullPath:"/v1/payouts/{payout}"}),update:HJ({method:"POST",fullPath:"/v1/payouts/{payout}"}),list:HJ({method:"GET",fullPath:"/v1/payouts",methodType:"list"}),cancel:HJ({method:"POST",fullPath:"/v1/payouts/{payout}/cancel"}),reverse:HJ({method:"POST",fullPath:"/v1/payouts/{payout}/reverse"})})});var I1=B((x1)=>{Object.defineProperty(x1,"__esModule",{value:!0});x1.Plans=void 0;var v1=U(),cJ=v1.StripeResource.method;x1.Plans=v1.StripeResource.extend({create:cJ({method:"POST",fullPath:"/v1/plans",requestSchema:{kind:"object",fields:{amount_decimal:{kind:"decimal_string"},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"decimal_string"},unit_amount_decimal:{kind:"decimal_string"}}}}}},responseSchema:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}),retrieve:cJ({method:"GET",fullPath:"/v1/plans/{plan}",responseSchema:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}),update:cJ({method:"POST",fullPath:"/v1/plans/{plan}",responseSchema:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}),list:cJ({method:"GET",fullPath:"/v1/plans",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}),del:cJ({method:"DELETE",fullPath:"/v1/plans/{plan}"})})});var R1=B((y1)=>{Object.defineProperty(y1,"__esModule",{value:!0});y1.Prices=void 0;var f1=U(),dJ=f1.StripeResource.method;y1.Prices=f1.StripeResource.extend({create:dJ({method:"POST",fullPath:"/v1/prices",requestSchema:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"decimal_string"},unit_amount_decimal:{kind:"decimal_string"}}}},unit_amount_decimal:{kind:"decimal_string"}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"decimal_string"},unit_amount_decimal:{kind:"decimal_string"}}}},unit_amount_decimal:{kind:"decimal_string"}}},responseSchema:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}),retrieve:dJ({method:"GET",fullPath:"/v1/prices/{price}",responseSchema:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}),update:dJ({method:"POST",fullPath:"/v1/prices/{price}",responseSchema:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}),list:dJ({method:"GET",fullPath:"/v1/prices",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}),search:dJ({method:"GET",fullPath:"/v1/prices/search",methodType:"search",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}})})});var _1=B((M1)=>{Object.defineProperty(M1,"__esModule",{value:!0});M1.Products=void 0;var S1=U(),m=S1.StripeResource.method;M1.Products=S1.StripeResource.extend({create:m({method:"POST",fullPath:"/v1/products",requestSchema:{kind:"object",fields:{default_price_data:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"decimal_string"},unit_amount_decimal:{kind:"decimal_string"}}}},unit_amount_decimal:{kind:"decimal_string"}}}},unit_amount_decimal:{kind:"decimal_string"}}}}}}),retrieve:m({method:"GET",fullPath:"/v1/products/{id}"}),update:m({method:"POST",fullPath:"/v1/products/{id}"}),list:m({method:"GET",fullPath:"/v1/products",methodType:"list"}),del:m({method:"DELETE",fullPath:"/v1/products/{id}"}),createFeature:m({method:"POST",fullPath:"/v1/products/{product}/features"}),deleteFeature:m({method:"DELETE",fullPath:"/v1/products/{product}/features/{id}"}),listFeatures:m({method:"GET",fullPath:"/v1/products/{product}/features",methodType:"list"}),retrieveFeature:m({method:"GET",fullPath:"/v1/products/{product}/features/{id}"}),search:m({method:"GET",fullPath:"/v1/products/search",methodType:"search"})})});var u1=B((h1)=>{Object.defineProperty(h1,"__esModule",{value:!0});h1.PromotionCodes=void 0;var m1=U(),x0=m1.StripeResource.method;h1.PromotionCodes=m1.StripeResource.extend({create:x0({method:"POST",fullPath:"/v1/promotion_codes"}),retrieve:x0({method:"GET",fullPath:"/v1/promotion_codes/{promotion_code}"}),update:x0({method:"POST",fullPath:"/v1/promotion_codes/{promotion_code}"}),list:x0({method:"GET",fullPath:"/v1/promotion_codes",methodType:"list"})})});var a1=B((d1)=>{Object.defineProperty(d1,"__esModule",{value:!0});d1.Quotes=void 0;var c1=U(),h=c1.StripeResource.method;d1.Quotes=c1.StripeResource.extend({create:h({method:"POST",fullPath:"/v1/quotes",requestSchema:{kind:"object",fields:{line_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{computed:{kind:"object",fields:{upfront:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}),retrieve:h({method:"GET",fullPath:"/v1/quotes/{quote}",responseSchema:{kind:"object",fields:{computed:{kind:"object",fields:{upfront:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}),update:h({method:"POST",fullPath:"/v1/quotes/{quote}",requestSchema:{kind:"object",fields:{line_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{computed:{kind:"object",fields:{upfront:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}),list:h({method:"GET",fullPath:"/v1/quotes",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{computed:{kind:"object",fields:{upfront:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}}}}),accept:h({method:"POST",fullPath:"/v1/quotes/{quote}/accept",responseSchema:{kind:"object",fields:{computed:{kind:"object",fields:{upfront:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}),cancel:h({method:"POST",fullPath:"/v1/quotes/{quote}/cancel",responseSchema:{kind:"object",fields:{computed:{kind:"object",fields:{upfront:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}),finalizeQuote:h({method:"POST",fullPath:"/v1/quotes/{quote}/finalize",responseSchema:{kind:"object",fields:{computed:{kind:"object",fields:{upfront:{kind:"object",fields:{line_items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}}}),listComputedUpfrontLineItems:h({method:"GET",fullPath:"/v1/quotes/{quote}/computed_upfront_line_items",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}),listLineItems:h({method:"GET",fullPath:"/v1/quotes/{quote}/line_items",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{price:{kind:"nullable",inner:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}),pdf:h({method:"GET",fullPath:"/v1/quotes/{quote}/pdf",host:"files.stripe.com",streaming:!0})})});var s1=B((p1)=>{Object.defineProperty(p1,"__esModule",{value:!0});p1.Refunds=void 0;var i1=U(),nJ=i1.StripeResource.method;p1.Refunds=i1.StripeResource.extend({create:nJ({method:"POST",fullPath:"/v1/refunds"}),retrieve:nJ({method:"GET",fullPath:"/v1/refunds/{refund}"}),update:nJ({method:"POST",fullPath:"/v1/refunds/{refund}"}),list:nJ({method:"GET",fullPath:"/v1/refunds",methodType:"list"}),cancel:nJ({method:"POST",fullPath:"/v1/refunds/{refund}/cancel"})})});var JB=B((t1)=>{Object.defineProperty(t1,"__esModule",{value:!0});t1.Reviews=void 0;var r1=U(),OZ=r1.StripeResource.method;t1.Reviews=r1.StripeResource.extend({retrieve:OZ({method:"GET",fullPath:"/v1/reviews/{review}"}),list:OZ({method:"GET",fullPath:"/v1/reviews",methodType:"list"}),approve:OZ({method:"POST",fullPath:"/v1/reviews/{review}/approve"})})});var GB=B(($B)=>{Object.defineProperty($B,"__esModule",{value:!0});$B.SetupAttempts=void 0;var ZB=U(),D3=ZB.StripeResource.method;$B.SetupAttempts=ZB.StripeResource.extend({list:D3({method:"GET",fullPath:"/v1/setup_attempts",methodType:"list"})})});var YB=B((BB)=>{Object.defineProperty(BB,"__esModule",{value:!0});BB.SetupIntents=void 0;var zB=U(),$J=zB.StripeResource.method;BB.SetupIntents=zB.StripeResource.extend({create:$J({method:"POST",fullPath:"/v1/setup_intents"}),retrieve:$J({method:"GET",fullPath:"/v1/setup_intents/{intent}"}),update:$J({method:"POST",fullPath:"/v1/setup_intents/{intent}"}),list:$J({method:"GET",fullPath:"/v1/setup_intents",methodType:"list"}),cancel:$J({method:"POST",fullPath:"/v1/setup_intents/{intent}/cancel"}),confirm:$J({method:"POST",fullPath:"/v1/setup_intents/{intent}/confirm"}),verifyMicrodeposits:$J({method:"POST",fullPath:"/v1/setup_intents/{intent}/verify_microdeposits"})})});var VB=B((UB)=>{Object.defineProperty(UB,"__esModule",{value:!0});UB.ShippingRates=void 0;var wB=U(),P0=wB.StripeResource.method;UB.ShippingRates=wB.StripeResource.extend({create:P0({method:"POST",fullPath:"/v1/shipping_rates"}),retrieve:P0({method:"GET",fullPath:"/v1/shipping_rates/{shipping_rate_token}"}),update:P0({method:"POST",fullPath:"/v1/shipping_rates/{shipping_rate_token}"}),list:P0({method:"GET",fullPath:"/v1/shipping_rates",methodType:"list"})})});var NB=B((KB)=>{Object.defineProperty(KB,"__esModule",{value:!0});KB.Sources=void 0;var WB=U(),aJ=WB.StripeResource.method;KB.Sources=WB.StripeResource.extend({create:aJ({method:"POST",fullPath:"/v1/sources"}),retrieve:aJ({method:"GET",fullPath:"/v1/sources/{source}"}),update:aJ({method:"POST",fullPath:"/v1/sources/{source}"}),listSourceTransactions:aJ({method:"GET",fullPath:"/v1/sources/{source}/source_transactions",methodType:"list"}),verify:aJ({method:"POST",fullPath:"/v1/sources/{source}/verify"})})});var EB=B((DB)=>{Object.defineProperty(DB,"__esModule",{value:!0});DB.SubscriptionItems=void 0;var HB=U(),iJ=HB.StripeResource.method;DB.SubscriptionItems=HB.StripeResource.extend({create:iJ({method:"POST",fullPath:"/v1/subscription_items",requestSchema:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}},responseSchema:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}),retrieve:iJ({method:"GET",fullPath:"/v1/subscription_items/{item}",responseSchema:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}),update:iJ({method:"POST",fullPath:"/v1/subscription_items/{item}",requestSchema:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}},responseSchema:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}),list:iJ({method:"GET",fullPath:"/v1/subscription_items",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}),del:iJ({method:"DELETE",fullPath:"/v1/subscription_items/{item}"})})});var CB=B((kB)=>{Object.defineProperty(kB,"__esModule",{value:!0});kB.SubscriptionSchedules=void 0;var OB=U(),DJ=OB.StripeResource.method;kB.SubscriptionSchedules=OB.StripeResource.extend({create:DJ({method:"POST",fullPath:"/v1/subscription_schedules",requestSchema:{kind:"object",fields:{phases:{kind:"array",element:{kind:"object",fields:{add_invoice_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}},items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}}}}}}),retrieve:DJ({method:"GET",fullPath:"/v1/subscription_schedules/{schedule}"}),update:DJ({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}",requestSchema:{kind:"object",fields:{phases:{kind:"array",element:{kind:"object",fields:{add_invoice_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}},items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}}}}}}),list:DJ({method:"GET",fullPath:"/v1/subscription_schedules",methodType:"list"}),cancel:DJ({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}/cancel"}),release:DJ({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}/release"})})});var xB=B((bB)=>{Object.defineProperty(bB,"__esModule",{value:!0});bB.Subscriptions=void 0;var AB=U(),u=AB.StripeResource.method;bB.Subscriptions=AB.StripeResource.extend({create:u({method:"POST",fullPath:"/v1/subscriptions",requestSchema:{kind:"object",fields:{add_invoice_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}},items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}),retrieve:u({method:"GET",fullPath:"/v1/subscriptions/{subscription_exposed_id}",responseSchema:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}),update:u({method:"POST",fullPath:"/v1/subscriptions/{subscription_exposed_id}",requestSchema:{kind:"object",fields:{add_invoice_items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}},items:{kind:"array",element:{kind:"object",fields:{price_data:{kind:"object",fields:{unit_amount_decimal:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}),list:u({method:"GET",fullPath:"/v1/subscriptions",methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}}),cancel:u({method:"DELETE",fullPath:"/v1/subscriptions/{subscription_exposed_id}",responseSchema:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}),deleteDiscount:u({method:"DELETE",fullPath:"/v1/subscriptions/{subscription_exposed_id}/discount"}),migrate:u({method:"POST",fullPath:"/v1/subscriptions/{subscription}/migrate",responseSchema:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}),resume:u({method:"POST",fullPath:"/v1/subscriptions/{subscription}/resume",responseSchema:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}),search:u({method:"GET",fullPath:"/v1/subscriptions/search",methodType:"search",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{items:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{plan:{kind:"object",fields:{amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}},price:{kind:"object",fields:{currency_options:{kind:"array",element:{kind:"object",fields:{tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tiers:{kind:"array",element:{kind:"object",fields:{flat_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}}}}}})})});var gB=B((fB)=>{Object.defineProperty(fB,"__esModule",{value:!0});fB.TaxCodes=void 0;var IB=U(),PB=IB.StripeResource.method;fB.TaxCodes=IB.StripeResource.extend({retrieve:PB({method:"GET",fullPath:"/v1/tax_codes/{id}"}),list:PB({method:"GET",fullPath:"/v1/tax_codes",methodType:"list"})})});var jB=B((SB)=>{Object.defineProperty(SB,"__esModule",{value:!0});SB.TaxIds=void 0;var RB=U(),I0=RB.StripeResource.method;SB.TaxIds=RB.StripeResource.extend({create:I0({method:"POST",fullPath:"/v1/tax_ids"}),retrieve:I0({method:"GET",fullPath:"/v1/tax_ids/{id}"}),list:I0({method:"GET",fullPath:"/v1/tax_ids",methodType:"list"}),del:I0({method:"DELETE",fullPath:"/v1/tax_ids/{id}"})})});var lB=B((mB)=>{Object.defineProperty(mB,"__esModule",{value:!0});mB.TaxRates=void 0;var _B=U(),f0=_B.StripeResource.method;mB.TaxRates=_B.StripeResource.extend({create:f0({method:"POST",fullPath:"/v1/tax_rates"}),retrieve:f0({method:"GET",fullPath:"/v1/tax_rates/{tax_rate}"}),update:f0({method:"POST",fullPath:"/v1/tax_rates/{tax_rate}"}),list:f0({method:"GET",fullPath:"/v1/tax_rates",methodType:"list"})})});var aB=B((dB)=>{Object.defineProperty(dB,"__esModule",{value:!0});dB.Tokens=void 0;var cB=U(),uB=cB.StripeResource.method;dB.Tokens=cB.StripeResource.extend({create:uB({method:"POST",fullPath:"/v1/tokens"}),retrieve:uB({method:"GET",fullPath:"/v1/tokens/{token}"})})});var sB=B((pB)=>{Object.defineProperty(pB,"__esModule",{value:!0});pB.Topups=void 0;var iB=U(),pJ=iB.StripeResource.method;pB.Topups=iB.StripeResource.extend({create:pJ({method:"POST",fullPath:"/v1/topups"}),retrieve:pJ({method:"GET",fullPath:"/v1/topups/{topup}"}),update:pJ({method:"POST",fullPath:"/v1/topups/{topup}"}),list:pJ({method:"GET",fullPath:"/v1/topups",methodType:"list"}),cancel:pJ({method:"POST",fullPath:"/v1/topups/{topup}/cancel"})})});var JX=B((tB)=>{Object.defineProperty(tB,"__esModule",{value:!0});tB.Transfers=void 0;var rB=U(),o=rB.StripeResource.method;tB.Transfers=rB.StripeResource.extend({create:o({method:"POST",fullPath:"/v1/transfers"}),retrieve:o({method:"GET",fullPath:"/v1/transfers/{transfer}"}),update:o({method:"POST",fullPath:"/v1/transfers/{transfer}"}),list:o({method:"GET",fullPath:"/v1/transfers",methodType:"list"}),createReversal:o({method:"POST",fullPath:"/v1/transfers/{id}/reversals"}),listReversals:o({method:"GET",fullPath:"/v1/transfers/{id}/reversals",methodType:"list"}),retrieveReversal:o({method:"GET",fullPath:"/v1/transfers/{transfer}/reversals/{id}"}),updateReversal:o({method:"POST",fullPath:"/v1/transfers/{transfer}/reversals/{id}"})})});var GX=B(($X)=>{Object.defineProperty($X,"__esModule",{value:!0});$X.WebhookEndpoints=void 0;var ZX=U(),oJ=ZX.StripeResource.method;$X.WebhookEndpoints=ZX.StripeResource.extend({create:oJ({method:"POST",fullPath:"/v1/webhook_endpoints"}),retrieve:oJ({method:"GET",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"}),update:oJ({method:"POST",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"}),list:oJ({method:"GET",fullPath:"/v1/webhook_endpoints",methodType:"list"}),del:oJ({method:"DELETE",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"})})});var BX=B((E)=>{Object.defineProperty(E,"__esModule",{value:!0});E.Subscriptions=E.SubscriptionSchedules=E.SubscriptionItems=E.Sources=E.ShippingRates=E.SetupIntents=E.SetupAttempts=E.Reviews=E.Refunds=E.Quotes=E.PromotionCodes=E.Products=E.Prices=E.Plans=E.Payouts=E.PaymentRecords=E.PaymentMethods=E.PaymentMethodDomains=E.PaymentMethodConfigurations=E.PaymentLinks=E.PaymentIntents=E.PaymentAttemptRecords=E.OAuth=E.Mandates=E.Invoices=E.InvoiceRenderingTemplates=E.InvoicePayments=E.InvoiceItems=E.Files=E.FileLinks=E.ExchangeRates=E.Events=E.EphemeralKeys=E.Disputes=E.Customers=E.CustomerSessions=E.CreditNotes=E.Coupons=E.CountrySpecs=E.ConfirmationTokens=E.Charges=E.BalanceTransactions=E.BalanceSettings=E.Balance=E.ApplicationFees=E.ApplePayDomains=E.Accounts=E.AccountSessions=E.AccountLinks=E.Account=void 0;E.V2=E.Treasury=E.TestHelpers=E.Terminal=E.Tax=E.Sigma=E.Reporting=E.Radar=E.Issuing=E.Identity=E.Forwarding=E.FinancialConnections=E.Entitlements=E.Climate=E.Checkout=E.BillingPortal=E.Billing=E.Apps=E.WebhookEndpoints=E.Transfers=E.Topups=E.Tokens=E.TaxRates=E.TaxIds=E.TaxCodes=void 0;var C=T$(),q3=q$(),E3=C$(),O3=x$(),k3=h$(),F3=n$(),C3=o$(),A3=e$(),b3=Q8(),v3=X8(),x3=L8(),P3=T8(),I3=q8(),f3=F8(),y3=v8(),g3=f8(),R3=S8(),S3=m8(),M3=c8(),j3=p8(),_3=t8(),m3=$Q(),h3=BQ(),l3=UQ(),u3=KQ(),c3=qQ(),d3=FQ(),n3=vQ(),a3=fQ(),i3=SQ(),p3=mQ(),o3=cQ(),s3=iQ(),r3=rQ(),t3=Z7(),e3=z7(),JU=w7(),ZU=W7(),$U=H7(),QU=O7(),GU=A7(),zU=P7(),BU=g7(),XU=j7(),YU=l7(),wU=n7(),UU=o7(),LU=e7(),VU=Q4(),WU=Y4(),KU=W4(),TU=H4(),NU=O4(),HU=A4(),DU=I4(),qU=R4(),EU=m4(),OU=c4(),kU=i4(),FU=r4(),CU=$5(),AU=B5(),bU=L5(),vU=T5(),xU=q5(),PU=F5(),IU=x5(),fU=g5(),yU=_5(),gU=u5(),RU=a5(),SU=r5(),MU=$G(),jU=BG(),_U=UG(),mU=KG(),hU=qG(),lU=FG(),uU=vG(),cU=yG(),dU=MG(),nU=DZ();Object.defineProperty(E,"Account",{enumerable:!0,get:function(){return nU.Accounts}});var aU=cG();Object.defineProperty(E,"AccountLinks",{enumerable:!0,get:function(){return aU.AccountLinks}});var iU=iG();Object.defineProperty(E,"AccountSessions",{enumerable:!0,get:function(){return iU.AccountSessions}});var pU=DZ();Object.defineProperty(E,"Accounts",{enumerable:!0,get:function(){return pU.Accounts}});var oU=rG();Object.defineProperty(E,"ApplePayDomains",{enumerable:!0,get:function(){return oU.ApplePayDomains}});var sU=Z6();Object.defineProperty(E,"ApplicationFees",{enumerable:!0,get:function(){return sU.ApplicationFees}});var rU=z6();Object.defineProperty(E,"Balance",{enumerable:!0,get:function(){return rU.Balance}});var tU=U6();Object.defineProperty(E,"BalanceSettings",{enumerable:!0,get:function(){return tU.BalanceSettings}});var eU=T6();Object.defineProperty(E,"BalanceTransactions",{enumerable:!0,get:function(){return eU.BalanceTransactions}});var JL=q6();Object.defineProperty(E,"Charges",{enumerable:!0,get:function(){return JL.Charges}});var ZL=F6();Object.defineProperty(E,"ConfirmationTokens",{enumerable:!0,get:function(){return ZL.ConfirmationTokens}});var $L=x6();Object.defineProperty(E,"CountrySpecs",{enumerable:!0,get:function(){return $L.CountrySpecs}});var QL=y6();Object.defineProperty(E,"Coupons",{enumerable:!0,get:function(){return QL.Coupons}});var GL=M6();Object.defineProperty(E,"CreditNotes",{enumerable:!0,get:function(){return GL.CreditNotes}});var zL=h6();Object.defineProperty(E,"CustomerSessions",{enumerable:!0,get:function(){return zL.CustomerSessions}});var BL=d6();Object.defineProperty(E,"Customers",{enumerable:!0,get:function(){return BL.Customers}});var XL=p6();Object.defineProperty(E,"Disputes",{enumerable:!0,get:function(){return XL.Disputes}});var YL=e6();Object.defineProperty(E,"EphemeralKeys",{enumerable:!0,get:function(){return YL.EphemeralKeys}});var wL=Gz();Object.defineProperty(E,"Events",{enumerable:!0,get:function(){return wL.Events}});var UL=wz();Object.defineProperty(E,"ExchangeRates",{enumerable:!0,get:function(){return UL.ExchangeRates}});var LL=Wz();Object.defineProperty(E,"FileLinks",{enumerable:!0,get:function(){return LL.FileLinks}});var VL=Oz();Object.defineProperty(E,"Files",{enumerable:!0,get:function(){return VL.Files}});var WL=Az();Object.defineProperty(E,"InvoiceItems",{enumerable:!0,get:function(){return WL.InvoiceItems}});var KL=Iz();Object.defineProperty(E,"InvoicePayments",{enumerable:!0,get:function(){return KL.InvoicePayments}});var TL=Rz();Object.defineProperty(E,"InvoiceRenderingTemplates",{enumerable:!0,get:function(){return TL.InvoiceRenderingTemplates}});var NL=_z();Object.defineProperty(E,"Invoices",{enumerable:!0,get:function(){return NL.Invoices}});var HL=uz();Object.defineProperty(E,"Mandates",{enumerable:!0,get:function(){return HL.Mandates}});var DL=iz();Object.defineProperty(E,"OAuth",{enumerable:!0,get:function(){return DL.OAuth}});var qL=tz();Object.defineProperty(E,"PaymentAttemptRecords",{enumerable:!0,get:function(){return qL.PaymentAttemptRecords}});var EL=$1();Object.defineProperty(E,"PaymentIntents",{enumerable:!0,get:function(){return EL.PaymentIntents}});var OL=B1();Object.defineProperty(E,"PaymentLinks",{enumerable:!0,get:function(){return OL.PaymentLinks}});var kL=U1();Object.defineProperty(E,"PaymentMethodConfigurations",{enumerable:!0,get:function(){return kL.PaymentMethodConfigurations}});var FL=K1();Object.defineProperty(E,"PaymentMethodDomains",{enumerable:!0,get:function(){return FL.PaymentMethodDomains}});var CL=D1();Object.defineProperty(E,"PaymentMethods",{enumerable:!0,get:function(){return CL.PaymentMethods}});var AL=k1();Object.defineProperty(E,"PaymentRecords",{enumerable:!0,get:function(){return AL.PaymentRecords}});var bL=b1();Object.defineProperty(E,"Payouts",{enumerable:!0,get:function(){return bL.Payouts}});var vL=I1();Object.defineProperty(E,"Plans",{enumerable:!0,get:function(){return vL.Plans}});var xL=R1();Object.defineProperty(E,"Prices",{enumerable:!0,get:function(){return xL.Prices}});var PL=_1();Object.defineProperty(E,"Products",{enumerable:!0,get:function(){return PL.Products}});var IL=u1();Object.defineProperty(E,"PromotionCodes",{enumerable:!0,get:function(){return IL.PromotionCodes}});var fL=a1();Object.defineProperty(E,"Quotes",{enumerable:!0,get:function(){return fL.Quotes}});var yL=s1();Object.defineProperty(E,"Refunds",{enumerable:!0,get:function(){return yL.Refunds}});var gL=JB();Object.defineProperty(E,"Reviews",{enumerable:!0,get:function(){return gL.Reviews}});var RL=GB();Object.defineProperty(E,"SetupAttempts",{enumerable:!0,get:function(){return RL.SetupAttempts}});var SL=YB();Object.defineProperty(E,"SetupIntents",{enumerable:!0,get:function(){return SL.SetupIntents}});var ML=VB();Object.defineProperty(E,"ShippingRates",{enumerable:!0,get:function(){return ML.ShippingRates}});var jL=NB();Object.defineProperty(E,"Sources",{enumerable:!0,get:function(){return jL.Sources}});var _L=EB();Object.defineProperty(E,"SubscriptionItems",{enumerable:!0,get:function(){return _L.SubscriptionItems}});var mL=CB();Object.defineProperty(E,"SubscriptionSchedules",{enumerable:!0,get:function(){return mL.SubscriptionSchedules}});var hL=xB();Object.defineProperty(E,"Subscriptions",{enumerable:!0,get:function(){return hL.Subscriptions}});var lL=gB();Object.defineProperty(E,"TaxCodes",{enumerable:!0,get:function(){return lL.TaxCodes}});var uL=jB();Object.defineProperty(E,"TaxIds",{enumerable:!0,get:function(){return uL.TaxIds}});var cL=lB();Object.defineProperty(E,"TaxRates",{enumerable:!0,get:function(){return cL.TaxRates}});var dL=aB();Object.defineProperty(E,"Tokens",{enumerable:!0,get:function(){return dL.Tokens}});var nL=sB();Object.defineProperty(E,"Topups",{enumerable:!0,get:function(){return nL.Topups}});var aL=JX();Object.defineProperty(E,"Transfers",{enumerable:!0,get:function(){return aL.Transfers}});var iL=GX();Object.defineProperty(E,"WebhookEndpoints",{enumerable:!0,get:function(){return iL.WebhookEndpoints}});E.Apps=(0,C.resourceNamespace)("apps",{Secrets:vU.Secrets});E.Billing=(0,C.resourceNamespace)("billing",{Alerts:C3.Alerts,CreditBalanceSummary:M3.CreditBalanceSummary,CreditBalanceTransactions:j3.CreditBalanceTransactions,CreditGrants:_3.CreditGrants,MeterEventAdjustments:r3.MeterEventAdjustments,MeterEvents:ZU.MeterEvents,Meters:QU.Meters});E.BillingPortal=(0,C.resourceNamespace)("billingPortal",{Configurations:y3.Configurations,Sessions:xU.Sessions});E.Checkout=(0,C.resourceNamespace)("checkout",{Sessions:PU.Sessions});E.Climate=(0,C.resourceNamespace)("climate",{Orders:zU.Orders,Products:KU.Products,Suppliers:yU.Suppliers});E.Entitlements=(0,C.resourceNamespace)("entitlements",{ActiveEntitlements:F3.ActiveEntitlements,Features:a3.Features});E.FinancialConnections=(0,C.resourceNamespace)("financialConnections",{Accounts:O3.Accounts,Sessions:IU.Sessions,Transactions:MU.Transactions});E.Forwarding=(0,C.resourceNamespace)("forwarding",{Requests:AU.Requests});E.Identity=(0,C.resourceNamespace)("identity",{VerificationReports:cU.VerificationReports,VerificationSessions:dU.VerificationSessions});E.Issuing=(0,C.resourceNamespace)("issuing",{Authorizations:b3.Authorizations,Cardholders:P3.Cardholders,Cards:I3.Cards,Disputes:u3.Disputes,PersonalizationDesigns:LU.PersonalizationDesigns,PhysicalBundles:WU.PhysicalBundles,Tokens:RU.Tokens,Transactions:jU.Transactions});E.Radar=(0,C.resourceNamespace)("radar",{EarlyFraudWarnings:c3.EarlyFraudWarnings,PaymentEvaluations:UU.PaymentEvaluations,ValueListItems:lU.ValueListItems,ValueLists:uU.ValueLists});E.Reporting=(0,C.resourceNamespace)("reporting",{ReportRuns:FU.ReportRuns,ReportTypes:CU.ReportTypes});E.Sigma=(0,C.resourceNamespace)("sigma",{ScheduledQueryRuns:bU.ScheduledQueryRuns});E.Tax=(0,C.resourceNamespace)("tax",{Associations:A3.Associations,Calculations:x3.Calculations,Registrations:kU.Registrations,Settings:fU.Settings,Transactions:_U.Transactions});E.Terminal=(0,C.resourceNamespace)("terminal",{Configurations:g3.Configurations,ConnectionTokens:S3.ConnectionTokens,Locations:s3.Locations,OnboardingLinks:GU.OnboardingLinks,Readers:TU.Readers});E.TestHelpers=(0,C.resourceNamespace)("testHelpers",{ConfirmationTokens:R3.ConfirmationTokens,Customers:h3.Customers,Refunds:OU.Refunds,TestClocks:gU.TestClocks,Issuing:(0,C.resourceNamespace)("issuing",{Authorizations:v3.Authorizations,Cards:f3.Cards,PersonalizationDesigns:VU.PersonalizationDesigns,Transactions:mU.Transactions}),Terminal:(0,C.resourceNamespace)("terminal",{Readers:NU.Readers}),Treasury:(0,C.resourceNamespace)("treasury",{InboundTransfers:p3.InboundTransfers,OutboundPayments:BU.OutboundPayments,OutboundTransfers:YU.OutboundTransfers,ReceivedCredits:HU.ReceivedCredits,ReceivedDebits:qU.ReceivedDebits})});E.Treasury=(0,C.resourceNamespace)("treasury",{CreditReversals:m3.CreditReversals,DebitReversals:l3.DebitReversals,FinancialAccounts:i3.FinancialAccounts,InboundTransfers:o3.InboundTransfers,OutboundPayments:XU.OutboundPayments,OutboundTransfers:wU.OutboundTransfers,ReceivedCredits:DU.ReceivedCredits,ReceivedDebits:EU.ReceivedDebits,TransactionEntries:SU.TransactionEntries,Transactions:hU.Transactions});E.V2=(0,C.resourceNamespace)("v2",{Billing:(0,C.resourceNamespace)("billing",{MeterEventAdjustments:t3.MeterEventAdjustments,MeterEventSession:e3.MeterEventSession,MeterEventStream:JU.MeterEventStream,MeterEvents:$U.MeterEvents}),Core:(0,C.resourceNamespace)("core",{AccountLinks:q3.AccountLinks,AccountTokens:E3.AccountTokens,Accounts:k3.Accounts,EventDestinations:d3.EventDestinations,Events:n3.Events})})});var kX=B((EX)=>{Object.defineProperty(EX,"__esModule",{value:!0});EX.createStripe=void 0;var XX=CJ(),VV=m9(),DX=U(),YX=B$(),WV=w$(),qX=V$(),KV=OJ(),TV=X0(),wX=kJ(),y0=BX(),QJ=_(),UX="api.stripe.com",LX="443",VX="/v1/",WX=qX.ApiVersion,KX=80000,TX=5,NX=0.5,NV=["name","version","url","partner_id"],HX=["authenticator","apiVersion","typescript","maxNetworkRetries","httpAgent","httpClient","timeout","host","port","protocol","telemetry","appInfo","stripeAccount","stripeContext"],HV=(J)=>new VV.RequestSender(J,DX.StripeResource.MAX_BUFFERED_REQUEST_METRICS);function DV(J,Z=HV){Q.PACKAGE_VERSION="21.0.1",Q.API_VERSION=qX.ApiVersion;let $=typeof process<"u"&&process.env?(0,QJ.detectAIAgent)(process.env):"";Q.AI_AGENT=$,Q.USER_AGENT={bindings_version:Q.PACKAGE_VERSION,lang:"node",typescript:!1,...(0,QJ.determineProcessUserAgentProperties)(),...$?{ai_agent:$}:{}},Q.StripeResource=DX.StripeResource,Q.StripeContext=YX.StripeContext,Q.resources=y0,Q.HttpClient=wX.HttpClient,Q.HttpClientResponse=wX.HttpClientResponse,Q.CryptoProvider=KV.CryptoProvider,Q.webhooks=(0,WV.createWebhooks)(J),Q.Decimal=TV.Decimal;function Q(G,z={}){if(!(this instanceof Q))return new Q(G,z);let w=this._getPropsFromConfig(z);this._platformFunctions=J,Object.defineProperty(this,"_emitter",{value:this._platformFunctions.createEmitter(),enumerable:!1,configurable:!1,writable:!1}),this.VERSION=Q.PACKAGE_VERSION,this.on=this._emitter.on.bind(this._emitter),this.once=this._emitter.once.bind(this._emitter),this.off=this._emitter.removeListener.bind(this._emitter);let X=w.httpAgent||null;this._api={host:w.host||UX,port:w.port||LX,protocol:w.protocol||"https",basePath:VX,version:w.apiVersion||WX,timeout:(0,QJ.validateInteger)("timeout",w.timeout,KX),maxNetworkRetries:(0,QJ.validateInteger)("maxNetworkRetries",w.maxNetworkRetries,2),agent:X,httpClient:w.httpClient||(X?this._platformFunctions.createNodeHttpClient(X):this._platformFunctions.createDefaultHttpClient()),dev:!1,stripeAccount:w.stripeAccount||null,stripeContext:w.stripeContext||null};let K=w.typescript||!1;if(K!==Q.USER_AGENT.typescript)Q.USER_AGENT.typescript=K;if(w.appInfo)this._setAppInfo(w.appInfo);this._prepResources(),this._setAuthenticator(G,w.authenticator),this.errors=XX,this.webhooks=Q.webhooks,this._prevRequestMetrics=[],this._enableTelemetry=w.telemetry!==!1,this._requestSender=Z(this),this.StripeResource=Q.StripeResource,this.Decimal=Q.Decimal}return Q.errors=XX,Q.createNodeHttpClient=J.createNodeHttpClient,Q.createFetchHttpClient=J.createFetchHttpClient,Q.createNodeCryptoProvider=J.createNodeCryptoProvider,Q.createSubtleCryptoProvider=J.createSubtleCryptoProvider,Q.prototype={_appInfo:void 0,on:null,off:null,once:null,VERSION:null,StripeResource:null,webhooks:null,errors:null,_api:null,_prevRequestMetrics:null,_emitter:null,_enableTelemetry:null,_requestSender:null,_platformFunctions:null,rawRequest(G,z,w,X){return this._requestSender._rawRequest(G,z,w,X)},_setAuthenticator(G,z){if(G&&z)throw Error("Can't specify both apiKey and authenticator");if(!G&&!z)throw Error("Neither apiKey nor config.authenticator provided");this._authenticator=G?(0,QJ.createApiKeyAuthenticator)(G):z},_setAppInfo(G){if(G&&typeof G!=="object")throw Error("AppInfo must be an object.");if(G&&!G.name)throw Error("AppInfo.name is required");G=G||{},this._appInfo=NV.reduce((z,w)=>{if(typeof G[w]=="string")z=z||{},z[w]=G[w];return z},{})},_setApiField(G,z){this._api[G]=z},getApiField(G){return this._api[G]},setClientId(G){this._clientId=G},getClientId(){return this._clientId},getConstant:(G)=>{switch(G){case"DEFAULT_HOST":return UX;case"DEFAULT_PORT":return LX;case"DEFAULT_BASE_PATH":return VX;case"DEFAULT_API_VERSION":return WX;case"DEFAULT_TIMEOUT":return KX;case"MAX_NETWORK_RETRY_DELAY_SEC":return TX;case"INITIAL_NETWORK_RETRY_DELAY_SEC":return NX}return Q[G]},getMaxNetworkRetries(){return this.getApiField("maxNetworkRetries")},_setApiNumberField(G,z,w){let X=(0,QJ.validateInteger)(G,z,w);this._setApiField(G,X)},getMaxNetworkRetryDelay(){return TX},getInitialNetworkRetryDelay(){return NX},getClientUserAgent(G){return this.getClientUserAgentSeeded(Q.USER_AGENT,G)},getClientUserAgentSeeded(G,z){let w={};for(let T in G){if(!Object.prototype.hasOwnProperty.call(G,T))continue;w[T]=encodeURIComponent(G[T]??"null")}let X=this._platformFunctions.getPlatformInfo();if(X&&this.getTelemetryEnabled())w.platform=encodeURIComponent(X);else delete w.platform;let K=this.getApiField("httpClient");if(K)w.httplib=encodeURIComponent(K.getClientName());if(this._appInfo)w.application=this._appInfo;z(JSON.stringify(w))},getAppInfoAsString(){if(!this._appInfo)return"";let G=this._appInfo.name;if(this._appInfo.version)G+=`/${this._appInfo.version}`;if(this._appInfo.url)G+=` (${this._appInfo.url})`;return G},getTelemetryEnabled(){return this._enableTelemetry},_prepResources(){for(let G in y0){if(!Object.prototype.hasOwnProperty.call(y0,G))continue;this[(0,QJ.pascalToCamelCase)(G)]=new y0[G](this)}},_getPropsFromConfig(G){if(!G)return{};let z=typeof G==="string";if(!(G===Object(G)&&!Array.isArray(G))&&!z)throw Error("Config must either be an object or a string");if(z)return{apiVersion:G};if(Object.keys(G).filter((K)=>!HX.includes(K)).length>0)throw Error(`Config object may only contain the following: ${HX.join(", ")}`);return G},parseEventNotification(G,z,w,X,K,T){this.webhooks.signature.verifyHeader(G,z,w,X||this.webhooks.DEFAULT_TOLERANCE,K,T);let Y=G instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(G)):JSON.parse(G);if(Y&&Y.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotification, which expects an event notification. Use stripe.webhooks.constructEvent instead.");if(Y.context)Y.context=YX.StripeContext.parse(Y.context);return Y.fetchEvent=()=>{return this._requestSender._rawRequest("GET",`/v2/core/events/${Y.id}`,void 0,{stripeContext:Y.context,headers:{"Stripe-Request-Trigger":`event=${Y.id}`}},["fetch_event"])},Y.fetchRelatedObject=()=>{if(!Y.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",Y.related_object.url,void 0,{stripeContext:Y.context,headers:{"Stripe-Request-Trigger":`event=${Y.id}`}},["fetch_related_object"])},Y}},Q}EX.createStripe=DV});var FZ=B((FX,sJ)=>{Object.defineProperty(FX,"__esModule",{value:!0});var qV=S9(),EV=kX(),OV=X0(),kZ=(0,EV.createStripe)(new qV.NodePlatformFunctions);sJ.exports=kZ;sJ.exports.Stripe=kZ;sJ.exports.default=kZ;sJ.exports.Decimal=OV.Decimal});var AX=_Z(FZ(),1);import{services as CX}from"@stacksjs/config";var CZ=null,H=new Proxy({},{get(J,Z){if(!CZ){let $=CX?.stripe?.secretKey;if(!$)throw Error("Stripe secret key is not configured. Set STRIPE_SECRET_KEY in your .env file.");let Q="2026-03-25.dahlia",G=CX?.stripe?.apiVersion;if(G&&G!==Q)throw Error(`Stripe API version ${G} does not match the installed SDK version ${Q}`);CZ=new AX.default($,{apiVersion:Q})}return CZ[Z]}});import{config as FV}from"@stacksjs/config";import{log as CV}from"@stacksjs/logging";import{createHash as bX}from"crypto";var AZ="stacks",bZ="v1",kV=255;function c(J,...Z){let $=Z.filter((z)=>z!==null&&z!==void 0&&z!=="").map((z)=>String(z)).join(":"),Q=$?`${AZ}:${J}:${$}:${bZ}`:`${AZ}:${J}:${bZ}`;if(Q.length<=kV)return Q;let G=bX("sha256").update($).digest("hex").slice(0,32);return`${AZ}:${J}:${G}:${bZ}`}function GJ(J,...Z){let $=bX("sha256").update(`${Date.now()}:${Math.random()}`).digest("hex").slice(0,16);return c(J,...Z,$)}function vX(){let J=FV||{};return(J.payment?.currency||J.billing?.currency||process.env.STRIPE_CURRENCY||"usd").toLowerCase()}var g0=(()=>{async function J(G,z,w){let X={currency:vX(),amount:z};if(G.hasStripeId())X.customer=G.stripe_id??void 0;let K={...X,...w};return await H.paymentIntents.create(K,{idempotencyKey:GJ("payment_intent.create",G.id,z)})}async function Z(G){try{return await H.paymentIntents.retrieve(G)}catch(z){return CV.error(z),null}}async function $(G,z={}){if(!G||typeof G!=="string")throw Error("[payments/refund] paymentIntentId is required");if(z.amount!=null){if(typeof z.amount!=="number"||!Number.isFinite(z.amount)||z.amount<=0)throw Error("[payments/refund] amount must be a positive finite number");try{let Y=await H.paymentIntents.retrieve(G),V=Y.amount_received??Y.amount;if(V&&z.amount>V)throw Error(`[payments/refund] amount ${z.amount} exceeds captured amount ${V}`)}catch(Y){if(Y instanceof Error&&Y.message.startsWith("[payments/refund]"))throw Y}}let{idempotencyKey:w,...X}=z,K={payment_intent:G,...X},T={idempotencyKey:w||`refund:${G}:${X.amount??"full"}`};return await H.refunds.create(K,T)}async function Q(G,z,w,X){let T={...{confirmation_method:"automatic",confirm:!0,payment_method:w,currency:vX(),amount:z},...X};return await J(G,z,T)}return{createPayment:J,charge:Q,findPayment:Z,refund:$}})();import{config as AV}from"@stacksjs/config";function xX(J,Z){if(!J)return;let $;try{$=new URL(J)}catch{throw Error(`[payments/checkout] ${Z} is not a valid URL: ${J}`)}let Q=AV?.app?.url;if(!Q)return;let G;try{G=new URL(Q.startsWith("http")?Q:`https://${Q}`).origin}catch{return}if($.origin!==G)throw Error(`[payments/checkout] ${Z} origin (${$.origin}) does not match app origin (${G})`)}var vZ=(()=>{async function J(Z,$){let Q=$.customer||Z.stripe_id;if(!Q)throw Error("User has no Stripe customer");xX($.success_url,"success_url"),xX($.cancel_url,"cancel_url");let z={...{customer:Q,mode:"payment",success_url:$.success_url,cancel_url:$.cancel_url},...$};return await H.checkout.sessions.create(z,{idempotencyKey:GJ("checkout.session.create",Z.id)})}return{create:J}})();var d=(()=>{function J(L){return L.stripe_id||""}function Z(L){return{line1:L.address?.line1,city:L.address?.city,state:L.address?.state,postal_code:L.address?.postal_code,country:L.address?.country}}function $(){return[]}function Q(L){return L}function G(L){return Boolean(L.stripe_id)}async function z(L,N={}){if(G(L))throw Error("Customer already created");if(!N.name&&W(L))N.name=W(L);if(!N.email&&D(L))N.email=D(L);let q=await H.customers.create(N,{idempotencyKey:c("customer.create",L.id)});return await L.update({stripe_id:q.id}),q}async function w(L,N={}){if(!L.stripe_id)throw Error("User does not have a Stripe customer ID. Create a customer first.");return await H.customers.update(L.stripe_id,N,{idempotencyKey:c("customer.update",L.id,L.stripe_id)})}async function X(L){if(!G(L))throw Error("User does not have a Stripe ID");try{if(!L.stripe_id)throw Error("User has no Stripe ID");let N=await H.customers.del(L.stripe_id);return await L.update({stripe_id:""}),N}catch(N){if(N.statusCode===404)throw Error("Customer not found in Stripe");throw N}}async function K(L,N={}){if(!G(L))return await z(L,N);try{let q=await H.customers.retrieve(L.stripe_id);if(q.deleted)throw Error("Customer was deleted");return q}catch(q){if(q.statusCode===404)return await z(L,N);throw q}}async function T(L){if(!G(L))return;try{let N=await H.customers.retrieve(L.stripe_id);if(N.deleted)throw Error("Customer was deleted in Stripe");return N}catch(N){if(N.statusCode===404)throw Error("Customer not found in Stripe");throw N}}async function Y(L,N){if(!G(L))return await z(L,N);try{if((await H.customers.retrieve(L.stripe_id)).deleted)return await z(L,N);return await w(L,N)}catch(q){if(q.statusCode===404)return await z(L,N);throw q}}async function V(L,N){return await w(L,{name:W(L),email:D(L),address:Z(N),preferred_locales:$(),metadata:N.metadata?Q(N.metadata):{}})}function W(L){return L.name||""}function D(L){return L.email||""}return{stripeId:J,hasStripeId:G,createStripeCustomer:z,updateStripeCustomer:w,createOrGetStripeUser:K,createOrUpdateStripeUser:Y,deleteStripeUser:X,retrieveStripeUser:T,syncStripeCustomerDetails:V}})();var xZ=(()=>{async function J(Z){if(!Z.hasStripeId())throw Error("Customer does not exist in Stripe");if(!Z.stripe_id)throw Error("User has no Stripe ID");return await H.invoices.list({customer:Z.stripe_id,expand:["data.payment_intent.payment_method"]})}return{list:J}})();import{db as s}from"@stacksjs/database";import{PaymentMethod as PZ}from"@stacksjs/orm";var rJ=(()=>{async function J(Y,V){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");let W;if(typeof V==="string")W=await H.paymentMethods.retrieve(V);else W=V;if(W.customer!==Y.stripe_id)W=await H.paymentMethods.attach(W.id,{customer:Y.stripe_id});return await Q(Y,W),W}async function Z(Y,V){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");let W=await H.paymentMethods.retrieve(V),D=await s.selectFrom("payment_methods").where("provider_id","=",V).selectAll().executeTakeFirst();if(!Y.stripe_id)throw Error("User has no Stripe ID");if(W.customer!==Y.stripe_id)await H.paymentMethods.attach(W.id,{customer:Y.stripe_id});let L=await H.customers.update(Y.stripe_id,{invoice_settings:{default_payment_method:V}});if(await s.updateTable("payment_methods").set({is_default:!1}).where("user_id","=",Y.id).executeTakeFirst(),D)await G(D);return L}async function $(Y,V){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");let W=await s.selectFrom("payment_methods").where("id","=",V).selectAll().executeTakeFirst();if(!W?.provider_id)throw Error(`Payment method with id ${V} not found`);let D=await H.paymentMethods.retrieve(String(W.provider_id));if(D.customer!==Y.stripe_id)await H.paymentMethods.attach(D.id,{customer:Y.stripe_id});if(!Y.stripe_id)throw Error("User has no Stripe ID");let L=await H.customers.update(Y.stripe_id,{invoice_settings:{default_payment_method:String(W.provider_id)}});return await s.updateTable("payment_methods").set({is_default:!1}).where("user_id","=",Y.id).executeTakeFirst(),await s.updateTable("payment_methods").set({is_default:!0}).where("id","=",V).executeTakeFirst(),L}async function Q(Y,V){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");if(!V.card?.brand||!V.card?.exp_year||!V.card?.exp_month)throw Error("Invalid payment method: missing required card details");let W={type:"card",last_four:String(V.card.last4),brand:V.card.brand,exp_year:V.card.exp_year,exp_month:V.card.exp_month,user_id:Y.id,provider_id:V.id};if(V.customer!==Y.stripe_id)await H.paymentMethods.attach(V.id,{customer:Y.stripe_id});return await PZ.create(W)}async function G(Y){return await Y.update({is_default:!0})}async function z(Y,V){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");let W=typeof V==="string"?await s.selectFrom("payment_methods").where("provider_id","=",V).selectAll().executeTakeFirst():await PZ.find(V);if(!W?.provider_id)throw Error(`Payment method with id ${V} not found`);if((await H.paymentMethods.retrieve(String(W.provider_id))).customer!==Y.stripe_id)throw Error("Payment method does not belong to this customer");return await W.delete(),await H.paymentMethods.detach(String(W.provider_id))}async function w(Y,V,W){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");if((await H.paymentMethods.retrieve(V)).customer!==Y.stripe_id)throw Error("Payment method does not belong to this customer");return await H.paymentMethods.update(V,W)}async function X(Y){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");return await s.selectFrom("payment_methods").selectAll().where("user_id","=",Y.id).execute()}async function K(Y,V){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");return await s.selectFrom("payment_methods").where("id","=",V).selectAll().executeTakeFirst()}async function T(Y){if(!Y.hasStripeId())throw Error("Customer does not exist in Stripe");return await PZ.where("user_id",Y.id).where("is_default",!0).first()}return{addPaymentMethod:J,deletePaymentMethod:z,retrieveDefaultPaymentMethod:T,updatePaymentMethod:w,listPaymentMethods:X,setDefaultPaymentMethod:$,storePaymentMethod:Q,retrievePaymentMethod:K,setUserDefaultPayment:Z}})();var tJ=(()=>{async function J($){let Q=await H.prices.list({lookup_keys:[$]});if(!Q.data.length)return;return Q.data[0]}async function Z($,Q){let G=await J($);if(G)return G;return await H.prices.create({...Q,lookup_key:$})}return{retrieveByLookupKey:J,createOrGet:Z}})();var R0=(()=>{async function J(X){return await H.products.create(X)}async function Z(X){return await H.products.retrieve(X)}async function $(X,K){return await H.products.update(X,K)}async function Q(X={}){return await H.products.list({active:!0,...X})}async function G(X){return await H.products.update(X,{active:!1})}async function z(X,K){let T=await H.products.create(X),Y=await H.prices.create({...K,product:T.id});return{product:T,price:Y}}async function w(X,K={query:""}){return await H.products.search({...K,query:X})}return{create:J,retrieve:Z,update:$,list:Q,archive:G,createWithPrice:z,search:w}})(),PX=(()=>{async function J(X){return await H.prices.create(X)}async function Z(X){return await H.prices.retrieve(X)}async function $(X,K){return await H.prices.update(X,K)}async function Q(X={}){return await H.prices.list({active:!0,...X})}async function G(X,K={}){return await H.prices.list({product:X,active:!0,...K})}async function z(X,K={query:""}){return await H.prices.search({...K,query:X})}async function w(X){return await H.prices.update(X,{active:!1})}return{create:J,retrieve:Z,update:$,list:Q,listByProduct:G,search:z,archive:w}})(),eJ=(()=>{async function J(X){return await H.coupons.create(X)}async function Z(X){return await H.coupons.retrieve(X)}async function $(X,K){return await H.coupons.update(X,K)}async function Q(X){return await H.coupons.del(X)}async function G(X={}){return await H.coupons.list(X)}async function z(X){return await H.promotionCodes.create(X)}async function w(X){try{let K=await H.promotionCodes.list({code:X,active:!0});if(K.data.length>0)return K.data[0]??null;return null}catch{return null}}return{create:J,retrieve:Z,update:$,delete:Q,list:G,createPromotionCode:z,retrievePromotionCode:w}})();import{db as zJ}from"@stacksjs/database";import{HttpError as bV}from"@stacksjs/error-handling";import{isUniqueViolation as vV}from"@stacksjs/orm";var qJ=(()=>{async function J(W,D,L,N){let q=await tJ.retrieveByLookupKey(L);if(!q)throw Error("Price does not exist in Stripe");let O=[{price:q.id,quantity:1}],I={...{customer:await d.createOrGetStripeUser(W,{}).then((y)=>{if(!y||!y.id)throw Error("Customer does not exist in Stripe");return y.id}),payment_behavior:"allow_incomplete",expand:["latest_invoice.payment_intent"],items:O},...N},f=await H.subscriptions.create(I,{idempotencyKey:c("subscription.create",W.id,D,L)});return await T(W,D,L,f),f}async function Z(W,D,L,N={}){let q=await tJ.retrieveByLookupKey(L),O=await W?.activeSubscription();if(!q)throw Error("New price does not exist in Stripe");if(!O)throw Error("No active subscription for user!");let k=O.subscription?.provider_id;if(!k)throw Error("Active subscription has no provider ID");let b=await H.subscriptions.retrieve(k);if(!b)throw Error("Subscription does not exist in Stripe");let I=b.items.data[0]?.id;if(!I)throw Error("No subscription items found in the subscription");await H.subscriptions.update(k,{items:[{id:I,price:q.id,quantity:1}],proration_behavior:"create_prorations"},{idempotencyKey:c("subscription.update",k,q.id)});let f=await H.subscriptions.retrieve(k);if(!O.subscription?.id)throw Error("Active subscription has no database ID");return await Y(O.subscription.id,D,f),f}async function $(W,D){if(!await H.subscriptions.retrieve(W))throw Error("Subscription does not exist or does not belong to the user");let N=await H.subscriptions.cancel(W,D,{idempotencyKey:c("subscription.cancel",W)});return await G(W),N}async function Q(W,D){if(!W.hasStripeId())throw Error("Customer does not exist in Stripe");return await H.subscriptions.retrieve(D)}async function G(W){await zJ.updateTable("subscriptions").set({provider_status:"canceled"}).where("provider_id","=",W).executeTakeFirst()}function z(W){return W.provider_status==="active"}function w(W){return W.provider_status==="trialing"}async function X(W,D){let L=await zJ.selectFrom("subscriptions").where("user_id","=",W.id).where("type","=",D).selectAll().executeTakeFirst();if(!L)return!1;return L.provider_status==="incomplete"}async function K(W,D){let L=await zJ.selectFrom("subscriptions").where("user_id","=",W.id).where("type","=",D).selectAll().executeTakeFirst();if(!L)return!1;let N=await z(L),q=await w(L);return N||q}async function T(W,D,L,N){let q=N.items.data[0];if(!q)throw Error("Stripe subscription contains no line items \u2014 cannot store subscription");let O=V({user_id:W.id,type:D,unit_price:Number(q.price.unit_amount),provider_id:N.id,provider_status:N.status,provider_price_id:q.price.id,quantity:q.quantity,trial_ends_at:N.trial_end!=null?String(N.trial_end):void 0,ends_at:N.current_period_end!=null?String(N.current_period_end):void 0,provider_type:"stripe",last_used_at:N.current_period_end!=null?String(N.current_period_end):void 0}),k;try{k=await zJ.insertInto("subscriptions").values(O).executeTakeFirst()}catch(I){if(vV(I))throw new bV(409,"A subscription with this provider ID already exists");throw I}if(!k)throw Error("Failed to insert subscription record");return await zJ.selectFrom("subscriptions").where("id","=",Number(k.insertId)).selectAll().executeTakeFirst()}async function Y(W,D,L){let N=await zJ.selectFrom("subscriptions").where("id","=",W).selectAll().executeTakeFirst(),q=L.items.data[0];if(!q)throw Error("Stripe subscription contains no line items \u2014 cannot update subscription");return await zJ?.updateTable("subscriptions").set({type:D,provider_price_id:q.price.id,unit_price:Number(q.price.unit_amount)}).where("id","=",W).executeTakeFirst(),N}function V(W){return Object.fromEntries(Object.entries(W).filter(([D,L])=>L!=null))}return{create:J,update:Z,isValid:K,isIncomplete:X,cancel:$,retrieve:Q}})();var IX=(()=>{async function J(Z,$){let z={...{customer:await d.createOrGetStripeUser(Z,{}).then((w)=>{if(!w||!w.id)throw Error("Customer does not exist in Stripe");return w.id}),payment_method_types:["card"]},...$};return await H.setupIntents.create(z,{idempotencyKey:GJ("setup_intent.create",Z.id)})}return{create:J}})();var IZ=new Map;function x(J,Z){let $=IZ.get(J)||[];$.push(Z),IZ.set(J,$)}function xV(J){for(let[Z,$]of Object.entries(J))x(Z,$)}function PV(J,Z,$,Q){if(Q!=null&&Number.isFinite(Q)&&Q>0)return H.webhooks.constructEvent(J,Z,$,Q);return H.webhooks.constructEvent(J,Z,$)}async function fX(J,Z,$,Q){if(Q!=null&&Number.isFinite(Q)&&Q>0)return await H.webhooks.constructEventAsync(J,Z,$,Q);return await H.webhooks.constructEventAsync(J,Z,$)}async function yX(J){let Z=IZ.get(J.type)||[];if(Z.length===0)return{handled:!1,eventType:J.type};let $=[];for(let Q of Z)try{await Q(J)}catch(G){$.push(G instanceof Error?G.message:String(G))}return{handled:!0,eventType:J.type,...$.length>0?{errors:$}:{}}}async function fZ(J,Z,$){try{let Q=await fX(J,Z,$.secret,$.tolerance),G=await yX(Q);if(G.errors&&G.errors.length>0)return{success:!1,eventType:G.eventType,error:G.errors.join("; ")};return{success:!0,eventType:G.eventType}}catch(Q){return{success:!1,error:Q instanceof Error?Q.message:"Unknown error"}}}function yZ(J){if(J.succeeded)x("payment_intent.succeeded",J.succeeded);if(J.failed)x("payment_intent.payment_failed",J.failed);if(J.created)x("payment_intent.created",J.created);if(J.canceled)x("payment_intent.canceled",J.canceled)}function gZ(J){if(J.created)x("customer.subscription.created",J.created);if(J.updated)x("customer.subscription.updated",J.updated);if(J.deleted)x("customer.subscription.deleted",J.deleted);if(J.trialWillEnd)x("customer.subscription.trial_will_end",J.trialWillEnd)}function RZ(J){if(J.paid)x("invoice.paid",J.paid);if(J.paymentFailed)x("invoice.payment_failed",J.paymentFailed);if(J.created)x("invoice.created",J.created);if(J.finalized)x("invoice.finalized",J.finalized)}function SZ(J){if(J.completed)x("checkout.session.completed",J.completed);if(J.expired)x("checkout.session.expired",J.expired)}function MZ(J){if(J.succeeded)x("charge.succeeded",J.succeeded);if(J.failed)x("charge.failed",J.failed);if(J.refunded)x("charge.refunded",J.refunded);if(J.disputed)x("charge.dispute.created",J.disputed)}function IV(J){if(J.type.startsWith("payment_intent."))return J.data.object;return null}function fV(J){if(J.type.startsWith("customer.subscription."))return J.data.object;return null}function yV(J){if(J.type.startsWith("invoice."))return J.data.object;return null}function gV(J){if(J.type.startsWith("checkout.session."))return J.data.object;return null}function RV(J){if(J.type.startsWith("charge."))return J.data.object;return null}function SV(J){if(J.type.startsWith("customer.")&&!J.type.includes("subscription"))return J.data.object;return null}var gX={onWebhookEvent:x,registerWebhookHandlers:xV,constructEvent:PV,constructEventAsync:fX,handleWebhookEvent:yX,processWebhook:fZ,onPaymentIntent:yZ,onSubscription:gZ,onInvoice:RZ,onCheckout:SZ,onCharge:MZ,getPaymentIntent:IV,getSubscription:fV,getInvoice:yV,getCheckoutSession:gV,getCharge:RV,getCustomer:SV};async function MV(J,Z,$,Q={}){return g0.charge(J,Z,$,Q)}async function jV(J,Z,$={}){return g0.createPayment(J,Z,$)}async function _V(J,Z,$={}){return g0.refund(J,{amount:Z,...$})}async function mV(J,Z,$={}){return vZ.create(J,{line_items:Z,mode:"payment",...$})}async function hV(J,Z,$={}){return vZ.create(J,{line_items:[{price:Z,quantity:1}],mode:"subscription",...$})}async function lV(J,Z,$={}){return qJ.create(J,"default",Z,$)}async function uV(J,Z=!1){return qJ.cancel(J,{prorate:!Z,invoice_now:Z})}async function cV(J,Z="default"){return qJ.isValid(J,Z)}async function dV(J,Z,$="default"){return qJ.update(J,$,Z,{})}async function nV(J,Z={}){return d.createOrGetStripeUser(J,Z)}async function aV(J,Z){return d.updateStripeCustomer(J,Z)}async function iV(J){return d.deleteStripeUser(J)}async function pV(J,Z){return rJ.addPaymentMethod(J,Z)}async function oV(J,Z){return rJ.setUserDefaultPayment(J,Z)}async function sV(J,Z){return rJ.deletePaymentMethod(J,Z)}async function rV(J,Z={}){return IX.create(J,Z)}async function tV(J){return xZ.list(J)}async function eV(J,Z={}){return H.invoices.create({customer:J,...Z})}async function JW(J){return H.invoices.pay(J)}async function ZW(J,Z,$={}){let{currency:Q="usd",interval:G,description:z,metadata:w}=$,X={unit_amount:Z,currency:Q};if(G)X.recurring={interval:G};return R0.createWithPrice({name:J,description:z,metadata:w},X)}async function $W(J){return tJ.retrieveByLookupKey(J)}async function QW(J={}){return R0.list(J)}async function GW(J){let Z={duration:J.duration||"once"};if(J.percentOff)Z.percent_off=J.percentOff;else if(J.amountOff)Z.amount_off=J.amountOff,Z.currency=J.currency||"usd";if(J.name)Z.name=J.name;if(J.durationInMonths)Z.duration_in_months=J.durationInMonths;if(J.maxRedemptions)Z.max_redemptions=J.maxRedemptions;return eJ.create(Z)}async function zW(J,Z,$={}){return eJ.createPromotionCode({promotion:{type:"coupon",coupon:J},code:Z,...$})}async function BW(J){return eJ.retrievePromotionCode(J)}function XW(J,Z){let $=globalThis.config||{},Q=(Z||$.payment?.currency||$.billing?.currency||process.env.STRIPE_CURRENCY||"usd").toLowerCase(),G=$.app?.locale||"en-US";return new Intl.NumberFormat(G,{style:"currency",currency:Q.toUpperCase()}).format(J/100)}function YW(J){return Math.round(J*100)}function wW(J){return J/100}var UW={charge:MV,createPayment:jV,refund:_V,checkout:mV,subscriptionCheckout:hV,subscribe:lV,cancelSubscription:uV,hasActiveSubscription:cV,changeSubscription:dV,getOrCreateCustomer:nV,updateCustomer:aV,deleteCustomer:iV,addPaymentMethod:pV,setDefaultPaymentMethod:oV,removePaymentMethod:sV,createSetupIntent:rV,getInvoices:tV,createInvoice:eV,payInvoice:JW,createProduct:ZW,getPrice:$W,listProducts:QW,createCoupon:GW,createPromoCode:zW,validatePromoCode:BW,formatAmount:XW,toCents:YW,toDollars:wW,webhook:gX,onPaymentIntent:yZ,onSubscription:gZ,onInvoice:RZ,onCheckout:SZ,onCharge:MZ,processWebhook:fZ,stripe:H,customer:d,subscription:qJ,invoice:xZ,paymentMethod:rJ,product:R0,price:PX,coupon:eJ},LW=UW;import{saas as VW}from"@stacksjs/config";import{err as WW,ok as KW}from"@stacksjs/error-handling";import{log as TW}from"@stacksjs/logging";import{stripe as RX}from"@stacksjs/payments";async function HD(){let J=VW.plans;try{if(J!==void 0&&J.length)for(let Z of J){let $=await RX.products.create({name:Z.productName,description:Z.description,metadata:Z.metadata});for(let Q of Z.pricing)if($){let G={unit_amount:Q.price,currency:Q.currency,product:$.id,lookup_key:Q.key};if(Q.interval)G.recurring={interval:Q.interval};await RX.prices.create(G)}}return KW("Migrations generated")}catch(Z){let $=Z instanceof Error?Z:Error(String(Z));return TW.error($),WW($)}}import{db as S0}from"@stacksjs/database";var ED=(()=>{async function J($,Q,G){let z=await S0.selectFrom("payment_products").where("id","=",Q).selectAll().executeTakeFirst();if(!z)throw Error(`Payment product with id ${Q} not found.`);let w={name:z.name,description:G.description??"",amount:z.unit_price,brand:G.brand,type:G.type??"one-time",provider_id:G.provider_id,user_id:$.id},X=await S0.insertInto("payment_transactions").values(w).executeTakeFirst();if(!X)throw Error("Failed to insert payment transaction");return await S0.selectFrom("payment_transactions").where("id","=",Number(X.insertId)).selectAll().executeTakeFirst()}async function Z($){return await S0.selectFrom("payment_transactions").where("user_id","=",$.id).selectAll().execute()}return{store:J,list:Z}})();var hD=_Z(FZ(),1);export{BW as validatePromoCode,aV as updateCustomer,wW as toDollars,YW as toCents,hV as subscriptionCheckout,lV as subscribe,H as stripe,c as stacksIdempotencyKey,oV as setDefaultPaymentMethod,sV as removePaymentMethod,xV as registerWebhookHandlers,_V as refund,fZ as processWebhook,JW as payInvoice,x as onWebhookEvent,gZ as onSubscription,yZ as onPaymentIntent,RZ as onInvoice,SZ as onCheckout,MZ as onCharge,gX as manageWebhook,ED as manageTransaction,qJ as manageSubscription,IX as manageSetupIntent,R0 as manageProduct,PX as managePriceExtended,tJ as managePrice,rJ as managePaymentMethod,xZ as manageInvoice,d as manageCustomer,eJ as manageCoupon,vZ as manageCheckout,g0 as manageCharge,QW as listProducts,cV as hasActiveSubscription,yX as handleWebhookEvent,fV as getSubscription,$W as getPrice,IV as getPaymentIntent,nV as getOrCreateCustomer,tV as getInvoices,yV as getInvoice,SV as getCustomer,gV as getCheckoutSession,RV as getCharge,GJ as freshIdempotencyKey,XW as formatAmount,iV as deleteCustomer,HD as createStripeProduct,rV as createSetupIntent,zW as createPromoCode,ZW as createProduct,jV as createPayment,eV as createInvoice,GW as createCoupon,fX as constructEventAsync,PV as constructEvent,mV as checkout,MV as charge,dV as changeSubscription,uV as cancelSubscription,pV as addPaymentMethod,hD as Stripe,LW as Payment};
2
+ import{createRequire as $x}from"module";import{services as r}from"@stacksjs/config";var zx=$x(import.meta.url);function Gx(){try{return zx("stripe")}catch{throw Error("Stripe payments are being used but the `stripe` package is not installed. "+"It is an opt-in dependency \u2014 run `bun add stripe` to enable server-side Stripe payments.")}}var I=null,_=new Proxy({},{get(x,T){if(!I){let w=r?.stripe?.secretKey;if(!w)throw Error("Stripe secret key is not configured. Set STRIPE_SECRET_KEY in your .env file.");let B="2026-03-25.dahlia",$=r?.stripe?.apiVersion;if($&&$!==B)throw Error(`Stripe API version ${$} does not match the installed SDK version ${B}`);I=new(Gx())(w,{apiVersion:B})}return I[T]}});import{config as Qx}from"@stacksjs/config";import{log as Zx}from"@stacksjs/logging";import{createHash as s}from"crypto";var y="stacks",l="v1",Jx=255;function U(x,...T){let w=T.filter((Q)=>Q!==null&&Q!==void 0&&Q!=="").map((Q)=>String(Q)).join(":"),B=w?`${y}:${x}:${w}:${l}`:`${y}:${x}:${l}`;if(B.length<=Jx)return B;let $=s("sha256").update(w).digest("hex").slice(0,32);return`${y}:${x}:${$}:${l}`}function j(x,...T){let w=s("sha256").update(`${Date.now()}:${Math.random()}`).digest("hex").slice(0,16);return U(x,...T,w)}function t(){let x=Qx||{};return(x.payment?.currency||x.billing?.currency||process.env.STRIPE_CURRENCY||"usd").toLowerCase()}var M=(()=>{async function x($,Q,X){let z={currency:t(),amount:Q};if($.hasStripeId())z.customer=$.stripe_id??void 0;let H={...z,...X};return await _.paymentIntents.create(H,{idempotencyKey:j("payment_intent.create",$.id,Q)})}async function T($){try{return await _.paymentIntents.retrieve($)}catch(Q){return Zx.error(Q),null}}async function w($,Q={}){if(!$||typeof $!=="string")throw Error("[payments/refund] paymentIntentId is required");if(Q.amount!=null){if(typeof Q.amount!=="number"||!Number.isFinite(Q.amount)||Q.amount<=0)throw Error("[payments/refund] amount must be a positive finite number");try{let J=await _.paymentIntents.retrieve($),L=J.amount_received??J.amount;if(L&&Q.amount>L)throw Error(`[payments/refund] amount ${Q.amount} exceeds captured amount ${L}`)}catch(J){if(J instanceof Error&&J.message.startsWith("[payments/refund]"))throw J}}let{idempotencyKey:X,...z}=Q,H={payment_intent:$,...z},N={idempotencyKey:X||`refund:${$}:${z.amount??"full"}`};return await _.refunds.create(H,N)}async function B($,Q,X,z){let N={...{confirmation_method:"automatic",confirm:!0,payment_method:X,currency:t(),amount:Q},...z};return await x($,Q,N)}return{createPayment:x,charge:B,findPayment:T,refund:w}})();import{config as Lx}from"@stacksjs/config";function e(x,T){if(!x)return;let w;try{w=new URL(x)}catch{throw Error(`[payments/checkout] ${T} is not a valid URL: ${x}`)}let B=Lx?.app?.url;if(!B)return;let $;try{$=new URL(B.startsWith("http")?B:`https://${B}`).origin}catch{return}if(w.origin!==$)throw Error(`[payments/checkout] ${T} origin (${w.origin}) does not match app origin (${$})`)}var h=(()=>{async function x(T,w){let B=w.customer||T.stripe_id;if(!B)throw Error("User has no Stripe customer");e(w.success_url,"success_url"),e(w.cancel_url,"cancel_url");let Q={...{customer:B,mode:"payment",success_url:w.success_url,cancel_url:w.cancel_url},...w};return await _.checkout.sessions.create(Q,{idempotencyKey:j("checkout.session.create",T.id)})}return{create:x}})();var D=(()=>{function x(F){return F.stripe_id||""}function T(F){return{line1:F.address?.line1,city:F.address?.city,state:F.address?.state,postal_code:F.address?.postal_code,country:F.address?.country}}function w(){return[]}function B(F){return F}function $(F){return Boolean(F.stripe_id)}async function Q(F,Z={}){if($(F))throw Error("Customer already created");if(!Z.name&&G(F))Z.name=G(F);if(!Z.email&&R(F))Z.email=R(F);let A=await _.customers.create(Z,{idempotencyKey:U("customer.create",F.id)});return await F.update({stripe_id:A.id}),A}async function X(F,Z={}){if(!F.stripe_id)throw Error("User does not have a Stripe customer ID. Create a customer first.");return await _.customers.update(F.stripe_id,Z,{idempotencyKey:U("customer.update",F.id,F.stripe_id)})}async function z(F){if(!$(F))throw Error("User does not have a Stripe ID");try{if(!F.stripe_id)throw Error("User has no Stripe ID");let Z=await _.customers.del(F.stripe_id);return await F.update({stripe_id:""}),Z}catch(Z){if(Z.statusCode===404)throw Error("Customer not found in Stripe");throw Z}}async function H(F,Z={}){if(!$(F))return await Q(F,Z);try{let A=await _.customers.retrieve(F.stripe_id);if(A.deleted)throw Error("Customer was deleted");return A}catch(A){if(A.statusCode===404)return await Q(F,Z);throw A}}async function N(F){if(!$(F))return;try{let Z=await _.customers.retrieve(F.stripe_id);if(Z.deleted)throw Error("Customer was deleted in Stripe");return Z}catch(Z){if(Z.statusCode===404)throw Error("Customer not found in Stripe");throw Z}}async function J(F,Z){if(!$(F))return await Q(F,Z);try{if((await _.customers.retrieve(F.stripe_id)).deleted)return await Q(F,Z);return await X(F,Z)}catch(A){if(A.statusCode===404)return await Q(F,Z);throw A}}async function L(F,Z){return await X(F,{name:G(F),email:R(F),address:T(Z),preferred_locales:w(),metadata:Z.metadata?B(Z.metadata):{}})}function G(F){return F.name||""}function R(F){return F.email||""}return{stripeId:x,hasStripeId:$,createStripeCustomer:Q,updateStripeCustomer:X,createOrGetStripeUser:H,createOrUpdateStripeUser:J,deleteStripeUser:z,retrieveStripeUser:N,syncStripeCustomerDetails:L}})();var c=(()=>{async function x(T){if(!T.hasStripeId())throw Error("Customer does not exist in Stripe");if(!T.stripe_id)throw Error("User has no Stripe ID");return await _.invoices.list({customer:T.stripe_id,expand:["data.payment_intent.payment_method"]})}return{list:x}})();import{db as V}from"@stacksjs/database";import{PaymentMethod as m}from"@stacksjs/orm";var P=(()=>{async function x(J,L){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");let G;if(typeof L==="string")G=await _.paymentMethods.retrieve(L);else G=L;if(G.customer!==J.stripe_id)G=await _.paymentMethods.attach(G.id,{customer:J.stripe_id});return await B(J,G),G}async function T(J,L){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");let G=await _.paymentMethods.retrieve(L),R=await V.selectFrom("payment_methods").where("provider_id","=",L).selectAll().executeTakeFirst();if(!J.stripe_id)throw Error("User has no Stripe ID");if(G.customer!==J.stripe_id)await _.paymentMethods.attach(G.id,{customer:J.stripe_id});let F=await _.customers.update(J.stripe_id,{invoice_settings:{default_payment_method:L}});if(await V.updateTable("payment_methods").set({is_default:!1}).where("user_id","=",J.id).executeTakeFirst(),R)await $(R);return F}async function w(J,L){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");let G=await V.selectFrom("payment_methods").where("id","=",L).selectAll().executeTakeFirst();if(!G?.provider_id)throw Error(`Payment method with id ${L} not found`);let R=await _.paymentMethods.retrieve(String(G.provider_id));if(R.customer!==J.stripe_id)await _.paymentMethods.attach(R.id,{customer:J.stripe_id});if(!J.stripe_id)throw Error("User has no Stripe ID");let F=await _.customers.update(J.stripe_id,{invoice_settings:{default_payment_method:String(G.provider_id)}});return await V.updateTable("payment_methods").set({is_default:!1}).where("user_id","=",J.id).executeTakeFirst(),await V.updateTable("payment_methods").set({is_default:!0}).where("id","=",L).executeTakeFirst(),F}async function B(J,L){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");if(!L.card?.brand||!L.card?.exp_year||!L.card?.exp_month)throw Error("Invalid payment method: missing required card details");let G={type:"card",last_four:String(L.card.last4),brand:L.card.brand,exp_year:L.card.exp_year,exp_month:L.card.exp_month,user_id:J.id,provider_id:L.id};if(L.customer!==J.stripe_id)await _.paymentMethods.attach(L.id,{customer:J.stripe_id});return await m.create(G)}async function $(J){return await J.update({is_default:!0})}async function Q(J,L){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");let G=typeof L==="string"?await V.selectFrom("payment_methods").where("provider_id","=",L).selectAll().executeTakeFirst():await m.find(L);if(!G?.provider_id)throw Error(`Payment method with id ${L} not found`);if((await _.paymentMethods.retrieve(String(G.provider_id))).customer!==J.stripe_id)throw Error("Payment method does not belong to this customer");return await G.delete(),await _.paymentMethods.detach(String(G.provider_id))}async function X(J,L,G){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");if((await _.paymentMethods.retrieve(L)).customer!==J.stripe_id)throw Error("Payment method does not belong to this customer");return await _.paymentMethods.update(L,G)}async function z(J){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");return await V.selectFrom("payment_methods").selectAll().where("user_id","=",J.id).execute()}async function H(J,L){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");return await V.selectFrom("payment_methods").where("id","=",L).selectAll().executeTakeFirst()}async function N(J){if(!J.hasStripeId())throw Error("Customer does not exist in Stripe");return await m.where("user_id",J.id).where("is_default",!0).first()}return{addPaymentMethod:x,deletePaymentMethod:Q,retrieveDefaultPaymentMethod:N,updatePaymentMethod:X,listPaymentMethods:z,setDefaultPaymentMethod:w,storePaymentMethod:B,retrievePaymentMethod:H,setUserDefaultPayment:T}})();var S=(()=>{async function x(w){let B=await _.prices.list({lookup_keys:[w]});if(!B.data.length)return;return B.data[0]}async function T(w,B){let $=await x(w);if($)return $;return await _.prices.create({...B,lookup_key:w})}return{retrieveByLookupKey:x,createOrGet:T}})();var v=(()=>{async function x(z){return await _.products.create(z)}async function T(z){return await _.products.retrieve(z)}async function w(z,H){return await _.products.update(z,H)}async function B(z={}){return await _.products.list({active:!0,...z})}async function $(z){return await _.products.update(z,{active:!1})}async function Q(z,H){let N=await _.products.create(z),J=await _.prices.create({...H,product:N.id});return{product:N,price:J}}async function X(z,H={query:""}){return await _.products.search({...H,query:z})}return{create:x,retrieve:T,update:w,list:B,archive:$,createWithPrice:Q,search:X}})(),xx=(()=>{async function x(z){return await _.prices.create(z)}async function T(z){return await _.prices.retrieve(z)}async function w(z,H){return await _.prices.update(z,H)}async function B(z={}){return await _.prices.list({active:!0,...z})}async function $(z,H={}){return await _.prices.list({product:z,active:!0,...H})}async function Q(z,H={query:""}){return await _.prices.search({...H,query:z})}async function X(z){return await _.prices.update(z,{active:!1})}return{create:x,retrieve:T,update:w,list:B,listByProduct:$,search:Q,archive:X}})(),C=(()=>{async function x(z){return await _.coupons.create(z)}async function T(z){return await _.coupons.retrieve(z)}async function w(z,H){return await _.coupons.update(z,H)}async function B(z){return await _.coupons.del(z)}async function $(z={}){return await _.coupons.list(z)}async function Q(z){return await _.promotionCodes.create(z)}async function X(z){try{let H=await _.promotionCodes.list({code:z,active:!0});if(H.data.length>0)return H.data[0]??null;return null}catch{return null}}return{create:x,retrieve:T,update:w,delete:B,list:$,createPromotionCode:Q,retrievePromotionCode:X}})();import{db as W}from"@stacksjs/database";import{HttpError as Ax}from"@stacksjs/error-handling";import{isUniqueViolation as Rx}from"@stacksjs/orm";var K=(()=>{async function x(G,R,F,Z){let A=await S.retrieveByLookupKey(F);if(!A)throw Error("Price does not exist in Stripe");let O=[{price:A.id,quantity:1}],f={...{customer:await D.createOrGetStripeUser(G,{}).then((b)=>{if(!b||!b.id)throw Error("Customer does not exist in Stripe");return b.id}),payment_behavior:"allow_incomplete",expand:["latest_invoice.payment_intent"],items:O},...Z},E=await _.subscriptions.create(f,{idempotencyKey:U("subscription.create",G.id,R,F)});return await N(G,R,F,E),E}async function T(G,R,F,Z={}){let A=await S.retrieveByLookupKey(F),O=await G?.activeSubscription();if(!A)throw Error("New price does not exist in Stripe");if(!O)throw Error("No active subscription for user!");let q=O.subscription?.provider_id;if(!q)throw Error("Active subscription has no provider ID");let k=await _.subscriptions.retrieve(q);if(!k)throw Error("Subscription does not exist in Stripe");let f=k.items.data[0]?.id;if(!f)throw Error("No subscription items found in the subscription");await _.subscriptions.update(q,{items:[{id:f,price:A.id,quantity:1}],proration_behavior:"create_prorations"},{idempotencyKey:U("subscription.update",q,A.id)});let E=await _.subscriptions.retrieve(q);if(!O.subscription?.id)throw Error("Active subscription has no database ID");return await J(O.subscription.id,R,E),E}async function w(G,R){if(!await _.subscriptions.retrieve(G))throw Error("Subscription does not exist or does not belong to the user");let Z=await _.subscriptions.cancel(G,R,{idempotencyKey:U("subscription.cancel",G)});return await $(G),Z}async function B(G,R){if(!G.hasStripeId())throw Error("Customer does not exist in Stripe");return await _.subscriptions.retrieve(R)}async function $(G){await W.updateTable("subscriptions").set({provider_status:"canceled"}).where("provider_id","=",G).executeTakeFirst()}function Q(G){return G.provider_status==="active"}function X(G){return G.provider_status==="trialing"}async function z(G,R){let F=await W.selectFrom("subscriptions").where("user_id","=",G.id).where("type","=",R).selectAll().executeTakeFirst();if(!F)return!1;return F.provider_status==="incomplete"}async function H(G,R){let F=await W.selectFrom("subscriptions").where("user_id","=",G.id).where("type","=",R).selectAll().executeTakeFirst();if(!F)return!1;let Z=await Q(F),A=await X(F);return Z||A}async function N(G,R,F,Z){let A=Z.items.data[0];if(!A)throw Error("Stripe subscription contains no line items \u2014 cannot store subscription");let O=L({user_id:G.id,type:R,unit_price:Number(A.price.unit_amount),provider_id:Z.id,provider_status:Z.status,provider_price_id:A.price.id,quantity:A.quantity,trial_ends_at:Z.trial_end!=null?String(Z.trial_end):void 0,ends_at:Z.current_period_end!=null?String(Z.current_period_end):void 0,provider_type:"stripe",last_used_at:Z.current_period_end!=null?String(Z.current_period_end):void 0}),q;try{q=await W.insertInto("subscriptions").values(O).executeTakeFirst()}catch(f){if(Rx(f))throw new Ax(409,"A subscription with this provider ID already exists");throw f}if(!q)throw Error("Failed to insert subscription record");return await W.selectFrom("subscriptions").where("id","=",Number(q.insertId)).selectAll().executeTakeFirst()}async function J(G,R,F){let Z=await W.selectFrom("subscriptions").where("id","=",G).selectAll().executeTakeFirst(),A=F.items.data[0];if(!A)throw Error("Stripe subscription contains no line items \u2014 cannot update subscription");return await W?.updateTable("subscriptions").set({type:R,provider_price_id:A.price.id,unit_price:Number(A.price.unit_amount)}).where("id","=",G).executeTakeFirst(),Z}function L(G){return Object.fromEntries(Object.entries(G).filter(([R,F])=>F!=null))}return{create:x,update:T,isValid:H,isIncomplete:z,cancel:w,retrieve:B}})();var Tx=(()=>{async function x(T,w){let Q={...{customer:await D.createOrGetStripeUser(T,{}).then((X)=>{if(!X||!X.id)throw Error("Customer does not exist in Stripe");return X.id}),payment_method_types:["card"]},...w};return await _.setupIntents.create(Q,{idempotencyKey:j("setup_intent.create",T.id)})}return{create:x}})();var u=new Map;function Y(x,T){let w=u.get(x)||[];w.push(T),u.set(x,w)}function Hx(x){for(let[T,w]of Object.entries(x))Y(T,w)}function Xx(x,T,w,B){if(B!=null&&Number.isFinite(B)&&B>0)return _.webhooks.constructEvent(x,T,w,B);return _.webhooks.constructEvent(x,T,w)}async function wx(x,T,w,B){if(B!=null&&Number.isFinite(B)&&B>0)return await _.webhooks.constructEventAsync(x,T,w,B);return await _.webhooks.constructEventAsync(x,T,w)}async function _x(x){let T=u.get(x.type)||[];if(T.length===0)return{handled:!1,eventType:x.type};let w=[];for(let B of T)try{await B(x)}catch($){w.push($ instanceof Error?$.message:String($))}return{handled:!0,eventType:x.type,...w.length>0?{errors:w}:{}}}async function d(x,T,w){try{let B=await wx(x,T,w.secret,w.tolerance),$=await _x(B);if($.errors&&$.errors.length>0)return{success:!1,eventType:$.eventType,error:$.errors.join("; ")};return{success:!0,eventType:$.eventType}}catch(B){return{success:!1,error:B instanceof Error?B.message:"Unknown error"}}}function i(x){if(x.succeeded)Y("payment_intent.succeeded",x.succeeded);if(x.failed)Y("payment_intent.payment_failed",x.failed);if(x.created)Y("payment_intent.created",x.created);if(x.canceled)Y("payment_intent.canceled",x.canceled)}function p(x){if(x.created)Y("customer.subscription.created",x.created);if(x.updated)Y("customer.subscription.updated",x.updated);if(x.deleted)Y("customer.subscription.deleted",x.deleted);if(x.trialWillEnd)Y("customer.subscription.trial_will_end",x.trialWillEnd)}function a(x){if(x.paid)Y("invoice.paid",x.paid);if(x.paymentFailed)Y("invoice.payment_failed",x.paymentFailed);if(x.created)Y("invoice.created",x.created);if(x.finalized)Y("invoice.finalized",x.finalized)}function n(x){if(x.completed)Y("checkout.session.completed",x.completed);if(x.expired)Y("checkout.session.expired",x.expired)}function o(x){if(x.succeeded)Y("charge.succeeded",x.succeeded);if(x.failed)Y("charge.failed",x.failed);if(x.refunded)Y("charge.refunded",x.refunded);if(x.disputed)Y("charge.dispute.created",x.disputed)}function Yx(x){if(x.type.startsWith("payment_intent."))return x.data.object;return null}function Nx(x){if(x.type.startsWith("customer.subscription."))return x.data.object;return null}function qx(x){if(x.type.startsWith("invoice."))return x.data.object;return null}function Ux(x){if(x.type.startsWith("checkout.session."))return x.data.object;return null}function Dx(x){if(x.type.startsWith("charge."))return x.data.object;return null}function Ox(x){if(x.type.startsWith("customer.")&&!x.type.includes("subscription"))return x.data.object;return null}var Fx={onWebhookEvent:Y,registerWebhookHandlers:Hx,constructEvent:Xx,constructEventAsync:wx,handleWebhookEvent:_x,processWebhook:d,onPaymentIntent:i,onSubscription:p,onInvoice:a,onCheckout:n,onCharge:o,getPaymentIntent:Yx,getSubscription:Nx,getInvoice:qx,getCheckoutSession:Ux,getCharge:Dx,getCustomer:Ox};async function Vx(x,T,w,B={}){return M.charge(x,T,w,B)}async function fx(x,T,w={}){return M.createPayment(x,T,w)}async function jx(x,T,w={}){return M.refund(x,{amount:T,...w})}async function Wx(x,T,w={}){return h.create(x,{line_items:T,mode:"payment",...w})}async function Kx(x,T,w={}){return h.create(x,{line_items:[{price:T,quantity:1}],mode:"subscription",...w})}async function Ex(x,T,w={}){return K.create(x,"default",T,w)}async function Px(x,T=!1){return K.cancel(x,{prorate:!T,invoice_now:T})}async function Sx(x,T="default"){return K.isValid(x,T)}async function Cx(x,T,w="default"){return K.update(x,w,T,{})}async function kx(x,T={}){return D.createOrGetStripeUser(x,T)}async function Mx(x,T){return D.updateStripeCustomer(x,T)}async function vx(x){return D.deleteStripeUser(x)}async function gx(x,T){return P.addPaymentMethod(x,T)}async function bx(x,T){return P.setUserDefaultPayment(x,T)}async function Ix(x,T){return P.deletePaymentMethod(x,T)}async function yx(x,T={}){return Tx.create(x,T)}async function lx(x){return c.list(x)}async function hx(x,T={}){return _.invoices.create({customer:x,...T})}async function cx(x){return _.invoices.pay(x)}async function mx(x,T,w={}){let{currency:B="usd",interval:$,description:Q,metadata:X}=w,z={unit_amount:T,currency:B};if($)z.recurring={interval:$};return v.createWithPrice({name:x,description:Q,metadata:X},z)}async function ux(x){return S.retrieveByLookupKey(x)}async function dx(x={}){return v.list(x)}async function ix(x){let T={duration:x.duration||"once"};if(x.percentOff)T.percent_off=x.percentOff;else if(x.amountOff)T.amount_off=x.amountOff,T.currency=x.currency||"usd";if(x.name)T.name=x.name;if(x.durationInMonths)T.duration_in_months=x.durationInMonths;if(x.maxRedemptions)T.max_redemptions=x.maxRedemptions;return C.create(T)}async function px(x,T,w={}){return C.createPromotionCode({promotion:{type:"coupon",coupon:x},code:T,...w})}async function ax(x){return C.retrievePromotionCode(x)}function nx(x,T){let w=globalThis.config||{},B=(T||w.payment?.currency||w.billing?.currency||process.env.STRIPE_CURRENCY||"usd").toLowerCase(),$=w.app?.locale||"en-US";return new Intl.NumberFormat($,{style:"currency",currency:B.toUpperCase()}).format(x/100)}function ox(x){return Math.round(x*100)}function rx(x){return x/100}var sx={charge:Vx,createPayment:fx,refund:jx,checkout:Wx,subscriptionCheckout:Kx,subscribe:Ex,cancelSubscription:Px,hasActiveSubscription:Sx,changeSubscription:Cx,getOrCreateCustomer:kx,updateCustomer:Mx,deleteCustomer:vx,addPaymentMethod:gx,setDefaultPaymentMethod:bx,removePaymentMethod:Ix,createSetupIntent:yx,getInvoices:lx,createInvoice:hx,payInvoice:cx,createProduct:mx,getPrice:ux,listProducts:dx,createCoupon:ix,createPromoCode:px,validatePromoCode:ax,formatAmount:nx,toCents:ox,toDollars:rx,webhook:Fx,onPaymentIntent:i,onSubscription:p,onInvoice:a,onCheckout:n,onCharge:o,processWebhook:d,stripe:_,customer:D,subscription:K,invoice:c,paymentMethod:P,product:v,price:xx,coupon:C},tx=sx;import{saas as ex}from"@stacksjs/config";import{err as xT,ok as TT}from"@stacksjs/error-handling";import{log as wT}from"@stacksjs/logging";import{stripe as Bx}from"@stacksjs/payments";async function _w(){let x=ex.plans;try{if(x!==void 0&&x.length)for(let T of x){let w=await Bx.products.create({name:T.productName,description:T.description,metadata:T.metadata});for(let B of T.pricing)if(w){let $={unit_amount:B.price,currency:B.currency,product:w.id,lookup_key:B.key};if(B.interval)$.recurring={interval:B.interval};await Bx.prices.create($)}}return TT("Migrations generated")}catch(T){let w=T instanceof Error?T:Error(String(T));return wT.error(w),xT(w)}}import{db as g}from"@stacksjs/database";var $w=(()=>{async function x(w,B,$){let Q=await g.selectFrom("payment_products").where("id","=",B).selectAll().executeTakeFirst();if(!Q)throw Error(`Payment product with id ${B} not found.`);let X={name:Q.name,description:$.description??"",amount:Q.unit_price,brand:$.brand,type:$.type??"one-time",provider_id:$.provider_id,user_id:w.id},z=await g.insertInto("payment_transactions").values(X).executeTakeFirst();if(!z)throw Error("Failed to insert payment transaction");return await g.selectFrom("payment_transactions").where("id","=",Number(z.insertId)).selectAll().executeTakeFirst()}async function T(w){return await g.selectFrom("payment_transactions").where("user_id","=",w.id).selectAll().execute()}return{store:x,list:T}})();export{ax as validatePromoCode,Mx as updateCustomer,rx as toDollars,ox as toCents,Kx as subscriptionCheckout,Ex as subscribe,_ as stripe,U as stacksIdempotencyKey,bx as setDefaultPaymentMethod,Ix as removePaymentMethod,Hx as registerWebhookHandlers,jx as refund,d as processWebhook,cx as payInvoice,Y as onWebhookEvent,p as onSubscription,i as onPaymentIntent,a as onInvoice,n as onCheckout,o as onCharge,Fx as manageWebhook,$w as manageTransaction,K as manageSubscription,Tx as manageSetupIntent,v as manageProduct,xx as managePriceExtended,S as managePrice,P as managePaymentMethod,c as manageInvoice,D as manageCustomer,C as manageCoupon,h as manageCheckout,M as manageCharge,dx as listProducts,Sx as hasActiveSubscription,_x as handleWebhookEvent,Nx as getSubscription,ux as getPrice,Yx as getPaymentIntent,kx as getOrCreateCustomer,lx as getInvoices,qx as getInvoice,Ox as getCustomer,Ux as getCheckoutSession,Dx as getCharge,j as freshIdempotencyKey,nx as formatAmount,vx as deleteCustomer,_w as createStripeProduct,yx as createSetupIntent,px as createPromoCode,mx as createProduct,fx as createPayment,hx as createInvoice,ix as createCoupon,wx as constructEventAsync,Xx as constructEvent,Wx as checkout,Vx as charge,Cx as changeSubscription,Px as cancelSubscription,gx as addPaymentMethod,tx as Payment};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/payments",
3
3
  "type": "module",
4
- "version": "0.70.82",
4
+ "version": "0.70.83",
5
5
  "description": "The Stacks payments package. Currently supporting Stripe.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -53,10 +53,22 @@
53
53
  "typecheck": "bun tsc --noEmit",
54
54
  "prepublishOnly": "bun run build"
55
55
  },
56
+ "peerDependencies": {
57
+ "@stripe/stripe-js": "^8.7.0",
58
+ "stripe": "^21.0.1"
59
+ },
60
+ "peerDependenciesMeta": {
61
+ "@stripe/stripe-js": {
62
+ "optional": true
63
+ },
64
+ "stripe": {
65
+ "optional": true
66
+ }
67
+ },
56
68
  "devDependencies": {
57
- "@stacksjs/config": "0.70.82",
69
+ "@stacksjs/config": "0.70.83",
58
70
  "better-dx": "^0.2.16",
59
- "@stacksjs/utils": "0.70.82",
71
+ "@stacksjs/utils": "0.70.83",
60
72
  "@stripe/stripe-js": "^8.7.0",
61
73
  "stripe": "^21.0.1"
62
74
  }