import{_ as H,a as P}from"./BuPXYaOg.js";import{_ as z}from"./DXyvFCCy.js";import{d as F,J as L,g as v,c as n,o as t,w as a,b as d,a as f,e as r,t as m,m as e,n as h,_ as R,F as _,l as c,r as x,s as T}from"./Dk4AzF7j.js";import{_ as W}from"./BnFHREeV.js";import{_ as j}from"./DWH2kpQP.js";import{_ as J}from"./BXyDg5m4.js";import{_ as K}from"./D-lem41g.js";import{u as M}from"./D9-3tnQL.js";import"./D7D5X_-3.js";import"./DM9AftQm.js";import"./D9EMGUu-.js";import"./B_jJHUd2.js";import"./DgCXB7yu.js";import"./DMtpgJrn.js";import"./7TXjTTLK.js";import"./B-PWL9ab.js";import"./BtsG96Qa.js";const q={class:"flex flex-col gap-4"},O={class:"font-medium text-lg p-2"},Q={key:0,class:"flex items-center justify-center p-12"},X={class:"flex items-center gap-2"},Y={key:1,class:"pt-4"},kt=F({__name:"woocommerce",setup(Z){const{getComponentData:b,getHealthData:$}=M(),{componentData:w,componentStatus:D,componentError:g}=b(),{healthData:i,healthStatus:B,healthError:l}=$(),{t:E}=L(),p=v(()=>{const s=l.value?.cause;return s?.identifier?E(`errors.${s.identifier}`):null}),S=v(()=>!!w.value?.components[0].component);return(s,tt)=>{const U=H,k=z,I=R,N=W,V=T,y=P,A=j,C=J,G=K;return t(),n(G,{"flag-name":"page:integrations.woocommerce","tracking-context":{components:"WooCommercePage"}},{default:a(()=>[d("div",q,[f(k,{class:"mb-4"},{header:a(()=>[d("div",O,m(s.$t("WooCommerce Integration")),1),f(U)]),_:1}),e(D)==="pending"?(t(),r("div",Q,[f(I,{name:"svg-spinners:90-ring-with-bg",class:"size-6 mr-2"}),h(" "+m(s.$t("Loading...")),1)])):(t(),r(_,{key:1},[e(S)?(t(),r(_,{key:0},[e(p)?(t(),n(N,{key:0,class:"mb-4",variant:"subtle",color:"info",description:e(p)},null,8,["description"])):c("",!0),e(B)==="success"?(t(),n(k,{key:1,class:"o_mb-4 o_p-4"},{default:a(()=>[e(i)?.isGrouped?(t(),n(A,{key:0,items:e(i).getGroups,variant:"link",ui:{root:"w-full",list:"o_gap-6",content:"o_pt-8"}},{default:a(({item:o})=>[d("div",X,[h(m(s.$t(o.name))+" ",1),o.notifications?(t(),n(V,{key:0,size:"sm",color:"error"},{default:a(()=>[h(m(o.notifications),1)]),_:2},1024)):c("",!0)])]),content:a(({item:o})=>[(t(!0),r(_,null,x(e(i)?.groupedStats?.[o.name],u=>(t(),n(y,{id:u.id,key:u.id,component:u,class:"mb-5"},null,8,["id","component"]))),128))]),_:1},8,["items"])):(t(),r("div",Y,[(t(!0),r(_,null,x(e(i)?.healthDataResults,o=>(t(),n(y,{id:o.id,key:o.id,component:o,class:"mb-5"},null,8,["id","component"]))),128))]))]),_:1})):c("",!0),(e(g)||e(l))&&!e(p)?(t(),n(C,{key:2,error:e(g)||e(l),refresh:()=>{},"with-refresh":!1},null,8,["error"])):c("",!0)],64)):c("",!0)],64))])]),_:1})}}});export{kt as default};
