@the-portland-company/shell 0.93.0 → 0.94.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.
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { S as StandardNavIconKey, h as NavIcon, N as NavItem, i as NavBreadcrumb, j as StandardNavMode, k as NavLinkComponent, l as NavChromeFetcher, m as NavMode, o as NavUserMenu, p as NavOrgOption, d as NotificationsAdapter, q as NavFooterLink, s as NavFooter, t as NavDisplayMode } from './index-BAFJZuRA.cjs';
3
+ import { S as StandardNavIconKey, k as NavIcon, N as NavItem, l as NavBreadcrumb, m as StandardNavMode, o as NavLinkComponent, p as NavChromeFetcher, q as NavMode, s as NavUserMenu, t as NavOrgOption, f as NotificationsAdapter, u as NavFooterLink, v as NavFooter, w as NavDisplayMode } from './index-ByUbBbta.cjs';
4
4
  import './theme-preference.cjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { S as StandardNavIconKey, h as NavIcon, N as NavItem, i as NavBreadcrumb, j as StandardNavMode, k as NavLinkComponent, l as NavChromeFetcher, m as NavMode, o as NavUserMenu, p as NavOrgOption, d as NotificationsAdapter, q as NavFooterLink, s as NavFooter, t as NavDisplayMode } from './index-DoSs3sQY.js';
3
+ import { S as StandardNavIconKey, k as NavIcon, N as NavItem, l as NavBreadcrumb, m as StandardNavMode, o as NavLinkComponent, p as NavChromeFetcher, q as NavMode, s as NavUserMenu, t as NavOrgOption, f as NotificationsAdapter, u as NavFooterLink, v as NavFooter, w as NavDisplayMode } from './index-PRu56mmW.js';
4
4
  import './theme-preference.js';
5
5
 
6
6
  /**
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { broadcastLogout, watchLogout } from './chunk-LL6LSJAH.js';
3
3
  import { writeUrlState } from './chunk-GVQKZI5X.js';
4
- import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell } from './chunk-EN5ANFMB.js';
5
- export { standardNavIcons } from './chunk-EN5ANFMB.js';
6
- import { warnDeprecated, NavChromeProvider, TopBarWidgetSlot, FuelAction, SpecOverlayAction, NotificationsAction, SupportAction, useChromeMe, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-Y66PVCZO.js';
4
+ import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell } from './chunk-MCMD4WR6.js';
5
+ export { standardNavIcons } from './chunk-MCMD4WR6.js';
6
+ import { warnDeprecated, NavChromeProvider, TopBarWidgetSlot, FuelAction, SpecOverlayAction, NotificationsAction, SupportAction, useChromeMe, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-JQ53VZO5.js';
7
7
  import './chunk-BHRVZPZ7.js';
8
8
  import { NAV_DISPLAY_DEFAULT, resolveNavDisplay, writeNavDisplayLocal, writeNavDisplayCookie, isNavDisplayPreference, NAV_DISPLAY_STORAGE_KEY, readNavDisplayCookie } from './chunk-7YVJ7HQG.js';
9
9
  import { authBaseUrl, orgIdTail, settingsBaseUrl, ORG_ID_QUERY_PARAM, readOrgSelectorFromUrl, matchOrgSelector, syncOrgIdInUrl, isOrgId, switchActiveOrg, ACTIVE_ORG_QUERY_PARAM, writeActiveOrgCookie, resolveActiveOrg, readActiveOrgCookie } from './chunk-5LO5W7W5.js';
@@ -27,6 +27,71 @@ function Card({
27
27
  }
28
28
  );
29
29
  }
30
+ var SETTINGS_ORIGIN = "https://settings.politogyvrm.com";
31
+ var WALLET_PATH = "/organization-settings/subscription-billing/wallet";
32
+ function aiCreditsWalletUrl(orgId) {
33
+ const url = new URL(WALLET_PATH, SETTINGS_ORIGIN);
34
+ if (orgId) url.searchParams.set("org", orgId);
35
+ return url.toString();
36
+ }
37
+ var AI_CREDITS_STATE_TITLES = {
38
+ out: "Out of AI Credits",
39
+ paused: "Paused \u2014 out of AI Credits",
40
+ waiting: "Waiting for AI Credits"
41
+ };
42
+ var MUTED = { color: "var(--color-text-muted, #6b7280)" };
43
+ var BUTTON = {
44
+ display: "inline-block",
45
+ borderRadius: 6,
46
+ padding: "6px 12px",
47
+ fontSize: 12,
48
+ fontWeight: 600,
49
+ textDecoration: "none"
50
+ };
51
+ var PRIMARY = { ...BUTTON, background: "var(--color-text, #2F3136)", color: "#fff" };
52
+ var SECONDARY = {
53
+ ...BUTTON,
54
+ border: "1px solid var(--color-border, #e5e7eb)",
55
+ color: "var(--color-text, #2F3136)"
56
+ };
57
+ var defaultFormat = (at) => at.toLocaleString(void 0, { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" });
58
+ function detail(kind, lastOutputAt, format) {
59
+ if (kind === "paused") return lastOutputAt ? `Last updated ${format(lastOutputAt)}.` : "Nothing has been generated yet.";
60
+ if (kind === "waiting") return "This step is kept and starts on its own once AI Credits are added.";
61
+ return null;
62
+ }
63
+ function AiCreditsState({
64
+ kind,
65
+ orgId,
66
+ isAccountAdmin,
67
+ lastOutputAt,
68
+ onCheckAgain,
69
+ formatTime = defaultFormat,
70
+ className,
71
+ style
72
+ }) {
73
+ const at = lastOutputAt == null ? null : lastOutputAt instanceof Date ? lastOutputAt : new Date(lastOutputAt);
74
+ const last = at && !Number.isNaN(at.getTime()) ? at : null;
75
+ const text = detail(kind, last, formatTime);
76
+ const wallet = aiCreditsWalletUrl(orgId);
77
+ return /* @__PURE__ */ jsxs("div", { role: "status", "data-ai-credits-state": kind, className, style: { fontSize: 14, ...style }, children: [
78
+ /* @__PURE__ */ jsx("p", { style: { margin: 0, fontWeight: 600 }, children: AI_CREDITS_STATE_TITLES[kind] }),
79
+ text && /* @__PURE__ */ jsx("p", { style: { margin: "4px 0 0", ...MUTED }, children: text }),
80
+ isAccountAdmin ? /* @__PURE__ */ jsxs("div", { style: { marginTop: 8, display: "flex", flexWrap: "wrap", gap: 8 }, children: [
81
+ /* @__PURE__ */ jsx("a", { href: wallet, style: PRIMARY, children: "Buy AI Credits" }),
82
+ /* @__PURE__ */ jsx("a", { href: wallet, style: SECONDARY, children: "Turn on auto top-off" })
83
+ ] }) : /* @__PURE__ */ jsx("p", { style: { margin: "4px 0 0", ...MUTED }, children: "Ask an Account Admin to add AI Credits." }),
84
+ onCheckAgain && /* @__PURE__ */ jsx(
85
+ "button",
86
+ {
87
+ type: "button",
88
+ onClick: onCheckAgain,
89
+ style: { marginTop: 8, padding: 0, border: 0, background: "none", fontSize: 12, textDecoration: "underline", cursor: "pointer", ...MUTED },
90
+ children: "Check again"
91
+ }
92
+ )
93
+ ] });
94
+ }
30
95
  function FormColumn({ children, className }) {
31
96
  return /* @__PURE__ */ jsx("div", { "data-shell-form-column": "", className: clsx2("w-full max-w-[960px]", className), children });
32
97
  }
