@apollosproject/canvas-embeds 2.1.2399 → 2.1.2400

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/widget/index.js +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apollosproject/canvas-embeds",
3
3
  "description": "Apollos React embed widgets",
4
- "version": "2.1.2399",
4
+ "version": "2.1.2400",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
package/widget/index.js CHANGED
@@ -861,7 +861,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
861
861
  title
862
862
  url
863
863
  }
864
- `);var _Ir=(e=[],{showUnmappedFeatures:t=!1}={})=>e?.filter(e=>(e?.features||[]).some(e=>e&&(Object.keys(e).some(e=>![`id`,`__typename`].includes(e))||t&&!!e.__typename)))||[],vIr={"--color-brand-primary":`0 103 109`,"--color-brand-secondary":`23 181 130`,"--color-brand-tertiary":`110 197 184`,"--color-fg-primary":`#27272e`,"--color-fg-primary-dark":`#f4f7f8`,"--color-fg-secondary":`#68686d`,"--color-fg-secondary-dark":`#9e9fa1`,"--color-fg-tertiary":`#b8b8ba`,"--color-fg-tertiary-dark":`#636466`,"--color-fg-quaternary":`#c9c9cb`,"--color-fg-quaternary-dark":`#525355`,"--color-fg-inverse":`#ffffff`,"--color-fg-inverse-dark":`#ffffff`,"--color-fg-quinary":`rgba(39, 39, 46, 0.15)`,"--color-fg-quinary-dark":`rgba(244, 247, 248, 0.15)`,"--color-gray-0":`255 255 255`,"--color-gray-50":`248 248 250`,"--color-gray-100":`229 229 234`,"--color-gray-200":`209 209 214`,"--color-gray-300":`199 199 204`,"--color-gray-400":`175 175 179`,"--color-gray-500":`142 142 147`,"--color-gray-600":`99 99 102`,"--color-gray-700":`72 72 74`,"--color-gray-800":`58 58 60`,"--color-gray-900":`44 44 46`,"--color-gray-950":`28 28 30`,"--color-gray-1000":`0 0 0`,"--color-material-chrome":`rgb(var(--color-gray-0))`,"--color-material-chrome-dark":`rgb(28 28 30 / 0.4)`,"--color-material-screen":`rgb(255 255 255 / 0.92)`,"--color-material-screen-dark":`rgb(var(--color-gray-1000))`,"--color-material-ultrathin":`rgb(248 248 250 / 0.4)`,"--color-material-ultrathin-dark":`rgb(28 28 30 / 0.5)`,"--color-material-thin":`rgb(248 248 250 / 0.65)`,"--color-material-thin-dark":`rgb(28 28 30 / 0.7)`,"--color-material-regular":`rgb(248 248 250 / 0.8)`,"--color-material-regular-dark":`rgb(28 28 30 / 0.9)`,"--color-material-thick":`rgb(248 248 250 / 0.92)`,"--color-material-thick-dark":`rgb(28 28 30 / 0.95)`,"--color-material-opaque":`rgb(28 28 30 / 0.99)`,"--color-system-chrome":`rgb(var(--color-gray-0))`,"--color-system-chrome-dark":`rgb(var(--color-gray-950))`,"--color-system-screen":`rgb(var(--color-gray-50))`,"--color-system-screen-dark":`rgb(var(--color-gray-1000))`,"--color-system-ultrathin":`rgb(103 103 134 / 0.08)`,"--color-system-ultrathin-dark":`rgb(118 118 128 / 0.18)`,"--color-system-thin":`rgb(120 120 128 / 0.12)`,"--color-system-thin-dark":`rgb(118 118 128 / 0.24)`,"--color-system-regular":`rgb(120 120 128 / 0.16)`,"--color-system-regular-dark":`rgb(120 120 128 / 0.32)`,"--color-system-thick":`rgb(120 120 128 / 0.2)`,"--color-system-thick-dark":`rgb(120 120 128 / 0.36)`,"--color-surface-paper":`#ffffff`,"--color-surface-paper-dark":`#1c1c1e`,"--color-surface-screen":`#f8f8fa`,"--color-surface-screen-dark":`#000000`,"--color-surface-muted":`#e5e5ea`,"--color-surface-muted-dark":`#2c2c2e`,"--color-surface-inverse":`#27272e`,"--color-surface-inverse-dark":`#f4f7f8`,"--color-surface-overlay":`#ffffff`,"--color-surface-overlay-dark":`#2c2c2e`,"--color-surface-overlay-muted":`#f8f8fa`,"--color-surface-overlay-muted-dark":`#1c1c1e`,"--color-border-muted":`#e5e5ea`,"--color-border-muted-dark":`#3a3a3c`,"--color-border-secondary":`#68686d`,"--color-border-secondary-dark":`#9e9fa1`,"--color-border-primary":`#27272e`,"--color-border-primary-dark":`#f4f7f8`,"--color-border-hairline":`rgba(0, 0, 0, 0.12)`,"--color-border-hairline-dark":`rgba(255, 255, 255, 0.10)`,"--color-border-strong":`#8e8e93`,"--color-border-strong-dark":`#636466`,"--color-fg-on-action":`#ffffff`,"--color-fg-on-action-dark":`#ffffff`,"--color-status-error":`#f04438`,"--color-status-error-dark":`#fda29b`,"--color-status-error-muted":`#fef3f2`,"--color-status-error-muted-dark":`#462423`,"--color-status-success":`#12b76a`,"--color-status-success-dark":`#12b76a`,"--color-status-success-muted":`#ecfdf3`,"--color-status-success-muted-dark":`#1a3b2d`,"--color-status-warning":`#f79009`,"--color-status-warning-dark":`#f79009`,"--color-status-warning-muted":`#fffaeb`,"--color-status-warning-muted-dark":`#48331a`,"--color-brand-primary-muted":`#cce1e2`,"--color-brand-primary-muted-dark":`#162b2e`,"--color-brand-primary-on-muted":`#00676d`,"--color-brand-primary-on-muted-dark":`#6ec5b8`,"--color-brand-action-muted":`#d1f0e6`,"--color-brand-action-muted-dark":`#1b3b32`,"--color-brand-action-on-muted":`#0f7856`,"--color-brand-action-on-muted-dark":`#17b582`,"--color-brand-accent-muted":`#e2f3f1`,"--color-brand-accent-muted-dark":`#2c3e3d`,"--color-brand-accent-on-muted":`#00676d`,"--color-brand-accent-on-muted-dark":`#6ec5b8`},yIr=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,bIr=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,xIr=e=>{if(!e)return null;let t=yIr.exec(e),n=t?t.slice(1).map(e=>parseInt(e,16)):bIr.exec(e)?.slice(1).map(Number);return n&&n.every(e=>e<=255)?n.join(` `):null},T7=(e,t)=>{let n=xIr(e);return n?t===void 0?`rgb(${n})`:`rgb(${n} / ${t})`:null},SIr={"--color-material-screen":[`light`,`paper`],"--color-material-ultrathin":[`light`,`screen`],"--color-material-thin":[`light`,`screen`],"--color-material-regular":[`light`,`screen`],"--color-material-thick":[`light`,`screen`],"--color-material-chrome-dark":[`dark`,`paper`],"--color-material-ultrathin-dark":[`dark`,`paper`],"--color-material-thin-dark":[`dark`,`paper`],"--color-material-regular-dark":[`dark`,`paper`],"--color-material-thick-dark":[`dark`,`paper`]},CIr=e=>Number(/\/ ([\d.]+)\)$/.exec(vIr[e])?.[1]??1);function wIr(e,t){let n={},r=e?.colors,i=t?.colors,a=(e,t)=>{t&&(n[e]=t)};a(`--color-system-screen`,T7(r?.screen)),a(`--color-system-chrome`,T7(r?.paper)),a(`--color-material-chrome`,T7(r?.paper)),a(`--color-system-screen-dark`,T7(i?.screen)),a(`--color-system-chrome-dark`,T7(i?.paper));let o={light:r,dark:i};for(let[e,[t,n]]of Object.entries(SIr))a(e,T7(o[t]?.[n],CIr(e)));return Object.keys(n).length?n:void 0}var TIr=[[`primary`,`--color-brand-primary`],[`secondary`,`--color-brand-secondary`],[`secondary`,`--color-brand-tertiary`]];function EIr(e){let t={};for(let[n,r]of TIr){let i=xIr(e?.colors?.[n]);i&&(t[r]=i)}return Object.keys(t).length?t:void 0}function DIr(e,t,n,r){let i={...EIr(n)},a={...EIr(r)};for(let e of Object.keys(i))a[e]??=`inherit`;let o=(e,t)=>Object.keys(t).length?`${e}{${Object.entries(t).map(([e,t])=>`${e}:${t}`).join(`;`)}}`:``;return o(e,i)+o(t,a)||null}var OIr=`bg-system-screen dark:bg-system-screen-dark`,kIr=({lightTheme:e,darkTheme:t,children:n})=>{let r=`ct-${(0,z.useId)().replace(/[^\w-]/g,``)}`,i=wIr(e,t);if(!i)return(0,q.jsx)(q.Fragment,{children:n});let a=`[data-content-theme=${r}]`,o=DIr(a,`.dark ${a}`,e,t);return(0,q.jsxs)(`div`,{"data-content-theme":r,className:OIr,style:i,children:[o?(0,q.jsx)(`style`,{children:o}):null,n]})},AIr=e=>typeof e.percentComplete==`number`,jIr=e=>AIr(e)||!!e.childContentItemsConnection?.edges?.length,MIr=({content:e,pageCount:t,enabled:n})=>{let r=ZOe(),[i,a]=(0,z.useState)(null),o=(0,z.useCallback)(e=>a(e),[]),s=(0,z.useRef)(null),c=(0,z.useRef)(null),l=t>1,u=n&&!jIr(e)&&!e.isCompleted,d=(0,z.useCallback)(()=>{u&&c.current!==e.id&&(c.current=e.id,r?.({contentItem:{id:e.id},action:`COMPLETE`}))},[u,e.id,r]);return(0,z.useEffect)(()=>{n&&s.current!==e.id&&(s.current=e.id,r?.({contentItem:{id:e.id},action:`VIEW`}),l||d())},[d,e.id,n,l,r]),(0,z.useEffect)(()=>{if(!u||!l||!i||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&(d(),e.disconnect())});return e.observe(i),()=>e.disconnect()},[u,d,l,i]),{readingEndRef:o}};Uw(),ske();var NIr=e=>!!(e&&(`embedHtml`in e&&e.embedHtml||e.sources?.some(e=>!!e?.uri))),PIr=({content:e,setIsCTAOpen:t,setInteractionType:n})=>(0,q.jsx)(`div`,{className:`flex justify-end`,children:(0,q.jsxs)(`div`,{className:`fixed right-0 bottom-0 mr-4 [@media(width>=56rem)]:mr-8 [@media(width>=80rem)]:-mr-72 [@media(width>=80rem)]:right-auto mt-4 mb-8 py-1 flex flex-col justify-between items-center`,children:[(0,q.jsx)(`div`,{className:`mb-4`,children:(0,q.jsx)(yC,{onClick:()=>{t(!0),n(S7.Like)},circular:!0,children:(0,q.jsxs)(`div`,{className:`flex flex-col px-1.5 items-center`,children:[(0,q.jsx)(iT,{weight:e?.isLiked?`fill`:`regular`,size:20,className:`md:hidden ${e?.isLiked?`fill-action`:`text-action`}`}),(0,q.jsx)(iT,{weight:e?.isLiked?`fill`:`regular`,size:28,className:`hidden md:flex ${e?.isLiked?`fill-action`:`text-action`}`}),e.likedCount?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`absolute -bottom-2.5 bg-white dark:bg-brand px-2 rounded-full text-xs z-9`,children:(0,q.jsx)(OC,{fg:`secondary`,className:`text-sm text-white dark:text-brand`,children:e.likedCount})}),(0,q.jsx)(`span`,{className:`absolute -bottom-2.5 bg-accent/20 dark:bg-brand px-2 rounded-full text-xs z-10`,children:(0,q.jsx)(OC,{fg:`secondary`,className:`text-sm text-accent/100`,children:e.likedCount})})]}):null]})})}),e.commentsEnabled?(0,q.jsx)(`div`,{className:`mb-4`,children:(0,q.jsx)(yC,{onClick:()=>{t(!0),n(S7.Comment)},circular:!0,children:(0,q.jsxs)(`div`,{className:`flex flex-col px-1.5 items-center`,children:[(0,q.jsx)(tT,{weight:`fill`,size:20,className:`md:hidden text-action`}),(0,q.jsx)(tT,{weight:`fill`,size:28,className:`hidden md:flex text-action`}),Nw(e.comments)?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`absolute -bottom-2.5 bg-white dark:bg-brand px-2 rounded-full text-xs z-9`,children:(0,q.jsx)(OC,{fg:`secondary`,className:`text-sm text-white dark:text-brand`,children:e.comments?.length??0})}),(0,q.jsx)(`span`,{className:`absolute -bottom-2.5 bg-accent/20 dark:bg-brand px-2 rounded-full text-xs z-10`,children:(0,q.jsx)(OC,{fg:`secondary`,className:`text-sm text-accent/100`,children:e.comments?.length??0})})]})]})})}):null,e.sharing?(0,q.jsxs)(gIr,{circular:!0,sharable:e.sharing,children:[(0,q.jsx)(sT,{weight:`fill`,size:20,className:`mx-1.5 text-fg-secondary dark:text-fg-secondary-dark md:hidden`}),(0,q.jsx)(sT,{weight:`fill`,size:28,className:`mx-2 text-fg-secondary dark:text-fg-secondary-dark hidden md:flex`})]}):(0,q.jsx)(`div`,{})]})}),FIr=({lightTheme:e,darkTheme:t,...n})=>(0,q.jsx)(kIr,{lightTheme:e,darkTheme:t,children:(0,q.jsx)(IIr,{...n})}),IIr=({content:e,currentChurch:t,isInteractionEnabled:n=!1,userCanComment:r,userProfile:i,theme:a,executedConnectFeatureId:o,guideProgressEnabled:s=!1})=>{let c=$ke(),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(S7.Default),p=eAe(),m=(0,z.useMemo)(()=>_Ir(e.pages,{showUnmappedFeatures:p}),[e.pages,p]),{readingEndRef:h}=MIr({content:e,pageCount:m?.length??0,enabled:s});if(!e)return null;let g=[...e?.videos??[],...e?.audios??[]].find(NIr),_=!!g,v=g?.__typename===`AudioMedia`,y=!!e?.coverImage,b=e?.childContentItemsConnection?.edges??[],x=e?.siblingContentItemsConnection?.edges??[],S=`md:border md:border-system-regular md:rounded-3xl py-6 md:p-6 mb-8 border-b border-b-system-regular`,C=m?.length&&m?.length>1,w=n?`pr-14 md:pr-16 [@media(width>=56rem)]:pr-0`:``;return(0,q.jsxs)(mIr,{children:[(0,q.jsxs)(`div`,{className:C?S:``,children:[y&&!_?(0,q.jsx)(cT,{image:e?.coverImage??void 0,className:`h-full w-full object-cover rounded-xl`}):null,_&&v?(0,q.jsx)(hwr,{media:g,coverImage:e?.coverImage??void 0,content:e??void 0,shouldSendInteractions:!!r}):null,_&&!v?(0,q.jsx)(cPr,{media:g,coverImage:e?.coverImage??void 0,content:e??void 0,shouldSendInteractions:!!r}):null,(0,q.jsxs)(`div`,{className:`${_||y?`mt-6 md:mt-12`:``} ${w} mb-4 mx-auto [&>*]:mx-auto [&>*]:max-w-[65ch]`,children:[(0,q.jsx)(`div`,{className:`prose dark:prose-invert`,children:(0,q.jsx)(OC,{as:`h1`,children:e.title})}),e.parentChannel?.name?(0,q.jsx)(OC,{fg:`secondary`,"data-testid":`content-item-category`,children:e.parentChannel.name}):null,(0,q.jsx)(`div`,{className:`h-px bg-system-thin my-8`}),e.htmlContent?(0,q.jsx)(aAe,{feature:{content:e.htmlContent}}):null,m?.length?(0,q.jsx)(`div`,{className:`mt-8 flex flex-col gap-4`,children:(0,q.jsx)(hIr,{features:m[0]?.features??[],church:t,userProfile:i,isInteractionEnabled:n,theme:a,executedConnectFeatureId:o})}):null]})]}),m?.slice(1).map(e=>e&&e.features?.length&&e.features.length>0&&(0,q.jsx)(`div`,{className:S,children:(0,q.jsx)(`div`,{className:`${w} flex flex-col gap-4`,children:(0,q.jsx)(hIr,{features:e.features??[],church:t,userProfile:i,isInteractionEnabled:n,theme:a,executedConnectFeatureId:o})})},e.id)),(0,q.jsx)(`div`,{ref:h,"data-testid":`content-item-reading-end`}),(0,q.jsxs)(`div`,{className:`${w} mx-auto [&>*]:mx-auto [&>*]:max-w-[65ch]`,children:[n?(0,q.jsx)(PIr,{content:e,setIsCTAOpen:u,setInteractionType:f}):null,b.length?(0,q.jsx)(BC,{className:`mt-10`,children:b.map(e=>{let t=(e?.node?.coverImage?.sources??[])[0]?.uri;return(0,q.jsx)(HC,{as:_C,to:{contentId:e?.node?.id},title:e?.node?.title??void 0,subtitle:e?.node?.summary,leadingAccessory:(0,q.jsx)(aw,{src:t??void 0}),trailingAccessory:(0,q.jsx)(Hw,{})},e?.node?.id)})}):null,e?.parentItem?(0,q.jsxs)(`div`,{className:`mt-12`,children:[(0,q.jsx)(OC,{as:`h3`,className:`mb-4`,children:`This series`}),(0,q.jsx)(mke,{content:e?.parentItem})]}):null,x.length?(0,q.jsxs)(`div`,{className:`mt-10`,children:[(0,q.jsx)(OC,{as:`h3`,children:`In this series`}),(0,q.jsx)(COe,{children:x.map(e=>(0,q.jsx)(mke,{content:e?.node??void 0,tile:!0},e?.node?.id))})]}):null]}),(0,q.jsx)(jPr,{type:d,currentPageParams:c,isOpen:l,setIsOpen:u,church:t,hasComments:!Nw(e.comments),hasLikes:!!(e?.likedCount??0),isInteractionEnabled:n,theme:a})]})};Sw(`
864
+ `);var _Ir=(e=[],{showUnmappedFeatures:t=!1}={})=>e?.filter(e=>(e?.features||[]).some(e=>e&&(Object.keys(e).some(e=>![`id`,`__typename`].includes(e))||t&&!!e.__typename)))||[],vIr={"--color-brand-primary":`0 103 109`,"--color-brand-secondary":`23 181 130`,"--color-brand-tertiary":`110 197 184`,"--color-fg-primary":`#27272e`,"--color-fg-primary-dark":`#f4f7f8`,"--color-fg-secondary":`#68686d`,"--color-fg-secondary-dark":`#9e9fa1`,"--color-fg-tertiary":`#b8b8ba`,"--color-fg-tertiary-dark":`#636466`,"--color-fg-quaternary":`#c9c9cb`,"--color-fg-quaternary-dark":`#525355`,"--color-fg-inverse":`#ffffff`,"--color-fg-inverse-dark":`#ffffff`,"--color-fg-quinary":`rgba(39, 39, 46, 0.15)`,"--color-fg-quinary-dark":`rgba(244, 247, 248, 0.15)`,"--color-gray-0":`255 255 255`,"--color-gray-50":`248 248 250`,"--color-gray-100":`229 229 234`,"--color-gray-200":`209 209 214`,"--color-gray-300":`199 199 204`,"--color-gray-400":`175 175 179`,"--color-gray-500":`142 142 147`,"--color-gray-600":`99 99 102`,"--color-gray-700":`72 72 74`,"--color-gray-800":`58 58 60`,"--color-gray-900":`44 44 46`,"--color-gray-950":`28 28 30`,"--color-gray-1000":`0 0 0`,"--color-material-chrome":`rgb(var(--color-gray-0))`,"--color-material-chrome-dark":`rgb(28 28 30 / 0.4)`,"--color-material-screen":`rgb(255 255 255 / 0.92)`,"--color-material-screen-dark":`rgb(var(--color-gray-1000))`,"--color-material-ultrathin":`rgb(248 248 250 / 0.4)`,"--color-material-ultrathin-dark":`rgb(28 28 30 / 0.5)`,"--color-material-thin":`rgb(248 248 250 / 0.65)`,"--color-material-thin-dark":`rgb(28 28 30 / 0.7)`,"--color-material-regular":`rgb(248 248 250 / 0.8)`,"--color-material-regular-dark":`rgb(28 28 30 / 0.9)`,"--color-material-thick":`rgb(248 248 250 / 0.92)`,"--color-material-thick-dark":`rgb(28 28 30 / 0.95)`,"--color-material-opaque":`rgb(28 28 30 / 0.99)`,"--color-system-chrome":`rgb(var(--color-gray-0))`,"--color-system-chrome-dark":`rgb(var(--color-gray-950))`,"--color-system-screen":`rgb(var(--color-gray-50))`,"--color-system-screen-dark":`rgb(var(--color-gray-1000))`,"--color-system-ultrathin":`rgb(103 103 134 / 0.08)`,"--color-system-ultrathin-dark":`rgb(118 118 128 / 0.18)`,"--color-system-thin":`rgb(120 120 128 / 0.12)`,"--color-system-thin-dark":`rgb(118 118 128 / 0.24)`,"--color-system-regular":`rgb(120 120 128 / 0.16)`,"--color-system-regular-dark":`rgb(120 120 128 / 0.32)`,"--color-system-thick":`rgb(120 120 128 / 0.2)`,"--color-system-thick-dark":`rgb(120 120 128 / 0.36)`,"--color-surface-paper":`#ffffff`,"--color-surface-paper-dark":`#1c1c1e`,"--color-surface-screen":`#f8f8fa`,"--color-surface-screen-dark":`#000000`,"--color-surface-muted":`#e5e5ea`,"--color-surface-muted-dark":`#2c2c2e`,"--color-surface-inverse":`#27272e`,"--color-surface-inverse-dark":`#f4f7f8`,"--color-surface-overlay":`#ffffff`,"--color-surface-overlay-dark":`#2c2c2e`,"--color-surface-overlay-muted":`#f8f8fa`,"--color-surface-overlay-muted-dark":`#1c1c1e`,"--color-border-muted":`#e5e5ea`,"--color-border-muted-dark":`#3a3a3c`,"--color-border-secondary":`#68686d`,"--color-border-secondary-dark":`#9e9fa1`,"--color-border-primary":`#27272e`,"--color-border-primary-dark":`#f4f7f8`,"--color-border-hairline":`rgba(0, 0, 0, 0.12)`,"--color-border-hairline-dark":`rgba(255, 255, 255, 0.10)`,"--color-border-strong":`#8e8e93`,"--color-border-strong-dark":`#636466`,"--color-fg-on-action":`#ffffff`,"--color-fg-on-action-dark":`#ffffff`,"--color-status-error":`#f04438`,"--color-status-error-dark":`#fda29b`,"--color-status-error-muted":`#fef3f2`,"--color-status-error-muted-dark":`#462423`,"--color-status-success":`#12b76a`,"--color-status-success-dark":`#12b76a`,"--color-status-success-muted":`#ecfdf3`,"--color-status-success-muted-dark":`#1a3b2d`,"--color-status-warning":`#f79009`,"--color-status-warning-dark":`#f79009`,"--color-status-warning-muted":`#fffaeb`,"--color-status-warning-muted-dark":`#48331a`,"--color-brand-primary-muted":`#cce1e2`,"--color-brand-primary-muted-dark":`#162b2e`,"--color-brand-primary-on-muted":`#00676d`,"--color-brand-primary-on-muted-dark":`#6ec5b8`,"--color-brand-action-muted":`#d1f0e6`,"--color-brand-action-muted-dark":`#1b3b32`,"--color-brand-action-on-muted":`#0f7856`,"--color-brand-action-on-muted-dark":`#17b582`,"--color-brand-accent-muted":`#e2f3f1`,"--color-brand-accent-muted-dark":`#2c3e3d`,"--color-brand-accent-on-muted":`#00676d`,"--color-brand-accent-on-muted-dark":`#6ec5b8`},yIr=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,bIr=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,xIr=e=>{if(!e)return null;let t=yIr.exec(e),n=t?t.slice(1).map(e=>parseInt(e,16)):bIr.exec(e)?.slice(1).map(Number);return n&&n.every(e=>e<=255)?n.join(` `):null},T7=(e,t)=>{let n=xIr(e);return n?t===void 0?`rgb(${n})`:`rgb(${n} / ${t})`:null},SIr={"--color-material-screen":[`light`,`paper`],"--color-material-ultrathin":[`light`,`screen`],"--color-material-thin":[`light`,`screen`],"--color-material-regular":[`light`,`screen`],"--color-material-thick":[`light`,`screen`],"--color-material-chrome-dark":[`dark`,`paper`],"--color-material-ultrathin-dark":[`dark`,`paper`],"--color-material-thin-dark":[`dark`,`paper`],"--color-material-regular-dark":[`dark`,`paper`],"--color-material-thick-dark":[`dark`,`paper`]},CIr=e=>Number(/\/ ([\d.]+)\)$/.exec(vIr[e])?.[1]??1);function wIr(e,t){let n={},r=e?.colors,i=t?.colors,a=(e,t)=>{t&&(n[e]=t)};a(`--color-system-screen`,T7(r?.screen)),a(`--color-system-chrome`,T7(r?.paper)),a(`--color-material-chrome`,T7(r?.paper)),a(`--color-system-screen-dark`,T7(i?.screen)),a(`--color-system-chrome-dark`,T7(i?.paper));let o={light:r,dark:i};for(let[e,[t,n]]of Object.entries(SIr))a(e,T7(o[t]?.[n],CIr(e)));return Object.keys(n).length?n:void 0}var TIr=[[`primary`,`--color-brand-primary`],[`secondary`,`--color-brand-secondary`],[`secondary`,`--color-brand-tertiary`]];function EIr(e){let t={};for(let[n,r]of TIr){let i=xIr(e?.colors?.[n]);i&&(t[r]=i)}return Object.keys(t).length?t:void 0}function DIr(e,t,n,r){let i={...EIr(n)},a={...EIr(r)};for(let e of Object.keys(i))a[e]??=`inherit`;let o=(e,t)=>Object.keys(t).length?`${e}{${Object.entries(t).map(([e,t])=>`${e}:${t}`).join(`;`)}}`:``;return o(e,i)+o(t,a)||null}var OIr=`bg-system-screen dark:bg-system-screen-dark`,kIr=({lightTheme:e,darkTheme:t,children:n})=>{let r=`ct-${(0,z.useId)().replace(/[^\w-]/g,``)}`,i=wIr(e,t);if(!i)return(0,q.jsx)(q.Fragment,{children:n});let a=`[data-content-theme=${r}]`,o=DIr(a,`.dark ${a}`,e,t);return(0,q.jsxs)(`div`,{"data-content-theme":r,className:OIr,style:i,children:[o?(0,q.jsx)(`style`,{children:o}):null,n]})},AIr=e=>typeof e.percentComplete==`number`,jIr=e=>AIr(e)||!!e.childContentItemsConnection?.edges?.length,MIr=({content:e,pageCount:t,enabled:n})=>{let r=ZOe(),[i,a]=(0,z.useState)(null),o=(0,z.useCallback)(e=>a(e),[]),s=(0,z.useRef)(null),c=(0,z.useRef)(null),l=t>1,u=n&&!jIr(e)&&!e.isCompleted,d=(0,z.useCallback)(()=>{u&&c.current!==e.id&&(c.current=e.id,r?.({contentItem:{id:e.id},action:`COMPLETE`}))},[u,e.id,r]);return(0,z.useEffect)(()=>{n&&s.current!==e.id&&(s.current=e.id,r?.({contentItem:{id:e.id},action:`VIEW`}),l||d())},[d,e.id,n,l,r]),(0,z.useEffect)(()=>{if(!u||!l||!i||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&(d(),e.disconnect())});return e.observe(i),()=>e.disconnect()},[u,d,l,i]),{readingEndRef:o}};Uw(),ske();var NIr=e=>!!(e&&(`embedHtml`in e&&e.embedHtml||e.sources?.some(e=>!!e?.uri))),PIr=({content:e,setIsCTAOpen:t,setInteractionType:n})=>(0,q.jsx)(`div`,{className:`flex justify-end`,children:(0,q.jsxs)(`div`,{className:`fixed right-0 bottom-0 mr-4 [@media(width>=56rem)]:mr-8 [@media(width>=80rem)]:-mr-72 [@media(width>=80rem)]:right-auto mt-4 mb-8 py-1 flex flex-col justify-between items-center`,children:[(0,q.jsx)(`div`,{className:`mb-4`,children:(0,q.jsx)(yC,{onClick:()=>{t(!0),n(S7.Like)},circular:!0,children:(0,q.jsxs)(`div`,{className:`flex flex-col px-1.5 items-center`,children:[(0,q.jsx)(iT,{weight:e?.isLiked?`fill`:`regular`,size:20,className:`md:hidden ${e?.isLiked?`fill-action`:`text-action`}`}),(0,q.jsx)(iT,{weight:e?.isLiked?`fill`:`regular`,size:28,className:`hidden md:flex ${e?.isLiked?`fill-action`:`text-action`}`}),e.likedCount?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`absolute -bottom-2.5 bg-white dark:bg-brand px-2 rounded-full text-xs z-9`,children:(0,q.jsx)(OC,{fg:`secondary`,className:`text-sm text-white dark:text-brand`,children:e.likedCount})}),(0,q.jsx)(`span`,{className:`absolute -bottom-2.5 bg-accent/20 dark:bg-brand px-2 rounded-full text-xs z-10`,children:(0,q.jsx)(OC,{fg:`secondary`,className:`text-sm text-accent/100`,children:e.likedCount})})]}):null]})})}),e.commentsEnabled?(0,q.jsx)(`div`,{className:`mb-4`,children:(0,q.jsx)(yC,{onClick:()=>{t(!0),n(S7.Comment)},circular:!0,children:(0,q.jsxs)(`div`,{className:`flex flex-col px-1.5 items-center`,children:[(0,q.jsx)(tT,{weight:`fill`,size:20,className:`md:hidden text-action`}),(0,q.jsx)(tT,{weight:`fill`,size:28,className:`hidden md:flex text-action`}),Nw(e.comments)?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`absolute -bottom-2.5 bg-white dark:bg-brand px-2 rounded-full text-xs z-9`,children:(0,q.jsx)(OC,{fg:`secondary`,className:`text-sm text-white dark:text-brand`,children:e.comments?.length??0})}),(0,q.jsx)(`span`,{className:`absolute -bottom-2.5 bg-accent/20 dark:bg-brand px-2 rounded-full text-xs z-10`,children:(0,q.jsx)(OC,{fg:`secondary`,className:`text-sm text-accent/100`,children:e.comments?.length??0})})]})]})})}):null,e.sharing?(0,q.jsxs)(gIr,{circular:!0,sharable:e.sharing,children:[(0,q.jsx)(sT,{weight:`fill`,size:20,className:`mx-1.5 text-fg-secondary dark:text-fg-secondary-dark md:hidden`}),(0,q.jsx)(sT,{weight:`fill`,size:28,className:`mx-2 text-fg-secondary dark:text-fg-secondary-dark hidden md:flex`})]}):(0,q.jsx)(`div`,{})]})}),FIr=({lightTheme:e,darkTheme:t,...n})=>(0,q.jsx)(kIr,{lightTheme:e,darkTheme:t,children:(0,q.jsx)(IIr,{...n})}),IIr=({content:e,currentChurch:t,isInteractionEnabled:n=!1,userCanComment:r,userProfile:i,theme:a,executedConnectFeatureId:o,guideProgressEnabled:s=!1,childCards:c=!1})=>{let l=$ke(),[u,d]=(0,z.useState)(!1),[f,p]=(0,z.useState)(S7.Default),m=eAe(),h=(0,z.useMemo)(()=>_Ir(e.pages,{showUnmappedFeatures:m}),[e.pages,m]),{readingEndRef:g}=MIr({content:e,pageCount:h?.length??0,enabled:s});if(!e)return null;let _=[...e?.videos??[],...e?.audios??[]].find(NIr),v=!!_,y=_?.__typename===`AudioMedia`,b=!!e?.coverImage,x=e?.childContentItemsConnection?.edges??[],S=x.flatMap(e=>e?.node?[e.node]:[]),C=e?.siblingContentItemsConnection?.edges??[],w=`md:border md:border-system-regular md:rounded-3xl py-6 md:p-6 mb-8 border-b border-b-system-regular`,T=h?.length&&h?.length>1,E=n?`pr-14 md:pr-16 [@media(width>=56rem)]:pr-0`:``;return(0,q.jsxs)(mIr,{children:[(0,q.jsxs)(`div`,{className:T?w:``,children:[b&&!v?(0,q.jsx)(cT,{image:e?.coverImage??void 0,className:`h-full w-full object-cover rounded-xl`}):null,v&&y?(0,q.jsx)(hwr,{media:_,coverImage:e?.coverImage??void 0,content:e??void 0,shouldSendInteractions:!!r}):null,v&&!y?(0,q.jsx)(cPr,{media:_,coverImage:e?.coverImage??void 0,content:e??void 0,shouldSendInteractions:!!r}):null,(0,q.jsxs)(`div`,{className:`${v||b?`mt-6 md:mt-12`:``} ${E} mb-4 mx-auto [&>*]:mx-auto [&>*]:max-w-[65ch]`,children:[(0,q.jsx)(`div`,{className:`prose dark:prose-invert`,children:(0,q.jsx)(OC,{as:`h1`,children:e.title})}),e.parentChannel?.name?(0,q.jsx)(OC,{fg:`secondary`,"data-testid":`content-item-category`,children:e.parentChannel.name}):null,(0,q.jsx)(`div`,{className:`h-px bg-system-thin my-8`}),e.htmlContent?(0,q.jsx)(aAe,{feature:{content:e.htmlContent}}):null,h?.length?(0,q.jsx)(`div`,{className:`mt-8 flex flex-col gap-4`,children:(0,q.jsx)(hIr,{features:h[0]?.features??[],church:t,userProfile:i,isInteractionEnabled:n,theme:a,executedConnectFeatureId:o})}):null]})]}),h?.slice(1).map(e=>e&&e.features?.length&&e.features.length>0&&(0,q.jsx)(`div`,{className:w,children:(0,q.jsx)(`div`,{className:`${E} flex flex-col gap-4`,children:(0,q.jsx)(hIr,{features:e.features??[],church:t,userProfile:i,isInteractionEnabled:n,theme:a,executedConnectFeatureId:o})})},e.id)),(0,q.jsx)(`div`,{ref:g,"data-testid":`content-item-reading-end`}),(0,q.jsxs)(`div`,{className:`${E} mx-auto [&>*]:mx-auto [&>*]:max-w-[65ch]`,children:[n?(0,q.jsx)(PIr,{content:e,setIsCTAOpen:d,setInteractionType:p}):null,c?S.length?(0,q.jsx)(`div`,{"data-testid":`child-content-cards`,className:`mt-10 grid gap-4 sm:grid-cols-2`,children:S.map(t=>(0,q.jsx)(mke,{content:t,labelText:e.title??void 0,tile:!0},t.id))}):null:x.length?(0,q.jsx)(BC,{className:`mt-10`,children:x.map(e=>{let t=(e?.node?.coverImage?.sources??[])[0]?.uri;return(0,q.jsx)(HC,{as:_C,to:{contentId:e?.node?.id},title:e?.node?.title??void 0,subtitle:e?.node?.summary,leadingAccessory:(0,q.jsx)(aw,{src:t??void 0}),trailingAccessory:(0,q.jsx)(Hw,{})},e?.node?.id)})}):null,e?.parentItem?(0,q.jsxs)(`div`,{className:`mt-12`,children:[(0,q.jsx)(OC,{as:`h3`,className:`mb-4`,children:`This series`}),(0,q.jsx)(mke,{content:e?.parentItem})]}):null,C.length?(0,q.jsxs)(`div`,{className:`mt-10`,children:[(0,q.jsx)(OC,{as:`h3`,children:`In this series`}),(0,q.jsx)(COe,{children:C.map(e=>(0,q.jsx)(mke,{content:e?.node??void 0,tile:!0},e?.node?.id))})]}):null]}),(0,q.jsx)(jPr,{type:f,currentPageParams:l,isOpen:u,setIsOpen:d,church:t,hasComments:!Nw(e.comments),hasLikes:!!(e?.likedCount??0),isInteractionEnabled:n,theme:a})]})};Sw(`
865
865
  fragment ContentItemFragment on ContentItem {
866
866
  id
867
867
  title