markdown-flow-ui 0.1.100-beta.13 → 0.1.100-beta.15

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 (49) hide show
  1. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.cjs.js +1 -1
  2. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
  3. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
  4. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
  5. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
  6. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  7. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
  8. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  9. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
  10. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
  11. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
  12. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
  13. package/dist/_virtual/index.cjs4.js +1 -1
  14. package/dist/_virtual/index.cjs5.js +1 -1
  15. package/dist/_virtual/index.cjs6.js +1 -1
  16. package/dist/_virtual/index.es4.js +4 -4
  17. package/dist/_virtual/index.es5.js +4 -4
  18. package/dist/_virtual/index.es6.js +5 -5
  19. package/dist/assets/markdown-flow-ui.css +1 -1
  20. package/dist/components/ContentRender/IframeSandbox.cjs.js +4 -4
  21. package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
  22. package/dist/components/ContentRender/IframeSandbox.d.ts +1 -0
  23. package/dist/components/ContentRender/IframeSandbox.es.js +237 -199
  24. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  25. package/dist/components/ContentRender/SandboxApp.cjs.js +2 -2
  26. package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -1
  27. package/dist/components/ContentRender/SandboxApp.d.ts +1 -0
  28. package/dist/components/ContentRender/SandboxApp.es.js +70 -66
  29. package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
  30. package/dist/components/Slide/Player.cjs.js +1 -1
  31. package/dist/components/Slide/Player.cjs.js.map +1 -1
  32. package/dist/components/Slide/Player.d.ts +1 -0
  33. package/dist/components/Slide/Player.es.js +157 -151
  34. package/dist/components/Slide/Player.es.js.map +1 -1
  35. package/dist/components/Slide/Slide.cjs.js +1 -1
  36. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  37. package/dist/components/Slide/Slide.d.ts +1 -0
  38. package/dist/components/Slide/Slide.es.js +325 -266
  39. package/dist/components/Slide/Slide.es.js.map +1 -1
  40. package/dist/components/Slide/Slide.stories.d.ts +2 -0
  41. package/dist/components/Slide/useSlide.cjs.js +1 -1
  42. package/dist/components/Slide/useSlide.cjs.js.map +1 -1
  43. package/dist/components/Slide/useSlide.d.ts +1 -0
  44. package/dist/components/Slide/useSlide.es.js +109 -87
  45. package/dist/components/Slide/useSlide.es.js.map +1 -1
  46. package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
  47. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  48. package/dist/markdown-flow-ui-lib.css +1 -1
  49. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../../_virtual/jsx-runtime.cjs.js"),t=require("react"),He=require("../../lib/browserUserActivation.cjs.js"),Ke=require("../../lib/sandboxInteraction.cjs.js"),M=require("../../lib/utils.cjs.js"),Ue=require("../ContentRender/ContentRender.cjs.js"),pe=require("../ContentRender/IframeSandbox.cjs.js");require("../ui/inputGroup/input-group.cjs.js");const he=require("../../lib/interaction-defaults.cjs.js"),Ve=require("./Player.cjs.js"),ze=require("./useSlide.cjs.js"),Ge=require("./useWakePlayerFromIframe.cjs.js");;/* empty css */const We=1e3,be=t.memo(({content:y,title:E,defaultButtonText:c,defaultInputText:_,defaultSelectedValues:b,confirmButtonText:S,copyButtonText:T,copiedButtonText:R,onSend:F,readonly:C=!1})=>n.jsxRuntimeExports.jsxs("div",{className:"slide-player__interaction-card",children:[n.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-header",children:n.jsxRuntimeExports.jsx("p",{className:"slide-player__interaction-title",children:E})}),n.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-body",children:n.jsxRuntimeExports.jsx(Ue.default,{content:y,defaultButtonText:c,defaultInputText:_,defaultSelectedValues:b,confirmButtonText:S,copyButtonText:T,copiedButtonText:R,onSend:F,readonly:C,enableTypewriter:!1,sandboxMode:"content"})}),n.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-arrow"})]}));be.displayName="InteractionOverlayCard";const Ye=(y,E)=>y.length===E.length&&y.every((c,_)=>{const b=E[_];return c.sequence_number===b?.sequence_number&&c.type===b?.type&&c.content===b?.content}),Je=({elementList:y=[],showPlayer:E=!0,playerAlwaysVisible:c=!1,playerClassName:_,interactionTitle:b,interactionTexts:S,playerAutoHideDelay:T=3e3,interactionDefaultValueOptions:R,onSend:F,onPlayerVisibilityChange:C,onStepChange:ee,className:ve,onPointerDown:te,...ge})=>{const J=t.useRef(null),Q=t.useRef(null),ne=t.useRef(null),P=t.useRef(null),q=t.useRef(null),A=t.useRef(null),re=t.useRef([]),L=t.useRef(!1),{currentElementList:f,stepElementLists:se,slideElementList:O,currentIndex:p,audioList:oe,currentAudioSequenceIndexes:k,currentInteractionElement:N,canGoPrev:ye,canGoNext:v,handlePrev:ue,handleNext:h}=ze.default(y),le=t.useMemo(()=>{if(!(p<0))return O[p]},[p,O]),Ee=O.filter(e=>e.is_renderable!==!1).length===1,d=E&&(O.length>0||oe.length>0||!!N),[ie,$]=t.useState(!0),[D,B]=t.useState(!1),[Se,X]=t.useState(!1),[Re]=t.useState(()=>He.hasBrowserUserActivation()),we=Re||Se,[Ie,H]=t.useState(-1),[K,U]=t.useState(-1),[r,Z]=t.useState(),[V,z]=t.useState(!1),w=d&&(c||ie),g=t.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),m=t.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),I=t.useCallback(()=>{q.current!==null&&(window.clearTimeout(q.current),q.current=null)},[]),j=t.useCallback(()=>{I(),m(),H(-1),U(-1),Z(void 0),z(!1)},[I,m]),G=t.useCallback(()=>{const e=k[0];return typeof e!="number"?!1:(U(0),H(e),!0)},[k]),W=t.useCallback(()=>{m(),z(!1),!G()&&v&&h()},[v,m,h,G]),i=t.useCallback((e=D)=>{d&&($(!0),g(),!(c||!e||T<=0)&&(P.current=window.setTimeout(()=>{$(!1),P.current=null},T)))},[g,D,c,T,d]);t.useEffect(()=>()=>{I(),g(),m()},[I,m,g]),t.useEffect(()=>(C?.(w),()=>{C?.(!1)}),[C,w]),t.useEffect(()=>{ee?.(le,p)},[p,le,ee]),t.useEffect(()=>{if(!d){g(),$(!1);return}if(c){g(),$(!0);return}D||i(!0)},[g,D,c,d,i]),t.useEffect(()=>{if(typeof window>"u")return;const e=s=>{s.origin===window.location.origin&&Ke.isSandboxInteractionMessage(s.data)&&d&&(B(!0),i(!0))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[d,i]),Ge.default({sectionRef:J,enabled:d,onWake:()=>{B(!0),i(!0)}}),t.useEffect(()=>{if(j(),!(f.length===0&&!N)){if(N){Z(N),z(!0);return}if(!G()&&v)return q.current=window.setTimeout(()=>{q.current=null,h()},We),()=>{I()}}},[v,I,f,N,h,j,G]);const ae=t.useMemo(()=>r?he.getInteractionDefaultValues(typeof r.content=="string"?r.content:void 0,r.user_input,R):{},[r,R]),je=t.useMemo(()=>{if(r)return he.getInteractionDefaultSelectedValues(typeof r.content=="string"?r.content:void 0,r.user_input,R)},[r,R]),ce=!!r?.user_input?.trim(),de=!!r?.readonly||ce,fe=de||ce,_e=t.useCallback(e=>{const u=[...e.selectedValues??[],e.inputText?.trim()??"",e.buttonText?.trim()??""].filter(Boolean).join(", ");Z(a=>!a||!u?a:{...a,user_input:u}),F?.(e,r),W()},[r,W,F]);t.useEffect(()=>{if(m(),!(!V||!fe))return A.current=window.setTimeout(()=>{A.current=null,W()},2e3),()=>{m()}},[m,W,V,fe]);const Te=e=>e?e.type==="slot"?n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:e.content}):e.type==="html"?n.jsxRuntimeExports.jsx(pe.default,{className:"content-render-iframe",hideFullScreen:!0,mode:"blackboard",type:"sandbox",content:e.content}):n.jsxRuntimeExports.jsx(pe.default,{className:"content-render-iframe",hideFullScreen:!0,mode:"blackboard",type:"markdown",content:e.content}):null,Ce=(e=[],s=!1)=>{if(e.length===0)return null;const u=e.filter(o=>o.is_renderable!==!1).length,a=e.reduce((o,l,x)=>l.is_renderable!==!1?x:o,-1);return n.jsxRuntimeExports.jsx("div",{className:"slide-stage__content flex w-full flex-col gap-4",children:e.map((o,l)=>{const x=o.type==="html"&&o.is_renderable===!1;return n.jsxRuntimeExports.jsx("div",{ref:s&&l===a?ne:null,"aria-hidden":x||void 0,className:M.cn("w-full shrink-0",u===1&&o.is_renderable!==!1&&"slide-element--single",x?"pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0":o.is_renderable===!1&&"hidden"),children:Te(o)},o.sequence_number??`${o.type}-${l}`)})})},{mountedStepStates:Pe,currentMountedStateIndex:qe}=t.useMemo(()=>{const e=[],s=new Map;return se.forEach((u,a)=>{const o=e.findIndex(l=>Ye(l.elementList,u));if(o>=0){e[o]?.sourceStepIndexes.push(a),s.set(a,o);return}e.push({elementList:u,sourceStepIndexes:[a]}),s.set(a,e.length-1)}),{mountedStepStates:e,currentMountedStateIndex:p>=0?s.get(p)??-1:-1}},[p,se]),Ae=()=>{const e=J.current;if(e){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}e.requestFullscreen?.().catch(()=>{})}},me=t.useCallback(()=>{const e=Q.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[]),ke=t.useCallback(()=>{L.current=!0,B(!0),X(!0),i(!0),j(),ue()},[ue,j,i]),Ne=t.useCallback(()=>{L.current=!0,B(!0),X(!0),i(!0),j(),h()},[h,j,i]),Be=t.useCallback(e=>{if(K<0||k[K]!==e)return;const s=K+1,u=k[s];if(typeof u=="number"){U(s),H(u);return}H(-1),U(-1),v&&h()},[v,k,K,h]),Me=t.useCallback(()=>{r&&z(e=>!e)},[r]),xe=t.useCallback(e=>{e.stopPropagation(),w&&i(!0)},[ie,i]),Fe=t.useCallback(e=>{te?.(e),B(!0),i(!0)},[te,i]),Le=!!r&&V,Y=t.useMemo(()=>f.map((e,s)=>`${e.sequence_number??`${e.type}-${s}`}:${String(e.is_new??"")}`),[f]);return t.useEffect(()=>{const e=re.current,a=(e.length>0&&e.length<Y.length&&e.every((l,x)=>l===Y[x])?f.slice(e.length):[]).some(l=>l.is_new===!1);if(re.current=Y,!a)return;const o=window.requestAnimationFrame(()=>{const l=Q.current,x=ne.current;if(!l||!x)return;const Oe=l.getBoundingClientRect(),$e=x.getBoundingClientRect(),De=l.scrollTop+($e.top-Oe.top);l.scrollTo({top:Math.max(De,0),behavior:"smooth"})});return()=>{window.cancelAnimationFrame(o)}},[f,Y]),t.useEffect(()=>{if(!L.current||(L.current=!1,f.length===0))return;const e=window.requestAnimationFrame(()=>{me()});return()=>{window.cancelAnimationFrame(e)}},[f,me]),n.jsxRuntimeExports.jsxs("section",{ref:J,className:M.cn("relative h-full w-full",ve),onPointerDown:Fe,...ge,children:[n.jsxRuntimeExports.jsx("div",{className:M.cn("h-full min-h-0 w-full",Ee?"slide-content--single":"grid gap-4"),children:f.length>0?n.jsxRuntimeExports.jsx("div",{className:"slide-stage",children:n.jsxRuntimeExports.jsx("div",{ref:Q,className:"slide-stage__layer w-full",children:Pe.map((e,s)=>{const u=s===qe;return n.jsxRuntimeExports.jsx("div",{"aria-hidden":!u||void 0,className:"w-full",style:{display:u?void 0:"none"},children:Ce(e.elementList,u)},e.sourceStepIndexes[0]??s)})})}):null}),Le?n.jsxRuntimeExports.jsx("div",{className:M.cn("slide-interaction-overlay",w&&d?"slide-interaction-overlay--with-player":"slide-interaction-overlay--standalone"),onClick:xe,onPointerDown:xe,children:n.jsxRuntimeExports.jsx(be,{content:String(r?.content??""),defaultButtonText:ae.buttonText??"",defaultInputText:ae.inputText??"",defaultSelectedValues:je,confirmButtonText:S?.confirmButtonText,copyButtonText:S?.copyButtonText,copiedButtonText:S?.copiedButtonText,onSend:_e,readonly:de,title:S?.title??b??"Submit the content below to continue."})}):null,d?n.jsxRuntimeExports.jsx(Ve.default,{audioList:oe,className:M.cn("absolute left-1/2 bottom-6 z-[2] -translate-x-1/2",_,!w&&"pointer-events-none opacity-0"),currentAudioIndex:Ie,defaultPlaying:we,hasInteraction:!!r,isInteractionOpen:V,nextDisabled:!v,onEnded:Be,onFullscreen:Ae,onInteractionToggle:Me,onPlayRequest:()=>X(!0),onNext:Ne,onPrev:ke,prevDisabled:!ye,showControls:w}):null]})};exports.default=Je;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../../_virtual/jsx-runtime.cjs.js"),t=require("react"),Xe=require("../../lib/browserUserActivation.cjs.js"),Ze=require("../../lib/sandboxInteraction.cjs.js"),F=require("../../lib/utils.cjs.js"),et=require("../ContentRender/ContentRender.cjs.js"),je=require("../ContentRender/IframeSandbox.cjs.js");require("../ui/inputGroup/input-group.cjs.js");const we=require("../../lib/interaction-defaults.cjs.js"),tt=require("./Player.cjs.js"),nt=require("./useSlide.cjs.js"),rt=require("./useWakePlayerFromIframe.cjs.js");;/* empty css */const st=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.js"),ot=1e3,Ie=t.memo(({content:R,title:j,defaultButtonText:c,defaultInputText:k,defaultSelectedValues:y,confirmButtonText:X,copyButtonText:w,copiedButtonText:A,onSend:I,readonly:L=!1})=>n.jsxRuntimeExports.jsxs("div",{className:"slide-player__interaction-card",children:[n.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-header",children:n.jsxRuntimeExports.jsx("p",{className:"slide-player__interaction-title",children:j})}),n.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-body",children:n.jsxRuntimeExports.jsx(et.default,{content:R,defaultButtonText:c,defaultInputText:k,defaultSelectedValues:y,confirmButtonText:X,copyButtonText:w,copiedButtonText:A,onSend:I,readonly:L,enableTypewriter:!1,sandboxMode:"content"})}),n.jsxRuntimeExports.jsx("div",{className:"slide-player__interaction-arrow"})]}));Ie.displayName="InteractionOverlayCard";const ut=(R,j)=>R.length===j.length&&R.every((c,k)=>{const y=j[k];return c.sequence_number===y?.sequence_number&&c.type===y?.type&&c.content===y?.content}),lt=({elementList:R=[],showPlayer:j=!0,playerAlwaysVisible:c=!1,playerClassName:k,bufferingText:y="Buffering...",interactionTitle:X,interactionTexts:w,playerAutoHideDelay:A=3e3,interactionDefaultValueOptions:I,onSend:L,onPlayerVisibilityChange:Z,onStepChange:oe,className:Ce,onPointerDown:ue,..._e})=>{const ee=t.useRef(null),te=t.useRef(null),le=t.useRef(null),q=t.useRef(null),N=t.useRef(null),M=t.useRef(null),ae=t.useRef([]),H=t.useRef(!1),{currentElementList:x,stepElementLists:ie,slideElementList:O,currentIndex:b,audioList:ce,currentAudioSequenceIndexes:p,currentStepHasSpeakableElement:C,currentInteractionElement:d,canGoPrev:Te,canGoNext:v,handlePrev:de,handleNext:S}=nt.default(R),fe=t.useMemo(()=>{if(!(b<0))return O[b]},[b,O]),Pe=O.filter(e=>e.is_renderable!==!1).length===1,f=j&&(O.length>0||ce.length>0||!!d),[me,$]=t.useState(!0),[K,B]=t.useState(!1),[ke,ne]=t.useState(!1),[Ae]=t.useState(()=>Xe.hasBrowserUserActivation()),qe=Ae||ke,[Ne,D]=t.useState(-1),[z,V]=t.useState(-1),[xe,m]=t.useState(!1),[W,pe]=t.useState(!1),[s,re]=t.useState(),[U,G]=t.useState(!1),_=f&&(c||me||xe),{mountedStepStates:Me,currentMountedStateIndex:se}=t.useMemo(()=>{const e=[],r=new Map;return ie.forEach((u,i)=>{const o=e.findIndex(l=>ut(l.elementList,u));if(o>=0){e[o]?.sourceStepIndexes.push(i),r.set(i,o);return}e.push({elementList:u,sourceStepIndexes:[i]}),r.set(i,e.length-1)}),{mountedStepStates:e,currentMountedStateIndex:b>=0?r.get(b)??-1:-1}},[b,ie]),he=t.useMemo(()=>p.join(","),[p]),ge=t.useMemo(()=>d?`${d.sequence_number??"none"}:${String(d.content??"")}`:"none",[d]),Be=t.useMemo(()=>[se,ge,he].join("|"),[he,ge,se]),E=t.useCallback(()=>{q.current!==null&&(window.clearTimeout(q.current),q.current=null)},[]),h=t.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),T=t.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),P=t.useCallback(()=>{T(),h(),D(-1),V(-1),m(!1),pe(!1),re(void 0),G(!1)},[T,h]),Y=t.useCallback(()=>{const e=p[0];return typeof e!="number"?!1:(V(0),D(e),!0)},[p]),J=t.useCallback(()=>{h(),G(!1),!Y()&&v&&S()},[v,h,S,Y]),a=t.useCallback((e=K)=>{f&&($(!0),E(),!(c||!e||A<=0)&&(q.current=window.setTimeout(()=>{$(!1),q.current=null},A)))},[E,K,c,A,f]);t.useEffect(()=>()=>{T(),E(),h()},[T,h,E]),t.useEffect(()=>(Z?.(_),()=>{Z?.(!1)}),[Z,_]),t.useEffect(()=>{oe?.(fe,b)},[b,fe,oe]),t.useEffect(()=>{if(!f){E(),$(!1);return}if(c){E(),$(!0);return}K||a(!0)},[E,K,c,f,a]),t.useEffect(()=>{if(typeof window>"u")return;const e=r=>{r.origin===window.location.origin&&Ze.isSandboxInteractionMessage(r.data)&&f&&(B(!0),a(!0))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[f,a]),rt.default({sectionRef:ee,enabled:f,onWake:()=>{B(!0),a(!0)}}),t.useEffect(()=>{if(P(),!(x.length===0&&!d)){if(d){re(d),G(!0);return}if(!Y()){if(C){m(!0);return}if(v)return N.current=window.setTimeout(()=>{N.current=null,S()},ot),()=>{T()}}}},[v,T,x.length,d,Be,C,S,P,Y]),t.useEffect(()=>{if(!C||d){m(!1);return}if(W){m(!1);return}p.length===0&&m(!0)},[p.length,d,C,W]);const be=t.useMemo(()=>s?we.getInteractionDefaultValues(typeof s.content=="string"?s.content:void 0,s.user_input,I):{},[s,I]),Fe=t.useMemo(()=>{if(s)return we.getInteractionDefaultSelectedValues(typeof s.content=="string"?s.content:void 0,s.user_input,I)},[s,I]),Se=!!s?.user_input?.trim(),ye=!!s?.readonly||Se,ve=ye||Se,Le=t.useCallback(e=>{const u=[...e.selectedValues??[],e.inputText?.trim()??"",e.buttonText?.trim()??""].filter(Boolean).join(", ");re(i=>!i||!u?i:{...i,user_input:u}),L?.(e,s),J()},[s,J,L]);t.useEffect(()=>{if(h(),!(!U||!ve))return M.current=window.setTimeout(()=>{M.current=null,J()},2e3),()=>{h()}},[h,J,U,ve]);const He=(e,r={})=>e?e.type==="slot"?n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:e.content}):e.type==="html"?n.jsxRuntimeExports.jsx(je.default,{className:"content-render-iframe",hideFullScreen:!0,mode:"blackboard",replaceRootScreenHeightWithFull:r.replaceRootScreenHeightWithFull,type:"sandbox",content:e.content}):n.jsxRuntimeExports.jsx(je.default,{className:"content-render-iframe",hideFullScreen:!0,mode:"blackboard",type:"markdown",content:e.content}):null,Oe=(e=[],r=!1)=>{if(e.length===0)return null;const u=e.filter(o=>o.is_renderable!==!1).length,i=e.reduce((o,l,g)=>l.is_renderable!==!1?g:o,-1);return n.jsxRuntimeExports.jsx("div",{className:"slide-stage__content flex w-full flex-col gap-4",children:e.map((o,l)=>{const g=o.type==="html"&&o.is_renderable===!1;return n.jsxRuntimeExports.jsx("div",{ref:r&&l===i?le:null,"aria-hidden":g||void 0,className:F.cn("w-full shrink-0",u===1&&o.is_renderable!==!1&&"slide-element--single",g?"pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0":o.is_renderable===!1&&"hidden"),children:He(o,{replaceRootScreenHeightWithFull:u===1&&o.type==="html"&&o.is_renderable!==!1})},o.sequence_number??`${o.type}-${l}`)})})},$e=()=>{const e=ee.current;if(e){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}e.requestFullscreen?.().catch(()=>{})}},Ee=t.useCallback(()=>{const e=te.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[]),Ke=t.useCallback(()=>{H.current=!0,B(!0),ne(!0),m(!1),a(!0),P(),de()},[de,P,a]),De=t.useCallback(()=>{H.current=!0,B(!0),ne(!0),m(!1),a(!0),P(),S()},[S,P,a]),ze=t.useCallback(e=>{if(!C||W){m(!1);return}m(e)},[C,W]),Ve=t.useCallback(e=>{if(z<0||p[z]!==e)return;const r=z+1,u=p[r];if(typeof u=="number"){V(r),D(u);return}D(-1),V(-1),pe(!0),m(!1),v&&S()},[v,p,z,S]),We=t.useCallback(()=>{s&&G(e=>!e)},[s]),Re=t.useCallback(e=>{e.stopPropagation(),_&&a(!0)},[me,a]),Ue=t.useCallback(e=>{ue?.(e),B(!0),a(!0)},[ue,a]),Ge=!!s&&U,Q=t.useMemo(()=>x.map((e,r)=>`${e.sequence_number??`${e.type}-${r}`}:${String(e.is_new??"")}`),[x]);return t.useEffect(()=>{const e=ae.current,i=(e.length>0&&e.length<Q.length&&e.every((l,g)=>l===Q[g])?x.slice(e.length):[]).some(l=>l.is_new===!1);if(ae.current=Q,!i)return;const o=window.requestAnimationFrame(()=>{const l=te.current,g=le.current;if(!l||!g)return;const Ye=l.getBoundingClientRect(),Je=g.getBoundingClientRect(),Qe=l.scrollTop+(Je.top-Ye.top);l.scrollTo({top:Math.max(Qe,0),behavior:"smooth"})});return()=>{window.cancelAnimationFrame(o)}},[x,Q]),t.useEffect(()=>{if(!H.current||(H.current=!1,x.length===0))return;const e=window.requestAnimationFrame(()=>{Ee()});return()=>{window.cancelAnimationFrame(e)}},[x,Ee]),n.jsxRuntimeExports.jsxs("section",{ref:ee,className:F.cn("relative h-full w-full",Ce),onPointerDown:Ue,..._e,children:[n.jsxRuntimeExports.jsx("div",{className:F.cn("h-full min-h-0 w-full",Pe?"slide-content--single":"grid gap-4"),children:x.length>0?n.jsxRuntimeExports.jsx("div",{className:"slide-stage",children:n.jsxRuntimeExports.jsx("div",{ref:te,className:"slide-stage__layer w-full",children:Me.map((e,r)=>{const u=r===se;return n.jsxRuntimeExports.jsx("div",{"aria-hidden":!u||void 0,className:"w-full h-full",style:{display:u?void 0:"none"},children:Oe(e.elementList,u)},e.sourceStepIndexes[0]??r)})})}):null}),xe?n.jsxRuntimeExports.jsxs("div",{className:"pointer-events-none absolute left-1/2 top-1/2 z-[3] flex size-28 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-2 rounded-2xl bg-foreground/65 px-3 py-4 text-center text-xs leading-4 font-medium text-background shadow-lg backdrop-blur-sm",children:[n.jsxRuntimeExports.jsx(st.default,{className:"size-5 animate-spin text-background"}),n.jsxRuntimeExports.jsx("span",{children:y})]}):null,Ge?n.jsxRuntimeExports.jsx("div",{className:F.cn("slide-interaction-overlay",_&&f?"slide-interaction-overlay--with-player":"slide-interaction-overlay--standalone"),onClick:Re,onPointerDown:Re,children:n.jsxRuntimeExports.jsx(Ie,{content:String(s?.content??""),defaultButtonText:be.buttonText??"",defaultInputText:be.inputText??"",defaultSelectedValues:Fe,confirmButtonText:w?.confirmButtonText,copyButtonText:w?.copyButtonText,copiedButtonText:w?.copiedButtonText,onSend:Le,readonly:ye,title:w?.title??X??"Submit the content below to continue."})}):null,f?n.jsxRuntimeExports.jsx(tt.default,{audioList:ce,className:F.cn("absolute left-1/2 bottom-6 z-[2] -translate-x-1/2",k,!_&&"pointer-events-none opacity-0"),currentAudioIndex:Ne,defaultPlaying:qe,hasInteraction:!!s,isInteractionOpen:U,onLoadingChange:ze,nextDisabled:!v,onEnded:Ve,onFullscreen:$e,onInteractionToggle:We,onPlayRequest:()=>ne(!0),onNext:De,onPrev:Ke,prevDisabled:!Te,showControls:_}):null]})};exports.default=lt;
