import e from"react";import"../../../node_modules/prop-types/index.js";import"../../../node_modules/react-redux/es/index.js";import r from"../../../node_modules/@loadable/component/dist/loadable.esm.js";import{p as t}from"../../../_virtual/index.js_commonjs-module";import{useDispatch as a}from"../../../node_modules/react-redux/es/hooks/useDispatch.js";import{useSelector as n}from"../../../node_modules/react-redux/es/hooks/useSelector.js";var d=r((function(){return import("./PrimaryHeader.js")})),i=r((function(){return import("./SecondaryHeader.js")})),o=r((function(){return import("./GenericHeader.js")})),s=r((function(){return import("./CondensedHeader.js")})),m=r((function(){return import("./SliderHeader.js")})),p=r((function(){return import("./LeadHeader.js")}));function c(r){var t=r.page,c=r.type,u=r.heroText,l=r.mediaUrl,x=r.mediaType,g=r.mediaHref,h=r.selectPageState,f=r.updateHeader,y=a(),H=n(h),_=function(e){var r,t;y(f(H,(r=e.properties.text,(t=document.createElement("DIV")).innerHTML=r,t.textContent||t.innerText||"")))},T=t.headerMarginTop,b=t.headerMarginRight,j=t.headerMarginBottom,v=t.headerMarginLeft,E=t.headerPaddingTop,k=t.headerPaddingRight,C=t.headerPaddingBottom,U=t.headerPaddingLeft;return e.createElement(e.Fragment,null,e.createElement("div",{className:"Header__media header-media"},function(r,a,n,c){switch(n&&!c&&(c="generic"),r){case"secondary":return e.createElement(i,{breadcrumb:t&&"news-and-events"===t.stack&&t.route.includes("articles"),onHeaderChange:_,heroText:a,mediaType:c,mediaHref:g,mediaUrl:n,type:c+"__"+r});case"primary":return e.createElement(d,{breadcrumb:t&&"news-and-events"===t.stack&&t.route.includes("articles"),onHeaderChange:_,heroText:a,mediaType:c,mediaHref:g,mediaUrl:n,type:c+"__"+r});case"generic":return e.createElement(o,{breadcrumb:t&&"news-and-events"===t.stack&&t.route.includes("articles"),onHeaderChange:_,heroText:a,mediaType:c,mediaHref:g,mediaUrl:n,type:c+"__"+r});case"condensed":return e.createElement(s,{breadcrumb:t&&"news-and-events"===t.stack&&t.route.includes("articles"),onHeaderChange:_,heroText:a,mediaType:c,mediaHref:g,mediaUrl:n,type:c+"__"+r});case"slider":return e.createElement(m,{breadcrumb:t&&"news-and-events"===t.stack&&t.route.includes("articles"),onHeaderChange:_,heroText:a,mediaType:c,mediaUrl:n,type:c+"__"+r});case"lead":return e.createElement(p,{breadcrumb:t&&"news-and-events"===t.stack&&t.route.includes("articles"),onHeaderChange:_,heroText:a,mediaType:c,mediaHref:g,mediaUrl:n,type:c+"__"+r})}}(c,u,l,x),e.createElement("style",{jsx:!0},"\n          .Header__media {\n            margin: "+(T||0)+"px "+(b||0)+"px "+(j||0)+"px\n              "+(v||0)+"px;\n            padding: "+(E||0)+"px "+(k||0)+"px "+(C||0)+"px\n              "+(U||0)+"px;\n          }\n\n          .header-media {\n            margin: "+(T||0)+"px "+(b||0)+"px "+(j||0)+"px\n              "+(v||0)+"px;\n            padding: "+(E||0)+"px "+(k||0)+"px "+(C||0)+"px\n              "+(U||0)+"px;\n          }\n        ")))}c.propTypes={page:t.exports.object,language:t.exports.string,type:t.exports.string,heroText:t.exports.string,mediaUrl:t.exports.arrayOf(t.exports.string),mediaType:t.exports.string,mediaHref:t.exports.string};export default c;
//# sourceMappingURL=HeaderMedia.js.map
