PageSourceSearch

https://www.caringbridge.org/_next/static/chunks/pages/components/chakra/tooltip/Tooltip-3e648a0a1a3e33aa.js

js caringbridge.org collected 2026-10-01 09:12:39 UTC 13,194 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2603],{18888:function(e,t,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/components/chakra/tooltip/Tooltip",function(){return o(63351)}])},63351:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return _}});var r=o(85893),n=o(40645),a=o.n(n),i=o(67294),s=o(17191),l=o(50151),u=o(57747),c=o(64325),p=o(72303),d=o(13591),m=o(93717),f=o(14e3),v=o(93108),h=o(45697),x=o.n(h),b=o(50319);let w={FOLLOW_TOOLTIP:{header:"Follow This Page",body:"Receive notifications for new updates and support requests.",ctaText:"Follow",colorScheme:"#22538b",placement:"left",arrowSize:20,ctaPosition:"right"},DONATE_TOOLTIP:{header:"Support This Cause",body:"Your donation helps us continue to provide valuable resources to those in need.",ctaText:"Donate Now",colorScheme:"green",placement:"right",arrowSize:20},SHARE_TOOLTIP:{header:"Share This Page",body:"Spread the word by sharing this page with your friends and family.",ctaText:"Share",colorScheme:"purple",placement:"top",arrowSize:15},SIGNUP_TOOLTIP:{header:"Join Us Today",body:"Sign up to receive updates and special content tailored just for you.",ctaText:"Sign Up",colorScheme:"orange",placement:"bottom",arrowSize:25}};var y=o(25351),g=o(61922),k=o(98303);let S=e=>{let{tooltip:t,siteId:o,targetRef:n,onAction:h,vpWidth:x}=e,[S,_]=(0,i.useState)(!1),[T,O]=(0,i.useState)(!1),[C,P]=(0,i.useState)(!1),[j]=(0,b.D)(y.J$),[N]=(0,b.D)(y.Gi,{onCompleted:()=>{_(!1),P(!0)}}),E=(0,k.S)({base:"top",sm:"top",md:"right",lg:"right"})||"right",L=w[null==t?void 0:t.type]||w.FOLLOW_TOOLTIP;(0,i.useEffect)(()=>{(null==t?void 0:t.status)!=="ACTIVE"||C||_(!0)},[t,C]);let q=async()=>{O(!0),P(!0),await j({variables:{input:{siteId:o,type:"FOLLOW_TOOLTIP",action:"DISMISS"}}}),_(!1),O(!1)},D=async()=>{let e;O(!0);try{e=await N({variables:{input:{context:"FOLLOW_BUTTON",siteId:o}}})}catch(e){console.error("Error following page:",e)}finally{O(!1),e&&e.data.followSite.isFollowing?h({following:!0}):h({following:!1})}};return S&&(null==n?void 0:n.current)?(0,r.jsxs)(s.J,{isOpen:S,placement:x?x<1024?"top":"right":E,initialFocusRef:n,children:[(0,r.jsx)(l.x,{children:(0,r.jsx)(u.xu,{ref:n})}),(0,r.jsxs)(c.y,{zIndex:"1600",p:4,bg:"#22538b",color:"white",borderRadius:"md",className:"custom-popover","data-qa":"tooltip-content",children:[(0,r.jsx)(p.Q,{className:"custom-arrow"}),(0,r.jsx)(d.u,{color:"white",border:"0",_hover:{bg:"#1e4a76",cursor:"pointer"},_focus:{boxShadow:"none",outline:"none"},_active:{boxShadow:"none",outline:"none"},mt:1,cursor:"pointer",onClick:q,"data-qa":"tooltip-close-btn"}),(0,r.jsxs)(u.xu,{p:0,children:[(0,r.jsx)(m.k,{justifyContent:"space-between",alignItems:"center",children:(0,r.jsx)(f.x,{fontWeight:"semibold",fontSize:"18px",mb:2,"data-qa":"tooltip-header",children:L.header})}),(0,r.jsx)(f.x,{mb:2,mt:0,lineHeight:"1.4",fontWeight:"medium","data-qa":"tooltip-body",children:L.body}),(0,r.jsx)(m.k,{justifyContent:"flex-end",mt:2,children:(0,r.jsx)(v.z,{size:"sm",bg:"#22538b",color:"white",border:"1px solid white",borderRadius:"5",onClick:D,_hover:{bg:"#1e4a76"},_focus:{boxShadow:"none"},disabled:T,"data-qa":"tooltip-cta-btn",children:T?(0,r.jsx)(g.ZP,{spotSize:5,spotCount:3}):L.ctaText||"Follow"})})]})]}),(0,r.jsx)(a(),{id:"dbd137242805a9e1",children:".custom-popover{z-index:1600!important}.custom-popover .custom-arrow{background-color:#22538b!important;width:16px!important;height:16px!important;-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;--popper-arrow-shadow-color:transparent!important;--popper-arrow-default-shadow:none!important}@media(max-width:767px){.custom-popover{-webkit-transform:translatey(-10px)!important;-moz-transform:translatey(-10px)!important;-ms-transform:translatey(-10px)!important;-o-transform:translatey(-10px)!important;transform:translatey(-10px)!important;margin-bottom:0px!important}.custom-popover .custom-arrow{bottom:-8px!important;top:auto!important;left:50%!important;-webkit-transform:rotate(45deg)translatex(-50%)!important;-moz-transform:rotate(45deg)translatex(-50%)!important;-ms-transform:rotate(45deg)translatex(-50%)!important;-o-transform:rotate(45deg)translatex(-50%)!important;transform:rotate(45deg)translatex(-50%)!important}}@media(min-width:768px)and (max-width:1023px){.custom-popover{-webkit-transform:translatey(-15px)!important;-moz-transform:translatey(-15px)!important;-ms-transform:translatey(-15px)!important;-o-transform:translatey(-15px)!important;transform:translatey(-15px)!important;margin-bottom:5px!important}.custom-popover .custom-arrow{bottom:-8px!important;top:auto!important;left:50%!important;-webkit-transform:rotate(45deg)translatex(-50%)!important;-moz-transform:rotate(45deg)translatex(-50%)!important;-ms-transform:rotate(45deg)translatex(-50%)!important;-o-transform:rotate(45deg)translatex(-50%)!important;transform:rotate(45deg)translatex(-50%)!important}}"})]}):null};S.propTypes={tooltip:x().shape({status:x().string,type:x().string}
1),siteId:x().string.isRequired,targetRef:x().object,onAction:x().func.isRequired,vpWidth:x().number};var _=S},98303:function(e,t,o){"use strict";o.d(t,{S:function(){return s}});var r=o(33951),n=o(52243),a=o(48940),i=o(25432);function s(e,t){var o;let s=(0,i.Kn)(t)?t:{fallback:null!=t?t:"base"},l=(0,n.G)(s),u=(0,a.F)();if(!l)return;let c=Array.from((null==(o=u.__breakpoints)?void 0:o.keys)||[]);return function(e,t,o=r.AV){let n=Object.keys(e).indexOf(t);if(-1!==n)return e[t];let a=o.indexOf(t);for(;a>=0;){let t=o[a];if(e.hasOwnProperty(t)){n=a;break}a-=1}if(-1!==n)return e[o[n]]}(Array.isArray(e)?Object.fromEntries(Object.entries((0,r.Yq)(e,c)).map(([e,t])=>[e,t])):e,l,c)}},64325:function(e,t,o){"use strict";o.d(t,{y:function(){return d}});var r=o(5904),n=o(59235),a=o(16554),i=o(77672),s=o(85893),l={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},u=(0,n.m)(i.E.section),c=(0,a.G)(function(e,t){let{variants:o=l,...n}=e,{isOpen:a}=(0,r.lp)();return(0,s.jsx)(u,{ref:t,variants:function(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}(o),initial:!1,animate:a?"enter":"exit",...n})});c.displayName="PopoverTransition";var p=o(25432),d=(0,a.G)(function(e,t){let{rootProps:o,motionProps:a,...i}=e,{getPopoverProps:l,getPopoverPositionerProps:u,onAnimationComplete:d}=(0,r.lp)(),m=(0,r.SV)(),f={position:"relative",display:"flex",flexDirection:"column",...m.content};return(0,s.jsx)(n.m.div,{...u(o),__css:m.popper,className:"chakra-popover__popper",children:(0,s.jsx)(c,{...a,...l(i,t),onAnimationComplete:(0,p.PP)(d,i.onAnimationComplete),className:(0,p.cx)("chakra-popover__content",e.className),__css:f})})});d.displayName="PopoverContent"},17191:function(e,t,o){"use strict";o.d(t,{J:function(){return O}});var r=o(93694),n=o(57134),a=()=>"undefined"!=typeof window,i=e=>a()&&e.test(navigator.vendor),s=e=>a()&&e.test(function(){var e;let t=navigator.userAgentData;return null!=(e=null==t?void 0:t.platform)?e:navigator.platform}()),l=()=>s(/mac|iphone|ipad|ipod/i),u=()=>l()&&i(/apple/i),c=o(32654),p=o(85075),d=o(12805),m=o(76766),f=o(81103),v=o(25432),h=o(92625),x=o(67294),b={click:"click",hover:"hover"};function w(e,t){return e===t||(null==e?void 0:e.contains(t))}function y(e){var t;let o=e.currentTarget.ownerDocument.activeElement;return null!=(t=e.relatedTarget)?t:o}var g=o(5904),k=o(77030),S=o(33179),_=o(48940),T=o(85893);function O(e){let t=(0,k.jC)("Popover",e),{children:o,...a}=(0,S.Lr)(e),i=(0,_.F)(),s=function(e={}){let{closeOnBlur:t=!0,closeOnEsc:o=!0,initialFocusRef:a,id:i,returnFocusOnClose:s=!0,autoFocus:l=!0,arrowSize:g,arrowShadowColor:k,trigger:S=b.click,openDelay:_=2
100,closeDelay:T=200,isLazy:O,lazyBehavior:C="unmount",computePositionOnMount:P,...j}=e,{isOpen:N,onClose:E,onOpen:L,onToggle:q}=(0,p.q)(e),D=(0,x.useRef)(null),R=(0,x.useRef)(null),z=(0,x.useRef)(null),F=(0,x.useRef)(!1),I=(0,x.useRef)(!1);N&&(I.current=!0);let[A,M]=(0,x.useState)(!1),[G,W]=(0,x.useState)(!1),B=(0,x.useId)(),$=null!=i?i:B,[U,V,K,H]=["popover-trigger","popover-content","popover-header","popover-body"].map(e=>`${e}-${$}`),{referenceRef:J,getArrowProps:Q,getPopperProps:X,getArrowInnerProps:Y,forceUpdate:Z}=(0,d.D)({...j,enabled:N||!!P}),ee=(0,r.h)({isOpen:N,ref:z});!function(e){let{ref:t,elements:o,enabled:r}=e,a=()=>{var e,o;return null!=(o=null==(e=t.current)?void 0:e.ownerDocument)?o:document};(0,n.O)(a,"pointerdown",e=>{if(!u()||!r)return;let n=e.target,i=(null!=o?o:[t]).some(e=>{let t="current"in e?e.current:e;return(null==t?void 0:t.contains(n))||t===n});a().activeElement!==n&&i&&(e.preventDefault(),n.focus())})}({enabled:N,ref:R}),(0,c.C)(z,{focusRef:R,visible:N,shouldFocus:s&&S===b.click}),(0,c.G)(z,{focusRef:a,visible:N,shouldFocus:l&&S===b.click});let et=(0,h.k)({wasSelected:I.current,enabled:O,mode:C,isSelected:ee.present}),eo=(0,x.useCallback)((e={},r=null)=>{let n={...e,style:{...e.style,transformOrigin:m.Dq.transformOrigin.varRef,[m.Dq.arrowSize.var]:g?`${g}px`:void 0,[m.Dq.arrowShadowColor.var]:k},ref:(0,f.lq)(z,r),children:et?e.children:null,id:V,tabIndex:-1,role:"dialog",onKeyDown:(0,v.v0)(e.onKeyDown,e=>{o&&"Escape"===e.key&&E()}),onBlur:(0,v.v0)(e.onBlur,e=>{let o=y(e),r=w(z.current,o),n=w(R.current,o);N&&t&&!r&&!n&&E()}),"aria-labelledby":A?K:void 0,"aria-describedby":G?H:void 0};return S===b.hover&&(n.role="tooltip",n.onMouseEnter=(0,v.v0)(e.onMouseEnter,()=>{F.current=!0}),n.onMouseLeave=(0,v.v0)(e.onMouseLeave,e=>{null!==e.nativeEvent.relatedTarget&&(F.current=!1,setTimeout(()=>E(),T))})),n},[et,V,A,K,G,H,S,o,E,N,t,T,k,g]),er=(0,x.useCallback)((e={},t=null)=>X({...e,style:{visibility:N?"visible":"hidden",...e.style}},t),[N,X]),en=(0,x.useCallback)((e,t=null)=>({...e,ref:(0,f.lq)(t,D,J)}),[D,J]),ea=(0,x.useRef)(),ei=(0,x.useRef)(),es=(0,x.useCallback)(e=>{null==D.current&&J(e)},[J]),el=(0,x.useCallback)((e={},o=null)=>{let r={...e,ref:(0,f.lq)(R,o,es),id:U,"aria-haspopup":"dialog","aria-expanded":N,"aria-controls":V};return S===b.click&&(r.onClick=(0,v.v0)(e.onClick,q)),S===b.hover&&(r.onFocus=(0,v.v0)(e.onFocus,()=>{void 0===ea.current&&L()}),r.onBlur=(0,v.v0)(e.onBlur,e=>{let o=y(e),r=!w(z.current,o);N&&t&&r&&E()}),r.onKeyDown=(0,v.v0)(e.onKeyDown,e=>{"Escape"===e.key&&E()}),r.onMouseEnter=(0,v.v0)(e.onMouseEnter,()=>{F.current=!0,ea.current=window.setTimeout(()=>L(),_)}),r.onMouseLeave=(0,v.v0)(e.onMouseLeave,()=>{F.current=!1,ea.current&&(clearTimeout(ea.current),ea.current=void 0),ei.current=window.setTimeout(()=>{!1===F.current&&E()},T)})),r},[U,N,V,S,es,q,L,t,E,_,T]);(0,x.useEffect)(()=>()=>{ea.current&&clearTimeout(ea.current),ei.current&&clearTimeout(ei.current)},[]);let eu=(0,x.useCallback)((e={},t=null)=>({...e,id:K,ref:(0,f.lq)(t,e=>{M(!!e)})}),[K]),ec=(0,x.useCallback)((e={},t=null)=>({...e,id:H,ref:(0,f.lq)(t,e=>{W(!!e)})}),[H]);return{forceUpdate:Z,isOpen:N,onAnimationComplete:ee.onComplete,onClose:E,getAnchorProps:en,getArrowProps:Q,getArrowInnerProps:Y,getPopoverPositionerProps:er,getPopoverProps:eo,getTriggerProps:el,getHeaderProps:eu,getBodyProps:ec}}({...a,direction:i.direction});return(0,T.jsx)(g.H2,{value:s,children:(0,T.jsx)(g.WG,{value:t,children:(0,v.Pu)(o,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}O.displayName="Popover"},13591:function(e,t,o){"use strict";o.d(t,{u:function(){return l}});var r=o(5904),n=o(3949),a=o(16554),i=o(25432),s=o(85893),l=(0,a.G)(function(e,t){let{onClose:o}=(0,r.lp)(),a=(0,r.SV)();return(0,s.jsx)(n.P,{size:"sm",onClick:o,className:(0,i.cx)("chakra-popover__close-btn",e.className),__css:a.closeButton,ref:t,...e})});l.displayName="PopoverCloseButton"},50151:function(e,t,o){"use strict";o.d(t,{x:function(){return a}});var r=o(5904),n=o(67294);function a(e){let t=n.Children.only(e.children),{getTriggerProps:o}=(0,r.lp)();return(0,n.cloneElement)(t,o(t.props,t.ref))}a.displayName="PopoverTrigger"},72303:function(e,t,o){"use strict";o.d(t,{Q:function(){return l}});var r=o(5904),n=o(59235),a=o(25432),i=o(85893),s=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function l(e){var t;let{bg:o,bgColor:l,backgroundColor:u,shadow:c,boxShadow:p,shadowColor:d}=e,{getArrowProps:m,getArrowInnerProps:f}=(0,r.lp)(),v=(0,r.SV)(),h=null!=(t=null!=o?o:l)?t:u;
1return(0,i.jsx)(n.m.div,{...m(),className:"chakra-popover__arrow-positioner",children:(0,i.jsx)(n.m.div,{className:(0,a.cx)("chakra-popover__arrow",e.className),...f(e),__css:{"--popper-arrow-shadow-color":s("colors",d),"--popper-arrow-bg":s("colors",h),"--popper-arrow-shadow":s("shadows",null!=c?c:p),...v.arrow}})})}l.displayName="PopoverArrow"},5904:function(e,t,o){"use strict";o.d(t,{H2:function(){return n},SV:function(){return s},WG:function(){return i},lp:function(){return a}});var r=o(55227),[n,a]=(0,r.k)({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[i,s]=(0,r.k)({name:"PopoverStylesContext",errorMessage:"usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Popover />\" "})}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=18888)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.