@apolitical/component-library 6.6.10-beta.1 → 6.6.11

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.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/index.mjs +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -63,7 +63,7 @@ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var X=oe($,ne,j,q,P+"."+
63
63
 
64
64
  `;return i.slice(0,a.length)===a&&(i=i.slice(a.length)),n?await _d({text:i,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):i},So=(e,t)=>t.length===0||e.length===0?[]:e.map(n=>t.find(r=>r.slug===n)),iv=(e,t,n)=>{let r=!1;function i(a){let s=30;for(;a||s<=0;){if(t.some(o=>Array.from(a==null?void 0:a.classList).includes(o))){r=!0;break}if(Array.from(a==null?void 0:a.classList).includes(n))break;a=a.parentElement,s--}}return i(e.target),r},av=(e,t)=>e?typeof e=="string"?e:e[t]:"",sv=({basePath:e,parentId:t,isMember:n,isOwner:r,categories:i,functions:{activities:a,form:s,join:o,leave:l,likes:u,polls:d},profile:m,locale:h=Do})=>{const p=ae.useIntl(),[v,f]=y.useState([{id:"recent_with_pin",text:"recent",type:"ranking"}]),[b,g]=y.useState([{id:"recent_with_pin",text:"recent",type:"ranking"},{id:"community_feed_live",text:"popular",type:"ranking"}]),x={...a,...d},{activities:C,error:A,fetchNextPage:E,hasNextPage:_,isLoading:T,mutations:{create:L,edit:O,remove:z,like:R,unlike:B,pin:F,unpin:S,createPoll:M,createVote:U,removeVote:V,removePoll:ie}}=Gg({queryKey:[e,t,"activities",v],queryFns:x,filterOption:v[0]});y.useEffect(()=>{i&&g(b.concat(i==null?void 0:i.map(({slug:Y,name:k})=>({id:Y,text:k,type:"category"}))))},[i]);const[te,D]=y.useState(null),J=()=>{D(C.length),E()};return mf(),A?c.jsx(wn,{variant:"error",text:A.message}):c.jsxs("section",{children:[c.jsx(fu,{isCard:!0,parentId:t,categories:i,form:{content:{type:br.Post,slugs:{}},functions:{create:L,createPoll:M,...s},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:o,leave:l,notMemberStateText:p.formatMessage({id:"community_joinToPost"})}}),c.jsx(wf,{className:"activities-feed-filtering",options:b.map(({id:Y,text:k})=>({id:Y,text:p.formatMessage({id:`activitiesFeed_rankingMethod_${k}`,defaultMessage:k})})),defaultOptions:v.map(({id:Y,text:k})=>({id:Y,text:p.formatMessage({id:`activitiesFeed_rankingMethod_${k}`,defaultMessage:k})})),preventNoOptionSelected:!0,allowMultiple:!1,onChange:({current:Y,previous:k})=>{if(Y[0]===k[0])return;f([b.find(P=>P.id===Y[0])]);const j=b.find(P=>P.id===Y[0]);if(!j)return;const q=new CustomEvent("ariaLive",{detail:{message:p.formatMessage({id:"community_sortSuccess"},{order:p.formatMessage({id:`activitiesFeed_rankingMethod_${j.text}`,defaultMessage:j.text})})}});document.dispatchEvent(q)}}),C==null?void 0:C.map((Y,k)=>{var be,Te,Ae,We,Le,ze,Ke,je,Ne;const{id:j,own_reactions:q,latest_reactions:P,reaction_counts:$,mentioned_users:K,total_replies:G,additional_data:ne}=Y,oe=(((be=P==null?void 0:P.like)==null?void 0:be.length)||0)>0,X=(((Te=q==null?void 0:q.like)==null?void 0:Te.length)||0)>0,ge=X?q==null?void 0:q.like[0].id:"",de=oe?(Ae=P==null?void 0:P.like)==null?void 0:Ae.map(we=>{var Z,se,ve;return{id:(Z=we==null?void 0:we.user)==null?void 0:Z.id,name:(ve=(se=we==null?void 0:we.user)==null?void 0:se.data)==null?void 0:ve.name}}):!1;return c.jsx(y.Fragment,{children:c.jsx(oi,{content:{type:Y.verb,title:Y==null?void 0:Y.title,body:Y==null?void 0:Y.content,canLike:n,createdAt:(Y==null?void 0:Y.time)||"",slugs:{question:`${e}/${t}`,answer:j},slug:j,author:yr(Y==null?void 0:Y.actor),userLiked:X,likes:($==null?void 0:$.like)||0,comments:G||0,peopleWhoLiked:de,data:{mentions:K,...ne||{}},pinned:($==null?void 0:$.pin)&&($==null?void 0:$.pin)>0||!1,categories:So((Y==null?void 0:Y.categories)||[],i||[]),pollOptions:sf(Y,h),pollSettings:{showRemoveVote:(We=Y==null?void 0:Y.settings)==null?void 0:We.show_remove_vote,allowMultipleVotes:(Le=Y==null?void 0:Y.settings)==null?void 0:Le.allow_multiple_votes,deadlineAt:(ze=Y==null?void 0:Y.settings)==null?void 0:ze.deadline_at,hideParticipants:(Ke=Y==null?void 0:Y.settings)==null?void 0:Ke.hide_participants,numberOfWinners:(je=Y==null?void 0:Y.settings)==null?void 0:je.number_of_winners,resultsVisibility:(Ne=Y==null?void 0:Y.settings)==null?void 0:Ne.results_visibility}},links:{post:`${e}/${t}/${j}`,comments:`${e}/${t}/${j}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>z({activityId:j}),updateContent:(we,{body:Z})=>O({activityId:j,content:Z})},likes:{createLike:()=>R({activityId:j}),deleteLike:()=>B({activityId:j,reactionId:ge}),listLikes:we=>u.list({activityId:j,...we})},comments:{openComments:()=>null},pins:{createPin:()=>F({activityId:j}),deletePin:()=>S({activityId:j,reactionId:P==null?void 0:P.pin[0].id})},polls:{createVote:({reactionId:we})=>U({activityId:j,reactionId:we}),removeVote:({reactionId:we})=>V({activityId:j,reactionId:we}),removePoll:()=>ie({activityId:j})},form:s},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:k===te,userHasOwnerPermissions:r,badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:t||""},{scope:dt.Platform,area:"all"}]},basePath:e,parentId:t})},j)}),!T&&c.jsx(ii,{hasNextPage:_,loadNextPage:J,icon:{icon:"arrow-down",position:"right"},messages:{button:p.formatMessage({id:"loadMore_button"}),error:p.formatMessage({id:"loadMore_error"})}}),C.length===0&&!T&&c.jsx(Ft,{className:"no-activities",variant:"muted",icon:"text--input",children:v[0].type==="category"?c.jsx("p",{children:p.formatMessage({id:"activitiesFeed_noActivities_inCategories"})}):c.jsxs(c.Fragment,{children:[c.jsx("p",{children:p.formatMessage({id:"activitiesFeed_noActivities"})}),c.jsx("p",{children:c.jsx(Fe,{variant:"secondary",size:"small",href:"/communities",children:p.formatMessage({id:"activitiesFeed_noActivities_button"})})})]})}),c.jsx(mu,{form:m})]})},ov={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester",badges:{communities:{"community-slug":["orange-badge","badge-with-heart"]}}}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function uv({parentId:e,isMember:t,formFunctions:n,leave:r,join:i}){const a=ae.useIntl();return c.jsx(fu,{form:{content:{type:Be.Reply,slugs:{}},functions:n,meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1},placeholder:a.formatMessage({id:"discussion_responses_placeholder"})},parentId:e,membershipRequiredToPost:{isMember:t,required:!0,join:i,leave:r,notMemberStateText:a.formatMessage({id:"community_joinToPost"})}})}function lv({hasNextPage:e,fetchNextPage:t,setFocusReplyIndex:n,totalReplies:r}){const i=ae.useIntl(),a=()=>{n(r),t()};return c.jsx(ii,{hasNextPage:e,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},messages:{button:i.formatMessage({id:"loadMore_button"}),error:i.formatMessage({id:"loadMore_error"})}})}function cv({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=$e.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Qu({reply:Ng(o),user:a});return cr(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const d=Qu({reply:o,user:a});r.setQueryData(i,cr(d,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{Ao(d.id,"reply")},0)}});return s}function dv({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=$e.useMutation({mutationFn:e,onMutate:({replyId:i,content:a})=>t(s=>{const o=Dt(i,s);return o&&(o.data.content=a),s}),onError:n});return r}function fv({replies:e,user:t}){return!e||!(t!=null&&t.id)?[]:e.map(({id:n,own_children:r,latest_children:i,children_counts:a,data:s,created_at:o,parent:l,...u})=>{var f,b,g,x;const d=(((f=r==null?void 0:r.like)==null?void 0:f.length)||0)>0,m=(((b=i==null?void 0:i.like)==null?void 0:b.length)||0)>0,h=d?(g=r==null?void 0:r.like)==null?void 0:g.find(C=>{var A;return((A=C==null?void 0:C.user)==null?void 0:A.id)===(t==null?void 0:t.id)}):!1,p=typeof h=="object"?(h==null?void 0:h.id)??"":"",v=m?(x=i==null?void 0:i.like)==null?void 0:x.map(C=>{var A,E,_;return{id:(A=C==null?void 0:C.user)==null?void 0:A.id,name:(_=(E=C==null?void 0:C.user)==null?void 0:E.data)==null?void 0:_.name}}):!1;return{user:u==null?void 0:u.user,body:hv(s),createdAt:o,data:mv(s),likeId:p,liked:m,likes:(a==null?void 0:a.like)||0,peopleWhoLiked:v,replyId:n,parent:l,userLiked:!!h}})}function mv(e){if(!e||!e.mentioned_users)return{};const t=e==null?void 0:e.mentioned_users,n=(e==null?void 0:e.additional_data)||{};return{mentions:t,...n}}function hv(e){var t;return e?typeof e.content=="string"?e.content:((t=e==null?void 0:e.content)==null?void 0:t.text)||"":""}function pf({queryFns:{create:e,edit:t,like:n,list:r,remove:i,unlike:a},queryKey:s}){const o=$e.useQueryClient(),l=fa(),u={queryClient:o,queryKey:s},d={mutationHandlers:{error:Eo(u),mutate:_o(u)},user:l,...u},m=cv({...d,mutationFn:e}),h=dv({...d,mutationFn:t}),p=pv({...d,mutationFn:n}),v=vv({...d,mutationFn:i}),f=bv({...d,mutationFn:a}),{replies:b,...g}=gv({queryKey:s,queryFn:r});return{replies:fv({replies:b,user:l}),mutations:{create:m,edit:h,remove:v,like:p,unlike:f},user:l,...g}}function pv({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=$e.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Dt(s,o);return l&&Ju({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Dt(o,l);u&&Ju({reply:u,reaction:s}),r.setQueryData(i,l)}});return a}function gv({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s}=$e.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{replies:Fo(n),error:r,isLoading:i,hasNextPage:a,fetchNextPage:s}}function vv({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=$e.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(a=>ff(i,a)),onError:n});return r}function bv({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=$e.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(s=>{const o=Dt(a,s);return o&&Ig({reply:o,user:r}),s}),onError:n});return i}const yv=({activityId:e,basePath:t,isMember:n,parentId:r,replyId:i,functions:{reactions:a,form:s,likes:o}})=>{const l=ae.useIntl(),u=3,{replies:d,fetchNextPage:m,hasNextPage:h,isLoading:p,mutations:{create:v,edit:f,like:b,remove:g,unlike:x}}=pf({queryKey:[t,r,e,i,"replies"],queryFns:{...a,list:E=>a.list({...E,reactionId:i})}});lo([p]);const[C,A]=y.useState(!0);return c.jsxs(c.Fragment,{children:[(d==null?void 0:d.length)>=u&&c.jsx(Fe,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${C?"up_left":"down_right"}`,position:"left"},onClick:()=>A(!C),children:l.formatMessage({id:`discussion_thread_${C?"hide":"show"}`},{count:d==null?void 0:d.length})}),C&&c.jsx(ph,{loadMore:{isLoading:p,hasNextPage:h,loadNextPage:()=>m()},form:{parentId:r,content:{type:Be.Reply,slugs:{question:`${t}/${r}`,answer:e,reply:i}},functions:{create:(E,{body:_})=>v({activityId:e,replyId:i,content:_}),...s},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:d&&d.length>0?d==null?void 0:d.map(({replyId:E,likes:_,data:T,body:L,createdAt:O,userLiked:z,peopleWhoLiked:R,parent:B,user:F,likeId:S})=>c.jsx(oi,{isCommunity:!0,content:{id:E,type:Be.Reply,body:L,canLike:n,createdAt:O,slugs:{question:`${t}/${r}`,answer:e,reply:B},slug:"",author:yr(F),userLiked:z,likes:_,peopleWhoLiked:R,data:T},functions:{content:{createContent:()=>null,deleteContent:()=>g({replyId:E}),updateContent:(M,{body:U})=>f({replyId:E,content:U})},likes:{createLike:()=>b({replyId:E}),deleteLike:()=>x({replyId:E,reactionId:S}),listLikes:M=>o.list({replyId:E,...M})},comments:{},form:s},styling:{showShareLinkButton:!0},badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:r||""},{scope:dt.Platform,area:"all"}]},basePath:t,parentId:r},E)):null})]})};function xv({formFns:e,activityId:t,basePath:n,focus:r,isMember:i,parentId:a,reply:s}){const{body:o,data:l,likeId:u,likes:d,peopleWhoLiked:m,replyId:h,createdAt:p,user:v,userLiked:f}=s,{edit:b,like:g,remove:x,unlike:C}=e.mutations;return c.jsx(dh,{children:c.jsx(oi,{isCommunity:!0,content:{id:h,type:Be.Reply,body:o,canLike:i,createdAt:p,slugs:{question:`${n}/${a}`,answer:t,reply:h},slug:h,author:yr(v),userLiked:f,likes:d,peopleWhoLiked:m,data:l},functions:{content:{createContent:()=>null,deleteContent:()=>x({replyId:h}),updateContent:(A,{body:E})=>b({replyId:h,content:E})},likes:{createLike:()=>g({replyId:h}),deleteLike:()=>C({replyId:h,reactionId:u}),listLikes:A=>e.likes.list({replyId:h,...A})},comments:{},form:e.form},badges:{showBadges:!0,scopes:[{scope:dt.Communities,area:a||""},{scope:dt.Platform,area:"all"}]},children:c.jsx(yv,{basePath:n,parentId:a,activityId:t,replyId:h,isMember:i,functions:e}),styling:{showShareLinkButton:!0},setFocus:r,basePath:n,parentId:a},h)},h)}const gf=({activityId:e,basePath:t,parentId:n,activityTotalReplies:r,isMember:i,functions:{form:a,join:s,leave:o,likes:l,reactions:u},profile:d,showReplies:m})=>{const{fetchNextPage:h,hasNextPage:p,isLoading:v,replies:f,mutations:{create:b,remove:g,edit:x,like:C,unlike:A}}=pf({queryKey:[t,n,e,"replies"],queryFns:u}),[E,_]=y.useState(null);lo([v]),mf();const T={create:(L,O)=>{const{body:z}=O;b({activityId:e,content:z})},...a};return c.jsxs("section",{className:"replies-feed",children:[c.jsx(hh,{type:"comment",responses:r,isLoading:v}),m?c.jsxs(c.Fragment,{children:[c.jsx(uv,{parentId:n,isMember:i,join:s,leave:o,formFunctions:T}),f==null?void 0:f.map((L,O)=>c.jsx(xv,{activityId:e,basePath:t,focus:E===O,formFns:{form:a,likes:l,reactions:u,mutations:{remove:g,edit:x,like:C,unlike:A}},isMember:i,parentId:n,reply:L},L.replyId)),v?c.jsx(c.Fragment,{children:" "}):c.jsx(lv,{hasNextPage:p,fetchNextPage:h,setFocusReplyIndex:_,totalReplies:f.length})]}):c.jsx(Ft,{children:c.jsx(ae.FormattedMessage,{id:"replies_feed_missing_polls_vote_message"})}),c.jsx(mu,{form:d})]})};function wv({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s,refetch:o}=$e.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:d=>(d==null?void 0:d.next)||null}),l=Fo(n),u=`${l.length||0}${a?"+":""}`;return{likes:l,likesCount:u,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s,refetch:o}}function Cv({queryFns:{list:e},queryKey:t}){const{likes:n,...r}=wv({queryKey:t,queryFn:e});return{likes:n,...r}}function vf({basePath:e,parentId:t,activityId:n,likeCount:r,functions:i}){const{likes:a,fetchNextPage:s,hasNextPage:o,refetch:l}=Cv({queryKey:[e,t,n,"likes"],queryFns:i.likes});y.useEffect(()=>{l()},[l]);const u=a.map(({user:d})=>d).map(d=>d?yr(d):void 0).filter(d=>d&&typeof d!="string");return c.jsx("section",{className:"likes-feed",children:c.jsx(ch,{members:{data:u,total:r},showHeader:!1,showPlaceholders:!0,communitySlug:t,hasNextPage:o&&u.length<r,loadNextPage:s})})}const bf=({showModal:e=!0,functions:{onClose:t,likes:n},likeCount:r,className:i,...a})=>{const s=ae.useIntl();return c.jsx(un,{id:"likes-modal",title:s.formatMessage({id:"discussion_likes"},{number:r}),isOpen:e,functions:{onClose:t},className:W("profile-modal in-portal",i,{open:e}),maxWidth:600,children:c.jsx(vf,{...a,likeCount:r??0,functions:{likes:n}})})},Dv=Object.freeze(Object.defineProperty({__proto__:null,default:bf},Symbol.toStringTag,{value:"Module"})),Ev={results:[{created_at:"2024-05-16T13:17:45.940899Z",updated_at:"2024-05-16T13:17:45.940899Z",id:"ab4b7ab0-f4fe-469f-a8e7-5a52b3e55333",user_id:"9ed21585-63be-4446-96ce-3e703820eb73",user:{id:"1234",data:{name:"Han Solo",thumbnail:"https://placehold.co/400x400",jobTitle:"Smuggler",organization:"Rebel Alliance",badges:{communities:{"endor-alumni":["blue-badge"]}}}},kind:"like",activity_id:"869e5a90-0eba-11ef-8080-80017b714aaf",data:{mentioned_users:null},parent:"",latest_children:{},children_counts:{}},{created_at:"2024-05-16T13:17:45.940899Z",updated_at:"2024-05-16T13:17:45.940899Z",id:"db4b7ab0-f4fe-469f-a8e7-5a52b3e55373",user_id:"9ed21585-63be-4446-96ce-3e703820eb73",user:{created_at:"2023-08-22T11:56:10.585365Z",updated_at:"2024-03-13T11:31:49.447916Z",id:"9ed21585-63be-4446-96ce-3e703820eb73",data:{jobTitle:"Admiral",name:"Princess Leia",organization:"Rebela Alliance",thumbnail:"https://placehold.co/400x400",badges:{platform:{all:["orange-badge"]}}}},kind:"pin",activity_id:"769e5a90-0eba-11ef-8080-80017b714aaf",data:{mentioned_users:null},parent:"",latest_children:{},children_counts:{}}],next:"xy12345"};const _v=3e3,yf=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=ae.useIntl(),r="discussion_share_copy_link",[i,a]=y.useState({isOpen:!1,isCopied:!1});return c.jsxs("li",{className:"share-link-wrapper",children:[c.jsx(Kr,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>a({...i,isOpen:!0}),onFocus:()=>a({...i,isOpen:!0}),onMouseOut:()=>a({isOpen:!1,isCopied:!1}),onBlur:()=>a({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{a({isOpen:!0,isCopied:!0});const s=new CustomEvent("ariaLive",{detail:{message:n.formatMessage({id:`${r}_success`})}});document.dispatchEvent(s),setTimeout(()=>{a({isOpen:!1,isCopied:!1})},_v)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event,"data-testid":"share-link",screenreaderText:n.formatMessage({id:r})}),c.jsx($n,{className:W({copied:i.isCopied}),isOpen:i.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:n.formatMessage({id:`${r}${i.isCopied?"_success":""}`})})]})};const Vn="discussion_",xf=({className:e,gtmContext:t,contentType:n,likes:r,comments:i,replies:a,shareLink:s,moreMenu:o})=>{const l=ae.useIntl(),u=[];return o&&o.reportData&&u.push({text:l.formatMessage({id:`${Vn}moreMenu_report`}),onClick:d=>{d.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(l.formatMessage({id:`${Vn}report_subject`}))}&body=${encodeURI(l.formatMessage({id:`${Vn}report_body`},{contentType:n||"",contentSlug:o&&o.reportData&&o.contentSlug||"",contentUrl:o&&o.reportData&&o.reportData.contentUrl||""}))}`,icon:"flag"}),c.jsxs("ul",{className:W("actions text-medium",e),"data-testid":`${n}-actions`,children:[r?c.jsx(hf,{element:"li",likes:r.count,isShort:!1,userLiked:r.userLiked,content:{type:n,slugs:r.content.slugs,slug:r.content.slug},canLike:r.canLike,peopleWhoLiked:r.peopleWhoLiked,activityId:r.activityId,functions:r.functions,basePath:r.basePath||"",parentId:r.parentId||""}):c.jsx(c.Fragment,{}),i?c.jsx("li",{children:c.jsx(Kr,{onClick:d=>{d.preventDefault(),d.stopPropagation(),i.functions.onClick()},icon:{icon:"speech-bubble_square"},"data-testid":"comment","data-gtm-event-context":t,"data-gtm-event-type":`answer-${n}-click`,screenreaderText:l.formatMessage({id:`${Vn}comments_screenReader`},{count:i.count}),children:l.formatMessage({id:`${Vn}comments${i.count===null?"_loading":""}`},{count:i.count})})}):c.jsx(c.Fragment,{}),a?c.jsx("li",{children:c.jsx(Kr,{styling:{muted:!0},onClick:a.functions.onClick,icon:{icon:"speech-bubble_square"},"data-testid":"reply",children:l.formatMessage({id:`${Vn}reply`})})}):c.jsx(c.Fragment,{}),s?c.jsx(yf,{url:s.url,gtm:{context:t||"",event:`copy-link-${n}-click`}}):c.jsx(c.Fragment,{}),o?c.jsx(Cf,{element:"li",id:`more-${o.contentSlug}`,options:[...o.options||[],...u]}):c.jsx(c.Fragment,{})]})};const kv=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ae.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(Me,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),c.jsx("ul",{className:W("breadcrumbs text-small",n),children:e.map(({text:i,href:a,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),c.jsxs("li",{children:[s&&c.jsx(Me,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),c.jsx(xn,{href:s?void 0:a,...l,children:sr(i,t)})]},`${window.btoa(i)}_${o}`)})})]})};const jo=({variant:e="default",data:{image:t,url:n,title:r,description:i},onClick:a,gtm:s,...o})=>{const l=n.split("//")[1].split("/")[0],{context:u="EnrichedLink",event:d="enriched-link-click"}=s??{};return c.jsxs("aside",{className:W("enriched-url gtm-trackable",{"has-image":t,[e]:e!=="default"}),onClick:m=>{if(m.preventDefault(),m.stopPropagation(),a){a(m);return}window.open(n,"_blank")},"data-gtm-event-context":u,"data-gtm-event-type":d,children:[c.jsx("small",{children:l}),c.jsx("p",{className:"title text-medium",children:c.jsx("a",{...o,href:n,target:"_blank",rel:"noreferrer",children:r})}),i&&e!=="condensed"?c.jsx("p",{className:"text-small",children:i}):c.jsx(c.Fragment,{}),t&&t.src?c.jsx("p",{className:"img",children:c.jsx("img",{src:t.src,alt:t.alt||"",loading:"lazy",fetchpriority:"low",width:t.width||"auto",height:t.height||"100%"})}):c.jsx(c.Fragment,{})]})};const wf=({options:e,defaultOptions:t=[],allOption:n=!1,allowMultiple:r=!0,onChange:i=()=>{},preventNoOptionSelected:a=!1,className:s=""})=>{const o=ae.useIntl(),l=n?[{id:"all",text:typeof n!="boolean"&&n.text||o.formatMessage({id:"filters_all"})},...e]:e,[u,d]=y.useState(n?["all"]:t.length?t.map(v=>v.id):[]),[m,h]=y.useState(0),p=(v,f)=>{let b=[];u.includes(v)&&!a?b=u.filter(g=>g!==v):v==="all"?b=["all"]:r?b=[...u.filter(g=>g!=="all"),v]:b=[v],d(g=>(i&&typeof i=="function"&&i({current:b,previous:g}),b)),f&&typeof f=="function"&&f()};return c.jsx("ul",{className:W("filters",s),children:l.map(({id:v,text:f,disabled:b=!1,callback:g=()=>{}},x)=>{let C={tabIndex:m===x?0:-1};return b&&(C={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:f})}),c.jsx("li",{children:c.jsx("button",{className:W(v,{selected:u.includes(v)}),onClick:A=>{A.preventDefault(),A.stopPropagation(),p(v,g)},onKeyDown:A=>{var L,O;let E=x+1,_,T;switch(A.code){case"Enter":case"Space":A.preventDefault(),A.stopPropagation(),p(v,g);break;case"ArrowLeft":case"ArrowRight":A.preventDefault(),A.stopPropagation(),A.code==="ArrowLeft"?(E=x-1,E<0&&(E=l.length-1)):E>=l.length&&(E=0),h(E),_=A.currentTarget.closest("li"),T=(L=_==null?void 0:_.parentElement)==null?void 0:L.children[E],(O=T==null?void 0:T.querySelector("button"))==null||O.focus();break}},"aria-selected":u.includes(v),...C,children:f})},v)})})},Fv=(e,t,n)=>{const r=String(e);if(!n||!n.length)return t?`/${r}/${t}`:`/${r}`;let i="",a=!1;return n.forEach(({url:s,position:o})=>{o==="before-lang"?(i+=`/${s}`,a=!0):(i.includes(`/${r}/`)||(i+=`/${r}`),i+=`/${s}`)}),i.includes(`/${r}/`)||(i+=`/${r}`),t&&(i+=`/${t}`),a?{url:i,urlForRouter:`/${i.split("/").slice(2).join("/")}`}:i};const pi="languageSwitcher_",Av=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:i,urlParts:a,variant:s="default",label:o,className:l=""})=>{const u=ae.useIntl(),{updateLanguage:d=()=>{}}=y.useContext(po),[m,h]=y.useState(e);if(y.useEffect(()=>{e!==m&&h(e)},[e]),!r||!Object.values(r).some(b=>b&&b.post_name))return null;const v=Object.keys(r),f=m!==e;return c.jsxs("div",{className:W("language-switcher text-small",s,l),children:[c.jsxs("nav",{children:[s!=="short"&&c.jsx("p",{children:o||u.formatMessage({id:`${pi}label`})}),c.jsx("ul",{children:v.map(b=>{var C;if(!Pi[b])return null;const g=(C=r[b])==null?void 0:C.post_name;let x={className:b};if(m===b)x["aria-label"]=u.formatMessage({id:`${pi}selected`},{language:Pi[b]});else{const A=Fv(b,g,a);x={...x,href:typeof A=="string"?A:A.url,onClick:E=>{h(b),d(b),typeof i<"u"&&(E.preventDefault(),E.stopPropagation(),i(b,typeof A=="string"?A:A.urlForRouter))}}}return c.jsx("li",{children:c.jsx(xn,{...x,fallbackElement:"span",children:Pi[b]})},b)})}),s!=="short"&&!f&&c.jsx("p",{children:u.formatMessage({id:`${pi}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&c.jsx("small",{children:u.formatMessage({id:`${pi}disclaimer`},{email:Qn.support,link:b=>{const g=`mailto:${b}`;return c.jsx("a",{href:g,children:b})}})})]})};const qa=ae.createIntl({locale:"en",messages:pr}),ii=({hasNextPage:e=!0,loadNextPage:t=()=>{},isLoading:n=!1,variant:r="secondary",size:i="medium",styling:a={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:qa.formatMessage({id:"loadMore_button"}),endOfFeed:qa.formatMessage({id:"loadMore_endOfFeed"}),error:qa.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[d,m]=y.useState(""),h=async p=>{if(!n)try{await t(p)}catch(v){v instanceof Error?m(v.message):m("Unknown error")}};return!d&&!e&&!o.endOfFeed?null:c.jsx("footer",{className:W("load-more",l),children:!d&&e?c.jsx(Fe,{variant:r,size:i,styling:a,icon:s,onClick:h,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!d||d!=null&&d.includes("Cannot read items"))?c.jsx("p",{children:o.endOfFeed}):d&&c.jsx("p",{className:"error",children:o.error})})};const Po=({variant:e="default",version:t="default",className:n="",...r})=>c.jsx("p",{className:"logo-wrapper",children:c.jsx("a",{href:"/home/",className:W("logo",e,t,n),...r,children:c.jsx(Me,{children:c.jsx(ae.FormattedMessage,{id:"apolitical"})})})});let gi=!1;const Cf=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const i=ae.useIntl(),a=y.useRef(null),[s,o]=y.useState(!1),l=u=>{a.current&&u.target instanceof HTMLElement&&!a.current.contains(u.target)&&o(!1)};return y.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),y.createElement(e,{ref:a,className:W("more-menu text-medium",r),children:c.jsxs(c.Fragment,{children:[c.jsx(Fe,{variant:"tertiary",size:"medium","data-testid":"more-menu",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),c.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:d,text:m,icon:h,...p},v)=>{const f={...p,onClick:b=>{o(!1),typeof d=="function"&&d(b)},onFocus:()=>{gi&&(clearTimeout(gi),gi=!1)},onBlur:()=>{gi=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),c.jsx("li",{className:"more-menu-list-item",children:c.jsx(Fe,{variant:"tertiary",size:"medium",icon:h?{icon:h,position:"left"}:!1,...f,children:m})},`${window.btoa(m)}_${v}`)})})]})})},Bv=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const Tv=y.lazy(()=>Promise.resolve().then(()=>Ap)),Sv=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],Df=({activeLink:e,profile:t})=>{const n=ae.useIntl(),r=y.useContext(at),i=r&&typeof r.id=="string";return c.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[Sv.map(({key:a,href:s})=>{const o=Bv(s,e),l={};return o&&(l["aria-current"]="page"),c.jsx("li",{className:W(a,{active:o}),children:c.jsx("a",{href:s,"data-gtm-event-type":`${a}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...l,children:n.formatMessage({id:`navigationMenu_links_${a}`})})},a)}),i&&t&&c.jsx(Tv,{element:"li",member:r,styling:{variant:"card",isCondensed:!1},functions:{profile:t},className:"profile gtm-trackable","data-testid":"profile-link",alt:"",gtmContext:"NavigationMenu",gtmType:"profile-click"})]})},Fr=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,jv=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${Fr(t,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(e)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${Fr(t,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(e)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${Fr(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
65
65
 
66
- ${Fr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:Fr(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const Pv="shareLinks_",Ov=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:a="default",className:s=""})=>{const o=ae.useIntl(),l=jv({title:e,link:t,referrer:n});return c.jsxs("aside",{className:W("share-links",i,a,s),children:[c.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),c.jsx("ul",{children:l.map(({key:u,icon:d,url:m,shouldRender:h=!0,onClick:p})=>{if(typeof h=="function"&&!h())return null;const v={};return p&&(v.onClick=f=>p(f,m)),c.jsx("li",{children:c.jsx(Fe,{size:i,variant:"tertiary",icon:{icon:d||u},href:m,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${Pv}link_${u}`}),...v})},u)})})]})};const Mv=({tabs:e,className:t="",preventLocationChange:n})=>{var v;const r=(f,b,g)=>(f||(f=`panel-${window.btoa(b)}-${g}`),f),i=Rn(!0)||0;let a=e.findIndex(f=>f.current===!0);if(a<0&&(a=0),window.location.hash){const f=window.location.hash.replace("#","");if(e.find(g=>g.id===f)){for(let g=0;g<e.length;g++)if(r(e[g].id,e[g].text,g)===f){a=g;break}}}const[s,o]=y.useState((v=e[a])!=null&&v.id?e[a].id:r(e[a].id,e[a].text,a)),[l,u]=y.useState(""),d=(f,b)=>{switch(f.key){case"ArrowLeft":case"ArrowRight":{f.preventDefault();let g=b;f.key==="ArrowLeft"?b>0?g=b-1:g=e.length-1:f.key==="ArrowRight"&&(b<e.length-1?g=b+1:g=0);const x=r(e[g].id,e[g].text,g),C=document.getElementById(`tab-${x}`);C==null||C.focus(),u(x);break}case"Enter":o(l),window.location.hash=`#${l}`;break}},m=f=>{let b=!1;return f.target==="min-width"&&i>=f.value&&(b=!0),f.target==="max-width"&&i<=f.value&&(b=!0),b};y.useEffect(()=>{if(e[a].hasCarousel){const f=new CustomEvent("hiddenSectionVisible",{detail:{id:s}});window.dispatchEvent(f)}},[s]);const h=[],p=[];return e.forEach(({id:f,text:b,content:g,href:x,hasCarousel:C,breakpoint:A},E)=>{if(A&&!m(A))return;f=r(f,b,E);const _=s===f,T={};x||(T["aria-controls"]=f,T.onClick=L=>{L.preventDefault(),L.stopPropagation(),o(f),!n&&(window.location.hash=`#${f}`)},p.push(c.jsx("section",{id:f,hidden:!_,role:"tabpanel","aria-labelledby":`tab-${f}`,"aria-live":_?"assertive":"off",children:typeof g=="string"?c.jsx("p",{children:g}):g},`section-${f}`))),h.push(c.jsx("li",{"data-testid":"navigation-tab",children:c.jsx("a",{href:x||`#${f}`,id:`tab-${f}`,"aria-controls":f,className:W({selected:_}),role:"tab",tabIndex:_?0:-1,"aria-selected":_,onKeyDown:L=>d(L,E),...T,children:b})},`tab-${f}`))}),c.jsxs("div",{className:W("tabs-wrapper",t),children:[c.jsx("ul",{className:"tabs",role:"tablist",children:h}),c.jsx("div",{className:"tab-content",children:p})]})};const Nv={"2-1":901,"1-3":769,"1-1":769},Ef=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:i})=>{const a=Rn(!0);let s=i;return y.Children.count(i)===1&&(s=y.Children.toArray(i)[0],s.props&&(s=s.props.children)),c.jsx("section",{className:W("columns",`layout-${e}`,r,{"has-containers":n}),children:y.Children.map(s,(o,l)=>t!==!1&&l===t&&a&&a<Nv[e]?null:o)})};const Oo=({id:e="character-limit",limit:t,valueLength:n,...r})=>{const i=ae.useIntl(),a="form_fieldWrapper_characterLimit";if(t===0)return null;const s=t-n,o=Math.abs(n-t),l=n>=.99*t,u=n>=.9*t&&n<.99*t,d=n>t;return c.jsxs(c.Fragment,{children:[c.jsx("small",{id:e,className:W("character-limit",{"near-limit":l,"approaching-limit":u}),"aria-live":"polite","aria-label":d?"":i.formatMessage({id:`${a}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}),children:d?i.formatMessage({id:`${a}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"hidden",children:i.formatMessage({id:a})}),n," / ",t]})}),c.jsx(Me,{showOnFocus:!1,id:`${e}-info`,children:i.formatMessage({id:`${a}_info`},{limit:t})})]})},pa=e=>(e==null?void 0:e.toString().length)||0,_f=(e,t)=>{const n={};return e===0||(n["data-character-limit"]=e,n.functions={...t,onChange:r=>{pa(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t.onChange(r)}}),n};const vi="emailHelperTextBox_",kf=({id:e="email-helper-textbox",type:t,email:n,redirectPath:r,resendVerificationCode:i})=>{const a=ae.useIntl(),[s,o]=y.useState({path:`${vi}default`,type:"default",link:{},mail:{},error:""}),[l,u]=y.useState(!1),d=y.useCallback(v=>{v.preventDefault(),v.stopPropagation();const f=b=>{o({path:`${vi}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:g=>d(g),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:b})};if(typeof i!="function"){f(a.formatMessage({id:`${vi}error_noFunction`}));return}u(!0),i(n).then(()=>{localStorage.setItem("email",n),window.location.href=r||"/signup/verify-email"}).catch(b=>{f(b.message)}).finally(()=>{u(!1)})},[n,r,i]);y.useEffect(()=>{let v=vi,f="default",b={},g={};switch(t){case"gov":v+="autoApproved",f="success";break;case"nonGov":v+="unrecognisedEmail",f="error",b={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":v+="pendingApproval",f="error",g={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":v+="emailUnverified",f="error",b={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:x=>d(x),"data-testid":"send-verify-email-click"};break;case"exists":v+="emailAlreadyExists",f="error",b={href:"/api/next-ui/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},g={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:v+="default",b={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}o({...s,path:v,type:f,link:b,mail:g})},[t]);const m={};return["link","mail"].forEach(v=>{m[v]=Object.keys(s[v]).length?f=>c.jsx("a",{...s[v],children:f}):f=>f}),c.jsx(Td,{id:e,type:s.type,heading:l?!1:a.formatMessage({id:`${s.path}_title`}),"aria-live":"assertive",children:l?c.jsxs(c.Fragment,{children:[c.jsx(It,{element:"span"}),c.jsx(It,{element:"span"})]}):a.formatMessage({id:`${s.path}_text`},{...m,strong:v=>c.jsx("strong",{children:v}),em:v=>c.jsx("em",{children:v}),br:c.jsxs(c.Fragment,{children:[c.jsx("br",{}),c.jsx("br",{})]}),error:s.error})})},Jn=({className:e="",element:t="input",id:n,inputRef:r,functions:i={onChange:()=>{}},name:a=n,placeholder:s,type:o="text",value:l,autoFocus:u,label:d,styling:m={},...h})=>{const p=y.useRef(),v=r||p,{autosizeToFit:f=!1}=m;return fd(f&&t==="textarea",v),y.useEffect(()=>{var b;u&&((b=v.current)==null||b.focus())},[]),!(h!=null&&h.autoComplete)&&["email"].includes(o)&&(h.autoComplete="email"),y.createElement(t,{ref:v,...h,id:n,name:a,className:W(e,t,{autoresize:f}),value:l,placeholder:s,autoFocus:u,...i,onChange:b=>{const g=b.target;i.onChange(g.value)}})};const Wn={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},Iv=500,Rv=({id:e,name:t=e,value:n,placeholder:r,functions:i={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...a})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=i,[{input:l,displayInput:u,debouncedInput:d},m]=y.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:h,activePredictionIndex:p,isPredictionSelected:v},f]=y.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:b}=ae.useIntl();r||(r=b({id:"inputAutocomplete_placeholder"})),y.useEffect(()=>{const A=setTimeout(()=>{v||m(E=>({...E,debouncedInput:l}))},Iv);return()=>{clearTimeout(A)}},[l,v]),y.useEffect(()=>{d&&!v?(async()=>{try{const E=await o(d)||[];f(_=>({..._,predictions:E}))}catch(E){console.error("Error fetching predictions:",E),f(_=>({..._,predictions:[]}))}})():f(A=>({...A,predictions:[]}))},[d,v]),y.useEffect(()=>{p>=0&&h[p]&&m(A=>({...A,displayInput:h[p].description}))},[p,h]);const g=A=>{[Wn.DOWN,Wn.UP,Wn.ENTER].includes(A.key)&&(A.preventDefault(),A.key===Wn.DOWN&&p<h.length-1?f(E=>({...E,activePredictionIndex:p+1})):A.key===Wn.UP&&p>0?f(E=>({...E,activePredictionIndex:p-1})):A.key===Wn.ENTER&&p>-1&&(s(h[p].description),m(E=>({...E,input:h[p].description})),f(E=>({...E,predictions:[],isPredictionSelected:!0}))))},x=A=>{s(A.target.value),m(E=>({...E,input:A.target.value,displayInput:A.target.value})),f(E=>({...E,activePredictionIndex:-1,isPredictionSelected:!1}))},C=A=>{s(A.description),m(E=>({...E,input:A.description,displayInput:A.description})),f(E=>({...E,isPredictionSelected:!0,predictions:[]}))};return c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:u,onChange:x,onKeyDown:g,placeholder:r,name:t,id:e,...a}),c.jsx("ul",{className:"predictions-list",children:h.map((A,E)=>c.jsx("li",{onClick:()=>C(A),onMouseEnter:()=>f(_=>({..._,activePredictionIndex:E})),className:W("predictions-list-item",{active:E===p}),children:A.description},E))})]})};const Mo=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:i,inputRef:a,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:d,accessibilityOptions:{checkboxes:{navigateWithArrowKeys:m=!1}={}}={},...h})=>{const p=ae.useIntl(),{onChange:v,...f}=r,b=()=>{t||v(d?null:l)},g=c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:a,id:i,name:i,type:u,value:l,checked:d,readOnly:!0,disabled:t,tabIndex:-1}),c.jsx("span",{className:W("pretty-checkbox",{radio:u==="radio"}),"data-testid":"pretty-checkbox"}),c.jsx("label",{htmlFor:i,onKeyDown:x=>{(x.key==="Enter"||x.code==="Space")&&(x.preventDefault(),x.stopPropagation(),b())},tabIndex:d||!m?0:-1,children:o||p.formatMessage({id:s?`${s}_${i}`:i})})]});return y.createElement(n,{onClick:x=>{const C=x.target;C.nodeName.toLowerCase()==="a"||C.parentNode&&C.parentNode.nodeName.toLowerCase()==="a"||(x.preventDefault(),x.stopPropagation(),b())},onKeyDown:m?x=>{var C,A,E;if(x.key!=="Tab")switch(x.code){case"Enter":case"Space":x.stopPropagation(),x.preventDefault(),b();break;case"ArrowLeft":case"ArrowRight":x.stopPropagation(),x.preventDefault();const _=x.currentTarget;let T=_==null?void 0:_.nextElementSibling;if(x.key==="ArrowLeft"){const L=_==null?void 0:_.previousElementSibling;L?T=L:T=(C=_==null?void 0:_.parentElement)==null?void 0:C.lastElementChild}else T||(T=(A=_==null?void 0:_.parentElement)==null?void 0:A.firstElementChild);T&&((E=T==null?void 0:T.querySelector("label"))==null||E.focus());break}}:void 0,className:W(i,"checkbox-wrapper",e,{"is-checked":d}),...h,...f},g)};const $v=y.memo(function({direction:t="down"}){return c.jsx(la,{className:W("rotating-chevron",`direction-${t}`)})});const Lv=({className:e,options:t,initialValue:n,value:r,functions:i={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:a}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const d=ae.useIntl(),[m,h]=y.useState(!1),p=r||n,v=Array.isArray(p)?[...p]:p?[p]:[],[f,b]=y.useState(v);let g;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?g=t&&f?t.find(T=>T.id===f[0]):t?t[0]:{id:"",label:""}:Array.isArray(f)&&f.length===1&&typeof f[0]!="string"?g=f[0]:g={id:"",label:""},y.useEffect(()=>{b(v)},[r,n]);const{onChange:x,onMultiSelectSubmit:C,...A}=i,E=T=>{if(o){let L=[];f!=null&&f.includes(T.id)?L=f.filter(O=>O!==T.id):L=[...f,T.id],b([...L]),x&&x([...L])}else b([T]),x&&x(T.id),h(!1)},_=T=>{if(T==="all"){const L=(t==null?void 0:t.map(O=>O.id))||[];b(L),x&&x(L)}else b([]),x&&x([])};return c.jsxs("div",{className:W("dropdown-wrapper",e),children:[c.jsxs("button",{className:"input","aria-expanded":m,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:T=>{T.preventDefault(),T.stopPropagation(),h(!m)},"data-testid":"dropdown-selector",...A,children:[o?`${s} · ${f.length}`:g.label,c.jsx($v,{direction:m?"up":"down"})]}),c.jsx("select",{defaultValue:g.id,onChange:T=>{T.preventDefault(),T.stopPropagation();const L=t&&t.find(O=>O.id===T.target.value);E(L)},hidden:!m,...A,children:t==null?void 0:t.map(T=>c.jsx("option",{value:T.id,className:"gtm-trackable","data-gtm-event-type":`${T.id}-click`,"data-gtm-event-context":a,children:T.label},T.id))}),c.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!m,children:[c.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&c.jsxs("div",{className:"action-bar",children:[c.jsx("p",{children:`${f==null?void 0:f.length} selected`}),c.jsxs("ul",{children:[c.jsx("li",{children:c.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>_("all"),className:"gtm-trackable","data-gtm-event-type":"all-click","data-gtm-event-context":a,children:d.formatMessage({id:"dropdown_menu_multiselect_all"})})}),c.jsx("li",{children:c.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>_("none"),className:"gtm-trackable","data-gtm-event-type":"none-click","data-gtm-event-context":a,children:d.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),c.jsx("ul",{children:t==null?void 0:t.map(T=>{const L=T.id===g.id||(f==null?void 0:f.includes(T))||(f==null?void 0:f.includes(T.id));return c.jsx("li",{"data-testid":"dropdown-options",children:c.jsxs("button",{className:W("gtm-trackable",{selected:L,"selected-single":L&&!o}),"data-gtm-event-type":`${T.id}-click`,"data-gtm-event-context":a,onClick:O=>{O.preventDefault(),O.stopPropagation(),E(T)},role:"menuitem","aria-current":L,"data-testid":L?"current-selection":"",children:[o&&c.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),c.jsx("span",{className:W({"menu-option-label":o}),children:T.label})]})},T.id)})})]}),(l==null?void 0:l.submitSection)&&c.jsx("p",{className:"submit",children:c.jsx(Fe,{variant:"secondary",onClick:()=>{C&&C(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),h(!1)},children:d.formatMessage({id:"form_submit"})})})]})]})},Pr=(e,t)=>{switch(e){case"required":if(!t||typeof t=="string"&&t.trim().length===0)return!0;break;case"no-numbers":if(t&&!/^([^0-9]*)$/.test(t))return!0;break;case"valid-email":if(t&&!/^(([^<>()[\]\\.,;:\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,}))$/.test(t))return!0;break;case"valid-url":if(t&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/i.test(t))return!0;break;default:return!1}return!1};let Ua=null;const zv=({id:e,label:t,limit:n,value:r,placeholder:i,functions:a,error:s,multipleInputs:o,validation:l,fieldData:u,type:d,...m})=>{const h=ae.useIntl(),{showCount:p=!1,label:v,defaultInputs:f=1,maxInputs:b=100,hasButton:g=!1,allowDuplicateValues:x=!1}=o||{},[C,A]=y.useState(r?Array.isArray(r)?r:[r]:Array(f).fill("")),E=C.filter(z=>z!==""),_=()=>{if(!u)return;const z=Ot(u.fields).filter(({id:F,name:S})=>(F||(F=S||""),F!==e&&!F.includes(`${e}-`))),R=[];C.map((F,S)=>{if(b&&S>=b)return;const M=Ot(l??[]);e&&(x||M.push({condition:U=>{var D;const V=U[e].toLowerCase(),ie=((D=U[`${e}-all`])==null?void 0:D.length)??0,te=new Set(U[`${e}-all`].map(J=>J.toLowerCase()));return te.has(V)&&te.size<ie},error:h==null?void 0:h.formatMessage({id:"form_error_multipleInputs_same"})}),M.forEach(U=>{const{condition:V,error:ie}=U;if(typeof V=="function")U.condition=te=>{var Y;let D=(Y=te==null?void 0:te[e])==null?void 0:Y[S];D||(te[e]&&!Array.isArray(te[e])?D=te[e]:D="");const J=Ot(te);return J[e]=D,J[`${e}-all`]=te[e],typeof V=="function"&&V(J)?ie:!1};else{const te=V;U.condition=D=>{var Y;let J=(Y=D==null?void 0:D[e])==null?void 0:Y[S];switch(J||(D[e]&&!Array.isArray(D[e])?J=D[e]:J=""),te){case"required":ie||(U.error=h==null?void 0:h.formatMessage({id:"form_error_required"}));break;case"no-numbers":ie||(U.error=h==null?void 0:h.formatMessage({id:"form_error_numbers"}));break;case"valid-email":ie||(U.error=ie||(h==null?void 0:h.formatMessage({id:"form_error_email"})));break;case"valid-url":ie||(U.error=h==null?void 0:h.formatMessage({id:"form_error_url"}));break;default:console.warn("WARNING! No field validation condition has been set")}return Pr(te,J)?U.error:!1}}}),R.push({id:`${e}-${S}`,validation:M,value:F}))});const B={fieldsToValidate:z.concat(R)};u.multipleInputs.includes(e)&&(B.multipleInputs=u.multipleInputs.filter(F=>F!==e)),u.setFields(F=>({...F,...B}))};y.useEffect(()=>{_()},[C.length]),y.useEffect(()=>{!u||!u.multipleInputs||u.multipleInputs.includes(e)&&_()},[u==null?void 0:u.multipleInputs]);const T=()=>{(!b||C.length<b)&&A([...C,""])},L=z=>{const R=document.getElementById(`${e}-${z+1}`);R==null||R.focus()},O=(z,R)=>z.replace("{number}",R+1);return c.jsxs("fieldset",{className:W("multiple-inputs field-wrapper",{"has-button":g,"has-legend":t}),children:[t?c.jsxs("legend",{className:"legend-as-label",children:[t,p?c.jsxs(c.Fragment,{children:[" ",c.jsx("small",{className:"filled-in-count","aria-label":h.formatMessage({id:"form_multipleInputs_filledInCount_aria"},{number:E.length,total:b}),children:h.formatMessage({id:"form_multipleInputs_filledInCount"},{number:E.length,total:b})})]}):""]}):c.jsx(c.Fragment,{}),C.map((z,R)=>{if(b&&R>=b)return c.jsx(c.Fragment,{});let B=!1;t?B=c.jsx(Me,{showOnFocus:!1,children:h.formatMessage({id:"form_multipleInputs_label"},{number:R+1})}):v&&(B=O(v,R));const F=`${e}-${R}`,S=R+1>f;return c.jsx(Ff,{id:F,type:"text",label:B,value:z,placeholder:i?O(i,R):void 0,className:W({"has-remove-button":S}),limit:n,error:s&&typeof s!="string"?s==null?void 0:s[F]:void 0,functions:{...a,onFocus:()=>{g||R!==C.length-1||T()},onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),M.stopPropagation(),Ua&&clearTimeout(Ua),R!==C.length-1?L(R):(T(),Ua=setTimeout(()=>L(R),100)))},onChange:M=>{const U=C[R].toLowerCase(),V=Ot(C);V[R]=M,A(V),u==null||u.dispatch({type:"removeError",payload:{key:F}}),x||V.forEach((ie,te)=>{Hr(ie)&&te!==R&&ie.toLowerCase()===U&&(u==null||u.dispatch({type:"removeError",payload:{key:`${e}-${te}`}}))}),a==null||a.onChange(V)}},siblings:S?c.jsx(Fe,{variant:"tertiary",size:"small",icon:"close",screenreaderText:h.formatMessage({id:"form_multipleInputs_remove"}),onClick:()=>{const M=Ot(C);M.splice(R,1),A(M),u==null||u.dispatch({type:"removeError",payload:{key:F}}),a==null||a.onChange(M)}}):void 0,...m},F)}),g?c.jsx(Fe,{...g,onClick:T,disabled:!!(b&&b<=C.length)}):c.jsx(c.Fragment,{})]})};const tl=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:i,multiSelect:a=!1,name:s,options:o,required:l,type:u="checkboxes",value:d,accessibilityOptions:m,styling:{displayOptionsAsPills:h=!1}={},...p})=>{const v=ae.useIntl(),f=a?d:[],b=d;return c.jsx("ul",{...p,className:W("options-wrapper",e,{"with-pills filters":h}),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:g,label:x=!1,value:C=g,disabled:A=!1})=>{const E=`${r}_${g}`,_=()=>{if(A)return;let T;if(a){const L=f==null?void 0:f.indexOf(C);Array.isArray(f)&&L>=0?(T=f,T.splice(L,1)):(!f||f.length===0?T=[]:T=f,T.push(C))}else T=b===C?void 0:C;t.onChange(T)};return c.jsx(Mo,{element:"li",id:E,type:u==="checkboxes"?"checkbox":"radio",shownValue:C,value:a?f==null?void 0:f.includes(C):b===C,functions:{...t,onChange:_},intlPath:n,label:x||v.formatMessage({id:n?`${n}_${g}`:g}),disabled:A,accessibilityOptions:m},E)})})};const qv=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},autoComplete:r="on",...i})=>{const a=ae.useIntl(),s=y.useRef(),o=e||s,[l,u]=y.useState(!1),[d,m]=y.useState(t),h=()=>{var p;u(!l),m(l?"password":"text"),(p=o.current)==null||p.focus()};return c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:W("show-password gtm-trackable",{"password-visible":l}),"data-gtm-event-context":n,"data-gtm-event-type":`${l?"hide":"show"}-password-click`,onClick:h,"aria-label":a.formatMessage({id:`showpassword_aria_${l?"hide":"show"}`}),children:a.formatMessage({id:`showpassword_${l?"hide":"show"}`})}),c.jsx(Jn,{inputRef:o,type:d,autoComplete:r,...i})]})};const Hn={text:{component:Jn},email:{component:Jn},url:{component:Jn},textarea:{component:Jn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Mo},checkboxes:{component:tl,props:{multiSelect:!0}},radio:{component:tl,props:{multiSelect:!1}},select:{component:Lv},password:{component:qv},autocomplete:{component:Rv},"multiple-inputs":{component:c.jsx(c.Fragment,{})}},Ff=e=>{const t=ae.useIntl(),{id:n,intlPath:r=!1,className:i="",error:a,functions:s={onChange:()=>{}},limit:o=0,showRequiredLabels:l=!0,type:u,validation:d,value:m,submitOnEnter:h,fieldData:p,siblings:v,...f}=e;if(u&&u==="multiple-inputs")return c.jsx(zv,{...e});const b=d&&d.some(({condition:S})=>S==="required"),g=pa(m),x=u&&Hn[u]&&Hn[u].component?Hn[u].component:Jn,C=u&&["checkboxes","radio"].includes(u),A=u&&["autocomplete"].includes(u),E=a&&`error-${n}`,_=`character-limit-${n}`,T={};C?T.element="legend":T.htmlFor=n;let L={...f,id:n,name:n,className:a?"error":"",type:u,required:b,"aria-required":b,functions:Ot(s),value:m};const O=S=>{L["aria-describedby"]?L["aria-describedby"]+=` ${S}`:L["aria-describedby"]=S};if(o>0){const S=_f(o,s);O(`${_}-info`),L={...L,...S},S.functions&&typeof S.functions=="object"&&(L.functions={...L.functions,...S.functions})}u&&Hn[u]&&Hn[u].props&&(L={...L,...Hn[u].props}),C&&(L.intlPath=`${r}_${n}`),a&&(L["aria-invalid"]=!0,L["aria-errormessage"]=E,O(E));const z=f.label||t.formatMessage({id:r?`${r}_${n}`:n}),R=({...S})=>a?y.createElement(S.as||"p",{id:E,className:"error text-small",...S},a):null;if(u&&["checkbox"].includes(u))return c.jsxs(c.Fragment,{children:[c.jsx(x,{...L,label:z,className:W("field-wrapper",i)}),c.jsx(R,{as:"p"})]});const B={};C?T.className="legend-as-label text-small":B.className="field-label";const F=({element:S,...M})=>y.createElement(S||"label",{...M,"data-testid":`label-${n}`});return c.jsx(c.Fragment,{children:y.createElement(C?"fieldset":"div",{className:W("field-wrapper text-small",i,`${u}-wrapper`,{"multiple-options-wrapper":C})},c.jsxs(c.Fragment,{children:[f.label===!1?c.jsx(c.Fragment,{}):y.createElement(C?y.Fragment:"p",B,c.jsxs(F,{...T,children:[z,b&&l&&c.jsxs(c.Fragment,{children:[" ",c.jsxs("small",{children:["(",t.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})),y.createElement(C||A?"div":"p",{className:"field-component"},c.jsxs(c.Fragment,{children:[c.jsx(x,{...L}),c.jsx(Oo,{id:_,limit:o,valueLength:g}),v]})),c.jsx(R,{})]}))})},Uv=(e,t)=>{const{type:n,payload:r}=t,i=e.errors?Ot(e.errors):{},a=e.values?Ot(e.values):{};switch(n){case"updateValue":if(r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:i,[r==null?void 0:r.key]:r==null?void 0:r.value};a[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:i,values:a};case"addError":return r!=null&&r.key&&!i[r==null?void 0:r.key]&&(i[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:i};case"removeError":return r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],{...e,errors:i};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:d}=r,m=Ot(Object.keys(i));for(const h of s)if(h.validation)for(let p=0;p<h.validation.length;p++){const{condition:v="required",error:f=!1}=h.validation[p];let b=!1;if(typeof v=="function"){const g=v(a);g&&(b=f||g)}else{const g=a[h.id],x=v;switch(x){case"required":Pr(x,g)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_required"})));break;case"no-numbers":{Pr(x,g)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{Pr(x,g)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_email"})));break}case"valid-url":{Pr(x,g)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(b){o({type:"addError",payload:{key:h.id,value:b}}),m.push(h.id);break}}return m.length===0?l(a):u(a,m),e}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let Va=null;const Jt=({element:e="form",fields:t,className:n="",id:r=t.length?`form__${t[0].id}`:"form",formRef:i,intlPath:a=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:l,children:u,gtm:d={context:"Form",event:"form-submit-click"},functions:m,...h})=>{const p=(t||[]).filter($=>$.type==="multiple-inputs").map($=>$.id),[v,f]=y.useState({fieldsToValidate:t,multipleInputs:p});y.useEffect(()=>{v.multipleInputs.length||f($=>({...$,fieldsToValidate:t,multipleInputs:p}))},[t.length]);const{customOnSubmit:b,hideButton:g,...x}=s,C=40,{shouldShowCancelButton:A=!1,shouldReset:E=!0,shouldHide:_=!0,showRequiredLabels:T=!0,showSuccessMessage:L=!1}=l||{},{onSuccess:O=async()=>{},onCancel:z=()=>{},onCatch:R=()=>{},onFailure:B=()=>{}}=m||{},F=ae.useIntl(),S={};t.length&&t.forEach($=>{const K=$.id||$.name;K&&(S[K]=$.value||"")});const[M,U]=y.useReducer(Uv,{isSubmitting:!1,formSubmitted:!1,errors:{},values:S}),{errors:V,isSubmitting:ie,formSubmitted:te,values:D}=M;y.useEffect(()=>{E&&te&&(Va=setTimeout(()=>{U({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[te]),y.useEffect(()=>()=>{Va&&clearTimeout(Va)},[]),y.useEffect(()=>{const $=K=>{U({type:"updateValue",payload:{key:K.detail.id,value:K.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",$),()=>{document.removeEventListener("dropdownMultiSelectSubmit",$)}},[]);const J=y.useRef(null),Y=i||J,k=Ur(()=>{if(!ie){if(U({type:"updateValue",payload:{key:"isSubmitting",value:!0}}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&U({type:"submitForm",payload:{fields:v.fieldsToValidate,dispatch:U,intl:F}});return}U({type:"submitForm",payload:{fields:v.fieldsToValidate,dispatch:U,onSuccess:async $=>{try{await O($),U({type:E?"formSubmittedAndReset":"formSubmitted"})}catch(K){R(K),U({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:($,K)=>{B($,K),U({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:F}})}},100);if(!t.length)return null;const j={};s.children&&(j.default=s.children),x.text&&typeof x.text=="string"&&(j.default=x.text),["default","submitting","submitted"].forEach($=>{x.text&&typeof x.text!="string"&&$ in x.text?j[$]=x.text[$]:j[$]||(j[$]=F.formatMessage({id:`form_${$==="default"?"submit":$}`}))}),delete x.text;const q=$=>{var ne;if($.preventDefault(),$.stopPropagation(),ie)return;let K=0;if((ne=Y==null?void 0:Y.current)!=null&&ne.id){const oe=document.getElementById(Y.current.id);oe&&(K=oe.getBoundingClientRect().top+window.scrollY)}const G=document.getElementById("header");G&&(K=K-G.offsetHeight-C),K<0&&(K=0),window.scrollTo({top:K,behavior:"smooth"}),k()},P=[{...x,icon:te?{icon:"tick",position:"left"}:!1,className:W("gtm-trackable",x.className),onClick:q,disabled:ie||te||s.disabled,"data-gtm-event-context":d.context,"data-gtm-event-type":d.event,children:j[ie?"submitting":te?"submitted":"default"]}];return A&&P.unshift({...o,className:W("gtm-trackable",o.className),"data-gtm-event-context":d.context,"data-gtm-event-type":d.event,disabled:ie||te,onClick:z,children:o.text||F.formatMessage({id:"form_cancel"})}),c.jsxs(c.Fragment,{children:[y.createElement(e,{...h,id:r,className:W("form",n),ref:Y},c.jsxs(c.Fragment,{children:[V!=null&&V.general?c.jsx(wn,{variant:"error",text:F.formatMessage({id:"form_error_generalError"})}):null,u,(!_||!ie&&!te||b)&&t.map(($,K)=>{const{id:G=$.name||K,component:ne,functions:oe={onChange:()=>{}},submitOnEnter:X=!1}=$;if(ne)return c.jsx(ne,{...$.props||{}},`component-${G}-${K}`);const ge=(D==null?void 0:D[G])||"",de={...oe,onChange:be=>{U({type:"updateValue",payload:{key:G,value:be}}),oe.onChange(be,U)}};return X&&(de.onKeyDown=be=>{be.key==="Enter"&&(be.stopPropagation(),be.preventDefault(),k()),oe.onKeyDown&&oe.onKeyDown(be)}),c.jsx(Ff,{intlPath:a,...$,showRequiredLabels:T,value:ge,error:$.type==="multiple-inputs"?V:V==null?void 0:V[G],functions:de,fieldData:{fields:v.fieldsToValidate,multipleInputs:v.multipleInputs,setFields:f,dispatch:U}},G)}),g?null:(ie||te)&&b?b:c.jsx(gr,{className:W("cta",{center:ie||te,submitted:te}),buttons:P})]})),L&&te&&c.jsx(ur,{className:"success",children:typeof L=="string"?L:F.formatMessage({id:"form_success"})})]})};const bi="passwordRules_",Af="isMoreThanEightCharacters",Bf="includesNumberAndSymbol",Tf="includesLowerAndUppercase",Vv={[Af]:"8Characters",[Bf]:"numberSymbol",[Tf]:"lowercaseUppercase"},Wv=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ae.useIntl();return c.jsxs("aside",{className:W("password-rules",t),children:[c.jsx("small",{children:n.formatMessage({id:`${bi}intro`})}),c.jsx("ul",{children:[Af,Bf,Tf].map(r=>c.jsxs("li",{className:W({matches:e[r]}),children:[c.jsxs(Me,{children:[n.formatMessage({id:`${bi}rule_label`})," "]}),c.jsx("span",{children:n.formatMessage({id:`${bi}rule_${Vv[r]}`})}),!e[r]&&c.jsxs(Me,{element:"strong",children:[" ",n.formatMessage({id:`${bi}notMet`})]})]},`rule-${r}`))})]})},Sf=y.memo(Wv);const Hv=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:i=()=>{}},className:a="",hasLoaded:s=!1})=>{const o=ae.useIntl(),[l,u]=y.useState({setUp:!1,id:null,rating:null,disabled:!0}),d=async()=>{try{const g=await n();u(x=>({...x,setUp:!0,id:g&&g.id,disabled:!1}))}catch(g){u(x=>({...x,setUp:!0,disabled:!0})),i(g)}};if(y.useEffect(()=>{s&&!l.setUp&&d()},[s]),!s)return c.jsx(It,{className:"rating-placeholder"});const{id:m,rating:h,disabled:p}=l,v="ratings_",f={text:o.formatMessage({id:`${v}text`}),low:o.formatMessage({id:`${v}low`}),high:o.formatMessage({id:`${v}high`}),success:o.formatMessage({id:`${v}success`}),...e},b=async g=>{if(!(!m||p))try{u(x=>({...x,rating:g,disabled:!0})),await r({id:m,value:g})}catch(x){u(C=>({...C,rating:null})),i(x)}finally{u(x=>({...x,disabled:!1}))}};return c.jsxs("div",{className:W("rating",a),children:[c.jsx("span",{className:"label",children:f[h?"success":"text"]}),c.jsx("ol",{children:Array.from(new Array(t).keys()).map(g=>{const x=g+1;return c.jsx("li",{className:W({selected:h&&x<=h}),children:c.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:`star${!h||x>h?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${v}stars`},{number:x,total:t})}${x===1||x===t?` - ${f[x===1?"low":"high"]}`:""}`,onClick:C=>{C.preventDefault(),C.stopPropagation(),b(x)},disabled:p})},`rating-${x}`)})})]})},Kv={id:"",tabbableOption:"",setFocus:()=>{},openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,isInOverlay:!1,dispatch:()=>{},enrichedUrl:void 0,onMention:()=>{},getLinkPreview:()=>Promise.resolve({}),reportError:e=>{console.error(e)}},ln=y.createContext(Kv);var H=(e=>(e.blockquote="block_quote",e.bold="bold",e.code="code",e.codeblock="code_block",e.heading="heading",e.hr="thematic_break",e.image="image",e.italic="italic",e.li="list_item",e.link="link",e.mention="mention",e.ol="ol_list",e.paragraph="paragraph",e.ul="ul_list",e.strikethrough="strikeThrough",e.span="span",e.h3="heading_three",e))(H||{}),Kt=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(Kt||{});const Zv=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case H.blockquote:return c.jsx("blockquote",{className:"subtle",...e,children:t});case H.link:return c.jsx("a",{...e,children:t});case H.li:return c.jsx("li",{...e,children:t});case H.mention:const i=r;return i!=null&&i.name&&i.name===Vr?c.jsxs("span",{...e,className:"mention deleted-user",children:["@",c.jsx(ae.FormattedMessage,{id:"member_deleted"}),t]}):c.jsxs("a",{...e,className:"mention",children:["@",(i==null?void 0:i.name)||"",t]});case H.ol:return c.jsx("ol",{...e,children:t});case H.ul:return c.jsx("ul",{...e,children:t});case H.span:return c.jsx("span",{...e,children:t});case H.paragraph:return c.jsx("p",{...e,children:t});default:return c.jsx("span",{...e,children:t})}},Yv=({attributes:e,children:t,leaf:n})=>{const r=n;return r[H.bold]&&(t=c.jsx("strong",{children:t})),r[H.italic]&&(t=c.jsx("em",{children:t})),r[H.strikethrough]&&(t=c.jsx("s",{children:t})),r[H.h3]&&(t=c.jsx("h3",{children:t})),c.jsx("span",{...e,children:t})};var Gv=Xv,jf="֑-߿יִ-﷽ﹰ-ﻼ",Pf="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Qv=new RegExp("^[^"+Pf+"]*["+jf+"]"),Jv=new RegExp("^[^"+jf+"]*["+Pf+"]");function Xv(e){return e=String(e||""),Qv.test(e)?"rtl":Jv.test(e)?"ltr":"neutral"}const Of=In(Gv);function eb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var No=eb,tb=typeof li=="object"&&li&&li.Object===Object&&li,nb=tb,rb=nb,ib=typeof self=="object"&&self&&self.Object===Object&&self,ab=rb||ib||Function("return this")(),Mf=ab,sb=Mf,ob=function(){return sb.Date.now()},ub=ob,lb=/\s/;function cb(e){for(var t=e.length;t--&&lb.test(e.charAt(t)););return t}var db=cb,fb=db,mb=/^\s+/;function hb(e){return e&&e.slice(0,fb(e)+1).replace(mb,"")}var pb=hb,gb=Mf,vb=gb.Symbol,Nf=vb,nl=Nf,If=Object.prototype,bb=If.hasOwnProperty,yb=If.toString,Ar=nl?nl.toStringTag:void 0;function xb(e){var t=bb.call(e,Ar),n=e[Ar];try{e[Ar]=void 0;var r=!0}catch{}var i=yb.call(e);return r&&(t?e[Ar]=n:delete e[Ar]),i}var wb=xb,Cb=Object.prototype,Db=Cb.toString;function Eb(e){return Db.call(e)}var _b=Eb,rl=Nf,kb=wb,Fb=_b,Ab="[object Null]",Bb="[object Undefined]",il=rl?rl.toStringTag:void 0;function Tb(e){return e==null?e===void 0?Bb:Ab:il&&il in Object(e)?kb(e):Fb(e)}var Sb=Tb;function jb(e){return e!=null&&typeof e=="object"}var Pb=jb,Ob=Sb,Mb=Pb,Nb="[object Symbol]";function Ib(e){return typeof e=="symbol"||Mb(e)&&Ob(e)==Nb}var Rb=Ib,$b=pb,al=No,Lb=Rb,sl=0/0,zb=/^[-+]0x[0-9a-f]+$/i,qb=/^0b[01]+$/i,Ub=/^0o[0-7]+$/i,Vb=parseInt;function Wb(e){if(typeof e=="number")return e;if(Lb(e))return sl;if(al(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=al(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$b(e);var n=qb.test(e);return n||Ub.test(e)?Vb(e.slice(2),n?2:8):zb.test(e)?sl:+e}var Hb=Wb,Kb=No,Wa=ub,ol=Hb,Zb="Expected a function",Yb=Math.max,Gb=Math.min;function Qb(e,t,n){var r,i,a,s,o,l,u=0,d=!1,m=!1,h=!0;if(typeof e!="function")throw new TypeError(Zb);t=ol(t)||0,Kb(n)&&(d=!!n.leading,m="maxWait"in n,a=m?Yb(ol(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(_){var T=r,L=i;return r=i=void 0,u=_,s=e.apply(L,T),s}function v(_){return u=_,o=setTimeout(g,t),d?p(_):s}function f(_){var T=_-l,L=_-u,O=t-T;return m?Gb(O,a-L):O}function b(_){var T=_-l,L=_-u;return l===void 0||T>=t||T<0||m&&L>=a}function g(){var _=Wa();if(b(_))return x(_);o=setTimeout(g,f(_))}function x(_){return o=void 0,h&&r?p(_):(r=i=void 0,s)}function C(){o!==void 0&&clearTimeout(o),u=0,r=l=i=o=void 0}function A(){return o===void 0?s:x(Wa())}function E(){var _=Wa(),T=b(_);if(r=arguments,i=this,l=_,T){if(o===void 0)return v(l);if(m)return clearTimeout(o),o=setTimeout(g,t),p(l)}return o===void 0&&(o=setTimeout(g,t)),s}return E.cancel=C,E.flush=A,E}var Rf=Qb;const Jb=In(Rf);var Xb=Rf,e0=No,t0="Expected a function";function n0(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(t0);return e0(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Xb(e,t,{leading:r,maxWait:t,trailing:i})}var r0=n0;const i0=In(r0),ul=e=>typeof e=="object"&&e!=null&&e.nodeType===1,ll=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Ha=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return ll(n.overflowY,t)||ll(n.overflowX,t)||(r=>{const i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},yi=(e,t,n,r,i,a,s,o)=>a<e&&s>t||a>e&&s<t?0:a<=e&&o<=n||s>=t&&o>=n?a-e-r:s>t&&o<n||a<e&&o>n?s-t+i:0,a0=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},cl=(e,t)=>{var n,r,i,a;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:d}=t,m=typeof u=="function"?u:U=>U!==u;if(!ul(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,p=[];let v=e;for(;ul(v)&&m(v);){if(v=a0(v),v===h){p.push(v);break}v!=null&&v===document.body&&Ha(v)&&!Ha(document.documentElement)||v!=null&&Ha(v,d)&&p.push(v)}const f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,b=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:g,scrollY:x}=window,{height:C,width:A,top:E,right:_,bottom:T,left:L}=e.getBoundingClientRect(),{top:O,right:z,bottom:R,left:B}=(U=>{const V=window.getComputedStyle(U);return{top:parseFloat(V.scrollMarginTop)||0,right:parseFloat(V.scrollMarginRight)||0,bottom:parseFloat(V.scrollMarginBottom)||0,left:parseFloat(V.scrollMarginLeft)||0}})(e);let F=o==="start"||o==="nearest"?E-O:o==="end"?T+R:E+C/2-O+R,S=l==="center"?L+A/2-B+z:l==="end"?_+z:L-B;const M=[];for(let U=0;U<p.length;U++){const V=p[U],{height:ie,width:te,top:D,right:J,bottom:Y,left:k}=V.getBoundingClientRect();if(s==="if-needed"&&E>=0&&L>=0&&T<=b&&_<=f&&E>=D&&T<=Y&&L>=k&&_<=J)return M;const j=getComputedStyle(V),q=parseInt(j.borderLeftWidth,10),P=parseInt(j.borderTopWidth,10),$=parseInt(j.borderRightWidth,10),K=parseInt(j.borderBottomWidth,10);let G=0,ne=0;const oe="offsetWidth"in V?V.offsetWidth-V.clientWidth-q-$:0,X="offsetHeight"in V?V.offsetHeight-V.clientHeight-P-K:0,ge="offsetWidth"in V?V.offsetWidth===0?0:te/V.offsetWidth:0,de="offsetHeight"in V?V.offsetHeight===0?0:ie/V.offsetHeight:0;if(h===V)G=o==="start"?F:o==="end"?F-b:o==="nearest"?yi(x,x+b,b,P,K,x+F,x+F+C,C):F-b/2,ne=l==="start"?S:l==="center"?S-f/2:l==="end"?S-f:yi(g,g+f,f,q,$,g+S,g+S+A,A),G=Math.max(0,G+x),ne=Math.max(0,ne+g);else{G=o==="start"?F-D-P:o==="end"?F-Y+K+X:o==="nearest"?yi(D,Y,ie,P,K+X,F,F+C,C):F-(D+ie/2)+X/2,ne=l==="start"?S-k-q:l==="center"?S-(k+te/2)+oe/2:l==="end"?S-J+$+oe:yi(k,J,te,q,$+oe,S,S+A,A);const{scrollLeft:be,scrollTop:Te}=V;G=de===0?0:Math.max(0,Math.min(Te+G/de,V.scrollHeight-ie/de+X)),ne=ge===0?0:Math.max(0,Math.min(be+ne/ge,V.scrollWidth-te/ge+oe)),F+=Te-G,S+=be-ne}M.push({el:V,top:G,left:ne})}return M},s0=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function o0(e,t){if(!e.isConnected||!(i=>{let a=i;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(e))return;const n=(i=>{const a=window.getComputedStyle(i);return{top:parseFloat(a.scrollMarginTop)||0,right:parseFloat(a.scrollMarginRight)||0,bottom:parseFloat(a.scrollMarginBottom)||0,left:parseFloat(a.scrollMarginLeft)||0}})(e);if((i=>typeof i=="object"&&typeof i.behavior=="function")(t))return t.behavior(cl(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:i,top:a,left:s}of cl(e,s0(t))){const o=a-n.top+n.bottom,l=s-n.left+n.right;i.scroll({top:o,left:l,behavior:r})}}/*!
66
+ ${Fr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:Fr(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const Pv="shareLinks_",Ov=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:a="default",className:s=""})=>{const o=ae.useIntl(),l=jv({title:e,link:t,referrer:n});return c.jsxs("aside",{className:W("share-links",i,a,s),children:[c.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),c.jsx("ul",{children:l.map(({key:u,icon:d,url:m,shouldRender:h=!0,onClick:p})=>{if(typeof h=="function"&&!h())return null;const v={};return p&&(v.onClick=f=>p(f,m)),c.jsx("li",{children:c.jsx(Fe,{size:i,variant:"tertiary",icon:{icon:d||u},href:m,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${Pv}link_${u}`}),...v})},u)})})]})};const Mv=({tabs:e,className:t="",preventLocationChange:n})=>{var v;const r=(f,b,g)=>(f||(f=`panel-${window.btoa(b)}-${g}`),f),i=Rn(!0)||0;let a=e.findIndex(f=>f.current===!0);if(a<0&&(a=0),window.location.hash){const f=window.location.hash.replace("#","");if(e.find(g=>g.id===f)){for(let g=0;g<e.length;g++)if(r(e[g].id,e[g].text,g)===f){a=g;break}}}const[s,o]=y.useState((v=e[a])!=null&&v.id?e[a].id:r(e[a].id,e[a].text,a)),[l,u]=y.useState(""),d=(f,b)=>{switch(f.key){case"ArrowLeft":case"ArrowRight":{f.preventDefault();let g=b;f.key==="ArrowLeft"?b>0?g=b-1:g=e.length-1:f.key==="ArrowRight"&&(b<e.length-1?g=b+1:g=0);const x=r(e[g].id,e[g].text,g),C=document.getElementById(`tab-${x}`);C==null||C.focus(),u(x);break}case"Enter":o(l),window.location.hash=`#${l}`;break}},m=f=>{let b=!1;return f.target==="min-width"&&i>=f.value&&(b=!0),f.target==="max-width"&&i<=f.value&&(b=!0),b};y.useEffect(()=>{if(e[a].hasCarousel){const f=new CustomEvent("hiddenSectionVisible",{detail:{id:s}});window.dispatchEvent(f)}},[s]);const h=[],p=[];return e.forEach(({id:f,text:b,content:g,href:x,hasCarousel:C,breakpoint:A},E)=>{if(A&&!m(A))return;f=r(f,b,E);const _=s===f,T={};x||(T["aria-controls"]=f,T.onClick=L=>{L.preventDefault(),L.stopPropagation(),o(f),!n&&(window.location.hash=`#${f}`)},p.push(c.jsx("section",{id:f,hidden:!_,role:"tabpanel","aria-labelledby":`tab-${f}`,"aria-live":_?"assertive":"off",children:typeof g=="string"?c.jsx("p",{children:g}):g},`section-${f}`))),h.push(c.jsx("li",{"data-testid":"navigation-tab",children:c.jsx("a",{href:x||`#${f}`,id:`tab-${f}`,"aria-controls":f,className:W({selected:_}),role:"tab",tabIndex:_?0:-1,"aria-selected":_,onKeyDown:L=>d(L,E),...T,children:b})},`tab-${f}`))}),c.jsxs("div",{className:W("tabs-wrapper",t),children:[c.jsx("ul",{className:"tabs",role:"tablist",children:h}),c.jsx("div",{className:"tab-content",children:p})]})};const Nv={"2-1":901,"1-3":769,"1-1":769},Ef=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:i})=>{const a=Rn(!0);let s=i;return y.Children.count(i)===1&&(s=y.Children.toArray(i)[0],s.props&&(s=s.props.children)),c.jsx("section",{className:W("columns",`layout-${e}`,r,{"has-containers":n}),children:y.Children.map(s,(o,l)=>t!==!1&&l===t&&a&&a<Nv[e]?null:o)})};const Oo=({id:e="character-limit",limit:t,valueLength:n,...r})=>{const i=ae.useIntl(),a="form_fieldWrapper_characterLimit";if(t===0)return null;const s=t-n,o=Math.abs(n-t),l=n>=.99*t,u=n>=.9*t&&n<.99*t,d=n>t;return c.jsxs(c.Fragment,{children:[c.jsx("small",{id:e,className:W("character-limit",{"near-limit":l,"approaching-limit":u}),"aria-live":"polite","aria-label":d?"":i.formatMessage({id:`${a}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}),children:d?i.formatMessage({id:`${a}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"hidden",children:i.formatMessage({id:a})}),n," / ",t]})}),c.jsx(Me,{showOnFocus:!1,id:`${e}-info`,children:i.formatMessage({id:`${a}_info`},{limit:t})})]})},pa=e=>(e==null?void 0:e.toString().length)||0,_f=(e,t)=>{const n={};return e===0||(n["data-character-limit"]=e,n.functions={...t,onChange:r=>{pa(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t.onChange(r)}}),n};const vi="emailHelperTextBox_",kf=({id:e="email-helper-textbox",type:t,email:n,redirectPath:r,resendVerificationCode:i})=>{const a=ae.useIntl(),[s,o]=y.useState({path:`${vi}default`,type:"default",link:{},mail:{},error:""}),[l,u]=y.useState(!1),d=y.useCallback(v=>{v.preventDefault(),v.stopPropagation();const f=b=>{o({path:`${vi}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:g=>d(g),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:b})};if(typeof i!="function"){f(a.formatMessage({id:`${vi}error_noFunction`}));return}u(!0),i(n).then(()=>{localStorage.setItem("email",n),window.location.href=r||"/signup/verify-email"}).catch(b=>{f(b.message)}).finally(()=>{u(!1)})},[n,r,i]);y.useEffect(()=>{let v=vi,f="default",b={},g={};switch(t){case"gov":v+="autoApproved",f="success";break;case"nonGov":v+="unrecognisedEmail",f="error",b={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":v+="pendingApproval",f="error",g={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":v+="emailUnverified",f="error",b={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:x=>d(x),"data-testid":"send-verify-email-click"};break;case"exists":v+="emailAlreadyExists",f="error",b={href:"/api/next-ui/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},g={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:v+="default",b={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}o({...s,path:v,type:f,link:b,mail:g})},[t]);const m={};return["link","mail"].forEach(v=>{m[v]=Object.keys(s[v]).length?f=>c.jsx("a",{...s[v],children:f}):f=>f}),c.jsx(Td,{id:e,type:s.type,heading:l?!1:a.formatMessage({id:`${s.path}_title`}),"aria-live":"assertive",children:l?c.jsxs(c.Fragment,{children:[c.jsx(It,{element:"span"}),c.jsx(It,{element:"span"})]}):a.formatMessage({id:`${s.path}_text`},{...m,strong:v=>c.jsx("strong",{children:v}),em:v=>c.jsx("em",{children:v}),br:c.jsxs(c.Fragment,{children:[c.jsx("br",{}),c.jsx("br",{})]}),error:s.error})})},Jn=({className:e="",element:t="input",id:n,inputRef:r,functions:i={onChange:()=>{}},name:a=n,placeholder:s,type:o="text",value:l,autoFocus:u,label:d,styling:m={},...h})=>{const p=y.useRef(),v=r||p,{autosizeToFit:f=!1}=m;return fd(f&&t==="textarea",v),y.useEffect(()=>{var b;u&&((b=v.current)==null||b.focus())},[]),!(h!=null&&h.autoComplete)&&["email"].includes(o)&&(h.autoComplete="email"),y.createElement(t,{ref:v,...h,id:n,name:a,className:W(e,t,{autoresize:f}),value:l,placeholder:s,autoFocus:u,...i,onChange:b=>{const g=b.target;i.onChange(g.value)}})};const Wn={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},Iv=500,Rv=({id:e,name:t=e,value:n,placeholder:r,functions:i={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...a})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=i,[{input:l,displayInput:u,debouncedInput:d},m]=y.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:h,activePredictionIndex:p,isPredictionSelected:v},f]=y.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:b}=ae.useIntl();r||(r=b({id:"inputAutocomplete_placeholder"})),y.useEffect(()=>{const A=setTimeout(()=>{v||m(E=>({...E,debouncedInput:l}))},Iv);return()=>{clearTimeout(A)}},[l,v]),y.useEffect(()=>{d&&!v?(async()=>{try{const E=await o(d)||[];f(_=>({..._,predictions:E}))}catch(E){console.error("Error fetching predictions:",E),f(_=>({..._,predictions:[]}))}})():f(A=>({...A,predictions:[]}))},[d,v]),y.useEffect(()=>{p>=0&&h[p]&&m(A=>({...A,displayInput:h[p].description}))},[p,h]);const g=A=>{[Wn.DOWN,Wn.UP,Wn.ENTER].includes(A.key)&&(A.preventDefault(),A.key===Wn.DOWN&&p<h.length-1?f(E=>({...E,activePredictionIndex:p+1})):A.key===Wn.UP&&p>0?f(E=>({...E,activePredictionIndex:p-1})):A.key===Wn.ENTER&&p>-1&&(s(h[p].description),m(E=>({...E,input:h[p].description})),f(E=>({...E,predictions:[],isPredictionSelected:!0}))))},x=A=>{s(A.target.value),m(E=>({...E,input:A.target.value,displayInput:A.target.value})),f(E=>({...E,activePredictionIndex:-1,isPredictionSelected:!1}))},C=A=>{s(A.description),m(E=>({...E,input:A.description,displayInput:A.description})),f(E=>({...E,isPredictionSelected:!0,predictions:[]}))};return c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:u,onChange:x,onKeyDown:g,placeholder:r,name:t,id:e,...a}),c.jsx("ul",{className:"predictions-list",children:h.map((A,E)=>c.jsx("li",{onClick:()=>C(A),onMouseEnter:()=>f(_=>({..._,activePredictionIndex:E})),className:W("predictions-list-item",{active:E===p}),children:A.description},E))})]})};const Mo=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:i,inputRef:a,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:d,accessibilityOptions:{checkboxes:{navigateWithArrowKeys:m=!1}={}}={},...h})=>{const p=ae.useIntl(),{onChange:v,...f}=r,b=()=>{t||v(d?null:l)},g=c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:a,id:i,name:i,type:u,value:l,checked:d,readOnly:!0,disabled:t,tabIndex:-1}),c.jsx("span",{className:W("pretty-checkbox",{radio:u==="radio"}),"data-testid":"pretty-checkbox"}),c.jsx("label",{htmlFor:i,onKeyDown:x=>{(x.key==="Enter"||x.code==="Space")&&(x.preventDefault(),x.stopPropagation(),b())},tabIndex:d||!m?0:-1,children:o||p.formatMessage({id:s?`${s}_${i}`:i})})]});return y.createElement(n,{onClick:x=>{const C=x.target;C.nodeName.toLowerCase()==="a"||C.parentNode&&C.parentNode.nodeName.toLowerCase()==="a"||(x.preventDefault(),x.stopPropagation(),b())},onKeyDown:m?x=>{var C,A,E;if(x.key!=="Tab")switch(x.code){case"Enter":case"Space":x.stopPropagation(),x.preventDefault(),b();break;case"ArrowLeft":case"ArrowRight":x.stopPropagation(),x.preventDefault();const _=x.currentTarget;let T=_==null?void 0:_.nextElementSibling;if(x.key==="ArrowLeft"){const L=_==null?void 0:_.previousElementSibling;L?T=L:T=(C=_==null?void 0:_.parentElement)==null?void 0:C.lastElementChild}else T||(T=(A=_==null?void 0:_.parentElement)==null?void 0:A.firstElementChild);T&&((E=T==null?void 0:T.querySelector("label"))==null||E.focus());break}}:void 0,className:W(i,"checkbox-wrapper",e,{"is-checked":d}),...h,...f},g)};const $v=y.memo(function({direction:t="down"}){return c.jsx(la,{className:W("rotating-chevron",`direction-${t}`)})});const Lv=({className:e,options:t,initialValue:n,value:r,functions:i={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:a}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const d=ae.useIntl(),[m,h]=y.useState(!1),p=r||n,v=Array.isArray(p)?[...p]:p?[p]:[],[f,b]=y.useState(v);let g;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?g=t&&f?t.find(T=>T.id===f[0]):t?t[0]:{id:"",label:""}:Array.isArray(f)&&f.length===1&&typeof f[0]!="string"?g=f[0]:g={id:"",label:""},y.useEffect(()=>{b(v)},[r,n]);const{onChange:x,onMultiSelectSubmit:C,...A}=i,E=T=>{if(o){let L=[];f!=null&&f.includes(T.id)?L=f.filter(O=>O!==T.id):L=[...f,T.id],b([...L]),x&&x([...L])}else b([T]),x&&x(T.id),h(!1)},_=T=>{if(T==="all"){const L=(t==null?void 0:t.map(O=>O.id))||[];b(L),x&&x(L)}else b([]),x&&x([])};return c.jsxs("div",{className:W("dropdown-wrapper",e),children:[c.jsxs("button",{className:"input","aria-expanded":m,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:T=>{T.preventDefault(),T.stopPropagation(),h(!m)},"data-testid":"dropdown-selector",...A,children:[o?`${s} · ${f.length}`:g.label,c.jsx($v,{direction:m?"up":"down"})]}),c.jsx("select",{defaultValue:g.id,onChange:T=>{T.preventDefault(),T.stopPropagation();const L=t&&t.find(O=>O.id===T.target.value);E(L)},hidden:!m,...A,children:t==null?void 0:t.map(T=>c.jsx("option",{value:T.id,className:"gtm-trackable","data-gtm-event-type":`${T.id}-click`,"data-gtm-event-context":a,children:T.label},T.id))}),c.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!m,children:[c.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&c.jsxs("div",{className:"action-bar",children:[c.jsx("p",{children:`${f==null?void 0:f.length} selected`}),c.jsxs("ul",{children:[c.jsx("li",{children:c.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>_("all"),className:"gtm-trackable","data-gtm-event-type":"all-click","data-gtm-event-context":a,children:d.formatMessage({id:"dropdown_menu_multiselect_all"})})}),c.jsx("li",{children:c.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>_("none"),className:"gtm-trackable","data-gtm-event-type":"none-click","data-gtm-event-context":a,children:d.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),c.jsx("ul",{children:t==null?void 0:t.map(T=>{const L=T.id===g.id||(f==null?void 0:f.includes(T))||(f==null?void 0:f.includes(T.id));return c.jsx("li",{"data-testid":"dropdown-options",children:c.jsxs("button",{className:W("gtm-trackable",{selected:L,"selected-single":L&&!o}),"data-gtm-event-type":`${T.id}-click`,"data-gtm-event-context":a,onClick:O=>{O.preventDefault(),O.stopPropagation(),E(T)},role:"menuitem","aria-current":L,"data-testid":L?"current-selection":"",children:[o&&c.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),c.jsx("span",{className:W({"menu-option-label":o}),children:T.label})]})},T.id)})})]}),(l==null?void 0:l.submitSection)&&c.jsx("p",{className:"submit",children:c.jsx(Fe,{variant:"secondary",onClick:()=>{C&&C(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),h(!1)},children:d.formatMessage({id:"form_submit"})})})]})]})},Pr=(e,t)=>{switch(e){case"required":if(!t||typeof t=="string"&&t.trim().length===0)return!0;break;case"no-numbers":if(t&&!/^([^0-9]*)$/.test(t))return!0;break;case"valid-email":if(t&&!/^(([^<>()[\]\\.,;:\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,}))$/.test(t))return!0;break;case"valid-url":if(t&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/i.test(t))return!0;break;default:return!1}return!1};let Ua=null;const zv=({id:e,label:t,limit:n,value:r,placeholder:i,functions:a,error:s,multipleInputs:o,validation:l,fieldData:u,type:d,...m})=>{const h=ae.useIntl(),{showCount:p=!1,label:v,defaultInputs:f=1,maxInputs:b=100,hasButton:g=!1,allowDuplicateValues:x=!1}=o||{},[C,A]=y.useState(r?Array.isArray(r)?r:[r]:Array(f).fill("")),E=C.filter(z=>z!==""),_=()=>{if(!u)return;const z=Ot(u.fields).filter(({id:F,name:S})=>(F||(F=S||""),F!==e&&!F.includes(`${e}-`))),R=[];C.map((F,S)=>{if(b&&S>=b)return;const M=Ot(l??[]);e&&(x||M.push({condition:U=>{var D;const V=U[e].toLowerCase(),ie=((D=U[`${e}-all`])==null?void 0:D.length)??0,te=new Set(U[`${e}-all`].map(J=>J.toLowerCase()));return te.has(V)&&te.size<ie},error:h==null?void 0:h.formatMessage({id:"form_error_multipleInputs_same"})}),M.forEach(U=>{const{condition:V,error:ie}=U;if(typeof V=="function")U.condition=te=>{var Y;let D=(Y=te==null?void 0:te[e])==null?void 0:Y[S];D||(te[e]&&!Array.isArray(te[e])?D=te[e]:D="");const J=Ot(te);return J[e]=D,J[`${e}-all`]=te[e],typeof V=="function"&&V(J)?ie:!1};else{const te=V;U.condition=D=>{var Y;let J=(Y=D==null?void 0:D[e])==null?void 0:Y[S];switch(J||(D[e]&&!Array.isArray(D[e])?J=D[e]:J=""),te){case"required":ie||(U.error=h==null?void 0:h.formatMessage({id:"form_error_required"}));break;case"no-numbers":ie||(U.error=h==null?void 0:h.formatMessage({id:"form_error_numbers"}));break;case"valid-email":ie||(U.error=ie||(h==null?void 0:h.formatMessage({id:"form_error_email"})));break;case"valid-url":ie||(U.error=h==null?void 0:h.formatMessage({id:"form_error_url"}));break;default:console.warn("WARNING! No field validation condition has been set")}return Pr(te,J)?U.error:!1}}}),R.push({id:`${e}-${S}`,validation:M,value:F}))});const B={fieldsToValidate:z.concat(R)};u.multipleInputs.includes(e)&&(B.multipleInputs=u.multipleInputs.filter(F=>F!==e)),u.setFields(F=>({...F,...B}))};y.useEffect(()=>{_()},[C.length]),y.useEffect(()=>{!u||!u.multipleInputs||u.multipleInputs.includes(e)&&_()},[u==null?void 0:u.multipleInputs]);const T=()=>{(!b||C.length<b)&&A([...C,""])},L=z=>{const R=document.getElementById(`${e}-${z+1}`);R==null||R.focus()},O=(z,R)=>z.replace("{number}",R+1);return c.jsxs("fieldset",{className:W("multiple-inputs field-wrapper",{"has-button":g,"has-legend":t}),children:[t?c.jsxs("legend",{className:"legend-as-label text-small",children:[t,p?c.jsxs(c.Fragment,{children:[" ",c.jsx("small",{className:"filled-in-count","aria-label":h.formatMessage({id:"form_multipleInputs_filledInCount_aria"},{number:E.length,total:b}),children:h.formatMessage({id:"form_multipleInputs_filledInCount"},{number:E.length,total:b})})]}):""]}):c.jsx(c.Fragment,{}),C.map((z,R)=>{if(b&&R>=b)return c.jsx(c.Fragment,{});let B=!1;t?B=c.jsx(Me,{showOnFocus:!1,children:h.formatMessage({id:"form_multipleInputs_label"},{number:R+1})}):v&&(B=O(v,R));const F=`${e}-${R}`,S=R+1>f;return c.jsx(Ff,{id:F,type:"text",label:B,value:z,placeholder:i?O(i,R):void 0,className:W({"has-remove-button":S}),limit:n,error:s&&typeof s!="string"?s==null?void 0:s[F]:void 0,functions:{...a,onFocus:()=>{g||R!==C.length-1||T()},onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),M.stopPropagation(),Ua&&clearTimeout(Ua),R!==C.length-1?L(R):(T(),Ua=setTimeout(()=>L(R),100)))},onChange:M=>{const U=C[R].toLowerCase(),V=Ot(C);V[R]=M,A(V),u==null||u.dispatch({type:"removeError",payload:{key:F}}),x||V.forEach((ie,te)=>{Hr(ie)&&te!==R&&ie.toLowerCase()===U&&(u==null||u.dispatch({type:"removeError",payload:{key:`${e}-${te}`}}))}),a==null||a.onChange(V)}},siblings:S?c.jsx(Fe,{variant:"tertiary",size:"small",icon:"close",screenreaderText:h.formatMessage({id:"form_multipleInputs_remove"}),onClick:()=>{const M=Ot(C);M.splice(R,1),A(M),u==null||u.dispatch({type:"removeError",payload:{key:F}}),a==null||a.onChange(M)}}):void 0,...m},F)}),g?c.jsx(Fe,{...g,onClick:T,disabled:!!(b&&b<=C.length)}):c.jsx(c.Fragment,{})]})};const tl=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:i,multiSelect:a=!1,name:s,options:o,required:l,type:u="checkboxes",value:d,accessibilityOptions:m,styling:{displayOptionsAsPills:h=!1}={},...p})=>{const v=ae.useIntl(),f=a?d:[],b=d;return c.jsx("ul",{...p,className:W("options-wrapper",e,{"with-pills filters":h}),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:g,label:x=!1,value:C=g,disabled:A=!1})=>{const E=`${r}_${g}`,_=()=>{if(A)return;let T;if(a){const L=f==null?void 0:f.indexOf(C);Array.isArray(f)&&L>=0?(T=f,T.splice(L,1)):(!f||f.length===0?T=[]:T=f,T.push(C))}else T=b===C?void 0:C;t.onChange(T)};return c.jsx(Mo,{element:"li",id:E,type:u==="checkboxes"?"checkbox":"radio",shownValue:C,value:a?f==null?void 0:f.includes(C):b===C,functions:{...t,onChange:_},intlPath:n,label:x||v.formatMessage({id:n?`${n}_${g}`:g}),disabled:A,accessibilityOptions:m},E)})})};const qv=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},autoComplete:r="on",...i})=>{const a=ae.useIntl(),s=y.useRef(),o=e||s,[l,u]=y.useState(!1),[d,m]=y.useState(t),h=()=>{var p;u(!l),m(l?"password":"text"),(p=o.current)==null||p.focus()};return c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:W("show-password gtm-trackable",{"password-visible":l}),"data-gtm-event-context":n,"data-gtm-event-type":`${l?"hide":"show"}-password-click`,onClick:h,"aria-label":a.formatMessage({id:`showpassword_aria_${l?"hide":"show"}`}),children:a.formatMessage({id:`showpassword_${l?"hide":"show"}`})}),c.jsx(Jn,{inputRef:o,type:d,autoComplete:r,...i})]})};const Hn={text:{component:Jn},email:{component:Jn},url:{component:Jn},textarea:{component:Jn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Mo},checkboxes:{component:tl,props:{multiSelect:!0}},radio:{component:tl,props:{multiSelect:!1}},select:{component:Lv},password:{component:qv},autocomplete:{component:Rv},"multiple-inputs":{component:c.jsx(c.Fragment,{})}},Ff=e=>{const t=ae.useIntl(),{id:n,intlPath:r=!1,className:i="",error:a,functions:s={onChange:()=>{}},limit:o=0,showRequiredLabels:l=!0,type:u,validation:d,value:m,submitOnEnter:h,fieldData:p,siblings:v,...f}=e;if(u&&u==="multiple-inputs")return c.jsx(zv,{...e});const b=d&&d.some(({condition:S})=>S==="required"),g=pa(m),x=u&&Hn[u]&&Hn[u].component?Hn[u].component:Jn,C=u&&["checkboxes","radio"].includes(u),A=u&&["autocomplete"].includes(u),E=a&&`error-${n}`,_=`character-limit-${n}`,T={};C?T.element="legend":T.htmlFor=n;let L={...f,id:n,name:n,className:a?"error":"",type:u,required:b,"aria-required":b,functions:Ot(s),value:m};const O=S=>{L["aria-describedby"]?L["aria-describedby"]+=` ${S}`:L["aria-describedby"]=S};if(o>0){const S=_f(o,s);O(`${_}-info`),L={...L,...S},S.functions&&typeof S.functions=="object"&&(L.functions={...L.functions,...S.functions})}u&&Hn[u]&&Hn[u].props&&(L={...L,...Hn[u].props}),C&&(L.intlPath=`${r}_${n}`),a&&(L["aria-invalid"]=!0,L["aria-errormessage"]=E,O(E));const z=f.label||t.formatMessage({id:r?`${r}_${n}`:n}),R=({...S})=>a?y.createElement(S.as||"p",{id:E,className:"error text-small",...S},a):null;if(u&&["checkbox"].includes(u))return c.jsxs(c.Fragment,{children:[c.jsx(x,{...L,label:z,className:W("field-wrapper",i)}),c.jsx(R,{as:"p"})]});const B={};C?T.className="legend-as-label text-small":B.className="field-label";const F=({element:S,...M})=>y.createElement(S||"label",{...M,"data-testid":`label-${n}`});return c.jsx(c.Fragment,{children:y.createElement(C?"fieldset":"div",{className:W("field-wrapper text-small",i,`${u}-wrapper`,{"multiple-options-wrapper":C})},c.jsxs(c.Fragment,{children:[f.label===!1?c.jsx(c.Fragment,{}):y.createElement(C?y.Fragment:"p",B,c.jsxs(F,{...T,children:[z,b&&l&&c.jsxs(c.Fragment,{children:[" ",c.jsxs("small",{children:["(",t.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})),y.createElement(C||A?"div":"p",{className:"field-component"},c.jsxs(c.Fragment,{children:[c.jsx(x,{...L}),c.jsx(Oo,{id:_,limit:o,valueLength:g}),v]})),c.jsx(R,{})]}))})},Uv=(e,t)=>{const{type:n,payload:r}=t,i=e.errors?Ot(e.errors):{},a=e.values?Ot(e.values):{};switch(n){case"updateValue":if(r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:i,[r==null?void 0:r.key]:r==null?void 0:r.value};a[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:i,values:a};case"addError":return r!=null&&r.key&&!i[r==null?void 0:r.key]&&(i[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:i};case"removeError":return r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],{...e,errors:i};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:d}=r,m=Ot(Object.keys(i));for(const h of s)if(h.validation)for(let p=0;p<h.validation.length;p++){const{condition:v="required",error:f=!1}=h.validation[p];let b=!1;if(typeof v=="function"){const g=v(a);g&&(b=f||g)}else{const g=a[h.id],x=v;switch(x){case"required":Pr(x,g)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_required"})));break;case"no-numbers":{Pr(x,g)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{Pr(x,g)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_email"})));break}case"valid-url":{Pr(x,g)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(b){o({type:"addError",payload:{key:h.id,value:b}}),m.push(h.id);break}}return m.length===0?l(a):u(a,m),e}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let Va=null;const Jt=({element:e="form",fields:t,className:n="",id:r=t.length?`form__${t[0].id}`:"form",formRef:i,intlPath:a=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:l,children:u,gtm:d={context:"Form",event:"form-submit-click"},functions:m,...h})=>{const p=(t||[]).filter($=>$.type==="multiple-inputs").map($=>$.id),[v,f]=y.useState({fieldsToValidate:t,multipleInputs:p});y.useEffect(()=>{v.multipleInputs.length||f($=>({...$,fieldsToValidate:t,multipleInputs:p}))},[t.length]);const{customOnSubmit:b,hideButton:g,...x}=s,C=40,{shouldShowCancelButton:A=!1,shouldReset:E=!0,shouldHide:_=!0,showRequiredLabels:T=!0,showSuccessMessage:L=!1}=l||{},{onSuccess:O=async()=>{},onCancel:z=()=>{},onCatch:R=()=>{},onFailure:B=()=>{}}=m||{},F=ae.useIntl(),S={};t.length&&t.forEach($=>{const K=$.id||$.name;K&&(S[K]=$.value||"")});const[M,U]=y.useReducer(Uv,{isSubmitting:!1,formSubmitted:!1,errors:{},values:S}),{errors:V,isSubmitting:ie,formSubmitted:te,values:D}=M;y.useEffect(()=>{E&&te&&(Va=setTimeout(()=>{U({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[te]),y.useEffect(()=>()=>{Va&&clearTimeout(Va)},[]),y.useEffect(()=>{const $=K=>{U({type:"updateValue",payload:{key:K.detail.id,value:K.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",$),()=>{document.removeEventListener("dropdownMultiSelectSubmit",$)}},[]);const J=y.useRef(null),Y=i||J,k=Ur(()=>{if(!ie){if(U({type:"updateValue",payload:{key:"isSubmitting",value:!0}}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&U({type:"submitForm",payload:{fields:v.fieldsToValidate,dispatch:U,intl:F}});return}U({type:"submitForm",payload:{fields:v.fieldsToValidate,dispatch:U,onSuccess:async $=>{try{await O($),U({type:E?"formSubmittedAndReset":"formSubmitted"})}catch(K){R(K),U({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:($,K)=>{B($,K),U({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:F}})}},100);if(!t.length)return null;const j={};s.children&&(j.default=s.children),x.text&&typeof x.text=="string"&&(j.default=x.text),["default","submitting","submitted"].forEach($=>{x.text&&typeof x.text!="string"&&$ in x.text?j[$]=x.text[$]:j[$]||(j[$]=F.formatMessage({id:`form_${$==="default"?"submit":$}`}))}),delete x.text;const q=$=>{var ne;if($.preventDefault(),$.stopPropagation(),ie)return;let K=0;if((ne=Y==null?void 0:Y.current)!=null&&ne.id){const oe=document.getElementById(Y.current.id);oe&&(K=oe.getBoundingClientRect().top+window.scrollY)}const G=document.getElementById("header");G&&(K=K-G.offsetHeight-C),K<0&&(K=0),window.scrollTo({top:K,behavior:"smooth"}),k()},P=[{...x,icon:te?{icon:"tick",position:"left"}:!1,className:W("gtm-trackable",x.className),onClick:q,disabled:ie||te||s.disabled,"data-gtm-event-context":d.context,"data-gtm-event-type":d.event,children:j[ie?"submitting":te?"submitted":"default"]}];return A&&P.unshift({...o,className:W("gtm-trackable",o.className),"data-gtm-event-context":d.context,"data-gtm-event-type":d.event,disabled:ie||te,onClick:z,children:o.text||F.formatMessage({id:"form_cancel"})}),c.jsxs(c.Fragment,{children:[y.createElement(e,{...h,id:r,className:W("form",n),ref:Y},c.jsxs(c.Fragment,{children:[V!=null&&V.general?c.jsx(wn,{variant:"error",text:F.formatMessage({id:"form_error_generalError"})}):null,u,(!_||!ie&&!te||b)&&t.map(($,K)=>{const{id:G=$.name||K,component:ne,functions:oe={onChange:()=>{}},submitOnEnter:X=!1}=$;if(ne)return c.jsx(ne,{...$.props||{}},`component-${G}-${K}`);const ge=(D==null?void 0:D[G])||"",de={...oe,onChange:be=>{U({type:"updateValue",payload:{key:G,value:be}}),oe.onChange(be,U)}};return X&&(de.onKeyDown=be=>{be.key==="Enter"&&(be.stopPropagation(),be.preventDefault(),k()),oe.onKeyDown&&oe.onKeyDown(be)}),c.jsx(Ff,{intlPath:a,...$,showRequiredLabels:T,value:ge,error:$.type==="multiple-inputs"?V:V==null?void 0:V[G],functions:de,fieldData:{fields:v.fieldsToValidate,multipleInputs:v.multipleInputs,setFields:f,dispatch:U}},G)}),g?null:(ie||te)&&b?b:c.jsx(gr,{className:W("cta",{center:ie||te,submitted:te}),buttons:P})]})),L&&te&&c.jsx(ur,{className:"success",children:typeof L=="string"?L:F.formatMessage({id:"form_success"})})]})};const bi="passwordRules_",Af="isMoreThanEightCharacters",Bf="includesNumberAndSymbol",Tf="includesLowerAndUppercase",Vv={[Af]:"8Characters",[Bf]:"numberSymbol",[Tf]:"lowercaseUppercase"},Wv=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ae.useIntl();return c.jsxs("aside",{className:W("password-rules",t),children:[c.jsx("small",{children:n.formatMessage({id:`${bi}intro`})}),c.jsx("ul",{children:[Af,Bf,Tf].map(r=>c.jsxs("li",{className:W({matches:e[r]}),children:[c.jsxs(Me,{children:[n.formatMessage({id:`${bi}rule_label`})," "]}),c.jsx("span",{children:n.formatMessage({id:`${bi}rule_${Vv[r]}`})}),!e[r]&&c.jsxs(Me,{element:"strong",children:[" ",n.formatMessage({id:`${bi}notMet`})]})]},`rule-${r}`))})]})},Sf=y.memo(Wv);const Hv=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:i=()=>{}},className:a="",hasLoaded:s=!1})=>{const o=ae.useIntl(),[l,u]=y.useState({setUp:!1,id:null,rating:null,disabled:!0}),d=async()=>{try{const g=await n();u(x=>({...x,setUp:!0,id:g&&g.id,disabled:!1}))}catch(g){u(x=>({...x,setUp:!0,disabled:!0})),i(g)}};if(y.useEffect(()=>{s&&!l.setUp&&d()},[s]),!s)return c.jsx(It,{className:"rating-placeholder"});const{id:m,rating:h,disabled:p}=l,v="ratings_",f={text:o.formatMessage({id:`${v}text`}),low:o.formatMessage({id:`${v}low`}),high:o.formatMessage({id:`${v}high`}),success:o.formatMessage({id:`${v}success`}),...e},b=async g=>{if(!(!m||p))try{u(x=>({...x,rating:g,disabled:!0})),await r({id:m,value:g})}catch(x){u(C=>({...C,rating:null})),i(x)}finally{u(x=>({...x,disabled:!1}))}};return c.jsxs("div",{className:W("rating",a),children:[c.jsx("span",{className:"label",children:f[h?"success":"text"]}),c.jsx("ol",{children:Array.from(new Array(t).keys()).map(g=>{const x=g+1;return c.jsx("li",{className:W({selected:h&&x<=h}),children:c.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:`star${!h||x>h?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${v}stars`},{number:x,total:t})}${x===1||x===t?` - ${f[x===1?"low":"high"]}`:""}`,onClick:C=>{C.preventDefault(),C.stopPropagation(),b(x)},disabled:p})},`rating-${x}`)})})]})},Kv={id:"",tabbableOption:"",setFocus:()=>{},openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,isInOverlay:!1,dispatch:()=>{},enrichedUrl:void 0,onMention:()=>{},getLinkPreview:()=>Promise.resolve({}),reportError:e=>{console.error(e)}},ln=y.createContext(Kv);var H=(e=>(e.blockquote="block_quote",e.bold="bold",e.code="code",e.codeblock="code_block",e.heading="heading",e.hr="thematic_break",e.image="image",e.italic="italic",e.li="list_item",e.link="link",e.mention="mention",e.ol="ol_list",e.paragraph="paragraph",e.ul="ul_list",e.strikethrough="strikeThrough",e.span="span",e.h3="heading_three",e))(H||{}),Kt=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(Kt||{});const Zv=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case H.blockquote:return c.jsx("blockquote",{className:"subtle",...e,children:t});case H.link:return c.jsx("a",{...e,children:t});case H.li:return c.jsx("li",{...e,children:t});case H.mention:const i=r;return i!=null&&i.name&&i.name===Vr?c.jsxs("span",{...e,className:"mention deleted-user",children:["@",c.jsx(ae.FormattedMessage,{id:"member_deleted"}),t]}):c.jsxs("a",{...e,className:"mention",children:["@",(i==null?void 0:i.name)||"",t]});case H.ol:return c.jsx("ol",{...e,children:t});case H.ul:return c.jsx("ul",{...e,children:t});case H.span:return c.jsx("span",{...e,children:t});case H.paragraph:return c.jsx("p",{...e,children:t});default:return c.jsx("span",{...e,children:t})}},Yv=({attributes:e,children:t,leaf:n})=>{const r=n;return r[H.bold]&&(t=c.jsx("strong",{children:t})),r[H.italic]&&(t=c.jsx("em",{children:t})),r[H.strikethrough]&&(t=c.jsx("s",{children:t})),r[H.h3]&&(t=c.jsx("h3",{children:t})),c.jsx("span",{...e,children:t})};var Gv=Xv,jf="֑-߿יִ-﷽ﹰ-ﻼ",Pf="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Qv=new RegExp("^[^"+Pf+"]*["+jf+"]"),Jv=new RegExp("^[^"+jf+"]*["+Pf+"]");function Xv(e){return e=String(e||""),Qv.test(e)?"rtl":Jv.test(e)?"ltr":"neutral"}const Of=In(Gv);function eb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var No=eb,tb=typeof li=="object"&&li&&li.Object===Object&&li,nb=tb,rb=nb,ib=typeof self=="object"&&self&&self.Object===Object&&self,ab=rb||ib||Function("return this")(),Mf=ab,sb=Mf,ob=function(){return sb.Date.now()},ub=ob,lb=/\s/;function cb(e){for(var t=e.length;t--&&lb.test(e.charAt(t)););return t}var db=cb,fb=db,mb=/^\s+/;function hb(e){return e&&e.slice(0,fb(e)+1).replace(mb,"")}var pb=hb,gb=Mf,vb=gb.Symbol,Nf=vb,nl=Nf,If=Object.prototype,bb=If.hasOwnProperty,yb=If.toString,Ar=nl?nl.toStringTag:void 0;function xb(e){var t=bb.call(e,Ar),n=e[Ar];try{e[Ar]=void 0;var r=!0}catch{}var i=yb.call(e);return r&&(t?e[Ar]=n:delete e[Ar]),i}var wb=xb,Cb=Object.prototype,Db=Cb.toString;function Eb(e){return Db.call(e)}var _b=Eb,rl=Nf,kb=wb,Fb=_b,Ab="[object Null]",Bb="[object Undefined]",il=rl?rl.toStringTag:void 0;function Tb(e){return e==null?e===void 0?Bb:Ab:il&&il in Object(e)?kb(e):Fb(e)}var Sb=Tb;function jb(e){return e!=null&&typeof e=="object"}var Pb=jb,Ob=Sb,Mb=Pb,Nb="[object Symbol]";function Ib(e){return typeof e=="symbol"||Mb(e)&&Ob(e)==Nb}var Rb=Ib,$b=pb,al=No,Lb=Rb,sl=0/0,zb=/^[-+]0x[0-9a-f]+$/i,qb=/^0b[01]+$/i,Ub=/^0o[0-7]+$/i,Vb=parseInt;function Wb(e){if(typeof e=="number")return e;if(Lb(e))return sl;if(al(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=al(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$b(e);var n=qb.test(e);return n||Ub.test(e)?Vb(e.slice(2),n?2:8):zb.test(e)?sl:+e}var Hb=Wb,Kb=No,Wa=ub,ol=Hb,Zb="Expected a function",Yb=Math.max,Gb=Math.min;function Qb(e,t,n){var r,i,a,s,o,l,u=0,d=!1,m=!1,h=!0;if(typeof e!="function")throw new TypeError(Zb);t=ol(t)||0,Kb(n)&&(d=!!n.leading,m="maxWait"in n,a=m?Yb(ol(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(_){var T=r,L=i;return r=i=void 0,u=_,s=e.apply(L,T),s}function v(_){return u=_,o=setTimeout(g,t),d?p(_):s}function f(_){var T=_-l,L=_-u,O=t-T;return m?Gb(O,a-L):O}function b(_){var T=_-l,L=_-u;return l===void 0||T>=t||T<0||m&&L>=a}function g(){var _=Wa();if(b(_))return x(_);o=setTimeout(g,f(_))}function x(_){return o=void 0,h&&r?p(_):(r=i=void 0,s)}function C(){o!==void 0&&clearTimeout(o),u=0,r=l=i=o=void 0}function A(){return o===void 0?s:x(Wa())}function E(){var _=Wa(),T=b(_);if(r=arguments,i=this,l=_,T){if(o===void 0)return v(l);if(m)return clearTimeout(o),o=setTimeout(g,t),p(l)}return o===void 0&&(o=setTimeout(g,t)),s}return E.cancel=C,E.flush=A,E}var Rf=Qb;const Jb=In(Rf);var Xb=Rf,e0=No,t0="Expected a function";function n0(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(t0);return e0(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Xb(e,t,{leading:r,maxWait:t,trailing:i})}var r0=n0;const i0=In(r0),ul=e=>typeof e=="object"&&e!=null&&e.nodeType===1,ll=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Ha=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return ll(n.overflowY,t)||ll(n.overflowX,t)||(r=>{const i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},yi=(e,t,n,r,i,a,s,o)=>a<e&&s>t||a>e&&s<t?0:a<=e&&o<=n||s>=t&&o>=n?a-e-r:s>t&&o<n||a<e&&o>n?s-t+i:0,a0=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},cl=(e,t)=>{var n,r,i,a;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:d}=t,m=typeof u=="function"?u:U=>U!==u;if(!ul(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,p=[];let v=e;for(;ul(v)&&m(v);){if(v=a0(v),v===h){p.push(v);break}v!=null&&v===document.body&&Ha(v)&&!Ha(document.documentElement)||v!=null&&Ha(v,d)&&p.push(v)}const f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,b=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:g,scrollY:x}=window,{height:C,width:A,top:E,right:_,bottom:T,left:L}=e.getBoundingClientRect(),{top:O,right:z,bottom:R,left:B}=(U=>{const V=window.getComputedStyle(U);return{top:parseFloat(V.scrollMarginTop)||0,right:parseFloat(V.scrollMarginRight)||0,bottom:parseFloat(V.scrollMarginBottom)||0,left:parseFloat(V.scrollMarginLeft)||0}})(e);let F=o==="start"||o==="nearest"?E-O:o==="end"?T+R:E+C/2-O+R,S=l==="center"?L+A/2-B+z:l==="end"?_+z:L-B;const M=[];for(let U=0;U<p.length;U++){const V=p[U],{height:ie,width:te,top:D,right:J,bottom:Y,left:k}=V.getBoundingClientRect();if(s==="if-needed"&&E>=0&&L>=0&&T<=b&&_<=f&&E>=D&&T<=Y&&L>=k&&_<=J)return M;const j=getComputedStyle(V),q=parseInt(j.borderLeftWidth,10),P=parseInt(j.borderTopWidth,10),$=parseInt(j.borderRightWidth,10),K=parseInt(j.borderBottomWidth,10);let G=0,ne=0;const oe="offsetWidth"in V?V.offsetWidth-V.clientWidth-q-$:0,X="offsetHeight"in V?V.offsetHeight-V.clientHeight-P-K:0,ge="offsetWidth"in V?V.offsetWidth===0?0:te/V.offsetWidth:0,de="offsetHeight"in V?V.offsetHeight===0?0:ie/V.offsetHeight:0;if(h===V)G=o==="start"?F:o==="end"?F-b:o==="nearest"?yi(x,x+b,b,P,K,x+F,x+F+C,C):F-b/2,ne=l==="start"?S:l==="center"?S-f/2:l==="end"?S-f:yi(g,g+f,f,q,$,g+S,g+S+A,A),G=Math.max(0,G+x),ne=Math.max(0,ne+g);else{G=o==="start"?F-D-P:o==="end"?F-Y+K+X:o==="nearest"?yi(D,Y,ie,P,K+X,F,F+C,C):F-(D+ie/2)+X/2,ne=l==="start"?S-k-q:l==="center"?S-(k+te/2)+oe/2:l==="end"?S-J+$+oe:yi(k,J,te,q,$+oe,S,S+A,A);const{scrollLeft:be,scrollTop:Te}=V;G=de===0?0:Math.max(0,Math.min(Te+G/de,V.scrollHeight-ie/de+X)),ne=ge===0?0:Math.max(0,Math.min(be+ne/ge,V.scrollWidth-te/ge+oe)),F+=Te-G,S+=be-ne}M.push({el:V,top:G,left:ne})}return M},s0=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function o0(e,t){if(!e.isConnected||!(i=>{let a=i;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(e))return;const n=(i=>{const a=window.getComputedStyle(i);return{top:parseFloat(a.scrollMarginTop)||0,right:parseFloat(a.scrollMarginRight)||0,bottom:parseFloat(a.scrollMarginBottom)||0,left:parseFloat(a.scrollMarginLeft)||0}})(e);if((i=>typeof i=="object"&&typeof i.behavior=="function")(t))return t.behavior(cl(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:i,top:a,left:s}of cl(e,s0(t))){const o=a-n.top+n.bottom,l=s-n.left+n.right;i.scroll({top:o,left:l,behavior:r})}}/*!
67
67
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
68
68
  *
69
69
  * Copyright (c) 2014-2017, Jon Schlinkert.
package/index.mjs CHANGED
@@ -9248,7 +9248,7 @@ const Bv = ({
9248
9248
  "has-legend": t
9249
9249
  }),
9250
9250
  children: [
9251
- t ? /* @__PURE__ */ c.jsxs("legend", { className: "legend-as-label", children: [
9251
+ t ? /* @__PURE__ */ c.jsxs("legend", { className: "legend-as-label text-small", children: [
9252
9252
  t,
9253
9253
  p ? /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
9254
9254
  " ",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "6.6.10-beta.1",
3
+ "version": "6.6.11",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {