import{r as s,h as t,g as i}from"./p-dfbe004d.js";import{_ as r}from"./p-8415f806.js";import"./p-fd56940f.js";import{a as o}from"./p-7393a06c.js";import{o as a}from"./p-c2833cb1.js";import{a as e}from"./p-1c2e2695.js";import"./p-9a7a47e8.js";const d=class{constructor(t){s(this,t)}componentWillLoad(){a(this.el,(()=>{this.fetch()}))}async fetch(){if(""!==this.customerId)try{this.loading=!0,this.customer=await await o({path:e(`surecart/v1/customers/${this.customerId}`,{expand:["shipping_address","billing_address","tax_identifier"]})})}catch(s){this.error=(null==s?void 0:s.message)?s.message:r("Something went wrong","surecart"),console.error(this.error)}finally{this.loading=!1}}render(){return t("sc-customer-details",{customer:this.customer,loading:this.loading,error:this.error,heading:this.heading,"edit-link":e(window.location.href,{action:"edit",model:"customer",id:this.customerId})})}get el(){return i(this)}};d.style=":host{display:block;position:relative}.customer-details{display:grid;gap:0.75em}";export{d as sc_dashboard_customer_details}