import{H as q,T as H}from"./Dm6BDzrP.js";import{a as G,u as O,b as Q,w as j,p as E,d as m,e as I,s as o,f as i,g as v,j as T,h as e,k as b,t as p,F as w,r as J,l as K,_ as R,o as r,i as z}from"./B7AXH1Se.js";import{f as M,a as U,r as S}from"./vfZIw7yJ.js";const X=d=>`{
    newsPosts(
      pagination: { limit: -1 }
      locale: "all"
      filters: { slug: { eq: "${d}" } }
    ) {
      data {
        attributes {
          locale
          title
          slug
          date
          previewImage {
            data {
              attributes {
                url
              }
            }
          }
          headerImage {
            ... on ComponentCoverFullWidthImage {
              __typename
              image {
                data {
                  attributes {
                    hash
                    ext
                  }
                }
              }
            }
            ... on ComponentCoverFiftyFifty {
              __typename
              text
              image {
                data {
                  attributes {
                    hash
                    ext
                  }
                }
              }
              fiftyFiftyCardColor: cardColor
              button {
                __typename
                displayText
                internalPath
              }
              imageOnLeft
              fiftyFiftyTextColor: textColor
              scrollButton {
                __typename
                showButton
              }
            }
          }
          content {
            ... on ComponentWidgetImage {
              __typename
              image {
                data {
                  attributes {
                    ext
                    hash
                  }
                }
              }
            }
            ... on ComponentWidgetText {
              __typename
              content: text
            }
            ... on ComponentWidgetVideo {
              __typename
              data
            }
          }
        }
      }
    }
  }`,Y={class:"flex flex-col items-center m-8 md:mx-24"},Z={class:"flex flex-col max-w-screen-2xl w-full text-center md:text-left"},tt={class:"text-gray-500 dark:text-gray-400"},et={class:"mt-2"},st={__name:"[slug]",async setup(d){var g;let l,u;const F=G(),L=O(),k=Q(),{slug:_}=F.params,B=([l,u]=j(()=>K(`post-${_}`,()=>k(X(_)))),l=await l,u(),l),f=E(B.data.value.data),a=m(()=>f.newsPosts.find(t=>t.locale===L.locale.value)||f.newsPosts.find(t=>t.locale==="en")),y=a.value.date.split("-").map(t=>parseInt(t));y[1]-=1;const D=new Date(...y),h=m(()=>{var t,n;return((n=(t=a.value)==null?void 0:t.headerImage)==null?void 0:n.at(0))||[]}),P=(g=a.value)==null?void 0:g.content.map(t=>(t.__typename==="ComponentWidgetVideo"&&typeof t.data=="string"&&(t.data=JSON.parse(t.data)),t)),C=m(()=>{var t,n;return(n=(t=a.value)==null?void 0:t.content)==null?void 0:n.at(-1)}),A=M(C),V=U(C);return(t,n)=>{var x;const W=H,N=q,$=R;return r(),I(w,null,[o("div",null,[i(N,null,{default:v(()=>[i(W,null,{default:v(()=>{var s;return[z(p((s=e(a))==null?void 0:s.title)+" | TASKA Prosthetics ",1)]}),_:1})]),_:1})]),(r(),T(b(("renderComponent"in t?t.renderComponent:e(S))(e(h).__typename)),{content:e(h)},null,8,["content"])),o("div",Y,[o("div",Z,[o("p",null,[o("small",tt,p(new Intl.DateTimeFormat().format(e(D))),1)]),o("h1",et,p((x=e(a))==null?void 0:x.title),1),(r(!0),I(w,null,J(e(P),(s,c)=>(r(),T(b(("renderComponent"in t?t.renderComponent:e(S))(s.__typename)),{key:c,content:s,componentId:c,id:c},null,8,["content","componentId","id"]))),128))])]),i($,{bgColor:`bg-${e(A)}`,fullScreenCardIsLast:e(V)},null,8,["bgColor","fullScreenCardIsLast"])],64)}}};export{st as default};