2
2
  //# sourceMappingURL=Slide.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slide.cjs.js","sources":["../../../src/components/Slide/Slide.tsx"],"sourcesContent":["import React, {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { hasBrowserUserActivation } from \"../../lib/browserUserActivation\";\nimport { isSandboxInteractionMessage } from \"../../lib/sandboxInteraction\";\nimport { cn } from \"../../lib/utils\";\nimport ContentRender from \"../ContentRender\";\nimport type { ContentRenderProps } from \"../ContentRender/ContentRender\";\nimport IframeSandbox from \"../ContentRender/IframeSandbox\";\nimport type { OnSendContentParams } from \"../types\";\nimport {\n getInteractionDefaultSelectedValues,\n getInteractionDefaultValues,\n type InteractionDefaultValueOptions,\n} from \"../../lib/interaction-defaults\";\nimport Player from \"./Player\";\nimport type { Element } from \"./types\";\nimport useSlide from \"./useSlide\";\nimport useWakePlayerFromIframe from \"./useWakePlayerFromIframe\";\nimport \"./slide.css\";\nexport type { Element, ElementAudioSegment } from \"./types\";\n\nconst CHECKPOINT_AUTO_ADVANCE_DELAY_MS = 1000;\n\ninterface InteractionOverlayCardProps {\n content: string;\n title: string;\n defaultButtonText?: string;\n defaultInputText?: string;\n defaultSelectedValues?: string[];\n confirmButtonText?: string;\n copyButtonText?: string;\n copiedButtonText?: string;\n onSend?: (content: OnSendContentParams) => void;\n readonly?: boolean;\n}\n\nexport interface SlideInteractionTexts\n extends Pick<\n ContentRenderProps,\n \"confirmButtonText\" | \"copyButtonText\" | \"copiedButtonText\"\n > {\n title?: string;\n}\n\nconst InteractionOverlayCard = memo(\n ({\n content,\n title,\n defaultButtonText,\n defaultInputText,\n defaultSelectedValues,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n onSend,\n readonly = false,\n }: InteractionOverlayCardProps) => (\n <div className=\"slide-player__interaction-card\">\n <div className=\"slide-player__interaction-header\">\n <p className=\"slide-player__interaction-title\">{title}</p>\n </div>\n <div className=\"slide-player__interaction-body\">\n <ContentRender\n content={content}\n defaultButtonText={defaultButtonText}\n defaultInputText={defaultInputText}\n defaultSelectedValues={defaultSelectedValues}\n confirmButtonText={confirmButtonText}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n onSend={onSend}\n readonly={readonly}\n enableTypewriter={false}\n sandboxMode=\"content\"\n />\n </div>\n <div className=\"slide-player__interaction-arrow\" />\n </div>\n )\n);\n\nInteractionOverlayCard.displayName = \"InteractionOverlayCard\";\n\nconst areStepElementListsEqual = (\n prevElementList: Element[],\n nextElementList: Element[]\n) =>\n prevElementList.length === nextElementList.length &&\n prevElementList.every((element, index) => {\n const nextElement = nextElementList[index];\n\n return (\n element.sequence_number === nextElement?.sequence_number &&\n element.type === nextElement?.type &&\n element.content === nextElement?.content\n );\n });\n\nexport interface SlideProps extends React.ComponentProps<\"section\"> {\n elementList?: Element[];\n showPlayer?: boolean;\n playerAlwaysVisible?: boolean;\n playerClassName?: string;\n interactionTitle?: string;\n interactionTexts?: SlideInteractionTexts;\n playerAutoHideDelay?: number;\n interactionDefaultValueOptions?: InteractionDefaultValueOptions;\n onSend?: (content: OnSendContentParams, element?: Element) => void;\n onPlayerVisibilityChange?: (visible: boolean) => void;\n onStepChange?: (element: Element | undefined, index: number) => void;\n}\n\nconst Slide: React.FC<SlideProps> = ({\n elementList = [],\n showPlayer = true,\n playerAlwaysVisible = false,\n playerClassName,\n interactionTitle,\n interactionTexts,\n playerAutoHideDelay = 3000,\n interactionDefaultValueOptions,\n onSend,\n onPlayerVisibilityChange,\n onStepChange,\n className,\n onPointerDown,\n ...props\n}) => {\n const sectionRef = useRef<HTMLElement | null>(null);\n const stageLayerRef = useRef<HTMLDivElement | null>(null);\n const lastElementRef = useRef<HTMLDivElement | null>(null);\n const playerHideTimerRef = useRef<number | null>(null);\n const autoAdvanceTimerRef = useRef<number | null>(null);\n const interactionAutoCloseTimerRef = useRef<number | null>(null);\n const prevRenderElementKeysRef = useRef<string[]>([]);\n const shouldScrollToBottomRef = useRef(false);\n const {\n currentElementList,\n stepElementLists,\n slideElementList,\n currentIndex,\n audioList,\n currentAudioSequenceIndexes,\n currentInteractionElement,\n canGoPrev,\n canGoNext,\n handlePrev: goPrev,\n handleNext: goNext,\n } = useSlide(elementList);\n const currentStepElement = useMemo(() => {\n if (currentIndex < 0) {\n return undefined;\n }\n\n return slideElementList[currentIndex];\n }, [currentIndex, slideElementList]);\n const visibleMarkerCount = slideElementList.filter(\n (element) => element.is_renderable !== false\n ).length;\n const isSingleSlide = visibleMarkerCount === 1;\n const shouldRenderPlayer =\n showPlayer &&\n (slideElementList.length > 0 ||\n audioList.length > 0 ||\n Boolean(currentInteractionElement));\n const [isPlayerVisible, setIsPlayerVisible] = useState(true);\n const [hasPlayerInteracted, setHasPlayerInteracted] = useState(false);\n const [hasPlaybackInteracted, setHasPlaybackInteracted] = useState(false);\n const [shouldAutoPlay] = useState(() => hasBrowserUserActivation());\n const canAutoPlayAudio = shouldAutoPlay || hasPlaybackInteracted;\n const [currentAudioIndex, setCurrentAudioIndex] = useState(-1);\n const [currentAudioSequencePosition, setCurrentAudioSequencePosition] =\n useState(-1);\n const [activeInteractionElement, setActiveInteractionElement] = useState<\n Element | undefined\n >();\n const [isInteractionOverlayOpen, setIsInteractionOverlayOpen] =\n useState(false);\n const playerVisible =\n shouldRenderPlayer && (playerAlwaysVisible || isPlayerVisible);\n\n const clearPlayerHideTimer = useCallback(() => {\n if (playerHideTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(playerHideTimerRef.current);\n playerHideTimerRef.current = null;\n }, []);\n\n const clearInteractionAutoCloseTimer = useCallback(() => {\n if (interactionAutoCloseTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(interactionAutoCloseTimerRef.current);\n interactionAutoCloseTimerRef.current = null;\n }, []);\n\n const clearAutoAdvanceTimer = useCallback(() => {\n if (autoAdvanceTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(autoAdvanceTimerRef.current);\n autoAdvanceTimerRef.current = null;\n }, []);\n\n const resetAudioSequence = useCallback(() => {\n clearAutoAdvanceTimer();\n clearInteractionAutoCloseTimer();\n setCurrentAudioIndex(-1);\n setCurrentAudioSequencePosition(-1);\n setActiveInteractionElement(undefined);\n setIsInteractionOverlayOpen(false);\n }, [clearAutoAdvanceTimer, clearInteractionAutoCloseTimer]);\n\n const startCurrentAudioSequence = useCallback(() => {\n const nextAudioIndex = currentAudioSequenceIndexes[0];\n\n if (typeof nextAudioIndex !== \"number\") {\n return false;\n }\n\n // Start the first audio segment for the current step immediately.\n setCurrentAudioSequencePosition(0);\n setCurrentAudioIndex(nextAudioIndex);\n return true;\n }, [currentAudioSequenceIndexes]);\n\n const continueAfterInteraction = useCallback(() => {\n clearInteractionAutoCloseTimer();\n setIsInteractionOverlayOpen(false);\n\n if (startCurrentAudioSequence()) {\n return;\n }\n\n if (canGoNext) {\n goNext();\n }\n }, [\n canGoNext,\n clearInteractionAutoCloseTimer,\n goNext,\n startCurrentAudioSequence,\n ]);\n\n const showPlayerControls = useCallback(\n (enableAutoHide = hasPlayerInteracted) => {\n if (!shouldRenderPlayer) {\n return;\n }\n\n setIsPlayerVisible(true);\n clearPlayerHideTimer();\n\n if (playerAlwaysVisible || !enableAutoHide || playerAutoHideDelay <= 0) {\n return;\n }\n\n playerHideTimerRef.current = window.setTimeout(() => {\n setIsPlayerVisible(false);\n playerHideTimerRef.current = null;\n }, playerAutoHideDelay);\n },\n [\n clearPlayerHideTimer,\n hasPlayerInteracted,\n playerAlwaysVisible,\n playerAutoHideDelay,\n shouldRenderPlayer,\n ]\n );\n\n useEffect(() => {\n return () => {\n clearAutoAdvanceTimer();\n clearPlayerHideTimer();\n clearInteractionAutoCloseTimer();\n };\n }, [\n clearAutoAdvanceTimer,\n clearInteractionAutoCloseTimer,\n clearPlayerHideTimer,\n ]);\n\n useEffect(() => {\n onPlayerVisibilityChange?.(playerVisible);\n\n return () => {\n onPlayerVisibilityChange?.(false);\n };\n }, [onPlayerVisibilityChange, playerVisible]);\n\n useEffect(() => {\n onStepChange?.(currentStepElement, currentIndex);\n }, [currentIndex, currentStepElement, onStepChange]);\n\n useEffect(() => {\n if (!shouldRenderPlayer) {\n clearPlayerHideTimer();\n setIsPlayerVisible(false);\n return;\n }\n\n if (playerAlwaysVisible) {\n clearPlayerHideTimer();\n setIsPlayerVisible(true);\n return;\n }\n\n if (!hasPlayerInteracted) {\n // Keep the initial player visible briefly, then hide it automatically.\n showPlayerControls(true);\n }\n }, [\n clearPlayerHideTimer,\n hasPlayerInteracted,\n playerAlwaysVisible,\n shouldRenderPlayer,\n showPlayerControls,\n ]);\n\n useEffect(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const handleSandboxInteraction = (event: MessageEvent) => {\n if (event.origin !== window.location.origin) {\n return;\n }\n\n if (!isSandboxInteractionMessage(event.data)) {\n return;\n }\n\n if (!shouldRenderPlayer) {\n return;\n }\n\n // Restore player controls without blocking native iframe scrolling.\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n };\n\n window.addEventListener(\"message\", handleSandboxInteraction);\n\n return () => {\n window.removeEventListener(\"message\", handleSandboxInteraction);\n };\n }, [shouldRenderPlayer, showPlayerControls]);\n\n useWakePlayerFromIframe({\n sectionRef,\n enabled: shouldRenderPlayer,\n onWake: () => {\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n },\n });\n\n useEffect(() => {\n resetAudioSequence();\n\n if (currentElementList.length === 0 && !currentInteractionElement) {\n return;\n }\n\n if (currentInteractionElement) {\n // Show the interaction gate before playing any follow-up audio.\n setActiveInteractionElement(currentInteractionElement);\n setIsInteractionOverlayOpen(true);\n return;\n }\n\n if (startCurrentAudioSequence()) {\n return;\n }\n\n if (!canGoNext) {\n return;\n }\n\n // Auto-advance silent marker-only steps so playback flow does not stall.\n autoAdvanceTimerRef.current = window.setTimeout(() => {\n autoAdvanceTimerRef.current = null;\n goNext();\n }, CHECKPOINT_AUTO_ADVANCE_DELAY_MS);\n\n return () => {\n clearAutoAdvanceTimer();\n };\n }, [\n canGoNext,\n clearAutoAdvanceTimer,\n currentElementList,\n currentInteractionElement,\n goNext,\n resetAudioSequence,\n startCurrentAudioSequence,\n ]);\n\n const interactionDefaults = useMemo(() => {\n if (!activeInteractionElement) {\n return {};\n }\n\n return getInteractionDefaultValues(\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined,\n activeInteractionElement.user_input,\n interactionDefaultValueOptions\n );\n }, [activeInteractionElement, interactionDefaultValueOptions]);\n\n const interactionDefaultSelectedValues = useMemo(() => {\n if (!activeInteractionElement) {\n return undefined;\n }\n\n return getInteractionDefaultSelectedValues(\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined,\n activeInteractionElement.user_input,\n interactionDefaultValueOptions\n );\n }, [activeInteractionElement, interactionDefaultValueOptions]);\n\n const hasResolvedInteractionInput = Boolean(\n activeInteractionElement?.user_input?.trim()\n );\n const isInteractionReadonly =\n Boolean(activeInteractionElement?.readonly) || hasResolvedInteractionInput;\n const shouldAutoContinueInteraction =\n isInteractionReadonly || hasResolvedInteractionInput;\n\n const handleInteractionSend = useCallback(\n (content: OnSendContentParams) => {\n const submittedValues = [\n ...(content.selectedValues ?? []),\n content.inputText?.trim() ?? \"\",\n content.buttonText?.trim() ?? \"\",\n ].filter(Boolean);\n const resolvedUserInput = submittedValues.join(\", \");\n\n setActiveInteractionElement((prevElement) => {\n if (!prevElement || !resolvedUserInput) {\n return prevElement;\n }\n\n return {\n ...prevElement,\n user_input: resolvedUserInput,\n };\n });\n\n onSend?.(content, activeInteractionElement);\n continueAfterInteraction();\n },\n [activeInteractionElement, continueAfterInteraction, onSend]\n );\n\n useEffect(() => {\n clearInteractionAutoCloseTimer();\n\n if (!isInteractionOverlayOpen || !shouldAutoContinueInteraction) {\n return;\n }\n\n // Auto-close passive interaction checkpoints to keep playback moving.\n interactionAutoCloseTimerRef.current = window.setTimeout(() => {\n interactionAutoCloseTimerRef.current = null;\n\n continueAfterInteraction();\n }, 2000);\n\n return () => {\n clearInteractionAutoCloseTimer();\n };\n }, [\n clearInteractionAutoCloseTimer,\n continueAfterInteraction,\n isInteractionOverlayOpen,\n shouldAutoContinueInteraction,\n ]);\n\n const renderSlideElement = (element?: Element) => {\n if (!element) {\n return null;\n }\n\n if (element.type === \"slot\") {\n return <>{element.content}</>;\n }\n\n if (element.type === \"html\") {\n return (\n <IframeSandbox\n className=\"content-render-iframe\"\n hideFullScreen\n mode=\"blackboard\"\n type=\"sandbox\"\n content={element.content as string}\n />\n );\n }\n\n return (\n <IframeSandbox\n className=\"content-render-iframe\"\n hideFullScreen\n mode=\"blackboard\"\n type=\"markdown\"\n content={element.content as string}\n />\n );\n };\n\n const renderSlideElementList = (\n elementList: Element[] = [],\n isActiveStep = false\n ) => {\n if (elementList.length === 0) {\n return null;\n }\n\n const visibleElementCount = elementList.filter(\n (element) => element.is_renderable !== false\n ).length;\n const lastVisibleElementIndex = elementList.reduce(\n (lastVisibleIndex, element, index) =>\n element.is_renderable !== false ? index : lastVisibleIndex,\n -1\n );\n\n return (\n <div className=\"slide-stage__content flex w-full flex-col gap-4\">\n {elementList.map((element, index) => {\n const isPreRenderedHtml =\n element.type === \"html\" && element.is_renderable === false;\n\n return (\n <div\n key={element.sequence_number ?? `${element.type}-${index}`}\n ref={\n isActiveStep && index === lastVisibleElementIndex\n ? lastElementRef\n : null\n }\n aria-hidden={isPreRenderedHtml || undefined}\n className={cn(\n \"w-full shrink-0\",\n visibleElementCount === 1 &&\n element.is_renderable !== false &&\n \"slide-element--single\",\n isPreRenderedHtml\n ? \"pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0\"\n : element.is_renderable === false && \"hidden\"\n )}\n >\n {renderSlideElement(element)}\n </div>\n );\n })}\n </div>\n );\n };\n\n const { mountedStepStates, currentMountedStateIndex } = useMemo(() => {\n const nextMountedStepStates: Array<{\n elementList: Element[];\n sourceStepIndexes: number[];\n }> = [];\n const mountedStateIndexByStep = new Map<number, number>();\n\n stepElementLists.forEach((stepElementList, stepIndex) => {\n const existingMountedStateIndex = nextMountedStepStates.findIndex(\n (mountedStepState) =>\n areStepElementListsEqual(\n mountedStepState.elementList,\n stepElementList\n )\n );\n\n if (existingMountedStateIndex >= 0) {\n nextMountedStepStates[\n existingMountedStateIndex\n ]?.sourceStepIndexes.push(stepIndex);\n mountedStateIndexByStep.set(stepIndex, existingMountedStateIndex);\n return;\n }\n\n nextMountedStepStates.push({\n elementList: stepElementList,\n sourceStepIndexes: [stepIndex],\n });\n mountedStateIndexByStep.set(stepIndex, nextMountedStepStates.length - 1);\n });\n\n return {\n mountedStepStates: nextMountedStepStates,\n currentMountedStateIndex:\n currentIndex >= 0\n ? (mountedStateIndexByStep.get(currentIndex) ?? -1)\n : -1,\n };\n }, [currentIndex, stepElementLists]);\n\n const handleFullscreen = () => {\n const target = sectionRef.current;\n if (!target) return;\n\n if (document.fullscreenElement) {\n document.exitFullscreen().catch(() => {});\n return;\n }\n\n target.requestFullscreen?.().catch(() => {});\n };\n\n const scrollStageToBottom = useCallback(() => {\n const stageLayerElement = stageLayerRef.current;\n\n if (!stageLayerElement) {\n return;\n }\n\n // Keep the latest content visible after manual player navigation.\n stageLayerElement.scrollTo({\n top: stageLayerElement.scrollHeight,\n behavior: \"smooth\",\n });\n }, []);\n\n const handlePrev = useCallback(() => {\n shouldScrollToBottomRef.current = true;\n setHasPlayerInteracted(true);\n setHasPlaybackInteracted(true);\n showPlayerControls(true);\n resetAudioSequence();\n goPrev();\n }, [goPrev, resetAudioSequence, showPlayerControls]);\n\n const handleNext = useCallback(() => {\n shouldScrollToBottomRef.current = true;\n setHasPlayerInteracted(true);\n setHasPlaybackInteracted(true);\n showPlayerControls(true);\n resetAudioSequence();\n goNext();\n }, [goNext, resetAudioSequence, showPlayerControls]);\n\n const handlePlayerEnded = useCallback(\n (audioIndex: number) => {\n if (currentAudioSequencePosition < 0) {\n return;\n }\n\n if (\n currentAudioSequenceIndexes[currentAudioSequencePosition] !== audioIndex\n ) {\n return;\n }\n\n const nextSequencePosition = currentAudioSequencePosition + 1;\n const nextAudioIndex = currentAudioSequenceIndexes[nextSequencePosition];\n\n if (typeof nextAudioIndex === \"number\") {\n setCurrentAudioSequencePosition(nextSequencePosition);\n setCurrentAudioIndex(nextAudioIndex);\n return;\n }\n\n setCurrentAudioIndex(-1);\n setCurrentAudioSequencePosition(-1);\n\n if (canGoNext) {\n goNext();\n }\n },\n [\n canGoNext,\n currentAudioSequenceIndexes,\n currentAudioSequencePosition,\n goNext,\n ]\n );\n\n const handleInteractionToggle = useCallback(() => {\n if (!activeInteractionElement) {\n return;\n }\n\n setIsInteractionOverlayOpen((prevOpen) => !prevOpen);\n }, [activeInteractionElement]);\n\n const stopOverlayPropagation = useCallback(\n (\n event:\n | React.PointerEvent<HTMLDivElement>\n | React.MouseEvent<HTMLDivElement>\n ) => {\n event.stopPropagation();\n\n // Keep the player visible a bit longer when users interact with the overlay.\n if (playerVisible) {\n showPlayerControls(true);\n }\n },\n [isPlayerVisible, showPlayerControls]\n );\n\n const handleSurfacePointerDown = useCallback(\n (event: React.PointerEvent<HTMLElement>) => {\n onPointerDown?.(event);\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n },\n [onPointerDown, showPlayerControls]\n );\n\n const shouldShowInteractionOverlay =\n Boolean(activeInteractionElement) && isInteractionOverlayOpen;\n const currentRenderElementKeys = useMemo(\n () =>\n currentElementList.map(\n (element, index) =>\n `${element.sequence_number ?? `${element.type}-${index}`}:${String(element.is_new ?? \"\")}`\n ),\n [currentElementList]\n );\n\n useEffect(() => {\n const prevKeys = prevRenderElementKeysRef.current;\n const hasStablePrefix =\n prevKeys.length > 0 &&\n prevKeys.length < currentRenderElementKeys.length &&\n prevKeys.every((key, index) => key === currentRenderElementKeys[index]);\n const appendedElements = hasStablePrefix\n ? currentElementList.slice(prevKeys.length)\n : [];\n const shouldAutoScrollToAppend = appendedElements.some(\n (element) => element.is_new === false\n );\n\n prevRenderElementKeysRef.current = currentRenderElementKeys;\n\n if (!shouldAutoScrollToAppend) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n const stageLayerElement = stageLayerRef.current;\n const targetElement = lastElementRef.current;\n\n if (!stageLayerElement || !targetElement) {\n return;\n }\n\n const stageLayerRect = stageLayerElement.getBoundingClientRect();\n const targetRect = targetElement.getBoundingClientRect();\n const nextScrollTop =\n stageLayerElement.scrollTop + (targetRect.top - stageLayerRect.top);\n\n // Keep newly appended content visible when the current slide grows downward.\n stageLayerElement.scrollTo({\n top: Math.max(nextScrollTop, 0),\n behavior: \"smooth\",\n });\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [currentElementList, currentRenderElementKeys]);\n\n useEffect(() => {\n if (!shouldScrollToBottomRef.current) {\n return;\n }\n\n shouldScrollToBottomRef.current = false;\n\n if (currentElementList.length === 0) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n scrollStageToBottom();\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [currentElementList, scrollStageToBottom]);\n\n return (\n <section\n ref={sectionRef}\n className={cn(\"relative h-full w-full\", className)}\n onPointerDown={handleSurfacePointerDown}\n {...props}\n >\n <div\n className={cn(\n \"h-full min-h-0 w-full\",\n isSingleSlide ? \"slide-content--single\" : \"grid gap-4\"\n )}\n >\n {currentElementList.length > 0 ? (\n <div className=\"slide-stage\">\n <div ref={stageLayerRef} className=\"slide-stage__layer w-full\">\n {mountedStepStates.map(\n (mountedStepState, mountedStepStateIndex) => {\n const isActiveStep =\n mountedStepStateIndex === currentMountedStateIndex;\n\n return (\n <div\n key={\n mountedStepState.sourceStepIndexes[0] ??\n mountedStepStateIndex\n }\n aria-hidden={!isActiveStep || undefined}\n className=\"w-full\"\n style={{ display: isActiveStep ? undefined : \"none\" }}\n >\n {renderSlideElementList(\n mountedStepState.elementList,\n isActiveStep\n )}\n </div>\n );\n }\n )}\n </div>\n </div>\n ) : null}\n </div>\n\n {shouldShowInteractionOverlay ? (\n <div\n className={cn(\n \"slide-interaction-overlay\",\n playerVisible && shouldRenderPlayer\n ? \"slide-interaction-overlay--with-player\"\n : \"slide-interaction-overlay--standalone\"\n )}\n onClick={stopOverlayPropagation}\n onPointerDown={stopOverlayPropagation}\n >\n <InteractionOverlayCard\n content={String(activeInteractionElement?.content ?? \"\")}\n defaultButtonText={interactionDefaults.buttonText ?? \"\"}\n defaultInputText={interactionDefaults.inputText ?? \"\"}\n defaultSelectedValues={interactionDefaultSelectedValues}\n confirmButtonText={interactionTexts?.confirmButtonText}\n copyButtonText={interactionTexts?.copyButtonText}\n copiedButtonText={interactionTexts?.copiedButtonText}\n onSend={handleInteractionSend}\n readonly={isInteractionReadonly}\n title={\n interactionTexts?.title ??\n interactionTitle ??\n \"Submit the content below to continue.\"\n }\n />\n </div>\n ) : null}\n\n {shouldRenderPlayer ? (\n <Player\n audioList={audioList}\n className={cn(\n \"absolute left-1/2 bottom-6 z-[2] -translate-x-1/2\",\n playerClassName,\n !playerVisible && \"pointer-events-none opacity-0\"\n )}\n currentAudioIndex={currentAudioIndex}\n defaultPlaying={canAutoPlayAudio}\n hasInteraction={Boolean(activeInteractionElement)}\n isInteractionOpen={isInteractionOverlayOpen}\n nextDisabled={!canGoNext}\n onEnded={handlePlayerEnded}\n onFullscreen={handleFullscreen}\n onInteractionToggle={handleInteractionToggle}\n onPlayRequest={() => setHasPlaybackInteracted(true)}\n onNext={handleNext}\n onPrev={handlePrev}\n prevDisabled={!canGoPrev}\n showControls={playerVisible}\n />\n ) : null}\n </section>\n );\n};\n\nexport default Slide;\n"],"names":["CHECKPOINT_AUTO_ADVANCE_DELAY_MS","InteractionOverlayCard","memo","content","title","defaultButtonText","defaultInputText","defaultSelectedValues","confirmButtonText","copyButtonText","copiedButtonText","onSend","readonly","jsxs","jsx","ContentRender","areStepElementListsEqual","prevElementList","nextElementList","element","index","nextElement","Slide","elementList","showPlayer","playerAlwaysVisible","playerClassName","interactionTitle","interactionTexts","playerAutoHideDelay","interactionDefaultValueOptions","onPlayerVisibilityChange","onStepChange","className","onPointerDown","props","sectionRef","useRef","stageLayerRef","lastElementRef","playerHideTimerRef","autoAdvanceTimerRef","interactionAutoCloseTimerRef","prevRenderElementKeysRef","shouldScrollToBottomRef","currentElementList","stepElementLists","slideElementList","currentIndex","audioList","currentAudioSequenceIndexes","currentInteractionElement","canGoPrev","canGoNext","goPrev","goNext","useSlide","currentStepElement","useMemo","isSingleSlide","shouldRenderPlayer","isPlayerVisible","setIsPlayerVisible","useState","hasPlayerInteracted","setHasPlayerInteracted","hasPlaybackInteracted","setHasPlaybackInteracted","shouldAutoPlay","hasBrowserUserActivation","canAutoPlayAudio","currentAudioIndex","setCurrentAudioIndex","currentAudioSequencePosition","setCurrentAudioSequencePosition","activeInteractionElement","setActiveInteractionElement","isInteractionOverlayOpen","setIsInteractionOverlayOpen","playerVisible","clearPlayerHideTimer","useCallback","clearInteractionAutoCloseTimer","clearAutoAdvanceTimer","resetAudioSequence","startCurrentAudioSequence","nextAudioIndex","continueAfterInteraction","showPlayerControls","enableAutoHide","useEffect","handleSandboxInteraction","event","isSandboxInteractionMessage","useWakePlayerFromIframe","interactionDefaults","getInteractionDefaultValues","interactionDefaultSelectedValues","getInteractionDefaultSelectedValues","hasResolvedInteractionInput","isInteractionReadonly","shouldAutoContinueInteraction","handleInteractionSend","resolvedUserInput","prevElement","renderSlideElement","Fragment","IframeSandbox","renderSlideElementList","isActiveStep","visibleElementCount","lastVisibleElementIndex","lastVisibleIndex","isPreRenderedHtml","cn","mountedStepStates","currentMountedStateIndex","nextMountedStepStates","mountedStateIndexByStep","stepElementList","stepIndex","existingMountedStateIndex","mountedStepState","handleFullscreen","target","scrollStageToBottom","stageLayerElement","handlePrev","handleNext","handlePlayerEnded","audioIndex","nextSequencePosition","handleInteractionToggle","prevOpen","stopOverlayPropagation","handleSurfacePointerDown","shouldShowInteractionOverlay","currentRenderElementKeys","prevKeys","shouldAutoScrollToAppend","key","animationFrameId","targetElement","stageLayerRect","targetRect","nextScrollTop","mountedStepStateIndex","Player"],"mappings":"2pBA4BA,MAAMA,GAAmC,IAuBnCC,GAAyB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Ac2B,CAAA,CAAA,EAEd,IAAA,CAAA,CAAA,CAGV"}
