import{a as t}from"./p-d6eb762b.js";import"./p-112455b1.js";import"./p-1ae2b158.js";var i=function(t,i,r,n){return new(r||(r=Promise))((function(e,o){function u(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof r?i:new r((function(t){t(i)}))).then(u,s)}c((n=n.apply(t,i||[])).next())}))};class r{constructor(t){this.connection=t}equalizeBalance(t){return i(this,void 0,void 0,(function*(){return yield this.connection.delete(`customer/${t}/balance`)}))}addBalance(t,r){return i(this,void 0,void 0,(function*(){return yield this.connection.post(`customer/${r}/balance`,t)}))}setContact(t,r){return i(this,void 0,void 0,(function*(){return yield this.connection.put(`customer/${null!=r?r:null==t?void 0:t.id}/contact`,t)}))}create(t){return i(this,void 0,void 0,(function*(){return yield this.connection.post("customer",t)}))}get(t){return i(this,void 0,void 0,(function*(){return yield this.connection.get(`customer/${t}`)}))}update(t,r){return i(this,void 0,void 0,(function*(){return yield this.connection.patch(`customer/${r}`,t)}))}list(){return i(this,void 0,void 0,(function*(){return yield this.connection.get("customer/")}))}createKey(t){return i(this,void 0,void 0,(function*(){return yield this.connection.post(`customer/${t}`,void 0)}))}createLink(t){return i(this,void 0,void 0,(function*(){return yield this.connection.post(`customer/${t}/link`,void 0)}))}viewLink(t,r){return i(this,void 0,void 0,(function*(){return yield this.connection.get(`customer/${t}/link/${r}`)}))}openLink(r,n){return i(this,void 0,void 0,(function*(){const i=yield this.connection.get(`customer/${r}/link/${n}`);return"string"==typeof i&&(t.key=i),"string"==typeof i}))}createMethod(t,r){return i(this,void 0,void 0,(function*(){return yield this.connection.post(`customer/${r}/method`,t)}))}setMethods(t,r){return i(this,void 0,void 0,(function*(){return yield this.connection.put(`customer/${r}/methods`,t)}))}retryPayment(){return i(this,void 0,void 0,(function*(){return yield this.connection.put("retry",{})}))}createSubscription(t,r){return i(this,void 0,void 0,(function*(){return yield this.connection.post(`customer/${r}/subscription`,t)}))}cancelSubscription(t,r){return i(this,void 0,void 0,(function*(){return yield this.connection.delete(`customer/${t}/subscription/${r}`)}))}updateSubscription(t,r,n){return i(this,void 0,void 0,(function*(){return yield this.connection.patch(`customer/${r}/subscription/${n}`,t)}))}static open(i,n){const e=t.open(i,n);return e&&new r(e)}}export{r as Customer}