!function(){"use strict";const e=9/16;let t;!function(e){e.SET_UTK="SET_UTK";e.SET_PAGE_META="SET_PAGE_META";e.SET_CURRENT_TIME="SET_CURRENT_TIME";e.SET_PLAYBACK_RATE="SET_PLAYBACK_RATE";e.TRIGGER_KEYBOARD_SHORTCUT="TRIGGER_KEYBOARD_SHORTCUT";e.UPDATE_DISPLAY_OPTIONS="UPDATE_DISPLAY_OPTIONS";e.SET_PLAYER_STATUS="SET_PLAYER_STATUS";e.CONFIRM_VISIBLE="CONFIRM_VISIBLE";e.CTA_SKIPPED="CTA_SKIPPED";e.CTA_CLICKED="CTA_CLICKED";e.FORM_SKIPPED="FORM_SKIPPED";e.FORM_SUBMITTED="FORM_SUBMITTED";e.VIDEO_LOADED="VIDEO_LOADED";e.PLAYER_LOADED="PLAYER_LOADED";e.PLAYER_READY="PLAYER_READY";e.PLAYER_PLAY="PLAYER_PLAY";e.PLAYER_PAUSE="PLAYER_PAUSE";e.PLAYER_ENDED="PLAYER_ENDED";e.PLAYER_PROGRESS="PLAYER_PROGRESS";e.PLAYER_TIME_UPDATE="PLAYER_TIME_UPDATE";e.PLAYER_SHOW_OVERLAY="PLAYER_SHOW_OVERLAY";e.PLAYER_ORPHANED="PLAYER_ORPHANED";e.PLAYER_ERROR="PLAYER_ERROR";e.PLAYER_ANALYTICS_EVENTS="PLAYER_ANALYTICS_EVENTS";e.PLAYER_SECONDS_VIEWED="PLAYER_SECONDS_VIEWED";e.TRACKED_PLAY="TRACKED_PLAY";e.TRIGGER_AUTOPLAY="TRIGGER_AUTOPLAY";e.TRIGGER_PICTURE_IN_PICTURE="TRIGGER_PICTURE_IN_PICTURE"}(t||(t={}));const o=["region","posterUrl","playButtonColor","play_button_color","playButtonShape","play_button_shape","preview","richTextPreview","playerType","autoplay","autoPlay","subtitleLanguage","enablePictureInPicture","enableVideoFrameHotKeys","enableParentHotKeys","enableAutoPlayToggle","loop","muted","hiddenControls","hidden_controls","hostApp","renderContext","parentUrl","maxHeight","objectFit","playbackRate"],n=1e3,i="/share/hubspotvideo/",r=0,s=-1,a={EXTERNAL_PAGE:"EXTERNAL_PAGE",EMAIL:"EMAIL"},l={INITIAL:"INITIAL",LOADING:"LOADING",READY:"READY",PLAYING:"PLAYING",PAUSED:"PAUSED",ENDED:"ENDED",CONVERSION_ASSET_OVERLAY:"CONVERSION_ASSET_OVERLAY",ERROR:"ERROR"};let d,c;!function(e){e.FORM="FORM";e.CTA="CTA"}(d||(d={}));!function(e){e.PRE="PRE";e.POST="POST";e.CUSTOM="CUSTOM"}(c||(c={}));const u={HLS_MUX:"hsvideo-mux",VIDEOJS_RAW_URL:"videojs-raw-url",HTML5:"html5",HTML5_OPTIMIZED:"html5-optimized",IN_APP_PREVIEW:"inAppPreview",EDITOR_PREVIEW:"editorPreview",RICH_TEXT_PREVIEW:"richTextPreview",ACADEMY_IN_APP:"academy",ACADEMY_EMBEDDED:"academyEmbedded",COMPACT_PLAYER:"compactPlayer",COMPACT_PLAYER_WITH_CUSTOM_MENU:"compactPlayerWithCustomMenu"},h="VIDEO_PLAYER_ENV",p="-qa.js",f=[".hubspotqa.com",".hubspotvideoqa.com",".hsappstatic.net"],m=/http(s?):\/\/(app|local)(-\w+)?.hubspot(qa)?.com/;let g=!1;function E(e,t=!0){if(!t&&g)return null;try{return localStorage.getItem(e)}catch(e){g=!0;return null}}const b=()=>window[h];function y(){return b()?"local"===b():"local"===E(h)||!!window.location.search.includes("_hsVideoEnv=local")}function v(){if(Ye()||"qa"===E(h))return!0;if(b())return"qa"===b();const e=V();return f.some((e=>window.location.hostname.endsWith(e)))||e&&e.endsWith(p)}function w(e={}){const t=e.region||je(),o=t?`-${t}`:"";if("prod"===e.env)return`https://${y()?"local":`play${o}`}.hubspotvideo.com`;if(A()&&e.playerType!==u.ACADEMY_IN_APP&&e.playerType!==u.ACADEMY_EMBEDDED){if(v()&&!y()&&!je())return"https://app.hubspotqa.com";if(!e.region&&!e.env)return window.location.origin}if(y())return v()?"https://local.hubspotvideoqa.com":"https://local.hubspotvideo.com";return`https://play${o}.${v()||"qa"===e.env?"hubspotvideoqa.com":"hubspotvideo.com"}`}function P(){return"jasmineRequire"in window}function A(e){return!(P()&&!e)&&Boolean((e||window.location).origin.match(m))}function _(){return Boolean(E("selenium.disable.alarms"))}const R="hs_video_debug";function I(){return window.location.search.includes("debug=true")}function T(){return!(!y()&&!window.hsVideoDebug)||("true"===E(R)||I())}function S(...e){if(T()){const t=e.shift();console.log.apply(console,[`[hs-video] ${t}`,...e])}}const C="hs-script-loader",L="/hs/scriptloader/",O=/video-embed\/ex\/loader(-qa)?.js/,$=/video-embed\/static(?:-[\w.-]+)?\/bundles\/loader.js$/,M=`${"div.hs-video-widget[data-hsv-embed-id]"}:not([data-hsv-status])`,D="iframe[data-hsv-src]",x="iframe[data-hsv-id][src]";function N(e){return[].slice.call(document.querySelectorAll(e))}function k(e,t){return[].slice.call(e.querySelectorAll(t))}function q(){return N("script[src]").find((e=>O.test(e.src)||$.test(e.src)))}function U(){const e=document.getElementById(C);if(e&&e.src&&e.src.includes(L)){const t=document.createElement("a");t.href=e.src;const o=t.pathname.replace(L,"").replace(".js",""),n=Number(o);if(n>0)return n}return null}function V(){const e=q();return e?e.src:null}function Y(e,t=!1){return t?document.querySelector(`[data-hsv-embed-id="${e}"]:not([data-hsv-status])`):document.querySelector(`[data-hsv-embed-id="${e}"]`)}function j(){return"interactive"===document.readyState||"complete"===document.readyState}const F=1e4;function B(e,t){const o=document.createElement("script");return new Promise(((n,i)=>{let r=!1;o.onload=()=>{r=!0;n()};o.onerror=()=>i(new Error(`loadScript failed for: ${e}`));o.src=e;t&&Object.keys(t).forEach((e=>o.setAttribute(e,t[e])));document.getElementsByTagName("head")[0].appendChild(o);setTimeout((()=>{r||i(new Error(`loadScript timed out for: ${e}`))}),F)}))}function H(e,t={}){e instanceof HTMLElement&&Object.assign(e.style,t)}function G(e,t){t.startsWith(".")||(t=`.${t}`);for(;e&&e.parentElement;){if(e.parentElement.matches&&e.parentElement.matches(t))return e.parentElement;e=e.parentElement}return null}function W(e,t){return Boolean(G(e,t))}function K(e){const t=e.getBoundingClientRect();return t.bottom>0&&t.right>0&&t.left{S("Preloader iframe loaded, removing from page.");t.remove();e()}));document.body.appendChild(t)}const J="na1",X={APP:"app",APP_API:"app-api"};function Z(e,t){const o=t&&t.hubletOverride?t.hubletOverride:e,n=t&&!0===t.hubletizeNa1;return o!==J||n?`-${o}`:""}function ee(e,t,o){if(o&&o.hubletPostfixLocation&&"domain"===o.hubletPostfixLocation)return t;t===X.APP_API&&(t=X.APP);return`${t}${Z(e,o)}`}function te(e,t,o){return`${ne(o)}${oe(t,o)}${ie(e,o)}`}function oe(e,t){return"qa"===(t&&t.envOverride?t.envOverride:e)?"qa":""}function ne(e){return e&&e.domainOverride?e.domainOverride:"hubspot"}function ie(e,t){return t&&t.hubletPostfixLocation&&"domain"===t.hubletPostfixLocation?Z(e,t):""}function re(e){return e&&e.tldOverride?e.tldOverride:"com"}function se(e){return e===X.APP_API?"/api":""}function ae(e,t,o,n){return`https://${ee(t,e,n)}.${te(t,o,n)}.${re(n)}${se(e)}`}const le="outpost",de=({hublet:e=J,isQa:t=!1}={})=>`${ae("forms",e.length>0?e:J,t?"qa":"prod",{domainOverride:"hubspot"})}/${le}`,ce=({hublet:e=J,isQa:t=!1}={})=>`${ae("exceptions",e.length>0?e:J,t?"qa":"prod",{domainOverride:"hs-embed-reporting"})}/${le}`;function ue(e,...t){let o,n=0;e=e||{};for(;n-1)return!0;return!1}function pe(e){let t="";for(const o in e)e.hasOwnProperty(o)&&(t+=`${o}=${e[o]};`);return t}const fe=({isEmbedApp:e=!1,env:t="PROD",hublet:o=""})=>{const n="PROD"!==t;return e?ce({isQa:n,hublet:o}):de({isQa:n,hublet:o})};class me{constructor(e,t){t=t||{};e||console.warn("The projectName parameter is required");this.projectName=e;this.env=(t.env||"PROD").toUpperCase();this.hublet=t.hublet||"";this.isEmbedApp=t.isEmbedApp||!1;this.level=(t.level||"ERROR").toUpperCase();this.disabled=t.disabled||!1;this.baseUrl=t.baseUrl||fe({isEmbedApp:this.isEmbedApp,env:this.env,hublet:this.hublet});this.tags=t.tags||{};this.cookies=t.cookies||{};this.user=t.user||{}}bindToWindow(e=[],t=[]){e.length<1?console.warn("You need to specify allowlisted domains when binding to window errors or you will catch all page errors"):window.onerror=(o,n,i,r,s)=>{n&&he(e,n)&&!he(t,s.message)&&"script error"!==o.toLowerCase()&&this.sendReport("error",o,n,s)}}report(e,t,o={}){if(e){o.silent&&console.error(e);this.sendReport("error",e.message,e.fileName,e,t)}}reportMessage(e,t,o={}){if(e){o.silent&&console.error(e);this.sendReport("info",e,window.location.href,void 0,t)}}debug(e,t){if(e&&"DEBUG"===this.level){console.debug(e);this.sendReport("debug",e.message,e.fileName,e,t)}}addTags(e){ue(this.tags,e)}addCookies(e){ue(this.cookies,e)}addUserContext(e){ue(this.user,e)}sendReport(e,t,o,n,i){if(this.disabled){console.warn("Not reporting error to Outpost because logging is disabled");return}o=o||(window.document.currentScript?window.document.currentScript.src:null)||window.location.href;const r=this.buildReport(e,t,o,n,i),s=new Image,a=encodeURIComponent(JSON.stringify(r));s.src=`${this.baseUrl}/${this.projectName}/error.gif?report=${a}`;s.onload=()=>{console.log(`Completed reporting error to ${this.projectName}`)}}buildReport(e,t,o,n,i={}){const r=n?n.name:"Message";let s;s=n&&n.message?n.message.substring(0,999):t.substring(0,999);return{culprit:r,message:s,level:e,exception:[{type:r,value:n&&n.stack&&n.stack.substring(0,999)||s,url:o}],request:{url:`${window.location.protocol}//${window.location.host+window.location.pathname}`,queryString:window.location.search.replace(/(^\?)/,""),cookies:pe(this.cookies)},environment:this.env,tags:ue(this.tags),user:this.user,extra:i}}}var ge=me;const Ee=5;let be,ye=0;function ve(){be||(be=new ge("video-embed",{env:Ye()?"qa":null,debug:T(),tags:{domain:window.location.origin,portalId:Ve()||void 0,hublet:je()||void 0}}));return be}function we(){return!(P()||_()||ye>=Ee)}function Pe(e,t={}){S("Reporting message to outpost",e);if(we()){ve().reportMessage(e,t);ye++}}function Ae(e,t={}){S("Reporting error to outpost",e);if(we()){ve().report(e,t);ye++}}const _e=["api","local","app","private","platform","tools","meetings","payments","mcp"],Re=["hubspotstarter","hubspotfree","hubspotemail"],Ie=["growth"],Te={com:["hubspot","hubteam","grader","getsignals","getsidekick","gettally","hubspotemail","customer-hub","hubspotservicehub","hubspotquote","hubspotdocuments","hs-data-privacy"].join("|"),net:Re.join("|"),org:Ie.join("|")},Se=function e(t){const o=new RegExp(`^(?!local|test|selenium)(.*\\.)?(${Object.entries(Te).map((([e,t])=>`(?:${t})(qa)?\\.${e}`)).join("|")}|(?:connect)\\.com|(?:connect)(qa)\\.co|wthubspot\\.(com|de|es|fr|jp))$`),n=new RegExp("^(?:[^.]+)\\.(?:preview).app(-[a-z]+[0-9])?\\.hubspotqa\\.com"),i=new RegExp("^(?:[^.]+)\\.(?:local).(app|tools|private)(-[a-z]+[0-9])?\\.(hubspot|hubteam)qa\\.com"),r=o.test(t.hostname),s=i.test(t.hostname),a=n.test(t.hostname),l=r&&!s||a,d=new RegExp(`${Object.entries(Te).map((([e,t])=>`(?:${t})qa\\.${e}`)).join("|")}|(?:connect)qa\\.co|wthubspot\\.(com|de|es|fr|jp)|hsqa-sales(?:crm)?-sub\\.com|(?:hubspotstarter|hubspotfree|hubspotemail)(qa)(?:-.*)\\.net|(?:hubspotemail)(qa)(?:-.*)\\.com`),c=[new RegExp(`^(?:${_e.join("|")})-(.*).(?:hubspot|hubteam)(?:qa)?.com`),new RegExp("^(.*).(?:hubspotquote)(?:qa)?.com"),new RegExp("^app-(.*).(?:hubspotdocuments)(?:qa)?.com"),new RegExp("^(?:[0-9]+).(.*).hs(?:qa)?-sales(?:crm)?-sub.com"),new RegExp("^(?:[a-zA-Z0-9-]+)\\.([a-z0-9]+)\\.hs(?:qa)?-sales(?:crm)?-sub\\.com"),new RegExp("^hs-(?:[0-9]+).s.(?:hubspotfree|hubspotstarter|hubspotemail)(?:qa)?-(.*).net"),new RegExp("^hs-(?:[0-9]+).s.(?:hubspotemail)(?:qa)?-(.*).com"),new RegExp("^t.sidekickopen(?:\\d)+-([a-z]+[0-9]).com"),new RegExp("^([a-z]+[0-9]).hs-data-privacy(?:qa)?.com"),new RegExp("^(?:[^.]+)\\.(?:preview|local)\\.app-([a-z]+[0-9])\\.hubspotqa\\.com"),new RegExp("^(?:[^.]+)\\.(?:local)\\.(?:tools|private)-([a-z]+[0-9])\\.hubteamqa\\.com")],u="ENV",h="Enviro error: the default argument for .get and .getShort is no longer supported",p=e=>{let t=window[e];if(null==t)try{t=window.sessionStorage.getItem(e)}catch(e){}if(null==t)try{t=window.localStorage.getItem(e)}catch(e){}return t},f=()=>{const e=p(u);return e||(d.test(t.host)?"qa":"prod")},m=(e,t)=>{window[e]=t;return t},g={prod:"production",qa:"development"},E=e=>{if("string"==typeof e){const t=e.toLowerCase();return g[t]||t}return e},b=e=>{e="string"==typeof e?e.toLowerCase():void 0;return Object.keys(g).find((t=>e===g[t]))||e},y=(e,t)=>{if(null!=t)throw new Error(h);let o=null;if(e){const t=e.split(".").reverse();for(let e=0;e{if(null!=t)throw new Error(h);return b(y(e))},P=w,A=e=>"prod"===P(e),_=e=>"qa"===P(e),R=()=>{const e=p("HUBLET");if(e)return e;for(const e of c)if(e.test(t.hostname))return e.exec(t.hostname)[1];return"na1"};function I({isNa1:e,isNonNa1:t},o){o||(o=R());return"na1"===o?"function"==typeof e?e(o):void 0:"function"==typeof t?t(o):void 0}return{createEnviro:e,debug:(e,t=!1)=>{let o;"string"==typeof e&&(o=p(`${e.toUpperCase()}_DEBUG`));null==o&&(o=p("DEBUG"));return null==o?t:o},denormalize:b,deployed:e=>{let t;"string"==typeof e&&(t=p(`${e.toUpperCase()}_DEPLOYED`));null==t&&(t=p("DEPLOYED"));return null==t?l:!!t},enabled:(e,t=!1)=>{let o=p(`${e.toUpperCase()}_ENABLED`);null==o&&(o=JSON.stringify(t));return"true"===`${o}`.toLowerCase()},get:y,getHublet:R,getInternal:w,getShort:P,isProd:A,isQa:_,ifHublet:I,normalize:E,set:v,setDebug:(e,t=!0)=>{if("string"==typeof e)try{t?localStorage.setItem(`${e.toUpperCase()}_DEBUG`,JSON.stringify(!0)):localStorage.removeItem(`${e.toUpperCase()}_DEBUG`)}catch(o){m(`${e.toUpperCase()}_DEBUG`,t||void 0)}else{t=null==e||e;try{t?localStorage.setItem("DEBUG",JSON.stringify(t)):localStorage.removeItem("DEBUG")}catch(e){m("DEBUG",t||void 0)}}}}};Se(document.location);function Ce(e,t=[]){return Object.keys(e).filter((e=>t.includes(e))).reduce(((t,o)=>Object.assign({},t,{[o]:e[o]})),{})}function Le(e){return Object.values?Object.values(e):Object.keys(e).map((t=>e[t]))}function Oe(e=window.location.search){const t={};"?"===e[0]&&(e=e.substring(1));e.split("&").forEach((e=>{const[o,n]=e.split("=");if(o&&n)try{t[o]=decodeURIComponent(n)}catch(i){S(`Could not decode query param: ${e}`);t[o]=n}}));return t}function $e(e){const t={};Object.keys(e).forEach((o=>{(e[o]||"number"==typeof e[o])&&(t[o]=e[o])}));return Object.keys(t).map((e=>`${e}=${encodeURIComponent(t[e])}`)).join("&")}function Me(e){return"object"==typeof e&&Object.keys(e).length?`?${$e(e)}`:""}function De(e){return"true"===e||"1"===e}const xe=["type","id","position","overlayDelaySeconds","preventSkip"];function Ne(e){return xe.map((t=>e[t]?String(e[t]):"")).join("_")}function ke(e){const t=Ue(),n=t&&"number"==typeof t.page_id?t.page_id:ze(),i=window.location.origin||`${window.location.protocol}//${window.location.hostname}`,r=Object.assign({},Ce(e,o),{parentOrigin:i,pageId:n,locale:Be()});r.parentOrigin||Pe(`window.location is missing - ${document.documentURI}`);T()&&(r.debug=!0);He()&&(r.playerType=u.EDITOR_PREVIEW);const s=Oe();Qe().hidePosterImage&&(r.hidePosterImage=!0);s._hsVideoForm?e.conversionAsset={type:d.FORM,position:c.PRE,id:s._hsVideoForm}:s._hsVideoCta&&(e.conversionAsset={type:d.CTA,position:c.PRE,id:s._hsVideoCta});"object"==typeof e.conversionAsset&&e.conversionAsset.type&&e.conversionAsset.id&&(r.ca=Ne(e.conversionAsset));if(r.playButtonColor){r.playButtonColor=r.playButtonColor.replace("#","");"ffffff"===r.playButtonColor&&delete r.playButtonColor}1===r.playbackRate&&delete r.playbackRate;"100%"===e.height&&("100%"===e.width||e.full_width)&&(r.objectFit="cover");return r}function qe(e,t,o={},n,i,r){let s="video";if(e&&t){const o=(null==i?void 0:i.playerType)===u.ACADEMY_IN_APP||(null==i?void 0:i.playerType)===u.ACADEMY_EMBEDDED;s=A()&&!o?`video/${e}/id/${t}`:`v/${e}/id/${t}`}const a={};if(n){a.hsvid=n;a.t=Date.now();r&&(a.afterPreload=!0)}const l=Me(a).replace("?","#");return`${w(i)}/${s}${Me(o)}${l}`}function Ue(){return window.hsVars?window.hsVars:null}function Ve(){const e=q();return e&&e.dataset.hsPortalId?Number(e.dataset.hsPortalId):Ue()?Ue().portal_id:U()}function Ye(){const e=q();if(e&&e.dataset.hsEnv)return"qa"===e.dataset.hsEnv;const t=Ue();return!(!t||!t.app_hs_base_url)&&t.app_hs_base_url.includes("hubspotqa.com")}function je(){const e=q();if(A()){const e=window.location.hostname.split(".")[0];if(e.includes("-"))return e.split("-")[1]}if(e&&e.dataset.hsRegion)return e.dataset.hsRegion;const t=Ue();if(t&&t.app_hs_base_url){const e=t.app_hs_base_url.split("//")[1].split(".")[0];return e.includes("-")?e.split("-")[1]:null}return null}function Fe(){var e;const t=q();return null!==(e=Ue())&&void 0!==e&&e.scp_id?parseInt(Ue().scp_id,10):t&&t.dataset.hsPageId?Number(t.dataset.hsPageId):Ue()?Ue().page_id:null}function Be(){return Ue()?Ue().language:null}function He(){return Boolean(window.hsInEditor)}function Ge(){return window.location.pathname.startsWith(i)}function We(){const e=q();return(null==e?void 0:e.dataset.hsExternal)&&De(e.dataset.hsExternal)}const Ke="hs-content-id-";function ze(){let e=null;document.body.classList.forEach((t=>{t.includes(Ke)&&(e=parseInt(t.replace(Ke,""),10))}));return e||null}function Qe(){return window.hsVideoOptions||{}}function Je(){const e={pageUrl:window.location.href,pageTitle:document.title,pageId:Fe()};if(We()){e.pageId=s;e.externalPlayContext=a.EXTERNAL_PAGE}else if(Ge()){e.pageId=r;e.externalPlayContext=a.EMAIL}if("number"==typeof e.pageId)return e;if(!A())if(ze()){e.pageId=ze();Pe("Missing expected hsVars context, parsed pageId from body classname")}else Pe("Missing expected hsVars context");return e}const Xe='\n
\n \n \n \n \n \n
\n',Ze=e=>/^\d+$/.test(e);function et(e,t){const o=document.createElement("div");o.innerHTML=Xe;o.querySelector(".hsv-overlay-close").addEventListener("click",(()=>e()));t.appendChild(o.firstElementChild)}function tt(e,t){return Ze(t.id)?`\n
\n
\n \n \n \n
\n ${t.preventSkip?"":Xe}\n
\n `:`\n
\n \n \n \n \n \n ${t.preventSkip?"":Xe}\n
\n `}function ot(e,t){let o=`//no-cache.${v()?"hubspotqa.com":"hubspot.com"}`;je()&&(o=v()?`//hubspot-no-cache-${je()}-qa.s3.amazonaws.com`:`//hubspot-no-cache-${je()}-prod.s3.amazonaws.com`);return`${o}/cta/default/${t}/${Ze(e)?`interactive-${e}`:e}.png`}function nt(e,o){const{id:n}=o,i=document.createElement("div");i.innerHTML=tt(e.portalId,o);const r=i.firstElementChild;e.getWrapperEl().append(r);const s=()=>{e.postMessageToPlayer(t.CTA_SKIPPED);r.style.display="none"},a=()=>{e.postMessageToPlayer(t.CTA_CLICKED);r.style.display="none"},l=()=>{r.querySelector(".hsv-overlay-close")||et(s,r)},d=r.querySelector(".hsv-overlay-close");d&&d.addEventListener("click",s);const c=()=>{if(!window.hbspt||!window.hbspt.cta){Pe("Could not load CTA JS");s();return}window.hbspt.cta._relativeUrls=!0;window.hbspt.cta.canonicalURL=window.location.href;const t={region:je()||J,useNewLoader:!0,enforceTargetIsBlank:!0};v()&&(t.env="qa");e.el.querySelector(".hs-cta-node").addEventListener("click",a);window.hbspt.cta.load(e.portalId,n,t);window.hbspt.cta.loadQueue()},u=()=>{if(!window.__PRIVATE__HubspotCtaClient||"function"!=typeof window.__PRIVATE__HubspotCtaClient.loadCta){Pe("Web interactive API not found after load");s();return}const e=r.querySelector(".hs-cta-simple-placeholder");window.hsCtasOnReady=window.hsCtasOnReady||[];window.hsCtasOnReady.push((()=>{window.__PRIVATE__HubspotCtaClient.loadCta({contentId:Number(o.id),options:{openInNewTab:!0,elementToEmbed:e,onNavigate:a}});window.HubSpotCallsToActions&&window.HubSpotCallsToActions.on("onCallToActionFormSubmitted",l)}))};if(Ze(o.id))if(window.__PRIVATE__HubspotCtaClient)u();else{let e=`${window.location.origin}/hs/cta/web-interactives-embed.js`;A()&&(e=v()?"https://js.hubspotqa.com/web-interactives-embed.js":"https://js.hscta.net/web-interactives-embed.js");B(e,{id:"hubspot-web-interactives-loader",crossorigin:"anonymous","data-loader":"hs-scriptloader","data-hsjs-portal":Ve(),"data-hsjs-hublet":je()||J}).then(u).catch((e=>{Pe("Failed to load web interactive JS",{errorMessage:String(e)});s()}))}else if(window.hbspt&&window.hbspt.cta)c();else{let e=`${window.location.origin}/hs/cta/cta/current.js`;A()&&(e=v()?"https://js.hubspotqa.com/cta/current.js":"https://js.hscta.net/cta/current.js");B(e).then(c).catch((e=>{console.error("Failed to display CTA",e);Pe("Failed to display CTA",{errorMessage:String(e)});s()}))}}let it;function rt(){if(!it)try{it=window.scrollTo;window.scrollTo=(...e)=>{S("Prevented scrollTo with args:",...e)}}catch(e){S("Failed to patch window.scrollTo to prevent forms auto-scroll",e)}}function st(){if(it){try{window.scrollTo=it}catch(e){S("Failed to un-patch window.scrollTo to restore auto-scroll ability",e)}it=void 0}}const at="hsv-form-wrapper",lt=9,dt="Thanks for your response!";function ct(e){return`\n
\n
\n
\n
\n ${e.preventSkip?"":Xe}\n
\n `}const ut=e=>{const t=e.querySelector("form");if(!t){S("Form el not found in onFormReady callback");return}const o=t.querySelector("div.actions");o&&H(o,{margin:0,padding:0})};function ht(e,o){let n,i=!1,r=!1,s=!1;const{id:a}=o,l=document.createElement("div");l.innerHTML=ct(o);const d=l.firstElementChild;e.getWrapperEl().append(d);const u=d.querySelector(".hsv-form"),h=()=>{st();e.postMessageToPlayer(i?t.FORM_SUBMITTED:t.FORM_SKIPPED,{isLegacyForm:r});d.style.display="none"},p=()=>{e.postMessageToPlayer(t.FORM_SUBMITTED,{isLegacyForm:r});d.style.display="none"},f=()=>{var e;st();s&&p();i=!0;const t=d.querySelector(".submitted-message")||u;d.querySelector(".hsv-overlay-close")||et(p,d);const n=`\n
\n \n ${(null===(e=o.copy)||void 0===e?void 0:e.watchVideo)||"Watch video"}\n \n
\n `,r=document.createElement("div");r.innerHTML=n;r.querySelector("a").addEventListener("click",(()=>p()));setTimeout((()=>{t.append(r.firstElementChild)}),250)},m=e.el.querySelector(".hsv-overlay-close");m&&m.addEventListener("click",h);const g=()=>{if(window.HubSpotForms){rt();e.form=window.HubSpotForms.create({formId:a,portalId:e.portalId,env:v()?"qa":null,region:je(),target:`${e.getPlaceholderSelector()} .hsv-form`,css:"",onFormDefinitionFetchSuccess:e=>{n=e.form;if(n){n.formTypeNumber===lt&&(r=!0);n.inlineMessage||(s=!0)}},onFormReady:()=>{const t=d.querySelector("form");t&&z(t)&&H(u,{background:"white",padding:"10px 20px"});ut(d);if(n.redirectUrl&&o.position!==c.POST){var i;S(`Overriding redirectUrl ${n.redirectUrl} with generic inlineMessage`);e.form.setContext({inlineMessage:(null===(i=o.copy)||void 0===i?void 0:i.defaultThankYouMessage)||dt,redirectUrl:""})}},getExtraMetaDataBeforeSubmit:()=>({hs_video_id:e.options.id,hs_video_title:e.video?e.video.title:null}),onFormSubmitted:()=>setTimeout(f,0)});e.form.on("onRenderError",((t,o)=>{if("NON_EMBEDDABLE_EDITOR2_FORM"===o){document.addEventListener("hs-form-event:on-ready",(t=>{const o=window.HubSpotFormsV4.getFormFromEvent(t);null==o||o.setExtraSubmissionMetadata({hs_video_id:e.options.id,hs_video_title:e.video?e.video.title:null})}));document.addEventListener("hs-form-event:on-submission:success",(()=>{setTimeout(f,0)}))}}))}else{Pe("Could not load Forms JS");h()}};if(window.HubSpotForms)g();else{B(`//js.${v()?"hsformsqa.net":"hsforms.net"}/forms/embed/v2.js`).then(g).catch((e=>{console.error("Failed to display form",e);Pe("Failed to display form",{errorMessage:String(e)});h()}))}}const pt=[l.INITIAL,l.LOADING,l.READY],ft="video-embed-js",mt="hubl-iframe",gt=()=>window.performance.now?window.performance.now():null,Et=(e,t)=>{const o=e.filter((e=>"number"==typeof e.timings[t])).map((e=>e.timings[t]));return o.length?Math.round(Math.min(...o)):null},bt=e=>{let t=ft;e.some((e=>e.options.renderContext&&e.options.renderContext.startsWith("hubl-iframe")))&&(t=mt);return{embedType:t,embedVersion:1,firstVideoLoadedAt:Et(e,"loadedAfterMs"),firstVideoReadyAt:Et(e,"readyAfterMs"),firstVideoPlayedAt:Et(e,"playedAfterMs"),numHsVideos:e.length,numAutoplay:e.filter((e=>e.options.autoplay)).length,numInitiallyVisible:e.filter((e=>e.initiallyVisible)).length,numInteractedWith:e.filter((e=>!pt.includes(e.status))).length,secondsOfVideoPlayed:e.reduce(((e,t)=>e+(t.timings.secondsViewed||0)),0)}},yt="hsv",vt="ca",wt=["id","width","height"],Pt={fullWidth:"full_width"},At=[".slick-slide.slick-cloned",".swiper-slide-duplicate"],_t=e=>`${e[0].toLowerCase()}${e.slice(1)}`;function Rt(e){let t=e.querySelector("img[data-hsv-id]");t||(t=e.querySelector("iframe[data-hsv-src]"));if(!t)return null;const o=Object.assign({},t.dataset),n={embedId:e.dataset.hsvEmbedId};Object.keys(o).forEach((e=>{let t=o[e];(e=_t(e.replace(yt,"")))in Pt&&(e=Pt[e]);"true"===t?t=!0:"false"===t?t=!1:wt.includes(e)&&(e.includes("%")||Number.isNaN(Number(t))||(t=Number(t)));if(e.startsWith("ca")){e=_t(e.replace(vt,""));n.conversionAsset=n.conversionAsset||{};"overlayDelaySeconds"===e&&(t=Number(t));n.conversionAsset[e]=t}else n[e]=t}));return n}function It(e){return!At.some((t=>W(e,t)))}function Tt(e=document.body){const t=k(e,M).filter((e=>e.querySelector("img[data-hsv-id]"))),o=t.filter(It);o.length!==t.length&&S(`Found only ${o.length} valid placeholders out of ${t.length} total.`,t);const n=o.map(Rt),i={};o.forEach(((e,t)=>{const o=n[t];o&&o.embedId&&(i[o.embedId]={id:o.embedId,el:e,options:o})}));Object.keys(i).length!==n.length&&S(`Found only ${Object.keys(i).length} unique embedIds for ${n.length} placeholders.`,o);return Le(i)}function St(e=document.body){return k(e,M).filter((e=>e.querySelector(D))).map((e=>({el:e,options:Rt(e)})))}class Ct{constructor(e,o,i,r){this.status=l.INITIAL;this.confirmedVisible=!1;this.initiallyVisible=!1;this.preloaderIframeLoaded=!1;this.iframeLoaded=!1;this.getWrapperEl=()=>this.el.matches(".hs-video-wrapper")?this.el:this.el.querySelector(".hs-video-wrapper");this.injectPlayer=()=>{const{options:e,placeholderEl:t}=this;if(t.querySelector(D))this.iframeEl=t.querySelector(D);else{if(this.selectIframeElFromPage()){Pe("injectPlayer found iframe el on page via selector, not inserting again.");this.replaceIframeFromPage();return}if(!t){Pe("injectPlayer cannot find placeholder, no way to render!");return}this.injectIframe(t);t.setAttribute("data-hsv-status","rendered");e.altText&&(this.iframeEl.title=e.altText)}if(A()||e.playerType===u.IN_APP_PREVIEW||e.playerType===u.EDITOR_PREVIEW||e.autoplay)this.onConfirmVisible();else{setTimeout((()=>this.confirmRendered()),n);if(window.IntersectionObserver)try{this.setupIntersectionObserver()}catch(e){this.log("Failed to setup IntersectionObserver",e);Pe("Failed to setup IntersectionObserver",{err:String(e)});this.onConfirmVisible()}else{Pe("Missing IntersectionObserver constructor");this.onConfirmVisible()}}};this.injectIframe=e=>{e.appendChild(this.el);const t=e.querySelector("img[data-hsv-id]");if(t&&t.src){this.el.style.backgroundImage=`url(${t.src})`;this.el.style.backgroundSize="contain";this.el.style.backgroundRepeat="no-repeat";this.el.style.backgroundPosition="center"}this.hidePlaceholderImage()};this.hidePlaceholderImage=()=>{const e=this.placeholderEl.querySelector("img[data-hsv-id]");e&&e.style.setProperty("display","none","important")};this.on=(e,t)=>{this.eventTarget?this.eventTarget.addEventListener(e,t):console.log("Browser does not support EventTarget API, on is a no-op.")};this.trigger=e=>{this.eventTarget&&this.eventTarget.dispatchEvent(e)};this.onConfirmVisible=()=>{const e=this.iframeEl.getAttribute("data-hsv-src");if(e){const[t]=e.split("#"),o=t.split("?");let n=o[0];const i=Oe(o[1]||""),r=Oe();i.parentOrigin=window.location.origin;i.renderContext=this.options.renderContext;i.locale=Be();r._hsVideoForm&&!i.ca?i.ca=Ne({type:d.FORM,position:c.PRE,id:r._hsVideoForm}):r._hsVideoCta&&!i.ca&&(i.ca=Ne({type:d.CTA,position:c.PRE,id:r._hsVideoCta}));y()&&(n=n.replace("play","local"));this.iframeEl.src=`${n}?${$e(i)}#hsvid=${this.id}`;this.iframeEl.removeAttribute("data-hsv-src")}else{const e=this.iframeEl.getAttribute("src");if(!e||!/http(s?):/.test(e)){this.hidePlaceholderImage();this.iframeEl.src=this.buildIframeUrl();this.el.style.backgroundImage="none"}}this.status=l.LOADING;this.postMessageToPlayer(t.CONFIRM_VISIBLE);this.confirmedVisible=!0};this.log=(...e)=>{S(`(${this.id})`,...e)};this.id=e;this.portalId=o;this.options=i;this.outgoingMessages=[];this.receivedMessages=[];this.timings={constructedAt:gt()};this.placeholderEl=r||Y(this.id,!0);this.el=this.createPlayerIframe();this.iframeEl=this.el.querySelector("iframe");if(window.EventTarget)try{this.eventTarget=new EventTarget}catch(e){S("Cannot construct EventTarget, cannot support event handler API.",e)}}createPlayerIframe(){const{id:t,options:o,placeholderEl:n}=this;if(n&&n.querySelector(D)&&n.querySelector(".hs-video-wrapper")){S(`Found server-rendered iframe for player ${t}`,o,n);return n.querySelector(".hs-video-wrapper")}S(`Rendering iframe for player ${t}`,o,n);const i="100%"===o.height&&("100%"===o.width||o.full_width);let r="",s="",a=o.style||"",l="";if(i)s=r="position: absolute; width: 100%; height: 100%";else{const t="string"==typeof o.width?Number(o.width):o.width;let n="string"==typeof o.height?Number(o.height):o.height;const i=t&&n?n/t*100:100*e;if("number"==typeof o.maxHeight){n=o.maxHeight;l=`max-height: ${o.maxHeight}px`}let d=t?`max-width: ${t}px; `:"";const c=n&&o.maxHeight&&n>=o.maxHeight?`max-height: ${o.maxHeight}px; `:"";if("boolean"==typeof o.full_width){a||(a="margin: 0 auto;");o.full_width&&(d="")}r=`${d} ${c} ${a}`;s=`position: relative; height: 0; padding-bottom: ${i}%;`}const d=document.createElement("div");d.innerHTML=`\n
\n
\n \n
\n
\n `;return d.firstElementChild}getPlaceholderSelector(){return`[data-hsv-embed-id="${this.id}"]`}findPlaceholderEls(){return N(this.getPlaceholderSelector())}findOtherPlaceholderEls(){return this.findPlaceholderEls().filter((e=>e!==this.placeholderEl&&It(e)))}selectIframeElFromPage(){const e=N(`iframe#hs_player_${this.id}`);if(e.length>1){S("Found multiple iframes for player",e);Pe("Found multiple iframes for player")}return e[0]}confirmRendered(){if(document.contains(this.el))return;if(this.selectIframeElFromPage()){Pe("confirmRendered found new iframe el on page via selector.");this.replaceIframeFromPage();return}const e=this.findOtherPlaceholderEls();e.length?Pe("confirmRendered found duplicate placeholders for player",{embedId:this.id,otherPlaceholderCount:e.length}):Pe("confirmRendered could not find player el and exhausted options to render!")}buildIframeUrl(){const e=ke(this.options);return qe(this.portalId,this.options.id,e,this.id,this.options,this.preloaderIframeLoaded)}isIframeLoaded(){return this.iframeLoaded}getReadyQueue(){return this.outgoingMessages}onMessageReceived(e,o){S(`Received message from player ${this.id}`,e,o);this.receivedMessages.push([e,o]);switch(e){case t.VIDEO_LOADED:this.video=o;this.handleVideoLoaded(this.video);this.trigger(new Event("videoLoaded"));break;case t.PLAYER_LOADED:this.executeReadyQueue();this.placeholderEl.setAttribute("data-hsv-status","loaded");this.timings.loadedAfterMs=gt();this.trigger(new Event("loaded"));break;case t.PLAYER_READY:this.status=l.READY;this.placeholderEl.setAttribute("data-hsv-status","ready");this.timings.readyAfterMs=gt();this.trigger(new Event("ready"));break;case t.PLAYER_PLAY:this.status=l.PLAYING;this.placeholderEl.setAttribute("data-hsv-status","playing");this.timings.playedAfterMs=gt();this.trigger(new Event("play"));break;case t.PLAYER_PROGRESS:if(o&&"object"==typeof o&&"currentTime"in o){const e=o.currentTime,t=o.textLanguage,n=new CustomEvent("progress",{detail:{currentTime:e,textLanguage:t}});this.trigger(n)}break;case t.PLAYER_TIME_UPDATE:if(o&&"object"==typeof o&&"currentTime"in o){const e=o.currentTime,t=new CustomEvent("timeupdate",{detail:{currentTime:e}});this.trigger(t)}break;case t.SET_PLAYBACK_RATE:if(o&&"object"==typeof o&&"playbackRate"in o){const e=o.playbackRate,t=new CustomEvent("ratechange",{detail:{playbackRate:e}});this.trigger(t)}break;case t.TRIGGER_AUTOPLAY:{const e=new CustomEvent("autoplaytoggle");this.trigger(e);break}case t.PLAYER_SECONDS_VIEWED:o&&"object"==typeof o&&"number"==typeof o.secondsViewed&&(this.timings.secondsViewed=o.secondsViewed);break;case t.PLAYER_PAUSE:this.status=l.PAUSED;this.placeholderEl.setAttribute("data-hsv-status","paused");this.trigger(new Event("pause"));break;case t.PLAYER_ENDED:this.status=l.ENDED;this.placeholderEl.setAttribute("data-hsv-status","ended");this.trigger(new Event("ended"));break;case t.PLAYER_SHOW_OVERLAY:{const e=o||this.options.conversionAsset;if(!(e&&e.type&&e.id)){Pe("Unexpected PLAYER_SHOW_OVERLAY message");break}this.status=l.CONVERSION_ASSET_OVERLAY;this.placeholderEl.setAttribute("data-hsv-status",`${e.type.toLowerCase()}-overlay`);if(e.type===d.CTA)try{nt(this,e)}catch(e){Pe("Error thrown rendering CTA")}else if(e.type===d.FORM)try{ht(this,e)}catch(e){Pe("Error thrown rendering form")}break}case t.PLAYER_ORPHANED:Pe("Player did not receive SET_PAGE_META postMessage",{iframeUrl:this.iframeEl.src});break;case t.PLAYER_ERROR:Pe("In-app player reported error",{iframeUrl:this.iframeEl.src});this.trigger(new CustomEvent("error",{detail:o}));break;case t.TRIGGER_PICTURE_IN_PICTURE:if(o&&"object"==typeof o&&"isPictureInPictureActive"in o&&"currentTime"in o){const e=new CustomEvent("pictureinpicturetoggle",{detail:o});this.trigger(e)}}}handleVideoLoaded(e){this.iframeEl.title||(this.iframeEl.title=e.altText||e.title)}triggerPlay(){this.postMessageToPlayer(t.SET_PLAYER_STATUS,{status:l.PLAYING})}triggerPause(){this.postMessageToPlayer(t.SET_PLAYER_STATUS,{status:l.PAUSED})}postMessageToPlayer(e,t=null,o=!0){if(this.iframeLoaded){this.iframeEl.contentWindow||this.replaceIframeFromPage();if(this.iframeEl.contentWindow){this.sendMessage(e,t);return}S(`Could not access contentWindow for player ${this.id}`,e,t)}if(o){S(`Queuing postMessage for player ${this.id}`,e,t);this.outgoingMessages.push([e,t])}}sendMessage(e,o){this.iframeEl.contentWindow||this.replaceIframeFromPage();if(this.iframeEl&&this.iframeEl.contentWindow){S(`Sending postMessage to player ${this.id}`,e,o);o&&"object"==typeof o&&e===t.SET_UTK&&"utk"in o&&(this.utk=o.utk);try{this.iframeEl.contentWindow.postMessage({type:e,payload:o},w(this.options))}catch(e){this.log("Failed to postMessage player",e)}}else S(`sendMessage could not access contentWindow for player ${this.id}`,e,o)}replaceIframe(e){this.iframeEl=e;try{this.intersectionObserver.observe(this.iframeEl)}catch(e){this.onConfirmVisible()}}replaceIframeFromPage(){const e=this.selectIframeElFromPage();if(e){S("Replacing iframeEl from page with ",this.iframeEl,this.iframeEl===e);this.iframeEl=e}}executeReadyQueue(){if(this.outgoingMessages.length){if(this.iframeLoaded){S(`Player ${this.id} reloaded, executing readyQueue of length ${this.outgoingMessages.length}`);if(this.utk){const{utk:e}=this;this.sendMessage(t.SET_UTK,{utk:e})}}else S(`Executing readyQueue of length ${this.outgoingMessages.length} for player ${this.id}`);this.outgoingMessages.forEach((([e,t])=>{this.sendMessage(e,t)}))}this.iframeLoaded=!0}setupIntersectionObserver(){if(K(this.el)){this.initiallyVisible=!0;this.onConfirmVisible()}else{this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{this.log("IntersectionObserver entry",e);if(e.isIntersecting){this.log("Found player in viewport via IntersectionObserver");this.onConfirmVisible();this.intersectionObserver.disconnect()}}))}),{rootMargin:"100px",threshold:0});this.intersectionObserver.observe(this.el)}}}function Lt(e,o){if(e&&e.data&&"object"==typeof e.data&&Object.keys(t).includes(e.data.type)){o&&e.origin&&e.origin!==o&&S("isPlayerMessage saw unexpected origin",e);return!0}return!1}function Ot(e,t,{placeholderEl:o}={}){!o&&t.embedId&&((o=Y(e,!0))?t.renderContext="embed-id-selector":S(`Failed to find for embedId: ${t.embedId} for player: ${e}`));const n=t.portalId||Ve();n&&t.id||Pe("Required param `portalId` or video `id` missing");if(He()){t.playerType=u.EDITOR_PREVIEW;t.renderContext="editor-preview"}const i=new Ct(e,n,t,o);i.injectPlayer();return i}function $t(e,t){const o=t.portalId||Ve(),n=ke(t),i=qe(o,t.id,n,e.id,t);if(t.conversionAsset&&e.options.conversionAsset&&t.conversionAsset.id!==e.options.conversionAsset.id){const t=e.el.querySelector(".hsv-overlay");t&&t.remove()}S(`Updating src of existing iframe for player ${e.id}`,t);e.options=t;e.iframeEl.src=i;t.altText&&(e.iframeEl.title=t.altText);return e}function Mt(e,t,o,n=!0){Le(e).forEach((e=>{e.postMessageToPlayer(t,o,n)}))}function Dt(e){window.addEventListener("message",(o=>{if(Lt(o,w())){const{data:n}=o,{type:i,embedId:r,payload:s={}}=n,a=e[r];if(!a){console.warn(`Could not find embedId ${r}`,n);return}a.onMessageReceived(i,s);if(!(i!==t.PLAYER_PLAY||a.options.autoplay&&s.isInitial)){const t=Le(e).filter((e=>e!==a&&e.status===l.PLAYING));t.length&&S(`Pausing ${t.length} other currently playing players`,t);t.forEach((e=>e.triggerPause()))}if(i===t.PLAYER_ANALYTICS_EVENTS){const e=JSON.parse(s);e.events&&e.events.length&&window._hsq&&e.events.forEach((e=>window._hsq.push(e)))}}}))}function xt(){const e=({id:e})=>{const t=document.querySelector(`.hs-form-${e}.submitted-message`);if(t){const e=Tt(t);S(`Found ${e.length} players in form thank you message`);e.forEach((({el:e,options:t})=>{t.renderContext="form-inline-message";window.hsVideoApi.renderPlayer(e,t)}))}};window.addEventListener("message",(t=>{if(t.data&&"hsFormCallback"===t.data.type&&"onFormSubmitted"===t.data.eventName){S("Form submitted",t.data);setTimeout((()=>e(t.data)))}}))}function Nt(){if(!window.MutationObserver)return null;const e=new MutationObserver((e=>{e.forEach((e=>{if(!e.addedNodes.length)return;const t=[...e.addedNodes].filter((e=>e instanceof Element&&(e.matches(D)||e.matches(x))));e.addedNodes.forEach((e=>{e instanceof Element&&t.push(...e.querySelectorAll(D),...e.querySelectorAll(x))}));if(t.length){S("Found server-rendered iframes via MutationObserver:",t);Pe("Found server-rendered iframes via MutationObserver (leaving here for debugging)");t.forEach((e=>{const t=G(e,".hs-video-widget[data-hsv-embed-id]");if(!t||!t.dataset.hsvEmbedId)return;const o=window.hsVideoApi.getPlayer(t.dataset.hsvEmbedId);if(o&&e.matches(x)){S(`Moving player ${t.dataset.hsvEmbedId} to new iframe: `,e);o.replaceIframe(e)}else{const e=Rt(t);if(null!=e&&e.embedId){e.renderContext="hubl-iframe";window.hsVideoApi.renderPlayer(t,e)}}}))}}))}));try{e.observe(document.body,{childList:!0,subtree:!0})}catch(e){Pe("Failed to create MutationObserver")}return e}function kt(){document.addEventListener("securitypolicyviolation",(e=>{S("SecurityPolicyViolationEvent event",e);const{blockedURI:t,disposition:o}=e;e.blockedURI&&O.test(t)&&Pe(`CSP ${o} blocked video-embed JS`,{blockedURI:t});e.blockedURI&&e.blockedURI.includes(w())&&Pe(`CSP ${o} blocked player iframe load`,{blockedURI:t})}))}let qt=1;function Ut(e="uniq"){return`${e}${qt++}`}let Vt=!1;function Yt({testingMode:e=!1}={}){const o=window._hsq=window._hsq||[],n=window._hsp=window._hsp||[],i=[],r={};let s,a;const l=e=>Boolean(r[e]),d=e=>Boolean(r[e]&&r[e].confirmedVisible),c=e=>i.find((([t])=>e===t));function u(...e){let t,o,n;Pe("registerPlayer still being called");if("string"==typeof e[0]){t=e[0];o=e[1];o.embedId=t||Ut()}else if(e[0]instanceof HTMLElement){n=e[0];o=e[1];t=o.embedId||Ut()}else{if("object"!=typeof e[0]){console.warn("invalid args passed to `registerPlayer`",e);return}o=e[0];t=o.embedId||Ut()}if(c(t)||l(t))S(`Player with embedId: ${t} already exists, ignoring call to registerPlayer`,o);else{if(j()){!n&&o.embedId&&(n=Y(t));if(n){m(n,o);return}}i.push([t,o])}}function h(){return!!s&&(s.categories?s.categories.analytics:s.allowed)}function p(e){Mt({[e]:r[e]},t.SET_PAGE_META,Je());a&&h()&&!A()&&Mt({[e]:r[e]},t.SET_UTK,{utk:a})}function f(e,t,o){r[e]=Ot(e,t,o);A()||p(e);return r[e]}function m(e,t){let o,n;if("string"==typeof e){o=e;n=Y(o);if(!n){console.warn(`Element id ${e} not found`);return null}}else{if(!(e instanceof HTMLElement)){console.warn("First argument to renderPlayer must be an id string or HTMLElement");return null}o=t.embedId||Ut();n=e}if(l(o)&&d(o)){S(`Player with embedId: ${o} already exists, ignoring call to renderPlayer`,t);return null}return f(o,t,{placeholderEl:n})}function g(e,t){const o=w(e);if(!o){S(`Could not find player id ${e} to update`);return null}$t(o,t);return o}function E(e){a=e;if(s&&a)if(h()){S(`Received utk ${a} privacyConsent`,JSON.stringify(s));Mt(r,t.SET_UTK,{utk:a})}else{S("Received privacyConsent but not allowed",a,s);Mt(r,t.SET_UTK,null)}else S("Could not obtain utk cookie and privacyConsent",a,s)}function b(){n.push(["addPrivacyConsentListener",e=>{s=e;o.push(["addUserTokenListener",E])}])}function y(){return r}function w(e){return y()[e]}function P(){return Le(r).reduce(((e,t)=>{t.receivedMessages.forEach((o=>{e.push([t.id,o[0],o[1]])}));return e}),[])}function _(){Le(r).forEach((e=>e.triggerPause()))}function R(){Tt().forEach((({el:e,options:t})=>{if(t.embedId){t.renderContext=W(e,".widget-type-rich_text")?"rich-text-placeholder":"onload-placeholder";Ge()&&(t.renderContext="share-page");f(t.embedId,t,{placeholderEl:e})}}));St().forEach((({el:e,options:t})=>{if(t.embedId){t.renderContext=Ge()?"hubl-iframe-share-page":"hubl-iframe";f(t.embedId,t,{placeholderEl:e})}}))}function I(){setTimeout((()=>{const e=Object.values(y()).find((e=>e.confirmedVisible));e?S("Not inserting preloader iframe as at least one player is already visible & loading:",e):Q((()=>{Object.values(y()).forEach((e=>{e.preloaderIframeLoaded=!0}))}))}),500)}function C(){i.forEach((([e,t])=>{f(e,t)}));Dt(r);Vt=!0;if(!A()){I();b();R();kt();xt();Nt();window._hsVideoReady&&Array.isArray(window._hsVideoReady)&&setTimeout((()=>window._hsVideoReady.forEach((e=>e()))))}}if(Vt&&!e)S("loader already initialized, not listening for document load");else if(j())try{C()}catch(e){Ae(e,{source:"already-loaded"})}else{document.addEventListener("DOMContentLoaded",(()=>{try{C()}catch(e){Ae(e,{source:"DOMContentLoaded"})}}));window.addEventListener("content-analytics-code-not-loaded",(()=>E(null)))}const L={registerPlayer:u,renderPlayer:m,updatePlayer:g,getPlayer:w,getPlayers:()=>Le(y()),getPerformanceMetrics:()=>bt(Object.values(r)),pauseAllPlayers:_};return e||T()||v()?Object.assign({},L,{getPlayerMessages:P,triggerLoad:C,renderPlaceholders:R}):L}let jt=window.hsVideoApi;jt?S("hsVideoApi found on page, not calling createLoader"):window.hsVideoApi=jt=Yt();jt.renderPlayer,jt.updatePlayer}(); //# sourceMappingURL=//static.hsappstatic.net/video-embed/static-1.34356/bundles/loader.js.map