@beyondwords/player 0.0.0-beta26 → 0.0.0-beta27

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.
package/dist/umd.js CHANGED
@@ -2,7 +2,7 @@
2
2
  (function(ue,mt){typeof exports=="object"&&typeof module!="undefined"?module.exports=mt():typeof define=="function"&&define.amd?define(mt):(ue=typeof globalThis!="undefined"?globalThis:ue||self,ue.BeyondWords=mt())})(this,function(){var ma,mu,po,oh,pa,_o,lh,yo,uh,_a,bo,ch,So,dh,ya,To,fh,ko,hh,Eo,gh,Ao,vh,xo,mh,ba,pu,Po,ph,wo,_h,Dr,En,fn,ls,ar,wr,Co,yh,ts,Pa,hn,us,Lo,bh,Sa,_u,Zr,Hn,Ta,yu,gn,cs,Li,er,vn,ds,Jr,Kn,Io,Sh,Ro,Th,is,wa,ka,bu,Do,kh,Oo,Eh,Bo,Ah,Mo,xh,Mn,hf;"use strict";var mE=Object.defineProperty,pE=Object.defineProperties;var _E=Object.getOwnPropertyDescriptors;var Yo=Object.getOwnPropertySymbols;var nh=Object.prototype.hasOwnProperty,sh=Object.prototype.propertyIsEnumerable;var rh=(ue,mt,bt)=>mt in ue?mE(ue,mt,{enumerable:!0,configurable:!0,writable:!0,value:bt}):ue[mt]=bt,fe=(ue,mt)=>{for(var bt in mt||(mt={}))nh.call(mt,bt)&&rh(ue,bt,mt[bt]);if(Yo)for(var bt of Yo(mt))sh.call(mt,bt)&&rh(ue,bt,mt[bt]);return ue},ti=(ue,mt)=>pE(ue,_E(mt));var gu=(ue,mt)=>{var bt={};for(var Bi in ue)nh.call(ue,Bi)&&mt.indexOf(Bi)<0&&(bt[Bi]=ue[Bi]);if(ue!=null&&Yo)for(var Bi of Yo(ue))mt.indexOf(Bi)<0&&sh.call(ue,Bi)&&(bt[Bi]=ue[Bi]);return bt};var vu=(ue,mt,bt)=>{if(!mt.has(ue))throw TypeError("Cannot "+bt)};var Vr=(ue,mt,bt)=>(vu(ue,mt,"read from private field"),bt?bt.call(ue):mt.get(ue)),ht=(ue,mt,bt)=>{if(mt.has(ue))throw TypeError("Cannot add the same private member more than once");mt instanceof WeakSet?mt.add(ue):mt.set(ue,bt)},ah=(ue,mt,bt,Bi)=>(vu(ue,mt,"write to private field"),Bi?Bi.call(ue,bt):mt.set(ue,bt),bt);var de=(ue,mt,bt)=>(vu(ue,mt,"access private method"),bt);var on=(ue,mt,bt)=>new Promise((Bi,qs)=>{var Zt=Sr=>{try{Xe(bt.next(Sr))}catch(Cr){qs(Cr)}},An=Sr=>{try{Xe(bt.throw(Sr))}catch(Cr){qs(Cr)}},Xe=Sr=>Sr.done?Bi(Sr.value):Promise.resolve(Sr.value).then(Zt,An);Xe((bt=bt.apply(ue,mt)).next())});function ue(){}const mt=t=>t;function bt(t,e){for(const i in e)t[i]=e[i];return t}function Bi(t){return t()}function qs(){return Object.create(null)}function Zt(t){t.forEach(Bi)}function An(t){return typeof t=="function"}function Xe(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Sr;function Cr(t,e){return Sr||(Sr=document.createElement("a")),Sr.href=e,t===Sr.href}function Ph(t){return Object.keys(t).length===0}function fs(t,e,i,n){if(t){const a=Su(t,e,i,n);return t[0](a)}}function Su(t,e,i,n){return t[1]&&n?bt(i.ctx.slice(),t[1](n(e))):i.ctx}function hs(t,e,i,n){if(t[2]&&n){const a=t[2](n(i));if(e.dirty===void 0)return a;if(typeof a=="object"){const l=[],g=Math.max(e.dirty.length,a.length);for(let p=0;p<g;p+=1)l[p]=e.dirty[p]|a[p];return l}return e.dirty|a}return e.dirty}function gs(t,e,i,n,a,l){if(a){const g=Su(e,i,n,l);t.p(g,a)}}function vs(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function Tu(t){return t==null?"":t}function ku(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const Eu=typeof window!="undefined";let wh=Eu?()=>window.performance.now():()=>Date.now(),Ca=Eu?t=>requestAnimationFrame(t):ue;const ms=new Set;function Au(t){ms.forEach(e=>{e.c(t)||(ms.delete(e),e.f())}),ms.size!==0&&Ca(Au)}function Ch(t){let e;return ms.size===0&&Ca(Au),{promise:new Promise(i=>{ms.add(e={c:t,f:i})}),abort(){ms.delete(e)}}}const Lh=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function I(t,e){t.appendChild(e)}function xu(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Ih(t){const e=N("style");return Rh(xu(t),e),e.sheet}function Rh(t,e){return I(t.head||t,e),e.sheet}function te(t,e,i){t.insertBefore(e,i||null)}function $(t){t.parentNode&&t.parentNode.removeChild(t)}function xn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function N(t){return document.createElement(t)}function et(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Ie(t){return document.createTextNode(t)}function Pe(){return Ie(" ")}function Yn(){return Ie("")}function me(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function nt(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function Dh(t){return Array.from(t.childNodes)}function dr(t,e){e=""+e,t.data!==e&&(t.data=e)}function St(t,e){t.value=e==null?"":e}function wi(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function lt(t,e,i){for(let n=0;n<t.options.length;n+=1){const a=t.options[n];if(a.__value===e){a.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function mi(t){const e=t.querySelector(":checked");return e&&e.__value}let La;function Oh(){if(La===void 0){La=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){La=!0}}return La}function Bh(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=N("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const a=Oh();let l;return a?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",l=me(window,"message",g=>{g.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{l=me(n.contentWindow,"resize",e),e()}),I(t,n),()=>{(a||l&&n.contentWindow)&&l(),$(n)}}function Ye(t,e,i){t.classList[i?"add":"remove"](e)}function Mh(t,e,{bubbles:i=!1,cancelable:n=!1}={}){const a=document.createEvent("CustomEvent");return a.initCustomEvent(t,i,n,e),a}const Ia=new Map;let Ra=0;function Nh(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function Fh(t,e){const i={stylesheet:Ih(e),rules:{}};return Ia.set(t,i),i}function Pu(t,e,i,n,a,l,g,p=0){const _=16.666/n;let T=`{
3
3
  `;for(let H=0;H<=1;H+=_){const oe=e+(i-e)*l(H);T+=H*100+`%{${g(oe,1-oe)}}
4
4
  `}const k=T+`100% {${g(i,1-i)}}
5
- }`,C=`__svelte_${Nh(k)}_${p}`,F=xu(t),{stylesheet:U,rules:V}=Ia.get(F)||Fh(F,t);V[C]||(V[C]=!0,U.insertRule(`@keyframes ${C} ${k}`,U.cssRules.length));const z=t.style.animation||"";return t.style.animation=`${z?`${z}, `:""}${C} ${n}ms linear ${a}ms 1 both`,Ra+=1,C}function Uh(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),a=i.length-n.length;a&&(t.style.animation=n.join(", "),Ra-=a,Ra||Vh())}function Vh(){Ca(()=>{Ra||(Ia.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&$(e)}),Ia.clear())})}let Xs;function Zs(t){Xs=t}function wu(){if(!Xs)throw new Error("Function called outside component initialization");return Xs}function qo(t){wu().$$.on_mount.push(t)}function Wh(t){wu().$$.on_destroy.push(t)}const ps=[],Fe=[];let _s=[];const Xo=[],Cu=Promise.resolve();let Zo=!1;function Lu(){Zo||(Zo=!0,Cu.then(P))}function jh(){return Lu(),Cu}function Mt(t){_s.push(t)}function Qe(t){Xo.push(t)}const Jo=new Set;let ys=0;function P(){if(ys!==0)return;const t=Xs;do{try{for(;ys<ps.length;){const e=ps[ys];ys++,Zs(e),Gh(e.$$)}}catch(e){throw ps.length=0,ys=0,e}for(Zs(null),ps.length=0,ys=0;Fe.length;)Fe.pop()();for(let e=0;e<_s.length;e+=1){const i=_s[e];Jo.has(i)||(Jo.add(i),i())}_s.length=0}while(ps.length);for(;Xo.length;)Xo.pop()();Zo=!1,Jo.clear(),Zs(t)}function Gh(t){if(t.fragment!==null){t.update(),Zt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Mt)}}function zh(t){const e=[],i=[];_s.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),_s=e}let Js;function Hh(){return Js||(Js=Promise.resolve(),Js.then(()=>{Js=null})),Js}function Qo(t,e,i){t.dispatchEvent(Mh(`${e?"intro":"outro"}${i}`))}const Da=new Set;let ln;function Et(){ln={r:0,c:[],p:ln}}function At(){ln.r||Zt(ln.c),ln=ln.p}function X(t,e){t&&t.i&&(Da.delete(t),t.i(e))}function se(t,e,i,n){if(t&&t.o){if(Da.has(t))return;Da.add(t),ln.c.push(()=>{Da.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Kh={duration:0};function Iu(t,e,i,n){const a={direction:"both"};let l=e(t,i,a),g=n?0:1,p=null,_=null,T=null;function k(){T&&Uh(t,T)}function C(U,V){const z=U.b-g;return V*=Math.abs(z),{a:g,b:U.b,d:z,duration:V,start:U.start,end:U.start+V,group:U.group}}function F(U){const{delay:V=0,duration:z=300,easing:H=mt,tick:oe=ue,css:ce}=l||Kh,ge={start:wh()+V,b:U};U||(ge.group=ln,ln.r+=1),p||_?_=ge:(ce&&(k(),T=Pu(t,g,U,z,V,H,ce)),U&&oe(0,1),p=C(ge,z),Mt(()=>Qo(t,U,"start")),Ch(ve=>{if(_&&ve>_.start&&(p=C(_,z),_=null,Qo(t,p.b,"start"),ce&&(k(),T=Pu(t,g,p.b,p.duration,0,H,l.css))),p){if(ve>=p.end)oe(g=p.b,1-g),Qo(t,p.b,"end"),_||(p.b?k():--p.group.r||Zt(p.group.c)),p=null;else if(ve>=p.start){const le=ve-p.start;g=p.a+p.d*H(le/p.duration),oe(g,1-g)}}return!!(p||_)}))}return{run(U){An(l)?Hh().then(()=>{l=l(a),F(U)}):F(U)},end(){k(),p=_=null}}}function Yh(t,e){se(t,1,1,()=>{e.delete(t.key)})}function qh(t,e,i,n,a,l,g,p,_,T,k,C){let F=t.length,U=l.length,V=F;const z={};for(;V--;)z[t[V].key]=V;const H=[],oe=new Map,ce=new Map,ge=[];for(V=U;V--;){const ee=C(a,l,V),L=i(ee);let ae=g.get(L);ae?n&&ge.push(()=>ae.p(ee,e)):(ae=T(L,ee),ae.c()),oe.set(L,H[V]=ae),L in z&&ce.set(L,Math.abs(V-z[L]))}const ve=new Set,le=new Set;function Se(ee){X(ee,1),ee.m(p,k),g.set(ee.key,ee),k=ee.first,U--}for(;F&&U;){const ee=H[U-1],L=t[F-1],ae=ee.key,W=L.key;ee===L?(k=ee.first,F--,U--):oe.has(W)?!g.has(ae)||ve.has(ae)?Se(ee):le.has(W)?F--:ce.get(ae)>ce.get(W)?(le.add(ae),Se(ee)):(ve.add(W),F--):(_(L,g),F--)}for(;F--;){const ee=t[F];oe.has(ee.key)||_(ee,g)}for(;U;)Se(H[U-1]);return Zt(ge),H}function $e(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ze(t){t&&t.c()}function We(t,e,i,n){const{fragment:a,after_update:l}=t.$$;a&&a.m(e,i),n||Mt(()=>{const g=t.$$.on_mount.map(Bi).filter(An);t.$$.on_destroy?t.$$.on_destroy.push(...g):Zt(g),t.$$.on_mount=[]}),l.forEach(Mt)}function je(t,e){const i=t.$$;i.fragment!==null&&(zh(i.after_update),Zt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Xh(t,e){t.$$.dirty[0]===-1&&(ps.push(t),Lu(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function tt(t,e,i,n,a,l,g,p=[-1]){const _=Xs;Zs(t);const T=t.$$={fragment:null,ctx:[],props:l,update:ue,not_equal:a,bound:qs(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(_?_.$$.context:[])),callbacks:qs(),dirty:p,skip_bound:!1,root:e.target||_.$$.root};g&&g(T.root);let k=!1;if(T.ctx=i?i(t,e.props||{},(C,F,...U)=>{const V=U.length?U[0]:F;return T.ctx&&a(T.ctx[C],T.ctx[C]=V)&&(!T.skip_bound&&T.bound[C]&&T.bound[C](V),k&&Xh(t,C)),F}):[],T.update(),k=!0,Zt(T.before_update),T.fragment=n?n(T.ctx):!1,e.target){if(e.hydrate){const C=Dh(e.target);T.fragment&&T.fragment.l(C),C.forEach($)}else T.fragment&&T.fragment.c();e.intro&&X(t.$$.fragment),We(t,e.target,e.anchor,e.customElement),P()}Zs(_)}class it{$destroy(){je(this,1),this.$destroy=ue}$on(e,i){if(!An(i))return ue;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const a=n.indexOf(i);a!==-1&&n.splice(a,1)}}$set(e){this.$$set&&!Ph(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Zh="@beyondwords/player",$o="0.0.0-beta26",tr=(t,e)=>{t=[t].flat().join(`
5
+ }`,C=`__svelte_${Nh(k)}_${p}`,F=xu(t),{stylesheet:U,rules:V}=Ia.get(F)||Fh(F,t);V[C]||(V[C]=!0,U.insertRule(`@keyframes ${C} ${k}`,U.cssRules.length));const z=t.style.animation||"";return t.style.animation=`${z?`${z}, `:""}${C} ${n}ms linear ${a}ms 1 both`,Ra+=1,C}function Uh(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),a=i.length-n.length;a&&(t.style.animation=n.join(", "),Ra-=a,Ra||Vh())}function Vh(){Ca(()=>{Ra||(Ia.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&$(e)}),Ia.clear())})}let Xs;function Zs(t){Xs=t}function wu(){if(!Xs)throw new Error("Function called outside component initialization");return Xs}function qo(t){wu().$$.on_mount.push(t)}function Wh(t){wu().$$.on_destroy.push(t)}const ps=[],Fe=[];let _s=[];const Xo=[],Cu=Promise.resolve();let Zo=!1;function Lu(){Zo||(Zo=!0,Cu.then(P))}function jh(){return Lu(),Cu}function Mt(t){_s.push(t)}function Qe(t){Xo.push(t)}const Jo=new Set;let ys=0;function P(){if(ys!==0)return;const t=Xs;do{try{for(;ys<ps.length;){const e=ps[ys];ys++,Zs(e),Gh(e.$$)}}catch(e){throw ps.length=0,ys=0,e}for(Zs(null),ps.length=0,ys=0;Fe.length;)Fe.pop()();for(let e=0;e<_s.length;e+=1){const i=_s[e];Jo.has(i)||(Jo.add(i),i())}_s.length=0}while(ps.length);for(;Xo.length;)Xo.pop()();Zo=!1,Jo.clear(),Zs(t)}function Gh(t){if(t.fragment!==null){t.update(),Zt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Mt)}}function zh(t){const e=[],i=[];_s.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),_s=e}let Js;function Hh(){return Js||(Js=Promise.resolve(),Js.then(()=>{Js=null})),Js}function Qo(t,e,i){t.dispatchEvent(Mh(`${e?"intro":"outro"}${i}`))}const Da=new Set;let ln;function Et(){ln={r:0,c:[],p:ln}}function At(){ln.r||Zt(ln.c),ln=ln.p}function X(t,e){t&&t.i&&(Da.delete(t),t.i(e))}function se(t,e,i,n){if(t&&t.o){if(Da.has(t))return;Da.add(t),ln.c.push(()=>{Da.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Kh={duration:0};function Iu(t,e,i,n){const a={direction:"both"};let l=e(t,i,a),g=n?0:1,p=null,_=null,T=null;function k(){T&&Uh(t,T)}function C(U,V){const z=U.b-g;return V*=Math.abs(z),{a:g,b:U.b,d:z,duration:V,start:U.start,end:U.start+V,group:U.group}}function F(U){const{delay:V=0,duration:z=300,easing:H=mt,tick:oe=ue,css:ce}=l||Kh,ge={start:wh()+V,b:U};U||(ge.group=ln,ln.r+=1),p||_?_=ge:(ce&&(k(),T=Pu(t,g,U,z,V,H,ce)),U&&oe(0,1),p=C(ge,z),Mt(()=>Qo(t,U,"start")),Ch(ve=>{if(_&&ve>_.start&&(p=C(_,z),_=null,Qo(t,p.b,"start"),ce&&(k(),T=Pu(t,g,p.b,p.duration,0,H,l.css))),p){if(ve>=p.end)oe(g=p.b,1-g),Qo(t,p.b,"end"),_||(p.b?k():--p.group.r||Zt(p.group.c)),p=null;else if(ve>=p.start){const le=ve-p.start;g=p.a+p.d*H(le/p.duration),oe(g,1-g)}}return!!(p||_)}))}return{run(U){An(l)?Hh().then(()=>{l=l(a),F(U)}):F(U)},end(){k(),p=_=null}}}function Yh(t,e){se(t,1,1,()=>{e.delete(t.key)})}function qh(t,e,i,n,a,l,g,p,_,T,k,C){let F=t.length,U=l.length,V=F;const z={};for(;V--;)z[t[V].key]=V;const H=[],oe=new Map,ce=new Map,ge=[];for(V=U;V--;){const ee=C(a,l,V),L=i(ee);let ae=g.get(L);ae?n&&ge.push(()=>ae.p(ee,e)):(ae=T(L,ee),ae.c()),oe.set(L,H[V]=ae),L in z&&ce.set(L,Math.abs(V-z[L]))}const ve=new Set,le=new Set;function Se(ee){X(ee,1),ee.m(p,k),g.set(ee.key,ee),k=ee.first,U--}for(;F&&U;){const ee=H[U-1],L=t[F-1],ae=ee.key,W=L.key;ee===L?(k=ee.first,F--,U--):oe.has(W)?!g.has(ae)||ve.has(ae)?Se(ee):le.has(W)?F--:ce.get(ae)>ce.get(W)?(le.add(ae),Se(ee)):(ve.add(W),F--):(_(L,g),F--)}for(;F--;){const ee=t[F];oe.has(ee.key)||_(ee,g)}for(;U;)Se(H[U-1]);return Zt(ge),H}function $e(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ze(t){t&&t.c()}function We(t,e,i,n){const{fragment:a,after_update:l}=t.$$;a&&a.m(e,i),n||Mt(()=>{const g=t.$$.on_mount.map(Bi).filter(An);t.$$.on_destroy?t.$$.on_destroy.push(...g):Zt(g),t.$$.on_mount=[]}),l.forEach(Mt)}function je(t,e){const i=t.$$;i.fragment!==null&&(zh(i.after_update),Zt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Xh(t,e){t.$$.dirty[0]===-1&&(ps.push(t),Lu(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function tt(t,e,i,n,a,l,g,p=[-1]){const _=Xs;Zs(t);const T=t.$$={fragment:null,ctx:[],props:l,update:ue,not_equal:a,bound:qs(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(_?_.$$.context:[])),callbacks:qs(),dirty:p,skip_bound:!1,root:e.target||_.$$.root};g&&g(T.root);let k=!1;if(T.ctx=i?i(t,e.props||{},(C,F,...U)=>{const V=U.length?U[0]:F;return T.ctx&&a(T.ctx[C],T.ctx[C]=V)&&(!T.skip_bound&&T.bound[C]&&T.bound[C](V),k&&Xh(t,C)),F}):[],T.update(),k=!0,Zt(T.before_update),T.fragment=n?n(T.ctx):!1,e.target){if(e.hydrate){const C=Dh(e.target);T.fragment&&T.fragment.l(C),C.forEach($)}else T.fragment&&T.fragment.c();e.intro&&X(t.$$.fragment),We(t,e.target,e.anchor,e.customElement),P()}Zs(_)}class it{$destroy(){je(this,1),this.$destroy=ue}$on(e,i){if(!An(i))return ue;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const a=n.indexOf(i);a!==-1&&n.splice(a,1)}}$set(e){this.$$set&&!Ph(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Zh="@beyondwords/player",$o="0.0.0-beta27",tr=(t,e)=>{t=[t].flat().join(`
6
6
  `);let i=`${Zh}:
7
7
 
8
8
  ${t}`;if(e){i+=`
@@ -68,7 +68,7 @@ This context may be helpful:
68
68
  `),Ki=N("select"),tn=N("option"),tn.textContent="all",xi=N("option"),xi.textContent="body",rn=N("option"),rn.textContent="none",xr=N("option"),xr.textContent="all-none",pr=N("option"),pr.textContent="none-all",Fn=Pe(),pn=N("div"),js=Ie(`segmentWidgetPosition:
69
69
  `),_r=N("select");for(let He=0;He<12;He+=1)ss[He].c();Un=Pe(),Ji&&Ji.c(),Br=Pe(),Gs=N("br"),rs=Pe(),Pr.c(),Q(i,"class","heading svelte-g76q0j"),T.__value="small",T.value=T.__value,k.__value="standard",k.value=k.__value,C.__value="large",C.value=C.__value,F.__value="video",F.value=F.__value,Q(_,"tabindex",-1),Q(_,"class","svelte-g76q0j"),t[6]===void 0&&Mt(()=>t[43].call(_)),Q(g,"class","control svelte-g76q0j"),oe.__value="stopped",oe.value=oe.__value,ce.__value="playing",ce.value=ce.__value,ge.__value="paused",ge.value=ge.__value,Q(H,"tabindex",-1),Q(H,"class","svelte-g76q0j"),t[20]===void 0&&Mt(()=>t[44].call(H)),Q(V,"class","control svelte-g76q0j"),Q(ee,"tabindex",-1),Q(ee,"type","text"),Q(ee,"class","svelte-g76q0j"),Q(le,"class","control svelte-g76q0j"),Q(Ze,"tabindex",-1),Q(Ze,"type","text"),Q(Ze,"class","svelte-g76q0j"),Q(ae,"class","control svelte-g76q0j"),Z.__value="auto",Z.value=Z.__value,B.__value="segments",B.value=B.__value,Ke.__value="seconds",Ke.value=Ke.__value,Me.__value="seconds-15",Me.value=Me.__value,we.__value="seconds-15-30",we.value=we.__value,Ue.__value="tracks",Ue.value=Ue.__value,Q(K,"tabindex",-1),Q(K,"class","svelte-g76q0j"),t[9]===void 0&&Mt(()=>t[47].call(K)),Q(Re,"class","control svelte-g76q0j"),Le.__value="auto",Le.value=Le.__value,qe.__value="show",qe.value=qe.__value,Lt.__value="show-3",Lt.value=Lt.__value,Pt.__value="show-999",Pt.value=Pt.__value,Jt.__value="hide",Jt.value=Jt.__value,Q(Ae,"tabindex",-1),Q(Ae,"class","svelte-g76q0j"),t[10]===void 0&&Mt(()=>t[48].call(Ae)),Q(pe,"class","control svelte-g76q0j"),wt.__value="auto",wt.value=wt.__value,Te.__value="show",Te.value=Te.__value,gt.__value="hide",gt.value=gt.__value,Q(ut,"tabindex",-1),Q(ut,"class","svelte-g76q0j"),t[11]===void 0&&Mt(()=>t[49].call(ut)),Q(Wt,"class","control svelte-g76q0j"),st.__value=-1,st.value=st.__value,Q(kt,"tabindex",-1),Q(kt,"class","svelte-g76q0j"),t[15]===void 0&&Mt(()=>t[50].call(kt)),Q(Kt,"class","control svelte-g76q0j"),Ot.__value="small",Ot.value=Ot.__value,Bt.__value="standard",Bt.value=Bt.__value,Gt.__value="large",Gt.value=Gt.__value,ri.__value="video",ri.value=ri.__value,Q(Dt,"tabindex",-1),Q(Dt,"class","svelte-g76q0j"),t[22]===void 0&&Mt(()=>t[51].call(Dt)),Q(ui,"class","control svelte-g76q0j"),at.__value="auto",at.value=at.__value,si.__value="left",si.value=si.__value,De.__value="center",De.value=De.__value,fi.__value="right",fi.value=fi.__value,Q(It,"tabindex",-1),Q(It,"class","svelte-g76q0j"),t[23]===void 0&&Mt(()=>t[52].call(It)),Q(ni,"class","control svelte-g76q0j"),_e.__value="auto",_e.value=_e.__value,hi.__value="400px",hi.value=hi.__value,gi.__value="30rem",gi.value=gi.__value,bi.__value="fit-content",bi.value=bi.__value,vi.__value="initial",vi.value=vi.__value,Pi.__value="0",Pi.value=Pi.__value,Q(Ut,"tabindex",-1),Q(Ut,"class","svelte-g76q0j"),t[24]===void 0&&Mt(()=>t[53].call(Ut)),Q(Je,"class","control svelte-g76q0j"),Q(Ne,"tabindex",-1),Q(Ne,"type","text"),Q(Ne,"class","svelte-g76q0j"),Q(Y,"class","control svelte-g76q0j"),Q(ai,"tabindex",-1),Q(ai,"type","text"),Q(ai,"class","svelte-g76q0j"),Q(Wi,"class","control svelte-g76q0j"),Q(ji,"tabindex",-1),Q(ji,"type","text"),Q(ji,"class","svelte-g76q0j"),Q(Xi,"class","control svelte-g76q0j"),Q(Ri,"tabindex",-1),Q(Ri,"type","text"),Q(Ri,"class","svelte-g76q0j"),Q(kr,"class","control svelte-g76q0j"),zi.__value="all",zi.value=zi.__value,Di.__value="body",Di.value=Di.__value,qt.__value="none",qt.value=qt.__value,Hi.__value="all-none",Hi.value=Hi.__value,Xt.__value="none-all",Xt.value=Xt.__value,Q(Si,"tabindex",-1),Q(Si,"class","svelte-g76q0j"),t[31]===void 0&&Mt(()=>t[58].call(Si)),Q(Er,"class","control svelte-g76q0j"),be.__value="all",be.value=be.__value,ot.__value="body",ot.value=ot.__value,Or.__value="none",Or.value=Or.__value,Ar.__value="all-none",Ar.value=Ar.__value,en.__value="none-all",en.value=en.__value,Q(ye,"tabindex",-1),Q(ye,"class","svelte-g76q0j"),t[32]===void 0&&Mt(()=>t[59].call(ye)),Q($t,"class","control svelte-g76q0j"),tn.__value="all",tn.value=tn.__value,xi.__value="body",xi.value=xi.__value,rn.__value="none",rn.value=rn.__value,xr.__value="all-none",xr.value=xr.__value,pr.__value="none-all",pr.value=pr.__value,Q(Ki,"tabindex",-1),Q(Ki,"class","svelte-g76q0j"),t[33]===void 0&&Mt(()=>t[60].call(Ki)),Q(mn,"class","control svelte-g76q0j"),Q(_r,"tabindex",-1),Q(_r,"class","svelte-g76q0j"),t[34]===void 0&&Mt(()=>t[61].call(_r)),Q(pn,"class","control svelte-g76q0j"),Q(e,"class","control-panel")},m(He,Vt){te(He,e,Vt),I(e,i),I(e,n),I(e,a),I(e,l),I(e,g),I(g,p),I(g,_),I(_,T),I(_,k),I(_,C),I(_,F),lt(_,t[6],!0),I(e,U),I(e,V),I(V,z),I(V,H),I(H,oe),I(H,ce),I(H,ge),lt(H,t[20],!0),I(e,ve),I(e,le),I(le,Se),I(le,ee),St(ee,t[7]),I(e,L),I(e,ae),I(ae,W),I(ae,Ze),St(Ze,t[8]),I(e,Ce),I(e,Re),I(Re,Oe),I(Re,K),I(K,Z),I(K,B),I(K,Ke),I(K,Me),I(K,we),I(K,Ue),lt(K,t[9],!0),I(e,ie),I(e,pe),I(pe,ft),I(pe,Ae),I(Ae,Le),I(Ae,qe),I(Ae,Lt),I(Ae,Pt),I(Ae,Jt),lt(Ae,t[10],!0),I(e,Tt),I(e,Wt),I(Wt,jt),I(Wt,ut),I(ut,wt),I(ut,Te),I(ut,gt),lt(ut,t[11],!0),I(e,ii),I(e,Kt),I(Kt,Nt),I(Kt,kt),I(kt,st);for(let oi=0;oi<R.length;oi+=1)R[oi]&&R[oi].m(kt,null);lt(kt,t[15],!0),I(e,Ft),I(e,ui),I(ui,ci),I(ui,Dt),I(Dt,Ot),I(Dt,Bt),I(Dt,Gt),I(Dt,ri),lt(Dt,t[22],!0),I(e,Qt),I(e,ni),I(ni,di),I(ni,It),I(It,at),I(It,si),I(It,De),I(It,fi),lt(It,t[23],!0),I(e,Yt),I(e,Je),I(Je,Ai),I(Je,Ut),I(Ut,_e),I(Ut,hi),I(Ut,gi),I(Ut,bi),I(Ut,vi),I(Ut,Pi),lt(Ut,t[24],!0),I(e,Ve),I(e,Y),I(Y,J),I(Y,Ne),St(Ne,t[26]),I(e,Qr),I(e,Wi),I(Wi,$r),I(Wi,ai),St(ai,t[27]),I(e,vr),I(e,Xi),I(Xi,Zi),I(Xi,ji),St(ji,t[28]),I(e,or),I(e,kr),I(kr,Ii),I(kr,Ri),St(Ri,t[29]),I(e,lr),I(e,Er),I(Er,Gi),I(Er,Si),I(Si,zi),I(Si,Di),I(Si,qt),I(Si,Hi),I(Si,Xt),lt(Si,t[31],!0),I(e,mr),I(e,$t),I($t,j),I($t,ye),I(ye,be),I(ye,ot),I(ye,Or),I(ye,Ar),I(ye,en),lt(ye,t[32],!0),I(e,Vs),I(e,mn),I(mn,Ws),I(mn,Ki),I(Ki,tn),I(Ki,xi),I(Ki,rn),I(Ki,xr),I(Ki,pr),lt(Ki,t[33],!0),I(e,Fn),I(e,pn),I(pn,js),I(pn,_r);for(let oi=0;oi<12;oi+=1)ss[oi]&&ss[oi].m(_r,null);lt(_r,t[34],!0),I(e,Un),Ji&&Ji.m(e,null),I(e,Br),I(e,Gs),I(e,rs),Pr.m(e,null),ns||(Vn=[me(_,"change",t[43]),me(H,"change",t[44]),me(ee,"input",t[45]),me(Ze,"input",t[46]),me(K,"change",t[47]),me(Ae,"change",t[48]),me(ut,"change",t[49]),me(kt,"change",t[50]),me(Dt,"change",t[51]),me(It,"change",t[52]),me(Ut,"change",t[53]),me(Ne,"input",t[54]),me(ai,"input",t[55]),me(ji,"input",t[56]),me(Ri,"input",t[57]),me(Si,"change",t[58]),me(ye,"change",t[59]),me(Ki,"change",t[60]),me(_r,"change",t[61])],ns=!0)},p(He,Vt){if(Vt[0]&64&&lt(_,He[6]),Vt[0]&1048576&&lt(H,He[20]),Vt[0]&128&&ee.value!==He[7]&&St(ee,He[7]),Vt[0]&256&&Ze.value!==He[8]&&St(Ze,He[8]),Vt[0]&512&&lt(K,He[9]),Vt[0]&1024&&lt(Ae,He[10]),Vt[0]&2048&&lt(ut,He[11]),Vt[1]&1024){Mr=He[41];let oi;for(oi=0;oi<Mr.length;oi+=1){const as=Sc(He,Mr,oi);R[oi]?R[oi].p(as,Vt):(R[oi]=Tc(as),R[oi].c(),R[oi].m(kt,null))}for(;oi<R.length;oi+=1)R[oi].d(1);R.length=Mr.length}Vt[0]&32768&&lt(kt,He[15]),Vt[0]&4194304&&lt(Dt,He[22]),Vt[0]&8388608&&lt(It,He[23]),Vt[0]&16777216&&lt(Ut,He[24]),Vt[0]&67108864&&Ne.value!==He[26]&&St(Ne,He[26]),Vt[0]&134217728&&ai.value!==He[27]&&St(ai,He[27]),Vt[0]&268435456&&ji.value!==He[28]&&St(ji,He[28]),Vt[0]&536870912&&Ri.value!==He[29]&&St(Ri,He[29]),Vt[1]&1&&lt(Si,He[31]),Vt[1]&2&&lt(ye,He[32]),Vt[1]&4&&lt(Ki,He[33]),Vt[1]&8&&lt(_r,He[34]),He[42]?Ji?Ji.p(He,Vt):(Ji=kc(He),Ji.c(),Ji.m(e,Br)):Ji&&(Ji.d(1),Ji=null),zs===(zs=Ea(He))&&Pr?Pr.p(He,Vt):(Pr.d(1),Pr=zs(He),Pr&&(Pr.c(),Pr.m(e,null)))},i:ue,o:ue,d(He){He&&$(e),xn(R,He),xn(ss,He),Ji&&Ji.d(),Pr.d(),ns=!1,Zt(Vn)}}}function R1(t,e,i){let{projectId:n}=e,{contentId:a}=e,{playlistId:l}=e,{sourceId:g}=e,{sourceUrl:p}=e,{showUserInterface:_}=e,{playerStyle:T}=e,{playerTitle:k}=e,{callToAction:C}=e,{skipButtonStyle:F}=e,{playlistStyle:U}=e,{playlistToggle:V}=e,{mediaSession:z}=e,{content:H}=e,{contentIndex:oe}=e,{introsOutros:ce}=e,{introsOutrosIndex:ge}=e,{adverts:ve}=e,{advertIndex:le}=e,{persistentAdImage:Se}=e,{persistentIndex:ee}=e,{duration:L}=e,{currentTime:ae}=e,{playbackState:W}=e,{playbackRate:Ze}=e,{widgetStyle:Ce}=e,{widgetPosition:Re}=e,{widgetWidth:Oe}=e,{widgetTarget:K}=e,{textColor:Z}=e,{backgroundColor:B}=e,{iconColor:Ke}=e,{highlightColor:Me}=e,{logoIconEnabled:we}=e,{highlightSections:Ue}=e,{clickableSections:ie}=e,{segmentWidgetSections:pe}=e,{segmentWidgetPosition:ft}=e,{advertConsent:Ae}=e,{analyticsConsent:Le}=e,{analyticsCustomUrl:qe}=e,{analyticsTag:Lt}=e,Pt=!1;function Jt(){T=mi(this),i(6,T)}function Tt(){W=mi(this),i(20,W)}function Wt(){k=this.value,i(7,k)}function jt(){C=this.value,i(8,C)}function ut(){F=mi(this),i(9,F)}function wt(){U=mi(this),i(10,U)}function Te(){V=mi(this),i(11,V)}function gt(){le=mi(this),i(15,le)}function ii(){Ce=mi(this),i(22,Ce)}function Kt(){Re=mi(this),i(23,Re)}function Nt(){Oe=mi(this),i(24,Oe)}function kt(){Z=this.value,i(26,Z)}function st(){B=this.value,i(27,B)}function Ft(){Ke=this.value,i(28,Ke)}function ui(){Me=this.value,i(29,Me)}function ci(){Ue=mi(this),i(31,Ue)}function Dt(){ie=mi(this),i(32,ie)}function Ot(){pe=mi(this),i(33,pe)}function Bt(){ft=mi(this),i(34,ft)}function Gt(){n=this.value,i(0,n)}function ri(){a=this.value,i(1,a)}function Qt(){l=this.value,i(2,l)}function ni(){g=this.value,i(3,g)}function di(){p=this.value,i(4,p)}function It(){_=mi(this),i(5,_)}function at(){z=mi(this),i(12,z)}function si(){oe=mi(this),i(13,oe)}function De(){ge=mi(this),i(14,ge)}function fi(){Se=mi(this),i(16,Se)}function Yt(){ee=mi(this),i(17,ee)}function Je(){L=this.value,i(18,L)}function Ai(){ae=this.value,i(19,ae)}function Ut(){Ze=this.value,i(21,Ze)}function _e(){K=this.value,i(25,K)}function hi(){we=mi(this),i(30,we)}function gi(){Ae=mi(this),i(35,Ae)}function bi(){Le=mi(this),i(36,Le)}function vi(){qe=this.value,i(37,qe)}function Pi(){Lt=this.value,i(38,Lt)}const Ve=()=>i(42,Pt=!1),Y=()=>i(42,Pt=!0);return t.$$set=J=>{"projectId"in J&&i(0,n=J.projectId),"contentId"in J&&i(1,a=J.contentId),"playlistId"in J&&i(2,l=J.playlistId),"sourceId"in J&&i(3,g=J.sourceId),"sourceUrl"in J&&i(4,p=J.sourceUrl),"showUserInterface"in J&&i(5,_=J.showUserInterface),"playerStyle"in J&&i(6,T=J.playerStyle),"playerTitle"in J&&i(7,k=J.playerTitle),"callToAction"in J&&i(8,C=J.callToAction),"skipButtonStyle"in J&&i(9,F=J.skipButtonStyle),"playlistStyle"in J&&i(10,U=J.playlistStyle),"playlistToggle"in J&&i(11,V=J.playlistToggle),"mediaSession"in J&&i(12,z=J.mediaSession),"content"in J&&i(39,H=J.content),"contentIndex"in J&&i(13,oe=J.contentIndex),"introsOutros"in J&&i(40,ce=J.introsOutros),"introsOutrosIndex"in J&&i(14,ge=J.introsOutrosIndex),"adverts"in J&&i(41,ve=J.adverts),"advertIndex"in J&&i(15,le=J.advertIndex),"persistentAdImage"in J&&i(16,Se=J.persistentAdImage),"persistentIndex"in J&&i(17,ee=J.persistentIndex),"duration"in J&&i(18,L=J.duration),"currentTime"in J&&i(19,ae=J.currentTime),"playbackState"in J&&i(20,W=J.playbackState),"playbackRate"in J&&i(21,Ze=J.playbackRate),"widgetStyle"in J&&i(22,Ce=J.widgetStyle),"widgetPosition"in J&&i(23,Re=J.widgetPosition),"widgetWidth"in J&&i(24,Oe=J.widgetWidth),"widgetTarget"in J&&i(25,K=J.widgetTarget),"textColor"in J&&i(26,Z=J.textColor),"backgroundColor"in J&&i(27,B=J.backgroundColor),"iconColor"in J&&i(28,Ke=J.iconColor),"highlightColor"in J&&i(29,Me=J.highlightColor),"logoIconEnabled"in J&&i(30,we=J.logoIconEnabled),"highlightSections"in J&&i(31,Ue=J.highlightSections),"clickableSections"in J&&i(32,ie=J.clickableSections),"segmentWidgetSections"in J&&i(33,pe=J.segmentWidgetSections),"segmentWidgetPosition"in J&&i(34,ft=J.segmentWidgetPosition),"advertConsent"in J&&i(35,Ae=J.advertConsent),"analyticsConsent"in J&&i(36,Le=J.analyticsConsent),"analyticsCustomUrl"in J&&i(37,qe=J.analyticsCustomUrl),"analyticsTag"in J&&i(38,Lt=J.analyticsTag)},[n,a,l,g,p,_,T,k,C,F,U,V,z,oe,ge,le,Se,ee,L,ae,W,Ze,Ce,Re,Oe,K,Z,B,Ke,Me,we,Ue,ie,pe,ft,Ae,Le,qe,Lt,H,ce,ve,Pt,Jt,Tt,Wt,jt,ut,wt,Te,gt,ii,Kt,Nt,kt,st,Ft,ui,ci,Dt,Ot,Bt,Gt,ri,Qt,ni,di,It,at,si,De,fi,Yt,Je,Ai,Ut,_e,hi,gi,bi,vi,Pi,Ve,Y]}class D1 extends it{constructor(e){super(),tt(this,e,R1,I1,Xe,{projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,showUserInterface:5,playerStyle:6,playerTitle:7,callToAction:8,skipButtonStyle:9,playlistStyle:10,playlistToggle:11,mediaSession:12,content:39,contentIndex:13,introsOutros:40,introsOutrosIndex:14,adverts:41,advertIndex:15,persistentAdImage:16,persistentIndex:17,duration:18,currentTime:19,playbackState:20,playbackRate:21,widgetStyle:22,widgetPosition:23,widgetWidth:24,widgetTarget:25,textColor:26,backgroundColor:27,iconColor:28,highlightColor:29,logoIconEnabled:30,highlightSections:31,clickableSections:32,segmentWidgetSections:33,segmentWidgetPosition:34,advertConsent:35,analyticsConsent:36,analyticsCustomUrl:37,analyticsTag:38},null,[-1,-1,-1])}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),P()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),P()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),P()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),P()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),P()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),P()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),P()}get playerTitle(){return this.$$.ctx[7]}set playerTitle(e){this.$$set({playerTitle:e}),P()}get callToAction(){return this.$$.ctx[8]}set callToAction(e){this.$$set({callToAction:e}),P()}get skipButtonStyle(){return this.$$.ctx[9]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),P()}get playlistStyle(){return this.$$.ctx[10]}set playlistStyle(e){this.$$set({playlistStyle:e}),P()}get playlistToggle(){return this.$$.ctx[11]}set playlistToggle(e){this.$$set({playlistToggle:e}),P()}get mediaSession(){return this.$$.ctx[12]}set mediaSession(e){this.$$set({mediaSession:e}),P()}get content(){return this.$$.ctx[39]}set content(e){this.$$set({content:e}),P()}get contentIndex(){return this.$$.ctx[13]}set contentIndex(e){this.$$set({contentIndex:e}),P()}get introsOutros(){return this.$$.ctx[40]}set introsOutros(e){this.$$set({introsOutros:e}),P()}get introsOutrosIndex(){return this.$$.ctx[14]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),P()}get adverts(){return this.$$.ctx[41]}set adverts(e){this.$$set({adverts:e}),P()}get advertIndex(){return this.$$.ctx[15]}set advertIndex(e){this.$$set({advertIndex:e}),P()}get persistentAdImage(){return this.$$.ctx[16]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),P()}get persistentIndex(){return this.$$.ctx[17]}set persistentIndex(e){this.$$set({persistentIndex:e}),P()}get duration(){return this.$$.ctx[18]}set duration(e){this.$$set({duration:e}),P()}get currentTime(){return this.$$.ctx[19]}set currentTime(e){this.$$set({currentTime:e}),P()}get playbackState(){return this.$$.ctx[20]}set playbackState(e){this.$$set({playbackState:e}),P()}get playbackRate(){return this.$$.ctx[21]}set playbackRate(e){this.$$set({playbackRate:e}),P()}get widgetStyle(){return this.$$.ctx[22]}set widgetStyle(e){this.$$set({widgetStyle:e}),P()}get widgetPosition(){return this.$$.ctx[23]}set widgetPosition(e){this.$$set({widgetPosition:e}),P()}get widgetWidth(){return this.$$.ctx[24]}set widgetWidth(e){this.$$set({widgetWidth:e}),P()}get widgetTarget(){return this.$$.ctx[25]}set widgetTarget(e){this.$$set({widgetTarget:e}),P()}get textColor(){return this.$$.ctx[26]}set textColor(e){this.$$set({textColor:e}),P()}get backgroundColor(){return this.$$.ctx[27]}set backgroundColor(e){this.$$set({backgroundColor:e}),P()}get iconColor(){return this.$$.ctx[28]}set iconColor(e){this.$$set({iconColor:e}),P()}get highlightColor(){return this.$$.ctx[29]}set highlightColor(e){this.$$set({highlightColor:e}),P()}get logoIconEnabled(){return this.$$.ctx[30]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),P()}get highlightSections(){return this.$$.ctx[31]}set highlightSections(e){this.$$set({highlightSections:e}),P()}get clickableSections(){return this.$$.ctx[32]}set clickableSections(e){this.$$set({clickableSections:e}),P()}get segmentWidgetSections(){return this.$$.ctx[33]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),P()}get segmentWidgetPosition(){return this.$$.ctx[34]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),P()}get advertConsent(){return this.$$.ctx[35]}set advertConsent(e){this.$$set({advertConsent:e}),P()}get analyticsConsent(){return this.$$.ctx[36]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),P()}get analyticsCustomUrl(){return this.$$.ctx[37]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),P()}get analyticsTag(){return this.$$.ctx[38]}set analyticsTag(e){this.$$set({analyticsTag:e}),P()}}const O1=(t,e,i)=>{N1(t);const n=new Image;return n.setAttribute("crossorigin","anonymous"),new Promise((a,l)=>{n.addEventListener("load",B1(n,e,i,a,l)),n.addEventListener("error",l),n.src=t})},B1=(t,e,i,n,a)=>()=>{const l=document.createElement("canvas"),g=l.getContext("2d");l.width=e,l.height=i,g.drawImage(t,0,0,e,i),l.toBlob(M1(t,e,i,n,a))},ks={},M1=(t,e,i,n,a)=>l=>{var p;l||a();const g=URL.createObjectURL(l);ks[p=t.src]||(ks[p]=[]),ks[t.src].push(g),n({src:g,sizes:`${e}x${i}`,type:"image/png"})},N1=t=>{Object.keys(ks).filter(n=>n!==t).map(n=>ks[n]).flat().forEach(n=>URL.revokeObjectURL(n))},F1=(t,e,i)=>on(this,null,function*(){t=yield t;const n=t.innerHTML;return{src:`data:image/svg+xml,${encodeURIComponent(n)}`,sizes:`${e}x${i}`,type:"image/svg+xml"}}),U1=(t,e,i)=>wi(t,e,i,1),V1=(t,e,i)=>nt(t,e,e==="style"?j1(i):i),W1=/;(?!([^()]*\([^()]*\))*[^()]*\))/,j1=t=>t.split(W1).map(e=>e+" !important").join(";");function Pc(t,e,i){const n=t.slice();return n[39]=e[i],n[40]=e,n[41]=i,n}function wc(t){let e,i,n,a=t[41],l;i=new Qu({props:{fill:t[2],color:t[1],scale:t[39]/18,zoom:.65}});const g=()=>t[36](e,a),p=()=>t[36](null,a);return{c(){e=N("div"),ze(i.$$.fragment),n=Pe(),U1(e,"display","none")},m(_,T){te(_,e,T),We(i,e,null),I(e,n),g(),l=!0},p(_,T){t=_;const k={};T[0]&4&&(k.fill=t[2]),T[0]&2&&(k.color=t[1]),i.$set(k),a!==t[41]&&(p(),a=t[41],g())},i(_){l||(X(i.$$.fragment,_),l=!0)},o(_){se(i.$$.fragment,_),l=!1},d(_){_&&$(e),je(i),p()}}}function G1(t){let e,i,n=t[3],a=[];for(let g=0;g<n.length;g+=1)a[g]=wc(Pc(t,n,g));const l=g=>se(a[g],1,1,()=>{a[g]=null});return{c(){e=N("div");for(let g=0;g<a.length;g+=1)a[g].c();V1(e,"class","media-session")},m(g,p){te(g,e,p);for(let _=0;_<a.length;_+=1)a[_]&&a[_].m(e,null);i=!0},p(g,p){if(p[0]&15){n=g[3];let _;for(_=0;_<n.length;_+=1){const T=Pc(g,n,_);a[_]?(a[_].p(T,p),X(a[_],1)):(a[_]=wc(T),a[_].c(),X(a[_],1),a[_].m(e,null))}for(Et(),_=n.length;_<a.length;_+=1)l(_);At()}},i(g){if(!i){for(let p=0;p<n.length;p+=1)X(a[p]);i=!0}},o(g){a=a.filter(Boolean);for(let p=0;p<a.length;p+=1)se(a[p]);i=!1},d(g){g&&$(e),xn(a,g)}}}function z1(t,e,i){let n,a,l,g,p,_,T,k,C,F,U,V,z,H,oe,ce,ge,ve,le,Se,ee;const L=[96,128,192,256,384,512],ae=["hangup","nextslide","nexttrack","pause","play","previousslide","previoustrack","seekbackward","seekforward","seekto","skipad","stop","togglecamera","togglemicrophone"];let{content:W=[]}=e,{contentIndex:Ze=0}=e,{activeAdvert:Ce=void 0}=e,{persistentAdvert:Re=void 0}=e,{duration:Oe=0}=e,{playbackState:K="stopped"}=e,{skipButtonStyle:Z="auto"}=e,{backgroundColor:B="#f5f5f5"}=e,{iconColor:Ke="black"}=e,{onEvent:Me=()=>{}}=e,we=[],Ue=new Set,ie=L.map(()=>{}),pe=L.map(()=>{});const ft=()=>i(15,Ue=Ue.add(H));function Ae(Le,qe){Fe[Le?"unshift":"push"](()=>{ie[qe]=Le,i(0,ie)})}return t.$$set=Le=>{"content"in Le&&i(4,W=Le.content),"contentIndex"in Le&&i(5,Ze=Le.contentIndex),"activeAdvert"in Le&&i(6,Ce=Le.activeAdvert),"persistentAdvert"in Le&&i(7,Re=Le.persistentAdvert),"duration"in Le&&i(8,Oe=Le.duration),"playbackState"in Le&&i(9,K=Le.playbackState),"skipButtonStyle"in Le&&i(10,Z=Le.skipButtonStyle),"backgroundColor"in Le&&i(11,B=Le.backgroundColor),"iconColor"in Le&&i(12,Ke=Le.iconColor),"onEvent"in Le&&i(13,Me=Le.onEvent)},t.$$.update=()=>{t.$$.dirty[0]&512&&i(33,n=K==="stopped"),t.$$.dirty[0]&64|t.$$.dirty[1]&4&&i(34,a=Ce&&!n),t.$$.dirty[0]&16&&i(35,l=W.length>1),t.$$.dirty[0]&48&&i(27,g=W[Ze]),t.$$.dirty[0]&1024|t.$$.dirty[1]&16&&i(19,p=Z==="auto"?l?"tracks":"segments":Z),t.$$.dirty[0]&524288&&i(21,_=parseFloat(p.split("-")[1]||10)),t.$$.dirty[0]&2621440&&i(18,T=parseFloat(p.split("-")[2]||_)),t.$$.dirty[0]&524288|t.$$.dirty[1]&8&&i(20,k=!a&&p!=="tracks"),t.$$.dirty[0]&524288|t.$$.dirty[1]&8&&i(17,C=!a&&p==="tracks"),t.$$.dirty[1]&8&&i(22,F=!a),t.$$.dirty[0]&2112|t.$$.dirty[1]&8&&i(2,U=a&&(Ce==null?void 0:Ce.backgroundColor)||B),t.$$.dirty[0]&4160|t.$$.dirty[1]&8&&i(1,V=a&&(Ce==null?void 0:Ce.iconColor)||Ke),t.$$.dirty[0]&7&&i(16,pe=L.map((Le,qe)=>jh().then(()=>ie[qe]))),t.$$.dirty[0]&134217920|t.$$.dirty[1]&12&&i(32,z=a&&Ce.imageUrl||!n&&(Re==null?void 0:Re.imageUrl)||(g==null?void 0:g.imageUrl)),t.$$.dirty[0]&32768|t.$$.dirty[1]&2&&i(28,H=Ue.has(z)?null:z),t.$$.dirty[0]&268435456&&i(31,oe=H?L.map(Le=>O1(H,Le,Le)):[]),t.$$.dirty[0]&268435456&&i(30,ce=H?[{src:H,sizes:"any"}]:[]),t.$$.dirty[0]&268500992&&i(29,ge=H?[]:L.map((Le,qe)=>F1(pe[qe],Le,Le))),t.$$.dirty[0]&1610612736|t.$$.dirty[1]&1&&i(26,ve=Promise.all([...oe,...ce,...ge])),t.$$.dirty[0]&134217728&&i(25,le=(g==null?void 0:g.title)||""),t.$$.dirty[0]&67108864&&ve.then(Le=>i(14,we=Le)).catch(ft),t.$$.dirty[0]&58736640&&(navigator.mediaSession.metadata=new MediaMetadata({title:le,artist:Se,album:ee,artwork:we})),t.$$.dirty[0]&8192&&navigator.mediaSession.setActionHandler("play",()=>{Me(rt({type:"PressedPlay",description:"The play button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&8192&&navigator.mediaSession.setActionHandler("pause",()=>{Me(rt({type:"PressedPause",description:"The pause button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&4202752&&navigator.mediaSession.setActionHandler("seekto",F?({seekTime:Le})=>{Me(rt({type:"ScrubbedProgressBar",description:"The user pressed on the progress bar then dragged.",initiatedBy:"media-session-api",ratio:Math.max(0,Math.min(1,Le/Oe))}))}:null),t.$$.dirty[0]&3678208&&navigator.mediaSession.setActionHandler("seekbackward",k?({seekOffset:Le})=>{Me(rt(p==="seconds"||Le?{type:"PressedSeekBack",description:"The seek backward button was pressed.",initiatedBy:"media-session-api",seconds:Le||_}:{type:"PressedPrevSegment",description:"The previous segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&1843200&&navigator.mediaSession.setActionHandler("seekforward",k?({seekOffset:Le})=>{Me(rt(p==="seconds"||Le?{type:"PressedSeekAhead",description:"The seek ahead button was pressed.",initiatedBy:"media-session-api",seconds:Le||T}:{type:"PressedNextSegment",description:"The next segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&139264&&navigator.mediaSession.setActionHandler("previoustrack",C?()=>{Me(rt({type:"PressedPrevTrack",description:"The previous track button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&139264&&navigator.mediaSession.setActionHandler("nexttrack",C?()=>{Me(rt({type:"PressedNextTrack",description:"The next track button was pressed.",initiatedBy:"media-session-api"}))}:null)},i(24,Se=""),i(23,ee=""),navigator.mediaSession.setByPlayer=!0,ae.forEach(Le=>{try{navigator.mediaSession.setActionHandler(Le,null)}catch(qe){}}),[ie,V,U,L,W,Ze,Ce,Re,Oe,K,Z,B,Ke,Me,we,Ue,pe,C,T,p,k,_,F,ee,Se,le,ve,g,H,ge,ce,oe,z,n,a,l,Ae]}class H1 extends it{constructor(e){super(),tt(this,e,z1,G1,Xe,{content:4,contentIndex:5,activeAdvert:6,persistentAdvert:7,duration:8,playbackState:9,skipButtonStyle:10,backgroundColor:11,iconColor:12,onEvent:13},null,[-1,-1])}get content(){return this.$$.ctx[4]}set content(e){this.$$set({content:e}),P()}get contentIndex(){return this.$$.ctx[5]}set contentIndex(e){this.$$set({contentIndex:e}),P()}get activeAdvert(){return this.$$.ctx[6]}set activeAdvert(e){this.$$set({activeAdvert:e}),P()}get persistentAdvert(){return this.$$.ctx[7]}set persistentAdvert(e){this.$$set({persistentAdvert:e}),P()}get duration(){return this.$$.ctx[8]}set duration(e){this.$$set({duration:e}),P()}get playbackState(){return this.$$.ctx[9]}set playbackState(e){this.$$set({playbackState:e}),P()}get skipButtonStyle(){return this.$$.ctx[10]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),P()}get backgroundColor(){return this.$$.ctx[11]}set backgroundColor(e){this.$$set({backgroundColor:e}),P()}get iconColor(){return this.$$.ctx[12]}set iconColor(e){this.$$set({iconColor:e}),P()}get onEvent(){return this.$$.ctx[13]}set onEvent(e){this.$$set({onEvent:e}),P()}}const Cc=(t,e,i)=>nt(t,e,e==="style"?Y1(i):i),K1=/;(?!([^()]*\([^()]*\))*[^()]*\))/,Y1=t=>t.split(K1).map(e=>e+" !important").join(";");function Lc(t){let e,i,n,a;return{c(){e=N("script"),n=Pe(),a=N("script"),a.textContent=`window.dataLayer = window.dataLayer || [];
70
70
  function gtag() { dataLayer.push(arguments); }
71
- gtag("js", new Date());`,e.async=!0,Cr(e.src,i="https://www.googletagmanager.com/gtag/js?id="+t[0])||Cc(e,"src",i)},m(l,g){te(l,e,g),te(l,n,g),te(l,a,g)},p(l,g){g&1&&!Cr(e.src,i="https://www.googletagmanager.com/gtag/js?id="+l[0])&&Cc(e,"src",i)},d(l){l&&$(e),l&&$(n),l&&$(a)}}}function q1(t){let e,i=!t[1]&&Lc(t);return{c(){i&&i.c(),e=Yn()},m(n,a){i&&i.m(document.head,null),I(document.head,e)},p(n,[a]){n[1]?i&&(i.d(1),i=null):i?i.p(n,a):(i=Lc(n),i.c(),i.m(e.parentNode,e))},i:ue,o:ue,d(n){i&&i.d(n),$(e)}}}function X1(t,e,i){let n,{analyticsTag:a}=e;return t.$$set=l=>{"analyticsTag"in l&&i(0,a=l.analyticsTag)},i(1,n=window.gtag),[a,n]}class Z1 extends it{constructor(e){super(),tt(this,e,X1,q1,Xe,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),P()}}const $6="";class J1 extends it{constructor(e){super(),tt(this,e,null,null,Xe,{})}}class ml{constructor(e,i){ht(this,ma);ht(this,po);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var l;(l=this.consumers)[e]||(l[e]=[]);const a=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(a&&de(this,ma,mu).call(this,n,a.args))&&(a&&this.onDeselected(e,...a.args),this.onSelected(e,...n))}removeInterest(e,i){var g;(g=this.consumers)[e]||(g[e]=[]);const n=this.consumers[e].slice(-1)[0];if(de(this,po,oh).call(this,this.consumers[e],p=>p.consumerId===i),!(n&&i===n.consumerId))return;const l=this.consumers[e].slice(-1)[0];l&&de(this,ma,mu).call(this,n.args,l.args)||(this.onDeselected(e,...n.args),l&&this.onSelected(e,...l.args))}}ma=new WeakSet,mu=function(e,i){return e.length===i.length&&e.every((n,a)=>n===i[a])},po=new WeakSet,oh=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};const ta=(t,e,i)=>{let[n,a]=i.split("-");n||(n="none"),a||(a=n);const l=t==="current"?n:a;return l==="all"||l==="body"&&(e==null?void 0:e.section)==="body"},Ln="data-beyondwords-marker",Ic=t=>["beyondwords-highlight","bwp",`marker-${t}`],Ns=class{update(e,i,n,a){const l=ta(e,i,n),g=this[`prev${e}`],p=l?i==null?void 0:i.marker:null;p&&Vr(Ns,pa).addInterest(p,this,a),g&&Vr(Ns,pa).removeInterest(g,this),this[`prev${e}`]=p}};let Es=Ns;pa=new WeakMap,_o=new WeakSet,lh=function(e,i){const n=document.querySelectorAll(`[${Ln}="${e}"]`);for(const a of n){const l=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);let g;for(;g=l.nextNode();){if(/^\s*$/.test(g.nodeValue))continue;g.parentNode.nodeName.toLowerCase()==="a"&&(g=g.parentNode);const T=document.createElement("mark");T.classList.add(...Ic(e)),T.style.background=i,g.parentNode.insertBefore(T,g),T.appendChild(g)}}},yo=new WeakSet,uh=function(e){const i=document.querySelectorAll(`[${Ln}="${e}"]`);for(const n of i){const a=n.querySelectorAll(`mark.${Ic(e)}`);for(const l of a)for(const g of l.childNodes)l.parentNode.insertBefore(g,l),l.remove()}},ht(Es,_o),ht(Es,yo),ht(Es,pa,new ml(de(Ns,_o,lh),de(Ns,yo,uh)));const Rc=["beyondwords-clickable","bwp"],Fs=class{update(e,i){const n=ta("hovered",e,i),a=this.previous,l=n?e==null?void 0:e.marker:null;l&&Vr(Fs,_a).addInterest(l,this),a&&Vr(Fs,_a).removeInterest(a,this),this.previous=l}};let As=Fs;_a=new WeakMap,bo=new WeakSet,ch=function(e){const i=document.querySelectorAll(`[${Ln}="${e}"]`);for(const n of i)n.classList.add(...Rc)},So=new WeakSet,dh=function(e){const i=document.querySelectorAll(`[${Ln}="${e}"]`);for(const n of i)Dc(n,Rc)},ht(As,bo),ht(As,So),ht(As,_a,new ml(de(Fs,bo,ch),de(Fs,So,dh)));const Dc=(t,e)=>{if(!t)return;const a=[...t.classList].filter(l=>!e.includes(l)).some(l=>l.startsWith("beyondwords-"))?e.filter(l=>l!=="bwp"):e;t.classList.remove(...a)},Oc=(t,e,i)=>["beyondwords-widget","bwp",`marker-${t}`,`position-${e}`,`for-${i}-player`],Bc=["beyondwords-relative","bwp"],Us=class{constructor(e){this.onUpdate=e,this.containers=[]}update(e,i,n,a){const l=i.includes("all")||i.includes("body"),g=this.previous,p=(e==null?void 0:e.marker)||l&&(g==null?void 0:g.marker);p&&Vr(Us,ya).addInterest(p,this,this,n,a),g&&Vr(Us,ya).removeInterest(g,this),this.previous=p}reset(){this.update(null,"none")}};let xs=Us;ya=new WeakMap,To=new WeakSet,fh=function(e,i,n,a){const l=document.querySelectorAll(`[${Ln}="${e}"]`);for(const g of l){const p=document.createElement("div");["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(n)&&g.classList.add(...Bc),p.classList.add(...Oc(e,n,a)),["11-oclock","12-oclock","1-oclock"].includes(n)?g.insertBefore(p,g.firstChild):g.appendChild(p),i.containers.push(p)}i.onUpdate(i.containers)},ko=new WeakSet,hh=function(e,i,n,a){const l=Oc(e,n,a);for(let g=0;g<i.containers.length;g+=1){if(!l.every(T=>i.containers[g].classList.contains(T)))continue;const _=i.containers[g].parentNode;Dc(_,Bc),i.containers[g].remove(),i.containers.splice(g,1),g-=1}i.onUpdate(i.containers)},ht(xs,To),ht(xs,ko),ht(xs,ya,new ml(de(Us,To,fh),de(Us,ko,hh)));const Q1=()=>rt({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),Xn=(i,...n)=>on(this,[i,...n],function*(t,e={}){const a=yield fetch(t,e).catch(()=>{}),l=yield a==null?void 0:a.json().catch(()=>{});return(a==null?void 0:a.status)!==200&&tr(`Failed to fetch ${t}`,ti(fe({},e),{responseStatus:a==null?void 0:a.status,responseJson:l})),l}),$1=(t,e)=>Xn(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class eb{constructor(e,i,n){ht(this,Eo);this.baseUrl=de(this,Eo,gh).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return on(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield Xn(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return on(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,a="actioncable-v1-json";this.webSocket=new WebSocket(n,a),this.webSocket.onmessage=l=>e(JSON.parse(l.data)),this.webSocket.onerror=i,yield new Promise(l=>this.webSocket.onopen=l)})}subscribeToStatusChanges(){const e=JSON.stringify({channel:"Api::V1::ProjectChannel",id:this.projectId}),i=JSON.stringify({command:"subscribe",identifier:e});this.webSocket.send(i)}destroy(){this.webSocketToken=null,this.webSocket&&(this.webSocket.onmessage=()=>{},this.webSocket.onerror=()=>{},this.webSocket.close(),this.webSocket=null)}}Eo=new WeakSet,gh=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let Zn;const tb=(t,e,i,n)=>on(this,null,function*(){!t||!e||!i||(Zn==null||Zn.destroy(),Zn=new eb(t,e,i),yield Zn.getWebSocketToken(),yield Zn.establishConnection(ib(n),sb),yield Zn.subscribeToStatusChanges())}),ib=t=>e=>{var a,l;((l=(a=e==null?void 0:e.message)==null?void 0:a.result)==null?void 0:l.action)==="podcast_state_updated"&&rb(e,t),e.type==="reject_subscription"&&nb(e)},rb=(t,e)=>{const i=t.message.result;e(rt({type:"ContentStatusChanged",description:"The processing status of a content item within the project changed.",initiatedBy:"websocket",contentId:i.content_id,legacyId:i.legacy_id,sourceId:i.source_id,sourceUrl:i.source_url,contentStatus:i.state}))},nb=t=>{tr("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},sb=t=>{tr("Unexpected WebSocket error.",{error:t})},Mc=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},ia=t=>{const i=Object.keys(t.$$.props).filter(n=>!ab.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},ab=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),Nc=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const a of i){const l=t[a],g=e[a];l!==g&&(n[a]={previousValue:l,currentValue:g})}return n};let ra=-1;const Fc=[],ob=(t,e,i)=>on(this,null,function*(){yield Mc(()=>e.player);const n=e.player,a=lb(n.contentIndex,i,t);a>ra&&ub(n,ra,a,t),a<ra&&cb(n,ra,a),ra=a}),lb=(t,e,i)=>{const n=i.findIndex(l=>l[0]===t&&l[1]>e||l[0]>t);return n===-1?i.length-1:n-1},ub=(t,e,i,n)=>{for(let a=e+1;a<=i;a+=1){const l=ia(t);n[a][2](t);const g=ia(t),p=Nc(l,g);Fc.push(p)}},cb=(t,e,i)=>{for(let n=e;n>i;n-=1){const a=Fc.pop();for(const[l,g]of Object.entries(a))t[l]=g.previousValue}},db=t=>t?fb(t)?{newTarget:gb(t),showUserInterface:!0}:typeof t=="string"?{newTarget:pl(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:hb(),showUserInterface:!1},fb=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",hb=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},gb=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},pl=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&tr(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&tr(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]};function Uc(t,e,i){const n=t.slice();return n[137]=e[i],n}function Vc(t){let e,i,n={onEvent:t[53],playerStyle:t[59],callToAction:t[23],skipButtonStyle:t[24],playlistStyle:t[25],playlistToggle:t[26],downloadFormats:t[47],playerTitle:t[22],content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[11],playbackState:t[30],playbackRate:t[31],activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36],logoIconEnabled:t[37],videoIsBehind:t[61]};return e=new gl({props:n}),t[90](e),{c(){ze(e.$$.fragment)},m(a,l){We(e,a,l),i=!0},p(a,l){const g={};l[1]&268435456&&(g.playerStyle=a[59]),l[0]&8388608&&(g.callToAction=a[23]),l[0]&16777216&&(g.skipButtonStyle=a[24]),l[0]&33554432&&(g.playlistStyle=a[25]),l[0]&67108864&&(g.playlistToggle=a[26]),l[1]&65536&&(g.downloadFormats=a[47]),l[0]&4194304&&(g.playerTitle=a[22]),l[1]&131072&&(g.content=a[48]),l[0]&128&&(g.contentIndex=a[7]),l[0]&536870912&&(g.duration=a[29]),l[0]&2048&&(g.currentTime=a[11]),l[0]&1073741824&&(g.playbackState=a[30]),l[1]&1&&(g.playbackRate=a[31]),l[1]&33554432&&(g.activeAdvert=a[56]),l[2]&1&&(g.persistentAdvert=a[62]),l[1]&8&&(g.textColor=a[34]),l[1]&16&&(g.backgroundColor=a[35]),l[1]&32&&(g.iconColor=a[36]),l[1]&64&&(g.logoIconEnabled=a[37]),l[1]&1073741824&&(g.videoIsBehind=a[61]),e.$set(g)},i(a){i||(X(e.$$.fragment,a),i=!0)},o(a){se(e.$$.fragment,a),i=!1},d(a){t[90](null),je(e,a)}}}function Wc(t){let e,i;return e=new vl({props:{root:t[13],$$slots:{default:[vb]},$$scope:{ctx:t}}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[0]&8192&&(l.root=n[13]),a[0]&1639987328|a[1]&167977087|a[2]&1|a[4]&65536&&(l.$$scope={dirty:a,ctx:n}),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function vb(t){let e,i,n={onEvent:t[53],playerStyle:t[12],callToAction:t[23],skipButtonStyle:t[24],playlistStyle:"hide",playlistToggle:"hide",downloadFormats:t[47],playerTitle:t[22],fixedPosition:!t[13]&&t[32],fixedWidth:t[33],content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[11],playbackState:t[30],playbackRate:t[31],activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36],logoIconEnabled:t[37],videoIsBehind:t[58]};return e=new gl({props:n}),t[91](e),{c(){ze(e.$$.fragment)},m(a,l){We(e,a,l),i=!0},p(a,l){const g={};l[0]&4096&&(g.playerStyle=a[12]),l[0]&8388608&&(g.callToAction=a[23]),l[0]&16777216&&(g.skipButtonStyle=a[24]),l[1]&65536&&(g.downloadFormats=a[47]),l[0]&4194304&&(g.playerTitle=a[22]),l[0]&8192|l[1]&2&&(g.fixedPosition=!a[13]&&a[32]),l[1]&4&&(g.fixedWidth=a[33]),l[1]&131072&&(g.content=a[48]),l[0]&128&&(g.contentIndex=a[7]),l[0]&536870912&&(g.duration=a[29]),l[0]&2048&&(g.currentTime=a[11]),l[0]&1073741824&&(g.playbackState=a[30]),l[1]&1&&(g.playbackRate=a[31]),l[1]&33554432&&(g.activeAdvert=a[56]),l[2]&1&&(g.persistentAdvert=a[62]),l[1]&8&&(g.textColor=a[34]),l[1]&16&&(g.backgroundColor=a[35]),l[1]&32&&(g.iconColor=a[36]),l[1]&64&&(g.logoIconEnabled=a[37]),l[1]&134217728&&(g.videoIsBehind=a[58]),e.$set(g)},i(a){i||(X(e.$$.fragment,a),i=!0)},o(a){se(e.$$.fragment,a),i=!1},d(a){t[91](null),je(e,a)}}}function mb(t){let e,i;return e=new gl({props:{onEvent:t[92],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[60]?t[11]:t[54].startTime,playbackState:t[60]?t[30]:"paused",activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36]}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[1]&75497472&&(l.onEvent=n[92]),a[1]&131072&&(l.content=n[48]),a[0]&128&&(l.contentIndex=n[7]),a[0]&536870912&&(l.duration=n[29]),a[0]&2048|a[1]&545259520&&(l.currentTime=n[60]?n[11]:n[54].startTime),a[0]&1073741824|a[1]&536870912&&(l.playbackState=n[60]?n[30]:"paused"),a[1]&33554432&&(l.activeAdvert=n[56]),a[2]&1&&(l.persistentAdvert=n[62]),a[1]&8&&(l.textColor=n[34]),a[1]&16&&(l.backgroundColor=n[35]),a[1]&32&&(l.iconColor=n[36]),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function jc(t,e){let i,n,a;return n=new vl({props:{root:e[137],$$slots:{default:[mb]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=Yn(),ze(n.$$.fragment),this.first=i},m(l,g){te(l,i,g),We(n,l,g),a=!0},p(l,g){e=l;const p={};g[1]&32768&&(p.root=e[137]),g[0]&1610614912|g[1]&646053944|g[2]&1|g[4]&65536&&(p.$$scope={dirty:g,ctx:e}),n.$set(p)},i(l){a||(X(n.$$.fragment,l),a=!0)},o(l){se(n.$$.fragment,l),a=!1},d(l){l&&$(i),je(n,l)}}}function Gc(t){let e,i;return e=new vl({props:{root:t[21],$$slots:{default:[pb]},$$scope:{ctx:t}}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[0]&2097152&&(l.root=n[21]),a[0]&2145386495|a[1]&919551|a[4]&65536&&(l.$$scope={dirty:a,ctx:n}),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function pb(t){let e,i,n,a,l,g,p,_,T,k,C,F,U,V,z,H,oe,ce,ge,ve,le,Se,ee,L,ae,W,Ze,Ce,Re,Oe,K,Z,B,Ke,Me,we,Ue,ie,pe,ft,Ae,Le,qe;function Lt(Y){t[93](Y)}function Pt(Y){t[94](Y)}function Jt(Y){t[95](Y)}function Tt(Y){t[96](Y)}function Wt(Y){t[97](Y)}function jt(Y){t[98](Y)}function ut(Y){t[99](Y)}function wt(Y){t[100](Y)}function Te(Y){t[101](Y)}function gt(Y){t[102](Y)}function ii(Y){t[103](Y)}function Kt(Y){t[104](Y)}function Nt(Y){t[105](Y)}function kt(Y){t[106](Y)}function st(Y){t[107](Y)}function Ft(Y){t[108](Y)}function ui(Y){t[109](Y)}function ci(Y){t[110](Y)}function Dt(Y){t[111](Y)}function Ot(Y){t[112](Y)}function Bt(Y){t[113](Y)}function Gt(Y){t[114](Y)}function ri(Y){t[115](Y)}function Qt(Y){t[116](Y)}function ni(Y){t[117](Y)}function di(Y){t[118](Y)}function It(Y){t[119](Y)}function at(Y){t[120](Y)}function si(Y){t[121](Y)}function De(Y){t[122](Y)}function fi(Y){t[123](Y)}function Yt(Y){t[124](Y)}function Je(Y){t[125](Y)}function Ai(Y){t[126](Y)}function Ut(Y){t[127](Y)}function _e(Y){t[128](Y)}function hi(Y){t[129](Y)}function gi(Y){t[130](Y)}function bi(Y){t[131](Y)}function vi(Y){t[132](Y)}function Pi(Y){t[133](Y)}let Ve={content:t[48],introsOutros:t[49],adverts:t[50]};return t[0]!==void 0&&(Ve.projectId=t[0]),t[1]!==void 0&&(Ve.contentId=t[1]),t[2]!==void 0&&(Ve.playlistId=t[2]),t[3]!==void 0&&(Ve.sourceId=t[3]),t[4]!==void 0&&(Ve.sourceUrl=t[4]),t[5]!==void 0&&(Ve.showUserInterface=t[5]),t[6]!==void 0&&(Ve.playerStyle=t[6]),t[22]!==void 0&&(Ve.playerTitle=t[22]),t[23]!==void 0&&(Ve.callToAction=t[23]),t[24]!==void 0&&(Ve.skipButtonStyle=t[24]),t[25]!==void 0&&(Ve.playlistStyle=t[25]),t[26]!==void 0&&(Ve.playlistToggle=t[26]),t[27]!==void 0&&(Ve.mediaSession=t[27]),t[7]!==void 0&&(Ve.contentIndex=t[7]),t[8]!==void 0&&(Ve.introsOutrosIndex=t[8]),t[9]!==void 0&&(Ve.advertIndex=t[9]),t[28]!==void 0&&(Ve.persistentAdImage=t[28]),t[10]!==void 0&&(Ve.persistentIndex=t[10]),t[29]!==void 0&&(Ve.duration=t[29]),t[11]!==void 0&&(Ve.currentTime=t[11]),t[30]!==void 0&&(Ve.playbackState=t[30]),t[31]!==void 0&&(Ve.playbackRate=t[31]),t[12]!==void 0&&(Ve.widgetStyle=t[12]),t[32]!==void 0&&(Ve.widgetPosition=t[32]),t[33]!==void 0&&(Ve.widgetWidth=t[33]),t[13]!==void 0&&(Ve.widgetTarget=t[13]),t[34]!==void 0&&(Ve.textColor=t[34]),t[35]!==void 0&&(Ve.backgroundColor=t[35]),t[36]!==void 0&&(Ve.iconColor=t[36]),t[14]!==void 0&&(Ve.highlightColor=t[14]),t[37]!==void 0&&(Ve.logoIconEnabled=t[37]),t[15]!==void 0&&(Ve.highlightSections=t[15]),t[16]!==void 0&&(Ve.clickableSections=t[16]),t[17]!==void 0&&(Ve.segmentWidgetSections=t[17]),t[18]!==void 0&&(Ve.segmentWidgetPosition=t[18]),t[19]!==void 0&&(Ve.currentSegment=t[19]),t[20]!==void 0&&(Ve.hoveredSegment=t[20]),t[38]!==void 0&&(Ve.advertConsent=t[38]),t[39]!==void 0&&(Ve.analyticsConsent=t[39]),t[40]!==void 0&&(Ve.analyticsCustomUrl=t[40]),t[41]!==void 0&&(Ve.analyticsTag=t[41]),e=new D1({props:Ve}),Fe.push(()=>$e(e,"projectId",Lt)),Fe.push(()=>$e(e,"contentId",Pt)),Fe.push(()=>$e(e,"playlistId",Jt)),Fe.push(()=>$e(e,"sourceId",Tt)),Fe.push(()=>$e(e,"sourceUrl",Wt)),Fe.push(()=>$e(e,"showUserInterface",jt)),Fe.push(()=>$e(e,"playerStyle",ut)),Fe.push(()=>$e(e,"playerTitle",wt)),Fe.push(()=>$e(e,"callToAction",Te)),Fe.push(()=>$e(e,"skipButtonStyle",gt)),Fe.push(()=>$e(e,"playlistStyle",ii)),Fe.push(()=>$e(e,"playlistToggle",Kt)),Fe.push(()=>$e(e,"mediaSession",Nt)),Fe.push(()=>$e(e,"contentIndex",kt)),Fe.push(()=>$e(e,"introsOutrosIndex",st)),Fe.push(()=>$e(e,"advertIndex",Ft)),Fe.push(()=>$e(e,"persistentAdImage",ui)),Fe.push(()=>$e(e,"persistentIndex",ci)),Fe.push(()=>$e(e,"duration",Dt)),Fe.push(()=>$e(e,"currentTime",Ot)),Fe.push(()=>$e(e,"playbackState",Bt)),Fe.push(()=>$e(e,"playbackRate",Gt)),Fe.push(()=>$e(e,"widgetStyle",ri)),Fe.push(()=>$e(e,"widgetPosition",Qt)),Fe.push(()=>$e(e,"widgetWidth",ni)),Fe.push(()=>$e(e,"widgetTarget",di)),Fe.push(()=>$e(e,"textColor",It)),Fe.push(()=>$e(e,"backgroundColor",at)),Fe.push(()=>$e(e,"iconColor",si)),Fe.push(()=>$e(e,"highlightColor",De)),Fe.push(()=>$e(e,"logoIconEnabled",fi)),Fe.push(()=>$e(e,"highlightSections",Yt)),Fe.push(()=>$e(e,"clickableSections",Je)),Fe.push(()=>$e(e,"segmentWidgetSections",Ai)),Fe.push(()=>$e(e,"segmentWidgetPosition",Ut)),Fe.push(()=>$e(e,"currentSegment",_e)),Fe.push(()=>$e(e,"hoveredSegment",hi)),Fe.push(()=>$e(e,"advertConsent",gi)),Fe.push(()=>$e(e,"analyticsConsent",bi)),Fe.push(()=>$e(e,"analyticsCustomUrl",vi)),Fe.push(()=>$e(e,"analyticsTag",Pi)),{c(){ze(e.$$.fragment)},m(Y,J){We(e,Y,J),qe=!0},p(Y,J){const Ne={};J[1]&131072&&(Ne.content=Y[48]),J[1]&262144&&(Ne.introsOutros=Y[49]),J[1]&524288&&(Ne.adverts=Y[50]),!i&&J[0]&1&&(i=!0,Ne.projectId=Y[0],Qe(()=>i=!1)),!n&&J[0]&2&&(n=!0,Ne.contentId=Y[1],Qe(()=>n=!1)),!a&&J[0]&4&&(a=!0,Ne.playlistId=Y[2],Qe(()=>a=!1)),!l&&J[0]&8&&(l=!0,Ne.sourceId=Y[3],Qe(()=>l=!1)),!g&&J[0]&16&&(g=!0,Ne.sourceUrl=Y[4],Qe(()=>g=!1)),!p&&J[0]&32&&(p=!0,Ne.showUserInterface=Y[5],Qe(()=>p=!1)),!_&&J[0]&64&&(_=!0,Ne.playerStyle=Y[6],Qe(()=>_=!1)),!T&&J[0]&4194304&&(T=!0,Ne.playerTitle=Y[22],Qe(()=>T=!1)),!k&&J[0]&8388608&&(k=!0,Ne.callToAction=Y[23],Qe(()=>k=!1)),!C&&J[0]&16777216&&(C=!0,Ne.skipButtonStyle=Y[24],Qe(()=>C=!1)),!F&&J[0]&33554432&&(F=!0,Ne.playlistStyle=Y[25],Qe(()=>F=!1)),!U&&J[0]&67108864&&(U=!0,Ne.playlistToggle=Y[26],Qe(()=>U=!1)),!V&&J[0]&134217728&&(V=!0,Ne.mediaSession=Y[27],Qe(()=>V=!1)),!z&&J[0]&128&&(z=!0,Ne.contentIndex=Y[7],Qe(()=>z=!1)),!H&&J[0]&256&&(H=!0,Ne.introsOutrosIndex=Y[8],Qe(()=>H=!1)),!oe&&J[0]&512&&(oe=!0,Ne.advertIndex=Y[9],Qe(()=>oe=!1)),!ce&&J[0]&268435456&&(ce=!0,Ne.persistentAdImage=Y[28],Qe(()=>ce=!1)),!ge&&J[0]&1024&&(ge=!0,Ne.persistentIndex=Y[10],Qe(()=>ge=!1)),!ve&&J[0]&536870912&&(ve=!0,Ne.duration=Y[29],Qe(()=>ve=!1)),!le&&J[0]&2048&&(le=!0,Ne.currentTime=Y[11],Qe(()=>le=!1)),!Se&&J[0]&1073741824&&(Se=!0,Ne.playbackState=Y[30],Qe(()=>Se=!1)),!ee&&J[1]&1&&(ee=!0,Ne.playbackRate=Y[31],Qe(()=>ee=!1)),!L&&J[0]&4096&&(L=!0,Ne.widgetStyle=Y[12],Qe(()=>L=!1)),!ae&&J[1]&2&&(ae=!0,Ne.widgetPosition=Y[32],Qe(()=>ae=!1)),!W&&J[1]&4&&(W=!0,Ne.widgetWidth=Y[33],Qe(()=>W=!1)),!Ze&&J[0]&8192&&(Ze=!0,Ne.widgetTarget=Y[13],Qe(()=>Ze=!1)),!Ce&&J[1]&8&&(Ce=!0,Ne.textColor=Y[34],Qe(()=>Ce=!1)),!Re&&J[1]&16&&(Re=!0,Ne.backgroundColor=Y[35],Qe(()=>Re=!1)),!Oe&&J[1]&32&&(Oe=!0,Ne.iconColor=Y[36],Qe(()=>Oe=!1)),!K&&J[0]&16384&&(K=!0,Ne.highlightColor=Y[14],Qe(()=>K=!1)),!Z&&J[1]&64&&(Z=!0,Ne.logoIconEnabled=Y[37],Qe(()=>Z=!1)),!B&&J[0]&32768&&(B=!0,Ne.highlightSections=Y[15],Qe(()=>B=!1)),!Ke&&J[0]&65536&&(Ke=!0,Ne.clickableSections=Y[16],Qe(()=>Ke=!1)),!Me&&J[0]&131072&&(Me=!0,Ne.segmentWidgetSections=Y[17],Qe(()=>Me=!1)),!we&&J[0]&262144&&(we=!0,Ne.segmentWidgetPosition=Y[18],Qe(()=>we=!1)),!Ue&&J[0]&524288&&(Ue=!0,Ne.currentSegment=Y[19],Qe(()=>Ue=!1)),!ie&&J[0]&1048576&&(ie=!0,Ne.hoveredSegment=Y[20],Qe(()=>ie=!1)),!pe&&J[1]&128&&(pe=!0,Ne.advertConsent=Y[38],Qe(()=>pe=!1)),!ft&&J[1]&256&&(ft=!0,Ne.analyticsConsent=Y[39],Qe(()=>ft=!1)),!Ae&&J[1]&512&&(Ae=!0,Ne.analyticsCustomUrl=Y[40],Qe(()=>Ae=!1)),!Le&&J[1]&1024&&(Le=!0,Ne.analyticsTag=Y[41],Qe(()=>Le=!1)),e.$set(Ne)},i(Y){qe||(X(e.$$.fragment,Y),qe=!0)},o(Y){se(e.$$.fragment,Y),qe=!1},d(Y){je(e,Y)}}}function zc(t){let e,i;return e=new H1({props:{onEvent:t[53],content:t[48],contentIndex:t[7],activeAdvert:t[56],persistentAdvert:t[62],duration:t[29],playbackState:t[30],skipButtonStyle:t[24],backgroundColor:t[35],iconColor:t[36]}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[1]&131072&&(l.content=n[48]),a[0]&128&&(l.contentIndex=n[7]),a[1]&33554432&&(l.activeAdvert=n[56]),a[2]&1&&(l.persistentAdvert=n[62]),a[0]&536870912&&(l.duration=n[29]),a[0]&1073741824&&(l.playbackState=n[30]),a[0]&16777216&&(l.skipButtonStyle=n[24]),a[1]&16&&(l.backgroundColor=n[35]),a[1]&32&&(l.iconColor=n[36]),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function Hc(t){let e,i;return e=new Z1({props:{analyticsTag:t[41]}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[1]&1024&&(l.analyticsTag=n[41]),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function _b(t){let e,i,n,a,l,g,p,_,T,k=[],C=new Map,F,U,V,z,H,oe;function ce(K){t[85](K)}function ge(K){t[86](K)}function ve(K){t[87](K)}function le(K){t[88](K)}function Se(K){t[89](K)}let ee={onEvent:t[53],content:t[48],contentIndex:t[7],introOrOutro:t[55],activeAdvert:t[56],advertConsent:t[38],videoBehindWidget:t[58],videoBehindStatic:t[61],widgetPosition:t[32],widgetWidth:t[33]};t[30]!==void 0&&(ee.playbackState=t[30]),t[29]!==void 0&&(ee.duration=t[29]),t[11]!==void 0&&(ee.currentTime=t[11]),t[31]!==void 0&&(ee.playbackRate=t[31]),t[45]!==void 0&&(ee.prevPercentage=t[45]),e=new Iv({props:ee}),t[84](e),Fe.push(()=>$e(e,"playbackState",ce)),Fe.push(()=>$e(e,"duration",ge)),Fe.push(()=>$e(e,"currentTime",ve)),Fe.push(()=>$e(e,"playbackRate",le)),Fe.push(()=>$e(e,"prevPercentage",Se));let L=t[5]&&Vc(t),ae=(t[51]||t[13])&&Wc(t),W=t[46];const Ze=K=>K[137];for(let K=0;K<W.length;K+=1){let Z=Uc(t,W,K),B=Ze(Z);C.set(B,k[K]=jc(B,Z))}let Ce=t[21]&&Gc(t),Re=t[52]&&zc(t),Oe=t[41]&&Hc(t);return H=new J1({}),{c(){ze(e.$$.fragment),p=Pe(),L&&L.c(),_=Pe(),ae&&ae.c(),T=Pe();for(let K=0;K<k.length;K+=1)k[K].c();F=Pe(),Ce&&Ce.c(),U=Pe(),Re&&Re.c(),V=Pe(),Oe&&Oe.c(),z=Pe(),ze(H.$$.fragment)},m(K,Z){We(e,K,Z),te(K,p,Z),L&&L.m(K,Z),te(K,_,Z),ae&&ae.m(K,Z),te(K,T,Z);for(let B=0;B<k.length;B+=1)k[B]&&k[B].m(K,Z);te(K,F,Z),Ce&&Ce.m(K,Z),te(K,U,Z),Re&&Re.m(K,Z),te(K,V,Z),Oe&&Oe.m(K,Z),te(K,z,Z),We(H,K,Z),oe=!0},p(K,Z){const B={};Z[1]&131072&&(B.content=K[48]),Z[0]&128&&(B.contentIndex=K[7]),Z[1]&16777216&&(B.introOrOutro=K[55]),Z[1]&33554432&&(B.activeAdvert=K[56]),Z[1]&128&&(B.advertConsent=K[38]),Z[1]&134217728&&(B.videoBehindWidget=K[58]),Z[1]&1073741824&&(B.videoBehindStatic=K[61]),Z[1]&2&&(B.widgetPosition=K[32]),Z[1]&4&&(B.widgetWidth=K[33]),!i&&Z[0]&1073741824&&(i=!0,B.playbackState=K[30],Qe(()=>i=!1)),!n&&Z[0]&536870912&&(n=!0,B.duration=K[29],Qe(()=>n=!1)),!a&&Z[0]&2048&&(a=!0,B.currentTime=K[11],Qe(()=>a=!1)),!l&&Z[1]&1&&(l=!0,B.playbackRate=K[31],Qe(()=>l=!1)),!g&&Z[1]&16384&&(g=!0,B.prevPercentage=K[45],Qe(()=>g=!1)),e.$set(B),K[5]?L?(L.p(K,Z),Z[0]&32&&X(L,1)):(L=Vc(K),L.c(),X(L,1),L.m(_.parentNode,_)):L&&(Et(),se(L,1,1,()=>{L=null}),At()),K[51]||K[13]?ae?(ae.p(K,Z),Z[0]&8192|Z[1]&1048576&&X(ae,1)):(ae=Wc(K),ae.c(),X(ae,1),ae.m(T.parentNode,T)):ae&&(Et(),se(ae,1,1,()=>{ae=null}),At()),Z[0]&1610614912|Z[1]&650281016|Z[2]&1&&(W=K[46],Et(),k=qh(k,Z,Ze,1,K,W,C,F.parentNode,Yh,jc,F,Uc),At()),K[21]?Ce?(Ce.p(K,Z),Z[0]&2097152&&X(Ce,1)):(Ce=Gc(K),Ce.c(),X(Ce,1),Ce.m(U.parentNode,U)):Ce&&(Et(),se(Ce,1,1,()=>{Ce=null}),At()),K[52]?Re?(Re.p(K,Z),Z[1]&2097152&&X(Re,1)):(Re=zc(K),Re.c(),X(Re,1),Re.m(V.parentNode,V)):Re&&(Et(),se(Re,1,1,()=>{Re=null}),At()),K[41]?Oe?(Oe.p(K,Z),Z[1]&1024&&X(Oe,1)):(Oe=Hc(K),Oe.c(),X(Oe,1),Oe.m(z.parentNode,z)):Oe&&(Et(),se(Oe,1,1,()=>{Oe=null}),At())},i(K){if(!oe){X(e.$$.fragment,K),X(L),X(ae);for(let Z=0;Z<W.length;Z+=1)X(k[Z]);X(Ce),X(Re),X(Oe),X(H.$$.fragment,K),oe=!0}},o(K){se(e.$$.fragment,K),se(L),se(ae);for(let Z=0;Z<k.length;Z+=1)se(k[Z]);se(Ce),se(Re),se(Oe),se(H.$$.fragment,K),oe=!1},d(K){t[84](null),je(e,K),K&&$(p),L&&L.d(K),K&&$(_),ae&&ae.d(K),K&&$(T);for(let Z=0;Z<k.length;Z+=1)k[Z].d(K);K&&$(F),Ce&&Ce.d(K),K&&$(U),Re&&Re.d(K),K&&$(V),Oe&&Oe.d(K),K&&$(z),je(H,K)}}}function yb(t,e,i){let n,a,l,g,p,_,T,k,C,F,U,V,z,{playerApiUrl:H="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:oe=void 0}=e,{contentId:ce=void 0}=e,{playlistId:ge=void 0}=e,{sourceId:ve=void 0}=e,{sourceUrl:le=void 0}=e,{playlist:Se=[]}=e,{showUserInterface:ee=!0}=e,{playerStyle:L="standard"}=e,{playerTitle:ae=void 0}=e,{callToAction:W=void 0}=e,{skipButtonStyle:Ze="auto"}=e,{playlistStyle:Ce="auto-5-4"}=e,{playlistToggle:Re="auto"}=e,{downloadFormats:Oe=[]}=e,{mediaSession:K="auto"}=e,{content:Z=[]}=e,{contentIndex:B=0}=e,{introsOutros:Ke=[]}=e,{introsOutrosIndex:Me=-1}=e,{adverts:we=[]}=e,{advertIndex:Ue=-1}=e,{persistentAdImage:ie=!1}=e,{persistentIndex:pe=-1}=e,{duration:ft=0}=e,{currentTime:Ae=0}=e,{playbackState:Le="stopped"}=e,{playbackRate:qe=1}=e,{widgetStyle:Lt="standard"}=e,{widgetPosition:Pt="auto"}=e,{widgetWidth:Jt="auto"}=e,{widgetTarget:Tt=void 0}=e,{textColor:Wt="#111"}=e,{backgroundColor:jt="#f5f5f5"}=e,{iconColor:ut="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:wt="#eee"}=e,{logoIconEnabled:Te=!0}=e,{highlightSections:gt="all"}=e,{clickableSections:ii="all"}=e,{segmentWidgetSections:Kt="body"}=e,{segmentWidgetPosition:Nt="7-oclock"}=e,{currentSegment:kt=void 0}=e,{hoveredSegment:st=void 0}=e,{advertConsent:Ft="personalized"}=e,{analyticsConsent:ui="allowed"}=e,{analyticsCustomUrl:ci=void 0}=e,{analyticsTag:Dt=void 0}=e,{writeToken:Ot=void 0}=e,{captureErrors:Bt=!0}=e,{transitions:Gt=[]}=e,{controlPanel:ri=void 0}=e;const Qt=(...R)=>Je.addEventListener(...R),ni=(...R)=>Je.removeEventListener(...R);let{initialProps:di={}}=e,{showBottomWidget:It=!1}=e,{showMediaSession:at=!1}=e,{isFullScreen:si=!1}=e,{mediaElement:De=void 0}=e,{userInterface:fi=void 0}=e,{widgetInterface:Yt=void 0}=e,{controller:Je=void 0}=e,{analyticsUrl:Ai=void 0}=e,{analyticsId:Ut=void 0}=e,{listenSessionId:_e=void 0}=e,{sessionCreatedAt:hi=void 0}=e,{isNewListen:gi=!1}=e,{prevPercentage:bi=0}=e,{segmentWidgets:vi=[]}=e,{segmentContainers:Pi=new xs(R=>i(46,vi=R))}=e,{segmentClickables:Ve=new As}=e,{segmentHighlights:Y=new Es}=e;const J=R=>Je.processEvent(fe({emittedFrom:p},R)),Ne=()=>i(82,k=st);function Qr(R){Fe[R?"unshift":"push"](()=>{De=R,i(42,De)})}function Wi(R){Le=R,i(30,Le)}function $r(R){ft=R,i(29,ft)}function ai(R){Ae=R,i(11,Ae)}function vr(R){qe=R,i(31,qe)}function Xi(R){bi=R,i(45,bi)}function Zi(R){Fe[R?"unshift":"push"](()=>{fi=R,i(43,fi)})}function ji(R){Fe[R?"unshift":"push"](()=>{Yt=R,i(44,Yt)})}const or=R=>J(ti(fe({},R),{emittedFrom:"segment-widget",widgetSegment:U,widgetIsCurrent:V}));function kr(R){oe=R,i(0,oe)}function Ii(R){ce=R,i(1,ce)}function Ri(R){ge=R,i(2,ge)}function lr(R){ve=R,i(3,ve)}function Er(R){le=R,i(4,le)}function Gi(R){ee=R,i(5,ee)}function Si(R){L=R,i(6,L)}function zi(R){ae=R,i(22,ae)}function Di(R){W=R,i(23,W)}function qt(R){Ze=R,i(24,Ze)}function Hi(R){Ce=R,i(25,Ce)}function Xt(R){Re=R,i(26,Re)}function mr(R){K=R,i(27,K)}function $t(R){B=R,i(7,B)}function j(R){Me=R,i(8,Me)}function ye(R){Ue=R,i(9,Ue)}function be(R){ie=R,i(28,ie)}function ot(R){pe=R,i(10,pe)}function Or(R){ft=R,i(29,ft)}function Ar(R){Ae=R,i(11,Ae)}function en(R){Le=R,i(30,Le)}function Vs(R){qe=R,i(31,qe)}function mn(R){Lt=R,i(12,Lt)}function Ws(R){Pt=R,i(32,Pt)}function Ki(R){Jt=R,i(33,Jt)}function tn(R){Tt=R,i(13,Tt)}function xi(R){Wt=R,i(34,Wt)}function rn(R){jt=R,i(35,jt)}function xr(R){ut=R,i(36,ut)}function pr(R){wt=R,i(14,wt)}function Fn(R){Te=R,i(37,Te)}function pn(R){gt=R,i(15,gt)}function js(R){ii=R,i(16,ii)}function _r(R){Kt=R,i(17,Kt)}function Un(R){Nt=R,i(18,Nt)}function Br(R){kt=R,i(19,kt)}function Gs(R){st=R,i(20,st)}function rs(R){Ft=R,i(38,Ft)}function ns(R){ui=R,i(39,ui)}function Vn(R){ci=R,i(40,ci)}function Mr(R){Dt=R,i(41,Dt)}return t.$$set=R=>{"playerApiUrl"in R&&i(63,H=R.playerApiUrl),"projectId"in R&&i(0,oe=R.projectId),"contentId"in R&&i(1,ce=R.contentId),"playlistId"in R&&i(2,ge=R.playlistId),"sourceId"in R&&i(3,ve=R.sourceId),"sourceUrl"in R&&i(4,le=R.sourceUrl),"playlist"in R&&i(64,Se=R.playlist),"showUserInterface"in R&&i(5,ee=R.showUserInterface),"playerStyle"in R&&i(6,L=R.playerStyle),"playerTitle"in R&&i(22,ae=R.playerTitle),"callToAction"in R&&i(23,W=R.callToAction),"skipButtonStyle"in R&&i(24,Ze=R.skipButtonStyle),"playlistStyle"in R&&i(25,Ce=R.playlistStyle),"playlistToggle"in R&&i(26,Re=R.playlistToggle),"downloadFormats"in R&&i(47,Oe=R.downloadFormats),"mediaSession"in R&&i(27,K=R.mediaSession),"content"in R&&i(48,Z=R.content),"contentIndex"in R&&i(7,B=R.contentIndex),"introsOutros"in R&&i(49,Ke=R.introsOutros),"introsOutrosIndex"in R&&i(8,Me=R.introsOutrosIndex),"adverts"in R&&i(50,we=R.adverts),"advertIndex"in R&&i(9,Ue=R.advertIndex),"persistentAdImage"in R&&i(28,ie=R.persistentAdImage),"persistentIndex"in R&&i(10,pe=R.persistentIndex),"duration"in R&&i(29,ft=R.duration),"currentTime"in R&&i(11,Ae=R.currentTime),"playbackState"in R&&i(30,Le=R.playbackState),"playbackRate"in R&&i(31,qe=R.playbackRate),"widgetStyle"in R&&i(12,Lt=R.widgetStyle),"widgetPosition"in R&&i(32,Pt=R.widgetPosition),"widgetWidth"in R&&i(33,Jt=R.widgetWidth),"widgetTarget"in R&&i(13,Tt=R.widgetTarget),"textColor"in R&&i(34,Wt=R.textColor),"backgroundColor"in R&&i(35,jt=R.backgroundColor),"iconColor"in R&&i(36,ut=R.iconColor),"highlightColor"in R&&i(14,wt=R.highlightColor),"logoIconEnabled"in R&&i(37,Te=R.logoIconEnabled),"highlightSections"in R&&i(15,gt=R.highlightSections),"clickableSections"in R&&i(16,ii=R.clickableSections),"segmentWidgetSections"in R&&i(17,Kt=R.segmentWidgetSections),"segmentWidgetPosition"in R&&i(18,Nt=R.segmentWidgetPosition),"currentSegment"in R&&i(19,kt=R.currentSegment),"hoveredSegment"in R&&i(20,st=R.hoveredSegment),"advertConsent"in R&&i(38,Ft=R.advertConsent),"analyticsConsent"in R&&i(39,ui=R.analyticsConsent),"analyticsCustomUrl"in R&&i(40,ci=R.analyticsCustomUrl),"analyticsTag"in R&&i(41,Dt=R.analyticsTag),"writeToken"in R&&i(65,Ot=R.writeToken),"captureErrors"in R&&i(66,Bt=R.captureErrors),"transitions"in R&&i(67,Gt=R.transitions),"controlPanel"in R&&i(21,ri=R.controlPanel),"initialProps"in R&&i(70,di=R.initialProps),"showBottomWidget"in R&&i(51,It=R.showBottomWidget),"showMediaSession"in R&&i(52,at=R.showMediaSession),"isFullScreen"in R&&i(71,si=R.isFullScreen),"mediaElement"in R&&i(42,De=R.mediaElement),"userInterface"in R&&i(43,fi=R.userInterface),"widgetInterface"in R&&i(44,Yt=R.widgetInterface),"controller"in R&&i(72,Je=R.controller),"analyticsUrl"in R&&i(73,Ai=R.analyticsUrl),"analyticsId"in R&&i(74,Ut=R.analyticsId),"listenSessionId"in R&&i(75,_e=R.listenSessionId),"sessionCreatedAt"in R&&i(76,hi=R.sessionCreatedAt),"isNewListen"in R&&i(77,gi=R.isNewListen),"prevPercentage"in R&&i(45,bi=R.prevPercentage),"segmentWidgets"in R&&i(46,vi=R.segmentWidgets),"segmentContainers"in R&&i(78,Pi=R.segmentContainers),"segmentClickables"in R&&i(79,Ve=R.segmentClickables),"segmentHighlights"in R&&i(80,Y=R.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&256|t.$$.dirty[1]&262144&&i(55,n=Ke[Me]),t.$$.dirty[0]&512|t.$$.dirty[1]&524288&&i(56,a=we[Ue]),t.$$.dirty[0]&1024|t.$$.dirty[1]&524288&&i(62,l=we[pe]),t.$$.dirty[0]&128|t.$$.dirty[1]&131072&&Z[B],t.$$.dirty[0]&64|t.$$.dirty[2]&512&&i(59,g=si?"video":L),t.$$.dirty[0]&4096|t.$$.dirty[1]&1048576|t.$$.dirty[2]&512&&i(58,_=It&&Lt==="video"&&!si),t.$$.dirty[1]&134217728&&(p=_?"bottom-widget":"inline-player"),t.$$.dirty[0]&8192&&i(13,Tt=pl(Tt)),t.$$.dirty[0]&2097152&&i(21,ri=pl(ri)),t.$$.dirty[0]&32|t.$$.dirty[1]&402653184&&i(61,T=ee&&g==="video"&&!_),t.$$.dirty[0]&31|t.$$.dirty[2]&4&&J(Q1()),t.$$.dirty[0]&1|t.$$.dirty[2]&10&&tb(H,oe,Ot,R=>J(R)),t.$$.dirty[0]&1048576|t.$$.dirty[2]&1048576&&i(82,k=st||k),t.$$.dirty[0]&655360&&i(81,C=ta("current",kt,Kt)),t.$$.dirty[0]&524288|t.$$.dirty[2]&524288&&C&&Ne(),t.$$.dirty[0]&131072|t.$$.dirty[2]&1048576&&i(83,F=ta("hovered",k,Kt)),t.$$.dirty[0]&524288|t.$$.dirty[2]&3670016&&i(54,U=F&&k||C&&kt),t.$$.dirty[0]&524288|t.$$.dirty[1]&8388608&&i(57,V=(U==null?void 0:U.marker)===(kt==null?void 0:kt.marker)),t.$$.dirty[1]&117440512&&i(60,z=V||a||n),t.$$.dirty[0]&393280|t.$$.dirty[1]&8388608|t.$$.dirty[2]&65536&&Pi.update(U,Kt,Nt,L),t.$$.dirty[0]&1114112|t.$$.dirty[2]&131072&&Ve.update(st,ii),t.$$.dirty[0]&573440|t.$$.dirty[2]&262144&&Y.update("current",kt,gt,wt),t.$$.dirty[0]&1097728|t.$$.dirty[2]&262144&&Y.update("hovered",st,gt,wt),t.$$.dirty[0]&2048|t.$$.dirty[2]&1056&&ob(Gt,Je,Ae)},[oe,ce,ge,ve,le,ee,L,B,Me,Ue,pe,Ae,Lt,Tt,wt,gt,ii,Kt,Nt,kt,st,ri,ae,W,Ze,Ce,Re,K,ie,ft,Le,qe,Pt,Jt,Wt,jt,ut,Te,Ft,ui,ci,Dt,De,fi,Yt,bi,vi,Oe,Z,Ke,we,It,at,J,U,n,a,V,_,g,z,T,l,H,Se,Ot,Bt,Gt,Qt,ni,di,si,Je,Ai,Ut,_e,hi,gi,Pi,Ve,Y,C,k,F,Qr,Wi,$r,ai,vr,Xi,Zi,ji,or,kr,Ii,Ri,lr,Er,Gi,Si,zi,Di,qt,Hi,Xt,mr,$t,j,ye,be,ot,Or,Ar,en,Vs,mn,Ws,Ki,tn,xi,rn,xr,pr,Fn,pn,js,_r,Un,Br,Gs,rs,ns,Vn,Mr]}let bb=class extends it{constructor(e){super(),tt(this,e,yb,_b,Xe,{playerApiUrl:63,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:64,showUserInterface:5,playerStyle:6,playerTitle:22,callToAction:23,skipButtonStyle:24,playlistStyle:25,playlistToggle:26,downloadFormats:47,mediaSession:27,content:48,contentIndex:7,introsOutros:49,introsOutrosIndex:8,adverts:50,advertIndex:9,persistentAdImage:28,persistentIndex:10,duration:29,currentTime:11,playbackState:30,playbackRate:31,widgetStyle:12,widgetPosition:32,widgetWidth:33,widgetTarget:13,textColor:34,backgroundColor:35,iconColor:36,highlightColor:14,logoIconEnabled:37,highlightSections:15,clickableSections:16,segmentWidgetSections:17,segmentWidgetPosition:18,currentSegment:19,hoveredSegment:20,advertConsent:38,analyticsConsent:39,analyticsCustomUrl:40,analyticsTag:41,writeToken:65,captureErrors:66,transitions:67,controlPanel:21,addEventListener:68,removeEventListener:69,initialProps:70,showBottomWidget:51,showMediaSession:52,isFullScreen:71,mediaElement:42,userInterface:43,widgetInterface:44,controller:72,analyticsUrl:73,analyticsId:74,listenSessionId:75,sessionCreatedAt:76,isNewListen:77,prevPercentage:45,segmentWidgets:46,segmentContainers:78,segmentClickables:79,segmentHighlights:80,onEvent:53},null,[-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[63]}set playerApiUrl(e){this.$$set({playerApiUrl:e}),P()}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),P()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),P()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),P()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),P()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),P()}get playlist(){return this.$$.ctx[64]}set playlist(e){this.$$set({playlist:e}),P()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),P()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),P()}get playerTitle(){return this.$$.ctx[22]}set playerTitle(e){this.$$set({playerTitle:e}),P()}get callToAction(){return this.$$.ctx[23]}set callToAction(e){this.$$set({callToAction:e}),P()}get skipButtonStyle(){return this.$$.ctx[24]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),P()}get playlistStyle(){return this.$$.ctx[25]}set playlistStyle(e){this.$$set({playlistStyle:e}),P()}get playlistToggle(){return this.$$.ctx[26]}set playlistToggle(e){this.$$set({playlistToggle:e}),P()}get downloadFormats(){return this.$$.ctx[47]}set downloadFormats(e){this.$$set({downloadFormats:e}),P()}get mediaSession(){return this.$$.ctx[27]}set mediaSession(e){this.$$set({mediaSession:e}),P()}get content(){return this.$$.ctx[48]}set content(e){this.$$set({content:e}),P()}get contentIndex(){return this.$$.ctx[7]}set contentIndex(e){this.$$set({contentIndex:e}),P()}get introsOutros(){return this.$$.ctx[49]}set introsOutros(e){this.$$set({introsOutros:e}),P()}get introsOutrosIndex(){return this.$$.ctx[8]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),P()}get adverts(){return this.$$.ctx[50]}set adverts(e){this.$$set({adverts:e}),P()}get advertIndex(){return this.$$.ctx[9]}set advertIndex(e){this.$$set({advertIndex:e}),P()}get persistentAdImage(){return this.$$.ctx[28]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),P()}get persistentIndex(){return this.$$.ctx[10]}set persistentIndex(e){this.$$set({persistentIndex:e}),P()}get duration(){return this.$$.ctx[29]}set duration(e){this.$$set({duration:e}),P()}get currentTime(){return this.$$.ctx[11]}set currentTime(e){this.$$set({currentTime:e}),P()}get playbackState(){return this.$$.ctx[30]}set playbackState(e){this.$$set({playbackState:e}),P()}get playbackRate(){return this.$$.ctx[31]}set playbackRate(e){this.$$set({playbackRate:e}),P()}get widgetStyle(){return this.$$.ctx[12]}set widgetStyle(e){this.$$set({widgetStyle:e}),P()}get widgetPosition(){return this.$$.ctx[32]}set widgetPosition(e){this.$$set({widgetPosition:e}),P()}get widgetWidth(){return this.$$.ctx[33]}set widgetWidth(e){this.$$set({widgetWidth:e}),P()}get widgetTarget(){return this.$$.ctx[13]}set widgetTarget(e){this.$$set({widgetTarget:e}),P()}get textColor(){return this.$$.ctx[34]}set textColor(e){this.$$set({textColor:e}),P()}get backgroundColor(){return this.$$.ctx[35]}set backgroundColor(e){this.$$set({backgroundColor:e}),P()}get iconColor(){return this.$$.ctx[36]}set iconColor(e){this.$$set({iconColor:e}),P()}get highlightColor(){return this.$$.ctx[14]}set highlightColor(e){this.$$set({highlightColor:e}),P()}get logoIconEnabled(){return this.$$.ctx[37]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),P()}get highlightSections(){return this.$$.ctx[15]}set highlightSections(e){this.$$set({highlightSections:e}),P()}get clickableSections(){return this.$$.ctx[16]}set clickableSections(e){this.$$set({clickableSections:e}),P()}get segmentWidgetSections(){return this.$$.ctx[17]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),P()}get segmentWidgetPosition(){return this.$$.ctx[18]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),P()}get currentSegment(){return this.$$.ctx[19]}set currentSegment(e){this.$$set({currentSegment:e}),P()}get hoveredSegment(){return this.$$.ctx[20]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),P()}get advertConsent(){return this.$$.ctx[38]}set advertConsent(e){this.$$set({advertConsent:e}),P()}get analyticsConsent(){return this.$$.ctx[39]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),P()}get analyticsCustomUrl(){return this.$$.ctx[40]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),P()}get analyticsTag(){return this.$$.ctx[41]}set analyticsTag(e){this.$$set({analyticsTag:e}),P()}get writeToken(){return this.$$.ctx[65]}set writeToken(e){this.$$set({writeToken:e}),P()}get captureErrors(){return this.$$.ctx[66]}set captureErrors(e){this.$$set({captureErrors:e}),P()}get transitions(){return this.$$.ctx[67]}set transitions(e){this.$$set({transitions:e}),P()}get controlPanel(){return this.$$.ctx[21]}set controlPanel(e){this.$$set({controlPanel:e}),P()}get addEventListener(){return this.$$.ctx[68]}get removeEventListener(){return this.$$.ctx[69]}get initialProps(){return this.$$.ctx[70]}set initialProps(e){this.$$set({initialProps:e}),P()}get showBottomWidget(){return this.$$.ctx[51]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),P()}get showMediaSession(){return this.$$.ctx[52]}set showMediaSession(e){this.$$set({showMediaSession:e}),P()}get isFullScreen(){return this.$$.ctx[71]}set isFullScreen(e){this.$$set({isFullScreen:e}),P()}get mediaElement(){return this.$$.ctx[42]}set mediaElement(e){this.$$set({mediaElement:e}),P()}get userInterface(){return this.$$.ctx[43]}set userInterface(e){this.$$set({userInterface:e}),P()}get widgetInterface(){return this.$$.ctx[44]}set widgetInterface(e){this.$$set({widgetInterface:e}),P()}get controller(){return this.$$.ctx[72]}set controller(e){this.$$set({controller:e}),P()}get analyticsUrl(){return this.$$.ctx[73]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),P()}get analyticsId(){return this.$$.ctx[74]}set analyticsId(e){this.$$set({analyticsId:e}),P()}get listenSessionId(){return this.$$.ctx[75]}set listenSessionId(e){this.$$set({listenSessionId:e}),P()}get sessionCreatedAt(){return this.$$.ctx[76]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),P()}get isNewListen(){return this.$$.ctx[77]}set isNewListen(e){this.$$set({isNewListen:e}),P()}get prevPercentage(){return this.$$.ctx[45]}set prevPercentage(e){this.$$set({prevPercentage:e}),P()}get segmentWidgets(){return this.$$.ctx[46]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),P()}get segmentContainers(){return this.$$.ctx[78]}set segmentContainers(e){this.$$set({segmentContainers:e}),P()}get segmentClickables(){return this.$$.ctx[79]}set segmentClickables(e){this.$$set({segmentClickables:e}),P()}get segmentHighlights(){return this.$$.ctx[80]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),P()}get onEvent(){return this.$$.ctx[53]}};class Sb{constructor(e,i){this.baseUrl=e==null?void 0:e.replace("{id}",i)}byContentId(e){return Xn(`${this.baseUrl}/by_content_id/${e}`)}byPlaylistId(e){return Xn(`${this.baseUrl}/by_playlist_id/${e}`)}bySourceId(e){return Xn(`${this.baseUrl}/by_source_id/${e}`)}bySourceUrl(e){return Xn(`${this.baseUrl}/by_source_url/${e}`)}byIdentifiers(e){return Xn(`${this.baseUrl}/by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}const _l=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(_l):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),_l(i)])),Kc=t=>t==="dark"||t==="auto"&&Tb()?"dark":"light",Tb=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Yc=t=>on(this,null,function*(){const e=new Sb(t.playerApiUrl,t.projectId);if(!t.playerApiUrl||!t.projectId)return;const i=kb(t);if(i.length===0)return;const n=yield Eb(e,i);n&&Ab(t,n)}),kb=t=>{const e=[];return t.contentId&&e.push({content_id:t.contentId}),t.playlistId&&e.push({playlist_id:t.playlistId}),t.sourceId&&e.push({source_id:t.sourceId}),t.sourceUrl&&e.push({source_url:t.sourceUrl}),t.playlist&&e.push(..._l(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},Eb=(t,e)=>{const i=e[0];if(e.length>1)return t.byIdentifiers(e);if(i.content_id)return t.byContentId(i.content_id);if(i.playlist_id)return t.byPlaylistId(i.playlist_id);if(i.source_id)return t.bySourceId(i.source_id);if(i.source_url)return t.bySourceUrl(i.source_url)},Ab=(t,e)=>{var l;const i=Kc(e.settings.theme),n=e.settings[`${i}_theme`],a=e.settings.image_enabled;xt(t,"playerStyle",e.settings.player_style),xt(t,"playerTitle",((l=e.playlist)==null?void 0:l.title)||e.settings.player_title),xt(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),xt(t,"skipButtonStyle",e.settings.skip_button_style),xt(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),xt(t,"contentIndex",0),xt(t,"introsOutros",xb(e.settings)),xt(t,"introsOutrosIndex",-1),xt(t,"advertIndex",-1),xt(t,"persistentAdImage",e.settings.persistent_ad_image),xt(t,"persistentIndex",-1),xt(t,"duration",0),xt(t,"currentTime",0),xt(t,"playbackState","stopped"),xt(t,"widgetStyle",e.settings.widget_style),xt(t,"widgetPosition",e.settings.widget_position),xt(t,"textColor",n.text_color),xt(t,"backgroundColor",n.background_color),xt(t,"iconColor",n.icon_color),xt(t,"highlightColor",n.highlight_color),xt(t,"logoIconEnabled",e.settings.logo_icon_enabled),xt(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),xt(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),xt(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),xt(t,"currentSegment",void 0),xt(t,"hoveredSegment",void 0),xt(t,"analyticsConsent",Pb(e.settings)),xt(t,"analyticsCustomUrl",e.settings.analytics_custom_url),xt(t,"analyticsTag",e.settings.analytics_tag),xt(t,"analyticsUrl",e.settings.analytics_url),xt(t,"analyticsId",e.settings.analytics_id),xt(t,"content",e.content.map(g=>{var p;return{id:g.id,title:g.title,imageUrl:a&&(((p=e.playlist)==null?void 0:p.image_url)||e.settings.image_url||g.image_url),sourceId:g.source_id,sourceUrl:g.source_url,adsEnabled:g.ads_enabled,duration:g.audio[0]?g.audio[0].duration/1e3:0,media:[...g.video,...g.audio].map(_=>({id:_.id,url:_.url,contentType:_.content_type})),segments:g.segments.map(_=>({marker:_.marker,section:_.section,startTime:_.start_time?_.start_time/1e3:0,duration:_.duration?_.duration/1e3:0}))}})),xt(t,"adverts",e.ads.map(g=>{const p=g.type==="vast",_=Kc(g.theme),T=g[`${_}_theme`];return{id:g.id,type:g.type,placement:g.placement,vastUrl:p?g.vast_url:null,clickThroughUrl:p?null:g.click_through_url,imageUrl:a&&g.image_url,textColor:T==null?void 0:T.text_color,backgroundColor:T==null?void 0:T.background_color,iconColor:T==null?void 0:T.icon_color,media:p?[]:g.media.map(k=>({id:k.id,url:k.url,contentType:k.content_type}))}}))},xt=(t,e,i)=>{typeof t.initialProps[e]!="undefined"||(t[e]=i)},xb=({intro_outro_enabled:t,intro_url:e,outro_url:i})=>{if(!t)return[];const n=[];return e&&n.push({placement:"pre-roll",media:[{url:e}]}),i&&n.push({placement:"post-roll",media:[{url:i}]}),n},Pb=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",wb=(t,e)=>on(this,null,function*(){const n=yield(yield fetch(t)).blob(),a=URL.createObjectURL(n),l=document.createElement("a");document.body.append(l),l.href=a,l.setAttribute("download",e),l.setAttribute("target","_blank"),l.click(),l.remove()}),Xa={vastUrls:new Set,mediaSources:new Set},Cb=t=>{t.vastUrl&&Xa.vastUrls.add(t.vastUrl);for(const e of t.media)Xa.mediaSources.add(e.url)},qc=t=>{if(t.vastUrl&&Xa.vastUrls.has(t.vastUrl))return!0;for(const e of t.media)if(Xa.mediaSources.has(e.url))return!0;return!1},Xc=new Set,Lb=t=>{t.media.forEach(e=>Xc.add(e.url))},Ib=t=>t.media.some(e=>Xc.has(e.url)),Rb=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:a,currentTime:l,atTheStart:g,atTheEnd:p,errored:_}={})=>{var V;const T=e&&e[i];e:if(T){if(_){Cb(T);break e}if(p)return Lb(T),-1;if(!p)return i}if(!((V=n[a])!=null&&V.adsEnabled)||t!==-1)return-1;const k=Ob({content:n,contentIndex:a,currentTime:l,atTheStart:g,atTheEnd:p});let C=-1,F=-1/0,U=-1/0;for(const[z,H]of e.entries()){if(Ib(H)||qc(H)||!k.has(H.placement))continue;const oe=Db[H.type]||0;if(oe<F)continue;const ce=Math.random();oe===F&&ce<U||(C=z,F=oe,U=ce)}return C},Db={vast:1,custom:0},Ob=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:a})=>{const l=e===0,g=e===t.length-1,p=t.length>1,_=p&&n&&!l,T=t[e].segments,k=T[T.length-1],C=p?null:Fb(T),F=T[C],U=F&&i>F.startTime,V=k?k.startTime+k.duration:0,z=i>V-Mb,H=new Set;return n&&H.add("pre-roll"),U&&!z&&H.add("mid-roll"),_&&H.add("mid-roll"),a&&g&&H.add("post-roll"),_&&H.add("post-roll"),H},Bb=2*60,Mb=10,Nb=.5,Fb=t=>{const e=t[t.length-1];if(!e)return;const i=e.startTime+e.duration;if(i<Bb)return;const n=i/2,a=al(t,i/2),p=t[a].startTime>=n-Nb?a:a+1;if(p!==t.length)return p},Ub=(t,e,i,n)=>{let a=-1,l=-1/0,g=-1/0;for(const[p,_]of(n||[]).entries()){if(!t||qc(_)||_.type==="vast")continue;const T=Wb(p,e,i);if(T<l)continue;const k=Vb[_.placement]||0;T===l&&k<g||(a=p,l=T,g=k)}return a},Vb={"pre-roll":2,"mid-roll":1},Wb=(t,e,i)=>t===i?2:t===e?1:0,Zc={mediaSources:new Set},jb=t=>{for(const e of t.media)Zc.mediaSources.add(e.url)},Gb=t=>{for(const e of t.media)if(Zc.mediaSources.has(e.url))return!0;return!1},Jc=new Set,zb=t=>{t.media.forEach(e=>Jc.add(e.url))},Hb=t=>t.media.some(e=>Jc.has(e.url)),Kb=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:a,currentTime:l,atTheStart:g,atTheEnd:p,errored:_})=>{const T=t[e];e:if(T){if(_){jb(T);break e}if(p)return zb(T),-1;if(!p)return e}if(i!==-1)return-1;const k=Yb({content:n,contentIndex:a,currentTime:l,atTheStart:g,atTheEnd:p});let C=-1,F=-1/0,U=-1/0;for(const[V,z]of t.entries()){if(Gb(z)||!k.has(z.placement))continue;const H=Hb(z)?1:0;if(H<F)continue;const oe=Math.random();H===F&&oe<U||(C=V,F=H,U=oe)}return C},Yb=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:a})=>{const l=new Set,g=n&&e===0&&i===0,p=a&&e===t.length-1;return g&&l.add("pre-roll"),p&&l.add("post-roll"),l},qb=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(l=>l.mediaSession==="override");if(Jb()&&!e)return;let i,n=-1/0,a=-1/0;for(const l of t.instances()){if(l.mediaSession==="none")continue;const g=Xb[l.playbackState]||0;if(g<n)continue;const p=Zb[l.showMediaSession]||0;g===n&&p<a||(i=l,n=g,a=p)}for(const l of t.instances())l.showMediaSession=l===i;return i},Xb={playing:1,paused:0,stopped:0},Zb={true:1,false:0},Jb=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:a}=t;return e||i||n||(a==null?void 0:a.length)},Qb=t=>{let e=!1,i,n=-1/0,a=-1/0;for(const l of t.instances()){if(!l.userInterface||l.widgetTarget||!hl(l.widgetStyle))continue;if(l.userInterface.isVisible){e=!0;continue}if(!(l.userInterface.relativeY<0))continue;const T=$b[l.playbackState]||0;if(T<n)continue;const k=l.userInterface.absoluteY;T===n&&k<a||(i=l,n=T,a=k)}e&&n===0&&(i=null);for(const l of t.instances())l.showBottomWidget=l===i},$b={playing:2,paused:1,stopped:0};class eS{constructor(e,i){ht(this,Ao);ht(this,xo);ht(this,ba);ht(this,Po);ht(this,wo);ht(this,Dr);ht(this,fn);ht(this,ar);ht(this,Co);ht(this,ts);ht(this,hn);ht(this,Lo);ht(this,Sa);ht(this,Zr);ht(this,Ta);ht(this,gn);ht(this,Li);ht(this,vn);ht(this,Jr);ht(this,Io);ht(this,Ro);ht(this,is);ht(this,ka);ht(this,Do);ht(this,Oo);ht(this,Bo);ht(this,Mo);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||tr(`Cannot add listener for unknown event type '${e}'.`);const a=`listener-handle-${Ba()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][a]=i,a}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return on(this,null,function*(){yield Mc(()=>this.player),ag(e);const i=this[`handle${e.type}`],n=ia(this.player);de(this,Ao,vh).call(this,e)?e.status="ignored-due-to-advert":de(this,xo,mh).call(this,e)?e.status="ignored-due-to-scrubbing":i?(yield i.call(this,e),de(this,Io,Sh).call(this),de(this,Ro,Th).call(this),e.status="handled"):tr("No handler function for event.",e);const a=ia(this.player);e.changedProps=Nc(n,a),e.processedAt=new Date().toISOString(),og(e),de(this,ba,pu).call(this,e.type,e),de(this,ba,pu).call(this,"<any>",e)})}handlePressedChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1)}handlePressedRightOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1)}handlePressedDownOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e-1)}handlePressedLeftOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e-1)}handlePressedPrevSegment(){de(this,Ta,yu).call(this,e=>e-1)}handlePressedNextSegment(){de(this,Ta,yu).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){de(this,Li,er).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){de(this,Li,er).call(this,i=>i+e)}handlePressedPrevTrack(){de(this,gn,cs).call(this,e=>e-1)}handlePressedNextTrack(){de(this,gn,cs).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleCurrentTimeUpdated(){!this.midrollPlayed&&de(this,Jr,Kn).call(this)}handlePlaybackPaused(){}handlePlaybackRateUpdated(){}handleVisibilityChanged(){Qb(this.PlayerClass)}handlePressedScrollToPlayer(){this.player.target.scrollIntoView()}handlePressedVideoBackground(){de(this,hn,us).call(this)}handlePressedEnterOnProgressBar(){de(this,hn,us).call(this)}handlePressedSpaceOnProgressBar(){de(this,hn,us).call(this)}handlePressedEnterOnProgressCircle(){de(this,hn,us).call(this)}handlePressedSpaceOnProgressCircle(){de(this,hn,us).call(this)}handlePressedLeftOnProgressBar(){de(this,Li,er).call(this,e=>e-5)}handlePressedRightOnProgressBar(){de(this,Li,er).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){de(this,Li,er).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){de(this,Li,er).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,de(this,Lo,bh).call(this),de(this,Li,er).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){de(this,Li,er).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){this.player.playbackState=this.preScrubState,delete this.preScrubState}handleIdentifiersChanged(){Yc(this.player).then(()=>{de(this,vn,ds).call(this,{atTheStart:!0}),de(this,Jr,Kn).call(this,{atTheStart:!0})})}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?de(this,Sa,_u).call(this,i):this.player.playbackState="playing"}handlePressedPause(){this.player.playbackState="paused"}handlePlaybackPlaying(){this.PlayerClass.instances().filter(n=>n!==this.player).filter(n=>n.playbackState==="playing").forEach(n=>n.playbackState="paused"),qb(this.PlayerClass)}handlePlaybackEnded(){de(this,Co,yh).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=de(this,Dr,En).call(this),i=de(this,ar,wr).call(this);de(this,Jr,Kn).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(de(this,vn,ds).call(this,{atTheEnd:!0}),!e&&(de(this,fn,ls).call(this)||de(this,ar,wr).call(this)||de(this,gn,cs).call(this,n=>n+1)))}handlePlaybackErrored({mediaType:e,mediaUrl:i,errorMessage:n}){console.error(`${e} playback error: ${n} (requesting ${i})`),de(this,Dr,En).call(this)||de(this,fn,ls).call(this)?de(this,vn,ds).call(this,{errored:!0}):de(this,ar,wr).call(this)?de(this,Jr,Kn).call(this,{errored:!0}):this.handlePlaybackEnded()}handlePressedMaximize(){rc()?a1():s1(this.player.target)}handleFullScreenModeUpdated(){const e=rc()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){de(this,gn,cs).call(this,()=>e),this.player.playbackState="playing"}handlePressedTogglePlaylist(){const e=this.player.playlistStyle.split("-"),i=this.player.content.length>1,n=e[0]==="show"||e[0]==="auto"&&i;e[0]=n?"hide":"show",this.player.playlistStyle=e.join("-")}handlePressedDownload({contentIndex:e,mediaIndex:i}){const n=this.player.content[e],l=n.media[i].url,g=l.split(".").pop(),p=`${n.title}.${g}`;return wb(l,p)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:a,contentStatus:l}){l==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&de(this,Bo,Ah).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:a})&&Yc(this.player).then(()=>{de(this,vn,ds).call(this,{atTheStart:!0}),de(this,Jr,Kn).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){var a;de(this,ts,Pa).call(this)?this.player.currentSegment=ti(fe({},e),{segmentIndex:i,contentIndex:n}):this.segmentPlayed||((a=this.player.segmentContainers)==null||a.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){e?this.player.hoveredSegment=ti(fe({},e),{segmentIndex:i,contentIndex:n}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,segmentIndex:i,contentIndex:n}){if(!ta("hovered",e,this.player.clickableSections))return;if(!de(this,Mo,xh).call(this,{contentIndex:n,segmentIndex:i})&&!de(this,ar,wr).call(this)){de(this,hn,us).call(this);return}n!==this.player.contentIndex&&de(this,gn,cs).call(this,()=>n),de(this,Sa,_u).call(this,fe({segmentIndex:i,contentIndex:n},e))}}Ao=new WeakSet,vh=function({type:e}){return de(this,ar,wr).call(this)&&(e.includes("ChangeSpeed")||e.includes("PrevSegment")||e.includes("NextSegment")||e.includes("SeekBack")||e.includes("SeekAhead")||e.includes("Progress")&&!e.includes("Space")&&!e.includes("Enter"))},xo=new WeakSet,mh=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},ba=new WeakSet,pu=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(a=>a(i))},Po=new WeakSet,ph=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},wo=new WeakSet,_h=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},Dr=new WeakSet,En=function(e=this.player.introsOutrosIndex){var i,n,a;return((a=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:a.placement)==="pre-roll"},fn=new WeakSet,ls=function(e=this.player.introsOutrosIndex){var i,n,a;return((a=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:a.placement)==="post-roll"},ar=new WeakSet,wr=function(){return this.player.advertIndex!==-1},Co=new WeakSet,yh=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},ts=new WeakSet,Pa=function(){return!de(this,Dr,En).call(this)&&!de(this,fn,ls).call(this)&&!de(this,ar,wr).call(this)},hn=new WeakSet,us=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},Lo=new WeakSet,bh=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},Sa=new WeakSet,_u=function(a){var l=a,{segmentIndex:e,contentIndex:i}=l,n=gu(l,["segmentIndex","contentIndex"]);de(this,Li,er).call(this,()=>n.startTime,i),this.player.currentSegment=fe({segmentIndex:e,contentIndex:i},n),this.player.playbackState="playing",this.segmentPlayed=!0},Zr=new WeakSet,Hn=function(e,{cycle:i}={}){const n=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3],a=n.length-1,l=n.indexOf(this.player.playbackRate),g=e(l);let p;i?p=g%n.length:p=Math.max(0,Math.min(a,g)),this.player.playbackRate=n[p]||1},Ta=new WeakSet,yu=function(e){const i=this.player.content[this.player.contentIndex].segments,n=al(i,this.player.currentTime),a=e(n);de(this,Dr,En).call(this)&&a>=0?this.handlePlaybackEnded():de(this,fn,ls).call(this)&&a<0?(de(this,is,wa).call(this,-1),de(this,Li,er).call(this,()=>{var l;return((l=i[i.length-1])==null?void 0:l.startTime)||.01}),this.player.playbackState="playing"):de(this,ts,Pa).call(this)&&a<0&&de(this,Po,ph).call(this)?(de(this,Li,er).call(this,()=>0),de(this,vn,ds).call(this,{atTheStart:!0})):de(this,ts,Pa).call(this)&&a===i.length&&de(this,wo,_h).call(this)?de(this,Li,er).call(this,()=>this.player.duration-.01):de(this,ts,Pa).call(this)&&a>=0&&a<i.length&&de(this,Li,er).call(this,()=>i[a].startTime)},gn=new WeakSet,cs=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",de(this,Li,er).call(this,()=>0)):(this.player.contentIndex=i,de(this,ar,wr).call(this)||(de(this,Li,er).call(this,()=>0),this.midrollPlayed=!1)),de(this,is,wa).call(this,-1),de(this,vn,ds).call(this,{atTheStart:!0}),n||de(this,Jr,Kn).call(this,{atTheStart:!0})},Li=new WeakSet,er=function(e,i){if(de(this,ar,wr).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},vn=new WeakSet,ds=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:a,introsOutros:l,currentTime:g}=this.player,p=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,_=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,T=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;de(this,is,wa).call(this,Kb({introsOutros:l,introsOutrosIndex:p,advertIndex:_,content:a,contentIndex:T,currentTime:g,atTheStart:e,atTheEnd:i,errored:n}))},Jr=new WeakSet,Kn=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:a}={}){const{adverts:l,content:g,currentTime:p}=this.player;let _=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const T=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,k=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,_=-1),de(this,ka,bu).call(this,Rb({introsOutrosIndex:_,adverts:l,advertIndex:T,content:g,contentIndex:k,currentTime:p,atTheStart:e,atTheEnd:i,errored:a}));const C=this.player.persistentAdImage,F=this.player.persistentIndex;this.player.persistentIndex=Ub(C,F,T,l)},Io=new WeakSet,Sh=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(de(this,is,wa).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},Ro=new WeakSet,Th=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(de(this,ka,bu).call(this,this.nextAdvert),delete this.nextAdvert)},is=new WeakSet,wa=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextIntroOutro=e;return}else delete this.nextIntroOutro;if(!(this.player.contentIndex===0&&this.player.currentTime===0)&&de(this,Dr,En).call(this,e)){this.player.introsOutrosIndex=-1,de(this,Jr,Kn).call(this,{atTheStart:!0});return}const l=de(this,Dr,En).call(this),g=de(this,fn,ls).call(this);this.player.introsOutrosIndex=e;const p=l&&!de(this,Dr,En).call(this),_=g&&!de(this,fn,ls).call(this);p&&(this.player.currentTime=0),_&&de(this,gn,cs).call(this,()=>1/0)},ka=new WeakSet,bu=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=de(this,ar,wr).call(this);this.player.advertIndex=e;const a=!n&&de(this,ar,wr).call(this),l=n&&!de(this,ar,wr).call(this);a&&de(this,Do,kh).call(this),l&&de(this,Oo,Eh).call(this)},Do=new WeakSet,kh=function(){de(this,Dr,En).call(this)||(this.prevTime=this.player.currentTime),this.prevRate=this.player.playbackRate,this.prevContent=this.player.contentIndex,this.player.currentTime=0,this.player.playbackRate=1},Oo=new WeakSet,Eh=function(){this.player.playbackRate=this.prevRate||1,this.player.contentIndex!==this.prevContent||(this.player.currentTime=this.prevTime),delete this.prevTime,delete this.prevRate,delete this.prevContent},Bo=new WeakSet,Ah=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:a}){var l,g,p,_;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===a||((l=this.player.playlist)==null?void 0:l.some(T=>T.contentId===e))||((g=this.player.playlist)==null?void 0:g.some(T=>T.contentId===i))||((p=this.player.playlist)==null?void 0:p.some(T=>T.sourceId===n))||((_=this.player.playlist)==null?void 0:_.some(T=>T.sourceUrl===a))},Mo=new WeakSet,xh=function({contentIndex:e,segmentIndex:i}){var n,a;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((a=this.player.currentSegment)==null?void 0:a.segmentIndex)!==i};const tS=()=>{typeof window=="undefined"&&tr(["Trying to initialize BeyondWords.Player in a server context but this is unsupported.","Please only initialize the player in a context where the global window object is available.","For example, by initializing the player inside a useEffect hook in a React application."])},Qc=Object.prototype.toString;function $c(t){switch(Qc.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Cs(t,Error)}}function Ps(t,e){return Qc.call(t)===`[object ${e}]`}function ed(t){return Ps(t,"ErrorEvent")}function td(t){return Ps(t,"DOMError")}function iS(t){return Ps(t,"DOMException")}function Jn(t){return Ps(t,"String")}function id(t){return t===null||typeof t!="object"&&typeof t!="function"}function ws(t){return Ps(t,"Object")}function yl(t){return typeof Event!="undefined"&&Cs(t,Event)}function rS(t){return typeof Element!="undefined"&&Cs(t,Element)}function nS(t){return Ps(t,"RegExp")}function bl(t){return!!(t&&t.then&&typeof t.then=="function")}function sS(t){return ws(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function aS(t){return typeof t=="number"&&t!==t}function Cs(t,e){try{return t instanceof e}catch(i){return!1}}function Za(t){return t&&t.Math==Math?t:void 0}const Tr=typeof globalThis=="object"&&Za(globalThis)||typeof window=="object"&&Za(window)||typeof self=="object"&&Za(self)||typeof global=="object"&&Za(global)||function(){return this}()||{};function na(){return Tr}function Sl(t,e,i){const n=i||Tr,a=n.__SENTRY__=n.__SENTRY__||{};return a[t]||(a[t]=e())}const Ja=na(),oS=80;function Tl(t,e={}){try{let i=t;const n=5,a=[];let l=0,g=0;const p=" > ",_=p.length;let T;const k=Array.isArray(e)?e:e.keyAttrs,C=!Array.isArray(e)&&e.maxStringLength||oS;for(;i&&l++<n&&(T=lS(i,k),!(T==="html"||l>1&&g+a.length*_+T.length>=C));)a.push(T),g+=T.length,i=i.parentNode;return a.reverse().join(p)}catch(i){return"<unknown>"}}function lS(t,e){const i=t,n=[];let a,l,g,p,_;if(!i||!i.tagName)return"";n.push(i.tagName.toLowerCase());const T=e&&e.length?e.filter(C=>i.getAttribute(C)).map(C=>[C,i.getAttribute(C)]):null;if(T&&T.length)T.forEach(C=>{n.push(`[${C[0]}="${C[1]}"]`)});else if(i.id&&n.push(`#${i.id}`),a=i.className,a&&Jn(a))for(l=a.split(/\s+/),_=0;_<l.length;_++)n.push(`.${l[_]}`);const k=["aria-label","type","name","title","alt"];for(_=0;_<k.length;_++)g=k[_],p=i.getAttribute(g),p&&n.push(`[${g}="${p}"]`);return n.join("")}function uS(){try{return Ja.document.location.href}catch(t){return""}}function cS(t){return Ja.document&&Ja.document.querySelector?Ja.document.querySelector(t):null}const dS="Sentry Logger ",Qa=["debug","info","warn","error","log","assert","trace"];function rd(t){if(!("console"in Tr))return t();const e=Tr.console,i={};Qa.forEach(n=>{const a=e[n]&&e[n].__sentry_original__;n in e&&a&&(i[n]=e[n],e[n]=a)});try{return t()}finally{Object.keys(i).forEach(n=>{e[n]=i[n]})}}function nd(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__?Qa.forEach(i=>{e[i]=(...n)=>{t&&rd(()=>{Tr.console[i](`${dS}[${i}]:`,...n)})}}):Qa.forEach(i=>{e[i]=()=>{}}),e}let ct;typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__?ct=Sl("logger",nd):ct=nd();const fS=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function hS(t){return t==="http"||t==="https"}function $a(t,e=!1){const{host:i,path:n,pass:a,port:l,projectId:g,protocol:p,publicKey:_}=t;return`${p}://${_}${e&&a?`:${a}`:""}@${i}${l?`:${l}`:""}/${n&&`${n}/`}${g}`}function gS(t){const e=fS.exec(t);if(!e){console.error(`Invalid Sentry Dsn: ${t}`);return}const[i,n,a="",l,g="",p]=e.slice(1);let _="",T=p;const k=T.split("/");if(k.length>1&&(_=k.slice(0,-1).join("/"),T=k.pop()),T){const C=T.match(/^\d+/);C&&(T=C[0])}return sd({host:l,pass:a,path:_,projectId:T,port:g,protocol:i,publicKey:n})}function sd(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function vS(t){if(!(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__))return!0;const{port:e,projectId:i,protocol:n}=t;return["protocol","publicKey","host","projectId"].find(g=>t[g]?!1:(ct.error(`Invalid Sentry Dsn: ${g} missing`),!0))?!1:i.match(/^\d+$/)?hS(n)?e&&isNaN(parseInt(e,10))?(ct.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(ct.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(ct.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),!1)}function mS(t){const e=typeof t=="string"?gS(t):sd(t);if(!(!e||!vS(e)))return e}class Ir extends Error{constructor(e,i="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=i}}function sa(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function ad(t,e){if(!Array.isArray(t))return"";const i=[];for(let n=0;n<t.length;n++){const a=t[n];try{i.push(String(a))}catch(l){i.push("[value cannot be serialized]")}}return i.join(e)}function pS(t,e,i=!1){return Jn(t)?nS(e)?e.test(t):Jn(e)?i?t===e:t.includes(e):!1:!1}function eo(t,e=[],i=!1){return e.some(n=>pS(t,n,i))}function Vi(t,e,i){if(!(e in t))return;const n=t[e],a=i(n);if(typeof a=="function")try{od(a,n)}catch(l){}t[e]=a}function kl(t,e,i){Object.defineProperty(t,e,{value:i,writable:!0,configurable:!0})}function od(t,e){const i=e.prototype||{};t.prototype=e.prototype=i,kl(t,"__sentry_original__",e)}function El(t){return t.__sentry_original__}function _S(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function ld(t){if($c(t))return fe({message:t.message,name:t.name,stack:t.stack},cd(t));if(yl(t)){const e=fe({type:t.type,target:ud(t.target),currentTarget:ud(t.currentTarget)},cd(t));return typeof CustomEvent!="undefined"&&Cs(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function ud(t){try{return rS(t)?Tl(t):Object.prototype.toString.call(t)}catch(e){return"<unknown>"}}function cd(t){if(typeof t=="object"&&t!==null){const e={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}else return{}}function yS(t,e=40){const i=Object.keys(ld(t));if(i.sort(),!i.length)return"[object has no keys]";if(i[0].length>=e)return sa(i[0],e);for(let n=i.length;n>0;n--){const a=i.slice(0,n).join(", ");if(!(a.length>e))return n===i.length?a:sa(a,e)}return""}function Al(t){return xl(t,new Map)}function xl(t,e){if(ws(t)){const i=e.get(t);if(i!==void 0)return i;const n={};e.set(t,n);for(const a of Object.keys(t))typeof t[a]!="undefined"&&(n[a]=xl(t[a],e));return n}if(Array.isArray(t)){const i=e.get(t);if(i!==void 0)return i;const n=[];return e.set(t,n),t.forEach(a=>{n.push(xl(a,e))}),n}return t}const dd=50,fd=/\(error: (.*)\)/;function hd(...t){const e=t.sort((i,n)=>i[0]-n[0]).map(i=>i[1]);return(i,n=0)=>{const a=[],l=i.split(`
71
+ gtag("js", new Date());`,e.async=!0,Cr(e.src,i="https://www.googletagmanager.com/gtag/js?id="+t[0])||Cc(e,"src",i)},m(l,g){te(l,e,g),te(l,n,g),te(l,a,g)},p(l,g){g&1&&!Cr(e.src,i="https://www.googletagmanager.com/gtag/js?id="+l[0])&&Cc(e,"src",i)},d(l){l&&$(e),l&&$(n),l&&$(a)}}}function q1(t){let e,i=!t[1]&&Lc(t);return{c(){i&&i.c(),e=Yn()},m(n,a){i&&i.m(document.head,null),I(document.head,e)},p(n,[a]){n[1]?i&&(i.d(1),i=null):i?i.p(n,a):(i=Lc(n),i.c(),i.m(e.parentNode,e))},i:ue,o:ue,d(n){i&&i.d(n),$(e)}}}function X1(t,e,i){let n,{analyticsTag:a}=e;return t.$$set=l=>{"analyticsTag"in l&&i(0,a=l.analyticsTag)},i(1,n=window.gtag),[a,n]}class Z1 extends it{constructor(e){super(),tt(this,e,X1,q1,Xe,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),P()}}const $6="";class J1 extends it{constructor(e){super(),tt(this,e,null,null,Xe,{})}}class ml{constructor(e,i){ht(this,ma);ht(this,po);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var l;(l=this.consumers)[e]||(l[e]=[]);const a=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(a&&de(this,ma,mu).call(this,n,a.args))&&(a&&this.onDeselected(e,...a.args),this.onSelected(e,...n))}removeInterest(e,i){var g;(g=this.consumers)[e]||(g[e]=[]);const n=this.consumers[e].slice(-1)[0];if(de(this,po,oh).call(this,this.consumers[e],p=>p.consumerId===i),!(n&&i===n.consumerId))return;const l=this.consumers[e].slice(-1)[0];l&&de(this,ma,mu).call(this,n.args,l.args)||(this.onDeselected(e,...n.args),l&&this.onSelected(e,...l.args))}}ma=new WeakSet,mu=function(e,i){return e.length===i.length&&e.every((n,a)=>n===i[a])},po=new WeakSet,oh=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};const ta=(t,e,i)=>{let[n,a]=i.split("-");n||(n="none"),a||(a=n);const l=t==="current"?n:a;return l==="all"||l==="body"&&(e==null?void 0:e.section)==="body"},Ln="data-beyondwords-marker",Ic=t=>["beyondwords-highlight","bwp",`marker-${t}`],Ns=class{update(e,i,n,a){const l=ta(e,i,n),g=this[`prev${e}`],p=l?i==null?void 0:i.marker:null;p&&Vr(Ns,pa).addInterest(p,this,a),g&&Vr(Ns,pa).removeInterest(g,this),this[`prev${e}`]=p}};let Es=Ns;pa=new WeakMap,_o=new WeakSet,lh=function(e,i){const n=document.querySelectorAll(`[${Ln}="${e}"]`);for(const a of n){const l=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);let g;for(;g=l.nextNode();){if(/^\s*$/.test(g.nodeValue))continue;g.parentNode.nodeName.toLowerCase()==="a"&&(g=g.parentNode);const T=document.createElement("mark");T.classList.add(...Ic(e)),T.style.background=i,g.parentNode.insertBefore(T,g),T.appendChild(g)}}},yo=new WeakSet,uh=function(e){const i=document.querySelectorAll(`[${Ln}="${e}"]`);for(const n of i){const a=n.querySelectorAll(`mark.${Ic(e)}`);for(const l of a)for(const g of l.childNodes)l.parentNode.insertBefore(g,l),l.remove()}},ht(Es,_o),ht(Es,yo),ht(Es,pa,new ml(de(Ns,_o,lh),de(Ns,yo,uh)));const Rc=["beyondwords-clickable","bwp"],Fs=class{update(e,i){const n=ta("hovered",e,i),a=this.previous,l=n?e==null?void 0:e.marker:null;l&&Vr(Fs,_a).addInterest(l,this),a&&Vr(Fs,_a).removeInterest(a,this),this.previous=l}};let As=Fs;_a=new WeakMap,bo=new WeakSet,ch=function(e){const i=document.querySelectorAll(`[${Ln}="${e}"]`);for(const n of i)n.classList.add(...Rc)},So=new WeakSet,dh=function(e){const i=document.querySelectorAll(`[${Ln}="${e}"]`);for(const n of i)Dc(n,Rc)},ht(As,bo),ht(As,So),ht(As,_a,new ml(de(Fs,bo,ch),de(Fs,So,dh)));const Dc=(t,e)=>{if(!t)return;const a=[...t.classList].filter(l=>!e.includes(l)).some(l=>l.startsWith("beyondwords-"))?e.filter(l=>l!=="bwp"):e;t.classList.remove(...a)},Oc=(t,e,i)=>["beyondwords-widget","bwp",`marker-${t}`,`position-${e}`,`for-${i}-player`],Bc=["beyondwords-relative","bwp"],Us=class{constructor(e){this.onUpdate=e,this.containers=[]}update(e,i,n,a){const l=i.includes("all")||i.includes("body"),g=this.previous,p=(e==null?void 0:e.marker)||l&&(g==null?void 0:g.marker);p&&Vr(Us,ya).addInterest(p,this,this,n,a),g&&Vr(Us,ya).removeInterest(g,this),this.previous=p}reset(){this.update(null,"none")}};let xs=Us;ya=new WeakMap,To=new WeakSet,fh=function(e,i,n,a){const l=document.querySelector(`[${Ln}="${e}"]`),g=document.createElement("div");["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(n)&&l.classList.add(...Bc),g.classList.add(...Oc(e,n,a)),["11-oclock","12-oclock","1-oclock"].includes(n)?l.insertBefore(g,l.firstChild):l.appendChild(g),i.containers.push(g),i.onUpdate(i.containers)},ko=new WeakSet,hh=function(e,i,n,a){const l=Oc(e,n,a);for(let g=0;g<i.containers.length;g+=1){if(!l.every(T=>i.containers[g].classList.contains(T)))continue;const _=i.containers[g].parentNode;Dc(_,Bc),i.containers[g].remove(),i.containers.splice(g,1),g-=1}i.onUpdate(i.containers)},ht(xs,To),ht(xs,ko),ht(xs,ya,new ml(de(Us,To,fh),de(Us,ko,hh)));const Q1=()=>rt({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),Xn=(i,...n)=>on(this,[i,...n],function*(t,e={}){const a=yield fetch(t,e).catch(()=>{}),l=yield a==null?void 0:a.json().catch(()=>{});return(a==null?void 0:a.status)!==200&&tr(`Failed to fetch ${t}`,ti(fe({},e),{responseStatus:a==null?void 0:a.status,responseJson:l})),l}),$1=(t,e)=>Xn(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class eb{constructor(e,i,n){ht(this,Eo);this.baseUrl=de(this,Eo,gh).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return on(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield Xn(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return on(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,a="actioncable-v1-json";this.webSocket=new WebSocket(n,a),this.webSocket.onmessage=l=>e(JSON.parse(l.data)),this.webSocket.onerror=i,yield new Promise(l=>this.webSocket.onopen=l)})}subscribeToStatusChanges(){const e=JSON.stringify({channel:"Api::V1::ProjectChannel",id:this.projectId}),i=JSON.stringify({command:"subscribe",identifier:e});this.webSocket.send(i)}destroy(){this.webSocketToken=null,this.webSocket&&(this.webSocket.onmessage=()=>{},this.webSocket.onerror=()=>{},this.webSocket.close(),this.webSocket=null)}}Eo=new WeakSet,gh=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let Zn;const tb=(t,e,i,n)=>on(this,null,function*(){!t||!e||!i||(Zn==null||Zn.destroy(),Zn=new eb(t,e,i),yield Zn.getWebSocketToken(),yield Zn.establishConnection(ib(n),sb),yield Zn.subscribeToStatusChanges())}),ib=t=>e=>{var a,l;((l=(a=e==null?void 0:e.message)==null?void 0:a.result)==null?void 0:l.action)==="podcast_state_updated"&&rb(e,t),e.type==="reject_subscription"&&nb(e)},rb=(t,e)=>{const i=t.message.result;e(rt({type:"ContentStatusChanged",description:"The processing status of a content item within the project changed.",initiatedBy:"websocket",contentId:i.content_id,legacyId:i.legacy_id,sourceId:i.source_id,sourceUrl:i.source_url,contentStatus:i.state}))},nb=t=>{tr("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},sb=t=>{tr("Unexpected WebSocket error.",{error:t})},Mc=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},ia=t=>{const i=Object.keys(t.$$.props).filter(n=>!ab.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},ab=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),Nc=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const a of i){const l=t[a],g=e[a];l!==g&&(n[a]={previousValue:l,currentValue:g})}return n};let ra=-1;const Fc=[],ob=(t,e,i)=>on(this,null,function*(){yield Mc(()=>e.player);const n=e.player,a=lb(n.contentIndex,i,t);a>ra&&ub(n,ra,a,t),a<ra&&cb(n,ra,a),ra=a}),lb=(t,e,i)=>{const n=i.findIndex(l=>l[0]===t&&l[1]>e||l[0]>t);return n===-1?i.length-1:n-1},ub=(t,e,i,n)=>{for(let a=e+1;a<=i;a+=1){const l=ia(t);n[a][2](t);const g=ia(t),p=Nc(l,g);Fc.push(p)}},cb=(t,e,i)=>{for(let n=e;n>i;n-=1){const a=Fc.pop();for(const[l,g]of Object.entries(a))t[l]=g.previousValue}},db=t=>t?fb(t)?{newTarget:gb(t),showUserInterface:!0}:typeof t=="string"?{newTarget:pl(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:hb(),showUserInterface:!1},fb=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",hb=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},gb=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},pl=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&tr(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&tr(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]};function Uc(t,e,i){const n=t.slice();return n[137]=e[i],n}function Vc(t){let e,i,n={onEvent:t[53],playerStyle:t[59],callToAction:t[23],skipButtonStyle:t[24],playlistStyle:t[25],playlistToggle:t[26],downloadFormats:t[47],playerTitle:t[22],content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[11],playbackState:t[30],playbackRate:t[31],activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36],logoIconEnabled:t[37],videoIsBehind:t[61]};return e=new gl({props:n}),t[90](e),{c(){ze(e.$$.fragment)},m(a,l){We(e,a,l),i=!0},p(a,l){const g={};l[1]&268435456&&(g.playerStyle=a[59]),l[0]&8388608&&(g.callToAction=a[23]),l[0]&16777216&&(g.skipButtonStyle=a[24]),l[0]&33554432&&(g.playlistStyle=a[25]),l[0]&67108864&&(g.playlistToggle=a[26]),l[1]&65536&&(g.downloadFormats=a[47]),l[0]&4194304&&(g.playerTitle=a[22]),l[1]&131072&&(g.content=a[48]),l[0]&128&&(g.contentIndex=a[7]),l[0]&536870912&&(g.duration=a[29]),l[0]&2048&&(g.currentTime=a[11]),l[0]&1073741824&&(g.playbackState=a[30]),l[1]&1&&(g.playbackRate=a[31]),l[1]&33554432&&(g.activeAdvert=a[56]),l[2]&1&&(g.persistentAdvert=a[62]),l[1]&8&&(g.textColor=a[34]),l[1]&16&&(g.backgroundColor=a[35]),l[1]&32&&(g.iconColor=a[36]),l[1]&64&&(g.logoIconEnabled=a[37]),l[1]&1073741824&&(g.videoIsBehind=a[61]),e.$set(g)},i(a){i||(X(e.$$.fragment,a),i=!0)},o(a){se(e.$$.fragment,a),i=!1},d(a){t[90](null),je(e,a)}}}function Wc(t){let e,i;return e=new vl({props:{root:t[13],$$slots:{default:[vb]},$$scope:{ctx:t}}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[0]&8192&&(l.root=n[13]),a[0]&1639987328|a[1]&167977087|a[2]&1|a[4]&65536&&(l.$$scope={dirty:a,ctx:n}),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function vb(t){let e,i,n={onEvent:t[53],playerStyle:t[12],callToAction:t[23],skipButtonStyle:t[24],playlistStyle:"hide",playlistToggle:"hide",downloadFormats:t[47],playerTitle:t[22],fixedPosition:!t[13]&&t[32],fixedWidth:t[33],content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[11],playbackState:t[30],playbackRate:t[31],activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36],logoIconEnabled:t[37],videoIsBehind:t[58]};return e=new gl({props:n}),t[91](e),{c(){ze(e.$$.fragment)},m(a,l){We(e,a,l),i=!0},p(a,l){const g={};l[0]&4096&&(g.playerStyle=a[12]),l[0]&8388608&&(g.callToAction=a[23]),l[0]&16777216&&(g.skipButtonStyle=a[24]),l[1]&65536&&(g.downloadFormats=a[47]),l[0]&4194304&&(g.playerTitle=a[22]),l[0]&8192|l[1]&2&&(g.fixedPosition=!a[13]&&a[32]),l[1]&4&&(g.fixedWidth=a[33]),l[1]&131072&&(g.content=a[48]),l[0]&128&&(g.contentIndex=a[7]),l[0]&536870912&&(g.duration=a[29]),l[0]&2048&&(g.currentTime=a[11]),l[0]&1073741824&&(g.playbackState=a[30]),l[1]&1&&(g.playbackRate=a[31]),l[1]&33554432&&(g.activeAdvert=a[56]),l[2]&1&&(g.persistentAdvert=a[62]),l[1]&8&&(g.textColor=a[34]),l[1]&16&&(g.backgroundColor=a[35]),l[1]&32&&(g.iconColor=a[36]),l[1]&64&&(g.logoIconEnabled=a[37]),l[1]&134217728&&(g.videoIsBehind=a[58]),e.$set(g)},i(a){i||(X(e.$$.fragment,a),i=!0)},o(a){se(e.$$.fragment,a),i=!1},d(a){t[91](null),je(e,a)}}}function mb(t){let e,i;return e=new gl({props:{onEvent:t[92],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[60]?t[11]:t[54].startTime,playbackState:t[60]?t[30]:"paused",activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36]}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[1]&75497472&&(l.onEvent=n[92]),a[1]&131072&&(l.content=n[48]),a[0]&128&&(l.contentIndex=n[7]),a[0]&536870912&&(l.duration=n[29]),a[0]&2048|a[1]&545259520&&(l.currentTime=n[60]?n[11]:n[54].startTime),a[0]&1073741824|a[1]&536870912&&(l.playbackState=n[60]?n[30]:"paused"),a[1]&33554432&&(l.activeAdvert=n[56]),a[2]&1&&(l.persistentAdvert=n[62]),a[1]&8&&(l.textColor=n[34]),a[1]&16&&(l.backgroundColor=n[35]),a[1]&32&&(l.iconColor=n[36]),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function jc(t,e){let i,n,a;return n=new vl({props:{root:e[137],$$slots:{default:[mb]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=Yn(),ze(n.$$.fragment),this.first=i},m(l,g){te(l,i,g),We(n,l,g),a=!0},p(l,g){e=l;const p={};g[1]&32768&&(p.root=e[137]),g[0]&1610614912|g[1]&646053944|g[2]&1|g[4]&65536&&(p.$$scope={dirty:g,ctx:e}),n.$set(p)},i(l){a||(X(n.$$.fragment,l),a=!0)},o(l){se(n.$$.fragment,l),a=!1},d(l){l&&$(i),je(n,l)}}}function Gc(t){let e,i;return e=new vl({props:{root:t[21],$$slots:{default:[pb]},$$scope:{ctx:t}}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[0]&2097152&&(l.root=n[21]),a[0]&2145386495|a[1]&919551|a[4]&65536&&(l.$$scope={dirty:a,ctx:n}),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function pb(t){let e,i,n,a,l,g,p,_,T,k,C,F,U,V,z,H,oe,ce,ge,ve,le,Se,ee,L,ae,W,Ze,Ce,Re,Oe,K,Z,B,Ke,Me,we,Ue,ie,pe,ft,Ae,Le,qe;function Lt(Y){t[93](Y)}function Pt(Y){t[94](Y)}function Jt(Y){t[95](Y)}function Tt(Y){t[96](Y)}function Wt(Y){t[97](Y)}function jt(Y){t[98](Y)}function ut(Y){t[99](Y)}function wt(Y){t[100](Y)}function Te(Y){t[101](Y)}function gt(Y){t[102](Y)}function ii(Y){t[103](Y)}function Kt(Y){t[104](Y)}function Nt(Y){t[105](Y)}function kt(Y){t[106](Y)}function st(Y){t[107](Y)}function Ft(Y){t[108](Y)}function ui(Y){t[109](Y)}function ci(Y){t[110](Y)}function Dt(Y){t[111](Y)}function Ot(Y){t[112](Y)}function Bt(Y){t[113](Y)}function Gt(Y){t[114](Y)}function ri(Y){t[115](Y)}function Qt(Y){t[116](Y)}function ni(Y){t[117](Y)}function di(Y){t[118](Y)}function It(Y){t[119](Y)}function at(Y){t[120](Y)}function si(Y){t[121](Y)}function De(Y){t[122](Y)}function fi(Y){t[123](Y)}function Yt(Y){t[124](Y)}function Je(Y){t[125](Y)}function Ai(Y){t[126](Y)}function Ut(Y){t[127](Y)}function _e(Y){t[128](Y)}function hi(Y){t[129](Y)}function gi(Y){t[130](Y)}function bi(Y){t[131](Y)}function vi(Y){t[132](Y)}function Pi(Y){t[133](Y)}let Ve={content:t[48],introsOutros:t[49],adverts:t[50]};return t[0]!==void 0&&(Ve.projectId=t[0]),t[1]!==void 0&&(Ve.contentId=t[1]),t[2]!==void 0&&(Ve.playlistId=t[2]),t[3]!==void 0&&(Ve.sourceId=t[3]),t[4]!==void 0&&(Ve.sourceUrl=t[4]),t[5]!==void 0&&(Ve.showUserInterface=t[5]),t[6]!==void 0&&(Ve.playerStyle=t[6]),t[22]!==void 0&&(Ve.playerTitle=t[22]),t[23]!==void 0&&(Ve.callToAction=t[23]),t[24]!==void 0&&(Ve.skipButtonStyle=t[24]),t[25]!==void 0&&(Ve.playlistStyle=t[25]),t[26]!==void 0&&(Ve.playlistToggle=t[26]),t[27]!==void 0&&(Ve.mediaSession=t[27]),t[7]!==void 0&&(Ve.contentIndex=t[7]),t[8]!==void 0&&(Ve.introsOutrosIndex=t[8]),t[9]!==void 0&&(Ve.advertIndex=t[9]),t[28]!==void 0&&(Ve.persistentAdImage=t[28]),t[10]!==void 0&&(Ve.persistentIndex=t[10]),t[29]!==void 0&&(Ve.duration=t[29]),t[11]!==void 0&&(Ve.currentTime=t[11]),t[30]!==void 0&&(Ve.playbackState=t[30]),t[31]!==void 0&&(Ve.playbackRate=t[31]),t[12]!==void 0&&(Ve.widgetStyle=t[12]),t[32]!==void 0&&(Ve.widgetPosition=t[32]),t[33]!==void 0&&(Ve.widgetWidth=t[33]),t[13]!==void 0&&(Ve.widgetTarget=t[13]),t[34]!==void 0&&(Ve.textColor=t[34]),t[35]!==void 0&&(Ve.backgroundColor=t[35]),t[36]!==void 0&&(Ve.iconColor=t[36]),t[14]!==void 0&&(Ve.highlightColor=t[14]),t[37]!==void 0&&(Ve.logoIconEnabled=t[37]),t[15]!==void 0&&(Ve.highlightSections=t[15]),t[16]!==void 0&&(Ve.clickableSections=t[16]),t[17]!==void 0&&(Ve.segmentWidgetSections=t[17]),t[18]!==void 0&&(Ve.segmentWidgetPosition=t[18]),t[19]!==void 0&&(Ve.currentSegment=t[19]),t[20]!==void 0&&(Ve.hoveredSegment=t[20]),t[38]!==void 0&&(Ve.advertConsent=t[38]),t[39]!==void 0&&(Ve.analyticsConsent=t[39]),t[40]!==void 0&&(Ve.analyticsCustomUrl=t[40]),t[41]!==void 0&&(Ve.analyticsTag=t[41]),e=new D1({props:Ve}),Fe.push(()=>$e(e,"projectId",Lt)),Fe.push(()=>$e(e,"contentId",Pt)),Fe.push(()=>$e(e,"playlistId",Jt)),Fe.push(()=>$e(e,"sourceId",Tt)),Fe.push(()=>$e(e,"sourceUrl",Wt)),Fe.push(()=>$e(e,"showUserInterface",jt)),Fe.push(()=>$e(e,"playerStyle",ut)),Fe.push(()=>$e(e,"playerTitle",wt)),Fe.push(()=>$e(e,"callToAction",Te)),Fe.push(()=>$e(e,"skipButtonStyle",gt)),Fe.push(()=>$e(e,"playlistStyle",ii)),Fe.push(()=>$e(e,"playlistToggle",Kt)),Fe.push(()=>$e(e,"mediaSession",Nt)),Fe.push(()=>$e(e,"contentIndex",kt)),Fe.push(()=>$e(e,"introsOutrosIndex",st)),Fe.push(()=>$e(e,"advertIndex",Ft)),Fe.push(()=>$e(e,"persistentAdImage",ui)),Fe.push(()=>$e(e,"persistentIndex",ci)),Fe.push(()=>$e(e,"duration",Dt)),Fe.push(()=>$e(e,"currentTime",Ot)),Fe.push(()=>$e(e,"playbackState",Bt)),Fe.push(()=>$e(e,"playbackRate",Gt)),Fe.push(()=>$e(e,"widgetStyle",ri)),Fe.push(()=>$e(e,"widgetPosition",Qt)),Fe.push(()=>$e(e,"widgetWidth",ni)),Fe.push(()=>$e(e,"widgetTarget",di)),Fe.push(()=>$e(e,"textColor",It)),Fe.push(()=>$e(e,"backgroundColor",at)),Fe.push(()=>$e(e,"iconColor",si)),Fe.push(()=>$e(e,"highlightColor",De)),Fe.push(()=>$e(e,"logoIconEnabled",fi)),Fe.push(()=>$e(e,"highlightSections",Yt)),Fe.push(()=>$e(e,"clickableSections",Je)),Fe.push(()=>$e(e,"segmentWidgetSections",Ai)),Fe.push(()=>$e(e,"segmentWidgetPosition",Ut)),Fe.push(()=>$e(e,"currentSegment",_e)),Fe.push(()=>$e(e,"hoveredSegment",hi)),Fe.push(()=>$e(e,"advertConsent",gi)),Fe.push(()=>$e(e,"analyticsConsent",bi)),Fe.push(()=>$e(e,"analyticsCustomUrl",vi)),Fe.push(()=>$e(e,"analyticsTag",Pi)),{c(){ze(e.$$.fragment)},m(Y,J){We(e,Y,J),qe=!0},p(Y,J){const Ne={};J[1]&131072&&(Ne.content=Y[48]),J[1]&262144&&(Ne.introsOutros=Y[49]),J[1]&524288&&(Ne.adverts=Y[50]),!i&&J[0]&1&&(i=!0,Ne.projectId=Y[0],Qe(()=>i=!1)),!n&&J[0]&2&&(n=!0,Ne.contentId=Y[1],Qe(()=>n=!1)),!a&&J[0]&4&&(a=!0,Ne.playlistId=Y[2],Qe(()=>a=!1)),!l&&J[0]&8&&(l=!0,Ne.sourceId=Y[3],Qe(()=>l=!1)),!g&&J[0]&16&&(g=!0,Ne.sourceUrl=Y[4],Qe(()=>g=!1)),!p&&J[0]&32&&(p=!0,Ne.showUserInterface=Y[5],Qe(()=>p=!1)),!_&&J[0]&64&&(_=!0,Ne.playerStyle=Y[6],Qe(()=>_=!1)),!T&&J[0]&4194304&&(T=!0,Ne.playerTitle=Y[22],Qe(()=>T=!1)),!k&&J[0]&8388608&&(k=!0,Ne.callToAction=Y[23],Qe(()=>k=!1)),!C&&J[0]&16777216&&(C=!0,Ne.skipButtonStyle=Y[24],Qe(()=>C=!1)),!F&&J[0]&33554432&&(F=!0,Ne.playlistStyle=Y[25],Qe(()=>F=!1)),!U&&J[0]&67108864&&(U=!0,Ne.playlistToggle=Y[26],Qe(()=>U=!1)),!V&&J[0]&134217728&&(V=!0,Ne.mediaSession=Y[27],Qe(()=>V=!1)),!z&&J[0]&128&&(z=!0,Ne.contentIndex=Y[7],Qe(()=>z=!1)),!H&&J[0]&256&&(H=!0,Ne.introsOutrosIndex=Y[8],Qe(()=>H=!1)),!oe&&J[0]&512&&(oe=!0,Ne.advertIndex=Y[9],Qe(()=>oe=!1)),!ce&&J[0]&268435456&&(ce=!0,Ne.persistentAdImage=Y[28],Qe(()=>ce=!1)),!ge&&J[0]&1024&&(ge=!0,Ne.persistentIndex=Y[10],Qe(()=>ge=!1)),!ve&&J[0]&536870912&&(ve=!0,Ne.duration=Y[29],Qe(()=>ve=!1)),!le&&J[0]&2048&&(le=!0,Ne.currentTime=Y[11],Qe(()=>le=!1)),!Se&&J[0]&1073741824&&(Se=!0,Ne.playbackState=Y[30],Qe(()=>Se=!1)),!ee&&J[1]&1&&(ee=!0,Ne.playbackRate=Y[31],Qe(()=>ee=!1)),!L&&J[0]&4096&&(L=!0,Ne.widgetStyle=Y[12],Qe(()=>L=!1)),!ae&&J[1]&2&&(ae=!0,Ne.widgetPosition=Y[32],Qe(()=>ae=!1)),!W&&J[1]&4&&(W=!0,Ne.widgetWidth=Y[33],Qe(()=>W=!1)),!Ze&&J[0]&8192&&(Ze=!0,Ne.widgetTarget=Y[13],Qe(()=>Ze=!1)),!Ce&&J[1]&8&&(Ce=!0,Ne.textColor=Y[34],Qe(()=>Ce=!1)),!Re&&J[1]&16&&(Re=!0,Ne.backgroundColor=Y[35],Qe(()=>Re=!1)),!Oe&&J[1]&32&&(Oe=!0,Ne.iconColor=Y[36],Qe(()=>Oe=!1)),!K&&J[0]&16384&&(K=!0,Ne.highlightColor=Y[14],Qe(()=>K=!1)),!Z&&J[1]&64&&(Z=!0,Ne.logoIconEnabled=Y[37],Qe(()=>Z=!1)),!B&&J[0]&32768&&(B=!0,Ne.highlightSections=Y[15],Qe(()=>B=!1)),!Ke&&J[0]&65536&&(Ke=!0,Ne.clickableSections=Y[16],Qe(()=>Ke=!1)),!Me&&J[0]&131072&&(Me=!0,Ne.segmentWidgetSections=Y[17],Qe(()=>Me=!1)),!we&&J[0]&262144&&(we=!0,Ne.segmentWidgetPosition=Y[18],Qe(()=>we=!1)),!Ue&&J[0]&524288&&(Ue=!0,Ne.currentSegment=Y[19],Qe(()=>Ue=!1)),!ie&&J[0]&1048576&&(ie=!0,Ne.hoveredSegment=Y[20],Qe(()=>ie=!1)),!pe&&J[1]&128&&(pe=!0,Ne.advertConsent=Y[38],Qe(()=>pe=!1)),!ft&&J[1]&256&&(ft=!0,Ne.analyticsConsent=Y[39],Qe(()=>ft=!1)),!Ae&&J[1]&512&&(Ae=!0,Ne.analyticsCustomUrl=Y[40],Qe(()=>Ae=!1)),!Le&&J[1]&1024&&(Le=!0,Ne.analyticsTag=Y[41],Qe(()=>Le=!1)),e.$set(Ne)},i(Y){qe||(X(e.$$.fragment,Y),qe=!0)},o(Y){se(e.$$.fragment,Y),qe=!1},d(Y){je(e,Y)}}}function zc(t){let e,i;return e=new H1({props:{onEvent:t[53],content:t[48],contentIndex:t[7],activeAdvert:t[56],persistentAdvert:t[62],duration:t[29],playbackState:t[30],skipButtonStyle:t[24],backgroundColor:t[35],iconColor:t[36]}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[1]&131072&&(l.content=n[48]),a[0]&128&&(l.contentIndex=n[7]),a[1]&33554432&&(l.activeAdvert=n[56]),a[2]&1&&(l.persistentAdvert=n[62]),a[0]&536870912&&(l.duration=n[29]),a[0]&1073741824&&(l.playbackState=n[30]),a[0]&16777216&&(l.skipButtonStyle=n[24]),a[1]&16&&(l.backgroundColor=n[35]),a[1]&32&&(l.iconColor=n[36]),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function Hc(t){let e,i;return e=new Z1({props:{analyticsTag:t[41]}}),{c(){ze(e.$$.fragment)},m(n,a){We(e,n,a),i=!0},p(n,a){const l={};a[1]&1024&&(l.analyticsTag=n[41]),e.$set(l)},i(n){i||(X(e.$$.fragment,n),i=!0)},o(n){se(e.$$.fragment,n),i=!1},d(n){je(e,n)}}}function _b(t){let e,i,n,a,l,g,p,_,T,k=[],C=new Map,F,U,V,z,H,oe;function ce(K){t[85](K)}function ge(K){t[86](K)}function ve(K){t[87](K)}function le(K){t[88](K)}function Se(K){t[89](K)}let ee={onEvent:t[53],content:t[48],contentIndex:t[7],introOrOutro:t[55],activeAdvert:t[56],advertConsent:t[38],videoBehindWidget:t[58],videoBehindStatic:t[61],widgetPosition:t[32],widgetWidth:t[33]};t[30]!==void 0&&(ee.playbackState=t[30]),t[29]!==void 0&&(ee.duration=t[29]),t[11]!==void 0&&(ee.currentTime=t[11]),t[31]!==void 0&&(ee.playbackRate=t[31]),t[45]!==void 0&&(ee.prevPercentage=t[45]),e=new Iv({props:ee}),t[84](e),Fe.push(()=>$e(e,"playbackState",ce)),Fe.push(()=>$e(e,"duration",ge)),Fe.push(()=>$e(e,"currentTime",ve)),Fe.push(()=>$e(e,"playbackRate",le)),Fe.push(()=>$e(e,"prevPercentage",Se));let L=t[5]&&Vc(t),ae=(t[51]||t[13])&&Wc(t),W=t[46];const Ze=K=>K[137];for(let K=0;K<W.length;K+=1){let Z=Uc(t,W,K),B=Ze(Z);C.set(B,k[K]=jc(B,Z))}let Ce=t[21]&&Gc(t),Re=t[52]&&zc(t),Oe=t[41]&&Hc(t);return H=new J1({}),{c(){ze(e.$$.fragment),p=Pe(),L&&L.c(),_=Pe(),ae&&ae.c(),T=Pe();for(let K=0;K<k.length;K+=1)k[K].c();F=Pe(),Ce&&Ce.c(),U=Pe(),Re&&Re.c(),V=Pe(),Oe&&Oe.c(),z=Pe(),ze(H.$$.fragment)},m(K,Z){We(e,K,Z),te(K,p,Z),L&&L.m(K,Z),te(K,_,Z),ae&&ae.m(K,Z),te(K,T,Z);for(let B=0;B<k.length;B+=1)k[B]&&k[B].m(K,Z);te(K,F,Z),Ce&&Ce.m(K,Z),te(K,U,Z),Re&&Re.m(K,Z),te(K,V,Z),Oe&&Oe.m(K,Z),te(K,z,Z),We(H,K,Z),oe=!0},p(K,Z){const B={};Z[1]&131072&&(B.content=K[48]),Z[0]&128&&(B.contentIndex=K[7]),Z[1]&16777216&&(B.introOrOutro=K[55]),Z[1]&33554432&&(B.activeAdvert=K[56]),Z[1]&128&&(B.advertConsent=K[38]),Z[1]&134217728&&(B.videoBehindWidget=K[58]),Z[1]&1073741824&&(B.videoBehindStatic=K[61]),Z[1]&2&&(B.widgetPosition=K[32]),Z[1]&4&&(B.widgetWidth=K[33]),!i&&Z[0]&1073741824&&(i=!0,B.playbackState=K[30],Qe(()=>i=!1)),!n&&Z[0]&536870912&&(n=!0,B.duration=K[29],Qe(()=>n=!1)),!a&&Z[0]&2048&&(a=!0,B.currentTime=K[11],Qe(()=>a=!1)),!l&&Z[1]&1&&(l=!0,B.playbackRate=K[31],Qe(()=>l=!1)),!g&&Z[1]&16384&&(g=!0,B.prevPercentage=K[45],Qe(()=>g=!1)),e.$set(B),K[5]?L?(L.p(K,Z),Z[0]&32&&X(L,1)):(L=Vc(K),L.c(),X(L,1),L.m(_.parentNode,_)):L&&(Et(),se(L,1,1,()=>{L=null}),At()),K[51]||K[13]?ae?(ae.p(K,Z),Z[0]&8192|Z[1]&1048576&&X(ae,1)):(ae=Wc(K),ae.c(),X(ae,1),ae.m(T.parentNode,T)):ae&&(Et(),se(ae,1,1,()=>{ae=null}),At()),Z[0]&1610614912|Z[1]&650281016|Z[2]&1&&(W=K[46],Et(),k=qh(k,Z,Ze,1,K,W,C,F.parentNode,Yh,jc,F,Uc),At()),K[21]?Ce?(Ce.p(K,Z),Z[0]&2097152&&X(Ce,1)):(Ce=Gc(K),Ce.c(),X(Ce,1),Ce.m(U.parentNode,U)):Ce&&(Et(),se(Ce,1,1,()=>{Ce=null}),At()),K[52]?Re?(Re.p(K,Z),Z[1]&2097152&&X(Re,1)):(Re=zc(K),Re.c(),X(Re,1),Re.m(V.parentNode,V)):Re&&(Et(),se(Re,1,1,()=>{Re=null}),At()),K[41]?Oe?(Oe.p(K,Z),Z[1]&1024&&X(Oe,1)):(Oe=Hc(K),Oe.c(),X(Oe,1),Oe.m(z.parentNode,z)):Oe&&(Et(),se(Oe,1,1,()=>{Oe=null}),At())},i(K){if(!oe){X(e.$$.fragment,K),X(L),X(ae);for(let Z=0;Z<W.length;Z+=1)X(k[Z]);X(Ce),X(Re),X(Oe),X(H.$$.fragment,K),oe=!0}},o(K){se(e.$$.fragment,K),se(L),se(ae);for(let Z=0;Z<k.length;Z+=1)se(k[Z]);se(Ce),se(Re),se(Oe),se(H.$$.fragment,K),oe=!1},d(K){t[84](null),je(e,K),K&&$(p),L&&L.d(K),K&&$(_),ae&&ae.d(K),K&&$(T);for(let Z=0;Z<k.length;Z+=1)k[Z].d(K);K&&$(F),Ce&&Ce.d(K),K&&$(U),Re&&Re.d(K),K&&$(V),Oe&&Oe.d(K),K&&$(z),je(H,K)}}}function yb(t,e,i){let n,a,l,g,p,_,T,k,C,F,U,V,z,{playerApiUrl:H="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:oe=void 0}=e,{contentId:ce=void 0}=e,{playlistId:ge=void 0}=e,{sourceId:ve=void 0}=e,{sourceUrl:le=void 0}=e,{playlist:Se=[]}=e,{showUserInterface:ee=!0}=e,{playerStyle:L="standard"}=e,{playerTitle:ae=void 0}=e,{callToAction:W=void 0}=e,{skipButtonStyle:Ze="auto"}=e,{playlistStyle:Ce="auto-5-4"}=e,{playlistToggle:Re="auto"}=e,{downloadFormats:Oe=[]}=e,{mediaSession:K="auto"}=e,{content:Z=[]}=e,{contentIndex:B=0}=e,{introsOutros:Ke=[]}=e,{introsOutrosIndex:Me=-1}=e,{adverts:we=[]}=e,{advertIndex:Ue=-1}=e,{persistentAdImage:ie=!1}=e,{persistentIndex:pe=-1}=e,{duration:ft=0}=e,{currentTime:Ae=0}=e,{playbackState:Le="stopped"}=e,{playbackRate:qe=1}=e,{widgetStyle:Lt="standard"}=e,{widgetPosition:Pt="auto"}=e,{widgetWidth:Jt="auto"}=e,{widgetTarget:Tt=void 0}=e,{textColor:Wt="#111"}=e,{backgroundColor:jt="#f5f5f5"}=e,{iconColor:ut="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:wt="#eee"}=e,{logoIconEnabled:Te=!0}=e,{highlightSections:gt="all"}=e,{clickableSections:ii="all"}=e,{segmentWidgetSections:Kt="body"}=e,{segmentWidgetPosition:Nt="7-oclock"}=e,{currentSegment:kt=void 0}=e,{hoveredSegment:st=void 0}=e,{advertConsent:Ft="personalized"}=e,{analyticsConsent:ui="allowed"}=e,{analyticsCustomUrl:ci=void 0}=e,{analyticsTag:Dt=void 0}=e,{writeToken:Ot=void 0}=e,{captureErrors:Bt=!0}=e,{transitions:Gt=[]}=e,{controlPanel:ri=void 0}=e;const Qt=(...R)=>Je.addEventListener(...R),ni=(...R)=>Je.removeEventListener(...R);let{initialProps:di={}}=e,{showBottomWidget:It=!1}=e,{showMediaSession:at=!1}=e,{isFullScreen:si=!1}=e,{mediaElement:De=void 0}=e,{userInterface:fi=void 0}=e,{widgetInterface:Yt=void 0}=e,{controller:Je=void 0}=e,{analyticsUrl:Ai=void 0}=e,{analyticsId:Ut=void 0}=e,{listenSessionId:_e=void 0}=e,{sessionCreatedAt:hi=void 0}=e,{isNewListen:gi=!1}=e,{prevPercentage:bi=0}=e,{segmentWidgets:vi=[]}=e,{segmentContainers:Pi=new xs(R=>i(46,vi=R))}=e,{segmentClickables:Ve=new As}=e,{segmentHighlights:Y=new Es}=e;const J=R=>Je.processEvent(fe({emittedFrom:p},R)),Ne=()=>i(82,k=st);function Qr(R){Fe[R?"unshift":"push"](()=>{De=R,i(42,De)})}function Wi(R){Le=R,i(30,Le)}function $r(R){ft=R,i(29,ft)}function ai(R){Ae=R,i(11,Ae)}function vr(R){qe=R,i(31,qe)}function Xi(R){bi=R,i(45,bi)}function Zi(R){Fe[R?"unshift":"push"](()=>{fi=R,i(43,fi)})}function ji(R){Fe[R?"unshift":"push"](()=>{Yt=R,i(44,Yt)})}const or=R=>J(ti(fe({},R),{emittedFrom:"segment-widget",widgetSegment:U,widgetIsCurrent:V}));function kr(R){oe=R,i(0,oe)}function Ii(R){ce=R,i(1,ce)}function Ri(R){ge=R,i(2,ge)}function lr(R){ve=R,i(3,ve)}function Er(R){le=R,i(4,le)}function Gi(R){ee=R,i(5,ee)}function Si(R){L=R,i(6,L)}function zi(R){ae=R,i(22,ae)}function Di(R){W=R,i(23,W)}function qt(R){Ze=R,i(24,Ze)}function Hi(R){Ce=R,i(25,Ce)}function Xt(R){Re=R,i(26,Re)}function mr(R){K=R,i(27,K)}function $t(R){B=R,i(7,B)}function j(R){Me=R,i(8,Me)}function ye(R){Ue=R,i(9,Ue)}function be(R){ie=R,i(28,ie)}function ot(R){pe=R,i(10,pe)}function Or(R){ft=R,i(29,ft)}function Ar(R){Ae=R,i(11,Ae)}function en(R){Le=R,i(30,Le)}function Vs(R){qe=R,i(31,qe)}function mn(R){Lt=R,i(12,Lt)}function Ws(R){Pt=R,i(32,Pt)}function Ki(R){Jt=R,i(33,Jt)}function tn(R){Tt=R,i(13,Tt)}function xi(R){Wt=R,i(34,Wt)}function rn(R){jt=R,i(35,jt)}function xr(R){ut=R,i(36,ut)}function pr(R){wt=R,i(14,wt)}function Fn(R){Te=R,i(37,Te)}function pn(R){gt=R,i(15,gt)}function js(R){ii=R,i(16,ii)}function _r(R){Kt=R,i(17,Kt)}function Un(R){Nt=R,i(18,Nt)}function Br(R){kt=R,i(19,kt)}function Gs(R){st=R,i(20,st)}function rs(R){Ft=R,i(38,Ft)}function ns(R){ui=R,i(39,ui)}function Vn(R){ci=R,i(40,ci)}function Mr(R){Dt=R,i(41,Dt)}return t.$$set=R=>{"playerApiUrl"in R&&i(63,H=R.playerApiUrl),"projectId"in R&&i(0,oe=R.projectId),"contentId"in R&&i(1,ce=R.contentId),"playlistId"in R&&i(2,ge=R.playlistId),"sourceId"in R&&i(3,ve=R.sourceId),"sourceUrl"in R&&i(4,le=R.sourceUrl),"playlist"in R&&i(64,Se=R.playlist),"showUserInterface"in R&&i(5,ee=R.showUserInterface),"playerStyle"in R&&i(6,L=R.playerStyle),"playerTitle"in R&&i(22,ae=R.playerTitle),"callToAction"in R&&i(23,W=R.callToAction),"skipButtonStyle"in R&&i(24,Ze=R.skipButtonStyle),"playlistStyle"in R&&i(25,Ce=R.playlistStyle),"playlistToggle"in R&&i(26,Re=R.playlistToggle),"downloadFormats"in R&&i(47,Oe=R.downloadFormats),"mediaSession"in R&&i(27,K=R.mediaSession),"content"in R&&i(48,Z=R.content),"contentIndex"in R&&i(7,B=R.contentIndex),"introsOutros"in R&&i(49,Ke=R.introsOutros),"introsOutrosIndex"in R&&i(8,Me=R.introsOutrosIndex),"adverts"in R&&i(50,we=R.adverts),"advertIndex"in R&&i(9,Ue=R.advertIndex),"persistentAdImage"in R&&i(28,ie=R.persistentAdImage),"persistentIndex"in R&&i(10,pe=R.persistentIndex),"duration"in R&&i(29,ft=R.duration),"currentTime"in R&&i(11,Ae=R.currentTime),"playbackState"in R&&i(30,Le=R.playbackState),"playbackRate"in R&&i(31,qe=R.playbackRate),"widgetStyle"in R&&i(12,Lt=R.widgetStyle),"widgetPosition"in R&&i(32,Pt=R.widgetPosition),"widgetWidth"in R&&i(33,Jt=R.widgetWidth),"widgetTarget"in R&&i(13,Tt=R.widgetTarget),"textColor"in R&&i(34,Wt=R.textColor),"backgroundColor"in R&&i(35,jt=R.backgroundColor),"iconColor"in R&&i(36,ut=R.iconColor),"highlightColor"in R&&i(14,wt=R.highlightColor),"logoIconEnabled"in R&&i(37,Te=R.logoIconEnabled),"highlightSections"in R&&i(15,gt=R.highlightSections),"clickableSections"in R&&i(16,ii=R.clickableSections),"segmentWidgetSections"in R&&i(17,Kt=R.segmentWidgetSections),"segmentWidgetPosition"in R&&i(18,Nt=R.segmentWidgetPosition),"currentSegment"in R&&i(19,kt=R.currentSegment),"hoveredSegment"in R&&i(20,st=R.hoveredSegment),"advertConsent"in R&&i(38,Ft=R.advertConsent),"analyticsConsent"in R&&i(39,ui=R.analyticsConsent),"analyticsCustomUrl"in R&&i(40,ci=R.analyticsCustomUrl),"analyticsTag"in R&&i(41,Dt=R.analyticsTag),"writeToken"in R&&i(65,Ot=R.writeToken),"captureErrors"in R&&i(66,Bt=R.captureErrors),"transitions"in R&&i(67,Gt=R.transitions),"controlPanel"in R&&i(21,ri=R.controlPanel),"initialProps"in R&&i(70,di=R.initialProps),"showBottomWidget"in R&&i(51,It=R.showBottomWidget),"showMediaSession"in R&&i(52,at=R.showMediaSession),"isFullScreen"in R&&i(71,si=R.isFullScreen),"mediaElement"in R&&i(42,De=R.mediaElement),"userInterface"in R&&i(43,fi=R.userInterface),"widgetInterface"in R&&i(44,Yt=R.widgetInterface),"controller"in R&&i(72,Je=R.controller),"analyticsUrl"in R&&i(73,Ai=R.analyticsUrl),"analyticsId"in R&&i(74,Ut=R.analyticsId),"listenSessionId"in R&&i(75,_e=R.listenSessionId),"sessionCreatedAt"in R&&i(76,hi=R.sessionCreatedAt),"isNewListen"in R&&i(77,gi=R.isNewListen),"prevPercentage"in R&&i(45,bi=R.prevPercentage),"segmentWidgets"in R&&i(46,vi=R.segmentWidgets),"segmentContainers"in R&&i(78,Pi=R.segmentContainers),"segmentClickables"in R&&i(79,Ve=R.segmentClickables),"segmentHighlights"in R&&i(80,Y=R.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&256|t.$$.dirty[1]&262144&&i(55,n=Ke[Me]),t.$$.dirty[0]&512|t.$$.dirty[1]&524288&&i(56,a=we[Ue]),t.$$.dirty[0]&1024|t.$$.dirty[1]&524288&&i(62,l=we[pe]),t.$$.dirty[0]&128|t.$$.dirty[1]&131072&&Z[B],t.$$.dirty[0]&64|t.$$.dirty[2]&512&&i(59,g=si?"video":L),t.$$.dirty[0]&4096|t.$$.dirty[1]&1048576|t.$$.dirty[2]&512&&i(58,_=It&&Lt==="video"&&!si),t.$$.dirty[1]&134217728&&(p=_?"bottom-widget":"inline-player"),t.$$.dirty[0]&8192&&i(13,Tt=pl(Tt)),t.$$.dirty[0]&2097152&&i(21,ri=pl(ri)),t.$$.dirty[0]&32|t.$$.dirty[1]&402653184&&i(61,T=ee&&g==="video"&&!_),t.$$.dirty[0]&31|t.$$.dirty[2]&4&&J(Q1()),t.$$.dirty[0]&1|t.$$.dirty[2]&10&&tb(H,oe,Ot,R=>J(R)),t.$$.dirty[0]&1048576|t.$$.dirty[2]&1048576&&i(82,k=st||k),t.$$.dirty[0]&655360&&i(81,C=ta("current",kt,Kt)),t.$$.dirty[0]&524288|t.$$.dirty[2]&524288&&C&&Ne(),t.$$.dirty[0]&131072|t.$$.dirty[2]&1048576&&i(83,F=ta("hovered",k,Kt)),t.$$.dirty[0]&524288|t.$$.dirty[2]&3670016&&i(54,U=F&&k||C&&kt),t.$$.dirty[0]&524288|t.$$.dirty[1]&8388608&&i(57,V=(U==null?void 0:U.marker)===(kt==null?void 0:kt.marker)),t.$$.dirty[1]&117440512&&i(60,z=V||a||n),t.$$.dirty[0]&393280|t.$$.dirty[1]&8388608|t.$$.dirty[2]&65536&&Pi.update(U,Kt,Nt,L),t.$$.dirty[0]&1114112|t.$$.dirty[2]&131072&&Ve.update(st,ii),t.$$.dirty[0]&573440|t.$$.dirty[2]&262144&&Y.update("current",kt,gt,wt),t.$$.dirty[0]&1097728|t.$$.dirty[2]&262144&&Y.update("hovered",st,gt,wt),t.$$.dirty[0]&2048|t.$$.dirty[2]&1056&&ob(Gt,Je,Ae)},[oe,ce,ge,ve,le,ee,L,B,Me,Ue,pe,Ae,Lt,Tt,wt,gt,ii,Kt,Nt,kt,st,ri,ae,W,Ze,Ce,Re,K,ie,ft,Le,qe,Pt,Jt,Wt,jt,ut,Te,Ft,ui,ci,Dt,De,fi,Yt,bi,vi,Oe,Z,Ke,we,It,at,J,U,n,a,V,_,g,z,T,l,H,Se,Ot,Bt,Gt,Qt,ni,di,si,Je,Ai,Ut,_e,hi,gi,Pi,Ve,Y,C,k,F,Qr,Wi,$r,ai,vr,Xi,Zi,ji,or,kr,Ii,Ri,lr,Er,Gi,Si,zi,Di,qt,Hi,Xt,mr,$t,j,ye,be,ot,Or,Ar,en,Vs,mn,Ws,Ki,tn,xi,rn,xr,pr,Fn,pn,js,_r,Un,Br,Gs,rs,ns,Vn,Mr]}let bb=class extends it{constructor(e){super(),tt(this,e,yb,_b,Xe,{playerApiUrl:63,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:64,showUserInterface:5,playerStyle:6,playerTitle:22,callToAction:23,skipButtonStyle:24,playlistStyle:25,playlistToggle:26,downloadFormats:47,mediaSession:27,content:48,contentIndex:7,introsOutros:49,introsOutrosIndex:8,adverts:50,advertIndex:9,persistentAdImage:28,persistentIndex:10,duration:29,currentTime:11,playbackState:30,playbackRate:31,widgetStyle:12,widgetPosition:32,widgetWidth:33,widgetTarget:13,textColor:34,backgroundColor:35,iconColor:36,highlightColor:14,logoIconEnabled:37,highlightSections:15,clickableSections:16,segmentWidgetSections:17,segmentWidgetPosition:18,currentSegment:19,hoveredSegment:20,advertConsent:38,analyticsConsent:39,analyticsCustomUrl:40,analyticsTag:41,writeToken:65,captureErrors:66,transitions:67,controlPanel:21,addEventListener:68,removeEventListener:69,initialProps:70,showBottomWidget:51,showMediaSession:52,isFullScreen:71,mediaElement:42,userInterface:43,widgetInterface:44,controller:72,analyticsUrl:73,analyticsId:74,listenSessionId:75,sessionCreatedAt:76,isNewListen:77,prevPercentage:45,segmentWidgets:46,segmentContainers:78,segmentClickables:79,segmentHighlights:80,onEvent:53},null,[-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[63]}set playerApiUrl(e){this.$$set({playerApiUrl:e}),P()}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),P()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),P()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),P()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),P()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),P()}get playlist(){return this.$$.ctx[64]}set playlist(e){this.$$set({playlist:e}),P()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),P()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),P()}get playerTitle(){return this.$$.ctx[22]}set playerTitle(e){this.$$set({playerTitle:e}),P()}get callToAction(){return this.$$.ctx[23]}set callToAction(e){this.$$set({callToAction:e}),P()}get skipButtonStyle(){return this.$$.ctx[24]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),P()}get playlistStyle(){return this.$$.ctx[25]}set playlistStyle(e){this.$$set({playlistStyle:e}),P()}get playlistToggle(){return this.$$.ctx[26]}set playlistToggle(e){this.$$set({playlistToggle:e}),P()}get downloadFormats(){return this.$$.ctx[47]}set downloadFormats(e){this.$$set({downloadFormats:e}),P()}get mediaSession(){return this.$$.ctx[27]}set mediaSession(e){this.$$set({mediaSession:e}),P()}get content(){return this.$$.ctx[48]}set content(e){this.$$set({content:e}),P()}get contentIndex(){return this.$$.ctx[7]}set contentIndex(e){this.$$set({contentIndex:e}),P()}get introsOutros(){return this.$$.ctx[49]}set introsOutros(e){this.$$set({introsOutros:e}),P()}get introsOutrosIndex(){return this.$$.ctx[8]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),P()}get adverts(){return this.$$.ctx[50]}set adverts(e){this.$$set({adverts:e}),P()}get advertIndex(){return this.$$.ctx[9]}set advertIndex(e){this.$$set({advertIndex:e}),P()}get persistentAdImage(){return this.$$.ctx[28]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),P()}get persistentIndex(){return this.$$.ctx[10]}set persistentIndex(e){this.$$set({persistentIndex:e}),P()}get duration(){return this.$$.ctx[29]}set duration(e){this.$$set({duration:e}),P()}get currentTime(){return this.$$.ctx[11]}set currentTime(e){this.$$set({currentTime:e}),P()}get playbackState(){return this.$$.ctx[30]}set playbackState(e){this.$$set({playbackState:e}),P()}get playbackRate(){return this.$$.ctx[31]}set playbackRate(e){this.$$set({playbackRate:e}),P()}get widgetStyle(){return this.$$.ctx[12]}set widgetStyle(e){this.$$set({widgetStyle:e}),P()}get widgetPosition(){return this.$$.ctx[32]}set widgetPosition(e){this.$$set({widgetPosition:e}),P()}get widgetWidth(){return this.$$.ctx[33]}set widgetWidth(e){this.$$set({widgetWidth:e}),P()}get widgetTarget(){return this.$$.ctx[13]}set widgetTarget(e){this.$$set({widgetTarget:e}),P()}get textColor(){return this.$$.ctx[34]}set textColor(e){this.$$set({textColor:e}),P()}get backgroundColor(){return this.$$.ctx[35]}set backgroundColor(e){this.$$set({backgroundColor:e}),P()}get iconColor(){return this.$$.ctx[36]}set iconColor(e){this.$$set({iconColor:e}),P()}get highlightColor(){return this.$$.ctx[14]}set highlightColor(e){this.$$set({highlightColor:e}),P()}get logoIconEnabled(){return this.$$.ctx[37]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),P()}get highlightSections(){return this.$$.ctx[15]}set highlightSections(e){this.$$set({highlightSections:e}),P()}get clickableSections(){return this.$$.ctx[16]}set clickableSections(e){this.$$set({clickableSections:e}),P()}get segmentWidgetSections(){return this.$$.ctx[17]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),P()}get segmentWidgetPosition(){return this.$$.ctx[18]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),P()}get currentSegment(){return this.$$.ctx[19]}set currentSegment(e){this.$$set({currentSegment:e}),P()}get hoveredSegment(){return this.$$.ctx[20]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),P()}get advertConsent(){return this.$$.ctx[38]}set advertConsent(e){this.$$set({advertConsent:e}),P()}get analyticsConsent(){return this.$$.ctx[39]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),P()}get analyticsCustomUrl(){return this.$$.ctx[40]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),P()}get analyticsTag(){return this.$$.ctx[41]}set analyticsTag(e){this.$$set({analyticsTag:e}),P()}get writeToken(){return this.$$.ctx[65]}set writeToken(e){this.$$set({writeToken:e}),P()}get captureErrors(){return this.$$.ctx[66]}set captureErrors(e){this.$$set({captureErrors:e}),P()}get transitions(){return this.$$.ctx[67]}set transitions(e){this.$$set({transitions:e}),P()}get controlPanel(){return this.$$.ctx[21]}set controlPanel(e){this.$$set({controlPanel:e}),P()}get addEventListener(){return this.$$.ctx[68]}get removeEventListener(){return this.$$.ctx[69]}get initialProps(){return this.$$.ctx[70]}set initialProps(e){this.$$set({initialProps:e}),P()}get showBottomWidget(){return this.$$.ctx[51]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),P()}get showMediaSession(){return this.$$.ctx[52]}set showMediaSession(e){this.$$set({showMediaSession:e}),P()}get isFullScreen(){return this.$$.ctx[71]}set isFullScreen(e){this.$$set({isFullScreen:e}),P()}get mediaElement(){return this.$$.ctx[42]}set mediaElement(e){this.$$set({mediaElement:e}),P()}get userInterface(){return this.$$.ctx[43]}set userInterface(e){this.$$set({userInterface:e}),P()}get widgetInterface(){return this.$$.ctx[44]}set widgetInterface(e){this.$$set({widgetInterface:e}),P()}get controller(){return this.$$.ctx[72]}set controller(e){this.$$set({controller:e}),P()}get analyticsUrl(){return this.$$.ctx[73]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),P()}get analyticsId(){return this.$$.ctx[74]}set analyticsId(e){this.$$set({analyticsId:e}),P()}get listenSessionId(){return this.$$.ctx[75]}set listenSessionId(e){this.$$set({listenSessionId:e}),P()}get sessionCreatedAt(){return this.$$.ctx[76]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),P()}get isNewListen(){return this.$$.ctx[77]}set isNewListen(e){this.$$set({isNewListen:e}),P()}get prevPercentage(){return this.$$.ctx[45]}set prevPercentage(e){this.$$set({prevPercentage:e}),P()}get segmentWidgets(){return this.$$.ctx[46]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),P()}get segmentContainers(){return this.$$.ctx[78]}set segmentContainers(e){this.$$set({segmentContainers:e}),P()}get segmentClickables(){return this.$$.ctx[79]}set segmentClickables(e){this.$$set({segmentClickables:e}),P()}get segmentHighlights(){return this.$$.ctx[80]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),P()}get onEvent(){return this.$$.ctx[53]}};class Sb{constructor(e,i){this.baseUrl=e==null?void 0:e.replace("{id}",i)}byContentId(e){return Xn(`${this.baseUrl}/by_content_id/${e}`)}byPlaylistId(e){return Xn(`${this.baseUrl}/by_playlist_id/${e}`)}bySourceId(e){return Xn(`${this.baseUrl}/by_source_id/${e}`)}bySourceUrl(e){return Xn(`${this.baseUrl}/by_source_url/${e}`)}byIdentifiers(e){return Xn(`${this.baseUrl}/by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}const _l=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(_l):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),_l(i)])),Kc=t=>t==="dark"||t==="auto"&&Tb()?"dark":"light",Tb=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Yc=t=>on(this,null,function*(){const e=new Sb(t.playerApiUrl,t.projectId);if(!t.playerApiUrl||!t.projectId)return;const i=kb(t);if(i.length===0)return;const n=yield Eb(e,i);n&&Ab(t,n)}),kb=t=>{const e=[];return t.contentId&&e.push({content_id:t.contentId}),t.playlistId&&e.push({playlist_id:t.playlistId}),t.sourceId&&e.push({source_id:t.sourceId}),t.sourceUrl&&e.push({source_url:t.sourceUrl}),t.playlist&&e.push(..._l(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},Eb=(t,e)=>{const i=e[0];if(e.length>1)return t.byIdentifiers(e);if(i.content_id)return t.byContentId(i.content_id);if(i.playlist_id)return t.byPlaylistId(i.playlist_id);if(i.source_id)return t.bySourceId(i.source_id);if(i.source_url)return t.bySourceUrl(i.source_url)},Ab=(t,e)=>{var l;const i=Kc(e.settings.theme),n=e.settings[`${i}_theme`],a=e.settings.image_enabled;xt(t,"playerStyle",e.settings.player_style),xt(t,"playerTitle",((l=e.playlist)==null?void 0:l.title)||e.settings.player_title),xt(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),xt(t,"skipButtonStyle",e.settings.skip_button_style),xt(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),xt(t,"contentIndex",0),xt(t,"introsOutros",xb(e.settings)),xt(t,"introsOutrosIndex",-1),xt(t,"advertIndex",-1),xt(t,"persistentAdImage",e.settings.persistent_ad_image),xt(t,"persistentIndex",-1),xt(t,"duration",0),xt(t,"currentTime",0),xt(t,"playbackState","stopped"),xt(t,"widgetStyle",e.settings.widget_style),xt(t,"widgetPosition",e.settings.widget_position),xt(t,"textColor",n.text_color),xt(t,"backgroundColor",n.background_color),xt(t,"iconColor",n.icon_color),xt(t,"highlightColor",n.highlight_color),xt(t,"logoIconEnabled",e.settings.logo_icon_enabled),xt(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),xt(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),xt(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),xt(t,"currentSegment",void 0),xt(t,"hoveredSegment",void 0),xt(t,"analyticsConsent",Pb(e.settings)),xt(t,"analyticsCustomUrl",e.settings.analytics_custom_url),xt(t,"analyticsTag",e.settings.analytics_tag),xt(t,"analyticsUrl",e.settings.analytics_url),xt(t,"analyticsId",e.settings.analytics_id),xt(t,"content",e.content.map(g=>{var p;return{id:g.id,title:g.title,imageUrl:a&&(((p=e.playlist)==null?void 0:p.image_url)||e.settings.image_url||g.image_url),sourceId:g.source_id,sourceUrl:g.source_url,adsEnabled:g.ads_enabled,duration:g.audio[0]?g.audio[0].duration/1e3:0,media:[...g.video,...g.audio].map(_=>({id:_.id,url:_.url,contentType:_.content_type})),segments:g.segments.map(_=>({marker:_.marker,section:_.section,startTime:_.start_time?_.start_time/1e3:0,duration:_.duration?_.duration/1e3:0}))}})),xt(t,"adverts",e.ads.map(g=>{const p=g.type==="vast",_=Kc(g.theme),T=g[`${_}_theme`];return{id:g.id,type:g.type,placement:g.placement,vastUrl:p?g.vast_url:null,clickThroughUrl:p?null:g.click_through_url,imageUrl:a&&g.image_url,textColor:T==null?void 0:T.text_color,backgroundColor:T==null?void 0:T.background_color,iconColor:T==null?void 0:T.icon_color,media:p?[]:g.media.map(k=>({id:k.id,url:k.url,contentType:k.content_type}))}}))},xt=(t,e,i)=>{typeof t.initialProps[e]!="undefined"||(t[e]=i)},xb=({intro_outro_enabled:t,intro_url:e,outro_url:i})=>{if(!t)return[];const n=[];return e&&n.push({placement:"pre-roll",media:[{url:e}]}),i&&n.push({placement:"post-roll",media:[{url:i}]}),n},Pb=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",wb=(t,e)=>on(this,null,function*(){const n=yield(yield fetch(t)).blob(),a=URL.createObjectURL(n),l=document.createElement("a");document.body.append(l),l.href=a,l.setAttribute("download",e),l.setAttribute("target","_blank"),l.click(),l.remove()}),Xa={vastUrls:new Set,mediaSources:new Set},Cb=t=>{t.vastUrl&&Xa.vastUrls.add(t.vastUrl);for(const e of t.media)Xa.mediaSources.add(e.url)},qc=t=>{if(t.vastUrl&&Xa.vastUrls.has(t.vastUrl))return!0;for(const e of t.media)if(Xa.mediaSources.has(e.url))return!0;return!1},Xc=new Set,Lb=t=>{t.media.forEach(e=>Xc.add(e.url))},Ib=t=>t.media.some(e=>Xc.has(e.url)),Rb=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:a,currentTime:l,atTheStart:g,atTheEnd:p,errored:_}={})=>{var V;const T=e&&e[i];e:if(T){if(_){Cb(T);break e}if(p)return Lb(T),-1;if(!p)return i}if(!((V=n[a])!=null&&V.adsEnabled)||t!==-1)return-1;const k=Ob({content:n,contentIndex:a,currentTime:l,atTheStart:g,atTheEnd:p});let C=-1,F=-1/0,U=-1/0;for(const[z,H]of e.entries()){if(Ib(H)||qc(H)||!k.has(H.placement))continue;const oe=Db[H.type]||0;if(oe<F)continue;const ce=Math.random();oe===F&&ce<U||(C=z,F=oe,U=ce)}return C},Db={vast:1,custom:0},Ob=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:a})=>{const l=e===0,g=e===t.length-1,p=t.length>1,_=p&&n&&!l,T=t[e].segments,k=T[T.length-1],C=p?null:Fb(T),F=T[C],U=F&&i>F.startTime,V=k?k.startTime+k.duration:0,z=i>V-Mb,H=new Set;return n&&H.add("pre-roll"),U&&!z&&H.add("mid-roll"),_&&H.add("mid-roll"),a&&g&&H.add("post-roll"),_&&H.add("post-roll"),H},Bb=2*60,Mb=10,Nb=.5,Fb=t=>{const e=t[t.length-1];if(!e)return;const i=e.startTime+e.duration;if(i<Bb)return;const n=i/2,a=al(t,i/2),p=t[a].startTime>=n-Nb?a:a+1;if(p!==t.length)return p},Ub=(t,e,i,n)=>{let a=-1,l=-1/0,g=-1/0;for(const[p,_]of(n||[]).entries()){if(!t||qc(_)||_.type==="vast")continue;const T=Wb(p,e,i);if(T<l)continue;const k=Vb[_.placement]||0;T===l&&k<g||(a=p,l=T,g=k)}return a},Vb={"pre-roll":2,"mid-roll":1},Wb=(t,e,i)=>t===i?2:t===e?1:0,Zc={mediaSources:new Set},jb=t=>{for(const e of t.media)Zc.mediaSources.add(e.url)},Gb=t=>{for(const e of t.media)if(Zc.mediaSources.has(e.url))return!0;return!1},Jc=new Set,zb=t=>{t.media.forEach(e=>Jc.add(e.url))},Hb=t=>t.media.some(e=>Jc.has(e.url)),Kb=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:a,currentTime:l,atTheStart:g,atTheEnd:p,errored:_})=>{const T=t[e];e:if(T){if(_){jb(T);break e}if(p)return zb(T),-1;if(!p)return e}if(i!==-1)return-1;const k=Yb({content:n,contentIndex:a,currentTime:l,atTheStart:g,atTheEnd:p});let C=-1,F=-1/0,U=-1/0;for(const[V,z]of t.entries()){if(Gb(z)||!k.has(z.placement))continue;const H=Hb(z)?1:0;if(H<F)continue;const oe=Math.random();H===F&&oe<U||(C=V,F=H,U=oe)}return C},Yb=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:a})=>{const l=new Set,g=n&&e===0&&i===0,p=a&&e===t.length-1;return g&&l.add("pre-roll"),p&&l.add("post-roll"),l},qb=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(l=>l.mediaSession==="override");if(Jb()&&!e)return;let i,n=-1/0,a=-1/0;for(const l of t.instances()){if(l.mediaSession==="none")continue;const g=Xb[l.playbackState]||0;if(g<n)continue;const p=Zb[l.showMediaSession]||0;g===n&&p<a||(i=l,n=g,a=p)}for(const l of t.instances())l.showMediaSession=l===i;return i},Xb={playing:1,paused:0,stopped:0},Zb={true:1,false:0},Jb=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:a}=t;return e||i||n||(a==null?void 0:a.length)},Qb=t=>{let e=!1,i,n=-1/0,a=-1/0;for(const l of t.instances()){if(!l.userInterface||l.widgetTarget||!hl(l.widgetStyle))continue;if(l.userInterface.isVisible){e=!0;continue}if(!(l.userInterface.relativeY<0))continue;const T=$b[l.playbackState]||0;if(T<n)continue;const k=l.userInterface.absoluteY;T===n&&k<a||(i=l,n=T,a=k)}e&&n===0&&(i=null);for(const l of t.instances())l.showBottomWidget=l===i},$b={playing:2,paused:1,stopped:0};class eS{constructor(e,i){ht(this,Ao);ht(this,xo);ht(this,ba);ht(this,Po);ht(this,wo);ht(this,Dr);ht(this,fn);ht(this,ar);ht(this,Co);ht(this,ts);ht(this,hn);ht(this,Lo);ht(this,Sa);ht(this,Zr);ht(this,Ta);ht(this,gn);ht(this,Li);ht(this,vn);ht(this,Jr);ht(this,Io);ht(this,Ro);ht(this,is);ht(this,ka);ht(this,Do);ht(this,Oo);ht(this,Bo);ht(this,Mo);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||tr(`Cannot add listener for unknown event type '${e}'.`);const a=`listener-handle-${Ba()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][a]=i,a}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return on(this,null,function*(){yield Mc(()=>this.player),ag(e);const i=this[`handle${e.type}`],n=ia(this.player);de(this,Ao,vh).call(this,e)?e.status="ignored-due-to-advert":de(this,xo,mh).call(this,e)?e.status="ignored-due-to-scrubbing":i?(yield i.call(this,e),de(this,Io,Sh).call(this),de(this,Ro,Th).call(this),e.status="handled"):tr("No handler function for event.",e);const a=ia(this.player);e.changedProps=Nc(n,a),e.processedAt=new Date().toISOString(),og(e),de(this,ba,pu).call(this,e.type,e),de(this,ba,pu).call(this,"<any>",e)})}handlePressedChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1)}handlePressedRightOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e+1)}handlePressedDownOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e-1)}handlePressedLeftOnChangeSpeed(){de(this,Zr,Hn).call(this,e=>e-1)}handlePressedPrevSegment(){de(this,Ta,yu).call(this,e=>e-1)}handlePressedNextSegment(){de(this,Ta,yu).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){de(this,Li,er).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){de(this,Li,er).call(this,i=>i+e)}handlePressedPrevTrack(){de(this,gn,cs).call(this,e=>e-1)}handlePressedNextTrack(){de(this,gn,cs).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleCurrentTimeUpdated(){!this.midrollPlayed&&de(this,Jr,Kn).call(this)}handlePlaybackPaused(){}handlePlaybackRateUpdated(){}handleVisibilityChanged(){Qb(this.PlayerClass)}handlePressedScrollToPlayer(){this.player.target.scrollIntoView()}handlePressedVideoBackground(){de(this,hn,us).call(this)}handlePressedEnterOnProgressBar(){de(this,hn,us).call(this)}handlePressedSpaceOnProgressBar(){de(this,hn,us).call(this)}handlePressedEnterOnProgressCircle(){de(this,hn,us).call(this)}handlePressedSpaceOnProgressCircle(){de(this,hn,us).call(this)}handlePressedLeftOnProgressBar(){de(this,Li,er).call(this,e=>e-5)}handlePressedRightOnProgressBar(){de(this,Li,er).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){de(this,Li,er).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){de(this,Li,er).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,de(this,Lo,bh).call(this),de(this,Li,er).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){de(this,Li,er).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){this.player.playbackState=this.preScrubState,delete this.preScrubState}handleIdentifiersChanged(){Yc(this.player).then(()=>{de(this,vn,ds).call(this,{atTheStart:!0}),de(this,Jr,Kn).call(this,{atTheStart:!0})})}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?de(this,Sa,_u).call(this,i):this.player.playbackState="playing"}handlePressedPause(){this.player.playbackState="paused"}handlePlaybackPlaying(){this.PlayerClass.instances().filter(n=>n!==this.player).filter(n=>n.playbackState==="playing").forEach(n=>n.playbackState="paused"),qb(this.PlayerClass)}handlePlaybackEnded(){de(this,Co,yh).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=de(this,Dr,En).call(this),i=de(this,ar,wr).call(this);de(this,Jr,Kn).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(de(this,vn,ds).call(this,{atTheEnd:!0}),!e&&(de(this,fn,ls).call(this)||de(this,ar,wr).call(this)||de(this,gn,cs).call(this,n=>n+1)))}handlePlaybackErrored({mediaType:e,mediaUrl:i,errorMessage:n}){console.error(`${e} playback error: ${n} (requesting ${i})`),de(this,Dr,En).call(this)||de(this,fn,ls).call(this)?de(this,vn,ds).call(this,{errored:!0}):de(this,ar,wr).call(this)?de(this,Jr,Kn).call(this,{errored:!0}):this.handlePlaybackEnded()}handlePressedMaximize(){rc()?a1():s1(this.player.target)}handleFullScreenModeUpdated(){const e=rc()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){de(this,gn,cs).call(this,()=>e),this.player.playbackState="playing"}handlePressedTogglePlaylist(){const e=this.player.playlistStyle.split("-"),i=this.player.content.length>1,n=e[0]==="show"||e[0]==="auto"&&i;e[0]=n?"hide":"show",this.player.playlistStyle=e.join("-")}handlePressedDownload({contentIndex:e,mediaIndex:i}){const n=this.player.content[e],l=n.media[i].url,g=l.split(".").pop(),p=`${n.title}.${g}`;return wb(l,p)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:a,contentStatus:l}){l==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&de(this,Bo,Ah).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:a})&&Yc(this.player).then(()=>{de(this,vn,ds).call(this,{atTheStart:!0}),de(this,Jr,Kn).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){var a;de(this,ts,Pa).call(this)?this.player.currentSegment=ti(fe({},e),{segmentIndex:i,contentIndex:n}):this.segmentPlayed||((a=this.player.segmentContainers)==null||a.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){e?this.player.hoveredSegment=ti(fe({},e),{segmentIndex:i,contentIndex:n}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,segmentIndex:i,contentIndex:n}){if(!ta("hovered",e,this.player.clickableSections))return;if(!de(this,Mo,xh).call(this,{contentIndex:n,segmentIndex:i})&&!de(this,ar,wr).call(this)){de(this,hn,us).call(this);return}n!==this.player.contentIndex&&de(this,gn,cs).call(this,()=>n),de(this,Sa,_u).call(this,fe({segmentIndex:i,contentIndex:n},e))}}Ao=new WeakSet,vh=function({type:e}){return de(this,ar,wr).call(this)&&(e.includes("ChangeSpeed")||e.includes("PrevSegment")||e.includes("NextSegment")||e.includes("SeekBack")||e.includes("SeekAhead")||e.includes("Progress")&&!e.includes("Space")&&!e.includes("Enter"))},xo=new WeakSet,mh=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},ba=new WeakSet,pu=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(a=>a(i))},Po=new WeakSet,ph=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},wo=new WeakSet,_h=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},Dr=new WeakSet,En=function(e=this.player.introsOutrosIndex){var i,n,a;return((a=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:a.placement)==="pre-roll"},fn=new WeakSet,ls=function(e=this.player.introsOutrosIndex){var i,n,a;return((a=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:a.placement)==="post-roll"},ar=new WeakSet,wr=function(){return this.player.advertIndex!==-1},Co=new WeakSet,yh=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},ts=new WeakSet,Pa=function(){return!de(this,Dr,En).call(this)&&!de(this,fn,ls).call(this)&&!de(this,ar,wr).call(this)},hn=new WeakSet,us=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},Lo=new WeakSet,bh=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},Sa=new WeakSet,_u=function(a){var l=a,{segmentIndex:e,contentIndex:i}=l,n=gu(l,["segmentIndex","contentIndex"]);de(this,Li,er).call(this,()=>n.startTime,i),this.player.currentSegment=fe({segmentIndex:e,contentIndex:i},n),this.player.playbackState="playing",this.segmentPlayed=!0},Zr=new WeakSet,Hn=function(e,{cycle:i}={}){const n=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3],a=n.length-1,l=n.indexOf(this.player.playbackRate),g=e(l);let p;i?p=g%n.length:p=Math.max(0,Math.min(a,g)),this.player.playbackRate=n[p]||1},Ta=new WeakSet,yu=function(e){const i=this.player.content[this.player.contentIndex].segments,n=al(i,this.player.currentTime),a=e(n);de(this,Dr,En).call(this)&&a>=0?this.handlePlaybackEnded():de(this,fn,ls).call(this)&&a<0?(de(this,is,wa).call(this,-1),de(this,Li,er).call(this,()=>{var l;return((l=i[i.length-1])==null?void 0:l.startTime)||.01}),this.player.playbackState="playing"):de(this,ts,Pa).call(this)&&a<0&&de(this,Po,ph).call(this)?(de(this,Li,er).call(this,()=>0),de(this,vn,ds).call(this,{atTheStart:!0})):de(this,ts,Pa).call(this)&&a===i.length&&de(this,wo,_h).call(this)?de(this,Li,er).call(this,()=>this.player.duration-.01):de(this,ts,Pa).call(this)&&a>=0&&a<i.length&&de(this,Li,er).call(this,()=>i[a].startTime)},gn=new WeakSet,cs=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",de(this,Li,er).call(this,()=>0)):(this.player.contentIndex=i,de(this,ar,wr).call(this)||(de(this,Li,er).call(this,()=>0),this.midrollPlayed=!1)),de(this,is,wa).call(this,-1),de(this,vn,ds).call(this,{atTheStart:!0}),n||de(this,Jr,Kn).call(this,{atTheStart:!0})},Li=new WeakSet,er=function(e,i){if(de(this,ar,wr).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},vn=new WeakSet,ds=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:a,introsOutros:l,currentTime:g}=this.player,p=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,_=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,T=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;de(this,is,wa).call(this,Kb({introsOutros:l,introsOutrosIndex:p,advertIndex:_,content:a,contentIndex:T,currentTime:g,atTheStart:e,atTheEnd:i,errored:n}))},Jr=new WeakSet,Kn=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:a}={}){const{adverts:l,content:g,currentTime:p}=this.player;let _=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const T=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,k=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,_=-1),de(this,ka,bu).call(this,Rb({introsOutrosIndex:_,adverts:l,advertIndex:T,content:g,contentIndex:k,currentTime:p,atTheStart:e,atTheEnd:i,errored:a}));const C=this.player.persistentAdImage,F=this.player.persistentIndex;this.player.persistentIndex=Ub(C,F,T,l)},Io=new WeakSet,Sh=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(de(this,is,wa).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},Ro=new WeakSet,Th=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(de(this,ka,bu).call(this,this.nextAdvert),delete this.nextAdvert)},is=new WeakSet,wa=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextIntroOutro=e;return}else delete this.nextIntroOutro;if(!(this.player.contentIndex===0&&this.player.currentTime===0)&&de(this,Dr,En).call(this,e)){this.player.introsOutrosIndex=-1,de(this,Jr,Kn).call(this,{atTheStart:!0});return}const l=de(this,Dr,En).call(this),g=de(this,fn,ls).call(this);this.player.introsOutrosIndex=e;const p=l&&!de(this,Dr,En).call(this),_=g&&!de(this,fn,ls).call(this);p&&(this.player.currentTime=0),_&&de(this,gn,cs).call(this,()=>1/0)},ka=new WeakSet,bu=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=de(this,ar,wr).call(this);this.player.advertIndex=e;const a=!n&&de(this,ar,wr).call(this),l=n&&!de(this,ar,wr).call(this);a&&de(this,Do,kh).call(this),l&&de(this,Oo,Eh).call(this)},Do=new WeakSet,kh=function(){de(this,Dr,En).call(this)||(this.prevTime=this.player.currentTime),this.prevRate=this.player.playbackRate,this.prevContent=this.player.contentIndex,this.player.currentTime=0,this.player.playbackRate=1},Oo=new WeakSet,Eh=function(){this.player.playbackRate=this.prevRate||1,this.player.contentIndex!==this.prevContent||(this.player.currentTime=this.prevTime),delete this.prevTime,delete this.prevRate,delete this.prevContent},Bo=new WeakSet,Ah=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:a}){var l,g,p,_;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===a||((l=this.player.playlist)==null?void 0:l.some(T=>T.contentId===e))||((g=this.player.playlist)==null?void 0:g.some(T=>T.contentId===i))||((p=this.player.playlist)==null?void 0:p.some(T=>T.sourceId===n))||((_=this.player.playlist)==null?void 0:_.some(T=>T.sourceUrl===a))},Mo=new WeakSet,xh=function({contentIndex:e,segmentIndex:i}){var n,a;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((a=this.player.currentSegment)==null?void 0:a.segmentIndex)!==i};const tS=()=>{typeof window=="undefined"&&tr(["Trying to initialize BeyondWords.Player in a server context but this is unsupported.","Please only initialize the player in a context where the global window object is available.","For example, by initializing the player inside a useEffect hook in a React application."])},Qc=Object.prototype.toString;function $c(t){switch(Qc.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Cs(t,Error)}}function Ps(t,e){return Qc.call(t)===`[object ${e}]`}function ed(t){return Ps(t,"ErrorEvent")}function td(t){return Ps(t,"DOMError")}function iS(t){return Ps(t,"DOMException")}function Jn(t){return Ps(t,"String")}function id(t){return t===null||typeof t!="object"&&typeof t!="function"}function ws(t){return Ps(t,"Object")}function yl(t){return typeof Event!="undefined"&&Cs(t,Event)}function rS(t){return typeof Element!="undefined"&&Cs(t,Element)}function nS(t){return Ps(t,"RegExp")}function bl(t){return!!(t&&t.then&&typeof t.then=="function")}function sS(t){return ws(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function aS(t){return typeof t=="number"&&t!==t}function Cs(t,e){try{return t instanceof e}catch(i){return!1}}function Za(t){return t&&t.Math==Math?t:void 0}const Tr=typeof globalThis=="object"&&Za(globalThis)||typeof window=="object"&&Za(window)||typeof self=="object"&&Za(self)||typeof global=="object"&&Za(global)||function(){return this}()||{};function na(){return Tr}function Sl(t,e,i){const n=i||Tr,a=n.__SENTRY__=n.__SENTRY__||{};return a[t]||(a[t]=e())}const Ja=na(),oS=80;function Tl(t,e={}){try{let i=t;const n=5,a=[];let l=0,g=0;const p=" > ",_=p.length;let T;const k=Array.isArray(e)?e:e.keyAttrs,C=!Array.isArray(e)&&e.maxStringLength||oS;for(;i&&l++<n&&(T=lS(i,k),!(T==="html"||l>1&&g+a.length*_+T.length>=C));)a.push(T),g+=T.length,i=i.parentNode;return a.reverse().join(p)}catch(i){return"<unknown>"}}function lS(t,e){const i=t,n=[];let a,l,g,p,_;if(!i||!i.tagName)return"";n.push(i.tagName.toLowerCase());const T=e&&e.length?e.filter(C=>i.getAttribute(C)).map(C=>[C,i.getAttribute(C)]):null;if(T&&T.length)T.forEach(C=>{n.push(`[${C[0]}="${C[1]}"]`)});else if(i.id&&n.push(`#${i.id}`),a=i.className,a&&Jn(a))for(l=a.split(/\s+/),_=0;_<l.length;_++)n.push(`.${l[_]}`);const k=["aria-label","type","name","title","alt"];for(_=0;_<k.length;_++)g=k[_],p=i.getAttribute(g),p&&n.push(`[${g}="${p}"]`);return n.join("")}function uS(){try{return Ja.document.location.href}catch(t){return""}}function cS(t){return Ja.document&&Ja.document.querySelector?Ja.document.querySelector(t):null}const dS="Sentry Logger ",Qa=["debug","info","warn","error","log","assert","trace"];function rd(t){if(!("console"in Tr))return t();const e=Tr.console,i={};Qa.forEach(n=>{const a=e[n]&&e[n].__sentry_original__;n in e&&a&&(i[n]=e[n],e[n]=a)});try{return t()}finally{Object.keys(i).forEach(n=>{e[n]=i[n]})}}function nd(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__?Qa.forEach(i=>{e[i]=(...n)=>{t&&rd(()=>{Tr.console[i](`${dS}[${i}]:`,...n)})}}):Qa.forEach(i=>{e[i]=()=>{}}),e}let ct;typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__?ct=Sl("logger",nd):ct=nd();const fS=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function hS(t){return t==="http"||t==="https"}function $a(t,e=!1){const{host:i,path:n,pass:a,port:l,projectId:g,protocol:p,publicKey:_}=t;return`${p}://${_}${e&&a?`:${a}`:""}@${i}${l?`:${l}`:""}/${n&&`${n}/`}${g}`}function gS(t){const e=fS.exec(t);if(!e){console.error(`Invalid Sentry Dsn: ${t}`);return}const[i,n,a="",l,g="",p]=e.slice(1);let _="",T=p;const k=T.split("/");if(k.length>1&&(_=k.slice(0,-1).join("/"),T=k.pop()),T){const C=T.match(/^\d+/);C&&(T=C[0])}return sd({host:l,pass:a,path:_,projectId:T,port:g,protocol:i,publicKey:n})}function sd(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function vS(t){if(!(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__))return!0;const{port:e,projectId:i,protocol:n}=t;return["protocol","publicKey","host","projectId"].find(g=>t[g]?!1:(ct.error(`Invalid Sentry Dsn: ${g} missing`),!0))?!1:i.match(/^\d+$/)?hS(n)?e&&isNaN(parseInt(e,10))?(ct.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(ct.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(ct.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),!1)}function mS(t){const e=typeof t=="string"?gS(t):sd(t);if(!(!e||!vS(e)))return e}class Ir extends Error{constructor(e,i="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=i}}function sa(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function ad(t,e){if(!Array.isArray(t))return"";const i=[];for(let n=0;n<t.length;n++){const a=t[n];try{i.push(String(a))}catch(l){i.push("[value cannot be serialized]")}}return i.join(e)}function pS(t,e,i=!1){return Jn(t)?nS(e)?e.test(t):Jn(e)?i?t===e:t.includes(e):!1:!1}function eo(t,e=[],i=!1){return e.some(n=>pS(t,n,i))}function Vi(t,e,i){if(!(e in t))return;const n=t[e],a=i(n);if(typeof a=="function")try{od(a,n)}catch(l){}t[e]=a}function kl(t,e,i){Object.defineProperty(t,e,{value:i,writable:!0,configurable:!0})}function od(t,e){const i=e.prototype||{};t.prototype=e.prototype=i,kl(t,"__sentry_original__",e)}function El(t){return t.__sentry_original__}function _S(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function ld(t){if($c(t))return fe({message:t.message,name:t.name,stack:t.stack},cd(t));if(yl(t)){const e=fe({type:t.type,target:ud(t.target),currentTarget:ud(t.currentTarget)},cd(t));return typeof CustomEvent!="undefined"&&Cs(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function ud(t){try{return rS(t)?Tl(t):Object.prototype.toString.call(t)}catch(e){return"<unknown>"}}function cd(t){if(typeof t=="object"&&t!==null){const e={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}else return{}}function yS(t,e=40){const i=Object.keys(ld(t));if(i.sort(),!i.length)return"[object has no keys]";if(i[0].length>=e)return sa(i[0],e);for(let n=i.length;n>0;n--){const a=i.slice(0,n).join(", ");if(!(a.length>e))return n===i.length?a:sa(a,e)}return""}function Al(t){return xl(t,new Map)}function xl(t,e){if(ws(t)){const i=e.get(t);if(i!==void 0)return i;const n={};e.set(t,n);for(const a of Object.keys(t))typeof t[a]!="undefined"&&(n[a]=xl(t[a],e));return n}if(Array.isArray(t)){const i=e.get(t);if(i!==void 0)return i;const n=[];return e.set(t,n),t.forEach(a=>{n.push(xl(a,e))}),n}return t}const dd=50,fd=/\(error: (.*)\)/;function hd(...t){const e=t.sort((i,n)=>i[0]-n[0]).map(i=>i[1]);return(i,n=0)=>{const a=[],l=i.split(`
72
72
  `);for(let g=n;g<l.length;g++){const p=l[g];if(p.length>1024)continue;const _=fd.test(p)?p.replace(fd,"$1"):p;if(!_.match(/\S*Error: /)){for(const T of e){const k=T(_);if(k){a.push(k);break}}if(a.length>=dd)break}}return SS(a)}}function bS(t){return Array.isArray(t)?hd(...t):t}function SS(t){if(!t.length)return[];const e=t.slice(0,dd),i=e[e.length-1].function;i&&/sentryWrapped/.test(i)&&e.pop(),e.reverse();const n=e[e.length-1].function;return n&&/captureMessage|captureException/.test(n)&&e.pop(),e.map(a=>ti(fe({},a),{filename:a.filename||e[e.length-1].filename,function:a.function||"?"}))}const Pl="<anonymous>";function In(t){try{return!t||typeof t!="function"?Pl:t.name||Pl}catch(e){return Pl}}const wl=na();function gd(){if(!("fetch"in wl))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}function Cl(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function TS(){if(!gd())return!1;if(Cl(wl.fetch))return!0;let t=!1;const e=wl.document;if(e&&typeof e.createElement=="function")try{const i=e.createElement("iframe");i.hidden=!0,e.head.appendChild(i),i.contentWindow&&i.contentWindow.fetch&&(t=Cl(i.contentWindow.fetch)),e.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&ct.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return t}const to=na();function kS(){const t=to.chrome,e=t&&t.app&&t.app.runtime,i="history"in to&&!!to.history.pushState&&!!to.history.replaceState;return!e&&i}const li=na(),aa="__sentry_xhr_v2__",oa={},vd={};function ES(t){if(!vd[t])switch(vd[t]=!0,t){case"console":AS();break;case"dom":DS();break;case"xhr":wS();break;case"fetch":xS();break;case"history":CS();break;case"error":OS();break;case"unhandledrejection":BS();break;default:(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&ct.warn("unknown instrumentation type:",t);return}}function Rn(t,e){oa[t]=oa[t]||[],oa[t].push(e),ES(t)}function Rr(t,e){if(!(!t||!oa[t]))for(const i of oa[t]||[])try{i(e)}catch(n){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&ct.error(`Error while triggering instrumentation handler.
73
73
  Type: ${t}
74
74
  Name: ${In(i)}