"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[371],{35268:function(e,t,n){n.d(t,{Z:function(){return c}});var i=n(85893),a=n(36465),o=n.n(a),s=n(45697),r=n.n(s);let l="form {\n    display: flex;\n    flex-flow: column nowrap;\n    gap: 1rem;\n}";function c(e){let{className:t,onSubmit:n,children:a,styles:s="",useDefaultStyling:r=!0}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("form",{onSubmit:n,autoComplete:"off",className:o().dynamic([["e4e6152b6aba3646",[r?l:"",s]]])+" "+"".concat(null!=t?t:""),children:a}),(0,i.jsx)(o(),{id:"e4e6152b6aba3646",dynamic:[r?l:"",s],children:"".concat(r?l:"","\n                ").concat(s,"\n            ")})]})}c.propTypes={className:r().string,onSubmit:r().func.isRequired,children:r().node.isRequired,styles:r().string,useDefaultStyling:r().bool}},35879:function(e,t,n){n.d(t,{e:function(){return u}});var i=n(85893),a=n(36465),o=n.n(a),s=n(45697),r=n.n(s),l=n(27453),c=n(94184),d=n.n(c);let u={bottomLeft:"buttonBottomLeft",bottomRight:"buttonBottomRight",topRight:"buttonTopRight",topLeft:"buttonTopLeft"},m=e=>{let{children:t,photoId:n,legacyPath:a,width:s=128,buttonLocation:r,iconCenteredOnCircumference:c=!1}=e,u=s/2,m=c?"".concat(u-Math.sqrt(u*u/2),"px"):0;return(0,i.jsxs)("div",{className:o().dynamic([["5320e9821e37908b",[c?"translate(-50%, -50%)":"none",m,m,m,m,m,m,m,m]]])+" profilePhotoBorder",children:[(0,i.jsx)(l.Z,{width:s,publicId:n,legacyPath:a}),(0,i.jsx)("div",{className:o().dynamic([["5320e9821e37908b",[c?"translate(-50%, -50%)":"none",m,m,m,m,m,m,m,m]]])+" "+(d()(r,"photoButton")||""),children:t}),(0,i.jsx)(o(),{id:"5320e9821e37908b",dynamic:[c?"translate(-50%, -50%)":"none",m,m,m,m,m,m,m,m],children:".profilePhotoBorder.__jsx-style-dynamic-selector{position:relative}.photoButton.__jsx-style-dynamic-selector{position:absolute;background-color:transparent;-webkit-transform:".concat(c?"translate(-50%, -50%)":"none",";-moz-transform:").concat(c?"translate(-50%, -50%)":"none",";-ms-transform:").concat(c?"translate(-50%, -50%)":"none",";-o-transform:").concat(c?"translate(-50%, -50%)":"none",";transform:").concat(c?"translate(-50%, -50%)":"none","}.buttonBottomLeft.__jsx-style-dynamic-selector{bottom:").concat(m,";left:").concat(m,"}.buttonBottomRight.__jsx-style-dynamic-selector{bottom:").concat(m,";right:").concat(m,"}.buttonTopLeft.__jsx-style-dynamic-selector{top:").concat(m,";left:").concat(m,"}.buttonTopRight.__jsx-style-dynamic-selector{top:").concat(m,";right:").concat(m,"}")})]})};m.propTypes={children:r().node.isRequired,photoId:r().string,legacyPath:r().string,width:r().number,buttonLocation:r().string,iconCenteredOnCircumference:r().bool},t.Z=m},44777:function(e,t,n){n.d(t,{Z:function(){return d}});var i=n(85893),a=n(36465),o=n.n(a),s=n(45697),r=n.n(s),l=n(17352);function c(e){let{item:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:t.icon,style:{padding:"2px"}}),(0,i.jsx)("span",{children:t.text})]})}function d(e){let{items:t,onItemClick:n,id:a,...s}=e;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{"data-qa":"button-ellipsis-".concat(a," ").concat(s["data-qa"]),className:"jsx-9e84e8eb00e79a40 ellipsis",children:[(0,i.jsx)(l.u,{id:a,className:"noPrint ellipsis",onItemClick:n,items:t,itemRender:e=>{let{item:t}=e;return(0,i.jsx)(c,{item:t})},fillMode:"flat",rounded:"full",iconClass:"fa-ellipsis fa-light icon-30",popupSettings:{anchorAlign:{horizontal:"center",vertical:"bottom"},popupAlign:{horizontal:"right",vertical:"top"},popupClass:"ellipsis"}}),(0,i.jsx)(o(),{id:"9e84e8eb00e79a40",children:".k-popup.k-menu-popup{padding:14px 4px;border:0;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.2);-moz-box-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 1px 2px rgba(0,0,0,.2);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.k-link:hover{background-color:transparent!important}"})]})})}c.propTypes={item:r().object.isRequired},d.propTypes={items:r().array.isRequired,onItemClick:r().func.isRequired,id:r().string.isRequired}},38330:function(e,t,n){n.d(t,{Z:function(){return K}});var i=n(67294),a=n(85893),o=n(36465),s=n.n(o),r=n(82729),l=n(81621);function c(){let e=(0,r._)(["\n    query GET_COMMENTS(\n        $parentId: String!\n        $parentType: CommentParentType!\n        $limit: Int\n        $sortDirection: SortDirection!\n    ) {\n        commentByParent(\n            query: {\n                parentId: $parentId\n                parentType: $parentType\n                paginationInput: { limit: $limit, sortDirection: $sortDirection }\n            }\n        ) {\n            comments {\n                id\n                author {\n                    id\n                    firstName\n                    lastName\n                    photo {\n                        publicId\n                        legacyPath\n                        width\n                        height\n                    }\n                }\n                comment\n                createdAt\n                parentId\n                parentType\n                replyCount\n                privileges\n                reactionGroupSummary {\n                    id\n                    type\n                    totalCount\n                    contextualUserHasReacted\n                }\n            }\n            nextToken\n            totalCount\n        }\n    }\n"]);return c=function(){return e},e}function d(){let e=(0,r._)(["\n    mutation CREATE_COMMENT($input: CreateCommentInput!) {\n        createComment(input: $input) {\n            comment {\n                id\n                author {\n                    id\n                    firstName\n                    lastName\n                    photo {\n                        publicId\n                        legacyPath\n                        width\n                        height\n                    }\n                }\n                comment\n                createdAt\n                parentId\n                parentType\n                replyCount\n                privileges\n                reactionGroupSummary {\n                    id\n                    type\n                    totalCount\n                    contextualUserHasReacted\n                }\n            }\n            didAutoFollowSite\n        }\n    }\n"]);return d=function(){return e},e}function u(){let e=(0,r._)(["\n    mutation UPDATE_COMMENT($input: UpdateCommentInput!) {\n        updateComment(input: $input) {\n            id\n            author {\n                id\n                firstName\n                lastName\n                photo {\n                    publicId\n                    legacyPath\n                    width\n                    height\n                }\n            }\n            comment\n            createdAt\n            parentId\n            parentType\n            replyCount\n            privileges\n            reactionGroupSummary {\n                id\n                type\n                totalCount\n                contextualUserHasReacted\n            }\n        }\n    }\n"]);return u=function(){return e},e}function m(){let e=(0,r._)(["\n    mutation DELETE_COMMENT($input: DeleteCommentInput!) {\n        deleteComment(input: $input)\n    }\n"]);return m=function(){return e},e}let p=(0,l.Ps)(c()),x=(0,l.Ps)(d()),f=(0,l.Ps)(u()),h=(0,l.Ps)(m());var b=n(35268),y=n(54303),g=n(80325),v=n(45697),j=n.n(v),w=n(50319),E=n(9779),I=n(50178),S=n(96491),_=n(88514),k=n(73552),T=n(8988);let N={CREATE:"CREATE",EDIT:"EDIT"};function C(e){let{commentInstance:t,commentText:n="",id:o,onSuccess:r}=e,[l,c]=(0,i.useState)(n),[d,u]=(0,i.useState)(l),[m,p]=(0,i.useState)(!1),h=(0,I.Ph)("siteId"),v=t.parentType===g.L8.COMMENT,j=o?N.EDIT:N.CREATE,{isSignedIn:C}=(0,E.SE)();""===l&&""===d||C||(0,I.Eu)();let M=v?"Reply to this Comment":(0,a.jsxs)("div",{children:["Comment:"," ",(0,a.jsx)("span",{className:"light",children:"Did you know, a quick comment can boost morale by 28.2%"})]}),[A,{client:D}]=(0,w.D)(x),[L]=(0,w.D)(f),P=(0,S.Pe)(),R=e=>{e.preventDefault(),p(e=>!e),j===N.CREATE&&A({variables:{input:{parentId:t.parentObject.id,parentType:t.parentType,comment:d}},onError(e){console.log("mutation createComment failed because ".concat(JSON.stringify(e)))},onCompleted(e){var n;let{createComment:i}=e;t.updateCommentCount(1),null===(n=t.refetch)||void 0===n||n.call(t),p(!1),P({event:S.kM.COMMENTED}),r({didAutoFollowSite:i.didAutoFollowSite}),i.didAutoFollowSite&&D.refetchQueries({include:[k.j]})},refetchQueries:[{query:_.EF,variables:{siteId:h}}]}),j===N.EDIT&&L({variables:{input:{id:o,comment:d}},onError(e){console.log("mutation editComment failed because ".concat(JSON.stringify(e)))},onCompleted(){t.refetch(),p(e=>!e),r()}})};return(0,i.useEffect)(()=>{u(l.trim())},[l]),(0,a.jsxs)("div",{className:"jsx-82ed2212d72ad8ce",children:[(0,a.jsxs)(b.Z,{className:"addComment marginBottom--12",onSubmit:R,useDefaultStyling:!1,styles:".addComment {\n                        display: flex;\n                        gap: 12px;\n                    }",children:[(0,a.jsx)("div",{className:"jsx-82ed2212d72ad8ce inputContainer",children:(0,a.jsx)(T.Z,{id:"commentField",value:l,label:M,onChange:e=>c(e.target.value),"data-qa":"addCommentField",className:"commentField",onSubmit:R,placeholder:v?"Write a reply":"Write a comment"})}),(0,a.jsx)(y.Z,{"data-qa":"commentBtn",onClick:e=>{if(!C){(0,I.Eu)();return}R(e)},disabled:""===l||""===d||m,className:"commentBtn",children:(0,a.jsx)("i",{"aria-hidden":"true",className:"jsx-82ed2212d72ad8ce fa fa-paper-plane fa-light"})})]}),(0,a.jsx)(s(),{id:"82ed2212d72ad8ce",children:".addComment.jsx-82ed2212d72ad8ce>input{margin-bottom:0}.commentBtn.button{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;margin-bottom:6px;padding:9px 15px}.inputContainer.jsx-82ed2212d72ad8ce{width:100%;margin-top:15px}.inputContainer>label{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-top:0;font-weight:500}.light{color:var(--gray-500)}.commentField::placeholder{font-style:normal;color:#737373}"})]})}C.propTypes={commentInstance:j().object.isRequired,commentText:j().string,id:j().string,onSuccess:j().func,focus:j().bool};var M=n(69880);function A(e){var t,n;let{commentInstance:i,className:o}=e;o||(o=null);let r=null==i?void 0:null===(t=i.parentObject)||void 0===t?void 0:null===(n=t.commentCount)||void 0===n?void 0:n.totalDescendentCount;return(0,a.jsxs)("span",{className:"jsx-ea16c7692e41b271 "+(o||""),children:[r," comment",(0,M.Ho)(r),(0,a.jsx)(s(),{id:"ea16c7692e41b271",children:"span.jsx-ea16c7692e41b271{font-size:16px}"})]})}A.propTypes={commentInstance:j().object.isRequired,className:j().string};var D=n(48683);function L(e){var t;let{commentInstance:n,expandedCommentThreadState:i,className:o,...s}=e;o||(o=null);let[r,l]=i,c=r?(0,a.jsx)("i",{className:"fa-chevron-up fa-light"}):(0,a.jsx)("i",{className:"fa-chevron-down fa-light"}),d=null==n?void 0:null===(t=n.parentObject)||void 0===t?void 0:t.commentCount.totalDescendentCount;return d?(0,a.jsxs)(D.Z,{onClick:()=>{l(e=>!e)},className:o,...s,children:[(0,a.jsx)(A,{commentInstance:n})," ",c]}):(0,a.jsx)(A,{className:o,commentInstance:n})}L.propTypes={commentInstance:j().object.isRequired,expandedCommentThreadState:j().array.isRequired,"data-qa":j().string.isRequired,className:j().string};var P=n(37887),R=n(49638);function B(e){let t,{commentInstance:n,expandedCommentThreadState:i,level:o=1,onSinglePostPage:r,onSuccess:l}=e,[c]=i,d=n.View;if(1===o){var u;t=!(null===(u=n.primogenitor.commentCount)||void 0===u?void 0:u.totalDescendentCount)}else t=!n.parentObject.replyCount;(!c||o>n.levelsAllowed)&&(t=!0);let{data:m,loading:x,refetch:f}=(0,P.a)(p,{variables:{parentId:n.parentObject.id,parentType:n.parentType,sortDirection:g.Sr.DESCENDING,limit:0},skip:t});if(x)return(0,a.jsx)("p",{className:"centered",children:(0,a.jsx)(R.ZP,{})});if(!m)return null;n.refetch=f;let h=m.commentByParent.comments;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"jsx-a92a6789e88cdd98 marginTop--24 thread",children:h.map(e=>(0,a.jsx)(d,{commentObject:e,level:o,onSinglePostPage:r,onSuccess:l},e.id))}),(0,a.jsx)(s(),{id:"a92a6789e88cdd98",children:".thread.jsx-a92a6789e88cdd98{border-left:solid 1px var(--gray-300)}"})]})}B.propTypes={commentInstance:j().object.isRequired,expandedCommentThreadState:j().array.isRequired,onSinglePostPage:j().bool.isRequired,level:j().number,onSuccess:j().func};var O=n(68862),U=n(66252),F=n(77386),q=n(44777),z=n(9143),Z=n(38183),V=n(27453),$=n(21754),H=n(45532),G=n(28216),Y=n(49465);function W(e){var t,n;let{commentObject:o,level:r,commentInstance:l,onSinglePostPage:c,onSuccess:d}=e,u=(0,G.Z)(),[m,p]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),{cache:b}=(0,U.x)(),{isSignedIn:v}=(0,E.SE)(),j=(0,i.useMemo)(()=>({__html:o.comment.replace(/\n/g,"<br />")}),[o.comment]),[S]=(0,w.D)(h),_=l.AddEdit,{Comment:k,expandedCommentThreadState:T}=K(b,o,g.L8.COMMENT,l.primogenitor,!0),[N,C]=T,M=[];return o.privileges.includes(g.xP.EDIT)&&M.push({text:"Edit",icon:"fa-light fa-pen",callback:()=>p(!0)}),o.privileges.includes(g.xP.DELETE)&&M.push({text:"Delete",icon:"fa-light fa-trash",callback:u.toggleModal}),(0,a.jsxs)("div",{"data-id":o.id,"data-qa":1===r?"comment":"reply",className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" viewComment marginTop--12",children:[(0,a.jsx)(V.Z,{publicId:null===(t=o.author.photo)||void 0===t?void 0:t.publicId,legacyPath:null===(n=o.author.photo)||void 0===n?void 0:n.legacyPath,width:40}),(0,a.jsxs)("div",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" textColumn",children:[(0,a.jsxs)("span",{"data-qa":"commenter-".concat(o.id),className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" commentHeader",children:[(0,a.jsxs)("span",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]]),children:[(0,a.jsxs)("strong",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]]),children:[o.author.firstName," ",o.author.lastName]})," ","—"," ",(0,O.p6)(O.yi.SHORT,new Date(o.createdAt))]}),!!M.length&&(0,a.jsx)(q.Z,{onItemClick:e=>(e.item.callback(),!1),items:M,id:"commentActions-".concat(o.id)})]}),m||(0,a.jsx)(Y.Z,{contentData:{type:"comment",html:j.__html,id:o.id},enableReadMore:!c}),m&&(0,a.jsx)(_,{commentText:o.comment,id:o.id,onSuccess:()=>p(!1),className:s().dynamic([["1ee9e4ff01efe32e",[40]]])}),(0,a.jsxs)("div",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" actionButtons testButton marginBottom--12 marginTop--12 noPrint",children:[(0,a.jsx)($.Z,{reactableType:g.xU.COMMENT,parent:o}),r!==k.levelsAllowed&&(0,a.jsx)(D.Z,{"data-qa":"replyBtn",icon:(0,a.jsx)("i",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" fa-comment fa-light"}),onClick:()=>{if(!v){(0,I.Eu)();return}N||C(e=>!e),f(e=>!e)},children:"Reply"}),(0,a.jsx)("div",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" spacer"}),(0,a.jsx)(H.Z,{reactableId:o.id,reactableType:g.xU.COMMENT,reactionGroupSummary:o.reactionGroupSummary})]}),x&&(0,a.jsx)("div",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" marginBottom--24",children:(0,a.jsx)(k.AddEdit,{onSuccess:e=>{let{didAutoFollowSite:t}=e;d({didAutoFollowSite:t})}})}),(0,a.jsx)(k.Thread,{level:++r,expandedCommentThreadState:T,onSinglePostPage:c})]}),(0,a.jsx)(Z.Z,{isShowing:u.isShowing,setIsShowing:u.setIsShowing,onClickOverlay:u.toggleModal,children:(0,a.jsxs)(z.Z,{isForModal:!0,children:[(0,a.jsx)(F.Z,{"data-qa":"closeModal",onClick:u.toggleModal}),(0,a.jsx)("p",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" h3 center",children:"Are you sure you want to delete this comment?"}),(0,a.jsx)("p",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" center",children:"Your comment and any related replies will be removed permanently. This action cannot be undone."}),(0,a.jsxs)("p",{className:s().dynamic([["1ee9e4ff01efe32e",[40]]])+" buttonGroup center",children:[(0,a.jsx)(y.Z,{"data-qa":"deleteComment",onClick:()=>{S({variables:{input:{id:o.id}},onCompleted(){u.toggleModal(),l.updateCommentCount(-1-o.replyCount),l.refetch()}})},children:"Delete"}),(0,a.jsx)(y.Z,{variant:y.c.SECONDARY,"data-qa":"cancelDelete",onClick:u.toggleModal,children:"Cancel"})]})]})}),(0,a.jsx)(s(),{id:"1ee9e4ff01efe32e",dynamic:[40],children:".viewComment.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:3px;font-size:14px;-webkit-box-align:start;-webkit-align-items:flex-start;-moz-box-align:start;-ms-flex-align:start;align-items:flex-start;page-break-inside:avoid}.viewComment.__jsx-style-dynamic-selector>:first-child{-webkit-box-flex:0;-webkit-flex:0 0 ".concat(40,"px;-moz-box-flex:0;-ms-flex:0 0 ").concat(40,"px;flex:0 0 ").concat(40,"px}.textColumn.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex:1 1 auto;-moz-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding-left:7px}.commentHeader.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:32px}.commentBody.__jsx-style-dynamic-selector{font-size:16px}.actionButtons.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-moz-box-orient:horizontal;-moz-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;gap:36px}.spacer.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-moz-box-flex:1;-ms-flex-positive:1;flex-grow:1}")})]})}W.propTypes={commentObject:j().object.isRequired,level:j().number.isRequired,commentInstance:j().object.isRequired,onSinglePostPage:j().bool.isRequired,onSuccess:j().func};class J{updateCommentCount(e){this.cache.modify({id:this.cache.identify(this.primogenitor),fields:{commentCount:t=>({...t,totalDescendentCount:t.totalDescendentCount+e})}}),this.parentType===g.L8.COMMENT&&this.cache.modify({id:this.cache.identify(this.parentObject),fields:{replyCount:t=>t+e}})}buildComponents(){this.AddEdit=this.withCommentData(C),this.Counter=this.withCommentData(A),this.CounterToggle=this.withCommentData(L),this.Thread=this.withCommentData(B),this.View=this.withCommentData(W)}withCommentData(e){return t=>(0,a.jsx)(e,{...t,commentInstance:this})}constructor(e,t,n,i){this.cache=e,this.parentObject=t,this.parentType=n,this.primogenitor=null!=i?i:t,this.levelsAllowed=J.COMMENT_LEVELS_ALLOWED}}function K(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=(0,i.useState)(o),r=(0,i.useMemo)(()=>{let i=new J(e,t,n,a);return i.buildComponents(),i},[e,t,n,a]);return{Comment:r,expandedCommentThreadState:s}}J.COMMENT_LEVELS_ALLOWED=2},21754:function(e,t,n){n.d(t,{Z:function(){return j}});var i=n(85893),a=n(36465),o=n.n(a),s=n(79777),r=n(67294),l=n(48683),c=n(33922),d=n(45697),u=n.n(d),m=n(80325),p=n(74318),x=n(50319),f=n(65970),h=n(96491),b=n(86871),y=n(9779),g=n(50178);function v(e){let t,{currentButton:n}=e;return t=n.reactionType?n.reactionType===m.lo.AMP_HEART?(0,i.jsx)("span",{className:"heartIcon colorFill",children:(0,i.jsx)("i",{className:"fa-solid fa-heart"})}):(0,i.jsx)("img",{className:"reactionIcon",src:n.src,alt:n.alt}):(0,i.jsx)("span",{className:"heartIcon",children:(0,i.jsx)("i",{className:"fa-regular fa-heart"})}),(0,i.jsxs)(i.Fragment,{children:[t,(0,i.jsx)(o(),{id:"a1747f837cb11d57",children:".reactionIcon{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex;height:18px;width:18px}.heartIcon{font-size:16px}.heartIcon .fa-heart{font-weight:300}.colorFill{color:var(--berry-bridge-400)}"})]})}function j(e){let{reactableType:t,parent:n}=e,a=(0,r.useRef)(null),d=(0,r.useRef)(null),[u,j]=(0,r.useState)(!1),[w,E]=(0,r.useState)(null),I=function(e,t){let n=(0,h.Pe)(),[i]=(0,x.D)(f.W_,{onError:e=>{console.log("addReaction error: ",e)},update:(t,n)=>{let{data:i}=n;t.modify({id:t.identify(e),fields:{reactionGroupSummary(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{readField:n}=arguments.length>1?arguments[1]:void 0,a=t.writeFragment({data:i.addReaction,fragment:f.z4});return e.some(e=>n("id",e)===i.addReaction.id)?e:[...e,a]}}})},onCompleted:()=>{n({event:h.kM.REACTED})}}),[a]=(0,x.D)(f.j4,{onError:e=>{console.log("removeReaction error: ",e)},update:(t,n)=>{let{data:i}=n;t.modify({id:t.identify(e),fields:{reactionGroupSummary(e,t){let{readField:n}=t;return e.filter(e=>n("id",e)!==i.removeReaction.id)}}})}});return n=>{let o=(0,p.PY)(e.reactionGroupSummary);(!o||(a({variables:{input:{parentId:e.id,parentType:t,type:o}}}),n&&o!==n))&&i({variables:{input:{parentId:e.id,parentType:t,type:n}}})}}(n,t),{isSignedIn:S}=(0,y.SE)(),_=(0,b.TA)(()=>j(!0),{detect:"touch"}),k=w?s.Ei.find(e=>e.reactionType===w):s.o3;(0,r.useEffect)(()=>{let e=(0,p.PY)(n.reactionGroupSummary);E(e)},[n.reactionGroupSummary]);let T=()=>{d.current=!0,j(!0)},N=()=>{d.current=!1,setTimeout(()=>{d.current||j(!1)},s.$o)},C=e=>()=>{if(!S){(0,g.Eu)({[g.Tx.REACTION]:e,[g.Tx.PARENT]:n.id},!1,void 0);return}I(e),j(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Z,{ref:a,"data-qa":"reactionButton-".concat(t,"-").concat(n.id),id:"reactionButton-".concat(t,"-").concat(n.id),onClick:()=>{let e=w?null:m.lo.AMP_HEART;if(!S){(0,g.Eu)({[g.Tx.REACTION]:e,[g.Tx.PARENT]:n.id},!1,void 0);return}I(e),j(!1)},onMouseEnter:T,onMouseLeave:N,..._(),icon:(0,i.jsx)(v,{currentButton:k}),children:k.text}),(0,i.jsx)(c.G,{anchor:a.current,show:u,anchorAlign:{horizontal:"center",vertical:"top"},popupAlign:{horizontal:"center",vertical:"bottom"},popupClass:"popover",children:(0,i.jsx)("div",{onMouseEnter:T,onMouseLeave:N,className:"jsx-bee3a8c062e5091 popoverContent",children:s.Ei.map(e=>(0,i.jsx)("button",{onClick:C(e.reactionType),"data-qa":"react-".concat(e.reactionType),className:"jsx-bee3a8c062e5091 button--isClear",children:(0,i.jsx)("div",{className:"jsx-bee3a8c062e5091 imgContainer",children:(0,i.jsx)("img",{src:e.src,alt:e.alt,className:"jsx-bee3a8c062e5091"})})},e.reactionType))})}),(0,i.jsx)(o(),{id:"bee3a8c062e5091",children:".popover{-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px;margin-bottom:4px}.popoverContent.jsx-bee3a8c062e5091{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:1px;padding:4px}.imgContainer.jsx-bee3a8c062e5091{height:40px;width:40px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px;-webkit-transition:background-color var(--speed-on-hover)ease-out;-moz-transition:background-color var(--speed-on-hover)ease-out;-o-transition:background-color var(--speed-on-hover)ease-out;transition:background-color var(--speed-on-hover)ease-out}.imgContainer.jsx-bee3a8c062e5091:hover{background-color:var(--gray-50)}img.jsx-bee3a8c062e5091{height:26px;margin:auto;display:block}"})]})}v.propTypes={currentButton:u().object.isRequired},j.propTypes={reactableType:u().string.isRequired,parent:u().object.isRequired}},45532:function(e,t,n){n.d(t,{Z:function(){return E}});var i=n(85893),a=n(36465),o=n.n(a),s=n(74318),r=n(45697),l=n.n(r),c=n(29179),d=n(6418),u=n(67294),m=n(77386),p=n(9143),x=n(65970),f=n(38183),h=n(27453),b=n(79777),y=n(73359),g=n(49638);function v(e){var t;let{data:n,loading:a,selectedIndex:r,setSelectedIndex:l}=e,u=null==n?void 0:null===(t=n.reactionsByParent)||void 0===t?void 0:t.reactionGroups;if(a||!u)return(0,i.jsx)("div",{className:"center",children:(0,i.jsx)(g.ZP,{})});let m=(0,s.fG)(u,b.Ei[r].reactionType);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.h,{children:b.Ei.map((e,t)=>(0,i.jsx)(d.z,{"data-qa":"reactionTab-".concat(e.reactionType),imageUrl:e.src,onClick:()=>l(t),togglable:!0,selected:t===r,fillMode:"flat",rounded:null,children:(0,s.uW)(u,e.reactionType)},e.reactionType))}),(0,i.jsx)("ul",{className:"jsx-9401ac3578b733f2 plainList",children:m.map(e=>{var t,n;return(0,i.jsxs)("li",{className:"jsx-9401ac3578b733f2 reactorItem",children:[(0,i.jsx)(h.Z,{publicId:null===(t=e.photo)||void 0===t?void 0:t.publicId,legacyPath:null===(n=e.photo)||void 0===n?void 0:n.legacyPath,width:34}),(0,i.jsx)("span",{"data-qa":"reactorName",className:"jsx-9401ac3578b733f2 reactorName",children:"".concat(e.firstName," ").concat(e.lastName)})]},e.id)})}),(0,i.jsx)(o(),{id:"9401ac3578b733f2",children:"ul.jsx-9401ac3578b733f2{width:100%;border-top:1px solid var(--gray-300)}.reactorItem.jsx-9401ac3578b733f2{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:12px;padding:10px}.reactorName.jsx-9401ac3578b733f2{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}"})]})}function j(e){let{isShowing:t,setIsShowing:n,toggleModal:a,reactableId:s,reactableType:r}=e,[l,c]=(0,u.useState)(0),[d,{data:h,loading:b}]=(0,y.t)(x._w,{variables:{id:s,type:r},fetchPolicy:"cache-and-network"});return(0,u.useEffect)(()=>{t&&d()},[t,d]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f.Z,{isShowing:t,setIsShowing:n,onClickOverlay:a,children:(0,i.jsxs)(p.Z,{isForModal:!0,className:"reactorsModalContent",children:[(0,i.jsx)(m.Z,{"data-qa":"closeModal",onClick:a}),(0,i.jsx)(v,{data:h,loading:b,selectedIndex:l,setSelectedIndex:c})]})}),(0,i.jsx)(o(),{id:"a1aa2ff8db9d9fa2",children:".reactorsModalContent{max-width:480px}"})]})}v.propTypes={data:l().object,loading:l().bool,selectedIndex:l().number,setSelectedIndex:l().func},j.propTypes={isShowing:l().bool.isRequired,setIsShowing:l().func.isRequired,toggleModal:l().func.isRequired,reactableId:l().string.isRequired,reactableType:l().string.isRequired};var w=n(28216);function E(e){let{reactableId:t,reactableType:n,reactionGroupSummary:a}=e,r=(0,w.Z)(),{hasCurrentUserReacted:l,reactionCount:c,reactionTypes:d}=(0,s.t1)(a),u=1===d.length&&l;if(c<1)return null;let m=(0,s.Bm)(d);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{"data-qa":"reactionCounter-".concat(t),onClick:()=>r.setIsShowing(!0),className:"jsx-1378e3855087140a reactionCounter button--isClear",children:[m.map(e=>(0,i.jsx)("div",{"data-qa":"rc-icon-".concat(e.text),className:"jsx-1378e3855087140a reactionCounter__emoji",children:(0,i.jsx)("img",{src:e.src,alt:e.alt,className:"jsx-1378e3855087140a"})},e.reactionType)),(0,i.jsxs)("span",{"data-qa":"rc-count",className:"jsx-1378e3855087140a reactionCounter__count",children:[(0,i.jsx)("span",{className:"jsx-1378e3855087140a sr-only",children:(0,s.Vc)(l)}),(0,s.CZ)(u,c)]})]}),(0,i.jsx)(j,{reactableId:t,reactableType:n,isShowing:r.isShowing,setIsShowing:r.setIsShowing,toggleModal:r.toggleModal}),(0,i.jsx)(o(),{id:"1378e3855087140a",children:".reactionCounter.jsx-1378e3855087140a{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;gap:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:var(--body-text)}.reactionCounter__emoji.jsx-1378e3855087140a{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}.reactionCounter__count.jsx-1378e3855087140a{padding:0 6px;font-size:16px}img.jsx-1378e3855087140a{height:18px;width:18px}"})]})}E.propTypes={reactableId:l().string.isRequired,reactableType:l().string.isRequired,reactionGroupSummary:l().arrayOf(l().object).isRequired}},79777:function(e,t,n){n.d(t,{$o:function(){return s},Ei:function(){return a},o3:function(){return o}});var i=n(80325);let a=[{src:"/img/emojis/emoji-heart.svg",alt:"Heart icon",text:"Heart",reactionType:i.lo.AMP_HEART},{src:"/img/emojis/emoji-pray.svg",alt:"Folded hands icon",text:"Prayer",reactionType:i.lo.FOLDED_HANDS},{src:"/img/emojis/emoji-smile.svg",alt:"Happy face icon",text:"Happy",reactionType:i.lo.HAPPY},{src:"/img/emojis/emoji-cry.svg",alt:"Sad face icon",text:"Sad",reactionType:i.lo.SAD}],o={text:"React",reactionType:null},s=200},65970:function(e,t,n){n.d(t,{W_:function(){return c},_w:function(){return m},j4:function(){return d},z4:function(){return u}});var i=n(82729),a=n(81621);function o(){let e=(0,i._)(["\n    mutation ADD_REACTION($input: AddReactionInput!) {\n        addReaction(input: $input) {\n            id\n            type\n            totalCount\n            contextualUserHasReacted\n        }\n    }\n"]);return o=function(){return e},e}function s(){let e=(0,i._)(["\n    mutation REMOVE_REACTION($input: RemoveReactionInput!) {\n        removeReaction(input: $input) {\n            id\n            type\n            totalCount\n            contextualUserHasReacted\n        }\n    }\n"]);return s=function(){return e},e}function r(){let e=(0,i._)(["\n    fragment NewReaction on ReactionGroupSummary {\n        contextualUserHasReacted\n        id\n        totalCount\n        type\n    }\n"]);return r=function(){return e},e}function l(){let e=(0,i._)(["\n    query GET_REACTORS_LIST($id: ID!, $type: ReactableType!) {\n        reactionsByParent(query: { id: $id, type: $type }) {\n            reactionGroups {\n                type\n                reactors {\n                    firstName\n                    lastName\n                    id\n                    photo {\n                        publicId\n                        legacyPath\n                    }\n                }\n                contextualUserHasReacted\n                totalCount\n            }\n        }\n    }\n"]);return l=function(){return e},e}let c=(0,a.Ps)(o()),d=(0,a.Ps)(s()),u=(0,a.Ps)(r()),m=(0,a.Ps)(l())},74318:function(e,t,n){n.d(t,{Bm:function(){return m},CZ:function(){return l},PY:function(){return s},Vc:function(){return c},fG:function(){return u},t1:function(){return r},uW:function(){return d}});var i=n(97236),a=n(69880),o=n(79777);function s(e){if(Array.isArray(e)&&e.length){let t=e.reduce((e,t)=>(t.contextualUserHasReacted&&e.push(t.type),e),[]);return t.length?t[0]:null}return null}function r(e){let t=!1,n=0,i=[];return Array.isArray(e)&&e.forEach(e=>{t=t||(null==e?void 0:e.contextualUserHasReacted),n+=null==e?void 0:e.totalCount,i.push(e.type)}),{hasCurrentUserReacted:t,reactionCount:n,reactionTypes:i}}function l(e,t){let n="";return e?(n+=" You",--t>0&&(n+=" and ".concat((0,i.eQ)(t)," other").concat((0,a.Ho)(t)))):t>0&&(n+=" ".concat((0,i.eQ)(t))),n.substring(1)}function c(e){return e?"Reacted to by ":"Reactions count: "}function d(e,t){if(!e)return 0;let n=e.find(e=>e.type===t);return n?n.totalCount:0}function u(e,t){if(!e)return[];let n=e.find(e=>e.type===t);return n?n.reactors:[]}function m(e){return o.Ei.reduce((t,n)=>(e.includes(n.reactionType)&&t.push(n),t),[])}},44441:function(e,t,n){n.d(t,{Z:function(){return E}});var i=n(85893),a=n(36465),o=n.n(a),s=n(77386),r=n(9143),l=n(38183),c=n(45697),d=n.n(c),u=n(77845),m=n(67294),p=n(32376),x=n(68258);function f(e){let{target:t,onClick:n=()=>{},children:a,...s}=e,r=(0,m.useId)(),l=null,c="shareBtn button--isClear",d={};switch(t){case p.j.FACEBOOK:l=x.Vq,c+=" facebook",d={round:!0,size:57,"data-qa":"share-facebook-icon"};break;case p.j.COPY_LINK:l=(0,u.Z)("fa-link fa-light"),c+=" copyLink";break;case p.j.EMAIL:l=(0,u.Z)("fa-envelope fa-light"),c+=" email";break;default:throw Error("Invalid value “".concat(t,"” was passed to component ButtonShare"))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{onClick:n,"aria-labelledby":r,...s,className:"jsx-2054abcce930fa6a "+(s&&null!=s.className&&s.className||c||""),children:[(0,i.jsx)("span",{"data-qa":"".concat(s["data-qa"],"-icon-span"),className:"jsx-2054abcce930fa6a circledIcon",children:(0,i.jsx)(l,{...d,className:"jsx-2054abcce930fa6a "+(d&&null!=d.className&&d.className||"")})}),(0,i.jsx)("span",{id:r,"data-qa":"".concat(s["data-qa"],"-text-span"),className:"jsx-2054abcce930fa6a textStyle",children:a})]}),(0,i.jsx)(o(),{id:"2054abcce930fa6a",children:".shareBtn.jsx-2054abcce930fa6a{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;min-width:85px}.circledIcon.jsx-2054abcce930fa6a{width:57px;height:57px;display:inline-grid;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;justify-items:center;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%}.facebook.jsx-2054abcce930fa6a .circledIcon.jsx-2054abcce930fa6a{background-color:rgba(24,119,242,.1)}.email.jsx-2054abcce930fa6a .circledIcon.jsx-2054abcce930fa6a{background-color:var(--sky);color:var(--navy);font-size:20px}.copyLink.jsx-2054abcce930fa6a .circledIcon.jsx-2054abcce930fa6a{background-color:var(--berry-bridge-200);color:var(--berry-bridge-500)}.textStyle.jsx-2054abcce930fa6a{color:var(--link-text);text-decoration:underline;font-size:16px}.shareBtn.jsx-2054abcce930fa6a:hover .textStyle.jsx-2054abcce930fa6a{color:var(--link-hover-text)}"})]})}f.propTypes={target:d().string.isRequired,onClick:d().func,"data-qa":d().string.isRequired,children:d().node.isRequired};var h=n(50178),b=n(67304),y=n(9779),g=n(81537),v=n(96491);function j(e){let{facebookShareUrl:t}=e,n=(0,g.c)(g.T.FB_SHARE),a=(0,v.Pe)(),s=async()=>{let e="undefined"!=typeof navigator&&/Android/i.test(null==navigator?void 0:navigator.userAgent);if(navigator.share&&e)try{await navigator.share({title:"CaringBridge",url:t}),a({event:v.kM.FACEBOOK_SHARE})}catch(e){console.error("Error sharing",e),a({event:v.kM.FACEBOOK_SHARE_ERROR})}else document.getElementById("reactShareFacebookShareButton").click(),a({event:v.kM.FACEBOOK_SHARE})};return(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsxs)("div",{className:"jsx-59cd6aefe639b7be",children:[(0,i.jsx)("div",{onClick:s,className:"jsx-59cd6aefe639b7be facebookShareControlFlowContainer",children:(0,i.jsx)(f,{target:p.j.FACEBOOK,"data-qa":"share-facebook",children:"Facebook"})}),(0,i.jsx)(x.Dk,{id:"reactShareFacebookShareButton",className:"reactShareFacebookShareButton",url:t,windowWidth:800,windowHeight:600,children:"This text is hidden, but necessary for FacebookShareButton to work"})]}),(0,i.jsx)(o(),{id:"59cd6aefe639b7be",children:".facebookShareControlFlowContainer.jsx-59cd6aefe639b7be{background-color:transparent;border:none}.reactShareFacebookShareButton{display:none}"})]})}function w(e){var t,n;let{siteId:a,postDetails:s,origin:r}=e,[l,c]=(0,m.useState)("Copy Link"),{data:d,error:u,loading:x}=(0,b.Z)(a),{id:g}=(0,y.SE)();if(u||x)return null;let v=null==s?void 0:s.singlePostUrl,w=d.getSite.patientId,E="".concat((0,h.Hn)()).concat((0,h.G3)(h.Z6.SITE_HOME_PAGE,a)),I=null!==(n=null==d?void 0:null===(t=d.getSite)||void 0===t?void 0:t.firstName)&&void 0!==n?n:"",{subject:S,body:_}=function(e,t,n,i,a,o){let s,r;if(a){let i="\n\nWe believe in a world where no one goes through a health journey alone. CaringBridge offers tools to share and document a health journey, simplify care coordination, and connect caregivers with their supportive community. Please continue to show your support: visit, stay updated, and share messages of encouragement and compassion.";return e===a.authorId?a.authorId===t?(s="Journal Post on my CaringBridge",r="Hello,\n\nI’ve added a new post to my CaringBridge, “".concat(a.postTitle,"”.\n\nRead the post here: ").concat(a.singlePostUrl,"?utm_source=website_share&utm_medium=share_button&utm_term=&utm_content=email_share_button&utm_campaign=").concat(o).concat(i)):(s="Journal Post on ".concat(n,"’s CaringBridge"),r="Hello,\n\nI’ve added a new post to ".concat(n,"’s CaringBridge, “").concat(a.postTitle,"”.\n\nRead the post here: ").concat(a.singlePostUrl,"?utm_source=website_share&utm_medium=share_button&utm_term=&utm_content=email_share_button&utm_campaign=").concat(o).concat(i)):e===t?(s="Journal Post on my CaringBridge",r="Hello,\n\n".concat(a.authorFirstName," has added a new post on my CaringBridge, “").concat(a.postTitle,"”.\n\nRead the post here: ").concat(a.singlePostUrl,"?utm_source=website_share&utm_medium=share_button&utm_term=&utm_content=email_share_button&utm_campaign=").concat(o).concat(i)):(s="Journal Post on ".concat(n,"’s CaringBridge"),r="Hello,\n\n".concat(a.authorFirstName," has added a new post on CaringBridge, “").concat(a.postTitle,"”.\n\nRead the post here: ").concat(a.singlePostUrl,"?utm_source=website_share&utm_medium=share_button&utm_term=&utm_content=email_share_button&utm_campaign=").concat(o).concat(i)),{subject:s,body:r}}return e===t?(s="Visit My CaringBridge",r="Hello,\n\nTo keep you updated on my health journey, I created a CaringBridge. CaringBridge is a health platform that offers tools to share and document a health journey, simplify care coordination, and connect caregivers with their supportive community.\n\nPlease visit my CaringBridge to stay updated and share messages of encouragement and support.\n\nVisit my CaringBridge page: ".concat(i,"?utm_source=website_share&utm_medium=share_button&utm_term=&utm_content=email_share_button&utm_campaign=").concat(o)):(s="Visit ".concat(n,"’s CaringBridge"),r="Hello,\n\nA CaringBridge has been created on behalf of ".concat(n,". CaringBridge is a health platform that offers tools to share and document a health journey, simplify care coordination, and connect caregivers with their supportive community.\n\n Please visit ").concat(n,"’s site often to stay updated and share messages of encouragement and support.\n\n Visit ").concat(n,"’s CaringBridge: ").concat(i,"?utm_source=website_share&utm_medium=share_button&utm_term=&utm_content=email_share_button&utm_campaign=").concat(o)),{subject:s,body:r}}(g,w,I,E,s,r),k="".concat(null!=v?v:E,"?utm_source=website_share&utm_medium=share_button&utm_term=&utm_content=link_share_button&utm_campaign=").concat(r),T="mailto:?subject=".concat(encodeURIComponent(S),"&body=").concat(encodeURIComponent(_)),N="".concat(null!=v?v:E,"?utm_source=website_share&utm_medium=share_button&utm_term=&utm_content=facebook_share_button&utm_campaign=").concat(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"jsx-553da5ff801f4e62 shareGroup marginTop--48",children:[(0,i.jsx)(f,{target:p.j.COPY_LINK,onClick:()=>{navigator.clipboard.writeText(k).then(()=>{c("Copied"),setTimeout(()=>{c("Copy Link")},2500)})},"data-qa":"share-copy-link",children:l}),(0,i.jsx)("a",{href:T,className:"jsx-553da5ff801f4e62",children:(0,i.jsx)(f,{target:p.j.EMAIL,"data-qa":"share-email",children:"Email"})}),(0,i.jsx)(j,{facebookShareUrl:N})]}),(0,i.jsxs)("div",{className:"jsx-553da5ff801f4e62 copyLink marginTop--48",children:[(0,i.jsx)("input",{type:"url","data-qa":"copyUrlText",readOnly:!0,value:k,className:"jsx-553da5ff801f4e62"}),(0,i.jsx)("i",{className:"jsx-553da5ff801f4e62 fa-link fa-light copyIcon"})]}),(0,i.jsx)(o(),{id:"553da5ff801f4e62",children:".shareGroup.jsx-553da5ff801f4e62{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:24px;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center}.copyLink.jsx-553da5ff801f4e62{position:relative;display:none}input.jsx-553da5ff801f4e62{width:100%;padding-right:2em}.copyIcon{position:absolute;right:10px;top:13px}"})]})}function E(e){let{siteId:t,modalController:n,children:a,postDetails:c,origin:d}=e,u=a||(c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"center h4",children:"Share this post"}),(0,i.jsx)("p",{className:"center",children:"Share this post with your community."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"center h4",children:"Share this page"}),(0,i.jsx)("p",{className:"center",children:"Share your CaringBridge with your community."})]}));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Z,{isShowing:n.isShowing,setIsShowing:n.setIsShowing,onClickOverlay:n.toggleModal,children:(0,i.jsxs)(r.Z,{isForModal:!0,className:"shareModalWidth",children:[(0,i.jsx)(s.Z,{"data-qa":"closeModal",onClick:n.toggleModal}),u,(0,i.jsx)(w,{siteId:t,postDetails:c,origin:d}),(0,i.jsx)("div",{className:"jsx-b7846f62c3d3d228 spacer"})]})}),(0,i.jsx)(o(),{id:"b7846f62c3d3d228",children:".shareModalWidth{max-width:700px}.spacer.jsx-b7846f62c3d3d228{height:44px}"})]})}j.propTypes={facebookShareUrl:d().string.isRequired},w.propTypes={siteId:d().string.isRequired,postDetails:d().object,origin:d().string},E.propTypes={siteId:d().string.isRequired,modalController:d().object.isRequired,children:d().node,postDetails:d().object,origin:d().string}},32376:function(e,t,n){n.d(t,{Y:function(){return i},j:function(){return a}});let i={START:"sitestart",PAGE_ACTIONS:"leftmenu_php",PRIVATE_HOME_PAGE:"private_home_page",POST:"post_php"},a={FACEBOOK:"FACEBOOK",COPY_LINK:"LINK",EMAIL:"EMAIL"}},33532:function(e,t,n){n.d(t,{Z:function(){return g}});var i=n(85893),a=n(36465),o=n.n(a),s=n(45697),r=n.n(s),l=n(19063),c=n(9143),d=n(79545),u=n(50178),m=n(9779),p=n(37887),x=n(73552),f=n(25675),h=n.n(f),b=n(2232),y=n(78993);function g(e){var t,n;let{tributeThanksJson:a,className:s="",preview:r=!1}=e,f=(0,u.Ph)("siteId"),{isSignedIn:g}=(0,m.SE)(),{data:v,loading:j}=(0,p.a)(x.j,{skip:!g}),{page:w}=(0,l.bh)(),E=null!==(n=null==w?void 0:w.tributeThanks)&&void 0!==n?n:a,I=(0,d.Fb)(null==E?void 0:E.rules)||r;if(!E||!I||j)return null;let{headline:S,body:_,rules:k,daysSinceDonation:T,image:N}=E,C=(0,y.$)(T,null==v?void 0:null===(t=v.me)||void 0===t?void 0:t.mySites,f,g);return C?(0,i.jsxs)(c.Z,{className:" ".concat(s," tributeThanksCard paddingTopBottom--24 paddingLeftRight--24 "),isForModal:!0,children:[N?(0,i.jsx)(h(),{className:"tributeThanksImage",src:N.asset[0].secure_url,width:240,height:185,alt:"",unoptimized:!0}):null,(0,i.jsxs)("section",{className:o().dynamic([["c3f2680153678acd",[b.Bs.MEDIUM]]]),children:[(0,i.jsx)("h1",{className:o().dynamic([["c3f2680153678acd",[b.Bs.MEDIUM]]])+" h6 marginTop--0 marginBottom--6",children:(0,d.C9)(S)}),(0,i.jsx)("div",{className:o().dynamic([["c3f2680153678acd",[b.Bs.MEDIUM]]])+" tributeThanksBody",children:(0,i.jsx)(d.Nq,{json:_.json,rules:k||void 0})})]}),(0,i.jsx)(o(),{id:"c3f2680153678acd",dynamic:[b.Bs.MEDIUM],children:".tributeThanksCard{width:275px;max-width:300px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;text-align:center}.tributeThanksImage{-webkit-align-self:end;-ms-flex-item-align:end;align-self:end;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.tributeThanksBody.__jsx-style-dynamic-selector{font-size:16px}@media(max-width:".concat(b.Bs.MEDIUM,"){.tributeThanksCard{width:initial}.tributeThanksImage{display:none}}")})]}):null}g.propTypes={tributeThanksJson:r().object,className:r().string,preview:r().bool}},65874:function(e,t,n){n.d(t,{Z:function(){return k}});var i=n(85893),a=n(36465),o=n.n(a),s=n(67294),r=n(45697),l=n.n(r),c=n(19063),d=n(9143),u=n(93599),m=n(79545),p=n(54303),x=n(41664),f=n.n(x),h=n(50178),b=n(9779),y=n(37887),g=n(73552),v=n(67304),j=n(52107),w=n(25675),E=n.n(w),I=n(17279),S=n(2232),_=n(78993);function k(e){var t,n;let{tributeJson:a,className:r="",preview:l=!1,previewTributeCount:x=0,tab:w}=e,k=(0,h.Ph)("siteId"),{isSignedIn:T}=(0,b.SE)(),{data:N,loading:C}=(0,y.a)(g.j,{skip:!T}),{data:M,loading:A}=(0,v.Z)(k),{page:D}=(0,c.bh)(),L=null!==(n=null==D?void 0:D.tribute)&&void 0!==n?n:a,[P,R]=(0,s.useState)(""),B=(0,m.Fb)(null==L?void 0:L.rules)||l,O=(0,I.ew)(null==L?void 0:L[({feed:"splitCodeFeed",posts:"splitCodePosts",tributes:"splitCodeTributes",singlePost:"splitCodeSinglePost"})[w]],P);if(!L||!B||C||A)return null;let{headline:U,bodyTributesZero:F,bodyTributesOne:q,bodyTributesMultiple:z,placeholder:Z,buttonText:V,rules:$,daysSinceDonation:H}=L,G=(0,_.$)(H,null==N?void 0:null===(t=N.me)||void 0===t?void 0:t.mySites,k,T),Y=x;l||(Y=M.getSite.numTributes);let W=z;return(1===Y?W=q:0===Y&&(W=F),G)?null:(0,i.jsxs)(d.Z,{className:" ".concat(r," tributeCard paddingTopBottom--0 paddingLeftRight--24 "),isForModal:!0,children:[(null==L?void 0:L.image)?(0,i.jsx)(E(),{className:"tributeImage",src:L.image.asset[0].secure_url,width:240,height:185,alt:"",unoptimized:!0}):null,(0,i.jsx)("section",{className:o().dynamic([["351479056c0316c7",[S.Bs.SMALL]]])+" paddingTopBottom--24",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:o().dynamic([["351479056c0316c7",[S.Bs.SMALL]]])+" h6 marginTop--0 marginBottom--6",children:(0,m.C9)(U)}),(0,i.jsx)(m.Nq,{json:W.json,rules:$||void 0}),(0,i.jsxs)("div",{className:o().dynamic([["351479056c0316c7",[S.Bs.SMALL]]])+" inputRow marginTop--12",children:[(0,i.jsx)(u.Z,{className:"tributeTextInput","data-qa":"tributeText",value:P,onChange:e=>{R(e)},placeholder:Z,maxLength:700,style:{":placeholder-shown":{fontStyle:"bold"}}}),(0,i.jsx)(f(),{href:O,legacyBehavior:!0,children:(0,i.jsx)(p.Z,{className:"donateButton",size:j.i.SMALL,"data-qa":"tributeAction",children:V})})]})]})}),(0,i.jsx)(o(),{id:"351479056c0316c7",dynamic:[S.Bs.SMALL],children:".tributeCard{margin-top:36px!important;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:12px;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}.tributeImage{-webkit-align-self:end;-ms-flex-item-align:end;align-self:end;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.tributeTextInput::-webkit-input-placeholder{font-style:normal}.tributeTextInput:-moz-placeholder{font-style:normal}.tributeTextInput::-moz-placeholder{font-style:normal}.tributeTextInput:-ms-input-placeholder{font-style:normal}.tributeTextInput::-ms-input-placeholder{font-style:normal}.tributeTextInput::placeholder{font-style:normal}.inputRow.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:10px}.donateButton{height:44px}@media(max-width:".concat(S.Bs.SMALL,"){.tributeImage{display:none}.inputRow.__jsx-style-dynamic-selector{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:6px}}")})]})}k.propTypes={tributeJson:l().object,className:l().string,preview:l().bool,previewTributeCount:l().number,tab:l().string}},78993:function(e,t,n){n.d(t,{$:function(){return i}});function i(e,t,n,i){if(!i)return!1;if(Array.isArray(t)){let i=t.find(e=>e.id===n);if(i){let t=new Date(i.lastDonatedAt).valueOf();if(t){let n=Date.now()-t;return n<864e5*e}}}return!1}},73552:function(e,t,n){n.d(t,{j:function(){return s}});var i=n(82729),a=n(81621);function o(){let e=(0,i._)(["\n    query MY_SITES {\n        me {\n            id\n            unconfirmedSocialSignUp\n            mySites {\n                id\n                isAuthor\n                isFollowing\n                lastVisitedAt\n                lastDonatedAt\n                mainSitePhoto {\n                    width\n                    height\n                    publicId\n                    legacyPath\n                }\n                title\n                firstName\n                lastName\n                notificationList {\n                    type\n                    count\n                }\n            }\n        }\n    }\n"]);return o=function(){return e},e}let s=(0,a.Ps)(o())},37413:function(e,t,n){n.d(t,{Z:function(){return S}});var i=n(85893),a=n(36465),o=n.n(a),s=n(68602),r=n(67294),l=n(45697),c=n.n(l),d=n(50809),u=n(21403),m=n(10815),p=n(94184),x=n.n(p),f=n(49638);let h=m.Ef.MIME_TYPES.join();function b(e){let{onChange:t,id:n="filesInput",arePhotosUploading:a=!1,shouldFocusOnMount:s=!1,shouldShowInput:l=!0}=e,c=(0,r.useRef)();return((0,r.useEffect)(()=>{if(s){var e;null===(e=c.current)||void 0===e||e.focus()}},[s]),l)?(0,i.jsxs)("div",{className:o().dynamic([["9f8ec66dc864ee98",[u.bZ]]])+" prettyFileInput",children:[(0,i.jsx)("input",{accept:h,"data-qa":"upload-photos","data-ga-label":"Upload Photos",id:n,multiple:!0,onChange:t,onClick:e=>e.target.value=null,ref:c,type:"file",disabled:a,className:o().dynamic([["9f8ec66dc864ee98",[u.bZ]]])+" hideOutlineForMouse"}),(0,i.jsxs)(d.Z,{centerVertically:!0,children:[(0,i.jsx)("span",{className:o().dynamic([["9f8ec66dc864ee98",[u.bZ]]])+" prettyFileInputMask"}),(0,i.jsxs)("label",{"data-qa":"upload-photos-label",htmlFor:n,className:o().dynamic([["9f8ec66dc864ee98",[u.bZ]]])+" "+(x()("headerFont prettyFileInput__label",{"prettyFileInput__label--isDisabled":a})||""),children:[a?(0,i.jsx)(f.ZP,{}):(0,i.jsx)("i",{className:o().dynamic([["9f8ec66dc864ee98",[u.bZ]]])+" fa-plus fa-light"}),(0,i.jsxs)("span",{className:o().dynamic([["9f8ec66dc864ee98",[u.bZ]]])+" uploadInputText",children:[(0,i.jsx)("span",{className:o().dynamic([["9f8ec66dc864ee98",[u.bZ]]])+" sr-only",children:a?"Uploading":"Upload"})," ","Photos"]})]})]}),(0,i.jsx)(o(),{id:"9f8ec66dc864ee98",dynamic:[u.bZ],children:".prettyFileInput.__jsx-style-dynamic-selector{background-color:inherit;position:relative;width:".concat(u.bZ,"px;margin-top:10px}.prettyFileInput.__jsx-style-dynamic-selector>input.__jsx-style-dynamic-selector,.prettyFileInput__label.__jsx-style-dynamic-selector,.prettyFileInputMask.__jsx-style-dynamic-selector{background-color:white;height:100%;position:absolute;width:100%}.prettyFileInput.__jsx-style-dynamic-selector>input.__jsx-style-dynamic-selector{overflow:hidden}.prettyFileInput__label.__jsx-style-dynamic-selector{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;border:1px dashed var(--gray-600);color:var(--gray-600);display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;font-size:20px;font-weight:bold;height:100%;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;z-index:1}.prettyFileInput__label--isDisabled.__jsx-style-dynamic-selector{opacity:.3}.prettyFileInput__label.__jsx-style-dynamic-selector:hover{border-color:var(--gray-700);color:var(--gray-700);cursor:pointer}")})]}):null}b.propTypes={arePhotosUploading:c().bool,onChange:c().func.isRequired,id:c().string,shouldFocusOnMount:c().bool,shouldShowInput:c().bool};var y=n(81306);let g="One or more of your photos was not added because";function v(){let e=(0,s.XX)(),t=(0,y.ZZ)(e.photoFiles),n=t.map(t=>(0,y.mL)(t,e.maxFileCount));return 0===n.length?null:1===n.length?(0,i.jsxs)("div",{className:"jsx-214cedaa2234d4c9 singleErrorUpload",children:[(0,i.jsxs)("span",{className:"jsx-214cedaa2234d4c9",children:[g," ",n[0]]}),(0,i.jsx)(o(),{id:"214cedaa2234d4c9",children:".singleErrorUpload{margin-top:15px}"})]}):(0,i.jsxs)("div",{children:[g,":",(0,i.jsx)("ul",{className:"plainList",children:n.map(e=>(0,i.jsx)("li",{children:(0,y.ky)(e)},e))})]})}function j(e){let{className:t,...n}=e;return(0,i.jsxs)("button",{...n,className:"jsx-562c6c9c44246cdc "+(n&&null!=n.className&&n.className||"button--isClear ".concat(null!=t?t:"")),children:[(0,i.jsx)("i",{className:"jsx-562c6c9c44246cdc fa-circle-xmark fa-light"}),(0,i.jsx)(o(),{id:"562c6c9c44246cdc",children:"button.jsx-562c6c9c44246cdc{font-size:26px;width:42px;height:42px;display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;z-index:1}"})]})}j.propTypes={className:c().string,onClick:c().func.isRequired,"data-qa":c().string.isRequired};var w=n(96970),E=n(95414);function I(e){let{photoFile:t}=e,n=(0,s.zW)(),a=(0,r.useRef)(!0);if((0,r.useEffect)(()=>{async function e(){if(t.upload)return;let e=t.uniqueId;n({type:s.yx.SET_LIFECYCLE,uniqueId:e,lifecycle:u.TE.UPLOADING});try{t.upload=await (0,E.Ix)(t.File),n({type:s.yx.SET_LIFECYCLE,uniqueId:e,lifecycle:u.TE.FINISHED})}catch(t){n({type:s.yx.SET_ERROR,uniqueId:e,photoError:t.type})}}a.current&&(e(),a.current=!1)},[]),t.lifecycle===u.TE.UPLOADING)return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:o().dynamic([["5a8f91c8eac94e5d",[u.bZ,u.bZ]]])+" thumbnail",children:(0,i.jsx)(f.ZP,{})}),(0,i.jsx)(o(),{id:"5a8f91c8eac94e5d",dynamic:[u.bZ,u.bZ],children:".thumbnail.__jsx-style-dynamic-selector{width:".concat(u.bZ,"px;height:").concat(u.bZ,"px;text-align:center;margin-top:36px}")})]});if(t.lifecycle===u.TE.FINISHED){var l,c;return(0,i.jsxs)("span",{className:o().dynamic([["2ef0f9ffd02d75c9",[u.bZ,u.bZ]]])+" thumbnail marginTop--12",children:[(0,i.jsx)(j,{onClick:()=>{n({type:s.yx.REMOVE,uniqueId:t.uniqueId})},"data-qa":"xSitePhoto",className:"deleteBtn"}),(0,i.jsx)(w.Z,{id:null==t?void 0:null===(l=t.upload)||void 0===l?void 0:l.public_id,legacyPath:null==t?void 0:null===(c=t.upload)||void 0===c?void 0:c.legacyPath,width:u.bZ}),(0,i.jsx)(o(),{id:"2ef0f9ffd02d75c9",dynamic:[u.bZ,u.bZ],children:".thumbnail.__jsx-style-dynamic-selector{display:inline-block;position:relative;width:".concat(u.bZ,"px;height:").concat(u.bZ,"px;overflow:hidden;border:1px solid#ccc;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.deleteBtn{position:absolute;top:-6px;right:-6px}")})]})}return(0,i.jsx)("i",{className:"fa-user fa-light",style:{fontSize:"80px",color:"var(--gray-400)"}})}function S(){let e=(0,s.zW)(),t=(0,s.XX)(),n=(0,y.Kh)(t.photoFiles);return(0,i.jsxs)("div",{className:"jsx-5f186d7e22bf9427 marginTop--24",children:[(0,i.jsxs)("div",{className:"jsx-5f186d7e22bf9427 uploadList",children:[n.map(e=>(0,i.jsx)(I,{photoFile:e},e.uniqueId)),n.length<t.maxFileCount&&(0,i.jsx)("div",{className:"jsx-5f186d7e22bf9427 uploadList__appendMore",children:(0,i.jsx)(b,{arePhotosUploading:t.isUploading,onChange:t=>{let n=Array.from(t.target.files);e({type:s.yx.APPEND,data:n})},id:"uploadListAppendMore",shouldFocusOnMount:!0,shouldShowInput:!0})})]}),(0,i.jsx)(v,{}),(0,i.jsx)(o(),{id:"5f186d7e22bf9427",children:".uploadList.jsx-5f186d7e22bf9427{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-moz-box-orient:horizontal;-moz-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;gap:24px}"})]})}I.propTypes={photoFile:c().object.isRequired}},21403:function(e,t,n){n.d(t,{C1:function(){return i},Fe:function(){return a},Q2:function(){return c},TE:function(){return r},UY:function(){return l},bZ:function(){return o},mu:function(){return s}});let i=10,a=50,o=120,s={JOURNAL_POST:"JOURNAL_POST",WELL_WISH:"WELL_WISH",TRIBUTE:"TRIBUTE",SITE_PROFILE:"SITE_PROFILE"},r={CHOSEN:"CHOSEN",UPLOADING:"UPLOADING",REMOVED:"REMOVED",FINISHED:"FINISHED",ERROR:"ERROR"},l={SAVED:"SAVED",NEW:"NEW"},c={TOO_BIG:"TOO_BIG",INVALID_TYPE:"INVALID_TYPE",OVER_COUNT_LIMIT:"OVER_COUNT_LIMIT"}},81306:function(e,t,n){n.d(t,{Kh:function(){return l},Ki:function(){return r},V_:function(){return s},ZZ:function(){return c},ky:function(){return u},mL:function(){return d}});var i=n(21403),a=n(10815),o=n(69880);function s(e,t,n){let i=!1,a=!1,s=(0,o.mD)(e.name);return s&&(i=t.includes(s)),a=n.includes(String(e.type).toLowerCase()),!!(i&&a)}function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e;for(;t.some(e=>(null==e?void 0:e.uniqueId)===i);){var a;a=++n,i=null==e?void 0:e.replace(/(^[^.]*)/,"$1"+a)}return i}function l(e){return e.filter(e=>0===e.errors.length&&e.lifecycle!==i.TE.REMOVED&&e.lifecycle!==i.TE.UPLOADING)}function c(e){return e.reduce((e,t)=>(t.errors.forEach(t=>{e.includes(t)||e.push(t)}),e),[])}function d(e,t){switch(e){case i.Q2.TOO_BIG:return"it exceeds the ".concat(i.C1," MB limit.");case i.Q2.OVER_COUNT_LIMIT:return"you can only upload ".concat(t," photos at a time.");case i.Q2.INVALID_TYPE:return"its file type is not supported. Please only add ".concat(a.Ef.EXTENSIONS.join(","),".");case a.uY.TOO_MANY_PIXELS:return"it is over the ".concat(i.Fe," megapixel image resolution limit.");case a.uY.CORRUPT_IMAGE:return"it could not be loaded.";default:return"of a system problem on our end. Please try again."}}function u(e){let t=e.substring(0,1).toLocaleUpperCase(),n=e.replace(/\.$/,"");return t+n.substring(1)}},68602:function(e,t,n){n.d(t,{yx:function(){return p},TV:function(){return h},zW:function(){return y},XX:function(){return b}});var i=n(85893),a=n(21403),o=n(67294),s=n(10815),r=n(81306);class l{setError(e){this.hasError(e)||this.errors.push(e),this.lifecycle=a.TE.ERROR}hasError(e){return this.errors.includes(e)}constructor({uploadType:e,File:t=null,allowedSize:n=a.C1,listType:i=a.UY.NEW,lifeCycle:o=a.TE.CHOSEN,upload:l=null}){if(this.File=t,this.uniqueId="",this.uploadType=e,this.lifecycle=o,this.listType=i,this.errors=[],this.upload=l,this.abortController=null,this.listType===a.UY.SAVED&&this.upload)return;this.File.size>1048576*n&&this.setError(a.Q2.TOO_BIG),(0,r.V_)(this.File,s.Ef.EXTENSIONS,s.Ef.MIME_TYPES)||this.setError(a.Q2.INVALID_TYPE)}}var c=n(68716),d=n(45697),u=n.n(d);let m={isUploading:!1,photoFiles:[],maxFileCount:1,uploadType:"",isHydrated:!1},p={APPEND:"APPEND",CLEAR_ALL:"CLEAR_ALL",CLEAR_DEAD:"CLEAR_DEAD",SET_ERROR:"ERROR",REMOVE:"REMOVE",SET_LIFECYCLE:"SET_LIFECYCLE",UPLOAD:"UPLOAD",HYDRATE:"HYDRATE"},x=(0,o.createContext)(m),f=(0,o.createContext)(void 0);function h(e){let{value:t,children:n}=e,s={...m,...t},[r,d]=(0,o.useReducer)((e,t)=>{switch(t.type){case p.APPEND:{let n=Array.from(t.data).map(t=>new l({uploadType:e.uploadType,File:t}));return new c.Z(e).clearErrors().clearDeadPhotos().append(n).assignUniqueName().errorOutExcessFiles().getAbortController().getState()}case p.CLEAR_ALL:return new c.Z(e).clearErrors().clearAll().getState();case p.CLEAR_DEAD:return new c.Z(e).clearDeadPhotos().getState();case p.HYDRATE:{let n=t.photos.map(t=>new l({upload:{...t,public_id:t.publicId,legacyPath:t.legacyPath},uploadType:e.uploadType,listType:a.UY.SAVED,lifeCycle:a.TE.FINISHED}));return new c.Z(e).clearAll().clearDeadPhotos().append(n).assignUniqueName().errorOutExcessFiles().getAbortController().setIsHydrated(!0).getState()}case p.SET_ERROR:return new c.Z(e).setError(t.uniqueId,t.photoError).setIsUploading().getState();case p.REMOVE:return new c.Z(e).setLifecycle(t.uniqueId,a.TE.REMOVED).setIsUploading().abortUpload(t.uniqueId).getState();case p.SET_LIFECYCLE:return new c.Z(e).setLifecycle(t.uniqueId,t.lifecycle).setIsUploading().getState();default:throw Error("Invalid action type provided to the photoReducer")}},s);return(0,i.jsx)(x.Provider,{value:r,children:(0,i.jsx)(f.Provider,{value:d,children:n})})}function b(){let e=(0,o.useContext)(x);if(void 0===e)throw Error("usePhotoState must be used within <PhotoProvider>");return e}function y(){let e=(0,o.useContext)(f);if(void 0===e)throw Error("usePhotoDispatch must be used within <PhotoProvider>");return e}h.propTypes={value:u().object,children:u().node.isRequired}},68716:function(e,t,n){n.d(t,{Z:function(){return o}});var i=n(21403),a=n(81306);class o{abortUpload(e){let t=this.findIndex(e);return -1!==t&&this.state.photoFiles[t].abortController.abort(),this}append(e){return this.state.photoFiles=this.state.photoFiles.concat(e),this}assignUniqueName(){return this.state.photoFiles.forEach((e,t,n)=>{var i,o,s;e.uniqueId=e.uniqueId||(0,a.Ki)((null==e?void 0:null===(i=e.File)||void 0===i?void 0:i.name)||(null==e?void 0:null===(o=e.upload)||void 0===o?void 0:o.public_id)||(null==e?void 0:null===(s=e.upload)||void 0===s?void 0:s.legacyPath),n)}),this}clearAll(){return this.state.photoFiles.forEach(e=>{this.setLifecycle(e.uniqueId,i.TE.REMOVED),this.abortUpload(e.uniqueId)}),this}clearErrors(){return this.state.photoFiles=this.state.photoFiles.filter(e=>!e.errors.length),this}clearDeadPhotos(){return this.state.photoFiles=this.getValidPhotos(),this}errorOutExcessFiles(){let e=(0,a.Kh)(this.state.photoFiles);return e.forEach((e,t)=>{t>=this.state.maxFileCount&&e.setError(i.Q2.OVER_COUNT_LIMIT)}),this}getAbortController(){return this.state.photoFiles.forEach(e=>{e.abortController=e.abortController||new AbortController}),this}setError(e,t){let n=this.findIndex(e);return -1!==n&&this.state.photoFiles[n].setError(t),this}setIsHydrated(e){return this.state.isHydrated=e,this}setIsUploading(){for(let e=0;e<this.state.photoFiles.length;e++){let t=this.state.photoFiles[e];if(t.lifecycle===i.TE.UPLOADING||t.lifecycle===i.TE.CHOSEN&&!t.errors.length)return this.state.isUploading=!0,this}return this.state.isUploading=!1,this}setLifecycle(e,t){let n=this.findIndex(e);return -1!==n&&(this.state.photoFiles[n].lifecycle=t),this}findIndex(e){return this.state.photoFiles.findIndex(t=>t.uniqueId===e)}getValidPhotos(){return this.state.photoFiles.filter(e=>e.lifecycle!==i.TE.REMOVED&&e.lifecycle!==i.TE.ERROR)}getState(){return this.state}constructor(e){this.state={...e}}}},78088:function(e,t,n){n.d(t,{AX:function(){return p},Ex:function(){return f},Hs:function(){return d},Is:function(){return u},Lx:function(){return x},oj:function(){return m}});var i=n(82729),a=n(81621);function o(){let e=(0,i._)(["\n    mutation UPDATE_EMAIL_ADDRESS($input: UpdateEmailInput!) {\n        updateEmailAddress(input: $input)\n    }\n"]);return o=function(){return e},e}function s(){let e=(0,i._)(["\n    mutation VERIFY_EMAIL_UPDATE($input: VerifyEmailUpdateInput!) {\n        verifyEmailUpdate(input: $input)\n    }\n"]);return s=function(){return e},e}function r(){let e=(0,i._)(["\n    mutation CHANGE_PASSWORD($new: String!, $old: String!) {\n        changePassword(new: $new, old: $old)\n    }\n"]);return r=function(){return e},e}function l(){let e=(0,i._)(["\n    mutation UPDATE_USER($input: updateUserInput!) {\n        updateUser(input: $input) {\n            id\n        }\n    }\n"]);return l=function(){return e},e}function c(){let e=(0,i._)(["\n    query GET_FEDERATED_IDENTITIES_FOR_USER {\n        getFederatedIdentitiesForUser {\n            facebook\n            google\n            apple\n        }\n    }\n"]);return c=function(){return e},e}let d=(0,a.Ps)(o()),u=(0,a.Ps)(s()),m=(0,a.Ps)(r()),p=(0,a.Ps)(l()),x=(0,a.Ps)(c());function f(e){let t="",n="";e.forEach(e=>{let[[i,a]]=Object.entries(e);t+=", $".concat(i,": ").concat(a),n+=", ".concat(i,": $").concat(i)});let i="mutation UNSUBSCRIBE(".concat(h(t),") {\n    updateNotificationSetting(input: { ").concat(h(n)," }) {\n        jen\n        dailyEmail\n    }\n}");return(0,a.Ps)(i)}function h(e){return e.substring(2)}},31519:function(e,t,n){n.d(t,{Z:function(){return l}});var i=n(85893),a=n(45697),o=n.n(a),s=n(1283),r=n(44777);function l(e){let{post:t,feedId:n,showUnpin:a=!1,showPin:o=!1,disableEdit:l=!1}=e,c=(0,s.fm)(),d=[];return l||d.push({mode:s.oS.EDIT,text:"Edit"}),a&&d.push({mode:s.oS.UNPIN,text:"Unpin Post"}),o&&d.push({mode:s.oS.PIN,text:"Pin Post"}),d.push({mode:s.oS.DELETE,text:"Delete"}),(0,i.jsx)(r.Z,{items:d,onItemClick:e=>{let{mode:i}=e.item;return c({type:s.Ir.SET_VALUE,mode:i,post:t,feedId:n}),!1},id:"authorActions-".concat(null==t?void 0:t.id),"data-qa":"author-ellipsis-button"})}l.propTypes={post:o().object.isRequired,feedId:o().string,showUnpin:o().bool,showPin:o().bool,disableEdit:o().bool}},25456:function(e,t,n){var i=n(85893),a=n(36465),o=n.n(a),s=n(38183),r=n(9143),l=n(77386),c=n(54303),d=n(78604),u=n(67294),m=n(45697),p=n.n(m),x=n(88514),f=n(50319),h=n(80325),b=n(50178),y=n(36631),g=n(67304),v=n(2232),j=n(9779),w=n(78088),E=n(96491);let I=e=>{let{modal:t}=e,[n,a]=(0,u.useState)(""),[m,p]=(0,u.useState)(""),[I,S]=(0,u.useState)(!1),[_,k]=(0,u.useState)(!1),T=(0,E.Pe)(),N=(0,b.Ph)("siteId"),{data:C}=(0,g.Z)(N),{photo:M,notificationSetting:A}=(0,j.SE)(),{dailyEmail:D}=A,L=(0,j.O_)(),[P,{error:R,loading:B}]=(0,f.D)(x.P7,{onCompleted:()=>{T({event:E.kM.UNFOLLOW_SITE})}}),[O,{loading:U}]=(0,f.D)(w.AX,{onCompleted:()=>{L({type:j.xf.SET_VALUE,notificationSetting:{jen:!1,dailyEmail:D},photo:M}),k(!0),setTimeout(()=>{p(""),z()},3e3)},onError:e=>{a(e.message)}}),F=(0,u.useCallback)(()=>{let e=(null==M?void 0:M.publicId)||(null==M?void 0:M.legacyPath)?M:null;e?Object.hasOwn(e,"legacyPath")?e.legacyPath&&!e.publicId?O({variables:{input:{notificationSetting:{jen:!1,dailyEmail:D}}}}):e.publicId?(delete e.legacyPath,O({variables:{input:{notificationSetting:{jen:!1,dailyEmail:D},photo:e}}})):O({variables:{input:{notificationSetting:{jen:!1,dailyEmail:D}}}}):(null==e?void 0:e.publicId)?O({variables:{input:{notificationSetting:{jen:!1,dailyEmail:D},photo:e}}}):O({variables:{input:{notificationSetting:{jen:!1,dailyEmail:D}}}}):O({variables:{input:{notificationSetting:{jen:!1,dailyEmail:D}}}})},[D,O,M]),q=(0,u.useCallback)(async()=>{S(!0);try{await P({variables:{input:{context:h.Ie.AUTO_SUBSCRIBE_SITE_INTERACTION,siteId:N}},onCompleted(e){let{unfollowSite:t}=e;t.isFollowing||(p("You have been unfollowed from the site."),F())},refetchQueries:["GET_SITE_CORE","MY_SITES"]})}catch(e){a(e.message)}},[P,N,F]),z=()=>{t.isShowing&&t.toggleModal()};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Z,{isShowing:t.isShowing,setIsShowing:t.setIsShowing,onClickOverlay:t.toggleModal,children:(0,i.jsxs)(r.Z,{isForModal:!0,className:"autoFollowModalCard",children:[(0,i.jsx)("h4",{className:o().dynamic([["cb027963fddbe62",[v.Bs.SMALL]]]),children:"Thank you for commenting"}),(0,i.jsx)(l.Z,{"data-qa":"closeModal",onClick:z,disabled:B||U||I}),(0,i.jsxs)("p",{className:o().dynamic([["cb027963fddbe62",[v.Bs.SMALL]]])+" bodyCopy",children:["You are now following ",C.getSite.firstName,"'s CaringBridge. You will get a notification email when a new post is created."]}),(0,i.jsx)("div",{className:o().dynamic([["cb027963fddbe62",[v.Bs.SMALL]]])+" buttonRow",children:(0,i.jsxs)("div",{className:o().dynamic([["cb027963fddbe62",[v.Bs.SMALL]]])+" buttonGroup",children:[(0,i.jsx)(c.Z,{"data-qa":"followConfirmButton",onClick:z,disabled:B||U||I,children:"Yes, Follow"}),(0,i.jsx)("button",{"data-qa":"unfollowButton",onClick:q,disabled:B||U||I,className:o().dynamic([["cb027963fddbe62",[v.Bs.SMALL]]])+" button--asLink button--isClear displayBlock",children:"No thanks, unfollow"})]})}),m&&(0,i.jsx)(y.Z,{children:m}),n||R&&(0,i.jsx)(d.Z,{}),(0,i.jsx)("div",{className:o().dynamic([["cb027963fddbe62",[v.Bs.SMALL]]])+" "+((_?"loadingBar":"")||"")})]})}),(0,i.jsx)(o(),{id:"cb027963fddbe62",dynamic:[v.Bs.SMALL],children:".autoFollowModalCard{width:initial!important;padding-top:72px!important;padding-bottom:56px!important;padding-left:72px!important;padding-right:72px!important;height:auto;color:white;text-align:center;overflow:hidden}.bodyCopy.__jsx-style-dynamic-selector{width:380px}.buttonRow.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-top:36px;width:100%}.buttonGroup.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.displayBlock.__jsx-style-dynamic-selector{display:block}@-webkit-keyframes dismissLoading{from{width:100%}to{width:0%}}@-moz-keyframes dismissLoading{from{width:100%}to{width:0%}}@-o-keyframes dismissLoading{from{width:100%}to{width:0%}}@keyframes dismissLoading{from{width:100%}to{width:0%}}.loadingBar.__jsx-style-dynamic-selector{position:absolute;left:0;bottom:0;display:inline-block;height:4px;background-color:var(--success-400);width:0%;-webkit-animation-name:dismissLoading;-moz-animation-name:dismissLoading;-o-animation-name:dismissLoading;animation-name:dismissLoading;-webkit-animation-duration:3s;-moz-animation-duration:3s;-o-animation-duration:3s;animation-duration:3s}@media(max-width:".concat(v.Bs.SMALL,"){.autoFollowModalCard{padding-top:48px!important;padding-bottom:24px!important;padding-left:36px!important;padding-right:36px!important}.bodyCopy.__jsx-style-dynamic-selector{width:100%}}")})]})};t.Z=I,I.propTypes={modal:p().object.isRequired}},84318:function(e,t,n){n.d(t,{Z:function(){return p}});var i=n(85893),a=n(36465),o=n.n(a),s=n(9151),r=n(43323),l=n(45697),c=n.n(l),d=n(96970);function u(e){let{id:t,legacyPath:n,width:a,onClick:o,responsive:s,...r}=e;return(0,i.jsx)("button",{className:"button--isClear",onClick:e=>o(),...r,"aria-label":"View a larger version of this picture",children:(0,i.jsx)(d.Z,{id:t,legacyPath:n,width:a,responsive:s})})}u.propTypes={id:c().string,legacyPath:c().string,width:c().number.isRequired,onClick:c().func.isRequired,"data-qa":c().string.isRequired,responsive:c().bool};var m=n(10750);function p(e){let{thumbnailWidth:t,photos:n=[]}=e,a=(0,s.Yx)(),l=(0,m.Z)();if(!n.length)return null;let c=[...n],d=n.map(e=>()=>(0,i.jsx)(r.Z,{id:e.publicId,legacyPath:e.legacyPath,width:e.width,height:e.height,maxHeight:l})),p=e=>()=>{a({type:s.w7.LOAD_MEDIA_VIEWER,mediaList:d,mediaIndex:e})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"jsx-90dd3d5d3d6464a0 quadLayout",children:c.map((e,n)=>(0,i.jsx)(u,{id:e.publicId,legacyPath:e.legacyPath,width:t,onClick:p(n),"data-qa":"thumb-".concat(n)},e.publicId))}),(0,i.jsx)(o(),{id:"90dd3d5d3d6464a0",children:".quadLayout.jsx-90dd3d5d3d6464a0{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-moz-box-orient:horizontal;-moz-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;gap:12px}"})]})}p.propTypes={thumbnailWidth:c().number.isRequired,photos:c().arrayOf(c().object)}},49465:function(e,t,n){n.d(t,{Z:function(){return u}});var i=n(85893),a=n(67294),o=n(45697),s=n.n(o),r=n(57747),l=n(32883);let c=e=>{let{html:t,fontSize:n=16,maxLines:o=4,maxHeight:s=300}=e,[c,d]=(0,a.useState)(o),[u,m]=(0,a.useState)(!1),p=(0,a.useRef)(null);return(0,a.useLayoutEffect)(()=>{if(p.current){let{scrollHeight:e,clientHeight:t}=p.current;m(e>t||e>s)}},[t,s]),(0,i.jsxs)(r.xu,{children:[(0,i.jsx)(r.xu,{ref:p,noOfLines:c,dangerouslySetInnerHTML:{__html:t},style:{maxHeight:c?"".concat(s,"px"):"none",overflow:c?"hidden":"visible"}}),u&&(0,i.jsx)(l.r,{className:"readMoreToggle",textDecoration:"underline",as:"span",_hover:{color:"var(--link-hover-text)"},color:"var(--link-text)",fontSize:"".concat(n,"px"),onClick:()=>{d(c?void 0:o)},mt:"2",children:c?"Show more":"Show less"})]})};c.propTypes={html:s().string.isRequired,fontSize:s().number,maxLines:s().number,maxHeight:s().number};let d=e=>{let{contentData:t,maxLines:n=4,enableReadMore:a=!1}=e;return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"".concat(t.type,"Body ").concat("comment"===t.type?"test":""),"data-qa":"".concat(t.type,"Body-").concat(t.id),children:a?(0,i.jsx)(c,{html:t.html,maxLines:n}):(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:t.html}})})})};d.propTypes={contentData:s().object.isRequired,maxLines:s().number,enableReadMore:s().bool};var u=d},12189:function(e,t,n){n.d(t,{EV:function(){return i},R_:function(){return o},mb:function(){return s},ue:function(){return a}});let i={ERROR:"ERROR",SUCCESS:"SUCCESS",WARNING:"WARNING"},a={OFF:"OFF",JEN_ONLY:"JEN_ONLY",DAS_ONLY:"DAS_ONLY",JEN_DAS:"JEN_DAS"},o={[a.OFF]:{title:"Enable Notifications",message:"To follow this page, you need to turn on either or both of your profile’s email notification settings.",status:i.WARNING},[a.JEN_ONLY]:{title:"You’re Now Following!",message:"You'll get a notification email when a new post is created.",status:i.SUCCESS},[a.DAS_ONLY]:{title:"You’re Now Following!",message:"You’ll get a daily summary email when there is new activity.",status:i.SUCCESS},[a.JEN_DAS]:{title:"You’re Now Following!",message:"You'll get an email when an update is posted or when there is new activity.",status:i.SUCCESS}};function s(e){let t=!!(null==e?void 0:e.jen),n=!!(null==e?void 0:e.dailyEmail);return t?n?a.JEN_DAS:a.JEN_ONLY:n?a.DAS_ONLY:a.OFF}},45394:function(e,t,n){n.d(t,{Z:function(){return R}});var i=n(85893),a=n(36465),o=n.n(a),s=n(68862),r=n(88514),l=n(68602),c=n(1283),d=n(67294),u=n(54303),m=n(9143),p=n(43221),x=n(74769),f=n(38183),h=n(21403),b=n(45697),y=n.n(b),g=n(37413),v=n(49638),j=n(5152),w=n.n(j),E=n(50178),I=n(81306),S=n(50319),_=n(48683),k=n(11163),T=n(80325),N=n(96491),C=n(69880),M=n(67304);let A=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15e3,i=(0,d.useRef)(null),a=(0,d.useRef)(null),o=(0,d.useCallback)(async()=>{await e(),clearTimeout(i.current),clearTimeout(a.current),i.current=null,a.current=null},[e]),s=(0,d.useCallback)(()=>{clearTimeout(i.current),clearTimeout(a.current),i.current=null,a.current=null},[]),r=(0,d.useCallback)(()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(o,t),a.current||(a.current=setTimeout(o,n))},[o,t,n]);return(0,d.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[o]),{setAutoSaveTimeout:r,cancelAutoSave:s}};var D=n(12558),L=n(85991);let P=w()(()=>Promise.all([n.e(9774),n.e(253),n.e(6911),n.e(5311),n.e(5297),n.e(2292),n.e(9950)]).then(n.bind(n,19950)),{loadableGenerated:{webpack:()=>[19950]},ssr:!1});function R(){let{mode:e,post:t}=(0,c.Ei)();if([c.oS.ADD,c.oS.EDIT,c.oS.DRAFT].includes(e))return(0,i.jsx)(l.TV,{value:{uploadType:h.mu.JOURNAL_POST,maxFileCount:6},children:(0,i.jsx)(B,{mode:e,post:t})})}function B(e){var t,n,a,h,b;let{mode:y,post:j}=e,[w,R]=(0,d.useState)(null!==(t=null==j?void 0:j.id)&&void 0!==t?t:null),[B,O]=(0,d.useState)(null!==(n=null==j?void 0:j.title)&&void 0!==n?n:(0,s.p6)(s.yi.FULL)),[U,F]=(0,d.useState)(null!==(a=null==j?void 0:j.body)&&void 0!==a?a:""),[q,z]=(0,d.useState)(null!==(h=null==j?void 0:j.photos.map(e=>e.publicId))&&void 0!==h?h:[]),[Z,V]=(0,d.useState)(null!==(b=null==j?void 0:j.savedAsDraftAt)&&void 0!==b?b:null),[$,H]=(0,d.useState)(y===c.oS.DRAFT&&(null==j?void 0:j.savedAsDraftAt)),[G,Y]=(0,d.useState)(""),W=(0,l.XX)(),J=(0,l.zW)(),K=(0,c.fm)(),Q=(0,k.useRouter)(),X=(0,N.Pe)(),[ee,et]=(0,d.useState)(null),[en,ei]=(0,d.useState)(!1),[ea,eo]=(0,d.useState)(!1),[es,er]=(0,d.useState)(!1),el=(0,E.Ph)("siteId"),{data:ec}=(0,M.Z)(el),{activeTab:ed}=(0,c.Ei)(),eu=(0,c.fm)(),{refetchDrafts:em}=(0,L.f)(),ep=[];"ALL"===ed&&ep.push("GET_FEED"),ed===T.u5.POST&&ep.push("GET_SITE_PAGE");let ex=(0,d.useCallback)(()=>{let e=(0,I.Kh)(W.photoFiles),t={content:{body:U,title:B}};t.content.body=t.content.body.replace(/<p><\/p>/g,"<br/>");let n=[],i=e.reduce((e,t)=>(t.upload&&(t.upload.legacyPath&&!t.upload.public_id?n.includes(t.upload.legacyPath)||n.push(t.upload.legacyPath):t.upload.public_id&&e.push({publicId:t.upload.public_id,width:t.upload.width,height:t.upload.height})),e),[]);return t.content.photos=i,y===c.oS.ADD?t.siteId=el:y===c.oS.EDIT?(t.id=w,n.length>0&&(t.legacyPhotoPaths=n.filter(e=>!t.content.photos.some(t=>t.legacyPath===e)))):y===c.oS.DRAFT&&(w?t.id=w:t.siteId=el),t},[U,W.photoFiles,w,el,B,y]),ef=()=>{"ALL"===ed?eu({type:c.Ir.SET_VALUE,isDirtyPosts:!0}):eu({type:c.Ir.SET_VALUE,isDirtyFeed:!0})},eh=()=>{X({event:N.kM.JOURNAL_ENTRY,event_action:(0,I.Kh)(W.photoFiles).length>0?"media":"text"}),X({posts_on_site:ec.getSite.postConnection.totalCount+1}),ew(),ef(),Q.pathname!==E.Z6.SITE_HOME_PAGE&&(0,E.Eh)((0,E.G3)(E.Z6.SITE_HOME_PAGE,el))},[eb,ey]=(0,S.D)(r.Sx,{onCompleted:e=>{if(y===c.oS.DRAFT&&!en){R(e.createPost.id),V(e.createPost.savedAsDraftAt),H(!1),em(),X({event:N.kM.DRAFT_POST_CREATED});return}eh()},onError:e=>{Y(e.message)},refetchQueries:ep,update:e=>{e.modify({id:e.identify({__typename:"Site",id:el}),fields:{postConnection(e){if(e)return{posts:e.posts,totalCount:e.totalCount+1}}}})}}),[eg,ev]=(0,S.D)(r.vG,{onCompleted:e=>{if(y===c.oS.DRAFT){if(en)eh();else{V(e.updatePost.savedAsDraftAt),H(!1),X({event:N.kM.DRAFT_POST_UPDATED});return}}ew(),ef(),X({event:N.kM.JOURNAL_ENTRY_EDITED})},onError:e=>{Y(e.message)},refetchQueries:ep}),[ej]=(0,S.D)(r.Xv,{onCompleted:()=>{ew(),X({event:N.kM.DRAFT_POST_DELETED})},onError:e=>{Y(e.message)},refetchQueries:ep});(0,d.useEffect)(()=>{y===c.oS.DRAFT&&eE()&&ea?eS():e_(),eo(!0)},[U,B]),(0,d.useEffect)(()=>{if(y!==c.oS.DRAFT||!eE())return;let e=(0,I.Kh)(W.photoFiles).map(e=>{var t;return null===(t=e.upload)||void 0===t?void 0:t.public_id}).filter(e=>!!e),t=JSON.stringify(e)!==JSON.stringify(q);t&&(z(e),eS())},[JSON.stringify(W.photoFiles)]),(0,d.useEffect)(()=>{if([c.oS.EDIT,c.oS.DRAFT].includes(y)){var e;J({type:l.yx.HYDRATE,photos:null!==(e=null==j?void 0:j.photos)&&void 0!==e?e:[]})}},[y,J,j]);let ew=async()=>{e_(),K({type:c.Ir.RESET}),em()},eE=(0,d.useCallback)(()=>{let e=(0,I.Kh)(W.photoFiles).length>0,t=(0,C.tL)(U);return!(0,C.fp)(B)&&W.isHydrated&&!W.isUploading&&(e||!t)},[W.photoFiles,W.isUploading,W.isHydrated,U,B]),eI=(0,d.useCallback)(async()=>{if(!eE())return;let e=ex(),t=e.content!==(null==ee?void 0:ee.content),n=ey.loading||ev.loading;if(t&&!n)try{let t=w?eg:eb;t({variables:{input:{...e,isDraft:!0}}}),et(e)}catch(e){Y("Failed to save the draft.")}},[ex,ey.loading,ev.loading,w,eg,eb,ee,eE]),{setAutoSaveTimeout:eS,cancelAutoSave:e_}=A(eI),ek=()=>{y===c.oS.DRAFT&&eE()?(e_(),er(!0)):ew()},eT=Z?"".concat($?"Restored from a draft saved":"Autosaved"," ").concat((0,D.Q)(Z,{addSuffix:!0})):null;if(es){let e="draftConfirm";return(0,i.jsx)(f.Z,{isShowing:!0,setIsShowing:()=>{},shouldCloseOnEscape:!1,children:(0,i.jsxs)(m.Z,{isForModal:!0,isDismissible:!0,onDismiss:()=>er(!1),style:{maxWidth:"480px",paddingBottom:"55px"},children:[(0,i.jsx)("h5",{className:"center","data-qa":"".concat(e,"Title"),children:"Save this post as a draft?"}),(0,i.jsx)("p",{className:"center","data-qa":"".concat(e,"Description"),children:"You will be able to resume where you left off the next time you create a post."}),(0,i.jsxs)("div",{className:"center buttonGroup",children:[(0,i.jsx)(u.Z,{"data-qa":"".concat(e,"Save"),onClick:()=>{eI(),ew()},children:"Save as Draft"}),(0,i.jsx)(u.Z,{"data-qa":"".concat(e,"KeepEditing"),variant:u.c.SECONDARY,onClick:()=>er(!1),children:"Keep Editing"})]}),(0,i.jsx)("div",{className:"center",children:(0,i.jsx)("button",{"data-qa":"".concat(e,"Discard"),className:"button--asLink button--isClear marginTop--24",onClick:()=>{w&&ej({variables:{input:{id:w}}}),ew()},children:"Discard"})})]})})}return(0,i.jsxs)(f.Z,{isShowing:!es,setIsShowing:ek,children:[(0,i.jsx)("div",{className:"jsx-c5d6a287899dce8 cardWidth",children:(0,i.jsxs)(m.Z,{isForModal:!0,isDismissible:!0,onDismiss:ek,children:[(0,i.jsx)("h1",{className:"jsx-c5d6a287899dce8 h5",children:y===c.oS.EDIT?"Edit Post":"Create a Post"}),(0,i.jsx)(x.Z,{label:"Title",required:!0,"data-qa":"postTitle",value:B,maxLength:50,onChange:e=>{O(e)}}),(0,i.jsx)("div",{"data-qa":"postBody",className:"jsx-c5d6a287899dce8",children:(0,i.jsx)(P,{postHtml:U,setPostHtml:e=>{e!==U&&F(e)},infoMessage:eT})}),(0,i.jsx)(g.Z,{}),(0,i.jsx)("div",{className:"jsx-c5d6a287899dce8 marginTop--24",children:(0,i.jsxs)("div",{className:"jsx-c5d6a287899dce8 buttonContainer",children:[(0,i.jsx)("div",{className:"jsx-c5d6a287899dce8 spacer"}),ey.loading||ev.loading?(0,i.jsx)(()=>y!==c.oS.DRAFT||en?(0,i.jsx)(v.ZP,{}):(0,i.jsx)("span",{children:"Autosaving..."}),{className:"jsx-c5d6a287899dce8"}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_.Z,{"data-qa":"publishPostCancel",onClick:ek,children:"Cancel"}),(0,i.jsx)(u.Z,{"data-qa":"publishPost",onClick:()=>{ei(!0),Y("");let e=ex(),t=null;y!==c.oS.ADD&&(y!==c.oS.DRAFT||w)?t=eg:(e_(),t=eb),y===c.oS.DRAFT&&(e.isDraft=!1),t({variables:{input:e}})},disabled:!eE(),children:(0,i.jsx)("i",{className:"jsx-c5d6a287899dce8 fa-paper-plane fa-fw fa-solid"})})]})]})}),G&&(0,i.jsx)(p.Z,{children:G})]})}),(0,i.jsx)(o(),{id:"c5d6a287899dce8",children:".postBody>p{margin:15px 0!important;display:flow-root}h1.jsx-c5d6a287899dce8{margin-top:0}.cardWidth.jsx-c5d6a287899dce8{max-width:720px}.buttonContainer.jsx-c5d6a287899dce8{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:24px;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;min-height:40px}.spacer.jsx-c5d6a287899dce8{-webkit-box-flex:1;-webkit-flex-grow:1;-moz-box-flex:1;-ms-flex-positive:1;flex-grow:1}"})]})}B.propTypes={mode:y().string.isRequired,post:y().object,refetchQuery:y().string}},50668:function(e,t,n){n.d(t,{Z:function(){return h}});var i=n(85893),a=n(36465),o=n.n(a),s=n(88514),r=n(1283),l=n(45697),c=n.n(l),d=n(54303),u=n(9143),m=n(38183),p=n(49638),x=n(50319),f=n(96491);function h(){var e;let t=(0,r.Ei)(),n=(0,r.fm)(),a=(0,f.Pe)(),[l,{loading:c}]=(0,x.D)(s.Xv,{onCompleted:()=>{a({event:f.kM.JOURNAL_ENTRY_DELETED}),g()},onError:e=>{console.log(e.message)},refetchQueries:[s.fo.GET_SITE_PAGE,s.fo.GET_FEED],awaitRefetchQueries:!0,update:(e,n)=>{e.evict({id:t.feedId}),e.evict({id:"Post:".concat(n.data.deletePost)})}}),[h,{loading:b}]=(0,x.D)(s.QW,{onCompleted:()=>{a({event:f.kM.JOURNAL_ENTRY_DELETED}),g()},onError:e=>{console.log(e.message)},refetchQueries:[s.fo.GET_SITE_PAGE,s.fo.GET_FEED],awaitRefetchQueries:!0,update:e=>{e.evict({id:t.feedId})}}),y=()=>{n({type:r.Ir.RESET})},g=()=>{y()};return(0,i.jsxs)(m.Z,{isShowing:t.mode===r.oS.DELETE,setIsShowing:y,children:[(0,i.jsxs)(u.Z,{isForModal:!0,className:"modalContent",children:[(0,i.jsx)("h1",{className:"jsx-f2e57bebd7d6e52b h2",children:"Are you sure you want to delete this post?"}),(0,i.jsx)("h5",{className:"jsx-f2e57bebd7d6e52b",children:null===(e=t.post)||void 0===e?void 0:e.title}),(0,i.jsx)("p",{className:"jsx-f2e57bebd7d6e52b",children:"Your post and any related comments will be removed permanently. This action cannot be undone."}),(0,i.jsxs)("div",{className:"jsx-f2e57bebd7d6e52b buttonContainer",children:[(0,i.jsx)("div",{className:"jsx-f2e57bebd7d6e52b spacer"}),b||c?(0,i.jsx)(p.ZP,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{onClick:g,className:"jsx-f2e57bebd7d6e52b button--isClear button--asStylizedLink",children:"Cancel"}),(0,i.jsx)(d.Z,{"data-qa":"publishPost",onClick:()=>{"WaysToHelpPost"===t.post.__typename?h({variables:{input:{id:t.post.id,feedId:t.feedId}}}):l({variables:{input:{id:t.post.id}}})},children:"Delete Post"})]})]})]}),(0,i.jsx)(o(),{id:"f2e57bebd7d6e52b",children:"h1.jsx-f2e57bebd7d6e52b{margin-top:0}.modalContent{max-width:720px}.buttonContainer.jsx-f2e57bebd7d6e52b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:24px}.spacer.jsx-f2e57bebd7d6e52b{-webkit-box-flex:1;-webkit-flex-grow:1;-moz-box-flex:1;-ms-flex-positive:1;flex-grow:1}"})]})}h.propTypes={postType:c().string}},75544:function(e,t,n){n.d(t,{Z:function(){return G}});var i=n(85893),a=n(36465),o=n.n(a),s=n(1283),r=n(50178),l=n(2232),c=n(41664),d=n.n(c),u=n(25675),m=n.n(u),p=n(39332),x=n(80325),f=n(44441),h=n(28216),b=n(50319),y=n(9779),g=n(45697),v=n.n(g),j=n(67294),w=n(96491),E=n(7438),I=n(69692),S=n(88514),_=n(12189),k=n(49638),T=n(54303),N=n(78604),C=n(1706),M=n(78088);let A={[_.EV.ERROR]:{icon:"fa-circle-info",status:"error"},[_.EV.SUCCESS]:{icon:"fa-circle-check",status:"success"},[_.EV.WARNING]:{icon:"fa-message-question ",status:"warning"}};function D(e){let{title:t,message:n,status:a}=e,s=A[a];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"jsx-12519261f1e44c78 "+"".concat(s.status," title"),children:[(0,i.jsx)("i",{className:"jsx-12519261f1e44c78 "+"".concat(s.icon," fa-light")}),t]}),(0,i.jsx)("div",{className:"jsx-12519261f1e44c78 message",children:n}),(0,i.jsx)(o(),{id:"12519261f1e44c78",children:"i.jsx-12519261f1e44c78{margin-right:12px}.title.jsx-12519261f1e44c78{font-size:20px;margin-bottom:10px}.message.jsx-12519261f1e44c78{font-size:16px}.error.jsx-12519261f1e44c78{color:var(--error-500)}.success.jsx-12519261f1e44c78{color:var(--success-500)}.warning.jsx-12519261f1e44c78{color:var(--warning-500)}"})]})}function L(e){let{notificationPreference:t,vpWidth:n,onClose:a,setIsFollower:s,setCurrentAction:c,handleNotificationChanges:u}=e,{photo:m,notificationSetting:p}=(0,y.SE)(),{jen:x,dailyEmail:f}=p,[h,g]=(0,j.useState)(x),[v,E]=(0,j.useState)(f),I=(0,y.O_)(),S=(0,w.Pe)(),[k,{loading:A,error:L}]=(0,b.D)(M.AX,{onCompleted:()=>{let e={jen:h,dailyEmail:v};I({type:y.xf.SET_VALUE,notificationSetting:e,photo:m}),(h||v)&&(u(),s(!0),S({event:w.kM.EMAIL_SUBSCRIPTION,event_action:w.RC[(0,_.mb)({jen:h,dailyEmail:v})],subscription:w.RC[(0,_.mb)(e)]})),h&&v||(S({event:w.kM.EMAIL_UNSUBSCRIPTION,event_action:w.RC[(0,_.mb)({jen:h,dailyEmail:v})],subscription:w.RC[(0,_.mb)(e)]}),h||v||c("unfollow"))},onError:e=>{console.log("Error occurred when attempting to call mutation UPDATE_USER from FollowPopover.js\n".concat(JSON.stringify(e)))}}),P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,n=m.publicId||m.legacyPath?m:null;n?Object.hasOwn(n,"legacyPath")?n.legacyPath&&!n.publicId?k({variables:{input:{notificationSetting:{jen:e,dailyEmail:t}}}}):n.publicId?(delete n.legacyPath,k({variables:{input:{notificationSetting:{jen:e,dailyEmail:t},photo:n}}})):k({variables:{input:{notificationSetting:{jen:e,dailyEmail:t}}}}):(null==n?void 0:n.publicId)?k({variables:{input:{notificationSetting:{jen:e,dailyEmail:t},photo:n}}}):k({variables:{input:{notificationSetting:{jen:e,dailyEmail:t}}}}):k({variables:{input:{notificationSetting:{jen:e,dailyEmail:t}}}})},R=_.R_[t];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]])+" popoverContainer",children:[(0,i.jsx)("div",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]])+" message",children:(0,i.jsx)(D,{title:R.title,message:R.message,status:R.status})}),n<l.aV.MEDIUM&&t===_.ue.OFF&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]])+" flexbox-space-between small toggleRow",children:[(0,i.jsx)("p",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]]),children:"New journal post created"}),(0,i.jsx)(C.Z,{display:C.P.INLINE,isChecked:h,onChange:e=>{g(e),P(e)},"data-qa":"newJournalUpdate",disabled:A||!!L})]}),(0,i.jsxs)("div",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]])+" flexbox-space-between small toggleRow",children:[(0,i.jsx)("p",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]]),children:"Daily summary of visitor activity"}),(0,i.jsx)(C.Z,{display:C.P.INLINE,isChecked:v,onChange:e=>{E(e),P(h,e)},"data-qa":"activitySummaryUpdate",disabled:A||!!L})]})]}),n>=l.aV.MEDIUM&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]])+" flexbox-space-between small toggleRow",children:[(0,i.jsx)("p",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]]),children:"New journal post created"}),(0,i.jsx)(C.Z,{display:C.P.INLINE,isChecked:h,onChange:e=>{g(e),P(e)},"data-qa":"newJournalUpdate",disabled:A||!!L})]}),(0,i.jsxs)("div",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]])+" flexbox-space-between small toggleRow",children:[(0,i.jsx)("p",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]]),children:"Daily summary of visitor activity"}),(0,i.jsx)(C.Z,{display:C.P.INLINE,isChecked:v,onChange:e=>{E(e),P(h,e)},"data-qa":"activitySummaryUpdate",disabled:A||!!L})]})]}),n<l.aV.MEDIUM?(0,i.jsxs)("div",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]])+" btnContainer",children:[(0,i.jsx)(d(),{href:r.Z6.PROFILE_SETTINGS_NOTIFICATIONS,"data-qa":"notificationPref",children:"Notification Preferences"}),(0,i.jsx)(T.Z,{"data-qa":"followBtn",onClick:a,children:"Close"}),L&&(0,i.jsx)(N.Z,{})]}):(0,i.jsxs)("div",{className:o().dynamic([["bf9e1ee9b3a1fa66",[l.Bs.MEDIUM]]])+" btnContainer",children:[(0,i.jsx)(T.Z,{variant:T.c.SECONDARY,"data-qa":"closeFollowBtn",onClick:a,children:R.status===_.EV.SUCCESS?"Close":"Cancel"}),L&&(0,i.jsx)(N.Z,{})]})]}),(0,i.jsx)(o(),{id:"bf9e1ee9b3a1fa66",dynamic:[l.Bs.MEDIUM],children:".popoverContainer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.btnContainer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:end;-webkit-align-items:flex-end;-moz-box-align:end;-ms-flex-align:end;align-items:flex-end;gap:24px}.toggleRow.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;gap:24px}.message.__jsx-style-dynamic-selector{width:240px}@media(min-width:".concat(l.Bs.MEDIUM,"){.popoverContainer.__jsx-style-dynamic-selector{width:100%;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}.message.__jsx-style-dynamic-selector{text-align:center;max-width:350px}.btnContainer.__jsx-style-dynamic-selector{margin-top:16px;margin-bottom:10px}.contentContainer.__jsx-style-dynamic-selector{-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center}.toggleRow.__jsx-style-dynamic-selector{width:350px}.toggleRow.__jsx-style-dynamic-selector+.toggleRow.__jsx-style-dynamic-selector{border-top:thin solid var(--gray-300)}.toggleRow.__jsx-style-dynamic-selector>p.__jsx-style-dynamic-selector{width:248px}}")})]})}function P(e){let{onClose:t,handleClick:n}=e;return(0,i.jsxs)("div",{className:o().dynamic([["1e2056e0a39bcc56",[l.Bs.MEDIUM]]])+" popoverContainer",children:[(0,i.jsx)("div",{className:o().dynamic([["1e2056e0a39bcc56",[l.Bs.MEDIUM]]])+" message",children:(0,i.jsx)(D,{title:"Are you sure?",message:"You will no longer receive updates if you unfollow.",status:_.EV.WARNING})}),(0,i.jsxs)("div",{className:o().dynamic([["1e2056e0a39bcc56",[l.Bs.MEDIUM]]])+" btnContainer",children:[(0,i.jsx)(T.Z,{variant:T.c.SECONDARY,"data-qa":"unfollowBtn",onClick:n,children:"Unfollow"}),(0,i.jsx)(T.Z,{variant:T.c.PRIMARY,"data-qa":"closeFollowBtn",onClick:t,children:"Cancel"})]}),(0,i.jsx)(o(),{id:"1e2056e0a39bcc56",dynamic:[l.Bs.MEDIUM],children:".popoverContainer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.btnContainer.__jsx-style-dynamic-selector{margin-top:14px;margin-bottom:10px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:20px;-webkit-box-pack:end;-webkit-justify-content:flex-end;-moz-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-align:end;-webkit-align-items:flex-end;-moz-box-align:end;-ms-flex-align:end;align-items:flex-end}.message.__jsx-style-dynamic-selector{width:250px;margin-left:12px}@media(min-width:".concat(l.Bs.MEDIUM,"){.popoverContainer.__jsx-style-dynamic-selector{-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}.message.__jsx-style-dynamic-selector{text-align:center;max-width:100%}.btnContainer.__jsx-style-dynamic-selector{-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center}}")})]})}D.propTypes={title:v().string.isRequired,message:v().string.isRequired,status:v().string.isRequired},L.propTypes={notificationPreference:v().string.isRequired,vpWidth:v().number.isRequired,onClose:v().func.isRequired,setIsFollower:v().func.isRequired,setCurrentAction:v().func.isRequired,handleNotificationChanges:v().func.isRequired},P.propTypes={onClose:v().func.isRequired,handleClick:v().func.isRequired};var R=n(43221),B=n(73552);function O(e){let{page:t,menuBtnRef:n}=e,a=(0,w.Pe)(),{notificationSetting:s,isSignedIn:c}=(0,y.SE)(),d=(0,I.Z)(),[u,p]=(0,j.useState)(null==t?void 0:t.isFollower),[f,h]=(0,j.useState)(""),[g,v]=(0,j.useState)(!1),[T,N]=(0,j.useState)(u?"unfollow":"follow"),C=(0,j.useRef)(null),M=(0,_.mb)(s),A=M===_.ue.OFF,D=!!(0,r.Ph)(r.Tx.FOLLOW),O=u?"fa-circle-check":"fa-user-plus",[U,{error:F,called:q,loading:z}]=(0,b.D)(S.Gi,{refetchQueries:[{query:B.j},{query:S.EF,variables:{siteId:null==t?void 0:t.id}}]}),[Z,{error:V,loading:$}]=(0,b.D)(S.P7,{refetchQueries:[{query:B.j},{query:S.EF,variables:{siteId:null==t?void 0:t.id}}]});(0,j.useEffect)(()=>{p(null==t?void 0:t.isFollower)},[null==t?void 0:t.isFollower]),(0,j.useEffect)(()=>{let e=async()=>{u||(v(!0),A||await U({variables:{input:{context:x.Ie.FOLLOW_BUTTON,siteId:null==t?void 0:t.id}}})),(0,r.aX)()};!D||q||z||e()},[q,D,U,A,u,z,t.id]);let H=(0,j.useCallback)(async(e,n,i)=>{try{let o=await n({variables:{input:{context:x.Ie.FOLLOW_BUTTON,siteId:null==t?void 0:t.id}}}),s="follow"===e?null==o?void 0:o.data.followSite.isFollowing:!(null==o?void 0:o.data.unfollowSite.isFollowing);N(e),s&&("follow"===e?a({event:i,autoFollow:!1}):(a({event:i}),v(!1))),p("follow"===e),f&&h("")}catch(e){h(e.message),v(!0)}},[a,f,null==t?void 0:t.id]),G=(0,j.useCallback)(async()=>{if(!c){(0,r.Eu)({[r.Tx.FOLLOW]:!0},!1,void 0);return}if(A){N(u?"unfollow":"follow"),v(!0),f&&h("");return}if(u)v(e=>!e);else try{N("follow");let e=await U({variables:{input:{context:x.Ie.FOLLOW_BUTTON,siteId:null==t?void 0:t.id}}});(null==e?void 0:e.data.followSite.isFollowing)&&(v(!0),a({event:w.kM.FOLLOW_SITE,autoFollow:!1}),p(!0)),f&&h("")}catch(e){h(e)}},[c,null==t?void 0:t.id,u,f,a,A,U]),Y=(0,j.useCallback)(()=>{v(!1)},[]);return(0,i.jsxs)("div",{className:"jsx-65a8d9072b82938c followBtnContainer",children:[(0,i.jsxs)("button",{id:"FollowButton",ref:C,"data-qa":"followPageBtn",onClick:G,disabled:g,className:"jsx-65a8d9072b82938c button--isClear menuLink",children:[(0,i.jsx)("i",{className:"jsx-65a8d9072b82938c "+"".concat(O," fa-solid sideNavIcon")}),(0,i.jsx)("span",{className:"jsx-65a8d9072b82938c menuText",children:u?"Following":"Follow this page"})]}),(n||C)&&(0,i.jsx)(E.J,{anchor:d<l.aV.MEDIUM&&null!=n?n:C.current,show:g,position:d<l.aV.MEDIUM?"bottom":"right",positionMode:"absolute",children:(0,i.jsxs)("div",{className:"jsx-65a8d9072b82938c popoverContent",children:[F?(0,i.jsxs)(R.Z,{children:["Follow failed: ",f]}):V?(0,i.jsxs)(R.Z,{children:["Unfollow failed: ",f]}):z||$?(0,i.jsx)("div",{className:"center",children:(0,i.jsx)(k.ZP,{})}):"follow"!==T&&(u||"unfollow"===T)?"unfollow"===T||u&&"follow"!==T?(0,i.jsx)(P,{onClose:Y,handleClick:()=>H("unfollow",Z,w.kM.UNFOLLOW_SITE)}):(0,i.jsx)(i.Fragment,{}):(0,i.jsx)(L,{notificationPreference:M,vpWidth:d,onClose:Y,setIsFollower:p,setCurrentAction:N,handleNotificationChanges:()=>H("follow",U,w.kM.FOLLOW_SITE)}),(0,i.jsx)("div",{className:"jsx-65a8d9072b82938c",children:(0,i.jsx)(m(),{src:"/img/followClose.svg",width:14,height:14,alt:"",onClick:()=>Y()})})]})}),(0,i.jsx)(o(),{id:"65a8d9072b82938c",children:"button.jsx-65a8d9072b82938c{width:100%;text-align:inherit;line-height:inherit}.popoverContent.jsx-65a8d9072b82938c{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center}"})]})}O.propTypes={page:v().object,menuBtnRef:v().object};var U=n(32376),F=n(13681),q=n(94184),z=n.n(q),Z=n(81537),V=n(67304),$=n(85991),H=n(24880);function G(){var e,t,n,a,c;let u=(0,h.Z)(),b=(0,r.Ph)("siteId"),y=(0,s.fm)(),{data:g,loading:v}=(0,V.Z)(b),{draftsData:w}=(0,$.f)(),E=(0,Z.c)(Z.T.GO_FUND_ME),I=(0,Z.c)(Z.T.MEAL_TRAIN),S=(null==g?void 0:null===(e=g.getSite)||void 0===e?void 0:e.privacy)===x.uk.HIGH||v,_=null==g?void 0:null===(t=g.getSite)||void 0===t?void 0:t.isAuthor,k=null!==(c=(null==g?void 0:null===(n=g.getSite)||void 0===n?void 0:n.isShareableByVisitor)&&!S)&&void 0!==c&&c,T=(0,r.G3)(r.Z6.SITE_HOME_PAGE,{siteId:b}),N=(0,p.usePathname)(),[C,M]=(0,j.useState)(!0),A=(0,j.useRef)(null),D=(0,j.useRef)(null),L=()=>M(e=>!e),P=(0,j.useId)(),R=z()({open:C,closed:!C}),B=(null==w?void 0:null===(a=w.getDrafts)||void 0===a?void 0:a.drafts)||[];return(0,F.K)(C,[D,A],L),(0,i.jsxs)("div",{id:"siteActions",className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" "+(R||""),children:[(0,i.jsxs)("div",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:[(0,i.jsx)("h6",{style:{whiteSpace:"pre-wrap"},className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" navHeadline",children:_?"Manage my page":"Show your support for ".concat(null==g?void 0:g.getSite.firstName)}),(0,i.jsx)("button",{onClick:L,ref:e=>(D&&(D.current=e),D),"aria-expanded":C,"aria-controls":P,"data-qa":"settingsDropdownMenu",className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" button--isClear navBtn ddmCenterIcon",children:(0,i.jsxs)("p",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:[_?"Manage my page":"Show your support for ".concat(null==g?void 0:g.getSite.firstName)," ",C?(0,i.jsx)("i",{"data-qa":"settingsDropdownMenuUpArrow",className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" fa-chevron-up fa-solid"}):(0,i.jsx)("i",{"data-qa":"settingsDropdownMenuDownArrow",className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" fa-chevron-down fa-solid"})," "]})})]}),(0,i.jsxs)("ul",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" plainList",children:[_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("li",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:(0,i.jsxs)("button",{id:"CreatePostButton","data-qa":"createPostBtn",onClick:e=>{e.stopPropagation();let t=null==B?void 0:B[0];y({type:s.Ir.SET_VALUE,mode:s.oS.DRAFT,post:t})},className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" button--isClear menuLink",children:[(0,i.jsx)("i",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" fa-pen fa-solid sideNavIcon"}),(0,i.jsx)("span",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" menuText",children:"Create a post"}),B.length>0&&(0,i.jsx)(H.C,{variant:"secondary",children:"Draft"})]})}),(0,i.jsx)("li",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:(0,i.jsxs)(d(),{"data-qa":"addCoAuthorBtn",href:(0,r.G3)(r.Z6.SITE_SETTINGS_AUTHORS,b),className:"a--isClear menuLink ",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)("i",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" fa-users fa-solid sideNavIcon"}),(0,i.jsx)("span",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" menuText",children:"Add a Co-Author"})]})})]}),_||(0,i.jsxs)("li",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:[" ",(0,i.jsx)(O,{page:null==g?void 0:g.getSite,menuBtnRef:D.current})]}),(k||_)&&(0,i.jsx)("li",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:(0,i.jsxs)("button",{"data-qa":"sharePageBtn",onClick:e=>{e.stopPropagation(),u.toggleModal()},className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" button--isClear menuLink",children:[(0,i.jsx)("i",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" fa-share fa-solid sideNavIcon"}),(0,i.jsx)("span",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" menuText",children:_?"Share my page":"Share this page"})]})}),(E||I)&&(0,i.jsx)("li",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:(0,i.jsxs)(d(),{"data-qa":"waysToHelpPageLinkButton",href:(0,r.G3)(r.Z6.SITE_WAYS_TO_HELP,b),className:"a--isClear menuLink ",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)("i",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" fa-heart-circle-plus fa-solid sideNavIcon"}),(0,i.jsx)("span",{"data-qa":"waysToHelpPageLinkButtonText",className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" menuText",children:_?"Ways to get help":"Ways to help"})]})}),_&&(0,i.jsx)("li",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:(0,i.jsxs)(d(),{"data-qa":"pageSettingsBtn",href:(0,r.G3)(r.Z6.SITE_SETTINGS_GENERAL,b),className:"a--isClear menuLink ",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)("i",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" fa-gear fa-solid sideNavIcon"}),(0,i.jsx)("span",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" menuText",children:"Page Settings"})]})}),T!==N&&(0,i.jsx)("li",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]]),children:(0,i.jsxs)(d(),{className:"a--isClear menuLink ",href:T,"data-qa":"menuLinkHomePage",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(m(),{className:"menuLogo",src:"/img/menu-show-all-posts.svg",alt:"",width:28,height:14}),(0,i.jsx)("span",{className:o().dynamic([["d942dfc058a05cc",[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM]]])+" menuText",children:"View all posts"})]})})]}),(0,i.jsx)(f.Z,{modalController:u,siteId:b,origin:U.Y.PRIVATE_HOME_PAGE}),(0,i.jsx)(o(),{id:"d942dfc058a05cc",dynamic:[l.Bs.SMALL,l.Bs.MEDIUM,l.Bs.MEDIUM],children:"#siteActions.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}h6.__jsx-style-dynamic-selector{white-space:nowrap}ul.__jsx-style-dynamic-selector{display:inline-block;color:var(--body-text);-webkit-border-radius:var(--border-radius);-moz-border-radius:var(--border-radius);border-radius:var(--border-radius)}li.__jsx-style-dynamic-selector:hover{color:var(--berry-bridge-500)}button.__jsx-style-dynamic-selector{width:100%;text-align:inherit;line-height:inherit;font-weight:var(--font-weight-medium)}.menuLogo{padding-right:4px}.menuLink{height:100%;display:block;padding:6px 0px;white-space:nowrap;-webkit-border-radius:inherit;-moz-border-radius:inherit;border-radius:inherit;-webkit-transition:all var(--speed-on-hover)linear;-moz-transition:all var(--speed-on-hover)linear;-o-transition:all var(--speed-on-hover)linear;transition:all var(--speed-on-hover)linear;font-weight:var(--font-weight-medium)}.menuLink:hover{background-color:var(--body-bg);color:var(--berry-bridge-500)}.sideNavIcon{vertical-align:-2px;width:24px}.menuText{white-space:nowrap;padding-left:3px;font-weight:var(--font-weight-medium)}@media(max-width:".concat(l.Bs.SMALL,"){.open.__jsx-style-dynamic-selector>ul.__jsx-style-dynamic-selector{min-width:100vw;background-color:white;margin-top:0px}}@media(max-width:").concat(l.Bs.MEDIUM,"){.navHeadline.__jsx-style-dynamic-selector{display:none}.navBtn.__jsx-style-dynamic-selector{display:inline-block;background-color:var(--berry-bridge-500);padding:6px 12px;-webkit-border-radius:var(--border-radius);-moz-border-radius:var(--border-radius);border-radius:var(--border-radius);width:initial;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1}.navBtn.__jsx-style-dynamic-selector>p.__jsx-style-dynamic-selector{display:inline-block;color:white;margin:0}.closed.__jsx-style-dynamic-selector>ul.__jsx-style-dynamic-selector{display:none}.open.__jsx-style-dynamic-selector>ul.__jsx-style-dynamic-selector{background-color:white;width:360px;margin-top:6px}li.__jsx-style-dynamic-selector{padding:12px 28px}li.__jsx-style-dynamic-selector:not(:last-child){border-bottom:1px solid var(--component-border)}}@media(min-width:").concat(l.Bs.MEDIUM,"){#siteActions.__jsx-style-dynamic-selector{-webkit-box-align:start;-webkit-align-items:flex-start;-moz-box-align:start;-ms-flex-align:start;align-items:flex-start}.menuLink{padding:12px 0px}.navHeadline.__jsx-style-dynamic-selector{display:block}.navBtn.__jsx-style-dynamic-selector{display:none}.closed.__jsx-style-dynamic-selector>ul.__jsx-style-dynamic-selector{display:inline-block}li.__jsx-style-dynamic-selector i.__jsx-style-dynamic-selector{display:inline-block}}")})]})}},31057:function(e,t,n){n.d(t,{Z:function(){return A}});var i=n(85893),a=n(36465),o=n.n(a),s=n(2232),r=n(27453),l=n(54303),c=n(68602),d=n(67294),u=n(77386),m=n(9143),p=n(78604),x=n(38183),f=n(21403),h=n(68716),b=n(45697),y=n.n(b),g=n(37413),v=n(50178),j=n(57773),w=n(28216),E=n(50319);function I(e){let{width:t,photo:n}=e,a=(0,v.Ph)("siteId"),[s,r]=(0,d.useState)(!1),[f,b]=(0,d.useState)(!1),y=(0,w.Z)(),I=(0,c.XX)(),S=(0,c.zW)();(0,d.useEffect)(()=>{y.isShowing&&(n&&S({type:c.yx.HYDRATE,photos:[n]}),r(!1))},[y.isShowing,n,S]);let[_]=(0,E.D)((0,j.Xo)([{mainSitePhoto:"PhotoInput"}]),{onCompleted:y.toggleModal,onError:()=>{b(!0)}});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{"data-qa":"profilePhotoEdit",onClick:y.toggleModal,className:o().dynamic([["daa8f9c415dbf943",[t,t,t,t]]])+" button--isClear",children:(0,i.jsx)("i",{className:o().dynamic([["daa8f9c415dbf943",[t,t,t,t]]])+" fa-camera fa-solid"})}),(0,i.jsx)(x.Z,{isShowing:y.isShowing,setIsShowing:y.setIsShowing,onClickOverlay:y.toggleModal,children:(0,i.jsxs)(m.Z,{isForModal:!0,children:[(0,i.jsx)("h1",{className:o().dynamic([["daa8f9c415dbf943",[t,t,t,t]]]),children:"Page photo"}),(0,i.jsx)(u.Z,{"data-qa":"closeModal",onClick:y.toggleModal}),(0,i.jsx)(g.Z,{}),(0,i.jsxs)("p",{className:o().dynamic([["daa8f9c415dbf943",[t,t,t,t]]])+" buttonGroup",children:[(0,i.jsx)(l.Z,{"data-qa":"saveMainPhoto",onClick:()=>{r(!0);let e=new h.Z(I).getValidPhotos(),t=[],n=null;if(e.length>0){var i;let a=null===(i=e[0])||void 0===i?void 0:i.upload;a&&(a.legacyPath&&!a.public_id?t.push(a.legacyPath):a.public_id&&(n={publicId:a.public_id,width:a.width,height:a.height}))}t.length>0?_({variables:{siteId:a,mainSitePhoto:n,legacyPhotoPaths:t}}):_({variables:{siteId:a,mainSitePhoto:n}})},disabled:s,children:"Save"}),(0,i.jsx)(l.Z,{variant:l.c.SECONDARY,"data-qa":"cancelMainPhoto",onClick:y.toggleModal,children:"Cancel"})]}),f&&(0,i.jsx)(p.Z,{})]})}),(0,i.jsx)(o(),{id:"daa8f9c415dbf943",dynamic:[t,t,t,t],children:"button.__jsx-style-dynamic-selector{width:".concat(t,"px;height:").concat(t,"px;-webkit-border-radius:-webkit-calc(").concat(t,"px / 2);-moz-border-radius:-moz-calc(").concat(t,"px / 2);border-radius:-webkit-calc(").concat(t,"px / 2);border-radius:-moz-calc(").concat(t,"px / 2);border-radius:calc(").concat(t,"px / 2);background-color:var(--button-blue-500);color:white;font-size:-webkit-calc(").concat(t,"px - 14px);font-size:-moz-calc(").concat(t,"px - 14px);font-size:calc(").concat(t,"px - 14px)}")})]})}function S(e){return(0,i.jsx)(c.TV,{value:{uploadType:f.mu.SITE_PROFILE,maxFileCount:1},children:(0,i.jsx)(I,{...e})})}I.propTypes={width:y().number.isRequired,photo:y().object},S.propTypes={width:y().number.isRequired,photo:y().object};var _=n(67304),k=n(88514),T=n(37887),N=n(41664),C=n.n(N),M=n(39332);function A(){var e,t,n,a,l,c,d,u,m,p,x,f,h,b,y,g,j,w,E,I,k,T;let N=(0,v.Ph)("siteId"),{data:C}=(0,_.Z)(N),M=null!==(T=null==C?void 0:null===(e=C.getSite)||void 0===e?void 0:e.isAuthor)&&void 0!==T&&T;return(0,i.jsxs)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" bleed",children:[(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" backgroundBanner",children:(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" standardLayout wider lv",children:(0,i.jsxs)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" content marginBottom--0",children:[(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" profilePhotoWrapper",children:(0,i.jsxs)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" profilePhotoBorder",children:[(0,i.jsx)(r.Z,{width:126,publicId:null==C?void 0:null===(t=C.getSite)||void 0===t?void 0:null===(n=t.mainSitePhoto)||void 0===n?void 0:n.publicId,legacyPath:null==C?void 0:null===(a=C.getSite)||void 0===a?void 0:null===(l=a.mainSitePhoto)||void 0===l?void 0:l.legacyPath,isResponsive:!0}),M&&(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" positionEdit",children:(0,i.jsx)(S,{photo:null==C?void 0:null===(c=C.getSite)||void 0===c?void 0:c.mainSitePhoto,width:32})})]})}),(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" siteInfo",children:(0,i.jsx)(D,{title:null==C?void 0:null===(d=C.getSite)||void 0===d?void 0:d.title,firstName:null==C?void 0:null===(u=C.getSite)||void 0===u?void 0:u.firstName,lastName:null==C?void 0:null===(m=C.getSite)||void 0===m?void 0:m.lastName,isAuthor:M,numVisits:null==C?void 0:null===(p=C.getSite)||void 0===p?void 0:p.numVisits,siteId:N})})]})})}),(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" standardLayout sv",children:(0,i.jsxs)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" content marginBottom--0",children:[(0,i.jsxs)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" profilePhotoBorder",children:[(0,i.jsx)(r.Z,{width:126,publicId:null==C?void 0:null===(x=C.getSite)||void 0===x?void 0:null===(f=x.mainSitePhoto)||void 0===f?void 0:f.publicId,legacyPath:null==C?void 0:null===(h=C.getSite)||void 0===h?void 0:null===(b=h.mainSitePhoto)||void 0===b?void 0:b.legacyPath,isResponsive:!0}),M&&(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" positionEdit",children:(0,i.jsx)(S,{photo:null==C?void 0:null===(y=C.getSite)||void 0===y?void 0:y.mainSitePhoto,width:32})})]}),(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" siteInfo lv",children:(0,i.jsx)(D,{firstName:null==C?void 0:null===(g=C.getSite)||void 0===g?void 0:g.firstName,lastName:null==C?void 0:null===(j=C.getSite)||void 0===j?void 0:j.lastName,isAuthor:M,numVisits:null==C?void 0:null===(w=C.getSite)||void 0===w?void 0:w.numVisits})}),(0,i.jsx)("div",{className:o().dynamic([["ae0934cdf4d35f4f",[32,32,s.Bs.MEDIUM,s.Bs.SMALL]]])+" siteInfo sv center",children:(0,i.jsx)(D,{firstName:null==C?void 0:null===(E=C.getSite)||void 0===E?void 0:E.firstName,lastName:null==C?void 0:null===(I=C.getSite)||void 0===I?void 0:I.lastName,isAuthor:M,numVisits:null==C?void 0:null===(k=C.getSite)||void 0===k?void 0:k.numVisits,siteId:N})})]})}),(0,i.jsx)(o(),{id:"ae0934cdf4d35f4f",dynamic:[32,32,s.Bs.MEDIUM,s.Bs.SMALL],children:'.bleed.__jsx-style-dynamic-selector{position:relative}.standardLayout.__jsx-style-dynamic-selector{padding-bottom:0}.backgroundBanner.__jsx-style-dynamic-selector{position:absolute;top:0;left:0;right:0;min-height:80px;background-color:var(--gray-200);background-image:url("/img/bgProfile.svg");background-position:center bottom;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;background-repeat:no-repeat}.content.__jsx-style-dynamic-selector{position:relative;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding-top:18px;padding-bottom:24px;word-break:break-all}.profilePhotoWrapper.__jsx-style-dynamic-selector{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;width:-webkit-calc((290px - max(80px,min((100vw*.069 + 55.1px),126px)))/2 + max(80px,min((100vw*.069 + 55.1px),126px)));width:-moz-calc((290px - clamp(80px,(100vw*.069 + 55.1px),126px))/2 + clamp(80px,(100vw*.069 + 55.1px),126px));width:calc((290px - clamp(80px,(100vw*.069 + 55.1px),126px))/2 + clamp(80px,(100vw*.069 + 55.1px),126px))}.profilePhotoBorder.__jsx-style-dynamic-selector{-webkit-box-flex:0;-webkit-flex:0 0 auto;-moz-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;border:1.5px solid var(--gray-100);-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;width:max(80px,min((100vw*.069 + 55.1px),126px));width:clamp(80px,(100vw*.069 + 55.1px),126px);height:max(80px,min((100vw*.069 + 55.1px),126px));height:clamp(80px,(100vw*.069 + 55.1px),126px);position:relative}.positionEdit.__jsx-style-dynamic-selector{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;width:'.concat(32,"px;height:").concat(32,"px;position:absolute;bottom:0;right:0}.lv.__jsx-style-dynamic-selector{display:none}@media(min-width:").concat(s.Bs.MEDIUM,"){.backgroundBanner.__jsx-style-dynamic-selector{position:relative}.content.__jsx-style-dynamic-selector{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-moz-box-orient:horizontal;-moz-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:start;-webkit-align-items:flex-start;-moz-box-align:start;-ms-flex-align:start;align-items:flex-start;gap:48px}.profilePhotoBorder.__jsx-style-dynamic-selector{margin-top:0;position:absolute;bottom:0;-webkit-transform:translatey(33%);-moz-transform:translatey(33%);-ms-transform:translatey(33%);-o-transform:translatey(33%);transform:translatey(33%)}.lv.__jsx-style-dynamic-selector{display:block}.sv.__jsx-style-dynamic-selector{display:none}.siteHeader.__jsx-style-dynamic-selector{margin-bottom:84px}.siteInfo.__jsx-style-dynamic-selector{color:var(--body-text);position:relative;left:-80px}}@media(max-width:").concat(s.Bs.SMALL,'){.content.__jsx-style-dynamic-selector{padding-bottom:10px}.backgroundBanner.__jsx-style-dynamic-selector{min-height:94px;background-image:url("/img/bgProfileMobile.svg")}}')})]})}function D(e){let{title:t,firstName:n,lastName:a,isAuthor:r,numVisits:l,siteId:c}=e,d=null==n?void 0:n.trim(),u=a.trim(),m=(0,v.G3)(v.Z6.SITE_HOME_PAGE,{siteId:c}),p=(0,M.usePathname)(),x=m===p;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{"data-qa":"siteTitle",className:o().dynamic([["b0e52f901b1749d3",[s.Bs.MEDIUM]]])+" siteTitle headerFont",children:[!x&&(0,i.jsx)(C(),{className:"siteTitleLink",href:m,"data-qa":"siteTitleHomeLink",children:null!=t?t:" ".concat(d,"'s CaringBridge")}),x&&(null!=t?t:" ".concat(d,"'s CaringBridge"))]}),(0,i.jsx)("div",{"data-qa":"patientName",className:o().dynamic([["b0e52f901b1749d3",[s.Bs.MEDIUM]]])+" patient siteInfoBoldText",children:"".concat(d," ").concat(u)}),(0,i.jsxs)("div",{className:o().dynamic([["b0e52f901b1749d3",[s.Bs.MEDIUM]]])+" visitorInfo",children:[(0,i.jsx)("div",{"data-qa":"site-info-page-visits",className:o().dynamic([["b0e52f901b1749d3",[s.Bs.MEDIUM]]])+" siteInfoBoldText",children:l}),r?(0,i.jsx)(C(),{href:(0,v.G3)(v.Z6.SITE_SETTINGS_VISITORS,{siteId:c}),className:"siteInfoLightText",children:1===l?"visit":"visits"}):(0,i.jsx)("div",{className:o().dynamic([["b0e52f901b1749d3",[s.Bs.MEDIUM]]])+" visitorCount",children:1===l?"visit":"visits"}),r&&(0,i.jsx)(L,{})]}),(0,i.jsx)(o(),{id:"b0e52f901b1749d3",dynamic:[s.Bs.MEDIUM],children:".siteTitle.__jsx-style-dynamic-selector{color:var(--color-primary);font-size:24px}.patient.__jsx-style-dynamic-selector{font-size:20px;line-height:26px}.visitorInfo.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;font-size:16px;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-top:6px}.siteTitleLink{text-decoration:none;color:var(--color-primary)!important}.visitsCount{color:#24384c;padding-left:3px}.siteInfoBoldText{font-weight:500}.siteInfoLightText{font-weight:300;color:#24384c!important;text-decoration:underline;padding-left:3px}.visitorCount{padding-left:3px}.siteInfoLightText:hover{color:#963862!important;cursor:pointer;text-decoration:underline}@media(min-width:".concat(s.Bs.MEDIUM,"){.visitorInfo.__jsx-style-dynamic-selector{-webkit-box-pack:initial;-webkit-justify-content:initial;-moz-box-pack:initial;-ms-flex-pack:initial;justify-content:initial}}")})]})}function L(){var e,t,n,a;let s=(0,v.Ph)("siteId"),{data:r}=(0,T.a)(k.z7,{variables:{siteId:s}});return r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"jsx-a3182af8a1210f4e",children:"\xa0 | \xa0"}),(0,i.jsx)("div",{className:"jsx-a3182af8a1210f4e authorVisitors",children:(0,i.jsxs)(C(),{href:(0,v.G3)(v.Z6.SITE_SETTINGS_VISITORS,{siteId:s}),className:"a--isClear flexbox",children:[(0,i.jsx)("div",{"data-qa":"site-info-visitors",className:"jsx-a3182af8a1210f4e visitorCount",children:(null==r?void 0:null===(e=r.getSite)||void 0===e?void 0:null===(t=e.visitorConnection)||void 0===t?void 0:t.totalCount)||""}),(0,i.jsx)("div",{className:"jsx-a3182af8a1210f4e siteInfoLightText",children:(null==r?void 0:null===(n=r.getSite)||void 0===n?void 0:null===(a=n.visitorConnection)||void 0===a?void 0:a.totalCount)<=1?"visitor":"visitors"})]})}),(0,i.jsx)(o(),{id:"a3182af8a1210f4e",children:".authorVisitors.jsx-a3182af8a1210f4e{color:var(--color-primary);-webkit-transition:all var(--speed-on-toggle)linear;-moz-transition:all var(--speed-on-toggle)linear;-o-transition:all var(--speed-on-toggle)linear;transition:all var(--speed-on-toggle)linear}.authorVisitors.jsx-a3182af8a1210f4e:hover{color:var(--button-bg-hover)}.visitorCount.jsx-a3182af8a1210f4e{color:#24384c}"})]}):null}D.propTypes={title:y().string,firstName:y().string.isRequired,lastName:y().string.isRequired,isAuthor:y().bool.isRequired,numVisits:y().number,siteId:y().string}},1283:function(e,t,n){n.d(t,{Ei:function(){return f},Ir:function(){return d},J6:function(){return x},fm:function(){return h},oS:function(){return l}});var i=n(85893),a=n(67294),o=n(45697),s=n.n(o),r=n(70758);let l={ADD:"ADD",DRAFT:"DRAFT",EDIT:"EDIT",PIN:"PIN",UNPIN:"UNPIN",DELETE:"DELETE",NONE:"NONE"},c={mode:l.NONE,post:null,feedId:"",waysToHelp:{},activeTab:"ALL",isDirtyFeed:!1,isDirtyPosts:!1},d={SET_VALUE:"SET_VALUE",RESET:"RESET"},u=(0,a.createContext)(c),m=(0,a.createContext)(void 0);function p(e,t){switch(t.type){case d.SET_VALUE:{let n={};for(let[e,i]of Object.entries(t))"type"!==e&&(n[e]=i);return{...e,...n}}case d.RESET:return{...c,activeTab:e.activeTab};default:throw Error("Invalid action type provided to the postActionReducer: “".concat(t.type,"”"))}}function x(e){let{children:t}=e,[n,o]=(0,a.useReducer)(p,c);return(0,i.jsx)(u.Provider,{value:n,children:(0,i.jsx)(m.Provider,{value:o,children:t})})}function f(){let e=(0,a.useContext)(u),t=(0,r.q)();if(void 0===e)throw Error("usePostActionState must be used within <PostActionStateContext>");return e.waysToHelp=t,e}function h(){let e=(0,a.useContext)(m);if(void 0===e)throw Error("usePostActionDispatch must be used within <PostActionDispatchContext>");return e}x.propTypes={value:s().object,children:s().node.isRequired}},67380:function(e,t,n){n.d(t,{Z:function(){return l}});var i=n(67294),a=n(50319),o=n(65970),s=n(88514),r=n(50178);function l(e){let t=(0,r.Ph)(r.Tx.REACTION),[n,{data:l,loading:c,called:d}]=(0,a.D)(o.W_,{onError:e=>{console.log("addReaction error: ",e)}});(0,i.useEffect)(()=>{if(t){let i=(0,r.Ph)(r.Tx.PARENT);!i||l||c||d||(n({refetchQueries:[s.fo.GET_SITE_PAGE],variables:{input:{parentId:i,parentType:e,type:t}}}),(0,r.aX)())}},[t,e])}},70758:function(e,t,n){n.d(t,{q:function(){return c}});var i=n(67294),a=n(37887),o=n(50319),s=n(80325),r=n(91992),l=n(50178);function c(){var e;let t=(0,l.Ph)("siteId"),{data:n,loading:c}=(0,a.a)(r.m$,{variables:{siteId:t},fetchPolicy:"network-only"}),[d,{loading:u}]=(0,o.D)(r.b,{refetchQueries:["GET_FEED","GET_SITE_WAYS_TO_HELP"]}),[m,p]=(0,i.useState)({}),[x,f]=(0,i.useState)({});return(0,i.useEffect)(()=>{if(!c&&n){var e,t;let i={},a={};null==n||null===(e=n.getSite)||void 0===e||null===(t=e.waysToHelps)||void 0===t||t.forEach(e=>{e.item&&(i[e.type]=e.item,a[e.type]=e.item.initializedPostShared)}),p(i),f(a)}},[c,n]),{postItems:m,initializedPostsShared:x,dismissPostPreview:e=>{d({variables:{siteId:t,initializedPostShared:s.NS.DISMISSED,postType:e}})},postPreview:e=>{d({variables:{siteId:t,initializedPostShared:s.NS.POSTED,postType:e}})},loading:c,updateWaysToHelpPostLoading:u,isAuthor:null==n?void 0:null===(e=n.getSite)||void 0===e?void 0:e.isAuthor}}},2900:function(e,t,n){n.d(t,{Z:function(){return x}});var i=n(85893),a=n(36465),o=n.n(a),s=n(77386),r=n(38183),l=n(9151),c=n(45697),d=n.n(c),u=n(68481),m=n(45338);function p(e){let{onNext:t,onPrev:n}=e,{mediaList:a,mediaIndex:s}=(0,l.j9)(),r=a[s];(0,u.Z)(["ArrowRight","ArrowDown"],t),(0,u.Z)(["ArrowLeft","ArrowUp"],n);let c=(0,m.QS)({onSwiped:e=>{let{dir:i}=e;switch(i){case"Left":t();break;case"Right":n()}}});return(0,i.jsxs)(i.Fragment,{children:[a.length>1&&(0,i.jsxs)("button",{"data-qa":"prev-photo-nav",onClick:e=>{n()},className:"jsx-c5fe1ecc3865b6c1 navBtn navBtn--prev button--isClear hideOutlineForMouse",children:[(0,i.jsx)("i",{className:"jsx-c5fe1ecc3865b6c1 fa-chevron-left fa-light"}),(0,i.jsx)("span",{className:"jsx-c5fe1ecc3865b6c1 sr-only",children:"Show previous photo"})]}),a.length>1&&(0,i.jsxs)("button",{"data-qa":"next-photo-nav",onClick:e=>{t()},className:"jsx-c5fe1ecc3865b6c1 navBtn navBtn--next button--isClear hideOutlineForMouse",children:[(0,i.jsx)("i",{className:"jsx-c5fe1ecc3865b6c1 fa-chevron-right fa-light"}),(0,i.jsx)("span",{className:"jsx-c5fe1ecc3865b6c1 sr-only",children:"Show next photo"})]}),(0,i.jsx)("div",{...c,className:"jsx-c5fe1ecc3865b6c1 "+(c&&null!=c.className&&c.className||"detailImage"),children:(0,i.jsx)(r,{className:"jsx-c5fe1ecc3865b6c1"})}),(0,i.jsx)(o(),{id:"c5fe1ecc3865b6c1",children:".navBtn.jsx-c5fe1ecc3865b6c1{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;font-size:36px;width:64px;height:64px;position:absolute;top:50%;-webkit-transform:translatey(-50%);-moz-transform:translatey(-50%);-ms-transform:translatey(-50%);-o-transform:translatey(-50%);transform:translatey(-50%);opacity:.3;-webkit-transition:opacity linear var(--speed-on-hover);-moz-transition:opacity linear var(--speed-on-hover);-o-transition:opacity linear var(--speed-on-hover);transition:opacity linear var(--speed-on-hover);background-color:var(--gray-600);-webkit-border-radius:32px;-moz-border-radius:32px;border-radius:32px}.navBtn.jsx-c5fe1ecc3865b6c1:hover{opacity:1;-webkit-transition:opacity linear var(--speed-on-hover);-moz-transition:opacity linear var(--speed-on-hover);-o-transition:opacity linear var(--speed-on-hover);transition:opacity linear var(--speed-on-hover)}.navBtn.jsx-c5fe1ecc3865b6c1 svg{margin:auto}.navBtn--prev.jsx-c5fe1ecc3865b6c1{left:6px}.navBtn--next.jsx-c5fe1ecc3865b6c1{right:6px}.detailImage.jsx-c5fe1ecc3865b6c1{height:-webkit-calc(100vh - 84px);height:-moz-calc(100vh - 84px);height:calc(100vh - 84px);width:100vw}"})]})}function x(){let{mediaModalShowing:e}=(0,l.j9)(),t=(0,l.Yx)(),n=()=>{t({type:l.w7.CLOSE_MEDIA_VIEWER})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z,{isShowing:e,setIsShowing:n,centerVertically:!1,children:(0,i.jsxs)("div",{className:"jsx-80834e2d9b9fa439 imageSection bleed",children:[(0,i.jsx)("div",{className:"jsx-80834e2d9b9fa439 closeBtn",children:(0,i.jsx)(s.Z,{"data-qa":"close-media-detail",onClick:n,isForModal:!1})}),(0,i.jsx)(p,{onNext:()=>{t({type:l.w7.SHOW_NEXT})},onPrev:()=>{t({type:l.w7.SHOW_PREV})}})]})}),(0,i.jsx)(o(),{id:"80834e2d9b9fa439",children:".closeBtn.jsx-80834e2d9b9fa439{text-align:right}.imageSection.jsx-80834e2d9b9fa439{height:100vh}"})]})}p.propTypes={onNext:d().func,onPrev:d().func}},9151:function(e,t,n){n.d(t,{w7:function(){return c},ZN:function(){return p},Yx:function(){return f},j9:function(){return x}});var i=n(85893),a=n(67294),o=n(45697),s=n.n(o);class r{setValue(e){for(let[t,n]of Object.entries(e))"type"!==t&&(this.state[t]=n);return this}showPrev(){return 0===this.state.mediaIndex?this.state.mediaIndex=this.state.mediaList.length-1:this.state.mediaIndex--,this}showNext(){return this.state.mediaIndex===this.state.mediaList.length-1?this.state.mediaIndex=0:this.state.mediaIndex++,this}setListenForEscape(e){return this.state.listenForEscape=e,this}loadMediaViewer(e,t){return this.state.mediaList=e,this.state.mediaIndex=t,this.state.mediaModalShowing=!0,this}closeMediaViewer(){return this.state.mediaList=[],this.state.mediaIndex=-1,this.state.mediaModalShowing=!1,this}getState(){return this.state}constructor(e){this.state={...e}}}let l={listenForEscape:!0,mediaModalShowing:!1,mediaList:[],mediaIndex:0},c={LOAD_MEDIA_VIEWER:"LOAD_MEDIA_VIEWER",CLOSE_MEDIA_VIEWER:"CLOSE_MEDIA_VIEWER",SET_VALUE:"SET_VALUE",SHOW_PREV:"SHOW_PREV",SHOW_NEXT:"SHOW_NEXT"},d=(0,a.createContext)(l),u=(0,a.createContext)(void 0);function m(e,t){switch(t.type){case c.SET_VALUE:return new r(e).setValue(t).getState();case c.SHOW_PREV:return new r(e).showPrev().getState();case c.SHOW_NEXT:return new r(e).showNext().getState();case c.LOAD_MEDIA_VIEWER:return new r(e).loadMediaViewer(t.mediaList,t.mediaIndex).getState();case c.CLOSE_MEDIA_VIEWER:return new r(e).closeMediaViewer().getState();default:throw Error("Invalid action type provided to the mediaReducer: “".concat(t.type,"”"))}}function p(e){let{value:t,children:n}=e,o={...l,...t},[s,r]=(0,a.useReducer)(m,o);return(0,i.jsx)(d.Provider,{value:s,children:(0,i.jsx)(u.Provider,{value:r,children:n})})}function x(){let e=(0,a.useContext)(d);if(void 0===e)throw Error("useMediaState must be used within <MediaProvider>");return e}function f(){let e=(0,a.useContext)(u);if(void 0===e)throw Error("useMediaDispatch must be used within <MediaProvider>");return e}p.propTypes={value:s().object,children:s().node.isRequired}},57773:function(e,t,n){n.d(t,{DV:function(){return E},G5:function(){return I},Ip:function(){return w},KN:function(){return T},Ko:function(){return C},Ky:function(){return P},Ln:function(){return S},QC:function(){return A},RO:function(){return R},Rt:function(){return k},X8:function(){return B},Xo:function(){return O},Xq:function(){return N},ZY:function(){return D},hk:function(){return M},iS:function(){return L},pT:function(){return _}});var i=n(82729),a=n(81621);function o(){let e=(0,i._)(["\n    mutation UPDATE_AUTHOR_INVITE($action: InviteAction!, $id: String!) {\n        updateAuthorInvite(input: { action: $action, id: $id }) {\n            id\n            updatedAt\n            inviteStatus\n        }\n    }\n"]);return o=function(){return e},e}function s(){let e=(0,i._)(["\n    query GET_SITE_AUTHORS($siteId: String!) {\n        getSite(query: { id: $siteId }) {\n            id\n            authors {\n                id\n                firstName\n                lastName\n                email\n                authorAt\n                photo {\n                    publicId\n                    legacyPath\n                    width\n                    height\n                }\n            }\n            context {\n                roles\n            }\n            isAuthor @client\n        }\n    }\n"]);return s=function(){return e},e}function r(){let e=(0,i._)(["\n    query GET_SITE_AUTHOR_INVITES($siteId: String!) {\n        authorInvites(query: { siteId: $siteId }) {\n            id\n            createdAt\n            firstName\n            lastName\n            inviteStatus\n            emailAddress\n            updatedAt\n        }\n    }\n"]);return r=function(){return e},e}function l(){let e=(0,i._)(["\n    mutation INVITE_AUTHOR(\n        $emailAddress: String!\n        $firstName: String!\n        $lastName: String!\n        $personalMessage: String\n        $sendInviterEmailCopy: Boolean\n        $sendOtherAuthorsEmailCopy: Boolean\n        $siteId: String!\n    ) {\n        createAuthorInvite(\n            input: {\n                emailAddress: $emailAddress\n                firstName: $firstName\n                lastName: $lastName\n                personalMessage: $personalMessage\n                sendInviterEmailCopy: $sendInviterEmailCopy\n                sendOtherAuthorsEmailCopy: $sendOtherAuthorsEmailCopy\n                siteId: $siteId\n            }\n        ) {\n            id\n            emailAddress\n            firstName\n            lastName\n            inviteStatus\n            siteId\n        }\n    }\n"]);return l=function(){return e},e}function c(){let e=(0,i._)(["\n    mutation DELETE_AUTHOR($siteId: String!, $userId: String!) {\n        deleteAuthor(input: { siteId: $siteId, userId: $userId })\n    }\n"]);return c=function(){return e},e}function d(){let e=(0,i._)(["\n    query GET_SITE_SETTINGS($siteId: String!) {\n        getSite(query: { id: $siteId }) {\n            id\n            firstName\n            lastName\n            numVisits\n            healthCondition\n            title\n            patientId\n            privacy\n            isSearchableInternally\n            isSearchablePublicly\n            allowAccessRequest\n            isShareableByVisitor\n            mainSitePhoto {\n                publicId\n                legacyPath\n                width\n                height\n            }\n            context {\n                roles\n            }\n            isAuthor @client\n        }\n    }\n"]);return d=function(){return e},e}function u(){let e=(0,i._)(["\n    mutation UPDATE_SITE_GENERAL(\n        $siteId: String!\n        $firstName: String!\n        $lastName: String!\n        $healthCondition: HealthCondition\n        $title: String\n    ) {\n        updateSite(\n            input: {\n                siteId: $siteId\n                firstName: $firstName\n                lastName: $lastName\n                title: $title\n                healthCondition: $healthCondition\n            }\n        ) {\n            id\n            firstName\n            lastName\n            healthCondition\n            title\n        }\n    }\n"]);return u=function(){return e},e}function m(){let e=(0,i._)(["\n    query GET_SITE_BLOCK_LIST($siteId: String!) {\n        getSite(query: { id: $siteId }) {\n            id\n            blockList {\n                blockedAddress\n                blockedVisitor {\n                    firstName\n                    id\n                    lastName\n                    emailAddress\n                    lastVisitedAt\n                    photo {\n                        height\n                        publicId\n                        legacyPath\n                        width\n                    }\n                }\n            }\n        }\n    }\n"]);return m=function(){return e},e}function p(){let e=(0,i._)(["\n    mutation UPDATE_BLOCK_SITE_ACCESS($siteId: String!, $emailAddresses: [String!]!) {\n        blockSiteAccess(input: { siteId: $siteId, emailAddresses: $emailAddresses }) {\n            blockedAddresses\n        }\n    }\n"]);return p=function(){return e},e}function x(){let e=(0,i._)(["\n    mutation UPDATE_UNBLOCK_SITE_ACCESS($siteId: String!, $emailAddresses: [String!]!) {\n        unblockSiteAccess(input: { siteId: $siteId, emailAddresses: $emailAddresses }) {\n            unblockedAddresses\n        }\n    }\n"]);return x=function(){return e},e}function f(){let e=(0,i._)(["\n    query GET_SITE_ALLOW_LIST($siteId: String!) {\n        getSite(query: { id: $siteId }) {\n            id\n            allowList {\n                allowedAddress\n                allowedVisitor {\n                    firstName\n                    id\n                    lastName\n                    emailAddress\n                    lastVisitedAt\n                    photo {\n                        height\n                        publicId\n                        legacyPath\n                        width\n                    }\n                }\n            }\n        }\n    }\n"]);return f=function(){return e},e}function h(){let e=(0,i._)(["\n    query GET_SITE_REQUESTS($siteId: String!) {\n        getSite(query: { id: $siteId }) {\n            id\n            listAccessRequests {\n                id\n                createdAt\n                message\n                requestStatus\n                requester {\n                    emailAddress\n                    firstName\n                    photo {\n                        publicId\n                        legacyPath\n                    }\n                    lastName\n                    userId\n                }\n            }\n        }\n    }\n"]);return h=function(){return e},e}function b(){let e=(0,i._)(["\n    mutation UPDATE_ACCESS_REQUEST($id: String!, $action: AccessAction!) {\n        updateAccessRequest(input: { id: $id, action: $action }) {\n            id\n            requestStatus\n        }\n    }\n"]);return b=function(){return e},e}function y(){let e=(0,i._)(["\n    mutation UPDATE_ALLOW_SITE_ACCESS($siteId: String!, $emailAddresses: [String!]!) {\n        allowSiteAccess(input: { siteId: $siteId, emailAddresses: $emailAddresses }) {\n            allowedAddresses\n        }\n    }\n"]);return y=function(){return e},e}function g(){let e=(0,i._)(["\n    mutation UPDATE_REVOKE_SITE_ACCESS($siteId: String!, $emailAddresses: [String!]!) {\n        revokeSiteAccess(input: { siteId: $siteId, emailAddresses: $emailAddresses }) {\n            revokedAddresses\n        }\n    }\n"]);return g=function(){return e},e}function v(){let e=(0,i._)(["\n    query GET_SITE_VISITOR_CONNECTION(\n        $siteId: String!\n        $limit: Int\n        $nextToken: String\n        $sortDirection: SortDirection\n    ) {\n        getSite(query: { id: $siteId }) {\n            id\n            numVisits\n            privacy\n            visitorConnection(\n                query: {\n                    paginationInput: {\n                        limit: $limit\n                        nextToken: $nextToken\n                        sortDirection: $sortDirection\n                    }\n                }\n            ) {\n                nextToken\n                totalCount\n                visitors {\n                    emailAddress\n                    firstName\n                    id\n                    lastName\n                    lastVisitedAt\n                    photo {\n                        height\n                        publicId\n                        legacyPath\n                        width\n                    }\n                    status\n                }\n            }\n        }\n    }\n"]);return v=function(){return e},e}function j(){let e=(0,i._)(["\n        mutation UPDATE_SITE($siteId: String!",") {\n            updateSite(input: { siteId: $siteId"," }) {\n                id","\n            }\n        }\n    "]);return j=function(){return e},e}let w=(0,a.Ps)(o()),E=(0,a.Ps)(s()),I=(0,a.Ps)(r()),S=(0,a.Ps)(l()),_=(0,a.Ps)(c()),k=(0,a.Ps)(d()),T=(0,a.Ps)(u()),N=(0,a.Ps)(m()),C=(0,a.Ps)(p()),M=(0,a.Ps)(x()),A=(0,a.Ps)(f()),D=(0,a.Ps)(h()),L=(0,a.Ps)(b()),P=(0,a.Ps)(y()),R=(0,a.Ps)(g()),B=(0,a.Ps)(v());function O(e){let t="",n="",i="";return e.forEach(e=>{let[[a,o]]=Object.entries(e);n+=", $".concat(a,": ").concat(o),i+=", ".concat(a,": $").concat(a),"PhotoInput"===o?t+=", ".concat(a," { width, height, publicId, legacyPath }"):t+=", "+a}),(0,a.Ps)(j(),n,i,t)}},43323:function(e,t,n){n.d(t,{Z:function(){return c}});var i=n(85893),a=n(25675),o=n.n(a),s=n(45697),r=n.n(s),l=n(90266);function c(e){let{id:t,legacyPath:n,width:a,height:s,maxWidth:r,maxHeight:l,responsive:c=!0}=e,{displayWidth:m,displayHeight:p}=u({width:a,height:s,maxWidth:r,maxHeight:l}),x=d(t,n,m,p);return s?(0,i.jsx)(o(),{src:x,width:m,height:p,alt:"",style:c?{width:"100%",height:l?"100%":"auto",objectFit:"scale-down"}:null,unoptimized:!0}):(0,i.jsx)("img",{src:x,style:c?{width:"100%",height:l?"100%":"auto",objectFit:"scale-down"}:null,width:a,alt:"",loading:"lazy",decoding:"async"})}let d=(e,t,n,i)=>{let a=["c_limit","w_".concat(n),"q_auto:best"];return i&&a.push("h_".concat(i)),(0,l.h)(e,t,a)},u=e=>{let t,{width:n,height:i,maxWidth:a,maxHeight:o}=e,s=a||n||"auto";return i?(o?s=Math.round((t=o||i)*(n/i)):t=Math.round(s*(i/n)),{displayWidth:s,displayHeight:t}):{displayWidth:s,displayHeight:null}};c.propTypes={id:r().string,legacyPath:r().string,width:r().number,height:r().number,maxWidth:r().number,maxHeight:r().number,responsive:r().bool}},77845:function(e,t,n){n.d(t,{Z:function(){return a}});var i=n(85893);function a(e){return()=>(0,i.jsx)("i",{className:e})}n(67294)},95414:function(e,t,n){n.d(t,{Ix:function(){return a}});var i=n(10815);async function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=await s(e,(t.tags&&!String(t.tags).includes("orphan")?t.tags+=",orphan":t.tags||(t.tags="orphan"),t)),a="".concat(i.H,"/v1_1/").concat(i.H_,"/").concat(i.To.IMAGE,"/upload"),o=await fetch(a,{method:"POST",body:n,credentials:"same-origin"});return o.ok?o.json():await r(o)}async function o(e){let t=await fetch("/api/sign",{method:"POST",body:JSON.stringify({paramsToSign:e}),headers:{"Content-Type":"application/json"}});return await t.json()}async function s(e,t){let n=new FormData;n.append("file",e),n.append("api_key",i.$h);let a=await o(t);for(let e in n.append("timestamp",a.timestamp),n.append("signature",a.signature),t)Object.hasOwn(t,e)&&n.append(e,t[e]);return n}async function r(e){let t={message:"",type:i.uY.SERVER_ERROR};try{let n=await e.json(),{message:a}=n.error,o="Invalid image file"===a||"Failed to ping image"===a||"Invalid webp file"===a?i.uY.CORRUPT_IMAGE:i.uY.SERVER_ERROR;t={message:a,type:o},console.error("Handled Cloudinary Error: ",t)}catch(e){t.message=JSON.stringify(e),console.error("Unhandled Cloudinary Error: ",e)}return Promise.reject(t)}},13681:function(e,t,n){n.d(t,{K:function(){return a}});var i=n(67294);function a(e,t,n){(0,i.useEffect)(()=>{function i(e){let i;i=!0,Array.isArray(t)&&t.length&&(i=!t.some(t=>{var n;return!!t&&!!t.current&&!!e&&(null==e?void 0:e.composedPath())&&(null===(n=null==e?void 0:e.composedPath())||void 0===n?void 0:n.indexOf(t.current))>-1})),i&&n()}if(e)return window.addEventListener("click",i),()=>{window.removeEventListener("click",i)}},[e,t,n])}}}]);