;
(self.AMP=self.AMP||[]).push({m:1,v:"2603032146000",n:"amp-connatix-player",ev:"0.1",l:!0,f:function(t,i){(()=>{function i(t,i,n){return i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t}function n(t,i){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);i&&(e=e.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.push.apply(n,e)}return n}var e,s={SUFFICIENT:1,INSUFFICIENT:2,UNKNOWN_NOT_REQUIRED:3,UNKNOWN:4},o={TCF_V1:1,TCF_V2:2,US_PRIVACY_STRING:3,GLOBAL_PRIVACY_PLATFORM:4};function r(){return e||(e=Promise.resolve(void 0))}var a=class{constructor(){this.promise=new Promise(((t,i)=>{this.resolve=t,this.reject=i}))}};function l(t){return new Promise((i=>{i(t())}))}var{isArray:u}=Array,{hasOwnProperty:h,toString:c}=Object.prototype;function d(t){const i=Object.create(null);return t&&Object.assign(i,t),i}function f(t){return"number"==typeof t&&isFinite(t)}function m(t,i,n,e,s,o,r,a,l,u,h){return t}function p(t,i){try{return function(t){return JSON.parse(t)}(t)}catch(t){return null==i||i(t),null}}function v(t){return(t.ownerDocument||t).defaultView}var _,P={bubbles:!0,cancelable:!0};function g(t){var i;null===(i=t.parentElement)||void 0===i||i.removeChild(t)}function A(t,i,n,e){const s=n||{};m(t.ownerDocument);const{bubbles:o,cancelable:r}=e||P,a=new MessageEvent(i,{data:s,bubbles:o,cancelable:r});t.dispatchEvent(a)}function b(t){const i=Object.getOwnPropertyDescriptor(t,"message");if(null!=i&&i.writable)return t;const{message:n,stack:e}=t,s=new Error(n);for(const i in t)s[i]=t[i];return s.stack=e,s}function y(t){let i=null,n="";for(const t of arguments)t instanceof Error&&!i?i=b(t):(n&&(n+=" "),n+=t);return i?n&&(i.message=n+": "+i.message):i=new Error(n),i}function I(t){var i,n;null===(i=(n=self).__AMP_REPORT_ERROR)||void 0===i||i.call(n,t)}function M(t,...i){try{return t.apply(null,i)}catch(t){!function(t){const i=y.apply(null,arguments);setTimeout((()=>{throw I(i),i}))}(t)}}function T(t){const i=y.apply(null,arguments);return i.expected=!0,i}function R(t,...i){I(T.apply(null,i))}var E=["Webkit","webkit","Moz","moz","ms","O","o"],w={"getPropertyPriority":()=>"","getPropertyValue":()=>""};function V(t,i,n,e,s){const o=function(t,i,n){if(i.startsWith("--"))return i;_||(_=d());let e=_[i];if(!e||n){if(e=i,void 0===t[i]){const n=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(i),s=function(t,i){for(let n=0;n<E.length;n++){const e=E[n]+i;if(void 0!==t[e])return e}return""}(t,n);void 0!==t[s]&&(e=s)}n||(_[i]=e)}return e}(t.style,i,s);if(!o)return;const r=e?n+e:n;t.style.setProperty(function(t){const i=t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()));return E.some((t=>i.startsWith(t+"-")))?`-${i}`:i}(o),r)}var k=/vertical/,x=new WeakMap,C=new WeakMap,S=new WeakMap;function O(t,i,n){const e=t.ownerDocument.defaultView;if(!e)return;let s=C.get(t);if(s||(s=[],C.set(t,s),j(e).observe(t)),!s.some((t=>t.callback===n&&t.type===i))){s.push({type:i,callback:n});const e=S.get(t);e&&setTimeout((()=>N(i,n,e)))}}function F(t,i,n){const e=C.get(t);if(e&&(function(t,e){const s=[];let o=0;for(let e=0;e<t.length;e++){const a=t[e];(r=a).callback===n&&r.type===i?s.push(a):(o<e&&(t[o]=a),o++)}var r;o<t.length&&(t.length=o)}(e),0==e.length)){C.delete(t),S.delete(t);const i=t.ownerDocument.defaultView;i&&j(i).unobserve(t)}}function j(t){let i=x.get(t);return i||(i=new t.ResizeObserver(q),x.set(t,i)),i}function q(t){const i=new Set;for(let n=t.length-1;n>=0;n--){const e=t[n],{target:s}=e;if(i.has(s))continue;i.add(s);const o=C.get(s);if(o){S.set(s,e);for(let t=0;t<o.length;t++){const{callback:i,type:n}=o[t];N(n,i,e)}}}}function N(t,i,n){if(0==t){const{contentRect:t}=n,{height:e,width:s}=t;M(i,{width:s,height:e})}else if(1==t){const{borderBoxSize:t}=n;let e;if(t)e=t.length>0?t[0]:{inlineSize:0,blockSize:0};else{const{target:t}=n,i=v(t),s=k.test(function(t,i){return t.getComputedStyle(i)||w}(i,t).writingMode),{offsetHeight:o,offsetWidth:r}=t;let a,l;s?(l=r,a=o):(a=r,l=o),e={inlineSize:a,blockSize:l}}M(i,e)}}function z(t){let i=!1,n=null,e=t;return(...t)=>(i||(n=e.apply(self,t),i=!0,e=null),n)}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var $=self.__AMP_LOG;function L(t){return $.user||($.user=U()),function(t,i){return i&&i.ownerDocument.defaultView!=t}($.user.win,t)?$.userForEmbed||($.userForEmbed=U()):$.user}function U(t){return function(t,i){throw new Error("failed to call initLogConstructor")}()}function Y(t,i,n,e,s,o,r,a,l,u,h){return t}function W(t,i,n,e,s,o,r,a,l,u,h){return L().assert(t,i,n,e,s,o,r,a,l,u,h)}function D(t,i){return Q(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),i)}function B(t,i){return Q(K(H(t)),i)}function J(t,i){const n=K(H(t));return tt(n,i)?Q(n,i):null}function G(t,i){return Z(K(t),i)}function H(t){return t.nodeType?(i=v(t),D(i,"ampdoc")).getAmpDoc(t):t;var i}function K(t){const i=H(t);return i.isSingleDoc()?i.win:i}function Q(t,i){Y(tt(t,i));const n=X(t)[i];return n.obj||(Y(n.ctor),Y(n.context),n.obj=new n.ctor(n.context),Y(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function Z(t,i){const n=X(t)[i];return n?n.promise?n.promise:(Q(t,i),n.promise=Promise.resolve(n.obj)):null}function X(t){let i=t.__AMP_SERVICES;return i||(i=t.__AMP_SERVICES={}),i}function tt(t,i){const n=t.__AMP_SERVICES&&t.__AMP_SERVICES[i];return!(!n||!n.ctor)}var it,nt,et,st,ot=t=>J(t,"action"),rt=t=>D(t,"platform"),at=t=>Q(t,"timer"),lt=t=>function(t,i,n,e){const s=G(t,i);if(s)return s;const o=H(t);return o.whenExtensionsKnown().then((()=>{const t=o.getExtensionVersion(n);return t?D(o.win,"extensions").waitForExtension(n,t):null})).then((n=>n?function(t,i){return function(t,i){const n=Z(t,i);if(n)return n;const e=X(t);return e[i]=function(){const t=new a,{promise:i,reject:n,resolve:e}=t;return i.catch((()=>{})),{obj:null,promise:i,resolve:e,reject:n,context:null,ctor:null}}(),e[i].promise}(K(t),i)}(t,i):null))}(t,"consentPolicyManager","amp-consent"),ut=t=>B(t,"viewport");function ht(t,i,n={}){const{needsRootBounds:e,rootMargin:s,threshold:o}=n,r=function(t){return t.parent&&t.parent!=t}(i)&&(e||s)?i.document:void 0;return new i.IntersectionObserver(t,{threshold:o,root:r,rootMargin:s})}function ct(t){var i;let n=null===(i=it)||void 0===i?void 0:i.get(t);if(!n){const i=function(t){it||(it=new WeakMap,nt=new WeakMap),m(nt);let i=nt.get(t);return i||(i=ht((t=>{const n=new Set;for(let s=t.length-1;s>=0;s--){var e;const{target:o}=t[s];n.has(o)||(n.add(o),m(i),i.unobserve(o),m(it),null===(e=it.get(o))||void 0===e||e.resolve(t[s]),it.delete(o))}}),t,{needsRootBounds:!0}),nt.set(t,i)),i}(v(t));m(it),i.observe(t),n=new a,it.set(t,n)}return n.promise}function dt(t){return null==t.__AMP_AUTOPLAY&&(t.__AMP_AUTOPLAY=function(t){const i=t.document.createElement("video");var n;return i.setAttribute("muted",""),i.setAttribute("playsinline",""),i.setAttribute("webkit-playsinline",""),i.setAttribute("height","0"),i.setAttribute("width","0"),i.muted=!0,i.playsInline=!0,i.playsinline=!0,i.webkitPlaysinline=!0,function(t,i){for(const n in i)V(t,n,i[n])}(i,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),n=i,l((()=>n.play())).catch((()=>{})),Promise.resolve(!i.paused)}(t)),t.__AMP_AUTOPLAY}function ft(t){return t.querySelector("video, iframe")}function mt(t,i){const n=l((()=>t.play(!!i)));return n.catch((t=>{R(0,t)})),n}function pt(t,i,n,e){let s=t,o=n,r=t=>{try{return o(t)}catch(t){var i,n;throw null===(i=(n=self).__AMP_REPORT_ERROR)||void 0===i||i.call(n,t),t}};const a=function(){if(void 0!==et)return et;et=!1;try{const t={get capture(){return et=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return et}(),l=!(null==e||!e.capture);return s.addEventListener(i,r,a?e:l),()=>{null==s||s.removeEventListener(i,r,a?e:l),o=null,s=null,r=null}}function vt(t,i,n,e){const s={detail:n};return Object.assign(s,e),new t.CustomEvent(i,s)}function _t(t,i,n,e){return pt(t,i,n,e)}function Pt(t){return t.data}function gt(t){const i=t.ownerDocument||t;return st&&st.ownerDocument===i||(st=i.createElement("div")),At}function At(t){return function(t,i){if(m(1===i.length),m(Array.isArray(i)||(n=i,h.call(n,"raw"))),self.trustedTypes&&self.trustedTypes.createPolicy){const n=self.trustedTypes.createPolicy("static-template#createNode",{createHTML:function(t){return i[0]}});t.innerHTML=n.createHTML("ignored")}else t.innerHTML=i[0];var n;const e=t.firstElementChild;return m(e),m(!e.nextElementSibling),t.removeChild(e),e}(st,t)}var bt=['<button aria-label="Unmute video" class="i-amphtml-video-mask i-amphtml-fill-content" tabindex=0></button>'],yt=["<i-amphtml-video-icon class=amp-video-eq><div class=amp-video-eq-col><div class=amp-video-eq-filler></div><div class=amp-video-eq-filler></div></div></i-amphtml-video-icon>"];function It(t,i,n){if(i[n])return i[n];const e=t.querySelector(`style[${n}], link[${n}]`);return e?(i[n]=e,e):null}function Mt(t,i){const n=t.styleSheets;for(let t=0;t<n.length;t++)if(n[t].ownerNode==i)return!0;return!1}var Tt=class{constructor(){this.Rv=!1,this.qv=new class{constructor(){this.un=null}add(t){return this.un||(this.un=[]),this.un.push(t),()=>{this.remove(t)}}remove(t){this.un&&function(t,i){const n=t.indexOf(i);-1!=n&&t.splice(n,1)}(this.un,t)}removeAll(){this.un&&(this.un.length=0)}fire(t){if(this.un)for(const i of this.un.slice())i(t)}getHandlerCount(){var t,i;return null!==(t=null===(i=this.un)||void 0===i?void 0:i.length)&&void 0!==t?t:0}}}onSessionEnd(t){this.qv.add(t)}beginSession(){this.Rv=!0}endSession(){this.Rv&&this.qv.fire(),this.Rv=!1}isSessionActive(){return this.Rv}},Rt={"title":"","artist":"","album":"","artwork":[{"src":""}]};var Et="registered",wt="playing",Vt="pause",kt="ended",xt="muted",Ct="unmuted",St="ad_start",Ot="ad_end",Ft="playing_manual",jt="paused",qt="video-play",Nt="user-interacted";function zt(t){t.signals().signal(Nt)}function $t(t){t.classList.add("i-amphtml-media-component")}var Lt="video-manager",Ut=(t,i)=>!!t&&(t.video===i||t.video.element===i);function Yt(t,i){const n=i.top+i.height/2,e=t.getSize().height/2;return Math.abs(n-e)}function Wt(t){return 10*t*5}var Dt=t=>!!t&&!isNaN(t)&&t>1;function Bt(t,i,n){const{video:e}=t;t.getAnalyticsDetails().then((t=>{n&&Object.assign(t,n),A(e.element,i,t)}))}function Jt(t){!function(t,i,n,e){const s=H(t),o=K(s);!function(t,i,n,e,s,o){const r=X(t);let a=r[n];a||(a=r[n]={obj:null,promise:null,resolve:null,reject:null,context:null,ctor:null,sharedInstance:!1}),a.ctor||(a.ctor=e,a.context=i,a.sharedInstance=!1,a.resolve&&Q(t,n))}(o,s,i,class{constructor(t){this.ampdoc=t,this.installAutoplayStyles=z((()=>function(t){!function(t,i,n,e,s){const o=t.getHeadNode(),r=function(t,i,n,e){let s=t.__AMP_CSS_SM;s||(s=t.__AMP_CSS_SM=d());const o=!n&&e&&"amp-custom"!=e&&"amp-keyframes"!=e,r=n?"amp-runtime":o?`amp-extension=${e}`:null;if(r){const n=It(t,s,r);if(n)return"STYLE"==n.tagName&&n.textContent!==i&&(n.textContent=i),n}const a=(t.ownerDocument||t).createElement("style");a.textContent=i;let l=null;return n?a.setAttribute("amp-runtime",""):o?(a.setAttribute("amp-extension",e||""),l=It(t,s,"amp-runtime")):(e&&a.setAttribute(e,""),l=t.lastChild),function(t,i,n=null){if(!n)return void function(t,i){t.insertBefore(i,t.firstChild)}(t,i);const e=n.nextSibling;t.insertBefore(i,e)}(t,a,l),r&&(s[r]=a),a}(o,function(t,i){const n=t.__AMP_CSS_TR;return n?n(i):i}(o,i),e||!1,s||null);if(n){const i=t.getRootNode();if(Mt(i,r))return n(r),r;const e=setInterval((()=>{Mt(i,r)&&(clearInterval(e),n(r))}),4)}}(t,".i-amphtml-video-mask{display:block;z-index:1;-webkit-appearance:none;appearance:none;background:transparent;border:none}.amp-video-eq{display:none}.i-amphtml-video-interface:not(amp-video) .amp-video-eq,amp-story .amp-video-eq,amp-video[controls] .amp-video-eq{display:-ms-flexbox;display:flex}[noaudio] .amp-video-eq{display:none!important}.amp-video-eq{pointer-events:none!important;-ms-flex-align:end;align-items:flex-end;bottom:7px;height:12px;opacity:0.8;overflow:hidden;position:absolute;right:7px;width:20px;z-index:1}.amp-video-eq-col{-ms-flex:1;flex:1;height:100%;margin-right:1px;position:relative}.amp-video-eq-col div{animation-name:amp-video-eq-animation;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;background-color:#fafafa;height:100%;position:absolute;width:100%;will-change:transform;animation-play-state:paused}.amp-video-eq-play .amp-video-eq-col div{animation-play-state:running}.amp-video-eq-1-1{animation-duration:0.3s;transform:translateY(60%)}.amp-video-eq-1-2{animation-duration:0.45s;transform:translateY(60%)}.amp-video-eq-2-1{animation-duration:0.5s;transform:translateY(30%)}.amp-video-eq-2-2{animation-duration:0.4s;transform:translateY(30%)}.amp-video-eq-3-1{animation-duration:0.3s;transform:translateY(70%)}.amp-video-eq-3-2{animation-duration:0.35s;transform:translateY(70%)}.amp-video-eq-4-1{animation-duration:0.4s;transform:translateY(50%)}.amp-video-eq-4-2{animation-duration:0.25s;transform:translateY(50%)}@keyframes amp-video-eq-animation{0%{transform:translateY(100%)}to{transform:translateY(0)}}\n/*# sourceURL=/css/video-autoplay.css*/",null,!1,"amp-video-autoplay")}(this.ampdoc))),this.Sv=null,this.Fv=null,this.zv=null,this.ke=at(t.win),this.jv=ot(t.getHeadNode()),this.Yv=()=>this.Lv(),this.Dv=z((()=>new class{constructor(t,i){this.Nv=i,this.ji=t,this.Wv=null,this.Bv=null,this.Sv=[],this.Uv=[],this.Hv=()=>this.Jv(),this.Gv=t=>this.Zv(t)==Ft,this.Kv=(t,i)=>this.Qv(t,i),this.Xv(),this.M_()}dispose(){this.Uv.forEach((t=>t())),this.Uv.length=0}register(t){const{video:i}=t,{element:n}=i;this.E_(n)&&(this.Sv.push(i),_t(n,Vt,this.Hv),_t(n,wt,this.Hv),_t(n,kt,this.Hv),i.signals().whenSignal(Nt).then(this.Hv),this.Jv())}M_(){const t=this.ji.getRootNode(),i=()=>this.R_();this.Uv.push(_t(t,"webkitfullscreenchange",i),_t(t,"mozfullscreenchange",i),_t(t,"fullscreenchange",i),_t(t,"MSFullscreenChange",i))}isInLandscape(){return(t=this.ji.win).screen&&"orientation"in t.screen?t.screen.orientation.type.startsWith("landscape"):90==Math.abs(t.orientation);var t}E_(t){if("video"==ft(t).tagName.toLowerCase())return!0;const i=rt(this.ji.win);return!i.isIos()&&!i.isSafari()||function(t){return!!{"amp-dailymotion":!0,"amp-ima-video":!0}[t.tagName.toLowerCase()]}(t)}R_(){this.Wv=null}Xv(){const{win:t}=this.ji,{screen:i}=t;if(i&&"orientation"in i){const t=i.orientation;this.Uv.push(_t(t,"change",(()=>this.V_())))}this.Uv.push(_t(t,"orientationchange",(()=>this.V_())))}V_(){this.isInLandscape()?null!=this.Bv&&this.k_(this.Bv):this.Wv&&this.q_(this.Wv)}k_(t){const i=rt(this.ji.win);this.Wv=t,i.isAndroid()&&i.isChrome()?t.fullscreenEnter():this.S_(t).then((()=>t.fullscreenEnter()))}q_(t){this.Wv=null,this.S_(t,"center").then((()=>t.fullscreenExit()))}S_(t,i=null){const{element:n}=t,e=this.x_();return this.C_().then((()=>ct(n))).then((({boundingClientRect:t})=>{const{bottom:s,top:o}=t,a=e.getSize().height;if(o>=0&&s<=a)return r();const l=i||(s>a?"bottom":"top");return e.animateScrollIntoView(n,l)}))}x_(){return ut(this.ji)}C_(){return at(this.ji.win).promise(330)}Jv(){if(this.isInLandscape())return Promise.resolve(this.Bv);this.Bv=null;const t=this.Sv.filter(this.Gv).map((t=>ct(t.element)));return Promise.all(t).then((t=>{const i=t.sort(this.Kv)[0];return i&&i.intersectionRatio>.5?i.target.getImpl().then((t=>this.Bv=t)):this.Bv}))}Qv(t,i){const{boundingClientRect:n,intersectionRatio:e}=t,{boundingClientRect:s,intersectionRatio:o}=i,r=e-o;if(Math.abs(r)>.1)return r;const a=ut(this.ji),l=Yt(a,n),u=Yt(a,s);return l<u||l>u?l-u:n.top-s.top}Zv(t){return this.Nv.getPlayingState(t)}}(this.ampdoc,this))),this.ke.delay(this.Yv,1e3)}dispose(){if(this.Dv().dispose(),this.Fv.disconnect(),this.Fv=null,this.Sv)for(let t=0;t<this.Sv.length;t++)this.Sv[t].dispose()}Lv(){for(let t=0;t<this.Sv.length;t++){const i=this.Sv[t];i.getPlayingState()!==jt&&(Bt(i,"video-seconds-played"),this.F_(i))}this.ke.delay(this.Yv,1e3)}F_(t){const i="timeUpdate",n=t.video.getCurrentTime(),e=t.video.getDuration();if(f(n)&&f(e)&&e>0){const s=n/e,o=vt(this.ampdoc.win,`${Lt}.${i}`,{"time":n,"percent":s});this.jv.trigger(t.video.element,i,o,1)}}register(t){Y(t);const i=t;if(this.z_(t),!t.supportsPlatform())return;if(this.Y_(t))return;if(!this.Fv){const t=t=>t.forEach((({isIntersecting:t,target:i})=>{this.L_(i).updateVisibility(t)}));this.Fv=ht(t,this.ampdoc.win,{threshold:.5})}this.Fv.observe(i.element),_t(i.element,"reloaded",(()=>n.videoLoaded())),this.Sv=this.Sv||[];const n=new class{constructor(t,i){this.Nv=t,this.ji=t.ampdoc,this.video=i,this.D_=!0,this.W_=!1,this.Sg=!1,this.B_=!1,this.ps=!1,this.U_=new Tt,this.U_.onSessionEnd((()=>Bt(this,"video-session"))),this.H_=new Tt,this.H_.onSessionEnd((()=>Bt(this,"video-session-visible"))),this.J_=z((()=>new class{constructor(t,i){this.ke=at(t),this.G_=i,this.Uv=null,this.Z_=0,this.K_=0}start(){const{element:t}=this.G_.video;this.stop(),this.Uv=this.Uv||[],this.Q_()?this.X_(this.K_):this.Uv.push(function(t,i,n,e){let s=n;const o=pt(t,"loadedmetadata",(t=>{try{s(t)}finally{s=null,o()}}),void 0);return o}(t,0,(()=>{this.Q_()&&this.X_(this.K_)}))),this.Uv.push(_t(t,kt,(()=>{this.Q_()&&this.Mg(100)})))}stop(){if(this.Uv){for(;this.Uv.length>0;)this.Uv.pop()();this.K_++}}Q_(){const{video:t}=this.G_,i=t.getDuration();if(!Dt(i))return!1;if(Wt(i)<250){const i=Math.ceil(5);this.Eg("This video is too short for `video-percentage-played`. Reports may be inaccurate. For best results, use videos over",i,"seconds long.",t.element)}return!0}Eg(...t){L().warn.apply(L(),[Lt].concat(t))}X_(t){if(t!=this.K_)return;const{G_:i,ke:n}=this,{video:e}=i,s=()=>this.X_(t);if(i.getPlayingState()==jt)return void n.delay(s,500);const o=e.getDuration();if(!Dt(o))return void n.delay(s,500);const r=(u=Wt(o),m(!0),Math.min(Math.max(u,250),4e3)),a=e.getCurrentTime()/o*100,l=5*Math.floor(a/5);var u;Y(f(l)),this.Mg(l),n.delay(s,r)}Mg(t){t<=0||this.Z_!=t&&(this.Z_=t,this.Tg(t))}Tg(t){Bt(this.G_,"video-percentage-played",{"normalizedPercentage":t.toString()})}}(this.ji.win,this))),this.Rg=!1,this.Ig=!1,this.Vg=null,this.Bt=!1,this.qg=!1,this.hasAutoplay=i.element.hasAttribute("autoplay"),this.hasAutoplay&&this.Nv.installAutoplayStyles(),this.xg=Rt,this.Og=()=>{mt(this.video,!1)},this.Fg=()=>{this.video.pause()},_t(i.element,"load",(()=>this.videoLoaded())),_t(i.element,Vt,(()=>this.$g())),_t(i.element,"play",(()=>{this.qg=!0,Bt(this,qt)})),_t(i.element,wt,(()=>this.jg())),_t(i.element,xt,(()=>this.Bt=!0)),_t(i.element,Ct,(()=>{this.Bt=!1,this.Nv.pauseOtherVideos(this)})),_t(i.element,"amp:video:tick",(t=>{const i=Pt(t),n=i.eventType;n&&this.Yg(n,i.vars)})),_t(i.element,kt,(()=>{this.B_=!1,Bt(this,"video-ended")})),_t(i.element,St,(()=>{this.B_=!0,Bt(this,"video-ad-start")})),_t(i.element,Ot,(()=>{this.B_=!1,Bt(this,"video-ad-end")})),i.signals().whenSignal(Et).then((()=>this.Lg())),this.Dg=z((()=>{const t="firstPlay",i=vt(this.ji.win,t,{}),{element:n}=this.video;ot(n).trigger(n,t,i,1)})),this.Ng()}dispose(){this.J_().stop()}Yg(t,i){const n={"__amp:eventType":t};Object.keys(i).forEach((t=>{n[`custom_${t}`]=i[t]})),Bt(this,"video-hosted-custom",n)}Ng(){this.video.signals().whenSignal("playback-delegated").then((()=>{this.D_=!1,this.Sg&&this.video.pause()}))}isMuted(){return this.Bt}isPlaybackManaged(){return this.D_}Lg(){this.Wg()&&this.Nv.registerForAutoFullscreen(this),this.hasAutoplay&&this.Bg()}Wg(){const{element:t}=this.video;return!(this.video.preimplementsAutoFullscreen()||!t.hasAttribute("rotate-to-fullscreen"))&&W(this.video.isInteractive(),"Only interactive videos are allowed to enter fullscreen on rotate. Set the `controls` attribute on %s to enable.",t)}jg(){this.Sg=!0,this.getPlayingState()==Ft&&(this.Dg(),this.Nv.pauseOtherVideos(this));const{video:t}=this,{element:i}=t;t.preimplementsMediaSessionAPI()||i.classList.contains("i-amphtml-disable-mediasession")||(function(t,i){const n=(t=>J(t,"url"))(t);if(i&&i.artwork){const{artwork:t}=i;Y(u(t)),t.forEach((t=>{if(t){const e=(i=t,"[object Object]"===c.call(i)?t.src:t);W(n.isProtocolValid(e))}var i}))}}(i,this.xg),function(t,i,n,e){const{navigator:s}=t;"mediaSession"in s&&t.MediaMetadata&&(s.mediaSession.metadata=new t.MediaMetadata(Rt),s.mediaSession.metadata=new t.MediaMetadata(i),s.mediaSession.setActionHandler("play",n),s.mediaSession.setActionHandler("pause",e))}(this.ji.win,this.xg,this.Og,this.Fg)),this.U_.beginSession(),this.ps&&this.H_.beginSession(),this.qg||Bt(this,qt)}$g(){Bt(this,"video-pause"),this.Sg=!1,this.Ig?this.Ig=!1:this.U_.endSession()}videoLoaded(){this.W_=!0,this.Vg=ft(this.video.element),this.Ug(),this.J_().start(),this.ps&&this.Hg()}Ug(){if(this.video.preimplementsMediaSessionAPI())return;this.video.getMetadata()&&(this.xg=d(this.video.getMetadata()));const t=this.ji.win.document;if(!this.xg.artwork||0==this.xg.artwork.length){const i=function(t){const i=t.querySelector('script[type="application/ld+json"]');if(!i)return;const n=p(i.textContent);return n&&n.image?"string"==typeof n.image?n.image:n.image["@list"]&&"string"==typeof n.image["@list"][0]?n.image["@list"][0]:"string"==typeof n.image.url?n.image.url:"string"==typeof n.image[0]?n.image[0]:void 0:void 0}(t)||function(t){const i=t.querySelector('meta[property="og:image"]');return i?i.getAttribute("content"):void 0}(t)||function(t){const i=t.querySelector('link[rel="shortcut icon"]')||t.querySelector('link[rel="icon"]');return i?i.getAttribute("href"):void 0}(t);i&&(this.xg.artwork=[{"src":i}])}if(!this.xg.title){const i=this.video.element.getAttribute("title")||this.video.element.getAttribute("aria-label")||this.Vg.getAttribute("title")||this.Vg.getAttribute("aria-label")||t.title;i&&(this.xg.title=i)}}Jg(){this.W_&&this.Hg()}Hg(){this.ji.isVisible()&&dt(this.ji.win).then((t=>{this.hasAutoplay&&!this.userInteracted()&&t?this.Gg():this.Zg()}))}Bg(){this.video.isInteractive()&&this.video.hideControls(),dt(this.ji.win).then((t=>{t||!this.video.isInteractive()?(this.video.mute(),this.Kg()):this.video.showControls()}))}Kg(){const{video:t}=this,{element:i,win:n}=this.video;if(i.hasAttribute("noaudio")||i.signals().get(Nt))return;const e=function(t,i){const n=gt(i)(yt),e=n.firstElementChild;for(let t=0;t<4;t++){const i=e.cloneNode(!0),s=i.children;for(let i=0;i<s.length;i++)s[i].classList.add(`amp-video-eq-${t+1}-${i+1}`);n.appendChild(i)}return g(e),n}(0,i),s=[e];function o(i){t.mutateElementSkipRemeasure((()=>{s.forEach((t=>{!function(t,i){void 0===i&&(i=t.hasAttribute("hidden")),i?t.removeAttribute("hidden"):t.setAttribute("hidden","")}(t,i)}))}))}function r(i){t.mutateElementSkipRemeasure((()=>e.classList.toggle("amp-video-eq-play",i)))}const a=[_t(i,Vt,(()=>r(!1))),_t(i,wt,(()=>r(!0))),_t(i,St,(()=>{o(!1),t.showControls()})),_t(i,Ot,(()=>{o(!0),t.hideControls()})),_t(i,Ct,(()=>zt(t)))];if(t.isInteractive()){t.hideControls();const n=function(t,i){const n=gt(t)(bt);return i&&i.title&&n.setAttribute("aria-label",i.title),n}(i,this.xg);s.push(n),a.push(_t(n,"click",(()=>zt(t))))}t.mutateElementSkipRemeasure((()=>{s.forEach((t=>{i.appendChild(t)}))})),this.B_&&o(!1),t.signals().whenSignal(Nt).then((()=>{this.Dg(),t.isInteractive()&&t.showControls(),t.unmute(),a.forEach((t=>{t()})),t.mutateElementSkipRemeasure((()=>{s.forEach((t=>{g(t)}))}))}))}Gg(){this.D_&&(this.ps?(this.H_.beginSession(),mt(this.video,!0),this.Rg=!0):(this.Sg&&this.H_.endSession(),this.video.pause(),this.Ig=!0))}Zg(){this.ps?this.H_.beginSession():this.Sg&&this.H_.endSession()}updateVisibility(t){const i=this.ps;this.ps=t,t!=i&&this.Jg()}getPlayingState(){return this.Sg?this.Sg&&this.Rg&&!this.userInteracted()?"playing_auto":Ft:jt}isRollingAd(){return this.B_}userInteracted(){return null!=this.video.signals().get(Nt)}getAnalyticsDetails(){const{video:t}=this;return Promise.all([dt(this.ji.win),ct(t.element)]).then((i=>{const n=i[0],e=i[1],{height:s,width:o}=e.boundingClientRect,r=this.hasAutoplay&&n,a=t.getPlayedRanges(),l=a.reduce(((t,i)=>t+i[1]-i[0]),0);return{"autoplay":r,"currentTime":t.getCurrentTime(),"duration":t.getDuration(),"height":s,"id":t.element.id,"muted":this.Bt,"playedTotal":l,"playedRangesJson":JSON.stringify(a),"state":this.getPlayingState(),"width":o}}))}}(this,t);this.Sv.push(n);const{element:e}=n.video;A(e,Et),$t(e),t.signals().signal(Et),e.classList.add("i-amphtml-video-interface")}z_(t){n("play",(()=>mt(t,!1))),n("pause",(()=>t.pause())),n("mute",(()=>t.mute())),n("unmute",(()=>t.unmute()));const i=()=>t.fullscreenEnter();function n(i,n){t.registerAction(i,(()=>{zt(t),n()}),1)}n("fullscreenenter",i),n("fullscreen",i)}Y_(t){if(Ut(this.zv,t))return this.zv;for(let i=0;this.Sv&&i<this.Sv.length;i++){const n=this.Sv[i];if(Ut(n,t))return this.zv=n,n}return null}L_(t){return Y(this.Y_(t))}registerForAutoFullscreen(t){this.Dv().register(t)}Qg(){return this.Dv()}getVideoStateProperty(t,i){const n=this.ampdoc.getRootNode(),e=L().assertElement(n.getElementById(t),`Could not find an element with id="${t}" for VIDEO_STATE`),s=this.L_(e);return(s?s.getAnalyticsDetails():r()).then((t=>t?t[i]:""))}getPlayingState(t){return this.L_(t).getPlayingState()}isMuted(t){return this.L_(t).isMuted()}userInteracted(t){return this.L_(t).userInteracted()}isRollingAd(t){return this.L_(t).isRollingAd()}pauseOtherVideos(t){this.Sv.forEach((i=>{i.isPlaybackManaged()&&i!==t&&i.getPlayingState()==Ft&&i.video.pause()}))}})}(t,"video-manager")}function Gt(t){return t?xt:Ct}var Ht=class extends t.BaseElement{constructor(t){super(t),this.lP="",this._P="",this.PP=null,this.vg=null,this.Xg=null,this.tP=null,this.gP=this.gP.bind(this),this.kg=new class{constructor(t){this.el=t,this.Sg=!1,this.Pg=!1,this._g=this._g.bind(this)}updatePlaying(t){t!==this.Sg&&(this.Sg=t,t?(this.Pg=!1,O(this.el,1,this._g)):function(t,i){F(t,1,i)}(this.el,this._g))}_g({blockSize:t,inlineSize:i}){const n=i>0&&t>0;if(n===this.Pg)return;this.Pg=n;const e=this.el;n||e.pause()}}(this.element),this.AP=!1,this.Bt=!0,this.Wu=null}pP(t,i){this.Xg&&this.Xg.then((n=>{n&&n.contentWindow&&n.contentWindow.postMessage(JSON.stringify({"event":"command","func":t,"args":i||""}),this.PP)}))}bP(){this.win.addEventListener("message",(t=>{if(!this.vg||t.source!==this.vg.contentWindow)return;const i=p(Pt(t));if(i&&"command"===i.event){switch(i.func){case"cnxClose":this.yP(),this.attemptCollapse();break;case"cnxPlayerRendered":this.tP(this.vg);break;case"cnxContentPlaying":this.kg.updatePlaying(!0);break;case"cnxContentPaused":this.kg.updatePlaying(!1);break;case"cnxFullscreenChanged":{const t=i.args;this.AP=t;break}case"cnxToggleFullscreen":this.AP?this.fullscreenExit():this.fullscreenEnter();break;case"cnxVolumeChanged":{const t=i.args;this.Bt=0===t,A(this.element,Gt(this.Bt));break}}!function(t,i,n){if(null==n[i])return!1;const e=n[i];(u(e)?e:[e]).forEach((i=>{A(t,i)}))}(this.element,i.func.toString(),{"cnxContentPlaying":wt,"cnxContentPaused":Vt})}}))}IP(){const t=super.getConsentPolicy()||"default",i=function(t,i="default"){return lt(t).then((t=>t?t.whenPolicyResolved(i):null))}(this.element,t),n=function(t,i="default"){return lt(t).then((t=>t?t.getConsentStringInfo(i):null))}(this.element,t),e=(r=this.element,a=t,lt(r).then((t=>t?t.getMergedSharedData(a):null)));var r,a;const l=function(t,i="default"){return lt(t).then((t=>t?t.getConsentMetadataInfo(i):null))}(this.element,t);(function(t){function i(t){return{status:"fulfilled",value:t}}function n(t){return{status:"rejected",reason:t}}return Promise.all(t.map((t=>t.then(i,n))))})([i,n,e,l]).then((t=>{if(t&&4===t.length){const i=t[0],n=t[1],e=t[2],r=t[3],a={"consentPolicyStateEnum":s,"consentStringTypeEnum":o,"consentPolicyState":{"error":i.reason,"value":i.value},"rawConsentString":{"error":n.reason,"value":n.value},"consentSharedData":{"error":e.reason,"value":e.value},"consentMetadata":{"error":r.reason,"value":r.value}};this.pP("ampConsentInfo",a)}}))}yP(){this.vg&&(g(this.vg),this.vg=null)}buildCallback(){const{element:t}=this;Jt(t),$t(t),this.lP=W(t.getAttribute("data-player-id"),"The data-player-id attribute is required for <amp-connatix-player> %s",t),this._P=t.getAttribute("data-media-id")||"";const i=t.getAttribute("data-elements-player")||!1;this.PP=i?"https://cdm.elements.video":"https://amp.cntxcdm.com";const n=new a;this.Xg=n.promise,this.tP=n.resolve}preconnectCallback(t){var i;(i=this.win,D(i,"preconnect")).url(this.getAmpDoc(),this.PP,t)}layoutCallback(){const{element:t}=this,e=function(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?n(Object(s),!0).forEach((function(n){i(t,n,s[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(s,i))}))}return t}({"playerId":this.lP||void 0,"mediaId":this._P||void 0,"url":(r=t,B(r,"documentInfo").get()).sourceUrl,"isSafariOrIos":this.MP()},function(t,i,n){const{dataset:e}=t,s={},o=/^param(.+)/;for(const t in e){const i=t.match(o);i&&(s[i[1][0].toLowerCase()+i[1].substr(1)]=e[t])}return s}(t)),s=function(t,i,n){if(!i)return t;const e=t.split("#",2),s=e[0].split("?",2);let o=s[0]+(s[1]?`?${s[1]}&${i}`:`?${i}`);return o+=e[1]?`#${e[1]}`:"",o}(this.PP+"/amp-embed/index.html",function(t){const i=[];for(const o in t){let r=t[o];if(null!=r){r=u(s=r)?s:[s];for(let t=0;t<r.length;t++)i.push((n=o,e=r[t],`${encodeURIComponent(n)}=${encodeURIComponent(e)}`))}}var n,e,s;return i.join("&")}(e)),o=t.ownerDocument.createElement("iframe");var r;if(o.setAttribute("frameborder","0"),o.setAttribute("allowfullscreen","true"),o.src=s,function(t,i){t.classList.add("i-amphtml-fill-content"),t.classList.add("i-amphtml-replaced-content")}(o),function(t){let i=t.getAttribute("allow")||"";i+="autoplay;",t.setAttribute("allow",i)}(o),t.appendChild(o),this.vg=o,(t=>B(t,"video-manager"))(t).register(this),this.bP(),this.IP(),!this.Wu){const t=t=>{for(const i of t)"attributes"===i.type&&"class"===i.attributeName&&this.pP(i.target.classList.contains("i-amphtml-video-docked")?"dock":"undock")};this.Wu=new MutationObserver(t)}return this.Wu.observe(this.vg,{attributes:!0,childList:!1,subtree:!1}),function(t,i){O(t,0,i)}(this.element,this.gP),this.kg.updatePlaying(!0),A(this.element,Gt(this.Bt)),this.loadPromise(o).then((()=>this.Xg))}isLayoutSupported(t){return function(t){return"fixed"==t||"fixed-height"==t||"responsive"==t||"fill"==t||"flex-item"==t||"fluid"==t||"intrinsic"==t}(t)}gP({height:t,width:i}){this.vg&&this.pP("ampResize",{"width":i,"height":t})}pauseCallback(){this.vg&&(this.pP("ampPause"),this.vg.src=this.vg.src)}unlayoutCallback(){this.yP();const t=new a;return this.Xg=t.promise,this.tP=t.resolve,F(this.element,0,this.gP),this.Wu.disconnect(),this.kg.updatePlaying(!1),!0}MP(){const t=rt(this.win);return t.isSafari()||t.isIos()}supportsPlatform(){return!0}isInteractive(){return!0}play(t){this.pP("play")}pause(){this.pP("pause")}mute(){this.pP("mute")}unmute(){this.pP("unmute")}showControls(){}hideControls(){}fullscreenEnter(){this.vg&&(this.MP()?this.pP("toggleFullscreen",!0):(function(t){const i=t.requestFullscreen||t.requestFullScreen||t.webkitRequestFullscreen||t.webkitEnterFullscreen||t.msRequestFullscreen||t.mozRequestFullScreen;i&&i.call(t)}(this.vg),this.AP=!0,this.pP("updateFullscreenUi",!0)))}fullscreenExit(){this.vg&&(this.MP()?this.pP("toggleFullscreen",!1):(function(t){const i=t.cancelFullScreen||t.exitFullscreen||t.webkitExitFullscreen||t.webkitCancelFullScreen||t.mozCancelFullScreen||t.msExitFullscreen;if(i)return void i.call(t);const{ownerDocument:n}=t;if(!n)return;const e=n.cancelFullScreen||n.exitFullscreen||n.webkitExitFullscreen||n.webkitCancelFullScreen||n.mozCancelFullScreen||n.msExitFullscreen;e&&e.call(n)}(this.vg),this.AP=!1,this.pP("updateFullscreenUi",!1)))}isFullscreen(){return!!this.vg&&this.AP}getMetadata(){}preimplementsMediaSessionAPI(){return!0}preimplementsAutoFullscreen(){return!1}getCurrentTime(){return NaN}getDuration(){return NaN}getPlayedRanges(){return[]}seekTo(t){this.user().error("TAG","`seekTo` not supported.")}};t.registerElement("amp-connatix-player",Ht)})();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});
//# sourceMappingURL=amp-connatix-player-0.1.mjs.map