@beyondwords/player 0.0.0-beta20 → 0.0.0-beta21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd.js CHANGED
@@ -2,7 +2,7 @@
2
2
  (function(ue,mt){typeof exports=="object"&&typeof module!="undefined"?module.exports=mt():typeof define=="function"&&define.amd?define(mt):(ue=typeof globalThis!="undefined"?globalThis:ue||self,ue.BeyondWords=mt())})(this,function(){var ma,mu,po,oh,pa,_o,lh,yo,uh,_a,bo,ch,So,dh,ya,To,fh,ko,hh,Eo,gh,Ao,vh,xo,mh,ba,pu,Po,ph,wo,_h,Dr,En,fn,ls,ar,Cr,Co,yh,ts,Pa,hn,us,Lo,bh,Sa,_u,Zr,Hn,Ta,yu,gn,cs,Li,er,vn,ds,Jr,Kn,Io,Sh,Ro,Th,is,wa,ka,bu,Do,kh,Oo,Eh,Bo,Ah,Mo,xh,Mn,hf;"use strict";var gE=Object.defineProperty,vE=Object.defineProperties;var mE=Object.getOwnPropertyDescriptors;var Yo=Object.getOwnPropertySymbols;var nh=Object.prototype.hasOwnProperty,sh=Object.prototype.propertyIsEnumerable;var rh=(ue,mt,bt)=>mt in ue?gE(ue,mt,{enumerable:!0,configurable:!0,writable:!0,value:bt}):ue[mt]=bt,fe=(ue,mt)=>{for(var bt in mt||(mt={}))nh.call(mt,bt)&&rh(ue,bt,mt[bt]);if(Yo)for(var bt of Yo(mt))sh.call(mt,bt)&&rh(ue,bt,mt[bt]);return ue},ti=(ue,mt)=>vE(ue,mE(mt));var gu=(ue,mt)=>{var bt={};for(var Bi in ue)nh.call(ue,Bi)&&mt.indexOf(Bi)<0&&(bt[Bi]=ue[Bi]);if(ue!=null&&Yo)for(var Bi of Yo(ue))mt.indexOf(Bi)<0&&sh.call(ue,Bi)&&(bt[Bi]=ue[Bi]);return bt};var vu=(ue,mt,bt)=>{if(!mt.has(ue))throw TypeError("Cannot "+bt)};var Vr=(ue,mt,bt)=>(vu(ue,mt,"read from private field"),bt?bt.call(ue):mt.get(ue)),ft=(ue,mt,bt)=>{if(mt.has(ue))throw TypeError("Cannot add the same private member more than once");mt instanceof WeakSet?mt.add(ue):mt.set(ue,bt)},ah=(ue,mt,bt,Bi)=>(vu(ue,mt,"write to private field"),Bi?Bi.call(ue,bt):mt.set(ue,bt),bt);var de=(ue,mt,bt)=>(vu(ue,mt,"access private method"),bt);var on=(ue,mt,bt)=>new Promise((Bi,qs)=>{var Zt=Tr=>{try{Xe(bt.next(Tr))}catch(Lr){qs(Lr)}},An=Tr=>{try{Xe(bt.throw(Tr))}catch(Lr){qs(Lr)}},Xe=Tr=>Tr.done?Bi(Tr.value):Promise.resolve(Tr.value).then(Zt,An);Xe((bt=bt.apply(ue,mt)).next())});function ue(){}const mt=t=>t;function bt(t,e){for(const i in e)t[i]=e[i];return t}function Bi(t){return t()}function qs(){return Object.create(null)}function Zt(t){t.forEach(Bi)}function An(t){return typeof t=="function"}function Xe(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Tr;function Lr(t,e){return Tr||(Tr=document.createElement("a")),Tr.href=e,t===Tr.href}function Ph(t){return Object.keys(t).length===0}function fs(t,e,i,n){if(t){const a=Su(t,e,i,n);return t[0](a)}}function Su(t,e,i,n){return t[1]&&n?bt(i.ctx.slice(),t[1](n(e))):i.ctx}function hs(t,e,i,n){if(t[2]&&n){const a=t[2](n(i));if(e.dirty===void 0)return a;if(typeof a=="object"){const l=[],g=Math.max(e.dirty.length,a.length);for(let p=0;p<g;p+=1)l[p]=e.dirty[p]|a[p];return l}return e.dirty|a}return e.dirty}function gs(t,e,i,n,a,l){if(a){const g=Su(e,i,n,l);t.p(g,a)}}function vs(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function Tu(t){return t==null?"":t}function ku(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const Eu=typeof window!="undefined";let wh=Eu?()=>window.performance.now():()=>Date.now(),Ca=Eu?t=>requestAnimationFrame(t):ue;const ms=new Set;function Au(t){ms.forEach(e=>{e.c(t)||(ms.delete(e),e.f())}),ms.size!==0&&Ca(Au)}function Ch(t){let e;return ms.size===0&&Ca(Au),{promise:new Promise(i=>{ms.add(e={c:t,f:i})}),abort(){ms.delete(e)}}}const Lh=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function I(t,e){t.appendChild(e)}function xu(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Ih(t){const e=N("style");return Rh(xu(t),e),e.sheet}function Rh(t,e){return I(t.head||t,e),e.sheet}function te(t,e,i){t.insertBefore(e,i||null)}function $(t){t.parentNode&&t.parentNode.removeChild(t)}function xn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function N(t){return document.createElement(t)}function et(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Ie(t){return document.createTextNode(t)}function Pe(){return Ie(" ")}function Yn(){return Ie("")}function pe(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function nt(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function Dh(t){return Array.from(t.childNodes)}function fr(t,e){e=""+e,t.data!==e&&(t.data=e)}function St(t,e){t.value=e==null?"":e}function wi(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function lt(t,e,i){for(let n=0;n<t.options.length;n+=1){const a=t.options[n];if(a.__value===e){a.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function mi(t){const e=t.querySelector(":checked");return e&&e.__value}let La;function Oh(){if(La===void 0){La=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){La=!0}}return La}function Bh(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=N("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const a=Oh();let l;return a?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",l=pe(window,"message",g=>{g.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{l=pe(n.contentWindow,"resize",e),e()}),I(t,n),()=>{(a||l&&n.contentWindow)&&l(),$(n)}}function Ye(t,e,i){t.classList[i?"add":"remove"](e)}function Mh(t,e,{bubbles:i=!1,cancelable:n=!1}={}){const a=document.createEvent("CustomEvent");return a.initCustomEvent(t,i,n,e),a}const Ia=new Map;let Ra=0;function Nh(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function Fh(t,e){const i={stylesheet:Ih(e),rules:{}};return Ia.set(t,i),i}function Pu(t,e,i,n,a,l,g,p=0){const _=16.666/n;let T=`{
3
3
  `;for(let H=0;H<=1;H+=_){const oe=e+(i-e)*l(H);T+=H*100+`%{${g(oe,1-oe)}}
4
4
  `}const k=T+`100% {${g(i,1-i)}}
5
- }`,C=`__svelte_${Nh(k)}_${p}`,F=xu(t),{stylesheet:U,rules:V}=Ia.get(F)||Fh(F,t);V[C]||(V[C]=!0,U.insertRule(`@keyframes ${C} ${k}`,U.cssRules.length));const z=t.style.animation||"";return t.style.animation=`${z?`${z}, `:""}${C} ${n}ms linear ${a}ms 1 both`,Ra+=1,C}function Uh(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),a=i.length-n.length;a&&(t.style.animation=n.join(", "),Ra-=a,Ra||Vh())}function Vh(){Ca(()=>{Ra||(Ia.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&$(e)}),Ia.clear())})}let Xs;function Zs(t){Xs=t}function wu(){if(!Xs)throw new Error("Function called outside component initialization");return Xs}function qo(t){wu().$$.on_mount.push(t)}function Wh(t){wu().$$.on_destroy.push(t)}const ps=[],Fe=[];let _s=[];const Xo=[],Cu=Promise.resolve();let Zo=!1;function Lu(){Zo||(Zo=!0,Cu.then(P))}function jh(){return Lu(),Cu}function Mt(t){_s.push(t)}function Qe(t){Xo.push(t)}const Jo=new Set;let ys=0;function P(){if(ys!==0)return;const t=Xs;do{try{for(;ys<ps.length;){const e=ps[ys];ys++,Zs(e),Gh(e.$$)}}catch(e){throw ps.length=0,ys=0,e}for(Zs(null),ps.length=0,ys=0;Fe.length;)Fe.pop()();for(let e=0;e<_s.length;e+=1){const i=_s[e];Jo.has(i)||(Jo.add(i),i())}_s.length=0}while(ps.length);for(;Xo.length;)Xo.pop()();Zo=!1,Jo.clear(),Zs(t)}function Gh(t){if(t.fragment!==null){t.update(),Zt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Mt)}}function zh(t){const e=[],i=[];_s.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),_s=e}let Js;function Hh(){return Js||(Js=Promise.resolve(),Js.then(()=>{Js=null})),Js}function Qo(t,e,i){t.dispatchEvent(Mh(`${e?"intro":"outro"}${i}`))}const Da=new Set;let ln;function Et(){ln={r:0,c:[],p:ln}}function At(){ln.r||Zt(ln.c),ln=ln.p}function X(t,e){t&&t.i&&(Da.delete(t),t.i(e))}function se(t,e,i,n){if(t&&t.o){if(Da.has(t))return;Da.add(t),ln.c.push(()=>{Da.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Kh={duration:0};function Iu(t,e,i,n){const a={direction:"both"};let l=e(t,i,a),g=n?0:1,p=null,_=null,T=null;function k(){T&&Uh(t,T)}function C(U,V){const z=U.b-g;return V*=Math.abs(z),{a:g,b:U.b,d:z,duration:V,start:U.start,end:U.start+V,group:U.group}}function F(U){const{delay:V=0,duration:z=300,easing:H=mt,tick:oe=ue,css:ce}=l||Kh,ge={start:wh()+V,b:U};U||(ge.group=ln,ln.r+=1),p||_?_=ge:(ce&&(k(),T=Pu(t,g,U,z,V,H,ce)),U&&oe(0,1),p=C(ge,z),Mt(()=>Qo(t,U,"start")),Ch(ve=>{if(_&&ve>_.start&&(p=C(_,z),_=null,Qo(t,p.b,"start"),ce&&(k(),T=Pu(t,g,p.b,p.duration,0,H,l.css))),p){if(ve>=p.end)oe(g=p.b,1-g),Qo(t,p.b,"end"),_||(p.b?k():--p.group.r||Zt(p.group.c)),p=null;else if(ve>=p.start){const le=ve-p.start;g=p.a+p.d*H(le/p.duration),oe(g,1-g)}}return!!(p||_)}))}return{run(U){An(l)?Hh().then(()=>{l=l(a),F(U)}):F(U)},end(){k(),p=_=null}}}function Yh(t,e){se(t,1,1,()=>{e.delete(t.key)})}function qh(t,e,i,n,a,l,g,p,_,T,k,C){let F=t.length,U=l.length,V=F;const z={};for(;V--;)z[t[V].key]=V;const H=[],oe=new Map,ce=new Map,ge=[];for(V=U;V--;){const ee=C(a,l,V),L=i(ee);let ae=g.get(L);ae?n&&ge.push(()=>ae.p(ee,e)):(ae=T(L,ee),ae.c()),oe.set(L,H[V]=ae),L in z&&ce.set(L,Math.abs(V-z[L]))}const ve=new Set,le=new Set;function Se(ee){X(ee,1),ee.m(p,k),g.set(ee.key,ee),k=ee.first,U--}for(;F&&U;){const ee=H[U-1],L=t[F-1],ae=ee.key,W=L.key;ee===L?(k=ee.first,F--,U--):oe.has(W)?!g.has(ae)||ve.has(ae)?Se(ee):le.has(W)?F--:ce.get(ae)>ce.get(W)?(le.add(ae),Se(ee)):(ve.add(W),F--):(_(L,g),F--)}for(;F--;){const ee=t[F];oe.has(ee.key)||_(ee,g)}for(;U;)Se(H[U-1]);return Zt(ge),H}function $e(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ze(t){t&&t.c()}function We(t,e,i,n){const{fragment:a,after_update:l}=t.$$;a&&a.m(e,i),n||Mt(()=>{const g=t.$$.on_mount.map(Bi).filter(An);t.$$.on_destroy?t.$$.on_destroy.push(...g):Zt(g),t.$$.on_mount=[]}),l.forEach(Mt)}function je(t,e){const i=t.$$;i.fragment!==null&&(zh(i.after_update),Zt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Xh(t,e){t.$$.dirty[0]===-1&&(ps.push(t),Lu(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function tt(t,e,i,n,a,l,g,p=[-1]){const _=Xs;Zs(t);const T=t.$$={fragment:null,ctx:[],props:l,update:ue,not_equal:a,bound:qs(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(_?_.$$.context:[])),callbacks:qs(),dirty:p,skip_bound:!1,root:e.target||_.$$.root};g&&g(T.root);let k=!1;if(T.ctx=i?i(t,e.props||{},(C,F,...U)=>{const V=U.length?U[0]:F;return T.ctx&&a(T.ctx[C],T.ctx[C]=V)&&(!T.skip_bound&&T.bound[C]&&T.bound[C](V),k&&Xh(t,C)),F}):[],T.update(),k=!0,Zt(T.before_update),T.fragment=n?n(T.ctx):!1,e.target){if(e.hydrate){const C=Dh(e.target);T.fragment&&T.fragment.l(C),C.forEach($)}else T.fragment&&T.fragment.c();e.intro&&X(t.$$.fragment),We(t,e.target,e.anchor,e.customElement),P()}Zs(_)}class it{$destroy(){je(this,1),this.$destroy=ue}$on(e,i){if(!An(i))return ue;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const a=n.indexOf(i);a!==-1&&n.splice(a,1)}}$set(e){this.$$set&&!Ph(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Zh="@beyondwords/player",$o="0.0.0-beta20",tr=(t,e)=>{t=[t].flat().join(`
5
+ }`,C=`__svelte_${Nh(k)}_${p}`,F=xu(t),{stylesheet:U,rules:V}=Ia.get(F)||Fh(F,t);V[C]||(V[C]=!0,U.insertRule(`@keyframes ${C} ${k}`,U.cssRules.length));const z=t.style.animation||"";return t.style.animation=`${z?`${z}, `:""}${C} ${n}ms linear ${a}ms 1 both`,Ra+=1,C}function Uh(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),a=i.length-n.length;a&&(t.style.animation=n.join(", "),Ra-=a,Ra||Vh())}function Vh(){Ca(()=>{Ra||(Ia.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&$(e)}),Ia.clear())})}let Xs;function Zs(t){Xs=t}function wu(){if(!Xs)throw new Error("Function called outside component initialization");return Xs}function qo(t){wu().$$.on_mount.push(t)}function Wh(t){wu().$$.on_destroy.push(t)}const ps=[],Fe=[];let _s=[];const Xo=[],Cu=Promise.resolve();let Zo=!1;function Lu(){Zo||(Zo=!0,Cu.then(P))}function jh(){return Lu(),Cu}function Mt(t){_s.push(t)}function Qe(t){Xo.push(t)}const Jo=new Set;let ys=0;function P(){if(ys!==0)return;const t=Xs;do{try{for(;ys<ps.length;){const e=ps[ys];ys++,Zs(e),Gh(e.$$)}}catch(e){throw ps.length=0,ys=0,e}for(Zs(null),ps.length=0,ys=0;Fe.length;)Fe.pop()();for(let e=0;e<_s.length;e+=1){const i=_s[e];Jo.has(i)||(Jo.add(i),i())}_s.length=0}while(ps.length);for(;Xo.length;)Xo.pop()();Zo=!1,Jo.clear(),Zs(t)}function Gh(t){if(t.fragment!==null){t.update(),Zt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Mt)}}function zh(t){const e=[],i=[];_s.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),_s=e}let Js;function Hh(){return Js||(Js=Promise.resolve(),Js.then(()=>{Js=null})),Js}function Qo(t,e,i){t.dispatchEvent(Mh(`${e?"intro":"outro"}${i}`))}const Da=new Set;let ln;function Et(){ln={r:0,c:[],p:ln}}function At(){ln.r||Zt(ln.c),ln=ln.p}function X(t,e){t&&t.i&&(Da.delete(t),t.i(e))}function se(t,e,i,n){if(t&&t.o){if(Da.has(t))return;Da.add(t),ln.c.push(()=>{Da.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Kh={duration:0};function Iu(t,e,i,n){const a={direction:"both"};let l=e(t,i,a),g=n?0:1,p=null,_=null,T=null;function k(){T&&Uh(t,T)}function C(U,V){const z=U.b-g;return V*=Math.abs(z),{a:g,b:U.b,d:z,duration:V,start:U.start,end:U.start+V,group:U.group}}function F(U){const{delay:V=0,duration:z=300,easing:H=mt,tick:oe=ue,css:ce}=l||Kh,ge={start:wh()+V,b:U};U||(ge.group=ln,ln.r+=1),p||_?_=ge:(ce&&(k(),T=Pu(t,g,U,z,V,H,ce)),U&&oe(0,1),p=C(ge,z),Mt(()=>Qo(t,U,"start")),Ch(ve=>{if(_&&ve>_.start&&(p=C(_,z),_=null,Qo(t,p.b,"start"),ce&&(k(),T=Pu(t,g,p.b,p.duration,0,H,l.css))),p){if(ve>=p.end)oe(g=p.b,1-g),Qo(t,p.b,"end"),_||(p.b?k():--p.group.r||Zt(p.group.c)),p=null;else if(ve>=p.start){const le=ve-p.start;g=p.a+p.d*H(le/p.duration),oe(g,1-g)}}return!!(p||_)}))}return{run(U){An(l)?Hh().then(()=>{l=l(a),F(U)}):F(U)},end(){k(),p=_=null}}}function Yh(t,e){se(t,1,1,()=>{e.delete(t.key)})}function qh(t,e,i,n,a,l,g,p,_,T,k,C){let F=t.length,U=l.length,V=F;const z={};for(;V--;)z[t[V].key]=V;const H=[],oe=new Map,ce=new Map,ge=[];for(V=U;V--;){const ee=C(a,l,V),L=i(ee);let ae=g.get(L);ae?n&&ge.push(()=>ae.p(ee,e)):(ae=T(L,ee),ae.c()),oe.set(L,H[V]=ae),L in z&&ce.set(L,Math.abs(V-z[L]))}const ve=new Set,le=new Set;function Se(ee){X(ee,1),ee.m(p,k),g.set(ee.key,ee),k=ee.first,U--}for(;F&&U;){const ee=H[U-1],L=t[F-1],ae=ee.key,W=L.key;ee===L?(k=ee.first,F--,U--):oe.has(W)?!g.has(ae)||ve.has(ae)?Se(ee):le.has(W)?F--:ce.get(ae)>ce.get(W)?(le.add(ae),Se(ee)):(ve.add(W),F--):(_(L,g),F--)}for(;F--;){const ee=t[F];oe.has(ee.key)||_(ee,g)}for(;U;)Se(H[U-1]);return Zt(ge),H}function $e(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ze(t){t&&t.c()}function We(t,e,i,n){const{fragment:a,after_update:l}=t.$$;a&&a.m(e,i),n||Mt(()=>{const g=t.$$.on_mount.map(Bi).filter(An);t.$$.on_destroy?t.$$.on_destroy.push(...g):Zt(g),t.$$.on_mount=[]}),l.forEach(Mt)}function je(t,e){const i=t.$$;i.fragment!==null&&(zh(i.after_update),Zt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Xh(t,e){t.$$.dirty[0]===-1&&(ps.push(t),Lu(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function tt(t,e,i,n,a,l,g,p=[-1]){const _=Xs;Zs(t);const T=t.$$={fragment:null,ctx:[],props:l,update:ue,not_equal:a,bound:qs(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(_?_.$$.context:[])),callbacks:qs(),dirty:p,skip_bound:!1,root:e.target||_.$$.root};g&&g(T.root);let k=!1;if(T.ctx=i?i(t,e.props||{},(C,F,...U)=>{const V=U.length?U[0]:F;return T.ctx&&a(T.ctx[C],T.ctx[C]=V)&&(!T.skip_bound&&T.bound[C]&&T.bound[C](V),k&&Xh(t,C)),F}):[],T.update(),k=!0,Zt(T.before_update),T.fragment=n?n(T.ctx):!1,e.target){if(e.hydrate){const C=Dh(e.target);T.fragment&&T.fragment.l(C),C.forEach($)}else T.fragment&&T.fragment.c();e.intro&&X(t.$$.fragment),We(t,e.target,e.anchor,e.customElement),P()}Zs(_)}class it{$destroy(){je(this,1),this.$destroy=ue}$on(e,i){if(!An(i))return ue;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const a=n.indexOf(i);a!==-1&&n.splice(a,1)}}$set(e){this.$$set&&!Ph(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Zh="@beyondwords/player",$o="0.0.0-beta21",tr=(t,e)=>{t=[t].flat().join(`
6
6
  `);let i=`${Zh}:
7
7
 
8
8
  ${t}`;if(e){i+=`
@@ -87,5 +87,5 @@ Url: ${ho(t)}`),!0):GT(t,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__=="undefined"|
87
87
  Event: ${Dn(t)}.
88
88
  Url: ${ho(t)}`),!0)}function VT(t,e){return t.type||!e||!e.length?!1:zT(t).some(i=>eo(i,e))}function WT(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const i=t.transaction;return i?eo(i,e):!1}function jT(t,e){if(!e||!e.length)return!1;const i=ho(t);return i?eo(i,e):!1}function GT(t,e){if(!e||!e.length)return!0;const i=ho(t);return i?eo(i,e):!0}function zT(t){if(t.message)return[t.message];if(t.exception){const{values:e}=t.exception;try{const{type:i="",value:n=""}=e&&e[e.length-1]||{};return[`${n}`,`${i}: ${n}`]}catch(i){return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.error(`Cannot extract message for event ${Dn(t)}`),[]}}return[]}function HT(t){try{return t.exception.values[0].type==="SentryError"}catch(e){}return!1}function KT(t=[]){for(let e=t.length-1;e>=0;e--){const i=t[e];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}function ho(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch(i){}return e?KT(e):null}catch(e){return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.error(`Cannot extract url for event ${Dn(t)}`),null}}const Ht=kr;let Fl=0;function zd(){return Fl>0}function YT(){Fl++,setTimeout(()=>{Fl--})}function Ds(t,e={},i){if(typeof t!="function")return t;try{const a=t.__sentry_wrapped__;if(a)return a;if(El(t))return t}catch(a){return t}const n=function(){const a=Array.prototype.slice.call(arguments);try{i&&typeof i=="function"&&i.apply(this,arguments);const l=a.map(g=>Ds(g,e));return t.apply(this,l)}catch(l){throw YT(),vT(g=>{g.addEventProcessor(p=>(e.mechanism&&(Il(p,void 0,void 0),la(p,e.mechanism)),p.extra=ti(fe({},p.extra),{arguments:a}),p)),Od(l)}),l}};try{for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a])}catch(a){}od(n,t),kl(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch(a){}return n}function Hd(t,e){const i=Vl(t,e),n={type:e&&e.name,value:JT(e)};return i.length&&(n.stacktrace={frames:i}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function qT(t,e,i,n){const l=Ci().getClient(),g=l&&l.getOptions().normalizeDepth,p={exception:{values:[{type:yl(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:`Non-Error ${n?"promise rejection":"exception"} captured with keys: ${yS(e)}`}]},extra:{__serialized__:Sd(e,g)}};if(i){const _=Vl(t,i);_.length&&(p.exception.values[0].stacktrace={frames:_})}return p}function Ul(t,e){return{exception:{values:[Hd(t,e)]}}}function Vl(t,e){const i=e.stacktrace||e.stack||"",n=ZT(e);try{return t(i,n)}catch(a){}return[]}const XT=/Minified React error #\d+;/i;function ZT(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(XT.test(t.message))return 1}return 0}function JT(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function QT(t,e,i,n){const a=i&&i.syntheticException||void 0,l=Wl(t,e,a,n);return la(l),l.level="error",i&&i.event_id&&(l.event_id=i.event_id),Qn(l)}function $T(t,e,i="info",n,a){const l=n&&n.syntheticException||void 0,g=jl(t,e,l,a);return g.level=i,n&&n.event_id&&(g.event_id=n.event_id),Qn(g)}function Wl(t,e,i,n,a){let l;if(ed(e)&&e.error)return Ul(t,e.error);if(td(e)||iS(e)){const g=e;if("stack"in e)l=Ul(t,e);else{const p=g.name||(td(g)?"DOMError":"DOMException"),_=g.message?`${p}: ${g.message}`:p;l=jl(t,_,i,n),Il(l,_)}return"code"in g&&(l.tags=ti(fe({},l.tags),{"DOMException.code":`${g.code}`})),l}return $c(e)?Ul(t,e):ws(e)||yl(e)?(l=qT(t,e,i,a),la(l,{synthetic:!0}),l):(l=jl(t,e,i,n),Il(l,`${e}`,void 0),la(l,{synthetic:!0}),l)}function jl(t,e,i,n){const a={message:e};if(n&&i){const l=Vl(t,i);l.length&&(a.exception={values:[{value:e,stacktrace:{frames:l}}]})}return a}const go=1024,Kd="Breadcrumbs";class da{static __initStatic(){this.id=Kd}__init(){this.name=da.id}constructor(e){da.prototype.__init.call(this),this.options=fe({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}setupOnce(){this.options.console&&Rn("console",tk),this.options.dom&&Rn("dom",ek(this.options.dom)),this.options.xhr&&Rn("xhr",ik),this.options.fetch&&Rn("fetch",rk),this.options.history&&Rn("history",nk)}addSentryBreadcrumb(e){this.options.sentry&&Ci().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:Dn(e)},{event:e})}}da.__initStatic();function ek(t){function e(i){let n,a=typeof t=="object"?t.serializeAttribute:void 0,l=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;l&&l>go&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.warn(`\`dom.maxStringLength\` cannot exceed ${go}, but a value of ${l} was configured. Sentry will use ${go} instead.`),l=go),typeof a=="string"&&(a=[a]);try{const g=i.event;n=sk(g)?Tl(g.target,{keyAttrs:a,maxStringLength:l}):Tl(g,{keyAttrs:a,maxStringLength:l})}catch(g){n="<unknown>"}n.length!==0&&Ci().addBreadcrumb({category:`ui.${i.name}`,message:n},{event:i.event,name:i.name,global:i.global})}return e}function tk(t){for(let i=0;i<t.args.length;i++)if(t.args[i]==="ref=Ref<"){t.args[i+1]="viewRef";break}const e={category:"console",data:{arguments:t.args,logger:"console"},level:YS(t.level),message:ad(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)e.message=`Assertion failed: ${ad(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1);else return;Ci().addBreadcrumb(e,{input:t.args,level:t.level})}function ik(t){const{startTimestamp:e,endTimestamp:i}=t,n=t.xhr[aa];if(!e||!i||!n)return;const{method:a,url:l,status_code:g,body:p}=n,_={method:a,url:l,status_code:g},T={xhr:t.xhr,input:p,startTimestamp:e,endTimestamp:i};Ci().addBreadcrumb({category:"xhr",data:_,type:"http"},T)}function rk(t){const{startTimestamp:e,endTimestamp:i}=t;if(i&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"))if(t.error){const n=t.fetchData,a={data:t.error,input:t.args,startTimestamp:e,endTimestamp:i};Ci().addBreadcrumb({category:"fetch",data:n,level:"error",type:"http"},a)}else{const n=ti(fe({},t.fetchData),{status_code:t.response&&t.response.status}),a={input:t.args,response:t.response,startTimestamp:e,endTimestamp:i};Ci().addBreadcrumb({category:"fetch",data:n,type:"http"},a)}}function nk(t){let e=t.from,i=t.to;const n=Dl(Ht.location.href);let a=Dl(e);const l=Dl(i);a.path||(a=n),n.protocol===l.protocol&&n.host===l.host&&(i=l.relative),n.protocol===a.protocol&&n.host===a.host&&(e=a.relative),Ci().addBreadcrumb({category:"navigation",data:{from:e,to:i}})}function sk(t){return t&&!!t.target}function ak(t,{metadata:e,tunnel:i,dsn:n}){const a=fe(fe({event_id:t.event_id,sent_at:new Date().toISOString()},e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}}),!!i&&!!n&&{dsn:Qa(n)}),l=ok(t);return ua(a,[l])}function ok(t){return[{type:"user_report"},t]}class lk extends es{constructor(e){const i=Ht.SENTRY_SDK_SOURCE||FS();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${i}:@sentry/browser`,version:fo}],version:fo},super(e),e.sendClientReports&&Ht.document&&Ht.document.addEventListener("visibilitychange",()=>{Ht.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,i){return QT(this._options.stackParser,e,i,this._options.attachStacktrace)}eventFromMessage(e,i="info",n){return $T(this._options.stackParser,e,i,n,this._options.attachStacktrace)}sendEvent(e,i){const n=this.getIntegrationById(Kd);n&&n.addSentryBreadcrumb&&n.addSentryBreadcrumb(e),super.sendEvent(e,i)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.warn("SDK not enabled, will not capture user feedback.");return}const i=ak(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(i)}_prepareEvent(e,i,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,i,n)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.log("Sending outcomes:",e);const i=iT(e,this._options.tunnel&&Qa(this._dsn));this._sendEnvelope(i)}}let fa;function uk(){if(fa)return fa;if(Cl(Ht.fetch))return fa=Ht.fetch.bind(Ht);const t=Ht.document;let e=Ht.fetch;if(t&&typeof t.createElement=="function")try{const i=t.createElement("iframe");i.hidden=!0,t.head.appendChild(i);const n=i.contentWindow;n&&n.fetch&&(e=n.fetch),t.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return fa=e.bind(Ht)}function ck(){fa=void 0}function dk(t,e=uk()){let i=0,n=0;function a(l){const g=l.body.length;i+=g,n++;const p=fe({body:l.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:i<=6e4&&n<15},t.fetchOptions);try{return e(t.url,p).then(_=>(i-=g,n--,{statusCode:_.status,headers:{"x-sentry-rate-limits":_.headers.get("X-Sentry-Rate-Limits"),"retry-after":_.headers.get("Retry-After")}}))}catch(_){return ck(),i-=g,n--,oo(_)}}return Wd(t,a)}const fk=4;function hk(t){function e(i){return new ir((n,a)=>{const l=new XMLHttpRequest;l.onerror=a,l.onreadystatechange=()=>{l.readyState===fk&&n({statusCode:l.status,headers:{"x-sentry-rate-limits":l.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":l.getResponseHeader("Retry-After")}})},l.open("POST",t.url);for(const g in t.headers)Object.prototype.hasOwnProperty.call(t.headers,g)&&l.setRequestHeader(g,t.headers[g]);l.send(i.body)})}return Wd(t,e)}const vo="?",gk=30,vk=40,mk=50;function Gl(t,e,i,n){const a={filename:t,function:e,in_app:!0};return i!==void 0&&(a.lineno=i),n!==void 0&&(a.colno=n),a}const pk=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,_k=/\((\S*)(?::(\d+))(?::(\d+))\)/,yk=[gk,t=>{const e=pk.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const l=_k.exec(e[2]);l&&(e[2]=l[1],e[3]=l[2],e[4]=l[3])}const[n,a]=Yd(e[1]||vo,e[2]);return Gl(a,n,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}}],bk=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Sk=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Tk=[mk,t=>{const e=bk.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const l=Sk.exec(e[3]);l&&(e[1]=e[1]||"eval",e[3]=l[1],e[4]=l[2],e[5]="")}let n=e[3],a=e[1]||vo;return[a,n]=Yd(a,n),Gl(n,a,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}],kk=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Ek=hd(...[yk,Tk,[vk,t=>{const e=kk.exec(t);return e?Gl(e[2],e[1]||vo,+e[3],e[4]?+e[4]:void 0):void 0}]]),Yd=(t,e)=>{const i=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return i||n?[t.indexOf("@")!==-1?t.split("@")[0]:vo,i?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};class Bn{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=Bn.id}__init2(){this._installFunc={onerror:Ak,onunhandledrejection:xk}}constructor(e){Bn.prototype.__init.call(this),Bn.prototype.__init2.call(this),this._options=fe({onerror:!0,onunhandledrejection:!0},e)}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const i in e){const n=this._installFunc[i];n&&e[i]&&(Ck(i),n(),this._installFunc[i]=void 0)}}}Bn.__initStatic();function Ak(){Rn("error",t=>{const[e,i,n]=Zd();if(!e.getIntegration(Bn))return;const{msg:a,url:l,line:g,column:p,error:_}=t;if(zd()||_&&_.__sentry_own_request__)return;const T=_===void 0&&Jn(a)?wk(a,l,g,p):qd(Wl(i,_||a,void 0,n,!1),l,g,p);T.level="error",Xd(e,_,T,"onerror")})}function xk(){Rn("unhandledrejection",t=>{const[e,i,n]=Zd();if(!e.getIntegration(Bn))return;let a=t;try{"reason"in t?a=t.reason:"detail"in t&&"reason"in t.detail&&(a=t.detail.reason)}catch(g){}if(zd()||a&&a.__sentry_own_request__)return!0;const l=id(a)?Pk(a):Wl(i,a,void 0,n,!0);l.level="error",Xd(e,a,l,"onunhandledrejection")})}function Pk(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function wk(t,e,i,n){const a=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let l=ed(t)?t.message:t,g="Error";const p=l.match(a);return p&&(g=p[1],l=p[2]),qd({exception:{values:[{type:g,value:l}]}},e,i,n)}function qd(t,e,i,n){const a=t.exception=t.exception||{},l=a.values=a.values||[],g=l[0]=l[0]||{},p=g.stacktrace=g.stacktrace||{},_=p.frames=p.frames||[],T=isNaN(parseInt(n,10))?void 0:n,k=isNaN(parseInt(i,10))?void 0:i,C=Jn(e)&&e.length>0?e:uS();return _.length===0&&_.push({colno:T,filename:C,function:"?",in_app:!0,lineno:k}),t}function Ck(t){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.log(`Global Handler attached: ${t}`)}function Xd(t,e,i,n){la(i,{handled:!1,type:n}),t.captureEvent(i,{originalException:e})}function Zd(){const t=Ci(),e=t.getClient(),i=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,i.stackParser,i.attachStacktrace]}const Lk=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class ha{static __initStatic(){this.id="TryCatch"}__init(){this.name=ha.id}constructor(e){ha.prototype.__init.call(this),this._options=fe({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}setupOnce(){this._options.setTimeout&&Vi(Ht,"setTimeout",Jd),this._options.setInterval&&Vi(Ht,"setInterval",Jd),this._options.requestAnimationFrame&&Vi(Ht,"requestAnimationFrame",Ik),this._options.XMLHttpRequest&&"XMLHttpRequest"in Ht&&Vi(XMLHttpRequest.prototype,"send",Rk);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Lk).forEach(Dk)}}ha.__initStatic();function Jd(t){return function(...e){const i=e[0];return e[0]=Ds(i,{mechanism:{data:{function:In(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function Ik(t){return function(e){return t.apply(this,[Ds(e,{mechanism:{data:{function:"requestAnimationFrame",handler:In(t)},handled:!0,type:"instrument"}})])}}function Rk(t){return function(...e){const i=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(a=>{a in i&&typeof i[a]=="function"&&Vi(i,a,function(l){const g={mechanism:{data:{function:a,handler:In(l)},handled:!0,type:"instrument"}},p=El(l);return p&&(g.mechanism.data.handler=In(p)),Ds(l,g)})}),t.apply(this,e)}}function Dk(t){const e=Ht,i=e[t]&&e[t].prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||(Vi(i,"addEventListener",function(n){return function(a,l,g){try{typeof l.handleEvent=="function"&&(l.handleEvent=Ds(l.handleEvent,{mechanism:{data:{function:"handleEvent",handler:In(l),target:t},handled:!0,type:"instrument"}}))}catch(p){}return n.apply(this,[a,Ds(l,{mechanism:{data:{function:"addEventListener",handler:In(l),target:t},handled:!0,type:"instrument"}}),g])}}),Vi(i,"removeEventListener",function(n){return function(a,l,g){const p=l;try{const _=p&&p.__sentry_wrapped__;_&&n.call(this,a,_,g)}catch(_){}return n.call(this,a,p,g)}}))}const Ok="cause",Bk=5;class Os{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=Os.id}constructor(e={}){Os.prototype.__init.call(this),this._key=e.key||Ok,this._limit=e.limit||Bk}setupOnce(){const e=Ci().getClient();e&&uo((i,n)=>{const a=Ci().getIntegration(Os);return a?Mk(e.getOptions().stackParser,a._key,a._limit,i,n):i})}}Os.__initStatic();function Mk(t,e,i,n,a){if(!n.exception||!n.exception.values||!a||!Cs(a.originalException,Error))return n;const l=Qd(t,i,a.originalException,e);return n.exception.values=[...l,...n.exception.values],n}function Qd(t,e,i,n,a=[]){if(!Cs(i[n],Error)||a.length+1>=e)return a;const l=Hd(t,i[n]);return Qd(t,e,i[n],n,[l,...a])}class Bs{constructor(){Bs.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=Bs.id}setupOnce(){uo(e=>{if(Ci().getIntegration(Bs)){if(!Ht.navigator&&!Ht.location&&!Ht.document)return e;const i=e.request&&e.request.url||Ht.location&&Ht.location.href,{referrer:n}=Ht.document||{},{userAgent:a}=Ht.navigator||{},l=fe(fe(fe({},e.request&&e.request.headers),n&&{Referer:n}),a&&{"User-Agent":a}),g=ti(fe(fe({},e.request),i&&{url:i}),{headers:l});return ti(fe({},e),{request:g})}return e})}}Bs.__initStatic();class Ms{constructor(){Ms.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=Ms.id}setupOnce(e,i){const n=a=>{if(a.type)return a;const l=i().getIntegration(Ms);if(l){try{if(Nk(a,l._previousEvent))return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(g){return l._previousEvent=a}return l._previousEvent=a}return a};n.id=this.name,e(n)}}Ms.__initStatic();function Nk(t,e){return e?!!(Fk(t,e)||Uk(t,e)):!1}function Fk(t,e){const i=t.message,n=e.message;return!(!i&&!n||i&&!n||!i&&n||i!==n||!ef(t,e)||!$d(t,e))}function Uk(t,e){const i=tf(e),n=tf(t);return!(!i||!n||i.type!==n.type||i.value!==n.value||!ef(t,e)||!$d(t,e))}function $d(t,e){let i=rf(t),n=rf(e);if(!i&&!n)return!0;if(i&&!n||!i&&n||(i=i,n=n,n.length!==i.length))return!1;for(let a=0;a<n.length;a++){const l=n[a],g=i[a];if(l.filename!==g.filename||l.lineno!==g.lineno||l.colno!==g.colno||l.function!==g.function)return!1}return!0}function ef(t,e){let i=t.fingerprint,n=e.fingerprint;if(!i&&!n)return!0;if(i&&!n||!i&&n)return!1;i=i,n=n;try{return i.join("")===n.join("")}catch(a){return!1}}function tf(t){return t.exception&&t.exception.values&&t.exception.values[0]}function rf(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch(i){return}}const Vk=[new Rs,new ca,new ha,new da,new Bn,new Os,new Ms,new Bs];function Wk(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=Vk),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),Ht.SENTRY_RELEASE&&Ht.SENTRY_RELEASE.id&&(t.release=Ht.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);const e=ti(fe({},t),{stackParser:bS(t.stackParser||Ek),integrations:AT(t),transport:t.transport||(gd()?dk:hk)});BT(lk,e),t.autoSessionTracking&&jk()}function nf(t){t.startSession({ignoreDuration:!0}),t.captureSession()}function jk(){if(typeof Ht.document=="undefined"){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&gt.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const t=Ci();t.captureSession&&(nf(t),Rn("history",({from:e,to:i})=>{e===void 0||e===i||nf(Ci())}))}function Gk(t){t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.svelte",packages:[{name:"npm:@sentry/svelte",version:fo}],version:fo},Wk(t),zk()}function zk(){let t;const e=i=>(t===void 0&&(t=Hk()),t&&(i.modules=fe({svelteKit:"latest"},i.modules)),i);e.id="svelteKitProcessor",uo(e)}function Hk(){return cS("div#svelte-announcer")!==null}var ga="<unknown>";function Kk(t){var e=t.split(`
89
89
  `);return e.reduce(function(i,n){var a=Xk(n)||Jk(n)||e2(n)||n2(n)||i2(n);return a&&i.push(a),i},[])}var Yk=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,qk=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Xk(t){var e=Yk.exec(t);if(!e)return null;var i=e[2]&&e[2].indexOf("native")===0,n=e[2]&&e[2].indexOf("eval")===0,a=qk.exec(e[2]);return n&&a!=null&&(e[2]=a[1],e[3]=a[2],e[4]=a[3]),{file:i?null:e[2],methodName:e[1]||ga,arguments:i?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}var Zk=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Jk(t){var e=Zk.exec(t);return e?{file:e[2],methodName:e[1]||ga,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}var Qk=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,$k=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function e2(t){var e=Qk.exec(t);if(!e)return null;var i=e[3]&&e[3].indexOf(" > eval")>-1,n=$k.exec(e[3]);return i&&n!=null&&(e[3]=n[1],e[4]=n[2],e[5]=null),{file:e[3],methodName:e[1]||ga,arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}var t2=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function i2(t){var e=t2.exec(t);return e?{file:e[3],methodName:e[1]||ga,arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}:null}var r2=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function n2(t){var e=r2.exec(t);return e?{file:e[2],methodName:e[1]||ga,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}let sf=!1;const s2=({captureErrors:t})=>{if(!(t!==!1)||sf)return;sf=!0;const i=af(new Error),n=i==null?void 0:i.match(/initializeSentry/);Gk(ti(fe({},i?{}:{defaultIntegrations:!1}),{dsn:"https://ea2f0f2a070b4934994dc8543b8d16e1@o271781.ingest.sentry.io/4504853792882688",environment:n?"development":"production",release:$o,beforeSend(l,{originalException:g}){var C;const _=af(g)===i,T=(C=g==null?void 0:g.message)==null?void 0:C.match(/request was interrupted/);if(n||_||T)return a2(l)}})),!i&&Od(new Error(["Unable to determine the filename of the BeyondWords player script.","We therefore can't filter errors to only those originating from the player.","To avoid receiving unrelated errors from publishers, Sentry has been disabled."].join(`
90
- `)))},af=t=>{var e;return(e=Kk((t==null?void 0:t.stack)||"")[0])==null?void 0:e.file},a2=t=>{var i,n;const e=((n=(i=window.BeyondWords)==null?void 0:i.Player)==null?void 0:n.instances())||[];for(const[a,l]of e.entries()){const g=`BeyondWords.Player.instances()[${a}]`;t.contexts=t.contexts||{},t.contexts[g]=ia(l)}return t};let of=!1;const o2=()=>{of||(of=!0,addEventListener("mousedown",l2),addEventListener("click",u2),addEventListener("mousemove",c2))},l2=t=>{cf=t.pageX,df=t.pageY},u2=t=>{var i;if(t.defaultPrevented||d2(t)||t.button!==0)return;const e=(i=lf(t.target))==null?void 0:i.getAttribute(Ln);if(e)for(const n of BeyondWords.Player.instances()){const{segment:a,contentIndex:l,segmentIndex:g}=uf(n,e);a&&n.onEvent(rt({type:"PressedSegment",description:"The user pressed on a segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:a,contentIndex:l,segmentIndex:g}))}},c2=t=>{var n;const e=document.elementFromPoint(t.clientX,t.clientY),i=(n=lf(e))==null?void 0:n.getAttribute(Ln);for(const[a,l]of BeyondWords.Player.instances().entries()){const{segment:g,contentIndex:p,segmentIndex:_}=uf(l,i);f2(a,p,_)&&l.onEvent(rt({type:"HoveredSegmentUpdated",description:"The user hovered over a different segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:g,contentIndex:p,segmentIndex:_}))}},lf=t=>{for(;t&&t.hasAttribute;){if(t.hasAttribute(Ln))return t;if(t.onclick||t.onmousedown||t.nodeName.toLowerCase()==="a")return;t=t.parentNode}},uf=(t,e)=>{if(!e)return{};let i={},n=-1/0;for(const[a,l]of(t.content||[]).entries())for(const[g,p]of(l.segments||[]).entries()){if(e!==p.marker)continue;const _=t.contentIndex===a?1:0;_<n||_===n&&(i!=null&&i.segment)||(i={contentIndex:a,segmentIndex:g,segment:p},n=_)}return i};let cf,df;const d2=t=>{const e=t.pageX-cf,i=t.pageY-df;return Math.sqrt(e*e+i*i)>5},mo={},f2=(t,e,i)=>{mo[t]||(mo[t]={});const n=mo[t];return n.contentIndex===e&&n.segmentIndex===i?!1:(n.contentIndex=e,n.segmentIndex=i,!0)};class zl{constructor(e){this.analyticsSink=e}sendToCustomAnalytics(e){return $1(this.analyticsSink,e)}sendToGoogleAnalytics(e,i){window.gtag("event",e,ti(fe({},i),{send_to:this.analyticsSink}))}}const h2=(t,e)=>{const i=g2(t,e.type);if(!i)return;const n=v2(t,i);lg(n),t.analyticsUrl&&t.analyticsConsent!=="none"&&new zl(t.analyticsUrl).sendToCustomAnalytics(n),t.analyticsCustomUrl&&t.analyticsConsent!=="none"&&new zl(t.analyticsCustomUrl).sendToCustomAnalytics(n),t.analyticsTag&&new zl(t.analyticsTag).sendToGoogleAnalytics(m2(n),n)},g2=(t,e)=>{if(!t.listenSessionId&&t.duration)return"load";if(e==="PlaybackPlaying"&&(t.emitPlayEvent="CurrentTimeUpdated"),e===t.emitPlayEvent)return delete t.emitPlayEvent,"play";if(e==="CurrentTimeUpdated"&&p2(t))return"play_progress";if(e.startsWith("PressedAdvert"))return"ad_link_click"},v2=(t,e)=>{var g,p,_;t.listenSessionId||(t.listenSessionId=Ba()),t.sessionCreatedAt||(t.sessionCreatedAt=Date.now());const i=t.analyticsConsent==="without-local-storage";i||localStorage.beyondwords||(localStorage.beyondwords=JSON.stringify(Ba()));const n=t.adverts[t.advertIndex],a=t.content[t.contentIndex],l=t.currentTime/t.duration*100;return{event_type:e,device_type:_2(),media_type:n?"ad":"content",project_id:t.projectId,content_id:a==null?void 0:a.id,analytics_id:t.analyticsId,ad_id:n==null?void 0:n.id,media_id:(_=(p=(g=n||a)==null?void 0:g.media)==null?void 0:p[0])==null?void 0:_.id,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,l)),speed:t.playbackRate,location:window.location.href,referrer:document.referrer,player_version:"1",player_npm_version:$o}},m2=({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"},p2=t=>{const e=t.prevPercentage+10;if(t.currentTime/t.duration*100>=e)return t.prevPercentage=e,!0},_2=()=>ff(499)?"phone":ff(999)?"tablet":"desktop",ff=t=>window.matchMedia&&window.matchMedia(`only screen and (max-device-width: ${t}px)`).matches,Nn=class extends bb{constructor(n){var a=n,{target:e}=a,i=gu(a,["target"]);tS(),s2(i),o2();const{newTarget:l,showUserInterface:g}=db(e);l.classList.add("beyondwords-player","bwp");const p=new eS(null,Nn);p.addEventListener("<any>",T=>h2(this,T));const _=fe({showUserInterface:g},i);super({target:l,props:ti(fe({controller:p},_),{initialProps:_})}),p.player=this,Vr(Nn,Mn).push(this)}static get version(){return $o}static instances(){return[...Vr(Nn,Mn)]}static destroyAll(){Vr(Nn,Mn).forEach(e=>e.destroy())}destroy(){this.$destroy(),ah(Nn,Mn,Vr(Nn,Mn).filter(e=>e!==this))}get target(){return this.$$.root}set target(e){tr(["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>"])}};let va=Nn;return Mn=new WeakMap,ft(va,Mn,[]),typeof window!="undefined"&&(window.BeyondWords||(window.BeyondWords={}),(hf=window.BeyondWords).Player||(hf.Player=va)),{Player:va}});
90
+ `)))},af=t=>{var e;return(e=Kk((t==null?void 0:t.stack)||"")[0])==null?void 0:e.file},a2=t=>{var i,n;const e=((n=(i=window.BeyondWords)==null?void 0:i.Player)==null?void 0:n.instances())||[];for(const[a,l]of e.entries()){const g=`BeyondWords.Player.instances()[${a}]`;t.contexts=t.contexts||{},t.contexts[g]=ia(l)}return t};let of=!1;const o2=()=>{of||(of=!0,addEventListener("mousedown",l2),addEventListener("click",u2),addEventListener("mousemove",c2))},l2=t=>{cf=t.pageX,df=t.pageY},u2=t=>{var i;if(t.defaultPrevented||d2(t)||t.button!==0)return;const e=(i=lf(t.target))==null?void 0:i.getAttribute(Ln);if(e)for(const n of BeyondWords.Player.instances()){const{segment:a,contentIndex:l,segmentIndex:g}=uf(n,e);a&&n.onEvent(rt({type:"PressedSegment",description:"The user pressed on a segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:a,contentIndex:l,segmentIndex:g}))}},c2=t=>{var n;const e=document.elementFromPoint(t.clientX,t.clientY),i=(n=lf(e))==null?void 0:n.getAttribute(Ln);for(const[a,l]of BeyondWords.Player.instances().entries()){const{segment:g,contentIndex:p,segmentIndex:_}=uf(l,i);f2(a,p,_)&&l.onEvent(rt({type:"HoveredSegmentUpdated",description:"The user hovered over a different segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:g,contentIndex:p,segmentIndex:_}))}},lf=t=>{for(;t&&t.hasAttribute;){if(t.hasAttribute(Ln))return t;if(t.onclick||t.onmousedown||t.nodeName.toLowerCase()==="a")return;t=t.parentNode}},uf=(t,e)=>{if(!e)return{};let i={},n=-1/0;for(const[a,l]of(t.content||[]).entries())for(const[g,p]of(l.segments||[]).entries()){if(e!==p.marker)continue;const _=t.contentIndex===a?1:0;_<n||_===n&&(i!=null&&i.segment)||(i={contentIndex:a,segmentIndex:g,segment:p},n=_)}return i};let cf,df;const d2=t=>{const e=t.pageX-cf,i=t.pageY-df;return Math.sqrt(e*e+i*i)>5},mo={},f2=(t,e,i)=>{mo[t]||(mo[t]={});const n=mo[t];return n.contentIndex===e&&n.segmentIndex===i?!1:(n.contentIndex=e,n.segmentIndex=i,!0)};class zl{constructor(e){this.analyticsSink=e}sendToCustomAnalytics(e){return $1(this.analyticsSink,e)}sendToGoogleAnalytics(e,i){window.gtag("event",e,ti(fe({},i),{send_to:this.analyticsSink}))}}const h2=(t,e)=>{const i=g2(t,e.type);if(!i)return;const n=v2(t,i);lg(n),t.analyticsUrl&&t.analyticsConsent!=="none"&&new zl(t.analyticsUrl).sendToCustomAnalytics(n),t.analyticsCustomUrl&&t.analyticsConsent!=="none"&&new zl(t.analyticsCustomUrl).sendToCustomAnalytics(n),t.analyticsTag&&new zl(t.analyticsTag).sendToGoogleAnalytics(m2(n),n)},g2=(t,e)=>{if(!t.listenSessionId&&t.duration)return"load";if(e==="PlaybackPlaying"&&(t.emitPlayEvent="CurrentTimeUpdated"),e===t.emitPlayEvent)return t.emitPlayEvent=null,"play";if(e==="CurrentTimeUpdated"&&p2(t))return"play_progress";if(e.startsWith("PressedAdvert"))return"ad_link_click"},v2=(t,e)=>{var g,p,_;t.listenSessionId||(t.listenSessionId=Ba()),t.sessionCreatedAt||(t.sessionCreatedAt=Date.now());const i=t.analyticsConsent==="without-local-storage";i||localStorage.beyondwords||(localStorage.beyondwords=JSON.stringify(Ba()));const n=t.adverts[t.advertIndex],a=t.content[t.contentIndex],l=t.currentTime/t.duration*100;return{event_type:e,device_type:_2(),media_type:n?"ad":"content",project_id:t.projectId,content_id:a==null?void 0:a.id,analytics_id:t.analyticsId,ad_id:n==null?void 0:n.id,media_id:(_=(p=(g=n||a)==null?void 0:g.media)==null?void 0:p[0])==null?void 0:_.id,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,l)),speed:t.playbackRate,location:window.location.href,referrer:document.referrer,player_version:"1",player_npm_version:$o}},m2=({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"},p2=t=>{const e=t.prevPercentage+10;if(t.currentTime/t.duration*100>=e)return t.prevPercentage=e,!0},_2=()=>ff(499)?"phone":ff(999)?"tablet":"desktop",ff=t=>window.matchMedia&&window.matchMedia(`only screen and (max-device-width: ${t}px)`).matches,Nn=class extends bb{constructor(n){var a=n,{target:e}=a,i=gu(a,["target"]);tS(),s2(i),o2();const{newTarget:l,showUserInterface:g}=db(e);l.classList.add("beyondwords-player","bwp");const p=new eS(null,Nn);p.addEventListener("<any>",T=>h2(this,T));const _=fe({showUserInterface:g},i);super({target:l,props:ti(fe({controller:p},_),{initialProps:_})}),p.player=this,Vr(Nn,Mn).push(this)}static get version(){return $o}static instances(){return[...Vr(Nn,Mn)]}static destroyAll(){Vr(Nn,Mn).forEach(e=>e.destroy())}destroy(){this.$destroy(),ah(Nn,Mn,Vr(Nn,Mn).filter(e=>e!==this))}get target(){return this.$$.root}set target(e){tr(["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>"])}};let va=Nn;return Mn=new WeakMap,ft(va,Mn,[]),typeof window!="undefined"&&(window.BeyondWords||(window.BeyondWords={}),(hf=window.BeyondWords).Player||(hf.Player=va)),{Player:va}});
91
91
  //# sourceMappingURL=umd.js.map