PageSourceSearch

https://www.kingchess.io/assets/billing-api-oCwfIcGA.js

js kingchess.io collected 2026-10-08 11:32:17 UTC 1,250 bytes, 1 lines download raw bytes

1import{O as a}from"./index-B5_v9qME.js";class s{get baseUrl(){return`${a.BASE}/api/v1/billing`}get authHeaders(){const e=localStorage.getItem("access_token");return{"Content-Type":"application/json",Authorization:e?`Bearer ${e}`:""}}async getConfig(){const e=await fetch(`${this.baseUrl}/config`);if(!e.ok)throw new Error("Failed to fetch Stripe configuration");return e.json()}async createCheckoutSession(e="monthly"){const t=await fetch(`${this.baseUrl}/create-checkout-session?plan=${e}`,{method:"POST",headers:this.authHeaders});if(!t.ok){const o=await t.json().catch(()=>({detail:"Failed to create checkout session"}));throw new Error(o.detail||"Failed to create checkout session")}return t.json()}async createPortalSession(){const e=await fetch(`${this.baseUrl}/create-portal-session`,{method:"POST",headers:this.authHeaders});if(!e.ok){const t=await e.json().catch(()=>({detail:"Failed to create portal session"}));throw new Error(t.detail||"Failed to create portal session")}return e.json()}async upgradeToPremium(e="monthly"){const{checkout_url:t}=await this.createCheckoutSession(e);window.location.href=t}async openCustomerPortal(){const{portal_url:e}=await this.createPortalSession();window.location.href=e}}const i=new s;export{i as b};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.