1
+ {"version":3,"file":"Slide.cjs.js","sources":["../../../src/components/Slide/Slide.tsx"],"sourcesContent":["import React, {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { LoaderCircle } from \"lucide-react\";\n\nimport { hasBrowserUserActivation } from \"../../lib/browserUserActivation\";\nimport { isSandboxInteractionMessage } from \"../../lib/sandboxInteraction\";\nimport { cn } from \"../../lib/utils\";\nimport ContentRender from \"../ContentRender\";\nimport type { ContentRenderProps } from \"../ContentRender/ContentRender\";\nimport IframeSandbox from \"../ContentRender/IframeSandbox\";\nimport type { OnSendContentParams } from \"../types\";\nimport {\n getInteractionDefaultSelectedValues,\n getInteractionDefaultValues,\n type InteractionDefaultValueOptions,\n} from \"../../lib/interaction-defaults\";\nimport Player from \"./Player\";\nimport type { Element } from \"./types\";\nimport useSlide from \"./useSlide\";\nimport useWakePlayerFromIframe from \"./useWakePlayerFromIframe\";\nimport \"./slide.css\";\nexport type { Element, ElementAudioSegment } from \"./types\";\n\nconst CHECKPOINT_AUTO_ADVANCE_DELAY_MS = 1000;\n\ntype RenderSlideElementOptions = {\n replaceRootScreenHeightWithFull?: boolean;\n};\n\ninterface InteractionOverlayCardProps {\n content: string;\n title: string;\n defaultButtonText?: string;\n defaultInputText?: string;\n defaultSelectedValues?: string[];\n confirmButtonText?: string;\n copyButtonText?: string;\n copiedButtonText?: string;\n onSend?: (content: OnSendContentParams) => void;\n readonly?: boolean;\n}\n\nexport interface SlideInteractionTexts\n extends Pick<\n ContentRenderProps,\n \"confirmButtonText\" | \"copyButtonText\" | \"copiedButtonText\"\n > {\n title?: string;\n}\n\nconst InteractionOverlayCard = memo(\n ({\n content,\n title,\n defaultButtonText,\n defaultInputText,\n defaultSelectedValues,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n onSend,\n readonly = false,\n }: InteractionOverlayCardProps) => (\n <div className=\"slide-player__interaction-card\">\n <div className=\"slide-player__interaction-header\">\n <p className=\"slide-player__interaction-title\">{title}</p>\n </div>\n <div className=\"slide-player__interaction-body\">\n <ContentRender\n content={content}\n defaultButtonText={defaultButtonText}\n defaultInputText={defaultInputText}\n defaultSelectedValues={defaultSelectedValues}\n confirmButtonText={confirmButtonText}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n onSend={onSend}\n readonly={readonly}\n enableTypewriter={false}\n sandboxMode=\"content\"\n />\n </div>\n <div className=\"slide-player__interaction-arrow\" />\n </div>\n )\n);\n\nInteractionOverlayCard.displayName = \"InteractionOverlayCard\";\n\nconst areStepElementListsEqual = (\n prevElementList: Element[],\n nextElementList: Element[]\n) =>\n prevElementList.length === nextElementList.length &&\n prevElementList.every((element, index) => {\n const nextElement = nextElementList[index];\n\n return (\n element.sequence_number === nextElement?.sequence_number &&\n element.type === nextElement?.type &&\n element.content === nextElement?.content\n );\n });\n\nexport interface SlideProps extends React.ComponentProps<\"section\"> {\n elementList?: Element[];\n showPlayer?: boolean;\n playerAlwaysVisible?: boolean;\n playerClassName?: string;\n bufferingText?: string;\n interactionTitle?: string;\n interactionTexts?: SlideInteractionTexts;\n playerAutoHideDelay?: number;\n interactionDefaultValueOptions?: InteractionDefaultValueOptions;\n onSend?: (content: OnSendContentParams, element?: Element) => void;\n onPlayerVisibilityChange?: (visible: boolean) => void;\n onStepChange?: (element: Element | undefined, index: number) => void;\n}\n\nconst Slide: React.FC<SlideProps> = ({\n elementList = [],\n showPlayer = true,\n playerAlwaysVisible = false,\n playerClassName,\n bufferingText = \"Buffering...\",\n interactionTitle,\n interactionTexts,\n playerAutoHideDelay = 3000,\n interactionDefaultValueOptions,\n onSend,\n onPlayerVisibilityChange,\n onStepChange,\n className,\n onPointerDown,\n ...props\n}) => {\n const sectionRef = useRef<HTMLElement | null>(null);\n const stageLayerRef = useRef<HTMLDivElement | null>(null);\n const lastElementRef = useRef<HTMLDivElement | null>(null);\n const playerHideTimerRef = useRef<number | null>(null);\n const autoAdvanceTimerRef = useRef<number | null>(null);\n const interactionAutoCloseTimerRef = useRef<number | null>(null);\n const prevRenderElementKeysRef = useRef<string[]>([]);\n const shouldScrollToBottomRef = useRef(false);\n const {\n currentElementList,\n stepElementLists,\n slideElementList,\n currentIndex,\n audioList,\n currentAudioSequenceIndexes,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n canGoPrev,\n canGoNext,\n handlePrev: goPrev,\n handleNext: goNext,\n } = useSlide(elementList);\n const currentStepElement = useMemo(() => {\n if (currentIndex < 0) {\n return undefined;\n }\n\n return slideElementList[currentIndex];\n }, [currentIndex, slideElementList]);\n const visibleMarkerCount = slideElementList.filter(\n (element) => element.is_renderable !== false\n ).length;\n const isSingleSlide = visibleMarkerCount === 1;\n const shouldRenderPlayer =\n showPlayer &&\n (slideElementList.length > 0 ||\n audioList.length > 0 ||\n Boolean(currentInteractionElement));\n const [isPlayerVisible, setIsPlayerVisible] = useState(true);\n const [hasPlayerInteracted, setHasPlayerInteracted] = useState(false);\n const [hasPlaybackInteracted, setHasPlaybackInteracted] = useState(false);\n const [shouldAutoPlay] = useState(() => hasBrowserUserActivation());\n const canAutoPlayAudio = shouldAutoPlay || hasPlaybackInteracted;\n const [currentAudioIndex, setCurrentAudioIndex] = useState(-1);\n const [currentAudioSequencePosition, setCurrentAudioSequencePosition] =\n useState(-1);\n const [isAudioLoadingVisible, setIsAudioLoadingVisible] = useState(false);\n const [hasCompletedCurrentStepAudio, setHasCompletedCurrentStepAudio] =\n useState(false);\n const [activeInteractionElement, setActiveInteractionElement] = useState<\n Element | undefined\n >();\n const [isInteractionOverlayOpen, setIsInteractionOverlayOpen] =\n useState(false);\n const playerVisible =\n shouldRenderPlayer &&\n (playerAlwaysVisible || isPlayerVisible || isAudioLoadingVisible);\n const { mountedStepStates, currentMountedStateIndex } = useMemo(() => {\n const nextMountedStepStates: Array<{\n elementList: Element[];\n sourceStepIndexes: number[];\n }> = [];\n const mountedStateIndexByStep = new Map<number, number>();\n\n stepElementLists.forEach((stepElementList, stepIndex) => {\n const existingMountedStateIndex = nextMountedStepStates.findIndex(\n (mountedStepState) =>\n areStepElementListsEqual(\n mountedStepState.elementList,\n stepElementList\n )\n );\n\n if (existingMountedStateIndex >= 0) {\n nextMountedStepStates[\n existingMountedStateIndex\n ]?.sourceStepIndexes.push(stepIndex);\n mountedStateIndexByStep.set(stepIndex, existingMountedStateIndex);\n return;\n }\n\n nextMountedStepStates.push({\n elementList: stepElementList,\n sourceStepIndexes: [stepIndex],\n });\n mountedStateIndexByStep.set(stepIndex, nextMountedStepStates.length - 1);\n });\n\n return {\n mountedStepStates: nextMountedStepStates,\n currentMountedStateIndex:\n currentIndex >= 0\n ? (mountedStateIndexByStep.get(currentIndex) ?? -1)\n : -1,\n };\n }, [currentIndex, stepElementLists]);\n const currentAudioSequenceKey = useMemo(\n () => currentAudioSequenceIndexes.join(\",\"),\n [currentAudioSequenceIndexes]\n );\n const currentInteractionResetKey = useMemo(() => {\n if (!currentInteractionElement) {\n return \"none\";\n }\n\n return `${currentInteractionElement.sequence_number ?? \"none\"}:${String(\n currentInteractionElement.content ?? \"\"\n )}`;\n }, [currentInteractionElement]);\n const currentPlaybackResetKey = useMemo(\n () =>\n [\n currentMountedStateIndex,\n currentInteractionResetKey,\n currentAudioSequenceKey,\n ].join(\"|\"),\n [\n currentAudioSequenceKey,\n currentInteractionResetKey,\n currentMountedStateIndex,\n ]\n );\n\n const clearPlayerHideTimer = useCallback(() => {\n if (playerHideTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(playerHideTimerRef.current);\n playerHideTimerRef.current = null;\n }, []);\n\n const clearInteractionAutoCloseTimer = useCallback(() => {\n if (interactionAutoCloseTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(interactionAutoCloseTimerRef.current);\n interactionAutoCloseTimerRef.current = null;\n }, []);\n\n const clearAutoAdvanceTimer = useCallback(() => {\n if (autoAdvanceTimerRef.current === null) {\n return;\n }\n\n window.clearTimeout(autoAdvanceTimerRef.current);\n autoAdvanceTimerRef.current = null;\n }, []);\n\n const resetAudioSequence = useCallback(() => {\n clearAutoAdvanceTimer();\n clearInteractionAutoCloseTimer();\n setCurrentAudioIndex(-1);\n setCurrentAudioSequencePosition(-1);\n setIsAudioLoadingVisible(false);\n setHasCompletedCurrentStepAudio(false);\n setActiveInteractionElement(undefined);\n setIsInteractionOverlayOpen(false);\n }, [clearAutoAdvanceTimer, clearInteractionAutoCloseTimer]);\n\n const startCurrentAudioSequence = useCallback(() => {\n const nextAudioIndex = currentAudioSequenceIndexes[0];\n\n if (typeof nextAudioIndex !== \"number\") {\n return false;\n }\n\n // Start the first audio segment for the current step immediately.\n setCurrentAudioSequencePosition(0);\n setCurrentAudioIndex(nextAudioIndex);\n return true;\n }, [currentAudioSequenceIndexes]);\n\n const continueAfterInteraction = useCallback(() => {\n clearInteractionAutoCloseTimer();\n setIsInteractionOverlayOpen(false);\n\n if (startCurrentAudioSequence()) {\n return;\n }\n\n if (canGoNext) {\n goNext();\n }\n }, [\n canGoNext,\n clearInteractionAutoCloseTimer,\n goNext,\n startCurrentAudioSequence,\n ]);\n\n const showPlayerControls = useCallback(\n (enableAutoHide = hasPlayerInteracted) => {\n if (!shouldRenderPlayer) {\n return;\n }\n\n setIsPlayerVisible(true);\n clearPlayerHideTimer();\n\n if (playerAlwaysVisible || !enableAutoHide || playerAutoHideDelay <= 0) {\n return;\n }\n\n playerHideTimerRef.current = window.setTimeout(() => {\n setIsPlayerVisible(false);\n playerHideTimerRef.current = null;\n }, playerAutoHideDelay);\n },\n [\n clearPlayerHideTimer,\n hasPlayerInteracted,\n playerAlwaysVisible,\n playerAutoHideDelay,\n shouldRenderPlayer,\n ]\n );\n\n useEffect(() => {\n return () => {\n clearAutoAdvanceTimer();\n clearPlayerHideTimer();\n clearInteractionAutoCloseTimer();\n };\n }, [\n clearAutoAdvanceTimer,\n clearInteractionAutoCloseTimer,\n clearPlayerHideTimer,\n ]);\n\n useEffect(() => {\n onPlayerVisibilityChange?.(playerVisible);\n\n return () => {\n onPlayerVisibilityChange?.(false);\n };\n }, [onPlayerVisibilityChange, playerVisible]);\n\n useEffect(() => {\n onStepChange?.(currentStepElement, currentIndex);\n }, [currentIndex, currentStepElement, onStepChange]);\n\n useEffect(() => {\n if (!shouldRenderPlayer) {\n clearPlayerHideTimer();\n setIsPlayerVisible(false);\n return;\n }\n\n if (playerAlwaysVisible) {\n clearPlayerHideTimer();\n setIsPlayerVisible(true);\n return;\n }\n\n if (!hasPlayerInteracted) {\n // Keep the initial player visible briefly, then hide it automatically.\n showPlayerControls(true);\n }\n }, [\n clearPlayerHideTimer,\n hasPlayerInteracted,\n playerAlwaysVisible,\n shouldRenderPlayer,\n showPlayerControls,\n ]);\n\n useEffect(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const handleSandboxInteraction = (event: MessageEvent) => {\n if (event.origin !== window.location.origin) {\n return;\n }\n\n if (!isSandboxInteractionMessage(event.data)) {\n return;\n }\n\n if (!shouldRenderPlayer) {\n return;\n }\n\n // Restore player controls without blocking native iframe scrolling.\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n };\n\n window.addEventListener(\"message\", handleSandboxInteraction);\n\n return () => {\n window.removeEventListener(\"message\", handleSandboxInteraction);\n };\n }, [shouldRenderPlayer, showPlayerControls]);\n\n useWakePlayerFromIframe({\n sectionRef,\n enabled: shouldRenderPlayer,\n onWake: () => {\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n },\n });\n\n useEffect(() => {\n resetAudioSequence();\n\n if (currentElementList.length === 0 && !currentInteractionElement) {\n return;\n }\n\n if (currentInteractionElement) {\n // Show the interaction gate before playing any follow-up audio.\n setActiveInteractionElement(currentInteractionElement);\n setIsInteractionOverlayOpen(true);\n return;\n }\n\n if (startCurrentAudioSequence()) {\n return;\n }\n\n if (currentStepHasSpeakableElement) {\n setIsAudioLoadingVisible(true);\n return;\n }\n\n if (!canGoNext) {\n return;\n }\n\n // Auto-advance silent marker-only steps so playback flow does not stall.\n autoAdvanceTimerRef.current = window.setTimeout(() => {\n autoAdvanceTimerRef.current = null;\n goNext();\n }, CHECKPOINT_AUTO_ADVANCE_DELAY_MS);\n\n return () => {\n clearAutoAdvanceTimer();\n };\n }, [\n canGoNext,\n clearAutoAdvanceTimer,\n currentElementList.length,\n currentInteractionElement,\n currentPlaybackResetKey,\n currentStepHasSpeakableElement,\n goNext,\n resetAudioSequence,\n startCurrentAudioSequence,\n ]);\n\n useEffect(() => {\n if (!currentStepHasSpeakableElement || currentInteractionElement) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n if (hasCompletedCurrentStepAudio) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n if (currentAudioSequenceIndexes.length === 0) {\n setIsAudioLoadingVisible(true);\n }\n }, [\n currentAudioSequenceIndexes.length,\n currentInteractionElement,\n currentStepHasSpeakableElement,\n hasCompletedCurrentStepAudio,\n ]);\n\n const interactionDefaults = useMemo(() => {\n if (!activeInteractionElement) {\n return {};\n }\n\n return getInteractionDefaultValues(\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined,\n activeInteractionElement.user_input,\n interactionDefaultValueOptions\n );\n }, [activeInteractionElement, interactionDefaultValueOptions]);\n\n const interactionDefaultSelectedValues = useMemo(() => {\n if (!activeInteractionElement) {\n return undefined;\n }\n\n return getInteractionDefaultSelectedValues(\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined,\n activeInteractionElement.user_input,\n interactionDefaultValueOptions\n );\n }, [activeInteractionElement, interactionDefaultValueOptions]);\n\n const hasResolvedInteractionInput = Boolean(\n activeInteractionElement?.user_input?.trim()\n );\n const isInteractionReadonly =\n Boolean(activeInteractionElement?.readonly) || hasResolvedInteractionInput;\n const shouldAutoContinueInteraction =\n isInteractionReadonly || hasResolvedInteractionInput;\n\n const handleInteractionSend = useCallback(\n (content: OnSendContentParams) => {\n const submittedValues = [\n ...(content.selectedValues ?? []),\n content.inputText?.trim() ?? \"\",\n content.buttonText?.trim() ?? \"\",\n ].filter(Boolean);\n const resolvedUserInput = submittedValues.join(\", \");\n\n setActiveInteractionElement((prevElement) => {\n if (!prevElement || !resolvedUserInput) {\n return prevElement;\n }\n\n return {\n ...prevElement,\n user_input: resolvedUserInput,\n };\n });\n\n onSend?.(content, activeInteractionElement);\n continueAfterInteraction();\n },\n [activeInteractionElement, continueAfterInteraction, onSend]\n );\n\n useEffect(() => {\n clearInteractionAutoCloseTimer();\n\n if (!isInteractionOverlayOpen || !shouldAutoContinueInteraction) {\n return;\n }\n\n // Auto-close passive interaction checkpoints to keep playback moving.\n interactionAutoCloseTimerRef.current = window.setTimeout(() => {\n interactionAutoCloseTimerRef.current = null;\n\n continueAfterInteraction();\n }, 2000);\n\n return () => {\n clearInteractionAutoCloseTimer();\n };\n }, [\n clearInteractionAutoCloseTimer,\n continueAfterInteraction,\n isInteractionOverlayOpen,\n shouldAutoContinueInteraction,\n ]);\n\n const renderSlideElement = (\n element?: Element,\n options: RenderSlideElementOptions = {}\n ) => {\n if (!element) {\n return null;\n }\n\n if (element.type === \"slot\") {\n return <>{element.content}</>;\n }\n\n if (element.type === \"html\") {\n return (\n <IframeSandbox\n className=\"content-render-iframe\"\n hideFullScreen\n mode=\"blackboard\"\n replaceRootScreenHeightWithFull={\n options.replaceRootScreenHeightWithFull\n }\n type=\"sandbox\"\n content={element.content as string}\n />\n );\n }\n\n return (\n <IframeSandbox\n className=\"content-render-iframe\"\n hideFullScreen\n mode=\"blackboard\"\n type=\"markdown\"\n content={element.content as string}\n />\n );\n };\n\n const renderSlideElementList = (\n elementList: Element[] = [],\n isActiveStep = false\n ) => {\n if (elementList.length === 0) {\n return null;\n }\n\n const visibleElementCount = elementList.filter(\n (element) => element.is_renderable !== false\n ).length;\n const lastVisibleElementIndex = elementList.reduce(\n (lastVisibleIndex, element, index) =>\n element.is_renderable !== false ? index : lastVisibleIndex,\n -1\n );\n\n return (\n <div className=\"slide-stage__content flex w-full flex-col gap-4\">\n {elementList.map((element, index) => {\n const isPreRenderedHtml =\n element.type === \"html\" && element.is_renderable === false;\n\n return (\n <div\n key={element.sequence_number ?? `${element.type}-${index}`}\n ref={\n isActiveStep && index === lastVisibleElementIndex\n ? lastElementRef\n : null\n }\n aria-hidden={isPreRenderedHtml || undefined}\n className={cn(\n \"w-full shrink-0\",\n visibleElementCount === 1 &&\n element.is_renderable !== false &&\n \"slide-element--single\",\n isPreRenderedHtml\n ? \"pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0\"\n : element.is_renderable === false && \"hidden\"\n )}\n >\n {renderSlideElement(element, {\n replaceRootScreenHeightWithFull:\n visibleElementCount === 1 &&\n element.type === \"html\" &&\n element.is_renderable !== false,\n })}\n </div>\n );\n })}\n </div>\n );\n };\n\n const handleFullscreen = () => {\n const target = sectionRef.current;\n if (!target) return;\n\n if (document.fullscreenElement) {\n document.exitFullscreen().catch(() => {});\n return;\n }\n\n target.requestFullscreen?.().catch(() => {});\n };\n\n const scrollStageToBottom = useCallback(() => {\n const stageLayerElement = stageLayerRef.current;\n\n if (!stageLayerElement) {\n return;\n }\n\n // Keep the latest content visible after manual player navigation.\n stageLayerElement.scrollTo({\n top: stageLayerElement.scrollHeight,\n behavior: \"smooth\",\n });\n }, []);\n\n const handlePrev = useCallback(() => {\n shouldScrollToBottomRef.current = true;\n setHasPlayerInteracted(true);\n setHasPlaybackInteracted(true);\n setIsAudioLoadingVisible(false);\n showPlayerControls(true);\n resetAudioSequence();\n goPrev();\n }, [goPrev, resetAudioSequence, showPlayerControls]);\n\n const handleNext = useCallback(() => {\n shouldScrollToBottomRef.current = true;\n setHasPlayerInteracted(true);\n setHasPlaybackInteracted(true);\n setIsAudioLoadingVisible(false);\n showPlayerControls(true);\n resetAudioSequence();\n goNext();\n }, [goNext, resetAudioSequence, showPlayerControls]);\n\n const handlePlayerLoadingChange = useCallback(\n (loading: boolean) => {\n if (!currentStepHasSpeakableElement || hasCompletedCurrentStepAudio) {\n setIsAudioLoadingVisible(false);\n return;\n }\n\n setIsAudioLoadingVisible(loading);\n },\n [currentStepHasSpeakableElement, hasCompletedCurrentStepAudio]\n );\n\n const handlePlayerEnded = useCallback(\n (audioIndex: number) => {\n if (currentAudioSequencePosition < 0) {\n return;\n }\n\n if (\n currentAudioSequenceIndexes[currentAudioSequencePosition] !== audioIndex\n ) {\n return;\n }\n\n const nextSequencePosition = currentAudioSequencePosition + 1;\n const nextAudioIndex = currentAudioSequenceIndexes[nextSequencePosition];\n\n if (typeof nextAudioIndex === \"number\") {\n setCurrentAudioSequencePosition(nextSequencePosition);\n setCurrentAudioIndex(nextAudioIndex);\n return;\n }\n\n setCurrentAudioIndex(-1);\n setCurrentAudioSequencePosition(-1);\n setHasCompletedCurrentStepAudio(true);\n setIsAudioLoadingVisible(false);\n\n if (canGoNext) {\n goNext();\n }\n },\n [\n canGoNext,\n currentAudioSequenceIndexes,\n currentAudioSequencePosition,\n goNext,\n ]\n );\n\n const handleInteractionToggle = useCallback(() => {\n if (!activeInteractionElement) {\n return;\n }\n\n setIsInteractionOverlayOpen((prevOpen) => !prevOpen);\n }, [activeInteractionElement]);\n\n const stopOverlayPropagation = useCallback(\n (\n event:\n | React.PointerEvent<HTMLDivElement>\n | React.MouseEvent<HTMLDivElement>\n ) => {\n event.stopPropagation();\n\n // Keep the player visible a bit longer when users interact with the overlay.\n if (playerVisible) {\n showPlayerControls(true);\n }\n },\n [isPlayerVisible, showPlayerControls]\n );\n\n const handleSurfacePointerDown = useCallback(\n (event: React.PointerEvent<HTMLElement>) => {\n onPointerDown?.(event);\n setHasPlayerInteracted(true);\n showPlayerControls(true);\n },\n [onPointerDown, showPlayerControls]\n );\n\n const shouldShowInteractionOverlay =\n Boolean(activeInteractionElement) && isInteractionOverlayOpen;\n const currentRenderElementKeys = useMemo(\n () =>\n currentElementList.map(\n (element, index) =>\n `${element.sequence_number ?? `${element.type}-${index}`}:${String(element.is_new ?? \"\")}`\n ),\n [currentElementList]\n );\n\n useEffect(() => {\n const prevKeys = prevRenderElementKeysRef.current;\n const hasStablePrefix =\n prevKeys.length > 0 &&\n prevKeys.length < currentRenderElementKeys.length &&\n prevKeys.every((key, index) => key === currentRenderElementKeys[index]);\n const appendedElements = hasStablePrefix\n ? currentElementList.slice(prevKeys.length)\n : [];\n const shouldAutoScrollToAppend = appendedElements.some(\n (element) => element.is_new === false\n );\n\n prevRenderElementKeysRef.current = currentRenderElementKeys;\n\n if (!shouldAutoScrollToAppend) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n const stageLayerElement = stageLayerRef.current;\n const targetElement = lastElementRef.current;\n\n if (!stageLayerElement || !targetElement) {\n return;\n }\n\n const stageLayerRect = stageLayerElement.getBoundingClientRect();\n const targetRect = targetElement.getBoundingClientRect();\n const nextScrollTop =\n stageLayerElement.scrollTop + (targetRect.top - stageLayerRect.top);\n\n // Keep newly appended content visible when the current slide grows downward.\n stageLayerElement.scrollTo({\n top: Math.max(nextScrollTop, 0),\n behavior: \"smooth\",\n });\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [currentElementList, currentRenderElementKeys]);\n\n useEffect(() => {\n if (!shouldScrollToBottomRef.current) {\n return;\n }\n\n shouldScrollToBottomRef.current = false;\n\n if (currentElementList.length === 0) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n scrollStageToBottom();\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [currentElementList, scrollStageToBottom]);\n\n return (\n <section\n ref={sectionRef}\n className={cn(\"relative h-full w-full\", className)}\n onPointerDown={handleSurfacePointerDown}\n {...props}\n >\n <div\n className={cn(\n \"h-full min-h-0 w-full\",\n isSingleSlide ? \"slide-content--single\" : \"grid gap-4\"\n )}\n >\n {currentElementList.length > 0 ? (\n <div className=\"slide-stage\">\n <div ref={stageLayerRef} className=\"slide-stage__layer w-full\">\n {mountedStepStates.map(\n (mountedStepState, mountedStepStateIndex) => {\n const isActiveStep =\n mountedStepStateIndex === currentMountedStateIndex;\n\n return (\n <div\n key={\n mountedStepState.sourceStepIndexes[0] ??\n mountedStepStateIndex\n }\n aria-hidden={!isActiveStep || undefined}\n className=\"w-full h-full\"\n style={{ display: isActiveStep ? undefined : \"none\" }}\n >\n {renderSlideElementList(\n mountedStepState.elementList,\n isActiveStep\n )}\n </div>\n );\n }\n )}\n </div>\n </div>\n ) : null}\n </div>\n\n {isAudioLoadingVisible ? (\n <div className=\"pointer-events-none absolute left-1/2 top-1/2 z-[3] flex size-28 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-2 rounded-2xl bg-foreground/65 px-3 py-4 text-center text-xs leading-4 font-medium text-background shadow-lg backdrop-blur-sm\">\n <LoaderCircle className=\"size-5 animate-spin text-background\" />\n <span>{bufferingText}</span>\n </div>\n ) : null}\n\n {shouldShowInteractionOverlay ? (\n <div\n className={cn(\n \"slide-interaction-overlay\",\n playerVisible && shouldRenderPlayer\n ? \"slide-interaction-overlay--with-player\"\n : \"slide-interaction-overlay--standalone\"\n )}\n onClick={stopOverlayPropagation}\n onPointerDown={stopOverlayPropagation}\n >\n <InteractionOverlayCard\n content={String(activeInteractionElement?.content ?? \"\")}\n defaultButtonText={interactionDefaults.buttonText ?? \"\"}\n defaultInputText={interactionDefaults.inputText ?? \"\"}\n defaultSelectedValues={interactionDefaultSelectedValues}\n confirmButtonText={interactionTexts?.confirmButtonText}\n copyButtonText={interactionTexts?.copyButtonText}\n copiedButtonText={interactionTexts?.copiedButtonText}\n onSend={handleInteractionSend}\n readonly={isInteractionReadonly}\n title={\n interactionTexts?.title ??\n interactionTitle ??\n \"Submit the content below to continue.\"\n }\n />\n </div>\n ) : null}\n\n {shouldRenderPlayer ? (\n <Player\n audioList={audioList}\n className={cn(\n \"absolute left-1/2 bottom-6 z-[2] -translate-x-1/2\",\n playerClassName,\n !playerVisible && \"pointer-events-none opacity-0\"\n )}\n currentAudioIndex={currentAudioIndex}\n defaultPlaying={canAutoPlayAudio}\n hasInteraction={Boolean(activeInteractionElement)}\n isInteractionOpen={isInteractionOverlayOpen}\n onLoadingChange={handlePlayerLoadingChange}\n nextDisabled={!canGoNext}\n onEnded={handlePlayerEnded}\n onFullscreen={handleFullscreen}\n onInteractionToggle={handleInteractionToggle}\n onPlayRequest={() => setHasPlaybackInteracted(true)}\n onNext={handleNext}\n onPrev={handlePrev}\n prevDisabled={!canGoPrev}\n showControls={playerVisible}\n />\n ) : null}\n </section>\n );\n};\n\nexport default Slide;\n"],"names":["CHECKPOINT_AUTO_ADVANCE_DELAY_MS","InteractionOverlayCard","memo","content","title","defaultButtonText","defaultInputText","defaultSelectedValues","confirmButtonText","copyButtonText","copiedButtonText","onSend","readonly","jsxs","jsx","ContentRender","areStepElementListsEqual","prevElementList","nextElementList","element","index","nextElement","Slide","elementList","showPlayer","playerAlwaysVisible","playerClassName","bufferingText","interactionTitle","interactionTexts","playerAutoHideDelay","interactionDefaultValueOptions","onPlayerVisibilityChange","onStepChange","className","onPointerDown","props","sectionRef","useRef","stageLayerRef","lastElementRef","playerHideTimerRef","autoAdvanceTimerRef","interactionAutoCloseTimerRef","prevRenderElementKeysRef","shouldScrollToBottomRef","currentElementList","stepElementLists","slideElementList","currentIndex","audioList","currentAudioSequenceIndexes","currentStepHasSpeakableElement","currentInteractionElement","canGoPrev","canGoNext","goPrev","goNext","useSlide","currentStepElement","useMemo","isSingleSlide","shouldRenderPlayer","isPlayerVisible","setIsPlayerVisible","useState","hasPlayerInteracted","setHasPlayerInteracted","hasPlaybackInteracted","setHasPlaybackInteracted","shouldAutoPlay","hasBrowserUserActivation","canAutoPlayAudio","currentAudioIndex","setCurrentAudioIndex","currentAudioSequencePosition","setCurrentAudioSequencePosition","isAudioLoadingVisible","setIsAudioLoadingVisible","hasCompletedCurrentStepAudio","setHasCompletedCurrentStepAudio","activeInteractionElement","setActiveInteractionElement","isInteractionOverlayOpen","setIsInteractionOverlayOpen","playerVisible","mountedStepStates","currentMountedStateIndex","nextMountedStepStates","mountedStateIndexByStep","stepElementList","stepIndex","existingMountedStateIndex","mountedStepState","currentAudioSequenceKey","currentInteractionResetKey","currentPlaybackResetKey","clearPlayerHideTimer","useCallback","clearInteractionAutoCloseTimer","clearAutoAdvanceTimer","resetAudioSequence","startCurrentAudioSequence","nextAudioIndex","continueAfterInteraction","showPlayerControls","enableAutoHide","useEffect","handleSandboxInteraction","event","isSandboxInteractionMessage","useWakePlayerFromIframe","interactionDefaults","getInteractionDefaultValues","interactionDefaultSelectedValues","getInteractionDefaultSelectedValues","hasResolvedInteractionInput","isInteractionReadonly","shouldAutoContinueInteraction","handleInteractionSend","resolvedUserInput","prevElement","renderSlideElement","options","Fragment","IframeSandbox","renderSlideElementList","isActiveStep","visibleElementCount","lastVisibleElementIndex","lastVisibleIndex","isPreRenderedHtml","cn","handleFullscreen","target","scrollStageToBottom","stageLayerElement","handlePrev","handleNext","handlePlayerLoadingChange","loading","handlePlayerEnded","audioIndex","nextSequencePosition","handleInteractionToggle","prevOpen","stopOverlayPropagation","handleSurfacePointerDown","shouldShowInteractionOverlay","currentRenderElementKeys","prevKeys","shouldAutoScrollToAppend","key","animationFrameId","targetElement","stageLayerRect","targetRect","nextScrollTop","mountedStepStateIndex","LoaderCircle","Player"],"mappings":"40BA6BMA,GAAmC,IA2BnCC,GAAyBC,EAAAA,KAC7B,CAAC,CACC,QAAAC,EACA,MAAAC,EACA,kBAAAC,EACA,iBAAAC,EACA,sBAAAC,EACA,kBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,OAAAC,EACA,SAAAC,EAAW,EAAA,IAEXC,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,iCACb,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,mCACb,SAAAA,EAAAA,kBAAAA,IAAC,KAAE,UAAU,kCAAmC,WAAM,CAAA,CACxD,EACAA,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,iCACb,SAAAA,EAAAA,kBAAAA,IAACC,GAAAA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C,EAAiB,kBAAkB,CAAC,GACpCiE,CAAA,CAYR,CAAA,CACF,CACF,EACF,EACE,IAAA,CAAA,EAGLjF,GACChE,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,4QACb,SAAA,CAAAC,EAAAA,kBAAAA,IAACiJ,GAAAA,QAAA,CAAa,UAAU,qCAAA,CAAsC,EAC9DjJ,EAAAA,kBAAAA,IAAC,QAAM,SAAAa,CAAA,CAAc,CAAA,CAAA,CACvB,EACE,KAEHyH,GACCtI,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAWsH,EAAAA,GACT,4BACA/C,GAAiBvB,EACb,yCACA,uCAAA,EAEN,QAASoF,GACT,cAAeA,GAEf,SAAApI,EAAAA,kBAAAA,IAACb,GAAA,CACC,QAAS,OAAOgF,GAA0B,SAAW,EAAE,EACvD,kBAAmB+B,GAAoB,YAAc,GACrD,iBAAkBA,GAAoB,WAAa,GACnD,sBAAuBE,GACvB,kBAAmBrF,GAAkB,kBACrC,eAAgBA,GAAkB,eAClC,iBAAkBA,GAAkB,iBACpC,OAAQ0F,GACR,SAAUF,GACV,MACExF,GAAkB,OAClBD,GACA,uCAAA,CAAA,CAEJ,CAAA,EAEA,KAEHkC,EACChD,EAAAA,kBAAAA,IAACkJ,GAAAA,QAAA,CACC,UAAA9G,GACA,UAAWkF,EAAAA,GACT,oDACA1G,EACA,CAAC2D,GAAiB,+BAAA,EAEpB,kBAAAZ,GACA,eAAgBD,GAChB,eAAgB,EAAQS,EACxB,kBAAmBE,EACnB,gBAAiBwD,GACjB,aAAc,CAACpF,EACf,QAASsF,GACT,aAAcR,GACd,oBAAqBW,GACrB,cAAe,IAAM3E,GAAyB,EAAI,EAClD,OAAQqE,GACR,OAAQD,GACR,aAAc,CAACnF,GACf,aAAc+B,CAAA,CAAA,EAEd,IAAA,CAAA,CAAA,CAGV"}
@@ -12,6 +12,7 @@ export interface SlideProps extends React.ComponentProps<"section"> {
12
12
  showPlayer?: boolean;
13
13
  playerAlwaysVisible?: boolean;
14
14
  playerClassName?: string;
15
+ bufferingText?: string;
15
16
  interactionTitle?: string;
16
17
  interactionTexts?: SlideInteractionTexts;
17
18
  playerAutoHideDelay?: number;