"use strict";(self.webpackJsonpRuntime=self.webpackJsonpRuntime||[]).push([[549],{5116:(e,t,n)=>{async function o(e){const{_currentPage:t,Parameters:n}=window;!async function(e){try{const t=window.rtCommonProps?.["runtimecollector.url"];if(!t)return;await fetch(`${t}/feature/metrics`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(e)})}catch(e){console.debug("Failed send metrics for feature count",e)}}({features:e,siteAlias:n?.SiteAlias,sitePublicationDate:n?.PublicationDate?new Date(n?.PublicationDate).getTime():0,pageType:n?.pageType,pageUuid:t?.pageContent?.uuid||n?.InitialPageUuid||`${t?.pageID}`,path:location.pathname})}n.d(t,{_:()=>o})},3549:(e,t,n)=>{n.r(t),n.d(t,{collectWidgetCount:()=>d,countButtonTypes:()=>c,countImages:()=>l,countMegaMenus:()=>s,countSmartLayouts:()=>i,countWidgetTypes:()=>u});var o=n(6856),r=n(5116);const a="[data-widget-type], [data-element-type]";function u(){const e=document.querySelectorAll(a),t=Array.from(e).reduce(m({generateFeatureKey:e=>`widget-${p(e)}`}),{});return Object.values(t)}function c(){const e=document.querySelectorAll(a),t=Array.from(e).filter(y).reduce(m({generateFeatureKey:e=>`${function(e){return e.classList.contains("button_2")||e.querySelector(".button_2")?"button-secondary":"button-primary"}(e)}-${p(e)}`}),{});return Object.values(t)}function l(){const e=document.querySelectorAll("img"),t=document.querySelectorAll("image"),n=document.querySelectorAll("img[alt]"),o=document.querySelectorAll("image[alt]");return[{feature:"all-image-elements",count:e.length+t.length},{feature:"all-image-elements-with-alt",count:n.length+o.length}]}function i(){const e=document.querySelectorAll("[data-layout-type]"),t=Array.from(e).reduce(m({generateFeatureKey:e=>`smart-layout-${e.getAttribute("data-layout-type")}`}),{});return Object.values(t)}function s(){const e=document.querySelector("#flex-mega-menu");return e?[{feature:"mega-menu",count:e.childElementCount}]:[]}async function d(e){if(!(0,o.V)("scripts.widgetCount.enabled"))return;const t=e||u().concat(function(){const e=document.querySelectorAll('[data-element-type="mapextension"][provider="mappy"][data-radius-toggle="true"]');return e.length?[{feature:"maps-mappy-radius",count:e.length}]:[]}()).concat(c()).concat(function(){const e=document.querySelectorAll('[data-element-type="html"]'),t=["acuityscheduling","tidycal","Calendly","simplybookme","fareharbor","bookalet","bookeo"];return Array.from(e).find((e=>t.some((t=>e.innerHTML.toLowerCase().includes(t)))))?[{feature:"booking-script",count:1}]:[]}()).concat(function(){const e=document.querySelectorAll(a),t=["book","appointment","schedule"];return Array.from(e).filter(y).find((e=>t.some((t=>e.innerHTML.toLowerCase().includes(t)))))?[{feature:"booking-text",count:1}]:[]}()).concat(l()).concat(i()).concat(s());(0,r._)(t)}function m({generateFeatureKey:e}){return(t,n)=>{const o=e(n);return t[o]||(t[o]={feature:o,count:0}),t[o].count+=1,t}}const y=e=>{const t=e.classList.contains("dmWidget")&&g(e),n=Array.from(e.querySelectorAll(".dmWidget")).some((e=>g(e)));return t||n};function g(e){return"none"!==window.getComputedStyle(e).getPropertyValue("display")}const p=e=>{const t=e.getAttribute("data-widget-type")||e.getAttribute("data-element-type"),n=e.getAttribute("data-widget-id");return n?`${t}-${n}`:t}}}]);