1import{f as i,o,b as s,r as N,c as k,w as a,a as r,m as u,k as c,t as d,F as h,l as g,n as T,N as j}from"./app-Bgf-TuPN.js";import{_ as $}from"./DashboardLayout-Bs5b8Szf.js";import{_ as x}from"./Button-DXRPOz_d.js";import{_ as P}from"./ButtonLink-DHG08PGD.js";import{_ as F}from"./Pill-CC6Qr3tG.js";import{_ as V}from"./Modal-DP4cl15H.js";import{I as b}from"./IconTrash-CQUWx2U7.js";import{I}from"./IconArrowLeft-Za3zvhYX.js";import{a as A}from"./IconUser--DMTvuhp.js";import{_ as z}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{P as C}from"./PlatformIcon-D4JqfsSy.js";import{I as E}from"./IconCalendar-CySuch5-.js";import"./CookieConsent-AG_kMxsg.js";import"./IconChevron-x45fWevM.js";import"./IconLogoText-CExMwzJs.js";const U={},D={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function O(e,m){return o(),i("svg",D,m[0]||(m[0]=[s("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},null,-1),s("polyline",{points:"15 3 21 3 21 9"},null,-1),s("line",{x1:"10",y1:"14",x2:"21",y2:"3"},null,-1)]))}const H=z(U,[["render",O]]),R={class:"w-full overflow-auto bg-surface-grey-2x-light p-16 md:px-32 md:py-24"},W={class:"relative flex min-h-full flex-col rounded-2xl bg-surface-page p-16 md:p-24"},Y={class:"mb-24 flex flex-col gap-8"},q={class:"flex items-center gap-2 text-sm text-text-secondary"},G={class:"flex items-center justify-between"},J={class:"grid grid-cols-1 gap-24 lg:grid-cols-3"},K={class:"lg:col-span-2 lg:order-2"},Q={class:"mb-24 overflow-hidden rounded-lg border border-border-light bg-white shadow-sm"},X={class:"border-b border-border-light p-16"},Z={class:"mb-12 flex items-center gap-8"},ss={class:"h-36 w-36 overflow-hidden rounded-full bg-primary-light"},ts={class:"text-xs text-text-secondary"},es={key:0,class:"flex items-center gap-2 rounded-lg bg-warning-subtle px-12 py-8"},os={class:"p-16"},ls={class:"mb-16 whitespace-pre-wrap text-lg"},is={key:0,class:"mt-16 overflow-hidden rounded-lg bg-surface-grey-3x-light"},ns={key:0,class:"flex justify-center"},rs=["src"],ds={key:1,class:"grid grid-cols-2"},as=["src"],cs={key:2,class:"grid grid-cols-2 grid-rows-2"},us={class:"row-span-2"},ms=["src"],fs=["src"],hs={key:3,class:"grid grid-cols-2"},gs=["src"],ps={key:0,class:"relative col-start-2 row-start-2"},xs=["src"],bs={class:"absolute inset-0 flex items-center justify-center"},_s={class:"text-xl font-bold text-white"},ys={class:"mt-16 flex flex-wrap gap-2"},vs={key:0},ws={class:"grid grid-cols-1 gap-16 sm:grid-cols-2"},ks={class:"mb-12 flex items-center gap-8"},js={class:"flex h-32 w-32 items-center justify-center rounded-md bg-surface-grey-light"},Ps={class:"font-medium capitalize"},Is={class:"flex items-center gap-2"},Cs={class:"text-xs capitalize"},Ss={class:"space-y-8 rounded-md bg-surface-grey-2x-light p-12 text-sm"},Ls={key:0,class:"flex items-center justify-between gap-2"},Ms={class:"rounded bg-surface-grey-light px-4 py-2 text-xs"},Bs={key:1,class:"flex"},Ns=["href"],Ts={class:"lg:col-span-1 lg:order-1"},$s={class:"sticky top-24 space-y-16"},Fs={class:"rounded-lg border border-border-light bg-white p-16 shadow-sm"},Vs={class:"space-y-8"},As={class:"flex justify-between"},zs={class:"font-medium capitalize"},Es={class:"flex justify-between"},Us={class:"font-medium"},Ds={key:0,class:"flex justify-between"},Os={class:"font-medium"},Hs={class:"flex justify-between"},Rs={class:"font-medium"},Ws={class:"flex justify-between"},Ys={class:"font-medium"},qs={class:"rounded-lg border border-border-light bg-white p-16 shadow-sm"},Gs={class:"space-y-8"},Js={class:"p-24"},Ks={class:"mb-16 flex items-center gap-16"},Qs={class:"flex h-40 w-40 items-center justify-center rounded-full bg-danger-subtle"},Xs={key:0,class:"mb-16 rounded-lg bg-warning-subtle p-12 text-sm"},Zs={key:0},st={class:"flex justify-end gap-8"},pt={__name:"Show",props:{post:Object,platformLabels:Object},setup(e){const m=e,_=N(!1);function v(){_.value=!0}function p(){_.value=!1}function S(){if(!m.post||!m.post.id){console.error("No post available for deleti
1on"),p();return}j.delete(route("social-media-posts.destroy",m.post.id),{onSuccess:()=>{j.visit(route("social-media-posts.index"))},onError:n=>{console.error("Error deleting post:",n),p(),alert("There was an error deleting the post. Please try again.")},preserveScroll:!0})}function y(n){return new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}function L(n){return typeof n!="string"||n.length<30?n:n.substring(0,15)+"..."+n.substring(n.length-5)}function M(n){return n.platforms.includes("instagram")||n.platforms.includes("tiktok")}function B(n){return n.content.includes("story")}return(n,t)=>(o(),k($,{title:"Social Media Post Details"},{default:a(()=>{var w;return[s("main",R,[s("div",W,[s("div",Y,[s("div",q,[r(P,{href:n.route("social-media-posts.index"),class:"flex items-center gap-2 text-text-secondary hover:text-primary",color:"transparent"},{default:a(()=>[r(I,{class:"h-12 w-12"}),t[0]||(t[0]=u(" Back to Posts "))]),_:1,__:[0]},8,["href"]),t[1]||(t[1]=s("span",{class:"mx-2"},"/",-1)),t[2]||(t[2]=s("span",null,"Post Details",-1))]),s("div",G,[t[4]||(t[4]=s("h1",{class:"fs-2xl font-bold"},"Post Details",-1)),r(x,{color:"danger",onClick:v,class:"flex items-center gap-2"},{default:a(()=>[r(b,{class:"h-12 w-12"}),t[3]||(t[3]=u(" Delete Post "))]),_:1,__:[3]})])]),s("div",J,[s("div",K,[s("div",Q,[s("div",X,[s("div",Z,[s("div",ss,[r(A,{class:"h-full w-full p-6 text-primary"})]),s("div",null,[t[5]||(t[5]=s("h3",{class:"font-medium"},"Your Post",-1)),s("p",ts,d(e.post.status==="scheduled"?"Scheduled for":"Posted on")+" "+d(y(e.post.scheduled_at||e.post.created_at)),1)])]),e.post.status==="scheduled"?(o(),i("div",es,[r(E,{class:"h-16 w-16 text-warning"}),t[6]||(t[6]=s("span",{class:"text-sm font-medium"},"This post is scheduled and will be published automatically at the scheduled time.",-1))])):c("",!0)]),s("div",os,[s("p",ls,d(e.post.content),1),e.post.media_urls&&e.post.media_urls.length>0?(o(),i("div",is,[e.post.media_urls.length===1?(o(),i("div",ns,[s("img",{src:e.post.media_urls[0],class:"max-h-320 max-w-full object-contain",alt:"Media"},null,8,rs)])):e.post.media_urls.length===2?(o(),i("div",ds,[(o(!0),i(h,null,g(e.post.media_urls,(l,f)=>(o(),i("div",{key:f,class:"h-180"},[s("img",{src:l,class:"h-full w-full object-cover",alt:"Media"},null,8,as)]))),128))])):e.post.media_urls.length===3?(o(),i("div",cs,[s("div",us,[s("img",{src:e.post.media_urls[0],class:"h-full w-full object-cover",alt:"Media"},null,8,ms)]),(o(!0),i(h,null,g(e.post.media_urls.slice(1,3),(l,f)=>(o(),i("div",{key:f,class:"h-140"},[s("img",{src:l,class:"h-full w-full object-cover",alt:"Media"},null,8,fs)]))),128))])):(o(),i("div",hs,[(o(!0),i(h,null,g(e.post.media_urls.slice(0,4),(l,f)=>(o(),i("div",{key:f,class:"h-140"},[s("img",{src:l,class:"h-full w-full object-cover",alt:"Media"},null,8,gs)]))),128)),e.post.media_urls.length>4?(o(),i("div",ps,[s("img",{src:e.post.media_urls[4],class:"h-full w-full object-cover brightness-50",alt:"Media"},null,8,xs),s("div",bs,[s("span",_s,"+"+d(e.post.media_urls.length-4)+" more",1)])])):c("",!0)]))])):c("",!0),s("div",ys,[(o(!0),i(h,null,g(e.post.platforms,l=>(o(),k(F,{key:l,class:"flex items-center gap-1"},{default:a(()=>[r(C,{platform:l,class:"h-12 w-12"},null,8,["platform"]),u(" "+d(e.platformLabels[l]||l),1)]),_:2},1024))),128))])])]),e.post.post_data&&e.post.post_data.postIds?(o(),i("div",vs,[t[8]||(t[8]=s("h2",{class:"mb-16 text-lg font-bold"},"Publishing Results",-1)),s("div",ws,[(o(!0),i(h,null,g(e.post.post_data.postIds,l=>(o(),i("div",{key:l.platform,class:"flex flex-col rounded-lg border border-border-light bg-white p-16 shadow-sm"},[s("div",ks,[s("div",js,[r(C,{platform:l.platform,class:"h-18 w-18"},null,8,["platform"])]),s("div",null,[s("h3",Ps,d(e.platformLabels[l.platform]||l.platform),1),s("div",Is,[s("span",{class:T(["inline-block h-8 w-8 rounded-full",l.status==="success"?"bg-success":"bg-danger"])},null,2),s("span",Cs,d(l.status),1)])])]),s("div",Ss,[l.id?(o(),i("div",Ls,[t[7]||(t[7]=s("span",{class:"font-medium"},"Post ID:",-1)),s("code",Ms,d(L(l.id)),1)])):c("",!0),l.postUrl?(o(),i("div",Bs,[s("a",{href:l.postUrl,target:"_blank",class:"flex w-full items-center justify-center gap-2 rounded-md bg-primary/10 px-8 py-4 text-primary transition hover:bg-primary/20"},[r(H,{class:"h-12 w-12"}),u(" View on "+d(e.platformLabels[l.platform]||l.platform),1)],8,Ns)])):c("",!0)])]))),128))])])):c("",!0)]),s("div",Ts,[s("div",$s,[s("div",Fs,[t[14]||(t[14]=s("h3",{class:"mb-12 font-medium"},"Post Information",-1)),s("div",Vs,[s("div",As,[t[9]||(t[9]=s("span",{class:"text-text-secondary"},"Status:",-1)),s("span",zs,d(e.post.status),1)]),s("div",Es,[t[10]||(t[10]=s("span",{class:"text-text-secondary"},"Created:",-1)),s("span",Us,d(y(e.post.created_at)),1)]),e.post.status==="scheduled"?(o(),i("div",Ds,[t[11]||(t[11]=s("span",{class:"text-text-secondary"},"Scheduled For:",-1)),s("span",Os,d(y(e.post.scheduled_at)),1)])):c("",!0),s("div",Hs,[t[12]||(t[12]=s("span",{class:"text-text-secondary"},"Platforms:",-1)),s("span",Rs,d(e.post.platforms.length),1)]),s("div",Ws,[t[13]||(t[13]=s("span",{class:"text-text-secondary"},"Media:",-1)),s("span",Ys,d(((w=e.post.media_urls)==null?void 0:w.length)||0),1)])])]),s("div",qs,[t[17]||(t[17]=s("h3",{class:"mb-12 font-medium"},"Actions",-1)),s("div",Gs,[r(P,{href:n.route("social-media-posts.index"),color:"secondary",class:"flex w-full items-center justify-center gap-2"},{default:a(()=>[r(I,{class:"h-12 w-12"}),t[15]||(t[15]=u(" Back to Posts "))]),_:1,__:[15]},8,["href"]),r(x,{color:"danger",onClick:v,class:"flex w-full items-center justify-center gap-2"},{default:a(()=>[r(b,{class:"h-12 w-12"}),t[16]||(t[16]=u(" Delete Post "))]),_:1,__:[16]})])])])])])])]),r(V,{show:_.value,onClose:p},{default:a(()=>[s("div",Js,[s("div",Ks,[s("div",Qs,[r(b,{class:"h-20 w-20 text-danger"})]),t[18]||(t[18]=s("h2",{class:"fs-xl font-bold"},"Delete Post",-1))]),t[23]||(t[23]=s("p",{class:"mb-8"},"Are you sure you want to delete this post? This action cannot be undone and will remove the post from your dashboard.",-1)),M(e.post)?(o(),i("div",Xs,[t[19]||(t[19]=s("p",{class:"font-medium"},"Platform Limitations:",-1)),t[20]||(t[20]=s("p",null,"Instagram and TikTok do n
1ot support deletion via API. For these platforms, you'll need to manually delete the post using their mobile apps.",-1)),B(e.post)?(o(),i("p",Zs,"Facebook image stories cannot be deleted via API and must be deleted manually from the Facebook app.")):c("",!0)])):c("",!0),s("div",st,[r(x,{color:"secondary",onClick:p},{default:a(()=>t[21]||(t[21]=[u("Cancel")])),_:1,__:[21]}),r(x,{color:"danger",onClick:S,class:"flex items-center gap-2"},{default:a(()=>[r(b,{class:"h-12 w-12"}),t[22]||(t[22]=u(" Delete Post "))]),_:1,__:[22]})])])]),_:1},8,["show"])]}),_:1}))}};export{pt 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.