@planningcenter/topbar 12.4.0 → 12.4.1-qa-959.0

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/topbar.js CHANGED
@@ -7,16 +7,18 @@ var general = require('@planningcenter/icons/paths/general');
7
7
  var Jolt = require('@planningcenter/jolt-client');
8
8
  var shim = require('use-sync-external-store/shim');
9
9
  require('react/jsx-runtime');
10
+ var toolbar = require('@planningcenter/icons/paths/toolbar');
11
+ var datetimeFmt = require('@planningcenter/datetime-fmt');
12
+ var pluralize = require('pluralize');
13
+ var logomarks = require('@planningcenter/icons/paths/logomark');
10
14
  var tapestryReact = require('@planningcenter/tapestry-react');
11
15
  var addOns = require('@planningcenter/add-ons');
12
16
  var churchCenter = require('@planningcenter/icons/paths/church-center');
13
17
  var people = require('@planningcenter/icons/paths/people');
14
- var toolbar = require('@planningcenter/icons/paths/toolbar');
15
18
  var reactCalendly = require('react-calendly');
16
19
  var algoliasearch = require('algoliasearch');
17
20
  var reactInstantsearchCore = require('react-instantsearch-core');
18
21
  var reactTransitionGroup = require('react-transition-group');
19
- var datetimeFmt = require('@planningcenter/datetime-fmt');
20
22
 
21
23
  function _interopNamespaceDefault(e) {
22
24
  var n = Object.create(null);
@@ -37,11 +39,12 @@ function _interopNamespaceDefault(e) {
37
39
 
38
40
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
39
41
  var general__namespace = /*#__PURE__*/_interopNamespaceDefault(general);
42
+ var toolbar__namespace = /*#__PURE__*/_interopNamespaceDefault(toolbar);
43
+ var logomarks__namespace = /*#__PURE__*/_interopNamespaceDefault(logomarks);
40
44
  var churchCenter__namespace = /*#__PURE__*/_interopNamespaceDefault(churchCenter);
41
45
  var people__namespace = /*#__PURE__*/_interopNamespaceDefault(people);
42
- var toolbar__namespace = /*#__PURE__*/_interopNamespaceDefault(toolbar);
43
46
 
44
- var styles$m = {"accessibility-toolbar":"accessibility-toolbar-jgjUG"};
47
+ var styles$u = {"accessibility-toolbar":"accessibility-toolbar-jgjUG"};
45
48
 
46
49
  const AccessibilityToolbar = ({
47
50
  children
@@ -53,7 +56,7 @@ const AccessibilityToolbar = ({
53
56
  (_a = document.getElementById("main-content")) === null || _a === void 0 ? void 0 : _a.focus();
54
57
  };
55
58
  return /*#__PURE__*/React.createElement("div", {
56
- className: styles$m["accessibility-toolbar"]
59
+ className: styles$u["accessibility-toolbar"]
57
60
  }, /*#__PURE__*/React.createElement(tapestry.Link, {
58
61
  href: "#main-content",
59
62
  kind: "primary",
@@ -372,11 +375,11 @@ const X = ({
372
375
  fill: fill
373
376
  })));
374
377
 
375
- var styles$l = {"announcement":"announcement-pI5tM","announcement--platform":"announcement--platform-EcUn2","announcement--promo":"announcement--promo-FarUk","announcement-icon":"announcement-icon-Ov39-","announcement-content":"announcement-content-q2ad6","dismiss":"dismiss-wUAoU","dismiss--promo":"dismiss--promo-7zvO4"};
378
+ var styles$t = {"announcement":"announcement-pI5tM","announcement--platform":"announcement--platform-EcUn2","announcement--promo":"announcement--promo-FarUk","announcement-icon":"announcement-icon-Ov39-","announcement-content":"announcement-content-q2ad6","dismiss":"dismiss-wUAoU","dismiss--promo":"dismiss--promo-7zvO4"};
376
379
 
377
380
  function AnnouncementIcon() {
378
381
  return /*#__PURE__*/React.createElement("svg", {
379
- className: styles$l["announcement-icon"],
382
+ className: styles$t["announcement-icon"],
380
383
  width: "16",
381
384
  height: "16",
382
385
  viewBox: "0 0 16 16",
@@ -501,7 +504,7 @@ let StyledAnnouncement$1 = class StyledAnnouncement extends React.Component {
501
504
  } = this.props;
502
505
  const isPromo = variant === "promo";
503
506
  return /*#__PURE__*/React.createElement("div", {
504
- className: classnames(styles$l["announcement"], styles$l[`announcement--${variant !== null && variant !== void 0 ? variant : "platform"}`]),
507
+ className: classnames(styles$t["announcement"], styles$t[`announcement--${variant !== null && variant !== void 0 ? variant : "platform"}`]),
505
508
  "data-announcement-variant": variant !== null && variant !== void 0 ? variant : "platform",
506
509
  style: isPromo ? {
507
510
  backgroundImage: promoBackgroundUrl,
@@ -510,7 +513,7 @@ let StyledAnnouncement$1 = class StyledAnnouncement extends React.Component {
510
513
  backgroundSize: "cover"
511
514
  } : undefined
512
515
  }, !isPromo && /*#__PURE__*/React.createElement(AnnouncementIcon, null), /*#__PURE__*/React.createElement("div", {
513
- className: styles$l["announcement-content"],
516
+ className: styles$t["announcement-content"],
514
517
  style: style,
515
518
  ...platformProps
516
519
  }));
@@ -559,7 +562,7 @@ function StyledDismissButton$1({
559
562
  const isPromo = variant === "promo";
560
563
  return /*#__PURE__*/React.createElement("button", {
561
564
  type: "button",
562
- className: classnames(styles$l.dismiss, isPromo && styles$l["dismiss--promo"]),
565
+ className: classnames(styles$t.dismiss, isPromo && styles$t["dismiss--promo"]),
563
566
  ...props
564
567
  }, /*#__PURE__*/React.createElement(X, {
565
568
  fill: isPromo ? "currentColor" : "white",
@@ -639,9 +642,9 @@ class StyledAnnouncement extends React.Component {
639
642
  ...platformProps
640
643
  } = this.props;
641
644
  return /*#__PURE__*/React.createElement("div", {
642
- className: styles$l["announcement"]
645
+ className: styles$t["announcement"]
643
646
  }, /*#__PURE__*/React.createElement(AnnouncementIcon, null), /*#__PURE__*/React.createElement("div", {
644
- className: styles$l["announcement-content"],
647
+ className: styles$t["announcement-content"],
645
648
  style: style,
646
649
  ...platformProps
647
650
  }));
@@ -652,7 +655,7 @@ function StyledDismissButton({
652
655
  }) {
653
656
  return /*#__PURE__*/React.createElement("button", {
654
657
  type: "button",
655
- className: styles$l.dismiss,
658
+ className: styles$t.dismiss,
656
659
  ...props
657
660
  }, /*#__PURE__*/React.createElement(X, {
658
661
  fill: "white",
@@ -1774,7 +1777,7 @@ function MonoAppIcon({
1774
1777
  })) : (/*#__PURE__*/React.createElement("div", null, "appName not supported")));
1775
1778
  }
1776
1779
 
1777
- var styles$k = {"icon-slot":"icon-slot-m3ZIk","name":"name-UNqbW"};
1780
+ var styles$s = {"icon-slot":"icon-slot-m3ZIk","name":"name-UNqbW"};
1778
1781
 
1779
1782
  const AppRow = ({
1780
1783
  appName,
@@ -1783,24 +1786,24 @@ const AppRow = ({
1783
1786
  }) => {
1784
1787
  if (appName === "Accounts") {
1785
1788
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
1786
- className: styles$k["icon-slot"]
1789
+ className: styles$s["icon-slot"]
1787
1790
  }, /*#__PURE__*/React.createElement(MonoAppIcon, {
1788
1791
  appName: "Accounts",
1789
1792
  colors: colors,
1790
1793
  size: iconSize
1791
1794
  })), /*#__PURE__*/React.createElement("span", {
1792
- className: styles$k.name
1795
+ className: styles$s.name
1793
1796
  }, "Account settings"));
1794
1797
  }
1795
1798
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorAppIcon, {
1796
1799
  appName: appName.replace(/[\s-]/, ""),
1797
1800
  size: iconSize
1798
1801
  }), /*#__PURE__*/React.createElement("span", {
1799
- className: styles$k.name
1802
+ className: styles$s.name
1800
1803
  }, appName));
1801
1804
  };
1802
1805
 
1803
- var styles$j = {"button":"button-XMbeQ","label":"label-884of","chevron":"chevron-RRg9k"};
1806
+ var styles$r = {"button":"button-XMbeQ","label":"label-884of","chevron":"chevron-RRg9k"};
1804
1807
 
1805
1808
  const AppsButton = /*#__PURE__*/React.forwardRef(({
1806
1809
  appName,
@@ -1812,10 +1815,10 @@ const AppsButton = /*#__PURE__*/React.forwardRef(({
1812
1815
  ...restProps,
1813
1816
  ref: ref,
1814
1817
  "aria-label": `App switcher: ${appName}`,
1815
- className: styles$j.button,
1818
+ className: styles$r.button,
1816
1819
  kind: "neutral-inline",
1817
1820
  label: /*#__PURE__*/React.createElement("span", {
1818
- className: styles$j.label
1821
+ className: styles$r.label
1819
1822
  }, isAccounts ? "Account settings" : appName),
1820
1823
  prefix: isAccounts ? (/*#__PURE__*/React.createElement(MonoAppIcon, {
1821
1824
  appName: "Accounts",
@@ -1826,13 +1829,13 @@ const AppsButton = /*#__PURE__*/React.forwardRef(({
1826
1829
  size: 22
1827
1830
  })),
1828
1831
  suffix: /*#__PURE__*/React.createElement(DisclosureChevronIcon, {
1829
- className: `${styles$j.chevron} symbol`
1832
+ className: `${styles$r.chevron} symbol`
1830
1833
  })
1831
1834
  });
1832
1835
  });
1833
1836
  AppsButton.displayName = "AppsButton";
1834
1837
 
1835
- var styles$i = {"nav":"nav-y-6ML","popover-content":"popover-content-jOAAY","list":"list-jUxvp","link":"link-LMp2h","current":"current-4U4VL","accounts-item":"accounts-item-erJW0","accounts-link":"accounts-link-4jwPW"};
1838
+ var styles$q = {"nav":"nav-y-6ML","popover-content":"popover-content-jOAAY","list":"list-jUxvp","link":"link-LMp2h","current":"current-4U4VL","accounts-item":"accounts-item-erJW0","accounts-link":"accounts-link-4jwPW"};
1836
1839
 
1837
1840
  const AppsMenu = ({
1838
1841
  appName,
@@ -1853,8 +1856,8 @@ const AppsMenu = ({
1853
1856
  }, /*#__PURE__*/React.createElement("a", {
1854
1857
  "aria-current": isCurrent ? "page" : undefined,
1855
1858
  "aria-label": name,
1856
- className: classnames(styles$i.link, {
1857
- [styles$i.current]: isCurrent
1859
+ className: classnames(styles$q.link, {
1860
+ [styles$q.current]: isCurrent
1858
1861
  }),
1859
1862
  "data-pendo": `app-switcher--change-app--${name}`,
1860
1863
  "data-turbolinks": false,
@@ -1870,22 +1873,22 @@ const AppsMenu = ({
1870
1873
  colors: colors
1871
1874
  })), /*#__PURE__*/React.createElement(tapestry.PopoverContent, {
1872
1875
  "aria-label": "Switch app",
1873
- className: styles$i["popover-content"],
1876
+ className: styles$q["popover-content"],
1874
1877
  placement: "bottom start"
1875
1878
  }, /*#__PURE__*/React.createElement("nav", {
1876
- className: styles$i.nav,
1879
+ className: styles$q.nav,
1877
1880
  "data-pendo": "app-switcher"
1878
1881
  }, /*#__PURE__*/React.createElement("ul", {
1879
- className: styles$i.list,
1882
+ className: styles$q.list,
1880
1883
  role: "list"
1881
1884
  }, homeProduct && renderProductLink(homeProduct.name), restProducts.map(({
1882
1885
  name
1883
1886
  }) => renderProductLink(name)), accountsProduct && (/*#__PURE__*/React.createElement("li", {
1884
- className: styles$i["accounts-item"]
1887
+ className: styles$q["accounts-item"]
1885
1888
  }, /*#__PURE__*/React.createElement("a", {
1886
1889
  "aria-current": appName === accountsProduct.name ? "page" : undefined,
1887
1890
  "aria-label": "Account settings",
1888
- className: classnames(styles$i.link, styles$i["accounts-link"]),
1891
+ className: classnames(styles$q.link, styles$q["accounts-link"]),
1889
1892
  "data-pendo": "app-switcher--change-app--Accounts",
1890
1893
  "data-turbolinks": false,
1891
1894
  href: pcoUrl$1(env)("accounts") + getAppsSwitchProductPath(accountsProduct.name)
@@ -2093,7 +2096,7 @@ function MonoAppName({
2093
2096
  })) : (/*#__PURE__*/React.createElement("div", null, "appName not supported"));
2094
2097
  }
2095
2098
 
2096
- var styles$h = {"unbutton":"unbutton-lEbTR"};
2099
+ var styles$p = {"unbutton":"unbutton-lEbTR"};
2097
2100
 
2098
2101
  function Unbutton({
2099
2102
  className,
@@ -2102,7 +2105,7 @@ function Unbutton({
2102
2105
  ...nativeProps
2103
2106
  }) {
2104
2107
  return /*#__PURE__*/React.createElement("button", {
2105
- className: classnames(styles$h.unbutton, className),
2108
+ className: classnames(styles$p.unbutton, className),
2106
2109
  style: {
2107
2110
  ...style
2108
2111
  },
@@ -2111,7 +2114,7 @@ function Unbutton({
2111
2114
  });
2112
2115
  }
2113
2116
 
2114
- var styles$g = {"button":"button-wsipc","button-accounts":"button-accounts-zQmBM","chevron":"chevron-obyBF","is-expanded":"is-expanded-PoCQ9"};
2117
+ var styles$o = {"button":"button-wsipc","button-accounts":"button-accounts-zQmBM","chevron":"chevron-obyBF","is-expanded":"is-expanded-PoCQ9"};
2115
2118
 
2116
2119
  const LegacyAppsButton = ({
2117
2120
  appName,
@@ -2126,8 +2129,8 @@ const LegacyAppsButton = ({
2126
2129
  "aria-haspopup": "true",
2127
2130
  "aria-label": `App switcher: ${appName}`,
2128
2131
  onClick: onClick,
2129
- className: classnames(styles$g.button, {
2130
- [styles$g["is-expanded"]]: expanded
2132
+ className: classnames(styles$o.button, {
2133
+ [styles$o["is-expanded"]]: expanded
2131
2134
  }),
2132
2135
  type: "button",
2133
2136
  style: style,
@@ -2136,7 +2139,7 @@ const LegacyAppsButton = ({
2136
2139
  appName: "Accounts",
2137
2140
  colors: colors
2138
2141
  }), /*#__PURE__*/React.createElement("div", {
2139
- className: styles$g["button-accounts"]
2142
+ className: styles$o["button-accounts"]
2140
2143
  }, "Account settings"))) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorAppIcon, {
2141
2144
  appName: appName.replace(/[\s-]/, "")
2142
2145
  }), /*#__PURE__*/React.createElement(MonoAppName, {
@@ -2144,7 +2147,7 @@ const LegacyAppsButton = ({
2144
2147
  key: "mono-app-name",
2145
2148
  size: 24
2146
2149
  }))), /*#__PURE__*/React.createElement(DisclosureChevronIcon, {
2147
- className: styles$g.chevron,
2150
+ className: styles$o.chevron,
2148
2151
  key: "disclosure-chevron-icon"
2149
2152
  }));
2150
2153
  };
@@ -2277,7 +2280,7 @@ class Outsider extends React.Component {
2277
2280
  }
2278
2281
  }
2279
2282
 
2280
- var styles$f = {"popup-root":"popup-root-SeL5u","popup":"popup-nQXYW","is-visible":"is-visible-3DAUP"};
2283
+ var styles$n = {"popup-root":"popup-root-SeL5u","popup":"popup-nQXYW","is-visible":"is-visible-3DAUP"};
2281
2284
 
2282
2285
  const Popup = ({
2283
2286
  className,
@@ -2285,8 +2288,8 @@ const Popup = ({
2285
2288
  isVisible,
2286
2289
  ...nativeProps
2287
2290
  }) => (/*#__PURE__*/React.createElement(C, {
2288
- className: classnames(styles$f.popup, {
2289
- [styles$f["is-visible"]]: isVisible
2291
+ className: classnames(styles$n.popup, {
2292
+ [styles$n["is-visible"]]: isVisible
2290
2293
  }, className),
2291
2294
  ...nativeProps
2292
2295
  }));
@@ -2294,11 +2297,11 @@ const Popup = ({
2294
2297
  const PopupRoot = ({
2295
2298
  ...nativeProps
2296
2299
  }) => (/*#__PURE__*/React.createElement("div", {
2297
- className: styles$f["popup-root"],
2300
+ className: styles$n["popup-root"],
2298
2301
  ...nativeProps
2299
2302
  }));
2300
2303
 
2301
- var styles$e = {"popup":"popup-bVhSa"};
2304
+ var styles$m = {"popup":"popup-bVhSa"};
2302
2305
 
2303
2306
  const LegacyAppsMenu = ({
2304
2307
  appName,
@@ -2336,7 +2339,7 @@ const LegacyAppsMenu = ({
2336
2339
  cleanup: !visible,
2337
2340
  component: Outsider,
2338
2341
  onOutsideClick: toggle,
2339
- className: styles$e.popup,
2342
+ className: styles$m.popup,
2340
2343
  isVisible: visible
2341
2344
  }, /*#__PURE__*/React.createElement("menu", {
2342
2345
  ref: menuRef,
@@ -3246,34 +3249,117 @@ const useUpdateStore = () => React.useCallback(updates => {
3246
3249
  });
3247
3250
  }, []);
3248
3251
 
3252
+ const collections = {
3253
+ general: general__namespace,
3254
+ toolbar: toolbar__namespace
3255
+ };
3256
+ const paths = collections;
3257
+ function Icon({
3258
+ name,
3259
+ size = 16,
3260
+ style,
3261
+ theme,
3262
+ title,
3263
+ ...props
3264
+ }) {
3265
+ const [collection, symbol] = name.split(".");
3266
+ return /*#__PURE__*/React.createElement("svg", {
3267
+ "aria-hidden": title ? undefined : true,
3268
+ fill: "currentColor",
3269
+ height: size,
3270
+ role: title ? "img" : undefined,
3271
+ style: {
3272
+ color: theme && `var(${theme})`,
3273
+ flexShrink: 0,
3274
+ ...style
3275
+ },
3276
+ viewBox: "0 0 16 16",
3277
+ width: size,
3278
+ ...props
3279
+ }, title && /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("path", {
3280
+ d: paths[collection][symbol]
3281
+ }));
3282
+ }
3283
+
3284
+ const SEARCHABLE_PRODUCTS = [{
3285
+ appName: "Calendar",
3286
+ slug: "calendar"
3287
+ }, {
3288
+ appName: "Check-Ins",
3289
+ slug: "check-ins"
3290
+ }, {
3291
+ appName: "Giving",
3292
+ slug: "giving"
3293
+ }, {
3294
+ appName: "Groups",
3295
+ slug: "groups"
3296
+ }, {
3297
+ appName: "People",
3298
+ slug: "people"
3299
+ }, {
3300
+ appName: "Publishing",
3301
+ slug: "publishing"
3302
+ }, {
3303
+ appName: "Registrations",
3304
+ slug: "registrations"
3305
+ }, {
3306
+ appName: "Services",
3307
+ slug: "services"
3308
+ }];
3309
+ const KEYBOARD_SHORTCUTS = {
3310
+ copyLink: {
3311
+ key: "c",
3312
+ label: "Copy link",
3313
+ modifierKey: true
3314
+ },
3315
+ openInNewTab: {
3316
+ label: "Open in new tab"},
3317
+ openSearch: {
3318
+ key: "k",
3319
+ label: "Open search",
3320
+ modifierKey: true
3321
+ },
3322
+ select: {
3323
+ label: "Select",
3324
+ modifierKey: false,
3325
+ next: "ArrowDown",
3326
+ previous: "ArrowUp"
3327
+ }
3328
+ };
3329
+
3249
3330
  const isMac = () => /Mac|iPhone|iPad|iPod/.test(navigator.platform);
3250
3331
  const hasCommandKey = event => isMac() ? event.metaKey : event.ctrlKey;
3251
- const commandKeyLabel = () => isMac() ? "⌘" : "Ctrl+";
3252
- const isSearchShortcut = event => event.key.toLowerCase() === "k" && !event.altKey && !event.shiftKey && hasCommandKey(event);
3332
+ const matchesShortcut = (shortcut, event) => event.key.toLowerCase() === shortcut.key && !event.altKey && !event.shiftKey && hasCommandKey(event) === shortcut.modifierKey;
3333
+ const isSearchShortcut = event => matchesShortcut(KEYBOARD_SHORTCUTS.openSearch, event);
3253
3334
  // Products opened their own search with `/` before this one replaced it.
3254
3335
  const isLegacySearchShortcut = event => event.key === "/" && !event.altKey && !event.ctrlKey && !event.metaKey && !isTypingIn(event.target);
3255
- const isCopyShortcut = event => event.key.toLowerCase() === "c" && !event.altKey && !event.shiftKey && hasCommandKey(event);
3336
+ const isCopyShortcut = event => matchesShortcut(KEYBOARD_SHORTCUTS.copyLink, event);
3256
3337
  const isTypingIn = target => target instanceof Element && target.closest('input, select, textarea, [contenteditable]:not([contenteditable="false"])') !== null;
3257
3338
  const isTypingKey = event => event.key.length === 1 && event.key !== " " && !event.altKey && !event.ctrlKey && !event.metaKey;
3258
3339
  const verticalStep = key => ({
3259
- ArrowDown: 1,
3260
- ArrowUp: -1
3340
+ [KEYBOARD_SHORTCUTS.select.next]: 1,
3341
+ [KEYBOARD_SHORTCUTS.select.previous]: -1
3261
3342
  })[key];
3262
3343
  const horizontalStep = key => ({
3263
3344
  ArrowLeft: -1,
3264
3345
  ArrowRight: 1
3265
3346
  })[key];
3266
3347
 
3348
+ var styles$l = {"searchButton":"searchButton-fYa5-"};
3349
+
3267
3350
  function SearchButton({
3351
+ mobile = false,
3268
3352
  onClick
3269
3353
  }) {
3270
3354
  return /*#__PURE__*/React.createElement("button", {
3271
- "aria-keyshortcuts": `${isMac() ? "Meta+K" : "Control+K"} /`,
3355
+ "aria-keyshortcuts": mobile ? undefined : `${isMac() ? "Meta" : "Control"}+${KEYBOARD_SHORTCUTS.openSearch.key.toUpperCase()} /`,
3272
3356
  "aria-label": "Search",
3357
+ className: styles$l.searchButton,
3273
3358
  onClick: onClick,
3274
3359
  type: "button"
3275
- }, /*#__PURE__*/React.createElement(Spyglass, {
3276
- fill: "currentColor"
3360
+ }, /*#__PURE__*/React.createElement(Icon, {
3361
+ name: "general.search",
3362
+ size: mobile ? 18 : 14
3277
3363
  }));
3278
3364
  }
3279
3365
 
@@ -3588,16 +3674,16 @@ function useRecentlyVisitableMetadata() {
3588
3674
  const ENTRY_VERSION = 3;
3589
3675
  const MAX_ENTRIES = 50;
3590
3676
  const MAX_TEXT_LENGTH = 200;
3591
- const PRODUCTS = ["accounts", "calendar", "check-ins", "giving", "groups", "home", "login", "people", "publishing", "registrations", "services"];
3677
+ const PRODUCTS$1 = ["accounts", "calendar", "check-ins", "giving", "groups", "home", "login", "people", "publishing", "registrations", "services"];
3592
3678
  // Login has no pages worth returning to.
3593
- const APPS = PRODUCTS.filter(product => product !== "login");
3679
+ const APPS = PRODUCTS$1.filter(product => product !== "login");
3594
3680
  function isId(value) {
3595
3681
  return value !== "" && Array.from(value).every(character => character >= "0" && character <= "9");
3596
3682
  }
3597
3683
  // A PCRL looks like `<product>/v2/<resource_type>/<id>`.
3598
3684
  function isPcrl(value) {
3599
3685
  const segments = value.split("/");
3600
- return segments.length === 4 && PRODUCTS.some(product => product === segments[0]) && isId(segments[3]);
3686
+ return segments.length === 4 && PRODUCTS$1.some(product => product === segments[0]) && isId(segments[3]);
3601
3687
  }
3602
3688
  function isApp(value) {
3603
3689
  return APPS.some(app => app === value);
@@ -3996,7 +4082,13 @@ function hasSelectedText(element) {
3996
4082
  return selectedInField || ((_b = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "") !== "";
3997
4083
  }
3998
4084
 
3999
- const COPIED_FEEDBACK_MS = 1500;
4085
+ // eslint-disable-next-line sort-keys-fix/sort-keys-fix
4086
+ const COPIED_TIMING = {
4087
+ enter: 240,
4088
+ active: 1000,
4089
+ exit: 240
4090
+ };
4091
+ const COPIED_FEEDBACK_MS = COPIED_TIMING.enter + COPIED_TIMING.active + COPIED_TIMING.exit;
4000
4092
  // `copiedUrl` stays set briefly after a copy so the UI can confirm it.
4001
4093
  function useCopyLink() {
4002
4094
  const [copiedUrl, setCopiedUrl] = React.useState(null);
@@ -4020,22 +4112,27 @@ function useCopyLink() {
4020
4112
  // Remembering which list the index belongs to puts the highlight back on the
4021
4113
  // first item whenever a new list replaces it, without an effect to reset it.
4022
4114
  // A list that grows or fills in under the same `list` keeps its highlight.
4023
- function useResultNavigation(items, list) {
4115
+ // Disabled, nothing is highlighted and the keys and pointer leave it alone.
4116
+ function useResultNavigation(items, list, enabled = true) {
4024
4117
  const [highlight, setHighlight] = React.useState({
4025
4118
  index: 0,
4026
4119
  list
4027
4120
  });
4028
4121
  const highlightedIndex = highlight.list === list ? highlight.index : 0;
4029
- const highlighted = items[highlightedIndex];
4122
+ const highlighted = enabled ? items[highlightedIndex] : undefined;
4030
4123
  const {
4031
4124
  copiedUrl,
4032
4125
  copy
4033
4126
  } = useCopyLink();
4034
- const highlightIndex = React.useCallback(index => setHighlight(current => current.list === list && current.index === index ? current : {
4035
- index,
4036
- list
4037
- }), [list]);
4127
+ const highlightIndex = React.useCallback(index => {
4128
+ if (!enabled) return;
4129
+ setHighlight(current => current.list === list && current.index === index ? current : {
4130
+ index,
4131
+ list
4132
+ });
4133
+ }, [enabled, list]);
4038
4134
  const handleKeyDown = event => {
4135
+ if (!enabled) return;
4039
4136
  const step = verticalStep(event.key);
4040
4137
  if (step && items.length > 0) {
4041
4138
  event.preventDefault();
@@ -4059,41 +4156,89 @@ function useResultNavigation(items, list) {
4059
4156
  };
4060
4157
  }
4061
4158
 
4062
- function groupSections(groups = []) {
4159
+ var styles$k = {"modal":"modal-NR3TO","visuallyHidden":"visuallyHidden-C28ju","panel":"panel-HlF7S"};
4160
+
4161
+ const FALLBACK_SLUGS = ["people", "services"];
4162
+ function defaultProduct(products, appName) {
4163
+ var _a;
4164
+ const current = products.find(product => product.appName === appName);
4165
+ const fallback = FALLBACK_SLUGS.map(slug => products.find(product => product.slug === slug)).find(Boolean);
4166
+ return (_a = current !== null && current !== void 0 ? current : fallback) !== null && _a !== void 0 ? _a : products[0];
4167
+ }
4168
+
4169
+ function groupSections(groups = [], timeZone) {
4063
4170
  return groups.map(({
4064
4171
  results,
4065
4172
  type
4066
4173
  }) => ({
4067
4174
  heading: type,
4068
- items: results.map(resultItem),
4175
+ items: results.map(result => resultItem(result, timeZone)),
4069
4176
  key: type
4070
4177
  }));
4071
4178
  }
4072
4179
  function resultItem({
4073
4180
  attributes,
4074
4181
  id
4075
- }) {
4182
+ }, timeZone) {
4076
4183
  return {
4184
+ category: attributes.category,
4185
+ imageUrl: attributes.image_url,
4077
4186
  key: id,
4078
- subtitle: summarize(attributes.metadata),
4187
+ product: attributes.product,
4188
+ subtitle: summarize(attributes, timeZone),
4079
4189
  title: attributes.title,
4080
4190
  url: attributes.url
4081
4191
  };
4082
4192
  }
4083
- function visitItem(visit) {
4193
+ function visitItem(visit, timeZone) {
4084
4194
  return {
4085
4195
  key: entryKey(visit.entry),
4086
- ...describeVisit(visit)
4196
+ ...describeVisit(visit, timeZone)
4087
4197
  };
4088
4198
  }
4089
- function summarize(metadata) {
4090
- return Object.values(metadata !== null && metadata !== void 0 ? metadata : {}).filter(value => typeof value === "string" && value !== "").join(" · ");
4199
+ const joinParts = (...parts) => parts.filter(Boolean).join(" · ");
4200
+ // Matches home-mobile's search subtitles, so a result reads the same in both.
4201
+ function summarize({
4202
+ category,
4203
+ metadata
4204
+ }, timeZone) {
4205
+ const text = key => {
4206
+ const value = metadata === null || metadata === void 0 ? void 0 : metadata[key];
4207
+ return typeof value === "string" ? value : "";
4208
+ };
4209
+ if (category === "profile") {
4210
+ return joinParts(text("phone"), text("email"));
4211
+ } else if (category === "event") {
4212
+ return eventTime(text("starts_at"), text("ends_at"), {
4213
+ recurring: (metadata === null || metadata === void 0 ? void 0 : metadata.recurring) === true,
4214
+ timeZone
4215
+ });
4216
+ } else {
4217
+ return text("details");
4218
+ }
4219
+ }
4220
+ // "Oct 25, 9–10:30am", in the organization's time zone like the rest
4221
+ // of Planning Center.
4222
+ function eventTime(startsAt, endsAt, {
4223
+ recurring,
4224
+ timeZone
4225
+ }) {
4226
+ if (startsAt === "") {
4227
+ return "";
4228
+ } else {
4229
+ const time = datetimeFmt.datetime(startsAt, endsAt || null, {
4230
+ style: "abbreviated",
4231
+ ...(timeZone && {
4232
+ timeZone
4233
+ })
4234
+ });
4235
+ return recurring ? joinParts(time, "Repeating") : time;
4236
+ }
4091
4237
  }
4092
4238
  // Unlike search results, recents come from every product, so each one names
4093
4239
  // its product and type.
4094
- function describeVisit(visit) {
4240
+ function describeVisit(visit, timeZone) {
4095
4241
  var _a, _b;
4096
- const subtitle = (...parts) => parts.filter(Boolean).join(" · ");
4097
4242
  if (visit.status === "page") {
4098
4243
  const {
4099
4244
  app,
@@ -4101,19 +4246,31 @@ function describeVisit(visit) {
4101
4246
  title
4102
4247
  } = visit.entry;
4103
4248
  return {
4104
- subtitle: subtitle(productName(app), (_a = metadata === null || metadata === void 0 ? void 0 : metadata.type) !== null && _a !== void 0 ? _a : "", (_b = metadata === null || metadata === void 0 ? void 0 : metadata.details) !== null && _b !== void 0 ? _b : ""),
4249
+ category: "generic",
4250
+ imageUrl: null,
4251
+ product: app,
4252
+ subtitle: joinParts(productName(app), capitalize((_a = metadata === null || metadata === void 0 ? void 0 : metadata.type) !== null && _a !== void 0 ? _a : ""), (_b = metadata === null || metadata === void 0 ? void 0 : metadata.details) !== null && _b !== void 0 ? _b : ""),
4105
4253
  title,
4106
4254
  url: visit.url
4107
4255
  };
4108
4256
  } else {
4109
4257
  const {
4110
- metadata,
4258
+ attributes
4259
+ } = visit.result;
4260
+ const {
4261
+ category,
4262
+ image_url,
4111
4263
  product,
4112
4264
  title,
4113
4265
  type
4114
- } = visit.result.attributes;
4266
+ } = attributes;
4267
+ // Profiles and events say what they are with a phone number or a date.
4268
+ const kind = category === "generic" ? capitalize(pluralize.singular(type)) : "";
4115
4269
  return {
4116
- subtitle: subtitle(productName(product), type, summarize(metadata)),
4270
+ category,
4271
+ imageUrl: image_url,
4272
+ product,
4273
+ subtitle: joinParts(productName(product), kind, summarize(attributes, timeZone)),
4117
4274
  title,
4118
4275
  url: visit.url
4119
4276
  };
@@ -4127,39 +4284,278 @@ function capitalize(word) {
4127
4284
  return word.charAt(0).toUpperCase() + word.slice(1);
4128
4285
  }
4129
4286
 
4130
- const STORAGE_KEY = "topbar.product_search.last_product";
4131
- function readLastProduct() {
4132
- try {
4133
- return localStorage.getItem(STORAGE_KEY);
4134
- } catch {
4135
- return null;
4136
- }
4137
- }
4138
- function saveLastProduct(slug) {
4139
- try {
4140
- localStorage.setItem(STORAGE_KEY, slug);
4141
- } catch {
4142
- // Storage can be full or blocked; search still works without it.
4287
+ var styles$j = {"container":"container-YDdM1","hint":"hint-017Rd","keycap":"keycap-ENJM2","labels":"labels-GHPqL","copied":"copied-DUFa1"};
4288
+
4289
+ const SYMBOLS = {
4290
+ command: {
4291
+ label: "⌘",
4292
+ paths: ["M7 9a2 2 0 1 1 2 -2v10a2 2 0 1 1 -2 -2h10a2 2 0 1 1 -2 2v-10a2 2 0 1 1 2 2h-10"]
4293
+ },
4294
+ down: {
4295
+ label: "↓",
4296
+ paths: ["M12 6l0 12", "M16 14l-4 4", "M8 14l4 4"]
4297
+ },
4298
+ return: {
4299
+ label: "↵",
4300
+ paths: ["M18 6v6a3 3 0 0 1 -3 3h-10l4 -4m0 8l-4 -4"]
4301
+ },
4302
+ up: {
4303
+ label: "↑",
4304
+ paths: ["M12 6l0 12", "M16 10l-4 -4", "M8 10l4 -4"]
4143
4305
  }
4306
+ };
4307
+ function Keycap(props) {
4308
+ return /*#__PURE__*/React.createElement("kbd", {
4309
+ className: styles$j.keycap
4310
+ }, "symbol" in props ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("svg", {
4311
+ "aria-hidden": true,
4312
+ fill: "none",
4313
+ stroke: "currentColor",
4314
+ strokeLinecap: "round",
4315
+ strokeLinejoin: "round",
4316
+ viewBox: "0 0 24 24"
4317
+ }, SYMBOLS[props.symbol].paths.map(d => (/*#__PURE__*/React.createElement("path", {
4318
+ d: d,
4319
+ key: d
4320
+ })))), /*#__PURE__*/React.createElement("span", {
4321
+ className: styles$k.visuallyHidden
4322
+ }, SYMBOLS[props.symbol].label))) : props.label);
4323
+ }
4324
+ function CommandKey() {
4325
+ return isMac() ? /*#__PURE__*/React.createElement(Keycap, {
4326
+ symbol: "command"
4327
+ }) : /*#__PURE__*/React.createElement(Keycap, {
4328
+ label: "Ctrl"
4329
+ });
4144
4330
  }
4145
- function initialProduct(products) {
4146
- var _a, _b, _c;
4147
- const lastProduct = readLastProduct();
4148
- const bySlug = slug => products.find(product => product.slug === slug);
4149
- return (_c = (_b = (_a = bySlug(lastProduct)) !== null && _a !== void 0 ? _a : bySlug("people")) !== null && _b !== void 0 ? _b : bySlug("services")) !== null && _c !== void 0 ? _c : products[0];
4331
+ function EnterKey() {
4332
+ return isMac() ? /*#__PURE__*/React.createElement(Keycap, {
4333
+ symbol: "return"
4334
+ }) : /*#__PURE__*/React.createElement(Keycap, {
4335
+ label: "Enter"
4336
+ });
4150
4337
  }
4151
-
4338
+ const {
4339
+ copyLink,
4340
+ openInNewTab,
4341
+ openSearch,
4342
+ select
4343
+ } = KEYBOARD_SHORTCUTS;
4152
4344
  function KeyboardHints({
4153
4345
  copied
4154
4346
  }) {
4155
- const command = commandKeyLabel();
4156
- return /*#__PURE__*/React.createElement("p", null, "\u2191\u2193 Select \u00B7 \u21B5 Open \u00B7 ", command, "\u21B5 Open in new tab \u00B7 ", command, "C", " ", /*#__PURE__*/React.createElement("span", {
4347
+ return /*#__PURE__*/React.createElement("ul", {
4348
+ "aria-label": "Keyboard shortcuts",
4349
+ className: styles$j.container
4350
+ }, /*#__PURE__*/React.createElement("li", {
4351
+ className: styles$j.hint
4352
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4353
+ gap: 0.5
4354
+ }, select.modifierKey, /*#__PURE__*/React.createElement(Keycap, {
4355
+ symbol: "up"
4356
+ }), /*#__PURE__*/React.createElement(Keycap, {
4357
+ symbol: "down"
4358
+ })), select.label), /*#__PURE__*/React.createElement("li", {
4359
+ className: styles$j.hint
4360
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4361
+ gap: 0.5
4362
+ }, /*#__PURE__*/React.createElement(CommandKey, null), /*#__PURE__*/React.createElement(EnterKey, null)), openInNewTab.label), /*#__PURE__*/React.createElement("li", {
4363
+ className: classnames(styles$j.hint, copied && styles$j.copied),
4364
+ style: {
4365
+ "--copied-active": `${COPIED_TIMING.active}ms`,
4366
+ "--copied-enter": `${COPIED_TIMING.enter}ms`,
4367
+ "--copied-exit": `${COPIED_TIMING.exit}ms`
4368
+ }
4369
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4370
+ gap: 0.5
4371
+ }, /*#__PURE__*/React.createElement(CommandKey, null), /*#__PURE__*/React.createElement(Keycap, {
4372
+ label: copyLink.key.toUpperCase()
4373
+ })), /*#__PURE__*/React.createElement("span", {
4374
+ className: styles$j.labels
4375
+ }, /*#__PURE__*/React.createElement("span", {
4376
+ "aria-hidden": copied
4377
+ }, copyLink.label), /*#__PURE__*/React.createElement("span", {
4157
4378
  role: "status"
4158
- }, copied ? "Copied!" : "Copy link"), " \u00B7 ", command, "K Open search");
4379
+ }, copied && "Copied!"))), /*#__PURE__*/React.createElement("li", {
4380
+ className: styles$j.hint
4381
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4382
+ gap: 0.5
4383
+ }, /*#__PURE__*/React.createElement(CommandKey, null), /*#__PURE__*/React.createElement(Keycap, {
4384
+ label: openSearch.key.toUpperCase()
4385
+ })), openSearch.label));
4159
4386
  }
4160
4387
 
4161
- var styles$d = {"tab":"tab-dz8ki"};
4388
+ var styles$i = {"icon":"icon-XKLvN","squircle":"squircle-JCHr6"};
4162
4389
 
4390
+ const PRODUCTS = {
4391
+ accounts: {
4392
+ gradient: "--t-fill-color-product-accounts-gradient-brand",
4393
+ path: logomarks__namespace.accounts
4394
+ },
4395
+ api: {
4396
+ gradient: "--t-fill-color-product-api-gradient-brand",
4397
+ path: logomarks__namespace.api
4398
+ },
4399
+ calendar: {
4400
+ gradient: "--t-fill-color-product-calendar-gradient-brand",
4401
+ path: logomarks__namespace.calendar
4402
+ },
4403
+ "check-ins": {
4404
+ gradient: "--t-fill-color-product-checkins-gradient-brand",
4405
+ path: logomarks__namespace.checkIns
4406
+ },
4407
+ "church-center": {
4408
+ gradient: "--t-fill-color-product-cc-gradient-brand",
4409
+ path: logomarks__namespace.churchCenter
4410
+ },
4411
+ giving: {
4412
+ gradient: "--t-fill-color-product-giving-gradient-brand",
4413
+ path: logomarks__namespace.giving
4414
+ },
4415
+ groups: {
4416
+ gradient: "--t-fill-color-product-groups-gradient-brand",
4417
+ path: logomarks__namespace.groups
4418
+ },
4419
+ home: {
4420
+ gradient: "--t-fill-color-product-home-gradient-brand",
4421
+ path: logomarks__namespace.home
4422
+ },
4423
+ "music-stand": {
4424
+ gradient: "--t-fill-color-product-musicstand-gradient-brand",
4425
+ path: logomarks__namespace.musicStand
4426
+ },
4427
+ people: {
4428
+ gradient: "--t-fill-color-product-people-gradient-brand",
4429
+ path: logomarks__namespace.people
4430
+ },
4431
+ publishing: {
4432
+ gradient: "--t-fill-color-product-publishing-gradient-brand",
4433
+ path: logomarks__namespace.publishing
4434
+ },
4435
+ registrations: {
4436
+ gradient: "--t-fill-color-product-registrations-gradient-brand",
4437
+ path: logomarks__namespace.registrations
4438
+ },
4439
+ services: {
4440
+ gradient: "--t-fill-color-product-services-gradient-brand",
4441
+ path: logomarks__namespace.services
4442
+ }
4443
+ };
4444
+ const isProductIconSlug = slug => Object.prototype.hasOwnProperty.call(PRODUCTS, slug);
4445
+ const maskFor = path => `url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="${path}"/></svg>`)}")`;
4446
+ function ProductIcon({
4447
+ size = 16,
4448
+ slug
4449
+ }) {
4450
+ const {
4451
+ gradient,
4452
+ path
4453
+ } = PRODUCTS[slug];
4454
+ const mask = maskFor(path);
4455
+ return /*#__PURE__*/React.createElement("span", {
4456
+ "aria-hidden": true,
4457
+ className: styles$i.icon,
4458
+ style: {
4459
+ height: size,
4460
+ width: size
4461
+ }
4462
+ }, /*#__PURE__*/React.createElement("span", {
4463
+ className: styles$i.squircle,
4464
+ style: {
4465
+ WebkitMaskImage: mask,
4466
+ background: `var(${gradient})`,
4467
+ maskImage: mask
4468
+ }
4469
+ }));
4470
+ }
4471
+
4472
+ var styles$h = {"picker":"picker-iuzzj","option":"option--7LXg"};
4473
+
4474
+ // Phones have no room for a tab per product, so they pick from a dropdown.
4475
+ // Complex mode renders each option's logomark, in the list and the trigger.
4476
+ function ProductSelect({
4477
+ children,
4478
+ onSelect,
4479
+ products,
4480
+ selected
4481
+ }) {
4482
+ const options = products.map(({
4483
+ appName,
4484
+ slug
4485
+ }) => ({
4486
+ label: (/*#__PURE__*/React.createElement("span", {
4487
+ className: styles$h.option
4488
+ }, /*#__PURE__*/React.createElement(ProductIcon, {
4489
+ slug: slug
4490
+ }), appName)),
4491
+ textValue: appName,
4492
+ value: slug
4493
+ }));
4494
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
4495
+ className: styles$h.picker
4496
+ }, /*#__PURE__*/React.createElement(tapestry.Select, {
4497
+ "aria-label": "Product",
4498
+ complex: true,
4499
+ onChange: event => onSelect(event.target.value),
4500
+ options: options,
4501
+ value: selected.slug
4502
+ })), /*#__PURE__*/React.createElement("div", {
4503
+ className: styles$k.panel
4504
+ }, children));
4505
+ }
4506
+
4507
+ // Browsers match :focus-visible on every focused text field, keyboard or not,
4508
+ // since typing follows either way. So this remembers what last moved focus,
4509
+ // shared by every field and listened for once, in the capture phase so it's
4510
+ // known before focus moves.
4511
+ let lastInteraction = "pointer";
4512
+ let listening = false;
4513
+ function listen() {
4514
+ if (listening) return;
4515
+ listening = true;
4516
+ document.addEventListener("keydown", event => {
4517
+ // Shortcuts like ⌘C don't move focus.
4518
+ if (!event.metaKey && !event.ctrlKey && !event.altKey) {
4519
+ lastInteraction = "keyboard";
4520
+ }
4521
+ }, true);
4522
+ document.addEventListener("pointerdown", () => {
4523
+ lastInteraction = "pointer";
4524
+ }, true);
4525
+ }
4526
+ /**
4527
+ * Whether a field was focused from the keyboard, as by Tab, rather than by a
4528
+ * click or tap. Spread `focusProps` onto the field, and style it by
4529
+ * `data-focus-visible`.
4530
+ */
4531
+ function useKeyboardFocus({
4532
+ onBlur,
4533
+ onFocus
4534
+ } = {}) {
4535
+ const [focusVisible, setFocusVisible] = React.useState(false);
4536
+ React.useEffect(listen, []);
4537
+ return {
4538
+ focusProps: {
4539
+ "data-focus-visible": focusVisible || undefined,
4540
+ onBlur: event => {
4541
+ setFocusVisible(false);
4542
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
4543
+ },
4544
+ onFocus: event => {
4545
+ const keyboard = lastInteraction === "keyboard";
4546
+ setFocusVisible(keyboard);
4547
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, keyboard);
4548
+ }
4549
+ },
4550
+ focusVisible
4551
+ };
4552
+ }
4553
+
4554
+ var styles$g = {"tablist":"tablist-7ASvc","tab":"tab-dz8ki"};
4555
+
4556
+ // With this many tabs or more, only the selected tab shows its name, so they
4557
+ // all fit. Fewer always fit with their names.
4558
+ const ICON_ONLY_TAB_COUNT = 5;
4163
4559
  function ProductTabs({
4164
4560
  children,
4165
4561
  onKeyDown,
@@ -4170,6 +4566,7 @@ function ProductTabs({
4170
4566
  const id = useInstanceId("product-tabs");
4171
4567
  const tabId = slug => `${id}-tab-${slug}`;
4172
4568
  const tabRefs = React.useRef(new Map());
4569
+ const showAllNames = products.length < ICON_ONLY_TAB_COUNT;
4173
4570
  const handleKeyDown = event => {
4174
4571
  var _a;
4175
4572
  const offset = horizontalStep(event.key);
@@ -4184,13 +4581,14 @@ function ProductTabs({
4184
4581
  }
4185
4582
  };
4186
4583
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
4187
- "aria-label": "Product",
4584
+ "aria-label": "Search in",
4585
+ className: styles$g.tablist,
4188
4586
  onKeyDown: handleKeyDown,
4189
4587
  role: "tablist"
4190
- }, products.map(product => (/*#__PURE__*/React.createElement("button", {
4588
+ }, products.map(product => (/*#__PURE__*/React.createElement(Tab, {
4191
4589
  "aria-controls": `${id}-panel`,
4590
+ "aria-describedby": `${tabId(product.slug)}-description`,
4192
4591
  "aria-selected": product === selected,
4193
- className: styles$d.tab,
4194
4592
  id: tabId(product.slug),
4195
4593
  key: product.slug,
4196
4594
  onClick: () => onSelect(product.slug),
@@ -4201,15 +4599,397 @@ function ProductTabs({
4201
4599
  tabRefs.current.delete(product.slug);
4202
4600
  }
4203
4601
  },
4204
- role: "tab",
4205
- tabIndex: product === selected ? 0 : -1,
4206
- type: "button"
4207
- }, product.appName)))), /*#__PURE__*/React.createElement("div", {
4602
+ tabIndex: product === selected ? 0 : -1
4603
+ }, /*#__PURE__*/React.createElement(ProductIcon, {
4604
+ slug: product.slug
4605
+ }), showAllNames || product === selected ? product.appName : (/*#__PURE__*/React.createElement("span", {
4606
+ className: styles$k.visuallyHidden
4607
+ }, product.appName)))))), /*#__PURE__*/React.createElement("div", {
4608
+ className: styles$k.visuallyHidden
4609
+ }, products.map(product => (/*#__PURE__*/React.createElement("span", {
4610
+ id: `${tabId(product.slug)}-description`,
4611
+ key: product.slug
4612
+ }, "Planning Center ", product.appName)))), /*#__PURE__*/React.createElement("div", {
4208
4613
  "aria-labelledby": tabId(selected.slug),
4614
+ className: styles$k.panel,
4209
4615
  id: `${id}-panel`,
4210
4616
  role: "tabpanel"
4211
4617
  }, children));
4212
4618
  }
4619
+ // The modal's focus scope moves focus here by script when Tab is pressed, and
4620
+ // Safari doesn't match :focus-visible on focus moved by script. So the tab
4621
+ // remembers whether the keyboard brought focus, and the ring keys off that.
4622
+ const Tab = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
4623
+ const {
4624
+ focusProps
4625
+ } = useKeyboardFocus();
4626
+ return /*#__PURE__*/React.createElement("button", {
4627
+ className: styles$g.tab,
4628
+ ref: ref,
4629
+ role: "tab",
4630
+ type: "button",
4631
+ ...props,
4632
+ ...focusProps
4633
+ });
4634
+ });
4635
+
4636
+ function BlankStateRecentlyVisited(props) {
4637
+ const id = useInstanceId("blank-state-initial");
4638
+ return /*#__PURE__*/React.createElement("svg", {
4639
+ viewBox: "0 0 197 174",
4640
+ fill: "none",
4641
+ "aria-hidden": "true",
4642
+ focusable: "false",
4643
+ ...props
4644
+ }, /*#__PURE__*/React.createElement("path", {
4645
+ d: "M139.863 32.119c10.938 10.028 21.777 20.154 32.912 30.084 8.376 7.373 21.975 15.828 23.157 28.02.592 6.095-2.167 11.993-5.321 17.204-24.635 40.8-81.098 67.148-127.412 48.862-30.646-12.093-76.172-47.387-59.716-85.041 15.865-36.377 64.84-55.056 83.957-57.71 21.876-4.621 34.883 2.457 52.423 18.58Z",
4646
+ fill: "currentColor"
4647
+ }), /*#__PURE__*/React.createElement("g", {
4648
+ clipPath: `url(#${id}-a)`
4649
+ }, /*#__PURE__*/React.createElement("path", {
4650
+ d: "M115.885 109.31c-.478-.686-.01-1.845 1.046-2.589s2.3-.791 2.778-.105c.478.686.009 1.845-1.047 2.589-1.056.744-2.299.791-2.777.105Z",
4651
+ fill: "#333"
4652
+ }), /*#__PURE__*/React.createElement("path", {
4653
+ d: "M123.403 113.599c-3.456 0-6.259-2.817-6.259-6.293 0-3.475 2.803-6.293 6.259-6.293 3.457 0 6.259 2.818 6.259 6.293 0 3.476-2.802 6.293-6.259 6.293Z",
4654
+ fill: "#333"
4655
+ }), /*#__PURE__*/React.createElement("path", {
4656
+ d: "M118.853 100.968a2.85 2.85 0 0 0 2.832-2.484 2.89 2.89 0 0 0-.071-1.115c-2.638-9.955-9.668-9.687-9.964-9.665l.311 5.716h-.104c.119 0 2.853.134 4.254 5.421a2.874 2.874 0 0 0 1.013 1.53 2.846 2.846 0 0 0 1.729.597Z",
4657
+ fill: "#4D4D4D"
4658
+ }), /*#__PURE__*/React.createElement("path", {
4659
+ d: "M114.96 100.503c-.462-5.894 2.796-10.96 7.279-11.315 4.482-.356 8.491 4.134 8.953 10.027.462 5.894-2.796 10.96-7.279 11.315-4.482.356-8.491-4.134-8.953-10.027Z",
4660
+ fill: "#F2F2F2"
4661
+ }), /*#__PURE__*/React.createElement("path", {
4662
+ d: "M125.964 107.738c-4.48.354-8.489-4.135-8.953-10.026a12.893 12.893 0 0 1 1.223-6.707c-2.249 2.046-3.591 5.59-3.283 9.505.463 5.895 4.469 10.384 8.953 10.027 2.594-.205 4.765-1.986 6.055-4.591a6.682 6.682 0 0 1-3.995 1.792Z",
4663
+ fill: "#E6E6E6"
4664
+ }), /*#__PURE__*/React.createElement("path", {
4665
+ d: "M115.885 109.31c-.478-.686-.01-1.845 1.046-2.589s2.3-.791 2.778-.105c.478.686.009 1.845-1.047 2.589-1.056.744-2.299.791-2.777.105Z",
4666
+ fill: "#333"
4667
+ }), /*#__PURE__*/React.createElement("path", {
4668
+ d: "M123.403 113.599c-3.456 0-6.259-2.817-6.259-6.293 0-3.475 2.803-6.293 6.259-6.293 3.457 0 6.259 2.818 6.259 6.293 0 3.476-2.802 6.293-6.259 6.293Z",
4669
+ fill: "#333"
4670
+ }), /*#__PURE__*/React.createElement("path", {
4671
+ d: "M118.853 100.968a2.85 2.85 0 0 0 2.832-2.484 2.89 2.89 0 0 0-.071-1.115c-2.638-9.955-9.668-9.687-9.964-9.665l.311 5.716h-.104c.119 0 2.853.134 4.254 5.421a2.874 2.874 0 0 0 1.013 1.53 2.846 2.846 0 0 0 1.729.597Z",
4672
+ fill: "#4D4D4D"
4673
+ }), /*#__PURE__*/React.createElement("path", {
4674
+ d: "M114.96 100.503c-.462-5.894 2.796-10.96 7.279-11.315 4.482-.356 8.491 4.134 8.953 10.027.462 5.894-2.796 10.96-7.279 11.315-4.482.356-8.491-4.134-8.953-10.027Z",
4675
+ fill: "#F2F2F2"
4676
+ }), /*#__PURE__*/React.createElement("path", {
4677
+ d: "M125.964 107.738c-4.48.354-8.489-4.135-8.953-10.026a12.893 12.893 0 0 1 1.223-6.707c-2.249 2.046-3.591 5.59-3.283 9.505.463 5.895 4.469 10.384 8.953 10.027 2.594-.205 4.765-1.986 6.055-4.591a6.682 6.682 0 0 1-3.995 1.792Z",
4678
+ fill: "#E6E6E6"
4679
+ }), /*#__PURE__*/React.createElement("path", {
4680
+ d: "M89.317 121.331a2.836 2.836 0 0 1-1.92-.752 2.869 2.869 0 0 1-.911-1.857c-.534-5.726 3.527-13.808 3.99-14.713a2.849 2.849 0 0 1 1.666-1.413 2.835 2.835 0 0 1 2.172.185 2.86 2.86 0 0 1 1.405 1.675 2.876 2.876 0 0 1-.184 2.183c-1.46 2.843-3.669 8.492-3.383 11.551a2.868 2.868 0 0 1-1.504 2.797 2.84 2.84 0 0 1-1.064.318 1.378 1.378 0 0 1-.267.026Z",
4681
+ fill: "#4D4D4D"
4682
+ }), /*#__PURE__*/React.createElement("path", {
4683
+ d: "M92.155 112.314c3.308 0 5.989-2.696 5.989-6.021 0-3.326-2.681-6.021-5.989-6.021-3.307 0-5.988 2.695-5.988 6.021 0 3.325 2.681 6.021 5.988 6.021Z",
4684
+ fill: "gray"
4685
+ }), /*#__PURE__*/React.createElement("path", {
4686
+ d: "M80.597 128.771h11.769v3.726a1.118 1.118 0 0 1-1.112 1.118H78.57a1.118 1.118 0 0 1-1.112-1.118v-.566c0-.841.332-1.648.924-2.242a3.144 3.144 0 0 1 2.23-.929l-.015.011Z",
4687
+ fill: "#333"
4688
+ }), /*#__PURE__*/React.createElement("path", {
4689
+ d: "M89.572 132.084s8.075.119 6.3-8.268c-1.775-8.387-12.188-15.351-15.234-6.066-3.046 9.285-1.386 15.232 8.934 14.334Z",
4690
+ fill: "#F2F2F2"
4691
+ }), /*#__PURE__*/React.createElement("path", {
4692
+ d: "M106.67 121.334h-.27a2.84 2.84 0 0 1-1.925-1.025 2.872 2.872 0 0 1-.639-2.093c.285-3.059-1.92-8.708-3.38-11.551a2.873 2.873 0 0 1 1.296-3.721 2.832 2.832 0 0 1 2.102-.199 2.848 2.848 0 0 1 1.66 1.312c.463.906 4.521 8.991 3.988 14.714a2.874 2.874 0 0 1-.926 1.828 2.832 2.832 0 0 1-1.906.735Z",
4693
+ fill: "#4D4D4D"
4694
+ }), /*#__PURE__*/React.createElement("path", {
4695
+ d: "M103.835 112.314c3.307 0 5.988-2.696 5.988-6.021 0-3.326-2.681-6.021-5.988-6.021-3.307 0-5.988 2.695-5.988 6.021 0 3.325 2.681 6.021 5.988 6.021Z",
4696
+ fill: "gray"
4697
+ }), /*#__PURE__*/React.createElement("path", {
4698
+ d: "m117.408 133.652-12.674-.002c-.295 0-.577-.118-.786-.328a1.121 1.121 0 0 1-.325-.79v-3.726l11.773.002c.837 0 1.639.334 2.23.929s.923 1.401.923 2.242v.567a1.116 1.116 0 0 1-1.141 1.106Z",
4699
+ fill: "#333"
4700
+ }), /*#__PURE__*/React.createElement("path", {
4701
+ d: "M106.414 132.084s-8.075.119-6.318-8.268c1.756-8.387 12.195-15.343 15.237-6.062 3.043 9.281 1.405 15.235-8.919 14.33Z",
4702
+ fill: "#F2F2F2"
4703
+ }), /*#__PURE__*/React.createElement("path", {
4704
+ d: "M109.107 94.58a2.305 2.305 0 0 0 2.191 2.412 2.302 2.302 0 0 0 2.399-2.202l.333-7.33a2.306 2.306 0 0 0-2.191-2.412 2.303 2.303 0 0 0-2.4 2.203l-.332 7.328Z",
4705
+ fill: "gray"
4706
+ }), /*#__PURE__*/React.createElement("path", {
4707
+ d: "M80.968 109.31c.478-.686.01-1.845-1.047-2.589-1.056-.744-2.3-.791-2.777-.105-.478.686-.01 1.845 1.046 2.589s2.3.791 2.778.105Z",
4708
+ fill: "#333"
4709
+ }), /*#__PURE__*/React.createElement("path", {
4710
+ d: "M73.448 113.599c3.457 0 6.26-2.817 6.26-6.293 0-3.475-2.803-6.293-6.26-6.293-3.456 0-6.258 2.818-6.258 6.293 0 3.476 2.802 6.293 6.258 6.293Z",
4711
+ fill: "#333"
4712
+ }), /*#__PURE__*/React.createElement("path", {
4713
+ d: "M78 100.968a2.853 2.853 0 0 1-2.832-2.484 2.876 2.876 0 0 1 .07-1.115c2.639-9.955 9.669-9.687 9.965-9.665l-.311 5.716h.104c-.12 0-2.854.134-4.255 5.421a2.87 2.87 0 0 1-1.013 1.53 2.845 2.845 0 0 1-1.729.597Z",
4714
+ fill: "#4D4D4D"
4715
+ }), /*#__PURE__*/React.createElement("path", {
4716
+ d: "M87.37 88.17a2.305 2.305 0 0 0-2.19-2.413 2.302 2.302 0 0 0-2.4 2.202l-.332 7.329a2.305 2.305 0 0 0 2.19 2.413 2.302 2.302 0 0 0 2.4-2.203l.332-7.328Z",
4717
+ fill: "gray"
4718
+ }), /*#__PURE__*/React.createElement("path", {
4719
+ d: "M81.893 100.503c.462-5.894-2.797-10.96-7.28-11.315-4.482-.356-8.49 4.134-8.953 10.027-.462 5.894 2.797 10.96 7.28 11.315 4.482.356 8.49-4.134 8.953-10.027Z",
4720
+ fill: "#F2F2F2"
4721
+ }), /*#__PURE__*/React.createElement("path", {
4722
+ d: "M70.888 107.738c4.48.354 8.49-4.135 8.953-10.026a12.89 12.89 0 0 0-1.223-6.707c2.25 2.046 3.591 5.59 3.284 9.505-.464 5.895-4.47 10.384-8.953 10.027-2.594-.205-4.766-1.986-6.055-4.591a6.682 6.682 0 0 0 3.994 1.792Z",
4723
+ fill: "#E6E6E6"
4724
+ }), /*#__PURE__*/React.createElement("path", {
4725
+ d: "M112.717 94.105c-.511-9.095-7.459-11.703-15.82-11.226-8.36.477-14.97 3.856-14.451 12.951.518 9.095 7.707 16.081 16.067 15.605 8.36-.477 14.719-8.231 14.204-17.33Z",
4726
+ fill: "#F2F2F2"
4727
+ }), /*#__PURE__*/React.createElement("path", {
4728
+ d: "M112.565 92.656c-1.056 7.496-6.799 13.413-14.059 13.812-7.852.451-14.67-5.686-15.897-13.965a14.571 14.571 0 0 0-.17 3.327c.51 9.095 7.704 16.081 16.067 15.605 8.364-.477 14.723-8.235 14.211-17.33a16.83 16.83 0 0 0-.152-1.45Z",
4729
+ fill: "#E6E6E6"
4730
+ }), /*#__PURE__*/React.createElement("path", {
4731
+ d: "M103.546 90.353H91.61a.62.62 0 0 0-.619.623v1.762a.62.62 0 0 0 .62.622h11.935a.62.62 0 0 0 .619-.622v-1.762a.62.62 0 0 0-.619-.623Zm0 5.187H91.61a.62.62 0 0 0-.619.622v1.762a.62.62 0 0 0 .62.623h11.935a.62.62 0 0 0 .619-.623v-1.762a.62.62 0 0 0-.619-.622Zm-.004 5.19H91.606a.62.62 0 0 0-.619.622v1.763a.62.62 0 0 0 .62.622h11.935a.62.62 0 0 0 .619-.622v-1.763a.62.62 0 0 0-.619-.622Z",
4732
+ fill: "#3690EA"
4733
+ }), /*#__PURE__*/React.createElement("path", {
4734
+ d: "M89.317 121.331a2.836 2.836 0 0 1-1.92-.752 2.869 2.869 0 0 1-.911-1.857c-.534-5.726 3.527-13.808 3.99-14.713a2.849 2.849 0 0 1 1.666-1.413 2.835 2.835 0 0 1 2.172.185 2.86 2.86 0 0 1 1.405 1.675 2.876 2.876 0 0 1-.184 2.183c-1.46 2.843-3.669 8.492-3.383 11.551a2.868 2.868 0 0 1-1.504 2.797 2.84 2.84 0 0 1-1.064.318 1.378 1.378 0 0 1-.267.026Z",
4735
+ fill: "#4D4D4D"
4736
+ }), /*#__PURE__*/React.createElement("path", {
4737
+ d: "M92.155 112.314c3.308 0 5.989-2.696 5.989-6.021 0-3.326-2.681-6.021-5.989-6.021-3.307 0-5.988 2.695-5.988 6.021 0 3.325 2.681 6.021 5.988 6.021Z",
4738
+ fill: "gray"
4739
+ }), /*#__PURE__*/React.createElement("path", {
4740
+ d: "M80.597 128.771h11.769v3.726a1.118 1.118 0 0 1-1.112 1.118H78.57a1.118 1.118 0 0 1-1.112-1.118v-.566c0-.841.332-1.648.924-2.242a3.144 3.144 0 0 1 2.23-.929l-.015.011Z",
4741
+ fill: "#333"
4742
+ }), /*#__PURE__*/React.createElement("path", {
4743
+ d: "M89.572 132.084s8.075.119 6.3-8.268c-1.775-8.387-12.188-15.351-15.234-6.066-3.046 9.285-1.386 15.232 8.934 14.334Z",
4744
+ fill: "#F2F2F2"
4745
+ }), /*#__PURE__*/React.createElement("path", {
4746
+ d: "M106.67 121.334h-.27a2.84 2.84 0 0 1-1.925-1.025 2.872 2.872 0 0 1-.639-2.093c.285-3.059-1.92-8.708-3.38-11.551a2.873 2.873 0 0 1 1.296-3.721 2.832 2.832 0 0 1 2.102-.199 2.848 2.848 0 0 1 1.66 1.312c.463.906 4.521 8.991 3.988 14.714a2.874 2.874 0 0 1-.926 1.828 2.832 2.832 0 0 1-1.906.735Z",
4747
+ fill: "#4D4D4D"
4748
+ }), /*#__PURE__*/React.createElement("path", {
4749
+ d: "M103.835 112.314c3.307 0 5.988-2.696 5.988-6.021 0-3.326-2.681-6.021-5.988-6.021-3.307 0-5.988 2.695-5.988 6.021 0 3.325 2.681 6.021 5.988 6.021Z",
4750
+ fill: "gray"
4751
+ }), /*#__PURE__*/React.createElement("path", {
4752
+ d: "m117.408 133.652-12.674-.002c-.295 0-.577-.118-.786-.328a1.121 1.121 0 0 1-.325-.79v-3.726l11.773.002c.837 0 1.639.334 2.23.929s.923 1.401.923 2.242v.567a1.116 1.116 0 0 1-1.141 1.106Z",
4753
+ fill: "#333"
4754
+ }), /*#__PURE__*/React.createElement("path", {
4755
+ d: "M106.414 132.084s-8.075.119-6.318-8.268c1.756-8.387 12.195-15.343 15.237-6.062 3.043 9.281 1.405 15.235-8.919 14.33Z",
4756
+ fill: "#F2F2F2"
4757
+ }), /*#__PURE__*/React.createElement("path", {
4758
+ d: "M109.107 94.58a2.305 2.305 0 0 0 2.191 2.412 2.302 2.302 0 0 0 2.399-2.202l.333-7.33a2.306 2.306 0 0 0-2.191-2.412 2.303 2.303 0 0 0-2.4 2.203l-.332 7.328Z",
4759
+ fill: "gray"
4760
+ }), /*#__PURE__*/React.createElement("path", {
4761
+ d: "M80.968 109.31c.478-.686.01-1.845-1.047-2.589-1.056-.744-2.3-.791-2.777-.105-.478.686-.01 1.845 1.046 2.589s2.3.791 2.778.105Z",
4762
+ fill: "#333"
4763
+ }), /*#__PURE__*/React.createElement("path", {
4764
+ d: "M73.448 113.599c3.457 0 6.26-2.817 6.26-6.293 0-3.475-2.803-6.293-6.26-6.293-3.456 0-6.258 2.818-6.258 6.293 0 3.476 2.802 6.293 6.258 6.293Z",
4765
+ fill: "#333"
4766
+ }), /*#__PURE__*/React.createElement("path", {
4767
+ d: "M78 100.968a2.853 2.853 0 0 1-2.832-2.484 2.876 2.876 0 0 1 .07-1.115c2.639-9.955 9.669-9.687 9.965-9.665l-.311 5.716h.104c-.12 0-2.854.134-4.255 5.421a2.87 2.87 0 0 1-1.013 1.53 2.845 2.845 0 0 1-1.729.597Z",
4768
+ fill: "#4D4D4D"
4769
+ }), /*#__PURE__*/React.createElement("path", {
4770
+ d: "M87.37 88.17a2.305 2.305 0 0 0-2.19-2.413 2.302 2.302 0 0 0-2.4 2.202l-.332 7.329a2.305 2.305 0 0 0 2.19 2.413 2.302 2.302 0 0 0 2.4-2.203l.332-7.328Z",
4771
+ fill: "gray"
4772
+ }), /*#__PURE__*/React.createElement("path", {
4773
+ d: "M81.893 100.503c.462-5.894-2.797-10.96-7.28-11.315-4.482-.356-8.49 4.134-8.953 10.027-.462 5.894 2.797 10.96 7.28 11.315 4.482.356 8.49-4.134 8.953-10.027Z",
4774
+ fill: "#F2F2F2"
4775
+ }), /*#__PURE__*/React.createElement("path", {
4776
+ d: "M70.888 107.738c4.48.354 8.49-4.135 8.953-10.026a12.89 12.89 0 0 0-1.223-6.707c2.25 2.046 3.591 5.59 3.284 9.505-.464 5.895-4.47 10.384-8.953 10.027-2.594-.205-4.766-1.986-6.055-4.591a6.682 6.682 0 0 0 3.994 1.792Z",
4777
+ fill: "#E6E6E6"
4778
+ }), /*#__PURE__*/React.createElement("path", {
4779
+ d: "M112.717 94.105c-.511-9.095-7.459-11.703-15.82-11.226-8.36.477-14.97 3.856-14.451 12.951.518 9.095 7.707 16.081 16.067 15.605 8.36-.477 14.719-8.231 14.204-17.33Z",
4780
+ fill: "#F2F2F2"
4781
+ }), /*#__PURE__*/React.createElement("path", {
4782
+ d: "M112.565 92.656c-1.056 7.496-6.799 13.413-14.059 13.812-7.852.451-14.67-5.686-15.897-13.965a14.571 14.571 0 0 0-.17 3.327c.51 9.095 7.704 16.081 16.067 15.605 8.364-.477 14.723-8.235 14.211-17.33a16.83 16.83 0 0 0-.152-1.45Z",
4783
+ fill: "#E6E6E6"
4784
+ }), /*#__PURE__*/React.createElement("path", {
4785
+ d: "M94.626 78.445c-.114-.488 6.548-.927 5.815.246v.775c0 .746.033 1.49.033 2.258s.037 1.595.044 2.392c.278.593-6.473.935-5.817-.115v-.67c-.015-1.63-.06-3.257-.075-4.886Z",
4786
+ fill: "#999"
4787
+ }), /*#__PURE__*/React.createElement("path", {
4788
+ d: "M103.546 90.353H91.61a.62.62 0 0 0-.619.623v1.762a.62.62 0 0 0 .62.622h11.935a.62.62 0 0 0 .619-.622v-1.762a.62.62 0 0 0-.619-.623Zm0 5.187H91.61a.62.62 0 0 0-.619.622v1.762a.62.62 0 0 0 .62.623h11.935a.62.62 0 0 0 .619-.623v-1.762a.62.62 0 0 0-.619-.622Zm-.004 5.19H91.606a.62.62 0 0 0-.619.622v1.763a.62.62 0 0 0 .62.622h11.935a.62.62 0 0 0 .619-.622v-1.763a.62.62 0 0 0-.619-.622ZM55.773 64.004c4.349 0 7.874-5.285 7.874-11.804s-3.525-11.804-7.874-11.804-7.875 5.285-7.875 11.804c0 6.52 3.526 11.804 7.875 11.804Zm84.17.015c4.349 0 7.874-5.285 7.874-11.804 0-6.52-3.525-11.804-7.874-11.804s-7.875 5.285-7.875 11.804 3.526 11.804 7.875 11.804Z",
4789
+ fill: "#3690EA"
4790
+ }), /*#__PURE__*/React.createElement("path", {
4791
+ d: "M97.962 29.036c7.273 0 13.17-2.224 13.17-4.967 0-2.743-5.897-4.966-13.17-4.966-7.274 0-13.17 2.223-13.17 4.966 0 2.743 5.896 4.967 13.17 4.967Z",
4792
+ fill: "#B3B3B3"
4793
+ }), /*#__PURE__*/React.createElement("path", {
4794
+ d: "M97.962 16.55c4.545 0 8.23-3.705 8.23-8.275S102.507 0 97.962 0c-4.546 0-8.23 3.705-8.23 8.275s3.684 8.275 8.23 8.275Z",
4795
+ fill: "#3690EA"
4796
+ }), /*#__PURE__*/React.createElement("path", {
4797
+ d: "M141.607 59.283V45.147a19.038 19.038 0 0 0-3.687-11.301 18.872 18.872 0 0 0-9.653-6.874c-8.838-2.69-19.203-4.24-30.29-4.244-11.088-.004-21.452 1.546-30.29 4.233a18.871 18.871 0 0 0-9.668 6.866 19.041 19.041 0 0 0-3.699 11.305v14.132a19.03 19.03 0 0 0 3.685 11.303 18.86 18.86 0 0 0 9.656 6.872c8.841 2.694 19.206 4.244 30.29 4.244 11.083 0 21.452-1.542 30.294-4.233a18.858 18.858 0 0 0 9.666-6.863 19.028 19.028 0 0 0 3.696-11.304Z",
4798
+ fill: "#F2F2F2"
4799
+ }), /*#__PURE__*/React.createElement("path", {
4800
+ d: "M97.954 75.051c-10.068 0-19.88-1.371-28.381-3.957a12.353 12.353 0 0 1-6.262-4.485 12.463 12.463 0 0 1-2.41-7.34V45.131c.006-2.642.85-5.214 2.411-7.34a12.345 12.345 0 0 1 6.264-4.482c8.501-2.586 18.317-3.95 28.382-3.95 10.065 0 19.877 1.371 28.382 3.96a12.35 12.35 0 0 1 6.262 4.486 12.46 12.46 0 0 1 2.409 7.34V59.28a12.453 12.453 0 0 1-2.41 7.341 12.343 12.343 0 0 1-6.265 4.482c-8.486 2.585-18.317 3.949-28.382 3.949Z",
4801
+ fill: "#E6E6E6"
4802
+ }), /*#__PURE__*/React.createElement("path", {
4803
+ d: "M100.863 15.992h-5.81v1.293h5.81v-1.293Z",
4804
+ fill: "#F2F2F2"
4805
+ }), /*#__PURE__*/React.createElement("path", {
4806
+ d: "M76.472 66.05c4.327 0 7.834-6.2 7.834-13.846 0-7.647-3.507-13.846-7.834-13.846-4.326 0-7.833 6.2-7.833 13.846s3.507 13.845 7.833 13.845Z",
4807
+ fill: "#1A1A1A"
4808
+ }), /*#__PURE__*/React.createElement("path", {
4809
+ d: "M77.844 52.766c1.743 0 3.157-2.088 3.157-4.664 0-2.577-1.414-4.665-3.157-4.665-1.744 0-3.157 2.088-3.157 4.665 0 2.576 1.413 4.664 3.157 4.664Z",
4810
+ fill: "#fff"
4811
+ }), /*#__PURE__*/React.createElement("path", {
4812
+ d: "M118.662 66.057c4.326 0 7.834-6.2 7.834-13.846s-3.508-13.845-7.834-13.845c-4.327 0-7.834 6.199-7.834 13.845 0 7.647 3.507 13.846 7.834 13.846Z",
4813
+ fill: "#1A1A1A"
4814
+ }), /*#__PURE__*/React.createElement("path", {
4815
+ d: "M120.032 52.774c1.744 0 3.157-2.089 3.157-4.665s-1.413-4.665-3.157-4.665c-1.743 0-3.157 2.089-3.157 4.665s1.414 4.665 3.157 4.665Z",
4816
+ fill: "#fff"
4817
+ }), /*#__PURE__*/React.createElement("path", {
4818
+ d: "M92.674 63.11a10.286 10.286 0 0 0 7.949 1.095 13.2 13.2 0 0 0 2.623-1.118.738.738 0 0 1 1.035.639.748.748 0 0 1-.119.453c-2.224 2.82-6.474 3.625-9.672 2.12a7.284 7.284 0 0 1-2.75-2.12.748.748 0 0 1 .465-1.139.738.738 0 0 1 .469.054v.015Z",
4819
+ fill: "#999"
4820
+ }), /*#__PURE__*/React.createElement("path", {
4821
+ d: "M55.773 64.004c4.349 0 7.874-5.285 7.874-11.804s-3.525-11.804-7.874-11.804-7.875 5.285-7.875 11.804c0 6.52 3.526 11.804 7.875 11.804Zm84.17.015c4.349 0 7.874-5.285 7.874-11.804 0-6.52-3.525-11.804-7.874-11.804s-7.875 5.285-7.875 11.804 3.526 11.804 7.875 11.804Z",
4822
+ fill: "#3690EA"
4823
+ }), /*#__PURE__*/React.createElement("path", {
4824
+ d: "M95.008 14.315c-.115-.488 6.548-.932 5.815.246v.771c0 .745.033 1.51.037 2.262.003.752.033 1.594.04 2.392.282.592-6.474.935-5.818-.116v-.67c-.014-1.629-.055-3.257-.074-4.885Z",
4825
+ fill: "#F2F2F2"
4826
+ }), /*#__PURE__*/React.createElement("path", {
4827
+ d: "M97.962 29.036c7.273 0 13.17-2.224 13.17-4.967 0-2.743-5.897-4.966-13.17-4.966-7.274 0-13.17 2.223-13.17 4.966 0 2.743 5.896 4.967 13.17 4.967Z",
4828
+ fill: "#B3B3B3"
4829
+ }), /*#__PURE__*/React.createElement("path", {
4830
+ d: "M97.962 16.55c4.545 0 8.23-3.705 8.23-8.275S102.507 0 97.962 0c-4.546 0-8.23 3.705-8.23 8.275s3.684 8.275 8.23 8.275Z",
4831
+ fill: "#3690EA"
4832
+ }), /*#__PURE__*/React.createElement("path", {
4833
+ d: "M141.607 59.283V45.147a19.038 19.038 0 0 0-3.687-11.301 18.872 18.872 0 0 0-9.653-6.874c-8.838-2.69-19.203-4.24-30.29-4.244-11.088-.004-21.452 1.546-30.29 4.233a18.871 18.871 0 0 0-9.668 6.866 19.041 19.041 0 0 0-3.699 11.305v14.132a19.03 19.03 0 0 0 3.685 11.303 18.86 18.86 0 0 0 9.656 6.872c8.841 2.694 19.206 4.244 30.29 4.244 11.083 0 21.452-1.542 30.294-4.233a18.858 18.858 0 0 0 9.666-6.863 19.028 19.028 0 0 0 3.696-11.304Z",
4834
+ fill: "#F2F2F2"
4835
+ }), /*#__PURE__*/React.createElement("path", {
4836
+ d: "M97.954 75.051c-10.068 0-19.88-1.371-28.381-3.957a12.353 12.353 0 0 1-6.262-4.485 12.463 12.463 0 0 1-2.41-7.34V45.131c.006-2.642.85-5.214 2.411-7.34a12.345 12.345 0 0 1 6.264-4.482c8.501-2.586 18.317-3.95 28.382-3.95 10.065 0 19.877 1.371 28.382 3.96a12.35 12.35 0 0 1 6.262 4.486 12.46 12.46 0 0 1 2.409 7.34V59.28a12.453 12.453 0 0 1-2.41 7.341 12.343 12.343 0 0 1-6.265 4.482c-8.486 2.585-18.317 3.949-28.382 3.949Zm2.909-59.059h-5.81v1.293h5.81v-1.293Z",
4837
+ fill: "#E6E6E6"
4838
+ }), /*#__PURE__*/React.createElement("path", {
4839
+ d: "M76.472 66.05c4.327 0 7.834-6.2 7.834-13.846 0-7.647-3.507-13.846-7.834-13.846-4.326 0-7.833 6.2-7.833 13.846s3.507 13.845 7.833 13.845Z",
4840
+ fill: "#1A1A1A"
4841
+ }), /*#__PURE__*/React.createElement("path", {
4842
+ d: "M77.844 52.766c1.743 0 3.157-2.088 3.157-4.664 0-2.577-1.414-4.665-3.157-4.665-1.744 0-3.157 2.088-3.157 4.665 0 2.576 1.413 4.664 3.157 4.664Z",
4843
+ fill: "#fff"
4844
+ }), /*#__PURE__*/React.createElement("path", {
4845
+ d: "M118.662 66.057c4.326 0 7.834-6.2 7.834-13.846s-3.508-13.845-7.834-13.845c-4.327 0-7.834 6.199-7.834 13.845 0 7.647 3.507 13.846 7.834 13.846Z",
4846
+ fill: "#1A1A1A"
4847
+ }), /*#__PURE__*/React.createElement("path", {
4848
+ d: "M120.032 52.774c1.744 0 3.157-2.089 3.157-4.665s-1.413-4.665-3.157-4.665c-1.743 0-3.157 2.089-3.157 4.665s1.414 4.665 3.157 4.665Z",
4849
+ fill: "#fff"
4850
+ }), /*#__PURE__*/React.createElement("path", {
4851
+ d: "M92.674 63.11a10.286 10.286 0 0 0 7.949 1.095 13.2 13.2 0 0 0 2.623-1.118.738.738 0 0 1 1.035.639.748.748 0 0 1-.119.453c-2.224 2.82-6.474 3.625-9.672 2.12a7.284 7.284 0 0 1-2.75-2.12.748.748 0 0 1 .465-1.139.738.738 0 0 1 .469.054v.015Z",
4852
+ fill: "#999"
4853
+ }), /*#__PURE__*/React.createElement("path", {
4854
+ d: "M101.117 9.562a3.035 3.035 0 0 0 3.027-3.043 3.035 3.035 0 0 0-3.027-3.043A3.035 3.035 0 0 0 98.09 6.52a3.035 3.035 0 0 0 3.027 3.043ZM51.578 54.84c.801 0 1.45-1.64 1.45-3.66 0-2.023-.649-3.662-1.45-3.662-.802 0-1.451 1.64-1.451 3.661 0 2.022.65 3.66 1.45 3.66Zm93.429 0c.802 0 1.451-1.64 1.451-3.66 0-2.023-.649-3.662-1.451-3.662-.801 0-1.45 1.64-1.45 3.661 0 2.022.649 3.66 1.45 3.66Z",
4855
+ fill: "#4BAAF7"
4856
+ }), /*#__PURE__*/React.createElement("g", {
4857
+ clipPath: `url(#${id}-b)`
4858
+ }, /*#__PURE__*/React.createElement("path", {
4859
+ d: "M52.39 160.841h-2.919a1.774 1.774 0 0 1-1.766-1.782v-7.334h9.035l-2.677 7.911a1.766 1.766 0 0 1-1.671 1.206l-.001-.001Zm91.774 0h2.919c.977 0 1.767-.799 1.767-1.782v-7.334h-9.036l2.677 7.911a1.767 1.767 0 0 0 1.672 1.206l.001-.001Z",
4860
+ fill: "#6D4932"
4861
+ }), /*#__PURE__*/React.createElement("path", {
4862
+ d: "M163.181 108.015H33.375c-2.37 0-4.291 1.479-4.291 3.305v2.216c0 1.825 1.921 3.305 4.29 3.305h129.807c2.369 0 4.29-1.48 4.29-3.305v-2.216c0-1.826-1.921-3.305-4.29-3.305Z",
4863
+ fill: "#A87B5D"
4864
+ }), /*#__PURE__*/React.createElement("path", {
4865
+ d: "M38.282 116.841h119.992v33.16c0 1.648-1.554 2.985-3.469 2.985H41.752c-1.915 0-3.468-1.337-3.468-2.985v-33.16h-.002Z",
4866
+ fill: "#916A50"
4867
+ }), /*#__PURE__*/React.createElement("path", {
4868
+ opacity: ".3",
4869
+ d: "M131.002 109.794h-97.18a.996.996 0 0 0-.992 1.001c0 .552.444 1 .992 1h97.18a.996.996 0 0 0 .991-1 .996.996 0 0 0-.991-1.001Zm30.849 0h-24.24a.996.996 0 0 0-.992 1.001c0 .552.444 1 .992 1h24.24a.996.996 0 0 0 .992-1 .996.996 0 0 0-.992-1.001Z",
4870
+ fill: "#D4B097"
4871
+ })), /*#__PURE__*/React.createElement("g", {
4872
+ clipPath: `url(#${id}-c)`
4873
+ }, /*#__PURE__*/React.createElement("path", {
4874
+ d: "M151.367 97.536h2.894c1.6 0 2.895 1.307 2.895 2.913a2.906 2.906 0 0 1-2.895 2.914h-2.894v-5.827Z",
4875
+ strokeWidth: "6",
4876
+ strokeMiterlimit: "10",
4877
+ stroke: `url(#${id}-d)`
4878
+ }), /*#__PURE__*/React.createElement("path", {
4879
+ d: "M135.876 93.304h17.017a.6.6 0 0 1 .597.602v10.166c0 1.942-1.566 3.522-3.499 3.522h-11.214c-1.933 0-3.499-1.58-3.499-3.522V93.906a.6.6 0 0 1 .598-.602Z",
4880
+ fill: `url(#${id}-e)`
4881
+ })), /*#__PURE__*/React.createElement("path", {
4882
+ d: "m37.492 78.174 38.863-6.725a3.453 3.453 0 0 1 3.455 3.45v30.087H34.04V81.623a3.452 3.452 0 0 1 3.452-3.45Z",
4883
+ fill: `url(#${id}-f)`
4884
+ }), /*#__PURE__*/React.createElement("path", {
4885
+ d: "M34.1 108.015v-3.363h57.697v3.363H34.1Z",
4886
+ fill: `url(#${id}-g)`
4887
+ }), /*#__PURE__*/React.createElement("path", {
4888
+ d: "M79.673 108.015v-3.363h12.124v3.363H79.673Z",
4889
+ fill: `url(#${id}-h)`
4890
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
4891
+ id: `${id}-d`,
4892
+ x1: "150.254",
4893
+ y1: "100.449",
4894
+ x2: "158.273",
4895
+ y2: "100.449",
4896
+ gradientUnits: "userSpaceOnUse"
4897
+ }, /*#__PURE__*/React.createElement("stop", {
4898
+ stopColor: "#FEFEFE"
4899
+ }), /*#__PURE__*/React.createElement("stop", {
4900
+ offset: "1",
4901
+ stopColor: "#fff"
4902
+ })), /*#__PURE__*/React.createElement("linearGradient", {
4903
+ id: `${id}-e`,
4904
+ x1: "132.629",
4905
+ y1: "100.449",
4906
+ x2: "155.32",
4907
+ y2: "100.449",
4908
+ gradientUnits: "userSpaceOnUse"
4909
+ }, /*#__PURE__*/React.createElement("stop", {
4910
+ stopColor: "#FEFEFE"
4911
+ }), /*#__PURE__*/React.createElement("stop", {
4912
+ offset: "1",
4913
+ stopColor: "#F3F3F3"
4914
+ })), /*#__PURE__*/React.createElement("linearGradient", {
4915
+ id: `${id}-f`,
4916
+ x1: "56.925",
4917
+ y1: "45.291",
4918
+ x2: "56.925",
4919
+ y2: "93.076",
4920
+ gradientUnits: "userSpaceOnUse"
4921
+ }, /*#__PURE__*/React.createElement("stop", {
4922
+ stopColor: "#FEFEFE"
4923
+ }), /*#__PURE__*/React.createElement("stop", {
4924
+ offset: "1",
4925
+ stopColor: "#D1D6E7"
4926
+ })), /*#__PURE__*/React.createElement("linearGradient", {
4927
+ id: `${id}-g`,
4928
+ x1: "62.684",
4929
+ y1: "108.015",
4930
+ x2: "62.684",
4931
+ y2: "104.85",
4932
+ gradientUnits: "userSpaceOnUse"
4933
+ }, /*#__PURE__*/React.createElement("stop", {
4934
+ stopColor: "#D2D6E8"
4935
+ }), /*#__PURE__*/React.createElement("stop", {
4936
+ offset: ".726",
4937
+ stopColor: "#D1D6E7"
4938
+ })), /*#__PURE__*/React.createElement("linearGradient", {
4939
+ id: `${id}-h`,
4940
+ x1: "85.68",
4941
+ y1: "108.015",
4942
+ x2: "85.68",
4943
+ y2: "104.85",
4944
+ gradientUnits: "userSpaceOnUse"
4945
+ }, /*#__PURE__*/React.createElement("stop", {
4946
+ stopColor: "#D8DDF1"
4947
+ }), /*#__PURE__*/React.createElement("stop", {
4948
+ offset: ".726",
4949
+ stopColor: "#E2E6F6"
4950
+ })), /*#__PURE__*/React.createElement("clipPath", {
4951
+ id: `${id}-a`
4952
+ }, /*#__PURE__*/React.createElement("path", {
4953
+ fill: "#fff",
4954
+ transform: "translate(12.006)",
4955
+ d: "M0 0h172v174H0z"
4956
+ })), /*#__PURE__*/React.createElement("clipPath", {
4957
+ id: `${id}-b`
4958
+ }, /*#__PURE__*/React.createElement("path", {
4959
+ fill: "#fff",
4960
+ transform: "translate(29.084 105.073)",
4961
+ d: "M0 0h138.387v68.927H0z"
4962
+ })), /*#__PURE__*/React.createElement("clipPath", {
4963
+ id: `${id}-c`
4964
+ }, /*#__PURE__*/React.createElement("path", {
4965
+ fill: "#fff",
4966
+ transform: "translate(135.278 93.304)",
4967
+ d: "M0 0h22.995v14.29H0z"
4968
+ }))));
4969
+ }
4970
+
4971
+ var styles$f = {"blank_state":"blank_state-wMOWN","image":"image-uy0Fd"};
4972
+
4973
+ function BlankState$1({
4974
+ image,
4975
+ role,
4976
+ subtitle,
4977
+ title
4978
+ }) {
4979
+ return /*#__PURE__*/React.createElement(tapestry.Flex, {
4980
+ role: role,
4981
+ className: styles$f.blank_state,
4982
+ direction: "column",
4983
+ align: "center",
4984
+ gap: 3
4985
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4986
+ className: styles$f.image
4987
+ }, image), /*#__PURE__*/React.createElement(tapestry.Flex, {
4988
+ direction: "column",
4989
+ align: "center",
4990
+ gap: 1
4991
+ }, /*#__PURE__*/React.createElement("h2", null, title), /*#__PURE__*/React.createElement("p", null, subtitle)));
4992
+ }
4213
4993
 
4214
4994
  function EndOfResultsObserver({
4215
4995
  onVisible
@@ -4229,39 +5009,98 @@ function EndOfResultsObserver({
4229
5009
 
4230
5010
  const resultId = (listboxId, index) => `${listboxId}-result-${index}`;
4231
5011
 
4232
- var styles$c = {"result":"result-Thq2C"};
5012
+ var styles$e = {"result":"result-Thq2C","title":"title-KYUEn","subtitle":"subtitle-R2haq","image":"image-KVDor","avatar":"avatar-6Gh62","photo":"photo-FZR3Q","badge":"badge-trUKt"};
4233
5013
 
4234
5014
  function SearchResult({
5015
+ category,
5016
+ describedBy,
4235
5017
  highlighted,
4236
5018
  id,
5019
+ imageUrl,
4237
5020
  onHighlight,
5021
+ product,
4238
5022
  subtitle,
4239
5023
  title,
4240
5024
  url
4241
5025
  }) {
4242
5026
  const ref = React.useRef(null);
5027
+ // A hovered result is already under the pointer, and scrolling it clear of
5028
+ // the panel's scroll padding would slide the list out from under the mouse.
5029
+ const highlightedByPointer = React.useRef(false);
4243
5030
  React.useEffect(() => {
4244
5031
  var _a;
4245
- if (highlighted) (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
4246
- block: "nearest"
4247
- });
5032
+ if (!highlighted) return;
5033
+ if (highlightedByPointer.current) {
5034
+ highlightedByPointer.current = false;
5035
+ } else {
5036
+ (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
5037
+ block: "nearest"
5038
+ });
5039
+ }
4248
5040
  }, [highlighted]);
5041
+ const highlightFromPointer = () => {
5042
+ if (highlighted) return;
5043
+ highlightedByPointer.current = true;
5044
+ onHighlight();
5045
+ };
4249
5046
  // Focus stays in the search input, which points at the highlighted result
4250
5047
  // with aria-activedescendant, so results are kept out of the tab order.
4251
5048
  // Mouse move rather than enter: arrowing scrolls results under a resting
4252
5049
  // pointer, and that shouldn't steal the highlight.
4253
- return /*#__PURE__*/React.createElement("a", {
4254
- "aria-selected": highlighted,
4255
- className: styles$c.result,
4256
- href: url,
4257
- id: id,
4258
- onMouseMove: onHighlight,
4259
- ref: ref,
4260
- role: "option",
4261
- tabIndex: -1
4262
- }, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", null, subtitle));
5050
+ return (
5051
+ /*#__PURE__*/
5052
+ // Named by the title alone, so screen readers say "Ada Lovelace" rather
5053
+ // than the whole row. The section and subtitle are read after a pause.
5054
+ React.createElement("a", {
5055
+ "aria-describedby": [describedBy, subtitle && `${id}-subtitle`].filter(Boolean).join(" ") || undefined,
5056
+ "aria-labelledby": title ? `${id}-title` : undefined,
5057
+ "aria-selected": highlighted,
5058
+ className: styles$e.result,
5059
+ href: url,
5060
+ id: id,
5061
+ onMouseMove: highlightFromPointer,
5062
+ ref: ref,
5063
+ role: "option",
5064
+ tabIndex: -1
5065
+ }, /*#__PURE__*/React.createElement(ResultImage, {
5066
+ category: category,
5067
+ imageUrl: imageUrl,
5068
+ product: product
5069
+ }), /*#__PURE__*/React.createElement("span", {
5070
+ className: styles$e.title,
5071
+ id: `${id}-title`
5072
+ }, title), /*#__PURE__*/React.createElement("span", {
5073
+ className: styles$e.subtitle,
5074
+ id: `${id}-subtitle`
5075
+ }, subtitle))
5076
+ );
5077
+ }
5078
+ // A person's photo or the result's own image, badged with its product, or
5079
+ // just the product's logomark when there's no image.
5080
+ function ResultImage({
5081
+ category,
5082
+ imageUrl,
5083
+ product
5084
+ }) {
5085
+ const icon = size => isProductIconSlug(product) ? (/*#__PURE__*/React.createElement(ProductIcon, {
5086
+ size: size,
5087
+ slug: product
5088
+ })) : null;
5089
+ return /*#__PURE__*/React.createElement("span", {
5090
+ "aria-hidden": true,
5091
+ className: styles$e.image
5092
+ }, imageUrl ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
5093
+ alt: "",
5094
+ className: category === "profile" ? styles$e.avatar : styles$e.photo,
5095
+ loading: "lazy",
5096
+ src: imageUrl
5097
+ }), /*#__PURE__*/React.createElement("span", {
5098
+ className: styles$e.badge
5099
+ }, icon(16)))) : icon("100%"));
4263
5100
  }
4264
5101
 
5102
+ var styles$d = {"message":"message-1-PP-","heading":"heading-LioUF","group":"group-cKChg"};
5103
+
4265
5104
  // Sections with a heading render as labelled groups; ones without render
4266
5105
  // their items straight into the listbox. Indexes run across every section.
4267
5106
  function ResultListbox({
@@ -4274,13 +5113,19 @@ function ResultListbox({
4274
5113
  sections
4275
5114
  }) {
4276
5115
  let index = 0;
4277
- const renderItem = item => {
5116
+ // With aria-activedescendant, screen readers don't reliably announce the
5117
+ // group a highlighted option is in, so each option names its heading too.
5118
+ const renderItem = (item, headingId) => {
4278
5119
  const itemIndex = index++;
4279
5120
  return /*#__PURE__*/React.createElement(SearchResult, {
5121
+ category: item.category,
5122
+ describedBy: headingId,
4280
5123
  highlighted: itemIndex === highlightedIndex,
4281
5124
  id: resultId(id, itemIndex),
5125
+ imageUrl: item.imageUrl,
4282
5126
  key: item.key,
4283
5127
  onHighlight: () => onHighlight(itemIndex),
5128
+ product: item.product,
4284
5129
  subtitle: item.subtitle,
4285
5130
  title: item.title,
4286
5131
  url: item.url
@@ -4296,16 +5141,18 @@ function ResultListbox({
4296
5141
  if (section.heading === undefined) {
4297
5142
  return /*#__PURE__*/React.createElement(React.Fragment, {
4298
5143
  key: section.key
4299
- }, section.items.map(renderItem));
5144
+ }, section.items.map(item => renderItem(item)));
4300
5145
  }
4301
5146
  const headingId = `${id}-group-${sectionIndex}`;
4302
5147
  return /*#__PURE__*/React.createElement("div", {
4303
5148
  "aria-labelledby": headingId,
5149
+ className: styles$d.group,
4304
5150
  key: section.key,
4305
5151
  role: "group"
4306
5152
  }, /*#__PURE__*/React.createElement("div", {
5153
+ className: styles$d.heading,
4307
5154
  id: headingId
4308
- }, section.heading), section.items.map(renderItem));
5155
+ }, section.heading), section.items.map(item => renderItem(item, headingId)));
4309
5156
  }));
4310
5157
  }
4311
5158
 
@@ -4319,9 +5166,14 @@ function RecentlyVisited({
4319
5166
  }) {
4320
5167
  const headingId = `${navigation.id}-heading`;
4321
5168
  if (items.length === 0 && !hasMore && !loading) {
4322
- return /*#__PURE__*/React.createElement("p", null, "Pages you visit will show up here.");
5169
+ return /*#__PURE__*/React.createElement(BlankState$1, {
5170
+ image: /*#__PURE__*/React.createElement(BlankStateRecentlyVisited, null),
5171
+ subtitle: "Pages you visit will show up here.",
5172
+ title: "Recently visited"
5173
+ });
4323
5174
  } else {
4324
5175
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5176
+ className: styles$d.heading,
4325
5177
  id: headingId
4326
5178
  }, "Recently visited"), /*#__PURE__*/React.createElement(ResultListbox, {
4327
5179
  labelledBy: headingId,
@@ -4337,6 +5189,8 @@ function RecentlyVisited({
4337
5189
  }
4338
5190
  }
4339
5191
 
5192
+ var styles$c = {"row":"row-5P7UQ","header":"header-sXEyG","closeButton":"closeButton-rPJJV","input":"input-YQkTC","clearButton":"clearButton-9Yh9w"};
5193
+
4340
5194
  // A combobox: focus stays here while aria-activedescendant points screen
4341
5195
  // readers at the highlighted result in the listbox it controls.
4342
5196
  function SearchInput({
@@ -4345,29 +5199,267 @@ function SearchInput({
4345
5199
  inputRef,
4346
5200
  listboxId,
4347
5201
  onChange,
5202
+ onClose,
4348
5203
  onFocus,
4349
5204
  onKeyDown,
4350
5205
  value
4351
5206
  }) {
4352
- return /*#__PURE__*/React.createElement("input", {
5207
+ const {
5208
+ focusProps
5209
+ } = useKeyboardFocus({
5210
+ onFocus: (event, keyboard) => {
5211
+ // Tabbing in selects the whole term, which the next keystroke would
5212
+ // replace. Put the cursor after it instead, to keep typing. The
5213
+ // browser selects after the focus event, so this waits a frame and
5214
+ // only undoes that select-all: typing on the tabs moves focus here by
5215
+ // script, which keeps the cursor, and the keystroke may already be in.
5216
+ if (keyboard) {
5217
+ const input = event.currentTarget;
5218
+ requestAnimationFrame(() => {
5219
+ const length = input.value.length;
5220
+ const selectedAll = length > 0 && input.selectionStart === 0 && input.selectionEnd === length;
5221
+ if (document.activeElement !== input || !selectedAll) return;
5222
+ input.setSelectionRange(length, length);
5223
+ });
5224
+ }
5225
+ onFocus();
5226
+ }
5227
+ });
5228
+ return /*#__PURE__*/React.createElement("div", {
5229
+ className: styles$c.row
5230
+ }, /*#__PURE__*/React.createElement("label", {
5231
+ className: styles$c.header
5232
+ }, /*#__PURE__*/React.createElement(Icon, {
5233
+ name: "general.search",
5234
+ size: 20,
5235
+ theme: "--t-icon-color-dim"
5236
+ }), /*#__PURE__*/React.createElement("input", {
4353
5237
  "aria-activedescendant": highlightedIndex === null ? undefined : resultId(listboxId, highlightedIndex),
4354
5238
  "aria-autocomplete": "list",
4355
5239
  "aria-controls": expanded ? listboxId : undefined,
4356
5240
  "aria-expanded": expanded,
4357
5241
  "aria-label": "Search",
4358
5242
  autoFocus: true,
5243
+ className: styles$c.input,
5244
+ id: "product_search",
4359
5245
  onChange: event => onChange(event.target.value),
4360
- onFocus: onFocus,
4361
5246
  onKeyDown: onKeyDown,
4362
5247
  placeholder: "Search",
4363
5248
  ref: inputRef,
4364
5249
  role: "combobox",
4365
5250
  type: "search",
4366
- value: value
4367
- });
5251
+ value: value,
5252
+ ...focusProps
5253
+ }), !onClose && value !== "" && (/*#__PURE__*/React.createElement("button", {
5254
+ "aria-label": "Clear search",
5255
+ className: styles$c.clearButton,
5256
+ onClick: () => {
5257
+ var _a;
5258
+ onChange("");
5259
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
5260
+ },
5261
+ tabIndex: -1,
5262
+ type: "button"
5263
+ }, /*#__PURE__*/React.createElement(Icon, {
5264
+ name: "general.smallX"
5265
+ })))), onClose && (/*#__PURE__*/React.createElement(tapestry.IconButton, {
5266
+ "aria-label": "Close search",
5267
+ className: styles$c.closeButton,
5268
+ icon: /*#__PURE__*/React.createElement(Icon, {
5269
+ name: "general.x",
5270
+ theme: "--t-icon-color-dim"
5271
+ }),
5272
+ kind: "ghost",
5273
+ onClick: onClose,
5274
+ size: "md"
5275
+ })));
5276
+ }
5277
+
5278
+ function BlankStateNoResults(props) {
5279
+ const id = useInstanceId("blank-state-no-results");
5280
+ return /*#__PURE__*/React.createElement("svg", {
5281
+ viewBox: "0 0 197 152",
5282
+ fill: "none",
5283
+ "aria-hidden": "true",
5284
+ focusable: "false",
5285
+ ...props
5286
+ }, /*#__PURE__*/React.createElement("path", {
5287
+ d: "M139.863 19.971C150.801 30 161.64 40.126 172.775 50.055c8.376 7.374 21.975 15.829 23.157 28.02.592 6.095-2.167 11.994-5.321 17.205-24.635 40.8-81.098 67.148-127.412 48.862C32.553 132.049-12.973 96.754 3.483 59.1 19.348 22.724 68.323 4.044 87.44 1.39c21.876-4.62 34.883 2.458 52.423 18.581Z",
5288
+ fill: "currentColor"
5289
+ }), /*#__PURE__*/React.createElement("path", {
5290
+ d: "M94.382 27.326c4.859 0 8.797-3.932 8.797-8.783 0-4.85-3.938-8.783-8.797-8.783-4.858 0-8.796 3.933-8.796 8.783 0 4.851 3.938 8.783 8.796 8.783Z",
5291
+ fill: "#3690EA"
5292
+ }), /*#__PURE__*/React.createElement("path", {
5293
+ d: "M97.481 19.861a3.22 3.22 0 0 0 3.222-3.217 3.22 3.22 0 0 0-3.222-3.217 3.22 3.22 0 0 0-3.222 3.217 3.22 3.22 0 0 0 3.222 3.217Z",
5294
+ fill: "#4BAAF7"
5295
+ }), /*#__PURE__*/React.createElement("path", {
5296
+ d: "M97.564 26.688h-6.248v3.565h6.248v-3.565Z",
5297
+ fill: "#F2F2F2"
5298
+ }), /*#__PURE__*/React.createElement("path", {
5299
+ d: "M49.297 77.706c4.649 0 8.417-5.61 8.417-12.53 0-6.921-3.768-12.531-8.417-12.531s-8.417 5.61-8.417 12.53c0 6.92 3.768 12.531 8.417 12.531Zm89.958 0c4.649 0 8.417-5.61 8.417-12.53 0-6.921-3.768-12.531-8.417-12.531s-8.417 5.61-8.417 12.53c0 6.92 3.768 12.531 8.417 12.531Z",
5300
+ fill: "#3690EA"
5301
+ }), /*#__PURE__*/React.createElement("path", {
5302
+ d: "M94.379 40.574c7.774 0 14.076-2.36 14.076-5.271 0-2.912-6.302-5.272-14.076-5.272-7.774 0-14.076 2.36-14.076 5.272 0 2.911 6.302 5.271 14.076 5.271Z",
5303
+ fill: "#B3B3B3"
5304
+ }), /*#__PURE__*/React.createElement("path", {
5305
+ d: "M141.036 72.671V57.672a20.118 20.118 0 0 0-3.949-12 20.166 20.166 0 0 0-10.333-7.29c-9.448-2.852-20.529-4.497-32.379-4.497-11.849 0-22.926 1.645-32.374 4.497a20.167 20.167 0 0 0-10.331 7.29 20.117 20.117 0 0 0-3.95 12v15a20.112 20.112 0 0 0 3.949 12A20.163 20.163 0 0 0 62 91.962c9.448 2.856 20.53 4.496 32.375 4.496 11.844 0 22.93-1.64 32.378-4.496a20.153 20.153 0 0 0 10.333-7.289 20.107 20.107 0 0 0 3.949-12.002Z",
5306
+ fill: "#F2F2F2"
5307
+ }), /*#__PURE__*/React.createElement("path", {
5308
+ d: "M94.387 89.422c-10.76 0-21.248-1.448-30.348-4.193a13.19 13.19 0 0 1-6.698-4.759 13.159 13.159 0 0 1-2.576-7.794v-15a13.163 13.163 0 0 1 2.577-7.793 13.196 13.196 0 0 1 6.697-4.76c9.082-2.744 19.574-4.193 30.348-4.193 10.773 0 21.248 1.449 30.348 4.194a13.2 13.2 0 0 1 6.701 4.757 13.17 13.17 0 0 1 2.582 7.795v15a13.164 13.164 0 0 1-2.577 7.794 13.195 13.195 0 0 1-6.697 4.759c-9.109 2.727-19.597 4.193-30.357 4.193Z",
5309
+ fill: "#E6E6E6"
5310
+ }), /*#__PURE__*/React.createElement("path", {
5311
+ d: "M71.426 79.868c4.624 0 8.373-6.58 8.373-14.696s-3.749-14.696-8.373-14.696c-4.624 0-8.372 6.58-8.372 14.696 0 8.117 3.748 14.697 8.372 14.697Z",
5312
+ fill: "#1A1A1A"
5313
+ }), /*#__PURE__*/React.createElement("path", {
5314
+ d: "M72.894 65.765c1.863 0 3.373-2.217 3.373-4.95 0-2.735-1.51-4.952-3.373-4.952-1.864 0-3.375 2.217-3.375 4.951 0 2.734 1.511 4.95 3.374 4.95Z",
5315
+ fill: "#fff"
5316
+ }), /*#__PURE__*/React.createElement("path", {
5317
+ d: "M116.517 79.868c4.624 0 8.373-6.58 8.373-14.696s-3.749-14.696-8.373-14.696c-4.624 0-8.372 6.58-8.372 14.696 0 8.117 3.748 14.697 8.372 14.697Z",
5318
+ fill: "#1A1A1A"
5319
+ }), /*#__PURE__*/React.createElement("path", {
5320
+ d: "M117.981 65.765c1.864 0 3.374-2.217 3.374-4.95 0-2.735-1.51-4.952-3.374-4.952-1.863 0-3.374 2.217-3.374 4.951 0 2.734 1.511 4.95 3.374 4.95Z",
5321
+ fill: "#fff"
5322
+ }), /*#__PURE__*/React.createElement("path", {
5323
+ d: "M100.012 80.196a14.156 14.156 0 0 0-2.785-1.159 10.598 10.598 0 0 0-5.713 0 14.09 14.09 0 0 0-2.78 1.159h-.027a.773.773 0 0 1-.973-1.159 8.74 8.74 0 0 1 6.639-3.049 8.754 8.754 0 0 1 6.638 3.05.773.773 0 0 1-.977 1.158h-.022Z",
5324
+ fill: "#999"
5325
+ }), /*#__PURE__*/React.createElement("path", {
5326
+ d: "M44.788 67.69c.853 0 1.545-1.731 1.545-3.867 0-2.137-.692-3.868-1.545-3.868-.852 0-1.544 1.731-1.544 3.867 0 2.137.691 3.868 1.544 3.868Zm99.38 0c.853 0 1.544-1.731 1.544-3.867 0-2.137-.691-3.868-1.544-3.868-.853 0-1.544 1.731-1.544 3.867 0 2.137.691 3.868 1.544 3.868Z",
5327
+ fill: "#4BAAF7"
5328
+ }), /*#__PURE__*/React.createElement("path", {
5329
+ d: "M79.596 106.857s-13.835 0-13.835-18.752",
5330
+ strokeWidth: "13.63",
5331
+ strokeMiterlimit: "10",
5332
+ strokeLinecap: "round",
5333
+ stroke: "#4D4D4D"
5334
+ }), /*#__PURE__*/React.createElement("path", {
5335
+ d: "M79.295 99.708h-.004a2.453 2.453 0 0 0-2.34 2.56l.353 7.781a2.453 2.453 0 0 0 2.564 2.337h.004a2.452 2.452 0 0 0 2.34-2.559l-.353-7.782a2.453 2.453 0 0 0-2.564-2.337Z",
5336
+ fill: "gray"
5337
+ }), /*#__PURE__*/React.createElement("path", {
5338
+ d: "M109.137 104.385s3.851 3.681 10.947-1.181",
5339
+ strokeWidth: "13.63",
5340
+ strokeMiterlimit: "10",
5341
+ strokeLinecap: "round",
5342
+ stroke: "#4D4D4D"
5343
+ }), /*#__PURE__*/React.createElement("path", {
5344
+ d: "m107.907 112.125.004.001a2.455 2.455 0 0 0 2.859-1.966l1.414-7.661a2.451 2.451 0 0 0-1.97-2.854h-.004a2.455 2.455 0 0 0-2.859 1.965l-1.413 7.661a2.45 2.45 0 0 0 1.969 2.854Z",
5345
+ fill: "gray"
5346
+ }), /*#__PURE__*/React.createElement("path", {
5347
+ d: "M89.494 121.176s-4.44 8.569-3.936 13.934",
5348
+ strokeWidth: "13.63",
5349
+ strokeMiterlimit: "10",
5350
+ strokeLinecap: "round",
5351
+ stroke: "#4D4D4D"
5352
+ }), /*#__PURE__*/React.createElement("path", {
5353
+ d: "M88.59 128.571c3.535 0 6.4-2.861 6.4-6.39a6.395 6.395 0 0 0-6.4-6.39 6.395 6.395 0 0 0-6.4 6.39 6.395 6.395 0 0 0 6.4 6.39Z",
5354
+ fill: "gray"
5355
+ }), /*#__PURE__*/React.createElement("path", {
5356
+ d: "M76.233 146.043h12.585v3.966a1.205 1.205 0 0 1-1.205 1.204H74.068a1.205 1.205 0 0 1-1.205-1.204v-.601a3.367 3.367 0 0 1 .989-2.378 3.38 3.38 0 0 1 2.38-.987Z",
5357
+ fill: "#333"
5358
+ }), /*#__PURE__*/React.createElement("path", {
5359
+ d: "M85.808 149.557s8.631.125 6.752-8.774c-1.878-8.899-13-16.291-16.263-6.434-3.262 9.857-1.499 16.166 9.511 15.208Z",
5360
+ fill: "#F2F2F2"
5361
+ }), /*#__PURE__*/React.createElement("path", {
5362
+ d: "M100.159 121.176s4.463 8.569 3.937 13.934",
5363
+ strokeWidth: "13.63",
5364
+ strokeMiterlimit: "10",
5365
+ strokeLinecap: "round",
5366
+ stroke: "#4D4D4D"
5367
+ }), /*#__PURE__*/React.createElement("path", {
5368
+ d: "M101.064 128.571c3.534 0 6.4-2.861 6.4-6.39 0-3.529-2.866-6.39-6.4-6.39a6.395 6.395 0 0 0-6.4 6.39 6.395 6.395 0 0 0 6.4 6.39Z",
5369
+ fill: "gray"
5370
+ }), /*#__PURE__*/React.createElement("path", {
5371
+ d: "M115.584 151.216h-13.545a1.206 1.206 0 0 1-1.205-1.203v-3.98h12.586a3.37 3.37 0 0 1 3.374 3.369v.602a1.21 1.21 0 0 1-.745 1.121 1.23 1.23 0 0 1-.465.091Z",
5372
+ fill: "#333"
5373
+ }), /*#__PURE__*/React.createElement("path", {
5374
+ d: "M103.838 149.557s-8.632.125-6.757-8.774c1.874-8.899 13.036-16.291 16.285-6.434 3.249 9.857 1.5 16.166-9.528 15.208Zm6.725-40.315c-.549-9.652-7.975-12.415-16.91-11.907-8.935.508-16.004 4.091-15.455 13.748.549 9.656 8.243 17.067 17.178 16.559 8.935-.508 15.736-8.743 15.187-18.4Z",
5375
+ fill: "#F2F2F2"
5376
+ }), /*#__PURE__*/React.createElement("path", {
5377
+ d: "M110.402 107.707c-1.129 7.958-7.271 14.228-15.027 14.665-8.39.477-15.683-6.034-16.995-14.821a15.77 15.77 0 0 0-.183 3.533c.549 9.652 8.239 17.067 17.178 16.559 8.939-.508 15.736-8.742 15.174-18.399a14.03 14.03 0 0 0-.147-1.537Z",
5378
+ fill: "#E6E6E6"
5379
+ }), /*#__PURE__*/React.createElement("path", {
5380
+ d: "M100.76 105.262H88a.66.66 0 0 0-.66.66v1.871c0 .365.296.66.66.66h12.76a.66.66 0 0 0 .66-.66v-1.871a.66.66 0 0 0-.66-.66Zm0 5.512H88a.66.66 0 0 0-.66.66v1.871c0 .364.296.66.66.66h12.76a.66.66 0 0 0 .66-.66v-1.871a.66.66 0 0 0-.66-.66Zm0 5.505H88a.66.66 0 0 0-.66.66v1.871c0 .364.296.66.66.66h12.76a.66.66 0 0 0 .66-.66v-1.871a.66.66 0 0 0-.66-.66Z",
5381
+ fill: "#3690EA"
5382
+ }), /*#__PURE__*/React.createElement("path", {
5383
+ d: "M133.43 107.146c5.688-4.463 7.529-11.6 4.111-15.943-3.417-4.343-10.799-4.245-16.487.218-5.688 4.463-7.529 11.601-4.111 15.943 3.417 4.343 10.799 4.245 16.487-.218Z",
5384
+ fill: "#F2F2F2"
5385
+ }), /*#__PURE__*/React.createElement("path", {
5386
+ d: "M136.74 95.34c-3.418-4.344-10.8-4.246-16.486.22a15.744 15.744 0 0 0-5.034 6.683c-.031-3.725 2.035-7.87 5.802-10.837 5.69-4.456 13.072-4.559 16.491-.218 1.972 2.508 2.182 5.953.919 9.273a8.246 8.246 0 0 0-1.692-5.12Z",
5387
+ fill: "#E6E6E6"
5388
+ }), /*#__PURE__*/React.createElement("path", {
5389
+ d: "M127.405 89.78c1.87.546 3.824.751 5.766.605v0a16.153 16.153 0 0 0 9.056-3.631",
5390
+ strokeWidth: "13.63",
5391
+ strokeMiterlimit: "10",
5392
+ strokeLinecap: "round",
5393
+ stroke: "#333"
5394
+ }), /*#__PURE__*/React.createElement("path", {
5395
+ d: "M79.875 85.766c2.25-7.476-.567-14.93-6.293-16.649-5.727-1.718-12.194 2.949-14.444 10.425-2.251 7.476.567 14.93 6.293 16.648 5.727 1.719 12.194-2.948 14.444-10.424Z",
5396
+ fill: "#F2F2F2"
5397
+ }), /*#__PURE__*/React.createElement("path", {
5398
+ d: "M69.713 71.558c5.726 1.72 8.542 9.175 6.293 16.652a16.978 16.978 0 0 1-4.74 7.687c3.767-1.435 7.141-5.151 8.627-10.12 2.232-7.477-.567-14.932-6.293-16.648-3.311-.993-6.863.152-9.706 2.736 1.85-.75 3.9-.858 5.82-.307Z",
5399
+ fill: "#E6E6E6"
5400
+ }), /*#__PURE__*/React.createElement("path", {
5401
+ d: "M77.006 68.04a6.195 6.195 0 0 1-4.269-1.866 6.176 6.176 0 0 1 0-8.623 6.195 6.195 0 0 1 4.27-1.867",
5402
+ strokeWidth: "13.63",
5403
+ strokeMiterlimit: "10",
5404
+ strokeLinecap: "round",
5405
+ stroke: "#333"
5406
+ }), /*#__PURE__*/React.createElement("path", {
5407
+ d: "M81.567 54.262c-.103.03-.205.07-.303.106l-.304.112-.303.111-.3.112-.303.111c-.103.031-.2.071-.303.111-.103.04-.201.072-.304.108l-.299.11-.303.112-.304.112c-.102.03-.2.071-.303.111l-.3.107-.303.111-.303.112-.304.111c-.098.031-.2.072-.299.112-.098.04-.205.07-.303.111-.099.04-.201.071-.304.107l-.299.111-.303.112a5.63 5.63 0 0 0-3.824 4.578 5.62 5.62 0 0 0 1.101 4.178 5.578 5.578 0 0 0 2.754 1.956l.303.112.304.111.308.112.303.11.304.112.303.112.304.111.303.112.308.111.304.111.303.112.304.111c.102.036.2.076.303.107l.308.116c.098.036.2.076.303.107.103.031.201.08.304.111.103.031.2.08.303.112.103.03.201.08.304.111.103.031.2.08.303.111.103.032.206.08.308.112a8.12 8.12 0 0 0 10.027-3.863 8.087 8.087 0 0 0-2.619-10.407 8.117 8.117 0 0 0-7.479-.88v.004Z",
5408
+ fill: "#2278D6"
5409
+ }), /*#__PURE__*/React.createElement("path", {
5410
+ d: "M97.105 47.237c-.192.062-.389.138-.58.21-.193.07-.393.142-.585.213-.192.072-.389.138-.585.214-.196.076-.388.138-.58.214-.192.076-.393.138-.585.214-.192.076-.388.138-.584.214-.197.076-.389.138-.585.214-.197.075-.388.138-.58.214-.192.075-.389.138-.585.213-.196.076-.388.139-.585.21-.196.071-.388.143-.58.214-.192.071-.392.138-.584.214-.192.075-.389.138-.585.214-.196.075-.388.138-.585.213-.196.076-.388.139-.58.214-.192.076-.393.139-.585.214-.191.076-.388.138-.584.214-.197.076-.389.138-.585.214-.196.076-.388.134-.58.21-.192.075-.388.138-.585.213a10.762 10.762 0 0 0-3.146 1.65 10.844 10.844 0 0 0-1.674 15.763 10.879 10.879 0 0 0 4.883 3.233c.196.075.388.151.589.213.2.063.388.152.585.214.196.063.392.152.589.219.196.067.388.147.584.214l.59.213c.196.076.388.152.589.214.2.063.388.152.584.214.197.063.388.152.59.214.2.063.388.152.584.219.196.066.388.147.59.213.2.067.387.148.584.214.196.067.388.147.589.214.2.067.388.152.584.214.197.063.393.152.59.214.196.062.388.151.584.218l.59.214c.196.072.388.147.584.214.196.067.393.147.59.214.196.067.387.151.588.214.201.062.388.151.585.214a15.669 15.669 0 0 0 14.439-1.806 15.624 15.624 0 0 0 6.706-12.895 15.597 15.597 0 0 0-1.829-7.256 15.659 15.659 0 0 0-19.454-7.244Z",
5411
+ fill: "#3690EA"
5412
+ }), /*#__PURE__*/React.createElement("path", {
5413
+ d: "M119.065 37.388a25.93 25.93 0 0 0-.978.356c-.326.125-.651.232-.977.357-.326.125-.652.232-.978.356-.325.125-.651.232-.977.361-.326.13-.652.232-.977.357-.326.125-.652.232-.978.356-.326.125-.656.232-.977.357-.322.125-.656.232-.978.36-.321.13-.651.228-.977.357-.326.13-.656.232-.977.357-.322.124-.656.231-.978.356-.321.125-.656.232-.977.357-.321.125-.656.231-.977.36-.322.13-.657.228-.978.357-.321.13-.656.232-.977.357-.322.124-.656.231-.978.356-.321.125-.656.232-.982.361-.325.13-.651.227-.977.357-.326.129-.651.227-.973.356-.321.13-.656.232-.982.357a18.217 18.217 0 0 0-7.281 4.523A18.158 18.158 0 0 0 90.716 72.8a18.097 18.097 0 0 0 8.926 6.314c.326.13.651.254.986.361.335.107.652.254.982.361.33.107.652.25.986.36.335.112.647.25.982.357.335.107.652.254.982.361.33.107.652.25.986.361.335.112.652.25.982.357.33.107.652.254.986.36.335.108.648.25.982.362.335.111.652.25.982.356.33.107.652.254.986.361.335.107.652.25.982.361.331.111.652.25.982.357.33.106.656.253.986.36.331.107.652.254.982.361.331.107.652.25.987.361.334.112.651.25.981.357.331.107.652.254.987.36.334.108.647.25.982.362.334.111.651.25.981.356a26.26 26.26 0 0 0 24.2-3.02 26.2 26.2 0 0 0 8.29-9.42 26.147 26.147 0 0 0-.114-24.35 26.194 26.194 0 0 0-8.377-9.343 26.244 26.244 0 0 0-24.226-2.795l-.022.009Z",
5414
+ fill: "#50B0FF"
5415
+ }), /*#__PURE__*/React.createElement("path", {
5416
+ d: "M128.994 80.692a18.926 18.926 0 0 1-11.736-4.091 18.853 18.853 0 0 1-5.352-22.825 18.889 18.889 0 0 1 8.696-8.867 18.93 18.93 0 0 1 22.967 4.864 18.856 18.856 0 0 1 .514 23.437 18.738 18.738 0 0 1-6.655 5.529 18.772 18.772 0 0 1-8.434 1.953Z",
5417
+ fill: "#D6DEE5"
5418
+ }), /*#__PURE__*/React.createElement("path", {
5419
+ d: "M129.021 45.14a16.719 16.719 0 0 1 10.373 3.604 16.67 16.67 0 0 1 5.887 9.258 16.65 16.65 0 0 1-1.144 10.906 16.687 16.687 0 0 1-7.681 7.838 16.724 16.724 0 0 1-10.896 1.38 16.704 16.704 0 0 1-9.398-5.675 16.657 16.657 0 0 1-.449-20.708 16.64 16.64 0 0 1 13.322-6.604h-.014Zm.014-4.417a21.143 21.143 0 0 0-13.684 5.01 21.066 21.066 0 0 0-4.43 26.958 21.12 21.12 0 0 0 11.363 9.113 21.153 21.153 0 0 0 14.569-.404 21.113 21.113 0 0 0 10.84-9.728 21.063 21.063 0 0 0 1.948-14.422 21.086 21.086 0 0 0-7.869-12.249 20.973 20.973 0 0 0-12.737-4.278Z",
5420
+ fill: "#1B64CE"
5421
+ }), /*#__PURE__*/React.createElement("path", {
5422
+ d: "M131.495 67.397c4.287 0 7.762-3.47 7.762-7.749 0-4.28-3.475-7.75-7.762-7.75-4.286 0-7.761 3.47-7.761 7.75 0 4.28 3.475 7.75 7.761 7.75Z",
5423
+ fill: "#fff"
5424
+ }), /*#__PURE__*/React.createElement("path", {
5425
+ d: "M137.039 56.638a3.996 3.996 0 0 0 3.999-3.993 3.996 3.996 0 0 0-3.999-3.992 3.996 3.996 0 0 0-3.999 3.992 3.996 3.996 0 0 0 3.999 3.993Z",
5426
+ fill: "#fff"
5427
+ }), /*#__PURE__*/React.createElement("mask", {
5428
+ id: `${id}-a`,
5429
+ style: {
5430
+ maskType: "alpha"
5431
+ },
5432
+ maskUnits: "userSpaceOnUse",
5433
+ x: "90",
5434
+ y: "96",
5435
+ width: "9",
5436
+ height: "4"
5437
+ }, /*#__PURE__*/React.createElement("path", {
5438
+ d: "M94.651 96.461c-1.785 0-3.26-.038-3.78-.038v2.897h7.14v-2.897c-.371 0-1.574.038-3.36.038Z",
5439
+ fill: "#000"
5440
+ })), /*#__PURE__*/React.createElement("g", {
5441
+ mask: `url(#${id}-a)`
5442
+ }, /*#__PURE__*/React.createElement("path", {
5443
+ d: "M94.51 95.545c-1.732.049-3.124.25-3.124.494v2.617c0 .245 1.392.446 3.124.495 1.731.049 3.124-.138 3.124-.384v-2.839c0-.245-1.393-.432-3.124-.383Z",
5444
+ fill: "#999"
5445
+ })));
4368
5446
  }
4369
5447
 
4370
- var styles$b = {"visuallyHidden":"visuallyHidden-S9VG5"};
5448
+ var styles$b = {"spinner":"spinner-b5tlz"};
5449
+
5450
+ function LoadingSpinner({
5451
+ size = 48,
5452
+ trackWidth = 6
5453
+ }) {
5454
+ return /*#__PURE__*/React.createElement("span", {
5455
+ "aria-hidden": "true",
5456
+ className: styles$b.spinner,
5457
+ style: {
5458
+ "--spinner-size": `${size}px`,
5459
+ "--spinner-track-width": `${trackWidth}px`
5460
+ }
5461
+ });
5462
+ }
4371
5463
 
4372
5464
  function SearchResults({
4373
5465
  label,
@@ -4388,18 +5480,33 @@ function SearchResults({
4388
5480
  ...navigation
4389
5481
  });
4390
5482
  }
4391
- return /*#__PURE__*/React.createElement("p", {
4392
- role: "status"
4393
- }, "Searching\u2026");
5483
+ return /*#__PURE__*/React.createElement(tapestry.Flex, {
5484
+ role: "status",
5485
+ justify: "center",
5486
+ align: "center",
5487
+ gap: 1,
5488
+ style: {
5489
+ color: "var(--t-text-color-placeholder)",
5490
+ fontSize: "var(--t-font-size-md)",
5491
+ marginTop: "var(--t-spacing-5)"
5492
+ }
5493
+ }, /*#__PURE__*/React.createElement(LoadingSpinner, {
5494
+ size: 28,
5495
+ trackWidth: 4
5496
+ }), "Searching\u2026");
4394
5497
  case "error":
4395
5498
  return /*#__PURE__*/React.createElement("p", {
5499
+ className: styles$d.message,
4396
5500
  role: "alert"
4397
5501
  }, "Search isn\u2019t working right now. Try again.");
4398
5502
  case "done":
4399
5503
  if (sections.length === 0) {
4400
- return /*#__PURE__*/React.createElement("p", {
4401
- role: "status"
4402
- }, "No results for \u201C", term.trim(), "\u201D");
5504
+ return /*#__PURE__*/React.createElement(BlankState$1, {
5505
+ image: /*#__PURE__*/React.createElement(BlankStateNoResults, null),
5506
+ role: "status",
5507
+ subtitle: "Clear search and try again.",
5508
+ title: `No results for “${term.trim()}”`
5509
+ });
4403
5510
  }
4404
5511
  return /*#__PURE__*/React.createElement(ResultListbox, {
4405
5512
  busy: false,
@@ -4414,27 +5521,37 @@ function SearchResults({
4414
5521
  // stays put as more recents load and as their lookups answer.
4415
5522
  const RECENTS = "recents";
4416
5523
  function SearchPanel({
5524
+ appName,
5525
+ mobile = false,
4417
5526
  env,
5527
+ onClose,
4418
5528
  products
4419
5529
  }) {
4420
5530
  var _a, _b;
4421
5531
  const listboxId = useInstanceId("product-search-results");
4422
5532
  const [term, setTerm] = React.useState("");
4423
- const [selectedSlug, setSelectedSlug] = React.useState(() => initialProduct(products).slug);
5533
+ const [selectedSlug, setSelectedSlug] = React.useState(() => defaultProduct(products, appName).slug);
4424
5534
  const product = (_a = products.find(({
4425
5535
  slug
4426
5536
  }) => slug === selectedSlug)) !== null && _a !== void 0 ? _a : products[0];
4427
5537
  const hasTerm = term.trim() !== "";
4428
5538
  const search = useProductSearch(product.slug, term);
4429
5539
  const groups = "groups" in search ? search.groups : undefined;
4430
- const sections = React.useMemo(() => groupSections(groups), [groups]);
5540
+ const {
5541
+ organizationTimeZone
5542
+ } = useStore();
5543
+ const sections = React.useMemo(() => groupSections(groups, organizationTimeZone), [groups, organizationTimeZone]);
4431
5544
  const {
4432
5545
  visits,
4433
5546
  ...recents
4434
5547
  } = useRecentVisits(env);
4435
- const recentItems = visits.map(visitItem);
5548
+ const recentItems = visits.map(visit => visitItem(visit, organizationTimeZone));
4436
5549
  const items = hasTerm ? sections.flatMap(section => section.items) : recentItems;
4437
- const navigation = useResultNavigation(items, hasTerm ? sections : RECENTS);
5550
+ // Phones open results by tapping them, with no highlight to arrow through.
5551
+ // A narrow window with a keyboard and mouse keeps both, as does the desktop
5552
+ // layout on a touch device, whose keyboard hints still advertise them.
5553
+ const touchOnly = useMediaQuery("(hover: none) and (pointer: coarse)");
5554
+ const navigation = useResultNavigation(items, hasTerm ? sections : RECENTS, !(mobile && touchOnly));
4438
5555
  const {
4439
5556
  highlightedIndex
4440
5557
  } = navigation;
@@ -4454,41 +5571,48 @@ function SearchPanel({
4454
5571
  navigation.handleKeyDown(event);
4455
5572
  }
4456
5573
  };
4457
- React.useEffect(() => {
4458
- if (hasTerm) saveLastProduct(product.slug);
4459
- }, [hasTerm, product.slug]);
5574
+ const results = hasTerm ? (/*#__PURE__*/React.createElement(SearchResults, {
5575
+ highlightedIndex: highlightedIndex,
5576
+ id: listboxId,
5577
+ label: `Results from Planning Center ${product.appName}`,
5578
+ onHighlight: navigation.highlightIndex,
5579
+ sections: sections,
5580
+ status: search.status,
5581
+ term: term
5582
+ })) : (/*#__PURE__*/React.createElement(RecentlyVisited, {
5583
+ highlightedIndex: highlightedIndex,
5584
+ id: listboxId,
5585
+ items: recentItems,
5586
+ onHighlight: navigation.highlightIndex,
5587
+ ...recents
5588
+ }));
4460
5589
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchInput, {
4461
5590
  expanded: items.length > 0,
4462
5591
  highlightedIndex: highlightedIndex,
4463
5592
  inputRef: inputRef,
4464
5593
  listboxId: listboxId,
4465
5594
  onChange: setTerm,
5595
+ onClose: onClose,
4466
5596
  onFocus: () => setAnnounceHighlight(false),
4467
5597
  onKeyDown: navigation.handleKeyDown,
4468
5598
  value: term
4469
- }), /*#__PURE__*/React.createElement(ProductTabs, {
5599
+ }), mobile ? (/*#__PURE__*/React.createElement(ProductSelect, {
5600
+ onSelect: setSelectedSlug,
5601
+ products: products,
5602
+ selected: product
5603
+ }, results)) : (/*#__PURE__*/React.createElement(ProductTabs, {
4470
5604
  onKeyDown: handleTabsKeyDown,
4471
5605
  onSelect: setSelectedSlug,
4472
5606
  products: products,
4473
5607
  selected: product
4474
- }, hasTerm ? (/*#__PURE__*/React.createElement(SearchResults, {
4475
- highlightedIndex: highlightedIndex,
4476
- id: listboxId,
4477
- label: `${product.appName} results`,
4478
- onHighlight: navigation.highlightIndex,
4479
- sections: sections,
4480
- status: search.status,
4481
- term: term
4482
- })) : (/*#__PURE__*/React.createElement(RecentlyVisited, {
4483
- highlightedIndex: highlightedIndex,
4484
- id: listboxId,
4485
- items: recentItems,
4486
- onHighlight: navigation.highlightIndex,
4487
- ...recents
4488
- }))), /*#__PURE__*/React.createElement("div", {
5608
+ }, results)), /*#__PURE__*/React.createElement("div", {
4489
5609
  "aria-live": "polite",
4490
- className: styles$b.visuallyHidden
4491
- }, announceHighlight ? (_b = navigation.highlighted) === null || _b === void 0 ? void 0 : _b.title : null), /*#__PURE__*/React.createElement(KeyboardHints, {
5610
+ className: styles$k.visuallyHidden
5611
+ }, announceHighlight ? (_b = navigation.highlighted) === null || _b === void 0 ? void 0 : _b.title : null), /*#__PURE__*/React.createElement("div", {
5612
+ "aria-live": "polite",
5613
+ className: styles$k.visuallyHidden,
5614
+ "data-testid": "result-count"
5615
+ }, hasTerm && search.status === "done" && items.length > 0 ? `${items.length} ${items.length === 1 ? "result" : "results"} for “${term.trim()}” in ${product.appName}` : null), mobile ? null : /*#__PURE__*/React.createElement(KeyboardHints, {
4492
5616
  copied: navigation.copied
4493
5617
  }));
4494
5618
  }
@@ -4559,32 +5683,6 @@ function useSearchShortcut(enabled, open, setOpen) {
4559
5683
  }, [enabled, open, setOpen]);
4560
5684
  }
4561
5685
 
4562
- const SEARCHABLE_PRODUCTS = [{
4563
- appName: "Calendar",
4564
- slug: "calendar"
4565
- }, {
4566
- appName: "Check-Ins",
4567
- slug: "check-ins"
4568
- }, {
4569
- appName: "Giving",
4570
- slug: "giving"
4571
- }, {
4572
- appName: "Groups",
4573
- slug: "groups"
4574
- }, {
4575
- appName: "People",
4576
- slug: "people"
4577
- }, {
4578
- appName: "Publishing",
4579
- slug: "publishing"
4580
- }, {
4581
- appName: "Registrations",
4582
- slug: "registrations"
4583
- }, {
4584
- appName: "Services",
4585
- slug: "services"
4586
- }];
4587
-
4588
5686
  const PERMISSION_CHECKS = {
4589
5687
  "check-ins": () => fetchMe("check-ins", "permission").then(({
4590
5688
  permission
@@ -4689,24 +5787,59 @@ function inSwitcherOrder(apps) {
4689
5787
  return groupApps(apps).restProducts.flatMap(app => SEARCHABLE_PRODUCTS.filter(product => product.appName === app.name));
4690
5788
  }
4691
5789
 
5790
+ /**
5791
+ * Writes the height of the visible part of the page to the parent of `ref`'s
5792
+ * element as `--visual-viewport-height`. It shrinks when an on-screen keyboard
5793
+ * opens; `100dvh` doesn't, since mobile Safari draws the keyboard over it.
5794
+ */
5795
+ function useVisualViewportHeight(ref, enabled) {
5796
+ React.useEffect(() => {
5797
+ var _a;
5798
+ const viewport = window.visualViewport;
5799
+ const parent = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.parentElement;
5800
+ if (!enabled || !viewport || !parent) return undefined;
5801
+ const update = () => parent.style.setProperty("--visual-viewport-height", `${viewport.height}px`);
5802
+ update();
5803
+ viewport.addEventListener("resize", update);
5804
+ return () => {
5805
+ viewport.removeEventListener("resize", update);
5806
+ parent.style.removeProperty("--visual-viewport-height");
5807
+ };
5808
+ }, [enabled, ref]);
5809
+ }
5810
+
4692
5811
  function ProductSearch({
5812
+ appName,
4693
5813
  apps,
5814
+ mobile = false,
4694
5815
  env
4695
5816
  }) {
4696
5817
  const searchable = useSearchableProducts(apps);
4697
5818
  const [open, setOpen] = React.useState(false);
5819
+ const modalRef = React.useRef(null);
5820
+ // Sizes Tapestry's modal frame, the dialog's parent, to fit above the keyboard.
5821
+ useVisualViewportHeight(modalRef, mobile && open);
4698
5822
  const available = searchable.status === "done" && searchable.products.length > 0;
4699
5823
  useSearchShortcut(available, open, setOpen);
4700
5824
  if (!available) return null;
4701
5825
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchButton, {
5826
+ mobile: mobile,
4702
5827
  onClick: () => setOpen(true)
4703
5828
  }), /*#__PURE__*/React.createElement(tapestry.Modal, {
4704
5829
  "aria-label": "Search",
5830
+ className: styles$k.modal,
4705
5831
  dismissible: true,
5832
+ id: "product_search_modal",
4706
5833
  onClose: () => setOpen(false),
4707
- open: open
5834
+ open: open,
5835
+ ref: modalRef,
5836
+ size: "lg"
4708
5837
  }, /*#__PURE__*/React.createElement(SearchPanel, {
5838
+ appName: appName,
5839
+ mobile: mobile,
4709
5840
  env: env,
5841
+ // Phones have no Esc, so mobile search gets a close button.
5842
+ onClose: mobile ? () => setOpen(false) : undefined,
4710
5843
  products: searchable.products
4711
5844
  })));
4712
5845
  }
@@ -5000,6 +6133,7 @@ const NotSmallTopbar = ({
5000
6133
  margin: "auto"
5001
6134
  }
5002
6135
  }), !notificationsEnabled && notifications(), productSearchEnabled ? (/*#__PURE__*/React.createElement(ProductSearch, {
6136
+ appName: props.appName,
5003
6137
  apps: props.apps,
5004
6138
  env: props.env
5005
6139
  })) : search({
@@ -32914,7 +34048,7 @@ ClientStorage.defaultProps = {
32914
34048
  method: "localStorage"
32915
34049
  };
32916
34050
 
32917
- var styles$6 = {"appmenu-button":"appmenu-button-b0UvT","appmenu-layer":"appmenu-layer-0IQpN","appmenu-container":"appmenu-container-gackd","appmenu-scroll":"appmenu-scroll-mPSx0","appmenu-list":"appmenu-list-h7clX","appmenu-list-a":"appmenu-list-a-rGIQN","appmenu-list-a--top":"appmenu-list-a--top-RT-2F","appmenu-list-a--bottom":"appmenu-list-a--bottom-YDeBC","appmenu-close-button":"appmenu-close-button-vv9bV","current-route":"current-route-wpJgz","is-active":"is-active-wy8Bg","routes":"routes-Nmt1S","route":"route-kkknQ","profile-button":"profile-button-a2WO2"};
34051
+ var styles$6 = {"appmenu-button":"appmenu-button-b0UvT","appmenu-layer":"appmenu-layer-0IQpN","appmenu-container":"appmenu-container-gackd","appmenu-scroll":"appmenu-scroll-mPSx0","appmenu-list":"appmenu-list-h7clX","appmenu-list-a":"appmenu-list-a-rGIQN","appmenu-list-a--top":"appmenu-list-a--top-RT-2F","appmenu-list-a--bottom":"appmenu-list-a--bottom-YDeBC","appmenu-close-button":"appmenu-close-button-vv9bV","current-route":"current-route-wpJgz","is-active":"is-active-wy8Bg","routes":"routes-Nmt1S","route":"route-kkknQ","actions":"actions-INQ7-","profile-button":"profile-button-a2WO2"};
32918
34052
 
32919
34053
  function AccountSettingsLink({
32920
34054
  env
@@ -33134,7 +34268,14 @@ const SmallTopbar = ({
33134
34268
  setProductSwitcherVisible(false);
33135
34269
  setRoutesMenuVisible(visible => !visible);
33136
34270
  } : null
33137
- }, /*#__PURE__*/React.createElement(CurrentRouteComponent, null, capitalize$1(currentRouteText)), props.routes.length > 0 && /*#__PURE__*/React.createElement(DisclosureChevronIcon, null)), /*#__PURE__*/React.createElement("button", {
34271
+ }, /*#__PURE__*/React.createElement(CurrentRouteComponent, null, capitalize$1(currentRouteText)), props.routes.length > 0 && /*#__PURE__*/React.createElement(DisclosureChevronIcon, null)), /*#__PURE__*/React.createElement("div", {
34272
+ className: styles$6["actions"]
34273
+ }, productSearchEnabled && (/*#__PURE__*/React.createElement(ProductSearch, {
34274
+ appName: props.appName,
34275
+ apps: props.apps,
34276
+ mobile: true,
34277
+ env: props.env
34278
+ })), /*#__PURE__*/React.createElement("button", {
33138
34279
  type: "button",
33139
34280
  className: styles$6["profile-button"],
33140
34281
  onClick: () => {
@@ -33145,7 +34286,7 @@ const SmallTopbar = ({
33145
34286
  }, /*#__PURE__*/React.createElement(Avatar, {
33146
34287
  env: props.env,
33147
34288
  url: props.userAvatarPath
33148
- })));
34289
+ }))));
33149
34290
  };
33150
34291
  const SmallRoute = ({
33151
34292
  active,
@@ -33635,38 +34776,6 @@ const SwitchView = ({
33635
34776
  }));
33636
34777
  };
33637
34778
 
33638
- const collections = {
33639
- general: general__namespace,
33640
- toolbar: toolbar__namespace
33641
- };
33642
- const paths = collections;
33643
- function Icon({
33644
- name,
33645
- size = 16,
33646
- style,
33647
- theme,
33648
- title,
33649
- ...props
33650
- }) {
33651
- const [collection, symbol] = name.split(".");
33652
- return /*#__PURE__*/React.createElement("svg", {
33653
- "aria-hidden": title ? undefined : true,
33654
- fill: "currentColor",
33655
- height: size,
33656
- role: title ? "img" : undefined,
33657
- style: {
33658
- color: theme && `var(${theme})`,
33659
- flexShrink: 0,
33660
- ...style
33661
- },
33662
- viewBox: "0 0 16 16",
33663
- width: size,
33664
- ...props
33665
- }, title && /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("path", {
33666
- d: paths[collection][symbol]
33667
- }));
33668
- }
33669
-
33670
34779
  var styles$3 = {"color-mode-switcher":"color-mode-switcher-JpczO","color-mode-switcher-label":"color-mode-switcher-label-3jPM2","color-mode-switcher-modes":"color-mode-switcher-modes-u-bic"};
33671
34780
 
33672
34781
  const COLOR_MODES = [{
@@ -34451,7 +35560,8 @@ function AskAIButton({
34451
35560
  onClick: () => onClick(),
34452
35561
  type: "button"
34453
35562
  }, /*#__PURE__*/React.createElement(SparkleIcon, {
34454
- className: styles.sparkle
35563
+ className: styles.sparkle,
35564
+ fill: "currentColor"
34455
35565
  }), /*#__PURE__*/React.createElement("span", {
34456
35566
  className: styles.label
34457
35567
  }, text));
@@ -34640,6 +35750,9 @@ function createPicobotIframe(picobotOrigin, {
34640
35750
  // Contact support) and picobot's own NEW_ROUTE_RENDERED reports—so it
34641
35751
  // always reflects the live conversation. See buildPicobotSrc.
34642
35752
  const [loadedPath, setLoadedPath] = React.useState(iframePath || "");
35753
+ // Hidden until picobot paints so its blank first frame doesn't flash
35754
+ // white against the drawer in dark mode.
35755
+ const [isReady, setIsReady] = React.useState(false);
34643
35756
  const hasReportedErrorRef = React.useRef(false);
34644
35757
  const loadTimeoutRef = React.useRef();
34645
35758
  const reportLoadError = React.useCallback(() => {
@@ -34667,7 +35780,10 @@ function createPicobotIframe(picobotOrigin, {
34667
35780
  setLoadedPath(reportedPath);
34668
35781
  onIframeChangePath(reportedPath);
34669
35782
  }
34670
- if (((_c = e.data) === null || _c === void 0 ? void 0 : _c.type) === "READY") clearTimeout(loadTimeoutRef.current);
35783
+ if (((_c = e.data) === null || _c === void 0 ? void 0 : _c.type) === "READY") {
35784
+ clearTimeout(loadTimeoutRef.current);
35785
+ setIsReady(true);
35786
+ }
34671
35787
  if (onMessage) onMessage(e.data);
34672
35788
  }
34673
35789
  window.addEventListener("message", handleGuestMessage);
@@ -34677,12 +35793,15 @@ function createPicobotIframe(picobotOrigin, {
34677
35793
  setLoadedPath(iframePath || "");
34678
35794
  }, [iframePath]);
34679
35795
  // A one-way channel for sending messages to picobot. Topbar just
34680
- // forwards the envelope to the iframe and holds no message semantics of
34681
- // its own—the consumer decides what to send and when.
35796
+ // forwards the envelope to the iframe—the consumer decides what to send
35797
+ // and when. The one exception is PANE_VISIBLE: Safari ignores focus()
35798
+ // from inside a cross-origin iframe, so the host has to focus the iframe
35799
+ // before picobot can focus its composer.
34682
35800
  React.useImperativeHandle(ref, () => ({
34683
35801
  postMessage(message) {
34684
- var _a, _b;
34685
- (_b = (_a = iframeRef.current) === null || _a === void 0 ? void 0 : _a.contentWindow) === null || _b === void 0 ? void 0 : _b.postMessage(message, picobotOrigin);
35802
+ var _a, _b, _c;
35803
+ if (message.type === "PANE_VISIBLE") (_a = iframeRef.current) === null || _a === void 0 ? void 0 : _a.focus();
35804
+ (_c = (_b = iframeRef.current) === null || _b === void 0 ? void 0 : _b.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage(message, picobotOrigin);
34686
35805
  }
34687
35806
  }), []);
34688
35807
  const iframeSrc = buildPicobotSrc(picobotOrigin, loadedPath, {
@@ -34696,6 +35815,7 @@ function createPicobotIframe(picobotOrigin, {
34696
35815
  border: 0,
34697
35816
  flex: 1,
34698
35817
  height: "100%",
35818
+ visibility: isReady ? undefined : "hidden",
34699
35819
  width: "100%"
34700
35820
  },
34701
35821
  title: "Picobot"
@@ -35424,6 +36544,7 @@ function PicobotComponent({
35424
36544
  closeDrawer,
35425
36545
  currentPath,
35426
36546
  env,
36547
+ isOpen,
35427
36548
  onChangePath,
35428
36549
  openTool,
35429
36550
  pending
@@ -35468,6 +36589,17 @@ function PicobotComponent({
35468
36589
  }
35469
36590
  clearPending();
35470
36591
  }, [pending, isPicobotReady, clearPending]);
36592
+ // The drawer keeps the iframe mounted while it's closed, so picobot's
36593
+ // autofocus is spent by the time the panel reopens. READY gates the signal
36594
+ // because picobot has no listener before it.
36595
+ React.useEffect(function tellPicobotThePanelIsVisible() {
36596
+ var _a;
36597
+ if (isOpen && isPicobotReady) {
36598
+ (_a = picobotRef.current) === null || _a === void 0 ? void 0 : _a.postMessage({
36599
+ type: "PANE_VISIBLE"
36600
+ });
36601
+ }
36602
+ }, [isOpen, isPicobotReady]);
35471
36603
  const [iframeErrored, setIframeErrored] = React.useState(false);
35472
36604
  const [mountKey, setMountKey] = React.useState(0);
35473
36605
  const handleRetry = React.useCallback(() => {
@@ -35984,6 +37116,11 @@ const Profile = {
35984
37116
  };
35985
37117
 
35986
37118
  const DURATION = 100;
37119
+ const TOOLBAR_DRAWER_CHANGE_EVENT = "topbar:toolbar-drawer-change";
37120
+ const CLOSED_TOOLBAR_DRAWER = {
37121
+ open: false,
37122
+ tool: null
37123
+ };
35987
37124
  // Exempt paths match regardless of query, so `email?conversationId=…` is
35988
37125
  // exempt along with `email`.
35989
37126
  function isToolPathExemptFromStorage(toolName, path) {
@@ -36097,6 +37234,27 @@ function Toolbar({
36097
37234
  delete window.openHelpdesk; /* TODO: Remove when products have migrated to window.topbar.openHelpdesk */
36098
37235
  };
36099
37236
  }, [Profile, openHelpdeskAtRoot]);
37237
+ const toolbarDrawerTool = open && currentContent ? currentContent.name.toLowerCase() : null;
37238
+ const lastToolbarDrawer = React.useRef(CLOSED_TOOLBAR_DRAWER);
37239
+ React.useEffect(() => {
37240
+ const toolbarDrawer = {
37241
+ open,
37242
+ tool: toolbarDrawerTool
37243
+ };
37244
+ window.topbar = window.topbar || {};
37245
+ window.topbar.toolbarDrawer = toolbarDrawer;
37246
+ const last = lastToolbarDrawer.current;
37247
+ if (last.open !== toolbarDrawer.open || last.tool !== toolbarDrawer.tool) {
37248
+ lastToolbarDrawer.current = toolbarDrawer;
37249
+ window.dispatchEvent(new CustomEvent(TOOLBAR_DRAWER_CHANGE_EVENT, {
37250
+ detail: toolbarDrawer
37251
+ }));
37252
+ }
37253
+ return () => {
37254
+ var _a;
37255
+ (_a = window.topbar) === null || _a === void 0 ? true : delete _a.toolbarDrawer;
37256
+ };
37257
+ }, [open, toolbarDrawerTool]);
36100
37258
  const loginSettingsUrl = getLoginProfilePath({
36101
37259
  appName: appName.replace(/[\s-]/, ""),
36102
37260
  env: env,