@yext/visual-editor 0.0.45 → 0.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -6,7 +6,7 @@ import * as i18next from 'i18next';
6
6
  import { TOptions } from 'i18next';
7
7
  import * as _measured_puck from '@measured/puck';
8
8
  import { Field, CustomField, Data, DefaultComponentProps, DefaultRootProps, Config, ComponentConfig, ArrayField, BaseField, ObjectField, NumberField } from '@measured/puck';
9
- import { CTA as CTA$1, ImageType, LinkType, HoursTableProps as HoursTableProps$1, ComplexImageType, HoursType, AddressType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
9
+ import { AddressType, CTA as CTA$1, ImageType, LinkType, HoursTableProps as HoursTableProps$1, ComplexImageType, HoursType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
10
10
  import { ClassValue } from 'clsx';
11
11
  import * as _yext_search_headless_react from '@yext/search-headless-react';
12
12
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
@@ -46,7 +46,10 @@ declare const usePlatformBridgeEntityFields: () => StreamFields | null;
46
46
  declare const useEntityFields: () => StreamFields | null;
47
47
 
48
48
  declare const TemplatePropsContext: React$1.Context<any>;
49
- declare const useTemplateProps: <T>() => T;
49
+ declare const useTemplateProps: <T = {
50
+ document: Record<string, any>;
51
+ relativePrefixToRoot?: string;
52
+ }>() => T;
50
53
  declare const useDocument: <T>() => T;
51
54
 
52
55
  declare const TailwindConfigContext: React$1.Context<any>;
@@ -125,6 +128,10 @@ declare const defaultThemeTailwindExtensions: {
125
128
  "4xl": string;
126
129
  };
127
130
  };
131
+ type BorderRadiusOption = {
132
+ label: string;
133
+ value: string;
134
+ };
128
135
  declare const ThemeOptions: {
129
136
  HEADING_LEVEL: {
130
137
  label: string;
@@ -155,10 +162,8 @@ declare const ThemeOptions: {
155
162
  label: MsgString;
156
163
  value: string;
157
164
  }[];
158
- BORDER_RADIUS: () => {
159
- label: string;
160
- value: string;
161
- }[];
165
+ BUTTON_BORDER_RADIUS: BorderRadiusOption[];
166
+ IMAGE_BORDER_RADIUS: BorderRadiusOption[];
162
167
  SPACING: () => {
163
168
  label: string;
164
169
  value: string;
@@ -421,7 +426,7 @@ type RootConfig = {
421
426
  };
422
427
  declare function getPageMetadata(document: Record<string, any>): RootConfig;
423
428
 
424
- declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, latitude, longitude, radiusMi, limit, }: {
429
+ declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, latitude, longitude, radiusMi, limit, locale, currentLocationId, }: {
425
430
  businessId: string;
426
431
  apiKey: string;
427
432
  contentEndpointId: string;
@@ -430,6 +435,8 @@ declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, co
430
435
  latitude: number;
431
436
  radiusMi: number;
432
437
  limit: number;
438
+ locale: string;
439
+ currentLocationId: string;
433
440
  }) => Promise<Record<string, any>>;
434
441
 
435
442
  declare const fetchLocalesToPathsForEntity: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, entityId, }: {
@@ -498,6 +505,13 @@ declare function withPropOverrides<P extends DefaultComponentProps>(base: Compon
498
505
 
499
506
  declare const i18nComponentsInstance: i18next.i18n;
500
507
 
508
+ interface LocationDocument extends Record<string, any> {
509
+ slug?: string;
510
+ id: string;
511
+ address?: AddressType;
512
+ }
513
+ declare const getLocationPath: (location: LocationDocument, locale: string, relativePrefixToRoot: string | undefined) => string | undefined;
514
+
501
515
  type TranslatableCTA = Omit<CTA$1, "label"> & {
502
516
  label: TranslatableString;
503
517
  };
@@ -678,8 +692,6 @@ declare const OptionalNumberField: ({ fieldLabel, hideNumberFieldRadioLabel, sho
678
692
 
679
693
  declare const FontSizeSelector: (label?: string, includeLargeSizes?: boolean) => Field;
680
694
 
681
- declare const BorderRadiusSelector: (label?: string) => Field;
682
-
683
695
  declare const SpacingSelector: (label: string, spacingType: "padding" | "gap", includeDefault: boolean) => Field;
684
696
 
685
697
  type BasicSelectorProps = {
@@ -905,6 +917,23 @@ declare function Timestamp({ date, option, endDate, timeZone, hideTimeZone, loca
905
917
 
906
918
  declare function Toggle({ className, ...props }: React$1.ComponentProps<typeof TogglePrimitive.Root>): react_jsx_runtime.JSX.Element;
907
919
 
920
+ type AggregateRating = {
921
+ averageRating: number;
922
+ reviewCount: number;
923
+ };
924
+ type ReviewStarsProps = {
925
+ averageRating: number;
926
+ hasDarkBackground: boolean;
927
+ reviewCount?: number;
928
+ };
929
+ declare const ReviewStars: (props: ReviewStarsProps) => react_jsx_runtime.JSX.Element;
930
+ /**
931
+ * Extracts the aggregate rating from the document's schema.
932
+ * @param document - The document containing the schema.
933
+ * @returns The aggregate rating object if found, otherwise undefined.
934
+ */
935
+ declare function getAggregateRating(document: any): AggregateRating;
936
+
908
937
  type BannerSectionProps = {
909
938
  styles: {
910
939
  backgroundColor?: BackgroundStyle;
@@ -1010,6 +1039,7 @@ interface HeroSectionProps {
1010
1039
  localGeoModifier: YextEntityField<TranslatableString>;
1011
1040
  hours: YextEntityField<HoursType>;
1012
1041
  hero: YextStructEntityField<HeroSectionType>;
1042
+ showAverageReview: boolean;
1013
1043
  };
1014
1044
  styles: {
1015
1045
  backgroundColor?: BackgroundStyle;
@@ -1164,6 +1194,14 @@ interface FAQSectionProps {
1164
1194
  }
1165
1195
  declare const FAQSection: ComponentConfig<FAQSectionProps>;
1166
1196
 
1197
+ type ReviewsSectionProps = {
1198
+ backgroundColor: BackgroundStyle;
1199
+ analytics?: {
1200
+ scope?: string;
1201
+ };
1202
+ };
1203
+ declare const ReviewsSection: ComponentConfig<ReviewsSectionProps>;
1204
+
1167
1205
  interface TestimonialSectionProps {
1168
1206
  data: {
1169
1207
  heading: YextEntityField<TranslatableString>;
@@ -1208,9 +1246,9 @@ interface TeamSectionProps {
1208
1246
  declare const TeamSection: ComponentConfig<TeamSectionProps>;
1209
1247
 
1210
1248
  declare const layoutVariants: (props?: ({
1211
- gap?: "0" | "1" | "2" | "3" | "4" | "none" | "6" | "8" | "12" | "16" | "24" | "14" | "20" | "0.5" | "1.5" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1212
- verticalPadding?: "0" | "1" | "2" | "3" | "4" | "default" | "none" | "6" | "8" | "12" | "16" | "24" | "14" | "20" | "0.5" | "1.5" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1213
- horizontalPadding?: "0" | "1" | "2" | "3" | "4" | "none" | "6" | "8" | "12" | "16" | "24" | "14" | "20" | "0.5" | "1.5" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1249
+ gap?: "0" | "1" | "2" | "3" | "4" | "none" | "12" | "14" | "16" | "20" | "24" | "0.5" | "1.5" | "6" | "8" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1250
+ verticalPadding?: "0" | "1" | "2" | "3" | "4" | "default" | "none" | "12" | "14" | "16" | "20" | "24" | "0.5" | "1.5" | "6" | "8" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1251
+ horizontalPadding?: "0" | "1" | "2" | "3" | "4" | "none" | "12" | "14" | "16" | "20" | "24" | "0.5" | "1.5" | "6" | "8" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1214
1252
  columnFormatting?: "default" | "none" | "forceHorizontal" | null | undefined;
1215
1253
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
1216
1254
  interface layoutProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof layoutVariants> {
@@ -1330,7 +1368,9 @@ interface ExpandedHeaderProps {
1330
1368
  logo: string;
1331
1369
  links: TranslatableCTA[];
1332
1370
  primaryCTA?: TranslatableCTA;
1371
+ showPrimaryCTA: boolean;
1333
1372
  secondaryCTA?: TranslatableCTA;
1373
+ showSecondaryCTA: boolean;
1334
1374
  };
1335
1375
  secondaryHeader: {
1336
1376
  show: boolean;
@@ -1400,12 +1440,13 @@ interface ExpandedFooterProps {
1400
1440
  data: {
1401
1441
  primaryFooter: {
1402
1442
  logo: string;
1403
- xLink: string;
1404
1443
  facebookLink: string;
1405
1444
  instagramLink: string;
1406
- pinterestLink: string;
1407
1445
  linkedInLink: string;
1446
+ pinterestLink: string;
1447
+ tiktokLink: string;
1408
1448
  youtubeLink: string;
1449
+ xLink: string;
1409
1450
  utilityImages: {
1410
1451
  url: string;
1411
1452
  linkTarget?: string;
@@ -1452,6 +1493,7 @@ interface PageSectionCategoryProps {
1452
1493
  PhotoGallerySection: PhotoGallerySectionProps;
1453
1494
  ProductSection: ProductSectionProps;
1454
1495
  PromoSection: PromoSectionProps;
1496
+ ReviewsSection: ReviewsSectionProps;
1455
1497
  StaticMapSection: StaticMapSectionProps;
1456
1498
  TeamSection: TeamSectionProps;
1457
1499
  TestimonialSection: TestimonialSectionProps;
@@ -1468,6 +1510,7 @@ declare const PageSectionCategoryComponents: {
1468
1510
  PhotoGallerySection: _measured_puck.ComponentConfig<PhotoGallerySectionProps>;
1469
1511
  ProductSection: _measured_puck.ComponentConfig<ProductSectionProps>;
1470
1512
  PromoSection: _measured_puck.ComponentConfig<PromoSectionProps>;
1513
+ ReviewsSection: _measured_puck.ComponentConfig<ReviewsSectionProps>;
1471
1514
  StaticMapSection: _measured_puck.ComponentConfig<StaticMapSectionProps>;
1472
1515
  TeamSection: _measured_puck.ComponentConfig<TeamSectionProps>;
1473
1516
  TestimonialSection: _measured_puck.ComponentConfig<TestimonialSectionProps>;
@@ -1545,14 +1588,6 @@ declare const ContentBlockCategoryComponents: {
1545
1588
  };
1546
1589
  declare const ContentBlockCategory: (keyof ContentBlockCategoryProps)[];
1547
1590
 
1548
- type ReviewsSectionProps = {
1549
- backgroundColor: BackgroundStyle;
1550
- analytics?: {
1551
- scope?: string;
1552
- };
1553
- };
1554
- declare const ReviewsSection: ComponentConfig<ReviewsSectionProps>;
1555
-
1556
1591
  type SectionContainerProps = {
1557
1592
  background?: BackgroundStyle;
1558
1593
  sectionHeading: {
@@ -1570,4 +1605,4 @@ declare const addHeadingAlignmentMigration: Migration;
1570
1605
 
1571
1606
  declare const defaultThemeConfig: ThemeConfig;
1572
1607
 
1573
- export { Address, type AddressProps, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BorderRadiusSelector, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, DeprecatedCategory, DeprecatedCategoryComponents, type DeprecatedCategoryProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExpandedHeader, type ExpandedHeaderProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, type GalleryImageType, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, HoursStatusAtom, type HoursStatusAtomProps, type HoursStatusProps, HoursTable, HoursTableAtom, type HoursTableAtomProps, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, KnowledgeGraphIcon, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, LocatorCategory, LocatorCategoryComponents, type LocatorCategoryProps, LocatorComponent, type LocatorProps, MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, MaybeRTF, type MaybeRTFProps, type Migration, type MigrationAction, type MigrationRegistry, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RenderYextEntityFieldSelectorProps, ReviewsSection, type ReviewsSectionProps, type RichText, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, Toggle, type TranslatableCTA, type TranslatableRichText, TranslatableRichTextField, type TranslatableString, TranslatableStringField, VisibilityWrapper, VisualEditorProvider, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, addHeadingAlignmentMigration, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchLocalesToPathsForEntity, fetchNearbyLocations, fetchReviewsForEntity, getAnalyticsScopeHash, getFontWeightOptions, getFontWeightOverrideOptions, getPageMetadata, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, msg, normalizeSlug, pt, resolveTranslatableRichText, resolveTranslatableString, resolveYextEntityField, resolveYextStructField, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
1608
+ export { Address, type AddressProps, type AggregateRating, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, DeprecatedCategory, DeprecatedCategoryComponents, type DeprecatedCategoryProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExpandedHeader, type ExpandedHeaderProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, type GalleryImageType, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, HoursStatusAtom, type HoursStatusAtomProps, type HoursStatusProps, HoursTable, HoursTableAtom, type HoursTableAtomProps, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, KnowledgeGraphIcon, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, LocatorCategory, LocatorCategoryComponents, type LocatorCategoryProps, LocatorComponent, type LocatorProps, MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, MaybeRTF, type MaybeRTFProps, type Migration, type MigrationAction, type MigrationRegistry, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RenderYextEntityFieldSelectorProps, ReviewStars, type ReviewStarsProps, ReviewsSection, type ReviewsSectionProps, type RichText, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, Toggle, type TranslatableCTA, type TranslatableRichText, TranslatableRichTextField, type TranslatableString, TranslatableStringField, VisibilityWrapper, VisualEditorProvider, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, addHeadingAlignmentMigration, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchLocalesToPathsForEntity, fetchNearbyLocations, fetchReviewsForEntity, getAggregateRating, getAnalyticsScopeHash, getFontWeightOptions, getFontWeightOverrideOptions, getLocationPath, getPageMetadata, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, msg, normalizeSlug, pt, resolveTranslatableRichText, resolveTranslatableString, resolveYextEntityField, resolveYextStructField, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import * as i18next from 'i18next';
6
6
  import { TOptions } from 'i18next';
7
7
  import * as _measured_puck from '@measured/puck';
8
8
  import { Field, CustomField, Data, DefaultComponentProps, DefaultRootProps, Config, ComponentConfig, ArrayField, BaseField, ObjectField, NumberField } from '@measured/puck';
9
- import { CTA as CTA$1, ImageType, LinkType, HoursTableProps as HoursTableProps$1, ComplexImageType, HoursType, AddressType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
9
+ import { AddressType, CTA as CTA$1, ImageType, LinkType, HoursTableProps as HoursTableProps$1, ComplexImageType, HoursType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
10
10
  import { ClassValue } from 'clsx';
11
11
  import * as _yext_search_headless_react from '@yext/search-headless-react';
12
12
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
@@ -46,7 +46,10 @@ declare const usePlatformBridgeEntityFields: () => StreamFields | null;
46
46
  declare const useEntityFields: () => StreamFields | null;
47
47
 
48
48
  declare const TemplatePropsContext: React$1.Context<any>;
49
- declare const useTemplateProps: <T>() => T;
49
+ declare const useTemplateProps: <T = {
50
+ document: Record<string, any>;
51
+ relativePrefixToRoot?: string;
52
+ }>() => T;
50
53
  declare const useDocument: <T>() => T;
51
54
 
52
55
  declare const TailwindConfigContext: React$1.Context<any>;
@@ -125,6 +128,10 @@ declare const defaultThemeTailwindExtensions: {
125
128
  "4xl": string;
126
129
  };
127
130
  };
131
+ type BorderRadiusOption = {
132
+ label: string;
133
+ value: string;
134
+ };
128
135
  declare const ThemeOptions: {
129
136
  HEADING_LEVEL: {
130
137
  label: string;
@@ -155,10 +162,8 @@ declare const ThemeOptions: {
155
162
  label: MsgString;
156
163
  value: string;
157
164
  }[];
158
- BORDER_RADIUS: () => {
159
- label: string;
160
- value: string;
161
- }[];
165
+ BUTTON_BORDER_RADIUS: BorderRadiusOption[];
166
+ IMAGE_BORDER_RADIUS: BorderRadiusOption[];
162
167
  SPACING: () => {
163
168
  label: string;
164
169
  value: string;
@@ -421,7 +426,7 @@ type RootConfig = {
421
426
  };
422
427
  declare function getPageMetadata(document: Record<string, any>): RootConfig;
423
428
 
424
- declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, latitude, longitude, radiusMi, limit, }: {
429
+ declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, latitude, longitude, radiusMi, limit, locale, currentLocationId, }: {
425
430
  businessId: string;
426
431
  apiKey: string;
427
432
  contentEndpointId: string;
@@ -430,6 +435,8 @@ declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, co
430
435
  latitude: number;
431
436
  radiusMi: number;
432
437
  limit: number;
438
+ locale: string;
439
+ currentLocationId: string;
433
440
  }) => Promise<Record<string, any>>;
434
441
 
435
442
  declare const fetchLocalesToPathsForEntity: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, entityId, }: {
@@ -498,6 +505,13 @@ declare function withPropOverrides<P extends DefaultComponentProps>(base: Compon
498
505
 
499
506
  declare const i18nComponentsInstance: i18next.i18n;
500
507
 
508
+ interface LocationDocument extends Record<string, any> {
509
+ slug?: string;
510
+ id: string;
511
+ address?: AddressType;
512
+ }
513
+ declare const getLocationPath: (location: LocationDocument, locale: string, relativePrefixToRoot: string | undefined) => string | undefined;
514
+
501
515
  type TranslatableCTA = Omit<CTA$1, "label"> & {
502
516
  label: TranslatableString;
503
517
  };
@@ -678,8 +692,6 @@ declare const OptionalNumberField: ({ fieldLabel, hideNumberFieldRadioLabel, sho
678
692
 
679
693
  declare const FontSizeSelector: (label?: string, includeLargeSizes?: boolean) => Field;
680
694
 
681
- declare const BorderRadiusSelector: (label?: string) => Field;
682
-
683
695
  declare const SpacingSelector: (label: string, spacingType: "padding" | "gap", includeDefault: boolean) => Field;
684
696
 
685
697
  type BasicSelectorProps = {
@@ -905,6 +917,23 @@ declare function Timestamp({ date, option, endDate, timeZone, hideTimeZone, loca
905
917
 
906
918
  declare function Toggle({ className, ...props }: React$1.ComponentProps<typeof TogglePrimitive.Root>): react_jsx_runtime.JSX.Element;
907
919
 
920
+ type AggregateRating = {
921
+ averageRating: number;
922
+ reviewCount: number;
923
+ };
924
+ type ReviewStarsProps = {
925
+ averageRating: number;
926
+ hasDarkBackground: boolean;
927
+ reviewCount?: number;
928
+ };
929
+ declare const ReviewStars: (props: ReviewStarsProps) => react_jsx_runtime.JSX.Element;
930
+ /**
931
+ * Extracts the aggregate rating from the document's schema.
932
+ * @param document - The document containing the schema.
933
+ * @returns The aggregate rating object if found, otherwise undefined.
934
+ */
935
+ declare function getAggregateRating(document: any): AggregateRating;
936
+
908
937
  type BannerSectionProps = {
909
938
  styles: {
910
939
  backgroundColor?: BackgroundStyle;
@@ -1010,6 +1039,7 @@ interface HeroSectionProps {
1010
1039
  localGeoModifier: YextEntityField<TranslatableString>;
1011
1040
  hours: YextEntityField<HoursType>;
1012
1041
  hero: YextStructEntityField<HeroSectionType>;
1042
+ showAverageReview: boolean;
1013
1043
  };
1014
1044
  styles: {
1015
1045
  backgroundColor?: BackgroundStyle;
@@ -1164,6 +1194,14 @@ interface FAQSectionProps {
1164
1194
  }
1165
1195
  declare const FAQSection: ComponentConfig<FAQSectionProps>;
1166
1196
 
1197
+ type ReviewsSectionProps = {
1198
+ backgroundColor: BackgroundStyle;
1199
+ analytics?: {
1200
+ scope?: string;
1201
+ };
1202
+ };
1203
+ declare const ReviewsSection: ComponentConfig<ReviewsSectionProps>;
1204
+
1167
1205
  interface TestimonialSectionProps {
1168
1206
  data: {
1169
1207
  heading: YextEntityField<TranslatableString>;
@@ -1208,9 +1246,9 @@ interface TeamSectionProps {
1208
1246
  declare const TeamSection: ComponentConfig<TeamSectionProps>;
1209
1247
 
1210
1248
  declare const layoutVariants: (props?: ({
1211
- gap?: "0" | "1" | "2" | "3" | "4" | "none" | "6" | "8" | "12" | "16" | "24" | "14" | "20" | "0.5" | "1.5" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1212
- verticalPadding?: "0" | "1" | "2" | "3" | "4" | "default" | "none" | "6" | "8" | "12" | "16" | "24" | "14" | "20" | "0.5" | "1.5" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1213
- horizontalPadding?: "0" | "1" | "2" | "3" | "4" | "none" | "6" | "8" | "12" | "16" | "24" | "14" | "20" | "0.5" | "1.5" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1249
+ gap?: "0" | "1" | "2" | "3" | "4" | "none" | "12" | "14" | "16" | "20" | "24" | "0.5" | "1.5" | "6" | "8" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1250
+ verticalPadding?: "0" | "1" | "2" | "3" | "4" | "default" | "none" | "12" | "14" | "16" | "20" | "24" | "0.5" | "1.5" | "6" | "8" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1251
+ horizontalPadding?: "0" | "1" | "2" | "3" | "4" | "none" | "12" | "14" | "16" | "20" | "24" | "0.5" | "1.5" | "6" | "8" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
1214
1252
  columnFormatting?: "default" | "none" | "forceHorizontal" | null | undefined;
1215
1253
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
1216
1254
  interface layoutProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof layoutVariants> {
@@ -1330,7 +1368,9 @@ interface ExpandedHeaderProps {
1330
1368
  logo: string;
1331
1369
  links: TranslatableCTA[];
1332
1370
  primaryCTA?: TranslatableCTA;
1371
+ showPrimaryCTA: boolean;
1333
1372
  secondaryCTA?: TranslatableCTA;
1373
+ showSecondaryCTA: boolean;
1334
1374
  };
1335
1375
  secondaryHeader: {
1336
1376
  show: boolean;
@@ -1400,12 +1440,13 @@ interface ExpandedFooterProps {
1400
1440
  data: {
1401
1441
  primaryFooter: {
1402
1442
  logo: string;
1403
- xLink: string;
1404
1443
  facebookLink: string;
1405
1444
  instagramLink: string;
1406
- pinterestLink: string;
1407
1445
  linkedInLink: string;
1446
+ pinterestLink: string;
1447
+ tiktokLink: string;
1408
1448
  youtubeLink: string;
1449
+ xLink: string;
1409
1450
  utilityImages: {
1410
1451
  url: string;
1411
1452
  linkTarget?: string;
@@ -1452,6 +1493,7 @@ interface PageSectionCategoryProps {
1452
1493
  PhotoGallerySection: PhotoGallerySectionProps;
1453
1494
  ProductSection: ProductSectionProps;
1454
1495
  PromoSection: PromoSectionProps;
1496
+ ReviewsSection: ReviewsSectionProps;
1455
1497
  StaticMapSection: StaticMapSectionProps;
1456
1498
  TeamSection: TeamSectionProps;
1457
1499
  TestimonialSection: TestimonialSectionProps;
@@ -1468,6 +1510,7 @@ declare const PageSectionCategoryComponents: {
1468
1510
  PhotoGallerySection: _measured_puck.ComponentConfig<PhotoGallerySectionProps>;
1469
1511
  ProductSection: _measured_puck.ComponentConfig<ProductSectionProps>;
1470
1512
  PromoSection: _measured_puck.ComponentConfig<PromoSectionProps>;
1513
+ ReviewsSection: _measured_puck.ComponentConfig<ReviewsSectionProps>;
1471
1514
  StaticMapSection: _measured_puck.ComponentConfig<StaticMapSectionProps>;
1472
1515
  TeamSection: _measured_puck.ComponentConfig<TeamSectionProps>;
1473
1516
  TestimonialSection: _measured_puck.ComponentConfig<TestimonialSectionProps>;
@@ -1545,14 +1588,6 @@ declare const ContentBlockCategoryComponents: {
1545
1588
  };
1546
1589
  declare const ContentBlockCategory: (keyof ContentBlockCategoryProps)[];
1547
1590
 
1548
- type ReviewsSectionProps = {
1549
- backgroundColor: BackgroundStyle;
1550
- analytics?: {
1551
- scope?: string;
1552
- };
1553
- };
1554
- declare const ReviewsSection: ComponentConfig<ReviewsSectionProps>;
1555
-
1556
1591
  type SectionContainerProps = {
1557
1592
  background?: BackgroundStyle;
1558
1593
  sectionHeading: {
@@ -1570,4 +1605,4 @@ declare const addHeadingAlignmentMigration: Migration;
1570
1605
 
1571
1606
  declare const defaultThemeConfig: ThemeConfig;
1572
1607
 
1573
- export { Address, type AddressProps, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BorderRadiusSelector, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, DeprecatedCategory, DeprecatedCategoryComponents, type DeprecatedCategoryProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExpandedHeader, type ExpandedHeaderProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, type GalleryImageType, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, HoursStatusAtom, type HoursStatusAtomProps, type HoursStatusProps, HoursTable, HoursTableAtom, type HoursTableAtomProps, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, KnowledgeGraphIcon, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, LocatorCategory, LocatorCategoryComponents, type LocatorCategoryProps, LocatorComponent, type LocatorProps, MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, MaybeRTF, type MaybeRTFProps, type Migration, type MigrationAction, type MigrationRegistry, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RenderYextEntityFieldSelectorProps, ReviewsSection, type ReviewsSectionProps, type RichText, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, Toggle, type TranslatableCTA, type TranslatableRichText, TranslatableRichTextField, type TranslatableString, TranslatableStringField, VisibilityWrapper, VisualEditorProvider, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, addHeadingAlignmentMigration, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchLocalesToPathsForEntity, fetchNearbyLocations, fetchReviewsForEntity, getAnalyticsScopeHash, getFontWeightOptions, getFontWeightOverrideOptions, getPageMetadata, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, msg, normalizeSlug, pt, resolveTranslatableRichText, resolveTranslatableString, resolveYextEntityField, resolveYextStructField, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
1608
+ export { Address, type AddressProps, type AggregateRating, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, DeprecatedCategory, DeprecatedCategoryComponents, type DeprecatedCategoryProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExpandedHeader, type ExpandedHeaderProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, type GalleryImageType, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, HoursStatusAtom, type HoursStatusAtomProps, type HoursStatusProps, HoursTable, HoursTableAtom, type HoursTableAtomProps, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, KnowledgeGraphIcon, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, LocatorCategory, LocatorCategoryComponents, type LocatorCategoryProps, LocatorComponent, type LocatorProps, MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, MaybeRTF, type MaybeRTFProps, type Migration, type MigrationAction, type MigrationRegistry, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RenderYextEntityFieldSelectorProps, ReviewStars, type ReviewStarsProps, ReviewsSection, type ReviewsSectionProps, type RichText, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, Toggle, type TranslatableCTA, type TranslatableRichText, TranslatableRichTextField, type TranslatableString, TranslatableStringField, VisibilityWrapper, VisualEditorProvider, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, addHeadingAlignmentMigration, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchLocalesToPathsForEntity, fetchNearbyLocations, fetchReviewsForEntity, getAggregateRating, getAnalyticsScopeHash, getFontWeightOptions, getFontWeightOverrideOptions, getLocationPath, getPageMetadata, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, msg, normalizeSlug, pt, resolveTranslatableRichText, resolveTranslatableString, resolveYextEntityField, resolveYextStructField, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
@@ -1,4 +1,4 @@
1
- import { r as b, n as l, e as w, a as k, l as S } from "./index-BAnL5AMG.js";
1
+ import { r as b, n as l, e as w, a as k, l as S } from "./index-DsJ02qpe.js";
2
2
  function P() {
3
3
  return S().name !== "browser" || window.hasOwnProperty("debuggerInitialized") ? null : (window.debuggerInitialized = !0, k.createPortal(/* @__PURE__ */ l.jsx($, {}), document.body));
4
4
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-DvewYwma.cjs");function N(){return n.la().name!=="browser"||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,n.reactDomExports.createPortal(n.nt.jsx(j,{}),document.body))}const k=(e,a)=>{const s=e.dataset.yaAction,t=e.dataset.yaScopeoverride,o=e.dataset.yaEventname,i=t||a;return{action:s,originalEventName:i?`${i}_${o}`:o,scope:i}},S=(e,a)=>{const s=[];let t=e;for(;t!=null&&t.parentElement;)t=t.parentElement.closest(a),t&&s.push(t);return s},v={},w="YA_NO_SCOPE",y=(e,a,s,t)=>{v.hasOwnProperty(e)?v[e].events.map(o=>o.el).includes(t)||(v[e].events=[...v[e].events,{eventData:a,el:t}]):v[e]={scopeEl:s||t,events:[{eventData:a,el:t}]}};function j(){const[e,a]=n.reactExports.useState(),[s,t]=n.reactExports.useState([]),[o,i]=n.reactExports.useState(!1),l=r=>{a(e===r?void 0:r)};return n.reactExports.useEffect(()=>{let r=null;const d=()=>{r&&r.abort(),r=new AbortController;const c=r.signal;document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-eventname]").forEach((u,E)=>{const m=u.closest("[data-ya-scope]"),h=m?.dataset.yaScope,p=k(u,h);u.addEventListener("mouseenter",()=>{t([{elem:u,key:`${p.originalEventName}_${E}`,action:p.action,originalEventName:p.originalEventName,scope:p.scope}])},{signal:c}),u.addEventListener("mouseleave",()=>{t([])},{signal:c});const x=u.dataset.yaScopeoverride;x?y(x,p,m,u):[h,...S(u,"[data-ya-scope]").map(b=>b.dataset.yaScope)].forEach(b=>{y(b||w,p,m,u)})}),i(!0)};d();const g=new MutationObserver(d);return g.observe(document,{childList:!0,subtree:!0}),()=>{document.documentElement.classList.remove("xYextDebug"),g.disconnect(),r?.abort()}},[]),o?n.nt.jsxs(n.nt.Fragment,{children:[n.nt.jsxs("div",{className:"analytics-debugger",children:[n.nt.jsxs("div",{className:"analytics-debugger-toggles",children:[n.nt.jsx("button",{className:n.el("analytics-debugger-toggle",{"is-active":e==="Events"}),onClick:()=>l("Events"),children:"Events"}),n.nt.jsx("button",{className:n.el("analytics-debugger-toggle",{"is-active":e==="Scopes"}),onClick:()=>l("Scopes"),children:"Scopes"})]}),e&&n.nt.jsx("div",{className:"analytics-debugger-tabs",children:e==="Events"?n.nt.jsx(C,{data:v,setTooltips:t}):n.nt.jsx($,{data:v,setTooltips:t})})]}),n.nt.jsx(D,{tooltips:s})]}):null}const Y=()=>{const e={};return Object.values(v).forEach(a=>{a.events.forEach(s=>{const{originalEventName:t}=s.eventData;e[t]||(e[t]=[]),!e[t].find(o=>o.el===s.el)&&e[t].push(s)})}),e};function C(e){const{setTooltips:a}=e,[s,t]=n.reactExports.useState([]),[o,i]=n.reactExports.useState(""),l=(r,d)=>{s.forEach(c=>c.classList.remove("analytics-event-highlight"));const g=r.map(c=>(c.el.scrollIntoView({behavior:"smooth",block:"nearest"}),c.el.classList.add("analytics-event-highlight"),c.el));t(g),i(d),a(r.map((c,u)=>({elem:c.el,key:`${c.eventData.originalEventName}_${u}`,action:c.eventData.action,originalEventName:c.eventData.originalEventName,scope:c.eventData.scope})))};return n.nt.jsxs("div",{className:"analytics-debugger-tab",children:[n.nt.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),n.nt.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(Y()).map(([r,d],g)=>{const c=`${r}_${g}`;return n.nt.jsx("li",{className:"analytics-debugger-listItem",children:n.nt.jsx("button",{className:n.el("analytics-debugger-button",{"is-active":c===o}),onClick:()=>l(d,c),children:r})},c)})})]})}function $(e){const{data:a,setTooltips:s}=e,[t,o]=n.reactExports.useState(""),i=l=>{const r=a[l];r.scopeEl&&(r.scopeEl.scrollIntoView({behavior:"smooth",block:"nearest"}),o(l),s(r.events.map((d,g)=>{const c=d.eventData;return{elem:d.el,key:`${c.originalEventName}_${g}`,action:c.action,originalEventName:c.originalEventName,scope:c.scope}})))};return n.nt.jsxs("div",{className:"analytics-debugger-tab",children:[n.nt.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),n.nt.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(a).map((l,r)=>{if(l!==w)return n.nt.jsx("li",{className:"analytics-debugger-listItem",children:n.nt.jsx("button",{className:n.el("analytics-debugger-button",{"is-active":l===t}),onClick:()=>i(l),children:l})},l+r)})})]})}function D(e){const a=n.reactExports.useRef({});return n.reactExports.useEffect(()=>{if(a.current)for(const s of Object.values(a.current)){const t=Object.values(a.current).map(o=>o.el).filter(o=>o!==s.el);O(s,t),s.el.style.visibility="visible"}},[e.tooltips]),n.nt.jsx(n.nt.Fragment,{children:e.tooltips.map(s=>n.nt.jsxs("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:t=>{t?a.current[s.key]={el:t,tooltip:s}:delete a.current[s.key]},children:[n.nt.jsxs("span",{children:["Action: ",s.action]}),n.nt.jsx("br",{}),n.nt.jsxs("span",{children:["Scope: ",s.scope]}),n.nt.jsx("br",{}),n.nt.jsxs("span",{children:["Original Event Name: ",s.originalEventName]})]},s.key))})}function O(e,a){for(let s=0;s<9;s++){const t=I(e.tooltip.elem.getBoundingClientRect(),e.el,s);if(e.el.style.inset=`${t.top} auto auto ${t.left}`,!!B(e.el.getBoundingClientRect().left,e.el.getBoundingClientRect().top+window.scrollY,e.el.getBoundingClientRect().right,e.el.getBoundingClientRect().bottom+window.scrollY))continue;let o=!0;for(let i=0;i<a.length;i++){const l=a[i];R(e.el,l)&&(o=!1)}if(o)break}}function R(e,a){const s=e.getBoundingClientRect().top+window.scrollY,t=e.getBoundingClientRect().left,o=s+e.clientHeight,i=t+e.clientWidth,l=a.getBoundingClientRect().top+window.scrollY,r=a.getBoundingClientRect().left,d=l+a.clientHeight,g=r+a.clientWidth,c=(u,E,m,h,p,x,b,f)=>m<=p&&p<=b&&h<=x&&x<=f||m<=u&&u<=b&&h<=E&&E<=f||m<=u&&u<=b&&h<=x&&x<=f||m<=p&&p<=b&&h<=E&&E<=f;return c(t,s,r,l,i,o,g,d)||c(r,l,t,s,g,d,i,o)}function B(e,a,s,t){return e<0||s>window.innerWidth||a<0||t>document.documentElement.scrollHeight}function I(e,a,s){const t=a.clientHeight,o=a.clientWidth;let i,l;switch(s){case 0:{l=window.scrollY+e.top-t+"px",i=e.left-o+"px";break}case 1:{l=window.scrollY+e.top-t+"px",i=e.left+"px";break}case 2:{l=window.scrollY+e.top-t+"px",i=e.right+"px";break}case 3:{l=window.scrollY+e.top-t+"px",i=e.right-o+"px";break}case 4:{l=window.scrollY+e.bottom+"px",i=e.left-o+"px";break}case 5:{l=window.scrollY+e.bottom+"px",i=e.left+"px";break}case 6:{l=window.scrollY+e.bottom+"px",i=e.right-o+"px";break}case 7:{l=window.scrollY+e.bottom+"px",i=e.right+"px";break}default:l=0,i=0}return{top:l,left:i}}exports.AnalyticsDebuggerInternal=j;exports.default=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-DGoKf32S.cjs");function N(){return n.la().name!=="browser"||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,n.reactDomExports.createPortal(n.nt.jsx(j,{}),document.body))}const k=(e,a)=>{const s=e.dataset.yaAction,t=e.dataset.yaScopeoverride,o=e.dataset.yaEventname,i=t||a;return{action:s,originalEventName:i?`${i}_${o}`:o,scope:i}},S=(e,a)=>{const s=[];let t=e;for(;t!=null&&t.parentElement;)t=t.parentElement.closest(a),t&&s.push(t);return s},v={},w="YA_NO_SCOPE",y=(e,a,s,t)=>{v.hasOwnProperty(e)?v[e].events.map(o=>o.el).includes(t)||(v[e].events=[...v[e].events,{eventData:a,el:t}]):v[e]={scopeEl:s||t,events:[{eventData:a,el:t}]}};function j(){const[e,a]=n.reactExports.useState(),[s,t]=n.reactExports.useState([]),[o,i]=n.reactExports.useState(!1),l=r=>{a(e===r?void 0:r)};return n.reactExports.useEffect(()=>{let r=null;const d=()=>{r&&r.abort(),r=new AbortController;const c=r.signal;document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-eventname]").forEach((u,E)=>{const m=u.closest("[data-ya-scope]"),h=m?.dataset.yaScope,p=k(u,h);u.addEventListener("mouseenter",()=>{t([{elem:u,key:`${p.originalEventName}_${E}`,action:p.action,originalEventName:p.originalEventName,scope:p.scope}])},{signal:c}),u.addEventListener("mouseleave",()=>{t([])},{signal:c});const x=u.dataset.yaScopeoverride;x?y(x,p,m,u):[h,...S(u,"[data-ya-scope]").map(b=>b.dataset.yaScope)].forEach(b=>{y(b||w,p,m,u)})}),i(!0)};d();const g=new MutationObserver(d);return g.observe(document,{childList:!0,subtree:!0}),()=>{document.documentElement.classList.remove("xYextDebug"),g.disconnect(),r?.abort()}},[]),o?n.nt.jsxs(n.nt.Fragment,{children:[n.nt.jsxs("div",{className:"analytics-debugger",children:[n.nt.jsxs("div",{className:"analytics-debugger-toggles",children:[n.nt.jsx("button",{className:n.el("analytics-debugger-toggle",{"is-active":e==="Events"}),onClick:()=>l("Events"),children:"Events"}),n.nt.jsx("button",{className:n.el("analytics-debugger-toggle",{"is-active":e==="Scopes"}),onClick:()=>l("Scopes"),children:"Scopes"})]}),e&&n.nt.jsx("div",{className:"analytics-debugger-tabs",children:e==="Events"?n.nt.jsx(C,{data:v,setTooltips:t}):n.nt.jsx($,{data:v,setTooltips:t})})]}),n.nt.jsx(D,{tooltips:s})]}):null}const Y=()=>{const e={};return Object.values(v).forEach(a=>{a.events.forEach(s=>{const{originalEventName:t}=s.eventData;e[t]||(e[t]=[]),!e[t].find(o=>o.el===s.el)&&e[t].push(s)})}),e};function C(e){const{setTooltips:a}=e,[s,t]=n.reactExports.useState([]),[o,i]=n.reactExports.useState(""),l=(r,d)=>{s.forEach(c=>c.classList.remove("analytics-event-highlight"));const g=r.map(c=>(c.el.scrollIntoView({behavior:"smooth",block:"nearest"}),c.el.classList.add("analytics-event-highlight"),c.el));t(g),i(d),a(r.map((c,u)=>({elem:c.el,key:`${c.eventData.originalEventName}_${u}`,action:c.eventData.action,originalEventName:c.eventData.originalEventName,scope:c.eventData.scope})))};return n.nt.jsxs("div",{className:"analytics-debugger-tab",children:[n.nt.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),n.nt.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(Y()).map(([r,d],g)=>{const c=`${r}_${g}`;return n.nt.jsx("li",{className:"analytics-debugger-listItem",children:n.nt.jsx("button",{className:n.el("analytics-debugger-button",{"is-active":c===o}),onClick:()=>l(d,c),children:r})},c)})})]})}function $(e){const{data:a,setTooltips:s}=e,[t,o]=n.reactExports.useState(""),i=l=>{const r=a[l];r.scopeEl&&(r.scopeEl.scrollIntoView({behavior:"smooth",block:"nearest"}),o(l),s(r.events.map((d,g)=>{const c=d.eventData;return{elem:d.el,key:`${c.originalEventName}_${g}`,action:c.action,originalEventName:c.originalEventName,scope:c.scope}})))};return n.nt.jsxs("div",{className:"analytics-debugger-tab",children:[n.nt.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),n.nt.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(a).map((l,r)=>{if(l!==w)return n.nt.jsx("li",{className:"analytics-debugger-listItem",children:n.nt.jsx("button",{className:n.el("analytics-debugger-button",{"is-active":l===t}),onClick:()=>i(l),children:l})},l+r)})})]})}function D(e){const a=n.reactExports.useRef({});return n.reactExports.useEffect(()=>{if(a.current)for(const s of Object.values(a.current)){const t=Object.values(a.current).map(o=>o.el).filter(o=>o!==s.el);O(s,t),s.el.style.visibility="visible"}},[e.tooltips]),n.nt.jsx(n.nt.Fragment,{children:e.tooltips.map(s=>n.nt.jsxs("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:t=>{t?a.current[s.key]={el:t,tooltip:s}:delete a.current[s.key]},children:[n.nt.jsxs("span",{children:["Action: ",s.action]}),n.nt.jsx("br",{}),n.nt.jsxs("span",{children:["Scope: ",s.scope]}),n.nt.jsx("br",{}),n.nt.jsxs("span",{children:["Original Event Name: ",s.originalEventName]})]},s.key))})}function O(e,a){for(let s=0;s<9;s++){const t=I(e.tooltip.elem.getBoundingClientRect(),e.el,s);if(e.el.style.inset=`${t.top} auto auto ${t.left}`,!!B(e.el.getBoundingClientRect().left,e.el.getBoundingClientRect().top+window.scrollY,e.el.getBoundingClientRect().right,e.el.getBoundingClientRect().bottom+window.scrollY))continue;let o=!0;for(let i=0;i<a.length;i++){const l=a[i];R(e.el,l)&&(o=!1)}if(o)break}}function R(e,a){const s=e.getBoundingClientRect().top+window.scrollY,t=e.getBoundingClientRect().left,o=s+e.clientHeight,i=t+e.clientWidth,l=a.getBoundingClientRect().top+window.scrollY,r=a.getBoundingClientRect().left,d=l+a.clientHeight,g=r+a.clientWidth,c=(u,E,m,h,p,x,b,f)=>m<=p&&p<=b&&h<=x&&x<=f||m<=u&&u<=b&&h<=E&&E<=f||m<=u&&u<=b&&h<=x&&x<=f||m<=p&&p<=b&&h<=E&&E<=f;return c(t,s,r,l,i,o,g,d)||c(r,l,t,s,g,d,i,o)}function B(e,a,s,t){return e<0||s>window.innerWidth||a<0||t>document.documentElement.scrollHeight}function I(e,a,s){const t=a.clientHeight,o=a.clientWidth;let i,l;switch(s){case 0:{l=window.scrollY+e.top-t+"px",i=e.left-o+"px";break}case 1:{l=window.scrollY+e.top-t+"px",i=e.left+"px";break}case 2:{l=window.scrollY+e.top-t+"px",i=e.right+"px";break}case 3:{l=window.scrollY+e.top-t+"px",i=e.right-o+"px";break}case 4:{l=window.scrollY+e.bottom+"px",i=e.left-o+"px";break}case 5:{l=window.scrollY+e.bottom+"px",i=e.left+"px";break}case 6:{l=window.scrollY+e.bottom+"px",i=e.right-o+"px";break}case 7:{l=window.scrollY+e.bottom+"px",i=e.right+"px";break}default:l=0,i=0}return{top:l,left:i}}exports.AnalyticsDebuggerInternal=j;exports.default=N;