(()=>{"use strict";function e(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{if("wa.me"===t.hostname){const o=e(n(t),2),i=o[0],l=o[1];return/^\d+$/.test(i||"")||["message","qr"].includes(r(i))&&!!l}return!!t.searchParams.get("phone")}},{type:"messenger",schemes:["fb-messenger:"],hosts:["m.me","messenger.com"],hasRecipient:t=>{if("m.me"===t.hostname)return n(t).length>0;if("messenger.com"===t.hostname){const o=e(n(t),2),i=o[0],l=o[1];return"t"===r(i)&&!!l}return["user-thread","user"].includes(t.hostname)}},{type:"telegram",schemes:["tg:"],hosts:["t.me","telegram.me"],hasRecipient:t=>{if("tg:"===t.protocol)return"resolve"===t.hostname&&!!t.searchParams.get("domain");const o=e(n(t),1)[0];return!!o&&!o.startsWith("+")&&!["share","joinchat","addstickers","proxy"].includes(r(o))}},{type:"viber",schemes:["viber:"],hasRecipient:e=>["chat","add","pa"].includes(e.hostname)},{type:"signal",schemes:["sgnl:"],hosts:["signal.me"],hasRecipient:e=>"sgnl:"===e.protocol||e.hash.startsWith("#p/")&&e.hash.length>3},{type:"line",schemes:["line:"],hosts:["line.me","page.line.me"],hasRecipient:t=>{if("page.line.me"===t.hostname)return n(t).length>0;const o="line:"===t.protocol?[t.hostname,...n(t)]:n(t),i=e("r"===r(o[0])?o.slice(1):o,4),l=i[0],a=i[1],s=i[2],c=i[3];return"ti"===r(l)&&"p"===r(a)&&!!s&&!c}}],i=Object.create(null),l=Object.create(null);o.forEach(e=>{var t,n;null===(t=e.schemes)||void 0===t||t.forEach(t=>{i[t]=e}),null===(n=e.hosts)||void 0===n||n.forEach(t=>{l[t]=e})});const a=["sponsored","ugc","nofollow"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t0)return n}const n=t.pathname.split("/").filter(Boolean).pop()||"";if(/^\d+$/.test(n)){const e=parseInt(n,10);if(e>0)return e}}catch(e){}const n=parseInt((null===(t=e.textContent)||void 0===t?void 0:t.trim())||"",10);return n>0?n:1}const m="https://player.vimeo.com/api/player.js",d="data-googlesitekit-vimeo-sdk";function g(){return globalThis.Vimeo}function b(e,t){return new Promise((n,r)=>{let o;function i(e){return function(){clearTimeout(o),e(...arguments)}}e.addEventListener("load",i(()=>n()),{once:!0}),e.addEventListener("error",i(()=>r(new Error("Site Kit: failed to load the Vimeo Player SDK script."))),{once:!0}),void 0!==t&&(o=setTimeout(i(()=>r(new Error("Site Kit: timed out waiting for the Vimeo Player SDK script to load."))),t))})}let v=null;function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{var e;const t=null===(e=g())||void 0===e?void 0:e.Player;if("function"!=typeof t)throw new Error("Site Kit: the Vimeo Player SDK script did not expose Vimeo.Player.");return t}).catch(e=>{throw v=null,e})),v)}();await Promise.allSettled(Array.from(t).map(async(t,n)=>{await async function(e,t){const n=Promise.all([e.getVideoTitle(),e.getVideoUrl()]).then(e=>{let n=(o=2,function(e){if(Array.isArray(e))return e}(r=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(r,o)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var r,o;return{video_provider:"vimeo",video_title:n[0],video_url:n[1],video_instance_index:t}});function r(e,t){n.then(n=>{var r,o;null===(r=globalThis._googlesitekit)||void 0===r||null===(o=r.gtagEvent)||void 0===o||o.call(r,e,w(w({},n),{},{video_percent:t}))}).catch(()=>{})}n.catch(e=>{console.error("Site Kit: failed to fetch this Vimeo video’s title/URL; its engagement events will not be tracked.",e)});let o=!1,i=!1;const l=new Set;e.on("play",()=>{o||(o=!0,r("video_start",0))}),e.on("timeupdate",e=>{if(l.size===T.length)return;const t=Math.floor(100*e.percent);T.forEach(e=>{t>=e&&!l.has(e)&&(l.add(e),r("video_progress",e))})}),e.on("ended",()=>{i||(i=!0,r("video_complete",100))}),await n}(new e(t),n)}))}catch(e){console.error("Site Kit: failed to load the Vimeo Player SDK; video engagement events will not be tracked on this page.",e)}}(k),E(()=>function(e){globalThis.document.addEventListener("click",t=>{try{var n,r;if(!(t.target instanceof Element))return;const o=t.target.closest("".concat(p,", ").concat("body.single-topic .bbp-pagination-links a.page-numbers"));if(!o)return;const i=o.matches(p)?"post":"bbpress";null===(n=globalThis._googlesitekit)||void 0===n||null===(r=n.gtagEvent)||void 0===r||r.call(n,"pagination_click",{pagination_type:i,page_number:h(o),post_id:e.postID,transport_type:"beacon"})}catch(e){console.error("Site Kit: failed to track this pagination click.",e)}})}(k),"Site Kit: failed to initialize pagination click tracking."),E(()=>{globalThis.document.addEventListener("click",e=>{try{if(!(e.target instanceof Element))return;const s=e.target.closest("a[href]");if(!s)return;let u;try{u=new URL(s.href)}catch(e){return}const p=function(e){const t=new URL(e),n="http:"===t.protocol||"https:"===t.protocol;t.hostname=n?t.hostname.replace(/^www\./,""):t.hostname.toLowerCase();const r=n?l[t.hostname]:i[t.protocol];return r?r.hasRecipient?r.hasRecipient(t)?r.type:null:r.type:null}(u);if(p){var t,n;null===(t=globalThis._googlesitekit)||void 0===t||null===(n=t.gtagEvent)||void 0===n||n.call(t,"contact_link_click",c({link_type:p},f(u)))}else{const e=function(e,t){if("http:"!==t.protocol&&"https:"!==t.protocol||t.hostname===globalThis.location.hostname)return null;const n=new Set((e.getAttribute("rel")||"").toLowerCase().split(/[\s,]+/).filter(Boolean));return a.filter(e=>n.has(e)).join(" ")||null}(s,u);var r,o;e&&(null===(r=globalThis._googlesitekit)||void 0===r||null===(o=r.gtagEvent)||void 0===o||o.call(r,"outbound_link_click",c({link_rel:e,link_url:u.href,link_domain:u.hostname},f(u))))}}catch(e){console.error("Site Kit: failed to track this link click.",e)}})},"Site Kit: failed to initialize link click tracking."),E(()=>function(e){const t=e.postID,n=e.isReadableSinglePost,r=e.isLastPageOfMultiPagePost,o=e.wordCount,i=e.estimatedReadTimeSeconds,l=e.readTimeThresholdPercent,a=e.minimumReadTimeSeconds;if(!n||!r)return;const s=1e3*Math.max(a,i*l/100);let c=!1,u=!1,f=null,p=null,h=0,m=0;function d(){if(c&&u){try{var e,n;null===(e=globalThis._googlesitekit)||void 0===e||null===(n=e.gtagEvent)||void 0===n||n.call(e,"read_article",{post_id:t,word_count:o,estimated_read_time_seconds:i})}catch(e){console.error("Site Kit: failed to send the read article event.",e)}g(),y(),globalThis.removeEventListener("blur",w),globalThis.removeEventListener("focus",w),globalThis.document.removeEventListener("visibilitychange",w)}}function g(){var e;null===(e=f)||void 0===e||e.disconnect(),f=null,globalThis.removeEventListener("scroll",v)}function b(){c=!0,g(),d()}function v(){(globalThis.scrollY+globalThis.innerHeight)/globalThis.document.documentElement.scrollHeight>=.9&&b()}function y(){null!==p&&(globalThis.clearTimeout(p),p=null,h+=globalThis.performance.now()-m)}function w(){"hidden"!==globalThis.document.visibilityState&&globalThis.document.hasFocus()?u||null!==p||(m=globalThis.performance.now(),p=globalThis.setTimeout(()=>{p=null,u=!0,d()},s-h)):y()}const O=function(){const e=globalThis.document.createTreeWalker(globalThis.document.body,globalThis.NodeFilter.SHOW_COMMENT);for(;e.nextNode();){const t=e.currentNode;if("[googlesitekit-end-of-content]"!==t.data)continue;let n=t.previousElementSibling;for(;n&&0===n.getClientRects().length;)n=n.previousElementSibling;return n||t.parentElement}return null}();O&&"function"==typeof globalThis.IntersectionObserver?(f=new globalThis.IntersectionObserver(e=>{e.some(e=>!e.isIntersecting&&e.rootBounds&&e.boundingClientRect.bottom<=e.rootBounds.top)&&b()},{rootMargin:"-100% 0px 1000000px 0px"}),"complete"===globalThis.document.readyState?f.observe(O):globalThis.addEventListener("load",()=>{var e;return null===(e=f)||void 0===e?void 0:e.observe(O)},{once:!0})):(globalThis.addEventListener("scroll",v,{passive:!0}),v()),globalThis.addEventListener("blur",w),globalThis.addEventListener("focus",w),globalThis.document.addEventListener("visibilitychange",w),w()}(k),"Site Kit: failed to initialize read article tracking.")})();