@apolitical/component-library 1.1.0-beta.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,8 @@ export interface IUserDetails {
6
6
  thumbnail?: string;
7
7
  };
8
8
  }
9
- export interface IUserContext {
9
+ export interface IUserContext extends IUserDetails {
10
10
  isLoading: boolean;
11
- details: IUserDetails | null;
12
11
  }
13
12
  declare const _default: import("react").Context<IUserContext | null>;
14
13
  export default _default;
package/index.js CHANGED
@@ -157,4 +157,4 @@ Unable to find an `+(n===!1?"accessible ":"")+'element with the role "'+t+'"'+l+
157
157
  * Copyright(c) 2012-2014 Roman Shtylman
158
158
  * Copyright(c) 2015 Douglas Christopher Wilson
159
159
  * MIT Licensed
160
- */var gb=yD,bm=bD,vD=Object.prototype.toString,_a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function yD(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");for(var r={},n=t||{},a=n.decode||gD,o=0;o<e.length;){var i=e.indexOf("=",o);if(i===-1)break;var s=e.indexOf(";",o);if(s===-1)s=e.length;else if(s<i){o=e.lastIndexOf(";",i-1)+1;continue}var l=e.slice(o,i).trim();if(r[l]===void 0){var u=e.slice(i+1,s).trim();u.charCodeAt(0)===34&&(u=u.slice(1,-1)),r[l]=xD(u,a)}o=s+1}return r}function bD(e,t,r){var n=r||{},a=n.encode||ED;if(typeof a!="function")throw new TypeError("option encode is invalid");if(!_a.test(e))throw new TypeError("argument name is invalid");var o=a(t);if(o&&!_a.test(o))throw new TypeError("argument val is invalid");var i=e+"="+o;if(n.maxAge!=null){var s=n.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");i+="; Max-Age="+Math.floor(s)}if(n.domain){if(!_a.test(n.domain))throw new TypeError("option domain is invalid");i+="; Domain="+n.domain}if(n.path){if(!_a.test(n.path))throw new TypeError("option path is invalid");i+="; Path="+n.path}if(n.expires){var l=n.expires;if(!_D(l)||isNaN(l.valueOf()))throw new TypeError("option expires is invalid");i+="; Expires="+l.toUTCString()}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.priority){var u=typeof n.priority=="string"?n.priority.toLowerCase():n.priority;switch(u){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(n.sameSite){var c=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite;switch(c){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return i}function gD(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function ED(e){return encodeURIComponent(e)}function _D(e){return vD.call(e)==="[object Date]"||e instanceof Date}function xD(e,t){try{return t(e)}catch{return e}}function wD(){return typeof document=="object"&&typeof document.cookie=="string"}function CD(e){return typeof e=="string"?gb(e):typeof e=="object"&&e!==null?e:{}}function xu(e,t={}){const r=TD(e);if(!t.doNotParse)try{return JSON.parse(r)}catch{}return e}function TD(e){return e&&e[0]==="j"&&e[1]===":"?e.substr(2):e}class Eb{constructor(t,r={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const a=this.cookies;this.cookies=gb(document.cookie),this._checkChanges(a)};const n=typeof document>"u"?"":document.cookie;this.cookies=CD(t||n),this.defaultSetOptions=r,this.HAS_DOCUMENT_COOKIE=wD()}_emitChange(t){for(let r=0;r<this.changeListeners.length;++r)this.changeListeners[r](t)}_checkChanges(t){new Set(Object.keys(t).concat(Object.keys(this.cookies))).forEach(n=>{t[n]!==this.cookies[n]&&this._emitChange({name:n,value:xu(t[n])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(t,r={}){return r.doNotUpdate||this.update(),xu(this.cookies[t],r)}getAll(t={}){t.doNotUpdate||this.update();const r={};for(let n in this.cookies)r[n]=xu(this.cookies[n],t);return r}set(t,r,n){n?n=Object.assign(Object.assign({},this.defaultSetOptions),n):n=this.defaultSetOptions;const a=typeof r=="string"?r:JSON.stringify(r);this.cookies=Object.assign(Object.assign({},this.cookies),{[t]:a}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=bm(t,a,n)),this._emitChange({name:t,value:r,options:n})}remove(t,r){const n=r=Object.assign(Object.assign({},r),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[t],this.HAS_DOCUMENT_COOKIE&&(document.cookie=bm(t,"",n)),this._emitChange({name:t,value:void 0,options:r})}addChangeListener(t){this.changeListeners.push(t),this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(t){const r=this.changeListeners.indexOf(t);r>=0&&this.changeListeners.splice(r,1),this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}const _b=_e.createContext(new Eb),{Provider:SD,Consumer:zL}=_b;class RD extends _e.Component{constructor(t){super(t),t.cookies?this.cookies=t.cookies:this.cookies=new Eb(void 0,t.defaultSetOptions)}render(){return _e.createElement(SD,{value:this.cookies},this.props.children)}}function PD(){return typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"}function AD(e){const t=j.useContext(_b);if(!t)throw new Error("Missing <CookiesProvider>");const[r,n]=j.useState(()=>t.getAll());PD()&&j.useLayoutEffect(()=>{function s(){const l=t.getAll({doNotUpdate:!0});OD(e||null,l,r)&&n(l)}return t.addChangeListener(s),()=>{t.removeChangeListener(s)}},[t,r]);const a=j.useMemo(()=>t.set.bind(t),[t]),o=j.useMemo(()=>t.remove.bind(t),[t]),i=j.useMemo(()=>t.update.bind(t),[t]);return[r,a,o,i]}function OD(e,t,r){if(!e)return!0;for(let n of e)if(t[n]!==r[n])return!0;return!1}const wu="cookieBanner_",Cu=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Tu=new Date(Date.now()+12*30*24*60*60*1e3),MD=()=>{const e=Me(),[t,r,n]=AD(Cu),[a,o]=j.useState(!t["apol-cookie-banner"]),i=()=>{Cu.forEach(u=>{r(u,!0,{path:"/",expires:Tu,domain:u==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),o(!1),window.location.reload()},s=()=>{r("apol-cookie-banner",!0,{path:"/",expires:Tu}),Cu.forEach(u=>{if(u==="apol-cookie-banner"){r(u,!0,{path:"/",expires:Tu});return}n(u)}),o(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:i,gtmType:"accepted-all"}];return E.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[E.jsx("h6",{children:e.formatMessage({id:`${wu}title`})}),E.jsx("p",{children:e.formatMessage({id:`${wu}text`})}),E.jsx("ul",{className:"button-wrapper",children:l.map(({id:u,onClick:c=!1,href:f=!1,gtmType:m})=>E.jsx("li",{children:E.jsx(Ct,{variant:f?"tertiary":"primary",href:f,onClick:c,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${m}-click`,children:e.formatMessage({id:`${wu}buttons_${u}`})})},u))})]})},xb=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(MD,{...t})});const ID=({options:e,allOption:t=!1,allowMultiple:r=!0,onChange:n=()=>{},className:a=""})=>{const o=Me(),i=t?[{id:"all",text:typeof t!="boolean"&&t.text||o.formatMessage({id:"filters_all"})},...e]:e,[s,l]=j.useState(t?["all"]:[]),u=(c,f)=>{let m=[];s.includes(c)?m=s.filter(d=>d!==c):c==="all"?m=["all"]:r?m=[...s.filter(d=>d!=="all"),c]:m=[c],l(d=>(n&&typeof n=="function"&&n({current:m,previous:d}),m)),f&&typeof f=="function"&&f()};return E.jsx("ul",{className:Q("filters",a),children:i.map(({id:c,text:f,disabled:m=!1,callback:d=()=>{}})=>{let y={};return m&&(y={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:f})}),E.jsx("li",{children:E.jsx("button",{className:Q(c,{selected:s.includes(c)}),onClick:v=>{v.preventDefault(),v.stopPropagation(),u(c,d)},...y,children:f})},c)})})},$D=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(ID,{...t})});const Su=Hu({locale:"en",messages:yh}),kD=({page:e=1,length:t=0,limit:r=10,loadNextPage:n=()=>{},icon:a=!1,messages:o={button:Su.formatMessage({id:"loadMore_button"}),endOfFeed:Su.formatMessage({id:"loadMore_endOfFeed"}),error:Su.formatMessage({id:"loadMore_error"})},className:i="",gtmContext:s="LoadMore"})=>{const[l,u]=j.useState(!1),[c,f]=j.useState(!1);if(t<=0||t<r*e)return null;const m=async d=>{try{await n(d)}catch(y){y instanceof Error&&y.message&&y.message.includes("Cannot read items")?f(!0):u(!0)}};return E.jsxs("footer",{className:Q("load-more",i),children:[l&&E.jsx("p",{className:"error",children:o.error}),c?E.jsx("p",{children:o.endOfFeed}):E.jsx(Ct,{variant:"secondary",icon:a,onClick:m,"data-gtm-event-context":s,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button})]})},ND=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(kD,{...t})});const qD=({variant:e="default",version:t="default",className:r="",...n})=>E.jsx("p",{className:"logo-wrapper",children:E.jsx("a",{className:Q("logo",e,t,r),href:"/home/",...n,children:E.jsx(Ye,{children:E.jsx(Sr,{id:"apolitical"})})})}),xd=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(qD,{...t})}),gm={default:"tags_",headerTopics:"header_topics_topics_"},Ru={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},BD={getTagDetails:e=>{if(e.includes("topic_")){if(e=Ru.topic[e.replace("topic_","")],e){const t=Un.topics.topics[e].href;return t?{id:e,href:t,text:`${gm.headerTopics}${e}`}:null}return null}return Ru[e]?(e=Ru[e],{id:e,text:`${gm.default}${e}`}):null}};const jD=({tags:e=[],color:t="default",forceOneLine:r=!1,canHaveLinks:n=!0,className:a="",gtmType:o="tag-click",gtmContext:i="tags"})=>{const s=Me();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=BD.getTagDetails(u);c&&l.push(c)}),l.length<1?null:E.jsx("ul",{className:Q("tags text-small",t,a,{"one-line":r}),children:l.map(u=>{const c=s.formatMessage({id:u.text});return E.jsx("li",{children:u.href&&n?E.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":o,"data-gtm-event-context":i,children:c}):c},u.id)})})},DD=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(jD,{...t})}),Lt={platform:{order:["events","courses","qanda","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},qanda:{href:"/questions-answers/",gtmType:"q-and-a-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["story","team","careers","partner","contact"],story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:"dpo@apolitical.co",gtmType:"email-dpo-link"},euDataProtection:{email:"dpo.agl@apolitical.foundation",gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:"concierge@apolitical.co",gtmType:"concierge-email-click"},business:{email:"hello@apolitical.co",gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const en="footer_",oo="SiteFooter",Em=({group:e})=>{const t=Lt[e].order||[];let r=!1;return"text"in Lt[e]&&(r=Lt[e].text),E.jsxs(j.Fragment,{children:[E.jsx("p",{className:"pre-title",children:E.jsx(Sr,{id:`${en}${e}`})}),Array.isArray(t)&&t.length>0&&E.jsx("ul",{className:"text-medium",children:t.map(n=>{if(["order","child","text"].includes(n))return null;const{href:a,gtmType:o}=Lt[e][n],i={};return["legal"].includes(e)&&(i.target="_blank",i.rel="noopener"),E.jsx("li",{children:E.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":oo,"data-gtm-event-type":o,...i,children:E.jsx(Sr,{id:`${en}${e}_${n}`})})},`${e}_${n}`)})}),typeof r!="boolean"&&"order"in r&&Array.isArray(r.order)&&E.jsx("dl",{className:"text-medium",children:r.order.map(n=>E.jsxs(j.Fragment,{children:[E.jsx("dt",{children:E.jsx(Sr,{id:`${en}${e}_${n}`})}),E.jsxs("dd",{children:[typeof r!="boolean"&&r[n].address&&E.jsx("address",{children:E.jsx(Sr,{id:`${en}${e}_${n}_address`,values:{br:E.jsx("br",{})}})}),typeof r!="boolean"&&r[n].email&&E.jsx("a",{href:`mailto:${r[n].email}`,className:"gtm-trackable","data-gtm-event-context":oo,"data-gtm-event-type":r[n].gtmType,children:r[n].email})]})]},`dl-${e}-${n}`))})]},e)},LD=()=>E.jsx("div",{id:"footer",children:E.jsxs("div",{className:"wrapper",children:[E.jsx(Nc,{element:"hr"}),E.jsx(xd,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":oo,"data-gtm-event-type":"logo-homepage-link"}),E.jsx("footer",{children:["platform","community","company","contact"].map(e=>E.jsxs("div",{className:"group",children:[E.jsx(Em,{group:e}),Object.keys(Lt[e]).includes("child")&&E.jsx(Em,{group:Lt[e].child})]},e))}),E.jsx("hr",{}),E.jsxs("div",{className:"sub-footer",children:[E.jsx("ul",{children:Array.isArray(Lt.social.order)&&Lt.social.order.map(e=>{const t=Lt.social[e];return E.jsx("li",{className:e,children:E.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":oo,"data-gtm-event-type":"social-click",children:E.jsx("span",{className:"hidden",children:E.jsx(Sr,{id:`${en}social_${e}`})})})},e)})}),E.jsx("small",{children:E.jsx(Sr,{id:`${en}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),wd=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(LD,{...t})}),wb=e=>{const t=e&&e.toUpperCase().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},xa=["#5AB6A3","#A2D7AF","#806056","#3962B3"],FD=e=>{const t=Math.ceil(26/xa.length),r=wb(e).toLowerCase();if(r==="")return xa[0];const n=r.charCodeAt(0)-96;for(let a=0;a<xa.length;a++)if(n<=t*(a+1))return xa[a]};const wa=256,Cb=({className:e="",src:t="",name:r,alt:n,...a})=>{const[o,i]=j.useState(!1),s=j.useRef(null);return j.useEffect(()=>{const l=s.current;if(!l)return;const u=l.getContext("2d");if(!u)return;const c=wa,f=wa;typeof window<"u"&&window.devicePixelRatio&&(l.width=c*window.devicePixelRatio,l.height=f*window.devicePixelRatio,u.scale(window.devicePixelRatio,window.devicePixelRatio)),u.fillStyle=FD(r),u.fillRect(0,0,c,f),u.font=`${c/3}px Arial`,u.textAlign="center",u.fillStyle="white",u.fillText(wb(r),c/2,f/1.6)},[r]),E.jsxs("figure",{className:Q("profile-picture",e,{error:o}),...a,children:[t!==""&&!o&&E.jsx("img",{src:t,alt:n||r,onError:()=>{i(!0)},width:wa,height:wa}),(t===""||o)&&E.jsx("canvas",{ref:s})]})};var HD="Expected a function",Tb="__lodash_hash_undefined__",Sb=1/0,UD="[object Function]",GD="[object GeneratorFunction]",WD="[object Symbol]",VD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zD=/^\w*$/,XD=/^\./,YD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,KD=/[\\^$.*+?()[\]{}|]/g,ZD=/\\(\\)?/g,JD=/^\[object .+?Constructor\]$/,QD=typeof Ve=="object"&&Ve&&Ve.Object===Object&&Ve,eL=typeof self=="object"&&self&&self.Object===Object&&self,Cd=QD||eL||Function("return this")();function tL(e,t){return e==null?void 0:e[t]}function rL(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var nL=Array.prototype,aL=Function.prototype,Rb=Object.prototype,Pu=Cd["__core-js_shared__"],_m=function(){var e=/[^.]+$/.exec(Pu&&Pu.keys&&Pu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Pb=aL.toString,Td=Rb.hasOwnProperty,Ab=Rb.toString,oL=RegExp("^"+Pb.call(Td).replace(KD,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xm=Cd.Symbol,iL=nL.splice,lL=Ob(Cd,"Map"),Hn=Ob(Object,"create"),wm=xm?xm.prototype:void 0,Cm=wm?wm.toString:void 0;function $r(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function sL(){this.__data__=Hn?Hn(null):{}}function uL(e){return this.has(e)&&delete this.__data__[e]}function cL(e){var t=this.__data__;if(Hn){var r=t[e];return r===Tb?void 0:r}return Td.call(t,e)?t[e]:void 0}function dL(e){var t=this.__data__;return Hn?t[e]!==void 0:Td.call(t,e)}function fL(e,t){var r=this.__data__;return r[e]=Hn&&t===void 0?Tb:t,this}$r.prototype.clear=sL;$r.prototype.delete=uL;$r.prototype.get=cL;$r.prototype.has=dL;$r.prototype.set=fL;function hn(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function pL(){this.__data__=[]}function mL(e){var t=this.__data__,r=rs(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():iL.call(t,r,1),!0}function hL(e){var t=this.__data__,r=rs(t,e);return r<0?void 0:t[r][1]}function vL(e){return rs(this.__data__,e)>-1}function yL(e,t){var r=this.__data__,n=rs(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}hn.prototype.clear=pL;hn.prototype.delete=mL;hn.prototype.get=hL;hn.prototype.has=vL;hn.prototype.set=yL;function Hr(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function bL(){this.__data__={hash:new $r,map:new(lL||hn),string:new $r}}function gL(e){return ns(this,e).delete(e)}function EL(e){return ns(this,e).get(e)}function _L(e){return ns(this,e).has(e)}function xL(e,t){return ns(this,e).set(e,t),this}Hr.prototype.clear=bL;Hr.prototype.delete=gL;Hr.prototype.get=EL;Hr.prototype.has=_L;Hr.prototype.set=xL;function rs(e,t){for(var r=e.length;r--;)if($L(e[r][0],t))return r;return-1}function wL(e,t){t=RL(t,e)?[t]:SL(t);for(var r=0,n=t.length;e!=null&&r<n;)e=e[ML(t[r++])];return r&&r==n?e:void 0}function CL(e){if(!Ib(e)||AL(e))return!1;var t=kL(e)||rL(e)?oL:JD;return t.test(IL(e))}function TL(e){if(typeof e=="string")return e;if(Rd(e))return Cm?Cm.call(e):"";var t=e+"";return t=="0"&&1/e==-Sb?"-0":t}function SL(e){return Mb(e)?e:OL(e)}function ns(e,t){var r=e.__data__;return PL(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Ob(e,t){var r=tL(e,t);return CL(r)?r:void 0}function RL(e,t){if(Mb(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Rd(e)?!0:zD.test(e)||!VD.test(e)||t!=null&&e in Object(t)}function PL(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function AL(e){return!!_m&&_m in e}var OL=Sd(function(e){e=qL(e);var t=[];return XD.test(e)&&t.push(""),e.replace(YD,function(r,n,a,o){t.push(a?o.replace(ZD,"$1"):n||r)}),t});function ML(e){if(typeof e=="string"||Rd(e))return e;var t=e+"";return t=="0"&&1/e==-Sb?"-0":t}function IL(e){if(e!=null){try{return Pb.call(e)}catch{}try{return e+""}catch{}}return""}function Sd(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(HD);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],o=r.cache;if(o.has(a))return o.get(a);var i=e.apply(this,n);return r.cache=o.set(a,i),i};return r.cache=new(Sd.Cache||Hr),r}Sd.Cache=Hr;function $L(e,t){return e===t||e!==e&&t!==t}var Mb=Array.isArray;function kL(e){var t=Ib(e)?Ab.call(e):"";return t==UD||t==GD}function Ib(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function NL(e){return!!e&&typeof e=="object"}function Rd(e){return typeof e=="symbol"||NL(e)&&Ab.call(e)==WD}function qL(e){return e==null?"":TL(e)}function BL(e,t,r){var n=e==null?void 0:wL(e,t);return n===void 0?r:n}var jL=BL;const $b=Gn(jL),fe={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const r={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},n=o=>{const i=`logged${e?"In":"Out"}`;return t>=r[o][i]};let a={};return["navigation","search"].forEach(o=>{a[o]=n(o)}),a},shouldChangeHeaderIsVisible:(e,t,r)=>{Object.values(t).filter(a=>a===!0).length||r([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:r,dispatch:n})=>{if(r[e]===t||e==="account"&&t===!1&&r.navigation===!0)return;const a=Date.now();if(!t&&fe.handlerCalled[e]&&a-fe.handlerCalled[e]<500)return;fe.handlerCalled[e]=a;let o=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(r).forEach(i=>{i===e||r[i]===!1||o.push({type:`menus.${i}`,value:!1})}),n(o)},findFirstChild:(e,t,r=!1)=>{if(!e||!e[0])return!1;for(let n=0;n<=e.length;n++){if(!e[n])continue;if(e[n][t]&&(!r||e[n][t].includes(r)))return e[n];if(!t.includes("."))continue;const a=$b(e[n],t);if(!(typeof a>"u")&&(!r||a[t]&&a[t].includes(r)||a.value&&a.value.includes(r)||a.toString().includes(r)))return e[n]}return e[0].children?fe.findFirstChild(e[0].children,t,r):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:r,focusElements:n,dispatch:a})=>{if(!t.current||!t.current.children)return;const o=r?"desktop":"default";if(n[e][o]){n[e][o].focus();return}let i,s;switch(e){case"navigation":if(r){const l=fe.findFirstChild(t.current.children,"attributes.aria-controls","navigation");i=fe.findFirstChild(l.children,"href")}else i=fe.findFirstChild(t.current.children,"href");i||(i=t.current);break;case"account":if(s=fe.findFirstChild(t.current.children,"className","account"),!s||!s.children)return;i=fe.findFirstChild(s.children,"href");break;default:return}i&&(a([{type:`focusElements.${e}.${o}`,value:i}]),i.focus())},events:{onClick:(e,{id:t,callback:r,isOpen:n})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(fe.timeouts[t]),r(t,!n))},onFocus:({id:e})=>{clearTimeout(fe.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(fe.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{fe.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Un={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","q-and-a","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},"q-and-a":{href:"/questions-answers/",className:"icon q-and-a"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},io=({id:e,isLoggedIn:t=!1,isDesktopVersion:r=!1,menus:n={},callback:a=()=>{},doTrack:o=null})=>{const i=Me(),s=$b(Un,e);if(!s||s.onlyShow&&(s.onlyShow==="logged-in"&&!t||s.onlyShow==="logged-out"&&t))return null;const l="doTrack"in s,u=o===null?l?s.doTrack:!0:o,c=e.includes("buttons.");let f=`header_${e.replaceAll(".","_")}`;s.hasVariantText&&(f+=`_logged${t?"In":"Out"}`);let m=!1;if(s.href){let _=s.gtmType||`${e}-click`;if(_.includes(".")){const C=_.split("."),R=C[C.length-2];_=`${R==="topics"?`${R}-`:""}${C[C.length-1]}`}m={href:s.href,role:"menuitem"},u&&(m={...m,className:"gtm-trackable","data-gtm-event-type":_,"data-gtm-event-context":"HeaderButtons"}),c&&(m={...m,variant:"secondary",size:{mobile:"small",881:"large"},...s.props||{}})}const d=s.order&&s.order[0]&&s[s.order[0]],y=d&&s[s.order[0]].order,v=m&&typeof window<"u"&&window.location&&window.location.pathname===s.href;let S={},h={};if(d){const _=s.menuId||e,C={onClick:R=>fe.events.onClick(R,{id:_,callback:a,isOpen:n[_]}),onFocus:()=>fe.events.onFocus({id:_}),onBlur:()=>fe.events.onBlur({id:_,callback:a}),onMouseLeave:()=>fe.events.onBlur({id:_,callback:a}),onMouseEnter:()=>fe.events.onMouseEnter({id:_,callback:a})};r&&(y&&(S={...C,onKeyPress:R=>{R.key==="Enter"&&fe.events.onClick(R,{id:_,callback:a,isOpen:n[_]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":n[_],"aria-controls":_}),h={hidden:_ in n?!n[_]:!0}),y||(h={...h,...C})}return E.jsxs("li",{className:Q({[s.className]:s.className,"has-submenu":d,parent:y,active:v}),role:"none",...S,children:[m?j.createElement(c?Ct:"a",m,i.formatMessage({id:f})):i.formatMessage({id:f}),s.order&&E.jsx("ul",{...h,children:s.order.map(_=>{if(!s[_])return null;const C={isLoggedIn:t,isDesktopVersion:r,menus:n,callback:a,doTrack:l?u:null};return s[_].order?E.jsxs("li",{className:Q({[s[_].className]:s[_].className}),children:[i.formatMessage({id:`${f}_${_}`}),E.jsx("ul",{children:s[_].order.map(R=>E.jsx(io,{id:`${e}.${_}.${R}`,...C},R))})]},_):E.jsx(io,{id:`${e}.${_}`,...C},_)})})]},e)};const DL={height:67,height_desktop:83},LL=()=>{const e=Me(),t=j.useContext(bd),r=lo(!0,!0),n=t&&t.details&&typeof t.details.id=="string",a=j.useMemo(()=>fe.getIsDesktopVersion(n,r),[n,r]),[o,i]=j.useReducer(nE,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:s,menus:l,focusElements:u}=o;Pm({scrollPosition:DL[`height${a.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!a&&l.navigation||fe.shouldChangeHeaderIsVisible(!0,l,i)},scrollDown:()=>{!a&&l.navigation||fe.shouldChangeHeaderIsVisible(!1,l,i)}}});const c=(m,d)=>{fe.handleMenus({id:m,value:d,menus:l,dispatch:i})},f=j.useRef(null);return Na(()=>{l.navigation&&fe.autoFocus({menu:"navigation",navigationRef:f,isDesktopVersion:a.navigation,focusElements:u,dispatch:i})},[l.navigation]),Na(()=>{l.account&&fe.autoFocus({menu:"account",navigationRef:f,isDesktopVersion:a.navigation,focusElements:u,dispatch:i})},[l.account]),t&&t.isLoading?null:E.jsxs(E.Fragment,{children:[E.jsxs("nav",{id:"header",className:Q({"logged-in":n,"logged-out":!n,visible:s}),children:[E.jsx(Ye,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),E.jsx(xd,{}),!a.navigation&&E.jsx("button",{className:"menu-button gtm-trackable",onClick:m=>{m.preventDefault(),m.stopPropagation(),c("navigation",!l.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":l.navigation,"aria-controls":"navigation",children:E.jsx(Ye,{children:e.formatMessage({id:`header_menu_${l.navigation?"hide":"show"}`})})}),E.jsx("ul",{ref:f,id:"navigation",hidden:a.navigation||l.account?!1:!l.navigation,role:"menu","data-showing":!a.navigation&&l.account?"account":"default",children:Un.order.map(m=>E.jsx(io,{id:m,isLoggedIn:n,isDesktopVersion:a.navigation,menus:{navigation:l.navigation,account:l.account},callback:c},m))}),!a.search&&E.jsx("button",{className:"search toggle-search-button",onClick:m=>{m.preventDefault(),m.stopPropagation(),c("search",!l.search)},"aria-haspopup":"true","aria-expanded":l.search,"aria-controls":"search-form",children:E.jsx(Ye,{children:e.formatMessage({id:`header_search_${l.search?"hide":"show"}`})})}),E.jsx(bb,{id:"global-search",handleToggle:{searchIsOpen:l.search,isDesktopVersion:a.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),n?E.jsxs("button",{className:"account-button",onClick:m=>fe.events.onClick(m,{id:"account",callback:c,isOpen:l.account}),onMouseEnter:()=>fe.events.onMouseEnter({id:"account",callback:c}),onMouseLeave:()=>fe.events.onBlur({id:"account",callback:c}),"aria-haspopup":"true","aria-expanded":l.account,"aria-controls":"navigation",children:[E.jsx(Ye,{children:e.formatMessage({id:`header_account_${l.account?"hide":"show"}`})}),E.jsx(Cb,{name:t&&t.details&&t.details.name||"",src:t&&t.details&&t.details.image&&t.details.image.thumbnail||""})]}):E.jsx("ul",{className:"sign-in-buttons",children:Un.buttons.order.map(m=>E.jsx(io,{id:`buttons.${m}`},m))})]}),E.jsx("hr",{id:"content-of-page"}),E.jsx("div",{className:Q("overlay",{open:l.navigation||l.account||!a.search&&l.search})})]})},Pd=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(LL,{...t})}),FL=j.createContext(null),Au={didCatch:!1,error:null};class HL extends j.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Au}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:o,reason:"imperative-api"}),this.setState(Au)}}componentDidCatch(t,r){var n,a;(n=(a=this.props).onError)===null||n===void 0||n.call(a,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:a}=this.props;if(n&&r.error!==null&&UL(t.resetKeys,a)){var o,i;(o=(i=this.props).onReset)===null||o===void 0||o.call(i,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(Au)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:a}=this.props,{didCatch:o,error:i}=this.state;let s=t;if(o){const l={error:i,resetErrorBoundary:this.resetErrorBoundary};if(j.isValidElement(a))s=a;else if(typeof r=="function")s=r(l);else if(n)s=j.createElement(n,l);else throw i}return j.createElement(FL.Provider,{value:{didCatch:o,error:i,resetErrorBoundary:this.resetErrorBoundary}},s)}}function UL(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const GL=({locale:e})=>{const t=Me();return E.jsxs(E.Fragment,{children:[E.jsx(Pd,{locale:e}),E.jsx("div",{className:"content",children:E.jsx(ub,{variant:"error",text:t.formatMessage({id:"pageLayout_error"})})}),E.jsx(wd,{locale:e})]})},WL=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(GL,{locale:e,...t})}),VL=({children:e,reportError:t,showFooter:r=!0,background:n="default",className:a="",locale:o="en"})=>{const i=I_(e,{locale:o});return E.jsx(HL,{onError:t,fallback:E.jsx(WL,{locale:o}),children:E.jsx(j.Suspense,{fallback:E.jsx(mb,{layout:"overview-page"}),children:E.jsx("div",{id:"wrapper",className:Q(a,{[n]:n!=="default"}),children:E.jsxs(RD,{children:[E.jsx(Pd,{locale:o}),E.jsx("div",{className:"content",children:i}),r&&E.jsx(wd,{locale:o}),E.jsx(xb,{})]})})})})};exports.ASSETS_BUCKET=Uy;exports.BannerSection=HB;exports.Button=Ct;exports.CollapsibleSection=zB;exports.CookieBanner=xb;exports.DownloadSection=mD;exports.EmailHelperTextBox=iD;exports.EmptyStateBox=ub;exports.Filters=$D;exports.Footer=wd;exports.Header=Pd;exports.HelperTextBox=db;exports.HiddenFromScreenReaders=Nc;exports.HideShowTextBox=Jj;exports.HighlightedTextBox=ts;exports.Link=BB;exports.LoadMore=ND;exports.LoadingBlock=aD;exports.LoadingPlaceholder=Fn;exports.LoadingState=mb;exports.Logo=xd;exports.Logos=hD;exports.MarketingBox=UB;exports.NUMBER_OF_USERS=GB;exports.PageLayout=VL;exports.PasswordRules=cD;exports.Pill=Qj;exports.ProfilePicture=Cb;exports.ProgressBar=fb;exports.Rating=fD;exports.ResponsiveImage=Hy;exports.SearchForm=bb;exports.Tags=DD;exports.UserContext=bd;exports.UserProvider=WB;exports.VisuallyHidden=Ye;exports.headerData=Un;exports.useEffectAfterMount=Na;exports.useScreenWidth=lo;exports.useScrollListener=Pm;
160
+ */var gb=yD,bm=bD,vD=Object.prototype.toString,_a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function yD(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");for(var r={},n=t||{},a=n.decode||gD,o=0;o<e.length;){var i=e.indexOf("=",o);if(i===-1)break;var s=e.indexOf(";",o);if(s===-1)s=e.length;else if(s<i){o=e.lastIndexOf(";",i-1)+1;continue}var l=e.slice(o,i).trim();if(r[l]===void 0){var u=e.slice(i+1,s).trim();u.charCodeAt(0)===34&&(u=u.slice(1,-1)),r[l]=xD(u,a)}o=s+1}return r}function bD(e,t,r){var n=r||{},a=n.encode||ED;if(typeof a!="function")throw new TypeError("option encode is invalid");if(!_a.test(e))throw new TypeError("argument name is invalid");var o=a(t);if(o&&!_a.test(o))throw new TypeError("argument val is invalid");var i=e+"="+o;if(n.maxAge!=null){var s=n.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");i+="; Max-Age="+Math.floor(s)}if(n.domain){if(!_a.test(n.domain))throw new TypeError("option domain is invalid");i+="; Domain="+n.domain}if(n.path){if(!_a.test(n.path))throw new TypeError("option path is invalid");i+="; Path="+n.path}if(n.expires){var l=n.expires;if(!_D(l)||isNaN(l.valueOf()))throw new TypeError("option expires is invalid");i+="; Expires="+l.toUTCString()}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.priority){var u=typeof n.priority=="string"?n.priority.toLowerCase():n.priority;switch(u){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(n.sameSite){var c=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite;switch(c){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return i}function gD(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function ED(e){return encodeURIComponent(e)}function _D(e){return vD.call(e)==="[object Date]"||e instanceof Date}function xD(e,t){try{return t(e)}catch{return e}}function wD(){return typeof document=="object"&&typeof document.cookie=="string"}function CD(e){return typeof e=="string"?gb(e):typeof e=="object"&&e!==null?e:{}}function xu(e,t={}){const r=TD(e);if(!t.doNotParse)try{return JSON.parse(r)}catch{}return e}function TD(e){return e&&e[0]==="j"&&e[1]===":"?e.substr(2):e}class Eb{constructor(t,r={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const a=this.cookies;this.cookies=gb(document.cookie),this._checkChanges(a)};const n=typeof document>"u"?"":document.cookie;this.cookies=CD(t||n),this.defaultSetOptions=r,this.HAS_DOCUMENT_COOKIE=wD()}_emitChange(t){for(let r=0;r<this.changeListeners.length;++r)this.changeListeners[r](t)}_checkChanges(t){new Set(Object.keys(t).concat(Object.keys(this.cookies))).forEach(n=>{t[n]!==this.cookies[n]&&this._emitChange({name:n,value:xu(t[n])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(t,r={}){return r.doNotUpdate||this.update(),xu(this.cookies[t],r)}getAll(t={}){t.doNotUpdate||this.update();const r={};for(let n in this.cookies)r[n]=xu(this.cookies[n],t);return r}set(t,r,n){n?n=Object.assign(Object.assign({},this.defaultSetOptions),n):n=this.defaultSetOptions;const a=typeof r=="string"?r:JSON.stringify(r);this.cookies=Object.assign(Object.assign({},this.cookies),{[t]:a}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=bm(t,a,n)),this._emitChange({name:t,value:r,options:n})}remove(t,r){const n=r=Object.assign(Object.assign({},r),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[t],this.HAS_DOCUMENT_COOKIE&&(document.cookie=bm(t,"",n)),this._emitChange({name:t,value:void 0,options:r})}addChangeListener(t){this.changeListeners.push(t),this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(t){const r=this.changeListeners.indexOf(t);r>=0&&this.changeListeners.splice(r,1),this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}const _b=_e.createContext(new Eb),{Provider:SD,Consumer:zL}=_b;class RD extends _e.Component{constructor(t){super(t),t.cookies?this.cookies=t.cookies:this.cookies=new Eb(void 0,t.defaultSetOptions)}render(){return _e.createElement(SD,{value:this.cookies},this.props.children)}}function PD(){return typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"}function AD(e){const t=j.useContext(_b);if(!t)throw new Error("Missing <CookiesProvider>");const[r,n]=j.useState(()=>t.getAll());PD()&&j.useLayoutEffect(()=>{function s(){const l=t.getAll({doNotUpdate:!0});OD(e||null,l,r)&&n(l)}return t.addChangeListener(s),()=>{t.removeChangeListener(s)}},[t,r]);const a=j.useMemo(()=>t.set.bind(t),[t]),o=j.useMemo(()=>t.remove.bind(t),[t]),i=j.useMemo(()=>t.update.bind(t),[t]);return[r,a,o,i]}function OD(e,t,r){if(!e)return!0;for(let n of e)if(t[n]!==r[n])return!0;return!1}const wu="cookieBanner_",Cu=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Tu=new Date(Date.now()+12*30*24*60*60*1e3),MD=()=>{const e=Me(),[t,r,n]=AD(Cu),[a,o]=j.useState(!t["apol-cookie-banner"]),i=()=>{Cu.forEach(u=>{r(u,!0,{path:"/",expires:Tu,domain:u==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),o(!1),window.location.reload()},s=()=>{r("apol-cookie-banner",!0,{path:"/",expires:Tu}),Cu.forEach(u=>{if(u==="apol-cookie-banner"){r(u,!0,{path:"/",expires:Tu});return}n(u)}),o(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:i,gtmType:"accepted-all"}];return E.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[E.jsx("h6",{children:e.formatMessage({id:`${wu}title`})}),E.jsx("p",{children:e.formatMessage({id:`${wu}text`})}),E.jsx("ul",{className:"button-wrapper",children:l.map(({id:u,onClick:c=!1,href:f=!1,gtmType:m})=>E.jsx("li",{children:E.jsx(Ct,{variant:f?"tertiary":"primary",href:f,onClick:c,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${m}-click`,children:e.formatMessage({id:`${wu}buttons_${u}`})})},u))})]})},xb=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(MD,{...t})});const ID=({options:e,allOption:t=!1,allowMultiple:r=!0,onChange:n=()=>{},className:a=""})=>{const o=Me(),i=t?[{id:"all",text:typeof t!="boolean"&&t.text||o.formatMessage({id:"filters_all"})},...e]:e,[s,l]=j.useState(t?["all"]:[]),u=(c,f)=>{let m=[];s.includes(c)?m=s.filter(d=>d!==c):c==="all"?m=["all"]:r?m=[...s.filter(d=>d!=="all"),c]:m=[c],l(d=>(n&&typeof n=="function"&&n({current:m,previous:d}),m)),f&&typeof f=="function"&&f()};return E.jsx("ul",{className:Q("filters",a),children:i.map(({id:c,text:f,disabled:m=!1,callback:d=()=>{}})=>{let y={};return m&&(y={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:f})}),E.jsx("li",{children:E.jsx("button",{className:Q(c,{selected:s.includes(c)}),onClick:v=>{v.preventDefault(),v.stopPropagation(),u(c,d)},...y,children:f})},c)})})},$D=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(ID,{...t})});const Su=Hu({locale:"en",messages:yh}),kD=({page:e=1,length:t=0,limit:r=10,loadNextPage:n=()=>{},icon:a=!1,messages:o={button:Su.formatMessage({id:"loadMore_button"}),endOfFeed:Su.formatMessage({id:"loadMore_endOfFeed"}),error:Su.formatMessage({id:"loadMore_error"})},className:i="",gtmContext:s="LoadMore"})=>{const[l,u]=j.useState(!1),[c,f]=j.useState(!1);if(t<=0||t<r*e)return null;const m=async d=>{try{await n(d)}catch(y){y instanceof Error&&y.message&&y.message.includes("Cannot read items")?f(!0):u(!0)}};return E.jsxs("footer",{className:Q("load-more",i),children:[l&&E.jsx("p",{className:"error",children:o.error}),c?E.jsx("p",{children:o.endOfFeed}):E.jsx(Ct,{variant:"secondary",icon:a,onClick:m,"data-gtm-event-context":s,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button})]})},ND=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(kD,{...t})});const qD=({variant:e="default",version:t="default",className:r="",...n})=>E.jsx("p",{className:"logo-wrapper",children:E.jsx("a",{className:Q("logo",e,t,r),href:"/home/",...n,children:E.jsx(Ye,{children:E.jsx(Sr,{id:"apolitical"})})})}),xd=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(qD,{...t})}),gm={default:"tags_",headerTopics:"header_topics_topics_"},Ru={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},BD={getTagDetails:e=>{if(e.includes("topic_")){if(e=Ru.topic[e.replace("topic_","")],e){const t=Un.topics.topics[e].href;return t?{id:e,href:t,text:`${gm.headerTopics}${e}`}:null}return null}return Ru[e]?(e=Ru[e],{id:e,text:`${gm.default}${e}`}):null}};const jD=({tags:e=[],color:t="default",forceOneLine:r=!1,canHaveLinks:n=!0,className:a="",gtmType:o="tag-click",gtmContext:i="tags"})=>{const s=Me();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=BD.getTagDetails(u);c&&l.push(c)}),l.length<1?null:E.jsx("ul",{className:Q("tags text-small",t,a,{"one-line":r}),children:l.map(u=>{const c=s.formatMessage({id:u.text});return E.jsx("li",{children:u.href&&n?E.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":o,"data-gtm-event-context":i,children:c}):c},u.id)})})},DD=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(jD,{...t})}),Lt={platform:{order:["events","courses","qanda","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},qanda:{href:"/questions-answers/",gtmType:"q-and-a-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["story","team","careers","partner","contact"],story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:"dpo@apolitical.co",gtmType:"email-dpo-link"},euDataProtection:{email:"dpo.agl@apolitical.foundation",gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:"concierge@apolitical.co",gtmType:"concierge-email-click"},business:{email:"hello@apolitical.co",gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const en="footer_",oo="SiteFooter",Em=({group:e})=>{const t=Lt[e].order||[];let r=!1;return"text"in Lt[e]&&(r=Lt[e].text),E.jsxs(j.Fragment,{children:[E.jsx("p",{className:"pre-title",children:E.jsx(Sr,{id:`${en}${e}`})}),Array.isArray(t)&&t.length>0&&E.jsx("ul",{className:"text-medium",children:t.map(n=>{if(["order","child","text"].includes(n))return null;const{href:a,gtmType:o}=Lt[e][n],i={};return["legal"].includes(e)&&(i.target="_blank",i.rel="noopener"),E.jsx("li",{children:E.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":oo,"data-gtm-event-type":o,...i,children:E.jsx(Sr,{id:`${en}${e}_${n}`})})},`${e}_${n}`)})}),typeof r!="boolean"&&"order"in r&&Array.isArray(r.order)&&E.jsx("dl",{className:"text-medium",children:r.order.map(n=>E.jsxs(j.Fragment,{children:[E.jsx("dt",{children:E.jsx(Sr,{id:`${en}${e}_${n}`})}),E.jsxs("dd",{children:[typeof r!="boolean"&&r[n].address&&E.jsx("address",{children:E.jsx(Sr,{id:`${en}${e}_${n}_address`,values:{br:E.jsx("br",{})}})}),typeof r!="boolean"&&r[n].email&&E.jsx("a",{href:`mailto:${r[n].email}`,className:"gtm-trackable","data-gtm-event-context":oo,"data-gtm-event-type":r[n].gtmType,children:r[n].email})]})]},`dl-${e}-${n}`))})]},e)},LD=()=>E.jsx("div",{id:"footer",children:E.jsxs("div",{className:"wrapper",children:[E.jsx(Nc,{element:"hr"}),E.jsx(xd,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":oo,"data-gtm-event-type":"logo-homepage-link"}),E.jsx("footer",{children:["platform","community","company","contact"].map(e=>E.jsxs("div",{className:"group",children:[E.jsx(Em,{group:e}),Object.keys(Lt[e]).includes("child")&&E.jsx(Em,{group:Lt[e].child})]},e))}),E.jsx("hr",{}),E.jsxs("div",{className:"sub-footer",children:[E.jsx("ul",{children:Array.isArray(Lt.social.order)&&Lt.social.order.map(e=>{const t=Lt.social[e];return E.jsx("li",{className:e,children:E.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":oo,"data-gtm-event-type":"social-click",children:E.jsx("span",{className:"hidden",children:E.jsx(Sr,{id:`${en}social_${e}`})})})},e)})}),E.jsx("small",{children:E.jsx(Sr,{id:`${en}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),wd=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(LD,{...t})}),wb=e=>{const t=e&&e.toUpperCase().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},xa=["#5AB6A3","#A2D7AF","#806056","#3962B3"],FD=e=>{const t=Math.ceil(26/xa.length),r=wb(e).toLowerCase();if(r==="")return xa[0];const n=r.charCodeAt(0)-96;for(let a=0;a<xa.length;a++)if(n<=t*(a+1))return xa[a]};const wa=256,Cb=({className:e="",src:t="",name:r,alt:n,...a})=>{const[o,i]=j.useState(!1),s=j.useRef(null);return j.useEffect(()=>{const l=s.current;if(!l)return;const u=l.getContext("2d");if(!u)return;const c=wa,f=wa;typeof window<"u"&&window.devicePixelRatio&&(l.width=c*window.devicePixelRatio,l.height=f*window.devicePixelRatio,u.scale(window.devicePixelRatio,window.devicePixelRatio)),u.fillStyle=FD(r),u.fillRect(0,0,c,f),u.font=`${c/3}px Arial`,u.textAlign="center",u.fillStyle="white",u.fillText(wb(r),c/2,f/1.6)},[r]),E.jsxs("figure",{className:Q("profile-picture",e,{error:o}),...a,children:[t!==""&&!o&&E.jsx("img",{src:t,alt:n||r,onError:()=>{i(!0)},width:wa,height:wa}),(t===""||o)&&E.jsx("canvas",{ref:s})]})};var HD="Expected a function",Tb="__lodash_hash_undefined__",Sb=1/0,UD="[object Function]",GD="[object GeneratorFunction]",WD="[object Symbol]",VD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zD=/^\w*$/,XD=/^\./,YD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,KD=/[\\^$.*+?()[\]{}|]/g,ZD=/\\(\\)?/g,JD=/^\[object .+?Constructor\]$/,QD=typeof Ve=="object"&&Ve&&Ve.Object===Object&&Ve,eL=typeof self=="object"&&self&&self.Object===Object&&self,Cd=QD||eL||Function("return this")();function tL(e,t){return e==null?void 0:e[t]}function rL(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var nL=Array.prototype,aL=Function.prototype,Rb=Object.prototype,Pu=Cd["__core-js_shared__"],_m=function(){var e=/[^.]+$/.exec(Pu&&Pu.keys&&Pu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Pb=aL.toString,Td=Rb.hasOwnProperty,Ab=Rb.toString,oL=RegExp("^"+Pb.call(Td).replace(KD,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xm=Cd.Symbol,iL=nL.splice,lL=Ob(Cd,"Map"),Hn=Ob(Object,"create"),wm=xm?xm.prototype:void 0,Cm=wm?wm.toString:void 0;function $r(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function sL(){this.__data__=Hn?Hn(null):{}}function uL(e){return this.has(e)&&delete this.__data__[e]}function cL(e){var t=this.__data__;if(Hn){var r=t[e];return r===Tb?void 0:r}return Td.call(t,e)?t[e]:void 0}function dL(e){var t=this.__data__;return Hn?t[e]!==void 0:Td.call(t,e)}function fL(e,t){var r=this.__data__;return r[e]=Hn&&t===void 0?Tb:t,this}$r.prototype.clear=sL;$r.prototype.delete=uL;$r.prototype.get=cL;$r.prototype.has=dL;$r.prototype.set=fL;function hn(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function pL(){this.__data__=[]}function mL(e){var t=this.__data__,r=rs(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():iL.call(t,r,1),!0}function hL(e){var t=this.__data__,r=rs(t,e);return r<0?void 0:t[r][1]}function vL(e){return rs(this.__data__,e)>-1}function yL(e,t){var r=this.__data__,n=rs(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}hn.prototype.clear=pL;hn.prototype.delete=mL;hn.prototype.get=hL;hn.prototype.has=vL;hn.prototype.set=yL;function Hr(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function bL(){this.__data__={hash:new $r,map:new(lL||hn),string:new $r}}function gL(e){return ns(this,e).delete(e)}function EL(e){return ns(this,e).get(e)}function _L(e){return ns(this,e).has(e)}function xL(e,t){return ns(this,e).set(e,t),this}Hr.prototype.clear=bL;Hr.prototype.delete=gL;Hr.prototype.get=EL;Hr.prototype.has=_L;Hr.prototype.set=xL;function rs(e,t){for(var r=e.length;r--;)if($L(e[r][0],t))return r;return-1}function wL(e,t){t=RL(t,e)?[t]:SL(t);for(var r=0,n=t.length;e!=null&&r<n;)e=e[ML(t[r++])];return r&&r==n?e:void 0}function CL(e){if(!Ib(e)||AL(e))return!1;var t=kL(e)||rL(e)?oL:JD;return t.test(IL(e))}function TL(e){if(typeof e=="string")return e;if(Rd(e))return Cm?Cm.call(e):"";var t=e+"";return t=="0"&&1/e==-Sb?"-0":t}function SL(e){return Mb(e)?e:OL(e)}function ns(e,t){var r=e.__data__;return PL(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Ob(e,t){var r=tL(e,t);return CL(r)?r:void 0}function RL(e,t){if(Mb(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Rd(e)?!0:zD.test(e)||!VD.test(e)||t!=null&&e in Object(t)}function PL(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function AL(e){return!!_m&&_m in e}var OL=Sd(function(e){e=qL(e);var t=[];return XD.test(e)&&t.push(""),e.replace(YD,function(r,n,a,o){t.push(a?o.replace(ZD,"$1"):n||r)}),t});function ML(e){if(typeof e=="string"||Rd(e))return e;var t=e+"";return t=="0"&&1/e==-Sb?"-0":t}function IL(e){if(e!=null){try{return Pb.call(e)}catch{}try{return e+""}catch{}}return""}function Sd(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(HD);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],o=r.cache;if(o.has(a))return o.get(a);var i=e.apply(this,n);return r.cache=o.set(a,i),i};return r.cache=new(Sd.Cache||Hr),r}Sd.Cache=Hr;function $L(e,t){return e===t||e!==e&&t!==t}var Mb=Array.isArray;function kL(e){var t=Ib(e)?Ab.call(e):"";return t==UD||t==GD}function Ib(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function NL(e){return!!e&&typeof e=="object"}function Rd(e){return typeof e=="symbol"||NL(e)&&Ab.call(e)==WD}function qL(e){return e==null?"":TL(e)}function BL(e,t,r){var n=e==null?void 0:wL(e,t);return n===void 0?r:n}var jL=BL;const $b=Gn(jL),fe={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const r={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},n=o=>{const i=`logged${e?"In":"Out"}`;return t>=r[o][i]};let a={};return["navigation","search"].forEach(o=>{a[o]=n(o)}),a},shouldChangeHeaderIsVisible:(e,t,r)=>{Object.values(t).filter(a=>a===!0).length||r([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:r,dispatch:n})=>{if(r[e]===t||e==="account"&&t===!1&&r.navigation===!0)return;const a=Date.now();if(!t&&fe.handlerCalled[e]&&a-fe.handlerCalled[e]<500)return;fe.handlerCalled[e]=a;let o=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(r).forEach(i=>{i===e||r[i]===!1||o.push({type:`menus.${i}`,value:!1})}),n(o)},findFirstChild:(e,t,r=!1)=>{if(!e||!e[0])return!1;for(let n=0;n<=e.length;n++){if(!e[n])continue;if(e[n][t]&&(!r||e[n][t].includes(r)))return e[n];if(!t.includes("."))continue;const a=$b(e[n],t);if(!(typeof a>"u")&&(!r||a[t]&&a[t].includes(r)||a.value&&a.value.includes(r)||a.toString().includes(r)))return e[n]}return e[0].children?fe.findFirstChild(e[0].children,t,r):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:r,focusElements:n,dispatch:a})=>{if(!t.current||!t.current.children)return;const o=r?"desktop":"default";if(n[e][o]){n[e][o].focus();return}let i,s;switch(e){case"navigation":if(r){const l=fe.findFirstChild(t.current.children,"attributes.aria-controls","navigation");i=fe.findFirstChild(l.children,"href")}else i=fe.findFirstChild(t.current.children,"href");i||(i=t.current);break;case"account":if(s=fe.findFirstChild(t.current.children,"className","account"),!s||!s.children)return;i=fe.findFirstChild(s.children,"href");break;default:return}i&&(a([{type:`focusElements.${e}.${o}`,value:i}]),i.focus())},events:{onClick:(e,{id:t,callback:r,isOpen:n})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(fe.timeouts[t]),r(t,!n))},onFocus:({id:e})=>{clearTimeout(fe.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(fe.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{fe.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Un={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","q-and-a","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},"q-and-a":{href:"/questions-answers/",className:"icon q-and-a"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},io=({id:e,isLoggedIn:t=!1,isDesktopVersion:r=!1,menus:n={},callback:a=()=>{},doTrack:o=null})=>{const i=Me(),s=$b(Un,e);if(!s||s.onlyShow&&(s.onlyShow==="logged-in"&&!t||s.onlyShow==="logged-out"&&t))return null;const l="doTrack"in s,u=o===null?l?s.doTrack:!0:o,c=e.includes("buttons.");let f=`header_${e.replaceAll(".","_")}`;s.hasVariantText&&(f+=`_logged${t?"In":"Out"}`);let m=!1;if(s.href){let _=s.gtmType||`${e}-click`;if(_.includes(".")){const C=_.split("."),R=C[C.length-2];_=`${R==="topics"?`${R}-`:""}${C[C.length-1]}`}m={href:s.href,role:"menuitem"},u&&(m={...m,className:"gtm-trackable","data-gtm-event-type":_,"data-gtm-event-context":"HeaderButtons"}),c&&(m={...m,variant:"secondary",size:{mobile:"small",881:"large"},...s.props||{}})}const d=s.order&&s.order[0]&&s[s.order[0]],y=d&&s[s.order[0]].order,v=m&&typeof window<"u"&&window.location&&window.location.pathname===s.href;let S={},h={};if(d){const _=s.menuId||e,C={onClick:R=>fe.events.onClick(R,{id:_,callback:a,isOpen:n[_]}),onFocus:()=>fe.events.onFocus({id:_}),onBlur:()=>fe.events.onBlur({id:_,callback:a}),onMouseLeave:()=>fe.events.onBlur({id:_,callback:a}),onMouseEnter:()=>fe.events.onMouseEnter({id:_,callback:a})};r&&(y&&(S={...C,onKeyPress:R=>{R.key==="Enter"&&fe.events.onClick(R,{id:_,callback:a,isOpen:n[_]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":n[_],"aria-controls":_}),h={hidden:_ in n?!n[_]:!0}),y||(h={...h,...C})}return E.jsxs("li",{className:Q({[s.className]:s.className,"has-submenu":d,parent:y,active:v}),role:"none",...S,children:[m?j.createElement(c?Ct:"a",m,i.formatMessage({id:f})):i.formatMessage({id:f}),s.order&&E.jsx("ul",{...h,children:s.order.map(_=>{if(!s[_])return null;const C={isLoggedIn:t,isDesktopVersion:r,menus:n,callback:a,doTrack:l?u:null};return s[_].order?E.jsxs("li",{className:Q({[s[_].className]:s[_].className}),children:[i.formatMessage({id:`${f}_${_}`}),E.jsx("ul",{children:s[_].order.map(R=>E.jsx(io,{id:`${e}.${_}.${R}`,...C},R))})]},_):E.jsx(io,{id:`${e}.${_}`,...C},_)})})]},e)};const DL={height:67,height_desktop:83},LL=()=>{const e=Me(),t=j.useContext(bd),r=lo(!0,!0),n=t&&typeof t.id=="string",a=j.useMemo(()=>fe.getIsDesktopVersion(n,r),[n,r]),[o,i]=j.useReducer(nE,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:s,menus:l,focusElements:u}=o;Pm({scrollPosition:DL[`height${a.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!a&&l.navigation||fe.shouldChangeHeaderIsVisible(!0,l,i)},scrollDown:()=>{!a&&l.navigation||fe.shouldChangeHeaderIsVisible(!1,l,i)}}});const c=(m,d)=>{fe.handleMenus({id:m,value:d,menus:l,dispatch:i})},f=j.useRef(null);return Na(()=>{l.navigation&&fe.autoFocus({menu:"navigation",navigationRef:f,isDesktopVersion:a.navigation,focusElements:u,dispatch:i})},[l.navigation]),Na(()=>{l.account&&fe.autoFocus({menu:"account",navigationRef:f,isDesktopVersion:a.navigation,focusElements:u,dispatch:i})},[l.account]),t&&t.isLoading?null:E.jsxs(E.Fragment,{children:[E.jsxs("nav",{id:"header",className:Q({"logged-in":n,"logged-out":!n,visible:s}),children:[E.jsx(Ye,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),E.jsx(xd,{}),!a.navigation&&E.jsx("button",{className:"menu-button gtm-trackable",onClick:m=>{m.preventDefault(),m.stopPropagation(),c("navigation",!l.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":l.navigation,"aria-controls":"navigation",children:E.jsx(Ye,{children:e.formatMessage({id:`header_menu_${l.navigation?"hide":"show"}`})})}),E.jsx("ul",{ref:f,id:"navigation",hidden:a.navigation||l.account?!1:!l.navigation,role:"menu","data-showing":!a.navigation&&l.account?"account":"default",children:Un.order.map(m=>E.jsx(io,{id:m,isLoggedIn:n,isDesktopVersion:a.navigation,menus:{navigation:l.navigation,account:l.account},callback:c},m))}),!a.search&&E.jsx("button",{className:"search toggle-search-button",onClick:m=>{m.preventDefault(),m.stopPropagation(),c("search",!l.search)},"aria-haspopup":"true","aria-expanded":l.search,"aria-controls":"search-form",children:E.jsx(Ye,{children:e.formatMessage({id:`header_search_${l.search?"hide":"show"}`})})}),E.jsx(bb,{id:"global-search",handleToggle:{searchIsOpen:l.search,isDesktopVersion:a.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),n?E.jsxs("button",{className:"account-button",onClick:m=>fe.events.onClick(m,{id:"account",callback:c,isOpen:l.account}),onMouseEnter:()=>fe.events.onMouseEnter({id:"account",callback:c}),onMouseLeave:()=>fe.events.onBlur({id:"account",callback:c}),"aria-haspopup":"true","aria-expanded":l.account,"aria-controls":"navigation",children:[E.jsx(Ye,{children:e.formatMessage({id:`header_account_${l.account?"hide":"show"}`})}),E.jsx(Cb,{name:t&&t.name||"",src:t&&t.image&&t.image.thumbnail||""})]}):E.jsx("ul",{className:"sign-in-buttons",children:Un.buttons.order.map(m=>E.jsx(io,{id:`buttons.${m}`},m))})]}),E.jsx("hr",{id:"content-of-page"}),E.jsx("div",{className:Q("overlay",{open:l.navigation||l.account||!a.search&&l.search})})]})},Pd=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(LL,{...t})}),FL=j.createContext(null),Au={didCatch:!1,error:null};class HL extends j.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Au}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:o,reason:"imperative-api"}),this.setState(Au)}}componentDidCatch(t,r){var n,a;(n=(a=this.props).onError)===null||n===void 0||n.call(a,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:a}=this.props;if(n&&r.error!==null&&UL(t.resetKeys,a)){var o,i;(o=(i=this.props).onReset)===null||o===void 0||o.call(i,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(Au)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:a}=this.props,{didCatch:o,error:i}=this.state;let s=t;if(o){const l={error:i,resetErrorBoundary:this.resetErrorBoundary};if(j.isValidElement(a))s=a;else if(typeof r=="function")s=r(l);else if(n)s=j.createElement(n,l);else throw i}return j.createElement(FL.Provider,{value:{didCatch:o,error:i,resetErrorBoundary:this.resetErrorBoundary}},s)}}function UL(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const GL=({locale:e})=>{const t=Me();return E.jsxs(E.Fragment,{children:[E.jsx(Pd,{locale:e}),E.jsx("div",{className:"content",children:E.jsx(ub,{variant:"error",text:t.formatMessage({id:"pageLayout_error"})})}),E.jsx(wd,{locale:e})]})},WL=({locale:e="en",...t})=>E.jsx(qe,{locale:e,children:E.jsx(GL,{locale:e,...t})}),VL=({children:e,reportError:t,showFooter:r=!0,background:n="default",className:a="",locale:o="en"})=>{const i=I_(e,{locale:o});return E.jsx(HL,{onError:t,fallback:E.jsx(WL,{locale:o}),children:E.jsx(j.Suspense,{fallback:E.jsx(mb,{layout:"overview-page"}),children:E.jsx("div",{id:"wrapper",className:Q(a,{[n]:n!=="default"}),children:E.jsxs(RD,{children:[E.jsx(Pd,{locale:o}),E.jsx("div",{className:"content",children:i}),r&&E.jsx(wd,{locale:o}),E.jsx(xb,{})]})})})})};exports.ASSETS_BUCKET=Uy;exports.BannerSection=HB;exports.Button=Ct;exports.CollapsibleSection=zB;exports.CookieBanner=xb;exports.DownloadSection=mD;exports.EmailHelperTextBox=iD;exports.EmptyStateBox=ub;exports.Filters=$D;exports.Footer=wd;exports.Header=Pd;exports.HelperTextBox=db;exports.HiddenFromScreenReaders=Nc;exports.HideShowTextBox=Jj;exports.HighlightedTextBox=ts;exports.Link=BB;exports.LoadMore=ND;exports.LoadingBlock=aD;exports.LoadingPlaceholder=Fn;exports.LoadingState=mb;exports.Logo=xd;exports.Logos=hD;exports.MarketingBox=UB;exports.NUMBER_OF_USERS=GB;exports.PageLayout=VL;exports.PasswordRules=cD;exports.Pill=Qj;exports.ProfilePicture=Cb;exports.ProgressBar=fb;exports.Rating=fD;exports.ResponsiveImage=Hy;exports.SearchForm=bb;exports.Tags=DD;exports.UserContext=bd;exports.UserProvider=WB;exports.VisuallyHidden=Ye;exports.headerData=Un;exports.useEffectAfterMount=Na;exports.useScreenWidth=lo;exports.useScrollListener=Pm;
package/index.mjs CHANGED
@@ -20356,7 +20356,7 @@ const $b = /* @__PURE__ */ Xn(B2), fe = {
20356
20356
  ] }, e);
20357
20357
  };
20358
20358
  const D2 = { height: 67, height_desktop: 83 }, L2 = () => {
20359
- const e = Ie(), t = Im(Xy), r = Fc(!0, !0), n = t && t.details && typeof t.details.id == "string", a = $n(
20359
+ const e = Ie(), t = Im(Xy), r = Fc(!0, !0), n = t && typeof t.id == "string", a = $n(
20360
20360
  () => fe.getIsDesktopVersion(n, r),
20361
20361
  [n, r]
20362
20362
  ), [o, i] = Zb(cE, {
@@ -20471,7 +20471,7 @@ const D2 = { height: 67, height_desktop: 83 }, L2 = () => {
20471
20471
  "aria-controls": "navigation",
20472
20472
  children: [
20473
20473
  /* @__PURE__ */ w(tt, { children: e.formatMessage({ id: `header_account_${l.account ? "hide" : "show"}` }) }),
20474
- /* @__PURE__ */ w(FL, { name: t && t.details && t.details.name || "", src: t && t.details && t.details.image && t.details.image.thumbnail || "" })
20474
+ /* @__PURE__ */ w(FL, { name: t && t.name || "", src: t && t.image && t.image.thumbnail || "" })
20475
20475
  ]
20476
20476
  }
20477
20477
  ) : /* @__PURE__ */ w("ul", { className: "sign-in-buttons", children: fo.buttons.order.map((m) => /* @__PURE__ */ w(po, { id: `buttons.${m}` }, m)) })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "1.1.0-beta.3",
3
+ "version": "1.1.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {