1import{an as P,u as d,Y as C,j as e,G as T,E as o,B as a,ba as N}from"./index-BA0BsjOr.js";import{u as R}from"./useDownloadCount-auZ-Ew2j.js";import{d as E}from"./constants-hP-4Inhf.js";import{D as j}from"./index-C7iW9-WC.js";import{R as I}from"./RelatedContent-BPeXS4i5.js";import{u as D}from"./useContentData-Bo2Q907_.js";import y from"./NotFound_page-CazPJo_k.js";import{E as S}from"./external-link-B7teK2Gg.js";import{D as p}from"./download-Cldfkuab.js";import"./index-DaZZWgfT.js";import"./tagsToHide-BZKeRTIn.js";import"./index-BNWj6iNr.js";import"./createPopper-DyNIyIE3.js";import"./align-justify-BXOy0p8A.js";import"./index-CEZKERY5.js";import"./index-DrOx-deL.js";import"./index-V4uFqD5k.js";import"./progress-BeK90hM2.js";import"./pencil-BLBHPdqU.js";import"./trash-2-DuWLB2PW.js";import"./link-BvVWrR6H.js";import"./index-vsE1k6dX.js";import"./ProfileLink-EaTQKgSI.js";import"./index-BPaObREG.js";import"./DetailedContentHeader-Dllk6yh-.js";import"./ResourceActions-BGkgj071.js";import"./contants-mUttiIdh.js";import"./ResourceFavoriteAction-DJ-y-f0R.js";import"./index-DHy8Y7dG.js";import"./iconBase-CrYX_Vfu.js";import"./index-CrbbVHHr.js";import"./chevron-right-BKqCYvOP.js";import"./ImageCreditTooltip-BjRHspuq.js";import"./constants-N7EXd0zj.js";import"./star-DeysrATc.js";import"./CardCardSkeleton-D_2UtIdb.js";import"./index-OKBWy7mt.js";import"./CardActions-CvX1o8cj.js";import"./DotsThreeOutline.es-Dvx4cPoy.js";import"./CardTagsList-CkqgyNSP.js";import"./arrow-right-DS-4PTaP.js";import"./carousel-CS5IN9Qf.js";import"./arrow-left-Bi13VI0q.js";import"./contentPreview-CqHcDn9J.js";import"./index-C5TkCOXa.js";import"./index-BDs7587F.js";import"./index-BAdnYGYz.js";const A=[o.BY_DEVELOPING_REGION,o.COUNTRYLIST,o.PROGRAMME_TYPE,o.SOCIAL_PROTECTION_TOPICS,o.SOCIAL_PROTECTION_APPROACHES,o.CROSS_CUTTING_AREAS,o.POPULATION_GROUPS,o.PUBLICATION_DOCUMENT_TYPE];function Et(){var i,n,l;const{slug:u}=P(),{searchResult:t,loadingSearchResult:f,contentNotFound:_}=D({baseUrl:"/publications",slug:u,isDetail:!0}),{t:s}=d("Publication"),{t:c}=d("SubmitContent"),{details:h}=t?C(t):{details:[]},{downloadCount:x,onDownLoad:O}=R(t==null?void 0:t.publication_file);if(_)return e.jsx(y,{});if(t===null||f)return e.jsx(T,{});const g=()=>{var r;(r=t==null?void 0:t.publication_file)!=null&&r.url&&(N.capture("file_download",{publication_title:t.title,publication_type:t.content_type,publication_url:window.location.href,file_url:t.publication_file.url},{transport:"sendBeacon",send_instantly:!0}),O())};return e.jsx(j,{data:t,breadcrumbPaths:[{label:s("publications"),link:"/publications"},{label:t==null?void 0:t.title}],downloadCount:x,headTags:((t==null?void 0:t.document_formats)??[]).map(r=>{var m;return c(((m=E.find(w=>w.value===r))==null?void 0:m.translatableKey)??"")}),image:(i=t==null?void 0:t.featured_image)==null?void 0:i.url,imageCredit:t==null?void 0:t.image_credit,imageOrientation:"Portrait",title:t==null?void 0:t.title,publishers:t==null?void 0:t.publishers,authors:t==null?void 0:t.authorships,details:h.filter(r=>r.key!=="postedOn"),description:(t==null?void 0:t.description)||(t==null?void 0:t.description_plain_text),tagTypesOrder:A,showConfigOptions:(t==null?void 0:t.submission_status)==="published",Actions:e.jsxs("div",{className:"flex w-full flex-col flex-wrap justify-start gap-3 sm:flex-row sm:justify-end",children:[t!=null&&t.publication_url?e.jsx("a",{href:t.publication_url??"",target:"_blank",rel:"noopener noreferrer",children:e.jsxs(a,{variant:"outlined",className:"border-tertiary text-tertiary w-full gap-1.5 text-sm sm:w-fit",size:"s",children:[e.jsx(S,{className:"h-4 w-4",strokeWidth:2}),s("goToWebsite")]})}):null,t!=null&&t.download_page?e.jsx("a",{href:t.download_page,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(a,{variant:"outlined",className:"border-tertiary text-tertiary w-full gap-1.5 text-sm sm:w-fit",size:"s",children:[e.jsx(p,{className:"h-4 w-4",strokeWidth:2}),s("externalDownload")]})}):null,(n=t==null?void 0:t.publication_file)!=null&&n.url?e.jsxs(a,{variant:"tertiary",className:"w-full gap-1.5 text-sm sm:w-fit",size:"s",onClick:g,children:[e.jsx(p,{className:"h-4 w-4 text-white",strokeWidth:2}),s("downloadContent")]}):null]}),RelatedContent:e.jsx(I,{title:s("relatedPublications"),fetchUrl:`/publications/${t.id}/related`,prioritizedTagIds:((l=t==null?void 0:t.tags)==null?void 0:l.map(r=>r.id))||[]})})}export{Et 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.