@bendyline/squisq-react 1.1.0 → 1.1.2

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.
@@ -1,6 +1,7 @@
1
- var SquisqPlayer=(function(exports){'use strict';var st,B,vn,ve,bn,kn,wn,Sn,Lt,Tt,Ct,Tn,ot={},it=[],uo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$e=Array.isArray;function pe(e,t){for(var n in t)e[n]=t[n];return e}function It(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function me(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?st.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return rt(e,a,r,o,null)}function rt(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++vn,__i:-1,__u:0};return o==null&&B.vnode!=null&&B.vnode(i),i}function te(e){return e.children}function ce(e,t){this.props=e,this.context=t;}function Pe(e,t){if(t==null)return e.__?Pe(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Pe(e):null}function fo(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=pe({},t);i.__v=t.__v+1,B.vnode&&B.vnode(i),Pt(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Pe(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,Ln(r,i,o),t.__e=t.__=null,i.__e!=n&&Cn(i);}}function Cn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Cn(e)}function Mt(e){(!e.__d&&(e.__d=true)&&ve.push(e)&&!at.__r++||bn!=B.debounceRendering)&&((bn=B.debounceRendering)||kn)(at);}function at(){try{for(var e,t=1;ve.length;)ve.length>t&&ve.sort(wn),e=ve.shift(),t=ve.length,fo(e);}finally{ve.length=at.__r=0;}}function Mn(e,t,n,r,o,i,a,s,u,c,p){var d,m,f,h,g,y,v,x=r&&r.__k||it,S=t.length;for(u=po(n,t,x,u,S),d=0;d<S;d++)(f=n.__k[d])!=null&&(m=f.__i!=-1&&x[f.__i]||ot,f.__i=d,y=Pt(e,f,m,o,i,a,s,u,c,p),h=f.__e,f.ref&&m.ref!=f.ref&&(m.ref&&Bt(m.ref,null,f),p.push(f.ref,f.__c||h,f)),g==null&&h!=null&&(g=h),(v=!!(4&f.__u))||m.__k===f.__k?u=An(f,u,e,v):typeof f.type=="function"&&y!==void 0?u=y:h&&(u=h.nextSibling),f.__u&=-7);return n.__e=g,u}function po(e,t,n,r,o){var i,a,s,u,c,p=n.length,d=p,m=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[i]=rt(null,a,null,null,null):$e(a)?a=e.__k[i]=rt(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=rt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,u=i+m,a.__=e,a.__b=e.__b+1,s=null,(c=a.__i=mo(a,n,u,d))!=-1&&(d--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(o>p?m--:o<p&&m++),typeof a.type!="function"&&(a.__u|=4)):c!=u&&(c==u-1?m--:c==u+1?m++:(c>u?m--:m++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<p;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Pe(s)),Pn(s,s));return r}function An(e,t,n,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=An(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Pe(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ze(e,t){return t=t||[],e==null||typeof e=="boolean"||($e(e)?e.some(function(n){ze(n,t);}):t.push(e)),t}function mo(e,t,n,r){var o,i,a,s=e.key,u=e.type,c=t[n],p=c!=null&&(2&c.__u)==0;if(c===null&&s==null||p&&s==c.key&&u==c.type)return n;if(r>(p?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((c=t[a=o>=0?o--:i++])!=null&&(2&c.__u)==0&&s==c.key&&u==c.type)return a}return -1}function _n(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||uo.test(t)?n:n+"px";}function nt(e,t,n,r,o){var i,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else {if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||_n(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||_n(e.style,t,n[t]);}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Sn,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Lt,e.addEventListener(t,i?Ct:Tt,i)):e.removeEventListener(t,i?Ct:Tt,i);else {if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===false&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n));}}function xn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Lt++;else if(t.t<n.u)return;return n(B.event?B.event(t):t)}}}function Pt(e,t,n,r,o,i,a,s,u,c){var p,d,m,f,h,g,y,v,x,S,w,C,P,R,N,Y=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(p=B.__b)&&p(t);e:if(typeof Y=="function")try{if(v=t.props,x=Y.prototype&&Y.prototype.render,S=(p=Y.contextType)&&r[p.__c],w=p?S?S.props.value:p.__:r,n.__c?y=(d=t.__c=n.__c).__=d.__E:(x?t.__c=d=new Y(v,w):(t.__c=d=new ce(v,w),d.constructor=Y,d.render=go),S&&S.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&Y.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=pe({},d.__s)),pe(d.__s,Y.getDerivedStateFromProps(v,d.__s))),f=d.props,h=d.state,d.__v=t,m)x&&Y.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else {if(x&&Y.getDerivedStateFromProps==null&&v!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,w),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,w)===!1){t.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(W){W&&(W.__=t);}),it.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,w),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,h,g);});}if(d.context=w,d.props=v,d.__P=e,d.__e=!1,C=B.__r,P=0,x)d.state=d.__s,d.__d=!1,C&&C(t),p=d.render(d.props,d.state,d.context),it.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,C&&C(t),p=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++P<25);d.state=d.__s,d.getChildContext!=null&&(r=pe(pe({},r),d.getChildContext())),x&&!m&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(f,h)),R=p!=null&&p.type===te&&p.key==null?In(p.props.children):p,s=Mn(e,$e(R)?R:[R],t,n,r,o,i,a,s,u,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),y&&(d.__E=d.__=null);}catch(W){if(t.__v=null,u||i!=null)if(W.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s;}else {for(N=i.length;N--;)It(i[N]);At(t);}else t.__e=n.__e,t.__k=n.__k,W.then||At(t);B.__e(W,t,n);}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ho(n.__e,t,n,r,o,i,a,u,c);return (p=B.diffed)&&p(t),128&t.__u?void 0:s}function At(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(At));}function Ln(e,t,n){for(var r=0;r<n.length;r++)Bt(n[r],n[++r],n[++r]);B.__c&&B.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o);});}catch(i){B.__e(i,o.__v);}});}function In(e){return typeof e!="object"||e==null||e.__b>0?e:$e(e)?e.map(In):pe({},e)}function ho(e,t,n,r,o,i,a,s,u){var c,p,d,m,f,h,g,y=n.props||ot,v=t.props,x=t.type;if(x=="svg"?o="http://www.w3.org/2000/svg":x=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((f=i[c])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,i[c]=null;break}}if(e==null){if(x==null)return document.createTextNode(v);e=document.createElementNS(o,x,v.is&&v),s&&(B.__m&&B.__m(t,i),s=false),i=null;}if(x==null)y===v||s&&e.data==v||(e.data=v);else {if(i=i&&st.call(e.childNodes),!s&&i!=null)for(y={},c=0;c<e.attributes.length;c++)y[(f=e.attributes[c]).name]=f.value;for(c in y)f=y[c],c=="dangerouslySetInnerHTML"?d=f:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||nt(e,c,null,f,o);for(c in v)f=v[c],c=="children"?m=f:c=="dangerouslySetInnerHTML"?p=f:c=="value"?h=f:c=="checked"?g=f:s&&typeof f!="function"||y[c]===f||nt(e,c,f,y[c],o);if(p)s||d&&(p.__html==d.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),Mn(t.type=="template"?e.content:e,$e(m)?m:[m],t,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Pe(n,0),s,u),i!=null)for(c=i.length;c--;)It(i[c]);s||(c="value",x=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[c]||x=="progress"&&!h||x=="option"&&h!=y[c])&&nt(e,c,h,y[c],o),c="checked",g!=null&&g!=e[c]&&nt(e,c,g,y[c],o));}return e}function Bt(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t));}else e.current=t;}catch(o){B.__e(o,n);}}function Pn(e,t,n){var r,o;if(B.unmount&&B.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Bt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount();}catch(i){B.__e(i,t);}r.base=r.__P=null;}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Pn(r[o],t,n||typeof e.type!="function");n||It(e.__e),e.__c=e.__=e.__e=void 0;}function go(e,t,n){return this.constructor(e,n)}function Et(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),o=(r="undefined"=="function")?null:t.__k,i=[],a=[],Pt(t,e=(t).__k=me(te,null,[e]),o||ot,ot,t.namespaceURI,o?null:t.firstChild?st.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,a),Ln(i,e,a);}function lt(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null;},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&r.forEach(function(a){a.__e=true,Mt(a);});},this.sub=function(i){r.add(i);var a=i.componentWillUnmount;i.componentWillUnmount=function(){r&&r.delete(i),a&&a.call(i);};}),n.children}return t.__c="__cC"+Tn++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}st=it.slice,B={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s;}throw e}},vn=0,ce.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=pe({},this.state),typeof e=="function"&&(e=e(pe({},n),this.props)),e&&pe(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Mt(this));},ce.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),Mt(this));},ce.prototype.render=te,ve=[],kn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wn=function(e,t){return e.__v.__b-t.__v.__b},at.__r=0,Sn=/(PointerCapture)$|Capture$/i,Lt=0,Tt=xn(false),Ct=xn(true),Tn=0;var Be,X,Ft,Bn,Oe=0,zn=[],G=B,En=G.__b,Fn=G.__r,Rn=G.diffed,qn=G.__c,Nn=G.unmount,Dn=G.__;function ut(e,t){G.__h&&G.__h(X,e,Oe||t),Oe=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function U(e){return Oe=1,On(Hn,e)}function On(e,t,n){var r=ut(Be++,2);if(r.t=e,!r.__c&&(r.__=[Hn(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],c=r.t(u,s);u!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}));}],r.__c=X,!X.__f)){var o=function(s,u,c){if(!r.__c.__H)return true;var p=r.__c.__H.__.filter(function(m){return m.__c});if(p.every(function(m){return !m.__N}))return !i||i.call(this,s,u,c);var d=r.__c.props!==s;return p.some(function(m){if(m.__N){var f=m.__[0];m.__=m.__N,m.__N=void 0,f!==m.__[0]&&(d=true);}}),i&&i.call(this,s,u,c)||d};X.__f=true;var i=X.shouldComponentUpdate,a=X.componentWillUpdate;X.componentWillUpdate=function(s,u,c){if(this.__e){var p=i;i=void 0,o(s,u,c),i=p;}a&&a.call(this,s,u,c);},X.shouldComponentUpdate=o;}return r.__N||r.__}function z(e,t){var n=ut(Be++,3);!G.__s&&Wn(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n));}function V(e){return Oe=5,$(function(){return {current:e}},[])}function $(e,t){var n=ut(Be++,7);return Wn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Z(e,t){return Oe=8,$(function(){return e},t)}function qt(e){var t=X.context[e.__c],n=ut(Be++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(X)),t.props.value):e.__}function yo(){for(var e;e=zn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ct),t.__h.some(Rt),t.__h=[];}catch(n){t.__h=[],G.__e(n,e.__v);}}}G.__b=function(e){X=null,En&&En(e);},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Dn&&Dn(e,t);},G.__r=function(e){Fn&&Fn(e),Be=0;var t=(X=e.__c).__H;t&&(Ft===X?(t.__h=[],X.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(t.__h.some(ct),t.__h.some(Rt),t.__h=[],Be=0)),Ft=X;},G.diffed=function(e){Rn&&Rn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zn.push(t)!==1&&Bn===G.requestAnimationFrame||((Bn=G.requestAnimationFrame)||bo)(yo)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),Ft=X=null;},G.__c=function(e,t){t.some(function(n){try{n.__h.some(ct),n.__h=n.__h.filter(function(r){return !r.__||Rt(r)});}catch(r){t.some(function(o){o.__h&&(o.__h=[]);}),t=[],G.__e(r,n.__v);}}),qn&&qn(e,t);},G.unmount=function(e){Nn&&Nn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{ct(r);}catch(o){t=o;}}),n.__H=void 0,t&&G.__e(t,n.__v));};var $n=typeof requestAnimationFrame=="function";function bo(e){var t,n=function(){clearTimeout(r),$n&&cancelAnimationFrame(t),setTimeout(e);},r=setTimeout(n,35);$n&&(t=requestAnimationFrame(n));}function ct(e){var t=X,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),X=t;}function Rt(e){var t=X;e.__c=e.__(),X=t;}function Wn(e,t){return !e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Hn(e,t){return typeof t=="function"?t(e):t}function xo(e,t){for(var n in t)e[n]=t[n];return e}function Un(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return true;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return true;return false}function Vn(e,t){this.props=e,this.context=t;}(Vn.prototype=new ce).isPureReactComponent=true,Vn.prototype.shouldComponentUpdate=function(e,t){return Un(this.props,e)||Un(this.state,t)};var Yn=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Yn&&Yn(e);};var vo=B.__e;B.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}vo(e,t,n,r);};var jn=B.unmount;function Jn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c();}),e.__c.__H=null),(e=xo({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Jn(r,t,n)})),e}function er(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return er(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function Nt(){this.__u=0,this.o=null,this.__b=null;}function tr(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function dt(){this.i=null,this.l=null;}B.unmount=function(e){var t=e.__c;t&&(t.__z=true),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),jn&&jn(e);},(Nt.prototype=new ce).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=tr(r.__v),i=false,a=function(){i||r.__z||(i=true,n.__R=null,o?o(u):u());};n.__R=a;var s=n.__P;n.__P=null;var u=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=er(c,c.__c.__P,c.__c.__O);}var p;for(r.setState({__a:r.__b=null});p=r.o.pop();)p.__P=s,p.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a);},Nt.prototype.componentWillUnmount=function(){this.o=[];},Nt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Jn(this.__b,n,r.__O=r.__P);}this.__b=null;}var o=t.__a&&me(te,null,e.fallback);return o&&(o.__u&=-33),[me(te,null,t.__a?null:e.children),o]};var Xn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2];}};(dt.prototype=new ce).__a=function(e){var t=this,n=tr(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Xn(t,e,r)):o();};n?n(i):i();}},dt.prototype.render=function(e){this.i=null,this.l=new Map;var t=ze(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},dt.prototype.componentDidUpdate=dt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Xn(e,n,t);});};var ko=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,wo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,So=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,To=/[A-Z0-9]/g,Co=typeof document<"u",Mo=function(e){return (typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function nr(e,t,n){return t.__k==null&&(t.textContent=""),Et(e,t),e?e.__c:null}ce.prototype.isReactComponent=true,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ce.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t});}});});var Zn=B.event;B.event=function(e){return Zn&&(e=Zn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Ao={configurable:true,get:function(){return this.class}},Gn=B.vnode;B.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")==-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||Co&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===true?s="":u==="translate"&&s==="no"?s=false:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||r!=="input"&&r!=="textarea"||Mo(n.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":So.test(a)&&(a=u):u=a="oninput":i&&wo.test(a)?a=a.replace(To,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&o[a=u]&&(a="oninputCapture"),o[a]=s;}}r=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=ze(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1;})),o.defaultValue!=null&&(o.value=ze(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value;}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Ao)):n.className&&(o.class=o.className=n.className),t.props=o;})(e),e.$$typeof=ko,Gn&&Gn(e);};var Kn=B.__r;B.__r=function(e){Kn&&Kn(e),e.__c;};var Qn=B.diffed;B.diffed=function(e){Qn&&Qn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value);};function or(e){return !!e.__k&&(Et(null,e),true)}function ir(e){return {render:function(t){nr(t,e);},unmount:function(){or(e);}}}function Dt(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(t>=r.startTime&&t<r.startTime+r.duration)return r}return e[0]||null}function We(e,t){if(!e||!e.phrases.length)return null;for(let n of e.phrases)if(t>=n.startTime&&t<n.endTime)return n;return null}var Lo='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Io='Georgia, "Times New Roman", serif',Po='Consolas, "Courier New", monospace';var Bo={blue:{bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"},green:{bg:"#22543d",text:"#9ae6b4",accent:"#68d391"},purple:{bg:"#44337a",text:"#d6bcfa",accent:"#b794f4"},red:{bg:"#742a2a",text:"#fc8181",accent:"#feb2b2"},orange:{bg:"#744210",text:"#fbd38d",accent:"#f6ad55"},teal:{bg:"#234e52",text:"#81e6d9",accent:"#4fd1c5"}},Eo={id:"standard",name:"Standard",description:"Clean and safe. System fonts only \u2014 no external font dependencies.",colors:{primary:"#3182ce",secondary:"#4a5568",background:"#1a202c",backgroundLight:"#2d3748",text:"#f7fafc",textMuted:"#a0aec0",highlight:"#4299e1",warning:"#fc8181"},typography:{bodyFontFamily:Lo,titleFontFamily:Io,monoFontFamily:Po,titleWeight:"bold"},style:{textShadow:true,overlayOpacity:.45,animationSpeed:1},renderStyle:{name:"standard",defaultTextAnimation:"fadeIn",defaultImageAnimation:"slowZoom",ambientMotion:true,defaultTransition:{type:"fade",duration:.7}},colorSchemes:Bo,persistentLayers:{bottomLayers:[{template:"gradientBackground",config:{type:"gradientBackground",preset:"dark-vignette"}}]}};var he=Eo;var J={landscape:{width:1920,height:1080,name:"16:9 Landscape"},portrait:{width:1080,height:1920,name:"9:16 Portrait"},square:{width:1080,height:1080,name:"1:1 Square"}};var Fo=Math.sqrt(1920*1920+1080*1080);function $t(e){return Math.sqrt(e.width*e.width+e.height*e.height)/Fo}function zt(e){let t=e.width/e.height;return Math.abs(t-1)<.05?"square":t>1?"landscape":"portrait"}var Ro={landscape:{primaryY:"35%",secondaryY:"55%",tertiaryY:"75%",titleScale:1,bodyScale:1,columnLeftX:"25%",columnRightX:"75%",columnTopY:"35%",columnBottomY:"65%",stackColumns:false,maxTextWidth:"80%",horizontalPadding:"10%",captionY:"85%",captionScale:1},portrait:{primaryY:"25%",secondaryY:"42%",tertiaryY:"58%",titleScale:.7,bodyScale:1.5,columnLeftX:"50%",columnRightX:"50%",columnTopY:"30%",columnBottomY:"55%",stackColumns:true,maxTextWidth:"90%",horizontalPadding:"5%",captionY:"75%",captionScale:.85},square:{primaryY:"30%",secondaryY:"50%",tertiaryY:"70%",titleScale:.85,bodyScale:.9,columnLeftX:"25%",columnRightX:"75%",columnTopY:"35%",columnBottomY:"65%",stackColumns:false,maxTextWidth:"85%",horizontalPadding:"7.5%",captionY:"82%",captionScale:.9}};function He(e){return Ro[e]}function ar(e,t,n,r=false){let o=$t(t),i=He(n),a=r?i.titleScale:i.bodyScale;return Math.round(e*o*a)}function ft(e){let t=He(e);return t.stackColumns?{left:{x:"50%",y:t.columnTopY},right:{x:"50%",y:t.columnBottomY}}:{left:{x:t.columnLeftX,y:"50%"},right:{x:t.columnRightX,y:"50%"}}}var Ot='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';function ne(e){return "template"in e&&typeof e.template=="string"}function ge(e,t,n,r=J.landscape){let o=zt(r);return {theme:e,blockIndex:t,totalBlocks:n,viewport:r,fontScale:$t(r),orientation:o,layout:He(o)}}function I(e,t,n=false){return ar(e,t.viewport,t.orientation,n)}function Wt(e){return "template"in e&&typeof e.template=="string"}function sr(e){return "children"in e&&Array.isArray(e.children)?e.children:[]}function ye(e){return "value"in e&&typeof e.value=="string"?e.value:sr(e).map(ye).join("")}var zo={"dark-vignette":"radial-gradient(ellipse at center, rgba(26,32,44,0.8) 0%, rgba(0,0,0,0.95) 100%)","radial-dark":"radial-gradient(ellipse at center, #1a202c 0%, #000000 100%)","warm-sunset":"linear-gradient(135deg, rgba(124,58,48,0.9) 0%, rgba(26,32,44,0.95) 100%)","cool-blue":"linear-gradient(135deg, rgba(26,54,93,0.9) 0%, rgba(26,32,44,0.95) 100%)","earth-tones":"linear-gradient(135deg, rgba(68,51,34,0.9) 0%, rgba(26,32,44,0.95) 100%)"};function Oo(e){return {type:"shape",id:"persistent-bg-solid",content:{shape:"rect",fill:e.color},position:{x:0,y:0,width:"100%",height:"100%"}}}function Wo(e){return {type:"shape",id:"persistent-bg-gradient",content:{shape:"rect",fill:e.gradient??zo[e.preset??"dark-vignette"]},position:{x:0,y:0,width:"100%",height:"100%"}}}function Ho(e){let t=[],n=e.opacity??.4,r={type:"image",id:"persistent-bg-image",content:{src:e.src,alt:"Background",fit:"cover"},position:{x:0,y:0,width:"100%",height:"100%"},animation:e.ambientMotion?{type:e.ambientMotion,duration:30}:void 0};return t.push(r),t.push({type:"shape",id:"persistent-bg-overlay",content:{shape:"rect",fill:`rgba(0,0,0,${.5+(1-n)*.3})`},position:{x:0,y:0,width:"100%",height:"100%"}}),t}function Uo(e){let t=e.opacity??.1;return {type:"shape",id:"persistent-bg-pattern",content:{shape:"rect",fill:e.color??`rgba(255,255,255,${t})`},position:{x:0,y:0,width:"100%",height:"100%"}}}function Vo(e){let t=[],n=e.fontSize??18,r=!!e.subtitle,o=e.position.includes("bottom"),i=e.position.includes("left"),a=3,s=r?"15%":"7%",u=o?r?"78%":"84%":"2%",c=i?`${a}%`:"68%",p=r?"6%":"5%",d=r?"10%":"5%",m=1.5,f=e.showThumbnail&&i?`${a+m+6+m}%`:`${a+m}%`,h=e.showThumbnail?"19%":"24%",g=o?r?"80%":"86%":"4%";if(t.push({type:"shape",id:"persistent-caption-bg",content:{shape:"rect",fill:"rgba(0,0,0,0.6)",borderRadius:8},position:{x:c,y:u,width:e.showThumbnail?"30%":"28%",height:s}}),e.showThumbnail&&e.thumbnailSrc){let y=i?`${a+m}%`:"93%",v=o?r?`${78+m}%`:"85%":"3%";t.push({type:"image",id:"persistent-caption-thumb",content:{src:e.thumbnailSrc,alt:"Article thumbnail",fit:"cover"},position:{x:y,y:v,width:p,height:d}});}if(t.push({type:"text",id:"persistent-caption-title",content:{text:e.title,style:{fontSize:n,fontWeight:"bold",color:"rgba(255,255,255,0.9)",textAlign:i?"left":"right",maxLines:1}},position:{x:f,y:g,width:h}}),r){let y=o?"85.5%":"8%";t.push({type:"text",id:"persistent-caption-subtitle",content:{text:e.subtitle,style:{fontSize:18,fontWeight:"normal",color:"rgba(255,255,255,0.55)",textAlign:i?"left":"right"}},position:{x:f,y,width:h}});}return t}function Yo(e){let t=e.position.includes("bottom"),r=e.position.includes("left")?"3%":"90%",o=t?"94%":"3%";return e.isImage?{type:"image",id:"persistent-branding",content:{src:e.content,alt:"Branding",fit:"contain"},position:{x:r,y:o,width:"8%",height:"4%"}}:{type:"text",id:"persistent-branding",content:{text:e.content,style:{fontSize:14,fontWeight:"normal",color:"rgba(255,255,255,0.6)"}},position:{x:r,y:o}}}function jo(e){let t=e.color??"rgba(255,255,255,0.3)",n=e.position==="top"?"1%":"98%";return {type:"shape",id:"persistent-progress",content:{shape:"rect",fill:t,borderRadius:2},position:{x:"5%",y:n,width:"90%",height:"0.5%"}}}function Xo(e){if(!Wt(e))return [e];let n=e.config;switch(n.type){case "solidBackground":return [Oo(n)];case "gradientBackground":return [Wo(n)];case "imageBackground":return Ho(n);case "patternBackground":return [Uo(n)];case "titleCaption":return Vo(n);case "cornerBranding":return [Yo(n)];case "progressIndicator":return [jo(n)];default:return console.warn("Unknown persistent layer template:",n.type),[]}}function Ue(e){return !e||e.length===0?[]:e.reduce((t,n)=>t.concat(Xo(n)),[])}var Zo={bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"};function be(e,t){let n=e.theme.colorSchemes;if(t&&t in n)return n[t];let r=Object.keys(n);return r.length>0?n[r[0]]:Zo}var Go='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Ko='Georgia, "Times New Roman", serif',Qo='Consolas, "Courier New", monospace';function L(e,t){let{typography:n}=e.theme;switch(t){case "title":return n.titleFontFamily||Ko;case "body":return n.bodyFontFamily||Go;case "mono":return n.monoFontFamily||Qo}}function ur(e,t){let{title:n,subtitle:r,backgroundColor:o}=e,{theme:i,layout:a}=t,s=I(96,t,true),u=I(36,t,false),p=[{type:"shape",id:"bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 40%, ${o||i.colors.primary} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"shape",id:"accent-line",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.2)"},position:{x:"40%",y:r?"28%":"38%",width:"20%",height:"2px"}},{type:"text",id:"title",content:{text:n,style:{fontSize:s,fontFamily:L(t,"title"),fontWeight:"bold",color:i.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:r?a.primaryY:"50%",anchor:"center",width:a.maxTextWidth},animation:{type:"fadeIn",duration:2}}];return r&&p.push({type:"text",id:"subtitle",content:{text:r,style:{fontSize:u,fontFamily:L(t,"body"),color:i.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:a.secondaryY,anchor:"center",width:a.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:1}}),p}function dr(e,t){let{title:n="",colorScheme:r="blue",imageSrc:o,imageAlt:i,ambientMotion:a}=e,{layout:s}=t,u=be(t,r),c=I(72,t,true),p=[];return o?(p.push({type:"image",id:"bg-image",content:{src:o,alt:i||n,fit:"cover"},position:{x:0,y:0,width:"100%",height:"100%"},animation:a?{type:a,duration:8}:{type:"slowZoom",duration:8,direction:"in"}}),p.push({type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.5)"},position:{x:0,y:0,width:"100%",height:"100%"}})):(p.push({type:"shape",id:"bg",content:{shape:"rect",fill:u.bg},position:{x:0,y:0,width:"100%",height:"100%"}}),p.push({type:"shape",id:"line-top",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"40%",width:"20%",height:"2px",anchor:"center"}}),p.push({type:"shape",id:"line-bottom",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"60%",width:"20%",height:"2px",anchor:"center"}})),p.push({type:"text",id:"title",content:{text:n,style:{fontSize:c,fontFamily:L(t,"title"),fontWeight:"bold",color:o?"#ffffff":u.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"50%",anchor:"center",width:s.maxTextWidth},animation:{type:"fadeIn",duration:1.5}}),p}var Jo=/^(\d+(?:\.\d+)?)\s*%?$/,ke={textCenterX:"50%",textWidth:"85%",textYAdjust:0,adjustY:false};function Ee(e,t){if(!e)return;let n=t!==void 0?{duration:t}:{};switch(e){case "zoomIn":case "in":return {type:"slowZoom",direction:"in",...n};case "zoomOut":case "out":return {type:"slowZoom",direction:"out",...n};case "panLeft":case "left":return {type:"slowZoom",panDirection:"left",...n};case "panRight":case "right":return {type:"slowZoom",panDirection:"right",...n};default:return}}var ue=35,fr=`${ue}%`;function Te(e){switch(e){case "left-strip":return {textCenterX:`${50+ue/2}%`,textWidth:`${100-ue-8}%`,textYAdjust:0,adjustY:false};case "right-strip":return {textCenterX:`${50-ue/2}%`,textWidth:`${100-ue-8}%`,textYAdjust:0,adjustY:false};case "bottom-strip":return {textCenterX:"50%",textWidth:"85%",textYAdjust:-10,adjustY:true};case "corner-inset":return {textCenterX:"45%",textWidth:"70%",textYAdjust:0,adjustY:false};default:return ke}}function Ce(e,t){let n=[],{src:r,alt:o,position:i,ambientMotion:a,credit:s,license:u}=e;switch(i){case "left-strip":n.push(lr(r,o,"left",t,a,s,u)),n.push(cr("left",t));break;case "right-strip":n.push(lr(r,o,"right",t,a,s,u)),n.push(cr("right",t));break;case "bottom-strip":n.push(ei(r,o,t,a,s,u)),n.push(ti(t));break;case "corner-inset":n.push(ni(r,o,t,a,s,u)),n.push(ri(t));break}return n}function lr(e,t,n,r,o,i,a){return {type:"image",id:`${r}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:i,license:a},position:{x:n==="left"?0:`${100-ue}%`,y:0,width:fr,height:"100%"},animation:Ee(o,15)}}function cr(e,t){let n=e==="left"?"accent-gradient-left":"accent-gradient-right";return {type:"shape",id:`${t}-accent-fade`,content:{shape:"rect",fill:`url(#${n})`},position:{x:e==="left"?`${ue-8}%`:`${100-ue}%`,y:0,width:"10%",height:"100%"}}}function ei(e,t,n,r,o,i){return {type:"image",id:`${n}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:o,license:i},position:{x:0,y:`${100-ue}%`,width:"100%",height:fr},animation:Ee(r,15)}}function ti(e){return {type:"shape",id:`${e}-accent-fade`,content:{shape:"rect",fill:"url(#accent-gradient-bottom)"},position:{x:0,y:`${100-ue-8}%`,width:"100%",height:"12%"}}}function ni(e,t,n,r,o,i){return {type:"image",id:`${n}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:o,license:i},position:{x:"70%",y:"60%",width:"28%",height:"38%",anchor:"top-left"},animation:Ee(r,15)??{type:"fadeIn",duration:2,delay:.5}}}function ri(e){return {type:"shape",id:`${e}-accent-vignette`,content:{shape:"rect",fill:"url(#accent-vignette-corner)",borderRadius:8},position:{x:"69%",y:"59%",width:"30%",height:"40%"}}}function K(e,t){if(!t.adjustY||t.textYAdjust===0)return typeof e=="number"?`${e}%`:e;let n=typeof e=="number"?`${e}`:e,r=n.match(Jo);if(r){let o=parseFloat(r[1]);return `${Math.max(5,o+t.textYAdjust)}%`}return n}var oi=/[.;:!?]+$/;function Ut(e){return e.replace(oi,"").trim()}function Ye(e,t){return {type:"shape",id:e,content:{shape:"rect",fill:t},position:{x:0,y:0,width:"100%",height:"100%"}}}function pr(e,t){let{stat:n,description:r,detail:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,u=be(t,i),c=a?Te(a.position):ke,p=I(148,t,true),d=I(32,t,false),m=I(26,t,false),f=[Ye("bg",`linear-gradient(180deg, ${s.colors.background} 0%, #0f1520 100%)`)];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"stat",content:{text:n,style:{fontSize:p,fontFamily:L(t,"title"),fontWeight:"bold",color:u.text,shadow:!!a}},position:{x:c.textCenterX,y:K("32%",c),anchor:"center"},animation:{type:"zoomIn",duration:.6}}),f.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,fontFamily:L(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.6,shadow:!!a}},position:{x:c.textCenterX,y:K("58%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.3}}),o&&f.push({type:"text",id:"detail",content:{text:o,style:{fontSize:m,fontFamily:L(t,"body"),color:u.accent,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:K("75%",c),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1}}),f}function mr(e,t){let{quote:n,attribution:r,accentImage:o}=e,{theme:i,layout:a}=t,s=o?Te(o.position):ke,u=I(48,t,true),c=I(24,t,false),p=I(280,t,true),d=[Ye("bg",`linear-gradient(160deg, ${i.colors.backgroundLight} 0%, #1e2636 100%)`)];o&&d.push(...Ce(o,e.id)),d.push({type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:p,fontFamily:L(t,"title"),color:"rgba(255, 255, 255, 0.06)",textAlign:"center"}},position:{x:s.textCenterX,y:K("18%",s),anchor:"center"}});let m=r?a.primaryY:"50%";return d.push({type:"text",id:"quote",content:{text:n,style:{fontSize:u,fontFamily:L(t,"title"),color:i.colors.text,textAlign:"center",lineHeight:1.6,shadow:true}},position:{x:s.textCenterX,y:K(m,s),anchor:"center",width:s.textWidth},animation:{type:"fadeIn",duration:2}}),r&&d.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:c,fontFamily:L(t,"body"),color:i.colors.textMuted,textAlign:"center",shadow:!!o}},position:{x:s.textCenterX,y:K(a.captionY,s),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),d}function hr(e,t){let{fact:n,explanation:r,source:o,accentImage:i}=e,{theme:a}=t,s=i?Te(i.position):ke,u=I(56,t,true),c=I(32,t,false),p=I(20,t,false),d=[Ye("bg",`linear-gradient(170deg, #1e2030 0%, ${a.colors.background} 100%)`)];return i&&d.push(...Ce(i,e.id)),d.push({type:"text",id:"fact",content:{text:n,style:{fontSize:u,fontFamily:L(t,"title"),fontWeight:"bold",color:a.colors.text,textAlign:"center",lineHeight:1.4,shadow:true}},position:{x:s.textCenterX,y:K("35%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),d.push({type:"text",id:"explanation",content:{text:r,style:{fontSize:c,fontFamily:L(t,"body"),color:a.colors.textMuted,textAlign:"center",lineHeight:1.5,shadow:!!i}},position:{x:s.textCenterX,y:K("60%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&d.push({type:"text",id:"source",content:{text:o,style:{fontSize:p,fontFamily:L(t,"body"),color:a.colors.textMuted,textAlign:"center",shadow:!!i}},position:{x:s.textCenterX,y:K("85%",s),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),d}function gr(e,t){let{left:n,right:r,header:o,leftColor:i="green",rightColor:a="blue"}=e;if(!n?.label||!r?.label)return [];let{theme:s,layout:u,orientation:c}=t,p=be(t,i),d=be(t,a),m=ft(c),f=u.stackColumns,h=f?"85%":"42%",g=I(32,t,false),y=I(44,t,true),v=I(22,t,false),x=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(135deg, ${s.colors.background} 0%, #16202e 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];f||(x.push({type:"shape",id:"left-panel",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.04)"},position:{x:"3%",y:"15%",width:"44%",height:"70%"}}),x.push({type:"shape",id:"right-panel",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.04)"},position:{x:"53%",y:"15%",width:"44%",height:"70%"}}));let S=f?"12%":"22%";o&&x.push({type:"text",id:"header",content:{text:o,style:{fontSize:g,fontFamily:L(t,"title"),color:s.colors.textMuted,textAlign:"center"}},position:{x:"50%",y:S,anchor:"center"},animation:{type:"fadeIn",duration:.8}});let w,C,P,R;if(f)w=o?"30%":"25%",C=o?"40%":"35%",P=o?"60%":"55%",R=o?"70%":"65%";else {let ae=o?"47%":"45%",k=o?"58%":"56%";w=ae,C=k,P=ae,R=k;}x.push({type:"text",id:"left-label",content:{text:n.label,style:{fontSize:y,fontFamily:L(t,"body"),fontWeight:"bold",color:p.text,textAlign:"center",lineHeight:1.3}},position:{x:m.left.x,y:w,anchor:"center",width:h},animation:{type:"fadeIn",duration:1}}),n.sublabel&&x.push({type:"text",id:"left-sublabel",content:{text:n.sublabel,style:{fontSize:v,fontFamily:L(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.left.x,y:C,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.3}});let N=I(120,t,true),Y=f?"48%":"50%",W=f?"\u2193":"\u2192";return x.push({type:"text",id:"connector",content:{text:W,style:{fontSize:N,fontFamily:L(t,"title"),fontWeight:"bold",color:"rgba(255, 255, 255, 0.6)",textAlign:"center"}},position:{x:"50%",y:Y,anchor:"center"},animation:{type:"fadeIn",duration:.6,delay:.4}}),x.push({type:"text",id:"right-label",content:{text:r.label,style:{fontSize:y,fontFamily:L(t,"body"),fontWeight:"bold",color:d.text,textAlign:"center",lineHeight:1.3}},position:{x:m.right.x,y:P,anchor:"center",width:h},animation:{type:"fadeIn",duration:1,delay:.5}}),r.sublabel&&x.push({type:"text",id:"right-sublabel",content:{text:r.sublabel,style:{fontSize:v,fontFamily:L(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.right.x,y:R,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.8}}),x}var ii={neutral:{bg:"#1a202c",date:"#63b3ed",text:"#ffffff"},somber:{bg:"#1a1a2e",date:"#e53e3e",text:"#a0aec0"},celebratory:{bg:"#1a365d",date:"#68d391",text:"#ffffff"}};function yr(e,t){let{date:n,description:r,footer:o,mood:i="neutral",accentImage:a}=e,{theme:s}=t,u=ii[i],c=a?Te(a.position):ke,p=I(96,t,true),d=I(30,t,false),m=I(26,t,false),f=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(135deg, ${u.bg} 0%, #0d1117 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"date",content:{text:n,style:{fontSize:p,fontFamily:L(t,"title"),fontWeight:"bold",color:u.date,shadow:!!a}},position:{x:c.textCenterX,y:K("35%",c),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,fontFamily:L(t,"body"),color:u.text,textAlign:"center",lineHeight:1.8,shadow:!!a}},position:{x:c.textCenterX,y:K("58%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:2,delay:1}}),o&&f.push({type:"text",id:"footer",content:{text:o,style:{fontSize:m,fontFamily:L(t,"body"),color:s.colors.textMuted,shadow:!!a}},position:{x:c.textCenterX,y:K("82%",c),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:3}}),f}function br(e,t){let{imageSrc:n,imageAlt:r,caption:o,captionPosition:i="bottom",ambientMotion:a,isTitle:s,subtitle:u,imageCredit:c,imageLicense:p}=e,d=o&&Ut(o),{theme:m,layout:f}=t,h=I(36,t,false),g=I(96,t,true),y=I(36,t,false),v=e.kenBurns,S=Ee(a||v),w=[{type:"image",id:"bg-image",content:{src:n,alt:r,fit:"cover",credit:c,license:p},position:{x:0,y:0,width:"100%",height:"100%"},animation:S}];return s&&d?(w.push({type:"shape",id:"title-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)"},position:{x:0,y:0,width:"100%",height:"100%"}}),w.push({type:"text",id:"title",content:{text:d,style:{fontSize:g,fontFamily:L(t,"title"),fontWeight:"bold",color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:u?"70%":"75%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8}}),u&&w.push({type:"text",id:"subtitle",content:{text:u,style:{fontSize:y,fontFamily:L(t,"body"),color:m.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:"82%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),w):(d&&(w.push({type:"shape",id:"caption-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)"},position:{x:0,y:"65%",width:"100%",height:"35%"}}),w.push({type:"text",id:"caption",content:{text:d,style:{fontSize:h,fontFamily:L(t,"body"),color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"82%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}})),w)}function _r(e,t){let{center:n,zoom:r,mapStyle:o="terrain",title:i,caption:a,markers:s,ambientMotion:u,staticSrc:c}=e,{theme:p,layout:d}=t,m=I(64,t,true),f=I(32,t,false),h=Ee(u),g=[{type:"map",id:"map-bg",content:{center:n,zoom:r,style:o,markers:s,showAttribution:true,staticSrc:c},position:{x:0,y:0,width:"100%",height:"100%"},animation:h}];return i&&(g.push({type:"shape",id:"title-overlay",content:{shape:"rect",fill:"rgba(0,0,0,0.6)"},position:{x:0,y:0,width:"100%",height:"18%"}}),g.push({type:"text",id:"title",content:{text:i,style:{fontSize:m,fontFamily:L(t,"title"),fontWeight:"bold",color:p.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"9%",anchor:"center",width:d.maxTextWidth},animation:{type:"fadeIn",duration:1,delay:.3}})),a&&(g.push({type:"shape",id:"caption-overlay",content:{shape:"rect",fill:"rgba(0,0,0,0.6)"},position:{x:0,y:"82%",width:"100%",height:"18%"}}),g.push({type:"text",id:"caption",content:{text:a,style:{fontSize:f,fontFamily:L(t,"body"),color:p.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:d.captionY,anchor:"center",width:d.maxTextWidth},animation:{type:"fadeIn",duration:1,delay:.5}})),g}function xr(e,t){let{text:n,colorScheme:r="blue"}=e,{theme:o}=t,i=be(t,r),a=I(120,t,true);return [{type:"shape",id:"bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 50%, ${o.colors.backgroundLight} 0%, #000000 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"impact-text",content:{text:n,style:{fontSize:a,fontFamily:L(t,"title"),fontWeight:"bold",color:i.text,textAlign:"center",lineHeight:1.2,shadow:true}},position:{x:"50%",y:"50%",anchor:"center",width:"85%"},animation:{type:"fadeIn",duration:1.5}}]}function vr(e,t){let{items:n,title:r,accentImage:o}=e,{theme:i}=t,a=o?Te(o.position):ke,s=I(44,t,true),u=I(34,t,false),c=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(155deg, ${i.colors.backgroundLight} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];o&&c.push(...Ce(o,e.id));let p=r?30:22;r&&c.push({type:"text",id:"list-title",content:{text:r,style:{fontSize:s,fontFamily:L(t,"title"),fontWeight:"bold",color:i.colors.text,textAlign:"center",shadow:!!o}},position:{x:a.textCenterX,y:K("16%",a),anchor:"center"},animation:{type:"fadeIn",duration:1}});let m=n.length>1?(80-p)/(n.length-1):0;for(let f=0;f<n.length;f++){let h=p+m*f,g=`${f+1}. ${n[f]}`;c.push({type:"text",id:`item-${f}`,content:{text:g,style:{fontSize:u,fontFamily:L(t,"body"),color:i.colors.text,lineHeight:1.4,shadow:!!o}},position:{x:a.textCenterX,y:K(`${h}%`,a),anchor:"center",width:a.textWidth},animation:{type:"fadeIn",duration:.8,delay:.3+.3*f}});}return c}var ee=.5;function kr(e,t){let{images:n,caption:r,ambientMotion:o}=e;if(!n||n.length===0)return [];let i=r&&Ut(r),{theme:a,layout:s}=t,u=[{type:"shape",id:"bg",content:{shape:"rect",fill:"#000000"},position:{x:0,y:0,width:"100%",height:"100%"}}],c=i?s.stackColumns?18:22:0,p=100-c,d=ai(n.length,p,s.stackColumns),m=I(24,t,false);for(let f=0;f<Math.min(n.length,4);f++){let h=n[f],g=d[f];u.push({type:"shape",id:`grid-placeholder-${f}`,content:{shape:"rect",fill:a.colors.background},position:{x:`${g.x}%`,y:`${g.y}%`,width:`${g.w}%`,height:`${g.h}%`}}),h.alt&&u.push({type:"text",id:`grid-alt-${f}`,content:{text:h.alt,style:{fontSize:m,fontFamily:L(t,"body"),color:a.colors.textMuted,textAlign:"center"}},position:{x:`${g.x+g.w/2}%`,y:`${g.y+g.h/2}%`,anchor:"center"}}),u.push({type:"image",id:`grid-img-${f}`,content:{src:h.src,alt:h.alt,fit:"cover",credit:h.credit,license:h.license},position:{x:`${g.x}%`,y:`${g.y}%`,width:`${g.w}%`,height:`${g.h}%`},animation:f===0&&o?{type:o,duration:15}:{type:"fadeIn",duration:1,delay:.2*f}});}if(i){let f=I(s.stackColumns?28:40,t,false);u.push({type:"shape",id:"caption-bg",content:{shape:"rect",fill:"linear-gradient(transparent, rgba(0,0,0,0.8))"},position:{x:0,y:`${p-4}%`,width:"100%",height:`${c+4}%`}}),u.push({type:"text",id:"caption",content:{text:i,style:{fontSize:f,fontFamily:L(t,"body"),color:a.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:`${p+(s.stackColumns?c/2:c*.3)}%`,anchor:"center",width:"90%"},animation:{type:"fadeIn",duration:1,delay:.5}});}return u}function ai(e,t,n){let r=50-ee/2,o=t/2-ee/2;switch(e){case 2:return n?[{x:0,y:0,w:100,h:o},{x:0,y:t/2+ee/2,w:100,h:o}]:[{x:0,y:0,w:r,h:t},{x:50+ee/2,y:0,w:r,h:t}];case 3:{if(n){let s=t/3-ee*2/3;return [{x:0,y:0,w:100,h:s},{x:0,y:t/3+ee/3,w:100,h:s},{x:0,y:t*2/3+ee*2/3,w:100,h:s}]}let i=60-ee/2,a=40-ee/2;return [{x:0,y:0,w:i,h:t},{x:60+ee/2,y:0,w:a,h:o},{x:60+ee/2,y:t/2+ee/2,w:a,h:o}]}default:return [{x:0,y:0,w:r,h:o},{x:50+ee/2,y:0,w:r,h:o},{x:0,y:t/2+ee/2,w:r,h:o},{x:50+ee/2,y:t/2+ee/2,w:r,h:o}]}}function wr(e,t){let{term:n,definition:r,origin:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,u=be(t,i),c=a?Te(a.position):ke,p=I(72,t,true),d=I(32,t,false),m=I(22,t,false),f=[Ye("bg",`linear-gradient(145deg, #1e2030 0%, ${s.colors.background} 100%)`)];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"term",content:{text:n,style:{fontSize:p,fontFamily:L(t,"title"),fontWeight:"bold",color:u.text,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:K("30%",c),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"shape",id:"separator",content:{shape:"rect",fill:`${u.text}33`},position:{x:c.textCenterX,y:K("42%",c),width:"30%",height:"2px",anchor:"center"}}),f.push({type:"text",id:"definition",content:{text:r,style:{fontSize:d,fontFamily:L(t,"body"),color:s.colors.text,textAlign:"center",lineHeight:1.6,maxLines:4,shadow:!!a}},position:{x:c.textCenterX,y:K("55%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&f.push({type:"text",id:"origin",content:{text:o,style:{fontSize:m,fontFamily:L(t,"body"),color:s.colors.textMuted,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:K("78%",c),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),f}function Sr(e,t){let{leftLabel:n,leftValue:r,rightLabel:o,rightValue:i,unit:a,colorScheme:s="blue"}=e,{theme:u}=t,c=be(t,s),p=I(28,t,false),d=I(48,t,true),m=Math.max(r,i,1),f=65,h=r/m*f,g=i/m*f,y=15,v=6,x=36,S=58,w=R=>R>=1e6?`${(R/1e6).toFixed(1)}M`:R>=1e3?`${(R/1e3).toFixed(R>=1e4?0:1)}K`:R.toLocaleString(),C=a?`${w(r)} ${a}`:w(r),P=a?`${w(i)} ${a}`:w(i);return [{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(180deg, ${u.colors.background} 0%, #0f1520 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"left-label",content:{text:n,style:{fontSize:p,fontFamily:L(t,"body"),color:u.colors.textMuted}},position:{x:`${y}%`,y:`${x-8}%`}},{type:"text",id:"left-value",content:{text:C,style:{fontSize:d,fontFamily:L(t,"body"),fontWeight:"bold",color:c.text}},position:{x:`${y+h+2}%`,y:`${x-1}%`},animation:{type:"fadeIn",duration:.8,delay:.3}},{type:"shape",id:"left-bar",content:{shape:"rect",fill:c.text,borderRadius:4},position:{x:`${y}%`,y:`${x}%`,width:`${h}%`,height:`${v}%`},animation:{type:"fadeIn",duration:1}},{type:"text",id:"right-label",content:{text:o,style:{fontSize:p,fontFamily:L(t,"body"),color:u.colors.textMuted}},position:{x:`${y}%`,y:`${S-8}%`}},{type:"text",id:"right-value",content:{text:P,style:{fontSize:d,fontFamily:L(t,"body"),fontWeight:"bold",color:c.accent}},position:{x:`${y+g+2}%`,y:`${S-1}%`},animation:{type:"fadeIn",duration:.8,delay:.6}},{type:"shape",id:"right-bar",content:{shape:"rect",fill:c.accent,borderRadius:4},position:{x:`${y}%`,y:`${S}%`,width:`${g}%`,height:`${v}%`},animation:{type:"fadeIn",duration:1,delay:.3}}]}function Tr(e,t){let{text:n,attribution:r,backgroundImage:o,ambientMotion:i}=e;if(!o?.src)return [];let a=I(52,t,true),s=I(24,t,false),u=I(200,t,true),c=[{type:"image",id:"bg-image",content:{src:o.src,alt:o.alt,fit:"cover",credit:o.credit,license:o.license},position:{x:0,y:0,width:"100%",height:"100%"},animation:i?{type:i,duration:15}:void 0},{type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.55)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:u,fontFamily:L(t,"title"),color:"rgba(255, 255, 255, 0.08)",textAlign:"center"}},position:{x:"50%",y:"20%",anchor:"center"}},{type:"text",id:"quote-text",content:{text:n,style:{fontSize:a,fontFamily:L(t,"title"),color:"#ffffff",textAlign:"center",lineHeight:1.5,shadow:true}},position:{x:"50%",y:r?"45%":"50%",anchor:"center",width:"80%"},animation:{type:"fadeIn",duration:2}}];return r&&c.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:s,fontFamily:L(t,"body"),color:"rgba(255, 255, 255, 0.7)",textAlign:"center",shadow:true}},position:{x:"50%",y:"72%",anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),c}function Cr(e,t){let{videoSrc:n,posterSrc:r,videoAlt:o,clipStart:i,clipEnd:a,sourceDuration:s,caption:u,captionPosition:c="bottom",videoCredit:p,videoLicense:d}=e,m=u&&Ut(u),{theme:f,layout:h}=t,g=I(36,t,false),y=I(16,t,false),v=[{type:"video",id:"bg-video",content:{src:n,posterSrc:r,alt:o,fit:"cover",clipStart:i,clipEnd:a,sourceDuration:s,credit:p,license:d},position:{x:0,y:0,width:"100%",height:"100%"}}];if(m){v.push({type:"shape",id:"caption-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)"},position:{x:0,y:c==="top"?0:"65%",width:"100%",height:"35%"}});let x=c==="top"?"15%":c==="center"?"50%":"82%";v.push({type:"text",id:"caption",content:{text:m,style:{fontSize:g,fontFamily:L(t,"body"),color:f.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:x,anchor:"center",width:h.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}});}return p&&v.push({type:"text",id:"credit",content:{text:p,style:{fontSize:y,fontFamily:L(t,"body"),color:"rgba(255, 255, 255, 0.5)",textAlign:"right"}},position:{x:"96%",y:"96%",anchor:"bottom-right"}}),v}function Mr(e,t){let{text:n,attribution:r,backgroundVideo:o}=e;if(!o?.src)return [];let i=I(52,t,true),a=I(24,t,false),s=I(200,t,true),u=[{type:"video",id:"bg-video",content:{src:o.src,posterSrc:o.posterSrc,alt:o.alt,fit:"cover",clipStart:o.clipStart,clipEnd:o.clipEnd,credit:o.credit,license:o.license},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.55)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:s,fontFamily:L(t,"title"),color:"rgba(255, 255, 255, 0.08)",textAlign:"center"}},position:{x:"50%",y:"20%",anchor:"center"}},{type:"text",id:"quote-text",content:{text:n,style:{fontSize:i,fontFamily:L(t,"title"),color:"#ffffff",textAlign:"center",lineHeight:1.5,shadow:true}},position:{x:"50%",y:r?"45%":"50%",anchor:"center",width:"80%"},animation:{type:"fadeIn",duration:2}}];return r&&u.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:a,fontFamily:L(t,"body"),color:"rgba(255, 255, 255, 0.7)",textAlign:"center",shadow:true}},position:{x:"50%",y:"72%",anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),u}function Ar(e,t){let{title:n,headers:r,rows:o,align:i,colorScheme:a}=e,{theme:s}=t,u=be(t,a),c=I(48,t,true),p=I(28,t,false),d=[Ye("bg",`linear-gradient(170deg, ${s.colors.background} 0%, #0f1520 100%)`)];return n&&d.push({type:"text",id:"title",content:{text:n,style:{fontSize:c,fontFamily:L(t,"title"),fontWeight:"bold",color:s.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"10%",width:"80%",anchor:"center"},animation:{type:"fadeIn",duration:.8}}),d.push({type:"table",id:"table",content:{headers:r,rows:o,align:i,style:{headerBackground:u.accent,headerColor:u.text,cellBackground:"rgba(255,255,255,0.05)",cellColor:s.colors.text,borderColor:"rgba(255,255,255,0.12)",fontSize:p,fontFamily:L(t,"body"),headerFontFamily:L(t,"title"),borderRadius:8}},position:{x:"10%",y:n?"18%":"8%",width:"80%",height:n?"74%":"84%"},animation:{type:"fadeIn",duration:1,delay:n?.4:0}}),d}function Lr(e,t){let{heroSrc:n,heroAlt:r,title:o,subtitle:i,ambientMotion:a,heroCredit:s,heroLicense:u}=e,{theme:c,layout:p}=t,d=I(96,t,true),m=I(36,t,false),f=Ee(a),h=[{type:"image",id:"cover-hero",content:{src:n,alt:r||o,fit:"cover",credit:s,license:u},position:{x:0,y:0,width:"100%",height:"100%"},animation:f},{type:"shape",id:"cover-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"cover-title",content:{text:o,style:{fontSize:d,fontFamily:L(t,"title"),fontWeight:"bold",color:c.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:i?"70%":"75%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8}}];return i&&h.push({type:"text",id:"cover-subtitle",content:{text:i,style:{fontSize:m,fontFamily:L(t,"body"),color:c.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:"82%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),h}function si(e){return {heroSrc:e.heroSrc,heroAlt:e.heroAlt,title:e.title,subtitle:e.subtitle,ambientMotion:e.ambientMotion,heroCredit:e.heroCredit,heroLicense:e.heroLicense}}function Vt(e,t){let n=si(e);return Lr(n,t)}var Ve={titleBlock:ur,sectionHeader:dr,statHighlight:pr,quoteBlock:mr,factCard:hr,twoColumn:gr,dateEvent:yr,imageWithCaption:br,mapBlock:_r,fullBleedQuote:xr,listBlock:vr,photoGrid:kr,definitionCard:wr,comparisonBar:Sr,pullQuote:Tr,videoWithCaption:Cr,videoPullQuote:Mr,dataTable:Ar};function pt(e,t){let n=Ve[e.template];if(!n)return console.warn(`Unknown template: ${e.template}`),{id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,transition:e.transition,template:e.template};let r;try{r=n(e,t),Array.isArray(r)||(console.error(`Template ${e.template} did not return an array, got:`,typeof r),r=[]);}catch(o){console.error(`Error expanding template ${e.template}:`,o),r=[];}return {id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,...r.length>0?{layers:r}:{},transition:e.transition,template:e.template}}function Yt(e,t={}){let n=t,r=n.theme??he,o=n.viewport??J.landscape,{persistentLayers:i,audioSegments:a}=n,s=e.length,u=Ue(i?.bottomLayers),c=Ue(i?.topLayers);if(!a||a.length===0){let m=0;return e.map((f,h)=>{let g=ge(r,h,s,o),y=ne(f)?pt(f,g):f,v=f,x=v.useBottomLayer!==false,S=v.useTopLayer!==false;return (u.length>0||c.length>0)&&(y.layers=[...x?u:[],...y.layers??[],...S?c:[]]),y.startTime=m,m+=y.duration,y})}let p=new Map;e.forEach((m,f)=>{let h=m.audioSegment??0;p.has(h)||p.set(h,[]),p.get(h).push({block:m,originalIndex:f});});let d=new Array(e.length);for(let[m,f]of p){let h=a[m];if(!h){let b=0;for(let{block:_,originalIndex:M}of f){let F=ge(r,M,s,o),q=ne(_)?pt(_,F):_,E=_,D=E.useBottomLayer!==false,oe=E.useTopLayer!==false;(u.length>0||c.length>0)&&(q.layers=[...D?u:[],...q.layers??[],...oe?c:[]]),q.startTime=b,b+=q.duration,d[M]=q;}continue}let g=[],y=[];for(let b of f)b.block.template==="sectionHeader"?g.push(b):y.push(b);let v=g.reduce((b,{block:_})=>b+(_.duration??0),0),x=y.reduce((b,{block:_})=>b+(_.duration??0),0),S=h.duration-v,w=x>0&&S>0?S/x:1,C=[];for(let{block:b,originalIndex:_}of f){let M=ge(r,_,s,o),F=ne(b)?pt(b,M):b,q=b,E=q.useBottomLayer!==false,D=q.useTopLayer!==false;(u.length>0||c.length>0)&&(F.layers=[...E?u:[],...F.layers??[],...D?c:[]]),C.push({block:F,originalIndex:_,templateBlock:q,hasSourceTiming:typeof q.sourceStartTime=="number"});}let P=C.some(b=>b.hasSourceTiming);C.sort((b,_)=>{if(P){let M=b.templateBlock.template==="sectionHeader",F=_.templateBlock.template==="sectionHeader";if(M&&!F)return -1;if(!M&&F)return 1;if(b.hasSourceTiming&&_.hasSourceTiming)return b.templateBlock.sourceStartTime-_.templateBlock.sourceStartTime;if(b.hasSourceTiming&&!_.hasSourceTiming)return -1;if(!b.hasSourceTiming&&_.hasSourceTiming)return 1}return b.originalIndex-_.originalIndex});let R=0;for(let b=0;b<C.length;b++){let _=C[b],{block:M,templateBlock:F}=_;if(_.hasSourceTiming){let q=F.sourceStartTime;M.startTime=h.startTime+q,typeof F.sourceDuration=="number"&&(M.duration=Math.max(5,F.sourceDuration)),R=q+M.duration;}else if(F.template==="sectionHeader")M.startTime=h.startTime+R,R+=M.duration;else {M.startTime=h.startTime+R;let q=M.duration*w;M.duration=q,R+=q;}d[_.originalIndex]=M;}let N=C.map(b=>d[b.originalIndex]).sort((b,_)=>b.startTime-_.startTime);for(let b=0;b<N.length-1;b++){let _=N[b],M=N[b+1],F=_.startTime+_.duration;F>M.startTime?_.duration=M.startTime-_.startTime:F<M.startTime-.5&&(_.duration=Math.max(.1,M.startTime-_.startTime));}let Y=5,W=h.startTime+h.duration;for(;N.length>1;){let b=N[N.length-1];if(W-b.startTime<Y&&b.template!=="sectionHeader"){let M=N[N.length-2];M.duration=W-M.startTime,b.duration=0,b.startTime=W,N.pop();}else {b.startTime+b.duration<W&&(b.duration=W-b.startTime);break}}if(N.length===1){let b=N[0];b.startTime+b.duration<W&&(b.duration=W-b.startTime);}let ae=true;for(;ae;){ae=false;for(let b=N.length-1;b>=1;b--){let _=N[b];if(_.duration>0&&_.duration<Y){let M=N[b-1],F=_.startTime+_.duration;M.duration=F-M.startTime,_.duration=0,_.startTime=W,N.splice(b,1),ae=true;break}}}let k=20;for(let b=0;b<N.length;b++){let _=N[b];if(_.duration>k){let M=Math.ceil(_.duration/k),F=_.duration/M;if(F>=Y){_.duration=F;for(let q=1;q<M;q++){let E={id:`${_.id}-split-${q}`,startTime:_.startTime+q*F,duration:F,audioSegment:_.audioSegment,layers:(_.layers??[]).map(D=>({...D,id:`${D.id}-split-${q}`})),transition:{type:"dissolve",duration:1},template:_.template};d.push(E);}}}}}return d.filter(m=>m&&m.duration>0)}function jt(e){return e in Ve}function re(e,t=0){if(!e||e.type==="none")return {className:"",style:{}};let n=li(e),r=ci(e);return {className:n,style:r}}function li(e){let{type:t,direction:n,panDirection:r}=e;switch(t){case "fadeIn":return "anim-fadeIn";case "fadeOut":return "anim-fadeOut";case "slowZoom":return r==="left"?"anim-slowZoom-panLeft":r==="right"?"anim-slowZoom-panRight":n==="out"?"anim-slowZoom-out":"anim-slowZoom-in";case "zoomIn":return "anim-zoomIn";case "zoomOut":return "anim-zoomOut";case "panLeft":return "anim-panLeft";case "panRight":return "anim-panRight";case "typewriter":return "anim-typewriter";default:return ""}}function ci(e){let t={};return e.duration!==void 0&&(t["--anim-duration"]=`${e.duration}s`),e.delay!==void 0&&(t["--anim-delay"]=`${e.delay}s`),e.easing&&(t["--anim-easing"]=e.easing),t}function je(e,t){return `transition-${e}-${t?"enter":"exit"}`}function mt(e){let t=[];for(let n of e)t.push(n),n.children&&t.push(...mt(n.children));return t}function Xt(e,t={}){let n=t.theme??he,r=t.viewport??J.landscape,o=t.blockIndex??0,i=t.totalBlocks??1,a=e.layers;if(a&&a.length>0&&!ne(e))return Ht(a,e,t);if(ne(e)&&e.template in Ve){let s=e.template,u=ge(n,o,i,r),c;try{let p=Ve[s];c=p(e,u),Array.isArray(c)||(console.error(`Template ${s} did not return an array, got:`,typeof c),c=[]);}catch(p){console.error(`Error expanding template ${s}:`,p),c=[];}return Ht(c,e,t)}return Ht([],e,t)}function Ht(e,t,n){let{persistentLayers:r}=n;if(!r)return e;let o=Ue(r.bottomLayers),i=Ue(r.topLayers);if(o.length===0&&i.length===0)return e;let a=t,s=a.useBottomLayer!==false,u=a.useTopLayer!==false;return [...s?o:[],...e,...u?i:[]]}function O(e,t){return typeof e=="number"?e:e.endsWith("%")?parseFloat(e)/100*t:parseFloat(e)}function de(e,t,n){switch(e){case "center":return {x:-t/2,y:-n/2};case "top-right":return {x:-t,y:0};case "bottom-left":return {x:0,y:-n};case "bottom-right":return {x:-t,y:-n};default:return {x:0,y:0}}}var Zt=lt(null);function fi(){return qt(Zt)}function Xe(e,t){let n=fi(),r=e.startsWith("http")||e.startsWith("/")||e.startsWith("data:")||e.startsWith("blob:"),o=$(()=>r?e:`${t}/${e}`,[r,e,t]),i=!r&&!!n,[a,s]=U(o);return z(()=>{if(!i){s(o);return}let u=false;return n.resolveUrl(e).then(c=>{u||s(c);}),()=>{u=true;}},[i,n,e,o]),i?a:o}var pi=0;function l(e,t,n,r,o,i){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var c={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--pi,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return B.vnode&&B.vnode(c),c}function Ir({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,s=O(i.x,n.width),u=O(i.y,n.height),c=i.width?O(i.width,n.width):n.width,p=i.height?O(i.height,n.height):n.height,d=de(i.anchor,c,p),m=s+d.x,f=u+d.y,h=Xe(o.src,t),g=re(a,r),y=mi(o.fit),v=o.fit==="cover",x=a&&hi.has(a.type);if(v&&x&&a){let S=gi(a),w=re(S,r);return l("g",{className:"block-layer block-layer--image","data-layer-id":e.id,children:l("foreignObject",{x:m,y:f,width:c,height:p,children:l("div",{style:{width:"100%",height:"100%",overflow:"hidden"},children:l("img",{src:h,alt:o.alt||"",className:w.className,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none",transformOrigin:"center center",...w.style}})})})})}return v?l("g",{className:`block-layer block-layer--image ${g.className}`,style:g.style,"data-layer-id":e.id,children:l("foreignObject",{x:m,y:f,width:c,height:p,children:l("img",{src:h,alt:o.alt||"",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})}):l("g",{className:`block-layer block-layer--image ${g.className}`,style:g.style,"data-layer-id":e.id,children:l("image",{href:h,x:m,y:f,width:c,height:p,preserveAspectRatio:y,style:{pointerEvents:"none"}})})}function mi(e){switch(e){case "cover":return "xMidYMid slice";case "fill":return "none";default:return "xMidYMid meet"}}var hi=new Set(["panLeft","panRight","slowZoom","zoomIn","zoomOut"]);function gi(e){switch(e.type){case "panLeft":return {...e,type:"slowZoom",panDirection:"left"};case "panRight":return {...e,type:"slowZoom",panDirection:"right"};case "zoomIn":return {...e,type:"slowZoom",direction:"in"};case "zoomOut":return {...e,type:"slowZoom",direction:"out"};default:return e}}function Pr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{text:a,style:s}=r,u=O(o.x,t.width),c=O(o.y,t.height),p=o.width?O(o.width,t.width):void 0,d=yi(s.textAlign,o.anchor),m=bi(o.anchor),f=re(i,n),h=(a??"").split(`
2
- `),g=p?h.reduce((w,C)=>w.concat(xi(C,s.fontSize,p)),[]):h;if(s.maxLines&&g.length>s.maxLines){g=g.slice(0,s.maxLines);let w=g[g.length-1];g[g.length-1]=w.replace(/\s*$/,"")+"...";}let y=s.lineHeight||1.4,v=s.fontSize*y,x={fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||Ot,fontWeight:s.fontWeight||"normal",fill:s.color,...f.style},S=s.shadow?`shadow-${e.id}`:void 0;return l("g",{className:`block-layer block-layer--text ${f.className}`,"data-layer-id":e.id,children:[s.shadow&&l("defs",{children:l("filter",{id:S,x:"-20%",y:"-20%",width:"140%",height:"140%",children:l("feDropShadow",{dx:"0",dy:"2",stdDeviation:"3",floodColor:"rgba(0,0,0,0.7)"})})}),s.background&&l("rect",{x:u-(s.padding||16),y:c-s.fontSize-(s.padding||16),width:_i(g,s)+(s.padding||16)*2,height:g.length*v+(s.padding||16)*2,fill:s.background,rx:4,ry:4}),l("text",{x:u,y:c,textAnchor:d,dominantBaseline:m,style:x,filter:S?`url(#${S})`:void 0,children:g.map((w,C)=>l("tspan",{x:u,dy:C===0?0:v,children:[w||"\xA0"," "]},C))})]})}function yi(e,t){return e==="center"?"middle":e==="right"?"end":e==="left"?"start":t?.includes("right")?"end":t==="center"?"middle":"start"}function bi(e){return e?.includes("bottom")?"text-after-edge":e==="center"?"middle":"text-before-edge"}function _i(e,t){return Math.max(...e.map(r=>r.length))*t.fontSize*.55}function xi(e,t,n){if(!e.trim())return [""];let r=t*.5,o=Math.floor(n/r);if(o<=0)return [e];let i=e.split(/\s+/),a=[],s="";for(let u of i){let c=s?`${s} ${u}`:u;if(c.length<=o)s=c;else if(s&&a.push(s),u.length>o){let p=u;for(;p.length>o;)a.push(p.slice(0,o)),p=p.slice(o);s=p;}else s=u;}return s&&a.push(s),a.length>0?a:[""]}function Br({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,a=O(o.x,t.width),s=O(o.y,t.height),u=o.width?O(o.width,t.width):100,c=o.height?O(o.height,t.height):100,p=de(o.anchor,u,c),d=a+p.x,m=s+p.y,f=re(i,n),h=r.fill||"none",g=typeof h=="string"&&h.includes("gradient(");if(r.shape==="rect"&&g)return l("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:l("foreignObject",{x:d,y:m,width:u,height:c,children:l("div",{style:{width:"100%",height:"100%",background:h,borderRadius:r.borderRadius?`${r.borderRadius}px`:void 0,pointerEvents:"none"}})})});let y={fill:h,stroke:r.stroke,strokeWidth:r.strokeWidth};return l("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:[r.shape==="rect"&&l("rect",{x:d,y:m,width:u,height:c,rx:r.borderRadius,ry:r.borderRadius,...y}),r.shape==="circle"&&l("circle",{cx:d+u/2,cy:m+c/2,r:Math.min(u,c)/2,...y}),r.shape==="line"&&l("line",{x1:d,y1:m,x2:d+u,y2:m+c,stroke:r.stroke||"#ffffff",strokeWidth:r.strokeWidth||2})]})}var vi={terrain:{url:"https://tile.opentopomap.org/{z}/{x}/{y}.png",attribution:"Map: OpenTopoMap (CC-BY-SA)",maxZoom:17},road:{url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xA9 OpenStreetMap contributors",maxZoom:19},satellite:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",attribution:"Imagery: Esri, Maxar, Earthstar",maxZoom:18},toner:{url:"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png",attribution:"Map: Stadia Maps, Stamen Design",maxZoom:20},watercolor:{url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",attribution:"Map: Stadia Maps, Stamen Design",maxZoom:16}};function Gt(e,t,n){let r=Math.pow(2,n),o=Math.floor((t+180)/360*r),i=e*Math.PI/180,a=Math.floor((1-Math.log(Math.tan(i)+1/Math.cos(i))/Math.PI)/2*r);return {x:o,y:a}}function Kt(e,t,n,r=256){let o=Math.pow(2,n),i=(t+180)/360*o,a=e*Math.PI/180,s=(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2*o;return {x:(i-Math.floor(i))*r,y:(s-Math.floor(s))*r}}function ki(e,t,n,r,o,i=256){let a=Gt(e,t,n),s=Kt(e,t,n,i),u=Math.ceil(r/i)+1,c=Math.ceil(o/i)+1,p=a.x-Math.floor(u/2),d=a.y-Math.floor(c/2),m=r/2-s.x,f=o/2-s.y,h=[];for(let g=0;g<c;g++)for(let y=0;y<u;y++){let v=p+y,x=d+g,S=m+(v-a.x)*i,w=f+(x-a.y)*i;h.push({x:v,y:x,screenX:S,screenY:w});}return h}function wi(e,t,n,r){return e.url.replace("{z}",String(r)).replace("{x}",String(t)).replace("{y}",String(n))}async function Si(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=()=>n(new Error(`Failed to load tile: ${e}`)),r.src=e;})}async function Er(e){let{center:t,zoom:n,style:r,width:o,height:i,markers:a=[],showAttribution:s=true}=e,u=vi[r],c=u.tileSize||256,p=Math.min(n,u.maxZoom),d=document.createElement("canvas");d.width=o,d.height=i;let m=d.getContext("2d");if(!m)throw new Error("Failed to get canvas context");m.fillStyle=r==="toner"?"#ffffff":"#e5e7eb",m.fillRect(0,0,o,i);let h=ki(t.lat,t.lng,p,o,i,c).map(async g=>{let y=wi(u,g.x,g.y,p);try{let v=await Si(y);m.drawImage(v,g.screenX,g.screenY,c,c);}catch(v){console.warn(`Tile load failed: ${y}`,v);}});await Promise.all(h);for(let g of a)Ti(m,g,t,p,o,i,c);return s&&Mi(m,u.attribution,o,i),d.toDataURL("image/png")}function Ti(e,t,n,r,o,i,a){let s=Gt(n.lat,n.lng,r),u=Gt(t.lat,t.lng,r),c=Kt(n.lat,n.lng,r,a),p=Kt(t.lat,t.lng,r,a),d=(u.x-s.x)*a+(p.x-c.x),m=(u.y-s.y)*a+(p.y-c.y),f=o/2+d,h=i/2+m,g=t.color||"#ef4444",y=t.icon||"pin";e.save(),y==="pin"?(e.fillStyle=g,e.beginPath(),e.arc(f,h-12,8,Math.PI,0,false),e.lineTo(f,h),e.closePath(),e.fill(),e.fillStyle="#ffffff",e.beginPath(),e.arc(f,h-12,3,0,Math.PI*2),e.fill()):y==="circle"?(e.fillStyle=g,e.beginPath(),e.arc(f,h,8,0,Math.PI*2),e.fill(),e.strokeStyle="#ffffff",e.lineWidth=2,e.stroke()):y==="star"&&(e.fillStyle=g,Ci(e,f,h,5,10,5),e.fill()),t.label&&(e.fillStyle="#1f2937",e.font="bold 12px system-ui, sans-serif",e.textAlign="center",e.fillText(t.label,f,h+20)),e.restore();}function Ci(e,t,n,r,o,i){let a=Math.PI/2*3,s=Math.PI/r;e.beginPath(),e.moveTo(t,n-o);for(let u=0;u<r;u++)e.lineTo(t+Math.cos(a)*o,n+Math.sin(a)*o),a+=s,e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i),a+=s;e.lineTo(t,n-o),e.closePath();}function Mi(e,t,n,r){e.save(),e.fillStyle="rgba(255, 255, 255, 0.8)";let o=4;e.font="10px system-ui, sans-serif";let i=e.measureText(t).width;e.fillRect(n-i-o*2-4,r-16,i+o*2,14),e.fillStyle="#374151",e.textAlign="right",e.fillText(t,n-o-4,r-5),e.restore();}function Fr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,[s,u]=U(null),[c,p]=U(true),[d,m]=U(null),f=O(i.x,n.width),h=O(i.y,n.height),g=i.width?O(i.width,n.width):n.width,y=i.height?O(i.height,n.height):n.height,v=de(i.anchor,g,y),x=f+v.x,S=h+v.y;z(()=>{let C=false;if(o.staticSrc){let P=o.staticSrc.startsWith("http")?o.staticSrc:`${t}/${o.staticSrc}`;u(P),p(false);return}return p(true),m(null),Er({center:o.center,zoom:o.zoom,style:o.style,width:g,height:y,markers:o.markers,showAttribution:o.showAttribution!==false}).then(P=>{C||(u(P),p(false));}).catch(P=>{C||(console.error("Failed to compose map:",P),m(P instanceof Error?P.message:String(P)),p(false));}),()=>{C=true;}},[o.center.lat,o.center.lng,o.zoom,o.style,o.staticSrc,g,y,t]);let w=re(a,r);return c?l("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[l("rect",{x,y:S,width:g,height:y,fill:"#e5e7eb"}),l("text",{x:x+g/2,y:S+y/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#9ca3af",fontSize:"24",fontFamily:"system-ui, sans-serif",children:"Loading map..."})]}):d||!s?l("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[l("rect",{x,y:S,width:g,height:y,fill:"#fef2f2"}),l("text",{x:x+g/2,y:S+y/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#dc2626",fontSize:"18",fontFamily:"system-ui, sans-serif",children:"Map failed to load"})]}):l("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[l("defs",{children:l("clipPath",{id:`clip-${e.id}`,children:l("rect",{x,y:S,width:g,height:y})})}),l("g",{clipPath:`url(#clip-${e.id})`,children:l("image",{href:s,x,y:S,width:g,height:y,preserveAspectRatio:"xMidYMid slice",style:{pointerEvents:"none"}})})]})}function Rr({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){let{content:i,position:a}=e,s=V(null),u=V(false),c=O(a.x,n.width),p=O(a.y,n.height),d=a.width?O(a.width,n.width):n.width,m=a.height?O(a.height,n.height):n.height,f=de(a.anchor,d,m),h=c+f.x,g=p+f.y,y=Xe(i.src,t),v=Xe(i.posterSrc||"",t),x=i.posterSrc?v:void 0;return z(()=>{let S=s.current;if(!S)return;if(S.currentTime=i.clipStart,u.current=true,o){let C=S.play();C&&C.catch(()=>{});}let w=()=>{S.currentTime>=i.clipEnd&&(S.pause(),S.currentTime=i.clipEnd);};return S.addEventListener("timeupdate",w),()=>{S.removeEventListener("timeupdate",w),S.pause();}},[i.src,i.clipStart,i.clipEnd]),z(()=>{let S=s.current;if(!(!S||!u.current)&&!(S.currentTime>=i.clipEnd))if(o){let w=S.play();w&&w.catch(()=>{});}else S.pause();},[o,i.clipEnd]),l("g",{className:"block-layer block-layer--video","data-layer-id":e.id,children:l("foreignObject",{x:h,y:g,width:d,height:m,children:l("video",{ref:s,src:y,poster:x,muted:true,playsInline:true,preload:"auto","data-clip-start":i.clipStart,"data-clip-end":i.clipEnd,style:{width:"100%",height:"100%",objectFit:i.fit||"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})})}function qr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{headers:a,rows:s,align:u,style:c}=r,p=O(o.x,t.width),d=O(o.y,t.height),m=o.width?O(o.width,t.width):t.width,f=o.height?O(o.height,t.height):t.height,h=de(o.anchor,m,f),g=p+h.x,y=d+h.y,v=i?re(i,n):{},x=w=>{let C=u?.[w];return C?{textAlign:C}:void 0},S=c.borderRadius??8;return l("foreignObject",{x:g,y,width:m,height:f,style:v,children:l("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",boxSizing:"border-box"},children:l("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:`${c.fontSize}px`,fontFamily:c.fontFamily??"system-ui, sans-serif",overflow:"hidden",borderRadius:`${S}px`,border:`1px solid ${c.borderColor}`},children:[a.length>0&&l("thead",{children:l("tr",{children:a.map((w,C)=>l("th",{style:{background:c.headerBackground,color:c.headerColor,fontFamily:c.headerFontFamily??c.fontFamily??"system-ui, sans-serif",fontWeight:600,padding:"12px 16px",borderBottom:`2px solid ${c.borderColor}`,borderRight:C<a.length-1?`1px solid ${c.borderColor}`:void 0,...x(C)},children:w},C))})}),s.length>0&&l("tbody",{children:s.map((w,C)=>l("tr",{children:w.map((P,R)=>l("td",{style:{background:c.cellBackground,color:c.cellColor,padding:"10px 16px",borderBottom:C<s.length-1?`1px solid ${c.borderColor}`:void 0,borderRight:R<w.length-1?`1px solid ${c.borderColor}`:void 0,...x(R)},children:P},R))},C))})]})})})}var Ai={width:1920,height:1080};function Fe({block:e,blockTime:t,basePath:n,isEntering:r=false,isExiting:o=false,viewport:i=Ai,isPlaying:a}){let s="",u={};e.transition&&r?(s=je(e.transition.type,true),u["--transition-duration"]=`${e.transition.duration}s`):e.transition&&o&&(s=je(e.transition.type,false),u["--transition-duration"]=`${e.transition.duration}s`);let c=`vb-clip-${e.id}`;return l("svg",{className:`block-svg ${s}`,style:u,viewBox:`0 0 ${i.width} ${i.height}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden","data-block-id":e.id,children:[l("defs",{children:l("clipPath",{id:c,children:l("rect",{x:"0",y:"0",width:i.width,height:i.height})})}),l("g",{clipPath:`url(#${c})`,children:(e.layers??[]).map(p=>l(Li,{layer:p,basePath:n,viewport:i,blockTime:t,isPlaying:a},p.id))})]})}function Li({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){switch(e.type){case "image":return l(Ir,{layer:e,basePath:t,viewport:n,blockTime:r});case "text":return l(Pr,{layer:e,viewport:n,blockTime:r});case "shape":return l(Br,{layer:e,viewport:n,blockTime:r});case "map":return l(Fr,{layer:e,basePath:t,viewport:n,blockTime:r});case "video":return l(Rr,{layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o});case "table":return l(qr,{layer:e,viewport:n,blockTime:r});default:return console.warn(`Unknown layer type: ${e.type}`),null}}var Ii=4,Nr=2,Pi=6;function Bi(e){if(e.words&&e.words.length>0)return e.words.map(o=>({text:o.text,startTime:o.startTime,endTime:o.endTime}));let t=e.text.split(/\s+/).filter(o=>o.length>0);if(t.length===0)return [];let r=(e.endTime-e.startTime)/t.length;return t.map((o,i)=>({text:o,startTime:e.startTime+i*r,endTime:e.startTime+(i+1)*r}))}function Ei(e){let t=[];for(let o of e.phrases)t.push(...Bi(o));if(t.length===0)return {words:[],chunks:[]};let n=Ii;if(t.length>n){let o=Math.ceil(t.length/n);n=Math.ceil(t.length/o),n=Math.min(Pi,Math.max(Nr,n));}else n=Math.max(Nr,t.length);let r=[];for(let o=0;o<t.length;o+=n){let i=t.slice(o,o+n);r.push({words:i,startTime:i[0].startTime,endTime:i[i.length-1].endTime});}return {words:t,chunks:r}}function Dr({captions:e,currentTime:t,enabled:n=true,theme:r,viewport:o}){let{chunks:i}=$(()=>e?Ei(e):{words:[],chunks:[]},[e]);if(!n||i.length===0)return l("div",{className:"social-caption-overlay",style:{position:"absolute",bottom:"18%",left:0,right:0,zIndex:50,pointerEvents:"none",opacity:0,transition:"opacity 0.15s ease-in-out"}});let a=null,s=-1;for(let f of i)if(t>=f.startTime&&t<f.endTime){a=f;break}if(!a){for(let f=0;f<i.length-1;f++)if(t>=i[f].endTime&&t<i[f+1].startTime){a=i[f],s=a.words.length-1;break}!a&&i.length>0&&t>=i[i.length-1].startTime&&(a=i[i.length-1],s=a.words.length-1);}if(!a)return null;if(s===-1){for(let f=0;f<a.words.length;f++){let h=a.words[f];if(t>=h.startTime&&t<h.endTime){s=f;break}}if(s===-1){for(let f=a.words.length-1;f>=0;f--)if(t>=a.words[f].startTime){s=f;break}}s===-1&&(s=0);}let u=r?.colors?.primary??"#5b9bd5",c=r?.typography?.titleFontFamily?`"${r.typography.titleFontFamily}", system-ui, sans-serif`:'"PT Serif", Georgia, serif',p=o?.height??720,d=Math.round(p*.055),m=Math.max(24,Math.min(72,d));return l("div",{className:"social-caption-overlay",style:{position:"absolute",bottom:"18%",left:0,right:0,zIndex:50,pointerEvents:"none",textAlign:"center",padding:"0 8%",boxSizing:"border-box",opacity:1,transition:"opacity 0.15s ease-in-out"},children:l("div",{style:{display:"inline-block",lineHeight:1.3},children:a.words.map((f,h)=>{let g=h===s;return l("span",{style:{fontFamily:c,fontSize:`${m}px`,fontWeight:g?800:600,color:g?u:"rgba(255, 255, 255, 0.9)",textShadow:"0 2px 8px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.4)",marginRight:h<a.words.length-1?"0.3em":void 0,transition:"color 0.1s ease, font-weight 0.1s ease",textTransform:"uppercase"},children:f.text},`${f.startTime}-${h}`)})})})}function $r({captions:e,currentTime:t,enabled:n=true,fontSize:r=16,captionStyle:o="standard",theme:i,viewport:a}){if(o==="social")return l(Dr,{captions:e,currentTime:t,enabled:n,theme:i,viewport:a});let u=(n&&e?We(e,t):null)?.text??null;return l("div",{className:"caption-overlay",style:{position:"absolute",top:"6px",left:"50%",transform:"translateX(-50%)",zIndex:50,pointerEvents:"none",maxWidth:"100%",width:"100%",textAlign:"center",opacity:u?1:0,transition:"opacity 0.15s ease-in-out",padding:"0 4px",boxSizing:"border-box"},children:u&&l("div",{style:{display:"inline-block",padding:"3px 10px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"4px",backdropFilter:"blur(4px)"},children:l("span",{style:{color:"#ffffff",fontSize:`${r}px`,fontFamily:"'Hanken Grotesk', system-ui, sans-serif",fontWeight:500,lineHeight:1.25,textShadow:"0 1px 3px rgba(0,0,0,0.5)",whiteSpace:"pre-wrap",wordWrap:"break-word"},children:u})})})}function zr(e,t,n=""){let[r,o]=U(0),[i,a]=U(false),[s,u]=U(0),[c,p]=U(false),[d,m]=U(false),[f,h]=U(0),g=V([]),y=V(null),v=V(false),x=V(new Map),S=V(new Map),w=V(false);z(()=>{if(!t?.segments)return;let k=0;g.current=t.segments.map(b=>{let _=k;return k+=b.duration,_}),h(k);},[t]);let C=Z(async k=>{let b=n?`${n}/${k}`:k;if(x.current.has(k))return x.current.get(k);if(S.current.has(k))return S.current.get(k);let _=(async()=>{try{let M=await fetch(b);if(!M.ok)throw new Error(`HTTP ${M.status}`);let F=await M.blob(),q=URL.createObjectURL(F);return x.current.set(k,q),q}catch{return b}finally{S.current.delete(k);}})();return S.current.set(k,_),_},[n]);z(()=>{if(!t?.segments)return;t.segments.forEach(b=>{C(b.src);});let k=x.current;return ()=>{k.forEach(b=>{URL.revokeObjectURL(b);}),k.clear();}},[t,C]),z(()=>{let k=e.current;if(!k)return;let b=()=>{let D=(g.current[s]||0)+k.currentTime;o(D);},_=()=>{w.current=false,a(true);},M=()=>a(false),F=()=>{m(true);},q=()=>{t&&s<t.segments.length-1?(v.current=true,u(E=>E+1)):(p(true),a(false));};return k.addEventListener("timeupdate",b),k.addEventListener("play",_),k.addEventListener("pause",M),k.addEventListener("ended",q),k.addEventListener("error",F),()=>{k.removeEventListener("timeupdate",b),k.removeEventListener("play",_),k.removeEventListener("pause",M),k.removeEventListener("ended",q),k.removeEventListener("error",F);}},[e,s,t]),z(()=>{let k=e.current;if(!k||!t?.segments)return;let b=t.segments[s];if(!b)return;let _=()=>{if(y.current!==null){let E=g.current[s]||0,D=y.current-E;k.currentTime=Math.max(0,D),o(y.current),y.current=null;}v.current&&(k.play().catch(()=>{}),v.current=false);},M=k.src,F=x.current.get(b.src);M&&(M===F||M.endsWith(b.src))?_():(async()=>{let D=await C(b.src),oe=()=>{m(true),_(),k.removeEventListener("canplay",oe);};k.addEventListener("canplay",oe),k.src=D,k.load(),await Promise.resolve(),k.readyState>=3&&(k.removeEventListener("canplay",oe),m(true),_());})();},[e,s,t,C]);let P=Z(()=>{let k=e.current;k&&(c&&(u(0),p(false)),k.play().then(()=>{w.current=false;}).catch(()=>{w.current=true,a(true);}));},[e,c]),R=Z(()=>{let k=e.current;k&&k.pause(),a(false);},[e]),N=Z(()=>{e.current&&(i?R():P());},[e,i,P,R]),Y=Z(k=>{let b=e.current;if(!b||!t?.segments)return;let _=f>0?Math.max(0,Math.min(k,f)):Math.max(0,k),M=0,F=0;for(let E=0;E<t.segments.length;E++){let D=F+t.segments[E].duration;if(_<D){M=E;break}F=D,E===t.segments.length-1&&(M=E);}let q=!b.paused;if(p(false),M!==s)y.current=_,v.current=q,u(M);else {let E=_-F;b.currentTime=Math.max(0,E),o(_);}},[e,t,s,f]),W=Z(k=>{!t?.segments||k<0||k>=t.segments.length||(u(k),p(false));},[t]),ae=Z(async()=>{Y(0),await new Promise(k=>setTimeout(k,50)),P();},[Y,P]);return z(()=>{if(!i||!w.current||!f)return;let k=performance.now(),b,_=M=>{if(!w.current)return;let F=(M-k)/1e3;k=M,o(q=>{let E=q+F;return E>=f?(w.current=false,p(true),a(false),f):E}),b=requestAnimationFrame(_);};return b=requestAnimationFrame(_),()=>cancelAnimationFrame(b)},[i,f]),{currentTime:r,isPlaying:i,currentSegment:s,totalDuration:f,isEnded:c,isReady:d,isAvailable:true,play:async()=>P(),pause:async()=>R(),toggle:async()=>N(),seekTo:async k=>Y(k),skipToSegment:async k=>W(k),restart:ae}}function Or(e,t,n=J.landscape,r=false,o){let [i,a]=U({entering:false,exiting:false,previousBlock:null}),s=$(()=>{if(!e?.blocks)return [];let P=e.blocks.some(N=>N.children&&N.children.length>0)?mt(e.blocks):e.blocks;if(P.some(ne)){let N=e.audio?.segments?.map(W=>({startTime:W.startTime,duration:W.duration}));return Yt(P,{audioSegments:N,viewport:n,persistentLayers:e.persistentLayers,theme:o})}return P},[e?.blocks,e?.audio?.segments,e?.persistentLayers,n,o]),u=$(()=>Dt(s,t),[s,t]),c=$(()=>u?s.indexOf(u):-1,[s,u]),p=$(()=>u?Math.max(0,t-u.startTime):0,[u,t]),d=$(()=>!u||u.duration===0?0:Math.min(1,p/u.duration),[u,p]),m=$(()=>!e||e.duration===0?0:Math.min(1,t/e.duration),[e,t]);$(()=>u,[c]);z(()=>{if(!(!u||r)&&i.previousBlock?.id!==u.id){let P=u.transition?.duration||0;if(P>0){a({entering:true,exiting:true,previousBlock:i.previousBlock});let R=setTimeout(()=>{a({entering:false,exiting:false,previousBlock:u});},P*1e3);return ()=>clearTimeout(R)}else a({entering:false,exiting:false,previousBlock:u});}},[u?.id,r]);let h=V(null);z(()=>{if(!(!r||!u)&&i.previousBlock?.id!==u.id){let C=i.previousBlock;h.current=C,a(P=>({...P,previousBlock:u}));}},[u?.id,r]);let g=u?.transition?.duration||0,y=r&&g>0&&p<g,v=y&&h.current!==null,x=Z(C=>{if(!e||C<0||C>=s.length)return;let P=s[C];if(P)return P.startTime},[e,s]),S=Z(()=>{if(c<s.length-1)return x(c+1)},[c,s.length,x]),w=Z(()=>{if(c>0)return x(c-1)},[c,x]);return {currentBlock:u,currentBlockIndex:c,previousBlock:r?v?h.current:null:i.exiting?i.previousBlock:null,isEntering:r?y:i.entering,isExiting:r?v:i.exiting,blockTime:p,blockProgress:d,docProgress:m,nextBlock:S,prevBlock:w,goToBlock:x,blocks:s}}function Fi(e,t){let n=e/t;return n>1.2?"landscape":n<.83?"portrait":"landscape"}function Ri(e){switch(e){case "portrait":return J.portrait;case "square":return J.square;default:return J.landscape}}function Wr(){let[e,t]=U(()=>({width:typeof window<"u"?window.innerWidth:1920,height:typeof window<"u"?window.innerHeight:1080}));z(()=>{if(typeof window>"u")return;let o=()=>{t({width:window.innerWidth,height:window.innerHeight});},i,a=()=>{clearTimeout(i),i=setTimeout(o,100);};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),clearTimeout(i);}},[]);let n=$(()=>Fi(e.width,e.height),[e.width,e.height]);return {viewport:$(()=>Ri(n),[n]),orientation:n,windowSize:e}}function Ze(e){let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}function ht({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){let i=V(null),[a,s]=U(null),u=Z(d=>{let m=i.current;if(!m)return;let f=m.getBoundingClientRect(),h=d.clientX-f.left,g=Math.max(0,Math.min(1,h/f.width));s(g);},[]),c=Z(()=>{s(null);},[]),p=Z(d=>{for(let m=r.length-1;m>=0;m--){let f=r[m];if(d>=f.startTime)return {block:f,index:m}}return r.length>0?{block:r[0],index:0}:null},[r]);return l("div",{ref:i,style:{flex:1,height:"24px",cursor:"pointer",position:"relative",display:"flex",alignItems:"center"},onClick:d=>{let m=d.currentTarget.getBoundingClientRect(),h=(d.clientX-m.left)/m.width;t.seekTo(h*e.totalDuration);},onMouseMove:u,onMouseLeave:c,children:[l("div",{style:{position:"absolute",left:0,right:0,height:"6px",background:"rgba(255,255,255,0.2)",borderRadius:"3px"}}),l("div",{style:{position:"absolute",left:0,width:`${e.docProgress*100}%`,height:"6px",background:"#5b9bd5",borderRadius:"3px",transition:"width 0.1s"}}),n.map((d,m)=>l("div",{style:{position:"absolute",left:`${d.position}%`,transform:"translateX(-50%)",width:"10px",height:"10px",borderRadius:"50%",background:d.index===e.currentBlockIndex?"#ffffff":"rgba(255,255,255,0.5)",border:"2px solid #5b9bd5",cursor:"pointer",zIndex:2,transition:"transform 0.15s, background 0.15s"},title:d.title,onClick:f=>{f.stopPropagation(),t.seekTo(d.block.startTime);},onMouseEnter:f=>{f.currentTarget.style.transform="translateX(-50%) scale(1.3)";},onMouseLeave:f=>{f.currentTarget.style.transform="translateX(-50%)";}},`${d.block.id}-${m}`)),a!==null&&l("div",{style:{position:"absolute",left:`${a*100}%`,bottom:"100%",transform:"translateX(-50%)",marginBottom:"8px",padding:"6px 10px",background:"rgba(0,0,0,0.9)",borderRadius:"4px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[l("div",{style:{color:"white",fontSize:"12px",fontFamily:"monospace"},children:Ze(a*e.totalDuration)}),(()=>{let d=a*e.totalDuration,m=p(d);return m&&o?l("div",{style:{color:"rgba(255,255,255,0.7)",fontSize:"11px",marginTop:"2px"},children:o(m.block)}):null})()]}),a!==null&&l("div",{style:{position:"absolute",left:`${a*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"2px",height:"16px",background:"rgba(255,255,255,0.6)",pointerEvents:"none",zIndex:1}})]})}function Hr({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){return l("div",{className:"doc-player__controls",style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 16px",background:"linear-gradient(transparent, rgba(0,0,0,0.8))",display:"flex",alignItems:"center",gap:"8px",zIndex:100},children:[l("button",{onClick:t.restart,style:{background:"none",border:"none",color:"rgba(255,255,255,0.7)",cursor:"pointer",padding:"8px",fontSize:"14px",display:"flex",alignItems:"center"},title:"Restart","aria-label":"Restart from beginning",children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"})})}),l("button",{onClick:t.toggle,style:{background:"rgba(255,255,255,0.2)",border:"none",borderRadius:"50%",color:"white",cursor:"pointer",padding:"10px",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px"},"aria-label":e.isPlaying?"Pause":"Play",children:e.isPlaying?l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:l("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}):l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:l("path",{d:"M8 5v14l11-7z"})})}),l("span",{style:{color:"white",fontSize:"12px",minWidth:"80px",fontFamily:"monospace"},children:[Ze(e.currentTime)," / ",Ze(e.totalDuration)]}),l(ht,{state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}),l("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"11px",whiteSpace:"nowrap"},children:[e.currentBlockIndex+1,"/",e.totalBlocks]}),e.hasCaptions&&l("button",{onClick:()=>t.cycleCaptionMode(),style:{background:e.captionMode!=="off"?"rgba(255,255,255,0.2)":"none",border:"none",color:e.captionMode!=="off"?"white":"rgba(255,255,255,0.5)",cursor:"pointer",padding:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px",borderRadius:"4px"},title:e.captionMode==="off"?"Captions: Off (click for Standard)":e.captionMode==="standard"?"Captions: Standard (click for Social)":"Captions: Social (click to turn off)","aria-label":"Cycle caption style",children:[l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z"})}),e.captionMode!=="off"&&l("span",{style:{fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.5px"},children:e.captionMode==="standard"?"CC":"SM"})]}),t.toggleFullscreen&&l("button",{onClick:t.toggleFullscreen,style:{background:e.isFullscreen?"rgba(255,255,255,0.2)":"none",border:"none",color:e.isFullscreen?"white":"rgba(255,255,255,0.5)",cursor:"pointer",padding:"8px",display:"flex",alignItems:"center",borderRadius:"4px"},title:e.isFullscreen?"Exit fullscreen (F)":"Fullscreen (F)","aria-label":e.isFullscreen?"Exit fullscreen":"Enter fullscreen",children:e.isFullscreen?l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})}):l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})}function Ur({state:e,slideNav:t}){let{currentBlockIndex:n,totalBlocks:r}=e,o=n<=0,i=n>=r-1;return l("div",{className:"doc-controls-slideshow","data-testid":"slideshow-controls",style:{position:"absolute",bottom:"16px",right:"16px",display:"flex",alignItems:"center",gap:"2px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"8px",padding:"4px 6px",zIndex:100,userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[l("button",{onClick:a=>{a.stopPropagation(),t.prevSlide();},disabled:o,"data-testid":"slide-prev","aria-label":"Previous slide",title:"Previous slide",style:{background:"none",border:"none",color:o?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.9)",cursor:o?"default":"pointer",padding:"6px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:a=>{o||(a.currentTarget.style.background="rgba(255,255,255,0.1)");},onMouseLeave:a=>{a.currentTarget.style.background="none";},children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),l("span",{"data-testid":"slide-counter",style:{color:"rgba(255,255,255,0.9)",fontSize:"13px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontVariantNumeric:"tabular-nums",minWidth:"48px",textAlign:"center",padding:"0 4px",letterSpacing:"0.02em"},children:r>0?`${n+1} / ${r}`:"\u2014"}),l("button",{onClick:a=>{a.stopPropagation(),t.nextSlide();},disabled:i,"data-testid":"slide-next","aria-label":"Next slide",title:"Next slide",style:{background:"none",border:"none",color:i?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.9)",cursor:i?"default":"pointer",padding:"6px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:a=>{i||(a.currentTarget.style.background="rgba(255,255,255,0.1)");},onMouseLeave:a=>{a.currentTarget.style.background="none";},children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})})})]})}function ie(e,t=""){return e.map((n,r)=>{let o=`${t}i${r}`;switch(n.type){case "text":return l(te,{children:n.value},o);case "emphasis":return l("em",{className:"squisq-md-em",children:ie(n.children,o)},o);case "strong":return l("strong",{className:"squisq-md-strong",children:ie(n.children,o)},o);case "delete":return l("del",{className:"squisq-md-del",children:ie(n.children,o)},o);case "inlineCode":return l("code",{className:"squisq-md-inline-code",children:n.value},o);case "link":return l("a",{className:"squisq-md-link",href:n.url,title:n.title??void 0,target:"_blank",rel:"noopener noreferrer",children:ie(n.children,o)},o);case "image":return l("img",{className:"squisq-md-image",src:n.url,alt:n.alt??"",title:n.title??void 0},o);case "break":return l("br",{},o);case "inlineMath":return l("code",{className:"squisq-md-inline-math",children:n.value},o);case "htmlInline":return l("span",{className:"squisq-md-html-inline",dangerouslySetInnerHTML:{__html:n.rawHtml}},o);case "footnoteReference":return l("sup",{className:"squisq-md-footnote-ref",children:l("a",{href:`#fn-${n.identifier}`,children:["[",n.label??n.identifier,"]"]})},o);case "linkReference":return l("span",{className:"squisq-md-link-ref",children:ie(n.children,o)},o);case "imageReference":return l("span",{className:"squisq-md-image-ref",children:["[",n.alt??n.identifier,"]"]},o);case "textDirective":return l("span",{className:"squisq-md-text-directive","data-directive":n.name,children:ie(n.children,o)},o);default:return null}})}function Ni(e,t){switch(e.type){case "paragraph":return l("p",{className:"squisq-md-p",children:ie(e.children,t)},t);case "heading":{let n=`h${e.depth}`;return l(n,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:ie(e.children,t)},t)}case "blockquote":return l("blockquote",{className:"squisq-md-blockquote",children:Re(e.children,t)},t);case "list":return e.ordered?l("ol",{className:"squisq-md-list squisq-md-ol",start:e.start??void 0,children:e.children.map((n,r)=>Vr(n,`${t}li${r}`))},t):l("ul",{className:"squisq-md-list squisq-md-ul",children:e.children.map((n,r)=>Vr(n,`${t}li${r}`))},t);case "code":return l("pre",{className:"squisq-md-code-block",children:l("code",{className:e.lang?`language-${e.lang}`:void 0,children:e.value})},t);case "thematicBreak":return l("hr",{className:"squisq-md-hr"},t);case "table":return Di(e.children,e.align,t);case "htmlBlock":return l("div",{className:"squisq-md-html-block",dangerouslySetInnerHTML:{__html:e.rawHtml}},t);case "math":return l("pre",{className:"squisq-md-math-block",children:l("code",{children:e.value})},t);case "definition":return null;case "footnoteDefinition":return l("div",{className:"squisq-md-footnote-def",id:`fn-${e.identifier}`,children:[l("sup",{children:e.label??e.identifier}),Re(e.children,t)]},t);case "containerDirective":return l("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:[e.label&&l("div",{className:"squisq-md-directive-label",children:e.label}),Re(e.children,t)]},t);case "leafDirective":return l("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:ie(e.children,t)},t);case "definitionList":return l("dl",{className:"squisq-md-dl",children:e.children.map((n,r)=>n.type==="definitionTerm"?l("dt",{className:"squisq-md-dt",children:ie(n.children,`${t}dt${r}`)},`${t}dt${r}`):l("dd",{className:"squisq-md-dd",children:Re(n.children,`${t}dd${r}`)},`${t}dd${r}`))},t);default:return null}}function Vr(e,t){let n=e.checked!==null&&e.checked!==void 0;return l("li",{className:`squisq-md-li${n?" squisq-md-task":""}`,children:[n&&l("input",{type:"checkbox",checked:!!e.checked,readOnly:true,className:"squisq-md-checkbox"}),Re(e.children,t)]},t)}function Di(e,t,n){let[r,...o]=e;return l("table",{className:"squisq-md-table",children:[r&&l("thead",{children:l("tr",{children:r.children.map((i,a)=>l("th",{className:"squisq-md-th",style:t?.[a]?{textAlign:t[a]}:void 0,children:ie(i.children,`${n}th${a}`)},`${n}th${a}`))})}),o.length>0&&l("tbody",{children:o.map((i,a)=>l("tr",{children:i.children.map((s,u)=>l("td",{className:"squisq-md-td",style:t?.[u]?{textAlign:t[u]}:void 0,children:ie(s.children,`${n}td${a}-${u}`)},`${n}td${a}-${u}`))},`${n}tr${a}`))})]},n)}function Re(e,t=""){return e.map((n,r)=>Ni(n,`${t}b${r}`))}function gt({nodes:e,className:t}){return !e||e.length===0?null:l("div",{className:`squisq-md ${t||""}`,children:Re(e)})}function $i(e){let t=e.sourceHeading?.templateAnnotation;return t?!!t.template&&jt(t.template):false}function Yr(e){let t=0;for(let n of e)t++,n.children&&(t+=Yr(n.children));return t}function jr({block:e,basePath:t,viewport:n,renderContext:r,blockIndex:o}){let i=$i(e),a=$(()=>{if(!i)return null;let s=e.sourceHeading.templateAnnotation,u=ye(e.sourceHeading),c=zi(e.contents),p={id:e.id,template:s.template,startTime:0,duration:1,audioSegment:0,title:u,...Hi(s.template??"sectionHeader",u,c,e.contents),...s.params,...e.templateOverrides},d={...r,blockIndex:o},m=Xt(p,d);return {...e,layers:m,template:s.template}},[e,i,r,o]);return l("div",{className:"squisq-linear-section","data-block-id":e.id,"data-template":i?e.sourceHeading?.templateAnnotation?.template:void 0,children:[e.sourceHeading&&!i&&l(gt,{nodes:[e.sourceHeading]}),i&&a&&l("div",{className:"squisq-linear-card",children:[e.sourceHeading&&l("div",{className:"squisq-linear-card-label squisq-md",children:l(gt,{nodes:[e.sourceHeading]})}),l("div",{className:"squisq-linear-card-svg",style:{width:"100%",aspectRatio:`${n.width} / ${n.height}`,overflow:"hidden",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.12)",marginBottom:"1em"},children:l(Fe,{block:a,blockTime:0,basePath:t,viewport:n})})]}),!i&&e.contents&&e.contents.length>0&&l(gt,{nodes:e.contents}),e.children&&e.children.length>0&&l("div",{className:"squisq-linear-children",children:e.children.map((s,u)=>l(jr,{block:s,basePath:t,viewport:n,renderContext:r,blockIndex:o+u+1},s.id))})]})}function zi(e){return !e||e.length===0?"":e.map(t=>ye(t)).join(`
3
- `).trim()}function Oi(e){if(!e)return [];let t=[];for(let n of e)if(n.type==="list")for(let r of n.children){let o=ye(r).trim();o&&t.push(o);}return t}function Wi(e){if(!e)return null;for(let t of e)if(t.type==="table"){let n=t,[r,...o]=n.children;if(!r)return null;let i=r.children.map(s=>ye(s).trim()),a=o.map(s=>s.children.map(u=>ye(u).trim()));return {headers:i,rows:a,align:n.align}}return null}function Hi(e,t,n,r){switch(e){case "statHighlight":return {stat:t,description:n||t};case "quoteBlock":case "fullBleedQuote":case "pullQuote":return {quote:n||t};case "factCard":return {fact:t,explanation:n||t};case "comparisonBar":return {leftLabel:"A",leftValue:60,rightLabel:"B",rightValue:40};case "listBlock":return {items:Oi(r)||["Item 1","Item 2","Item 3"]};case "definitionCard":return {term:t,definition:n||t};case "dateEvent":return {date:t,description:n||t};case "dataTable":return Wi(r)??{headers:["Column"],rows:[["Data"]]};default:return {}}}function yt({doc:e,basePath:t="/",viewport:n,className:r,theme:o}){let i=n??J.landscape,a=$(()=>Yr(e.blocks),[e.blocks]),s=$(()=>({theme:o??he,viewport:i,totalBlocks:a}),[i,a,o]),u=s.theme,c=u.colors.background,p=u.colors.text,d=u.colors.textMuted,m=u.colors.primary,f=u.typography.bodyFontFamily,h=u.typography.titleFontFamily,g=u.typography.lineHeight??1.7;return l("div",{className:`squisq-linear ${r||""}`,style:{width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:c},children:l("div",{className:"squisq-linear-content squisq-md",style:{maxWidth:"720px",margin:"0 auto",padding:"24px 16px",lineHeight:g,fontSize:"16px",fontFamily:f,color:p,"--squisq-linear-title-font":h,"--squisq-linear-body-font":f,"--squisq-linear-text":p,"--squisq-linear-muted":d,"--squisq-linear-primary":m,"--squisq-linear-bg":c},children:[l("style",{children:`
1
+ var SquisqPlayer=(function(exports){'use strict';var st,P,vn,ve,bn,kn,wn,Sn,It,Tt,Ct,Tn,ot={},it=[],uo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ze=Array.isArray;function pe(e,t){for(var n in t)e[n]=t[n];return e}function Lt(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function me(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?st.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return rt(e,a,r,o,null)}function rt(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++vn,__i:-1,__u:0};return o==null&&P.vnode!=null&&P.vnode(i),i}function te(e){return e.children}function ce(e,t){this.props=e,this.context=t;}function Pe(e,t){if(t==null)return e.__?Pe(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Pe(e):null}function fo(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=pe({},t);i.__v=t.__v+1,P.vnode&&P.vnode(i),Bt(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Pe(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,In(r,i,o),t.__e=t.__=null,i.__e!=n&&Cn(i);}}function Cn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Cn(e)}function Mt(e){(!e.__d&&(e.__d=true)&&ve.push(e)&&!at.__r++||bn!=P.debounceRendering)&&((bn=P.debounceRendering)||kn)(at);}function at(){try{for(var e,t=1;ve.length;)ve.length>t&&ve.sort(wn),e=ve.shift(),t=ve.length,fo(e);}finally{ve.length=at.__r=0;}}function Mn(e,t,n,r,o,i,a,s,u,l,p){var d,m,f,h,g,y,v,x=r&&r.__k||it,S=t.length;for(u=po(n,t,x,u,S),d=0;d<S;d++)(f=n.__k[d])!=null&&(m=f.__i!=-1&&x[f.__i]||ot,f.__i=d,y=Bt(e,f,m,o,i,a,s,u,l,p),h=f.__e,f.ref&&m.ref!=f.ref&&(m.ref&&Pt(m.ref,null,f),p.push(f.ref,f.__c||h,f)),g==null&&h!=null&&(g=h),(v=!!(4&f.__u))||m.__k===f.__k?u=An(f,u,e,v):typeof f.type=="function"&&y!==void 0?u=y:h&&(u=h.nextSibling),f.__u&=-7);return n.__e=g,u}function po(e,t,n,r,o){var i,a,s,u,l,p=n.length,d=p,m=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[i]=rt(null,a,null,null,null):ze(a)?a=e.__k[i]=rt(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=rt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,u=i+m,a.__=e,a.__b=e.__b+1,s=null,(l=a.__i=mo(a,n,u,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(o>p?m--:o<p&&m++),typeof a.type!="function"&&(a.__u|=4)):l!=u&&(l==u-1?m--:l==u+1?m++:(l>u?m--:m++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<p;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Pe(s)),Bn(s,s));return r}function An(e,t,n,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=An(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Pe(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Oe(e,t){return t=t||[],e==null||typeof e=="boolean"||(ze(e)?e.some(function(n){Oe(n,t);}):t.push(e)),t}function mo(e,t,n,r){var o,i,a,s=e.key,u=e.type,l=t[n],p=l!=null&&(2&l.__u)==0;if(l===null&&s==null||p&&s==l.key&&u==l.type)return n;if(r>(p?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((l=t[a=o>=0?o--:i++])!=null&&(2&l.__u)==0&&s==l.key&&u==l.type)return a}return -1}function _n(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||uo.test(t)?n:n+"px";}function nt(e,t,n,r,o){var i,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else {if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||_n(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||_n(e.style,t,n[t]);}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Sn,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=It,e.addEventListener(t,i?Ct:Tt,i)):e.removeEventListener(t,i?Ct:Tt,i);else {if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===false&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n));}}function xn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=It++;else if(t.t<n.u)return;return n(P.event?P.event(t):t)}}}function Bt(e,t,n,r,o,i,a,s,u,l){var p,d,m,f,h,g,y,v,x,S,w,C,B,R,$,Y=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(p=P.__b)&&p(t);e:if(typeof Y=="function")try{if(v=t.props,x=Y.prototype&&Y.prototype.render,S=(p=Y.contextType)&&r[p.__c],w=p?S?S.props.value:p.__:r,n.__c?y=(d=t.__c=n.__c).__=d.__E:(x?t.__c=d=new Y(v,w):(t.__c=d=new ce(v,w),d.constructor=Y,d.render=go),S&&S.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&Y.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=pe({},d.__s)),pe(d.__s,Y.getDerivedStateFromProps(v,d.__s))),f=d.props,h=d.state,d.__v=t,m)x&&Y.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else {if(x&&Y.getDerivedStateFromProps==null&&v!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,w),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,w)===!1){t.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(W){W&&(W.__=t);}),it.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,w),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,h,g);});}if(d.context=w,d.props=v,d.__P=e,d.__e=!1,C=P.__r,B=0,x)d.state=d.__s,d.__d=!1,C&&C(t),p=d.render(d.props,d.state,d.context),it.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,C&&C(t),p=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++B<25);d.state=d.__s,d.getChildContext!=null&&(r=pe(pe({},r),d.getChildContext())),x&&!m&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(f,h)),R=p!=null&&p.type===te&&p.key==null?Ln(p.props.children):p,s=Mn(e,ze(R)?R:[R],t,n,r,o,i,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),y&&(d.__E=d.__=null);}catch(W){if(t.__v=null,u||i!=null)if(W.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s;}else {for($=i.length;$--;)Lt(i[$]);At(t);}else t.__e=n.__e,t.__k=n.__k,W.then||At(t);P.__e(W,t,n);}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ho(n.__e,t,n,r,o,i,a,u,l);return (p=P.diffed)&&p(t),128&t.__u?void 0:s}function At(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(At));}function In(e,t,n){for(var r=0;r<n.length;r++)Pt(n[r],n[++r],n[++r]);P.__c&&P.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o);});}catch(i){P.__e(i,o.__v);}});}function Ln(e){return typeof e!="object"||e==null||e.__b>0?e:ze(e)?e.map(Ln):pe({},e)}function ho(e,t,n,r,o,i,a,s,u){var l,p,d,m,f,h,g,y=n.props||ot,v=t.props,x=t.type;if(x=="svg"?o="http://www.w3.org/2000/svg":x=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(l=0;l<i.length;l++)if((f=i[l])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,i[l]=null;break}}if(e==null){if(x==null)return document.createTextNode(v);e=document.createElementNS(o,x,v.is&&v),s&&(P.__m&&P.__m(t,i),s=false),i=null;}if(x==null)y===v||s&&e.data==v||(e.data=v);else {if(i=i&&st.call(e.childNodes),!s&&i!=null)for(y={},l=0;l<e.attributes.length;l++)y[(f=e.attributes[l]).name]=f.value;for(l in y)f=y[l],l=="dangerouslySetInnerHTML"?d=f:l=="children"||l in v||l=="value"&&"defaultValue"in v||l=="checked"&&"defaultChecked"in v||nt(e,l,null,f,o);for(l in v)f=v[l],l=="children"?m=f:l=="dangerouslySetInnerHTML"?p=f:l=="value"?h=f:l=="checked"?g=f:s&&typeof f!="function"||y[l]===f||nt(e,l,f,y[l],o);if(p)s||d&&(p.__html==d.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),Mn(t.type=="template"?e.content:e,ze(m)?m:[m],t,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Pe(n,0),s,u),i!=null)for(l=i.length;l--;)Lt(i[l]);s||(l="value",x=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[l]||x=="progress"&&!h||x=="option"&&h!=y[l])&&nt(e,l,h,y[l],o),l="checked",g!=null&&g!=e[l]&&nt(e,l,g,y[l],o));}return e}function Pt(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t));}else e.current=t;}catch(o){P.__e(o,n);}}function Bn(e,t,n){var r,o;if(P.unmount&&P.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Pt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount();}catch(i){P.__e(i,t);}r.base=r.__P=null;}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Bn(r[o],t,n||typeof e.type!="function");n||Lt(e.__e),e.__c=e.__=e.__e=void 0;}function go(e,t,n){return this.constructor(e,n)}function Et(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),P.__&&P.__(e,t),o=(r="undefined"=="function")?null:t.__k,i=[],a=[],Bt(t,e=(t).__k=me(te,null,[e]),o||ot,ot,t.namespaceURI,o?null:t.firstChild?st.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,a),In(i,e,a);}function lt(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null;},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&r.forEach(function(a){a.__e=true,Mt(a);});},this.sub=function(i){r.add(i);var a=i.componentWillUnmount;i.componentWillUnmount=function(){r&&r.delete(i),a&&a.call(i);};}),n.children}return t.__c="__cC"+Tn++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}st=it.slice,P={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s;}throw e}},vn=0,ce.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=pe({},this.state),typeof e=="function"&&(e=e(pe({},n),this.props)),e&&pe(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Mt(this));},ce.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),Mt(this));},ce.prototype.render=te,ve=[],kn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wn=function(e,t){return e.__v.__b-t.__v.__b},at.__r=0,Sn=/(PointerCapture)$|Capture$/i,It=0,Tt=xn(false),Ct=xn(true),Tn=0;var Ee,X,Ft,Pn,We=0,zn=[],G=P,En=G.__b,Fn=G.__r,Rn=G.diffed,qn=G.__c,$n=G.unmount,Nn=G.__;function ut(e,t){G.__h&&G.__h(X,e,We||t),We=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function U(e){return We=1,On(Hn,e)}function On(e,t,n){var r=ut(Ee++,2);if(r.t=e,!r.__c&&(r.__=[Hn(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],l=r.t(u,s);u!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}));}],r.__c=X,!X.__f)){var o=function(s,u,l){if(!r.__c.__H)return true;var p=r.__c.__H.__.filter(function(m){return m.__c});if(p.every(function(m){return !m.__N}))return !i||i.call(this,s,u,l);var d=r.__c.props!==s;return p.some(function(m){if(m.__N){var f=m.__[0];m.__=m.__N,m.__N=void 0,f!==m.__[0]&&(d=true);}}),i&&i.call(this,s,u,l)||d};X.__f=true;var i=X.shouldComponentUpdate,a=X.componentWillUpdate;X.componentWillUpdate=function(s,u,l){if(this.__e){var p=i;i=void 0,o(s,u,l),i=p;}a&&a.call(this,s,u,l);},X.shouldComponentUpdate=o;}return r.__N||r.__}function D(e,t){var n=ut(Ee++,3);!G.__s&&Wn(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n));}function V(e){return We=5,z(function(){return {current:e}},[])}function z(e,t){var n=ut(Ee++,7);return Wn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Z(e,t){return We=8,z(function(){return e},t)}function qt(e){var t=X.context[e.__c],n=ut(Ee++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(X)),t.props.value):e.__}function yo(){for(var e;e=zn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ct),t.__h.some(Rt),t.__h=[];}catch(n){t.__h=[],G.__e(n,e.__v);}}}G.__b=function(e){X=null,En&&En(e);},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Nn&&Nn(e,t);},G.__r=function(e){Fn&&Fn(e),Ee=0;var t=(X=e.__c).__H;t&&(Ft===X?(t.__h=[],X.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(t.__h.some(ct),t.__h.some(Rt),t.__h=[],Ee=0)),Ft=X;},G.diffed=function(e){Rn&&Rn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zn.push(t)!==1&&Pn===G.requestAnimationFrame||((Pn=G.requestAnimationFrame)||bo)(yo)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),Ft=X=null;},G.__c=function(e,t){t.some(function(n){try{n.__h.some(ct),n.__h=n.__h.filter(function(r){return !r.__||Rt(r)});}catch(r){t.some(function(o){o.__h&&(o.__h=[]);}),t=[],G.__e(r,n.__v);}}),qn&&qn(e,t);},G.unmount=function(e){$n&&$n(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{ct(r);}catch(o){t=o;}}),n.__H=void 0,t&&G.__e(t,n.__v));};var Dn=typeof requestAnimationFrame=="function";function bo(e){var t,n=function(){clearTimeout(r),Dn&&cancelAnimationFrame(t),setTimeout(e);},r=setTimeout(n,35);Dn&&(t=requestAnimationFrame(n));}function ct(e){var t=X,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),X=t;}function Rt(e){var t=X;e.__c=e.__(),X=t;}function Wn(e,t){return !e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Hn(e,t){return typeof t=="function"?t(e):t}function xo(e,t){for(var n in t)e[n]=t[n];return e}function Un(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return true;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return true;return false}function Vn(e,t){this.props=e,this.context=t;}(Vn.prototype=new ce).isPureReactComponent=true,Vn.prototype.shouldComponentUpdate=function(e,t){return Un(this.props,e)||Un(this.state,t)};var Yn=P.__b;P.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Yn&&Yn(e);};var vo=P.__e;P.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}vo(e,t,n,r);};var jn=P.unmount;function Jn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c();}),e.__c.__H=null),(e=xo({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Jn(r,t,n)})),e}function er(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return er(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function $t(){this.__u=0,this.o=null,this.__b=null;}function tr(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function dt(){this.i=null,this.l=null;}P.unmount=function(e){var t=e.__c;t&&(t.__z=true),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),jn&&jn(e);},($t.prototype=new ce).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=tr(r.__v),i=false,a=function(){i||r.__z||(i=true,n.__R=null,o?o(u):u());};n.__R=a;var s=n.__P;n.__P=null;var u=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=er(l,l.__c.__P,l.__c.__O);}var p;for(r.setState({__a:r.__b=null});p=r.o.pop();)p.__P=s,p.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a);},$t.prototype.componentWillUnmount=function(){this.o=[];},$t.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Jn(this.__b,n,r.__O=r.__P);}this.__b=null;}var o=t.__a&&me(te,null,e.fallback);return o&&(o.__u&=-33),[me(te,null,t.__a?null:e.children),o]};var Xn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2];}};(dt.prototype=new ce).__a=function(e){var t=this,n=tr(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Xn(t,e,r)):o();};n?n(i):i();}},dt.prototype.render=function(e){this.i=null,this.l=new Map;var t=Oe(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},dt.prototype.componentDidUpdate=dt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Xn(e,n,t);});};var ko=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,wo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,So=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,To=/[A-Z0-9]/g,Co=typeof document<"u",Mo=function(e){return (typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function nr(e,t,n){return t.__k==null&&(t.textContent=""),Et(e,t),e?e.__c:null}ce.prototype.isReactComponent=true,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ce.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t});}});});var Zn=P.event;P.event=function(e){return Zn&&(e=Zn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Ao={configurable:true,get:function(){return this.class}},Gn=P.vnode;P.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")==-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||Co&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===true?s="":u==="translate"&&s==="no"?s=false:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||r!=="input"&&r!=="textarea"||Mo(n.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":So.test(a)&&(a=u):u=a="oninput":i&&wo.test(a)?a=a.replace(To,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&o[a=u]&&(a="oninputCapture"),o[a]=s;}}r=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=Oe(n.children).forEach(function(l){l.props.selected=o.value.indexOf(l.props.value)!=-1;})),o.defaultValue!=null&&(o.value=Oe(n.children).forEach(function(l){l.props.selected=o.multiple?o.defaultValue.indexOf(l.props.value)!=-1:o.defaultValue==l.props.value;}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Ao)):n.className&&(o.class=o.className=n.className),t.props=o;})(e),e.$$typeof=ko,Gn&&Gn(e);};var Kn=P.__r;P.__r=function(e){Kn&&Kn(e),e.__c;};var Qn=P.diffed;P.diffed=function(e){Qn&&Qn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value);};function or(e){return !!e.__k&&(Et(null,e),true)}function ir(e){return {render:function(t){nr(t,e);},unmount:function(){or(e);}}}function Nt(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(t>=r.startTime&&t<r.startTime+r.duration)return r}return e[0]||null}function He(e,t){if(!e||!e.phrases.length)return null;for(let n of e.phrases)if(t>=n.startTime&&t<n.endTime)return n;return null}var Io='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Lo='Georgia, "Times New Roman", serif',Bo='Consolas, "Courier New", monospace';var Po={blue:{bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"},green:{bg:"#22543d",text:"#9ae6b4",accent:"#68d391"},purple:{bg:"#44337a",text:"#d6bcfa",accent:"#b794f4"},red:{bg:"#742a2a",text:"#fc8181",accent:"#feb2b2"},orange:{bg:"#744210",text:"#fbd38d",accent:"#f6ad55"},teal:{bg:"#234e52",text:"#81e6d9",accent:"#4fd1c5"}},Eo={id:"standard",name:"Standard",description:"Clean and safe. System fonts only \u2014 no external font dependencies.",colors:{primary:"#3182ce",secondary:"#4a5568",background:"#1a202c",backgroundLight:"#2d3748",text:"#f7fafc",textMuted:"#a0aec0",highlight:"#4299e1",warning:"#fc8181"},typography:{bodyFontFamily:Io,titleFontFamily:Lo,monoFontFamily:Bo,titleWeight:"bold"},style:{textShadow:true,overlayOpacity:.45,animationSpeed:1},renderStyle:{name:"standard",defaultTextAnimation:"fadeIn",defaultImageAnimation:"slowZoom",ambientMotion:true,defaultTransition:{type:"fade",duration:.7}},colorSchemes:Po,persistentLayers:{bottomLayers:[{template:"gradientBackground",config:{type:"gradientBackground",preset:"dark-vignette"}}]}};var he=Eo;var J={landscape:{width:1920,height:1080,name:"16:9 Landscape"},portrait:{width:1080,height:1920,name:"9:16 Portrait"},square:{width:1080,height:1080,name:"1:1 Square"}};var Fo=Math.sqrt(1920*1920+1080*1080);function Dt(e){return Math.sqrt(e.width*e.width+e.height*e.height)/Fo}function zt(e){let t=e.width/e.height;return Math.abs(t-1)<.05?"square":t>1?"landscape":"portrait"}var Ro={landscape:{primaryY:"35%",secondaryY:"55%",tertiaryY:"75%",titleScale:1,bodyScale:1,columnLeftX:"25%",columnRightX:"75%",columnTopY:"35%",columnBottomY:"65%",stackColumns:false,maxTextWidth:"80%",horizontalPadding:"10%",captionY:"85%",captionScale:1},portrait:{primaryY:"25%",secondaryY:"42%",tertiaryY:"58%",titleScale:.7,bodyScale:1.5,columnLeftX:"50%",columnRightX:"50%",columnTopY:"30%",columnBottomY:"55%",stackColumns:true,maxTextWidth:"90%",horizontalPadding:"5%",captionY:"75%",captionScale:.85},square:{primaryY:"30%",secondaryY:"50%",tertiaryY:"70%",titleScale:.85,bodyScale:.9,columnLeftX:"25%",columnRightX:"75%",columnTopY:"35%",columnBottomY:"65%",stackColumns:false,maxTextWidth:"85%",horizontalPadding:"7.5%",captionY:"82%",captionScale:.9}};function Ue(e){return Ro[e]}function ar(e,t,n,r=false){let o=Dt(t),i=Ue(n),a=r?i.titleScale:i.bodyScale;return Math.round(e*o*a)}function ft(e){let t=Ue(e);return t.stackColumns?{left:{x:"50%",y:t.columnTopY},right:{x:"50%",y:t.columnBottomY}}:{left:{x:t.columnLeftX,y:"50%"},right:{x:t.columnRightX,y:"50%"}}}var Ot='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';function ne(e){return "template"in e&&typeof e.template=="string"}function ge(e,t,n,r=J.landscape){let o=zt(r);return {theme:e,blockIndex:t,totalBlocks:n,viewport:r,fontScale:Dt(r),orientation:o,layout:Ue(o)}}function L(e,t,n=false){return ar(e,t.viewport,t.orientation,n)}function Wt(e){return "template"in e&&typeof e.template=="string"}function sr(e){return "children"in e&&Array.isArray(e.children)?e.children:[]}function ye(e){if("value"in e&&typeof e.value=="string")return e.value;let t=sr(e),n=e.type==="list"||e.type==="listItem"?`
2
+ `:"";return t.map(ye).join(n)}var zo={"dark-vignette":"radial-gradient(ellipse at center, rgba(26,32,44,0.8) 0%, rgba(0,0,0,0.95) 100%)","radial-dark":"radial-gradient(ellipse at center, #1a202c 0%, #000000 100%)","warm-sunset":"linear-gradient(135deg, rgba(124,58,48,0.9) 0%, rgba(26,32,44,0.95) 100%)","cool-blue":"linear-gradient(135deg, rgba(26,54,93,0.9) 0%, rgba(26,32,44,0.95) 100%)","earth-tones":"linear-gradient(135deg, rgba(68,51,34,0.9) 0%, rgba(26,32,44,0.95) 100%)"};function Oo(e){return {type:"shape",id:"persistent-bg-solid",content:{shape:"rect",fill:e.color},position:{x:0,y:0,width:"100%",height:"100%"}}}function Wo(e){return {type:"shape",id:"persistent-bg-gradient",content:{shape:"rect",fill:e.gradient??zo[e.preset??"dark-vignette"]},position:{x:0,y:0,width:"100%",height:"100%"}}}function Ho(e){let t=[],n=e.opacity??.4,r={type:"image",id:"persistent-bg-image",content:{src:e.src,alt:"Background",fit:"cover"},position:{x:0,y:0,width:"100%",height:"100%"},animation:e.ambientMotion?{type:e.ambientMotion,duration:30}:void 0};return t.push(r),t.push({type:"shape",id:"persistent-bg-overlay",content:{shape:"rect",fill:`rgba(0,0,0,${.5+(1-n)*.3})`},position:{x:0,y:0,width:"100%",height:"100%"}}),t}function Uo(e){let t=e.opacity??.1;return {type:"shape",id:"persistent-bg-pattern",content:{shape:"rect",fill:e.color??`rgba(255,255,255,${t})`},position:{x:0,y:0,width:"100%",height:"100%"}}}function Vo(e){let t=[],n=e.fontSize??18,r=!!e.subtitle,o=e.position.includes("bottom"),i=e.position.includes("left"),a=3,s=r?"15%":"7%",u=o?r?"78%":"84%":"2%",l=i?`${a}%`:"68%",p=r?"6%":"5%",d=r?"10%":"5%",m=1.5,f=e.showThumbnail&&i?`${a+m+6+m}%`:`${a+m}%`,h=e.showThumbnail?"19%":"24%",g=o?r?"80%":"86%":"4%";if(t.push({type:"shape",id:"persistent-caption-bg",content:{shape:"rect",fill:"rgba(0,0,0,0.6)",borderRadius:8},position:{x:l,y:u,width:e.showThumbnail?"30%":"28%",height:s}}),e.showThumbnail&&e.thumbnailSrc){let y=i?`${a+m}%`:"93%",v=o?r?`${78+m}%`:"85%":"3%";t.push({type:"image",id:"persistent-caption-thumb",content:{src:e.thumbnailSrc,alt:"Article thumbnail",fit:"cover"},position:{x:y,y:v,width:p,height:d}});}if(t.push({type:"text",id:"persistent-caption-title",content:{text:e.title,style:{fontSize:n,fontWeight:"bold",color:"rgba(255,255,255,0.9)",textAlign:i?"left":"right",maxLines:1}},position:{x:f,y:g,width:h}}),r){let y=o?"85.5%":"8%";t.push({type:"text",id:"persistent-caption-subtitle",content:{text:e.subtitle,style:{fontSize:18,fontWeight:"normal",color:"rgba(255,255,255,0.55)",textAlign:i?"left":"right"}},position:{x:f,y,width:h}});}return t}function Yo(e){let t=e.position.includes("bottom"),r=e.position.includes("left")?"3%":"90%",o=t?"94%":"3%";return e.isImage?{type:"image",id:"persistent-branding",content:{src:e.content,alt:"Branding",fit:"contain"},position:{x:r,y:o,width:"8%",height:"4%"}}:{type:"text",id:"persistent-branding",content:{text:e.content,style:{fontSize:14,fontWeight:"normal",color:"rgba(255,255,255,0.6)"}},position:{x:r,y:o}}}function jo(e){let t=e.color??"rgba(255,255,255,0.3)",n=e.position==="top"?"1%":"98%";return {type:"shape",id:"persistent-progress",content:{shape:"rect",fill:t,borderRadius:2},position:{x:"5%",y:n,width:"90%",height:"0.5%"}}}function Xo(e){if(!Wt(e))return [e];let n=e.config;switch(n.type){case "solidBackground":return [Oo(n)];case "gradientBackground":return [Wo(n)];case "imageBackground":return Ho(n);case "patternBackground":return [Uo(n)];case "titleCaption":return Vo(n);case "cornerBranding":return [Yo(n)];case "progressIndicator":return [jo(n)];default:return console.warn("Unknown persistent layer template:",n.type),[]}}function Ve(e){return !e||e.length===0?[]:e.reduce((t,n)=>t.concat(Xo(n)),[])}var Zo={bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"};function be(e,t){let n=e.theme.colorSchemes;if(t&&t in n)return n[t];let r=Object.keys(n);return r.length>0?n[r[0]]:Zo}var Go='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Ko='Georgia, "Times New Roman", serif',Qo='Consolas, "Courier New", monospace';function I(e,t){let{typography:n}=e.theme;switch(t){case "title":return n.titleFontFamily||Ko;case "body":return n.bodyFontFamily||Go;case "mono":return n.monoFontFamily||Qo}}function ur(e,t){let{title:n,subtitle:r,backgroundColor:o}=e,{theme:i,layout:a}=t,s=L(96,t,true),u=L(36,t,false),p=[{type:"shape",id:"bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 40%, ${o||i.colors.primary} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"shape",id:"accent-line",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.2)"},position:{x:"40%",y:r?"28%":"38%",width:"20%",height:"2px"}},{type:"text",id:"title",content:{text:n,style:{fontSize:s,fontFamily:I(t,"title"),fontWeight:"bold",color:i.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:r?a.primaryY:"50%",anchor:"center",width:a.maxTextWidth},animation:{type:"fadeIn",duration:2}}];return r&&p.push({type:"text",id:"subtitle",content:{text:r,style:{fontSize:u,fontFamily:I(t,"body"),color:i.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:a.secondaryY,anchor:"center",width:a.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:1}}),p}function dr(e,t){let{title:n="",colorScheme:r="blue",imageSrc:o,imageAlt:i,ambientMotion:a}=e,{layout:s}=t,u=be(t,r),l=L(72,t,true),p=[];return o?(p.push({type:"image",id:"bg-image",content:{src:o,alt:i||n,fit:"cover"},position:{x:0,y:0,width:"100%",height:"100%"},animation:a?{type:a,duration:8}:{type:"slowZoom",duration:8,direction:"in"}}),p.push({type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.5)"},position:{x:0,y:0,width:"100%",height:"100%"}})):(p.push({type:"shape",id:"bg",content:{shape:"rect",fill:u.bg},position:{x:0,y:0,width:"100%",height:"100%"}}),p.push({type:"shape",id:"line-top",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"40%",width:"20%",height:"2px",anchor:"center"}}),p.push({type:"shape",id:"line-bottom",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"60%",width:"20%",height:"2px",anchor:"center"}})),p.push({type:"text",id:"title",content:{text:n,style:{fontSize:l,fontFamily:I(t,"title"),fontWeight:"bold",color:o?"#ffffff":u.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"50%",anchor:"center",width:s.maxTextWidth},animation:{type:"fadeIn",duration:1.5}}),p}var Jo=/^(\d+(?:\.\d+)?)\s*%?$/,ke={textCenterX:"50%",textWidth:"85%",textYAdjust:0,adjustY:false};function Fe(e,t){if(!e)return;let n=t!==void 0?{duration:t}:{};switch(e){case "zoomIn":case "in":return {type:"slowZoom",direction:"in",...n};case "zoomOut":case "out":return {type:"slowZoom",direction:"out",...n};case "panLeft":case "left":return {type:"slowZoom",panDirection:"left",...n};case "panRight":case "right":return {type:"slowZoom",panDirection:"right",...n};default:return}}var ue=35,fr=`${ue}%`;function Te(e){switch(e){case "left-strip":return {textCenterX:`${50+ue/2}%`,textWidth:`${100-ue-8}%`,textYAdjust:0,adjustY:false};case "right-strip":return {textCenterX:`${50-ue/2}%`,textWidth:`${100-ue-8}%`,textYAdjust:0,adjustY:false};case "bottom-strip":return {textCenterX:"50%",textWidth:"85%",textYAdjust:-10,adjustY:true};case "corner-inset":return {textCenterX:"45%",textWidth:"70%",textYAdjust:0,adjustY:false};default:return ke}}function Ce(e,t){let n=[],{src:r,alt:o,position:i,ambientMotion:a,credit:s,license:u}=e;switch(i){case "left-strip":n.push(lr(r,o,"left",t,a,s,u)),n.push(cr("left",t));break;case "right-strip":n.push(lr(r,o,"right",t,a,s,u)),n.push(cr("right",t));break;case "bottom-strip":n.push(ei(r,o,t,a,s,u)),n.push(ti(t));break;case "corner-inset":n.push(ni(r,o,t,a,s,u)),n.push(ri(t));break}return n}function lr(e,t,n,r,o,i,a){return {type:"image",id:`${r}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:i,license:a},position:{x:n==="left"?0:`${100-ue}%`,y:0,width:fr,height:"100%"},animation:Fe(o,15)}}function cr(e,t){let n=e==="left"?"accent-gradient-left":"accent-gradient-right";return {type:"shape",id:`${t}-accent-fade`,content:{shape:"rect",fill:`url(#${n})`},position:{x:e==="left"?`${ue-8}%`:`${100-ue}%`,y:0,width:"10%",height:"100%"}}}function ei(e,t,n,r,o,i){return {type:"image",id:`${n}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:o,license:i},position:{x:0,y:`${100-ue}%`,width:"100%",height:fr},animation:Fe(r,15)}}function ti(e){return {type:"shape",id:`${e}-accent-fade`,content:{shape:"rect",fill:"url(#accent-gradient-bottom)"},position:{x:0,y:`${100-ue-8}%`,width:"100%",height:"12%"}}}function ni(e,t,n,r,o,i){return {type:"image",id:`${n}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:o,license:i},position:{x:"70%",y:"60%",width:"28%",height:"38%",anchor:"top-left"},animation:Fe(r,15)??{type:"fadeIn",duration:2,delay:.5}}}function ri(e){return {type:"shape",id:`${e}-accent-vignette`,content:{shape:"rect",fill:"url(#accent-vignette-corner)",borderRadius:8},position:{x:"69%",y:"59%",width:"30%",height:"40%"}}}function K(e,t){if(!t.adjustY||t.textYAdjust===0)return typeof e=="number"?`${e}%`:e;let n=typeof e=="number"?`${e}`:e,r=n.match(Jo);if(r){let o=parseFloat(r[1]);return `${Math.max(5,o+t.textYAdjust)}%`}return n}var oi=/[.;:!?]+$/;function Ut(e){return e.replace(oi,"").trim()}function je(e,t){return {type:"shape",id:e,content:{shape:"rect",fill:t},position:{x:0,y:0,width:"100%",height:"100%"}}}function pr(e,t){let{stat:n,description:r,detail:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,u=be(t,i),l=a?Te(a.position):ke,p=L(148,t,true),d=L(32,t,false),m=L(26,t,false),f=[je("bg",`linear-gradient(180deg, ${s.colors.background} 0%, #0f1520 100%)`)];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"stat",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:u.text,shadow:!!a}},position:{x:l.textCenterX,y:K("32%",l),anchor:"center"},animation:{type:"zoomIn",duration:.6}}),f.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.6,shadow:!!a}},position:{x:l.textCenterX,y:K("58%",l),width:l.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.3}}),o&&f.push({type:"text",id:"detail",content:{text:o,style:{fontSize:m,fontFamily:I(t,"body"),color:u.accent,textAlign:"center",shadow:!!a}},position:{x:l.textCenterX,y:K("75%",l),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1}}),f}function mr(e,t){let{quote:n,attribution:r,accentImage:o}=e,{theme:i,layout:a}=t,s=o?Te(o.position):ke,u=L(48,t,true),l=L(24,t,false),p=L(280,t,true),d=[je("bg",`linear-gradient(160deg, ${i.colors.backgroundLight} 0%, #1e2636 100%)`)];o&&d.push(...Ce(o,e.id)),d.push({type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:p,fontFamily:I(t,"title"),color:"rgba(255, 255, 255, 0.06)",textAlign:"center"}},position:{x:s.textCenterX,y:K("18%",s),anchor:"center"}});let m=r?a.primaryY:"50%";return d.push({type:"text",id:"quote",content:{text:n,style:{fontSize:u,fontFamily:I(t,"title"),color:i.colors.text,textAlign:"center",lineHeight:1.6,shadow:true}},position:{x:s.textCenterX,y:K(m,s),anchor:"center",width:s.textWidth},animation:{type:"fadeIn",duration:2}}),r&&d.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:l,fontFamily:I(t,"body"),color:i.colors.textMuted,textAlign:"center",shadow:!!o}},position:{x:s.textCenterX,y:K(a.captionY,s),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),d}function hr(e,t){let{fact:n,explanation:r,source:o,accentImage:i}=e,{theme:a}=t,s=i?Te(i.position):ke,u=L(56,t,true),l=L(32,t,false),p=L(20,t,false),d=[je("bg",`linear-gradient(170deg, #1e2030 0%, ${a.colors.background} 100%)`)];return i&&d.push(...Ce(i,e.id)),d.push({type:"text",id:"fact",content:{text:n,style:{fontSize:u,fontFamily:I(t,"title"),fontWeight:"bold",color:a.colors.text,textAlign:"center",lineHeight:1.4,shadow:true}},position:{x:s.textCenterX,y:K("35%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),d.push({type:"text",id:"explanation",content:{text:r,style:{fontSize:l,fontFamily:I(t,"body"),color:a.colors.textMuted,textAlign:"center",lineHeight:1.5,shadow:!!i}},position:{x:s.textCenterX,y:K("60%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&d.push({type:"text",id:"source",content:{text:o,style:{fontSize:p,fontFamily:I(t,"body"),color:a.colors.textMuted,textAlign:"center",shadow:!!i}},position:{x:s.textCenterX,y:K("85%",s),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),d}function gr(e,t){let{left:n,right:r,header:o,leftColor:i="green",rightColor:a="blue"}=e;if(!n?.label||!r?.label)return [];let{theme:s,layout:u,orientation:l}=t,p=be(t,i),d=be(t,a),m=ft(l),f=u.stackColumns,h=f?"85%":"42%",g=L(32,t,false),y=L(44,t,true),v=L(22,t,false),x=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(135deg, ${s.colors.background} 0%, #16202e 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];f||(x.push({type:"shape",id:"left-panel",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.04)"},position:{x:"3%",y:"15%",width:"44%",height:"70%"}}),x.push({type:"shape",id:"right-panel",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.04)"},position:{x:"53%",y:"15%",width:"44%",height:"70%"}}));let S=f?"12%":"22%";o&&x.push({type:"text",id:"header",content:{text:o,style:{fontSize:g,fontFamily:I(t,"title"),color:s.colors.textMuted,textAlign:"center"}},position:{x:"50%",y:S,anchor:"center"},animation:{type:"fadeIn",duration:.8}});let w,C,B,R;if(f)w=o?"30%":"25%",C=o?"40%":"35%",B=o?"60%":"55%",R=o?"70%":"65%";else {let ae=o?"47%":"45%",k=o?"58%":"56%";w=ae,C=k,B=ae,R=k;}x.push({type:"text",id:"left-label",content:{text:n.label,style:{fontSize:y,fontFamily:I(t,"body"),fontWeight:"bold",color:p.text,textAlign:"center",lineHeight:1.3}},position:{x:m.left.x,y:w,anchor:"center",width:h},animation:{type:"fadeIn",duration:1}}),n.sublabel&&x.push({type:"text",id:"left-sublabel",content:{text:n.sublabel,style:{fontSize:v,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.left.x,y:C,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.3}});let $=L(120,t,true),Y=f?"48%":"50%",W=f?"\u2193":"\u2192";return x.push({type:"text",id:"connector",content:{text:W,style:{fontSize:$,fontFamily:I(t,"title"),fontWeight:"bold",color:"rgba(255, 255, 255, 0.6)",textAlign:"center"}},position:{x:"50%",y:Y,anchor:"center"},animation:{type:"fadeIn",duration:.6,delay:.4}}),x.push({type:"text",id:"right-label",content:{text:r.label,style:{fontSize:y,fontFamily:I(t,"body"),fontWeight:"bold",color:d.text,textAlign:"center",lineHeight:1.3}},position:{x:m.right.x,y:B,anchor:"center",width:h},animation:{type:"fadeIn",duration:1,delay:.5}}),r.sublabel&&x.push({type:"text",id:"right-sublabel",content:{text:r.sublabel,style:{fontSize:v,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.right.x,y:R,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.8}}),x}var ii={neutral:{bg:"#1a202c",date:"#63b3ed",text:"#ffffff"},somber:{bg:"#1a1a2e",date:"#e53e3e",text:"#a0aec0"},celebratory:{bg:"#1a365d",date:"#68d391",text:"#ffffff"}};function yr(e,t){let{date:n,description:r,footer:o,mood:i="neutral",accentImage:a}=e,{theme:s}=t,u=ii[i],l=a?Te(a.position):ke,p=L(96,t,true),d=L(30,t,false),m=L(26,t,false),f=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(135deg, ${u.bg} 0%, #0d1117 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"date",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:u.date,shadow:!!a}},position:{x:l.textCenterX,y:K("35%",l),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,fontFamily:I(t,"body"),color:u.text,textAlign:"center",lineHeight:1.8,shadow:!!a}},position:{x:l.textCenterX,y:K("58%",l),width:l.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:2,delay:1}}),o&&f.push({type:"text",id:"footer",content:{text:o,style:{fontSize:m,fontFamily:I(t,"body"),color:s.colors.textMuted,shadow:!!a}},position:{x:l.textCenterX,y:K("82%",l),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:3}}),f}function br(e,t){let{imageSrc:n,imageAlt:r,caption:o,captionPosition:i="bottom",ambientMotion:a,isTitle:s,subtitle:u,imageCredit:l,imageLicense:p}=e,d=o&&Ut(o),{theme:m,layout:f}=t,h=L(36,t,false),g=L(96,t,true),y=L(36,t,false),v=e.kenBurns,S=Fe(a||v),w=[{type:"image",id:"bg-image",content:{src:n,alt:r,fit:"cover",credit:l,license:p},position:{x:0,y:0,width:"100%",height:"100%"},animation:S}];return s&&d?(w.push({type:"shape",id:"title-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)"},position:{x:0,y:0,width:"100%",height:"100%"}}),w.push({type:"text",id:"title",content:{text:d,style:{fontSize:g,fontFamily:I(t,"title"),fontWeight:"bold",color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:u?"70%":"75%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8}}),u&&w.push({type:"text",id:"subtitle",content:{text:u,style:{fontSize:y,fontFamily:I(t,"body"),color:m.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:"82%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),w):(d&&(w.push({type:"shape",id:"caption-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)"},position:{x:0,y:"65%",width:"100%",height:"35%"}}),w.push({type:"text",id:"caption",content:{text:d,style:{fontSize:h,fontFamily:I(t,"body"),color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"82%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}})),w)}function _r(e,t){let{center:n,zoom:r,mapStyle:o="terrain",title:i,caption:a,markers:s,ambientMotion:u,staticSrc:l}=e,{theme:p,layout:d}=t,m=L(64,t,true),f=L(32,t,false),h=Fe(u),g=[{type:"map",id:"map-bg",content:{center:n,zoom:r,style:o,markers:s,showAttribution:true,staticSrc:l},position:{x:0,y:0,width:"100%",height:"100%"},animation:h}];return i&&(g.push({type:"shape",id:"title-overlay",content:{shape:"rect",fill:"rgba(0,0,0,0.6)"},position:{x:0,y:0,width:"100%",height:"18%"}}),g.push({type:"text",id:"title",content:{text:i,style:{fontSize:m,fontFamily:I(t,"title"),fontWeight:"bold",color:p.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"9%",anchor:"center",width:d.maxTextWidth},animation:{type:"fadeIn",duration:1,delay:.3}})),a&&(g.push({type:"shape",id:"caption-overlay",content:{shape:"rect",fill:"rgba(0,0,0,0.6)"},position:{x:0,y:"82%",width:"100%",height:"18%"}}),g.push({type:"text",id:"caption",content:{text:a,style:{fontSize:f,fontFamily:I(t,"body"),color:p.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:d.captionY,anchor:"center",width:d.maxTextWidth},animation:{type:"fadeIn",duration:1,delay:.5}})),g}function xr(e,t){let{text:n,colorScheme:r="blue"}=e,{theme:o}=t,i=be(t,r),a=L(120,t,true);return [{type:"shape",id:"bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 50%, ${o.colors.backgroundLight} 0%, #000000 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"impact-text",content:{text:n,style:{fontSize:a,fontFamily:I(t,"title"),fontWeight:"bold",color:i.text,textAlign:"center",lineHeight:1.2,shadow:true}},position:{x:"50%",y:"50%",anchor:"center",width:"85%"},animation:{type:"fadeIn",duration:1.5}}]}function vr(e,t){let{items:n,title:r,accentImage:o}=e,{theme:i}=t,a=o?Te(o.position):ke,s=L(44,t,true),u=L(34,t,false),l=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(155deg, ${i.colors.backgroundLight} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];o&&l.push(...Ce(o,e.id));let p=r?30:22;r&&l.push({type:"text",id:"list-title",content:{text:r,style:{fontSize:s,fontFamily:I(t,"title"),fontWeight:"bold",color:i.colors.text,textAlign:"center",shadow:!!o}},position:{x:a.textCenterX,y:K("16%",a),anchor:"center"},animation:{type:"fadeIn",duration:1}});let m=n.length>1?(80-p)/(n.length-1):0;for(let f=0;f<n.length;f++){let h=p+m*f,g=`${f+1}. ${n[f]}`;l.push({type:"text",id:`item-${f}`,content:{text:g,style:{fontSize:u,fontFamily:I(t,"body"),color:i.colors.text,lineHeight:1.4,shadow:!!o}},position:{x:a.textCenterX,y:K(`${h}%`,a),anchor:"center",width:a.textWidth},animation:{type:"fadeIn",duration:.8,delay:.3+.3*f}});}return l}var ee=.5;function kr(e,t){let{images:n,caption:r,ambientMotion:o}=e;if(!n||n.length===0)return [];let i=r&&Ut(r),{theme:a,layout:s}=t,u=[{type:"shape",id:"bg",content:{shape:"rect",fill:"#000000"},position:{x:0,y:0,width:"100%",height:"100%"}}],l=i?s.stackColumns?18:22:0,p=100-l,d=ai(n.length,p,s.stackColumns),m=L(24,t,false);for(let f=0;f<Math.min(n.length,4);f++){let h=n[f],g=d[f];u.push({type:"shape",id:`grid-placeholder-${f}`,content:{shape:"rect",fill:a.colors.background},position:{x:`${g.x}%`,y:`${g.y}%`,width:`${g.w}%`,height:`${g.h}%`}}),h.alt&&u.push({type:"text",id:`grid-alt-${f}`,content:{text:h.alt,style:{fontSize:m,fontFamily:I(t,"body"),color:a.colors.textMuted,textAlign:"center"}},position:{x:`${g.x+g.w/2}%`,y:`${g.y+g.h/2}%`,anchor:"center"}}),u.push({type:"image",id:`grid-img-${f}`,content:{src:h.src,alt:h.alt,fit:"cover",credit:h.credit,license:h.license},position:{x:`${g.x}%`,y:`${g.y}%`,width:`${g.w}%`,height:`${g.h}%`},animation:f===0&&o?{type:o,duration:15}:{type:"fadeIn",duration:1,delay:.2*f}});}if(i){let f=L(s.stackColumns?28:40,t,false);u.push({type:"shape",id:"caption-bg",content:{shape:"rect",fill:"linear-gradient(transparent, rgba(0,0,0,0.8))"},position:{x:0,y:`${p-4}%`,width:"100%",height:`${l+4}%`}}),u.push({type:"text",id:"caption",content:{text:i,style:{fontSize:f,fontFamily:I(t,"body"),color:a.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:`${p+(s.stackColumns?l/2:l*.3)}%`,anchor:"center",width:"90%"},animation:{type:"fadeIn",duration:1,delay:.5}});}return u}function ai(e,t,n){let r=50-ee/2,o=t/2-ee/2;switch(e){case 2:return n?[{x:0,y:0,w:100,h:o},{x:0,y:t/2+ee/2,w:100,h:o}]:[{x:0,y:0,w:r,h:t},{x:50+ee/2,y:0,w:r,h:t}];case 3:{if(n){let s=t/3-ee*2/3;return [{x:0,y:0,w:100,h:s},{x:0,y:t/3+ee/3,w:100,h:s},{x:0,y:t*2/3+ee*2/3,w:100,h:s}]}let i=60-ee/2,a=40-ee/2;return [{x:0,y:0,w:i,h:t},{x:60+ee/2,y:0,w:a,h:o},{x:60+ee/2,y:t/2+ee/2,w:a,h:o}]}default:return [{x:0,y:0,w:r,h:o},{x:50+ee/2,y:0,w:r,h:o},{x:0,y:t/2+ee/2,w:r,h:o},{x:50+ee/2,y:t/2+ee/2,w:r,h:o}]}}function wr(e,t){let{term:n,definition:r,origin:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,u=be(t,i),l=a?Te(a.position):ke,p=L(72,t,true),d=L(32,t,false),m=L(22,t,false),f=[je("bg",`linear-gradient(145deg, #1e2030 0%, ${s.colors.background} 100%)`)];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"term",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:u.text,textAlign:"center",shadow:!!a}},position:{x:l.textCenterX,y:K("30%",l),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"shape",id:"separator",content:{shape:"rect",fill:`${u.text}33`},position:{x:l.textCenterX,y:K("42%",l),width:"30%",height:"2px",anchor:"center"}}),f.push({type:"text",id:"definition",content:{text:r,style:{fontSize:d,fontFamily:I(t,"body"),color:s.colors.text,textAlign:"center",lineHeight:1.6,maxLines:4,shadow:!!a}},position:{x:l.textCenterX,y:K("55%",l),width:l.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&f.push({type:"text",id:"origin",content:{text:o,style:{fontSize:m,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",shadow:!!a}},position:{x:l.textCenterX,y:K("78%",l),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),f}function Sr(e,t){let{leftLabel:n,leftValue:r,rightLabel:o,rightValue:i,unit:a,colorScheme:s="blue"}=e,{theme:u}=t,l=be(t,s),p=L(28,t,false),d=L(48,t,true),m=Math.max(r,i,1),f=65,h=r/m*f,g=i/m*f,y=15,v=6,x=36,S=58,w=R=>R>=1e6?`${(R/1e6).toFixed(1)}M`:R>=1e3?`${(R/1e3).toFixed(R>=1e4?0:1)}K`:R.toLocaleString(),C=a?`${w(r)} ${a}`:w(r),B=a?`${w(i)} ${a}`:w(i);return [{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(180deg, ${u.colors.background} 0%, #0f1520 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"left-label",content:{text:n,style:{fontSize:p,fontFamily:I(t,"body"),color:u.colors.textMuted}},position:{x:`${y}%`,y:`${x-8}%`}},{type:"text",id:"left-value",content:{text:C,style:{fontSize:d,fontFamily:I(t,"body"),fontWeight:"bold",color:l.text}},position:{x:`${y+h+2}%`,y:`${x-1}%`},animation:{type:"fadeIn",duration:.8,delay:.3}},{type:"shape",id:"left-bar",content:{shape:"rect",fill:l.text,borderRadius:4},position:{x:`${y}%`,y:`${x}%`,width:`${h}%`,height:`${v}%`},animation:{type:"fadeIn",duration:1}},{type:"text",id:"right-label",content:{text:o,style:{fontSize:p,fontFamily:I(t,"body"),color:u.colors.textMuted}},position:{x:`${y}%`,y:`${S-8}%`}},{type:"text",id:"right-value",content:{text:B,style:{fontSize:d,fontFamily:I(t,"body"),fontWeight:"bold",color:l.accent}},position:{x:`${y+g+2}%`,y:`${S-1}%`},animation:{type:"fadeIn",duration:.8,delay:.6}},{type:"shape",id:"right-bar",content:{shape:"rect",fill:l.accent,borderRadius:4},position:{x:`${y}%`,y:`${S}%`,width:`${g}%`,height:`${v}%`},animation:{type:"fadeIn",duration:1,delay:.3}}]}function Tr(e,t){let{text:n,attribution:r,backgroundImage:o,ambientMotion:i}=e;if(!o?.src)return [];let a=L(52,t,true),s=L(24,t,false),u=L(200,t,true),l=[{type:"image",id:"bg-image",content:{src:o.src,alt:o.alt,fit:"cover",credit:o.credit,license:o.license},position:{x:0,y:0,width:"100%",height:"100%"},animation:i?{type:i,duration:15}:void 0},{type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.55)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:u,fontFamily:I(t,"title"),color:"rgba(255, 255, 255, 0.08)",textAlign:"center"}},position:{x:"50%",y:"20%",anchor:"center"}},{type:"text",id:"quote-text",content:{text:n,style:{fontSize:a,fontFamily:I(t,"title"),color:"#ffffff",textAlign:"center",lineHeight:1.5,shadow:true}},position:{x:"50%",y:r?"45%":"50%",anchor:"center",width:"80%"},animation:{type:"fadeIn",duration:2}}];return r&&l.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:s,fontFamily:I(t,"body"),color:"rgba(255, 255, 255, 0.7)",textAlign:"center",shadow:true}},position:{x:"50%",y:"72%",anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),l}function Cr(e,t){let{videoSrc:n,posterSrc:r,videoAlt:o,clipStart:i,clipEnd:a,sourceDuration:s,caption:u,captionPosition:l="bottom",videoCredit:p,videoLicense:d}=e,m=u&&Ut(u),{theme:f,layout:h}=t,g=L(36,t,false),y=L(16,t,false),v=[{type:"video",id:"bg-video",content:{src:n,posterSrc:r,alt:o,fit:"cover",clipStart:i,clipEnd:a,sourceDuration:s,credit:p,license:d},position:{x:0,y:0,width:"100%",height:"100%"}}];if(m){v.push({type:"shape",id:"caption-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)"},position:{x:0,y:l==="top"?0:"65%",width:"100%",height:"35%"}});let x=l==="top"?"15%":l==="center"?"50%":"82%";v.push({type:"text",id:"caption",content:{text:m,style:{fontSize:g,fontFamily:I(t,"body"),color:f.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:x,anchor:"center",width:h.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}});}return p&&v.push({type:"text",id:"credit",content:{text:p,style:{fontSize:y,fontFamily:I(t,"body"),color:"rgba(255, 255, 255, 0.5)",textAlign:"right"}},position:{x:"96%",y:"96%",anchor:"bottom-right"}}),v}function Mr(e,t){let{text:n,attribution:r,backgroundVideo:o}=e;if(!o?.src)return [];let i=L(52,t,true),a=L(24,t,false),s=L(200,t,true),u=[{type:"video",id:"bg-video",content:{src:o.src,posterSrc:o.posterSrc,alt:o.alt,fit:"cover",clipStart:o.clipStart,clipEnd:o.clipEnd,credit:o.credit,license:o.license},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.55)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:s,fontFamily:I(t,"title"),color:"rgba(255, 255, 255, 0.08)",textAlign:"center"}},position:{x:"50%",y:"20%",anchor:"center"}},{type:"text",id:"quote-text",content:{text:n,style:{fontSize:i,fontFamily:I(t,"title"),color:"#ffffff",textAlign:"center",lineHeight:1.5,shadow:true}},position:{x:"50%",y:r?"45%":"50%",anchor:"center",width:"80%"},animation:{type:"fadeIn",duration:2}}];return r&&u.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:a,fontFamily:I(t,"body"),color:"rgba(255, 255, 255, 0.7)",textAlign:"center",shadow:true}},position:{x:"50%",y:"72%",anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),u}function Ar(e,t){let{title:n,headers:r,rows:o,align:i,colorScheme:a}=e,{theme:s}=t,u=be(t,a),l=L(48,t,true),p=L(28,t,false),d=[je("bg",`linear-gradient(170deg, ${s.colors.background} 0%, #0f1520 100%)`)];return n&&d.push({type:"text",id:"title",content:{text:n,style:{fontSize:l,fontFamily:I(t,"title"),fontWeight:"bold",color:s.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"10%",width:"80%",anchor:"center"},animation:{type:"fadeIn",duration:.8}}),d.push({type:"table",id:"table",content:{headers:r,rows:o,align:i,style:{headerBackground:u.accent,headerColor:u.text,cellBackground:"rgba(255,255,255,0.05)",cellColor:s.colors.text,borderColor:"rgba(255,255,255,0.12)",fontSize:p,fontFamily:I(t,"body"),headerFontFamily:I(t,"title"),borderRadius:8}},position:{x:"10%",y:n?"18%":"8%",width:"80%",height:n?"74%":"84%"},animation:{type:"fadeIn",duration:1,delay:n?.4:0}}),d}function Ir(e,t){let{heroSrc:n,heroAlt:r,title:o,subtitle:i,ambientMotion:a,heroCredit:s,heroLicense:u}=e,{theme:l,layout:p}=t,d=L(120,t,true),m=L(40,t,false),f=[];if(n){let h=Fe(a);f.push({type:"image",id:"cover-hero",content:{src:n,alt:r||o,fit:"cover",credit:s,license:u},position:{x:0,y:0,width:"100%",height:"100%"},animation:h},{type:"shape",id:"cover-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)"},position:{x:0,y:0,width:"100%",height:"100%"}});}else f.push({type:"shape",id:"cover-bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 40%, ${l.colors.primary} 0%, ${l.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}),f.push({type:"shape",id:"cover-accent",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.2)"},position:{x:"35%",y:i?"42%":"58%",width:"30%",height:"2px"}});return f.push({type:"text",id:"cover-title",content:{text:o,style:{fontSize:d,fontFamily:I(t,"title"),fontWeight:"bold",color:l.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:n?i?"70%":"75%":i?p.primaryY:"50%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8}}),i&&f.push({type:"text",id:"cover-subtitle",content:{text:i,style:{fontSize:m,fontFamily:I(t,"body"),color:l.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:n?"82%":p.secondaryY,anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),f}function si(e){return {heroSrc:e.heroSrc,heroAlt:e.heroAlt,title:e.title,subtitle:e.subtitle,ambientMotion:e.ambientMotion,heroCredit:e.heroCredit,heroLicense:e.heroLicense}}function Vt(e,t){let n=si(e);return Ir(n,t)}var Ye={titleBlock:ur,sectionHeader:dr,statHighlight:pr,quoteBlock:mr,factCard:hr,twoColumn:gr,dateEvent:yr,imageWithCaption:br,mapBlock:_r,fullBleedQuote:xr,listBlock:vr,photoGrid:kr,definitionCard:wr,comparisonBar:Sr,pullQuote:Tr,videoWithCaption:Cr,videoPullQuote:Mr,dataTable:Ar};function pt(e,t){let n=Ye[e.template];if(!n)return console.warn(`Unknown template: ${e.template}`),{id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,transition:e.transition,template:e.template};let r;try{r=n(e,t),Array.isArray(r)||(console.error(`Template ${e.template} did not return an array, got:`,typeof r),r=[]);}catch(o){console.error(`Error expanding template ${e.template}:`,o),r=[];}return {id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,...r.length>0?{layers:r}:{},transition:e.transition,template:e.template}}function Yt(e,t={}){let n=t,r=n.theme??he,o=n.viewport??J.landscape,{persistentLayers:i,audioSegments:a}=n,s=e.length,u=Ve(i?.bottomLayers),l=Ve(i?.topLayers);if(!a||a.length===0){let m=0;return e.map((f,h)=>{let g=ge(r,h,s,o),y=ne(f)?pt(f,g):f,v=f,x=v.useBottomLayer!==false,S=v.useTopLayer!==false;return (u.length>0||l.length>0)&&(y.layers=[...x?u:[],...y.layers??[],...S?l:[]]),y.startTime=m,m+=y.duration,y})}let p=new Map;e.forEach((m,f)=>{let h=m.audioSegment??0;p.has(h)||p.set(h,[]),p.get(h).push({block:m,originalIndex:f});});let d=new Array(e.length);for(let[m,f]of p){let h=a[m];if(!h){let b=0;for(let{block:_,originalIndex:M}of f){let F=ge(r,M,s,o),q=ne(_)?pt(_,F):_,E=_,N=E.useBottomLayer!==false,oe=E.useTopLayer!==false;(u.length>0||l.length>0)&&(q.layers=[...N?u:[],...q.layers??[],...oe?l:[]]),q.startTime=b,b+=q.duration,d[M]=q;}continue}let g=[],y=[];for(let b of f)b.block.template==="sectionHeader"?g.push(b):y.push(b);let v=g.reduce((b,{block:_})=>b+(_.duration??0),0),x=y.reduce((b,{block:_})=>b+(_.duration??0),0),S=h.duration-v,w=x>0&&S>0?S/x:1,C=[];for(let{block:b,originalIndex:_}of f){let M=ge(r,_,s,o),F=ne(b)?pt(b,M):b,q=b,E=q.useBottomLayer!==false,N=q.useTopLayer!==false;(u.length>0||l.length>0)&&(F.layers=[...E?u:[],...F.layers??[],...N?l:[]]),C.push({block:F,originalIndex:_,templateBlock:q,hasSourceTiming:typeof q.sourceStartTime=="number"});}let B=C.some(b=>b.hasSourceTiming);C.sort((b,_)=>{if(B){let M=b.templateBlock.template==="sectionHeader",F=_.templateBlock.template==="sectionHeader";if(M&&!F)return -1;if(!M&&F)return 1;if(b.hasSourceTiming&&_.hasSourceTiming)return b.templateBlock.sourceStartTime-_.templateBlock.sourceStartTime;if(b.hasSourceTiming&&!_.hasSourceTiming)return -1;if(!b.hasSourceTiming&&_.hasSourceTiming)return 1}return b.originalIndex-_.originalIndex});let R=0;for(let b=0;b<C.length;b++){let _=C[b],{block:M,templateBlock:F}=_;if(_.hasSourceTiming){let q=F.sourceStartTime;M.startTime=h.startTime+q,typeof F.sourceDuration=="number"&&(M.duration=Math.max(5,F.sourceDuration)),R=q+M.duration;}else if(F.template==="sectionHeader")M.startTime=h.startTime+R,R+=M.duration;else {M.startTime=h.startTime+R;let q=M.duration*w;M.duration=q,R+=q;}d[_.originalIndex]=M;}let $=C.map(b=>d[b.originalIndex]).sort((b,_)=>b.startTime-_.startTime);for(let b=0;b<$.length-1;b++){let _=$[b],M=$[b+1],F=_.startTime+_.duration;F>M.startTime?_.duration=M.startTime-_.startTime:F<M.startTime-.5&&(_.duration=Math.max(.1,M.startTime-_.startTime));}let Y=5,W=h.startTime+h.duration;for(;$.length>1;){let b=$[$.length-1];if(W-b.startTime<Y&&b.template!=="sectionHeader"){let M=$[$.length-2];M.duration=W-M.startTime,b.duration=0,b.startTime=W,$.pop();}else {b.startTime+b.duration<W&&(b.duration=W-b.startTime);break}}if($.length===1){let b=$[0];b.startTime+b.duration<W&&(b.duration=W-b.startTime);}let ae=true;for(;ae;){ae=false;for(let b=$.length-1;b>=1;b--){let _=$[b];if(_.duration>0&&_.duration<Y){let M=$[b-1],F=_.startTime+_.duration;M.duration=F-M.startTime,_.duration=0,_.startTime=W,$.splice(b,1),ae=true;break}}}let k=20;for(let b=0;b<$.length;b++){let _=$[b];if(_.duration>k){let M=Math.ceil(_.duration/k),F=_.duration/M;if(F>=Y){_.duration=F;for(let q=1;q<M;q++){let E={id:`${_.id}-split-${q}`,startTime:_.startTime+q*F,duration:F,audioSegment:_.audioSegment,layers:(_.layers??[]).map(N=>({...N,id:`${N.id}-split-${q}`})),transition:{type:"dissolve",duration:1},template:_.template};d.push(E);}}}}}return d.filter(m=>m&&m.duration>0)}function jt(e){return e in Ye}function re(e,t=0){if(!e||e.type==="none")return {className:"",style:{}};let n=li(e),r=ci(e);return {className:n,style:r}}function li(e){let{type:t,direction:n,panDirection:r}=e;switch(t){case "fadeIn":return "anim-fadeIn";case "fadeOut":return "anim-fadeOut";case "slowZoom":return r==="left"?"anim-slowZoom-panLeft":r==="right"?"anim-slowZoom-panRight":n==="out"?"anim-slowZoom-out":"anim-slowZoom-in";case "zoomIn":return "anim-zoomIn";case "zoomOut":return "anim-zoomOut";case "panLeft":return "anim-panLeft";case "panRight":return "anim-panRight";case "typewriter":return "anim-typewriter";default:return ""}}function ci(e){let t={};return e.duration!==void 0&&(t["--anim-duration"]=`${e.duration}s`),e.delay!==void 0&&(t["--anim-delay"]=`${e.delay}s`),e.easing&&(t["--anim-easing"]=e.easing),t}function Xe(e,t){return `transition-${e}-${t?"enter":"exit"}`}function mt(e){let t=[];for(let n of e)t.push(n),n.children&&t.push(...mt(n.children));return t}function Xt(e,t={}){let n=t.theme??he,r=t.viewport??J.landscape,o=t.blockIndex??0,i=t.totalBlocks??1,a=e.layers;if(a&&a.length>0&&!ne(e))return Ht(a,e,t);if(ne(e)&&e.template in Ye){let s=e.template,u=ge(n,o,i,r),l;try{let p=Ye[s];l=p(e,u),Array.isArray(l)||(console.error(`Template ${s} did not return an array, got:`,typeof l),l=[]);}catch(p){console.error(`Error expanding template ${s}:`,p),l=[];}return Ht(l,e,t)}return Ht([],e,t)}function Ht(e,t,n){let{persistentLayers:r}=n;if(!r)return e;let o=Ve(r.bottomLayers),i=Ve(r.topLayers);if(o.length===0&&i.length===0)return e;let a=t,s=a.useBottomLayer!==false,u=a.useTopLayer!==false;return [...s?o:[],...e,...u?i:[]]}function O(e,t){return typeof e=="number"?e:e.endsWith("%")?parseFloat(e)/100*t:parseFloat(e)}function de(e,t,n){switch(e){case "center":return {x:-t/2,y:-n/2};case "top-right":return {x:-t,y:0};case "bottom-left":return {x:0,y:-n};case "bottom-right":return {x:-t,y:-n};default:return {x:0,y:0}}}var Zt=lt(null);function fi(){return qt(Zt)}function Me(e,t){let n=fi(),r=e.startsWith("http")||e.startsWith("/")||e.startsWith("data:")||e.startsWith("blob:"),o=z(()=>r?e:`${t}/${e}`,[r,e,t]),i=!r&&!!n,[a,s]=U(o);return D(()=>{if(!i){s(o);return}let u=false;return n.resolveUrl(e).then(l=>{u||s(l);}),()=>{u=true;}},[i,n,e,o]),i?a:o}var pi=0;function c(e,t,n,r,o,i){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var l={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--pi,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return P.vnode&&P.vnode(l),l}function Lr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,s=O(i.x,n.width),u=O(i.y,n.height),l=i.width?O(i.width,n.width):n.width,p=i.height?O(i.height,n.height):n.height,d=de(i.anchor,l,p),m=s+d.x,f=u+d.y,h=Me(o.src,t),g=re(a,r),y=mi(o.fit),v=o.fit==="cover",x=a&&hi.has(a.type);if(v&&x&&a){let S=gi(a),w=re(S,r);return c("g",{className:"block-layer block-layer--image","data-layer-id":e.id,children:c("foreignObject",{x:m,y:f,width:l,height:p,children:c("div",{style:{width:`${l}px`,height:`${p}px`,overflow:"hidden"},children:c("img",{src:h,alt:o.alt||"",className:w.className,style:{width:`${l}px`,height:`${p}px`,objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none",transformOrigin:"center center",...w.style}})})})})}return v?c("g",{className:`block-layer block-layer--image ${g.className}`,style:g.style,"data-layer-id":e.id,children:c("foreignObject",{x:m,y:f,width:l,height:p,children:c("img",{src:h,alt:o.alt||"",style:{width:`${l}px`,height:`${p}px`,objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})}):c("g",{className:`block-layer block-layer--image ${g.className}`,style:g.style,"data-layer-id":e.id,children:c("image",{href:h,x:m,y:f,width:l,height:p,preserveAspectRatio:y,style:{pointerEvents:"none"}})})}function mi(e){switch(e){case "cover":return "xMidYMid slice";case "fill":return "none";default:return "xMidYMid meet"}}var hi=new Set(["panLeft","panRight","slowZoom","zoomIn","zoomOut"]);function gi(e){switch(e.type){case "panLeft":return {...e,type:"slowZoom",panDirection:"left"};case "panRight":return {...e,type:"slowZoom",panDirection:"right"};case "zoomIn":return {...e,type:"slowZoom",direction:"in"};case "zoomOut":return {...e,type:"slowZoom",direction:"out"};default:return e}}function Br({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{text:a,style:s}=r,u=O(o.x,t.width),l=O(o.y,t.height),p=o.width?O(o.width,t.width):void 0,d=yi(s.textAlign,o.anchor),m=bi(o.anchor),f=re(i,n),h=(a??"").split(`
3
+ `),g=p?h.reduce((w,C)=>w.concat(xi(C,s.fontSize,p)),[]):h;if(s.maxLines&&g.length>s.maxLines){g=g.slice(0,s.maxLines);let w=g[g.length-1];g[g.length-1]=w.replace(/\s*$/,"")+"...";}let y=s.lineHeight||1.4,v=s.fontSize*y,x={fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||Ot,fontWeight:s.fontWeight||"normal",fill:s.color,...f.style},S=s.shadow?`shadow-${e.id}`:void 0;return c("g",{className:`block-layer block-layer--text ${f.className}`,"data-layer-id":e.id,children:[s.shadow&&c("defs",{children:c("filter",{id:S,x:"-20%",y:"-20%",width:"140%",height:"140%",children:c("feDropShadow",{dx:"0",dy:"2",stdDeviation:"3",floodColor:"rgba(0,0,0,0.7)"})})}),s.background&&c("rect",{x:u-(s.padding||16),y:l-s.fontSize-(s.padding||16),width:_i(g,s)+(s.padding||16)*2,height:g.length*v+(s.padding||16)*2,fill:s.background,rx:4,ry:4}),c("text",{x:u,y:l,textAnchor:d,dominantBaseline:m,style:x,filter:S?`url(#${S})`:void 0,children:g.map((w,C)=>c("tspan",{x:u,dy:C===0?0:v,children:[w||"\xA0"," "]},C))})]})}function yi(e,t){return e==="center"?"middle":e==="right"?"end":e==="left"?"start":t?.includes("right")?"end":t==="center"?"middle":"start"}function bi(e){return e?.includes("bottom")?"text-after-edge":e==="center"?"middle":"text-before-edge"}function _i(e,t){return Math.max(...e.map(r=>r.length))*t.fontSize*.55}function xi(e,t,n){if(!e.trim())return [""];let r=t*.5,o=Math.floor(n/r);if(o<=0)return [e];let i=e.split(/\s+/),a=[],s="";for(let u of i){let l=s?`${s} ${u}`:u;if(l.length<=o)s=l;else if(s&&a.push(s),u.length>o){let p=u;for(;p.length>o;)a.push(p.slice(0,o)),p=p.slice(o);s=p;}else s=u;}return s&&a.push(s),a.length>0?a:[""]}function Pr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,a=O(o.x,t.width),s=O(o.y,t.height),u=o.width?O(o.width,t.width):100,l=o.height?O(o.height,t.height):100,p=de(o.anchor,u,l),d=a+p.x,m=s+p.y,f=re(i,n),h=r.fill||"none",g=typeof h=="string"&&h.includes("gradient(");if(r.shape==="rect"&&g)return c("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:c("foreignObject",{x:d,y:m,width:u,height:l,children:c("div",{style:{width:`${u}px`,height:`${l}px`,background:h,borderRadius:r.borderRadius?`${r.borderRadius}px`:void 0,pointerEvents:"none"}})})});let y={fill:h,stroke:r.stroke,strokeWidth:r.strokeWidth};return c("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:[r.shape==="rect"&&c("rect",{x:d,y:m,width:u,height:l,rx:r.borderRadius,ry:r.borderRadius,...y}),r.shape==="circle"&&c("circle",{cx:d+u/2,cy:m+l/2,r:Math.min(u,l)/2,...y}),r.shape==="line"&&c("line",{x1:d,y1:m,x2:d+u,y2:m+l,stroke:r.stroke||"#ffffff",strokeWidth:r.strokeWidth||2})]})}var vi={terrain:{url:"https://tile.opentopomap.org/{z}/{x}/{y}.png",attribution:"Map: OpenTopoMap (CC-BY-SA)",maxZoom:17},road:{url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xA9 OpenStreetMap contributors",maxZoom:19},satellite:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",attribution:"Imagery: Esri, Maxar, Earthstar",maxZoom:18},toner:{url:"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png",attribution:"Map: Stadia Maps, Stamen Design",maxZoom:20},watercolor:{url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",attribution:"Map: Stadia Maps, Stamen Design",maxZoom:16}};function Gt(e,t,n){let r=Math.pow(2,n),o=Math.floor((t+180)/360*r),i=e*Math.PI/180,a=Math.floor((1-Math.log(Math.tan(i)+1/Math.cos(i))/Math.PI)/2*r);return {x:o,y:a}}function Kt(e,t,n,r=256){let o=Math.pow(2,n),i=(t+180)/360*o,a=e*Math.PI/180,s=(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2*o;return {x:(i-Math.floor(i))*r,y:(s-Math.floor(s))*r}}function ki(e,t,n,r,o,i=256){let a=Gt(e,t,n),s=Kt(e,t,n,i),u=Math.ceil(r/i)+1,l=Math.ceil(o/i)+1,p=a.x-Math.floor(u/2),d=a.y-Math.floor(l/2),m=r/2-s.x,f=o/2-s.y,h=[];for(let g=0;g<l;g++)for(let y=0;y<u;y++){let v=p+y,x=d+g,S=m+(v-a.x)*i,w=f+(x-a.y)*i;h.push({x:v,y:x,screenX:S,screenY:w});}return h}function wi(e,t,n,r){return e.url.replace("{z}",String(r)).replace("{x}",String(t)).replace("{y}",String(n))}async function Si(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=()=>n(new Error(`Failed to load tile: ${e}`)),r.src=e;})}async function Er(e){let{center:t,zoom:n,style:r,width:o,height:i,markers:a=[],showAttribution:s=true}=e,u=vi[r],l=u.tileSize||256,p=Math.min(n,u.maxZoom),d=document.createElement("canvas");d.width=o,d.height=i;let m=d.getContext("2d");if(!m)throw new Error("Failed to get canvas context");m.fillStyle=r==="toner"?"#ffffff":"#e5e7eb",m.fillRect(0,0,o,i);let h=ki(t.lat,t.lng,p,o,i,l).map(async g=>{let y=wi(u,g.x,g.y,p);try{let v=await Si(y);m.drawImage(v,g.screenX,g.screenY,l,l);}catch(v){console.warn(`Tile load failed: ${y}`,v);}});await Promise.all(h);for(let g of a)Ti(m,g,t,p,o,i,l);return s&&Mi(m,u.attribution,o,i),d.toDataURL("image/png")}function Ti(e,t,n,r,o,i,a){let s=Gt(n.lat,n.lng,r),u=Gt(t.lat,t.lng,r),l=Kt(n.lat,n.lng,r,a),p=Kt(t.lat,t.lng,r,a),d=(u.x-s.x)*a+(p.x-l.x),m=(u.y-s.y)*a+(p.y-l.y),f=o/2+d,h=i/2+m,g=t.color||"#ef4444",y=t.icon||"pin";e.save(),y==="pin"?(e.fillStyle=g,e.beginPath(),e.arc(f,h-12,8,Math.PI,0,false),e.lineTo(f,h),e.closePath(),e.fill(),e.fillStyle="#ffffff",e.beginPath(),e.arc(f,h-12,3,0,Math.PI*2),e.fill()):y==="circle"?(e.fillStyle=g,e.beginPath(),e.arc(f,h,8,0,Math.PI*2),e.fill(),e.strokeStyle="#ffffff",e.lineWidth=2,e.stroke()):y==="star"&&(e.fillStyle=g,Ci(e,f,h,5,10,5),e.fill()),t.label&&(e.fillStyle="#1f2937",e.font="bold 12px system-ui, sans-serif",e.textAlign="center",e.fillText(t.label,f,h+20)),e.restore();}function Ci(e,t,n,r,o,i){let a=Math.PI/2*3,s=Math.PI/r;e.beginPath(),e.moveTo(t,n-o);for(let u=0;u<r;u++)e.lineTo(t+Math.cos(a)*o,n+Math.sin(a)*o),a+=s,e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i),a+=s;e.lineTo(t,n-o),e.closePath();}function Mi(e,t,n,r){e.save(),e.fillStyle="rgba(255, 255, 255, 0.8)";let o=4;e.font="10px system-ui, sans-serif";let i=e.measureText(t).width;e.fillRect(n-i-o*2-4,r-16,i+o*2,14),e.fillStyle="#374151",e.textAlign="right",e.fillText(t,n-o-4,r-5),e.restore();}function Fr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,[s,u]=U(null),[l,p]=U(true),[d,m]=U(null),f=O(i.x,n.width),h=O(i.y,n.height),g=i.width?O(i.width,n.width):n.width,y=i.height?O(i.height,n.height):n.height,v=de(i.anchor,g,y),x=f+v.x,S=h+v.y;D(()=>{let C=false;if(o.staticSrc){let B=o.staticSrc.startsWith("http")?o.staticSrc:`${t}/${o.staticSrc}`;u(B),p(false);return}return p(true),m(null),Er({center:o.center,zoom:o.zoom,style:o.style,width:g,height:y,markers:o.markers,showAttribution:o.showAttribution!==false}).then(B=>{C||(u(B),p(false));}).catch(B=>{C||(console.error("Failed to compose map:",B),m(B instanceof Error?B.message:String(B)),p(false));}),()=>{C=true;}},[o.center.lat,o.center.lng,o.zoom,o.style,o.staticSrc,g,y,t]);let w=re(a,r);return l?c("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[c("rect",{x,y:S,width:g,height:y,fill:"#e5e7eb"}),c("text",{x:x+g/2,y:S+y/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#9ca3af",fontSize:"24",fontFamily:"system-ui, sans-serif",children:"Loading map..."})]}):d||!s?c("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[c("rect",{x,y:S,width:g,height:y,fill:"#fef2f2"}),c("text",{x:x+g/2,y:S+y/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#dc2626",fontSize:"18",fontFamily:"system-ui, sans-serif",children:"Map failed to load"})]}):c("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[c("defs",{children:c("clipPath",{id:`clip-${e.id}`,children:c("rect",{x,y:S,width:g,height:y})})}),c("g",{clipPath:`url(#clip-${e.id})`,children:c("image",{href:s,x,y:S,width:g,height:y,preserveAspectRatio:"xMidYMid slice",style:{pointerEvents:"none"}})})]})}function Rr({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){let{content:i,position:a}=e,s=V(null),u=V(false),l=O(a.x,n.width),p=O(a.y,n.height),d=a.width?O(a.width,n.width):n.width,m=a.height?O(a.height,n.height):n.height,f=de(a.anchor,d,m),h=l+f.x,g=p+f.y,y=Me(i.src,t),v=Me(i.posterSrc||"",t),x=i.posterSrc?v:void 0;return D(()=>{let S=s.current;if(!S)return;if(S.currentTime=i.clipStart,u.current=true,o){let C=S.play();C&&C.catch(()=>{});}let w=()=>{S.currentTime>=i.clipEnd&&(S.pause(),S.currentTime=i.clipEnd);};return S.addEventListener("timeupdate",w),()=>{S.removeEventListener("timeupdate",w),S.pause();}},[i.src,i.clipStart,i.clipEnd]),D(()=>{let S=s.current;if(!(!S||!u.current)&&!(S.currentTime>=i.clipEnd))if(o){let w=S.play();w&&w.catch(()=>{});}else S.pause();},[o,i.clipEnd]),c("g",{className:"block-layer block-layer--video","data-layer-id":e.id,children:c("foreignObject",{x:h,y:g,width:d,height:m,children:c("video",{ref:s,src:y,poster:x,muted:true,playsInline:true,preload:"auto","data-clip-start":i.clipStart,"data-clip-end":i.clipEnd,style:{width:`${d}px`,height:`${m}px`,objectFit:i.fit||"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})})}function qr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{headers:a,rows:s,align:u,style:l}=r,p=O(o.x,t.width),d=O(o.y,t.height),m=o.width?O(o.width,t.width):t.width,f=o.height?O(o.height,t.height):t.height,h=de(o.anchor,m,f),g=p+h.x,y=d+h.y,v=i?re(i,n):{},x=w=>{let C=u?.[w];return C?{textAlign:C}:void 0},S=l.borderRadius??8;return c("foreignObject",{x:g,y,width:m,height:f,style:v,children:c("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{width:`${m}px`,height:`${f}px`,display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",boxSizing:"border-box"},children:c("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:`${l.fontSize}px`,fontFamily:l.fontFamily??"system-ui, sans-serif",overflow:"hidden",borderRadius:`${S}px`,border:`1px solid ${l.borderColor}`},children:[a.length>0&&c("thead",{children:c("tr",{children:a.map((w,C)=>c("th",{style:{background:l.headerBackground,color:l.headerColor,fontFamily:l.headerFontFamily??l.fontFamily??"system-ui, sans-serif",fontWeight:600,padding:"12px 16px",borderBottom:`2px solid ${l.borderColor}`,borderRight:C<a.length-1?`1px solid ${l.borderColor}`:void 0,...x(C)},children:w},C))})}),s.length>0&&c("tbody",{children:s.map((w,C)=>c("tr",{children:w.map((B,R)=>c("td",{style:{background:l.cellBackground,color:l.cellColor,padding:"10px 16px",borderBottom:C<s.length-1?`1px solid ${l.borderColor}`:void 0,borderRight:R<w.length-1?`1px solid ${l.borderColor}`:void 0,...x(R)},children:B},R))},C))})]})})})}var Ai={width:1920,height:1080};function Re({block:e,blockTime:t,basePath:n,isEntering:r=false,isExiting:o=false,viewport:i=Ai,isPlaying:a}){let s="",u={};e.transition&&r?(s=Xe(e.transition.type,true),u["--transition-duration"]=`${e.transition.duration}s`):e.transition&&o&&(s=Xe(e.transition.type,false),u["--transition-duration"]=`${e.transition.duration}s`);let l=`vb-clip-${e.id}`;return c("svg",{className:`block-svg ${s}`,style:u,viewBox:`0 0 ${i.width} ${i.height}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden","data-block-id":e.id,children:[c("defs",{children:c("clipPath",{id:l,children:c("rect",{x:"0",y:"0",width:i.width,height:i.height})})}),c("g",{clipPath:`url(#${l})`,children:(e.layers??[]).map(p=>c(Ii,{layer:p,basePath:n,viewport:i,blockTime:t,isPlaying:a},p.id))})]})}function Ii({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){switch(e.type){case "image":return c(Lr,{layer:e,basePath:t,viewport:n,blockTime:r});case "text":return c(Br,{layer:e,viewport:n,blockTime:r});case "shape":return c(Pr,{layer:e,viewport:n,blockTime:r});case "map":return c(Fr,{layer:e,basePath:t,viewport:n,blockTime:r});case "video":return c(Rr,{layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o});case "table":return c(qr,{layer:e,viewport:n,blockTime:r});default:return console.warn(`Unknown layer type: ${e.type}`),null}}var Li=4,$r=2,Bi=6;function Pi(e){if(e.words&&e.words.length>0)return e.words.map(o=>({text:o.text,startTime:o.startTime,endTime:o.endTime}));let t=e.text.split(/\s+/).filter(o=>o.length>0);if(t.length===0)return [];let r=(e.endTime-e.startTime)/t.length;return t.map((o,i)=>({text:o,startTime:e.startTime+i*r,endTime:e.startTime+(i+1)*r}))}function Ei(e){let t=[];for(let o of e.phrases)t.push(...Pi(o));if(t.length===0)return {words:[],chunks:[]};let n=Li;if(t.length>n){let o=Math.ceil(t.length/n);n=Math.ceil(t.length/o),n=Math.min(Bi,Math.max($r,n));}else n=Math.max($r,t.length);let r=[];for(let o=0;o<t.length;o+=n){let i=t.slice(o,o+n);r.push({words:i,startTime:i[0].startTime,endTime:i[i.length-1].endTime});}return {words:t,chunks:r}}function Nr({captions:e,currentTime:t,enabled:n=true,theme:r,viewport:o}){let{chunks:i}=z(()=>e?Ei(e):{words:[],chunks:[]},[e]);if(!n||i.length===0)return c("div",{className:"social-caption-overlay",style:{position:"absolute",bottom:"18%",left:0,right:0,zIndex:50,pointerEvents:"none",opacity:0,transition:"opacity 0.15s ease-in-out"}});let a=null,s=-1;for(let f of i)if(t>=f.startTime&&t<f.endTime){a=f;break}if(!a){for(let f=0;f<i.length-1;f++)if(t>=i[f].endTime&&t<i[f+1].startTime){a=i[f],s=a.words.length-1;break}!a&&i.length>0&&t>=i[i.length-1].startTime&&(a=i[i.length-1],s=a.words.length-1);}if(!a)return null;if(s===-1){for(let f=0;f<a.words.length;f++){let h=a.words[f];if(t>=h.startTime&&t<h.endTime){s=f;break}}if(s===-1){for(let f=a.words.length-1;f>=0;f--)if(t>=a.words[f].startTime){s=f;break}}s===-1&&(s=0);}let u=r?.colors?.primary??"#5b9bd5",l=r?.typography?.titleFontFamily?`"${r.typography.titleFontFamily}", system-ui, sans-serif`:'"PT Serif", Georgia, serif',p=o?.height??720,d=Math.round(p*.055),m=Math.max(24,Math.min(72,d));return c("div",{className:"social-caption-overlay",style:{position:"absolute",bottom:"18%",left:0,right:0,zIndex:50,pointerEvents:"none",textAlign:"center",padding:"0 8%",boxSizing:"border-box",opacity:1,transition:"opacity 0.15s ease-in-out"},children:c("div",{style:{display:"inline-block",lineHeight:1.3},children:a.words.map((f,h)=>{let g=h===s;return c("span",{style:{fontFamily:l,fontSize:`${m}px`,fontWeight:g?800:600,color:g?u:"rgba(255, 255, 255, 0.9)",textShadow:"0 2px 8px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.4)",marginRight:h<a.words.length-1?"0.3em":void 0,transition:"color 0.1s ease, font-weight 0.1s ease",textTransform:"uppercase"},children:f.text},`${f.startTime}-${h}`)})})})}function Dr({captions:e,currentTime:t,enabled:n=true,fontSize:r=16,captionStyle:o="standard",theme:i,viewport:a}){if(o==="social")return c(Nr,{captions:e,currentTime:t,enabled:n,theme:i,viewport:a});let u=(n&&e?He(e,t):null)?.text??null;return c("div",{className:"caption-overlay",style:{position:"absolute",top:"6px",left:"50%",transform:"translateX(-50%)",zIndex:50,pointerEvents:"none",maxWidth:"100%",width:"100%",textAlign:"center",opacity:u?1:0,transition:"opacity 0.15s ease-in-out",padding:"0 4px",boxSizing:"border-box"},children:u&&c("div",{style:{display:"inline-block",padding:"3px 10px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"4px",backdropFilter:"blur(4px)"},children:c("span",{style:{color:"#ffffff",fontSize:`${r}px`,fontFamily:"'Hanken Grotesk', system-ui, sans-serif",fontWeight:500,lineHeight:1.25,textShadow:"0 1px 3px rgba(0,0,0,0.5)",whiteSpace:"pre-wrap",wordWrap:"break-word"},children:u})})})}function zr(e,t,n=""){let[r,o]=U(0),[i,a]=U(false),[s,u]=U(0),[l,p]=U(false),[d,m]=U(false),[f,h]=U(0),g=V([]),y=V(null),v=V(false),x=V(new Map),S=V(new Map),w=V(false);D(()=>{if(!t?.segments)return;let k=0;g.current=t.segments.map(b=>{let _=k;return k+=b.duration,_}),h(k);},[t]);let C=Z(async k=>{let b=n?`${n}/${k}`:k;if(x.current.has(k))return x.current.get(k);if(S.current.has(k))return S.current.get(k);let _=(async()=>{try{let M=await fetch(b);if(!M.ok)throw new Error(`HTTP ${M.status}`);let F=await M.blob(),q=URL.createObjectURL(F);return x.current.set(k,q),q}catch{return b}finally{S.current.delete(k);}})();return S.current.set(k,_),_},[n]);D(()=>{if(!t?.segments)return;t.segments.forEach(b=>{C(b.src);});let k=x.current;return ()=>{k.forEach(b=>{URL.revokeObjectURL(b);}),k.clear();}},[t,C]),D(()=>{let k=e.current;if(!k)return;let b=()=>{let N=(g.current[s]||0)+k.currentTime;o(N);},_=()=>{w.current=false,a(true);},M=()=>a(false),F=()=>{m(true);},q=()=>{t&&s<t.segments.length-1?(v.current=true,u(E=>E+1)):(p(true),a(false));};return k.addEventListener("timeupdate",b),k.addEventListener("play",_),k.addEventListener("pause",M),k.addEventListener("ended",q),k.addEventListener("error",F),()=>{k.removeEventListener("timeupdate",b),k.removeEventListener("play",_),k.removeEventListener("pause",M),k.removeEventListener("ended",q),k.removeEventListener("error",F);}},[e,s,t]),D(()=>{let k=e.current;if(!k||!t?.segments)return;let b=t.segments[s];if(!b)return;let _=()=>{if(y.current!==null){let E=g.current[s]||0,N=y.current-E;k.currentTime=Math.max(0,N),o(y.current),y.current=null;}v.current&&(k.play().catch(()=>{}),v.current=false);},M=k.src,F=x.current.get(b.src);M&&(M===F||M.endsWith(b.src))?_():(async()=>{let N=await C(b.src),oe=()=>{m(true),_(),k.removeEventListener("canplay",oe);};k.addEventListener("canplay",oe),k.src=N,k.load(),await Promise.resolve(),k.readyState>=3&&(k.removeEventListener("canplay",oe),m(true),_());})();},[e,s,t,C]);let B=Z(()=>{let k=e.current;k&&(l&&(u(0),p(false)),k.play().then(()=>{w.current=false;}).catch(()=>{w.current=true,a(true);}));},[e,l]),R=Z(()=>{let k=e.current;k&&k.pause(),a(false);},[e]),$=Z(()=>{e.current&&(i?R():B());},[e,i,B,R]),Y=Z(k=>{let b=e.current;if(!b||!t?.segments)return;let _=f>0?Math.max(0,Math.min(k,f)):Math.max(0,k),M=0,F=0;for(let E=0;E<t.segments.length;E++){let N=F+t.segments[E].duration;if(_<N){M=E;break}F=N,E===t.segments.length-1&&(M=E);}let q=!b.paused;if(p(false),M!==s)y.current=_,v.current=q,u(M);else {let E=_-F;b.currentTime=Math.max(0,E),o(_);}},[e,t,s,f]),W=Z(k=>{!t?.segments||k<0||k>=t.segments.length||(u(k),p(false));},[t]),ae=Z(async()=>{Y(0),await new Promise(k=>setTimeout(k,50)),B();},[Y,B]);return D(()=>{if(!i||!w.current||!f)return;let k=performance.now(),b,_=M=>{if(!w.current)return;let F=(M-k)/1e3;k=M,o(q=>{let E=q+F;return E>=f?(w.current=false,p(true),a(false),f):E}),b=requestAnimationFrame(_);};return b=requestAnimationFrame(_),()=>cancelAnimationFrame(b)},[i,f]),{currentTime:r,isPlaying:i,currentSegment:s,totalDuration:f,isEnded:l,isReady:d,isAvailable:true,play:async()=>B(),pause:async()=>R(),toggle:async()=>$(),seekTo:async k=>Y(k),skipToSegment:async k=>W(k),restart:ae}}function Or(e,t,n=J.landscape,r=false,o){let [i,a]=U({entering:false,exiting:false,previousBlock:null}),s=z(()=>{if(!e?.blocks)return [];let B=e.blocks.some($=>$.children&&$.children.length>0)?mt(e.blocks):e.blocks;if(B.some(ne)){let $=e.audio?.segments?.map(W=>({startTime:W.startTime,duration:W.duration}));return Yt(B,{audioSegments:$,viewport:n,persistentLayers:e.persistentLayers,theme:o})}return B},[e?.blocks,e?.audio?.segments,e?.persistentLayers,n,o]),u=z(()=>Nt(s,t),[s,t]),l=z(()=>u?s.indexOf(u):-1,[s,u]),p=z(()=>u?Math.max(0,t-u.startTime):0,[u,t]),d=z(()=>!u||u.duration===0?0:Math.min(1,p/u.duration),[u,p]),m=z(()=>!e||e.duration===0?0:Math.min(1,t/e.duration),[e,t]);z(()=>u,[l]);D(()=>{if(!(!u||r)&&i.previousBlock?.id!==u.id){let B=u.transition?.duration||0;if(B>0){a({entering:true,exiting:true,previousBlock:i.previousBlock});let R=setTimeout(()=>{a({entering:false,exiting:false,previousBlock:u});},B*1e3);return ()=>clearTimeout(R)}else a({entering:false,exiting:false,previousBlock:u});}},[u?.id,r]);let h=V(null);D(()=>{if(!(!r||!u)&&i.previousBlock?.id!==u.id){let C=i.previousBlock;h.current=C,a(B=>({...B,previousBlock:u}));}},[u?.id,r]);let g=u?.transition?.duration||0,y=r&&g>0&&p<g,v=y&&h.current!==null,x=Z(C=>{if(!e||C<0||C>=s.length)return;let B=s[C];if(B)return B.startTime},[e,s]),S=Z(()=>{if(l<s.length-1)return x(l+1)},[l,s.length,x]),w=Z(()=>{if(l>0)return x(l-1)},[l,x]);return {currentBlock:u,currentBlockIndex:l,previousBlock:r?v?h.current:null:i.exiting?i.previousBlock:null,isEntering:r?y:i.entering,isExiting:r?v:i.exiting,blockTime:p,blockProgress:d,docProgress:m,nextBlock:S,prevBlock:w,goToBlock:x,blocks:s}}function Fi(e,t){let n=e/t;return n>1.2?"landscape":n<.83?"portrait":"landscape"}function Ri(e){switch(e){case "portrait":return J.portrait;case "square":return J.square;default:return J.landscape}}function Wr(){let[e,t]=U(()=>({width:typeof window<"u"?window.innerWidth:1920,height:typeof window<"u"?window.innerHeight:1080}));D(()=>{if(typeof window>"u")return;let o=()=>{t({width:window.innerWidth,height:window.innerHeight});},i,a=()=>{clearTimeout(i),i=setTimeout(o,100);};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),clearTimeout(i);}},[]);let n=z(()=>Fi(e.width,e.height),[e.width,e.height]);return {viewport:z(()=>Ri(n),[n]),orientation:n,windowSize:e}}function Ze(e){let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}function ht({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){let i=V(null),[a,s]=U(null),u=Z(d=>{let m=i.current;if(!m)return;let f=m.getBoundingClientRect(),h=d.clientX-f.left,g=Math.max(0,Math.min(1,h/f.width));s(g);},[]),l=Z(()=>{s(null);},[]),p=Z(d=>{for(let m=r.length-1;m>=0;m--){let f=r[m];if(d>=f.startTime)return {block:f,index:m}}return r.length>0?{block:r[0],index:0}:null},[r]);return c("div",{ref:i,style:{flex:1,height:"24px",cursor:"pointer",position:"relative",display:"flex",alignItems:"center"},onClick:d=>{let m=d.currentTarget.getBoundingClientRect(),h=(d.clientX-m.left)/m.width;t.seekTo(h*e.totalDuration);},onMouseMove:u,onMouseLeave:l,children:[c("div",{style:{position:"absolute",left:0,right:0,height:"6px",background:"rgba(255,255,255,0.2)",borderRadius:"3px"}}),c("div",{style:{position:"absolute",left:0,width:`${e.docProgress*100}%`,height:"6px",background:"#5b9bd5",borderRadius:"3px",transition:"width 0.1s"}}),n.map((d,m)=>c("div",{style:{position:"absolute",left:`${d.position}%`,transform:"translateX(-50%)",width:"10px",height:"10px",borderRadius:"50%",background:d.index===e.currentBlockIndex?"#ffffff":"rgba(255,255,255,0.5)",border:"2px solid #5b9bd5",cursor:"pointer",zIndex:2,transition:"transform 0.15s, background 0.15s"},title:d.title,onClick:f=>{f.stopPropagation(),t.seekTo(d.block.startTime);},onMouseEnter:f=>{f.currentTarget.style.transform="translateX(-50%) scale(1.3)";},onMouseLeave:f=>{f.currentTarget.style.transform="translateX(-50%)";}},`${d.block.id}-${m}`)),a!==null&&c("div",{style:{position:"absolute",left:`${a*100}%`,bottom:"100%",transform:"translateX(-50%)",marginBottom:"8px",padding:"6px 10px",background:"rgba(0,0,0,0.9)",borderRadius:"4px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[c("div",{style:{color:"white",fontSize:"12px",fontFamily:"monospace"},children:Ze(a*e.totalDuration)}),(()=>{let d=a*e.totalDuration,m=p(d);return m&&o?c("div",{style:{color:"rgba(255,255,255,0.7)",fontSize:"11px",marginTop:"2px"},children:o(m.block)}):null})()]}),a!==null&&c("div",{style:{position:"absolute",left:`${a*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"2px",height:"16px",background:"rgba(255,255,255,0.6)",pointerEvents:"none",zIndex:1}})]})}function Hr({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){return c("div",{className:"doc-player__controls",style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 16px",background:"linear-gradient(transparent, rgba(0,0,0,0.8))",display:"flex",alignItems:"center",gap:"8px",zIndex:100},children:[c("button",{onClick:t.restart,style:{background:"none",border:"none",color:"rgba(255,255,255,0.7)",cursor:"pointer",padding:"8px",fontSize:"14px",display:"flex",alignItems:"center"},title:"Restart","aria-label":"Restart from beginning",children:c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"})})}),c("button",{onClick:t.toggle,style:{background:"rgba(255,255,255,0.2)",border:"none",borderRadius:"50%",color:"white",cursor:"pointer",padding:"10px",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px"},"aria-label":e.isPlaying?"Pause":"Play",children:e.isPlaying?c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:c("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}):c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:c("path",{d:"M8 5v14l11-7z"})})}),c("span",{style:{color:"white",fontSize:"12px",minWidth:"80px",fontFamily:"monospace"},children:[Ze(e.currentTime)," / ",Ze(e.totalDuration)]}),c(ht,{state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}),c("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"11px",whiteSpace:"nowrap"},children:[e.currentBlockIndex+1,"/",e.totalBlocks]}),e.hasCaptions&&c("button",{onClick:()=>t.cycleCaptionMode(),style:{background:e.captionMode!=="off"?"rgba(255,255,255,0.2)":"none",border:"none",color:e.captionMode!=="off"?"white":"rgba(255,255,255,0.5)",cursor:"pointer",padding:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px",borderRadius:"4px"},title:e.captionMode==="off"?"Captions: Off (click for Standard)":e.captionMode==="standard"?"Captions: Standard (click for Social)":"Captions: Social (click to turn off)","aria-label":"Cycle caption style",children:[c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z"})}),e.captionMode!=="off"&&c("span",{style:{fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.5px"},children:e.captionMode==="standard"?"CC":"SM"})]}),t.toggleFullscreen&&c("button",{onClick:t.toggleFullscreen,style:{background:e.isFullscreen?"rgba(255,255,255,0.2)":"none",border:"none",color:e.isFullscreen?"white":"rgba(255,255,255,0.5)",cursor:"pointer",padding:"8px",display:"flex",alignItems:"center",borderRadius:"4px"},title:e.isFullscreen?"Exit fullscreen (F)":"Fullscreen (F)","aria-label":e.isFullscreen?"Exit fullscreen":"Enter fullscreen",children:e.isFullscreen?c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})}):c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})}function Ur({state:e,slideNav:t}){let{currentBlockIndex:n,totalBlocks:r}=e,o=n<=0,i=n>=r-1;return c("div",{className:"doc-controls-slideshow","data-testid":"slideshow-controls",style:{position:"absolute",bottom:"16px",right:"16px",display:"flex",alignItems:"center",gap:"2px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"8px",padding:"4px 6px",zIndex:100,userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[c("button",{onClick:a=>{a.stopPropagation(),t.prevSlide();},disabled:o,"data-testid":"slide-prev","aria-label":"Previous slide",title:"Previous slide",style:{background:"none",border:"none",color:o?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.9)",cursor:o?"default":"pointer",padding:"6px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:a=>{o||(a.currentTarget.style.background="rgba(255,255,255,0.1)");},onMouseLeave:a=>{a.currentTarget.style.background="none";},children:c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),c("span",{"data-testid":"slide-counter",style:{color:"rgba(255,255,255,0.9)",fontSize:"13px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontVariantNumeric:"tabular-nums",minWidth:"48px",textAlign:"center",padding:"0 4px",letterSpacing:"0.02em"},children:r>0?`${n+1} / ${r}`:"\u2014"}),c("button",{onClick:a=>{a.stopPropagation(),t.nextSlide();},disabled:i,"data-testid":"slide-next","aria-label":"Next slide",title:"Next slide",style:{background:"none",border:"none",color:i?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.9)",cursor:i?"default":"pointer",padding:"6px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:a=>{i||(a.currentTarget.style.background="rgba(255,255,255,0.1)");},onMouseLeave:a=>{a.currentTarget.style.background="none";},children:c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})})})]})}function ie(e,t=""){return e.map((n,r)=>{let o=`${t}i${r}`;switch(n.type){case "text":return c(te,{children:n.value},o);case "emphasis":return c("em",{className:"squisq-md-em",children:ie(n.children,o)},o);case "strong":return c("strong",{className:"squisq-md-strong",children:ie(n.children,o)},o);case "delete":return c("del",{className:"squisq-md-del",children:ie(n.children,o)},o);case "inlineCode":return c("code",{className:"squisq-md-inline-code",children:n.value},o);case "link":return c("a",{className:"squisq-md-link",href:n.url,title:n.title??void 0,target:"_blank",rel:"noopener noreferrer",children:ie(n.children,o)},o);case "image":return c(Di,{src:n.url,alt:n.alt??"",title:n.title??void 0},o);case "break":return c("br",{},o);case "inlineMath":return c("code",{className:"squisq-md-inline-math",children:n.value},o);case "htmlInline":return c("span",{className:"squisq-md-html-inline",dangerouslySetInnerHTML:{__html:n.rawHtml}},o);case "footnoteReference":return c("sup",{className:"squisq-md-footnote-ref",children:c("a",{href:`#fn-${n.identifier}`,children:["[",n.label??n.identifier,"]"]})},o);case "linkReference":return c("span",{className:"squisq-md-link-ref",children:ie(n.children,o)},o);case "imageReference":return c("span",{className:"squisq-md-image-ref",children:["[",n.alt??n.identifier,"]"]},o);case "textDirective":return c("span",{className:"squisq-md-text-directive","data-directive":n.name,children:ie(n.children,o)},o);default:return null}})}function $i(e,t){switch(e.type){case "paragraph":return c("p",{className:"squisq-md-p",children:ie(e.children,t)},t);case "heading":{let n=`h${e.depth}`;return c(n,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:ie(e.children,t)},t)}case "blockquote":return c("blockquote",{className:"squisq-md-blockquote",children:qe(e.children,t)},t);case "list":return e.ordered?c("ol",{className:"squisq-md-list squisq-md-ol",start:e.start??void 0,children:e.children.map((n,r)=>Vr(n,`${t}li${r}`))},t):c("ul",{className:"squisq-md-list squisq-md-ul",children:e.children.map((n,r)=>Vr(n,`${t}li${r}`))},t);case "code":return c("pre",{className:"squisq-md-code-block",children:c("code",{className:e.lang?`language-${e.lang}`:void 0,children:e.value})},t);case "thematicBreak":return c("hr",{className:"squisq-md-hr"},t);case "table":return Ni(e.children,e.align,t);case "htmlBlock":return c("div",{className:"squisq-md-html-block",dangerouslySetInnerHTML:{__html:e.rawHtml}},t);case "math":return c("pre",{className:"squisq-md-math-block",children:c("code",{children:e.value})},t);case "definition":return null;case "footnoteDefinition":return c("div",{className:"squisq-md-footnote-def",id:`fn-${e.identifier}`,children:[c("sup",{children:e.label??e.identifier}),qe(e.children,t)]},t);case "containerDirective":return c("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:[e.label&&c("div",{className:"squisq-md-directive-label",children:e.label}),qe(e.children,t)]},t);case "leafDirective":return c("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:ie(e.children,t)},t);case "definitionList":return c("dl",{className:"squisq-md-dl",children:e.children.map((n,r)=>n.type==="definitionTerm"?c("dt",{className:"squisq-md-dt",children:ie(n.children,`${t}dt${r}`)},`${t}dt${r}`):c("dd",{className:"squisq-md-dd",children:qe(n.children,`${t}dd${r}`)},`${t}dd${r}`))},t);default:return null}}function Vr(e,t){let n=e.checked!==null&&e.checked!==void 0;return c("li",{className:`squisq-md-li${n?" squisq-md-task":""}`,children:[n&&c("input",{type:"checkbox",checked:!!e.checked,readOnly:true,className:"squisq-md-checkbox"}),qe(e.children,t)]},t)}function Ni(e,t,n){let[r,...o]=e;return c("table",{className:"squisq-md-table",children:[r&&c("thead",{children:c("tr",{children:r.children.map((i,a)=>c("th",{className:"squisq-md-th",style:t?.[a]?{textAlign:t[a]}:void 0,children:ie(i.children,`${n}th${a}`)},`${n}th${a}`))})}),o.length>0&&c("tbody",{children:o.map((i,a)=>c("tr",{children:i.children.map((s,u)=>c("td",{className:"squisq-md-td",style:t?.[u]?{textAlign:t[u]}:void 0,children:ie(s.children,`${n}td${a}-${u}`)},`${n}td${a}-${u}`))},`${n}tr${a}`))})]},n)}function qe(e,t=""){return e.map((n,r)=>$i(n,`${t}b${r}`))}function Di({src:e,alt:t,title:n}){let r=Me(e,".");return c("img",{className:"squisq-md-image",src:r,alt:t,title:n})}function gt({nodes:e,className:t}){return !e||e.length===0?null:c("div",{className:`squisq-md ${t||""}`,children:qe(e)})}function zi(e){let t=e.sourceHeading?.templateAnnotation;return t?!!t.template&&jt(t.template):false}function Yr(e){let t=0;for(let n of e)t++,n.children&&(t+=Yr(n.children));return t}function jr({block:e,basePath:t,viewport:n,renderContext:r,blockIndex:o}){let i=zi(e),a=z(()=>{if(!i)return null;let s=e.sourceHeading.templateAnnotation,u=ye(e.sourceHeading),l=Oi(e.contents),p={id:e.id,template:s.template,startTime:0,duration:1,audioSegment:0,title:u,...Ui(s.template??"sectionHeader",u,l,e.contents),...s.params,...e.templateOverrides},d={...r,blockIndex:o},m=Xt(p,d);return {...e,layers:m,template:s.template}},[e,i,r,o]);return c("div",{className:"squisq-linear-section","data-block-id":e.id,"data-template":i?e.sourceHeading?.templateAnnotation?.template:void 0,children:[e.sourceHeading&&!i&&c(gt,{nodes:[e.sourceHeading]}),i&&a&&c("div",{className:"squisq-linear-card",children:[e.sourceHeading&&c("div",{className:"squisq-linear-card-label squisq-md",children:c(gt,{nodes:[e.sourceHeading]})}),c("div",{className:"squisq-linear-card-svg",style:{width:"100%",aspectRatio:`${n.width} / ${n.height}`,overflow:"hidden",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.12)",marginBottom:"1em"},children:c(Re,{block:a,blockTime:0,basePath:t,viewport:n})})]}),!i&&e.contents&&e.contents.length>0&&c(gt,{nodes:e.contents}),e.children&&e.children.length>0&&c("div",{className:"squisq-linear-children",children:e.children.map((s,u)=>c(jr,{block:s,basePath:t,viewport:n,renderContext:r,blockIndex:o+u+1},s.id))})]})}function Oi(e){return !e||e.length===0?"":e.map(t=>ye(t)).join(`
4
+ `).trim()}function Wi(e){if(!e)return [];let t=[];for(let n of e)if(n.type==="list")for(let r of n.children){let o=ye(r).trim();o&&t.push(o);}return t}function Hi(e){if(!e)return null;for(let t of e)if(t.type==="table"){let n=t,[r,...o]=n.children;if(!r)return null;let i=r.children.map(s=>ye(s).trim()),a=o.map(s=>s.children.map(u=>ye(u).trim()));return {headers:i,rows:a,align:n.align}}return null}function Ui(e,t,n,r){switch(e){case "statHighlight":return {stat:t,description:n||t};case "quoteBlock":case "fullBleedQuote":case "pullQuote":return {quote:n||t};case "factCard":return {fact:t,explanation:n||t};case "comparisonBar":return {leftLabel:"A",leftValue:60,rightLabel:"B",rightValue:40};case "listBlock":{let o=Wi(r);return {items:o.length>0?o:["Item 1","Item 2","Item 3"]}}case "definitionCard":return {term:t,definition:n||t};case "dateEvent":return {date:t,description:n||t};case "dataTable":return Hi(r)??{headers:["Column"],rows:[["Data"]]};default:return {}}}function yt({doc:e,basePath:t="/",viewport:n,className:r,theme:o}){let i=n??J.landscape,a=z(()=>Yr(e.blocks),[e.blocks]),s=z(()=>({theme:o??he,viewport:i,totalBlocks:a}),[i,a,o]),u=s.theme,l=u.colors.background,p=u.colors.text,d=u.colors.textMuted,m=u.colors.primary,f=u.typography.bodyFontFamily,h=u.typography.titleFontFamily,g=u.typography.lineHeight??1.7;return c("div",{className:`squisq-linear ${r||""}`,style:{width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:l},children:c("div",{className:"squisq-linear-content squisq-md",style:{maxWidth:"720px",margin:"0 auto",padding:"24px 16px",lineHeight:g,fontSize:"16px",fontFamily:f,color:p,"--squisq-linear-title-font":h,"--squisq-linear-body-font":f,"--squisq-linear-text":p,"--squisq-linear-muted":d,"--squisq-linear-primary":m,"--squisq-linear-bg":l},children:[c("style",{children:`
4
5
  .squisq-linear-content h1,
5
6
  .squisq-linear-content h2,
6
7
  .squisq-linear-content h3,
@@ -59,6 +60,12 @@ var SquisqPlayer=(function(exports){'use strict';var st,B,vn,ve,bn,kn,wn,Sn,Lt,T
59
60
  border-top: 1px solid var(--squisq-linear-muted);
60
61
  margin: 1.5em 0;
61
62
  }
63
+ .squisq-linear-content img {
64
+ max-width: 100%;
65
+ height: auto;
66
+ border-radius: 6px;
67
+ margin: 0.5em 0;
68
+ }
62
69
  .squisq-linear-content strong {
63
70
  font-weight: 700;
64
71
  }
@@ -86,7 +93,8 @@ var SquisqPlayer=(function(exports){'use strict';var st,B,vn,ve,bn,kn,wn,Sn,Lt,T
86
93
  .squisq-linear-content tbody tr:hover {
87
94
  background: color-mix(in srgb, var(--squisq-linear-primary) 8%, transparent);
88
95
  }
89
- `}),e.blocks.map((y,v)=>l(jr,{block:y,basePath:t,viewport:i,renderContext:s,blockIndex:v},y.id))]})})}var Ui=new Set(["a","an","the","and","but","or","for","nor","on","at","to","in","of","by","is"]);function Xr(e){let t=new Map;for(let n of e.blocks)if(ne(n)&&n.template==="sectionHeader"&&"title"in n){let r=n.audioSegment;t.has(r)||t.set(r,n.title);}for(let n=0;n<e.audio.segments.length;n++)if(!t.has(n)){let r=e.audio.segments[n].name;if(r==="intro"||r.includes("intro"))t.set(n,"Introduction");else if(r==="flight-context"||r.includes("flight-context"))t.set(n,"Flight Context");else {let i=r.split("-").map((a,s)=>s===0||!Ui.has(a)?a.charAt(0).toUpperCase()+a.slice(1):a).join(" ");t.set(n,i);}}return t}function Zr({script:e,basePath:t,renderMode:n=false,autoPlay:r=false,onEnded:o,onTimeUpdate:i,audioProvider:a,showControls:s=true,showScrubber:u=false,muted:c=false,captionsEnabled:p,onCaptionsToggle:d,onPlaybackStateChange:m,onControlsReady:f,isFullscreen:h=false,onFullscreenToggle:g,onBlockMarkers:y,forceViewport:v,displayMode:x="video",theme:S,captionStyle:w="standard"}){let C=x==="slideshow",P=x==="linear",R=V(null),N=V(null),[Y,W]=U(null),ae=V(),{viewport:k,orientation:b}=Wr(),_=v||(n?J.landscape:k),M=$(()=>typeof window>"u"?false:new URLSearchParams(window.location.search).get("debug")==="true",[]),F=zr(R,e.audio,t),q=a||F,{currentTime:E,isPlaying:D,currentSegment:oe,totalDuration:se,isEnded:Qt,isReady:Jt,isAvailable:Qr,unavailableMessage:en,play:Ge,pause:Me,toggle:Ae,seekTo:le,skipToSegment:Ki,restart:tn}=q,_t=V(E);_t.current=E;let nn=V(se);nn.current=se;let rn=V(0),Jr=Z(T=>{if(n||C||P||T.target.closest("button, a, input, .doc-player__controls, .doc-player__scrubber, .doc-controls-sidebar, .doc-controls-slideshow"))return;Ae(),W(D?"play":"pause"),clearTimeout(ae.current),ae.current=setTimeout(()=>W(null),600);},[n,Ae,D,C,P]),{currentBlock:we,currentBlockIndex:_e,previousBlock:on,isEntering:eo,isExiting:to,blockTime:xt,docProgress:vt,blocks:j}=Or(e,E,_,n,S),xe=$(()=>{let T=e.startBlock;if(!T)return null;let A=ge(S??he,0,1,_);return {id:"cover-block",startTime:-1,duration:0,audioSegment:-1,layers:Vt(T,A)}},[e.startBlock,_,S]),[no,an]=U(false),[ro,sn]=U(false),ln=V(),kt=V(false);xe&&!D&&E===0&&!n&&!r&&(kt.current=true),z(()=>{if(D&&kt.current&&xe&&!n)return kt.current=false,sn(true),ln.current=setTimeout(()=>sn(false),3e3),()=>clearTimeout(ln.current)},[D,xe,n]);let Ke=!C&&!P&&xe&&(no||ro||!D&&E===0&&!n&&!r),cn=V(false);z(()=>{Jt&&r&&!cn.current&&(cn.current=true,Ge());},[Jt,r,Ge]),z(()=>{i?.(E);},[E,i]),z(()=>{Qt&&o?.();},[Qt,o]),z(()=>{if((n||M)&&typeof window<"u"){let T=window;T.seekTo=A=>(le(A),new Promise(H=>{requestAnimationFrame(()=>{let Q=0;for(let fe=j.length-1;fe>=0;fe--)if(A>=j[fe].startTime){Q=j[fe].startTime;break}let mn=(A-Q)*1e3;document.getAnimations().forEach(fe=>{let De=fe.effect?.target;De&&(De.closest(".doc-player__block--active")||De.closest(".doc-player__block--previous"))&&(fe.currentTime=Math.max(0,mn));});let ao=A-Q,hn=[],gn=document.querySelector(".doc-player__block--active");gn&&gn.querySelectorAll("video[data-clip-start]").forEach(De=>{let Ie=De,so=parseFloat(Ie.dataset.clipStart||"0"),lo=parseFloat(Ie.dataset.clipEnd||"0"),yn=Math.min(so+Math.max(0,ao),lo);Ie.pause(),Ie.currentTime=yn,hn.push(new Promise(St=>{Math.abs(Ie.currentTime-yn)<.1?St():(Ie.addEventListener("seeked",()=>St(),{once:true}),setTimeout(St,200));}));}),Promise.all(hn).then(()=>{requestAnimationFrame(()=>H());});});})),T.getDuration=()=>{if(se>0)return se;if(j.length>0){let A=j[j.length-1];return A.startTime+A.duration}return 0},T.getBlocks=()=>j.map(A=>({id:A.id,template:A.template??"raw",startTime:A.startTime,duration:A.duration})),T.getAudioSegments=()=>e.audio.segments.map(A=>({src:A.src,name:A.name,duration:A.duration,startTime:A.startTime})),T.getCaptions=()=>e.captions?.phrases?.map(A=>({text:A.text,startTime:A.startTime,endTime:A.endTime}))||[],T.getChapters=()=>{let A=Xr(e);return e.audio.segments.map((H,Q)=>({title:A.get(Q)||H.name,startTime:H.startTime,duration:H.duration}))},T.showCover=()=>(an(true),new Promise(A=>requestAnimationFrame(()=>A()))),T.hideCover=()=>(an(false),new Promise(A=>requestAnimationFrame(()=>A()))),T.hasCoverBlock=()=>!!xe;}return ()=>{if(typeof window<"u"){let T=window;delete T.seekTo,delete T.getDuration,delete T.getBlocks,delete T.getAudioSegments,delete T.getCaptions,delete T.getChapters,delete T.showCover,delete T.hideCover,delete T.hasCoverBlock;}}},[n,M,le,se,j,xe]);let oo=p===false?"off":w||"standard",[Qe,un]=U(oo),Se=Qe!=="off",io=Qe==="social"?"social":"standard",dn=Z(T=>{un(T?w||"standard":"off"),d?.(T);},[d,w]),fn=Z(()=>{un(T=>{let A=T==="off"?"standard":T==="standard"?"social":"off";return d?.(A!=="off"),A});},[d]),Je=e.captions&&e.captions.phrases.length>0,pn=$(()=>Xr(e),[e]),qe=$(()=>({isPlaying:D,currentTime:E,totalDuration:se,currentBlockIndex:_e,totalBlocks:j.length,docProgress:vt,hasCaptions:!!Je,captionsEnabled:Se,captionMode:Qe,isFullscreen:h,currentSegmentIndex:oe,currentSegmentName:pn.get(oe)??e.audio.segments[oe]?.name??null,currentBlock:we??null}),[D,E,se,_e,j.length,vt,Je,Se,Qe,h,oe,pn,we]),et=$(()=>({toggle:Ae,restart:tn,seekTo:le,setCaptionsEnabled:dn,cycleCaptionMode:fn,toggleFullscreen:g}),[Ae,tn,le,dn,fn,g]),Le=$(()=>({nextSlide:()=>{if(_e<j.length-1){let T=j[_e+1];T&&(le(T.startTime),Me());}},prevSlide:()=>{if(_e>0){let T=j[_e-1];T&&(le(T.startTime),Me());}},goToSlide:T=>{if(T>=0&&T<j.length){let A=j[T];A&&(le(A.startTime),Me());}}}),[_e,j,le,Me]);z(()=>{m?.(qe);},[qe,m]),z(()=>{f?.({play:Ge,pause:Me,...et});},[Ge,Me,et,f]);let tt=Z(T=>{let A=T;if(ne(A)){let H=A;if(typeof H.title=="string")return H.title;if(typeof H.stat=="string")return H.stat;if(typeof H.quote=="string"){let Q=H.quote.split(`
96
+ `}),e.blocks.map((y,v)=>c(jr,{block:y,basePath:t,viewport:i,renderContext:s,blockIndex:v},y.id))]})})}var Vi=new Set(["a","an","the","and","but","or","for","nor","on","at","to","in","of","by","is"]);function Xr(e){let t=new Map;for(let n of e.blocks)if(ne(n)&&n.template==="sectionHeader"&&"title"in n){let r=n.audioSegment;t.has(r)||t.set(r,n.title);}for(let n=0;n<e.audio.segments.length;n++)if(!t.has(n)){let r=e.audio.segments[n].name;if(r==="intro"||r.includes("intro"))t.set(n,"Introduction");else if(r==="flight-context"||r.includes("flight-context"))t.set(n,"Flight Context");else {let i=r.split("-").map((a,s)=>s===0||!Vi.has(a)?a.charAt(0).toUpperCase()+a.slice(1):a).join(" ");t.set(n,i);}}return t}function Zr({script:e,basePath:t,renderMode:n=false,autoPlay:r=false,onEnded:o,onTimeUpdate:i,audioProvider:a,showControls:s=true,showScrubber:u=false,muted:l=false,captionsEnabled:p,onCaptionsToggle:d,onPlaybackStateChange:m,onControlsReady:f,isFullscreen:h=false,onFullscreenToggle:g,onBlockMarkers:y,forceViewport:v,displayMode:x="video",theme:S,captionStyle:w="standard"}){let C=x==="slideshow",B=x==="linear",R=V(null),$=V(null),[Y,W]=U(null),ae=V(),{viewport:k,orientation:b}=Wr(),_=v||(n?J.landscape:k),M=z(()=>typeof window>"u"?false:new URLSearchParams(window.location.search).get("debug")==="true",[]),F=zr(R,e.audio,t),q=a||F,{currentTime:E,isPlaying:N,currentSegment:oe,totalDuration:se,isEnded:Qt,isReady:Jt,isAvailable:Qr,unavailableMessage:en,play:Ge,pause:Ae,toggle:Ie,seekTo:le,skipToSegment:Qi,restart:tn}=q,_t=V(E);_t.current=E;let nn=V(se);nn.current=se;let rn=V(0),Jr=Z(T=>{if(n||C||B||T.target.closest("button, a, input, .doc-player__controls, .doc-player__scrubber, .doc-controls-sidebar, .doc-controls-slideshow"))return;Ie(),W(N?"play":"pause"),clearTimeout(ae.current),ae.current=setTimeout(()=>W(null),600);},[n,Ie,N,C,B]),{currentBlock:we,currentBlockIndex:_e,previousBlock:on,isEntering:eo,isExiting:to,blockTime:xt,docProgress:vt,blocks:j}=Or(e,E,_,n,S),xe=z(()=>{let T=e.startBlock;if(!T)return null;let A=ge(S??he,0,1,_);return {id:"cover-block",startTime:-1,duration:0,audioSegment:-1,layers:Vt(T,A)}},[e.startBlock,_,S]),[no,an]=U(false),[ro,sn]=U(false),ln=V(),kt=V(false);xe&&!N&&E===0&&!n&&!r&&(kt.current=true),D(()=>{N&&kt.current&&xe&&!n&&(kt.current=false,sn(true),ln.current=setTimeout(()=>sn(false),3e3));},[N,xe,n]),D(()=>()=>clearTimeout(ln.current),[]);let Ke=!C&&!B&&xe&&(no||ro||!N&&E===0&&!n&&!r),cn=V(false);D(()=>{Jt&&r&&!cn.current&&(cn.current=true,Ge());},[Jt,r,Ge]),D(()=>{i?.(E);},[E,i]),D(()=>{Qt&&o?.();},[Qt,o]),D(()=>{if((n||M)&&typeof window<"u"){let T=window;T.seekTo=A=>(le(A),new Promise(H=>{requestAnimationFrame(()=>{let Q=0;for(let fe=j.length-1;fe>=0;fe--)if(A>=j[fe].startTime){Q=j[fe].startTime;break}let mn=(A-Q)*1e3;document.getAnimations().forEach(fe=>{let De=fe.effect?.target;De&&(De.closest(".doc-player__block--active")||De.closest(".doc-player__block--previous"))&&(fe.currentTime=Math.max(0,mn));});let ao=A-Q,hn=[],gn=document.querySelector(".doc-player__block--active");gn&&gn.querySelectorAll("video[data-clip-start]").forEach(De=>{let Be=De,so=parseFloat(Be.dataset.clipStart||"0"),lo=parseFloat(Be.dataset.clipEnd||"0"),yn=Math.min(so+Math.max(0,ao),lo);Be.pause(),Be.currentTime=yn,hn.push(new Promise(St=>{Math.abs(Be.currentTime-yn)<.1?St():(Be.addEventListener("seeked",()=>St(),{once:true}),setTimeout(St,200));}));}),Promise.all(hn).then(()=>{requestAnimationFrame(()=>H());});});})),T.getDuration=()=>{if(se>0)return se;if(j.length>0){let A=j[j.length-1];return A.startTime+A.duration}return 0},T.getBlocks=()=>j.map(A=>({id:A.id,template:A.template??"raw",startTime:A.startTime,duration:A.duration})),T.getAudioSegments=()=>e.audio.segments.map(A=>({src:A.src,name:A.name,duration:A.duration,startTime:A.startTime})),T.getCaptions=()=>e.captions?.phrases?.map(A=>({text:A.text,startTime:A.startTime,endTime:A.endTime}))||[],T.getChapters=()=>{let A=Xr(e);return e.audio.segments.map((H,Q)=>({title:A.get(Q)||H.name,startTime:H.startTime,duration:H.duration}))},T.showCover=()=>(an(true),new Promise(A=>requestAnimationFrame(()=>A()))),T.hideCover=()=>(an(false),new Promise(A=>requestAnimationFrame(()=>A()))),T.hasCoverBlock=()=>!!xe;}return ()=>{if(typeof window<"u"){let T=window;delete T.seekTo,delete T.getDuration,delete T.getBlocks,delete T.getAudioSegments,delete T.getCaptions,delete T.getChapters,delete T.showCover,delete T.hideCover,delete T.hasCoverBlock;}}},[n,M,le,se,j,xe]);let oo=p===false?"off":w||"standard",[Qe,un]=U(oo),Se=Qe!=="off",io=Qe==="social"?"social":"standard",dn=Z(T=>{un(T?w||"standard":"off"),d?.(T);},[d,w]),fn=Z(()=>{un(T=>{let A=T==="off"?"standard":T==="standard"?"social":"off";return d?.(A!=="off"),A});},[d]),Je=e.captions&&e.captions.phrases.length>0,pn=z(()=>Xr(e),[e]),$e=z(()=>({isPlaying:N,currentTime:E,totalDuration:se,currentBlockIndex:_e,totalBlocks:j.length,docProgress:vt,hasCaptions:!!Je,captionsEnabled:Se,captionMode:Qe,isFullscreen:h,currentSegmentIndex:oe,currentSegmentName:pn.get(oe)??e.audio.segments[oe]?.name??null,currentBlock:we??null}),[N,E,se,_e,j.length,vt,Je,Se,Qe,h,oe,pn,we]),et=z(()=>({toggle:Ie,restart:tn,seekTo:le,setCaptionsEnabled:dn,cycleCaptionMode:fn,toggleFullscreen:g}),[Ie,tn,le,dn,fn,g]),Le=z(()=>({nextSlide:()=>{if(_e<j.length-1){let T=j[_e+1];T&&(le(T.startTime),Ae());}},prevSlide:()=>{if(_e>0){let T=j[_e-1];T&&(le(T.startTime),Ae());}},goToSlide:T=>{if(T>=0&&T<j.length){let A=j[T];A&&(le(A.startTime),Ae());}}}),[_e,j,le,Ae]);D(()=>{m?.($e);},[$e,m]),D(()=>{f?.({play:Ge,pause:Ae,...et});},[Ge,Ae,et,f]);let tt=Z(T=>{let A=T;if(ne(A)){let H=A;if(typeof H.title=="string")return H.title;if(typeof H.stat=="string")return H.stat;if(typeof H.quote=="string"){let Q=H.quote.split(`
90
97
  `)[0];return Q.length<=30?Q:Q.slice(0,27)+"..."}if(typeof H.date=="string")return H.date;if(typeof H.fact=="string")return H.fact}if(T.layers&&Array.isArray(T.layers)){let H=T.layers.find(Q=>Q.type==="text");if(H?.content?.text){let Q=H.content.text.split(`
91
- `)[0];return Q.length<=30?Q:Q.slice(0,27)+"..."}}return T.id.replace(/-/g," ").replace(/\b\w/g,H=>H.toUpperCase())},[]),Ne=$(()=>{if(!se||!j.length)return [];let T=-1;return j.map((A,H)=>{let Q=A.audioSegment!==T;return T=A.audioSegment,{block:A,index:H,position:A.startTime/se*100,title:tt(A),isSectionStart:Q}})},[j,se,tt]);z(()=>{Ne.length>0&&y?.(Ne);},[Ne,y]),rn.current=j.length;let wt=Z(T=>{let A=document.activeElement;if(!(A&&(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.tagName==="SELECT"))&&!P)if(C)switch(T.key){case "ArrowRight":case "ArrowDown":case " ":T.preventDefault(),Le.nextSlide();break;case "ArrowLeft":case "ArrowUp":T.preventDefault(),Le.prevSlide();break;case "Home":T.preventDefault(),Le.goToSlide(0);break;case "End":T.preventDefault(),Le.goToSlide(rn.current-1);break}else switch(T.key){case " ":T.preventDefault(),Ae();break;case "ArrowRight":le(Math.min(_t.current+10,nn.current));break;case "ArrowLeft":le(Math.max(_t.current-10,0));break}},[C,P,Ae,le,Le]);return z(()=>{if(!n)return window.addEventListener("keydown",wt),()=>window.removeEventListener("keydown",wt)},[wt,n]),P?l("div",{ref:N,className:"doc-player doc-player--linear",style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:l(yt,{doc:e,basePath:t,viewport:_})}):l("div",{ref:N,className:"doc-player",onClick:Jr,style:{position:"relative",width:"100%",aspectRatio:`${_.width} / ${_.height}`,margin:"0 auto",overflow:"hidden",cursor:n?void 0:"pointer"},children:[l("audio",{ref:R,preload:"auto",muted:c}),l("div",{className:"doc-player__viewport",children:[Ke&&xe&&l("div",{className:"doc-player__block doc-player__block--cover",children:l(Fe,{block:xe,blockTime:0,basePath:t,isEntering:false,viewport:_})}),!Ke&&on&&to&&l("div",{className:"doc-player__block doc-player__block--previous",children:l(Fe,{block:on,blockTime:xt,basePath:t,isExiting:true,viewport:_})}),!Ke&&we&&l("div",{className:"doc-player__block doc-player__block--active",children:l(Fe,{block:we,blockTime:xt,basePath:t,isEntering:eo,viewport:_,isPlaying:D})}),Je&&(n?Se:true)&&l($r,{captions:e.captions,currentTime:E,enabled:Se&&(n||D||E>0),fontSize:16,captionStyle:io,theme:S,viewport:_}),M&&l("div",{className:"doc-player__debug",style:{position:"absolute",top:"8px",right:"8px",padding:"8px 12px",background:"rgba(0, 0, 0, 0.85)",borderRadius:"6px",color:"#00ff00",fontFamily:"monospace",fontSize:"11px",lineHeight:"1.5",zIndex:200,maxWidth:"280px",pointerEvents:"none",textAlign:"left"},children:[l("div",{style:{color:"#ffcc00",fontWeight:"bold",marginBottom:"4px"},children:"DEBUG MODE"}),l("div",{children:[l("span",{style:{color:"#888"},children:"template:"})," ",l("span",{style:{color:"#ff6b6b"},children:we?.template??"raw"})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"block:"})," ",_e+1,"/",j.length," ",l("span",{style:{color:"#666"},children:["(",we?.id||"none",")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"time:"})," ",E.toFixed(2),"s /"," ",se.toFixed(1),"s"," ",l("span",{style:{color:"#666"},children:["(progress: ",(vt*100).toFixed(1),"%, scriptDur:"," ",e.duration.toFixed(1),")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"blockTime:"})," ",xt.toFixed(2),"s /"," ",(we?.duration||0).toFixed(1),"s"]}),l("div",{children:[l("span",{style:{color:"#888"},children:"segment:"})," ",oe,"/",e.audio.segments.length-1," ",l("span",{style:{color:"#666"},children:["(",e.audio.segments[oe]?.name||"none",")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"viewport:"})," ",_.name||`${_.width}x${_.height}`," ",l("span",{style:{color:"#666"},children:["(",b,")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"playing:"})," ",l("span",{style:{color:D?"#4ade80":"#f87171"},children:D?"yes":"no"}),Ke&&l("span",{style:{color:"#60a5fa"},children:" (cover)"})]}),Je&&(()=>{let T=We(e.captions,E),A=Se&&(D||E>0);return l(te,{children:[l("div",{children:[l("span",{style:{color:"#888"},children:"captions:"})," ",e.captions?.phrases.length||0," phrases"," ",l("span",{style:{color:Se?"#4ade80":"#666"},children:["(",Se?"on":"off",")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"cc.enabled:"})," ",l("span",{style:{color:A?"#4ade80":"#f87171"},children:String(A)})," ",l("span",{style:{color:"#666"},children:["(playing=",String(D)," t>0=",String(E>0),")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"cc.phrase:"})," ",l("span",{style:{color:T?"#4ade80":"#f87171"},children:T?`"${T.text.slice(0,30)}..."`:"null"})]}),T&&l("div",{children:[l("span",{style:{color:"#888"},children:"cc.range:"})," ",l("span",{style:{color:"#60a5fa"},children:[T.startTime.toFixed(2),"-",T.endTime.toFixed(2)]})]})]})})()]})]}),!Qr&&en&&l("div",{className:"doc-player__unavailable",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"16px",background:"rgba(0, 0, 0, 0.7)",color:"rgba(255, 255, 255, 0.9)",fontSize:"14px",zIndex:50},children:[l("span",{style:{fontSize:"32px"},children:"\u{1F50A}"}),l("span",{children:en})]}),!n&&!C&&s&&l(Hr,{state:qe,actions:et,blockMarkers:Ne,expandedBlocks:j,getBlockTitle:tt}),!n&&!C&&!s&&u&&l("div",{className:"doc-player__scrubber",style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 16px 8px",background:"linear-gradient(transparent, rgba(0,0,0,0.6))",display:"flex",alignItems:"center",zIndex:100},children:l(ht,{state:qe,actions:et,blockMarkers:Ne,expandedBlocks:j,getBlockTitle:tt})}),!n&&C&&l(Ur,{state:qe,slideNav:Le}),!C&&Y&&l("div",{className:"doc-player__tap-feedback",children:l("svg",{viewBox:"0 0 24 24",fill:"white",width:"48",height:"48",children:Y==="pause"?l("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}):l("path",{d:"M8 5v14l11-7z"})})},Date.now())]})}var Gr={};var Kr=false;function Yi(){if(Kr||typeof document>"u")return;let e=document.createElement("style");e.setAttribute("data-squisq-player","animations"),e.textContent=Gr,document.head.appendChild(e),Kr=true;}function ji(e,t){return {async resolveUrl(n){return n in e?e[n]:n.startsWith("http")||n.startsWith("data:")||n.startsWith("blob:")?n:`${t}/${n}`},async listMedia(){return Object.keys(e).map(n=>({name:n,mimeType:Xi(n),size:0}))},async addMedia(){throw new Error("Standalone player is read-only")},async removeMedia(){throw new Error("Standalone player is read-only")},dispose(){}}}function Xi(e){let t=e.split(".").pop()?.toLowerCase()??"";return {jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp3:"audio/mpeg",mp4:"video/mp4",webm:"video/webm"}[t]??"application/octet-stream"}function Zi(e,t){if(!e.audio?.segments?.length)return e;let n=e.audio.segments.map(r=>{let o=t[r.name]??t[r.src]??r.src;return {...r,src:o}});return {...e,audio:{...e.audio,segments:n}}}var bt=new WeakMap;function Gi(e,t,n={}){Yi();let{mode:r="slideshow",basePath:o=".",images:i,audio:a,autoPlay:s=false,theme:u,renderMode:c=false,captionStyle:p}=n,d=a?Zi(t,a):t,m=i?ji(i,o):null,f;r==="static"?f=me(yt,{doc:d,basePath:o,theme:u}):f=me(Zr,{script:d,basePath:o,displayMode:"slideshow",autoPlay:c?false:s,showControls:!c,renderMode:c,theme:u,captionsEnabled:!!p,captionStyle:p??"standard"}),m&&(f=me(Zt.Provider,{value:m},f));let h=bt.get(e);h||(h=ir(e),bt.set(e,h)),h.render(f);}function Ac(e,t,n={}){Gi(e,t,{...n,mode:"static"});}function Lc(e){let t=bt.get(e);t&&(t.unmount(),bt.delete(e));}var Ic="1.0.3";exports.mount=Gi;exports.mountStatic=Ac;exports.unmount=Lc;exports.version=Ic;return exports;})({});//# sourceMappingURL=squisq-player.global.js.map
98
+ `)[0];return Q.length<=30?Q:Q.slice(0,27)+"..."}}return T.id.replace(/-/g," ").replace(/\b\w/g,H=>H.toUpperCase())},[]),Ne=z(()=>{if(!se||!j.length)return [];let T=-1;return j.map((A,H)=>{let Q=A.audioSegment!==T;return T=A.audioSegment,{block:A,index:H,position:A.startTime/se*100,title:tt(A),isSectionStart:Q}})},[j,se,tt]);D(()=>{Ne.length>0&&y?.(Ne);},[Ne,y]),rn.current=j.length;let wt=Z(T=>{let A=document.activeElement;if(!(A&&(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.tagName==="SELECT"))&&!B)if(C)switch(T.key){case "ArrowRight":case "ArrowDown":case " ":T.preventDefault(),Le.nextSlide();break;case "ArrowLeft":case "ArrowUp":T.preventDefault(),Le.prevSlide();break;case "Home":T.preventDefault(),Le.goToSlide(0);break;case "End":T.preventDefault(),Le.goToSlide(rn.current-1);break}else switch(T.key){case " ":T.preventDefault(),Ie();break;case "ArrowRight":le(Math.min(_t.current+10,nn.current));break;case "ArrowLeft":le(Math.max(_t.current-10,0));break}},[C,B,Ie,le,Le]);return D(()=>{if(!n)return window.addEventListener("keydown",wt),()=>window.removeEventListener("keydown",wt)},[wt,n]),B?c("div",{ref:$,className:"doc-player doc-player--linear",style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:c(yt,{doc:e,basePath:t,viewport:_})}):c("div",{ref:$,className:"doc-player",onClick:Jr,style:{position:"relative",width:"100%",aspectRatio:`${_.width} / ${_.height}`,margin:"0 auto",overflow:"hidden",cursor:n?void 0:"pointer"},children:[c("audio",{ref:R,preload:"auto",muted:l}),c("div",{className:"doc-player__viewport",children:[Ke&&xe&&c("div",{className:"doc-player__block doc-player__block--cover",children:c(Re,{block:xe,blockTime:0,basePath:t,isEntering:false,viewport:_})}),!Ke&&on&&to&&c("div",{className:"doc-player__block doc-player__block--previous",children:c(Re,{block:on,blockTime:xt,basePath:t,isExiting:true,viewport:_})}),!Ke&&we&&c("div",{className:"doc-player__block doc-player__block--active",children:c(Re,{block:we,blockTime:xt,basePath:t,isEntering:eo,viewport:_,isPlaying:N})}),Je&&(n?Se:true)&&c(Dr,{captions:e.captions,currentTime:E,enabled:Se&&(n||N||E>0),fontSize:16,captionStyle:io,theme:S,viewport:_}),M&&c("div",{className:"doc-player__debug",style:{position:"absolute",top:"8px",right:"8px",padding:"8px 12px",background:"rgba(0, 0, 0, 0.85)",borderRadius:"6px",color:"#00ff00",fontFamily:"monospace",fontSize:"11px",lineHeight:"1.5",zIndex:200,maxWidth:"280px",pointerEvents:"none",textAlign:"left"},children:[c("div",{style:{color:"#ffcc00",fontWeight:"bold",marginBottom:"4px"},children:"DEBUG MODE"}),c("div",{children:[c("span",{style:{color:"#888"},children:"template:"})," ",c("span",{style:{color:"#ff6b6b"},children:we?.template??"raw"})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"block:"})," ",_e+1,"/",j.length," ",c("span",{style:{color:"#666"},children:["(",we?.id||"none",")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"time:"})," ",E.toFixed(2),"s /"," ",se.toFixed(1),"s"," ",c("span",{style:{color:"#666"},children:["(progress: ",(vt*100).toFixed(1),"%, scriptDur:"," ",e.duration.toFixed(1),")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"blockTime:"})," ",xt.toFixed(2),"s /"," ",(we?.duration||0).toFixed(1),"s"]}),c("div",{children:[c("span",{style:{color:"#888"},children:"segment:"})," ",oe,"/",e.audio.segments.length-1," ",c("span",{style:{color:"#666"},children:["(",e.audio.segments[oe]?.name||"none",")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"viewport:"})," ",_.name||`${_.width}x${_.height}`," ",c("span",{style:{color:"#666"},children:["(",b,")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"playing:"})," ",c("span",{style:{color:N?"#4ade80":"#f87171"},children:N?"yes":"no"}),Ke&&c("span",{style:{color:"#60a5fa"},children:" (cover)"})]}),Je&&(()=>{let T=He(e.captions,E),A=Se&&(N||E>0);return c(te,{children:[c("div",{children:[c("span",{style:{color:"#888"},children:"captions:"})," ",e.captions?.phrases.length||0," phrases"," ",c("span",{style:{color:Se?"#4ade80":"#666"},children:["(",Se?"on":"off",")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"cc.enabled:"})," ",c("span",{style:{color:A?"#4ade80":"#f87171"},children:String(A)})," ",c("span",{style:{color:"#666"},children:["(playing=",String(N)," t>0=",String(E>0),")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"cc.phrase:"})," ",c("span",{style:{color:T?"#4ade80":"#f87171"},children:T?`"${T.text.slice(0,30)}..."`:"null"})]}),T&&c("div",{children:[c("span",{style:{color:"#888"},children:"cc.range:"})," ",c("span",{style:{color:"#60a5fa"},children:[T.startTime.toFixed(2),"-",T.endTime.toFixed(2)]})]})]})})()]})]}),!Qr&&en&&c("div",{className:"doc-player__unavailable",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"16px",background:"rgba(0, 0, 0, 0.7)",color:"rgba(255, 255, 255, 0.9)",fontSize:"14px",zIndex:50},children:[c("span",{style:{fontSize:"32px"},children:"\u{1F50A}"}),c("span",{children:en})]}),!n&&!C&&s&&c(Hr,{state:$e,actions:et,blockMarkers:Ne,expandedBlocks:j,getBlockTitle:tt}),!n&&!C&&!s&&u&&c("div",{className:"doc-player__scrubber",style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 16px 8px",background:"linear-gradient(transparent, rgba(0,0,0,0.6))",display:"flex",alignItems:"center",zIndex:100},children:c(ht,{state:$e,actions:et,blockMarkers:Ne,expandedBlocks:j,getBlockTitle:tt})}),!n&&C&&c(Ur,{state:$e,slideNav:Le}),!C&&Y&&c("div",{className:"doc-player__tap-feedback",children:c("svg",{viewBox:"0 0 24 24",fill:"white",width:"48",height:"48",children:Y==="pause"?c("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}):c("path",{d:"M8 5v14l11-7z"})})},Date.now())]})}var Gr={};var Kr=false;function ji(){if(Kr||typeof document>"u")return;let e=document.createElement("style");e.setAttribute("data-squisq-player","animations"),e.textContent=Gr,document.head.appendChild(e),Kr=true;}function Xi(e,t){let n={};for(let r of Object.keys(e)){let o=r.split("/").pop();n[o]=e[r];}return {async resolveUrl(r){if(r in e)return e[r];let o=r.replace(/^\.\//,"");if(o!==r&&o in e)return e[o];let i=r.split("/").pop();return i in n?n[i]:r.startsWith("http")||r.startsWith("data:")||r.startsWith("blob:")?r:`${t}/${r}`},async listMedia(){return Object.keys(e).map(r=>({name:r,mimeType:Zi(r),size:0}))},async addMedia(){throw new Error("Standalone player is read-only")},async removeMedia(){throw new Error("Standalone player is read-only")},dispose(){}}}function Zi(e){let t=e.split(".").pop()?.toLowerCase()??"";return {jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp3:"audio/mpeg",mp4:"video/mp4",webm:"video/webm"}[t]??"application/octet-stream"}function Gi(e,t){if(!e.audio?.segments?.length)return e;let n=e.audio.segments.map(r=>{let o=t[r.name]??t[r.src]??r.src;return {...r,src:o}});return {...e,audio:{...e.audio,segments:n}}}var bt=new WeakMap;function Ki(e,t,n={}){ji();let{mode:r="slideshow",basePath:o=".",images:i,audio:a,autoPlay:s=false,theme:u,renderMode:l=false,captionStyle:p}=n,d=a?Gi(t,a):t,m=i?Xi(i,o):null,f;r==="static"?f=me(yt,{doc:d,basePath:o,theme:u}):f=me(Zr,{script:d,basePath:o,displayMode:"slideshow",autoPlay:l?false:s,showControls:!l,renderMode:l,theme:u,captionsEnabled:!!p,captionStyle:p??"standard"}),m&&(f=me(Zt.Provider,{value:m},f));let h=bt.get(e);h||(h=ir(e),bt.set(e,h)),h.render(f);}function Lc(e,t,n={}){Ki(e,t,{...n,mode:"static"});}function Bc(e){let t=bt.get(e);t&&(t.unmount(),bt.delete(e));}var Pc="1.1.1";
99
+ exports.mount=Ki;exports.mountStatic=Lc;exports.unmount=Bc;exports.version=Pc;return exports;})({});//# sourceMappingURL=squisq-player.global.js.map
92
100
  //# sourceMappingURL=squisq-player.global.js.map