6 lines
28 KiB
JavaScript
6 lines
28 KiB
JavaScript
import{S as re,i as ae,s as ue,l as Ce,u as Oe,p as Pe,q as Ie,t as k,h as g,K as Te,D as nt,L as lt,M as ot,o as I,c as w,b as _,d as V,N as v,v as T,w as W,f as C,z as We,n as D,g as B,m as M,j as R,O as ee,x as st,y as te,k as ie,E as Z,e as N,A as rt,F as x,P as q,Q as $,R as at,T as ut,U as Ee}from"./index-06834efe.js";import{F as ne}from"./fa-e8793af2.js";import{f as Be,a as ft,b as dt}from"./index.es-a32769a3.js";import{G as ct}from"./GraphicBlock-dc15374e.js";const pt=n=>({intersecting:n&1,entry:n&2,observer:n&4}),he=n=>({intersecting:n[0],entry:n[1],observer:n[2]});function yt(n){let e;const i=n[9].default,t=Ce(i,n,n[8],he);return{c(){t&&t.c()},m(l,o){t&&t.m(l,o),e=!0},p(l,[o]){t&&t.p&&(!e||o&263)&&Oe(t,i,l,l[8],e?Ie(i,l[8],o,pt):Pe(l[8]),he)},i(l){e||(k(t,l),e=!0)},o(l){g(t,l),e=!1},d(l){t&&t.d(l)}}}function mt(n,e,i){let{$$slots:t={},$$scope:l}=e,{element:o=null}=e,{once:r=!1}=e,{intersecting:u=!1}=e,{root:s=null}=e,{rootMargin:f="0px"}=e,{threshold:a=0}=e,{entry:c=null}=e,{observer:h=null}=e;const P=Te();let y=null,b=null;const m=()=>{i(2,h=new IntersectionObserver(p=>{p.forEach(j=>{i(1,c=j),i(0,u=j.isIntersecting)})},{root:s,rootMargin:f,threshold:a}))};return nt(()=>(m(),()=>{h&&(h.disconnect(),i(2,h=null))})),lt(async()=>{c!==null&&(P("observe",c),c.isIntersecting&&(P("intersect",c),r&&h.unobserve(o))),await ot(),o!==null&&o!==b&&(h.observe(o),b!==null&&h.unobserve(b),b=o),y&&f!==y&&(h.disconnect(),b=null,m()),y=f}),n.$$set=p=>{"element"in p&&i(3,o=p.element),"once"in p&&i(4,r=p.once),"intersecting"in p&&i(0,u=p.intersecting),"root"in p&&i(5,s=p.root),"rootMargin"in p&&i(6,f=p.rootMargin),"threshold"in p&&i(7,a=p.threshold),"entry"in p&&i(1,c=p.entry),"observer"in p&&i(2,h=p.observer),"$$scope"in p&&i(8,l=p.$$scope)},[u,c,h,o,r,s,f,a,l,t]}class bt extends re{constructor(e){super(),ae(this,e,mt,yt,ue,{element:3,once:4,intersecting:0,root:5,rootMargin:6,threshold:7,entry:1,observer:2})}}const ht=bt;IntersectionObserver.__docgen={version:3,name:"IntersectionObserver.svelte",data:[{keywords:[{name:"type",description:"{HTMLElement}"}],visibility:"public",description:"The HTML Element to observe.",name:"element",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"HTMLElement",type:"HTMLElement"},defaultValue:null},{keywords:[{name:"type",description:"{boolean}"}],visibility:"public",description:"Set to `true` to unobserve the element\nafter it intersects the viewport.",name:"once",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"`true` if the observed element\nis intersecting the viewport.",name:"intersecting",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[{name:"type",description:"{HTMLElement}"}],visibility:"public",description:`Specify the containing element.
|
|
Defaults to the browser viewport.`,name:"root",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"HTMLElement",type:"HTMLElement"},defaultValue:null},{keywords:[],visibility:"public",description:"Margin offset of the containing element.",name:"rootMargin",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"0px"},{keywords:[],visibility:"public",description:`Percentage of element visibility to trigger an event.
|
|
Value must be between 0 and 1.`,name:"threshold",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:0},{keywords:[{name:"type",description:"{null | IntersectionObserverEntry}"}],visibility:"public",description:"Observed element metadata.",name:"entry",kind:"let",static:!1,readonly:!1,type:{kind:"union",text:"null | IntersectionObserverEntry",type:[{kind:"type",text:"null",type:"null"},{kind:"type",text:"IntersectionObserverEntry",type:"IntersectionObserverEntry"}]},defaultValue:null},{keywords:[{name:"type",description:"{null | IntersectionObserver}"}],visibility:"public",description:"`IntersectionObserver` instance.",name:"observer",kind:"let",static:!1,readonly:!1,type:{kind:"union",text:"null | IntersectionObserver",type:[{kind:"type",text:"null",type:"null"},{kind:"type",text:"IntersectionObserver",type:"IntersectionObserver"}]},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[{visibility:"public",description:null,keywords:[],name:"observe"},{visibility:"public",description:null,keywords:[],name:"intersect"}],slots:[{keywords:[],visibility:"public",description:"",name:"default",params:[{name:"{intersecting}",type:{kind:"type",text:"*",type:"any"}},{name:"{entry}",type:{kind:"type",text:"*",type:"any"}},{name:"{observer}",type:{kind:"type",text:"*",type:"any"}}],parameters:[{name:"{intersecting}",type:{kind:"type",text:"*",type:"any"}},{name:"{entry}",type:{kind:"type",text:"*",type:"any"}},{name:"{observer}",type:{kind:"type",text:"*",type:"any"}}]}],refs:[]};function _t(n){let e;return{c(){e=We("error")},m(i,t){V(i,e,t)},p:D,i:D,o:D,d(i){i&&C(e)}}}function kt(n){let e,i,t;return i=new ne({props:{icon:Be,size:"2x",color:n[8]}}),{c(){e=I("i"),B(i.$$.fragment),_(e,"class","play-pause-icon play")},m(l,o){V(l,e,o),M(i,e,null),t=!0},p(l,o){const r={};o&256&&(r.color=l[8]),i.$set(r)},i(l){t||(k(i.$$.fragment,l),t=!0)},o(l){g(i.$$.fragment,l),t=!1},d(l){l&&C(e),R(i)}}}function gt(n){let e,i,t;return i=new ne({props:{icon:ft,size:"2x",color:n[8]}}),{c(){e=I("i"),B(i.$$.fragment),_(e,"class","play-pause-icon pause")},m(l,o){V(l,e,o),M(i,e,null),t=!0},p(l,o){const r={};o&256&&(r.color=l[8]),i.$set(r)},i(l){t||(k(i.$$.fragment,l),t=!0)},o(l){g(i.$$.fragment,l),t=!1},d(l){l&&C(e),R(i)}}}function wt(n){let e,i,t,l;const o=[Vt,vt],r=[];function u(s,f){return s[7]?0:1}return i=u(n),t=r[i]=o[i](n),{c(){e=I("i"),t.c(),_(e,"class","play-pause-icon replay")},m(s,f){V(s,e,f),r[i].m(e,null),l=!0},p(s,f){let a=i;i=u(s),i===a?r[i].p(s,f):(T(),g(r[a],1,1,()=>{r[a]=null}),W(),t=r[i],t?t.p(s,f):(t=r[i]=o[i](s),t.c()),k(t,1),t.m(e,null))},i(s){l||(k(t),l=!0)},o(s){g(t),l=!1},d(s){s&&C(e),r[i].d()}}}function vt(n){let e,i;return e=new ne({props:{icon:Be,size:"2x",color:n[8]}}),{c(){B(e.$$.fragment)},m(t,l){M(e,t,l),i=!0},p(t,l){const o={};l&256&&(o.color=t[8]),e.$set(o)},i(t){i||(k(e.$$.fragment,t),i=!0)},o(t){g(e.$$.fragment,t),i=!1},d(t){R(e,t)}}}function Vt(n){let e,i;return e=new ne({props:{icon:dt,size:"2x",color:n[8]}}),{c(){B(e.$$.fragment)},m(t,l){M(e,t,l),i=!0},p(t,l){const o={};l&256&&(o.color=t[8]),e.$set(o)},i(t){i||(k(e.$$.fragment,t),i=!0)},o(t){g(e.$$.fragment,t),i=!1},d(t){R(e,t)}}}function Ct(n){let e,i,t,l,o,r;const u=[wt,gt,kt,_t],s=[];function f(a,c){return a[6]?0:a[0]===!1?1:a[0]===!0?2:3}return i=f(n),t=s[i]=u[i](n),{c(){e=I("button"),t.c(),w(e,"opacity",n[1]),w(e,"top",n[2]==="top left"||n[2]==="top right"?"10px":n[2]==="center"?`${(n[4]-n[5])/2}px`:`${n[4]-n[5]}px`),w(e,"left",n[2]==="top left"||n[2]==="bottom left"?"10px":n[2]==="center"?`${(n[3]-n[5])/2}px`:`${n[3]-n[5]}px`),_(e,"class","svelte-1rmu17u")},m(a,c){V(a,e,c),s[i].m(e,null),l=!0,o||(r=v(e,"click",n[9]),o=!0)},p(a,[c]){let h=i;i=f(a),i===h?s[i].p(a,c):(T(),g(s[h],1,1,()=>{s[h]=null}),W(),t=s[i],t?t.p(a,c):(t=s[i]=u[i](a),t.c()),k(t,1),t.m(e,null)),(!l||c&2)&&w(e,"opacity",a[1]),(!l||c&52)&&w(e,"top",a[2]==="top left"||a[2]==="top right"?"10px":a[2]==="center"?`${(a[4]-a[5])/2}px`:`${a[4]-a[5]}px`),(!l||c&44)&&w(e,"left",a[2]==="top left"||a[2]==="bottom left"?"10px":a[2]==="center"?`${(a[3]-a[5])/2}px`:`${a[3]-a[5]}px`)},i(a){l||(k(t),l=!0)},o(a){g(t),l=!1},d(a){a&&C(e),s[i].d(),o=!1,r()}}}function Ot(n,e,i){const t=Te();let{paused:l}=e,{clickedOnPauseBtn:o}=e,{controlsOpacity:r}=e,{controlsPosition:u}=e,{widthVideoContainer:s}=e,{heightVideoContainer:f}=e,{controlsBorderOffset:a}=e,{resetCondition:c}=e,{separateReplayIcon:h}=e,{controlsColour:P}=e;function y(){i(0,l=!l),i(10,o=l===!0),t("pausePlayEvent",{paused:l,clickedOnPauseBtn:o})}return n.$$set=b=>{"paused"in b&&i(0,l=b.paused),"clickedOnPauseBtn"in b&&i(10,o=b.clickedOnPauseBtn),"controlsOpacity"in b&&i(1,r=b.controlsOpacity),"controlsPosition"in b&&i(2,u=b.controlsPosition),"widthVideoContainer"in b&&i(3,s=b.widthVideoContainer),"heightVideoContainer"in b&&i(4,f=b.heightVideoContainer),"controlsBorderOffset"in b&&i(5,a=b.controlsBorderOffset),"resetCondition"in b&&i(6,c=b.resetCondition),"separateReplayIcon"in b&&i(7,h=b.separateReplayIcon),"controlsColour"in b&&i(8,P=b.controlsColour)},[l,r,u,s,f,a,c,h,P,y,o]}class fe extends re{constructor(e){super(),ae(this,e,Ot,Ct,ue,{paused:0,clickedOnPauseBtn:10,controlsOpacity:1,controlsPosition:2,widthVideoContainer:3,heightVideoContainer:4,controlsBorderOffset:5,resetCondition:6,separateReplayIcon:7,controlsColour:8})}}fe.__docgen={version:3,name:"Controls.svelte",data:[{visibility:"public",description:null,keywords:[],name:"paused",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"clickedOnPauseBtn",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"controlsOpacity",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"controlsPosition",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"widthVideoContainer",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"heightVideoContainer",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"controlsBorderOffset",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"resetCondition",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"separateReplayIcon",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"controlsColour",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[{keywords:[],visibility:"public",description:"so video doesn't autoplay when coming into view again if paused previously",name:"pausePlayEvent"}],slots:[],refs:[]};const Pt=n=>({}),_e=n=>({});function ke(n){let e,i,t,l,o,r=n[4]&&ge(n);const u=[Tt,It],s=[];function f(a,c){return a[14]?0:1}return i=f(n),t=s[i]=u[i](n),{c(){r&&r.c(),e=te(),t.c(),l=ie()},m(a,c){r&&r.m(a,c),V(a,e,c),s[i].m(a,c),V(a,l,c),o=!0},p(a,c){a[4]?r?r.p(a,c):(r=ge(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null);let h=i;i=f(a),i===h?s[i].p(a,c):(T(),g(s[h],1,1,()=>{s[h]=null}),W(),t=s[i],t?t.p(a,c):(t=s[i]=u[i](a),t.c()),k(t,1),t.m(l.parentNode,l))},i(a){o||(k(t),o=!0)},o(a){g(t),o=!1},d(a){a&&(C(e),C(l)),r&&r.d(a),s[i].d(a)}}}function ge(n){let e,i;return{c(){e=I("p"),i=We(n[4]),_(e,"class","visually-hidden")},m(t,l){V(t,e,l),N(e,i)},p(t,l){l[0]&16&&rt(i,t[4])},d(t){t&&C(e)}}}function It(n){let e,i,t,l,o,r=!1,u,s=!0,f,a,c,h,P,y=n[16]&&we(n);function b(){cancelAnimationFrame(u),t.paused||(u=Ee(b),r=!0),n[52].call(t)}return{c(){e=I("div"),y&&y.c(),i=te(),t=I("video"),l=I("track"),_(l,"kind","captions"),x(t.src,o=n[1])||_(t,"src",o),_(t,"poster",n[2]),_(t,"class","pointer-events-none relative"),_(t,"width","100%"),t.muted=n[13],t.playsInline=!0,_(t,"preload",n[11]),t.loop=n[12],t.autoplay=!0,n[23]===void 0&&q(()=>n[53].call(t)),q(()=>n[55].call(t)),_(e,"class","video-wrapper relative"),_(e,"aria-hidden",n[3]),q(()=>n[56].call(e))},m(m,p){V(m,e,p),y&&y.m(e,null),N(e,i),N(e,t),N(t,l),n[51](t),f=$(t,n[55].bind(t)),a=$(e,n[56].bind(e)),c=!0,h||(P=[v(t,"timeupdate",b),v(t,"durationchange",n[53]),v(t,"play",n[54]),v(t,"pause",n[54])],h=!0)},p(m,p){m[16]?y?(y.p(m,p),p[0]&65536&&k(y,1)):(y=we(m),y.c(),k(y,1),y.m(e,i)):y&&(T(),g(y,1,1,()=>{y=null}),W()),(!c||p[0]&2&&!x(t.src,o=m[1]))&&_(t,"src",o),(!c||p[0]&4)&&_(t,"poster",m[2]),(!c||p[0]&8192)&&(t.muted=m[13]),(!c||p[0]&2048)&&_(t,"preload",m[11]),(!c||p[0]&4096)&&(t.loop=m[12]),!r&&p[0]&4194304&&!isNaN(m[22])&&(t.currentTime=m[22]),r=!1,p[0]&67108864&&s!==(s=m[26])&&t[s?"pause":"play"](),(!c||p[0]&8)&&_(e,"aria-hidden",m[3])},i(m){c||(k(y),c=!0)},o(m){g(y),c=!1},d(m){m&&C(e),y&&y.d(),n[51](null),f(),a(),h=!1,ee(P)}}}function Tt(n){let e,i,t;function l(r){n[49](r)}let o={element:n[31],threshold:n[15],once:!1,$$slots:{default:[Rt]},$$scope:{ctx:n}};return n[25]!==void 0&&(o.intersecting=n[25]),e=new ht({props:o}),Z.push(()=>at(e,"intersecting",l)),{c(){B(e.$$.fragment)},m(r,u){M(e,r,u),t=!0},p(r,u){const s={};u[1]&1&&(s.element=r[31]),u[0]&32768&&(s.threshold=r[15]),u[0]&2113878031|u[1]&1073741839&&(s.$$scope={dirty:u,ctx:r}),!i&&u[0]&33554432&&(i=!0,s.intersecting=r[25],ut(()=>i=!1)),e.$set(s)},i(r){t||(k(e.$$.fragment,r),t=!0)},o(r){g(e.$$.fragment,r),t=!1},d(r){R(e,r)}}}function we(n){let e,i,t,l;const o=[Et,Wt],r=[];function u(s,f){return s[0]?0:1}return e=u(n),i=r[e]=o[e](n),{c(){i.c(),t=ie()},m(s,f){r[e].m(s,f),V(s,t,f),l=!0},p(s,f){let a=e;e=u(s),e===a?r[e].p(s,f):(T(),g(r[a],1,1,()=>{r[a]=null}),W(),i=r[e],i?i.p(s,f):(i=r[e]=o[e](s),i.c()),k(i,1),i.m(t.parentNode,t))},i(s){l||(k(i),l=!0)},o(s){g(i),l=!1},d(s){s&&C(t),r[e].d(s)}}}function Wt(n){let e,i,t;return{c(){e=I("button"),_(e,"class","border-0 m-0 p-0 bg-transparent absolute"),w(e,"top","0"),w(e,"left","0"),w(e,"width",n[30]+"px"),w(e,"height",n[29]+"px")},m(l,o){V(l,e,o),i||(t=v(e,"click",n[50]),i=!0)},p(l,o){o[0]&1073741824&&w(e,"width",l[30]+"px"),o[0]&536870912&&w(e,"height",l[29]+"px")},i:D,o:D,d(l){l&&C(e),i=!1,t()}}}function Et(n){let e,i;return e=new fe({props:{paused:n[26],clickedOnPauseBtn:n[24],controlsOpacity:n[20],controlsPosition:n[21],widthVideoContainer:n[30],heightVideoContainer:n[29],controlsBorderOffset:Me,resetCondition:n[33],separateReplayIcon:n[18],controlsColour:n[19]}}),e.$on("pausePlayEvent",n[36]),{c(){B(e.$$.fragment)},m(t,l){M(e,t,l),i=!0},p(t,l){const o={};l[0]&67108864&&(o.paused=t[26]),l[0]&16777216&&(o.clickedOnPauseBtn=t[24]),l[0]&1048576&&(o.controlsOpacity=t[20]),l[0]&2097152&&(o.controlsPosition=t[21]),l[0]&1073741824&&(o.widthVideoContainer=t[30]),l[0]&536870912&&(o.heightVideoContainer=t[29]),l[1]&4&&(o.resetCondition=t[33]),l[0]&262144&&(o.separateReplayIcon=t[18]),l[0]&524288&&(o.controlsColour=t[19]),e.$set(o)},i(t){i||(k(e.$$.fragment,t),i=!0)},o(t){g(e.$$.fragment,t),i=!1},d(t){R(e,t)}}}function ve(n){let e,i,t,l;const o=[Mt,Bt],r=[];function u(s,f){return s[0]?0:1}return e=u(n),i=r[e]=o[e](n),{c(){i.c(),t=ie()},m(s,f){r[e].m(s,f),V(s,t,f),l=!0},p(s,f){let a=e;e=u(s),e===a?r[e].p(s,f):(T(),g(r[a],1,1,()=>{r[a]=null}),W(),i=r[e],i?i.p(s,f):(i=r[e]=o[e](s),i.c()),k(i,1),i.m(t.parentNode,t))},i(s){l||(k(i),l=!0)},o(s){g(i),l=!1},d(s){s&&C(t),r[e].d(s)}}}function Bt(n){let e,i,t;return{c(){e=I("button"),_(e,"class","border-0 m-0 p-0 bg-transparent absolute"),w(e,"top","0"),w(e,"left","0"),w(e,"width",n[30]+"px"),w(e,"height",n[29]+"px")},m(l,o){V(l,e,o),i||(t=v(e,"click",n[41]),i=!0)},p(l,o){o[0]&1073741824&&w(e,"width",l[30]+"px"),o[0]&536870912&&w(e,"height",l[29]+"px")},i:D,o:D,d(l){l&&C(e),i=!1,t()}}}function Mt(n){let e,i;return e=new fe({props:{paused:n[26],clickedOnPauseBtn:n[24],controlsOpacity:n[17]?n[34]:n[20],controlsPosition:n[21],widthVideoContainer:n[30],heightVideoContainer:n[29],controlsBorderOffset:Me,resetCondition:n[33],separateReplayIcon:n[18],controlsColour:n[19]}}),e.$on("pausePlayEvent",n[36]),{c(){B(e.$$.fragment)},m(t,l){M(e,t,l),i=!0},p(t,l){const o={};l[0]&67108864&&(o.paused=t[26]),l[0]&16777216&&(o.clickedOnPauseBtn=t[24]),l[0]&1179648|l[1]&8&&(o.controlsOpacity=t[17]?t[34]:t[20]),l[0]&2097152&&(o.controlsPosition=t[21]),l[0]&1073741824&&(o.widthVideoContainer=t[30]),l[0]&536870912&&(o.heightVideoContainer=t[29]),l[1]&4&&(o.resetCondition=t[33]),l[0]&262144&&(o.separateReplayIcon=t[18]),l[0]&524288&&(o.controlsColour=t[19]),e.$set(o)},i(t){i||(k(e.$$.fragment,t),i=!0)},o(t){g(e.$$.fragment,t),i=!1},d(t){R(e,t)}}}function Rt(n){let e,i,t,l,o,r=!1,u,s=!0,f,a,c,h,P,y=n[16]&&ve(n);function b(){cancelAnimationFrame(u),t.paused||(u=Ee(b),r=!0),n[43].call(t)}return{c(){e=I("div"),y&&y.c(),i=te(),t=I("video"),l=I("track"),_(l,"kind","captions"),x(t.src,o=n[1])||_(t,"src",o),_(t,"poster",n[2]),_(t,"class","pointer-events-none relative"),_(t,"width","100%"),t.muted=n[13],t.playsInline=!0,_(t,"preload",n[11]),t.loop=n[12],n[23]===void 0&&q(()=>n[44].call(t)),q(()=>n[46].call(t)),_(e,"class","video-wrapper relative block"),_(e,"aria-hidden",n[3]),q(()=>n[48].call(e))},m(m,p){V(m,e,p),y&&y.m(e,null),N(e,i),N(e,t),N(t,l),n[42](t),f=$(t,n[46].bind(t)),n[47](e),a=$(e,n[48].bind(e)),c=!0,h||(P=[v(t,"timeupdate",b),v(t,"durationchange",n[44]),v(t,"play",n[45]),v(t,"pause",n[45])],h=!0)},p(m,p){m[16]?y?(y.p(m,p),p[0]&65536&&k(y,1)):(y=ve(m),y.c(),k(y,1),y.m(e,i)):y&&(T(),g(y,1,1,()=>{y=null}),W()),(!c||p[0]&2&&!x(t.src,o=m[1]))&&_(t,"src",o),(!c||p[0]&4)&&_(t,"poster",m[2]),(!c||p[0]&8192)&&(t.muted=m[13]),(!c||p[0]&2048)&&_(t,"preload",m[11]),(!c||p[0]&4096)&&(t.loop=m[12]),!r&&p[0]&4194304&&!isNaN(m[22])&&(t.currentTime=m[22]),r=!1,p[0]&67108864&&s!==(s=m[26])&&t[s?"pause":"play"](),(!c||p[0]&8)&&_(e,"aria-hidden",m[3])},i(m){c||(k(y),c=!0)},o(m){g(y),c=!1},d(m){m&&C(e),y&&y.d(),n[42](null),f(),n[47](null),a(),h=!1,ee(P)}}}function Ve(n){let e;const i=n[40].notes,t=Ce(i,n,n[61],_e);return{c(){t&&t.c()},m(l,o){t&&t.m(l,o),e=!0},p(l,o){t&&t.p&&(!e||o[1]&1073741824)&&Oe(t,i,l,l[61],e?Ie(i,l[61],o,Pt):Pe(l[61]),_e)},i(l){e||(k(t,l),e=!0)},o(l){g(t,l),e=!1},d(l){t&&t.d(l)}}}function St(n){let e,i,t,l,o,r,u=(n[3]&&n[4]||!n[3])&&ke(n),s=n[37].notes&&Ve(n);return{c(){e=I("div"),u&&u.c(),i=te(),s&&s.c(),t=ie(),_(e,"role","figure")},m(f,a){V(f,e,a),u&&u.m(e,null),V(f,i,a),s&&s.m(f,a),V(f,t,a),l=!0,o||(r=[v(e,"mouseover",n[57]),v(e,"focus",n[58]),v(e,"mouseout",n[59]),v(e,"blur",n[60])],o=!0)},p(f,a){f[3]&&f[4]||!f[3]?u?(u.p(f,a),a[0]&24&&k(u,1)):(u=ke(f),u.c(),k(u,1),u.m(e,null)):u&&(T(),g(u,1,1,()=>{u=null}),W()),f[37].notes?s?(s.p(f,a),a[1]&64&&k(s,1)):(s=Ve(f),s.c(),k(s,1),s.m(t.parentNode,t)):s&&(T(),g(s,1,1,()=>{s=null}),W())},i(f){l||(k(u),k(s),l=!0)},o(f){g(u),g(s),l=!1},d(f){f&&(C(e),C(i),C(t)),u&&u.d(),s&&s.d(f),o=!1,ee(r)}}}function zt(n){let e,i,t,l;return e=new ct({props:{textWidth:n[10],title:n[6],description:n[8],notes:n[7],width:n[9],class:"video "+n[5],$$slots:{default:[St]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(o,r){M(e,o,r),i=!0,t||(l=[v(window,"click",n[35]),v(window,"touchstart",n[35])],t=!0)},p(o,r){const u={};r[0]&1024&&(u.textWidth=o[10]),r[0]&64&&(u.title=o[6]),r[0]&256&&(u.description=o[8]),r[0]&128&&(u.notes=o[7]),r[0]&512&&(u.width=o[9]),r[0]&32&&(u.class="video "+o[5]),r[0]&2147481631|r[1]&1073741903&&(u.$$scope={dirty:r,ctx:o}),e.$set(u)},i(o){i||(k(e.$$.fragment,o),i=!0)},o(o){g(e.$$.fragment,o),i=!1},d(o){R(e,o),t=!1,ee(l)}}}const Me=50;function Dt(n,e,i){let t,l,{$$slots:o={},$$scope:r}=e;const u=st(o);let{src:s}=e,{poster:f=""}=e,{hidden:a=!0}=e,{ariaDescription:c=null}=e,{class:h=""}=e,{title:P=null}=e,{notes:y=null}=e,{description:b=null}=e,{width:m="normal"}=e,{textWidth:p="normal"}=e,{preloadVideo:j="auto"}=e,{loopVideo:de=!0}=e,{muteVideo:S=!0}=e,{allowSoundToAutoplay:A=!1}=e,{playVideoWhenInView:z=!0}=e,{playVideoThreshold:ce=.5}=e,{possibleToPlayPause:le=!0}=e,{showControls:oe=!0}=e,{hoverToSeeControls:pe=!1}=e,{separateReplayIcon:ye=!1}=e,{controlsColour:me="#333"}=e,{controlsOpacity:Y=.5}=e,{controlsPosition:be="top left"}=e,H=0,L,O=!0,G=!1,U,K,Q,J,E,se,X,F=!1;const Re=()=>{i(39,F=!0)},Se=d=>{const tt=d.detail.paused,it=d.detail.clickedOnPauseBtn;i(26,O=tt),i(24,G=it)};a&&!c&&console.warn("Must provide aria description for video components if hidden is true.");const ze=()=>{O===!0?i(26,O=!1):i(26,O=!0)};function De(d){Z[d?"unshift":"push"](()=>{X=d,i(32,X)})}function Ne(){H=this.currentTime,i(22,H)}function Ae(){L=this.duration,i(23,L)}function He(){O=this.paused,i(26,O),i(14,z),i(25,E),i(13,S),i(38,A),i(39,F),i(24,G)}function Le(){K=this.clientWidth,U=this.clientHeight,i(28,K),i(27,U)}function Fe(d){Z[d?"unshift":"push"](()=>{se=d,i(31,se)})}function qe(){J=this.clientWidth,Q=this.clientHeight,i(30,J),i(29,Q)}function je(d){E=d,i(25,E)}const Ge=()=>{O===!0?i(26,O=!1):i(26,O=!0)};function Ue(d){Z[d?"unshift":"push"](()=>{X=d,i(32,X)})}function Ke(){H=this.currentTime,i(22,H)}function Qe(){L=this.duration,i(23,L)}function Je(){O=this.paused,i(26,O),i(14,z),i(25,E),i(13,S),i(38,A),i(39,F),i(24,G)}function Xe(){K=this.clientWidth,U=this.clientHeight,i(28,K),i(27,U)}function Ye(){J=this.clientWidth,Q=this.clientHeight,i(30,J),i(29,Q)}const Ze=()=>{i(34,t=Y)},xe=()=>{i(34,t=Y)},$e=()=>{i(34,t=0)},et=()=>{i(34,t=0)};return n.$$set=d=>{"src"in d&&i(1,s=d.src),"poster"in d&&i(2,f=d.poster),"hidden"in d&&i(3,a=d.hidden),"ariaDescription"in d&&i(4,c=d.ariaDescription),"class"in d&&i(5,h=d.class),"title"in d&&i(6,P=d.title),"notes"in d&&i(7,y=d.notes),"description"in d&&i(8,b=d.description),"width"in d&&i(9,m=d.width),"textWidth"in d&&i(10,p=d.textWidth),"preloadVideo"in d&&i(11,j=d.preloadVideo),"loopVideo"in d&&i(12,de=d.loopVideo),"muteVideo"in d&&i(13,S=d.muteVideo),"allowSoundToAutoplay"in d&&i(38,A=d.allowSoundToAutoplay),"playVideoWhenInView"in d&&i(14,z=d.playVideoWhenInView),"playVideoThreshold"in d&&i(15,ce=d.playVideoThreshold),"possibleToPlayPause"in d&&i(16,le=d.possibleToPlayPause),"showControls"in d&&i(0,oe=d.showControls),"hoverToSeeControls"in d&&i(17,pe=d.hoverToSeeControls),"separateReplayIcon"in d&&i(18,ye=d.separateReplayIcon),"controlsColour"in d&&i(19,me=d.controlsColour),"controlsOpacity"in d&&i(20,Y=d.controlsOpacity),"controlsPosition"in d&&i(21,be=d.controlsPosition),"$$scope"in d&&i(61,r=d.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&12582912&&i(33,l=H>=L),n.$$.dirty[0]&33579008&&z&&E&&S&&i(26,O=!1),n.$$.dirty[0]&33570816&&z&&!E&&i(26,O=!0),n.$$.dirty[0]&50356224|n.$$.dirty[1]&384&&A&&z&&E&&!S&&F&&!G&&i(26,O=!1),n.$$.dirty[0]&8192|n.$$.dirty[1]&384&&A&&!S&&!F&&i(26,O=!0),n.$$.dirty[0]&65536&&(le||i(0,oe=!0))},i(34,t=0),[oe,s,f,a,c,h,P,y,b,m,p,j,de,S,z,ce,le,pe,ye,me,Y,be,H,L,G,E,O,U,K,Q,J,se,X,l,t,Re,Se,u,A,F,o,ze,De,Ne,Ae,He,Le,Fe,qe,je,Ge,Ue,Ke,Qe,Je,Xe,Ye,Ze,xe,$e,et,r]}class Nt extends re{constructor(e){super(),ae(this,e,Dt,zt,ue,{src:1,poster:2,hidden:3,ariaDescription:4,class:5,title:6,notes:7,description:8,width:9,textWidth:10,preloadVideo:11,loopVideo:12,muteVideo:13,allowSoundToAutoplay:38,playVideoWhenInView:14,playVideoThreshold:15,possibleToPlayPause:16,showControls:0,hoverToSeeControls:17,separateReplayIcon:18,controlsColour:19,controlsOpacity:20,controlsPosition:21},null,[-1,-1])}}Nt.__docgen={version:3,name:"Video.svelte",data:[{keywords:[{name:"type",description:"{string}"},{name:"required",description:""}],visibility:"public",description:"Video src",name:"src",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"}},{keywords:[],visibility:"public",description:"Image to be shown while the video is downloading",name:"poster",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{keywords:[],visibility:"public",description:"Whether to wrap the graphic with an aria hidden tag.",name:"hidden",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"ARIA description, passed in as a markdown string.",name:"ariaDescription",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{visibility:"public",description:"Add extra classes to the block tag to target it with custom CSS.",keywords:[],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Title of the graphic",name:"title",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Notes to the graphic, passed in as a markdown string.",name:"notes",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Description of the graphic, passed in as a markdown string.",name:"description",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Width of the block within the article well.",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:`Set a different width for the text within the text well, for example,
|
|
"normal" to keep the title, description and notes inline with the rest
|
|
of the text well. Can't ever be wider than \`width\`.`,name:"textWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Preload options. `auto` is ignored if `autoplay` is true. Can also be `none` or `metadata`.",name:"preloadVideo",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"auto"},{keywords:[],visibility:"public",description:"Whether the video should loop.",name:"loopVideo",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0},{keywords:[],visibility:"public",description:"Whether video should have sound or not.",name:"muteVideo",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0},{visibility:"public",description:null,keywords:[],name:"allowSoundToAutoplay",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"for video with sound, whether video should be allowed to autoplay if the user has previously interacted with DOM",name:"playVideoWhenInView",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0},{keywords:[],visibility:"public",description:"whether the video should play when it comes into view or just on page load",name:"playVideoThreshold",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:.5},{keywords:[],visibility:"public",description:"if video plays with intersection observer, how much of it should be into view to start playing",name:"possibleToPlayPause",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0},{keywords:[],visibility:"public",description:"whether to have the option to pause and play video",name:"showControls",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0},{keywords:[],visibility:"public",description:"whetner to show the play / pause buttons",name:"hoverToSeeControls",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"whether you need to hover over the video to see the controls",name:"separateReplayIcon",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"whether to use a separate replay icon or use the play icon for replay as well",name:"controlsColour",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"#333"},{keywords:[],visibility:"public",description:"change the colour of the play/pause button",name:"controlsOpacity",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:.5},{visibility:"public",description:null,keywords:[],name:"controlsPosition",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"top left"}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Custom notes and source slot",name:"notes"}],refs:[]};export{Nt as V};
|
|
//# sourceMappingURL=Video-de17ecf4.js.map
|