@@ -2381,6 +2446,6 @@ function BreadcrumbBarView({
2381
2446
  );
2382
2447
  }
2383
2448
 
2384
- export { BreadcrumbBarView, CORE_APP_ORIGIN, CORE_BILLING_PATH, CREDIT_TYPE_LABELS, CREDIT_TYPE_ORDER, Card, CreditsAction, FormColumn, FuelAction, HeaderTabBar, KNOWN_TAB_GLYPHS, NAV_DISPLAY_OPTIONS, NavChromeProvider, NavDisplayAction, NavThemeControl, NotificationsAction, PageHeaderView, SPECS_ORIGIN, SpecOverlayAction, SpeculationRulesScript, SupportAction, TOPBAR_GLYPH_SIZE, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, creditGaugeRatio, creditStateWord, creditTooltipLine, creditsAriaLabel, creditsIconState, emptyNotificationsFeed, normalizeNotificationsFeed, resolveBrandGlyph, resolveOrgLogoUrl, resolveTabGlyph, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeDedupedFetch, useNavChromeFetcher, useThemePreference, useTopBarIconSlotGlyph, warnDeprecated };
2385
- //# sourceMappingURL=chunk-Y66PVCZO.js.map
2386
- //# sourceMappingURL=chunk-Y66PVCZO.js.map
2449
+ export { AI_CREDITS_STATE_TITLES, AiCreditsState, BreadcrumbBarView, CORE_APP_ORIGIN, CORE_BILLING_PATH, CREDIT_TYPE_LABELS, CREDIT_TYPE_ORDER, Card, CreditsAction, FormColumn, FuelAction, HeaderTabBar, KNOWN_TAB_GLYPHS, NAV_DISPLAY_OPTIONS, NavChromeProvider, NavDisplayAction, NavThemeControl, NotificationsAction, PageHeaderView, SPECS_ORIGIN, SpecOverlayAction, SpeculationRulesScript, SupportAction, TOPBAR_GLYPH_SIZE, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, aiCreditsWalletUrl, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, creditGaugeRatio, creditStateWord, creditTooltipLine, creditsAriaLabel, creditsIconState, emptyNotificationsFeed, normalizeNotificationsFeed, resolveBrandGlyph, resolveOrgLogoUrl, resolveTabGlyph, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeDedupedFetch, useNavChromeFetcher, useThemePreference, useTopBarIconSlotGlyph, warnDeprecated };
2450
+ //# sourceMappingURL=chunk-JQ53VZO5.js.map
2451
+ //# sourceMappingURL=chunk-JQ53VZO5.js.map