PageSourceSearch

https://app.afflow.co/assets/index-BUpsHxD9.js

js afflow.co collected 2026-09-24 14:37:03 UTC 8,474 bytes, 1 lines download raw bytes

1import{e as F,l as c,m as u,aw as q,al as H,ar as N,a as C,o as K,w as L,T as s,R as l,v as t,U as g,Q as B,F as Q,Z,an as J,ao as O,ad as d,ae as o,af as i}from"./vue-core-DUXii8fo.js";import{u as S,f as p,K as x,V as T}from"./index-DuW1V99_.js";import{_ as X,a as Y}from"./CardContent.vue_vue_type_script_setup_true_lang-CyuqoZBU.js";import{_ as ee,a as te}from"./CardTitle.vue_vue_type_script_setup_true_lang-hvMhNYtR.js";import{u as se}from"./usePageTitle-BGqbOKcn.js";import{_ as ae}from"./PageHeader.vue_vue_type_script_setup_true_lang-BNUn0vGu.js";import{_ as $}from"./StatisticsCard.vue_vue_type_script_setup_true_lang-CH6Yg0uI.js";import{_ as oe}from"./EmptyState.vue_vue_type_script_setup_true_lang-ClqlY9It.js";import{_ as ie}from"./LoadingState.vue_vue_type_script_setup_true_lang-Sy4LZc-L.js";import{u as P}from"./store-C_RDh8qJ.js";import{o as b,aH as z,w as A,a8 as le,ay as ne,i as re,aC as ce,aa as de,b7 as ue,bA as me}from"./icons-C2DUVh9O.js";import"./ui-primitives-Dp--CXYu.js";import"./AfflowSpinner-CBDCY0gE.js";import"./Skeleton-COMXh_JC.js";const pe=["width","height","aria-label"],fe=F({__name:"IlloNoBundles",props:{size:{default:132},label:{default:"No bundles yet"}},setup(M){return(r,h)=>(c(),u("svg",{width:r.size,height:r.size,viewBox:"0 0 200 200",role:"img","aria-label":r.label},h[0]||(h[0]=[q('<g transform="translate(100 100) scale(1.18) translate(-100 -100)"><rect x="46" y="104" width="108" height="54" rx="11" class="f-mid"></rect><rect x="96" y="104" width="8" height="54" class="f-accent"></rect><rect x="66" y="56" width="68" height="46" rx="10" class="f-lit"></rect><use href="#aMark" class="f-paper" transform="translate(100 79) scale(0.145) translate(-100 -108)"></use><circle cx="152" cy="56" r="15" class="f-accent"></circle><path d="M145 56 h14 M152 49 v14" class="k-paper" stroke-width="3.6" stroke-linecap="round"></path></g>',1)]),8,pe))}}),he={class:"space-y-6"},ve={key:0,class:"grid gap-4 md:grid-cols-4"},_e={key:3,class:"grid gap-6 md:grid-cols-2 lg:grid-cols-5"},ge={key:0,class:"relative h-48 overflow-hidden"},$e=["src","alt","onClick"],be={key:0,class:"absolute top-3 start-3"},we=["onClick"],ke={class:"text-center text-muted-foreground"},ye={class:"text-sm font-medium"},Ce={class:"text-xs"},Be={key:0,class:"absolute top-3 start-3"},xe={class:"flex items-start justify-between"},Ve={class:"space-y-1"},De={class:"text-sm text-muted-foreground"},Ne={key:0,class:"text-sm text-muted-foreground line-clamp-2"},Se={class:"grid grid-cols-3 gap-2 text-center"},Te={class:"text-xs text-muted-foreground"},Pe={class:"font-semibold"},ze={class:"text-xs text-muted-foreground"},Ae={class:"font-semibold"},Fe={class:"text-xs text-muted-foreground"},Me={class:"font-semibold"},Ue={class:"flex flex-wrap gap-2"},Ge={class:"text-xs text-muted-foreground"},Ye=F({__name:"index",setup(M){const{t:r}=H(),h=J();se(h.meta.title||"Bundles");const{bundles:m,loading:V}=N(P()),{selectedCategoryId:v}=N(S()),{fetchAll:D,deleteBundle:U}=P(),{fetchAll:G}=S(),w=O(),_=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}).format(e),k=e=>{w.push(`/bundles/${e}`)},I=e=>{w.push(`/bundles/${e}/edit`)},R=e=>{w.push(`/bundles/${e}/posts`)},j=async e=>{if(confirm(r("bundles.deleteConfirm")))try{await U(e),T.success(r("bundles.bundleDeleted"),{description:r("bundles.bundleDeletedDesc")})}catch{T.error(r("common.error"),{description:r("bundles.failedToDelete")})}},y=C(()=>m.value.filter(e=>e.status==="active").length),E=C(()=>m.value.reduce((e,n)=>e+(n.estimatedValue||0),0)),W=C(()=>m.value.reduce((e,n)=>e+(n.estimatedCommission||0),0));return K(async()=>{await G(),v.value&&await D(v.value==="all"?void 0:v.value)}),L(v,async e=>{e&&await D(e==="all"?void 0:e)}),(e,n)=>(c(),u("div",he,[s(ae,{title:e.$t("bundles.title"),description:e.$t("bundles.description")},{actions:l(()=>[s(t(p),{variant:"outline",onClick:n[0]||(n[0]=a=>e.$router.push("/bundles/ai-create")),class:"gap-2"},{default:l(()=>[s(t(b),{class:"h-4 w-4"}),d(" "+o(e.$t("bundles.createWithAI")),1)]),_:1}),s(t(p),{onClick:n[1]||(n[1]=a=>e.$router.push("/bundles/new")),class:"gap-2"},{default:l(()=>[s(t(z),{class:"h-4 w-4"}),d(" "+o(e.$t("bundles.newBundle")),1)]),_:1})]),_:1},8,["title","description"]),!t(V)&&t(m).length>0?(c(),u("div",ve,[s($,{title:e.$t("bundles.totalBundles"),value:t(m).length,description:`${y.value} ${e.$t("common.active")}`,icon:t(A)},null,8,["title","value","description","icon"]),s($,{title:e.$t("bundles.activeBundles"),value:y.value,description:`${Math.round(y.value/t(m).length*100)}% ${e.$t("categories.ofTotal")}`,icon:t(le),"icon-class":"text-green-600"},null,8,["title","value","description","icon"]),s($,{title:e.$t("bundles.totalValue"),value:_(E.value),description:e.$t("bundles.estimatedBundleValue"),icon:t(ne),"icon-class":"text-blue-600"},null,8,["title","value","description","icon"]),s($,{title:e.$t("bundles.estimatedCommission"),value:_(W.value),description:e.$t("bundles.potentialEarnings"),icon:t(re),"icon-class":"text-purple-600"},null,8,["title","value","description","icon"])])):g("",!0),t(V)?(c(),B(ie,{key:1,message:e.$t("bundles.loadingBundles")},null,8,["message"])):t(m).length?(c(),u("div",_e,[(c(!0),u(Q,null,Z(t(m),a=>(c(),B(t(Y),{key:a._id,class:"overflow-hidden hover:shadow-lg transition-shadow"},{default:l(()=>[a.imageUrl?(c(),u("div",ge,[i("img",{src:a.imageUrl,alt:a.name,class:"w-full h-full object-contain cursor-pointer transition-transform hover:scale-105",onClick:f=>k(a._id)},null,8,$e),n[4]||(n[4]=i("div",{class:"absolute inset-0 bg-gradient-to-t from-black/20 to-transparent"},null,-1)),a.aiGenerated?(c(),u("div",be,[s(t(x),{class:"bg-purple-600 hover:bg-purple-700 text-white border-none"},{default:l(()=>[s(t(b),{class:"h-3 w-3 me-1"}),d(" "+o(e.$t("bundles.aiGenerated")),1)]),_:1})])):g("",!0)])):(c(),u("div",{key:1,class:"relative h-48 bg-gradient-to-br from-muted to-muted/60 flex items-center justify-center cursor-pointer transition-colors hover:from-muted/80 hover:to-muted/40",onClick:f=>k(a._id)},[i("div",ke,[s(t(A),{class:"h-12 w-12 mx-auto mb-2 opacity-40"}),i("p",ye,o(a.name),1),i("p",Ce,o(a.totalProducts)+" "+o(e.$t("bundles.products")),1)]),a.aiGenerated?(c(),u("div",Be,[s(t(x),{class:"bg-purple-600 hover:bg-purple-700 text-white border-none"},{default:l(()=>[s(t(b),{class:"h-3 w-3 me-1"}),d(" "+o(e.$t("bundles.aiGenerated")),1)]),_:1})])):g("",!0)],8,we)),s(t(te),{class:"pb-3"},{default:l(()=>[i("div",xe,[i("div",Ve,[s(t(ee),{class:"text-lg"},{default:l(()=>[d(o(a.name),1)]),_:2},1024),i("p",De,o(a.categoryName),1)]),s(t(x),{variant:a.status==="active"?"default":"secondary"},{default:l(()=>[d(o(a.status),1)]),_:2},1032,["variant"])]),a.description?(c(),u("p",Ne,o(a.description),1)):g("",!0)]),_:2},1024),s(t(X),{class:"space-y-4"},{default:l(()=>[i("div",Se,[i("div",null,[i("p",Te,o(e.$t("bundles.products")),1),i("p",Pe,o(a.totalProducts),1)]),i("div",null,[i("p",ze,o(e.$t("bundles.value")),1),i("p",Ae,o(_(a.estimatedValue)),1)]),i("div",null,[i("p",Fe,o(e.$t("bundles.c
1ommission")),1),i("p",Me,o(_(a.estimatedCommission)),1)])]),i("div",Ue,[s(t(p),{variant:"outline",size:"sm",onClick:f=>k(a._id),class:"gap-1"},{default:l(()=>[s(t(ce),{class:"h-3 w-3"}),d(" "+o(t(r)("common.view")),1)]),_:2},1032,["onClick"]),s(t(p),{variant:"outline",size:"sm",onClick:f=>I(a._id),class:"gap-1"},{default:l(()=>[s(t(de),{class:"h-3 w-3"}),d(" "+o(t(r)("common.edit")),1)]),_:2},1032,["onClick"]),s(t(p),{variant:"outline",size:"sm",onClick:f=>R(a._id),class:"gap-1"},{default:l(()=>[s(t(ue),{class:"h-3 w-3"}),d(" "+o(t(r)("bundles.createPosts")),1)]),_:2},1032,["onClick"]),s(t(p),{variant:"destructive",size:"sm",onClick:f=>j(a._id),class:"gap-1"},{default:l(()=>[s(t(me),{class:"h-3 w-3"}),d(" "+o(t(r)("common.delete")),1)]),_:2},1032,["onClick"])]),i("div",Ge,o(t(r)("bundles.created"))+": "+o(a.formatCreatedDate()),1)]),_:2},1024)]),_:2},1024))),128))])):(c(),B(oe,{key:2,title:e.$t("bundles.noBundlesFound"),description:e.$t("bundles.noBundlesDescription"),illo:t(fe)},{actions:l(()=>[s(t(p),{variant:"outline",onClick:n[2]||(n[2]=a=>e.$router.push("/bundles/ai-create")),class:"gap-2"},{default:l(()=>[s(t(b),{class:"h-4 w-4"}),d(" "+o(e.$t("bundles.createWithAI")),1)]),_:1}),s(t(p),{onClick:n[3]||(n[3]=a=>e.$router.push("/bundles/new")),class:"gap-2"},{default:l(()=>[s(t(z),{class:"h-4 w-4"}),d(" "+o(e.$t("bundles.createManually")),1)]),_:1})]),_:1},8,["title","description","illo"]))]))}});export{Ye as default};

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.