import{r as P,u as H,R as r,C as B,A as O,F as X,B as D,L as j,E as G,a as R,G as q,J as z,j as V,K as F,O as J,P as K,Q as U}from"./index-DnDa_30t.js";import{R as Q,H as Y}from"./BlockContainer-CksxSEY6.js";import{H as Z}from"./Helmet-tDWpWdZ8.js";function v(w){var A,d,c,f,k,b;const[n,e]=P.useState(!1),{alert:s}=w,g=H();P.useEffect(()=>{const T=localStorage.getItem((s==null?void 0:s.title)+"dismissedAt");let x=!0;if(T){const a=Date.now()-new Date(T).getTime(),t=30*60*1e3;a<t&&(x=!1)}e(x)},[]);const y=()=>{e(!1),localStorage.setItem((s==null?void 0:s.title)+"dismissedAt",new Date().toISOString())};return!s||!s.active||!n?null:r.createElement(r.Fragment,null,s&&s.active&&n&&r.createElement(B,{as:O,color:g.colors.White,backgroundColor:g.colors.Blue150,minW:"100%",direction:{base:"column",md:"row"},justify:{base:"center",md:"space-between"},align:{base:"center",md:"center"}},r.createElement(B,{color:g.colors.White,backgroundColor:g.colors.Blue150,minW:"100%",as:X,flexDirection:"row",justifyContent:"space-between"},r.createElement(D,{minW:"100%",align:"center",paddingX:"32px",paddingY:"8px",maxWidth:"1200px"},r.createElement(D,{maxWidth:"1200px"},r.createElement(Q,{data:s.message,fontSize:"1rem",px:"0",mx:"0",display:"inline",addedClassName:"alertBanner"})," ",r.createElement(j,{href:(d=(A=s.url_path)==null?void 0:A.link)==null?void 0:d.href,target:(c=s.url_path)!=null&&c.new_window?"_blank":"_self",textDecoration:(f=s.url_path)!=null&&f.external?"underline":"none",fontWeight:"bold"},(b=(k=s.url_path)==null?void 0:k.link)==null?void 0:b.title))),r.createElement(D,{flexGrow:.03},r.createElement(G,{onClick:y})))))}function se(w){const e=R().pathname,{data:s,isError:g,failureReason:y,isLoading:A}=q(V.messageAlert);if(g)return console.error("Error loading message alert: ",(y==null?void 0:y.message)||"unknown reason"),null;const d=(c,f)=>f===z.homePage&&c==="Home page only"||f.startsWith(c)?!0:c==="All pages";return A||!s?null:r.createElement(D,{"data-testid":"allAlert"},s==null?void 0:s.map((c,f)=>d(c==null?void 0:c.page_path,e)&&r.createElement(D,{key:f},r.createElement(v,{alert:c}))))}const ee=["es","fr","pt","nl","en-us"];var S={exports:{}};(function(w){(function(n){if(typeof e!="function"){var e=function(a){return a};e.nonNative=!0}const s=e("plaintext"),g=e("html"),y=e("comment"),A=/<(\w*)>/g,d=/<\/?([^\s\/>]+)/;function c(a,t,E){a=a||"",t=t||[],E=E||"";let C=k(t,E);return b(a,C)}function f(a,t){a=a||[],t=t||"";let E=k(a,t);return function(p){return b(p||"",E)}}c.init_streaming_mode=f;function k(a,t){return a=T(a),{allowable_tags:a,tag_replacement:t,state:s,tag_buffer:"",depth:0,in_quote_char:""}}function b(a,t){if(typeof a!="string")throw new TypeError("'html' parameter must be a string");let E=t.allowable_tags,C=t.tag_replacement,p=t.state,o=t.tag_buffer,i=t.depth,m=t.in_quote_char,h="";for(let _=0,M=a.length;_<M;_++){let u=a[_];if(p===s)switch(u){case"<":p=g,o+=u;break;default:h+=u;break}else if(p===g)switch(u){case"<":if(m)break;i++;break;case">":if(m)break;if(i){i--;break}m="",p=s,o+=">",E.has(x(o))?h+=o:h+=C,o="";break;case'"':case"'":u===m?m="":m=m||u,o+=u;break;case"-":o==="<!-"&&(p=y),o+=u;break;case" ":case` `:if(o==="<"){p=s,h+="< ",o="";break}o+=u;break;default:o+=u;break}else if(p===y)switch(u){case">":o.slice(-2)=="--"&&(p=s),o="";break;default:o+=u;break}}return t.state=p,t.tag_buffer=o,t.depth=i,t.in_quote_char=m,h}function T(a){let t=new Set;if(typeof a=="string"){let E;for(;E=A.exec(a);)t.add(E[1])}else!e.nonNative&&typeof a[e.iterator]=="function"?t=new Set(a):typeof a.forEach=="function"&&a.forEach(t.add,t);return t}function x(a){let t=d.exec(a);return t?t[1].toLowerCase():null}w.exports?w.exports=c:n.striptags=c})(F)})(S);var te=S.exports;const I=J(te),$=160;function ie(w){var b,T,x,a,t,E,C,p,o;const{data:n,override:e,isArticle:s}=w,{l:g}=K();U();const y=()=>{const i=document.head,m=Array.from(i.childNodes),h=(l,W)=>{const L=l.name,N=W.name;return L==="description"&&N!=="description"?-1:N==="description"&&L!=="description"?1:0},_=m.filter(l=>l.nodeName==="META").sort(h),M=m.filter(l=>l.nodeName==="TITLE"),u=m.filter(l=>l.nodeName==="LINK");_.forEach(l=>i.removeChild(l)),M.forEach(l=>i.removeChild(l)),u.forEach(l=>i.removeChild(l)),u.forEach(l=>i.insertBefore(l,i.firstChild)),_.forEach(l=>i.insertBefore(l,i.firstChild)),M.forEach(l=>i.insertBefore(l,i.firstChild)),window&&(window.prerenderReady=!0)};P.useEffect(()=>{y()},[]);const A=i=>Y(i,"yyyy-MM-dd'T'HH:mm:ssXXX"),d=()=>{const i=n==null?void 0:n.meta_description;if(i)return i;if(e!=null&&e.article_body&&Array.isArray(e.article_body)){const m=e.article_body.map(h=>{var _;return((_=h==null?void 0:h.rte)==null?void 0:_.rich_text_editor)||(e==null?void 0:e.entry_summary)||""}).join(" ");return I(m).trim().slice(0,$)}return e!=null&&e.entry_summary?I(e.entry_summary).trim().slice(0,$):""},c=((b=n==null?void 0:n.meta_image)==null?void 0:b.url)||((T=e==null?void 0:e.main_image)==null?void 0:T.url)||((a=(x=e==null?void 0:e.headline_banner)==null?void 0:x.image)==null?void 0:a.url),f=(n==null?void 0:n.meta_page_title)||(e==null?void 0:e.title),k=P.useMemo(()=>{var h,_;const[i]=((h=e==null?void 0:e.article_details)==null?void 0:h.author)||[""],m=d();return{"@context":"https://schema.org","@type":"NewsArticle",headline:((_=e==null?void 0:e.article_details)==null?void 0:_.headline)||f,description:m,url:window.location.origin+e.url,image:c,datePublished:e==null?void 0:e.created_at,dateModified:e==null?void 0:e.updated_at,author:{"@type":"Person",name:(i==null?void 0:i.name)||"IAPP Staff"},publisher:{"@type":"Organization",name:"IAPP"}}},[n,e,c,f,d]);return r.createElement(Z,null,r.createElement("title",null,`${f} | IAPP`),r.createElement("meta",{name:"description",content:d(),"data-rh":"true"}),((t=e==null?void 0:e.publish_details)==null?void 0:t.time)&&r.createElement("meta",{"http-equiv":"last-modified",content:A((E=e==null?void 0:e.publish_details)==null?void 0:E.time)}),r.createElement("link",{rel:"canonical",href:`${n==null?void 0:n.canonical_url}`||`https://iapp.org${e==null?void 0:e.url}`}),r.createElement("meta",{property:"og:title",content:`${n==null?void 0:n.meta_page_title}`||`${(C=e==null?void 0:e.article_details)==null?void 0:C.headline}`}),r.createElement("meta",{property:"og:description",content:d()}),c&&r.createElement("meta",{property:"og:image",content:c}),r.createElement("meta",{property:"og:type",content:"article"}),r.createElement("meta",{property:"og:url",content:`${n==null?void 0:n.canonical_url}`||`https://iapp.org${e==null?void 0:e.url}`}),r.createElement("meta",{property:"og:locale",content:g&&ee.includes(g)?`${g}`:"en_US"}),r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("meta",{name:"twitter:site",content:"@IAPP"}),r.createElement("meta",{name:"twitter:title",content:`${f}`}),r.createElement("meta",{name:"twitter:description",content:`${n==null?void 0:n.meta_description}`||`${e==null?void 0:e.news_blurb}`}),r.createElement("meta",{name:"twitter:image",content:((p=n==null?void 0:n.meta_image)==null?void 0:p.url)||((o=e==null?void 0:e.main_image)==null?void 0:o.url)}),r.createElement("meta",null),s&&r.createElement("script",{type:"application/ld+json"},JSON.stringify(k)))}export{se as A,ie as M};