@apolitical/component-library 6.6.18-ac.0 → 6.6.19-beta.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.
package/index.js CHANGED
@@ -34,7 +34,7 @@ Please explain why you're reporting this post. Reasons could include: inappropri
34
34
 
35
35
  Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"Create post",discussionFormCard_placeholder_long:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_postType_label:"Post type","discussion_form__postType_no-category":"Post",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_question_label:"Question",discussion_form_question_placeholder:"Question",discussion_form_option_label:"Options",discussion_form_option_placeholder:"Option {number}",discussion_form_option_cta:"Add option",discussion_form_multiplePollAnswers:"Allow multiple answers",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Create post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Share a question, insight, or announcement with the community",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_showAll:"Show all...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments_loading:"... comments",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",profileModalLauncher_successMessage:"Your post has been created",profileModalLauncher_title:"Your profile is incomplete",profileModalLauncher_text:"A complete profile builds trust and amplifies your voice across the community. Ensure all your details are up to date including a photo and a bio.",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_fieldWrapper_characterLimit_info:"You can enter up to {limit} characters",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_error_multipleInputs_same:"Please enter a unique value into each field",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",form_multipleInputs_label:"Input {number}",form_multipleInputs_filledInCount:"{number}/{total}",form_multipleInputs_filledInCount_aria:"{number} out of {total} available inputs have been filled in",form_multipleInputs_remove:"Remove this input",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_message_label:"Add an invitation note",inviteForm_message_placeholder:"Add a personal note to your invitation...",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",publishArticleForm_title_label:"Title",publishArticleForm_title_placeholder:"Write a snappy title",publishArticleForm_subtitle_label:"Subtitle",publishArticleForm_subtitle_placeholder:"Your topic, in a nutshell",publishArticleForm_body_label:"Body",publishArticleForm_body_placeholder:"Type or paste your article here",publishArticleForm_tags_label:"Tags (select up to three)",publishArticleForm__tags_topic_CitiesAndLocalGovernment:"Cities and local government",publishArticleForm__tags_topic_Climate:"Climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"Equity, justice and inclusion",publishArticleForm__tags_topic_HealthAndSocialCare:"Health and social care",publishArticleForm__tags_topic_Innovation:"Innovation",publishArticleForm__tags_topic_LeadershipAndSkills:"Leadership and skills",publishArticleForm__tags_topic_LifeInGovernment:"Life in government",publishArticleForm__tags_topic_Policymaking:"Policymaking",publishArticleForm__tags_topic_TransportAndInfrastructure:"Transport and infrastructure",publishArticleForm__tags_topic_WorkAndTheEconomy:"Work and the economy",publishArticleForm_tags_error_over_three:"You must select no more than three options.",publishArticleForm_tags_error_required:"Please select at least one option.",publishArticleForm_disclaimer:"Ready to publish? Before you do, consider the following: Have you thoroughly proofread your writing? Are you confident in your arguments? Have you included hyperlinks to the necessary resources to support your article?",publishArticleForm_cta_submit:"Publish article",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_error:"Sorry, something went wrong.",publishArticleForm_error_underMinLength:"Please add at least {length, plural, one {1 character} other {# characters}}.",publishArticleForm_error_loggedOut:"You need to be logged in to publish an article. Please log in and try again.",publishArticleForm_progressBar:"Your article is being published",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_heading_three:"Heading",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_link_enrichedUrl_aria:"Remove this preview for {title}",richTextEditor_link_enrichedUrl_aria_fallback:"the link",richTextEditor_link_enrichedUrl_aria_live:"The link preview has been removed from your post",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",poll_instructions:"Select one{allowMultipleVotes, select, true { or more} other {}}",poll_num_votes:"{number, plural, one {# vote} other {# votes}}",poll_remove_vote_button:"Remove vote{number, plural, =0 {} one {} other {s}}",poll_aria_votes:"You have {number, plural, =0 {not voted on this poll} other {voted for:}}",replies_feed_missing_polls_vote_message:"Please vote above to view all the comments",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_platform_communities:"Communities",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_news:"News",footer_company_insights:"Insights",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_communities:"Communities",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital, data and AI",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_browserTooSmall:"Sorry, your device is too small to view this content properly. Please change to a different orientation or another device.",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},Zh={...pr,languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},Yh={...pr,languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},Gh={...pr,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},Qh=Object.freeze(Object.defineProperty({__proto__:null,en:pr,es:Zh,fr:Yh,pt:Gh},Symbol.toStringTag,{value:"Module"})),ca=(e,t=pr)=>e in t,$t=(e,t,n,r,i={})=>{let a="";return ca(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},Jh=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let i=n.length-1;i>=0;i--){const a=Math.pow(10,(i+1)*3);if(a<=e){e=Math.round(e*t/a)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},ji=(e,t)=>y.Children.map(e,n=>Object.is(n,null)?n:y.cloneElement(n,{...t})),Ed=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},Xh=e=>{var a,s;const n=["name","organization","jobTitle","biography"].every(o=>{const l=e[o];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((s=e.location)==null?void 0:s.en)!==void 0;return n&&r&&i},ep=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,Wr).replace(/{{id}}/g,Wr):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),_d=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match(Vr);if(!i)return e;for(const s of i){const o=s.replace(Vr,(d,m)=>m),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((a=l==null?void 0:l.data)==null?void 0:a.name)||"",u.id=l.id||"",u.error=l.error;else{const d=l;if(d.startsWith(Bs))try{const m=d.replace(Bs,"");u.id=m,await r({id:m}).then(h=>{const{name:p,error:v}=h;u.name=v||p||"",u.error=v})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?ep(e,u,t):s)}return e},mo=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},kd=e=>new URLSearchParams(window.location.search).get(e),Hr=(e="")=>e.replace(/\s+/g,"").length>0,Ss=e=>{const t=e.length>8,n=/[0-9]/.test(e)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(e),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(e);return{isValid:t&&n&&r,matchingRules:{isMoreThanEightCharacters:t,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}};const Be=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:d=!1,children:m=!1,...h})=>{const v=xn(typeof t=="object"),{showTooltip:f,tooltipProps:b}=co(!!u);if(typeof t=="object"&&typeof v=="number"){const A=Object.assign({},t),E=gd(Object.keys(A));t=vd(v,E,A)}!l&&u&&(u="");const g=[];typeof t=="string"&&g.push(t),r&&(g.push("icon"),typeof r=="object"?(g.push(r.icon),r.position?g.push(r.position):g.push("left"),r.hover&&g.push(`hover_${r.hover}`),r.animate&&(g.push("animate"),typeof r.animate=="string"&&g.push(r.animate))):(g.push(r),!r.includes("right")&&!r.includes("left")&&g.push("left")));const x={...h,className:H(e,o,g,{"no-text":!m,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:A=>{(!i||i[0]==="#")&&s&&(A.preventDefault(),A.stopPropagation()),s&&s(A)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",x.href=i);const C=y.createElement(a,x,m||(d?c.jsx(Me,{showOnFocus:!1,children:d}):null));return l&&u?c.jsxs("span",{className:"button-container",...b,children:[c.jsx($n,{isOpen:f,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),C]}):C},gr=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((s,o)=>{var l;return i==="p"?c.jsx(Be,{...s},o):c.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:c.jsx(Be,{...s})},o)});return y.createElement(i,{className:H("button-wrapper",n),...r,children:a})};const qt=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return c.jsx("hr",{className:H(e,{"has-max-width":t}),style:n})},Eu={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},tp=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?Eu[e]:Eu.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},np=({format:e,height:t,query:n,width:r})=>{let i=`w=${r}&h=${t}`;return i=e?`${i}&fm=${e}`:i,i=n?`${i}&${n}`:i,i},Ta=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${np({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const Ln=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,query:s,url:o,width:l,loading:u,decoding:d,fetchPriority:m}=e,{range:h,sizes:p}=tp(e),v=Ta({format:"avif",query:s,range:h,url:o}),f=Ta({format:"webp",query:s,range:h,url:o}),b=Ta({format:"",query:s,range:h,url:o});return a&&a.includes("svg")?c.jsx("picture",{className:t,children:c.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:m||"auto",width:l,height:i,"data-testid":n||"image"})}):c.jsxs("picture",{className:t,children:[a!=="image/gif"&&c.jsx("source",{type:"image/avif",srcSet:v,sizes:p,"data-testid":"source"}),c.jsx("source",{type:"image/webp",srcSet:f,sizes:p,"data-testid":"source"}),c.jsx("img",{srcSet:b,sizes:p,src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:m||"auto",width:l,height:i,"data-testid":n||"image"})]})};const rp=({image:e,className:t="",testId:n})=>c.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&c.jsx(Ln,{image:{...e},className:"image"})}),wn=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:s,gtmType:o,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const m={...l};return a&&(m.onClick=a),s&&(m["data-gtm-event-context"]=s),o&&(m["data-gtm-event-type"]=o),c.jsx("a",{href:e,className:H("gtm-trackable",i),...m,children:t})}const d={};return u&&(d.onClick=a),n?y.createElement(n,{children:t,className:i,...l,...d}):c.jsx(c.Fragment,{children:t})};const Fd=y.forwardRef(({className:e="",children:t},n)=>{const r=y.useRef(null),i=n||r;return c.jsx("aside",{ref:i,className:H("popover",e),"aria-live":"polite",children:t})}),vr=({parent:e=document.body,children:t})=>typeof document=="object"?ud.createPortal(t,e):null,ip=Object.freeze(Object.defineProperty({__proto__:null,default:vr},Symbol.toStringTag,{value:"Module"}));const ap=({currentStep:e=1,steps:t=1})=>c.jsxs(c.Fragment,{children:[c.jsx(Me,{children:c.jsx(ie.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),c.jsx("div",{className:"progress-tracker",children:c.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return c.jsxs("div",{className:"dot-wrapper",children:[c.jsx("div",{className:H("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),c.jsx("div",{className:H("line",{active:i<e})})]},r)})})})]});const sp=({elementId:e,offset:t=20})=>{const n=ie.useIntl(),r=()=>{const i=document.getElementById(e);if(!i)return;const a=document.getElementById("header");a&&window.scrollTo({top:i.offsetTop-a.clientHeight-t})};return c.jsx(Be,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};const op=({items:e,className:t="",...n})=>c.jsx("ul",{className:H("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...s},o)=>c.jsx("li",{className:"bucket text-medium",children:c.jsxs("a",{href:a,...s,children:[c.jsx("p",{className:"title",children:r}),c.jsx("p",{children:i})]})},o))}),_u=300,ku="ease-in-out";class up{constructor(t){this.el=t,this.summary=t.querySelector("summary"),this.content=t.querySelector(".content"),this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",n=>this.onClick(n))}cleanUp(){this.summary.removeEventListener("click",t=>this.onClick(t))}onClick(t){t.preventDefault(),t.stopPropagation(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.open():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:_u,easing:ku}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:_u,easing:ku}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(t){this.el.open=t,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}const da=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=ie.useIntl(),a=y.useRef(null);return y.useEffect(()=>{let s;return r&&(s=new up(a.current)),()=>{r&&s&&s.cleanUp()}},[]),c.jsxs("details",{ref:a,className:H("collapsible-section",t,{"should-animate":r}),children:[c.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),c.jsx("div",{className:"content",children:n})]})},Fu={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},lp=e=>{let t=e;return Object.keys(Fu).includes(e)&&(t=Fu[e]),`url(${Gt}icons/${t}.svg)`};const Au={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},Ad=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=ie.useIntl(),a=t?{"--custom-icon":lp(t)}:{},s=ca(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:c.jsx("small",{className:H("content-type-label text-small",e in Au?Au[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||s})};const Ft=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Gt}icons/${t}.svg)`}:{};return c.jsx("div",{className:H("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...a,children:i})};const Cn=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const a=typeof n=="object"&&"breakpoints"in n,s=xn(a);if(a&&typeof n=="object"&&typeof s=="number"){const m=Object.assign({},n.breakpoints),h=gd(Object.keys(m));i=vd(s,h,m)}const{breakpoints:o,text:l="",component:u,...d}=n;return c.jsx(Ft,{variant:"subtle",className:H("empty-state-box",e,r),children:c.jsxs(c.Fragment,{children:[t&&typeof t=="string"?c.jsx(Zt,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||c.jsx(Be,{...d,variant:n.variant?n.variant:"secondary",children:l}))]})})};const js=({children:e,...t})=>c.jsx("p",{...t,children:e}),Bd={q:js,blockquote:js};for(let e=1;e<=6;e++)Bd[`h${e}`]={component:js,props:{className:"title"}};const Td=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>c.jsxs("div",{...i,className:H("helper-text-box text-small",e,t),children:[n&&c.jsx("p",{className:"title",children:n}),typeof r=="string"?c.jsx(Zt,{options:{wrapper:y.Fragment,forceBlock:!0,overrides:Bd},children:r}):c.jsx("p",{children:r})]});const Sd=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:s="default",children:o})=>{const l=ie.useIntl(),u=y.useRef(null);e||(e=Date.now().toString());const[d,m]=y.useState(""),[h,p]=y.useState("closed");y.useEffect(()=>{const b=u.current;if(b)return b.addEventListener("transitionend",v),()=>{b.removeEventListener("transitionend",v)}},[]),y.useEffect(()=>{if(!i||typeof i!="string")return;const b=i.split(`
36
36
  `);m(b.length<3?`${i.substring(0,400)}...`:b.slice(0,3).join(`
37
- `))},[i]),y.useEffect(()=>{h==="ready-to-close"&&p("closing")},[h]);const v=({propertyName:b})=>{b==="max-height"&&p(g=>g==="opening"?"open":g==="closing"?"closed":g)},f=["opening","open"].includes(h);return c.jsxs(Ft,{variant:"subtle",className:H("hide-show-text-box",t),children:[c.jsx("div",{ref:u,id:e,className:H("content",h,s),children:i?c.jsxs(c.Fragment,{children:[c.jsx(Zt,{options:{forceBlock:!0,...a},children:h==="closed"?d:i}),h!=="closed"&&o]}):o}),c.jsx("p",{className:"cta",children:c.jsx(Be,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:H({"rotate-180":f}),onClick:()=>{p(f?"ready-to-close":"opening")},"aria-expanded":f,"aria-controls":e,children:f?r||l.formatMessage({id:"hideShowTextBox_hide"}):n||l.formatMessage({id:"hideShowTextBox_show"})})})]})};const cp=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:i={},className:a=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=i;return y.createElement(e,{className:H("icon-bulleted-list text-medium",n,a,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const d={wrapper:y.Fragment,forceInline:!0},m={"--icon":`url(${Gt}icons/${l.icon}.svg)`};return e==="dl"?c.jsxs(y.Fragment,{children:[c.jsx("dt",{style:m,children:c.jsx(Zt,{options:d,children:l.dt||""})},`dt-${u}`),c.jsx("dd",{children:typeof l.text=="string"?c.jsx(Zt,{options:d,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):c.jsx("li",{style:m,children:typeof l.text=="string"?c.jsx(Zt,{options:d,children:l.text}):l.text},u)})})},ut=()=>y.Fragment,dp=({children:e})=>c.jsx(Ft,{variant:"secondary",children:e}),fp=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{className:"center",children:e}):c.jsx("div",{className:"center",children:e}),mp=["span","strong","h1","h2","h3","h4","h5","h6","p"],hp=({children:e})=>{const t=ie.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const a of y.Children.toArray(e))if(!(!a||typeof a=="string"||typeof a=="number"))if(y.isValidElement(a)&&a.type==="summary"){if(a.props&&a.props.children){for(const s of y.Children.toArray(a.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&y.isValidElement(s)){const o=s.type;if(mp.includes(o)){for(n=s.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(a);const i=n?n.toString():"";return c.jsx(da,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(a=>a)})},pp=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return c.jsx(Ft,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return c.jsx(Ft,{variant:"primary",children:e});case"pink-textbox":return c.jsx(Ft,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{children:e}):e;default:return c.jsx("div",{...t,children:e})}return c.jsx("div",{...t,children:e})},jt=({children:e})=>c.jsx(c.Fragment,{children:e}),gp=e=>{const t=ie.useIntl(),n=Date.now().toString();let r="default";const i=e.src;i.includes("youtube")||i.includes("vimeo")?r="video":i.includes("riddle")||i.includes("sli.do")?r="poll":i.includes("padlet")&&(r="padlet");const a=`content-after-iframe-${n}`;return c.jsxs(c.Fragment,{children:[c.jsx(Me,{element:"a",href:`#${a}`,onClick:s=>{s.preventDefault(),s.stopPropagation();const o=document.getElementById(a);o==null||o.scrollIntoView({behavior:"smooth"}),o==null||o.focus()},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),c.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),c.jsx("span",{id:a,tabIndex:0})]})},Bu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},vp=({children:e,...t})=>{const n=ie.useIntl();let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let i=e,a=!1;for(const o of y.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&y.isValidElement(o)){const l=o.type;if(["button","center","span","strong"].includes(l)&&o.props&&o.props.children&&o.props.children[0])for((l==="button"||Bu(o.props.children[0])==="button")&&(a=!0),i=o.props.children[0];i&&typeof i!="string"&&!(typeof i=="boolean"||typeof i=="number"||!y.isValidElement(i));)if(i.props&&i.props.children&&i.props.children[0])i=i.props.children[0],i&&Bu(i)==="button"&&(a=!0);else break}const s=`@${Wr}`;return i===s||Array.isArray(i)&&i[0]===s?(delete r.href,delete r.target,c.jsxs("span",{...r,className:"mention deleted-user",children:["@",n.formatMessage({id:"member_deleted"})]})):a?(r={...r,className:"button primary medium"},c.jsx("p",{className:"center",children:c.jsx(Be,{variant:"primary",size:"medium",...r,children:i})})):c.jsx("a",{...r,children:i})},Ps=({children:e,...t})=>c.jsx("span",{className:H({url:t==null?void 0:t.href}),children:e});const bp={default:{a:vp,CollapsibleSection:da,TextBox:Ft,CaseStudy:dp,style:ut,details:hp,div:pp,iframe:gp,center:fp,script:ut},"text-only":{h1:ut,h2:ut,h3:ut,h4:ut,h5:ut,h6:ut,style:ut,details:ut,div:ut,TextBox:ut,CollapsibleSection:ut,CaseStudy:ut,blockquote:ut,iframe:ut,button:ut}},Pn=({element:e="div",className:t="",options:n={},children:r,overrideType:i="default",styling:a={}})=>{if(!r)return null;const{highlightTitles:s=!1}=a;r=r.replace(/^<br\/?>/,"");const o={wrapper:y.Fragment,forceBlock:!0};let l=bp[i];return n.overrides&&(l={...l,...n.overrides}),console.log({children:r,overrideProps:l}),y.createElement(e,{className:H("markdown-text",t,{"highlight-titles":s}),children:c.jsx(Zt,{options:{...o,...n,overrides:l},children:r})})};const jd=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:i="",ctaButton:a})=>{const s=e?{"--max-width":`${e/16}rem`}:{};return c.jsxs("section",{className:H("page-heading",i),children:[c.jsxs("div",{className:H("content",{"has-max-width":e}),style:s,children:[c.jsxs("div",{className:H("content-wrapper",{"has-max-width":e}),children:[t&&t.text&&y.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&y.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),a&&c.jsx(Be,{...a,className:H("cta-button","gtm-trackable"),"data-gtm-event-context":"CreateNewArticle","data-gtm-event-type":"create-article-click",children:a.text})]}),r]})};const Yt=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:i="",children:a,element:s="span",...o})=>{const l={"--icon":`url(${Gt}icons/${r}.svg)`},{showTooltip:u,tooltipProps:d}=co(!!i),m={},h=i?typeof i=="string"?`tooltip-${window.btoa(i)}`:i.id:void 0,p=i?typeof i=="string"?i:i.text:void 0;i&&h&&(m["aria-describedby"]=h);const v=y.createElement(i?"button":s,{className:H("pill",e,t,n,{"has-icon":r}),style:l,children:a,...d,...m,...o});return i?y.createElement(s,{className:"pill-wrapper"},c.jsxs(c.Fragment,{children:[v,c.jsx($n,{id:h,isOpen:u,children:p})]})):v};const ur=({element:e="p",children:t=null,className:n="",...r})=>y.createElement(e,{...r,className:H("status-banner text-small",n),"aria-live":"assertive"},t),ho=y.createContext({badges:[],isLoading:!0});function Pd(){return y.useContext(ho)}const Od=({children:e,badges:t})=>c.jsx(ho.Provider,{value:t,children:e}),Md=({showDevTools:e=!0,children:t})=>{const n=new $e.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return c.jsxs($e.QueryClientProvider,{client:n,children:[t,e&&c.jsx(Th.ReactQueryDevtools,{initialIsOpen:!1})]})};var yp=y.createContext({client:Si});function xp(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,a=y.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&i&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(Si.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),Si.init(r,i)),Si)},[n,r]);return y.createElement(yp.Provider,{value:{client:a}},t)}const Nd=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?c.jsx(xp,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):c.jsx(c.Fragment,{children:e});var Id=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(Id||{});const Rd=({children:e,locale:t,messages:n})=>{const r=t||"en",i={...Qh[r],...n||{}};return c.jsx(ie.IntlProvider,{locale:r,messages:i,children:e})},po=y.createContext({}),Pi={en:"English",es:"Español",fr:"Français",pt:"Português"},st=y.createContext({isLoading:!0});function fa(){return y.useContext(st)}const $d=({children:e,user:t,updateDetails:n})=>c.jsx(st.Provider,{value:{...t,updateDetails:n},children:e}),go=y.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),Ld=()=>y.useContext(go),zd=({children:e})=>{const[t,n]=y.useState([]);y.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=y.useCallback(a=>{n(s=>[...s,a])},[]),i=y.useCallback(a=>{n(s=>s.filter(o=>o!==a))},[]);return c.jsx(go.Provider,{value:{registerOverlay:r,unregisterOverlay:i},children:e})},wp=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[i,a]=y.useState({isLoading:!0}),[s,o]=y.useState({badges:[],isLoading:!0}),l=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[u,d]=y.useState(l),m=h=>{localStorage.setItem("language",h),d(h)};return y.useEffect(()=>{e().then(h=>{Array.isArray(h)?(a({...h[0],isLoading:!1}),o({badges:h[1],isLoading:!1})):a({...h,isLoading:!1}),Ed(5e3)}).catch(h=>{h.message===wd&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),a({isLoading:!1}),o({badges:[],isLoading:!1})})},[]),c.jsx(po.Provider,{value:{language:u,updateLanguage:m},children:c.jsx(Rd,{locale:u,messages:n==null?void 0:n.messages,children:c.jsx(uo.CookiesProvider,{children:c.jsx($d,{user:i,updateDetails:a,children:c.jsx(Od,{badges:s,children:c.jsx(zd,{children:c.jsx(Md,{showDevTools:r,children:c.jsx(Nd,{user:i,children:t})})})})})})})})},Cp={globe:"globe",heart:"heart_empty_thick",pencil:"pencil",star:"star_empty","speech-bubble":"speech-bubble_round"};const qd=({slug:e})=>{const{badges:t}=Pd(),n=t==null?void 0:t.find(o=>o.slug===e);if(!n)return null;const{name:r,icon:i,colour:a,description:s}=n;return c.jsx(Yt,{className:H("user-badge",a==null?void 0:a.toLowerCase()),icon:i&&Cp[i],element:"li",tooltip:s,children:r})};var dt=(e=>(e.Communities="communities",e.Platform="platform",e))(dt||{});const Ud=({element:e="ul",userBadges:t,badgeOptions:n})=>{if(Object.keys(t).length!==0)return y.createElement(e,{className:"badges-list",children:(n==null?void 0:n.scopes)&&(n==null?void 0:n.scopes.map(r=>{var i,a;return(a=(i=t==null?void 0:t[r.scope])==null?void 0:i[r.area])==null?void 0:a.map((s,o)=>c.jsx(qd,{slug:s},o))}))})};const Dp=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const i=ie.useIntl(),{showText:a=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,d={"--progress":`${t}%`};return c.jsx("span",{className:H(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:d,children:y.createElement(a?"span":Me,{className:a?"text":"",children:n||i.formatMessage({id:"progressBar"},{number:t})})})},vo=y.memo(Dp);const Sa="loadingBlock_",Ep=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ie.useIntl();t||(t={0:{text:r.formatMessage({id:`${Sa}loading`})},75:{text:r.formatMessage({id:`${Sa}almostDone`})},100:{text:r.formatMessage({id:`${Sa}complete`})}});let i=null;const a=Object.keys(t);for(let o=0;o<a.length&&!(e<parseInt(a[o]));o++)i=a[o];const s=i&&t[i].icon?{"--icon":`url(${Gt}icons/${t[i].icon}.svg)`}:{};return c.jsxs(Ft,{className:H("loading-block",n,{"has-icon":i&&t[i].icon}),variant:"subtle",style:s,children:[i&&c.jsx("span",{className:"step",children:t[i].text}),c.jsx(vo,{progress:e})]})},Wd=y.memo(Ep);const It=({element:e="div",className:t="",...n})=>c.jsx(la,{element:e,className:H("loading-placeholder",t),...n});const Os={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],member:["profile-picture","text","text"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},Vd=(e,t)=>e in Os?c.jsx("div",{className:e,children:Os[e].map((n,r)=>Vd(n,r))},t):c.jsx(It,{className:e},t),ma=({layout:e="overview-page",...t})=>c.jsx("div",{className:H("loading-state",e),...t,children:Os[e].map((n,r)=>Vd(n,r))}),Hd=e=>{const t=e&&e.toUpperCase().trim().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):""},ci=["#5AB6A3","#A2D7AF","#806056","#3962B3"],_p=e=>{const t=Math.ceil(26/ci.length),n=Hd(e).toLowerCase();if(n==="")return ci[0];const r=n.charCodeAt(0)-96;for(let i=0;i<ci.length;i++)if(r<=t*(i+1))return ci[i]};const Tu=256,on=({className:e="",src:t="",name:n,alt:r,width:i=Tu,height:a=Tu,showInitials:s=!0,...o})=>{const[l,u]=y.useState(!1),d=y.useRef(null),m=r??n;y.useEffect(()=>{const p=d.current;if(!p)return;const v=p.getContext("2d");if(!v)return;const f=i,b=a;typeof window<"u"&&window.devicePixelRatio&&(p.width=f*window.devicePixelRatio,p.height=b*window.devicePixelRatio,v.scale(window.devicePixelRatio,window.devicePixelRatio)),v.fillStyle=_p(n),v.fillRect(0,0,f,b),v.font=`${f/3}px Arial`,v.textAlign="center",v.fillStyle="white",v.fillText(Hd(n),f/2,b/1.6)},[n]);let h=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(h=!0),c.jsx("figure",{className:H("profile-picture",e,{error:l}),...o,children:h?c.jsx("img",{src:t,alt:m,onError:()=>{u(!0)},width:i,height:a}):s?c.jsx("canvas",{ref:d}):c.jsx("span",{className:"fallback"})})};var it=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_ADDED="discussionPostAdded",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(it||{});const ha=e=>e==="apolitical"?{image:`${Gt}logos/member_apolitical.svg`}:e==="community"||e==="deleted"||typeof e=="object"&&!e.name?{image:`${Gt}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.en||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail,badges:e.badges},kp=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const i=e!=="",a=t!=="",s=n!=="";if(!i&&!a&&!s)return"";const o=`${e}${i&&a?` — ${t}`:t}`;let l=`${o}${(i||a)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=sr(l,r)),l};const Fp=y.lazy(()=>Promise.resolve().then(()=>ip)),Ap=y.lazy(()=>Promise.resolve().then(()=>mk));let di=null;const rn=({element:e="div",member:t="community",alt:n="",additionalContent:r=!1,styling:i={},functions:a={},gtmContext:s="member",gtmType:o="member-click",className:l="",badges:u,...d})=>{var S,N,V,W,ae;const m=ie.useIntl(),{profile:h,...p}=a,{size:v="medium",variant:f="inline",isCondensed:b=!0,additionalContentNewLine:g=!1}=i,x=y.useContext(st),C=h&&x&&typeof x.id=="string",[A,E]=y.useState(!1),_=ha(t);_.name||(_.name=m.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:T,image:M}=_;let{url:O}=_;typeof t=="object"&&t.link!==void 0&&(t.link===!1?O=void 0:O=t.link);const L=kp(_),$=r&&r.createdAt?Ts(r.createdAt):!1,B=r&&r.createdAt?fo(r.createdAt):"",F=!O&&C;return y.createElement(e,{...d,className:H("member text-medium",v,f,l,{"has-profile-link":C}),...p,children:c.jsxs(c.Fragment,{children:[c.jsxs(wn,{href:O,className:H({"details-wrapper":F}),fallbackElement:F?"div":void 0,gtmType:o,gtmContext:s,meta:{forceOnClick:!0},onClick:te=>{if(te==null||te.preventDefault(),te==null||te.stopPropagation(),!O){F&&E(!0);return}di&&clearTimeout(di),di=setTimeout(()=>{window.location.href=O},150);const D=new CustomEvent(it.MEMBER_CLICKED,{detail:{link:O,timeout:di}});document.dispatchEvent(D)},children:[c.jsx(on,{name:T,src:M,alt:n}),c.jsxs("div",{className:"details",children:[c.jsxs("div",{className:H("name",{"new-line":g}),"data-testid":"member-name",children:[c.jsx("span",{children:T}),(u==null?void 0:u.showBadges)&&(_==null?void 0:_.badges)&&c.jsx(Ud,{userBadges:_.badges,badgeOptions:u}),r&&c.jsxs("span",{className:H("additional-content",{"new-line":g}),children:[r.createdAt&&$&&!((S=r==null?void 0:r.customMessage)!=null&&S.text)&&c.jsx("span",{className:"date",title:B,"aria-label":B,"data-testid":"date",children:m.formatMessage({id:`dates_${$.path}`},{number:$.number})}),r.createdAt&&$&&((N=r==null?void 0:r.customMessage)==null?void 0:N.text)&&c.jsx("span",{children:m.formatMessage({id:(V=r.customMessage)==null?void 0:V.text},{time:m.formatMessage({id:`dates_${$.path}`},{number:$.number}),community:(ae=(W=r.customMessage)==null?void 0:W.link)==null?void 0:ae.text,link:te=>{var D,Q;return c.jsx("a",{href:`${(Q=(D=r.customMessage)==null?void 0:D.link)==null?void 0:Q.url}`,onClick:Y=>Y.stopPropagation(),children:te})}})}),r.didEdit&&c.jsx("em",{children:m.formatMessage({id:"discussion_edited"})})]})]}),L&&!g&&c.jsx("small",{className:H({"text-medium":v==="large"}),"data-testid":"member-details",children:b?L:c.jsxs(c.Fragment,{children:[_.role,_.organisation?` — ${_.organisation}`:c.jsx(c.Fragment,{}),c.jsx("span",{className:"location",children:_.country})]})})]})]}),L&&h&&C?c.jsxs(c.Fragment,{children:[c.jsx(Be,{variant:"tertiary",size:"small",onClick:te=>{te.preventDefault(),te.stopPropagation(),E(!0)},"data-testid":"profile-button",children:m.formatMessage({id:"member_profile"})}),c.jsx(Fp,{children:c.jsx(Ap,{form:h,showModal:A,content:{title:m.formatMessage({id:"member_profile"})},functions:{onClose:()=>{E(!1)}},className:"in-portal"})})]}):c.jsx(c.Fragment,{})]})})},Bp=Object.freeze(Object.defineProperty({__proto__:null,default:rn},Symbol.toStringTag,{value:"Module"}));const Su={small:24,medium:48},bo=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:a,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...d})=>{const m=ie.useIntl();return!n||n.length===0?null:y.createElement(e,{...d,className:H("contributors",u,i,{"has-gap":a}),children:c.jsxs(c.Fragment,{children:[c.jsx("ul",{children:n.map((h,p)=>{let v,f="";if(p<o){const{name:b="",image:g=""}=ha(h);if(s)return c.jsx(It,{element:"li",className:"contributor"},p);v=c.jsx(on,{name:b,src:g,width:Su[i||"medium"],height:Su[i||"medium"]})}else if(p===o){const b=(t||n.length)-o;v=c.jsxs("small",{className:H({"large-number":b>99}),children:["+",Jh(b,0)]}),f="number-left"}return v?c.jsx("li",{className:H("contributor",f),children:v},p):null})}),r&&c.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?m.formatMessage({id:`member_${n[0]}`}):sr(n[0].name||"",20):l||null})]})})};const yo=({element:e="section",children:t,className:n,...r})=>y.createElement(e,{className:H("modal",n),children:typeof t=="string"?c.jsx("p",{children:t}):t,...r});var Ms={exports:{}},fi={exports:{}},qe={};/** @license React v16.13.1
37
+ `))},[i]),y.useEffect(()=>{h==="ready-to-close"&&p("closing")},[h]);const v=({propertyName:b})=>{b==="max-height"&&p(g=>g==="opening"?"open":g==="closing"?"closed":g)},f=["opening","open"].includes(h);return c.jsxs(Ft,{variant:"subtle",className:H("hide-show-text-box",t),children:[c.jsx("div",{ref:u,id:e,className:H("content",h,s),children:i?c.jsxs(c.Fragment,{children:[c.jsx(Zt,{options:{forceBlock:!0,...a},children:h==="closed"?d:i}),h!=="closed"&&o]}):o}),c.jsx("p",{className:"cta",children:c.jsx(Be,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:H({"rotate-180":f}),onClick:()=>{p(f?"ready-to-close":"opening")},"aria-expanded":f,"aria-controls":e,children:f?r||l.formatMessage({id:"hideShowTextBox_hide"}):n||l.formatMessage({id:"hideShowTextBox_show"})})})]})};const cp=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:i={},className:a=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=i;return y.createElement(e,{className:H("icon-bulleted-list text-medium",n,a,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const d={wrapper:y.Fragment,forceInline:!0},m={"--icon":`url(${Gt}icons/${l.icon}.svg)`};return e==="dl"?c.jsxs(y.Fragment,{children:[c.jsx("dt",{style:m,children:c.jsx(Zt,{options:d,children:l.dt||""})},`dt-${u}`),c.jsx("dd",{children:typeof l.text=="string"?c.jsx(Zt,{options:d,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):c.jsx("li",{style:m,children:typeof l.text=="string"?c.jsx(Zt,{options:d,children:l.text}):l.text},u)})})},ut=()=>y.Fragment,dp=({children:e})=>c.jsx(Ft,{variant:"secondary",children:e}),fp=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{className:"center",children:e}):c.jsx("div",{className:"center",children:e}),mp=["span","strong","h1","h2","h3","h4","h5","h6","p"],hp=({children:e})=>{const t=ie.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const a of y.Children.toArray(e))if(!(!a||typeof a=="string"||typeof a=="number"))if(y.isValidElement(a)&&a.type==="summary"){if(a.props&&a.props.children){for(const s of y.Children.toArray(a.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&y.isValidElement(s)){const o=s.type;if(mp.includes(o)){for(n=s.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(a);const i=n?n.toString():"";return c.jsx(da,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(a=>a)})},pp=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return c.jsx(Ft,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return c.jsx(Ft,{variant:"primary",children:e});case"pink-textbox":return c.jsx(Ft,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{children:e}):e;default:return c.jsx("div",{...t,children:e})}return c.jsx("div",{...t,children:e})},jt=({children:e})=>c.jsx(c.Fragment,{children:e}),gp=e=>{const t=ie.useIntl(),n=Date.now().toString();let r="default";const i=e.src;i.includes("youtube")||i.includes("vimeo")?r="video":i.includes("riddle")||i.includes("sli.do")?r="poll":i.includes("padlet")&&(r="padlet");const a=`content-after-iframe-${n}`;return c.jsxs(c.Fragment,{children:[c.jsx(Me,{element:"a",href:`#${a}`,onClick:s=>{s.preventDefault(),s.stopPropagation();const o=document.getElementById(a);o==null||o.scrollIntoView({behavior:"smooth"}),o==null||o.focus()},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),c.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),c.jsx("span",{id:a,tabIndex:0})]})},Bu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},vp=({children:e,...t})=>{const n=ie.useIntl();let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let i=e,a=!1;for(const o of y.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&y.isValidElement(o)){const l=o.type;if(["button","center","span","strong"].includes(l)&&o.props&&o.props.children&&o.props.children[0])for((l==="button"||Bu(o.props.children[0])==="button")&&(a=!0),i=o.props.children[0];i&&typeof i!="string"&&!(typeof i=="boolean"||typeof i=="number"||!y.isValidElement(i));)if(i.props&&i.props.children&&i.props.children[0])i=i.props.children[0],i&&Bu(i)==="button"&&(a=!0);else break}const s=`@${Wr}`;return i===s||Array.isArray(i)&&i[0]===s?(delete r.href,delete r.target,c.jsxs("span",{...r,className:"mention deleted-user",children:["@",n.formatMessage({id:"member_deleted"})]})):a?(r={...r,className:"button primary medium"},c.jsx("p",{className:"center",children:c.jsx(Be,{variant:"primary",size:"medium",...r,children:i})})):c.jsx("a",{...r,children:i})},Ps=({children:e,...t})=>c.jsx("span",{className:H({url:t==null?void 0:t.href}),children:e});const bp={default:{a:vp,CollapsibleSection:da,TextBox:Ft,CaseStudy:dp,style:ut,details:hp,div:pp,iframe:gp,center:fp,script:ut},"text-only":{h1:ut,h2:ut,h3:ut,h4:ut,h5:ut,h6:ut,style:ut,details:ut,div:ut,TextBox:ut,CollapsibleSection:ut,CaseStudy:ut,blockquote:ut,iframe:ut,button:ut}},Pn=({element:e="div",className:t="",options:n={},children:r,overrideType:i="default",styling:a={}})=>{if(!r)return null;const{highlightTitles:s=!1}=a;r=r.replace(/^<br\/?>/,"");const o={wrapper:y.Fragment,forceBlock:!0};let l=bp[i];return n.overrides&&(l={...l,...n.overrides}),y.createElement(e,{className:H("markdown-text",t,{"highlight-titles":s}),children:c.jsx(Zt,{options:{...o,...n,overrides:l},children:r})})};const jd=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:i="",ctaButton:a})=>{const s=e?{"--max-width":`${e/16}rem`}:{};return c.jsxs("section",{className:H("page-heading",i),children:[c.jsxs("div",{className:H("content",{"has-max-width":e}),style:s,children:[c.jsxs("div",{className:H("content-wrapper",{"has-max-width":e}),children:[t&&t.text&&y.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&y.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),a&&c.jsx(Be,{...a,className:H("cta-button","gtm-trackable"),"data-gtm-event-context":"CreateNewArticle","data-gtm-event-type":"create-article-click",children:a.text})]}),r]})};const Yt=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:i="",children:a,element:s="span",...o})=>{const l={"--icon":`url(${Gt}icons/${r}.svg)`},{showTooltip:u,tooltipProps:d}=co(!!i),m={},h=i?typeof i=="string"?`tooltip-${window.btoa(i)}`:i.id:void 0,p=i?typeof i=="string"?i:i.text:void 0;i&&h&&(m["aria-describedby"]=h);const v=y.createElement(i?"button":s,{className:H("pill",e,t,n,{"has-icon":r}),style:l,children:a,...d,...m,...o});return i?y.createElement(s,{className:"pill-wrapper"},c.jsxs(c.Fragment,{children:[v,c.jsx($n,{id:h,isOpen:u,children:p})]})):v};const ur=({element:e="p",children:t=null,className:n="",...r})=>y.createElement(e,{...r,className:H("status-banner text-small",n),"aria-live":"assertive"},t),ho=y.createContext({badges:[],isLoading:!0});function Pd(){return y.useContext(ho)}const Od=({children:e,badges:t})=>c.jsx(ho.Provider,{value:t,children:e}),Md=({showDevTools:e=!0,children:t})=>{const n=new $e.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return c.jsxs($e.QueryClientProvider,{client:n,children:[t,e&&c.jsx(Th.ReactQueryDevtools,{initialIsOpen:!1})]})};var yp=y.createContext({client:Si});function xp(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,a=y.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&i&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(Si.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),Si.init(r,i)),Si)},[n,r]);return y.createElement(yp.Provider,{value:{client:a}},t)}const Nd=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?c.jsx(xp,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):c.jsx(c.Fragment,{children:e});var Id=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(Id||{});const Rd=({children:e,locale:t,messages:n})=>{const r=t||"en",i={...Qh[r],...n||{}};return c.jsx(ie.IntlProvider,{locale:r,messages:i,children:e})},po=y.createContext({}),Pi={en:"English",es:"Español",fr:"Français",pt:"Português"},st=y.createContext({isLoading:!0});function fa(){return y.useContext(st)}const $d=({children:e,user:t,updateDetails:n})=>c.jsx(st.Provider,{value:{...t,updateDetails:n},children:e}),go=y.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),Ld=()=>y.useContext(go),zd=({children:e})=>{const[t,n]=y.useState([]);y.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=y.useCallback(a=>{n(s=>[...s,a])},[]),i=y.useCallback(a=>{n(s=>s.filter(o=>o!==a))},[]);return c.jsx(go.Provider,{value:{registerOverlay:r,unregisterOverlay:i},children:e})},wp=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[i,a]=y.useState({isLoading:!0}),[s,o]=y.useState({badges:[],isLoading:!0}),l=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[u,d]=y.useState(l),m=h=>{localStorage.setItem("language",h),d(h)};return y.useEffect(()=>{e().then(h=>{Array.isArray(h)?(a({...h[0],isLoading:!1}),o({badges:h[1],isLoading:!1})):a({...h,isLoading:!1}),Ed(5e3)}).catch(h=>{h.message===wd&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),a({isLoading:!1}),o({badges:[],isLoading:!1})})},[]),c.jsx(po.Provider,{value:{language:u,updateLanguage:m},children:c.jsx(Rd,{locale:u,messages:n==null?void 0:n.messages,children:c.jsx(uo.CookiesProvider,{children:c.jsx($d,{user:i,updateDetails:a,children:c.jsx(Od,{badges:s,children:c.jsx(zd,{children:c.jsx(Md,{showDevTools:r,children:c.jsx(Nd,{user:i,children:t})})})})})})})})},Cp={globe:"globe",heart:"heart_empty_thick",pencil:"pencil",star:"star_empty","speech-bubble":"speech-bubble_round"};const qd=({slug:e})=>{const{badges:t}=Pd(),n=t==null?void 0:t.find(o=>o.slug===e);if(!n)return null;const{name:r,icon:i,colour:a,description:s}=n;return c.jsx(Yt,{className:H("user-badge",a==null?void 0:a.toLowerCase()),icon:i&&Cp[i],element:"li",tooltip:s,children:r})};var dt=(e=>(e.Communities="communities",e.Platform="platform",e))(dt||{});const Ud=({element:e="ul",userBadges:t,badgeOptions:n})=>{if(Object.keys(t).length!==0)return y.createElement(e,{className:"badges-list",children:(n==null?void 0:n.scopes)&&(n==null?void 0:n.scopes.map(r=>{var i,a;return(a=(i=t==null?void 0:t[r.scope])==null?void 0:i[r.area])==null?void 0:a.map((s,o)=>c.jsx(qd,{slug:s},o))}))})};const Dp=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const i=ie.useIntl(),{showText:a=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,d={"--progress":`${t}%`};return c.jsx("span",{className:H(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:d,children:y.createElement(a?"span":Me,{className:a?"text":"",children:n||i.formatMessage({id:"progressBar"},{number:t})})})},vo=y.memo(Dp);const Sa="loadingBlock_",Ep=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ie.useIntl();t||(t={0:{text:r.formatMessage({id:`${Sa}loading`})},75:{text:r.formatMessage({id:`${Sa}almostDone`})},100:{text:r.formatMessage({id:`${Sa}complete`})}});let i=null;const a=Object.keys(t);for(let o=0;o<a.length&&!(e<parseInt(a[o]));o++)i=a[o];const s=i&&t[i].icon?{"--icon":`url(${Gt}icons/${t[i].icon}.svg)`}:{};return c.jsxs(Ft,{className:H("loading-block",n,{"has-icon":i&&t[i].icon}),variant:"subtle",style:s,children:[i&&c.jsx("span",{className:"step",children:t[i].text}),c.jsx(vo,{progress:e})]})},Wd=y.memo(Ep);const It=({element:e="div",className:t="",...n})=>c.jsx(la,{element:e,className:H("loading-placeholder",t),...n});const Os={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],member:["profile-picture","text","text"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},Vd=(e,t)=>e in Os?c.jsx("div",{className:e,children:Os[e].map((n,r)=>Vd(n,r))},t):c.jsx(It,{className:e},t),ma=({layout:e="overview-page",...t})=>c.jsx("div",{className:H("loading-state",e),...t,children:Os[e].map((n,r)=>Vd(n,r))}),Hd=e=>{const t=e&&e.toUpperCase().trim().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):""},ci=["#5AB6A3","#A2D7AF","#806056","#3962B3"],_p=e=>{const t=Math.ceil(26/ci.length),n=Hd(e).toLowerCase();if(n==="")return ci[0];const r=n.charCodeAt(0)-96;for(let i=0;i<ci.length;i++)if(r<=t*(i+1))return ci[i]};const Tu=256,on=({className:e="",src:t="",name:n,alt:r,width:i=Tu,height:a=Tu,showInitials:s=!0,...o})=>{const[l,u]=y.useState(!1),d=y.useRef(null),m=r??n;y.useEffect(()=>{const p=d.current;if(!p)return;const v=p.getContext("2d");if(!v)return;const f=i,b=a;typeof window<"u"&&window.devicePixelRatio&&(p.width=f*window.devicePixelRatio,p.height=b*window.devicePixelRatio,v.scale(window.devicePixelRatio,window.devicePixelRatio)),v.fillStyle=_p(n),v.fillRect(0,0,f,b),v.font=`${f/3}px Arial`,v.textAlign="center",v.fillStyle="white",v.fillText(Hd(n),f/2,b/1.6)},[n]);let h=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(h=!0),c.jsx("figure",{className:H("profile-picture",e,{error:l}),...o,children:h?c.jsx("img",{src:t,alt:m,onError:()=>{u(!0)},width:i,height:a}):s?c.jsx("canvas",{ref:d}):c.jsx("span",{className:"fallback"})})};var it=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_ADDED="discussionPostAdded",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(it||{});const ha=e=>e==="apolitical"?{image:`${Gt}logos/member_apolitical.svg`}:e==="community"||e==="deleted"||typeof e=="object"&&!e.name?{image:`${Gt}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.en||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail,badges:e.badges},kp=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const i=e!=="",a=t!=="",s=n!=="";if(!i&&!a&&!s)return"";const o=`${e}${i&&a?` — ${t}`:t}`;let l=`${o}${(i||a)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=sr(l,r)),l};const Fp=y.lazy(()=>Promise.resolve().then(()=>ip)),Ap=y.lazy(()=>Promise.resolve().then(()=>mk));let di=null;const rn=({element:e="div",member:t="community",alt:n="",additionalContent:r=!1,styling:i={},functions:a={},gtmContext:s="member",gtmType:o="member-click",className:l="",badges:u,...d})=>{var S,N,V,W,ae;const m=ie.useIntl(),{profile:h,...p}=a,{size:v="medium",variant:f="inline",isCondensed:b=!0,additionalContentNewLine:g=!1}=i,x=y.useContext(st),C=h&&x&&typeof x.id=="string",[A,E]=y.useState(!1),_=ha(t);_.name||(_.name=m.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:T,image:M}=_;let{url:O}=_;typeof t=="object"&&t.link!==void 0&&(t.link===!1?O=void 0:O=t.link);const L=kp(_),$=r&&r.createdAt?Ts(r.createdAt):!1,B=r&&r.createdAt?fo(r.createdAt):"",F=!O&&C;return y.createElement(e,{...d,className:H("member text-medium",v,f,l,{"has-profile-link":C}),...p,children:c.jsxs(c.Fragment,{children:[c.jsxs(wn,{href:O,className:H({"details-wrapper":F}),fallbackElement:F?"div":void 0,gtmType:o,gtmContext:s,meta:{forceOnClick:!0},onClick:te=>{if(te==null||te.preventDefault(),te==null||te.stopPropagation(),!O){F&&E(!0);return}di&&clearTimeout(di),di=setTimeout(()=>{window.location.href=O},150);const D=new CustomEvent(it.MEMBER_CLICKED,{detail:{link:O,timeout:di}});document.dispatchEvent(D)},children:[c.jsx(on,{name:T,src:M,alt:n}),c.jsxs("div",{className:"details",children:[c.jsxs("div",{className:H("name",{"new-line":g}),"data-testid":"member-name",children:[c.jsx("span",{children:T}),(u==null?void 0:u.showBadges)&&(_==null?void 0:_.badges)&&c.jsx(Ud,{userBadges:_.badges,badgeOptions:u}),r&&c.jsxs("span",{className:H("additional-content",{"new-line":g}),children:[r.createdAt&&$&&!((S=r==null?void 0:r.customMessage)!=null&&S.text)&&c.jsx("span",{className:"date",title:B,"aria-label":B,"data-testid":"date",children:m.formatMessage({id:`dates_${$.path}`},{number:$.number})}),r.createdAt&&$&&((N=r==null?void 0:r.customMessage)==null?void 0:N.text)&&c.jsx("span",{children:m.formatMessage({id:(V=r.customMessage)==null?void 0:V.text},{time:m.formatMessage({id:`dates_${$.path}`},{number:$.number}),community:(ae=(W=r.customMessage)==null?void 0:W.link)==null?void 0:ae.text,link:te=>{var D,Q;return c.jsx("a",{href:`${(Q=(D=r.customMessage)==null?void 0:D.link)==null?void 0:Q.url}`,onClick:Y=>Y.stopPropagation(),children:te})}})}),r.didEdit&&c.jsx("em",{children:m.formatMessage({id:"discussion_edited"})})]})]}),L&&!g&&c.jsx("small",{className:H({"text-medium":v==="large"}),"data-testid":"member-details",children:b?L:c.jsxs(c.Fragment,{children:[_.role,_.organisation?` — ${_.organisation}`:c.jsx(c.Fragment,{}),c.jsx("span",{className:"location",children:_.country})]})})]})]}),L&&h&&C?c.jsxs(c.Fragment,{children:[c.jsx(Be,{variant:"tertiary",size:"small",onClick:te=>{te.preventDefault(),te.stopPropagation(),E(!0)},"data-testid":"profile-button",children:m.formatMessage({id:"member_profile"})}),c.jsx(Fp,{children:c.jsx(Ap,{form:h,showModal:A,content:{title:m.formatMessage({id:"member_profile"})},functions:{onClose:()=>{E(!1)}},className:"in-portal"})})]}):c.jsx(c.Fragment,{})]})})},Bp=Object.freeze(Object.defineProperty({__proto__:null,default:rn},Symbol.toStringTag,{value:"Module"}));const Su={small:24,medium:48},bo=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:a,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...d})=>{const m=ie.useIntl();return!n||n.length===0?null:y.createElement(e,{...d,className:H("contributors",u,i,{"has-gap":a}),children:c.jsxs(c.Fragment,{children:[c.jsx("ul",{children:n.map((h,p)=>{let v,f="";if(p<o){const{name:b="",image:g=""}=ha(h);if(s)return c.jsx(It,{element:"li",className:"contributor"},p);v=c.jsx(on,{name:b,src:g,width:Su[i||"medium"],height:Su[i||"medium"]})}else if(p===o){const b=(t||n.length)-o;v=c.jsxs("small",{className:H({"large-number":b>99}),children:["+",Jh(b,0)]}),f="number-left"}return v?c.jsx("li",{className:H("contributor",f),children:v},p):null})}),r&&c.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?m.formatMessage({id:`member_${n[0]}`}):sr(n[0].name||"",20):l||null})]})})};const yo=({element:e="section",children:t,className:n,...r})=>y.createElement(e,{className:H("modal",n),children:typeof t=="string"?c.jsx("p",{children:t}):t,...r});var Ms={exports:{}},fi={exports:{}},qe={};/** @license React v16.13.1
38
38
  * react-is.production.min.js
39
39
  *
40
40
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -162,4 +162,4 @@ ${p}${m?"1.":"-"} ${u}${h?`
162
162
 
163
163
  `.substring(0,i);return n+a+r}function e_(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}var t_={isHistory(e){return lt(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||gn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||gn.isOperationList(e.undos[0].operations))}},ps=new WeakMap,gs=new WeakMap,nr={isHistoryEditor(e){return t_.isHistory(e.history)&&w.isEditor(e)},isMerging(e){return gs.get(e)},isSaving(e){return ps.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=nr.isMerging(e);gs.set(e,!1),t(),gs.set(e,n)},withoutSaving(e,t){var n=nr.isSaving(e);ps.set(e,!1),t(),ps.set(e,n)}},n_=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:r}=t,{redos:i}=r;if(i.length>0){var a=i[i.length-1];a.selectionBefore&&ne.setSelection(t,a.selectionBefore),nr.withoutSaving(t,()=>{w.withoutNormalizing(t,()=>{for(var s of a.operations)t.apply(s)})}),r.redos.pop(),t.writeHistory("undos",a)}},t.undo=()=>{var{history:r}=t,{undos:i}=r;if(i.length>0){var a=i[i.length-1];nr.withoutSaving(t,()=>{w.withoutNormalizing(t,()=>{var s=a.operations.map(gn.inverse).reverse();for(var o of s)t.apply(o);a.selectionBefore&&ne.setSelection(t,a.selectionBefore)})}),t.writeHistory("redos",a),r.undos.pop()}},t.apply=r=>{var{operations:i,history:a}=t,{undos:s}=a,o=s[s.length-1],l=o&&o.operations[o.operations.length-1],u=nr.isSaving(t),d=nr.isMerging(t);if(u==null&&(u=i_(r)),u){if(d==null&&(o==null?d=!1:i.length!==0?d=!0:d=r_(r,l)),o&&d)o.operations.push(r);else{var m={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",m)}for(;s.length>100;)s.shift();a.redos=[]}n(r)},t.writeHistory=(r,i)=>{t.history[r].push(i)},t},r_=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&R.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&R.equals(e.path,t.path)),i_=(e,t)=>e.type!=="set_selection";const a_=(e,t)=>{const{apply:n}=e;try{e.apply=r=>{if(r.type==="remove_node"&&"type"in r.node&&r.node.type===K.link){const i=r.node;if(i.link){const a=new CustomEvent("linkRemoved",{detail:{url:i.link}});window.dispatchEvent(a)}}n(r)}}catch(r){const i=r.message;t(`Error in withLinkRemovalListener: ${i}`)}return e};var s_=c_,o_=/^(?:\w+:)?\/\/(\S+)$/,u_=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,l_=/^[^\s\.]+\.\S{2,}$/;function c_(e){if(typeof e!="string")return!1;var t=e.match(o_);if(!t)return!1;var n=t[1];return n?!!(u_.test(n)||l_.test(n)):!1}const d_=Rn(s_),f_=(e,t,n)=>{const{insertText:r,isInline:i}=e;try{e.isInline=a=>{const s=a;return[K.link].includes(s.type)||i(a)},e.insertText=a=>{a&&d_(a)?au(e,a,t):r(a)}}catch(a){const s=a.message;n(`Error in withInlines: ${s}`)}return e},m_=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:i}=e;try{e.isInline=a=>a.type===K.mention?!0:n(a),e.isVoid=a=>a.type===K.mention?!0:r(a),e.markableVoid=a=>a.type===K.mention||i(a)}catch(a){const s=a.message;t(`Error in withMentions: ${s}`)}return e},h_=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,i])=>{if(r.type===K.link&&ce.string(r).trim()===""){ne.removeNodes(e,{at:i});return}n([r,i])}}catch(r){const i=r.message;t(`Error in withoutEmptyLinks: ${i}`)}return e};const lu=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:i,functions:a,autoFocus:s,data:o,styling:l,...u})=>{const d=ie.useIntl(),m=Kh();typeof s>"u"&&(s=!0);const{isInOverlay:h=!1}=i||{},{listMembers:p,clickMentionFallback:v,onChange:f=()=>{},onChangeData:b=()=>{},getLinkPreview:g=()=>Promise.resolve({}),onMention:x=()=>{},reportError:C=P=>{console.error(P)}}=a||{},A=[{type:K.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const E={editorKey:null,originalValue:t||"",initialValue:t?null:A,tabbableOption:ra[0],openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1,enrichedUrl:!1},[_,T]=y.useReducer(ri,E),{editorKey:M,originalValue:O,initialValue:L,stringValue:$,lastAnchor:B,lastKey:F,hasInteracted:S,hasLoaded:N,enrichedUrl:V,mentionPopover:W}=_,ae=P=>{P&&T([{type:"tabbableOption",value:P||ra[0]}])},te=async P=>{const z=await g(P);z.url&&T([{type:"enrichedUrl",value:z}])},D=`rte-${e}`,Q=y.useCallback(P=>c.jsx(Yv,{...P}),[]),Y=y.useCallback(P=>c.jsx(Gv,{...P}),[]),k=y.useMemo(()=>a_(f_(m_(h_(n_(Nw($x())),C),C),D,C),C),[]),j=P=>{if(!k||P!==D)return;const z=w.end(k,[]);ne.select(k,z),re.focus(k)};y.useEffect(()=>{const P=z=>{var X;const ee=z,U=((X=ee==null?void 0:ee.detail)==null?void 0:X.id)||null;U&&j(U)};return window.addEventListener("focusEditor",P),()=>{window.removeEventListener("focusEditor",P)}},[]),y.useEffect(()=>{if(k.children.length>0&&!N){if(T([{type:"hasLoaded",value:!0}]),!s)return;j(D)}},[k.children.length,L]),y.useEffect(()=>{O&&(async()=>{let z=Ot(O);if(z.includes("<")){ti.prototype.escape=U=>U;const ee=new ti;ee.addRule("br",{filter:["br"],replacement:U=>U+`
164
164
 
165
- `}),z=ee.turndown(z)}o&&o.mentions&&(z=await _d({text:z,template:`[${Xs}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),fE(z,ee=>{const U=[{type:"initialValue",value:ee},{type:"editorKey",value:O.toString()}];o!=null&&o.link&&(U.push({type:"enrichedUrl",value:o.link}),o.link.url&&te(o.link.url)),T(U),setTimeout(()=>{T([{type:"stringValue",value:Hc(k)}])},150)})})()},[O]),y.useEffect(()=>{if(V===void 0&&k){const z=pE(k);z&&te(z)}const P=z=>{var X;const ee=z,U=((X=ee==null?void 0:ee.detail)==null?void 0:X.url)||null;U&&V&&V.url===U&&T([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",P),()=>{window.removeEventListener("linkRemoved",P)}},[V]),y.useEffect(()=>{if(t){Vr.lastIndex=0;const P=t.match(Vr);P&&P.length===1&&P[0].length===t.length&&!S&&T([{type:"originalValue",value:t}])}t!==""||!k||qi(O,t)&&!S||(w.withoutNormalizing(k,()=>{ne.delete(k,{at:{anchor:w.start(k,[]),focus:w.end(k,[])}}),ne.deselect(k),k.children.length!==0&&ne.unwrapNodes(k,{at:[0]}),ne.insertNodes(k,A,{at:[0]})}),T([{type:"initialValue",value:A},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),y.useEffect(()=>{b({link:V})},[V]),y.useEffect(()=>{$===""&&V&&T([{type:"enrichedUrl",value:void 0}])},[$]);const q=Ur(()=>{vE({editor:k,isShowing:W.show,numberOfUsers:W.numberOfUsers,listMembers:p,dispatch:T})},100);return L?c.jsx("div",{id:D,className:"rich-text-editor input text-medium",children:c.jsxs(ln.Provider,{value:{..._,id:D,isInOverlay:h,setFocus:ae,dispatch:T,getLinkPreview:g,onMention:x,reportError:C},children:[c.jsxs(Ow,{editor:k,initialValue:L,onChange:P=>{if(k.operations.some(ee=>ee.type!=="set_selection")){let ee=yE(P);ee==="<br>"&&(ee=""),f(ee,V),T([{type:"stringValue",value:Hc(k)}]),S||T([{type:"hasInteracted",value:!0}]),q(),m&&console.log({serialized:ee,json:P})}},...u,children:[c.jsx(_w,{className:"editor",renderElement:Q,renderLeaf:Y,placeholder:n||d.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onPaste:async P=>{const z=V!==!1,ee=P.clipboardData.getData("text");if((X=>{try{return new URL(X),!0}catch{return!1}})(ee)){let X=ee;if(ee){const{full:oe}=mo(ee);X=oe}if(ee&&g&&!z){const oe=await g(X);oe.url&&T([{type:"enrichedUrl",value:oe}])}}},onKeyDown:P=>{if(P.key==="Enter"){W.show&&(P.preventDefault(),P.stopPropagation(),Lm(k,W,T,D));const{selection:z}=k;if(z){const ee=G.isCollapsed(z),[U,X]=w.node(k,z,{depth:1});let oe=U,J=oe.type;const pe=oe.children[0];if(pe&&(pe==null?void 0:pe[K.h3])===!0&&(P.stopPropagation(),P.preventDefault(),ne.insertNodes(k,A)),pe&&[K.ol,K.ul].includes(pe.type)&&(oe=pe,J=pe.type),oe&&me.isElement(oe)&&J!==K.paragraph){if(J===K.blockquote&&!P.shiftKey){P.stopPropagation(),P.preventDefault(),ne.insertNodes(k,A);return}if(ee){const[de,ye]=w.parent(k,z,{edge:"end"}),Ce=de.type;if([K.ul,K.ol].includes(J))if(P.stopPropagation(),P.preventDefault(),Ce===K.li&&F==="Enter"){de.children.length===1&&"text"in de.children[0]&&de.children[0].text===""&&ne.removeNodes(k,{at:ye}),ne.insertNodes(k,A,{at:R.next(X)}),ne.select(k,w.end(k,R.next(X)));return}else{const[Ve,Le]=mE(k,K.li),ze={type:K.li,children:[{text:""}]};ne.insertNodes(k,ze,{at:R.next(Le)}),ne.select(k,w.end(k,R.next(Le)))}}}}}else if(P.key==="Escape"){if(W.show){P.preventDefault(),P.stopPropagation(),T([{type:"mentionPopover",value:{...W,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(P.key)&&W.show){P.preventDefault(),P.stopPropagation();const{selectedUser:z,possibleUsers:ee}=W;let U=P.key==="ArrowUp"?z-1:z+1;U<0&&(U=ee.length-1),U>=ee.length+1&&(U=0),T([{type:"mentionPopover",value:{...W,selectedUser:U}}])}T([{type:"lastKey",value:P.key}]),gE(P,k,T,C)},onBlur:()=>{k.selection&&T([{type:"lastAnchor",value:k.selection.anchor}])},onFocus:()=>{if(B){if(!R.isPath(B.path)||!ce.has(k,B.path))return;const P=ce.get(k,B.path);let z=0;if(ge.isText(P)?z=P.text.length:P.children&&(z=P.children.length),B.offset>z)return;try{ne.select(k,{anchor:B,focus:B})}catch(ee){const U=ee.message;C(`Error focusing editor: ${U}`)}}}}),V?c.jsx(jo,{data:V,variant:"condensed",onClick:()=>{T([{type:"enrichedUrl",value:!1}]);const P=new CustomEvent("ariaLive",{detail:{message:d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(P)},"aria-label":d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:V.title||d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):c.jsx(c.Fragment,{}),c.jsx(BE,{styling:l==null?void 0:l.toolbar}),p?c.jsx(xE,{onFallbackClick:v}):c.jsx(c.Fragment,{})]},M),c.jsx(Oo,{id:`character-limit-${e}`,limit:r,valueLength:pa($)})]})}):c.jsx(c.Fragment,{})};const p_=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:s=""})=>{const[o,l]=y.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);y.useEffect(()=>{r&&l(r)},[r]);const u=d=>{a||(l(d),i(d))};return c.jsxs("div",{className:H("toggle",s),onClick:d=>{d.preventDefault(),d.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[c.jsx("p",{children:t}),c.jsx("ul",{className:H("toggle-options",{disabled:a,on:o===n[1].value}),children:n.map(d=>{const m=`${e}-${d.value}`;return c.jsxs("li",{className:"hidden",children:[c.jsx("input",{type:"radio",id:m,name:e,value:d.value,checked:o===d.value,onChange:()=>u(d.value),disabled:a}),c.jsx("label",{htmlFor:m,children:d.label})]},m)})})]})};function th({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:s}){const o=ie.useIntl(),l="profileImageChange_",[u,d]=y.useState(r),[m,h]=y.useState(!1),[p,v]=y.useState(!1),f=y.useRef(null),b=async A=>{h(!0),v(!1);try{const E=A.target.files&&A.target.files[0];if(!E||!t)throw h(!1),new Error("Image file or userID is missing");const _=await i({fileObject:E,userId:t}),T={thumbnail:_.thumbnailURL,full:_.originalURL};d(T),s(T)}catch{v(!0)}finally{h(!1)}h(!1)},{upload:g=o.formatMessage({id:`${l}cta_upload`}),change:x=o.formatMessage({id:`${l}cta_change`}),uploading:C=o.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return c.jsxs("div",{className:H("profile-image-change-figure",e),children:[c.jsx(on,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),p&&c.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),c.jsx("input",{id:"file",type:"file",accept:"image/*",ref:f,onChange:b,hidden:!0,"data-testid":"file-input"}),c.jsx(Be,{onClick:()=>f.current&&f.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:m,children:m?C:u?x:g})]})}const nh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return c.jsx(Jt,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const g_=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=ie.useIntl();return c.jsx(jh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,s)=>c.jsxs("div",{className:"email text-medium",children:[c.jsx("div",{"data-tag-item":!0,children:i}),c.jsx(Be,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{s(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},rh=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:s,onClose:o,reportError:l,sendInvites:u,initialFormStatus:d="NOT_SUBMITTED"})=>{const[m,h]=y.useState([]),[p,v]=y.useState(!0),[f,b]=y.useState(d),{formatMessage:g}=ie.useIntl(),x=async E=>{try{await u(m,E.message),h([]),b("SUCCESS")}catch(_){b("ERROR"),l(_)}},C=E=>{E.preventDefault(),b("NOT_SUBMITTED"),v(!0),h([])},A=E=>{E.preventDefault(),o(),b("CLOSED")};return f==="CLOSED"?null:f==="ERROR"||f==="SUCCESS"?c.jsxs("div",{className:"invite-form-wrapper",children:[c.jsx("div",{className:"content centred",children:f==="SUCCESS"?c.jsx("h2",{className:"success-title",children:g({id:"inviteForm_success"})}):c.jsxs("h2",{className:"error-title",children:[" ",g({id:"inviteForm_error"})]})}),c.jsx(qt,{}),c.jsx("div",{className:"footer",children:f==="SUCCESS"?c.jsxs(c.Fragment,{children:[c.jsx(Be,{variant:"secondary",onClick:C,children:g({id:"inviteForm_ctaSendMoreInvites"})}),c.jsx(Be,{onClick:A,children:g({id:"inviteForm_ctaDone"})})]}):c.jsx(Be,{onClick:C,children:g({id:"inviteForm_ctaTryAgain"})})})]}):c.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:s},children:[c.jsxs("div",{className:"content",children:[c.jsx("h2",{className:"title",style:{color:i},children:e}),c.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),c.jsx(Jt,{id:"invite-form",fields:[{component:g_,props:{emails:m,setEmails:h,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:g({id:"inviteForm_message_label"}),placeholder:n||g({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:x},button:{text:r,size:"medium",disabled:p}})]})},zi=e=>e.map(t=>({condition:t})),St={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},v_=({functions:e,...t})=>{const{formatMessage:n}=ie.useIntl(),[r,i]=y.useState(null),[a,s]=y.useState(!1),[o,l]=y.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=p=>p[St.NEW_PASSWORD]!==p[St.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,d=p=>!Ss(p[St.NEW_PASSWORD]).isValid,m=[{"data-testid":St.NEW_PASSWORD,id:St.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:zi(["required",d]),functions:{onChange:p=>l(Ss(p).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":St.CONFIRMED_PASSWORD,id:St.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:zi(["required",u])}];t.isPasswordChange&&m.unshift({"data-testid":St.CURRENT_PASSWORD,id:St.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:zi(["required"])}),a&&m.push({component:Sf,props:{matchingRules:o}});const h={id:St.FORM_ID,fields:m,functions:{...e,onSuccess:async p=>(e.createPassword(p),e.onSuccess&&e.onSuccess(p)),onCatch:p=>i(p==null?void 0:p.statusCode),onFailure:(p,v)=>{(v.includes(St.NEW_PASSWORD)||v.includes(St.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return c.jsxs(c.Fragment,{children:[c.jsx(Jt,{...h}),r&&c.jsx(Cn,{variant:"error",text:r})]})};const ih=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var M;const s=ie.useIntl(),o="profileForm_",l=y.useContext(st),[u,d]=y.useState(l.image),[m,h]=y.useState(!1),{uploadImage:p=()=>{},onSuccess:v=async O=>{},onCancel:f=()=>{},onFailure:b=()=>{}}=n,{buildLocation:g,isValidPlace:x,predictPlaces:C}=t.useMaps(),{context:A="ProfileForm",event:E="profile-form-submit-click"}=i||{},_=[{id:"jobTitle",type:"text",label:s.formatMessage({id:`${o}jobTitle`}),placeholder:s.formatMessage({id:`${o}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:s.formatMessage({id:`${o}organization`}),placeholder:s.formatMessage({id:`${o}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:s.formatMessage({id:`${o}location`}),placeholder:s.formatMessage({id:`${o}location_placeholder`}),value:(M=l.location)==null?void 0:M.en,validation:[{condition:"required"},{condition:({location:O})=>O&&!m?!1:!x(O),error:s.formatMessage({id:`${o}location_error`})}],functions:{onChange:()=>{m||h(!0)},onKeyInput:C}}],T=[{component:th,props:{userName:l.name,userId:l.id,src:u,uploadImage:p,callback:d,button:{text:{upload:s.formatMessage({id:`${o}image`})}}}},{id:"name",type:"text",label:s.formatMessage({id:`${o}name`}),placeholder:s.formatMessage({id:`${o}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},..._,{id:"biography",type:"textarea",label:s.formatMessage({id:`${o}bio`}),placeholder:s.formatMessage({id:`${o}bio_placeholder`}),limit:1e3,value:l.biography},{component:qt}];return c.jsx(Jt,{id:"profile-details-form",fields:e?_:T,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:o,gtm:{context:A,event:E},functions:{onSuccess:async O=>{try{const L={...O,image:u||null,location:m?await g(O==null?void 0:O.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails($=>({...$,...L})),await v(L)}catch{b()}},onCancel:f,onFailure:b},button:{size:"large",text:{default:s.formatMessage({id:`${o}cta`}),submitting:s.formatMessage({id:`${o}cta_submitting`}),submitted:s.formatMessage({id:`${o}cta_submitted`})}},...a})},b_=()=>{const e=ie.useIntl(),[t,n]=y.useState(0);return y.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),c.jsx(Wd,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};var ah=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(ah||{});let vs=null;const rt="publishArticleForm_",ed={},td=10,y_=({id:e="publish-article-form",values:t=ed,functions:n,meta:r,gtm:i})=>{const a=ie.useIntl(),s=y.useContext(st),{create:o,onSuccess:l=()=>{},onFailure:u=()=>{}}=n||{},{isInOverlay:d=!1}=r||{},[m,h]=y.useState(!1),[p,v]=y.useState(t.body||""),[f,b]=y.useState(!1),[g,x]=y.useState("");y.useEffect(()=>{qi(t,ed)||Hr(t.body)&&t.body!==p&&t.body!==void 0&&v(t.body)},[t.body]);const C=()=>{!s||!s.id?b(a.formatMessage({id:`${rt}error_loggedOut`})):f&&b(!1)},A=M=>({condition:O=>{const L=O[M];return!L||typeof L!="string"?!0:L.length<td},error:a.formatMessage({id:`${rt}error_underMinLength`},{length:td})}),E=!!p&&Hr(p),_=()=>c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsx("p",{className:"text-medium",children:a.formatMessage({id:`${rt}disclaimer`})})]}),T=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:a.formatMessage({id:`${rt}title_label`}),placeholder:a.formatMessage({id:`${rt}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:C},validation:[{condition:"required"},A("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:a.formatMessage({id:`${rt}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:a.formatMessage({id:`${rt}subtitle_placeholder`}),functions:{onChange:C},validation:[{condition:"required"},A("subtitle")]},{component:ru,props:{formID:e,label:{visible:a.formatMessage({id:`${rt}body_label`})},showLabel:!0}},{component:lu,props:{id:`${e}-input`,value:p,placeholder:a.formatMessage({id:`${rt}body_placeholder`}),meta:{isInOverlay:d},autoFocus:!1,functions:{onChange:M=>{v(M),C()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!f,"aria-errormessage":"error-message"}},{id:"tags",label:a.formatMessage({id:`${rt}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(ah).map(M=>({id:M,label:a.formatMessage({id:`${rt}_tags_${M}`})})),multipleOptions:{limit:3},validation:[{condition:"required",error:a.formatMessage({id:`${rt}tags_error_required`})},{condition:M=>{var O;return((O=M==null?void 0:M.tags)==null?void 0:O.length)>3},error:a.formatMessage({id:`${rt}tags_error_over_three`})}]}];return m?T.push({component:qt}):T.push({component:_}),c.jsxs("section",{className:"publish-article-form",children:[c.jsx(Jt,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async M=>{if(!s||!s.id||!E)return;vs&&clearTimeout(vs),h(!0);const O={...M,body:p};try{o&&await o(O),vs=setTimeout(()=>{x(a.formatMessage({id:`${rt}aria_success`})),l(O)},500)}catch{b(a.formatMessage({id:`${rt}error`})),x(""),u()}},onFailure:u},fields:T,intlPath:rt,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":i==null?void 0:i.context,"data-gtm-event-type":"publish-article-click",disabled:!s||!s.id||!E,text:{default:a.formatMessage({id:`${rt}cta_submit`}),submitting:a.formatMessage({id:`${rt}cta_submitting`}),submitted:a.formatMessage({id:`${rt}cta_submitted`})},customOnSubmit:f?c.jsx(c.Fragment,{}):c.jsx(b_,{})},gtm:i}),f&&c.jsx(ur,{id:"error-message",className:"error",children:typeof f=="string"&&f.includes(" ")?f:a.formatMessage({id:`${rt}error`})}),g&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:g})]})};const sh=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=ie.useIntl(),u=y.useRef(null);or(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=m=>{m.preventDefault(),m.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return c.jsx("form",{onSubmit:d,className:H("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:c.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:c.jsxs("p",{children:[c.jsx(Me,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),c.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:m=>{m.key==="Enter"&&d(m)}}),c.jsx("button",{className:"clear",onClick:m=>{m.preventDefault(),m.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:c.jsx(Me,{children:l.formatMessage({id:"search_clear"})})}),c.jsx("button",{className:"search",onClick:d,children:c.jsx(Me,{children:l.formatMessage({id:"search_cta"})})})]})})})},nd=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},a);try{s=await t(i),s===void 0&&(s=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let d="";return o?d=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?d=u.auth?"verify":"pending":d="exists":u.auth&&(d="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:i,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},x_=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},w_=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=x_(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),localStorage.setItem("email",s.email),r&&r({...s,...a.values}),i([{type:"showSuccessMessage",value:!0}])},C_=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:d}=s,m=(p,v)=>{p.current&&s.validFields[v]!==p.current.validity.valid&&o([{type:`validFields.${v}`,value:p.current.validity.valid}])},h=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>m(a.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{nd({ref:a.email,validateEmail:r,dispatch:o})},onChange:(p,v)=>{o([{type:"shouldDisableButton",value:!0}]),v&&v({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:kf,props:{email:d.email,type:d.boxType,resendVerificationCode:i}}];return s.shouldManuallyApprove&&(h.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>m(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{m(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&h.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:p=>c.jsx("small",{children:p})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&h.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:p=>c.jsx("small",{className:"notes text-small",children:p})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),h.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:p=>c.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:p}),privacy:p=>c.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:p})}),shownValue:"accepted",functions:{onChange:p=>{if(!p)return;const v=[];["name","email"].forEach(f=>{s.validFields[f]!==a[f].current.validity.valid&&(v.push({type:`validFields.${f}`,value:a[f].current.validity.valid}),f==="email"&&nd({ref:a.email,validateEmail:r,dispatch:o}))}),v.length&&o(v)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),h};const D_=({className:e=""})=>c.jsxs("div",{className:H("success-message",e),"data-testid":"success-message",children:[c.jsx("p",{className:"success-title",children:c.jsx(ie.FormattedMessage,{id:"signup_success_title"})}),c.jsx(ie.FormattedMessage,{id:"signup_success_text",values:{p:t=>c.jsx("p",{children:t})}})]});const E_={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},__=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=ie.useIntl(),{title:u=!0,expectation:d=!1,url:m=!0,logInButton:h=!0,successMessage:p=!0}=i,v={title:u,expectation:d,url:m,logInButton:h,successMessage:p},[f,b]=y.useReducer(ri,E_),{validFields:g,emailDetails:x,shouldManuallyApprove:C,shouldDisableButton:A,showSuccessMessage:E,showError:_}=f,[T,M]=uo.useCookies(["signup-this-session","functional-cookie-consent"]),O={form:y.createRef(),name:y.createRef(),email:y.createRef(),jobTitle:y.createRef(),organisation:y.createRef(),tc:y.createRef(),hiddenValidation:y.createRef()};y.useEffect(()=>{C===!0&&O.jobTitle.current&&O.jobTitle.current.focus()},[C]),y.useEffect(()=>{T["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[T]),y.useEffect(()=>{E&&T["functional-cookie-consent"]&&M("signup-this-session","true",{path:"/",maxAge:3600})},[E]);const L=y.useMemo(()=>C_({placeholders:n,labels:t,shouldShow:v,functions:r,refs:O,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,O,v,f]),$=A?!0:C?!Object.values(g).every(B=>B===!0):!g.name||!g.email||["exists","pending","verify"].includes(x.boxType);return v.successMessage&&E?c.jsx(D_,{className:e}):c.jsxs("fieldset",{className:H("signup-form-fieldset",e),"data-testid":"signup-form",children:[v.title&&c.jsx("p",{className:"signup-title",children:c.jsx(ie.FormattedMessage,{id:"signup_title"})}),_&&c.jsx(Cn,{variant:"error",text:l.formatMessage({id:"signup_error"})}),c.jsx(Jt,{className:"signup-form",formRef:O.form,id:"sign-up-form",fields:L,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:$?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:`/api/next-ui/login?returnTo=${window.location.pathname}`,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:v.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await w_({refs:O,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:B=>{r.handleError(B),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),c.jsx("button",{className:"validation-button",ref:O.hiddenValidation})]})};const _n=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return c.jsx("section",{className:H("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const k_=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),c.jsx(_n,{className:H("download-section",n),styling:{background:"dark"},children:c.jsxs("div",{className:"content-default",children:[y.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),c.jsx(gr,{buttons:r})]})})};const oo="editSection_";function oh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const F_=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:s}=ie.useIntl();return c.jsxs(Ft,{variant:"muted",icon:e,children:[c.jsx("p",{children:t||s({id:`${oo}placeholder_description`})}),i&&c.jsx("p",{children:c.jsx(Be,{href:r,variant:"secondary",size:"small",onClick:()=>oh({href:r,setShowModal:a}),children:n||s({id:`${oo}placeholder_cta`})})})]})},A_=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:d}=ie.useIntl(),[m,h]=y.useState(!1),p=()=>h(!1),v=!!n||!!r,f=typeof i=="string"||v;let b;return r&&(b=y.cloneElement(r,{functions:{...r.props.functions,onSuccess:async g=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(g)}finally{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),c.jsxs("section",{className:H("edit-section",t),children:[v&&c.jsx(un,{title:o||`Edit ${a}`,isOpen:m,showDivider:!1,showIcon:!1,functions:{onClose:p},className:H("edit-section-modal"),children:b||(n?c.jsx(Jt,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async g=>{var x,C;(x=n==null?void 0:n.functions)!=null&&x.onSuccess&&await((C=n==null?void 0:n.functions)==null?void 0:C.onSuccess(g)),h(!1)},onCancel:p}}):c.jsx(c.Fragment,{}))}),c.jsxs("div",{className:H("edit-section-header",{"no-title":!s}),children:[s&&c.jsx("h2",{className:"edit-section-header-title",children:a}),f&&c.jsx(Be,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>oh({href:i,setShowModal:h}),children:d({id:`${oo}edit`})})]}),e||c.jsx(F_,{...l,href:i,setShowModal:h,showEditButton:f}),u&&c.jsx(qt,{})]})};const B_=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return c.jsxs("div",{className:H("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&y.createElement(s.element,{className:H("title",s.className)},s.text),t&&c.jsx("p",{children:t}),c.jsx("ul",{className:H({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:d,nameOfBusiness:m,link:h=!1,description:p=!1},v)=>{if(!d||!d.url)return null;const f=c.jsx("img",{src:d.url,width:d.width||"auto",height:d.height||"auto",alt:m});return c.jsxs("li",{children:[c.jsx("p",{className:"img-wrapper",children:h?c.jsx("a",{href:h,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),p&&c.jsx("small",{children:p})]},window.btoa(`${d.url}_${v}`))})})]})};let bs;const ys="contactFooter_",T_=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=y.useRef(null),[r,i]=y.useState(0),[a,s]=y.useState(!1),o=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(s(!0),clearTimeout(bs),bs=setTimeout(()=>{o(),s(!1)},500))};return y.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(bs),window.removeEventListener("resize",l)}),[]),c.jsx(_n,{id:"contactForm",className:"contact-footer",children:c.jsxs("div",{className:"inner-wrapper",children:[c.jsx("h2",{children:c.jsx(ie.FormattedMessage,{id:`${ys}title`})}),c.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[c.jsxs("aside",{children:[c.jsx("p",{children:c.jsx(ie.FormattedMessage,{id:`${ys}text`})}),c.jsx(wn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:c.jsx(ie.FormattedMessage,{id:`${ys}email`})})]}),c.jsx(nh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},S_=({activeLink:e,profile:t,...n})=>c.jsx(_n,{children:c.jsx(Ef,{layout:"1-3",children:c.jsxs(c.Fragment,{children:[c.jsx(Df,{activeLink:e,profile:t}),c.jsx(jd,{...n})]})})});const xs="cookieBanner_",ws=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Cs=new Date(Date.now()+12*30*24*60*60*1e3),uh=()=>{const e=ie.useIntl(),[t,n,r]=uo.useCookies(ws),[i,a]=y.useState(!t["apol-cookie-banner"]),s=()=>{ws.forEach(d=>{n(d,!0,{path:"/",expires:Cs,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Cs}),ws.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:Cs});return}r(d)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(d=>{u.push({variant:d.href?"tertiary":"primary",href:d.href,onClick:d.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${d.gtmType}-click`,children:e.formatMessage({id:`${xs}buttons_${d.id}`})})}),c.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[c.jsx("h6",{children:e.formatMessage({id:`${xs}title`})}),c.jsx("p",{children:e.formatMessage({id:`${xs}text`})}),c.jsx(gr,{buttons:u})]})},tn={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-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:["news","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-click"},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","ai"],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"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Qn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Qn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Qn.support,gtmType:"concierge-email-click"},business:{email:Qn.general,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 rr="footer_",aa="SiteFooter",rd=({group:e})=>{const t=tn[e].order||[];let n=!1;return"text"in tn[e]&&(n=tn[e].text),c.jsxs(y.Fragment,{children:[c.jsx("p",{className:"pre-title",children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}`})}),Array.isArray(t)&&t.length>0&&c.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=tn[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),c.jsx("li",{children:c.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":aa,"data-gtm-event-type":a,...s,children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&c.jsx("dl",{className:"text-medium",children:n.order.map(r=>c.jsxs(y.Fragment,{children:[c.jsx("dt",{children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}`})}),c.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&c.jsx("address",{children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}_address`,values:{br:c.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&c.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":aa,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},cu=()=>c.jsx("div",{id:"footer",children:c.jsxs("div",{className:"wrapper",children:[c.jsx(la,{element:"hr"}),c.jsx(Po,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":aa,"data-gtm-event-type":"logo-homepage-link"}),c.jsx("footer",{children:["platform","community","company","contact"].map(e=>c.jsxs("div",{className:"group",children:[c.jsx(rd,{group:e}),Object.keys(tn[e]).includes("child")&&c.jsx(rd,{group:tn[e].child})]},e))}),c.jsx("hr",{}),c.jsxs("div",{className:"sub-footer",children:[c.jsx("ul",{children:Array.isArray(tn.social.order)&&tn.social.order.map(e=>{const t=tn.social[e];return c.jsx("li",{className:e,children:c.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":aa,"data-gtm-event-type":"social-click",children:c.jsx("span",{className:"hidden",children:c.jsx(ie.FormattedMessage,{id:`${rr}social_${e}`})})})},e)})}),c.jsx("small",{children:c.jsx(ie.FormattedMessage,{id:`${rr}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),We={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=a=>{const s=`logged${e?"In":"Out"}`;return t>=n[a][s]};let i={};return["navigation","search"].forEach(a=>{i[a]=r(a)}),i},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:i=!1})=>{if(!i&&n[e]===t||!i&&e===kt.ACCOUNT&&t===!1&&n[kt.SITE]===!0)return;const a=Date.now();if(!i&&!t&&We.handlerCalled[e]&&a-We.handlerCalled[e]<500)return;We.handlerCalled[e]=a;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case kt.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case kt.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case kt.ACCOUNT:o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const i=ld(e[r],t);if(!(typeof i>"u")&&(!n||i[t]&&i[t].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return e[r]}return e[0].children?We.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{var l;if(!t.current||!t.current.children)return;const a=n?"desktop":"default";if(r[e][a]){(l=document.querySelector(`#header ul a[href="${r[e][a]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case kt.SITE:if(n){const u=We.findFirstChild(t.current.children,"className","has-submenu parent"),d=We.findFirstChild(u.children,"id",kt.SITE);s=We.findFirstChild(d.children,"href")}else s=We.findFirstChild(t.current.children,"href");break;case kt.ACCOUNT:if(o=We.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=We.findFirstChild(o.children,"href");break;default:return}s&&(i([{type:`focusElements.${e}.${a}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(We.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(We.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(We.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{We.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},ni={order:["home","communities","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},communities:{href:"/communities/",gtmType:"communities-click",onlyShow:"logged-in"},topics:{order:["explore","topics"],menuId:"site-navigation",explore:{order:["events","courses","articles","communities"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"},communities:{href:"/communities/",gtmType:"communities-click",className:"icon communities"}},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:{menuId:"account-navigation",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:"/api/next-ui/login",withReturnTo:!0},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},sa=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:a=null})=>{const s=ie.useIntl(),o=ld(ni,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=a===null?l?o.doTrack:!0:a,d=e.includes("buttons.");let m=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(m+=`_logged${t?"In":"Out"}`);let h=!1;if(o.href){let C=o.gtmType||`${e}-click`;if(C.includes(".")){const A=C.split("."),E=A[A.length-2];C=`${E==="topics"?`${E}-`:""}${A[A.length-1]}`}h={href:o.withReturnTo?`${o.href}?returnTo=${window.location.pathname}`:o.href},u&&(h={...h,className:"gtm-trackable","data-gtm-event-type":C,"data-gtm-event-context":"HeaderButtons"}),d&&(h={...h,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const p=o.order&&o.order[0]&&o[o.order[0]],v=p&&o[o.order[0]].order,f=h&&window.location.pathname===o.href;let b={},g={},x={};if(f&&(b={...b,"aria-current":"page"}),p){const C=o.menuId||e,A={onClick:E=>We.events.onClick(E,{id:C,callback:i,isOpen:r[C]}),onFocus:()=>We.events.onFocus({id:C}),onBlur:()=>We.events.onBlur({id:C,callback:i}),onMouseLeave:()=>We.events.onBlur({id:C,callback:i}),onMouseEnter:()=>We.events.onMouseEnter({id:C,callback:i})};g={...A,id:C===kt.SITE?kt.SITE:kt.ACCOUNT},n&&(v&&(x={...A,className:"navigation-button",onKeyPress:E=>{E.key==="Enter"&&We.events.onClick(E,{id:C,callback:i,isOpen:r[C]})},"aria-haspopup":!0,"aria-expanded":r[C],"aria-controls":C}),g={...g,hidden:C in r?!r[C]:!0}),v||(g={...g})}return c.jsxs("li",{className:H({[o.className]:o.className,"has-submenu":p,parent:v,active:f}),...b,children:[h?y.createElement(d?Be:"a",h,s.formatMessage({id:m})):n&&o.order&&v?c.jsxs("button",{...x,children:[s.formatMessage({id:m}),c.jsx(Me,{children:s.formatMessage({id:`header_menu_${r[kt.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:m}),o.order&&c.jsx("ul",{...g,children:o.order.map(C=>{if(!o[C])return null;const A={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:l?u:null};return o[C].order?c.jsxs("li",{className:H({[o[C].className]:o[C].className}),children:[s.formatMessage({id:`${m}_${C}`}),c.jsx("ul",{children:o[C].order.map(E=>c.jsx(sa,{id:`${e}.${C}.${E}`,...A},E))})]},C):c.jsx(sa,{id:`${e}.${C}`,...A},C)})})]},e)};const j_={height:67,height_desktop:83};var kt=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(kt||{});const du=({showNavigation:e=!0})=>{const t=ie.useIntl(),n=y.useContext(st),r=xn(!0,!0),i=n&&typeof n.id=="string",a=y.useMemo(()=>We.getIsDesktopVersion(i,r),[i,r]),[s,o]=y.useReducer(ri,{headerIsVisible:!0,menus:{"site-navigation":!1,search:!1,"account-navigation":!1},focusElements:{"site-navigation":{desktop:!1,default:!1},"account-navigation":{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:d}=s,m=y.useRef(s);y.useEffect(()=>{m.current=s},[s]),pd({scrollPosition:j_[`height${a.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const g=m.current.menus;!a&&g["site-navigation"]||We.shouldChangeHeaderIsVisible(!0,g,o)},scrollDown:()=>{const g=m.current.menus;!a&&g["site-navigation"]||We.shouldChangeHeaderIsVisible(!1,g,o)}}});const h=(g,x,C=!1)=>{We.handleMenus({id:g,value:x,menus:m.current.menus,dispatch:o,forceHandle:C})},p=y.useRef(null),v=g=>{g.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(x=>{m.current.menus[x]&&h(x,!1,!0)})};y.useEffect(()=>{var g;return(g=document.getElementById("header"))==null||g.addEventListener("keydown",v),()=>{var x;(x=document.getElementById("header"))==null||x.removeEventListener("keydown",v)}},[]),or(()=>{u["site-navigation"]&&We.autoFocus({menu:"site-navigation",navigationRef:p,isDesktopVersion:a.navigation,focusElements:d,dispatch:o})},[u["site-navigation"]]),or(()=>{u["account-navigation"]&&We.autoFocus({menu:"account-navigation",navigationRef:p,isDesktopVersion:a.navigation,focusElements:d,dispatch:o})},[u["account-navigation"]]);const f=c.jsxs(c.Fragment,{children:[!a.search&&c.jsx("button",{className:"search toggle-search-button",onClick:g=>{g.preventDefault(),g.stopPropagation(),h("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:c.jsx(Me,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),c.jsx(sh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:a.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=c.jsxs(c.Fragment,{children:[!a.navigation&&c.jsx("button",{className:"menu-button gtm-trackable",onClick:g=>{g.preventDefault(),g.stopPropagation(),h("site-navigation",!u["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u["site-navigation"],"aria-controls":"site-navigation",children:c.jsx(Me,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),c.jsx("ul",{ref:p,id:"navigation",hidden:a.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!a.navigation&&u["account-navigation"]?"account":"default",children:ni.order.map(g=>c.jsx(sa,{id:g,isLoggedIn:i,isDesktopVersion:a.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:h},g))})]});return n&&n.isLoading?null:c.jsxs(c.Fragment,{children:[c.jsxs("nav",{id:"header",className:H({"logged-in":i,"logged-out":!i,visible:l}),children:[c.jsx(Me,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),c.jsx(Po,{variant:"monochrome"}),e&&c.jsxs(c.Fragment,{children:[a.navigation?c.jsxs(c.Fragment,{children:[b,f]}):c.jsxs(c.Fragment,{children:[f,b]}),i?c.jsxs("button",{className:"account-button",onClick:g=>We.events.onClick(g,{id:"account-navigation",callback:h,isOpen:u["account-navigation"]}),onMouseEnter:()=>We.events.onMouseEnter({id:"account-navigation",callback:h}),onMouseLeave:()=>We.events.onBlur({id:"account-navigation",callback:h}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[c.jsx(Me,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),c.jsx(on,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):c.jsx("ul",{className:"sign-in-buttons",children:ni.buttons.order.map(g=>c.jsx(sa,{id:`buttons.${g}`},g))})]})]}),c.jsx("hr",{id:"content-of-page"}),c.jsx("div",{className:H("overlay",{open:u["site-navigation"]||u["account-navigation"]||!a.search&&u.search})})]})};const P_=()=>{const e=ie.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(du,{}),c.jsx("div",{id:"content",children:c.jsx(Cn,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),c.jsx(cu,{})]})},lh=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:a={},className:s="",locale:o="en"})=>{const l=ie.useIntl(),{navigation:u=!0,footer:d=!0}=i,{background:m="default",variant:h="default",circle:p="default",modal:v="default"}=a,f=md(),[b,g]=y.useState(""),x=T=>{const{detail:{message:M}}=T;g(M)};y.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",x),()=>{document.removeEventListener("ariaLive",x)}),[f]);const C=ji(e,{locale:o}),A=ji(t,{locale:o}),E=ji(n,{locale:o}),_={};return m!=="default"&&(_[m]=!0),h!=="default"&&(_[h]=!0),p!=="default"&&(_[p]=!0),c.jsx(Sh.ErrorBoundary,{onError:r,fallback:c.jsx(P_,{}),children:c.jsxs(y.Suspense,{fallback:null,children:[c.jsxs("div",{id:"wrapper",className:H(s,_,{"has-footer":d}),"data-too-small":l.formatMessage({id:"pageLayout_browserTooSmall"}),children:[c.jsx(du,{showNavigation:u}),c.jsxs("main",{id:"content-wrapper",children:[A&&c.jsx("div",{className:H("additional-content prepended",{"large-modal":v==="large"}),children:A}),y.createElement(m==="bold"?yo:"div",{id:"content",children:C,className:H({"large-modal":v==="large"})})]}),E&&c.jsx("div",{className:"additional-content appended",children:E}),d&&c.jsx(cu,{}),c.jsx(uh,{})]}),b&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:b})]})})},id={default:"tags_",headerTopics:"header_topics_topics_"},Ds={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"},O_={getTagDetails:e=>{if(e.includes("topic_")){if(e=Ds.topic[e.replace("topic_","")],e){const t=ni.topics.topics[e].href;return t?{id:e,href:t,text:`${id.headerTopics}${e}`}:null}return null}return Ds[e]?(e=Ds[e],{id:e,text:`${id.default}${e}`}):null}};const M_=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:a="tag-click",gtmContext:s="tags"})=>{const o=ie.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const d=O_.getTagDetails(u);d&&l.push(d)}),l.length<1?null:c.jsx("ul",{className:H("tags text-small",t,i,{"one-line":n}),children:l.map(u=>{const d=o.formatMessage({id:u.text});return c.jsx("li",{children:u.href&&r?c.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":a,"data-gtm-event-context":s,children:d}):d},u.id)})})};const ch=25,N_=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:i=!1,loadNextPage:a=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:d=!1,className:m=""})=>{const h=ie.useIntl(),p="membersList",v=y.useContext(st),[f,b]=y.useState(!1);return e.length===0&&!d?null:c.jsxs("div",{className:H("members-list",m),children:[u?c.jsxs("h1",{children:[h.formatMessage({id:p}),c.jsx("span",{className:"count",children:t})]}):c.jsx(c.Fragment,{}),c.jsxs("ul",{children:[r?c.jsxs("li",{children:[c.jsx(rn,{member:v,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:n||""},{scope:dt.Platform,area:"all"}]}}),c.jsx(wn,{href:"/profiles/me",className:"text-small",onClick:g=>{g==null||g.preventDefault(),g==null||g.stopPropagation(),b(!0)},children:h.formatMessage({id:`${p}_profile`})})]}):c.jsx(c.Fragment,{}),e.map((g,x)=>v&&g.id===v.id?c.jsx(c.Fragment,{}):c.jsxs("li",{children:[c.jsx(rn,{member:g,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:n||""},{scope:dt.Platform,area:"all"}]}}),g.isAdmin&&c.jsx(Yt,{children:h.formatMessage({id:`${p}_admin`})})]},x)),d&&e.length===0&&t>0?[...new Array(Math.min(t,ch))].map((g,x)=>c.jsx("li",{children:c.jsx(ma,{layout:"member"})},x)):c.jsx(c.Fragment,{})]}),i&&c.jsx(ii,{hasNextPage:i,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},gtmContext:o}),s?c.jsx(Ea,{form:s,showModal:f,content:{title:h.formatMessage({id:`${p}_modal_title`})},functions:{onClose:()=>{b(!1)}}}):c.jsx(c.Fragment,{})]})},dh=N_,I_=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const i=ie.useIntl();return t?c.jsx("small",{children:$t(i.formatMessage,`${e}explainer`,n,"action",{a:a=>c.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:a})})}):c.jsx(c.Fragment,{})},R_=({intlPath:e,type:t,...n})=>{const r=ie.useIntl();return c.jsx(ru,{label:{visible:r.formatMessage({id:`${e}label`}),screenreader:$t(r.formatMessage,`${e}label_action`,t,"action")},...n})},ad=5,sd=2,$_=e=>{var r;let t=0;const n=[];return(r=e==null?void 0:e["poll-options"])==null||r.forEach((i,a)=>{i!==""&&(t++,n.push({position:t,description:{en:i}}))}),{title:{en:e.title},options:n,settings:{allow_multiple_votes:e["multiple-answers"]||!1}}};let Gn=null;const Qe="discussion_form_",si=({id:e,parentId:t,content:n={type:Te.Response,slugs:{}},userHasPermissions:r=!0,meta:i,placeholder:a,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},functions:u,data:d={},gtmContext:m="DiscussionForm"})=>{var Z,se,ve;const h=ie.useIntl(),p=y.useContext(st),[v,f]=y.useState(n.type),[b,g]=y.useState(""),{isLoading:x=!1,isInWrapper:C=!1,isInOverlay:A=!1,isAutoFocused:E=!1,isEditing:_=!1,hasTitleField:T=!1,canBePrepopulated:M=!1,isPrepopulated:O=!1,showTitle:L=!1,showGuidelines:$=!0,showDivider:B=!1,showSuccessMessage:F=!0,showPostType:S=!1,postCategories:N=[]}=i||{},{onChange:V=()=>{},create:W=()=>{},createPoll:ae=()=>Promise,handleSaveEdit:te=()=>{},handleCancel:D=()=>{},callback:Q=()=>{},onMention:Y=()=>{},listMembers:k=()=>Promise.resolve([]),clickMentionFallback:j=()=>{},getLinkPreview:q=()=>Promise.resolve({}),props:P={create:{projectNames:["questions-answers"]}}}=u,[z,ee]=y.useState({body:_&&_.text||O&&O.text||"",data:d!=null&&d.link?{link:d==null?void 0:d.link}:{}}),[U,X]=y.useState(l.error||!1),oe={status:!1,title:T&&T.text||"",polls:0},[J,pe]=y.useState(oe);y.useEffect(()=>{M&&!_&&O&&O!==z.body&&ee(ue=>({...ue,body:O.text||""}))},[O]),y.useEffect(()=>{f(n.type)},[n.type]);const de=Ur((ue,be)=>{ee(he=>({...he,body:ue,data:{link:be}})),V({body:ue});let Ee;!p||!p.id?Ee=$t(h.formatMessage,`${Qe}error_loggedOut`,v,"action"):r?s>0&&ue.length>=s&&(Ee=`${Qe}error_tooLong`):Ee=$t(h.formatMessage,`${Qe}error_noPermission`,v,"action"),Ee?X(Ee):U&&X(!1)},50);let ye=`${v}-form`;if(v===Te.Response||v===Te.Reply){const ue=((Z=n.slugs)==null?void 0:Z.reply)||((se=n.slugs)==null?void 0:se.answer)||((ve=n.slugs)==null?void 0:ve.question)||"";ue&&(ye=`${ye}-${ue.slice(-15)}`)}e&&(ye=`${e}-${ye}`);const Ae=async ue=>{if(!p||!p.id||!r||Ke)throw new Error("You do not have permission to post.");Gn&&clearTimeout(Gn),pe(Ee=>({...Ee,status:"submitting"}));const be=window.location.pathname;try{let Ee;switch(v){case Te.Post:Ee=await W({title:ue.title,content:ue.body,categories:ue.postType,data:ue.data});break;case Te.Poll:Ee=await ae($_(ue));break;case Te.Question:Ee=await W({title:ue.body,authorId:p&&p.id,data:ue.data,...P==null?void 0:P.create});break;case Te.Response:Ee=await W({questionSlug:n.slugs.question},{body:ue.body,authorId:p&&p.id,contentPath:be,data:ue.data});break;case Te.Reply:Ee=await W({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:ue.body,authorId:p&&p.id,contentPath:be,data:ue.data});break;default:break}return await Hh(1e3),Q&&await Q(Ee),Gn=setTimeout(()=>{ee({body:"",data:{}}),f(Te.Post),pe(Fe=>({...Fe,status:"submitted"})),g($t(h.formatMessage,`${Qe}success`,v,"action"));const he=new Event(it.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(he),Ce()},850),Ee}catch(Ee){const he=Ee;let Fe=`${Qe}error`;he!=null&&he.message.includes("entry already exists")&&(Fe=$t(h.formatMessage,`${Qe}error_alreadyExists`,v,"action")),he!=null&&he.message.includes("429")?Fe=$t(h.formatMessage,`${Qe}error_tooMany`,v,"action"):he!=null&&he.message.includes("400")&&(Fe=`${Qe}error`),X(Fe),Ce()}},Ce=()=>{Gn=setTimeout(()=>{X(!1),pe(oe),g("")},5e3)},Ve=Ur(async ue=>{const be={...z,...ue};if(_){pe(Ee=>({...Ee,status:"submitting"})),te(be);return}try{if(!await Ae(be))throw Error("No response from handleSubmit")}catch{Gn&&clearTimeout(Gn)}},100);if(x)return c.jsx(It,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const Le=!z.body||!Hr(z.body),ze=!J.title||!Hr(J.title);let Ke=!1;v!==Te.Poll&&(Ke=Le),T&&(Ke=Ke&&ze);const je=J.status==="submitting",Ne=[];v===Te.Poll?Ne.push({id:"poll-options",label:h.formatMessage({id:`${Qe}option_label`}),type:"multiple-inputs",element:"textarea",placeholder:h.formatMessage({id:`${Qe}option_placeholder`}),limit:100,multipleInputs:{showCount:!0,defaultInputs:sd,maxInputs:ad,hasButton:{variant:"secondary",size:"small",styling:{muted:!0},icon:"plus",children:h.formatMessage({id:`${Qe}option_cta`})}},styling:{autosizeToFit:!0},functions:{onChange:ue=>{var Ee;let be=0;ue&&Array.isArray(ue)&&(be=((Ee=ue==null?void 0:ue.filter(he=>he!==""))==null?void 0:Ee.length)||0),J.polls!==be&&pe(he=>({...he,polls:be})),V({polls:ue})}},validation:[{condition:"required"}]},{type:"checkbox",id:"multiple-answers",label:h.formatMessage({id:`${Qe}multiplePollAnswers`}),className:"text-medium"}):Ne.push({component:R_,props:{formID:ye,intlPath:Qe,showLabel:T!==!1,type:v}},{component:lu,props:{id:`${ye}-input`,value:J.status==="submitting"&&!U?"":z.body,placeholder:a||$t(h.formatMessage,`${Qe}placeholder`,v,"action"),maxLength:s,meta:{isInOverlay:A},functions:{onChange:de,onChangeData:ue=>{ee(be=>({...be,data:ue}))},onMention:Y,listMembers:k,clickMentionFallback:j,getLinkPreview:q},data:d,autoFocus:_!==!1||E&&!T,"aria-invalid":!!U,"aria-errormessage":"error-message"}},{component:I_,props:{intlPath:Qe,showGuidelines:$,type:v,gtmContext:m}}),B&&Ne.push({component:qt}),T&&Ne.unshift({id:"title",type:"textarea",value:T.text,limit:250,label:h.formatMessage({id:`${Qe}${v===Te.Poll?"question":"titleField"}_label`}),styling:{autosizeToFit:!0},placeholder:h.formatMessage({id:`${Qe}${v===Te.Poll?"question":"titleField"}_placeholder`}),functions:{onChange:ue=>{pe(be=>({...be,title:ue})),V({title:ue})}},validation:v===Te.Poll?[{condition:"required"}]:[]}),S&&Ne.unshift({id:"postType",type:"radio",value:"no-category",accessibilityOptions:{checkboxes:{navigateWithArrowKeys:!0}},styling:{displayOptionsAsPills:!0},label:h.formatMessage({id:`${Qe}postType_label`}),options:N.map(ue=>({id:ue.slug,label:ue.name})),validation:[{condition:"required"}],functions:{onChange:ue=>{V({postType:ue}),ue.includes(Te.Poll)?f(Te.Poll):v!==Te.Post&&f(Te.Post)}}});let we=!p||!p.id||!r||je;if(v===Te.Poll){const ue=J.polls;we=we||ze||ue<sd||ue>ad}else we=we||Ke,_&&(T?we=we||z.body===_.text&&J.title===T.text:we=we||z.body===_.text);return c.jsxs(c.Fragment,{children:[c.jsxs(Jt,{id:ye,className:H("discussion-card discussion-form",{"no-styling":C&&_}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:_&&!je||l.cancel},functions:{onSuccess:async ue=>{await Ve(ue)},onCancel:D},fields:Ne,intlPath:Qe,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":m,"data-gtm-event-type":`${_?"save":"submit"}-${v}-click`,"data-testid":"save-button",disabled:we,text:{default:!_&&(o!=null&&o.submit)?o==null?void 0:o.submit:h.formatMessage({id:`${Qe}${_?"save":"post"}`}),submitting:h.formatMessage({id:`${Qe}${_?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":m,"data-gtm-event-type":`cancel-${v}-click`,disabled:!l.cancel&&(!p||!p.id||!z.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:h.formatMessage({id:`${Qe}cancel`})},gtm:{context:m,event:`${v}-form`},"data-testid":`discussion-${v}-form`,children:[L&&!_&&v===Te.Question&&c.jsx("h2",{children:$t(h.formatMessage,`${Qe}title`,v,"action")}),c.jsx(rn,{member:p?{...p,link:!1}:"community",gtmContext:m,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:t||""},{scope:dt.Platform,area:"all"}]}})]}),J.status==="submitted"&&F&&c.jsx(ur,{className:"success","data-testid":"success",children:$t(h.formatMessage,`${Qe}success`,v,"action")}),U&&c.jsx(ur,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof U=="string"?U.includes(" ")?U:h.formatMessage({id:U},{action:h.formatMessage({id:`discussion_action_${v}`}),maxLength:s}):U}),b&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:b})]})},L_=Object.freeze(Object.defineProperty({__proto__:null,default:si},Symbol.toStringTag,{value:"Module"}));const z_={showForm:!1},Da=y.createContext(z_),fh=({children:e})=>{const[t,n]=y.useState({showForm:!1});return c.jsx(Da.Provider,{value:{...t,updateConversation:n},children:e})};function q_({author:e,originalAuthorId:t,createdAt:n,contentData:r,content:i,gtmContext:a,badges:s}){var m;const o="discussion_",l=ie.useIntl(),u=(m=i==null?void 0:i.componentProps)==null?void 0:m.member.additionalContent,d=u?u.customMessage:void 0;return c.jsxs("div",{className:"author-section",children:[c.jsx(rn,{member:e,additionalContent:{createdAt:n,didEdit:r.didEdit,customMessage:d},className:H({highlighted:typeof e!="string"&&e.id===t}),styling:{additionalContentNewLine:!!d},gtmContext:a,gtmType:"profile-click",badges:s}),i.pinned&&c.jsx(Yt,{variant:"naked",size:"xlarge",icon:"pin",children:c.jsx(Me,{children:l.formatMessage({id:`${o}pinned_post`})})})]})}const Es=({children:e,class:t,...n})=>{const r={...n,class:H("subtle",t)};return c.jsx("blockquote",{...r,children:e})};function U_({content:e}){var t;return!e||!((t=e.categories)!=null&&t.length)?c.jsx(c.Fragment,{}):c.jsx("ul",{className:"categories-list",children:e.categories.map(n=>!n.slug||!n.name?c.jsx(c.Fragment,{}):c.jsx(Yt,{size:"small",element:"li",children:n.name},n.slug))})}var oa=(e=>(e.Always="always",e.AfterVoting="after-voting",e))(oa||{});const W_=(e,t,n)=>n===void 0?0:e.some(i=>i.hasUserVoted)?t?e.findIndex(i=>!i.hasUserVoted):e.findIndex(i=>i.hasUserVoted):0,V_=(e,t,n,r=0)=>{if(!e)return{nextElement:null,nextIndex:0};let i=n==="next"?e.nextElementSibling:e.previousElementSibling,a=r+(n==="next"?1:-1);for(;i;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}const s=e.parentElement;if(s)for(i=n==="next"?s.firstElementChild:s.lastElementChild,a=n==="next"?0:s.childElementCount-1;i&&i!==e;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}return{nextElement:null,nextIndex:0}};const H_=({user:e,option:t,optionIndex:n,totalPollVotes:r=0,allowMultipleVotes:i=!1,showResults:a=!1,hasVotedOnPoll:s=!1,isTabbable:o=!1,functions:l})=>{var b;const[u,d]=y.useState(t.hasUserVoted);let m=0,h={};const p=(i||!s)&&!t.hasUserVoted;a&&(m=Math.round(t.numVotes/r*100)||0,h={"--vote-perc":`${m}%`});const v=g=>{g.stopPropagation(),p&&(l==null||l.createVote(t),d(!0))},f={htmlFor:t.id,className:H({"can-vote":p}),tabIndex:o&&p?0:-1,"data-testid":"poll-option-label","data-gtm-event-type":"poll-option-click","data-gtm-event-context":"PollOption","aria-selected":t.hasUserVoted,onClick:v,onKeyDown:g=>{var x;if(g.code!=="Tab")switch(g.code){case"Enter":case"Space":g.preventDefault(),g.stopPropagation(),v(g),d(!0);break;case"ArrowUp":case"ArrowDown":g.stopPropagation(),g.preventDefault();const C=g.code==="ArrowUp"?"prev":"next",{nextElement:A,nextIndex:E}=V_(g.currentTarget.parentElement,"selected",C,n);A&&((x=A.querySelector("label"))==null||x.focus(),l==null||l.setTabbableOption(E));break}}};return c.jsxs("li",{"data-testid":"poll-option",style:h,className:H("poll-option text-small",{selected:t.hasUserVoted}),children:[c.jsx("label",{...f,children:c.jsx("span",{children:t.label})}),a&&c.jsxs("div",{className:"vote-details",children:[t.hasUserVoted&&c.jsx(on,{className:"author-profile-picture",name:e.name,src:(b=e==null?void 0:e.image)==null?void 0:b.thumbnail}),c.jsxs("p",{className:"vote-perc text-medium","data-testid":"vote-perc",children:[m,"%"]})]}),c.jsx("input",{type:i?"radio":"checkbox",id:t.id,name:t.id,checked:u,tabIndex:-1})]})};const mh=({title:e,options:t,settings:n,functions:r})=>{const i="poll_",a=ie.useIntl(),s=y.useContext(st),{showRemoveVote:o=!1,allowMultipleVotes:l=!1,resultsVisibility:u=oa.AfterVoting}=n||{},[d,m]=y.useState(W_(t,l,s==null?void 0:s.id)),h=t.reduce((g,x)=>g+x.numVotes,0),p=t.filter(g=>g.hasUserVoted).length,v=t.filter(g=>g.hasUserVoted),f=y.useCallback(async g=>{await r.createVote({reactionId:g.id})},[]),b=y.useCallback(async()=>{t.forEach(async g=>{g.hasUserVoted&&g.userVote&&r.removeVote({reactionId:g.userVote.id})})},[t]);return c.jsxs("div",{className:"poll-wrapper",children:[c.jsx("p",{className:"poll-title",children:e}),c.jsxs("aside",{className:"poll-info",children:[c.jsx("p",{className:"poll-instructions","data-testid":"poll-instructions",children:c.jsx("small",{children:a.formatMessage({id:`${i}instructions`},{allowMultipleVotes:l})})}),c.jsx("p",{className:"poll-num-votes",children:c.jsx("small",{"data-testid":"poll-total-votes",children:a.formatMessage({id:`${i}num_votes`},{number:h})})}),o&&c.jsx("p",{className:"poll-remove-vote",children:c.jsx(Be,{variant:"tertiary",onClick:b,"data-testid":"remove-votes-button",disabled:p===0,children:c.jsx("small",{children:a.formatMessage({id:`${i}remove_vote_button`},{number:p})})})})]}),t&&c.jsx("form",{children:c.jsx("fieldset",{children:c.jsx("ul",{className:"poll-options",children:t==null?void 0:t.map((g,x)=>c.jsx(H_,{isTabbable:d===x,user:s,option:g,optionIndex:x,totalPollVotes:h,showResults:u==oa.Always||!!p,allowMultipleVotes:l,hasVotedOnPoll:!!p,functions:{createVote:f,setTabbableOption:m}},g.id))})})}),c.jsxs(Me,{"aria-live":"polite",children:[a.formatMessage({id:`${i}aria_votes`},{number:p}),!!p&&c.jsx("ul",{children:v.map(g=>c.jsx("li",{children:g.label}))})]})]})};function K_({content:e,contentData:t,functions:n}){return c.jsx(mh,{title:t.title,options:(e==null?void 0:e.pollOptions)||[],settings:(e==null?void 0:e.pollSettings)||{},functions:{createVote:n.createVote,removeVote:n.removeVote}})}function Z_({links:e={},contentData:t,postCutOff:n,content:r}){var i;return c.jsxs(c.Fragment,{children:[e.post?c.jsxs("a",{href:e.post,children:[(t==null?void 0:t.title)&&c.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),t.postBody.length>n?c.jsx(Sd,{text:t.postBody,markdownOptions:{overrides:{a:Ps,blockquote:{component:Es}}}}):c.jsx(Pn,{options:{overrides:{a:Ps,blockquote:{component:Es}}},children:t.postBody})]}):c.jsxs(c.Fragment,{children:[(t==null?void 0:t.title)&&c.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),c.jsx(Pn,{options:{wrapper:r.type===Te.Question?"h1":y.Fragment,forceWrapper:r.type===Te.Question,forceInline:r.type===Te.Question,forceBlock:r.type!==Te.Question,overrides:{blockquote:{component:Es}}},children:t.postBody})]}),(i=t.data)!=null&&i.link?c.jsx(jo,{data:t.data.link}):c.jsx(c.Fragment,{})]})}const Rt="discussion_",Y_=195;let Ai=null;const oi=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:i=!1,originalAuthorId:a,forceHide:s,functions:o,links:l={},className:u,gtmContext:d="DiscussionAnswer",children:m,isTruncated:h=!1,setFocus:p=!1,isCommunity:v=!1,badges:f,basePath:b,parentId:g,locale:x="en"})=>{var Z,se,ve,ue,be,Ee;const C=ie.useIntl(),A=y.useContext(Da),E=y.useContext(st),{createContent:_=async()=>{},deleteContent:T=async()=>{},updateContent:M=async()=>{}}=o.content||{},{createLike:O=()=>{},deleteLike:L=()=>{},listLikes:$=async()=>({})}=o.likes||{},{openComments:B=()=>{}}=o.comments||{},{listMembers:F=()=>Promise.resolve([]),clickMentionFallback:S=()=>{}}=o.form||{},{createVote:N=()=>{},removeVote:V=()=>{},removePoll:W=()=>{}}=o.polls||{},{author:ae,canLike:te,createdAt:D,id:Q,likes:Y=0,userLiked:k,comments:j=0,data:q}=t,P=sv(t.title,x),z=E&&E.id&&typeof ae!="string"&&ae.id&&ae.id===E.id||!1,ee=typeof te=="boolean"?te:!0,U=z&&(!t.createdAt||Wh(t.createdAt,10,"seconds")),X=y.useRef(null),[oe,J]=y.useState({title:t.body!==P&&P||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:"",data:t&&t.data||{}}),[pe,de]=y.useState(!1),[ye,Ae]=y.useState(U?"highlighted":"default"),[Ce,Ve]=y.useState("");y.useEffect(()=>{const he=X.current;if(!(!he||ye==="default"))return document.addEventListener(it.DISCUSSION_FORM_SUBMITTED,Le),he.addEventListener("transitionend",ze),()=>{document.removeEventListener(it.DISCUSSION_FORM_SUBMITTED,Le),he.removeEventListener("transitionend",ze)}},[]),y.useEffect(()=>{J(he=>({...he,title:t&&P||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1,data:t&&t.data||{}}))},[t.isEdited]),y.useEffect(()=>{(async()=>{const Fe=await To(oe.body,h,q==null?void 0:q.mentions,F);J(ot=>({...ot,postBody:Fe}))})()},[oe.body,q==null?void 0:q.mentions]);const Le=()=>{setTimeout(()=>{Ae("fading")},1e3)},ze=({propertyName:he})=>{he==="background-color"&&Ae(Fe=>(Fe==="default"&&(document.removeEventListener(it.DISCUSSION_FORM_SUBMITTED,Le),X.current&&X.current.removeEventListener("transitionend",ze)),Fe==="fading"?"default":Fe))};if(i||!t||t.type===Te.Answer&&(!t.slugs||!t.slugs.question)||oe.postBody===""&&t.title==="")return c.jsx(It,{className:"discussion-card"});const Ke=async({title:he,body:Fe,data:ot})=>{he||(he=""),Fe||(Fe=""),Ve("");try{if(!qi(he,oe.title)||!qi(Fe,oe.body)){const et=t.type===Te.Question?{title:Fe}:{title:he,body:Fe,data:ot};await M(Rs(t.slugs),et)}J(et=>({...et,title:he||"",body:Fe||"",data:{...et.data,...ot},isEditing:!1,didEdit:!0}))}catch{Ve(`${Rt}form_error`)}},je=()=>{if(A&&A.updateConversation){const he={showForm:!0},Fe=t.author;Fe&&Fe.id&&(v&&(he.prepopulateForm=`@{{${Fe.id}}}`),he.mentionData={id:Fe.id,name:Fe.name}),A.updateConversation(he)}setTimeout(()=>{var tt,_t,ct;const Fe=`reply-form-${(t.type===Te.Answer?t.slug:((tt=t.slugs)==null?void 0:tt.reply)||((_t=t.slugs)==null?void 0:_t.answer)||((ct=t.slugs)==null?void 0:ct.question)||"").toLowerCase().slice(-15)}`,ot=document.getElementById(Fe),et=document.getElementById(`${Fe}-input`);et&&et.focus(),ot&&ot.scrollIntoView({behavior:"smooth"})},0)},Ne=async()=>{de(!1);try{t.type===Te.Poll?(await W(),window.location.href=`${b}/${g}`):await T(Rs(t.slugs))}catch{Ve("delete-error")}},we=[];return n&&z&&(t.type!==Te.Poll&&we.push({text:C.formatMessage({id:`${Rt}moreMenu_edit`}),onClick:()=>J(he=>({...he,isEditing:!0})),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),we.push({text:C.formatMessage({id:`${Rt}moreMenu_delete`}),onClick:he=>{he.preventDefault(),he.stopPropagation(),de(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`delete-${t.type}-click`,...af(`delete-${t.slug}-modal`,pe)})),r&&o.pins&&we.push({text:C.formatMessage({id:`${Rt}moreMenu_${t.pinned?"unpin":"pin"}`}),onClick:t.pinned?o.pins.deletePin:o.pins.createPin,icon:t.pinned?"unpin":"pin",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),p&&((Z=X==null?void 0:X.current)==null||Z.focus(),(se=X==null?void 0:X.current)==null||se.scrollIntoView({behavior:"smooth"})),y.createElement(e,{className:H("discussion-post",u,{[ye]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!oe.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:X,tabIndex:p?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${d}-post-click`,onClick:he=>{if(!l.post||oe.isEditing||t.type===Te.Poll&&av(he,["poll-options","poll-info"],"discussion-post"))return;he.preventDefault(),he.stopPropagation(),Ai&&clearTimeout(Ai),Ai=setTimeout(()=>{window.location.href=l.post},150);const Fe=new CustomEvent(it.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:Ai}});document.dispatchEvent(Fe)},children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{id:Q||t.slug,className:H("discussion-card text-medium",t.type,{editing:oe.isEditing,"has-link":l.post&&!oe.isEditing}),children:[!oe.isEditing&&c.jsx(q_,{author:ae,originalAuthorId:a,createdAt:D,contentData:{didEdit:oe.didEdit},content:t,gtmContext:d,badges:f}),oe.isEditing?c.jsx(si,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:i,isInWrapper:!0,hasTitleField:oe.title!==""?{text:oe.title}:!1,isEditing:{text:oe.body,categories:[]},canBePrepopulated:v,isPrepopulated:!1},maxLength:t.type===Te.Question?250:5e4,forceShow:{error:Ce!==""&&Ce!=="delete-error"?C.formatMessage({id:Ce},{action:C.formatMessage({id:`${Rt}action_${t.type}`})}):!1},functions:{create:_,handleSaveEdit:Ke,handleCancel:()=>{Ve(""),J(he=>({...he,isEditing:!1}))},listMembers:F,clickMentionFallback:S},gtmContext:`${d}Form`,data:q}):c.jsxs(c.Fragment,{children:[t.type===Te.Poll?c.jsx(K_,{content:t,contentData:oe,functions:{createVote:N,removeVote:V}}):c.jsx(Z_,{links:l,contentData:oe,postCutOff:Y_,content:t}),c.jsx(U_,{content:t})]}),!oe.isEditing&&!(s!=null&&s.actionBar)&&c.jsx(xf,{className:t.type,gtmContext:d,contentType:t.type,likes:s!=null&&s.likes?!1:{count:Y||0,userLiked:k||!1,canLike:ee,peopleWhoLiked:t.peopleWhoLiked,activityId:t.id||t.slug,content:{slugs:t.slugs||{},slug:t.slug},functions:{createLike:O,deleteLike:L,listLikes:$},basePath:b,parentId:g},comments:!(s!=null&&s.comments)&&([Te.Question,Te.Post].includes(t.type)||l.comments)?{count:j||0,functions:{onClick:()=>{l!=null&&l.comments&&(window.location.href=l.comments),typeof B=="function"&&B()}}}:!1,replies:t.type==="answer"||t.type==="reply"?{functions:{onClick:je}}:!1,shareLink:{url:`${window.location.origin}${(ve=t.slugs)==null?void 0:ve.question}/${(ue=t.slugs)==null?void 0:ue.answer}${(be=t.slugs)!=null&&be.reply?`#${(Ee=t.slugs)==null?void 0:Ee.reply}`:""}`},moreMenu:{options:we,contentSlug:t.slug,reportData:{contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}}})]}),m,c.jsx(un,{id:`delete-${t.slug}-modal`,isOpen:pe,functions:{onOpen:()=>{},onClose:()=>de(!1)},forceShow:{error:Ce==="delete-error"?C.formatMessage({id:"${intlPath}delete_error"},{action:C.formatMessage({id:`${Rt}action_${t.type}`})}):!1},title:C.formatMessage({id:`${Rt}delete_title`},{action:C.formatMessage({id:`${Rt}action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>de(!1),children:C.formatMessage({id:`${Rt}delete_cancel`})},{variant:"primary",className:"destructive",onClick:Ne,children:C.formatMessage({id:`${Rt}delete_delete`})}],gtmContext:`${(t.type||"").charAt(0).toUpperCase()}${(t.type||"").slice(1)}:${t.slug}`,children:c.jsx(ie.FormattedMessage,{id:"discussion_delete_text",values:{p:he=>c.jsx("p",{children:he}),action:C.formatMessage({id:`${Rt}action_${t.type}`})}})})]})})};const G_=y.lazy(()=>Promise.resolve().then(()=>ck)),Q_=65,hh=({forceShow:e,form:t,className:n})=>{const r=ie.useIntl(),i="discussionFormCard_",a="DiscardDraftModal",o=y.useContext(st)||"community",l=ha(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const u=xn(!0,!1),d=u?u<768:0,{modal:m=!1}=e||{},[h,p]=y.useState({form:m||kd("showPost")==="true"||!1,warning:!1}),[v,f]=y.useState({showCachedText:!1});y.useEffect(()=>{if(!v.showCachedText)return;(async()=>{const C=await To(v.title||v.body||"",Q_,v.mentions);f(A=>({...A,prettifiedText:C}))})()},[v.showCachedText,v.title,v.body]);const b=x=>{if(!v.showCachedText||typeof h.warning=="string")return;let C;if("detail"in x&&x.detail.link)x.detail.timeout&&clearTimeout(x.detail.timeout),C=x.detail.link;else{const A=x;A.preventDefault(),A.stopPropagation();const _=A.target.closest("a");C=_&&_.getAttribute("href")}p(A=>({...A,warning:C||!1}))};y.useEffect(()=>{if(!v.showCachedText){document.removeEventListener(it.DISCUSSION_POST_CLICKED,b),document.removeEventListener(it.MEMBER_CLICKED,b),document.removeEventListener("click",b);return}return document.addEventListener(it.DISCUSSION_POST_CLICKED,b),document.addEventListener(it.MEMBER_CLICKED,b),document.addEventListener("click",b),()=>{document.removeEventListener(it.DISCUSSION_POST_CLICKED,b),document.removeEventListener(it.MEMBER_CLICKED,b),document.removeEventListener("click",b)}},[v.showCachedText]),y.useEffect(()=>{const x=C=>{if(!(!v.showCachedText||h.warning!==!1))return C.preventDefault(),C.returnValue=""};return window.addEventListener("beforeunload",x,{capture:!0}),()=>{window.removeEventListener("beforeunload",x,{capture:!0})}},[v.showCachedText,h.warning]);let g=r.formatMessage({id:`${i}placeholder${d?"":"_long"}`});return v.showCachedText&&(v.title||v.body)&&(g=v.prettifiedText||g),c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:H("discussion-form-card",n),onClick:x=>{x.preventDefault(),x.stopPropagation(),p(C=>({...C,form:!0}))},"data-testid":"discussion-form-card",children:[c.jsx(on,{name:l.name,src:l.image,alt:""}),c.jsx(Pn,{className:H("input",{placeholder:!v.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:jt,blockquote:jt,br:jt,em:jt,li:jt,ol:jt,p:jt,s:jt,span:jt,strong:jt,ul:jt}},children:g})]}),c.jsxs(vr,{children:[c.jsx(G_,{showModal:h.form,functions:{cacheText:f,onClose:()=>{p(x=>({...x,form:!1}))}},form:t,cachedText:v,className:"in-portal"}),c.jsx(un,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:h.warning!==!1,functions:{onClose:()=>{p(x=>({...x,warning:!1}))}},title:r.formatMessage({id:`${i}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${i}overlay_cta_discard`}),onClick:x=>{x.preventDefault(),x.stopPropagation(),typeof h.warning=="string"&&(window.location.href=h.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":a},{variant:"primary",children:r.formatMessage({id:`${i}overlay_cta_continue`}),onClick:()=>{p({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":a}],children:c.jsx("p",{children:r.formatMessage({id:`${i}overlay_text`})})})]})]})},J_=y.lazy(()=>Promise.resolve().then(()=>L_)),fu=({isCard:e=!1,form:t,parentId:n,categories:r,membershipRequiredToPost:{isMember:i,required:a,join:s,leave:o,notMemberStateText:l},locale:u=Do})=>{if(a&&!i)return c.jsx(Cn,{text:l,button:{breakpoints:{mobile:!0,901:!1},component:c.jsx(Co,{isShort:!0,functions:{join:s,leave:o}})}});const{content:d,functions:m,meta:h,...p}=t,v={content:{type:(d==null?void 0:d.type)||"reply",slugs:(d==null?void 0:d.slugs)||{}},functions:{...m,create:(m==null?void 0:m.create)||(()=>{})},parentId:n,meta:{...h,isEditing:(h==null?void 0:h.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1,postCategories:[{name:"Post",slug:"no-category"},...r||[]]},...p,id:`add-post-${p.id||""}`};return e?c.jsx(hh,{form:v}):c.jsx(J_,{...v})},mu=({form:e})=>{const t=y.useContext(st),n=ie.useIntl(),[r,i]=y.useState(!1),a=()=>{Xh(t)||i(!0)};y.useEffect(()=>(document.addEventListener(it.DISCUSSION_POST_ADDED,a),()=>{document.removeEventListener(it.DISCUSSION_POST_ADDED,a)}));const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),c.jsx(Ea,{form:e,showModal:r,functions:{onClose:()=>{i(!1)}},content:s})};const _s="discussion_responses_",ph=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=ie.useIntl();return t=parseInt(t),c.jsxs("div",{className:"responses-heading",children:[c.jsx("h4",{children:r.formatMessage({id:`${_s}title`},{action:r.formatMessage({id:`${_s}${e}`}),count:t})}),!n&&t===0&&c.jsx("p",{children:$t(r.formatMessage,`${_s}empty`,e,e)})]})};const gh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const a=ie.useIntl(),s=y.useContext(Da),o=ji(i,{element:"li"});if(s.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:s.prepopulateForm},s.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=s.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:s.mentionData},r.data=l,r.meta.isAutoFocused=!0}return c.jsxs("div",{className:H("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&c.jsx("ul",{className:"thread",children:o}),!e&&c.jsx(ii,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:a.formatMessage({id:"discussion_thread_loadMore"}),error:a.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&c.jsx(si,{...r})]})};function X_(e){var n,r;let t=!1;return(r=(n=e.latest_reactions)==null?void 0:n["poll-option"])==null||r.forEach(i=>{var a,s;(s=(a=i.own_children)==null?void 0:a["poll-vote"])!=null&&s.length&&(t=!0)}),t}function ek({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=$e.useMutation({mutationFn:e,onMutate:({reactionId:o})=>t(l=>(of({activity:l,reactionId:o,user:a}),l)),onError:n,onSuccess:(o,{reactionId:l},u)=>{u&&uf({activity:u,reactionId:l,correctReactionId:o.body.id,user:a}),r.setQueryData(i,u)}});return s}function tk({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=$e.useMutation({mutationFn:e,onMutate:({content:i,title:a})=>t(s=>(s&&(i!=null&&(s.content=i),a!=null&&(s.title=a)),s)),onError:n});return r}function nk({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=$e.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Yi({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Yi({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function rk({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=$e.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Gi({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Gi({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function ik({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,isFetching:a}=$e.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:i,isFetching:a}}function ak({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=$e.useMutation({mutationFn:e,onMutate:({reactionId:a})=>t(s=>(lf({activity:s,reactionId:a}),s)),onError:n});return i}function sk({queryFns:{read:e,edit:t,like:n,unlike:r,pin:i,unpin:a,createVote:s,removeVote:o},queryKey:l}){const u=$e.useQueryClient(),d=fa(),m={queryClient:u,queryKey:l},h={mutationHandlers:{error:Eo(m),mutate:_o(m)},user:d,...m},p=tk({...h,mutationFn:t}),v=nk({...h,mutationFn:n}),f=ok({...h,mutationFn:r}),b=rk({...h,mutationFn:i}),g=uk({...h,mutationFn:a}),x=ek({...h,mutationFn:s}),C=ak({...h,mutationFn:o}),{activity:A,...E}=ik({queryKey:l,queryFn:e});return{activity:A,mutations:{edit:p,like:v,unlike:f,pin:b,unpin:g,createVote:x,removeVote:C},user:d,...E}}function ok({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=$e.useMutation({mutationFn:e,onMutate:a=>t(s=>(s&&cf({activity:s,user:r}),s)),onError:n});return i}function uk({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=$e.useMutation({mutationFn:e,onMutate:a=>(console.log("unpin"),t(s=>(s&&df({activity:s,user:r}),s))),onError:n});return i}const lk=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:i,functions:{activities:{remove:a,...s},likes:o,reactions:l,form:u,join:d,leave:m,polls:h},profile:p,categories:v,locale:f=Do})=>{var Y,k,j,q,P,z,ee,U,X,oe,J,pe;const b=ie.useIntl(),g={...s,...h},{activity:x,error:C,isLoading:A,mutations:{edit:E,like:_,unlike:T,pin:M,unpin:O,createVote:L,removeVote:$}}=sk({queryFns:g,queryKey:[e,t,n]});if(A)return c.jsx(It,{style:{height:"400px"}});if(C||!x)return c.jsx(Cn,{variant:"error",text:b.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:B,verb:F,latest_reactions:S,mentioned_users:N,additional_data:V}=x,W=(((Y=S==null?void 0:S.like)==null?void 0:Y.length)||0)>0,ae=(((k=B==null?void 0:B.like)==null?void 0:k.length)||0)>0,te=ae?B==null?void 0:B.like[0].id:"",D=W?(j=S==null?void 0:S.like)==null?void 0:j.map(de=>{var ye,Ae,Ce;return{id:(ye=de==null?void 0:de.user)==null?void 0:ye.id,name:(Ce=(Ae=de==null?void 0:de.user)==null?void 0:Ae.data)==null?void 0:Ce.name}}):!1,Q=x==null?void 0:x.actor;return c.jsxs("section",{className:"activity-section",children:[c.jsx(oi,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:F,title:x==null?void 0:x.title,body:x==null?void 0:x.content,categories:So((x==null?void 0:x.categories)||[],v||[]),canLike:r,createdAt:(x==null?void 0:x.time)||"",slugs:{question:`${e}/${t}`,answer:x==null?void 0:x.id},slug:n,author:yr(Q),userLiked:ae,likes:((q=x==null?void 0:x.reaction_counts)==null?void 0:q.like)||0,comments:(x==null?void 0:x.total_replies)||0,peopleWhoLiked:D,data:{mentions:N,...V||{}},pinned:((P=x==null?void 0:x.reaction_counts)==null?void 0:P.pin)&&((z=x==null?void 0:x.reaction_counts)==null?void 0:z.pin)>0||!1,pollOptions:sf(x,f),pollSettings:{showRemoveVote:(ee=x==null?void 0:x.settings)==null?void 0:ee.show_remove_vote,allowMultipleVotes:(U=x==null?void 0:x.settings)==null?void 0:U.allow_multiple_votes,deadlineAt:(X=x==null?void 0:x.settings)==null?void 0:X.deadline_at,hideParticipants:(oe=x==null?void 0:x.settings)==null?void 0:oe.hide_participants,numberOfWinners:(J=x==null?void 0:x.settings)==null?void 0:J.number_of_winners,resultsVisibility:(pe=x==null?void 0:x.settings)==null?void 0:pe.results_visibility}},originalAuthorId:Q==null?void 0:Q.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(de,{title:ye,body:Ae})=>E({title:ye,content:Ae})},likes:{createLike:()=>_({activityId:n}),deleteLike:()=>T({activityId:n,reactionId:te}),listLikes:de=>o.list({activityId:n,...de})},comments:{openComments:()=>{}},pins:{createPin:()=>M({activityId:n}),deletePin:()=>{var de;return O({activityId:n,reactionId:(de=S==null?void 0:S.pin)==null?void 0:de[0].id})}},polls:{createVote:({reactionId:de})=>L({reactionId:de}),removeVote:({reactionId:de})=>$({reactionId:de}),removePoll:()=>h.removePoll({activityId:n})},form:u},styling:{showShareLinkButton:!0},userHasOwnerPermissions:i,badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:t||""},{scope:dt.Platform,area:"all"}]},basePath:e,parentId:t},n),c.jsx(gf,{basePath:e,parentId:t,activityId:n,showReplies:F===Te.Poll?X_(x):!0,activityTotalReplies:(x==null?void 0:x.total_replies)||0,isMember:r,functions:{reactions:l,likes:o,form:u,join:d,leave:m},profile:p})]})};const vh=({showModal:e=!0,functions:t,form:n,cachedText:r,className:i})=>{const a=ie.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:d,functions:m}=n,{title:h="",body:p="",mentions:v}=r||{},f="discussion-form-modal";return c.jsx(un,{id:f,title:a.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(h!==""||p!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:H("discussion-form-modal",i),children:c.jsx(si,{...n,data:{...u,mentions:v||(u==null?void 0:u.mentions)},meta:{...d,isAutoFocused:!0,isInOverlay:`${f}-overlay`,hasTitleField:{text:h},isPrepopulated:{text:p||(d==null?void 0:d.isPrepopulated)!==!1&&(d==null?void 0:d.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0,showPostType:!0},buttons:{submit:a.formatMessage({id:`${s}cta`})},functions:{...m,onChange:b=>{l(g=>({...g,...b}))},onMention:({id:b,name:g}={})=>{if(!b||!g)return;const x=v||{};x[b]={created_at:"",updated_at:"",id:b,data:{name:g}},l(C=>({...C,mentions:x}))},create:async b=>{o(),m.create&&await m.create(b),l({showCachedText:!1})},createPoll:async b=>{const g=()=>{o(),l({showCachedText:!1})};if(m.createPoll)try{const x=await m.createPoll(b);return new Promise(C=>(g(),C(x)))}catch{return new Promise((C,A)=>A())}else return g(),new Promise(x=>x({}))},handleSaveEdit:async b=>{o(),m.handleSaveEdit&&await m.handleSaveEdit(b),l({showCachedText:!1})}}})})},ck=Object.freeze(Object.defineProperty({__proto__:null,default:vh},Symbol.toStringTag,{value:"Module"}));const dk=({className:e,showModal:t=!0,title:n,messagePlaceholder:r,formTitle:i,formLabel:a,ctaMessage:s,showIcon:o,onClose:l,reportError:u=()=>{},sendInvites:d})=>{const m=ie.useIntl();return i||(i=m.formatMessage({id:"inviteModal_formTitle"})),a||(a=m.formatMessage({id:"inviteModal_formLabel"})),s||(s=m.formatMessage({id:"inviteModal_cta"})),c.jsx(un,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:o,functions:{onClose:l},className:H("invite-modal",e,{success:!!n}),children:c.jsx(rh,{title:i,label:a,messagePlaceholder:r,ctaMessage:s,onClose:l,sendInvites:d,reportError:u})})};const fk=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:i,form:a,className:s})=>{const o=ie.useIntl(),[l,u]=y.useState(kd("showProfile")==="true"||e);y.useEffect(()=>{u(e)},[e]);const{onClose:d=()=>{}}=i;return c.jsx(un,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:d},className:H("profile-modal",s,{success:!!t}),maxWidth:700,children:c.jsxs(c.Fragment,{children:[t&&n||r?c.jsxs("div",{className:"intro",children:[t&&n?c.jsx("h3",{children:n}):"",r?c.jsx("p",{children:r}):""]}):null,c.jsx(ih,{...a,meta:{shouldShowCancelButton:!1},functions:{...(a==null?void 0:a.functions)||{},onSuccess:async m=>{var h;try{(h=a==null?void 0:a.functions)!=null&&h.onSuccess&&await a.functions.onSuccess(m)}finally{d()}}}})]})})},Ea=fk,mk=Object.freeze(Object.defineProperty({__proto__:null,default:Ea},Symbol.toStringTag,{value:"Module"}));const hk=({members:e})=>{const[t,n]=y.useState(!1),r=i=>{const{fullName:a,jobTitle:s,organisation:o,photo:l}=i||{};return c.jsxs(c.Fragment,{children:[c.jsx(on,{name:a,src:l}),c.jsx("p",{children:a}),c.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return c.jsxs("div",{className:"directory-wrapper",children:[c.jsx("ul",{className:"directory",children:e.map(i=>c.jsx("li",{children:c.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),c.jsx(un,{isOpen:t!==!1,children:t===!1?"":c.jsxs(c.Fragment,{children:[r(t),c.jsx(Pn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const pk=({author:e,authorCite:t,content:n,member:r,className:i=""})=>c.jsxs("blockquote",{className:H("testimonial-block",i),children:[c.jsx(Zt,{className:"testimonial",children:n}),r?c.jsx(rn,{member:r,styling:{size:"large"}}):c.jsxs(c.Fragment,{children:[e&&c.jsx("p",{className:H("author",{"text-small":!i.includes("new")}),children:e}),t&&c.jsx("p",{className:H("author-cite",{"text-small":!i.includes("new")}),children:c.jsx("cite",{children:t})})]})]}),gk=y.memo(pk);const vk=({items:e=[],selector:t="",className:n=""})=>{const r=ie.useIntl(),[i,a]=y.useState(e);return y.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,d)=>{s+=`${d>0?", ":""}${t} h${d+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));a(l)},[]),i&&i.length>0&&c.jsxs(Ft,{variant:"subtle",className:H("table-of-contents",n),children:[c.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),c.jsx("nav",{children:c.jsx("ul",{children:i.map(({id:s,text:o})=>c.jsx("li",{children:c.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const _a=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:i=""})=>{const a=ie.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=d=>{const m=d/60,h=Math.floor(m),p=(m-h)*60,v=Math.round(p),f=`${a.formatMessage({id:`${s}hours`},{time:h})}${h>0&&v>0?", ":""}${a.formatMessage({id:`${s}minutes`},{time:v})}`;return{text:`${h>0?`${a.formatMessage({id:`${s}hours_short`},{time:h})} `:""}${v>0?a.formatMessage({id:`${s}minutes_short`},{time:v}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:d,ariaText:m}=o(e+t);l=a.formatMessage({id:`${s}range`},{early:l,late:d}),u=a.formatMessage({id:`${s}range_aria`},{early:u,late:m})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),c.jsx("span",{className:H("time-to-complete",i),"aria-label":u,children:l})};const bk=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",c.jsx(Ln,{...n,className:H("banner",e),image:{...t,aspect:"banner"}})):null;const yk=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],xk=({className:e="",content:t,image:n,variant:r,spacing:i="normal",styling:a,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var v,f;const u={imageFullWidth:!0,...a};r||(r=u.imageFullWidth?"default":"light");const d=["eyebrow","title","text"],m={eyebrow:"small",title:"h1",text:"p"},h={};d.forEach(b=>{if(!t[b]){h[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){h[b]=t[b];const{text:g,element:x}=t[b];if(x&&yk.includes(x.toLowerCase()))return;h[b]={text:g,element:m[b]};return}h[b]={text:t[b],element:m[b]}}});const p=o&&o.text&&o.link;return p&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=b=>{b.preventDefault(),b.stopPropagation();const g=document.getElementById(o.link.substring(1));g&&g.scrollIntoView({behavior:"smooth"})}),c.jsx(_n,{className:H("banner-section",r,i,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":p,"has-extra-spacing":r!=="subtle"&&i==="normal"&&h.eyebrow&&h.title}),children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"content-wrapper",children:[d.map(b=>{if(h[b]&&typeof h[b]=="object"){const{text:g,element:x=""}=h[b];return b==="text"?c.jsx(Pn,{overrideType:"text-only",className:"text",children:g},b):y.createElement(x,{key:b,className:b},g)}return null}),l,p&&c.jsx(Be,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:H({new:r==="subtle",[(v=o.props)==null?void 0:v.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&c.jsx(Ln,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},wk=y.memo(xk);const Ck=({image:e,variant:t="default",children:n,className:r=""})=>{const i={};return e&&(i["--image"]=`url(${e})`),c.jsx(_n,{className:H("custom-content-banner",t,r,{"has-image":e}),style:i,children:c.jsx("div",{className:"content-slim",children:n})})};const Dk=({alignImage:e="left",className:t,content:n,image:r})=>{const i=typeof n=="string"?c.jsx(Pn,{children:n}):n;return c.jsxs(_n,{className:H("highlight-section",t),children:[r&&c.jsx("div",{className:H("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:c.jsx(Ln,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),c.jsx("div",{className:H("highlight-container highlight-content-wrapper",{"no-image":!r}),children:c.jsx("div",{className:H("highlight-content",{"highlight-content-right":e==="left"}),children:r?i:c.jsx("div",{className:"content-default",children:i})})})]})},Ek=y.memo(Dk);const _k=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:c.jsxs("aside",{className:H("marketing-block",e),children:[n&&c.jsx("p",{className:"title",children:n}),r&&c.jsx("p",{children:r}),t&&c.jsx(Be,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:t.text})]}),kk=({type:e,data:t})=>{const n=ie.useIntl(),{answers:r,createdAt:i,dateHasPassed:a,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:d}=t;if(e==="question"){const m=i&&Ts(i);return c.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&c.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:m?n.formatMessage({id:`dates_${m.path}`},{number:m.number}):0})]})]})}if(d&&!a||s)return c.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):fo(d)});if(o)return c.jsx(Yt,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const m=u&&Ts(u);return c.jsxs("ul",{className:"details",children:[l&&c.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&c.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:m?n.formatMessage({id:`dates_${m.path}`},{number:m.number}):0})})]})}return null},Fk={title:66,text:3e3,secondaryText:1e3,partner:34},ua={communityPage:{basePath:"/communities/",className:"communityPage",gtmEvent:"community"},customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},Ak=({data:e,cta:t,link:n,gtmContext:r})=>{var f,b;const i=ie.useIntl(),[a,s]=y.useState({loading:!1,registered:e.registered||!1});y.useEffect(()=>{e.registered&&s(g=>({...g,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:d,slug:m}=e,h=e.contentType;let p="";if((f=ua[h])!=null&&f.gtmEvent&&(p=ua[h].gtmEvent),l&&u)return n?c.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${p}-click`,children:o||i.formatMessage({id:"card_watch"})}):null;if(h==="people")return n?c.jsx(Be,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${p}-click`,children:o||i.formatMessage({id:"card_cta_people"})}):null;const v=["communityPage","microcourse","event"];if(t&&t.onClick&&v.includes(h)&&d!=="premium"){const g=a.loading||a.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),x=async C=>{if(C.preventDefault(),C.stopPropagation(),!(g||!t||!t.onClick)){s(A=>({...A,loading:!0}));try{const A=await t.onClick(e);s(A==="success"?()=>({registered:!0,loading:!1}):E=>({...E,loading:!1}))}catch{s(E=>({...E,loading:!1}))}}};return c.jsx("p",{className:H("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:c.jsx(Be,{onClick:x,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:g,"data-gtm-event-context":`${r}Page-${h}: ${m}`,"data-gtm-event-type":`${r}-${h}-register-click`,"data-testid":"in-card-button",children:o||i.formatMessage({id:`card_cta_${h}${g?`_${a.loading?"loading":"done"}`:""}`})})})}return null};function Bk({buildMemberData:e,communitySlug:t}){const n=ie.useIntl(),r=y.useContext(st),[i,a]=y.useState({count:"...",isMember:!1,memberType:""});return y.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(s=>{if(!s)return;const{membersCount:o,role:l="",pagination:u}=s;let d=0;o?d=o:u!=null&&u.total&&(d=u==null?void 0:u.total),a({count:d.toString(),isMember:!!l,memberType:l})})},[t,e]),c.jsxs("span",{className:"member-information",children:[i.isMember&&c.jsx(Yt,{size:"small",variant:"registered",icon:(i==null?void 0:i.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${i.memberType}`})}),c.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:i.count})})]})}const hu=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:i,cta:a,gtmContext:s="Carousel",handleCardClick:o,meta:l})=>{var F,S;const u=ie.useIntl(),d=y.useContext(st),m=!!(d!=null&&d.id),{isTabbable:h=!0,setFocus:p=!1}=l||{},v=y.useRef(null),[f,b]=y.useState({data:null,isLoading:!0});y.useEffect(()=>{n(i,m).then(N=>{b({data:N,isLoading:!1})}).catch(()=>b(N=>({...N,isLoading:!1})))},[i,m,n]);const{data:g,isLoading:x}=f;if(x||!g)return c.jsx(It,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});o&&!a&&(a={text:u.formatMessage({id:`card_cta_${i.contentType}`}),onClick:o});const{contentType:C}=g;if(!C||!ua[C])return c.jsx(It,{element:"li",className:"card-wrapper"});const{basePath:A="",className:E,length:_,gtmEvent:T}=ua[C];let M=h&&g.slug?`${A}${g.slug}`:!1;h&&g.slug&&(g.slug.slice(0,4)==="http"||g.slug.slice(0,2)==="//"||g.slug.slice(0,6)==="mailto"||g.slug.slice(0,3)==="tel")&&(M=g.slug);const O=N=>{M&&(N.preventDefault(),N.stopPropagation(),window.location.href=M)},L={...Fk,..._};let $={className:"card"},B={};return M&&(B={href:M,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${T}-click`,"data-testid":"link"},g.openInNewTab&&(B.target="_blank"),$={onClick:O,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${T}-click`}),p&&($={...$,tabIndex:"0"},(F=v==null?void 0:v.current)==null||F.focus(),(S=v==null?void 0:v.current)==null||S.scrollIntoView({behavior:"smooth"})),c.jsx("li",{className:H("card-wrapper text-medium",E,t,{"has-link":M,"no-link":!M,"has-image":g.banner}),"data-testid":`${C}-card`,children:c.jsxs("div",{...$,ref:v,children:[c.jsx(Ad,{className:"card-label",contentType:C,customIcon:g.isPrivate?"lock-locked":g.customIcon,customLabel:g.customLabel}),C==="communityPage"&&(g==null?void 0:g.createdAt)&&Vh(g==null?void 0:g.createdAt,60)&&c.jsx(Yt,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),g.startDate&&!g.isOngoingEvent&&c.jsx(Yt,{size:"small",variant:g.dateHasPassed?"default":"information","data-testid":"date",children:g.dateHasPassed?u.formatMessage({id:"card_ended"}):Dd(g.startDate)}),g.banner?c.jsxs("p",{className:"img",children:[g.registered&&c.jsx(Yt,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),c.jsx(Ln,{image:{...g.banner,description:""}})]}):E==="people"?c.jsx(on,{name:g.title||"",src:g.profile,"data-testid":"people-profile-picture"}):null,g.contributors&&c.jsx(bo,{contributors:{data:g.contributors},styling:{size:"small",showGap:E!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(C)?u.formatMessage({id:`card_contributors_${C}`}):void 0,"data-testid":"contributors"}),g.partner&&c.jsx("p",{className:"partners","data-testid":"partners",children:g.partner.length>1?u.formatMessage({id:"card_partner"},{partner:g.partner[0],number:g.partner.length-1}):sr(g.partner[0],L.partner)}),["title","text","secondaryText"].map(N=>{const V=g[N];if(!V)return null;const W=bd(N),ae={key:N,className:W,"data-testid":W},te={wrapper:"p",forceWrapper:!0,forceInline:!0},D=sr(V,L[N]);return["title","text"].includes(N)&&M?(te.wrapper="a",c.jsx("p",{...ae,children:c.jsx(Zt,{options:te,...B,children:D})})):c.jsx(Zt,{options:te,...ae,children:D})}),i.contentType==="communityPage"&&(i.slug||g.slug)&&r&&c.jsx(Bk,{communitySlug:i.slug||g.slug,buildMemberData:r}),c.jsx(kk,{type:E||"",data:g}),c.jsx(Ak,{data:g,cta:a,link:M||"",gtmContext:s})]})})};const bh=({cards:e,cardTypes:t,className:n="",...r})=>c.jsx("ul",{className:H("card-block",n),children:e.map((i,a)=>{const s=i.slug?`${i.slug}-${t[a]}`:`${t[a]}-${a}`;return c.jsx(hu,{id:s,card:{...i,contentType:t[a]},meta:{setFocus:a===(r==null?void 0:r.focusCardIndex)},...r},s)})}),Tk=(e,t,n,r)=>{const i=t*n<=e,a=e<t*(n+1),s=r.includes(Math.floor(e/t));return{inView:i&&a,isLoaded:s}},Sk=({id:e,title:t})=>{const n=ie.useIntl();if(!t||!t.text)return null;const{text:r,element:i="h2",variant:a="default",size:s="medium",link:o}=t;return y.createElement(i,{className:H("title",a,s,{"highlighted-title":a==="highlighted"}),children:c.jsxs(c.Fragment,{children:[r,o&&c.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const ks={fourCards:1024,threeCards:769,twoCards:480};let Bi=null,Fs=null;const jk=({id:e,cards:t,cardTypes:n,buildCardData:r,title:i,className:a,gtmContext:s,...o})=>{const l=ie.useIntl(),u="carousel_pagination_",[d,m]=y.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=d,[v,f]=y.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:g}=v,[x,C]=y.useState(""),A=t.length,E=Math.ceil(A/h),_=y.useRef(null),T=xn(!0,!0,_==null?void 0:_.current);y.useEffect(()=>{let F=1;T&&(T>=ks.fourCards?F=4:T>=ks.threeCards?F=3:T>=ks.twoCards&&(F=2),F>A&&(F=A)),m(S=>({...S,cardsPerPage:F,isLoading:!1}))},[T,A]);const M=(F="next")=>{Fs&&clearTimeout(Fs);let S=b;if(typeof F=="string")if(F==="next")if(b<E-1)S=b+1;else return;else if(b>0)S=b-1;else return;else S=F;C(""),f(V=>({...V,currentPage:S,loadedPages:[...new Set([...g,S])]}));const N=()=>{const V=S*d.cardsPerPage,W=V+d.cardsPerPage;return t.slice(V,W).length};Fs=setTimeout(()=>{C(l.formatMessage({id:`${u}ariaLive${typeof F=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof F=="string"?F:"next"}`}),slide:typeof F=="string"?1:F+1,count:N()}))},500)},O=F=>{Bi=F.touches[0].clientX},L=F=>{if(Bi===null)return;const S=F.touches[0].clientX,N=Bi-S;N>5?M("next"):N<-5&&M("previous"),Bi=null},$={"--width":`${T||0}px`,"--total-cards":A,"--cards-per-page":h,"--page":b};if(p)return c.jsx(ma,{layout:`carousel${i?"-with-title":""}`});const B=(F,S)=>{var V;let N=null;return(V=F==null?void 0:F.sys)!=null&&V.id?N=`card-${F.sys.id}`:F!=null&&F.slug?N=`card-${F.slug}`:[n[S],F.contentType].includes("customCard")&&(N=`card-${window.btoa(`${F.title} ${F.createdAt}`)}-${S}`),N};return c.jsxs("section",{ref:_,className:H("carousel-wrapper",a),"data-testid":"carousel",children:[c.jsx(Sk,{id:e,title:i}),c.jsx("ul",{className:"carousel",onTouchStart:O,onTouchMove:L,style:$,"data-testid":"carousel-list",children:t.map((F,S)=>{let N=B(F,S);const{inView:V,isLoaded:W}=Tk(S,h,b,g);return N&&(V||W)?c.jsx(hu,{id:N,card:{...F,contentType:n[S]},buildCardData:r,gtmContext:s,meta:{isTabbable:V},...o},N):(N=N||`${e}-card-${S}`,c.jsx(It,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},N))})}),E<=1?null:c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[c.jsx("li",{className:"arrow previous",children:c.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:F=>{F.preventDefault(),F.stopPropagation(),M("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:b<=0})}),[...Array(E)].map((F,S)=>c.jsx("li",{"data-testid":"carousel-controls-button",children:c.jsx("button",{className:H("page-indicator",{selected:S===b}),onClick:N=>{N.preventDefault(),N.stopPropagation(),M(S)},children:c.jsx(Me,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:S+1,total:E})})})},`page-indicator-${S}`)),c.jsx("li",{className:"arrow next",children:c.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:F=>{F.preventDefault(),F.stopPropagation(),M("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:b>=E-1})})]}),c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:x})]})]})},Pk=({carousels:e=[],isLoading:t,title:n,className:r="",...i})=>!e||!e.length?null:e.map(({title:a,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const d=a?window.btoa(a):`carousel-${u}`,m=u===e.length-1;return t?c.jsxs(y.Fragment,{children:[c.jsx(ma,{layout:`carousel${a?"-with-title":""}`,"data-testid":"carousel-placeholder"}),m?null:c.jsx(qt,{})]},`placeholder-${d}`):c.jsxs(y.Fragment,{children:[c.jsx(jk,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:a,link:s},...i}),m?null:c.jsx(qt,{})]},`carousel-${d}`)});const Ok=({element:e="div",className:t="",card:n,gtmContext:r="NarrowCard"})=>{const{banner:i,title:a,text:s,isPrivate:o,slug:l}=n;let u={};return l&&(u={onClick:m=>{l&&(m.preventDefault(),m.stopPropagation(),window.location.href=l)},tabIndex:"0","data-gtm-event-context":`${r}-NarrowCard`,"data-gtm-event-type":`${r}-click`}),y.createElement(e,{className:H("narrow-card",t,{"has-link":l,"gtm-trackable":l,"no-link":!l}),...u,children:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:H("img",{private:o,"no-image":!i}),children:i&&c.jsx(Ln,{image:i})}),c.jsxs("div",{className:"content",children:[a&&c.jsx("p",{className:"title text-medium",children:a}),s&&c.jsx("p",{className:"text text-medium",children:s})]})]})})};const Mk=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:i=!0},graph:a,styling:s={},className:o=""})=>{const l=ie.useIntl();let u=i?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:d=!1}=s;return y.createElement(e,{className:H("course-progression",o,{"highlight-percentage":d,"has-circle-graph":a==="circle"}),children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:m=>c.jsx("strong",{children:m}),number:u})}),u<100&&i&&c.jsx(_a,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),c.jsx(vo,{progress:u,styling:{layout:a||"bar",size:a&&a==="circle"?"small":"default"}})]})})};const yh=({element:e="span",sectionId:t,subsectionId:n,title:r,className:i=""})=>y.createElement(e,{className:H("lesson-name",i),"data-number":`${t}.${n}`,children:r});const xh=({size:e="default",completionTime:t,icon:n,optional:r,type:i,children:a})=>{const s=ie.useIntl(),o=ca(`lessonType_${i}`)?s.formatMessage({id:`lessonType_${i}`}):xd(i||"");return c.jsxs("small",{className:H("content-type",{[e]:e!=="default"}),children:[c.jsx("span",{className:H("type",n),children:o})," ",t>0&&!r&&c.jsx(_a,{time:t})," ",a?c.jsx("span",{className:"additional",children:a}):null]})};const Nk=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:i,sectionId:a,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:d})=>{const m=ie.useIntl(),h="courseStructure_",p=u.toLowerCase().includes("course conclusion");return c.jsxs(da,{className:"course-structure",label:c.jsxs(c.Fragment,{children:[c.jsxs("small",{children:[m.formatMessage({id:`${h}section${p?"_end":""}`},{number:a})," ",!r&&s>=0&&c.jsx("span",{className:"time",children:i&&l===0?m.formatMessage({id:`${h}time_completed`}):c.jsx(_a,{time:s,appendedText:i?m.formatMessage({id:`${h}time_left`}):""})})]}),c.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[c.jsx("p",{children:n}),c.jsx("ol",{children:e&&e.length>0&&e.map(({completed:v,completionTime:f,contentType:b,icon:g,image:x,isIntroduction:C,optional:A,slug:E,subsectionId:_,title:T,type:M})=>{const O=i&&t||C,L={};return x&&(L.style={"--image":`url(${x})`}),c.jsx("li",{className:H({article:b===Sr.ARTICLE,discussion:b===Sr.DISCUSSION,quiz:b===Sr.QUIZ,completed:v&&b===Sr.ARTICLE,locked:!O}),...L,children:c.jsx(wn,{href:O?`/microcourses/en/${o}/${E}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${yd(T)}`,gtmType:"article-click",children:c.jsxs(c.Fragment,{children:[c.jsx(yh,{sectionId:a,subsectionId:_,title:T,className:"course-title"})," ",c.jsx(xh,{completionTime:f,icon:g,optional:A,type:M,children:d&&d[E]&&c.jsx("span",{className:"quiz-score",children:`${d[E]}%`})})]})})},E)})})]})};const Ik=({isComplete:e=!1,onClick:t,...n})=>{const r=ie.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),c.jsx(Be,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:H("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},Rk=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),od=[{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/kCcBdXurt3uOKu6NdTPm0/1b6d19179b21f98dbdadf2477c03d267/devin-avery-7gwqj0yyrhm-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"why-public-servants-must-learn-to-fail",contributors:["community"]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/12Y0W1K0zVcDKzgLZlbfyC/6eb0757a02cbeea19b1b42d7da04d553/ashkan-forouzani-m0l9nbcivuk-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"organisational-culture-change-and-failure",contributors:[{name:"Mari-Liis",id:"bdb7509c-89ed-4633-8bc0-dbf11f5d9be1"}]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/26TEwu0xVkbQDguuW89fY6/d54ce406cdd652d68979770d526398ab/nik-shuliahin-bunwp1bl0nc-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"how-to-learn-from-failure-without-causing-a-scandal",contributors:["community"]}];const Ti="notFoundError_",$k=()=>{const e=ie.useIntl(),t=[];return od.forEach((n,r)=>{n.title=e.formatMessage({id:`${Ti}post_${r+1}`}),t.push("solutionArticle")}),c.jsxs(lh,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:c.jsxs(_n,{children:[c.jsx(bh,{cards:od,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),c.jsx(Be,{href:"/solution-articles/",children:e.formatMessage({id:`${Ti}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[c.jsx("h1",{children:e.formatMessage({id:`${Ti}title`})}),c.jsx("p",{children:e.formatMessage({id:`${Ti}text`})})]})};exports.ASSETS_BUCKET=Gt;exports.ActionBar=xf;exports.ActionButton=Kr;exports.ActivitiesFeed=ov;exports.ActivitySection=lk;exports.ActivityType=br;exports.AddPost=fu;exports.Badge=qd;exports.BadgeScope=dt;exports.Badges=Ud;exports.BadgesContext=ho;exports.BadgesProvider=Od;exports.Banner=bk;exports.BannerSection=wk;exports.Breadcrumbs=Fv;exports.Buckets=op;exports.Button=Be;exports.ButtonWrapper=gr;exports.COURSE_CONTENT_TYPES=Sr;exports.CacheProvider=Md;exports.Card=hu;exports.CardBlock=bh;exports.Carousel=Pk;exports.CharacterLimit=Oo;exports.Checkbox=Mo;exports.CollapsibleSection=da;exports.Columns=Ef;exports.CommunityDetails=Fg;exports.ContactFooter=T_;exports.ContactForm=nh;exports.ContentTypeLabel=Ad;exports.Contributors=bo;exports.ConversationContext=Da;exports.CookieBanner=uh;exports.CourseProgression=Mk;exports.CourseStructure=Nk;exports.CustomContentBanner=Ck;exports.CustomEvents=it;exports.DELETED_USER_ID=Wr;exports.Directory=hk;exports.DiscussionContentType=Te;exports.DiscussionConversation=fh;exports.DiscussionForm=si;exports.DiscussionFormCard=hh;exports.DiscussionFormModal=vh;exports.DiscussionPost=oi;exports.DiscussionThread=gh;exports.Divider=qt;exports.DownloadSection=k_;exports.EMAILS=Qn;exports.EditSection=A_;exports.EmailHelperTextBox=kf;exports.EmptyStateBox=Cn;exports.EnrichedUrl=jo;exports.FeatureFlags=Id;exports.Filters=wf;exports.FlagsProvider=Nd;exports.Footer=cu;exports.Form=Jt;exports.Formatting=K;exports.Fragment=jt;exports.FullWidthSection=_n;exports.GET_STREAM_USER_PREFIX=Bs;exports.GlobalProviders=wp;exports.Header=du;exports.HelperTextBox=Td;exports.HiddenFromScreenReaders=la;exports.HideShowTextBox=Sd;exports.HighlightSection=Ek;exports.HighlightedTextBox=Ft;exports.INVALID_TOKEN=wd;exports.IconBulletedList=cp;exports.ImageContainer=rp;exports.IntlProvider=Rd;exports.InviteForm=rh;exports.InviteModal=dk;exports.JoinButton=Co;exports.Label=ru;exports.LanguageContext=po;exports.LanguageSwitcher=Bv;exports.LessonName=yh;exports.LessonType=xh;exports.LikesButton=hf;exports.LikesFeed=vf;exports.LikesModal=bf;exports.Link=wn;exports.LoadMore=ii;exports.LoadingBlock=Wd;exports.LoadingPlaceholder=It;exports.LoadingState=ma;exports.Logo=Po;exports.LogoSection=B_;exports.MEMBERS_PER_PAGE=ch;exports.MENTION_REGEX=Cd;exports.MarkCompleteButton=Ik;exports.MarkdownText=Pn;exports.MarketingBlock=_k;exports.Marks=Kt;exports.Member=rn;exports.MembersList=dh;exports.Modal=yo;exports.MoreMenu=Cf;exports.NUMBER_OF_COUNTRIES=qh;exports.NUMBER_OF_USERS=zh;exports.NarrowCard=Ok;exports.NavigationMenu=Df;exports.NotFoundError=$k;exports.Overlay=un;exports.OverlayContext=go;exports.OverlayProvider=zd;exports.PageHeading=jd;exports.PageLayout=lh;exports.PasswordForm=v_;exports.PasswordRules=Sf;exports.Pill=Yt;exports.Poll=mh;exports.Popover=Fd;exports.Portal=vr;exports.ProfileForm=ih;exports.ProfileImageChange=th;exports.ProfileModal=Ea;exports.ProfileModalLauncher=mu;exports.ProfilePicture=on;exports.ProgressBar=vo;exports.ProgressTracker=ap;exports.PublishArticleForm=y_;exports.Rating=Kv;exports.RepliesFeed=gf;exports.ResponsesHeading=ph;exports.ResponsiveImage=Ln;exports.ResultsVisibility=oa;exports.ReturnToNavButton=sp;exports.RichTextEditor=lu;exports.SearchForm=sh;exports.ShareLink=yf;exports.ShareLinks=Mv;exports.SignupForm=__;exports.Span=Ps;exports.StatusBanner=ur;exports.TableOfContents=vk;exports.Tabs=Nv;exports.Tags=M_;exports.TestimonialBlock=gk;exports.TimeToComplete=_a;exports.Toggle=p_;exports.Tooltip=$n;exports.TopLevelPage=S_;exports.UUID_V4_REGEX=Vr;exports.UserContext=st;exports.UserProvider=$d;exports.VisuallyHidden=Me;exports.addAriaProps=af;exports.basicReducer=ri;exports.camelCaseToDashCase=bd;exports.checkIntlPathExists=ca;exports.enrichPostCategories=So;exports.generateConditions=zi;exports.generateCssIcon=Uh;exports.getAuthorData=yr;exports.getCharacterLimitProps=_f;exports.getLongDate=fo;exports.getMember=ha;exports.getPostBody=To;exports.getShortDate=Dd;exports.getValueLength=pa;exports.headerData=ni;exports.likesResponseMock=_v;exports.mapGetStreamData=Rk;exports.pageReady=Ed;exports.passwordValidator=Ss;exports.repliesFeedMock=uv;exports.supportedLanguages=Pi;exports.toCamelCase=yd;exports.toCapitalisedCase=Lh;exports.toSentenceCase=xd;exports.transformSlugs=Rs;exports.useAutoResize=fd;exports.useBadges=Pd;exports.useCurrentPath=md;exports.useEffectAfterMount=or;exports.useElementWidth=xn;exports.useOverlay=Ld;exports.useScrollListener=pd;exports.useScrollToHash=lo;exports.useTooltips=co;exports.useUser=fa;
165
+ `}),z=ee.turndown(z)}o&&o.mentions&&(z=await _d({text:z,template:`[${Xs}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),fE(z,ee=>{const U=[{type:"initialValue",value:ee},{type:"editorKey",value:O.toString()}];o!=null&&o.link&&(U.push({type:"enrichedUrl",value:o.link}),o.link.url&&te(o.link.url)),T(U),setTimeout(()=>{T([{type:"stringValue",value:Hc(k)}])},150)})})()},[O]),y.useEffect(()=>{if(V===void 0&&k){const z=pE(k);z&&te(z)}const P=z=>{var X;const ee=z,U=((X=ee==null?void 0:ee.detail)==null?void 0:X.url)||null;U&&V&&V.url===U&&T([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",P),()=>{window.removeEventListener("linkRemoved",P)}},[V]),y.useEffect(()=>{if(t){Vr.lastIndex=0;const P=t.match(Vr);P&&P.length===1&&P[0].length===t.length&&!S&&T([{type:"originalValue",value:t}])}t!==""||!k||qi(O,t)&&!S||(w.withoutNormalizing(k,()=>{ne.delete(k,{at:{anchor:w.start(k,[]),focus:w.end(k,[])}}),ne.deselect(k),k.children.length!==0&&ne.unwrapNodes(k,{at:[0]}),ne.insertNodes(k,A,{at:[0]})}),T([{type:"initialValue",value:A},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),y.useEffect(()=>{b({link:V})},[V]),y.useEffect(()=>{$===""&&V&&T([{type:"enrichedUrl",value:void 0}])},[$]);const q=Ur(()=>{vE({editor:k,isShowing:W.show,numberOfUsers:W.numberOfUsers,listMembers:p,dispatch:T})},100);return L?c.jsx("div",{id:D,className:"rich-text-editor input text-medium",children:c.jsxs(ln.Provider,{value:{..._,id:D,isInOverlay:h,setFocus:ae,dispatch:T,getLinkPreview:g,onMention:x,reportError:C},children:[c.jsxs(Ow,{editor:k,initialValue:L,onChange:P=>{if(k.operations.some(ee=>ee.type!=="set_selection")){let ee=yE(P);ee==="<br>"&&(ee=""),f(ee,V),T([{type:"stringValue",value:Hc(k)}]),S||T([{type:"hasInteracted",value:!0}]),q(),m&&console.log({serialized:ee,json:P})}},...u,children:[c.jsx(_w,{className:"editor",renderElement:Q,renderLeaf:Y,placeholder:n||d.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onPaste:async P=>{const z=V!==!1,ee=P.clipboardData.getData("text");if((X=>{try{return new URL(X),!0}catch{return!1}})(ee)){let X=ee;if(ee){const{full:oe}=mo(ee);X=oe}if(ee&&g&&!z){const oe=await g(X);oe.url&&T([{type:"enrichedUrl",value:oe}])}}},onKeyDown:P=>{if(P.key==="Enter"){W.show&&(P.preventDefault(),P.stopPropagation(),Lm(k,W,T,D));const{selection:z}=k;if(z){const ee=G.isCollapsed(z),[U,X]=w.node(k,z,{depth:1});let oe=U,J=oe.type;const pe=oe.children[0];if(pe&&(pe==null?void 0:pe[K.h3])===!0&&(P.stopPropagation(),P.preventDefault(),ne.insertNodes(k,A)),pe&&[K.ol,K.ul].includes(pe.type)&&(oe=pe,J=pe.type),oe&&me.isElement(oe)&&J!==K.paragraph){if(J===K.blockquote&&!P.shiftKey){P.stopPropagation(),P.preventDefault(),ne.insertNodes(k,A);return}if(ee){const[de,ye]=w.parent(k,z,{edge:"end"}),Ce=de.type;if([K.ul,K.ol].includes(J))if(P.stopPropagation(),P.preventDefault(),Ce===K.li&&F==="Enter"){de.children.length===1&&"text"in de.children[0]&&de.children[0].text===""&&ne.removeNodes(k,{at:ye}),ne.insertNodes(k,A,{at:R.next(X)}),ne.select(k,w.end(k,R.next(X)));return}else{const[Ve,Le]=mE(k,K.li),ze={type:K.li,children:[{text:""}]};ne.insertNodes(k,ze,{at:R.next(Le)}),ne.select(k,w.end(k,R.next(Le)))}}}}}else if(P.key==="Escape"){if(W.show){P.preventDefault(),P.stopPropagation(),T([{type:"mentionPopover",value:{...W,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(P.key)&&W.show){P.preventDefault(),P.stopPropagation();const{selectedUser:z,possibleUsers:ee}=W;let U=P.key==="ArrowUp"?z-1:z+1;U<0&&(U=ee.length-1),U>=ee.length+1&&(U=0),T([{type:"mentionPopover",value:{...W,selectedUser:U}}])}T([{type:"lastKey",value:P.key}]),gE(P,k,T,C)},onBlur:()=>{k.selection&&T([{type:"lastAnchor",value:k.selection.anchor}])},onFocus:()=>{if(B){if(!R.isPath(B.path)||!ce.has(k,B.path))return;const P=ce.get(k,B.path);let z=0;if(ge.isText(P)?z=P.text.length:P.children&&(z=P.children.length),B.offset>z)return;try{ne.select(k,{anchor:B,focus:B})}catch(ee){const U=ee.message;C(`Error focusing editor: ${U}`)}}}}),V?c.jsx(jo,{data:V,variant:"condensed",onClick:()=>{T([{type:"enrichedUrl",value:!1}]);const P=new CustomEvent("ariaLive",{detail:{message:d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(P)},"aria-label":d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:V.title||d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):c.jsx(c.Fragment,{}),c.jsx(BE,{styling:l==null?void 0:l.toolbar}),p?c.jsx(xE,{onFallbackClick:v}):c.jsx(c.Fragment,{})]},M),c.jsx(Oo,{id:`character-limit-${e}`,limit:r,valueLength:pa($)})]})}):c.jsx(c.Fragment,{})};const p_=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:s=""})=>{const[o,l]=y.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);y.useEffect(()=>{r&&l(r)},[r]);const u=d=>{a||(l(d),i(d))};return c.jsxs("div",{className:H("toggle",s),onClick:d=>{d.preventDefault(),d.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[c.jsx("p",{children:t}),c.jsx("ul",{className:H("toggle-options",{disabled:a,on:o===n[1].value}),children:n.map(d=>{const m=`${e}-${d.value}`;return c.jsxs("li",{className:"hidden",children:[c.jsx("input",{type:"radio",id:m,name:e,value:d.value,checked:o===d.value,onChange:()=>u(d.value),disabled:a}),c.jsx("label",{htmlFor:m,children:d.label})]},m)})})]})};function th({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:s}){const o=ie.useIntl(),l="profileImageChange_",[u,d]=y.useState(r),[m,h]=y.useState(!1),[p,v]=y.useState(!1),f=y.useRef(null),b=async A=>{h(!0),v(!1);try{const E=A.target.files&&A.target.files[0];if(!E||!t)throw h(!1),new Error("Image file or userID is missing");const _=await i({fileObject:E,userId:t}),T={thumbnail:_.thumbnailURL,full:_.originalURL};d(T),s(T)}catch{v(!0)}finally{h(!1)}h(!1)},{upload:g=o.formatMessage({id:`${l}cta_upload`}),change:x=o.formatMessage({id:`${l}cta_change`}),uploading:C=o.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return c.jsxs("div",{className:H("profile-image-change-figure",e),children:[c.jsx(on,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),p&&c.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),c.jsx("input",{id:"file",type:"file",accept:"image/*",ref:f,onChange:b,hidden:!0,"data-testid":"file-input"}),c.jsx(Be,{onClick:()=>f.current&&f.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:m,children:m?C:u?x:g})]})}const nh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return c.jsx(Jt,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const g_=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=ie.useIntl();return c.jsx(jh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,s)=>c.jsxs("div",{className:"email text-medium",children:[c.jsx("div",{"data-tag-item":!0,children:i}),c.jsx(Be,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{s(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},rh=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:s,onClose:o,reportError:l,sendInvites:u,initialFormStatus:d="NOT_SUBMITTED"})=>{const[m,h]=y.useState([]),[p,v]=y.useState(!0),[f,b]=y.useState(d),{formatMessage:g}=ie.useIntl(),x=async E=>{try{await u(m,E.message),h([]),b("SUCCESS")}catch(_){b("ERROR"),l(_)}},C=E=>{E.preventDefault(),b("NOT_SUBMITTED"),v(!0),h([])},A=E=>{E.preventDefault(),o(),b("CLOSED")};return f==="CLOSED"?null:f==="ERROR"||f==="SUCCESS"?c.jsxs("div",{className:"invite-form-wrapper",children:[c.jsx("div",{className:"content centred",children:f==="SUCCESS"?c.jsx("h2",{className:"success-title",children:g({id:"inviteForm_success"})}):c.jsxs("h2",{className:"error-title",children:[" ",g({id:"inviteForm_error"})]})}),c.jsx(qt,{}),c.jsx("div",{className:"footer",children:f==="SUCCESS"?c.jsxs(c.Fragment,{children:[c.jsx(Be,{variant:"secondary",onClick:C,children:g({id:"inviteForm_ctaSendMoreInvites"})}),c.jsx(Be,{onClick:A,children:g({id:"inviteForm_ctaDone"})})]}):c.jsx(Be,{onClick:C,children:g({id:"inviteForm_ctaTryAgain"})})})]}):c.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:s},children:[c.jsxs("div",{className:"content",children:[c.jsx("h2",{className:"title",style:{color:i},children:e}),c.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),c.jsx(Jt,{id:"invite-form",fields:[{component:g_,props:{emails:m,setEmails:h,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:g({id:"inviteForm_message_label"}),placeholder:n||g({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:x},button:{text:r,size:"medium",disabled:p}})]})},zi=e=>e.map(t=>({condition:t})),St={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},v_=({functions:e,...t})=>{const{formatMessage:n}=ie.useIntl(),[r,i]=y.useState(null),[a,s]=y.useState(!1),[o,l]=y.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=p=>p[St.NEW_PASSWORD]!==p[St.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,d=p=>!Ss(p[St.NEW_PASSWORD]).isValid,m=[{"data-testid":St.NEW_PASSWORD,id:St.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:zi(["required",d]),functions:{onChange:p=>l(Ss(p).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":St.CONFIRMED_PASSWORD,id:St.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:zi(["required",u])}];t.isPasswordChange&&m.unshift({"data-testid":St.CURRENT_PASSWORD,id:St.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:zi(["required"])}),a&&m.push({component:Sf,props:{matchingRules:o}});const h={id:St.FORM_ID,fields:m,functions:{...e,onSuccess:async p=>(e.createPassword(p),e.onSuccess&&e.onSuccess(p)),onCatch:p=>i(p==null?void 0:p.statusCode),onFailure:(p,v)=>{(v.includes(St.NEW_PASSWORD)||v.includes(St.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return c.jsxs(c.Fragment,{children:[c.jsx(Jt,{...h}),r&&c.jsx(Cn,{variant:"error",text:r})]})};const ih=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var M;const s=ie.useIntl(),o="profileForm_",l=y.useContext(st),[u,d]=y.useState(l.image),[m,h]=y.useState(!1),{uploadImage:p=()=>{},onSuccess:v=async O=>{},onCancel:f=()=>{},onFailure:b=()=>{}}=n,{buildLocation:g,isValidPlace:x,predictPlaces:C}=t.useMaps(),{context:A="ProfileForm",event:E="profile-form-submit-click"}=i||{},_=[{id:"jobTitle",type:"text",label:s.formatMessage({id:`${o}jobTitle`}),placeholder:s.formatMessage({id:`${o}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:s.formatMessage({id:`${o}organization`}),placeholder:s.formatMessage({id:`${o}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:s.formatMessage({id:`${o}location`}),placeholder:s.formatMessage({id:`${o}location_placeholder`}),value:(M=l.location)==null?void 0:M.en,validation:[{condition:"required"},{condition:({location:O})=>O&&!m?!1:!x(O),error:s.formatMessage({id:`${o}location_error`})}],functions:{onChange:()=>{m||h(!0)},onKeyInput:C}}],T=[{component:th,props:{userName:l.name,userId:l.id,src:u,uploadImage:p,callback:d,button:{text:{upload:s.formatMessage({id:`${o}image`})}}}},{id:"name",type:"text",label:s.formatMessage({id:`${o}name`}),placeholder:s.formatMessage({id:`${o}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},..._,{id:"biography",type:"textarea",label:s.formatMessage({id:`${o}bio`}),placeholder:s.formatMessage({id:`${o}bio_placeholder`}),limit:1e3,value:l.biography},{component:qt}];return c.jsx(Jt,{id:"profile-details-form",fields:e?_:T,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:o,gtm:{context:A,event:E},functions:{onSuccess:async O=>{try{const L={...O,image:u||null,location:m?await g(O==null?void 0:O.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails($=>({...$,...L})),await v(L)}catch{b()}},onCancel:f,onFailure:b},button:{size:"large",text:{default:s.formatMessage({id:`${o}cta`}),submitting:s.formatMessage({id:`${o}cta_submitting`}),submitted:s.formatMessage({id:`${o}cta_submitted`})}},...a})},b_=()=>{const e=ie.useIntl(),[t,n]=y.useState(0);return y.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),c.jsx(Wd,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};var ah=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(ah||{});let vs=null;const rt="publishArticleForm_",ed={},td=10,y_=({id:e="publish-article-form",values:t=ed,functions:n,meta:r,gtm:i})=>{const a=ie.useIntl(),s=y.useContext(st),{create:o,onSuccess:l=()=>{},onFailure:u=()=>{}}=n||{},{isInOverlay:d=!1}=r||{},[m,h]=y.useState(!1),[p,v]=y.useState(t.body||""),[f,b]=y.useState(!1),[g,x]=y.useState("");y.useEffect(()=>{qi(t,ed)||Hr(t.body)&&t.body!==p&&t.body!==void 0&&v(t.body)},[t.body]);const C=()=>{!s||!s.id?b(a.formatMessage({id:`${rt}error_loggedOut`})):f&&b(!1)},A=M=>({condition:O=>{const L=O[M];return!L||typeof L!="string"?!0:L.length<td},error:a.formatMessage({id:`${rt}error_underMinLength`},{length:td})}),E=!!p&&Hr(p),_=()=>c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsx("p",{className:"text-medium",children:a.formatMessage({id:`${rt}disclaimer`})})]}),T=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:a.formatMessage({id:`${rt}title_label`}),placeholder:a.formatMessage({id:`${rt}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:C},validation:[{condition:"required"},A("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:a.formatMessage({id:`${rt}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:a.formatMessage({id:`${rt}subtitle_placeholder`}),functions:{onChange:C},validation:[{condition:"required"},A("subtitle")]},{component:ru,props:{formID:e,label:{visible:a.formatMessage({id:`${rt}body_label`})},showLabel:!0}},{component:lu,props:{id:`${e}-input`,value:p,placeholder:a.formatMessage({id:`${rt}body_placeholder`}),meta:{isInOverlay:d},autoFocus:!1,functions:{onChange:M=>{v(M),C()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!f,"aria-errormessage":"error-message"}},{id:"tags",label:a.formatMessage({id:`${rt}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(ah).map(M=>({id:M,label:a.formatMessage({id:`${rt}_tags_${M}`})})),multipleOptions:{limit:3},validation:[{condition:"required",error:a.formatMessage({id:`${rt}tags_error_required`})},{condition:M=>{var O;return((O=M==null?void 0:M.tags)==null?void 0:O.length)>3},error:a.formatMessage({id:`${rt}tags_error_over_three`})}]}];return m?T.push({component:qt}):T.push({component:_}),c.jsxs("section",{className:"publish-article-form",children:[c.jsx(Jt,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async M=>{if(!s||!s.id||!E)return;vs&&clearTimeout(vs),h(!0);const O={...M,body:p};try{o&&await o(O),vs=setTimeout(()=>{x(a.formatMessage({id:`${rt}aria_success`})),l(O)},500)}catch{b(a.formatMessage({id:`${rt}error`})),x(""),u()}},onFailure:u},fields:T,intlPath:rt,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":i==null?void 0:i.context,"data-gtm-event-type":"publish-article-click",disabled:!s||!s.id||!E,text:{default:a.formatMessage({id:`${rt}cta_submit`}),submitting:a.formatMessage({id:`${rt}cta_submitting`}),submitted:a.formatMessage({id:`${rt}cta_submitted`})},customOnSubmit:f?c.jsx(c.Fragment,{}):c.jsx(b_,{})},gtm:i}),f&&c.jsx(ur,{id:"error-message",className:"error",children:typeof f=="string"&&f.includes(" ")?f:a.formatMessage({id:`${rt}error`})}),g&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:g})]})};const sh=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=ie.useIntl(),u=y.useRef(null);or(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=m=>{m.preventDefault(),m.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return c.jsx("form",{onSubmit:d,className:H("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:c.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:c.jsxs("p",{children:[c.jsx(Me,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),c.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:m=>{m.key==="Enter"&&d(m)}}),c.jsx("button",{className:"clear",onClick:m=>{m.preventDefault(),m.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:c.jsx(Me,{children:l.formatMessage({id:"search_clear"})})}),c.jsx("button",{className:"search",onClick:d,children:c.jsx(Me,{children:l.formatMessage({id:"search_cta"})})})]})})})},nd=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},a);try{s=await t(i),s===void 0&&(s=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let d="";return o?d=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?d=u.auth?"verify":"pending":d="exists":u.auth&&(d="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:i,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},x_=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},w_=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=x_(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),localStorage.setItem("email",s.email),r&&r({...s,...a.values}),i([{type:"showSuccessMessage",value:!0}])},C_=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:d}=s,m=(p,v)=>{p.current&&s.validFields[v]!==p.current.validity.valid&&o([{type:`validFields.${v}`,value:p.current.validity.valid}])},h=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>m(a.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{nd({ref:a.email,validateEmail:r,dispatch:o})},onChange:(p,v)=>{o([{type:"shouldDisableButton",value:!0}]),v&&v({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:kf,props:{email:d.email,type:d.boxType,resendVerificationCode:i}}];return s.shouldManuallyApprove&&(h.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>m(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{m(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&h.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:p=>c.jsx("small",{children:p})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&h.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:p=>c.jsx("small",{className:"notes text-small",children:p})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),h.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:p=>c.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:p}),privacy:p=>c.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:p})}),shownValue:"accepted",functions:{onChange:p=>{if(!p)return;const v=[];["name","email"].forEach(f=>{s.validFields[f]!==a[f].current.validity.valid&&(v.push({type:`validFields.${f}`,value:a[f].current.validity.valid}),f==="email"&&nd({ref:a.email,validateEmail:r,dispatch:o}))}),v.length&&o(v)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),h};const D_=({className:e=""})=>c.jsxs("div",{className:H("success-message",e),"data-testid":"success-message",children:[c.jsx("p",{className:"success-title",children:c.jsx(ie.FormattedMessage,{id:"signup_success_title"})}),c.jsx(ie.FormattedMessage,{id:"signup_success_text",values:{p:t=>c.jsx("p",{children:t})}})]});const E_={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},__=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=ie.useIntl(),{title:u=!0,expectation:d=!1,url:m=!0,logInButton:h=!0,successMessage:p=!0}=i,v={title:u,expectation:d,url:m,logInButton:h,successMessage:p},[f,b]=y.useReducer(ri,E_),{validFields:g,emailDetails:x,shouldManuallyApprove:C,shouldDisableButton:A,showSuccessMessage:E,showError:_}=f,[T,M]=uo.useCookies(["signup-this-session","functional-cookie-consent"]),O={form:y.createRef(),name:y.createRef(),email:y.createRef(),jobTitle:y.createRef(),organisation:y.createRef(),tc:y.createRef(),hiddenValidation:y.createRef()};y.useEffect(()=>{C===!0&&O.jobTitle.current&&O.jobTitle.current.focus()},[C]),y.useEffect(()=>{T["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[T]),y.useEffect(()=>{E&&T["functional-cookie-consent"]&&M("signup-this-session","true",{path:"/",maxAge:3600})},[E]);const L=y.useMemo(()=>C_({placeholders:n,labels:t,shouldShow:v,functions:r,refs:O,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,O,v,f]),$=A?!0:C?!Object.values(g).every(B=>B===!0):!g.name||!g.email||["exists","pending","verify"].includes(x.boxType);return v.successMessage&&E?c.jsx(D_,{className:e}):c.jsxs("fieldset",{className:H("signup-form-fieldset",e),"data-testid":"signup-form",children:[v.title&&c.jsx("p",{className:"signup-title",children:c.jsx(ie.FormattedMessage,{id:"signup_title"})}),_&&c.jsx(Cn,{variant:"error",text:l.formatMessage({id:"signup_error"})}),c.jsx(Jt,{className:"signup-form",formRef:O.form,id:"sign-up-form",fields:L,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:$?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:`/api/next-ui/login?returnTo=${window.location.pathname}`,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:v.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await w_({refs:O,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:B=>{r.handleError(B),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),c.jsx("button",{className:"validation-button",ref:O.hiddenValidation})]})};const _n=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return c.jsx("section",{className:H("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const k_=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),c.jsx(_n,{className:H("download-section",n),styling:{background:"dark"},children:c.jsxs("div",{className:"content-default",children:[y.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),c.jsx(gr,{buttons:r})]})})};const oo="editSection_";function oh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const F_=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:s}=ie.useIntl();return c.jsxs(Ft,{variant:"muted",icon:e,children:[c.jsx("p",{children:t||s({id:`${oo}placeholder_description`})}),i&&c.jsx("p",{children:c.jsx(Be,{href:r,variant:"secondary",size:"small",onClick:()=>oh({href:r,setShowModal:a}),children:n||s({id:`${oo}placeholder_cta`})})})]})},A_=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:d}=ie.useIntl(),[m,h]=y.useState(!1),p=()=>h(!1),v=!!n||!!r,f=typeof i=="string"||v;let b;return r&&(b=y.cloneElement(r,{functions:{...r.props.functions,onSuccess:async g=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(g)}finally{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),c.jsxs("section",{className:H("edit-section",t),children:[v&&c.jsx(un,{title:o||`Edit ${a}`,isOpen:m,showDivider:!1,showIcon:!1,functions:{onClose:p},className:H("edit-section-modal"),children:b||(n?c.jsx(Jt,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async g=>{var x,C;(x=n==null?void 0:n.functions)!=null&&x.onSuccess&&await((C=n==null?void 0:n.functions)==null?void 0:C.onSuccess(g)),h(!1)},onCancel:p}}):c.jsx(c.Fragment,{}))}),c.jsxs("div",{className:H("edit-section-header",{"no-title":!s}),children:[s&&c.jsx("h2",{className:"edit-section-header-title",children:a}),f&&c.jsx(Be,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>oh({href:i,setShowModal:h}),children:d({id:`${oo}edit`})})]}),e||c.jsx(F_,{...l,href:i,setShowModal:h,showEditButton:f}),u&&c.jsx(qt,{})]})};const B_=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return c.jsxs("div",{className:H("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&y.createElement(s.element,{className:H("title",s.className)},s.text),t&&c.jsx("p",{children:t}),c.jsx("ul",{className:H({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:d,nameOfBusiness:m,link:h=!1,description:p=!1},v)=>{if(!d||!d.url)return null;const f=c.jsx("img",{src:d.url,width:d.width||"auto",height:d.height||"auto",alt:m});return c.jsxs("li",{children:[c.jsx("p",{className:"img-wrapper",children:h?c.jsx("a",{href:h,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),p&&c.jsx("small",{children:p})]},window.btoa(`${d.url}_${v}`))})})]})};let bs;const ys="contactFooter_",T_=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=y.useRef(null),[r,i]=y.useState(0),[a,s]=y.useState(!1),o=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(s(!0),clearTimeout(bs),bs=setTimeout(()=>{o(),s(!1)},500))};return y.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(bs),window.removeEventListener("resize",l)}),[]),c.jsx(_n,{id:"contactForm",className:"contact-footer",children:c.jsxs("div",{className:"inner-wrapper",children:[c.jsx("h2",{children:c.jsx(ie.FormattedMessage,{id:`${ys}title`})}),c.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[c.jsxs("aside",{children:[c.jsx("p",{children:c.jsx(ie.FormattedMessage,{id:`${ys}text`})}),c.jsx(wn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:c.jsx(ie.FormattedMessage,{id:`${ys}email`})})]}),c.jsx(nh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},S_=({activeLink:e,profile:t,...n})=>c.jsx(_n,{children:c.jsx(Ef,{layout:"1-3",children:c.jsxs(c.Fragment,{children:[c.jsx(Df,{activeLink:e,profile:t}),c.jsx(jd,{...n})]})})});const xs="cookieBanner_",ws=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Cs=new Date(Date.now()+12*30*24*60*60*1e3),uh=()=>{const e=ie.useIntl(),[t,n,r]=uo.useCookies(ws),[i,a]=y.useState(!t["apol-cookie-banner"]),s=()=>{ws.forEach(d=>{n(d,!0,{path:"/",expires:Cs,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Cs}),ws.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:Cs});return}r(d)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(d=>{u.push({variant:d.href?"tertiary":"primary",href:d.href,onClick:d.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${d.gtmType}-click`,children:e.formatMessage({id:`${xs}buttons_${d.id}`})})}),c.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[c.jsx("h6",{children:e.formatMessage({id:`${xs}title`})}),c.jsx("p",{children:e.formatMessage({id:`${xs}text`})}),c.jsx(gr,{buttons:u})]})},tn={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-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:["news","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-click"},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","ai"],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"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Qn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Qn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Qn.support,gtmType:"concierge-email-click"},business:{email:Qn.general,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 rr="footer_",aa="SiteFooter",rd=({group:e})=>{const t=tn[e].order||[];let n=!1;return"text"in tn[e]&&(n=tn[e].text),c.jsxs(y.Fragment,{children:[c.jsx("p",{className:"pre-title",children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}`})}),Array.isArray(t)&&t.length>0&&c.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=tn[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),c.jsx("li",{children:c.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":aa,"data-gtm-event-type":a,...s,children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&c.jsx("dl",{className:"text-medium",children:n.order.map(r=>c.jsxs(y.Fragment,{children:[c.jsx("dt",{children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}`})}),c.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&c.jsx("address",{children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}_address`,values:{br:c.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&c.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":aa,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},cu=()=>c.jsx("div",{id:"footer",children:c.jsxs("div",{className:"wrapper",children:[c.jsx(la,{element:"hr"}),c.jsx(Po,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":aa,"data-gtm-event-type":"logo-homepage-link"}),c.jsx("footer",{children:["platform","community","company","contact"].map(e=>c.jsxs("div",{className:"group",children:[c.jsx(rd,{group:e}),Object.keys(tn[e]).includes("child")&&c.jsx(rd,{group:tn[e].child})]},e))}),c.jsx("hr",{}),c.jsxs("div",{className:"sub-footer",children:[c.jsx("ul",{children:Array.isArray(tn.social.order)&&tn.social.order.map(e=>{const t=tn.social[e];return c.jsx("li",{className:e,children:c.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":aa,"data-gtm-event-type":"social-click",children:c.jsx("span",{className:"hidden",children:c.jsx(ie.FormattedMessage,{id:`${rr}social_${e}`})})})},e)})}),c.jsx("small",{children:c.jsx(ie.FormattedMessage,{id:`${rr}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),We={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=a=>{const s=`logged${e?"In":"Out"}`;return t>=n[a][s]};let i={};return["navigation","search"].forEach(a=>{i[a]=r(a)}),i},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:i=!1})=>{if(!i&&n[e]===t||!i&&e===kt.ACCOUNT&&t===!1&&n[kt.SITE]===!0)return;const a=Date.now();if(!i&&!t&&We.handlerCalled[e]&&a-We.handlerCalled[e]<500)return;We.handlerCalled[e]=a;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case kt.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case kt.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case kt.ACCOUNT:o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const i=ld(e[r],t);if(!(typeof i>"u")&&(!n||i[t]&&i[t].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return e[r]}return e[0].children?We.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{var l;if(!t.current||!t.current.children)return;const a=n?"desktop":"default";if(r[e][a]){(l=document.querySelector(`#header ul a[href="${r[e][a]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case kt.SITE:if(n){const u=We.findFirstChild(t.current.children,"className","has-submenu parent"),d=We.findFirstChild(u.children,"id",kt.SITE);s=We.findFirstChild(d.children,"href")}else s=We.findFirstChild(t.current.children,"href");break;case kt.ACCOUNT:if(o=We.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=We.findFirstChild(o.children,"href");break;default:return}s&&(i([{type:`focusElements.${e}.${a}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(We.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(We.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(We.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{We.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},ni={order:["home","communities","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},communities:{href:"/communities/",gtmType:"communities-click",onlyShow:"logged-in"},topics:{order:["explore","topics"],menuId:"site-navigation",explore:{order:["events","courses","articles","communities"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"},communities:{href:"/communities/",gtmType:"communities-click",className:"icon communities"}},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:{menuId:"account-navigation",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:"/api/next-ui/login",withReturnTo:!0},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},sa=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:a=null})=>{const s=ie.useIntl(),o=ld(ni,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=a===null?l?o.doTrack:!0:a,d=e.includes("buttons.");let m=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(m+=`_logged${t?"In":"Out"}`);let h=!1;if(o.href){let C=o.gtmType||`${e}-click`;if(C.includes(".")){const A=C.split("."),E=A[A.length-2];C=`${E==="topics"?`${E}-`:""}${A[A.length-1]}`}h={href:o.withReturnTo?`${o.href}?returnTo=${window.location.pathname}`:o.href},u&&(h={...h,className:"gtm-trackable","data-gtm-event-type":C,"data-gtm-event-context":"HeaderButtons"}),d&&(h={...h,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const p=o.order&&o.order[0]&&o[o.order[0]],v=p&&o[o.order[0]].order,f=h&&window.location.pathname===o.href;let b={},g={},x={};if(f&&(b={...b,"aria-current":"page"}),p){const C=o.menuId||e,A={onClick:E=>We.events.onClick(E,{id:C,callback:i,isOpen:r[C]}),onFocus:()=>We.events.onFocus({id:C}),onBlur:()=>We.events.onBlur({id:C,callback:i}),onMouseLeave:()=>We.events.onBlur({id:C,callback:i}),onMouseEnter:()=>We.events.onMouseEnter({id:C,callback:i})};g={...A,id:C===kt.SITE?kt.SITE:kt.ACCOUNT},n&&(v&&(x={...A,className:"navigation-button",onKeyPress:E=>{E.key==="Enter"&&We.events.onClick(E,{id:C,callback:i,isOpen:r[C]})},"aria-haspopup":!0,"aria-expanded":r[C],"aria-controls":C}),g={...g,hidden:C in r?!r[C]:!0}),v||(g={...g})}return c.jsxs("li",{className:H({[o.className]:o.className,"has-submenu":p,parent:v,active:f}),...b,children:[h?y.createElement(d?Be:"a",h,s.formatMessage({id:m})):n&&o.order&&v?c.jsxs("button",{...x,children:[s.formatMessage({id:m}),c.jsx(Me,{children:s.formatMessage({id:`header_menu_${r[kt.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:m}),o.order&&c.jsx("ul",{...g,children:o.order.map(C=>{if(!o[C])return null;const A={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:l?u:null};return o[C].order?c.jsxs("li",{className:H({[o[C].className]:o[C].className}),children:[s.formatMessage({id:`${m}_${C}`}),c.jsx("ul",{children:o[C].order.map(E=>c.jsx(sa,{id:`${e}.${C}.${E}`,...A},E))})]},C):c.jsx(sa,{id:`${e}.${C}`,...A},C)})})]},e)};const j_={height:67,height_desktop:83};var kt=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(kt||{});const du=({showNavigation:e=!0})=>{const t=ie.useIntl(),n=y.useContext(st),r=xn(!0,!0),i=n&&typeof n.id=="string",a=y.useMemo(()=>We.getIsDesktopVersion(i,r),[i,r]),[s,o]=y.useReducer(ri,{headerIsVisible:!0,menus:{"site-navigation":!1,search:!1,"account-navigation":!1},focusElements:{"site-navigation":{desktop:!1,default:!1},"account-navigation":{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:d}=s,m=y.useRef(s);y.useEffect(()=>{m.current=s},[s]),pd({scrollPosition:j_[`height${a.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const g=m.current.menus;!a&&g["site-navigation"]||We.shouldChangeHeaderIsVisible(!0,g,o)},scrollDown:()=>{const g=m.current.menus;!a&&g["site-navigation"]||We.shouldChangeHeaderIsVisible(!1,g,o)}}});const h=(g,x,C=!1)=>{We.handleMenus({id:g,value:x,menus:m.current.menus,dispatch:o,forceHandle:C})},p=y.useRef(null),v=g=>{g.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(x=>{m.current.menus[x]&&h(x,!1,!0)})};y.useEffect(()=>{var g;return(g=document.getElementById("header"))==null||g.addEventListener("keydown",v),()=>{var x;(x=document.getElementById("header"))==null||x.removeEventListener("keydown",v)}},[]),or(()=>{u["site-navigation"]&&We.autoFocus({menu:"site-navigation",navigationRef:p,isDesktopVersion:a.navigation,focusElements:d,dispatch:o})},[u["site-navigation"]]),or(()=>{u["account-navigation"]&&We.autoFocus({menu:"account-navigation",navigationRef:p,isDesktopVersion:a.navigation,focusElements:d,dispatch:o})},[u["account-navigation"]]);const f=c.jsxs(c.Fragment,{children:[!a.search&&c.jsx("button",{className:"search toggle-search-button",onClick:g=>{g.preventDefault(),g.stopPropagation(),h("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:c.jsx(Me,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),c.jsx(sh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:a.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=c.jsxs(c.Fragment,{children:[!a.navigation&&c.jsx("button",{className:"menu-button gtm-trackable",onClick:g=>{g.preventDefault(),g.stopPropagation(),h("site-navigation",!u["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u["site-navigation"],"aria-controls":"site-navigation",children:c.jsx(Me,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),c.jsx("ul",{ref:p,id:"navigation",hidden:a.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!a.navigation&&u["account-navigation"]?"account":"default",children:ni.order.map(g=>c.jsx(sa,{id:g,isLoggedIn:i,isDesktopVersion:a.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:h},g))})]});return n&&n.isLoading?null:c.jsxs(c.Fragment,{children:[c.jsxs("nav",{id:"header",className:H({"logged-in":i,"logged-out":!i,visible:l}),children:[c.jsx(Me,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),c.jsx(Po,{variant:"monochrome"}),e&&c.jsxs(c.Fragment,{children:[a.navigation?c.jsxs(c.Fragment,{children:[b,f]}):c.jsxs(c.Fragment,{children:[f,b]}),i?c.jsxs("button",{className:"account-button",onClick:g=>We.events.onClick(g,{id:"account-navigation",callback:h,isOpen:u["account-navigation"]}),onMouseEnter:()=>We.events.onMouseEnter({id:"account-navigation",callback:h}),onMouseLeave:()=>We.events.onBlur({id:"account-navigation",callback:h}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[c.jsx(Me,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),c.jsx(on,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):c.jsx("ul",{className:"sign-in-buttons",children:ni.buttons.order.map(g=>c.jsx(sa,{id:`buttons.${g}`},g))})]})]}),c.jsx("hr",{id:"content-of-page"}),c.jsx("div",{className:H("overlay",{open:u["site-navigation"]||u["account-navigation"]||!a.search&&u.search})})]})};const P_=()=>{const e=ie.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(du,{}),c.jsx("div",{id:"content",children:c.jsx(Cn,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),c.jsx(cu,{})]})},lh=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:a={},className:s="",locale:o="en"})=>{const l=ie.useIntl(),{navigation:u=!0,footer:d=!0}=i,{background:m="default",variant:h="default",circle:p="default",modal:v="default"}=a,f=md(),[b,g]=y.useState(""),x=T=>{const{detail:{message:M}}=T;g(M)};y.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",x),()=>{document.removeEventListener("ariaLive",x)}),[f]);const C=ji(e,{locale:o}),A=ji(t,{locale:o}),E=ji(n,{locale:o}),_={};return m!=="default"&&(_[m]=!0),h!=="default"&&(_[h]=!0),p!=="default"&&(_[p]=!0),c.jsx(Sh.ErrorBoundary,{onError:r,fallback:c.jsx(P_,{}),children:c.jsxs(y.Suspense,{fallback:null,children:[c.jsxs("div",{id:"wrapper",className:H(s,_,{"has-footer":d}),"data-too-small":l.formatMessage({id:"pageLayout_browserTooSmall"}),children:[c.jsx(du,{showNavigation:u}),c.jsxs("main",{id:"content-wrapper",children:[A&&c.jsx("div",{className:H("additional-content prepended",{"large-modal":v==="large"}),children:A}),y.createElement(m==="bold"?yo:"div",{id:"content",children:C,className:H({"large-modal":v==="large"})})]}),E&&c.jsx("div",{className:"additional-content appended",children:E}),d&&c.jsx(cu,{}),c.jsx(uh,{})]}),b&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:b})]})})},id={default:"tags_",headerTopics:"header_topics_topics_"},Ds={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"},O_={getTagDetails:e=>{if(e.includes("topic_")){if(e=Ds.topic[e.replace("topic_","")],e){const t=ni.topics.topics[e].href;return t?{id:e,href:t,text:`${id.headerTopics}${e}`}:null}return null}return Ds[e]?(e=Ds[e],{id:e,text:`${id.default}${e}`}):null}};const M_=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:a="tag-click",gtmContext:s="tags"})=>{const o=ie.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const d=O_.getTagDetails(u);d&&l.push(d)}),l.length<1?null:c.jsx("ul",{className:H("tags text-small",t,i,{"one-line":n}),children:l.map(u=>{const d=o.formatMessage({id:u.text});return c.jsx("li",{children:u.href&&r?c.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":a,"data-gtm-event-context":s,children:d}):d},u.id)})})};const ch=25,N_=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:i=!1,loadNextPage:a=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:d=!1,className:m=""})=>{const h=ie.useIntl(),p="membersList",v=y.useContext(st),[f,b]=y.useState(!1);return e.length===0&&!d?null:c.jsxs("div",{className:H("members-list",m),children:[u?c.jsxs("h1",{children:[h.formatMessage({id:p}),c.jsx("span",{className:"count",children:t})]}):c.jsx(c.Fragment,{}),c.jsxs("ul",{children:[r?c.jsxs("li",{children:[c.jsx(rn,{member:v,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:n||""},{scope:dt.Platform,area:"all"}]}}),c.jsx(wn,{href:"/profiles/me",className:"text-small",onClick:g=>{g==null||g.preventDefault(),g==null||g.stopPropagation(),b(!0)},children:h.formatMessage({id:`${p}_profile`})})]}):c.jsx(c.Fragment,{}),e.map((g,x)=>v&&g.id===v.id?c.jsx(c.Fragment,{}):c.jsxs("li",{children:[c.jsx(rn,{member:g,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:n||""},{scope:dt.Platform,area:"all"}]}}),g.isAdmin&&c.jsx(Yt,{children:h.formatMessage({id:`${p}_admin`})})]},x)),d&&e.length===0&&t>0?[...new Array(Math.min(t,ch))].map((g,x)=>c.jsx("li",{children:c.jsx(ma,{layout:"member"})},x)):c.jsx(c.Fragment,{})]}),i&&c.jsx(ii,{hasNextPage:i,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},gtmContext:o}),s?c.jsx(Ea,{form:s,showModal:f,content:{title:h.formatMessage({id:`${p}_modal_title`})},functions:{onClose:()=>{b(!1)}}}):c.jsx(c.Fragment,{})]})},dh=N_,I_=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const i=ie.useIntl();return t?c.jsx("small",{children:$t(i.formatMessage,`${e}explainer`,n,"action",{a:a=>c.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:a})})}):c.jsx(c.Fragment,{})},R_=({intlPath:e,type:t,...n})=>{const r=ie.useIntl();return c.jsx(ru,{label:{visible:r.formatMessage({id:`${e}label`}),screenreader:$t(r.formatMessage,`${e}label_action`,t,"action")},...n})},ad=5,sd=2,$_=e=>{var r;let t=0;const n=[];return(r=e==null?void 0:e["poll-options"])==null||r.forEach((i,a)=>{i!==""&&(t++,n.push({position:t,description:{en:i}}))}),{title:{en:e.title},options:n,settings:{allow_multiple_votes:e["multiple-answers"]||!1}}};let Gn=null;const Qe="discussion_form_",si=({id:e,parentId:t,content:n={type:Te.Response,slugs:{}},userHasPermissions:r=!0,meta:i,placeholder:a,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},functions:u,data:d={},gtmContext:m="DiscussionForm"})=>{var Z,se,ve;const h=ie.useIntl(),p=y.useContext(st),[v,f]=y.useState(n.type),[b,g]=y.useState(""),{isLoading:x=!1,isInWrapper:C=!1,isInOverlay:A=!1,isAutoFocused:E=!1,isEditing:_=!1,hasTitleField:T=!1,canBePrepopulated:M=!1,isPrepopulated:O=!1,showTitle:L=!1,showGuidelines:$=!0,showDivider:B=!1,showSuccessMessage:F=!0,showPostType:S=!1,postCategories:N=[]}=i||{},{onChange:V=()=>{},create:W=()=>{},createPoll:ae=()=>Promise,handleSaveEdit:te=()=>{},handleCancel:D=()=>{},callback:Q=()=>{},onMention:Y=()=>{},listMembers:k=()=>Promise.resolve([]),clickMentionFallback:j=()=>{},getLinkPreview:q=()=>Promise.resolve({}),props:P={create:{projectNames:["questions-answers"]}}}=u,[z,ee]=y.useState({body:_&&_.text||O&&O.text||"",data:d!=null&&d.link?{link:d==null?void 0:d.link}:{}}),[U,X]=y.useState(l.error||!1),oe={status:!1,title:T&&T.text||"",polls:0},[J,pe]=y.useState(oe);y.useEffect(()=>{M&&!_&&O&&O!==z.body&&ee(ue=>({...ue,body:O.text||""}))},[O]),y.useEffect(()=>{f(n.type)},[n.type]);const de=Ur((ue,be)=>{ee(he=>({...he,body:ue,data:{link:be}})),V({body:ue});let Ee;!p||!p.id?Ee=$t(h.formatMessage,`${Qe}error_loggedOut`,v,"action"):r?s>0&&ue.length>=s&&(Ee=`${Qe}error_tooLong`):Ee=$t(h.formatMessage,`${Qe}error_noPermission`,v,"action"),Ee?X(Ee):U&&X(!1)},50);let ye=`${v}-form`;if(v===Te.Response||v===Te.Reply){const ue=((Z=n.slugs)==null?void 0:Z.reply)||((se=n.slugs)==null?void 0:se.answer)||((ve=n.slugs)==null?void 0:ve.question)||"";ue&&(ye=`${ye}-${ue.slice(-15)}`)}e&&(ye=`${e}-${ye}`);const Ae=async ue=>{if(!p||!p.id||!r||Ke)throw new Error("You do not have permission to post.");Gn&&clearTimeout(Gn),pe(Ee=>({...Ee,status:"submitting"}));const be=window.location.pathname;try{let Ee;switch(v){case Te.Post:Ee=await W({title:ue.title,content:ue.body,categories:ue.postType,data:ue.data});break;case Te.Poll:Ee=await ae($_(ue));break;case Te.Question:Ee=await W({title:ue.body,authorId:p&&p.id,data:ue.data,...P==null?void 0:P.create});break;case Te.Response:Ee=await W({questionSlug:n.slugs.question},{body:ue.body,authorId:p&&p.id,contentPath:be,data:ue.data});break;case Te.Reply:Ee=await W({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:ue.body,authorId:p&&p.id,contentPath:be,data:ue.data});break;default:break}return await Hh(1e3),Q&&await Q(Ee),Gn=setTimeout(()=>{ee({body:"",data:{}}),f(Te.Post),pe(Fe=>({...Fe,status:"submitted"})),g($t(h.formatMessage,`${Qe}success`,v,"action"));const he=new Event(it.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(he),Ce()},850),Ee}catch(Ee){const he=Ee;let Fe=`${Qe}error`;he!=null&&he.message.includes("entry already exists")&&(Fe=$t(h.formatMessage,`${Qe}error_alreadyExists`,v,"action")),he!=null&&he.message.includes("429")?Fe=$t(h.formatMessage,`${Qe}error_tooMany`,v,"action"):he!=null&&he.message.includes("400")&&(Fe=`${Qe}error`),X(Fe),Ce()}},Ce=()=>{Gn=setTimeout(()=>{X(!1),pe(oe),g("")},5e3)},Ve=Ur(async ue=>{const be={...z,...ue};if(_){pe(Ee=>({...Ee,status:"submitting"})),te(be);return}try{if(!await Ae(be))throw Error("No response from handleSubmit")}catch{Gn&&clearTimeout(Gn)}},100);if(x)return c.jsx(It,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const Le=!z.body||!Hr(z.body),ze=!J.title||!Hr(J.title);let Ke=!1;v!==Te.Poll&&(Ke=Le),T&&(Ke=Ke&&ze);const je=J.status==="submitting",Ne=[];v===Te.Poll?Ne.push({id:"poll-options",label:h.formatMessage({id:`${Qe}option_label`}),type:"multiple-inputs",element:"textarea",placeholder:h.formatMessage({id:`${Qe}option_placeholder`}),limit:100,multipleInputs:{showCount:!0,defaultInputs:sd,maxInputs:ad,hasButton:{variant:"secondary",size:"small",styling:{muted:!0},icon:"plus",children:h.formatMessage({id:`${Qe}option_cta`})}},styling:{autosizeToFit:!0},functions:{onChange:ue=>{var Ee;let be=0;ue&&Array.isArray(ue)&&(be=((Ee=ue==null?void 0:ue.filter(he=>he!==""))==null?void 0:Ee.length)||0),J.polls!==be&&pe(he=>({...he,polls:be})),V({polls:ue})}},validation:[{condition:"required"}]},{type:"checkbox",id:"multiple-answers",label:h.formatMessage({id:`${Qe}multiplePollAnswers`}),className:"text-medium"}):Ne.push({component:R_,props:{formID:ye,intlPath:Qe,showLabel:T!==!1,type:v}},{component:lu,props:{id:`${ye}-input`,value:J.status==="submitting"&&!U?"":z.body,placeholder:a||$t(h.formatMessage,`${Qe}placeholder`,v,"action"),maxLength:s,meta:{isInOverlay:A},functions:{onChange:de,onChangeData:ue=>{ee(be=>({...be,data:ue}))},onMention:Y,listMembers:k,clickMentionFallback:j,getLinkPreview:q},data:d,autoFocus:_!==!1||E&&!T,"aria-invalid":!!U,"aria-errormessage":"error-message"}},{component:I_,props:{intlPath:Qe,showGuidelines:$,type:v,gtmContext:m}}),B&&Ne.push({component:qt}),T&&Ne.unshift({id:"title",type:"textarea",value:T.text,limit:250,label:h.formatMessage({id:`${Qe}${v===Te.Poll?"question":"titleField"}_label`}),styling:{autosizeToFit:!0},placeholder:h.formatMessage({id:`${Qe}${v===Te.Poll?"question":"titleField"}_placeholder`}),functions:{onChange:ue=>{pe(be=>({...be,title:ue})),V({title:ue})}},validation:v===Te.Poll?[{condition:"required"}]:[]}),S&&Ne.unshift({id:"postType",type:"radio",value:"no-category",accessibilityOptions:{checkboxes:{navigateWithArrowKeys:!0}},styling:{displayOptionsAsPills:!0},label:h.formatMessage({id:`${Qe}postType_label`}),options:N.map(ue=>({id:ue.slug,label:ue.name})),validation:[{condition:"required"}],functions:{onChange:ue=>{V({postType:ue}),ue.includes(Te.Poll)?f(Te.Poll):v!==Te.Post&&f(Te.Post)}}});let we=!p||!p.id||!r||je;if(v===Te.Poll){const ue=J.polls;we=we||ze||ue<sd||ue>ad}else we=we||Ke,_&&(T?we=we||z.body===_.text&&J.title===T.text:we=we||z.body===_.text);return c.jsxs(c.Fragment,{children:[c.jsxs(Jt,{id:ye,className:H("discussion-card discussion-form",{"no-styling":C&&_}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:_&&!je||l.cancel},functions:{onSuccess:async ue=>{await Ve(ue)},onCancel:D},fields:Ne,intlPath:Qe,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":m,"data-gtm-event-type":`${_?"save":"submit"}-${v}-click`,"data-testid":"save-button",disabled:we,text:{default:!_&&(o!=null&&o.submit)?o==null?void 0:o.submit:h.formatMessage({id:`${Qe}${_?"save":"post"}`}),submitting:h.formatMessage({id:`${Qe}${_?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":m,"data-gtm-event-type":`cancel-${v}-click`,disabled:!l.cancel&&(!p||!p.id||!z.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:h.formatMessage({id:`${Qe}cancel`})},gtm:{context:m,event:`${v}-form`},"data-testid":`discussion-${v}-form`,children:[L&&!_&&v===Te.Question&&c.jsx("h2",{children:$t(h.formatMessage,`${Qe}title`,v,"action")}),c.jsx(rn,{member:p?{...p,link:!1}:"community",gtmContext:m,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:t||""},{scope:dt.Platform,area:"all"}]}})]}),J.status==="submitted"&&F&&c.jsx(ur,{className:"success","data-testid":"success",children:$t(h.formatMessage,`${Qe}success`,v,"action")}),U&&c.jsx(ur,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof U=="string"?U.includes(" ")?U:h.formatMessage({id:U},{action:h.formatMessage({id:`discussion_action_${v}`}),maxLength:s}):U}),b&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:b})]})},L_=Object.freeze(Object.defineProperty({__proto__:null,default:si},Symbol.toStringTag,{value:"Module"}));const z_={showForm:!1},Da=y.createContext(z_),fh=({children:e})=>{const[t,n]=y.useState({showForm:!1});return c.jsx(Da.Provider,{value:{...t,updateConversation:n},children:e})};function q_({author:e,originalAuthorId:t,createdAt:n,contentData:r,content:i,gtmContext:a,badges:s}){var m;const o="discussion_",l=ie.useIntl(),u=(m=i==null?void 0:i.componentProps)==null?void 0:m.member.additionalContent,d=u?u.customMessage:void 0;return c.jsxs("div",{className:"author-section",children:[c.jsx(rn,{member:e,additionalContent:{createdAt:n,didEdit:r.didEdit,customMessage:d},className:H({highlighted:typeof e!="string"&&e.id===t}),styling:{additionalContentNewLine:!!d},gtmContext:a,gtmType:"profile-click",badges:s}),i.pinned&&c.jsx(Yt,{variant:"naked",size:"xlarge",icon:"pin",children:c.jsx(Me,{children:l.formatMessage({id:`${o}pinned_post`})})})]})}const Es=({children:e,class:t,...n})=>{const r={...n,class:H("subtle",t)};return c.jsx("blockquote",{...r,children:e})};function U_({content:e}){var t;return!e||!((t=e.categories)!=null&&t.length)?c.jsx(c.Fragment,{}):c.jsx("ul",{className:"categories-list",children:e.categories.map(n=>!n.slug||!n.name?c.jsx(c.Fragment,{}):c.jsx(Yt,{size:"small",element:"li",children:n.name},n.slug))})}var oa=(e=>(e.Always="always",e.AfterVoting="after-voting",e))(oa||{});const W_=(e,t,n)=>n===void 0?0:e.some(i=>i.hasUserVoted)?t?e.findIndex(i=>!i.hasUserVoted):e.findIndex(i=>i.hasUserVoted):0,V_=(e,t,n,r=0)=>{if(!e)return{nextElement:null,nextIndex:0};let i=n==="next"?e.nextElementSibling:e.previousElementSibling,a=r+(n==="next"?1:-1);for(;i;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}const s=e.parentElement;if(s)for(i=n==="next"?s.firstElementChild:s.lastElementChild,a=n==="next"?0:s.childElementCount-1;i&&i!==e;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}return{nextElement:null,nextIndex:0}};const H_=({user:e,option:t,optionIndex:n,totalPollVotes:r=0,allowMultipleVotes:i=!1,showResults:a=!1,hasVotedOnPoll:s=!1,isTabbable:o=!1,functions:l})=>{var b;const[u,d]=y.useState(t.hasUserVoted);let m=0,h={};const p=(i||!s)&&!t.hasUserVoted;a&&(m=Math.round(t.numVotes/r*100)||0,h={"--vote-perc":`${m}%`});const v=g=>{g.stopPropagation(),p&&(l==null||l.createVote(t),d(!0))},f={htmlFor:t.id,className:H({"can-vote":p}),tabIndex:o&&p?0:-1,"data-testid":"poll-option-label","data-gtm-event-type":"poll-option-click","data-gtm-event-context":"PollOption","aria-selected":t.hasUserVoted,onClick:v,onKeyDown:g=>{var x;if(g.code!=="Tab")switch(g.code){case"Enter":case"Space":g.preventDefault(),g.stopPropagation(),v(g),d(!0);break;case"ArrowUp":case"ArrowDown":g.stopPropagation(),g.preventDefault();const C=g.code==="ArrowUp"?"prev":"next",{nextElement:A,nextIndex:E}=V_(g.currentTarget.parentElement,"selected",C,n);A&&((x=A.querySelector("label"))==null||x.focus(),l==null||l.setTabbableOption(E));break}}};return c.jsxs("li",{"data-testid":"poll-option",style:h,className:H("poll-option text-small",{selected:t.hasUserVoted}),children:[c.jsx("label",{...f,children:c.jsx("span",{children:t.label})}),a&&c.jsxs("div",{className:"vote-details",children:[t.hasUserVoted&&c.jsx(on,{className:"author-profile-picture",name:e.name,src:(b=e==null?void 0:e.image)==null?void 0:b.thumbnail}),c.jsxs("p",{className:"vote-perc text-medium","data-testid":"vote-perc",children:[m,"%"]})]}),c.jsx("input",{type:i?"radio":"checkbox",id:t.id,name:t.id,checked:u,tabIndex:-1})]})};const mh=({title:e,options:t,settings:n,functions:r})=>{const i="poll_",a=ie.useIntl(),s=y.useContext(st),{showRemoveVote:o=!1,allowMultipleVotes:l=!1,resultsVisibility:u=oa.AfterVoting}=n||{},[d,m]=y.useState(W_(t,l,s==null?void 0:s.id)),h=t.reduce((g,x)=>g+x.numVotes,0),p=t.filter(g=>g.hasUserVoted).length,v=t.filter(g=>g.hasUserVoted),f=y.useCallback(async g=>{await r.createVote({reactionId:g.id})},[]),b=y.useCallback(async()=>{t.forEach(async g=>{g.hasUserVoted&&g.userVote&&r.removeVote({reactionId:g.userVote.id})})},[t]);return c.jsxs("div",{className:"poll-wrapper",children:[c.jsx("p",{className:"poll-title",children:e}),c.jsxs("aside",{className:"poll-info",children:[c.jsx("p",{className:"poll-instructions","data-testid":"poll-instructions",children:c.jsx("small",{children:a.formatMessage({id:`${i}instructions`},{allowMultipleVotes:l})})}),c.jsx("p",{className:"poll-num-votes",children:c.jsx("small",{"data-testid":"poll-total-votes",children:a.formatMessage({id:`${i}num_votes`},{number:h})})}),o&&c.jsx("p",{className:"poll-remove-vote",children:c.jsx(Be,{variant:"tertiary",onClick:b,"data-testid":"remove-votes-button",disabled:p===0,children:c.jsx("small",{children:a.formatMessage({id:`${i}remove_vote_button`},{number:p})})})})]}),t&&c.jsx("form",{children:c.jsx("fieldset",{children:c.jsx("ul",{className:"poll-options",children:t==null?void 0:t.map((g,x)=>c.jsx(H_,{isTabbable:d===x,user:s,option:g,optionIndex:x,totalPollVotes:h,showResults:u==oa.Always||!!p,allowMultipleVotes:l,hasVotedOnPoll:!!p,functions:{createVote:f,setTabbableOption:m}},g.id))})})}),c.jsxs(Me,{"aria-live":"polite",children:[a.formatMessage({id:`${i}aria_votes`},{number:p}),!!p&&c.jsx("ul",{children:v.map(g=>c.jsx("li",{children:g.label}))})]})]})};function K_({content:e,contentData:t,functions:n}){return c.jsx(mh,{title:t.title,options:(e==null?void 0:e.pollOptions)||[],settings:(e==null?void 0:e.pollSettings)||{},functions:{createVote:n.createVote,removeVote:n.removeVote}})}function Z_({links:e={},contentData:t,postCutOff:n,content:r}){var i;return c.jsxs(c.Fragment,{children:[e.post?c.jsxs("a",{href:e.post,children:[(t==null?void 0:t.title)&&c.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),t.postBody.length>n?c.jsx(Sd,{text:t.postBody,markdownOptions:{overrides:{a:Ps,blockquote:{component:Es}}}}):c.jsx(Pn,{options:{overrides:{a:Ps,blockquote:{component:Es}}},children:t.postBody})]}):c.jsxs(c.Fragment,{children:[(t==null?void 0:t.title)&&c.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),c.jsx(Pn,{options:{wrapper:r.type===Te.Question?"h1":y.Fragment,forceWrapper:r.type===Te.Question,forceInline:r.type===Te.Question,forceBlock:r.type!==Te.Question,overrides:{blockquote:{component:Es}}},children:t.postBody})]}),(i=t.data)!=null&&i.link?c.jsx(jo,{data:t.data.link}):c.jsx(c.Fragment,{})]})}const Rt="discussion_",Y_=195;let Ai=null;const oi=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:i=!1,originalAuthorId:a,forceHide:s,functions:o,links:l={},className:u,gtmContext:d="DiscussionAnswer",children:m,isTruncated:h=!1,setFocus:p=!1,isCommunity:v=!1,badges:f,basePath:b,parentId:g,locale:x="en"})=>{var Z,se,ve,ue,be,Ee;const C=ie.useIntl(),A=y.useContext(Da),E=y.useContext(st),{createContent:_=async()=>{},deleteContent:T=async()=>{},updateContent:M=async()=>{}}=o.content||{},{createLike:O=()=>{},deleteLike:L=()=>{},listLikes:$=async()=>({})}=o.likes||{},{openComments:B=()=>{}}=o.comments||{},{listMembers:F=()=>Promise.resolve([]),clickMentionFallback:S=()=>{}}=o.form||{},{createVote:N=()=>{},removeVote:V=()=>{},removePoll:W=()=>{}}=o.polls||{},{author:ae,canLike:te,createdAt:D,id:Q,likes:Y=0,userLiked:k,comments:j=0,data:q}=t,P=sv(t.title,x),z=E&&E.id&&typeof ae!="string"&&ae.id&&ae.id===E.id||!1,ee=typeof te=="boolean"?te:!0,U=z&&(!t.createdAt||Wh(t.createdAt,10,"seconds")),X=y.useRef(null),[oe,J]=y.useState({title:t.body!==P&&P||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:"",data:t&&t.data||{}}),[pe,de]=y.useState(!1),[ye,Ae]=y.useState(U?"highlighted":"default"),[Ce,Ve]=y.useState("");y.useEffect(()=>{const he=X.current;if(!(!he||ye==="default"))return document.addEventListener(it.DISCUSSION_FORM_SUBMITTED,Le),he.addEventListener("transitionend",ze),()=>{document.removeEventListener(it.DISCUSSION_FORM_SUBMITTED,Le),he.removeEventListener("transitionend",ze)}},[]),y.useEffect(()=>{J(he=>({...he,title:t&&P||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1,data:t&&t.data||{}}))},[t.isEdited]),y.useEffect(()=>{(async()=>{const Fe=await To(oe.body,h,q==null?void 0:q.mentions,F);J(ot=>({...ot,postBody:Fe}))})()},[oe.body,q==null?void 0:q.mentions]);const Le=()=>{setTimeout(()=>{Ae("fading")},1e3)},ze=({propertyName:he})=>{he==="background-color"&&Ae(Fe=>(Fe==="default"&&(document.removeEventListener(it.DISCUSSION_FORM_SUBMITTED,Le),X.current&&X.current.removeEventListener("transitionend",ze)),Fe==="fading"?"default":Fe))};if(i||!t||t.type===Te.Answer&&(!t.slugs||!t.slugs.question)||oe.postBody===""&&t.title==="")return c.jsx(It,{className:"discussion-card"});const Ke=async({title:he,body:Fe,data:ot})=>{he||(he=""),Fe||(Fe=""),Ve("");try{if(!qi(he,oe.title)||!qi(Fe,oe.body)){const et=t.type===Te.Question?{title:Fe}:{title:he,body:Fe,data:ot};await M(Rs(t.slugs),et)}J(et=>({...et,title:he||"",body:Fe||"",data:{...et.data,...ot},isEditing:!1,didEdit:!0}))}catch{Ve(`${Rt}form_error`)}},je=()=>{if(A&&A.updateConversation){const he={showForm:!0},Fe=t.author;Fe&&Fe.id&&(v&&(he.prepopulateForm=`@{{${Fe.id}}}`),he.mentionData={id:Fe.id,name:Fe.name}),A.updateConversation(he)}setTimeout(()=>{var tt,_t,ct;const Fe=`reply-form-${(t.type===Te.Answer?t.slug:((tt=t.slugs)==null?void 0:tt.reply)||((_t=t.slugs)==null?void 0:_t.answer)||((ct=t.slugs)==null?void 0:ct.question)||"").toLowerCase().slice(-15)}`,ot=document.getElementById(Fe),et=document.getElementById(`${Fe}-input`);et&&et.focus(),ot&&ot.scrollIntoView({behavior:"smooth"})},0)},Ne=async()=>{de(!1);try{t.type===Te.Poll?(await W(),window.location.href=`${b}/${g}`):await T(Rs(t.slugs))}catch{Ve("delete-error")}},we=[];return n&&z&&(t.type!==Te.Poll&&we.push({text:C.formatMessage({id:`${Rt}moreMenu_edit`}),onClick:()=>J(he=>({...he,isEditing:!0})),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),we.push({text:C.formatMessage({id:`${Rt}moreMenu_delete`}),onClick:he=>{he.preventDefault(),he.stopPropagation(),de(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`delete-${t.type}-click`,...af(`delete-${t.slug}-modal`,pe)})),r&&o.pins&&we.push({text:C.formatMessage({id:`${Rt}moreMenu_${t.pinned?"unpin":"pin"}`}),onClick:t.pinned?o.pins.deletePin:o.pins.createPin,icon:t.pinned?"unpin":"pin",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),p&&((Z=X==null?void 0:X.current)==null||Z.focus(),(se=X==null?void 0:X.current)==null||se.scrollIntoView({behavior:"smooth"})),y.createElement(e,{className:H("discussion-post",u,{[ye]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!oe.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:X,tabIndex:p?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${d}-post-click`,onClick:he=>{if(!l.post||oe.isEditing||t.type===Te.Poll&&av(he,["poll-options","poll-info"],"discussion-post"))return;he.preventDefault(),he.stopPropagation(),Ai&&clearTimeout(Ai),Ai=setTimeout(()=>{window.location.href=l.post},150);const Fe=new CustomEvent(it.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:Ai}});document.dispatchEvent(Fe)},children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{id:Q||t.slug,className:H("discussion-card text-medium",t.type,{editing:oe.isEditing,"has-link":l.post&&!oe.isEditing}),children:[!oe.isEditing&&c.jsx(q_,{author:ae,originalAuthorId:a,createdAt:D,contentData:{didEdit:oe.didEdit},content:t,gtmContext:d,badges:f}),oe.isEditing?c.jsx(si,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:i,isInWrapper:!0,hasTitleField:oe.title!==""?{text:oe.title}:!1,isEditing:{text:oe.body,categories:[]},canBePrepopulated:v,isPrepopulated:!1},maxLength:t.type===Te.Question?250:5e4,forceShow:{error:Ce!==""&&Ce!=="delete-error"?C.formatMessage({id:Ce},{action:C.formatMessage({id:`${Rt}action_${t.type}`})}):!1},functions:{create:_,handleSaveEdit:Ke,handleCancel:()=>{Ve(""),J(he=>({...he,isEditing:!1}))},listMembers:F,clickMentionFallback:S},gtmContext:`${d}Form`,data:q}):c.jsxs(c.Fragment,{children:[t.type===Te.Poll?c.jsx(K_,{content:t,contentData:oe,functions:{createVote:N,removeVote:V}}):c.jsx(Z_,{links:l,contentData:oe,postCutOff:Y_,content:t}),c.jsx(U_,{content:t})]}),!oe.isEditing&&!(s!=null&&s.actionBar)&&c.jsx(xf,{className:t.type,gtmContext:d,contentType:t.type,likes:s!=null&&s.likes?!1:{count:Y||0,userLiked:k||!1,canLike:ee,peopleWhoLiked:t.peopleWhoLiked,activityId:t.id||t.slug,content:{slugs:t.slugs||{},slug:t.slug},functions:{createLike:O,deleteLike:L,listLikes:$},basePath:b,parentId:g},comments:!(s!=null&&s.comments)&&([Te.Question,Te.Post].includes(t.type)||l.comments)?{count:j||0,functions:{onClick:()=>{l!=null&&l.comments&&(window.location.href=l.comments),typeof B=="function"&&B()}}}:!1,replies:t.type==="answer"||t.type==="reply"?{functions:{onClick:je}}:!1,shareLink:{url:`${window.location.origin}${(ve=t.slugs)==null?void 0:ve.question}/${(ue=t.slugs)==null?void 0:ue.answer}${(be=t.slugs)!=null&&be.reply?`#${(Ee=t.slugs)==null?void 0:Ee.reply}`:""}`},moreMenu:{options:we,contentSlug:t.slug,reportData:{contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}}})]}),m,c.jsx(un,{id:`delete-${t.slug}-modal`,isOpen:pe,functions:{onOpen:()=>{},onClose:()=>de(!1)},forceShow:{error:Ce==="delete-error"?C.formatMessage({id:"${intlPath}delete_error"},{action:C.formatMessage({id:`${Rt}action_${t.type}`})}):!1},title:C.formatMessage({id:`${Rt}delete_title`},{action:C.formatMessage({id:`${Rt}action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>de(!1),children:C.formatMessage({id:`${Rt}delete_cancel`})},{variant:"primary",className:"destructive",onClick:Ne,children:C.formatMessage({id:`${Rt}delete_delete`})}],gtmContext:`${(t.type||"").charAt(0).toUpperCase()}${(t.type||"").slice(1)}:${t.slug}`,children:c.jsx(ie.FormattedMessage,{id:"discussion_delete_text",values:{p:he=>c.jsx("p",{children:he}),action:C.formatMessage({id:`${Rt}action_${t.type}`})}})})]})})};const G_=y.lazy(()=>Promise.resolve().then(()=>ck)),Q_=65,hh=({forceShow:e,form:t,className:n})=>{const r=ie.useIntl(),i="discussionFormCard_",a="DiscardDraftModal",o=y.useContext(st)||"community",l=ha(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const u=xn(!0,!1),d=u?u<768:0,{modal:m=!1}=e||{},[h,p]=y.useState({form:m||kd("showPost")==="true"||!1,warning:!1}),[v,f]=y.useState({showCachedText:!1});y.useEffect(()=>{if(!v.showCachedText)return;(async()=>{const C=await To(v.title||v.body||"",Q_,v.mentions);f(A=>({...A,prettifiedText:C}))})()},[v.showCachedText,v.title,v.body]);const b=x=>{if(!v.showCachedText||typeof h.warning=="string")return;let C;if("detail"in x&&x.detail.link)x.detail.timeout&&clearTimeout(x.detail.timeout),C=x.detail.link;else{const A=x;A.preventDefault(),A.stopPropagation();const _=A.target.closest("a");C=_&&_.getAttribute("href")}p(A=>({...A,warning:C||!1}))};y.useEffect(()=>{if(!v.showCachedText){document.removeEventListener(it.DISCUSSION_POST_CLICKED,b),document.removeEventListener(it.MEMBER_CLICKED,b),document.removeEventListener("click",b);return}return document.addEventListener(it.DISCUSSION_POST_CLICKED,b),document.addEventListener(it.MEMBER_CLICKED,b),document.addEventListener("click",b),()=>{document.removeEventListener(it.DISCUSSION_POST_CLICKED,b),document.removeEventListener(it.MEMBER_CLICKED,b),document.removeEventListener("click",b)}},[v.showCachedText]),y.useEffect(()=>{const x=C=>{if(!(!v.showCachedText||h.warning!==!1))return C.preventDefault(),C.returnValue=""};return window.addEventListener("beforeunload",x,{capture:!0}),()=>{window.removeEventListener("beforeunload",x,{capture:!0})}},[v.showCachedText,h.warning]);let g=r.formatMessage({id:`${i}placeholder${d?"":"_long"}`});return v.showCachedText&&(v.title||v.body)&&(g=v.prettifiedText||g),c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:H("discussion-form-card",n),onClick:x=>{x.preventDefault(),x.stopPropagation(),p(C=>({...C,form:!0}))},"data-testid":"discussion-form-card",children:[c.jsx(on,{name:l.name,src:l.image,alt:""}),c.jsx(Pn,{className:H("input",{placeholder:!v.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:jt,blockquote:jt,br:jt,em:jt,li:jt,ol:jt,p:jt,s:jt,span:jt,strong:jt,ul:jt}},children:g})]}),c.jsxs(vr,{children:[c.jsx(G_,{showModal:h.form,functions:{cacheText:f,onClose:()=>{p(x=>({...x,form:!1}))}},form:t,cachedText:v,className:"in-portal"}),c.jsx(un,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:h.warning!==!1,functions:{onClose:()=>{p(x=>({...x,warning:!1}))}},title:r.formatMessage({id:`${i}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${i}overlay_cta_discard`}),onClick:x=>{x.preventDefault(),x.stopPropagation(),typeof h.warning=="string"&&(window.location.href=h.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":a},{variant:"primary",children:r.formatMessage({id:`${i}overlay_cta_continue`}),onClick:()=>{p({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":a}],children:c.jsx("p",{children:r.formatMessage({id:`${i}overlay_text`})})})]})]})},J_=y.lazy(()=>Promise.resolve().then(()=>L_)),fu=({isCard:e=!1,form:t,parentId:n,categories:r,membershipRequiredToPost:{isMember:i,required:a,join:s,leave:o,notMemberStateText:l},locale:u=Do})=>{if(a&&!i)return c.jsx(Cn,{text:l,button:{breakpoints:{mobile:!0,901:!1},component:c.jsx(Co,{isShort:!0,functions:{join:s,leave:o}})}});const{content:d,functions:m,meta:h,...p}=t,v={content:{type:(d==null?void 0:d.type)||"reply",slugs:(d==null?void 0:d.slugs)||{}},functions:{...m,create:(m==null?void 0:m.create)||(()=>{})},parentId:n,meta:{...h,isEditing:(h==null?void 0:h.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1,postCategories:[{name:"Post",slug:"no-category"},...r||[]]},...p,id:`add-post-${p.id||""}`};return e?c.jsx(hh,{form:v}):c.jsx(J_,{...v})},mu=({form:e})=>{const t=y.useContext(st),n=ie.useIntl(),[r,i]=y.useState(!1),a=()=>{Xh(t)||i(!0)};y.useEffect(()=>(document.addEventListener(it.DISCUSSION_POST_ADDED,a),()=>{document.removeEventListener(it.DISCUSSION_POST_ADDED,a)}));const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),c.jsx(Ea,{form:e,showModal:r,functions:{onClose:()=>{i(!1)}},content:s})};const _s="discussion_responses_",ph=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=ie.useIntl();return t=parseInt(t),c.jsxs("div",{className:"responses-heading",children:[c.jsx("h4",{children:r.formatMessage({id:`${_s}title`},{action:r.formatMessage({id:`${_s}${e}`}),count:t})}),!n&&t===0&&c.jsx("p",{children:$t(r.formatMessage,`${_s}empty`,e,e)})]})};const gh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const a=ie.useIntl(),s=y.useContext(Da),o=ji(i,{element:"li"});if(s.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:s.prepopulateForm},s.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=s.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:s.mentionData},r.data=l,r.meta.isAutoFocused=!0}return c.jsxs("div",{className:H("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&c.jsx("ul",{className:"thread",children:o}),!e&&c.jsx(ii,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:a.formatMessage({id:"discussion_thread_loadMore"}),error:a.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&c.jsx(si,{...r})]})};function X_(e){var n,r;let t=!1;return(r=(n=e.latest_reactions)==null?void 0:n["poll-option"])==null||r.forEach(i=>{var a,s;(s=(a=i.own_children)==null?void 0:a["poll-vote"])!=null&&s.length&&(t=!0)}),t}function ek({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=$e.useMutation({mutationFn:e,onMutate:({reactionId:o})=>t(l=>(of({activity:l,reactionId:o,user:a}),l)),onError:n,onSuccess:(o,{reactionId:l},u)=>{u&&uf({activity:u,reactionId:l,correctReactionId:o.body.id,user:a}),r.setQueryData(i,u)}});return s}function tk({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=$e.useMutation({mutationFn:e,onMutate:({content:i,title:a})=>t(s=>(s&&(i!=null&&(s.content=i),a!=null&&(s.title=a)),s)),onError:n});return r}function nk({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=$e.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Yi({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Yi({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function rk({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=$e.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Gi({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Gi({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function ik({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,isFetching:a}=$e.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:i,isFetching:a}}function ak({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=$e.useMutation({mutationFn:e,onMutate:({reactionId:a})=>t(s=>(lf({activity:s,reactionId:a}),s)),onError:n});return i}function sk({queryFns:{read:e,edit:t,like:n,unlike:r,pin:i,unpin:a,createVote:s,removeVote:o},queryKey:l}){const u=$e.useQueryClient(),d=fa(),m={queryClient:u,queryKey:l},h={mutationHandlers:{error:Eo(m),mutate:_o(m)},user:d,...m},p=tk({...h,mutationFn:t}),v=nk({...h,mutationFn:n}),f=ok({...h,mutationFn:r}),b=rk({...h,mutationFn:i}),g=uk({...h,mutationFn:a}),x=ek({...h,mutationFn:s}),C=ak({...h,mutationFn:o}),{activity:A,...E}=ik({queryKey:l,queryFn:e});return{activity:A,mutations:{edit:p,like:v,unlike:f,pin:b,unpin:g,createVote:x,removeVote:C},user:d,...E}}function ok({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=$e.useMutation({mutationFn:e,onMutate:a=>t(s=>(s&&cf({activity:s,user:r}),s)),onError:n});return i}function uk({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=$e.useMutation({mutationFn:e,onMutate:a=>(console.log("unpin"),t(s=>(s&&df({activity:s,user:r}),s))),onError:n});return i}const lk=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:i,functions:{activities:{remove:a,...s},likes:o,reactions:l,form:u,join:d,leave:m,polls:h},profile:p,categories:v,locale:f=Do})=>{var Y,k,j,q,P,z,ee,U,X,oe,J,pe;const b=ie.useIntl(),g={...s,...h},{activity:x,error:C,isLoading:A,mutations:{edit:E,like:_,unlike:T,pin:M,unpin:O,createVote:L,removeVote:$}}=sk({queryFns:g,queryKey:[e,t,n]});if(A)return c.jsx(It,{style:{height:"400px"}});if(C||!x)return c.jsx(Cn,{variant:"error",text:b.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:B,verb:F,latest_reactions:S,mentioned_users:N,additional_data:V}=x,W=(((Y=S==null?void 0:S.like)==null?void 0:Y.length)||0)>0,ae=(((k=B==null?void 0:B.like)==null?void 0:k.length)||0)>0,te=ae?B==null?void 0:B.like[0].id:"",D=W?(j=S==null?void 0:S.like)==null?void 0:j.map(de=>{var ye,Ae,Ce;return{id:(ye=de==null?void 0:de.user)==null?void 0:ye.id,name:(Ce=(Ae=de==null?void 0:de.user)==null?void 0:Ae.data)==null?void 0:Ce.name}}):!1,Q=x==null?void 0:x.actor;return c.jsxs("section",{className:"activity-section",children:[c.jsx(oi,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:F,title:x==null?void 0:x.title,body:x==null?void 0:x.content,categories:So((x==null?void 0:x.categories)||[],v||[]),canLike:r,createdAt:(x==null?void 0:x.time)||"",slugs:{question:`${e}/${t}`,answer:x==null?void 0:x.id},slug:n,author:yr(Q),userLiked:ae,likes:((q=x==null?void 0:x.reaction_counts)==null?void 0:q.like)||0,comments:(x==null?void 0:x.total_replies)||0,peopleWhoLiked:D,data:{mentions:N,...V||{}},pinned:((P=x==null?void 0:x.reaction_counts)==null?void 0:P.pin)&&((z=x==null?void 0:x.reaction_counts)==null?void 0:z.pin)>0||!1,pollOptions:sf(x,f),pollSettings:{showRemoveVote:(ee=x==null?void 0:x.settings)==null?void 0:ee.show_remove_vote,allowMultipleVotes:(U=x==null?void 0:x.settings)==null?void 0:U.allow_multiple_votes,deadlineAt:(X=x==null?void 0:x.settings)==null?void 0:X.deadline_at,hideParticipants:(oe=x==null?void 0:x.settings)==null?void 0:oe.hide_participants,numberOfWinners:(J=x==null?void 0:x.settings)==null?void 0:J.number_of_winners,resultsVisibility:(pe=x==null?void 0:x.settings)==null?void 0:pe.results_visibility}},originalAuthorId:Q==null?void 0:Q.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(de,{title:ye,body:Ae})=>E({title:ye,content:Ae})},likes:{createLike:()=>_({activityId:n}),deleteLike:()=>T({activityId:n,reactionId:te}),listLikes:de=>o.list({activityId:n,...de})},comments:{openComments:()=>{}},pins:{createPin:()=>M({activityId:n}),deletePin:()=>{var de;return O({activityId:n,reactionId:(de=S==null?void 0:S.pin)==null?void 0:de[0].id})}},polls:{createVote:({reactionId:de})=>L({reactionId:de}),removeVote:({reactionId:de})=>$({reactionId:de}),removePoll:()=>h.removePoll({activityId:n})},form:u},styling:{showShareLinkButton:!0},userHasOwnerPermissions:i,badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:t||""},{scope:dt.Platform,area:"all"}]},basePath:e,parentId:t},n),c.jsx(gf,{basePath:e,parentId:t,activityId:n,showReplies:F===Te.Poll?X_(x):!0,activityTotalReplies:(x==null?void 0:x.total_replies)||0,isMember:r,functions:{reactions:l,likes:o,form:u,join:d,leave:m},profile:p})]})};const vh=({showModal:e=!0,functions:t,form:n,cachedText:r,className:i})=>{const a=ie.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:d,functions:m}=n,{title:h="",body:p="",mentions:v}=r||{},f="discussion-form-modal";return c.jsx(un,{id:f,title:a.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(h!==""||p!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:H("discussion-form-modal",i),children:c.jsx(si,{...n,data:{...u,mentions:v||(u==null?void 0:u.mentions)},meta:{...d,isAutoFocused:!0,isInOverlay:`${f}-overlay`,hasTitleField:{text:h},isPrepopulated:{text:p||(d==null?void 0:d.isPrepopulated)!==!1&&(d==null?void 0:d.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0,showPostType:!0},buttons:{submit:a.formatMessage({id:`${s}cta`})},functions:{...m,onChange:b=>{l(g=>({...g,...b}))},onMention:({id:b,name:g}={})=>{if(!b||!g)return;const x=v||{};x[b]={created_at:"",updated_at:"",id:b,data:{name:g}},l(C=>({...C,mentions:x}))},create:async b=>{o(),m.create&&await m.create(b),l({showCachedText:!1})},createPoll:async b=>{const g=()=>{o(),l({showCachedText:!1})};if(m.createPoll)try{const x=await m.createPoll(b);return new Promise(C=>(g(),C(x)))}catch{return new Promise((C,A)=>A())}else return g(),new Promise(x=>x({}))},handleSaveEdit:async b=>{o(),m.handleSaveEdit&&await m.handleSaveEdit(b),l({showCachedText:!1})}}})})},ck=Object.freeze(Object.defineProperty({__proto__:null,default:vh},Symbol.toStringTag,{value:"Module"}));const dk=({className:e,showModal:t=!0,title:n,messagePlaceholder:r,formTitle:i,formLabel:a,ctaMessage:s,showIcon:o,onClose:l,reportError:u=()=>{},sendInvites:d})=>{const m=ie.useIntl();return i||(i=m.formatMessage({id:"inviteModal_formTitle"})),a||(a=m.formatMessage({id:"inviteModal_formLabel"})),s||(s=m.formatMessage({id:"inviteModal_cta"})),c.jsx(un,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:o,functions:{onClose:l},className:H("invite-modal",e,{success:!!n}),children:c.jsx(rh,{title:i,label:a,messagePlaceholder:r,ctaMessage:s,onClose:l,sendInvites:d,reportError:u})})};const fk=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:i,form:a,className:s})=>{const o=ie.useIntl(),[l,u]=y.useState(kd("showProfile")==="true"||e);y.useEffect(()=>{u(e)},[e]);const{onClose:d=()=>{}}=i;return c.jsx(un,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:d},className:H("profile-modal",s,{success:!!t}),maxWidth:700,children:c.jsxs(c.Fragment,{children:[t&&n||r?c.jsxs("div",{className:"intro",children:[t&&n?c.jsx("h3",{children:n}):"",r?c.jsx("p",{children:r}):""]}):null,c.jsx(ih,{...a,meta:{shouldShowCancelButton:!1},functions:{...(a==null?void 0:a.functions)||{},onSuccess:async m=>{var h;try{(h=a==null?void 0:a.functions)!=null&&h.onSuccess&&await a.functions.onSuccess(m)}finally{d()}}}})]})})},Ea=fk,mk=Object.freeze(Object.defineProperty({__proto__:null,default:Ea},Symbol.toStringTag,{value:"Module"}));const hk=({members:e})=>{const[t,n]=y.useState(!1),r=i=>{const{fullName:a,jobTitle:s,organisation:o,photo:l}=i||{};return c.jsxs(c.Fragment,{children:[c.jsx(on,{name:a,src:l}),c.jsx("p",{children:a}),c.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return c.jsxs("div",{className:"directory-wrapper",children:[c.jsx("ul",{className:"directory",children:e.map(i=>c.jsx("li",{children:c.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),c.jsx(un,{isOpen:t!==!1,children:t===!1?"":c.jsxs(c.Fragment,{children:[r(t),c.jsx(Pn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const pk=({author:e,authorCite:t,content:n,member:r,className:i=""})=>c.jsxs("blockquote",{className:H("testimonial-block",i),children:[c.jsx(Zt,{className:"testimonial",children:n}),r?c.jsx(rn,{member:r,styling:{size:"large"}}):c.jsxs(c.Fragment,{children:[e&&c.jsx("p",{className:H("author",{"text-small":!i.includes("new")}),children:e}),t&&c.jsx("p",{className:H("author-cite",{"text-small":!i.includes("new")}),children:c.jsx("cite",{children:t})})]})]}),gk=y.memo(pk);const vk=({items:e=[],selector:t="",className:n=""})=>{const r=ie.useIntl(),[i,a]=y.useState(e);return y.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,d)=>{s+=`${d>0?", ":""}${t} h${d+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));a(l)},[]),i&&i.length>0&&c.jsxs(Ft,{variant:"subtle",className:H("table-of-contents",n),children:[c.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),c.jsx("nav",{children:c.jsx("ul",{children:i.map(({id:s,text:o})=>c.jsx("li",{children:c.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const _a=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:i=""})=>{const a=ie.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=d=>{const m=d/60,h=Math.floor(m),p=(m-h)*60,v=Math.round(p),f=`${a.formatMessage({id:`${s}hours`},{time:h})}${h>0&&v>0?", ":""}${a.formatMessage({id:`${s}minutes`},{time:v})}`;return{text:`${h>0?`${a.formatMessage({id:`${s}hours_short`},{time:h})} `:""}${v>0?a.formatMessage({id:`${s}minutes_short`},{time:v}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:d,ariaText:m}=o(e+t);l=a.formatMessage({id:`${s}range`},{early:l,late:d}),u=a.formatMessage({id:`${s}range_aria`},{early:u,late:m})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),c.jsx("span",{className:H("time-to-complete",i),"aria-label":u,children:l})};const bk=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",c.jsx(Ln,{...n,className:H("banner",e),image:{...t,aspect:"banner"}})):null;const yk=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],xk=({className:e="",content:t,image:n,variant:r,spacing:i="normal",styling:a,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var v,f;const u={imageFullWidth:!0,...a};r||(r=u.imageFullWidth?"default":"light");const d=["eyebrow","title","text"],m={eyebrow:"small",title:"h1",text:"p"},h={};d.forEach(b=>{if(!t[b]){h[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){h[b]=t[b];const{text:g,element:x}=t[b];if(x&&yk.includes(x.toLowerCase()))return;h[b]={text:g,element:m[b]};return}h[b]={text:t[b],element:m[b]}}});const p=o&&o.text&&o.link;return p&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=b=>{b.preventDefault(),b.stopPropagation();const g=document.getElementById(o.link.substring(1));g&&g.scrollIntoView({behavior:"smooth"})}),c.jsx(_n,{className:H("banner-section",r,i,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":p,"has-extra-spacing":r!=="subtle"&&i==="normal"&&h.eyebrow&&h.title}),children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"content-wrapper",children:[d.map(b=>{if(h[b]&&typeof h[b]=="object"){const{text:g,element:x=""}=h[b];return b==="text"?c.jsx(Pn,{overrideType:"text-only",className:"text",children:g},b):y.createElement(x,{key:b,className:b},g)}return null}),l,p&&c.jsx(Be,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:H({new:r==="subtle",[(v=o.props)==null?void 0:v.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&c.jsx(Ln,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},wk=y.memo(xk);const Ck=({image:e,variant:t="default",children:n,className:r=""})=>{const i={};return e&&(i["--image"]=`url(${e})`),c.jsx(_n,{className:H("custom-content-banner",t,r,{"has-image":e}),style:i,children:c.jsx("div",{className:"content-slim",children:n})})};const Dk=({alignImage:e="left",className:t,content:n,image:r})=>{const i=typeof n=="string"?c.jsx(Pn,{children:n}):n;return c.jsxs(_n,{className:H("highlight-section",t),children:[r&&c.jsx("div",{className:H("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:c.jsx(Ln,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),c.jsx("div",{className:H("highlight-container highlight-content-wrapper",{"no-image":!r}),children:c.jsx("div",{className:H("highlight-content",{"highlight-content-right":e==="left"}),children:r?i:c.jsx("div",{className:"content-default",children:i})})})]})},Ek=y.memo(Dk);const _k=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:c.jsxs("aside",{className:H("marketing-block",e),children:[n&&c.jsx("p",{className:"title",children:n}),r&&c.jsx("p",{children:r}),t&&c.jsx(Be,{variant:t.variant||"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:t.text})]}),kk=({type:e,data:t})=>{const n=ie.useIntl(),{answers:r,createdAt:i,dateHasPassed:a,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:d}=t;if(e==="question"){const m=i&&Ts(i);return c.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&c.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:m?n.formatMessage({id:`dates_${m.path}`},{number:m.number}):0})]})]})}if(d&&!a||s)return c.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):fo(d)});if(o)return c.jsx(Yt,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const m=u&&Ts(u);return c.jsxs("ul",{className:"details",children:[l&&c.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&c.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:m?n.formatMessage({id:`dates_${m.path}`},{number:m.number}):0})})]})}return null},Fk={title:66,text:3e3,secondaryText:1e3,partner:34},ua={communityPage:{basePath:"/communities/",className:"communityPage",gtmEvent:"community"},customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},Ak=({data:e,cta:t,link:n,gtmContext:r})=>{var f,b;const i=ie.useIntl(),[a,s]=y.useState({loading:!1,registered:e.registered||!1});y.useEffect(()=>{e.registered&&s(g=>({...g,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:d,slug:m}=e,h=e.contentType;let p="";if((f=ua[h])!=null&&f.gtmEvent&&(p=ua[h].gtmEvent),l&&u)return n?c.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${p}-click`,children:o||i.formatMessage({id:"card_watch"})}):null;if(h==="people")return n?c.jsx(Be,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${p}-click`,children:o||i.formatMessage({id:"card_cta_people"})}):null;const v=["communityPage","microcourse","event"];if(t&&t.onClick&&v.includes(h)&&d!=="premium"){const g=a.loading||a.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),x=async C=>{if(C.preventDefault(),C.stopPropagation(),!(g||!t||!t.onClick)){s(A=>({...A,loading:!0}));try{const A=await t.onClick(e);s(A==="success"?()=>({registered:!0,loading:!1}):E=>({...E,loading:!1}))}catch{s(E=>({...E,loading:!1}))}}};return c.jsx("p",{className:H("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:c.jsx(Be,{onClick:x,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:g,"data-gtm-event-context":`${r}Page-${h}: ${m}`,"data-gtm-event-type":`${r}-${h}-register-click`,"data-testid":"in-card-button",children:o||i.formatMessage({id:`card_cta_${h}${g?`_${a.loading?"loading":"done"}`:""}`})})})}return null};function Bk({buildMemberData:e,communitySlug:t}){const n=ie.useIntl(),r=y.useContext(st),[i,a]=y.useState({count:"...",isMember:!1,memberType:""});return y.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(s=>{if(!s)return;const{membersCount:o,role:l="",pagination:u}=s;let d=0;o?d=o:u!=null&&u.total&&(d=u==null?void 0:u.total),a({count:d.toString(),isMember:!!l,memberType:l})})},[t,e]),c.jsxs("span",{className:"member-information",children:[i.isMember&&c.jsx(Yt,{size:"small",variant:"registered",icon:(i==null?void 0:i.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${i.memberType}`})}),c.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:i.count})})]})}const hu=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:i,cta:a,gtmContext:s="Carousel",handleCardClick:o,meta:l})=>{var F,S;const u=ie.useIntl(),d=y.useContext(st),m=!!(d!=null&&d.id),{isTabbable:h=!0,setFocus:p=!1}=l||{},v=y.useRef(null),[f,b]=y.useState({data:null,isLoading:!0});y.useEffect(()=>{n(i,m).then(N=>{b({data:N,isLoading:!1})}).catch(()=>b(N=>({...N,isLoading:!1})))},[i,m,n]);const{data:g,isLoading:x}=f;if(x||!g)return c.jsx(It,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});o&&!a&&(a={text:u.formatMessage({id:`card_cta_${i.contentType}`}),onClick:o});const{contentType:C}=g;if(!C||!ua[C])return c.jsx(It,{element:"li",className:"card-wrapper"});const{basePath:A="",className:E,length:_,gtmEvent:T}=ua[C];let M=h&&g.slug?`${A}${g.slug}`:!1;h&&g.slug&&(g.slug.slice(0,4)==="http"||g.slug.slice(0,2)==="//"||g.slug.slice(0,6)==="mailto"||g.slug.slice(0,3)==="tel")&&(M=g.slug);const O=N=>{M&&(N.preventDefault(),N.stopPropagation(),window.location.href=M)},L={...Fk,..._};let $={className:"card"},B={};return M&&(B={href:M,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${T}-click`,"data-testid":"link"},g.openInNewTab&&(B.target="_blank"),$={onClick:O,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${T}-click`}),p&&($={...$,tabIndex:"0"},(F=v==null?void 0:v.current)==null||F.focus(),(S=v==null?void 0:v.current)==null||S.scrollIntoView({behavior:"smooth"})),c.jsx("li",{className:H("card-wrapper text-medium",E,t,{"has-link":M,"no-link":!M,"has-image":g.banner}),"data-testid":`${C}-card`,children:c.jsxs("div",{...$,ref:v,children:[c.jsx(Ad,{className:"card-label",contentType:C,customIcon:g.isPrivate?"lock-locked":g.customIcon,customLabel:g.customLabel}),C==="communityPage"&&(g==null?void 0:g.createdAt)&&Vh(g==null?void 0:g.createdAt,60)&&c.jsx(Yt,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),g.startDate&&!g.isOngoingEvent&&c.jsx(Yt,{size:"small",variant:g.dateHasPassed?"default":"information","data-testid":"date",children:g.dateHasPassed?u.formatMessage({id:"card_ended"}):Dd(g.startDate)}),g.banner?c.jsxs("p",{className:"img",children:[g.registered&&c.jsx(Yt,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),c.jsx(Ln,{image:{...g.banner,description:""}})]}):E==="people"?c.jsx(on,{name:g.title||"",src:g.profile,"data-testid":"people-profile-picture"}):null,g.contributors&&c.jsx(bo,{contributors:{data:g.contributors},styling:{size:"small",showGap:E!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(C)?u.formatMessage({id:`card_contributors_${C}`}):void 0,"data-testid":"contributors"}),g.partner&&c.jsx("p",{className:"partners","data-testid":"partners",children:g.partner.length>1?u.formatMessage({id:"card_partner"},{partner:g.partner[0],number:g.partner.length-1}):sr(g.partner[0],L.partner)}),["title","text","secondaryText"].map(N=>{const V=g[N];if(!V)return null;const W=bd(N),ae={key:N,className:W,"data-testid":W},te={wrapper:"p",forceWrapper:!0,forceInline:!0},D=sr(V,L[N]);return["title","text"].includes(N)&&M?(te.wrapper="a",c.jsx("p",{...ae,children:c.jsx(Zt,{options:te,...B,children:D})})):c.jsx(Zt,{options:te,...ae,children:D})}),i.contentType==="communityPage"&&(i.slug||g.slug)&&r&&c.jsx(Bk,{communitySlug:i.slug||g.slug,buildMemberData:r}),c.jsx(kk,{type:E||"",data:g}),c.jsx(Ak,{data:g,cta:a,link:M||"",gtmContext:s})]})})};const bh=({cards:e,cardTypes:t,className:n="",...r})=>c.jsx("ul",{className:H("card-block",n),children:e.map((i,a)=>{const s=i.slug?`${i.slug}-${t[a]}`:`${t[a]}-${a}`;return c.jsx(hu,{id:s,card:{...i,contentType:t[a]},meta:{setFocus:a===(r==null?void 0:r.focusCardIndex)},...r},s)})}),Tk=(e,t,n,r)=>{const i=t*n<=e,a=e<t*(n+1),s=r.includes(Math.floor(e/t));return{inView:i&&a,isLoaded:s}},Sk=({id:e,title:t})=>{const n=ie.useIntl();if(!t||!t.text)return null;const{text:r,element:i="h2",variant:a="default",size:s="medium",link:o}=t;return y.createElement(i,{className:H("title",a,s,{"highlighted-title":a==="highlighted"}),children:c.jsxs(c.Fragment,{children:[r,o&&c.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const ks={fourCards:1024,threeCards:769,twoCards:480};let Bi=null,Fs=null;const jk=({id:e,cards:t,cardTypes:n,buildCardData:r,title:i,className:a,gtmContext:s,...o})=>{const l=ie.useIntl(),u="carousel_pagination_",[d,m]=y.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=d,[v,f]=y.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:g}=v,[x,C]=y.useState(""),A=t.length,E=Math.ceil(A/h),_=y.useRef(null),T=xn(!0,!0,_==null?void 0:_.current);y.useEffect(()=>{let F=1;T&&(T>=ks.fourCards?F=4:T>=ks.threeCards?F=3:T>=ks.twoCards&&(F=2),F>A&&(F=A)),m(S=>({...S,cardsPerPage:F,isLoading:!1}))},[T,A]);const M=(F="next")=>{Fs&&clearTimeout(Fs);let S=b;if(typeof F=="string")if(F==="next")if(b<E-1)S=b+1;else return;else if(b>0)S=b-1;else return;else S=F;C(""),f(V=>({...V,currentPage:S,loadedPages:[...new Set([...g,S])]}));const N=()=>{const V=S*d.cardsPerPage,W=V+d.cardsPerPage;return t.slice(V,W).length};Fs=setTimeout(()=>{C(l.formatMessage({id:`${u}ariaLive${typeof F=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof F=="string"?F:"next"}`}),slide:typeof F=="string"?1:F+1,count:N()}))},500)},O=F=>{Bi=F.touches[0].clientX},L=F=>{if(Bi===null)return;const S=F.touches[0].clientX,N=Bi-S;N>5?M("next"):N<-5&&M("previous"),Bi=null},$={"--width":`${T||0}px`,"--total-cards":A,"--cards-per-page":h,"--page":b};if(p)return c.jsx(ma,{layout:`carousel${i?"-with-title":""}`});const B=(F,S)=>{var V;let N=null;return(V=F==null?void 0:F.sys)!=null&&V.id?N=`card-${F.sys.id}`:F!=null&&F.slug?N=`card-${F.slug}`:[n[S],F.contentType].includes("customCard")&&(N=`card-${window.btoa(`${F.title} ${F.createdAt}`)}-${S}`),N};return c.jsxs("section",{ref:_,className:H("carousel-wrapper",a),"data-testid":"carousel",children:[c.jsx(Sk,{id:e,title:i}),c.jsx("ul",{className:"carousel",onTouchStart:O,onTouchMove:L,style:$,"data-testid":"carousel-list",children:t.map((F,S)=>{let N=B(F,S);const{inView:V,isLoaded:W}=Tk(S,h,b,g);return N&&(V||W)?c.jsx(hu,{id:N,card:{...F,contentType:n[S]},buildCardData:r,gtmContext:s,meta:{isTabbable:V},...o},N):(N=N||`${e}-card-${S}`,c.jsx(It,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},N))})}),E<=1?null:c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[c.jsx("li",{className:"arrow previous",children:c.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:F=>{F.preventDefault(),F.stopPropagation(),M("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:b<=0})}),[...Array(E)].map((F,S)=>c.jsx("li",{"data-testid":"carousel-controls-button",children:c.jsx("button",{className:H("page-indicator",{selected:S===b}),onClick:N=>{N.preventDefault(),N.stopPropagation(),M(S)},children:c.jsx(Me,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:S+1,total:E})})})},`page-indicator-${S}`)),c.jsx("li",{className:"arrow next",children:c.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:F=>{F.preventDefault(),F.stopPropagation(),M("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:b>=E-1})})]}),c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:x})]})]})},Pk=({carousels:e=[],isLoading:t,title:n,className:r="",...i})=>!e||!e.length?null:e.map(({title:a,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const d=a?window.btoa(a):`carousel-${u}`,m=u===e.length-1;return t?c.jsxs(y.Fragment,{children:[c.jsx(ma,{layout:`carousel${a?"-with-title":""}`,"data-testid":"carousel-placeholder"}),m?null:c.jsx(qt,{})]},`placeholder-${d}`):c.jsxs(y.Fragment,{children:[c.jsx(jk,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:a,link:s},...i}),m?null:c.jsx(qt,{})]},`carousel-${d}`)});const Ok=({element:e="div",className:t="",card:n,gtmContext:r="NarrowCard"})=>{const{banner:i,title:a,text:s,isPrivate:o,slug:l}=n;let u={};return l&&(u={onClick:m=>{l&&(m.preventDefault(),m.stopPropagation(),window.location.href=l)},tabIndex:"0","data-gtm-event-context":`${r}-NarrowCard`,"data-gtm-event-type":`${r}-click`}),y.createElement(e,{className:H("narrow-card",t,{"has-link":l,"gtm-trackable":l,"no-link":!l}),...u,children:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:H("img",{private:o,"no-image":!i}),children:i&&c.jsx(Ln,{image:i})}),c.jsxs("div",{className:"content",children:[a&&c.jsx("p",{className:"title text-medium",children:a}),s&&c.jsx("p",{className:"text text-medium",children:s})]})]})})};const Mk=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:i=!0},graph:a,styling:s={},className:o=""})=>{const l=ie.useIntl();let u=i?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:d=!1}=s;return y.createElement(e,{className:H("course-progression",o,{"highlight-percentage":d,"has-circle-graph":a==="circle"}),children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:m=>c.jsx("strong",{children:m}),number:u})}),u<100&&i&&c.jsx(_a,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),c.jsx(vo,{progress:u,styling:{layout:a||"bar",size:a&&a==="circle"?"small":"default"}})]})})};const yh=({element:e="span",sectionId:t,subsectionId:n,title:r,className:i=""})=>y.createElement(e,{className:H("lesson-name",i),"data-number":`${t}.${n}`,children:r});const xh=({size:e="default",completionTime:t,icon:n,optional:r,type:i,children:a})=>{const s=ie.useIntl(),o=ca(`lessonType_${i}`)?s.formatMessage({id:`lessonType_${i}`}):xd(i||"");return c.jsxs("small",{className:H("content-type",{[e]:e!=="default"}),children:[c.jsx("span",{className:H("type",n),children:o})," ",t>0&&!r&&c.jsx(_a,{time:t})," ",a?c.jsx("span",{className:"additional",children:a}):null]})};const Nk=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:i,sectionId:a,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:d})=>{const m=ie.useIntl(),h="courseStructure_",p=u.toLowerCase().includes("course conclusion");return c.jsxs(da,{className:"course-structure",label:c.jsxs(c.Fragment,{children:[c.jsxs("small",{children:[m.formatMessage({id:`${h}section${p?"_end":""}`},{number:a})," ",!r&&s>=0&&c.jsx("span",{className:"time",children:i&&l===0?m.formatMessage({id:`${h}time_completed`}):c.jsx(_a,{time:s,appendedText:i?m.formatMessage({id:`${h}time_left`}):""})})]}),c.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[c.jsx("p",{children:n}),c.jsx("ol",{children:e&&e.length>0&&e.map(({completed:v,completionTime:f,contentType:b,icon:g,image:x,isIntroduction:C,optional:A,slug:E,subsectionId:_,title:T,type:M})=>{const O=i&&t||C,L={};return x&&(L.style={"--image":`url(${x})`}),c.jsx("li",{className:H({article:b===Sr.ARTICLE,discussion:b===Sr.DISCUSSION,quiz:b===Sr.QUIZ,completed:v&&b===Sr.ARTICLE,locked:!O}),...L,children:c.jsx(wn,{href:O?`/microcourses/en/${o}/${E}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${yd(T)}`,gtmType:"article-click",children:c.jsxs(c.Fragment,{children:[c.jsx(yh,{sectionId:a,subsectionId:_,title:T,className:"course-title"})," ",c.jsx(xh,{completionTime:f,icon:g,optional:A,type:M,children:d&&d[E]&&c.jsx("span",{className:"quiz-score",children:`${d[E]}%`})})]})})},E)})})]})};const Ik=({isComplete:e=!1,onClick:t,...n})=>{const r=ie.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),c.jsx(Be,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:H("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},Rk=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),od=[{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/kCcBdXurt3uOKu6NdTPm0/1b6d19179b21f98dbdadf2477c03d267/devin-avery-7gwqj0yyrhm-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"why-public-servants-must-learn-to-fail",contributors:["community"]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/12Y0W1K0zVcDKzgLZlbfyC/6eb0757a02cbeea19b1b42d7da04d553/ashkan-forouzani-m0l9nbcivuk-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"organisational-culture-change-and-failure",contributors:[{name:"Mari-Liis",id:"bdb7509c-89ed-4633-8bc0-dbf11f5d9be1"}]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/26TEwu0xVkbQDguuW89fY6/d54ce406cdd652d68979770d526398ab/nik-shuliahin-bunwp1bl0nc-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"how-to-learn-from-failure-without-causing-a-scandal",contributors:["community"]}];const Ti="notFoundError_",$k=()=>{const e=ie.useIntl(),t=[];return od.forEach((n,r)=>{n.title=e.formatMessage({id:`${Ti}post_${r+1}`}),t.push("solutionArticle")}),c.jsxs(lh,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:c.jsxs(_n,{children:[c.jsx(bh,{cards:od,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),c.jsx(Be,{href:"/solution-articles/",children:e.formatMessage({id:`${Ti}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[c.jsx("h1",{children:e.formatMessage({id:`${Ti}title`})}),c.jsx("p",{children:e.formatMessage({id:`${Ti}text`})})]})};exports.ASSETS_BUCKET=Gt;exports.ActionBar=xf;exports.ActionButton=Kr;exports.ActivitiesFeed=ov;exports.ActivitySection=lk;exports.ActivityType=br;exports.AddPost=fu;exports.Badge=qd;exports.BadgeScope=dt;exports.Badges=Ud;exports.BadgesContext=ho;exports.BadgesProvider=Od;exports.Banner=bk;exports.BannerSection=wk;exports.Breadcrumbs=Fv;exports.Buckets=op;exports.Button=Be;exports.ButtonWrapper=gr;exports.COURSE_CONTENT_TYPES=Sr;exports.CacheProvider=Md;exports.Card=hu;exports.CardBlock=bh;exports.Carousel=Pk;exports.CharacterLimit=Oo;exports.Checkbox=Mo;exports.CollapsibleSection=da;exports.Columns=Ef;exports.CommunityDetails=Fg;exports.ContactFooter=T_;exports.ContactForm=nh;exports.ContentTypeLabel=Ad;exports.Contributors=bo;exports.ConversationContext=Da;exports.CookieBanner=uh;exports.CourseProgression=Mk;exports.CourseStructure=Nk;exports.CustomContentBanner=Ck;exports.CustomEvents=it;exports.DELETED_USER_ID=Wr;exports.Directory=hk;exports.DiscussionContentType=Te;exports.DiscussionConversation=fh;exports.DiscussionForm=si;exports.DiscussionFormCard=hh;exports.DiscussionFormModal=vh;exports.DiscussionPost=oi;exports.DiscussionThread=gh;exports.Divider=qt;exports.DownloadSection=k_;exports.EMAILS=Qn;exports.EditSection=A_;exports.EmailHelperTextBox=kf;exports.EmptyStateBox=Cn;exports.EnrichedUrl=jo;exports.FeatureFlags=Id;exports.Filters=wf;exports.FlagsProvider=Nd;exports.Footer=cu;exports.Form=Jt;exports.Formatting=K;exports.Fragment=jt;exports.FullWidthSection=_n;exports.GET_STREAM_USER_PREFIX=Bs;exports.GlobalProviders=wp;exports.Header=du;exports.HelperTextBox=Td;exports.HiddenFromScreenReaders=la;exports.HideShowTextBox=Sd;exports.HighlightSection=Ek;exports.HighlightedTextBox=Ft;exports.INVALID_TOKEN=wd;exports.IconBulletedList=cp;exports.ImageContainer=rp;exports.IntlProvider=Rd;exports.InviteForm=rh;exports.InviteModal=dk;exports.JoinButton=Co;exports.Label=ru;exports.LanguageContext=po;exports.LanguageSwitcher=Bv;exports.LessonName=yh;exports.LessonType=xh;exports.LikesButton=hf;exports.LikesFeed=vf;exports.LikesModal=bf;exports.Link=wn;exports.LoadMore=ii;exports.LoadingBlock=Wd;exports.LoadingPlaceholder=It;exports.LoadingState=ma;exports.Logo=Po;exports.LogoSection=B_;exports.MEMBERS_PER_PAGE=ch;exports.MENTION_REGEX=Cd;exports.MarkCompleteButton=Ik;exports.MarkdownText=Pn;exports.MarketingBlock=_k;exports.Marks=Kt;exports.Member=rn;exports.MembersList=dh;exports.Modal=yo;exports.MoreMenu=Cf;exports.NUMBER_OF_COUNTRIES=qh;exports.NUMBER_OF_USERS=zh;exports.NarrowCard=Ok;exports.NavigationMenu=Df;exports.NotFoundError=$k;exports.Overlay=un;exports.OverlayContext=go;exports.OverlayProvider=zd;exports.PageHeading=jd;exports.PageLayout=lh;exports.PasswordForm=v_;exports.PasswordRules=Sf;exports.Pill=Yt;exports.Poll=mh;exports.Popover=Fd;exports.Portal=vr;exports.ProfileForm=ih;exports.ProfileImageChange=th;exports.ProfileModal=Ea;exports.ProfileModalLauncher=mu;exports.ProfilePicture=on;exports.ProgressBar=vo;exports.ProgressTracker=ap;exports.PublishArticleForm=y_;exports.Rating=Kv;exports.RepliesFeed=gf;exports.ResponsesHeading=ph;exports.ResponsiveImage=Ln;exports.ResultsVisibility=oa;exports.ReturnToNavButton=sp;exports.RichTextEditor=lu;exports.SearchForm=sh;exports.ShareLink=yf;exports.ShareLinks=Mv;exports.SignupForm=__;exports.Span=Ps;exports.StatusBanner=ur;exports.TableOfContents=vk;exports.Tabs=Nv;exports.Tags=M_;exports.TestimonialBlock=gk;exports.TimeToComplete=_a;exports.Toggle=p_;exports.Tooltip=$n;exports.TopLevelPage=S_;exports.UUID_V4_REGEX=Vr;exports.UserContext=st;exports.UserProvider=$d;exports.VisuallyHidden=Me;exports.addAriaProps=af;exports.basicReducer=ri;exports.camelCaseToDashCase=bd;exports.checkIntlPathExists=ca;exports.enrichPostCategories=So;exports.generateConditions=zi;exports.generateCssIcon=Uh;exports.getAuthorData=yr;exports.getCharacterLimitProps=_f;exports.getLongDate=fo;exports.getMember=ha;exports.getPostBody=To;exports.getShortDate=Dd;exports.getValueLength=pa;exports.headerData=ni;exports.likesResponseMock=_v;exports.mapGetStreamData=Rk;exports.pageReady=Ed;exports.passwordValidator=Ss;exports.repliesFeedMock=uv;exports.supportedLanguages=Pi;exports.toCamelCase=yd;exports.toCapitalisedCase=Lh;exports.toSentenceCase=xd;exports.transformSlugs=Rs;exports.useAutoResize=fd;exports.useBadges=Pd;exports.useCurrentPath=md;exports.useEffectAfterMount=or;exports.useElementWidth=xn;exports.useOverlay=Ld;exports.useScrollListener=pd;exports.useScrollToHash=lo;exports.useTooltips=co;exports.useUser=fa;