UNPKG

cloudinary-video-player

Version:
7 lines 472 kB
console.warn('[Cloudinary] The "light" video-player is deprecated and will be removed in a future release. The main player is now light by default. Please use that instead.'); /*! * Cloudinary Video Player v4.0.3 * Built on 2026-06-07T12:23:47.824Z * https://github.com/cloudinary/cloudinary-video-player */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["cloudinary-video-player"]=t():e["cloudinary-video-player"]=t()}(self,()=>(()=>{var e,t,i={7878(e){const t=e=>{e.style.display="none"},i=e=>{e.style.display=""};e.exports={hide:t,show:i,setText:(e,s)=>{if(!s||s.length<=0)return e.innerText="",void t(e);e.innerText=s,i(e)}}},223(e,t,i){"use strict";var s=i(6673),n=i.n(s),r=i(1104);const o=n().getComponent("ErrorDisplay");const a=class extends o{content(){const e=this.player().error();if(!e)return"";const t=n().dom.createEl("div",{className:"cld-error-display-content"}),i=n().dom.createEl("div",{className:"cld-error-header"}),s=n().dom.createEl("span",{className:"cld-error-title"},{},this.localize("Something went wrong")),o=n().dom.createEl("div",{className:"cld-error-message"});i.appendChild(s),e.isHtml?o.innerHTML=this.localize(e.message):o.textContent=this.localize(e.message),t.appendChild(i),t.appendChild(o);const a=o.querySelector(".cld-error-refresh");return a&&(a.onclick=e=>{e.preventDefault(),this.player().trigger(r.f.REFRESH)}),t}},l=n().getComponent("ClickableComponent");class c extends l{handleClick(e){super.handleClick(e),this.player().currentTime(this.player().currentTime()+10)}createEl(){return n().dom.createEl("button",{className:"vjs-control vjs-icon-skip-10-plus vjs-icon-forward-10 vjs-button",ariaLabel:"Jump forward 10 seconds"})}}n().registerComponent("JumpForwardButton",c);const h=n().getComponent("ClickableComponent");class u extends h{handleClick(e){super.handleClick(e),this.player().currentTime(this.player().currentTime()-10)}createEl(){return n().dom.createEl("button",{className:"vjs-control vjs-icon-skip-10-min vjs-icon-replay-10 vjs-button",ariaLabel:"Jump back 10 seconds"})}}n().registerComponent("JumpBackButton",u);const d=n().getComponent("ClickableComponent");class p extends d{createEl(){const e=this.options_.playerOptions,t=e.showLogo?"block":"none",i=e.logoImageUrl?`background-image: url(${e.logoImageUrl})`:"";return n().dom.createEl("a",{},{class:"vjs-control vjs-cloudinary-button vjs-button",href:e.logoOnclickUrl,target:"_blank",style:`display: ${t}; ${i}`,"aria-label":"Logo link"})}}n().registerComponent("logoButton",p);const f=n().getComponent("Component");class g extends f{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}createEl(){return super.createEl("div",{className:"vjs-progress-control-events-blocker"})}}n().registerComponent("progressControlEventsBlocker",g);var m=i(7878),y=i.n(m),v=i(2415),_=i(5770),b=i(7311);const w=n().dom||n(),T=n().getComponent("Component");class C extends T{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.on(e,"cldsourcechanged",(e,t)=>{let{source:i}=t;return this.setItem(i)})}setItem(e){if(!e)return this.setTitle(""),void this.setDescription("");const t=e.info();this.setTitle(t.title),this.setDescription(t.subtitle);const i=e.title&&!0===e.title(),s=e.description&&!0===e.description();(i||s)&&this.fetchAutoMetadata(e,i,s)}fetchAutoMetadata(e,t,i){if(e.isRawUrl)return;const s=e.cloudinaryConfig(),n=e.publicId();if(!s?.cloud_name||!n)return;const r=(0,_.k$)(s),o=e.getInitOptions().type||"upload",a=(0,b.N)(`${r}/_applet_/video_service/video_metadata/${o}/${(0,v.G)(n)}.json`,e.queryParams());fetch(a,{headers:{"X-Cld-Video-Player-Version":"4.0.3"}}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t&&e.title&&this.setTitle(e.title),i&&e.description&&this.setDescription(e.description)}).catch(e=>{console.warn(`Failed to fetch metadata for ${n}:`,e)})}setTitle(e){const t="string"==typeof e?e:"";return y().setText(this.titleEl,t),this.refresh(),t}setDescription(e){const t="string"==typeof e?e:"";return y().setText(this.descriptionEl,t),this.refresh(),t}refresh(){(()=>this.titleEl.innerText)()||(()=>this.descriptionEl.innerText)()?this.show():this.hide()}createEl(){this.titleEl=w.createEl("div",{className:"vjs-title-bar-title"}),this.descriptionEl=w.createEl("div",{className:"vjs-title-bar-subtitle"});const e=super.createEl("div",{append:this.titleEl,className:"vjs-title-bar"});return e.appendChild(this.titleEl),e.appendChild(this.descriptionEl),e}}n().registerComponent("titleBar",C);const k=n().getComponent("MenuItem");class S extends k{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,{...t,selectable:!0,multiSelectable:!1,selected:!!t.selected,label:t.label}),this.value=t.value,this._ssIndex=t.index,this._onSelect="function"==typeof t.onSelect?t.onSelect:null}handleClick(e){super.handleClick(e),this._onSelect&&this._onSelect({index:this._ssIndex,value:this.value,label:this.options_.label})}}n().registerComponent("SourceMenuItem",S);const x=S,E=n().getComponent("MenuButton"),j=n().getComponent("MenuItem");class A extends E{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,t),this.controlText(t.tooltip||"Sources"),this._emptyLabel=t.emptyLabel||"No sources",this._items=Array.isArray(t.items)?t.items:[],this._selectedIndex=Number.isInteger(t.defaultIndex)?t.defaultIndex:void 0,this._onSelected="function"==typeof t.onSelected?t.onSelected:null,this._setEnabled(this._items.length>0);const i=this.el().querySelector(".vjs-icon-placeholder");i&&i.classList.add("vjs-icon-source-switcher")}buildCSSClass(){return`vjs-source-switcher-button${!Array.isArray(this._items)||0===this._items.length?" vjs-source-switcher-disabled":""} ${super.buildCSSClass()}`}createItems(){if(!Array.isArray(this._items)||0===this._items.length){const e=new j(this.player_,{label:this._emptyLabel,selectable:!1});return e.addClass("vjs-source-switcher-empty"),e.disable(),[e]}return this._items.map((e,t)=>{let{label:i,value:s}=e;return new x(this.player_,{label:i,value:s,index:t,selected:t===this._selectedIndex,onSelect:e=>this._handleItemSelect(e)})})}_handleItemSelect(e){let{index:t}=e;this._selectedIndex!==t&&this.setSelected(t)}setItems(e){this._items=Array.isArray(e)?e:[],this._selectedIndex=this._items.length?0:void 0,this._setEnabled(this._items.length>0),this._rebuildMenu()}setSelected(e){if(!Array.isArray(this._items)||null==e||e<0||e>=this._items.length)return;this._selectedIndex=e,this.menu&&"function"==typeof this.menu.children&&this.menu.children().forEach(t=>{t instanceof j&&t.selected(t._ssIndex===e)});const{value:t}=this._items[e];this._onSelected&&this._onSelected({index:e,value:t},this.player_)}setOnSelected(e){this._onSelected="function"==typeof e?e:null}_rebuildMenu(){if(!this.menu)return;this.menu.children().slice().forEach(e=>this.menu.removeChild(e)),this.createItems().forEach(e=>this.menu.addItem(e));const e=this.el&&this.el();if(e){const t=0===this._items.length;e.classList.toggle("vjs-source-switcher-disabled",t),e.setAttribute("aria-disabled",String(t))}}_setEnabled(e){const t=this.el&&this.el();t&&(t.classList.toggle("vjs-source-switcher-disabled",!e),t.setAttribute("aria-disabled",String(!e)))}}n().registerComponent("sourceSwitcherButton",A);const P=n().getComponent("BigPlayButton");class O extends P{constructor(e,t){super(e,t),this.boundUpdate=this.handleUpdate.bind(this);const i=this.player();i.on("play",this.boundUpdate),i.on("pause",this.boundUpdate),this.handleUpdate()}buildCSSClass(){return`${super.buildCSSClass()} vjs-big-pause-button`}handleClick(){const e=this.player();!e.paused()&&e.pause()}handleUpdate(){const e=this.player();if(!e)return;const t=e.paused();!t&&e.hasStarted()?this.show():this.hide(),this[t?"removeClass":"addClass"]("vjs-playing"),this.controlText("Pause")}dispose(){if(this.boundUpdate){const e=this.player();e.off("play",this.boundUpdate),e.off("pause",this.boundUpdate)}super.dispose()}}n().registerComponent("BigPauseButton",O);n().registerComponent("ErrorDisplay",a)},7668(e,t,i){"use strict";i.d(t,{A:()=>a});var s=i(6673),n=i.n(s);const r=e=>{const t=e.loop(),i=e.paused(),s=e.muted(),n=e.isFullscreen(),r={class:"player-version",label:"Cloudinary Player v4.0.3"};return e.controls()?[{label:t?"Unloop":"Loop",listener:()=>{e.loop(!t)}},{label:i?"Play":"Pause",listener:()=>{i?e.play():e.pause()}},{label:s?"Unmute":"Mute",listener:()=>{e.muted(!s)}},{label:n?"Exit Fullscreen":"Fullscreen",listener:()=>{n?e.exitFullscreen():e.requestFullscreen()}},r]:[r]};var o=i(608);const a={logoOnclickUrl:"https://cloudinary.com/",showLogo:!0,showJumpControls:!1,playsinline:n().browser.IS_IOS,skin:"dark",controls:!1,chaptersButton:!1,pictureInPictureToggle:!1,seekThumbnails:!0,aiHighlightsGraph:!1,visualSearch:!1,download:!1,preload:o.Am.AUTO,textTrackSettings:!1,loop:!1,muted:!1,posterOptions:{},sourceTypes:["auto"],breakpoints:!1,contextMenu:{content:r},floatingWhenNotVisible:o.rT.NONE,hideContextMenu:!1,analytics:!1,cloudinaryAnalytics:!0,allowUsageReport:!0,videoConfig:!0,playedEventPercents:[25,50,75,100],adaptiveStreaming:{strategy:"balanced"},html5:{handlePartialData:!1,nativeTextTracks:!1},disableSeekWhileScrubbingOnMobile:!0}},8513(e,t,i){"use strict";i.d(t,{A:()=>y,q:()=>f});var s=i(6673),n=i.n(s),r=i(6827),o=i.n(r),a=i(8953),l=i.n(a),c=i(1104);const h={percentsplayed:{percents:[25,50,75,100]}},u=[c.f.PLAYER_LOAD,c.f.VIDEO_LOAD,c.f.START,c.f.PAUSE_NO_SEEK,c.f.SEEK,c.f.MUTE,c.f.UNMUTE,c.f.QUALITY_CHANGED,c.f.PERCENTS_PLAYED],d={events:u};class p extends(o()){constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.player=e;const i=n().obj.merge(d,t);t.events&&(i.events=[...u,...t.events]);let s={lastState:void 0},r=0,o=0,a=!1,l=[],p=[],y=null,v=!1,_=!1;const b=e=>{this.player.muted()&&"muted"!==s.lastState?(s.lastState="muted",this.emit(c.f.MUTE,e)):this.player.muted()||"unmuted"===s.lastState||(s.lastState="unmuted",this.emit(c.f.UNMUTE,e))},w=e=>{const t=this.player.currentTime(),i=this.player.duration(),s=(t,i)=>{i.originalType="timeupdate",this.emit(t,e,i)};if(this.events.percentsplayed&&this.events.percentsplayed.percents.forEach(e=>{g(t,i,e)&&-1===l.indexOf(e)&&(l.push(e),s(c.f.PERCENTS_PLAYED,{percent:e}))}),this.events.timeplayed){const e=this.events.timeplayed;(e.interval?[Math.floor(t/e.interval)*e.interval]:e.times).forEach(e=>{m(t,e)&&-1===p.indexOf(e)&&(p.push(e),s(c.f.TIME_PLAYED,{time:e}))})}this.events.seek&&(r=o,o=t,Math.abs(r-o)>1&&(a=!0,k(),s(c.f.SEEK,{seekStart:r,seekEnd:o})))},T=e=>{Math.round(this.player.currentTime())===Math.round(this.player.duration())||a||this.emit(c.f.PAUSE_NO_SEEK,e)},C=()=>{a=!1},k=()=>{l=[],p=[],_=!1};this.events=f(i.events,h),s={lastState:void 0},r=o=0,a=!1,_=!1,k(),this.emit(c.f.PLAYER_LOAD,null,{url:window.location.href}),this.player.on(c.f.PLAYING,(()=>{_||(_=!0,this.emit(c.f.START))}).bind(this)),this.player.on(c.f.PLAY,(()=>{v&&(this.player.trigger("replay"),v=!1)}).bind(this)),this.player.on(c.f.ENDED,(()=>{v=!0}).bind(this)),(this.events.percentsplayed||this.events.timeplayed||this.events.seek||this.events.totaltimeplayed)&&this.player.on(c.f.TIME_UPDATE,w.bind(this)),(this.events.mute||this.events.unmute)&&this.player.on(c.f.VOLUME_CHANGE,b.bind(this)),this.events.pausenoseek&&(this.player.on(c.f.PAUSE,T.bind(this)),this.player.on(c.f.PLAY,C.bind(this))),this.player.on(c.f.LOADED_METADATA,(()=>{const e=this.player.currentSource().src;e!==y&&(k(),y=e,this.emit(c.f.VIDEO_LOAD,null,{src:e}))}).bind(this)),this.player.on(c.f.LOADED_DATA,(e=>{let t=this,i=this.player.textTracks(),s=null;for(let e=0;e<i.length;e++)"segment-metadata"===i[e].label&&(s=i[e]);let n=null;s&&s.on("cuechange",function(){let i=s.activeCues[0];if(i){let s=i.value.resolution;if(n!==s){let i={from:n,to:s};t.emit(c.f.QUALITY_CHANGED,e,i)}n=s}})}).bind(this))}}const f=(e,t)=>{let i=e;return"Array"===e.constructor.name&&(i=e.reduce((e,i)=>{const s=t[i]||{};return l()(i)?e[i.type]=Object.assign({},s,i):e[i]=s,e},{})),i},g=function(e,t,i){return m(e,t*i/100,arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5)},m=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5;return e<=t+i&&e>=t-i},y=p},7490(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>h,player:()=>l,players:()=>c,videoPlayer:()=>o,videoPlayers:()=>a});var s=i(6801),n=i(9606);const r=(e,t,i,s)=>[...document.querySelectorAll(e)].map(e=>s(e,t,i)),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return(0,s.createVideoPlayer)(e,t,i)},a=(e,t,i)=>r(e,t,i,o),l=function(e){return(async(e,t,s,r)=>{const o=Object.assign({},t),a=(0,n.yn)(e),l=await(async()=>{try{const{fetchAndMergeConfig:e}=await i.e(309).then(i.bind(i,4309)),t=await e(o);return Object.assign({},t,o)}catch{return o}})();if(l?.schedule?.weekly){const{shouldUseScheduleBootstrap:t,scheduleBootstrap:n}=await i.e(689).then(i.bind(i,5689));if(t(l))return n(e,l,s)}return(0,n.VB)(l)?(0,n.Lg)(e,l,s):r(a,l,s)})(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2?arguments[2]:void 0,s.createPlayerWithConfig)},c=(e,t,i)=>(async(e,t,i,s)=>{const n=document.querySelectorAll(e);return Promise.all([...n].map(e=>s(e,t,i)))})(e,t,i,l),h=(e=>{const t={...window.cloudinary||{},...e};return window.cloudinary=t,t})({videoPlayer:o,videoPlayers:a,player:l,players:c,Cloudinary:{new:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.warn("Cloudinary.new() is deprecated and will be removed. Please use cloudinary.videoPlayer() instead.");const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},e,t)};return{videoPlayer:function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return(0,s.createVideoPlayer)(e,t(i),n)},videoPlayers:function(e){let i=arguments.length>2?arguments[2]:void 0;return r(e,t(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),i,o)}}}}})},7707(e,t,i){"use strict";async function s(e){const t=this;try{e.isDash&&!window.dashjs&&await i.e(367).then(i.bind(i,6604));const{default:s}=await i.e(26).then(i.bind(i,833));s(t,e)}catch(e){console.error("Failed to load plugin:",e)}}i.r(t),i.d(t,{default:()=>s})},5770(e,t,i){"use strict";i.d(t,{bo:()=>$,dC:()=>U,ww:()=>z,lP:()=>D,KA:()=>R,k$:()=>L.k,iT:()=>L.i,Nl:()=>N,N7:()=>F,a5:()=>M,hS:()=>H,M6:()=>W});var s=i(6673),n=i.n(s),r=i(4319),o=i.n(r),a=i(5871),l=i(8953),c=i.n(l),h=i(7571),u=i.n(h),d=i(2901),p=i(9914),f=i(4728),g=i(2798),m=i(593),y=i(7704);function v(e){const t=[];let i="";if(Object.keys(f.Bu).forEach(i=>{let s=f.Bu[i],n=e[i]||s;n!==s&&t.push(n)}),Object.keys(e).forEach(i=>{"letter_spacing"!==i&&"line_spacing"!==i||t.push(`${i}_${e[i]}`),"font_hinting"===i&&t.push(`${i.split("_").pop()}_${e[i]}`),"font_antialiasing"===i&&t.push(`antialias_${e[i]}`)}),e.hasOwnProperty("font_size")||!t||0===t.length){if(!e.font_size)throw"Must supply font_size for text in overlay/underlay";if(!e.font_family)throw"Must supply font_family for text in overlay/underlay";t.unshift(e.font_size),t.unshift(e.font_family),i=t.filter(e=>e).join("_")}return i}function _(e){if(e instanceof m.A||e instanceof y.A)return e.toString();let t="";if((0,d.G)(e))if("fetch"===e.resource_type||null!=e.url)t=`fetch:${(0,p.K)(e.url)}`;else{let i=e.public_id,s=e.format,n=e.resource_type||"image",r=e.type||"upload",o=e.text,a=null,l=[];const c=!i||0===i.length;if(c||(i=i.replace(new RegExp("/","g"),":"),null!=s&&(i=`${i}.${s}`)),o&&0!==o.length||"text"===n){if(n="text",r=null,a=v(e),o&&o.length>=0){const e=!a;if(!c&&!e||c&&e)throw"Must supply either style parameters or a public_id when providing text parameter in a text overlay/underlay";let t=/\$\([a-zA-Z]\w*\)/g,i=0,s=(0,g.$)(decodeURIComponent(o),/[,\/]/g);o="";for(let e=t.exec(s);e;e=t.exec(s))o+=(0,g.$)(s.slice(i,e.index)),o+=e[0],i=e.index+e[0].length;o+=encodeURIComponent(s.slice(i))}}else{if(c)throw"Must supply public_id for resource_type layer_parameter";"subtitles"===n&&(a=v(e))}"image"!==n&&l.push(n),"upload"!==r&&l.push(r),l.push(a),l.push(i),l.push(o),t=l.filter(e=>e).join(":")}else t=/^fetch:.+/.test(e)?`fetch:${(0,p.K)(e.substr(6))}`:e;return t}function b(e){if("string"!=typeof e||0===e.length||e.match(/^!.+!$/))return e?e.toString():e;e=String(e);const t=new RegExp("((\\|\\||>=|<=|&&|!=|>|=|<|/|-|\\+|\\*|\\^)(?=[ _]))","g");e=e.replace(t,e=>f.vo[e]);const i="("+Object.keys(f.wL).join("|")+")",s=new RegExp(`(\\$_*[^_ ]+)|${i}`,"g");return(e=e.replace(s,e=>f.wL[e]||e)).replace(/[ _]+/g,"_")}function w(e){switch(!0){case null==e:return[];case Array.isArray(e):return e;default:return[e]}}function T(e){if(!(0,d.G)(e))return e;if("remote"===e.function_type){const t=(0,p.K)(e.source).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return[e.function_type,t].join(":")}return[e.function_type,e.source].join(":")}function C(e){switch(e&&e.constructor){case String:return f.K9.test(e)?e.split(".."):e;case Array:return[[e],e[e.length-1]];default:return[null,null]}}function k(e){const t=String(e).match(f.qw);if(t){const e=t[5]?"p":"";return`${t[1]||t[4]}${e}`}return e}function S(e){switch(e&&e.constructor){case Object:{let t="";return"codec"in e&&(t=e.codec,"profile"in e&&(t+=":"+e.profile,"level"in e&&(t+=":"+e.level))),t}case String:return e;default:return null}}var x=i(9445),E=i(8586);var j=i(9480);function A(e){if("string"==typeof e)return e;if(e instanceof x.A)return e.toString();if(Array.isArray(e))return e.map(e=>A(e)).filter(e=>e).join("/");let t,i;const s=e.size,n=e.overlay||e.underlay,r=e.crop,o=w(e.angle).join("."),a=(e.background||"").replace(/^#/,"rgb:"),l=(e.color||"").replace(/^#/,"rgb:"),c=w(e.flags||[]).join("."),h=void 0===e.dpr?e.dpr:function(e){let t=e.toString();return(null!=t?t.match(/^\d+$/):void 0)?t+".0":E.A.normalize(t)}(e.dpr),u=_(e.overlay),p=function(e){let t=e;if(!t)return t;if(Array.isArray(t)||(t=[t]),0===t.length||t.length>4)throw new Error("Radius array should contain between 1 and 4 values");if(t.findIndex(e=>null===e)>=0)throw new Error("Corner: Cannot be null");return t.map(b).join(":")}(e.radius),f=_(e.underlay),g=function(e){return e?"if_"+b(e):e}(e.if),m=T(e.custom_function),y=function(e){const t=T(e);return"string"==typeof t?`pre:${t}`:null}(e.custom_pre_function);let v=e.fps,P=[],O=w(e.transformation||[]),I=e.effect;const L=n||o||"fit"===r||"limit"===r;if(s){const[e,n]=s.split("x");t=e,i=n}else t=e.width,i=e.height;t&&(0===t.toString().indexOf("auto")||L||parseFloat(t.toString())<1)&&delete e.width,i&&(L||parseFloat(i.toString())<1)&&delete e.height;const M=O.some(e=>"object"==typeof e);M?O=O.map(e=>(0,d.G)(e)?A(e):A({transformation:e})).filter(e=>e):(P=O.join("."),O=[]),Array.isArray(I)?I=I.join(":"):(0,d.G)(I)&&(I=Object.entries(I).map(([e,t])=>`${e}:${t}`));let N=e.border;(0,d.G)(N)?N=`${null!=N.width?N.width:2}px_solid_${(null!=N.color?N.color:"black").replace(/^#/,"rgb:")}`:/^\d+$/.exec(N)&&(e.border=N,N=void 0),Array.isArray(v)&&(v=v.join("-"));const D={a:b(o),ar:b(e.aspect_ratio),b:a,bo:N,c:r,co:l,dpr:b(h),e:b(I),fl:c,fn:m||y,fps:v,h:b(i),ki:b(e.keyframe_interval),l:u,o:b(e.opacity),q:b(e.quality),r:p,t:P,u:f,w:b(t),x:b(e.x),y:b(e.y),z:b(e.zoom),ac:e.audio_codec,af:e.audio_frequency,br:e.bit_rate,cs:e.color_space,d:e.default_image,dl:e.delay,dn:e.density,du:k(e.duration),eo:k(e.end_offset||(0,j.t)(e.end_offset)?e.end_offset:C(e.offset)[1]),f:e.fetch_format,g:e.gravity,pg:e.page,p:e.prefix,so:k(e.start_offset||(0,j.t)(e.start_offset)?e.start_offset:C(e.offset)[0]),sp:e.streaming_profile,vc:S(e.video_codec),vs:e.video_sampling},R=[g,Object.entries(e).filter(([e,t])=>e.startsWith("$")).map(([e,t])=>`${e}_${b(t)}`).sort().concat((e.variables||[]).map(([e,t])=>`${e}_${b(t)}`)).join(","),Object.entries(D).filter(([e,t])=>null!=t&&(("string"!=typeof t||0!==t.length)&&(!Array.isArray(t)||0!==t.length))).map(([e,t])=>`${e}_${t}`).sort().join(","),e.raw_transformation].filter(e=>e).join(",");return R&&O.push(R),O.join("/")}var P=i(4870),O=i(7648);function I(e,t){let i;"fetch"===t.type&&null==t.fetch_format&&(t.fetch_format=t.format);let s=t.type,n=t.resource_type||"image",r=t.version;const o="boolean"!=typeof t.force_version||t.force_version,a=(t.long_url_signature,t.format),l=t.cloud_name;if(!l)throw"cloud_name must be provided in the configuration";const c=t.private_cdn,h=t.secure_distribution,u=t.secure,d=t.cdn_subdomain,p=t.secure_cdn_subdomain,f=t.cname,m=t.shorten,y=t.sign_url,v=(t.api_secret,t.url_suffix),_=t.use_root_path,b=t.auth_token,w=/^(image|raw)\/([a-z0-9_]+)\/v(\d+)\/([^#]+)$/.exec(e);w&&(n=w[1],s=w[2],r=w[3],e=w[4]);const T=e;if(null==e)return T;if(e=e.toString(),null===s&&e.match(/^https?:\//i))return T;[n,s]=function(e,t,i,s,n){if(null==t&&(t="upload"),null!=i)if("image"===e&&"upload"===t)e="images",t=null;else if("image"===e&&"private"===t)e="private_images",t=null;else if("image"===e&&"authenticated"===t)e="authenticated_images",t=null;else if("raw"===e&&"upload"===t)e="files",t=null;else{if("video"!==e||"upload"!==t)throw new Error("URL Suffix only supported for image/upload, image/private, image/authenticated, video/upload and raw/upload");e="videos",t=null}if(s){if(!("image"===e&&"upload"===t||"images"===e&&null==t))throw new Error("Root path only supported for image/upload");e=null,t=null}return n&&"image"===e&&"upload"===t&&(e="iu",t=null),[e,t]}(n,s,v,_,m),[e,i]=function(e,t,i){let s;if((e=e.replace(/([^:])\/\//g,"$1/")).match(/^https?:\//i))s=e=(0,g.$)(e);else{if(s=e=encodeURIComponent(decodeURIComponent(e)).replace(/%3A/g,":").replace(/%2F/g,"/"),i){if(i.match(/[\.\/]/))throw new Error("url_suffix should not include . or /");e=e+"/"+i}null!=t&&(e=e+"."+t,s=s+"."+t)}return[e,s]}(e,a,v),null==r&&o&&i.indexOf("/")>=0&&!i.match(/^v[0-9]+/)&&!i.match(/^https?:\//)&&(r=1),r=null!=r?`v${r}`:null;const C=A((0,O.m)(t)).replace(/([^:])\/\//g,"$1/");if(y&&!b){let e=[C,i].filter(function(e){return null!=e&&""!==e}).join("/");try{for(let t=0;e!==decodeURIComponent(e)&&t<10;t++)e=decodeURIComponent(e)}catch(e){}}return[(0,P.D)(e,l,c,d,p,f,u,h),n,s,C,r,e].filter(function(e){return null!=e&&""!==e}).join("/").replace(" ","%20")}var L=i(9897);const M=function(e,t){let{tolerateMissingId:i=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(c()(e)){const s=Object.assign({},e);if(e=(0,a.sliceAndUnsetProperties)(s,"publicId").publicId,!u()(e)&&!i)throw new Error("Source is missing 'publicId'.");t&&(t=Object.assign({},s,t))}return{publicId:e,options:t}},N=(e,t)=>{let i=e,s=t;return"object"==typeof e&&(i=e.src),"object"==typeof t&&(s=t.src),/^\/\//.test(i)&&(s=s.slice(s.indexOf("//"))),/^\/\//.test(s)&&(i=i.slice(i.indexOf("//"))),i===s},D=(e,t)=>Object.assign(e,t),R=(e,t)=>I(e,o()(t,["chainTarget"])),F=(e,t)=>{const i=(e=>"Transformation"===e.constructor.name&&e.toOptions)(e)?e.toOptions():e;return new x.A(i).fromOptions(t).toOptions()},B=["streaming_profile","video_codec"],V=e=>e.map(e=>o()(e,B)).filter(e=>Object.keys(e).length>0),H=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return V(e);if(Array.isArray(e?.transformation)){const t=o()(e,B);return t.transformation=V(e.transformation),t}return o()(e,B)},$={NO_SUPPORTED_MEDIA:6,CUSTOM:10,UNKNOWN_CUSTOMER:11,RESOURCE_NOT_FOUND:12,PRIVATE_RESOURCE:13,UNAUTHENTICATED:14},z=e=>{let{errorMsg:t,publicId:i,cloudName:s,statusCode:n}=e;const r="Video cannot be played";let o={code:$.CUSTOM,message:`${r}${t?"- "+t:""}`,statusCode:n},a=t.toLowerCase();return a.startsWith("unknown customer")&&(o.code=$.UNKNOWN_CUSTOMER,o.message=`${r} Unknown cloud-name ${s}`),a.startsWith("resource not found")&&(o.code=$.RESOURCE_NOT_FOUND,o.message=`${r} Public ID ${i} not found`),a.startsWith("private resource")&&(o.code=$.PRIVATE_RESOURCE,o.message=`${r} Private video`),a.startsWith("unauthenticated access")&&(o.message=`${r} Requires authentication`,o.code=$.UNAUTHENTICATED),423===n&&(o.message='Video is being processed. <br><a href="#" class="cld-error-refresh">Try again</a> in a moment.',o.isHtml=!0),o},U={AV1:"av1",VP9:"vp9",HEV1:"hev1",H265:"h265",H264:"h264"},W=()=>{n().use("video/auto",()=>({async setSource(e,t){const{headers:i}=await fetch(e.src,{method:"HEAD",credentials:e.withCredentials?"include":"omit"}),s=i.get("content-type").split(";")[0];return t(null,{src:e.src,type:s})}}))}},6770(e,t,i){"use strict";i.d(t,{A:()=>o});var s=i(5770),n=i(5871),r=i(7311);const o=class{_transformation=null;constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{publicId:i,options:r}=(0,s.a5)(e,t),{cloudinaryConfig:o}=(0,n.sliceAndUnsetProperties)(r,"cloudinaryConfig"),{transformation:a}=(0,n.sliceAndUnsetProperties)(r,"transformation"),{queryParams:l}=(0,n.sliceAndUnsetProperties)(r,"queryParams");if(!o)throw new Error('Source is missing "cloudinaryConfig".');this.publicId=()=>i,this.cloudinaryConfig=()=>o,this.resourceConfig=()=>r,this.queryParams=()=>l,this.getType=()=>this._type,this.transformation(a)}transformation(e){return e&&(this._transformation=e),this._transformation}config(){const e=this.cloudinaryConfig();return{cloud_name:e.cloudName,url:(t,i)=>{if((0,s.iT)(t))return t;const n=(0,s.N7)(this.resourceConfig(),i);return(0,s.KA)(t,{...e,...n})}}}url(){let{transformation:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.config().url(this.publicId(),{transformation:e||this.transformation()});return(0,r.N)(t,this.queryParams())}}},4650(e,t,i){"use strict";i.d(t,{A:()=>a});var s=i(6770),n=i(5770);const r={resource_type:"image",type:"upload",transformation:[]};class o extends s.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};({publicId:e,options:t}=(0,n.a5)(e,t)),t=Object.assign({},r,t),super(e,t),this._type="ImageSource"}}const a=o},5226(e,t,i){"use strict";i.d(t,{IH:()=>c,Tf:()=>n,VX:()=>h,XY:()=>a,cE:()=>o,o7:()=>u,rm:()=>r,uf:()=>l,vD:()=>s});i(6498);const s={format:"jpg",resource_type:"video"},n={resource_type:"video",type:"upload",hdr:!1,transformation:[],sourceTransformation:{},sourceTypes:["auto"],recommendations:null,info:{},interactionAreas:{},chapters:{}},r=["3g2","3gp","avi","flv","m3u8","ts","m2ts","mts","mov","mkv","mp4","mpeg","mpd","mxf","ogv","webm","wmv"],o=RegExp(`\\.(${r.join("|")})$$`),a={hls:"application/x-mpegURL",dash:"application/dash+xml",opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},l=["hls","dash","mpd","m3u8"],c={hls:"m3u8",dash:"mpd"},h=2,u=[640,848,1280,1920,2560,3840]},5381(e,t,i){"use strict";i.d(t,{A:()=>b});var s=i(7311),n=i(2160),r=i.n(n),o=i(1104),a=i(608),l=i(5226),c=i(5770),h=i(7571),u=i.n(h),d=i(5004);const p=e=>{return!!e&&(u()(e)?(t=e)&&Object.values(c.dC).some(e=>t.includes(e)):!!(e=>["video_codec","streaming_profile"].some(t=>(0,d.isKeyInTransformation)(e,t)))(e)||!!e.some?.(e=>p(e)));var t};var f=i(2415),g=i(9445),m=i(6770),y=i(4650);let v=0;class _ extends m.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=(0,c.iT)(e);let{publicId:s,options:n}=(0,c.a5)(e,t);i||(s=s.replace(l.cE,"")),n=Object.assign({},l.Tf,n),n.resourceType&&(n.resource_type=n.resourceType),void 0===n.poster&&(n.poster=Object.assign({publicId:s},l.vD)),super(s,n),this._type=o.x.VIDEO,this.isRawUrl=i,this.isLiveStream="live"===n.type,this.withCredentials=!!n.withCredentials,this.getInitOptions=()=>t;const r=["poster","withCredentials","publicId","cloudinaryConfig","transformation","queryParams","type","info"],h=a.LU.filter(e=>!r.includes(e));this._createGetterSetters(h),h.forEach(e=>{void 0!==n[e]&&this[e](n[e])}),this.poster(n.poster),this.objectId=v++}_createGetterSetters(e){e.forEach(e=>{const t=`_${e}`;this[e]=function(i){return void 0===i?"sourceTypes"===e&&void 0===this[t]?["auto"]:"sourceTransformation"===e&&void 0===this[t]?{}:this[t]:(this[t]=i,this)}})}poster(e){let t={type:this.getInitOptions().type};if(!e)return this._poster;if(e instanceof y.A)return this._poster=e,this;if(({publicId:e,options:t}=(0,c.a5)(e,t,{tolerateMissingId:!0})),!e&&this.isRawUrl)return null;if(this.isLiveStream)return null;if(e||(e=this.publicId(),t=Object.assign({},t,l.vD)),t.cloudinaryConfig=t.cloudinaryConfig||this.cloudinaryConfig(),t.resource_type=this.resourceType()||t.resource_type,(0,c.iT)(e)||(t.queryParams=this.queryParams()),!0===e){let e=`${(0,c.k$)(t.cloudinaryConfig)}/_applet_/video_service/elements/${this.getInitOptions().type||"upload"}/${(0,f.G)(this.publicId())}/poster`;const i=this.getInitOptions().posterOptions?.transformation;if(i){e+=`?tx=${new g.A(i).toString()}`}return this._poster=new y.A(e,{cloudinaryConfig:t.cloudinaryConfig,queryParams:t.queryParams}),this}return this._poster=new y.A(e,t),this}contains(e){return this.generateSources().some(t=>(0,c.Nl)(t,e))}generateSources(){if(this.isRawUrl)return[this.generateRawSource(this.publicId(),this.sourceTypes()[0])];return this.sourceTypes().map(e=>{const t=this.sourceTransformation()[e]||this.transformation(),i=function(e){e=e.toLowerCase().split("/").shift();let t=l.IH[e];return t||(t=e.split("/").shift()),t}(e),n=l.uf.includes(i),o={};t&&(o.transformation=r()(t)),Object.assign(o,{format:i});const[a,h]=function(e){const[t,i]=e.toLowerCase().split("/"),s=l.XY[t]||`video/${t}`;let n=[s];i&&(n=[s,{video_codec:i}]);return n}(e);if(!h||p(o.transformation)||p(this.rawTransformation())||(o.transformation=(0,c.N7)(o.transformation,h)),"auto"===o.format&&(delete o.format,o.transformation=(0,c.N7)(o.transformation,{fetch_format:"auto:video"})),n){JSON.stringify(o.transformation||{}).includes('"streaming_profile":')||this.isLiveStream||(o.transformation=(0,c.N7)(o.transformation,{streaming_profile:"auto"}))}!0===this.hdr()&&window.matchMedia&&window.matchMedia("(dynamic-range: high)").matches&&(o.transformation=(0,c.N7)(o.transformation,{fetch_format:"mp4",video_codec:"h265",raw_transformation:"dr_high"}));return{type:a,src:(0,s.N)(this.config().url(this.publicId(),o),this.queryParams()),cldSrc:this,isAdaptive:n,withCredentials:this.withCredentials}})}generateRawSource(e,t){if(!t||"auto"===t){const i=e.split(".").pop().split(/[?#]/)[0].toLowerCase();t=l.rm.includes(i)?i:"auto"}const i=l.uf.includes(t);return{type:l.XY[t]||`video/${t}`,src:e,cldSrc:this,isAdaptive:i,withCredentials:this.withCredentials}}info(e){if(void 0!==e)return this._info=e,this;const t=this._info||this.getInitOptions().info;return{title:this.title()||t?.title||"",subtitle:this.description()||t?.subtitle||"",description:this.description()||t?.subtitle||""}}}const b=_},6498(e,t,i){"use strict";i.d(t,{P:()=>s});const s=RegExp("https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)")},9897(e,t,i){"use strict";i.d(t,{i:()=>r,k:()=>n.k});var s=i(6498),n=i(1741);const r=e=>s.P.test(e)},818(e,t,i){"use strict";i.d(t,{A:()=>Oe});var s=i(6673),n=i.n(s),r="3.0.1";const o=n().getTech("Html5"),a=n().registerPlugin||n().plugin,l=["abort","emptied","loadstart","play"],c=["abort","emptied"],h=["ad-playback","ads-ready?","postroll?","preroll?"],u=(e,t)=>{return!!e.usingPlugin("ads")&&((e=>e.usingPlugin("ads")&&"function"==typeof e.ads.inAdBreak)(e)?e.ads.isInAdMode()&&"loadstart"!==t.type:(i=e.ads.state,h.indexOf(i)>-1));var i};let d=0;const p=function(){const e=[];let t,i,s=!1,n=!0;const a=t=>function(i,s){if(this.perSourceBehaviors.disabled())return;const n=2===arguments.length,r=this.currentSrc(),o=[i],a=arguments[arguments.length-1],l=n?this:i,c=a.bind(l),h=(...e)=>{const i=this.currentSrc()!==r;this.perSourceBehaviors.disabled()||((i||t)&&this.off(...o),i||c(...e))};return h.guid=c.guid=a.guid="psb-"+ ++d,n||o.push(s),o.push(h),e.push(o),this.on(...o)};this.perSourceBehaviors={disable:function(){return this.clearTimeout(i),i=null,s=!0,s}.bind(this),disabled:()=>s,enable:()=>(s=!1,s),enabled:()=>!s,isSrcStable:()=>n,VERSION:r},this.onPerSrc=a(),this.onePerSrc=a(!0),this.on("dispose",()=>{e.length=0}),this.on(l,s=>{if(this.perSourceBehaviors.disabled()||i||u(this,s))return;n&&c.indexOf(s.type)>-1&&(n=!1,this.trigger("sourceunstable"));const r=[],a=e=>r.push({time:Date.now(),event:e});a(s),this.on(o.Events,a),i=this.setTimeout(()=>{const s=this.currentSrc();n=!0,i=null,this.off(o.Events,a),s&&s!==t&&(e.forEach(e=>this.off(...e)),e.length=0,this.trigger("sourcechanged",{interimEvents:r,from:t,to:s}),t=s)},1)})};p.VERSION=r,a("perSourceBehaviors",p);let f={};const g=function(){function e(e,t){return this.player=e,this.options=t,this.initializeHighlightsGraph(),this}return e.prototype.src=function(e){this.resetPlugin(),this.options.src=e,this.initializeHighlightsGraph()},e.prototype.detach=function(){this.resetPlugin()},e.prototype.resetPlugin=function(){this.graphHolder&&this.graphHolder.parentNode.removeChild(this.graphHolder),delete this.progressBar,delete this.graphHolder,delete this.lastStyle},e.prototype.initializeHighlightsGraph=function(){this.options.src&&fetch(this.options.src,{credentials:this.player.cloudinary.source?.().withCredentials?"include":"omit"}).then(e=>e.json()).then(e=>{this.setupHighlightsGraphElement(),this.graphHolder&&this.createHighlightsGraph(e)})},e.prototype.setupHighlightsGraphElement=function(){if(this.progressBar=this.player.$(".vjs-progress-control"),!this.progressBar)return;const e=this.player.$(".vjs-highlights-graph-display")||document.createElement("div");e.setAttribute("class","vjs-highlights-graph-display"),this.progressBar.appendChild(e),this.graphHolder=e},e.prototype.createPath=function(e,t,i){const s=t/(e.length-1),n=e.map((e,t)=>({x:t*s,y:i-e*i})),r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("fill","lightblue");let o=`M ${n[0].x},${n[0].y}`;for(let e=0;e<n.length-1;e++){const t=(n[e].x+n[e+1].x)/2,i=(n[e].y+n[e+1].y)/2;o+=` Q ${n[e].x},${n[e].y} ${t},${i}`}return o+=` Q ${n[n.length-1].x},${n[n.length-1].y} ${n[n.length-1].x},${n[n.length-1].y}`,o+=` L ${n[n.length-1].x},${i} L ${n[0].x},${i} Z`,r.setAttribute("d",o),r},e.prototype.createHighlightsGraph=function(e){const t=e.data,i=this.player.$(".vjs-highlights-graph-display > svg")||document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("viewBox","0 0 600 20"),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("width",600),i.setAttribute("height",20),i.innerHTML="";const s=this.createPath(t,600,20);i.appendChild(s),this.graphHolder.appendChild(i)},e}(),m=function(e){this.ready(()=>{!function(e,t){e.addClass("vjs-ai-highlights-graph"),e.aiHighlightsGraph=new g(e,t)}(this,n().obj.merge(f,e))})};var y=i(8513),v=i(1104);const _=[v.f.PLAY,v.f.PAUSE,v.f.ENDED,v.f.VOLUME_CHANGE,v.f.RESIZE,v.f.ERROR,v.f.FULL_SCREEN_CHANGE,v.f.START,v.f.VIDEO_LOAD,v.f.PERCENTS_PLAYED,v.f.SEEK,v.f.PLAYER_LOAD],b={percentsplayed:{percents:[25,50,75,100]}},w={events:_,category:"Video",defaultLabel:e=>e.cloudinary?.currentPublicId()||e.currentSource().src};class T{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player=e,this.options=n().obj.merge(w,t),this.events=(0,y.q)(this.options.events,b),this._startTracked=null,this._endTracked=null,this.resetState()}init(){const e=(e,t)=>{const i=t?.url||window.location.href;this.track({action:"Player Load",label:i,nonInteraction:!0})},t=()=>{this.track({action:"Play"})},i=()=>{this.track({action:"Start"})},s=()=>{this.track({action:"Pause"})},n=()=>{this._endTracked||(this.track({action:"Ended",nonInteraction:!0}),this._endTracked=!0)},r=()=>{this.track({action:"Error",nonInteraction:!0})},o=()=>{const e=this.player.muted()?0:this.player.volume();this.track({action:"Volume Change",value:e})},a=()=>{const e=`Resize - ${this.player.width()}x${this.player.height()}}`;this.track({action:e})},l=()=>{const e=this.player.isFullscreen()?"Enter Fullscreen":"Exit Fullscreen";this.track({action:e})},c=(e,t)=>{const{percent:i}=t;this.track({action:`${i} Percents Played`,nonInteraction:!0})},h=(e,t)=>{const{time:i}=t;this.track({action:`${i} Seconds Played`,value:i,nonInteraction:!0})},u=(e,t)=>{const{seekStart:i,seekEnd:s}=t;this.track({action:"Seek Start",value:i}),this.track({action:"Seek End",value:s})},d=(e,t)=>{this.track({action:"productHover",label:t.productName})},p=(e,t)=>{this.track({action:"productClick",label:t.productName})},f=()=>{this.track({action:"shoppableBar",label:"opened"})},g=()=>{this.track({action:"shoppableBar",label:"closed"})},m=()=>{this.track({action:"replay"})},y=(e,t)=>{this.track({action:"productClickPostPlay",label:t.productName})},_=(e,t)=>{this.track({action:"productHoverPostPlay",label:t.productName})};this.events.shoppable&&(this.player.on("productHover",d.bind(this)),this.player.on("productClick",p.bind(this)),this.player.on("productHoverPost",_.bind(this)),this.player.on("productClickPost",y.bind(this)),this.player.on("productBarMin",g.bind(this)),this.player.on("productBarMax",f.bind(this)),this.player.on("replay",m.bind(this))),this.events.play&&this.player.on(v.f.PLAY,t.bind(this)),this.events.ended&&this.player.on(v.f.ENDED,n.bind(this)),this.events.volumechange&&this.player.on(v.f.VOLUME_CHANGE,o.bind(this)),this.events.resize&&this.player.on(v.f.RESIZE,a.bind(this)),this.events.error&&this.player.on(v.f.ERROR,r.bind(this)),this.events.start&&this.player.on(v.f.START,i.bind(this)),this.events.fullscreenchange&&this.player.on(v.f.FULL_SCREEN_CHANGE,l.bind(this)),this.events.percentsplayed&&this.player.on(v.f.PERCENTS_PLAYED,c.bind(this)),this.events.timeplayed&&this.player.on(v.f.TIME_PLAYED,h.bind(this)),this.events.pause&&this.player.on(v.f.PAUSE_NO_SEEK,s.bind(this)),this.events.seek&&this.player.on(v.f.SEEK,u.bind(this)),this.events.playerload&&this.player.on(v.f.PLAYER_LOAD,e.bind(this)),this.events.videoload&&this.player.on(v.f.VIDEO_LOAD,this.videoload.bind(this))}track(e){let{action:t,label:i,value:s=null,nonInteraction:n=!1}=e;const r={event_category:this.options.category,event_label:i||this.options.defaultLabel(this.player),value:s||Math.round(this.player.currentTime()),non_interaction:n};window.gtag("event",t,r)}videoload(){this.track({action:"Video Load",nonInteraction:!0})}resetState(){this._startTracked=!1,this._endTracked=!1}}var C=i(3171),k=i(5871);const S={fraction:.5,isMuted:!0};class x{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object.assign({},S,t),this.player=e;let i=(0,k.sliceProperties)(t,"fraction"),s=!1,n=!1,r=null,o=null;this.init=()=>{u(),h()};const a=()=>{window.removeEventListener("DOMContentLoaded",h,!1),window.removeEventListener("load",h,!1),window.removeEventListener("scroll",h,!1),window.removeEventListener("resize",h,!1),this.player.off("pause",r),this.player.off("play",o)},l=()=>{s=!0,n=!1,this.player.pause()},c=()=>{s=!1,n=!0,this.player.play()},h=()=>{(0,C.isElementInViewport)(this.player.el(),{fraction:i.fraction})?this.player.paused()&&c():this.player.paused()||this.player.activePlugins_.floatingPlayer||l()},u=()=>{r=()=>{this.player.waiting||s||a()},o=()=>{n||a()},window.addEventListener("DOMContentLoaded",h,!1),window.addEventListener("load",h,!1),window.addEventListener("scroll",h,!1),window.addEventListener("resize",h,!1),this.player.on("pause",r),this.player.on("play",o)}}}var E=i(8446),j=i.n(E),A=i(5685),P=i.n(A);var O=i(5004),I=i(5770),L=i(608),M=i(5381);const N=class{constructor(e){this._emitter=e,this._eventHandlers=[]}on(e,t){this._eventHandlers.push({type:e,handler:t}),this._emitter.on(e,t)}one(e,t){var i=this;this._eventHandlers.push({type:e,handler:t,wrapper:function(){t(...arguments),i.off(e,t)}}),this._emitter.one(e,t)}off(e,t){const i=this._eventHandlers?.findIndex(i=>i.type===e&&i.handler===t);if(-1===i)return;const s=this._eventHandlers[i];this._emitter.off(e,s.wrapper||s.handler),this._eventHandlers.splice(i,1)}removeAllListeners(){this._eventHandlers.forEach(e=>{this.off(e)})}};var D=i(4650),R=i(7311);const F={format:"jpg",resource_type:"video",transformation:{flags:"waveform"}},B=RegExp(`\\.(${["mp3","ogg","wav","mp4"].join("|")})$$`),V={resource_type:"video",type:"upload",transformation:[]};class H extends M.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};({publicId:e,options:t}=(0,I.a5)(e,t)),e=e.replace(B,""),t=Object.assign({},V,t);const{poster:i}=(0,k.sliceAndUnsetProperties)(t,"poster");super(e,t),this._poster=null,this._type=v.x.AUDIO,this.poster(i)}getPoster(){return this._poster}poster(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e instanceof D.A?(this._poster=e,this):(!0===e?(e=this.publicId(),t=Object.assign({},t,F)):(({publicId:e,options:t}=(0,I.a5)(e,t,{tolerateMissingId:!0})),e||(e=this.publicId(),t=Object.assign({},t,F))),t.cloudinaryConfig=t.cloudinaryConfig||this.cloudinaryConfig(),this._poster=new D.A(e,t),this):this._poster}generateSources(){return this.sourceTypes().map(e=>{if("audio"===e){const t="mp3",i={},s=this.sourceTransformation()[e]||[this.transformation()];s&&(i.transformation=s),Object.assign(i,{resource_type:"video",format:t});return{type:"video/mp4",src:(0,R.N)(this.config().url(this.publicId(),i),this.queryParams()),cldSrc:this,poster:this.getPoster().url()}}return null},this)}}const $=H;var z=i(5226);const U=e=>{const t="undefined"!=typeof window&&null!=window.devicePixelRatio?window.devicePixelRatio:z.VX;return Math.min(e??z.VX,t,z.VX)},W={transformation:{},sourceTypes:[],sourceTransformation:[],posterOptions:{}},q=["cloudinaryConfig","transformation","sourceTypes","sourceTransformation","posterOptions","autoShowRecommendations"];class G{constructor(e){var t=this;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,I.M6)(),this.player=e,s=Object.assign({},W,s);let n=null,r=null,o=null,a=null,l=null,c=null,h=null,u=null,d=null,p=s.chainTarget,f=null,g=null,m=!1;this.source=function(s){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),!s)return n;let o=null;if(s instanceof M.A)o=s;else{let{publicId:e,options:i}=(0,I.a5)(s,r);o=t.buildSource(e,i)}const a=o.recommendations();if(a&&a.length){let t=null,s=!1;r.recommendationOptions&&({disableAutoShow:s,itemBuilder:t}=(0,k.sliceAndUnsetProperties)(r.recommendationOptions,"disableAutoShow","itemBuilder")),async function(e){try{return e.getChild("recommendationsOverlay")||(await Promise.all([i.e(869),i.e(410)]).then(i.bind(i,7604)),e.addChild("recommendationsOverlay")),e}catch(e){console.error("Failed to load plugin:",e)}}(e).then(()=>{y(a,{disableAutoShow:s,itemBuilder:t})})}else v();n=o,h=o.transformation();const l=r.sourceTypes&&r.sourceTypes.some(e=>e.includes("dash"))||"string"==typeof s&&s.endsWith(".mpd"),c=r.sourceTypes&&r.sourceTypes.some(e=>e.includes("hls"))||"string"==typeof s&&s.endsWith(".m3u8");return(l||c)&&!t.player.adaptiveStreamingLoaded?i.e(26).then(i.bind(i,7707)).then(()=>{t.player.adaptiveStreaming({...r.adaptiveStreaming,isDash:l,debug:r.debug,withCredentials:r.withCredentials}).then(()=>{_()})}).catch(e=>{console.error("Failed to load adaptive streaming plugin:",e),_()}):r.skipRefresh||_(),t.player.trigger("cldsourcechanged",{source:o,sourceOptions:r}),p},this.buildSource=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=null;if(({publicId:e,options:i}=(0,I.a5)(e,i)),i.breakpoints&&t.player){const e=t.player.el(),s=e?.clientWidth,n=s*U(i.maxDpr),r=z.o7.find(e=>e>=n)||z.o7[z.o7.length-1];i.breakpointTransformation={width:r,...!(0,O.isKeyInTransformation)(i.transformation,"crop")&&{crop:"limit"}}}i=(e=>{const{aspectRatio:t,cropMode:i,cropPadColor:s,transformation:n,breakpointTransformation:r,...o}=e;if(!t&&!i&&!r)return e;const a={};t&&(a.aspect_ratio=t),i&&(i===L.hN.SMART?(a.crop=L.hN.FILL,a.gravity="auto"):(a.crop=i,i===L.hN.PAD&&s&&(a.background=s)));const l={...r||{},...a};return{...o,transformation:Array.isArray(n)?[...n,l]:(0,I.N7)(n||{},l)}})(i),i.cloudinaryConfig=(0,I.lP)(t.cloudinaryConfig(),i.cloudinaryConfig||{}),i.transformation=(0,I.N7)(t.transformation(),i.transformation||{}),i.sourceTransformation=i.sourceTransformation||t.sourceTransformation(),i.sourceTypes=i.sourceTypes||t.sourceTypes();const n=w(i),r=i.transformation;if(r&&!P()(r)){const e=(0,I.hS)(r),t=(0,I.N7)(n.transformation||{},e);t.aspect_ratio&&delete t.height,n.transformation=t}const o=!P()(i.posterOptions);return void 0===i.poster&&((0,I.iT)(e)?i.poster=!1:i.poster=!o||n),i.posterOptions=Object.assign({},n,{hasUserPosterOptions:o||null}),i.queryParams=Object.assign(i.queryParams||{},i.allowUsageReport?{_s:"vp"}:{}),s=i.sourceTypes.indexOf("audio")>-1?new $(e,i):new M.A(e,i),s},this.posterOptions=e=>e?(l=e,p):l,this.disablePoster=e=>{this.player.poster(" "),this.player.posterImage.el().style.backgroundColor=e},this.cloudinaryConfig=e=>e?(c=e,p):c,this.transformation=e=>e?(h=e,p):h,this.sourceTypes=e=>e?(u=e,p):u,this.getCurrentSources=()=>r,this.sourceTransformation=e=>e?(d=e,p):d,this.on=function(){return f.on(...arguments)},this.one=function(){return f.one(...arguments)},this.off=function(){return f.off(...arguments)},this.autoShowRecommendations=e=>void 0===e?m:(m=e,p),this.dispose=()=>{this.playlist&&this.playlist()&&this.disposePlaylist(),v(),n=void 0,f.removeAllListeners()};const y=(e,t)=>{let{disableAutoShow:i=!1,itemBuilder:s=null}=t;if(v(),!Array.isArray(e)&&"function"!=typeof e&&!e.then)throw new Error('"recommendations" must be either an array or a function');g={},s=s||(e=>({source:e instanceof M.A?e:this.buildSource(e),action:()=>this.source(e)})),g.sourceChangedHandler=()=>{const t=e=>{if(void 0!==e&&e.length>0){const t=e.map(e=>s(e));this.player.trigger("recommendationschanged",{items:t})}else this.player.trigger("recommendationsnoshow");g.sources=e};j()(e)?t(e()):e.then?e.then(t):t(e)},g.sourceChangedHandler(),g.endedHandler=()=>{!i&&this.autoShowRecommendations()&&this.player.trigger("recommendationsshow")},this.on("ended",g.endedHandler)},v=()=>{g&&(this.off("cldsourcechanged",g.sourceChangedHandler),this.off("ended",g.endedHandler),delete g.endedHandler,delete g.sourceChangedHandler),g=null},_=()=>{const e=this.source();if(!e)return;const t=Object.assign({},this.player.cloudinary.posterOptions(),e.getInitOptions().poster);t.posterColor?this.disablePoster(t.posterColor):e.poster()&&this.player.poster(e.poster().url()),r=e.generateSources().reduce((e,t)=>{if(t.isAdaptive){if((t.type.split("; ")[1]||null)&&"MediaSource"in window){let i=`video/mp4; ${t.type.split("; ")[1]||""}`;b(i)&&e.push(t)}else e.push(t)}else e.push(t);return e},[]),e.withCredentials&&this.player.crossOrigin("use-credentials"),this.player.src(r),o=e,this.playlist&&(a=this.playlist())},b=e=>document.createElement("video").canPlayType(e)||"MediaSource"in window&&MediaSource.isTypeSupported(e),w=e=>{const t=Object.assign({},this.posterOptions());t.transformation=t.transformation||{},!t.transformation.width&&!t.transformation.height||t.transformation.crop||(t.transformation.crop="scale");const i=(0,O.isKeyInTransformation)(e.transformation,"width"),s=this.player.el();if(!i&&s?.clientWidth){const i=e=>100*Math.ceil(e/100),n=U(e.maxDpr);t.transformation=(0,I.N7)(t.transformation,{width:i(s.clientWidth*n),...!(0,O.isKeyInTransformation)(t.transformation,"crop")&&{crop:"limit"}})}return t};f=new N(this.player);const T=(0,k.sliceAndUnsetProperties)(s,...q);var C,S;C=this,S=T,Object.entries(S).forEach(e=>{let[t,i]=e;C[t]&&"function"==typeof C[t]&&C[t](i)}),this.on("sourcechanged",(e,t)=>{let i=t.to;o&&o.contains(i)?this.source()||(this.playlist&&a&&this.playlist(a),this.source(o,{skipRefresh:!0})):(this.player.trigger("cldsourcechanged",{}),this.dispose())})}currentSourceType(){return this.source().getType()}currentPublicId(){return this.source()&&this.source().publicId()}currentPoster(){return this.source()&&this.source().poster()}}var K=i(4679),Y=i.n(K),X=i(4138);class J{constructor(e,t){this.player=e,this.cloudinaryAnalytics=(0,X.connectCloudinaryAnalytics)(this.player.videoElement,{playerAdapter:this.getCloudinaryVideoPlayerAdapter()}),this.currentVideoMetadata={cloudName:null,publicId:null},this.analyticsOptions=t}getMetadata=()=>({cloudName:this.player.cloudinary.cloudinaryConfig().cloud_name,publicId:this.player.cloudinary.currentPublicId()});sourceChanged=(e,t)=>{let{source:i}=t;const s=this.getMetadata();if(s.cloudName&&s.publicId){const e="live"===i?.resourceConfig().type;this.currentVideoMetadata=s,this.cloudinaryAnalytics.startManualTracking({...s,...e?{type:"live"}:{}},{...Y()(this.analyticsOptions)?this.analyticsOptions:{},videoPlayerType:"cloudinary video player",videoPlayerVersion:"4.0.3"})}else this.currentVideoMetadata.cloudName===s.cloudName&&this.currentVideoMetadata.publicId===s.publicId||this.cloudinaryAnalytics.stopManualTracking()};getCloudinaryVideoPlayerAdapter=()=>{const e=(e,t)=>(this.player.on(e,t),()=>{this.player.off(e,t)});return{onCanPlay:t=>e("canplay",t),onCanPlayThrough:t=>e("canplaythrough",t),onComplete:t=>e("complete",t),onDurationChange:t=>e("durationchange",t),onEmptied:t=>e("emptied",t),onEnded:t=>e("ended",t),onError:t=>e("error",t),onLoadedData:t=>e("loadeddata",t),onLoadedMetadata:t=>e("loadedmetadata",t),onLoadStart:t=>e("loadstart",t),onPause:t=>e("pause",t),onPlay:t=>e("play",t),onPlaying:t=>e("playing",t),onProgress:t=>e("progress",t),onRateChange:t=>e("ratechange",t),onSeeked:t=>e("seeked",t),onSeeking:t=>e("seeking",t),onStalled:t=>e("stalled",t),onSuspend:t=>e("suspend",t),onTimeUpdate:t=>e("timeupdate",t),onVolumeChange:t=>e("volumechange",t),onWaiting:t=>e("waiting",t),getCurrentSrc:()=>this.player.videoElement.currentSrc,getCurrentTime:()=>this.player.currentTime(),getReadyState:()=>this.