https://sonyinteractive.com/content/themes/sie/assets/dist/sie-post-archive-list.js?ver=b8b539b4e038
1!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,s,i,a,r={exports:{}};r.exports=function(){if(a)return i;a=1;var e=s?t:(s=1,t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function r(){}function n(){}return n.resetWarningCache=r,i=function(){function t(t,s,i,a,r,n){if(n!==e){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function s(){return t}t.isRequired=t;var i={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:s,element:t,elementType:t,instanceOf:s,node:t,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:r};return i.PropTypes=i,i}}()();var n=e(r.exports);const{createRef:o,useState:c,useEffect:l}=window.wp.element,u=e=>{const{buttonLabel:t,children:s,buttonClass:i,ariaLabel:a}=e,r=o(null),n=o(null),[u,p]=c(!1),d=()=>{r.current.setAttribute("aria-expanded","false"),p(!1)};l((()=>{let e=null;if(n?.current){const t=()=>{u||(n.current.style.display="none")};return e=n.current,n.current.addEventListener("animationend",t),()=>{e&&e.removeEventListener("animationend",t)}}}),[n]),l((()=>(document.body.addEventListener("click",d),()=>document.body.removeEventListener("click",d))));const g="sie-dropdown sie-dropdown--"+(u?"show":"hide");return React.createElement("div",{className:g,onClick:e=>e.stopPropagation()},React.createElement("button",{ref:r,"aria-expanded":"false","aria-haspopup":"listbox","aria-label":void 0!==a?a:t,className:void 0!==i?i:"sie-dropdown__btn",onClick:()=>{!u&&n?.current?(n.current.style.display="block",r.current.setAttribute("aria-expanded","true")):r.current.setAttribute("aria-expanded","false"),p(!u)}},React.createElement("span",null,t)),React.createElement("div",{ref:n,className:"sie-dropdown__list",role:"listbox",onClick:e=>{e.currentTarget.contains(e.relatedTarget)||d()}},s))};u.propTypes={buttonLabel:n.string.isRequired,children:n.node.isRequired,buttonClass:n.string,ariaLabel:n.string};const p=window.wp,{__:d}=p.i18n;function g(e,t){const s=window?.siePluginLocalization?.filters??{};return d(s&&e in s?s[e]:t,"sie")}function m(e,t){return t||(t=0),[...Array(e+1).keys()].slice(t,e+1)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e},h.apply(this,arguments)}const y=window.wp,{Component:R,createRef:b,useEffect:w,useState:f}=y.element,E=e=>`${window.location.href.replace(/page\/[0-9]+\/?/,"").replace(/\/$/,"")}/page/${e}/`;const{_x:P}=window.wp.i18n;function v(e,t,s){const i=window?.siePluginLocalization?.postArchiveList??{};return P(i&&e in i?i[e]:t,s,"sie")}const{apiFetch:_}=window.wp,{addQueryArgs:q}=window.wp.url;function T(e){const{postsPerPage:t,postType:s,page:i,category:a,year:r,excludeFirstPost:n}={postsPerPage:4,postType:"post",page:1,category:"all",year:"",excludeFirstPost:!1,...e};return new Promise((e=>{_({path:q("/sie/posts",{categories:N(s)&&"all"!==a?a:void 0,page:i,per_page:t,post_type:s,year:"string"==typeof r&&""!==r?r:void 0,exclude_first_post:n??void 0}),parse:!1}).then((t=>{t.json().then((s=>{e({posts:s,totalPages:parseInt(t.headers.get("x-wp-totalpages"))})}))}))}))}function N(e){return"post"===e}const A=n.arrayOf(n.shape({height:n.number.isRequired,url:n.string.isRequired,width:n.number.isRequired})),x=n.shape({alt:n.string.isRequired,height:n.number.isRequired,is_empty:n.bool.isRequired,sizes:A.isRequired,url:n.string.isRequired,width:n.number.isRequired});function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e},L.apply(this,arguments)}const{SIEArchivePaginationLoader:S,SIEArchivePagination:O}=function(e){const t=()=>"function"==typeof window?.Sie?.isMobile&&window.Sie.isMobile(),s=t=>{const s=e("pageNumber","Page ","SIE Post Archive List - Pagination number"),i=t.atts.href?"a":"button";return React.createElement(i,t.atts,React.createElement("span",{className:"screen-reader-text"},s),t.page)};s.propTypes={atts:n.object.isRequired,page:n.number.isRequired};const i=e=>React.createElement(s,{atts:{className:"sie-pagination-btn sie-pagination-btn--clickable",href:E(e.page),onClick:t=>{e.setPage(t,e.page)}},page:e.page});i.propTypes={page:n.number.isRequired,setPage:n.func.isRequired};const a=e=>React.createElement(s,{atts:{className:"sie-pagination-btn sie-pagination-btn--selected",disabled:!0,"aria-current":"page"},page:e.page});a.propTypes={page:n.number.isRequired};const r=e=>React.createElement("button",{className:"sie-pagination-btn sie-pagination-btn--spacer",disabled:!0},e.children);
1r.propTypes={children:n.any};const o=t=>{const s={className:"sie-pagination-sequential-btn"};let i="div";t.selected?s.className+=" sie-pagination-sequential-btn--selected":(s.onClick=t.updater,s.href=t.href,i="a");const a=e("pageSequential"," page","SIE Post Archive List - Pagination sequential"),r=t.title.replace("%s",`<span class="screen-reader-text">${a}</span>`);return React.createElement("div",{className:`sie-pagination-sequential sie-pagination-sequential-${t.type}`},React.createElement(i,h({},s,{dangerouslySetInnerHTML:{__html:r}})))};o.propTypes={href:n.string.isRequired,selected:n.bool.isRequired,title:n.string.isRequired,type:n.string.isRequired,updater:n.func.isRequired};const c=t=>React.createElement(o,{href:E(t.page-1),selected:1===t.page,title:e("previous","Previous %s","SIE Post Archive List - Pagination"),type:"previous",updater:e=>{t.setPage(e,t.page-1)}});c.propTypes={page:n.number.isRequired,setPage:n.func.isRequired};const l=t=>React.createElement(o,{href:E(t.page+1),selected:t.page===t.numberOfPages,title:e("next","Next %s","SIE Post Archive List - Pagination"),type:"next",updater:e=>{t.setPage(e,t.page+1)}});l.propTypes={numberOfPages:n.number.isRequired,page:n.number.isRequired,setPage:n.func.isRequired};const u=e=>{const t=((e,t)=>{const s=[1];if(t<=7)for(let e=2;e<t;++e)s.push(e);else if(e<5){for(let e=2;e<=5&&e<t;++e)s.push(e);s.push("...")}else if(e>=t-3){s.push("...");for(let e=Math.max(2,t-4);e<t;++e)s.push(e)}else s.push("..."),s.push(e-1),s.push(e),s.push(e+1),s.push("...");return t>1&&s.push(t),s})(e.currentPage,e.numberOfPages);return React.createElement("ul",{className:"sie-pagination-numbers"},t.map((t=>React.createElement("li",{key:`sie-pagination-number-${t}`,className:"sie-pagination-item"},t!==e.currentPage&&"..."!==t&&React.createElement(i,{page:t,setPage:e.setPage}),t===e.currentPage&&React.createElement(a,{page:t}),"..."===t&&React.createElement(r,null,"...")))))};u.propTypes={currentPage:n.number.isRequired,numberOfPages:n.number.isRequired,setPage:n.func.isRequired};const p=e=>{const t=b(),[s,r]=f(!1),n=()=>{r(!1)};w((()=>{let e=null;if(t?.current){const i=()=>{s||(t.current.style.display="none")};return e=t.current,t.current.addEventListener("animationend",i),()=>{e&&e.removeEventListener("animationend",i)}}}),[t]),w((()=>(document.body.addEventListener("click",n),()=>document.body.removeEventListener("click",n))));let o="sie-pagination-dropdown-box sie-pagination-dropdown-box-"+(s?"show":"hide");return React.createElement("div",{className:"sie-pagination-dropdown"},React.createElement("div",{className:o,onClick:e=>e.stopPropagation()},React.createElement("button",{className:"sie-pagination-btn sie-pagination-btn--clickable sie-pagination-dropdown-btn",onClick:()=>{!s&&t?.current&&(t.current.style.display="block",t.current.scrollTop=36*(e.currentPage-1)),r(!s)}},e.currentPage),React.createElement("ul",{ref:t,className:"sie-pagination-dropdown-list",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||n()}},m(e.numberOfPages,1).map((t=>React.createElement("li",{key:`sie-pagination-number-${t}`,className:"sie-pagination-item"},t===e.currentPage&&React.createElement(a,{page:t}),t!==e.currentPage&&React.createElement(i,{page:t,setPage:e.setPage})))))),React.createElement("div",{className:"sie-pagination-dropdown-of"},"/ ",e.numberOfPages))};p.propTypes={currentPage:n.number.isRequired,numberOfPages:n.number.isRequired,setPage:n.func.isRequired};const d=()=>React.createElement("ul",{className:"sie-pagination-numbers"},m(5).map((e=>React.createElement("li",{key:`sie-pagination-number-${e}`,className:"sie-pagination-item"},React.createElement(r,null))))),g=()=>React.createElement("div",{className:"sie-pagination-dropdown"},React.createElement("div",{className:"sie-pagination-dropdown-box"},React.createElement("button",{className:"sie-pagination-btn sie-pagination-dropdown-btn sie-pagination-dropdown-btn--loading",disabled:!0},"Â ")),React.createElement("div",{className:"sie-pagination-dropdown-of"},"/ 0")),y=s=>{const[i,a]=f(window.innerWidth),{numberOfPages:r,page:n,setPage:o,show:d}=s;return w((()=>{const e=()=>a(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)})),d&&React.createElement(React.Fragment,null,React.createElement("h2",{className:"screen-reader-text"},e("pagination","Pagination","SIE Post Archive List - Pagination")),r>1&&React.createElement("div",{className:"sie-pagination"},React.createElement(c,{page:n,setPage:o}),t()&&React.createElement(p,{currentPage:n,numberOfPages:r,setPage:o}),!t()&&React.createElement(u,{currentPage:n,numberOfPages:r,setPage:o}),React.createElement(l,{numberOfPages:r,page:n,setPage:o})))};y.propTypes={numberOfPages:n.number.isRequired,page:n.number.isRequired,setPage:n.func.isRequired,show:n.bool.isRequired};const R=s=>{const[i,a]=f(window.innerWidth);return w((()=>{const e=()=>a(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)})),s.show&&React.createElement(React.Fragment,null,React.createElement("h2",{className:"screen-reader-text"},e("pagination","Pagination","SIE Post Archive List - Pagination")),React.createElement("div",{className:"sie-pagination"},React.createElement(c,{page:0,setPage:()=>{}}),t()&&React.createElement(g,null),!t()&&React.createElement(d,null),React.createElement(l,{numberOfPages:0,page:0,setPage:()=>{}})))};return R.propTypes={show:n.bool.isRequired},{SIEArchivePagination:y,SIEArchivePaginationLoader:R}}(v),k=window.wp,{useEffect:C,useRef:$,useState:z}=k.element,{apiFetch:j}=k,{addQueryArgs:I}=k.url,{speak:Y}=k.a11y,{sprintf:F}=k.i18n,W=1024,M=n.shape({id:n.string.isRequired,image:n.shape({height:n.number.isRequired,src:n.string.isRequired,width:n.number.isRequired}),slug:n.string.isRequired,title:n.string.isRequired}),H=n.shape({id:n.string.isRequired,slug:n.string.isRequired,title:n.string.isRequired}),B=n.shape({byline:n.string.isRequired,cats:n.arrayOf(M).isRequired,date:n.shape({display:n.string.isRequired}).isRequired,link:n.string.isRequired,media:x.isRequired,slug:n.string.isRequired,title:n.string.isRequired}),D=n.arrayOf(M),Q=(e,t,s)=>{const[i]=window.location.href.match(/(\/year\/([0-9]+))?(\/category\/([a-z]+))?(\/page\/([0-9]+))?\/?$/);let a=window.location.href.replace(new RegExp(`${i}$`),"");s&&(a+=`/year/${s}`),e&&"all"!==e?.id&&(a+=`/category/${e?.slug}`),a+=t&&t>1?`/page/${t}/`:"/",window.history.pushState(null,null,a)},U=({sizes:e})=>{const t=[],s=[];for(let i=0;i<e.length;i++){const a=e[i],{source_url:r,width:n}=a;t.push(i===e.length-1?`${n}px`:`(max-width: ${n}px) ${n}px`),s.push(`${r} ${n}w`)}return React.createElement("source",{media:"(max-width: 767px)",sizes:t.join(", "),srcSet:s.join(", ")})};U.propTypes={sizes:A.isRequired};const J=({sizes:e})=>{const t=[],s=[];for(let i=0;i<e.length;i++){const a=e[i],{source_url:r,width:n}=a;t.push(i===e.length-1?`${n}px`:`(max-width: ${2*n}px) ${n}px`),s.push(`${r} ${n}w`)}return React.createElement("source",{media:"(min-width: 768px) and (max-width: 1023px)",sizes:t.join(", "),srcSet:s.join(", ")})};J.propTypes={sizes:A.isRequired};const V=({sizes:e})=>{const t=[];let s=1;for(let i=0;i<e.length-1;i++){const a=e[i];if(a.width>424*s){const{source_url:e}=a;t.push(1===s?e:`${e} ${s}x`),s+=.5}}const{source_url:i}=e[e.length-1];return t.push(1===s?i:`${i} ${s}x`),React.createElement("source",{media:"(min-width: 1024px)",srcSet:t.join(", ")})};V.propTypes={sizes:A.isRequired};const G=e=>{const{media:t}=e,{alt:s,sizes:i}=t,a=Object.values(i).sort(((e,t)=>e.width-t.width)),{width:r}=a.length>0?a[0]:t,n=a.length>0?a[0].source_url:t.url;return React.createElement("picture",{className:"sie-post-archive-list__post-picture"},a.length>0&&React.createElement(U,{sizes:a}),a.length>0&&React.createElement(J,{sizes:a}),a.length>0&&React.createElement(V,{sizes:a}),React.createElement("img",{alt:s,className:"sie-post-archive-list__post-image",src:n,width:r}))};G.propTypes={media:x.isRequired};const K=e=>{const{firstLinkRef:t,index:s,isLink:i,minCatHeight:a,post:r,postType:n,showTags:o,updateNaturalCatHeight:c,windowWidth:l}=e,{cats:u,date:p,link:d,media:g,title:m}=r,h=r.byline.split(/[,ã]/).map((e=>e.trim())),y=v("bylineSeparator",", ","SIE Post Archive List - Separator");let R="sie-card-arrow__container sie-post-archive-list__post";o&&r.cats.length>0&&(R+=" sie-post-archive-list__post--has-cats");const b=$(null);C((()=>{!o||u.length<=0?c(0,s):b?.current&&c(b.current.offsetHeight,s)}),[l]);const w={};l>767&&a>0&&(w.minHeight=`${a}px`);const f=i?"a":"div",E={};return i&&(E.href=d),i&&0===s&&(E.ref=t),React.createElement("article",{className:R},React.createElement("div",{className:"sie-post-archive-list__post-content"},React.createElement("h2",{className:"sie-post-archive-list__post-title sie-style-h3"},React.createElement(f,L({className:"sie-post-archive-list__post-link"},E),m)),React.createElement("div",{className:"sie-post-archive-list__post-date sie-style-body-small-v2"},p.display),React.createElement("div",{className:"sie-post-archive-list__post-bylines"},React.createElement("div",{className:"sie-post-archive-list__post-byline-name"},h[0]),h.length>1&&React.createElement("div",{className:"sie-post-archive-list__post-byline-title sie-style-body-small"},h.slice(1).join(y))),"post"===n&&React.createElement("div",{className:"sie-post-archive-list__post-img-block"},React.createElement("figure",{className:"sie-post-archive-list__post-figure"},!g.is_empty&&React.createElement(G,{media:g}),g.is_empty&&React.createElement("div",{className:"sie-post-archive-list__post-image"})),React.createElement("div",{className:"sie-card-arrow sie-post-archive-list__post-arrow"})),o&&u.length>0&&React.createElement("div",{className:"sie-post-archive-list__post-cat-list-container",style:w},React.createElement("ul",{ref:b,className:"sie-post-archive-list__post-cat-list"},u.map(((e,t)=>React.createElement("li",{key:t,className:"sie-style-category sie-post-archive-list__post-cat-item post-category"},React.createElement("span",null,e.title))))))))};K.propTypes={firstLinkRef:n.object,index:n.number.isRequired,isLink:n.bool,minCatHeight:n.number.isRequired,post:B.isRequired,postType:n.string.isRequired,showTags:n.bool.isRequired,updateNaturalCatHeight:n.func.isRequired,windowWidth:n.number.isRequired};const X=e=>{const{category:t,className:s,excludeFirstPost:i,initPage:a,isLink:r,layoutStyle:n,postsPerPage:o,postType:c,setYear:l,showPagination:u,showTags:p,year:d}=e,[g,m]=z(!0),[h,y]=z(!1),[R,b]=z(a),[w,f]=z(e.posts),[E,P]=z(e.totalPages),[_,q]=z(Array(w.length).fill(null)),[A,x]=z(window.innerWidth),L=$(null),[k,j]=z(Array(w.length).fill(0)),I=(e,t)=>{q((s=>{const i=[...s];return i[t]=e,i}))},W=()=>{L.current&&(L.current.focus(),window.scrollTo(0,L.current.parentNode.parentNode.getBoundingClientRect().top+window.scrollY-90))},M=()=>Y(F(v("postsOfPage","%1$d posts for page %2$d %3$s %4$s","SIE Post Archive List - Screen reader"),w.length,R,t?.id&&"all"!==t?.id?F(v("ofCategory",'of category "%s"',"SIE Post Archive List - Screen reader"),t.title):"",d?F(v("ofYear","of year %s","SIE Post Archive List - Screen reader"),d):""));return C((()=>{const e=()=>{x(window.innerWidth),q(Array(w.length).fill(null))};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),C((()=>{g||(y(!0),b(1),Q(t,1,d),T({postsPerPage:o,postType:c,category:t.id,excludeFirstPost:i}).then((e=>{const{posts:t,totalPages:s}=e;f(t),P(s),y(!1),l(null),W(),M()})))}),[t,i,o,c]),C((()=>{g?m(!1):(y(!0),b(1),Q(t,1,d),T({postsPerPage:o,postType:c,category:t.id,year:d,excludeFirstPost:i}).then((e=>{const{posts:t,totalPages:s}=e;f(t),P(s),y(!1),W(),M()})))}),[d]),C((()=>
1{if(!w?.length)return;const e={"@context":"https://schema.org","@type":"ItemList","@id":`${window.location.href}#itemlist`,numberOfItems:w.length,itemListElement:w.map(((e,t)=>({"@type":"ListItem",position:t+1,url:e.link,name:e.title,image:e.media.url})))};document.querySelectorAll("script[data-yoast-itemlist]").forEach((e=>e.remove()));const t=document.createElement("script");t.type="application/ld+json",t.dataset.yoastItemlist="true",t.textContent=JSON.stringify(e),document.head.appendChild(t)}),[w]),C((()=>{const e=[...k];_.every((e=>null!==e))&&(w.forEach(((t,s)=>{"z-pattern"===n?w.length%2==0?s>=2&&(e[s]=s%2==0?Math.max(_[s],_[s+1]):Math.max(_[s-1],_[s])):s>=3&&(e[s]=s%2==0?Math.max(_[s-1],_[s]):Math.max(_[s],_[s+1])):e[s]=s%2==0?Math.max(_[s],_[s+1]):Math.max(_[s-1],_[s])})),j(e))}),[n,_,w]),React.createElement(React.Fragment,null,React.createElement("div",{className:s},w.map(((e,t)=>React.createElement(K,{key:t,firstLinkRef:0===t?L:null,index:t,isLink:r,minCatHeight:k[t],post:e,postType:c,showTags:N(c)&&p,updateNaturalCatHeight:I,windowWidth:A})))),u&&h&&React.createElement(S,{show:!0}),u&&!h&&React.createElement(O,{numberOfPages:E,page:R,setPage:(e,s)=>{e.preventDefault(),Q(t,s,d),b(s),y(!0),T({postsPerPage:o,postType:c,page:s,category:t?.id??null,year:d}).then((e=>{const{posts:t}=e;f(t),y(!1),W(),M()}))},show:!0}))};X.propTypes={category:H.isRequired,className:n.string.isRequired,excludeFirstPost:n.bool.isRequired,initPage:n.number.isRequired,isLink:n.bool,layoutStyle:n.string.isRequired,page:n.number.isRequired,posts:n.arrayOf(B).isRequired,postsPerPage:n.number.isRequired,postType:n.string.isRequired,setYear:n.func.isRequired,showPagination:n.bool.isRequired,showTags:n.bool.isRequired,totalPages:n.number.isRequired,year:n.string.isRequired};const Z=e=>{const{category:t,selected:s,setCategory:i}=e,a=`sie-btn__100--ghost\n\t\tsie-dropdown-item__btn\n\t\tsie-dropdown-item__btn-${t.slug}\n\t\t${s.id===t.id?"sie-dropdown-item__btn--selected":""}`;return React.createElement("li",{className:"sie-dropdown-item"},React.createElement("button",{className:a,"data-category-icon":t.slug,disabled:s.id===t.id,onClick:()=>{s.id!==t.id&&i(t)}},React.createElement("span",{className:"sie-dropdown__name"},t.title),t.image&&React.createElement("img",{alt:"",className:"sie-dropdown-item__icon",height:t.image.height,src:t.image.src,width:t.image.width})))};Z.propTypes={category:M.isRequired,selected:D.isRequired,setCategory:n.func.isRequired};const ee=e=>{const{categories:t,selected:s,setCategory:i}=e;return React.createElement("div",{className:"categories-filter__container"},React.createElement("ul",{className:"categories-filter__list"},t.map(((e,t)=>React.createElement(Z,{key:t,category:e,selected:s,setCategory:i})))))};ee.propTypes={categories:D.isRequired,selected:D.isRequired,setCategory:n.func.isRequired};const te=e=>{const{categories:t,selected:s,setCategory:i}=e;return React.createElement("div",{className:"sie-dropdown__container"},React.createElement("div",{className:"sie--dropdown__label"},v("filterTopics","Filter Topics:","SIE Post Archive List")),React.createElement(u,{buttonLabel:s.title},React.createElement("ul",{className:"sie-dropdown__category-list"},t.map(((e,t)=>React.createElement(Z,{key:t,category:e,selected:s,setCategory:i}))))))};te.propTypes={categories:D.isRequired,selected:D.isRequired,setCategory:n.func.isRequired};const se=e=>{const{action:t,title:s,selected:i}=e,a="year-filter__btn sie-style-body-small-v2 "+(i===s?"sie-dropdown-item__btn--selected":"");return React.createElement("li",{className:"sie-dropdown-item"},React.createElement("button",{"aria-pressed":i===s,className:a,disabled:i===s,onClick:t},s))};se.propTypes={action:n.func.isRequired,title:n.string.isRequired,selected:n.string};const ie=e=>{const{windowWidth:t}=e;return React.createElement(React.Fragment,null,t<W&&React.createElement(te,e),t>=W&&React.createElement(ee,e))};ie.propTypes={categories:D.isRequired,selected:D.isRequired,setCategory:n.func.isRequired,windowWidth:n.number.isRequired};const ae=e=>{const{category:t,postType:s,setYear:i,selectedYear:a}=e,[r,n]=z([]),o=g("allYears","All"),c=g("allFilterYears","All, filter years"),l=F(g("yearFilterYears","%1$s, filter years"),a),[p,d]=z(null==a?c:l);return C((()=>{j({path:I("/sie/years",{category:t.id,post_type:s})}).then((e=>{n(e?.years||[])}))}),[t,s]),React.createElement("div",{className:"year-filter"},React.createElement("div",null,g("filterYears","Filter Years:")),React.createElement(u,{ariaLabel:p,buttonClass:"action-btn action-btn__icon action-btn__icon--arrow",buttonLabel:null==a?o:a},React.createElement("ul",{className:"year-filter__list"},React.createElement(se,{action:()=>{i(null),d(c)},selected:null==a?o:"",title:o}),r.map(((e,t)=>React.createElement(se,{key:t,action:()=>{i(e),d(F(g("yearFilterYears","%1$s, filter years"),e))},selected:a,title:e}))))),React.createElement("h2",{className:"screen-reader-text"},null===a?"":`${a} `,v((e=>{switch(e){case"press-release":return"pressReleases";case"research-post":return"researchPosts";default:return"posts"}})(s),(e=>{switch(e){case"press-release":return"Press Releases";case"research-post":return"Research Posts";default:return"Posts"}})(s),"SIE Post Archive List - Year header")))};ae.propTypes={category:H.isRequired,postType:n.string.isRequired,setYear:n.func.isRequired,selectedYear:n.string};const re=e=>{const{categories:t,postType:s,selectedCategory:i,setCategory:a,setYear:r,showYearFilter:n,windowWidth:o,year:c}=e;let l="sie-post-archive__header";return t.length>0&&(l+=" sie-post-archive__header--has-cats"),n&&(l+=" sie-post-archive__header--has-years"),React.createElement("div",{className:"sie-post-archive__header-container"},React.createElement("div",{className:l},t.length>0&&React.createElement(ie,{categories:t,selected:i,setCategory:a,windowWidth:o}),n&&React.createElement(ae,{category:i,postType:s,selectedYear:c,setYear:r})))};re.propTypes={categories:D.isRequired,postType:n.string.isRequired,selectedCategory:H.isRequired,setCategory:n.func.isRequired,setYear:n.func.isRequired,showYearFilter:n.bool.isRequired,windowWidth:n.number.isRequired,year:n.string};const ne=e=>{const{categories:t,className:s,excludeFirstPost:i,initCategory:a,initYear:r,isLink:n,layoutStyle:o,page:c,posts:l,postsPerPage:u,postType:p,showPagination:d,showTags:g,showYearFilter:m,totalPages:h}=e,[y,R]=z(a),[b,w]=z(window.innerWidth),[f,E]=z(""===r?null:r);return C((()=>{const e=()=>{w(window.innerWidth)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),C((()=>{R(a)}),[a]),React.createElement("div",{className:"sie-post-archive__block"}
1,(m||t.length>0)&&React.createElement(re,{categories:t,postType:p,selectedCategory:y,setCategory:R,setYear:E,showYearFilter:m,windowWidth:b,year:f}),React.createElement(X,{category:y,className:s,excludeFirstPost:i,initPage:c,isLink:n,layoutStyle:o,posts:l,postsPerPage:u,postType:p,setYear:E,showPagination:d,showTags:g,totalPages:h,year:f}))};ne.propTypes={categories:D.isRequired,className:n.string.isRequired,excludeFirstPost:n.bool,initCategory:H.isRequired,initYear:n.string.isRequired,isLink:n.bool,layoutStyle:n.string.isRequired,page:n.number.isRequired,posts:n.arrayOf(B).isRequired,postsPerPage:n.number.isRequired,postType:n.string.isRequired,showPagination:n.bool.isRequired,showTags:n.bool.isRequired,showYearFilter:n.bool.isRequired,totalPages:n.number.isRequired};const{createRoot:oe}=window.wp.element,ce=Object.freeze({id:"all",slug:"all",title:v("allTopics","All Topics","SIE Post Archive List")}),le=e=>Object.freeze(Array.from(e.querySelectorAll(".sie-post-archive-list__post"))),ue=e=>e.querySelector(".sie-post-archive-list__post-link").innerText.trim(),pe=e=>Object.freeze({display:e.querySelector(".sie-post-archive-list__post-date").innerText.trim()}),de=e=>{const t=[],s=e.querySelector(".sie-post-archive-list__post-byline-name");s&&t.push(s.innerText.trim());const i=e.querySelector(".sie-post-archive-list__post-byline-title");return i&&t.push(i.innerText.trim()),t.join(", ")},ge=e=>{const t=e.querySelector('source[data-breakpoint="mobile"]');if(!t)return[];const s=t.getAttribute("srcset").split(",");return Object.freeze(s.map((e=>{const t=e.match(/^(.*) (\d+)w$/),s=t[1],i=parseInt(t[2]);return Object.freeze({source_url:s,width:i})})))},me=e=>{const t=e.querySelector(".sie-post-archive-list__post-image");return t?Object.freeze({alt:t.getAttribute("alt")??"",height:t.getAttribute("height")??0,is_empty:!t.hasAttribute("src"),sizes:ge(e),url:t.getAttribute("src")??"",width:t.getAttribute("width")??0}):Object.freeze({alt:"",height:0,is_empty:!0,sizes:[],url:"",width:0})},he=e=>e.querySelector(".sie-post-archive-list__post-link").getAttribute("href"),ye=e=>Array.from(Object.freeze(Array.from(e.querySelectorAll(".sie-post-archive-list__post-cat-item")).map((t=>({title:t.innerText.trim(),image:we(e)}))))),Re=e=>{const t=e.querySelector(".sie-dropdown-item__icon");return Object.freeze(t?{height:t.getAttribute("height"),src:t.getAttribute("src"),width:t.getAttribute("width")}:null)},be=(e,t)=>"press-release"===e?ce:{id:t.getAttribute("data-category-id")??"all",slug:t.getAttribute("data-category-icon")??"all",title:t.getAttribute("data-category-title")??v("allTopics","All Topics","SIE Post Archive List")},we=e=>{const t=e.querySelector(".sie-post-archive-list__post-term-image");return Object.freeze(t?{alt:t.getAttribute("alt"),height:t.getAttribute("height"),src:t.getAttribute("src"),srcSet:t.getAttribute("srcset"),url:t.getAttribute("src"),width:t.getAttribute("width")}:null)},fe=e=>e.getAttribute("data-post-slug");document.addEventListener("DOMContentLoaded",(()=>{Array.from(document.getElementsByClassName("sie-post-archive-list--raw")).forEach((e=>{e.classList.remove("sie-post-archive-list--raw");const t=(e=>Object.freeze(Array.from(e.getElementsByClassName("sie-dropdown-item__btn")).map((e=>({id:e.getAttribute("data-category"),image:Re(e),slug:e.getAttribute("data-category-icon"),title:e.innerText.trim()})))))(e),s=e.getAttribute("data-post-type"),i={categories:t,className:e.querySelector(".sie-post-archive-list").getAttribute("class"),excludeFirstPost:"true"===e.getAttribute("data-exclude-first-post"),initCategory:be(s,e),initYear:e.getAttribute("data-year"),isLink:!0,layoutStyle:e.getAttribute("data-layout-style"),page:parseInt(e.getAttribute("data-page")),posts:le(e).map((e=>({byline:de(e),cats:ye(e),date:pe(e),link:he(e),media:me(e),slug:fe(e),title:ue(e)}))),postsPerPage:parseInt(e.getAttribute("data-posts-per-page")),postType:s,showPagination:"true"===e.getAttribute("data-show-pagination"),showTags:"true"===e.getAttribute("data-show-tags"),showYearFilter:"true"===e.getAttribute("data-show-year-filter"),totalPages:parseInt(e.getAttribute("data-total-pages"))};oe(e).render(React.createElement(ne,i))}))}))}));
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.