@beyondwords/player 0.1.4 → 0.1.5

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
@@ -1,7 +1,7 @@
1
- var cm=Object.defineProperty,um=Object.defineProperties;var dm=Object.getOwnPropertyDescriptors;var _o=Object.getOwnPropertySymbols;var Fr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable;var Ho=(j,Be,je)=>Be in j?cm(j,Be,{enumerable:!0,configurable:!0,writable:!0,value:je}):j[Be]=je,Jt=(j,Be)=>{for(var je in Be||(Be={}))Fr.call(Be,je)&&Ho(j,je,Be[je]);if(_o)for(var je of _o(Be))qr.call(Be,je)&&Ho(j,je,Be[je]);return j},Ji=(j,Be)=>um(j,dm(Be));var Yo=(j,Be)=>{var je={};for(var Ot in j)Fr.call(j,Ot)&&Be.indexOf(Ot)<0&&(je[Ot]=j[Ot]);if(j!=null&&_o)for(var Ot of _o(j))Be.indexOf(Ot)<0&&qr.call(j,Ot)&&(je[Ot]=j[Ot]);return je};var Zo=(j,Be,je)=>(Ho(j,typeof Be!="symbol"?Be+"":Be,je),je),Ko=(j,Be,je)=>{if(!Be.has(j))throw TypeError("Cannot "+je)};var Ai=(j,Be,je)=>(Ko(j,Be,"read from private field"),je?je.call(j):Be.get(j)),Ve=(j,Be,je)=>{if(Be.has(j))throw TypeError("Cannot add the same private member more than once");Be instanceof WeakSet?Be.add(j):Be.set(j,je)},Hr=(j,Be,je,Ot)=>(Ko(j,Be,"write to private field"),Ot?Ot.call(j,je):Be.set(j,je),je);var M=(j,Be,je)=>(Ko(j,Be,"access private method"),je);var fi=(j,Be,je)=>new Promise((Ot,qn)=>{var Ne=hi=>{try{fe(je.next(hi))}catch(bi){qn(bi)}},Xi=hi=>{try{fe(je.throw(hi))}catch(bi){qn(bi)}},fe=hi=>hi.done?Ot(hi.value):Promise.resolve(hi.value).then(Ne,Xi);fe((je=je.apply(j,Be)).next())});/*! version:"0.1.4" */(function(j,Be){typeof exports=="object"&&typeof module!="undefined"?module.exports=Be():typeof define=="function"&&define.amd?define(Be):(j=typeof globalThis!="undefined"?globalThis:j||self,j.BeyondWords=Be())})(this,function(){var is,Jo,Ns,Yr,ns,Ds,Zr,Rs,Kr,ss,Us,Jr,Fs,Gr,os,qs,Xr,Hs,Qr,Ys,$r,Zs,ea,Ks,ta,ls,Go,Js,ia,Gs,na,vi,Gi,qi,Cn,oi,yi,Xs,sa,pn,gs,Hi,An,Qs,oa,rs,Xo,Oi,mn,as,Qo,Yi,Bn,Mt,Gt,Zi,In,Ei,yn,$s,la,eo,ra,Sn,fs,cs,$o,to,aa,io,ca,no,ua,so,da,ln,Rr;"use strict";function j(){}const Be=t=>t;function je(t,e){for(const i in e)t[i]=e[i];return t}function Ot(t){return t()}function qn(){return Object.create(null)}function Ne(t){t.forEach(Ot)}function Xi(t){return typeof t=="function"}function fe(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let hi;function bi(t,e){return t===e?!0:(hi||(hi=document.createElement("a")),hi.href=e,t===hi.href)}function ga(t){return Object.keys(t).length===0}function Vn(t,e,i,n){if(t){const s=el(t,e,i,n);return t[0](s)}}function el(t,e,i,n){return t[1]&&n?je(i.ctx.slice(),t[1](n(e))):i.ctx}function Wn(t,e,i,n){if(t[2]&&n){const s=t[2](n(i));if(e.dirty===void 0)return s;if(typeof s=="object"){const o=[],l=Math.max(e.dirty.length,s.length);for(let r=0;r<l;r+=1)o[r]=e.dirty[r]|s[r];return o}return e.dirty|s}return e.dirty}function jn(t,e,i,n,s,o){if(s){const l=el(e,i,n,o);t.p(l,s)}}function Mn(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 tl(t){return t==null?"":t}function il(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const nl=typeof window!="undefined";let fa=nl?()=>window.performance.now():()=>Date.now(),hs=nl?t=>requestAnimationFrame(t):j;const zn=new Set;function sl(t){zn.forEach(e=>{e.c(t)||(zn.delete(e),e.f())}),zn.size!==0&&hs(sl)}function ha(t){let e;return zn.size===0&&hs(sl),{promise:new Promise(i=>{zn.add(e={c:t,f:i})}),abort(){zn.delete(e)}}}const _a=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function f(t,e){t.appendChild(e)}function ol(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function ma(t){const e=m("style");return e.textContent="/* empty */",ya(ol(t),e),e.sheet}function ya(t,e){return f(t.head||t,e),e.sheet}function I(t,e,i){t.insertBefore(e,i||null)}function A(t){t.parentNode&&t.parentNode.removeChild(t)}function Qi(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function m(t){return document.createElement(t)}function be(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function $(t){return document.createTextNode(t)}function K(){return $(" ")}function $i(){return $("")}function L(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function we(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function ba(t){return Array.from(t.childNodes)}function ci(t,e){e=""+e,t.data!==e&&(t.data=e)}function E(t,e){t.value=e==null?"":e}function jt(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function Pe(t,e,i){for(let n=0;n<t.options.length;n+=1){const s=t.options[n];if(s.__value===e){s.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function yt(t){const e=t.querySelector(":checked");return e&&e.__value}let _s;function va(){if(_s===void 0){_s=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){_s=!0}}return _s}function ka(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=m("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 s=va();let o;return s?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",o=L(window,"message",l=>{l.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=L(n.contentWindow,"resize",e),e()}),f(t,n),()=>{(s||o&&n.contentWindow)&&o(),A(n)}}function re(t,e,i){t.classList.toggle(e,!!i)}function pa(t,e,{bubbles:i=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:i,cancelable:n})}const ms=new Map;let ys=0;function Sa(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function wa(t,e){const i={stylesheet:ma(e),rules:{}};return ms.set(t,i),i}function ll(t,e,i,n,s,o,l,r=0){const a=16.666/n;let u=`{
1
+ var cm=Object.defineProperty,um=Object.defineProperties;var dm=Object.getOwnPropertyDescriptors;var _o=Object.getOwnPropertySymbols;var Fr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable;var Ho=(j,Be,je)=>Be in j?cm(j,Be,{enumerable:!0,configurable:!0,writable:!0,value:je}):j[Be]=je,Jt=(j,Be)=>{for(var je in Be||(Be={}))Fr.call(Be,je)&&Ho(j,je,Be[je]);if(_o)for(var je of _o(Be))qr.call(Be,je)&&Ho(j,je,Be[je]);return j},Ji=(j,Be)=>um(j,dm(Be));var Yo=(j,Be)=>{var je={};for(var Ot in j)Fr.call(j,Ot)&&Be.indexOf(Ot)<0&&(je[Ot]=j[Ot]);if(j!=null&&_o)for(var Ot of _o(j))Be.indexOf(Ot)<0&&qr.call(j,Ot)&&(je[Ot]=j[Ot]);return je};var Zo=(j,Be,je)=>(Ho(j,typeof Be!="symbol"?Be+"":Be,je),je),Ko=(j,Be,je)=>{if(!Be.has(j))throw TypeError("Cannot "+je)};var Ai=(j,Be,je)=>(Ko(j,Be,"read from private field"),je?je.call(j):Be.get(j)),Ve=(j,Be,je)=>{if(Be.has(j))throw TypeError("Cannot add the same private member more than once");Be instanceof WeakSet?Be.add(j):Be.set(j,je)},Hr=(j,Be,je,Ot)=>(Ko(j,Be,"write to private field"),Ot?Ot.call(j,je):Be.set(j,je),je);var M=(j,Be,je)=>(Ko(j,Be,"access private method"),je);var fi=(j,Be,je)=>new Promise((Ot,qn)=>{var Ne=hi=>{try{fe(je.next(hi))}catch(bi){qn(bi)}},Xi=hi=>{try{fe(je.throw(hi))}catch(bi){qn(bi)}},fe=hi=>hi.done?Ot(hi.value):Promise.resolve(hi.value).then(Ne,Xi);fe((je=je.apply(j,Be)).next())});/*! version:"0.1.5" */(function(j,Be){typeof exports=="object"&&typeof module!="undefined"?module.exports=Be():typeof define=="function"&&define.amd?define(Be):(j=typeof globalThis!="undefined"?globalThis:j||self,j.BeyondWords=Be())})(this,function(){var is,Jo,Ns,Yr,ns,Ds,Zr,Rs,Kr,ss,Us,Jr,Fs,Gr,os,qs,Xr,Hs,Qr,Ys,$r,Zs,ea,Ks,ta,ls,Go,Js,ia,Gs,na,vi,Gi,qi,Cn,oi,yi,Xs,sa,pn,gs,Hi,An,Qs,oa,rs,Xo,Oi,mn,as,Qo,Yi,Bn,Mt,Gt,Zi,In,Ei,yn,$s,la,eo,ra,Sn,fs,cs,$o,to,aa,io,ca,no,ua,so,da,ln,Rr;"use strict";function j(){}const Be=t=>t;function je(t,e){for(const i in e)t[i]=e[i];return t}function Ot(t){return t()}function qn(){return Object.create(null)}function Ne(t){t.forEach(Ot)}function Xi(t){return typeof t=="function"}function fe(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let hi;function bi(t,e){return t===e?!0:(hi||(hi=document.createElement("a")),hi.href=e,t===hi.href)}function ga(t){return Object.keys(t).length===0}function Vn(t,e,i,n){if(t){const s=el(t,e,i,n);return t[0](s)}}function el(t,e,i,n){return t[1]&&n?je(i.ctx.slice(),t[1](n(e))):i.ctx}function Wn(t,e,i,n){if(t[2]&&n){const s=t[2](n(i));if(e.dirty===void 0)return s;if(typeof s=="object"){const o=[],l=Math.max(e.dirty.length,s.length);for(let r=0;r<l;r+=1)o[r]=e.dirty[r]|s[r];return o}return e.dirty|s}return e.dirty}function jn(t,e,i,n,s,o){if(s){const l=el(e,i,n,o);t.p(l,s)}}function Mn(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 tl(t){return t==null?"":t}function il(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const nl=typeof window!="undefined";let fa=nl?()=>window.performance.now():()=>Date.now(),hs=nl?t=>requestAnimationFrame(t):j;const zn=new Set;function sl(t){zn.forEach(e=>{e.c(t)||(zn.delete(e),e.f())}),zn.size!==0&&hs(sl)}function ha(t){let e;return zn.size===0&&hs(sl),{promise:new Promise(i=>{zn.add(e={c:t,f:i})}),abort(){zn.delete(e)}}}const _a=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function f(t,e){t.appendChild(e)}function ol(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function ma(t){const e=m("style");return e.textContent="/* empty */",ya(ol(t),e),e.sheet}function ya(t,e){return f(t.head||t,e),e.sheet}function I(t,e,i){t.insertBefore(e,i||null)}function A(t){t.parentNode&&t.parentNode.removeChild(t)}function Qi(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function m(t){return document.createElement(t)}function be(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function $(t){return document.createTextNode(t)}function K(){return $(" ")}function $i(){return $("")}function L(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function we(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function ba(t){return Array.from(t.childNodes)}function ci(t,e){e=""+e,t.data!==e&&(t.data=e)}function E(t,e){t.value=e==null?"":e}function jt(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function Pe(t,e,i){for(let n=0;n<t.options.length;n+=1){const s=t.options[n];if(s.__value===e){s.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function yt(t){const e=t.querySelector(":checked");return e&&e.__value}let _s;function va(){if(_s===void 0){_s=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){_s=!0}}return _s}function ka(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=m("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 s=va();let o;return s?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",o=L(window,"message",l=>{l.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=L(n.contentWindow,"resize",e),e()}),f(t,n),()=>{(s||o&&n.contentWindow)&&o(),A(n)}}function re(t,e,i){t.classList.toggle(e,!!i)}function pa(t,e,{bubbles:i=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:i,cancelable:n})}const ms=new Map;let ys=0;function Sa(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function wa(t,e){const i={stylesheet:ma(e),rules:{}};return ms.set(t,i),i}function ll(t,e,i,n,s,o,l,r=0){const a=16.666/n;let u=`{
2
2
  `;for(let p=0;p<=1;p+=a){const O=e+(i-e)*o(p);u+=p*100+`%{${l(O,1-O)}}
3
3
  `}const c=u+`100% {${l(i,1-i)}}
4
- }`,h=`__svelte_${Sa(c)}_${r}`,y=ol(t),{stylesheet:k,rules:_}=ms.get(y)||wa(y,t);_[h]||(_[h]=!0,k.insertRule(`@keyframes ${h} ${c}`,k.cssRules.length));const b=t.style.animation||"";return t.style.animation=`${b?`${b}, `:""}${h} ${n}ms linear ${s}ms 1 both`,ys+=1,h}function Pa(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),s=i.length-n.length;s&&(t.style.animation=n.join(", "),ys-=s,ys||Ta())}function Ta(){hs(()=>{ys||(ms.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&A(e)}),ms.clear())})}let Hn;function Yn(t){Hn=t}function rl(){if(!Hn)throw new Error("Function called outside component initialization");return Hn}function mo(t){rl().$$.on_mount.push(t)}function Ca(t){rl().$$.on_destroy.push(t)}const On=[],ie=[];let En=[];const yo=[],al=Promise.resolve();let bo=!1;function cl(){bo||(bo=!0,al.then(d))}function Aa(){return cl(),al}function Fe(t){En.push(t)}function me(t){yo.push(t)}const vo=new Set;let xn=0;function d(){if(xn!==0)return;const t=Hn;do{try{for(;xn<On.length;){const e=On[xn];xn++,Yn(e),Ba(e.$$)}}catch(e){throw On.length=0,xn=0,e}for(Yn(null),On.length=0,xn=0;ie.length;)ie.pop()();for(let e=0;e<En.length;e+=1){const i=En[e];vo.has(i)||(vo.add(i),i())}En.length=0}while(On.length);for(;yo.length;)yo.pop()();bo=!1,vo.clear(),Yn(t)}function Ba(t){if(t.fragment!==null){t.update(),Ne(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Fe)}}function Ia(t){const e=[],i=[];En.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),En=e}let Zn;function Va(){return Zn||(Zn=Promise.resolve(),Zn.then(()=>{Zn=null})),Zn}function ko(t,e,i){t.dispatchEvent(pa(`${e?"intro":"outro"}${i}`))}const bs=new Set;let Ni;function xe(){Ni={r:0,c:[],p:Ni}}function Le(){Ni.r||Ne(Ni.c),Ni=Ni.p}function P(t,e){t&&t.i&&(bs.delete(t),t.i(e))}function V(t,e,i,n){if(t&&t.o){if(bs.has(t))return;bs.add(t),Ni.c.push(()=>{bs.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Wa={duration:0};function ul(t,e,i,n){let o=e(t,i,{direction:"both"}),l=n?0:1,r=null,a=null,u=null,c;function h(){u&&Pa(t,u)}function y(_,b){const p=_.b-l;return b*=Math.abs(p),{a:l,b:_.b,d:p,duration:b,start:_.start,end:_.start+b,group:_.group}}function k(_){const{delay:b=0,duration:p=300,easing:O=Be,tick:z=j,css:de}=o||Wa,X={start:fa()+b,b:_};_||(X.group=Ni,Ni.r+=1),"inert"in t&&(_?c!==void 0&&(t.inert=c):(c=t.inert,t.inert=!0)),r||a?a=X:(de&&(h(),u=ll(t,l,_,p,b,O,de)),_&&z(0,1),r=y(X,p),Fe(()=>ko(t,_,"start")),ha(x=>{if(a&&x>a.start&&(r=y(a,p),a=null,ko(t,r.b,"start"),de&&(h(),u=ll(t,l,r.b,r.duration,0,O,o.css))),r){if(x>=r.end)z(l=r.b,1-l),ko(t,r.b,"end"),a||(r.b?h():--r.group.r||Ne(r.group.c)),r=null;else if(x>=r.start){const D=x-r.start;l=r.a+r.d*O(D/r.duration),z(l,1-l)}}return!!(r||a)}))}return{run(_){Xi(o)?Va().then(()=>{o=o({direction:_?"in":"out"}),k(_)}):k(_)},end(){h(),r=a=null}}}function Et(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function ja(t,e){V(t,1,1,()=>{e.delete(t.key)})}function Ma(t,e,i,n,s,o,l,r,a,u,c,h){let y=t.length,k=o.length,_=y;const b={};for(;_--;)b[t[_].key]=_;const p=[],O=new Map,z=new Map,de=[];for(_=k;_--;){const U=h(s,o,_),N=i(U);let J=l.get(N);J?n&&de.push(()=>J.p(U,e)):(J=u(N,U),J.c()),O.set(N,p[_]=J),N in b&&z.set(N,Math.abs(_-b[N]))}const X=new Set,x=new Set;function D(U){P(U,1),U.m(r,c),l.set(U.key,U),c=U.first,k--}for(;y&&k;){const U=p[k-1],N=t[y-1],J=U.key,ge=N.key;U===N?(c=U.first,y--,k--):O.has(ge)?!l.has(J)||X.has(J)?D(U):x.has(ge)?y--:z.get(J)>z.get(ge)?(x.add(J),D(U)):(X.add(ge),y--):(a(N,l),y--)}for(;y--;){const U=t[y];O.has(U.key)||a(U,l)}for(;k;)D(p[k-1]);return Ne(de),p}function ye(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ue(t){t&&t.c()}function ae(t,e,i){const{fragment:n,after_update:s}=t.$$;n&&n.m(e,i),Fe(()=>{const o=t.$$.on_mount.map(Ot).filter(Xi);t.$$.on_destroy?t.$$.on_destroy.push(...o):Ne(o),t.$$.on_mount=[]}),s.forEach(Fe)}function ce(t,e){const i=t.$$;i.fragment!==null&&(Ia(i.after_update),Ne(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function za(t,e){t.$$.dirty[0]===-1&&(On.push(t),cl(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ve(t,e,i,n,s,o,l,r=[-1]){const a=Hn;Yn(t);const u=t.$$={fragment:null,ctx:[],props:o,update:j,not_equal:s,bound:qn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:qn(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};l&&l(u.root);let c=!1;if(u.ctx=i?i(t,e.props||{},(h,y,...k)=>{const _=k.length?k[0]:y;return u.ctx&&s(u.ctx[h],u.ctx[h]=_)&&(!u.skip_bound&&u.bound[h]&&u.bound[h](_),c&&za(t,h)),y}):[],u.update(),c=!0,Ne(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const h=ba(e.target);u.fragment&&u.fragment.l(h),h.forEach(A)}else u.fragment&&u.fragment.c();e.intro&&P(t.$$.fragment),ae(t,e.target,e.anchor),d()}Yn(a)}class ke{constructor(){Zo(this,"$$");Zo(this,"$$set")}$destroy(){ce(this,1),this.$destroy=j}$on(e,i){if(!Xi(i))return j;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const s=n.indexOf(i);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!ga(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Oa="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Oa);const Ea="@beyondwords/player",vs="0.1.4",Xt=(t,e)=>{t=[t].flat().join(`
4
+ }`,h=`__svelte_${Sa(c)}_${r}`,y=ol(t),{stylesheet:k,rules:_}=ms.get(y)||wa(y,t);_[h]||(_[h]=!0,k.insertRule(`@keyframes ${h} ${c}`,k.cssRules.length));const b=t.style.animation||"";return t.style.animation=`${b?`${b}, `:""}${h} ${n}ms linear ${s}ms 1 both`,ys+=1,h}function Pa(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),s=i.length-n.length;s&&(t.style.animation=n.join(", "),ys-=s,ys||Ta())}function Ta(){hs(()=>{ys||(ms.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&A(e)}),ms.clear())})}let Hn;function Yn(t){Hn=t}function rl(){if(!Hn)throw new Error("Function called outside component initialization");return Hn}function mo(t){rl().$$.on_mount.push(t)}function Ca(t){rl().$$.on_destroy.push(t)}const On=[],ie=[];let En=[];const yo=[],al=Promise.resolve();let bo=!1;function cl(){bo||(bo=!0,al.then(d))}function Aa(){return cl(),al}function Fe(t){En.push(t)}function me(t){yo.push(t)}const vo=new Set;let xn=0;function d(){if(xn!==0)return;const t=Hn;do{try{for(;xn<On.length;){const e=On[xn];xn++,Yn(e),Ba(e.$$)}}catch(e){throw On.length=0,xn=0,e}for(Yn(null),On.length=0,xn=0;ie.length;)ie.pop()();for(let e=0;e<En.length;e+=1){const i=En[e];vo.has(i)||(vo.add(i),i())}En.length=0}while(On.length);for(;yo.length;)yo.pop()();bo=!1,vo.clear(),Yn(t)}function Ba(t){if(t.fragment!==null){t.update(),Ne(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Fe)}}function Ia(t){const e=[],i=[];En.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),En=e}let Zn;function Va(){return Zn||(Zn=Promise.resolve(),Zn.then(()=>{Zn=null})),Zn}function ko(t,e,i){t.dispatchEvent(pa(`${e?"intro":"outro"}${i}`))}const bs=new Set;let Ni;function xe(){Ni={r:0,c:[],p:Ni}}function Le(){Ni.r||Ne(Ni.c),Ni=Ni.p}function P(t,e){t&&t.i&&(bs.delete(t),t.i(e))}function V(t,e,i,n){if(t&&t.o){if(bs.has(t))return;bs.add(t),Ni.c.push(()=>{bs.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Wa={duration:0};function ul(t,e,i,n){let o=e(t,i,{direction:"both"}),l=n?0:1,r=null,a=null,u=null,c;function h(){u&&Pa(t,u)}function y(_,b){const p=_.b-l;return b*=Math.abs(p),{a:l,b:_.b,d:p,duration:b,start:_.start,end:_.start+b,group:_.group}}function k(_){const{delay:b=0,duration:p=300,easing:O=Be,tick:z=j,css:de}=o||Wa,X={start:fa()+b,b:_};_||(X.group=Ni,Ni.r+=1),"inert"in t&&(_?c!==void 0&&(t.inert=c):(c=t.inert,t.inert=!0)),r||a?a=X:(de&&(h(),u=ll(t,l,_,p,b,O,de)),_&&z(0,1),r=y(X,p),Fe(()=>ko(t,_,"start")),ha(x=>{if(a&&x>a.start&&(r=y(a,p),a=null,ko(t,r.b,"start"),de&&(h(),u=ll(t,l,r.b,r.duration,0,O,o.css))),r){if(x>=r.end)z(l=r.b,1-l),ko(t,r.b,"end"),a||(r.b?h():--r.group.r||Ne(r.group.c)),r=null;else if(x>=r.start){const D=x-r.start;l=r.a+r.d*O(D/r.duration),z(l,1-l)}}return!!(r||a)}))}return{run(_){Xi(o)?Va().then(()=>{o=o({direction:_?"in":"out"}),k(_)}):k(_)},end(){h(),r=a=null}}}function Et(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function ja(t,e){V(t,1,1,()=>{e.delete(t.key)})}function Ma(t,e,i,n,s,o,l,r,a,u,c,h){let y=t.length,k=o.length,_=y;const b={};for(;_--;)b[t[_].key]=_;const p=[],O=new Map,z=new Map,de=[];for(_=k;_--;){const U=h(s,o,_),N=i(U);let J=l.get(N);J?n&&de.push(()=>J.p(U,e)):(J=u(N,U),J.c()),O.set(N,p[_]=J),N in b&&z.set(N,Math.abs(_-b[N]))}const X=new Set,x=new Set;function D(U){P(U,1),U.m(r,c),l.set(U.key,U),c=U.first,k--}for(;y&&k;){const U=p[k-1],N=t[y-1],J=U.key,ge=N.key;U===N?(c=U.first,y--,k--):O.has(ge)?!l.has(J)||X.has(J)?D(U):x.has(ge)?y--:z.get(J)>z.get(ge)?(x.add(J),D(U)):(X.add(ge),y--):(a(N,l),y--)}for(;y--;){const U=t[y];O.has(U.key)||a(U,l)}for(;k;)D(p[k-1]);return Ne(de),p}function ye(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ue(t){t&&t.c()}function ae(t,e,i){const{fragment:n,after_update:s}=t.$$;n&&n.m(e,i),Fe(()=>{const o=t.$$.on_mount.map(Ot).filter(Xi);t.$$.on_destroy?t.$$.on_destroy.push(...o):Ne(o),t.$$.on_mount=[]}),s.forEach(Fe)}function ce(t,e){const i=t.$$;i.fragment!==null&&(Ia(i.after_update),Ne(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function za(t,e){t.$$.dirty[0]===-1&&(On.push(t),cl(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ve(t,e,i,n,s,o,l,r=[-1]){const a=Hn;Yn(t);const u=t.$$={fragment:null,ctx:[],props:o,update:j,not_equal:s,bound:qn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:qn(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};l&&l(u.root);let c=!1;if(u.ctx=i?i(t,e.props||{},(h,y,...k)=>{const _=k.length?k[0]:y;return u.ctx&&s(u.ctx[h],u.ctx[h]=_)&&(!u.skip_bound&&u.bound[h]&&u.bound[h](_),c&&za(t,h)),y}):[],u.update(),c=!0,Ne(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const h=ba(e.target);u.fragment&&u.fragment.l(h),h.forEach(A)}else u.fragment&&u.fragment.c();e.intro&&P(t.$$.fragment),ae(t,e.target,e.anchor),d()}Yn(a)}class ke{constructor(){Zo(this,"$$");Zo(this,"$$set")}$destroy(){ce(this,1),this.$destroy=j}$on(e,i){if(!Xi(i))return j;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const s=n.indexOf(i);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!ga(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Oa="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Oa);const Ea="@beyondwords/player",vs="0.1.5",Xt=(t,e)=>{t=[t].flat().join(`
5
5
  `);let i=`${Ea}:
6
6
 
7
7
  ${t}`;if(e){i+=`
@@ -52,6 +52,6 @@ This context may be helpful:
52
52
  `),ii=m("select"),un=m("option"),un.textContent="all",dn=m("option"),dn.textContent="body",gn=m("option"),gn.textContent="none",fn=m("option"),fn.textContent="all-none",hn=m("option"),hn.textContent="none-all",ro=K(),Pn=m("div"),ao=$(`segmentWidgetPosition:
53
53
  `),Ci=m("select");for(let g=0;g<12;g+=1)Tn[g].c();co=K(),Kt&&Kt.c(),us=K(),uo=m("br"),go=K(),mi.c(),C(i,"class","heading svelte-g76q0j"),u.__value="small",E(u,u.__value),c.__value="standard",E(c,c.__value),h.__value="large",E(h,h.__value),y.__value="video",E(y,y.__value),C(a,"tabindex",-1),C(a,"class","svelte-g76q0j"),t[6]===void 0&&Fe(()=>t[43].call(a)),C(l,"class","control svelte-g76q0j"),O.__value="stopped",E(O,O.__value),z.__value="playing",E(z,z.__value),de.__value="paused",E(de,de.__value),C(p,"tabindex",-1),C(p,"class","svelte-g76q0j"),t[20]===void 0&&Fe(()=>t[44].call(p)),C(_,"class","control svelte-g76q0j"),C(U,"tabindex",-1),C(U,"type","text"),C(U,"class","svelte-g76q0j"),C(x,"class","control svelte-g76q0j"),C(pe,"tabindex",-1),C(pe,"type","text"),C(pe,"class","svelte-g76q0j"),C(J,"class","control svelte-g76q0j"),w.__value="auto",E(w,w.__value),q.__value="segments",E(q,q.__value),se.__value="seconds",E(se,se.__value),te.__value="seconds-15",E(te,te.__value),B.__value="seconds-15-30",E(B,B.__value),F.__value="tracks",E(F,F.__value),C(v,"tabindex",-1),C(v,"class","svelte-g76q0j"),t[9]===void 0&&Fe(()=>t[47].call(v)),C(G,"class","control svelte-g76q0j"),Q.__value="auto",E(Q,Q.__value),_e.__value="show",E(_e,_e.__value),qe.__value="show-3",E(qe,qe.__value),He.__value="show-999",E(He,He.__value),tt.__value="hide",E(tt,tt.__value),C(Ce,"tabindex",-1),C(Ce,"class","svelte-g76q0j"),t[10]===void 0&&Fe(()=>t[48].call(Ce)),C(Se,"class","control svelte-g76q0j"),Ze.__value="auto",E(Ze,Ze.__value),Oe.__value="show",E(Oe,Oe.__value),Re.__value="hide",E(Re,Re.__value),C(Ie,"tabindex",-1),C(Ie,"class","svelte-g76q0j"),t[11]===void 0&&Fe(()=>t[49].call(Ie)),C(it,"class","control svelte-g76q0j"),Ae.__value=-1,E(Ae,Ae.__value),C(Ke,"tabindex",-1),C(Ke,"class","svelte-g76q0j"),t[15]===void 0&&Fe(()=>t[50].call(Ke)),C(ht,"class","control svelte-g76q0j"),R.__value="small",E(R,R.__value),Je.__value="standard",E(Je,Je.__value),Ee.__value="large",E(Ee,Ee.__value),pt.__value="video",E(pt,pt.__value),C(ze,"tabindex",-1),C(ze,"class","svelte-g76q0j"),t[22]===void 0&&Fe(()=>t[51].call(ze)),C(Qe,"class","control svelte-g76q0j"),Ge.__value="auto",E(Ge,Ge.__value),_t.__value="left",E(_t,_t.__value),et.__value="center",E(et,et.__value),At.__value="right",E(At,At.__value),C($e,"tabindex",-1),C($e,"class","svelte-g76q0j"),t[23]===void 0&&Fe(()=>t[52].call($e)),C(Ct,"class","control svelte-g76q0j"),Xe.__value="auto",E(Xe,Xe.__value),ut.__value="400px",E(ut,ut.__value),dt.__value="30rem",E(dt,dt.__value),H.__value="fit-content",E(H,H.__value),rt.__value="initial",E(rt,rt.__value),Ut.__value="0",E(Ut,Ut.__value),C(nt,"tabindex",-1),C(nt,"class","svelte-g76q0j"),t[24]===void 0&&Fe(()=>t[53].call(nt)),C(zt,"class","control svelte-g76q0j"),C(ne,"tabindex",-1),C(ne,"type","text"),C(ne,"class","svelte-g76q0j"),C(S,"class","control svelte-g76q0j"),C(at,"tabindex",-1),C(at,"type","text"),C(at,"class","svelte-g76q0j"),C(Zt,"class","control svelte-g76q0j"),C(Qt,"tabindex",-1),C(Qt,"type","text"),C(Qt,"class","svelte-g76q0j"),C(Ft,"class","control svelte-g76q0j"),C($t,"tabindex",-1),C($t,"type","text"),C($t,"class","svelte-g76q0j"),C(xi,"class","control svelte-g76q0j"),Pi.__value="all",E(Pi,Pi.__value),ei.__value="body",E(ei,ei.__value),gt.__value="none",E(gt,gt.__value),ti.__value="all-none",E(ti,ti.__value),ft.__value="none-all",E(ft,ft.__value),C(Wt,"tabindex",-1),C(Wt,"class","svelte-g76q0j"),t[31]===void 0&&Fe(()=>t[58].call(Wt)),C(Li,"class","control svelte-g76q0j"),le.__value="all",E(le,le.__value),qt.__value="body",E(qt,qt.__value),rn.__value="none",E(rn,rn.__value),an.__value="all-none",E(an,an.__value),cn.__value="none-all",E(cn,cn.__value),C(Z,"tabindex",-1),C(Z,"class","svelte-g76q0j"),t[32]===void 0&&Fe(()=>t[59].call(Z)),C(mt,"class","control svelte-g76q0j"),un.__value="all",E(un,un.__value),dn.__value="body",E(dn,dn.__value),gn.__value="none",E(gn,gn.__value),fn.__value="all-none",E(fn,fn.__value),hn.__value="none-all",E(hn,hn.__value),C(ii,"tabindex",-1),C(ii,"class","svelte-g76q0j"),t[33]===void 0&&Fe(()=>t[60].call(ii)),C(wn,"class","control svelte-g76q0j"),C(Ci,"tabindex",-1),C(Ci,"class","svelte-g76q0j"),t[34]===void 0&&Fe(()=>t[61].call(Ci)),C(Pn,"class","control svelte-g76q0j"),C(e,"class","control-panel")},m(g,st){I(g,e,st),f(e,i),f(e,n),f(e,s),f(e,o),f(e,l),f(l,r),f(l,a),f(a,u),f(a,c),f(a,h),f(a,y),Pe(a,t[6],!0),f(e,k),f(e,_),f(_,b),f(_,p),f(p,O),f(p,z),f(p,de),Pe(p,t[20],!0),f(e,X),f(e,x),f(x,D),f(x,U),E(U,t[7]),f(e,N),f(e,J),f(J,ge),f(J,pe),E(pe,t[8]),f(e,ee),f(e,G),f(G,Y),f(G,v),f(v,w),f(v,q),f(v,se),f(v,te),f(v,B),f(v,F),Pe(v,t[9],!0),f(e,Te),f(e,Se),f(Se,Ye),f(Se,Ce),f(Ce,Q),f(Ce,_e),f(Ce,qe),f(Ce,He),f(Ce,tt),Pe(Ce,t[10],!0),f(e,De),f(e,it),f(it,vt),f(it,Ie),f(Ie,Ze),f(Ie,Oe),f(Ie,Re),Pe(Ie,t[11],!0),f(e,kt),f(e,ht),f(ht,ct),f(ht,Ke),f(Ke,Ae);for(let wt=0;wt<Ht.length;wt+=1)Ht[wt]&&Ht[wt].m(Ke,null);Pe(Ke,t[15],!0),f(e,Ue),f(e,Qe),f(Qe,ot),f(Qe,ze),f(ze,R),f(ze,Je),f(ze,Ee),f(ze,pt),Pe(ze,t[22],!0),f(e,lt),f(e,Ct),f(Ct,St),f(Ct,$e),f($e,Ge),f($e,_t),f($e,et),f($e,At),Pe($e,t[23],!0),f(e,Bt),f(e,zt),f(zt,Vt),f(zt,nt),f(nt,Xe),f(nt,ut),f(nt,dt),f(nt,H),f(nt,rt),f(nt,Ut),Pe(nt,t[24],!0),f(e,oe),f(e,S),f(S,T),f(S,ne),E(ne,t[26]),f(e,ki),f(e,Zt),f(Zt,Ki),f(Zt,at),E(at,t[27]),f(e,li),f(e,Ft),f(Ft,pi),f(Ft,Qt),E(Qt,t[28]),f(e,Si),f(e,xi),f(xi,ri),f(xi,$t),E($t,t[29]),f(e,wi),f(e,Li),f(Li,ai),f(Li,Wt),f(Wt,Pi),f(Wt,ei),f(Wt,gt),f(Wt,ti),f(Wt,ft),Pe(Wt,t[31],!0),f(e,Ti),f(e,mt),f(mt,W),f(mt,Z),f(Z,le),f(Z,qt),f(Z,rn),f(Z,an),f(Z,cn),Pe(Z,t[32],!0),f(e,oo),f(e,wn),f(wn,lo),f(wn,ii),f(ii,un),f(ii,dn),f(ii,gn),f(ii,fn),f(ii,hn),Pe(ii,t[33],!0),f(e,ro),f(e,Pn),f(Pn,ao),f(Pn,Ci);for(let wt=0;wt<12;wt+=1)Tn[wt]&&Tn[wt].m(Ci,null);Pe(Ci,t[34],!0),f(e,co),Kt&&Kt.m(e,null),f(e,us),f(e,uo),f(e,go),mi.m(e,null),ds||(fo=[L(a,"change",t[43]),L(p,"change",t[44]),L(U,"input",t[45]),L(pe,"input",t[46]),L(v,"change",t[47]),L(Ce,"change",t[48]),L(Ie,"change",t[49]),L(Ke,"change",t[50]),L(ze,"change",t[51]),L($e,"change",t[52]),L(nt,"change",t[53]),L(ne,"input",t[54]),L(at,"input",t[55]),L(Qt,"input",t[56]),L($t,"input",t[57]),L(Wt,"change",t[58]),L(Z,"change",t[59]),L(ii,"change",t[60]),L(Ci,"change",t[61])],ds=!0)},p(g,st){if(st[0]&64&&Pe(a,g[6]),st[0]&1048576&&Pe(p,g[20]),st[0]&128&&U.value!==g[7]&&E(U,g[7]),st[0]&256&&pe.value!==g[8]&&E(pe,g[8]),st[0]&512&&Pe(v,g[9]),st[0]&1024&&Pe(Ce,g[10]),st[0]&2048&&Pe(Ie,g[11]),st[1]&1024){_n=Et(g[41]);let wt;for(wt=0;wt<_n.length;wt+=1){const Ur=$l(g,_n,wt);Ht[wt]?Ht[wt].p(Ur,st):(Ht[wt]=er(Ur),Ht[wt].c(),Ht[wt].m(Ke,null))}for(;wt<Ht.length;wt+=1)Ht[wt].d(1);Ht.length=_n.length}st[0]&32768&&Pe(Ke,g[15]),st[0]&4194304&&Pe(ze,g[22]),st[0]&8388608&&Pe($e,g[23]),st[0]&16777216&&Pe(nt,g[24]),st[0]&67108864&&ne.value!==g[26]&&E(ne,g[26]),st[0]&134217728&&at.value!==g[27]&&E(at,g[27]),st[0]&268435456&&Qt.value!==g[28]&&E(Qt,g[28]),st[0]&536870912&&$t.value!==g[29]&&E($t,g[29]),st[1]&1&&Pe(Wt,g[31]),st[1]&2&&Pe(Z,g[32]),st[1]&4&&Pe(ii,g[33]),st[1]&8&&Pe(Ci,g[34]),g[42]?Kt?Kt.p(g,st):(Kt=tr(g),Kt.c(),Kt.m(e,us)):Kt&&(Kt.d(1),Kt=null),Fn===(Fn=ho(g))&&mi?mi.p(g,st):(mi.d(1),mi=Fn(g),mi&&(mi.c(),mi.m(e,null)))},i:j,o:j,d(g){g&&A(e),Qi(Ht,g),Qi(Tn,g),Kt&&Kt.d(),mi.d(),ds=!1,Ne(fo)}}}function d_(t,e,i){import(BeyondWords.Player.styleSrc );let{projectId:n}=e,{contentId:s}=e,{playlistId:o}=e,{sourceId:l}=e,{sourceUrl:r}=e,{showUserInterface:a}=e,{playerStyle:u}=e,{playerTitle:c}=e,{callToAction:h}=e,{skipButtonStyle:y}=e,{playlistStyle:k}=e,{playlistToggle:_}=e,{mediaSession:b}=e,{content:p}=e,{contentIndex:O}=e,{introsOutros:z}=e,{introsOutrosIndex:de}=e,{adverts:X}=e,{advertIndex:x}=e,{persistentAdImage:D}=e,{persistentIndex:U}=e,{duration:N}=e,{currentTime:J}=e,{playbackState:ge}=e,{playbackRate:pe}=e,{widgetStyle:ee}=e,{widgetPosition:G}=e,{widgetWidth:Y}=e,{widgetTarget:v}=e,{textColor:w}=e,{backgroundColor:q}=e,{iconColor:se}=e,{highlightColor:te}=e,{logoIconEnabled:B}=e,{highlightSections:F}=e,{clickableSections:Te}=e,{segmentWidgetSections:Se}=e,{segmentWidgetPosition:Ye}=e,{advertConsent:Ce}=e,{analyticsConsent:Q}=e,{analyticsCustomUrl:_e}=e,{analyticsTag:qe}=e,He=!1;function tt(){u=yt(this),i(6,u)}function De(){ge=yt(this),i(20,ge)}function it(){c=this.value,i(7,c)}function vt(){h=this.value,i(8,h)}function Ie(){y=yt(this),i(9,y)}function Ze(){k=yt(this),i(10,k)}function Oe(){_=yt(this),i(11,_)}function Re(){x=yt(this),i(15,x)}function kt(){ee=yt(this),i(22,ee)}function ht(){G=yt(this),i(23,G)}function ct(){Y=yt(this),i(24,Y)}function Ke(){w=this.value,i(26,w)}function Ae(){q=this.value,i(27,q)}function Ue(){se=this.value,i(28,se)}function Qe(){te=this.value,i(29,te)}function ot(){F=yt(this),i(31,F)}function ze(){Te=yt(this),i(32,Te)}function R(){Se=yt(this),i(33,Se)}function Je(){Ye=yt(this),i(34,Ye)}function Ee(){n=this.value,i(0,n)}function pt(){s=this.value,i(1,s)}function lt(){o=this.value,i(2,o)}function Ct(){l=this.value,i(3,l)}function St(){r=this.value,i(4,r)}function $e(){a=yt(this),i(5,a)}function Ge(){b=yt(this),i(12,b)}function _t(){O=yt(this),i(13,O)}function et(){de=yt(this),i(14,de)}function At(){D=yt(this),i(16,D)}function Bt(){U=yt(this),i(17,U)}function zt(){N=this.value,i(18,N)}function Vt(){J=this.value,i(19,J)}function nt(){pe=this.value,i(21,pe)}function Xe(){v=this.value,i(25,v)}function ut(){B=yt(this),i(30,B)}function dt(){Ce=yt(this),i(35,Ce)}function H(){Q=yt(this),i(36,Q)}function rt(){_e=this.value,i(37,_e)}function Ut(){qe=this.value,i(38,qe)}const oe=()=>i(42,He=!1),S=()=>i(42,He=!0);return t.$$set=T=>{"projectId"in T&&i(0,n=T.projectId),"contentId"in T&&i(1,s=T.contentId),"playlistId"in T&&i(2,o=T.playlistId),"sourceId"in T&&i(3,l=T.sourceId),"sourceUrl"in T&&i(4,r=T.sourceUrl),"showUserInterface"in T&&i(5,a=T.showUserInterface),"playerStyle"in T&&i(6,u=T.playerStyle),"playerTitle"in T&&i(7,c=T.playerTitle),"callToAction"in T&&i(8,h=T.callToAction),"skipButtonStyle"in T&&i(9,y=T.skipButtonStyle),"playlistStyle"in T&&i(10,k=T.playlistStyle),"playlistToggle"in T&&i(11,_=T.playlistToggle),"mediaSession"in T&&i(12,b=T.mediaSession),"content"in T&&i(39,p=T.content),"contentIndex"in T&&i(13,O=T.contentIndex),"introsOutros"in T&&i(40,z=T.introsOutros),"introsOutrosIndex"in T&&i(14,de=T.introsOutrosIndex),"adverts"in T&&i(41,X=T.adverts),"advertIndex"in T&&i(15,x=T.advertIndex),"persistentAdImage"in T&&i(16,D=T.persistentAdImage),"persistentIndex"in T&&i(17,U=T.persistentIndex),"duration"in T&&i(18,N=T.duration),"currentTime"in T&&i(19,J=T.currentTime),"playbackState"in T&&i(20,ge=T.playbackState),"playbackRate"in T&&i(21,pe=T.playbackRate),"widgetStyle"in T&&i(22,ee=T.widgetStyle),"widgetPosition"in T&&i(23,G=T.widgetPosition),"widgetWidth"in T&&i(24,Y=T.widgetWidth),"widgetTarget"in T&&i(25,v=T.widgetTarget),"textColor"in T&&i(26,w=T.textColor),"backgroundColor"in T&&i(27,q=T.backgroundColor),"iconColor"in T&&i(28,se=T.iconColor),"highlightColor"in T&&i(29,te=T.highlightColor),"logoIconEnabled"in T&&i(30,B=T.logoIconEnabled),"highlightSections"in T&&i(31,F=T.highlightSections),"clickableSections"in T&&i(32,Te=T.clickableSections),"segmentWidgetSections"in T&&i(33,Se=T.segmentWidgetSections),"segmentWidgetPosition"in T&&i(34,Ye=T.segmentWidgetPosition),"advertConsent"in T&&i(35,Ce=T.advertConsent),"analyticsConsent"in T&&i(36,Q=T.analyticsConsent),"analyticsCustomUrl"in T&&i(37,_e=T.analyticsCustomUrl),"analyticsTag"in T&&i(38,qe=T.analyticsTag)},[n,s,o,l,r,a,u,c,h,y,k,_,b,O,de,x,D,U,N,J,ge,pe,ee,G,Y,v,w,q,se,te,B,F,Te,Se,Ye,Ce,Q,_e,qe,p,z,X,He,tt,De,it,vt,Ie,Ze,Oe,Re,kt,ht,ct,Ke,Ae,Ue,Qe,ot,ze,R,Je,Ee,pt,lt,Ct,St,$e,Ge,_t,et,At,Bt,zt,Vt,nt,Xe,ut,dt,H,rt,Ut,oe,S]}class g_ extends ke{constructor(e){super(),ve(this,e,d_,u_,fe,{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}),d()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),d()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),d()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),d()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),d()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),d()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),d()}get playerTitle(){return this.$$.ctx[7]}set playerTitle(e){this.$$set({playerTitle:e}),d()}get callToAction(){return this.$$.ctx[8]}set callToAction(e){this.$$set({callToAction:e}),d()}get skipButtonStyle(){return this.$$.ctx[9]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get playlistStyle(){return this.$$.ctx[10]}set playlistStyle(e){this.$$set({playlistStyle:e}),d()}get playlistToggle(){return this.$$.ctx[11]}set playlistToggle(e){this.$$set({playlistToggle:e}),d()}get mediaSession(){return this.$$.ctx[12]}set mediaSession(e){this.$$set({mediaSession:e}),d()}get content(){return this.$$.ctx[39]}set content(e){this.$$set({content:e}),d()}get contentIndex(){return this.$$.ctx[13]}set contentIndex(e){this.$$set({contentIndex:e}),d()}get introsOutros(){return this.$$.ctx[40]}set introsOutros(e){this.$$set({introsOutros:e}),d()}get introsOutrosIndex(){return this.$$.ctx[14]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),d()}get adverts(){return this.$$.ctx[41]}set adverts(e){this.$$set({adverts:e}),d()}get advertIndex(){return this.$$.ctx[15]}set advertIndex(e){this.$$set({advertIndex:e}),d()}get persistentAdImage(){return this.$$.ctx[16]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),d()}get persistentIndex(){return this.$$.ctx[17]}set persistentIndex(e){this.$$set({persistentIndex:e}),d()}get duration(){return this.$$.ctx[18]}set duration(e){this.$$set({duration:e}),d()}get currentTime(){return this.$$.ctx[19]}set currentTime(e){this.$$set({currentTime:e}),d()}get playbackState(){return this.$$.ctx[20]}set playbackState(e){this.$$set({playbackState:e}),d()}get playbackRate(){return this.$$.ctx[21]}set playbackRate(e){this.$$set({playbackRate:e}),d()}get widgetStyle(){return this.$$.ctx[22]}set widgetStyle(e){this.$$set({widgetStyle:e}),d()}get widgetPosition(){return this.$$.ctx[23]}set widgetPosition(e){this.$$set({widgetPosition:e}),d()}get widgetWidth(){return this.$$.ctx[24]}set widgetWidth(e){this.$$set({widgetWidth:e}),d()}get widgetTarget(){return this.$$.ctx[25]}set widgetTarget(e){this.$$set({widgetTarget:e}),d()}get textColor(){return this.$$.ctx[26]}set textColor(e){this.$$set({textColor:e}),d()}get backgroundColor(){return this.$$.ctx[27]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[28]}set iconColor(e){this.$$set({iconColor:e}),d()}get highlightColor(){return this.$$.ctx[29]}set highlightColor(e){this.$$set({highlightColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[30]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[31]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[32]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[33]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[34]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get advertConsent(){return this.$$.ctx[35]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[36]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[37]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsTag(){return this.$$.ctx[38]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const f_=(t,e,i)=>{m_(t);const n=new Image;return n.setAttribute("crossorigin","anonymous"),new Promise((s,o)=>{n.addEventListener("load",h_(n,e,i,s,o)),n.addEventListener("error",o),n.src=t})},h_=(t,e,i,n,s)=>()=>{const o=document.createElement("canvas"),l=o.getContext("2d");o.width=e,o.height=i,l.drawImage(t,0,0,e,i),o.toBlob(__(t,e,i,n,s))},Un={},__=(t,e,i,n,s)=>o=>{var r;o||s();const l=URL.createObjectURL(o);Un[r=t.src]||(Un[r]=[]),Un[t.src].push(l),n({src:l,sizes:`${e}x${i}`,type:"image/png"})},m_=t=>{Object.keys(Un).filter(n=>n!==t).map(n=>Un[n]).flat().forEach(n=>URL.revokeObjectURL(n))},y_=(t,e,i)=>fi(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"}}),b_=(t,e,i)=>jt(t,e,i,1),v_=(t,e,i)=>we(t,e,e==="style"?p_(i):i),k_=/;(?!([^()]*\([^()]*\))*[^()]*\))/,p_=t=>t.split(k_).filter(e=>e).map(e=>e+" !important").join(";");function or(t,e,i){const n=t.slice();return n[39]=e[i],n[40]=e,n[41]=i,n}function lr(t){let e,i,n,s=t[41],o;i=new Wl({props:{fill:t[2],color:t[1],scale:t[39]/18,zoom:.65}});const l=()=>t[36](e,s),r=()=>t[36](null,s);return{c(){e=m("div"),ue(i.$$.fragment),n=K(),b_(e,"display","none")},m(a,u){I(a,e,u),ae(i,e,null),f(e,n),l(),o=!0},p(a,u){t=a;const c={};u[0]&4&&(c.fill=t[2]),u[0]&2&&(c.color=t[1]),i.$set(c),s!==t[41]&&(r(),s=t[41],l())},i(a){o||(P(i.$$.fragment,a),o=!0)},o(a){V(i.$$.fragment,a),o=!1},d(a){a&&A(e),ce(i),r()}}}function S_(t){let e,i,n=Et(t[3]),s=[];for(let l=0;l<n.length;l+=1)s[l]=lr(or(t,n,l));const o=l=>V(s[l],1,1,()=>{s[l]=null});return{c(){e=m("div");for(let l=0;l<s.length;l+=1)s[l].c();v_(e,"class","media-session")},m(l,r){I(l,e,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(e,null);i=!0},p(l,r){if(r[0]&15){n=Et(l[3]);let a;for(a=0;a<n.length;a+=1){const u=or(l,n,a);s[a]?(s[a].p(u,r),P(s[a],1)):(s[a]=lr(u),s[a].c(),P(s[a],1),s[a].m(e,null))}for(xe(),a=n.length;a<s.length;a+=1)o(a);Le()}},i(l){if(!i){for(let r=0;r<n.length;r+=1)P(s[r]);i=!0}},o(l){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)V(s[r]);i=!1},d(l){l&&A(e),Qi(s,l)}}}function w_(t,e,i){let n,s,o,l,r,a,u,c,h,y,k,_,b,p,O,z,de,X,x,D,U;const N=[96,128,192,256,384,512],J=["hangup","nextslide","nexttrack","pause","play","previousslide","previoustrack","seekbackward","seekforward","seekto","skipad","stop","togglecamera","togglemicrophone"];let{content:ge=[]}=e,{contentIndex:pe=0}=e,{activeAdvert:ee=void 0}=e,{persistentAdvert:G=void 0}=e,{duration:Y=0}=e,{playbackState:v="stopped"}=e,{skipButtonStyle:w="auto"}=e,{backgroundColor:q="#f5f5f5"}=e,{iconColor:se="black"}=e,{onEvent:te=()=>{}}=e,B=[],F=new Set,Te=N.map(()=>{}),Se=N.map(()=>{});const Ye=()=>i(15,F=F.add(p));function Ce(Q,_e){ie[Q?"unshift":"push"](()=>{Te[_e]=Q,i(0,Te)})}return t.$$set=Q=>{"content"in Q&&i(4,ge=Q.content),"contentIndex"in Q&&i(5,pe=Q.contentIndex),"activeAdvert"in Q&&i(6,ee=Q.activeAdvert),"persistentAdvert"in Q&&i(7,G=Q.persistentAdvert),"duration"in Q&&i(8,Y=Q.duration),"playbackState"in Q&&i(9,v=Q.playbackState),"skipButtonStyle"in Q&&i(10,w=Q.skipButtonStyle),"backgroundColor"in Q&&i(11,q=Q.backgroundColor),"iconColor"in Q&&i(12,se=Q.iconColor),"onEvent"in Q&&i(13,te=Q.onEvent)},t.$$.update=()=>{t.$$.dirty[0]&512&&i(33,n=v==="stopped"),t.$$.dirty[0]&64|t.$$.dirty[1]&4&&i(34,s=ee&&!n),t.$$.dirty[0]&16&&i(35,o=ge.length>1),t.$$.dirty[0]&48&&i(27,l=ge[pe]),t.$$.dirty[0]&1024|t.$$.dirty[1]&16&&i(19,r=w==="auto"?o?"tracks":"segments":w),t.$$.dirty[0]&524288&&i(21,a=parseFloat(r.split("-")[1]||10)),t.$$.dirty[0]&2621440&&i(18,u=parseFloat(r.split("-")[2]||a)),t.$$.dirty[0]&524288|t.$$.dirty[1]&8&&i(20,c=!s&&r!=="tracks"),t.$$.dirty[0]&524288|t.$$.dirty[1]&8&&i(17,h=!s&&r==="tracks"),t.$$.dirty[1]&8&&i(22,y=!s),t.$$.dirty[0]&2112|t.$$.dirty[1]&8&&i(2,k=s&&(ee==null?void 0:ee.backgroundColor)||q),t.$$.dirty[0]&4160|t.$$.dirty[1]&8&&i(1,_=s&&(ee==null?void 0:ee.iconColor)||se),t.$$.dirty[0]&7&&i(16,Se=N.map((Q,_e)=>Aa().then(()=>Te[_e]))),t.$$.dirty[0]&134217920|t.$$.dirty[1]&12&&i(32,b=s&&ee.imageUrl||!n&&(G==null?void 0:G.imageUrl)||(l==null?void 0:l.imageUrl)),t.$$.dirty[0]&32768|t.$$.dirty[1]&2&&i(28,p=F.has(b)?null:b),t.$$.dirty[0]&268435456&&i(31,O=p?N.map(Q=>f_(p,Q,Q)):[]),t.$$.dirty[0]&268435456&&i(30,z=p?[{src:p,sizes:"any"}]:[]),t.$$.dirty[0]&268500992&&i(29,de=p?[]:N.map((Q,_e)=>y_(Se[_e],Q,Q))),t.$$.dirty[0]&1610612736|t.$$.dirty[1]&1&&i(26,X=Promise.all([...O,...z,...de])),t.$$.dirty[0]&134217728&&i(25,x=(l==null?void 0:l.title)||""),t.$$.dirty[0]&67108864&&X.then(Q=>i(14,B=Q)).catch(Ye),t.$$.dirty[0]&58736640&&(navigator.mediaSession.metadata=new MediaMetadata({title:x,artist:D,album:U,artwork:B})),t.$$.dirty[0]&8192&&navigator.mediaSession.setActionHandler("play",()=>{te(he({type:"PressedPlay",description:"The play button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&8192&&navigator.mediaSession.setActionHandler("pause",()=>{te(he({type:"PressedPause",description:"The pause button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&4202752&&navigator.mediaSession.setActionHandler("seekto",y?({seekTime:Q})=>{te(he({type:"ScrubbedProgressBar",description:"The user pressed on the progress bar then dragged.",initiatedBy:"media-session-api",ratio:Math.max(0,Math.min(1,Q/Y))}))}:null),t.$$.dirty[0]&3678208&&navigator.mediaSession.setActionHandler("seekbackward",c?({seekOffset:Q})=>{te(he(r==="seconds"||Q?{type:"PressedSeekBack",description:"The seek backward button was pressed.",initiatedBy:"media-session-api",seconds:Q||a}:{type:"PressedPrevSegment",description:"The previous segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&1843200&&navigator.mediaSession.setActionHandler("seekforward",c?({seekOffset:Q})=>{te(he(r==="seconds"||Q?{type:"PressedSeekAhead",description:"The seek ahead button was pressed.",initiatedBy:"media-session-api",seconds:Q||u}:{type:"PressedNextSegment",description:"The next segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&139264&&navigator.mediaSession.setActionHandler("previoustrack",h?()=>{te(he({type:"PressedPrevTrack",description:"The previous track button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&139264&&navigator.mediaSession.setActionHandler("nexttrack",h?()=>{te(he({type:"PressedNextTrack",description:"The next track button was pressed.",initiatedBy:"media-session-api"}))}:null)},i(24,D=""),i(23,U=""),navigator.mediaSession.setByPlayer=!0,J.forEach(Q=>{try{navigator.mediaSession.setActionHandler(Q,null)}catch(_e){}}),[Te,_,k,N,ge,pe,ee,G,Y,v,w,q,se,te,B,F,Se,h,u,r,c,a,y,U,D,x,X,l,p,de,z,O,b,n,s,o,Ce]}class P_ extends ke{constructor(e){super(),ve(this,e,w_,S_,fe,{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}),d()}get contentIndex(){return this.$$.ctx[5]}set contentIndex(e){this.$$set({contentIndex:e}),d()}get activeAdvert(){return this.$$.ctx[6]}set activeAdvert(e){this.$$set({activeAdvert:e}),d()}get persistentAdvert(){return this.$$.ctx[7]}set persistentAdvert(e){this.$$set({persistentAdvert:e}),d()}get duration(){return this.$$.ctx[8]}set duration(e){this.$$set({duration:e}),d()}get playbackState(){return this.$$.ctx[9]}set playbackState(e){this.$$set({playbackState:e}),d()}get skipButtonStyle(){return this.$$.ctx[10]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get backgroundColor(){return this.$$.ctx[11]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[12]}set iconColor(e){this.$$set({iconColor:e}),d()}get onEvent(){return this.$$.ctx[13]}set onEvent(e){this.$$set({onEvent:e}),d()}}const rr=(t,e,i)=>we(t,e,e==="style"?C_(i):i),T_=/;(?!([^()]*\([^()]*\))*[^()]*\))/,C_=t=>t.split(T_).filter(e=>e).map(e=>e+" !important").join(";");function ar(t){let e,i,n,s;return{c(){e=m("script"),n=K(),s=m("script"),s.textContent=`window.dataLayer = window.dataLayer || [];
54
54
  function gtag() { dataLayer.push(arguments); }
55
- gtag("js", new Date());`,e.async=!0,bi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+t[0])||rr(e,"src",i)},m(o,l){I(o,e,l),I(o,n,l),I(o,s,l)},p(o,l){l&1&&!bi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+o[0])&&rr(e,"src",i)},d(o){o&&(A(e),A(n),A(s))}}}function A_(t){let e,i=!t[1]&&ar(t);return{c(){i&&i.c(),e=$i()},m(n,s){i&&i.m(document.head,null),f(document.head,e)},p(n,[s]){n[1]?i&&(i.d(1),i=null):i?i.p(n,s):(i=ar(n),i.c(),i.m(e.parentNode,e))},i:j,o:j,d(n){i&&i.d(n),A(e)}}}function B_(t,e,i){let n,{analyticsTag:s}=e;return t.$$set=o=>{"analyticsTag"in o&&i(0,s=o.analyticsTag)},i(1,n=window.gtag),[s,n]}class I_ extends ke{constructor(e){super(),ve(this,e,B_,A_,fe,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const H2="";class V_ extends ke{constructor(e){super(),ve(this,e,null,null,fe,{})}}class Oo{constructor(e,i){Ve(this,is);Ve(this,Ns);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var o;(o=this.consumers)[e]||(o[e]=[]);const s=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(s&&M(this,is,Jo).call(this,n,s.args))&&(s&&this.onDeselected(e,...s.args),this.onSelected(e,...n))}removeInterest(e,i){var l;(l=this.consumers)[e]||(l[e]=[]);const n=this.consumers[e].slice(-1)[0];if(M(this,Ns,Yr).call(this,this.consumers[e],r=>r.consumerId===i),!(n&&i===n.consumerId))return;const o=this.consumers[e].slice(-1)[0];o&&M(this,is,Jo).call(this,n.args,o.args)||(this.onDeselected(e,...n.args),o&&this.onSelected(e,...o.args))}}is=new WeakSet,Jo=function(e,i){return e.length===i.length&&e.every((n,s)=>n===i[s])},Ns=new WeakSet,Yr=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};const $n=(t,e,i)=>{let[n,s]=i.split("-");n||(n="none"),s||(s=n);const o=t==="current"?n:s;return o==="all"||o==="body"&&(e==null?void 0:e.section)==="body"},on="data-beyondwords-marker",cr=t=>["beyondwords-highlight","bwp",`marker-${t}`],Ri=class Ri{update(e,i,n,s){const o=$n(e,i,n),l=this[`prev${e}`],r=o?i==null?void 0:i.marker:null;r&&Ai(Ri,ns).addInterest(r,this,s),l&&Ai(Ri,ns).removeInterest(l,this),this[`prev${e}`]=r}};ns=new WeakMap,Ds=new WeakSet,Zr=function(e,i){const n=document.querySelectorAll(`[${on}="${e}"]`);for(const s of n){const o=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,null,!1);let l;for(;l=o.nextNode();){if(/^\s*$/.test(l.nodeValue))continue;l.parentNode.nodeName.toLowerCase()==="a"&&(l=l.parentNode);const u=document.createElement("mark");u.classList.add(...cr(e)),u.style.background=i,l.parentNode.insertBefore(u,l),u.appendChild(l)}}},Rs=new WeakSet,Kr=function(e){const i=document.querySelectorAll(`[${on}="${e}"]`);for(const n of i){const s=n.querySelectorAll(`mark.${cr(e)}`);for(const o of s)for(const l of o.childNodes)o.parentNode.insertBefore(l,o),o.remove()}},Ve(Ri,Ds),Ve(Ri,Rs),Ve(Ri,ns,new Oo(M(Ri,Ds,Zr),M(Ri,Rs,Kr)));let Eo=Ri;const ur=["beyondwords-clickable","bwp"],Ui=class Ui{update(e,i){const n=$n("hovered",e,i),s=this.previous,o=n?e==null?void 0:e.marker:null;o&&Ai(Ui,ss).addInterest(o,this),s&&Ai(Ui,ss).removeInterest(s,this),this.previous=o}};ss=new WeakMap,Us=new WeakSet,Jr=function(e){const i=document.querySelectorAll(`[${on}="${e}"]`);for(const n of i)n.classList.add(...ur)},Fs=new WeakSet,Gr=function(e){const i=document.querySelectorAll(`[${on}="${e}"]`);for(const n of i)dr(n,ur)},Ve(Ui,Us),Ve(Ui,Fs),Ve(Ui,ss,new Oo(M(Ui,Us,Jr),M(Ui,Fs,Gr)));let xo=Ui;const dr=(t,e)=>{if(!t)return;const s=[...t.classList].filter(o=>!e.includes(o)).some(o=>o.startsWith("beyondwords-"))?e.filter(o=>o!=="bwp"):e;t.classList.remove(...s)},gr=(t,e,i)=>["beyondwords-widget","bwp",`marker-${t}`,`position-${e}`,`for-${i}-player`],fr=["beyondwords-relative","bwp"],Fi=class Fi{constructor(e){this.onUpdate=e,this.containers=[]}update(e,i,n,s){const o=i.includes("all")||i.includes("body"),l=this.previous,r=(e==null?void 0:e.marker)||o&&(l==null?void 0:l.marker);r&&Ai(Fi,os).addInterest(r,this,this,n,s),l&&Ai(Fi,os).removeInterest(l,this),this.previous=r}reset(){this.update(null,"none")}};os=new WeakMap,qs=new WeakSet,Xr=function(e,i,n,s){const o=document.querySelector(`[${on}="${e}"]`),l=document.createElement("div");["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(n)&&o.classList.add(...fr),l.classList.add(...gr(e,n,s)),["11-oclock","12-oclock","1-oclock"].includes(n)?o.insertBefore(l,o.firstChild):o.appendChild(l),i.containers.push(l),i.onUpdate(i.containers)},Hs=new WeakSet,Qr=function(e,i,n,s){const o=gr(e,n,s);for(let l=0;l<i.containers.length;l+=1){if(!o.every(u=>i.containers[l].classList.contains(u)))continue;const a=i.containers[l].parentNode;dr(a,fr),i.containers[l].remove(),i.containers.splice(l,1),l-=1}i.onUpdate(i.containers)},Ve(Fi,qs),Ve(Fi,Hs),Ve(Fi,os,new Oo(M(Fi,qs,Xr),M(Fi,Hs,Qr)));let Lo=Fi;const W_=()=>he({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),vn=(i,...n)=>fi(this,[i,...n],function*(t,e={}){const s=yield fetch(t,e).catch(()=>{}),o=yield s==null?void 0:s.json().catch(()=>{});return(s==null?void 0:s.status)!==200&&Xt(`Failed to fetch ${t}`,Ji(Jt({},e),{responseStatus:s==null?void 0:s.status,responseJson:o})),o}),j_=(t,e)=>vn(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class M_{constructor(e,i,n){Ve(this,Ys);this.baseUrl=M(this,Ys,$r).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return fi(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield vn(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return fi(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,s="actioncable-v1-json";this.webSocket=new WebSocket(n,s),this.webSocket.onmessage=o=>e(JSON.parse(o.data)),this.webSocket.onerror=i,yield new Promise(o=>this.webSocket.onopen=o)})}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)}}Ys=new WeakSet,$r=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let kn;const z_=(t,e,i,n)=>fi(this,null,function*(){!t||!e||!i||(kn==null||kn.destroy(),kn=new M_(t,e,i),yield kn.getWebSocketToken(),yield kn.establishConnection(O_(n),L_),yield kn.subscribeToStatusChanges())}),O_=t=>e=>{var s,o;((o=(s=e==null?void 0:e.message)==null?void 0:s.result)==null?void 0:o.action)==="podcast_state_updated"&&E_(e,t),e.type==="reject_subscription"&&x_(e)},E_=(t,e)=>{const i=t.message.result;e(he({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}))},x_=t=>{Xt("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},L_=t=>{Xt("Unexpected WebSocket error.",{error:t})},hr=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},Os=t=>{const i=Object.keys(t.$$.props).filter(n=>!N_.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},N_=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),_r=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const s of i){const o=t[s],l=e[s];o!==l&&(n[s]={previousValue:o,currentValue:l})}return n};let es=-1;const mr=[],D_=(t,e,i)=>fi(this,null,function*(){yield hr(()=>e.player);const n=e.player,s=R_(n.contentIndex,i,t);s>es&&U_(n,es,s,t),s<es&&F_(n,es,s),es=s}),R_=(t,e,i)=>{const n=i.findIndex(o=>o[0]===t&&o[1]>e||o[0]>t);return n===-1?i.length-1:n-1},U_=(t,e,i,n)=>{for(let s=e+1;s<=i;s+=1){const o=Os(t);n[s][2](t);const l=Os(t),r=_r(o,l);mr.push(r)}},F_=(t,e,i)=>{for(let n=e;n>i;n-=1){const s=mr.pop();for(const[o,l]of Object.entries(s))t[o]=l.previousValue}},q_=t=>t?H_(t)?{newTarget:Z_(t),showUserInterface:!0}:typeof t=="string"?{newTarget:No(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:Y_(),showUserInterface:!1},H_=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",Y_=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},Z_=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},No=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&Xt(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&Xt(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]};function yr(t,e,i){const n=t.slice();return n[143]=e[i],n}function br(t){let e,i,n={onEvent:t[56],playerStyle:t[62],callToAction:t[22],skipButtonStyle:t[23],playlistStyle:t[24],playlistToggle:t[25],downloadFormats:t[47],playerTitle:t[21],content:t[48],contentIndex:t[27],duration:t[29],currentTime:t[10],playbackState:t[30],playbackRate:t[31],activeAdvert:t[59],persistentAdvert:t[66],textColor:t[34],backgroundColor:t[35],iconColor:t[36],videoTextColor:t[51],videoBackgroundColor:t[52],videoIconColor:t[53],logoIconEnabled:t[37],videoIsBehind:t[65]};return e=new Mo({props:n}),t[97](e),{c(){ue(e.$$.fragment)},m(s,o){ae(e,s,o),i=!0},p(s,o){const l={};o[2]&1&&(l.playerStyle=s[62]),o[0]&4194304&&(l.callToAction=s[22]),o[0]&8388608&&(l.skipButtonStyle=s[23]),o[0]&16777216&&(l.playlistStyle=s[24]),o[0]&33554432&&(l.playlistToggle=s[25]),o[1]&65536&&(l.downloadFormats=s[47]),o[0]&2097152&&(l.playerTitle=s[21]),o[1]&131072&&(l.content=s[48]),o[0]&134217728&&(l.contentIndex=s[27]),o[0]&536870912&&(l.duration=s[29]),o[0]&1024&&(l.currentTime=s[10]),o[0]&1073741824&&(l.playbackState=s[30]),o[1]&1&&(l.playbackRate=s[31]),o[1]&268435456&&(l.activeAdvert=s[59]),o[2]&16&&(l.persistentAdvert=s[66]),o[1]&8&&(l.textColor=s[34]),o[1]&16&&(l.backgroundColor=s[35]),o[1]&32&&(l.iconColor=s[36]),o[1]&1048576&&(l.videoTextColor=s[51]),o[1]&2097152&&(l.videoBackgroundColor=s[52]),o[1]&4194304&&(l.videoIconColor=s[53]),o[1]&64&&(l.logoIconEnabled=s[37]),o[2]&8&&(l.videoIsBehind=s[65]),e.$set(l)},i(s){i||(P(e.$$.fragment,s),i=!0)},o(s){V(e.$$.fragment,s),i=!1},d(s){t[97](null),ce(e,s)}}}function vr(t){let e,i;return e=new zo({props:{root:t[12],$$slots:{default:[K_]},$$scope:{ctx:t}}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[0]&4096&&(o.root=n[12]),s[0]&1759517696|s[1]&1349722239|s[2]&16|s[4]&4194304&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function K_(t){let e,i,n={onEvent:t[56],playerStyle:t[11],callToAction:t[22],skipButtonStyle:t[23],playlistStyle:"hide",playlistToggle:"hide",downloadFormats:t[47],playerTitle:t[21],fixedPosition:!t[12]&&t[32],fixedWidth:t[33],content:t[48],contentIndex:t[27],duration:t[29],currentTime:t[10],playbackState:t[30],playbackRate:t[31],activeAdvert:t[59],persistentAdvert:t[66],textColor:t[34],backgroundColor:t[35],iconColor:t[36],videoTextColor:t[51],videoBackgroundColor:t[52],videoIconColor:t[53],logoIconEnabled:t[37],videoIsBehind:t[61]};return e=new Mo({props:n}),t[98](e),{c(){ue(e.$$.fragment)},m(s,o){ae(e,s,o),i=!0},p(s,o){const l={};o[0]&2048&&(l.playerStyle=s[11]),o[0]&4194304&&(l.callToAction=s[22]),o[0]&8388608&&(l.skipButtonStyle=s[23]),o[1]&65536&&(l.downloadFormats=s[47]),o[0]&2097152&&(l.playerTitle=s[21]),o[0]&4096|o[1]&2&&(l.fixedPosition=!s[12]&&s[32]),o[1]&4&&(l.fixedWidth=s[33]),o[1]&131072&&(l.content=s[48]),o[0]&134217728&&(l.contentIndex=s[27]),o[0]&536870912&&(l.duration=s[29]),o[0]&1024&&(l.currentTime=s[10]),o[0]&1073741824&&(l.playbackState=s[30]),o[1]&1&&(l.playbackRate=s[31]),o[1]&268435456&&(l.activeAdvert=s[59]),o[2]&16&&(l.persistentAdvert=s[66]),o[1]&8&&(l.textColor=s[34]),o[1]&16&&(l.backgroundColor=s[35]),o[1]&32&&(l.iconColor=s[36]),o[1]&1048576&&(l.videoTextColor=s[51]),o[1]&2097152&&(l.videoBackgroundColor=s[52]),o[1]&4194304&&(l.videoIconColor=s[53]),o[1]&64&&(l.logoIconEnabled=s[37]),o[1]&1073741824&&(l.videoIsBehind=s[61]),e.$set(l)},i(s){i||(P(e.$$.fragment,s),i=!0)},o(s){V(e.$$.fragment,s),i=!1},d(s){t[98](null),ce(e,s)}}}function J_(t){let e,i;return e=new Mo({props:{onEvent:t[99],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[48],contentIndex:t[27],duration:t[29],currentTime:t[63]?t[10]:t[57].startTime,playbackState:t[63]?t[30]:"paused",activeAdvert:t[59],persistentAdvert:t[66],textColor:t[34],backgroundColor:t[35],iconColor:t[36],videoTextColor:t[51],videoBackgroundColor:t[52],videoIconColor:t[53]}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[1]&603979776&&(o.onEvent=n[99]),s[1]&131072&&(o.content=n[48]),s[0]&134217728&&(o.contentIndex=n[27]),s[0]&536870912&&(o.duration=n[29]),s[0]&1024|s[1]&67108864|s[2]&2&&(o.currentTime=n[63]?n[10]:n[57].startTime),s[0]&1073741824|s[2]&2&&(o.playbackState=n[63]?n[30]:"paused"),s[1]&268435456&&(o.activeAdvert=n[59]),s[2]&16&&(o.persistentAdvert=n[66]),s[1]&8&&(o.textColor=n[34]),s[1]&16&&(o.backgroundColor=n[35]),s[1]&32&&(o.iconColor=n[36]),s[1]&1048576&&(o.videoTextColor=n[51]),s[1]&2097152&&(o.videoBackgroundColor=n[52]),s[1]&4194304&&(o.videoIconColor=n[53]),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function kr(t,e){let i,n,s;return n=new zo({props:{root:e[143],$$slots:{default:[J_]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=$i(),ue(n.$$.fragment),this.first=i},m(o,l){I(o,i,l),ae(n,o,l),s=!0},p(o,l){e=o;const r={};l[1]&32768&&(r.root=e[143]),l[0]&1744831488|l[1]&879886392|l[2]&18|l[4]&4194304&&(r.$$scope={dirty:l,ctx:e}),n.$set(r)},i(o){s||(P(n.$$.fragment,o),s=!0)},o(o){V(n.$$.fragment,o),s=!1},d(o){o&&A(i),ce(n,o)}}}function pr(t){let e,i;return e=new zo({props:{root:t[20],$$slots:{default:[G_]},$$scope:{ctx:t}}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[0]&1048576&&(o.root=n[20]),s[0]&2146435071|s[1]&919551|s[4]&4194304&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function G_(t){let e,i,n,s,o,l,r,a,u,c,h,y,k,_,b,p,O,z,de,X,x,D,U,N,J,ge,pe,ee,G,Y,v,w,q,se,te,B,F,Te,Se,Ye,Ce,Q,_e;function qe(S){t[100](S)}function He(S){t[101](S)}function tt(S){t[102](S)}function De(S){t[103](S)}function it(S){t[104](S)}function vt(S){t[105](S)}function Ie(S){t[106](S)}function Ze(S){t[107](S)}function Oe(S){t[108](S)}function Re(S){t[109](S)}function kt(S){t[110](S)}function ht(S){t[111](S)}function ct(S){t[112](S)}function Ke(S){t[113](S)}function Ae(S){t[114](S)}function Ue(S){t[115](S)}function Qe(S){t[116](S)}function ot(S){t[117](S)}function ze(S){t[118](S)}function R(S){t[119](S)}function Je(S){t[120](S)}function Ee(S){t[121](S)}function pt(S){t[122](S)}function lt(S){t[123](S)}function Ct(S){t[124](S)}function St(S){t[125](S)}function $e(S){t[126](S)}function Ge(S){t[127](S)}function _t(S){t[128](S)}function et(S){t[129](S)}function At(S){t[130](S)}function Bt(S){t[131](S)}function zt(S){t[132](S)}function Vt(S){t[133](S)}function nt(S){t[134](S)}function Xe(S){t[135](S)}function ut(S){t[136](S)}function dt(S){t[137](S)}function H(S){t[138](S)}function rt(S){t[139](S)}function Ut(S){t[140](S)}let oe={content:t[48],introsOutros:t[49],adverts:t[50]};return t[0]!==void 0&&(oe.projectId=t[0]),t[1]!==void 0&&(oe.contentId=t[1]),t[2]!==void 0&&(oe.playlistId=t[2]),t[3]!==void 0&&(oe.sourceId=t[3]),t[4]!==void 0&&(oe.sourceUrl=t[4]),t[5]!==void 0&&(oe.showUserInterface=t[5]),t[6]!==void 0&&(oe.playerStyle=t[6]),t[21]!==void 0&&(oe.playerTitle=t[21]),t[22]!==void 0&&(oe.callToAction=t[22]),t[23]!==void 0&&(oe.skipButtonStyle=t[23]),t[24]!==void 0&&(oe.playlistStyle=t[24]),t[25]!==void 0&&(oe.playlistToggle=t[25]),t[26]!==void 0&&(oe.mediaSession=t[26]),t[27]!==void 0&&(oe.contentIndex=t[27]),t[7]!==void 0&&(oe.introsOutrosIndex=t[7]),t[8]!==void 0&&(oe.advertIndex=t[8]),t[28]!==void 0&&(oe.persistentAdImage=t[28]),t[9]!==void 0&&(oe.persistentIndex=t[9]),t[29]!==void 0&&(oe.duration=t[29]),t[10]!==void 0&&(oe.currentTime=t[10]),t[30]!==void 0&&(oe.playbackState=t[30]),t[31]!==void 0&&(oe.playbackRate=t[31]),t[11]!==void 0&&(oe.widgetStyle=t[11]),t[32]!==void 0&&(oe.widgetPosition=t[32]),t[33]!==void 0&&(oe.widgetWidth=t[33]),t[12]!==void 0&&(oe.widgetTarget=t[12]),t[34]!==void 0&&(oe.textColor=t[34]),t[35]!==void 0&&(oe.backgroundColor=t[35]),t[36]!==void 0&&(oe.iconColor=t[36]),t[13]!==void 0&&(oe.highlightColor=t[13]),t[37]!==void 0&&(oe.logoIconEnabled=t[37]),t[14]!==void 0&&(oe.highlightSections=t[14]),t[15]!==void 0&&(oe.clickableSections=t[15]),t[16]!==void 0&&(oe.segmentWidgetSections=t[16]),t[17]!==void 0&&(oe.segmentWidgetPosition=t[17]),t[18]!==void 0&&(oe.currentSegment=t[18]),t[19]!==void 0&&(oe.hoveredSegment=t[19]),t[38]!==void 0&&(oe.advertConsent=t[38]),t[39]!==void 0&&(oe.analyticsConsent=t[39]),t[40]!==void 0&&(oe.analyticsCustomUrl=t[40]),t[41]!==void 0&&(oe.analyticsTag=t[41]),e=new g_({props:oe}),ie.push(()=>ye(e,"projectId",qe)),ie.push(()=>ye(e,"contentId",He)),ie.push(()=>ye(e,"playlistId",tt)),ie.push(()=>ye(e,"sourceId",De)),ie.push(()=>ye(e,"sourceUrl",it)),ie.push(()=>ye(e,"showUserInterface",vt)),ie.push(()=>ye(e,"playerStyle",Ie)),ie.push(()=>ye(e,"playerTitle",Ze)),ie.push(()=>ye(e,"callToAction",Oe)),ie.push(()=>ye(e,"skipButtonStyle",Re)),ie.push(()=>ye(e,"playlistStyle",kt)),ie.push(()=>ye(e,"playlistToggle",ht)),ie.push(()=>ye(e,"mediaSession",ct)),ie.push(()=>ye(e,"contentIndex",Ke)),ie.push(()=>ye(e,"introsOutrosIndex",Ae)),ie.push(()=>ye(e,"advertIndex",Ue)),ie.push(()=>ye(e,"persistentAdImage",Qe)),ie.push(()=>ye(e,"persistentIndex",ot)),ie.push(()=>ye(e,"duration",ze)),ie.push(()=>ye(e,"currentTime",R)),ie.push(()=>ye(e,"playbackState",Je)),ie.push(()=>ye(e,"playbackRate",Ee)),ie.push(()=>ye(e,"widgetStyle",pt)),ie.push(()=>ye(e,"widgetPosition",lt)),ie.push(()=>ye(e,"widgetWidth",Ct)),ie.push(()=>ye(e,"widgetTarget",St)),ie.push(()=>ye(e,"textColor",$e)),ie.push(()=>ye(e,"backgroundColor",Ge)),ie.push(()=>ye(e,"iconColor",_t)),ie.push(()=>ye(e,"highlightColor",et)),ie.push(()=>ye(e,"logoIconEnabled",At)),ie.push(()=>ye(e,"highlightSections",Bt)),ie.push(()=>ye(e,"clickableSections",zt)),ie.push(()=>ye(e,"segmentWidgetSections",Vt)),ie.push(()=>ye(e,"segmentWidgetPosition",nt)),ie.push(()=>ye(e,"currentSegment",Xe)),ie.push(()=>ye(e,"hoveredSegment",ut)),ie.push(()=>ye(e,"advertConsent",dt)),ie.push(()=>ye(e,"analyticsConsent",H)),ie.push(()=>ye(e,"analyticsCustomUrl",rt)),ie.push(()=>ye(e,"analyticsTag",Ut)),{c(){ue(e.$$.fragment)},m(S,T){ae(e,S,T),_e=!0},p(S,T){const ne={};T[1]&131072&&(ne.content=S[48]),T[1]&262144&&(ne.introsOutros=S[49]),T[1]&524288&&(ne.adverts=S[50]),!i&&T[0]&1&&(i=!0,ne.projectId=S[0],me(()=>i=!1)),!n&&T[0]&2&&(n=!0,ne.contentId=S[1],me(()=>n=!1)),!s&&T[0]&4&&(s=!0,ne.playlistId=S[2],me(()=>s=!1)),!o&&T[0]&8&&(o=!0,ne.sourceId=S[3],me(()=>o=!1)),!l&&T[0]&16&&(l=!0,ne.sourceUrl=S[4],me(()=>l=!1)),!r&&T[0]&32&&(r=!0,ne.showUserInterface=S[5],me(()=>r=!1)),!a&&T[0]&64&&(a=!0,ne.playerStyle=S[6],me(()=>a=!1)),!u&&T[0]&2097152&&(u=!0,ne.playerTitle=S[21],me(()=>u=!1)),!c&&T[0]&4194304&&(c=!0,ne.callToAction=S[22],me(()=>c=!1)),!h&&T[0]&8388608&&(h=!0,ne.skipButtonStyle=S[23],me(()=>h=!1)),!y&&T[0]&16777216&&(y=!0,ne.playlistStyle=S[24],me(()=>y=!1)),!k&&T[0]&33554432&&(k=!0,ne.playlistToggle=S[25],me(()=>k=!1)),!_&&T[0]&67108864&&(_=!0,ne.mediaSession=S[26],me(()=>_=!1)),!b&&T[0]&134217728&&(b=!0,ne.contentIndex=S[27],me(()=>b=!1)),!p&&T[0]&128&&(p=!0,ne.introsOutrosIndex=S[7],me(()=>p=!1)),!O&&T[0]&256&&(O=!0,ne.advertIndex=S[8],me(()=>O=!1)),!z&&T[0]&268435456&&(z=!0,ne.persistentAdImage=S[28],me(()=>z=!1)),!de&&T[0]&512&&(de=!0,ne.persistentIndex=S[9],me(()=>de=!1)),!X&&T[0]&536870912&&(X=!0,ne.duration=S[29],me(()=>X=!1)),!x&&T[0]&1024&&(x=!0,ne.currentTime=S[10],me(()=>x=!1)),!D&&T[0]&1073741824&&(D=!0,ne.playbackState=S[30],me(()=>D=!1)),!U&&T[1]&1&&(U=!0,ne.playbackRate=S[31],me(()=>U=!1)),!N&&T[0]&2048&&(N=!0,ne.widgetStyle=S[11],me(()=>N=!1)),!J&&T[1]&2&&(J=!0,ne.widgetPosition=S[32],me(()=>J=!1)),!ge&&T[1]&4&&(ge=!0,ne.widgetWidth=S[33],me(()=>ge=!1)),!pe&&T[0]&4096&&(pe=!0,ne.widgetTarget=S[12],me(()=>pe=!1)),!ee&&T[1]&8&&(ee=!0,ne.textColor=S[34],me(()=>ee=!1)),!G&&T[1]&16&&(G=!0,ne.backgroundColor=S[35],me(()=>G=!1)),!Y&&T[1]&32&&(Y=!0,ne.iconColor=S[36],me(()=>Y=!1)),!v&&T[0]&8192&&(v=!0,ne.highlightColor=S[13],me(()=>v=!1)),!w&&T[1]&64&&(w=!0,ne.logoIconEnabled=S[37],me(()=>w=!1)),!q&&T[0]&16384&&(q=!0,ne.highlightSections=S[14],me(()=>q=!1)),!se&&T[0]&32768&&(se=!0,ne.clickableSections=S[15],me(()=>se=!1)),!te&&T[0]&65536&&(te=!0,ne.segmentWidgetSections=S[16],me(()=>te=!1)),!B&&T[0]&131072&&(B=!0,ne.segmentWidgetPosition=S[17],me(()=>B=!1)),!F&&T[0]&262144&&(F=!0,ne.currentSegment=S[18],me(()=>F=!1)),!Te&&T[0]&524288&&(Te=!0,ne.hoveredSegment=S[19],me(()=>Te=!1)),!Se&&T[1]&128&&(Se=!0,ne.advertConsent=S[38],me(()=>Se=!1)),!Ye&&T[1]&256&&(Ye=!0,ne.analyticsConsent=S[39],me(()=>Ye=!1)),!Ce&&T[1]&512&&(Ce=!0,ne.analyticsCustomUrl=S[40],me(()=>Ce=!1)),!Q&&T[1]&1024&&(Q=!0,ne.analyticsTag=S[41],me(()=>Q=!1)),e.$set(ne)},i(S){_e||(P(e.$$.fragment,S),_e=!0)},o(S){V(e.$$.fragment,S),_e=!1},d(S){ce(e,S)}}}function Sr(t){let e,i;return e=new P_({props:{onEvent:t[56],content:t[48],contentIndex:t[27],activeAdvert:t[59],persistentAdvert:t[66],duration:t[29],playbackState:t[30],skipButtonStyle:t[23],backgroundColor:t[35],iconColor:t[36]}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[1]&131072&&(o.content=n[48]),s[0]&134217728&&(o.contentIndex=n[27]),s[1]&268435456&&(o.activeAdvert=n[59]),s[2]&16&&(o.persistentAdvert=n[66]),s[0]&536870912&&(o.duration=n[29]),s[0]&1073741824&&(o.playbackState=n[30]),s[0]&8388608&&(o.skipButtonStyle=n[23]),s[1]&16&&(o.backgroundColor=n[35]),s[1]&32&&(o.iconColor=n[36]),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function wr(t){let e,i;return e=new I_({props:{analyticsTag:t[41]}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[1]&1024&&(o.analyticsTag=n[41]),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function X_(t){let e,i,n,s,o,l,r,a,u,c=[],h=new Map,y,k,_,b,p,O;function z(v){t[92](v)}function de(v){t[93](v)}function X(v){t[94](v)}function x(v){t[95](v)}function D(v){t[96](v)}let U={onEvent:t[56],content:t[48],contentIndex:t[27],introOrOutro:t[58],activeAdvert:t[59],advertConsent:t[38],videoBehindWidget:t[61],videoBehindStatic:t[65],videoMightBeShown:t[64],widgetPosition:t[32],widgetWidth:t[33]};t[30]!==void 0&&(U.playbackState=t[30]),t[29]!==void 0&&(U.duration=t[29]),t[10]!==void 0&&(U.currentTime=t[10]),t[31]!==void 0&&(U.playbackRate=t[31]),t[45]!==void 0&&(U.prevPercentage=t[45]),e=new kd({props:U}),t[91](e),ie.push(()=>ye(e,"playbackState",z)),ie.push(()=>ye(e,"duration",de)),ie.push(()=>ye(e,"currentTime",X)),ie.push(()=>ye(e,"playbackRate",x)),ie.push(()=>ye(e,"prevPercentage",D));let N=t[5]&&br(t),J=(t[54]||t[12])&&vr(t),ge=Et(t[46]);const pe=v=>v[143];for(let v=0;v<ge.length;v+=1){let w=yr(t,ge,v),q=pe(w);h.set(q,c[v]=kr(q,w))}let ee=t[20]&&pr(t),G=t[55]&&Sr(t),Y=t[41]&&wr(t);return p=new V_({}),{c(){ue(e.$$.fragment),r=K(),N&&N.c(),a=K(),J&&J.c(),u=K();for(let v=0;v<c.length;v+=1)c[v].c();y=K(),ee&&ee.c(),k=K(),G&&G.c(),_=K(),Y&&Y.c(),b=K(),ue(p.$$.fragment)},m(v,w){ae(e,v,w),I(v,r,w),N&&N.m(v,w),I(v,a,w),J&&J.m(v,w),I(v,u,w);for(let q=0;q<c.length;q+=1)c[q]&&c[q].m(v,w);I(v,y,w),ee&&ee.m(v,w),I(v,k,w),G&&G.m(v,w),I(v,_,w),Y&&Y.m(v,w),I(v,b,w),ae(p,v,w),O=!0},p(v,w){const q={};w[1]&131072&&(q.content=v[48]),w[0]&134217728&&(q.contentIndex=v[27]),w[1]&134217728&&(q.introOrOutro=v[58]),w[1]&268435456&&(q.activeAdvert=v[59]),w[1]&128&&(q.advertConsent=v[38]),w[1]&1073741824&&(q.videoBehindWidget=v[61]),w[2]&8&&(q.videoBehindStatic=v[65]),w[2]&4&&(q.videoMightBeShown=v[64]),w[1]&2&&(q.widgetPosition=v[32]),w[1]&4&&(q.widgetWidth=v[33]),!i&&w[0]&1073741824&&(i=!0,q.playbackState=v[30],me(()=>i=!1)),!n&&w[0]&536870912&&(n=!0,q.duration=v[29],me(()=>n=!1)),!s&&w[0]&1024&&(s=!0,q.currentTime=v[10],me(()=>s=!1)),!o&&w[1]&1&&(o=!0,q.playbackRate=v[31],me(()=>o=!1)),!l&&w[1]&16384&&(l=!0,q.prevPercentage=v[45],me(()=>l=!1)),e.$set(q),v[5]?N?(N.p(v,w),w[0]&32&&P(N,1)):(N=br(v),N.c(),P(N,1),N.m(a.parentNode,a)):N&&(xe(),V(N,1,1,()=>{N=null}),Le()),v[54]||v[12]?J?(J.p(v,w),w[0]&4096|w[1]&8388608&&P(J,1)):(J=vr(v),J.c(),P(J,1),J.m(u.parentNode,u)):J&&(xe(),V(J,1,1,()=>{J=null}),Le()),w[0]&1744831488|w[1]&913473592|w[2]&18&&(ge=Et(v[46]),xe(),c=Ma(c,w,pe,1,v,ge,h,y.parentNode,ja,kr,y,yr),Le()),v[20]?ee?(ee.p(v,w),w[0]&1048576&&P(ee,1)):(ee=pr(v),ee.c(),P(ee,1),ee.m(k.parentNode,k)):ee&&(xe(),V(ee,1,1,()=>{ee=null}),Le()),v[55]?G?(G.p(v,w),w[1]&16777216&&P(G,1)):(G=Sr(v),G.c(),P(G,1),G.m(_.parentNode,_)):G&&(xe(),V(G,1,1,()=>{G=null}),Le()),v[41]?Y?(Y.p(v,w),w[1]&1024&&P(Y,1)):(Y=wr(v),Y.c(),P(Y,1),Y.m(b.parentNode,b)):Y&&(xe(),V(Y,1,1,()=>{Y=null}),Le())},i(v){if(!O){P(e.$$.fragment,v),P(N),P(J);for(let w=0;w<ge.length;w+=1)P(c[w]);P(ee),P(G),P(Y),P(p.$$.fragment,v),O=!0}},o(v){V(e.$$.fragment,v),V(N),V(J);for(let w=0;w<c.length;w+=1)V(c[w]);V(ee),V(G),V(Y),V(p.$$.fragment,v),O=!1},d(v){v&&(A(r),A(a),A(u),A(y),A(k),A(_),A(b)),t[91](null),ce(e,v),N&&N.d(v),J&&J.d(v);for(let w=0;w<c.length;w+=1)c[w].d(v);ee&&ee.d(v),G&&G.d(v),Y&&Y.d(v),ce(p,v)}}}function Q_(t,e,i){let n,s,o,l,r,a,u,c,h,y,k,_,b,p,{playerApiUrl:O="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:z=void 0}=e,{contentId:de=void 0}=e,{playlistId:X=void 0}=e,{sourceId:x=void 0}=e,{sourceUrl:D=void 0}=e,{playlist:U=[]}=e,{showUserInterface:N=!0}=e,{playerStyle:J="standard"}=e,{playerTitle:ge=void 0}=e,{callToAction:pe=void 0}=e,{skipButtonStyle:ee="auto"}=e,{playlistStyle:G="auto-5-4"}=e,{playlistToggle:Y="auto"}=e,{downloadFormats:v=[]}=e,{mediaSession:w="auto"}=e,{content:q=[]}=e,{contentIndex:se=0}=e,{introsOutros:te=[]}=e,{introsOutrosIndex:B=-1}=e,{adverts:F=[]}=e,{advertIndex:Te=-1}=e,{persistentAdImage:Se=!1}=e,{persistentIndex:Ye=-1}=e,{duration:Ce=0}=e,{currentTime:Q=0}=e,{playbackState:_e="stopped"}=e,{playbackRate:qe=1}=e,{playbackRates:He=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3]}=e,{widgetStyle:tt="standard"}=e,{widgetPosition:De="auto"}=e,{widgetWidth:it="auto"}=e,{widgetTarget:vt=void 0}=e,{textColor:Ie="#111"}=e,{backgroundColor:Ze="#f5f5f5"}=e,{iconColor:Oe="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:Re="#eee"}=e,{videoTextColor:kt="white"}=e,{videoBackgroundColor:ht="black"}=e,{videoIconColor:ct="white"}=e,{logoIconEnabled:Ke=!0}=e,{highlightSections:Ae="all"}=e,{clickableSections:Ue="all"}=e,{segmentWidgetSections:Qe="body"}=e,{segmentWidgetPosition:ot="7-oclock"}=e,{currentSegment:ze=void 0}=e,{hoveredSegment:R=void 0}=e,{loadedMedia:Je=void 0}=e,{advertConsent:Ee="personalized"}=e,{analyticsConsent:pt="allowed"}=e,{analyticsCustomUrl:lt=void 0}=e,{analyticsTag:Ct=void 0}=e,{writeToken:St=void 0}=e,{captureErrors:$e=!0}=e,{onError:Ge=()=>{}}=e,{transitions:_t=[]}=e,{controlPanel:et=void 0}=e;const At=(...g)=>rt.addEventListener(...g),Bt=(...g)=>rt.removeEventListener(...g);let{initialProps:zt={}}=e,{showBottomWidget:Vt=!1}=e,{showMediaSession:nt=!1}=e,{isFullScreen:Xe=!1}=e,{mediaElement:ut=void 0}=e,{userInterface:dt=void 0}=e,{widgetInterface:H=void 0}=e,{controller:rt=void 0}=e,{analyticsUrl:Ut=void 0}=e,{analyticsId:oe=void 0}=e,{listenSessionId:S=void 0}=e,{sessionCreatedAt:T=void 0}=e,{isNewListen:ne=!1}=e,{prevPercentage:ki=0}=e,{segmentWidgets:Zt=[]}=e,{segmentContainers:Ki=new Lo(g=>i(46,Zt=g))}=e,{segmentClickables:at=new xo}=e,{segmentHighlights:li=new Eo}=e;const Ft=g=>rt.processEvent(Jt({emittedFrom:r},g)),pi=()=>i(89,h=R);function Qt(g){ie[g?"unshift":"push"](()=>{ut=g,i(42,ut)})}function Si(g){_e=g,i(30,_e)}function xi(g){Ce=g,i(29,Ce)}function ri(g){Q=g,i(10,Q)}function $t(g){qe=g,i(31,qe)}function wi(g){ki=g,i(45,ki)}function Li(g){ie[g?"unshift":"push"](()=>{dt=g,i(43,dt)})}function ai(g){ie[g?"unshift":"push"](()=>{H=g,i(44,H)})}const Wt=g=>Ft(Ji(Jt({},g),{emittedFrom:"segment-widget",widgetSegment:_,widgetIsCurrent:b}));function Pi(g){z=g,i(0,z)}function ei(g){de=g,i(1,de)}function gt(g){X=g,i(2,X)}function ti(g){x=g,i(3,x)}function ft(g){D=g,i(4,D)}function Ti(g){N=g,i(5,N)}function mt(g){J=g,i(6,J)}function W(g){ge=g,i(21,ge)}function Z(g){pe=g,i(22,pe)}function le(g){ee=g,i(23,ee)}function qt(g){G=g,i(24,G)}function rn(g){Y=g,i(25,Y)}function an(g){w=g,i(26,w)}function cn(g){se=g,i(27,se)}function oo(g){B=g,i(7,B)}function wn(g){Te=g,i(8,Te)}function lo(g){Se=g,i(28,Se)}function ii(g){Ye=g,i(9,Ye)}function un(g){Ce=g,i(29,Ce)}function dn(g){Q=g,i(10,Q)}function gn(g){_e=g,i(30,_e)}function fn(g){qe=g,i(31,qe)}function hn(g){tt=g,i(11,tt)}function ro(g){De=g,i(32,De)}function Pn(g){it=g,i(33,it)}function ao(g){vt=g,i(12,vt)}function Ci(g){Ie=g,i(34,Ie)}function co(g){Ze=g,i(35,Ze)}function us(g){Oe=g,i(36,Oe)}function uo(g){Re=g,i(13,Re)}function go(g){Ke=g,i(37,Ke)}function ds(g){Ae=g,i(14,Ae)}function fo(g){Ue=g,i(15,Ue)}function _n(g){Qe=g,i(16,Qe)}function Ht(g){ot=g,i(17,ot)}function qo(g){ze=g,i(18,ze)}function Tn(g){R=g,i(19,R)}function Kt(g){Ee=g,i(38,Ee)}function ho(g){pt=g,i(39,pt)}function Fn(g){lt=g,i(40,lt)}function mi(g){Ct=g,i(41,Ct)}return t.$$set=g=>{"playerApiUrl"in g&&i(67,O=g.playerApiUrl),"projectId"in g&&i(0,z=g.projectId),"contentId"in g&&i(1,de=g.contentId),"playlistId"in g&&i(2,X=g.playlistId),"sourceId"in g&&i(3,x=g.sourceId),"sourceUrl"in g&&i(4,D=g.sourceUrl),"playlist"in g&&i(68,U=g.playlist),"showUserInterface"in g&&i(5,N=g.showUserInterface),"playerStyle"in g&&i(6,J=g.playerStyle),"playerTitle"in g&&i(21,ge=g.playerTitle),"callToAction"in g&&i(22,pe=g.callToAction),"skipButtonStyle"in g&&i(23,ee=g.skipButtonStyle),"playlistStyle"in g&&i(24,G=g.playlistStyle),"playlistToggle"in g&&i(25,Y=g.playlistToggle),"downloadFormats"in g&&i(47,v=g.downloadFormats),"mediaSession"in g&&i(26,w=g.mediaSession),"content"in g&&i(48,q=g.content),"contentIndex"in g&&i(27,se=g.contentIndex),"introsOutros"in g&&i(49,te=g.introsOutros),"introsOutrosIndex"in g&&i(7,B=g.introsOutrosIndex),"adverts"in g&&i(50,F=g.adverts),"advertIndex"in g&&i(8,Te=g.advertIndex),"persistentAdImage"in g&&i(28,Se=g.persistentAdImage),"persistentIndex"in g&&i(9,Ye=g.persistentIndex),"duration"in g&&i(29,Ce=g.duration),"currentTime"in g&&i(10,Q=g.currentTime),"playbackState"in g&&i(30,_e=g.playbackState),"playbackRate"in g&&i(31,qe=g.playbackRate),"playbackRates"in g&&i(69,He=g.playbackRates),"widgetStyle"in g&&i(11,tt=g.widgetStyle),"widgetPosition"in g&&i(32,De=g.widgetPosition),"widgetWidth"in g&&i(33,it=g.widgetWidth),"widgetTarget"in g&&i(12,vt=g.widgetTarget),"textColor"in g&&i(34,Ie=g.textColor),"backgroundColor"in g&&i(35,Ze=g.backgroundColor),"iconColor"in g&&i(36,Oe=g.iconColor),"highlightColor"in g&&i(13,Re=g.highlightColor),"videoTextColor"in g&&i(51,kt=g.videoTextColor),"videoBackgroundColor"in g&&i(52,ht=g.videoBackgroundColor),"videoIconColor"in g&&i(53,ct=g.videoIconColor),"logoIconEnabled"in g&&i(37,Ke=g.logoIconEnabled),"highlightSections"in g&&i(14,Ae=g.highlightSections),"clickableSections"in g&&i(15,Ue=g.clickableSections),"segmentWidgetSections"in g&&i(16,Qe=g.segmentWidgetSections),"segmentWidgetPosition"in g&&i(17,ot=g.segmentWidgetPosition),"currentSegment"in g&&i(18,ze=g.currentSegment),"hoveredSegment"in g&&i(19,R=g.hoveredSegment),"loadedMedia"in g&&i(70,Je=g.loadedMedia),"advertConsent"in g&&i(38,Ee=g.advertConsent),"analyticsConsent"in g&&i(39,pt=g.analyticsConsent),"analyticsCustomUrl"in g&&i(40,lt=g.analyticsCustomUrl),"analyticsTag"in g&&i(41,Ct=g.analyticsTag),"writeToken"in g&&i(71,St=g.writeToken),"captureErrors"in g&&i(72,$e=g.captureErrors),"onError"in g&&i(73,Ge=g.onError),"transitions"in g&&i(74,_t=g.transitions),"controlPanel"in g&&i(20,et=g.controlPanel),"initialProps"in g&&i(77,zt=g.initialProps),"showBottomWidget"in g&&i(54,Vt=g.showBottomWidget),"showMediaSession"in g&&i(55,nt=g.showMediaSession),"isFullScreen"in g&&i(78,Xe=g.isFullScreen),"mediaElement"in g&&i(42,ut=g.mediaElement),"userInterface"in g&&i(43,dt=g.userInterface),"widgetInterface"in g&&i(44,H=g.widgetInterface),"controller"in g&&i(79,rt=g.controller),"analyticsUrl"in g&&i(80,Ut=g.analyticsUrl),"analyticsId"in g&&i(81,oe=g.analyticsId),"listenSessionId"in g&&i(82,S=g.listenSessionId),"sessionCreatedAt"in g&&i(83,T=g.sessionCreatedAt),"isNewListen"in g&&i(84,ne=g.isNewListen),"prevPercentage"in g&&i(45,ki=g.prevPercentage),"segmentWidgets"in g&&i(46,Zt=g.segmentWidgets),"segmentContainers"in g&&i(85,Ki=g.segmentContainers),"segmentClickables"in g&&i(86,at=g.segmentClickables),"segmentHighlights"in g&&i(87,li=g.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&128|t.$$.dirty[1]&262144&&i(58,n=te[B]),t.$$.dirty[0]&256|t.$$.dirty[1]&524288&&i(59,s=F[Te]),t.$$.dirty[0]&512|t.$$.dirty[1]&524288&&i(66,o=F[Ye]),t.$$.dirty[0]&64|t.$$.dirty[2]&65536&&i(62,l=Xe?"video":J),t.$$.dirty[0]&2048|t.$$.dirty[1]&8388608|t.$$.dirty[2]&65536&&i(61,a=Vt&&tt==="video"&&!Xe),t.$$.dirty[1]&1073741824&&(r=a?"bottom-widget":"inline-player"),t.$$.dirty[0]&4096&&i(12,vt=No(vt,"widget")),t.$$.dirty[0]&1048576&&i(20,et=No(et,"control panel")),t.$$.dirty[0]&32|t.$$.dirty[1]&1073741824|t.$$.dirty[2]&1&&i(65,u=N&&l==="video"&&!a),t.$$.dirty[0]&2112&&i(64,c=J==="video"||tt==="video"),t.$$.dirty[0]&31|t.$$.dirty[2]&64&&Ft(W_()),t.$$.dirty[0]&1|t.$$.dirty[2]&544&&z_(O,z,St,g=>Ft(g)),t.$$.dirty[0]&524288|t.$$.dirty[2]&134217728&&i(89,h=R||h),t.$$.dirty[0]&327680&&i(88,y=$n("current",ze,Qe)),t.$$.dirty[0]&262144|t.$$.dirty[2]&67108864&&y&&pi(),t.$$.dirty[0]&65536|t.$$.dirty[2]&134217728&&i(90,k=$n("hovered",h,Qe)),t.$$.dirty[0]&262144|t.$$.dirty[2]&469762048&&i(57,_=k&&h||y&&ze),t.$$.dirty[0]&262144|t.$$.dirty[1]&67108864&&i(60,b=(_==null?void 0:_.marker)===(ze==null?void 0:ze.marker)),t.$$.dirty[1]&939524096&&i(63,p=b||s||n),t.$$.dirty[0]&196672|t.$$.dirty[1]&67108864|t.$$.dirty[2]&8388608&&Ki.update(_,Qe,ot,J),t.$$.dirty[0]&557056|t.$$.dirty[2]&16777216&&at.update(R,Ue),t.$$.dirty[0]&286720|t.$$.dirty[2]&33554432&&li.update("current",ze,Ae,Re),t.$$.dirty[0]&548864|t.$$.dirty[2]&33554432&&li.update("hovered",R,Ae,Re),t.$$.dirty[0]&1024|t.$$.dirty[2]&135168&&D_(_t,rt,Q)},[z,de,X,x,D,N,J,B,Te,Ye,Q,tt,vt,Re,Ae,Ue,Qe,ot,ze,R,et,ge,pe,ee,G,Y,w,se,Se,Ce,_e,qe,De,it,Ie,Ze,Oe,Ke,Ee,pt,lt,Ct,ut,dt,H,ki,Zt,v,q,te,F,kt,ht,ct,Vt,nt,Ft,_,n,s,b,a,l,p,c,u,o,O,U,He,Je,St,$e,Ge,_t,At,Bt,zt,Xe,rt,Ut,oe,S,T,ne,Ki,at,li,y,h,k,Qt,Si,xi,ri,$t,wi,Li,ai,Wt,Pi,ei,gt,ti,ft,Ti,mt,W,Z,le,qt,rn,an,cn,oo,wn,lo,ii,un,dn,gn,fn,hn,ro,Pn,ao,Ci,co,us,uo,go,ds,fo,_n,Ht,qo,Tn,Kt,ho,Fn,mi]}let $_=class extends ke{constructor(e){super(),ve(this,e,Q_,X_,fe,{playerApiUrl:67,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:68,showUserInterface:5,playerStyle:6,playerTitle:21,callToAction:22,skipButtonStyle:23,playlistStyle:24,playlistToggle:25,downloadFormats:47,mediaSession:26,content:48,contentIndex:27,introsOutros:49,introsOutrosIndex:7,adverts:50,advertIndex:8,persistentAdImage:28,persistentIndex:9,duration:29,currentTime:10,playbackState:30,playbackRate:31,playbackRates:69,widgetStyle:11,widgetPosition:32,widgetWidth:33,widgetTarget:12,textColor:34,backgroundColor:35,iconColor:36,highlightColor:13,videoTextColor:51,videoBackgroundColor:52,videoIconColor:53,logoIconEnabled:37,highlightSections:14,clickableSections:15,segmentWidgetSections:16,segmentWidgetPosition:17,currentSegment:18,hoveredSegment:19,loadedMedia:70,advertConsent:38,analyticsConsent:39,analyticsCustomUrl:40,analyticsTag:41,writeToken:71,captureErrors:72,onError:73,transitions:74,controlPanel:20,addEventListener:75,removeEventListener:76,initialProps:77,showBottomWidget:54,showMediaSession:55,isFullScreen:78,mediaElement:42,userInterface:43,widgetInterface:44,controller:79,analyticsUrl:80,analyticsId:81,listenSessionId:82,sessionCreatedAt:83,isNewListen:84,prevPercentage:45,segmentWidgets:46,segmentContainers:85,segmentClickables:86,segmentHighlights:87,onEvent:56},null,[-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[67]}set playerApiUrl(e){this.$$set({playerApiUrl:e}),d()}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),d()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),d()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),d()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),d()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),d()}get playlist(){return this.$$.ctx[68]}set playlist(e){this.$$set({playlist:e}),d()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),d()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),d()}get playerTitle(){return this.$$.ctx[21]}set playerTitle(e){this.$$set({playerTitle:e}),d()}get callToAction(){return this.$$.ctx[22]}set callToAction(e){this.$$set({callToAction:e}),d()}get skipButtonStyle(){return this.$$.ctx[23]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get playlistStyle(){return this.$$.ctx[24]}set playlistStyle(e){this.$$set({playlistStyle:e}),d()}get playlistToggle(){return this.$$.ctx[25]}set playlistToggle(e){this.$$set({playlistToggle:e}),d()}get downloadFormats(){return this.$$.ctx[47]}set downloadFormats(e){this.$$set({downloadFormats:e}),d()}get mediaSession(){return this.$$.ctx[26]}set mediaSession(e){this.$$set({mediaSession:e}),d()}get content(){return this.$$.ctx[48]}set content(e){this.$$set({content:e}),d()}get contentIndex(){return this.$$.ctx[27]}set contentIndex(e){this.$$set({contentIndex:e}),d()}get introsOutros(){return this.$$.ctx[49]}set introsOutros(e){this.$$set({introsOutros:e}),d()}get introsOutrosIndex(){return this.$$.ctx[7]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),d()}get adverts(){return this.$$.ctx[50]}set adverts(e){this.$$set({adverts:e}),d()}get advertIndex(){return this.$$.ctx[8]}set advertIndex(e){this.$$set({advertIndex:e}),d()}get persistentAdImage(){return this.$$.ctx[28]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),d()}get persistentIndex(){return this.$$.ctx[9]}set persistentIndex(e){this.$$set({persistentIndex:e}),d()}get duration(){return this.$$.ctx[29]}set duration(e){this.$$set({duration:e}),d()}get currentTime(){return this.$$.ctx[10]}set currentTime(e){this.$$set({currentTime:e}),d()}get playbackState(){return this.$$.ctx[30]}set playbackState(e){this.$$set({playbackState:e}),d()}get playbackRate(){return this.$$.ctx[31]}set playbackRate(e){this.$$set({playbackRate:e}),d()}get playbackRates(){return this.$$.ctx[69]}set playbackRates(e){this.$$set({playbackRates:e}),d()}get widgetStyle(){return this.$$.ctx[11]}set widgetStyle(e){this.$$set({widgetStyle:e}),d()}get widgetPosition(){return this.$$.ctx[32]}set widgetPosition(e){this.$$set({widgetPosition:e}),d()}get widgetWidth(){return this.$$.ctx[33]}set widgetWidth(e){this.$$set({widgetWidth:e}),d()}get widgetTarget(){return this.$$.ctx[12]}set widgetTarget(e){this.$$set({widgetTarget:e}),d()}get textColor(){return this.$$.ctx[34]}set textColor(e){this.$$set({textColor:e}),d()}get backgroundColor(){return this.$$.ctx[35]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[36]}set iconColor(e){this.$$set({iconColor:e}),d()}get highlightColor(){return this.$$.ctx[13]}set highlightColor(e){this.$$set({highlightColor:e}),d()}get videoTextColor(){return this.$$.ctx[51]}set videoTextColor(e){this.$$set({videoTextColor:e}),d()}get videoBackgroundColor(){return this.$$.ctx[52]}set videoBackgroundColor(e){this.$$set({videoBackgroundColor:e}),d()}get videoIconColor(){return this.$$.ctx[53]}set videoIconColor(e){this.$$set({videoIconColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[37]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[14]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[15]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[16]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[17]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get currentSegment(){return this.$$.ctx[18]}set currentSegment(e){this.$$set({currentSegment:e}),d()}get hoveredSegment(){return this.$$.ctx[19]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),d()}get loadedMedia(){return this.$$.ctx[70]}set loadedMedia(e){this.$$set({loadedMedia:e}),d()}get advertConsent(){return this.$$.ctx[38]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[39]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[40]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsTag(){return this.$$.ctx[41]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}get writeToken(){return this.$$.ctx[71]}set writeToken(e){this.$$set({writeToken:e}),d()}get captureErrors(){return this.$$.ctx[72]}set captureErrors(e){this.$$set({captureErrors:e}),d()}get onError(){return this.$$.ctx[73]}set onError(e){this.$$set({onError:e}),d()}get transitions(){return this.$$.ctx[74]}set transitions(e){this.$$set({transitions:e}),d()}get controlPanel(){return this.$$.ctx[20]}set controlPanel(e){this.$$set({controlPanel:e}),d()}get addEventListener(){return this.$$.ctx[75]}get removeEventListener(){return this.$$.ctx[76]}get initialProps(){return this.$$.ctx[77]}set initialProps(e){this.$$set({initialProps:e}),d()}get showBottomWidget(){return this.$$.ctx[54]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),d()}get showMediaSession(){return this.$$.ctx[55]}set showMediaSession(e){this.$$set({showMediaSession:e}),d()}get isFullScreen(){return this.$$.ctx[78]}set isFullScreen(e){this.$$set({isFullScreen:e}),d()}get mediaElement(){return this.$$.ctx[42]}set mediaElement(e){this.$$set({mediaElement:e}),d()}get userInterface(){return this.$$.ctx[43]}set userInterface(e){this.$$set({userInterface:e}),d()}get widgetInterface(){return this.$$.ctx[44]}set widgetInterface(e){this.$$set({widgetInterface:e}),d()}get controller(){return this.$$.ctx[79]}set controller(e){this.$$set({controller:e}),d()}get analyticsUrl(){return this.$$.ctx[80]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),d()}get analyticsId(){return this.$$.ctx[81]}set analyticsId(e){this.$$set({analyticsId:e}),d()}get listenSessionId(){return this.$$.ctx[82]}set listenSessionId(e){this.$$set({listenSessionId:e}),d()}get sessionCreatedAt(){return this.$$.ctx[83]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),d()}get isNewListen(){return this.$$.ctx[84]}set isNewListen(e){this.$$set({isNewListen:e}),d()}get prevPercentage(){return this.$$.ctx[45]}set prevPercentage(e){this.$$set({prevPercentage:e}),d()}get segmentWidgets(){return this.$$.ctx[46]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),d()}get segmentContainers(){return this.$$.ctx[85]}set segmentContainers(e){this.$$set({segmentContainers:e}),d()}get segmentClickables(){return this.$$.ctx[86]}set segmentClickables(e){this.$$set({segmentClickables:e}),d()}get segmentHighlights(){return this.$$.ctx[87]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),d()}get onEvent(){return this.$$.ctx[56]}};class e0{constructor(e,i){this.baseUrl=e==null?void 0:e.replace("{id}",i)}byContentId(e){return vn(`${this.baseUrl}/by_content_id/${e}`)}byPlaylistId(e){return vn(`${this.baseUrl}/by_playlist_id/${e}`)}bySourceId(e){return vn(`${this.baseUrl}/by_source_id/${e}`)}bySourceUrl(e){return vn(`${this.baseUrl}/by_source_url/${e}`)}byIdentifiers(e){return vn(`${this.baseUrl}/by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}const Do=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(Do):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),Do(i)])),Pr=t=>t==="dark"||t==="auto"&&t0()?"dark":"light",t0=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Tr=t=>fi(this,null,function*(){const e=new e0(t.playerApiUrl,t.projectId);if(!t.playerApiUrl||!t.projectId)return;const i=i0(t);if(i.length===0)return;const n=yield n0(e,i).catch(()=>{});if(!(n!=null&&n.content)){s0(t);return}o0(t,n)}),i0=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(...Do(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},n0=(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)},s0=t=>{Cr(t),Ar(t),Br(t),t.onEvent(he({type:"NoContentAvailable",description:"No published and processed content is available for the identifiers.",initiatedBy:"browser"}))},o0=(t,e)=>{var o;const i=Pr(e.settings.theme),n=e.settings[`${i}_theme`],s=e.settings.video_theme;Cr(t),Ar(t,e),Br(t,e),Me(t,"playerStyle",e.settings.player_style),Me(t,"playerTitle",((o=e.playlist)==null?void 0:o.title)||e.settings.player_title),Me(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),Me(t,"skipButtonStyle",e.settings.skip_button_style),Me(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),Me(t,"introsOutros",l0(e.settings)),Me(t,"persistentAdImage",e.settings.persistent_ad_image),Me(t,"widgetStyle",e.settings.widget_style),Me(t,"widgetPosition",e.settings.widget_position),Me(t,"textColor",n.text_color),Me(t,"backgroundColor",n.background_color),Me(t,"iconColor",n.icon_color),Me(t,"highlightColor",n.highlight_color),Me(t,"videoTextColor",s.text_color),Me(t,"videoBackgroundColor",s.background_color),Me(t,"videoIconColor",s.icon_color),Me(t,"logoIconEnabled",e.settings.logo_icon_enabled),Me(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),Me(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),Me(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),Me(t,"analyticsConsent",r0(e.settings)),Me(t,"analyticsCustomUrl",e.settings.analytics_custom_url),Me(t,"analyticsTag",e.settings.analytics_tag),Me(t,"analyticsUrl",e.settings.analytics_url),Me(t,"analyticsId",e.settings.analytics_id)},Cr=t=>{Me(t,"contentIndex",0),Me(t,"introsOutrosIndex",-1),Me(t,"advertIndex",-1),Me(t,"persistentIndex",-1),Me(t,"duration",0),Me(t,"currentTime",0),Me(t,"playbackState","stopped"),Me(t,"currentSegment",void 0),Me(t,"hoveredSegment",void 0)},Ar=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.content)||[];Me(t,"content",n.map(o=>{var l;return{id:o.id,title:o.title,imageUrl:i?((l=e.playlist)==null?void 0:l.image_url)||e.settings.image_url||o.image_url:null,sourceId:o.source_id,sourceUrl:o.source_url,adsEnabled:o.ads_enabled,duration:o.audio[0]?o.audio[0].duration/1e3:0,audio:o.audio.map(r=>({id:r.id,url:r.url,contentType:r.content_type,duration:r.duration?r.duration/1e3:0})),video:o.video.map(r=>({id:r.id,url:r.url,contentType:r.content_type,duration:r.duration?r.duration/1e3:0})),segments:o.segments.map(r=>({marker:r.marker,section:r.section,startTime:r.start_time?r.start_time/1e3:0,duration:r.duration?r.duration/1e3:0}))}}))},Br=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.ads)||[];Me(t,"adverts",n.map(o=>{const l=o.type==="vast",r=Pr(o.theme),a=o[`${r}_theme`],u=o.video_theme;return{id:o.id,type:o.type,placement:o.placement,vastUrl:l?o.vast_url:null,clickThroughUrl:l?null:o.click_through_url,imageUrl:i?o.image_url:null,textColor:a==null?void 0:a.text_color,backgroundColor:a==null?void 0:a.background_color,iconColor:a==null?void 0:a.icon_color,videoTextColor:u==null?void 0:u.text_color,videoBackgroundColor:u==null?void 0:u.background_color,videoIconColor:u==null?void 0:u.icon_color,audio:l?[]:(o.audio||o.media).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0})),video:l?[]:(o.video||[]).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0}))}}))},Me=(t,e,i)=>{var s;typeof((s=t.initialProps)==null?void 0:s[e])!="undefined"||(t[e]=i)},l0=({intro_outro_enabled:t,intro_url:e,outro_url:i})=>{if(!t)return[];const n=[];return e&&n.push({placement:"pre-roll",audio:[{url:e}],video:[]}),i&&n.push({placement:"post-roll",audio:[{url:i}],video:[]}),n},r0=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",a0=(t,e)=>fi(this,null,function*(){const n=yield(yield fetch(t)).blob(),s=URL.createObjectURL(n),o=document.createElement("a");document.body.append(o),o.href=s,o.setAttribute("download",e),o.setAttribute("target","_blank"),o.click(),o.remove()}),Es={vastUrls:new Set,mediaSources:new Set},c0=t=>{t.vastUrl&&Es.vastUrls.add(t.vastUrl);for(const e of[...t.audio||[],...t.video||[]])Es.mediaSources.add(e.url)},Ir=t=>{if(t.vastUrl&&Es.vastUrls.has(t.vastUrl))return!0;for(const e of[...t.audio||[],...t.video||[]])if(Es.mediaSources.has(e.url))return!0;return!1},Vr=new Set,u0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Vr.add(i.url))},d0=t=>[...t.audio||[],...t.video||[]].some(i=>Vr.has(i.url)),g0=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r,errored:a}={})=>{var _;const u=e&&e[i];e:if(u){if(a){c0(u);break e}if(r)return u0(u),-1;if(!r)return i}if(!((_=n[s])!=null&&_.adsEnabled)||t!==-1)return-1;const c=h0({content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r});let h=-1,y=-1/0,k=-1/0;for(const[b,p]of e.entries()){if(d0(p)||Ir(p)||!c.has(p.placement))continue;const O=f0[p.type]||0;if(O<y)continue;const z=Math.random();O===y&&z<k||(h=b,y=O,k=z)}return h},f0={vast:1,custom:0},h0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=e===0,l=e===t.length-1,r=t.length>1,a=r&&n&&!o,u=t[e].segments,c=u[u.length-1],h=r?null:b0(u),y=u[h],k=y&&i>y.startTime,_=c?c.startTime+c.duration:0,b=i>_-m0,p=new Set;return n&&p.add("pre-roll"),k&&!b&&p.add("mid-roll"),a&&p.add("mid-roll"),s&&l&&p.add("post-roll"),a&&p.add("post-roll"),p},_0=2*60,m0=10,y0=.5,b0=t=>{const e=t[t.length-1];if(!e)return;const i=e.startTime+e.duration;if(i<_0)return;const n=i/2,s=Co(t,i/2),r=t[s].startTime>=n-y0?s:s+1;if(r!==t.length)return r},v0=(t,e,i,n)=>{let s=-1,o=-1/0,l=-1/0;for(const[r,a]of(n||[]).entries()){if(!t||Ir(a)||a.type==="vast")continue;const u=p0(r,e,i);if(u<o)continue;const c=k0[a.placement]||0;u===o&&c<l||(s=r,o=u,l=c)}return s},k0={"pre-roll":2,"mid-roll":1},p0=(t,e,i)=>t===i?2:t===e?1:0,Wr={mediaSources:new Set},S0=t=>{for(const e of[...t.audio||[],t.video||[]])Wr.mediaSources.add(e.url)},w0=t=>{for(const e of[...t.audio||[],t.video||[]])if(Wr.mediaSources.has(e.url))return!0;return!1},jr=new Set,P0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>jr.add(i.url))},T0=t=>[...t.audio||[],...t.video||[]].some(i=>jr.has(i.url)),C0=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r,errored:a})=>{const u=t[e];e:if(u){if(a){S0(u);break e}if(r)return P0(u),-1;if(!r)return e}if(i!==-1)return-1;const c=A0({content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r});let h=-1,y=-1/0,k=-1/0;for(const[_,b]of t.entries()){if(w0(b)||!c.has(b.placement))continue;const p=T0(b)?1:0;if(p<y)continue;const O=Math.random();p===y&&O<k||(h=_,y=p,k=O)}return h},A0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=new Set,l=n&&e===0&&i===0,r=s&&e===t.length-1;return l&&o.add("pre-roll"),r&&o.add("post-roll"),o},B0=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(o=>o.mediaSession==="override");if(W0()&&!e)return;let i,n=-1/0,s=-1/0;for(const o of t.instances()){if(o.mediaSession==="none")continue;const l=I0[o.playbackState]||0;if(l<n)continue;const r=V0[o.showMediaSession]||0;l===n&&r<s||(i=o,n=l,s=r)}for(const o of t.instances())o.showMediaSession=o===i;return i},I0={playing:1,paused:0,stopped:0},V0={true:1,false:0},W0=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:s}=t;return e||i||n||(s==null?void 0:s.length)},j0=t=>{let e=!1,i,n=-1/0,s=-1/0;for(const o of t.instances()){if(!o.userInterface||o.widgetTarget||!jo(o.widgetStyle))continue;if(o.userInterface.isVisible){e=!0;continue}if(!(o.userInterface.relativeY<0))continue;const u=M0[o.playbackState]||0;if(u<n)continue;const c=o.userInterface.absoluteY;u===n&&c<s||(i=o,n=u,s=c)}e&&n===0&&(i=null);for(const o of t.instances())o.showBottomWidget=o===i},M0={playing:2,paused:1,stopped:0};class z0{constructor(e,i){Ve(this,Zs);Ve(this,Ks);Ve(this,ls);Ve(this,Js);Ve(this,Gs);Ve(this,vi);Ve(this,qi);Ve(this,oi);Ve(this,Xs);Ve(this,pn);Ve(this,Hi);Ve(this,Qs);Ve(this,rs);Ve(this,Oi);Ve(this,as);Ve(this,Yi);Ve(this,Mt);Ve(this,Zi);Ve(this,Ei);Ve(this,$s);Ve(this,eo);Ve(this,Sn);Ve(this,cs);Ve(this,to);Ve(this,io);Ve(this,no);Ve(this,so);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||Xt(`Cannot add listener for unknown event type '${e}'.`);const s=`listener-handle-${ps()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][s]=i,s}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return fi(this,null,function*(){yield hr(()=>this.player),Ya(e);const i=this[`handle${e.type}`],n=Os(this.player);M(this,Zs,ea).call(this,e)?e.status="ignored-due-to-advert":M(this,Ks,ta).call(this,e)?e.status="ignored-due-to-scrubbing":i?(yield i.call(this,e),M(this,$s,la).call(this),M(this,eo,ra).call(this),e.status="handled"):Xt("No handler function for event.",e);const s=Os(this.player);e.changedProps=_r(n,s),e.processedAt=new Date().toISOString(),Za(e),M(this,ls,Go).call(this,e.type,e),M(this,ls,Go).call(this,"<any>",e)})}handlePressedChangeRate(){M(this,Oi,mn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeRate(){M(this,Oi,mn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeRate(){M(this,Oi,mn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeRate(){M(this,Oi,mn).call(this,e=>e+1)}handlePressedRightOnChangeRate(){M(this,Oi,mn).call(this,e=>e+1)}handlePressedDownOnChangeRate(){M(this,Oi,mn).call(this,e=>e-1)}handlePressedLeftOnChangeRate(){M(this,Oi,mn).call(this,e=>e-1)}handlePressedPrevSegment(){M(this,as,Qo).call(this,e=>e-1)}handlePressedNextSegment(){M(this,as,Qo).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){M(this,Mt,Gt).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){M(this,Mt,Gt).call(this,i=>i+e)}handlePressedPrevTrack(){M(this,Yi,Bn).call(this,e=>e-1)}handlePressedNextTrack(){M(this,Yi,Bn).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleMediaLoaded({loadedMedia:e}){this.player.loadedMedia=e}handlePlaybackRateUpdated(){}handleVisibilityChanged(){j0(this.PlayerClass)}handlePressedVideoBackground(){M(this,Hi,An).call(this)}handlePressedEnterOnProgressBar(){M(this,Hi,An).call(this)}handlePressedSpaceOnProgressBar(){M(this,Hi,An).call(this)}handlePressedEnterOnProgressCircle(){M(this,Hi,An).call(this)}handlePressedSpaceOnProgressCircle(){M(this,Hi,An).call(this)}handlePressedLeftOnProgressBar(){M(this,Mt,Gt).call(this,e=>e-5)}handlePressedRightOnProgressBar(){M(this,Mt,Gt).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){M(this,Mt,Gt).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){M(this,Mt,Gt).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,M(this,Qs,oa).call(this),M(this,Mt,Gt).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){M(this,Mt,Gt).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){this.player.playbackState=this.preScrubState,setTimeout(()=>delete this.preScrubState,500)}handleIdentifiersChanged(){Tr(this.player).then(()=>{M(this,Zi,In).call(this,{atTheStart:!0}),M(this,Ei,yn).call(this,{atTheStart:!0})})}handleNoContentAvailable({description:e}){console.warn(`BeyondWords.Player: ${e}`)}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?M(this,rs,Xo).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"),B0(this.PlayerClass)}handlePlaybackPaused(){const e=this.player.playbackState==="playing",i=this.player.currentTime>=this.player.duration-.5;e&&!i&&!this.preScrubState&&(this.player.playbackState="paused")}handleCurrentTimeUpdated(){this.midrollPlayed||M(this,Ei,yn).call(this);const e=this.player.currentTime<=0,i=this.player.currentTime>=this.player.duration,n=this.player.mediaElement.video.paused;!e&&!i&&!n&&(this.player.playbackState="playing")}handlePlaybackEnded(){M(this,Xs,sa).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=M(this,vi,Gi).call(this),i=M(this,oi,yi).call(this);M(this,Ei,yn).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(M(this,Zi,In).call(this,{atTheEnd:!0}),!e&&(M(this,qi,Cn).call(this)||M(this,oi,yi).call(this)||M(this,Yi,Bn).call(this,n=>n+1)))}handlePlaybackNotAllowed({description:e}){console.warn(`BeyondWords.Player: ${e}`);const i=this.player.contentIndex<=0&&this.player.currentTime<=0;this.player.playbackState=i?"stopped":"paused"}handlePlaybackErrored({mediaType:e,errorMessage:i}){console.warn(`BeyondWords.Player: ${e} playback error: ${i}`),M(this,vi,Gi).call(this)||M(this,qi,Cn).call(this)?M(this,Zi,In).call(this,{errored:!0}):M(this,oi,yi).call(this)?M(this,Ei,yn).call(this,{errored:!0}):this.handlePlaybackEnded()}handlePressedMaximize(){xl()?Nh():Lh(this.player.target)}handleFullScreenModeUpdated(){const e=xl()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){M(this,Yi,Bn).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,audioIndex:i,videoIndex:n}){var c,h;const s=this.player.content[e],o=(c=s.audio)==null?void 0:c[i],l=(h=s.video)==null?void 0:h[n],r=(o||l).url,a=r.split(".").pop(),u=`${s.title}.${a}`;return a0(r,u)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:s,contentStatus:o}){o==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&M(this,no,ua).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:s})&&Tr(this.player).then(()=>{M(this,Zi,In).call(this,{atTheStart:!0}),M(this,Ei,yn).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){var s;M(this,pn,gs).call(this)?this.player.currentSegment=Ji(Jt({},e),{segmentIndex:i,contentIndex:n}):this.segmentPlayed||((s=this.player.segmentContainers)==null||s.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){e?this.player.hoveredSegment=Ji(Jt({},e),{segmentIndex:i,contentIndex:n}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,segmentIndex:i,contentIndex:n}){if(!$n("hovered",e,this.player.clickableSections))return;if(!M(this,so,da).call(this,{contentIndex:n,segmentIndex:i})&&!M(this,oi,yi).call(this)){M(this,Hi,An).call(this);return}n!==this.player.contentIndex&&M(this,Yi,Bn).call(this,()=>n),M(this,rs,Xo).call(this,Jt({segmentIndex:i,contentIndex:n},e))}}Zs=new WeakSet,ea=function({type:e}){return M(this,oi,yi).call(this)&&(e.includes("ChangeRate")||e.includes("PrevSegment")||e.includes("NextSegment")||e.includes("SeekBack")||e.includes("SeekAhead")||e.includes("Progress")&&!e.includes("Space")&&!e.includes("Enter"))},Ks=new WeakSet,ta=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},ls=new WeakSet,Go=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(s=>s(i))},Js=new WeakSet,ia=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},Gs=new WeakSet,na=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},vi=new WeakSet,Gi=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="pre-roll"},qi=new WeakSet,Cn=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="post-roll"},oi=new WeakSet,yi=function(){return this.player.advertIndex!==-1},Xs=new WeakSet,sa=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},pn=new WeakSet,gs=function(){return!M(this,vi,Gi).call(this)&&!M(this,qi,Cn).call(this)&&!M(this,oi,yi).call(this)},Hi=new WeakSet,An=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},Qs=new WeakSet,oa=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},rs=new WeakSet,Xo=function(s){var o=s,{segmentIndex:e,contentIndex:i}=o,n=Yo(o,["segmentIndex","contentIndex"]);M(this,Mt,Gt).call(this,()=>n.startTime,i),this.player.currentSegment=Jt({segmentIndex:e,contentIndex:i},n),this.player.playbackState="playing",this.segmentPlayed=!0},Oi=new WeakSet,mn=function(e,{cycle:i}={}){const n=this.player.playbackRates,s=n.length-1,o=n.indexOf(this.player.playbackRate),l=e(o);let r;i?r=l%n.length:r=Math.max(0,Math.min(s,l)),this.player.playbackRate=n[r]||1},as=new WeakSet,Qo=function(e){const i=this.player.content[this.player.contentIndex].segments,n=Co(i,this.player.currentTime),s=e(n);M(this,vi,Gi).call(this)&&s>=0?this.handlePlaybackEnded():M(this,qi,Cn).call(this)&&s<0?(M(this,Sn,fs).call(this,-1),M(this,Mt,Gt).call(this,()=>{var o;return((o=i[i.length-1])==null?void 0:o.startTime)||.01}),this.player.playbackState="playing"):M(this,pn,gs).call(this)&&s<0&&M(this,Js,ia).call(this)?(M(this,Mt,Gt).call(this,()=>0),M(this,Zi,In).call(this,{atTheStart:!0})):M(this,pn,gs).call(this)&&s===i.length&&M(this,Gs,na).call(this)?M(this,Mt,Gt).call(this,()=>this.player.duration-.01):M(this,pn,gs).call(this)&&s>=0&&s<i.length&&M(this,Mt,Gt).call(this,()=>i[s].startTime)},Yi=new WeakSet,Bn=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",M(this,Mt,Gt).call(this,()=>0)):(this.player.contentIndex=i,M(this,oi,yi).call(this)||(M(this,Mt,Gt).call(this,()=>0),this.midrollPlayed=!1)),M(this,Sn,fs).call(this,-1),M(this,Zi,In).call(this,{atTheStart:!0}),n||M(this,Ei,yn).call(this,{atTheStart:!0})},Mt=new WeakSet,Gt=function(e,i){if(M(this,oi,yi).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},Zi=new WeakSet,In=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:s,introsOutros:o,currentTime:l}=this.player,r=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,a=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,u=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;M(this,Sn,fs).call(this,C0({introsOutros:o,introsOutrosIndex:r,advertIndex:a,content:s,contentIndex:u,currentTime:l,atTheStart:e,atTheEnd:i,errored:n}))},Ei=new WeakSet,yn=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:s}={}){const{adverts:o,content:l,currentTime:r}=this.player;let a=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const u=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,c=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,a=-1),M(this,cs,$o).call(this,g0({introsOutrosIndex:a,adverts:o,advertIndex:u,content:l,contentIndex:c,currentTime:r,atTheStart:e,atTheEnd:i,errored:s}));const h=this.player.persistentAdImage,y=this.player.persistentIndex;this.player.persistentIndex=v0(h,y,u,o)},$s=new WeakSet,la=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(M(this,Sn,fs).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},eo=new WeakSet,ra=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(M(this,cs,$o).call(this,this.nextAdvert),delete this.nextAdvert)},Sn=new WeakSet,fs=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)&&M(this,vi,Gi).call(this,e)){this.player.introsOutrosIndex=-1,M(this,Ei,yn).call(this,{atTheStart:!0});return}const o=M(this,vi,Gi).call(this),l=M(this,qi,Cn).call(this);this.player.introsOutrosIndex=e;const r=o&&!M(this,vi,Gi).call(this),a=l&&!M(this,qi,Cn).call(this);r&&(this.player.currentTime=0),a&&M(this,Yi,Bn).call(this,()=>1/0)},cs=new WeakSet,$o=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=M(this,oi,yi).call(this);this.player.advertIndex=e;const s=!n&&M(this,oi,yi).call(this),o=n&&!M(this,oi,yi).call(this);s&&M(this,to,aa).call(this),o&&M(this,io,ca).call(this)},to=new WeakSet,aa=function(){M(this,vi,Gi).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},io=new WeakSet,ca=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},no=new WeakSet,ua=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:s}){var o,l,r,a;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===s||((o=this.player.playlist)==null?void 0:o.some(u=>u.contentId===e))||((l=this.player.playlist)==null?void 0:l.some(u=>u.contentId===i))||((r=this.player.playlist)==null?void 0:r.some(u=>u.sourceId===n))||((a=this.player.playlist)==null?void 0:a.some(u=>u.sourceUrl===s))},so=new WeakSet,da=function({contentIndex:e,segmentIndex:i}){var n,s;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((s=this.player.currentSegment)==null?void 0:s.segmentIndex)!==i};var ts="<unknown>";function O0(t){var e=t.split(`
55
+ gtag("js", new Date());`,e.async=!0,bi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+t[0])||rr(e,"src",i)},m(o,l){I(o,e,l),I(o,n,l),I(o,s,l)},p(o,l){l&1&&!bi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+o[0])&&rr(e,"src",i)},d(o){o&&(A(e),A(n),A(s))}}}function A_(t){let e,i=!t[1]&&ar(t);return{c(){i&&i.c(),e=$i()},m(n,s){i&&i.m(document.head,null),f(document.head,e)},p(n,[s]){n[1]?i&&(i.d(1),i=null):i?i.p(n,s):(i=ar(n),i.c(),i.m(e.parentNode,e))},i:j,o:j,d(n){i&&i.d(n),A(e)}}}function B_(t,e,i){let n,{analyticsTag:s}=e;return t.$$set=o=>{"analyticsTag"in o&&i(0,s=o.analyticsTag)},i(1,n=window.gtag),[s,n]}class I_ extends ke{constructor(e){super(),ve(this,e,B_,A_,fe,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const H2="";class V_ extends ke{constructor(e){super(),ve(this,e,null,null,fe,{})}}class Oo{constructor(e,i){Ve(this,is);Ve(this,Ns);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var o;(o=this.consumers)[e]||(o[e]=[]);const s=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(s&&M(this,is,Jo).call(this,n,s.args))&&(s&&this.onDeselected(e,...s.args),this.onSelected(e,...n))}removeInterest(e,i){var l;(l=this.consumers)[e]||(l[e]=[]);const n=this.consumers[e].slice(-1)[0];if(M(this,Ns,Yr).call(this,this.consumers[e],r=>r.consumerId===i),!(n&&i===n.consumerId))return;const o=this.consumers[e].slice(-1)[0];o&&M(this,is,Jo).call(this,n.args,o.args)||(this.onDeselected(e,...n.args),o&&this.onSelected(e,...o.args))}}is=new WeakSet,Jo=function(e,i){return e.length===i.length&&e.every((n,s)=>n===i[s])},Ns=new WeakSet,Yr=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};const $n=(t,e,i)=>{let[n,s]=i.split("-");n||(n="none"),s||(s=n);const o=t==="current"?n:s;return o==="all"||o==="body"&&(e==null?void 0:e.section)==="body"},on="data-beyondwords-marker",cr=t=>["beyondwords-highlight","bwp",`marker-${t}`],Ri=class Ri{update(e,i,n,s){const o=$n(e,i,n),l=this[`prev${e}`],r=o?i==null?void 0:i.marker:null;r&&Ai(Ri,ns).addInterest(r,this,s),l&&Ai(Ri,ns).removeInterest(l,this),this[`prev${e}`]=r}};ns=new WeakMap,Ds=new WeakSet,Zr=function(e,i){const n=document.querySelectorAll(`[${on}="${e}"]`);for(const s of n){const o=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,null,!1);let l;for(;l=o.nextNode();){if(/^\s*$/.test(l.nodeValue))continue;l.parentNode.nodeName.toLowerCase()==="a"&&(l=l.parentNode);const u=document.createElement("mark");u.classList.add(...cr(e)),u.style.background=i,l.parentNode.insertBefore(u,l),u.appendChild(l)}}},Rs=new WeakSet,Kr=function(e){const i=document.querySelectorAll(`[${on}="${e}"]`);for(const n of i){const s=n.querySelectorAll(`mark.${cr(e)}`);for(const o of s)for(const l of o.childNodes)o.parentNode.insertBefore(l,o),o.remove()}},Ve(Ri,Ds),Ve(Ri,Rs),Ve(Ri,ns,new Oo(M(Ri,Ds,Zr),M(Ri,Rs,Kr)));let Eo=Ri;const ur=["beyondwords-clickable","bwp"],Ui=class Ui{update(e,i){const n=$n("hovered",e,i),s=this.previous,o=n?e==null?void 0:e.marker:null;o&&Ai(Ui,ss).addInterest(o,this),s&&Ai(Ui,ss).removeInterest(s,this),this.previous=o}};ss=new WeakMap,Us=new WeakSet,Jr=function(e){const i=document.querySelectorAll(`[${on}="${e}"]`);for(const n of i)n.classList.add(...ur)},Fs=new WeakSet,Gr=function(e){const i=document.querySelectorAll(`[${on}="${e}"]`);for(const n of i)dr(n,ur)},Ve(Ui,Us),Ve(Ui,Fs),Ve(Ui,ss,new Oo(M(Ui,Us,Jr),M(Ui,Fs,Gr)));let xo=Ui;const dr=(t,e)=>{if(!t)return;const s=[...t.classList].filter(o=>!e.includes(o)).some(o=>o.startsWith("beyondwords-"))?e.filter(o=>o!=="bwp"):e;t.classList.remove(...s)},gr=(t,e,i)=>["beyondwords-widget","bwp",`marker-${t}`,`position-${e}`,`for-${i}-player`],fr=["beyondwords-relative","bwp"],Fi=class Fi{constructor(e){this.onUpdate=e,this.containers=[]}update(e,i,n,s){const o=i.includes("all")||i.includes("body"),l=this.previous,r=(e==null?void 0:e.marker)||o&&(l==null?void 0:l.marker);r&&Ai(Fi,os).addInterest(r,this,this,n,s),l&&Ai(Fi,os).removeInterest(l,this),this.previous=r}reset(){this.update(null,"none")}};os=new WeakMap,qs=new WeakSet,Xr=function(e,i,n,s){const o=document.querySelector(`[${on}="${e}"]`),l=document.createElement("div");if(!o)return;["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(n)&&o.classList.add(...fr),l.classList.add(...gr(e,n,s)),["11-oclock","12-oclock","1-oclock"].includes(n)?o.insertBefore(l,o.firstChild):o.appendChild(l),i.containers.push(l),i.onUpdate(i.containers)},Hs=new WeakSet,Qr=function(e,i,n,s){const o=gr(e,n,s);for(let l=0;l<i.containers.length;l+=1){if(!o.every(u=>i.containers[l].classList.contains(u)))continue;const a=i.containers[l].parentNode;dr(a,fr),i.containers[l].remove(),i.containers.splice(l,1),l-=1}i.onUpdate(i.containers)},Ve(Fi,qs),Ve(Fi,Hs),Ve(Fi,os,new Oo(M(Fi,qs,Xr),M(Fi,Hs,Qr)));let Lo=Fi;const W_=()=>he({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),vn=(i,...n)=>fi(this,[i,...n],function*(t,e={}){const s=yield fetch(t,e).catch(()=>{}),o=yield s==null?void 0:s.json().catch(()=>{});return(s==null?void 0:s.status)!==200&&Xt(`Failed to fetch ${t}`,Ji(Jt({},e),{responseStatus:s==null?void 0:s.status,responseJson:o})),o}),j_=(t,e)=>vn(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class M_{constructor(e,i,n){Ve(this,Ys);this.baseUrl=M(this,Ys,$r).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return fi(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield vn(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return fi(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,s="actioncable-v1-json";this.webSocket=new WebSocket(n,s),this.webSocket.onmessage=o=>e(JSON.parse(o.data)),this.webSocket.onerror=i,yield new Promise(o=>this.webSocket.onopen=o)})}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)}}Ys=new WeakSet,$r=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let kn;const z_=(t,e,i,n)=>fi(this,null,function*(){!t||!e||!i||(kn==null||kn.destroy(),kn=new M_(t,e,i),yield kn.getWebSocketToken(),yield kn.establishConnection(O_(n),L_),yield kn.subscribeToStatusChanges())}),O_=t=>e=>{var s,o;((o=(s=e==null?void 0:e.message)==null?void 0:s.result)==null?void 0:o.action)==="podcast_state_updated"&&E_(e,t),e.type==="reject_subscription"&&x_(e)},E_=(t,e)=>{const i=t.message.result;e(he({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}))},x_=t=>{Xt("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},L_=t=>{Xt("Unexpected WebSocket error.",{error:t})},hr=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},Os=t=>{const i=Object.keys(t.$$.props).filter(n=>!N_.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},N_=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),_r=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const s of i){const o=t[s],l=e[s];o!==l&&(n[s]={previousValue:o,currentValue:l})}return n};let es=-1;const mr=[],D_=(t,e,i)=>fi(this,null,function*(){yield hr(()=>e.player);const n=e.player,s=R_(n.contentIndex,i,t);s>es&&U_(n,es,s,t),s<es&&F_(n,es,s),es=s}),R_=(t,e,i)=>{const n=i.findIndex(o=>o[0]===t&&o[1]>e||o[0]>t);return n===-1?i.length-1:n-1},U_=(t,e,i,n)=>{for(let s=e+1;s<=i;s+=1){const o=Os(t);n[s][2](t);const l=Os(t),r=_r(o,l);mr.push(r)}},F_=(t,e,i)=>{for(let n=e;n>i;n-=1){const s=mr.pop();for(const[o,l]of Object.entries(s))t[o]=l.previousValue}},q_=t=>t?H_(t)?{newTarget:Z_(t),showUserInterface:!0}:typeof t=="string"?{newTarget:No(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:Y_(),showUserInterface:!1},H_=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",Y_=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},Z_=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},No=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&Xt(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&Xt(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]};function yr(t,e,i){const n=t.slice();return n[143]=e[i],n}function br(t){let e,i,n={onEvent:t[56],playerStyle:t[62],callToAction:t[22],skipButtonStyle:t[23],playlistStyle:t[24],playlistToggle:t[25],downloadFormats:t[47],playerTitle:t[21],content:t[48],contentIndex:t[27],duration:t[29],currentTime:t[10],playbackState:t[30],playbackRate:t[31],activeAdvert:t[59],persistentAdvert:t[66],textColor:t[34],backgroundColor:t[35],iconColor:t[36],videoTextColor:t[51],videoBackgroundColor:t[52],videoIconColor:t[53],logoIconEnabled:t[37],videoIsBehind:t[65]};return e=new Mo({props:n}),t[97](e),{c(){ue(e.$$.fragment)},m(s,o){ae(e,s,o),i=!0},p(s,o){const l={};o[2]&1&&(l.playerStyle=s[62]),o[0]&4194304&&(l.callToAction=s[22]),o[0]&8388608&&(l.skipButtonStyle=s[23]),o[0]&16777216&&(l.playlistStyle=s[24]),o[0]&33554432&&(l.playlistToggle=s[25]),o[1]&65536&&(l.downloadFormats=s[47]),o[0]&2097152&&(l.playerTitle=s[21]),o[1]&131072&&(l.content=s[48]),o[0]&134217728&&(l.contentIndex=s[27]),o[0]&536870912&&(l.duration=s[29]),o[0]&1024&&(l.currentTime=s[10]),o[0]&1073741824&&(l.playbackState=s[30]),o[1]&1&&(l.playbackRate=s[31]),o[1]&268435456&&(l.activeAdvert=s[59]),o[2]&16&&(l.persistentAdvert=s[66]),o[1]&8&&(l.textColor=s[34]),o[1]&16&&(l.backgroundColor=s[35]),o[1]&32&&(l.iconColor=s[36]),o[1]&1048576&&(l.videoTextColor=s[51]),o[1]&2097152&&(l.videoBackgroundColor=s[52]),o[1]&4194304&&(l.videoIconColor=s[53]),o[1]&64&&(l.logoIconEnabled=s[37]),o[2]&8&&(l.videoIsBehind=s[65]),e.$set(l)},i(s){i||(P(e.$$.fragment,s),i=!0)},o(s){V(e.$$.fragment,s),i=!1},d(s){t[97](null),ce(e,s)}}}function vr(t){let e,i;return e=new zo({props:{root:t[12],$$slots:{default:[K_]},$$scope:{ctx:t}}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[0]&4096&&(o.root=n[12]),s[0]&1759517696|s[1]&1349722239|s[2]&16|s[4]&4194304&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function K_(t){let e,i,n={onEvent:t[56],playerStyle:t[11],callToAction:t[22],skipButtonStyle:t[23],playlistStyle:"hide",playlistToggle:"hide",downloadFormats:t[47],playerTitle:t[21],fixedPosition:!t[12]&&t[32],fixedWidth:t[33],content:t[48],contentIndex:t[27],duration:t[29],currentTime:t[10],playbackState:t[30],playbackRate:t[31],activeAdvert:t[59],persistentAdvert:t[66],textColor:t[34],backgroundColor:t[35],iconColor:t[36],videoTextColor:t[51],videoBackgroundColor:t[52],videoIconColor:t[53],logoIconEnabled:t[37],videoIsBehind:t[61]};return e=new Mo({props:n}),t[98](e),{c(){ue(e.$$.fragment)},m(s,o){ae(e,s,o),i=!0},p(s,o){const l={};o[0]&2048&&(l.playerStyle=s[11]),o[0]&4194304&&(l.callToAction=s[22]),o[0]&8388608&&(l.skipButtonStyle=s[23]),o[1]&65536&&(l.downloadFormats=s[47]),o[0]&2097152&&(l.playerTitle=s[21]),o[0]&4096|o[1]&2&&(l.fixedPosition=!s[12]&&s[32]),o[1]&4&&(l.fixedWidth=s[33]),o[1]&131072&&(l.content=s[48]),o[0]&134217728&&(l.contentIndex=s[27]),o[0]&536870912&&(l.duration=s[29]),o[0]&1024&&(l.currentTime=s[10]),o[0]&1073741824&&(l.playbackState=s[30]),o[1]&1&&(l.playbackRate=s[31]),o[1]&268435456&&(l.activeAdvert=s[59]),o[2]&16&&(l.persistentAdvert=s[66]),o[1]&8&&(l.textColor=s[34]),o[1]&16&&(l.backgroundColor=s[35]),o[1]&32&&(l.iconColor=s[36]),o[1]&1048576&&(l.videoTextColor=s[51]),o[1]&2097152&&(l.videoBackgroundColor=s[52]),o[1]&4194304&&(l.videoIconColor=s[53]),o[1]&64&&(l.logoIconEnabled=s[37]),o[1]&1073741824&&(l.videoIsBehind=s[61]),e.$set(l)},i(s){i||(P(e.$$.fragment,s),i=!0)},o(s){V(e.$$.fragment,s),i=!1},d(s){t[98](null),ce(e,s)}}}function J_(t){let e,i;return e=new Mo({props:{onEvent:t[99],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[48],contentIndex:t[27],duration:t[29],currentTime:t[63]?t[10]:t[57].startTime,playbackState:t[63]?t[30]:"paused",activeAdvert:t[59],persistentAdvert:t[66],textColor:t[34],backgroundColor:t[35],iconColor:t[36],videoTextColor:t[51],videoBackgroundColor:t[52],videoIconColor:t[53]}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[1]&603979776&&(o.onEvent=n[99]),s[1]&131072&&(o.content=n[48]),s[0]&134217728&&(o.contentIndex=n[27]),s[0]&536870912&&(o.duration=n[29]),s[0]&1024|s[1]&67108864|s[2]&2&&(o.currentTime=n[63]?n[10]:n[57].startTime),s[0]&1073741824|s[2]&2&&(o.playbackState=n[63]?n[30]:"paused"),s[1]&268435456&&(o.activeAdvert=n[59]),s[2]&16&&(o.persistentAdvert=n[66]),s[1]&8&&(o.textColor=n[34]),s[1]&16&&(o.backgroundColor=n[35]),s[1]&32&&(o.iconColor=n[36]),s[1]&1048576&&(o.videoTextColor=n[51]),s[1]&2097152&&(o.videoBackgroundColor=n[52]),s[1]&4194304&&(o.videoIconColor=n[53]),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function kr(t,e){let i,n,s;return n=new zo({props:{root:e[143],$$slots:{default:[J_]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=$i(),ue(n.$$.fragment),this.first=i},m(o,l){I(o,i,l),ae(n,o,l),s=!0},p(o,l){e=o;const r={};l[1]&32768&&(r.root=e[143]),l[0]&1744831488|l[1]&879886392|l[2]&18|l[4]&4194304&&(r.$$scope={dirty:l,ctx:e}),n.$set(r)},i(o){s||(P(n.$$.fragment,o),s=!0)},o(o){V(n.$$.fragment,o),s=!1},d(o){o&&A(i),ce(n,o)}}}function pr(t){let e,i;return e=new zo({props:{root:t[20],$$slots:{default:[G_]},$$scope:{ctx:t}}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[0]&1048576&&(o.root=n[20]),s[0]&2146435071|s[1]&919551|s[4]&4194304&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function G_(t){let e,i,n,s,o,l,r,a,u,c,h,y,k,_,b,p,O,z,de,X,x,D,U,N,J,ge,pe,ee,G,Y,v,w,q,se,te,B,F,Te,Se,Ye,Ce,Q,_e;function qe(S){t[100](S)}function He(S){t[101](S)}function tt(S){t[102](S)}function De(S){t[103](S)}function it(S){t[104](S)}function vt(S){t[105](S)}function Ie(S){t[106](S)}function Ze(S){t[107](S)}function Oe(S){t[108](S)}function Re(S){t[109](S)}function kt(S){t[110](S)}function ht(S){t[111](S)}function ct(S){t[112](S)}function Ke(S){t[113](S)}function Ae(S){t[114](S)}function Ue(S){t[115](S)}function Qe(S){t[116](S)}function ot(S){t[117](S)}function ze(S){t[118](S)}function R(S){t[119](S)}function Je(S){t[120](S)}function Ee(S){t[121](S)}function pt(S){t[122](S)}function lt(S){t[123](S)}function Ct(S){t[124](S)}function St(S){t[125](S)}function $e(S){t[126](S)}function Ge(S){t[127](S)}function _t(S){t[128](S)}function et(S){t[129](S)}function At(S){t[130](S)}function Bt(S){t[131](S)}function zt(S){t[132](S)}function Vt(S){t[133](S)}function nt(S){t[134](S)}function Xe(S){t[135](S)}function ut(S){t[136](S)}function dt(S){t[137](S)}function H(S){t[138](S)}function rt(S){t[139](S)}function Ut(S){t[140](S)}let oe={content:t[48],introsOutros:t[49],adverts:t[50]};return t[0]!==void 0&&(oe.projectId=t[0]),t[1]!==void 0&&(oe.contentId=t[1]),t[2]!==void 0&&(oe.playlistId=t[2]),t[3]!==void 0&&(oe.sourceId=t[3]),t[4]!==void 0&&(oe.sourceUrl=t[4]),t[5]!==void 0&&(oe.showUserInterface=t[5]),t[6]!==void 0&&(oe.playerStyle=t[6]),t[21]!==void 0&&(oe.playerTitle=t[21]),t[22]!==void 0&&(oe.callToAction=t[22]),t[23]!==void 0&&(oe.skipButtonStyle=t[23]),t[24]!==void 0&&(oe.playlistStyle=t[24]),t[25]!==void 0&&(oe.playlistToggle=t[25]),t[26]!==void 0&&(oe.mediaSession=t[26]),t[27]!==void 0&&(oe.contentIndex=t[27]),t[7]!==void 0&&(oe.introsOutrosIndex=t[7]),t[8]!==void 0&&(oe.advertIndex=t[8]),t[28]!==void 0&&(oe.persistentAdImage=t[28]),t[9]!==void 0&&(oe.persistentIndex=t[9]),t[29]!==void 0&&(oe.duration=t[29]),t[10]!==void 0&&(oe.currentTime=t[10]),t[30]!==void 0&&(oe.playbackState=t[30]),t[31]!==void 0&&(oe.playbackRate=t[31]),t[11]!==void 0&&(oe.widgetStyle=t[11]),t[32]!==void 0&&(oe.widgetPosition=t[32]),t[33]!==void 0&&(oe.widgetWidth=t[33]),t[12]!==void 0&&(oe.widgetTarget=t[12]),t[34]!==void 0&&(oe.textColor=t[34]),t[35]!==void 0&&(oe.backgroundColor=t[35]),t[36]!==void 0&&(oe.iconColor=t[36]),t[13]!==void 0&&(oe.highlightColor=t[13]),t[37]!==void 0&&(oe.logoIconEnabled=t[37]),t[14]!==void 0&&(oe.highlightSections=t[14]),t[15]!==void 0&&(oe.clickableSections=t[15]),t[16]!==void 0&&(oe.segmentWidgetSections=t[16]),t[17]!==void 0&&(oe.segmentWidgetPosition=t[17]),t[18]!==void 0&&(oe.currentSegment=t[18]),t[19]!==void 0&&(oe.hoveredSegment=t[19]),t[38]!==void 0&&(oe.advertConsent=t[38]),t[39]!==void 0&&(oe.analyticsConsent=t[39]),t[40]!==void 0&&(oe.analyticsCustomUrl=t[40]),t[41]!==void 0&&(oe.analyticsTag=t[41]),e=new g_({props:oe}),ie.push(()=>ye(e,"projectId",qe)),ie.push(()=>ye(e,"contentId",He)),ie.push(()=>ye(e,"playlistId",tt)),ie.push(()=>ye(e,"sourceId",De)),ie.push(()=>ye(e,"sourceUrl",it)),ie.push(()=>ye(e,"showUserInterface",vt)),ie.push(()=>ye(e,"playerStyle",Ie)),ie.push(()=>ye(e,"playerTitle",Ze)),ie.push(()=>ye(e,"callToAction",Oe)),ie.push(()=>ye(e,"skipButtonStyle",Re)),ie.push(()=>ye(e,"playlistStyle",kt)),ie.push(()=>ye(e,"playlistToggle",ht)),ie.push(()=>ye(e,"mediaSession",ct)),ie.push(()=>ye(e,"contentIndex",Ke)),ie.push(()=>ye(e,"introsOutrosIndex",Ae)),ie.push(()=>ye(e,"advertIndex",Ue)),ie.push(()=>ye(e,"persistentAdImage",Qe)),ie.push(()=>ye(e,"persistentIndex",ot)),ie.push(()=>ye(e,"duration",ze)),ie.push(()=>ye(e,"currentTime",R)),ie.push(()=>ye(e,"playbackState",Je)),ie.push(()=>ye(e,"playbackRate",Ee)),ie.push(()=>ye(e,"widgetStyle",pt)),ie.push(()=>ye(e,"widgetPosition",lt)),ie.push(()=>ye(e,"widgetWidth",Ct)),ie.push(()=>ye(e,"widgetTarget",St)),ie.push(()=>ye(e,"textColor",$e)),ie.push(()=>ye(e,"backgroundColor",Ge)),ie.push(()=>ye(e,"iconColor",_t)),ie.push(()=>ye(e,"highlightColor",et)),ie.push(()=>ye(e,"logoIconEnabled",At)),ie.push(()=>ye(e,"highlightSections",Bt)),ie.push(()=>ye(e,"clickableSections",zt)),ie.push(()=>ye(e,"segmentWidgetSections",Vt)),ie.push(()=>ye(e,"segmentWidgetPosition",nt)),ie.push(()=>ye(e,"currentSegment",Xe)),ie.push(()=>ye(e,"hoveredSegment",ut)),ie.push(()=>ye(e,"advertConsent",dt)),ie.push(()=>ye(e,"analyticsConsent",H)),ie.push(()=>ye(e,"analyticsCustomUrl",rt)),ie.push(()=>ye(e,"analyticsTag",Ut)),{c(){ue(e.$$.fragment)},m(S,T){ae(e,S,T),_e=!0},p(S,T){const ne={};T[1]&131072&&(ne.content=S[48]),T[1]&262144&&(ne.introsOutros=S[49]),T[1]&524288&&(ne.adverts=S[50]),!i&&T[0]&1&&(i=!0,ne.projectId=S[0],me(()=>i=!1)),!n&&T[0]&2&&(n=!0,ne.contentId=S[1],me(()=>n=!1)),!s&&T[0]&4&&(s=!0,ne.playlistId=S[2],me(()=>s=!1)),!o&&T[0]&8&&(o=!0,ne.sourceId=S[3],me(()=>o=!1)),!l&&T[0]&16&&(l=!0,ne.sourceUrl=S[4],me(()=>l=!1)),!r&&T[0]&32&&(r=!0,ne.showUserInterface=S[5],me(()=>r=!1)),!a&&T[0]&64&&(a=!0,ne.playerStyle=S[6],me(()=>a=!1)),!u&&T[0]&2097152&&(u=!0,ne.playerTitle=S[21],me(()=>u=!1)),!c&&T[0]&4194304&&(c=!0,ne.callToAction=S[22],me(()=>c=!1)),!h&&T[0]&8388608&&(h=!0,ne.skipButtonStyle=S[23],me(()=>h=!1)),!y&&T[0]&16777216&&(y=!0,ne.playlistStyle=S[24],me(()=>y=!1)),!k&&T[0]&33554432&&(k=!0,ne.playlistToggle=S[25],me(()=>k=!1)),!_&&T[0]&67108864&&(_=!0,ne.mediaSession=S[26],me(()=>_=!1)),!b&&T[0]&134217728&&(b=!0,ne.contentIndex=S[27],me(()=>b=!1)),!p&&T[0]&128&&(p=!0,ne.introsOutrosIndex=S[7],me(()=>p=!1)),!O&&T[0]&256&&(O=!0,ne.advertIndex=S[8],me(()=>O=!1)),!z&&T[0]&268435456&&(z=!0,ne.persistentAdImage=S[28],me(()=>z=!1)),!de&&T[0]&512&&(de=!0,ne.persistentIndex=S[9],me(()=>de=!1)),!X&&T[0]&536870912&&(X=!0,ne.duration=S[29],me(()=>X=!1)),!x&&T[0]&1024&&(x=!0,ne.currentTime=S[10],me(()=>x=!1)),!D&&T[0]&1073741824&&(D=!0,ne.playbackState=S[30],me(()=>D=!1)),!U&&T[1]&1&&(U=!0,ne.playbackRate=S[31],me(()=>U=!1)),!N&&T[0]&2048&&(N=!0,ne.widgetStyle=S[11],me(()=>N=!1)),!J&&T[1]&2&&(J=!0,ne.widgetPosition=S[32],me(()=>J=!1)),!ge&&T[1]&4&&(ge=!0,ne.widgetWidth=S[33],me(()=>ge=!1)),!pe&&T[0]&4096&&(pe=!0,ne.widgetTarget=S[12],me(()=>pe=!1)),!ee&&T[1]&8&&(ee=!0,ne.textColor=S[34],me(()=>ee=!1)),!G&&T[1]&16&&(G=!0,ne.backgroundColor=S[35],me(()=>G=!1)),!Y&&T[1]&32&&(Y=!0,ne.iconColor=S[36],me(()=>Y=!1)),!v&&T[0]&8192&&(v=!0,ne.highlightColor=S[13],me(()=>v=!1)),!w&&T[1]&64&&(w=!0,ne.logoIconEnabled=S[37],me(()=>w=!1)),!q&&T[0]&16384&&(q=!0,ne.highlightSections=S[14],me(()=>q=!1)),!se&&T[0]&32768&&(se=!0,ne.clickableSections=S[15],me(()=>se=!1)),!te&&T[0]&65536&&(te=!0,ne.segmentWidgetSections=S[16],me(()=>te=!1)),!B&&T[0]&131072&&(B=!0,ne.segmentWidgetPosition=S[17],me(()=>B=!1)),!F&&T[0]&262144&&(F=!0,ne.currentSegment=S[18],me(()=>F=!1)),!Te&&T[0]&524288&&(Te=!0,ne.hoveredSegment=S[19],me(()=>Te=!1)),!Se&&T[1]&128&&(Se=!0,ne.advertConsent=S[38],me(()=>Se=!1)),!Ye&&T[1]&256&&(Ye=!0,ne.analyticsConsent=S[39],me(()=>Ye=!1)),!Ce&&T[1]&512&&(Ce=!0,ne.analyticsCustomUrl=S[40],me(()=>Ce=!1)),!Q&&T[1]&1024&&(Q=!0,ne.analyticsTag=S[41],me(()=>Q=!1)),e.$set(ne)},i(S){_e||(P(e.$$.fragment,S),_e=!0)},o(S){V(e.$$.fragment,S),_e=!1},d(S){ce(e,S)}}}function Sr(t){let e,i;return e=new P_({props:{onEvent:t[56],content:t[48],contentIndex:t[27],activeAdvert:t[59],persistentAdvert:t[66],duration:t[29],playbackState:t[30],skipButtonStyle:t[23],backgroundColor:t[35],iconColor:t[36]}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[1]&131072&&(o.content=n[48]),s[0]&134217728&&(o.contentIndex=n[27]),s[1]&268435456&&(o.activeAdvert=n[59]),s[2]&16&&(o.persistentAdvert=n[66]),s[0]&536870912&&(o.duration=n[29]),s[0]&1073741824&&(o.playbackState=n[30]),s[0]&8388608&&(o.skipButtonStyle=n[23]),s[1]&16&&(o.backgroundColor=n[35]),s[1]&32&&(o.iconColor=n[36]),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function wr(t){let e,i;return e=new I_({props:{analyticsTag:t[41]}}),{c(){ue(e.$$.fragment)},m(n,s){ae(e,n,s),i=!0},p(n,s){const o={};s[1]&1024&&(o.analyticsTag=n[41]),e.$set(o)},i(n){i||(P(e.$$.fragment,n),i=!0)},o(n){V(e.$$.fragment,n),i=!1},d(n){ce(e,n)}}}function X_(t){let e,i,n,s,o,l,r,a,u,c=[],h=new Map,y,k,_,b,p,O;function z(v){t[92](v)}function de(v){t[93](v)}function X(v){t[94](v)}function x(v){t[95](v)}function D(v){t[96](v)}let U={onEvent:t[56],content:t[48],contentIndex:t[27],introOrOutro:t[58],activeAdvert:t[59],advertConsent:t[38],videoBehindWidget:t[61],videoBehindStatic:t[65],videoMightBeShown:t[64],widgetPosition:t[32],widgetWidth:t[33]};t[30]!==void 0&&(U.playbackState=t[30]),t[29]!==void 0&&(U.duration=t[29]),t[10]!==void 0&&(U.currentTime=t[10]),t[31]!==void 0&&(U.playbackRate=t[31]),t[45]!==void 0&&(U.prevPercentage=t[45]),e=new kd({props:U}),t[91](e),ie.push(()=>ye(e,"playbackState",z)),ie.push(()=>ye(e,"duration",de)),ie.push(()=>ye(e,"currentTime",X)),ie.push(()=>ye(e,"playbackRate",x)),ie.push(()=>ye(e,"prevPercentage",D));let N=t[5]&&br(t),J=(t[54]||t[12])&&vr(t),ge=Et(t[46]);const pe=v=>v[143];for(let v=0;v<ge.length;v+=1){let w=yr(t,ge,v),q=pe(w);h.set(q,c[v]=kr(q,w))}let ee=t[20]&&pr(t),G=t[55]&&Sr(t),Y=t[41]&&wr(t);return p=new V_({}),{c(){ue(e.$$.fragment),r=K(),N&&N.c(),a=K(),J&&J.c(),u=K();for(let v=0;v<c.length;v+=1)c[v].c();y=K(),ee&&ee.c(),k=K(),G&&G.c(),_=K(),Y&&Y.c(),b=K(),ue(p.$$.fragment)},m(v,w){ae(e,v,w),I(v,r,w),N&&N.m(v,w),I(v,a,w),J&&J.m(v,w),I(v,u,w);for(let q=0;q<c.length;q+=1)c[q]&&c[q].m(v,w);I(v,y,w),ee&&ee.m(v,w),I(v,k,w),G&&G.m(v,w),I(v,_,w),Y&&Y.m(v,w),I(v,b,w),ae(p,v,w),O=!0},p(v,w){const q={};w[1]&131072&&(q.content=v[48]),w[0]&134217728&&(q.contentIndex=v[27]),w[1]&134217728&&(q.introOrOutro=v[58]),w[1]&268435456&&(q.activeAdvert=v[59]),w[1]&128&&(q.advertConsent=v[38]),w[1]&1073741824&&(q.videoBehindWidget=v[61]),w[2]&8&&(q.videoBehindStatic=v[65]),w[2]&4&&(q.videoMightBeShown=v[64]),w[1]&2&&(q.widgetPosition=v[32]),w[1]&4&&(q.widgetWidth=v[33]),!i&&w[0]&1073741824&&(i=!0,q.playbackState=v[30],me(()=>i=!1)),!n&&w[0]&536870912&&(n=!0,q.duration=v[29],me(()=>n=!1)),!s&&w[0]&1024&&(s=!0,q.currentTime=v[10],me(()=>s=!1)),!o&&w[1]&1&&(o=!0,q.playbackRate=v[31],me(()=>o=!1)),!l&&w[1]&16384&&(l=!0,q.prevPercentage=v[45],me(()=>l=!1)),e.$set(q),v[5]?N?(N.p(v,w),w[0]&32&&P(N,1)):(N=br(v),N.c(),P(N,1),N.m(a.parentNode,a)):N&&(xe(),V(N,1,1,()=>{N=null}),Le()),v[54]||v[12]?J?(J.p(v,w),w[0]&4096|w[1]&8388608&&P(J,1)):(J=vr(v),J.c(),P(J,1),J.m(u.parentNode,u)):J&&(xe(),V(J,1,1,()=>{J=null}),Le()),w[0]&1744831488|w[1]&913473592|w[2]&18&&(ge=Et(v[46]),xe(),c=Ma(c,w,pe,1,v,ge,h,y.parentNode,ja,kr,y,yr),Le()),v[20]?ee?(ee.p(v,w),w[0]&1048576&&P(ee,1)):(ee=pr(v),ee.c(),P(ee,1),ee.m(k.parentNode,k)):ee&&(xe(),V(ee,1,1,()=>{ee=null}),Le()),v[55]?G?(G.p(v,w),w[1]&16777216&&P(G,1)):(G=Sr(v),G.c(),P(G,1),G.m(_.parentNode,_)):G&&(xe(),V(G,1,1,()=>{G=null}),Le()),v[41]?Y?(Y.p(v,w),w[1]&1024&&P(Y,1)):(Y=wr(v),Y.c(),P(Y,1),Y.m(b.parentNode,b)):Y&&(xe(),V(Y,1,1,()=>{Y=null}),Le())},i(v){if(!O){P(e.$$.fragment,v),P(N),P(J);for(let w=0;w<ge.length;w+=1)P(c[w]);P(ee),P(G),P(Y),P(p.$$.fragment,v),O=!0}},o(v){V(e.$$.fragment,v),V(N),V(J);for(let w=0;w<c.length;w+=1)V(c[w]);V(ee),V(G),V(Y),V(p.$$.fragment,v),O=!1},d(v){v&&(A(r),A(a),A(u),A(y),A(k),A(_),A(b)),t[91](null),ce(e,v),N&&N.d(v),J&&J.d(v);for(let w=0;w<c.length;w+=1)c[w].d(v);ee&&ee.d(v),G&&G.d(v),Y&&Y.d(v),ce(p,v)}}}function Q_(t,e,i){let n,s,o,l,r,a,u,c,h,y,k,_,b,p,{playerApiUrl:O="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:z=void 0}=e,{contentId:de=void 0}=e,{playlistId:X=void 0}=e,{sourceId:x=void 0}=e,{sourceUrl:D=void 0}=e,{playlist:U=[]}=e,{showUserInterface:N=!0}=e,{playerStyle:J="standard"}=e,{playerTitle:ge=void 0}=e,{callToAction:pe=void 0}=e,{skipButtonStyle:ee="auto"}=e,{playlistStyle:G="auto-5-4"}=e,{playlistToggle:Y="auto"}=e,{downloadFormats:v=[]}=e,{mediaSession:w="auto"}=e,{content:q=[]}=e,{contentIndex:se=0}=e,{introsOutros:te=[]}=e,{introsOutrosIndex:B=-1}=e,{adverts:F=[]}=e,{advertIndex:Te=-1}=e,{persistentAdImage:Se=!1}=e,{persistentIndex:Ye=-1}=e,{duration:Ce=0}=e,{currentTime:Q=0}=e,{playbackState:_e="stopped"}=e,{playbackRate:qe=1}=e,{playbackRates:He=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3]}=e,{widgetStyle:tt="standard"}=e,{widgetPosition:De="auto"}=e,{widgetWidth:it="auto"}=e,{widgetTarget:vt=void 0}=e,{textColor:Ie="#111"}=e,{backgroundColor:Ze="#f5f5f5"}=e,{iconColor:Oe="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:Re="#eee"}=e,{videoTextColor:kt="white"}=e,{videoBackgroundColor:ht="black"}=e,{videoIconColor:ct="white"}=e,{logoIconEnabled:Ke=!0}=e,{highlightSections:Ae="all"}=e,{clickableSections:Ue="all"}=e,{segmentWidgetSections:Qe="body"}=e,{segmentWidgetPosition:ot="7-oclock"}=e,{currentSegment:ze=void 0}=e,{hoveredSegment:R=void 0}=e,{loadedMedia:Je=void 0}=e,{advertConsent:Ee="personalized"}=e,{analyticsConsent:pt="allowed"}=e,{analyticsCustomUrl:lt=void 0}=e,{analyticsTag:Ct=void 0}=e,{writeToken:St=void 0}=e,{captureErrors:$e=!0}=e,{onError:Ge=()=>{}}=e,{transitions:_t=[]}=e,{controlPanel:et=void 0}=e;const At=(...g)=>rt.addEventListener(...g),Bt=(...g)=>rt.removeEventListener(...g);let{initialProps:zt={}}=e,{showBottomWidget:Vt=!1}=e,{showMediaSession:nt=!1}=e,{isFullScreen:Xe=!1}=e,{mediaElement:ut=void 0}=e,{userInterface:dt=void 0}=e,{widgetInterface:H=void 0}=e,{controller:rt=void 0}=e,{analyticsUrl:Ut=void 0}=e,{analyticsId:oe=void 0}=e,{listenSessionId:S=void 0}=e,{sessionCreatedAt:T=void 0}=e,{isNewListen:ne=!1}=e,{prevPercentage:ki=0}=e,{segmentWidgets:Zt=[]}=e,{segmentContainers:Ki=new Lo(g=>i(46,Zt=g))}=e,{segmentClickables:at=new xo}=e,{segmentHighlights:li=new Eo}=e;const Ft=g=>rt.processEvent(Jt({emittedFrom:r},g)),pi=()=>i(89,h=R);function Qt(g){ie[g?"unshift":"push"](()=>{ut=g,i(42,ut)})}function Si(g){_e=g,i(30,_e)}function xi(g){Ce=g,i(29,Ce)}function ri(g){Q=g,i(10,Q)}function $t(g){qe=g,i(31,qe)}function wi(g){ki=g,i(45,ki)}function Li(g){ie[g?"unshift":"push"](()=>{dt=g,i(43,dt)})}function ai(g){ie[g?"unshift":"push"](()=>{H=g,i(44,H)})}const Wt=g=>Ft(Ji(Jt({},g),{emittedFrom:"segment-widget",widgetSegment:_,widgetIsCurrent:b}));function Pi(g){z=g,i(0,z)}function ei(g){de=g,i(1,de)}function gt(g){X=g,i(2,X)}function ti(g){x=g,i(3,x)}function ft(g){D=g,i(4,D)}function Ti(g){N=g,i(5,N)}function mt(g){J=g,i(6,J)}function W(g){ge=g,i(21,ge)}function Z(g){pe=g,i(22,pe)}function le(g){ee=g,i(23,ee)}function qt(g){G=g,i(24,G)}function rn(g){Y=g,i(25,Y)}function an(g){w=g,i(26,w)}function cn(g){se=g,i(27,se)}function oo(g){B=g,i(7,B)}function wn(g){Te=g,i(8,Te)}function lo(g){Se=g,i(28,Se)}function ii(g){Ye=g,i(9,Ye)}function un(g){Ce=g,i(29,Ce)}function dn(g){Q=g,i(10,Q)}function gn(g){_e=g,i(30,_e)}function fn(g){qe=g,i(31,qe)}function hn(g){tt=g,i(11,tt)}function ro(g){De=g,i(32,De)}function Pn(g){it=g,i(33,it)}function ao(g){vt=g,i(12,vt)}function Ci(g){Ie=g,i(34,Ie)}function co(g){Ze=g,i(35,Ze)}function us(g){Oe=g,i(36,Oe)}function uo(g){Re=g,i(13,Re)}function go(g){Ke=g,i(37,Ke)}function ds(g){Ae=g,i(14,Ae)}function fo(g){Ue=g,i(15,Ue)}function _n(g){Qe=g,i(16,Qe)}function Ht(g){ot=g,i(17,ot)}function qo(g){ze=g,i(18,ze)}function Tn(g){R=g,i(19,R)}function Kt(g){Ee=g,i(38,Ee)}function ho(g){pt=g,i(39,pt)}function Fn(g){lt=g,i(40,lt)}function mi(g){Ct=g,i(41,Ct)}return t.$$set=g=>{"playerApiUrl"in g&&i(67,O=g.playerApiUrl),"projectId"in g&&i(0,z=g.projectId),"contentId"in g&&i(1,de=g.contentId),"playlistId"in g&&i(2,X=g.playlistId),"sourceId"in g&&i(3,x=g.sourceId),"sourceUrl"in g&&i(4,D=g.sourceUrl),"playlist"in g&&i(68,U=g.playlist),"showUserInterface"in g&&i(5,N=g.showUserInterface),"playerStyle"in g&&i(6,J=g.playerStyle),"playerTitle"in g&&i(21,ge=g.playerTitle),"callToAction"in g&&i(22,pe=g.callToAction),"skipButtonStyle"in g&&i(23,ee=g.skipButtonStyle),"playlistStyle"in g&&i(24,G=g.playlistStyle),"playlistToggle"in g&&i(25,Y=g.playlistToggle),"downloadFormats"in g&&i(47,v=g.downloadFormats),"mediaSession"in g&&i(26,w=g.mediaSession),"content"in g&&i(48,q=g.content),"contentIndex"in g&&i(27,se=g.contentIndex),"introsOutros"in g&&i(49,te=g.introsOutros),"introsOutrosIndex"in g&&i(7,B=g.introsOutrosIndex),"adverts"in g&&i(50,F=g.adverts),"advertIndex"in g&&i(8,Te=g.advertIndex),"persistentAdImage"in g&&i(28,Se=g.persistentAdImage),"persistentIndex"in g&&i(9,Ye=g.persistentIndex),"duration"in g&&i(29,Ce=g.duration),"currentTime"in g&&i(10,Q=g.currentTime),"playbackState"in g&&i(30,_e=g.playbackState),"playbackRate"in g&&i(31,qe=g.playbackRate),"playbackRates"in g&&i(69,He=g.playbackRates),"widgetStyle"in g&&i(11,tt=g.widgetStyle),"widgetPosition"in g&&i(32,De=g.widgetPosition),"widgetWidth"in g&&i(33,it=g.widgetWidth),"widgetTarget"in g&&i(12,vt=g.widgetTarget),"textColor"in g&&i(34,Ie=g.textColor),"backgroundColor"in g&&i(35,Ze=g.backgroundColor),"iconColor"in g&&i(36,Oe=g.iconColor),"highlightColor"in g&&i(13,Re=g.highlightColor),"videoTextColor"in g&&i(51,kt=g.videoTextColor),"videoBackgroundColor"in g&&i(52,ht=g.videoBackgroundColor),"videoIconColor"in g&&i(53,ct=g.videoIconColor),"logoIconEnabled"in g&&i(37,Ke=g.logoIconEnabled),"highlightSections"in g&&i(14,Ae=g.highlightSections),"clickableSections"in g&&i(15,Ue=g.clickableSections),"segmentWidgetSections"in g&&i(16,Qe=g.segmentWidgetSections),"segmentWidgetPosition"in g&&i(17,ot=g.segmentWidgetPosition),"currentSegment"in g&&i(18,ze=g.currentSegment),"hoveredSegment"in g&&i(19,R=g.hoveredSegment),"loadedMedia"in g&&i(70,Je=g.loadedMedia),"advertConsent"in g&&i(38,Ee=g.advertConsent),"analyticsConsent"in g&&i(39,pt=g.analyticsConsent),"analyticsCustomUrl"in g&&i(40,lt=g.analyticsCustomUrl),"analyticsTag"in g&&i(41,Ct=g.analyticsTag),"writeToken"in g&&i(71,St=g.writeToken),"captureErrors"in g&&i(72,$e=g.captureErrors),"onError"in g&&i(73,Ge=g.onError),"transitions"in g&&i(74,_t=g.transitions),"controlPanel"in g&&i(20,et=g.controlPanel),"initialProps"in g&&i(77,zt=g.initialProps),"showBottomWidget"in g&&i(54,Vt=g.showBottomWidget),"showMediaSession"in g&&i(55,nt=g.showMediaSession),"isFullScreen"in g&&i(78,Xe=g.isFullScreen),"mediaElement"in g&&i(42,ut=g.mediaElement),"userInterface"in g&&i(43,dt=g.userInterface),"widgetInterface"in g&&i(44,H=g.widgetInterface),"controller"in g&&i(79,rt=g.controller),"analyticsUrl"in g&&i(80,Ut=g.analyticsUrl),"analyticsId"in g&&i(81,oe=g.analyticsId),"listenSessionId"in g&&i(82,S=g.listenSessionId),"sessionCreatedAt"in g&&i(83,T=g.sessionCreatedAt),"isNewListen"in g&&i(84,ne=g.isNewListen),"prevPercentage"in g&&i(45,ki=g.prevPercentage),"segmentWidgets"in g&&i(46,Zt=g.segmentWidgets),"segmentContainers"in g&&i(85,Ki=g.segmentContainers),"segmentClickables"in g&&i(86,at=g.segmentClickables),"segmentHighlights"in g&&i(87,li=g.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&128|t.$$.dirty[1]&262144&&i(58,n=te[B]),t.$$.dirty[0]&256|t.$$.dirty[1]&524288&&i(59,s=F[Te]),t.$$.dirty[0]&512|t.$$.dirty[1]&524288&&i(66,o=F[Ye]),t.$$.dirty[0]&64|t.$$.dirty[2]&65536&&i(62,l=Xe?"video":J),t.$$.dirty[0]&2048|t.$$.dirty[1]&8388608|t.$$.dirty[2]&65536&&i(61,a=Vt&&tt==="video"&&!Xe),t.$$.dirty[1]&1073741824&&(r=a?"bottom-widget":"inline-player"),t.$$.dirty[0]&4096&&i(12,vt=No(vt,"widget")),t.$$.dirty[0]&1048576&&i(20,et=No(et,"control panel")),t.$$.dirty[0]&32|t.$$.dirty[1]&1073741824|t.$$.dirty[2]&1&&i(65,u=N&&l==="video"&&!a),t.$$.dirty[0]&2112&&i(64,c=J==="video"||tt==="video"),t.$$.dirty[0]&31|t.$$.dirty[2]&64&&Ft(W_()),t.$$.dirty[0]&1|t.$$.dirty[2]&544&&z_(O,z,St,g=>Ft(g)),t.$$.dirty[0]&524288|t.$$.dirty[2]&134217728&&i(89,h=R||h),t.$$.dirty[0]&327680&&i(88,y=$n("current",ze,Qe)),t.$$.dirty[0]&262144|t.$$.dirty[2]&67108864&&y&&pi(),t.$$.dirty[0]&65536|t.$$.dirty[2]&134217728&&i(90,k=$n("hovered",h,Qe)),t.$$.dirty[0]&262144|t.$$.dirty[2]&469762048&&i(57,_=k&&h||y&&ze),t.$$.dirty[0]&262144|t.$$.dirty[1]&67108864&&i(60,b=(_==null?void 0:_.marker)===(ze==null?void 0:ze.marker)),t.$$.dirty[1]&939524096&&i(63,p=b||s||n),t.$$.dirty[0]&196672|t.$$.dirty[1]&67108864|t.$$.dirty[2]&8388608&&Ki.update(_,Qe,ot,J),t.$$.dirty[0]&557056|t.$$.dirty[2]&16777216&&at.update(R,Ue),t.$$.dirty[0]&286720|t.$$.dirty[2]&33554432&&li.update("current",ze,Ae,Re),t.$$.dirty[0]&548864|t.$$.dirty[2]&33554432&&li.update("hovered",R,Ae,Re),t.$$.dirty[0]&1024|t.$$.dirty[2]&135168&&D_(_t,rt,Q)},[z,de,X,x,D,N,J,B,Te,Ye,Q,tt,vt,Re,Ae,Ue,Qe,ot,ze,R,et,ge,pe,ee,G,Y,w,se,Se,Ce,_e,qe,De,it,Ie,Ze,Oe,Ke,Ee,pt,lt,Ct,ut,dt,H,ki,Zt,v,q,te,F,kt,ht,ct,Vt,nt,Ft,_,n,s,b,a,l,p,c,u,o,O,U,He,Je,St,$e,Ge,_t,At,Bt,zt,Xe,rt,Ut,oe,S,T,ne,Ki,at,li,y,h,k,Qt,Si,xi,ri,$t,wi,Li,ai,Wt,Pi,ei,gt,ti,ft,Ti,mt,W,Z,le,qt,rn,an,cn,oo,wn,lo,ii,un,dn,gn,fn,hn,ro,Pn,ao,Ci,co,us,uo,go,ds,fo,_n,Ht,qo,Tn,Kt,ho,Fn,mi]}let $_=class extends ke{constructor(e){super(),ve(this,e,Q_,X_,fe,{playerApiUrl:67,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:68,showUserInterface:5,playerStyle:6,playerTitle:21,callToAction:22,skipButtonStyle:23,playlistStyle:24,playlistToggle:25,downloadFormats:47,mediaSession:26,content:48,contentIndex:27,introsOutros:49,introsOutrosIndex:7,adverts:50,advertIndex:8,persistentAdImage:28,persistentIndex:9,duration:29,currentTime:10,playbackState:30,playbackRate:31,playbackRates:69,widgetStyle:11,widgetPosition:32,widgetWidth:33,widgetTarget:12,textColor:34,backgroundColor:35,iconColor:36,highlightColor:13,videoTextColor:51,videoBackgroundColor:52,videoIconColor:53,logoIconEnabled:37,highlightSections:14,clickableSections:15,segmentWidgetSections:16,segmentWidgetPosition:17,currentSegment:18,hoveredSegment:19,loadedMedia:70,advertConsent:38,analyticsConsent:39,analyticsCustomUrl:40,analyticsTag:41,writeToken:71,captureErrors:72,onError:73,transitions:74,controlPanel:20,addEventListener:75,removeEventListener:76,initialProps:77,showBottomWidget:54,showMediaSession:55,isFullScreen:78,mediaElement:42,userInterface:43,widgetInterface:44,controller:79,analyticsUrl:80,analyticsId:81,listenSessionId:82,sessionCreatedAt:83,isNewListen:84,prevPercentage:45,segmentWidgets:46,segmentContainers:85,segmentClickables:86,segmentHighlights:87,onEvent:56},null,[-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[67]}set playerApiUrl(e){this.$$set({playerApiUrl:e}),d()}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),d()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),d()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),d()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),d()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),d()}get playlist(){return this.$$.ctx[68]}set playlist(e){this.$$set({playlist:e}),d()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),d()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),d()}get playerTitle(){return this.$$.ctx[21]}set playerTitle(e){this.$$set({playerTitle:e}),d()}get callToAction(){return this.$$.ctx[22]}set callToAction(e){this.$$set({callToAction:e}),d()}get skipButtonStyle(){return this.$$.ctx[23]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get playlistStyle(){return this.$$.ctx[24]}set playlistStyle(e){this.$$set({playlistStyle:e}),d()}get playlistToggle(){return this.$$.ctx[25]}set playlistToggle(e){this.$$set({playlistToggle:e}),d()}get downloadFormats(){return this.$$.ctx[47]}set downloadFormats(e){this.$$set({downloadFormats:e}),d()}get mediaSession(){return this.$$.ctx[26]}set mediaSession(e){this.$$set({mediaSession:e}),d()}get content(){return this.$$.ctx[48]}set content(e){this.$$set({content:e}),d()}get contentIndex(){return this.$$.ctx[27]}set contentIndex(e){this.$$set({contentIndex:e}),d()}get introsOutros(){return this.$$.ctx[49]}set introsOutros(e){this.$$set({introsOutros:e}),d()}get introsOutrosIndex(){return this.$$.ctx[7]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),d()}get adverts(){return this.$$.ctx[50]}set adverts(e){this.$$set({adverts:e}),d()}get advertIndex(){return this.$$.ctx[8]}set advertIndex(e){this.$$set({advertIndex:e}),d()}get persistentAdImage(){return this.$$.ctx[28]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),d()}get persistentIndex(){return this.$$.ctx[9]}set persistentIndex(e){this.$$set({persistentIndex:e}),d()}get duration(){return this.$$.ctx[29]}set duration(e){this.$$set({duration:e}),d()}get currentTime(){return this.$$.ctx[10]}set currentTime(e){this.$$set({currentTime:e}),d()}get playbackState(){return this.$$.ctx[30]}set playbackState(e){this.$$set({playbackState:e}),d()}get playbackRate(){return this.$$.ctx[31]}set playbackRate(e){this.$$set({playbackRate:e}),d()}get playbackRates(){return this.$$.ctx[69]}set playbackRates(e){this.$$set({playbackRates:e}),d()}get widgetStyle(){return this.$$.ctx[11]}set widgetStyle(e){this.$$set({widgetStyle:e}),d()}get widgetPosition(){return this.$$.ctx[32]}set widgetPosition(e){this.$$set({widgetPosition:e}),d()}get widgetWidth(){return this.$$.ctx[33]}set widgetWidth(e){this.$$set({widgetWidth:e}),d()}get widgetTarget(){return this.$$.ctx[12]}set widgetTarget(e){this.$$set({widgetTarget:e}),d()}get textColor(){return this.$$.ctx[34]}set textColor(e){this.$$set({textColor:e}),d()}get backgroundColor(){return this.$$.ctx[35]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[36]}set iconColor(e){this.$$set({iconColor:e}),d()}get highlightColor(){return this.$$.ctx[13]}set highlightColor(e){this.$$set({highlightColor:e}),d()}get videoTextColor(){return this.$$.ctx[51]}set videoTextColor(e){this.$$set({videoTextColor:e}),d()}get videoBackgroundColor(){return this.$$.ctx[52]}set videoBackgroundColor(e){this.$$set({videoBackgroundColor:e}),d()}get videoIconColor(){return this.$$.ctx[53]}set videoIconColor(e){this.$$set({videoIconColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[37]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[14]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[15]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[16]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[17]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get currentSegment(){return this.$$.ctx[18]}set currentSegment(e){this.$$set({currentSegment:e}),d()}get hoveredSegment(){return this.$$.ctx[19]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),d()}get loadedMedia(){return this.$$.ctx[70]}set loadedMedia(e){this.$$set({loadedMedia:e}),d()}get advertConsent(){return this.$$.ctx[38]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[39]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[40]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsTag(){return this.$$.ctx[41]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}get writeToken(){return this.$$.ctx[71]}set writeToken(e){this.$$set({writeToken:e}),d()}get captureErrors(){return this.$$.ctx[72]}set captureErrors(e){this.$$set({captureErrors:e}),d()}get onError(){return this.$$.ctx[73]}set onError(e){this.$$set({onError:e}),d()}get transitions(){return this.$$.ctx[74]}set transitions(e){this.$$set({transitions:e}),d()}get controlPanel(){return this.$$.ctx[20]}set controlPanel(e){this.$$set({controlPanel:e}),d()}get addEventListener(){return this.$$.ctx[75]}get removeEventListener(){return this.$$.ctx[76]}get initialProps(){return this.$$.ctx[77]}set initialProps(e){this.$$set({initialProps:e}),d()}get showBottomWidget(){return this.$$.ctx[54]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),d()}get showMediaSession(){return this.$$.ctx[55]}set showMediaSession(e){this.$$set({showMediaSession:e}),d()}get isFullScreen(){return this.$$.ctx[78]}set isFullScreen(e){this.$$set({isFullScreen:e}),d()}get mediaElement(){return this.$$.ctx[42]}set mediaElement(e){this.$$set({mediaElement:e}),d()}get userInterface(){return this.$$.ctx[43]}set userInterface(e){this.$$set({userInterface:e}),d()}get widgetInterface(){return this.$$.ctx[44]}set widgetInterface(e){this.$$set({widgetInterface:e}),d()}get controller(){return this.$$.ctx[79]}set controller(e){this.$$set({controller:e}),d()}get analyticsUrl(){return this.$$.ctx[80]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),d()}get analyticsId(){return this.$$.ctx[81]}set analyticsId(e){this.$$set({analyticsId:e}),d()}get listenSessionId(){return this.$$.ctx[82]}set listenSessionId(e){this.$$set({listenSessionId:e}),d()}get sessionCreatedAt(){return this.$$.ctx[83]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),d()}get isNewListen(){return this.$$.ctx[84]}set isNewListen(e){this.$$set({isNewListen:e}),d()}get prevPercentage(){return this.$$.ctx[45]}set prevPercentage(e){this.$$set({prevPercentage:e}),d()}get segmentWidgets(){return this.$$.ctx[46]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),d()}get segmentContainers(){return this.$$.ctx[85]}set segmentContainers(e){this.$$set({segmentContainers:e}),d()}get segmentClickables(){return this.$$.ctx[86]}set segmentClickables(e){this.$$set({segmentClickables:e}),d()}get segmentHighlights(){return this.$$.ctx[87]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),d()}get onEvent(){return this.$$.ctx[56]}};class e0{constructor(e,i){this.baseUrl=e==null?void 0:e.replace("{id}",i)}byContentId(e){return vn(`${this.baseUrl}/by_content_id/${e}`)}byPlaylistId(e){return vn(`${this.baseUrl}/by_playlist_id/${e}`)}bySourceId(e){return vn(`${this.baseUrl}/by_source_id/${e}`)}bySourceUrl(e){return vn(`${this.baseUrl}/by_source_url/${e}`)}byIdentifiers(e){return vn(`${this.baseUrl}/by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}const Do=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(Do):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),Do(i)])),Pr=t=>t==="dark"||t==="auto"&&t0()?"dark":"light",t0=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Tr=t=>fi(this,null,function*(){const e=new e0(t.playerApiUrl,t.projectId);if(!t.playerApiUrl||!t.projectId)return;const i=i0(t);if(i.length===0)return;const n=yield n0(e,i).catch(()=>{});if(!(n!=null&&n.content)){s0(t);return}o0(t,n)}),i0=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(...Do(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},n0=(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)},s0=t=>{Cr(t),Ar(t),Br(t),t.onEvent(he({type:"NoContentAvailable",description:"No published and processed content is available for the identifiers.",initiatedBy:"browser"}))},o0=(t,e)=>{var o;const i=Pr(e.settings.theme),n=e.settings[`${i}_theme`],s=e.settings.video_theme;Cr(t),Ar(t,e),Br(t,e),Me(t,"playerStyle",e.settings.player_style),Me(t,"playerTitle",((o=e.playlist)==null?void 0:o.title)||e.settings.player_title),Me(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),Me(t,"skipButtonStyle",e.settings.skip_button_style),Me(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),Me(t,"introsOutros",l0(e.settings)),Me(t,"persistentAdImage",e.settings.persistent_ad_image),Me(t,"widgetStyle",e.settings.widget_style),Me(t,"widgetPosition",e.settings.widget_position),Me(t,"textColor",n.text_color),Me(t,"backgroundColor",n.background_color),Me(t,"iconColor",n.icon_color),Me(t,"highlightColor",n.highlight_color),Me(t,"videoTextColor",s.text_color),Me(t,"videoBackgroundColor",s.background_color),Me(t,"videoIconColor",s.icon_color),Me(t,"logoIconEnabled",e.settings.logo_icon_enabled),Me(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),Me(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),Me(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),Me(t,"analyticsConsent",r0(e.settings)),Me(t,"analyticsCustomUrl",e.settings.analytics_custom_url),Me(t,"analyticsTag",e.settings.analytics_tag),Me(t,"analyticsUrl",e.settings.analytics_url),Me(t,"analyticsId",e.settings.analytics_id)},Cr=t=>{Me(t,"contentIndex",0),Me(t,"introsOutrosIndex",-1),Me(t,"advertIndex",-1),Me(t,"persistentIndex",-1),Me(t,"duration",0),Me(t,"currentTime",0),Me(t,"playbackState","stopped"),Me(t,"currentSegment",void 0),Me(t,"hoveredSegment",void 0)},Ar=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.content)||[];Me(t,"content",n.map(o=>{var l;return{id:o.id,title:o.title,imageUrl:i?((l=e.playlist)==null?void 0:l.image_url)||e.settings.image_url||o.image_url:null,sourceId:o.source_id,sourceUrl:o.source_url,adsEnabled:o.ads_enabled,duration:o.audio[0]?o.audio[0].duration/1e3:0,audio:o.audio.map(r=>({id:r.id,url:r.url,contentType:r.content_type,duration:r.duration?r.duration/1e3:0})),video:o.video.map(r=>({id:r.id,url:r.url,contentType:r.content_type,duration:r.duration?r.duration/1e3:0})),segments:o.segments.map(r=>({marker:r.marker,section:r.section,startTime:r.start_time?r.start_time/1e3:0,duration:r.duration?r.duration/1e3:0}))}}))},Br=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.ads)||[];Me(t,"adverts",n.map(o=>{const l=o.type==="vast",r=Pr(o.theme),a=o[`${r}_theme`],u=o.video_theme;return{id:o.id,type:o.type,placement:o.placement,vastUrl:l?o.vast_url:null,clickThroughUrl:l?null:o.click_through_url,imageUrl:i?o.image_url:null,textColor:a==null?void 0:a.text_color,backgroundColor:a==null?void 0:a.background_color,iconColor:a==null?void 0:a.icon_color,videoTextColor:u==null?void 0:u.text_color,videoBackgroundColor:u==null?void 0:u.background_color,videoIconColor:u==null?void 0:u.icon_color,audio:l?[]:(o.audio||o.media).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0})),video:l?[]:(o.video||[]).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0}))}}))},Me=(t,e,i)=>{var s;typeof((s=t.initialProps)==null?void 0:s[e])!="undefined"||(t[e]=i)},l0=({intro_outro_enabled:t,intro_url:e,outro_url:i})=>{if(!t)return[];const n=[];return e&&n.push({placement:"pre-roll",audio:[{url:e}],video:[]}),i&&n.push({placement:"post-roll",audio:[{url:i}],video:[]}),n},r0=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",a0=(t,e)=>fi(this,null,function*(){const n=yield(yield fetch(t)).blob(),s=URL.createObjectURL(n),o=document.createElement("a");document.body.append(o),o.href=s,o.setAttribute("download",e),o.setAttribute("target","_blank"),o.click(),o.remove()}),Es={vastUrls:new Set,mediaSources:new Set},c0=t=>{t.vastUrl&&Es.vastUrls.add(t.vastUrl);for(const e of[...t.audio||[],...t.video||[]])Es.mediaSources.add(e.url)},Ir=t=>{if(t.vastUrl&&Es.vastUrls.has(t.vastUrl))return!0;for(const e of[...t.audio||[],...t.video||[]])if(Es.mediaSources.has(e.url))return!0;return!1},Vr=new Set,u0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Vr.add(i.url))},d0=t=>[...t.audio||[],...t.video||[]].some(i=>Vr.has(i.url)),g0=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r,errored:a}={})=>{var _;const u=e&&e[i];e:if(u){if(a){c0(u);break e}if(r)return u0(u),-1;if(!r)return i}if(!((_=n[s])!=null&&_.adsEnabled)||t!==-1)return-1;const c=h0({content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r});let h=-1,y=-1/0,k=-1/0;for(const[b,p]of e.entries()){if(d0(p)||Ir(p)||!c.has(p.placement))continue;const O=f0[p.type]||0;if(O<y)continue;const z=Math.random();O===y&&z<k||(h=b,y=O,k=z)}return h},f0={vast:1,custom:0},h0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=e===0,l=e===t.length-1,r=t.length>1,a=r&&n&&!o,u=t[e].segments,c=u[u.length-1],h=r?null:b0(u),y=u[h],k=y&&i>y.startTime,_=c?c.startTime+c.duration:0,b=i>_-m0,p=new Set;return n&&p.add("pre-roll"),k&&!b&&p.add("mid-roll"),a&&p.add("mid-roll"),s&&l&&p.add("post-roll"),a&&p.add("post-roll"),p},_0=2*60,m0=10,y0=.5,b0=t=>{const e=t[t.length-1];if(!e)return;const i=e.startTime+e.duration;if(i<_0)return;const n=i/2,s=Co(t,i/2),r=t[s].startTime>=n-y0?s:s+1;if(r!==t.length)return r},v0=(t,e,i,n)=>{let s=-1,o=-1/0,l=-1/0;for(const[r,a]of(n||[]).entries()){if(!t||Ir(a)||a.type==="vast")continue;const u=p0(r,e,i);if(u<o)continue;const c=k0[a.placement]||0;u===o&&c<l||(s=r,o=u,l=c)}return s},k0={"pre-roll":2,"mid-roll":1},p0=(t,e,i)=>t===i?2:t===e?1:0,Wr={mediaSources:new Set},S0=t=>{for(const e of[...t.audio||[],t.video||[]])Wr.mediaSources.add(e.url)},w0=t=>{for(const e of[...t.audio||[],t.video||[]])if(Wr.mediaSources.has(e.url))return!0;return!1},jr=new Set,P0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>jr.add(i.url))},T0=t=>[...t.audio||[],...t.video||[]].some(i=>jr.has(i.url)),C0=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r,errored:a})=>{const u=t[e];e:if(u){if(a){S0(u);break e}if(r)return P0(u),-1;if(!r)return e}if(i!==-1)return-1;const c=A0({content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r});let h=-1,y=-1/0,k=-1/0;for(const[_,b]of t.entries()){if(w0(b)||!c.has(b.placement))continue;const p=T0(b)?1:0;if(p<y)continue;const O=Math.random();p===y&&O<k||(h=_,y=p,k=O)}return h},A0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=new Set,l=n&&e===0&&i===0,r=s&&e===t.length-1;return l&&o.add("pre-roll"),r&&o.add("post-roll"),o},B0=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(o=>o.mediaSession==="override");if(W0()&&!e)return;let i,n=-1/0,s=-1/0;for(const o of t.instances()){if(o.mediaSession==="none")continue;const l=I0[o.playbackState]||0;if(l<n)continue;const r=V0[o.showMediaSession]||0;l===n&&r<s||(i=o,n=l,s=r)}for(const o of t.instances())o.showMediaSession=o===i;return i},I0={playing:1,paused:0,stopped:0},V0={true:1,false:0},W0=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:s}=t;return e||i||n||(s==null?void 0:s.length)},j0=t=>{let e=!1,i,n=-1/0,s=-1/0;for(const o of t.instances()){if(!o.userInterface||o.widgetTarget||!jo(o.widgetStyle))continue;if(o.userInterface.isVisible){e=!0;continue}if(!(o.userInterface.relativeY<0))continue;const u=M0[o.playbackState]||0;if(u<n)continue;const c=o.userInterface.absoluteY;u===n&&c<s||(i=o,n=u,s=c)}e&&n===0&&(i=null);for(const o of t.instances())o.showBottomWidget=o===i},M0={playing:2,paused:1,stopped:0};class z0{constructor(e,i){Ve(this,Zs);Ve(this,Ks);Ve(this,ls);Ve(this,Js);Ve(this,Gs);Ve(this,vi);Ve(this,qi);Ve(this,oi);Ve(this,Xs);Ve(this,pn);Ve(this,Hi);Ve(this,Qs);Ve(this,rs);Ve(this,Oi);Ve(this,as);Ve(this,Yi);Ve(this,Mt);Ve(this,Zi);Ve(this,Ei);Ve(this,$s);Ve(this,eo);Ve(this,Sn);Ve(this,cs);Ve(this,to);Ve(this,io);Ve(this,no);Ve(this,so);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||Xt(`Cannot add listener for unknown event type '${e}'.`);const s=`listener-handle-${ps()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][s]=i,s}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return fi(this,null,function*(){yield hr(()=>this.player),Ya(e);const i=this[`handle${e.type}`],n=Os(this.player);M(this,Zs,ea).call(this,e)?e.status="ignored-due-to-advert":M(this,Ks,ta).call(this,e)?e.status="ignored-due-to-scrubbing":i?(yield i.call(this,e),M(this,$s,la).call(this),M(this,eo,ra).call(this),e.status="handled"):Xt("No handler function for event.",e);const s=Os(this.player);e.changedProps=_r(n,s),e.processedAt=new Date().toISOString(),Za(e),M(this,ls,Go).call(this,e.type,e),M(this,ls,Go).call(this,"<any>",e)})}handlePressedChangeRate(){M(this,Oi,mn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeRate(){M(this,Oi,mn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeRate(){M(this,Oi,mn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeRate(){M(this,Oi,mn).call(this,e=>e+1)}handlePressedRightOnChangeRate(){M(this,Oi,mn).call(this,e=>e+1)}handlePressedDownOnChangeRate(){M(this,Oi,mn).call(this,e=>e-1)}handlePressedLeftOnChangeRate(){M(this,Oi,mn).call(this,e=>e-1)}handlePressedPrevSegment(){M(this,as,Qo).call(this,e=>e-1)}handlePressedNextSegment(){M(this,as,Qo).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){M(this,Mt,Gt).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){M(this,Mt,Gt).call(this,i=>i+e)}handlePressedPrevTrack(){M(this,Yi,Bn).call(this,e=>e-1)}handlePressedNextTrack(){M(this,Yi,Bn).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleMediaLoaded({loadedMedia:e}){this.player.loadedMedia=e}handlePlaybackRateUpdated(){}handleVisibilityChanged(){j0(this.PlayerClass)}handlePressedVideoBackground(){M(this,Hi,An).call(this)}handlePressedEnterOnProgressBar(){M(this,Hi,An).call(this)}handlePressedSpaceOnProgressBar(){M(this,Hi,An).call(this)}handlePressedEnterOnProgressCircle(){M(this,Hi,An).call(this)}handlePressedSpaceOnProgressCircle(){M(this,Hi,An).call(this)}handlePressedLeftOnProgressBar(){M(this,Mt,Gt).call(this,e=>e-5)}handlePressedRightOnProgressBar(){M(this,Mt,Gt).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){M(this,Mt,Gt).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){M(this,Mt,Gt).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,M(this,Qs,oa).call(this),M(this,Mt,Gt).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){M(this,Mt,Gt).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){this.player.playbackState=this.preScrubState,setTimeout(()=>delete this.preScrubState,500)}handleIdentifiersChanged(){Tr(this.player).then(()=>{M(this,Zi,In).call(this,{atTheStart:!0}),M(this,Ei,yn).call(this,{atTheStart:!0})})}handleNoContentAvailable({description:e}){console.warn(`BeyondWords.Player: ${e}`)}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?M(this,rs,Xo).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"),B0(this.PlayerClass)}handlePlaybackPaused(){const e=this.player.playbackState==="playing",i=this.player.currentTime>=this.player.duration-.5;e&&!i&&!this.preScrubState&&(this.player.playbackState="paused")}handleCurrentTimeUpdated(){this.midrollPlayed||M(this,Ei,yn).call(this);const e=this.player.currentTime<=0,i=this.player.currentTime>=this.player.duration,n=this.player.mediaElement.video.paused;!e&&!i&&!n&&(this.player.playbackState="playing")}handlePlaybackEnded(){M(this,Xs,sa).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=M(this,vi,Gi).call(this),i=M(this,oi,yi).call(this);M(this,Ei,yn).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(M(this,Zi,In).call(this,{atTheEnd:!0}),!e&&(M(this,qi,Cn).call(this)||M(this,oi,yi).call(this)||M(this,Yi,Bn).call(this,n=>n+1)))}handlePlaybackNotAllowed({description:e}){console.warn(`BeyondWords.Player: ${e}`);const i=this.player.contentIndex<=0&&this.player.currentTime<=0;this.player.playbackState=i?"stopped":"paused"}handlePlaybackErrored({mediaType:e,errorMessage:i}){console.warn(`BeyondWords.Player: ${e} playback error: ${i}`),M(this,vi,Gi).call(this)||M(this,qi,Cn).call(this)?M(this,Zi,In).call(this,{errored:!0}):M(this,oi,yi).call(this)?M(this,Ei,yn).call(this,{errored:!0}):this.handlePlaybackEnded()}handlePressedMaximize(){xl()?Nh():Lh(this.player.target)}handleFullScreenModeUpdated(){const e=xl()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){M(this,Yi,Bn).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,audioIndex:i,videoIndex:n}){var c,h;const s=this.player.content[e],o=(c=s.audio)==null?void 0:c[i],l=(h=s.video)==null?void 0:h[n],r=(o||l).url,a=r.split(".").pop(),u=`${s.title}.${a}`;return a0(r,u)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:s,contentStatus:o}){o==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&M(this,no,ua).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:s})&&Tr(this.player).then(()=>{M(this,Zi,In).call(this,{atTheStart:!0}),M(this,Ei,yn).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){var s;M(this,pn,gs).call(this)?this.player.currentSegment=Ji(Jt({},e),{segmentIndex:i,contentIndex:n}):this.segmentPlayed||((s=this.player.segmentContainers)==null||s.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){e?this.player.hoveredSegment=Ji(Jt({},e),{segmentIndex:i,contentIndex:n}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,segmentIndex:i,contentIndex:n}){if(!$n("hovered",e,this.player.clickableSections))return;if(!M(this,so,da).call(this,{contentIndex:n,segmentIndex:i})&&!M(this,oi,yi).call(this)){M(this,Hi,An).call(this);return}n!==this.player.contentIndex&&M(this,Yi,Bn).call(this,()=>n),M(this,rs,Xo).call(this,Jt({segmentIndex:i,contentIndex:n},e))}}Zs=new WeakSet,ea=function({type:e}){return M(this,oi,yi).call(this)&&(e.includes("ChangeRate")||e.includes("PrevSegment")||e.includes("NextSegment")||e.includes("SeekBack")||e.includes("SeekAhead")||e.includes("Progress")&&!e.includes("Space")&&!e.includes("Enter"))},Ks=new WeakSet,ta=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},ls=new WeakSet,Go=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(s=>s(i))},Js=new WeakSet,ia=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},Gs=new WeakSet,na=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},vi=new WeakSet,Gi=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="pre-roll"},qi=new WeakSet,Cn=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="post-roll"},oi=new WeakSet,yi=function(){return this.player.advertIndex!==-1},Xs=new WeakSet,sa=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},pn=new WeakSet,gs=function(){return!M(this,vi,Gi).call(this)&&!M(this,qi,Cn).call(this)&&!M(this,oi,yi).call(this)},Hi=new WeakSet,An=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},Qs=new WeakSet,oa=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},rs=new WeakSet,Xo=function(s){var o=s,{segmentIndex:e,contentIndex:i}=o,n=Yo(o,["segmentIndex","contentIndex"]);M(this,Mt,Gt).call(this,()=>n.startTime,i),this.player.currentSegment=Jt({segmentIndex:e,contentIndex:i},n),this.player.playbackState="playing",this.segmentPlayed=!0},Oi=new WeakSet,mn=function(e,{cycle:i}={}){const n=this.player.playbackRates,s=n.length-1,o=n.indexOf(this.player.playbackRate),l=e(o);let r;i?r=l%n.length:r=Math.max(0,Math.min(s,l)),this.player.playbackRate=n[r]||1},as=new WeakSet,Qo=function(e){const i=this.player.content[this.player.contentIndex].segments,n=Co(i,this.player.currentTime),s=e(n);M(this,vi,Gi).call(this)&&s>=0?this.handlePlaybackEnded():M(this,qi,Cn).call(this)&&s<0?(M(this,Sn,fs).call(this,-1),M(this,Mt,Gt).call(this,()=>{var o;return((o=i[i.length-1])==null?void 0:o.startTime)||.01}),this.player.playbackState="playing"):M(this,pn,gs).call(this)&&s<0&&M(this,Js,ia).call(this)?(M(this,Mt,Gt).call(this,()=>0),M(this,Zi,In).call(this,{atTheStart:!0})):M(this,pn,gs).call(this)&&s===i.length&&M(this,Gs,na).call(this)?M(this,Mt,Gt).call(this,()=>this.player.duration-.01):M(this,pn,gs).call(this)&&s>=0&&s<i.length&&M(this,Mt,Gt).call(this,()=>i[s].startTime)},Yi=new WeakSet,Bn=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",M(this,Mt,Gt).call(this,()=>0)):(this.player.contentIndex=i,M(this,oi,yi).call(this)||(M(this,Mt,Gt).call(this,()=>0),this.midrollPlayed=!1)),M(this,Sn,fs).call(this,-1),M(this,Zi,In).call(this,{atTheStart:!0}),n||M(this,Ei,yn).call(this,{atTheStart:!0})},Mt=new WeakSet,Gt=function(e,i){if(M(this,oi,yi).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},Zi=new WeakSet,In=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:s,introsOutros:o,currentTime:l}=this.player,r=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,a=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,u=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;M(this,Sn,fs).call(this,C0({introsOutros:o,introsOutrosIndex:r,advertIndex:a,content:s,contentIndex:u,currentTime:l,atTheStart:e,atTheEnd:i,errored:n}))},Ei=new WeakSet,yn=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:s}={}){const{adverts:o,content:l,currentTime:r}=this.player;let a=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const u=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,c=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,a=-1),M(this,cs,$o).call(this,g0({introsOutrosIndex:a,adverts:o,advertIndex:u,content:l,contentIndex:c,currentTime:r,atTheStart:e,atTheEnd:i,errored:s}));const h=this.player.persistentAdImage,y=this.player.persistentIndex;this.player.persistentIndex=v0(h,y,u,o)},$s=new WeakSet,la=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(M(this,Sn,fs).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},eo=new WeakSet,ra=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(M(this,cs,$o).call(this,this.nextAdvert),delete this.nextAdvert)},Sn=new WeakSet,fs=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)&&M(this,vi,Gi).call(this,e)){this.player.introsOutrosIndex=-1,M(this,Ei,yn).call(this,{atTheStart:!0});return}const o=M(this,vi,Gi).call(this),l=M(this,qi,Cn).call(this);this.player.introsOutrosIndex=e;const r=o&&!M(this,vi,Gi).call(this),a=l&&!M(this,qi,Cn).call(this);r&&(this.player.currentTime=0),a&&M(this,Yi,Bn).call(this,()=>1/0)},cs=new WeakSet,$o=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=M(this,oi,yi).call(this);this.player.advertIndex=e;const s=!n&&M(this,oi,yi).call(this),o=n&&!M(this,oi,yi).call(this);s&&M(this,to,aa).call(this),o&&M(this,io,ca).call(this)},to=new WeakSet,aa=function(){M(this,vi,Gi).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},io=new WeakSet,ca=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},no=new WeakSet,ua=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:s}){var o,l,r,a;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===s||((o=this.player.playlist)==null?void 0:o.some(u=>u.contentId===e))||((l=this.player.playlist)==null?void 0:l.some(u=>u.contentId===i))||((r=this.player.playlist)==null?void 0:r.some(u=>u.sourceId===n))||((a=this.player.playlist)==null?void 0:a.some(u=>u.sourceUrl===s))},so=new WeakSet,da=function({contentIndex:e,segmentIndex:i}){var n,s;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((s=this.player.currentSegment)==null?void 0:s.segmentIndex)!==i};var ts="<unknown>";function O0(t){var e=t.split(`
56
56
  `);return e.reduce(function(i,n){var s=L0(n)||D0(n)||F0(n)||Z0(n)||H0(n);return s&&i.push(s),i},[])}var E0=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,x0=/\((\S*)(?::(\d+))(?::(\d+))\)/;function L0(t){var e=E0.exec(t);if(!e)return null;var i=e[2]&&e[2].indexOf("native")===0,n=e[2]&&e[2].indexOf("eval")===0,s=x0.exec(e[2]);return n&&s!=null&&(e[2]=s[1],e[3]=s[2],e[4]=s[3]),{file:i?null:e[2],methodName:e[1]||ts,arguments:i?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}var N0=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function D0(t){var e=N0.exec(t);return e?{file:e[2],methodName:e[1]||ts,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}var R0=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,U0=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function F0(t){var e=R0.exec(t);if(!e)return null;var i=e[3]&&e[3].indexOf(" > eval")>-1,n=U0.exec(e[3]);return i&&n!=null&&(e[3]=n[1],e[4]=n[2],e[5]=null),{file:e[3],methodName:e[1]||ts,arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}var q0=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function H0(t){var e=q0.exec(t);return e?{file:e[3],methodName:e[1]||ts,arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}:null}var Y0=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Z0(t){var e=Y0.exec(t);return e?{file:e[2],methodName:e[1]||ts,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}let Mr=!1,Ro,Uo;const K0=({onError:t})=>{if(!t||Mr)return;Mr=!0;const e=zr(new Error),i=e==null?void 0:e.match(/setErrorHandler/);Ro=window.onerror,Uo=window.onunhandledrejection,window.onerror=(n,s,o,l,r)=>{var h;const a=s===e,u=(h=r==null?void 0:r.message)==null?void 0:h.match(/request was interrupted/);if((i||a||u)&&t(r))return!0;Ro&&Ro(n,s,o,l,r)},window.onunhandledrejection=n=>{var a;const s=n.reason,o=zr(s)===e,l=(a=s==null?void 0:s.message)==null?void 0:a.match(/request was interrupted/);if((i||o||l)&&t(s)){n.preventDefault();return}Uo&&Uo(n)}},zr=t=>{var e;return(e=O0((t==null?void 0:t.stack)||"")[0])==null?void 0:e.file},J0=()=>{typeof window=="undefined"&&Xt(["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."])};let Or=!1;const G0=()=>{Or||(Or=!0,addEventListener("mousedown",X0),addEventListener("click",Q0),addEventListener("mousemove",$0))},X0=t=>{Lr=t.pageX,Nr=t.pageY},Q0=t=>{var i;if(t.defaultPrevented||em(t)||t.button!==0)return;const e=(i=Er(t.target))==null?void 0:i.getAttribute(on);if(e)for(const n of BeyondWords.Player.instances()){const{segment:s,contentIndex:o,segmentIndex:l}=xr(n,e);s&&n.onEvent(he({type:"PressedSegment",description:"The user pressed on a segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:s,contentIndex:o,segmentIndex:l}))}},$0=t=>{var n;const e=document.elementFromPoint(t.clientX,t.clientY),i=(n=Er(e))==null?void 0:n.getAttribute(on);for(const[s,o]of BeyondWords.Player.instances().entries()){const{segment:l,contentIndex:r,segmentIndex:a}=xr(o,i);tm(s,r,a)&&o.onEvent(he({type:"HoveredSegmentUpdated",description:"The user hovered over a different segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:l,contentIndex:r,segmentIndex:a}))}},Er=t=>{for(;t&&t.hasAttribute;){if(t.hasAttribute(on))return t;if(t.onclick||t.onmousedown||t.nodeName.toLowerCase()==="a")return;t=t.parentNode}},xr=(t,e)=>{if(!e)return{};let i={},n=-1/0;for(const[s,o]of(t.content||[]).entries())for(const[l,r]of(o.segments||[]).entries()){if(e!==r.marker)continue;const a=t.contentIndex===s?1:0;a<n||a===n&&(i!=null&&i.segment)||(i={contentIndex:s,segmentIndex:l,segment:r},n=a)}return i};let Lr,Nr;const em=t=>{const e=t.pageX-Lr,i=t.pageY-Nr;return Math.sqrt(e*e+i*i)>5},xs={},tm=(t,e,i)=>{xs[t]||(xs[t]={});const n=xs[t];return n.contentIndex===e&&n.segmentIndex===i?!1:(n.contentIndex=e,n.segmentIndex=i,!0)};class Fo{constructor(e){this.analyticsSink=e}sendToCustomAnalytics(e){return j_(this.analyticsSink,e)}sendToGoogleAnalytics(e,i){window.gtag("event",e,Ji(Jt({},i),{send_to:this.analyticsSink}))}}const im=(t,e)=>{const i=nm(t,e.type);if(!i)return;const n=sm(t,i);Ka(n),t.analyticsUrl&&t.analyticsConsent!=="none"&&new Fo(t.analyticsUrl).sendToCustomAnalytics(n),t.analyticsCustomUrl&&t.analyticsConsent!=="none"&&new Fo(t.analyticsCustomUrl).sendToCustomAnalytics(n),t.analyticsTag&&new Fo(t.analyticsTag).sendToGoogleAnalytics(om(n),n)},nm=(t,e)=>{if(e==="MediaLoaded"&&!t.listenSessionId)return"load";if(e==="PlaybackPlaying"&&lm(t)&&(t.isNewListen=!0),e==="CurrentTimeUpdated"&&t.isNewListen)return t.isNewListen=!1,"play";if(e==="CurrentTimeUpdated"&&rm(t))return"play_progress";if(e.startsWith("PressedAdvert"))return"ad_link_click"},sm=(t,e)=>{var l,r;t.listenSessionId||(t.listenSessionId=ps()),t.sessionCreatedAt||(t.sessionCreatedAt=Date.now());const i=["without-local-storage","none"].includes(t.analyticsConsent);i||localStorage.beyondwords||(localStorage.beyondwords=JSON.stringify(ps()));const n=t.adverts[t.advertIndex],s=t.content[t.contentIndex],o=t.duration?t.currentTime/t.duration*100:0;return{event_type:e,device_type:am(),media_type:n?"ad":"content",project_id:t.projectId,content_id:s==null?void 0:s.id,source_id:s==null?void 0:s.sourceId,analytics_id:t.analyticsId,ad_id:n==null?void 0:n.id,media_id:(l=t.loadedMedia)==null?void 0:l.id,media_format:(r=t.loadedMedia)==null?void 0:r.format,local_storage_id:i?null:JSON.parse(localStorage.beyondwords),listen_session_id:t.listenSessionId,session_created_at:t.sessionCreatedAt,duration:t.duration,listen_length_seconds:t.currentTime,listen_length_percent:Math.max(0,Math.min(100,o)),speed:t.playbackRate,location:window.location.href,referrer:document.referrer,player_version:"1",player_npm_version:vs}},om=({event_type:t,listen_length_percent:e})=>{const i=Math.floor(e/10)*10;if(t==="load")return"Load";if(t==="play")return"Play";if(t==="play_progress"&&i===100)return"Complete";if(t==="play_progress")return`${i}% listened`;if(t==="ad_link_click")return"Advert Click"},lm=t=>{var n,s;let e=!1;if(t.advertIndex!==-1){const o=((n=t.adverts[t.advertIndex])==null?void 0:n.id)||t.advertIndex;e=o!==t.prevAdvertId,t.prevAdvertId=o}else{const o=((s=t.content[t.contentIndex])==null?void 0:s.id)||t.contentIndex;e=o!==t.prevContentId,t.prevContentId=o}return e},rm=t=>{if(t.introsOutrosIndex!==-1)return;const e=t.prevPercentage+10,i=t.currentTime/t.duration*100;if(i>=e)return t.prevPercentage=Math.floor(i/10)*10,!0},am=()=>Dr(499)?"phone":Dr(999)?"tablet":"desktop",Dr=t=>window.matchMedia&&window.matchMedia(`only screen and (max-device-width: ${t}px)`).matches,_i=class _i extends $_{constructor(n){var s=n,{target:e}=s,i=Yo(s,["target"]);J0(),K0(i),G0();const{newTarget:o,showUserInterface:l}=q_(e);o.classList.add("beyondwords-player","bwp"),_i._styleLoaded||(o.style.display="none");const r=new z0(null,_i);r.addEventListener("<any>",u=>im(this,u));const a=Jt({showUserInterface:l},i);super({target:o,props:Ji(Jt({controller:r},a),{initialProps:a})}),r.player=this,Ai(_i,ln).push(this)}static styleLoaded(){_i.instances().forEach(e=>e.target.style.removeProperty("display")),_i._styleLoaded=!0}static get version(){return vs}static get styleSrc(){return`https://proxy.beyondwords.io/npm/@beyondwords/player@${vs}/dist/style.js`}static get hlsSrc(){return`https://proxy.beyondwords.io/npm/@beyondwords/player@${vs}/dist/hls.light.min.js`}static instances(){return[...Ai(_i,ln)]}static destroyAll(){Ai(_i,ln).forEach(e=>e.destroy())}destroy(){this.$destroy(),Hr(_i,ln,Ai(_i,ln).filter(e=>e!==this))}get target(){return this.$$.root}set target(e){Xt(["Unable to change the player's target after initialization.","Call player.destroy() and initialize a new player, instead.","","Alternatively, you can show or hide the player with:","player.showUserInterface = <bool>"])}};ln=new WeakMap,Ve(_i,ln,[]);let Ls=_i;return typeof window!="undefined"&&(window.BeyondWords||(window.BeyondWords={}),(Rr=window.BeyondWords).Player||(Rr.Player=Ls)),{Player:Ls}});
57
57
  //# sourceMappingURL=umd.js.map