@stacksjs/orm 0.72.13 → 0.72.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ Signature verification is impossible without access to the original signed mater
|
|
|
12
12
|
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.
|
|
13
13
|
`+P+`
|
|
14
14
|
`+I})}let h=Math.floor((typeof L==="number"?L:Date.now())/1000)-O.timestamp;if(x>0&&h>x)throw new g(z,V,{message:"Timestamp outside the tolerance zone"});return!0}function G(V,z){if(typeof V!=="string")return null;return z=z||X.EXPECTED_SCHEME,V.split(",").reduce((O,w)=>{let x=w.split("=");if(x[0]==="t")O.timestamp=parseInt(x[1],10);if(x[0]===z)O.signatures.push(x[1]);return O},{timestamp:-1,signatures:[]})}let W=null;function H(){if(!W)W=Z.createDefaultCryptoProvider();return W}function K(V){if(!V)throw new k({message:"Options are required"});let z=V.timestamp&&Math.floor(V.timestamp)||Math.floor(Date.now()/1000),O=V.scheme||X.EXPECTED_SCHEME,w=V.cryptoProvider||H(),x=`${z}.${V.payload}`;return{...V,timestamp:z,scheme:O,cryptoProvider:w,payloadString:x,generateHeaderString:(q)=>{return`t=${z},${O}=${q}`}}}return $.signature=X,$}var N5=_(()=>{E8();T8()});var I9="2026-06-24.dahlia";function r2(Z,$){for(let X in $){if(!Object.prototype.hasOwnProperty.call($,X))continue;let J=X[0].toLowerCase()+X.substring(1),Y=new $[X](Z);this[J]=Y}}function C(Z,$){return function(X){return new r2(X,$)}}var C0;var j9=_(()=>{F();C0=class C0 extends B{create(Z,$){return this._makeRequest("POST","/v2/core/account_links",Z,$)}}});var P0;var S9=_(()=>{F();P0=class P0 extends B{create(Z,$){return this._makeRequest("POST","/v2/core/account_tokens",Z,$,{requestSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}retrieve(Z,$,X){return this._makeRequest("GET",`/v2/core/account_tokens/${encodeURIComponent(Z)}`,$,X)}}});var N0;var M9=_(()=>{F();N0=class N0 extends B{list(Z,$){return this._makeRequest("GET","/v1/financial_connections/accounts",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/financial_connections/accounts/${encodeURIComponent(Z)}`,$,X)}disconnect(Z,$,X){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(Z)}/disconnect`,$,X)}refresh(Z,$,X){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(Z)}/refresh`,$,X)}subscribe(Z,$,X){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(Z)}/subscribe`,$,X)}unsubscribe(Z,$,X){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(Z)}/unsubscribe`,$,X)}listOwners(Z,$,X){return this._makeRequest("GET",`/v1/financial_connections/accounts/${encodeURIComponent(Z)}/owners`,$,X,{methodType:"list"})}}});var f9;var k5=_(()=>{F();f9=class f9 extends B{list(Z,$,X){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(Z)}/persons`,$,X,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}})}create(Z,$,X){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(Z)}/persons`,$,X,{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"}}}}}})}del(Z,$,X,J){return this._makeRequest("DELETE",`/v2/core/accounts/${encodeURIComponent(Z)}/persons/${encodeURIComponent($)}`,X,J)}retrieve(Z,$,X,J){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(Z)}/persons/${encodeURIComponent($)}`,X,J,{responseSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}})}update(Z,$,X,J){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(Z)}/persons/${encodeURIComponent($)}`,X,J,{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"}}}}}})}}});var y9;var I5=_(()=>{F();y9=class y9 extends B{create(Z,$,X){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(Z)}/person_tokens`,$,X,{requestSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}})}retrieve(Z,$,X,J){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(Z)}/person_tokens/${encodeURIComponent($)}`,X,J)}}});var k0;var h9=_(()=>{F();k5();I5();k0=class k0 extends B{constructor(Z){super(Z);this.stripe=Z,this.persons=new f9(Z),this.personTokens=new y9(Z)}list(Z,$){return this._makeRequest("GET","/v2/core/accounts",Z,$,{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"}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v2/core/accounts",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(Z)}`,$,X,{responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}update(Z,$,X){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}})}close(Z,$,X){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(Z)}/close`,$,X,{responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}}});var I0;var v9=_(()=>{F();I0=class I0 extends B{list(Z,$){return this._makeRequest("GET","/v1/entitlements/active_entitlements",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/entitlements/active_entitlements/${encodeURIComponent(Z)}`,$,X)}}});var j0;var R9=_(()=>{F();j0=class j0 extends B{list(Z,$){return this._makeRequest("GET","/v1/billing/alerts",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/billing/alerts",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/billing/alerts/${encodeURIComponent(Z)}`,$,X)}activate(Z,$,X){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(Z)}/activate`,$,X)}archive(Z,$,X){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(Z)}/archive`,$,X)}deactivate(Z,$,X){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(Z)}/deactivate`,$,X)}}});var S0;var b9=_(()=>{F();S0=class S0 extends B{find(Z,$){return this._makeRequest("GET","/v1/tax/associations/find",Z,$)}}});var M0;var g9=_(()=>{F();M0=class M0 extends B{list(Z,$){return this._makeRequest("GET","/v1/issuing/authorizations",Z,$,{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"}}}}}}}}}}}}}}}})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/issuing/authorizations/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}})}approve(Z,$,X){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(Z)}/approve`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(Z)}/decline`,$,X,{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 f0;var u9=_(()=>{F();f0=class f0 extends B{create(Z,$){return this._makeRequest("POST","/v1/test_helpers/issuing/authorizations",Z,$,{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(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(Z)}/capture`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(Z)}/expire`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(Z)}/finalize_amount`,$,X,{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"}}}}}}}}}}}}})}respond(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(Z)}/fraud_challenges/respond`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(Z)}/increment`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(Z)}/reverse`,$,X,{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 y0;var c9=_(()=>{F();y0=class y0 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax/calculations/${encodeURIComponent(Z)}`,$,X)}create(Z,$){return this._makeRequest("POST","/v1/tax/calculations",Z,$)}listLineItems(Z,$,X){return this._makeRequest("GET",`/v1/tax/calculations/${encodeURIComponent(Z)}/line_items`,$,X,{methodType:"list"})}}});var h0;var m9=_(()=>{F();h0=class h0 extends B{list(Z,$){return this._makeRequest("GET","/v1/issuing/cardholders",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/issuing/cardholders",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/issuing/cardholders/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/issuing/cardholders/${encodeURIComponent(Z)}`,$,X)}}});var v0;var l9=_(()=>{F();v0=class v0 extends B{list(Z,$){return this._makeRequest("GET","/v1/issuing/cards",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/issuing/cards",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/issuing/cards/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/issuing/cards/${encodeURIComponent(Z)}`,$,X)}}});var R0;var d9=_(()=>{F();R0=class R0 extends B{deliverCard(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(Z)}/shipping/deliver`,$,X)}failCard(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(Z)}/shipping/fail`,$,X)}returnCard(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(Z)}/shipping/return`,$,X)}shipCard(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(Z)}/shipping/ship`,$,X)}submitCard(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(Z)}/shipping/submit`,$,X)}}});var b0;var n9=_(()=>{F();b0=class b0 extends B{list(Z,$){return this._makeRequest("GET","/v1/billing_portal/configurations",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/billing_portal/configurations",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/billing_portal/configurations/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/billing_portal/configurations/${encodeURIComponent(Z)}`,$,X)}}});var g0;var p9=_(()=>{F();g0=class g0 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/terminal/configurations/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/terminal/configurations/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/terminal/configurations/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/terminal/configurations",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/terminal/configurations",Z,$)}}});var u0;var i9=_(()=>{F();u0=class u0 extends B{create(Z,$){return this._makeRequest("POST","/v1/test_helpers/confirmation_tokens",Z,$)}}});var c0;var r9=_(()=>{F();c0=class c0 extends B{create(Z,$){return this._makeRequest("POST","/v1/terminal/connection_tokens",Z,$)}}});var m0;var t9=_(()=>{F();m0=class m0 extends B{retrieve(Z,$){return this._makeRequest("GET","/v1/billing/credit_balance_summary",Z,$)}}});var l0;var s9=_(()=>{F();l0=class l0 extends B{list(Z,$){return this._makeRequest("GET","/v1/billing/credit_balance_transactions",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/billing/credit_balance_transactions/${encodeURIComponent(Z)}`,$,X)}}});var d0;var o9=_(()=>{F();d0=class d0 extends B{list(Z,$){return this._makeRequest("GET","/v1/billing/credit_grants",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/billing/credit_grants",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/billing/credit_grants/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(Z)}`,$,X)}expire(Z,$,X){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(Z)}/expire`,$,X)}voidGrant(Z,$,X){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(Z)}/void`,$,X)}}});var n0;var a9=_(()=>{F();n0=class n0 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/credit_reversals",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/treasury/credit_reversals",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/credit_reversals/${encodeURIComponent(Z)}`,$,X)}}});var p0;var e9=_(()=>{F();p0=class p0 extends B{fundCashBalance(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/customers/${encodeURIComponent(Z)}/fund_cash_balance`,$,X)}}});var i0;var Z1=_(()=>{F();i0=class i0 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/debit_reversals",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/treasury/debit_reversals",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/debit_reversals/${encodeURIComponent(Z)}`,$,X)}}});var r0;var $1=_(()=>{F();r0=class r0 extends B{list(Z,$){return this._makeRequest("GET","/v1/issuing/disputes",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/issuing/disputes",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/issuing/disputes/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/issuing/disputes/${encodeURIComponent(Z)}`,$,X)}submit(Z,$,X){return this._makeRequest("POST",`/v1/issuing/disputes/${encodeURIComponent(Z)}/submit`,$,X)}}});var t0;var X1=_(()=>{F();t0=class t0 extends B{list(Z,$){return this._makeRequest("GET","/v1/radar/early_fraud_warnings",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/radar/early_fraud_warnings/${encodeURIComponent(Z)}`,$,X)}}});var s0;var J1=_(()=>{F();s0=class s0 extends B{list(Z,$){return this._makeRequest("GET","/v2/core/event_destinations",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v2/core/event_destinations",Z,$)}del(Z,$,X){return this._makeRequest("DELETE",`/v2/core/event_destinations/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v2/core/event_destinations/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(Z)}`,$,X)}disable(Z,$,X){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(Z)}/disable`,$,X)}enable(Z,$,X){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(Z)}/enable`,$,X)}ping(Z,$,X){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(Z)}/ping`,$,X)}}});var o0;var Y1=_(()=>{F();o0=class o0 extends B{list(Z,$){let X=(J)=>{return{...J,data:J.data.map(this.addFetchRelatedObjectIfNeeded.bind(this))}};return this._makeRequest("GET","/v2/core/events",Z,$,{methodType:"list",transformResponseData:X})}retrieve(Z,$,X){let J=(Y)=>{return this.addFetchRelatedObjectIfNeeded(Y)};return this._makeRequest("GET",`/v2/core/events/${encodeURIComponent(Z)}`,$,X,{transformResponseData:J})}addFetchRelatedObjectIfNeeded(Z){if(!Z.related_object||!Z.related_object.url)return Z;return{...Z,fetchRelatedObject:()=>this._makeRequest("GET",Z.related_object.url,void 0,{stripeContext:Z.context,headers:{"Stripe-Request-Trigger":`event=${Z.id}`}})}}}});var a0;var Q1=_(()=>{F();a0=class a0 extends B{list(Z,$){return this._makeRequest("GET","/v1/entitlements/features",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/entitlements/features",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/entitlements/features/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/entitlements/features/${encodeURIComponent(Z)}`,$,X)}}});var e0;var G1=_(()=>{F();e0=class e0 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/financial_accounts",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/treasury/financial_accounts",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/financial_accounts/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(Z)}`,$,X)}close(Z,$,X){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(Z)}/close`,$,X)}updateFeatures(Z,$,X){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(Z)}/features`,$,X)}retrieveFeatures(Z,$,X){return this._makeRequest("GET",`/v1/treasury/financial_accounts/${encodeURIComponent(Z)}/features`,$,X)}}});var Z4;var W1=_(()=>{F();Z4=class Z4 extends B{list(Z,$){return this._makeRequest("GET","/v2/commerce/product_catalog/imports",Z,$,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{status_details:{kind:"object",fields:{processing:{kind:"object",fields:{error_count:{kind:"int64_string"},success_count:{kind:"int64_string"}}},succeeded:{kind:"object",fields:{success_count:{kind:"int64_string"}}},succeeded_with_errors:{kind:"object",fields:{error_count:{kind:"int64_string"},error_file:{kind:"object",fields:{size:{kind:"int64_string"}}},samples:{kind:"array",element:{kind:"object",fields:{row:{kind:"int64_string"}}}},success_count:{kind:"int64_string"}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v2/commerce/product_catalog/imports",Z,$,{responseSchema:{kind:"object",fields:{status_details:{kind:"object",fields:{processing:{kind:"object",fields:{error_count:{kind:"int64_string"},success_count:{kind:"int64_string"}}},succeeded:{kind:"object",fields:{success_count:{kind:"int64_string"}}},succeeded_with_errors:{kind:"object",fields:{error_count:{kind:"int64_string"},error_file:{kind:"object",fields:{size:{kind:"int64_string"}}},samples:{kind:"array",element:{kind:"object",fields:{row:{kind:"int64_string"}}}},success_count:{kind:"int64_string"}}}}}}}})}retrieve(Z,$,X){return this._makeRequest("GET",`/v2/commerce/product_catalog/imports/${encodeURIComponent(Z)}`,$,X,{responseSchema:{kind:"object",fields:{status_details:{kind:"object",fields:{processing:{kind:"object",fields:{error_count:{kind:"int64_string"},success_count:{kind:"int64_string"}}},succeeded:{kind:"object",fields:{success_count:{kind:"int64_string"}}},succeeded_with_errors:{kind:"object",fields:{error_count:{kind:"int64_string"},error_file:{kind:"object",fields:{size:{kind:"int64_string"}}},samples:{kind:"array",element:{kind:"object",fields:{row:{kind:"int64_string"}}}},success_count:{kind:"int64_string"}}}}}}}})}}});var $4;var B1=_(()=>{F();$4=class $4 extends B{fail(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(Z)}/fail`,$,X)}returnInboundTransfer(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(Z)}/return`,$,X)}succeed(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(Z)}/succeed`,$,X)}}});var X4;var K1=_(()=>{F();X4=class X4 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/inbound_transfers",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/treasury/inbound_transfers",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/inbound_transfers/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/treasury/inbound_transfers/${encodeURIComponent(Z)}/cancel`,$,X)}}});var J4;var V1=_(()=>{F();J4=class J4 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/terminal/locations/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/terminal/locations/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/terminal/locations/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/terminal/locations",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/terminal/locations",Z,$)}}});var Y4;var H1=_(()=>{F();Y4=class Y4 extends B{create(Z,$){return this._makeRequest("POST","/v1/billing/meter_event_adjustments",Z,$)}}});var Q4;var z1=_(()=>{F();Q4=class Q4 extends B{create(Z,$){return this._makeRequest("POST","/v2/billing/meter_event_adjustments",Z,$)}}});var G4;var O1=_(()=>{F();G4=class G4 extends B{create(Z,$){return this._makeRequest("POST","/v2/billing/meter_event_session",Z,$)}}});var W4;var _1=_(()=>{F();W4=class W4 extends B{create(Z,$){return this._makeRequest("POST","/v2/billing/meter_event_stream",Z,$,{apiBase:"meter_events"})}}});var B4;var F1=_(()=>{F();B4=class B4 extends B{create(Z,$){return this._makeRequest("POST","/v1/billing/meter_events",Z,$)}}});var K4;var w1=_(()=>{F();K4=class K4 extends B{create(Z,$){return this._makeRequest("POST","/v2/billing/meter_events",Z,$)}}});var V4;var x1=_(()=>{F();V4=class V4 extends B{list(Z,$){return this._makeRequest("GET","/v1/billing/meters",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/billing/meters",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/billing/meters/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(Z)}`,$,X)}deactivate(Z,$,X){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(Z)}/deactivate`,$,X)}reactivate(Z,$,X){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(Z)}/reactivate`,$,X)}listEventSummaries(Z,$,X){return this._makeRequest("GET",`/v1/billing/meters/${encodeURIComponent(Z)}/event_summaries`,$,X,{methodType:"list"})}}});var H4;var T1=_(()=>{F();H4=class H4 extends B{create(Z,$){return this._makeRequest("POST","/v1/terminal/onboarding_links",Z,$)}}});var z4;var U1=_(()=>{F();z4=class z4 extends B{list(Z,$){return this._makeRequest("GET","/v1/climate/orders",Z,$,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/climate/orders",Z,$,{requestSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}},responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/climate/orders/${encodeURIComponent(Z)}`,$,X,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}update(Z,$,X){return this._makeRequest("POST",`/v1/climate/orders/${encodeURIComponent(Z)}`,$,X,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}cancel(Z,$,X){return this._makeRequest("POST",`/v1/climate/orders/${encodeURIComponent(Z)}/cancel`,$,X,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}}});var O4;var q1=_(()=>{F();O4=class O4 extends B{update(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(Z)}`,$,X)}fail(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(Z)}/fail`,$,X)}post(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(Z)}/post`,$,X)}returnOutboundPayment(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(Z)}/return`,$,X)}}});var _4;var L1=_(()=>{F();_4=class _4 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/outbound_payments",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/treasury/outbound_payments",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/outbound_payments/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/treasury/outbound_payments/${encodeURIComponent(Z)}/cancel`,$,X)}}});var F4;var D1=_(()=>{F();F4=class F4 extends B{update(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(Z)}`,$,X)}fail(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(Z)}/fail`,$,X)}post(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(Z)}/post`,$,X)}returnOutboundTransfer(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(Z)}/return`,$,X)}}});var w4;var A1=_(()=>{F();w4=class w4 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/outbound_transfers",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/treasury/outbound_transfers",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/outbound_transfers/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/treasury/outbound_transfers/${encodeURIComponent(Z)}/cancel`,$,X)}}});var x4;var E1=_(()=>{F();x4=class x4 extends B{create(Z,$){return this._makeRequest("POST","/v1/radar/payment_evaluations",Z,$)}}});var T4;var C1=_(()=>{F();T4=class T4 extends B{list(Z,$){return this._makeRequest("GET","/v1/issuing/personalization_designs",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/issuing/personalization_designs",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/issuing/personalization_designs/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/issuing/personalization_designs/${encodeURIComponent(Z)}`,$,X)}}});var U4;var P1=_(()=>{F();U4=class U4 extends B{activate(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(Z)}/activate`,$,X)}deactivate(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(Z)}/deactivate`,$,X)}reject(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(Z)}/reject`,$,X)}}});var q4;var N1=_(()=>{F();q4=class q4 extends B{list(Z,$){return this._makeRequest("GET","/v1/issuing/physical_bundles",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/issuing/physical_bundles/${encodeURIComponent(Z)}`,$,X)}}});var L4;var k1=_(()=>{F();L4=class L4 extends B{list(Z,$){return this._makeRequest("GET","/v1/climate/products",Z,$,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{metric_tons_available:{kind:"decimal_string"}}}}}}})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/climate/products/${encodeURIComponent(Z)}`,$,X,{responseSchema:{kind:"object",fields:{metric_tons_available:{kind:"decimal_string"}}}})}}});var D4;var I1=_(()=>{F();D4=class D4 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/terminal/readers/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/terminal/readers/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/terminal/readers",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/terminal/readers",Z,$)}cancelAction(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}/cancel_action`,$,X)}collectInputs(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}/collect_inputs`,$,X)}collectPaymentMethod(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}/collect_payment_method`,$,X)}confirmPaymentIntent(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}/confirm_payment_intent`,$,X)}processPaymentIntent(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}/process_payment_intent`,$,X)}processSetupIntent(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}/process_setup_intent`,$,X)}refundPayment(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}/refund_payment`,$,X)}setReaderDisplay(Z,$,X){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(Z)}/set_reader_display`,$,X)}}});var A4;var j1=_(()=>{F();A4=class A4 extends B{presentPaymentMethod(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(Z)}/present_payment_method`,$,X)}succeedInputCollection(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(Z)}/succeed_input_collection`,$,X)}timeoutInputCollection(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(Z)}/timeout_input_collection`,$,X)}}});var E4;var S1=_(()=>{F();E4=class E4 extends B{create(Z,$){return this._makeRequest("POST","/v1/test_helpers/treasury/received_credits",Z,$)}}});var C4;var M1=_(()=>{F();C4=class C4 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/received_credits",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/received_credits/${encodeURIComponent(Z)}`,$,X)}}});var P4;var f1=_(()=>{F();P4=class P4 extends B{create(Z,$){return this._makeRequest("POST","/v1/test_helpers/treasury/received_debits",Z,$)}}});var N4;var y1=_(()=>{F();N4=class N4 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/received_debits",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/received_debits/${encodeURIComponent(Z)}`,$,X)}}});var k4;var h1=_(()=>{F();k4=class k4 extends B{expire(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/refunds/${encodeURIComponent(Z)}/expire`,$,X)}}});var I4;var v1=_(()=>{F();I4=class I4 extends B{list(Z,$){return this._makeRequest("GET","/v1/tax/registrations",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/tax/registrations",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax/registrations/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/tax/registrations/${encodeURIComponent(Z)}`,$,X)}}});var j4;var R1=_(()=>{F();j4=class j4 extends B{list(Z,$){return this._makeRequest("GET","/v1/reporting/report_runs",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/reporting/report_runs",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/reporting/report_runs/${encodeURIComponent(Z)}`,$,X)}}});var S4;var b1=_(()=>{F();S4=class S4 extends B{list(Z,$){return this._makeRequest("GET","/v1/reporting/report_types",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/reporting/report_types/${encodeURIComponent(Z)}`,$,X)}}});var M4;var g1=_(()=>{F();M4=class M4 extends B{list(Z,$){return this._makeRequest("GET","/v1/forwarding/requests",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/forwarding/requests",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/forwarding/requests/${encodeURIComponent(Z)}`,$,X)}}});var f4;var u1=_(()=>{F();f4=class f4 extends B{list(Z,$){return this._makeRequest("GET","/v1/sigma/scheduled_query_runs",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/sigma/scheduled_query_runs/${encodeURIComponent(Z)}`,$,X)}}});var y4;var c1=_(()=>{F();y4=class y4 extends B{list(Z,$){return this._makeRequest("GET","/v1/apps/secrets",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/apps/secrets",Z,$)}find(Z,$){return this._makeRequest("GET","/v1/apps/secrets/find",Z,$)}deleteWhere(Z,$){return this._makeRequest("POST","/v1/apps/secrets/delete",Z,$)}}});var h4;var m1=_(()=>{F();h4=class h4 extends B{create(Z,$){return this._makeRequest("POST","/v1/billing_portal/sessions",Z,$)}}});var v4;var l1=_(()=>{F();v4=class v4 extends B{list(Z,$){return this._makeRequest("GET","/v1/checkout/sessions",Z,$,{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"}}}}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/checkout/sessions",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/checkout/sessions/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/checkout/sessions/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}})}expire(Z,$,X){return this._makeRequest("POST",`/v1/checkout/sessions/${encodeURIComponent(Z)}/expire`,$,X,{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(Z,$,X){return this._makeRequest("GET",`/v1/checkout/sessions/${encodeURIComponent(Z)}/line_items`,$,X,{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 R4;var d1=_(()=>{F();R4=class R4 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/financial_connections/sessions/${encodeURIComponent(Z)}`,$,X)}create(Z,$){return this._makeRequest("POST","/v1/financial_connections/sessions",Z,$)}}});var b4;var n1=_(()=>{F();b4=class b4 extends B{retrieve(Z,$){return this._makeRequest("GET","/v1/tax/settings",Z,$)}update(Z,$){return this._makeRequest("POST","/v1/tax/settings",Z,$)}}});var g4;var p1=_(()=>{F();g4=class g4 extends B{list(Z,$){return this._makeRequest("GET","/v1/climate/suppliers",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/climate/suppliers/${encodeURIComponent(Z)}`,$,X)}}});var u4;var i1=_(()=>{F();u4=class u4 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/test_helpers/test_clocks/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/test_helpers/test_clocks/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/test_helpers/test_clocks",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/test_helpers/test_clocks",Z,$)}advance(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/test_clocks/${encodeURIComponent(Z)}/advance`,$,X)}}});var c4;var r1=_(()=>{F();c4=class c4 extends B{list(Z,$){return this._makeRequest("GET","/v1/issuing/tokens",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/issuing/tokens/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/issuing/tokens/${encodeURIComponent(Z)}`,$,X)}}});var m4;var t1=_(()=>{F();m4=class m4 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/transaction_entries",Z,$,{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"}}}}}}}}}}}}}}}}}}}}})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/transaction_entries/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}}}}}}})}}});var l4;var s1=_(()=>{F();l4=class l4 extends B{list(Z,$){return this._makeRequest("GET","/v1/financial_connections/transactions",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/financial_connections/transactions/${encodeURIComponent(Z)}`,$,X)}}});var d4;var o1=_(()=>{F();d4=class d4 extends B{list(Z,$){return this._makeRequest("GET","/v1/issuing/transactions",Z,$,{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"}}}}}}}}}}}}})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/issuing/transactions/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/issuing/transactions/${encodeURIComponent(Z)}`,$,X,{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 n4;var a1=_(()=>{F();n4=class n4 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax/transactions/${encodeURIComponent(Z)}`,$,X)}createFromCalculation(Z,$){return this._makeRequest("POST","/v1/tax/transactions/create_from_calculation",Z,$)}createReversal(Z,$){return this._makeRequest("POST","/v1/tax/transactions/create_reversal",Z,$)}listLineItems(Z,$,X){return this._makeRequest("GET",`/v1/tax/transactions/${encodeURIComponent(Z)}/line_items`,$,X,{methodType:"list"})}}});var p4;var e1=_(()=>{F();p4=class p4 extends B{refund(Z,$,X){return this._makeRequest("POST",`/v1/test_helpers/issuing/transactions/${encodeURIComponent(Z)}/refund`,$,X,{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"}}}}}}}}}})}createForceCapture(Z,$){return this._makeRequest("POST","/v1/test_helpers/issuing/transactions/create_force_capture",Z,$,{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(Z,$){return this._makeRequest("POST","/v1/test_helpers/issuing/transactions/create_unlinked_refund",Z,$,{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"}}}}}}}}}})}}});var i4;var ZZ=_(()=>{F();i4=class i4 extends B{list(Z,$){return this._makeRequest("GET","/v1/treasury/transactions",Z,$,{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"}}}}}}}}}}}}}}}}}}}}}}}}}}})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/treasury/transactions/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}}}}}}}}}}}}})}}});var r4;var $Z=_(()=>{F();r4=class r4 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/radar/value_list_items/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/radar/value_list_items/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/radar/value_list_items",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/radar/value_list_items",Z,$)}}});var t4;var XZ=_(()=>{F();t4=class t4 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/radar/value_lists/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/radar/value_lists/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/radar/value_lists/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/radar/value_lists",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/radar/value_lists",Z,$)}}});var s4;var JZ=_(()=>{F();s4=class s4 extends B{list(Z,$){return this._makeRequest("GET","/v1/identity/verification_reports",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/identity/verification_reports/${encodeURIComponent(Z)}`,$,X)}}});var o4;var YZ=_(()=>{F();o4=class o4 extends B{list(Z,$){return this._makeRequest("GET","/v1/identity/verification_sessions",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/identity/verification_sessions",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/identity/verification_sessions/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(Z)}/cancel`,$,X)}redact(Z,$,X){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(Z)}/redact`,$,X)}}});var J0;var C8=_(()=>{F();J0=class J0 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){if(typeof Z==="string")return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(Z)}`,$,X);else return this._makeRequest("GET","/v1/account",$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(Z)}`,$,X)}retrieveCurrent(Z,$){return this._makeRequest("GET","/v1/account",Z,$)}list(Z,$){return this._makeRequest("GET","/v1/accounts",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/accounts",Z,$)}reject(Z,$,X){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(Z)}/reject`,$,X)}listCapabilities(Z,$,X){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(Z)}/capabilities`,$,X,{methodType:"list"})}retrieveCapability(Z,$,X,J){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(Z)}/capabilities/${encodeURIComponent($)}`,X,J)}updateCapability(Z,$,X,J){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(Z)}/capabilities/${encodeURIComponent($)}`,X,J)}deleteExternalAccount(Z,$,X,J){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(Z)}/external_accounts/${encodeURIComponent($)}`,X,J)}retrieveExternalAccount(Z,$,X,J){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(Z)}/external_accounts/${encodeURIComponent($)}`,X,J)}updateExternalAccount(Z,$,X,J){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(Z)}/external_accounts/${encodeURIComponent($)}`,X,J)}listExternalAccounts(Z,$,X){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(Z)}/external_accounts`,$,X,{methodType:"list"})}createExternalAccount(Z,$,X){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(Z)}/external_accounts`,$,X)}createLoginLink(Z,$,X){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(Z)}/login_links`,$,X)}deletePerson(Z,$,X,J){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(Z)}/persons/${encodeURIComponent($)}`,X,J)}retrievePerson(Z,$,X,J){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(Z)}/persons/${encodeURIComponent($)}`,X,J)}updatePerson(Z,$,X,J){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(Z)}/persons/${encodeURIComponent($)}`,X,J)}listPersons(Z,$,X){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(Z)}/persons`,$,X,{methodType:"list"})}createPerson(Z,$,X){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(Z)}/persons`,$,X)}}});var a4;var QZ=_(()=>{F();a4=class a4 extends B{create(Z,$){return this._makeRequest("POST","/v1/account_links",Z,$)}}});var e4;var GZ=_(()=>{F();e4=class e4 extends B{create(Z,$){return this._makeRequest("POST","/v1/account_sessions",Z,$)}}});var Z6;var WZ=_(()=>{F();Z6=class Z6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/apple_pay/domains/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/apple_pay/domains/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/apple_pay/domains",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/apple_pay/domains",Z,$)}}});var $6;var BZ=_(()=>{F();$6=class $6 extends B{list(Z,$){return this._makeRequest("GET","/v1/application_fees",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(Z)}`,$,X)}retrieveRefund(Z,$,X,J){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(Z)}/refunds/${encodeURIComponent($)}`,X,J)}updateRefund(Z,$,X,J){return this._makeRequest("POST",`/v1/application_fees/${encodeURIComponent(Z)}/refunds/${encodeURIComponent($)}`,X,J)}listRefunds(Z,$,X){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(Z)}/refunds`,$,X,{methodType:"list"})}createRefund(Z,$,X){return this._makeRequest("POST",`/v1/application_fees/${encodeURIComponent(Z)}/refunds`,$,X)}}});var Y0;var P8=_(()=>{F();Y0=class Y0 extends B{retrieve(Z,$){return this._makeRequest("GET","/v1/balance",Z,$)}}});var X6;var KZ=_(()=>{F();X6=class X6 extends B{retrieve(Z,$){return this._makeRequest("GET","/v1/balance_settings",Z,$)}update(Z,$){return this._makeRequest("POST","/v1/balance_settings",Z,$)}}});var J6;var VZ=_(()=>{F();J6=class J6 extends B{list(Z,$){return this._makeRequest("GET","/v1/balance_transactions",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/balance_transactions/${encodeURIComponent(Z)}`,$,X)}}});var Y6;var HZ=_(()=>{F();Y6=class Y6 extends B{list(Z,$){return this._makeRequest("GET","/v1/charges",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/charges",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/charges/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/charges/${encodeURIComponent(Z)}`,$,X)}search(Z,$){return this._makeRequest("GET","/v1/charges/search",Z,$,{methodType:"search"})}capture(Z,$,X){return this._makeRequest("POST",`/v1/charges/${encodeURIComponent(Z)}/capture`,$,X)}}});var Q6;var zZ=_(()=>{F();Q6=class Q6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/confirmation_tokens/${encodeURIComponent(Z)}`,$,X)}}});var G6;var OZ=_(()=>{F();G6=class G6 extends B{list(Z,$){return this._makeRequest("GET","/v1/country_specs",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/country_specs/${encodeURIComponent(Z)}`,$,X)}}});var W6;var _Z=_(()=>{F();W6=class W6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/coupons/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/coupons/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/coupons/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/coupons",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/coupons",Z,$)}}});var B6;var FZ=_(()=>{F();B6=class B6 extends B{list(Z,$){return this._makeRequest("GET","/v1/credit_notes",Z,$,{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"}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/credit_notes",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/credit_notes/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/credit_notes/${encodeURIComponent(Z)}`,$,X,{responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}})}preview(Z,$){return this._makeRequest("GET","/v1/credit_notes/preview",Z,$,{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(Z,$,X){return this._makeRequest("POST",`/v1/credit_notes/${encodeURIComponent(Z)}/void`,$,X,{responseSchema:{kind:"object",fields:{lines:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}})}listPreviewLineItems(Z,$){return this._makeRequest("GET","/v1/credit_notes/preview/lines",Z,$,{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"}}}}}}}})}listLineItems(Z,$,X){return this._makeRequest("GET",`/v1/credit_notes/${encodeURIComponent(Z)}/lines`,$,X,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}})}}});var K6;var wZ=_(()=>{F();K6=class K6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}}}}}})}deleteDiscount(Z,$,X){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(Z)}/discount`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/customers",Z,$,{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"}}}}}}}}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/customers",Z,$,{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"}}}}}}}}}}}}}}}}})}search(Z,$){return this._makeRequest("GET","/v1/customers/search",Z,$,{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"}}}}}}}}}}}}}}}}}}}})}listBalanceTransactions(Z,$,X){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/balance_transactions`,$,X,{methodType:"list"})}createBalanceTransaction(Z,$,X){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}/balance_transactions`,$,X)}retrieveBalanceTransaction(Z,$,X,J){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/balance_transactions/${encodeURIComponent($)}`,X,J)}updateBalanceTransaction(Z,$,X,J){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}/balance_transactions/${encodeURIComponent($)}`,X,J)}retrieveCashBalance(Z,$,X){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/cash_balance`,$,X)}updateCashBalance(Z,$,X){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}/cash_balance`,$,X)}listCashBalanceTransactions(Z,$,X){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/cash_balance_transactions`,$,X,{methodType:"list"})}retrieveCashBalanceTransaction(Z,$,X,J){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/cash_balance_transactions/${encodeURIComponent($)}`,X,J)}createFundingInstructions(Z,$,X){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}/funding_instructions`,$,X)}listPaymentMethods(Z,$,X){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/payment_methods`,$,X,{methodType:"list"})}retrievePaymentMethod(Z,$,X,J){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/payment_methods/${encodeURIComponent($)}`,X,J)}listSources(Z,$,X){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/sources`,$,X,{methodType:"list"})}createSource(Z,$,X){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}/sources`,$,X)}retrieveSource(Z,$,X,J){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/sources/${encodeURIComponent($)}`,X,J)}updateSource(Z,$,X,J){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}/sources/${encodeURIComponent($)}`,X,J)}deleteSource(Z,$,X,J){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(Z)}/sources/${encodeURIComponent($)}`,X,J)}verifySource(Z,$,X,J){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}/sources/${encodeURIComponent($)}/verify`,X,J)}deleteTaxId(Z,$,X,J){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(Z)}/tax_ids/${encodeURIComponent($)}`,X,J)}retrieveTaxId(Z,$,X,J){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/tax_ids/${encodeURIComponent($)}`,X,J)}listTaxIds(Z,$,X){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(Z)}/tax_ids`,$,X,{methodType:"list"})}createTaxId(Z,$,X){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(Z)}/tax_ids`,$,X)}}});var V6;var xZ=_(()=>{F();V6=class V6 extends B{create(Z,$){return this._makeRequest("POST","/v1/customer_sessions",Z,$)}}});var H6;var TZ=_(()=>{F();H6=class H6 extends B{list(Z,$){return this._makeRequest("GET","/v1/disputes",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/disputes/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/disputes/${encodeURIComponent(Z)}`,$,X)}close(Z,$,X){return this._makeRequest("POST",`/v1/disputes/${encodeURIComponent(Z)}/close`,$,X)}}});var z6;var UZ=_(()=>{F();z6=class z6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/ephemeral_keys/${encodeURIComponent(Z)}`,$,X)}create(Z,$){return this._makeRequest("POST","/v1/ephemeral_keys",Z,$,{validator:(X,J)=>{if(!J.headers||!J.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")}})}}});var O6;var qZ=_(()=>{F();O6=class O6 extends B{list(Z,$){return this._makeRequest("GET","/v1/events",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/events/${encodeURIComponent(Z)}`,$,X)}}});var _6;var LZ=_(()=>{F();_6=class _6 extends B{list(Z,$){return this._makeRequest("GET","/v1/exchange_rates",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/exchange_rates/${encodeURIComponent(Z)}`,$,X)}}});function j5(Z,$,X,J){if($=$||{},Z!=="POST")return J(null,d($));this._stripe._platformFunctions.tryBufferData($).then((Y)=>{let Q=t2(Z,Y,X);return J(null,Q)}).catch((Y)=>J(Y,null))}var t2=(Z,$,X)=>{let J=(Math.round(Math.random()*10000000000000000)+Math.round(Math.random()*10000000000000000)).toString();X["Content-Type"]=`multipart/form-data; boundary=${J}`;let Y=new TextEncoder,Q=new Uint8Array(0),G=Y.encode(`\r
|
|
15
|
-
`);function W(V){let z=Q,O=V instanceof Uint8Array?V:new Uint8Array(Y.encode(V));Q=new Uint8Array(z.length+O.length+2),Q.set(z),Q.set(O,z.length),Q.set(G,Q.length-2)}function H(V){return`"${V.replace(/"|"/g,"%22").replace(/\r\n|\r|\n/g," ")}"`}let K=K5($);for(let V in K){if(!Object.prototype.hasOwnProperty.call(K,V))continue;let z=K[V];if(W(`--${J}`),Object.prototype.hasOwnProperty.call(z,"data")){let O=z;W(`Content-Disposition: form-data; name=${H(V)}; filename=${H(O.name||"blob")}`),W(`Content-Type: ${O.type||"application/octet-stream"}`),W(""),W(O.data)}else W(`Content-Disposition: form-data; name=${H(V)}`),W(""),W(z)}return W(`--${J}--`),Q};var S5=_(()=>{n()});var F6;var DZ=_(()=>{S5();F();F6=class F6 extends B{constructor(){super(...arguments);this.requestDataProcessor=j5}list(Z,$){return this._makeRequest("GET","/v1/files",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/files",Z,$,{headers:{"Content-Type":"multipart/form-data"},apiBase:"files"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/files/${encodeURIComponent(Z)}`,$,X)}}});var w6;var AZ=_(()=>{F();w6=class w6 extends B{list(Z,$){return this._makeRequest("GET","/v1/file_links",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/file_links",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/file_links/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/file_links/${encodeURIComponent(Z)}`,$,X)}}});var x6;var EZ=_(()=>{F();x6=class x6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/invoices/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/invoices/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}`,$,X,{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(Z,$){return this._makeRequest("GET","/v1/invoices",Z,$,{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"}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/invoices",Z,$,{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(Z,$){return this._makeRequest("GET","/v1/invoices/search",Z,$,{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"}}}}}}}}}}}}})}addLines(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/add_lines`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/attach_payment`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/finalize`,$,X,{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"}}}}}}}}}})}markUncollectible(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/mark_uncollectible`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/pay`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/remove_lines`,$,X,{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"}}}}}}}}}})}sendInvoice(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/send`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/update_lines`,$,X,{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"}}}}}}}}}})}voidInvoice(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/void`,$,X,{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(Z,$){return this._makeRequest("POST","/v1/invoices/create_preview",Z,$,{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"}}}}}}}}}})}listLineItems(Z,$,X){return this._makeRequest("GET",`/v1/invoices/${encodeURIComponent(Z)}/lines`,$,X,{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"}}}}}}}})}updateLineItem(Z,$,X,J){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/lines/${encodeURIComponent($)}`,X,J,{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"}}}}})}}});var T6;var CZ=_(()=>{F();T6=class T6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/invoiceitems/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/invoiceitems/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoiceitems/${encodeURIComponent(Z)}`,$,X,{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(Z,$){return this._makeRequest("GET","/v1/invoiceitems",Z,$,{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"}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/invoiceitems",Z,$,{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"}}}})}}});var U6;var PZ=_(()=>{F();U6=class U6 extends B{list(Z,$){return this._makeRequest("GET","/v1/invoice_payments",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/invoice_payments/${encodeURIComponent(Z)}`,$,X)}}});var q6;var NZ=_(()=>{F();q6=class q6 extends B{list(Z,$){return this._makeRequest("GET","/v1/invoice_rendering_templates",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/invoice_rendering_templates/${encodeURIComponent(Z)}`,$,X)}archive(Z,$,X){return this._makeRequest("POST",`/v1/invoice_rendering_templates/${encodeURIComponent(Z)}/archive`,$,X)}unarchive(Z,$,X){return this._makeRequest("POST",`/v1/invoice_rendering_templates/${encodeURIComponent(Z)}/unarchive`,$,X)}}});var L6;var kZ=_(()=>{F();L6=class L6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/mandates/${encodeURIComponent(Z)}`,$,X)}}});var D6;var M5=_(()=>{F();n();D6=class D6 extends B{constructor(){super(...arguments);this.basePath=F0("/")}authorizeUrl(Z,$){Z=Z||{},$=$||{};let X="oauth/authorize";if($.express)X=`express/${X}`;if(!Z.response_type)Z.response_type="code";if(!Z.client_id)Z.client_id=this._stripe.getClientId();if(!Z.scope)Z.scope="read_write";return`https://${this._stripe.resolveBaseAddress("connect")}/${X}?${d(Z)}`}token(Z,$){return this._makeRequest("POST","/oauth/token",Z,$,{apiBase:"connect"})}deauthorize(Z,$){if(!Z.client_id)Z.client_id=this._stripe.getClientId();return this._makeRequest("POST","/oauth/deauthorize",Z,$,{apiBase:"connect"})}}});var A6;var IZ=_(()=>{F();A6=class A6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_attempt_records",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_attempt_records/${encodeURIComponent(Z)}`,$,X)}}});var E6;var jZ=_(()=>{F();E6=class E6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_intents",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payment_intents",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_intents/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}`,$,X)}search(Z,$){return this._makeRequest("GET","/v1/payment_intents/search",Z,$,{methodType:"search"})}applyCustomerBalance(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/apply_customer_balance`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/cancel`,$,X)}capture(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/capture`,$,X)}confirm(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/confirm`,$,X)}incrementAuthorization(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/increment_authorization`,$,X)}verifyMicrodeposits(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/verify_microdeposits`,$,X)}listAmountDetailsLineItems(Z,$,X){return this._makeRequest("GET",`/v1/payment_intents/${encodeURIComponent(Z)}/amount_details_line_items`,$,X,{methodType:"list"})}}});var C6;var SZ=_(()=>{F();C6=class C6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_links",Z,$,{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"}}}}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/payment_links",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/payment_links/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/payment_links/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}})}listLineItems(Z,$,X){return this._makeRequest("GET",`/v1/payment_links/${encodeURIComponent(Z)}/line_items`,$,X,{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 P6;var MZ=_(()=>{F();P6=class P6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_methods",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payment_methods",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_methods/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(Z)}`,$,X)}attach(Z,$,X){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(Z)}/attach`,$,X)}detach(Z,$,X){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(Z)}/detach`,$,X)}}});var N6;var fZ=_(()=>{F();N6=class N6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_method_configurations",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payment_method_configurations",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_method_configurations/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payment_method_configurations/${encodeURIComponent(Z)}`,$,X)}}});var k6;var yZ=_(()=>{F();k6=class k6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_method_domains",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payment_method_domains",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_method_domains/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payment_method_domains/${encodeURIComponent(Z)}`,$,X)}validate(Z,$,X){return this._makeRequest("POST",`/v1/payment_method_domains/${encodeURIComponent(Z)}/validate`,$,X)}}});var I6;var hZ=_(()=>{F();I6=class I6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_records/${encodeURIComponent(Z)}`,$,X)}reportPaymentAttempt(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt`,$,X)}reportPaymentAttemptCanceled(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt_canceled`,$,X)}reportPaymentAttemptFailed(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt_failed`,$,X)}reportPaymentAttemptGuaranteed(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt_guaranteed`,$,X)}reportPaymentAttemptInformational(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt_informational`,$,X)}reportRefund(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_refund`,$,X)}reportPayment(Z,$){return this._makeRequest("POST","/v1/payment_records/report_payment",Z,$)}}});var j6;var vZ=_(()=>{F();j6=class j6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payouts",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payouts",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payouts/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(Z)}/cancel`,$,X)}reverse(Z,$,X){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(Z)}/reverse`,$,X)}}});var S6;var RZ=_(()=>{F();S6=class S6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/plans/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/plans/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/plans/${encodeURIComponent(Z)}`,$,X,{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(Z,$){return this._makeRequest("GET","/v1/plans",Z,$,{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"}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/plans",Z,$,{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"}}}}}}}})}}});var M6;var bZ=_(()=>{F();M6=class M6 extends B{list(Z,$){return this._makeRequest("GET","/v1/prices",Z,$,{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"}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/prices",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/prices/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/prices/${encodeURIComponent(Z)}`,$,X,{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"}}}}})}search(Z,$){return this._makeRequest("GET","/v1/prices/search",Z,$,{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 f6;var gZ=_(()=>{F();f6=class f6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/products/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/products/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/products",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/products",Z,$,{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"}}}}}})}search(Z,$){return this._makeRequest("GET","/v1/products/search",Z,$,{methodType:"search"})}deleteFeature(Z,$,X,J){return this._makeRequest("DELETE",`/v1/products/${encodeURIComponent(Z)}/features/${encodeURIComponent($)}`,X,J)}retrieveFeature(Z,$,X,J){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(Z)}/features/${encodeURIComponent($)}`,X,J)}listFeatures(Z,$,X){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(Z)}/features`,$,X,{methodType:"list"})}createFeature(Z,$,X){return this._makeRequest("POST",`/v1/products/${encodeURIComponent(Z)}/features`,$,X)}}});var y6;var uZ=_(()=>{F();y6=class y6 extends B{list(Z,$){return this._makeRequest("GET","/v1/promotion_codes",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/promotion_codes",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/promotion_codes/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/promotion_codes/${encodeURIComponent(Z)}`,$,X)}}});var h6;var cZ=_(()=>{F();h6=class h6 extends B{list(Z,$){return this._makeRequest("GET","/v1/quotes",Z,$,{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"}}}}}}}}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/quotes",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}}}}}})}accept(Z,$,X){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(Z)}/accept`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(Z)}/cancel`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(Z)}/finalize`,$,X,{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"}}}}}}}}}}}}}}}}})}pdf(Z,$,X){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(Z)}/pdf`,$,X,{apiBase:"files",streaming:!0})}listComputedUpfrontLineItems(Z,$,X){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(Z)}/computed_upfront_line_items`,$,X,{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(Z,$,X){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(Z)}/line_items`,$,X,{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 v6;var mZ=_(()=>{F();v6=class v6 extends B{list(Z,$){return this._makeRequest("GET","/v1/refunds",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/refunds",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/refunds/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/refunds/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/refunds/${encodeURIComponent(Z)}/cancel`,$,X)}}});var R6;var lZ=_(()=>{F();R6=class R6 extends B{list(Z,$){return this._makeRequest("GET","/v1/reviews",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/reviews/${encodeURIComponent(Z)}`,$,X)}approve(Z,$,X){return this._makeRequest("POST",`/v1/reviews/${encodeURIComponent(Z)}/approve`,$,X)}}});var b6;var dZ=_(()=>{F();b6=class b6 extends B{list(Z,$){return this._makeRequest("GET","/v1/setup_attempts",Z,$,{methodType:"list"})}}});var g6;var nZ=_(()=>{F();g6=class g6 extends B{list(Z,$){return this._makeRequest("GET","/v1/setup_intents",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/setup_intents",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/setup_intents/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(Z)}/cancel`,$,X)}confirm(Z,$,X){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(Z)}/confirm`,$,X)}verifyMicrodeposits(Z,$,X){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(Z)}/verify_microdeposits`,$,X)}}});var u6;var pZ=_(()=>{F();u6=class u6 extends B{list(Z,$){return this._makeRequest("GET","/v1/shipping_rates",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/shipping_rates",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/shipping_rates/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/shipping_rates/${encodeURIComponent(Z)}`,$,X)}}});var c6;var iZ=_(()=>{F();c6=class c6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/sources/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/sources/${encodeURIComponent(Z)}`,$,X)}create(Z,$){return this._makeRequest("POST","/v1/sources",Z,$)}verify(Z,$,X){return this._makeRequest("POST",`/v1/sources/${encodeURIComponent(Z)}/verify`,$,X)}listSourceTransactions(Z,$,X){return this._makeRequest("GET",`/v1/sources/${encodeURIComponent(Z)}/source_transactions`,$,X,{methodType:"list"})}}});var m6;var rZ=_(()=>{F();m6=class m6 extends B{cancel(Z,$,X){return this._makeRequest("DELETE",`/v1/subscriptions/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("GET",`/v1/subscriptions/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}})}deleteDiscount(Z,$,X){return this._makeRequest("DELETE",`/v1/subscriptions/${encodeURIComponent(Z)}/discount`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/subscriptions",Z,$,{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"}}}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/subscriptions",Z,$,{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"}}}}}}}}}}}})}search(Z,$){return this._makeRequest("GET","/v1/subscriptions/search",Z,$,{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"}}}}}}}}}}}}}}})}migrate(Z,$,X){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(Z)}/migrate`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(Z)}/resume`,$,X,{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"}}}}}}}}}}}})}}});var l6;var tZ=_(()=>{F();l6=class l6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/subscription_items/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/subscription_items/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/subscription_items/${encodeURIComponent(Z)}`,$,X,{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(Z,$){return this._makeRequest("GET","/v1/subscription_items",Z,$,{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"}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/subscription_items",Z,$,{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"}}}}}}})}}});var d6;var sZ=_(()=>{F();d6=class d6 extends B{list(Z,$){return this._makeRequest("GET","/v1/subscription_schedules",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/subscription_schedules",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/subscription_schedules/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}})}cancel(Z,$,X){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(Z)}/cancel`,$,X)}release(Z,$,X){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(Z)}/release`,$,X)}}});var n6;var oZ=_(()=>{F();n6=class n6 extends B{list(Z,$){return this._makeRequest("GET","/v1/tax_codes",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax_codes/${encodeURIComponent(Z)}`,$,X)}}});var p6;var aZ=_(()=>{F();p6=class p6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/tax_ids/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax_ids/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/tax_ids",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/tax_ids",Z,$)}}});var i6;var eZ=_(()=>{F();i6=class i6 extends B{list(Z,$){return this._makeRequest("GET","/v1/tax_rates",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/tax_rates",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax_rates/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/tax_rates/${encodeURIComponent(Z)}`,$,X)}}});var r6;var Z$=_(()=>{F();r6=class r6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tokens/${encodeURIComponent(Z)}`,$,X)}create(Z,$){return this._makeRequest("POST","/v1/tokens",Z,$)}}});var t6;var $$=_(()=>{F();t6=class t6 extends B{list(Z,$){return this._makeRequest("GET","/v1/topups",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/topups",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/topups/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/topups/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/topups/${encodeURIComponent(Z)}/cancel`,$,X)}}});var s6;var X$=_(()=>{F();s6=class s6 extends B{list(Z,$){return this._makeRequest("GET","/v1/transfers",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/transfers",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(Z)}`,$,X)}listReversals(Z,$,X){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(Z)}/reversals`,$,X,{methodType:"list"})}createReversal(Z,$,X){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(Z)}/reversals`,$,X)}retrieveReversal(Z,$,X,J){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(Z)}/reversals/${encodeURIComponent($)}`,X,J)}updateReversal(Z,$,X,J){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(Z)}/reversals/${encodeURIComponent($)}`,X,J)}}});var o6;var J$=_(()=>{F();o6=class o6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/webhook_endpoints/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/webhook_endpoints/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/webhook_endpoints/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/webhook_endpoints",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/webhook_endpoints",Z,$)}}});var Q0={};j8(Q0,{WebhookEndpoints:()=>o6,V2:()=>OX,Treasury:()=>zX,Transfers:()=>s6,Topups:()=>t6,Tokens:()=>r6,TestHelpers:()=>HX,Terminal:()=>VX,TaxRates:()=>i6,TaxIds:()=>p6,TaxCodes:()=>n6,Tax:()=>KX,Subscriptions:()=>m6,SubscriptionSchedules:()=>d6,SubscriptionItems:()=>l6,Sources:()=>c6,Sigma:()=>BX,ShippingRates:()=>u6,SetupIntents:()=>g6,SetupAttempts:()=>b6,Reviews:()=>R6,Reporting:()=>WX,Refunds:()=>v6,Radar:()=>GX,Quotes:()=>h6,PromotionCodes:()=>y6,Products:()=>f6,Prices:()=>M6,Plans:()=>S6,Payouts:()=>j6,PaymentRecords:()=>I6,PaymentMethods:()=>P6,PaymentMethodDomains:()=>k6,PaymentMethodConfigurations:()=>N6,PaymentLinks:()=>C6,PaymentIntents:()=>E6,PaymentAttemptRecords:()=>A6,OAuthResource:()=>D6,Mandates:()=>L6,Issuing:()=>QX,Invoices:()=>x6,InvoiceRenderingTemplates:()=>q6,InvoicePayments:()=>U6,InvoiceItems:()=>T6,Identity:()=>YX,Forwarding:()=>JX,FinancialConnections:()=>XX,Files:()=>F6,FileLinks:()=>w6,ExchangeRates:()=>_6,Events:()=>O6,EphemeralKeys:()=>z6,Entitlements:()=>$X,Disputes:()=>H6,Customers:()=>K6,CustomerSessions:()=>V6,CreditNotes:()=>B6,Coupons:()=>W6,CountrySpecs:()=>G6,ConfirmationTokens:()=>Q6,Climate:()=>ZX,Checkout:()=>e2,Charges:()=>Y6,BillingPortal:()=>a2,Billing:()=>o2,Balances:()=>Y0,BalanceTransactions:()=>J6,BalanceSettings:()=>X6,Balance:()=>Y0,Apps:()=>s2,ApplicationFees:()=>$6,ApplePayDomains:()=>Z6,Accounts:()=>J0,AccountSessions:()=>e4,AccountLinks:()=>a4,Account:()=>J0});var s2,o2,a2,e2,ZX,$X,XX,JX,YX,QX,GX,WX,BX,KX,VX,HX,zX,OX;var Y$=_(()=>{j9();S9();M9();h9();v9();R9();b9();g9();u9();c9();m9();l9();d9();n9();p9();i9();r9();t9();s9();o9();a9();e9();Z1();$1();X1();J1();Y1();Q1();G1();W1();B1();K1();V1();H1();z1();O1();_1();F1();w1();x1();T1();U1();q1();L1();D1();A1();E1();C1();P1();N1();k1();I1();j1();S1();M1();f1();y1();h1();v1();R1();b1();g1();u1();c1();m1();l1();d1();n1();p1();i1();r1();t1();s1();o1();a1();e1();ZZ();$Z();XZ();JZ();YZ();C8();C8();QZ();GZ();WZ();BZ();P8();P8();KZ();VZ();HZ();zZ();OZ();_Z();FZ();wZ();xZ();TZ();UZ();qZ();LZ();DZ();AZ();EZ();CZ();PZ();NZ();kZ();M5();IZ();jZ();SZ();MZ();fZ();yZ();hZ();vZ();RZ();bZ();gZ();uZ();cZ();mZ();lZ();dZ();nZ();pZ();iZ();rZ();tZ();sZ();oZ();aZ();eZ();Z$();$$();X$();J$();s2=C("apps",{Secrets:y4}),o2=C("billing",{Alerts:j0,CreditBalanceSummary:m0,CreditBalanceTransactions:l0,CreditGrants:d0,MeterEventAdjustments:Y4,MeterEvents:B4,Meters:V4}),a2=C("billingPortal",{Configurations:b0,Sessions:h4}),e2=C("checkout",{Sessions:v4}),ZX=C("climate",{Orders:z4,Products:L4,Suppliers:g4}),$X=C("entitlements",{ActiveEntitlements:I0,Features:a0}),XX=C("financialConnections",{Accounts:N0,Sessions:R4,Transactions:l4}),JX=C("forwarding",{Requests:M4}),YX=C("identity",{VerificationReports:s4,VerificationSessions:o4}),QX=C("issuing",{Authorizations:M0,Cardholders:h0,Cards:v0,Disputes:r0,PersonalizationDesigns:T4,PhysicalBundles:q4,Tokens:c4,Transactions:d4}),GX=C("radar",{EarlyFraudWarnings:t0,PaymentEvaluations:x4,ValueListItems:r4,ValueLists:t4}),WX=C("reporting",{ReportRuns:j4,ReportTypes:S4}),BX=C("sigma",{ScheduledQueryRuns:f4}),KX=C("tax",{Associations:S0,Calculations:y0,Registrations:I4,Settings:b4,Transactions:n4}),VX=C("terminal",{Configurations:g0,ConnectionTokens:c0,Locations:J4,OnboardingLinks:H4,Readers:D4}),HX=C("testHelpers",{ConfirmationTokens:u0,Customers:p0,Refunds:k4,TestClocks:u4,Issuing:C("issuing",{Authorizations:f0,Cards:R0,PersonalizationDesigns:U4,Transactions:p4}),Terminal:C("terminal",{Readers:A4}),Treasury:C("treasury",{InboundTransfers:$4,OutboundPayments:O4,OutboundTransfers:F4,ReceivedCredits:E4,ReceivedDebits:P4})}),zX=C("treasury",{CreditReversals:n0,DebitReversals:i0,FinancialAccounts:e0,InboundTransfers:X4,OutboundPayments:_4,OutboundTransfers:w4,ReceivedCredits:C4,ReceivedDebits:N4,TransactionEntries:m4,Transactions:i4}),OX=C("v2",{Billing:C("billing",{MeterEventAdjustments:Q4,MeterEventSession:G4,MeterEventStream:W4,MeterEvents:K4}),Commerce:C("commerce",{ProductCatalog:C("productCatalog",{Imports:Z4})}),Core:C("core",{AccountLinks:C0,AccountTokens:P0,Accounts:k0,EventDestinations:s0,Events:o0})})});var f5=_(()=>{U8()});class Q${constructor(Z){this.stripe=Z,this.secrets=new y4(Z)}}var y5=_(()=>{c1()});class G${constructor(Z){this.stripe=Z,this.alerts=new j0(Z),this.creditBalanceSummaries=new m0(Z),this.creditBalanceTransactions=new l0(Z),this.creditGrants=new d0(Z),this.meters=new V4(Z),this.meterEvents=new B4(Z),this.meterEventAdjustments=new Y4(Z)}}var h5=_(()=>{R9();t9();s9();o9();x1();F1();H1()});class W${constructor(Z){this.stripe=Z,this.configurations=new b0(Z),this.sessions=new h4(Z)}}var v5=_(()=>{n9();m1()});class B${constructor(Z){this.stripe=Z,this.sessions=new v4(Z)}}var R5=_(()=>{l1()});class K${constructor(Z){this.stripe=Z,this.orders=new z4(Z),this.products=new L4(Z),this.suppliers=new g4(Z)}}var b5=_(()=>{U1();k1();p1()});class V${constructor(Z){this.stripe=Z,this.activeEntitlements=new I0(Z),this.features=new a0(Z)}}var g5=_(()=>{v9();Q1()});class H${constructor(Z){this.stripe=Z,this.accounts=new N0(Z),this.sessions=new R4(Z),this.transactions=new l4(Z)}}var u5=_(()=>{M9();d1();s1()});class z${constructor(Z){this.stripe=Z,this.requests=new M4(Z)}}var c5=_(()=>{g1()});class O${constructor(Z){this.stripe=Z,this.verificationReports=new s4(Z),this.verificationSessions=new o4(Z)}}var m5=_(()=>{JZ();YZ()});class _${constructor(Z){this.stripe=Z,this.authorizations=new M0(Z),this.cards=new v0(Z),this.cardholders=new h0(Z),this.disputes=new r0(Z),this.personalizationDesigns=new T4(Z),this.physicalBundles=new q4(Z),this.tokens=new c4(Z),this.transactions=new d4(Z)}}var l5=_(()=>{g9();l9();m9();$1();C1();N1();r1();o1()});class F${constructor(Z){this.stripe=Z,this.earlyFraudWarnings=new t0(Z),this.paymentEvaluations=new x4(Z),this.valueLists=new t4(Z),this.valueListItems=new r4(Z)}}var d5=_(()=>{X1();E1();XZ();$Z()});class w${constructor(Z){this.stripe=Z,this.reportRuns=new j4(Z),this.reportTypes=new S4(Z)}}var n5=_(()=>{R1();b1()});class x${constructor(Z){this.stripe=Z,this.scheduledQueryRuns=new f4(Z)}}var p5=_(()=>{u1()});class T${constructor(Z){this.stripe=Z,this.associations=new S0(Z),this.calculations=new y0(Z),this.registrations=new I4(Z),this.settings=new b4(Z),this.transactions=new n4(Z)}}var i5=_(()=>{b9();c9();v1();n1();a1()});class U${constructor(Z){this.stripe=Z,this.configurations=new g0(Z),this.connectionTokens=new c0(Z),this.locations=new J4(Z),this.onboardingLinks=new H4(Z),this.readers=new D4(Z)}}var r5=_(()=>{p9();r9();V1();T1();I1()});class q${constructor(Z){this.stripe=Z,this.authorizations=new f0(Z),this.cards=new R0(Z),this.personalizationDesigns=new U4(Z),this.transactions=new p4(Z)}}var t5=_(()=>{u9();d9();P1();e1()});class L${constructor(Z){this.stripe=Z,this.readers=new A4(Z)}}var s5=_(()=>{j1()});class D${constructor(Z){this.stripe=Z,this.inboundTransfers=new $4(Z),this.outboundPayments=new O4(Z),this.outboundTransfers=new F4(Z),this.receivedCredits=new E4(Z),this.receivedDebits=new P4(Z)}}var o5=_(()=>{B1();q1();D1();S1();f1()});class A${constructor(Z){this.stripe=Z,this.confirmationTokens=new u0(Z),this.customers=new p0(Z),this.refunds=new k4(Z),this.testClocks=new u4(Z),this.issuing=new q$(Z),this.terminal=new L$(Z),this.treasury=new D$(Z)}}var a5=_(()=>{i9();e9();h1();i1();t5();s5();o5()});class E${constructor(Z){this.stripe=Z,this.creditReversals=new n0(Z),this.debitReversals=new i0(Z),this.financialAccounts=new e0(Z),this.inboundTransfers=new X4(Z),this.outboundPayments=new _4(Z),this.outboundTransfers=new w4(Z),this.receivedCredits=new C4(Z),this.receivedDebits=new N4(Z),this.transactions=new i4(Z),this.transactionEntries=new m4(Z)}}var e5=_(()=>{a9();Z1();G1();K1();L1();A1();M1();y1();ZZ();t1()});class C${constructor(Z){this.stripe=Z,this.meterEvents=new K4(Z),this.meterEventAdjustments=new Q4(Z),this.meterEventSession=new G4(Z),this.meterEventStream=new W4(Z)}}var Z7=_(()=>{w1();z1();O1();_1()});class P${constructor(Z){this.stripe=Z,this.imports=new Z4(Z)}}var $7=_(()=>{W1()});class N${constructor(Z){this.stripe=Z,this.productCatalog=new P$(Z)}}var X7=_(()=>{$7()});class k${constructor(Z){this.stripe=Z,this.accounts=new k0(Z),this.accountLinks=new C0(Z),this.accountTokens=new P0(Z),this.events=new o0(Z),this.eventDestinations=new s0(Z)}}var J7=_(()=>{h9();j9();S9();Y1();J1()});class I${constructor(Z){this.stripe=Z,this.billing=new C$(Z),this.commerce=new N$(Z),this.core=new k$(Z)}}var Y7=_(()=>{Z7();X7();J7()});class A{static initialize(Z,$=z7){A._platformFunctions=Z,A._requestSenderFactory=$,A.webhooks=P5(Z),A.createNodeHttpClient=Z.createNodeHttpClient,A.createFetchHttpClient=Z.createFetchHttpClient,A.createNodeCryptoProvider=Z.createNodeCryptoProvider,A.createSubtleCryptoProvider=Z.createSubtleCryptoProvider;let X=Z.getEnv(),J=Z.getRuntimeVersion();A.aiAgent=X?V5(X):"",A.AI_AGENT=A.aiAgent,A.USER_AGENT={bindings_version:A.PACKAGE_VERSION,lang:"node",typescript:!1,...J?{lang_version:J}:{},...A.aiAgent?{ai_agent:A.aiAgent}:{}}}constructor(Z,$={}){this._authenticator=null;let X=this._getPropsFromConfig($);this._platformFunctions=A._platformFunctions,Object.defineProperty(this,"_emitter",{value:this._platformFunctions.createEmitter(),enumerable:!1,configurable:!1,writable:!1}),this.VERSION=A.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 J=X.httpAgent||null;this._api={host:X.host||j$,port:X.port||Q7,protocol:X.protocol||"https",basePath:G7,version:X.apiVersion||W7,timeout:_8("timeout",X.timeout,B7),maxNetworkRetries:_8("maxNetworkRetries",X.maxNetworkRetries,2),agent:J,httpClient:X.httpClient||(J?this._platformFunctions.createNodeHttpClient(J):this._platformFunctions.createDefaultHttpClient()),dev:!1,stripeAccount:X.stripeAccount||null,stripeContext:X.stripeContext||null};let Y=X.typescript||!1;if(Y!==A.USER_AGENT.typescript)A.USER_AGENT.typescript=Y;if(X.appInfo)this._setAppInfo(X.appInfo);this._setAuthenticator(Z,X.authenticator||null),this.errors=A8,this.Decimal=v,this.webhooks=A.webhooks,this._prevRequestMetrics=[],this._enableTelemetry=X.telemetry!==!1,this._emitEventBodies=X.emitEventBodies===!0,this._requestSender=A._requestSenderFactory(this),this.accountLinks=new a4(this),this.accountSessions=new e4(this),this.accounts=new J0(this),this.applePayDomains=new Z6(this),this.applicationFees=new $6(this),this.balance=new Y0(this),this.balanceSettings=new X6(this),this.balanceTransactions=new J6(this),this.charges=new Y6(this),this.confirmationTokens=new Q6(this),this.countrySpecs=new G6(this),this.coupons=new W6(this),this.creditNotes=new B6(this),this.customerSessions=new V6(this),this.customers=new K6(this),this.disputes=new H6(this),this.ephemeralKeys=new z6(this),this.events=new O6(this),this.exchangeRates=new _6(this),this.fileLinks=new w6(this),this.files=new F6(this),this.invoiceItems=new T6(this),this.invoicePayments=new U6(this),this.invoiceRenderingTemplates=new q6(this),this.invoices=new x6(this),this.mandates=new L6(this),this.paymentAttemptRecords=new A6(this),this.paymentIntents=new E6(this),this.paymentLinks=new C6(this),this.paymentMethodConfigurations=new N6(this),this.paymentMethodDomains=new k6(this),this.paymentMethods=new P6(this),this.paymentRecords=new I6(this),this.payouts=new j6(this),this.plans=new S6(this),this.prices=new M6(this),this.products=new f6(this),this.promotionCodes=new y6(this),this.quotes=new h6(this),this.refunds=new v6(this),this.reviews=new R6(this),this.setupAttempts=new b6(this),this.setupIntents=new g6(this),this.shippingRates=new u6(this),this.sources=new c6(this),this.subscriptionItems=new l6(this),this.subscriptionSchedules=new d6(this),this.subscriptions=new m6(this),this.taxCodes=new n6(this),this.taxIds=new p6(this),this.taxRates=new i6(this),this.tokens=new r6(this),this.topups=new t6(this),this.transfers=new s6(this),this.webhookEndpoints=new o6(this),this.apps=new Q$(this),this.billing=new G$(this),this.billingPortal=new W$(this),this.checkout=new B$(this),this.climate=new K$(this),this.entitlements=new V$(this),this.financialConnections=new H$(this),this.forwarding=new z$(this),this.identity=new O$(this),this.issuing=new _$(this),this.radar=new F$(this),this.reporting=new w$(this),this.sigma=new x$(this),this.tax=new T$(this),this.terminal=new U$(this),this.testHelpers=new A$(this),this.treasury=new E$(this),this.v2=new I$(this),this.account=this.accounts,this.oauth=new D6(this)}rawRequest(Z,$,X,J){return this._requestSender._rawRequest(Z,$,X,J)}_setAuthenticator(Z,$){if(Z&&$)throw Error("Can't specify both apiKey and authenticator");if(!Z&&!$)throw Error("Neither apiKey nor config.authenticator provided");this._authenticator=Z?G9(Z):$}_setAppInfo(Z){if(Z&&typeof Z!=="object")throw Error("AppInfo must be an object.");if(Z&&!Z.name)throw Error("AppInfo.name is required");Z=Z||{},this._appInfo=_X.reduce(($,X)=>{if(typeof Z[X]=="string")$=$||{},$[X]=Z[X];return $},{})}setClientId(Z){this._clientId=Z}getClientId(){return this._clientId}getConstant(Z){switch(Z){case"DEFAULT_HOST":return j$;case"DEFAULT_PORT":return Q7;case"DEFAULT_BASE_PATH":return G7;case"DEFAULT_API_VERSION":return W7;case"DEFAULT_TIMEOUT":return B7;case"MAX_NETWORK_RETRY_DELAY_SEC":return K7;case"INITIAL_NETWORK_RETRY_DELAY_SEC":return V7}return A[Z]}resolveBaseAddress(Z){let $=this.getApiField("host");if($!==j$)return $;return Y9[Z]}getMaxNetworkRetries(){return this.getApiField("maxNetworkRetries")}_setApiNumberField(Z,$,X){let J=_8(Z,$,X);this._setApiField(Z,J)}getMaxNetworkRetryDelay(){return K7}getInitialNetworkRetryDelay(){return V7}getClientUserAgent(Z){return this.getClientUserAgentSeeded(A.USER_AGENT,Z)}getClientUserAgentSeeded(Z,$){let X={};for(let Q in Z){if(!Object.prototype.hasOwnProperty.call(Z,Q))continue;X[Q]=encodeURIComponent(Z[Q]??"null")}let J=this._platformFunctions.getPlatformInfo();if(J&&this.getTelemetryEnabled())X.platform=encodeURIComponent(J);else delete X.platform;let Y=this.getApiField("httpClient");if(Y)X.httplib=encodeURIComponent(Y.getClientName());if(this._appInfo)X.application=this._appInfo;if(this.getTelemetryEnabled()){let Q=this._platformFunctions.getTelemetryId();if(Q)X.telemetry_id=Q}$(JSON.stringify(X))}getAppInfoAsString(){if(!this._appInfo)return"";let Z=this._appInfo.name;if(this._appInfo.version)Z+=`/${this._appInfo.version}`;if(this._appInfo.url)Z+=` (${this._appInfo.url})`;return Z}getTelemetryEnabled(){return this._enableTelemetry}getEmitEventBodiesEnabled(){return this._emitEventBodies}_prepResources(){for(let Z in Q0){if(!Object.prototype.hasOwnProperty.call(Q0,Z))continue;this[B5(Z.replace("Resource",""))]=new Q0[Z](this)}}_getPropsFromConfig(Z){if(!Z)return{};let $=typeof Z==="string";if(!(Z===Object(Z)&&!Array.isArray(Z))&&!$)throw Error("Config must either be an object or a string");if($)return{apiVersion:Z};if(Object.keys(Z).filter((Y)=>!H7.includes(Y)).length>0)throw Error(`Config object may only contain the following: ${H7.join(", ")}`);return Z}_setApiField(Z,$){this._api[Z]=$}getApiField(Z){return this._api[Z]}parseEventNotification(Z,$,X,J,Y,Q){if(!this.webhooks.signature)throw Error("ERR: missing signature helper, unable to verify");this.webhooks.signature.verifyHeader(Z,$,X,J||this.webhooks.DEFAULT_TOLERANCE,Y||this._platformFunctions.createDefaultCryptoProvider(),Q);let G=Z instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(Z)):JSON.parse(Z);if(G&&G.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotification, which expects an event notification. Use stripe.webhooks.constructEvent instead.");if(G.context)G.context=l.parse(G.context);return G.fetchEvent=()=>{return this._requestSender._rawRequest("GET",`/v2/core/events/${G.id}`,void 0,{stripeContext:G.context,headers:{"Stripe-Request-Trigger":`event=${G.id}`}},["fetch_event"])},G.fetchRelatedObject=()=>{if(!G.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",G.related_object.url,void 0,{stripeContext:G.context,headers:{"Stripe-Request-Trigger":`event=${G.id}`}},["fetch_related_object"])},G}async parseEventNotificationAsync(Z,$,X,J,Y,Q){if(!this.webhooks.signature)throw Error("ERR: missing signature helper, unable to verify");await this.webhooks.signature.verifyHeaderAsync(Z,$,X,J||this.webhooks.DEFAULT_TOLERANCE,Y||this._platformFunctions.createDefaultCryptoProvider(),Q);let G=Z instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(Z)):JSON.parse(Z);if(G&&G.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotificationAsync, which expects an event notification. Use stripe.webhooks.constructEventAsync instead.");if(G.context)G.context=l.parse(G.context);return G.fetchEvent=()=>{return this._requestSender._rawRequest("GET",`/v2/core/events/${G.id}`,void 0,{stripeContext:G.context,headers:{"Stripe-Request-Trigger":`event=${G.id}`}},["fetch_event"])},G.fetchRelatedObject=()=>{if(!G.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",G.related_object.url,void 0,{stripeContext:G.context,headers:{"Stripe-Request-Trigger":`event=${G.id}`}},["fetch_related_object"])},G}}var j$="api.stripe.com",Q7="443",G7="/v1/",W7,B7=80000,K7=5,V7=0.5,_X,H7,z7=(Z)=>new X0(Z,B.MAX_BUFFERED_REQUEST_METRICS);var O7=_(()=>{E8();U5();F();Q9();N5();T8();x8();Y$();n();f5();C8();QZ();GZ();WZ();BZ();P8();KZ();VZ();HZ();zZ();OZ();_Z();FZ();wZ();xZ();TZ();UZ();LZ();DZ();AZ();EZ();CZ();PZ();NZ();kZ();IZ();jZ();SZ();MZ();fZ();yZ();hZ();vZ();RZ();bZ();gZ();uZ();cZ();mZ();lZ();dZ();nZ();pZ();iZ();rZ();tZ();sZ();oZ();aZ();eZ();Z$();$$();X$();J$();y5();h5();v5();R5();b5();g5();u5();c5();m5();l5();d5();n5();p5();i5();r5();a5();e5();Y7();qZ();Y$();W7=I9,_X=["name","version","url","partner_id"],H7=["authenticator","apiVersion","typescript","maxNetworkRetries","httpAgent","httpClient","timeout","host","port","protocol","telemetry","emitEventBodies","appInfo","stripeAccount","stripeContext"];A.PACKAGE_VERSION="22.3.2";A.API_VERSION=I9;A.aiAgent="";A.AI_AGENT="";A.USER_AGENT={bindings_version:A.PACKAGE_VERSION,lang:"node",typescript:!1};A.StripeResource=B;A.resources=Q0;A.HttpClient=S;A.HttpClientResponse=x0;A.CryptoProvider=U0;A.StripeContext=l;A.errors=A8;A.Decimal=v;A._requestSenderFactory=z7});var _7={};j8(_7,{default:()=>FX,Stripe:()=>A,Decimal:()=>v});var FX;var F7=_(()=>{T5();U8();O7();A.initialize(new z9);FX=A});import"@stacksjs/validation";import{log as S8}from"@stacksjs/cli";import{db as R$}from"@stacksjs/database";async function i7(Z,$={}){let{olderThanDays:X=30,column:J="created_at",query:Y}=$;try{if(Y){let K=R$.deleteFrom(Z);K=Y(K);let V=await K.execute(),z=Array.isArray(V)?V:[V],O=Number(z[0]?.numDeletedRows??z.length??0);return S8.info(`Pruned ${O} records from ${Z}`),O}let Q=new Date;Q.setDate(Q.getDate()-X);let G=await R$.deleteFrom(Z).where(J,"<",Q.toISOString()).execute(),W=Array.isArray(G)?G:[G],H=Number(W[0]?.numDeletedRows??W.length??0);return S8.info(`Pruned ${H} records from ${Z} older than ${X} days`),H}catch(Q){throw S8.error(`Failed to prune ${Z}:`,Q),Q}}async function BY(Z,$={}){return i7(Z,$)}function KY(Z){if(!Z?.prunable)return null;if(typeof Z.prunable==="boolean")return{olderThanDays:30,column:"created_at"};return Z.prunable}import{createCipheriv as r7,createDecipheriv as t7,createHash as s7,randomBytes as o7}from"crypto";import{log as Q8}from"@stacksjs/logging";var b$="enc:",g$="aes-256-gcm",a7=12,Y8=null;async function u$(){if(Y8)return Y8;let Z=process.env.APP_KEY;if(!Z)try{Z=(await import("@stacksjs/config").catch(()=>null))?.config?.app?.key}catch{}if(!Z)return null;return Y8=s7("sha256").update(Z).digest(),Y8}function K0(Z){return typeof Z==="string"&&Z.startsWith(b$)}async function M8(Z){if(Z==null)return Z;if(K0(Z))return Z;if(typeof Z!=="string")return Z;let $=await u$();if(!$)return Q8.warn("[orm] encrypted attribute: APP_KEY not set \u2014 storing value in plaintext"),Z;let X=o7(a7),J=r7(g$,$,X),Y=Buffer.concat([J.update(Z,"utf8"),J.final()]),Q=J.getAuthTag();return`${b$}${X.toString("base64")}:${Q.toString("base64")}:${Y.toString("base64")}`}async function f8(Z){if(Z==null)return Z;if(typeof Z!=="string")return Z;if(!K0(Z))return Z;try{let $=await u$();if(!$)return Q8.warn("[orm] encrypted attribute: APP_KEY not set \u2014 cannot decrypt"),null;let[,X,J,Y]=Z.split(":");if(!X||!J||!Y)return Q8.warn("[orm] encrypted attribute: malformed envelope, returning null"),null;let Q=Buffer.from(X,"base64"),G=Buffer.from(J,"base64"),W=Buffer.from(Y,"base64"),H=t7(g$,$,Q);return H.setAuthTag(G),Buffer.concat([H.update(W),H.final()]).toString("utf8")}catch($){return Q8.warn("[orm] encrypted attribute: decrypt failed (key rotation? corrupted ciphertext?)",{error:$}),null}}function y8(Z){let $=Z.attributes;if(!$||typeof $!=="object")return[];let X=[];for(let[J,Y]of Object.entries($))if(Y&&typeof Y==="object"&&Y.encrypted===!0)X.push(J);return X}import{sqlDateTime as e7}from"@stacksjs/database";import{log as H0}from"@stacksjs/logging";var Z2=[/^password$/i,/^password_hash$/i,/^api_key$/i,/_token$/i,/_secret$/i,/^remember_token$/i],m$="model_audits",R8=null;function $2(Z){R8=Z}async function h8(){if(R8!=null)return R8;try{let Z=await import("@stacksjs/router").catch(()=>null);if(!Z)return null;let $=Z.getCurrentRequest;if(typeof $!=="function")return null;let X=$();if(!X)return null;return(X.user??X._user)?.id??null}catch{return null}}function G8(Z){if(!Z||typeof Z!=="object")return null;let $={};for(let[X,J]of Object.entries(Z)){if(Z2.some((Y)=>Y.test(X)))continue;$[X]=J}return $}function V0(Z){if(!Z||typeof Z!=="object")return null;let $=Z;if($._attributes&&typeof $._attributes==="object")return{...$._attributes};return{...Z}}function X2(Z,$){if(!Z||!$)return{old:Z,next:$};let X={},J={},Y=new Set([...Object.keys(Z),...Object.keys($)]);for(let Q of Y)if(Z[Q]!==$[Q])X[Q]=Z[Q],J[Q]=$[Q];return{old:X,next:J}}async function v8(Z,$=!1){try{let{db:X}=await import("@stacksjs/database");await X.insertInto(m$).values({auditable_type:Z.auditable_type,auditable_id:Z.auditable_id,event:Z.event,old_values:Z.old_values?JSON.stringify(Z.old_values):null,new_values:Z.new_values?JSON.stringify(Z.new_values):null,user_id:Z.user_id,created_at:e7()}).executeTakeFirst()}catch(X){if(H0.warn(`[orm] audit row write failed for ${Z.auditable_type}#${String(Z.auditable_id)} (${Z.event})`,{error:X}),$)throw X}}function l$(Z){return{async audits($){try{let{db:X}=await import("@stacksjs/database");return(await X.selectFrom(m$).selectAll().where("auditable_type","=",Z).where("auditable_id","=",$).orderBy("created_at","desc").execute()??[]).map((Y)=>({...Y,old_values:typeof Y.old_values==="string"?c$(Y.old_values):Y.old_values,new_values:typeof Y.new_values==="string"?c$(Y.new_values):Y.new_values}))}catch(X){return H0.warn(`[orm] audits() lookup failed for ${Z}#${String($)}`,{error:X}),[]}}}}function c$(Z){try{return JSON.parse(Z)}catch{return Z}}function d$(Z){if(Z&&typeof Z==="object"&&"transactional"in Z)return{transactional:Z.transactional===!0};return{transactional:!1}}function n$(Z,$,X="id",J={}){let Y=J.transactional===!0,Q=Z;if(typeof Z.audits!=="function")Z.audits=l$($).audits;let G=async(V)=>{if(!Y)return await V();let{db:z}=await import("@stacksjs/database");return await z.transaction(async()=>V())},W=Z.create;if(typeof W==="function")Z.create=async function(...V){return await G(async()=>{let z=await W.apply(this,V);try{let O=V0(z),w=O?.[X];if(w!=null){let x=await h8();await v8({auditable_type:$,auditable_id:w,event:"created",old_values:null,new_values:G8(O),user_id:x},Y)}}catch(O){if(H0.warn(`[orm] audit(create) failed for ${$}`,{error:O}),Y)throw O}return z})};let H=Z.update;if(typeof H==="function")Z.update=async function(V,z){return await G(async()=>{let O=Q.find,w=typeof O==="function"?V0(await O.call(Q,V)):null,x=await H.call(this,V,z);try{let U=V0(x)??(typeof O==="function"?V0(await O.call(Q,V)):null),{old:q,next:L}=X2(w,U);if(L&&Object.keys(L).length>0){let E=await h8();await v8({auditable_type:$,auditable_id:V,event:"updated",old_values:G8(q),new_values:G8(L),user_id:E},Y)}}catch(U){if(H0.warn(`[orm] audit(update) failed for ${$}#${String(V)}`,{error:U}),Y)throw U}return x})};let K=(V)=>{let z=Z[V];if(typeof z!=="function")return;Z[V]=async function(O){return await G(async()=>{let w=Q.find,x=typeof w==="function"?V0(await w.call(Q,O)):null,U=await z.call(this,O);try{if(U!==!1&&x){let q=await h8();await v8({auditable_type:$,auditable_id:O,event:"deleted",old_values:G8(x),new_values:null,user_id:q},Y)}}catch(q){if(H0.warn(`[orm] audit(${V}) failed for ${$}#${String(O)}`,{error:q}),Y)throw q}return U})}};K("delete"),K("softDelete")}import{db as J2,sql as Y2,sqlDateTime as b8}from"@stacksjs/database";function u(Z,$){if(typeof Z!=="number"||!Number.isFinite(Z)||Z<=0)throw Error(`[orm/commentable] ${$} requires a positive numeric id (received ${String(Z)})`)}var z0="commentable_upvotes",O0="commentables";function Q2(Z){let $=Z;return $.code==="SQLITE_CONSTRAINT_UNIQUE"||$.code==="SQLITE_CONSTRAINT"||$.code==="23505"||$.errno===1062||/unique|duplicate/i.test($.message??"")}function g8(Z){let $=J2;return{async comments(X){return u(X,"comments"),await $.selectFrom("commentables").where("commentables_id","=",X).where("commentables_type","=",Z).selectAll().execute()},async commentCount(X){let J=await $.selectFrom("commentables").select(Y2`count(*) as count`).where("commentables_id","=",X).where("commentables_type","=",Z).executeTakeFirst();return Number(J?.count)||0},async addComment(X,J){if(u(X,"addComment"),!J||typeof J.title!=="string"||J.title.trim().length===0)throw Error("[orm/commentable] addComment requires a non-empty comment.title");if(typeof J.body!=="string"||J.body.trim().length===0)throw Error("[orm/commentable] addComment requires a non-empty comment.body");let Y=await $.insertInto("commentables").values({...J,commentables_id:X,commentables_type:Z,status:"pending",created_at:b8(),updated_at:b8()}).returningAll().executeTakeFirst();if(Y&&typeof Y==="object"&&"id"in Y)return Y;let Q=Y?.lastInsertRowid;if(Q==null)return Y;return await $.selectFrom("commentables").where("id","=",Number(Q)).selectAll().executeTakeFirst()},async approvedComments(X){return await $.selectFrom("commentables").where("commentables_id","=",X).where("commentables_type","=",Z).where("status","=","approved").selectAll().execute()},async pendingComments(X){return await $.selectFrom("commentables").where("commentables_id","=",X).where("commentables_type","=",Z).where("status","=","pending").selectAll().execute()},async rejectedComments(X){return await $.selectFrom("commentables").where("commentables_id","=",X).where("commentables_type","=",Z).where("status","=","rejected").selectAll().execute()},async upvoteComment(X,J){u(X,"upvoteComment"),u(J,"upvoteComment");let Y=()=>$.selectFrom(z0).where("upvoteable_id","=",X).where("upvoteable_type","=",O0).where("user_id","=",J).selectAll().executeTakeFirst(),Q=await Y();if(Q)return Q;try{await $.insertInto(z0).values({upvoteable_id:X,upvoteable_type:O0,user_id:J,created_at:b8()}).execute()}catch(G){if(!Q2(G))throw G}return await Y()},async removeCommentUpvote(X,J){u(X,"removeCommentUpvote"),u(J,"removeCommentUpvote"),await $.deleteFrom(z0).where("upvoteable_id","=",X).where("upvoteable_type","=",O0).where("user_id","=",J).execute()},async commentUpvoteCount(X){u(X,"commentUpvoteCount");let J=await $.selectFrom(z0).select("count(*) as count").where("upvoteable_id","=",X).where("upvoteable_type","=",O0).executeTakeFirst();return Number(J?.count)||0},async hasUpvotedComment(X,J){return u(X,"hasUpvotedComment"),u(J,"hasUpvotedComment"),!!await $.selectFrom(z0).where("upvoteable_id","=",X).where("upvoteable_type","=",O0).where("user_id","=",J).selectAll().executeTakeFirst()}}}import{db as G2,sql as W2,sqlDateTime as p$}from"@stacksjs/database";function u8(Z,$){if(typeof Z!=="number"||!Number.isFinite(Z)||Z<=0)throw Error(`[orm/taggable] ${$} requires a positive numeric id (received ${String(Z)})`)}function c8(Z){let $=G2;return{async tags(X){return u8(X,"tags"),await $.selectFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).selectAll().execute()},async tagCount(X){u8(X,"tagCount");let J=await $.selectFrom("taggables").select(W2`count(*) as count`).where("taggable_id","=",X).where("taggable_type","=",Z).executeTakeFirst();return Number(J?.count)||0},async addTag(X,J){if(u8(X,"addTag"),!J||typeof J.name!=="string"||J.name.trim().length===0)throw Error("[orm/taggable] addTag requires a non-empty tag.name");return await $.insertInto("taggables").values({...J,taggable_id:X,taggable_type:Z,slug:J.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),is_active:!0,created_at:p$(),updated_at:p$()}).execute(),await $.selectFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).where("name","=",J.name).selectAll().executeTakeFirst()},async activeTags(X){return await $.selectFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).where("is_active","=",!0).selectAll().execute()},async inactiveTags(X){return await $.selectFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).where("is_active","=",!1).selectAll().execute()},async removeTag(X,J){await $.deleteFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).where("id","=",J).execute()}}}import{db as B2,sqlDateTime as W8}from"@stacksjs/database";function m8(Z){let $=B2;async function X(J){return(await $.selectFrom("categorizable_models").where("categorizable_id","=",J).where("categorizable_type","=",Z).selectAll().execute()).map((Q)=>Q.category_id)}return{async categories(J){let Y=await X(J);if(Y.length===0)return[];return await $.selectFrom("categorizables").where("id","in",Y).selectAll().execute()},async categoryCount(J){return(await X(J)).length},async addCategory(J,Y){let Q=()=>$.selectFrom("categorizables").where("name","=",Y.name).where("categorizable_type","=",Z).selectAll().executeTakeFirst(),G=await Q();if(!G)await $.insertInto("categorizables").values({name:Y.name,description:Y.description,slug:Y.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),categorizable_type:Z,is_active:!0,created_at:W8(),updated_at:W8()}).execute(),G=await Q();return await $.insertInto("categorizable_models").values({categorizable_id:J,categorizable_type:Z,category_id:G.id,created_at:W8(),updated_at:W8()}).execute(),G},async activeCategories(J){let Y=await X(J);if(Y.length===0)return[];return await $.selectFrom("categorizables").where("id","in",Y).where("is_active","=",!0).selectAll().execute()},async inactiveCategories(J){let Y=await X(J);if(Y.length===0)return[];return await $.selectFrom("categorizables").where("id","in",Y).where("is_active","=",!1).selectAll().execute()},async removeCategory(J,Y){await $.deleteFrom("categorizable_models").where("categorizable_id","=",J).where("categorizable_type","=",Z).where("category_id","=",Y).execute()}}}import{db as K2,sqlDateTime as V2}from"@stacksjs/database";function l8(Z,$){let X=K2,J=$?.table||`${Z}_likes`,Y=$?.foreignKey||`${Z.replace(/s$/,"")}_id`;return{async likes(Q){return await X.selectFrom(J).where(Y,"=",Q).selectAll().execute()},async likeCount(Q){let G=await X.selectFrom(J).select("count(*) as count").where(Y,"=",Q).executeTakeFirst();return Number(G?.count)||0},async like(Q,G){if(typeof Q!=="number"||!Number.isFinite(Q)||Q<=0)throw Error(`[orm/likeable] like requires a positive numeric id (received ${String(Q)})`);if(typeof G!=="number"||!Number.isFinite(G)||G<=0)throw Error(`[orm/likeable] like requires a positive numeric userId (received ${String(G)})`);let W=V2();try{return await X.insertInto(J).values({[Y]:Q,user_id:G,created_at:W,updated_at:W}).returningAll().executeTakeFirst()}catch(H){let K=H;if(!(K.code==="SQLITE_CONSTRAINT_UNIQUE"||K.code==="SQLITE_CONSTRAINT"||K.code==="23505"||K.errno===1062||/unique|duplicate/i.test(K.message??"")))throw H;let z=await X.selectFrom(J).where(Y,"=",Q).where("user_id","=",G).selectAll().executeTakeFirst();if(z)return z;throw H}},async unlike(Q,G){await X.deleteFrom(J).where(Y,"=",Q).where("user_id","=",G).execute()},async isLiked(Q,G){return!!await X.selectFrom(J).where(Y,"=",Q).where("user_id","=",G).selectAll().executeTakeFirst()},async likedBy(Q){return(await X.selectFrom(J).select([Y]).where("user_id","=",Q).execute()).map((W)=>Number(W[Y])).filter(Boolean)}}}function r$(Z){let $=Z;return $?.code==="SQLITE_CONSTRAINT_UNIQUE"||$?.code==="SQLITE_CONSTRAINT"||$?.code==="23505"||$?.errno===1062||/unique|duplicate/i.test($?.message??"")}function H2(Z,$,X){let J=Z;if(Z instanceof Error&&typeof J.status==="number"&&Number.isInteger(J.status)&&J.status>=400&&J.status<600){let Y={error:Z.message};if(J.details!==void 0)Y.details=J.details;return{status:J.status,body:Y}}if(r$(Z))return{status:409,body:{error:`${$} already exists`}};return{status:500,body:{error:`Failed to ${X} ${$}`,detail:String(Z)}}}function y(Z){return Z.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function z2(Z){let $={};for(let[X,J]of Object.entries(Z))$[y(X)]=J;return $}function CY(Z,$){let X=String($||"").replace(/^\/+|\/+$/g,""),J=String(Z).replace(/^\/+/,"");return`/api/${X?`${X}/`:""}${J}`}function PY(Z){if(!Z)return null;let $=Z.attributes??{};if(Object.prototype.hasOwnProperty.call($,"teamId")||Object.prototype.hasOwnProperty.call($,"team_id"))return"team_id";return Z.belongsTo?.some((X)=>X==="Team")?"team_id":null}function NY(Z,$,X){let J=Object.keys(Z).find((Q)=>y(Q)===y($));if(Array.isArray(X)){if(J===void 0)return{data:Z,error:"Ownership value is required"};if(!X.some((Q)=>String(Q)===String(Z[J])))return{data:Z,error:"Ownership value is not available to this caller"};return{data:{...Z,[$]:Z[J]}}}if(X===null||X===void 0)return{data:Z,error:"Caller has no ownership identity"};let Y={...Z};for(let Q of Object.keys(Y))if(y(Q)===y($))delete Y[Q];return Y[$]=X,{data:Y}}function O2(Z){if(!Z)return[];let $=Object.entries(Z.attributes??{}).filter(([,X])=>X?.fillable===!0).map(([X])=>X);for(let X of Z.belongsTo??[]){if(typeof X!=="string"||!X.trim())continue;let J=y(X.trim()).split("_").filter(Boolean);if(J.length===0)continue;let Y=`${J[0]}${J.slice(1).map((Q)=>`${Q[0]?.toUpperCase()}${Q.slice(1)}`).join("")}Id`;$.push(Y)}return[...new Set($)]}function _2(Z,$){if(!Z||$.length===0)return{};let X={};for(let J of $){if(J in Z){X[J]=Z[J];continue}let Y=y(J);if(Y!==J&&Y in Z)X[J]=Z[Y]}return X}function F2(Z,$){if(Z?.name!=="date"||$ instanceof Date||typeof $!=="string")return $;let X=/^(\d{4})-(\d{2})-(\d{2})$/.exec($);if(!X)return $;let J=Number(X[1]),Y=Number(X[2]),Q=Number(X[3]),G=new Date(Date.UTC(J,Y-1,Q));if(G.getUTCFullYear()!==J||G.getUTCMonth()!==Y-1||G.getUTCDate()!==Q)return $;return G}function kY(Z,$){if(!$.length)return Z;let X={...Z};for(let J of $)delete X[J],delete X[y(J)];return X}function IY(Z,$){if(!Z||$.length===0)return Z;let X={...Z};for(let J of $)delete X[J],delete X[y(J)];return X}var w2=["id","uuid","created_at","updated_at","deleted_at"];function jY(Z,$){let X=new Map;for(let J of[...Object.keys(Z??{}),...w2]){let Y=y(J);if(!/^\w+$/.test(Y))continue;X.set(J,Y),X.set(Y,Y)}for(let J of $)X.delete(J),X.delete(y(J));return X}function SY(Z,$,X){if(!$)return Z;let J=String($).split(",").map((Q)=>Q.trim()).filter(Boolean),Y=Z;for(let Q of J){let G=Q.startsWith("-"),W=G?Q.slice(1):Q;if(!/^\w+$/.test(W))continue;let H=X.get(W);if(!H)continue;Y=Y.orderBy(H,G?"desc":"asc")}return Y}var x2={string:{get:(Z)=>Z!=null?String(Z):null,set:(Z)=>Z!=null?String(Z):null},number:{get:(Z)=>Z!=null?Number(Z):null,set:(Z)=>Z!=null?Number(Z):null},integer:{get:(Z)=>Z!=null?Math.trunc(Number(Z)):null,set:(Z)=>Z!=null?Math.trunc(Number(Z)):null},float:{get:(Z)=>Z!=null?Number.parseFloat(String(Z)):null,set:(Z)=>Z!=null?Number.parseFloat(String(Z)):null},boolean:{get:(Z)=>Z===1||Z==="1"||Z===!0||Z==="true",set:(Z)=>Z===!0||Z===1||Z==="1"||Z==="true"?1:0},json:{get:(Z)=>Z==null?null:typeof Z==="string"?T2(Z):Z,set:(Z)=>Z==null?null:typeof Z==="string"?Z:JSON.stringify(Z)},datetime:{get:(Z)=>Z?new Date(Z):null,set:(Z)=>Z instanceof Date?Z.toISOString():Z},date:{get:(Z)=>Z?new Date(Z):null,set:(Z)=>Z instanceof Date?Z.toISOString().split("T")[0]:Z},array:{get:(Z)=>Z==null?[]:Array.isArray(Z)?Z:typeof Z==="string"?U2(Z):[],set:(Z)=>Z==null?null:Array.isArray(Z)?JSON.stringify(Z):Z}};function T2(Z){try{return JSON.parse(Z)}catch{return Z}}function U2(Z){try{return JSON.parse(Z)}catch{return[]}}function MY(Z,$,X){if(!Z||typeof Z!=="object"||!$||Object.keys($).length===0)return Z;let J={...Z};for(let[Y,Q]of Object.entries($)){let G=typeof Q==="string"?x2[Q]:Q;if(!G||typeof G[X]!=="function")continue;if(Object.prototype.hasOwnProperty.call(J,Y))J[Y]=G[X](J[Y]);let W=y(Y);if(W!==Y&&Object.prototype.hasOwnProperty.call(J,W))J[W]=G[X](J[W])}return J}function t$(Z,$,X){let J=$?.attributes??{},Y={};for(let[Q,G]of Object.entries(J)){let W=G?.validation?.rule;if(!W||typeof W.validate!=="function")continue;let H=Object.prototype.hasOwnProperty.call(Z,Q);if(!H&&X==="updating")continue;let K=G!==null&&typeof G==="object"&&Object.prototype.hasOwnProperty.call(G,"default"),V=H?Z[Q]:K?G.default:void 0,z=F2(W,V),O=W.validate(z);if(!O?.valid&&Array.isArray(O?.errors)&&O.errors.length>0)Y[Q]=O.errors.map((w)=>G?.validation?.message?.[w?.code]??w?.message??"invalid")}return Object.keys(Y).length===0?{valid:!0}:{valid:!1,errors:Y}}function fY(Z){return Z.replace(/\{[^}]*\}/g,"{}").replace(/:[^/]+/g,"{}")}function d8(Z){if(Array.isArray(Z))return Z.filter(($)=>typeof $==="string"&&$.length>0);return typeof Z==="string"&&Z?[Z]:[]}function yY(Z){let $=typeof Z==="object"&&Z!==null&&"middleware"in Z,X=Z?.middleware;if(!$)return{read:["auth"],write:["auth"],declared:!1};if(X&&typeof X==="object"&&!Array.isArray(X)){let Y=X;return{read:"read"in Y?d8(Y.read):["auth"],write:"write"in Y?d8(Y.write):["auth"],declared:!0}}let J=d8(X);return{read:J,write:J,declared:!0}}var i$=15,q2=100;function hY(Z){let $=Number.parseInt(Z.get("page")||String(1),10),X=Number.isFinite($)?Math.max(1,$):1,J=Number.parseInt(Z.get("per_page")||String(i$),10),Y=Math.min(Number.isFinite(J)?Math.max(1,J):i$,q2);return{page:X,perPage:Y,offset:(X-1)*Y}}function B8(Z,$){let X=new URL(Z.toString());return X.searchParams.set("page",String($)),`${X.pathname}${X.search}`}function L2(Z,$,X,J,Y,Q){let G=($-1)*X,W=J===0,H={page:$,per_page:X,from:W?null:G+1,to:W?null:G+J,has_more_pages:Y,prev_page_url:$>1?B8(Z,$-1):null,next_page_url:Y?B8(Z,$+1):null};if(Q!==void 0&&!Number.isNaN(Q)){let K=Math.max(1,Math.ceil(Q/X));H.total=Q,H.last_page=K,H.first_page_url=B8(Z,1),H.last_page_url=B8(Z,K)}return H}function vY(Z,$,X,J,Y,Q){let{page:G,...W}=L2(Z,$,X,J,Y,Q);return{current_page:G,...W}}import{cacheRequestQuery as D2}from"@stacksjs/router";var K8=new WeakMap;function gY(Z,$){return D2(`batchLoad:${Z.name??"model"}:${String($)}`,async()=>{return new Promise((X,J)=>{let Y=K8.get(Z);if(!Y)Y={keys:[],resolvers:[],scheduled:!1},K8.set(Z,Y);if(Y.keys.push($),Y.resolvers.push({key:$,resolve:X,reject:J}),Y.scheduled)return;Y.scheduled=!0,Promise.resolve().then(async()=>{let Q=K8.get(Z);if(!Q)return;K8.delete(Z);let G=Array.from(new Set(Q.keys));try{let W=typeof Z.findMany==="function"?await Z.findMany(G):await Promise.all(G.map((K)=>Z.find?.(K))),H=new Map;for(let K of W??[]){let V=K?.id;if(V!==void 0)H.set(V,K)}for(let K of Q.resolvers)K.resolve(H.get(K.key))}catch(W){for(let H of Q.resolvers)H.reject(W)}})})})}import{db as lY}from"@stacksjs/database";class A2{conditions=[];where(Z,...$){let[X,J]=$,Y=J===void 0?"=":X,Q=J===void 0?X:J;this.addCondition("and","where",Z,Y,Q)}orWhere(Z,...$){let[X,J]=$,Y=J===void 0?"=":X,Q=J===void 0?X:J;this.addCondition("or","where",Z,Y,Q)}whereIn(Z,$){this.conditions.push({type:"and",method:"whereIn",column:Z,values:$})}whereNotIn(Z,$){this.conditions.push({type:"and",method:"whereIn",column:Z,values:$,operator:"not in"})}whereNull(Z){this.conditions.push({type:"and",method:"whereNull",column:Z})}whereNotNull(Z){this.conditions.push({type:"and",method:"whereNotNull",column:Z})}whereBetween(Z,$){this.conditions.push({type:"and",method:"whereBetween",column:Z,range:$})}whereExists(Z){this.conditions.push({type:"and",method:"whereExists",column:"",callback:Z})}addCondition(Z,$,X,J,Y){this.conditions.push({type:Z,method:$,column:X,operator:J,value:Y})}getConditions(){return this.conditions}}import{db as n8,runInTransactionScope as E2}from"@stacksjs/database";async function pY(Z,$){return await E2(async()=>{return await n8.transaction(Z,$)})}async function iY(Z){return await n8.savepoint(Z)}function rY(Z,$){return n8.transactional(Z,$)}import{path as c}from"@stacksjs/path";import{fs as Z0,globSync as t8}from"@stacksjs/storage";import{plural as Z5,singular as s$,snakeCase as j}from"@stacksjs/strings";import{isString as V8}from"@stacksjs/validation";function $5(Z){let $=Z.belongsToMany;if(!$)return[];if(Array.isArray($))return $.map((X)=>({relationName:typeof X==="string"?j(X):j(String(X.model)),relation:X}));return Object.entries($).map(([X,J])=>{if(typeof J==="string")return{relationName:X,relation:J};return{relationName:X,relation:{model:J.model,pivotTable:J.table,firstForeignKey:J.foreignKey,secondForeignKey:J.relatedKey}}})}async function ZQ(Z){if(typeof Z==="string")Z=(await import(Z)).default;return Z.table??j(Z5(Z?.name||""))}function _0(Z,$){if(Z.name)return Z.name;return c.basename($).replace(/\.ts$/,"")}function b(Z,$){if(Z.table)return Z.table;return j(Z5(_0(Z,$)))}function C2(Z,$){let X=[Z,$];return X.sort(),X.join("_")}function $Q(Z,$){return $ in Z}async function P2(Z,$){let X=[];if(Z.hasOne)for(let J of Z.hasOne)X.push(await p8(J,Z,$,"hasOne"));if(Z.hasMany)for(let J of Z.hasMany)X.push(await p8(J,Z,$,"hasMany"));if(Z.belongsTo)for(let J of Z.belongsTo)X.push(await p8(J,Z,$,"belongsTo"));if(Z.hasOneThrough)for(let J of Z.hasOneThrough)X.push(await a$(J,Z,$,"hasOneThrough"));if(Z.hasManyThrough)for(let J of Z.hasManyThrough)X.push(await a$(J,Z,$,"hasManyThrough"));if(Z.belongsToMany)for(let{relationName:J,relation:Y}of $5(Z))X.push(await k2(Y,Z,$,"belongsToMany",J));if(Z.morphOne)X.push(await e$(Z.morphOne,Z,$,"morphOne"));if(Z.morphMany){let J=Array.isArray(Z.morphMany)?Z.morphMany:[Z.morphMany];for(let Y of J)X.push(await e$(Y,Z,$,"morphMany"))}if(Z.morphTo){let J=Z.morphTo,Y=Array.isArray(J)?J:typeof J==="object"&&J!==null?[J]:[];for(let Q of Y)X.push(N2(Q,Z,$))}if(Z.morphToMany){let J=Array.isArray(Z.morphToMany)?Z.morphToMany:[Z.morphToMany];for(let Y of J)X.push(o$(Y,Z,$,"morphToMany"))}if(Z.morphedByMany){let J=Array.isArray(Z.morphedByMany)?Z.morphedByMany:[Z.morphedByMany];for(let Y of J)X.push(o$(Y,Z,$,"morphedByMany"))}return X}function N2(Z,$,X){let J=Z&&typeof Z==="object"&&Z.name?String(Z.name):`${j(X)}able`,Y=Z?.type||`${J}_type`;return{relationship:"morphTo",model:"",table:"",relationTable:"",foreignKey:Z?.id||`${J}_id`,modelKey:Y,relationName:J,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:"",pivotKey:"",pivotTable:""}}function o$(Z,$,X,J){let Y=typeof Z==="object"&&Z!==null,Q=Y?String(Z.model||""):String(Z),G=Y&&Z.morphName?String(Z.morphName):`${j(X)}able`,W=Y&&Z.pivotTable?String(Z.pivotTable):G,H=Y&&Z.id||`${G}_id`,K=Y&&Z.type||`${G}_type`;return{relationship:J,model:Q,table:"",relationTable:"",foreignKey:H,modelKey:K,relationName:G,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:H,pivotKey:K,pivotTable:W}}async function H8(Z,$){let X=r8(`${$}.ts`),J=r8(`${Z}.ts`),Y=i8(`${Z}.ts`),Q=i8(`${$}.ts`);if(!X&&!Q)throw Error(`Model not found: ${$}`);if(!J&&!Y)throw Error(`Model not found: ${Z}`);let G;try{if(Z0.existsSync(X))G=(await import(X)).default;else G=(await import(Q)).default}catch(H){throw Error(`Failed to load model: ${$}. Error: ${H?.message||"Unknown error"}`)}let W=Z0.existsSync(J)?J:Y;return{modelRelation:G,modelPath:W,modelRelationPath:Z0.existsSync(X)?X:Q}}async function a$(Z,$,X,J){let Y="",Q="",G="",W="";if(V8(Z))Y=Z;else Y=Z.model,Q=Z.relationName||"",G=Z.through,W=Z.throughForeignKey||"";let{modelRelation:H,modelPath:K,modelRelationPath:V}=await H8(X,Y),z=b(H,V),O=b($,K),w=j(_0(H,V)),x=j(X);return{relationship:J,model:Y,table:z,relationTable:O,foreignKey:`${x}_id`,modelKey:`${w}_id`,relationName:Q,relationModel:X,throughModel:G,throughForeignKey:W,pivotForeign:`${x}_id`,pivotKey:`${w}_id`,pivotTable:O}}async function k2(Z,$,X,J,Y){let Q="",G="",W="",H=j(X);if(V8(Z))Q=Z;else Q=Z.model,G=Z.pivotTable||"",W=Z.firstForeignKey||`${H}_id`;let{modelRelation:K,modelPath:V,modelRelationPath:z}=await H8(X,Q),O=b(K,z),w=b($,V),x=j(_0(K,z));return{relationship:J,model:Q,table:O,relationTable:w,foreignKey:typeof Z==="string"?`${H}_id`:Z.firstForeignKey||`${H}_id`,modelKey:typeof Z==="string"?`${x}_id`:Z.secondForeignKey||`${x}_id`,relationName:Y,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:W,pivotKey:`${x}_id`,pivotTable:G}}async function e$(Z,$,X,J){let Y="",Q="",G="",W="";if(V8(Z))Y=Z,Q=`${j(X)}able`;else Y=Z.model,Q=Z.morphName||`${j(X)}able`,G=Z.type||`${Q}_type`,W=Z.id||`${Q}_id`;let{modelRelation:H,modelPath:K,modelRelationPath:V}=await H8(X,Y),z=b(H,V),O=b($,K);return{relationship:J,model:Y,table:z,relationTable:O,foreignKey:W||`${Q}_id`,modelKey:G||`${Q}_type`,relationName:Q,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:"",pivotKey:"",pivotTable:O}}async function p8(Z,$,X,J){let Y="",Q="";if(V8(Z))Y=Z;else Y=Z.model,Q=Z.relationName||"";let{modelRelation:G,modelPath:W,modelRelationPath:H}=await H8(X,Y),K=b(G,H),V=b($,W),z=j(_0(G,H)),O=j(X),w={relationship:J,model:Y,table:K,relationTable:V,foreignKey:typeof Z==="string"?`${O}_id`:Z.foreignKey||`${O}_id`,modelKey:`${z}_id`,relationName:Q,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:`${O}_id`,pivotKey:`${z}_id`,pivotTable:V};if(J==="belongsTo")w.foreignKey="";return w}function XQ(Z){let $=/belongs/,X=/has/,J=/Through/,Y=/morph/;if(J.test(Z))return"throughType";if($.test(Z))return"belongsType";if(X.test(Z))return"hasType";if(Y.test(Z))return"morphType";return""}function JQ(Z){let $=/One/;if(/Many/.test(Z))return"many";if($.test(Z))return"one";return""}async function YQ(Z,$){let X=[];if("belongsToMany"in Z){for(let{relation:J}of $5(Z)){let Y,Q;if(typeof J==="string")Q=J;else Q=J.model;let G=r8(`${Q}.ts`),W=i8(`${Q}.ts`);if(Z0.existsSync(G))Y=(await import(G)).default;else Y=(await import(W)).default;let H=b(Y,G),K=b(Z,$),V=typeof J==="object"&&"firstForeignKey"in J?J.firstForeignKey:`${s$(K)}_${Z.primaryKey}`,z=typeof J==="object"&&"secondForeignKey"in J?J.secondForeignKey:`${s$(H)}_${Z.primaryKey}`;X.push({table:(typeof J==="object"&&"pivotTable"in J?J.pivotTable:void 0)??C2(K,H),firstForeignKey:V,secondForeignKey:z})}return X}return[]}async function QQ(Z){let $=t8([c.userModelsPath("*.ts"),c.storagePath("framework/defaults/app/Models/**/*.ts")],{absolute:!0}),X=[];for(let J=0;J<$.length;J++){let Y=$[J],Q=await import(Y);if(Z===Q.default.name)continue;let G=_0(Q,Y),W=await P2(Q.default,G);if(!W.length)continue;let H=W.find((K)=>K.model===Z);if(H)X.push(H)}return X}function GQ(Z){if(Z===void 0)return[];return Object.keys(Z).filter(($)=>{return Z[$]?.hidden===!0})}function WQ(Z){let $=Z.attributes;if($===void 0)return[];return Object.keys($).filter((X)=>{return $[X]?.guarded===!0}).map((X)=>j(X))}function BQ(Z,$){let X=Z.attributes,J=[];if(X===void 0)return[];let Y=typeof Z.traits?.billable==="object"||typeof Z.traits?.billable==="boolean",Q=typeof Z.traits?.useAuth==="object"?Z.traits?.useAuth.usePasskey:!1,G=Z.traits?.useUuid||!1;if(Y)J.push("stripe_id");if(G)J.push("uuid");if(Q)J.push(...["two_factor_secret","public_key"]);let W=$.map((H)=>H.foreignKey).filter((H)=>H);return[...Object.keys(X).filter((H)=>{if(X===void 0)return!1;return X[H]?.fillable===!0}).map((H)=>j(H)),...J,...W]}async function KQ(Z,$){let X=Z.attributes;if(!X)X={};let J=Object.keys(X),Y=[],Q=Bun.file($),G="";try{if(await Q.exists())G=await Q.text()}catch{G=""}let W=/rule:.*$/gm,H;H=W.exec(G);while(H!==null)Y.push(H[0]),H=W.exec(G);return J.map((V,z)=>{let O=X[V],w=null,x=!1,U=!1,q=!1,L=!1;if(O)w=O||null,x=O.unique||!1,U=O.hidden||!1,q=O.fillable||!1;let E=Y[z]??"";return L=(O.validation?.rule).isRequired??!1,{field:V,default:w,unique:x,hidden:U,fillable:q,required:L,fieldArray:I2(E)}})}function I2(Z){let $=Z.split("rule: schema.");if($.length!==2)return null;if(!$[1])$[1]="";let X=$[1].replace(/,/g,"");if(!X)return null;let J=X.split("."),Y=/\(([^)]+)\)/;return J.map((Q)=>{let G=Y.exec(Q),W=G?G[1]:null;return{entity:Q.replace(Y,"").replace(/\(|\)/g,""),charValue:W}})[0]||null}function VQ(Z){let $=Z.fieldArray?.entity;switch($){case"enum":return"string | string[]";case"date":return"Date | string";case"timestamp":return"Date | string";case"datetime":return"Date | string";case"float":return"number";case"double":return"number";case"decimal":return"number";case"integer":return"number";case"bigint":return"number";default:return $}}function i8(Z){let $=c.join(c.storagePath("framework/defaults/app/Models"),"/"),X=c.join($,Z);if(Z0.existsSync(X))return X;return t8(`${$}**/${Z}`,{absolute:!0})[0]??""}function r8(Z){let $=c.join(c.userModelsPath("/"),"/"),X=c.join($,Z);if(Z0.existsSync(X))return X;return t8(`${$}**/${Z}`,{absolute:!0})[0]??""}function HQ(Z){let $=typeof Z==="number"?new Date(Z):typeof Z==="string"?new Date(Z):Z;if(Number.isNaN($.getTime()))throw Error(`Invalid date value: ${String(Z)}`);return $.toISOString().replace("T"," ").split(".")[0]??""}function zQ(Z){return Z.toISOString().split("T")[0]??""}function OQ(Z){return Z.getTime()}import{createModel as qX,registerModel as LX}from"@stacksjs/query-builder";import{log as f}from"@stacksjs/logging";import{snakeCase as $8}from"@stacksjs/strings";import{AsyncLocalStorage as N7}from"async_hooks";function j2(Z){if(Z===null||typeof Z!=="object")return!1;let $=Z;return Array.isArray($.data)&&typeof $.current_page==="number"&&typeof $.per_page==="number"&&typeof $.total==="number"&&typeof $.last_page==="number"}function S2(Z){if(Z===null||typeof Z!=="object")return!1;let $=Z;return Array.isArray($.data)&&typeof $.current_page==="number"&&typeof $.per_page==="number"&&typeof $.has_more_pages==="boolean"&&!("total"in $)}function M2(Z){if(Z===null||typeof Z!=="object")return!1;let $=Z;return Array.isArray($.data)&&(typeof $.next_cursor==="string"||$.next_cursor===null)}function s8(Z){let{data:$}=Z,{perPage:X,page:J,total:Y,lastPage:Q}=Z.meta,G=$.length===0,W=G?null:(J-1)*X+1,H=G?null:W+$.length-1;return{data:$,current_page:J,per_page:X,total:Y,last_page:Q,from:W,to:H,has_more_pages:J<Q}}function o8(Z){return{data:Z.data,current_page:Z.meta.page,per_page:Z.meta.perPage,has_more_pages:Z.meta.hasMore}}function a8(Z){return{data:Z.data,per_page:Z.meta.perPage,next_cursor:X5(Z.meta.nextCursor),prev_cursor:X5(Z.meta.prevCursor),has_more_pages:Z.meta.nextCursor!==null&&Z.meta.nextCursor!==void 0}}function X5(Z){if(Z===null||Z===void 0)return null;if(typeof Z==="string")return Z;return JSON.stringify(Z)}function Z9(Z,$){let X=J9(),J=X?e8(X,"per_page"):void 0,Y=X?e8(X,"page"):void 0,Q=Z!==void 0?Math.max(1,Math.floor(Z)):Math.min(100,Math.max(1,J??15)),G=Math.max(1,Math.floor($??Y??1));return{perPage:Q,page:G}}function $9(Z,$){let X=J9(),J=X?Y5(X,"cursor"):void 0,Y=X?e8(X,"per_page"):void 0,Q=Z!==void 0?Math.max(1,Math.floor(Z)):Math.min(100,Math.max(1,Y??15)),W=J5($!==void 0?$:J??null);return{perPage:Q,cursor:W}}function J5(Z){if(Z===null||Z===void 0)return null;if(Array.isArray(Z))return Z;if(typeof Z==="string"&&Z.startsWith("["))try{let $=JSON.parse(Z);if(Array.isArray($))return $}catch{}return Z}function X9(Z){let $=J9();if(!$)return Z;let X=(()=>{try{return new URL($.url)}catch{return null}})();if(!X)return Z;let J=X.pathname;if(Z.path=J,"next_cursor"in Z)return Z.next_page_url=Z.next_cursor!==null?r(X,{cursor:Z.next_cursor}):null,Z.prev_page_url=Z.prev_cursor!==null?r(X,{cursor:Z.prev_cursor}):null,Z;let Y=Z.current_page;if(Z.prev_page_url=Y>1?r(X,{page:Y-1}):null,"total"in Z){let Q=Z.last_page;Z.next_page_url=Y<Q?r(X,{page:Y+1}):null,Z.first_page_url=r(X,{page:1}),Z.last_page_url=r(X,{page:Q})}else Z.next_page_url=Z.has_more_pages?r(X,{page:Y+1}):null;return Z}function r(Z,$){let X=new URL(Z.toString());for(let[J,Y]of Object.entries($))X.searchParams.set(J,String(Y));return`${X.pathname}${X.search}`}var $0;function J9(){if($0===null)return;if($0===void 0)try{let $=D("@stacksjs/router");if(typeof $.getCurrentRequest==="function")$0=$.getCurrentRequest;else{$0=null;return}}catch{$0=null;return}return $0()}function e8(Z,$){let X=Y5(Z,$);if(X===void 0)return;let J=Number(X);return Number.isFinite(J)?J:void 0}function Y5(Z,$){let X=Z.query?.[$];if(X===void 0)return;return Array.isArray(X)?X[0]:X}import{db as wX}from"@stacksjs/database";function w7(Z){let $=wX;return{async createStripeUser(X,J){let{manageCustomer:Y}=await import("@stacksjs/payments");return await Y.createStripeCustomer(X,J)},async updateStripeUser(X,J){let{manageCustomer:Y}=await import("@stacksjs/payments");return await Y.updateStripeCustomer(X,J)},async deleteStripeUser(X){let{manageCustomer:J}=await import("@stacksjs/payments");return await J.deleteStripeUser(X)},async createOrGetStripeUser(X,J){let{manageCustomer:Y}=await import("@stacksjs/payments");return await Y.createOrGetStripeUser(X,J)},async retrieveStripeUser(X){let{manageCustomer:J}=await import("@stacksjs/payments");return await J.retrieveStripeUser(X)},async defaultPaymentMethod(X){let{managePaymentMethod:J}=await import("@stacksjs/payments");return await J.retrieveDefaultPaymentMethod(X)},async setDefaultPaymentMethod(X,J){let{managePaymentMethod:Y}=await import("@stacksjs/payments");return await Y.setDefaultPaymentMethod(X,J)},async addPaymentMethod(X,J){let{managePaymentMethod:Y}=await import("@stacksjs/payments");return await Y.addPaymentMethod(X,J)},async paymentMethods(X,J){let{managePaymentMethod:Y}=await import("@stacksjs/payments");return await Y.listPaymentMethods(X,J)},async newSubscription(X,J,Y,Q={}){let{manageSubscription:G}=await import("@stacksjs/payments"),W=await G.create(X,J,Y,Q),K=W.latest_invoice?.payment_intent;return{subscription:W,paymentIntent:K}},async updateSubscription(X,J,Y,Q={}){let{manageSubscription:G}=await import("@stacksjs/payments"),W=await G.update(X,J,Y,Q),K=W.latest_invoice?.payment_intent;return{subscription:W,paymentIntent:K}},async cancelSubscription(X,J,Y={}){let{manageSubscription:Q}=await import("@stacksjs/payments");return{subscription:await Q.cancel(J,Y)}},async activeSubscription(X){let{manageSubscription:J}=await import("@stacksjs/payments"),Y=await $.selectFrom("subscriptions").where("user_id","=",X.id).where("provider_status","=","active").selectAll().executeTakeFirst();if(Y){let Q=await J.retrieve(X,Y.provider_id||"");return{subscription:Y,providerSubscription:Q}}return},async checkout(X,J,Y={}){let{manageCheckout:Q,manageCustomer:G}=await import("@stacksjs/payments"),W={};if(Y.enableTax)W.automatic_tax={enabled:!0},delete Y.enableTax;if(Y.allowPromotions)W.allow_promotion_codes=!0,delete Y.allowPromotions;let V={...{mode:"payment",customer:(await G.createOrGetStripeUser(X,{})).id,line_items:J.map((z)=>({price:z.priceId,quantity:z.quantity||1}))},...W,...Y};return await Q.create(X,V)},async createSetupIntent(X,J={}){let{manageSetupIntent:Y}=await import("@stacksjs/payments");return await Y.create(X,J)},async subscriptionHistory(X){let{manageInvoice:J}=await import("@stacksjs/payments");return await J.list(X)},async transactionHistory(X){let{manageTransaction:J}=await import("@stacksjs/payments");return await J.list(X)},async connectAccount(X,J={}){let Y=J.accountColumn||"stripe_account_id",Q=(X._attributes??X)[Y];if(!Q)return null;let G=await a6();try{return await G.accounts.retrieve(Q)}catch{return null}},async createConnectAccount(X,J={}){let Y=J.accountColumn||"stripe_account_id",Q=X._attributes??X,G=Q[Y],W=await a6();if(!G){let{stacksIdempotencyKey:H}=await import("@stacksjs/payments"),K=J.modelTable||Z,V=await W.accounts.create({type:J.type??"express",email:J.email??Q.email,country:J.country??"US",capabilities:J.capabilities??{card_payments:{requested:!0},transfers:{requested:!0}}},{idempotencyKey:H("connect.account.create",K,Q.id)});return G=V.id,await $.updateTable(K).set({[Y]:G}).where("id","=",Number(Q.id)).execute(),V}return await W.accounts.retrieve(G)},async connectOnboardLink(X,J){let Y=J.accountColumn||"stripe_account_id",G=(X._attributes??X)[Y];if(!G)throw Error("connectOnboardLink: model has no Stripe Connect account; call createConnectAccount first");return{url:(await(await a6()).accountLinks.create({account:G,refresh_url:J.refreshUrl,return_url:J.returnUrl,type:J.type??"account_onboarding"})).url,accountId:G}},async syncConnectStatus(X,J={}){let Y=J.accountColumn||"stripe_account_id",Q=J.chargesColumn||"charges_enabled",G=J.payoutsColumn||"payouts_enabled",W=X._attributes??X,H=W[Y];if(!H)return{chargesEnabled:!1,payoutsEnabled:!1};let V=await(await a6()).accounts.retrieve(H),z=!!V.charges_enabled,O=!!V.payouts_enabled,w=J.modelTable||Z;return await $.updateTable(w).set({[Q]:z,[G]:O}).where("id","=",Number(W.id)).execute(),{chargesEnabled:z,payoutsEnabled:O}},async chargeWithSplit(X,J){let Y=await a6(),Q=J.accountColumn||"stripe_account_id",G=X._attributes??X,W=J.connectAccountId||G[Q],H={amount:J.amountCents,currency:J.currency||"usd",automatic_payment_methods:{enabled:!0},metadata:J.metadata};if(W){if(H.transfer_data={destination:W},J.platformFeeCents)H.application_fee_amount=J.platformFeeCents}let{freshIdempotencyKey:K}=await import("@stacksjs/payments");return await Y.paymentIntents.create(H,{idempotencyKey:K("payment_intent.create",G.id,J.amountCents)})}}}async function a6(){let Z=globalThis.process?.env?.STRIPE_SECRET_KEY;if(!Z)throw Error("Stripe Connect: STRIPE_SECRET_KEY not configured");return new(await Promise.resolve().then(() => (F7(),_7))).default(Z,{apiVersion:"2026-06-24.dahlia"})}function x7(){return{async generateTwoFactorForModel(Z){let{generateTwoFactorSecret:$}=await import("@stacksjs/auth"),X=$();await Z.update({two_factor_secret:X})},async verifyTwoFactorCode(Z,$){let X=Z.get("two_factor_secret");if(typeof X!=="string")return!1;let{verifyTwoFactorCode:J,RateLimiter:Y}=await import("@stacksjs/auth"),Q=String(Z.id??Z.get?.("id")??Z.get?.("email")??X),G=`2fa:${Q}`;if(await Y.isRateLimited(G)){let{HttpError:H}=await import("@stacksjs/error-handling");throw new H(429,"Too many verification attempts. Please try again later.")}if(!await J($,X))return await Y.recordFailedAttempt(G),!1;try{let{cache:H}=await import("@stacksjs/cache"),K=`2fa:used:${Q}:${$}`;if(await H.has(K))return await Y.recordFailedAttempt(G),!1;await H.set(K,"1",90)}catch{}return await Y.resetAttempts(G),!0}}}import{sqlDateTime as xX}from"@stacksjs/database";import{log as G0}from"@stacksjs/logging";var N8="deleted_at";function T7(Z,$="id"){return{async softDelete(X){let J=xX(),Y=Z.where($,X);if(typeof Y?.update==="function")return await Y.update({[N8]:J}),!0;return!1},async restore(X){let J=Z.where($,X);if(typeof J?.update==="function")return await J.update({[N8]:null}),!0;return!1},async forceDelete(X){let J=Z.where($,X);if(typeof J?.delete==="function")return await J.delete(),!0;return!1},withTrashed(){return typeof Z.query==="function"?Z.query():Z},onlyTrashed(){let X=typeof Z.query==="function"?Z.query():Z;if(typeof X?.whereNotNull==="function")return X.whereNotNull(N8);return X?.where?.(N8,"!=",null)??X}}}function U7(Z){if(Z===!0||Z==null)return{};if(typeof Z==="object"&&!Array.isArray(Z)){let $=Z;if(Array.isArray($.cascade)){let X=$.cascade.filter((J)=>typeof J==="string");return X.length?{cascade:X}:{}}return{}}return{}}function TX(Z,$){let X=Z.hasMany??[],J=Z.hasOne??[],Y=X.some((V)=>S$(V,$,!0)),Q=J.some((V)=>S$(V,$,!1));if(!Y&&!Q)return G0.warn(`[orm] soft-delete cascade: '${$}' is not a declared hasMany/hasOne relation \u2014 skipping`),null;let W=(Y?X:J).find((V)=>S$(V,$,Y))??null;if(!W)return null;let K=globalThis[W];if(!K)return G0.warn(`[orm] soft-delete cascade: model '${W}' is not yet on globalThis \u2014 skipping cascade for '${$}'`),null;return{className:W,model:K}}function S$(Z,$,X){let J=Z.toLowerCase();if($===J)return!0;if(X&&$===`${J}s`)return!0;if(X&&J.endsWith("y")&&$===`${J.slice(0,-1)}ies`)return!0;return!1}async function UX(Z,$,X,J,Y){try{let Q=X.where;if(typeof Q!=="function"){G0.warn(`[orm] cascade ${Y}: child model has no .where()`);return}if(Y==="softDelete"){let G=X.softDelete;if(typeof G==="function"){let H=Q.call(X,J,$),K=typeof H?.get==="function"?await H.get():Array.isArray(H)?H:[],V=X.primaryKey||"id";for(let z of K){let O=z?.[V];if(O!=null)await G.call(X,O)}return}let W=Q.call(X,J,$);if(typeof W?.delete==="function"){G0.debug(`[orm] cascade soft-delete: child has no softDeletes trait, hard-deleting from ${String(X.table??"?")}`),await W.delete();return}}else{let G=X.restore;if(typeof G!=="function"){G0.debug("[orm] cascade restore: child has no restore() \u2014 nothing to do");return}let W=X.withTrashed,K=(typeof W==="function"?W.call(X):X).where?.(J,$),V=typeof K?.get==="function"?await K.get():[],z=X.primaryKey||"id";for(let O of V){let w=O?.[z];if(w!=null)await G.call(X,w)}}}catch(Q){if(G0.warn(`[orm] soft-delete cascade ${Y} on ${Z}#${String($)} failed`,{error:Q}),process.env.STACKS_ORM_CASCADE_SWALLOW!=="true")throw Q}}async function e6(Z,$,X,J){let Y=$.cascade;if(!Y||Y.length===0)return;let Q=`${Z.name.toLowerCase()}_id`;for(let G of Y){let W=TX(Z,G);if(!W)continue;await UX(W.className,X,W.model,Q,J)}}var k7=new N7;function o(){return k7.getStore()?.suppressed===!0}function s(Z){return Promise.resolve(k7.run({suppressed:!0},Z))}var I7=new N7;function DX(){return I7.getStore()?.suppressed===!0}function AX(Z){return Promise.resolve(I7.run({suppressed:!0},Z))}var v$=Symbol.for("stacks.orm.modelDefinition");class j7 extends Error{status=422;errors;constructor(Z,$){let X=Object.keys($).join(", ");super(`${Z} validation failed: ${X}`);this.name="ModelValidationError",this.errors=$}}var q7=new Set;function EX(Z,$){let X=typeof Z==="string"?Z.slice(0,80):String(Z),J=`${typeof Z}:${X}`;if(q7.has(J))return;q7.add(J);let Y=$ instanceof Error?$.message:String($);console.error(`[orm] JSON cast failed to parse value (returning null): ${Y} \u2014 value preview: ${JSON.stringify(X)}`)}var CX={string:{get:(Z)=>Z!=null?String(Z):null,set:(Z)=>Z!=null?String(Z):null},number:{get:(Z)=>Z!=null?Number(Z):null,set:(Z)=>Z!=null?Number(Z):null},integer:{get:(Z)=>Z!=null?Math.trunc(Number(Z)):null,set:(Z)=>Z!=null?Math.trunc(Number(Z)):null},float:{get:(Z)=>Z!=null?Number.parseFloat(String(Z)):null,set:(Z)=>Z!=null?Number.parseFloat(String(Z)):null},boolean:{get:(Z)=>Z===1||Z==="1"||Z===!0||Z==="true",set:(Z)=>Z===!0||Z===1||Z==="1"||Z==="true"?1:0},json:{get:(Z)=>{if(Z==null)return null;if(typeof Z==="string")try{return JSON.parse(Z)}catch($){return EX(Z,$),null}return Z},set:(Z)=>{if(Z==null)return null;return typeof Z==="string"?Z:JSON.stringify(Z)}},datetime:{get:(Z)=>Z?new Date(Z):null,set:(Z)=>Z instanceof Date?Z.toISOString():Z},date:{get:(Z)=>Z?new Date(Z):null,set:(Z)=>Z instanceof Date?Z.toISOString().split("T")[0]:Z},array:{get:(Z)=>{if(Z==null)return[];if(Array.isArray(Z))return Z;if(typeof Z==="string")try{return JSON.parse(Z)}catch{return[]}return[]},set:(Z)=>{if(Z==null)return null;return Array.isArray(Z)?JSON.stringify(Z):Z}}};function S7(Z){return typeof Z==="string"?CX[Z]:Z}function L7(Z,$,X){if(!Z||typeof Z!=="object")return Z;let J={...Z};for(let[Y,Q]of Object.entries($))if(Y in J){let G=S7(Q);J[Y]=G[X](J[Y])}return J}var k8=new Set(["_attributes","_original","_definition","_hasSaved","_relations"]),D7=Symbol.for("stacks.modelInstanceProxy"),PX={tags:{bag:"_taggable",mode:"id"},tagCount:{bag:"_taggable",mode:"id"},addTag:{bag:"_taggable",mode:"id"},activeTags:{bag:"_taggable",mode:"id"},inactiveTags:{bag:"_taggable",mode:"id"},removeTag:{bag:"_taggable",mode:"id"},categories:{bag:"_categorizable",mode:"id"},categoryCount:{bag:"_categorizable",mode:"id"},addCategory:{bag:"_categorizable",mode:"id"},activeCategories:{bag:"_categorizable",mode:"id"},inactiveCategories:{bag:"_categorizable",mode:"id"},removeCategory:{bag:"_categorizable",mode:"id"},comments:{bag:"_commentable",mode:"id"},commentCount:{bag:"_commentable",mode:"id"},addComment:{bag:"_commentable",mode:"id"},approvedComments:{bag:"_commentable",mode:"id"},pendingComments:{bag:"_commentable",mode:"id"},rejectedComments:{bag:"_commentable",mode:"id"},likes:{bag:"_likeable",mode:"id"},likeCount:{bag:"_likeable",mode:"id"},like:{bag:"_likeable",mode:"id"},unlike:{bag:"_likeable",mode:"id"},isLiked:{bag:"_likeable",mode:"id"},createStripeUser:{bag:"_billable",mode:"model"},updateStripeUser:{bag:"_billable",mode:"model"},deleteStripeUser:{bag:"_billable",mode:"model"},createOrGetStripeUser:{bag:"_billable",mode:"model"},retrieveStripeUser:{bag:"_billable",mode:"model"},defaultPaymentMethod:{bag:"_billable",mode:"model"},setDefaultPaymentMethod:{bag:"_billable",mode:"model"},addPaymentMethod:{bag:"_billable",mode:"model"},paymentMethods:{bag:"_billable",mode:"model"},newSubscription:{bag:"_billable",mode:"model"},updateSubscription:{bag:"_billable",mode:"model"},cancelSubscription:{bag:"_billable",mode:"model"},activeSubscription:{bag:"_billable",mode:"model"},checkout:{bag:"_billable",mode:"model"},createSetupIntent:{bag:"_billable",mode:"model"},subscriptionHistory:{bag:"_billable",mode:"model"},transactionHistory:{bag:"_billable",mode:"model"},connectAccount:{bag:"_billable",mode:"model"},createConnectAccount:{bag:"_billable",mode:"model"},connectOnboardLink:{bag:"_billable",mode:"model"},syncConnectStatus:{bag:"_billable",mode:"model"},chargeWithSplit:{bag:"_billable",mode:"model"},generateTwoFactorForModel:{bag:"_twoFactor",mode:"model"},verifyTwoFactorCode:{bag:"_twoFactor",mode:"model"}};function NX(Z,$){if(!Z||!$)return null;let X=$.split("."),J=Z;for(let Y of X){if(J==null||typeof J!=="object")return null;let Q=J;if("_attributes"in Q&&Q._attributes&&typeof Q._attributes==="object"){let G=Q._attributes;if(Y in G){J=G[Y];continue}}if(Y in Q){J=Q[Y];continue}return null}return J??null}function R(Z,$){if(!Z||typeof Z!=="object")return Z;if(Z[D7])return Z;let X=Z._attributes;if(!X||typeof X!=="object")return Z;if($&&Object.keys($).length>0){for(let[J,Y]of Object.entries($))if(Object.prototype.hasOwnProperty.call(X,J))X[J]=S7(Y).get(X[J])}return new Proxy(Z,{get(J,Y,Q){if(Y===D7)return!0;if(Y==="saveAsync")return async function(){let W=J._definition,H=W?.set;if(H&&typeof J.isDirty==="function"){for(let[V,z]of Object.entries(H)){if(typeof z!=="function")continue;if(!J.isDirty(V))continue;let O=z(J._attributes),w=O&&typeof O.then==="function"?await O:O;J._attributes[V]=w}let K=W.set;W.set={};try{return J.save()}finally{W.set=K}}return J.save()};if(Y==="save")return function(){let W=J._definition,H=W?.set;if(H&&Object.keys(H).length>0&&typeof J.isDirty==="function"){for(let[V,z]of Object.entries(H)){if(typeof z!=="function")continue;if(!J.isDirty(V))continue;let O=z(J._attributes);if(O&&typeof O.then==="function")throw Error(`Setter for "${V}" returned a Promise \u2014 use \`saveAsync()\` instead of \`save()\` when a model has async setters.`);J._attributes[V]=O}let K=W.set;W.set={};try{return J.save()}finally{W.set=K}}return J.save()};if(Y==="updateAsync")return async function(W){if(W&&typeof W==="object"&&!Array.isArray(W))for(let[H,K]of Object.entries(W))Q[H]=K;return Q.saveAsync()};if(Y==="saveQuietly")return function(){return s(()=>J.save())};if(Y==="saveAsyncQuietly")return function(){return s(()=>Q.saveAsync())};if(Y==="updateQuietly")return function(W){return s(()=>J.update(W))};if(Y==="updateAsyncQuietly")return function(W){return s(()=>Q.updateAsync(W))};if(Y==="deleteQuietly")return function(){return s(()=>J.delete())};if(Y==="toSearchableObject")return function(){let K=J._definition?.traits?.useSearch;if(!K)return null;let V=J._attributes;if(!V)return null;if(K===!0){let U={...V};if(V.id!=null)U.id=String(V.id);return U}let z={},O=K.displayable?.length?K.displayable:[...K.searchable??[],...K.filterable??[],...K.sortable??[],"id"],w=K.denormalize??{},x=J._relations;for(let U of O){let q=$8(U),L=V[q]??V[U];if(L!==void 0){z[q]=L;continue}let E=w[U]??w[q];if(E){z[q]=NX(x,E);continue}z[q]=void 0}if(V.id!=null)z.id=String(V.id);return z};if(typeof Y==="string"&&!k8.has(Y)){let W=J._attributes;if(W&&Object.prototype.hasOwnProperty.call(W,Y))return W[Y];let H=J._relations;if(H&&Object.prototype.hasOwnProperty.call(H,Y)){let V=H[Y];if(Array.isArray(V))return V.map((z)=>R(z,$));return R(V,$)}let K=PX[Y];if(K){let O=J._definition?.__traitMethods?.[K.bag]?.[Y];if(typeof O==="function")return K.mode==="model"?(...w)=>O(Q,...w):(...w)=>O(J.id,...w)}}let G=Reflect.get(J,Y,J);return typeof G==="function"?G.bind(J):G},set(J,Y,Q,G){if(typeof Y==="string"&&!k8.has(Y)){let{_attributes:W,set:H}=J;if(W&&Object.prototype.hasOwnProperty.call(W,Y)){if(typeof H==="function")H.call(J,Y,Q);else W[Y]=Q;return!0}if(W&&!(Y in J)){if(typeof H==="function")H.call(J,Y,Q);else W[Y]=Q;return!0}}return Reflect.set(J,Y,Q,G)},has(J,Y){if(typeof Y==="string"&&!k8.has(Y)){let Q=J._attributes;if(Q&&Object.prototype.hasOwnProperty.call(Q,Y))return!0;let G=J._relations;if(G&&Object.prototype.hasOwnProperty.call(G,Y))return!0}return Reflect.has(J,Y)},deleteProperty(J,Y){if(typeof Y==="string"&&!k8.has(Y)){let Q=J._attributes;if(Q&&Object.prototype.hasOwnProperty.call(Q,Y))return delete Q[Y],!0}return Reflect.deleteProperty(J,Y)},ownKeys(J){let Y=J._attributes;return Y?Object.keys(Y):[]},getOwnPropertyDescriptor(J,Y){if(typeof Y==="string"){let Q=J._attributes;if(Q&&Object.prototype.hasOwnProperty.call(Q,Y))return{configurable:!0,enumerable:!0,value:Q[Y],writable:!0}}return Object.getOwnPropertyDescriptor(J,Y)}})}var kX=new Set(["get","first","last","firstOrFail","find","findOrFail","all","paginate","simplePaginate","cursorPaginate"]),IX={paginate:s8,simplePaginate:o8,cursorPaginate:a8},A7=Symbol.for("stacks.queryBuilderProxy");function M7(Z,$){if(!Z||typeof Z!=="object")return Z;if(Z[A7])return Z;return new Proxy(Z,{get(X,J,Y){if(J===A7)return!0;let Q=Reflect.get(X,J,Y);if(typeof Q!=="function")return Q;return function(...G){let W=G,H=String(J);if(H==="paginate"||H==="simplePaginate"){let{perPage:z,page:O}=Z9(G[0],G[1]);W=[z,O]}else if(H==="cursorPaginate"){let{perPage:z,cursor:O}=$9(G[0],G[1]);W=[z,O,G[2],G[3]]}let K=Q.apply(X,W),V=(z)=>{if(kX.has(H)){if(Array.isArray(z))return z.map((w)=>R(w,$));let O=IX[H];if(O&&z&&Array.isArray(z.data)){let w=z.data.map((U)=>R(U,$)),x=O({...z,data:w});return X9(x)}if(z&&Array.isArray(z.data))return{...z,data:z.data.map((w)=>R(w,$))};return R(z,$)}if(z&&typeof z==="object"&&typeof z.get==="function")return M7(z,$);return z};if(K&&typeof K.then==="function")return K.then(V);return V(K)}}})}function jX(Z,$){let X=["find","first","last","all","firstOrFail","findOrFail","findMany"];for(let Q of X){let G=Z[Q];if(typeof G!=="function")continue;Z[Q]=function(...W){let H=G.apply(this,W),K=(V)=>Array.isArray(V)?V.map((z)=>R(z,$)):R(V,$);if(H&&typeof H.then==="function")return H.then(K);return K(H)}}let J=["create","firstOrCreate","updateOrCreate","make"];for(let Q of J){let G=Z[Q];if(typeof G!=="function")continue;Z[Q]=function(...W){let H=G.apply(this,W),K=(V)=>Array.isArray(V)?V.map((z)=>R(z,$)):R(V,$);if(H&&typeof H.then==="function")return H.then(K);return K(H)}}let Y=["query","where","orWhere","whereIn","whereNotIn","whereNull","whereNotNull","whereLike","whereBetween","whereNotBetween","orderBy","orderByDesc","select","with","limit","take","skip","latest","oldest"];for(let Q of Y){let G=Z[Q];if(typeof G!=="function")continue;Z[Q]=function(...W){let H=G.apply(this,W);return M7(H,$)}}}class f7 extends Error{model;id;constructor(Z,$){super($!=null?`[ORM] ${Z} not found for id=${String($)}`:`[ORM] No matching ${Z} row`);this.name="ModelNotFoundError",this.model=Z,this.id=$}}class f$ extends Error{model;attribute;reason;constructor(Z,$,X){let J=X==="guarded"?`'${$}' is marked guarded`:`'${$}' is not in the fillable allowlist`;super(`[ORM] Mass assignment to ${Z} forbidden: ${J}. Use ${Z}.forceCreate(...) / .forceUpdate(...) to bypass.`);this.name="MassAssignmentException",this.model=Z,this.attribute=$,this.reason=X}}var SX=new Set(["id","created_at","updated_at","deleted_at","uuid"]);function Z8(Z,$,X={}){if(X.force)return $;if(!$||typeof $!=="object"||Array.isArray($))return $;let J=Z.attributes;if(!J)return $;let Y=new Set,Q=new Set,G=new Set;for(let[H,K]of Object.entries(J)){let V=$8(H);if(Y.add(V),K?.fillable===!0)Q.add(V);if(K?.guarded===!0)G.add(V)}let W=Q.size>0?Q:Y;for(let H of Object.keys($)){let K=$8(H);if(SX.has(K))continue;if(G.has(K))throw new f$(Z.name,H,"guarded");if(K.endsWith("_id"))continue;if(!W.has(K))throw new f$(Z.name,H,"not-fillable")}return $}async function y$(Z,$){let X=Z.set;if(!X||typeof X!=="object")return $;let J={...$};for(let[Y,Q]of Object.entries(X)){if(typeof Q!=="function"||!(Y in J))continue;try{J[Y]=await Q(J)}catch(G){f.error(`[orm] ${Z.name}.set.${Y} threw \u2014 skipping setter`,G)}}return J}function MX(Z,$){let X=$.primaryKey||"id",J=Z.create;function Y(K){let V=Z.where;if(typeof V!=="function")throw Error(`[ORM] ${$.name}.${K} needs a working where(): the underlying query builder did not expose one`);return V}function Q(K){let V=Z.find;if(typeof V!=="function")throw Error(`[ORM] ${$.name}.${K} needs a working find(): the underlying query builder did not expose one`);return V}function G(K){let V=Z.create;if(typeof V!=="function")throw Error(`[ORM] ${$.name}.${K} cannot create: the underlying query builder did not expose create()`);return V}if(typeof Z.update!=="function")Z.update=async function(K,V){if(K==null)throw Error(`[ORM] ${$.name}.update requires an id as the first argument`);if(!V||typeof V!=="object"||Array.isArray(V))throw Error(`[ORM] ${$.name}.update requires a data object as the second argument`);if(Object.keys(V).length===0){f.debug(`[orm] ${$.name}.update called with empty data \u2014 short-circuiting and returning current row`);let w=Z.find;return typeof w==="function"?await w.call(Z,K):null}Z8($,V);let z=await y$($,V);await Y("update").call(Z,X,K).update(z);let O=Z.find;return typeof O==="function"?await O.call(Z,K):null};if(typeof Z.forceUpdate!=="function")Z.forceUpdate=async function(K,V){if(K==null)throw Error(`[ORM] ${$.name}.forceUpdate requires an id as the first argument`);if(!V||typeof V!=="object"||Array.isArray(V))throw Error(`[ORM] ${$.name}.forceUpdate requires a data object as the second argument`);let z=await y$($,V);await Y("forceUpdate").call(Z,X,K).update(z);let O=Z.find;return typeof O==="function"?await O.call(Z,K):null};if(typeof Z.forceCreate!=="function")Z.forceCreate=async function(K){if(!K||typeof K!=="object"||Array.isArray(K))throw Error(`[ORM] ${$.name}.forceCreate requires a data object`);if(typeof J!=="function")throw Error(`[ORM] ${$.name}.forceCreate cannot create: the underlying query builder did not expose create()`);return await J.call(Z,K)};if(typeof Z.delete!=="function")Z.delete=async function(K){if(K==null)throw Error(`[ORM] ${$.name}.delete requires an id as the first argument`);if(!await Q("delete").call(Z,K))return!1;return await Y("delete").call(Z,X,K).delete(),!0};if(typeof Z.findOrFail!=="function")Z.findOrFail=async function(K){let V=await Q("findOrFail").call(Z,K);if(V==null)throw new f7($.name,K);return V};if(typeof Z.exists!=="function")Z.exists=async function(K){if(K==null)return!1;let V=Y("exists").call(Z,X,K);if(typeof V.count==="function"){let O=await V.count();return Number(O)>0}let z=Z.find;return typeof z==="function"?await z.call(Z,K)!=null:!1};if(typeof Z.firstOrCreate!=="function")Z.firstOrCreate=async function(K,V={}){if(!K||typeof K!=="object"||Array.isArray(K))throw Error(`[ORM] ${$.name}.firstOrCreate requires a where-attrs object`);let z=Y("firstOrCreate").call(Z,K),O=typeof z.first==="function"?await z.first():await z;if(O)return O;let w={...K,...V};return Z8($,w),await G("firstOrCreate").call(Z,w)};if(typeof Z.updateOrCreate!=="function")Z.updateOrCreate=async function(K,V){if(!K||typeof K!=="object"||Array.isArray(K))throw Error(`[ORM] ${$.name}.updateOrCreate requires a where-attrs object`);if(!V||typeof V!=="object"||Array.isArray(V))throw Error(`[ORM] ${$.name}.updateOrCreate requires a values object`);let z=Y("updateOrCreate").call(Z,K),O=typeof z.first==="function"?await z.first():await z;if(O){Z8($,V);let x=O[X];await Y("updateOrCreate").call(Z,X,x).update(V);let U=Z.find;return typeof U==="function"?await U.call(Z,x):{...O,...V}}let w={...K,...V};return Z8($,w),await G("updateOrCreate").call(Z,w)};if(typeof Z.count!=="function")Z.count=async function(){let K=Z;if(typeof K.query==="function"){let O=K.query();if(typeof O?.count==="function"){let w=await O.count();return Number(w)||0}}let{all:V,get:z}=Z;if(typeof V==="function")return(await V.call(Z)||[]).length;if(typeof z==="function")return(await z.call(Z)||[]).length;return 0};if(typeof Z.pluck!=="function")Z.pluck=async function(K){if(!K||typeof K!=="string")throw Error(`[ORM] ${$.name}.pluck requires a column name`);let V=Z.all;return((typeof V==="function"?await V.call(Z):[])||[]).map((O)=>O?.[K])};if(typeof Z.whereIn!=="function")Z.whereIn=async function(K,V){if(!K||typeof K!=="string")throw Error(`[ORM] ${$.name}.whereIn requires a column name`);if(!Array.isArray(V))throw Error(`[ORM] ${$.name}.whereIn requires an array of values`);if(V.length===0)return[];let z=Z.where;if(typeof z!=="function")return[];let O=z.call(Z,K,"in",V);if(O&&typeof O.get==="function")return await O.get();return await O};let W=[["latest","desc"],["oldest","asc"]];for(let[K,V]of W)if(typeof Z[K]!=="function")Z[K]=async function(z="created_at"){let O=Z,w=typeof O.query==="function"?O.query():O;if(typeof w?.orderBy==="function"){let L=w.orderBy(z,V);if(typeof L.first==="function")return await L.first();if(typeof L.get==="function")return(await L.get())?.[0]??null}let x=Z.all;if(typeof x!=="function")return null;return[...await x.call(Z)||[]].sort((L,E)=>{let P=L?.[z],I=E?.[z];if(P===I)return 0;return(P>I?1:-1)*(V==="desc"?-1:1)})[0]??null};let H=h7($.traits?.useSearch,$);if(H){let K=H.index??$.table??$8(`${$.name}s`);if(typeof Z.search!=="function")Z.search=function(V,z){return vX(Z,K,V,z,H.searchable)};if(typeof Z.makeAllSearchable!=="function")Z.makeAllSearchable=async function(V=500){let z=Z.all;if(typeof z!=="function")throw Error(`[ORM] ${$.name}.makeAllSearchable cannot run: the underlying query builder did not expose all()`);let{useSearchEngine:O}=await import("@stacksjs/search-engine"),w=O(),x=0,U=Z.query;if(typeof U==="function")try{let E=U.call(Z);if(E&&typeof E.chunk==="function")return await E.chunk(V,async(P)=>{let I=await h$(P,H);if(I.length>0)await w.addDocuments(K,I);x+=I.length}),x}catch{}let q=await z.call(Z)||[],L=await h$(q,H);if(L.length>0)await w.addDocuments(K,L);return L.length};if(typeof Z.removeAllFromSearch!=="function")Z.removeAllFromSearch=async function(){let{useSearchEngine:V}=await import("@stacksjs/search-engine"),z=V();if(typeof z.deleteAllDocuments==="function"){await z.deleteAllDocuments(K);return}let O=Z.all,w=typeof O==="function"?await O.call(Z)||[]:[],x=V();for(let U of w){let q=U?.id??U?._attributes?.id;if(q!=null)await x.deleteDocument(K,Number(q))}}}}async function h$(Z,$){if(Z.length===0)return[];if(typeof $.shapeMany==="function"){let J=await $.shapeMany(Z);if(!Array.isArray(J)||J.length!==Z.length)throw TypeError(`[orm/search] shapeMany returned ${Array.isArray(J)?J.length:typeof J} documents for ${Z.length} rows. It must return one document per row, in order, or documents are indexed under the wrong ids.`);return J.filter(Boolean)}return(await Promise.all(Z.map((J)=>hX(J,$)))).filter(Boolean)}function fX(Z){let $=new Set,X=Z.attributes??{};for(let[J,Y]of Object.entries(X))if(Y?.hidden)$.add(J);return $}function yX(Z,$){if(!Z||$.size===0)return Z;let X={};for(let[J,Y]of Object.entries(Z))if(!$.has(J))X[J]=Y;return X}async function hX(Z,$){if(typeof $.shape==="function")try{return await $.shape(Z)}catch{return}let X=Z?.toSearchableObject?.();if(X!==void 0)return X;return yX(Z?._attributes??(typeof Z?.toJSON==="function"?Z.toJSON():null),$.hidden??new Set)}function vX(Z,$,X,J,Y){let Q=Y&&Y.length>0?{query_by:[...Y].join(",")}:{},G={q:X,...Q,...J??{}},W={with(H){return G={...G,...H},W},where(H){return G={...G,filter:H},W},async get(){let{useSearchEngine:H}=await import("@stacksjs/search-engine");return(await H().search($,G))?.hits??[]},async paginate(H,K=1){let{useSearchEngine:V}=await import("@stacksjs/search-engine"),O=await V().search($,{...G,limit:H,offset:(K-1)*H});return{hits:O.hits??[],total:Number(O.estimatedTotalHits??O.nbHits??O.total??0),page:K,perPage:H}},async raw(){let{useSearchEngine:H}=await import("@stacksjs/search-engine");return await H().search($,G)}};return W}async function M$(Z,$){if(!Z||typeof Z!=="object")return;let X=Z._attributes??Z;for(let J of $){if(!(J in X))continue;let Y=X[J];if(!K0(Y))continue;X[J]=await f8(Y)}}function RX(Z,$){if($.length===0)return;let X=async(G)=>{if(Array.isArray(G)){for(let W of G)await M$(W,$);return G}if(G&&typeof G==="object"&&Array.isArray(G.data)){for(let W of G.data)await M$(W,$);return G}if(G)await M$(G,$);return G},J=["find","first","last","all","firstOrFail","findOrFail","findMany"];for(let G of J){let W=Z[G];if(typeof W!=="function")continue;Z[G]=async function(...H){let K=await W.apply(this,H);return await X(K)}}let Y=["create","firstOrCreate","updateOrCreate","make"];for(let G of Y){let W=Z[G];if(typeof W!=="function")continue;Z[G]=async function(...H){let K=await W.apply(this,H);return await X(K)}}let Q=Z.update;if(typeof Q==="function")Z.update=async function(G,W){let H=await Q.call(this,G,W);return await X(H)}}function bX(Z,$){if($.length===0)return;let X=async(Q)=>{if(!Q||typeof Q!=="object"||Array.isArray(Q))return Q;let G={...Q};for(let W of $)if(W in G)G[W]=await M8(G[W]);return G},J=["create","firstOrCreate","updateOrCreate"];for(let Q of J){let G=Z[Q];if(typeof G!=="function")continue;Z[Q]=async function(...W){if(W[0]=await X(W[0]),W[1])W[1]=await X(W[1]);return await G.apply(this,W)}}let Y=Z.update;if(typeof Y==="function")Z.update=async function(Q,G){let W=await X(G);return await Y.call(this,Q,W)}}function gX(Z,$){let X=Z.create;if(typeof X==="function")Z.create=async function(J,...Y){Z8($,J);let Q=await y$($,J);return await X.call(this,Q,...Y)};for(let J of["firstOrCreate","updateOrCreate"]){let Y=Z[J];if(typeof Y!=="function")continue}}function uX(Z,$){let X=String($?.name??Z.name??"Model"),J=(G,W)=>{if(DX())return;if(!G||typeof G!=="object"||Array.isArray(G))return;let H=t$(G,$,W);if(!H.valid)throw new j7(X,H.errors)},Y=Z.create;if(typeof Y==="function")Z.create=async function(G,...W){return J(G,"creating"),await Y.call(this,G,...W)};let Q=Z.update;if(typeof Q==="function")Z.update=async function(G,W,...H){return J(W,"updating"),await Q.call(this,G,W,...H)}}function cX(Z,$){let X=["create","firstOrCreate","updateOrCreate"];for(let Y of X){let Q=Z[Y];if(typeof Q==="function")Z[Y]=async function(...G){if(f.debug(`[orm] ${Y.charAt(0).toUpperCase()+Y.slice(1)} ${String(Z.name||"unknown")}`,G[0]),G[0]&&typeof G[0]==="object"&&!Array.isArray(G[0]))G[0]=L7(G[0],$,"set");return await Q.apply(this,G)}}let J=Z.update;if(typeof J==="function")Z.update=async function(Y,Q){let G=Q&&typeof Q==="object"&&!Array.isArray(Q)?L7(Q,$,"set"):Q;return await J.call(this,Y,G)}}function y7(Z){f.debug(`[orm] Defining model: ${Z.name} (table: ${Z.table})`);let $=mX(Z),X=dX(Z),J=lX($,X),Y=nX(Z);Z.__traitMethods=Y;let Q=J?{...Z,hooks:{...Z.hooks,...J}}:Z,W=qX(Q);if(jX(W,Z.casts),MX(W,Q),gX(W,Q),Z.casts&&Object.keys(Z.casts).length>0)cX(W,Z.casts);let H=y8(Z);if(H.length>0)bX(W,H),RX(W,H);let K=Z.traits?.useSoftDeletes;if(K)pX(W,Q,K);let V=Z.traits?.useAudit;if(V){let O=d$(V);n$(W,Z.name,Z.primaryKey||"id",O)}uX(W,Q),W.withoutValidation=function(O){return AX(O)},W.withoutEvents=function(O){return s(O)};for(let O of["create","update","firstOrCreate","updateOrCreate","forceCreate","forceUpdate","delete","forceDelete","softDelete","restore"]){let w=W[O];if(typeof w!=="function")continue;let x=`${O}Quietly`;if(typeof W[x]==="function")continue;W[x]=function(...U){return s(()=>w.apply(W,U))}}let z=Object.assign(W,Y,{...Z,getDefinition:()=>Z,_isStacksModel:!0});return LX(Z.name,z),Object.defineProperty(z,v$,{value:Z,enumerable:!1,configurable:!0}),z}function mX(Z){let $=Z.traits?.observe;if(!$)return;let X=Z.name.toLowerCase(),J=(O)=>{let w=O?.attributes;if(!w||typeof w!=="object")return O;let x=Z.primaryKey||"id",U={...w};if(U[x]===void 0&&O[x]!==void 0)U[x]=O[x];return U},Y=async(O,w)=>{if(o())return;try{let{dispatch:x}=await import("@stacksjs/events");await x(O,w)}catch(x){if(x&&typeof x==="object"&&"code"in x&&x.code==="MODULE_NOT_FOUND")return;if(console.error(`[ORM] Event '${O}' handler error:`,x),process.env.STACKS_ORM_EVENT_ERRORS!=="swallow")throw x}},Q=Z.traits?.broadcastOn,G=Z.traits?.broadcastWith,W=typeof Q==="function"&&typeof G==="function",H=async(O,w)=>{if(!W)return;if(o())return;try{let x=Q(w),U=Array.isArray(x)?x:[x],q=G(w),E=(await import("@stacksjs/realtime").catch(()=>null))?.broadcast;if(typeof E!=="function")return;for(let P of U){if(typeof P!=="string"||P.length===0)continue;await E(P,O,q)}}catch(x){if(x&&typeof x==="object"&&"code"in x&&x.code==="MODULE_NOT_FOUND")return;if(console.error(`[ORM] Broadcast '${O}' handler error:`,x),process.env.STACKS_ORM_BROADCAST_ERRORS==="throw")throw x}},K=async(O,w)=>{if(o())return!0;try{let{dispatchAsync:x}=await import("@stacksjs/events"),U=await x(O,w);if(Array.isArray(U)&&U.some((q)=>q===!1))return!1}catch(x){if(x&&typeof x==="object"&&"code"in x&&x.code==="MODULE_NOT_FOUND")return!0;if(console.error(`[ORM] Before-event '${O}' handler error:`,x),process.env.STACKS_ORM_EVENT_ERRORS!=="swallow")throw x}return!0},V=$===!0?["create","update","delete"]:Array.isArray($)?$:[],z={};if(V.includes("create"))z.beforeCreate=async(O)=>{if(f.debug(`[orm] Create ${X}`,O),!await K(`${X}:saving`,O))throw Error(`[ORM] ${X}:saving event cancelled the operation`);if(!await K(`${X}:creating`,O))throw Error(`[ORM] ${X}:creating event cancelled the operation`)},z.afterCreate=async(O)=>{let w=J(O);await Y(`${X}:created`,w),await Y(`${X}:saved`,w),await H(`${X}:created`,O)};if(V.includes("update"))z.beforeUpdate=async(O)=>{if(f.debug(`[orm] Update ${X}#${O?.id??"unknown"}`,O),!await K(`${X}:saving`,O))throw Error(`[ORM] ${X}:saving event cancelled the operation`);if(!await K(`${X}:updating`,O))throw Error(`[ORM] ${X}:updating event cancelled the operation`)},z.afterUpdate=async(O)=>{let w=J(O);await Y(`${X}:updated`,w),await Y(`${X}:saved`,w),await H(`${X}:updated`,O)};if(V.includes("delete"))z.beforeDelete=async(O)=>{if(f.debug(`[orm] Delete ${X}#${O?.id??"unknown"}`),!await K(`${X}:deleting`,O))throw Error(`[ORM] ${X}:deleting event cancelled the operation`)},z.afterDelete=async(O)=>{await Y(`${X}:deleted`,J(O)),await H(`${X}:deleted`,O)};return z}function lX(...Z){let $={},X=new Set;for(let J of Z){if(!J)continue;for(let Y of Object.keys(J))X.add(Y)}for(let J of X){let Y=Z.map((Q)=>Q?.[J]).filter((Q)=>typeof Q==="function");if(!Y.length)continue;$[J]=async(...Q)=>{for(let G of Y)await G(...Q)}}return Object.keys($).length?$:void 0}function h7(Z,$){if(!Z)return null;let X=Z===!0?{}:typeof Z==="object"?{...Z}:null;if(!X)return null;if($)X.hidden=fX($);return X}function dX(Z){let $=h7(Z.traits?.useSearch,Z);if(!$)return;let X=$,J=X.index??Z.table??$8(`${Z.name}s`);async function Y(W){if(typeof X.shapeMany==="function")try{let[V]=await h$([W],X);return V}catch(V){f.warn(`[orm/search] shapeMany() threw for ${Z.name}: ${V.message}`);return}if(typeof X.shape==="function")try{return await X.shape(W)}catch(V){f.warn(`[orm/search] shape() threw for ${Z.name}: ${V.message}`);return}let K=R(W).toSearchableObject?.();if(K!==void 0)return K;return W?._attributes??(typeof W?.toJSON==="function"?W.toJSON():null)}let Q=async(W)=>{if(o())return;let H=await Y(W);if(!H)return;if($.queueable){try{let{Jobs:K}=await import("@stacksjs/queue");await K.dispatch("SyncSearchIndex",{index:J,op:"upsert",doc:H})}catch(K){f.warn(`[orm/search] queue dispatch failed for ${Z.name}; falling back to inline: ${K.message}`),await C7(J,H,Z.name)}return}await C7(J,H,Z.name)};return{afterCreate:Q,afterUpdate:Q,afterDelete:async(W)=>{if(o())return;let H=W?.id??W?._attributes?.id;if(H==null)return;if($.queueable){try{let{Jobs:K}=await import("@stacksjs/queue");await K.dispatch("SyncSearchIndex",{index:J,op:"delete",id:Number(H)})}catch(K){f.warn(`[orm/search] queue dispatch failed for ${Z.name}#${H}; falling back to inline: ${K.message}`),await P7(J,Number(H),Z.name)}return}await P7(J,Number(H),Z.name)}}}var E7=new Map;function v7(Z,$){let X=E7.get(Z)??0;if(E7.set(Z,X+1),X===0)f.warn(`[orm/search] ${$}`);else if(X===9)f.warn(`[orm/search] ${Z} is still failing; further identical warnings suppressed for this process.`)}async function C7(Z,$,X){try{let{useSearchEngine:J}=await import("@stacksjs/search-engine");await J().addDocument(Z,$)}catch(J){v7(`index:${X}`,`Failed to index ${X}: ${J.message}`)}}async function P7(Z,$,X){try{let{useSearchEngine:J}=await import("@stacksjs/search-engine");await J().deleteDocument(Z,$)}catch(J){v7(`remove:${X}`,`Failed to remove ${X}#${$}: ${J.message}`)}}function nX(Z){let $={},X=Z.table,J=Z.traits;if(!J)return $;if(J.taggable)$._taggable=c8(X);if(J.categorizable)$._categorizable=m8(X);if(J.commentable)$._commentable=g8(X);if(J.billable)$._billable=w7(X);if(J.likeable){let Q=typeof J.likeable==="object"?J.likeable:void 0;$._likeable=l8(X,Q)}let Y=J.useAuth||J.authenticatable;if(typeof Y==="object"&&Y&&"useTwoFactor"in Y&&Y.useTwoFactor)$._twoFactor=x7();return $}function pX(Z,$,X){let J=T7(Z,$.primaryKey||"id"),Y=U7(X),Q=$,G=$.name.toLowerCase(),W=$.traits?.observe!=null&&$.traits?.observe!==!1,H=async(w)=>{if(!W||o())return!0;try{let{dispatchAsync:x}=await import("@stacksjs/events"),U=await x(`${G}:restoring`,{id:w});if(Array.isArray(U)&&U.some((q)=>q===!1))return!1}catch(x){if(x?.code!=="MODULE_NOT_FOUND")console.error(`[ORM] Before-event '${G}:restoring' handler error:`,x)}return!0},K=async(w)=>{if(!W||o())return;try{let{dispatch:x}=await import("@stacksjs/events");await x(`${G}:restored`,{id:w})}catch(x){if(x?.code!=="MODULE_NOT_FOUND")console.error(`[ORM] Event '${G}:restored' handler error:`,x)}},V=process.env.STACKS_ORM_CASCADE_SWALLOW!=="true",z=async(w)=>{if(!Y.cascade?.length||!V){let U=await J.softDelete(w);if(U&&Y.cascade?.length)await e6(Q,Y,w,"softDelete");return U}let{db:x}=await import("@stacksjs/database");return await x.transaction(async()=>{let U=await J.softDelete(w);if(U)await e6(Q,Y,w,"softDelete");return U})},O=async(w)=>{if(!await H(w))return!1;if(!Y.cascade?.length||!V){let L=await J.restore(w);if(L){if(Y.cascade?.length)await e6(Q,Y,w,"restore");await K(w)}return L}let{db:U}=await import("@stacksjs/database"),q=await U.transaction(async()=>{let L=await J.restore(w);if(L)await e6(Q,Y,w,"restore");return L});if(q)await K(w);return q};Z.softDelete=z,Z.restore=O,Z.forceDelete=J.forceDelete,Z.withTrashed=J.withTrashed,Z.onlyTrashed=J.onlyTrashed,Z.delete=z}function iX(Z){if(Z==null)return Z;if(Array.isArray(Z))return Z.map(iX);if(typeof Z!=="object")return Z;if(typeof Z.toJSON==="function")return Z.toJSON();if(Z._attributes&&typeof Z._attributes==="object")return Z._attributes;return Z}var rX=["belongsTo","hasOne","hasMany","belongsToMany","morphMany","morphOne"],tX=["traits","dashboard"];function sX(Z){let $=Z?.[v$];if($&&typeof $==="object")return $;if(Z&&typeof Z==="object"&&"name"in Z&&"attributes"in Z)return Z;throw TypeError("extendModel() expects a model created by defineModel(), or a model definition. Import the framework model itself rather than its table name.")}function oX(Z,$){let X=Array.isArray(Z)?Z:[],J=Array.isArray($)?$:[];if(!X.length&&!J.length)return;return[...new Set([...X,...J])]}function aX(Z){if(!Z)return 0;return Object.values(Z).reduce(($,X)=>{let J=Number(X?.order);return Number.isFinite(J)&&J>$?J:$},0)}function eX(Z,$){let X={...Z,...$},J=Z.attributes??{},Y=$.attributes??{};if($.attributes){let Q=aX(J),G=Object.fromEntries(Object.entries(Y).map(([W,H])=>{let K=!(W in J),V=Number.isFinite(Number(H?.order));if(K&&!V)return[W,{...H,order:++Q}];return[W,H]}));X.attributes={...J,...G}}for(let Q of rX){let G=oX(Z[Q],$[Q]);if(G)X[Q]=G}for(let Q of tX){let G=Z[Q],W=$[Q];if(G&&W&&typeof G==="object"&&typeof W==="object")X[Q]={...G,...W}}return X}function QT(Z,$){return y7(eX(sX(Z),$))}import{log as ZJ}from"@stacksjs/logging";import{path as a}from"@stacksjs/path";import{fs as X8}from"@stacksjs/storage";function e(Z){return Z.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()}function $J(Z){let $=typeof Z.type==="string"?Z.type.toLowerCase():"",X=(()=>{switch($){case"string":case"text":case"longtext":case"mediumtext":case"tinytext":case"char":case"varchar":case"enum":case"uuid":case"date":case"datetime":case"timestamp":case"timestamptz":case"time":case"year":return"string";case"integer":case"int":case"tinyint":case"smallint":case"mediumint":case"float":case"double":case"decimal":case"numeric":return"number";case"bigint":return"number | bigint";case"boolean":case"bool":return"boolean";case"json":case"jsonb":return"unknown";case"binary":case"blob":case"bytea":return"Uint8Array";default:return"unknown"}})();return Z.nullable===!0?`${X} | null`:X}function XJ(Z){let $={},X=Z.belongsTo;if(!X)return $;let J=Array.isArray(X)?X:Object.keys(X);for(let Y of J)$[`${e(Y)}_id`]="number";return $}function JJ(Z,$){let[X,J]=[e(Z),e($)].sort();return`${X}_${J}`}function YJ(Z){let $=Z.default,X=typeof $==="string"?"string":typeof $==="number"?"number":typeof $==="boolean"?"boolean":$ instanceof Date?"string":"unknown";return Z.nullable?`${X} | null`:X}function QJ(Z,$){let X=$.belongsToMany;if(!X)return[];let J=[],Y=Array.isArray(X)?X:Object.values(X);for(let Q of Y){let G,W,H,K,V={},z=!0;if(typeof Q==="string")G=Q;else if(Q&&typeof Q==="object"&&"model"in Q){let q=Q;if(G=q.model,"pivotTable"in q||"firstForeignKey"in q||"secondForeignKey"in q)W=q.pivotTable,H=q.firstForeignKey,K=q.secondForeignKey;else{let L=Q;W=L.table,H=L.foreignKey,K=L.relatedKey,V=L.pivot?.columns??{},z=Boolean(L.pivot?.timestamps)}}else continue;let O=W??JJ(Z,G),w=H??`${e(Z)}_id`,x=K??`${e(G)}_id`,U={id:"number",[w]:"number",[x]:"number"};for(let[q,L]of Object.entries(V))U[q]=YJ(L);if(z)U.created_at="string",U.updated_at="string | null";J.push({table:O,columns:U})}return J}function GJ(Z){let $={id:"number"},X=Z.traits??{};if(X.useUuid)$.uuid="string";if((X.useTimestamps??X.timestampable)!==!1)$.created_at="string",$.updated_at="string | null";if(X.useSoftDeletes??X.softDeletable)$.deleted_at="string | null";return $}function WJ(Z){let $={},X=Z.attributes??{};for(let[J,Y]of Object.entries(X))$[e(J)]=$J(Y);return $}function R7(Z,$){let X=Object.entries($).map(([J,Y])=>` ${J}: ${Y}`).join(`
|
|
15
|
+
`);function W(V){let z=Q,O=V instanceof Uint8Array?V:new Uint8Array(Y.encode(V));Q=new Uint8Array(z.length+O.length+2),Q.set(z),Q.set(O,z.length),Q.set(G,Q.length-2)}function H(V){return`"${V.replace(/"|"/g,"%22").replace(/\r\n|\r|\n/g," ")}"`}let K=K5($);for(let V in K){if(!Object.prototype.hasOwnProperty.call(K,V))continue;let z=K[V];if(W(`--${J}`),Object.prototype.hasOwnProperty.call(z,"data")){let O=z;W(`Content-Disposition: form-data; name=${H(V)}; filename=${H(O.name||"blob")}`),W(`Content-Type: ${O.type||"application/octet-stream"}`),W(""),W(O.data)}else W(`Content-Disposition: form-data; name=${H(V)}`),W(""),W(z)}return W(`--${J}--`),Q};var S5=_(()=>{n()});var F6;var DZ=_(()=>{S5();F();F6=class F6 extends B{constructor(){super(...arguments);this.requestDataProcessor=j5}list(Z,$){return this._makeRequest("GET","/v1/files",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/files",Z,$,{headers:{"Content-Type":"multipart/form-data"},apiBase:"files"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/files/${encodeURIComponent(Z)}`,$,X)}}});var w6;var AZ=_(()=>{F();w6=class w6 extends B{list(Z,$){return this._makeRequest("GET","/v1/file_links",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/file_links",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/file_links/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/file_links/${encodeURIComponent(Z)}`,$,X)}}});var x6;var EZ=_(()=>{F();x6=class x6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/invoices/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/invoices/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}`,$,X,{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(Z,$){return this._makeRequest("GET","/v1/invoices",Z,$,{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"}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/invoices",Z,$,{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(Z,$){return this._makeRequest("GET","/v1/invoices/search",Z,$,{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"}}}}}}}}}}}}})}addLines(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/add_lines`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/attach_payment`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/finalize`,$,X,{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"}}}}}}}}}})}markUncollectible(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/mark_uncollectible`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/pay`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/remove_lines`,$,X,{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"}}}}}}}}}})}sendInvoice(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/send`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/update_lines`,$,X,{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"}}}}}}}}}})}voidInvoice(Z,$,X){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/void`,$,X,{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(Z,$){return this._makeRequest("POST","/v1/invoices/create_preview",Z,$,{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"}}}}}}}}}})}listLineItems(Z,$,X){return this._makeRequest("GET",`/v1/invoices/${encodeURIComponent(Z)}/lines`,$,X,{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"}}}}}}}})}updateLineItem(Z,$,X,J){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(Z)}/lines/${encodeURIComponent($)}`,X,J,{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"}}}}})}}});var T6;var CZ=_(()=>{F();T6=class T6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/invoiceitems/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/invoiceitems/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/invoiceitems/${encodeURIComponent(Z)}`,$,X,{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(Z,$){return this._makeRequest("GET","/v1/invoiceitems",Z,$,{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"}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/invoiceitems",Z,$,{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"}}}})}}});var U6;var PZ=_(()=>{F();U6=class U6 extends B{list(Z,$){return this._makeRequest("GET","/v1/invoice_payments",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/invoice_payments/${encodeURIComponent(Z)}`,$,X)}}});var q6;var NZ=_(()=>{F();q6=class q6 extends B{list(Z,$){return this._makeRequest("GET","/v1/invoice_rendering_templates",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/invoice_rendering_templates/${encodeURIComponent(Z)}`,$,X)}archive(Z,$,X){return this._makeRequest("POST",`/v1/invoice_rendering_templates/${encodeURIComponent(Z)}/archive`,$,X)}unarchive(Z,$,X){return this._makeRequest("POST",`/v1/invoice_rendering_templates/${encodeURIComponent(Z)}/unarchive`,$,X)}}});var L6;var kZ=_(()=>{F();L6=class L6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/mandates/${encodeURIComponent(Z)}`,$,X)}}});var D6;var M5=_(()=>{F();n();D6=class D6 extends B{constructor(){super(...arguments);this.basePath=F0("/")}authorizeUrl(Z,$){Z=Z||{},$=$||{};let X="oauth/authorize";if($.express)X=`express/${X}`;if(!Z.response_type)Z.response_type="code";if(!Z.client_id)Z.client_id=this._stripe.getClientId();if(!Z.scope)Z.scope="read_write";return`https://${this._stripe.resolveBaseAddress("connect")}/${X}?${d(Z)}`}token(Z,$){return this._makeRequest("POST","/oauth/token",Z,$,{apiBase:"connect"})}deauthorize(Z,$){if(!Z.client_id)Z.client_id=this._stripe.getClientId();return this._makeRequest("POST","/oauth/deauthorize",Z,$,{apiBase:"connect"})}}});var A6;var IZ=_(()=>{F();A6=class A6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_attempt_records",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_attempt_records/${encodeURIComponent(Z)}`,$,X)}}});var E6;var jZ=_(()=>{F();E6=class E6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_intents",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payment_intents",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_intents/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}`,$,X)}search(Z,$){return this._makeRequest("GET","/v1/payment_intents/search",Z,$,{methodType:"search"})}applyCustomerBalance(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/apply_customer_balance`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/cancel`,$,X)}capture(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/capture`,$,X)}confirm(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/confirm`,$,X)}incrementAuthorization(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/increment_authorization`,$,X)}verifyMicrodeposits(Z,$,X){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(Z)}/verify_microdeposits`,$,X)}listAmountDetailsLineItems(Z,$,X){return this._makeRequest("GET",`/v1/payment_intents/${encodeURIComponent(Z)}/amount_details_line_items`,$,X,{methodType:"list"})}}});var C6;var SZ=_(()=>{F();C6=class C6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_links",Z,$,{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"}}}}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/payment_links",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/payment_links/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/payment_links/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}})}listLineItems(Z,$,X){return this._makeRequest("GET",`/v1/payment_links/${encodeURIComponent(Z)}/line_items`,$,X,{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 P6;var MZ=_(()=>{F();P6=class P6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_methods",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payment_methods",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_methods/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(Z)}`,$,X)}attach(Z,$,X){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(Z)}/attach`,$,X)}detach(Z,$,X){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(Z)}/detach`,$,X)}}});var N6;var fZ=_(()=>{F();N6=class N6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_method_configurations",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payment_method_configurations",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_method_configurations/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payment_method_configurations/${encodeURIComponent(Z)}`,$,X)}}});var k6;var yZ=_(()=>{F();k6=class k6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payment_method_domains",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payment_method_domains",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_method_domains/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payment_method_domains/${encodeURIComponent(Z)}`,$,X)}validate(Z,$,X){return this._makeRequest("POST",`/v1/payment_method_domains/${encodeURIComponent(Z)}/validate`,$,X)}}});var I6;var hZ=_(()=>{F();I6=class I6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payment_records/${encodeURIComponent(Z)}`,$,X)}reportPaymentAttempt(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt`,$,X)}reportPaymentAttemptCanceled(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt_canceled`,$,X)}reportPaymentAttemptFailed(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt_failed`,$,X)}reportPaymentAttemptGuaranteed(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt_guaranteed`,$,X)}reportPaymentAttemptInformational(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_payment_attempt_informational`,$,X)}reportRefund(Z,$,X){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(Z)}/report_refund`,$,X)}reportPayment(Z,$){return this._makeRequest("POST","/v1/payment_records/report_payment",Z,$)}}});var j6;var vZ=_(()=>{F();j6=class j6 extends B{list(Z,$){return this._makeRequest("GET","/v1/payouts",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/payouts",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/payouts/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(Z)}/cancel`,$,X)}reverse(Z,$,X){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(Z)}/reverse`,$,X)}}});var S6;var RZ=_(()=>{F();S6=class S6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/plans/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/plans/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/plans/${encodeURIComponent(Z)}`,$,X,{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(Z,$){return this._makeRequest("GET","/v1/plans",Z,$,{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"}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/plans",Z,$,{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"}}}}}}}})}}});var M6;var bZ=_(()=>{F();M6=class M6 extends B{list(Z,$){return this._makeRequest("GET","/v1/prices",Z,$,{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"}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/prices",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/prices/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/prices/${encodeURIComponent(Z)}`,$,X,{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"}}}}})}search(Z,$){return this._makeRequest("GET","/v1/prices/search",Z,$,{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 f6;var gZ=_(()=>{F();f6=class f6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/products/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/products/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/products",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/products",Z,$,{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"}}}}}})}search(Z,$){return this._makeRequest("GET","/v1/products/search",Z,$,{methodType:"search"})}deleteFeature(Z,$,X,J){return this._makeRequest("DELETE",`/v1/products/${encodeURIComponent(Z)}/features/${encodeURIComponent($)}`,X,J)}retrieveFeature(Z,$,X,J){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(Z)}/features/${encodeURIComponent($)}`,X,J)}listFeatures(Z,$,X){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(Z)}/features`,$,X,{methodType:"list"})}createFeature(Z,$,X){return this._makeRequest("POST",`/v1/products/${encodeURIComponent(Z)}/features`,$,X)}}});var y6;var uZ=_(()=>{F();y6=class y6 extends B{list(Z,$){return this._makeRequest("GET","/v1/promotion_codes",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/promotion_codes",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/promotion_codes/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/promotion_codes/${encodeURIComponent(Z)}`,$,X)}}});var h6;var cZ=_(()=>{F();h6=class h6 extends B{list(Z,$){return this._makeRequest("GET","/v1/quotes",Z,$,{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"}}}}}}}}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/quotes",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}}}}}}})}accept(Z,$,X){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(Z)}/accept`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(Z)}/cancel`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(Z)}/finalize`,$,X,{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"}}}}}}}}}}}}}}}}})}pdf(Z,$,X){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(Z)}/pdf`,$,X,{apiBase:"files",streaming:!0})}listComputedUpfrontLineItems(Z,$,X){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(Z)}/computed_upfront_line_items`,$,X,{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(Z,$,X){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(Z)}/line_items`,$,X,{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 v6;var mZ=_(()=>{F();v6=class v6 extends B{list(Z,$){return this._makeRequest("GET","/v1/refunds",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/refunds",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/refunds/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/refunds/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/refunds/${encodeURIComponent(Z)}/cancel`,$,X)}}});var R6;var lZ=_(()=>{F();R6=class R6 extends B{list(Z,$){return this._makeRequest("GET","/v1/reviews",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/reviews/${encodeURIComponent(Z)}`,$,X)}approve(Z,$,X){return this._makeRequest("POST",`/v1/reviews/${encodeURIComponent(Z)}/approve`,$,X)}}});var b6;var dZ=_(()=>{F();b6=class b6 extends B{list(Z,$){return this._makeRequest("GET","/v1/setup_attempts",Z,$,{methodType:"list"})}}});var g6;var nZ=_(()=>{F();g6=class g6 extends B{list(Z,$){return this._makeRequest("GET","/v1/setup_intents",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/setup_intents",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/setup_intents/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(Z)}/cancel`,$,X)}confirm(Z,$,X){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(Z)}/confirm`,$,X)}verifyMicrodeposits(Z,$,X){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(Z)}/verify_microdeposits`,$,X)}}});var u6;var pZ=_(()=>{F();u6=class u6 extends B{list(Z,$){return this._makeRequest("GET","/v1/shipping_rates",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/shipping_rates",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/shipping_rates/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/shipping_rates/${encodeURIComponent(Z)}`,$,X)}}});var c6;var iZ=_(()=>{F();c6=class c6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/sources/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/sources/${encodeURIComponent(Z)}`,$,X)}create(Z,$){return this._makeRequest("POST","/v1/sources",Z,$)}verify(Z,$,X){return this._makeRequest("POST",`/v1/sources/${encodeURIComponent(Z)}/verify`,$,X)}listSourceTransactions(Z,$,X){return this._makeRequest("GET",`/v1/sources/${encodeURIComponent(Z)}/source_transactions`,$,X,{methodType:"list"})}}});var m6;var rZ=_(()=>{F();m6=class m6 extends B{cancel(Z,$,X){return this._makeRequest("DELETE",`/v1/subscriptions/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("GET",`/v1/subscriptions/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}})}deleteDiscount(Z,$,X){return this._makeRequest("DELETE",`/v1/subscriptions/${encodeURIComponent(Z)}/discount`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/subscriptions",Z,$,{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"}}}}}}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/subscriptions",Z,$,{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"}}}}}}}}}}}})}search(Z,$){return this._makeRequest("GET","/v1/subscriptions/search",Z,$,{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"}}}}}}}}}}}}}}})}migrate(Z,$,X){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(Z)}/migrate`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(Z)}/resume`,$,X,{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"}}}}}}}}}}}})}}});var l6;var tZ=_(()=>{F();l6=class l6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/subscription_items/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/subscription_items/${encodeURIComponent(Z)}`,$,X,{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(Z,$,X){return this._makeRequest("POST",`/v1/subscription_items/${encodeURIComponent(Z)}`,$,X,{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(Z,$){return this._makeRequest("GET","/v1/subscription_items",Z,$,{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"}}}}}}}}}})}create(Z,$){return this._makeRequest("POST","/v1/subscription_items",Z,$,{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"}}}}}}})}}});var d6;var sZ=_(()=>{F();d6=class d6 extends B{list(Z,$){return this._makeRequest("GET","/v1/subscription_schedules",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/subscription_schedules",Z,$,{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(Z,$,X){return this._makeRequest("GET",`/v1/subscription_schedules/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(Z)}`,$,X,{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"}}}}}}}}}}}})}cancel(Z,$,X){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(Z)}/cancel`,$,X)}release(Z,$,X){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(Z)}/release`,$,X)}}});var n6;var oZ=_(()=>{F();n6=class n6 extends B{list(Z,$){return this._makeRequest("GET","/v1/tax_codes",Z,$,{methodType:"list"})}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax_codes/${encodeURIComponent(Z)}`,$,X)}}});var p6;var aZ=_(()=>{F();p6=class p6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/tax_ids/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax_ids/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/tax_ids",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/tax_ids",Z,$)}}});var i6;var eZ=_(()=>{F();i6=class i6 extends B{list(Z,$){return this._makeRequest("GET","/v1/tax_rates",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/tax_rates",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tax_rates/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/tax_rates/${encodeURIComponent(Z)}`,$,X)}}});var r6;var Z$=_(()=>{F();r6=class r6 extends B{retrieve(Z,$,X){return this._makeRequest("GET",`/v1/tokens/${encodeURIComponent(Z)}`,$,X)}create(Z,$){return this._makeRequest("POST","/v1/tokens",Z,$)}}});var t6;var $$=_(()=>{F();t6=class t6 extends B{list(Z,$){return this._makeRequest("GET","/v1/topups",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/topups",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/topups/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/topups/${encodeURIComponent(Z)}`,$,X)}cancel(Z,$,X){return this._makeRequest("POST",`/v1/topups/${encodeURIComponent(Z)}/cancel`,$,X)}}});var s6;var X$=_(()=>{F();s6=class s6 extends B{list(Z,$){return this._makeRequest("GET","/v1/transfers",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/transfers",Z,$)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(Z)}`,$,X)}listReversals(Z,$,X){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(Z)}/reversals`,$,X,{methodType:"list"})}createReversal(Z,$,X){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(Z)}/reversals`,$,X)}retrieveReversal(Z,$,X,J){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(Z)}/reversals/${encodeURIComponent($)}`,X,J)}updateReversal(Z,$,X,J){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(Z)}/reversals/${encodeURIComponent($)}`,X,J)}}});var o6;var J$=_(()=>{F();o6=class o6 extends B{del(Z,$,X){return this._makeRequest("DELETE",`/v1/webhook_endpoints/${encodeURIComponent(Z)}`,$,X)}retrieve(Z,$,X){return this._makeRequest("GET",`/v1/webhook_endpoints/${encodeURIComponent(Z)}`,$,X)}update(Z,$,X){return this._makeRequest("POST",`/v1/webhook_endpoints/${encodeURIComponent(Z)}`,$,X)}list(Z,$){return this._makeRequest("GET","/v1/webhook_endpoints",Z,$,{methodType:"list"})}create(Z,$){return this._makeRequest("POST","/v1/webhook_endpoints",Z,$)}}});var Q0={};j8(Q0,{WebhookEndpoints:()=>o6,V2:()=>OX,Treasury:()=>zX,Transfers:()=>s6,Topups:()=>t6,Tokens:()=>r6,TestHelpers:()=>HX,Terminal:()=>VX,TaxRates:()=>i6,TaxIds:()=>p6,TaxCodes:()=>n6,Tax:()=>KX,Subscriptions:()=>m6,SubscriptionSchedules:()=>d6,SubscriptionItems:()=>l6,Sources:()=>c6,Sigma:()=>BX,ShippingRates:()=>u6,SetupIntents:()=>g6,SetupAttempts:()=>b6,Reviews:()=>R6,Reporting:()=>WX,Refunds:()=>v6,Radar:()=>GX,Quotes:()=>h6,PromotionCodes:()=>y6,Products:()=>f6,Prices:()=>M6,Plans:()=>S6,Payouts:()=>j6,PaymentRecords:()=>I6,PaymentMethods:()=>P6,PaymentMethodDomains:()=>k6,PaymentMethodConfigurations:()=>N6,PaymentLinks:()=>C6,PaymentIntents:()=>E6,PaymentAttemptRecords:()=>A6,OAuthResource:()=>D6,Mandates:()=>L6,Issuing:()=>QX,Invoices:()=>x6,InvoiceRenderingTemplates:()=>q6,InvoicePayments:()=>U6,InvoiceItems:()=>T6,Identity:()=>YX,Forwarding:()=>JX,FinancialConnections:()=>XX,Files:()=>F6,FileLinks:()=>w6,ExchangeRates:()=>_6,Events:()=>O6,EphemeralKeys:()=>z6,Entitlements:()=>$X,Disputes:()=>H6,Customers:()=>K6,CustomerSessions:()=>V6,CreditNotes:()=>B6,Coupons:()=>W6,CountrySpecs:()=>G6,ConfirmationTokens:()=>Q6,Climate:()=>ZX,Checkout:()=>e2,Charges:()=>Y6,BillingPortal:()=>a2,Billing:()=>o2,Balances:()=>Y0,BalanceTransactions:()=>J6,BalanceSettings:()=>X6,Balance:()=>Y0,Apps:()=>s2,ApplicationFees:()=>$6,ApplePayDomains:()=>Z6,Accounts:()=>J0,AccountSessions:()=>e4,AccountLinks:()=>a4,Account:()=>J0});var s2,o2,a2,e2,ZX,$X,XX,JX,YX,QX,GX,WX,BX,KX,VX,HX,zX,OX;var Y$=_(()=>{j9();S9();M9();h9();v9();R9();b9();g9();u9();c9();m9();l9();d9();n9();p9();i9();r9();t9();s9();o9();a9();e9();Z1();$1();X1();J1();Y1();Q1();G1();W1();B1();K1();V1();H1();z1();O1();_1();F1();w1();x1();T1();U1();q1();L1();D1();A1();E1();C1();P1();N1();k1();I1();j1();S1();M1();f1();y1();h1();v1();R1();b1();g1();u1();c1();m1();l1();d1();n1();p1();i1();r1();t1();s1();o1();a1();e1();ZZ();$Z();XZ();JZ();YZ();C8();C8();QZ();GZ();WZ();BZ();P8();P8();KZ();VZ();HZ();zZ();OZ();_Z();FZ();wZ();xZ();TZ();UZ();qZ();LZ();DZ();AZ();EZ();CZ();PZ();NZ();kZ();M5();IZ();jZ();SZ();MZ();fZ();yZ();hZ();vZ();RZ();bZ();gZ();uZ();cZ();mZ();lZ();dZ();nZ();pZ();iZ();rZ();tZ();sZ();oZ();aZ();eZ();Z$();$$();X$();J$();s2=C("apps",{Secrets:y4}),o2=C("billing",{Alerts:j0,CreditBalanceSummary:m0,CreditBalanceTransactions:l0,CreditGrants:d0,MeterEventAdjustments:Y4,MeterEvents:B4,Meters:V4}),a2=C("billingPortal",{Configurations:b0,Sessions:h4}),e2=C("checkout",{Sessions:v4}),ZX=C("climate",{Orders:z4,Products:L4,Suppliers:g4}),$X=C("entitlements",{ActiveEntitlements:I0,Features:a0}),XX=C("financialConnections",{Accounts:N0,Sessions:R4,Transactions:l4}),JX=C("forwarding",{Requests:M4}),YX=C("identity",{VerificationReports:s4,VerificationSessions:o4}),QX=C("issuing",{Authorizations:M0,Cardholders:h0,Cards:v0,Disputes:r0,PersonalizationDesigns:T4,PhysicalBundles:q4,Tokens:c4,Transactions:d4}),GX=C("radar",{EarlyFraudWarnings:t0,PaymentEvaluations:x4,ValueListItems:r4,ValueLists:t4}),WX=C("reporting",{ReportRuns:j4,ReportTypes:S4}),BX=C("sigma",{ScheduledQueryRuns:f4}),KX=C("tax",{Associations:S0,Calculations:y0,Registrations:I4,Settings:b4,Transactions:n4}),VX=C("terminal",{Configurations:g0,ConnectionTokens:c0,Locations:J4,OnboardingLinks:H4,Readers:D4}),HX=C("testHelpers",{ConfirmationTokens:u0,Customers:p0,Refunds:k4,TestClocks:u4,Issuing:C("issuing",{Authorizations:f0,Cards:R0,PersonalizationDesigns:U4,Transactions:p4}),Terminal:C("terminal",{Readers:A4}),Treasury:C("treasury",{InboundTransfers:$4,OutboundPayments:O4,OutboundTransfers:F4,ReceivedCredits:E4,ReceivedDebits:P4})}),zX=C("treasury",{CreditReversals:n0,DebitReversals:i0,FinancialAccounts:e0,InboundTransfers:X4,OutboundPayments:_4,OutboundTransfers:w4,ReceivedCredits:C4,ReceivedDebits:N4,TransactionEntries:m4,Transactions:i4}),OX=C("v2",{Billing:C("billing",{MeterEventAdjustments:Q4,MeterEventSession:G4,MeterEventStream:W4,MeterEvents:K4}),Commerce:C("commerce",{ProductCatalog:C("productCatalog",{Imports:Z4})}),Core:C("core",{AccountLinks:C0,AccountTokens:P0,Accounts:k0,EventDestinations:s0,Events:o0})})});var f5=_(()=>{U8()});class Q${constructor(Z){this.stripe=Z,this.secrets=new y4(Z)}}var y5=_(()=>{c1()});class G${constructor(Z){this.stripe=Z,this.alerts=new j0(Z),this.creditBalanceSummaries=new m0(Z),this.creditBalanceTransactions=new l0(Z),this.creditGrants=new d0(Z),this.meters=new V4(Z),this.meterEvents=new B4(Z),this.meterEventAdjustments=new Y4(Z)}}var h5=_(()=>{R9();t9();s9();o9();x1();F1();H1()});class W${constructor(Z){this.stripe=Z,this.configurations=new b0(Z),this.sessions=new h4(Z)}}var v5=_(()=>{n9();m1()});class B${constructor(Z){this.stripe=Z,this.sessions=new v4(Z)}}var R5=_(()=>{l1()});class K${constructor(Z){this.stripe=Z,this.orders=new z4(Z),this.products=new L4(Z),this.suppliers=new g4(Z)}}var b5=_(()=>{U1();k1();p1()});class V${constructor(Z){this.stripe=Z,this.activeEntitlements=new I0(Z),this.features=new a0(Z)}}var g5=_(()=>{v9();Q1()});class H${constructor(Z){this.stripe=Z,this.accounts=new N0(Z),this.sessions=new R4(Z),this.transactions=new l4(Z)}}var u5=_(()=>{M9();d1();s1()});class z${constructor(Z){this.stripe=Z,this.requests=new M4(Z)}}var c5=_(()=>{g1()});class O${constructor(Z){this.stripe=Z,this.verificationReports=new s4(Z),this.verificationSessions=new o4(Z)}}var m5=_(()=>{JZ();YZ()});class _${constructor(Z){this.stripe=Z,this.authorizations=new M0(Z),this.cards=new v0(Z),this.cardholders=new h0(Z),this.disputes=new r0(Z),this.personalizationDesigns=new T4(Z),this.physicalBundles=new q4(Z),this.tokens=new c4(Z),this.transactions=new d4(Z)}}var l5=_(()=>{g9();l9();m9();$1();C1();N1();r1();o1()});class F${constructor(Z){this.stripe=Z,this.earlyFraudWarnings=new t0(Z),this.paymentEvaluations=new x4(Z),this.valueLists=new t4(Z),this.valueListItems=new r4(Z)}}var d5=_(()=>{X1();E1();XZ();$Z()});class w${constructor(Z){this.stripe=Z,this.reportRuns=new j4(Z),this.reportTypes=new S4(Z)}}var n5=_(()=>{R1();b1()});class x${constructor(Z){this.stripe=Z,this.scheduledQueryRuns=new f4(Z)}}var p5=_(()=>{u1()});class T${constructor(Z){this.stripe=Z,this.associations=new S0(Z),this.calculations=new y0(Z),this.registrations=new I4(Z),this.settings=new b4(Z),this.transactions=new n4(Z)}}var i5=_(()=>{b9();c9();v1();n1();a1()});class U${constructor(Z){this.stripe=Z,this.configurations=new g0(Z),this.connectionTokens=new c0(Z),this.locations=new J4(Z),this.onboardingLinks=new H4(Z),this.readers=new D4(Z)}}var r5=_(()=>{p9();r9();V1();T1();I1()});class q${constructor(Z){this.stripe=Z,this.authorizations=new f0(Z),this.cards=new R0(Z),this.personalizationDesigns=new U4(Z),this.transactions=new p4(Z)}}var t5=_(()=>{u9();d9();P1();e1()});class L${constructor(Z){this.stripe=Z,this.readers=new A4(Z)}}var s5=_(()=>{j1()});class D${constructor(Z){this.stripe=Z,this.inboundTransfers=new $4(Z),this.outboundPayments=new O4(Z),this.outboundTransfers=new F4(Z),this.receivedCredits=new E4(Z),this.receivedDebits=new P4(Z)}}var o5=_(()=>{B1();q1();D1();S1();f1()});class A${constructor(Z){this.stripe=Z,this.confirmationTokens=new u0(Z),this.customers=new p0(Z),this.refunds=new k4(Z),this.testClocks=new u4(Z),this.issuing=new q$(Z),this.terminal=new L$(Z),this.treasury=new D$(Z)}}var a5=_(()=>{i9();e9();h1();i1();t5();s5();o5()});class E${constructor(Z){this.stripe=Z,this.creditReversals=new n0(Z),this.debitReversals=new i0(Z),this.financialAccounts=new e0(Z),this.inboundTransfers=new X4(Z),this.outboundPayments=new _4(Z),this.outboundTransfers=new w4(Z),this.receivedCredits=new C4(Z),this.receivedDebits=new N4(Z),this.transactions=new i4(Z),this.transactionEntries=new m4(Z)}}var e5=_(()=>{a9();Z1();G1();K1();L1();A1();M1();y1();ZZ();t1()});class C${constructor(Z){this.stripe=Z,this.meterEvents=new K4(Z),this.meterEventAdjustments=new Q4(Z),this.meterEventSession=new G4(Z),this.meterEventStream=new W4(Z)}}var Z7=_(()=>{w1();z1();O1();_1()});class P${constructor(Z){this.stripe=Z,this.imports=new Z4(Z)}}var $7=_(()=>{W1()});class N${constructor(Z){this.stripe=Z,this.productCatalog=new P$(Z)}}var X7=_(()=>{$7()});class k${constructor(Z){this.stripe=Z,this.accounts=new k0(Z),this.accountLinks=new C0(Z),this.accountTokens=new P0(Z),this.events=new o0(Z),this.eventDestinations=new s0(Z)}}var J7=_(()=>{h9();j9();S9();Y1();J1()});class I${constructor(Z){this.stripe=Z,this.billing=new C$(Z),this.commerce=new N$(Z),this.core=new k$(Z)}}var Y7=_(()=>{Z7();X7();J7()});class A{static initialize(Z,$=z7){A._platformFunctions=Z,A._requestSenderFactory=$,A.webhooks=P5(Z),A.createNodeHttpClient=Z.createNodeHttpClient,A.createFetchHttpClient=Z.createFetchHttpClient,A.createNodeCryptoProvider=Z.createNodeCryptoProvider,A.createSubtleCryptoProvider=Z.createSubtleCryptoProvider;let X=Z.getEnv(),J=Z.getRuntimeVersion();A.aiAgent=X?V5(X):"",A.AI_AGENT=A.aiAgent,A.USER_AGENT={bindings_version:A.PACKAGE_VERSION,lang:"node",typescript:!1,...J?{lang_version:J}:{},...A.aiAgent?{ai_agent:A.aiAgent}:{}}}constructor(Z,$={}){this._authenticator=null;let X=this._getPropsFromConfig($);this._platformFunctions=A._platformFunctions,Object.defineProperty(this,"_emitter",{value:this._platformFunctions.createEmitter(),enumerable:!1,configurable:!1,writable:!1}),this.VERSION=A.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 J=X.httpAgent||null;this._api={host:X.host||j$,port:X.port||Q7,protocol:X.protocol||"https",basePath:G7,version:X.apiVersion||W7,timeout:_8("timeout",X.timeout,B7),maxNetworkRetries:_8("maxNetworkRetries",X.maxNetworkRetries,2),agent:J,httpClient:X.httpClient||(J?this._platformFunctions.createNodeHttpClient(J):this._platformFunctions.createDefaultHttpClient()),dev:!1,stripeAccount:X.stripeAccount||null,stripeContext:X.stripeContext||null};let Y=X.typescript||!1;if(Y!==A.USER_AGENT.typescript)A.USER_AGENT.typescript=Y;if(X.appInfo)this._setAppInfo(X.appInfo);this._setAuthenticator(Z,X.authenticator||null),this.errors=A8,this.Decimal=v,this.webhooks=A.webhooks,this._prevRequestMetrics=[],this._enableTelemetry=X.telemetry!==!1,this._emitEventBodies=X.emitEventBodies===!0,this._requestSender=A._requestSenderFactory(this),this.accountLinks=new a4(this),this.accountSessions=new e4(this),this.accounts=new J0(this),this.applePayDomains=new Z6(this),this.applicationFees=new $6(this),this.balance=new Y0(this),this.balanceSettings=new X6(this),this.balanceTransactions=new J6(this),this.charges=new Y6(this),this.confirmationTokens=new Q6(this),this.countrySpecs=new G6(this),this.coupons=new W6(this),this.creditNotes=new B6(this),this.customerSessions=new V6(this),this.customers=new K6(this),this.disputes=new H6(this),this.ephemeralKeys=new z6(this),this.events=new O6(this),this.exchangeRates=new _6(this),this.fileLinks=new w6(this),this.files=new F6(this),this.invoiceItems=new T6(this),this.invoicePayments=new U6(this),this.invoiceRenderingTemplates=new q6(this),this.invoices=new x6(this),this.mandates=new L6(this),this.paymentAttemptRecords=new A6(this),this.paymentIntents=new E6(this),this.paymentLinks=new C6(this),this.paymentMethodConfigurations=new N6(this),this.paymentMethodDomains=new k6(this),this.paymentMethods=new P6(this),this.paymentRecords=new I6(this),this.payouts=new j6(this),this.plans=new S6(this),this.prices=new M6(this),this.products=new f6(this),this.promotionCodes=new y6(this),this.quotes=new h6(this),this.refunds=new v6(this),this.reviews=new R6(this),this.setupAttempts=new b6(this),this.setupIntents=new g6(this),this.shippingRates=new u6(this),this.sources=new c6(this),this.subscriptionItems=new l6(this),this.subscriptionSchedules=new d6(this),this.subscriptions=new m6(this),this.taxCodes=new n6(this),this.taxIds=new p6(this),this.taxRates=new i6(this),this.tokens=new r6(this),this.topups=new t6(this),this.transfers=new s6(this),this.webhookEndpoints=new o6(this),this.apps=new Q$(this),this.billing=new G$(this),this.billingPortal=new W$(this),this.checkout=new B$(this),this.climate=new K$(this),this.entitlements=new V$(this),this.financialConnections=new H$(this),this.forwarding=new z$(this),this.identity=new O$(this),this.issuing=new _$(this),this.radar=new F$(this),this.reporting=new w$(this),this.sigma=new x$(this),this.tax=new T$(this),this.terminal=new U$(this),this.testHelpers=new A$(this),this.treasury=new E$(this),this.v2=new I$(this),this.account=this.accounts,this.oauth=new D6(this)}rawRequest(Z,$,X,J){return this._requestSender._rawRequest(Z,$,X,J)}_setAuthenticator(Z,$){if(Z&&$)throw Error("Can't specify both apiKey and authenticator");if(!Z&&!$)throw Error("Neither apiKey nor config.authenticator provided");this._authenticator=Z?G9(Z):$}_setAppInfo(Z){if(Z&&typeof Z!=="object")throw Error("AppInfo must be an object.");if(Z&&!Z.name)throw Error("AppInfo.name is required");Z=Z||{},this._appInfo=_X.reduce(($,X)=>{if(typeof Z[X]=="string")$=$||{},$[X]=Z[X];return $},{})}setClientId(Z){this._clientId=Z}getClientId(){return this._clientId}getConstant(Z){switch(Z){case"DEFAULT_HOST":return j$;case"DEFAULT_PORT":return Q7;case"DEFAULT_BASE_PATH":return G7;case"DEFAULT_API_VERSION":return W7;case"DEFAULT_TIMEOUT":return B7;case"MAX_NETWORK_RETRY_DELAY_SEC":return K7;case"INITIAL_NETWORK_RETRY_DELAY_SEC":return V7}return A[Z]}resolveBaseAddress(Z){let $=this.getApiField("host");if($!==j$)return $;return Y9[Z]}getMaxNetworkRetries(){return this.getApiField("maxNetworkRetries")}_setApiNumberField(Z,$,X){let J=_8(Z,$,X);this._setApiField(Z,J)}getMaxNetworkRetryDelay(){return K7}getInitialNetworkRetryDelay(){return V7}getClientUserAgent(Z){return this.getClientUserAgentSeeded(A.USER_AGENT,Z)}getClientUserAgentSeeded(Z,$){let X={};for(let Q in Z){if(!Object.prototype.hasOwnProperty.call(Z,Q))continue;X[Q]=encodeURIComponent(Z[Q]??"null")}let J=this._platformFunctions.getPlatformInfo();if(J&&this.getTelemetryEnabled())X.platform=encodeURIComponent(J);else delete X.platform;let Y=this.getApiField("httpClient");if(Y)X.httplib=encodeURIComponent(Y.getClientName());if(this._appInfo)X.application=this._appInfo;if(this.getTelemetryEnabled()){let Q=this._platformFunctions.getTelemetryId();if(Q)X.telemetry_id=Q}$(JSON.stringify(X))}getAppInfoAsString(){if(!this._appInfo)return"";let Z=this._appInfo.name;if(this._appInfo.version)Z+=`/${this._appInfo.version}`;if(this._appInfo.url)Z+=` (${this._appInfo.url})`;return Z}getTelemetryEnabled(){return this._enableTelemetry}getEmitEventBodiesEnabled(){return this._emitEventBodies}_prepResources(){for(let Z in Q0){if(!Object.prototype.hasOwnProperty.call(Q0,Z))continue;this[B5(Z.replace("Resource",""))]=new Q0[Z](this)}}_getPropsFromConfig(Z){if(!Z)return{};let $=typeof Z==="string";if(!(Z===Object(Z)&&!Array.isArray(Z))&&!$)throw Error("Config must either be an object or a string");if($)return{apiVersion:Z};if(Object.keys(Z).filter((Y)=>!H7.includes(Y)).length>0)throw Error(`Config object may only contain the following: ${H7.join(", ")}`);return Z}_setApiField(Z,$){this._api[Z]=$}getApiField(Z){return this._api[Z]}parseEventNotification(Z,$,X,J,Y,Q){if(!this.webhooks.signature)throw Error("ERR: missing signature helper, unable to verify");this.webhooks.signature.verifyHeader(Z,$,X,J||this.webhooks.DEFAULT_TOLERANCE,Y||this._platformFunctions.createDefaultCryptoProvider(),Q);let G=Z instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(Z)):JSON.parse(Z);if(G&&G.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotification, which expects an event notification. Use stripe.webhooks.constructEvent instead.");if(G.context)G.context=l.parse(G.context);return G.fetchEvent=()=>{return this._requestSender._rawRequest("GET",`/v2/core/events/${G.id}`,void 0,{stripeContext:G.context,headers:{"Stripe-Request-Trigger":`event=${G.id}`}},["fetch_event"])},G.fetchRelatedObject=()=>{if(!G.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",G.related_object.url,void 0,{stripeContext:G.context,headers:{"Stripe-Request-Trigger":`event=${G.id}`}},["fetch_related_object"])},G}async parseEventNotificationAsync(Z,$,X,J,Y,Q){if(!this.webhooks.signature)throw Error("ERR: missing signature helper, unable to verify");await this.webhooks.signature.verifyHeaderAsync(Z,$,X,J||this.webhooks.DEFAULT_TOLERANCE,Y||this._platformFunctions.createDefaultCryptoProvider(),Q);let G=Z instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(Z)):JSON.parse(Z);if(G&&G.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotificationAsync, which expects an event notification. Use stripe.webhooks.constructEventAsync instead.");if(G.context)G.context=l.parse(G.context);return G.fetchEvent=()=>{return this._requestSender._rawRequest("GET",`/v2/core/events/${G.id}`,void 0,{stripeContext:G.context,headers:{"Stripe-Request-Trigger":`event=${G.id}`}},["fetch_event"])},G.fetchRelatedObject=()=>{if(!G.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",G.related_object.url,void 0,{stripeContext:G.context,headers:{"Stripe-Request-Trigger":`event=${G.id}`}},["fetch_related_object"])},G}}var j$="api.stripe.com",Q7="443",G7="/v1/",W7,B7=80000,K7=5,V7=0.5,_X,H7,z7=(Z)=>new X0(Z,B.MAX_BUFFERED_REQUEST_METRICS);var O7=_(()=>{E8();U5();F();Q9();N5();T8();x8();Y$();n();f5();C8();QZ();GZ();WZ();BZ();P8();KZ();VZ();HZ();zZ();OZ();_Z();FZ();wZ();xZ();TZ();UZ();LZ();DZ();AZ();EZ();CZ();PZ();NZ();kZ();IZ();jZ();SZ();MZ();fZ();yZ();hZ();vZ();RZ();bZ();gZ();uZ();cZ();mZ();lZ();dZ();nZ();pZ();iZ();rZ();tZ();sZ();oZ();aZ();eZ();Z$();$$();X$();J$();y5();h5();v5();R5();b5();g5();u5();c5();m5();l5();d5();n5();p5();i5();r5();a5();e5();Y7();qZ();Y$();W7=I9,_X=["name","version","url","partner_id"],H7=["authenticator","apiVersion","typescript","maxNetworkRetries","httpAgent","httpClient","timeout","host","port","protocol","telemetry","emitEventBodies","appInfo","stripeAccount","stripeContext"];A.PACKAGE_VERSION="22.3.2";A.API_VERSION=I9;A.aiAgent="";A.AI_AGENT="";A.USER_AGENT={bindings_version:A.PACKAGE_VERSION,lang:"node",typescript:!1};A.StripeResource=B;A.resources=Q0;A.HttpClient=S;A.HttpClientResponse=x0;A.CryptoProvider=U0;A.StripeContext=l;A.errors=A8;A.Decimal=v;A._requestSenderFactory=z7});var _7={};j8(_7,{default:()=>FX,Stripe:()=>A,Decimal:()=>v});var FX;var F7=_(()=>{T5();U8();O7();A.initialize(new z9);FX=A});import"@stacksjs/validation";import{log as S8}from"@stacksjs/cli";import{db as R$}from"@stacksjs/database";async function i7(Z,$={}){let{olderThanDays:X=30,column:J="created_at",query:Y}=$;try{if(Y){let K=R$.deleteFrom(Z);K=Y(K);let V=await K.execute(),z=Array.isArray(V)?V:[V],O=Number(z[0]?.numDeletedRows??z.length??0);return S8.info(`Pruned ${O} records from ${Z}`),O}let Q=new Date;Q.setDate(Q.getDate()-X);let G=await R$.deleteFrom(Z).where(J,"<",Q.toISOString()).execute(),W=Array.isArray(G)?G:[G],H=Number(W[0]?.numDeletedRows??W.length??0);return S8.info(`Pruned ${H} records from ${Z} older than ${X} days`),H}catch(Q){throw S8.error(`Failed to prune ${Z}:`,Q),Q}}async function BY(Z,$={}){return i7(Z,$)}function KY(Z){if(!Z?.prunable)return null;if(typeof Z.prunable==="boolean")return{olderThanDays:30,column:"created_at"};return Z.prunable}import{createCipheriv as r7,createDecipheriv as t7,createHash as s7,randomBytes as o7}from"crypto";import{log as Q8}from"@stacksjs/logging";var b$="enc:",g$="aes-256-gcm",a7=12,Y8=null;async function u$(){if(Y8)return Y8;let Z=process.env.APP_KEY;if(!Z)try{Z=(await import("@stacksjs/config").catch(()=>null))?.config?.app?.key}catch{}if(!Z)return null;return Y8=s7("sha256").update(Z).digest(),Y8}function K0(Z){return typeof Z==="string"&&Z.startsWith(b$)}async function M8(Z){if(Z==null)return Z;if(K0(Z))return Z;if(typeof Z!=="string")return Z;let $=await u$();if(!$)return Q8.warn("[orm] encrypted attribute: APP_KEY not set \u2014 storing value in plaintext"),Z;let X=o7(a7),J=r7(g$,$,X),Y=Buffer.concat([J.update(Z,"utf8"),J.final()]),Q=J.getAuthTag();return`${b$}${X.toString("base64")}:${Q.toString("base64")}:${Y.toString("base64")}`}async function f8(Z){if(Z==null)return Z;if(typeof Z!=="string")return Z;if(!K0(Z))return Z;try{let $=await u$();if(!$)return Q8.warn("[orm] encrypted attribute: APP_KEY not set \u2014 cannot decrypt"),null;let[,X,J,Y]=Z.split(":");if(!X||!J||!Y)return Q8.warn("[orm] encrypted attribute: malformed envelope, returning null"),null;let Q=Buffer.from(X,"base64"),G=Buffer.from(J,"base64"),W=Buffer.from(Y,"base64"),H=t7(g$,$,Q);return H.setAuthTag(G),Buffer.concat([H.update(W),H.final()]).toString("utf8")}catch($){return Q8.warn("[orm] encrypted attribute: decrypt failed (key rotation? corrupted ciphertext?)",{error:$}),null}}function y8(Z){let $=Z.attributes;if(!$||typeof $!=="object")return[];let X=[];for(let[J,Y]of Object.entries($))if(Y&&typeof Y==="object"&&Y.encrypted===!0)X.push(J);return X}import{sqlDateTime as e7}from"@stacksjs/database";import{log as H0}from"@stacksjs/logging";var Z2=[/^password$/i,/^password_hash$/i,/^api_key$/i,/_token$/i,/_secret$/i,/^remember_token$/i],m$="model_audits",R8=null;function $2(Z){R8=Z}async function h8(){if(R8!=null)return R8;try{let Z=await import("@stacksjs/router").catch(()=>null);if(!Z)return null;let $=Z.getCurrentRequest;if(typeof $!=="function")return null;let X=$();if(!X)return null;return(X.user??X._user)?.id??null}catch{return null}}function G8(Z){if(!Z||typeof Z!=="object")return null;let $={};for(let[X,J]of Object.entries(Z)){if(Z2.some((Y)=>Y.test(X)))continue;$[X]=J}return $}function V0(Z){if(!Z||typeof Z!=="object")return null;let $=Z;if($._attributes&&typeof $._attributes==="object")return{...$._attributes};return{...Z}}function X2(Z,$){if(!Z||!$)return{old:Z,next:$};let X={},J={},Y=new Set([...Object.keys(Z),...Object.keys($)]);for(let Q of Y)if(Z[Q]!==$[Q])X[Q]=Z[Q],J[Q]=$[Q];return{old:X,next:J}}async function v8(Z,$=!1){try{let{db:X}=await import("@stacksjs/database");await X.insertInto(m$).values({auditable_type:Z.auditable_type,auditable_id:Z.auditable_id,event:Z.event,old_values:Z.old_values?JSON.stringify(Z.old_values):null,new_values:Z.new_values?JSON.stringify(Z.new_values):null,user_id:Z.user_id,created_at:e7()}).executeTakeFirst()}catch(X){if(H0.warn(`[orm] audit row write failed for ${Z.auditable_type}#${String(Z.auditable_id)} (${Z.event})`,{error:X}),$)throw X}}function l$(Z){return{async audits($){try{let{db:X}=await import("@stacksjs/database");return(await X.selectFrom(m$).selectAll().where("auditable_type","=",Z).where("auditable_id","=",$).orderBy("created_at","desc").execute()??[]).map((Y)=>({...Y,old_values:typeof Y.old_values==="string"?c$(Y.old_values):Y.old_values,new_values:typeof Y.new_values==="string"?c$(Y.new_values):Y.new_values}))}catch(X){return H0.warn(`[orm] audits() lookup failed for ${Z}#${String($)}`,{error:X}),[]}}}}function c$(Z){try{return JSON.parse(Z)}catch{return Z}}function d$(Z){if(Z&&typeof Z==="object"&&"transactional"in Z)return{transactional:Z.transactional===!0};return{transactional:!1}}function n$(Z,$,X="id",J={}){let Y=J.transactional===!0,Q=Z;if(typeof Z.audits!=="function")Z.audits=l$($).audits;let G=async(V)=>{if(!Y)return await V();let{db:z}=await import("@stacksjs/database");return await z.transaction(async()=>V())},W=Z.create;if(typeof W==="function")Z.create=async function(...V){return await G(async()=>{let z=await W.apply(this,V);try{let O=V0(z),w=O?.[X];if(w!=null){let x=await h8();await v8({auditable_type:$,auditable_id:w,event:"created",old_values:null,new_values:G8(O),user_id:x},Y)}}catch(O){if(H0.warn(`[orm] audit(create) failed for ${$}`,{error:O}),Y)throw O}return z})};let H=Z.update;if(typeof H==="function")Z.update=async function(V,z){return await G(async()=>{let O=Q.find,w=typeof O==="function"?V0(await O.call(Q,V)):null,x=await H.call(this,V,z);try{let U=V0(x)??(typeof O==="function"?V0(await O.call(Q,V)):null),{old:q,next:L}=X2(w,U);if(L&&Object.keys(L).length>0){let E=await h8();await v8({auditable_type:$,auditable_id:V,event:"updated",old_values:G8(q),new_values:G8(L),user_id:E},Y)}}catch(U){if(H0.warn(`[orm] audit(update) failed for ${$}#${String(V)}`,{error:U}),Y)throw U}return x})};let K=(V)=>{let z=Z[V];if(typeof z!=="function")return;Z[V]=async function(O){return await G(async()=>{let w=Q.find,x=typeof w==="function"?V0(await w.call(Q,O)):null,U=await z.call(this,O);try{if(U!==!1&&x){let q=await h8();await v8({auditable_type:$,auditable_id:O,event:"deleted",old_values:G8(x),new_values:null,user_id:q},Y)}}catch(q){if(H0.warn(`[orm] audit(${V}) failed for ${$}#${String(O)}`,{error:q}),Y)throw q}return U})}};K("delete"),K("softDelete")}import{db as J2,sql as Y2,sqlDateTime as b8}from"@stacksjs/database";function u(Z,$){if(typeof Z!=="number"||!Number.isFinite(Z)||Z<=0)throw Error(`[orm/commentable] ${$} requires a positive numeric id (received ${String(Z)})`)}var z0="commentable_upvotes",O0="commentables";function Q2(Z){let $=Z;return $.code==="SQLITE_CONSTRAINT_UNIQUE"||$.code==="SQLITE_CONSTRAINT"||$.code==="23505"||$.errno===1062||/unique|duplicate/i.test($.message??"")}function g8(Z){let $=J2;return{async comments(X){return u(X,"comments"),await $.selectFrom("commentables").where("commentables_id","=",X).where("commentables_type","=",Z).selectAll().execute()},async commentCount(X){let J=await $.selectFrom("commentables").select(Y2`count(*) as count`).where("commentables_id","=",X).where("commentables_type","=",Z).executeTakeFirst();return Number(J?.count)||0},async addComment(X,J){if(u(X,"addComment"),!J||typeof J.title!=="string"||J.title.trim().length===0)throw Error("[orm/commentable] addComment requires a non-empty comment.title");if(typeof J.body!=="string"||J.body.trim().length===0)throw Error("[orm/commentable] addComment requires a non-empty comment.body");let Y=await $.insertInto("commentables").values({...J,commentables_id:X,commentables_type:Z,status:"pending",created_at:b8(),updated_at:b8()}).returningAll().executeTakeFirst();if(Y&&typeof Y==="object"&&"id"in Y)return Y;let Q=Y?.lastInsertRowid;if(Q==null)return Y;return await $.selectFrom("commentables").where("id","=",Number(Q)).selectAll().executeTakeFirst()},async approvedComments(X){return await $.selectFrom("commentables").where("commentables_id","=",X).where("commentables_type","=",Z).where("status","=","approved").selectAll().execute()},async pendingComments(X){return await $.selectFrom("commentables").where("commentables_id","=",X).where("commentables_type","=",Z).where("status","=","pending").selectAll().execute()},async rejectedComments(X){return await $.selectFrom("commentables").where("commentables_id","=",X).where("commentables_type","=",Z).where("status","=","rejected").selectAll().execute()},async upvoteComment(X,J){u(X,"upvoteComment"),u(J,"upvoteComment");let Y=()=>$.selectFrom(z0).where("upvoteable_id","=",X).where("upvoteable_type","=",O0).where("user_id","=",J).selectAll().executeTakeFirst(),Q=await Y();if(Q)return Q;try{await $.insertInto(z0).values({upvoteable_id:X,upvoteable_type:O0,user_id:J,created_at:b8()}).execute()}catch(G){if(!Q2(G))throw G}return await Y()},async removeCommentUpvote(X,J){u(X,"removeCommentUpvote"),u(J,"removeCommentUpvote"),await $.deleteFrom(z0).where("upvoteable_id","=",X).where("upvoteable_type","=",O0).where("user_id","=",J).execute()},async commentUpvoteCount(X){u(X,"commentUpvoteCount");let J=await $.selectFrom(z0).select("count(*) as count").where("upvoteable_id","=",X).where("upvoteable_type","=",O0).executeTakeFirst();return Number(J?.count)||0},async hasUpvotedComment(X,J){return u(X,"hasUpvotedComment"),u(J,"hasUpvotedComment"),!!await $.selectFrom(z0).where("upvoteable_id","=",X).where("upvoteable_type","=",O0).where("user_id","=",J).selectAll().executeTakeFirst()}}}import{db as G2,sql as W2,sqlDateTime as p$}from"@stacksjs/database";function u8(Z,$){if(typeof Z!=="number"||!Number.isFinite(Z)||Z<=0)throw Error(`[orm/taggable] ${$} requires a positive numeric id (received ${String(Z)})`)}function c8(Z){let $=G2;return{async tags(X){return u8(X,"tags"),await $.selectFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).selectAll().execute()},async tagCount(X){u8(X,"tagCount");let J=await $.selectFrom("taggables").select(W2`count(*) as count`).where("taggable_id","=",X).where("taggable_type","=",Z).executeTakeFirst();return Number(J?.count)||0},async addTag(X,J){if(u8(X,"addTag"),!J||typeof J.name!=="string"||J.name.trim().length===0)throw Error("[orm/taggable] addTag requires a non-empty tag.name");return await $.insertInto("taggables").values({...J,taggable_id:X,taggable_type:Z,slug:J.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),is_active:!0,created_at:p$(),updated_at:p$()}).execute(),await $.selectFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).where("name","=",J.name).selectAll().executeTakeFirst()},async activeTags(X){return await $.selectFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).where("is_active","=",!0).selectAll().execute()},async inactiveTags(X){return await $.selectFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).where("is_active","=",!1).selectAll().execute()},async removeTag(X,J){await $.deleteFrom("taggables").where("taggable_id","=",X).where("taggable_type","=",Z).where("id","=",J).execute()}}}import{db as B2,sqlDateTime as W8}from"@stacksjs/database";function m8(Z){let $=B2;async function X(J){return(await $.selectFrom("categorizable_models").where("categorizable_id","=",J).where("categorizable_type","=",Z).selectAll().execute()).map((Q)=>Q.category_id)}return{async categories(J){let Y=await X(J);if(Y.length===0)return[];return await $.selectFrom("categorizables").where("id","in",Y).selectAll().execute()},async categoryCount(J){return(await X(J)).length},async addCategory(J,Y){let Q=()=>$.selectFrom("categorizables").where("name","=",Y.name).where("categorizable_type","=",Z).selectAll().executeTakeFirst(),G=await Q();if(!G)await $.insertInto("categorizables").values({name:Y.name,description:Y.description,slug:Y.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),categorizable_type:Z,is_active:!0,created_at:W8(),updated_at:W8()}).execute(),G=await Q();return await $.insertInto("categorizable_models").values({categorizable_id:J,categorizable_type:Z,category_id:G.id,created_at:W8(),updated_at:W8()}).execute(),G},async activeCategories(J){let Y=await X(J);if(Y.length===0)return[];return await $.selectFrom("categorizables").where("id","in",Y).where("is_active","=",!0).selectAll().execute()},async inactiveCategories(J){let Y=await X(J);if(Y.length===0)return[];return await $.selectFrom("categorizables").where("id","in",Y).where("is_active","=",!1).selectAll().execute()},async removeCategory(J,Y){await $.deleteFrom("categorizable_models").where("categorizable_id","=",J).where("categorizable_type","=",Z).where("category_id","=",Y).execute()}}}import{db as K2,sqlDateTime as V2}from"@stacksjs/database";function l8(Z,$){let X=K2,J=$?.table||`${Z}_likes`,Y=$?.foreignKey||`${Z.replace(/s$/,"")}_id`;return{async likes(Q){return await X.selectFrom(J).where(Y,"=",Q).selectAll().execute()},async likeCount(Q){let G=await X.selectFrom(J).select("count(*) as count").where(Y,"=",Q).executeTakeFirst();return Number(G?.count)||0},async like(Q,G){if(typeof Q!=="number"||!Number.isFinite(Q)||Q<=0)throw Error(`[orm/likeable] like requires a positive numeric id (received ${String(Q)})`);if(typeof G!=="number"||!Number.isFinite(G)||G<=0)throw Error(`[orm/likeable] like requires a positive numeric userId (received ${String(G)})`);let W=V2();try{return await X.insertInto(J).values({[Y]:Q,user_id:G,created_at:W,updated_at:W}).returningAll().executeTakeFirst()}catch(H){let K=H;if(!(K.code==="SQLITE_CONSTRAINT_UNIQUE"||K.code==="SQLITE_CONSTRAINT"||K.code==="23505"||K.errno===1062||/unique|duplicate/i.test(K.message??"")))throw H;let z=await X.selectFrom(J).where(Y,"=",Q).where("user_id","=",G).selectAll().executeTakeFirst();if(z)return z;throw H}},async unlike(Q,G){await X.deleteFrom(J).where(Y,"=",Q).where("user_id","=",G).execute()},async isLiked(Q,G){return!!await X.selectFrom(J).where(Y,"=",Q).where("user_id","=",G).selectAll().executeTakeFirst()},async likedBy(Q){return(await X.selectFrom(J).select([Y]).where("user_id","=",Q).execute()).map((W)=>Number(W[Y])).filter(Boolean)}}}function r$(Z){let $=Z;return $?.code==="SQLITE_CONSTRAINT_UNIQUE"||$?.code==="SQLITE_CONSTRAINT"||$?.code==="23505"||$?.errno===1062||/unique|duplicate/i.test($?.message??"")}function H2(Z,$,X){let J=Z;if(Z instanceof Error&&typeof J.status==="number"&&Number.isInteger(J.status)&&J.status>=400&&J.status<600){let Y={error:Z.message};if(J.details!==void 0)Y.details=J.details;return{status:J.status,body:Y}}if(r$(Z))return{status:409,body:{error:`${$} already exists`}};return{status:500,body:{error:`Failed to ${X} ${$}`,detail:String(Z)}}}function y(Z){return Z.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function z2(Z){let $={};for(let[X,J]of Object.entries(Z))$[y(X)]=J;return $}function CY(Z,$){let X=String($||"").replace(/^\/+|\/+$/g,""),J=String(Z).replace(/^\/+/,"");return`/api/${X?`${X}/`:""}${J}`}function PY(Z){if(!Z)return null;let $=Z.attributes??{};if(Object.prototype.hasOwnProperty.call($,"teamId")||Object.prototype.hasOwnProperty.call($,"team_id"))return"team_id";return Z.belongsTo?.some((X)=>X==="Team")?"team_id":null}function NY(Z,$,X){let J=Object.keys(Z).find((Q)=>y(Q)===y($));if(Array.isArray(X)){if(J===void 0)return{data:Z,error:"Ownership value is required"};if(!X.some((Q)=>String(Q)===String(Z[J])))return{data:Z,error:"Ownership value is not available to this caller"};return{data:{...Z,[$]:Z[J]}}}if(X===null||X===void 0)return{data:Z,error:"Caller has no ownership identity"};let Y={...Z};for(let Q of Object.keys(Y))if(y(Q)===y($))delete Y[Q];return Y[$]=X,{data:Y}}function O2(Z){if(!Z)return[];let $=Object.entries(Z.attributes??{}).filter(([,X])=>X?.fillable===!0).map(([X])=>X);for(let X of Z.belongsTo??[]){if(typeof X!=="string"||!X.trim())continue;let J=y(X.trim()).split("_").filter(Boolean);if(J.length===0)continue;let Y=`${J[0]}${J.slice(1).map((Q)=>`${Q[0]?.toUpperCase()}${Q.slice(1)}`).join("")}Id`;$.push(Y)}return[...new Set($)]}function _2(Z,$){if(!Z||$.length===0)return{};let X={};for(let J of $){if(J in Z){X[J]=Z[J];continue}let Y=y(J);if(Y!==J&&Y in Z)X[J]=Z[Y]}return X}function F2(Z,$){if(Z?.name!=="date"||$ instanceof Date||typeof $!=="string")return $;let X=/^(\d{4})-(\d{2})-(\d{2})$/.exec($);if(!X)return $;let J=Number(X[1]),Y=Number(X[2]),Q=Number(X[3]),G=new Date(Date.UTC(J,Y-1,Q));if(G.getUTCFullYear()!==J||G.getUTCMonth()!==Y-1||G.getUTCDate()!==Q)return $;return G}function kY(Z,$){if(!$.length)return Z;let X={...Z};for(let J of $)delete X[J],delete X[y(J)];return X}function IY(Z,$){if(!Z||$.length===0)return Z;let X={...Z};for(let J of $)delete X[J],delete X[y(J)];return X}var w2=["id","uuid","created_at","updated_at","deleted_at"];function jY(Z,$){let X=new Map;for(let J of[...Object.keys(Z??{}),...w2]){let Y=y(J);if(!/^\w+$/.test(Y))continue;X.set(J,Y),X.set(Y,Y)}for(let J of $)X.delete(J),X.delete(y(J));return X}function SY(Z,$,X){if(!$)return Z;let J=String($).split(",").map((Q)=>Q.trim()).filter(Boolean),Y=Z;for(let Q of J){let G=Q.startsWith("-"),W=G?Q.slice(1):Q;if(!/^\w+$/.test(W))continue;let H=X.get(W);if(!H)continue;Y=Y.orderBy(H,G?"desc":"asc")}return Y}var x2={string:{get:(Z)=>Z!=null?String(Z):null,set:(Z)=>Z!=null?String(Z):null},number:{get:(Z)=>Z!=null?Number(Z):null,set:(Z)=>Z!=null?Number(Z):null},integer:{get:(Z)=>Z!=null?Math.trunc(Number(Z)):null,set:(Z)=>Z!=null?Math.trunc(Number(Z)):null},float:{get:(Z)=>Z!=null?Number.parseFloat(String(Z)):null,set:(Z)=>Z!=null?Number.parseFloat(String(Z)):null},boolean:{get:(Z)=>Z===1||Z==="1"||Z===!0||Z==="true",set:(Z)=>Z===!0||Z===1||Z==="1"||Z==="true"?1:0},json:{get:(Z)=>Z==null?null:typeof Z==="string"?T2(Z):Z,set:(Z)=>Z==null?null:typeof Z==="string"?Z:JSON.stringify(Z)},datetime:{get:(Z)=>Z?new Date(Z):null,set:(Z)=>Z instanceof Date?Z.toISOString():Z},date:{get:(Z)=>Z?new Date(Z):null,set:(Z)=>Z instanceof Date?Z.toISOString().split("T")[0]:Z},array:{get:(Z)=>Z==null?[]:Array.isArray(Z)?Z:typeof Z==="string"?U2(Z):[],set:(Z)=>Z==null?null:Array.isArray(Z)?JSON.stringify(Z):Z}};function T2(Z){try{return JSON.parse(Z)}catch{return Z}}function U2(Z){try{return JSON.parse(Z)}catch{return[]}}function MY(Z,$,X){if(!Z||typeof Z!=="object"||!$||Object.keys($).length===0)return Z;let J={...Z};for(let[Y,Q]of Object.entries($)){let G=typeof Q==="string"?x2[Q]:Q;if(!G||typeof G[X]!=="function")continue;if(Object.prototype.hasOwnProperty.call(J,Y))J[Y]=G[X](J[Y]);let W=y(Y);if(W!==Y&&Object.prototype.hasOwnProperty.call(J,W))J[W]=G[X](J[W])}return J}function t$(Z,$,X){let J=$?.attributes??{},Y={};for(let[Q,G]of Object.entries(J)){let W=G?.validation?.rule;if(!W||typeof W.validate!=="function")continue;let H=Object.prototype.hasOwnProperty.call(Z,Q);if(!H&&X==="updating")continue;let K=G!==null&&typeof G==="object"&&Object.prototype.hasOwnProperty.call(G,"default"),V=H?Z[Q]:K?G.default:void 0,z=F2(W,V),O=W.validate(z);if(!O?.valid&&Array.isArray(O?.errors)&&O.errors.length>0)Y[Q]=O.errors.map((w)=>G?.validation?.message?.[w?.code]??w?.message??"invalid")}return Object.keys(Y).length===0?{valid:!0}:{valid:!1,errors:Y}}function fY(Z){return Z.replace(/\{[^}]*\}/g,"{}").replace(/:[^/]+/g,"{}")}function d8(Z){if(Array.isArray(Z))return Z.filter(($)=>typeof $==="string"&&$.length>0);return typeof Z==="string"&&Z?[Z]:[]}function yY(Z){let $=typeof Z==="object"&&Z!==null&&"middleware"in Z,X=Z?.middleware;if(!$)return{read:["auth"],write:["auth"],declared:!1};if(X&&typeof X==="object"&&!Array.isArray(X)){let Y=X;return{read:"read"in Y?d8(Y.read):["auth"],write:"write"in Y?d8(Y.write):["auth"],declared:!0}}let J=d8(X);return{read:J,write:J,declared:!0}}var i$=15,q2=100;function hY(Z){let $=Number.parseInt(Z.get("page")||String(1),10),X=Number.isFinite($)?Math.max(1,$):1,J=Number.parseInt(Z.get("per_page")||String(i$),10),Y=Math.min(Number.isFinite(J)?Math.max(1,J):i$,q2);return{page:X,perPage:Y,offset:(X-1)*Y}}function B8(Z,$){let X=new URL(Z.toString());return X.searchParams.set("page",String($)),`${X.pathname}${X.search}`}function L2(Z,$,X,J,Y,Q){let G=($-1)*X,W=J===0,H={page:$,per_page:X,from:W?null:G+1,to:W?null:G+J,has_more_pages:Y,prev_page_url:$>1?B8(Z,$-1):null,next_page_url:Y?B8(Z,$+1):null};if(Q!==void 0&&!Number.isNaN(Q)){let K=Math.max(1,Math.ceil(Q/X));H.total=Q,H.last_page=K,H.first_page_url=B8(Z,1),H.last_page_url=B8(Z,K)}return H}function vY(Z,$,X,J,Y,Q){let{page:G,...W}=L2(Z,$,X,J,Y,Q);return{current_page:G,...W}}import{cacheRequestQuery as D2}from"@stacksjs/router";var K8=new WeakMap;function gY(Z,$){return D2(`batchLoad:${Z.name??"model"}:${String($)}`,async()=>{return new Promise((X,J)=>{let Y=K8.get(Z);if(!Y)Y={keys:[],resolvers:[],scheduled:!1},K8.set(Z,Y);if(Y.keys.push($),Y.resolvers.push({key:$,resolve:X,reject:J}),Y.scheduled)return;Y.scheduled=!0,Promise.resolve().then(async()=>{let Q=K8.get(Z);if(!Q)return;K8.delete(Z);let G=Array.from(new Set(Q.keys));try{let W=typeof Z.findMany==="function"?await Z.findMany(G):await Promise.all(G.map((K)=>Z.find?.(K))),H=new Map;for(let K of W??[]){let V=K?.id;if(V!==void 0)H.set(V,K)}for(let K of Q.resolvers)K.resolve(H.get(K.key))}catch(W){for(let H of Q.resolvers)H.reject(W)}})})})}import{db as lY}from"@stacksjs/database";class A2{conditions=[];where(Z,...$){let[X,J]=$,Y=J===void 0?"=":X,Q=J===void 0?X:J;this.addCondition("and","where",Z,Y,Q)}orWhere(Z,...$){let[X,J]=$,Y=J===void 0?"=":X,Q=J===void 0?X:J;this.addCondition("or","where",Z,Y,Q)}whereIn(Z,$){this.conditions.push({type:"and",method:"whereIn",column:Z,values:$})}whereNotIn(Z,$){this.conditions.push({type:"and",method:"whereIn",column:Z,values:$,operator:"not in"})}whereNull(Z){this.conditions.push({type:"and",method:"whereNull",column:Z})}whereNotNull(Z){this.conditions.push({type:"and",method:"whereNotNull",column:Z})}whereBetween(Z,$){this.conditions.push({type:"and",method:"whereBetween",column:Z,range:$})}whereExists(Z){this.conditions.push({type:"and",method:"whereExists",column:"",callback:Z})}addCondition(Z,$,X,J,Y){this.conditions.push({type:Z,method:$,column:X,operator:J,value:Y})}getConditions(){return this.conditions}}import{db as n8,runInTransactionScope as E2}from"@stacksjs/database";async function pY(Z,$){return await E2(async()=>{return await n8.transaction(Z,$)})}async function iY(Z){return await n8.savepoint(Z)}function rY(Z,$){return n8.transactional(Z,$)}import{path as c}from"@stacksjs/path";import{fs as Z0,globSync as t8}from"@stacksjs/storage";import{plural as Z5,singular as s$,snakeCase as j}from"@stacksjs/strings";import{isString as V8}from"@stacksjs/validation";function $5(Z){let $=Z.belongsToMany;if(!$)return[];if(Array.isArray($))return $.map((X)=>({relationName:typeof X==="string"?j(X):j(String(X.model)),relation:X}));return Object.entries($).map(([X,J])=>{if(typeof J==="string")return{relationName:X,relation:J};return{relationName:X,relation:{model:J.model,pivotTable:J.table,firstForeignKey:J.foreignKey,secondForeignKey:J.relatedKey}}})}async function ZQ(Z){if(typeof Z==="string")Z=(await import(Z)).default;return Z.table??j(Z5(Z?.name||""))}function _0(Z,$){if(Z.name)return Z.name;return c.basename($).replace(/\.ts$/,"")}function b(Z,$){if(Z.table)return Z.table;return j(Z5(_0(Z,$)))}function C2(Z,$){let X=[Z,$];return X.sort(),X.join("_")}function $Q(Z,$){return $ in Z}async function P2(Z,$){let X=[];if(Z.hasOne)for(let J of Z.hasOne)X.push(await p8(J,Z,$,"hasOne"));if(Z.hasMany)for(let J of Z.hasMany)X.push(await p8(J,Z,$,"hasMany"));if(Z.belongsTo)for(let J of Z.belongsTo)X.push(await p8(J,Z,$,"belongsTo"));if(Z.hasOneThrough)for(let J of Z.hasOneThrough)X.push(await a$(J,Z,$,"hasOneThrough"));if(Z.hasManyThrough)for(let J of Z.hasManyThrough)X.push(await a$(J,Z,$,"hasManyThrough"));if(Z.belongsToMany)for(let{relationName:J,relation:Y}of $5(Z))X.push(await k2(Y,Z,$,"belongsToMany",J));if(Z.morphOne)X.push(await e$(Z.morphOne,Z,$,"morphOne"));if(Z.morphMany){let J=Array.isArray(Z.morphMany)?Z.morphMany:[Z.morphMany];for(let Y of J)X.push(await e$(Y,Z,$,"morphMany"))}if(Z.morphTo){let J=Z.morphTo,Y=Array.isArray(J)?J:typeof J==="object"&&J!==null?[J]:[];for(let Q of Y)X.push(N2(Q,Z,$))}if(Z.morphToMany){let J=Array.isArray(Z.morphToMany)?Z.morphToMany:[Z.morphToMany];for(let Y of J)X.push(o$(Y,Z,$,"morphToMany"))}if(Z.morphedByMany){let J=Array.isArray(Z.morphedByMany)?Z.morphedByMany:[Z.morphedByMany];for(let Y of J)X.push(o$(Y,Z,$,"morphedByMany"))}return X}function N2(Z,$,X){let J=Z&&typeof Z==="object"&&Z.name?String(Z.name):`${j(X)}able`,Y=Z?.type||`${J}_type`;return{relationship:"morphTo",model:"",table:"",relationTable:"",foreignKey:Z?.id||`${J}_id`,modelKey:Y,relationName:J,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:"",pivotKey:"",pivotTable:""}}function o$(Z,$,X,J){let Y=typeof Z==="object"&&Z!==null,Q=Y?String(Z.model||""):String(Z),G=Y&&Z.morphName?String(Z.morphName):`${j(X)}able`,W=Y&&Z.pivotTable?String(Z.pivotTable):G,H=Y&&Z.id||`${G}_id`,K=Y&&Z.type||`${G}_type`;return{relationship:J,model:Q,table:"",relationTable:"",foreignKey:H,modelKey:K,relationName:G,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:H,pivotKey:K,pivotTable:W}}async function H8(Z,$){let X=r8(`${$}.ts`),J=r8(`${Z}.ts`),Y=i8(`${Z}.ts`),Q=i8(`${$}.ts`);if(!X&&!Q)throw Error(`Model not found: ${$}`);if(!J&&!Y)throw Error(`Model not found: ${Z}`);let G;try{if(Z0.existsSync(X))G=(await import(X)).default;else G=(await import(Q)).default}catch(H){throw Error(`Failed to load model: ${$}. Error: ${H?.message||"Unknown error"}`)}let W=Z0.existsSync(J)?J:Y;return{modelRelation:G,modelPath:W,modelRelationPath:Z0.existsSync(X)?X:Q}}async function a$(Z,$,X,J){let Y="",Q="",G="",W="";if(V8(Z))Y=Z;else Y=Z.model,Q=Z.relationName||"",G=Z.through,W=Z.throughForeignKey||"";let{modelRelation:H,modelPath:K,modelRelationPath:V}=await H8(X,Y),z=b(H,V),O=b($,K),w=j(_0(H,V)),x=j(X);return{relationship:J,model:Y,table:z,relationTable:O,foreignKey:`${x}_id`,modelKey:`${w}_id`,relationName:Q,relationModel:X,throughModel:G,throughForeignKey:W,pivotForeign:`${x}_id`,pivotKey:`${w}_id`,pivotTable:O}}async function k2(Z,$,X,J,Y){let Q="",G="",W="",H=j(X);if(V8(Z))Q=Z;else Q=Z.model,G=Z.pivotTable||"",W=Z.firstForeignKey||`${H}_id`;let{modelRelation:K,modelPath:V,modelRelationPath:z}=await H8(X,Q),O=b(K,z),w=b($,V),x=j(_0(K,z));return{relationship:J,model:Q,table:O,relationTable:w,foreignKey:typeof Z==="string"?`${H}_id`:Z.firstForeignKey||`${H}_id`,modelKey:typeof Z==="string"?`${x}_id`:Z.secondForeignKey||`${x}_id`,relationName:Y,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:W,pivotKey:`${x}_id`,pivotTable:G}}async function e$(Z,$,X,J){let Y="",Q="",G="",W="";if(V8(Z))Y=Z,Q=`${j(X)}able`;else Y=Z.model,Q=Z.morphName||`${j(X)}able`,G=Z.type||`${Q}_type`,W=Z.id||`${Q}_id`;let{modelRelation:H,modelPath:K,modelRelationPath:V}=await H8(X,Y),z=b(H,V),O=b($,K);return{relationship:J,model:Y,table:z,relationTable:O,foreignKey:W||`${Q}_id`,modelKey:G||`${Q}_type`,relationName:Q,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:"",pivotKey:"",pivotTable:O}}async function p8(Z,$,X,J){let Y="",Q="";if(V8(Z))Y=Z;else Y=Z.model,Q=Z.relationName||"";let{modelRelation:G,modelPath:W,modelRelationPath:H}=await H8(X,Y),K=b(G,H),V=b($,W),z=j(_0(G,H)),O=j(X),w={relationship:J,model:Y,table:K,relationTable:V,foreignKey:typeof Z==="string"?`${O}_id`:Z.foreignKey||`${O}_id`,modelKey:`${z}_id`,relationName:Q,relationModel:X,throughModel:"",throughForeignKey:"",pivotForeign:`${O}_id`,pivotKey:`${z}_id`,pivotTable:V};if(J==="belongsTo")w.foreignKey="";return w}function XQ(Z){let $=/belongs/,X=/has/,J=/Through/,Y=/morph/;if(J.test(Z))return"throughType";if($.test(Z))return"belongsType";if(X.test(Z))return"hasType";if(Y.test(Z))return"morphType";return""}function JQ(Z){let $=/One/;if(/Many/.test(Z))return"many";if($.test(Z))return"one";return""}async function YQ(Z,$){let X=[];if("belongsToMany"in Z){for(let{relation:J}of $5(Z)){let Y,Q;if(typeof J==="string")Q=J;else Q=J.model;let G=r8(`${Q}.ts`),W=i8(`${Q}.ts`);if(Z0.existsSync(G))Y=(await import(G)).default;else Y=(await import(W)).default;let H=b(Y,G),K=b(Z,$),V=typeof J==="object"&&"firstForeignKey"in J?J.firstForeignKey:`${s$(K)}_${Z.primaryKey}`,z=typeof J==="object"&&"secondForeignKey"in J?J.secondForeignKey:`${s$(H)}_${Z.primaryKey}`;X.push({table:(typeof J==="object"&&"pivotTable"in J?J.pivotTable:void 0)??C2(K,H),firstForeignKey:V,secondForeignKey:z})}return X}return[]}async function QQ(Z){let $=t8([c.userModelsPath("*.ts"),c.storagePath("framework/defaults/app/Models/**/*.ts")],{absolute:!0}),X=[];for(let J=0;J<$.length;J++){let Y=$[J],Q=await import(Y);if(Z===Q.default.name)continue;let G=_0(Q,Y),W=await P2(Q.default,G);if(!W.length)continue;let H=W.find((K)=>K.model===Z);if(H)X.push(H)}return X}function GQ(Z){if(Z===void 0)return[];return Object.keys(Z).filter(($)=>{return Z[$]?.hidden===!0})}function WQ(Z){let $=Z.attributes;if($===void 0)return[];return Object.keys($).filter((X)=>{return $[X]?.guarded===!0}).map((X)=>j(X))}function BQ(Z,$){let X=Z.attributes,J=[];if(X===void 0)return[];let Y=typeof Z.traits?.billable==="object"||typeof Z.traits?.billable==="boolean",Q=typeof Z.traits?.useAuth==="object"?Z.traits?.useAuth.usePasskey:!1,G=Z.traits?.useUuid||!1;if(Y)J.push("stripe_id");if(G)J.push("uuid");if(Q)J.push(...["two_factor_secret","public_key"]);let W=$.map((H)=>H.foreignKey).filter((H)=>H);return[...Object.keys(X).filter((H)=>{if(X===void 0)return!1;return X[H]?.fillable===!0}).map((H)=>j(H)),...J,...W]}async function KQ(Z,$){let X=Z.attributes;if(!X)X={};let J=Object.keys(X),Y=[],Q=Bun.file($),G="";try{if(await Q.exists())G=await Q.text()}catch{G=""}let W=/rule:.*$/gm,H;H=W.exec(G);while(H!==null)Y.push(H[0]),H=W.exec(G);return J.map((V,z)=>{let O=X[V],w=null,x=!1,U=!1,q=!1,L=!1;if(O)w=O||null,x=O.unique||!1,U=O.hidden||!1,q=O.fillable||!1;let E=Y[z]??"";return L=(O.validation?.rule).isRequired??!1,{field:V,default:w,unique:x,hidden:U,fillable:q,required:L,fieldArray:I2(E)}})}function I2(Z){let $=Z.split("rule: schema.");if($.length!==2)return null;if(!$[1])$[1]="";let X=$[1].replace(/,/g,"");if(!X)return null;let J=X.split("."),Y=/\(([^)]+)\)/;return J.map((Q)=>{let G=Y.exec(Q),W=G?G[1]:null;return{entity:Q.replace(Y,"").replace(/\(|\)/g,""),charValue:W}})[0]||null}function VQ(Z){let $=Z.fieldArray?.entity;switch($){case"enum":return"string | string[]";case"date":return"Date | string";case"timestamp":return"Date | string";case"datetime":return"Date | string";case"float":return"number";case"double":return"number";case"decimal":return"number";case"integer":return"number";case"bigint":return"number";default:return $}}function i8(Z){let $=c.join(c.storagePath("framework/defaults/app/Models"),"/"),X=c.join($,Z);if(Z0.existsSync(X))return X;return t8(`${$}**/${Z}`,{absolute:!0})[0]??""}function r8(Z){let $=c.join(c.userModelsPath("/"),"/"),X=c.join($,Z);if(Z0.existsSync(X))return X;return t8(`${$}**/${Z}`,{absolute:!0})[0]??""}function HQ(Z){let $=typeof Z==="number"?new Date(Z):typeof Z==="string"?new Date(Z):Z;if(Number.isNaN($.getTime()))throw Error(`Invalid date value: ${String(Z)}`);return $.toISOString().replace("T"," ").split(".")[0]??""}function zQ(Z){return Z.toISOString().split("T")[0]??""}function OQ(Z){return Z.getTime()}import{createModel as qX,registerModel as LX}from"@stacksjs/query-builder";import{log as f}from"@stacksjs/logging";import{snakeCase as $8}from"@stacksjs/strings";import{AsyncLocalStorage as N7}from"async_hooks";function j2(Z){if(Z===null||typeof Z!=="object")return!1;let $=Z;return Array.isArray($.data)&&typeof $.current_page==="number"&&typeof $.per_page==="number"&&typeof $.total==="number"&&typeof $.last_page==="number"}function S2(Z){if(Z===null||typeof Z!=="object")return!1;let $=Z;return Array.isArray($.data)&&typeof $.current_page==="number"&&typeof $.per_page==="number"&&typeof $.has_more_pages==="boolean"&&!("total"in $)}function M2(Z){if(Z===null||typeof Z!=="object")return!1;let $=Z;return Array.isArray($.data)&&(typeof $.next_cursor==="string"||$.next_cursor===null)}function s8(Z){let{data:$}=Z,{perPage:X,page:J,total:Y,lastPage:Q}=Z.meta,G=$.length===0,W=G?null:(J-1)*X+1,H=G?null:W+$.length-1;return{data:$,current_page:J,per_page:X,total:Y,last_page:Q,from:W,to:H,has_more_pages:J<Q}}function o8(Z){return{data:Z.data,current_page:Z.meta.page,per_page:Z.meta.perPage,has_more_pages:Z.meta.hasMore}}function a8(Z){return{data:Z.data,per_page:Z.meta.perPage,next_cursor:X5(Z.meta.nextCursor),prev_cursor:X5(Z.meta.prevCursor),has_more_pages:Z.meta.nextCursor!==null&&Z.meta.nextCursor!==void 0}}function X5(Z){if(Z===null||Z===void 0)return null;if(typeof Z==="string")return Z;return JSON.stringify(Z)}function Z9(Z,$){let X=J9(),J=X?e8(X,"per_page"):void 0,Y=X?e8(X,"page"):void 0,Q=Z!==void 0?Math.max(1,Math.floor(Z)):Math.min(100,Math.max(1,J??15)),G=Math.max(1,Math.floor($??Y??1));return{perPage:Q,page:G}}function $9(Z,$){let X=J9(),J=X?Y5(X,"cursor"):void 0,Y=X?e8(X,"per_page"):void 0,Q=Z!==void 0?Math.max(1,Math.floor(Z)):Math.min(100,Math.max(1,Y??15)),W=J5($!==void 0?$:J??null);return{perPage:Q,cursor:W}}function J5(Z){if(Z===null||Z===void 0)return null;if(Array.isArray(Z))return Z;if(typeof Z==="string"&&Z.startsWith("["))try{let $=JSON.parse(Z);if(Array.isArray($))return $}catch{}return Z}function X9(Z){let $=J9();if(!$)return Z;let X=(()=>{try{return new URL($.url)}catch{return null}})();if(!X)return Z;let J=X.pathname;if(Z.path=J,"next_cursor"in Z)return Z.next_page_url=Z.next_cursor!==null?r(X,{cursor:Z.next_cursor}):null,Z.prev_page_url=Z.prev_cursor!==null?r(X,{cursor:Z.prev_cursor}):null,Z;let Y=Z.current_page;if(Z.prev_page_url=Y>1?r(X,{page:Y-1}):null,"total"in Z){let Q=Z.last_page;Z.next_page_url=Y<Q?r(X,{page:Y+1}):null,Z.first_page_url=r(X,{page:1}),Z.last_page_url=r(X,{page:Q})}else Z.next_page_url=Z.has_more_pages?r(X,{page:Y+1}):null;return Z}function r(Z,$){let X=new URL(Z.toString());for(let[J,Y]of Object.entries($))X.searchParams.set(J,String(Y));return`${X.pathname}${X.search}`}var $0;function J9(){if($0===null)return;if($0===void 0)try{let $=D("@stacksjs/router");if(typeof $.getCurrentRequest==="function")$0=$.getCurrentRequest;else{$0=null;return}}catch{$0=null;return}return $0()}function e8(Z,$){let X=Y5(Z,$);if(X===void 0)return;let J=Number(X);return Number.isFinite(J)?J:void 0}function Y5(Z,$){let X=Z.query?.[$];if(X===void 0)return;return Array.isArray(X)?X[0]:X}import{db as wX}from"@stacksjs/database";function w7(Z){let $=wX;return{async createStripeUser(X,J){let{manageCustomer:Y}=await import("@stacksjs/payments");return await Y.createStripeCustomer(X,J)},async updateStripeUser(X,J){let{manageCustomer:Y}=await import("@stacksjs/payments");return await Y.updateStripeCustomer(X,J)},async deleteStripeUser(X){let{manageCustomer:J}=await import("@stacksjs/payments");return await J.deleteStripeUser(X)},async createOrGetStripeUser(X,J){let{manageCustomer:Y}=await import("@stacksjs/payments");return await Y.createOrGetStripeUser(X,J)},async retrieveStripeUser(X){let{manageCustomer:J}=await import("@stacksjs/payments");return await J.retrieveStripeUser(X)},async defaultPaymentMethod(X){let{managePaymentMethod:J}=await import("@stacksjs/payments");return await J.retrieveDefaultPaymentMethod(X)},async setDefaultPaymentMethod(X,J){let{managePaymentMethod:Y}=await import("@stacksjs/payments");return await Y.setDefaultPaymentMethod(X,J)},async addPaymentMethod(X,J){let{managePaymentMethod:Y}=await import("@stacksjs/payments");return await Y.addPaymentMethod(X,J)},async paymentMethods(X,J){let{managePaymentMethod:Y}=await import("@stacksjs/payments");return await Y.listPaymentMethods(X,J)},async newSubscription(X,J,Y,Q={}){let{manageSubscription:G}=await import("@stacksjs/payments"),W=await G.create(X,J,Y,Q),K=W.latest_invoice?.payment_intent;return{subscription:W,paymentIntent:K}},async updateSubscription(X,J,Y,Q={}){let{manageSubscription:G}=await import("@stacksjs/payments"),W=await G.update(X,J,Y,Q),K=W.latest_invoice?.payment_intent;return{subscription:W,paymentIntent:K}},async cancelSubscription(X,J,Y={}){let{manageSubscription:Q}=await import("@stacksjs/payments");return{subscription:await Q.cancel(J,Y)}},async activeSubscription(X){let{manageSubscription:J}=await import("@stacksjs/payments"),Y=await $.selectFrom("subscriptions").where("user_id","=",X.id).where("provider_status","=","active").selectAll().executeTakeFirst();if(Y){let Q=await J.retrieve(X,Y.provider_id||"");return{subscription:Y,providerSubscription:Q}}return},async checkout(X,J,Y={}){let{manageCheckout:Q,manageCustomer:G}=await import("@stacksjs/payments"),W={};if(Y.enableTax)W.automatic_tax={enabled:!0},delete Y.enableTax;if(Y.allowPromotions)W.allow_promotion_codes=!0,delete Y.allowPromotions;let V={...{mode:"payment",customer:(await G.createOrGetStripeUser(X,{})).id,line_items:J.map((z)=>({price:z.priceId,quantity:z.quantity||1}))},...W,...Y};return await Q.create(X,V)},async createSetupIntent(X,J={}){let{manageSetupIntent:Y}=await import("@stacksjs/payments");return await Y.create(X,J)},async subscriptionHistory(X){let{manageInvoice:J}=await import("@stacksjs/payments");return await J.list(X)},async transactionHistory(X){let{manageTransaction:J}=await import("@stacksjs/payments");return await J.list(X)},async connectAccount(X,J={}){let Y=J.accountColumn||"stripe_account_id",Q=(X._attributes??X)[Y];if(!Q)return null;let G=await a6();try{return await G.accounts.retrieve(Q)}catch{return null}},async createConnectAccount(X,J={}){let Y=J.accountColumn||"stripe_account_id",Q=X._attributes??X,G=Q[Y],W=await a6();if(!G){let{stacksIdempotencyKey:H}=await import("@stacksjs/payments"),K=J.modelTable||Z,V=await W.accounts.create({type:J.type??"express",email:J.email??Q.email,country:J.country??"US",capabilities:J.capabilities??{card_payments:{requested:!0},transfers:{requested:!0}}},{idempotencyKey:H("connect.account.create",K,Q.id)});return G=V.id,await $.updateTable(K).set({[Y]:G}).where("id","=",Number(Q.id)).execute(),V}return await W.accounts.retrieve(G)},async connectOnboardLink(X,J){let Y=J.accountColumn||"stripe_account_id",G=(X._attributes??X)[Y];if(!G)throw Error("connectOnboardLink: model has no Stripe Connect account; call createConnectAccount first");return{url:(await(await a6()).accountLinks.create({account:G,refresh_url:J.refreshUrl,return_url:J.returnUrl,type:J.type??"account_onboarding"})).url,accountId:G}},async syncConnectStatus(X,J={}){let Y=J.accountColumn||"stripe_account_id",Q=J.chargesColumn||"charges_enabled",G=J.payoutsColumn||"payouts_enabled",W=X._attributes??X,H=W[Y];if(!H)return{chargesEnabled:!1,payoutsEnabled:!1};let V=await(await a6()).accounts.retrieve(H),z=!!V.charges_enabled,O=!!V.payouts_enabled,w=J.modelTable||Z;return await $.updateTable(w).set({[Q]:z,[G]:O}).where("id","=",Number(W.id)).execute(),{chargesEnabled:z,payoutsEnabled:O}},async chargeWithSplit(X,J){let Y=await a6(),Q=J.accountColumn||"stripe_account_id",G=X._attributes??X,W=J.connectAccountId||G[Q],H={amount:J.amountCents,currency:J.currency||"usd",automatic_payment_methods:{enabled:!0},metadata:J.metadata};if(W){if(H.transfer_data={destination:W},J.platformFeeCents)H.application_fee_amount=J.platformFeeCents}let{freshIdempotencyKey:K}=await import("@stacksjs/payments");return await Y.paymentIntents.create(H,{idempotencyKey:K("payment_intent.create",G.id,J.amountCents)})}}}async function a6(){let Z=globalThis.process?.env?.STRIPE_SECRET_KEY;if(!Z)throw Error("Stripe Connect: STRIPE_SECRET_KEY not configured");return new(await Promise.resolve().then(() => (F7(),_7))).default(Z,{apiVersion:"2026-06-24.dahlia"})}function x7(){return{async generateTwoFactorForModel(Z){let{generateTwoFactorSecret:$}=await import("@stacksjs/auth"),X=$();await Z.update({two_factor_secret:X})},async verifyTwoFactorCode(Z,$){let X=Z.get("two_factor_secret");if(typeof X!=="string")return!1;let{verifyTwoFactorCode:J,RateLimiter:Y}=await import("@stacksjs/auth"),Q=String(Z.id??Z.get?.("id")??Z.get?.("email")??X),G=`2fa:${Q}`;if(await Y.isRateLimited(G)){let{HttpError:H}=await import("@stacksjs/error-handling");throw new H(429,"Too many verification attempts. Please try again later.")}if(!await J($,X))return await Y.recordFailedAttempt(G),!1;try{let{cache:H}=await import("@stacksjs/cache"),K=`2fa:used:${Q}:${$}`;if(await H.has(K))return await Y.recordFailedAttempt(G),!1;await H.set(K,"1",90)}catch{}return await Y.resetAttempts(G),!0}}}import{sqlDateTime as xX}from"@stacksjs/database";import{log as G0}from"@stacksjs/logging";var N8="deleted_at";function T7(Z,$="id"){return{async softDelete(X){let J=xX(),Y=Z.where($,X);if(typeof Y?.update==="function")return await Y.update({[N8]:J}),!0;return!1},async restore(X){let J=Z.where($,X);if(typeof J?.update==="function")return await J.update({[N8]:null}),!0;return!1},async forceDelete(X){let J=Z.where($,X);if(typeof J?.delete==="function")return await J.delete(),!0;return!1},withTrashed(){return typeof Z.query==="function"?Z.query():Z},onlyTrashed(){let X=typeof Z.query==="function"?Z.query():Z;if(typeof X?.whereNotNull==="function")return X.whereNotNull(N8);return X?.where?.(N8,"!=",null)??X}}}function U7(Z){if(Z===!0||Z==null)return{};if(typeof Z==="object"&&!Array.isArray(Z)){let $=Z;if(Array.isArray($.cascade)){let X=$.cascade.filter((J)=>typeof J==="string");return X.length?{cascade:X}:{}}return{}}return{}}function TX(Z,$){let X=Z.hasMany??[],J=Z.hasOne??[],Y=X.some((V)=>S$(V,$,!0)),Q=J.some((V)=>S$(V,$,!1));if(!Y&&!Q)return G0.warn(`[orm] soft-delete cascade: '${$}' is not a declared hasMany/hasOne relation \u2014 skipping`),null;let W=(Y?X:J).find((V)=>S$(V,$,Y))??null;if(!W)return null;let K=globalThis[W];if(!K)return G0.warn(`[orm] soft-delete cascade: model '${W}' is not yet on globalThis \u2014 skipping cascade for '${$}'`),null;return{className:W,model:K}}function S$(Z,$,X){let J=Z.toLowerCase();if($===J)return!0;if(X&&$===`${J}s`)return!0;if(X&&J.endsWith("y")&&$===`${J.slice(0,-1)}ies`)return!0;return!1}async function UX(Z,$,X,J,Y){try{let Q=X.where;if(typeof Q!=="function"){G0.warn(`[orm] cascade ${Y}: child model has no .where()`);return}if(Y==="softDelete"){let G=X.softDelete;if(typeof G==="function"){let H=Q.call(X,J,$),K=typeof H?.get==="function"?await H.get():Array.isArray(H)?H:[],V=X.primaryKey||"id";for(let z of K){let O=z?.[V];if(O!=null)await G.call(X,O)}return}let W=Q.call(X,J,$);if(typeof W?.delete==="function"){G0.debug(`[orm] cascade soft-delete: child has no softDeletes trait, hard-deleting from ${String(X.table??"?")}`),await W.delete();return}}else{let G=X.restore;if(typeof G!=="function"){G0.debug("[orm] cascade restore: child has no restore() \u2014 nothing to do");return}let W=X.withTrashed,K=(typeof W==="function"?W.call(X):X).where?.(J,$),V=typeof K?.get==="function"?await K.get():[],z=X.primaryKey||"id";for(let O of V){let w=O?.[z];if(w!=null)await G.call(X,w)}}}catch(Q){if(G0.warn(`[orm] soft-delete cascade ${Y} on ${Z}#${String($)} failed`,{error:Q}),process.env.STACKS_ORM_CASCADE_SWALLOW!=="true")throw Q}}async function e6(Z,$,X,J){let Y=$.cascade;if(!Y||Y.length===0)return;let Q=`${Z.name.toLowerCase()}_id`;for(let G of Y){let W=TX(Z,G);if(!W)continue;await UX(W.className,X,W.model,Q,J)}}var k7=new N7;function o(){return k7.getStore()?.suppressed===!0}function s(Z){return Promise.resolve(k7.run({suppressed:!0},Z))}var I7=new N7;function DX(){return I7.getStore()?.suppressed===!0}function AX(Z){return Promise.resolve(I7.run({suppressed:!0},Z))}var v$=Symbol.for("stacks.orm.modelDefinition");class j7 extends Error{status=422;errors;constructor(Z,$){let X=Object.keys($).join(", ");super(`${Z} validation failed: ${X}`);this.name="ModelValidationError",this.errors=$}}var q7=new Set;function EX(Z,$){let X=typeof Z==="string"?Z.slice(0,80):String(Z),J=`${typeof Z}:${X}`;if(q7.has(J))return;q7.add(J);let Y=$ instanceof Error?$.message:String($);console.error(`[orm] JSON cast failed to parse value (returning null): ${Y} \u2014 value preview: ${JSON.stringify(X)}`)}var CX={string:{get:(Z)=>Z!=null?String(Z):null,set:(Z)=>Z!=null?String(Z):null},number:{get:(Z)=>Z!=null?Number(Z):null,set:(Z)=>Z!=null?Number(Z):null},integer:{get:(Z)=>Z!=null?Math.trunc(Number(Z)):null,set:(Z)=>Z!=null?Math.trunc(Number(Z)):null},float:{get:(Z)=>Z!=null?Number.parseFloat(String(Z)):null,set:(Z)=>Z!=null?Number.parseFloat(String(Z)):null},boolean:{get:(Z)=>Z===1||Z==="1"||Z===!0||Z==="true",set:(Z)=>Z===!0||Z===1||Z==="1"||Z==="true"?1:0},json:{get:(Z)=>{if(Z==null)return null;if(typeof Z==="string")try{return JSON.parse(Z)}catch($){return EX(Z,$),null}return Z},set:(Z)=>{if(Z==null)return null;return typeof Z==="string"?Z:JSON.stringify(Z)}},datetime:{get:(Z)=>Z?new Date(Z):null,set:(Z)=>Z instanceof Date?Z.toISOString():Z},date:{get:(Z)=>Z?new Date(Z):null,set:(Z)=>Z instanceof Date?Z.toISOString().split("T")[0]:Z},array:{get:(Z)=>{if(Z==null)return[];if(Array.isArray(Z))return Z;if(typeof Z==="string")try{return JSON.parse(Z)}catch{return[]}return[]},set:(Z)=>{if(Z==null)return null;return Array.isArray(Z)?JSON.stringify(Z):Z}}};function S7(Z){return typeof Z==="string"?CX[Z]:Z}function L7(Z,$,X){if(!Z||typeof Z!=="object")return Z;let J={...Z};for(let[Y,Q]of Object.entries($))if(Y in J){let G=S7(Q);J[Y]=G[X](J[Y])}return J}var k8=new Set(["_attributes","_original","_definition","_hasSaved","_relations"]),D7=Symbol.for("stacks.modelInstanceProxy"),PX={tags:{bag:"_taggable",mode:"id"},tagCount:{bag:"_taggable",mode:"id"},addTag:{bag:"_taggable",mode:"id"},activeTags:{bag:"_taggable",mode:"id"},inactiveTags:{bag:"_taggable",mode:"id"},removeTag:{bag:"_taggable",mode:"id"},categories:{bag:"_categorizable",mode:"id"},categoryCount:{bag:"_categorizable",mode:"id"},addCategory:{bag:"_categorizable",mode:"id"},activeCategories:{bag:"_categorizable",mode:"id"},inactiveCategories:{bag:"_categorizable",mode:"id"},removeCategory:{bag:"_categorizable",mode:"id"},comments:{bag:"_commentable",mode:"id"},commentCount:{bag:"_commentable",mode:"id"},addComment:{bag:"_commentable",mode:"id"},approvedComments:{bag:"_commentable",mode:"id"},pendingComments:{bag:"_commentable",mode:"id"},rejectedComments:{bag:"_commentable",mode:"id"},likes:{bag:"_likeable",mode:"id"},likeCount:{bag:"_likeable",mode:"id"},like:{bag:"_likeable",mode:"id"},unlike:{bag:"_likeable",mode:"id"},isLiked:{bag:"_likeable",mode:"id"},createStripeUser:{bag:"_billable",mode:"model"},updateStripeUser:{bag:"_billable",mode:"model"},deleteStripeUser:{bag:"_billable",mode:"model"},createOrGetStripeUser:{bag:"_billable",mode:"model"},retrieveStripeUser:{bag:"_billable",mode:"model"},defaultPaymentMethod:{bag:"_billable",mode:"model"},setDefaultPaymentMethod:{bag:"_billable",mode:"model"},addPaymentMethod:{bag:"_billable",mode:"model"},paymentMethods:{bag:"_billable",mode:"model"},newSubscription:{bag:"_billable",mode:"model"},updateSubscription:{bag:"_billable",mode:"model"},cancelSubscription:{bag:"_billable",mode:"model"},activeSubscription:{bag:"_billable",mode:"model"},checkout:{bag:"_billable",mode:"model"},createSetupIntent:{bag:"_billable",mode:"model"},subscriptionHistory:{bag:"_billable",mode:"model"},transactionHistory:{bag:"_billable",mode:"model"},connectAccount:{bag:"_billable",mode:"model"},createConnectAccount:{bag:"_billable",mode:"model"},connectOnboardLink:{bag:"_billable",mode:"model"},syncConnectStatus:{bag:"_billable",mode:"model"},chargeWithSplit:{bag:"_billable",mode:"model"},generateTwoFactorForModel:{bag:"_twoFactor",mode:"model"},verifyTwoFactorCode:{bag:"_twoFactor",mode:"model"}};function NX(Z,$){if(!Z||!$)return null;let X=$.split("."),J=Z;for(let Y of X){if(J==null||typeof J!=="object")return null;let Q=J;if("_attributes"in Q&&Q._attributes&&typeof Q._attributes==="object"){let G=Q._attributes;if(Y in G){J=G[Y];continue}}if(Y in Q){J=Q[Y];continue}return null}return J??null}function R(Z,$){if(!Z||typeof Z!=="object")return Z;if(Z[D7])return Z;let X=Z._attributes;if(!X||typeof X!=="object")return Z;if($&&Object.keys($).length>0){for(let[J,Y]of Object.entries($))if(Object.prototype.hasOwnProperty.call(X,J))X[J]=S7(Y).get(X[J])}return new Proxy(Z,{get(J,Y,Q){if(Y===D7)return!0;if(Y==="saveAsync")return async function(){let W=J._definition,H=W?.set;if(H&&typeof J.isDirty==="function"){for(let[V,z]of Object.entries(H)){if(typeof z!=="function")continue;if(!J.isDirty(V))continue;let O=z(J._attributes),w=O&&typeof O.then==="function"?await O:O;J._attributes[V]=w}let K=W.set;W.set={};try{return J.save()}finally{W.set=K}}return J.save()};if(Y==="save")return function(){let W=J._definition,H=W?.set;if(H&&Object.keys(H).length>0&&typeof J.isDirty==="function"){for(let[V,z]of Object.entries(H)){if(typeof z!=="function")continue;if(!J.isDirty(V))continue;let O=z(J._attributes);if(O&&typeof O.then==="function")throw Error(`Setter for "${V}" returned a Promise \u2014 use \`saveAsync()\` instead of \`save()\` when a model has async setters.`);J._attributes[V]=O}let K=W.set;W.set={};try{return J.save()}finally{W.set=K}}return J.save()};if(Y==="updateAsync")return async function(W){if(W&&typeof W==="object"&&!Array.isArray(W))for(let[H,K]of Object.entries(W))Q[H]=K;return Q.saveAsync()};if(Y==="saveQuietly")return function(){return s(()=>J.save())};if(Y==="saveAsyncQuietly")return function(){return s(()=>Q.saveAsync())};if(Y==="updateQuietly")return function(W){return s(()=>J.update(W))};if(Y==="updateAsyncQuietly")return function(W){return s(()=>Q.updateAsync(W))};if(Y==="deleteQuietly")return function(){return s(()=>J.delete())};if(Y==="toSearchableObject")return function(){let K=J._definition?.traits?.useSearch;if(!K)return null;let V=J._attributes;if(!V)return null;if(K===!0){let U={...V};if(V.id!=null)U.id=String(V.id);return U}let z={},O=K.displayable?.length?K.displayable:[...K.searchable??[],...K.filterable??[],...K.sortable??[],"id"],w=K.denormalize??{},x=J._relations;for(let U of O){let q=$8(U),L=V[q]??V[U];if(L!==void 0){z[q]=L;continue}let E=w[U]??w[q];if(E){z[q]=NX(x,E);continue}z[q]=void 0}if(V.id!=null)z.id=String(V.id);return z};if(typeof Y==="string"&&!k8.has(Y)){let W=J._attributes;if(W&&Object.prototype.hasOwnProperty.call(W,Y))return W[Y];let H=J._relations;if(H&&Object.prototype.hasOwnProperty.call(H,Y)){let V=H[Y];if(Array.isArray(V))return V.map((z)=>R(z,$));return R(V,$)}let K=PX[Y];if(K){let O=J._definition?.__traitMethods?.[K.bag]?.[Y];if(typeof O==="function")return K.mode==="model"?(...w)=>O(Q,...w):(...w)=>O(J.id,...w)}}let G=Reflect.get(J,Y,J);return typeof G==="function"?G.bind(J):G},set(J,Y,Q,G){if(typeof Y==="string"&&!k8.has(Y)){let{_attributes:W,set:H}=J;if(W&&Object.prototype.hasOwnProperty.call(W,Y)){if(typeof H==="function")H.call(J,Y,Q);else W[Y]=Q;return!0}if(W&&!(Y in J)){if(typeof H==="function")H.call(J,Y,Q);else W[Y]=Q;return!0}}return Reflect.set(J,Y,Q,G)},has(J,Y){if(typeof Y==="string"&&!k8.has(Y)){let Q=J._attributes;if(Q&&Object.prototype.hasOwnProperty.call(Q,Y))return!0;let G=J._relations;if(G&&Object.prototype.hasOwnProperty.call(G,Y))return!0}return Reflect.has(J,Y)},deleteProperty(J,Y){if(typeof Y==="string"&&!k8.has(Y)){let Q=J._attributes;if(Q&&Object.prototype.hasOwnProperty.call(Q,Y))return delete Q[Y],!0}return Reflect.deleteProperty(J,Y)},ownKeys(J){let Y=J._attributes;return Y?Object.keys(Y):[]},getOwnPropertyDescriptor(J,Y){if(typeof Y==="string"){let Q=J._attributes;if(Q&&Object.prototype.hasOwnProperty.call(Q,Y))return{configurable:!0,enumerable:!0,value:Q[Y],writable:!0}}return Object.getOwnPropertyDescriptor(J,Y)}})}var kX=new Set(["get","first","last","firstOrFail","find","findOrFail","all","paginate","simplePaginate","cursorPaginate"]),IX={paginate:s8,simplePaginate:o8,cursorPaginate:a8},A7=Symbol.for("stacks.queryBuilderProxy");function M7(Z,$){if(!Z||typeof Z!=="object")return Z;if(Z[A7])return Z;return new Proxy(Z,{get(X,J,Y){if(J===A7)return!0;let Q=Reflect.get(X,J,Y);if(typeof Q!=="function")return Q;return function(...G){let W=G,H=String(J);if(H==="paginate"||H==="simplePaginate"){let{perPage:z,page:O}=Z9(G[0],G[1]);W=[z,O]}else if(H==="cursorPaginate"){let{perPage:z,cursor:O}=$9(G[0],G[1]);W=[z,O,G[2],G[3]]}let K=Q.apply(X,W),V=(z)=>{if(kX.has(H)){if(Array.isArray(z))return z.map((w)=>R(w,$));let O=IX[H];if(O&&z&&Array.isArray(z.data)){let w=z.data.map((U)=>R(U,$)),x=O({...z,data:w});return X9(x)}if(z&&Array.isArray(z.data))return{...z,data:z.data.map((w)=>R(w,$))};return R(z,$)}if(z&&typeof z==="object"&&typeof z.get==="function")return M7(z,$);return z};if(K&&typeof K.then==="function")return K.then(V);return V(K)}}})}function jX(Z,$){let X=["find","first","last","all","firstOrFail","findOrFail","findMany"];for(let Q of X){let G=Z[Q];if(typeof G!=="function")continue;Z[Q]=function(...W){let H=G.apply(this,W),K=(V)=>Array.isArray(V)?V.map((z)=>R(z,$)):R(V,$);if(H&&typeof H.then==="function")return H.then(K);return K(H)}}let J=["create","firstOrCreate","updateOrCreate","make"];for(let Q of J){let G=Z[Q];if(typeof G!=="function")continue;Z[Q]=function(...W){let H=G.apply(this,W),K=(V)=>Array.isArray(V)?V.map((z)=>R(z,$)):R(V,$);if(H&&typeof H.then==="function")return H.then(K);return K(H)}}let Y=["query","where","orWhere","whereIn","whereNotIn","whereNull","whereNotNull","whereLike","whereBetween","whereNotBetween","orderBy","orderByDesc","select","with","limit","take","skip","latest","oldest"];for(let Q of Y){let G=Z[Q];if(typeof G!=="function")continue;Z[Q]=function(...W){let H=G.apply(this,W);return M7(H,$)}}}class f7 extends Error{model;id;constructor(Z,$){super($!=null?`[ORM] ${Z} not found for id=${String($)}`:`[ORM] No matching ${Z} row`);this.name="ModelNotFoundError",this.model=Z,this.id=$}}class f$ extends Error{model;attribute;reason;constructor(Z,$,X){let J=X==="guarded"?`'${$}' is marked guarded`:`'${$}' is not in the fillable allowlist`;super(`[ORM] Mass assignment to ${Z} forbidden: ${J}. Use ${Z}.forceCreate(...) / .forceUpdate(...) to bypass.`);this.name="MassAssignmentException",this.model=Z,this.attribute=$,this.reason=X}}var SX=new Set(["id","created_at","updated_at","deleted_at","uuid"]);function Z8(Z,$,X={}){if(X.force)return $;if(!$||typeof $!=="object"||Array.isArray($))return $;let J=Z.attributes;if(!J)return $;let Y=new Set,Q=new Set,G=new Set;for(let[H,K]of Object.entries(J)){let V=$8(H);if(Y.add(V),K?.fillable===!0)Q.add(V);if(K?.guarded===!0)G.add(V)}let W=Q.size>0?Q:Y;for(let H of Object.keys($)){let K=$8(H);if(SX.has(K))continue;if(G.has(K))throw new f$(Z.name,H,"guarded");if(K.endsWith("_id"))continue;if(!W.has(K))throw new f$(Z.name,H,"not-fillable")}return $}async function y$(Z,$){let X=Z.set;if(!X||typeof X!=="object")return $;let J={...$};for(let[Y,Q]of Object.entries(X)){if(typeof Q!=="function"||!(Y in J))continue;try{J[Y]=await Q(J)}catch(G){f.error(`[orm] ${Z.name}.set.${Y} threw \u2014 skipping setter`,G)}}return J}function MX(Z,$){let X=$.primaryKey||"id",J=Z.create;function Y(K){let V=Z.where;if(typeof V!=="function")throw Error(`[ORM] ${$.name}.${K} needs a working where(): the underlying query builder did not expose one`);return V}function Q(K){let V=Z.find;if(typeof V!=="function")throw Error(`[ORM] ${$.name}.${K} needs a working find(): the underlying query builder did not expose one`);return V}function G(K){let V=Z.create;if(typeof V!=="function")throw Error(`[ORM] ${$.name}.${K} cannot create: the underlying query builder did not expose create()`);return V}if(typeof Z.update!=="function")Z.update=async function(K,V){if(K==null)throw Error(`[ORM] ${$.name}.update requires an id as the first argument`);if(!V||typeof V!=="object"||Array.isArray(V))throw Error(`[ORM] ${$.name}.update requires a data object as the second argument`);if(Object.keys(V).length===0){f.debug(`[orm] ${$.name}.update called with empty data \u2014 short-circuiting and returning current row`);let w=Z.find;return typeof w==="function"?await w.call(Z,K):null}Z8($,V);let z=await y$($,V);await Y("update").call(Z,X,K).update(z);let O=Z.find;return typeof O==="function"?await O.call(Z,K):null};if(typeof Z.forceUpdate!=="function")Z.forceUpdate=async function(K,V){if(K==null)throw Error(`[ORM] ${$.name}.forceUpdate requires an id as the first argument`);if(!V||typeof V!=="object"||Array.isArray(V))throw Error(`[ORM] ${$.name}.forceUpdate requires a data object as the second argument`);let z=await y$($,V);await Y("forceUpdate").call(Z,X,K).update(z);let O=Z.find;return typeof O==="function"?await O.call(Z,K):null};if(typeof Z.forceCreate!=="function")Z.forceCreate=async function(K){if(!K||typeof K!=="object"||Array.isArray(K))throw Error(`[ORM] ${$.name}.forceCreate requires a data object`);let V=Z.make;if(typeof V==="function"){let z=V.call(Z);if(z&&typeof z.forceFill==="function"&&typeof z.save==="function")return z.forceFill(K),await z.save()??z}if(typeof J!=="function")throw Error(`[ORM] ${$.name}.forceCreate cannot create: the underlying query builder did not expose create()`);return await J.call(Z,K)};if(typeof Z.delete!=="function")Z.delete=async function(K){if(K==null)throw Error(`[ORM] ${$.name}.delete requires an id as the first argument`);if(!await Q("delete").call(Z,K))return!1;return await Y("delete").call(Z,X,K).delete(),!0};if(typeof Z.findOrFail!=="function")Z.findOrFail=async function(K){let V=await Q("findOrFail").call(Z,K);if(V==null)throw new f7($.name,K);return V};if(typeof Z.exists!=="function")Z.exists=async function(K){if(K==null)return!1;let V=Y("exists").call(Z,X,K);if(typeof V.count==="function"){let O=await V.count();return Number(O)>0}let z=Z.find;return typeof z==="function"?await z.call(Z,K)!=null:!1};if(typeof Z.firstOrCreate!=="function")Z.firstOrCreate=async function(K,V={}){if(!K||typeof K!=="object"||Array.isArray(K))throw Error(`[ORM] ${$.name}.firstOrCreate requires a where-attrs object`);let z=Y("firstOrCreate").call(Z,K),O=typeof z.first==="function"?await z.first():await z;if(O)return O;let w={...K,...V};return Z8($,w),await G("firstOrCreate").call(Z,w)};if(typeof Z.updateOrCreate!=="function")Z.updateOrCreate=async function(K,V){if(!K||typeof K!=="object"||Array.isArray(K))throw Error(`[ORM] ${$.name}.updateOrCreate requires a where-attrs object`);if(!V||typeof V!=="object"||Array.isArray(V))throw Error(`[ORM] ${$.name}.updateOrCreate requires a values object`);let z=Y("updateOrCreate").call(Z,K),O=typeof z.first==="function"?await z.first():await z;if(O){Z8($,V);let x=O[X];await Y("updateOrCreate").call(Z,X,x).update(V);let U=Z.find;return typeof U==="function"?await U.call(Z,x):{...O,...V}}let w={...K,...V};return Z8($,w),await G("updateOrCreate").call(Z,w)};if(typeof Z.count!=="function")Z.count=async function(){let K=Z;if(typeof K.query==="function"){let O=K.query();if(typeof O?.count==="function"){let w=await O.count();return Number(w)||0}}let{all:V,get:z}=Z;if(typeof V==="function")return(await V.call(Z)||[]).length;if(typeof z==="function")return(await z.call(Z)||[]).length;return 0};if(typeof Z.pluck!=="function")Z.pluck=async function(K){if(!K||typeof K!=="string")throw Error(`[ORM] ${$.name}.pluck requires a column name`);let V=Z.all;return((typeof V==="function"?await V.call(Z):[])||[]).map((O)=>O?.[K])};if(typeof Z.whereIn!=="function")Z.whereIn=async function(K,V){if(!K||typeof K!=="string")throw Error(`[ORM] ${$.name}.whereIn requires a column name`);if(!Array.isArray(V))throw Error(`[ORM] ${$.name}.whereIn requires an array of values`);if(V.length===0)return[];let z=Z.where;if(typeof z!=="function")return[];let O=z.call(Z,K,"in",V);if(O&&typeof O.get==="function")return await O.get();return await O};let W=[["latest","desc"],["oldest","asc"]];for(let[K,V]of W)if(typeof Z[K]!=="function")Z[K]=async function(z="created_at"){let O=Z,w=typeof O.query==="function"?O.query():O;if(typeof w?.orderBy==="function"){let L=w.orderBy(z,V);if(typeof L.first==="function")return await L.first();if(typeof L.get==="function")return(await L.get())?.[0]??null}let x=Z.all;if(typeof x!=="function")return null;return[...await x.call(Z)||[]].sort((L,E)=>{let P=L?.[z],I=E?.[z];if(P===I)return 0;return(P>I?1:-1)*(V==="desc"?-1:1)})[0]??null};let H=h7($.traits?.useSearch,$);if(H){let K=H.index??$.table??$8(`${$.name}s`);if(typeof Z.search!=="function")Z.search=function(V,z){return vX(Z,K,V,z,H.searchable)};if(typeof Z.makeAllSearchable!=="function")Z.makeAllSearchable=async function(V=500){let z=Z.all;if(typeof z!=="function")throw Error(`[ORM] ${$.name}.makeAllSearchable cannot run: the underlying query builder did not expose all()`);let{useSearchEngine:O}=await import("@stacksjs/search-engine"),w=O(),x=0,U=Z.query;if(typeof U==="function")try{let E=U.call(Z);if(E&&typeof E.chunk==="function")return await E.chunk(V,async(P)=>{let I=await h$(P,H);if(I.length>0)await w.addDocuments(K,I);x+=I.length}),x}catch{}let q=await z.call(Z)||[],L=await h$(q,H);if(L.length>0)await w.addDocuments(K,L);return L.length};if(typeof Z.removeAllFromSearch!=="function")Z.removeAllFromSearch=async function(){let{useSearchEngine:V}=await import("@stacksjs/search-engine"),z=V();if(typeof z.deleteAllDocuments==="function"){await z.deleteAllDocuments(K);return}let O=Z.all,w=typeof O==="function"?await O.call(Z)||[]:[],x=V();for(let U of w){let q=U?.id??U?._attributes?.id;if(q!=null)await x.deleteDocument(K,Number(q))}}}}async function h$(Z,$){if(Z.length===0)return[];if(typeof $.shapeMany==="function"){let J=await $.shapeMany(Z);if(!Array.isArray(J)||J.length!==Z.length)throw TypeError(`[orm/search] shapeMany returned ${Array.isArray(J)?J.length:typeof J} documents for ${Z.length} rows. It must return one document per row, in order, or documents are indexed under the wrong ids.`);return J.filter(Boolean)}return(await Promise.all(Z.map((J)=>hX(J,$)))).filter(Boolean)}function fX(Z){let $=new Set,X=Z.attributes??{};for(let[J,Y]of Object.entries(X))if(Y?.hidden)$.add(J);return $}function yX(Z,$){if(!Z||$.size===0)return Z;let X={};for(let[J,Y]of Object.entries(Z))if(!$.has(J))X[J]=Y;return X}async function hX(Z,$){if(typeof $.shape==="function")try{return await $.shape(Z)}catch{return}let X=Z?.toSearchableObject?.();if(X!==void 0)return X;return yX(Z?._attributes??(typeof Z?.toJSON==="function"?Z.toJSON():null),$.hidden??new Set)}function vX(Z,$,X,J,Y){let Q=Y&&Y.length>0?{query_by:[...Y].join(",")}:{},G={q:X,...Q,...J??{}},W={with(H){return G={...G,...H},W},where(H){return G={...G,filter:H},W},async get(){let{useSearchEngine:H}=await import("@stacksjs/search-engine");return(await H().search($,G))?.hits??[]},async paginate(H,K=1){let{useSearchEngine:V}=await import("@stacksjs/search-engine"),O=await V().search($,{...G,limit:H,offset:(K-1)*H});return{hits:O.hits??[],total:Number(O.estimatedTotalHits??O.nbHits??O.total??0),page:K,perPage:H}},async raw(){let{useSearchEngine:H}=await import("@stacksjs/search-engine");return await H().search($,G)}};return W}async function M$(Z,$){if(!Z||typeof Z!=="object")return;let X=Z._attributes??Z;for(let J of $){if(!(J in X))continue;let Y=X[J];if(!K0(Y))continue;X[J]=await f8(Y)}}function RX(Z,$){if($.length===0)return;let X=async(G)=>{if(Array.isArray(G)){for(let W of G)await M$(W,$);return G}if(G&&typeof G==="object"&&Array.isArray(G.data)){for(let W of G.data)await M$(W,$);return G}if(G)await M$(G,$);return G},J=["find","first","last","all","firstOrFail","findOrFail","findMany"];for(let G of J){let W=Z[G];if(typeof W!=="function")continue;Z[G]=async function(...H){let K=await W.apply(this,H);return await X(K)}}let Y=["create","firstOrCreate","updateOrCreate","make"];for(let G of Y){let W=Z[G];if(typeof W!=="function")continue;Z[G]=async function(...H){let K=await W.apply(this,H);return await X(K)}}let Q=Z.update;if(typeof Q==="function")Z.update=async function(G,W){let H=await Q.call(this,G,W);return await X(H)}}function bX(Z,$){if($.length===0)return;let X=async(Q)=>{if(!Q||typeof Q!=="object"||Array.isArray(Q))return Q;let G={...Q};for(let W of $)if(W in G)G[W]=await M8(G[W]);return G},J=["create","firstOrCreate","updateOrCreate"];for(let Q of J){let G=Z[Q];if(typeof G!=="function")continue;Z[Q]=async function(...W){if(W[0]=await X(W[0]),W[1])W[1]=await X(W[1]);return await G.apply(this,W)}}let Y=Z.update;if(typeof Y==="function")Z.update=async function(Q,G){let W=await X(G);return await Y.call(this,Q,W)}}function gX(Z,$){let X=Z.create;if(typeof X==="function")Z.create=async function(J,...Y){Z8($,J);let Q=await y$($,J);return await X.call(this,Q,...Y)};for(let J of["firstOrCreate","updateOrCreate"]){let Y=Z[J];if(typeof Y!=="function")continue}}function uX(Z,$){let X=String($?.name??Z.name??"Model"),J=(G,W)=>{if(DX())return;if(!G||typeof G!=="object"||Array.isArray(G))return;let H=t$(G,$,W);if(!H.valid)throw new j7(X,H.errors)},Y=Z.create;if(typeof Y==="function")Z.create=async function(G,...W){return J(G,"creating"),await Y.call(this,G,...W)};let Q=Z.update;if(typeof Q==="function")Z.update=async function(G,W,...H){return J(W,"updating"),await Q.call(this,G,W,...H)}}function cX(Z,$){let X=["create","firstOrCreate","updateOrCreate"];for(let Y of X){let Q=Z[Y];if(typeof Q==="function")Z[Y]=async function(...G){if(f.debug(`[orm] ${Y.charAt(0).toUpperCase()+Y.slice(1)} ${String(Z.name||"unknown")}`,G[0]),G[0]&&typeof G[0]==="object"&&!Array.isArray(G[0]))G[0]=L7(G[0],$,"set");return await Q.apply(this,G)}}let J=Z.update;if(typeof J==="function")Z.update=async function(Y,Q){let G=Q&&typeof Q==="object"&&!Array.isArray(Q)?L7(Q,$,"set"):Q;return await J.call(this,Y,G)}}function y7(Z){f.debug(`[orm] Defining model: ${Z.name} (table: ${Z.table})`);let $=mX(Z),X=dX(Z),J=lX($,X),Y=nX(Z);Z.__traitMethods=Y;let Q=J?{...Z,hooks:{...Z.hooks,...J}}:Z,W=qX(Q);if(jX(W,Z.casts),MX(W,Q),gX(W,Q),Z.casts&&Object.keys(Z.casts).length>0)cX(W,Z.casts);let H=y8(Z);if(H.length>0)bX(W,H),RX(W,H);let K=Z.traits?.useSoftDeletes;if(K)pX(W,Q,K);let V=Z.traits?.useAudit;if(V){let O=d$(V);n$(W,Z.name,Z.primaryKey||"id",O)}uX(W,Q),W.withoutValidation=function(O){return AX(O)},W.withoutEvents=function(O){return s(O)};for(let O of["create","update","firstOrCreate","updateOrCreate","forceCreate","forceUpdate","delete","forceDelete","softDelete","restore"]){let w=W[O];if(typeof w!=="function")continue;let x=`${O}Quietly`;if(typeof W[x]==="function")continue;W[x]=function(...U){return s(()=>w.apply(W,U))}}let z=Object.assign(W,Y,{...Z,getDefinition:()=>Z,_isStacksModel:!0});return LX(Z.name,z),Object.defineProperty(z,v$,{value:Z,enumerable:!1,configurable:!0}),z}function mX(Z){let $=Z.traits?.observe;if(!$)return;let X=Z.name.toLowerCase(),J=(O)=>{let w=O?.attributes;if(!w||typeof w!=="object")return O;let x=Z.primaryKey||"id",U={...w};if(U[x]===void 0&&O[x]!==void 0)U[x]=O[x];return U},Y=async(O,w)=>{if(o())return;try{let{dispatch:x}=await import("@stacksjs/events");await x(O,w)}catch(x){if(x&&typeof x==="object"&&"code"in x&&x.code==="MODULE_NOT_FOUND")return;if(console.error(`[ORM] Event '${O}' handler error:`,x),process.env.STACKS_ORM_EVENT_ERRORS!=="swallow")throw x}},Q=Z.traits?.broadcastOn,G=Z.traits?.broadcastWith,W=typeof Q==="function"&&typeof G==="function",H=async(O,w)=>{if(!W)return;if(o())return;try{let x=Q(w),U=Array.isArray(x)?x:[x],q=G(w),E=(await import("@stacksjs/realtime").catch(()=>null))?.broadcast;if(typeof E!=="function")return;for(let P of U){if(typeof P!=="string"||P.length===0)continue;await E(P,O,q)}}catch(x){if(x&&typeof x==="object"&&"code"in x&&x.code==="MODULE_NOT_FOUND")return;if(console.error(`[ORM] Broadcast '${O}' handler error:`,x),process.env.STACKS_ORM_BROADCAST_ERRORS==="throw")throw x}},K=async(O,w)=>{if(o())return!0;try{let{dispatchAsync:x}=await import("@stacksjs/events"),U=await x(O,w);if(Array.isArray(U)&&U.some((q)=>q===!1))return!1}catch(x){if(x&&typeof x==="object"&&"code"in x&&x.code==="MODULE_NOT_FOUND")return!0;if(console.error(`[ORM] Before-event '${O}' handler error:`,x),process.env.STACKS_ORM_EVENT_ERRORS!=="swallow")throw x}return!0},V=$===!0?["create","update","delete"]:Array.isArray($)?$:[],z={};if(V.includes("create"))z.beforeCreate=async(O)=>{if(f.debug(`[orm] Create ${X}`,O),!await K(`${X}:saving`,O))throw Error(`[ORM] ${X}:saving event cancelled the operation`);if(!await K(`${X}:creating`,O))throw Error(`[ORM] ${X}:creating event cancelled the operation`)},z.afterCreate=async(O)=>{let w=J(O);await Y(`${X}:created`,w),await Y(`${X}:saved`,w),await H(`${X}:created`,O)};if(V.includes("update"))z.beforeUpdate=async(O)=>{if(f.debug(`[orm] Update ${X}#${O?.id??"unknown"}`,O),!await K(`${X}:saving`,O))throw Error(`[ORM] ${X}:saving event cancelled the operation`);if(!await K(`${X}:updating`,O))throw Error(`[ORM] ${X}:updating event cancelled the operation`)},z.afterUpdate=async(O)=>{let w=J(O);await Y(`${X}:updated`,w),await Y(`${X}:saved`,w),await H(`${X}:updated`,O)};if(V.includes("delete"))z.beforeDelete=async(O)=>{if(f.debug(`[orm] Delete ${X}#${O?.id??"unknown"}`),!await K(`${X}:deleting`,O))throw Error(`[ORM] ${X}:deleting event cancelled the operation`)},z.afterDelete=async(O)=>{await Y(`${X}:deleted`,J(O)),await H(`${X}:deleted`,O)};return z}function lX(...Z){let $={},X=new Set;for(let J of Z){if(!J)continue;for(let Y of Object.keys(J))X.add(Y)}for(let J of X){let Y=Z.map((Q)=>Q?.[J]).filter((Q)=>typeof Q==="function");if(!Y.length)continue;$[J]=async(...Q)=>{for(let G of Y)await G(...Q)}}return Object.keys($).length?$:void 0}function h7(Z,$){if(!Z)return null;let X=Z===!0?{}:typeof Z==="object"?{...Z}:null;if(!X)return null;if($)X.hidden=fX($);return X}function dX(Z){let $=h7(Z.traits?.useSearch,Z);if(!$)return;let X=$,J=X.index??Z.table??$8(`${Z.name}s`);async function Y(W){if(typeof X.shapeMany==="function")try{let[V]=await h$([W],X);return V}catch(V){f.warn(`[orm/search] shapeMany() threw for ${Z.name}: ${V.message}`);return}if(typeof X.shape==="function")try{return await X.shape(W)}catch(V){f.warn(`[orm/search] shape() threw for ${Z.name}: ${V.message}`);return}let K=R(W).toSearchableObject?.();if(K!==void 0)return K;return W?._attributes??(typeof W?.toJSON==="function"?W.toJSON():null)}let Q=async(W)=>{if(o())return;let H=await Y(W);if(!H)return;if($.queueable){try{let{Jobs:K}=await import("@stacksjs/queue");await K.dispatch("SyncSearchIndex",{index:J,op:"upsert",doc:H})}catch(K){f.warn(`[orm/search] queue dispatch failed for ${Z.name}; falling back to inline: ${K.message}`),await C7(J,H,Z.name)}return}await C7(J,H,Z.name)};return{afterCreate:Q,afterUpdate:Q,afterDelete:async(W)=>{if(o())return;let H=W?.id??W?._attributes?.id;if(H==null)return;if($.queueable){try{let{Jobs:K}=await import("@stacksjs/queue");await K.dispatch("SyncSearchIndex",{index:J,op:"delete",id:Number(H)})}catch(K){f.warn(`[orm/search] queue dispatch failed for ${Z.name}#${H}; falling back to inline: ${K.message}`),await P7(J,Number(H),Z.name)}return}await P7(J,Number(H),Z.name)}}}var E7=new Map;function v7(Z,$){let X=E7.get(Z)??0;if(E7.set(Z,X+1),X===0)f.warn(`[orm/search] ${$}`);else if(X===9)f.warn(`[orm/search] ${Z} is still failing; further identical warnings suppressed for this process.`)}async function C7(Z,$,X){try{let{useSearchEngine:J}=await import("@stacksjs/search-engine");await J().addDocument(Z,$)}catch(J){v7(`index:${X}`,`Failed to index ${X}: ${J.message}`)}}async function P7(Z,$,X){try{let{useSearchEngine:J}=await import("@stacksjs/search-engine");await J().deleteDocument(Z,$)}catch(J){v7(`remove:${X}`,`Failed to remove ${X}#${$}: ${J.message}`)}}function nX(Z){let $={},X=Z.table,J=Z.traits;if(!J)return $;if(J.taggable)$._taggable=c8(X);if(J.categorizable)$._categorizable=m8(X);if(J.commentable)$._commentable=g8(X);if(J.billable)$._billable=w7(X);if(J.likeable){let Q=typeof J.likeable==="object"?J.likeable:void 0;$._likeable=l8(X,Q)}let Y=J.useAuth||J.authenticatable;if(typeof Y==="object"&&Y&&"useTwoFactor"in Y&&Y.useTwoFactor)$._twoFactor=x7();return $}function pX(Z,$,X){let J=T7(Z,$.primaryKey||"id"),Y=U7(X),Q=$,G=$.name.toLowerCase(),W=$.traits?.observe!=null&&$.traits?.observe!==!1,H=async(w)=>{if(!W||o())return!0;try{let{dispatchAsync:x}=await import("@stacksjs/events"),U=await x(`${G}:restoring`,{id:w});if(Array.isArray(U)&&U.some((q)=>q===!1))return!1}catch(x){if(x?.code!=="MODULE_NOT_FOUND")console.error(`[ORM] Before-event '${G}:restoring' handler error:`,x)}return!0},K=async(w)=>{if(!W||o())return;try{let{dispatch:x}=await import("@stacksjs/events");await x(`${G}:restored`,{id:w})}catch(x){if(x?.code!=="MODULE_NOT_FOUND")console.error(`[ORM] Event '${G}:restored' handler error:`,x)}},V=process.env.STACKS_ORM_CASCADE_SWALLOW!=="true",z=async(w)=>{if(!Y.cascade?.length||!V){let U=await J.softDelete(w);if(U&&Y.cascade?.length)await e6(Q,Y,w,"softDelete");return U}let{db:x}=await import("@stacksjs/database");return await x.transaction(async()=>{let U=await J.softDelete(w);if(U)await e6(Q,Y,w,"softDelete");return U})},O=async(w)=>{if(!await H(w))return!1;if(!Y.cascade?.length||!V){let L=await J.restore(w);if(L){if(Y.cascade?.length)await e6(Q,Y,w,"restore");await K(w)}return L}let{db:U}=await import("@stacksjs/database"),q=await U.transaction(async()=>{let L=await J.restore(w);if(L)await e6(Q,Y,w,"restore");return L});if(q)await K(w);return q};Z.softDelete=z,Z.restore=O,Z.forceDelete=J.forceDelete,Z.withTrashed=J.withTrashed,Z.onlyTrashed=J.onlyTrashed,Z.delete=z}function iX(Z){if(Z==null)return Z;if(Array.isArray(Z))return Z.map(iX);if(typeof Z!=="object")return Z;if(typeof Z.toJSON==="function")return Z.toJSON();if(Z._attributes&&typeof Z._attributes==="object")return Z._attributes;return Z}var rX=["belongsTo","hasOne","hasMany","belongsToMany","morphMany","morphOne"],tX=["traits","dashboard"];function sX(Z){let $=Z?.[v$];if($&&typeof $==="object")return $;if(Z&&typeof Z==="object"&&"name"in Z&&"attributes"in Z)return Z;throw TypeError("extendModel() expects a model created by defineModel(), or a model definition. Import the framework model itself rather than its table name.")}function oX(Z,$){let X=Array.isArray(Z)?Z:[],J=Array.isArray($)?$:[];if(!X.length&&!J.length)return;return[...new Set([...X,...J])]}function aX(Z){if(!Z)return 0;return Object.values(Z).reduce(($,X)=>{let J=Number(X?.order);return Number.isFinite(J)&&J>$?J:$},0)}function eX(Z,$){let X={...Z,...$},J=Z.attributes??{},Y=$.attributes??{};if($.attributes){let Q=aX(J),G=Object.fromEntries(Object.entries(Y).map(([W,H])=>{let K=!(W in J),V=Number.isFinite(Number(H?.order));if(K&&!V)return[W,{...H,order:++Q}];return[W,H]}));X.attributes={...J,...G}}for(let Q of rX){let G=oX(Z[Q],$[Q]);if(G)X[Q]=G}for(let Q of tX){let G=Z[Q],W=$[Q];if(G&&W&&typeof G==="object"&&typeof W==="object")X[Q]={...G,...W}}return X}function QT(Z,$){return y7(eX(sX(Z),$))}import{log as ZJ}from"@stacksjs/logging";import{path as a}from"@stacksjs/path";import{fs as X8}from"@stacksjs/storage";function e(Z){return Z.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()}function $J(Z){let $=typeof Z.type==="string"?Z.type.toLowerCase():"",X=(()=>{switch($){case"string":case"text":case"longtext":case"mediumtext":case"tinytext":case"char":case"varchar":case"enum":case"uuid":case"date":case"datetime":case"timestamp":case"timestamptz":case"time":case"year":return"string";case"integer":case"int":case"tinyint":case"smallint":case"mediumint":case"float":case"double":case"decimal":case"numeric":return"number";case"bigint":return"number | bigint";case"boolean":case"bool":return"boolean";case"json":case"jsonb":return"unknown";case"binary":case"blob":case"bytea":return"Uint8Array";default:return"unknown"}})();return Z.nullable===!0?`${X} | null`:X}function XJ(Z){let $={},X=Z.belongsTo;if(!X)return $;let J=Array.isArray(X)?X:Object.keys(X);for(let Y of J)$[`${e(Y)}_id`]="number";return $}function JJ(Z,$){let[X,J]=[e(Z),e($)].sort();return`${X}_${J}`}function YJ(Z){let $=Z.default,X=typeof $==="string"?"string":typeof $==="number"?"number":typeof $==="boolean"?"boolean":$ instanceof Date?"string":"unknown";return Z.nullable?`${X} | null`:X}function QJ(Z,$){let X=$.belongsToMany;if(!X)return[];let J=[],Y=Array.isArray(X)?X:Object.values(X);for(let Q of Y){let G,W,H,K,V={},z=!0;if(typeof Q==="string")G=Q;else if(Q&&typeof Q==="object"&&"model"in Q){let q=Q;if(G=q.model,"pivotTable"in q||"firstForeignKey"in q||"secondForeignKey"in q)W=q.pivotTable,H=q.firstForeignKey,K=q.secondForeignKey;else{let L=Q;W=L.table,H=L.foreignKey,K=L.relatedKey,V=L.pivot?.columns??{},z=Boolean(L.pivot?.timestamps)}}else continue;let O=W??JJ(Z,G),w=H??`${e(Z)}_id`,x=K??`${e(G)}_id`,U={id:"number",[w]:"number",[x]:"number"};for(let[q,L]of Object.entries(V))U[q]=YJ(L);if(z)U.created_at="string",U.updated_at="string | null";J.push({table:O,columns:U})}return J}function GJ(Z){let $={id:"number"},X=Z.traits??{};if(X.useUuid)$.uuid="string";if((X.useTimestamps??X.timestampable)!==!1)$.created_at="string",$.updated_at="string | null";if(X.useSoftDeletes??X.softDeletable)$.deleted_at="string | null";return $}function WJ(Z){let $={},X=Z.attributes??{};for(let[J,Y]of Object.entries(X))$[e(J)]=$J(Y);return $}function R7(Z,$){let X=Object.entries($).map(([J,Y])=>` ${J}: ${Y}`).join(`
|
|
16
16
|
`);return` ${Z}: {
|
|
17
17
|
// columns
|
|
18
18
|
${X}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/orm",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.72.
|
|
5
|
+
"version": "0.72.14",
|
|
6
6
|
"description": "The Stacks ORM integration",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@stacksjs/ts-validation": "^0.5.4",
|
|
67
|
-
"bun-query-builder": "^0.2.
|
|
67
|
+
"bun-query-builder": "^0.2.44"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@stacksjs/config": "0.72.
|
|
70
|
+
"@stacksjs/config": "0.72.14",
|
|
71
71
|
"better-dx": "^0.2.23",
|
|
72
|
-
"@stacksjs/query-builder": "0.72.
|
|
73
|
-
"@stacksjs/types": "0.72.
|
|
72
|
+
"@stacksjs/query-builder": "0.72.14",
|
|
73
|
+
"@stacksjs/types": "0.72.14"
|
|
74
74
|
}
|
|
75
75
|
}
|