1import Y from"./BVm8vNn8.js";import J from"./B3x5dYws.js";import{d as W,n as d,y as K,z as S,Q as P,R as X,c as l,e as a,b as h,a as k,i as V,E as Z,p as e,t as m,F as q,r as O,N as ee,_ as te,g as oe,o as r,v as se,A as ae,S as ne,f as G,j as re,B as ce,w as U,k as ie,U as le,u as Q,l as ue,V as de}from"./B1oIcqXS.js";import _e from"./BREqUqkR.js";import{c as me}from"./BBWbxyqV.js";import{u as pe}from"./B7iB0kyk.js";import"./Cj9yNu_v.js";import"./ByPox6v1.js";const he={class:"resource-open"},fe={class:"resource-open__hero"},ge={class:"resource-open__header"},ye={class:"resource-open__crumbs flex items-center"},ve={key:0,class:"resource-open__type"},ke={class:"resource-open__title"},we={key:0,class:"resource-open__subtitle"},be={class:"resource-open__meta flex items-center"},xe={key:0,class:"resource-open__author flex items-center"},Ce={key:1,class:"resource-open__avatar resource-open__avatar--initials"},Se={class:"resource-open__author-name"},Ae={class:"resource-open__main"},$e={class:"resource-open__aside"},Ie={class:"resource-open__toc"},Re={key:0,class:"resource-open__toc-title"},Le={key:1,class:"resource-open__toc-list"},De=["onClick"],Te={class:"resource-open__share flex"},Be=["href"],Ue={class:"resource-open__column"},Fe={key:1,class:"resource-open__byline flex items-center"},Ee={key:1,class:"resource-open__avatar resource-open__avatar--initials resource-open__avatar--large"},Me={class:"flex direction-column"},Ne={class:"resource-open__author-name"},je={key:0,class:"resource-open__related"},Ve={class:"resource-open__related-title"},qe={class:"resource-open__related-items"},Oe=W({__name:"Content",props:{data:{},encodeDataAttribute:{type:Function}},setup(n){const t=n,c=o=>(o?.children||[]).map(s=>s.text||"").join(""),y=d(()=>t.data.content||[]),A=d(()=>{const o=y.value[0];if(o?._type!=="block"||!/^h[1-4]$/.test(o.style||""))return"";const s=c(o).trim().toLowerCase(),_=(t.data.title||"").trim().toLowerCase();return _&&s.startsWith(_)?c(o):""}),u=d(()=>{const o=A.value.trim(),s=(t.data.title||"").trim();return o?s&&o.toLowerCase().startsWith(s.toLowerCase())?o.slice(s.length).replace(/^[\s:ââ-]+/,"").trim():o:""}),x=d(()=>(A.value?t.data.content?.slice(1):t.data.content)||[]),i=d(()=>{const o=y.value.reduce((s,_)=>s+c(_).split(/\s+/).filter(Boolean).length,0);return Math.max(1,Math.round(o/200))}),$=d(()=>new Date(t.data._createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})),I=d(()=>(t.data.author?.name||"").split(/\s+/).filter(Boolean).map(o=>o[0]).slice(0,2).join("").toUpperCase()),w=d(()=>t.data.resourceType?.name?.trim()||""),R=d(()=>t.data.related||[]),p=d(()=>x.value.filter(o=>o._type==="block"&&/^h[2-4]$/.test(o.style||"")).map(o=>c(o).trim()).filter(Boolean)),{$lenis:L}=K(),f=S(null),D=S(0);let g=null;const F=(o,s)=>`${o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"section"}-${s+1}`;function b(){return Array.from(f.value?.querySelectorAll("h2, h3, h4")||[])}function T(o){const s=b()[o];s&&(L?L.scrollTo(s,{offset:-120}):window.scrollTo({top:s.getBoundingClientRect().top+window.scrollY-120,behavior:"smooth"}))}P(()=>{const o=b();o.forEach((_,v)=>{_.id||=F(_.textContent||"",v)});let s=0;g=()=>{cancelAnimationFrame(s),s=requestAnimationFrame(()=>{let _=0;o.forEach((v,N)=>{v.getBoundingClientRect().top<=160&&(_=N)}),D.value=_})},window.addEventListener("scroll",g,{passive:!0}),g()}),X(()=>{g&&window.removeEventListener("scroll",g)});const C=S(!1);async function E(){try{await navigator.clipboard.writeText(window.location.href),C.value=!0,setTimeout(()=>C.value=!1,2e3)}catch{}}const M=d(()=>{const o=`${ne().public.siteUrl}/resources/${t.data.slug?.current||""}`;return`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(o)}`});return(o,s)=>{const _=ee,v=te,N=oe,H=_e;return r(),l("article",he,[a("div",fe,[a("header",ge,[a("div",ye,[V(_,{to:"/resources",class:"resource-open__back"},{default:Z(()=>[...s[0]||(s[0]=[se(" â Resources ",-1)])]),_:1}),e(w)?(r(),l("span",ve,m(e(w)),1)):h("",!0)]),a("h1",ke,m(n.data.title),1),e(u)?(r(),l("p",we,m(e(u)),1)):h("",!0),a("div",be,[n.data.author?(r(),l("span",xe,[
1n.data.author.image?(r(),k(v,{key:0,src:n.data.author.image.asset?._ref,width:80,height:80,quality:"100",alt:n.data.author.name||"",class:"resource-open__avatar"},null,8,["src","alt"])):(r(),l("span",Ce,m(e(I)),1)),a("span",Se,m(n.data.author.name),1)])):h("",!0),s[1]||(s[1]=a("span",{class:"resource-open__dot"},null,-1)),a("span",null,m(e($)),1),s[2]||(s[2]=a("span",{class:"resource-open__dot"},null,-1)),a("span",null,m(e(i))+" min read",1)])]),n.data.featuredImage?(r(),k(v,{key:0,src:n.data.featuredImage.asset?._ref,quality:"90",sizes:"100vw m:100vw ml:50vw xxl:700px",alt:n.data.title||"",class:"resource-open__image","data-sanity":n.encodeDataAttribute?n.encodeDataAttribute(["featuredImage"]):void 0},null,8,["src","alt","data-sanity"])):h("",!0)]),a("div",Ae,[a("aside",$e,[a("nav",Ie,[e(p).length?(r(),l("h2",Re," On this page ")):h("",!0),e(p).length?(r(),l("ol",Le,[(r(!0),l(q,null,O(e(p),(B,j)=>(r(),l("li",{key:j},[a("button",{type:"button",class:ae(["resource-open__toc-link",{"resource-open__toc-link--active":e(D)===j}]),onClick:Ye=>T(j)},m(B),11,De)]))),128))])):h("",!0),a("div",Te,[a("button",{type:"button",class:"resource-open__share-button",onClick:E},m(e(C)?"Link copied":"Copy link"),1),a("a",{href:e(M),target:"_blank",rel:"noopener",class:"resource-open__share-button"},"LinkedIn",8,Be)])])]),a("div",Ue,[e(x).length?(r(),l("div",{key:0,ref_key:"bodyRef",ref:f,class:"resource-open__body"},[V(N,{value:e(x),title:n.data.title||void 0,classes:"resource-open__content-items sanity-content-block--resource","data-sanity":n.encodeDataAttribute?n.encodeDataAttribute(["content"]):void 0},null,8,["value","title","data-sanity"])],512)):h("",!0),n.data.author?(r(),l("footer",Fe,[n.data.author.image?(r(),k(v,{key:0,src:n.data.author.image.asset?._ref,width:112,height:112,quality:"100",alt:n.data.author.name||"",class:"resource-open__avatar resource-open__avatar--large"},null,8,["src","alt"])):(r(),l("span",Ee,m(e(I)),1)),a("span",Me,[a("span",Ne,m(n.data.author.name),1),s[3]||(s[3]=a("span",{class:"resource-open__byline-org"},"Bettear",-1))])])):h("",!0)])]),e(R).length?(r(),l("section",je,[a("h2",Ve," More "+m(e(w)?`from the ${e(w).toLowerCase()}`:"resources"),1),a("div",qe,[(r(!0),l(q,null,O(e(R),B=>(r(),k(H,{key:B._id,card:B,"disable-case-study-styles":"",modifier:"resource-card--tile"},null,8,["card"]))),128))])])):h("",!0)])}}}),Qe=Object.assign(G(Oe,[["__scopeId","data-v-5c7a96e4"]]),{__name:"ResourceContent"}),ze=re(`*[_type == "resource" && slug.current == $slug][0] { 2 _id, 3 _type, 4 _createdAt, 5 _updatedAt, 6 _rev, 7 title, 8 slug, 9 description, 10 featuredImage, 11 author ->, 12 resourceType->, 13 content, 14 gated, 15 externalUrl, 16 file, 17 meta { 18 title, 19 description 20 }, 21 // Up to three more of the same type for the "More from ..." row 22 "related": *[_type == "resource" && resourceType._ref == ^.resourceType._ref && _id != ^._id && showInResources != false] | order(_createdAt desc)[0...3] { 23 _id, 24 _type, 25 title, 26 slug, 27 featuredImage, 28 resourceType->, 29 tags[]-> 30 } 31}`);function z(){if(typeof document>"u")return!1;const t=document.cookie.split("; ").find(y=>y.startsWith("gated_access_granted="));if(!t)return!1;const c=t.split("=").slice(1).join("=");return decodeURIComponent(c)==="true"}function We(){if(typeof document>"u")return null;const t=document.cookie.split("; ").find(y=>y.startsWith("gated_user_email="));if(!t)return null;const c=t.split("=").slice(1).join("=");return c?decodeURIComponent(c):null}const Pe={key:0,class:"resource"},Ge={class:"wrapper flex direction-column"},He=W({__name:"[slug]",async setup(n){let t,c;const A=ce().params.slug,{data:u,encodeDataAttribute:x}=([t,c]=U(()=>Q(ze,{slug:A})),t=await t,c(),t);if(!u.value)throw ie({statusCode:404,statusMessage:"Resource not found"});const i=u.value,$=i.externalUrl;$&&([t,c]=U(()=>de($,{external:!0})),await t,c());const{data:I}=([t,c]=U(()=>ue()),t=await t,c(),t),{data:w}=([t,c]=U(()=>Q(me)),t=await t,c(),t),R=d(()=>w.value?.consentMessage);pe(i?.meta,I,{title:i?.title,description:i?.description}),i&&le({title:i.title,description:i.description,featuredImage:i.featuredImage,author:i.author});const p=i.gated===!0,L=!p&&!!i.file?.asset&&!i.content?.length,f=S(p?z():!0),D=d(()=>p&&!f.value),g=S(!1);p&&P(()=>{if(f.value=z(),f.value&&i.slug?.current){const b=We();b&&$fetch("/api/mailchimp/contacts/resource-slug",{method:"POST",body:{email:b,resourceSlug:i.slug.current}}).catch(T=>{console.error("Failed to update contact with new resource slug:",T)})}});function F(){f.value=!0,g.value=!0}return(b,T)=>{const C=Y,E=J,M=Qe;return e(u)?(r(),l("section",Pe,[a("div",Ge,[p&&e(D)?(r(),k(C,{key:0,title:`Download ${e(u).title||""}`,description:e(u).description||void 0,"form-type":"gated","resource-slug":e(u).slug?.current||"","submit-button-label":"Download Now","checkbox-text":e(R)||void 0,onSuccess:F},null,8,["title","description","resource-slug","checkbox-text"])):p&&e(f)||e(L)?(r(),k(E,{key:1,"form-type":"gated",title:e(u).title||void 0,description:e(u).description||void 0,file:e(u).file||void 0,"show-thank-you":e(g)},null,8,["title","description","file","show-thank-you"])):(r(),k(M,{key:2,data:e(u),"encode-data-attribute":e(x)},null,8,["data","encode-data-attribute"]))])])):h("",!0)}}}),at=G(He,[["__scopeId","data-v-c06a904d"]]);export{at 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.