@stacksjs/orm 0.72.63 → 0.72.64

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- var Wc=Object.defineProperty;var Qc=(e)=>e;function Jc(e,t){this[e]=Qc.bind(null,t)}var Oi=(e,t)=>{for(var n in t)Wc(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Jc.bind(t,n)})};var f=(e,t)=>()=>(e&&(t=e(e=0)),t);var T=import.meta.require;var sr;var ar=f(()=>{sr={api:"api.stripe.com",files:"files.stripe.com",connect:"connect.stripe.com",meter_events:"meter-events.stripe.com"}});function z(e){return Dd(e)}function ll(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27").replace(/%5B/g,"[").replace(/%5D/g,"]")}function Md(e){if(e instanceof Date)return Math.floor(e.getTime()/1000).toString();if(e===null)return"";return String(e)}function Dd(e){let t=[];function n(i,r){if(r===void 0)return;if(r===null||typeof r!=="object"||r instanceof Date){t.push(ll(i)+"="+ll(Md(r)));return}if(Array.isArray(r)){for(let o=0;o<r.length;o++)if(r[o]!==void 0)n(i+"["+o+"]",r[o]);return}for(let o of Object.keys(r))n(i+"["+o+"]",r[o])}if(typeof e==="object"&&e!==null)for(let i of Object.keys(e))n(i,e[i]);return t.join("&")}function Fd(e){return["number","string","boolean"].includes(typeof e)}function fi(e){let t={authenticator:null,headers:{},settings:{},streaming:!1,apiBase:null};if(!e)return t;if(e.apiKey)t.authenticator=lr(e.apiKey);if(e.idempotencyKey)t.headers["Idempotency-Key"]=e.idempotencyKey;if(e.stripeAccount)t.headers["Stripe-Account"]=e.stripeAccount;if(e.stripeContext){if(t.headers["Stripe-Account"])throw Error("Can't specify both stripeAccount and stripeContext.");t.headers["Stripe-Context"]=e.stripeContext}if(e.apiVersion)t.headers["Stripe-Version"]=e.apiVersion;if(Number.isInteger(e.maxNetworkRetries))t.settings.maxNetworkRetries=e.maxNetworkRetries;if(Number.isInteger(e.timeout))t.settings.timeout=e.timeout;if(e.authenticator){if(e.apiKey)throw Error("Can't specify both apiKey and authenticator.");if(typeof e.authenticator!=="function")throw Error("The authenticator must be a function receiving a request as the first parameter.");t.authenticator=e.authenticator}if(e.headers)Object.assign(t.headers,e.headers);if(e.streaming)t.streaming=!0;return t}function _i(e){if(typeof e!=="object")throw Error("Argument must be an object");return Object.keys(e).reduce((t,n)=>{if(e[n]!=null)t[n]=e[n];return t},{})}function dl(e){if(!(e&&typeof e==="object"))return e;return Object.keys(e).reduce((t,n)=>(t[Nd(n)]=e[n],t),{})}function Nd(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()).join("-")}function ul(e){if(e==="OAuth")return"oauth";else return e[0].toLowerCase()+e.substring(1)}function Gd(e){let t=typeof e;return(t==="function"||t==="object")&&!!e}function ml(e){let t={},n=(i,r)=>{Object.entries(i).forEach(([o,s])=>{let a=r?`${r}[${o}]`:o;if(Gd(s))if(!(s instanceof Uint8Array)&&!Object.prototype.hasOwnProperty.call(s,"data"))return n(s,a);else t[a]=s;else t[a]=String(s)})};return n(e,null),t}function ki(e,t,n){if(!Number.isInteger(t))if(n!==void 0)return n;else throw Error(`${e} must be an integer`);return t}function pl(e){for(let[t,n]of Bd)if(e[t])return n;return""}function lr(e){let t=(n)=>(n.headers.Authorization="Bearer "+e,Promise.resolve());return t._apiKey=e,t}function Ld(e,t){if(this[e]instanceof Date)return Math.floor(this[e].getTime()/1000).toString();return t}function fl(e){return JSON.stringify(e,Ld)}function bi(e){if(!e)return"v1";return e.startsWith("/v2")?"v2":"v1"}function gi(e){if(Array.isArray(e))return e.join(", ");return String(e)}function _l(e){return Object.entries(e).map(([t,n])=>[t,gi(n)])}function ge(e,t){if(!e||!e.stack||!t)return;let n=t.substring(t.indexOf(`
3
- `)+1),i=e.stack.indexOf(cl),r=i>=0?e.stack.substring(0,i):e.stack;e.stack=`${r}${cl}
4
- ${n}`}var be,Bd,cl=`
5
- Originating from:`;var W=f(()=>{ar();be=(()=>{let e={"\n":"\\n",'"':"\\\"","\u2028":"\\u2028","\u2029":"\\u2029"};return(t)=>{let n=t.replace(/["\n\r\u2028\u2029]/g,(i)=>e[i]);return(i)=>n.replace(/\{([\s\S]+?)\}/g,(r,o)=>{let s=i[o];if(Fd(s))return encodeURIComponent(s);return""})}})();Bd=[["ANTIGRAVITY_CLI_ALIAS","antigravity"],["CLAUDECODE","claude_code"],["CLINE_ACTIVE","cline"],["CODEX_SANDBOX","codex_cli"],["CODEX_THREAD_ID","codex_cli"],["CODEX_SANDBOX_NETWORK_DISABLED","codex_cli"],["CODEX_CI","codex_cli"],["CURSOR_AGENT","cursor"],["GEMINI_CLI","gemini_cli"],["OPENCLAW_SHELL","openclaw"],["OPENCODE","open_code"]]});class q{getClientName(){throw Error("getClientName not implemented.")}makeRequest(e,t,n,i,r,o,s,a){throw Error("makeRequest not implemented.")}static makeTimeoutError(){let e=TypeError(q.TIMEOUT_ERROR_CODE);return e.code=q.TIMEOUT_ERROR_CODE,e}}class he{constructor(e,t){this._statusCode=e,this._headers=t}getStatusCode(){return this._statusCode}getHeaders(){return this._headers}getRawResponse(){throw Error("getRawResponse not implemented.")}toStream(e){throw Error("toStream not implemented.")}toJSON(){throw Error("toJSON not implemented.")}}var hi=f(()=>{q.CONNECTION_CLOSED_ERROR_CODES=["ECONNRESET","EPIPE"];q.TIMEOUT_ERROR_CODE="ETIMEDOUT"});var ye,cr;var kl=f(()=>{W();hi();ye=class ye extends q{constructor(e){super();if(!e){if(!globalThis.fetch)throw Error("fetch() function not provided and is not defined in the global scope. You must provide a fetch implementation.");e=globalThis.fetch}if(globalThis.AbortController)this._fetchFn=ye.makeFetchWithAbortTimeout(e);else this._fetchFn=ye.makeFetchWithRaceTimeout(e)}static makeFetchWithRaceTimeout(e){return(t,n,i)=>{let r,o=new Promise((a,c)=>{r=setTimeout(()=>{r=null,c(q.makeTimeoutError())},i)}),s=e(t,n);return Promise.race([s,o]).finally(()=>{if(r)clearTimeout(r)})}}static makeFetchWithAbortTimeout(e){return async(t,n,i)=>{let r=new AbortController,o=setTimeout(()=>{o=null,r.abort(q.makeTimeoutError())},i);try{return await e(t,{...n,signal:r.signal})}catch(s){if(s.name==="AbortError")throw q.makeTimeoutError();else throw s}finally{if(o)clearTimeout(o)}}}getClientName(){return"fetch"}async makeRequest(e,t,n,i,r,o,s,a){let c=s==="http";if(!n.startsWith("/"))throw Error(`Only relative paths are supported, got: "${n}"`);let l=new URL(`${c?"http":"https"}://${e}${n}`);l.port=t;let u=i=="POST"||i=="PUT"||i=="PATCH",m=o||(u?"":void 0),p=await this._fetchFn(l.toString(),{method:i,headers:_l(r),body:m},a);return new cr(p)}};cr=class cr extends he{constructor(e){super(e.status,cr._transformHeadersToObject(e.headers));this._res=e}getRawResponse(){return this._res}toStream(e){return e(),this._res.body}toJSON(){return this._res.text().then((e)=>{try{return JSON.parse(e)}catch(t){if(t instanceof Error)t.rawBody=e;throw t}})}static _transformHeadersToObject(e){let t={};for(let n of e){if(!Array.isArray(n)||n.length!=2)throw Error("Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.");t[n[0]]=n[1]}return t}}});class Re{computeHMACSignature(e,t){throw Error("computeHMACSignature not implemented.")}computeHMACSignatureAsync(e,t){throw Error("computeHMACSignatureAsync not implemented.")}computeSHA256Async(e){throw Error("computeSHA256 not implemented.")}}var Te;var yi=f(()=>{Te=class Te extends Error{}});var ur,dr;var bl=f(()=>{yi();ur=class ur extends Re{constructor(e){super();this.subtleCrypto=e||crypto.subtle}computeHMACSignature(e,t){throw new Te("SubtleCryptoProvider cannot be used in a synchronous context.")}async computeHMACSignatureAsync(e,t){let n=new TextEncoder,i=await this.subtleCrypto.importKey("raw",n.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),r=await this.subtleCrypto.sign("hmac",i,n.encode(e)),o=new Uint8Array(r),s=Array(o.length);for(let a=0;a<o.length;a++)s[a]=dr[o[a]];return s.join("")}async computeSHA256Async(e){return new Uint8Array(await this.subtleCrypto.digest("SHA-256",e))}};dr=Array(256);for(let e=0;e<dr.length;e++)dr[e]=e.toString(16).padStart(2,"0")});class mr{constructor(){this._fetchFn=null,this._agent=null}getPlatformInfo(){return null}getTelemetryId(){return null}emitWarning(e){console.warn(`Stripe: ${e}`)}getEnv(){return null}getRuntimeVersion(){return null}uuid4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e)=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}secureCompare(e,t){if(e.length!==t.length)return!1;let n=e.length,i=0;for(let r=0;r<n;++r)i|=e.charCodeAt(r)^t.charCodeAt(r);return i===0}createEmitter(){throw Error("createEmitter not implemented.")}tryBufferData(e){throw Error("tryBufferData not implemented.")}createNodeHttpClient(e){throw Error("createNodeHttpClient not implemented.")}createFetchHttpClient(e){return new ye(e)}createDefaultHttpClient(){throw Error("createDefaultHttpClient not implemented.")}createNodeCryptoProvider(){throw Error("createNodeCryptoProvider not implemented.")}createSubtleCryptoProvider(e){return new ur(e)}createDefaultCryptoProvider(){throw Error("createDefaultCryptoProvider not implemented.")}}var gl=f(()=>{kl();bl()});class pr{constructor(){this.eventTarget=new EventTarget,this.listenerMapping=new Map}on(e,t){let n=(i)=>{t(i.data)};return this.listenerMapping.set(t,n),this.eventTarget.addEventListener(e,n)}removeListener(e,t){let n=this.listenerMapping.get(t);return this.listenerMapping.delete(t),this.eventTarget.removeEventListener(e,n)}once(e,t){let n=(i)=>{t(i.data)};return this.listenerMapping.set(t,n),this.eventTarget.addEventListener(e,n,{once:!0})}emit(e,t){return this.eventTarget.dispatchEvent(new hl(e,t))}}var hl;var yl=f(()=>{hl=class hl extends Event{constructor(e,t){super(e);this.data=t}}});var fr;var Rl=f(()=>{gl();yl();fr=class fr extends mr{createEmitter(){return new pr}tryBufferData(e){if(e.file.data instanceof ReadableStream)throw Error("Uploading a file as a stream is not supported in non-Node environments. Please open or upvote an issue at github.com/stripe/stripe-node if you use this, detailing your use-case.");return Promise.resolve(e)}createNodeHttpClient(){throw Error("Stripe: `createNodeHttpClient()` is not available in non-Node environments. Please use `createFetchHttpClient()` instead.")}createDefaultHttpClient(){return super.createFetchHttpClient()}createNodeCryptoProvider(){throw Error("Stripe: `createNodeCryptoProvider()` is not available in non-Node environments. Please use `createSubtleCryptoProvider()` instead.")}createDefaultCryptoProvider(){return this.createSubtleCryptoProvider()}}});class C{constructor(e,t){let[n,i]=C.normalize(e,t);this._coefficient=n,this._exponent=i,Object.freeze(this)}static normalize(e,t){if(e===0n)return[0n,0];let n=e,i=t;while(n!==0n&&n%10n===0n)n/=10n,i+=1;return[n,i]}static roundDivision(e,t,n,i){if(t===0n)return e;if(i==="round-down")return e;let r=t>0n===n>0n?1n:-1n;if(i==="round-up")return e+r;if(i==="ceil")return r===1n?e+1n:e;if(i==="floor")return r===-1n?e-1n:e;let o=t<0n?-t:t,s=n<0n?-n:n,a=o*2n,c;if(a===s)c=0;else if(a<s)c=-1;else c=1;if(c<0)return e;if(c>0)return e+r;if(i==="half-up")return e+r;if(i==="half-down")return e;if(e%2n===0n)return e;else return e+r}add(e){let t=e;if(this._exponent===t._exponent)return new C(this._coefficient+t._coefficient,this._exponent);if(this._exponent<t._exponent){let n=10n**BigInt(t._exponent-this._exponent);return new C(this._coefficient+t._coefficient*n,this._exponent)}else{let n=10n**BigInt(this._exponent-t._exponent);return new C(this._coefficient*n+t._coefficient,t._exponent)}}sub(e){let t=e;if(this._exponent===t._exponent)return new C(this._coefficient-t._coefficient,this._exponent);if(this._exponent<t._exponent){let n=10n**BigInt(t._exponent-this._exponent);return new C(this._coefficient-t._coefficient*n,this._exponent)}else{let n=10n**BigInt(this._exponent-t._exponent);return new C(this._coefficient*n-t._coefficient,t._exponent)}}mul(e){let t=e;return new C(this._coefficient*t._coefficient,this._exponent+t._exponent)}div(e,t,n){if(t<0||!Number.isInteger(t))throw Error("precision must be a non-negative integer");let i=e;if(i._coefficient===0n)throw Error("Division by zero");let r=this._exponent-i._exponent+t,o,s,a;if(r>=0){let l=this._coefficient*10n**BigInt(r);o=l/i._coefficient,s=l%i._coefficient,a=i._coefficient}else{let l=i._coefficient*10n**BigInt(-r);o=this._coefficient/l,s=this._coefficient%l,a=l}let c=C.roundDivision(o,s,a,n);return new C(c,-t)}cmp(e){let t=e;if(this._exponent===t._exponent){if(this._coefficient<t._coefficient)return-1;if(this._coefficient>t._coefficient)return 1;return 0}if(this._exponent<t._exponent){let n=10n**BigInt(t._exponent-this._exponent),i=t._coefficient*n;if(this._coefficient<i)return-1;if(this._coefficient>i)return 1;return 0}else{let n=10n**BigInt(this._exponent-t._exponent),i=this._coefficient*n;if(i<t._coefficient)return-1;if(i>t._coefficient)return 1;return 0}}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)===-1}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)===1}gte(e){return this.cmp(e)>=0}isZero(){return this._coefficient===0n}isNegative(){return this._coefficient<0n}isPositive(){return this._coefficient>0n}neg(){return new C(-this._coefficient,this._exponent)}abs(){if(this._coefficient<0n)return new C(-this._coefficient,this._exponent);return this}round(e,t){let n=typeof t==="string"?Kd[t]:t;if(n===void 0)throw Error(`Unknown rounding preset: "${t}"`);if(n.value<0||!Number.isInteger(n.value))throw Error("DecimalRoundingOptions.value must be a non-negative integer");if(n.mode==="decimal-places"){let u=this.toFixed(n.value,e);return M.from(u)}if(this._coefficient===0n)return this;let r=(this._coefficient<0n?(-this._coefficient).toString():this._coefficient.toString()).length;if(n.value===0)return M.zero;if(r<=n.value)return this;let o=r-n.value,s=10n**BigInt(o),a=this._coefficient/s,c=this._coefficient%s,l=C.roundDivision(a,c,s,e);return new C(l,this._exponent+o)}toString(){if(this._coefficient===0n)return"0";let e=this._coefficient.toString(),t=e.startsWith("-"),n=t?e.slice(1):e;if(this._exponent<0){let r=-this._exponent;if((r>=n.length?r-n.length:0)>30){if(n.length===1)return`${e}E${String(this._exponent)}`;let s=n[0]??"",a=n.slice(1),c=this._exponent+n.length-1;return`${t?"-":""}${s}.${a}E${String(c)}`}if(r>=n.length){let s="0".repeat(r-n.length);return`${t?"-":""}0.${s}${n}`}else{let s=n.slice(0,n.length-r),a=n.slice(n.length-r);return`${t?"-":""}${s}.${a}`}}if(n.length+this._exponent<=30){if(this._exponent===0)return e;let r="0".repeat(this._exponent);return`${t?"-":""}${n}${r}`}else{if(n.length===1)return`${e}E+${String(this._exponent)}`;let r=n[0]??"",o=n.slice(1),s=this._exponent+n.length-1;return`${t?"-":""}${r}.${o}E+${String(s)}`}}toJSON(){return this.toString()}toNumber(){return Number(this.toString())}toFixed(e,t){if(e<0||!Number.isInteger(e))throw Error("decimalPlaces must be a non-negative integer");let n=(r)=>{let o=r.toString(),s=o.startsWith("-"),a=s?o.slice(1):o;if(e===0)return o;if(e>=a.length){let c="0".repeat(e-a.length);return`${s?"-":""}0.${c}${a}`}else{let c=a.slice(0,a.length-e),l=a.slice(a.length-e);return`${s?"-":""}${c}.${l}`}},i=-e;if(this._exponent===i)return n(this._coefficient);if(this._exponent<i){let r=i-this._exponent,o=10n**BigInt(r),s=this._coefficient/o,a=this._coefficient%o,c=C.roundDivision(s,a,o,t);return n(c)}else{let r=this._exponent-i,o=this._coefficient*10n**BigInt(r);return n(o)}}valueOf(){return this.toString()}}var Kd,M;var Ri=f(()=>{Kd={"ubb-usage-count":{mode:"significant-figures",value:15},"v1-api":{mode:"decimal-places",value:12}};M={from(e){if(typeof e==="bigint")return new C(e,0);if(typeof e==="number"){if(!Number.isFinite(e))throw Error("Number must be finite");return M.from(e.toString())}let t=e.trim();if(t==="")throw Error("Cannot parse empty string as Decimal");let n=/^([+-]?)(\d+)(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/.exec(t);if(!n)throw Error(`Invalid decimal string: ${e}`);let i=n[1]==="-"?-1n:1n,r=n[2]??"",o=n[3]??"",s=n[4]?Number(n[4]):0;if(!Number.isSafeInteger(s)||s>1e6||s<-1e6)throw Error(`Exponent out of range: ${String(n[4])} exceeds safe integer bounds`);let a=r+o,c=i*BigInt(a),l=s-o.length;if(!Number.isSafeInteger(l)||l>1e6||l<-1e6)throw Error(`Computed exponent out of range: ${String(l)} exceeds safe integer bounds`);return new C(c,l)},zero:new C(0n,0)}});var Si={};Oi(Si,{RateLimitError:()=>Cr,StripeAPIError:()=>ve,StripeAuthenticationError:()=>gr,StripeCardError:()=>br,StripeConnectionError:()=>wi,StripeError:()=>j,StripeIdempotencyError:()=>vi,StripeInvalidClientError:()=>Tr,StripeInvalidGrantError:()=>Rr,StripeInvalidRequestError:()=>Ti,StripeInvalidScopeError:()=>vr,StripeOAuthError:()=>L,StripeOAuthInvalidRequestError:()=>wr,StripePermissionError:()=>hr,StripeRateLimitError:()=>yr,StripeSignatureVerificationError:()=>N,StripeUnsupportedGrantTypeError:()=>Sr,StripeUnsupportedResponseTypeError:()=>xr,TemporarySessionExpiredError:()=>jr,generateOAuthError:()=>_r,generateV1Error:()=>we,generateV2Error:()=>kr});var we=(e)=>{let t=e.statusCode;if(t===429||t===400&&e.code==="rate_limit")return new yr(e);if(t===400||t===404){if(e.type==="idempotency_error")return new vi(e);return new Ti(e)}if(t===401)return new gr(e);if(t===402)return new br(e);if(t===403)return new hr(e);return new ve(e)},_r=(e)=>{switch(e.type){case"invalid_grant":return new Rr(e);case"invalid_client":return new Tr(e);case"invalid_request":return new wr(e);case"invalid_scope":return new vr(e);case"unsupported_grant_type":return new Sr(e);case"unsupported_response_type":return new xr(e);default:return new L(e)}},kr=(e)=>{switch(e.type){case"idempotency_error":return new vi(e);case"rate_limit":return new Cr(e);case"temporary_session_expired":return new jr(e)}switch(e.code){case"invalid_fields":return new Ti(e)}return we(e)},j,br,Ti,ve,gr,hr,yr,wi,N,vi,L,Rr,Tr,wr,vr,Sr,xr,Cr,jr;var xi=f(()=>{j=class j extends Error{constructor(e={},t=null){super(e.message);this.type=t||this.constructor.name,this.raw=e,this.rawType=e.type,this.detail=e.detail,this.headers=e.headers,this.requestId=e.requestId,this.statusCode=e.statusCode,this.message=e.message??"",this.userMessage=e.user_message,this.advice_code=e.advice_code,this.charge=e.charge,this.code=e.code,this.decline_code=e.decline_code,this.doc_url=e.doc_url,this.network_advice_code=e.network_advice_code,this.network_decline_code=e.network_decline_code,this.param=e.param,this.payment_intent=e.payment_intent,this.payment_method=e.payment_method,this.payment_method_type=e.payment_method_type,this.request_log_url=e.request_log_url,this.setup_intent=e.setup_intent,this.source=e.source,this.user_message=e.user_message}};j.generate=we;br=class br extends j{constructor(e={}){super(e,"StripeCardError");this.decline_code=e.decline_code??""}};Ti=class Ti extends j{constructor(e={}){super(e,"StripeInvalidRequestError")}};ve=class ve extends j{constructor(e={}){super(e,"StripeAPIError")}};gr=class gr extends j{constructor(e={}){super(e,"StripeAuthenticationError")}};hr=class hr extends j{constructor(e={}){super(e,"StripePermissionError")}};yr=class yr extends j{constructor(e={}){super(e,"StripeRateLimitError")}};wi=class wi extends j{constructor(e={}){super(e,"StripeConnectionError")}};N=class N extends j{constructor(e,t,n={}){super(n,"StripeSignatureVerificationError");this.header=e,this.payload=t}};vi=class vi extends j{constructor(e={}){super(e,"StripeIdempotencyError")}};L=class L extends j{constructor(e={},t="StripeOAuthError"){super(e,t)}};Rr=class Rr extends L{constructor(e={}){super(e,"StripeInvalidGrantError")}};Tr=class Tr extends L{constructor(e={}){super(e,"StripeInvalidClientError")}};wr=class wr extends L{constructor(e={}){super(e,"StripeOAuthInvalidRequestError")}};vr=class vr extends L{constructor(e={}){super(e,"StripeInvalidScopeError")}};Sr=class Sr extends L{constructor(e={}){super(e,"StripeUnsupportedGrantTypeError")}};xr=class xr extends L{constructor(e={}){super(e,"StripeUnsupportedResponseTypeError")}};Cr=class Cr extends j{constructor(e={}){super(e,"RateLimitError")}};jr=class jr extends j{constructor(e={}){super(e,"TemporarySessionExpiredError")}}});class re{constructor(e,t){this._stripe=e,this._maxBufferedRequestMetric=t}_normalizeStripeContext(e,t){if(e)return e.toString()||null;return t?.toString()||null}_addHeadersDirectlyToObject(e,t){e.requestId=t["request-id"],e.stripeAccount=e.stripeAccount||t["stripe-account"],e.apiVersion=e.apiVersion||t["stripe-version"],e.idempotencyKey=e.idempotencyKey||t["idempotency-key"]}_makeResponseEvent(e,t,n){let i=Date.now(),r=i-e.request_start_time;return _i({api_version:n["stripe-version"],account:n["stripe-account"],idempotency_key:n["idempotency-key"],method:e.method,path:e.path,status:t,request_id:this._getRequestId(n),elapsed:r,request_start_time:e.request_start_time,request_end_time:i})}_getRequestId(e){return e["request-id"]}_emitStripeNotice(e){let t=e["stripe-notice"];if(t)this._stripe._platformFunctions.emitWarning(typeof t==="string"?t:t[0])}_streamingResponseHandler(e,t,n){return(i)=>{let r=i.getHeaders();this._emitStripeNotice(r);let o=()=>{let a=this._makeResponseEvent(e,i.getStatusCode(),r);this._stripe._emitter.emit("response",a),this._recordRequestMetrics(this._getRequestId(r),a.elapsed,t)},s=i.toStream(o);return this._addHeadersDirectlyToObject(s,r),n(null,s)}}_jsonResponseHandler(e,t,n,i){return(r)=>{let o=r.getHeaders();this._emitStripeNotice(o);let s=this._getRequestId(o),a=r.getStatusCode(),c=this._makeResponseEvent(e,a,o);r.toJSON().then((l)=>{if(this._stripe.getEmitEventBodiesEnabled())c.body=l;if(l.error){let u=typeof l.error==="string";if(u)l.error={type:l.error,message:l.error_description};l.error.headers=o,l.error.statusCode=a,l.error.requestId=s;let m;if(u)m=_r(l.error);else if(t==="v2")m=kr(l.error);else m=we(l.error);throw m}return l},(l)=>{if(this._stripe.getEmitEventBodiesEnabled()&&l.rawBody)c.body=l.rawBody;throw new ve({message:"Invalid JSON received from the Stripe API",exception:l,requestId:o["request-id"]})}).then((l)=>{this._stripe._emitter.emit("response",c),this._recordRequestMetrics(s,c.elapsed,n);let u=r.getRawResponse();this._addHeadersDirectlyToObject(u,o),Object.defineProperty(l,"lastResponse",{enumerable:!1,writable:!1,value:u}),i(null,l)},(l)=>{this._stripe._emitter.emit("response",c),i(l,null)})}}static _generateConnectionErrorMessage(e){return`An error occurred with our connection to Stripe.${e>0?` Request was retried ${e} times.`:""}`}static _shouldRetry(e,t,n,i){if(i&&t===0&&q.CONNECTION_CLOSED_ERROR_CODES.includes(i.code))return!0;if(t>=n)return!1;if(!e)return!0;if(e.getHeaders()["stripe-should-retry"]==="false")return!1;if(e.getHeaders()["stripe-should-retry"]==="true")return!0;if(e.getStatusCode()===409)return!0;if(e.getStatusCode()>=500)return!0;return!1}_getSleepTimeInMS(e){let t=this._stripe.getInitialNetworkRetryDelay(),n=this._stripe.getMaxNetworkRetryDelay(),i=Math.min(t*Math.pow(2,e-1),n);return i*=0.5*(1+Math.random()),i=Math.max(t,i),i*1000}_getMaxNetworkRetries(e={}){return e.maxNetworkRetries!==void 0&&Number.isInteger(e.maxNetworkRetries)?e.maxNetworkRetries:this._stripe.getMaxNetworkRetries()}_defaultIdempotencyKey(e,t,n){let i=this._getMaxNetworkRetries(t),r=()=>`stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`;if(n==="v2"){if(e==="POST"||e==="DELETE")return r()}else if(n==="v1"){if(e==="POST"&&i>0)return r()}return null}_makeHeaders({contentType:e,contentLength:t,apiVersion:n,clientUserAgent:i,method:r,userSuppliedHeaders:o,userSuppliedSettings:s,stripeAccount:a,stripeContext:c,apiMode:l}){let u={Accept:"application/json","Content-Type":e,"User-Agent":this._getUserAgentString(l),"X-Stripe-Client-User-Agent":i,"X-Stripe-Client-Telemetry":this._getTelemetryHeader(),"Stripe-Version":n,"Stripe-Account":a,"Stripe-Context":c,"Idempotency-Key":this._defaultIdempotencyKey(r,s,l)},m=r=="POST"||r=="PUT"||r=="PATCH";if(m||t){if(!m)this._stripe._platformFunctions.emitWarning(`${r} method had non-zero contentLength but no payload is expected for this verb`);u["Content-Length"]=t}return Object.assign(_i(u),dl(o))}_getUserAgentString(e){let t=this._stripe.getConstant("PACKAGE_VERSION"),n=this._stripe._appInfo?this._stripe.getAppInfoAsString():"",i=this._stripe.getConstant("AI_AGENT"),r=`Stripe/${e} NodeBindings/${t}`;if(n)r+=` ${n}`;if(i)r+=` AIAgent/${i}`;return r}_getTelemetryHeader(){if(this._stripe.getTelemetryEnabled()&&this._stripe._prevRequestMetrics.length>0){let e=this._stripe._prevRequestMetrics.shift();return JSON.stringify({last_request_metrics:e})}}_recordRequestMetrics(e,t,n){if(this._stripe.getTelemetryEnabled()&&e)if(this._stripe._prevRequestMetrics.length>this._maxBufferedRequestMetric)this._stripe._platformFunctions.emitWarning("Request metrics buffer is full, dropping telemetry message.");else{let i={request_id:e,request_duration_ms:t};if(n&&n.length>0)i.usage=n;this._stripe._prevRequestMetrics.push(i)}}_rawRequest(e,t,n,i,r){return new Promise((o,s)=>{try{let a=e.toUpperCase();if(a!=="POST"&&n&&Object.keys(n).length!==0)throw Error("rawRequest only supports params on POST requests. Please pass null and add your parameters to path.");let c=a==="POST"?Object.assign({},n):null,l=fi(i);if(i?.additionalHeaders)Object.assign(l.headers,i.additionalHeaders);let u=l.apiBase||(i?.apiBase??null),m=u?this._stripe.resolveBaseAddress(u):null;this._request(a,m,t,c,l.authenticator,{headers:l.headers,settings:l.settings,streaming:l.streaming},r||["raw_request"],(p,_)=>{if(p)s(p);else o(_)})}catch(a){s(a)}})}_getContentLength(e){return typeof e==="string"?new TextEncoder().encode(e).length:e.length}_request(e,t,n,i,r,o,s=[],a,c=null){let l;r=r??this._stripe._authenticator;let u=bi(n),m=(k,g,y,R)=>setTimeout(k,this._getSleepTimeInMS(R),g,y,R+1),p=(k,g,y)=>{let R=o.settings&&o.settings.timeout&&Number.isInteger(o.settings.timeout)&&o.settings.timeout>=0?o.settings.timeout:this._stripe.getApiField("timeout"),v={host:t||this._stripe.getApiField("host"),port:this._stripe.getApiField("port"),path:n,method:e,headers:Object.assign({},g),body:l,protocol:this._stripe.getApiField("protocol")};if(!r)throw Error("Authenticator was't initialized. Please pass an API Key or an Authenticator when initializing StripeClient.");r(v).then(()=>{let x=this._stripe.getApiField("httpClient").makeRequest(v.host,v.port,v.path,v.method,v.headers,v.body,v.protocol,R),P=Date.now(),U=_i({api_version:k,account:gi(g["Stripe-Account"]),idempotency_key:gi(g["Idempotency-Key"]),method:e,path:n,body:this._stripe.getEmitEventBodiesEnabled()?i??void 0:void 0,request_start_time:P}),X=y||0,oi=this._getMaxNetworkRetries(o.settings||{});this._stripe._emitter.emit("request",U),x.then((O)=>{if(re._shouldRetry(O,X,oi))return m(p,k,g,X);else if(o.streaming&&O.getStatusCode()<400)return this._streamingResponseHandler(U,s,a)(O);else return this._jsonResponseHandler(U,u,s,a)(O)}).catch((O)=>{if(re._shouldRetry(null,X,oi,O))return m(p,k,g,X);else{let de=O.code&&O.code===q.TIMEOUT_ERROR_CODE;return a(new wi({message:de?`Request aborted due to timeout being reached (${R}ms)`:re._generateConnectionErrorMessage(X),detail:O}))}})}).catch((x)=>{throw new j({message:"Unable to authenticate the request",exception:x})})},_=(k,g)=>{if(k)return a(k);l=g,this._stripe.getClientUserAgent((y)=>{let R=this._stripe.getApiField("version"),v=this._makeHeaders({contentType:u=="v2"?"application/json":"application/x-www-form-urlencoded",contentLength:this._getContentLength(g),apiVersion:R,clientUserAgent:y,method:e,userSuppliedHeaders:o.headers??null,userSuppliedSettings:o.settings??{},stripeAccount:o.stripeAccount??this._stripe.getApiField("stripeAccount"),stripeContext:this._normalizeStripeContext(o.stripeContext,this._stripe.getApiField("stripeContext")),apiMode:u});p(R,v,0)})};if(c)c(e,i,o.headers,_);else{let k;if(u=="v2")k=i?fl(i):"";else k=z(i||{});_(null,k)}}}var Tl=f(()=>{xi();hi();W()});var Se=(e,t)=>{if(e==null)return e;switch(t.kind){case"int64_string":return typeof e==="bigint"||typeof e==="number"?String(e):e;case"decimal_string":return typeof e.toFixed==="function"&&typeof e.isZero==="function"?e.toString():e;case"object":{if(typeof e!=="object"||Array.isArray(e))return e;let n=e,i={};for(let r of Object.keys(n)){let o=t.fields[r];i[r]=o?Se(n[r],o):n[r]}return i}case"array":{if(!Array.isArray(e))return e;return e.map((n)=>Se(n,t.element))}case"nullable":return Se(e,t.inner)}},xe=(e,t)=>{if(e==null)return e;switch(t.kind){case"int64_string":if(typeof e==="string")try{return BigInt(e)}catch{throw Error(`Failed to coerce int64_string value: expected an integer string, got '${e}'`)}return e;case"decimal_string":if(typeof e==="string")try{return M.from(e)}catch{throw Error(`Failed to coerce decimal_string value: expected a decimal string, got '${e}'`)}return e;case"object":{if(typeof e!=="object"||Array.isArray(e))return e;let n=e;for(let i of Object.keys(t.fields))if(i in n)n[i]=xe(n[i],t.fields[i]);return n}case"array":{if(!Array.isArray(e))return e;for(let n=0;n<e.length;n++)e[n]=xe(e[n],t.element);return e}case"nullable":return xe(e,t.inner)}};var wl=f(()=>{Ri()});class Er{constructor(e,t,n,i,r,o,s){this.index=0,this.pagePromise=e,this.promiseCache={currentPromise:null},this.params=t,this.options=n,this.method=i,this.path=r,this.spec=o,this.stripeResource=s}async iterate(e){if(!(e&&e.data&&typeof e.data.length==="number"))throw Error("Unexpected: Stripe API response does not have a well-formed `data` array.");let t=!!this.params.ending_before;if(this.index<e.data.length){let n=t?e.data.length-1-this.index:this.index,i=e.data[n];return this.index+=1,{value:i,done:!1}}else if(e.has_more){this.index=0,this.pagePromise=this.getNextPage(e);let n=await this.pagePromise;return this.iterate(n)}return{done:!0,value:void 0}}getNextPage(e){throw Error("Unimplemented")}async _next(){return this.iterate(await this.pagePromise)}next(){if(this.promiseCache.currentPromise)return this.promiseCache.currentPromise;let e=(async()=>{let t=await this._next();return this.promiseCache.currentPromise=null,t})();return this.promiseCache.currentPromise=e,e}}class xl{constructor(e,t,n,i){this.firstPagePromise=e,this.currentPageIterator=null,this.nextPageUrl=null,this.promiseCache={currentPromise:null},this.options=t,this.spec=n,this.stripeResource=i}async initFirstPage(){if(this.firstPagePromise){let e=await this.firstPagePromise;this.firstPagePromise=null,this.currentPageIterator=e.data[Symbol.iterator](),this.nextPageUrl=e.next_page_url||null}}async turnPage(){if(!this.nextPageUrl)return null;let e=await this.stripeResource._makeRequest("GET",this.nextPageUrl,void 0,this.options,this.spec);return this.nextPageUrl=e.next_page_url||null,this.currentPageIterator=e.data[Symbol.iterator](),this.currentPageIterator}async _next(){if(await this.initFirstPage(),this.currentPageIterator){let e=this.currentPageIterator.next();if(!e.done)return{done:!1,value:e.value}}return this.nextFromNewPage()}async nextFromNewPage(){let e=await this.turnPage();if(!e)return{done:!0,value:void 0};let t=e.next();if(!t.done)return{done:!1,value:t.value};return this.nextFromNewPage()}next(){if(this.promiseCache.currentPromise)return this.promiseCache.currentPromise;let e=(async()=>{try{return await this._next()}finally{this.promiseCache.currentPromise=null}})();return this.promiseCache.currentPromise=e,e}}function Hd(){if(typeof Symbol<"u"&&Symbol.asyncIterator)return Symbol.asyncIterator;return"@@asyncIterator"}function Vd(e){if(e.length<2)return null;let t=e[1];if(typeof t!=="function")throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);return t}function zd(e){if(e.length===0)return;let t=e[0];if(typeof t!=="function")throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);if(t.length===2)return t;if(t.length>2)throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${t}`);return function(i,r){let o=t(i);r(o)}}function Wd(e,t){let n=t?0:e.data.length-1,i=e.data[n],r=i&&i.id;if(!r)throw Error("Unexpected: No `id` found on the last item while auto-paging a list.");return r}function Qd(e){return function(){let n=Error().stack,i=[].slice.call(arguments),r=zd(i),o=Vd(i);if(i.length>2)throw Error(`autoPagingEach takes up to two arguments; received ${i}`);let s=Xd(e,r).catch((a)=>{throw ge(a,n),a});if(o)s.then(()=>o(),(a)=>o(a));return s}}function Jd(e){return function(n,i){let r=Error().stack,o=n&&n.limit;if(!o)throw Error("You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.");if(o>1e4)throw Error("You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.");let s=new Promise((a,c)=>{let l=[];e((u)=>{if(l.push(u),l.length>=o)return!1}).then(()=>{a(l)}).catch((u)=>{ge(u,r),c(u)})});if(i)s.then((a)=>i(null,a),(a)=>i(a));return s}}function Xd(e,t){return new Promise((n,i)=>{function r(o){if(o.done){n();return}let s=o.value;return new Promise((a)=>{t(s,a)}).then((a)=>{if(a===!1)return r({done:!0,value:void 0});else return e().then(r)})}e().then(r).catch(i)})}var vl,Sl,Cl=(e,t,n,i,r,o,s)=>{let a=bi(r),c=o?.methodType;if(a!=="v2"&&c==="search")return Pr(new Sl(s,t,n,i,r,o,e));if(a!=="v2"&&c==="list")return Pr(new vl(s,t,n,i,r,o,e));if(a==="v2"&&c==="list")return Pr(new xl(s,n,o,e));return null},Pr=(e)=>{let t=Qd((...r)=>e.next(...r)),n=Jd(t),i={autoPagingEach:t,autoPagingToArray:n,next:()=>e.next(),return:()=>({}),[Hd()]:()=>i};return i};var jl=f(()=>{W();vl=class vl extends Er{getNextPage(e){let t=!!this.params.ending_before,n=Wd(e,t),i={...this.params,[t?"ending_before":"starting_after"]:n};return this.stripeResource._makeRequest(this.method,this.path,i,this.options,this.spec)}};Sl=class Sl extends Er{getNextPage(e){if(!e.next_page)throw Error("Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.");let t={...this.params,page:e.next_page};return this.stripeResource._makeRequest(this.method,this.path,t,this.options,this.spec)}}});class d{constructor(e,t){if(this.resourcePath="",this.requestDataProcessor=null,this._stripe=e,t)throw Error("Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.");this.basePath=be(this.basePath||e.getApiField("basePath"));let n=this.path||"";this.resourcePath=n,this.path=be(n),this.initialize(e,t)}initialize(e,t){}_makeRequest(e,t,n,i,r){let o=e.toUpperCase(),a=(r?.encode||((x)=>x))(n?{...n}:{}),c=fi(i),l=c.apiBase||r?.apiBase||null,u=l?this._stripe.resolveBaseAddress(l):null,m=c.streaming||!!r?.streaming,p=Object.assign(c.headers,r?.headers),_=r?.usage||[],k=o==="GET"||o==="DELETE",g=k?null:a,y=k?a:{};try{if(r?.validator)r.validator(a,{headers:p});if(r?.requestSchema&&g)g=Se(g,r.requestSchema)}catch(x){return Promise.reject(x)}let R=Error().stack,v=new Promise((x,P)=>{function U(O,de){if(O)ge(O,R),P(O);else try{if(r?.responseSchema)xe(de,r.responseSchema);x(r?.transformResponseData?r.transformResponseData(de):de)}catch(zc){P(zc)}}let X=Object.keys(y).length===0,oi=[t,X?"":"?",z(y)].join("");this._stripe._requestSender._request(o,u,oi,g,c.authenticator,{headers:p,settings:c.settings,streaming:m},_,U,this.requestDataProcessor?.bind(this))});if(r?.methodType)Object.assign(v,Cl(this,n?{...n}:{},i,o,t,r,v));return v}}var b=f(()=>{W();wl();jl();d.MAX_BUFFERED_REQUEST_METRICS=100});class K{constructor(e=[]){this._segments=[...e]}get segments(){return[...this._segments]}push(e){if(!e)throw Error("Segment cannot be null or undefined");return new K([...this._segments,e])}pop(){if(this._segments.length===0)throw Error("Cannot pop from an empty context");return new K(this._segments.slice(0,-1))}toString(){return this._segments.join("/")}static parse(e){if(!e)return new K([]);return new K(e.split("/"))}}function Pl(e){let t={DEFAULT_TOLERANCE:300,signature:null,constructEvent(u,m,p,_,k,g){try{if(!this.signature)throw Error("ERR: missing signature helper, unable to verify");k=k||c(),this.signature.verifyHeader(u,m,p,_||t.DEFAULT_TOLERANCE,k,g)}catch(R){if(R instanceof Te)R.message+="\nUse `await constructEventAsync(...)` instead of `constructEvent(...)`";throw R}let y=u instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(u)):JSON.parse(u);if(y&&y.object==="v2.core.event")throw Error("You passed an event notification to stripe.webhooks.constructEvent, which expects a webhook payload. Use stripe.parseEventNotification instead.");return y},async constructEventAsync(u,m,p,_,k,g){if(!this.signature)throw Error("ERR: missing signature helper, unable to verify");k=k||c(),await this.signature.verifyHeaderAsync(u,m,p,_||t.DEFAULT_TOLERANCE,k,g);let y=u instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(u)):JSON.parse(u);if(y&&y.object==="v2.core.event")throw Error("You passed an event notification to stripe.webhooks.constructEvent, which expects a webhook payload. Use stripe.parseEventNotificationAsync instead.");return y},generateTestHeaderString:function(u){let m=l(u),p=m.signature||m.cryptoProvider.computeHMACSignature(m.payloadString,m.secret);return m.generateHeaderString(p)},generateTestHeaderStringAsync:async function(u){let m=l(u),p=m.signature||await m.cryptoProvider.computeHMACSignatureAsync(m.payloadString,m.secret);return m.generateHeaderString(p)}},n={EXPECTED_SCHEME:"v1",verifyHeader(u,m,p,_,k,g){let{decodedHeader:y,decodedPayload:R,details:v,suspectPayloadType:x}=r(u,m,this.EXPECTED_SCHEME),P=/\s/.test(p);k=k||c();let U=k.computeHMACSignature(i(R,v),p);return o(R,y,v,U,_||0,x,P,g),!0},async verifyHeaderAsync(u,m,p,_,k,g){let{decodedHeader:y,decodedPayload:R,details:v,suspectPayloadType:x}=r(u,m,this.EXPECTED_SCHEME),P=/\s/.test(p);k=k||c();let U=await k.computeHMACSignatureAsync(i(R,v),p);return o(R,y,v,U,_||0,x,P,g)}};function i(u,m){return`${m.timestamp}.${u}`}function r(u,m,p){if(Array.isArray(m))throw Error("Unexpected: An array was passed as a header, which should not be possible for the stripe-signature header.");if(!u)throw new N(m,u,{message:"No webhook payload was provided."});let _=typeof u!="string"&&!(u instanceof Uint8Array),k=new TextDecoder("utf8"),g=u instanceof Uint8Array?k.decode(u):u;if(m==null||m=="")throw new N(m,u,{message:"No stripe-signature header value was provided."});let y=m instanceof Uint8Array?k.decode(m):m,R=s(y,p);if(!R||R.timestamp===-1)throw new N(y,g,{message:"Unable to extract timestamp and signatures from header"});if(!R.signatures.length)throw new N(y,g,{message:"No signatures found with expected scheme"});return{decodedPayload:g,decodedHeader:y,details:R,suspectPayloadType:_}}function o(u,m,p,_,k,g,y,R){let v=!!p.signatures.filter(e.secureCompare.bind(e,_)).length,x=`
2
+ var Qc=Object.defineProperty;var Jc=(e)=>e;function Xc(e,t){this[e]=Jc.bind(null,t)}var Oi=(e,t)=>{for(var n in t)Qc(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Xc.bind(t,n)})};var f=(e,t)=>()=>(e&&(t=e(e=0)),t);var T=import.meta.require;var sr;var ar=f(()=>{sr={api:"api.stripe.com",files:"files.stripe.com",connect:"connect.stripe.com",meter_events:"meter-events.stripe.com"}});function z(e){return Fd(e)}function cl(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27").replace(/%5B/g,"[").replace(/%5D/g,"]")}function Dd(e){if(e instanceof Date)return Math.floor(e.getTime()/1000).toString();if(e===null)return"";return String(e)}function Fd(e){let t=[];function n(i,r){if(r===void 0)return;if(r===null||typeof r!=="object"||r instanceof Date){t.push(cl(i)+"="+cl(Dd(r)));return}if(Array.isArray(r)){for(let o=0;o<r.length;o++)if(r[o]!==void 0)n(i+"["+o+"]",r[o]);return}for(let o of Object.keys(r))n(i+"["+o+"]",r[o])}if(typeof e==="object"&&e!==null)for(let i of Object.keys(e))n(i,e[i]);return t.join("&")}function Nd(e){return["number","string","boolean"].includes(typeof e)}function fi(e){let t={authenticator:null,headers:{},settings:{},streaming:!1,apiBase:null};if(!e)return t;if(e.apiKey)t.authenticator=lr(e.apiKey);if(e.idempotencyKey)t.headers["Idempotency-Key"]=e.idempotencyKey;if(e.stripeAccount)t.headers["Stripe-Account"]=e.stripeAccount;if(e.stripeContext){if(t.headers["Stripe-Account"])throw Error("Can't specify both stripeAccount and stripeContext.");t.headers["Stripe-Context"]=e.stripeContext}if(e.apiVersion)t.headers["Stripe-Version"]=e.apiVersion;if(Number.isInteger(e.maxNetworkRetries))t.settings.maxNetworkRetries=e.maxNetworkRetries;if(Number.isInteger(e.timeout))t.settings.timeout=e.timeout;if(e.authenticator){if(e.apiKey)throw Error("Can't specify both apiKey and authenticator.");if(typeof e.authenticator!=="function")throw Error("The authenticator must be a function receiving a request as the first parameter.");t.authenticator=e.authenticator}if(e.headers)Object.assign(t.headers,e.headers);if(e.streaming)t.streaming=!0;return t}function _i(e){if(typeof e!=="object")throw Error("Argument must be an object");return Object.keys(e).reduce((t,n)=>{if(e[n]!=null)t[n]=e[n];return t},{})}function ul(e){if(!(e&&typeof e==="object"))return e;return Object.keys(e).reduce((t,n)=>(t[Gd(n)]=e[n],t),{})}function Gd(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()).join("-")}function ml(e){if(e==="OAuth")return"oauth";else return e[0].toLowerCase()+e.substring(1)}function Bd(e){let t=typeof e;return(t==="function"||t==="object")&&!!e}function pl(e){let t={},n=(i,r)=>{Object.entries(i).forEach(([o,s])=>{let a=r?`${r}[${o}]`:o;if(Bd(s))if(!(s instanceof Uint8Array)&&!Object.prototype.hasOwnProperty.call(s,"data"))return n(s,a);else t[a]=s;else t[a]=String(s)})};return n(e,null),t}function ki(e,t,n){if(!Number.isInteger(t))if(n!==void 0)return n;else throw Error(`${e} must be an integer`);return t}function fl(e){for(let[t,n]of Ld)if(e[t])return n;return""}function lr(e){let t=(n)=>(n.headers.Authorization="Bearer "+e,Promise.resolve());return t._apiKey=e,t}function Kd(e,t){if(this[e]instanceof Date)return Math.floor(this[e].getTime()/1000).toString();return t}function _l(e){return JSON.stringify(e,Kd)}function bi(e){if(!e)return"v1";return e.startsWith("/v2")?"v2":"v1"}function gi(e){if(Array.isArray(e))return e.join(", ");return String(e)}function kl(e){return Object.entries(e).map(([t,n])=>[t,gi(n)])}function ge(e,t){if(!e||!e.stack||!t)return;let n=t.substring(t.indexOf(`
3
+ `)+1),i=e.stack.indexOf(dl),r=i>=0?e.stack.substring(0,i):e.stack;e.stack=`${r}${dl}
4
+ ${n}`}var be,Ld,dl=`
5
+ Originating from:`;var W=f(()=>{ar();be=(()=>{let e={"\n":"\\n",'"':"\\\"","\u2028":"\\u2028","\u2029":"\\u2029"};return(t)=>{let n=t.replace(/["\n\r\u2028\u2029]/g,(i)=>e[i]);return(i)=>n.replace(/\{([\s\S]+?)\}/g,(r,o)=>{let s=i[o];if(Nd(s))return encodeURIComponent(s);return""})}})();Ld=[["ANTIGRAVITY_CLI_ALIAS","antigravity"],["CLAUDECODE","claude_code"],["CLINE_ACTIVE","cline"],["CODEX_SANDBOX","codex_cli"],["CODEX_THREAD_ID","codex_cli"],["CODEX_SANDBOX_NETWORK_DISABLED","codex_cli"],["CODEX_CI","codex_cli"],["CURSOR_AGENT","cursor"],["GEMINI_CLI","gemini_cli"],["OPENCLAW_SHELL","openclaw"],["OPENCODE","open_code"]]});class q{getClientName(){throw Error("getClientName not implemented.")}makeRequest(e,t,n,i,r,o,s,a){throw Error("makeRequest not implemented.")}static makeTimeoutError(){let e=TypeError(q.TIMEOUT_ERROR_CODE);return e.code=q.TIMEOUT_ERROR_CODE,e}}class he{constructor(e,t){this._statusCode=e,this._headers=t}getStatusCode(){return this._statusCode}getHeaders(){return this._headers}getRawResponse(){throw Error("getRawResponse not implemented.")}toStream(e){throw Error("toStream not implemented.")}toJSON(){throw Error("toJSON not implemented.")}}var hi=f(()=>{q.CONNECTION_CLOSED_ERROR_CODES=["ECONNRESET","EPIPE"];q.TIMEOUT_ERROR_CODE="ETIMEDOUT"});var ye,cr;var bl=f(()=>{W();hi();ye=class ye extends q{constructor(e){super();if(!e){if(!globalThis.fetch)throw Error("fetch() function not provided and is not defined in the global scope. You must provide a fetch implementation.");e=globalThis.fetch}if(globalThis.AbortController)this._fetchFn=ye.makeFetchWithAbortTimeout(e);else this._fetchFn=ye.makeFetchWithRaceTimeout(e)}static makeFetchWithRaceTimeout(e){return(t,n,i)=>{let r,o=new Promise((a,c)=>{r=setTimeout(()=>{r=null,c(q.makeTimeoutError())},i)}),s=e(t,n);return Promise.race([s,o]).finally(()=>{if(r)clearTimeout(r)})}}static makeFetchWithAbortTimeout(e){return async(t,n,i)=>{let r=new AbortController,o=setTimeout(()=>{o=null,r.abort(q.makeTimeoutError())},i);try{return await e(t,{...n,signal:r.signal})}catch(s){if(s.name==="AbortError")throw q.makeTimeoutError();else throw s}finally{if(o)clearTimeout(o)}}}getClientName(){return"fetch"}async makeRequest(e,t,n,i,r,o,s,a){let c=s==="http";if(!n.startsWith("/"))throw Error(`Only relative paths are supported, got: "${n}"`);let l=new URL(`${c?"http":"https"}://${e}${n}`);l.port=t;let u=i=="POST"||i=="PUT"||i=="PATCH",m=o||(u?"":void 0),p=await this._fetchFn(l.toString(),{method:i,headers:kl(r),body:m},a);return new cr(p)}};cr=class cr extends he{constructor(e){super(e.status,cr._transformHeadersToObject(e.headers));this._res=e}getRawResponse(){return this._res}toStream(e){return e(),this._res.body}toJSON(){return this._res.text().then((e)=>{try{return JSON.parse(e)}catch(t){if(t instanceof Error)t.rawBody=e;throw t}})}static _transformHeadersToObject(e){let t={};for(let n of e){if(!Array.isArray(n)||n.length!=2)throw Error("Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.");t[n[0]]=n[1]}return t}}});class Re{computeHMACSignature(e,t){throw Error("computeHMACSignature not implemented.")}computeHMACSignatureAsync(e,t){throw Error("computeHMACSignatureAsync not implemented.")}computeSHA256Async(e){throw Error("computeSHA256 not implemented.")}}var Te;var yi=f(()=>{Te=class Te extends Error{}});var ur,dr;var gl=f(()=>{yi();ur=class ur extends Re{constructor(e){super();this.subtleCrypto=e||crypto.subtle}computeHMACSignature(e,t){throw new Te("SubtleCryptoProvider cannot be used in a synchronous context.")}async computeHMACSignatureAsync(e,t){let n=new TextEncoder,i=await this.subtleCrypto.importKey("raw",n.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),r=await this.subtleCrypto.sign("hmac",i,n.encode(e)),o=new Uint8Array(r),s=Array(o.length);for(let a=0;a<o.length;a++)s[a]=dr[o[a]];return s.join("")}async computeSHA256Async(e){return new Uint8Array(await this.subtleCrypto.digest("SHA-256",e))}};dr=Array(256);for(let e=0;e<dr.length;e++)dr[e]=e.toString(16).padStart(2,"0")});class mr{constructor(){this._fetchFn=null,this._agent=null}getPlatformInfo(){return null}getTelemetryId(){return null}emitWarning(e){console.warn(`Stripe: ${e}`)}getEnv(){return null}getRuntimeVersion(){return null}uuid4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e)=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}secureCompare(e,t){if(e.length!==t.length)return!1;let n=e.length,i=0;for(let r=0;r<n;++r)i|=e.charCodeAt(r)^t.charCodeAt(r);return i===0}createEmitter(){throw Error("createEmitter not implemented.")}tryBufferData(e){throw Error("tryBufferData not implemented.")}createNodeHttpClient(e){throw Error("createNodeHttpClient not implemented.")}createFetchHttpClient(e){return new ye(e)}createDefaultHttpClient(){throw Error("createDefaultHttpClient not implemented.")}createNodeCryptoProvider(){throw Error("createNodeCryptoProvider not implemented.")}createSubtleCryptoProvider(e){return new ur(e)}createDefaultCryptoProvider(){throw Error("createDefaultCryptoProvider not implemented.")}}var hl=f(()=>{bl();gl()});class pr{constructor(){this.eventTarget=new EventTarget,this.listenerMapping=new Map}on(e,t){let n=(i)=>{t(i.data)};return this.listenerMapping.set(t,n),this.eventTarget.addEventListener(e,n)}removeListener(e,t){let n=this.listenerMapping.get(t);return this.listenerMapping.delete(t),this.eventTarget.removeEventListener(e,n)}once(e,t){let n=(i)=>{t(i.data)};return this.listenerMapping.set(t,n),this.eventTarget.addEventListener(e,n,{once:!0})}emit(e,t){return this.eventTarget.dispatchEvent(new yl(e,t))}}var yl;var Rl=f(()=>{yl=class yl extends Event{constructor(e,t){super(e);this.data=t}}});var fr;var Tl=f(()=>{hl();Rl();fr=class fr extends mr{createEmitter(){return new pr}tryBufferData(e){if(e.file.data instanceof ReadableStream)throw Error("Uploading a file as a stream is not supported in non-Node environments. Please open or upvote an issue at github.com/stripe/stripe-node if you use this, detailing your use-case.");return Promise.resolve(e)}createNodeHttpClient(){throw Error("Stripe: `createNodeHttpClient()` is not available in non-Node environments. Please use `createFetchHttpClient()` instead.")}createDefaultHttpClient(){return super.createFetchHttpClient()}createNodeCryptoProvider(){throw Error("Stripe: `createNodeCryptoProvider()` is not available in non-Node environments. Please use `createSubtleCryptoProvider()` instead.")}createDefaultCryptoProvider(){return this.createSubtleCryptoProvider()}}});class C{constructor(e,t){let[n,i]=C.normalize(e,t);this._coefficient=n,this._exponent=i,Object.freeze(this)}static normalize(e,t){if(e===0n)return[0n,0];let n=e,i=t;while(n!==0n&&n%10n===0n)n/=10n,i+=1;return[n,i]}static roundDivision(e,t,n,i){if(t===0n)return e;if(i==="round-down")return e;let r=t>0n===n>0n?1n:-1n;if(i==="round-up")return e+r;if(i==="ceil")return r===1n?e+1n:e;if(i==="floor")return r===-1n?e-1n:e;let o=t<0n?-t:t,s=n<0n?-n:n,a=o*2n,c;if(a===s)c=0;else if(a<s)c=-1;else c=1;if(c<0)return e;if(c>0)return e+r;if(i==="half-up")return e+r;if(i==="half-down")return e;if(e%2n===0n)return e;else return e+r}add(e){let t=e;if(this._exponent===t._exponent)return new C(this._coefficient+t._coefficient,this._exponent);if(this._exponent<t._exponent){let n=10n**BigInt(t._exponent-this._exponent);return new C(this._coefficient+t._coefficient*n,this._exponent)}else{let n=10n**BigInt(this._exponent-t._exponent);return new C(this._coefficient*n+t._coefficient,t._exponent)}}sub(e){let t=e;if(this._exponent===t._exponent)return new C(this._coefficient-t._coefficient,this._exponent);if(this._exponent<t._exponent){let n=10n**BigInt(t._exponent-this._exponent);return new C(this._coefficient-t._coefficient*n,this._exponent)}else{let n=10n**BigInt(this._exponent-t._exponent);return new C(this._coefficient*n-t._coefficient,t._exponent)}}mul(e){let t=e;return new C(this._coefficient*t._coefficient,this._exponent+t._exponent)}div(e,t,n){if(t<0||!Number.isInteger(t))throw Error("precision must be a non-negative integer");let i=e;if(i._coefficient===0n)throw Error("Division by zero");let r=this._exponent-i._exponent+t,o,s,a;if(r>=0){let l=this._coefficient*10n**BigInt(r);o=l/i._coefficient,s=l%i._coefficient,a=i._coefficient}else{let l=i._coefficient*10n**BigInt(-r);o=this._coefficient/l,s=this._coefficient%l,a=l}let c=C.roundDivision(o,s,a,n);return new C(c,-t)}cmp(e){let t=e;if(this._exponent===t._exponent){if(this._coefficient<t._coefficient)return-1;if(this._coefficient>t._coefficient)return 1;return 0}if(this._exponent<t._exponent){let n=10n**BigInt(t._exponent-this._exponent),i=t._coefficient*n;if(this._coefficient<i)return-1;if(this._coefficient>i)return 1;return 0}else{let n=10n**BigInt(this._exponent-t._exponent),i=this._coefficient*n;if(i<t._coefficient)return-1;if(i>t._coefficient)return 1;return 0}}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)===-1}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)===1}gte(e){return this.cmp(e)>=0}isZero(){return this._coefficient===0n}isNegative(){return this._coefficient<0n}isPositive(){return this._coefficient>0n}neg(){return new C(-this._coefficient,this._exponent)}abs(){if(this._coefficient<0n)return new C(-this._coefficient,this._exponent);return this}round(e,t){let n=typeof t==="string"?Hd[t]:t;if(n===void 0)throw Error(`Unknown rounding preset: "${t}"`);if(n.value<0||!Number.isInteger(n.value))throw Error("DecimalRoundingOptions.value must be a non-negative integer");if(n.mode==="decimal-places"){let u=this.toFixed(n.value,e);return M.from(u)}if(this._coefficient===0n)return this;let r=(this._coefficient<0n?(-this._coefficient).toString():this._coefficient.toString()).length;if(n.value===0)return M.zero;if(r<=n.value)return this;let o=r-n.value,s=10n**BigInt(o),a=this._coefficient/s,c=this._coefficient%s,l=C.roundDivision(a,c,s,e);return new C(l,this._exponent+o)}toString(){if(this._coefficient===0n)return"0";let e=this._coefficient.toString(),t=e.startsWith("-"),n=t?e.slice(1):e;if(this._exponent<0){let r=-this._exponent;if((r>=n.length?r-n.length:0)>30){if(n.length===1)return`${e}E${String(this._exponent)}`;let s=n[0]??"",a=n.slice(1),c=this._exponent+n.length-1;return`${t?"-":""}${s}.${a}E${String(c)}`}if(r>=n.length){let s="0".repeat(r-n.length);return`${t?"-":""}0.${s}${n}`}else{let s=n.slice(0,n.length-r),a=n.slice(n.length-r);return`${t?"-":""}${s}.${a}`}}if(n.length+this._exponent<=30){if(this._exponent===0)return e;let r="0".repeat(this._exponent);return`${t?"-":""}${n}${r}`}else{if(n.length===1)return`${e}E+${String(this._exponent)}`;let r=n[0]??"",o=n.slice(1),s=this._exponent+n.length-1;return`${t?"-":""}${r}.${o}E+${String(s)}`}}toJSON(){return this.toString()}toNumber(){return Number(this.toString())}toFixed(e,t){if(e<0||!Number.isInteger(e))throw Error("decimalPlaces must be a non-negative integer");let n=(r)=>{let o=r.toString(),s=o.startsWith("-"),a=s?o.slice(1):o;if(e===0)return o;if(e>=a.length){let c="0".repeat(e-a.length);return`${s?"-":""}0.${c}${a}`}else{let c=a.slice(0,a.length-e),l=a.slice(a.length-e);return`${s?"-":""}${c}.${l}`}},i=-e;if(this._exponent===i)return n(this._coefficient);if(this._exponent<i){let r=i-this._exponent,o=10n**BigInt(r),s=this._coefficient/o,a=this._coefficient%o,c=C.roundDivision(s,a,o,t);return n(c)}else{let r=this._exponent-i,o=this._coefficient*10n**BigInt(r);return n(o)}}valueOf(){return this.toString()}}var Hd,M;var Ri=f(()=>{Hd={"ubb-usage-count":{mode:"significant-figures",value:15},"v1-api":{mode:"decimal-places",value:12}};M={from(e){if(typeof e==="bigint")return new C(e,0);if(typeof e==="number"){if(!Number.isFinite(e))throw Error("Number must be finite");return M.from(e.toString())}let t=e.trim();if(t==="")throw Error("Cannot parse empty string as Decimal");let n=/^([+-]?)(\d+)(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/.exec(t);if(!n)throw Error(`Invalid decimal string: ${e}`);let i=n[1]==="-"?-1n:1n,r=n[2]??"",o=n[3]??"",s=n[4]?Number(n[4]):0;if(!Number.isSafeInteger(s)||s>1e6||s<-1e6)throw Error(`Exponent out of range: ${String(n[4])} exceeds safe integer bounds`);let a=r+o,c=i*BigInt(a),l=s-o.length;if(!Number.isSafeInteger(l)||l>1e6||l<-1e6)throw Error(`Computed exponent out of range: ${String(l)} exceeds safe integer bounds`);return new C(c,l)},zero:new C(0n,0)}});var Si={};Oi(Si,{RateLimitError:()=>Cr,StripeAPIError:()=>ve,StripeAuthenticationError:()=>gr,StripeCardError:()=>br,StripeConnectionError:()=>wi,StripeError:()=>j,StripeIdempotencyError:()=>vi,StripeInvalidClientError:()=>Tr,StripeInvalidGrantError:()=>Rr,StripeInvalidRequestError:()=>Ti,StripeInvalidScopeError:()=>vr,StripeOAuthError:()=>L,StripeOAuthInvalidRequestError:()=>wr,StripePermissionError:()=>hr,StripeRateLimitError:()=>yr,StripeSignatureVerificationError:()=>N,StripeUnsupportedGrantTypeError:()=>Sr,StripeUnsupportedResponseTypeError:()=>xr,TemporarySessionExpiredError:()=>jr,generateOAuthError:()=>_r,generateV1Error:()=>we,generateV2Error:()=>kr});var we=(e)=>{let t=e.statusCode;if(t===429||t===400&&e.code==="rate_limit")return new yr(e);if(t===400||t===404){if(e.type==="idempotency_error")return new vi(e);return new Ti(e)}if(t===401)return new gr(e);if(t===402)return new br(e);if(t===403)return new hr(e);return new ve(e)},_r=(e)=>{switch(e.type){case"invalid_grant":return new Rr(e);case"invalid_client":return new Tr(e);case"invalid_request":return new wr(e);case"invalid_scope":return new vr(e);case"unsupported_grant_type":return new Sr(e);case"unsupported_response_type":return new xr(e);default:return new L(e)}},kr=(e)=>{switch(e.type){case"idempotency_error":return new vi(e);case"rate_limit":return new Cr(e);case"temporary_session_expired":return new jr(e)}switch(e.code){case"invalid_fields":return new Ti(e)}return we(e)},j,br,Ti,ve,gr,hr,yr,wi,N,vi,L,Rr,Tr,wr,vr,Sr,xr,Cr,jr;var xi=f(()=>{j=class j extends Error{constructor(e={},t=null){super(e.message);this.type=t||this.constructor.name,this.raw=e,this.rawType=e.type,this.detail=e.detail,this.headers=e.headers,this.requestId=e.requestId,this.statusCode=e.statusCode,this.message=e.message??"",this.userMessage=e.user_message,this.advice_code=e.advice_code,this.charge=e.charge,this.code=e.code,this.decline_code=e.decline_code,this.doc_url=e.doc_url,this.network_advice_code=e.network_advice_code,this.network_decline_code=e.network_decline_code,this.param=e.param,this.payment_intent=e.payment_intent,this.payment_method=e.payment_method,this.payment_method_type=e.payment_method_type,this.request_log_url=e.request_log_url,this.setup_intent=e.setup_intent,this.source=e.source,this.user_message=e.user_message}};j.generate=we;br=class br extends j{constructor(e={}){super(e,"StripeCardError");this.decline_code=e.decline_code??""}};Ti=class Ti extends j{constructor(e={}){super(e,"StripeInvalidRequestError")}};ve=class ve extends j{constructor(e={}){super(e,"StripeAPIError")}};gr=class gr extends j{constructor(e={}){super(e,"StripeAuthenticationError")}};hr=class hr extends j{constructor(e={}){super(e,"StripePermissionError")}};yr=class yr extends j{constructor(e={}){super(e,"StripeRateLimitError")}};wi=class wi extends j{constructor(e={}){super(e,"StripeConnectionError")}};N=class N extends j{constructor(e,t,n={}){super(n,"StripeSignatureVerificationError");this.header=e,this.payload=t}};vi=class vi extends j{constructor(e={}){super(e,"StripeIdempotencyError")}};L=class L extends j{constructor(e={},t="StripeOAuthError"){super(e,t)}};Rr=class Rr extends L{constructor(e={}){super(e,"StripeInvalidGrantError")}};Tr=class Tr extends L{constructor(e={}){super(e,"StripeInvalidClientError")}};wr=class wr extends L{constructor(e={}){super(e,"StripeOAuthInvalidRequestError")}};vr=class vr extends L{constructor(e={}){super(e,"StripeInvalidScopeError")}};Sr=class Sr extends L{constructor(e={}){super(e,"StripeUnsupportedGrantTypeError")}};xr=class xr extends L{constructor(e={}){super(e,"StripeUnsupportedResponseTypeError")}};Cr=class Cr extends j{constructor(e={}){super(e,"RateLimitError")}};jr=class jr extends j{constructor(e={}){super(e,"TemporarySessionExpiredError")}}});class re{constructor(e,t){this._stripe=e,this._maxBufferedRequestMetric=t}_normalizeStripeContext(e,t){if(e)return e.toString()||null;return t?.toString()||null}_addHeadersDirectlyToObject(e,t){e.requestId=t["request-id"],e.stripeAccount=e.stripeAccount||t["stripe-account"],e.apiVersion=e.apiVersion||t["stripe-version"],e.idempotencyKey=e.idempotencyKey||t["idempotency-key"]}_makeResponseEvent(e,t,n){let i=Date.now(),r=i-e.request_start_time;return _i({api_version:n["stripe-version"],account:n["stripe-account"],idempotency_key:n["idempotency-key"],method:e.method,path:e.path,status:t,request_id:this._getRequestId(n),elapsed:r,request_start_time:e.request_start_time,request_end_time:i})}_getRequestId(e){return e["request-id"]}_emitStripeNotice(e){let t=e["stripe-notice"];if(t)this._stripe._platformFunctions.emitWarning(typeof t==="string"?t:t[0])}_streamingResponseHandler(e,t,n){return(i)=>{let r=i.getHeaders();this._emitStripeNotice(r);let o=()=>{let a=this._makeResponseEvent(e,i.getStatusCode(),r);this._stripe._emitter.emit("response",a),this._recordRequestMetrics(this._getRequestId(r),a.elapsed,t)},s=i.toStream(o);return this._addHeadersDirectlyToObject(s,r),n(null,s)}}_jsonResponseHandler(e,t,n,i){return(r)=>{let o=r.getHeaders();this._emitStripeNotice(o);let s=this._getRequestId(o),a=r.getStatusCode(),c=this._makeResponseEvent(e,a,o);r.toJSON().then((l)=>{if(this._stripe.getEmitEventBodiesEnabled())c.body=l;if(l.error){let u=typeof l.error==="string";if(u)l.error={type:l.error,message:l.error_description};l.error.headers=o,l.error.statusCode=a,l.error.requestId=s;let m;if(u)m=_r(l.error);else if(t==="v2")m=kr(l.error);else m=we(l.error);throw m}return l},(l)=>{if(this._stripe.getEmitEventBodiesEnabled()&&l.rawBody)c.body=l.rawBody;throw new ve({message:"Invalid JSON received from the Stripe API",exception:l,requestId:o["request-id"]})}).then((l)=>{this._stripe._emitter.emit("response",c),this._recordRequestMetrics(s,c.elapsed,n);let u=r.getRawResponse();this._addHeadersDirectlyToObject(u,o),Object.defineProperty(l,"lastResponse",{enumerable:!1,writable:!1,value:u}),i(null,l)},(l)=>{this._stripe._emitter.emit("response",c),i(l,null)})}}static _generateConnectionErrorMessage(e){return`An error occurred with our connection to Stripe.${e>0?` Request was retried ${e} times.`:""}`}static _shouldRetry(e,t,n,i){if(i&&t===0&&q.CONNECTION_CLOSED_ERROR_CODES.includes(i.code))return!0;if(t>=n)return!1;if(!e)return!0;if(e.getHeaders()["stripe-should-retry"]==="false")return!1;if(e.getHeaders()["stripe-should-retry"]==="true")return!0;if(e.getStatusCode()===409)return!0;if(e.getStatusCode()>=500)return!0;return!1}_getSleepTimeInMS(e){let t=this._stripe.getInitialNetworkRetryDelay(),n=this._stripe.getMaxNetworkRetryDelay(),i=Math.min(t*Math.pow(2,e-1),n);return i*=0.5*(1+Math.random()),i=Math.max(t,i),i*1000}_getMaxNetworkRetries(e={}){return e.maxNetworkRetries!==void 0&&Number.isInteger(e.maxNetworkRetries)?e.maxNetworkRetries:this._stripe.getMaxNetworkRetries()}_defaultIdempotencyKey(e,t,n){let i=this._getMaxNetworkRetries(t),r=()=>`stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`;if(n==="v2"){if(e==="POST"||e==="DELETE")return r()}else if(n==="v1"){if(e==="POST"&&i>0)return r()}return null}_makeHeaders({contentType:e,contentLength:t,apiVersion:n,clientUserAgent:i,method:r,userSuppliedHeaders:o,userSuppliedSettings:s,stripeAccount:a,stripeContext:c,apiMode:l}){let u={Accept:"application/json","Content-Type":e,"User-Agent":this._getUserAgentString(l),"X-Stripe-Client-User-Agent":i,"X-Stripe-Client-Telemetry":this._getTelemetryHeader(),"Stripe-Version":n,"Stripe-Account":a,"Stripe-Context":c,"Idempotency-Key":this._defaultIdempotencyKey(r,s,l)},m=r=="POST"||r=="PUT"||r=="PATCH";if(m||t){if(!m)this._stripe._platformFunctions.emitWarning(`${r} method had non-zero contentLength but no payload is expected for this verb`);u["Content-Length"]=t}return Object.assign(_i(u),ul(o))}_getUserAgentString(e){let t=this._stripe.getConstant("PACKAGE_VERSION"),n=this._stripe._appInfo?this._stripe.getAppInfoAsString():"",i=this._stripe.getConstant("AI_AGENT"),r=`Stripe/${e} NodeBindings/${t}`;if(n)r+=` ${n}`;if(i)r+=` AIAgent/${i}`;return r}_getTelemetryHeader(){if(this._stripe.getTelemetryEnabled()&&this._stripe._prevRequestMetrics.length>0){let e=this._stripe._prevRequestMetrics.shift();return JSON.stringify({last_request_metrics:e})}}_recordRequestMetrics(e,t,n){if(this._stripe.getTelemetryEnabled()&&e)if(this._stripe._prevRequestMetrics.length>this._maxBufferedRequestMetric)this._stripe._platformFunctions.emitWarning("Request metrics buffer is full, dropping telemetry message.");else{let i={request_id:e,request_duration_ms:t};if(n&&n.length>0)i.usage=n;this._stripe._prevRequestMetrics.push(i)}}_rawRequest(e,t,n,i,r){return new Promise((o,s)=>{try{let a=e.toUpperCase();if(a!=="POST"&&n&&Object.keys(n).length!==0)throw Error("rawRequest only supports params on POST requests. Please pass null and add your parameters to path.");let c=a==="POST"?Object.assign({},n):null,l=fi(i);if(i?.additionalHeaders)Object.assign(l.headers,i.additionalHeaders);let u=l.apiBase||(i?.apiBase??null),m=u?this._stripe.resolveBaseAddress(u):null;this._request(a,m,t,c,l.authenticator,{headers:l.headers,settings:l.settings,streaming:l.streaming},r||["raw_request"],(p,_)=>{if(p)s(p);else o(_)})}catch(a){s(a)}})}_getContentLength(e){return typeof e==="string"?new TextEncoder().encode(e).length:e.length}_request(e,t,n,i,r,o,s=[],a,c=null){let l;r=r??this._stripe._authenticator;let u=bi(n),m=(k,g,y,R)=>setTimeout(k,this._getSleepTimeInMS(R),g,y,R+1),p=(k,g,y)=>{let R=o.settings&&o.settings.timeout&&Number.isInteger(o.settings.timeout)&&o.settings.timeout>=0?o.settings.timeout:this._stripe.getApiField("timeout"),v={host:t||this._stripe.getApiField("host"),port:this._stripe.getApiField("port"),path:n,method:e,headers:Object.assign({},g),body:l,protocol:this._stripe.getApiField("protocol")};if(!r)throw Error("Authenticator was't initialized. Please pass an API Key or an Authenticator when initializing StripeClient.");r(v).then(()=>{let x=this._stripe.getApiField("httpClient").makeRequest(v.host,v.port,v.path,v.method,v.headers,v.body,v.protocol,R),P=Date.now(),U=_i({api_version:k,account:gi(g["Stripe-Account"]),idempotency_key:gi(g["Idempotency-Key"]),method:e,path:n,body:this._stripe.getEmitEventBodiesEnabled()?i??void 0:void 0,request_start_time:P}),X=y||0,oi=this._getMaxNetworkRetries(o.settings||{});this._stripe._emitter.emit("request",U),x.then((O)=>{if(re._shouldRetry(O,X,oi))return m(p,k,g,X);else if(o.streaming&&O.getStatusCode()<400)return this._streamingResponseHandler(U,s,a)(O);else return this._jsonResponseHandler(U,u,s,a)(O)}).catch((O)=>{if(re._shouldRetry(null,X,oi,O))return m(p,k,g,X);else{let de=O.code&&O.code===q.TIMEOUT_ERROR_CODE;return a(new wi({message:de?`Request aborted due to timeout being reached (${R}ms)`:re._generateConnectionErrorMessage(X),detail:O}))}})}).catch((x)=>{throw new j({message:"Unable to authenticate the request",exception:x})})},_=(k,g)=>{if(k)return a(k);l=g,this._stripe.getClientUserAgent((y)=>{let R=this._stripe.getApiField("version"),v=this._makeHeaders({contentType:u=="v2"?"application/json":"application/x-www-form-urlencoded",contentLength:this._getContentLength(g),apiVersion:R,clientUserAgent:y,method:e,userSuppliedHeaders:o.headers??null,userSuppliedSettings:o.settings??{},stripeAccount:o.stripeAccount??this._stripe.getApiField("stripeAccount"),stripeContext:this._normalizeStripeContext(o.stripeContext,this._stripe.getApiField("stripeContext")),apiMode:u});p(R,v,0)})};if(c)c(e,i,o.headers,_);else{let k;if(u=="v2")k=i?_l(i):"";else k=z(i||{});_(null,k)}}}var wl=f(()=>{xi();hi();W()});var Se=(e,t)=>{if(e==null)return e;switch(t.kind){case"int64_string":return typeof e==="bigint"||typeof e==="number"?String(e):e;case"decimal_string":return typeof e.toFixed==="function"&&typeof e.isZero==="function"?e.toString():e;case"object":{if(typeof e!=="object"||Array.isArray(e))return e;let n=e,i={};for(let r of Object.keys(n)){let o=t.fields[r];i[r]=o?Se(n[r],o):n[r]}return i}case"array":{if(!Array.isArray(e))return e;return e.map((n)=>Se(n,t.element))}case"nullable":return Se(e,t.inner)}},xe=(e,t)=>{if(e==null)return e;switch(t.kind){case"int64_string":if(typeof e==="string")try{return BigInt(e)}catch{throw Error(`Failed to coerce int64_string value: expected an integer string, got '${e}'`)}return e;case"decimal_string":if(typeof e==="string")try{return M.from(e)}catch{throw Error(`Failed to coerce decimal_string value: expected a decimal string, got '${e}'`)}return e;case"object":{if(typeof e!=="object"||Array.isArray(e))return e;let n=e;for(let i of Object.keys(t.fields))if(i in n)n[i]=xe(n[i],t.fields[i]);return n}case"array":{if(!Array.isArray(e))return e;for(let n=0;n<e.length;n++)e[n]=xe(e[n],t.element);return e}case"nullable":return xe(e,t.inner)}};var vl=f(()=>{Ri()});class Er{constructor(e,t,n,i,r,o,s){this.index=0,this.pagePromise=e,this.promiseCache={currentPromise:null},this.params=t,this.options=n,this.method=i,this.path=r,this.spec=o,this.stripeResource=s}async iterate(e){if(!(e&&e.data&&typeof e.data.length==="number"))throw Error("Unexpected: Stripe API response does not have a well-formed `data` array.");let t=!!this.params.ending_before;if(this.index<e.data.length){let n=t?e.data.length-1-this.index:this.index,i=e.data[n];return this.index+=1,{value:i,done:!1}}else if(e.has_more){this.index=0,this.pagePromise=this.getNextPage(e);let n=await this.pagePromise;return this.iterate(n)}return{done:!0,value:void 0}}getNextPage(e){throw Error("Unimplemented")}async _next(){return this.iterate(await this.pagePromise)}next(){if(this.promiseCache.currentPromise)return this.promiseCache.currentPromise;let e=(async()=>{let t=await this._next();return this.promiseCache.currentPromise=null,t})();return this.promiseCache.currentPromise=e,e}}class Cl{constructor(e,t,n,i){this.firstPagePromise=e,this.currentPageIterator=null,this.nextPageUrl=null,this.promiseCache={currentPromise:null},this.options=t,this.spec=n,this.stripeResource=i}async initFirstPage(){if(this.firstPagePromise){let e=await this.firstPagePromise;this.firstPagePromise=null,this.currentPageIterator=e.data[Symbol.iterator](),this.nextPageUrl=e.next_page_url||null}}async turnPage(){if(!this.nextPageUrl)return null;let e=await this.stripeResource._makeRequest("GET",this.nextPageUrl,void 0,this.options,this.spec);return this.nextPageUrl=e.next_page_url||null,this.currentPageIterator=e.data[Symbol.iterator](),this.currentPageIterator}async _next(){if(await this.initFirstPage(),this.currentPageIterator){let e=this.currentPageIterator.next();if(!e.done)return{done:!1,value:e.value}}return this.nextFromNewPage()}async nextFromNewPage(){let e=await this.turnPage();if(!e)return{done:!0,value:void 0};let t=e.next();if(!t.done)return{done:!1,value:t.value};return this.nextFromNewPage()}next(){if(this.promiseCache.currentPromise)return this.promiseCache.currentPromise;let e=(async()=>{try{return await this._next()}finally{this.promiseCache.currentPromise=null}})();return this.promiseCache.currentPromise=e,e}}function Vd(){if(typeof Symbol<"u"&&Symbol.asyncIterator)return Symbol.asyncIterator;return"@@asyncIterator"}function zd(e){if(e.length<2)return null;let t=e[1];if(typeof t!=="function")throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);return t}function Wd(e){if(e.length===0)return;let t=e[0];if(typeof t!=="function")throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);if(t.length===2)return t;if(t.length>2)throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${t}`);return function(i,r){let o=t(i);r(o)}}function Qd(e,t){let n=t?0:e.data.length-1,i=e.data[n],r=i&&i.id;if(!r)throw Error("Unexpected: No `id` found on the last item while auto-paging a list.");return r}function Jd(e){return function(){let n=Error().stack,i=[].slice.call(arguments),r=Wd(i),o=zd(i);if(i.length>2)throw Error(`autoPagingEach takes up to two arguments; received ${i}`);let s=Yd(e,r).catch((a)=>{throw ge(a,n),a});if(o)s.then(()=>o(),(a)=>o(a));return s}}function Xd(e){return function(n,i){let r=Error().stack,o=n&&n.limit;if(!o)throw Error("You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.");if(o>1e4)throw Error("You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.");let s=new Promise((a,c)=>{let l=[];e((u)=>{if(l.push(u),l.length>=o)return!1}).then(()=>{a(l)}).catch((u)=>{ge(u,r),c(u)})});if(i)s.then((a)=>i(null,a),(a)=>i(a));return s}}function Yd(e,t){return new Promise((n,i)=>{function r(o){if(o.done){n();return}let s=o.value;return new Promise((a)=>{t(s,a)}).then((a)=>{if(a===!1)return r({done:!0,value:void 0});else return e().then(r)})}e().then(r).catch(i)})}var Sl,xl,jl=(e,t,n,i,r,o,s)=>{let a=bi(r),c=o?.methodType;if(a!=="v2"&&c==="search")return Pr(new xl(s,t,n,i,r,o,e));if(a!=="v2"&&c==="list")return Pr(new Sl(s,t,n,i,r,o,e));if(a==="v2"&&c==="list")return Pr(new Cl(s,n,o,e));return null},Pr=(e)=>{let t=Jd((...r)=>e.next(...r)),n=Xd(t),i={autoPagingEach:t,autoPagingToArray:n,next:()=>e.next(),return:()=>({}),[Vd()]:()=>i};return i};var Pl=f(()=>{W();Sl=class Sl extends Er{getNextPage(e){let t=!!this.params.ending_before,n=Qd(e,t),i={...this.params,[t?"ending_before":"starting_after"]:n};return this.stripeResource._makeRequest(this.method,this.path,i,this.options,this.spec)}};xl=class xl extends Er{getNextPage(e){if(!e.next_page)throw Error("Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.");let t={...this.params,page:e.next_page};return this.stripeResource._makeRequest(this.method,this.path,t,this.options,this.spec)}}});class d{constructor(e,t){if(this.resourcePath="",this.requestDataProcessor=null,this._stripe=e,t)throw Error("Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.");this.basePath=be(this.basePath||e.getApiField("basePath"));let n=this.path||"";this.resourcePath=n,this.path=be(n),this.initialize(e,t)}initialize(e,t){}_makeRequest(e,t,n,i,r){let o=e.toUpperCase(),a=(r?.encode||((x)=>x))(n?{...n}:{}),c=fi(i),l=c.apiBase||r?.apiBase||null,u=l?this._stripe.resolveBaseAddress(l):null,m=c.streaming||!!r?.streaming,p=Object.assign(c.headers,r?.headers),_=r?.usage||[],k=o==="GET"||o==="DELETE",g=k?null:a,y=k?a:{};try{if(r?.validator)r.validator(a,{headers:p});if(r?.requestSchema&&g)g=Se(g,r.requestSchema)}catch(x){return Promise.reject(x)}let R=Error().stack,v=new Promise((x,P)=>{function U(O,de){if(O)ge(O,R),P(O);else try{if(r?.responseSchema)xe(de,r.responseSchema);x(r?.transformResponseData?r.transformResponseData(de):de)}catch(Wc){P(Wc)}}let X=Object.keys(y).length===0,oi=[t,X?"":"?",z(y)].join("");this._stripe._requestSender._request(o,u,oi,g,c.authenticator,{headers:p,settings:c.settings,streaming:m},_,U,this.requestDataProcessor?.bind(this))});if(r?.methodType)Object.assign(v,jl(this,n?{...n}:{},i,o,t,r,v));return v}}var b=f(()=>{W();vl();Pl();d.MAX_BUFFERED_REQUEST_METRICS=100});class K{constructor(e=[]){this._segments=[...e]}get segments(){return[...this._segments]}push(e){if(!e)throw Error("Segment cannot be null or undefined");return new K([...this._segments,e])}pop(){if(this._segments.length===0)throw Error("Cannot pop from an empty context");return new K(this._segments.slice(0,-1))}toString(){return this._segments.join("/")}static parse(e){if(!e)return new K([]);return new K(e.split("/"))}}function El(e){let t={DEFAULT_TOLERANCE:300,signature:null,constructEvent(u,m,p,_,k,g){try{if(!this.signature)throw Error("ERR: missing signature helper, unable to verify");k=k||c(),this.signature.verifyHeader(u,m,p,_||t.DEFAULT_TOLERANCE,k,g)}catch(R){if(R instanceof Te)R.message+="\nUse `await constructEventAsync(...)` instead of `constructEvent(...)`";throw R}let y=u instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(u)):JSON.parse(u);if(y&&y.object==="v2.core.event")throw Error("You passed an event notification to stripe.webhooks.constructEvent, which expects a webhook payload. Use stripe.parseEventNotification instead.");return y},async constructEventAsync(u,m,p,_,k,g){if(!this.signature)throw Error("ERR: missing signature helper, unable to verify");k=k||c(),await this.signature.verifyHeaderAsync(u,m,p,_||t.DEFAULT_TOLERANCE,k,g);let y=u instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(u)):JSON.parse(u);if(y&&y.object==="v2.core.event")throw Error("You passed an event notification to stripe.webhooks.constructEvent, which expects a webhook payload. Use stripe.parseEventNotificationAsync instead.");return y},generateTestHeaderString:function(u){let m=l(u),p=m.signature||m.cryptoProvider.computeHMACSignature(m.payloadString,m.secret);return m.generateHeaderString(p)},generateTestHeaderStringAsync:async function(u){let m=l(u),p=m.signature||await m.cryptoProvider.computeHMACSignatureAsync(m.payloadString,m.secret);return m.generateHeaderString(p)}},n={EXPECTED_SCHEME:"v1",verifyHeader(u,m,p,_,k,g){let{decodedHeader:y,decodedPayload:R,details:v,suspectPayloadType:x}=r(u,m,this.EXPECTED_SCHEME),P=/\s/.test(p);k=k||c();let U=k.computeHMACSignature(i(R,v),p);return o(R,y,v,U,_||0,x,P,g),!0},async verifyHeaderAsync(u,m,p,_,k,g){let{decodedHeader:y,decodedPayload:R,details:v,suspectPayloadType:x}=r(u,m,this.EXPECTED_SCHEME),P=/\s/.test(p);k=k||c();let U=await k.computeHMACSignatureAsync(i(R,v),p);return o(R,y,v,U,_||0,x,P,g)}};function i(u,m){return`${m.timestamp}.${u}`}function r(u,m,p){if(Array.isArray(m))throw Error("Unexpected: An array was passed as a header, which should not be possible for the stripe-signature header.");if(!u)throw new N(m,u,{message:"No webhook payload was provided."});let _=typeof u!="string"&&!(u instanceof Uint8Array),k=new TextDecoder("utf8"),g=u instanceof Uint8Array?k.decode(u):u;if(m==null||m=="")throw new N(m,u,{message:"No stripe-signature header value was provided."});let y=m instanceof Uint8Array?k.decode(m):m,R=s(y,p);if(!R||R.timestamp===-1)throw new N(y,g,{message:"Unable to extract timestamp and signatures from header"});if(!R.signatures.length)throw new N(y,g,{message:"No signatures found with expected scheme"});return{decodedPayload:g,decodedHeader:y,details:R,suspectPayloadType:_}}function o(u,m,p,_,k,g,y,R){let v=!!p.signatures.filter(e.secureCompare.bind(e,_)).length,x=`
6
6
  Learn more about webhook signing and explore webhook integration examples for various frameworks at https://docs.stripe.com/webhooks/signature`,P=y?`
7
7
 
8
8
  Note: The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value`:"";if(!v){if(g)throw new N(m,u,{message:`Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead.
@@ -11,25 +11,25 @@ Signature verification is impossible without access to the original signed mater
11
11
  `+P});throw new N(m,u,{message:`No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?
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
  `+x+`
14
- `+P})}let U=Math.floor((typeof R==="number"?R:Date.now())/1000)-p.timestamp;if(k>0&&U>k)throw new N(m,u,{message:"Timestamp outside the tolerance zone"});return!0}function s(u,m){if(typeof u!=="string")return null;return m=m||n.EXPECTED_SCHEME,u.split(",").reduce((p,_)=>{let k=_.split("=");if(k[0]==="t")p.timestamp=parseInt(k[1],10);if(k[0]===m)p.signatures.push(k[1]);return p},{timestamp:-1,signatures:[]})}let a=null;function c(){if(!a)a=e.createDefaultCryptoProvider();return a}function l(u){if(!u)throw new j({message:"Options are required"});let m=u.timestamp&&Math.floor(u.timestamp)||Math.floor(Date.now()/1000),p=u.scheme||n.EXPECTED_SCHEME,_=u.cryptoProvider||c(),k=`${m}.${u.payload}`;return{...u,timestamp:m,scheme:p,cryptoProvider:_,payloadString:k,generateHeaderString:(y)=>`t=${m},${p}=${y}`}}return t.signature=n,t}var El=f(()=>{xi();yi()});var qr="2026-06-24.dahlia";function Yd(e,t){for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=n[0].toLowerCase()+n.substring(1),r=new t[n](e);this[i]=r}}function S(e,t){return function(n){return new Yd(n,t)}}var Ce;var Or=f(()=>{b();Ce=class Ce extends d{create(e,t){return this._makeRequest("POST","/v2/core/account_links",e,t)}}});var je;var Ar=f(()=>{b();je=class je extends d{create(e,t){return this._makeRequest("POST","/v2/core/account_tokens",e,t,{requestSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}retrieve(e,t,n){return this._makeRequest("GET",`/v2/core/account_tokens/${encodeURIComponent(e)}`,t,n)}}});var Pe;var Ir=f(()=>{b();Pe=class Pe extends d{list(e,t){return this._makeRequest("GET","/v1/financial_connections/accounts",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/financial_connections/accounts/${encodeURIComponent(e)}`,t,n)}disconnect(e,t,n){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/disconnect`,t,n)}refresh(e,t,n){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/refresh`,t,n)}subscribe(e,t,n){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/subscribe`,t,n)}unsubscribe(e,t,n){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/unsubscribe`,t,n)}listOwners(e,t,n){return this._makeRequest("GET",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/owners`,t,n,{methodType:"list"})}}});var $r;var ql=f(()=>{b();$r=class $r extends d{list(e,t,n){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(e)}/persons`,t,n,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}})}create(e,t,n){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}/persons`,t,n,{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(e,t,n,i){return this._makeRequest("DELETE",`/v2/core/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i)}retrieve(e,t,n,i){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i,{responseSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}})}update(e,t,n,i){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i,{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 Ur;var Ol=f(()=>{b();Ur=class Ur extends d{create(e,t,n){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}/person_tokens`,t,n,{requestSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}})}retrieve(e,t,n,i){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(e)}/person_tokens/${encodeURIComponent(t)}`,n,i)}}});var Ee;var Mr=f(()=>{b();ql();Ol();Ee=class Ee extends d{constructor(e){super(e);this.stripe=e,this.persons=new $r(e),this.personTokens=new Ur(e)}list(e,t){return this._makeRequest("GET","/v2/core/accounts",e,t,{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(e,t){return this._makeRequest("POST","/v2/core/accounts",e,t,{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(e,t,n){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(e)}`,t,n,{responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}update(e,t,n){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}/close`,t,n,{responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}}});var qe;var Dr=f(()=>{b();qe=class qe extends d{list(e,t){return this._makeRequest("GET","/v1/entitlements/active_entitlements",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/entitlements/active_entitlements/${encodeURIComponent(e)}`,t,n)}}});var Oe;var Fr=f(()=>{b();Oe=class Oe extends d{list(e,t){return this._makeRequest("GET","/v1/billing/alerts",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/billing/alerts",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing/alerts/${encodeURIComponent(e)}`,t,n)}activate(e,t,n){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(e)}/activate`,t,n)}archive(e,t,n){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(e)}/archive`,t,n)}deactivate(e,t,n){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(e)}/deactivate`,t,n)}}});var Ae;var Nr=f(()=>{b();Ae=class Ae extends d{find(e,t){return this._makeRequest("GET","/v1/tax/associations/find",e,t)}}});var Ie;var Gr=f(()=>{b();Ie=class Ie extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/authorizations",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/issuing/authorizations/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(e)}/approve`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(e)}/decline`,t,n,{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 $e;var Br=f(()=>{b();$e=class $e extends d{create(e,t){return this._makeRequest("POST","/v1/test_helpers/issuing/authorizations",e,t,{requestSchema:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}}}},responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}capture(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/capture`,t,n,{requestSchema:{kind:"object",fields:{purchase_details:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}},receipt:{kind:"array",element:{kind:"object",fields:{quantity:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}expire(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/expire`,t,n,{responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}finalizeAmount(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/finalize_amount`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/fraud_challenges/respond`,t,n,{responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}increment(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/increment`,t,n,{responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}reverse(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/reverse`,t,n,{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 Ue;var Lr=f(()=>{b();Ue=class Ue extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax/calculations/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/tax/calculations",e,t)}listLineItems(e,t,n){return this._makeRequest("GET",`/v1/tax/calculations/${encodeURIComponent(e)}/line_items`,t,n,{methodType:"list"})}}});var Me;var Kr=f(()=>{b();Me=class Me extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/cardholders",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/issuing/cardholders",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/cardholders/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/cardholders/${encodeURIComponent(e)}`,t,n)}}});var De;var Hr=f(()=>{b();De=class De extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/cards",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/issuing/cards",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/cards/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/cards/${encodeURIComponent(e)}`,t,n)}}});var Fe;var Vr=f(()=>{b();Fe=class Fe extends d{deliverCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/deliver`,t,n)}failCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/fail`,t,n)}returnCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/return`,t,n)}shipCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/ship`,t,n)}submitCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/submit`,t,n)}}});var Ne;var zr=f(()=>{b();Ne=class Ne extends d{list(e,t){return this._makeRequest("GET","/v1/billing_portal/configurations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/billing_portal/configurations",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing_portal/configurations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/billing_portal/configurations/${encodeURIComponent(e)}`,t,n)}}});var Ge;var Wr=f(()=>{b();Ge=class Ge extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/terminal/configurations/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/terminal/configurations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/terminal/configurations/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/terminal/configurations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/terminal/configurations",e,t)}}});var Be;var Qr=f(()=>{b();Be=class Be extends d{create(e,t){return this._makeRequest("POST","/v1/test_helpers/confirmation_tokens",e,t)}}});var Le;var Jr=f(()=>{b();Le=class Le extends d{create(e,t){return this._makeRequest("POST","/v1/terminal/connection_tokens",e,t)}}});var Ke;var Xr=f(()=>{b();Ke=class Ke extends d{retrieve(e,t){return this._makeRequest("GET","/v1/billing/credit_balance_summary",e,t)}}});var He;var Yr=f(()=>{b();He=class He extends d{list(e,t){return this._makeRequest("GET","/v1/billing/credit_balance_transactions",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing/credit_balance_transactions/${encodeURIComponent(e)}`,t,n)}}});var Ve;var Zr=f(()=>{b();Ve=class Ve extends d{list(e,t){return this._makeRequest("GET","/v1/billing/credit_grants",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/billing/credit_grants",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing/credit_grants/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(e)}`,t,n)}expire(e,t,n){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(e)}/expire`,t,n)}voidGrant(e,t,n){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(e)}/void`,t,n)}}});var ze;var eo=f(()=>{b();ze=class ze extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/credit_reversals",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/credit_reversals",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/credit_reversals/${encodeURIComponent(e)}`,t,n)}}});var We;var to=f(()=>{b();We=class We extends d{fundCashBalance(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/customers/${encodeURIComponent(e)}/fund_cash_balance`,t,n)}}});var Qe;var no=f(()=>{b();Qe=class Qe extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/debit_reversals",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/debit_reversals",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/debit_reversals/${encodeURIComponent(e)}`,t,n)}}});var Je;var io=f(()=>{b();Je=class Je extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/disputes",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/issuing/disputes",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/disputes/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/disputes/${encodeURIComponent(e)}`,t,n)}submit(e,t,n){return this._makeRequest("POST",`/v1/issuing/disputes/${encodeURIComponent(e)}/submit`,t,n)}}});var Xe;var ro=f(()=>{b();Xe=class Xe extends d{list(e,t){return this._makeRequest("GET","/v1/radar/early_fraud_warnings",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/radar/early_fraud_warnings/${encodeURIComponent(e)}`,t,n)}}});var Ye;var oo=f(()=>{b();Ye=class Ye extends d{list(e,t){return this._makeRequest("GET","/v2/core/event_destinations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v2/core/event_destinations",e,t)}del(e,t,n){return this._makeRequest("DELETE",`/v2/core/event_destinations/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v2/core/event_destinations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(e)}`,t,n)}disable(e,t,n){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(e)}/disable`,t,n)}enable(e,t,n){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(e)}/enable`,t,n)}ping(e,t,n){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(e)}/ping`,t,n)}}});var Ze;var so=f(()=>{b();Ze=class Ze extends d{list(e,t){let n=(i)=>({...i,data:i.data.map(this.addFetchRelatedObjectIfNeeded.bind(this))});return this._makeRequest("GET","/v2/core/events",e,t,{methodType:"list",transformResponseData:n})}retrieve(e,t,n){let i=(r)=>this.addFetchRelatedObjectIfNeeded(r);return this._makeRequest("GET",`/v2/core/events/${encodeURIComponent(e)}`,t,n,{transformResponseData:i})}addFetchRelatedObjectIfNeeded(e){if(!e.related_object||!e.related_object.url)return e;return{...e,fetchRelatedObject:()=>this._makeRequest("GET",e.related_object.url,void 0,{stripeContext:e.context,headers:{"Stripe-Request-Trigger":`event=${e.id}`}})}}}});var et;var ao=f(()=>{b();et=class et extends d{list(e,t){return this._makeRequest("GET","/v1/entitlements/features",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/entitlements/features",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/entitlements/features/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/entitlements/features/${encodeURIComponent(e)}`,t,n)}}});var tt;var lo=f(()=>{b();tt=class tt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/financial_accounts",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/financial_accounts",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}`,t,n)}close(e,t,n){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}/close`,t,n)}updateFeatures(e,t,n){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}/features`,t,n)}retrieveFeatures(e,t,n){return this._makeRequest("GET",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}/features`,t,n)}}});var nt;var co=f(()=>{b();nt=class nt extends d{list(e,t){return this._makeRequest("GET","/v2/commerce/product_catalog/imports",e,t,{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(e,t){return this._makeRequest("POST","/v2/commerce/product_catalog/imports",e,t,{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(e,t,n){return this._makeRequest("GET",`/v2/commerce/product_catalog/imports/${encodeURIComponent(e)}`,t,n,{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 it;var uo=f(()=>{b();it=class it extends d{fail(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(e)}/fail`,t,n)}returnInboundTransfer(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(e)}/return`,t,n)}succeed(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(e)}/succeed`,t,n)}}});var rt;var mo=f(()=>{b();rt=class rt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/inbound_transfers",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/inbound_transfers",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/inbound_transfers/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/treasury/inbound_transfers/${encodeURIComponent(e)}/cancel`,t,n)}}});var ot;var po=f(()=>{b();ot=class ot extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/terminal/locations/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/terminal/locations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/terminal/locations/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/terminal/locations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/terminal/locations",e,t)}}});var st;var fo=f(()=>{b();st=class st extends d{create(e,t){return this._makeRequest("POST","/v1/billing/meter_event_adjustments",e,t)}}});var at;var _o=f(()=>{b();at=class at extends d{create(e,t){return this._makeRequest("POST","/v2/billing/meter_event_adjustments",e,t)}}});var lt;var ko=f(()=>{b();lt=class lt extends d{create(e,t){return this._makeRequest("POST","/v2/billing/meter_event_session",e,t)}}});var ct;var bo=f(()=>{b();ct=class ct extends d{create(e,t){return this._makeRequest("POST","/v2/billing/meter_event_stream",e,t,{apiBase:"meter_events"})}}});var dt;var go=f(()=>{b();dt=class dt extends d{create(e,t){return this._makeRequest("POST","/v1/billing/meter_events",e,t)}}});var ut;var ho=f(()=>{b();ut=class ut extends d{create(e,t){return this._makeRequest("POST","/v2/billing/meter_events",e,t)}}});var mt;var yo=f(()=>{b();mt=class mt extends d{list(e,t){return this._makeRequest("GET","/v1/billing/meters",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/billing/meters",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing/meters/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(e)}`,t,n)}deactivate(e,t,n){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(e)}/deactivate`,t,n)}reactivate(e,t,n){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(e)}/reactivate`,t,n)}listEventSummaries(e,t,n){return this._makeRequest("GET",`/v1/billing/meters/${encodeURIComponent(e)}/event_summaries`,t,n,{methodType:"list"})}}});var pt;var Ro=f(()=>{b();pt=class pt extends d{create(e,t){return this._makeRequest("POST","/v1/terminal/onboarding_links",e,t)}}});var ft;var To=f(()=>{b();ft=class ft extends d{list(e,t){return this._makeRequest("GET","/v1/climate/orders",e,t,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}}}}})}create(e,t){return this._makeRequest("POST","/v1/climate/orders",e,t,{requestSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}},responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/climate/orders/${encodeURIComponent(e)}`,t,n,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}update(e,t,n){return this._makeRequest("POST",`/v1/climate/orders/${encodeURIComponent(e)}`,t,n,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}cancel(e,t,n){return this._makeRequest("POST",`/v1/climate/orders/${encodeURIComponent(e)}/cancel`,t,n,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}}});var _t;var wo=f(()=>{b();_t=class _t extends d{update(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(e)}`,t,n)}fail(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(e)}/fail`,t,n)}post(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(e)}/post`,t,n)}returnOutboundPayment(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(e)}/return`,t,n)}}});var kt;var vo=f(()=>{b();kt=class kt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/outbound_payments",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/outbound_payments",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/outbound_payments/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/treasury/outbound_payments/${encodeURIComponent(e)}/cancel`,t,n)}}});var bt;var So=f(()=>{b();bt=class bt extends d{update(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(e)}`,t,n)}fail(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(e)}/fail`,t,n)}post(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(e)}/post`,t,n)}returnOutboundTransfer(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(e)}/return`,t,n)}}});var gt;var xo=f(()=>{b();gt=class gt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/outbound_transfers",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/outbound_transfers",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/outbound_transfers/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/treasury/outbound_transfers/${encodeURIComponent(e)}/cancel`,t,n)}}});var ht;var Co=f(()=>{b();ht=class ht extends d{create(e,t){return this._makeRequest("POST","/v1/radar/payment_evaluations",e,t)}}});var yt;var jo=f(()=>{b();yt=class yt extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/personalization_designs",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/issuing/personalization_designs",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/personalization_designs/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/personalization_designs/${encodeURIComponent(e)}`,t,n)}}});var Rt;var Po=f(()=>{b();Rt=class Rt extends d{activate(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(e)}/activate`,t,n)}deactivate(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(e)}/deactivate`,t,n)}reject(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(e)}/reject`,t,n)}}});var Tt;var Eo=f(()=>{b();Tt=class Tt extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/physical_bundles",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/physical_bundles/${encodeURIComponent(e)}`,t,n)}}});var wt;var qo=f(()=>{b();wt=class wt extends d{list(e,t){return this._makeRequest("GET","/v1/climate/products",e,t,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{metric_tons_available:{kind:"decimal_string"}}}}}}})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/climate/products/${encodeURIComponent(e)}`,t,n,{responseSchema:{kind:"object",fields:{metric_tons_available:{kind:"decimal_string"}}}})}}});var vt;var Oo=f(()=>{b();vt=class vt extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/terminal/readers/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/terminal/readers/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/terminal/readers",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/terminal/readers",e,t)}cancelAction(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/cancel_action`,t,n)}collectInputs(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/collect_inputs`,t,n)}collectPaymentMethod(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/collect_payment_method`,t,n)}confirmPaymentIntent(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/confirm_payment_intent`,t,n)}processPaymentIntent(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/process_payment_intent`,t,n)}processSetupIntent(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/process_setup_intent`,t,n)}refundPayment(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/refund_payment`,t,n)}setReaderDisplay(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/set_reader_display`,t,n)}}});var St;var Ao=f(()=>{b();St=class St extends d{presentPaymentMethod(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(e)}/present_payment_method`,t,n)}succeedInputCollection(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(e)}/succeed_input_collection`,t,n)}timeoutInputCollection(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(e)}/timeout_input_collection`,t,n)}}});var xt;var Io=f(()=>{b();xt=class xt extends d{create(e,t){return this._makeRequest("POST","/v1/test_helpers/treasury/received_credits",e,t)}}});var Ct;var $o=f(()=>{b();Ct=class Ct extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/received_credits",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/received_credits/${encodeURIComponent(e)}`,t,n)}}});var jt;var Uo=f(()=>{b();jt=class jt extends d{create(e,t){return this._makeRequest("POST","/v1/test_helpers/treasury/received_debits",e,t)}}});var Pt;var Mo=f(()=>{b();Pt=class Pt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/received_debits",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/received_debits/${encodeURIComponent(e)}`,t,n)}}});var Et;var Do=f(()=>{b();Et=class Et extends d{expire(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/refunds/${encodeURIComponent(e)}/expire`,t,n)}}});var qt;var Fo=f(()=>{b();qt=class qt extends d{list(e,t){return this._makeRequest("GET","/v1/tax/registrations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/tax/registrations",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax/registrations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/tax/registrations/${encodeURIComponent(e)}`,t,n)}}});var Ot;var No=f(()=>{b();Ot=class Ot extends d{list(e,t){return this._makeRequest("GET","/v1/reporting/report_runs",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/reporting/report_runs",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/reporting/report_runs/${encodeURIComponent(e)}`,t,n)}}});var At;var Go=f(()=>{b();At=class At extends d{list(e,t){return this._makeRequest("GET","/v1/reporting/report_types",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/reporting/report_types/${encodeURIComponent(e)}`,t,n)}}});var It;var Bo=f(()=>{b();It=class It extends d{list(e,t){return this._makeRequest("GET","/v1/forwarding/requests",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/forwarding/requests",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/forwarding/requests/${encodeURIComponent(e)}`,t,n)}}});var $t;var Lo=f(()=>{b();$t=class $t extends d{list(e,t){return this._makeRequest("GET","/v1/sigma/scheduled_query_runs",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/sigma/scheduled_query_runs/${encodeURIComponent(e)}`,t,n)}}});var Ut;var Ko=f(()=>{b();Ut=class Ut extends d{list(e,t){return this._makeRequest("GET","/v1/apps/secrets",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/apps/secrets",e,t)}find(e,t){return this._makeRequest("GET","/v1/apps/secrets/find",e,t)}deleteWhere(e,t){return this._makeRequest("POST","/v1/apps/secrets/delete",e,t)}}});var Mt;var Ho=f(()=>{b();Mt=class Mt extends d{create(e,t){return this._makeRequest("POST","/v1/billing_portal/sessions",e,t)}}});var Dt;var Vo=f(()=>{b();Dt=class Dt extends d{list(e,t){return this._makeRequest("GET","/v1/checkout/sessions",e,t,{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(e,t){return this._makeRequest("POST","/v1/checkout/sessions",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/checkout/sessions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/checkout/sessions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/checkout/sessions/${encodeURIComponent(e)}/expire`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/checkout/sessions/${encodeURIComponent(e)}/line_items`,t,n,{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 Ft;var zo=f(()=>{b();Ft=class Ft extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/financial_connections/sessions/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/financial_connections/sessions",e,t)}}});var Nt;var Wo=f(()=>{b();Nt=class Nt extends d{retrieve(e,t){return this._makeRequest("GET","/v1/tax/settings",e,t)}update(e,t){return this._makeRequest("POST","/v1/tax/settings",e,t)}}});var Gt;var Qo=f(()=>{b();Gt=class Gt extends d{list(e,t){return this._makeRequest("GET","/v1/climate/suppliers",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/climate/suppliers/${encodeURIComponent(e)}`,t,n)}}});var Bt;var Jo=f(()=>{b();Bt=class Bt extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/test_helpers/test_clocks/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/test_helpers/test_clocks/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/test_helpers/test_clocks",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/test_helpers/test_clocks",e,t)}advance(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/test_clocks/${encodeURIComponent(e)}/advance`,t,n)}}});var Lt;var Xo=f(()=>{b();Lt=class Lt extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/tokens",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/tokens/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/tokens/${encodeURIComponent(e)}`,t,n)}}});var Kt;var Yo=f(()=>{b();Kt=class Kt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/transaction_entries",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/treasury/transaction_entries/${encodeURIComponent(e)}`,t,n,{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 Ht;var Zo=f(()=>{b();Ht=class Ht extends d{list(e,t){return this._makeRequest("GET","/v1/financial_connections/transactions",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/financial_connections/transactions/${encodeURIComponent(e)}`,t,n)}}});var Vt;var es=f(()=>{b();Vt=class Vt extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/transactions",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/issuing/transactions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/issuing/transactions/${encodeURIComponent(e)}`,t,n,{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 zt;var ts=f(()=>{b();zt=class zt extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax/transactions/${encodeURIComponent(e)}`,t,n)}createFromCalculation(e,t){return this._makeRequest("POST","/v1/tax/transactions/create_from_calculation",e,t)}createReversal(e,t){return this._makeRequest("POST","/v1/tax/transactions/create_reversal",e,t)}listLineItems(e,t,n){return this._makeRequest("GET",`/v1/tax/transactions/${encodeURIComponent(e)}/line_items`,t,n,{methodType:"list"})}}});var Wt;var ns=f(()=>{b();Wt=class Wt extends d{refund(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/transactions/${encodeURIComponent(e)}/refund`,t,n,{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(e,t){return this._makeRequest("POST","/v1/test_helpers/issuing/transactions/create_force_capture",e,t,{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(e,t){return this._makeRequest("POST","/v1/test_helpers/issuing/transactions/create_unlinked_refund",e,t,{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 Qt;var is=f(()=>{b();Qt=class Qt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/transactions",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/treasury/transactions/${encodeURIComponent(e)}`,t,n,{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 Jt;var rs=f(()=>{b();Jt=class Jt extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/radar/value_list_items/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/radar/value_list_items/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/radar/value_list_items",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/radar/value_list_items",e,t)}}});var Xt;var os=f(()=>{b();Xt=class Xt extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/radar/value_lists/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/radar/value_lists/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/radar/value_lists/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/radar/value_lists",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/radar/value_lists",e,t)}}});var Yt;var ss=f(()=>{b();Yt=class Yt extends d{list(e,t){return this._makeRequest("GET","/v1/identity/verification_reports",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/identity/verification_reports/${encodeURIComponent(e)}`,t,n)}}});var Zt;var as=f(()=>{b();Zt=class Zt extends d{list(e,t){return this._makeRequest("GET","/v1/identity/verification_sessions",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/identity/verification_sessions",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/identity/verification_sessions/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(e)}/cancel`,t,n)}redact(e,t,n){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(e)}/redact`,t,n)}}});var oe;var Ci=f(()=>{b();oe=class oe extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){if(typeof e==="string")return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}`,t,n);else return this._makeRequest("GET","/v1/account",t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}`,t,n)}retrieveCurrent(e,t){return this._makeRequest("GET","/v1/account",e,t)}list(e,t){return this._makeRequest("GET","/v1/accounts",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/accounts",e,t)}reject(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/reject`,t,n)}listCapabilities(e,t,n){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/capabilities`,t,n,{methodType:"list"})}retrieveCapability(e,t,n,i){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/capabilities/${encodeURIComponent(t)}`,n,i)}updateCapability(e,t,n,i){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/capabilities/${encodeURIComponent(t)}`,n,i)}deleteExternalAccount(e,t,n,i){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(e)}/external_accounts/${encodeURIComponent(t)}`,n,i)}retrieveExternalAccount(e,t,n,i){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/external_accounts/${encodeURIComponent(t)}`,n,i)}updateExternalAccount(e,t,n,i){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/external_accounts/${encodeURIComponent(t)}`,n,i)}listExternalAccounts(e,t,n){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/external_accounts`,t,n,{methodType:"list"})}createExternalAccount(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/external_accounts`,t,n)}createLoginLink(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/login_links`,t,n)}deletePerson(e,t,n,i){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i)}retrievePerson(e,t,n,i){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i)}updatePerson(e,t,n,i){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i)}listPersons(e,t,n){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/persons`,t,n,{methodType:"list"})}createPerson(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/persons`,t,n)}}});var en;var ls=f(()=>{b();en=class en extends d{create(e,t){return this._makeRequest("POST","/v1/account_links",e,t)}}});var tn;var cs=f(()=>{b();tn=class tn extends d{create(e,t){return this._makeRequest("POST","/v1/account_sessions",e,t)}}});var nn;var ds=f(()=>{b();nn=class nn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/apple_pay/domains/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/apple_pay/domains/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/apple_pay/domains",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/apple_pay/domains",e,t)}}});var rn;var us=f(()=>{b();rn=class rn extends d{list(e,t){return this._makeRequest("GET","/v1/application_fees",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(e)}`,t,n)}retrieveRefund(e,t,n,i){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(e)}/refunds/${encodeURIComponent(t)}`,n,i)}updateRefund(e,t,n,i){return this._makeRequest("POST",`/v1/application_fees/${encodeURIComponent(e)}/refunds/${encodeURIComponent(t)}`,n,i)}listRefunds(e,t,n){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(e)}/refunds`,t,n,{methodType:"list"})}createRefund(e,t,n){return this._makeRequest("POST",`/v1/application_fees/${encodeURIComponent(e)}/refunds`,t,n)}}});var se;var ji=f(()=>{b();se=class se extends d{retrieve(e,t){return this._makeRequest("GET","/v1/balance",e,t)}}});var on;var ms=f(()=>{b();on=class on extends d{retrieve(e,t){return this._makeRequest("GET","/v1/balance_settings",e,t)}update(e,t){return this._makeRequest("POST","/v1/balance_settings",e,t)}}});var sn;var ps=f(()=>{b();sn=class sn extends d{list(e,t){return this._makeRequest("GET","/v1/balance_transactions",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/balance_transactions/${encodeURIComponent(e)}`,t,n)}}});var an;var fs=f(()=>{b();an=class an extends d{list(e,t){return this._makeRequest("GET","/v1/charges",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/charges",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/charges/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/charges/${encodeURIComponent(e)}`,t,n)}search(e,t){return this._makeRequest("GET","/v1/charges/search",e,t,{methodType:"search"})}capture(e,t,n){return this._makeRequest("POST",`/v1/charges/${encodeURIComponent(e)}/capture`,t,n)}}});var ln;var _s=f(()=>{b();ln=class ln extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/confirmation_tokens/${encodeURIComponent(e)}`,t,n)}}});var cn;var ks=f(()=>{b();cn=class cn extends d{list(e,t){return this._makeRequest("GET","/v1/country_specs",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/country_specs/${encodeURIComponent(e)}`,t,n)}}});var dn;var bs=f(()=>{b();dn=class dn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/coupons/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/coupons/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/coupons/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/coupons",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/coupons",e,t)}}});var un;var gs=f(()=>{b();un=class un extends d{list(e,t){return this._makeRequest("GET","/v1/credit_notes",e,t,{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(e,t){return this._makeRequest("POST","/v1/credit_notes",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/credit_notes/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/credit_notes/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/credit_notes/preview",e,t,{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(e,t,n){return this._makeRequest("POST",`/v1/credit_notes/${encodeURIComponent(e)}/void`,t,n,{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(e,t){return this._makeRequest("GET","/v1/credit_notes/preview/lines",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/credit_notes/${encodeURIComponent(e)}/lines`,t,n,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}})}}});var mn;var hs=f(()=>{b();mn=class mn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(e)}/discount`,t,n)}list(e,t){return this._makeRequest("GET","/v1/customers",e,t,{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(e,t){return this._makeRequest("POST","/v1/customers",e,t,{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(e,t){return this._makeRequest("GET","/v1/customers/search",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/balance_transactions`,t,n,{methodType:"list"})}createBalanceTransaction(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/balance_transactions`,t,n)}retrieveBalanceTransaction(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/balance_transactions/${encodeURIComponent(t)}`,n,i)}updateBalanceTransaction(e,t,n,i){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/balance_transactions/${encodeURIComponent(t)}`,n,i)}retrieveCashBalance(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/cash_balance`,t,n)}updateCashBalance(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/cash_balance`,t,n)}listCashBalanceTransactions(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/cash_balance_transactions`,t,n,{methodType:"list"})}retrieveCashBalanceTransaction(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/cash_balance_transactions/${encodeURIComponent(t)}`,n,i)}createFundingInstructions(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/funding_instructions`,t,n)}listPaymentMethods(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/payment_methods`,t,n,{methodType:"list"})}retrievePaymentMethod(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/payment_methods/${encodeURIComponent(t)}`,n,i)}listSources(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/sources`,t,n,{methodType:"list"})}createSource(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/sources`,t,n)}retrieveSource(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/sources/${encodeURIComponent(t)}`,n,i)}updateSource(e,t,n,i){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/sources/${encodeURIComponent(t)}`,n,i)}deleteSource(e,t,n,i){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(e)}/sources/${encodeURIComponent(t)}`,n,i)}verifySource(e,t,n,i){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/sources/${encodeURIComponent(t)}/verify`,n,i)}deleteTaxId(e,t,n,i){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(e)}/tax_ids/${encodeURIComponent(t)}`,n,i)}retrieveTaxId(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/tax_ids/${encodeURIComponent(t)}`,n,i)}listTaxIds(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/tax_ids`,t,n,{methodType:"list"})}createTaxId(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/tax_ids`,t,n)}}});var pn;var ys=f(()=>{b();pn=class pn extends d{create(e,t){return this._makeRequest("POST","/v1/customer_sessions",e,t)}}});var fn;var Rs=f(()=>{b();fn=class fn extends d{list(e,t){return this._makeRequest("GET","/v1/disputes",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/disputes/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/disputes/${encodeURIComponent(e)}`,t,n)}close(e,t,n){return this._makeRequest("POST",`/v1/disputes/${encodeURIComponent(e)}/close`,t,n)}}});var _n;var Ts=f(()=>{b();_n=class _n extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/ephemeral_keys/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/ephemeral_keys",e,t,{validator:(n,i)=>{if(!i.headers||!i.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 kn;var ws=f(()=>{b();kn=class kn extends d{list(e,t){return this._makeRequest("GET","/v1/events",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/events/${encodeURIComponent(e)}`,t,n)}}});var bn;var vs=f(()=>{b();bn=class bn extends d{list(e,t){return this._makeRequest("GET","/v1/exchange_rates",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/exchange_rates/${encodeURIComponent(e)}`,t,n)}}});function Al(e,t,n,i){if(t=t||{},e!=="POST")return i(null,z(t));this._stripe._platformFunctions.tryBufferData(t).then((r)=>{let o=Zd(e,r,n);return i(null,o)}).catch((r)=>i(r,null))}var Zd=(e,t,n)=>{let i=(Math.round(Math.random()*10000000000000000)+Math.round(Math.random()*10000000000000000)).toString();n["Content-Type"]=`multipart/form-data; boundary=${i}`;let r=new TextEncoder,o=new Uint8Array(0),s=r.encode(`\r
15
- `);function a(u){let m=o,p=u instanceof Uint8Array?u:new Uint8Array(r.encode(u));o=new Uint8Array(m.length+p.length+2),o.set(m),o.set(p,m.length),o.set(s,o.length-2)}function c(u){return`"${u.replace(/"|"/g,"%22").replace(/\r\n|\r|\n/g," ")}"`}let l=ml(t);for(let u in l){if(!Object.prototype.hasOwnProperty.call(l,u))continue;let m=l[u];if(a(`--${i}`),Object.prototype.hasOwnProperty.call(m,"data")){let p=m;a(`Content-Disposition: form-data; name=${c(u)}; filename=${c(p.name||"blob")}`),a(`Content-Type: ${p.type||"application/octet-stream"}`),a(""),a(p.data)}else a(`Content-Disposition: form-data; name=${c(u)}`),a(""),a(m)}return a(`--${i}--`),o};var Il=f(()=>{W()});var gn;var Ss=f(()=>{Il();b();gn=class gn extends d{constructor(){super(...arguments);this.requestDataProcessor=Al}list(e,t){return this._makeRequest("GET","/v1/files",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/files",e,t,{headers:{"Content-Type":"multipart/form-data"},apiBase:"files"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/files/${encodeURIComponent(e)}`,t,n)}}});var hn;var xs=f(()=>{b();hn=class hn extends d{list(e,t){return this._makeRequest("GET","/v1/file_links",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/file_links",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/file_links/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/file_links/${encodeURIComponent(e)}`,t,n)}}});var yn;var Cs=f(()=>{b();yn=class yn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/invoices/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/invoices/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/invoices",e,t,{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(e,t){return this._makeRequest("POST","/v1/invoices",e,t,{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(e,t){return this._makeRequest("GET","/v1/invoices/search",e,t,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/add_lines`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/attach_payment`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/finalize`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/mark_uncollectible`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/pay`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/remove_lines`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/send`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/update_lines`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/void`,t,n,{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(e,t){return this._makeRequest("POST","/v1/invoices/create_preview",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/invoices/${encodeURIComponent(e)}/lines`,t,n,{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(e,t,n,i){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/lines/${encodeURIComponent(t)}`,n,i,{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 Rn;var js=f(()=>{b();Rn=class Rn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/invoiceitems/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/invoiceitems/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoiceitems/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/invoiceitems",e,t,{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(e,t){return this._makeRequest("POST","/v1/invoiceitems",e,t,{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 Tn;var Ps=f(()=>{b();Tn=class Tn extends d{list(e,t){return this._makeRequest("GET","/v1/invoice_payments",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/invoice_payments/${encodeURIComponent(e)}`,t,n)}}});var wn;var Es=f(()=>{b();wn=class wn extends d{list(e,t){return this._makeRequest("GET","/v1/invoice_rendering_templates",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/invoice_rendering_templates/${encodeURIComponent(e)}`,t,n)}archive(e,t,n){return this._makeRequest("POST",`/v1/invoice_rendering_templates/${encodeURIComponent(e)}/archive`,t,n)}unarchive(e,t,n){return this._makeRequest("POST",`/v1/invoice_rendering_templates/${encodeURIComponent(e)}/unarchive`,t,n)}}});var vn;var qs=f(()=>{b();vn=class vn extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/mandates/${encodeURIComponent(e)}`,t,n)}}});var Sn;var $l=f(()=>{b();W();Sn=class Sn extends d{constructor(){super(...arguments);this.basePath=be("/")}authorizeUrl(e,t){e=e||{},t=t||{};let n="oauth/authorize";if(t.express)n=`express/${n}`;if(!e.response_type)e.response_type="code";if(!e.client_id)e.client_id=this._stripe.getClientId();if(!e.scope)e.scope="read_write";return`https://${this._stripe.resolveBaseAddress("connect")}/${n}?${z(e)}`}token(e,t){return this._makeRequest("POST","/oauth/token",e,t,{apiBase:"connect"})}deauthorize(e,t){if(!e.client_id)e.client_id=this._stripe.getClientId();return this._makeRequest("POST","/oauth/deauthorize",e,t,{apiBase:"connect"})}}});var xn;var Os=f(()=>{b();xn=class xn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_attempt_records",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_attempt_records/${encodeURIComponent(e)}`,t,n)}}});var Cn;var As=f(()=>{b();Cn=class Cn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_intents",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payment_intents",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_intents/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}`,t,n)}search(e,t){return this._makeRequest("GET","/v1/payment_intents/search",e,t,{methodType:"search"})}applyCustomerBalance(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/apply_customer_balance`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/cancel`,t,n)}capture(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/capture`,t,n)}confirm(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/confirm`,t,n)}incrementAuthorization(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/increment_authorization`,t,n)}verifyMicrodeposits(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/verify_microdeposits`,t,n)}listAmountDetailsLineItems(e,t,n){return this._makeRequest("GET",`/v1/payment_intents/${encodeURIComponent(e)}/amount_details_line_items`,t,n,{methodType:"list"})}}});var jn;var Is=f(()=>{b();jn=class jn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_links",e,t,{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(e,t){return this._makeRequest("POST","/v1/payment_links",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/payment_links/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/payment_links/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/payment_links/${encodeURIComponent(e)}/line_items`,t,n,{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 Pn;var $s=f(()=>{b();Pn=class Pn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_methods",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payment_methods",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_methods/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(e)}`,t,n)}attach(e,t,n){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(e)}/attach`,t,n)}detach(e,t,n){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(e)}/detach`,t,n)}}});var En;var Us=f(()=>{b();En=class En extends d{list(e,t){return this._makeRequest("GET","/v1/payment_method_configurations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payment_method_configurations",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_method_configurations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payment_method_configurations/${encodeURIComponent(e)}`,t,n)}}});var qn;var Ms=f(()=>{b();qn=class qn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_method_domains",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payment_method_domains",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_method_domains/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payment_method_domains/${encodeURIComponent(e)}`,t,n)}validate(e,t,n){return this._makeRequest("POST",`/v1/payment_method_domains/${encodeURIComponent(e)}/validate`,t,n)}}});var On;var Ds=f(()=>{b();On=class On extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_records/${encodeURIComponent(e)}`,t,n)}reportPaymentAttempt(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt`,t,n)}reportPaymentAttemptCanceled(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt_canceled`,t,n)}reportPaymentAttemptFailed(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt_failed`,t,n)}reportPaymentAttemptGuaranteed(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt_guaranteed`,t,n)}reportPaymentAttemptInformational(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt_informational`,t,n)}reportRefund(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_refund`,t,n)}reportPayment(e,t){return this._makeRequest("POST","/v1/payment_records/report_payment",e,t)}}});var An;var Fs=f(()=>{b();An=class An extends d{list(e,t){return this._makeRequest("GET","/v1/payouts",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payouts",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payouts/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(e)}/cancel`,t,n)}reverse(e,t,n){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(e)}/reverse`,t,n)}}});var In;var Ns=f(()=>{b();In=class In extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/plans/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/plans/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/plans/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/plans",e,t,{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(e,t){return this._makeRequest("POST","/v1/plans",e,t,{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 $n;var Gs=f(()=>{b();$n=class $n extends d{list(e,t){return this._makeRequest("GET","/v1/prices",e,t,{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(e,t){return this._makeRequest("POST","/v1/prices",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/prices/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/prices/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/prices/search",e,t,{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 Un;var Bs=f(()=>{b();Un=class Un extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/products/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/products/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/products",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/products",e,t,{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(e,t){return this._makeRequest("GET","/v1/products/search",e,t,{methodType:"search"})}deleteFeature(e,t,n,i){return this._makeRequest("DELETE",`/v1/products/${encodeURIComponent(e)}/features/${encodeURIComponent(t)}`,n,i)}retrieveFeature(e,t,n,i){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(e)}/features/${encodeURIComponent(t)}`,n,i)}listFeatures(e,t,n){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(e)}/features`,t,n,{methodType:"list"})}createFeature(e,t,n){return this._makeRequest("POST",`/v1/products/${encodeURIComponent(e)}/features`,t,n)}}});var Mn;var Ls=f(()=>{b();Mn=class Mn extends d{list(e,t){return this._makeRequest("GET","/v1/promotion_codes",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/promotion_codes",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/promotion_codes/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/promotion_codes/${encodeURIComponent(e)}`,t,n)}}});var Dn;var Ks=f(()=>{b();Dn=class Dn extends d{list(e,t){return this._makeRequest("GET","/v1/quotes",e,t,{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(e,t){return this._makeRequest("POST","/v1/quotes",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(e)}/accept`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(e)}/cancel`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(e)}/finalize`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(e)}/pdf`,t,n,{apiBase:"files",streaming:!0})}listComputedUpfrontLineItems(e,t,n){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(e)}/computed_upfront_line_items`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(e)}/line_items`,t,n,{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 Fn;var Hs=f(()=>{b();Fn=class Fn extends d{list(e,t){return this._makeRequest("GET","/v1/refunds",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/refunds",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/refunds/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/refunds/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/refunds/${encodeURIComponent(e)}/cancel`,t,n)}}});var Nn;var Vs=f(()=>{b();Nn=class Nn extends d{list(e,t){return this._makeRequest("GET","/v1/reviews",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/reviews/${encodeURIComponent(e)}`,t,n)}approve(e,t,n){return this._makeRequest("POST",`/v1/reviews/${encodeURIComponent(e)}/approve`,t,n)}}});var Gn;var zs=f(()=>{b();Gn=class Gn extends d{list(e,t){return this._makeRequest("GET","/v1/setup_attempts",e,t,{methodType:"list"})}}});var Bn;var Ws=f(()=>{b();Bn=class Bn extends d{list(e,t){return this._makeRequest("GET","/v1/setup_intents",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/setup_intents",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/setup_intents/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(e)}/cancel`,t,n)}confirm(e,t,n){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(e)}/confirm`,t,n)}verifyMicrodeposits(e,t,n){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(e)}/verify_microdeposits`,t,n)}}});var Ln;var Qs=f(()=>{b();Ln=class Ln extends d{list(e,t){return this._makeRequest("GET","/v1/shipping_rates",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/shipping_rates",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/shipping_rates/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/shipping_rates/${encodeURIComponent(e)}`,t,n)}}});var Kn;var Js=f(()=>{b();Kn=class Kn extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/sources/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/sources/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/sources",e,t)}verify(e,t,n){return this._makeRequest("POST",`/v1/sources/${encodeURIComponent(e)}/verify`,t,n)}listSourceTransactions(e,t,n){return this._makeRequest("GET",`/v1/sources/${encodeURIComponent(e)}/source_transactions`,t,n,{methodType:"list"})}}});var Hn;var Xs=f(()=>{b();Hn=class Hn extends d{cancel(e,t,n){return this._makeRequest("DELETE",`/v1/subscriptions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/subscriptions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("DELETE",`/v1/subscriptions/${encodeURIComponent(e)}/discount`,t,n)}list(e,t){return this._makeRequest("GET","/v1/subscriptions",e,t,{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(e,t){return this._makeRequest("POST","/v1/subscriptions",e,t,{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(e,t){return this._makeRequest("GET","/v1/subscriptions/search",e,t,{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(e,t,n){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(e)}/migrate`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(e)}/resume`,t,n,{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 Vn;var Ys=f(()=>{b();Vn=class Vn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/subscription_items/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/subscription_items/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/subscription_items/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/subscription_items",e,t,{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(e,t){return this._makeRequest("POST","/v1/subscription_items",e,t,{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 zn;var Zs=f(()=>{b();zn=class zn extends d{list(e,t){return this._makeRequest("GET","/v1/subscription_schedules",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/subscription_schedules",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/subscription_schedules/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(e)}/cancel`,t,n)}release(e,t,n){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(e)}/release`,t,n)}}});var Wn;var ea=f(()=>{b();Wn=class Wn extends d{list(e,t){return this._makeRequest("GET","/v1/tax_codes",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax_codes/${encodeURIComponent(e)}`,t,n)}}});var Qn;var ta=f(()=>{b();Qn=class Qn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/tax_ids/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax_ids/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/tax_ids",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/tax_ids",e,t)}}});var Jn;var na=f(()=>{b();Jn=class Jn extends d{list(e,t){return this._makeRequest("GET","/v1/tax_rates",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/tax_rates",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax_rates/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/tax_rates/${encodeURIComponent(e)}`,t,n)}}});var Xn;var ia=f(()=>{b();Xn=class Xn extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/tokens/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/tokens",e,t)}}});var Yn;var ra=f(()=>{b();Yn=class Yn extends d{list(e,t){return this._makeRequest("GET","/v1/topups",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/topups",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/topups/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/topups/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/topups/${encodeURIComponent(e)}/cancel`,t,n)}}});var Zn;var oa=f(()=>{b();Zn=class Zn extends d{list(e,t){return this._makeRequest("GET","/v1/transfers",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/transfers",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(e)}`,t,n)}listReversals(e,t,n){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(e)}/reversals`,t,n,{methodType:"list"})}createReversal(e,t,n){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(e)}/reversals`,t,n)}retrieveReversal(e,t,n,i){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(e)}/reversals/${encodeURIComponent(t)}`,n,i)}updateReversal(e,t,n,i){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(e)}/reversals/${encodeURIComponent(t)}`,n,i)}}});var ei;var sa=f(()=>{b();ei=class ei extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/webhook_endpoints/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/webhook_endpoints/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/webhook_endpoints/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/webhook_endpoints",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/webhook_endpoints",e,t)}}});var ae={};Oi(ae,{Account:()=>oe,AccountLinks:()=>en,AccountSessions:()=>tn,Accounts:()=>oe,ApplePayDomains:()=>nn,ApplicationFees:()=>rn,Apps:()=>eu,Balance:()=>se,BalanceSettings:()=>on,BalanceTransactions:()=>sn,Balances:()=>se,Billing:()=>tu,BillingPortal:()=>nu,Charges:()=>an,Checkout:()=>iu,Climate:()=>ru,ConfirmationTokens:()=>ln,CountrySpecs:()=>cn,Coupons:()=>dn,CreditNotes:()=>un,CustomerSessions:()=>pn,Customers:()=>mn,Disputes:()=>fn,Entitlements:()=>ou,EphemeralKeys:()=>_n,Events:()=>kn,ExchangeRates:()=>bn,FileLinks:()=>hn,Files:()=>gn,FinancialConnections:()=>su,Forwarding:()=>au,Identity:()=>lu,InvoiceItems:()=>Rn,InvoicePayments:()=>Tn,InvoiceRenderingTemplates:()=>wn,Invoices:()=>yn,Issuing:()=>cu,Mandates:()=>vn,OAuthResource:()=>Sn,PaymentAttemptRecords:()=>xn,PaymentIntents:()=>Cn,PaymentLinks:()=>jn,PaymentMethodConfigurations:()=>En,PaymentMethodDomains:()=>qn,PaymentMethods:()=>Pn,PaymentRecords:()=>On,Payouts:()=>An,Plans:()=>In,Prices:()=>$n,Products:()=>Un,PromotionCodes:()=>Mn,Quotes:()=>Dn,Radar:()=>du,Refunds:()=>Fn,Reporting:()=>uu,Reviews:()=>Nn,SetupAttempts:()=>Gn,SetupIntents:()=>Bn,ShippingRates:()=>Ln,Sigma:()=>mu,Sources:()=>Kn,SubscriptionItems:()=>Vn,SubscriptionSchedules:()=>zn,Subscriptions:()=>Hn,Tax:()=>pu,TaxCodes:()=>Wn,TaxIds:()=>Qn,TaxRates:()=>Jn,Terminal:()=>fu,TestHelpers:()=>_u,Tokens:()=>Xn,Topups:()=>Yn,Transfers:()=>Zn,Treasury:()=>ku,V2:()=>bu,WebhookEndpoints:()=>ei});var eu,tu,nu,iu,ru,ou,su,au,lu,cu,du,uu,mu,pu,fu,_u,ku,bu;var aa=f(()=>{Or();Ar();Ir();Mr();Dr();Fr();Nr();Gr();Br();Lr();Kr();Hr();Vr();zr();Wr();Qr();Jr();Xr();Yr();Zr();eo();to();no();io();ro();oo();so();ao();lo();co();uo();mo();po();fo();_o();ko();bo();go();ho();yo();Ro();To();wo();vo();So();xo();Co();jo();Po();Eo();qo();Oo();Ao();Io();$o();Uo();Mo();Do();Fo();No();Go();Bo();Lo();Ko();Ho();Vo();zo();Wo();Qo();Jo();Xo();Yo();Zo();es();ts();ns();is();rs();os();ss();as();Ci();Ci();ls();cs();ds();us();ji();ji();ms();ps();fs();_s();ks();bs();gs();hs();ys();Rs();Ts();ws();vs();Ss();xs();Cs();js();Ps();Es();qs();$l();Os();As();Is();$s();Us();Ms();Ds();Fs();Ns();Gs();Bs();Ls();Ks();Hs();Vs();zs();Ws();Qs();Js();Xs();Ys();Zs();ea();ta();na();ia();ra();oa();sa();eu=S("apps",{Secrets:Ut}),tu=S("billing",{Alerts:Oe,CreditBalanceSummary:Ke,CreditBalanceTransactions:He,CreditGrants:Ve,MeterEventAdjustments:st,MeterEvents:dt,Meters:mt}),nu=S("billingPortal",{Configurations:Ne,Sessions:Mt}),iu=S("checkout",{Sessions:Dt}),ru=S("climate",{Orders:ft,Products:wt,Suppliers:Gt}),ou=S("entitlements",{ActiveEntitlements:qe,Features:et}),su=S("financialConnections",{Accounts:Pe,Sessions:Ft,Transactions:Ht}),au=S("forwarding",{Requests:It}),lu=S("identity",{VerificationReports:Yt,VerificationSessions:Zt}),cu=S("issuing",{Authorizations:Ie,Cardholders:Me,Cards:De,Disputes:Je,PersonalizationDesigns:yt,PhysicalBundles:Tt,Tokens:Lt,Transactions:Vt}),du=S("radar",{EarlyFraudWarnings:Xe,PaymentEvaluations:ht,ValueListItems:Jt,ValueLists:Xt}),uu=S("reporting",{ReportRuns:Ot,ReportTypes:At}),mu=S("sigma",{ScheduledQueryRuns:$t}),pu=S("tax",{Associations:Ae,Calculations:Ue,Registrations:qt,Settings:Nt,Transactions:zt}),fu=S("terminal",{Configurations:Ge,ConnectionTokens:Le,Locations:ot,OnboardingLinks:pt,Readers:vt}),_u=S("testHelpers",{ConfirmationTokens:Be,Customers:We,Refunds:Et,TestClocks:Bt,Issuing:S("issuing",{Authorizations:$e,Cards:Fe,PersonalizationDesigns:Rt,Transactions:Wt}),Terminal:S("terminal",{Readers:St}),Treasury:S("treasury",{InboundTransfers:it,OutboundPayments:_t,OutboundTransfers:bt,ReceivedCredits:xt,ReceivedDebits:jt})}),ku=S("treasury",{CreditReversals:ze,DebitReversals:Qe,FinancialAccounts:tt,InboundTransfers:rt,OutboundPayments:kt,OutboundTransfers:gt,ReceivedCredits:Ct,ReceivedDebits:Pt,TransactionEntries:Kt,Transactions:Qt}),bu=S("v2",{Billing:S("billing",{MeterEventAdjustments:at,MeterEventSession:lt,MeterEventStream:ct,MeterEvents:ut}),Commerce:S("commerce",{ProductCatalog:S("productCatalog",{Imports:nt})}),Core:S("core",{AccountLinks:Ce,AccountTokens:je,Accounts:Ee,EventDestinations:Ye,Events:Ze})})});var Ul=f(()=>{Ri()});class la{constructor(e){this.stripe=e,this.secrets=new Ut(e)}}var Ml=f(()=>{Ko()});class ca{constructor(e){this.stripe=e,this.alerts=new Oe(e),this.creditBalanceSummaries=new Ke(e),this.creditBalanceTransactions=new He(e),this.creditGrants=new Ve(e),this.meters=new mt(e),this.meterEvents=new dt(e),this.meterEventAdjustments=new st(e)}}var Dl=f(()=>{Fr();Xr();Yr();Zr();yo();go();fo()});class da{constructor(e){this.stripe=e,this.configurations=new Ne(e),this.sessions=new Mt(e)}}var Fl=f(()=>{zr();Ho()});class ua{constructor(e){this.stripe=e,this.sessions=new Dt(e)}}var Nl=f(()=>{Vo()});class ma{constructor(e){this.stripe=e,this.orders=new ft(e),this.products=new wt(e),this.suppliers=new Gt(e)}}var Gl=f(()=>{To();qo();Qo()});class pa{constructor(e){this.stripe=e,this.activeEntitlements=new qe(e),this.features=new et(e)}}var Bl=f(()=>{Dr();ao()});class fa{constructor(e){this.stripe=e,this.accounts=new Pe(e),this.sessions=new Ft(e),this.transactions=new Ht(e)}}var Ll=f(()=>{Ir();zo();Zo()});class _a{constructor(e){this.stripe=e,this.requests=new It(e)}}var Kl=f(()=>{Bo()});class ka{constructor(e){this.stripe=e,this.verificationReports=new Yt(e),this.verificationSessions=new Zt(e)}}var Hl=f(()=>{ss();as()});class ba{constructor(e){this.stripe=e,this.authorizations=new Ie(e),this.cards=new De(e),this.cardholders=new Me(e),this.disputes=new Je(e),this.personalizationDesigns=new yt(e),this.physicalBundles=new Tt(e),this.tokens=new Lt(e),this.transactions=new Vt(e)}}var Vl=f(()=>{Gr();Hr();Kr();io();jo();Eo();Xo();es()});class ga{constructor(e){this.stripe=e,this.earlyFraudWarnings=new Xe(e),this.paymentEvaluations=new ht(e),this.valueLists=new Xt(e),this.valueListItems=new Jt(e)}}var zl=f(()=>{ro();Co();os();rs()});class ha{constructor(e){this.stripe=e,this.reportRuns=new Ot(e),this.reportTypes=new At(e)}}var Wl=f(()=>{No();Go()});class ya{constructor(e){this.stripe=e,this.scheduledQueryRuns=new $t(e)}}var Ql=f(()=>{Lo()});class Ra{constructor(e){this.stripe=e,this.associations=new Ae(e),this.calculations=new Ue(e),this.registrations=new qt(e),this.settings=new Nt(e),this.transactions=new zt(e)}}var Jl=f(()=>{Nr();Lr();Fo();Wo();ts()});class Ta{constructor(e){this.stripe=e,this.configurations=new Ge(e),this.connectionTokens=new Le(e),this.locations=new ot(e),this.onboardingLinks=new pt(e),this.readers=new vt(e)}}var Xl=f(()=>{Wr();Jr();po();Ro();Oo()});class wa{constructor(e){this.stripe=e,this.authorizations=new $e(e),this.cards=new Fe(e),this.personalizationDesigns=new Rt(e),this.transactions=new Wt(e)}}var Yl=f(()=>{Br();Vr();Po();ns()});class va{constructor(e){this.stripe=e,this.readers=new St(e)}}var Zl=f(()=>{Ao()});class Sa{constructor(e){this.stripe=e,this.inboundTransfers=new it(e),this.outboundPayments=new _t(e),this.outboundTransfers=new bt(e),this.receivedCredits=new xt(e),this.receivedDebits=new jt(e)}}var ec=f(()=>{uo();wo();So();Io();Uo()});class xa{constructor(e){this.stripe=e,this.confirmationTokens=new Be(e),this.customers=new We(e),this.refunds=new Et(e),this.testClocks=new Bt(e),this.issuing=new wa(e),this.terminal=new va(e),this.treasury=new Sa(e)}}var tc=f(()=>{Qr();to();Do();Jo();Yl();Zl();ec()});class Ca{constructor(e){this.stripe=e,this.creditReversals=new ze(e),this.debitReversals=new Qe(e),this.financialAccounts=new tt(e),this.inboundTransfers=new rt(e),this.outboundPayments=new kt(e),this.outboundTransfers=new gt(e),this.receivedCredits=new Ct(e),this.receivedDebits=new Pt(e),this.transactions=new Qt(e),this.transactionEntries=new Kt(e)}}var nc=f(()=>{eo();no();lo();mo();vo();xo();$o();Mo();is();Yo()});class ja{constructor(e){this.stripe=e,this.meterEvents=new ut(e),this.meterEventAdjustments=new at(e),this.meterEventSession=new lt(e),this.meterEventStream=new ct(e)}}var ic=f(()=>{ho();_o();ko();bo()});class Pa{constructor(e){this.stripe=e,this.imports=new nt(e)}}var rc=f(()=>{co()});class Ea{constructor(e){this.stripe=e,this.productCatalog=new Pa(e)}}var oc=f(()=>{rc()});class qa{constructor(e){this.stripe=e,this.accounts=new Ee(e),this.accountLinks=new Ce(e),this.accountTokens=new je(e),this.events=new Ze(e),this.eventDestinations=new Ye(e)}}var sc=f(()=>{Mr();Or();Ar();so();oo()});class Oa{constructor(e){this.stripe=e,this.billing=new ja(e),this.commerce=new Ea(e),this.core=new qa(e)}}var ac=f(()=>{ic();oc();sc()});class w{static initialize(e,t=_c){w._platformFunctions=e,w._requestSenderFactory=t,w.webhooks=Pl(e),w.createNodeHttpClient=e.createNodeHttpClient,w.createFetchHttpClient=e.createFetchHttpClient,w.createNodeCryptoProvider=e.createNodeCryptoProvider,w.createSubtleCryptoProvider=e.createSubtleCryptoProvider;let n=e.getEnv(),i=e.getRuntimeVersion();w.aiAgent=n?pl(n):"",w.AI_AGENT=w.aiAgent,w.USER_AGENT={bindings_version:w.PACKAGE_VERSION,lang:"node",typescript:!1,...i?{lang_version:i}:{},...w.aiAgent?{ai_agent:w.aiAgent}:{}}}constructor(e,t={}){this._authenticator=null;let n=this._getPropsFromConfig(t);this._platformFunctions=w._platformFunctions,Object.defineProperty(this,"_emitter",{value:this._platformFunctions.createEmitter(),enumerable:!1,configurable:!1,writable:!1}),this.VERSION=w.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 i=n.httpAgent||null;this._api={host:n.host||Aa,port:n.port||lc,protocol:n.protocol||"https",basePath:cc,version:n.apiVersion||dc,timeout:ki("timeout",n.timeout,uc),maxNetworkRetries:ki("maxNetworkRetries",n.maxNetworkRetries,2),agent:i,httpClient:n.httpClient||(i?this._platformFunctions.createNodeHttpClient(i):this._platformFunctions.createDefaultHttpClient()),dev:!1,stripeAccount:n.stripeAccount||null,stripeContext:n.stripeContext||null};let r=n.typescript||!1;if(r!==w.USER_AGENT.typescript)w.USER_AGENT.typescript=r;if(n.appInfo)this._setAppInfo(n.appInfo);this._setAuthenticator(e,n.authenticator||null),this.errors=Si,this.Decimal=M,this.webhooks=w.webhooks,this._prevRequestMetrics=[],this._enableTelemetry=n.telemetry!==!1,this._emitEventBodies=n.emitEventBodies===!0,this._requestSender=w._requestSenderFactory(this),this.accountLinks=new en(this),this.accountSessions=new tn(this),this.accounts=new oe(this),this.applePayDomains=new nn(this),this.applicationFees=new rn(this),this.balance=new se(this),this.balanceSettings=new on(this),this.balanceTransactions=new sn(this),this.charges=new an(this),this.confirmationTokens=new ln(this),this.countrySpecs=new cn(this),this.coupons=new dn(this),this.creditNotes=new un(this),this.customerSessions=new pn(this),this.customers=new mn(this),this.disputes=new fn(this),this.ephemeralKeys=new _n(this),this.events=new kn(this),this.exchangeRates=new bn(this),this.fileLinks=new hn(this),this.files=new gn(this),this.invoiceItems=new Rn(this),this.invoicePayments=new Tn(this),this.invoiceRenderingTemplates=new wn(this),this.invoices=new yn(this),this.mandates=new vn(this),this.paymentAttemptRecords=new xn(this),this.paymentIntents=new Cn(this),this.paymentLinks=new jn(this),this.paymentMethodConfigurations=new En(this),this.paymentMethodDomains=new qn(this),this.paymentMethods=new Pn(this),this.paymentRecords=new On(this),this.payouts=new An(this),this.plans=new In(this),this.prices=new $n(this),this.products=new Un(this),this.promotionCodes=new Mn(this),this.quotes=new Dn(this),this.refunds=new Fn(this),this.reviews=new Nn(this),this.setupAttempts=new Gn(this),this.setupIntents=new Bn(this),this.shippingRates=new Ln(this),this.sources=new Kn(this),this.subscriptionItems=new Vn(this),this.subscriptionSchedules=new zn(this),this.subscriptions=new Hn(this),this.taxCodes=new Wn(this),this.taxIds=new Qn(this),this.taxRates=new Jn(this),this.tokens=new Xn(this),this.topups=new Yn(this),this.transfers=new Zn(this),this.webhookEndpoints=new ei(this),this.apps=new la(this),this.billing=new ca(this),this.billingPortal=new da(this),this.checkout=new ua(this),this.climate=new ma(this),this.entitlements=new pa(this),this.financialConnections=new fa(this),this.forwarding=new _a(this),this.identity=new ka(this),this.issuing=new ba(this),this.radar=new ga(this),this.reporting=new ha(this),this.sigma=new ya(this),this.tax=new Ra(this),this.terminal=new Ta(this),this.testHelpers=new xa(this),this.treasury=new Ca(this),this.v2=new Oa(this),this.account=this.accounts,this.oauth=new Sn(this)}rawRequest(e,t,n,i){return this._requestSender._rawRequest(e,t,n,i)}_setAuthenticator(e,t){if(e&&t)throw Error("Can't specify both apiKey and authenticator");if(!e&&!t)throw Error("Neither apiKey nor config.authenticator provided");this._authenticator=e?lr(e):t}_setAppInfo(e){if(e&&typeof e!=="object")throw Error("AppInfo must be an object.");if(e&&!e.name)throw Error("AppInfo.name is required");e=e||{},this._appInfo=gu.reduce((t,n)=>{if(typeof e[n]=="string")t=t||{},t[n]=e[n];return t},{})}setClientId(e){this._clientId=e}getClientId(){return this._clientId}getConstant(e){switch(e){case"DEFAULT_HOST":return Aa;case"DEFAULT_PORT":return lc;case"DEFAULT_BASE_PATH":return cc;case"DEFAULT_API_VERSION":return dc;case"DEFAULT_TIMEOUT":return uc;case"MAX_NETWORK_RETRY_DELAY_SEC":return mc;case"INITIAL_NETWORK_RETRY_DELAY_SEC":return pc}return w[e]}resolveBaseAddress(e){let t=this.getApiField("host");if(t!==Aa)return t;return sr[e]}getMaxNetworkRetries(){return this.getApiField("maxNetworkRetries")}_setApiNumberField(e,t,n){let i=ki(e,t,n);this._setApiField(e,i)}getMaxNetworkRetryDelay(){return mc}getInitialNetworkRetryDelay(){return pc}getClientUserAgent(e){return this.getClientUserAgentSeeded(w.USER_AGENT,e)}getClientUserAgentSeeded(e,t){let n={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;n[o]=encodeURIComponent(e[o]??"null")}let i=this._platformFunctions.getPlatformInfo();if(i&&this.getTelemetryEnabled())n.platform=encodeURIComponent(i);else delete n.platform;let r=this.getApiField("httpClient");if(r)n.httplib=encodeURIComponent(r.getClientName());if(this._appInfo)n.application=this._appInfo;if(this.getTelemetryEnabled()){let o=this._platformFunctions.getTelemetryId();if(o)n.telemetry_id=o}t(JSON.stringify(n))}getAppInfoAsString(){if(!this._appInfo)return"";let e=this._appInfo.name;if(this._appInfo.version)e+=`/${this._appInfo.version}`;if(this._appInfo.url)e+=` (${this._appInfo.url})`;return e}getTelemetryEnabled(){return this._enableTelemetry}getEmitEventBodiesEnabled(){return this._emitEventBodies}_prepResources(){for(let e in ae){if(!Object.prototype.hasOwnProperty.call(ae,e))continue;this[ul(e.replace("Resource",""))]=new ae[e](this)}}_getPropsFromConfig(e){if(!e)return{};let t=typeof e==="string";if(!(e===Object(e)&&!Array.isArray(e))&&!t)throw Error("Config must either be an object or a string");if(t)return{apiVersion:e};if(Object.keys(e).filter((r)=>!fc.includes(r)).length>0)throw Error(`Config object may only contain the following: ${fc.join(", ")}`);return e}_setApiField(e,t){this._api[e]=t}getApiField(e){return this._api[e]}parseEventNotification(e,t,n,i,r,o){if(!this.webhooks.signature)throw Error("ERR: missing signature helper, unable to verify");this.webhooks.signature.verifyHeader(e,t,n,i||this.webhooks.DEFAULT_TOLERANCE,r||this._platformFunctions.createDefaultCryptoProvider(),o);let s=e instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(e)):JSON.parse(e);if(s&&s.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotification, which expects an event notification. Use stripe.webhooks.constructEvent instead.");if(s.context)s.context=K.parse(s.context);return s.fetchEvent=()=>this._requestSender._rawRequest("GET",`/v2/core/events/${s.id}`,void 0,{stripeContext:s.context,headers:{"Stripe-Request-Trigger":`event=${s.id}`}},["fetch_event"]),s.fetchRelatedObject=()=>{if(!s.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",s.related_object.url,void 0,{stripeContext:s.context,headers:{"Stripe-Request-Trigger":`event=${s.id}`}},["fetch_related_object"])},s}async parseEventNotificationAsync(e,t,n,i,r,o){if(!this.webhooks.signature)throw Error("ERR: missing signature helper, unable to verify");await this.webhooks.signature.verifyHeaderAsync(e,t,n,i||this.webhooks.DEFAULT_TOLERANCE,r||this._platformFunctions.createDefaultCryptoProvider(),o);let s=e instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(e)):JSON.parse(e);if(s&&s.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotificationAsync, which expects an event notification. Use stripe.webhooks.constructEventAsync instead.");if(s.context)s.context=K.parse(s.context);return s.fetchEvent=()=>this._requestSender._rawRequest("GET",`/v2/core/events/${s.id}`,void 0,{stripeContext:s.context,headers:{"Stripe-Request-Trigger":`event=${s.id}`}},["fetch_event"]),s.fetchRelatedObject=()=>{if(!s.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",s.related_object.url,void 0,{stripeContext:s.context,headers:{"Stripe-Request-Trigger":`event=${s.id}`}},["fetch_related_object"])},s}}var Aa="api.stripe.com",lc="443",cc="/v1/",dc,uc=80000,mc=5,pc=0.5,gu,fc,_c=(e)=>new re(e,d.MAX_BUFFERED_REQUEST_METRICS);var kc=f(()=>{xi();Tl();b();ar();El();yi();hi();aa();W();Ul();Ci();ls();cs();ds();us();ji();ms();ps();fs();_s();ks();bs();gs();hs();ys();Rs();Ts();vs();Ss();xs();Cs();js();Ps();Es();qs();Os();As();Is();$s();Us();Ms();Ds();Fs();Ns();Gs();Bs();Ls();Ks();Hs();Vs();zs();Ws();Qs();Js();Xs();Ys();Zs();ea();ta();na();ia();ra();oa();sa();Ml();Dl();Fl();Nl();Gl();Bl();Ll();Kl();Hl();Vl();zl();Wl();Ql();Jl();Xl();tc();nc();ac();ws();aa();dc=qr,gu=["name","version","url","partner_id"],fc=["authenticator","apiVersion","typescript","maxNetworkRetries","httpAgent","httpClient","timeout","host","port","protocol","telemetry","emitEventBodies","appInfo","stripeAccount","stripeContext"];w.PACKAGE_VERSION="22.3.2";w.API_VERSION=qr;w.aiAgent="";w.AI_AGENT="";w.USER_AGENT={bindings_version:w.PACKAGE_VERSION,lang:"node",typescript:!1};w.StripeResource=d;w.resources=ae;w.HttpClient=q;w.HttpClientResponse=he;w.CryptoProvider=Re;w.StripeContext=K;w.errors=Si;w.Decimal=M;w._requestSenderFactory=_c});var bc={};Oi(bc,{Decimal:()=>M,Stripe:()=>w,default:()=>hu});var hu;var gc=f(()=>{Rl();Ri();kc();w.initialize(new fr);hu=w});import"@stacksjs/validation";import{log as Ai}from"@stacksjs/cli";import{db as Na}from"@stacksjs/database";async function Xc(e,t={}){let{olderThanDays:n=30,column:i="created_at",query:r}=t;try{if(r){let l=Na.deleteFrom(e);l=r(l);let u=await l.execute(),m=Array.isArray(u)?u:[u],p=Number(m[0]?.numDeletedRows??m.length??0);return Ai.info(`Pruned ${p} records from ${e}`),p}let o=new Date;o.setDate(o.getDate()-n);let s=await Na.deleteFrom(e).where(i,"<",o.toISOString()).execute(),a=Array.isArray(s)?s:[s],c=Number(a[0]?.numDeletedRows??a.length??0);return Ai.info(`Pruned ${c} records from ${e} older than ${n} days`),c}catch(o){throw Ai.error(`Failed to prune ${e}:`,o),o}}async function wf(e,t={}){return Xc(e,t)}function vf(e){if(!e?.prunable)return null;if(typeof e.prunable==="boolean")return{olderThanDays:30,column:"created_at"};return e.prunable}import{createCipheriv as Yc,createDecipheriv as Zc,createHash as ed,randomBytes as td}from"crypto";import{log as ai}from"@stacksjs/logging";var Ga="enc:",Ba="aes-256-gcm",nd=12,si=null;async function La(){if(si)return si;let e=process.env.APP_KEY;if(!e)try{e=(await import("@stacksjs/config").catch(()=>null))?.config?.app?.key}catch{}if(!e)return null;return si=ed("sha256").update(e).digest(),si}function ue(e){return typeof e==="string"&&e.startsWith(Ga)}async function Ii(e){if(e==null)return e;if(ue(e))return e;if(typeof e!=="string")return e;let t=await La();if(!t)return ai.warn("[orm] encrypted attribute: APP_KEY not set - storing value in plaintext"),e;let n=td(nd),i=Yc(Ba,t,n),r=Buffer.concat([i.update(e,"utf8"),i.final()]),o=i.getAuthTag();return`${Ga}${n.toString("base64")}:${o.toString("base64")}:${r.toString("base64")}`}async function $i(e){if(e==null)return e;if(typeof e!=="string")return e;if(!ue(e))return e;try{let t=await La();if(!t)return ai.warn("[orm] encrypted attribute: APP_KEY not set - cannot decrypt"),null;let[,n,i,r]=e.split(":");if(!n||!i||!r)return ai.warn("[orm] encrypted attribute: malformed envelope, returning null"),null;let o=Buffer.from(n,"base64"),s=Buffer.from(i,"base64"),a=Buffer.from(r,"base64"),c=Zc(Ba,t,o);return c.setAuthTag(s),Buffer.concat([c.update(a),c.final()]).toString("utf8")}catch(t){return ai.warn("[orm] encrypted attribute: decrypt failed (key rotation? corrupted ciphertext?)",{error:t}),null}}function Ui(e){let t=e.attributes;if(!t||typeof t!=="object")return[];let n=[];for(let[i,r]of Object.entries(t))if(r&&typeof r==="object"&&r.encrypted===!0)n.push(i);return n}import{sqlDateTime as id}from"@stacksjs/database";import{log as pe}from"@stacksjs/logging";var rd=[/^password$/i,/^password_hash$/i,/^api_key$/i,/_token$/i,/_secret$/i,/^remember_token$/i],Ha="model_audits",Fi=null;function od(e){Fi=e}async function Mi(){if(Fi!=null)return Fi;try{let e=await import("@stacksjs/router").catch(()=>null);if(!e)return null;let t=e.getCurrentRequest;if(typeof t!=="function")return null;let n=t();if(!n)return null;return(n.user??n._user)?.id??null}catch{return null}}function li(e){if(!e||typeof e!=="object")return null;let t={};for(let[n,i]of Object.entries(e)){if(rd.some((r)=>r.test(n)))continue;t[n]=i}return t}function me(e){if(!e||typeof e!=="object")return null;let t=e;if(t._attributes&&typeof t._attributes==="object")return{...t._attributes};return{...e}}function sd(e,t){if(!e||!t)return{old:e,next:t};let n={},i={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(let o of r)if(e[o]!==t[o])n[o]=e[o],i[o]=t[o];return{old:n,next:i}}async function Di(e,t=!1){try{let{db:n}=await import("@stacksjs/database");await n.insertInto(Ha).values({auditable_type:e.auditable_type,auditable_id:e.auditable_id,event:e.event,old_values:e.old_values?JSON.stringify(e.old_values):null,new_values:e.new_values?JSON.stringify(e.new_values):null,user_id:e.user_id,created_at:id()}).executeTakeFirst()}catch(n){if(pe.warn(`[orm] audit row write failed for ${e.auditable_type}#${String(e.auditable_id)} (${e.event})`,{error:n}),t)throw n}}function Va(e){return{async audits(t){try{let{db:n}=await import("@stacksjs/database");return(await n.selectFrom(Ha).selectAll().where("auditable_type","=",e).where("auditable_id","=",t).orderBy("created_at","desc").execute()??[]).map((r)=>({...r,old_values:typeof r.old_values==="string"?Ka(r.old_values):r.old_values,new_values:typeof r.new_values==="string"?Ka(r.new_values):r.new_values}))}catch(n){return pe.warn(`[orm] audits() lookup failed for ${e}#${String(t)}`,{error:n}),[]}}}}function Ka(e){try{return JSON.parse(e)}catch{return e}}function za(e){if(e&&typeof e==="object"&&"transactional"in e)return{transactional:e.transactional===!0};return{transactional:!1}}function Wa(e,t,n="id",i={}){let r=i.transactional===!0,o=e;if(typeof e.audits!=="function")e.audits=Va(t).audits;let s=async(u)=>{if(!r)return await u();let{db:m}=await import("@stacksjs/database");return await m.transaction(async()=>u())},a=e.create;if(typeof a==="function")e.create=async function(...u){return await s(async()=>{let m=await a.apply(this,u);try{let p=me(m),_=p?.[n];if(_!=null){let k=await Mi();await Di({auditable_type:t,auditable_id:_,event:"created",old_values:null,new_values:li(p),user_id:k},r)}}catch(p){if(pe.warn(`[orm] audit(create) failed for ${t}`,{error:p}),r)throw p}return m})};let c=e.update;if(typeof c==="function")e.update=async function(u,m){return await s(async()=>{let p=o.find,_=typeof p==="function"?me(await p.call(o,u)):null,k=await c.call(this,u,m);try{let g=me(k)??(typeof p==="function"?me(await p.call(o,u)):null),{old:y,next:R}=sd(_,g);if(R&&Object.keys(R).length>0){let v=await Mi();await Di({auditable_type:t,auditable_id:u,event:"updated",old_values:li(y),new_values:li(R),user_id:v},r)}}catch(g){if(pe.warn(`[orm] audit(update) failed for ${t}#${String(u)}`,{error:g}),r)throw g}return k})};let l=(u)=>{let m=e[u];if(typeof m!=="function")return;e[u]=async function(p){return await s(async()=>{let _=o.find,k=typeof _==="function"?me(await _.call(o,p)):null,g=await m.call(this,p);try{if(g!==!1&&k){let y=await Mi();await Di({auditable_type:t,auditable_id:p,event:"deleted",old_values:li(k),new_values:null,user_id:y},r)}}catch(y){if(pe.warn(`[orm] audit(${u}) failed for ${t}#${String(p)}`,{error:y}),r)throw y}return g})}};l("delete"),l("softDelete")}import{db as ad,sql as ld,sqlDateTime as Ni}from"@stacksjs/database";function G(e,t){if(typeof e!=="number"||!Number.isFinite(e)||e<=0)throw Error(`[orm/commentable] ${t} requires a positive numeric id (received ${String(e)})`)}var fe="commentable_upvotes",_e="commentables";function cd(e){let t=e;return t.code==="SQLITE_CONSTRAINT_UNIQUE"||t.code==="SQLITE_CONSTRAINT"||t.code==="23505"||t.errno===1062||/unique|duplicate/i.test(t.message??"")}function Gi(e){let t=ad;return{async comments(n){return G(n,"comments"),await t.selectFrom("commentables").where("commentables_id","=",n).where("commentables_type","=",e).selectAll().execute()},async commentCount(n){let i=await t.selectFrom("commentables").select(ld`count(*) as count`).where("commentables_id","=",n).where("commentables_type","=",e).executeTakeFirst();return Number(i?.count)||0},async addComment(n,i){if(G(n,"addComment"),!i||typeof i.title!=="string"||i.title.trim().length===0)throw Error("[orm/commentable] addComment requires a non-empty comment.title");if(typeof i.body!=="string"||i.body.trim().length===0)throw Error("[orm/commentable] addComment requires a non-empty comment.body");let r=await t.insertInto("commentables").values({...i,commentables_id:n,commentables_type:e,status:"pending",created_at:Ni(),updated_at:Ni()}).returningAll().executeTakeFirst();if(r&&typeof r==="object"&&"id"in r)return r;let o=r?.lastInsertRowid;if(o==null)return r;return await t.selectFrom("commentables").where("id","=",Number(o)).selectAll().executeTakeFirst()},async approvedComments(n){return await t.selectFrom("commentables").where("commentables_id","=",n).where("commentables_type","=",e).where("status","=","approved").selectAll().execute()},async pendingComments(n){return await t.selectFrom("commentables").where("commentables_id","=",n).where("commentables_type","=",e).where("status","=","pending").selectAll().execute()},async rejectedComments(n){return await t.selectFrom("commentables").where("commentables_id","=",n).where("commentables_type","=",e).where("status","=","rejected").selectAll().execute()},async upvoteComment(n,i){G(n,"upvoteComment"),G(i,"upvoteComment");let r=()=>t.selectFrom(fe).where("upvoteable_id","=",n).where("upvoteable_type","=",_e).where("user_id","=",i).selectAll().executeTakeFirst(),o=await r();if(o)return o;try{await t.insertInto(fe).values({upvoteable_id:n,upvoteable_type:_e,user_id:i,created_at:Ni()}).execute()}catch(s){if(!cd(s))throw s}return await r()},async removeCommentUpvote(n,i){G(n,"removeCommentUpvote"),G(i,"removeCommentUpvote"),await t.deleteFrom(fe).where("upvoteable_id","=",n).where("upvoteable_type","=",_e).where("user_id","=",i).execute()},async commentUpvoteCount(n){G(n,"commentUpvoteCount");let i=await t.selectFrom(fe).select("count(*) as count").where("upvoteable_id","=",n).where("upvoteable_type","=",_e).executeTakeFirst();return Number(i?.count)||0},async hasUpvotedComment(n,i){return G(n,"hasUpvotedComment"),G(i,"hasUpvotedComment"),!!await t.selectFrom(fe).where("upvoteable_id","=",n).where("upvoteable_type","=",_e).where("user_id","=",i).selectAll().executeTakeFirst()}}}import{db as dd,sql as ud,sqlDateTime as Qa}from"@stacksjs/database";function Bi(e,t){if(typeof e!=="number"||!Number.isFinite(e)||e<=0)throw Error(`[orm/taggable] ${t} requires a positive numeric id (received ${String(e)})`)}function Li(e){let t=dd;return{async tags(n){return Bi(n,"tags"),await t.selectFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).selectAll().execute()},async tagCount(n){Bi(n,"tagCount");let i=await t.selectFrom("taggables").select(ud`count(*) as count`).where("taggable_id","=",n).where("taggable_type","=",e).executeTakeFirst();return Number(i?.count)||0},async addTag(n,i){if(Bi(n,"addTag"),!i||typeof i.name!=="string"||i.name.trim().length===0)throw Error("[orm/taggable] addTag requires a non-empty tag.name");return await t.insertInto("taggables").values({...i,taggable_id:n,taggable_type:e,slug:i.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),is_active:!0,created_at:Qa(),updated_at:Qa()}).execute(),await t.selectFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).where("name","=",i.name).selectAll().executeTakeFirst()},async activeTags(n){return await t.selectFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).where("is_active","=",!0).selectAll().execute()},async inactiveTags(n){return await t.selectFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).where("is_active","=",!1).selectAll().execute()},async removeTag(n,i){await t.deleteFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).where("id","=",i).execute()}}}import{db as md,sqlDateTime as ci}from"@stacksjs/database";function Ki(e){let t=md;async function n(i){return(await t.selectFrom("categorizable_models").where("categorizable_id","=",i).where("categorizable_type","=",e).selectAll().execute()).map((o)=>o.category_id)}return{async categories(i){let r=await n(i);if(r.length===0)return[];return await t.selectFrom("categorizables").where("id","in",r).selectAll().execute()},async categoryCount(i){return(await n(i)).length},async addCategory(i,r){let o=()=>t.selectFrom("categorizables").where("name","=",r.name).where("categorizable_type","=",e).selectAll().executeTakeFirst(),s=await o();if(!s)await t.insertInto("categorizables").values({name:r.name,description:r.description,slug:r.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),categorizable_type:e,is_active:!0,created_at:ci(),updated_at:ci()}).execute(),s=await o();return await t.insertInto("categorizable_models").values({categorizable_id:i,categorizable_type:e,category_id:s.id,created_at:ci(),updated_at:ci()}).execute(),s},async activeCategories(i){let r=await n(i);if(r.length===0)return[];return await t.selectFrom("categorizables").where("id","in",r).where("is_active","=",!0).selectAll().execute()},async inactiveCategories(i){let r=await n(i);if(r.length===0)return[];return await t.selectFrom("categorizables").where("id","in",r).where("is_active","=",!1).selectAll().execute()},async removeCategory(i,r){await t.deleteFrom("categorizable_models").where("categorizable_id","=",i).where("categorizable_type","=",e).where("category_id","=",r).execute()}}}import{db as pd,sqlDateTime as fd}from"@stacksjs/database";function Hi(e,t){let n=pd,i=t?.table||`${e}_likes`,r=t?.foreignKey||`${e.replace(/s$/,"")}_id`;return{async likes(o){return await n.selectFrom(i).where(r,"=",o).selectAll().execute()},async likeCount(o){let s=await n.selectFrom(i).select("count(*) as count").where(r,"=",o).executeTakeFirst();return Number(s?.count)||0},async like(o,s){if(typeof o!=="number"||!Number.isFinite(o)||o<=0)throw Error(`[orm/likeable] like requires a positive numeric id (received ${String(o)})`);if(typeof s!=="number"||!Number.isFinite(s)||s<=0)throw Error(`[orm/likeable] like requires a positive numeric userId (received ${String(s)})`);let a=fd();try{return await n.insertInto(i).values({[r]:o,user_id:s,created_at:a,updated_at:a}).returningAll().executeTakeFirst()}catch(c){let l=c;if(!(l.code==="SQLITE_CONSTRAINT_UNIQUE"||l.code==="SQLITE_CONSTRAINT"||l.code==="23505"||l.errno===1062||/unique|duplicate/i.test(l.message??"")))throw c;let m=await n.selectFrom(i).where(r,"=",o).where("user_id","=",s).selectAll().executeTakeFirst();if(m)return m;throw c}},async unlike(o,s){await n.deleteFrom(i).where(r,"=",o).where("user_id","=",s).execute()},async isLiked(o,s){return!!await n.selectFrom(i).where(r,"=",o).where("user_id","=",s).selectAll().executeTakeFirst()},async likedBy(o){return(await n.selectFrom(i).select([r]).where("user_id","=",o).execute()).map((a)=>Number(a[r])).filter(Boolean)}}}function Xa(e){let t=e;return t?.code==="SQLITE_CONSTRAINT_UNIQUE"||t?.code==="SQLITE_CONSTRAINT"||t?.code==="23505"||t?.errno===1062||/unique|duplicate/i.test(t?.message??"")}function _d(e,t,n){let i=e;if(e instanceof Error&&typeof i.status==="number"&&Number.isInteger(i.status)&&i.status>=400&&i.status<600){let r={error:e.message};if(i.details!==void 0)r.details=i.details;return{status:i.status,body:r}}if(Xa(e))return{status:409,body:{error:`${t} already exists`}};return{status:500,body:{error:`Failed to ${n} ${t}`,detail:String(e)}}}function I(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function kd(e){let t={};for(let[n,i]of Object.entries(e))t[I(n)]=i;return t}function Nf(e,t){let n=String(t||"").replace(/^\/+|\/+$/g,""),i=String(e).replace(/^\/+/,"");return`/api/${n?`${n}/`:""}${i}`}function Gf(e){if(!e)return null;let t=e.attributes??{};if(Object.prototype.hasOwnProperty.call(t,"teamId")||Object.prototype.hasOwnProperty.call(t,"team_id"))return"team_id";return e.belongsTo?.some((n)=>n==="Team")?"team_id":null}function Bf(e,t,n){let i=Object.keys(e).find((o)=>I(o)===I(t));if(Array.isArray(n)){if(i===void 0)return{data:e,error:"Ownership value is required"};if(!n.some((o)=>String(o)===String(e[i])))return{data:e,error:"Ownership value is not available to this caller"};return{data:{...e,[t]:e[i]}}}if(n===null||n===void 0)return{data:e,error:"Caller has no ownership identity"};let r={...e};for(let o of Object.keys(r))if(I(o)===I(t))delete r[o];return r[t]=n,{data:r}}function bd(e){if(!e)return[];let t=Object.entries(e.attributes??{}).filter(([,n])=>n?.fillable===!0).map(([n])=>n);for(let n of e.belongsTo??[]){if(typeof n!=="string"||!n.trim())continue;let i=I(n.trim()).split("_").filter(Boolean);if(i.length===0)continue;let r=`${i[0]}${i.slice(1).map((o)=>`${o[0]?.toUpperCase()}${o.slice(1)}`).join("")}Id`;t.push(r)}return[...new Set(t)]}function gd(e,t){if(!e||t.length===0)return{};let n={};for(let i of t){if(i in e){n[i]=e[i];continue}let r=I(i);if(r!==i&&r in e)n[i]=e[r]}return n}function hd(e,t){if(e?.name!=="date"||t instanceof Date||typeof t!=="string")return t;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(!n)return t;let i=Number(n[1]),r=Number(n[2]),o=Number(n[3]),s=new Date(Date.UTC(i,r-1,o));if(s.getUTCFullYear()!==i||s.getUTCMonth()!==r-1||s.getUTCDate()!==o)return t;return s}function Lf(e,t){if(!t.length)return e;let n={...e};for(let i of t)delete n[i],delete n[I(i)];return n}function Kf(e,t){if(!e||t.length===0)return e;let n={...e};for(let i of t)delete n[i],delete n[I(i)];return n}var yd=["id","uuid","created_at","updated_at","deleted_at"];function Hf(e,t){let n=new Map;for(let i of[...Object.keys(e??{}),...yd]){let r=I(i);if(!/^\w+$/.test(r))continue;n.set(i,r),n.set(r,r)}for(let i of t)n.delete(i),n.delete(I(i));return n}function Vf(e,t,n){if(!t)return e;let i=String(t).split(",").map((o)=>o.trim()).filter(Boolean),r=e;for(let o of i){let s=o.startsWith("-"),a=s?o.slice(1):o;if(!/^\w+$/.test(a))continue;let c=n.get(a);if(!c)continue;r=r.orderBy(c,s?"desc":"asc")}return r}var Rd={string:{get:(e)=>e!=null?String(e):null,set:(e)=>e!=null?String(e):null},number:{get:(e)=>e!=null?Number(e):null,set:(e)=>e!=null?Number(e):null},integer:{get:(e)=>e!=null?Math.trunc(Number(e)):null,set:(e)=>e!=null?Math.trunc(Number(e)):null},float:{get:(e)=>e!=null?Number.parseFloat(String(e)):null,set:(e)=>e!=null?Number.parseFloat(String(e)):null},boolean:{get:(e)=>e===1||e==="1"||e===!0||e==="true",set:(e)=>e===!0||e===1||e==="1"||e==="true"?1:0},json:{get:(e)=>e==null?null:typeof e==="string"?Td(e):e,set:(e)=>e==null?null:typeof e==="string"?e:JSON.stringify(e)},datetime:{get:(e)=>e?new Date(e):null,set:(e)=>e instanceof Date?e.toISOString():e},date:{get:(e)=>e?new Date(e):null,set:(e)=>e instanceof Date?e.toISOString().split("T")[0]:e},array:{get:(e)=>e==null?[]:Array.isArray(e)?e:typeof e==="string"?wd(e):[],set:(e)=>e==null?null:Array.isArray(e)?JSON.stringify(e):e}};function Td(e){try{return JSON.parse(e)}catch{return e}}function wd(e){try{return JSON.parse(e)}catch{return[]}}function zf(e,t,n){if(!e||typeof e!=="object"||!t||Object.keys(t).length===0)return e;let i={...e};for(let[r,o]of Object.entries(t)){let s=typeof o==="string"?Rd[o]:o;if(!s||typeof s[n]!=="function")continue;if(Object.prototype.hasOwnProperty.call(i,r))i[r]=s[n](i[r]);let a=I(r);if(a!==r&&Object.prototype.hasOwnProperty.call(i,a))i[a]=s[n](i[a])}return i}function Ya(e,t,n){let i=t?.attributes??{},r={};for(let[o,s]of Object.entries(i)){let a=s?.validation?.rule;if(!a||typeof a.validate!=="function")continue;let c=Object.prototype.hasOwnProperty.call(e,o);if(!c&&n==="updating")continue;let l=s!==null&&typeof s==="object"&&Object.prototype.hasOwnProperty.call(s,"default"),u=c?e[o]:l?s.default:void 0,m=hd(a,u),p=a.validate(m);if(!p?.valid&&Array.isArray(p?.errors)&&p.errors.length>0)r[o]=p.errors.map((_)=>s?.validation?.message?.[_?.code]??_?.message??"invalid")}return Object.keys(r).length===0?{valid:!0}:{valid:!1,errors:r}}function Wf(e){return e.replace(/\{[^}]*\}/g,"{}").replace(/:[^/]+/g,"{}")}function Vi(e){if(Array.isArray(e))return e.filter((t)=>typeof t==="string"&&t.length>0);return typeof e==="string"&&e?[e]:[]}function Qf(e){let t=typeof e==="object"&&e!==null&&"middleware"in e,n=e?.middleware;if(!t)return{read:["auth"],write:["auth"],declared:!1};if(n&&typeof n==="object"&&!Array.isArray(n)){let r=n;return{read:"read"in r?Vi(r.read):["auth"],write:"write"in r?Vi(r.write):["auth"],declared:!0}}let i=Vi(n);return{read:i,write:i,declared:!0}}var Ja=15,vd=100;function Jf(e){let t=Number.parseInt(e.get("page")||String(1),10),n=Number.isFinite(t)?Math.max(1,t):1,i=Number.parseInt(e.get("per_page")||String(Ja),10),r=Math.min(Number.isFinite(i)?Math.max(1,i):Ja,vd);return{page:n,perPage:r,offset:(n-1)*r}}function di(e,t){let n=new URL(e.toString());return n.searchParams.set("page",String(t)),`${n.pathname}${n.search}`}function Sd(e,t,n,i,r,o){let s=(t-1)*n,a=i===0,c={page:t,per_page:n,from:a?null:s+1,to:a?null:s+i,has_more_pages:r,prev_page_url:t>1?di(e,t-1):null,next_page_url:r?di(e,t+1):null};if(o!==void 0&&!Number.isNaN(o)){let l=Math.max(1,Math.ceil(o/n));c.total=o,c.last_page=l,c.first_page_url=di(e,1),c.last_page_url=di(e,l)}return c}function Xf(e,t,n,i,r,o){let{page:s,...a}=Sd(e,t,n,i,r,o);return{current_page:s,...a}}import{cacheRequestQuery as xd}from"@stacksjs/router";var ui=new WeakMap;function e_(e,t){return xd(`batchLoad:${e.name??"model"}:${String(t)}`,async()=>new Promise((n,i)=>{let r=ui.get(e);if(!r)r={keys:[],resolvers:[],scheduled:!1},ui.set(e,r);if(r.keys.push(t),r.resolvers.push({key:t,resolve:n,reject:i}),r.scheduled)return;r.scheduled=!0,Promise.resolve().then(async()=>{let o=ui.get(e);if(!o)return;ui.delete(e);let s=Array.from(new Set(o.keys));try{let a=typeof e.findMany==="function"?await e.findMany(s):await Promise.all(s.map((l)=>e.find?.(l))),c=new Map;for(let l of a??[]){let u=l?.id;if(u!==void 0)c.set(u,l)}for(let l of o.resolvers)l.resolve(c.get(l.key))}catch(a){for(let c of o.resolvers)c.reject(a)}})}))}import{db as r_}from"@stacksjs/database";class Cd{conditions=[];where(e,...t){let[n,i]=t,r=i===void 0?"=":n,o=i===void 0?n:i;this.addCondition("and","where",e,r,o)}orWhere(e,...t){let[n,i]=t,r=i===void 0?"=":n,o=i===void 0?n:i;this.addCondition("or","where",e,r,o)}whereIn(e,t){this.conditions.push({type:"and",method:"whereIn",column:e,values:t})}whereNotIn(e,t){this.conditions.push({type:"and",method:"whereIn",column:e,values:t,operator:"not in"})}whereNull(e){this.conditions.push({type:"and",method:"whereNull",column:e})}whereNotNull(e){this.conditions.push({type:"and",method:"whereNotNull",column:e})}whereBetween(e,t){this.conditions.push({type:"and",method:"whereBetween",column:e,range:t})}whereExists(e){this.conditions.push({type:"and",method:"whereExists",column:"",callback:e})}addCondition(e,t,n,i,r){this.conditions.push({type:e,method:t,column:n,operator:i,value:r})}getConditions(){return this.conditions}}import{db as zi,runInTransactionScope as jd}from"@stacksjs/database";async function a_(e,t){return await jd(async()=>await zi.transaction(e,t))}async function l_(e){return await zi.savepoint(e)}function c_(e,t){return zi.transactional(e,t)}import{path as B}from"@stacksjs/path";import{fs as ne,globSync as Xi}from"@stacksjs/storage";import{plural as il,singular as Za,snakeCase as E}from"@stacksjs/strings";import{isString as mi}from"@stacksjs/validation";function rl(e){let t=e.belongsToMany;if(!t)return[];if(Array.isArray(t))return t.map((n)=>({relationName:typeof n==="string"?E(n):E(String(n.model)),relation:n}));return Object.entries(t).map(([n,i])=>{if(typeof i==="string")return{relationName:n,relation:i};return{relationName:n,relation:{model:i.model,pivotTable:i.table,firstForeignKey:i.foreignKey,secondForeignKey:i.relatedKey}}})}async function __(e){if(typeof e==="string")e=(await import(e)).default;return e.table??E(il(e?.name||""))}function ke(e,t){if(e.name)return e.name;return B.basename(t).replace(/\.ts$/,"")}function F(e,t){if(e.table)return e.table;return E(il(ke(e,t)))}function Pd(e,t){let n=[e,t];return n.sort(),n.join("_")}function k_(e,t){return t in e}async function Ed(e,t){let n=[];if(e.hasOne)for(let i of e.hasOne)n.push(await Wi(i,e,t,"hasOne"));if(e.hasMany)for(let i of e.hasMany)n.push(await Wi(i,e,t,"hasMany"));if(e.belongsTo)for(let i of e.belongsTo)n.push(await Wi(i,e,t,"belongsTo"));if(e.hasOneThrough)for(let i of e.hasOneThrough)n.push(await tl(i,e,t,"hasOneThrough"));if(e.hasManyThrough)for(let i of e.hasManyThrough)n.push(await tl(i,e,t,"hasManyThrough"));if(e.belongsToMany)for(let{relationName:i,relation:r}of rl(e))n.push(await Od(r,e,t,"belongsToMany",i));if(e.morphOne)n.push(await nl(e.morphOne,e,t,"morphOne"));if(e.morphMany){let i=Array.isArray(e.morphMany)?e.morphMany:[e.morphMany];for(let r of i)n.push(await nl(r,e,t,"morphMany"))}if(e.morphTo){let i=e.morphTo,r=Array.isArray(i)?i:typeof i==="object"&&i!==null?[i]:[];for(let o of r)n.push(qd(o,e,t))}if(e.morphToMany){let i=Array.isArray(e.morphToMany)?e.morphToMany:[e.morphToMany];for(let r of i)n.push(el(r,e,t,"morphToMany"))}if(e.morphedByMany){let i=Array.isArray(e.morphedByMany)?e.morphedByMany:[e.morphedByMany];for(let r of i)n.push(el(r,e,t,"morphedByMany"))}return n}function qd(e,t,n){let i=e&&typeof e==="object"&&e.name?String(e.name):`${E(n)}able`,r=e?.type||`${i}_type`;return{relationship:"morphTo",model:"",table:"",relationTable:"",foreignKey:e?.id||`${i}_id`,modelKey:r,relationName:i,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:"",pivotKey:"",pivotTable:""}}function el(e,t,n,i){let r=typeof e==="object"&&e!==null,o=r?String(e.model||""):String(e),s=r&&e.morphName?String(e.morphName):`${E(n)}able`,a=r&&e.pivotTable?String(e.pivotTable):s,c=r&&e.id||`${s}_id`,l=r&&e.type||`${s}_type`;return{relationship:i,model:o,table:"",relationTable:"",foreignKey:c,modelKey:l,relationName:s,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:c,pivotKey:l,pivotTable:a}}async function pi(e,t){let n=Ji(`${t}.ts`),i=Ji(`${e}.ts`),r=Qi(`${e}.ts`),o=Qi(`${t}.ts`);if(!n&&!o)throw Error(`Model not found: ${t}`);if(!i&&!r)throw Error(`Model not found: ${e}`);let s;try{if(ne.existsSync(n))s=(await import(n)).default;else s=(await import(o)).default}catch(c){throw Error(`Failed to load model: ${t}. Error: ${c?.message||"Unknown error"}`)}let a=ne.existsSync(i)?i:r;return{modelRelation:s,modelPath:a,modelRelationPath:ne.existsSync(n)?n:o}}async function tl(e,t,n,i){let r="",o="",s="",a="";if(mi(e))r=e;else r=e.model,o=e.relationName||"",s=e.through,a=e.throughForeignKey||"";let{modelRelation:c,modelPath:l,modelRelationPath:u}=await pi(n,r),m=F(c,u),p=F(t,l),_=E(ke(c,u)),k=E(n);return{relationship:i,model:r,table:m,relationTable:p,foreignKey:`${k}_id`,modelKey:`${_}_id`,relationName:o,relationModel:n,throughModel:s,throughForeignKey:a,pivotForeign:`${k}_id`,pivotKey:`${_}_id`,pivotTable:p}}async function Od(e,t,n,i,r){let o="",s="",a="",c=E(n);if(mi(e))o=e;else o=e.model,s=e.pivotTable||"",a=e.firstForeignKey||`${c}_id`;let{modelRelation:l,modelPath:u,modelRelationPath:m}=await pi(n,o),p=F(l,m),_=F(t,u),k=E(ke(l,m));return{relationship:i,model:o,table:p,relationTable:_,foreignKey:typeof e==="string"?`${c}_id`:e.firstForeignKey||`${c}_id`,modelKey:typeof e==="string"?`${k}_id`:e.secondForeignKey||`${k}_id`,relationName:r,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:a,pivotKey:`${k}_id`,pivotTable:s}}async function nl(e,t,n,i){let r="",o="",s="",a="";if(mi(e))r=e,o=`${E(n)}able`;else r=e.model,o=e.morphName||`${E(n)}able`,s=e.type||`${o}_type`,a=e.id||`${o}_id`;let{modelRelation:c,modelPath:l,modelRelationPath:u}=await pi(n,r),m=F(c,u),p=F(t,l);return{relationship:i,model:r,table:m,relationTable:p,foreignKey:a||`${o}_id`,modelKey:s||`${o}_type`,relationName:o,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:"",pivotKey:"",pivotTable:p}}async function Wi(e,t,n,i){let r="",o="";if(mi(e))r=e;else r=e.model,o=e.relationName||"";let{modelRelation:s,modelPath:a,modelRelationPath:c}=await pi(n,r),l=F(s,c),u=F(t,a),m=E(ke(s,c)),p=E(n),_=typeof e==="string"?"":e.foreignKey||"",k={relationship:i,model:r,table:l,relationTable:u,foreignKey:_||`${p}_id`,modelKey:`${m}_id`,relationName:o,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:`${p}_id`,pivotKey:`${m}_id`,pivotTable:u};if(i==="belongsTo"){if(k.foreignKey="",_)k.modelKey=_}return k}function b_(e){let t=/belongs/,n=/has/,i=/Through/,r=/morph/;if(i.test(e))return"throughType";if(t.test(e))return"belongsType";if(n.test(e))return"hasType";if(r.test(e))return"morphType";return""}function g_(e){let t=/One/;if(/Many/.test(e))return"many";if(t.test(e))return"one";return""}async function h_(e,t){let n=[];if("belongsToMany"in e){for(let{relation:i}of rl(e)){let r,o;if(typeof i==="string")o=i;else o=i.model;let s=Ji(`${o}.ts`),a=Qi(`${o}.ts`);if(ne.existsSync(s))r=(await import(s)).default;else r=(await import(a)).default;let c=F(r,s),l=F(e,t),u=typeof i==="object"&&"firstForeignKey"in i?i.firstForeignKey:`${Za(l)}_${e.primaryKey}`,m=typeof i==="object"&&"secondForeignKey"in i?i.secondForeignKey:`${Za(c)}_${e.primaryKey}`;n.push({table:(typeof i==="object"&&"pivotTable"in i?i.pivotTable:void 0)??Pd(l,c),firstForeignKey:u,secondForeignKey:m})}return n}return[]}async function y_(e){let t=Xi([B.userModelsPath("*.ts"),B.storagePath("framework/defaults/app/Models/**/*.ts")],{absolute:!0}),n=[];for(let i=0;i<t.length;i++){let r=t[i],o=await import(r);if(e===o.default.name)continue;let s=ke(o,r),a=await Ed(o.default,s);if(!a.length)continue;let c=a.find((l)=>l.model===e);if(c)n.push(c)}return n}function R_(e){if(e===void 0)return[];return Object.keys(e).filter((t)=>e[t]?.hidden===!0)}function T_(e){let t=e.attributes;if(t===void 0)return[];return Object.keys(t).filter((n)=>t[n]?.guarded===!0).map((n)=>E(n))}function w_(e,t){let n=e.attributes,i=[];if(n===void 0)return[];let r=typeof e.traits?.billable==="object"||typeof e.traits?.billable==="boolean",o=typeof e.traits?.useAuth==="object"?e.traits?.useAuth.usePasskey:!1,s=e.traits?.useUuid||!1;if(r)i.push("stripe_id");if(s)i.push("uuid");if(o)i.push(...["two_factor_secret","public_key"]);let a=t.map((c)=>c.foreignKey).filter((c)=>c);return[...Object.keys(n).filter((c)=>{if(n===void 0)return!1;return n[c]?.fillable===!0}).map((c)=>E(c)),...i,...a]}async function v_(e,t){let n=e.attributes;if(!n)n={};let i=Object.keys(n),r=[],o=Bun.file(t),s="";try{if(await o.exists())s=await o.text()}catch{s=""}let a=/rule:.*$/gm,c;c=a.exec(s);while(c!==null)r.push(c[0]),c=a.exec(s);return i.map((u,m)=>{let p=n[u],_=null,k=!1,g=!1,y=!1,R=!1;if(p)_=p||null,k=p.unique||!1,g=p.hidden||!1,y=p.fillable||!1;let v=r[m]??"";return R=(p.validation?.rule).isRequired??!1,{field:u,default:_,unique:k,hidden:g,fillable:y,required:R,fieldArray:Ad(v)}})}function Ad(e){let t=e.split("rule: schema.");if(t.length!==2)return null;if(!t[1])t[1]="";let n=t[1].replace(/,/g,"");if(!n)return null;let i=n.split("."),r=/\(([^)]+)\)/;return i.map((o)=>{let s=r.exec(o),a=s?s[1]:null;return{entity:o.replace(r,"").replace(/\(|\)/g,""),charValue:a}})[0]||null}function S_(e){let t=e.fieldArray?.entity;switch(t){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 t}}function Qi(e){let t=B.join(B.storagePath("framework/defaults/app/Models"),"/"),n=B.join(t,e);if(ne.existsSync(n))return n;return Xi(`${t}**/${e}`,{absolute:!0})[0]??""}function Ji(e){let t=B.join(B.userModelsPath("/"),"/"),n=B.join(t,e);if(ne.existsSync(n))return n;return Xi(`${t}**/${e}`,{absolute:!0})[0]??""}function x_(e){let t=typeof e==="number"?new Date(e):typeof e==="string"?new Date(e):e;if(Number.isNaN(t.getTime()))throw Error(`Invalid date value: ${String(e)}`);return t.toISOString().replace("T"," ").split(".")[0]??""}function C_(e){return e.toISOString().split("T")[0]??""}function j_(e){return e.getTime()}import{createModel as vu,registerModel as Su}from"@stacksjs/query-builder";import{log as A}from"@stacksjs/logging";import{snakeCase as H}from"@stacksjs/strings";import{AsyncLocalStorage as Ec}from"async_hooks";function Id(e){if(e===null||typeof e!=="object")return!1;let t=e;return Array.isArray(t.data)&&typeof t.current_page==="number"&&typeof t.per_page==="number"&&typeof t.total==="number"&&typeof t.last_page==="number"}function $d(e){if(e===null||typeof e!=="object")return!1;let t=e;return Array.isArray(t.data)&&typeof t.current_page==="number"&&typeof t.per_page==="number"&&typeof t.has_more_pages==="boolean"&&!("total"in t)}function Ud(e){if(e===null||typeof e!=="object")return!1;let t=e;return Array.isArray(t.data)&&(typeof t.next_cursor==="string"||t.next_cursor===null)}function Yi(e){let{data:t}=e,{perPage:n,page:i,total:r,lastPage:o}=e.meta,s=t.length===0,a=s?null:(i-1)*n+1,c=s?null:a+t.length-1;return{data:t,current_page:i,per_page:n,total:r,last_page:o,from:a,to:c,has_more_pages:i<o}}function Zi(e){return{data:e.data,current_page:e.meta.page,per_page:e.meta.perPage,has_more_pages:e.meta.hasMore}}function er(e){return{data:e.data,per_page:e.meta.perPage,next_cursor:ol(e.meta.nextCursor),prev_cursor:ol(e.meta.prevCursor),has_more_pages:e.meta.nextCursor!==null&&e.meta.nextCursor!==void 0}}function ol(e){if(e===null||e===void 0)return null;if(typeof e==="string")return e;return JSON.stringify(e)}function nr(e,t){let n=or(),i=n?tr(n,"per_page"):void 0,r=n?tr(n,"page"):void 0,o=e!==void 0?Math.max(1,Math.floor(e)):Math.min(100,Math.max(1,i??15)),s=Math.max(1,Math.floor(t??r??1));return{perPage:o,page:s}}function ir(e,t){let n=or(),i=n?al(n,"cursor"):void 0,r=n?tr(n,"per_page"):void 0,o=e!==void 0?Math.max(1,Math.floor(e)):Math.min(100,Math.max(1,r??15)),a=sl(t!==void 0?t:i??null);return{perPage:o,cursor:a}}function sl(e){if(e===null||e===void 0)return null;if(Array.isArray(e))return e;if(typeof e==="string"&&e.startsWith("["))try{let t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e}function rr(e){let t=or();if(!t)return e;let n=(()=>{try{return new URL(t.url)}catch{return null}})();if(!n)return e;let i=n.pathname;if(e.path=i,"next_cursor"in e)return e.next_page_url=e.next_cursor!==null?Y(n,{cursor:e.next_cursor}):null,e.prev_page_url=e.prev_cursor!==null?Y(n,{cursor:e.prev_cursor}):null,e;let r=e.current_page;if(e.prev_page_url=r>1?Y(n,{page:r-1}):null,"total"in e){let o=e.last_page;e.next_page_url=r<o?Y(n,{page:r+1}):null,e.first_page_url=Y(n,{page:1}),e.last_page_url=Y(n,{page:o})}else e.next_page_url=e.has_more_pages?Y(n,{page:r+1}):null;return e}function Y(e,t){let n=new URL(e.toString());for(let[i,r]of Object.entries(t))n.searchParams.set(i,String(r));return`${n.pathname}${n.search}`}var ie;function or(){if(ie===null)return;if(ie===void 0)try{let t=T("@stacksjs/router");if(typeof t.getCurrentRequest==="function")ie=t.getCurrentRequest;else{ie=null;return}}catch{ie=null;return}return ie()}function tr(e,t){let n=al(e,t);if(n===void 0)return;let i=Number(n);return Number.isFinite(i)?i:void 0}function al(e,t){let n=e.query?.[t];if(n===void 0)return;return Array.isArray(n)?n[0]:n}import{db as yu}from"@stacksjs/database";function hc(e){let t=yu;return{async createStripeUser(n,i){let{manageCustomer:r}=await import("@stacksjs/payments");return await r.createStripeCustomer(n,i)},async updateStripeUser(n,i){let{manageCustomer:r}=await import("@stacksjs/payments");return await r.updateStripeCustomer(n,i)},async deleteStripeUser(n){let{manageCustomer:i}=await import("@stacksjs/payments");return await i.deleteStripeUser(n)},async createOrGetStripeUser(n,i){let{manageCustomer:r}=await import("@stacksjs/payments");return await r.createOrGetStripeUser(n,i)},async retrieveStripeUser(n){let{manageCustomer:i}=await import("@stacksjs/payments");return await i.retrieveStripeUser(n)},async defaultPaymentMethod(n){let{managePaymentMethod:i}=await import("@stacksjs/payments");return await i.retrieveDefaultPaymentMethod(n)},async setDefaultPaymentMethod(n,i){let{managePaymentMethod:r}=await import("@stacksjs/payments");return await r.setDefaultPaymentMethod(n,i)},async addPaymentMethod(n,i){let{managePaymentMethod:r}=await import("@stacksjs/payments");return await r.addPaymentMethod(n,i)},async paymentMethods(n,i){let{managePaymentMethod:r}=await import("@stacksjs/payments");return await r.listPaymentMethods(n,i)},async newSubscription(n,i,r,o={}){let{manageSubscription:s}=await import("@stacksjs/payments"),a=await s.create(n,i,r,o),l=a.latest_invoice?.payment_intent;return{subscription:a,paymentIntent:l}},async updateSubscription(n,i,r,o={}){let{manageSubscription:s}=await import("@stacksjs/payments"),a=await s.update(n,i,r,o),l=a.latest_invoice?.payment_intent;return{subscription:a,paymentIntent:l}},async cancelSubscription(n,i,r={}){let{manageSubscription:o}=await import("@stacksjs/payments");return{subscription:await o.cancel(i,r)}},async activeSubscription(n){let{manageSubscription:i}=await import("@stacksjs/payments"),r=await t.selectFrom("subscriptions").where("user_id","=",n.id).where("provider_status","=","active").selectAll().executeTakeFirst();if(r){let o=await i.retrieve(n,r.provider_id||"");return{subscription:r,providerSubscription:o}}return},async checkout(n,i,r={}){let{manageCheckout:o,manageCustomer:s}=await import("@stacksjs/payments"),a={};if(r.enableTax)a.automatic_tax={enabled:!0},delete r.enableTax;if(r.allowPromotions)a.allow_promotion_codes=!0,delete r.allowPromotions;let u={...{mode:"payment",customer:(await s.createOrGetStripeUser(n,{})).id,line_items:i.map((m)=>({price:m.priceId,quantity:m.quantity||1}))},...a,...r};return await o.create(n,u)},async createSetupIntent(n,i={}){let{manageSetupIntent:r}=await import("@stacksjs/payments");return await r.create(n,i)},async subscriptionHistory(n){let{manageInvoice:i}=await import("@stacksjs/payments");return await i.list(n)},async transactionHistory(n){let{manageTransaction:i}=await import("@stacksjs/payments");return await i.list(n)},async connectAccount(n,i={}){let r=i.accountColumn||"stripe_account_id",o=(n._attributes??n)[r];if(!o)return null;let s=await ti();try{return await s.accounts.retrieve(o)}catch{return null}},async createConnectAccount(n,i={}){let r=i.accountColumn||"stripe_account_id",o=n._attributes??n,s=o[r],a=await ti();if(!s){let{stacksIdempotencyKey:c}=await import("@stacksjs/payments"),l=i.modelTable||e,u=await a.accounts.create({type:i.type??"express",email:i.email??o.email,country:i.country??"US",capabilities:i.capabilities??{card_payments:{requested:!0},transfers:{requested:!0}}},{idempotencyKey:c("connect.account.create",l,o.id)});return s=u.id,await t.updateTable(l).set({[r]:s}).where("id","=",Number(o.id)).execute(),u}return await a.accounts.retrieve(s)},async connectOnboardLink(n,i){let r=i.accountColumn||"stripe_account_id",s=(n._attributes??n)[r];if(!s)throw Error("connectOnboardLink: model has no Stripe Connect account; call createConnectAccount first");return{url:(await(await ti()).accountLinks.create({account:s,refresh_url:i.refreshUrl,return_url:i.returnUrl,type:i.type??"account_onboarding"})).url,accountId:s}},async syncConnectStatus(n,i={}){let r=i.accountColumn||"stripe_account_id",o=i.chargesColumn||"charges_enabled",s=i.payoutsColumn||"payouts_enabled",a=n._attributes??n,c=a[r];if(!c)return{chargesEnabled:!1,payoutsEnabled:!1};let u=await(await ti()).accounts.retrieve(c),m=!!u.charges_enabled,p=!!u.payouts_enabled,_=i.modelTable||e;return await t.updateTable(_).set({[o]:m,[s]:p}).where("id","=",Number(a.id)).execute(),{chargesEnabled:m,payoutsEnabled:p}},async chargeWithSplit(n,i){let r=await ti(),o=i.accountColumn||"stripe_account_id",s=n._attributes??n,a=i.connectAccountId||s[o],c={amount:i.amountCents,currency:i.currency||"usd",automatic_payment_methods:{enabled:!0},metadata:i.metadata};if(a){if(c.transfer_data={destination:a},i.platformFeeCents)c.application_fee_amount=i.platformFeeCents}let{freshIdempotencyKey:l}=await import("@stacksjs/payments");return await r.paymentIntents.create(c,{idempotencyKey:l("payment_intent.create",s.id,i.amountCents)})}}}async function ti(){let e=globalThis.process?.env?.STRIPE_SECRET_KEY;if(!e)throw Error("Stripe Connect: STRIPE_SECRET_KEY not configured");return new(await Promise.resolve().then(() => (gc(),bc))).default(e,{apiVersion:"2026-06-24.dahlia"})}function yc(){return{async generateTwoFactorForModel(e){let{generateTwoFactorSecret:t}=await import("@stacksjs/auth"),n=t();await e.update({two_factor_secret:n})},async verifyTwoFactorCode(e,t){let n=e.get("two_factor_secret");if(typeof n!=="string")return!1;let{verifyTwoFactorCode:i,RateLimiter:r}=await import("@stacksjs/auth"),o=String(e.id??e.get?.("id")??e.get?.("email")??n),s=`2fa:${o}`;if(await r.isRateLimited(s)){let{HttpError:c}=await import("@stacksjs/error-handling");throw new c(429,"Too many verification attempts. Please try again later.")}if(!await i(t,n))return await r.recordFailedAttempt(s),!1;try{let{cache:c}=await import("@stacksjs/cache"),l=`2fa:used:${o}:${t}`;if(await c.has(l))return await r.recordFailedAttempt(s),!1;await c.set(l,"1",90)}catch{}return await r.resetAttempts(s),!0}}}import{sqlDateTime as Ru}from"@stacksjs/database";import{log as le}from"@stacksjs/logging";var Pi="deleted_at";function Rc(e,t="id"){return{async softDelete(n){let i=Ru(),r=e.where(t,n);if(typeof r?.update==="function")return await r.update({[Pi]:i}),!0;return!1},async restore(n){let i=e.where(t,n);if(typeof i?.update==="function")return await i.update({[Pi]:null}),!0;return!1},async forceDelete(n){let i=e.where(t,n);if(typeof i?.delete==="function")return await i.delete(),!0;return!1},withTrashed(){return typeof e.query==="function"?e.query():e},onlyTrashed(){let n=typeof e.query==="function"?e.query():e;if(typeof n?.whereNotNull==="function")return n.whereNotNull(Pi);return n?.where?.(Pi,"!=",null)??n}}}function Tc(e){if(e===!0||e==null)return{};if(typeof e==="object"&&!Array.isArray(e)){let t=e;if(Array.isArray(t.cascade)){let n=t.cascade.filter((i)=>typeof i==="string");return n.length?{cascade:n}:{}}return{}}return{}}function Tu(e,t){let n=e.hasMany??[],i=e.hasOne??[],r=n.some((u)=>Ia(u,t,!0)),o=i.some((u)=>Ia(u,t,!1));if(!r&&!o)return le.warn(`[orm] soft-delete cascade: '${t}' is not a declared hasMany/hasOne relation - skipping`),null;let a=(r?n:i).find((u)=>Ia(u,t,r))??null;if(!a)return null;let l=globalThis[a];if(!l)return le.warn(`[orm] soft-delete cascade: model '${a}' is not yet on globalThis - skipping cascade for '${t}'`),null;return{className:a,model:l}}function Ia(e,t,n){let i=e.toLowerCase();if(t===i)return!0;if(n&&t===`${i}s`)return!0;if(n&&i.endsWith("y")&&t===`${i.slice(0,-1)}ies`)return!0;return!1}async function wu(e,t,n,i,r){try{let o=n.where;if(typeof o!=="function"){le.warn(`[orm] cascade ${r}: child model has no .where()`);return}if(r==="softDelete"){let s=n.softDelete;if(typeof s==="function"){let c=o.call(n,i,t),l=typeof c?.get==="function"?await c.get():Array.isArray(c)?c:[],u=n.primaryKey||"id";for(let m of l){let p=m?.[u];if(p!=null)await s.call(n,p)}return}let a=o.call(n,i,t);if(typeof a?.delete==="function"){le.debug(`[orm] cascade soft-delete: child has no softDeletes trait, hard-deleting from ${String(n.table??"?")}`),await a.delete();return}}else{let s=n.restore;if(typeof s!=="function"){le.debug("[orm] cascade restore: child has no restore() - nothing to do");return}let a=n.withTrashed,l=(typeof a==="function"?a.call(n):n).where?.(i,t),u=typeof l?.get==="function"?await l.get():[],m=n.primaryKey||"id";for(let p of u){let _=p?.[m];if(_!=null)await s.call(n,_)}}}catch(o){if(le.warn(`[orm] soft-delete cascade ${r} on ${e}#${String(t)} failed`,{error:o}),process.env.STACKS_ORM_CASCADE_SWALLOW!=="true")throw o}}async function ni(e,t,n,i){let r=t.cascade;if(!r||r.length===0)return;let o=`${e.name.toLowerCase()}_id`;for(let s of r){let a=Tu(e,s);if(!a)continue;await wu(a.className,n,a.model,o,i)}}var qc=new Ec;function te(){return qc.getStore()?.suppressed===!0}function ee(e){return Promise.resolve(qc.run({suppressed:!0},e))}var Oc=new Ec;function xu(){return Oc.getStore()?.suppressed===!0}function Cu(e){return Promise.resolve(Oc.run({suppressed:!0},e))}var Fa=Symbol.for("stacks.orm.modelDefinition");class Ac extends Error{status=422;errors;constructor(e,t){let n=Object.keys(t).join(", ");super(`${e} validation failed: ${n}`);this.name="ModelValidationError",this.errors=t}}var wc=new Set;function ju(e,t){let n=typeof e==="string"?e.slice(0,80):String(e),i=`${typeof e}:${n}`;if(wc.has(i))return;wc.add(i);let r=t instanceof Error?t.message:String(t);console.error(`[orm] JSON cast failed to parse value (returning null): ${r} - value preview: ${JSON.stringify(n)}`)}var Pu={string:{get:(e)=>e!=null?String(e):null,set:(e)=>e!=null?String(e):null},number:{get:(e)=>e!=null?Number(e):null,set:(e)=>e!=null?Number(e):null},integer:{get:(e)=>e!=null?Math.trunc(Number(e)):null,set:(e)=>e!=null?Math.trunc(Number(e)):null},float:{get:(e)=>e!=null?Number.parseFloat(String(e)):null,set:(e)=>e!=null?Number.parseFloat(String(e)):null},boolean:{get:(e)=>e===1||e==="1"||e===!0||e==="true",set:(e)=>e===!0||e===1||e==="1"||e==="true"?1:0},json:{get:(e)=>{if(e==null)return null;if(typeof e==="string")try{return JSON.parse(e)}catch(t){return ju(e,t),null}return e},set:(e)=>{if(e==null)return null;return typeof e==="string"?e:JSON.stringify(e)}},datetime:{get:(e)=>e?new Date(e):null,set:(e)=>e instanceof Date?e.toISOString():e},date:{get:(e)=>e?new Date(e):null,set:(e)=>e instanceof Date?e.toISOString().split("T")[0]:e},array:{get:(e)=>{if(e==null)return[];if(Array.isArray(e))return e;if(typeof e==="string")try{return JSON.parse(e)}catch{return[]}return[]},set:(e)=>{if(e==null)return null;return Array.isArray(e)?JSON.stringify(e):e}}};function Ic(e){return typeof e==="string"?Pu[e]:e}function vc(e,t,n){if(!e||typeof e!=="object")return e;let i={...e};for(let[r,o]of Object.entries(t))if(r in i){let s=Ic(o);i[r]=s[n](i[r])}return i}var Ei=new Set(["_attributes","_original","_definition","_hasSaved","_relations"]),Sc=Symbol.for("stacks.modelInstanceProxy"),Eu={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 qu(e,t){if(!e||!t)return null;let n=t.split("."),i=e;for(let r of n){if(i==null||typeof i!=="object")return null;let o=i;if("_attributes"in o&&o._attributes&&typeof o._attributes==="object"){let s=o._attributes;if(r in s){i=s[r];continue}}if(r in o){i=o[r];continue}return null}return i??null}function D(e,t){if(!e||typeof e!=="object")return e;if(e[Sc])return e;let n=e._attributes;if(!n||typeof n!=="object")return e;if(t&&Object.keys(t).length>0){for(let[i,r]of Object.entries(t))if(Object.prototype.hasOwnProperty.call(n,i))n[i]=Ic(r).get(n[i])}return new Proxy(e,{get(i,r,o){if(r===Sc)return!0;if(r==="saveAsync")return async function(){let a=i._definition,c=a?.set;if(c&&typeof i.isDirty==="function"){for(let[u,m]of Object.entries(c)){if(typeof m!=="function")continue;if(!i.isDirty(u))continue;let p=m(i._attributes),_=p&&typeof p.then==="function"?await p:p;i._attributes[u]=_}let l=a.set;a.set={};try{return i.save()}finally{a.set=l}}return i.save()};if(r==="save")return function(){let a=i._definition,c=a?.set;if(c&&Object.keys(c).length>0&&typeof i.isDirty==="function"){for(let[u,m]of Object.entries(c)){if(typeof m!=="function")continue;if(!i.isDirty(u))continue;let p=m(i._attributes);if(p&&typeof p.then==="function")throw Error(`Setter for "${u}" returned a Promise - use \`saveAsync()\` instead of \`save()\` when a model has async setters.`);i._attributes[u]=p}let l=a.set;a.set={};try{return i.save()}finally{a.set=l}}return i.save()};if(r==="updateAsync")return async function(a){if(a&&typeof a==="object"&&!Array.isArray(a))for(let[c,l]of Object.entries(a))o[c]=l;return o.saveAsync()};if(r==="saveQuietly")return function(){return ee(()=>i.save())};if(r==="saveAsyncQuietly")return function(){return ee(()=>o.saveAsync())};if(r==="updateQuietly")return function(a){return ee(()=>i.update(a))};if(r==="updateAsyncQuietly")return function(a){return ee(()=>o.updateAsync(a))};if(r==="deleteQuietly")return function(){return ee(()=>i.delete())};if(r==="toSearchableObject")return function(){let l=i._definition?.traits?.useSearch;if(!l)return null;let u=i._attributes;if(!u)return null;if(l===!0){let g={...u};if(u.id!=null)g.id=String(u.id);return g}let m={},p=l.displayable?.length?l.displayable:[...l.searchable??[],...l.filterable??[],...l.sortable??[],"id"],_=l.denormalize??{},k=i._relations;for(let g of p){let y=H(g),R=u[y]??u[g];if(R!==void 0){m[y]=R;continue}let v=_[g]??_[y];if(v){m[y]=qu(k,v);continue}m[y]=void 0}if(u.id!=null)m.id=String(u.id);return m};if(typeof r==="string"&&!Ei.has(r)){let a=i._attributes;if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r];let c=i._relations;if(c&&Object.prototype.hasOwnProperty.call(c,r)){let u=c[r];if(Array.isArray(u))return u.map((m)=>D(m,t));return D(u,t)}let l=Eu[r];if(l){let p=i._definition?.__traitMethods?.[l.bag]?.[r];if(typeof p==="function")return l.mode==="model"?(..._)=>p(o,..._):(..._)=>p(i.id,..._)}if(a){let u=H(r);if(u!==r&&Object.prototype.hasOwnProperty.call(a,u))return a[u]}}let s=Reflect.get(i,r,i);return typeof s==="function"?s.bind(i):s},set(i,r,o,s){if(typeof r==="string"&&!Ei.has(r)){let{_attributes:a,set:c}=i;if(a&&Object.prototype.hasOwnProperty.call(a,r)){if(typeof c==="function")c.call(i,r,o);else a[r]=o;return!0}if(a){let l=H(r);if(l!==r&&Object.prototype.hasOwnProperty.call(a,l)){if(typeof c==="function")c.call(i,l,o);else a[l]=o;return!0}}if(a&&!(r in i)){if(typeof c==="function")c.call(i,r,o);else a[r]=o;return!0}}return Reflect.set(i,r,o,s)},has(i,r){if(typeof r==="string"&&!Ei.has(r)){let o=i._attributes;if(o&&Object.prototype.hasOwnProperty.call(o,r))return!0;let s=i._relations;if(s&&Object.prototype.hasOwnProperty.call(s,r))return!0;if(o){let a=H(r);if(a!==r&&Object.prototype.hasOwnProperty.call(o,a))return!0}}return Reflect.has(i,r)},deleteProperty(i,r){if(typeof r==="string"&&!Ei.has(r)){let o=i._attributes;if(o&&Object.prototype.hasOwnProperty.call(o,r))return delete o[r],!0}return Reflect.deleteProperty(i,r)},ownKeys(i){let r=i._attributes;return r?Object.keys(r):[]},getOwnPropertyDescriptor(i,r){if(typeof r==="string"){let o=i._attributes;if(o&&Object.prototype.hasOwnProperty.call(o,r))return{configurable:!0,enumerable:!0,value:o[r],writable:!0}}return Object.getOwnPropertyDescriptor(i,r)}})}var Ou=new Set(["get","first","last","firstOrFail","find","findOrFail","all","paginate","simplePaginate","cursorPaginate"]),Au={paginate:Yi,simplePaginate:Zi,cursorPaginate:er},xc=Symbol.for("stacks.queryBuilderProxy");function $c(e,t){if(!e||typeof e!=="object")return e;if(e[xc])return e;return new Proxy(e,{get(n,i,r){if(i===xc)return!0;let o=Reflect.get(n,i,r);if(typeof o!=="function")return o;return function(...s){let a=s,c=String(i);if(c==="paginate"||c==="simplePaginate"){let{perPage:m,page:p}=nr(s[0],s[1]);a=[m,p]}else if(c==="cursorPaginate"){let{perPage:m,cursor:p}=ir(s[0],s[1]);a=[m,p,s[2],s[3]]}let l=o.apply(n,a),u=(m)=>{if(Ou.has(c)){if(Array.isArray(m))return m.map((_)=>D(_,t));let p=Au[c];if(p&&m&&Array.isArray(m.data)){let _=m.data.map((g)=>D(g,t)),k=p({...m,data:_});return rr(k)}if(m&&Array.isArray(m.data))return{...m,data:m.data.map((_)=>D(_,t))};return D(m,t)}if(m&&typeof m==="object"&&typeof m.get==="function")return $c(m,t);return m};if(l&&typeof l.then==="function")return l.then(u);return u(l)}}})}function Iu(e,t){let n=["find","first","last","all","firstOrFail","findOrFail","findMany"];for(let o of n){let s=e[o];if(typeof s!=="function")continue;e[o]=function(...a){let c=s.apply(this,a),l=(u)=>Array.isArray(u)?u.map((m)=>D(m,t)):D(u,t);if(c&&typeof c.then==="function")return c.then(l);return l(c)}}let i=["create","firstOrCreate","updateOrCreate","make"];for(let o of i){let s=e[o];if(typeof s!=="function")continue;e[o]=function(...a){let c=s.apply(this,a),l=(u)=>Array.isArray(u)?u.map((m)=>D(m,t)):D(u,t);if(c&&typeof c.then==="function")return c.then(l);return l(c)}}let r=["query","where","orWhere","whereIn","whereNotIn","whereNull","whereNotNull","whereLike","whereBetween","whereNotBetween","orderBy","orderByDesc","select","with","limit","take","skip","latest","oldest"];for(let o of r){let s=e[o];if(typeof s!=="function")continue;e[o]=function(...a){let c=s.apply(this,a);return $c(c,t)}}}class Uc extends Error{model;id;constructor(e,t){super(t!=null?`[ORM] ${e} not found for id=${String(t)}`:`[ORM] No matching ${e} row`);this.name="ModelNotFoundError",this.model=e,this.id=t}}class Ua extends Error{model;attribute;reason;constructor(e,t,n){let i=n==="guarded"?`'${t}' is marked guarded`:`'${t}' is not in the fillable allowlist`;super(`[ORM] Mass assignment to ${e} forbidden: ${i}. Use ${e}.forceCreate(...) / .forceUpdate(...) to bypass.`);this.name="MassAssignmentException",this.model=e,this.attribute=t,this.reason=n}}var $u=new Set(["id","created_at","updated_at","deleted_at","uuid"]);function ii(e,t,n={}){if(n.force)return t;if(!t||typeof t!=="object"||Array.isArray(t))return t;let i=e.attributes;if(!i)return t;let r=new Set,o=new Set,s=new Set;for(let[c,l]of Object.entries(i)){let u=H(c);if(r.add(u),l?.fillable===!0)o.add(u);if(l?.guarded===!0)s.add(u)}let a=o.size>0?o:r;for(let c of Object.keys(t)){let l=H(c);if($u.has(l))continue;if(s.has(l))throw new Ua(e.name,c,"guarded");if(l.endsWith("_id"))continue;if(!a.has(l))throw new Ua(e.name,c,"not-fillable")}return t}async function Ma(e,t){let n=e.set;if(!n||typeof n!=="object")return t;let i={...t};for(let[r,o]of Object.entries(n)){if(typeof o!=="function"||!(r in i))continue;try{i[r]=await o(i)}catch(s){A.error(`[orm] ${e.name}.set.${r} threw - skipping setter`,s)}}return i}function Uu(e,t){let n=t.primaryKey||"id",i=e.create;function r(l){let u=e.where;if(typeof u!=="function")throw Error(`[ORM] ${t.name}.${l} needs a working where(): the underlying query builder did not expose one`);return u}function o(l){let u=e.find;if(typeof u!=="function")throw Error(`[ORM] ${t.name}.${l} needs a working find(): the underlying query builder did not expose one`);return u}function s(l){let u=e.create;if(typeof u!=="function")throw Error(`[ORM] ${t.name}.${l} cannot create: the underlying query builder did not expose create()`);return u}if(typeof e.update!=="function")e.update=async function(l,u){if(l==null)throw Error(`[ORM] ${t.name}.update requires an id as the first argument`);if(!u||typeof u!=="object"||Array.isArray(u))throw Error(`[ORM] ${t.name}.update requires a data object as the second argument`);if(Object.keys(u).length===0){A.debug(`[orm] ${t.name}.update called with empty data - short-circuiting and returning current row`);let _=e.find;return typeof _==="function"?await _.call(e,l):null}ii(t,u);let m=await Ma(t,u);await r("update").call(e,n,l).update(m);let p=e.find;return typeof p==="function"?await p.call(e,l):null};if(typeof e.forceUpdate!=="function")e.forceUpdate=async function(l,u){if(l==null)throw Error(`[ORM] ${t.name}.forceUpdate requires an id as the first argument`);if(!u||typeof u!=="object"||Array.isArray(u))throw Error(`[ORM] ${t.name}.forceUpdate requires a data object as the second argument`);let m=await Ma(t,u);await r("forceUpdate").call(e,n,l).update(m);let p=e.find;return typeof p==="function"?await p.call(e,l):null};if(typeof e.forceCreate!=="function")e.forceCreate=async function(l){if(!l||typeof l!=="object"||Array.isArray(l))throw Error(`[ORM] ${t.name}.forceCreate requires a data object`);let u=e.make;if(typeof u==="function"){let m=await u.call(e);if(m&&typeof m.forceFill==="function"&&typeof m.save==="function")return m.forceFill(l),await m.save()??m}if(typeof i!=="function")throw Error(`[ORM] ${t.name}.forceCreate cannot create: the underlying query builder did not expose create()`);return await i.call(e,l)};if(typeof e.delete!=="function")e.delete=async function(l){if(l==null)throw Error(`[ORM] ${t.name}.delete requires an id as the first argument`);if(!await o("delete").call(e,l))return!1;return await r("delete").call(e,n,l).delete(),!0};if(typeof e.findOrFail!=="function")e.findOrFail=async function(l){let u=await o("findOrFail").call(e,l);if(u==null)throw new Uc(t.name,l);return u};if(typeof e.exists!=="function")e.exists=async function(l){if(l==null)return!1;let u=r("exists").call(e,n,l);if(typeof u.count==="function"){let p=await u.count();return Number(p)>0}let m=e.find;return typeof m==="function"?await m.call(e,l)!=null:!1};if(typeof e.firstOrCreate!=="function")e.firstOrCreate=async function(l,u={}){if(!l||typeof l!=="object"||Array.isArray(l))throw Error(`[ORM] ${t.name}.firstOrCreate requires a where-attrs object`);let m=r("firstOrCreate").call(e,l),p=typeof m.first==="function"?await m.first():await m;if(p)return p;let _={...l,...u};return ii(t,_),await s("firstOrCreate").call(e,_)};if(typeof e.updateOrCreate!=="function")e.updateOrCreate=async function(l,u){if(!l||typeof l!=="object"||Array.isArray(l))throw Error(`[ORM] ${t.name}.updateOrCreate requires a where-attrs object`);if(!u||typeof u!=="object"||Array.isArray(u))throw Error(`[ORM] ${t.name}.updateOrCreate requires a values object`);let m=r("updateOrCreate").call(e,l),p=typeof m.first==="function"?await m.first():await m;if(p){ii(t,u);let k=p[n];await r("updateOrCreate").call(e,n,k).update(u);let g=e.find;return typeof g==="function"?await g.call(e,k):{...p,...u}}let _={...l,...u};return ii(t,_),await s("updateOrCreate").call(e,_)};if(typeof e.count!=="function")e.count=async function(){let l=e;if(typeof l.query==="function"){let p=l.query();if(typeof p?.count==="function"){let _=await p.count();return Number(_)||0}}let{all:u,get:m}=e;if(typeof u==="function")return(await u.call(e)||[]).length;if(typeof m==="function")return(await m.call(e)||[]).length;return 0};if(typeof e.pluck!=="function")e.pluck=async function(l){if(!l||typeof l!=="string")throw Error(`[ORM] ${t.name}.pluck requires a column name`);let u=e.all;return((typeof u==="function"?await u.call(e):[])||[]).map((p)=>p?.[l])};if(typeof e.whereIn!=="function")e.whereIn=async function(l,u){if(!l||typeof l!=="string")throw Error(`[ORM] ${t.name}.whereIn requires a column name`);if(!Array.isArray(u))throw Error(`[ORM] ${t.name}.whereIn requires an array of values`);if(u.length===0)return[];let m=e.where;if(typeof m!=="function")return[];let p=m.call(e,l,"in",u);if(p&&typeof p.get==="function")return await p.get();return await p};let a=[["latest","desc"],["oldest","asc"]];for(let[l,u]of a)if(typeof e[l]!=="function")e[l]=async function(m="created_at"){let p=e,_=typeof p.query==="function"?p.query():p;if(typeof _?.orderBy==="function"){let R=_.orderBy(m,u);if(typeof R.first==="function")return await R.first();if(typeof R.get==="function")return(await R.get())?.[0]??null}let k=e.all;if(typeof k!=="function")return null;return[...await k.call(e)||[]].sort((R,v)=>{let x=R?.[m],P=v?.[m];if(x===P)return 0;return(x>P?1:-1)*(u==="desc"?-1:1)})[0]??null};let c=Fc(t.traits?.useSearch,t);if(c){let l=c.index??t.table??H(`${t.name}s`);if(typeof e.search!=="function")e.search=function(u,m){return Nu(e,l,u,m,c.searchable)};if(typeof e.makeAllSearchable!=="function")e.makeAllSearchable=async function(u=500){let m=e.all;if(typeof m!=="function")throw Error(`[ORM] ${t.name}.makeAllSearchable cannot run: the underlying query builder did not expose all()`);let{useSearchEngine:p}=await import("@stacksjs/search-engine"),_=p(),k=0,g=e.query;if(typeof g==="function")try{let v=g.call(e);if(v&&typeof v.chunk==="function")return await v.chunk(u,async(x)=>{let P=await Da(x,c);if(P.length>0)await _.addDocuments(l,P);k+=P.length}),k}catch{}let y=await m.call(e)||[],R=await Da(y,c);if(R.length>0)await _.addDocuments(l,R);return R.length};if(typeof e.removeAllFromSearch!=="function")e.removeAllFromSearch=async function(){let{useSearchEngine:u}=await import("@stacksjs/search-engine"),m=u();if(typeof m.deleteAllDocuments==="function"){await m.deleteAllDocuments(l);return}let p=e.all,_=typeof p==="function"?await p.call(e)||[]:[],k=u();for(let g of _){let y=g?.id??g?._attributes?.id;if(y!=null)await k.deleteDocument(l,Number(y))}}}}async function Da(e,t){if(e.length===0)return[];if(typeof t.shapeMany==="function"){let i=await t.shapeMany(e);if(!Array.isArray(i)||i.length!==e.length)throw TypeError(`[orm/search] shapeMany returned ${Array.isArray(i)?i.length:typeof i} documents for ${e.length} rows. It must return one document per row, in order, or documents are indexed under the wrong ids.`);return i.filter(Boolean)}return(await Promise.all(e.map((i)=>Fu(i,t)))).filter(Boolean)}function Mu(e){let t=new Set,n=e.attributes??{};for(let[i,r]of Object.entries(n))if(r?.hidden)t.add(i);return t}function Du(e,t){if(!e||t.size===0)return e;let n={};for(let[i,r]of Object.entries(e))if(!t.has(i))n[i]=r;return n}async function Fu(e,t){if(typeof t.shape==="function")try{return await t.shape(e)}catch{return}let n=e?.toSearchableObject?.();if(n!==void 0)return n;return Du(e?._attributes??(typeof e?.toJSON==="function"?e.toJSON():null),t.hidden??new Set)}function Nu(e,t,n,i,r){let o=r&&r.length>0?{query_by:[...r].join(",")}:{},s={q:n,...o,...i??{}},a={with(c){return s={...s,...c},a},where(c){return s={...s,filter:c},a},async get(){let{useSearchEngine:c}=await import("@stacksjs/search-engine");return(await c().search(t,s))?.hits??[]},async paginate(c,l=1){let{useSearchEngine:u}=await import("@stacksjs/search-engine"),p=await u().search(t,{...s,limit:c,offset:(l-1)*c});return{hits:p.hits??[],total:Number(p.estimatedTotalHits??p.nbHits??p.total??0),page:l,perPage:c}},async raw(){let{useSearchEngine:c}=await import("@stacksjs/search-engine");return await c().search(t,s)}};return a}function Mc(e){let t=H(e);return t===e?[e]:[e,t]}async function $a(e,t){if(!e||typeof e!=="object")return;let n=e._attributes??e;for(let i of t)for(let r of Mc(i)){if(!(r in n))continue;let o=n[r];if(!ue(o))continue;n[r]=await $i(o)}}function Gu(e,t){if(t.length===0)return;let n=async(a)=>{if(Array.isArray(a)){for(let c of a)await $a(c,t);return a}if(a&&typeof a==="object"&&Array.isArray(a.data)){for(let c of a.data)await $a(c,t);return a}if(a)await $a(a,t);return a},i=["find","first","last","all","firstOrFail","findOrFail","findMany"];for(let a of i){let c=e[a];if(typeof c!=="function")continue;e[a]=async function(...l){let u=await c.apply(this,l);return await n(u)}}let r=["create","firstOrCreate","updateOrCreate","make"];for(let a of r){let c=e[a];if(typeof c!=="function")continue;e[a]=async function(...l){let u=await c.apply(this,l);return await n(u)}}for(let a of["update","forceUpdate"]){let c=e[a];if(typeof c!=="function")continue;e[a]=async function(l,u){let m=await c.call(this,l,u);return await n(m)}}let o=["first","firstOrFail","get","all","find","findOrFail","last","paginate","simplePaginate"],s=(a)=>{if(!a||typeof a!=="object")return a;let c=a;if(c.__stacksEncryptedReads)return a;for(let l of o){let u=c[l];if(typeof u!=="function")continue;c[l]=async function(...m){return await n(await u.apply(this,m))}}for(let l of["where","whereIn","whereNull","whereNotNull","orWhere","orderBy","orderByDesc","limit","offset","with"]){let u=c[l];if(typeof u!=="function")continue;c[l]=function(...m){return s(u.apply(this,m))}}return Object.defineProperty(c,"__stacksEncryptedReads",{value:!0,enumerable:!1}),a};for(let a of["where","whereIn","whereNull","whereNotNull","orderBy","orderByDesc","limit","query"]){let c=e[a];if(typeof c!=="function")continue;e[a]=function(...l){return s(c.apply(this,l))}}}function Bu(e,t){if(t.length===0)return;let n=async(r)=>{if(!r||typeof r!=="object"||Array.isArray(r))return r;let o={...r};for(let s of t)for(let a of Mc(s))if(a in o)o[a]=await Ii(o[a]);return o},i=["create","firstOrCreate","updateOrCreate","forceCreate"];for(let r of i){let o=e[r];if(typeof o!=="function")continue;e[r]=async function(...s){if(s[0]=await n(s[0]),s[1])s[1]=await n(s[1]);return await o.apply(this,s)}}for(let r of["update","forceUpdate"]){let o=e[r];if(typeof o!=="function")continue;e[r]=async function(s,a){let c=await n(a);return await o.call(this,s,c)}}}function Lu(e,t){let n=e.create;if(typeof n==="function")e.create=async function(i,...r){ii(t,i);let o=await Ma(t,i);return await n.call(this,o,...r)};for(let i of["firstOrCreate","updateOrCreate"]){let r=e[i];if(typeof r!=="function")continue}}function Ku(e,t){let n=String(t?.name??e.name??"Model"),i=(s,a)=>{if(xu())return;if(!s||typeof s!=="object"||Array.isArray(s))return;let c=Ya(s,t,a);if(!c.valid)throw new Ac(n,c.errors)},r=e.create;if(typeof r==="function")e.create=async function(s,...a){return i(s,"creating"),await r.call(this,s,...a)};let o=e.update;if(typeof o==="function")e.update=async function(s,a,...c){return i(a,"updating"),await o.call(this,s,a,...c)}}function Hu(e,t){let n=["create","firstOrCreate","updateOrCreate"];for(let r of n){let o=e[r];if(typeof o==="function")e[r]=async function(...s){if(A.debug(`[orm] ${r.charAt(0).toUpperCase()+r.slice(1)} ${String(e.name||"unknown")}`,s[0]),s[0]&&typeof s[0]==="object"&&!Array.isArray(s[0]))s[0]=vc(s[0],t,"set");return await o.apply(this,s)}}let i=e.update;if(typeof i==="function")e.update=async function(r,o){let s=o&&typeof o==="object"&&!Array.isArray(o)?vc(o,t,"set"):o;return await i.call(this,r,s)}}function Dc(e){A.debug(`[orm] Defining model: ${e.name} (table: ${e.table})`);let t=Vu(e),n=Wu(e),i=zu(t,n),r=Qu(e);e.__traitMethods=r;let o=i?{...e,hooks:{...e.hooks,...i}}:e,a=vu(o);if(Iu(a,e.casts),Uu(a,o),Lu(a,o),e.casts&&Object.keys(e.casts).length>0)Hu(a,e.casts);let c=Ui(e);if(c.length>0)Bu(a,c),Gu(a,c);let l=e.traits?.useSoftDeletes;if(l)Ju(a,o,l);let u=e.traits?.useAudit;if(u){let p=za(u);Wa(a,e.name,e.primaryKey||"id",p)}Ku(a,o),a.withoutValidation=function(p){return Cu(p)},a.withoutEvents=function(p){return ee(p)};for(let p of["create","update","firstOrCreate","updateOrCreate","forceCreate","forceUpdate","delete","forceDelete","softDelete","restore"]){let _=a[p];if(typeof _!=="function")continue;let k=`${p}Quietly`;if(typeof a[k]==="function")continue;a[k]=function(...g){return ee(()=>_.apply(a,g))}}let m=Object.assign(a,r,{...e,getDefinition:()=>e,_isStacksModel:!0});return Su(e.name,m),Object.defineProperty(m,Fa,{value:e,enumerable:!1,configurable:!0}),m}function Vu(e){let t=e.traits?.observe;if(!t)return;let n=e.name.toLowerCase(),i=(p)=>{let _=p?.attributes;if(!_||typeof _!=="object")return p;let k=e.primaryKey||"id",g={..._};if(g[k]===void 0&&p[k]!==void 0)g[k]=p[k];return g},r=async(p,_)=>{if(te())return;try{let{dispatch:k}=await import("@stacksjs/events");await k(p,_)}catch(k){if(k&&typeof k==="object"&&"code"in k&&k.code==="MODULE_NOT_FOUND")return;if(console.error(`[ORM] Event '${p}' handler error:`,k),process.env.STACKS_ORM_EVENT_ERRORS!=="swallow")throw k}},o=e.traits?.broadcastOn,s=e.traits?.broadcastWith,a=typeof o==="function"&&typeof s==="function",c=async(p,_)=>{if(!a)return;if(te())return;try{let k=o(_),g=Array.isArray(k)?k:[k],y=s(_),v=(await import("@stacksjs/realtime").catch(()=>null))?.broadcast;if(typeof v!=="function")return;for(let x of g){if(typeof x!=="string"||x.length===0)continue;await v(x,p,y)}}catch(k){if(k&&typeof k==="object"&&"code"in k&&k.code==="MODULE_NOT_FOUND")return;if(console.error(`[ORM] Broadcast '${p}' handler error:`,k),process.env.STACKS_ORM_BROADCAST_ERRORS==="throw")throw k}},l=async(p,_)=>{if(te())return!0;try{let{dispatchAsync:k}=await import("@stacksjs/events"),g=await k(p,_);if(Array.isArray(g)&&g.some((y)=>y===!1))return!1}catch(k){if(k&&typeof k==="object"&&"code"in k&&k.code==="MODULE_NOT_FOUND")return!0;if(console.error(`[ORM] Before-event '${p}' handler error:`,k),process.env.STACKS_ORM_EVENT_ERRORS!=="swallow")throw k}return!0},u=t===!0?["create","update","delete"]:Array.isArray(t)?t:[],m={};if(u.includes("create"))m.beforeCreate=async(p)=>{if(A.debug(`[orm] Create ${n}`,p),!await l(`${n}:saving`,p))throw Error(`[ORM] ${n}:saving event cancelled the operation`);if(!await l(`${n}:creating`,p))throw Error(`[ORM] ${n}:creating event cancelled the operation`)},m.afterCreate=async(p)=>{let _=i(p);await r(`${n}:created`,_),await r(`${n}:saved`,_),await c(`${n}:created`,p)};if(u.includes("update"))m.beforeUpdate=async(p)=>{if(A.debug(`[orm] Update ${n}#${p?.id??"unknown"}`,p),!await l(`${n}:saving`,p))throw Error(`[ORM] ${n}:saving event cancelled the operation`);if(!await l(`${n}:updating`,p))throw Error(`[ORM] ${n}:updating event cancelled the operation`)},m.afterUpdate=async(p)=>{let _=i(p);await r(`${n}:updated`,_),await r(`${n}:saved`,_),await c(`${n}:updated`,p)};if(u.includes("delete"))m.beforeDelete=async(p)=>{if(A.debug(`[orm] Delete ${n}#${p?.id??"unknown"}`),!await l(`${n}:deleting`,p))throw Error(`[ORM] ${n}:deleting event cancelled the operation`)},m.afterDelete=async(p)=>{await r(`${n}:deleted`,i(p)),await c(`${n}:deleted`,p)};return m}function zu(...e){let t={},n=new Set;for(let i of e){if(!i)continue;for(let r of Object.keys(i))n.add(r)}for(let i of n){let r=e.map((o)=>o?.[i]).filter((o)=>typeof o==="function");if(!r.length)continue;t[i]=async(...o)=>{for(let s of r)await s(...o)}}return Object.keys(t).length?t:void 0}function Fc(e,t){if(!e)return null;let n=e===!0?{}:typeof e==="object"?{...e}:null;if(!n)return null;if(t)n.hidden=Mu(t);return n}function Wu(e){let t=Fc(e.traits?.useSearch,e);if(!t)return;let n=t,i=n.index??e.table??H(`${e.name}s`);async function r(a){if(typeof n.shapeMany==="function")try{let[u]=await Da([a],n);return u}catch(u){A.warn(`[orm/search] shapeMany() threw for ${e.name}: ${u.message}`);return}if(typeof n.shape==="function")try{return await n.shape(a)}catch(u){A.warn(`[orm/search] shape() threw for ${e.name}: ${u.message}`);return}let l=D(a).toSearchableObject?.();if(l!==void 0)return l;return a?._attributes??(typeof a?.toJSON==="function"?a.toJSON():null)}let o=async(a)=>{if(te())return;let c=await r(a);if(!c)return;if(t.queueable){try{let{Jobs:l}=await import("@stacksjs/queue");await l.dispatch("SyncSearchIndex",{index:i,op:"upsert",doc:c})}catch(l){A.warn(`[orm/search] queue dispatch failed for ${e.name}; falling back to inline: ${l.message}`),await jc(i,c,e.name)}return}await jc(i,c,e.name)};return{afterCreate:o,afterUpdate:o,afterDelete:async(a)=>{if(te())return;let c=a?.id??a?._attributes?.id;if(c==null)return;if(t.queueable){try{let{Jobs:l}=await import("@stacksjs/queue");await l.dispatch("SyncSearchIndex",{index:i,op:"delete",id:Number(c)})}catch(l){A.warn(`[orm/search] queue dispatch failed for ${e.name}#${c}; falling back to inline: ${l.message}`),await Pc(i,Number(c),e.name)}return}await Pc(i,Number(c),e.name)}}}var Cc=new Map;function Nc(e,t){let n=Cc.get(e)??0;if(Cc.set(e,n+1),n===0)A.warn(`[orm/search] ${t}`);else if(n===9)A.warn(`[orm/search] ${e} is still failing; further identical warnings suppressed for this process.`)}async function jc(e,t,n){try{let{useSearchEngine:i}=await import("@stacksjs/search-engine");await i().addDocument(e,t)}catch(i){Nc(`index:${n}`,`Failed to index ${n}: ${i.message}`)}}async function Pc(e,t,n){try{let{useSearchEngine:i}=await import("@stacksjs/search-engine");await i().deleteDocument(e,t)}catch(i){Nc(`remove:${n}`,`Failed to remove ${n}#${t}: ${i.message}`)}}function Qu(e){let t={},n=e.table,i=e.traits;if(!i)return t;if(i.taggable)t._taggable=Li(n);if(i.categorizable)t._categorizable=Ki(n);if(i.commentable)t._commentable=Gi(n);if(i.billable)t._billable=hc(n);if(i.likeable){let o=typeof i.likeable==="object"?i.likeable:void 0;t._likeable=Hi(n,o)}let r=i.useAuth||i.authenticatable;if(typeof r==="object"&&r&&"useTwoFactor"in r&&r.useTwoFactor)t._twoFactor=yc();return t}function Ju(e,t,n){let i=Rc(e,t.primaryKey||"id"),r=Tc(n),o=t,s=t.name.toLowerCase(),a=t.traits?.observe!=null&&t.traits?.observe!==!1,c=async(_)=>{if(!a||te())return!0;try{let{dispatchAsync:k}=await import("@stacksjs/events"),g=await k(`${s}:restoring`,{id:_});if(Array.isArray(g)&&g.some((y)=>y===!1))return!1}catch(k){if(k?.code!=="MODULE_NOT_FOUND")console.error(`[ORM] Before-event '${s}:restoring' handler error:`,k)}return!0},l=async(_)=>{if(!a||te())return;try{let{dispatch:k}=await import("@stacksjs/events");await k(`${s}:restored`,{id:_})}catch(k){if(k?.code!=="MODULE_NOT_FOUND")console.error(`[ORM] Event '${s}:restored' handler error:`,k)}},u=process.env.STACKS_ORM_CASCADE_SWALLOW!=="true",m=async(_)=>{if(!r.cascade?.length||!u){let g=await i.softDelete(_);if(g&&r.cascade?.length)await ni(o,r,_,"softDelete");return g}let{db:k}=await import("@stacksjs/database");return await k.transaction(async()=>{let g=await i.softDelete(_);if(g)await ni(o,r,_,"softDelete");return g})},p=async(_)=>{if(!await c(_))return!1;if(!r.cascade?.length||!u){let R=await i.restore(_);if(R){if(r.cascade?.length)await ni(o,r,_,"restore");await l(_)}return R}let{db:g}=await import("@stacksjs/database"),y=await g.transaction(async()=>{let R=await i.restore(_);if(R)await ni(o,r,_,"restore");return R});if(y)await l(_);return y};e.softDelete=m,e.restore=p,e.forceDelete=i.forceDelete,e.withTrashed=i.withTrashed,e.onlyTrashed=i.onlyTrashed,e.delete=m}function Xu(e){if(e==null)return e;if(Array.isArray(e))return e.map(Xu);if(typeof e!=="object")return e;if(typeof e.toJSON==="function")return e.toJSON();if(e._attributes&&typeof e._attributes==="object")return e._attributes;return e}var Yu=["belongsTo","hasOne","hasMany","belongsToMany","morphMany","morphOne"],Zu=["traits","dashboard"];function em(e){let t=e?.[Fa];if(t&&typeof t==="object")return t;if(e&&typeof e==="object"&&"name"in e&&"attributes"in e)return e;throw TypeError("extendModel() expects a model created by defineModel(), or a model definition. Import the framework model itself rather than its table name.")}function tm(e,t){let n=Array.isArray(e)?e:[],i=Array.isArray(t)?t:[];if(!n.length&&!i.length)return;return[...new Set([...n,...i])]}function nm(e){if(!e)return 0;return Object.values(e).reduce((t,n)=>{let i=Number(n?.order);return Number.isFinite(i)&&i>t?i:t},0)}function im(e,t){let n={...e,...t},i=e.attributes??{},r=t.attributes??{};if(t.attributes){let o=nm(i),s=Object.fromEntries(Object.entries(r).map(([a,c])=>{let l=!(a in i),u=Number.isFinite(Number(c?.order));if(l&&!u)return[a,{...c,order:++o}];return[a,c]}));n.attributes={...i,...s}}for(let o of Yu){let s=tm(e[o],t[o]);if(s)n[o]=s}for(let o of Zu){let s=e[o],a=t[o];if(s&&a&&typeof s==="object"&&typeof a==="object")n[o]={...s,...a}}return n}function yj(e,t){return Dc(im(em(e),t))}import{log as rm}from"@stacksjs/logging";import{path as V}from"@stacksjs/path";import{fs as ri}from"@stacksjs/storage";function Q(e){return e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()}function om(e){let t=e.default;if(typeof t==="boolean")return"boolean";if(typeof t==="number")return"number";if(typeof t==="string")return"string";return"unknown"}function sm(e){let t=e.validation;if(!t||typeof t!=="object")return null;let n=t.rule;return n&&typeof n==="object"?n:null}function am(e){if(!e||String(e.name??"")!=="enum")return null;let n=(Array.isArray(e.allowedValues)?e.allowedValues:[]).filter((i)=>typeof i==="string"||typeof i==="number").map((i)=>typeof i==="number"?String(i):JSON.stringify(i));return n.length>0?n.join(" | "):null}function lm(e){let t=sm(e),n=am(t);if(n!==null)return e.nullable===!0?`${n} | null`:n;let i=typeof e.type==="string"?e.type.toLowerCase():String(t?.name??"").toLowerCase(),r=(()=>{switch(i){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"password":case"time":case"year":return"string";case"number":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";case"unix":return"number";case"array":return"unknown[]";case"object":return"Record<string, unknown>";default:return om(e)}})();return e.nullable===!0?`${r} | null`:r}function cm(e){let t={},n=e.belongsTo;if(!n)return t;let i=Array.isArray(n)?n:Object.values(n);for(let r of i){if(typeof r==="string"){t[`${Q(r)}_id`]="number";continue}if(r&&typeof r==="object"){let o=r;if(typeof o.foreignKey==="string"){t[o.foreignKey]="number";continue}if(typeof o.model==="string")t[`${Q(o.model)}_id`]="number"}}return t}function dm(e,t){let[n,i]=[Q(e),Q(t)].sort();return`${n}_${i}`}function um(e){let t=e.default,n=typeof t==="string"?"string":typeof t==="number"?"number":typeof t==="boolean"?"boolean":t instanceof Date?"string":"unknown";return e.nullable?`${n} | null`:n}function mm(e,t){let n=t.belongsToMany;if(!n)return[];let i=[],r=Array.isArray(n)?n:Object.values(n);for(let o of r){let s,a,c,l,u={},m=!0;if(typeof o==="string")s=o;else if(o&&typeof o==="object"&&"model"in o){let y=o;if(s=y.model,"pivotTable"in y||"firstForeignKey"in y||"secondForeignKey"in y)a=y.pivotTable,c=y.firstForeignKey,l=y.secondForeignKey;else{let R=o;a=R.table,c=R.foreignKey,l=R.relatedKey,u=R.pivot?.columns??{},m=Boolean(R.pivot?.timestamps)}}else continue;let p=a??dm(e,s),_=c??`${Q(e)}_id`,k=l??`${Q(s)}_id`,g={id:"number",[_]:"number",[k]:"number"};for(let[y,R]of Object.entries(u))g[y]=um(R);if(m)g.created_at="string",g.updated_at="string | null";i.push({table:p,columns:g})}return i}var pm={email_verified_at:"string | null",password_changed_at:"string | null",two_factor_secret:"string | null",two_factor_enabled:"boolean | null",two_factor_last_used_step:"number | null",stripe_id:"string | null"};function fm(e){let t={id:"number"},n=e.traits??{};if(n.useUuid)t.uuid="string";if((n.useTimestamps??n.timestampable)!==!1)t.created_at="string",t.updated_at="string | null";if(n.useSoftDeletes??n.softDeletable)t.deleted_at="string | null";if((e.table??"")==="users"||e.name==="User")Object.assign(t,pm);return t}function _m(e){let t={},n=e.attributes??{};for(let[i,r]of Object.entries(n))t[Q(i)]=lm(r);return t}function km(e){return e.replace(/_([a-z0-9])/g,(t,n)=>n.toUpperCase())}function bm(e){let t={...e};for(let[n,i]of Object.entries(e)){let r=km(n);if(r!==n&&!(r in t))t[r]=i}return t}function Gc(e,t,n=2){let i=" ".repeat(n),r=" ".repeat(n+1),o=Object.entries(t).map(([a,c])=>`${r}${a}: ${c}`).join(`
14
+ `+P})}let U=Math.floor((typeof R==="number"?R:Date.now())/1000)-p.timestamp;if(k>0&&U>k)throw new N(m,u,{message:"Timestamp outside the tolerance zone"});return!0}function s(u,m){if(typeof u!=="string")return null;return m=m||n.EXPECTED_SCHEME,u.split(",").reduce((p,_)=>{let k=_.split("=");if(k[0]==="t")p.timestamp=parseInt(k[1],10);if(k[0]===m)p.signatures.push(k[1]);return p},{timestamp:-1,signatures:[]})}let a=null;function c(){if(!a)a=e.createDefaultCryptoProvider();return a}function l(u){if(!u)throw new j({message:"Options are required"});let m=u.timestamp&&Math.floor(u.timestamp)||Math.floor(Date.now()/1000),p=u.scheme||n.EXPECTED_SCHEME,_=u.cryptoProvider||c(),k=`${m}.${u.payload}`;return{...u,timestamp:m,scheme:p,cryptoProvider:_,payloadString:k,generateHeaderString:(y)=>`t=${m},${p}=${y}`}}return t.signature=n,t}var ql=f(()=>{xi();yi()});var qr="2026-06-24.dahlia";function Zd(e,t){for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=n[0].toLowerCase()+n.substring(1),r=new t[n](e);this[i]=r}}function S(e,t){return function(n){return new Zd(n,t)}}var Ce;var Or=f(()=>{b();Ce=class Ce extends d{create(e,t){return this._makeRequest("POST","/v2/core/account_links",e,t)}}});var je;var Ar=f(()=>{b();je=class je extends d{create(e,t){return this._makeRequest("POST","/v2/core/account_tokens",e,t,{requestSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}retrieve(e,t,n){return this._makeRequest("GET",`/v2/core/account_tokens/${encodeURIComponent(e)}`,t,n)}}});var Pe;var Ir=f(()=>{b();Pe=class Pe extends d{list(e,t){return this._makeRequest("GET","/v1/financial_connections/accounts",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/financial_connections/accounts/${encodeURIComponent(e)}`,t,n)}disconnect(e,t,n){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/disconnect`,t,n)}refresh(e,t,n){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/refresh`,t,n)}subscribe(e,t,n){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/subscribe`,t,n)}unsubscribe(e,t,n){return this._makeRequest("POST",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/unsubscribe`,t,n)}listOwners(e,t,n){return this._makeRequest("GET",`/v1/financial_connections/accounts/${encodeURIComponent(e)}/owners`,t,n,{methodType:"list"})}}});var $r;var Ol=f(()=>{b();$r=class $r extends d{list(e,t,n){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(e)}/persons`,t,n,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}})}create(e,t,n){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}/persons`,t,n,{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(e,t,n,i){return this._makeRequest("DELETE",`/v2/core/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i)}retrieve(e,t,n,i){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i,{responseSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}})}update(e,t,n,i){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i,{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 Ur;var Al=f(()=>{b();Ur=class Ur extends d{create(e,t,n){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}/person_tokens`,t,n,{requestSchema:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}})}retrieve(e,t,n,i){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(e)}/person_tokens/${encodeURIComponent(t)}`,n,i)}}});var Ee;var Mr=f(()=>{b();Ol();Al();Ee=class Ee extends d{constructor(e){super(e);this.stripe=e,this.persons=new $r(e),this.personTokens=new Ur(e)}list(e,t){return this._makeRequest("GET","/v2/core/accounts",e,t,{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(e,t){return this._makeRequest("POST","/v2/core/accounts",e,t,{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(e,t,n){return this._makeRequest("GET",`/v2/core/accounts/${encodeURIComponent(e)}`,t,n,{responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}update(e,t,n){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v2/core/accounts/${encodeURIComponent(e)}/close`,t,n,{responseSchema:{kind:"object",fields:{identity:{kind:"object",fields:{individual:{kind:"object",fields:{relationship:{kind:"object",fields:{percent_ownership:{kind:"decimal_string"}}}}}}}}}})}}});var qe;var Dr=f(()=>{b();qe=class qe extends d{list(e,t){return this._makeRequest("GET","/v1/entitlements/active_entitlements",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/entitlements/active_entitlements/${encodeURIComponent(e)}`,t,n)}}});var Oe;var Fr=f(()=>{b();Oe=class Oe extends d{list(e,t){return this._makeRequest("GET","/v1/billing/alerts",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/billing/alerts",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing/alerts/${encodeURIComponent(e)}`,t,n)}activate(e,t,n){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(e)}/activate`,t,n)}archive(e,t,n){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(e)}/archive`,t,n)}deactivate(e,t,n){return this._makeRequest("POST",`/v1/billing/alerts/${encodeURIComponent(e)}/deactivate`,t,n)}}});var Ae;var Nr=f(()=>{b();Ae=class Ae extends d{find(e,t){return this._makeRequest("GET","/v1/tax/associations/find",e,t)}}});var Ie;var Gr=f(()=>{b();Ie=class Ie extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/authorizations",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/issuing/authorizations/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(e)}/approve`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/issuing/authorizations/${encodeURIComponent(e)}/decline`,t,n,{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 $e;var Br=f(()=>{b();$e=class $e extends d{create(e,t){return this._makeRequest("POST","/v1/test_helpers/issuing/authorizations",e,t,{requestSchema:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}}}},responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}capture(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/capture`,t,n,{requestSchema:{kind:"object",fields:{purchase_details:{kind:"object",fields:{fleet:{kind:"object",fields:{reported_breakdown:{kind:"object",fields:{fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},non_fuel:{kind:"object",fields:{gross_amount_decimal:{kind:"decimal_string"}}},tax:{kind:"object",fields:{local_amount_decimal:{kind:"decimal_string"},national_amount_decimal:{kind:"decimal_string"}}}}}}},fuel:{kind:"object",fields:{quantity_decimal:{kind:"decimal_string"},unit_cost_decimal:{kind:"decimal_string"}}},receipt:{kind:"array",element:{kind:"object",fields:{quantity:{kind:"decimal_string"}}}}}}}},responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}expire(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/expire`,t,n,{responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}finalizeAmount(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/finalize_amount`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/fraud_challenges/respond`,t,n,{responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}increment(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/increment`,t,n,{responseSchema:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},transactions:{kind:"array",element:{kind:"object",fields:{purchase_details:{kind:"nullable",inner:{kind:"object",fields:{fleet:{kind:"nullable",inner:{kind:"object",fields:{reported_breakdown:{kind:"nullable",inner:{kind:"object",fields:{fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},non_fuel:{kind:"nullable",inner:{kind:"object",fields:{gross_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}},tax:{kind:"nullable",inner:{kind:"object",fields:{local_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},national_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}}}}},fuel:{kind:"nullable",inner:{kind:"object",fields:{quantity_decimal:{kind:"nullable",inner:{kind:"decimal_string"}},unit_cost_decimal:{kind:"decimal_string"}}}}}}}}}}}}})}reverse(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/authorizations/${encodeURIComponent(e)}/reverse`,t,n,{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 Ue;var Lr=f(()=>{b();Ue=class Ue extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax/calculations/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/tax/calculations",e,t)}listLineItems(e,t,n){return this._makeRequest("GET",`/v1/tax/calculations/${encodeURIComponent(e)}/line_items`,t,n,{methodType:"list"})}}});var Me;var Kr=f(()=>{b();Me=class Me extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/cardholders",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/issuing/cardholders",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/cardholders/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/cardholders/${encodeURIComponent(e)}`,t,n)}}});var De;var Hr=f(()=>{b();De=class De extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/cards",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/issuing/cards",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/cards/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/cards/${encodeURIComponent(e)}`,t,n)}}});var Fe;var Vr=f(()=>{b();Fe=class Fe extends d{deliverCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/deliver`,t,n)}failCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/fail`,t,n)}returnCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/return`,t,n)}shipCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/ship`,t,n)}submitCard(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/cards/${encodeURIComponent(e)}/shipping/submit`,t,n)}}});var Ne;var zr=f(()=>{b();Ne=class Ne extends d{list(e,t){return this._makeRequest("GET","/v1/billing_portal/configurations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/billing_portal/configurations",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing_portal/configurations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/billing_portal/configurations/${encodeURIComponent(e)}`,t,n)}}});var Ge;var Wr=f(()=>{b();Ge=class Ge extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/terminal/configurations/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/terminal/configurations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/terminal/configurations/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/terminal/configurations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/terminal/configurations",e,t)}}});var Be;var Qr=f(()=>{b();Be=class Be extends d{create(e,t){return this._makeRequest("POST","/v1/test_helpers/confirmation_tokens",e,t)}}});var Le;var Jr=f(()=>{b();Le=class Le extends d{create(e,t){return this._makeRequest("POST","/v1/terminal/connection_tokens",e,t)}}});var Ke;var Xr=f(()=>{b();Ke=class Ke extends d{retrieve(e,t){return this._makeRequest("GET","/v1/billing/credit_balance_summary",e,t)}}});var He;var Yr=f(()=>{b();He=class He extends d{list(e,t){return this._makeRequest("GET","/v1/billing/credit_balance_transactions",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing/credit_balance_transactions/${encodeURIComponent(e)}`,t,n)}}});var Ve;var Zr=f(()=>{b();Ve=class Ve extends d{list(e,t){return this._makeRequest("GET","/v1/billing/credit_grants",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/billing/credit_grants",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing/credit_grants/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(e)}`,t,n)}expire(e,t,n){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(e)}/expire`,t,n)}voidGrant(e,t,n){return this._makeRequest("POST",`/v1/billing/credit_grants/${encodeURIComponent(e)}/void`,t,n)}}});var ze;var eo=f(()=>{b();ze=class ze extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/credit_reversals",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/credit_reversals",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/credit_reversals/${encodeURIComponent(e)}`,t,n)}}});var We;var to=f(()=>{b();We=class We extends d{fundCashBalance(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/customers/${encodeURIComponent(e)}/fund_cash_balance`,t,n)}}});var Qe;var no=f(()=>{b();Qe=class Qe extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/debit_reversals",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/debit_reversals",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/debit_reversals/${encodeURIComponent(e)}`,t,n)}}});var Je;var io=f(()=>{b();Je=class Je extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/disputes",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/issuing/disputes",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/disputes/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/disputes/${encodeURIComponent(e)}`,t,n)}submit(e,t,n){return this._makeRequest("POST",`/v1/issuing/disputes/${encodeURIComponent(e)}/submit`,t,n)}}});var Xe;var ro=f(()=>{b();Xe=class Xe extends d{list(e,t){return this._makeRequest("GET","/v1/radar/early_fraud_warnings",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/radar/early_fraud_warnings/${encodeURIComponent(e)}`,t,n)}}});var Ye;var oo=f(()=>{b();Ye=class Ye extends d{list(e,t){return this._makeRequest("GET","/v2/core/event_destinations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v2/core/event_destinations",e,t)}del(e,t,n){return this._makeRequest("DELETE",`/v2/core/event_destinations/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v2/core/event_destinations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(e)}`,t,n)}disable(e,t,n){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(e)}/disable`,t,n)}enable(e,t,n){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(e)}/enable`,t,n)}ping(e,t,n){return this._makeRequest("POST",`/v2/core/event_destinations/${encodeURIComponent(e)}/ping`,t,n)}}});var Ze;var so=f(()=>{b();Ze=class Ze extends d{list(e,t){let n=(i)=>({...i,data:i.data.map(this.addFetchRelatedObjectIfNeeded.bind(this))});return this._makeRequest("GET","/v2/core/events",e,t,{methodType:"list",transformResponseData:n})}retrieve(e,t,n){let i=(r)=>this.addFetchRelatedObjectIfNeeded(r);return this._makeRequest("GET",`/v2/core/events/${encodeURIComponent(e)}`,t,n,{transformResponseData:i})}addFetchRelatedObjectIfNeeded(e){if(!e.related_object||!e.related_object.url)return e;return{...e,fetchRelatedObject:()=>this._makeRequest("GET",e.related_object.url,void 0,{stripeContext:e.context,headers:{"Stripe-Request-Trigger":`event=${e.id}`}})}}}});var et;var ao=f(()=>{b();et=class et extends d{list(e,t){return this._makeRequest("GET","/v1/entitlements/features",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/entitlements/features",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/entitlements/features/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/entitlements/features/${encodeURIComponent(e)}`,t,n)}}});var tt;var lo=f(()=>{b();tt=class tt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/financial_accounts",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/financial_accounts",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}`,t,n)}close(e,t,n){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}/close`,t,n)}updateFeatures(e,t,n){return this._makeRequest("POST",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}/features`,t,n)}retrieveFeatures(e,t,n){return this._makeRequest("GET",`/v1/treasury/financial_accounts/${encodeURIComponent(e)}/features`,t,n)}}});var nt;var co=f(()=>{b();nt=class nt extends d{list(e,t){return this._makeRequest("GET","/v2/commerce/product_catalog/imports",e,t,{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(e,t){return this._makeRequest("POST","/v2/commerce/product_catalog/imports",e,t,{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(e,t,n){return this._makeRequest("GET",`/v2/commerce/product_catalog/imports/${encodeURIComponent(e)}`,t,n,{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 it;var uo=f(()=>{b();it=class it extends d{fail(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(e)}/fail`,t,n)}returnInboundTransfer(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(e)}/return`,t,n)}succeed(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent(e)}/succeed`,t,n)}}});var rt;var mo=f(()=>{b();rt=class rt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/inbound_transfers",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/inbound_transfers",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/inbound_transfers/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/treasury/inbound_transfers/${encodeURIComponent(e)}/cancel`,t,n)}}});var ot;var po=f(()=>{b();ot=class ot extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/terminal/locations/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/terminal/locations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/terminal/locations/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/terminal/locations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/terminal/locations",e,t)}}});var st;var fo=f(()=>{b();st=class st extends d{create(e,t){return this._makeRequest("POST","/v1/billing/meter_event_adjustments",e,t)}}});var at;var _o=f(()=>{b();at=class at extends d{create(e,t){return this._makeRequest("POST","/v2/billing/meter_event_adjustments",e,t)}}});var lt;var ko=f(()=>{b();lt=class lt extends d{create(e,t){return this._makeRequest("POST","/v2/billing/meter_event_session",e,t)}}});var ct;var bo=f(()=>{b();ct=class ct extends d{create(e,t){return this._makeRequest("POST","/v2/billing/meter_event_stream",e,t,{apiBase:"meter_events"})}}});var dt;var go=f(()=>{b();dt=class dt extends d{create(e,t){return this._makeRequest("POST","/v1/billing/meter_events",e,t)}}});var ut;var ho=f(()=>{b();ut=class ut extends d{create(e,t){return this._makeRequest("POST","/v2/billing/meter_events",e,t)}}});var mt;var yo=f(()=>{b();mt=class mt extends d{list(e,t){return this._makeRequest("GET","/v1/billing/meters",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/billing/meters",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/billing/meters/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(e)}`,t,n)}deactivate(e,t,n){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(e)}/deactivate`,t,n)}reactivate(e,t,n){return this._makeRequest("POST",`/v1/billing/meters/${encodeURIComponent(e)}/reactivate`,t,n)}listEventSummaries(e,t,n){return this._makeRequest("GET",`/v1/billing/meters/${encodeURIComponent(e)}/event_summaries`,t,n,{methodType:"list"})}}});var pt;var Ro=f(()=>{b();pt=class pt extends d{create(e,t){return this._makeRequest("POST","/v1/terminal/onboarding_links",e,t)}}});var ft;var To=f(()=>{b();ft=class ft extends d{list(e,t){return this._makeRequest("GET","/v1/climate/orders",e,t,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}}}}})}create(e,t){return this._makeRequest("POST","/v1/climate/orders",e,t,{requestSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}},responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/climate/orders/${encodeURIComponent(e)}`,t,n,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}update(e,t,n){return this._makeRequest("POST",`/v1/climate/orders/${encodeURIComponent(e)}`,t,n,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}cancel(e,t,n){return this._makeRequest("POST",`/v1/climate/orders/${encodeURIComponent(e)}/cancel`,t,n,{responseSchema:{kind:"object",fields:{metric_tons:{kind:"decimal_string"}}}})}}});var _t;var wo=f(()=>{b();_t=class _t extends d{update(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(e)}`,t,n)}fail(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(e)}/fail`,t,n)}post(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(e)}/post`,t,n)}returnOutboundPayment(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(e)}/return`,t,n)}}});var kt;var vo=f(()=>{b();kt=class kt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/outbound_payments",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/outbound_payments",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/outbound_payments/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/treasury/outbound_payments/${encodeURIComponent(e)}/cancel`,t,n)}}});var bt;var So=f(()=>{b();bt=class bt extends d{update(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(e)}`,t,n)}fail(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(e)}/fail`,t,n)}post(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(e)}/post`,t,n)}returnOutboundTransfer(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(e)}/return`,t,n)}}});var gt;var xo=f(()=>{b();gt=class gt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/outbound_transfers",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/treasury/outbound_transfers",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/outbound_transfers/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/treasury/outbound_transfers/${encodeURIComponent(e)}/cancel`,t,n)}}});var ht;var Co=f(()=>{b();ht=class ht extends d{create(e,t){return this._makeRequest("POST","/v1/radar/payment_evaluations",e,t)}}});var yt;var jo=f(()=>{b();yt=class yt extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/personalization_designs",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/issuing/personalization_designs",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/personalization_designs/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/personalization_designs/${encodeURIComponent(e)}`,t,n)}}});var Rt;var Po=f(()=>{b();Rt=class Rt extends d{activate(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(e)}/activate`,t,n)}deactivate(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(e)}/deactivate`,t,n)}reject(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent(e)}/reject`,t,n)}}});var Tt;var Eo=f(()=>{b();Tt=class Tt extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/physical_bundles",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/physical_bundles/${encodeURIComponent(e)}`,t,n)}}});var wt;var qo=f(()=>{b();wt=class wt extends d{list(e,t){return this._makeRequest("GET","/v1/climate/products",e,t,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{metric_tons_available:{kind:"decimal_string"}}}}}}})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/climate/products/${encodeURIComponent(e)}`,t,n,{responseSchema:{kind:"object",fields:{metric_tons_available:{kind:"decimal_string"}}}})}}});var vt;var Oo=f(()=>{b();vt=class vt extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/terminal/readers/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/terminal/readers/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/terminal/readers",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/terminal/readers",e,t)}cancelAction(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/cancel_action`,t,n)}collectInputs(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/collect_inputs`,t,n)}collectPaymentMethod(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/collect_payment_method`,t,n)}confirmPaymentIntent(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/confirm_payment_intent`,t,n)}processPaymentIntent(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/process_payment_intent`,t,n)}processSetupIntent(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/process_setup_intent`,t,n)}refundPayment(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/refund_payment`,t,n)}setReaderDisplay(e,t,n){return this._makeRequest("POST",`/v1/terminal/readers/${encodeURIComponent(e)}/set_reader_display`,t,n)}}});var St;var Ao=f(()=>{b();St=class St extends d{presentPaymentMethod(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(e)}/present_payment_method`,t,n)}succeedInputCollection(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(e)}/succeed_input_collection`,t,n)}timeoutInputCollection(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/terminal/readers/${encodeURIComponent(e)}/timeout_input_collection`,t,n)}}});var xt;var Io=f(()=>{b();xt=class xt extends d{create(e,t){return this._makeRequest("POST","/v1/test_helpers/treasury/received_credits",e,t)}}});var Ct;var $o=f(()=>{b();Ct=class Ct extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/received_credits",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/received_credits/${encodeURIComponent(e)}`,t,n)}}});var jt;var Uo=f(()=>{b();jt=class jt extends d{create(e,t){return this._makeRequest("POST","/v1/test_helpers/treasury/received_debits",e,t)}}});var Pt;var Mo=f(()=>{b();Pt=class Pt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/received_debits",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/treasury/received_debits/${encodeURIComponent(e)}`,t,n)}}});var Et;var Do=f(()=>{b();Et=class Et extends d{expire(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/refunds/${encodeURIComponent(e)}/expire`,t,n)}}});var qt;var Fo=f(()=>{b();qt=class qt extends d{list(e,t){return this._makeRequest("GET","/v1/tax/registrations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/tax/registrations",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax/registrations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/tax/registrations/${encodeURIComponent(e)}`,t,n)}}});var Ot;var No=f(()=>{b();Ot=class Ot extends d{list(e,t){return this._makeRequest("GET","/v1/reporting/report_runs",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/reporting/report_runs",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/reporting/report_runs/${encodeURIComponent(e)}`,t,n)}}});var At;var Go=f(()=>{b();At=class At extends d{list(e,t){return this._makeRequest("GET","/v1/reporting/report_types",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/reporting/report_types/${encodeURIComponent(e)}`,t,n)}}});var It;var Bo=f(()=>{b();It=class It extends d{list(e,t){return this._makeRequest("GET","/v1/forwarding/requests",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/forwarding/requests",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/forwarding/requests/${encodeURIComponent(e)}`,t,n)}}});var $t;var Lo=f(()=>{b();$t=class $t extends d{list(e,t){return this._makeRequest("GET","/v1/sigma/scheduled_query_runs",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/sigma/scheduled_query_runs/${encodeURIComponent(e)}`,t,n)}}});var Ut;var Ko=f(()=>{b();Ut=class Ut extends d{list(e,t){return this._makeRequest("GET","/v1/apps/secrets",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/apps/secrets",e,t)}find(e,t){return this._makeRequest("GET","/v1/apps/secrets/find",e,t)}deleteWhere(e,t){return this._makeRequest("POST","/v1/apps/secrets/delete",e,t)}}});var Mt;var Ho=f(()=>{b();Mt=class Mt extends d{create(e,t){return this._makeRequest("POST","/v1/billing_portal/sessions",e,t)}}});var Dt;var Vo=f(()=>{b();Dt=class Dt extends d{list(e,t){return this._makeRequest("GET","/v1/checkout/sessions",e,t,{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(e,t){return this._makeRequest("POST","/v1/checkout/sessions",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/checkout/sessions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/checkout/sessions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/checkout/sessions/${encodeURIComponent(e)}/expire`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/checkout/sessions/${encodeURIComponent(e)}/line_items`,t,n,{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 Ft;var zo=f(()=>{b();Ft=class Ft extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/financial_connections/sessions/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/financial_connections/sessions",e,t)}}});var Nt;var Wo=f(()=>{b();Nt=class Nt extends d{retrieve(e,t){return this._makeRequest("GET","/v1/tax/settings",e,t)}update(e,t){return this._makeRequest("POST","/v1/tax/settings",e,t)}}});var Gt;var Qo=f(()=>{b();Gt=class Gt extends d{list(e,t){return this._makeRequest("GET","/v1/climate/suppliers",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/climate/suppliers/${encodeURIComponent(e)}`,t,n)}}});var Bt;var Jo=f(()=>{b();Bt=class Bt extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/test_helpers/test_clocks/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/test_helpers/test_clocks/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/test_helpers/test_clocks",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/test_helpers/test_clocks",e,t)}advance(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/test_clocks/${encodeURIComponent(e)}/advance`,t,n)}}});var Lt;var Xo=f(()=>{b();Lt=class Lt extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/tokens",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/issuing/tokens/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/issuing/tokens/${encodeURIComponent(e)}`,t,n)}}});var Kt;var Yo=f(()=>{b();Kt=class Kt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/transaction_entries",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/treasury/transaction_entries/${encodeURIComponent(e)}`,t,n,{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 Ht;var Zo=f(()=>{b();Ht=class Ht extends d{list(e,t){return this._makeRequest("GET","/v1/financial_connections/transactions",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/financial_connections/transactions/${encodeURIComponent(e)}`,t,n)}}});var Vt;var es=f(()=>{b();Vt=class Vt extends d{list(e,t){return this._makeRequest("GET","/v1/issuing/transactions",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/issuing/transactions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/issuing/transactions/${encodeURIComponent(e)}`,t,n,{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 zt;var ts=f(()=>{b();zt=class zt extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax/transactions/${encodeURIComponent(e)}`,t,n)}createFromCalculation(e,t){return this._makeRequest("POST","/v1/tax/transactions/create_from_calculation",e,t)}createReversal(e,t){return this._makeRequest("POST","/v1/tax/transactions/create_reversal",e,t)}listLineItems(e,t,n){return this._makeRequest("GET",`/v1/tax/transactions/${encodeURIComponent(e)}/line_items`,t,n,{methodType:"list"})}}});var Wt;var ns=f(()=>{b();Wt=class Wt extends d{refund(e,t,n){return this._makeRequest("POST",`/v1/test_helpers/issuing/transactions/${encodeURIComponent(e)}/refund`,t,n,{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(e,t){return this._makeRequest("POST","/v1/test_helpers/issuing/transactions/create_force_capture",e,t,{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(e,t){return this._makeRequest("POST","/v1/test_helpers/issuing/transactions/create_unlinked_refund",e,t,{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 Qt;var is=f(()=>{b();Qt=class Qt extends d{list(e,t){return this._makeRequest("GET","/v1/treasury/transactions",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/treasury/transactions/${encodeURIComponent(e)}`,t,n,{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 Jt;var rs=f(()=>{b();Jt=class Jt extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/radar/value_list_items/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/radar/value_list_items/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/radar/value_list_items",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/radar/value_list_items",e,t)}}});var Xt;var os=f(()=>{b();Xt=class Xt extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/radar/value_lists/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/radar/value_lists/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/radar/value_lists/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/radar/value_lists",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/radar/value_lists",e,t)}}});var Yt;var ss=f(()=>{b();Yt=class Yt extends d{list(e,t){return this._makeRequest("GET","/v1/identity/verification_reports",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/identity/verification_reports/${encodeURIComponent(e)}`,t,n)}}});var Zt;var as=f(()=>{b();Zt=class Zt extends d{list(e,t){return this._makeRequest("GET","/v1/identity/verification_sessions",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/identity/verification_sessions",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/identity/verification_sessions/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(e)}/cancel`,t,n)}redact(e,t,n){return this._makeRequest("POST",`/v1/identity/verification_sessions/${encodeURIComponent(e)}/redact`,t,n)}}});var oe;var Ci=f(()=>{b();oe=class oe extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){if(typeof e==="string")return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}`,t,n);else return this._makeRequest("GET","/v1/account",t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}`,t,n)}retrieveCurrent(e,t){return this._makeRequest("GET","/v1/account",e,t)}list(e,t){return this._makeRequest("GET","/v1/accounts",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/accounts",e,t)}reject(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/reject`,t,n)}listCapabilities(e,t,n){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/capabilities`,t,n,{methodType:"list"})}retrieveCapability(e,t,n,i){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/capabilities/${encodeURIComponent(t)}`,n,i)}updateCapability(e,t,n,i){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/capabilities/${encodeURIComponent(t)}`,n,i)}deleteExternalAccount(e,t,n,i){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(e)}/external_accounts/${encodeURIComponent(t)}`,n,i)}retrieveExternalAccount(e,t,n,i){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/external_accounts/${encodeURIComponent(t)}`,n,i)}updateExternalAccount(e,t,n,i){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/external_accounts/${encodeURIComponent(t)}`,n,i)}listExternalAccounts(e,t,n){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/external_accounts`,t,n,{methodType:"list"})}createExternalAccount(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/external_accounts`,t,n)}createLoginLink(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/login_links`,t,n)}deletePerson(e,t,n,i){return this._makeRequest("DELETE",`/v1/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i)}retrievePerson(e,t,n,i){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i)}updatePerson(e,t,n,i){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/persons/${encodeURIComponent(t)}`,n,i)}listPersons(e,t,n){return this._makeRequest("GET",`/v1/accounts/${encodeURIComponent(e)}/persons`,t,n,{methodType:"list"})}createPerson(e,t,n){return this._makeRequest("POST",`/v1/accounts/${encodeURIComponent(e)}/persons`,t,n)}}});var en;var ls=f(()=>{b();en=class en extends d{create(e,t){return this._makeRequest("POST","/v1/account_links",e,t)}}});var tn;var cs=f(()=>{b();tn=class tn extends d{create(e,t){return this._makeRequest("POST","/v1/account_sessions",e,t)}}});var nn;var ds=f(()=>{b();nn=class nn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/apple_pay/domains/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/apple_pay/domains/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/apple_pay/domains",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/apple_pay/domains",e,t)}}});var rn;var us=f(()=>{b();rn=class rn extends d{list(e,t){return this._makeRequest("GET","/v1/application_fees",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(e)}`,t,n)}retrieveRefund(e,t,n,i){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(e)}/refunds/${encodeURIComponent(t)}`,n,i)}updateRefund(e,t,n,i){return this._makeRequest("POST",`/v1/application_fees/${encodeURIComponent(e)}/refunds/${encodeURIComponent(t)}`,n,i)}listRefunds(e,t,n){return this._makeRequest("GET",`/v1/application_fees/${encodeURIComponent(e)}/refunds`,t,n,{methodType:"list"})}createRefund(e,t,n){return this._makeRequest("POST",`/v1/application_fees/${encodeURIComponent(e)}/refunds`,t,n)}}});var se;var ji=f(()=>{b();se=class se extends d{retrieve(e,t){return this._makeRequest("GET","/v1/balance",e,t)}}});var on;var ms=f(()=>{b();on=class on extends d{retrieve(e,t){return this._makeRequest("GET","/v1/balance_settings",e,t)}update(e,t){return this._makeRequest("POST","/v1/balance_settings",e,t)}}});var sn;var ps=f(()=>{b();sn=class sn extends d{list(e,t){return this._makeRequest("GET","/v1/balance_transactions",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/balance_transactions/${encodeURIComponent(e)}`,t,n)}}});var an;var fs=f(()=>{b();an=class an extends d{list(e,t){return this._makeRequest("GET","/v1/charges",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/charges",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/charges/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/charges/${encodeURIComponent(e)}`,t,n)}search(e,t){return this._makeRequest("GET","/v1/charges/search",e,t,{methodType:"search"})}capture(e,t,n){return this._makeRequest("POST",`/v1/charges/${encodeURIComponent(e)}/capture`,t,n)}}});var ln;var _s=f(()=>{b();ln=class ln extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/confirmation_tokens/${encodeURIComponent(e)}`,t,n)}}});var cn;var ks=f(()=>{b();cn=class cn extends d{list(e,t){return this._makeRequest("GET","/v1/country_specs",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/country_specs/${encodeURIComponent(e)}`,t,n)}}});var dn;var bs=f(()=>{b();dn=class dn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/coupons/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/coupons/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/coupons/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/coupons",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/coupons",e,t)}}});var un;var gs=f(()=>{b();un=class un extends d{list(e,t){return this._makeRequest("GET","/v1/credit_notes",e,t,{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(e,t){return this._makeRequest("POST","/v1/credit_notes",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/credit_notes/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/credit_notes/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/credit_notes/preview",e,t,{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(e,t,n){return this._makeRequest("POST",`/v1/credit_notes/${encodeURIComponent(e)}/void`,t,n,{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(e,t){return this._makeRequest("GET","/v1/credit_notes/preview/lines",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/credit_notes/${encodeURIComponent(e)}/lines`,t,n,{methodType:"list",responseSchema:{kind:"object",fields:{data:{kind:"array",element:{kind:"object",fields:{unit_amount_decimal:{kind:"nullable",inner:{kind:"decimal_string"}}}}}}}})}}});var mn;var hs=f(()=>{b();mn=class mn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(e)}/discount`,t,n)}list(e,t){return this._makeRequest("GET","/v1/customers",e,t,{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(e,t){return this._makeRequest("POST","/v1/customers",e,t,{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(e,t){return this._makeRequest("GET","/v1/customers/search",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/balance_transactions`,t,n,{methodType:"list"})}createBalanceTransaction(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/balance_transactions`,t,n)}retrieveBalanceTransaction(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/balance_transactions/${encodeURIComponent(t)}`,n,i)}updateBalanceTransaction(e,t,n,i){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/balance_transactions/${encodeURIComponent(t)}`,n,i)}retrieveCashBalance(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/cash_balance`,t,n)}updateCashBalance(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/cash_balance`,t,n)}listCashBalanceTransactions(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/cash_balance_transactions`,t,n,{methodType:"list"})}retrieveCashBalanceTransaction(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/cash_balance_transactions/${encodeURIComponent(t)}`,n,i)}createFundingInstructions(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/funding_instructions`,t,n)}listPaymentMethods(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/payment_methods`,t,n,{methodType:"list"})}retrievePaymentMethod(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/payment_methods/${encodeURIComponent(t)}`,n,i)}listSources(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/sources`,t,n,{methodType:"list"})}createSource(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/sources`,t,n)}retrieveSource(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/sources/${encodeURIComponent(t)}`,n,i)}updateSource(e,t,n,i){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/sources/${encodeURIComponent(t)}`,n,i)}deleteSource(e,t,n,i){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(e)}/sources/${encodeURIComponent(t)}`,n,i)}verifySource(e,t,n,i){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/sources/${encodeURIComponent(t)}/verify`,n,i)}deleteTaxId(e,t,n,i){return this._makeRequest("DELETE",`/v1/customers/${encodeURIComponent(e)}/tax_ids/${encodeURIComponent(t)}`,n,i)}retrieveTaxId(e,t,n,i){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/tax_ids/${encodeURIComponent(t)}`,n,i)}listTaxIds(e,t,n){return this._makeRequest("GET",`/v1/customers/${encodeURIComponent(e)}/tax_ids`,t,n,{methodType:"list"})}createTaxId(e,t,n){return this._makeRequest("POST",`/v1/customers/${encodeURIComponent(e)}/tax_ids`,t,n)}}});var pn;var ys=f(()=>{b();pn=class pn extends d{create(e,t){return this._makeRequest("POST","/v1/customer_sessions",e,t)}}});var fn;var Rs=f(()=>{b();fn=class fn extends d{list(e,t){return this._makeRequest("GET","/v1/disputes",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/disputes/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/disputes/${encodeURIComponent(e)}`,t,n)}close(e,t,n){return this._makeRequest("POST",`/v1/disputes/${encodeURIComponent(e)}/close`,t,n)}}});var _n;var Ts=f(()=>{b();_n=class _n extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/ephemeral_keys/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/ephemeral_keys",e,t,{validator:(n,i)=>{if(!i.headers||!i.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 kn;var ws=f(()=>{b();kn=class kn extends d{list(e,t){return this._makeRequest("GET","/v1/events",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/events/${encodeURIComponent(e)}`,t,n)}}});var bn;var vs=f(()=>{b();bn=class bn extends d{list(e,t){return this._makeRequest("GET","/v1/exchange_rates",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/exchange_rates/${encodeURIComponent(e)}`,t,n)}}});function Il(e,t,n,i){if(t=t||{},e!=="POST")return i(null,z(t));this._stripe._platformFunctions.tryBufferData(t).then((r)=>{let o=eu(e,r,n);return i(null,o)}).catch((r)=>i(r,null))}var eu=(e,t,n)=>{let i=(Math.round(Math.random()*10000000000000000)+Math.round(Math.random()*10000000000000000)).toString();n["Content-Type"]=`multipart/form-data; boundary=${i}`;let r=new TextEncoder,o=new Uint8Array(0),s=r.encode(`\r
15
+ `);function a(u){let m=o,p=u instanceof Uint8Array?u:new Uint8Array(r.encode(u));o=new Uint8Array(m.length+p.length+2),o.set(m),o.set(p,m.length),o.set(s,o.length-2)}function c(u){return`"${u.replace(/"|"/g,"%22").replace(/\r\n|\r|\n/g," ")}"`}let l=pl(t);for(let u in l){if(!Object.prototype.hasOwnProperty.call(l,u))continue;let m=l[u];if(a(`--${i}`),Object.prototype.hasOwnProperty.call(m,"data")){let p=m;a(`Content-Disposition: form-data; name=${c(u)}; filename=${c(p.name||"blob")}`),a(`Content-Type: ${p.type||"application/octet-stream"}`),a(""),a(p.data)}else a(`Content-Disposition: form-data; name=${c(u)}`),a(""),a(m)}return a(`--${i}--`),o};var $l=f(()=>{W()});var gn;var Ss=f(()=>{$l();b();gn=class gn extends d{constructor(){super(...arguments);this.requestDataProcessor=Il}list(e,t){return this._makeRequest("GET","/v1/files",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/files",e,t,{headers:{"Content-Type":"multipart/form-data"},apiBase:"files"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/files/${encodeURIComponent(e)}`,t,n)}}});var hn;var xs=f(()=>{b();hn=class hn extends d{list(e,t){return this._makeRequest("GET","/v1/file_links",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/file_links",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/file_links/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/file_links/${encodeURIComponent(e)}`,t,n)}}});var yn;var Cs=f(()=>{b();yn=class yn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/invoices/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/invoices/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/invoices",e,t,{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(e,t){return this._makeRequest("POST","/v1/invoices",e,t,{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(e,t){return this._makeRequest("GET","/v1/invoices/search",e,t,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/add_lines`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/attach_payment`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/finalize`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/mark_uncollectible`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/pay`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/remove_lines`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/send`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/update_lines`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/void`,t,n,{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(e,t){return this._makeRequest("POST","/v1/invoices/create_preview",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/invoices/${encodeURIComponent(e)}/lines`,t,n,{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(e,t,n,i){return this._makeRequest("POST",`/v1/invoices/${encodeURIComponent(e)}/lines/${encodeURIComponent(t)}`,n,i,{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 Rn;var js=f(()=>{b();Rn=class Rn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/invoiceitems/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/invoiceitems/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/invoiceitems/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/invoiceitems",e,t,{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(e,t){return this._makeRequest("POST","/v1/invoiceitems",e,t,{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 Tn;var Ps=f(()=>{b();Tn=class Tn extends d{list(e,t){return this._makeRequest("GET","/v1/invoice_payments",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/invoice_payments/${encodeURIComponent(e)}`,t,n)}}});var wn;var Es=f(()=>{b();wn=class wn extends d{list(e,t){return this._makeRequest("GET","/v1/invoice_rendering_templates",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/invoice_rendering_templates/${encodeURIComponent(e)}`,t,n)}archive(e,t,n){return this._makeRequest("POST",`/v1/invoice_rendering_templates/${encodeURIComponent(e)}/archive`,t,n)}unarchive(e,t,n){return this._makeRequest("POST",`/v1/invoice_rendering_templates/${encodeURIComponent(e)}/unarchive`,t,n)}}});var vn;var qs=f(()=>{b();vn=class vn extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/mandates/${encodeURIComponent(e)}`,t,n)}}});var Sn;var Ul=f(()=>{b();W();Sn=class Sn extends d{constructor(){super(...arguments);this.basePath=be("/")}authorizeUrl(e,t){e=e||{},t=t||{};let n="oauth/authorize";if(t.express)n=`express/${n}`;if(!e.response_type)e.response_type="code";if(!e.client_id)e.client_id=this._stripe.getClientId();if(!e.scope)e.scope="read_write";return`https://${this._stripe.resolveBaseAddress("connect")}/${n}?${z(e)}`}token(e,t){return this._makeRequest("POST","/oauth/token",e,t,{apiBase:"connect"})}deauthorize(e,t){if(!e.client_id)e.client_id=this._stripe.getClientId();return this._makeRequest("POST","/oauth/deauthorize",e,t,{apiBase:"connect"})}}});var xn;var Os=f(()=>{b();xn=class xn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_attempt_records",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_attempt_records/${encodeURIComponent(e)}`,t,n)}}});var Cn;var As=f(()=>{b();Cn=class Cn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_intents",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payment_intents",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_intents/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}`,t,n)}search(e,t){return this._makeRequest("GET","/v1/payment_intents/search",e,t,{methodType:"search"})}applyCustomerBalance(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/apply_customer_balance`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/cancel`,t,n)}capture(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/capture`,t,n)}confirm(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/confirm`,t,n)}incrementAuthorization(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/increment_authorization`,t,n)}verifyMicrodeposits(e,t,n){return this._makeRequest("POST",`/v1/payment_intents/${encodeURIComponent(e)}/verify_microdeposits`,t,n)}listAmountDetailsLineItems(e,t,n){return this._makeRequest("GET",`/v1/payment_intents/${encodeURIComponent(e)}/amount_details_line_items`,t,n,{methodType:"list"})}}});var jn;var Is=f(()=>{b();jn=class jn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_links",e,t,{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(e,t){return this._makeRequest("POST","/v1/payment_links",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/payment_links/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/payment_links/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/payment_links/${encodeURIComponent(e)}/line_items`,t,n,{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 Pn;var $s=f(()=>{b();Pn=class Pn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_methods",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payment_methods",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_methods/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(e)}`,t,n)}attach(e,t,n){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(e)}/attach`,t,n)}detach(e,t,n){return this._makeRequest("POST",`/v1/payment_methods/${encodeURIComponent(e)}/detach`,t,n)}}});var En;var Us=f(()=>{b();En=class En extends d{list(e,t){return this._makeRequest("GET","/v1/payment_method_configurations",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payment_method_configurations",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_method_configurations/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payment_method_configurations/${encodeURIComponent(e)}`,t,n)}}});var qn;var Ms=f(()=>{b();qn=class qn extends d{list(e,t){return this._makeRequest("GET","/v1/payment_method_domains",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payment_method_domains",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_method_domains/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payment_method_domains/${encodeURIComponent(e)}`,t,n)}validate(e,t,n){return this._makeRequest("POST",`/v1/payment_method_domains/${encodeURIComponent(e)}/validate`,t,n)}}});var On;var Ds=f(()=>{b();On=class On extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/payment_records/${encodeURIComponent(e)}`,t,n)}reportPaymentAttempt(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt`,t,n)}reportPaymentAttemptCanceled(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt_canceled`,t,n)}reportPaymentAttemptFailed(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt_failed`,t,n)}reportPaymentAttemptGuaranteed(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt_guaranteed`,t,n)}reportPaymentAttemptInformational(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_payment_attempt_informational`,t,n)}reportRefund(e,t,n){return this._makeRequest("POST",`/v1/payment_records/${encodeURIComponent(e)}/report_refund`,t,n)}reportPayment(e,t){return this._makeRequest("POST","/v1/payment_records/report_payment",e,t)}}});var An;var Fs=f(()=>{b();An=class An extends d{list(e,t){return this._makeRequest("GET","/v1/payouts",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/payouts",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/payouts/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(e)}/cancel`,t,n)}reverse(e,t,n){return this._makeRequest("POST",`/v1/payouts/${encodeURIComponent(e)}/reverse`,t,n)}}});var In;var Ns=f(()=>{b();In=class In extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/plans/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/plans/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/plans/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/plans",e,t,{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(e,t){return this._makeRequest("POST","/v1/plans",e,t,{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 $n;var Gs=f(()=>{b();$n=class $n extends d{list(e,t){return this._makeRequest("GET","/v1/prices",e,t,{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(e,t){return this._makeRequest("POST","/v1/prices",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/prices/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/prices/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/prices/search",e,t,{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 Un;var Bs=f(()=>{b();Un=class Un extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/products/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/products/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/products",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/products",e,t,{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(e,t){return this._makeRequest("GET","/v1/products/search",e,t,{methodType:"search"})}deleteFeature(e,t,n,i){return this._makeRequest("DELETE",`/v1/products/${encodeURIComponent(e)}/features/${encodeURIComponent(t)}`,n,i)}retrieveFeature(e,t,n,i){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(e)}/features/${encodeURIComponent(t)}`,n,i)}listFeatures(e,t,n){return this._makeRequest("GET",`/v1/products/${encodeURIComponent(e)}/features`,t,n,{methodType:"list"})}createFeature(e,t,n){return this._makeRequest("POST",`/v1/products/${encodeURIComponent(e)}/features`,t,n)}}});var Mn;var Ls=f(()=>{b();Mn=class Mn extends d{list(e,t){return this._makeRequest("GET","/v1/promotion_codes",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/promotion_codes",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/promotion_codes/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/promotion_codes/${encodeURIComponent(e)}`,t,n)}}});var Dn;var Ks=f(()=>{b();Dn=class Dn extends d{list(e,t){return this._makeRequest("GET","/v1/quotes",e,t,{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(e,t){return this._makeRequest("POST","/v1/quotes",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(e)}/accept`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(e)}/cancel`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/quotes/${encodeURIComponent(e)}/finalize`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(e)}/pdf`,t,n,{apiBase:"files",streaming:!0})}listComputedUpfrontLineItems(e,t,n){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(e)}/computed_upfront_line_items`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/quotes/${encodeURIComponent(e)}/line_items`,t,n,{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 Fn;var Hs=f(()=>{b();Fn=class Fn extends d{list(e,t){return this._makeRequest("GET","/v1/refunds",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/refunds",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/refunds/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/refunds/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/refunds/${encodeURIComponent(e)}/cancel`,t,n)}}});var Nn;var Vs=f(()=>{b();Nn=class Nn extends d{list(e,t){return this._makeRequest("GET","/v1/reviews",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/reviews/${encodeURIComponent(e)}`,t,n)}approve(e,t,n){return this._makeRequest("POST",`/v1/reviews/${encodeURIComponent(e)}/approve`,t,n)}}});var Gn;var zs=f(()=>{b();Gn=class Gn extends d{list(e,t){return this._makeRequest("GET","/v1/setup_attempts",e,t,{methodType:"list"})}}});var Bn;var Ws=f(()=>{b();Bn=class Bn extends d{list(e,t){return this._makeRequest("GET","/v1/setup_intents",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/setup_intents",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/setup_intents/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(e)}/cancel`,t,n)}confirm(e,t,n){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(e)}/confirm`,t,n)}verifyMicrodeposits(e,t,n){return this._makeRequest("POST",`/v1/setup_intents/${encodeURIComponent(e)}/verify_microdeposits`,t,n)}}});var Ln;var Qs=f(()=>{b();Ln=class Ln extends d{list(e,t){return this._makeRequest("GET","/v1/shipping_rates",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/shipping_rates",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/shipping_rates/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/shipping_rates/${encodeURIComponent(e)}`,t,n)}}});var Kn;var Js=f(()=>{b();Kn=class Kn extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/sources/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/sources/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/sources",e,t)}verify(e,t,n){return this._makeRequest("POST",`/v1/sources/${encodeURIComponent(e)}/verify`,t,n)}listSourceTransactions(e,t,n){return this._makeRequest("GET",`/v1/sources/${encodeURIComponent(e)}/source_transactions`,t,n,{methodType:"list"})}}});var Hn;var Xs=f(()=>{b();Hn=class Hn extends d{cancel(e,t,n){return this._makeRequest("DELETE",`/v1/subscriptions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("GET",`/v1/subscriptions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("DELETE",`/v1/subscriptions/${encodeURIComponent(e)}/discount`,t,n)}list(e,t){return this._makeRequest("GET","/v1/subscriptions",e,t,{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(e,t){return this._makeRequest("POST","/v1/subscriptions",e,t,{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(e,t){return this._makeRequest("GET","/v1/subscriptions/search",e,t,{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(e,t,n){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(e)}/migrate`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/subscriptions/${encodeURIComponent(e)}/resume`,t,n,{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 Vn;var Ys=f(()=>{b();Vn=class Vn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/subscription_items/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/subscription_items/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/subscription_items/${encodeURIComponent(e)}`,t,n,{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(e,t){return this._makeRequest("GET","/v1/subscription_items",e,t,{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(e,t){return this._makeRequest("POST","/v1/subscription_items",e,t,{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 zn;var Zs=f(()=>{b();zn=class zn extends d{list(e,t){return this._makeRequest("GET","/v1/subscription_schedules",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/subscription_schedules",e,t,{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(e,t,n){return this._makeRequest("GET",`/v1/subscription_schedules/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(e)}`,t,n,{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(e,t,n){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(e)}/cancel`,t,n)}release(e,t,n){return this._makeRequest("POST",`/v1/subscription_schedules/${encodeURIComponent(e)}/release`,t,n)}}});var Wn;var ea=f(()=>{b();Wn=class Wn extends d{list(e,t){return this._makeRequest("GET","/v1/tax_codes",e,t,{methodType:"list"})}retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax_codes/${encodeURIComponent(e)}`,t,n)}}});var Qn;var ta=f(()=>{b();Qn=class Qn extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/tax_ids/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax_ids/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/tax_ids",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/tax_ids",e,t)}}});var Jn;var na=f(()=>{b();Jn=class Jn extends d{list(e,t){return this._makeRequest("GET","/v1/tax_rates",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/tax_rates",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/tax_rates/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/tax_rates/${encodeURIComponent(e)}`,t,n)}}});var Xn;var ia=f(()=>{b();Xn=class Xn extends d{retrieve(e,t,n){return this._makeRequest("GET",`/v1/tokens/${encodeURIComponent(e)}`,t,n)}create(e,t){return this._makeRequest("POST","/v1/tokens",e,t)}}});var Yn;var ra=f(()=>{b();Yn=class Yn extends d{list(e,t){return this._makeRequest("GET","/v1/topups",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/topups",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/topups/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/topups/${encodeURIComponent(e)}`,t,n)}cancel(e,t,n){return this._makeRequest("POST",`/v1/topups/${encodeURIComponent(e)}/cancel`,t,n)}}});var Zn;var oa=f(()=>{b();Zn=class Zn extends d{list(e,t){return this._makeRequest("GET","/v1/transfers",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/transfers",e,t)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(e)}`,t,n)}listReversals(e,t,n){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(e)}/reversals`,t,n,{methodType:"list"})}createReversal(e,t,n){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(e)}/reversals`,t,n)}retrieveReversal(e,t,n,i){return this._makeRequest("GET",`/v1/transfers/${encodeURIComponent(e)}/reversals/${encodeURIComponent(t)}`,n,i)}updateReversal(e,t,n,i){return this._makeRequest("POST",`/v1/transfers/${encodeURIComponent(e)}/reversals/${encodeURIComponent(t)}`,n,i)}}});var ei;var sa=f(()=>{b();ei=class ei extends d{del(e,t,n){return this._makeRequest("DELETE",`/v1/webhook_endpoints/${encodeURIComponent(e)}`,t,n)}retrieve(e,t,n){return this._makeRequest("GET",`/v1/webhook_endpoints/${encodeURIComponent(e)}`,t,n)}update(e,t,n){return this._makeRequest("POST",`/v1/webhook_endpoints/${encodeURIComponent(e)}`,t,n)}list(e,t){return this._makeRequest("GET","/v1/webhook_endpoints",e,t,{methodType:"list"})}create(e,t){return this._makeRequest("POST","/v1/webhook_endpoints",e,t)}}});var ae={};Oi(ae,{Account:()=>oe,AccountLinks:()=>en,AccountSessions:()=>tn,Accounts:()=>oe,ApplePayDomains:()=>nn,ApplicationFees:()=>rn,Apps:()=>tu,Balance:()=>se,BalanceSettings:()=>on,BalanceTransactions:()=>sn,Balances:()=>se,Billing:()=>nu,BillingPortal:()=>iu,Charges:()=>an,Checkout:()=>ru,Climate:()=>ou,ConfirmationTokens:()=>ln,CountrySpecs:()=>cn,Coupons:()=>dn,CreditNotes:()=>un,CustomerSessions:()=>pn,Customers:()=>mn,Disputes:()=>fn,Entitlements:()=>su,EphemeralKeys:()=>_n,Events:()=>kn,ExchangeRates:()=>bn,FileLinks:()=>hn,Files:()=>gn,FinancialConnections:()=>au,Forwarding:()=>lu,Identity:()=>cu,InvoiceItems:()=>Rn,InvoicePayments:()=>Tn,InvoiceRenderingTemplates:()=>wn,Invoices:()=>yn,Issuing:()=>du,Mandates:()=>vn,OAuthResource:()=>Sn,PaymentAttemptRecords:()=>xn,PaymentIntents:()=>Cn,PaymentLinks:()=>jn,PaymentMethodConfigurations:()=>En,PaymentMethodDomains:()=>qn,PaymentMethods:()=>Pn,PaymentRecords:()=>On,Payouts:()=>An,Plans:()=>In,Prices:()=>$n,Products:()=>Un,PromotionCodes:()=>Mn,Quotes:()=>Dn,Radar:()=>uu,Refunds:()=>Fn,Reporting:()=>mu,Reviews:()=>Nn,SetupAttempts:()=>Gn,SetupIntents:()=>Bn,ShippingRates:()=>Ln,Sigma:()=>pu,Sources:()=>Kn,SubscriptionItems:()=>Vn,SubscriptionSchedules:()=>zn,Subscriptions:()=>Hn,Tax:()=>fu,TaxCodes:()=>Wn,TaxIds:()=>Qn,TaxRates:()=>Jn,Terminal:()=>_u,TestHelpers:()=>ku,Tokens:()=>Xn,Topups:()=>Yn,Transfers:()=>Zn,Treasury:()=>bu,V2:()=>gu,WebhookEndpoints:()=>ei});var tu,nu,iu,ru,ou,su,au,lu,cu,du,uu,mu,pu,fu,_u,ku,bu,gu;var aa=f(()=>{Or();Ar();Ir();Mr();Dr();Fr();Nr();Gr();Br();Lr();Kr();Hr();Vr();zr();Wr();Qr();Jr();Xr();Yr();Zr();eo();to();no();io();ro();oo();so();ao();lo();co();uo();mo();po();fo();_o();ko();bo();go();ho();yo();Ro();To();wo();vo();So();xo();Co();jo();Po();Eo();qo();Oo();Ao();Io();$o();Uo();Mo();Do();Fo();No();Go();Bo();Lo();Ko();Ho();Vo();zo();Wo();Qo();Jo();Xo();Yo();Zo();es();ts();ns();is();rs();os();ss();as();Ci();Ci();ls();cs();ds();us();ji();ji();ms();ps();fs();_s();ks();bs();gs();hs();ys();Rs();Ts();ws();vs();Ss();xs();Cs();js();Ps();Es();qs();Ul();Os();As();Is();$s();Us();Ms();Ds();Fs();Ns();Gs();Bs();Ls();Ks();Hs();Vs();zs();Ws();Qs();Js();Xs();Ys();Zs();ea();ta();na();ia();ra();oa();sa();tu=S("apps",{Secrets:Ut}),nu=S("billing",{Alerts:Oe,CreditBalanceSummary:Ke,CreditBalanceTransactions:He,CreditGrants:Ve,MeterEventAdjustments:st,MeterEvents:dt,Meters:mt}),iu=S("billingPortal",{Configurations:Ne,Sessions:Mt}),ru=S("checkout",{Sessions:Dt}),ou=S("climate",{Orders:ft,Products:wt,Suppliers:Gt}),su=S("entitlements",{ActiveEntitlements:qe,Features:et}),au=S("financialConnections",{Accounts:Pe,Sessions:Ft,Transactions:Ht}),lu=S("forwarding",{Requests:It}),cu=S("identity",{VerificationReports:Yt,VerificationSessions:Zt}),du=S("issuing",{Authorizations:Ie,Cardholders:Me,Cards:De,Disputes:Je,PersonalizationDesigns:yt,PhysicalBundles:Tt,Tokens:Lt,Transactions:Vt}),uu=S("radar",{EarlyFraudWarnings:Xe,PaymentEvaluations:ht,ValueListItems:Jt,ValueLists:Xt}),mu=S("reporting",{ReportRuns:Ot,ReportTypes:At}),pu=S("sigma",{ScheduledQueryRuns:$t}),fu=S("tax",{Associations:Ae,Calculations:Ue,Registrations:qt,Settings:Nt,Transactions:zt}),_u=S("terminal",{Configurations:Ge,ConnectionTokens:Le,Locations:ot,OnboardingLinks:pt,Readers:vt}),ku=S("testHelpers",{ConfirmationTokens:Be,Customers:We,Refunds:Et,TestClocks:Bt,Issuing:S("issuing",{Authorizations:$e,Cards:Fe,PersonalizationDesigns:Rt,Transactions:Wt}),Terminal:S("terminal",{Readers:St}),Treasury:S("treasury",{InboundTransfers:it,OutboundPayments:_t,OutboundTransfers:bt,ReceivedCredits:xt,ReceivedDebits:jt})}),bu=S("treasury",{CreditReversals:ze,DebitReversals:Qe,FinancialAccounts:tt,InboundTransfers:rt,OutboundPayments:kt,OutboundTransfers:gt,ReceivedCredits:Ct,ReceivedDebits:Pt,TransactionEntries:Kt,Transactions:Qt}),gu=S("v2",{Billing:S("billing",{MeterEventAdjustments:at,MeterEventSession:lt,MeterEventStream:ct,MeterEvents:ut}),Commerce:S("commerce",{ProductCatalog:S("productCatalog",{Imports:nt})}),Core:S("core",{AccountLinks:Ce,AccountTokens:je,Accounts:Ee,EventDestinations:Ye,Events:Ze})})});var Ml=f(()=>{Ri()});class la{constructor(e){this.stripe=e,this.secrets=new Ut(e)}}var Dl=f(()=>{Ko()});class ca{constructor(e){this.stripe=e,this.alerts=new Oe(e),this.creditBalanceSummaries=new Ke(e),this.creditBalanceTransactions=new He(e),this.creditGrants=new Ve(e),this.meters=new mt(e),this.meterEvents=new dt(e),this.meterEventAdjustments=new st(e)}}var Fl=f(()=>{Fr();Xr();Yr();Zr();yo();go();fo()});class da{constructor(e){this.stripe=e,this.configurations=new Ne(e),this.sessions=new Mt(e)}}var Nl=f(()=>{zr();Ho()});class ua{constructor(e){this.stripe=e,this.sessions=new Dt(e)}}var Gl=f(()=>{Vo()});class ma{constructor(e){this.stripe=e,this.orders=new ft(e),this.products=new wt(e),this.suppliers=new Gt(e)}}var Bl=f(()=>{To();qo();Qo()});class pa{constructor(e){this.stripe=e,this.activeEntitlements=new qe(e),this.features=new et(e)}}var Ll=f(()=>{Dr();ao()});class fa{constructor(e){this.stripe=e,this.accounts=new Pe(e),this.sessions=new Ft(e),this.transactions=new Ht(e)}}var Kl=f(()=>{Ir();zo();Zo()});class _a{constructor(e){this.stripe=e,this.requests=new It(e)}}var Hl=f(()=>{Bo()});class ka{constructor(e){this.stripe=e,this.verificationReports=new Yt(e),this.verificationSessions=new Zt(e)}}var Vl=f(()=>{ss();as()});class ba{constructor(e){this.stripe=e,this.authorizations=new Ie(e),this.cards=new De(e),this.cardholders=new Me(e),this.disputes=new Je(e),this.personalizationDesigns=new yt(e),this.physicalBundles=new Tt(e),this.tokens=new Lt(e),this.transactions=new Vt(e)}}var zl=f(()=>{Gr();Hr();Kr();io();jo();Eo();Xo();es()});class ga{constructor(e){this.stripe=e,this.earlyFraudWarnings=new Xe(e),this.paymentEvaluations=new ht(e),this.valueLists=new Xt(e),this.valueListItems=new Jt(e)}}var Wl=f(()=>{ro();Co();os();rs()});class ha{constructor(e){this.stripe=e,this.reportRuns=new Ot(e),this.reportTypes=new At(e)}}var Ql=f(()=>{No();Go()});class ya{constructor(e){this.stripe=e,this.scheduledQueryRuns=new $t(e)}}var Jl=f(()=>{Lo()});class Ra{constructor(e){this.stripe=e,this.associations=new Ae(e),this.calculations=new Ue(e),this.registrations=new qt(e),this.settings=new Nt(e),this.transactions=new zt(e)}}var Xl=f(()=>{Nr();Lr();Fo();Wo();ts()});class Ta{constructor(e){this.stripe=e,this.configurations=new Ge(e),this.connectionTokens=new Le(e),this.locations=new ot(e),this.onboardingLinks=new pt(e),this.readers=new vt(e)}}var Yl=f(()=>{Wr();Jr();po();Ro();Oo()});class wa{constructor(e){this.stripe=e,this.authorizations=new $e(e),this.cards=new Fe(e),this.personalizationDesigns=new Rt(e),this.transactions=new Wt(e)}}var Zl=f(()=>{Br();Vr();Po();ns()});class va{constructor(e){this.stripe=e,this.readers=new St(e)}}var ec=f(()=>{Ao()});class Sa{constructor(e){this.stripe=e,this.inboundTransfers=new it(e),this.outboundPayments=new _t(e),this.outboundTransfers=new bt(e),this.receivedCredits=new xt(e),this.receivedDebits=new jt(e)}}var tc=f(()=>{uo();wo();So();Io();Uo()});class xa{constructor(e){this.stripe=e,this.confirmationTokens=new Be(e),this.customers=new We(e),this.refunds=new Et(e),this.testClocks=new Bt(e),this.issuing=new wa(e),this.terminal=new va(e),this.treasury=new Sa(e)}}var nc=f(()=>{Qr();to();Do();Jo();Zl();ec();tc()});class Ca{constructor(e){this.stripe=e,this.creditReversals=new ze(e),this.debitReversals=new Qe(e),this.financialAccounts=new tt(e),this.inboundTransfers=new rt(e),this.outboundPayments=new kt(e),this.outboundTransfers=new gt(e),this.receivedCredits=new Ct(e),this.receivedDebits=new Pt(e),this.transactions=new Qt(e),this.transactionEntries=new Kt(e)}}var ic=f(()=>{eo();no();lo();mo();vo();xo();$o();Mo();is();Yo()});class ja{constructor(e){this.stripe=e,this.meterEvents=new ut(e),this.meterEventAdjustments=new at(e),this.meterEventSession=new lt(e),this.meterEventStream=new ct(e)}}var rc=f(()=>{ho();_o();ko();bo()});class Pa{constructor(e){this.stripe=e,this.imports=new nt(e)}}var oc=f(()=>{co()});class Ea{constructor(e){this.stripe=e,this.productCatalog=new Pa(e)}}var sc=f(()=>{oc()});class qa{constructor(e){this.stripe=e,this.accounts=new Ee(e),this.accountLinks=new Ce(e),this.accountTokens=new je(e),this.events=new Ze(e),this.eventDestinations=new Ye(e)}}var ac=f(()=>{Mr();Or();Ar();so();oo()});class Oa{constructor(e){this.stripe=e,this.billing=new ja(e),this.commerce=new Ea(e),this.core=new qa(e)}}var lc=f(()=>{rc();sc();ac()});class w{static initialize(e,t=kc){w._platformFunctions=e,w._requestSenderFactory=t,w.webhooks=El(e),w.createNodeHttpClient=e.createNodeHttpClient,w.createFetchHttpClient=e.createFetchHttpClient,w.createNodeCryptoProvider=e.createNodeCryptoProvider,w.createSubtleCryptoProvider=e.createSubtleCryptoProvider;let n=e.getEnv(),i=e.getRuntimeVersion();w.aiAgent=n?fl(n):"",w.AI_AGENT=w.aiAgent,w.USER_AGENT={bindings_version:w.PACKAGE_VERSION,lang:"node",typescript:!1,...i?{lang_version:i}:{},...w.aiAgent?{ai_agent:w.aiAgent}:{}}}constructor(e,t={}){this._authenticator=null;let n=this._getPropsFromConfig(t);this._platformFunctions=w._platformFunctions,Object.defineProperty(this,"_emitter",{value:this._platformFunctions.createEmitter(),enumerable:!1,configurable:!1,writable:!1}),this.VERSION=w.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 i=n.httpAgent||null;this._api={host:n.host||Aa,port:n.port||cc,protocol:n.protocol||"https",basePath:dc,version:n.apiVersion||uc,timeout:ki("timeout",n.timeout,mc),maxNetworkRetries:ki("maxNetworkRetries",n.maxNetworkRetries,2),agent:i,httpClient:n.httpClient||(i?this._platformFunctions.createNodeHttpClient(i):this._platformFunctions.createDefaultHttpClient()),dev:!1,stripeAccount:n.stripeAccount||null,stripeContext:n.stripeContext||null};let r=n.typescript||!1;if(r!==w.USER_AGENT.typescript)w.USER_AGENT.typescript=r;if(n.appInfo)this._setAppInfo(n.appInfo);this._setAuthenticator(e,n.authenticator||null),this.errors=Si,this.Decimal=M,this.webhooks=w.webhooks,this._prevRequestMetrics=[],this._enableTelemetry=n.telemetry!==!1,this._emitEventBodies=n.emitEventBodies===!0,this._requestSender=w._requestSenderFactory(this),this.accountLinks=new en(this),this.accountSessions=new tn(this),this.accounts=new oe(this),this.applePayDomains=new nn(this),this.applicationFees=new rn(this),this.balance=new se(this),this.balanceSettings=new on(this),this.balanceTransactions=new sn(this),this.charges=new an(this),this.confirmationTokens=new ln(this),this.countrySpecs=new cn(this),this.coupons=new dn(this),this.creditNotes=new un(this),this.customerSessions=new pn(this),this.customers=new mn(this),this.disputes=new fn(this),this.ephemeralKeys=new _n(this),this.events=new kn(this),this.exchangeRates=new bn(this),this.fileLinks=new hn(this),this.files=new gn(this),this.invoiceItems=new Rn(this),this.invoicePayments=new Tn(this),this.invoiceRenderingTemplates=new wn(this),this.invoices=new yn(this),this.mandates=new vn(this),this.paymentAttemptRecords=new xn(this),this.paymentIntents=new Cn(this),this.paymentLinks=new jn(this),this.paymentMethodConfigurations=new En(this),this.paymentMethodDomains=new qn(this),this.paymentMethods=new Pn(this),this.paymentRecords=new On(this),this.payouts=new An(this),this.plans=new In(this),this.prices=new $n(this),this.products=new Un(this),this.promotionCodes=new Mn(this),this.quotes=new Dn(this),this.refunds=new Fn(this),this.reviews=new Nn(this),this.setupAttempts=new Gn(this),this.setupIntents=new Bn(this),this.shippingRates=new Ln(this),this.sources=new Kn(this),this.subscriptionItems=new Vn(this),this.subscriptionSchedules=new zn(this),this.subscriptions=new Hn(this),this.taxCodes=new Wn(this),this.taxIds=new Qn(this),this.taxRates=new Jn(this),this.tokens=new Xn(this),this.topups=new Yn(this),this.transfers=new Zn(this),this.webhookEndpoints=new ei(this),this.apps=new la(this),this.billing=new ca(this),this.billingPortal=new da(this),this.checkout=new ua(this),this.climate=new ma(this),this.entitlements=new pa(this),this.financialConnections=new fa(this),this.forwarding=new _a(this),this.identity=new ka(this),this.issuing=new ba(this),this.radar=new ga(this),this.reporting=new ha(this),this.sigma=new ya(this),this.tax=new Ra(this),this.terminal=new Ta(this),this.testHelpers=new xa(this),this.treasury=new Ca(this),this.v2=new Oa(this),this.account=this.accounts,this.oauth=new Sn(this)}rawRequest(e,t,n,i){return this._requestSender._rawRequest(e,t,n,i)}_setAuthenticator(e,t){if(e&&t)throw Error("Can't specify both apiKey and authenticator");if(!e&&!t)throw Error("Neither apiKey nor config.authenticator provided");this._authenticator=e?lr(e):t}_setAppInfo(e){if(e&&typeof e!=="object")throw Error("AppInfo must be an object.");if(e&&!e.name)throw Error("AppInfo.name is required");e=e||{},this._appInfo=hu.reduce((t,n)=>{if(typeof e[n]=="string")t=t||{},t[n]=e[n];return t},{})}setClientId(e){this._clientId=e}getClientId(){return this._clientId}getConstant(e){switch(e){case"DEFAULT_HOST":return Aa;case"DEFAULT_PORT":return cc;case"DEFAULT_BASE_PATH":return dc;case"DEFAULT_API_VERSION":return uc;case"DEFAULT_TIMEOUT":return mc;case"MAX_NETWORK_RETRY_DELAY_SEC":return pc;case"INITIAL_NETWORK_RETRY_DELAY_SEC":return fc}return w[e]}resolveBaseAddress(e){let t=this.getApiField("host");if(t!==Aa)return t;return sr[e]}getMaxNetworkRetries(){return this.getApiField("maxNetworkRetries")}_setApiNumberField(e,t,n){let i=ki(e,t,n);this._setApiField(e,i)}getMaxNetworkRetryDelay(){return pc}getInitialNetworkRetryDelay(){return fc}getClientUserAgent(e){return this.getClientUserAgentSeeded(w.USER_AGENT,e)}getClientUserAgentSeeded(e,t){let n={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;n[o]=encodeURIComponent(e[o]??"null")}let i=this._platformFunctions.getPlatformInfo();if(i&&this.getTelemetryEnabled())n.platform=encodeURIComponent(i);else delete n.platform;let r=this.getApiField("httpClient");if(r)n.httplib=encodeURIComponent(r.getClientName());if(this._appInfo)n.application=this._appInfo;if(this.getTelemetryEnabled()){let o=this._platformFunctions.getTelemetryId();if(o)n.telemetry_id=o}t(JSON.stringify(n))}getAppInfoAsString(){if(!this._appInfo)return"";let e=this._appInfo.name;if(this._appInfo.version)e+=`/${this._appInfo.version}`;if(this._appInfo.url)e+=` (${this._appInfo.url})`;return e}getTelemetryEnabled(){return this._enableTelemetry}getEmitEventBodiesEnabled(){return this._emitEventBodies}_prepResources(){for(let e in ae){if(!Object.prototype.hasOwnProperty.call(ae,e))continue;this[ml(e.replace("Resource",""))]=new ae[e](this)}}_getPropsFromConfig(e){if(!e)return{};let t=typeof e==="string";if(!(e===Object(e)&&!Array.isArray(e))&&!t)throw Error("Config must either be an object or a string");if(t)return{apiVersion:e};if(Object.keys(e).filter((r)=>!_c.includes(r)).length>0)throw Error(`Config object may only contain the following: ${_c.join(", ")}`);return e}_setApiField(e,t){this._api[e]=t}getApiField(e){return this._api[e]}parseEventNotification(e,t,n,i,r,o){if(!this.webhooks.signature)throw Error("ERR: missing signature helper, unable to verify");this.webhooks.signature.verifyHeader(e,t,n,i||this.webhooks.DEFAULT_TOLERANCE,r||this._platformFunctions.createDefaultCryptoProvider(),o);let s=e instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(e)):JSON.parse(e);if(s&&s.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotification, which expects an event notification. Use stripe.webhooks.constructEvent instead.");if(s.context)s.context=K.parse(s.context);return s.fetchEvent=()=>this._requestSender._rawRequest("GET",`/v2/core/events/${s.id}`,void 0,{stripeContext:s.context,headers:{"Stripe-Request-Trigger":`event=${s.id}`}},["fetch_event"]),s.fetchRelatedObject=()=>{if(!s.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",s.related_object.url,void 0,{stripeContext:s.context,headers:{"Stripe-Request-Trigger":`event=${s.id}`}},["fetch_related_object"])},s}async parseEventNotificationAsync(e,t,n,i,r,o){if(!this.webhooks.signature)throw Error("ERR: missing signature helper, unable to verify");await this.webhooks.signature.verifyHeaderAsync(e,t,n,i||this.webhooks.DEFAULT_TOLERANCE,r||this._platformFunctions.createDefaultCryptoProvider(),o);let s=e instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(e)):JSON.parse(e);if(s&&s.object==="event")throw Error("You passed a webhook payload to stripe.parseEventNotificationAsync, which expects an event notification. Use stripe.webhooks.constructEventAsync instead.");if(s.context)s.context=K.parse(s.context);return s.fetchEvent=()=>this._requestSender._rawRequest("GET",`/v2/core/events/${s.id}`,void 0,{stripeContext:s.context,headers:{"Stripe-Request-Trigger":`event=${s.id}`}},["fetch_event"]),s.fetchRelatedObject=()=>{if(!s.related_object)return Promise.resolve(null);return this._requestSender._rawRequest("GET",s.related_object.url,void 0,{stripeContext:s.context,headers:{"Stripe-Request-Trigger":`event=${s.id}`}},["fetch_related_object"])},s}}var Aa="api.stripe.com",cc="443",dc="/v1/",uc,mc=80000,pc=5,fc=0.5,hu,_c,kc=(e)=>new re(e,d.MAX_BUFFERED_REQUEST_METRICS);var bc=f(()=>{xi();wl();b();ar();ql();yi();hi();aa();W();Ml();Ci();ls();cs();ds();us();ji();ms();ps();fs();_s();ks();bs();gs();hs();ys();Rs();Ts();vs();Ss();xs();Cs();js();Ps();Es();qs();Os();As();Is();$s();Us();Ms();Ds();Fs();Ns();Gs();Bs();Ls();Ks();Hs();Vs();zs();Ws();Qs();Js();Xs();Ys();Zs();ea();ta();na();ia();ra();oa();sa();Dl();Fl();Nl();Gl();Bl();Ll();Kl();Hl();Vl();zl();Wl();Ql();Jl();Xl();Yl();nc();ic();lc();ws();aa();uc=qr,hu=["name","version","url","partner_id"],_c=["authenticator","apiVersion","typescript","maxNetworkRetries","httpAgent","httpClient","timeout","host","port","protocol","telemetry","emitEventBodies","appInfo","stripeAccount","stripeContext"];w.PACKAGE_VERSION="22.3.2";w.API_VERSION=qr;w.aiAgent="";w.AI_AGENT="";w.USER_AGENT={bindings_version:w.PACKAGE_VERSION,lang:"node",typescript:!1};w.StripeResource=d;w.resources=ae;w.HttpClient=q;w.HttpClientResponse=he;w.CryptoProvider=Re;w.StripeContext=K;w.errors=Si;w.Decimal=M;w._requestSenderFactory=kc});var gc={};Oi(gc,{Decimal:()=>M,Stripe:()=>w,default:()=>yu});var yu;var hc=f(()=>{Tl();Ri();bc();w.initialize(new fr);yu=w});import"@stacksjs/validation";import{log as Ai}from"@stacksjs/cli";import{db as Na}from"@stacksjs/database";async function Yc(e,t={}){let{olderThanDays:n=30,column:i="created_at",query:r}=t;try{if(r){let l=Na.deleteFrom(e);l=r(l);let u=await l.execute(),m=Array.isArray(u)?u:[u],p=Number(m[0]?.numDeletedRows??m.length??0);return Ai.info(`Pruned ${p} records from ${e}`),p}let o=new Date;o.setDate(o.getDate()-n);let s=await Na.deleteFrom(e).where(i,"<",o.toISOString()).execute(),a=Array.isArray(s)?s:[s],c=Number(a[0]?.numDeletedRows??a.length??0);return Ai.info(`Pruned ${c} records from ${e} older than ${n} days`),c}catch(o){throw Ai.error(`Failed to prune ${e}:`,o),o}}async function vf(e,t={}){return Yc(e,t)}function Sf(e){if(!e?.prunable)return null;if(typeof e.prunable==="boolean")return{olderThanDays:30,column:"created_at"};return e.prunable}import{createCipheriv as Zc,createDecipheriv as ed,createHash as td,randomBytes as nd}from"crypto";import{log as ai}from"@stacksjs/logging";var Ga="enc:",Ba="aes-256-gcm",id=12,si=null;async function La(){if(si)return si;let e=process.env.APP_KEY;if(!e)try{e=(await import("@stacksjs/config").catch(()=>null))?.config?.app?.key}catch{}if(!e)return null;return si=td("sha256").update(e).digest(),si}function ue(e){return typeof e==="string"&&e.startsWith(Ga)}async function Ii(e){if(e==null)return e;if(ue(e))return e;if(typeof e!=="string")return e;let t=await La();if(!t)return ai.warn("[orm] encrypted attribute: APP_KEY not set - storing value in plaintext"),e;let n=nd(id),i=Zc(Ba,t,n),r=Buffer.concat([i.update(e,"utf8"),i.final()]),o=i.getAuthTag();return`${Ga}${n.toString("base64")}:${o.toString("base64")}:${r.toString("base64")}`}async function $i(e){if(e==null)return e;if(typeof e!=="string")return e;if(!ue(e))return e;try{let t=await La();if(!t)return ai.warn("[orm] encrypted attribute: APP_KEY not set - cannot decrypt"),null;let[,n,i,r]=e.split(":");if(!n||!i||!r)return ai.warn("[orm] encrypted attribute: malformed envelope, returning null"),null;let o=Buffer.from(n,"base64"),s=Buffer.from(i,"base64"),a=Buffer.from(r,"base64"),c=ed(Ba,t,o);return c.setAuthTag(s),Buffer.concat([c.update(a),c.final()]).toString("utf8")}catch(t){return ai.warn("[orm] encrypted attribute: decrypt failed (key rotation? corrupted ciphertext?)",{error:t}),null}}function Ui(e){let t=e.attributes;if(!t||typeof t!=="object")return[];let n=[];for(let[i,r]of Object.entries(t))if(r&&typeof r==="object"&&r.encrypted===!0)n.push(i);return n}import{sqlDateTime as rd}from"@stacksjs/database";import{log as pe}from"@stacksjs/logging";var od=[/^password$/i,/^password_hash$/i,/^api_key$/i,/_token$/i,/_secret$/i,/^remember_token$/i],Ha="model_audits",Fi=null;function sd(e){Fi=e}async function Mi(){if(Fi!=null)return Fi;try{let e=await import("@stacksjs/router").catch(()=>null);if(!e)return null;let t=e.getCurrentRequest;if(typeof t!=="function")return null;let n=t();if(!n)return null;return(n.user??n._user)?.id??null}catch{return null}}function li(e){if(!e||typeof e!=="object")return null;let t={};for(let[n,i]of Object.entries(e)){if(od.some((r)=>r.test(n)))continue;t[n]=i}return t}function me(e){if(!e||typeof e!=="object")return null;let t=e;if(t._attributes&&typeof t._attributes==="object")return{...t._attributes};return{...e}}function ad(e,t){if(!e||!t)return{old:e,next:t};let n={},i={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(let o of r)if(e[o]!==t[o])n[o]=e[o],i[o]=t[o];return{old:n,next:i}}async function Di(e,t=!1){try{let{db:n}=await import("@stacksjs/database");await n.insertInto(Ha).values({auditable_type:e.auditable_type,auditable_id:e.auditable_id,event:e.event,old_values:e.old_values?JSON.stringify(e.old_values):null,new_values:e.new_values?JSON.stringify(e.new_values):null,user_id:e.user_id,created_at:rd()}).executeTakeFirst()}catch(n){if(pe.warn(`[orm] audit row write failed for ${e.auditable_type}#${String(e.auditable_id)} (${e.event})`,{error:n}),t)throw n}}function Va(e){return{async audits(t){try{let{db:n}=await import("@stacksjs/database");return(await n.selectFrom(Ha).selectAll().where("auditable_type","=",e).where("auditable_id","=",t).orderBy("created_at","desc").execute()??[]).map((r)=>({...r,old_values:typeof r.old_values==="string"?Ka(r.old_values):r.old_values,new_values:typeof r.new_values==="string"?Ka(r.new_values):r.new_values}))}catch(n){return pe.warn(`[orm] audits() lookup failed for ${e}#${String(t)}`,{error:n}),[]}}}}function Ka(e){try{return JSON.parse(e)}catch{return e}}function za(e){if(e&&typeof e==="object"&&"transactional"in e)return{transactional:e.transactional===!0};return{transactional:!1}}function Wa(e,t,n="id",i={}){let r=i.transactional===!0,o=e;if(typeof e.audits!=="function")e.audits=Va(t).audits;let s=async(u)=>{if(!r)return await u();let{db:m}=await import("@stacksjs/database");return await m.transaction(async()=>u())},a=e.create;if(typeof a==="function")e.create=async function(...u){return await s(async()=>{let m=await a.apply(this,u);try{let p=me(m),_=p?.[n];if(_!=null){let k=await Mi();await Di({auditable_type:t,auditable_id:_,event:"created",old_values:null,new_values:li(p),user_id:k},r)}}catch(p){if(pe.warn(`[orm] audit(create) failed for ${t}`,{error:p}),r)throw p}return m})};let c=e.update;if(typeof c==="function")e.update=async function(u,m){return await s(async()=>{let p=o.find,_=typeof p==="function"?me(await p.call(o,u)):null,k=await c.call(this,u,m);try{let g=me(k)??(typeof p==="function"?me(await p.call(o,u)):null),{old:y,next:R}=ad(_,g);if(R&&Object.keys(R).length>0){let v=await Mi();await Di({auditable_type:t,auditable_id:u,event:"updated",old_values:li(y),new_values:li(R),user_id:v},r)}}catch(g){if(pe.warn(`[orm] audit(update) failed for ${t}#${String(u)}`,{error:g}),r)throw g}return k})};let l=(u)=>{let m=e[u];if(typeof m!=="function")return;e[u]=async function(p){return await s(async()=>{let _=o.find,k=typeof _==="function"?me(await _.call(o,p)):null,g=await m.call(this,p);try{if(g!==!1&&k){let y=await Mi();await Di({auditable_type:t,auditable_id:p,event:"deleted",old_values:li(k),new_values:null,user_id:y},r)}}catch(y){if(pe.warn(`[orm] audit(${u}) failed for ${t}#${String(p)}`,{error:y}),r)throw y}return g})}};l("delete"),l("softDelete")}import{db as ld,sql as cd,sqlDateTime as Ni}from"@stacksjs/database";function G(e,t){if(typeof e!=="number"||!Number.isFinite(e)||e<=0)throw Error(`[orm/commentable] ${t} requires a positive numeric id (received ${String(e)})`)}var fe="commentable_upvotes",_e="commentables";function dd(e){let t=e;return t.code==="SQLITE_CONSTRAINT_UNIQUE"||t.code==="SQLITE_CONSTRAINT"||t.code==="23505"||t.errno===1062||/unique|duplicate/i.test(t.message??"")}function Gi(e){let t=ld;return{async comments(n){return G(n,"comments"),await t.selectFrom("commentables").where("commentables_id","=",n).where("commentables_type","=",e).selectAll().execute()},async commentCount(n){let i=await t.selectFrom("commentables").select(cd`count(*) as count`).where("commentables_id","=",n).where("commentables_type","=",e).executeTakeFirst();return Number(i?.count)||0},async addComment(n,i){if(G(n,"addComment"),!i||typeof i.title!=="string"||i.title.trim().length===0)throw Error("[orm/commentable] addComment requires a non-empty comment.title");if(typeof i.body!=="string"||i.body.trim().length===0)throw Error("[orm/commentable] addComment requires a non-empty comment.body");let r=await t.insertInto("commentables").values({...i,commentables_id:n,commentables_type:e,status:"pending",created_at:Ni(),updated_at:Ni()}).returningAll().executeTakeFirst();if(r&&typeof r==="object"&&"id"in r)return r;let o=r?.lastInsertRowid;if(o==null)return r;return await t.selectFrom("commentables").where("id","=",Number(o)).selectAll().executeTakeFirst()},async approvedComments(n){return await t.selectFrom("commentables").where("commentables_id","=",n).where("commentables_type","=",e).where("status","=","approved").selectAll().execute()},async pendingComments(n){return await t.selectFrom("commentables").where("commentables_id","=",n).where("commentables_type","=",e).where("status","=","pending").selectAll().execute()},async rejectedComments(n){return await t.selectFrom("commentables").where("commentables_id","=",n).where("commentables_type","=",e).where("status","=","rejected").selectAll().execute()},async upvoteComment(n,i){G(n,"upvoteComment"),G(i,"upvoteComment");let r=()=>t.selectFrom(fe).where("upvoteable_id","=",n).where("upvoteable_type","=",_e).where("user_id","=",i).selectAll().executeTakeFirst(),o=await r();if(o)return o;try{await t.insertInto(fe).values({upvoteable_id:n,upvoteable_type:_e,user_id:i,created_at:Ni()}).execute()}catch(s){if(!dd(s))throw s}return await r()},async removeCommentUpvote(n,i){G(n,"removeCommentUpvote"),G(i,"removeCommentUpvote"),await t.deleteFrom(fe).where("upvoteable_id","=",n).where("upvoteable_type","=",_e).where("user_id","=",i).execute()},async commentUpvoteCount(n){G(n,"commentUpvoteCount");let i=await t.selectFrom(fe).select("count(*) as count").where("upvoteable_id","=",n).where("upvoteable_type","=",_e).executeTakeFirst();return Number(i?.count)||0},async hasUpvotedComment(n,i){return G(n,"hasUpvotedComment"),G(i,"hasUpvotedComment"),!!await t.selectFrom(fe).where("upvoteable_id","=",n).where("upvoteable_type","=",_e).where("user_id","=",i).selectAll().executeTakeFirst()}}}import{db as ud,sql as md,sqlDateTime as Qa}from"@stacksjs/database";function Bi(e,t){if(typeof e!=="number"||!Number.isFinite(e)||e<=0)throw Error(`[orm/taggable] ${t} requires a positive numeric id (received ${String(e)})`)}function Li(e){let t=ud;return{async tags(n){return Bi(n,"tags"),await t.selectFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).selectAll().execute()},async tagCount(n){Bi(n,"tagCount");let i=await t.selectFrom("taggables").select(md`count(*) as count`).where("taggable_id","=",n).where("taggable_type","=",e).executeTakeFirst();return Number(i?.count)||0},async addTag(n,i){if(Bi(n,"addTag"),!i||typeof i.name!=="string"||i.name.trim().length===0)throw Error("[orm/taggable] addTag requires a non-empty tag.name");return await t.insertInto("taggables").values({...i,taggable_id:n,taggable_type:e,slug:i.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),is_active:!0,created_at:Qa(),updated_at:Qa()}).execute(),await t.selectFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).where("name","=",i.name).selectAll().executeTakeFirst()},async activeTags(n){return await t.selectFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).where("is_active","=",!0).selectAll().execute()},async inactiveTags(n){return await t.selectFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).where("is_active","=",!1).selectAll().execute()},async removeTag(n,i){await t.deleteFrom("taggables").where("taggable_id","=",n).where("taggable_type","=",e).where("id","=",i).execute()}}}import{db as pd,sqlDateTime as ci}from"@stacksjs/database";function Ki(e){let t=pd;async function n(i){return(await t.selectFrom("categorizable_models").where("categorizable_id","=",i).where("categorizable_type","=",e).selectAll().execute()).map((o)=>o.category_id)}return{async categories(i){let r=await n(i);if(r.length===0)return[];return await t.selectFrom("categorizables").where("id","in",r).selectAll().execute()},async categoryCount(i){return(await n(i)).length},async addCategory(i,r){let o=()=>t.selectFrom("categorizables").where("name","=",r.name).where("categorizable_type","=",e).selectAll().executeTakeFirst(),s=await o();if(!s)await t.insertInto("categorizables").values({name:r.name,description:r.description,slug:r.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),categorizable_type:e,is_active:!0,created_at:ci(),updated_at:ci()}).execute(),s=await o();return await t.insertInto("categorizable_models").values({categorizable_id:i,categorizable_type:e,category_id:s.id,created_at:ci(),updated_at:ci()}).execute(),s},async activeCategories(i){let r=await n(i);if(r.length===0)return[];return await t.selectFrom("categorizables").where("id","in",r).where("is_active","=",!0).selectAll().execute()},async inactiveCategories(i){let r=await n(i);if(r.length===0)return[];return await t.selectFrom("categorizables").where("id","in",r).where("is_active","=",!1).selectAll().execute()},async removeCategory(i,r){await t.deleteFrom("categorizable_models").where("categorizable_id","=",i).where("categorizable_type","=",e).where("category_id","=",r).execute()}}}import{db as fd,sqlDateTime as _d}from"@stacksjs/database";function Hi(e,t){let n=fd,i=t?.table||`${e}_likes`,r=t?.foreignKey||`${e.replace(/s$/,"")}_id`;return{async likes(o){return await n.selectFrom(i).where(r,"=",o).selectAll().execute()},async likeCount(o){let s=await n.selectFrom(i).select("count(*) as count").where(r,"=",o).executeTakeFirst();return Number(s?.count)||0},async like(o,s){if(typeof o!=="number"||!Number.isFinite(o)||o<=0)throw Error(`[orm/likeable] like requires a positive numeric id (received ${String(o)})`);if(typeof s!=="number"||!Number.isFinite(s)||s<=0)throw Error(`[orm/likeable] like requires a positive numeric userId (received ${String(s)})`);let a=_d();try{return await n.insertInto(i).values({[r]:o,user_id:s,created_at:a,updated_at:a}).returningAll().executeTakeFirst()}catch(c){let l=c;if(!(l.code==="SQLITE_CONSTRAINT_UNIQUE"||l.code==="SQLITE_CONSTRAINT"||l.code==="23505"||l.errno===1062||/unique|duplicate/i.test(l.message??"")))throw c;let m=await n.selectFrom(i).where(r,"=",o).where("user_id","=",s).selectAll().executeTakeFirst();if(m)return m;throw c}},async unlike(o,s){await n.deleteFrom(i).where(r,"=",o).where("user_id","=",s).execute()},async isLiked(o,s){return!!await n.selectFrom(i).where(r,"=",o).where("user_id","=",s).selectAll().executeTakeFirst()},async likedBy(o){return(await n.selectFrom(i).select([r]).where("user_id","=",o).execute()).map((a)=>Number(a[r])).filter(Boolean)}}}function Ya(e){let t=e;return t?.code==="SQLITE_CONSTRAINT_UNIQUE"||t?.code==="SQLITE_CONSTRAINT"||t?.code==="23505"||t?.errno===1062||/unique|duplicate/i.test(t?.message??"")}function kd(e,t,n){let i=e;if(e instanceof Error&&typeof i.status==="number"&&Number.isInteger(i.status)&&i.status>=400&&i.status<600){let r={error:e.message};if(i.details!==void 0)r.details=i.details;return{status:i.status,body:r}}if(Ya(e))return{status:409,body:{error:`${t} already exists`}};return{status:500,body:{error:`Failed to ${n} ${t}`,detail:String(e)}}}function I(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function bd(e){let t={};for(let[n,i]of Object.entries(e))t[I(n)]=i;return t}function Gf(e,t){let n=String(t||"").replace(/^\/+|\/+$/g,""),i=String(e).replace(/^\/+/,"");return`/api/${n?`${n}/`:""}${i}`}function Bf(e){if(!e)return null;let t=e.attributes??{};if(Object.prototype.hasOwnProperty.call(t,"teamId")||Object.prototype.hasOwnProperty.call(t,"team_id"))return"team_id";return e.belongsTo?.some((n)=>n==="Team")?"team_id":null}function Lf(e,t,n){let i=Object.keys(e).find((o)=>I(o)===I(t));if(Array.isArray(n)){if(i===void 0)return{data:e,error:"Ownership value is required"};if(!n.some((o)=>String(o)===String(e[i])))return{data:e,error:"Ownership value is not available to this caller"};return{data:{...e,[t]:e[i]}}}if(n===null||n===void 0)return{data:e,error:"Caller has no ownership identity"};let r={...e};for(let o of Object.keys(r))if(I(o)===I(t))delete r[o];return r[t]=n,{data:r}}function gd(e){if(!e)return[];let t=Object.entries(e.attributes??{}).filter(([,n])=>n?.fillable===!0).map(([n])=>n);for(let n of e.belongsTo??[]){if(typeof n!=="string"||!n.trim())continue;let i=I(n.trim()).split("_").filter(Boolean);if(i.length===0)continue;let r=`${i[0]}${i.slice(1).map((o)=>`${o[0]?.toUpperCase()}${o.slice(1)}`).join("")}Id`;t.push(r)}return[...new Set(t)]}function hd(e,t){if(!e||t.length===0)return{};let n={};for(let i of t){if(i in e){n[i]=e[i];continue}let r=I(i);if(r!==i&&r in e)n[i]=e[r]}return n}function yd(e,t){if(e?.name!=="date"||t instanceof Date||typeof t!=="string")return t;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(!n)return t;let i=Number(n[1]),r=Number(n[2]),o=Number(n[3]),s=new Date(Date.UTC(i,r-1,o));if(s.getUTCFullYear()!==i||s.getUTCMonth()!==r-1||s.getUTCDate()!==o)return t;return s}function Kf(e,t){if(!t.length)return e;let n={...e};for(let i of t)delete n[i],delete n[I(i)];return n}function Hf(e,t){if(!e||t.length===0)return e;let n={...e};for(let i of t)delete n[i],delete n[I(i)];return n}var Rd=["id","uuid","created_at","updated_at","deleted_at"];function Vf(e,t){let n=new Map;for(let i of[...Object.keys(e??{}),...Rd]){let r=I(i);if(!/^\w+$/.test(r))continue;n.set(i,r),n.set(r,r)}for(let i of t)n.delete(i),n.delete(I(i));return n}function zf(e,t,n){if(!t)return e;let i=String(t).split(",").map((o)=>o.trim()).filter(Boolean),r=e;for(let o of i){let s=o.startsWith("-"),a=s?o.slice(1):o;if(!/^\w+$/.test(a))continue;let c=n.get(a);if(!c)continue;r=r.orderBy(c,s?"desc":"asc")}return r}var Td={string:{get:(e)=>e!=null?String(e):null,set:(e)=>e!=null?String(e):null},number:{get:(e)=>e!=null?Number(e):null,set:(e)=>e!=null?Number(e):null},integer:{get:(e)=>e!=null?Math.trunc(Number(e)):null,set:(e)=>e!=null?Math.trunc(Number(e)):null},float:{get:(e)=>e!=null?Number.parseFloat(String(e)):null,set:(e)=>e!=null?Number.parseFloat(String(e)):null},boolean:{get:(e)=>e===1||e==="1"||e===!0||e==="true",set:(e)=>e===!0||e===1||e==="1"||e==="true"?1:0},json:{get:(e)=>e==null?null:typeof e==="string"?wd(e):e,set:(e)=>e==null?null:typeof e==="string"?e:JSON.stringify(e)},datetime:{get:(e)=>e?new Date(e):null,set:(e)=>e instanceof Date?e.toISOString():e},date:{get:(e)=>e?new Date(e):null,set:(e)=>e instanceof Date?e.toISOString().split("T")[0]:e},array:{get:(e)=>e==null?[]:Array.isArray(e)?e:typeof e==="string"?vd(e):[],set:(e)=>e==null?null:Array.isArray(e)?JSON.stringify(e):e}};function wd(e){try{return JSON.parse(e)}catch{return e}}function vd(e){try{return JSON.parse(e)}catch{return[]}}function Wf(e,t,n){if(!e||typeof e!=="object"||!t||Object.keys(t).length===0)return e;let i={...e};for(let[r,o]of Object.entries(t)){let s=typeof o==="string"?Td[o]:o;if(!s||typeof s[n]!=="function")continue;if(Object.prototype.hasOwnProperty.call(i,r))i[r]=s[n](i[r]);let a=I(r);if(a!==r&&Object.prototype.hasOwnProperty.call(i,a))i[a]=s[n](i[a])}return i}function Za(e,t,n){let i=t?.attributes??{},r={};for(let[o,s]of Object.entries(i)){let a=s?.validation?.rule;if(!a||typeof a.validate!=="function")continue;let c=Object.prototype.hasOwnProperty.call(e,o);if(!c&&n==="updating")continue;let l=s!==null&&typeof s==="object"&&Object.prototype.hasOwnProperty.call(s,"default"),u=c?e[o]:l?s.default:void 0,m=yd(a,u),p=a.validate(m);if(!p?.valid&&Array.isArray(p?.errors)&&p.errors.length>0)r[o]=p.errors.map((_)=>s?.validation?.message?.[_?.code]??_?.message??"invalid")}return Object.keys(r).length===0?{valid:!0}:{valid:!1,errors:r}}function Qf(e,t,n){let i=Ja(n);return e.find((r)=>r.method===t&&Ja(String(r.path??""))===i)}function Ja(e){return e.replace(/\{[^}]*\}/g,"{}").replace(/:[^/]+/g,"{}")}function Vi(e){if(Array.isArray(e))return e.filter((t)=>typeof t==="string"&&t.length>0);return typeof e==="string"&&e?[e]:[]}function Jf(e){let t=typeof e==="object"&&e!==null&&"middleware"in e,n=e?.middleware;if(!t)return{read:["auth"],write:["auth"],declared:!1};if(n&&typeof n==="object"&&!Array.isArray(n)){let r=n;return{read:"read"in r?Vi(r.read):["auth"],write:"write"in r?Vi(r.write):["auth"],declared:!0}}let i=Vi(n);return{read:i,write:i,declared:!0}}var Xa=15,Sd=100;function Xf(e){let t=Number.parseInt(e.get("page")||String(1),10),n=Number.isFinite(t)?Math.max(1,t):1,i=Number.parseInt(e.get("per_page")||String(Xa),10),r=Math.min(Number.isFinite(i)?Math.max(1,i):Xa,Sd);return{page:n,perPage:r,offset:(n-1)*r}}function di(e,t){let n=new URL(e.toString());return n.searchParams.set("page",String(t)),`${n.pathname}${n.search}`}function xd(e,t,n,i,r,o){let s=(t-1)*n,a=i===0,c={page:t,per_page:n,from:a?null:s+1,to:a?null:s+i,has_more_pages:r,prev_page_url:t>1?di(e,t-1):null,next_page_url:r?di(e,t+1):null};if(o!==void 0&&!Number.isNaN(o)){let l=Math.max(1,Math.ceil(o/n));c.total=o,c.last_page=l,c.first_page_url=di(e,1),c.last_page_url=di(e,l)}return c}function Yf(e,t,n,i,r,o){let{page:s,...a}=xd(e,t,n,i,r,o);return{current_page:s,...a}}import{cacheRequestQuery as Cd}from"@stacksjs/router";var ui=new WeakMap;function t_(e,t){return Cd(`batchLoad:${e.name??"model"}:${String(t)}`,async()=>new Promise((n,i)=>{let r=ui.get(e);if(!r)r={keys:[],resolvers:[],scheduled:!1},ui.set(e,r);if(r.keys.push(t),r.resolvers.push({key:t,resolve:n,reject:i}),r.scheduled)return;r.scheduled=!0,Promise.resolve().then(async()=>{let o=ui.get(e);if(!o)return;ui.delete(e);let s=Array.from(new Set(o.keys));try{let a=typeof e.findMany==="function"?await e.findMany(s):await Promise.all(s.map((l)=>e.find?.(l))),c=new Map;for(let l of a??[]){let u=l?.id;if(u!==void 0)c.set(u,l)}for(let l of o.resolvers)l.resolve(c.get(l.key))}catch(a){for(let c of o.resolvers)c.reject(a)}})}))}import{db as o_}from"@stacksjs/database";class jd{conditions=[];where(e,...t){let[n,i]=t,r=i===void 0?"=":n,o=i===void 0?n:i;this.addCondition("and","where",e,r,o)}orWhere(e,...t){let[n,i]=t,r=i===void 0?"=":n,o=i===void 0?n:i;this.addCondition("or","where",e,r,o)}whereIn(e,t){this.conditions.push({type:"and",method:"whereIn",column:e,values:t})}whereNotIn(e,t){this.conditions.push({type:"and",method:"whereIn",column:e,values:t,operator:"not in"})}whereNull(e){this.conditions.push({type:"and",method:"whereNull",column:e})}whereNotNull(e){this.conditions.push({type:"and",method:"whereNotNull",column:e})}whereBetween(e,t){this.conditions.push({type:"and",method:"whereBetween",column:e,range:t})}whereExists(e){this.conditions.push({type:"and",method:"whereExists",column:"",callback:e})}addCondition(e,t,n,i,r){this.conditions.push({type:e,method:t,column:n,operator:i,value:r})}getConditions(){return this.conditions}}import{db as zi,runInTransactionScope as Pd}from"@stacksjs/database";async function l_(e,t){return await Pd(async()=>await zi.transaction(e,t))}async function c_(e){return await zi.savepoint(e)}function d_(e,t){return zi.transactional(e,t)}import{path as B}from"@stacksjs/path";import{fs as ne,globSync as Xi}from"@stacksjs/storage";import{plural as rl,singular as el,snakeCase as E}from"@stacksjs/strings";import{isString as mi}from"@stacksjs/validation";function ol(e){let t=e.belongsToMany;if(!t)return[];if(Array.isArray(t))return t.map((n)=>({relationName:typeof n==="string"?E(n):E(String(n.model)),relation:n}));return Object.entries(t).map(([n,i])=>{if(typeof i==="string")return{relationName:n,relation:i};return{relationName:n,relation:{model:i.model,pivotTable:i.table,firstForeignKey:i.foreignKey,secondForeignKey:i.relatedKey}}})}async function k_(e){if(typeof e==="string")e=(await import(e)).default;return e.table??E(rl(e?.name||""))}function ke(e,t){if(e.name)return e.name;return B.basename(t).replace(/\.ts$/,"")}function F(e,t){if(e.table)return e.table;return E(rl(ke(e,t)))}function Ed(e,t){let n=[e,t];return n.sort(),n.join("_")}function b_(e,t){return t in e}async function qd(e,t){let n=[];if(e.hasOne)for(let i of e.hasOne)n.push(await Wi(i,e,t,"hasOne"));if(e.hasMany)for(let i of e.hasMany)n.push(await Wi(i,e,t,"hasMany"));if(e.belongsTo)for(let i of e.belongsTo)n.push(await Wi(i,e,t,"belongsTo"));if(e.hasOneThrough)for(let i of e.hasOneThrough)n.push(await nl(i,e,t,"hasOneThrough"));if(e.hasManyThrough)for(let i of e.hasManyThrough)n.push(await nl(i,e,t,"hasManyThrough"));if(e.belongsToMany)for(let{relationName:i,relation:r}of ol(e))n.push(await Ad(r,e,t,"belongsToMany",i));if(e.morphOne)n.push(await il(e.morphOne,e,t,"morphOne"));if(e.morphMany){let i=Array.isArray(e.morphMany)?e.morphMany:[e.morphMany];for(let r of i)n.push(await il(r,e,t,"morphMany"))}if(e.morphTo){let i=e.morphTo,r=Array.isArray(i)?i:typeof i==="object"&&i!==null?[i]:[];for(let o of r)n.push(Od(o,e,t))}if(e.morphToMany){let i=Array.isArray(e.morphToMany)?e.morphToMany:[e.morphToMany];for(let r of i)n.push(tl(r,e,t,"morphToMany"))}if(e.morphedByMany){let i=Array.isArray(e.morphedByMany)?e.morphedByMany:[e.morphedByMany];for(let r of i)n.push(tl(r,e,t,"morphedByMany"))}return n}function Od(e,t,n){let i=e&&typeof e==="object"&&e.name?String(e.name):`${E(n)}able`,r=e?.type||`${i}_type`;return{relationship:"morphTo",model:"",table:"",relationTable:"",foreignKey:e?.id||`${i}_id`,modelKey:r,relationName:i,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:"",pivotKey:"",pivotTable:""}}function tl(e,t,n,i){let r=typeof e==="object"&&e!==null,o=r?String(e.model||""):String(e),s=r&&e.morphName?String(e.morphName):`${E(n)}able`,a=r&&e.pivotTable?String(e.pivotTable):s,c=r&&e.id||`${s}_id`,l=r&&e.type||`${s}_type`;return{relationship:i,model:o,table:"",relationTable:"",foreignKey:c,modelKey:l,relationName:s,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:c,pivotKey:l,pivotTable:a}}async function pi(e,t){let n=Ji(`${t}.ts`),i=Ji(`${e}.ts`),r=Qi(`${e}.ts`),o=Qi(`${t}.ts`);if(!n&&!o)throw Error(`Model not found: ${t}`);if(!i&&!r)throw Error(`Model not found: ${e}`);let s;try{if(ne.existsSync(n))s=(await import(n)).default;else s=(await import(o)).default}catch(c){throw Error(`Failed to load model: ${t}. Error: ${c?.message||"Unknown error"}`)}let a=ne.existsSync(i)?i:r;return{modelRelation:s,modelPath:a,modelRelationPath:ne.existsSync(n)?n:o}}async function nl(e,t,n,i){let r="",o="",s="",a="";if(mi(e))r=e;else r=e.model,o=e.relationName||"",s=e.through,a=e.throughForeignKey||"";let{modelRelation:c,modelPath:l,modelRelationPath:u}=await pi(n,r),m=F(c,u),p=F(t,l),_=E(ke(c,u)),k=E(n);return{relationship:i,model:r,table:m,relationTable:p,foreignKey:`${k}_id`,modelKey:`${_}_id`,relationName:o,relationModel:n,throughModel:s,throughForeignKey:a,pivotForeign:`${k}_id`,pivotKey:`${_}_id`,pivotTable:p}}async function Ad(e,t,n,i,r){let o="",s="",a="",c=E(n);if(mi(e))o=e;else o=e.model,s=e.pivotTable||"",a=e.firstForeignKey||`${c}_id`;let{modelRelation:l,modelPath:u,modelRelationPath:m}=await pi(n,o),p=F(l,m),_=F(t,u),k=E(ke(l,m));return{relationship:i,model:o,table:p,relationTable:_,foreignKey:typeof e==="string"?`${c}_id`:e.firstForeignKey||`${c}_id`,modelKey:typeof e==="string"?`${k}_id`:e.secondForeignKey||`${k}_id`,relationName:r,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:a,pivotKey:`${k}_id`,pivotTable:s}}async function il(e,t,n,i){let r="",o="",s="",a="";if(mi(e))r=e,o=`${E(n)}able`;else r=e.model,o=e.morphName||`${E(n)}able`,s=e.type||`${o}_type`,a=e.id||`${o}_id`;let{modelRelation:c,modelPath:l,modelRelationPath:u}=await pi(n,r),m=F(c,u),p=F(t,l);return{relationship:i,model:r,table:m,relationTable:p,foreignKey:a||`${o}_id`,modelKey:s||`${o}_type`,relationName:o,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:"",pivotKey:"",pivotTable:p}}async function Wi(e,t,n,i){let r="",o="";if(mi(e))r=e;else r=e.model,o=e.relationName||"";let{modelRelation:s,modelPath:a,modelRelationPath:c}=await pi(n,r),l=F(s,c),u=F(t,a),m=E(ke(s,c)),p=E(n),_=typeof e==="string"?"":e.foreignKey||"",k={relationship:i,model:r,table:l,relationTable:u,foreignKey:_||`${p}_id`,modelKey:`${m}_id`,relationName:o,relationModel:n,throughModel:"",throughForeignKey:"",pivotForeign:`${p}_id`,pivotKey:`${m}_id`,pivotTable:u};if(i==="belongsTo"){if(k.foreignKey="",_)k.modelKey=_}return k}function g_(e){let t=/belongs/,n=/has/,i=/Through/,r=/morph/;if(i.test(e))return"throughType";if(t.test(e))return"belongsType";if(n.test(e))return"hasType";if(r.test(e))return"morphType";return""}function h_(e){let t=/One/;if(/Many/.test(e))return"many";if(t.test(e))return"one";return""}async function y_(e,t){let n=[];if("belongsToMany"in e){for(let{relation:i}of ol(e)){let r,o;if(typeof i==="string")o=i;else o=i.model;let s=Ji(`${o}.ts`),a=Qi(`${o}.ts`);if(ne.existsSync(s))r=(await import(s)).default;else r=(await import(a)).default;let c=F(r,s),l=F(e,t),u=typeof i==="object"&&"firstForeignKey"in i?i.firstForeignKey:`${el(l)}_${e.primaryKey}`,m=typeof i==="object"&&"secondForeignKey"in i?i.secondForeignKey:`${el(c)}_${e.primaryKey}`;n.push({table:(typeof i==="object"&&"pivotTable"in i?i.pivotTable:void 0)??Ed(l,c),firstForeignKey:u,secondForeignKey:m})}return n}return[]}async function R_(e){let t=Xi([B.userModelsPath("*.ts"),B.storagePath("framework/defaults/app/Models/**/*.ts")],{absolute:!0}),n=[];for(let i=0;i<t.length;i++){let r=t[i],o=await import(r);if(e===o.default.name)continue;let s=ke(o,r),a=await qd(o.default,s);if(!a.length)continue;let c=a.find((l)=>l.model===e);if(c)n.push(c)}return n}function T_(e){if(e===void 0)return[];return Object.keys(e).filter((t)=>e[t]?.hidden===!0)}function w_(e){let t=e.attributes;if(t===void 0)return[];return Object.keys(t).filter((n)=>t[n]?.guarded===!0).map((n)=>E(n))}function v_(e,t){let n=e.attributes,i=[];if(n===void 0)return[];let r=typeof e.traits?.billable==="object"||typeof e.traits?.billable==="boolean",o=typeof e.traits?.useAuth==="object"?e.traits?.useAuth.usePasskey:!1,s=e.traits?.useUuid||!1;if(r)i.push("stripe_id");if(s)i.push("uuid");if(o)i.push(...["two_factor_secret","public_key"]);let a=t.map((c)=>c.foreignKey).filter((c)=>c);return[...Object.keys(n).filter((c)=>{if(n===void 0)return!1;return n[c]?.fillable===!0}).map((c)=>E(c)),...i,...a]}async function S_(e,t){let n=e.attributes;if(!n)n={};let i=Object.keys(n),r=[],o=Bun.file(t),s="";try{if(await o.exists())s=await o.text()}catch{s=""}let a=/rule:.*$/gm,c;c=a.exec(s);while(c!==null)r.push(c[0]),c=a.exec(s);return i.map((u,m)=>{let p=n[u],_=null,k=!1,g=!1,y=!1,R=!1;if(p)_=p||null,k=p.unique||!1,g=p.hidden||!1,y=p.fillable||!1;let v=r[m]??"";return R=(p.validation?.rule).isRequired??!1,{field:u,default:_,unique:k,hidden:g,fillable:y,required:R,fieldArray:Id(v)}})}function Id(e){let t=e.split("rule: schema.");if(t.length!==2)return null;if(!t[1])t[1]="";let n=t[1].replace(/,/g,"");if(!n)return null;let i=n.split("."),r=/\(([^)]+)\)/;return i.map((o)=>{let s=r.exec(o),a=s?s[1]:null;return{entity:o.replace(r,"").replace(/\(|\)/g,""),charValue:a}})[0]||null}function x_(e){let t=e.fieldArray?.entity;switch(t){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 t}}function Qi(e){let t=B.join(B.storagePath("framework/defaults/app/Models"),"/"),n=B.join(t,e);if(ne.existsSync(n))return n;return Xi(`${t}**/${e}`,{absolute:!0})[0]??""}function Ji(e){let t=B.join(B.userModelsPath("/"),"/"),n=B.join(t,e);if(ne.existsSync(n))return n;return Xi(`${t}**/${e}`,{absolute:!0})[0]??""}function C_(e){let t=typeof e==="number"?new Date(e):typeof e==="string"?new Date(e):e;if(Number.isNaN(t.getTime()))throw Error(`Invalid date value: ${String(e)}`);return t.toISOString().replace("T"," ").split(".")[0]??""}function j_(e){return e.toISOString().split("T")[0]??""}function P_(e){return e.getTime()}import{createModel as Su,registerModel as xu}from"@stacksjs/query-builder";import{log as A}from"@stacksjs/logging";import{snakeCase as H}from"@stacksjs/strings";import{AsyncLocalStorage as qc}from"async_hooks";function $d(e){if(e===null||typeof e!=="object")return!1;let t=e;return Array.isArray(t.data)&&typeof t.current_page==="number"&&typeof t.per_page==="number"&&typeof t.total==="number"&&typeof t.last_page==="number"}function Ud(e){if(e===null||typeof e!=="object")return!1;let t=e;return Array.isArray(t.data)&&typeof t.current_page==="number"&&typeof t.per_page==="number"&&typeof t.has_more_pages==="boolean"&&!("total"in t)}function Md(e){if(e===null||typeof e!=="object")return!1;let t=e;return Array.isArray(t.data)&&(typeof t.next_cursor==="string"||t.next_cursor===null)}function Yi(e){let{data:t}=e,{perPage:n,page:i,total:r,lastPage:o}=e.meta,s=t.length===0,a=s?null:(i-1)*n+1,c=s?null:a+t.length-1;return{data:t,current_page:i,per_page:n,total:r,last_page:o,from:a,to:c,has_more_pages:i<o}}function Zi(e){return{data:e.data,current_page:e.meta.page,per_page:e.meta.perPage,has_more_pages:e.meta.hasMore}}function er(e){return{data:e.data,per_page:e.meta.perPage,next_cursor:sl(e.meta.nextCursor),prev_cursor:sl(e.meta.prevCursor),has_more_pages:e.meta.nextCursor!==null&&e.meta.nextCursor!==void 0}}function sl(e){if(e===null||e===void 0)return null;if(typeof e==="string")return e;return JSON.stringify(e)}function nr(e,t){let n=or(),i=n?tr(n,"per_page"):void 0,r=n?tr(n,"page"):void 0,o=e!==void 0?Math.max(1,Math.floor(e)):Math.min(100,Math.max(1,i??15)),s=Math.max(1,Math.floor(t??r??1));return{perPage:o,page:s}}function ir(e,t){let n=or(),i=n?ll(n,"cursor"):void 0,r=n?tr(n,"per_page"):void 0,o=e!==void 0?Math.max(1,Math.floor(e)):Math.min(100,Math.max(1,r??15)),a=al(t!==void 0?t:i??null);return{perPage:o,cursor:a}}function al(e){if(e===null||e===void 0)return null;if(Array.isArray(e))return e;if(typeof e==="string"&&e.startsWith("["))try{let t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e}function rr(e){let t=or();if(!t)return e;let n=(()=>{try{return new URL(t.url)}catch{return null}})();if(!n)return e;let i=n.pathname;if(e.path=i,"next_cursor"in e)return e.next_page_url=e.next_cursor!==null?Y(n,{cursor:e.next_cursor}):null,e.prev_page_url=e.prev_cursor!==null?Y(n,{cursor:e.prev_cursor}):null,e;let r=e.current_page;if(e.prev_page_url=r>1?Y(n,{page:r-1}):null,"total"in e){let o=e.last_page;e.next_page_url=r<o?Y(n,{page:r+1}):null,e.first_page_url=Y(n,{page:1}),e.last_page_url=Y(n,{page:o})}else e.next_page_url=e.has_more_pages?Y(n,{page:r+1}):null;return e}function Y(e,t){let n=new URL(e.toString());for(let[i,r]of Object.entries(t))n.searchParams.set(i,String(r));return`${n.pathname}${n.search}`}var ie;function or(){if(ie===null)return;if(ie===void 0)try{let t=T("@stacksjs/router");if(typeof t.getCurrentRequest==="function")ie=t.getCurrentRequest;else{ie=null;return}}catch{ie=null;return}return ie()}function tr(e,t){let n=ll(e,t);if(n===void 0)return;let i=Number(n);return Number.isFinite(i)?i:void 0}function ll(e,t){let n=e.query?.[t];if(n===void 0)return;return Array.isArray(n)?n[0]:n}import{db as Ru}from"@stacksjs/database";function yc(e){let t=Ru;return{async createStripeUser(n,i){let{manageCustomer:r}=await import("@stacksjs/payments");return await r.createStripeCustomer(n,i)},async updateStripeUser(n,i){let{manageCustomer:r}=await import("@stacksjs/payments");return await r.updateStripeCustomer(n,i)},async deleteStripeUser(n){let{manageCustomer:i}=await import("@stacksjs/payments");return await i.deleteStripeUser(n)},async createOrGetStripeUser(n,i){let{manageCustomer:r}=await import("@stacksjs/payments");return await r.createOrGetStripeUser(n,i)},async retrieveStripeUser(n){let{manageCustomer:i}=await import("@stacksjs/payments");return await i.retrieveStripeUser(n)},async defaultPaymentMethod(n){let{managePaymentMethod:i}=await import("@stacksjs/payments");return await i.retrieveDefaultPaymentMethod(n)},async setDefaultPaymentMethod(n,i){let{managePaymentMethod:r}=await import("@stacksjs/payments");return await r.setDefaultPaymentMethod(n,i)},async addPaymentMethod(n,i){let{managePaymentMethod:r}=await import("@stacksjs/payments");return await r.addPaymentMethod(n,i)},async paymentMethods(n,i){let{managePaymentMethod:r}=await import("@stacksjs/payments");return await r.listPaymentMethods(n,i)},async newSubscription(n,i,r,o={}){let{manageSubscription:s}=await import("@stacksjs/payments"),a=await s.create(n,i,r,o),l=a.latest_invoice?.payment_intent;return{subscription:a,paymentIntent:l}},async updateSubscription(n,i,r,o={}){let{manageSubscription:s}=await import("@stacksjs/payments"),a=await s.update(n,i,r,o),l=a.latest_invoice?.payment_intent;return{subscription:a,paymentIntent:l}},async cancelSubscription(n,i,r={}){let{manageSubscription:o}=await import("@stacksjs/payments");return{subscription:await o.cancel(i,r)}},async activeSubscription(n){let{manageSubscription:i}=await import("@stacksjs/payments"),r=await t.selectFrom("subscriptions").where("user_id","=",n.id).where("provider_status","=","active").selectAll().executeTakeFirst();if(r){let o=await i.retrieve(n,r.provider_id||"");return{subscription:r,providerSubscription:o}}return},async checkout(n,i,r={}){let{manageCheckout:o,manageCustomer:s}=await import("@stacksjs/payments"),a={};if(r.enableTax)a.automatic_tax={enabled:!0},delete r.enableTax;if(r.allowPromotions)a.allow_promotion_codes=!0,delete r.allowPromotions;let u={...{mode:"payment",customer:(await s.createOrGetStripeUser(n,{})).id,line_items:i.map((m)=>({price:m.priceId,quantity:m.quantity||1}))},...a,...r};return await o.create(n,u)},async createSetupIntent(n,i={}){let{manageSetupIntent:r}=await import("@stacksjs/payments");return await r.create(n,i)},async subscriptionHistory(n){let{manageInvoice:i}=await import("@stacksjs/payments");return await i.list(n)},async transactionHistory(n){let{manageTransaction:i}=await import("@stacksjs/payments");return await i.list(n)},async connectAccount(n,i={}){let r=i.accountColumn||"stripe_account_id",o=(n._attributes??n)[r];if(!o)return null;let s=await ti();try{return await s.accounts.retrieve(o)}catch{return null}},async createConnectAccount(n,i={}){let r=i.accountColumn||"stripe_account_id",o=n._attributes??n,s=o[r],a=await ti();if(!s){let{stacksIdempotencyKey:c}=await import("@stacksjs/payments"),l=i.modelTable||e,u=await a.accounts.create({type:i.type??"express",email:i.email??o.email,country:i.country??"US",capabilities:i.capabilities??{card_payments:{requested:!0},transfers:{requested:!0}}},{idempotencyKey:c("connect.account.create",l,o.id)});return s=u.id,await t.updateTable(l).set({[r]:s}).where("id","=",Number(o.id)).execute(),u}return await a.accounts.retrieve(s)},async connectOnboardLink(n,i){let r=i.accountColumn||"stripe_account_id",s=(n._attributes??n)[r];if(!s)throw Error("connectOnboardLink: model has no Stripe Connect account; call createConnectAccount first");return{url:(await(await ti()).accountLinks.create({account:s,refresh_url:i.refreshUrl,return_url:i.returnUrl,type:i.type??"account_onboarding"})).url,accountId:s}},async syncConnectStatus(n,i={}){let r=i.accountColumn||"stripe_account_id",o=i.chargesColumn||"charges_enabled",s=i.payoutsColumn||"payouts_enabled",a=n._attributes??n,c=a[r];if(!c)return{chargesEnabled:!1,payoutsEnabled:!1};let u=await(await ti()).accounts.retrieve(c),m=!!u.charges_enabled,p=!!u.payouts_enabled,_=i.modelTable||e;return await t.updateTable(_).set({[o]:m,[s]:p}).where("id","=",Number(a.id)).execute(),{chargesEnabled:m,payoutsEnabled:p}},async chargeWithSplit(n,i){let r=await ti(),o=i.accountColumn||"stripe_account_id",s=n._attributes??n,a=i.connectAccountId||s[o],c={amount:i.amountCents,currency:i.currency||"usd",automatic_payment_methods:{enabled:!0},metadata:i.metadata};if(a){if(c.transfer_data={destination:a},i.platformFeeCents)c.application_fee_amount=i.platformFeeCents}let{freshIdempotencyKey:l}=await import("@stacksjs/payments");return await r.paymentIntents.create(c,{idempotencyKey:l("payment_intent.create",s.id,i.amountCents)})}}}async function ti(){let e=globalThis.process?.env?.STRIPE_SECRET_KEY;if(!e)throw Error("Stripe Connect: STRIPE_SECRET_KEY not configured");return new(await Promise.resolve().then(() => (hc(),gc))).default(e,{apiVersion:"2026-06-24.dahlia"})}function Rc(){return{async generateTwoFactorForModel(e){let{generateTwoFactorSecret:t}=await import("@stacksjs/auth"),n=t();await e.update({two_factor_secret:n})},async verifyTwoFactorCode(e,t){let n=e.get("two_factor_secret");if(typeof n!=="string")return!1;let{verifyTwoFactorCode:i,RateLimiter:r}=await import("@stacksjs/auth"),o=String(e.id??e.get?.("id")??e.get?.("email")??n),s=`2fa:${o}`;if(await r.isRateLimited(s)){let{HttpError:c}=await import("@stacksjs/error-handling");throw new c(429,"Too many verification attempts. Please try again later.")}if(!await i(t,n))return await r.recordFailedAttempt(s),!1;try{let{cache:c}=await import("@stacksjs/cache"),l=`2fa:used:${o}:${t}`;if(await c.has(l))return await r.recordFailedAttempt(s),!1;await c.set(l,"1",90)}catch{}return await r.resetAttempts(s),!0}}}import{sqlDateTime as Tu}from"@stacksjs/database";import{log as le}from"@stacksjs/logging";var Pi="deleted_at";function Tc(e,t="id"){return{async softDelete(n){let i=Tu(),r=e.where(t,n);if(typeof r?.update==="function")return await r.update({[Pi]:i}),!0;return!1},async restore(n){let i=e.where(t,n);if(typeof i?.update==="function")return await i.update({[Pi]:null}),!0;return!1},async forceDelete(n){let i=e.where(t,n);if(typeof i?.delete==="function")return await i.delete(),!0;return!1},withTrashed(){return typeof e.query==="function"?e.query():e},onlyTrashed(){let n=typeof e.query==="function"?e.query():e;if(typeof n?.whereNotNull==="function")return n.whereNotNull(Pi);return n?.where?.(Pi,"!=",null)??n}}}function wc(e){if(e===!0||e==null)return{};if(typeof e==="object"&&!Array.isArray(e)){let t=e;if(Array.isArray(t.cascade)){let n=t.cascade.filter((i)=>typeof i==="string");return n.length?{cascade:n}:{}}return{}}return{}}function wu(e,t){let n=e.hasMany??[],i=e.hasOne??[],r=n.some((u)=>Ia(u,t,!0)),o=i.some((u)=>Ia(u,t,!1));if(!r&&!o)return le.warn(`[orm] soft-delete cascade: '${t}' is not a declared hasMany/hasOne relation - skipping`),null;let a=(r?n:i).find((u)=>Ia(u,t,r))??null;if(!a)return null;let l=globalThis[a];if(!l)return le.warn(`[orm] soft-delete cascade: model '${a}' is not yet on globalThis - skipping cascade for '${t}'`),null;return{className:a,model:l}}function Ia(e,t,n){let i=e.toLowerCase();if(t===i)return!0;if(n&&t===`${i}s`)return!0;if(n&&i.endsWith("y")&&t===`${i.slice(0,-1)}ies`)return!0;return!1}async function vu(e,t,n,i,r){try{let o=n.where;if(typeof o!=="function"){le.warn(`[orm] cascade ${r}: child model has no .where()`);return}if(r==="softDelete"){let s=n.softDelete;if(typeof s==="function"){let c=o.call(n,i,t),l=typeof c?.get==="function"?await c.get():Array.isArray(c)?c:[],u=n.primaryKey||"id";for(let m of l){let p=m?.[u];if(p!=null)await s.call(n,p)}return}let a=o.call(n,i,t);if(typeof a?.delete==="function"){le.debug(`[orm] cascade soft-delete: child has no softDeletes trait, hard-deleting from ${String(n.table??"?")}`),await a.delete();return}}else{let s=n.restore;if(typeof s!=="function"){le.debug("[orm] cascade restore: child has no restore() - nothing to do");return}let a=n.withTrashed,l=(typeof a==="function"?a.call(n):n).where?.(i,t),u=typeof l?.get==="function"?await l.get():[],m=n.primaryKey||"id";for(let p of u){let _=p?.[m];if(_!=null)await s.call(n,_)}}}catch(o){if(le.warn(`[orm] soft-delete cascade ${r} on ${e}#${String(t)} failed`,{error:o}),process.env.STACKS_ORM_CASCADE_SWALLOW!=="true")throw o}}async function ni(e,t,n,i){let r=t.cascade;if(!r||r.length===0)return;let o=`${e.name.toLowerCase()}_id`;for(let s of r){let a=wu(e,s);if(!a)continue;await vu(a.className,n,a.model,o,i)}}var Oc=new qc;function te(){return Oc.getStore()?.suppressed===!0}function ee(e){return Promise.resolve(Oc.run({suppressed:!0},e))}var Ac=new qc;function Cu(){return Ac.getStore()?.suppressed===!0}function ju(e){return Promise.resolve(Ac.run({suppressed:!0},e))}var Fa=Symbol.for("stacks.orm.modelDefinition");class Ic extends Error{status=422;errors;constructor(e,t){let n=Object.keys(t).join(", ");super(`${e} validation failed: ${n}`);this.name="ModelValidationError",this.errors=t}}var vc=new Set;function Pu(e,t){let n=typeof e==="string"?e.slice(0,80):String(e),i=`${typeof e}:${n}`;if(vc.has(i))return;vc.add(i);let r=t instanceof Error?t.message:String(t);console.error(`[orm] JSON cast failed to parse value (returning null): ${r} - value preview: ${JSON.stringify(n)}`)}var Eu={string:{get:(e)=>e!=null?String(e):null,set:(e)=>e!=null?String(e):null},number:{get:(e)=>e!=null?Number(e):null,set:(e)=>e!=null?Number(e):null},integer:{get:(e)=>e!=null?Math.trunc(Number(e)):null,set:(e)=>e!=null?Math.trunc(Number(e)):null},float:{get:(e)=>e!=null?Number.parseFloat(String(e)):null,set:(e)=>e!=null?Number.parseFloat(String(e)):null},boolean:{get:(e)=>e===1||e==="1"||e===!0||e==="true",set:(e)=>e===!0||e===1||e==="1"||e==="true"?1:0},json:{get:(e)=>{if(e==null)return null;if(typeof e==="string")try{return JSON.parse(e)}catch(t){return Pu(e,t),null}return e},set:(e)=>{if(e==null)return null;return typeof e==="string"?e:JSON.stringify(e)}},datetime:{get:(e)=>e?new Date(e):null,set:(e)=>e instanceof Date?e.toISOString():e},date:{get:(e)=>e?new Date(e):null,set:(e)=>e instanceof Date?e.toISOString().split("T")[0]:e},array:{get:(e)=>{if(e==null)return[];if(Array.isArray(e))return e;if(typeof e==="string")try{return JSON.parse(e)}catch{return[]}return[]},set:(e)=>{if(e==null)return null;return Array.isArray(e)?JSON.stringify(e):e}}};function $c(e){return typeof e==="string"?Eu[e]:e}function Sc(e,t,n){if(!e||typeof e!=="object")return e;let i={...e};for(let[r,o]of Object.entries(t))if(r in i){let s=$c(o);i[r]=s[n](i[r])}return i}var Ei=new Set(["_attributes","_original","_definition","_hasSaved","_relations"]),xc=Symbol.for("stacks.modelInstanceProxy"),qu={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 Ou(e,t){if(!e||!t)return null;let n=t.split("."),i=e;for(let r of n){if(i==null||typeof i!=="object")return null;let o=i;if("_attributes"in o&&o._attributes&&typeof o._attributes==="object"){let s=o._attributes;if(r in s){i=s[r];continue}}if(r in o){i=o[r];continue}return null}return i??null}function D(e,t){if(!e||typeof e!=="object")return e;if(e[xc])return e;let n=e._attributes;if(!n||typeof n!=="object")return e;if(t&&Object.keys(t).length>0){for(let[i,r]of Object.entries(t))if(Object.prototype.hasOwnProperty.call(n,i))n[i]=$c(r).get(n[i])}return new Proxy(e,{get(i,r,o){if(r===xc)return!0;if(r==="saveAsync")return async function(){let a=i._definition,c=a?.set;if(c&&typeof i.isDirty==="function"){for(let[u,m]of Object.entries(c)){if(typeof m!=="function")continue;if(!i.isDirty(u))continue;let p=m(i._attributes),_=p&&typeof p.then==="function"?await p:p;i._attributes[u]=_}let l=a.set;a.set={};try{return i.save()}finally{a.set=l}}return i.save()};if(r==="save")return function(){let a=i._definition,c=a?.set;if(c&&Object.keys(c).length>0&&typeof i.isDirty==="function"){for(let[u,m]of Object.entries(c)){if(typeof m!=="function")continue;if(!i.isDirty(u))continue;let p=m(i._attributes);if(p&&typeof p.then==="function")throw Error(`Setter for "${u}" returned a Promise - use \`saveAsync()\` instead of \`save()\` when a model has async setters.`);i._attributes[u]=p}let l=a.set;a.set={};try{return i.save()}finally{a.set=l}}return i.save()};if(r==="updateAsync")return async function(a){if(a&&typeof a==="object"&&!Array.isArray(a))for(let[c,l]of Object.entries(a))o[c]=l;return o.saveAsync()};if(r==="saveQuietly")return function(){return ee(()=>i.save())};if(r==="saveAsyncQuietly")return function(){return ee(()=>o.saveAsync())};if(r==="updateQuietly")return function(a){return ee(()=>i.update(a))};if(r==="updateAsyncQuietly")return function(a){return ee(()=>o.updateAsync(a))};if(r==="deleteQuietly")return function(){return ee(()=>i.delete())};if(r==="toSearchableObject")return function(){let l=i._definition?.traits?.useSearch;if(!l)return null;let u=i._attributes;if(!u)return null;if(l===!0){let g={...u};if(u.id!=null)g.id=String(u.id);return g}let m={},p=l.displayable?.length?l.displayable:[...l.searchable??[],...l.filterable??[],...l.sortable??[],"id"],_=l.denormalize??{},k=i._relations;for(let g of p){let y=H(g),R=u[y]??u[g];if(R!==void 0){m[y]=R;continue}let v=_[g]??_[y];if(v){m[y]=Ou(k,v);continue}m[y]=void 0}if(u.id!=null)m.id=String(u.id);return m};if(typeof r==="string"&&!Ei.has(r)){let a=i._attributes;if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r];let c=i._relations;if(c&&Object.prototype.hasOwnProperty.call(c,r)){let u=c[r];if(Array.isArray(u))return u.map((m)=>D(m,t));return D(u,t)}let l=qu[r];if(l){let p=i._definition?.__traitMethods?.[l.bag]?.[r];if(typeof p==="function")return l.mode==="model"?(..._)=>p(o,..._):(..._)=>p(i.id,..._)}if(a){let u=H(r);if(u!==r&&Object.prototype.hasOwnProperty.call(a,u))return a[u]}}let s=Reflect.get(i,r,i);return typeof s==="function"?s.bind(i):s},set(i,r,o,s){if(typeof r==="string"&&!Ei.has(r)){let{_attributes:a,set:c}=i;if(a&&Object.prototype.hasOwnProperty.call(a,r)){if(typeof c==="function")c.call(i,r,o);else a[r]=o;return!0}if(a){let l=H(r);if(l!==r&&Object.prototype.hasOwnProperty.call(a,l)){if(typeof c==="function")c.call(i,l,o);else a[l]=o;return!0}}if(a&&!(r in i)){if(typeof c==="function")c.call(i,r,o);else a[r]=o;return!0}}return Reflect.set(i,r,o,s)},has(i,r){if(typeof r==="string"&&!Ei.has(r)){let o=i._attributes;if(o&&Object.prototype.hasOwnProperty.call(o,r))return!0;let s=i._relations;if(s&&Object.prototype.hasOwnProperty.call(s,r))return!0;if(o){let a=H(r);if(a!==r&&Object.prototype.hasOwnProperty.call(o,a))return!0}}return Reflect.has(i,r)},deleteProperty(i,r){if(typeof r==="string"&&!Ei.has(r)){let o=i._attributes;if(o&&Object.prototype.hasOwnProperty.call(o,r))return delete o[r],!0}return Reflect.deleteProperty(i,r)},ownKeys(i){let r=i._attributes;return r?Object.keys(r):[]},getOwnPropertyDescriptor(i,r){if(typeof r==="string"){let o=i._attributes;if(o&&Object.prototype.hasOwnProperty.call(o,r))return{configurable:!0,enumerable:!0,value:o[r],writable:!0}}return Object.getOwnPropertyDescriptor(i,r)}})}var Au=new Set(["get","first","last","firstOrFail","find","findOrFail","all","paginate","simplePaginate","cursorPaginate"]),Iu={paginate:Yi,simplePaginate:Zi,cursorPaginate:er},Cc=Symbol.for("stacks.queryBuilderProxy");function Uc(e,t){if(!e||typeof e!=="object")return e;if(e[Cc])return e;return new Proxy(e,{get(n,i,r){if(i===Cc)return!0;let o=Reflect.get(n,i,r);if(typeof o!=="function")return o;return function(...s){let a=s,c=String(i);if(c==="paginate"||c==="simplePaginate"){let{perPage:m,page:p}=nr(s[0],s[1]);a=[m,p]}else if(c==="cursorPaginate"){let{perPage:m,cursor:p}=ir(s[0],s[1]);a=[m,p,s[2],s[3]]}let l=o.apply(n,a),u=(m)=>{if(Au.has(c)){if(Array.isArray(m))return m.map((_)=>D(_,t));let p=Iu[c];if(p&&m&&Array.isArray(m.data)){let _=m.data.map((g)=>D(g,t)),k=p({...m,data:_});return rr(k)}if(m&&Array.isArray(m.data))return{...m,data:m.data.map((_)=>D(_,t))};return D(m,t)}if(m&&typeof m==="object"&&typeof m.get==="function")return Uc(m,t);return m};if(l&&typeof l.then==="function")return l.then(u);return u(l)}}})}function $u(e,t){let n=["find","first","last","all","firstOrFail","findOrFail","findMany"];for(let o of n){let s=e[o];if(typeof s!=="function")continue;e[o]=function(...a){let c=s.apply(this,a),l=(u)=>Array.isArray(u)?u.map((m)=>D(m,t)):D(u,t);if(c&&typeof c.then==="function")return c.then(l);return l(c)}}let i=["create","firstOrCreate","updateOrCreate","make"];for(let o of i){let s=e[o];if(typeof s!=="function")continue;e[o]=function(...a){let c=s.apply(this,a),l=(u)=>Array.isArray(u)?u.map((m)=>D(m,t)):D(u,t);if(c&&typeof c.then==="function")return c.then(l);return l(c)}}let r=["query","where","orWhere","whereIn","whereNotIn","whereNull","whereNotNull","whereLike","whereBetween","whereNotBetween","orderBy","orderByDesc","select","with","limit","take","skip","latest","oldest"];for(let o of r){let s=e[o];if(typeof s!=="function")continue;e[o]=function(...a){let c=s.apply(this,a);return Uc(c,t)}}}class Mc extends Error{model;id;constructor(e,t){super(t!=null?`[ORM] ${e} not found for id=${String(t)}`:`[ORM] No matching ${e} row`);this.name="ModelNotFoundError",this.model=e,this.id=t}}class Ua extends Error{model;attribute;reason;constructor(e,t,n){let i=n==="guarded"?`'${t}' is marked guarded`:`'${t}' is not in the fillable allowlist`;super(`[ORM] Mass assignment to ${e} forbidden: ${i}. Use ${e}.forceCreate(...) / .forceUpdate(...) to bypass.`);this.name="MassAssignmentException",this.model=e,this.attribute=t,this.reason=n}}var Uu=new Set(["id","created_at","updated_at","deleted_at","uuid"]);function ii(e,t,n={}){if(n.force)return t;if(!t||typeof t!=="object"||Array.isArray(t))return t;let i=e.attributes;if(!i)return t;let r=new Set,o=new Set,s=new Set;for(let[c,l]of Object.entries(i)){let u=H(c);if(r.add(u),l?.fillable===!0)o.add(u);if(l?.guarded===!0)s.add(u)}let a=o.size>0?o:r;for(let c of Object.keys(t)){let l=H(c);if(Uu.has(l))continue;if(s.has(l))throw new Ua(e.name,c,"guarded");if(l.endsWith("_id"))continue;if(!a.has(l))throw new Ua(e.name,c,"not-fillable")}return t}async function Ma(e,t){let n=e.set;if(!n||typeof n!=="object")return t;let i={...t};for(let[r,o]of Object.entries(n)){if(typeof o!=="function"||!(r in i))continue;try{i[r]=await o(i)}catch(s){A.error(`[orm] ${e.name}.set.${r} threw - skipping setter`,s)}}return i}function Mu(e,t){let n=t.primaryKey||"id",i=e.create;function r(l){let u=e.where;if(typeof u!=="function")throw Error(`[ORM] ${t.name}.${l} needs a working where(): the underlying query builder did not expose one`);return u}function o(l){let u=e.find;if(typeof u!=="function")throw Error(`[ORM] ${t.name}.${l} needs a working find(): the underlying query builder did not expose one`);return u}function s(l){let u=e.create;if(typeof u!=="function")throw Error(`[ORM] ${t.name}.${l} cannot create: the underlying query builder did not expose create()`);return u}if(typeof e.update!=="function")e.update=async function(l,u){if(l==null)throw Error(`[ORM] ${t.name}.update requires an id as the first argument`);if(!u||typeof u!=="object"||Array.isArray(u))throw Error(`[ORM] ${t.name}.update requires a data object as the second argument`);if(Object.keys(u).length===0){A.debug(`[orm] ${t.name}.update called with empty data - short-circuiting and returning current row`);let _=e.find;return typeof _==="function"?await _.call(e,l):null}ii(t,u);let m=await Ma(t,u);await r("update").call(e,n,l).update(m);let p=e.find;return typeof p==="function"?await p.call(e,l):null};if(typeof e.forceUpdate!=="function")e.forceUpdate=async function(l,u){if(l==null)throw Error(`[ORM] ${t.name}.forceUpdate requires an id as the first argument`);if(!u||typeof u!=="object"||Array.isArray(u))throw Error(`[ORM] ${t.name}.forceUpdate requires a data object as the second argument`);let m=await Ma(t,u);await r("forceUpdate").call(e,n,l).update(m);let p=e.find;return typeof p==="function"?await p.call(e,l):null};if(typeof e.forceCreate!=="function")e.forceCreate=async function(l){if(!l||typeof l!=="object"||Array.isArray(l))throw Error(`[ORM] ${t.name}.forceCreate requires a data object`);let u=e.make;if(typeof u==="function"){let m=await u.call(e);if(m&&typeof m.forceFill==="function"&&typeof m.save==="function")return m.forceFill(l),await m.save()??m}if(typeof i!=="function")throw Error(`[ORM] ${t.name}.forceCreate cannot create: the underlying query builder did not expose create()`);return await i.call(e,l)};if(typeof e.delete!=="function")e.delete=async function(l){if(l==null)throw Error(`[ORM] ${t.name}.delete requires an id as the first argument`);if(!await o("delete").call(e,l))return!1;return await r("delete").call(e,n,l).delete(),!0};if(typeof e.findOrFail!=="function")e.findOrFail=async function(l){let u=await o("findOrFail").call(e,l);if(u==null)throw new Mc(t.name,l);return u};if(typeof e.exists!=="function")e.exists=async function(l){if(l==null)return!1;let u=r("exists").call(e,n,l);if(typeof u.count==="function"){let p=await u.count();return Number(p)>0}let m=e.find;return typeof m==="function"?await m.call(e,l)!=null:!1};if(typeof e.firstOrCreate!=="function")e.firstOrCreate=async function(l,u={}){if(!l||typeof l!=="object"||Array.isArray(l))throw Error(`[ORM] ${t.name}.firstOrCreate requires a where-attrs object`);let m=r("firstOrCreate").call(e,l),p=typeof m.first==="function"?await m.first():await m;if(p)return p;let _={...l,...u};return ii(t,_),await s("firstOrCreate").call(e,_)};if(typeof e.updateOrCreate!=="function")e.updateOrCreate=async function(l,u){if(!l||typeof l!=="object"||Array.isArray(l))throw Error(`[ORM] ${t.name}.updateOrCreate requires a where-attrs object`);if(!u||typeof u!=="object"||Array.isArray(u))throw Error(`[ORM] ${t.name}.updateOrCreate requires a values object`);let m=r("updateOrCreate").call(e,l),p=typeof m.first==="function"?await m.first():await m;if(p){ii(t,u);let k=p[n];await r("updateOrCreate").call(e,n,k).update(u);let g=e.find;return typeof g==="function"?await g.call(e,k):{...p,...u}}let _={...l,...u};return ii(t,_),await s("updateOrCreate").call(e,_)};if(typeof e.count!=="function")e.count=async function(){let l=e;if(typeof l.query==="function"){let p=l.query();if(typeof p?.count==="function"){let _=await p.count();return Number(_)||0}}let{all:u,get:m}=e;if(typeof u==="function")return(await u.call(e)||[]).length;if(typeof m==="function")return(await m.call(e)||[]).length;return 0};if(typeof e.pluck!=="function")e.pluck=async function(l){if(!l||typeof l!=="string")throw Error(`[ORM] ${t.name}.pluck requires a column name`);let u=e.all;return((typeof u==="function"?await u.call(e):[])||[]).map((p)=>p?.[l])};if(typeof e.whereIn!=="function")e.whereIn=async function(l,u){if(!l||typeof l!=="string")throw Error(`[ORM] ${t.name}.whereIn requires a column name`);if(!Array.isArray(u))throw Error(`[ORM] ${t.name}.whereIn requires an array of values`);if(u.length===0)return[];let m=e.where;if(typeof m!=="function")return[];let p=m.call(e,l,"in",u);if(p&&typeof p.get==="function")return await p.get();return await p};let a=[["latest","desc"],["oldest","asc"]];for(let[l,u]of a)if(typeof e[l]!=="function")e[l]=async function(m="created_at"){let p=e,_=typeof p.query==="function"?p.query():p;if(typeof _?.orderBy==="function"){let R=_.orderBy(m,u);if(typeof R.first==="function")return await R.first();if(typeof R.get==="function")return(await R.get())?.[0]??null}let k=e.all;if(typeof k!=="function")return null;return[...await k.call(e)||[]].sort((R,v)=>{let x=R?.[m],P=v?.[m];if(x===P)return 0;return(x>P?1:-1)*(u==="desc"?-1:1)})[0]??null};let c=Nc(t.traits?.useSearch,t);if(c){let l=c.index??t.table??H(`${t.name}s`);if(typeof e.search!=="function")e.search=function(u,m){return Gu(e,l,u,m,c.searchable)};if(typeof e.makeAllSearchable!=="function")e.makeAllSearchable=async function(u=500){let m=e.all;if(typeof m!=="function")throw Error(`[ORM] ${t.name}.makeAllSearchable cannot run: the underlying query builder did not expose all()`);let{useSearchEngine:p}=await import("@stacksjs/search-engine"),_=p(),k=0,g=e.query;if(typeof g==="function")try{let v=g.call(e);if(v&&typeof v.chunk==="function")return await v.chunk(u,async(x)=>{let P=await Da(x,c);if(P.length>0)await _.addDocuments(l,P);k+=P.length}),k}catch{}let y=await m.call(e)||[],R=await Da(y,c);if(R.length>0)await _.addDocuments(l,R);return R.length};if(typeof e.removeAllFromSearch!=="function")e.removeAllFromSearch=async function(){let{useSearchEngine:u}=await import("@stacksjs/search-engine"),m=u();if(typeof m.deleteAllDocuments==="function"){await m.deleteAllDocuments(l);return}let p=e.all,_=typeof p==="function"?await p.call(e)||[]:[],k=u();for(let g of _){let y=g?.id??g?._attributes?.id;if(y!=null)await k.deleteDocument(l,Number(y))}}}}async function Da(e,t){if(e.length===0)return[];if(typeof t.shapeMany==="function"){let i=await t.shapeMany(e);if(!Array.isArray(i)||i.length!==e.length)throw TypeError(`[orm/search] shapeMany returned ${Array.isArray(i)?i.length:typeof i} documents for ${e.length} rows. It must return one document per row, in order, or documents are indexed under the wrong ids.`);return i.filter(Boolean)}return(await Promise.all(e.map((i)=>Nu(i,t)))).filter(Boolean)}function Du(e){let t=new Set,n=e.attributes??{};for(let[i,r]of Object.entries(n))if(r?.hidden)t.add(i);return t}function Fu(e,t){if(!e||t.size===0)return e;let n={};for(let[i,r]of Object.entries(e))if(!t.has(i))n[i]=r;return n}async function Nu(e,t){if(typeof t.shape==="function")try{return await t.shape(e)}catch{return}let n=e?.toSearchableObject?.();if(n!==void 0)return n;return Fu(e?._attributes??(typeof e?.toJSON==="function"?e.toJSON():null),t.hidden??new Set)}function Gu(e,t,n,i,r){let o=r&&r.length>0?{query_by:[...r].join(",")}:{},s={q:n,...o,...i??{}},a={with(c){return s={...s,...c},a},where(c){return s={...s,filter:c},a},async get(){let{useSearchEngine:c}=await import("@stacksjs/search-engine");return(await c().search(t,s))?.hits??[]},async paginate(c,l=1){let{useSearchEngine:u}=await import("@stacksjs/search-engine"),p=await u().search(t,{...s,limit:c,offset:(l-1)*c});return{hits:p.hits??[],total:Number(p.estimatedTotalHits??p.nbHits??p.total??0),page:l,perPage:c}},async raw(){let{useSearchEngine:c}=await import("@stacksjs/search-engine");return await c().search(t,s)}};return a}function Dc(e){let t=H(e);return t===e?[e]:[e,t]}async function $a(e,t){if(!e||typeof e!=="object")return;let n=e._attributes??e;for(let i of t)for(let r of Dc(i)){if(!(r in n))continue;let o=n[r];if(!ue(o))continue;n[r]=await $i(o)}}function Bu(e,t){if(t.length===0)return;let n=async(a)=>{if(Array.isArray(a)){for(let c of a)await $a(c,t);return a}if(a&&typeof a==="object"&&Array.isArray(a.data)){for(let c of a.data)await $a(c,t);return a}if(a)await $a(a,t);return a},i=["find","first","last","all","firstOrFail","findOrFail","findMany"];for(let a of i){let c=e[a];if(typeof c!=="function")continue;e[a]=async function(...l){let u=await c.apply(this,l);return await n(u)}}let r=["create","firstOrCreate","updateOrCreate","make"];for(let a of r){let c=e[a];if(typeof c!=="function")continue;e[a]=async function(...l){let u=await c.apply(this,l);return await n(u)}}for(let a of["update","forceUpdate"]){let c=e[a];if(typeof c!=="function")continue;e[a]=async function(l,u){let m=await c.call(this,l,u);return await n(m)}}let o=["first","firstOrFail","get","all","find","findOrFail","last","paginate","simplePaginate"],s=(a)=>{if(!a||typeof a!=="object")return a;let c=a;if(c.__stacksEncryptedReads)return a;for(let l of o){let u=c[l];if(typeof u!=="function")continue;c[l]=async function(...m){return await n(await u.apply(this,m))}}for(let l of["where","whereIn","whereNull","whereNotNull","orWhere","orderBy","orderByDesc","limit","offset","with"]){let u=c[l];if(typeof u!=="function")continue;c[l]=function(...m){return s(u.apply(this,m))}}return Object.defineProperty(c,"__stacksEncryptedReads",{value:!0,enumerable:!1}),a};for(let a of["where","whereIn","whereNull","whereNotNull","orderBy","orderByDesc","limit","query"]){let c=e[a];if(typeof c!=="function")continue;e[a]=function(...l){return s(c.apply(this,l))}}}function Lu(e,t){if(t.length===0)return;let n=async(r)=>{if(!r||typeof r!=="object"||Array.isArray(r))return r;let o={...r};for(let s of t)for(let a of Dc(s))if(a in o)o[a]=await Ii(o[a]);return o},i=["create","firstOrCreate","updateOrCreate","forceCreate"];for(let r of i){let o=e[r];if(typeof o!=="function")continue;e[r]=async function(...s){if(s[0]=await n(s[0]),s[1])s[1]=await n(s[1]);return await o.apply(this,s)}}for(let r of["update","forceUpdate"]){let o=e[r];if(typeof o!=="function")continue;e[r]=async function(s,a){let c=await n(a);return await o.call(this,s,c)}}}function Ku(e,t){let n=e.create;if(typeof n==="function")e.create=async function(i,...r){ii(t,i);let o=await Ma(t,i);return await n.call(this,o,...r)};for(let i of["firstOrCreate","updateOrCreate"]){let r=e[i];if(typeof r!=="function")continue}}function Hu(e,t){let n=String(t?.name??e.name??"Model"),i=(s,a)=>{if(Cu())return;if(!s||typeof s!=="object"||Array.isArray(s))return;let c=Za(s,t,a);if(!c.valid)throw new Ic(n,c.errors)},r=e.create;if(typeof r==="function")e.create=async function(s,...a){return i(s,"creating"),await r.call(this,s,...a)};let o=e.update;if(typeof o==="function")e.update=async function(s,a,...c){return i(a,"updating"),await o.call(this,s,a,...c)}}function Vu(e,t){let n=["create","firstOrCreate","updateOrCreate"];for(let r of n){let o=e[r];if(typeof o==="function")e[r]=async function(...s){if(A.debug(`[orm] ${r.charAt(0).toUpperCase()+r.slice(1)} ${String(e.name||"unknown")}`,s[0]),s[0]&&typeof s[0]==="object"&&!Array.isArray(s[0]))s[0]=Sc(s[0],t,"set");return await o.apply(this,s)}}let i=e.update;if(typeof i==="function")e.update=async function(r,o){let s=o&&typeof o==="object"&&!Array.isArray(o)?Sc(o,t,"set"):o;return await i.call(this,r,s)}}function Fc(e){A.debug(`[orm] Defining model: ${e.name} (table: ${e.table})`);let t=zu(e),n=Qu(e),i=Wu(t,n),r=Ju(e);e.__traitMethods=r;let o=i?{...e,hooks:{...e.hooks,...i}}:e,a=Su(o);if($u(a,e.casts),Mu(a,o),Ku(a,o),e.casts&&Object.keys(e.casts).length>0)Vu(a,e.casts);let c=Ui(e);if(c.length>0)Lu(a,c),Bu(a,c);let l=e.traits?.useSoftDeletes;if(l)Xu(a,o,l);let u=e.traits?.useAudit;if(u){let p=za(u);Wa(a,e.name,e.primaryKey||"id",p)}Hu(a,o),a.withoutValidation=function(p){return ju(p)},a.withoutEvents=function(p){return ee(p)};for(let p of["create","update","firstOrCreate","updateOrCreate","forceCreate","forceUpdate","delete","forceDelete","softDelete","restore"]){let _=a[p];if(typeof _!=="function")continue;let k=`${p}Quietly`;if(typeof a[k]==="function")continue;a[k]=function(...g){return ee(()=>_.apply(a,g))}}let m=Object.assign(a,r,{...e,getDefinition:()=>e,_isStacksModel:!0});return xu(e.name,m),Object.defineProperty(m,Fa,{value:e,enumerable:!1,configurable:!0}),m}function zu(e){let t=e.traits?.observe;if(!t)return;let n=e.name.toLowerCase(),i=(p)=>{let _=p?.attributes;if(!_||typeof _!=="object")return p;let k=e.primaryKey||"id",g={..._};if(g[k]===void 0&&p[k]!==void 0)g[k]=p[k];return g},r=async(p,_)=>{if(te())return;try{let{dispatch:k}=await import("@stacksjs/events");await k(p,_)}catch(k){if(k&&typeof k==="object"&&"code"in k&&k.code==="MODULE_NOT_FOUND")return;if(console.error(`[ORM] Event '${p}' handler error:`,k),process.env.STACKS_ORM_EVENT_ERRORS!=="swallow")throw k}},o=e.traits?.broadcastOn,s=e.traits?.broadcastWith,a=typeof o==="function"&&typeof s==="function",c=async(p,_)=>{if(!a)return;if(te())return;try{let k=o(_),g=Array.isArray(k)?k:[k],y=s(_),v=(await import("@stacksjs/realtime").catch(()=>null))?.broadcast;if(typeof v!=="function")return;for(let x of g){if(typeof x!=="string"||x.length===0)continue;await v(x,p,y)}}catch(k){if(k&&typeof k==="object"&&"code"in k&&k.code==="MODULE_NOT_FOUND")return;if(console.error(`[ORM] Broadcast '${p}' handler error:`,k),process.env.STACKS_ORM_BROADCAST_ERRORS==="throw")throw k}},l=async(p,_)=>{if(te())return!0;try{let{dispatchAsync:k}=await import("@stacksjs/events"),g=await k(p,_);if(Array.isArray(g)&&g.some((y)=>y===!1))return!1}catch(k){if(k&&typeof k==="object"&&"code"in k&&k.code==="MODULE_NOT_FOUND")return!0;if(console.error(`[ORM] Before-event '${p}' handler error:`,k),process.env.STACKS_ORM_EVENT_ERRORS!=="swallow")throw k}return!0},u=t===!0?["create","update","delete"]:Array.isArray(t)?t:[],m={};if(u.includes("create"))m.beforeCreate=async(p)=>{if(A.debug(`[orm] Create ${n}`,p),!await l(`${n}:saving`,p))throw Error(`[ORM] ${n}:saving event cancelled the operation`);if(!await l(`${n}:creating`,p))throw Error(`[ORM] ${n}:creating event cancelled the operation`)},m.afterCreate=async(p)=>{let _=i(p);await r(`${n}:created`,_),await r(`${n}:saved`,_),await c(`${n}:created`,p)};if(u.includes("update"))m.beforeUpdate=async(p)=>{if(A.debug(`[orm] Update ${n}#${p?.id??"unknown"}`,p),!await l(`${n}:saving`,p))throw Error(`[ORM] ${n}:saving event cancelled the operation`);if(!await l(`${n}:updating`,p))throw Error(`[ORM] ${n}:updating event cancelled the operation`)},m.afterUpdate=async(p)=>{let _=i(p);await r(`${n}:updated`,_),await r(`${n}:saved`,_),await c(`${n}:updated`,p)};if(u.includes("delete"))m.beforeDelete=async(p)=>{if(A.debug(`[orm] Delete ${n}#${p?.id??"unknown"}`),!await l(`${n}:deleting`,p))throw Error(`[ORM] ${n}:deleting event cancelled the operation`)},m.afterDelete=async(p)=>{await r(`${n}:deleted`,i(p)),await c(`${n}:deleted`,p)};return m}function Wu(...e){let t={},n=new Set;for(let i of e){if(!i)continue;for(let r of Object.keys(i))n.add(r)}for(let i of n){let r=e.map((o)=>o?.[i]).filter((o)=>typeof o==="function");if(!r.length)continue;t[i]=async(...o)=>{for(let s of r)await s(...o)}}return Object.keys(t).length?t:void 0}function Nc(e,t){if(!e)return null;let n=e===!0?{}:typeof e==="object"?{...e}:null;if(!n)return null;if(t)n.hidden=Du(t);return n}function Qu(e){let t=Nc(e.traits?.useSearch,e);if(!t)return;let n=t,i=n.index??e.table??H(`${e.name}s`);async function r(a){if(typeof n.shapeMany==="function")try{let[u]=await Da([a],n);return u}catch(u){A.warn(`[orm/search] shapeMany() threw for ${e.name}: ${u.message}`);return}if(typeof n.shape==="function")try{return await n.shape(a)}catch(u){A.warn(`[orm/search] shape() threw for ${e.name}: ${u.message}`);return}let l=D(a).toSearchableObject?.();if(l!==void 0)return l;return a?._attributes??(typeof a?.toJSON==="function"?a.toJSON():null)}let o=async(a)=>{if(te())return;let c=await r(a);if(!c)return;if(t.queueable){try{let{Jobs:l}=await import("@stacksjs/queue");await l.dispatch("SyncSearchIndex",{index:i,op:"upsert",doc:c})}catch(l){A.warn(`[orm/search] queue dispatch failed for ${e.name}; falling back to inline: ${l.message}`),await Pc(i,c,e.name)}return}await Pc(i,c,e.name)};return{afterCreate:o,afterUpdate:o,afterDelete:async(a)=>{if(te())return;let c=a?.id??a?._attributes?.id;if(c==null)return;if(t.queueable){try{let{Jobs:l}=await import("@stacksjs/queue");await l.dispatch("SyncSearchIndex",{index:i,op:"delete",id:Number(c)})}catch(l){A.warn(`[orm/search] queue dispatch failed for ${e.name}#${c}; falling back to inline: ${l.message}`),await Ec(i,Number(c),e.name)}return}await Ec(i,Number(c),e.name)}}}var jc=new Map;function Gc(e,t){let n=jc.get(e)??0;if(jc.set(e,n+1),n===0)A.warn(`[orm/search] ${t}`);else if(n===9)A.warn(`[orm/search] ${e} is still failing; further identical warnings suppressed for this process.`)}async function Pc(e,t,n){try{let{useSearchEngine:i}=await import("@stacksjs/search-engine");await i().addDocument(e,t)}catch(i){Gc(`index:${n}`,`Failed to index ${n}: ${i.message}`)}}async function Ec(e,t,n){try{let{useSearchEngine:i}=await import("@stacksjs/search-engine");await i().deleteDocument(e,t)}catch(i){Gc(`remove:${n}`,`Failed to remove ${n}#${t}: ${i.message}`)}}function Ju(e){let t={},n=e.table,i=e.traits;if(!i)return t;if(i.taggable)t._taggable=Li(n);if(i.categorizable)t._categorizable=Ki(n);if(i.commentable)t._commentable=Gi(n);if(i.billable)t._billable=yc(n);if(i.likeable){let o=typeof i.likeable==="object"?i.likeable:void 0;t._likeable=Hi(n,o)}let r=i.useAuth||i.authenticatable;if(typeof r==="object"&&r&&"useTwoFactor"in r&&r.useTwoFactor)t._twoFactor=Rc();return t}function Xu(e,t,n){let i=Tc(e,t.primaryKey||"id"),r=wc(n),o=t,s=t.name.toLowerCase(),a=t.traits?.observe!=null&&t.traits?.observe!==!1,c=async(_)=>{if(!a||te())return!0;try{let{dispatchAsync:k}=await import("@stacksjs/events"),g=await k(`${s}:restoring`,{id:_});if(Array.isArray(g)&&g.some((y)=>y===!1))return!1}catch(k){if(k?.code!=="MODULE_NOT_FOUND")console.error(`[ORM] Before-event '${s}:restoring' handler error:`,k)}return!0},l=async(_)=>{if(!a||te())return;try{let{dispatch:k}=await import("@stacksjs/events");await k(`${s}:restored`,{id:_})}catch(k){if(k?.code!=="MODULE_NOT_FOUND")console.error(`[ORM] Event '${s}:restored' handler error:`,k)}},u=process.env.STACKS_ORM_CASCADE_SWALLOW!=="true",m=async(_)=>{if(!r.cascade?.length||!u){let g=await i.softDelete(_);if(g&&r.cascade?.length)await ni(o,r,_,"softDelete");return g}let{db:k}=await import("@stacksjs/database");return await k.transaction(async()=>{let g=await i.softDelete(_);if(g)await ni(o,r,_,"softDelete");return g})},p=async(_)=>{if(!await c(_))return!1;if(!r.cascade?.length||!u){let R=await i.restore(_);if(R){if(r.cascade?.length)await ni(o,r,_,"restore");await l(_)}return R}let{db:g}=await import("@stacksjs/database"),y=await g.transaction(async()=>{let R=await i.restore(_);if(R)await ni(o,r,_,"restore");return R});if(y)await l(_);return y};e.softDelete=m,e.restore=p,e.forceDelete=i.forceDelete,e.withTrashed=i.withTrashed,e.onlyTrashed=i.onlyTrashed,e.delete=m}function Yu(e){if(e==null)return e;if(Array.isArray(e))return e.map(Yu);if(typeof e!=="object")return e;if(typeof e.toJSON==="function")return e.toJSON();if(e._attributes&&typeof e._attributes==="object")return e._attributes;return e}var Zu=["belongsTo","hasOne","hasMany","belongsToMany","morphMany","morphOne"],em=["traits","dashboard"];function tm(e){let t=e?.[Fa];if(t&&typeof t==="object")return t;if(e&&typeof e==="object"&&"name"in e&&"attributes"in e)return e;throw TypeError("extendModel() expects a model created by defineModel(), or a model definition. Import the framework model itself rather than its table name.")}function nm(e,t){let n=Array.isArray(e)?e:[],i=Array.isArray(t)?t:[];if(!n.length&&!i.length)return;return[...new Set([...n,...i])]}function im(e){if(!e)return 0;return Object.values(e).reduce((t,n)=>{let i=Number(n?.order);return Number.isFinite(i)&&i>t?i:t},0)}function rm(e,t){let n={...e,...t},i=e.attributes??{},r=t.attributes??{};if(t.attributes){let o=im(i),s=Object.fromEntries(Object.entries(r).map(([a,c])=>{let l=!(a in i),u=Number.isFinite(Number(c?.order));if(l&&!u)return[a,{...c,order:++o}];return[a,c]}));n.attributes={...i,...s}}for(let o of Zu){let s=nm(e[o],t[o]);if(s)n[o]=s}for(let o of em){let s=e[o],a=t[o];if(s&&a&&typeof s==="object"&&typeof a==="object")n[o]={...s,...a}}return n}function Rj(e,t){return Fc(rm(tm(e),t))}import{log as om}from"@stacksjs/logging";import{path as V}from"@stacksjs/path";import{fs as ri}from"@stacksjs/storage";function Q(e){return e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()}function sm(e){let t=e.default;if(typeof t==="boolean")return"boolean";if(typeof t==="number")return"number";if(typeof t==="string")return"string";return"unknown"}function am(e){let t=e.validation;if(!t||typeof t!=="object")return null;let n=t.rule;return n&&typeof n==="object"?n:null}function lm(e){if(!e||String(e.name??"")!=="enum")return null;let n=(Array.isArray(e.allowedValues)?e.allowedValues:[]).filter((i)=>typeof i==="string"||typeof i==="number").map((i)=>typeof i==="number"?String(i):JSON.stringify(i));return n.length>0?n.join(" | "):null}function cm(e){let t=am(e),n=lm(t);if(n!==null)return e.nullable===!0?`${n} | null`:n;let i=typeof e.type==="string"?e.type.toLowerCase():String(t?.name??"").toLowerCase(),r=(()=>{switch(i){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"password":case"time":case"year":return"string";case"number":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";case"unix":return"number";case"array":return"unknown[]";case"object":return"Record<string, unknown>";default:return sm(e)}})();return e.nullable===!0?`${r} | null`:r}function dm(e){let t={},n=e.belongsTo;if(!n)return t;let i=Array.isArray(n)?n:Object.values(n);for(let r of i){if(typeof r==="string"){t[`${Q(r)}_id`]="number";continue}if(r&&typeof r==="object"){let o=r;if(typeof o.foreignKey==="string"){t[o.foreignKey]="number";continue}if(typeof o.model==="string")t[`${Q(o.model)}_id`]="number"}}return t}function um(e,t){let[n,i]=[Q(e),Q(t)].sort();return`${n}_${i}`}function mm(e){let t=e.default,n=typeof t==="string"?"string":typeof t==="number"?"number":typeof t==="boolean"?"boolean":t instanceof Date?"string":"unknown";return e.nullable?`${n} | null`:n}function pm(e,t){let n=t.belongsToMany;if(!n)return[];let i=[],r=Array.isArray(n)?n:Object.values(n);for(let o of r){let s,a,c,l,u={},m=!0;if(typeof o==="string")s=o;else if(o&&typeof o==="object"&&"model"in o){let y=o;if(s=y.model,"pivotTable"in y||"firstForeignKey"in y||"secondForeignKey"in y)a=y.pivotTable,c=y.firstForeignKey,l=y.secondForeignKey;else{let R=o;a=R.table,c=R.foreignKey,l=R.relatedKey,u=R.pivot?.columns??{},m=Boolean(R.pivot?.timestamps)}}else continue;let p=a??um(e,s),_=c??`${Q(e)}_id`,k=l??`${Q(s)}_id`,g={id:"number",[_]:"number",[k]:"number"};for(let[y,R]of Object.entries(u))g[y]=mm(R);if(m)g.created_at="string",g.updated_at="string | null";i.push({table:p,columns:g})}return i}var fm={email_verified_at:"string | null",password_changed_at:"string | null",two_factor_secret:"string | null",two_factor_enabled:"boolean | null",two_factor_last_used_step:"number | null",stripe_id:"string | null"};function _m(e){let t={id:"number"},n=e.traits??{};if(n.useUuid)t.uuid="string";if((n.useTimestamps??n.timestampable)!==!1)t.created_at="string",t.updated_at="string | null";if(n.useSoftDeletes??n.softDeletable)t.deleted_at="string | null";if((e.table??"")==="users"||e.name==="User")Object.assign(t,fm);return t}function km(e){let t={},n=e.attributes??{};for(let[i,r]of Object.entries(n))t[Q(i)]=cm(r);return t}function bm(e){return e.replace(/_([a-z0-9])/g,(t,n)=>n.toUpperCase())}function gm(e){let t={...e};for(let[n,i]of Object.entries(e)){let r=bm(n);if(r!==n&&!(r in t))t[r]=i}return t}function Bc(e,t,n=2){let i=" ".repeat(n),r=" ".repeat(n+1),o=Object.entries(t).map(([a,c])=>`${r}${a}: ${c}`).join(`
16
16
  `),s=/^[A-Z_a-z]\w*$/.test(e)?e:`'${e}'`;return`${i}${s}: {
17
17
  ${r}// columns
18
18
  ${o}
19
- ${i}}`}var gm=`/* eslint-disable */
19
+ ${i}}`}var hm=`/* eslint-disable */
20
20
  // AUTO-GENERATED by \`buddy generate:db-types\` \u2014 do not edit.
21
21
  // Regenerate after adding/removing a model or changing its attributes.
22
22
  // See stacksjs/stacks#1923.
23
23
 
24
24
  declare module '@stacksjs/database' {
25
25
  interface DatabaseSchema {
26
- `,hm=` }
26
+ `,ym=` }
27
27
  }
28
28
 
29
29
  export {}
30
- `,ym="/* eslint-disable */\n// AUTO-GENERATED by `buddy generate:db-types --framework` \u2014 do not edit.\n//\n// The shapes of the tables the framework itself ships, so framework code gets\n// real rows from `db.selectFrom(...)` without asserting them. An application's\n// own tables (and its overrides of these) live in `DatabaseSchema`, which takes\n// precedence - see `RowOf` in `./utils`.\n\nexport interface FrameworkSchema {\n",Rm=`}
31
- `;function Bc(e){return e==="framework"?ym:gm}function Lc(e){return e==="framework"?Rm:hm}async function Kc(e,t,n=[]){let i=[];if(!ri.existsSync(e))return i;let r=ri.readdirSync(e,{withFileTypes:!0});for(let o of r){let s=V.join(e,o.name);if(o.isDirectory()){if(t){let a=await Kc(s,!0,n);i.push(...a)}continue}if(!o.name.endsWith(".ts"))continue;if(o.name.startsWith("_")||o.name.startsWith("index"))continue;try{let a=await(V.isAbsolute(s)?import(s):import(V.resolve(s))),c=a.default||a;if(c?.name&&(c.attributes||c.table))i.push({filePath:s,model:c})}catch(a){n.push({file:s,error:a.message})}}return i}async function Tm(e={}){let t=e.modelsDir??V.userModelsPath(),n=e.defaultsDir??V.frameworkPath("defaults/app/Models"),i=e.outFile??V.projectPath("database/types.d.ts"),r=[],o=[];for(let[_,k]of[[t,!1],[n,!0]])try{let g=await Kc(_,k,r);o.push(...g)}catch(g){r.push({file:_,error:g.message})}let s=new Map;for(let _ of o)s.set(_.model.name??V.basename(_.filePath).replace(/\.ts$/,""),_);for(let _ of o)if(_.filePath.startsWith(t))s.set(_.model.name??V.basename(_.filePath).replace(/\.ts$/,""),_);let a=[];for(let[_,{model:k}]of s){let g=k.table??`${Q(_)}s`,y=bm({...fm(k),..._m(k),...cm(k)});a.push({table:g,model:_,columns:y})}let c=new Map;for(let[_,{model:k}]of s)for(let g of mm(_,k)){if(c.has(g.table))continue;c.set(g.table,{table:g.table,model:`(${g.table} pivot)`,columns:g.columns})}a.push(...c.values()),a.sort((_,k)=>_.table.localeCompare(k.table));let l=e.target??"app",u=l==="framework"?1:2,m=a.map((_)=>Gc(_.table,_.columns,u)).join(`
32
- `),p=`${Bc(l)}${m}
33
- ${Lc(l)}`;if(!e.dryRun){let _=V.dirname(i);if(!ri.existsSync(_))ri.mkdirSync(_,{recursive:!0});ri.writeFileSync(i,p,"utf-8"),rm.success(`[generate:db-types] wrote ${a.length} table(s) to ${i}`)}return{outFile:i,tables:a,errors:r,content:p}}function wm(e,t="app"){let n=[...e].sort((i,r)=>i.table.localeCompare(r.table)).map((i)=>Gc(i.table,i.columns,t==="framework"?1:2)).join(`
34
- `);return`${Bc(t)}${n}
35
- ${Lc(t)}`}import{configureOrm as vm}from"@stacksjs/query-builder";function Sm(){try{let e=process.env.DB_DATABASE_PATH||"database/stacks.sqlite";if((process.env.DB_CONNECTION||"sqlite")==="sqlite")vm({database:e})}catch{}}Sm();async function Hc(e){for(let t=0;;t++){let n=await import(e);try{return n.default}catch(i){if(t<5&&i instanceof ReferenceError&&/before initialization/.test(i.message)){await new Promise((r)=>setTimeout(r,0));continue}throw i}}}async function qi(e,t=[""]){let{path:n}=await import("@stacksjs/path"),i=n.userModelsPath(`${e}.ts`);try{if(await Bun.file(i).exists())return await Hc(i)}catch(r){console.error(`[orm] Failed to import userland model ${e} from ${i} - falling back to framework default. Reason:`,r)}for(let r of t){let o=r?`${r}/`:"",s=n.frameworkPath(`defaults/app/Models/${o}${e}.ts`);try{if(await Bun.file(s).exists())return await Hc(s)}catch(a){console.error(`[orm] Failed to import framework default model ${e} from ${s} - trying next subdir. Reason:`,a)}}return null}var J={},Vc=()=>{},jj=new Promise((e)=>{Vc=e});function h(e){return new Proxy(function(){},{get(t,n){if(n==="then")return;let i=J[e];if(i==null)return;let r=i[n];return typeof r==="function"?r.bind(i):r},set(t,n,i){let r=J[e];if(r==null)return!1;return r[n]=i,!0},has(t,n){let i=J[e];return i==null?!1:(n in i)},apply(t,n,i){let r=J[e];if(r==null||typeof r!=="function")return;return r.apply(n,i)}})}var xm=h("User"),Cm=h("Job"),jm=h("FailedJob"),Pm=[["Team",[""],"auth"],["TeamInvitation",[""],"auth"],["TeamMember",[""],"auth"],["SocialAccount",[""],"auth"],["Subscriber",[""],"auth"],["SubscriberEmail",[""],"auth"],["Subscription",[""],"auth"],["Post",["Content"],"cms"],["Page",["Content"],"cms"],["PageRevision",["Content"],"cms"],["Redirect",["Content"],"cms"],["Menu",["Content"],"cms"],["MenuItem",["Content"],"cms"],["Author",["Content"],"cms"],["Comment",[""],"cms"],["Tag",[""],"cms"],["Site",[""],"auth"],["SiteDomain",[""],"auth"],["MagicLinkToken",[""],"auth"],["SmsOptOut",[""],"auth"],["Form",["Forms"],"forms"],["FormField",["Forms"],"forms"],["FormSubmission",["Forms"],"forms"],["Activity",[""],"dashboard"],["Board",[""],"dashboard"],["BoardColumn",[""],"dashboard"],["Card",[""],"dashboard"],["CardComment",[""],"dashboard"],["Deployment",[""],"dashboard"],["Label",[""],"dashboard"],["Release",[""],"dashboard"],["Notification",[""],"dashboard"],["NotificationDelivery",[""],"dashboard"],["MailPreference",[""],"dashboard"],["Log",[""],"dashboard"],["Request",[""],"dashboard"],["AnalyticsEvent",[""],"dashboard"],["QueryLog",[""],"dashboard"],["Error",[""],"monitoring"],["Websocket",["realtime"],"realtime"],["Campaign",[""],"marketing"],["CampaignSend",[""],"marketing"],["EmailList",[""],"marketing"],["EmailListSubscriber",[""],"marketing"],["EmailIdempotency",[""],"marketing"],["EmailSuppression",[""],"marketing"],["EmailWebhookEvent",[""],"marketing"],["SocialPost",[""],"marketing"],["Automation",[""],"marketing"],["AutomationRun",[""],"marketing"],["CampaignVariant",[""],"marketing"],["CommunicationSuppression",[""],"marketing"],["ConsentEvent",[""],"marketing"],["SenderDomain",[""],"marketing"],["UsageEvent",[""],"marketing"],["PaymentMethod",[""],"commerce"],["PaymentProduct",[""],"commerce"],["PaymentTransaction",[""],"commerce"],["Order",["commerce"],"commerce"],["OrderIdempotency",["commerce"],"commerce"],["OrderItem",["commerce"],"commerce"],["Cart",["commerce"],"commerce"],["CartItem",["commerce"],"commerce"],["Customer",["commerce"],"commerce"],["Product",["commerce"],"commerce"],["ProductVariant",["commerce"],"commerce"],["ProductUnit",["commerce"],"commerce"],["Manufacturer",["commerce"],"commerce"],["Category",["commerce"],"commerce"],["Coupon",["commerce"],"commerce"],["GiftCard",["commerce"],"commerce"],["LicenseKey",["commerce"],"commerce"],["Review",["commerce"],"commerce"],["Receipt",["commerce"],"commerce"],["PrintDevice",["commerce"],"commerce"],["ShippingMethod",["commerce"],"commerce"],["ShippingRate",["commerce"],"commerce"],["ShippingZone",["commerce"],"commerce"],["DeliveryRoute",["commerce"],"commerce"],["DeliveryStop",["commerce"],"commerce"],["DigitalDelivery",["commerce"],"commerce"],["Driver",["commerce"],"commerce"],["DriverPing",["commerce"],"commerce"],["TaxRate",["commerce"],"commerce"],["WaitlistProduct",["commerce"],"commerce"],["WaitlistRestaurant",["commerce"],"commerce"],["Auction",["commerce"],"commerce"],["AuctionItem",["commerce"],"commerce"],["Bid",["commerce"],"commerce"],["Pledge",["commerce"],"commerce"],["LoyaltyPoint",["commerce"],"commerce"],["LoyaltyReward",["commerce"],"commerce"],["Payment",["commerce"],"commerce"],["Transaction",["commerce"],"commerce"]];queueMicrotask(async()=>{try{let{feature:e}=await import("@stacksjs/config"),t=await qi("User");if(t)J.User=t;if(e("queue")){let n=await qi("Job");if(n)J.Job=n;let i=await qi("FailedJob");if(i)J.FailedJob=i}for(let[n,i,r]of Pm){if(!e(r))continue;let o=await qi(n,i);if(o)J[n]=o}}catch(e){console.error("[orm] deferred model load failed:",e)}finally{Vc()}});var Em=h("Activity"),qm=h("AnalyticsEvent"),Om=h("Automation"),Am=h("AutomationRun"),Im=h("Auction"),$m=h("CampaignVariant"),Um=h("CommunicationSuppression"),Mm=h("ConsentEvent"),Dm=h("SenderDomain"),Fm=h("UsageEvent"),Nm=h("AuctionItem"),Gm=h("Author"),Bm=h("Bid"),Lm=h("Board"),Km=h("BoardColumn"),Hm=h("Campaign"),Vm=h("Card"),zm=h("CardComment"),Wm=h("Cart"),Qm=h("CartItem"),Jm=h("Category"),Xm=h("Comment"),Ym=h("Coupon"),Zm=h("Customer"),ep=h("DeliveryRoute"),tp=h("DeliveryStop"),np=h("Deployment"),ip=h("DigitalDelivery"),rp=h("Driver"),op=h("DriverPing"),sp=h("CampaignSend"),ap=h("EmailList"),lp=h("EmailListSubscriber"),cp=h("Form"),dp=h("FormField"),up=h("FormSubmission"),mp=h("MagicLinkToken"),pp=h("Menu"),fp=h("MenuItem"),_p=h("PageRevision"),kp=h("Pledge"),bp=h("Redirect"),gp=h("Site"),hp=h("SiteDomain"),yp=h("SmsOptOut"),Rp=h("EmailIdempotency"),Tp=h("EmailSuppression"),wp=h("EmailWebhookEvent"),vp=h("Error"),Sp=h("GiftCard"),xp=h("Label"),Cp=h("LicenseKey"),jp=h("Log"),Pp=h("LoyaltyPoint"),Ep=h("LoyaltyReward"),qp=h("MailPreference"),Op=h("Manufacturer"),Ap=h("Notification"),Ip=h("NotificationDelivery"),$p=h("Order"),Up=h("OrderIdempotency"),Mp=h("OrderItem"),Dp=h("Page"),Fp=h("Payment"),Np=h("PaymentMethod"),Gp=h("PaymentProduct"),Bp=h("PaymentTransaction"),Lp=h("Post"),Kp=h("PrintDevice"),Hp=h("Product"),Vp=h("ProductUnit"),zp=h("ProductVariant"),Wp=h("QueryLog"),Qp=h("Receipt"),Jp=h("Release"),Xp=h("Request"),Yp=h("Review"),Zp=h("ShippingMethod"),ef=h("ShippingRate"),tf=h("ShippingZone"),nf=h("SocialPost"),rf=h("SocialAccount"),of=h("Subscriber"),sf=h("SubscriberEmail"),af=h("Subscription"),lf=h("Tag"),cf=h("TaxRate"),df=h("Team"),uf=h("TeamInvitation"),mf=h("TeamMember"),pf=h("Transaction"),ff=h("WaitlistProduct"),_f=h("WaitlistRestaurant"),kf=h("Websocket"),bf={User:xm,Job:Cm,FailedJob:jm,Activity:Em,AnalyticsEvent:qm,Automation:Om,AutomationRun:Am,Auction:Im,AuctionItem:Nm,Author:Gm,Bid:Bm,Board:Lm,BoardColumn:Km,Campaign:Hm,CampaignSend:sp,CampaignVariant:$m,Card:Vm,CardComment:zm,Cart:Wm,CartItem:Qm,Category:Jm,Comment:Xm,Coupon:Ym,Customer:Zm,CommunicationSuppression:Um,ConsentEvent:Mm,DeliveryRoute:ep,DeliveryStop:tp,Deployment:np,DigitalDelivery:ip,Driver:rp,DriverPing:op,EmailList:ap,EmailListSubscriber:lp,EmailIdempotency:Rp,EmailSuppression:Tp,EmailWebhookEvent:wp,ErrorModel:vp,Form:cp,FormField:dp,FormSubmission:up,GiftCard:Sp,Label:xp,LicenseKey:Cp,Log:jp,LoyaltyPoint:Pp,LoyaltyReward:Ep,MailPreference:qp,Manufacturer:Op,Notification:Ap,MagicLinkToken:mp,Menu:pp,MenuItem:fp,NotificationDelivery:Ip,Order:$p,OrderIdempotency:Up,OrderItem:Mp,Page:Dp,PageRevision:_p,Payment:Fp,PaymentMethod:Np,PaymentProduct:Gp,PaymentTransaction:Bp,Pledge:kp,Post:Lp,PrintDevice:Kp,Product:Hp,ProductUnit:Vp,ProductVariant:zp,QueryLog:Wp,Receipt:Qp,Release:Jp,Request:Xp,Review:Yp,ShippingMethod:Zp,Redirect:bp,SenderDomain:Dm,ShippingRate:ef,ShippingZone:tf,Site:gp,SiteDomain:hp,SmsOptOut:yp,SocialAccount:rf,SocialPost:nf,Subscriber:of,SubscriberEmail:sf,Subscription:af,Tag:lf,TaxRate:cf,Team:df,TeamInvitation:uf,TeamMember:mf,Transaction:pf,UsageEvent:Fm,WaitlistProduct:ff,WaitlistRestaurant:_f,Websocket:kf},ce=globalThis;for(let[e,t]of Object.entries(bf))if(t&&ce[e]===void 0)ce[e]=t;async function gf(e){if(!e)return[];try{if(typeof e.all==="function"){let t=await e.all();return Array.isArray(t)?t:[]}if(typeof e.get==="function"){let t=await e.get();return Array.isArray(t)?t:[]}}catch{}return[]}function hf(e,t,n=""){if(!e)return n;try{if(typeof e.get==="function"){let r=e.get(t);if(r!==void 0&&r!==null)return r}}catch{}let i=e?.[t];return i!==void 0&&i!==null?i:n}if(ce.safeAll===void 0)ce.safeAll=gf;if(ce.safeGet===void 0)ce.safeGet=hf;export{Em as Activity,qm as AnalyticsEvent,Im as Auction,Nm as AuctionItem,Gm as Author,Om as Automation,Am as AutomationRun,Bm as Bid,Lm as Board,Km as BoardColumn,Hm as Campaign,sp as CampaignSend,$m as CampaignVariant,Vm as Card,zm as CardComment,Wm as Cart,Qm as CartItem,Jm as Category,Xm as Comment,Um as CommunicationSuppression,Mm as ConsentEvent,Ym as Coupon,Zm as Customer,ep as DeliveryRoute,tp as DeliveryStop,np as Deployment,ip as DigitalDelivery,rp as Driver,op as DriverPing,Rp as EmailIdempotency,ap as EmailList,lp as EmailListSubscriber,Tp as EmailSuppression,wp as EmailWebhookEvent,vp as ErrorModel,jm as FailedJob,cp as Form,dp as FormField,up as FormSubmission,Sp as GiftCard,Cm as Job,xp as Label,Cp as LicenseKey,jp as Log,Pp as LoyaltyPoint,Ep as LoyaltyReward,Fa as MODEL_DEFINITION,mp as MagicLinkToken,qp as MailPreference,Op as Manufacturer,Ua as MassAssignmentException,pp as Menu,fp as MenuItem,Uc as ModelNotFoundError,Ac as ModelValidationError,Ap as Notification,Ip as NotificationDelivery,$p as Order,Up as OrderIdempotency,Mp as OrderItem,Dp as Page,_p as PageRevision,Fp as Payment,Np as PaymentMethod,Gp as PaymentProduct,Bp as PaymentTransaction,kp as Pledge,Lp as Post,Kp as PrintDevice,Hp as Product,Vp as ProductUnit,zp as ProductVariant,Wp as QueryLog,Qp as Receipt,bp as Redirect,Jp as Release,Xp as Request,Yp as Review,Dm as SenderDomain,Zp as ShippingMethod,ef as ShippingRate,tf as ShippingZone,gp as Site,hp as SiteDomain,yp as SmsOptOut,rf as SocialAccount,nf as SocialPost,Cd as SubqueryBuilder,of as Subscriber,sf as SubscriberEmail,af as Subscription,lf as Tag,cf as TaxRate,df as Team,uf as TeamInvitation,mf as TeamMember,pf as Transaction,Fm as UsageEvent,xm as User,ff as WaitlistProduct,_f as WaitlistRestaurant,kf as Websocket,e_ as batchLoad,Tm as buildDatabaseSchema,Ui as collectEncryptedAttributes,Va as createAuditMethods,Ki as createCategorizableMethods,Gi as createCommentableMethods,Hi as createLikeableMethods,Li as createTaggableMethods,r_ as db,$i as decryptValue,Dc as defineModel,Ii as encryptValue,rr as enrichPaginatorUrls,yj as extendModel,C_ as extractDate,v_ as extractFields,y_ as fetchOtherModelRelations,gd as filterFillable,Qi as findCoreModel,Ji as findUserModel,x_ as formatDate,w_ as getFillableAttributes,T_ as getGuardedAttributes,R_ as getHiddenAttributes,ke as getModelName,Pd as getPivotTableName,h_ as getPivotTables,vf as getPrunableConfig,g_ as getRelationCount,b_ as getRelationType,Ed as getRelations,F as getTableName,bd as getWritableFields,k_ as hasRelations,Ud as isCursorPaginator,ue as isEncrypted,Id as isPaginator,$d as isSimplePaginator,Xa as isUniqueViolation,S_ as mapEntity,_d as mapWriteError,wf as massPrunable,im as mergeModelDefinition,__ as modelTableName,jj as ormReady,sl as parseCursor,Da as projectDocumentsFromTrait,Xc as prunable,wm as renderDatabaseTypeFile,ir as resolveCursorArgs,nr as resolvePageArgs,l_ as savepoint,od as setAuditUser,Xu as toAttrs,er as toCursorPaginator,Yi as toPaginator,Zi as toSimplePaginator,kd as toSnakeCaseKeys,j_ as toTimestamp,a_ as transaction,c_ as transactional,ee as withoutEvents,Cu as withoutValidation};
30
+ `,Rm="/* eslint-disable */\n// AUTO-GENERATED by `buddy generate:db-types --framework` \u2014 do not edit.\n//\n// The shapes of the tables the framework itself ships, so framework code gets\n// real rows from `db.selectFrom(...)` without asserting them. An application's\n// own tables (and its overrides of these) live in `DatabaseSchema`, which takes\n// precedence - see `RowOf` in `./utils`.\n\nexport interface FrameworkSchema {\n",Tm=`}
31
+ `;function Lc(e){return e==="framework"?Rm:hm}function Kc(e){return e==="framework"?Tm:ym}async function Hc(e,t,n=[]){let i=[];if(!ri.existsSync(e))return i;let r=ri.readdirSync(e,{withFileTypes:!0});for(let o of r){let s=V.join(e,o.name);if(o.isDirectory()){if(t){let a=await Hc(s,!0,n);i.push(...a)}continue}if(!o.name.endsWith(".ts"))continue;if(o.name.startsWith("_")||o.name.startsWith("index"))continue;try{let a=await(V.isAbsolute(s)?import(s):import(V.resolve(s))),c=a.default||a;if(c?.name&&(c.attributes||c.table))i.push({filePath:s,model:c})}catch(a){n.push({file:s,error:a.message})}}return i}async function wm(e={}){let t=e.modelsDir??V.userModelsPath(),n=e.defaultsDir??V.frameworkPath("defaults/app/Models"),i=e.outFile??V.projectPath("database/types.d.ts"),r=[],o=[];for(let[_,k]of[[t,!1],[n,!0]])try{let g=await Hc(_,k,r);o.push(...g)}catch(g){r.push({file:_,error:g.message})}let s=new Map;for(let _ of o)s.set(_.model.name??V.basename(_.filePath).replace(/\.ts$/,""),_);for(let _ of o)if(_.filePath.startsWith(t))s.set(_.model.name??V.basename(_.filePath).replace(/\.ts$/,""),_);let a=[];for(let[_,{model:k}]of s){let g=k.table??`${Q(_)}s`,y=gm({..._m(k),...km(k),...dm(k)});a.push({table:g,model:_,columns:y})}let c=new Map;for(let[_,{model:k}]of s)for(let g of pm(_,k)){if(c.has(g.table))continue;c.set(g.table,{table:g.table,model:`(${g.table} pivot)`,columns:g.columns})}a.push(...c.values()),a.sort((_,k)=>_.table.localeCompare(k.table));let l=e.target??"app",u=l==="framework"?1:2,m=a.map((_)=>Bc(_.table,_.columns,u)).join(`
32
+ `),p=`${Lc(l)}${m}
33
+ ${Kc(l)}`;if(!e.dryRun){let _=V.dirname(i);if(!ri.existsSync(_))ri.mkdirSync(_,{recursive:!0});ri.writeFileSync(i,p,"utf-8"),om.success(`[generate:db-types] wrote ${a.length} table(s) to ${i}`)}return{outFile:i,tables:a,errors:r,content:p}}function vm(e,t="app"){let n=[...e].sort((i,r)=>i.table.localeCompare(r.table)).map((i)=>Bc(i.table,i.columns,t==="framework"?1:2)).join(`
34
+ `);return`${Lc(t)}${n}
35
+ ${Kc(t)}`}import{configureOrm as Sm}from"@stacksjs/query-builder";function xm(){try{let e=process.env.DB_DATABASE_PATH||"database/stacks.sqlite";if((process.env.DB_CONNECTION||"sqlite")==="sqlite")Sm({database:e})}catch{}}xm();async function Vc(e){for(let t=0;;t++){let n=await import(e);try{return n.default}catch(i){if(t<5&&i instanceof ReferenceError&&/before initialization/.test(i.message)){await new Promise((r)=>setTimeout(r,0));continue}throw i}}}async function qi(e,t=[""]){let{path:n}=await import("@stacksjs/path"),i=n.userModelsPath(`${e}.ts`);try{if(await Bun.file(i).exists())return await Vc(i)}catch(r){console.error(`[orm] Failed to import userland model ${e} from ${i} - falling back to framework default. Reason:`,r)}for(let r of t){let o=r?`${r}/`:"",s=n.frameworkPath(`defaults/app/Models/${o}${e}.ts`);try{if(await Bun.file(s).exists())return await Vc(s)}catch(a){console.error(`[orm] Failed to import framework default model ${e} from ${s} - trying next subdir. Reason:`,a)}}return null}var J={},zc=()=>{},Pj=new Promise((e)=>{zc=e});function h(e){return new Proxy(function(){},{get(t,n){if(n==="then")return;let i=J[e];if(i==null)return;let r=i[n];return typeof r==="function"?r.bind(i):r},set(t,n,i){let r=J[e];if(r==null)return!1;return r[n]=i,!0},has(t,n){let i=J[e];return i==null?!1:(n in i)},apply(t,n,i){let r=J[e];if(r==null||typeof r!=="function")return;return r.apply(n,i)}})}var Cm=h("User"),jm=h("Job"),Pm=h("FailedJob"),Em=[["Team",[""],"auth"],["TeamInvitation",[""],"auth"],["TeamMember",[""],"auth"],["SocialAccount",[""],"auth"],["Subscriber",[""],"auth"],["SubscriberEmail",[""],"auth"],["Subscription",[""],"auth"],["Post",["Content"],"cms"],["Page",["Content"],"cms"],["PageRevision",["Content"],"cms"],["Redirect",["Content"],"cms"],["Menu",["Content"],"cms"],["MenuItem",["Content"],"cms"],["Author",["Content"],"cms"],["Comment",[""],"cms"],["Tag",[""],"cms"],["Site",[""],"auth"],["SiteDomain",[""],"auth"],["MagicLinkToken",[""],"auth"],["SmsOptOut",[""],"auth"],["Form",["Forms"],"forms"],["FormField",["Forms"],"forms"],["FormSubmission",["Forms"],"forms"],["Activity",[""],"dashboard"],["Board",[""],"dashboard"],["BoardColumn",[""],"dashboard"],["Card",[""],"dashboard"],["CardComment",[""],"dashboard"],["Deployment",[""],"dashboard"],["Label",[""],"dashboard"],["Release",[""],"dashboard"],["Notification",[""],"dashboard"],["NotificationDelivery",[""],"dashboard"],["MailPreference",[""],"dashboard"],["Log",[""],"dashboard"],["Request",[""],"dashboard"],["AnalyticsEvent",[""],"dashboard"],["QueryLog",[""],"dashboard"],["Error",[""],"monitoring"],["Websocket",["realtime"],"realtime"],["Campaign",[""],"marketing"],["CampaignSend",[""],"marketing"],["EmailList",[""],"marketing"],["EmailListSubscriber",[""],"marketing"],["EmailIdempotency",[""],"marketing"],["EmailSuppression",[""],"marketing"],["EmailWebhookEvent",[""],"marketing"],["SocialPost",[""],"marketing"],["Automation",[""],"marketing"],["AutomationRun",[""],"marketing"],["CampaignVariant",[""],"marketing"],["CommunicationSuppression",[""],"marketing"],["ConsentEvent",[""],"marketing"],["SenderDomain",[""],"marketing"],["UsageEvent",[""],"marketing"],["PaymentMethod",[""],"commerce"],["PaymentProduct",[""],"commerce"],["PaymentTransaction",[""],"commerce"],["Order",["commerce"],"commerce"],["OrderIdempotency",["commerce"],"commerce"],["OrderItem",["commerce"],"commerce"],["Cart",["commerce"],"commerce"],["CartItem",["commerce"],"commerce"],["Customer",["commerce"],"commerce"],["Product",["commerce"],"commerce"],["ProductVariant",["commerce"],"commerce"],["ProductUnit",["commerce"],"commerce"],["Manufacturer",["commerce"],"commerce"],["Category",["commerce"],"commerce"],["Coupon",["commerce"],"commerce"],["GiftCard",["commerce"],"commerce"],["LicenseKey",["commerce"],"commerce"],["Review",["commerce"],"commerce"],["Receipt",["commerce"],"commerce"],["PrintDevice",["commerce"],"commerce"],["ShippingMethod",["commerce"],"commerce"],["ShippingRate",["commerce"],"commerce"],["ShippingZone",["commerce"],"commerce"],["DeliveryRoute",["commerce"],"commerce"],["DeliveryStop",["commerce"],"commerce"],["DigitalDelivery",["commerce"],"commerce"],["Driver",["commerce"],"commerce"],["DriverPing",["commerce"],"commerce"],["TaxRate",["commerce"],"commerce"],["WaitlistProduct",["commerce"],"commerce"],["WaitlistRestaurant",["commerce"],"commerce"],["Auction",["commerce"],"commerce"],["AuctionItem",["commerce"],"commerce"],["Bid",["commerce"],"commerce"],["Pledge",["commerce"],"commerce"],["LoyaltyPoint",["commerce"],"commerce"],["LoyaltyReward",["commerce"],"commerce"],["Payment",["commerce"],"commerce"],["Transaction",["commerce"],"commerce"]];queueMicrotask(async()=>{try{let{feature:e}=await import("@stacksjs/config"),t=await qi("User");if(t)J.User=t;if(e("queue")){let n=await qi("Job");if(n)J.Job=n;let i=await qi("FailedJob");if(i)J.FailedJob=i}for(let[n,i,r]of Em){if(!e(r))continue;let o=await qi(n,i);if(o)J[n]=o}}catch(e){console.error("[orm] deferred model load failed:",e)}finally{zc()}});var qm=h("Activity"),Om=h("AnalyticsEvent"),Am=h("Automation"),Im=h("AutomationRun"),$m=h("Auction"),Um=h("CampaignVariant"),Mm=h("CommunicationSuppression"),Dm=h("ConsentEvent"),Fm=h("SenderDomain"),Nm=h("UsageEvent"),Gm=h("AuctionItem"),Bm=h("Author"),Lm=h("Bid"),Km=h("Board"),Hm=h("BoardColumn"),Vm=h("Campaign"),zm=h("Card"),Wm=h("CardComment"),Qm=h("Cart"),Jm=h("CartItem"),Xm=h("Category"),Ym=h("Comment"),Zm=h("Coupon"),ep=h("Customer"),tp=h("DeliveryRoute"),np=h("DeliveryStop"),ip=h("Deployment"),rp=h("DigitalDelivery"),op=h("Driver"),sp=h("DriverPing"),ap=h("CampaignSend"),lp=h("EmailList"),cp=h("EmailListSubscriber"),dp=h("Form"),up=h("FormField"),mp=h("FormSubmission"),pp=h("MagicLinkToken"),fp=h("Menu"),_p=h("MenuItem"),kp=h("PageRevision"),bp=h("Pledge"),gp=h("Redirect"),hp=h("Site"),yp=h("SiteDomain"),Rp=h("SmsOptOut"),Tp=h("EmailIdempotency"),wp=h("EmailSuppression"),vp=h("EmailWebhookEvent"),Sp=h("Error"),xp=h("GiftCard"),Cp=h("Label"),jp=h("LicenseKey"),Pp=h("Log"),Ep=h("LoyaltyPoint"),qp=h("LoyaltyReward"),Op=h("MailPreference"),Ap=h("Manufacturer"),Ip=h("Notification"),$p=h("NotificationDelivery"),Up=h("Order"),Mp=h("OrderIdempotency"),Dp=h("OrderItem"),Fp=h("Page"),Np=h("Payment"),Gp=h("PaymentMethod"),Bp=h("PaymentProduct"),Lp=h("PaymentTransaction"),Kp=h("Post"),Hp=h("PrintDevice"),Vp=h("Product"),zp=h("ProductUnit"),Wp=h("ProductVariant"),Qp=h("QueryLog"),Jp=h("Receipt"),Xp=h("Release"),Yp=h("Request"),Zp=h("Review"),ef=h("ShippingMethod"),tf=h("ShippingRate"),nf=h("ShippingZone"),rf=h("SocialPost"),of=h("SocialAccount"),sf=h("Subscriber"),af=h("SubscriberEmail"),lf=h("Subscription"),cf=h("Tag"),df=h("TaxRate"),uf=h("Team"),mf=h("TeamInvitation"),pf=h("TeamMember"),ff=h("Transaction"),_f=h("WaitlistProduct"),kf=h("WaitlistRestaurant"),bf=h("Websocket"),gf={User:Cm,Job:jm,FailedJob:Pm,Activity:qm,AnalyticsEvent:Om,Automation:Am,AutomationRun:Im,Auction:$m,AuctionItem:Gm,Author:Bm,Bid:Lm,Board:Km,BoardColumn:Hm,Campaign:Vm,CampaignSend:ap,CampaignVariant:Um,Card:zm,CardComment:Wm,Cart:Qm,CartItem:Jm,Category:Xm,Comment:Ym,Coupon:Zm,Customer:ep,CommunicationSuppression:Mm,ConsentEvent:Dm,DeliveryRoute:tp,DeliveryStop:np,Deployment:ip,DigitalDelivery:rp,Driver:op,DriverPing:sp,EmailList:lp,EmailListSubscriber:cp,EmailIdempotency:Tp,EmailSuppression:wp,EmailWebhookEvent:vp,ErrorModel:Sp,Form:dp,FormField:up,FormSubmission:mp,GiftCard:xp,Label:Cp,LicenseKey:jp,Log:Pp,LoyaltyPoint:Ep,LoyaltyReward:qp,MailPreference:Op,Manufacturer:Ap,Notification:Ip,MagicLinkToken:pp,Menu:fp,MenuItem:_p,NotificationDelivery:$p,Order:Up,OrderIdempotency:Mp,OrderItem:Dp,Page:Fp,PageRevision:kp,Payment:Np,PaymentMethod:Gp,PaymentProduct:Bp,PaymentTransaction:Lp,Pledge:bp,Post:Kp,PrintDevice:Hp,Product:Vp,ProductUnit:zp,ProductVariant:Wp,QueryLog:Qp,Receipt:Jp,Release:Xp,Request:Yp,Review:Zp,ShippingMethod:ef,Redirect:gp,SenderDomain:Fm,ShippingRate:tf,ShippingZone:nf,Site:hp,SiteDomain:yp,SmsOptOut:Rp,SocialAccount:of,SocialPost:rf,Subscriber:sf,SubscriberEmail:af,Subscription:lf,Tag:cf,TaxRate:df,Team:uf,TeamInvitation:mf,TeamMember:pf,Transaction:ff,UsageEvent:Nm,WaitlistProduct:_f,WaitlistRestaurant:kf,Websocket:bf},ce=globalThis;for(let[e,t]of Object.entries(gf))if(t&&ce[e]===void 0)ce[e]=t;async function hf(e){if(!e)return[];try{if(typeof e.all==="function"){let t=await e.all();return Array.isArray(t)?t:[]}if(typeof e.get==="function"){let t=await e.get();return Array.isArray(t)?t:[]}}catch{}return[]}function yf(e,t,n=""){if(!e)return n;try{if(typeof e.get==="function"){let r=e.get(t);if(r!==void 0&&r!==null)return r}}catch{}let i=e?.[t];return i!==void 0&&i!==null?i:n}if(ce.safeAll===void 0)ce.safeAll=hf;if(ce.safeGet===void 0)ce.safeGet=yf;export{qm as Activity,Om as AnalyticsEvent,$m as Auction,Gm as AuctionItem,Bm as Author,Am as Automation,Im as AutomationRun,Lm as Bid,Km as Board,Hm as BoardColumn,Vm as Campaign,ap as CampaignSend,Um as CampaignVariant,zm as Card,Wm as CardComment,Qm as Cart,Jm as CartItem,Xm as Category,Ym as Comment,Mm as CommunicationSuppression,Dm as ConsentEvent,Zm as Coupon,ep as Customer,tp as DeliveryRoute,np as DeliveryStop,ip as Deployment,rp as DigitalDelivery,op as Driver,sp as DriverPing,Tp as EmailIdempotency,lp as EmailList,cp as EmailListSubscriber,wp as EmailSuppression,vp as EmailWebhookEvent,Sp as ErrorModel,Pm as FailedJob,dp as Form,up as FormField,mp as FormSubmission,xp as GiftCard,jm as Job,Cp as Label,jp as LicenseKey,Pp as Log,Ep as LoyaltyPoint,qp as LoyaltyReward,Fa as MODEL_DEFINITION,pp as MagicLinkToken,Op as MailPreference,Ap as Manufacturer,Ua as MassAssignmentException,fp as Menu,_p as MenuItem,Mc as ModelNotFoundError,Ic as ModelValidationError,Ip as Notification,$p as NotificationDelivery,Up as Order,Mp as OrderIdempotency,Dp as OrderItem,Fp as Page,kp as PageRevision,Np as Payment,Gp as PaymentMethod,Bp as PaymentProduct,Lp as PaymentTransaction,bp as Pledge,Kp as Post,Hp as PrintDevice,Vp as Product,zp as ProductUnit,Wp as ProductVariant,Qp as QueryLog,Jp as Receipt,gp as Redirect,Xp as Release,Yp as Request,Zp as Review,Fm as SenderDomain,ef as ShippingMethod,tf as ShippingRate,nf as ShippingZone,hp as Site,yp as SiteDomain,Rp as SmsOptOut,of as SocialAccount,rf as SocialPost,jd as SubqueryBuilder,sf as Subscriber,af as SubscriberEmail,lf as Subscription,cf as Tag,df as TaxRate,uf as Team,mf as TeamInvitation,pf as TeamMember,ff as Transaction,Nm as UsageEvent,Cm as User,_f as WaitlistProduct,kf as WaitlistRestaurant,bf as Websocket,t_ as batchLoad,wm as buildDatabaseSchema,Ui as collectEncryptedAttributes,Va as createAuditMethods,Ki as createCategorizableMethods,Gi as createCommentableMethods,Hi as createLikeableMethods,Li as createTaggableMethods,o_ as db,$i as decryptValue,Fc as defineModel,Ii as encryptValue,rr as enrichPaginatorUrls,Rj as extendModel,j_ as extractDate,S_ as extractFields,R_ as fetchOtherModelRelations,hd as filterFillable,Qi as findCoreModel,Ji as findUserModel,C_ as formatDate,v_ as getFillableAttributes,w_ as getGuardedAttributes,T_ as getHiddenAttributes,ke as getModelName,Ed as getPivotTableName,y_ as getPivotTables,Sf as getPrunableConfig,h_ as getRelationCount,g_ as getRelationType,qd as getRelations,F as getTableName,gd as getWritableFields,b_ as hasRelations,Md as isCursorPaginator,ue as isEncrypted,$d as isPaginator,Ud as isSimplePaginator,Ya as isUniqueViolation,x_ as mapEntity,kd as mapWriteError,vf as massPrunable,rm as mergeModelDefinition,k_ as modelTableName,Pj as ormReady,al as parseCursor,Da as projectDocumentsFromTrait,Yc as prunable,vm as renderDatabaseTypeFile,ir as resolveCursorArgs,nr as resolvePageArgs,c_ as savepoint,sd as setAuditUser,Yu as toAttrs,er as toCursorPaginator,Yi as toPaginator,Zi as toSimplePaginator,bd as toSnakeCaseKeys,P_ as toTimestamp,l_ as transaction,d_ as transactional,ee as withoutEvents,ju as withoutValidation};