import{u as W,R as e,B as w,F as r,H as F,T as d,r as s,L as D,I as _,k as H,j as u,t as I,n as P,i as B,S as L}from"./index-BWYuRdqs.js";import{M as z,A as N}from"./Metadata-C9vJTAZv.js";import{n as C,o as $,q as G,r as M,s as U,t as A,W as J,v as T,P as q,w as V,R as Y,x as Q,T as K,S as X,k as Z,b as ee,y as te}from"./BlockContainer-CCUp_6io.js";import{L as ne,A as re}from"./AdBanner-CplCnsiW.js";import"./Helmet-GxQ5C0qj.js";import"./index.esm-DRw6x0jZ.js";function ae(t){const{data:n}=t,a=W();return e.createElement(w,{as:r,flexDirection:"column",justifyContent:"center",alignContent:"center",backgroundColor:"#4D4D4D",h:"255px",wrap:"wrap"},e.createElement(w,{my:10,mx:{lg:60,md:20,base:5},as:r,flexDirection:"column",justifyContent:"center",alignContent:"center",textAlign:"center",maxW:"826px"},e.createElement(F,{as:"h1",fontWeight:"700",fontSize:{base:"25px",md:"32px",lg:"40px"},lineHeight:{base:"74px",md:"74px",lg:"74px"},color:a.colors.White},n==null?void 0:n.headline),e.createElement(d,{fontWeight:"400",fontSize:{base:"16px",md:"20px",lg:"22px"},lineHeight:{base:"22px",md:"27px",lg:"30px"},color:a.colors.White},n==null?void 0:n.sub_text)))}const R=t=>{if(isNaN(t))return;const n={Jan:"Jan.",Feb:"Feb.",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"Aug.",Sep:"Sept.",Oct:"Oct.",Nov:"Nov.",Dec:"Dec."},a=(()=>{const o=new Date(t*1e3);return o.getFullYear()>1e4?new Date(t):o})().toUTCString().split(" ");return a.length>3?`${a[1]-0} ${n[a[2]]} ${a[3]}`:a.join(" ")},oe=({result:t})=>{var l;const[n,a]=s.useState(),o=W();return s.useEffect(()=>{t&&a(R(t.published_dtm))},[t]),t?e.createElement(r,{key:t.objectID,as:D,href:t.uri,border:`solid 1px ${o.colors.Grey70}`,p:"8px",justify:"space-between",borderRadius:"24px",w:{base:"100%",lg:"48.5%"},_hover:{textDecor:"none",boxShadow:"0px 24px 34px 0px rgba(0,0,0,0.07)"},role:"group",mb:"16px"},e.createElement(r,{direction:"column",gap:"8px",flex:1,m:"8px",justify:"center",textOverflow:"ellipsis"},e.createElement(r,{direction:"row",gap:"8px",flexWrap:"wrap"},t.category==="news_article"&&e.createElement(w,{color:o.colors.Green130,borderColor:o.colors.Green130,border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"16px"},e.createElement(d,{letterSpacing:".035em",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem"},"IAPP ORIGINAL")),((l=t.tags)==null?void 0:l.includes("internal_class=analysis"))&&e.createElement(w,{color:`${o.colors.Blue130}`,borderColor:`${o.colors.Blue130}`,border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"12px"},e.createElement(d,{letterSpacing:"3.5%",fontWeight:"600",fontSize:"14px",lineHeight:"1.188rem",fontFamily:"Open Sans, semi-bold"},"ANALYSIS"))),e.createElement(d,{color:"#4D4D4D",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem",letterSpacing:".08em"},n),e.createElement(r,{textOverflow:"ellipsis"},e.createElement(d,{fontWeight:"600",fontSize:"1rem",lineHeight:"1.688rem",_groupHover:{textDecor:"underline"},noOfLines:3},t.name))),e.createElement(r,{h:"auto",flex:1,maxWidth:{lg:"160px",md:"160px",sm:"130px",base:"160px"}},t.category==="news_article"&&e.createElement(_,{alt:t.name,src:t.imageUri,fallbackSrc:C,fit:"cover",borderRadius:"0 16px 16px 0"}),t.category==="news_blurb"&&e.createElement(_,{alt:t.name,src:t.imageUri,fallbackSrc:C,fit:"cover",borderRadius:"0 15px 15px 0"}))):null},ie=({result:t})=>{const{published_dtm:n}=t||{},a=s.useMemo(()=>R(n),[n]),{gated:o,type:l,original:c}=s.useMemo(()=>{const p=g=>(t.tags||[]).includes(g);return{gated:p("internal_class=member_gated"),type:p("internal_class=resource_article")?"Resource Article":void 0,original:p("internal_class=iapp_original")}},[t==null?void 0:t.tags]),m=W(),[x]=$(l);return t?e.createElement(r,{key:t.objectID,as:D,href:t.uri,border:`solid 1px ${m.colors.Grey30}`,p:"8px",justify:"space-between",borderRadius:"20px",w:{base:"100%",lg:"48.5%"},h:"174px",_hover:{textDecor:"none",boxShadow:"0px 24px 34px 0px rgba(0,0,0,0.07)"},role:"group",mb:{base:"20px",md:"16px",lg:"2%"},position:"relative"},o&&e.createElement(r,{position:"absolute",boxSize:"35px",justify:"center",align:"center",right:"8px",bgColor:"WhiteOpaque"},e.createElement(H,{faIcon:"fa-lock",color:"PrimaryGreen"})),e.createElement(r,{direction:"column",gap:"16px",flex:1,m:"8px",justify:"start"},e.createElement(r,{gap:".02em",flexWrap:"wrap",whiteSpace:"nowrap"},l&&e.createElement(r,{gap:"10px",mr:"10px",ml:"-16px",align:"center"},e.createElement(w,{w:"15px",h:"24px",bgColor:x}),e.createElement(d,{fontFamily:"Lato",fontWeight:"700",fontSize:".875rem",lineHeight:"1.05rem"},l)),c&&e.createElement(r,{whiteSpace:"nowrap",flex:1,maxW:"min-content",color:m.colors.Green130,borderColor:m.colors.Green130,border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"16px"},e.createElement(d,{letterSpacing:".035em",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem"},"IAPP ORIGINAL"))),a&&e.createElement(d,{color:"#4D4D4D",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem",letterSpacing:".08em"},a),e.createElement(d,{fontWeight:"600",fontSize:"1rem",lineHeight:"1.688rem",_groupHover:{textDecor:"underline"},noOfLines:a?2:3,textOverflow:"ellipsis"},t.name)),e.createElement(r,{h:"100%",flex:.75,maxW:"25%",borderRadius:"0 15px 15px 0"},t.category==="news_article"&&e.createElement(_,{src:t.imageUri,fallbackSrc:C,fit:"cover",borderRadius:"0 15px 15px 0"}))):null},le=()=>(s.useEffect(()=>{document.querySelectorAll(".rc-pagination-item").forEach(n=>{n.setAttribute("title","")})}),null),ce=({ct:t})=>e.createElement(r,{gap:{md:"2.5%"},w:"100%",className:"non-overview-container"},t===u.newsOverview&&e.createElement(r,{maxW:{base:"100%",md:"29%",lg:"22.5%"},flex:{base:0,md:1}}),e.createElement(V,null)),se=({ct:t,tags:n,setTags:a,filters:o})=>t=="news_overview"||!o?e.createElement(e.Fragment,null):e.createElement(r,{display:{base:"none",md:"flex"},w:"100%",className:"non-overview-container"},e.createElement(A,{type:"entity",ct:t,tags:n,setTags:a,filters:o})),me=({cta:t,ct:n})=>n!==u.newsOverview?e.createElement(e.Fragment,null):e.createElement(r,{border:t?"solid 1px #999999":"none",borderRadius:"20px",py:"27px",px:{base:"22px",lg:"38px"},maxW:{base:"100%",md:"29%",lg:"22.5%"},mt:"30px"},e.createElement(Y,{fontSize:{base:".875rem",md:"1rem",lg:"1.125rem"},lineHeight:"1.563rem",letterSpacing:"-.02em",data:t,style:["card"],px:"initial"})),pe=({ct:t,filters:n,setTags:a,tags:o,sortfilters:l,dates:c,setDates:m,sort:x,setSort:p,index:g})=>{const i=(n==null?void 0:n.filter(b=>b!=="sections"))??[];return e.createElement(r,{h:"auto",align:"center",flex:1,direction:{base:"column",md:"row"},className:"non-overview-container",width:"100%"},e.createElement(r,{flex:1,maxW:{md:"30%"},minW:{base:"100%",md:"initial"},align:"center",justify:"space-between",width:"100%",my:"25px"}," ",n&&e.createElement(A,{setTags:a,tags:o,type:"mobile",ct:t,filters:i,display:{base:"flex",md:"none"}}),(l==null?void 0:l.length)>0&&e.createElement(Q,{index:g,sort:x,setSort:p,sortFilters:l})),n&&e.createElement(r,{gap:"29px",flex:2,direction:{base:"row-reverse",md:"row"},w:{base:"100%",md:"auto"},align:"center"},e.createElement(K,{dates:c,tags:o,setTags:a,setDates:m})))};function de({cta:t,index:n,ct:a,filters:o,prefilter:l,sortfilters:c}){const[m,x]=s.useState([]),[p,g]=s.useState(),[i,b]=s.useState([]),[S,v]=s.useState(!0);s.useEffect(()=>{const f=setTimeout(()=>{v(!1)},500);return()=>clearTimeout(f)},[]);const E=(o==null?void 0:o.filter(f=>f!=="sections"))??[],h="https://search.iapp.org",y={debug:!1,alwaysSearchOnInitialLoad:!0,apiConnector:new G(h,n,{prefilter:l}),initialState:{resultsPerPage:16},searchQuery:{search_fields:{name:{weight:3}},filters:[]},result_fields:{name:{snippet:{size:100,fallback:!0}}}},j={ct:a,filters:o,setTags:x,tags:m,sortfilters:c,dates:i,setDates:b,sort:p,setSort:g,index:n};return e.createElement(M,{config:y},e.createElement(r,{direction:"column",pl:"42px",pr:"50px",className:["search-container",a].join(" ")},e.createElement(r,{direction:"column",mx:"auto",w:"100%",maxW:"1440px",gap:"30px"},e.createElement(r,{justifyContent:{base:"center",md:"space-between"},direction:{base:"column",md:"row"}},e.createElement(me,{cta:t,ct:a}),e.createElement(r,{direction:"column",width:"100%"},e.createElement(ce,{ct:a}),e.createElement(se,{ct:a,tags:m,setTags:x,filters:o}),e.createElement(r,{pl:{md:"2.5%"},direction:{base:"column",md:"row"},gap:"2.5%",w:"100%"},e.createElement(pe,j)))),e.createElement(r,{gap:{md:"2.5%"},direction:{base:"column",md:"row"},maxW:a!==u.newsOverview&&"980px",mx:a!==u.newsOverview&&"auto"},a===u.newsOverview&&e.createElement(r,{direction:"column",maxW:{md:"29%",lg:"22.5%"},minH:{md:"1000px"},gap:"37px",flex:1,visibility:{base:"hidden",md:"visible"}},e.createElement(r,{h:"100%",direction:"column",display:{base:"none",md:"initial"}},e.createElement(r,{p:"16px",border:"solid #00000010 1px"},e.createElement(U,{dates:i,setDates:b})),e.createElement(A,{type:"desktop",ct:a,tags:m,setTags:x,filters:E}))),e.createElement(r,{direction:"column",flex:1},e.createElement(r,{direction:"column"},e.createElement(r,{minH:"30px",h:"132%",direction:"column"},e.createElement(J,{mapContextToProps:({totalResults:f})=>({totalResults:f})},f=>{const{totalResults:O}=f;return S?e.createElement("div",null,"Loading..."):O>0?e.createElement(r,{as:T,columnGap:{base:"20px",md:"16px",lg:"2%"},flexWrap:"wrap",resultView:a===u.newsOverview?oe:ie,titleField:"name",h:"inherit"}):e.createElement(r,{justifyContent:"center"},e.createElement(d,null,"No results found"))})),e.createElement(r,{py:{base:"36px",lg:"100px"},justify:"center"},e.createElement(q,null),e.createElement(le,null))))),e.createElement(r,{py:{base:"36px",lg:"100px"},justify:"center",visibility:{lg:"hidden"}}))))}function xe(){const[t,n]=s.useState();function a(o,l,c){o===u.resourceOverview&&n('["category:resource_entry","tags:internal_class=resource_article"]'),o===u.newsOverview&&n('["category:news_article","category:news_blurb"]'),!t&&l&&c&&n(`"tags:${encodeURIComponent(l)}=${encodeURIComponent(c)}"`)}return[t,a]}function we({ct:t,parent:n}){var S,v;const a=window.location.pathname,[o,l]=xe(),{data:c,isLoading:m,isError:x,failureReason:p,isSuccess:g}=t!=null&&t.includes("overview")?I(t||"news_overview","leaderboard"):P(t,a,"leaderboard");if(s.useEffect(()=>{var E;g&&l(t,n==="subjects"?"subject":n,(E=c[0])==null?void 0:E.title)},[c]),m)return e.createElement(B,null);if(x)throw new Error("Error loading SearchPage: ",(p==null?void 0:p.message)||"unknown reason");const i=c[0];function b(E){const h=[];return E.split("-").map(y=>{h.push(y[0].toUpperCase()+y.slice(1))}),h.join(" ")}return e.createElement("main",{id:"main"},e.createElement(L,null),i&&e.createElement("div",null,i.seo&&e.createElement(z,{data:i.seo,override:i}),e.createElement(N,null),n&&e.createElement(ne,{data:{title:`All ${b(n)}`,href:`/resources/${n}`}}),i.banner&&e.createElement(ae,{data:i.banner}),i.section_hero_banner&&e.createElement(X,{data:i.section_hero_banner[0]}),((S=i.interior_section_header)==null?void 0:S.length)>0&&e.createElement(Z,{data:i.interior_section_header[0]}),i.page_content&&e.createElement(ee,{data:i.page_content}),((v=i.leaderboard)==null?void 0:v.length)>0&&e.createElement(r,{m:"23px auto 0",px:{base:"16px",md:"32px",lg:"60px"},flex:1},e.createElement(re,{data:i.leaderboard})),e.createElement(de,{cta:i.call_to_action,index:t,prefilter:o,filters:i.search_filters,ct:t,sortfilters:te(i)})))}export{we as default};